@akanjs/cli 3.1.1-rc.0 → 3.1.1-rc.2

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 (73) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-4pnxwptq.js → CodeAgent-8hfzq1zs.js} +2 -2
  3. package/{CodeTui-hhndze8h.js → CodeTui-kj6ng91g.js} +1 -1
  4. package/TunnelShare-ycmz33ve.js +14 -0
  5. package/{agent.command-p02330r6.js → agent.command-2gay26y4.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-ywks5ywm.js → application.command-a3aepayy.js} +16 -11
  8. package/{applicationBuildRunner-9cnnsdm5.js → applicationBuildRunner-xye2sqrm.js} +5 -5
  9. package/buildBatch.proc.js +5 -5
  10. package/{cloud.command-1tzkvje1.js → cloud.command-t2zdcw87.js} +13 -13
  11. package/cloud.script-mm636g83.js +24 -0
  12. package/{code.command-16pm1p2v.js → code.command-184jfjtk.js} +6 -6
  13. package/{context.command-6ys86sqf.js → context.command-kx0kzz3t.js} +16 -16
  14. package/context.runner-d7dhvbc7.js +25 -0
  15. package/{guideline.command-3zay3d8g.js → guideline.command-72psmnpx.js} +2 -2
  16. package/guidelines/conventions/conventions.instruction.md +7 -3
  17. package/guidelines/mcpRule/mcpRule.instruction.md +13 -6
  18. package/guidelines/pageRule/pageRule.instruction.md +13 -5
  19. package/guidelines/runtimeRule/runtimeRule.instruction.md +8 -2
  20. package/guidelines/ssrRule/ssrRule.instruction.md +6 -1
  21. package/guidelines/transportRule/transportRule.instruction.md +12 -5
  22. package/incrementalBuilder.proc.js +3 -3
  23. package/{index-sh9mmp5v.js → index-0dnv1039.js} +7 -7
  24. package/{index-jgs8z8xb.js → index-0fpeb7x7.js} +1 -1
  25. package/{index-b5vptvnt.js → index-3wfw8jb8.js} +4 -4
  26. package/{index-q8age5az.js → index-4g6te8sa.js} +2 -2
  27. package/{index-sng3vt0p.js → index-4q1amb3p.js} +2 -2
  28. package/{index-zn6bn1s2.js → index-5anqj3bm.js} +4 -4
  29. package/{index-ynqxpwx6.js → index-9z37veck.js} +1 -1
  30. package/{index-p4dnj2wc.js → index-azrhhgtb.js} +1 -1
  31. package/{index-4w3skd33.js → index-bxjacq5c.js} +3 -3
  32. package/{index-ngpn9hzy.js → index-eyhqttvh.js} +2 -2
  33. package/{index-kcbq2qcf.js → index-ggfjqpp4.js} +1 -1
  34. package/{index-bb4hj03s.js → index-hqaa4y3y.js} +8 -8
  35. package/{index-1f33g2z5.js → index-hrc7q2e6.js} +17 -12
  36. package/{index-qtkycaqn.js → index-jn8gfj2b.js} +30 -15
  37. package/{index-e9e9cebg.js → index-kb51mayy.js} +3 -3
  38. package/{index-z6v7k9sb.js → index-md6026rp.js} +2 -2
  39. package/{index-tk3jg2bm.js → index-mtf0cx8t.js} +2 -2
  40. package/{index-g2s33373.js → index-q0e6604h.js} +1 -1
  41. package/{index-1mfyyxh5.js → index-qp73c26e.js} +3 -3
  42. package/{index-vg28jsf9.js → index-rqcmr940.js} +172 -70
  43. package/{index-z9xepn8t.js → index-s28awecf.js} +3 -3
  44. package/{index-jaa81e9r.js → index-ssseyt0n.js} +4 -4
  45. package/{index-qkcwsg6r.js → index-sxqjxb4j.js} +2 -2
  46. package/{index-rr7jk14m.js → index-trjhp735.js} +8 -5
  47. package/{index-9hbhm6cs.js → index-v1gz5vja.js} +1 -1
  48. package/{index-68c3gzvg.js → index-x6c29k5m.js} +7 -7
  49. package/{index-ekpp5tax.js → index-xhnw8n74.js} +1 -1
  50. package/{index-fmder14z.js → index-yaz7yks8.js} +1 -1
  51. package/{index-qfzfaq96.js → index-zz5731qs.js} +3 -3
  52. package/index.js +22 -22
  53. package/{library.command-a8n9h8j4.js → library.command-tnxw0yb4.js} +3 -3
  54. package/{localRegistry.command-1e6m7w2f.js → localRegistry.command-dy0byd6z.js} +12 -12
  55. package/{module.command-b6f1p1xa.js → module.command-8pjk6vmm.js} +5 -5
  56. package/{package.command-tc27ftmy.js → package.command-b831nx2n.js} +3 -3
  57. package/package.json +2 -2
  58. package/{page.command-m5wyqfkd.js → page.command-earjccmn.js} +3 -3
  59. package/{pipeline.command-4qxyafpz.js → pipeline.command-yt8bq91c.js} +2 -2
  60. package/{primitive.command-9yaatk0d.js → primitive.command-8dw8ra1x.js} +6 -6
  61. package/{projectTypecheck-87k6z6ab.js → projectTypecheck-btbw3nyf.js} +1 -1
  62. package/{quality.command-ht1wjhv8.js → quality.command-j2c4a2zg.js} +387 -73
  63. package/{repair.command-evg9g911.js → repair.command-7jv7bgc4.js} +5 -5
  64. package/{scalar.command-xsejjeq1.js → scalar.command-vwjk94zr.js} +4 -4
  65. package/{subspace.command-ps12q5y7.js → subspace.command-xjw4tc0p.js} +8 -8
  66. package/templates/env/_env.server.type.ts +10 -5
  67. package/templates/facetIndex/index.ts +2 -2
  68. package/{tunnel.command-khzgvrj8.js → tunnel.command-zm29dgkr.js} +7 -7
  69. package/{workflow.command-qpyq0ya5.js → workflow.command-nyjc1mxx.js} +10 -10
  70. package/{workspace.command-3dq7e9g2.js → workspace.command-rq7mgq6f.js} +27 -25
  71. package/TunnelShare-zmq6bbar.js +0 -14
  72. package/cloud.script-8g83xqdg.js +0 -24
  73. package/context.runner-3jrypwe3.js +0 -25
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- ae28fc486e1361557772a6da6df80ce34a1f511109c2cd221c2f1848e6a7074b
1
+ 38e5d701205b086217ece1347934c9ac7c5aa7b31adb4dac7728403307aab399
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgent2
4
- } from "./index-4w3skd33.js";
5
- import"./index-9hbhm6cs.js";
4
+ } from "./index-bxjacq5c.js";
5
+ import"./index-v1gz5vja.js";
6
6
  import"./index-7md2g9vw.js";
7
7
  export {
8
8
  CodeAgent2 as CodeAgent
@@ -5,7 +5,7 @@ import {
5
5
  McpTokenStore,
6
6
  McpSignIn,
7
7
  AkanCodeCompaction2
8
- } from "./index-9hbhm6cs.js";
8
+ } from "./index-v1gz5vja.js";
9
9
  import {
10
10
  CodeTuiLines2,
11
11
  CodeTuiAgents2,
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-ggfjqpp4.js";
5
+ import"./index-hrc7q2e6.js";
6
+ import"./index-s28awecf.js";
7
+ import"./index-m9jj544v.js";
8
+ import"./index-4g6te8sa.js";
9
+ import"./index-0fpeb7x7.js";
10
+ import"./index-trjhp735.js";
11
+ import"./index-52w0fvh8.js";
12
+ export {
13
+ TunnelShare2 as TunnelShare
14
+ };
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-p4dnj2wc.js";
5
+ } from "./index-azrhhgtb.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-rr7jk14m.js";
7
+ import"./index-trjhp735.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-ynqxpwx6.js";
10
- import"./index-z6v7k9sb.js";
9
+ import"./index-9z37veck.js";
10
+ import"./index-md6026rp.js";
11
11
  import"./index-zzvvc845.js";
12
12
  import {
13
13
  AgentScript
14
- } from "./index-1mfyyxh5.js";
14
+ } from "./index-qp73c26e.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/agent/agent.command.ts
17
17
  class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
package/akanCode.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  CodeMailbox2,
29
29
  CodeSessionFork2,
30
30
  CodeAgent2
31
- } from "./index-4w3skd33.js";
31
+ } from "./index-bxjacq5c.js";
32
32
  import {
33
33
  akanCodeDefaultModel2,
34
34
  akanCodeModel2,
@@ -40,7 +40,7 @@ import {
40
40
  SubagentPool2,
41
41
  akanCodePaths2,
42
42
  AkanCodeCompaction2
43
- } from "./index-9hbhm6cs.js";
43
+ } from "./index-v1gz5vja.js";
44
44
  import"./index-7md2g9vw.js";
45
45
  import {
46
46
  CodeAgentRpcHost2
@@ -7,19 +7,19 @@ import {
7
7
  Exec,
8
8
  Workspace,
9
9
  command
10
- } from "./index-p4dnj2wc.js";
10
+ } from "./index-azrhhgtb.js";
11
11
  import"./index-52w0fvh8.js";
12
- import"./index-rr7jk14m.js";
12
+ import"./index-trjhp735.js";
13
13
  import"./index-5nd1wtkv.js";
14
- import"./index-ekpp5tax.js";
14
+ import"./index-xhnw8n74.js";
15
15
  import"./index-m9jj544v.js";
16
- import"./index-z9xepn8t.js";
17
- import"./index-q8age5az.js";
18
- import"./index-jgs8z8xb.js";
19
- import"./index-qkcwsg6r.js";
16
+ import"./index-s28awecf.js";
17
+ import"./index-4g6te8sa.js";
18
+ import"./index-0fpeb7x7.js";
19
+ import"./index-sxqjxb4j.js";
20
20
  import {
21
21
  ApplicationScript
22
- } from "./index-qtkycaqn.js";
22
+ } from "./index-jn8gfj2b.js";
23
23
  import"./index-7md2g9vw.js";
24
24
  import {
25
25
  writeOption,
@@ -28,7 +28,7 @@ import {
28
28
  allowLocalOption,
29
29
  publicEnvOption
30
30
  } from "./index-mdjc93e1.js";
31
- import"./index-fmder14z.js";
31
+ import"./index-yaz7yks8.js";
32
32
 
33
33
  // pkgs/@akanjs/cli/application/application.command.ts
34
34
  import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
@@ -130,8 +130,13 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
130
130
  typecheck: target({ short: true, desc: "Typecheck an app or a library, its tests and specs included" }).with(SysOrOnlyApp).option("write", Boolean, writeOption).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).option("tests", Boolean, { desc: "check its *.test.ts / *.spec.ts too, which nothing imports", default: true }).exec(async function(sys, write, clean, incremental, tests) {
131
131
  await this.applicationScript.typecheck(sys, { write, clean, incremental, tests });
132
132
  }),
133
- test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).option("write", Boolean, writeOption).exec(async function(exec, write) {
134
- await this.applicationScript.test(exec, { write });
133
+ test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).arg("files", String, {
134
+ desc: "test files or folders to run, relative to the target or the workspace root, comma-separated (default: all)",
135
+ example: "lib/user/user.signal.test.ts",
136
+ nullable: true
137
+ }).option("write", Boolean, writeOption).exec(async function(exec, files, write) {
138
+ const testFiles = (files ?? "").split(",").map((file) => file.trim()).filter(Boolean);
139
+ await this.applicationScript.test(exec, { write, files: testFiles });
135
140
  }),
136
141
  buildIos: target({ short: true, desc: "Build the iOS app on the native runtime" }).with(App).option("target", String, nativeTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, writeOption).exec(async function(app, target, env, debug, write) {
137
142
  await this.applicationScript.buildIos(app, { target, env, profile: debug ? "debug" : "release", write });
@@ -4,19 +4,19 @@ import {
4
4
  Spinner,
5
5
  ProjectTypecheck2,
6
6
  WorkspaceExecutor
7
- } from "./index-rr7jk14m.js";
7
+ } from "./index-trjhp735.js";
8
8
  import"./index-52w0fvh8.js";
9
- import"./index-ngpn9hzy.js";
10
- import"./index-jgs8z8xb.js";
9
+ import"./index-eyhqttvh.js";
10
+ import"./index-0fpeb7x7.js";
11
11
  import {
12
12
  AllRoutesBuilder,
13
13
  FontPruner,
14
14
  precompressArtifacts,
15
15
  SsrBaseArtifactBuilder
16
- } from "./index-e9e9cebg.js";
16
+ } from "./index-kb51mayy.js";
17
17
  import {
18
18
  CsrArtifactBuilder
19
- } from "./index-q8age5az.js";
19
+ } from "./index-4g6te8sa.js";
20
20
  import"./index-62md4dwy.js";
21
21
 
22
22
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
@@ -6,26 +6,26 @@ import {
6
6
  resolveSsrPageEntriesForApp,
7
7
  WorkspaceExecutor,
8
8
  AppExecutor
9
- } from "./index-rr7jk14m.js";
9
+ } from "./index-trjhp735.js";
10
10
  import {
11
11
  computeRouteSeedIndex,
12
12
  saveRouteSeedIndex,
13
13
  CsrDevBundler,
14
14
  SsrDevBundler
15
- } from "./index-ngpn9hzy.js";
15
+ } from "./index-eyhqttvh.js";
16
16
  import"./index-52w0fvh8.js";
17
17
  import {
18
18
  ServerGraphFile,
19
19
  PagesBundleBuilder
20
- } from "./index-jgs8z8xb.js";
20
+ } from "./index-0fpeb7x7.js";
21
21
  import {
22
22
  CssCompiler,
23
23
  FontOptimizer,
24
24
  SsrBaseArtifactBuilder
25
- } from "./index-e9e9cebg.js";
25
+ } from "./index-kb51mayy.js";
26
26
  import {
27
27
  CsrArtifactBuilder
28
- } from "./index-q8age5az.js";
28
+ } from "./index-4g6te8sa.js";
29
29
  import"./index-62md4dwy.js";
30
30
 
31
31
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
@@ -3,27 +3,27 @@ import {
3
3
  App,
4
4
  Workspace,
5
5
  command
6
- } from "./index-p4dnj2wc.js";
6
+ } from "./index-azrhhgtb.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-rr7jk14m.js";
9
- import"./index-1f33g2z5.js";
8
+ import"./index-trjhp735.js";
9
+ import"./index-hrc7q2e6.js";
10
10
  import {
11
11
  PlatformTestRun
12
- } from "./index-vg28jsf9.js";
13
- import"./index-ekpp5tax.js";
12
+ } from "./index-rqcmr940.js";
13
+ import"./index-xhnw8n74.js";
14
14
  import"./index-m9jj544v.js";
15
- import"./index-z9xepn8t.js";
16
- import"./index-q8age5az.js";
17
- import"./index-jgs8z8xb.js";
15
+ import"./index-s28awecf.js";
16
+ import"./index-4g6te8sa.js";
17
+ import"./index-0fpeb7x7.js";
18
18
  import"./index-5nd1wtkv.js";
19
- import"./index-qkcwsg6r.js";
20
- import"./index-qtkycaqn.js";
19
+ import"./index-sxqjxb4j.js";
20
+ import"./index-jn8gfj2b.js";
21
21
  import"./index-7md2g9vw.js";
22
22
  import"./index-tvehn2sp.js";
23
- import"./index-tk3jg2bm.js";
23
+ import"./index-mtf0cx8t.js";
24
24
  import {
25
25
  CloudScript2
26
- } from "./index-68c3gzvg.js";
26
+ } from "./index-x6c29k5m.js";
27
27
  import {
28
28
  writeOption,
29
29
  oneNativeTargetOption,
@@ -34,7 +34,7 @@ import {
34
34
  hostOption,
35
35
  subspaceOption
36
36
  } from "./index-mdjc93e1.js";
37
- import"./index-fmder14z.js";
37
+ import"./index-yaz7yks8.js";
38
38
 
39
39
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
40
40
  var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
@@ -0,0 +1,24 @@
1
+ // @bun
2
+ import {
3
+ CloudScript2
4
+ } from "./index-x6c29k5m.js";
5
+ import"./index-rqcmr940.js";
6
+ import"./index-jn8gfj2b.js";
7
+ import"./index-yaz7yks8.js";
8
+ import"./index-sxqjxb4j.js";
9
+ import"./index-mtf0cx8t.js";
10
+ import"./index-xhnw8n74.js";
11
+ import"./index-hrc7q2e6.js";
12
+ import"./index-s28awecf.js";
13
+ import"./index-m9jj544v.js";
14
+ import"./index-azrhhgtb.js";
15
+ import"./index-7md2g9vw.js";
16
+ import"./index-4g6te8sa.js";
17
+ import"./index-5nd1wtkv.js";
18
+ import"./index-0fpeb7x7.js";
19
+ import"./index-trjhp735.js";
20
+ import"./index-tvehn2sp.js";
21
+ import"./index-52w0fvh8.js";
22
+ export {
23
+ CloudScript2 as CloudScript
24
+ };
@@ -4,9 +4,9 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-p4dnj2wc.js";
7
+ } from "./index-azrhhgtb.js";
8
8
  import"./index-52w0fvh8.js";
9
- import"./index-rr7jk14m.js";
9
+ import"./index-trjhp735.js";
10
10
  import {
11
11
  akanCodeDefaultModel2,
12
12
  CodeAgentStreamPrinter2
@@ -19,7 +19,7 @@ class CodeRunner extends runner("code") {
19
19
  async serve(options, listen) {
20
20
  await import("./consoleToStderr-h5bryj94.js");
21
21
  const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
22
- import("./CodeAgent-4pnxwptq.js"),
22
+ import("./CodeAgent-8hfzq1zs.js"),
23
23
  import("./CodeAgentRpcHost-9g27hmer.js"),
24
24
  import("./CodeAgentRpcListener-7p7z5dd7.js")
25
25
  ]);
@@ -34,8 +34,8 @@ class CodeRunner extends runner("code") {
34
34
  }
35
35
  async tui(options, seed) {
36
36
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
37
- import("./CodeAgent-4pnxwptq.js"),
38
- import("./CodeTui-hhndze8h.js")
37
+ import("./CodeAgent-8hfzq1zs.js"),
38
+ import("./CodeTui-kj6ng91g.js")
39
39
  ]);
40
40
  const agentOptions = await CodeRunner.#agentOptions(options, false);
41
41
  let resume = options.resume;
@@ -67,7 +67,7 @@ class CodeRunner extends runner("code") {
67
67
  }
68
68
  }
69
69
  async run(prompt, options) {
70
- const { CodeAgent } = await import("./CodeAgent-4pnxwptq.js");
70
+ const { CodeAgent } = await import("./CodeAgent-8hfzq1zs.js");
71
71
  const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
72
72
  const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
73
73
  agent.on((event) => printer.print(event));
@@ -2,28 +2,28 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-p4dnj2wc.js";
5
+ } from "./index-azrhhgtb.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-rr7jk14m.js";
7
+ import"./index-trjhp735.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-ynqxpwx6.js";
10
- import"./index-z6v7k9sb.js";
11
- import"./index-bb4hj03s.js";
12
- import"./index-ekpp5tax.js";
9
+ import"./index-9z37veck.js";
10
+ import"./index-md6026rp.js";
11
+ import"./index-hqaa4y3y.js";
12
+ import"./index-xhnw8n74.js";
13
13
  import"./index-m9jj544v.js";
14
- import"./index-z9xepn8t.js";
15
- import"./index-q8age5az.js";
16
- import"./index-jgs8z8xb.js";
14
+ import"./index-s28awecf.js";
15
+ import"./index-4g6te8sa.js";
16
+ import"./index-0fpeb7x7.js";
17
17
  import"./index-zzvvc845.js";
18
- import"./index-qfzfaq96.js";
19
- import"./index-g2s33373.js";
20
- import"./index-b5vptvnt.js";
21
- import"./index-zn6bn1s2.js";
22
- import"./index-sng3vt0p.js";
23
- import"./index-sh9mmp5v.js";
18
+ import"./index-zz5731qs.js";
19
+ import"./index-q0e6604h.js";
20
+ import"./index-3wfw8jb8.js";
21
+ import"./index-5anqj3bm.js";
22
+ import"./index-4q1amb3p.js";
23
+ import"./index-0dnv1039.js";
24
24
  import {
25
25
  ContextScript
26
- } from "./index-jaa81e9r.js";
26
+ } from "./index-ssseyt0n.js";
27
27
 
28
28
  // pkgs/@akanjs/cli/context/context.command.ts
29
29
  class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
@@ -0,0 +1,25 @@
1
+ // @bun
2
+ import {
3
+ ContextRunner2
4
+ } from "./index-hqaa4y3y.js";
5
+ import"./index-0dnv1039.js";
6
+ import"./index-4q1amb3p.js";
7
+ import"./index-5anqj3bm.js";
8
+ import"./index-zz5731qs.js";
9
+ import"./index-3wfw8jb8.js";
10
+ import"./index-q0e6604h.js";
11
+ import"./index-xhnw8n74.js";
12
+ import"./index-s28awecf.js";
13
+ import"./index-m9jj544v.js";
14
+ import"./index-md6026rp.js";
15
+ import"./index-9z37veck.js";
16
+ import"./index-zzvvc845.js";
17
+ import"./index-azrhhgtb.js";
18
+ import"./index-4g6te8sa.js";
19
+ import"./index-0fpeb7x7.js";
20
+ import"./index-trjhp735.js";
21
+ import"./index-hj6w4ka1.js";
22
+ import"./index-52w0fvh8.js";
23
+ export {
24
+ ContextRunner2 as ContextRunner
25
+ };
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  script,
4
4
  command
5
- } from "./index-p4dnj2wc.js";
5
+ } from "./index-azrhhgtb.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-rr7jk14m.js";
7
+ import"./index-trjhp735.js";
8
8
  import {
9
9
  Prompter2
10
10
  } from "./index-zzvvc845.js";
@@ -160,9 +160,10 @@ not "fix" it back.
160
160
  - Bun's runner (`describe`, `expect`, `test` from `bun:test`); colocated `*.test.ts` / `*.spec.ts`; focused behavior
161
161
  tests of public contracts and edge cases. A placeholder `it` with a descriptive title is the floor; a
162
162
  security-relevant behaviour gets a real suite.
163
- - Run `bun run akan test <pkg>` from the root, or `cd <pkg> && bun test --isolate`. Plain `bun test` shares one
164
- global object across files and fails dozens of tests from that pollution (`bunfig.toml` `[test] isolate` is not
165
- honored as of Bun 1.4.4); from the repo root it breaks subprocess stdio pipes.
163
+ - Run `bun run akan test <pkg> [files]` from the root (`files`: comma-separated paths from the target or the root;
164
+ the only way a signal test runs), or `cd <pkg> && bun test --isolate ./<file>`. Plain `bun test` shares one global
165
+ object across files and fails dozens of tests from that pollution (`bunfig.toml` `[test] isolate` is not honored as
166
+ of Bun 1.4.4); from the repo root it breaks subprocess stdio pipes.
166
167
  - Signal tests split in two: `<model>.signal.spec.ts` holds fixtures on `sampleOf(cnst.XInput)` with explicit
167
168
  `Promise<cnst.X>` returns and **no assertions**; `<model>.signal.test.ts` holds `describe("<Model> Signal")`,
168
169
  describe-scope `let` fixtures, one `beforeAll`, story-ordered `it`s, negatives via
@@ -505,6 +506,9 @@ export default page()
505
506
  - `.render()` gets the declared args flat and typed (no `PageProps`, no `loader=` prop). Order: `usePage()`, fetch,
506
507
  return; auth is the chain's `.guard()`, which runs before anything renders. Hand `fetch.init*` / `view*` / `edit*` fields to sections unawaited; await only what the shell reads
507
508
  (title, redirect, link id) in one `Promise.all`.
509
+ - **A route never writes while it renders**: a `fetch.<mutation>()` in a stage or a component it renders throws
510
+ `base.error.mutationInRender`, since opening a link would perform it. Send it from a user action;
511
+ `{ duringRender: true }` only for a write harmless to repeat and safe for anyone to trigger (`ssrRule`).
508
512
  - Gate auth with `.guard(() => signedIn())` (`@libs/shared/webkit`; a new workspace has that lib only with
509
513
  `create-workspace --libs true`) at `_layout.tsx`, and repeat it on a page that needs more; it is a courtesy, the
510
514
  endpoint guards are the gate. `getSelf({ unauthorize })` in a body still works. `async` only when the body awaits;
@@ -40,6 +40,9 @@ export class FileSlice extends slice(srv.file, {
40
40
  `update`, `remove`), same fallbacks (`create`/`update`/`remove` inherit `cru`), and the same scope: it narrows
41
41
  the root slice and the generated CRUD, and never reaches a named slice or a custom endpoint. Those declare
42
42
  their own `mcp` beside their own `guards`. The bare `mcp: false` is every key at once, still within that scope.
43
+ - **An app's slice replaces a lib's whole**, on the server and in the client: its own `guards` (a `None` verb is
44
+ denied everywhere) and its own `mcp` map, or, when it writes none, every verb the lib's slice took off stays off.
45
+ To keep a mounted lib's tools off without its slice, use `setMcp({ excludeSignals, excludeEndpoints })` (below).
43
46
  - **A view keeps reaching it.** To a host that renders MCP Apps views, an endpoint refused for `mcp: false` alone
44
47
  is published with `visibility: ["app"]`: an app's view may call it, the model is never shown it (below). Every
45
48
  other refusal still holds there.
@@ -56,11 +59,13 @@ export class FileSlice extends slice(srv.file, {
56
59
  ## Configuration
57
60
  Settings live in the app's `lib/option.ts` — `option.setMcp({ … })`, taking `enabled`, `readOnly`, `path`,
58
61
  `version`, `instructions`, `allowedOrigins`, `pageSize`, `language`, `legacyTextBlock`, `outputSchema`, `rateLimit`,
59
- `promptBudget`, `apps`, `modern`, and `auth` — or `setMcp((env) => …)` for settings derived from the server env.
62
+ `promptBudget`, `apps`, `modern`, `auth`, and `excludeSignals` / `excludeEndpoints` (curation like `mcp: false`,
63
+ added up across libs, an unmatched name warned at boot) — or `setMcp((env) => …)` for settings derived from the
64
+ server env.
60
65
  **Not `main.ts`**: the gateway
61
66
  there only spawns children, and `option.ts` is the app-authored file `server.ts` already hands to the process that
62
67
  mounts `/mcp`. Every lib's option is read in mount order with the app's last, so an app tightens what a library
63
- declared without restating it. Each field also has an env spelling (`AKAN_MCP`, `AKAN_MCP_READONLY`,
68
+ declared without restating it. Each field but the two lists also has an env spelling (`AKAN_MCP`, `AKAN_MCP_READONLY`,
64
69
  `AKAN_MCP_PATH`, `AKAN_MCP_VERSION`, `AKAN_MCP_INSTRUCTIONS`, `AKAN_MCP_ALLOWED_ORIGINS`, `AKAN_MCP_PAGE_SIZE`,
65
70
  `AKAN_MCP_LANGUAGE`, `AKAN_MCP_LEGACY_TEXT`, `AKAN_MCP_OUTPUT_SCHEMA`, `AKAN_MCP_RATE_LIMIT`, `AKAN_MCP_CONCURRENT`,
66
71
  `AKAN_MCP_PROMPT_BUDGET`, `AKAN_MCP_APPS`, `AKAN_MCP_MODERN`, `AKAN_MCP_AUTH_SERVERS`, `AKAN_MCP_SCOPES`, `AKAN_MCP_RESOURCE`) for a deployment that configures what the source does
@@ -410,8 +415,9 @@ export default page()
410
415
  names share one namespace with the prompts, and an endpoint keeps its name over an app's, with a boot warning.
411
416
  - **`load` may only query.** A mutation, a file upload, a room subscription or a message sent while it runs throws
412
417
  `base.error.mutationInApp` before anything is sent — on the server through every `await`, in a browser for its
413
- synchronous part. Writes stay in `.render()` around the element (the `Close` above), and gating stays in
414
- `.guard()`: a `getSelf({ unauthorize })` inside `load` would redirect a view.
418
+ synchronous part, `{ duringRender: true }` or not. The buttons and forms that write stay in `.render()` around the
419
+ element (the `Close` above), and gating stays in `.guard()`: a `getSelf({ unauthorize })` inside `load` would
420
+ redirect a view.
415
421
  - **A host that declares the extension** (claude.ai, Claude Desktop, ChatGPT, VS Code, Goose) is also given
416
422
  `_meta.ui.resourceUri` (`ui://<app>/apps/<name>`) and draws the app's own view in place of the result: one HTML
417
423
  document per app, which `akan build` writes to `mcp-apps/<name>.html` beside `csr/` and `akan start` writes to
@@ -444,8 +450,9 @@ export default page()
444
450
  reaches the host with `base.error.readOnlyDeployment`, toasted in the person's language. A `.prompt()` page's text
445
451
  tool is dropped, since its run renders the whole page; the prompt stays.
446
452
  - **`.prompt()` is a briefing, never a view.** Its page is also a text tool of the same name, marked
447
- `readOnlyHint: false`, since running the page makes its own `fetch.*` calls, mutations included. To have a host draw
448
- part of that screen, declare an `.app()` beside it.
453
+ `readOnlyHint: false`, since running the page makes its own `fetch.*` calls; like any render it refuses a mutation
454
+ with `base.error.mutationInRender` unless the call passes `{ duringRender: true }`. To have a host draw part of that
455
+ screen, declare an `.app()` beside it.
449
456
  - **The view has no network.** `connect-src` stays closed; the app's own origin is opened for what a page loads by
450
457
  URL — fonts (served with `Access-Control-Allow-Origin: *`) and stored images — and every root-relative URL the
451
458
  page writes is pointed at it, since a host may block the document's `<base>` (Claude does).
@@ -41,6 +41,13 @@ body shape — this is the full contract behind them. Before changing route beha
41
41
  hydration, so an effect that needs the query on its first run takes the page's `.search()` value as a prop.
42
42
  - There is no `loader=` / `render=` page prop and no `PageProps` interface: the chain declares the arguments and
43
43
  `.render()` receives them flat, typed, with `lang` on every route and `children` added for a layout.
44
+ - **A route only reads while it renders.** A `fetch.<mutation>()` (or socket message) sent from `.render()`, `.guard()`,
45
+ `.head()`, `.loading()` or a layout's `.notFound()` / `.error()` (a `.prompt()` run included) throws
46
+ `base.error.mutationInRender` synchronously, before it is sent — a `.catch()` on its promise never sees it: opening a
47
+ link to the page would perform it. Send a write from a user action — a button through a store action. Only a write
48
+ that is harmless to repeat and safe for anyone to trigger (a warm-up) passes `{ duringRender: true }` as the option
49
+ after the endpoint's own arguments (`fetch.updateX(id, data, { duringRender: true })`). `akan quality` flags the call,
50
+ same-file helpers included, as `akan.ssr.render-mutation`.
44
51
 
45
52
  ## Route Guards — `.guard()`
46
53
 
@@ -82,11 +89,12 @@ body shape — this is the full contract behind them. Before changing route beha
82
89
  source), shares one namespace with every page's prompts and apps, and needs an English description. A name
83
90
  `.render()` already receives (`lang`, a `.param()` / `.search()` name, another app) fails to compile and throws when
84
91
  the module loads, as does an app named like the page's `.prompt()`.
85
- - **`load` may only query** (`base.error.mutationInApp` otherwise): keep writes in `.render()` around the element, and
86
- gating in `.guard()`. The view runs `load` with no layout body and no `.render()`: it gets the root layout's theme,
87
- fonts and framework providers through the generated `McpAppRoot` and the `_overrides.tsx` over the page (one the web
88
- draws outside the root layout wraps `McpAppRoot`, its toasts included), and nothing a layout body provides. The
89
- chain is the `export default` expression itself: one bound to a name fails the build. Full contract: `mcpRule`.
92
+ - **`load` may only query** (`base.error.mutationInApp` otherwise, `duringRender` or not): keep the buttons and forms
93
+ that write in `.render()` around the element, and gating in `.guard()`. The view runs `load` with no layout body
94
+ and no `.render()`: it gets the root layout's theme, fonts and framework providers through the generated
95
+ `McpAppRoot` and the `_overrides.tsx` over the page (one the web draws outside the root layout wraps `McpAppRoot`,
96
+ its toasts included), and nothing a layout body provides. The chain is the `export default` expression itself: one
97
+ bound to a name fails the build. Full contract: `mcpRule`.
90
98
 
91
99
  ## Heads
92
100
 
@@ -101,6 +101,10 @@ worker per web-serving replica.
101
101
  - **A solo process answers `/_akan/app/health`, `/_akan/app/metrics` and `/_akan/bench/ping` itself**, in the
102
102
  gateway's own shape — a `children` array with one entry — so a probe reads one contract either way. It owns the
103
103
  rotating log file the gateway would otherwise write, in the same `runtime/logs` directory.
104
+ - **Health detail and metrics answer only `Authorization: Bearer $AKAN_STATUS_TOKEN`** (or the log stream token)
105
+ outside `local`: without it `/_akan/app/health` is `{ status }` alone (still 200) and `/_akan/app/metrics` is 401.
106
+ A probe that reads only the status code needs nothing; give a scraper or monitor `AKAN_STATUS_TOKEN`, which reads
107
+ nothing else.
104
108
  - **Nothing supervises a solo process but the orchestrator**, since the gateway's crash-restart-with-backoff went
105
109
  with it. `infra/app/templates/app.yaml` carries the liveness, readiness and startup probes that replace it.
106
110
  - **`PORT` is the whole tree's port, and a server-side self-call follows it.** `AkanApp` resolves it once
@@ -209,7 +213,7 @@ normalized to `info` with one warning.
209
213
  `AKAN_LOG_STDOUT_LEVEL` (default: the console level); a child's or the RSC worker's crash stack is wrapped as a
210
214
  `raw=true` record instead of breaking the stream. Text stays the default; turn it on in the deployment.
211
215
  - **`AKAN_LOG_STREAM_TOKEN` mounts `/_akan/app/logs`** (SSE, `Last-Event-ID` resume, explicit `gap` events);
212
- unset, the route does not exist.
216
+ unset, the route does not exist. The same bearer also unlocks the health detail and metrics.
213
217
  - **`AKAN_LOG_CANONICAL=1|slow`** writes one `ok|error <endpoint> ms= status=` line per call; **`AKAN_LOG_FLIGHT=1`**
214
218
  keeps each call's last 64 sub-level records and promotes them (`flight=true`) only when it failed or ran past
215
219
  `AKAN_LOG_FLIGHT_MS`; an `x-akan-debug` header lowers one request to `trace` — in `local`, or with the
@@ -532,7 +536,9 @@ bypasses the store akanjs picks per platform (the shell's Preferences in an app)
532
536
  code never touches `document.cookie`, `localStorage` or `sessionStorage` (`no-document-cookie`, `no-web-storage`): it
533
537
  uses `getCookie` / `setCookie` / `removeCookie`, `storage`, and `secretStorage` for tokens and credentials, all from
534
538
  `akanjs/client`. `setCookie` writes `path=/; SameSite=Lax; Secure`, and an options object overrides only the keys it
535
- names — pass `sameSite: "none"` only for a cookie a cross-site POST must carry back. Browser APIs an app WebView lacks
539
+ names — pass `sameSite: "none"` only for a cookie a cross-site POST must carry back. `getCookie` reads a name sent
540
+ twice as unset, since a sibling subdomain can plant a second copy; server code reads `cookieJar()` from
541
+ `akanjs/fetch`, or `CookieJar.parse(req.headers.get("cookie"))`, never `req.cookies`. Browser APIs an app WebView lacks
536
542
  stay in a `webkit/` hook that branches on `isNativeApp()` from `akanjs/client/native`, which is where the app side goes
537
543
  too (`no-web-only-api-outside-webkit`, a warning): `navigator.share` / `canShare` (Android's WebView has none),
538
544
  `navigator.serviceWorker` and `Notification.requestPermission` / `.permission` (no app page has them),
@@ -28,7 +28,12 @@ on the client side**.
28
28
  - `akan.ssr.client-static-markup` — a large subtree wraps one or two interactive touches. Keep the interactive
29
29
  element in the client component and hoist the static subtree into a server component received as `children`.
30
30
  - `akan.ssr.client-mount-load` — a `useEffect(…, [])` loads server data. Fetch it in the route and pass the
31
- init/view object down.
31
+ init/view object down. A mutation is not a load: send it from a user action (a button through a store action),
32
+ never from the route.
33
+ - `akan.ssr.render-mutation` — a route's stages (a layout's `.notFound()` / `.error()` included), or a same-file
34
+ function they call, send a mutation, which throws `base.error.mutationInRender`: opening a link would perform it.
35
+ Move it to a user action; pass `{ duringRender: true }`, as the option after the endpoint's own arguments, only for
36
+ a write that is harmless to repeat and safe for anyone to trigger.
32
37
  - `akan.ssr.module-missing-server-view` — a module renders only from `Template`/`Zone`/`Util` and declares no
33
38
  `Unit`/`View`. Add them and have the `Zone` delegate.
34
39
  - `akan.ssr.template-client-state` — a `Template` holds form state in `useState`. Bind to the store instead:
@@ -20,14 +20,21 @@ HTTP verb a mutation is mounted under. `conventions` carries the invariants —
20
20
  - A websocket carries its credential in the handshake snapshot on `ws.data` (`AppWsData`); clients that hold the token in memory send it with `fetch.setJwt(...)`, which forwards an auth frame over the socket.
21
21
  - **Never read the caller's IP off the socket or the request peer — take `.with(Ip)`.** Whenever a federation
22
22
  gateway is in front, `ws.remoteAddress` and the child's own peer are the *gateway* (`127.0.0.1`) for every
23
- caller and for the whole life of every socket. `Ip` reads what a proxy recorded (`x-real-ip`, then the first
24
- `x-forwarded-for` entry) and falls back to the peer only when nothing proxied the call — which is the answer
25
- for a solo process behind an ingress that sets neither; `context.getClientIp()` is the same answer inside a
26
- guard or middleware. It arrives unwrapped from
23
+ caller and for the whole life of every socket. `Ip` reads forwarded headers only from a trusted peer — loopback,
24
+ a unix socket, and the private ranges until `AKAN_TRUSTED_PROXIES` (CIDRs or addresses, plus `private`, `none`,
25
+ `*`) replaces them; any other peer is the caller itself. Unset or `*`, it reads `x-real-ip`, else the leftmost
26
+ `x-forwarded-for` entry. A list walks `x-forwarded-for` from the nearest hop to the first untrusted address and
27
+ reads `x-real-ip` only without one — so list the load balancer's and ingress controller's own addresses (or a CIDR
28
+ holding only them), and have the proxy set or append `X-Forwarded-For` rather than pass the client's through.
29
+ `private` lets any pod in those ranges name any caller: pair it with a NetworkPolicy admitting only the ingress.
30
+ From any other peer `x-forwarded-host` / `-proto` / `-port` are dropped before a route runs, so a public proxy
31
+ that rewrites `Host` must be listed, or the browser's mutations fail the cross-site check.
32
+ The gateway hands its children the one address it resolved; `context.getClientIp()` is the same answer inside a
33
+ guard or middleware. It arrives in one canonical spelling, unwrapped from
27
34
  its `::ffff:` IPv4-mapped form, so it can address a `udp4` socket as well as identify a caller, and it is
28
35
  `null` rather than a placeholder when genuinely unknown — a loopback-looking address for an unknown caller
29
36
  is the failure this replaced. The gateway also forwards the client port (`x-forwarded-port`, read with
30
- `context.getClientPort()`) along with host and protocol.
37
+ `context.getClientPort()`), host and protocol, each taken from the request only when its peer is trusted.
31
38
  - **A device or another server proves itself with a machine token.** `MachineToken.issue({ kind, id, version },
32
39
  { expiresAt? })` in `akanjs/server` signs an EdDSA JWT (`typ: akan-machine+jwt`, `aud: <app>/<environment>`) with
33
40
  `AKAN_MACHINE_PRIVATE_KEY`; it never expires unless asked. `akan machine-keygen <file>` writes that key to a file
@@ -8,7 +8,7 @@ import {
8
8
  CodegenLock,
9
9
  WorkspaceExecutor,
10
10
  AppExecutor
11
- } from "./index-rr7jk14m.js";
11
+ } from "./index-trjhp735.js";
12
12
  import"./index-52w0fvh8.js";
13
13
  import {
14
14
  GraphClientEntryDiscovery,
@@ -19,10 +19,10 @@ import {
19
19
  DevChangePlanner,
20
20
  DevGeneratedIndexSync,
21
21
  SsrDevBundler
22
- } from "./index-ngpn9hzy.js";
22
+ } from "./index-eyhqttvh.js";
23
23
  import {
24
24
  ServerGraphFile
25
- } from "./index-jgs8z8xb.js";
25
+ } from "./index-0fpeb7x7.js";
26
26
  import {
27
27
  prepareDevWatchBatch
28
28
  } from "./index-a5vmm6x4.js";