Skip to content

Commit 16365d6

Browse files
committed
examples, docs: repoint artifacts and prose at the renamed worker example
The artifacts example clones this repo and copies EXAMPLE_PATH into the workspace at runtime; it still pointed at examples/worker, which the rename moved to examples/worker-shell, so the copy would fail once the rename landed. Update EXAMPLE_PATH and the surrounding prose, the root README link, AGENTS.md, and the artifacts example's own README, package.json, and wrangler.jsonc.
1 parent 7ec3962 commit 16365d6

6 files changed

Lines changed: 8 additions & 8 deletions

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,6 @@ file and add it to the list above.
173173
backed tests only run on Linux and are skipped elsewhere
174174
automatically.
175175
- **Examples are real consumers.** `examples/think`,
176-
`examples/container`, and `examples/worker` exercise the public
176+
`examples/container`, and `examples/worker-shell` exercise the public
177177
surface. If you change a public API, update them in the same
178178
change.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ To see the pieces working together, start with the examples:
5959
- [`examples/container`](examples/container) — runs `computerd` inside a
6060
container, mounts a workspace, and talks to a Durable Object over
6161
capnweb.
62-
- [`examples/worker`](examples/worker) — same HTTP surface as the
62+
- [`examples/worker-shell`](examples/worker-shell) — same HTTP surface as the
6363
container example, but the shell runs in a Dynamic Worker loaded
6464
through `env.LOADER`. No container.
6565
- [`examples/think`](examples/think) — an agent that uses the

examples/artifacts/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ The Worker endpoint owns the orchestration. The durable object stays minimal: it
3535
`POST /create` does the following through `ws.runtime.exec(...)`:
3636

3737
1. clones `https://github.com/cloudflare/computer` into `/workspace/<name>-source`;
38-
2. copies `/workspace/<name>-source/examples/worker` to `/workspace/<name>`;
38+
2. copies `/workspace/<name>-source/examples/worker-shell` to `/workspace/<name>`;
3939
3. rewrites the copied Worker name with `sed`;
4040
4. initializes and commits the generated project with the shell `git` command;
4141
5. runs `artifacts create <name> --remote origin --force` — one command that creates the session-scoped Artifact repo, mints a write token, and registers the credentialed remote as `origin`;

examples/artifacts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.0",
44
"private": true,
55
"type": "module",
6-
"description": "Example Worker that turns examples/worker into a cloneable Cloudflare Artifacts repo through @cloudflare/computer.",
6+
"description": "Example Worker that turns examples/worker-shell into a cloneable Cloudflare Artifacts repo through @cloudflare/computer.",
77
"scripts": {
88
"dev": "wrangler dev",
99
"deploy": "wrangler deploy",

examples/artifacts/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Minimal Artifacts example.
22
//
33
// POST /create { "name": "my-worker" } builds a fresh copy of
4-
// examples/worker, rewrites its Worker name, publishes it to a new
4+
// examples/worker-shell, rewrites its Worker name, publishes it to a new
55
// Cloudflare Artifacts repo, and returns a read-only clone URL.
66
// The Worker owns the endpoint logic. The durable object stays
77
// minimal: it constructs the Workspace with `this` so the Worker can
@@ -48,7 +48,7 @@ interface ArtifactCreateOutput {
4848

4949
const WORKSPACE_ROOT = "/workspace";
5050
const SOURCE_REPO = "https://github.com/cloudflare/computer";
51-
const EXAMPLE_PATH = "examples/worker";
51+
const EXAMPLE_PATH = "examples/worker-shell";
5252
const GIT_REMOTE = "origin";
5353
const SHARE_TOKEN_TTL = "24h";
5454

@@ -87,7 +87,7 @@ export default {
8787
" -H 'content-type: application/json' \\",
8888
' -d \'{"name":"my-worker"}\'',
8989
"",
90-
"Builds examples/worker in a Workspace and pushes it to a",
90+
"Builds examples/worker-shell in a Workspace and pushes it to a",
9191
"new Cloudflare Artifacts repo.",
9292
].join("\n"),
9393
{ headers: { "content-type": "text/plain; charset=utf-8" } },

examples/artifacts/wrangler.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
// Artifacts example. POST /create { "name": "my-worker" }
3-
// generates examples/worker in a Workspace and publishes it to a
3+
// generates examples/worker-shell in a Workspace and publishes it to a
44
// Cloudflare Artifacts repo.
55
"$schema": "node_modules/wrangler/config-schema.json",
66
"name": "computer-artifacts-example",

0 commit comments

Comments
 (0)