@fungi.computer/oyster 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/README.md +30 -15
  2. package/dist/agents.js +2 -1
  3. package/dist/approval-home.js +4 -2
  4. package/dist/boot-host-script.js +1 -1
  5. package/dist/browser/cdp-client.d.ts +1 -1
  6. package/dist/browser/cdp-client.js +73 -37
  7. package/dist/browser/errors.d.ts +2 -0
  8. package/dist/browser/lease-registry.d.ts +5 -1
  9. package/dist/browser/lease-registry.js +2 -6
  10. package/dist/build/candidate-cli.mjs +267 -246
  11. package/dist/build/definition-emission.js +17 -3
  12. package/dist/build/local-build.d.ts +6 -0
  13. package/dist/build/local-build.js +104 -91
  14. package/dist/build/process-group.d.ts +6 -0
  15. package/dist/build/process-group.js +92 -0
  16. package/dist/build.d.ts +1 -1
  17. package/dist/build.js +1 -1
  18. package/dist/embed-metafiles.js +2 -2
  19. package/dist/embed-scripts.js +1 -1
  20. package/dist/git-journal.js +12 -9
  21. package/dist/hello-app-script.js +1 -1
  22. package/dist/host-page-assets.js +1 -1
  23. package/dist/host-page.d.ts +6 -1
  24. package/dist/host-page.js +40 -0
  25. package/dist/host.js +24 -9
  26. package/dist/installation-operations.js +1 -1
  27. package/dist/machine-link/host.js +18 -13
  28. package/dist/pack.d.ts +3 -1
  29. package/dist/pack.js +28 -7
  30. package/dist/page/app-permissions.js +3 -13
  31. package/dist/page-script.js +2 -2
  32. package/dist/standalone/agent-mail.d.ts +38 -11
  33. package/dist/standalone/agent-mail.js +8 -22
  34. package/dist/standalone/agents.d.ts +1 -0
  35. package/dist/standalone/agents.js +30 -5
  36. package/dist/standalone/hello-app.d.ts +4 -1
  37. package/dist/standalone/hello-app.js +67 -22
  38. package/dist/standalone/hello-lesson.d.ts +2 -0
  39. package/dist/standalone/hello-lesson.js +36 -0
  40. package/dist/standalone/local-desktop.d.ts +6 -4
  41. package/dist/standalone/local-desktop.js +39 -20
  42. package/dist/standalone/sign-in-link.d.ts +2 -1
  43. package/dist/standalone/sign-in-link.js +58 -17
  44. package/dist/standalone/try-cli.d.ts +12 -9
  45. package/dist/standalone/try-cli.js +490 -138
  46. package/docs/api/browser.md +24 -7
  47. package/docs/api/pack.md +3 -2
  48. package/docs/api/workers-git.md +2 -2
  49. package/docs/api/workers.md +2 -2
  50. package/docs/site/agent-quickstart.mdx +109 -354
  51. package/examples/standalone/wrangler.jsonc +1 -1
  52. package/package.json +24 -24
package/README.md CHANGED
@@ -940,21 +940,36 @@ unpinned Agent refuses. A stale revision returns 409, an unknown Agent returns
940
940
 
941
941
  ### Connect an Agent to a remote MCP server
942
942
 
943
- The owner connects any Streamable HTTP MCP server to one Agent. The Agent's
944
- codemode then sees its tools as `env.mcp.<name>.<tool>()`, beside the installed
945
- Apps; Knapsack's `mcpServers` connection owns the client. On a standalone Oyster
946
- the Agent's own Durable Object keeps the endpoint and an optional bearer token,
947
- and no route returns the token.
948
-
949
- `GET /api/agent-mcp-servers` lists every Agent with its servers (`serverId`,
950
- `name`, `url`, `hasBearer`). `POST /api/agent-mcp-servers/:agentId` with
951
- `{"name":"linear","url":"https://mcp.example.com/mcp","bearer":null}` connects
952
- one; the name is lowercase letters, digits and `_`, and the endpoint must be
953
- `https:` with no credentials or fragment. A repeated name or more than 16
954
- servers returns 409. `DELETE /api/agent-mcp-servers/:agentId/:serverId`
955
- disconnects one. These routes are owner-direct and reject an App installation
956
- header. A server that is down or refuses the token is left out of that run and
957
- the others stay available. OAuth sign-in is not offered yet.
943
+ Connect a Streamable HTTP MCP server once, then choose which Agents can use it.
944
+ Each Agent's codemode sees its granted tools as `env.mcp.<name>.<tool>()`,
945
+ beside the installed Apps. Oyster keeps credentials sealed on the owner side.
946
+ Agents receive access without receiving tokens, and the API never returns stored
947
+ secrets.
948
+
949
+ `GET /api/connections` returns the shared connections, their Agent grants, the
950
+ available Agents and the OAuth `callbackUrl`. Create a connection with
951
+ `POST /api/connections` and
952
+ `{"name":"linear","url":"https://mcp.example.com/mcp","bearer":null}`. The name
953
+ starts with a lowercase letter and contains up to 32 lowercase letters, digits
954
+ or `_`. The endpoint must be `https:` with no credentials or fragment.
955
+
956
+ Use `bearer:null` for an unauthenticated server, or set `bearer` to its static
957
+ token. For OAuth, keep `bearer:null` and add `oauth:{}`. You can provide
958
+ `clientId`, `clientSecret` and `scope` inside `oauth` when needed. Without a
959
+ client ID, Oyster uses the server's dynamic client registration. The response
960
+ contains `connectionId` and `authorizeUrl`. For OAuth, open `authorizeUrl` in
961
+ your signed-in owner browser to finish connecting. If you register your own
962
+ OAuth client, use the `callbackUrl` returned by `GET /api/connections`.
963
+
964
+ A new connection grants no Agent access. Send
965
+ `PUT /api/connections/:connectionId/agents/:agentId` with `{"access":"read"}`,
966
+ `{"access":"all"}` or `{"access":["tool_name"]}` to grant or change access.
967
+ `GET /api/connections/:connectionId/tools` lists the available tool names.
968
+ `DELETE` on the Agent grant path removes only that Agent's access.
969
+ `DELETE /api/connections/:connectionId` revokes the shared connection for every
970
+ Agent. A repeated connection name or a grant beyond 16 connections per Agent
971
+ returns 409. These routes are owner-direct and reject an App installation
972
+ header.
958
973
 
959
974
  ### Give an Agent a browser
960
975
 
package/dist/agents.js CHANGED
@@ -241,7 +241,8 @@ function createAgentRoutes(agents) {
241
241
  const incoming = context.req.raw;
242
242
  const url = new URL(incoming.url);
243
243
  const path = url.pathname.slice(`/agents/${agentId}`.length);
244
- if (!(path === "/acp" ||
244
+ if (!((path === "/models" && incoming.method === "GET") ||
245
+ path === "/acp" ||
245
246
  path === "/sessions" ||
246
247
  path.startsWith("/sessions/") ||
247
248
  path.startsWith("/browser/")))
@@ -31,8 +31,10 @@ export class OysterApprovalHome {
31
31
  this.host = host;
32
32
  host.owner.sql.exec("CREATE TABLE IF NOT EXISTS oyster_approval_targets (record_id TEXT PRIMARY KEY, target_json TEXT NOT NULL) STRICT");
33
33
  this.ledger = this.createLedger();
34
- // A new native home represents boot, not a live per-call ledger facade.
35
- this.ledger.recoverClaims();
34
+ // A new native home represents boot, before any live call can claim work.
35
+ while (this.ledger.recoverClaims().length > 0) {
36
+ // Each bounded batch settles part of the finite orphan set.
37
+ }
36
38
  }
37
39
  createLedger(persistIntent) {
38
40
  const home = { kind: "oyster", id: this.host.scope.tenantId };