@akanjs/cli 3.1.0-rc.21 → 3.1.0-rc.22

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-gzfc5t52.js → CodeAgent-fee0pnwp.js} +2 -2
  3. package/{CodeTui-bpsjs8wz.js → CodeTui-xh71b2k8.js} +1 -1
  4. package/TunnelShare-s7bpe55e.js +14 -0
  5. package/{agent.command-67ysh3n6.js → agent.command-tge9rvmt.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-q0tqw5pc.js → application.command-j5b8yrcf.js} +9 -9
  8. package/{applicationBuildRunner-wsszr305.js → applicationBuildRunner-s41mgz21.js} +21 -7
  9. package/buildBatch.proc.js +9 -9
  10. package/{cloud.command-e7tkxyx6.js → cloud.command-q9srng6e.js} +13 -13
  11. package/cloud.script-vfsd4gxs.js +24 -0
  12. package/{code.command-ttk8tje2.js → code.command-n6r6zt97.js} +6 -6
  13. package/{context.command-bdsk2z2r.js → context.command-1je84w1b.js} +16 -16
  14. package/context.runner-xg0ngz93.js +25 -0
  15. package/{guideline.command-man90n70.js → guideline.command-0e0sx2vg.js} +2 -2
  16. package/guidelines/conventions/conventions.instruction.md +18 -12
  17. package/guidelines/mcpRule/mcpRule.instruction.md +88 -47
  18. package/guidelines/pageRule/pageRule.instruction.md +53 -8
  19. package/guidelines/runtimeRule/runtimeRule.instruction.md +8 -1
  20. package/guidelines/ssrRule/ssrRule.instruction.md +8 -5
  21. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +1 -1
  22. package/incrementalBuilder.proc.js +3 -3
  23. package/{index-p2r64bpa.js → index-1bhv9dh4.js} +4 -4
  24. package/{index-h6czey01.js → index-1xqq3va9.js} +9 -9
  25. package/{index-27y8t17p.js → index-3xhak9e0.js} +1 -1
  26. package/{index-ta1dychm.js → index-4fe4qqgn.js} +3 -3
  27. package/{index-35m6bzm7.js → index-551gh8h2.js} +5 -5
  28. package/{index-033wne2j.js → index-5m0s0gdv.js} +1 -1
  29. package/index-6mprvdt8.js +566 -0
  30. package/{index-h3r3nr9y.js → index-6nqnqzv1.js} +1 -1
  31. package/{index-cae9m5jz.js → index-73esn3y2.js} +1 -1
  32. package/{index-8jehkey8.js → index-7xy30jev.js} +4 -4
  33. package/{index-75n5q4ph.js → index-85h3dhe0.js} +7 -7
  34. package/{index-54wc2phm.js → index-8abyrfw8.js} +5 -4
  35. package/{index-g9ks2k8c.js → index-94jq9cbz.js} +2 -2
  36. package/{index-jrmzcp66.js → index-9h0z0tjr.js} +2 -2
  37. package/{index-844q7f8z.js → index-c9rfak6r.js} +7 -7
  38. package/{index-1r5a8bzx.js → index-cgyqx6q1.js} +2 -2
  39. package/{index-zv5s8x58.js → index-cq5x7a9k.js} +8 -8
  40. package/{index-ebarbgba.js → index-deckcwbg.js} +2 -2
  41. package/{index-4v43h00g.js → index-ex35dg39.js} +2 -1
  42. package/{index-xsd96yzw.js → index-f9118j70.js} +1 -1
  43. package/{index-vkb9m4z7.js → index-g5px5pxd.js} +1 -1
  44. package/{index-g6ax17x4.js → index-gxqvev8w.js} +28 -8
  45. package/{index-rc51f9ht.js → index-hagw9c94.js} +3 -3
  46. package/{index-9mt4smfy.js → index-p44jnjfr.js} +2 -2
  47. package/{index-4393nb4b.js → index-rp9anyeb.js} +4 -4
  48. package/{index-pg1t468s.js → index-t8npm331.js} +3 -3
  49. package/{index-nv79n88g.js → index-tbmtmkhx.js} +2 -2
  50. package/{index-2w8j2fnv.js → index-vyh8kemm.js} +3 -3
  51. package/{index-48edp6q4.js → index-x7bny3wv.js} +1 -1
  52. package/index.js +22 -22
  53. package/{library.command-6amzsrb8.js → library.command-ys9s0mtc.js} +3 -3
  54. package/{localRegistry.command-yqc0nyhh.js → localRegistry.command-kmp3sd47.js} +12 -12
  55. package/{module.command-10x6jv6c.js → module.command-5sx9453y.js} +5 -5
  56. package/{package.command-pwfvecjf.js → package.command-s0d3417k.js} +3 -3
  57. package/package.json +2 -2
  58. package/{page.command-ahhgx9y1.js → page.command-zsa03pmc.js} +3 -3
  59. package/{pipeline.command-1ptr3e9y.js → pipeline.command-j8h6qsha.js} +2 -2
  60. package/{primitive.command-g5xwv6tj.js → primitive.command-n2978nmw.js} +6 -6
  61. package/{projectTypecheck-fx8x7cat.js → projectTypecheck-qg2jf80j.js} +1 -1
  62. package/{quality.command-fw9ck061.js → quality.command-7kgz46st.js} +2 -2
  63. package/{repair.command-g8kecj96.js → repair.command-2sszcckw.js} +5 -5
  64. package/{routeSourceValidator-7ycnfz0e.js → routeSourceValidator-6jd0q6r6.js} +47 -14
  65. package/{scalar.command-fprap51w.js → scalar.command-230jrhzf.js} +4 -4
  66. package/{subspace.command-sc0t527y.js → subspace.command-y5v4ypd3.js} +8 -8
  67. package/{tunnel.command-mqnsqbwf.js → tunnel.command-ja29zghd.js} +7 -7
  68. package/{workflow.command-j0jgkr13.js → workflow.command-0eg8czt5.js} +10 -10
  69. package/{workspace.command-1r9hvvw0.js → workspace.command-zcym1dk5.js} +24 -24
  70. package/TunnelShare-tfrnftgr.js +0 -14
  71. package/cloud.script-krzh3d7k.js +0 -24
  72. package/context.runner-bxzv0gm0.js +0 -25
  73. package/index-nx64dz92.js +0 -271
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- 5cd1b4a580fd87bc2eb87ac99ed7ddef9d11f9cff7b04559b77daedc42dbe881
1
+ ff52b306f8c96b86a1bb9a1ea7d4a3a02deeb65d3184e77f02398b6eab82b052
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgent2
4
- } from "./index-2w8j2fnv.js";
5
- import"./index-cae9m5jz.js";
4
+ } from "./index-vyh8kemm.js";
5
+ import"./index-73esn3y2.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-cae9m5jz.js";
8
+ } from "./index-73esn3y2.js";
9
9
  import {
10
10
  CodeTuiLines2,
11
11
  CodeTuiAgents2,
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-x7bny3wv.js";
5
+ import"./index-9h0z0tjr.js";
6
+ import"./index-551gh8h2.js";
7
+ import"./index-m9jj544v.js";
8
+ import"./index-6mprvdt8.js";
9
+ import"./index-6nqnqzv1.js";
10
+ import"./index-gxqvev8w.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-vkb9m4z7.js";
5
+ } from "./index-g5px5pxd.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-g6ax17x4.js";
7
+ import"./index-gxqvev8w.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-033wne2j.js";
10
- import"./index-nv79n88g.js";
9
+ import"./index-5m0s0gdv.js";
10
+ import"./index-tbmtmkhx.js";
11
11
  import"./index-zzvvc845.js";
12
12
  import {
13
13
  AgentScript
14
- } from "./index-ta1dychm.js";
14
+ } from "./index-4fe4qqgn.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-2w8j2fnv.js";
31
+ } from "./index-vyh8kemm.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-cae9m5jz.js";
43
+ } from "./index-73esn3y2.js";
44
44
  import"./index-7md2g9vw.js";
45
45
  import {
46
46
  CodeAgentRpcHost2
@@ -7,18 +7,19 @@ import {
7
7
  Exec,
8
8
  Workspace,
9
9
  command
10
- } from "./index-vkb9m4z7.js";
10
+ } from "./index-g5px5pxd.js";
11
11
  import"./index-52w0fvh8.js";
12
- import"./index-g6ax17x4.js";
12
+ import"./index-gxqvev8w.js";
13
13
  import"./index-5nd1wtkv.js";
14
- import"./index-4v43h00g.js";
14
+ import"./index-ex35dg39.js";
15
15
  import"./index-m9jj544v.js";
16
- import"./index-35m6bzm7.js";
17
- import"./index-h3r3nr9y.js";
18
- import"./index-9mt4smfy.js";
16
+ import"./index-551gh8h2.js";
17
+ import"./index-6mprvdt8.js";
18
+ import"./index-6nqnqzv1.js";
19
+ import"./index-p44jnjfr.js";
19
20
  import {
20
21
  ApplicationScript
21
- } from "./index-h6czey01.js";
22
+ } from "./index-1xqq3va9.js";
22
23
  import"./index-7md2g9vw.js";
23
24
  import {
24
25
  writeOption,
@@ -27,8 +28,7 @@ import {
27
28
  allowLocalOption,
28
29
  publicEnvOption
29
30
  } from "./index-mdjc93e1.js";
30
- import"./index-xsd96yzw.js";
31
- import"./index-nx64dz92.js";
31
+ import"./index-f9118j70.js";
32
32
 
33
33
  // pkgs/@akanjs/cli/application/application.command.ts
34
34
  import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
@@ -4,20 +4,20 @@ import {
4
4
  Spinner,
5
5
  ProjectTypecheck2,
6
6
  WorkspaceExecutor
7
- } from "./index-g6ax17x4.js";
7
+ } from "./index-gxqvev8w.js";
8
8
  import"./index-52w0fvh8.js";
9
- import"./index-1r5a8bzx.js";
10
- import"./index-h3r3nr9y.js";
9
+ import"./index-cgyqx6q1.js";
10
+ import"./index-6nqnqzv1.js";
11
11
  import {
12
12
  AllRoutesBuilder,
13
13
  FontPruner,
14
14
  precompressArtifacts,
15
15
  SsrBaseArtifactBuilder
16
- } from "./index-54wc2phm.js";
17
- import"./index-62md4dwy.js";
16
+ } from "./index-8abyrfw8.js";
18
17
  import {
19
18
  CsrArtifactBuilder
20
- } from "./index-nx64dz92.js";
19
+ } from "./index-6mprvdt8.js";
20
+ import"./index-62md4dwy.js";
21
21
 
22
22
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
23
23
  import path2 from "path";
@@ -124,12 +124,26 @@ class ApplicationBuildRunner {
124
124
  get #envDir() {
125
125
  return path2.join(this.#app.cwdPath, "env");
126
126
  }
127
+ #pinImageEnv(baseDevEnv, environment) {
128
+ const imageEnv = {
129
+ AKAN_PUBLIC_ENV: environment,
130
+ AKAN_PUBLIC_REPO_NAME: baseDevEnv.repoName,
131
+ AKAN_PUBLIC_SERVE_DOMAIN: baseDevEnv.serveDomain
132
+ };
133
+ const outranked = Object.entries(imageEnv).filter(([key, value]) => {
134
+ const given = process.env[key];
135
+ return !!given && given !== value && !(key === "AKAN_PUBLIC_ENV" && this.#environment);
136
+ });
137
+ if (outranked.length)
138
+ this.#app.logger.warn(`The workspace .env outranks this process's environment: the bundles and the image take ${outranked.map(([key, value]) => `${key}=${value} (not ${process.env[key]})`).join(", ")}.`);
139
+ Object.assign(process.env, imageEnv);
140
+ }
127
141
  async build({ spinner = false } = {}) {
128
142
  this.#spinner = spinner;
129
143
  const { web, assets, baseDevEnv } = await this.#app.getConfig();
130
144
  const environment = this.#environment ?? baseDevEnv.env;
131
145
  WorkspaceExecutor.assertDeployableEnv(baseDevEnv, environment, "akan build");
132
- process.env.AKAN_PUBLIC_ENV = environment;
146
+ this.#pinImageEnv(baseDevEnv, environment);
133
147
  if (this.#profile)
134
148
  await ServerEnvProfile.assertShippable({ envDir: this.#envDir, environment, profile: this.#profile });
135
149
  await this.#runPhase("prepare", "Preparing output directory", () => this.#app.prepareCommand("build"));
@@ -6,27 +6,27 @@ import {
6
6
  resolveSsrPageEntriesForApp,
7
7
  WorkspaceExecutor,
8
8
  AppExecutor
9
- } from "./index-g6ax17x4.js";
9
+ } from "./index-gxqvev8w.js";
10
10
  import {
11
11
  computeRouteSeedIndex,
12
12
  saveRouteSeedIndex,
13
13
  CsrDevBundler,
14
14
  SsrDevBundler
15
- } from "./index-1r5a8bzx.js";
15
+ } from "./index-cgyqx6q1.js";
16
16
  import"./index-52w0fvh8.js";
17
17
  import {
18
18
  ServerGraphFile,
19
19
  PagesBundleBuilder
20
- } from "./index-h3r3nr9y.js";
20
+ } from "./index-6nqnqzv1.js";
21
21
  import {
22
22
  CssCompiler,
23
23
  FontOptimizer,
24
24
  SsrBaseArtifactBuilder
25
- } from "./index-54wc2phm.js";
26
- import"./index-62md4dwy.js";
25
+ } from "./index-8abyrfw8.js";
27
26
  import {
28
27
  CsrArtifactBuilder
29
- } from "./index-nx64dz92.js";
28
+ } from "./index-6mprvdt8.js";
29
+ import"./index-62md4dwy.js";
30
30
 
31
31
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
32
32
  import path from "path";
@@ -116,10 +116,10 @@ class BuildBatch {
116
116
  async#buildShell() {
117
117
  const started = Date.now();
118
118
  try {
119
- await new CsrArtifactBuilder(this.#app, "start", "en", { cssAssets: this.#request.cssAssets }).build();
120
- this.#logger.verbose(`csr-shell ok (${Date.now() - started}ms)`);
119
+ await new CsrArtifactBuilder(this.#app, "start", "en", { cssAssets: this.#request.cssAssets }).buildMcpAppViews();
120
+ this.#logger.verbose(`mcp-app-views ok (${Date.now() - started}ms)`);
121
121
  } catch (err) {
122
- this.#fail("shell", "csr-shell", err);
122
+ this.#fail("shell", "mcp-app-views", err);
123
123
  }
124
124
  }
125
125
  async#rebuildCsrArtifact(started) {
@@ -3,26 +3,27 @@ import {
3
3
  App,
4
4
  Workspace,
5
5
  command
6
- } from "./index-vkb9m4z7.js";
6
+ } from "./index-g5px5pxd.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-g6ax17x4.js";
9
- import"./index-jrmzcp66.js";
8
+ import"./index-gxqvev8w.js";
9
+ import"./index-9h0z0tjr.js";
10
10
  import {
11
11
  PlatformTestRun
12
- } from "./index-rc51f9ht.js";
13
- import"./index-4v43h00g.js";
12
+ } from "./index-hagw9c94.js";
13
+ import"./index-ex35dg39.js";
14
14
  import"./index-m9jj544v.js";
15
- import"./index-35m6bzm7.js";
16
- import"./index-h3r3nr9y.js";
15
+ import"./index-551gh8h2.js";
16
+ import"./index-6mprvdt8.js";
17
+ import"./index-6nqnqzv1.js";
17
18
  import"./index-5nd1wtkv.js";
18
- import"./index-9mt4smfy.js";
19
- import"./index-h6czey01.js";
19
+ import"./index-p44jnjfr.js";
20
+ import"./index-1xqq3va9.js";
20
21
  import"./index-7md2g9vw.js";
21
22
  import"./index-tvehn2sp.js";
22
- import"./index-ebarbgba.js";
23
+ import"./index-deckcwbg.js";
23
24
  import {
24
25
  CloudScript2
25
- } from "./index-844q7f8z.js";
26
+ } from "./index-c9rfak6r.js";
26
27
  import {
27
28
  writeOption,
28
29
  oneNativeTargetOption,
@@ -33,8 +34,7 @@ import {
33
34
  hostOption,
34
35
  subspaceOption
35
36
  } from "./index-mdjc93e1.js";
36
- import"./index-xsd96yzw.js";
37
- import"./index-nx64dz92.js";
37
+ import"./index-f9118j70.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-c9rfak6r.js";
5
+ import"./index-hagw9c94.js";
6
+ import"./index-1xqq3va9.js";
7
+ import"./index-f9118j70.js";
8
+ import"./index-p44jnjfr.js";
9
+ import"./index-deckcwbg.js";
10
+ import"./index-ex35dg39.js";
11
+ import"./index-9h0z0tjr.js";
12
+ import"./index-551gh8h2.js";
13
+ import"./index-m9jj544v.js";
14
+ import"./index-g5px5pxd.js";
15
+ import"./index-7md2g9vw.js";
16
+ import"./index-6mprvdt8.js";
17
+ import"./index-5nd1wtkv.js";
18
+ import"./index-6nqnqzv1.js";
19
+ import"./index-gxqvev8w.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-vkb9m4z7.js";
7
+ } from "./index-g5px5pxd.js";
8
8
  import"./index-52w0fvh8.js";
9
- import"./index-g6ax17x4.js";
9
+ import"./index-gxqvev8w.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-gzfc5t52.js"),
22
+ import("./CodeAgent-fee0pnwp.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-gzfc5t52.js"),
38
- import("./CodeTui-bpsjs8wz.js")
37
+ import("./CodeAgent-fee0pnwp.js"),
38
+ import("./CodeTui-xh71b2k8.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-gzfc5t52.js");
70
+ const { CodeAgent } = await import("./CodeAgent-fee0pnwp.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-vkb9m4z7.js";
5
+ } from "./index-g5px5pxd.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-g6ax17x4.js";
7
+ import"./index-gxqvev8w.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-033wne2j.js";
10
- import"./index-nv79n88g.js";
11
- import"./index-zv5s8x58.js";
12
- import"./index-4v43h00g.js";
9
+ import"./index-5m0s0gdv.js";
10
+ import"./index-tbmtmkhx.js";
11
+ import"./index-cq5x7a9k.js";
12
+ import"./index-ex35dg39.js";
13
13
  import"./index-m9jj544v.js";
14
- import"./index-35m6bzm7.js";
15
- import"./index-h3r3nr9y.js";
14
+ import"./index-551gh8h2.js";
15
+ import"./index-6mprvdt8.js";
16
+ import"./index-6nqnqzv1.js";
16
17
  import"./index-zzvvc845.js";
17
- import"./index-pg1t468s.js";
18
- import"./index-27y8t17p.js";
19
- import"./index-p2r64bpa.js";
20
- import"./index-4393nb4b.js";
21
- import"./index-g9ks2k8c.js";
22
- import"./index-75n5q4ph.js";
18
+ import"./index-t8npm331.js";
19
+ import"./index-3xhak9e0.js";
20
+ import"./index-1bhv9dh4.js";
21
+ import"./index-rp9anyeb.js";
22
+ import"./index-94jq9cbz.js";
23
+ import"./index-85h3dhe0.js";
23
24
  import {
24
25
  ContextScript
25
- } from "./index-8jehkey8.js";
26
- import"./index-nx64dz92.js";
26
+ } from "./index-7xy30jev.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-cq5x7a9k.js";
5
+ import"./index-85h3dhe0.js";
6
+ import"./index-94jq9cbz.js";
7
+ import"./index-rp9anyeb.js";
8
+ import"./index-t8npm331.js";
9
+ import"./index-1bhv9dh4.js";
10
+ import"./index-3xhak9e0.js";
11
+ import"./index-ex35dg39.js";
12
+ import"./index-551gh8h2.js";
13
+ import"./index-m9jj544v.js";
14
+ import"./index-tbmtmkhx.js";
15
+ import"./index-5m0s0gdv.js";
16
+ import"./index-zzvvc845.js";
17
+ import"./index-g5px5pxd.js";
18
+ import"./index-6mprvdt8.js";
19
+ import"./index-6nqnqzv1.js";
20
+ import"./index-gxqvev8w.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-vkb9m4z7.js";
5
+ } from "./index-g5px5pxd.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-g6ax17x4.js";
7
+ import"./index-gxqvev8w.js";
8
8
  import {
9
9
  Prompter2
10
10
  } from "./index-zzvvc845.js";
@@ -90,6 +90,10 @@ not "fix" it back.
90
90
  - **Never wrap a form setter in a pass-through arrow** — `(v) => st.do.setTypeOnTicket(v)` emits no
91
91
  `data-akan-action` and publishes no agent tool. A wrapper that transforms, adds a statement, or calls `writeOnX`
92
92
  is legal; publish it with an explicit `st.tool`.
93
+ - **Never call an `st` hook conditionally** — `st.use.*`, `st.sel`, `st.ref` and the last step of `st.tool` /
94
+ `st.useState` / `st.expose` are hooks Biome's `useHookAtTopLevel` cannot see. Behind `||` / `&&` / `??`, a ternary,
95
+ an `if`, a loop or a callback, a skipped call shifts every later hook, and production React crashes elsewhere. Read
96
+ each into its own `const` at the top of the component, then combine.
93
97
  - **No deep imports past a barrel**, except cross-module constants (`../map/map.constant`).
94
98
  - **Never import across the client/server boundary** (`apps/**`, `libs/**`). Client files (`ui/`, `webkit/`,
95
99
  `page/`, `*.store.ts`, every `.tsx`) never import a `*.document|dictionary|service|signal.ts`, `srvkit/`, a
@@ -224,8 +228,8 @@ Playbook (warning table, code, checklist: `ssrRule`): ① wrap the interaction a
224
228
  `useEffect(…, [])` load; ④ a store-reading `Zone` holds no markup and delegates to a server `View`; ⑤ hand each
225
229
  promise across — `const { xInitInY, xListInY } = fetch.initXInY(id)`, `xInitInY` to a `Zone`, `xListInY` to
226
230
  `<Load.Stream>` (model instances, server-only) — and `await` only what the shell must contain; ⑥ named `ReactNode`
227
- slots (`Layout.Navbar`); ⑦ derived display logic on `Light<Model>`; ⑧ `getSelf({ unauthorize: "/signin" })` in
228
- `_layout.tsx` (an in-page redirect after I/O; `.config({ ssr: "block" })` for a 3xx); ⑨ CSS (`data-*` +
231
+ slots (`Layout.Navbar`); ⑦ derived display logic on `Light<Model>`; ⑧ `.guard(() => signedIn())` on
232
+ `_layout.tsx` (a real 3xx before anything renders; `getSelf({ unauthorize })` in a body redirects in-page after I/O); ⑨ CSS (`data-*` +
229
233
  `group-data-[…]`, `<details>`) over client state for visibility; ⑩ heavy islands behind `index_.tsx` + `lazy()`.
230
234
 
231
235
  ## Runtime & Build Configuration
@@ -402,8 +406,9 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
402
406
  - **MCP (`mcpRule`)**: `/mcp` publishes every guarded endpoint by default; `mcp: false` (or a `slice()` `mcp` map
403
407
  mirroring `guards`) is curation, not authorization. `guards: [Every, Person]` reserves an act for a person;
404
408
  `.with(AgentCall)` narrows an agent's call. Settings are `option.setMcp` in `lib/option.ts`; `JWT_SECRET` is
405
- required outside `local`. Never make a refusal message more helpful. Every entry needs a `.desc()`; publish a
406
- screen with `page().prompt(name, description)`.
409
+ required outside `local`. Never make a refusal message more helpful. Every entry needs a `.desc()`; brief a
410
+ screen with `page().prompt(name, description)`, and publish one component a host draws with
411
+ `page().app(name, description, load)` — a read-only tool whose `load` may only query.
407
412
  - **In-page agent (`agentRule`)**: mount `<Agent.Chat />` once in a layout; it never executes tools and refuses
408
413
  every call until `option.setAgentAccess(<guard>)`; the LLM is `option.setLlm({ apiKey, model, host })`, never env.
409
414
  The surface is what components declare — `st.tool(…).exec(fn)` beside its control, `st.use` / `st.sel` /
@@ -461,15 +466,15 @@ orchestration in `service`, client state in `store`; `Template` is forms, `Unit`
461
466
 
462
467
  ## Akan Page Routing (`apps/**/page/**`)
463
468
 
464
- Full contract — heads, CSR root layouts, typed params, lib pages, `devOnly`: `pageRule`.
469
+ Full contract — guards, apps, heads, CSR root layouts, typed params, lib pages, `devOnly`: `pageRule`.
465
470
 
466
471
  - `page/` holds `.tsx` route modules only: `<routeName>.tsx` or `_index.tsx`, `_layout.tsx`, `_overrides.tsx` — no
467
472
  other `_*.tsx`, helpers, `.ts` / `.js` files, or uppercase filenames. `[id]` is a dynamic segment, `(group)` a
468
473
  route group.
469
474
  - **A route file exports one chain** — `page()`, `layout()` in a `_layout.tsx`, `rootLayout()` in a root
470
- `_layout.tsx` — and every setting is a stage (`.param`, `.search`, `.config`, `.head`, `.loading`; `.notFound` /
471
- `.error` on layouts; `.fonts` / `.theme` / `.manifest` / … on the root; `.prompt` on a page). A named export
472
- beside it fails the build.
475
+ `_layout.tsx` — and every setting is a stage (`.param`, `.search`, `.config`, `.guard`, `.head`, `.loading`;
476
+ `.notFound` / `.error` on layouts; `.fonts` / `.theme` / `.manifest` / … on the root; `.prompt` / `.app` on a page).
477
+ A named export beside it fails the build.
473
478
  - **Name every `[x]` segment with `.param("x", Type)`** and read query keys only via `.search("k", Type)`; values
474
479
  arrive typed. `lang` is never declared — every stage receives it.
475
480
  - `.head()` takes JSX or a function returning it — never a metadata object; deeper heads replace by tag identity,
@@ -485,18 +490,19 @@ Full contract — heads, CSR root layouts, typed params, lib pages, `devOnly`: `
485
490
  export default page()
486
491
  .param("orgId", ID)
487
492
  .config({ transition: "stack" })
493
+ .guard(() => signedIn())
488
494
  .render(({ orgId }) => {
489
495
  const { l } = usePage();
490
- getSelf({ unauthorize: "/signin" });
491
496
  const { taskInitInOrg } = fetch.initTaskInOrg(orgId);
492
497
  return <Task.Zone.Card init={taskInitInOrg} prefix={`/org/${orgId}`} />;
493
498
  });
494
499
  ```
495
500
 
496
- - `.render()` gets the declared args flat and typed (no `PageProps`, no `loader=` prop). Order: `usePage()`, auth,
497
- fetch, return. Hand `fetch.init*` / `view*` / `edit*` fields to sections unawaited; await only what the shell reads
501
+ - `.render()` gets the declared args flat and typed (no `PageProps`, no `loader=` prop). Order: `usePage()`, fetch,
502
+ 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
498
503
  (title, redirect, link id) in one `Promise.all`.
499
- - Gate auth at `_layout.tsx` (repeating `getSelf` in the page is fine). `async` only when the body awaits; the
504
+ - Gate auth with `.guard(() => signedIn())` (`@libs/shared/webkit`) at `_layout.tsx`, and repeat it on a page that
505
+ needs more; it is a courtesy, the endpoint guards are the gate. `getSelf({ unauthorize })` in a body still works. `async` only when the body awaits; the
500
506
  callback is not a React component, so it takes no name and no return type. No `useState`, `useEffect`, or
501
507
  comments in page files.
502
508