@akanjs/cli 3.2.0-rc.9 → 3.3.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-fx6088tv.js +11 -0
  3. package/{CodeTui-qstk5vpj.js → CodeTui-zee8atsr.js} +822 -666
  4. package/README.ko.md +7 -0
  5. package/README.md +7 -0
  6. package/TunnelShare-9ry4vh0y.js +18 -0
  7. package/agent.command-x65f2ags.js +61 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-79azsb2w.js +11 -0
  10. package/{application.command-m4rq4wc2.js → application.command-azbd1pb2.js} +83 -37
  11. package/{applicationBuildRunner-df7rx3ra.js → applicationBuildRunner-trfxv3pd.js} +49 -18
  12. package/buildBatch.proc.js +25 -11
  13. package/{cloud.command-a0gy0qq2.js → cloud.command-gapp4634.js} +33 -29
  14. package/cloud.script-3b401efv.js +35 -0
  15. package/{code.command-5rsdqw8s.js → code.command-5smx61yf.js} +13 -9
  16. package/context.command-ym5jbkny.js +64 -0
  17. package/context.runner-kctbfsde.js +34 -0
  18. package/{dependencyScanner-78sq8m4q.js → dependencyScanner-ge10gb52.js} +2 -2
  19. package/{devTui-h77zrjv5.js → devTui-rf374y2w.js} +1 -1
  20. package/{fileSys-zpvt5gtf.js → fileSys-q22646yc.js} +1 -1
  21. package/{guideline.command-mffxknbr.js → guideline.command-zwypaqsh.js} +9 -5
  22. package/guidelines/agentRule/agentRule.instruction.md +25 -9
  23. package/guidelines/akanApi/akanApi.instruction.md +6 -4
  24. package/guidelines/conventions/core.md +23 -5
  25. package/guidelines/conventions/rules/app.md +4 -1
  26. package/guidelines/conventions/rules/page.md +5 -4
  27. package/guidelines/conventions/rules/ts.md +3 -3
  28. package/guidelines/errorCodes/errorCodes.instruction.md +165 -0
  29. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  30. package/guidelines/mcpRule/mcpRule.instruction.md +225 -5
  31. package/guidelines/pageRule/pageRule.instruction.md +10 -1
  32. package/guidelines/queryRule/queryRule.instruction.md +3 -1
  33. package/guidelines/runtimeRule/runtimeRule.instruction.md +14 -8
  34. package/guidelines/transportRule/transportRule.instruction.md +31 -1
  35. package/incrementalBuilder.proc.js +577 -411
  36. package/{index-w15mg3km.js → index-0dm25wvf.js} +1 -1
  37. package/{index-0gg15zwa.js → index-0s7w2085.js} +6 -6
  38. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  39. package/{index-swwjakt0.js → index-275a4r3n.js} +11 -11
  40. package/{index-j6gc8n14.js → index-2jmvfa62.js} +11 -9
  41. package/{index-qd7xn2bk.js → index-2ny1e95c.js} +2 -2
  42. package/{index-exn38bzx.js → index-2yn3r67f.js} +116 -54
  43. package/{index-34792nh7.js → index-3txdtztz.js} +1 -1
  44. package/{index-28x1aszt.js → index-41a03gkj.js} +149 -53
  45. package/{index-2mf1aen9.js → index-4ss4gkv3.js} +2 -2
  46. package/{index-an76bdrv.js → index-612fdtbk.js} +1 -1
  47. package/{index-5radqwn2.js → index-67sd09ag.js} +12 -12
  48. package/{index-0hbtve0a.js → index-6dzjer7p.js} +32 -28
  49. package/{index-3ghdb7p5.js → index-71y6176j.js} +2777 -3676
  50. package/{index-xyn02k0w.js → index-78y75t0a.js} +662 -433
  51. package/index-7wf8snar.js +80 -0
  52. package/{index-skmtj8rm.js → index-8jtqfye2.js} +27 -10
  53. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  54. package/{index-nmvhjn8c.js → index-9wh04mqy.js} +93 -82
  55. package/{index-xvk2a75m.js → index-a860mx0m.js} +3 -3
  56. package/{index-5zwr4n6k.js → index-baccvws5.js} +65 -8
  57. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  58. package/{index-bns3wcpc.js → index-by2tvsq6.js} +1 -1
  59. package/{index-r0a604h4.js → index-c669pbyb.js} +5 -4
  60. package/{index-x40bdsca.js → index-dadwp2aw.js} +33 -98
  61. package/{index-vm0dn0mt.js → index-dmcpetwe.js} +200 -138
  62. package/{index-43f4h4cm.js → index-ebn9kgea.js} +6 -6
  63. package/{index-hqv34wzq.js → index-gt8phqpt.js} +10 -10
  64. package/{index-yckz5t8b.js → index-h901f24n.js} +516 -434
  65. package/{index-j3v29pq7.js → index-j0wr4e32.js} +219 -175
  66. package/{index-gcx48get.js → index-j592zfqc.js} +2 -2
  67. package/{index-grxs6fts.js → index-j6jjmn2r.js} +57 -31
  68. package/{index-w8yasvpc.js → index-jek2re5k.js} +2136 -2175
  69. package/{index-ny2k80mv.js → index-jf4vk1s0.js} +9 -2
  70. package/{index-gxav1bjz.js → index-k6vwww45.js} +9 -9
  71. package/{index-99qvtff2.js → index-kfvjzk8r.js} +5 -5
  72. package/{index-j6eeh5d7.js → index-knpm8sdm.js} +5 -5
  73. package/{index-2r9ff9qm.js → index-nc3br31y.js} +2 -2
  74. package/{index-35j83zkd.js → index-p5zh7pmc.js} +2 -2
  75. package/{index-cmg5ngqa.js → index-p7beqww9.js} +2 -2
  76. package/{index-b4qq3rq0.js → index-rwgqba9p.js} +1 -1
  77. package/{index-rfzp4pqs.js → index-s885g0jj.js} +3 -3
  78. package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
  79. package/{index-k92x3vne.js → index-v7ajmsh3.js} +1 -1
  80. package/index-w1zexzpx.js +127 -0
  81. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  82. package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
  83. package/{index-rp4yf32g.js → index-xwwex8rf.js} +36 -29
  84. package/{index-ra9fvn7s.js → index-ybcb9wc8.js} +74 -38
  85. package/index-z92zm3wd.js +788 -0
  86. package/{index-j9790rhk.js → index-z96ks033.js} +1509 -1121
  87. package/index-zfnz878d.js +30 -0
  88. package/{index-2vgv7fs7.js → index-zmd9xxgd.js} +727 -693
  89. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  90. package/index.js +28 -24
  91. package/libExecutor-jc6f8hm6.js +10 -0
  92. package/{library.command-bmd7zc5m.js → library.command-nxvesvhb.js} +12 -5
  93. package/{localRegistry.command-y6en1599.js → localRegistry.command-xz62e4ng.js} +29 -24
  94. package/{module.command-7exfffqw.js → module.command-aaws9byg.js} +11 -7
  95. package/{package.command-adskw2rj.js → package.command-j7hv26p0.js} +14 -10
  96. package/package.json +8 -8
  97. package/{page.command-dw01272p.js → page.command-7yffs7n9.js} +8 -4
  98. package/{pipeline.command-0b1r3y5r.js → pipeline.command-7yk0zcng.js} +15 -9
  99. package/pkgExecutor-arxmvx4t.js +10 -0
  100. package/{primitive.command-byw6vc04.js → primitive.command-7a1pt715.js} +12 -8
  101. package/{projectTypecheck-kkrpq60a.js → projectTypecheck-f4qhbecd.js} +1 -1
  102. package/{prompter-qrwx1p17.js → prompter-qyggfhqd.js} +2 -2
  103. package/{quality.command-6rqnhzct.js → quality.command-c6mvrjh1.js} +25 -16
  104. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  105. package/{repair.command-rw5zymak.js → repair.command-093adzt9.js} +12 -8
  106. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  107. package/{scalar.command-2dyp9nh9.js → scalar.command-2ex84spb.js} +10 -6
  108. package/skills/akan-debug/SKILL.md +8 -5
  109. package/skills/akan-err/SKILL.md +7 -0
  110. package/skills/akan-mcp/SKILL.md +19 -1
  111. package/skills/akan-scaffold/SKILL.md +1 -1
  112. package/skills/akan-validate/SKILL.md +3 -3
  113. package/{subspace.command-111ynwv1.js → subspace.command-4n4n4jpv.js} +32 -24
  114. package/templates/app/page/_layout.tsx +13 -0
  115. package/templates/app/page/styles.css.template +40 -0
  116. package/templates/appSample/page/_index.tsx +9 -9
  117. package/templates/appSample/page/_layout.tsx +1 -0
  118. package/templates/appSample/page/styles.css.template +40 -5
  119. package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
  120. package/templates/biomeForm.ts +1 -1
  121. package/templates/env/_env.server.type.ts +1 -1
  122. package/templates/facetIndex/index.ts +2 -37
  123. package/templates/lib/sig.ts +0 -4
  124. package/templates/lib/useClient.ts +1 -1
  125. package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
  126. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  127. package/templates/workspaceRoot/README.ts +4 -2
  128. package/{tunnel.command-2gcpfbdj.js → tunnel.command-f7ep1qfa.js} +17 -13
  129. package/{typeChecker-s640r6c0.js → typeChecker-7jt6abrs.js} +1 -1
  130. package/typecheck.proc.js +3 -2
  131. package/{verify.command-djgs86ma.js → verify.command-zrkxnvct.js} +21 -17
  132. package/{workflow.command-n0k2mxr5.js → workflow.command-ks16jegk.js} +21 -14
  133. package/{workspace.command-fh1qwxfx.js → workspace.command-ahhfpaag.js} +60 -54
  134. package/CodeAgent-x2p3a3e0.js +0 -11
  135. package/TunnelShare-c4xsfzg5.js +0 -15
  136. package/agent.command-9et2e27p.js +0 -52
  137. package/cloud.script-xze4zh7n.js +0 -31
  138. package/context.command-rk1dwrg4.js +0 -57
  139. package/context.runner-83ky5m1b.js +0 -30
  140. /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
  141. /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
  142. /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
  143. /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
@@ -3,36 +3,39 @@ import {
3
3
  App,
4
4
  Workspace,
5
5
  command
6
- } from "./index-exn38bzx.js";
6
+ } from "./index-2yn3r67f.js";
7
7
  import"./index-j4yvgfhr.js";
8
- import"./index-bns3wcpc.js";
9
- import"./index-3ghdb7p5.js";
10
- import"./index-rfzp4pqs.js";
8
+ import"./index-71y6176j.js";
9
+ import"./index-by2tvsq6.js";
10
+ import"./index-z92zm3wd.js";
11
+ import"./index-zfnz878d.js";
12
+ import"./index-w1zexzpx.js";
13
+ import"./index-s885g0jj.js";
11
14
  import {
12
15
  PlatformTestRun
13
- } from "./index-rp4yf32g.js";
14
- import"./index-43f4h4cm.js";
15
- import"./index-an76bdrv.js";
16
+ } from "./index-xwwex8rf.js";
17
+ import"./index-ebn9kgea.js";
18
+ import"./index-612fdtbk.js";
16
19
  import"./index-m9jj544v.js";
17
- import"./index-nmvhjn8c.js";
18
- import"./index-xvk2a75m.js";
20
+ import"./index-9wh04mqy.js";
21
+ import"./index-a860mx0m.js";
19
22
  import {
20
23
  npmRegistryFromEnv,
21
24
  warnIgnoredNpmRegistry
22
- } from "./index-ny2k80mv.js";
23
- import"./index-vm0dn0mt.js";
24
- import"./index-j6gc8n14.js";
25
- import"./index-j9790rhk.js";
26
- import"./index-b4qq3rq0.js";
27
- import"./index-28x1aszt.js";
28
- import"./index-qd7xn2bk.js";
29
- import"./index-9p260r4e.js";
30
- import"./index-cmg5ngqa.js";
31
- import"./index-5zwr4n6k.js";
32
- import"./index-swwjakt0.js";
25
+ } from "./index-jf4vk1s0.js";
26
+ import"./index-dmcpetwe.js";
27
+ import"./index-2jmvfa62.js";
28
+ import"./index-z96ks033.js";
29
+ import"./index-rwgqba9p.js";
30
+ import"./index-41a03gkj.js";
31
+ import"./index-trffs83s.js";
32
+ import"./index-p7beqww9.js";
33
+ import"./index-baccvws5.js";
34
+ import"./index-2ny1e95c.js";
35
+ import"./index-275a4r3n.js";
33
36
  import {
34
37
  CloudScript2
35
- } from "./index-gxav1bjz.js";
38
+ } from "./index-k6vwww45.js";
36
39
  import {
37
40
  writeOption,
38
41
  oneNativeTargetOption,
@@ -43,8 +46,9 @@ import {
43
46
  hostOption,
44
47
  subspaceOption
45
48
  } from "./index-mdjc93e1.js";
46
- import"./index-gcx48get.js";
49
+ import"./index-j592zfqc.js";
47
50
  import"./index-9bv479q5.js";
51
+ import"./index-7wf8snar.js";
48
52
 
49
53
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
50
54
  var localRegistryUrl = () => npmRegistryFromEnv() ?? "http://127.0.0.1:4873";
@@ -54,12 +58,14 @@ var resolveRegistryUrl = (registry) => {
54
58
  };
55
59
  var pushUpdateDesc = "Pack an over-the-air update of a phone's web bundle, or take the folder `akan pack-update` wrote, and upload it to the Akan Cloud project, which signs and publishes it; or upload the desktop release `akan publish-update` signed, as it is. Exits 2 when the pack needs a new store build or the project rejects it, 1 on any other failure";
56
60
  var registerBinaryDesc = "Register the store build of a phone app with the Akan Cloud project, with a pack of the same commit as its embedded bundle. Exits 2 when the store build differs natively from this commit's pack, 1 on any other failure";
61
+ var uploadSecretDesc = "Upload a named pipeline secret to the Akan Cloud project; write-only, it can never be read back";
62
+ var listSecretsDesc = "List the pipeline secrets of the Akan Cloud project: names and scopes, never values";
57
63
 
58
64
  class CloudCommand extends command("cloud", [CloudScript2], ({ public: target }) => ({
59
- login: target({ desc: "Login to Akan Cloud services" }).option("host", String, hostOption).with(Workspace).exec(async function(host, workspace) {
65
+ login: target({ desc: "Login to Akan Cloud services", readOnly: true }).option("host", String, hostOption).with(Workspace).exec(async function(host, workspace) {
60
66
  await this.cloudScript.login(workspace, host);
61
67
  }),
62
- logout: target({ desc: "Logout from Akan Cloud services" }).option("host", String, hostOption).with(Workspace).exec(async function(host, workspace) {
68
+ logout: target({ desc: "Logout from Akan Cloud services", readOnly: true }).option("host", String, hostOption).with(Workspace).exec(async function(host, workspace) {
63
69
  await this.cloudScript.logout(workspace, host);
64
70
  }),
65
71
  deployAkan: target({ devOnly: true, desc: "Deploy Akan.js framework to cloud (internal use)" }).option("test", Boolean, { desc: "test the deployment", default: true }).option("registry", String, {
@@ -179,9 +185,7 @@ class CloudCommand extends command("cloud", [CloudScript2], ({ public: target })
179
185
  publicEnv
180
186
  });
181
187
  }),
182
- uploadSecret: target({
183
- desc: "Upload a named pipeline secret to the Akan Cloud project; write-only, it can never be read back"
184
- }).arg("name", String, { desc: "secret name, e.g. DISCORD_WEBHOOK" }).option("branch", String, {
188
+ uploadSecret: target({ desc: uploadSecretDesc, readOnly: true }).arg("name", String, { desc: "secret name, e.g. DISCORD_WEBHOOK" }).option("branch", String, {
185
189
  desc: "only builds of this branch use it: debug, develop or main (default: every branch)",
186
190
  nullable: true
187
191
  }).option("file", String, {
@@ -190,13 +194,13 @@ class CloudCommand extends command("cloud", [CloudScript2], ({ public: target })
190
194
  }).option("subspace", String, subspaceOption("gets it")).option("host", String, hostOption).with(Workspace).exec(async function(name, branch, file, subspace, host, workspace) {
191
195
  await this.cloudScript.uploadSecret(workspace, { name, branch, file, subspace, host });
192
196
  }),
193
- listSecrets: target({ desc: "List the pipeline secrets of the Akan Cloud project: names and scopes, never values" }).option("branch", String, {
197
+ listSecrets: target({ desc: listSecretsDesc, readOnly: true }).option("branch", String, {
194
198
  desc: "only the secrets builds of this branch use: debug, develop or main",
195
199
  nullable: true
196
200
  }).option("subspace", String, subspaceOption("to list")).option("host", String, hostOption).with(Workspace).exec(async function(branch, subspace, host, workspace) {
197
201
  await this.cloudScript.listSecrets(workspace, { branch, subspace, host });
198
202
  }),
199
- removeSecret: target({ desc: "Remove a named pipeline secret from the Akan Cloud project" }).arg("name", String, { desc: "secret name" }).option("branch", String, {
203
+ removeSecret: target({ desc: "Remove a named pipeline secret from the Akan Cloud project", readOnly: true }).arg("name", String, { desc: "secret name" }).option("branch", String, {
200
204
  desc: "the branch override to remove: debug, develop or main (default: the every-branch value)",
201
205
  nullable: true
202
206
  }).option("subspace", String, subspaceOption("holds it")).option("host", String, hostOption).with(Workspace).exec(async function(name, branch, subspace, host, workspace) {
@@ -0,0 +1,35 @@
1
+ // @bun
2
+ import {
3
+ CloudScript2
4
+ } from "./index-k6vwww45.js";
5
+ import"./index-xwwex8rf.js";
6
+ import"./index-41a03gkj.js";
7
+ import"./index-2jmvfa62.js";
8
+ import"./index-275a4r3n.js";
9
+ import"./index-s885g0jj.js";
10
+ import"./index-jf4vk1s0.js";
11
+ import"./index-z96ks033.js";
12
+ import"./index-j592zfqc.js";
13
+ import"./index-baccvws5.js";
14
+ import"./index-612fdtbk.js";
15
+ import"./index-ebn9kgea.js";
16
+ import"./index-m9jj544v.js";
17
+ import"./index-2ny1e95c.js";
18
+ import"./index-2yn3r67f.js";
19
+ import"./index-9bv479q5.js";
20
+ import"./index-rwgqba9p.js";
21
+ import"./index-p7beqww9.js";
22
+ import"./index-trffs83s.js";
23
+ import"./index-a860mx0m.js";
24
+ import"./index-dmcpetwe.js";
25
+ import"./index-9wh04mqy.js";
26
+ import"./index-7wf8snar.js";
27
+ import"./index-z92zm3wd.js";
28
+ import"./index-zfnz878d.js";
29
+ import"./index-w1zexzpx.js";
30
+ import"./index-71y6176j.js";
31
+ import"./index-j4yvgfhr.js";
32
+ import"./index-by2tvsq6.js";
33
+ export {
34
+ CloudScript2 as CloudScript
35
+ };
@@ -4,19 +4,23 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-exn38bzx.js";
7
+ } from "./index-2yn3r67f.js";
8
8
  import"./index-j4yvgfhr.js";
9
- import"./index-bns3wcpc.js";
10
- import"./index-3ghdb7p5.js";
9
+ import"./index-71y6176j.js";
10
+ import"./index-by2tvsq6.js";
11
+ import"./index-z92zm3wd.js";
12
+ import"./index-zfnz878d.js";
13
+ import"./index-w1zexzpx.js";
11
14
  import {
12
15
  AkanCodeEnv,
13
16
  akanCodePaths2
14
- } from "./index-35j83zkd.js";
17
+ } from "./index-p5zh7pmc.js";
15
18
  import {
16
19
  akanCodeDefaultModel2,
17
20
  CodeAgentStreamPrinter2,
18
21
  WorkspaceTrust
19
- } from "./index-w15mg3km.js";
22
+ } from "./index-0dm25wvf.js";
23
+ import"./index-7wf8snar.js";
20
24
 
21
25
  // pkgs/@akanjs/cli/code/code.runner.ts
22
26
  import { randomBytes } from "crypto";
@@ -78,7 +82,7 @@ class CodeRunner extends runner("code") {
78
82
  async serve(options, listen) {
79
83
  await import("./consoleToStderr-h5bryj94.js");
80
84
  const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
81
- import("./CodeAgent-x2p3a3e0.js"),
85
+ import("./CodeAgent-fx6088tv.js"),
82
86
  import("./CodeAgentRpcHost-6dzfkvsc.js"),
83
87
  import("./CodeAgentRpcListener-tcwrdvst.js")
84
88
  ]);
@@ -112,8 +116,8 @@ class CodeRunner extends runner("code") {
112
116
  }
113
117
  async tui(options, seed) {
114
118
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
115
- import("./CodeAgent-x2p3a3e0.js"),
116
- import("./CodeTui-qstk5vpj.js")
119
+ import("./CodeAgent-fx6088tv.js"),
120
+ import("./CodeTui-zee8atsr.js")
117
121
  ]);
118
122
  const start = await CodeRunner.#start(options, { hostAttached: false, interactive: true, ask: true });
119
123
  const agentOptions = start.agent;
@@ -149,7 +153,7 @@ class CodeRunner extends runner("code") {
149
153
  }
150
154
  }
151
155
  async run(prompt, options) {
152
- const { CodeAgent } = await import("./CodeAgent-x2p3a3e0.js");
156
+ const { CodeAgent } = await import("./CodeAgent-fx6088tv.js");
153
157
  const ask = !!process.stdin.isTTY && !!process.stderr.isTTY;
154
158
  const start = await CodeRunner.#start(options, { hostAttached: false, interactive: false, ask });
155
159
  for (const warning of start.warnings)
@@ -0,0 +1,64 @@
1
+ // @bun
2
+ import {
3
+ Workspace,
4
+ command
5
+ } from "./index-2yn3r67f.js";
6
+ import"./index-j4yvgfhr.js";
7
+ import"./index-71y6176j.js";
8
+ import"./index-by2tvsq6.js";
9
+ import"./index-z92zm3wd.js";
10
+ import"./index-zfnz878d.js";
11
+ import"./index-w1zexzpx.js";
12
+ import"./index-zmd9xxgd.js";
13
+ import"./index-trffs83s.js";
14
+ import"./index-h901f24n.js";
15
+ import"./index-1p81ecbz.js";
16
+ import"./index-j0wr4e32.js";
17
+ import"./index-knpm8sdm.js";
18
+ import"./index-ebn9kgea.js";
19
+ import"./index-612fdtbk.js";
20
+ import"./index-m9jj544v.js";
21
+ import"./index-9wh04mqy.js";
22
+ import"./index-a860mx0m.js";
23
+ import"./index-zyb0ebm4.js";
24
+ import"./index-xs9a3ddt.js";
25
+ import"./index-kfvjzk8r.js";
26
+ import"./index-3txdtztz.js";
27
+ import"./index-gt8phqpt.js";
28
+ import"./index-6dzjer7p.js";
29
+ import"./index-4ss4gkv3.js";
30
+ import"./index-t4d0ckde.js";
31
+ import"./index-67sd09ag.js";
32
+ import {
33
+ ContextScript
34
+ } from "./index-0s7w2085.js";
35
+ import"./index-7wf8snar.js";
36
+
37
+ // pkgs/@akanjs/cli/context/context.command.ts
38
+ class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
39
+ context: target({ desc: "Print agent-readable Akan workspace context", readOnly: true }).option("format", String, { desc: "output format", default: "markdown", enum: ["markdown", "json"] }).option("app", String, { desc: "app name to include", nullable: true }).option("module", String, { desc: "module name to include with abstract content", nullable: true }).with(Workspace).exec(async function(format, app, module, workspace) {
40
+ await this.contextScript.context(workspace, { format, app, module });
41
+ }),
42
+ doctor: target({ desc: "Report Akan workspace convention diagnostics", readOnly: true }).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).option("strict", Boolean, { desc: "treat recommended conventions as errors", default: false }).option("ios", Boolean, {
43
+ desc: "report iOS/native config diagnostics (placeholder bundle ids, etc.)",
44
+ default: false
45
+ }).with(Workspace).exec(async function(format, strict, ios, workspace) {
46
+ await this.contextScript.doctor(workspace, { format, strict, ios });
47
+ }),
48
+ mcpInstall: target({ desc: "Install the Akan MCP server config for Cursor, Claude Code, and Codex" }).arg("target", String, { desc: "cursor, claude, codex, or all", nullable: true }).option("force", Boolean, { desc: "overwrite an existing Akan MCP server entry", default: false }).option("mode", String, { desc: "MCP permission mode", default: "apply", enum: ["readonly", "plan", "apply"] }).with(Workspace).exec(async function(targetName, force, mode, workspace) {
49
+ await this.contextScript.mcpInstall(workspace, targetName, { force, mode });
50
+ }),
51
+ mcp: target({ desc: "Start the Akan MCP server over stdio", stdio: true, readOnly: ({ mode }) => mode !== "apply" }).option("mode", String, { desc: "MCP permission mode", default: "readonly", enum: ["readonly", "plan", "apply"] }).with(Workspace).exec(async function(mode, workspace) {
52
+ await this.contextScript.mcp(workspace, { mode });
53
+ }),
54
+ mcpCall: target({
55
+ desc: "Call one Akan MCP tool for debugging without stdio JSON-RPC",
56
+ readOnly: ({ mode }) => mode !== "apply"
57
+ }).arg("tool", String, { desc: "MCP tool name" }).option("mode", String, { desc: "MCP permission mode", default: "readonly", enum: ["readonly", "plan", "apply"] }).option("args", String, { desc: "JSON object to pass as MCP tool arguments", nullable: true }).option("format", String, { desc: "output format", default: "json", enum: ["json"] }).with(Workspace).exec(async function(tool, mode, args, format, workspace) {
58
+ await this.contextScript.mcpCall(workspace, tool, { mode, args, format });
59
+ })
60
+ })) {
61
+ }
62
+ export {
63
+ ContextCommand
64
+ };
@@ -0,0 +1,34 @@
1
+ // @bun
2
+ import {
3
+ ContextRunner2
4
+ } from "./index-j0wr4e32.js";
5
+ import"./index-67sd09ag.js";
6
+ import"./index-kfvjzk8r.js";
7
+ import"./index-4ss4gkv3.js";
8
+ import"./index-6dzjer7p.js";
9
+ import"./index-gt8phqpt.js";
10
+ import"./index-3txdtztz.js";
11
+ import"./index-t4d0ckde.js";
12
+ import"./index-h901f24n.js";
13
+ import"./index-612fdtbk.js";
14
+ import"./index-zmd9xxgd.js";
15
+ import"./index-ebn9kgea.js";
16
+ import"./index-m9jj544v.js";
17
+ import"./index-knpm8sdm.js";
18
+ import"./index-2yn3r67f.js";
19
+ import"./index-xs9a3ddt.js";
20
+ import"./index-zyb0ebm4.js";
21
+ import"./index-trffs83s.js";
22
+ import"./index-a860mx0m.js";
23
+ import"./index-9wh04mqy.js";
24
+ import"./index-7wf8snar.js";
25
+ import"./index-z92zm3wd.js";
26
+ import"./index-zfnz878d.js";
27
+ import"./index-w1zexzpx.js";
28
+ import"./index-71y6176j.js";
29
+ import"./index-j4yvgfhr.js";
30
+ import"./index-1p81ecbz.js";
31
+ import"./index-by2tvsq6.js";
32
+ export {
33
+ ContextRunner2 as ContextRunner
34
+ };
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  TypeScriptDependencyScanner2
4
- } from "./index-qd7xn2bk.js";
5
- import"./index-bns3wcpc.js";
4
+ } from "./index-2ny1e95c.js";
5
+ import"./index-by2tvsq6.js";
6
6
  export {
7
7
  TypeScriptDependencyScanner2 as TypeScriptDependencyScanner
8
8
  };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  stripAnsi
4
- } from "./index-b4qq3rq0.js";
4
+ } from "./index-rwgqba9p.js";
5
5
  import {
6
6
  writeClipboard
7
7
  } from "./index-p6pbz9n5.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getDirname2,
4
4
  FileSys2
5
- } from "./index-bns3wcpc.js";
5
+ } from "./index-by2tvsq6.js";
6
6
  export {
7
7
  FileSys2 as FileSys,
8
8
  getDirname2 as getDirname
@@ -2,13 +2,17 @@
2
2
  import {
3
3
  script,
4
4
  command
5
- } from "./index-exn38bzx.js";
5
+ } from "./index-2yn3r67f.js";
6
6
  import"./index-j4yvgfhr.js";
7
- import"./index-bns3wcpc.js";
8
- import"./index-3ghdb7p5.js";
7
+ import"./index-71y6176j.js";
8
+ import"./index-by2tvsq6.js";
9
+ import"./index-z92zm3wd.js";
10
+ import"./index-zfnz878d.js";
11
+ import"./index-w1zexzpx.js";
9
12
  import {
10
13
  Prompter2
11
- } from "./index-j6eeh5d7.js";
14
+ } from "./index-knpm8sdm.js";
15
+ import"./index-7wf8snar.js";
12
16
 
13
17
  // pkgs/@akanjs/cli/guideline/guideline.script.ts
14
18
  import { Logger } from "akanjs/common";
@@ -33,7 +37,7 @@ class GuidelineScript extends script("guideline") {
33
37
 
34
38
  // pkgs/@akanjs/cli/guideline/guideline.command.ts
35
39
  class GuidelineCommand extends command("guideline", [GuidelineScript], ({ public: target }) => ({
36
- guideline: target({ desc: "List or show Akan AI guideline instructions" }).arg("action", String, { desc: "list or show" }).arg("name", String, { desc: "guideline name for show", nullable: true }).exec(async function(action, name) {
40
+ guideline: target({ desc: "List or show Akan AI guideline instructions", readOnly: true }).arg("action", String, { desc: "list or show" }).arg("name", String, { desc: "guideline name for show", nullable: true }).exec(async function(action, name) {
37
41
  await this.guidelineScript.guideline(action, name);
38
42
  })
39
43
  })) {
@@ -60,11 +60,18 @@ pages declaring one name never clash, and a registry kept outside the surface re
60
60
  and under every menu and modal — `launcherClassName` / `panelClassName` reach one surface each where
61
61
  `className` reaches both, `intro`
62
62
  replaces the empty-state line — where starter questions go — and `header` adds controls beside the built-in
63
- clear and close. `chrome={false}` drops the header bar whole, for an `inline` chat inside a panel the app
64
- already titles, and `defaultDraft` opens the composer with text in it without sending it. A panel driven by a
63
+ clear and close. `title` takes a node (a mark before the name); give `label` then, as the panel's accessible
64
+ name. The header's parts carry `data-slot="agent-header"`, `"agent-title"` and `"agent-running"`, so
65
+ `panelClassName="[&_[data-slot=agent-running]]:bg-accent"` restyles one without leaning on the markup. A modal,
66
+ menu or popconfirm opened from inside the floating panel, `header` included, stacks above the panel, while
67
+ one the page opens stays under it. While the turn waits on an approval, card or question, a scrim the panel
68
+ opened sinks under the panel so the answer stays reachable, and it comes back once answered. A question
69
+ arriving leaves focus in an overlay the person is typing in, and Escape in the composer closes a modal the panel
70
+ or a card opened through the modal's own close, `confirmClose` included, before it closes the panel. `chrome={false}` drops the header bar whole, for an `inline` chat inside a
71
+ panel the app already titles, and `defaultDraft` opens the composer with text in it without sending it. A panel driven by a
65
72
  controlled `open` with **no** `onOpenChange` draws no close button at all rather than an inert one. Then the
66
73
  slots: `AgentLauncher`, `AgentSteps`, `AgentBubble`, `AgentComposer`, `AgentApproval`,
67
- `AgentQuestion`, `AgentToolCard`, `AgentQueued`, `AgentMenu`, `AgentMarkdown` and `AgentCode` each replace one part in `_overrides.tsx`, and
74
+ `AgentQuestion`, `AgentToolCard`, `AgentToolRow`, `AgentQueued`, `AgentMenu`, `AgentMarkdown` and `AgentCode` each replace one part in `_overrides.tsx`, and
68
75
  `akanjs/ui` exports every default beside them (`DefaultBubble`, `DefaultComposer`, …) so a skin composes the
69
76
  one it is replacing. **`AgentSteps` is one agent turn** — the messages between the user message that opened it
70
77
  and the next one, with `isRunning` saying whether more are still coming — which is the grain a chat needs to
@@ -121,9 +128,10 @@ pages declaring one name never clash, and a registry kept outside the surface re
121
128
  carries `{ provider, status }`, the hostname and the HTTP status; the provider's own sentence goes to the server
122
129
  log only, because it can quote an account id or part of a key and `Err` data reaches the browser.
123
130
  `LlmOverflow.refusal(host, status, reason)` builds it, and reads the one refusal a chat can undo — a prompt past
124
- the window, recognized from each provider's own sentence — as `agent.error.contextOverflow` with the `limit` it
125
- named, which the relay flags so the chat compacts and asks again. An adaptor an app wrote throws through the same function, so its refusals
126
- translate and recover the way the shipped ones do without a key in the framework's dictionary it cannot add.
131
+ the window, recognized from each provider's own sentence — as `agent.error.contextOverflow` with the `limit` and
132
+ `requested` it named, which the relay flags so the chat compacts and asks again. An adaptor an app wrote throws through the same function, so its refusals
133
+ translate and recover the way the shipped ones do without a key in the framework's dictionary it cannot add. An
134
+ adaptor's own size cap throws that error with `{ limit, requested }` in its own unit, bytes included.
127
135
  - **`accepts` is answered per model, through `option.setLlm({ accepts })`.** An adaptor answers for an API and one
128
136
  API serves models that differ, so the override rides beside the `model` it is a fact about. It is not a table
129
137
  the framework keeps: a table is a claim about models that ship after it, and getting this wrong is the worst
@@ -598,8 +606,8 @@ pages declaring one name never clash, and a registry kept outside the surface re
598
606
  `window − answer ceiling (8,192 when unreported) − compact.buffer (13,000, the margin Claude Code leaves)` —
599
607
  measured by the provider's own count of the last turn (`done.usage`, kept on that assistant message) plus the
600
608
  four-character estimate for what arrived since, so a Korean transcript the character rule reads as small is
601
- still caught. The window comes from `option.setLlm({ contextWindow })` or from the first refusal that names it;
602
- with neither, only the ceiling runs. **A refusal for length is answered once**: a relay flags it `overflow` on
609
+ still caught. The window comes from `option.setLlm({ contextWindow })` or from a refusal that names it, scaled by
610
+ its `limit / requested` to this estimate when it gives both; with neither, only the ceiling runs. **A refusal for length is answered once**: a relay flags it `overflow` on
603
611
  the wire, and the session compacts and sends the same turn again, and a second refusal in the same send fails
604
612
  with `agent.error.contextOverflow`. Either way the history above the last `keep` messages
605
613
  becomes one message standing in for it, flagged `summary` on the wire — `<Agent.Chat compact={{ at, keep, buffer }} />`
@@ -637,6 +645,12 @@ pages declaring one name never clash, and a registry kept outside the surface re
637
645
  - **A turn that failed says so on the wire.** `error` is a field only this wire has, so a provider mapping reads
638
646
  `text` and drops it; `AgentService.explained` folds it into the text before any adaptor sees it, because an
639
647
  assistant turn that says nothing is one the model repeats.
648
+ - **A failed turn keeps its code for the host.** The relay's `error` event carries `code`: the `Err`'s key, else
649
+ an `AkanError`'s own code when its JSON carries it, else the status's name, so a custom `toJSON()` keeps `code`
650
+ in what it returns or the failure reads as its status. It is one code whether the failure is answered before the
651
+ stream opens or inside it, a 5xx included. A refusal (401/403) is named by its status alone, unless the server
652
+ kept it under its own code. The chat keeps it on that assistant message as `errorCode` after translating the
653
+ text, so a host branches on `message.errorCode`, never on the sentence. It is never sent back to the relay.
640
654
  - **↑ and ↓ in the composer walk what was sent**, seeded from the transcript so a persisted chat does not lose
641
655
  only what was just typed. A single-line input has nothing of its own on the vertical arrows, and the
642
656
  half-written draft they were walked away from comes back at the bottom of the walk. **The `/` menu takes those
@@ -780,7 +794,9 @@ pages declaring one name never clash, and a registry kept outside the surface re
780
794
  keeps a free-text row either way, because the model wrote the options and only the user knows whether the answer
781
795
  is among them. The loop parks on the question exactly as it parks on an approval, a dismissal is the tool's
782
796
  error result rather than a silent empty answer, and the settled exchange renders as question-and-answer instead
783
- of a tool row. **Never re-implement it per screen** — a `st.tool("askAboutX")` that opens a modal is the same
797
+ of a tool row. A restored transcript that ends on an unanswered `askUser` — a server run that parked on it while
798
+ no chat was open, or a reload mid-question — opens on that question, and settling it runs the turn on through the
799
+ runner; a turn started first closes it as unanswered instead. **Never re-implement it per screen** — a `st.tool("askAboutX")` that opens a modal is the same
784
800
  thing with a worse transcript — and a hook tool named `askUser` shadows it like any other built-in. The line
785
801
  between it and a `.card()` tool is what the answer *is*: a sentence or a pick off a list is `askUser` and belongs
786
802
  to the conversation, while a shape the model must not invent — fields, a form, a signature — is a card the screen
@@ -112,7 +112,7 @@ Shared by `page()`, `layout()` and `rootLayout()`:
112
112
  .render(render: (args: RouteBaseArgs) => PromiseOrObject<ReactNode>)
113
113
  .config(config: PageConfig)
114
114
  .head(head: HeadStage<RouteBaseArgs>)
115
- .guard(guard: (args: RouteBaseArgs) => void | Promise<void>)
115
+ .guard(guard: (args: RouteBaseArgs, request: RouteGuardRequest) => void | Promise<void>)
116
116
  .loading(render: (args: RouteBaseArgs) => PromiseOrObject<ReactNode>)
117
117
  ```
118
118
 
@@ -120,7 +120,7 @@ Only on `page()`:
120
120
 
121
121
  ```ts
122
122
  .prompt(name: string, description: string)
123
- .app<Name extends string>(name: Name & FreeName<Name, Record<never, never>>, description: string, load: (args: RouteBaseArgs) => PromiseOrObject<ReactNode>)
123
+ .app<Name extends string>(name: Name & FreeName<Name, Record<never, never>>, description: string, load: (args: RouteBaseArgs) => PromiseOrObject<ReactNode>, option?: { static?: boolean; })
124
124
  ```
125
125
 
126
126
  On `layout()` and `rootLayout()`, where a line replaces its shared form above:
@@ -235,8 +235,10 @@ globalPrefix?: false;
235
235
  /** HTTP verb of a `mutation`, `POST` unless named; every other endpoint type ignores it. */
236
236
  method?: HttpMutationMethod;
237
237
  fileUpload?: boolean;
238
- /** `false` keeps it out of the MCP catalogue (default `true`); curation, not authorization — HTTP still serves it. */
239
- mcp?: boolean;
238
+ /** `false` keeps it out of the MCP catalogue (default `true`), and `"agent"` keeps it off `/mcp` while the in-process agent (`AgentToolsRole`, `agentService.loop`) still lists it; curation, not authorization — HTTP still serves it. */
239
+ mcp?: McpShelf;
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. */
@@ -30,6 +30,24 @@ and infrastructure. A workspace is Bun-first: `apps/<app>` holds pages, domain m
30
30
  - Follow the nearest established pattern; when two shapes disagree, follow the newer neighbour. A new abstraction must
31
31
  remove real duplication — near-identical sibling modules are copied with changed literals, not parameterised.
32
32
 
33
+ ## Finishing Work
34
+
35
+ - Carry the task through to `verify ok`. A failing check, a stale generated file, a stopped dev server or a tool
36
+ error is an ordinary obstacle: diagnose it and work through it (`akan sync`, `akan repair generated`, a retry,
37
+ another command) rather than stopping to report it or offering to continue. Silencing a check is not a way through.
38
+ - Routine steps need no confirmation: reading code, `akan sync`, `akan verify`, `akan test`, `akan preview`, and the
39
+ workflow plan and apply the task calls for. Ask only when the work cannot go on without the answer, and keep doing
40
+ the parts that do not depend on it.
41
+ - A deliberate blocker stays put — another person's change in a dirty tree, an `akan.baseline.json` entry, a secret
42
+ you cannot read, a failure outside what you changed: leave it, say what you found, and finish the rest. Confirm
43
+ before a step that is hard to undo or leaves this machine, such as a push, a deploy or a write to a shared database.
44
+
45
+ ## Reporting
46
+
47
+ Write the final message for a reader who did not watch your tool calls. Lead with the outcome, name every file you
48
+ changed (small edits too), give each check's own result line, and say what you left undone or could not check, and
49
+ why. Use plain words, not labels you coined during the work.
50
+
33
51
  ## Looks Wrong, Is Right — Do Not "Fix"
34
52
 
35
53
  - Tailwind class order (`font-bold text-2xl text-foreground`) — Biome sorts it, `cn()` arguments included.
@@ -47,7 +65,7 @@ and infrastructure. A workspace is Bun-first: `apps/<app>` holds pages, domain m
47
65
  contract. Path rules name their checks the same way.
48
66
 
49
67
  - Throw `new Err("<module>.error.<key>")` with the key in the module dictionary's `.error({})`; never a raw `Error`
50
- (`no-throw-raw-error`) [app].
68
+ (`no-throw-raw-error`) and never the untyped `Err` of `akanjs/common` (`no-import-common-err`) [app].
51
69
  - A third-party package reaches `page/**`, a barrel or a module file only through a lib re-export
52
70
  (`no-import-external-library`) [app].
53
71
  - Colors only from the semantic vocabulary (`bg-primary`, `text-foreground/70`) — no palette, arbitrary, daisyUI or
@@ -77,10 +95,10 @@ contract. Path rules name their checks the same way.
77
95
  - One class per file, named after it; TypeScript files are camelCase, component and convention files excepted.
78
96
  - Identifiers, endpoint names and logs are English; everything a user reads goes through `l("model.field")` or
79
97
  `l.trans({ en, ko })`, and dictionary entries are `[en, ko]` pairs.
80
- - Comment only what the code cannot say (`akan verify` flags each new one as `akan.comment.added`) — a vendor quirk,
81
- an infrastructure constraint, security reasoning, a domain field's meaning, a state transition, a rejected
82
- alternative. Never restate code, label a section or add JSDoc; retire a symbol with
83
- `/** @deprecated <what instead> */`.
98
+ - Comment only what the code cannot say (`akan verify` flags each new one as `akan.comment.added`, a
99
+ `// TODO: <issue url>` aside) — a vendor quirk, an infrastructure constraint, security reasoning, a domain field's
100
+ meaning, a state transition, a rejected alternative. Never restate code, label a section or add JSDoc; retire a
101
+ symbol with `/** @deprecated <what instead> */`.
84
102
  - Server rendering is the default: `"use client"` only for a hook, an event handler, the store, a browser global or
85
103
  a client-only package.
86
104
 
@@ -17,6 +17,9 @@ each plugin's header and diagnostic carry its full reasoning.
17
17
  stored loses the key and status too (a warning for now). Exempt: tests, `*.constant.ts`, a root `native/` folder
18
18
  (plugins throw `AkanNativeError`), `script/migration/**` (an operator reads its message), and `common/**` / `env/**`,
19
19
  which have no legal `Err` import — keep throwing code out of them.
20
+ - **Never import `Err` from `akanjs/common`** or `akanjs/common/err` (`no-import-common-err`). That class takes any
21
+ string, so a mistyped key compiles; the `Err` from `"../dict"` or a client entrypoint is the same class, typed with
22
+ the dictionary's keys. `import type` stays legal, to annotate a caught `Err`. Exempt: tests.
20
23
  - **Never import a third-party package** (`no-import-external-library`) from `page/**`, any barrel, a module logic file
21
24
  (`*.{constant,dictionary,document,service,signal,store}.ts`) or module component
22
25
  (`*.{Template,Unit,Util,View,Zone}.tsx`) — re-export it through a lib first (one-line shims in a lib's `common/`,
@@ -49,7 +52,7 @@ each plugin's header and diagnostic carry its full reasoning.
49
52
  - Lib root files: `AGENTS.md`, `CLAUDE.md`, `README.md`, `akan.baseline.json`, `akan.config.ts`, `akan.lib.json`,
50
53
  `client.ts`, `index.ts`, `package.json`, `server.ts`, `tsconfig.json`, `tsconfig.spec.json`, `tsconfig.tsbuildinfo`;
51
54
  folders: the app's minus `.akan`, `script`, `secrets` (no `main.ts` either — a lib is never booted).
52
- - The allowlists' one source is `pkgs/@akanjs/devkit/workspaceLayout.ts`, read by `akan sync` (error), `akan doctor`
55
+ - The allowlists' one source is `pkgs/@akanjs/devkit/workspace/workspaceLayout.ts`, read by `akan sync` (error), `akan doctor`
53
56
  and `akan quality scan` — add an entry there and mirror it here.
54
57
  - `apps/<app>/AGENTS.md` / `libs/<lib>/AGENTS.md` carry a generated `## Recipes In Scope` block between the
55
58
  `akan:agent` markers — never hand-edit it (outside the markers is yours); `akan lint` fails when it is stale.
@@ -43,10 +43,11 @@ export default page()
43
43
  - `.render()` gets the declared args flat and typed (no `PageProps`, no `loader=` prop). Order: `usePage()`, fetch,
44
44
  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
45
45
  (title, redirect, link id) in one `Promise.all`.
46
- - **A field's refusal belongs to its `Load.*`**, which draws a notice while the page answers 200. So a field reaches
47
- only a `Load.*`, directly or through a Zone. Awaiting one in a component below the page, rendering it as a child or
48
- `use()`-ing it outside `Load.*` blanks the page when the server refuses it. Await the handle (`await fetch.initX()`)
49
- instead, so a refusal takes the layout's `.error()`.
46
+ - **A field's refusal belongs to its `Load.*`**, which draws a notice in its place while the page answers 200. So a
47
+ field reaches only a `Load.*`, directly or through a Zone. Awaited in a component below the page, rendered as a
48
+ child or `use()`-d outside `Load.*`, a refused field takes its whole route level, which draws a retryable notice
49
+ under the layouts above it, as any server error after the first byte does. Await the handle
50
+ (`await fetch.initX()`) instead, so a refusal takes the layout's `.error()`.
50
51
  - **A route never writes while it renders**: a `fetch.<mutation>()` in a stage or a component it renders throws
51
52
  `base.error.mutationInRender`, since opening a link would perform it. Send it from a user action;
52
53
  `{ duringRender: true }` only for a write harmless to repeat and safe for anyone to trigger (`ssrRule`).
@@ -89,8 +89,8 @@ Do not narrate code. Do document the thing the code cannot say. Both halves are
89
89
  - Warranted for: a vendor or protocol quirk; an infrastructure constraint; a library gotcha; security reasoning; why
90
90
  an arbitrary-looking rule is correct; a math derivation; a domain field's business meaning; a state transition above
91
91
  a document chain method; why an obvious alternative was rejected.
92
- - Markers: `TODO` (tracked unfinished work), `FIXME` (known broken), `XXX` (a hazard a reader must not miss), `//!`
93
- (disabled or must-fix — server, `srvkit/`, CLI only), `//?` (an aside), `//*` (a design note), and a deletion
94
- caution saying why removing a line would break something non-obvious.
92
+ - Markers: `TODO: <issue url>` (tracked unfinished work), `FIXME` (known broken), `XXX` (a hazard a reader must not
93
+ miss), `//!` (disabled or must-fix — server, `srvkit/`, CLI only), `//?` (an aside), `//*` (a design note), and a
94
+ deletion caution saying why removing a line would break something non-obvious.
95
95
  - One short line each. Every suppression carries a reason (`// biome-ignore lint/<rule>: <why>`), never a bare
96
96
  disable block. Match the nearby density.