@akanjs/cli 3.1.1-rc.9 → 3.1.2-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 (207) hide show
  1. package/.build-stamp +1 -1
  2. package/CodeAgent-dyc45f5w.js +11 -0
  3. package/{CodeAgentRpcHost-9g27hmer.js → CodeAgentRpcHost-6dzfkvsc.js} +1 -1
  4. package/CodeAgentRpcListener-tcwrdvst.js +182 -0
  5. package/{CodeTui-z5vkm9ea.js → CodeTui-q55b2zrn.js} +25 -8
  6. package/TunnelShare-hdq9h1hr.js +14 -0
  7. package/agent.command-20zaqe60.js +49 -0
  8. package/akanCode.js +13 -8
  9. package/{application.command-wthg8nn9.js → application.command-nd0fshsk.js} +45 -12
  10. package/{applicationBuildRunner-t2r84sz6.js → applicationBuildRunner-s13x3zqb.js} +14 -10
  11. package/buildBatch.proc.js +7 -7
  12. package/{cloud.command-sz11hpre.js → cloud.command-8kbddsz9.js} +28 -19
  13. package/cloud.script-hgvvajm3.js +27 -0
  14. package/code.command-625bg8s8.js +345 -0
  15. package/commandManifest.json +1 -1
  16. package/{context.command-15j9b7c0.js → context.command-p6haqjay.js} +20 -18
  17. package/context.runner-rsnqnk9j.js +27 -0
  18. package/{dependencyScanner-3afj2vt1.js → dependencyScanner-78sq8m4q.js} +2 -2
  19. package/{devTui-q7k7bakd.js → devTui-evr3b35y.js} +1 -1
  20. package/{fileSys-wzzrntkw.js → fileSys-zpvt5gtf.js} +1 -1
  21. package/{guideline.command-snh85ctf.js → guideline.command-195g0h9a.js} +4 -4
  22. package/guidelines/agentRule/agentRule.instruction.md +22 -8
  23. package/guidelines/conventions/core.md +106 -0
  24. package/guidelines/conventions/rules/app.md +83 -0
  25. package/guidelines/conventions/rules/auth.md +46 -0
  26. package/guidelines/conventions/rules/config.md +60 -0
  27. package/guidelines/conventions/rules/constant.md +24 -0
  28. package/guidelines/conventions/rules/gates.md +32 -0
  29. package/guidelines/conventions/rules/layer.md +25 -0
  30. package/guidelines/conventions/rules/migration.md +27 -0
  31. package/guidelines/conventions/rules/module.md +90 -0
  32. package/guidelines/conventions/rules/page.md +56 -0
  33. package/guidelines/conventions/rules/sensitive.md +16 -0
  34. package/guidelines/conventions/rules/server.md +91 -0
  35. package/guidelines/conventions/rules/ssr.md +47 -0
  36. package/guidelines/conventions/rules/style.md +43 -0
  37. package/guidelines/conventions/rules/test.md +34 -0
  38. package/guidelines/conventions/rules/ts.md +95 -0
  39. package/guidelines/conventions/rules/tsx.md +76 -0
  40. package/guidelines/mcpRule/mcpRule.instruction.md +1 -1
  41. package/guidelines/pageRule/pageRule.instruction.md +8 -7
  42. package/guidelines/queryRule/queryRule.instruction.md +4 -0
  43. package/guidelines/runtimeRule/runtimeRule.instruction.md +35 -25
  44. package/guidelines/ssrRule/ssrRule.instruction.md +11 -10
  45. package/guidelines/transportRule/transportRule.instruction.md +5 -4
  46. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +4 -4
  47. package/incrementalBuilder.proc.js +7 -7
  48. package/{index-301pdbzz.js → index-00a7j05x.js} +7 -7
  49. package/{index-js6geqjn.js → index-0j1t1h2b.js} +3 -1
  50. package/{index-6txx6a9p.js → index-1h2jc0x3.js} +154 -88
  51. package/{index-55j120r8.js → index-1qsd8ft1.js} +65 -145
  52. package/{index-9th4gszy.js → index-2mwjshz5.js} +233 -1271
  53. package/index-2nxk8wgs.js +266 -0
  54. package/{index-j9vyj3dj.js → index-2phm56a1.js} +49 -8
  55. package/index-35j83zkd.js +61 -0
  56. package/index-4am4dvmf.js +29 -0
  57. package/index-75y7bcz4.js +28 -0
  58. package/index-7apsdr5g.js +487 -0
  59. package/{index-42j4a8zq.js → index-84h43kg6.js} +8 -6
  60. package/index-9bv479q5.js +1 -0
  61. package/{index-3wypz6xj.js → index-9zy8479y.js} +11 -5
  62. package/{index-a5dhqkdr.js → index-a1vb3x7t.js} +273 -259
  63. package/{index-52w0fvh8.js → index-bns3wcpc.js} +15 -0
  64. package/index-cjmjvg4r.js +3622 -0
  65. package/{index-pcwzkdqb.js → index-defp4gmb.js} +1 -1
  66. package/index-ewbmfarf.js +1606 -0
  67. package/index-fbewhg4g.js +590 -0
  68. package/index-fhw7yq2d.js +653 -0
  69. package/{index-wcej7g4z.js → index-g500c5j9.js} +271 -105
  70. package/{index-74tjjsnc.js → index-g841cap9.js} +33 -37
  71. package/{index-2azahjaw.js → index-gr9thy79.js} +5 -5
  72. package/{index-4pf8g7ff.js → index-h7hehkw6.js} +3 -0
  73. package/{index-xjf5j657.js → index-hm0tn7qv.js} +1001 -91
  74. package/index-j6eeh5d7.js +138 -0
  75. package/{index-31es1yev.js → index-j7hwy56s.js} +108 -7
  76. package/{index-skk9zc1x.js → index-jc2zbwra.js} +2 -2
  77. package/{index-905qdgqp.js → index-khk05tsf.js} +1 -1
  78. package/{index-5nd1wtkv.js → index-p6x5b7hr.js} +1 -1
  79. package/{index-tvehn2sp.js → index-qd7xn2bk.js} +1 -1
  80. package/{index-a58emady.js → index-qw6814m4.js} +55 -17
  81. package/index-raz588b3.js +445 -0
  82. package/{index-at7bz0xq.js → index-s4nvxpzm.js} +2 -0
  83. package/{index-bt438yxm.js → index-sp0qsr7a.js} +116 -13
  84. package/{index-xb8809yb.js → index-sveq36gh.js} +40 -43
  85. package/{index-hmt54t45.js → index-t1t9wq9a.js} +4 -4
  86. package/index-t78230d7.js +191 -0
  87. package/index-tenw3mah.js +225 -0
  88. package/{index-qfp55x1y.js → index-tgqameyb.js} +4 -4
  89. package/{index-espk51ah.js → index-tp56652m.js} +6 -6
  90. package/index-w15mg3km.js +389 -0
  91. package/{index-dy0jx9ay.js → index-wwe9rsrx.js} +14 -0
  92. package/{index-2xcc2ax5.js → index-y4kcmbt2.js} +2 -2
  93. package/index-yf9wc28h.js +52 -0
  94. package/{index-0fz95kxe.js → index-zbrwnmf1.js} +9 -7
  95. package/{index-40brg4px.js → index-zttm13c3.js} +5 -5
  96. package/index.js +24 -23
  97. package/{library.command-gycrwhf1.js → library.command-63hgt9te.js} +4 -4
  98. package/{localRegistry.command-jtd8gaes.js → localRegistry.command-g3f8k25t.js} +46 -22
  99. package/{module.command-v6hgs1bc.js → module.command-r4sa2khp.js} +7 -6
  100. package/{package.command-shzpcfph.js → package.command-96eheyvd.js} +5 -5
  101. package/package.json +2 -2
  102. package/{page.command-ptxn5kqk.js → page.command-gs6d841d.js} +4 -4
  103. package/{pipeline.command-zz31pgax.js → pipeline.command-wdfvdbfj.js} +3 -3
  104. package/{primitive.command-a1vse91z.js → primitive.command-dfsv4mpe.js} +8 -7
  105. package/{projectTypecheck-2ztky9cf.js → projectTypecheck-kqj1t6hb.js} +1 -1
  106. package/{prompter-76k56b37.js → prompter-qrwx1p17.js} +2 -2
  107. package/quality.command-webzxee2.js +78 -0
  108. package/{repair.command-cvazbz99.js → repair.command-3r3j1xre.js} +7 -6
  109. package/{routeSourceValidator-6jd0q6r6.js → routeSourceValidator-4h947v7c.js} +13 -3
  110. package/{scalar.command-0acvyp26.js → scalar.command-e8y47j6d.js} +6 -5
  111. package/skills/akan-agent/SKILL.md +43 -0
  112. package/skills/akan-code/SKILL.md +38 -11
  113. package/skills/akan-debug/SKILL.md +41 -6
  114. package/skills/akan-deps/SKILL.md +1 -2
  115. package/skills/akan-err/SKILL.md +2 -1
  116. package/skills/akan-mcp/SKILL.md +40 -0
  117. package/skills/akan-page/SKILL.md +44 -0
  118. package/skills/akan-query/SKILL.md +39 -0
  119. package/skills/akan-runtime/SKILL.md +43 -0
  120. package/skills/akan-scaffold/SKILL.md +16 -6
  121. package/skills/akan-transport/SKILL.md +40 -0
  122. package/skills/akan-validate/SKILL.md +13 -11
  123. package/{subspace.command-822qx2bx.js → subspace.command-a1sf9n5a.js} +12 -10
  124. package/templates/__scalar/__model__/__model__.constant.ts +3 -5
  125. package/templates/__scalar/__model__/__model__.dictionary.ts +6 -5
  126. package/templates/__scalar/__model__/__model__.document.ts +3 -3
  127. package/templates/app/akan.config.ts +2 -3
  128. package/templates/app/env/env.client.ts +2 -4
  129. package/templates/app/env/env.client.type.ts +2 -3
  130. package/templates/app/env/env.server.ts +2 -3
  131. package/templates/app/lib/___appName__/__appName__.dictionary.ts +1 -2
  132. package/templates/app/lib/___appName__/__appName__.service.ts +3 -3
  133. package/templates/app/lib/___appName__/__appName__.signal.ts +5 -5
  134. package/templates/app/lib/___appName__/__appName__.store.ts +4 -6
  135. package/templates/app/lib/option.ts +2 -3
  136. package/templates/app/main.ts +2 -4
  137. package/templates/app/page/_index.tsx +3 -3
  138. package/templates/app/page/_layout.tsx +13 -10
  139. package/templates/appSample/lib/__scalar/workHistory/workHistory.constant.ts +1 -5
  140. package/templates/appSample/lib/__scalar/workHistory/workHistory.dictionary.ts +1 -1
  141. package/templates/appSample/lib/_noti/noti.signal.ts +1 -1
  142. package/templates/appSample/lib/task/Task.Template.tsx +2 -1
  143. package/templates/appSample/lib/task/Task.Unit.tsx +3 -2
  144. package/templates/appSample/lib/task/Task.Util.tsx +16 -4
  145. package/templates/appSample/lib/task/task.constant.ts +1 -5
  146. package/templates/appSample/lib/task/task.dictionary.ts +2 -8
  147. package/templates/appSample/lib/task/task.document.ts +1 -1
  148. package/templates/appSample/lib/task/task.signal.ts +14 -9
  149. package/templates/appSample/page/task/_index.tsx +2 -1
  150. package/templates/appSample/page/task/new.tsx +2 -1
  151. package/templates/appSample/srvkit/guards.ts +11 -0
  152. package/templates/appSample/ui/QuantityControl.tsx +5 -9
  153. package/templates/biomeForm.ts +144 -0
  154. package/templates/crudPages/[__model__Id]/edit/page.tsx +3 -3
  155. package/templates/crudPages/[__model__Id]/page.tsx +5 -5
  156. package/templates/crudPages/new/page.tsx +4 -3
  157. package/templates/crudPages/page.tsx +3 -3
  158. package/templates/crudSinglePage/page.tsx +9 -5
  159. package/templates/libRoot/akan.config.ts +2 -3
  160. package/templates/libRoot/lib/___libName__/__libName__.dictionary.ts +1 -2
  161. package/templates/libRoot/lib/___libName__/__libName__.service.ts +5 -4
  162. package/templates/libRoot/lib/___libName__/__libName__.signal.ts +6 -5
  163. package/templates/libRoot/lib/___libName__/__libName__.store.ts +5 -6
  164. package/templates/libRoot/lib/option.ts +1 -2
  165. package/templates/module/__Model__.Template.tsx +11 -10
  166. package/templates/module/__Model__.Unit.tsx +18 -5
  167. package/templates/module/__Model__.Util.tsx +9 -7
  168. package/templates/module/__Model__.View.tsx +9 -6
  169. package/templates/module/__Model__.Zone.tsx +25 -17
  170. package/templates/module/__model__.constant.ts +8 -9
  171. package/templates/module/__model__.dictionary.ts +16 -17
  172. package/templates/module/__model__.document.ts +6 -8
  173. package/templates/module/__model__.service.ts +3 -3
  174. package/templates/module/__model__.signal.ts +11 -10
  175. package/templates/module/__model__.store.ts +3 -5
  176. package/templates/service/__model__.dictionary.ts +5 -6
  177. package/templates/service/__model__.service.ts +3 -3
  178. package/templates/service/__model__.signal.ts +5 -4
  179. package/templates/service/__model__.store.ts +3 -5
  180. package/templates/workspaceRoot/.gitignore.template +4 -0
  181. package/templates/workspaceRoot/.vscode/settings.json.template +21 -21
  182. package/templates/workspaceRoot/AGENTS.md.template +4 -10
  183. package/{tunnel.command-ycmja19q.js → tunnel.command-dcb0wg93.js} +25 -13
  184. package/{typeChecker-px49mezc.js → typeChecker-j2jdnqsr.js} +1 -1
  185. package/typecheck.proc.js +6 -1
  186. package/verify.command-yyepccbh.js +93 -0
  187. package/{workflow.command-abb1d5xy.js → workflow.command-z5pg9ay0.js} +49 -14
  188. package/workspace.command-d7x5jttw.js +290 -0
  189. package/CodeAgent-8d5qs787.js +0 -9
  190. package/CodeAgentRpcListener-7p7z5dd7.js +0 -97
  191. package/TunnelShare-qkm8zp03.js +0 -14
  192. package/agent.command-ydftceda.js +0 -25
  193. package/cloud.script-nqevg5qw.js +0 -24
  194. package/code.command-9h3yrzhe.js +0 -167
  195. package/context.runner-8gg030b0.js +0 -25
  196. package/guidelines/conventions/conventions.instruction.md +0 -617
  197. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +0 -291
  198. package/index-2mwc0g0d.js +0 -49
  199. package/index-4vgbysa0.js +0 -279
  200. package/index-7md2g9vw.js +0 -6
  201. package/index-b70zct19.js +0 -856
  202. package/index-c6eggbee.js +0 -123
  203. package/index-zzvvc845.js +0 -74
  204. package/quality.command-ah8qcakd.js +0 -1478
  205. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +0 -69
  206. package/templates/workspaceRoot/docs/GENERATED.md.template +0 -55
  207. package/workspace.command-qm7cw29v.js +0 -521
@@ -3,27 +3,32 @@ import {
3
3
  App,
4
4
  Workspace,
5
5
  command
6
- } from "./index-3wypz6xj.js";
7
- import"./index-52w0fvh8.js";
8
- import"./index-wcej7g4z.js";
9
- import"./index-2azahjaw.js";
6
+ } from "./index-9zy8479y.js";
7
+ import"./index-bns3wcpc.js";
8
+ import"./index-g500c5j9.js";
9
+ import"./index-gr9thy79.js";
10
10
  import {
11
11
  PlatformTestRun
12
- } from "./index-6txx6a9p.js";
13
- import"./index-bt438yxm.js";
14
- import"./index-js6geqjn.js";
12
+ } from "./index-1h2jc0x3.js";
13
+ import"./index-sp0qsr7a.js";
14
+ import"./index-0j1t1h2b.js";
15
15
  import"./index-m9jj544v.js";
16
- import"./index-xb8809yb.js";
17
- import"./index-0fz95kxe.js";
18
- import"./index-5nd1wtkv.js";
19
- import"./index-2xcc2ax5.js";
20
- import"./index-9th4gszy.js";
21
- import"./index-7md2g9vw.js";
22
- import"./index-tvehn2sp.js";
23
- import"./index-42j4a8zq.js";
16
+ import"./index-zbrwnmf1.js";
17
+ import"./index-sveq36gh.js";
18
+ import {
19
+ npmRegistryFromEnv,
20
+ warnIgnoredNpmRegistry
21
+ } from "./index-4am4dvmf.js";
22
+ import"./index-p6x5b7hr.js";
23
+ import"./index-y4kcmbt2.js";
24
+ import"./index-2mwjshz5.js";
25
+ import"./index-ewbmfarf.js";
26
+ import"./index-tenw3mah.js";
27
+ import"./index-qd7xn2bk.js";
28
+ import"./index-84h43kg6.js";
24
29
  import {
25
30
  CloudScript2
26
- } from "./index-301pdbzz.js";
31
+ } from "./index-00a7j05x.js";
27
32
  import {
28
33
  writeOption,
29
34
  oneNativeTargetOption,
@@ -34,11 +39,15 @@ import {
34
39
  hostOption,
35
40
  subspaceOption
36
41
  } from "./index-mdjc93e1.js";
37
- import"./index-pcwzkdqb.js";
42
+ import"./index-defp4gmb.js";
43
+ import"./index-9bv479q5.js";
38
44
 
39
45
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
40
- var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
41
- var resolveRegistryUrl = (registry) => registry === "local" ? localRegistryUrl() : undefined;
46
+ var localRegistryUrl = () => npmRegistryFromEnv() ?? "http://127.0.0.1:4873";
47
+ var resolveRegistryUrl = (registry) => {
48
+ warnIgnoredNpmRegistry();
49
+ return registry === "local" ? localRegistryUrl() : undefined;
50
+ };
42
51
 
43
52
  class CloudCommand extends command("cloud", [CloudScript2], ({ public: target }) => ({
44
53
  login: target({ desc: "Login to Akan Cloud services" }).option("host", String, hostOption).with(Workspace).exec(async function(host, workspace) {
@@ -0,0 +1,27 @@
1
+ // @bun
2
+ import {
3
+ CloudScript2
4
+ } from "./index-00a7j05x.js";
5
+ import"./index-1h2jc0x3.js";
6
+ import"./index-ewbmfarf.js";
7
+ import"./index-y4kcmbt2.js";
8
+ import"./index-84h43kg6.js";
9
+ import"./index-gr9thy79.js";
10
+ import"./index-4am4dvmf.js";
11
+ import"./index-2mwjshz5.js";
12
+ import"./index-defp4gmb.js";
13
+ import"./index-0j1t1h2b.js";
14
+ import"./index-sp0qsr7a.js";
15
+ import"./index-m9jj544v.js";
16
+ import"./index-9zy8479y.js";
17
+ import"./index-9bv479q5.js";
18
+ import"./index-tenw3mah.js";
19
+ import"./index-sveq36gh.js";
20
+ import"./index-p6x5b7hr.js";
21
+ import"./index-zbrwnmf1.js";
22
+ import"./index-g500c5j9.js";
23
+ import"./index-qd7xn2bk.js";
24
+ import"./index-bns3wcpc.js";
25
+ export {
26
+ CloudScript2 as CloudScript
27
+ };
@@ -0,0 +1,345 @@
1
+ // @bun
2
+ import {
3
+ Workspace,
4
+ runner,
5
+ script,
6
+ command
7
+ } from "./index-9zy8479y.js";
8
+ import"./index-bns3wcpc.js";
9
+ import"./index-g500c5j9.js";
10
+ import {
11
+ AkanCodeEnv,
12
+ akanCodePaths2
13
+ } from "./index-35j83zkd.js";
14
+ import {
15
+ akanCodeDefaultModel2,
16
+ CodeAgentStreamPrinter2,
17
+ WorkspaceTrust
18
+ } from "./index-w15mg3km.js";
19
+
20
+ // pkgs/@akanjs/cli/code/code.runner.ts
21
+ import { randomBytes } from "crypto";
22
+ import { chmodSync, existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
23
+ import path from "path";
24
+ import { codeAgentPresets, isCodeAgentPresetName } from "akanjs/common";
25
+
26
+ // pkgs/@akanjs/cli/code/CodeTrustPrompt.ts
27
+ var shown = 8;
28
+
29
+ class CodeTrustPrompt {
30
+ static describe(items) {
31
+ const lines = ["This repo asks akan code to run its own code:"];
32
+ for (const item of items) {
33
+ lines.push(item.kind === "mcp" ? " MCP servers in .akan/code/mcp.json, which it would start or connect to:" : " Extensions in .akan/code/extensions/, which it would load and run:");
34
+ lines.push(...item.lines.slice(0, shown).map((line) => ` ${line}`));
35
+ if (item.lines.length > shown)
36
+ lines.push(` \u2026 and ${item.lines.length - shown} more`);
37
+ }
38
+ return lines.join(`
39
+ `);
40
+ }
41
+ static skipped(items) {
42
+ const what = items.map((item) => item.kind === "mcp" ? "MCP servers" : "extensions").join(" and ");
43
+ return `This repo's ${what} were not started: they are not approved. Start akan code in a terminal to approve them, or pass --trust-workspace.`;
44
+ }
45
+ static async ask(items, { input, output }) {
46
+ output.write(`${CodeTrustPrompt.describe(items)}
47
+
48
+ Start them, and remember this until they change? [y/N] `);
49
+ const answer = await CodeTrustPrompt.#line(input);
50
+ return /^\s*y(es)?\s*$/i.test(answer ?? "");
51
+ }
52
+ static #line(input) {
53
+ return new Promise((resolve) => {
54
+ let buffer = "";
55
+ const finish = (value) => {
56
+ input.off("data", onData);
57
+ input.off("end", onEnd);
58
+ input.pause();
59
+ resolve(value);
60
+ };
61
+ const onData = (chunk) => {
62
+ buffer += chunk.toString();
63
+ const newline = buffer.search(/[\r\n]/);
64
+ if (newline >= 0)
65
+ finish(buffer.slice(0, newline));
66
+ };
67
+ const onEnd = () => finish(undefined);
68
+ input.on("data", onData);
69
+ input.on("end", onEnd);
70
+ input.resume();
71
+ });
72
+ }
73
+ }
74
+
75
+ // pkgs/@akanjs/cli/code/code.runner.ts
76
+ class CodeRunner extends runner("code") {
77
+ async serve(options, listen) {
78
+ await import("./consoleToStderr-h5bryj94.js");
79
+ const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
80
+ import("./CodeAgent-dyc45f5w.js"),
81
+ import("./CodeAgentRpcHost-6dzfkvsc.js"),
82
+ import("./CodeAgentRpcListener-tcwrdvst.js")
83
+ ]);
84
+ const address = listen ? CodeAgentRpcListener.parse(listen, { anyHost: !!options.rpcBindAny }) : null;
85
+ const tcp = !!address && !("unix" in address);
86
+ const tokenFile = tcp && options.rpcToken !== false ? AkanCodeEnv.get("AKAN_CODE_RPC_TOKEN_FILE") : undefined;
87
+ const token = !tcp || options.rpcToken === false ? null : CodeRunner.#rpcTokenFrom(tokenFile);
88
+ const start = await CodeRunner.#start(options, { hostAttached: true, interactive: false, ask: false });
89
+ for (const warning of start.warnings)
90
+ process.stderr.write(`${warning}
91
+ `);
92
+ const agent = await CodeAgent.create({ ...start.agent, mode: "rpc" });
93
+ if (!address)
94
+ return await new CodeAgentRpcHost(agent).serve();
95
+ const listener = new CodeAgentRpcListener(new CodeAgentRpcHost(agent, null), address, { token }).listen();
96
+ const where = "unix" in address ? address.unix : `${address.hostname}:${listener.port}`;
97
+ const written = token && !tokenFile ? CodeRunner.#writeRpcToken(listener.port ?? 0, token) : undefined;
98
+ const tokenAt = tokenFile ?? written;
99
+ process.stderr.write(tokenAt ? `akan code rpc listening on ${where}; open with {"auth":"<token>"}, the token is in ${tokenAt}
100
+ ` : `akan code rpc listening on ${where}
101
+ `);
102
+ if (tcp && !token)
103
+ process.stderr.write(`No token is asked for, so any process on this machine can drive this agent.
104
+ `);
105
+ try {
106
+ await listener.serve();
107
+ } finally {
108
+ if (written)
109
+ rmSync(written, { force: true });
110
+ }
111
+ }
112
+ async tui(options, seed) {
113
+ const [{ CodeAgent }, { CodeTui }] = await Promise.all([
114
+ import("./CodeAgent-dyc45f5w.js"),
115
+ import("./CodeTui-q55b2zrn.js")
116
+ ]);
117
+ const start = await CodeRunner.#start(options, { hostAttached: false, interactive: true, ask: true });
118
+ const agentOptions = start.agent;
119
+ let warnings = start.warnings;
120
+ let resume = options.resume;
121
+ let autoCompactAt = agentOptions.autoCompactAt;
122
+ let prompt = seed;
123
+ let notice;
124
+ for (;; ) {
125
+ const agent = await CodeAgent.create({
126
+ ...agentOptions,
127
+ mode: "tui",
128
+ ...resume ? { resume } : {},
129
+ ...autoCompactAt ? { autoCompactAt } : {}
130
+ });
131
+ let next;
132
+ try {
133
+ next = await new CodeTui(agent, {
134
+ thinking: options.thinking,
135
+ ...notice ? { notice } : {},
136
+ warnings
137
+ }).run(prompt);
138
+ autoCompactAt = agent.info.autoCompactAt;
139
+ } finally {
140
+ agent.dispose();
141
+ }
142
+ if (!next)
143
+ return;
144
+ resume = next.id;
145
+ notice = next.notice;
146
+ warnings = [];
147
+ prompt = "";
148
+ }
149
+ }
150
+ async run(prompt, options) {
151
+ const { CodeAgent } = await import("./CodeAgent-dyc45f5w.js");
152
+ const ask = !!process.stdin.isTTY && !!process.stderr.isTTY;
153
+ const start = await CodeRunner.#start(options, { hostAttached: false, interactive: false, ask });
154
+ for (const warning of start.warnings)
155
+ process.stderr.write(`${warning}
156
+ `);
157
+ const agent = await CodeAgent.create(start.agent);
158
+ const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
159
+ agent.on((event) => printer.print(event));
160
+ agent.announce();
161
+ try {
162
+ await agent.prompt(prompt);
163
+ await agent.waitForIdle();
164
+ } finally {
165
+ printer.finish();
166
+ agent.dispose();
167
+ }
168
+ }
169
+ static async#start(options, mode) {
170
+ const profile = CodeRunner.profileOf(options, mode);
171
+ const trust = await CodeRunner.trust(options.workspace.workspaceRoot, profile, {
172
+ trustWorkspace: !!options.trustWorkspace,
173
+ ...mode.ask && process.stdin.isTTY ? { streams: { input: process.stdin, output: process.stderr } } : {}
174
+ });
175
+ const agent = {
176
+ workspace: options.workspace,
177
+ cwd: profile.paths.root,
178
+ profile,
179
+ apps: options.app ? [options.app] : await options.workspace.getApps(),
180
+ model: CodeRunner.modelOf(options.model),
181
+ ...options.compactAt !== undefined ? { autoCompactAt: options.compactAt } : {}
182
+ };
183
+ return { agent, warnings: [...CodeRunner.startWarnings(profile), ...trust] };
184
+ }
185
+ static profileOf(options, { hostAttached, interactive = true }) {
186
+ if (!isCodeAgentPresetName(options.profile))
187
+ throw new Error(`Unknown profile: ${options.profile}. Use local, pod, review, or web.`);
188
+ const root = options.app ? `${options.workspace.workspaceRoot}/apps/${options.app}` : options.workspace.workspaceRoot;
189
+ const profile = codeAgentPresets[options.profile](root);
190
+ const { askOutside: _ask, ...network } = profile.network;
191
+ return {
192
+ ...profile,
193
+ ...options.askNetwork === false ? { network } : {},
194
+ ui: { ...profile.ui, canPrompt: CodeRunner.canPrompt(profile, hostAttached, interactive) }
195
+ };
196
+ }
197
+ static canPrompt(profile, hostAttached, interactive = true) {
198
+ const forced = AkanCodeEnv.get("AKAN_CODE_CAN_PROMPT");
199
+ if (forced === "1")
200
+ return true;
201
+ if (forced === "0")
202
+ return false;
203
+ return hostAttached || interactive && profile.ui.canPrompt;
204
+ }
205
+ static startWarnings(profile) {
206
+ return [
207
+ ...AkanCodeEnv.ignored(),
208
+ ...profile.name === "local" ? [
209
+ "The local profile is not a sandbox: it refuses known secret files and asks before an unlisted host, but a command it runs can read anything you can. Use --profile pod inside a container to isolate it."
210
+ ] : []
211
+ ];
212
+ }
213
+ static async trust(workspaceRoot, profile, { trustWorkspace, streams }) {
214
+ const kinds = profile.tools.mcp === "off" ? ["extensions"] : ["mcp", "extensions"];
215
+ const pending = WorkspaceTrust.pending(workspaceRoot, kinds);
216
+ if (!pending.length)
217
+ return [];
218
+ if (trustWorkspace) {
219
+ WorkspaceTrust.approve(workspaceRoot, pending, false);
220
+ return [];
221
+ }
222
+ if (streams && await CodeTrustPrompt.ask(pending, streams)) {
223
+ WorkspaceTrust.approve(workspaceRoot, pending, true);
224
+ return [];
225
+ }
226
+ return [CodeTrustPrompt.skipped(pending)];
227
+ }
228
+ static #rpcTokenFrom(file) {
229
+ if (!file || !existsSync(file)) {
230
+ const token = randomBytes(32).toString("base64url");
231
+ if (file)
232
+ CodeRunner.#writePrivate(file, token);
233
+ return token;
234
+ }
235
+ const token = readFileSync(file, "utf8").trim();
236
+ if (!token)
237
+ throw new Error(`AKAN_CODE_RPC_TOKEN_FILE names ${file}, which is empty.`);
238
+ return token;
239
+ }
240
+ static #writeRpcToken(port, token) {
241
+ const file = akanCodePaths2.rpcTokenFile(port);
242
+ CodeRunner.#writePrivate(file, token);
243
+ return file;
244
+ }
245
+ static #writePrivate(file, content) {
246
+ akanCodePaths2.ensureGlobalDir();
247
+ mkdirSync(path.dirname(file), { recursive: true, mode: 448 });
248
+ writeFileSync(file, `${content}
249
+ `, { mode: 384 });
250
+ chmodSync(file, 384);
251
+ }
252
+ static modelOf(model) {
253
+ if (!model)
254
+ return;
255
+ const [provider, ...rest] = model.split("/");
256
+ if (!provider || !rest.length)
257
+ throw new Error(`Model must be "<provider>/<id>", e.g. ${akanCodeDefaultModel2.provider}/${akanCodeDefaultModel2.id}`);
258
+ return { provider, id: rest.join("/") };
259
+ }
260
+ }
261
+
262
+ // pkgs/@akanjs/cli/code/code.script.ts
263
+ class CodeScript extends script("code", [CodeRunner]) {
264
+ async run(workspace, prompt, options) {
265
+ const run = {
266
+ workspace,
267
+ ...options.app ? { app: options.app } : {},
268
+ profile: options.profile,
269
+ ...options.model ? { model: options.model } : {},
270
+ ...options.compactAt !== null ? { compactAt: options.compactAt } : {},
271
+ json: options.json,
272
+ thinking: options.thinking,
273
+ ...options.resume ? { resume: options.resume } : {},
274
+ trustWorkspace: options.trustWorkspace,
275
+ askNetwork: options.askNetwork,
276
+ rpcBindAny: options.rpcBindAny,
277
+ rpcToken: options.rpcToken
278
+ };
279
+ if (options.rpcListen)
280
+ return await this.codeRunner.serve(run, options.rpcListen);
281
+ if (options.rpc)
282
+ return await this.codeRunner.serve(run);
283
+ const interactive = options.interactive || !prompt.trim() && !options.json && !!process.stdout.isTTY;
284
+ if (interactive)
285
+ return await this.codeRunner.tui(run, prompt);
286
+ if (!prompt.trim())
287
+ throw new Error('akan code needs a prompt when it has no terminal: akan code "add a comment module"');
288
+ await this.codeRunner.run(prompt, run);
289
+ }
290
+ }
291
+
292
+ // pkgs/@akanjs/cli/code/code.command.ts
293
+ class CodeCommand extends command("code", [CodeScript], ({ public: target }) => ({
294
+ code: target({ desc: "Run the akan coding agent on a prompt" }).arg("prompt", String, { desc: "what the agent should do", nullable: true }).option("app", String, { desc: "narrow the agent to one app instead of the whole repo", nullable: true }).option("profile", String, { desc: "local, pod, review, or web", default: "local" }).option("model", String, { desc: "<provider>/<id>, e.g. deepseek/deepseek-flash", nullable: true }).option("compactAt", Number, {
295
+ desc: "compact once the context window is this full, in percent: 10, 20, \u2026 100",
296
+ flag: "c",
297
+ nullable: true
298
+ }).option("json", Boolean, { desc: "print one event per line as JSON", default: false }).option("thinking", Boolean, { desc: "print the model's reasoning", default: false }).option("rpc", Boolean, { desc: "serve the agent over stdio for another process to drive", default: false }).option("rpcListen", String, {
299
+ desc: "serve the RPC wire on unix:<path> or tcp:[host:]<port> instead of stdio",
300
+ flag: "L",
301
+ nullable: true
302
+ }).option("resume", String, { desc: "continue a stored session by id", flag: "R", nullable: true }).option("interactive", Boolean, {
303
+ desc: "open the full-screen session even when a prompt is given",
304
+ flag: "i",
305
+ default: false
306
+ }).option("trustWorkspace", Boolean, {
307
+ desc: "start this repo's own MCP servers and extensions for this run without asking",
308
+ flag: "T",
309
+ default: false
310
+ }).option("askNetwork", Boolean, {
311
+ desc: "ask before fetching an unlisted host or running a networking command (local profile)",
312
+ flag: "N",
313
+ default: true
314
+ }).option("rpcBindAny", Boolean, {
315
+ desc: "let --rpc-listen bind an address other machines can reach",
316
+ flag: "B",
317
+ default: false
318
+ }).option("rpcToken", Boolean, {
319
+ desc: "make a --rpc-listen tcp: connection open with its token",
320
+ flag: "K",
321
+ default: true
322
+ }).with(Workspace).exec(async function(prompt, app, profile, model, compactAt, json, thinking, rpc, rpcListen, resume, interactive, trustWorkspace, askNetwork, rpcBindAny, rpcToken, workspace) {
323
+ const options = {
324
+ app,
325
+ profile,
326
+ model,
327
+ compactAt,
328
+ json,
329
+ thinking,
330
+ rpc,
331
+ rpcListen,
332
+ interactive,
333
+ resume,
334
+ trustWorkspace,
335
+ askNetwork,
336
+ rpcBindAny,
337
+ rpcToken
338
+ };
339
+ await this.codeScript.run(workspace, prompt ?? "", options);
340
+ })
341
+ })) {
342
+ }
343
+ export {
344
+ CodeCommand
345
+ };
@@ -1 +1 @@
1
- {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","migrate":"application","create-migration":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","pipeline":"pipeline","tunnel":"tunnel"}}
1
+ {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","migrate":"application","create-migration":"application","preview":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","verify":"verify","repair":"repair","workflow":"workflow","pipeline":"pipeline","tunnel":"tunnel"}}
@@ -2,28 +2,30 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-3wypz6xj.js";
6
- import"./index-52w0fvh8.js";
7
- import"./index-wcej7g4z.js";
5
+ } from "./index-9zy8479y.js";
6
+ import"./index-bns3wcpc.js";
7
+ import"./index-g500c5j9.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-xjf5j657.js";
10
- import"./index-31es1yev.js";
11
- import"./index-a58emady.js";
12
- import"./index-bt438yxm.js";
13
- import"./index-js6geqjn.js";
9
+ import"./index-hm0tn7qv.js";
10
+ import"./index-2nxk8wgs.js";
11
+ import"./index-j7hwy56s.js";
12
+ import"./index-qw6814m4.js";
13
+ import"./index-sp0qsr7a.js";
14
+ import"./index-0j1t1h2b.js";
14
15
  import"./index-m9jj544v.js";
15
- import"./index-xb8809yb.js";
16
- import"./index-0fz95kxe.js";
17
- import"./index-zzvvc845.js";
18
- import"./index-j9vyj3dj.js";
19
- import"./index-905qdgqp.js";
20
- import"./index-hmt54t45.js";
21
- import"./index-74tjjsnc.js";
22
- import"./index-skk9zc1x.js";
23
- import"./index-b70zct19.js";
16
+ import"./index-zbrwnmf1.js";
17
+ import"./index-sveq36gh.js";
18
+ import"./index-j6eeh5d7.js";
19
+ import"./index-2phm56a1.js";
20
+ import"./index-khk05tsf.js";
21
+ import"./index-t1t9wq9a.js";
22
+ import"./index-g841cap9.js";
23
+ import"./index-jc2zbwra.js";
24
+ import"./index-fbewhg4g.js";
25
+ import"./index-raz588b3.js";
24
26
  import {
25
27
  ContextScript
26
- } from "./index-qfp55x1y.js";
28
+ } from "./index-tgqameyb.js";
27
29
 
28
30
  // pkgs/@akanjs/cli/context/context.command.ts
29
31
  class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
@@ -0,0 +1,27 @@
1
+ // @bun
2
+ import {
3
+ ContextRunner2
4
+ } from "./index-qw6814m4.js";
5
+ import"./index-raz588b3.js";
6
+ import"./index-jc2zbwra.js";
7
+ import"./index-g841cap9.js";
8
+ import"./index-2phm56a1.js";
9
+ import"./index-t1t9wq9a.js";
10
+ import"./index-khk05tsf.js";
11
+ import"./index-fbewhg4g.js";
12
+ import"./index-j7hwy56s.js";
13
+ import"./index-hm0tn7qv.js";
14
+ import"./index-2nxk8wgs.js";
15
+ import"./index-0j1t1h2b.js";
16
+ import"./index-j6eeh5d7.js";
17
+ import"./index-sp0qsr7a.js";
18
+ import"./index-m9jj544v.js";
19
+ import"./index-9zy8479y.js";
20
+ import"./index-sveq36gh.js";
21
+ import"./index-zbrwnmf1.js";
22
+ import"./index-g500c5j9.js";
23
+ import"./index-hj6w4ka1.js";
24
+ import"./index-bns3wcpc.js";
25
+ export {
26
+ ContextRunner2 as ContextRunner
27
+ };
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  TypeScriptDependencyScanner2
4
- } from "./index-tvehn2sp.js";
5
- import"./index-52w0fvh8.js";
4
+ } from "./index-qd7xn2bk.js";
5
+ import"./index-bns3wcpc.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-7md2g9vw.js";
4
+ } from "./index-tenw3mah.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-52w0fvh8.js";
5
+ } from "./index-bns3wcpc.js";
6
6
  export {
7
7
  FileSys2 as FileSys,
8
8
  getDirname2 as getDirname
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  script,
4
4
  command
5
- } from "./index-3wypz6xj.js";
6
- import"./index-52w0fvh8.js";
7
- import"./index-wcej7g4z.js";
5
+ } from "./index-9zy8479y.js";
6
+ import"./index-bns3wcpc.js";
7
+ import"./index-g500c5j9.js";
8
8
  import {
9
9
  Prompter2
10
- } from "./index-zzvvc845.js";
10
+ } from "./index-j6eeh5d7.js";
11
11
 
12
12
  // pkgs/@akanjs/cli/guideline/guideline.script.ts
13
13
  import { Logger } from "akanjs/common";
@@ -34,7 +34,12 @@ pages declaring one name never clash, and a registry kept outside the surface re
34
34
  cannot spend the LLM key. **The guard decides who, not what** — the browser writes the instructions, tools and
35
35
  transcript — so `option.setAgentRequestPolicy((request, { account, ip }) => request)` sees each turn after the
36
36
  guard, before the quota and the model (tool names as the page published them), and returns what is sent, or
37
- throws an `Err` (`agent.error.requestRefused`) to refuse it.
37
+ throws an `Err` (`agent.error.requestRefused`) to refuse it. With no policy set, a turn past
38
+ `AgentRelayPolicy.defaultLimits` (5,000 messages, 512 tools, 256 context entries, 8M characters, 64 MiB of
39
+ attachments) is refused with 413; a policy of the app's own keeps them by returning
40
+ `AgentRelayPolicy.capped(request, limits)`, and `(request) => request` lifts them. An error that is not an `Err`
41
+ reaches the chat as a generic failure and the server log in full, unless `AKAN_ERROR_DETAIL=1` or a development
42
+ runtime (`akan start`, `NODE_ENV` `development` or `test`) shows its message.
38
43
  `persist` keeps the transcript across reloads (sessionStorage; `{ storage: "local" }` to outlive the tab),
39
44
  default off, and `shortcut={false}` gives the browser back the Cmd/Ctrl+L the launcher otherwise captures.
40
45
  **`persist` also takes a `SessionHistory` of the app's own** — `{ load, save, clear }` — which is how a
@@ -111,11 +116,12 @@ pages declaring one name never clash, and a registry kept outside the surface re
111
116
  app's own chat-completions adaptor claims through `OpenaiLlm.acceptsOf(llmOption)` instead of copying the rule —
112
117
  a copy that read "any host is a gateway" kept a vision model text-only for an app that spelled out
113
118
  `https://api.openai.com/v1`.
114
- - **A refusal is `agent.error.llmRequestFailed`, and it names the host** — unless the prompt did not fit. The
115
- provider's own sentence rides in `reason` and the hostname in `provider`. `LlmOverflow.refusal(host, status,
116
- reason)` builds it, and reads the one refusal a chat can undo — a prompt past the window, recognized from each
117
- provider's own sentence — as `agent.error.contextOverflow` with the `limit` it named, which the relay flags so
118
- the chat compacts and asks again. An adaptor an app wrote throws through the same function, so its refusals
119
+ - **A refusal is `agent.error.llmRequestFailed`, and it names the host** — unless the prompt did not fit. It
120
+ carries `{ provider, status }`, the hostname and the HTTP status; the provider's own sentence goes to the server
121
+ log only, because it can quote an account id or part of a key and `Err` data reaches the browser.
122
+ `LlmOverflow.refusal(host, status, reason)` builds it, and reads the one refusal a chat can undo — a prompt past
123
+ the window, recognized from each provider's own sentence — as `agent.error.contextOverflow` with the `limit` it
124
+ 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
119
125
  translate and recover the way the shipped ones do without a key in the framework's dictionary it cannot add.
120
126
  - **`accepts` is answered per model, through `option.setLlm({ accepts })`.** An adaptor answers for an API and one
121
127
  API serves models that differ, so the override rides beside the `model` it is a fact about. It is not a table
@@ -322,7 +328,12 @@ pages declaring one name never clash, and a registry kept outside the surface re
322
328
  an inline arrow can be clicked by a person and by nobody else. `.desc()` is required and comes first, `.arg()`
323
329
  is an argument the caller must pass and `.opt()` one it may leave out (the `exec` parameter is then `| null`),
324
330
  and `.exec()` is the only hook, so the chain completes in one unconditional statement and the callable carries
325
- `data-akan-action` like a store setter does. A `remove*` name defaults to a confirm gate. `st.tool("x", { label:
331
+ `data-akan-action` like a store setter does. A name starting with a write verb (`remove`, `delete`, `create`,
332
+ `update`, `upsert`, `submit`, `save`, `send`, `export`) asks the user first unless it says `{ confirm: false }`;
333
+ `AgentConfirm.set({ byName })` moves that default app-wide. After a tool marked `taint: "source"` (`readScreen`,
334
+ `readState`, `viewImage`) returns text the user did not write, the next call that changes something asks once,
335
+ whatever its own `confirm` says, until the user approves a call; `taint: "exempt"` marks a tool that only moves the
336
+ view, and `AgentConfirm.set({ afterScreenRead: false })` turns the rule off. `st.tool("x", { label:
326
337
  l("ticket.archive") })` gives the action a name a person reads — `Agent.useScreenActions()` hands it to a command
327
338
  palette, and the model never sees it. Reach a store action
328
339
  from the body — `.exec((id) => st.do.removeX(id))` — which is how an agent gets CRUD; `st.do` on its own
@@ -718,7 +729,10 @@ pages declaring one name never clash, and a registry kept outside the surface re
718
729
  or `<nav>` and the component insists on a label. A region that is hidden anyway leaves no marker claiming it is
719
730
  there. **It hides text, not behaviour**: tools and state keys are declarations rather than markup, so an
720
731
  `st.tool` inside is published exactly as before and `highlight` still reaches a control in there. This is
721
- `field.visual` one layer up — cost, not secrecy.
732
+ `field.visual` one layer up — cost, not secrecy. Secrecy is `data-agent-private="<label>"`: the read prints
733
+ `[private: <label>]` in its place even when asked for by name, and it is no `section` or `highlight` target. A
734
+ password, one-time-code or card input (its standard `autocomplete`) is never read either; any other value on
735
+ screen is.
722
736
  - **Reach for it second.** A read narrows from the other side too: `Agent.Zone` and `readScreen({ section })` scope
723
737
  to one container, which beats blocklisting five regions on a screen that is mostly chrome. And a footer is last
724
738
  in the document, so on a page long enough to truncate it was already past the cut — the regions worth marking are