@akanjs/cli 3.2.0-rc.10 → 3.2.0-rc.12

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 (45) hide show
  1. package/.build-stamp +2 -2
  2. package/{CodeAgent-fk66n37w.js → CodeAgent-cr8pvdmv.js} +2 -2
  3. package/{CodeTui-4rf1mqmv.js → CodeTui-89ssa9rr.js} +1 -1
  4. package/{TunnelShare-44er4e29.js → TunnelShare-ndb5cts1.js} +5 -5
  5. package/{agent.command-7g9czkkd.js → agent.command-rp9hpf0v.js} +6 -6
  6. package/akanCode.js +2 -2
  7. package/{application.command-00spg55s.js → application.command-fydjdvce.js} +6 -6
  8. package/{applicationBuildRunner-f4yf0qyc.js → applicationBuildRunner-68sph7t4.js} +4 -4
  9. package/buildBatch.proc.js +4 -4
  10. package/{cloud.command-ab704p0g.js → cloud.command-0y1gg3sb.js} +9 -9
  11. package/{cloud.script-4p4y0s7e.js → cloud.script-ewk72b3g.js} +9 -9
  12. package/{code.command-m6c9xk56.js → code.command-63fcz7a3.js} +4 -4
  13. package/{context.command-hgcgxtdk.js → context.command-pgwcx0na.js} +6 -6
  14. package/{context.runner-w071gmc3.js → context.runner-5s2ytkjj.js} +5 -5
  15. package/guidelines/akanApi/akanApi.instruction.md +2 -0
  16. package/guidelines/errorCodes/errorCodes.instruction.md +3 -0
  17. package/guidelines/mcpRule/mcpRule.instruction.md +44 -2
  18. package/incrementalBuilder.proc.js +2 -2
  19. package/{index-dsg50er9.js → index-3m2cd8mm.js} +1 -1
  20. package/{index-z43wddce.js → index-6js9ek5c.js} +1 -1
  21. package/{index-p4htjyvk.js → index-6r5f768n.js} +2 -2
  22. package/{index-7ky4brfy.js → index-70jkxbf6.js} +1 -1
  23. package/{index-xy70tcv4.js → index-ahk6rvth.js} +1 -1
  24. package/{index-6eptmk8z.js → index-axe04yqm.js} +1 -1
  25. package/{index-rdx8cyv2.js → index-bgp0h8rx.js} +1 -1
  26. package/{index-5jwx4bf2.js → index-bmscnt1t.js} +3 -3
  27. package/{index-bxkx0x03.js → index-cqrndcq0.js} +3 -3
  28. package/{index-hhagjhkh.js → index-cswgczrv.js} +4 -4
  29. package/{index-6qtxs86x.js → index-h0s3cjm0.js} +1 -1
  30. package/{index-4k9nv4m3.js → index-mmgtnh44.js} +3 -3
  31. package/{index-b3pr4ee6.js → index-pcprf7ft.js} +1 -1
  32. package/{index-849qvd7t.js → index-qwzwzmvf.js} +2 -2
  33. package/{index-6z57w95f.js → index-s0w78805.js} +1 -1
  34. package/{index-xfv2p7b5.js → index-wm4385pm.js} +2 -2
  35. package/{index-9xh4zvw3.js → index-wpgtyek3.js} +20 -10
  36. package/index.js +10 -10
  37. package/{localRegistry.command-bz2df40m.js → localRegistry.command-yz150pcw.js} +8 -8
  38. package/package.json +2 -2
  39. package/skills/akan-mcp/SKILL.md +3 -0
  40. package/{subspace.command-0970n7kd.js → subspace.command-ykxertx8.js} +5 -5
  41. package/templates/lib/sig.ts +0 -4
  42. package/templates/lib/useClient.ts +1 -1
  43. package/{tunnel.command-bcy0rtmh.js → tunnel.command-qbcbj0vq.js} +5 -5
  44. package/{verify.command-ynaztxr2.js → verify.command-gvveq05z.js} +5 -5
  45. package/{workspace.command-e4wfxm86.js → workspace.command-jm7emxjh.js} +12 -12
package/.build-stamp CHANGED
@@ -1,2 +1,2 @@
1
- ed1a6034368b9b93d8a0752b2a6e180f3b595501bede5d0f3a9c914c47ced5b4
2
- 5eed55b1-b5b5-4198-84af-6e928a89dc1a
1
+ d67d3f47f5d4d1543eeeb0f52947ac386aafab7f55ecdf384aca9967fe1cb61a
2
+ d4fc8eb4-d5e8-433e-9788-2c15108a8b68
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgent2
4
- } from "./index-bxkx0x03.js";
5
- import"./index-b3pr4ee6.js";
4
+ } from "./index-cqrndcq0.js";
5
+ import"./index-pcprf7ft.js";
6
6
  import"./index-b4qq3rq0.js";
7
7
  import"./index-35j83zkd.js";
8
8
  import"./index-bns3wcpc.js";
@@ -4,7 +4,7 @@ import {
4
4
  McpTokenStore,
5
5
  McpSignIn,
6
6
  AkanCodeCompaction2
7
- } from "./index-b3pr4ee6.js";
7
+ } from "./index-pcprf7ft.js";
8
8
  import"./index-bns3wcpc.js";
9
9
  import"./index-35j83zkd.js";
10
10
  import {
@@ -1,12 +1,12 @@
1
1
  // @bun
2
2
  import {
3
3
  TunnelShare2
4
- } from "./index-xy70tcv4.js";
5
- import"./index-7ky4brfy.js";
6
- import"./index-dsg50er9.js";
4
+ } from "./index-ahk6rvth.js";
5
+ import"./index-70jkxbf6.js";
6
+ import"./index-3m2cd8mm.js";
7
7
  import"./index-m9jj544v.js";
8
- import"./index-z43wddce.js";
9
- import"./index-9xh4zvw3.js";
8
+ import"./index-6js9ek5c.js";
9
+ import"./index-wpgtyek3.js";
10
10
  import"./index-sq9d0jhj.js";
11
11
  import"./index-j4yvgfhr.js";
12
12
  import"./index-bns3wcpc.js";
@@ -12,13 +12,13 @@ import"./index-bper31wr.js";
12
12
  import"./index-hj6w4ka1.js";
13
13
  import"./index-dfsa009c.js";
14
14
  import"./index-nd39rssn.js";
15
- import"./index-4k9nv4m3.js";
15
+ import"./index-mmgtnh44.js";
16
16
  import"./index-41mfhgq0.js";
17
- import"./index-dsg50er9.js";
18
- import"./index-6z57w95f.js";
17
+ import"./index-3m2cd8mm.js";
18
+ import"./index-s0w78805.js";
19
19
  import"./index-m9jj544v.js";
20
- import"./index-9xh4zvw3.js";
21
- import"./index-z43wddce.js";
20
+ import"./index-wpgtyek3.js";
21
+ import"./index-6js9ek5c.js";
22
22
  import"./index-apcr1qgk.js";
23
23
  import"./index-e5f6czck.js";
24
24
  import"./index-62md4dwy.js";
@@ -28,7 +28,7 @@ import"./index-t4d0ckde.js";
28
28
  import"./index-k2r3hmbz.js";
29
29
  import {
30
30
  AgentScript
31
- } from "./index-6eptmk8z.js";
31
+ } from "./index-axe04yqm.js";
32
32
  import"./index-frvjq1rd.js";
33
33
 
34
34
  // pkgs/@akanjs/cli/agent/agent.command.ts
package/akanCode.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  CodeMailbox2,
35
35
  CodeSessionFork2,
36
36
  CodeAgent2
37
- } from "./index-bxkx0x03.js";
37
+ } from "./index-cqrndcq0.js";
38
38
  import {
39
39
  akanCodeDefaultModel2,
40
40
  akanCodeModel2,
@@ -45,7 +45,7 @@ import {
45
45
  import {
46
46
  SubagentPool2,
47
47
  AkanCodeCompaction2
48
- } from "./index-b3pr4ee6.js";
48
+ } from "./index-pcprf7ft.js";
49
49
  import {
50
50
  CodeAgentRpcHost2
51
51
  } from "./index-s4nvxpzm.js";
@@ -16,17 +16,17 @@ import"./index-sq9d0jhj.js";
16
16
  import {
17
17
  RouteJsBudget
18
18
  } from "./index-41mfhgq0.js";
19
- import"./index-dsg50er9.js";
20
- import"./index-6z57w95f.js";
19
+ import"./index-3m2cd8mm.js";
20
+ import"./index-s0w78805.js";
21
21
  import"./index-m9jj544v.js";
22
- import"./index-9xh4zvw3.js";
23
- import"./index-z43wddce.js";
22
+ import"./index-wpgtyek3.js";
23
+ import"./index-6js9ek5c.js";
24
24
  import"./index-t8h09yjs.js";
25
- import"./index-4k9nv4m3.js";
25
+ import"./index-mmgtnh44.js";
26
26
  import"./index-b4qq3rq0.js";
27
27
  import {
28
28
  ApplicationScript
29
- } from "./index-5jwx4bf2.js";
29
+ } from "./index-bmscnt1t.js";
30
30
  import {
31
31
  writeOption,
32
32
  nativeTargetOption,
@@ -10,21 +10,21 @@ import"./index-bns3wcpc.js";
10
10
  import"./index-j4yvgfhr.js";
11
11
  import {
12
12
  NARROWABLE_VENDOR_SPECIFIERS
13
- } from "./index-rdx8cyv2.js";
13
+ } from "./index-bgp0h8rx.js";
14
14
  import {
15
15
  FontPruner,
16
16
  RouteJsBudget
17
17
  } from "./index-41mfhgq0.js";
18
- import"./index-9xh4zvw3.js";
18
+ import"./index-wpgtyek3.js";
19
19
  import {
20
20
  AllRoutesBuilder,
21
21
  precompressArtifacts,
22
22
  SsrBaseArtifactBuilder,
23
23
  VendorImportScanner
24
- } from "./index-849qvd7t.js";
24
+ } from "./index-qwzwzmvf.js";
25
25
  import {
26
26
  CsrArtifactBuilder
27
- } from "./index-z43wddce.js";
27
+ } from "./index-6js9ek5c.js";
28
28
  import"./index-62md4dwy.js";
29
29
 
30
30
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
@@ -13,20 +13,20 @@ import {
13
13
  saveRouteSeedIndex,
14
14
  CsrDevBundler,
15
15
  SsrDevBundler
16
- } from "./index-rdx8cyv2.js";
16
+ } from "./index-bgp0h8rx.js";
17
17
  import"./index-bns3wcpc.js";
18
18
  import"./index-j4yvgfhr.js";
19
19
  import {
20
20
  ServerGraphFile,
21
21
  PagesBundleBuilder
22
- } from "./index-9xh4zvw3.js";
22
+ } from "./index-wpgtyek3.js";
23
23
  import {
24
24
  CssCompiler,
25
25
  SsrBaseArtifactBuilder
26
- } from "./index-849qvd7t.js";
26
+ } from "./index-qwzwzmvf.js";
27
27
  import {
28
28
  CsrArtifactBuilder
29
- } from "./index-z43wddce.js";
29
+ } from "./index-6js9ek5c.js";
30
30
  import"./index-62md4dwy.js";
31
31
 
32
32
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
@@ -7,24 +7,24 @@ import {
7
7
  import"./index-j4yvgfhr.js";
8
8
  import"./index-bns3wcpc.js";
9
9
  import"./index-sq9d0jhj.js";
10
- import"./index-7ky4brfy.js";
10
+ import"./index-70jkxbf6.js";
11
11
  import {
12
12
  PlatformTestRun
13
- } from "./index-p4htjyvk.js";
14
- import"./index-dsg50er9.js";
15
- import"./index-6z57w95f.js";
13
+ } from "./index-6r5f768n.js";
14
+ import"./index-3m2cd8mm.js";
15
+ import"./index-s0w78805.js";
16
16
  import"./index-m9jj544v.js";
17
- import"./index-9xh4zvw3.js";
18
- import"./index-z43wddce.js";
17
+ import"./index-wpgtyek3.js";
18
+ import"./index-6js9ek5c.js";
19
19
  import {
20
20
  npmRegistryFromEnv,
21
21
  warnIgnoredNpmRegistry
22
22
  } from "./index-ny2k80mv.js";
23
23
  import"./index-41mfhgq0.js";
24
24
  import"./index-t8h09yjs.js";
25
- import"./index-4k9nv4m3.js";
25
+ import"./index-mmgtnh44.js";
26
26
  import"./index-b4qq3rq0.js";
27
- import"./index-5jwx4bf2.js";
27
+ import"./index-bmscnt1t.js";
28
28
  import"./index-qd7xn2bk.js";
29
29
  import"./index-nd39rssn.js";
30
30
  import"./index-grt0e6kk.js";
@@ -32,7 +32,7 @@ import"./index-e5f6czck.js";
32
32
  import"./index-6fnrhpn1.js";
33
33
  import {
34
34
  CloudScript2
35
- } from "./index-hhagjhkh.js";
35
+ } from "./index-cswgczrv.js";
36
36
  import {
37
37
  writeOption,
38
38
  oneNativeTargetOption,
@@ -1,27 +1,27 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript2
4
- } from "./index-hhagjhkh.js";
5
- import"./index-p4htjyvk.js";
6
- import"./index-5jwx4bf2.js";
4
+ } from "./index-cswgczrv.js";
5
+ import"./index-6r5f768n.js";
6
+ import"./index-bmscnt1t.js";
7
7
  import"./index-t8h09yjs.js";
8
8
  import"./index-6fnrhpn1.js";
9
- import"./index-7ky4brfy.js";
9
+ import"./index-70jkxbf6.js";
10
10
  import"./index-ny2k80mv.js";
11
- import"./index-4k9nv4m3.js";
11
+ import"./index-mmgtnh44.js";
12
12
  import"./index-frvjq1rd.js";
13
13
  import"./index-e5f6czck.js";
14
- import"./index-6z57w95f.js";
15
- import"./index-dsg50er9.js";
14
+ import"./index-s0w78805.js";
15
+ import"./index-3m2cd8mm.js";
16
16
  import"./index-m9jj544v.js";
17
17
  import"./index-23d8gw08.js";
18
18
  import"./index-9bv479q5.js";
19
19
  import"./index-b4qq3rq0.js";
20
20
  import"./index-grt0e6kk.js";
21
21
  import"./index-nd39rssn.js";
22
- import"./index-z43wddce.js";
22
+ import"./index-6js9ek5c.js";
23
23
  import"./index-41mfhgq0.js";
24
- import"./index-9xh4zvw3.js";
24
+ import"./index-wpgtyek3.js";
25
25
  import"./index-sq9d0jhj.js";
26
26
  import"./index-j4yvgfhr.js";
27
27
  import"./index-qd7xn2bk.js";
@@ -78,7 +78,7 @@ class CodeRunner extends runner("code") {
78
78
  async serve(options, listen) {
79
79
  await import("./consoleToStderr-h5bryj94.js");
80
80
  const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
81
- import("./CodeAgent-fk66n37w.js"),
81
+ import("./CodeAgent-cr8pvdmv.js"),
82
82
  import("./CodeAgentRpcHost-6dzfkvsc.js"),
83
83
  import("./CodeAgentRpcListener-tcwrdvst.js")
84
84
  ]);
@@ -112,8 +112,8 @@ class CodeRunner extends runner("code") {
112
112
  }
113
113
  async tui(options, seed) {
114
114
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
115
- import("./CodeAgent-fk66n37w.js"),
116
- import("./CodeTui-4rf1mqmv.js")
115
+ import("./CodeAgent-cr8pvdmv.js"),
116
+ import("./CodeTui-89ssa9rr.js")
117
117
  ]);
118
118
  const start = await CodeRunner.#start(options, { hostAttached: false, interactive: true, ask: true });
119
119
  const agentOptions = start.agent;
@@ -149,7 +149,7 @@ class CodeRunner extends runner("code") {
149
149
  }
150
150
  }
151
151
  async run(prompt, options) {
152
- const { CodeAgent } = await import("./CodeAgent-fk66n37w.js");
152
+ const { CodeAgent } = await import("./CodeAgent-cr8pvdmv.js");
153
153
  const ask = !!process.stdin.isTTY && !!process.stderr.isTTY;
154
154
  const start = await CodeRunner.#start(options, { hostAttached: false, interactive: false, ask });
155
155
  for (const warning of start.warnings)
@@ -10,12 +10,12 @@ import"./index-bper31wr.js";
10
10
  import"./index-hj6w4ka1.js";
11
11
  import"./index-dfsa009c.js";
12
12
  import"./index-nd39rssn.js";
13
- import"./index-xfv2p7b5.js";
14
- import"./index-dsg50er9.js";
15
- import"./index-6z57w95f.js";
13
+ import"./index-wm4385pm.js";
14
+ import"./index-3m2cd8mm.js";
15
+ import"./index-s0w78805.js";
16
16
  import"./index-m9jj544v.js";
17
- import"./index-9xh4zvw3.js";
18
- import"./index-z43wddce.js";
17
+ import"./index-wpgtyek3.js";
18
+ import"./index-6js9ek5c.js";
19
19
  import"./index-j6eeh5d7.js";
20
20
  import"./index-ygdbn9jn.js";
21
21
  import"./index-xgqz3kak.js";
@@ -28,7 +28,7 @@ import"./index-t4d0ckde.js";
28
28
  import"./index-097bjwvm.js";
29
29
  import {
30
30
  ContextScript
31
- } from "./index-6qtxs86x.js";
31
+ } from "./index-h0s3cjm0.js";
32
32
 
33
33
  // pkgs/@akanjs/cli/context/context.command.ts
34
34
  class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ContextRunner2
4
- } from "./index-xfv2p7b5.js";
4
+ } from "./index-wm4385pm.js";
5
5
  import"./index-097bjwvm.js";
6
6
  import"./index-hf9nvwam.js";
7
7
  import"./index-adj7qmz9.js";
@@ -11,16 +11,16 @@ import"./index-p54s83sz.js";
11
11
  import"./index-t4d0ckde.js";
12
12
  import"./index-bper31wr.js";
13
13
  import"./index-dfsa009c.js";
14
- import"./index-6z57w95f.js";
14
+ import"./index-s0w78805.js";
15
15
  import"./index-j6eeh5d7.js";
16
- import"./index-dsg50er9.js";
16
+ import"./index-3m2cd8mm.js";
17
17
  import"./index-m9jj544v.js";
18
18
  import"./index-23d8gw08.js";
19
19
  import"./index-xgqz3kak.js";
20
20
  import"./index-ygdbn9jn.js";
21
21
  import"./index-nd39rssn.js";
22
- import"./index-z43wddce.js";
23
- import"./index-9xh4zvw3.js";
22
+ import"./index-6js9ek5c.js";
23
+ import"./index-wpgtyek3.js";
24
24
  import"./index-sq9d0jhj.js";
25
25
  import"./index-j4yvgfhr.js";
26
26
  import"./index-hj6w4ka1.js";
@@ -237,6 +237,8 @@ method?: HttpMutationMethod;
237
237
  fileUpload?: boolean;
238
238
  /** `false` keeps it out of the MCP catalogue (default `true`); curation, not authorization — HTTP still serves it. */
239
239
  mcp?: boolean;
240
+ /** Overrides what the key implies for a `mutation`'s MCP `destructiveHint`: `true` for one no verb gives away, such as `archiveOrder`, `false` for a `drop…` that loses nothing. */
241
+ destructive?: boolean;
240
242
  /** The errors this endpoint throws on purpose, by status. */
241
243
  errors?: EndpointErrors;
242
244
  /** A slow subscriber of a `pubsub(Binary)`: `"coalesce"` (default) keeps only the newest frame per room, `"queue"` delivers every frame and grows the send buffer with the slowest subscriber. */
@@ -89,8 +89,11 @@ Generated from the akanjs sources of this release: every code a framework error
89
89
  | `redisUriMissing` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
90
90
  | `routeConflict` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
91
91
  | `routeNotFound` | 404 | `AkanError` | no | yes | `base/akanError.ts` |
92
+ | `routeNotFound` | 404 | `RscRouteNotFound` | no | yes | `server/rscClient.tsx` |
92
93
  | `routerNotReady` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
93
94
  | `rpcDisposed` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
95
+ | `rscFetchFailed` | 502 | `AkanError` | no | yes | `base/akanError.ts` |
96
+ | `rscRedirectStarted` | 303 | `RscRedirectNavigationStarted` | no | yes | `server/rscClient.tsx` |
94
97
  | `searchMisconfigured` | 500 | `DocumentStoreError` | no | yes | `service/documentStoreError.ts` |
95
98
  | `searchUnavailable` | 500 | `DocumentStoreError` | no | yes | `service/documentStoreError.ts` |
96
99
  | `secretRefused` | 500 | `AkanError` | no | yes | `base/akanError.ts` |
@@ -205,8 +205,11 @@ export default page()
205
205
  alike: the caller reads `You are not permitted to perform this action.`, because either sentence names your
206
206
  authorization structure to the one caller barred from it. A domain `Err` at any other status resolves through
207
207
  the dictionary and keeps its own words, placeholders filled.
208
- - The `readOnly` / `destructive` / `idempotent` hints a client renders are derived from the endpoint type and key
209
- and are not configurable. Clients are told to distrust hints; they are never a gate.
208
+ - The `readOnly` / `destructive` / `idempotent` hints a client renders are derived from the endpoint type and key.
209
+ A mutation named `remove`, `delete`, `purge`, `destroy`, `erase`, `wipe`, `drop`, `cancel`, `bulkRemove` or
210
+ `bulkDelete` is destructive; `destructive: true` or `false` on the endpoint overrides that, for an `archiveOrder`
211
+ no verb gives away. Clients are told to distrust hints; they are never a gate. `agentService.loop` does read this
212
+ one: it refuses a destructive tool unless `approve` allows it.
210
213
  - **`AKAN_MCP_READONLY=true` is the read-only-deployment valve, not the exposure switch.** It drops every mutation
211
214
  whatever it declared, and reports each one in the boot log like any other refusal. It also drops each `.prompt()`
212
215
  page's text tool, whose run renders the whole page; the prompts, the `.app()` tools and their views stay.
@@ -514,6 +517,45 @@ are left out: `/mcp` `tools/list` shows them, `listAs` does not, and `callAs` an
514
517
  - **`headers` are forwarded without `authorization`, `cookie` and `origin`**; `ip` is what `getClientIp()` and an
515
518
  ip-scoped `rateLimit` read, unknown by default.
516
519
 
520
+ ## A Server Agent Loop — `agentService.loop`
521
+
522
+ `this.agentService.loop(request)` runs a model over that catalogue until it answers, with no browser — a queued
523
+ task, a scheduled run, a reply to a mention. It is an async iterable of `text`, `toolCall`, `toolResult`, `usage`,
524
+ `compacted` and `awaiting` events that ends in exactly one `done { stop }` or `error`, and it waits for the consumer
525
+ at every event.
526
+
527
+ - **Who it acts as.** `account` is a snapshot the server resolved; `principal` is a stored id that
528
+ `option.setAgentAccountResolver((principal) => account | null)` resolves at the start and before every round, so
529
+ a revoked one ends the run as `"unauthorized"`, as does a missing or falsy `account`: there is no anonymous run.
530
+ Neither is ever client input. The model is offered `allow` ∩ what
531
+ the account sees on `/mcp`, and a call to a name that round did not list is answered as an unknown tool, neither
532
+ asked about nor run. A request with no `allow` array is an `error`.
533
+ - **Writes after untrusted input.** `untrusted(result)` marks a result third parties wrote, and every later call
534
+ reaches `approve(call, { tainted, tool })` with `tainted` set. A batch is judged before it runs, since the model
535
+ wrote it before reading its results. Without `approve`, a `needsConfirm` tool — on this catalogue, a mutation
536
+ with the `destructive` hint above — is refused, and so is every write once tainted. `"defer"` holds the whole batch, emits
537
+ `awaiting` and ends the run as `"awaiting"`.
538
+ - **Resuming.** Store each message `onMessage` hands over — it is awaited, and a retried run may hand one over twice —
539
+ and call `loop` again with them. Trailing calls nothing answered go to `approve` again before any model call, and
540
+ the taint is rebuilt from the `tainted` marks on stored messages and by re-applying `untrusted`, which sees a result
541
+ whole during the run and clipped on a resume. Store every message whole, marks included. `compacted` says the first
542
+ `replaced` messages are now `summary`; its `tainted` marker stands in for the results it replaced, and a summary
543
+ with no marker counts as tainted to a run with `untrusted`. A batch's results
544
+ reach `onMessage` even when the consumer stops reading or a later call throws, so a resume runs only calls that
545
+ never started.
546
+ - **Metering.** Each model call, compactions included, is its own turn for the request policy, the quota and the
547
+ usage hook. It gets a fresh `id`, `loop { id, round }`, a copy of the request's `meta` — server-set, so it may key
548
+ billing — empty headers and no ip. The relay's default size caps skip loop rounds; a refused quota ends the run as
549
+ `"quota"`.
550
+ - **Limits.** `maxRounds` (12), `budget { tokens, toolCalls, wallMs }` (`"budget"`), `signal` (`"aborted"`) and a
551
+ provider cut (`"length"`). A limit that is not a valid number is an `error` before any model call. `wallMs` and
552
+ `signal` also end a run waiting on a tool or on `approve`. `callAs` cannot cancel a call, so the run stops waiting
553
+ and answers it with an error saying it may still finish; a resume does not run it again, and the endpoint runs on
554
+ with its outcome unreported. There is no preamble unless `preamble` gives one; with no `instructions` either, a
555
+ short neutral prompt stands in, as each adaptor's own fallback is about a screen. `compact { at, keep }` summarizes
556
+ the head, and a tool result is capped at 20,000 characters as the browser caps it. Its calls carry no ip, so an
557
+ ip-scoped `rateLimit` counts them under one unknown address.
558
+
517
559
  ## Rolling MCP Out To An App
518
560
 
519
561
  The goal of exposing a service over MCP is that a person uses it through an agent instead of through the page:
@@ -20,10 +20,10 @@ import {
20
20
  DevChangePlanner,
21
21
  DevGeneratedIndexSync,
22
22
  SsrDevBundler
23
- } from "./index-rdx8cyv2.js";
23
+ } from "./index-bgp0h8rx.js";
24
24
  import {
25
25
  ServerGraphFile
26
- } from "./index-9xh4zvw3.js";
26
+ } from "./index-wpgtyek3.js";
27
27
  import"./index-nd39rssn.js";
28
28
  import {
29
29
  FrameworkGraph
@@ -12,7 +12,7 @@ import {
12
12
  } from "./index-m9jj544v.js";
13
13
  import {
14
14
  CsrArtifactBuilder
15
- } from "./index-z43wddce.js";
15
+ } from "./index-6js9ek5c.js";
16
16
  import {
17
17
  ExitCodeError
18
18
  } from "./index-23d8gw08.js";
@@ -10,7 +10,7 @@ import {
10
10
  CsrEntryFiles,
11
11
  PagesEntrySourceGenerator,
12
12
  PagesBundleBuilder
13
- } from "./index-9xh4zvw3.js";
13
+ } from "./index-wpgtyek3.js";
14
14
 
15
15
  // pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
16
16
  import { mkdir as mkdir2, rm as rm2, unlink as unlink2 } from "fs/promises";
@@ -6,7 +6,7 @@ import {
6
6
  CloudApi,
7
7
  CloudUpdates,
8
8
  PipelineSecrets
9
- } from "./index-7ky4brfy.js";
9
+ } from "./index-70jkxbf6.js";
10
10
  import {
11
11
  resolveMobileTargets
12
12
  } from "./index-m9jj544v.js";
@@ -16,7 +16,7 @@ import {
16
16
  } from "./index-sq9d0jhj.js";
17
17
  import {
18
18
  NativeApp
19
- } from "./index-dsg50er9.js";
19
+ } from "./index-3m2cd8mm.js";
20
20
  import {
21
21
  runner,
22
22
  assertPromptable
@@ -9,7 +9,7 @@ import {
9
9
  UpdatePackFolder,
10
10
  NativePublicEnv,
11
11
  NativeApp
12
- } from "./index-dsg50er9.js";
12
+ } from "./index-3m2cd8mm.js";
13
13
  import {
14
14
  ExitCodeError
15
15
  } from "./index-23d8gw08.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  GlobalConfig,
4
4
  CloudApi
5
- } from "./index-7ky4brfy.js";
5
+ } from "./index-70jkxbf6.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/tunnel/TunnelShare.ts
8
8
  import { TunnelAgent } from "akanjs/server/tunnel";
@@ -35,7 +35,7 @@ import {
35
35
  import {
36
36
  ApplicationRunner,
37
37
  VerifyScope
38
- } from "./index-4k9nv4m3.js";
38
+ } from "./index-mmgtnh44.js";
39
39
  import {
40
40
  WorkspaceRunner
41
41
  } from "./index-apcr1qgk.js";
@@ -21,7 +21,7 @@ import {
21
21
  CsrDevPaths,
22
22
  PagesEntrySourceGenerator,
23
23
  PagesBundleBuilder
24
- } from "./index-9xh4zvw3.js";
24
+ } from "./index-wpgtyek3.js";
25
25
  import {
26
26
  AsyncDefaultExportDetector,
27
27
  StoreBootstrap,
@@ -18,14 +18,14 @@ import {
18
18
  } from "./index-sq9d0jhj.js";
19
19
  import {
20
20
  DesktopServerStage
21
- } from "./index-6z57w95f.js";
21
+ } from "./index-s0w78805.js";
22
22
  import {
23
23
  LibraryScript
24
24
  } from "./index-t8h09yjs.js";
25
25
  import {
26
26
  ApplicationRunner,
27
27
  VerifyScope
28
- } from "./index-4k9nv4m3.js";
28
+ } from "./index-mmgtnh44.js";
29
29
  import {
30
30
  PreviewChrome2,
31
31
  PreviewView2,
@@ -1683,7 +1683,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
1683
1683
  await Promise.all(shares.map(async (share) => await share.close()));
1684
1684
  }, "Abandoning the tunnel release; the shares expire on their own.");
1685
1685
  await Promise.all(apps.map(async (app) => {
1686
- const { TunnelShare } = await import("./TunnelShare-44er4e29.js");
1686
+ const { TunnelShare } = await import("./TunnelShare-ndb5cts1.js");
1687
1687
  const share = await TunnelShare.open(app, { workspace: app.workspace });
1688
1688
  shares.push(share);
1689
1689
  urls.set(app.name, share.url);
@@ -19,7 +19,7 @@ import {
19
19
  SubagentPool2,
20
20
  McpSignIn,
21
21
  AkanCodeCompaction2
22
- } from "./index-b3pr4ee6.js";
22
+ } from "./index-pcprf7ft.js";
23
23
  import {
24
24
  codeAgentIsLoopback,
25
25
  codeAgentHostListed,
@@ -659,7 +659,7 @@ class AkanToolPack2 {
659
659
  return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
660
660
  }
661
661
  async names() {
662
- const { ContextRunner } = await import("./context.runner-w071gmc3.js");
662
+ const { ContextRunner } = await import("./context.runner-5s2ytkjj.js");
663
663
  return [
664
664
  ...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
665
665
  AkanToolPack2.verifyToolName
@@ -667,7 +667,7 @@ class AkanToolPack2 {
667
667
  }
668
668
  static verifyToolName = "akan_verify";
669
669
  async#register(pi) {
670
- const { ContextRunner } = await import("./context.runner-w071gmc3.js");
670
+ const { ContextRunner } = await import("./context.runner-5s2ytkjj.js");
671
671
  const runner = new ContextRunner;
672
672
  const guidelineNames = await AkanToolPack2.#guidelineNames();
673
673
  for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
@@ -4,7 +4,7 @@ import {
4
4
  CloudApi,
5
5
  CloudUpdates,
6
6
  PipelineSecrets
7
- } from "./index-7ky4brfy.js";
7
+ } from "./index-70jkxbf6.js";
8
8
  import {
9
9
  PkgExecutor
10
10
  } from "./index-sq9d0jhj.js";
@@ -12,19 +12,19 @@ import {
12
12
  UpdatePackFolder,
13
13
  NativePublicEnv,
14
14
  NativeApp
15
- } from "./index-dsg50er9.js";
15
+ } from "./index-3m2cd8mm.js";
16
16
  import {
17
17
  script
18
18
  } from "./index-23d8gw08.js";
19
19
  import {
20
20
  ApplicationScript
21
- } from "./index-5jwx4bf2.js";
21
+ } from "./index-bmscnt1t.js";
22
22
  import {
23
23
  PackageScript
24
24
  } from "./index-6fnrhpn1.js";
25
25
  import {
26
26
  CloudRunner
27
- } from "./index-p4htjyvk.js";
27
+ } from "./index-6r5f768n.js";
28
28
 
29
29
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
30
30
  import { Logger } from "akanjs/common";
@@ -10,7 +10,7 @@ import {
10
10
  } from "./index-23d8gw08.js";
11
11
  import {
12
12
  ContextRunner2
13
- } from "./index-xfv2p7b5.js";
13
+ } from "./index-wm4385pm.js";
14
14
 
15
15
  // pkgs/@akanjs/cli/context/context.script.ts
16
16
  import { Logger } from "akanjs/common";
@@ -59,10 +59,10 @@ import {
59
59
  UpdateUploader,
60
60
  NativePublicEnv,
61
61
  NativeApp
62
- } from "./index-dsg50er9.js";
62
+ } from "./index-3m2cd8mm.js";
63
63
  import {
64
64
  DesktopServerStage
65
- } from "./index-6z57w95f.js";
65
+ } from "./index-s0w78805.js";
66
66
  import {
67
67
  resolveMobileTargets,
68
68
  resolveAppId
@@ -2028,7 +2028,7 @@ var reportsNoTestFile = (exec) => {
2028
2028
  };
2029
2029
 
2030
2030
  // pkgs/@akanjs/cli/application/application.runner.ts
2031
- var loadBuildRunner = async () => (await import("./applicationBuildRunner-f4yf0qyc.js")).ApplicationBuildRunner;
2031
+ var loadBuildRunner = async () => (await import("./applicationBuildRunner-68sph7t4.js")).ApplicationBuildRunner;
2032
2032
  var loadPrompts = async () => await import("@inquirer/prompts");
2033
2033
 
2034
2034
  class ApplicationRunner extends runner("application") {
@@ -157,7 +157,7 @@ class SubagentPool2 {
157
157
  }
158
158
  }
159
159
  async#run(id, kind, prompt, signal) {
160
- const { CodeAgent } = await import("./CodeAgent-fk66n37w.js");
160
+ const { CodeAgent } = await import("./CodeAgent-cr8pvdmv.js");
161
161
  const budget = this.#options.parent.tools.subagent;
162
162
  const child = SubagentPool2.childOf(this.#options.parent, kind);
163
163
  const model = this.#options.model?.();
@@ -11,7 +11,7 @@ import {
11
11
  ClientEntriesBundler,
12
12
  VENDOR_SPECIFIERS,
13
13
  RouteClientBuilder
14
- } from "./index-rdx8cyv2.js";
14
+ } from "./index-bgp0h8rx.js";
15
15
  import {
16
16
  SOURCE_EXTS,
17
17
  FontOptimizer,
@@ -24,7 +24,7 @@ import {
24
24
  CsrEntryFiles,
25
25
  toClientReferencePath,
26
26
  PagesBundleBuilder
27
- } from "./index-9xh4zvw3.js";
27
+ } from "./index-wpgtyek3.js";
28
28
  import {
29
29
  CssBlockParser
30
30
  } from "./index-62md4dwy.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  DesktopBin
4
- } from "./index-dsg50er9.js";
4
+ } from "./index-3m2cd8mm.js";
5
5
  // pkgs/@akanjs/devkit/mobile/desktopServerStage.ts
6
6
  import { cp, mkdir, readdir, rm, writeFile } from "fs/promises";
7
7
  import path from "path";
@@ -24,10 +24,10 @@ import {
24
24
  } from "./index-23d8gw08.js";
25
25
  import {
26
26
  NativeApp
27
- } from "./index-dsg50er9.js";
27
+ } from "./index-3m2cd8mm.js";
28
28
  import {
29
29
  isPlaceholderAppId
30
- } from "./index-6z57w95f.js";
30
+ } from "./index-s0w78805.js";
31
31
  import {
32
32
  getMobileTargets,
33
33
  appIdsOf
@@ -102,17 +102,18 @@ class BarrelAnalyzer {
102
102
  const map = new Map;
103
103
  const read = new Set;
104
104
  this.#read.set(pkgName, read);
105
- await this.#walk(pkg.entryFile, pkg, map, read);
105
+ await this.#walk(pkg.entryFile, pkg, map, { visited: new Set, read, following: new Set([pkg.entryFile]) });
106
106
  return map;
107
107
  } catch (err) {
108
108
  this.#logger.error(`analyze failed for ${pkgName}: ${err.message}`);
109
109
  return null;
110
110
  }
111
111
  }
112
- async#walk(absFile, pkg, map, visited) {
113
- if (visited.has(absFile))
112
+ async#walk(absFile, pkg, map, walk) {
113
+ if (walk.visited.has(absFile))
114
114
  return;
115
- visited.add(absFile);
115
+ walk.visited.add(absFile);
116
+ walk.read.add(absFile);
116
117
  const file = Bun.file(absFile);
117
118
  if (!await file.exists())
118
119
  return;
@@ -123,13 +124,14 @@ class BarrelAnalyzer {
123
124
  const authoritative = this.#scanExports(source, absFile);
124
125
  authoritative.delete("default");
125
126
  const attributed = new Set;
126
- const attribute = (listBody, subpath) => {
127
+ const attribute = (listBody, subpath, source) => {
127
128
  for (const item of parseNamedList(listBody)) {
128
129
  if (item.isType || item.imported === "default" || !authoritative.has(item.local))
129
130
  continue;
130
131
  attributed.add(item.local);
131
- if (!map.has(item.local))
132
- map.set(item.local, { subpath, originalName: item.imported });
132
+ if (map.has(item.local))
133
+ continue;
134
+ map.set(item.local, source?.get(item.imported) ?? { subpath, originalName: item.imported });
133
135
  }
134
136
  };
135
137
  const starSpecs = [];
@@ -158,7 +160,7 @@ class BarrelAnalyzer {
158
160
  continue;
159
161
  const targetSubpath = this.#subpathFor(pkg, targetAbs);
160
162
  if (targetSubpath)
161
- attribute(namedList, targetSubpath);
163
+ attribute(namedList, targetSubpath, await this.#exportsOf(targetAbs, pkg, walk));
162
164
  }
163
165
  }
164
166
  LOCAL_NAMED_RE.lastIndex = 0;
@@ -178,9 +180,17 @@ class BarrelAnalyzer {
178
180
  for (const spec of starSpecs) {
179
181
  const targetAbs = await this.#resolveRel(absFile, spec);
180
182
  if (targetAbs)
181
- await this.#walk(targetAbs, pkg, map, visited);
183
+ await this.#walk(targetAbs, pkg, map, walk);
182
184
  }
183
185
  }
186
+ async#exportsOf(absFile, pkg, walk) {
187
+ if (walk.following.has(absFile))
188
+ return null;
189
+ const map = new Map;
190
+ const following = new Set([...walk.following, absFile]);
191
+ await this.#walk(absFile, pkg, map, { visited: new Set, read: walk.read, following });
192
+ return map;
193
+ }
184
194
  #scanExports(source, absFile) {
185
195
  try {
186
196
  const transpiler = [".tsx", ".jsx"].includes(path.extname(absFile)) ? this.#tsxTranspiler : this.#tsTranspiler;
@@ -1182,7 +1192,7 @@ class PagesBundleBuilder {
1182
1192
  edits.push({
1183
1193
  start: tokens[fetchProtoAt].start,
1184
1194
  end: fetchProtoEnd.end,
1185
- text: "const fetchProto = FetchClient.build<typeof signal>(cnst, serverFetch.serializedSignal, { Err: pageProto.Err, base: serverFetch });"
1195
+ text: "const fetchProto = FetchClient.build<typeof signal>(cnst, serverFetch.serializedSignal, { base: serverFetch });"
1186
1196
  });
1187
1197
  let transformed = source;
1188
1198
  for (const { start, end, text } of edits.sort((a, b) => b.start - a.start))
package/index.js CHANGED
@@ -23,27 +23,27 @@ import path from "path";
23
23
 
24
24
  // pkgs/@akanjs/cli/commandModules.ts
25
25
  var commandModules = {
26
- workspace: async () => (await import("./workspace.command-e4wfxm86.js")).WorkspaceCommand,
27
- agent: async () => (await import("./agent.command-7g9czkkd.js")).AgentCommand,
28
- code: async () => (await import("./code.command-m6c9xk56.js")).CodeCommand,
29
- application: async () => (await import("./application.command-00spg55s.js")).ApplicationCommand,
26
+ workspace: async () => (await import("./workspace.command-jm7emxjh.js")).WorkspaceCommand,
27
+ agent: async () => (await import("./agent.command-rp9hpf0v.js")).AgentCommand,
28
+ code: async () => (await import("./code.command-63fcz7a3.js")).CodeCommand,
29
+ application: async () => (await import("./application.command-fydjdvce.js")).ApplicationCommand,
30
30
  library: async () => (await import("./library.command-kc1zahcg.js")).LibraryCommand,
31
- localRegistry: async () => (await import("./localRegistry.command-bz2df40m.js")).LocalRegistryCommand,
31
+ localRegistry: async () => (await import("./localRegistry.command-yz150pcw.js")).LocalRegistryCommand,
32
32
  package: async () => (await import("./package.command-qcjajpv8.js")).PackageCommand,
33
33
  module: async () => (await import("./module.command-cchwzz9r.js")).ModuleCommand,
34
34
  page: async () => (await import("./page.command-1t86dx8a.js")).PageCommand,
35
- context: async () => (await import("./context.command-hgcgxtdk.js")).ContextCommand,
36
- cloud: async () => (await import("./cloud.command-ab704p0g.js")).CloudCommand,
37
- subspace: async () => (await import("./subspace.command-0970n7kd.js")).SubspaceCommand,
35
+ context: async () => (await import("./context.command-pgwcx0na.js")).ContextCommand,
36
+ cloud: async () => (await import("./cloud.command-0y1gg3sb.js")).CloudCommand,
37
+ subspace: async () => (await import("./subspace.command-ykxertx8.js")).SubspaceCommand,
38
38
  guideline: async () => (await import("./guideline.command-6yz6d4hf.js")).GuidelineCommand,
39
39
  scalar: async () => (await import("./scalar.command-rvwh98ny.js")).ScalarCommand,
40
40
  primitive: async () => (await import("./primitive.command-mc0x8txr.js")).PrimitiveCommand,
41
41
  quality: async () => (await import("./quality.command-11rayf5c.js")).QualityCommand,
42
- verify: async () => (await import("./verify.command-ynaztxr2.js")).VerifyCommand,
42
+ verify: async () => (await import("./verify.command-gvveq05z.js")).VerifyCommand,
43
43
  repair: async () => (await import("./repair.command-8w41vy78.js")).RepairCommand,
44
44
  workflow: async () => (await import("./workflow.command-yp9ajthb.js")).WorkflowCommand,
45
45
  pipeline: async () => (await import("./pipeline.command-2xx9z3d0.js")).PipelineCommand,
46
- tunnel: async () => (await import("./tunnel.command-bcy0rtmh.js")).TunnelCommand
46
+ tunnel: async () => (await import("./tunnel.command-qbcbj0vq.js")).TunnelCommand
47
47
  };
48
48
  var commandModuleIds = Object.keys(commandModules);
49
49
 
@@ -17,21 +17,21 @@ import {
17
17
  getNpmRegistryUrl
18
18
  } from "./index-ny2k80mv.js";
19
19
  import"./index-41mfhgq0.js";
20
- import"./index-dsg50er9.js";
21
- import"./index-6z57w95f.js";
20
+ import"./index-3m2cd8mm.js";
21
+ import"./index-s0w78805.js";
22
22
  import"./index-m9jj544v.js";
23
- import"./index-9xh4zvw3.js";
24
- import"./index-z43wddce.js";
23
+ import"./index-wpgtyek3.js";
24
+ import"./index-6js9ek5c.js";
25
25
  import"./index-t8h09yjs.js";
26
- import"./index-4k9nv4m3.js";
26
+ import"./index-mmgtnh44.js";
27
27
  import"./index-b4qq3rq0.js";
28
28
  import {
29
29
  ApplicationScript
30
- } from "./index-5jwx4bf2.js";
31
- import"./index-7ky4brfy.js";
30
+ } from "./index-bmscnt1t.js";
31
+ import"./index-70jkxbf6.js";
32
32
  import {
33
33
  CloudRunner
34
- } from "./index-p4htjyvk.js";
34
+ } from "./index-6r5f768n.js";
35
35
  import"./index-qd7xn2bk.js";
36
36
  import"./index-nd39rssn.js";
37
37
  import"./index-grt0e6kk.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.2.0-rc.10",
3
+ "version": "3.2.0-rc.12",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "1.3.0",
40
40
  "@inquirer/prompts": "^8.7.3",
41
41
  "@tailwindcss/node": "^4.3.3",
42
- "akanjs": "3.2.0-rc.10",
42
+ "akanjs": "3.2.0-rc.12",
43
43
  "chalk": "^6.0.1",
44
44
  "commander": "^15.0.0",
45
45
  "dayjs": "^1.11.23",
@@ -36,6 +36,9 @@ an endpoint with a real guard is published, one with none is refused, and so is
36
36
 
37
37
  - `plug(AgentToolsRole)` gives a service `listAs(account, { allow })` / `callAs(account, call)`: the same catalogue
38
38
  and refusals in-process, batch servers included. Pass only an account the server resolved, never client input.
39
+ - `this.agentService.loop({ account | principal, allow, messages, approve, untrusted, onMessage, meta, budget })`
40
+ runs a model over those tools until it answers; `option.setAgentAccountResolver` resolves a stored `principal`
41
+ before every round. Each round is metered as its own turn with `turn.loop` and `turn.meta`.
39
42
 
40
43
  ## Verify
41
44
 
@@ -18,11 +18,11 @@ import {
18
18
  } from "./index-sq9d0jhj.js";
19
19
  import {
20
20
  GlobalConfig
21
- } from "./index-7ky4brfy.js";
21
+ } from "./index-70jkxbf6.js";
22
22
  import"./index-m9jj544v.js";
23
- import"./index-dsg50er9.js";
24
- import"./index-9xh4zvw3.js";
25
- import"./index-z43wddce.js";
23
+ import"./index-3m2cd8mm.js";
24
+ import"./index-wpgtyek3.js";
25
+ import"./index-6js9ek5c.js";
26
26
  import {
27
27
  SubspaceConfig
28
28
  } from "./index-h7hehkw6.js";
@@ -819,7 +819,7 @@ class SubspaceRunner extends runner("subspace") {
819
819
  if (!asked)
820
820
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
821
821
  const { libs } = await subspace.slice();
822
- const { CloudScript } = await import("./cloud.script-4p4y0s7e.js");
822
+ const { CloudScript } = await import("./cloud.script-ewk72b3g.js");
823
823
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
824
824
  host,
825
825
  workspaceId,
@@ -19,7 +19,6 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
19
19
  return `
20
20
  import { FetchClient, type FetchClientType } from "akanjs/fetch";
21
21
  import { SignalRegistry, serverSignal${libs.length === 0 ? ", fetch as base" : ""} } from "akanjs/signal";
22
- import { Err } from "./dict";
23
22
  ${libs.map((lib) => `import { fetch as ${lib} } from "@libs/${lib}/lib/sig";`).join("\n")}
24
23
 
25
24
  ${databaseModules.map((module) => `import * as ${module}Sig from "./${module}/${module}.signal";`).join("\n")}
@@ -37,9 +36,6 @@ ${serviceModules.map((module) => `export const ${module} = SignalRegistry.regist
37
36
  export const fetchSignals = [${signalNames.join(", ")}] as const;
38
37
  export type Fetch = FetchClientType<typeof fetchSignals>;
39
38
  export const fetch = FetchClient.from(...fetchSignals) as unknown as Fetch;
40
- // A failure restored from another process is this scope's own Err, so a server hop that rethrows one keeps its
41
- // dictionary key and data instead of answering the original caller with Internal Server Error.
42
- fetch.setErrorConstructor(Err);
43
39
 
44
40
  export const getSerializedSignal = () => fetch.ownSerializedSignal
45
41
  `;
@@ -18,7 +18,7 @@ ${
18
18
  const dictionary = {};`
19
19
  }
20
20
  const pageProto = makePageProto<typeof dict>(dictionary);
21
- const fetchProto = FetchClient.build<typeof signal>(cnst, getSerializedSignal(), { Err: pageProto.Err });
21
+ const fetchProto = FetchClient.build<typeof signal>(cnst, getSerializedSignal());
22
22
  export const runtime = registerClientRuntime({ ...pageProto, ...fetchProto }, { scope: ${JSON.stringify(scanInfo?.type ?? "lib")} });
23
23
 
24
24
  export const { msg, Err, usePage, sig, fetch } = runtime;
@@ -13,14 +13,14 @@ import {
13
13
  import {
14
14
  GlobalConfig,
15
15
  CloudApi
16
- } from "./index-7ky4brfy.js";
16
+ } from "./index-70jkxbf6.js";
17
17
  import"./index-m9jj544v.js";
18
- import"./index-dsg50er9.js";
19
- import"./index-9xh4zvw3.js";
20
- import"./index-z43wddce.js";
18
+ import"./index-3m2cd8mm.js";
19
+ import"./index-wpgtyek3.js";
20
+ import"./index-6js9ek5c.js";
21
21
  import {
22
22
  TunnelShare2
23
- } from "./index-xy70tcv4.js";
23
+ } from "./index-ahk6rvth.js";
24
24
  import {
25
25
  writeClipboard
26
26
  } from "./index-p6pbz9n5.js";
@@ -13,13 +13,13 @@ import"./index-sq9d0jhj.js";
13
13
  import {
14
14
  ApplicationRunner,
15
15
  VerifyScope
16
- } from "./index-4k9nv4m3.js";
16
+ } from "./index-mmgtnh44.js";
17
17
  import"./index-41mfhgq0.js";
18
- import"./index-dsg50er9.js";
19
- import"./index-6z57w95f.js";
18
+ import"./index-3m2cd8mm.js";
19
+ import"./index-s0w78805.js";
20
20
  import"./index-m9jj544v.js";
21
- import"./index-9xh4zvw3.js";
22
- import"./index-z43wddce.js";
21
+ import"./index-wpgtyek3.js";
22
+ import"./index-6js9ek5c.js";
23
23
  import"./index-62md4dwy.js";
24
24
  import {
25
25
  WorkspaceRunner
@@ -30,35 +30,35 @@ import"./index-35j83zkd.js";
30
30
  import"./index-j6eeh5d7.js";
31
31
  import"./index-bper31wr.js";
32
32
  import"./index-dfsa009c.js";
33
- import"./index-4k9nv4m3.js";
33
+ import"./index-mmgtnh44.js";
34
34
  import"./index-41mfhgq0.js";
35
- import"./index-dsg50er9.js";
36
- import"./index-6z57w95f.js";
35
+ import"./index-3m2cd8mm.js";
36
+ import"./index-s0w78805.js";
37
37
  import"./index-m9jj544v.js";
38
- import"./index-9xh4zvw3.js";
39
- import"./index-z43wddce.js";
38
+ import"./index-wpgtyek3.js";
39
+ import"./index-6js9ek5c.js";
40
40
  import"./index-k2r3hmbz.js";
41
41
  import {
42
42
  AgentScript
43
- } from "./index-6eptmk8z.js";
43
+ } from "./index-axe04yqm.js";
44
44
  import {
45
45
  LibraryScript
46
46
  } from "./index-t8h09yjs.js";
47
47
  import"./index-b4qq3rq0.js";
48
48
  import {
49
49
  ApplicationScript
50
- } from "./index-5jwx4bf2.js";
51
- import"./index-7ky4brfy.js";
50
+ } from "./index-bmscnt1t.js";
51
+ import"./index-70jkxbf6.js";
52
52
  import"./index-qd7xn2bk.js";
53
53
  import"./index-grt0e6kk.js";
54
54
  import {
55
55
  PackageScript
56
56
  } from "./index-6fnrhpn1.js";
57
- import"./index-p4htjyvk.js";
57
+ import"./index-6r5f768n.js";
58
58
  import {
59
59
  CloudScript2
60
- } from "./index-hhagjhkh.js";
61
- import"./index-xfv2p7b5.js";
60
+ } from "./index-cswgczrv.js";
61
+ import"./index-wm4385pm.js";
62
62
  import"./index-xgqz3kak.js";
63
63
  import"./index-c3r23w24.js";
64
64
  import"./index-p54s83sz.js";
@@ -68,7 +68,7 @@ import"./index-hf9nvwam.js";
68
68
  import"./index-097bjwvm.js";
69
69
  import {
70
70
  ContextScript
71
- } from "./index-6qtxs86x.js";
71
+ } from "./index-h0s3cjm0.js";
72
72
  import"./index-frvjq1rd.js";
73
73
  import {
74
74
  assertPlainName