apps 0.0.1-beta.9 → 0.0.1-beta.91

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 (191) hide show
  1. package/README.md +56 -38
  2. package/framework-reference.json +1 -1
  3. package/js/chunk-3LEVTFD4.js +712 -0
  4. package/js/chunk-5FHWNLCI.js +88 -0
  5. package/js/{chunk-FL2QR3XW.js → chunk-5MDA7MKL.js} +338 -73
  6. package/js/chunk-6XQLA5NC.js +5047 -0
  7. package/js/{chunk-M3B3DE4K.js → chunk-74YVXBKY.js} +463 -218
  8. package/js/chunk-7PHHWYV4.js +335 -0
  9. package/js/chunk-DADXWWRZ.js +449 -0
  10. package/js/{chunk-27F7W2LG.js → chunk-DDHBUKXX.js} +18 -2
  11. package/js/{chunk-UK573G7W.js → chunk-EOPQ727L.js} +87 -51
  12. package/js/{chunk-5T57N25Q.js → chunk-GQ33QSNB.js} +583 -69
  13. package/js/{chunk-JU7VHODU.js → chunk-H72MEDMN.js} +65 -10
  14. package/js/chunk-I5C7FD5Z.js +171 -0
  15. package/js/{chunk-CDL5PM2Q.js → chunk-IFJU5SYQ.js} +19082 -18402
  16. package/js/{chunk-VFZKSM3T.js → chunk-JPEUKEV4.js} +3 -3
  17. package/js/{chunk-KUMBKVJD.js → chunk-KLYSEHUD.js} +2 -2
  18. package/js/{chunk-RFVIONFX.js → chunk-KUCCHNVY.js} +123 -44
  19. package/js/chunk-OD3KFKZD.js +1617 -0
  20. package/js/{chunk-57RKNWL2.js → chunk-PD6I2SDG.js} +4 -4
  21. package/js/{chunk-72JNVHPK.js → chunk-PYQLOLOC.js} +4 -3
  22. package/js/{chunk-ODEIDRGW.js → chunk-QWQM3CLH.js} +795 -176
  23. package/js/{chunk-IJX4CYZO.js → chunk-TUMGL2OC.js} +228 -264
  24. package/js/{chunk-IPI4MFSN.js → chunk-XBG7HHXC.js} +2 -2
  25. package/js/chunk-XPRZTLHD.js +1915 -0
  26. package/js/chunk-YNJ5CZMJ.js +93 -0
  27. package/js/chunk-YRGL4QEF.js +49 -0
  28. package/js/{chunk-Z5M2LQOZ.js → chunk-YWFUWTUJ.js} +113 -58
  29. package/js/client.js +142 -78
  30. package/js/contracts.js +142 -21
  31. package/js/effect.js +18 -19
  32. package/js/{es-APDZKREY.js → es-DIULA3ZF.js} +62 -1659
  33. package/js/graphql.js +49 -40
  34. package/js/host.js +85 -62
  35. package/js/index.js +165 -70
  36. package/js/mcp/effect.js +21 -21
  37. package/js/mcp.js +76 -56
  38. package/js/openapi.js +4189 -1411
  39. package/js/react.js +2 -3
  40. package/js/skills/effect.js +6 -3
  41. package/js/skills.js +208 -81
  42. package/js/storage/facet.js +1 -540
  43. package/js/ui/auth/contracts.js +2 -2
  44. package/js/ui/auth.js +5 -5
  45. package/js/ui/contracts.js +5 -4
  46. package/js/ui/serving.js +8605 -225
  47. package/package.json +3 -8
  48. package/runtime.json +1 -1
  49. package/types/app-cache/src/contracts/cache.d.ts +18 -0
  50. package/types/app-cache/src/index.d.ts +34 -2
  51. package/types/apps/src/contracts/api-response-error.d.ts +4 -0
  52. package/types/apps/src/contracts/app.d.ts +60 -11
  53. package/types/apps/src/contracts/cache.d.ts +20 -0
  54. package/types/apps/src/contracts/context.d.ts +60 -17
  55. package/types/apps/src/contracts/elicitation.d.ts +23 -7
  56. package/types/apps/src/contracts/events.d.ts +94 -0
  57. package/types/apps/src/contracts/failure.d.ts +30 -1
  58. package/types/apps/src/contracts/graphql.d.ts +2 -1
  59. package/types/apps/src/contracts/host.d.ts +1446 -17
  60. package/types/apps/src/contracts/icons.d.ts +28 -0
  61. package/types/apps/src/contracts/live.d.ts +2 -0
  62. package/types/apps/src/contracts/mcp.d.ts +81 -20
  63. package/types/apps/src/contracts/network.d.ts +120 -0
  64. package/types/apps/src/contracts/openapi-compile.d.ts +82 -3
  65. package/types/apps/src/contracts/openapi.d.ts +41 -9
  66. package/types/apps/src/contracts/operations.d.ts +14 -7
  67. package/types/apps/src/contracts/placement.d.ts +102 -0
  68. package/types/apps/src/contracts/protocol-version.d.ts +2 -2
  69. package/types/apps/src/contracts/protocols/1.d.ts +733 -81
  70. package/types/apps/src/contracts/protocols/10.d.ts +1450 -0
  71. package/types/apps/src/contracts/protocols/11.d.ts +1149 -0
  72. package/types/apps/src/contracts/protocols/12.d.ts +3310 -0
  73. package/types/apps/src/contracts/protocols/2.d.ts +69 -26
  74. package/types/apps/src/contracts/protocols/3.d.ts +133 -33
  75. package/types/apps/src/contracts/protocols/4.d.ts +122 -45
  76. package/types/apps/src/contracts/protocols/5.d.ts +157 -47
  77. package/types/apps/src/contracts/protocols/6.d.ts +1629 -0
  78. package/types/apps/src/contracts/protocols/7.d.ts +1785 -0
  79. package/types/apps/src/contracts/protocols/8.d.ts +1182 -0
  80. package/types/apps/src/contracts/protocols/9.d.ts +1104 -0
  81. package/types/apps/src/contracts/protocols/current.d.ts +6669 -0
  82. package/types/apps/src/contracts/protocols/oauth-6.d.ts +74 -0
  83. package/types/apps/src/contracts/protocols/oauth.d.ts +134 -0
  84. package/types/apps/src/contracts/provider-error.d.ts +9 -0
  85. package/types/apps/src/contracts/provider.d.ts +90 -6
  86. package/types/apps/src/contracts/schedules.d.ts +7 -1
  87. package/types/apps/src/contracts/schema.d.ts +21 -0
  88. package/types/apps/src/contracts/skills.d.ts +50 -13
  89. package/types/apps/src/contracts/sql.d.ts +63 -0
  90. package/types/apps/src/contracts/ui.d.ts +44 -14
  91. package/types/apps/src/contracts/webhooks.d.ts +24 -7
  92. package/types/apps/src/contracts/workflows.d.ts +19 -17
  93. package/types/apps/src/facet.d.ts +4 -5
  94. package/types/apps/src/host.d.ts +5 -0
  95. package/types/apps/src/implementation/account-router.d.ts +4 -3
  96. package/types/apps/src/implementation/app.d.ts +41 -14
  97. package/types/apps/src/implementation/authoring.d.ts +25 -5
  98. package/types/apps/src/implementation/browser-scripts.gen.d.ts +6 -0
  99. package/types/apps/src/implementation/cache.d.ts +29 -2
  100. package/types/apps/src/implementation/catalog-cache.d.ts +35 -4
  101. package/types/apps/src/implementation/elicitation.d.ts +18 -15
  102. package/types/apps/src/implementation/events.d.ts +64 -0
  103. package/types/apps/src/implementation/failure-detail.d.ts +28 -5
  104. package/types/apps/src/implementation/graphql-catalog.d.ts +3 -3
  105. package/types/apps/src/implementation/graphql.d.ts +4 -3
  106. package/types/apps/src/implementation/input-problems.d.ts +6 -2
  107. package/types/apps/src/implementation/invocation-timing.d.ts +18 -0
  108. package/types/apps/src/implementation/live.d.ts +2 -2
  109. package/types/apps/src/implementation/mcp-call.d.ts +6 -5
  110. package/types/apps/src/implementation/mcp-catalog.d.ts +6 -4
  111. package/types/apps/src/implementation/mcp-client.d.ts +17 -9
  112. package/types/apps/src/implementation/mcp-tools.d.ts +2 -1
  113. package/types/apps/src/implementation/mcp.d.ts +20 -9
  114. package/types/apps/src/implementation/network.d.ts +16 -0
  115. package/types/apps/src/implementation/openapi-compile.d.ts +28 -7
  116. package/types/apps/src/implementation/openapi-document.d.ts +46 -19
  117. package/types/apps/src/implementation/openapi-names.d.ts +9 -4
  118. package/types/apps/src/implementation/openapi-request.d.ts +10 -2
  119. package/types/apps/src/implementation/openapi-source.d.ts +23 -1
  120. package/types/apps/src/implementation/openapi-upgrade.d.ts +4 -0
  121. package/types/apps/src/implementation/operations.d.ts +57 -7
  122. package/types/apps/src/implementation/optimistic.d.ts +1 -1
  123. package/types/apps/src/implementation/placement.d.ts +60 -0
  124. package/types/apps/src/implementation/protocol-operations.d.ts +3 -0
  125. package/types/apps/src/implementation/provider-error.d.ts +28 -1
  126. package/types/apps/src/implementation/provider.d.ts +19 -4
  127. package/types/apps/src/implementation/query-commit.d.ts +1 -1
  128. package/types/apps/src/implementation/router-catalog.d.ts +20 -18
  129. package/types/apps/src/implementation/router.d.ts +24 -5
  130. package/types/apps/src/implementation/runtime-yield.d.ts +7 -0
  131. package/types/apps/src/implementation/schedules.d.ts +39 -8
  132. package/types/apps/src/implementation/schema.d.ts +98 -11
  133. package/types/apps/src/implementation/skills.d.ts +18 -24
  134. package/types/apps/src/implementation/sql.d.ts +71 -0
  135. package/types/apps/src/implementation/ui-account-notice.d.ts +9 -0
  136. package/types/apps/src/implementation/ui-auth.d.ts +1 -1
  137. package/types/apps/src/implementation/ui-client.d.ts +2 -2
  138. package/types/apps/src/implementation/ui-document.d.ts +5 -0
  139. package/types/apps/src/implementation/ui-errors.d.ts +1 -1
  140. package/types/apps/src/implementation/ui-serving.d.ts +26 -9
  141. package/types/apps/src/implementation/ui-watch.d.ts +1 -1
  142. package/types/apps/src/implementation/upstream-error.d.ts +7 -0
  143. package/types/apps/src/implementation/webhooks.d.ts +15 -6
  144. package/types/apps/src/implementation/workflow-context.d.ts +6 -2
  145. package/types/apps/src/implementation/workflows.d.ts +11 -4
  146. package/types/apps/src/index.d.ts +68 -19
  147. package/types/apps/src/mcp.d.ts +20 -1
  148. package/types/apps/src/openapi.d.ts +6 -1
  149. package/types/apps/src/react.d.ts +1 -1
  150. package/types/apps/src/skills.d.ts +10 -8
  151. package/types/apps/src/ui-serving.d.ts +1 -1
  152. package/types/telemetry/src/app-records.d.ts +42 -0
  153. package/types/telemetry/src/browser-operations.d.ts +2 -2
  154. package/types/telemetry/src/browser.d.ts +8 -3
  155. package/types/telemetry/src/config.d.ts +2 -2
  156. package/types/telemetry/src/index.d.ts +2 -1
  157. package/types/telemetry/src/layer.d.ts +10 -4
  158. package/types/telemetry/src/measurements.d.ts +1 -1
  159. package/types/telemetry/src/ownership.d.ts +60 -0
  160. package/types/telemetry/src/recorded-failure.d.ts +29 -0
  161. package/types/telemetry/src/relay.d.ts +16 -6
  162. package/types/telemetry/src/span-attributes.d.ts +17 -1
  163. package/types/telemetry/src/transport.d.ts +8 -1
  164. package/types/utils/src/api-error.d.ts +55 -0
  165. package/types/utils/src/connection-failure.d.ts +33 -0
  166. package/types/utils/src/recorded-message.d.ts +18 -0
  167. package/types/utils/src/user-facing-error.d.ts +83 -0
  168. package/js/chunk-7EK2JDX4.js +0 -299
  169. package/js/chunk-IKS2C5MQ.js +0 -224
  170. package/js/chunk-MKWZPDR6.js +0 -63
  171. package/js/chunk-N7YDVXYJ.js +0 -186
  172. package/js/chunk-NKLWZJLE.js +0 -172
  173. package/js/chunk-PJJ24GU7.js +0 -877
  174. package/js/chunk-PZB6T6KU.js +0 -19
  175. package/js/chunk-R3EV5FTO.js +0 -97
  176. package/js/chunk-SJFZCGXG.js +0 -1243
  177. package/js/chunk-WLE7WX2U.js +0 -2645
  178. package/js/chunk-YXQHV65J.js +0 -242
  179. package/js/chunk-ZQINWV4W.js +0 -630
  180. package/js/mcp/stdio.js +0 -128
  181. package/types/app-data/src/implementation/cursor.d.ts +0 -10
  182. package/types/app-data/src/implementation/index-key.d.ts +0 -7
  183. package/types/app-data/src/implementation/promise.d.ts +0 -68
  184. package/types/app-data/src/implementation/range.d.ts +0 -8
  185. package/types/app-data/src/implementation/schema.d.ts +0 -18
  186. package/types/app-data/src/implementation/sqlite.d.ts +0 -11
  187. package/types/app-data/src/index.d.ts +0 -4
  188. package/types/apps/src/contracts/storage.d.ts +0 -68
  189. package/types/apps/src/implementation/mcp-stdio.d.ts +0 -4
  190. package/types/apps/src/implementation/storage.d.ts +0 -15
  191. package/types/apps/src/mcp-stdio.d.ts +0 -5
package/README.md CHANGED
@@ -4,16 +4,20 @@ Author apps with ordinary TypeScript and Promises. Framework operations use
4
4
  Effect v4 internally. The root export contains declarations and schemas;
5
5
  protocol helpers have separate entry points.
6
6
 
7
- The Executor package starts at `0.0.1-beta.0`. The first npm beta is being
8
- prepared; `latest` belongs to the earlier package and is not this framework.
9
- Once the beta is published, install it with `npm install --save-exact apps@beta`.
10
- For local testing, install the tarball made by `bun run pack` in this directory.
7
+ Install the exact version your Executor host runs: agents read it with the
8
+ Executor app's `framework.release`, and `executor apps framework` prints it. Run
9
+ `npm install --save-exact apps@<version>` and declare the same version in the
10
+ app's `package.json`. Do not install `apps@latest`; that tag is an unrelated,
11
+ earlier package. The package includes `framework-reference.json`, generated from
12
+ these declarations. The Executor app's `app-authoring` skill is the authoring
13
+ guide; [Author an app](https://v2.executor.sh/docs/author-an-app) summarizes
14
+ it. In this repository, `bun run pack` builds a local tarball.
11
15
 
12
16
  ```ts
13
17
  import { defineApp } from "apps";
14
18
  import { mcpRouter } from "apps/mcp";
15
19
 
16
- export default defineApp({ accounts: {} }, async ({ signal }) => ({
20
+ export default defineApp({}, async ({ signal }) => ({
17
21
  tools: await mcpRouter({
18
22
  url: "https://mcp.deepwiki.com/mcp",
19
23
  ...(signal === undefined ? {} : { signal }),
@@ -21,17 +25,15 @@ export default defineApp({ accounts: {} }, async ({ signal }) => ({
21
25
  }));
22
26
  ```
23
27
 
24
- | Import | Helper | App dependency |
25
- | ---------------- | --------------- | --------------------------- |
26
- | `apps/mcp` | `mcpRouter` | `@modelcontextprotocol/sdk` |
27
- | `apps/mcp/stdio` | `stdioRouter` | `@modelcontextprotocol/sdk` |
28
- | `apps/graphql` | `graphqlRouter` | `graphql` |
29
- | `apps/openapi` | `openapiRouter` | None |
28
+ | Import | Helper | App dependency |
29
+ | -------------- | ------------------------ | --------------------------- |
30
+ | `apps/mcp` | `mcpRouter`, `mcpHealth` | `@modelcontextprotocol/sdk` |
31
+ | `apps/graphql` | `graphqlRouter` | `graphql` |
32
+ | `apps/openapi` | `liveOpenapiRouter` | None |
30
33
 
31
34
  MCP and GraphQL are optional peers. Subpath imports isolate their module graphs;
32
- optional peers keep unused libraries out of the dependency installation. The
33
- MCP HTTP entry point does not import the stdio process adapter. Stdio requires
34
- a host with process support.
35
+ optional peers keep unused libraries out of the dependency installation. Apps
36
+ reach MCP servers over HTTP; they cannot start local processes.
35
37
 
36
38
  `defineApp` declares behavior, not a name. Package identity lives in
37
39
  `package.json.name`; the host separately names each installed copy.
@@ -39,7 +41,7 @@ a host with process support.
39
41
  Declare the needed peer in the deployed app's `package.json`, for example:
40
42
 
41
43
  ```json
42
- { "name": "deepwiki", "dependencies": { "@modelcontextprotocol/sdk": "1.30.0" } }
44
+ { "name": "deepwiki", "dependencies": { "@modelcontextprotocol/sdk": "1.32.1" } }
43
45
  ```
44
46
 
45
47
  Product runtimes compile authored source and declared dependencies inside workerd,
@@ -57,7 +59,7 @@ operation and shared schema before publishing the current revision. A warm call
57
59
  reads that revision and the requested operation's schema dependencies. It does
58
60
  not download, parse, or read the full catalog. `openapiRouter` remains the
59
61
  lower-level helper for already normalized metadata.
60
- `parameterDefaults` binds path, query or header values to the selected account.
62
+ `parameterDefaults` binds path, query or header values to the account.
61
63
  Those parameters become optional and publish their value as the schema `default`;
62
64
  an explicit value still wins.
63
65
 
@@ -69,17 +71,35 @@ Accounts bind at execution time. Live documents cannot change credential
69
71
  placement or send credentials to another origin. Editing generated source and
70
72
  redeploying is required to change those static choices.
71
73
 
72
- Authenticated templates use `provider.many()` and `accountRouter` from `apps`:
74
+ Requirements are declared by scope. `user: { accounts }` holds each caller's
75
+ own accounts, read as `ctx.user.accounts`; `app: { accounts }` holds the app's
76
+ own accounts, which people who can edit the app link for everyone, read as
77
+ `ctx.app.accounts`. A requirement name is used once across both. Contexts of the
78
+ `"app"` scope, such as `MutationContext<typeof requirements, "app">`, have no
79
+ `user`: app schedules (`appCron`, `appInterval`), webhooks whose `account` is
80
+ `{ app: "..." }` and the workflows they start run without a caller. App
81
+ schedules also accept a mutation whose handler declares no parameters, unless
82
+ the call passes explicit type arguments: their third, the context, defaults to
83
+ the caller's. A
84
+ handler that declares its context without a type gets the caller's, with
85
+ `ctx.user`, as a tool's does; app schedules reject it. User
86
+ schedules (`userCron`, `userInterval`) run once for each member who enables them,
87
+ as them. `{ accounts }` requirements and `ctx.accounts` are removed.
88
+
89
+ Authenticated templates use a `provider.many()` user requirement and
90
+ `accountRouter` from `apps`. A factory also runs without a caller for app-scope
91
+ work, so `ctx.user` may be undefined there:
73
92
 
74
93
  ```ts
75
94
  export default defineApp(
76
- { accounts: { service: provider.many() } },
77
- async ({ accounts, signal }) => ({
95
+ { user: { accounts: { service: provider.many() } } },
96
+ async ({ user, signal }) => ({
78
97
  tools: await accountRouter(
79
- accounts.service,
98
+ user?.accounts.service ?? [],
80
99
  (account) =>
81
100
  mcpRouter({
82
101
  url: "https://example.com/mcp",
102
+ account,
83
103
  headers: { Authorization: "Bearer " + account.fields.token },
84
104
  signal,
85
105
  }),
@@ -89,23 +109,24 @@ export default defineApp(
89
109
  );
90
110
  ```
91
111
 
92
- MCP and GraphQL helpers accept `cache: ctx.cache.forAccount(account)` (or
93
- `ctx.cache` for a public source). They return a dynamic router, cache remote
112
+ MCP and GraphQL helpers take the account their headers come from, and accept
113
+ `cache: ctx.cache`; an account's catalog is kept in that account's scope and
114
+ credentials never enter its key. They return a dynamic router, cache remote
94
115
  metadata, and compile only the selected tool. The defaults are five minutes fresh
95
116
  plus five minutes stale. Use `freshFor` / `staleFor` to change the windows, or
96
117
  `revalidate: true` to await a refresh. Tool results are never cached.
97
118
 
98
119
  Each combined tool takes `{ accountId, input }`. `input` keeps the upstream shape;
99
- `accountId` must identify a selected account that exposes that tool. Discovery
120
+ `accountId` must identify one of the caller's accounts that exposes that tool. Discovery
100
121
  and validation remain specific to each account. An empty selection returns no
101
- tools. This helper also works with OpenAPI, GraphQL and stdio operations.
122
+ tools. This helper also works with OpenAPI and GraphQL operations.
102
123
 
103
124
  Contracts live in `src/contracts/`; native operations live in `src/implementation/`.
104
125
  Promise conversion happens at the public entry points. `apps/mcp/effect` exposes
105
126
  the native HTTP discovery operation for host-side import probing.
106
127
 
107
128
  Helpers are ordinary app libraries. The SDK still builds and invokes one app
108
- model with the configured account selections; there is no protocol dispatcher.
129
+ model with the accounts each operation runs with; there is no protocol dispatcher.
109
130
  Existing retained builds keep their bundled code until a new deployment.
110
131
 
111
132
  The packaged runtime uses host protocol 1. A package missing that runtime or using
@@ -120,7 +141,8 @@ returns `approved`, `denied`, or `user-approval`. It receives `toolName`, decode
120
141
  `toolInput`, and `signal`. Reuse a policy function across tools or attach it when
121
142
  composing generated tools. There is no app-level policy.
122
143
  The framework enforces the decision before the selected tool body.
123
- Human approval delivery is separate; Executor SDK call/resume persists the pending invocation. See [tool approvals](../../notes/app-policies.md).
144
+ Human approval delivery is separate; Executor SDK call/resume persists the pending invocation.
145
+ See [Tools and approvals](https://v2.executor.sh/docs/concepts/tools-and-approvals).
124
146
 
125
147
  ## Browser UI
126
148
 
@@ -170,8 +192,7 @@ Use the Promise client methods for one-time reads and explicit writes.
170
192
 
171
193
  The product host supplies authentication and binds the browser to one configured
172
194
  app. No app ID, account token or Executor API key belongs in UI code. New
173
- activations reload open app pages. See [the full example](../../playground/demo-apps/live-inbox/ui/main.tsx)
174
- and [hosting notes](../../notes/app-ui.md).
195
+ activations reload open app pages. The `live-inbox` example in `framework-reference.json` is a complete app with a UI.
175
196
 
176
197
  ## Webhooks
177
198
 
@@ -184,14 +205,13 @@ The SDK creates durable subscriptions with `executor.webhooks.create`. A
184
205
  subscription pins its deployment and saved account IDs while resolving fresh
185
206
  credentials on each invocation. `.many()` sources use one subscription per
186
207
  selected source account. Local, self-host and cloud use the same author API.
187
- See [the lifecycle and management API](../../notes/webhooks.md) and
188
- [the GitHub/Gmail example](../../playground/demo-apps/issue-mail/webhooks.ts).
208
+ The app-authoring skill's `webhooks.md` covers the lifecycle and examples.
189
209
 
190
210
  Providers without a webhook API can use
191
211
  `setup: { instructions: "...", signingSecret: "executor" }`
192
212
  instead of `register` and `unregister`. The private setup page collects the
193
213
  `state` schema and the signing secret. Agents get a setup link and safe status
194
- through the normal management API. See [manual setup](../../notes/webhooks.md#manual-registration).
214
+ through the normal management API.
195
215
 
196
216
  ## Workflows
197
217
 
@@ -205,9 +225,7 @@ Start and inspect runs through `executor.apps.workflowRuns`. Inside an app,
205
225
  queries can inspect `ctx.workflows`; mutations and webhooks can also start and
206
226
  terminate runs. Workflow execution has no live `elicit` capability.
207
227
 
208
- See [workflow semantics](../../notes/app-workflows.md) for replay, idempotency,
209
- self-host recovery and v1 limits, and the
210
- [repository report example](../../playground/demo-apps/workflow-report/) for a full app.
228
+ The app-authoring skill's `workflows.md` covers replay, idempotency and limits.
211
229
 
212
230
  Local and self-host products run authored apps in Alchemy/workerd, using the
213
231
  same Worker build format and app-data facets as Cloud. Host filesystem and
@@ -222,7 +240,7 @@ private data; it also includes the current credential fingerprint. Use the
222
240
  shared cache for public metadata that is identical across accounts.
223
241
 
224
242
  ```ts
225
- const projects = await ctx.cache.forAccount(ctx.accounts.service).get({
243
+ const projects = await ctx.cache.forAccount(ctx.user.accounts.service).get({
226
244
  key: ["projects", region],
227
245
  schema: array(object({ id: string(), name: string() })),
228
246
  freshFor: "1 minute",
@@ -263,8 +281,8 @@ mutation can be mounted at only one path.
263
281
 
264
282
  Protocol helpers return routers, so an app mounts several sources under keys.
265
283
  `mcpRouter` takes its title, description, icons and instructions from the
266
- server, and `liveOpenapiRouter` from the document's `info` and tags. `stdioRouter`,
267
- `openapiRouter` and `graphqlRouter` carry no source metadata. A nested router that fails to load is reported on its own catalog entry;
284
+ server, and `liveOpenapiRouter` from the document's `info` and tags. `openapiRouter`
285
+ and `graphqlRouter` carry no source metadata. A nested router that fails to load is reported on its own catalog entry;
268
286
  the app's other tools still load. The root failing fails discovery.
269
287
 
270
288
  `dynamicRouter({ list, resolve })` separates descriptions from executable
@@ -277,7 +295,7 @@ duplicate names.
277
295
 
278
296
  ```ts
279
297
  export default defineApp(
280
- { accounts: {} },
298
+ {},
281
299
  {
282
300
  tools: dynamicRouter({
283
301
  list: async () => [