@akanjs/cli 3.2.0-rc.9 → 3.2.1-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 (145) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-xdw73nbz.js +11 -0
  3. package/{CodeTui-qstk5vpj.js → CodeTui-0gewm71c.js} +822 -666
  4. package/README.ko.md +7 -0
  5. package/README.md +7 -0
  6. package/TunnelShare-cccfdgbm.js +16 -0
  7. package/agent.command-g1mj34wz.js +59 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-rrx10jya.js +11 -0
  10. package/{application.command-m4rq4wc2.js → application.command-3w4v7t40.js} +84 -40
  11. package/{applicationBuildRunner-df7rx3ra.js → applicationBuildRunner-y5xbetyz.js} +51 -20
  12. package/buildBatch.proc.js +31 -16
  13. package/{cloud.command-a0gy0qq2.js → cloud.command-ph0rz6sw.js} +28 -29
  14. package/cloud.script-8bs9tp4j.js +30 -0
  15. package/{code.command-5rsdqw8s.js → code.command-9b967qpg.js} +13 -9
  16. package/context.command-ndzs5rbf.js +62 -0
  17. package/context.runner-bmstpng2.js +32 -0
  18. package/csrArtifactBuilder-gtvff6k7.js +10 -0
  19. package/{index-qd7xn2bk.js → dependencyScanner-93g8tk0r.js} +7 -6
  20. package/{devTui-h77zrjv5.js → devTui-rf374y2w.js} +1 -1
  21. package/{fileSys-zpvt5gtf.js → fileSys-e5mwt73x.js} +1 -1
  22. package/frameworkGraph-aneq2nwy.js +8 -0
  23. package/{guideline.command-mffxknbr.js → guideline.command-y8qz9kxy.js} +9 -5
  24. package/guidelines/agentRule/agentRule.instruction.md +25 -9
  25. package/guidelines/akanApi/akanApi.instruction.md +6 -4
  26. package/guidelines/conventions/core.md +23 -5
  27. package/guidelines/conventions/rules/app.md +4 -1
  28. package/guidelines/conventions/rules/page.md +5 -4
  29. package/guidelines/conventions/rules/ts.md +3 -3
  30. package/guidelines/errorCodes/errorCodes.instruction.md +165 -0
  31. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  32. package/guidelines/mcpRule/mcpRule.instruction.md +225 -5
  33. package/guidelines/pageRule/pageRule.instruction.md +10 -1
  34. package/guidelines/queryRule/queryRule.instruction.md +3 -1
  35. package/guidelines/runtimeRule/runtimeRule.instruction.md +14 -8
  36. package/guidelines/transportRule/transportRule.instruction.md +31 -1
  37. package/incrementalBuilder.proc.js +609 -437
  38. package/{index-skmtj8rm.js → index-02v45hh9.js} +27 -10
  39. package/{index-j6gc8n14.js → index-0csk6jqm.js} +11 -9
  40. package/{index-2r9ff9qm.js → index-0wa5z6rm.js} +2 -2
  41. package/{index-nmvhjn8c.js → index-0z8sbdme.js} +93 -82
  42. package/{index-2vgv7fs7.js → index-1c2807kg.js} +727 -693
  43. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  44. package/{index-2mf1aen9.js → index-1p9bxjmt.js} +2 -2
  45. package/{index-an76bdrv.js → index-2kh4xj3m.js} +1 -1
  46. package/{index-99qvtff2.js → index-2vn0m9z5.js} +5 -5
  47. package/{index-rp4yf32g.js → index-3569fr49.js} +36 -29
  48. package/{index-xvk2a75m.js → index-38x8ynrx.js} +25 -25
  49. package/{index-cmg5ngqa.js → index-3fmzz9sf.js} +20 -20
  50. package/{index-rfzp4pqs.js → index-45aprybg.js} +3 -3
  51. package/{index-k92x3vne.js → index-4a1n0nym.js} +1 -1
  52. package/{index-ra9fvn7s.js → index-4zgm54wf.js} +76 -40
  53. package/{index-exn38bzx.js → index-652f3bs8.js} +116 -54
  54. package/{index-grxs6fts.js → index-6gepp8yn.js} +57 -31
  55. package/{index-vm0dn0mt.js → index-6j351de4.js} +294 -157
  56. package/{index-w15mg3km.js → index-7ssr7wq4.js} +1 -1
  57. package/{index-gxav1bjz.js → index-82cmbpxc.js} +9 -9
  58. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  59. package/{index-gcx48get.js → index-9rymt8d6.js} +2 -2
  60. package/{index-swwjakt0.js → index-ankyx6dj.js} +14 -18
  61. package/{index-28x1aszt.js → index-b0t92k71.js} +154 -58
  62. package/index-b372rck5.js +799 -0
  63. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  64. package/{index-r0a604h4.js → index-c669pbyb.js} +5 -4
  65. package/{index-xyn02k0w.js → index-cm9rb480.js} +662 -433
  66. package/{index-j9790rhk.js → index-d0n78fzc.js} +1635 -1139
  67. package/{index-hqv34wzq.js → index-dr1carpr.js} +10 -10
  68. package/index-f2arv0mv.js +30 -0
  69. package/{index-5radqwn2.js → index-gtydr9qc.js} +12 -12
  70. package/{index-j6eeh5d7.js → index-j3fqs8rc.js} +5 -5
  71. package/{index-yckz5t8b.js → index-jdw9m5c4.js} +516 -434
  72. package/{index-ny2k80mv.js → index-jf4vk1s0.js} +9 -2
  73. package/{index-x40bdsca.js → index-jg5rwrf7.js} +77 -115
  74. package/{index-5zwr4n6k.js → index-ktxdfqg5.js} +65 -8
  75. package/index-mnhrqjjq.js +127 -0
  76. package/{index-3ghdb7p5.js → index-pc42gxa5.js} +2777 -3676
  77. package/{index-0hbtve0a.js → index-q8h4eg5y.js} +32 -28
  78. package/{index-j3v29pq7.js → index-qh81drde.js} +219 -175
  79. package/{index-b4qq3rq0.js → index-rwgqba9p.js} +1 -1
  80. package/{index-w8yasvpc.js → index-scfsqen7.js} +2136 -2175
  81. package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
  82. package/{index-0gg15zwa.js → index-twjgmryg.js} +6 -6
  83. package/index-whvhsb5f.js +80 -0
  84. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  85. package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
  86. package/{index-35j83zkd.js → index-xv3pvdw4.js} +2 -2
  87. package/{index-34792nh7.js → index-y2g0s9tn.js} +1 -1
  88. package/{index-43f4h4cm.js → index-ymgsvhc5.js} +7 -8
  89. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  90. package/{index-bns3wcpc.js → index-zyjztrvc.js} +2 -2
  91. package/index.js +30 -24
  92. package/libExecutor-nstr00s7.js +10 -0
  93. package/{library.command-bmd7zc5m.js → library.command-b02aw1hm.js} +12 -5
  94. package/{localRegistry.command-y6en1599.js → localRegistry.command-3hg1p4aj.js} +24 -24
  95. package/{module.command-7exfffqw.js → module.command-bd9gz6cv.js} +11 -7
  96. package/{package.command-adskw2rj.js → package.command-xmr0mxze.js} +11 -10
  97. package/package.json +8 -8
  98. package/{page.command-dw01272p.js → page.command-x94qf58g.js} +8 -4
  99. package/{pipeline.command-0b1r3y5r.js → pipeline.command-n2843k6t.js} +15 -9
  100. package/pkgExecutor-cka27e3c.js +10 -0
  101. package/{primitive.command-byw6vc04.js → primitive.command-cs7v376h.js} +12 -8
  102. package/{projectTypecheck-kkrpq60a.js → projectTypecheck-za2n3nbr.js} +1 -1
  103. package/{prompter-qrwx1p17.js → prompter-d33wmdpa.js} +2 -2
  104. package/{quality.command-6rqnhzct.js → quality.command-nqngh1jd.js} +25 -16
  105. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  106. package/{repair.command-rw5zymak.js → repair.command-v2medwsm.js} +12 -8
  107. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  108. package/{scalar.command-2dyp9nh9.js → scalar.command-61cjmxn1.js} +10 -6
  109. package/skills/akan-debug/SKILL.md +8 -5
  110. package/skills/akan-err/SKILL.md +7 -0
  111. package/skills/akan-mcp/SKILL.md +19 -1
  112. package/skills/akan-scaffold/SKILL.md +1 -1
  113. package/skills/akan-validate/SKILL.md +3 -3
  114. package/{subspace.command-111ynwv1.js → subspace.command-dtv8nfh7.js} +30 -24
  115. package/templates/app/page/_layout.tsx +13 -0
  116. package/templates/app/page/styles.css.template +40 -0
  117. package/templates/appSample/page/_index.tsx +9 -9
  118. package/templates/appSample/page/_layout.tsx +1 -0
  119. package/templates/appSample/page/styles.css.template +40 -5
  120. package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
  121. package/templates/biomeForm.ts +1 -1
  122. package/templates/env/_env.server.type.ts +1 -1
  123. package/templates/facetIndex/index.ts +2 -37
  124. package/templates/lib/sig.ts +0 -4
  125. package/templates/lib/useClient.ts +1 -1
  126. package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
  127. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  128. package/templates/workspaceRoot/README.ts +4 -2
  129. package/{tunnel.command-2gcpfbdj.js → tunnel.command-fmwm5fgb.js} +15 -13
  130. package/{typeChecker-s640r6c0.js → typeChecker-7jt6abrs.js} +1 -1
  131. package/typecheck.proc.js +3 -2
  132. package/{verify.command-djgs86ma.js → verify.command-4f260t53.js} +19 -17
  133. package/{workflow.command-n0k2mxr5.js → workflow.command-tm5q9xsm.js} +21 -14
  134. package/{workspace.command-fh1qwxfx.js → workspace.command-75gc280j.js} +56 -54
  135. package/CodeAgent-x2p3a3e0.js +0 -11
  136. package/TunnelShare-c4xsfzg5.js +0 -15
  137. package/agent.command-9et2e27p.js +0 -52
  138. package/cloud.script-xze4zh7n.js +0 -31
  139. package/context.command-rk1dwrg4.js +0 -57
  140. package/context.runner-83ky5m1b.js +0 -30
  141. package/dependencyScanner-78sq8m4q.js +0 -8
  142. /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
  143. /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
  144. /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
  145. /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
@@ -2,19 +2,23 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-exn38bzx.js";
5
+ } from "./index-652f3bs8.js";
6
6
  import"./index-j4yvgfhr.js";
7
- import"./index-bns3wcpc.js";
8
- import"./index-3ghdb7p5.js";
7
+ import"./index-pc42gxa5.js";
8
+ import"./index-zyjztrvc.js";
9
+ import"./index-b372rck5.js";
10
+ import"./index-f2arv0mv.js";
11
+ import"./index-mnhrqjjq.js";
9
12
  import {
10
13
  renderPrimitiveReport
11
- } from "./index-2vgv7fs7.js";
12
- import"./index-9p260r4e.js";
13
- import"./index-34792nh7.js";
14
- import"./index-hqv34wzq.js";
14
+ } from "./index-1c2807kg.js";
15
+ import"./index-trffs83s.js";
16
+ import"./index-y2g0s9tn.js";
17
+ import"./index-dr1carpr.js";
15
18
  import {
16
19
  PrimitiveScript
17
- } from "./index-0hbtve0a.js";
20
+ } from "./index-q8h4eg5y.js";
21
+ import"./index-whvhsb5f.js";
18
22
 
19
23
  // pkgs/@akanjs/cli/primitive/primitive.command.ts
20
24
  import { Logger } from "akanjs/common";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ProjectTypecheck2
4
- } from "./index-3ghdb7p5.js";
4
+ } from "./index-pc42gxa5.js";
5
5
  import"./index-j4yvgfhr.js";
6
6
  export {
7
7
  ProjectTypecheck2 as ProjectTypecheck
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  Prompter2
4
- } from "./index-j6eeh5d7.js";
5
- import"./index-bns3wcpc.js";
4
+ } from "./index-j3fqs8rc.js";
5
+ import"./index-zyjztrvc.js";
6
6
  export {
7
7
  Prompter2 as Prompter
8
8
  };
@@ -3,29 +3,35 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-exn38bzx.js";
6
+ } from "./index-652f3bs8.js";
7
7
  import"./index-j4yvgfhr.js";
8
- import"./index-bns3wcpc.js";
8
+ import"./index-pc42gxa5.js";
9
+ import"./index-zyjztrvc.js";
9
10
  import {
10
- AppExecutor,
11
- LibExecutor,
12
- PkgExecutor
13
- } from "./index-3ghdb7p5.js";
11
+ AppExecutor2
12
+ } from "./index-b372rck5.js";
13
+ import {
14
+ LibExecutor2
15
+ } from "./index-f2arv0mv.js";
16
+ import {
17
+ PkgExecutor2
18
+ } from "./index-mnhrqjjq.js";
14
19
  import {
15
20
  MaintainabilityBaseline
16
- } from "./index-5zwr4n6k.js";
21
+ } from "./index-ktxdfqg5.js";
17
22
  import {
18
23
  WorkspaceRunner,
19
24
  AkanQualityScanner,
20
25
  formatQualityScanResult,
21
26
  formatSsrScanResult
22
- } from "./index-xyn02k0w.js";
23
- import"./index-9p260r4e.js";
27
+ } from "./index-cm9rb480.js";
28
+ import"./index-trffs83s.js";
29
+ import"./index-1p81ecbz.js";
24
30
  import"./index-62md4dwy.js";
25
- import"./index-ygdbn9jn.js";
26
- import"./index-hj6w4ka1.js";
27
- import"./index-ny2k80mv.js";
31
+ import"./index-zyb0ebm4.js";
32
+ import"./index-jf4vk1s0.js";
28
33
  import"./index-t4d0ckde.js";
34
+ import"./index-whvhsb5f.js";
29
35
 
30
36
  // pkgs/@akanjs/cli/quality/quality.script.ts
31
37
  import { Logger } from "akanjs/common";
@@ -46,9 +52,9 @@ class QualityScript extends script("quality", [WorkspaceRunner]) {
46
52
  async baseline(workspace, { force = false } = {}) {
47
53
  const [appNames, libNames, pkgNames] = await workspace.getExecs();
48
54
  const execs = [
49
- ...appNames.map((appName) => AppExecutor.from(workspace, appName)),
50
- ...libNames.map((libName) => LibExecutor.from(workspace, libName)),
51
- ...pkgNames.map((pkgName) => PkgExecutor.from(workspace, pkgName))
55
+ ...appNames.map((appName) => AppExecutor2.from(workspace, appName)),
56
+ ...libNames.map((libName) => LibExecutor2.from(workspace, libName)),
57
+ ...pkgNames.map((pkgName) => PkgExecutor2.from(workspace, pkgName))
52
58
  ];
53
59
  const { fileName } = MaintainabilityBaseline;
54
60
  for (const exec of execs) {
@@ -67,7 +73,10 @@ class QualityScript extends script("quality", [WorkspaceRunner]) {
67
73
 
68
74
  // pkgs/@akanjs/cli/quality/quality.command.ts
69
75
  class QualityCommand extends command("quality", [QualityScript], ({ public: target }) => ({
70
- quality: target({ desc: "Scan apps and libs for Akan code quality warnings" }).arg("action", String, { desc: "quality action", default: "scan", enum: ["scan", "ssr", "baseline"] }).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).option("force", Boolean, { flag: "F", desc: "baseline: rewrite an existing akan.baseline.json", default: false }).with(Workspace).exec(async function(action, format, force, workspace) {
76
+ quality: target({
77
+ desc: "Scan apps and libs for Akan code quality warnings",
78
+ readOnly: ({ action }) => action !== "baseline"
79
+ }).arg("action", String, { desc: "quality action", default: "scan", enum: ["scan", "ssr", "baseline"] }).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).option("force", Boolean, { flag: "F", desc: "baseline: rewrite an existing akan.baseline.json", default: false }).with(Workspace).exec(async function(action, format, force, workspace) {
71
80
  if (action === "scan")
72
81
  await this.qualityScript.scan(workspace, format);
73
82
  else if (action === "ssr")
@@ -3,7 +3,7 @@ import {
3
3
  collectRecipeSources2,
4
4
  scanRecipes2,
5
5
  findInlineRecipeDuplicates2
6
- } from "./index-hj6w4ka1.js";
6
+ } from "./index-1p81ecbz.js";
7
7
  export {
8
8
  collectRecipeSources2 as collectRecipeSources,
9
9
  findInlineRecipeDuplicates2 as findInlineRecipeDuplicates,
@@ -3,17 +3,21 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-exn38bzx.js";
6
+ } from "./index-652f3bs8.js";
7
7
  import"./index-j4yvgfhr.js";
8
- import"./index-bns3wcpc.js";
9
- import"./index-3ghdb7p5.js";
10
- import"./index-yckz5t8b.js";
11
- import"./index-hj6w4ka1.js";
12
- import"./index-2vgv7fs7.js";
13
- import"./index-9p260r4e.js";
8
+ import"./index-pc42gxa5.js";
9
+ import"./index-zyjztrvc.js";
10
+ import"./index-b372rck5.js";
11
+ import"./index-f2arv0mv.js";
12
+ import"./index-mnhrqjjq.js";
13
+ import"./index-1c2807kg.js";
14
+ import"./index-trffs83s.js";
15
+ import"./index-jdw9m5c4.js";
16
+ import"./index-1p81ecbz.js";
14
17
  import {
15
18
  RepairRunner
16
- } from "./index-99qvtff2.js";
19
+ } from "./index-2vn0m9z5.js";
20
+ import"./index-whvhsb5f.js";
17
21
 
18
22
  // pkgs/@akanjs/cli/repair/repair.script.ts
19
23
  import { Logger } from "akanjs/common";
@@ -1,6 +1,6 @@
1
1
  // @bun
2
- // pkgs/@akanjs/devkit/routeSourceValidator.ts
3
- import { getRouteExports } from "akanjs/common";
2
+ // pkgs/@akanjs/devkit/app/routeSourceValidator.ts
3
+ import { GENERATED_ROOT_LAYOUT_EXPORTS, getRouteExports } from "akanjs/common";
4
4
  import ts from "typescript";
5
5
  var chainRoots = new Set(["page", "layout", "rootLayout"]);
6
6
 
@@ -10,6 +10,8 @@ class RouteSourceValidator {
10
10
  const allowed = getRouteExports(kind, { rootLayout: options.rootLayout });
11
11
  const exported = new Set;
12
12
  const assertExport = (name) => {
13
+ if (options.rootLayout && GENERATED_ROOT_LAYOUT_EXPORTS.has(name))
14
+ throw new Error(`[route-convention] unsupported export "${name}" in ${filePath}: ${name} belongs to the root layout Akan.js generates, which never reads one from an app's layout`);
13
15
  if (!allowed.has(name)) {
14
16
  throw new Error(`[route-convention] unsupported export "${name}" in ${filePath}`);
15
17
  }
@@ -2,17 +2,21 @@
2
2
  import {
3
3
  Sys,
4
4
  command
5
- } from "./index-exn38bzx.js";
5
+ } from "./index-652f3bs8.js";
6
6
  import"./index-j4yvgfhr.js";
7
- import"./index-bns3wcpc.js";
8
- import"./index-3ghdb7p5.js";
7
+ import"./index-pc42gxa5.js";
8
+ import"./index-zyjztrvc.js";
9
+ import"./index-b372rck5.js";
10
+ import"./index-f2arv0mv.js";
11
+ import"./index-mnhrqjjq.js";
9
12
  import {
10
13
  renderPrimitiveReport
11
- } from "./index-2vgv7fs7.js";
12
- import"./index-9p260r4e.js";
14
+ } from "./index-1c2807kg.js";
15
+ import"./index-trffs83s.js";
13
16
  import {
14
17
  ScalarScript
15
- } from "./index-2mf1aen9.js";
18
+ } from "./index-1p9bxjmt.js";
19
+ import"./index-whvhsb5f.js";
16
20
 
17
21
  // pkgs/@akanjs/cli/scalar/scalar.command.ts
18
22
  import { Logger, lowerlize } from "akanjs/common";
@@ -16,11 +16,14 @@ the server errors logged meanwhile, console errors and warnings, and layout smel
16
16
  running one.
17
17
  - Paths are comma-separated (`akan preview <app> /board,/board/new`) and get the default locale when they lack
18
18
  one, unless the app sets `localePrefix: "as-needed"` and `--csr` is off. What the server answers outside a
19
- locale opens as written: a `/_akan` route such as Studio (`/_akan/studio?view=runtime`), a route under the
20
- API prefix, `/__csr`, `/__rsc`, `/.well-known`, `/openapi.json`, the default `/mcp`, `/favicon.ico`,
21
- `/robots.txt`, `/sitemap.xml`, `manifest.webmanifest` and a file in the app's `public/`. A full URL
22
- (`http://localhost:<port>/oauth/token`) opens exactly as written: use it for an endpoint mounted outside the
23
- API prefix or a custom MCP path. A page `--changed` finds always gets the locale.
19
+ locale opens as written, with no locale and no CSR boot query: a `/_akan` route such as Studio
20
+ (`/_akan/studio?view=runtime`), a route under the API prefix, `/__csr`, `/__rsc`, `/.well-known`,
21
+ `/openapi.json`, `/mcp`, `/favicon.ico`, `/robots.txt`, `/sitemap.xml`, `manifest.webmanifest` and a file in
22
+ the app's `public/`; `--csr` prints a note naming them. `/mcp` answers only `POST`, so preview cannot check it
23
+ (it fails with 405); the `akan-mcp` exposure test does. A full URL (`http://localhost:<port>/oauth/token`)
24
+ opens its path and query the same way, always on the app's dev server, with a note when it names another
25
+ server: use it for an endpoint mounted outside the API prefix. A page `--changed` finds opens as a page even at
26
+ a server route's path, under the same locale rule, and `/en` and `/en/` open once.
24
27
  `--changed` adds the pages your uncommitted page and layout edits reach. A dynamic route needs a concrete
25
28
  path (`/memo/1`); `akan context --app <app>` lists every route with its params and search names.
26
29
  - The viewport is a 390x844 phone; `--desktop` is 1280x800. `--csr` loads each page in the CSR boot the native
@@ -15,6 +15,8 @@ This is the common failure. Import `Err` from the source matching the **runtime
15
15
  - server code: `import { Err } from "../dict"`
16
16
  - UI: `from "@libs/<lib>/client"` or `from "@apps/<app>/client"`
17
17
 
18
+ Never `from "akanjs/common"` (`no-import-common-err.grit`): that `Err` takes any string, so a mistyped key compiles.
19
+
18
20
  ## Where the rule does not apply
19
21
 
20
22
  The lint rule exempts tests, `*.constant.ts`, `common/**`, and `env/**`. The last two have **no legal `Err`
@@ -38,3 +40,8 @@ discards what the endpoint chose to say, and a bare `Error` is generalized to "I
38
40
  way out.
39
41
 
40
42
  Korean `.error()` messages end in `다.`.
43
+
44
+ **The framework's own failures carry a code.** A `NoDocumentError`, an `Exception` status class or another
45
+ `AkanError` names its kind in `code`; branch on that with `AkanError.is(error, "<code>")`, never on its message.
46
+
47
+ Every code, its status and whether the caller's JSON carries it: `get_guideline` with `errorCodes`.
@@ -13,7 +13,7 @@ an endpoint with a real guard is published, one with none is refused, and so is
13
13
 
14
14
  - `mcp: false` on an endpoint, or a `slice()` `mcp` map mirroring `guards`, keeps a perfectly guarded step (a UI
15
15
  state-machine step a model would only call by mistake) off the shelf. It is an opt-out; everything else still
16
- publishes.
16
+ publishes. `mcp: "agent"` keeps an entry off `/mcp` but listed to `AgentToolsRole` and `agentService.loop`.
17
17
  - `guards: [Every, Person]` reserves an act for a person; `.with(AgentCall)` narrows what an agent's call may do.
18
18
  - A guard's `static scope` decides whether a listing can hide the entry: `"account"` guards are evaluated per
19
19
  caller, `"resource"` guards stay visible and stop the call.
@@ -32,6 +32,24 @@ an endpoint with a real guard is published, one with none is refused, and so is
32
32
  - `page().app(name, description, load)` publishes one component a host draws in the chat, as a read-only tool
33
33
  whose `load` may only query.
34
34
 
35
+ ## Calling it from the server
36
+
37
+ - `plug(AgentToolsRole)` gives a service `listAs(account, { allow })` / `callAs(account, call)`: the same catalogue
38
+ and refusals in-process plus the `mcp: "agent"` entries, batch servers included. Pass only an account the server resolved, never client input.
39
+ - `this.agentService.loop({ account | principal, allow, messages, approve, untrusted, onMessage, meta, budget })`
40
+ runs a model over those tools until it answers; `option.setAgentAccountResolver` resolves a stored `principal`
41
+ before every round. Each round is metered as its own turn with `turn.loop` and `turn.meta`. With no `untrusted`,
42
+ everything a tool returns counts as untrusted: a run with no `approve` then writes only before its first result,
43
+ so pass `approve`, or `untrusted` to name the results that carry another party's text. `toolkits` holds named
44
+ groups of `allow` back until the model calls `openToolkit`; `clientTools` (from `AgentClientTools` on an open page)
45
+ parks a call as `awaiting { client: true }` for the page to run; `ask: true` lists `askUser`, which parks as
46
+ `awaiting { question: true }`. Resume either with `answer: { id, result | error }`, never by appending a
47
+ client's result to `messages`, and never take `messages` from a request: store what `onMessage` hands out.
48
+ - `remotes: this.remoteService.sources(account, [{ name, url, description }])` (`libs/shared`, `remote.enabled`) lets
49
+ the loop call another server's `/mcp` as the user: each is a toolkit, tools read `<name>.<tool>`, a missing
50
+ connection parks as `awaiting { connect: name }` for `<Remote.Util.Connect>`, and every remote result taints the run.
51
+ Once connected, resume with the stored messages; when the user declines, resume with `answer: { id, error }`.
52
+
35
53
  ## Verify
36
54
 
37
55
  - One exposure test per app in `srvkit/mcpExposure.signal.test.ts`: list the tools with a user token, pin the names
@@ -16,7 +16,7 @@ Everything else is pages, sections, and props.
16
16
  - A page or section whose content you can write as static JSX or props is not an entity. "A self-intro page
17
17
  with two detail pages" is pages only — no `profile` module.
18
18
  - Never invent a supporting entity (profile, category, tag, author, like) to round out a design. If one looks
19
- genuinely necessary, say so in your reply and let the user decide.
19
+ genuinely necessary, build the request without it and say in your reply why it may be needed; the user decides.
20
20
  - "… plus a comment zone that saves to a database" is exactly one new module: `comment`.
21
21
  - Check what exists first (`list_modules`) and extend it when it already fits — `add-field` / `add-slice` /
22
22
  `create-ui` beat a whole new module.
@@ -7,9 +7,9 @@ description: "Run the akan check loop after editing and fix each failure class t
7
7
 
8
8
  ## One call does the whole chain
9
9
 
10
- `akan verify` (the `akan_verify` tool in akan code) syncs, lints with fixes, typechecks, fast-builds each
11
- changed app, and runs the SSR check for a `.tsx` change — over everything the working tree has changed, in one
12
- process. It prints one line when it passes and one line per problem when it fails. **Run it after editing,
10
+ `akan verify` (the `akan_verify` tool in akan code) syncs, lints with fixes, typechecks, builds each
11
+ changed app's server and SSR routes, and runs the SSR check for a `.tsx` change — over everything the working tree has changed, in one
12
+ process. A changed lib also typechecks every app and lib that uses it, so an error can name a file you did not edit. It prints one line when it passes and one line per problem when it fails. **Run it after editing,
13
13
  before you say you are done.** In akan code it also runs itself at the end of a turn that changed source.
14
14
 
15
15
  Never run `akan lint`, `akan typecheck` and `akan build` in turn: that is the same work three times over, at
@@ -5,37 +5,40 @@ import {
5
5
  runner,
6
6
  script,
7
7
  command
8
- } from "./index-exn38bzx.js";
8
+ } from "./index-652f3bs8.js";
9
9
  import"./index-j4yvgfhr.js";
10
+ import {
11
+ Executor,
12
+ LibSource,
13
+ WorkspaceExecutor
14
+ } from "./index-pc42gxa5.js";
10
15
  import {
11
16
  FileSys2
12
- } from "./index-bns3wcpc.js";
17
+ } from "./index-zyjztrvc.js";
13
18
  import {
14
- LibSource,
15
- Executor,
16
- WorkspaceExecutor,
17
- AppExecutor
18
- } from "./index-3ghdb7p5.js";
19
+ AppExecutor2
20
+ } from "./index-b372rck5.js";
21
+ import"./index-f2arv0mv.js";
22
+ import"./index-mnhrqjjq.js";
19
23
  import {
20
24
  GlobalConfig
21
- } from "./index-rfzp4pqs.js";
25
+ } from "./index-45aprybg.js";
22
26
  import"./index-m9jj544v.js";
23
- import"./index-43f4h4cm.js";
24
- import"./index-nmvhjn8c.js";
25
- import"./index-xvk2a75m.js";
27
+ import"./index-ymgsvhc5.js";
26
28
  import {
27
29
  SubspaceConfig
28
- } from "./index-h7hehkw6.js";
30
+ } from "./index-xczjdng6.js";
29
31
  import {
30
32
  SlicePlanner
31
- } from "./index-gcx48get.js";
33
+ } from "./index-9rymt8d6.js";
34
+ import"./index-whvhsb5f.js";
32
35
 
33
- // pkgs/@akanjs/devkit/subspace.ts
36
+ // pkgs/@akanjs/devkit/subspace/subspace.ts
34
37
  import { mkdir as mkdir2 } from "fs/promises";
35
38
  import path2 from "path";
36
39
  import { toError as toError2 } from "akanjs/common";
37
40
 
38
- // pkgs/@akanjs/devkit/subspaceClone.ts
41
+ // pkgs/@akanjs/devkit/subspace/subspaceClone.ts
39
42
  import { mkdir, readdir, rename, rm } from "fs/promises";
40
43
  import path from "path";
41
44
  import { toError } from "akanjs/common";
@@ -74,9 +77,9 @@ class SubspaceClone {
74
77
  if (!await FileSys2.dirExists(path.join(this.#clonePath, ".git"))) {
75
78
  await rm(this.#clonePath, { recursive: true, force: true });
76
79
  await mkdir(path.dirname(this.#clonePath), { recursive: true });
77
- await this.#workspace.spawn("git", ["clone", "--quiet", this.#declaration.repo, this.#clonePath]);
80
+ await this.#workspace.spawn("git", ["clone", "--quiet", "--", this.#declaration.repo, this.#clonePath]);
78
81
  }
79
- await this.#clone.spawn("git", ["fetch", "--quiet", "origin", branch]);
82
+ await this.#clone.spawn("git", ["fetch", "--quiet", "--", "origin", branch]);
80
83
  await this.#clone.spawn("git", ["checkout", "--quiet", "-f", "-B", branch, `origin/${branch}`]);
81
84
  await this.#clone.spawn("git", ["clean", "-qfd"]);
82
85
  }
@@ -125,7 +128,7 @@ class SubspaceClone {
125
128
  await this.#clone.spawn("git", ["add", "-A"]);
126
129
  const message = `${SubspaceClone.syncSubjectPrefix}${this.#workspace.repoName}@${sha}`;
127
130
  await this.#clone.spawn("git", ["commit", "--quiet", "-m", message]);
128
- await this.#clone.spawn("git", ["push", "--quiet", "origin", branch]);
131
+ await this.#clone.spawn("git", ["push", "--quiet", "--", "origin", branch]);
129
132
  return (await this.#clone.spawn("git", ["rev-parse", "--short", "HEAD"])).trim();
130
133
  }
131
134
  async#writeAnchorFile(branch, sha) {
@@ -330,7 +333,7 @@ class SubspaceClone {
330
333
  }
331
334
  }
332
335
 
333
- // pkgs/@akanjs/devkit/subspace.ts
336
+ // pkgs/@akanjs/devkit/subspace/subspace.ts
334
337
  class Subspace {
335
338
  static retiredConfigFile = "akan.subspace.ts";
336
339
  static #retiredConfigRefusal = `${Subspace.retiredConfigFile} is no longer read: move it under \`subspace\` in akan.config.ts and delete it`;
@@ -372,7 +375,7 @@ class Subspace {
372
375
  else
373
376
  await this.#git(["remote", "add", this.#remote, this.#declaration.repo]);
374
377
  try {
375
- await this.#git(["fetch", "--quiet", this.#remote, branch]);
378
+ await this.#git(["fetch", "--quiet", "--", this.#remote, branch]);
376
379
  return true;
377
380
  } catch {
378
381
  return false;
@@ -392,7 +395,7 @@ class Subspace {
392
395
  return { commit, incoming };
393
396
  }
394
397
  async slice() {
395
- const plans = await Promise.all(this.#declaration.apps.map(async (appName) => await new SlicePlanner(AppExecutor.from(this.#workspace, appName)).plan()));
398
+ const plans = await Promise.all(this.#declaration.apps.map(async (appName) => await new SlicePlanner(AppExecutor2.from(this.#workspace, appName)).plan()));
396
399
  const libs = [...new Set(plans.flatMap((plan) => plan.libs))].sort();
397
400
  const paths = [...this.#declaration.apps.map((app) => `apps/${app}`), ...libs.map((lib) => `libs/${lib}`)];
398
401
  return { plans, libs, paths };
@@ -585,7 +588,7 @@ class Subspace {
585
588
  }
586
589
  }
587
590
 
588
- // pkgs/@akanjs/devkit/subspaceReport.ts
591
+ // pkgs/@akanjs/devkit/subspace/subspaceReport.ts
589
592
  class SubspaceReport {
590
593
  static statuses(statuses) {
591
594
  const sections = [
@@ -819,7 +822,7 @@ class SubspaceRunner extends runner("subspace") {
819
822
  if (!asked)
820
823
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
821
824
  const { libs } = await subspace.slice();
822
- const { CloudScript } = await import("./cloud.script-xze4zh7n.js");
825
+ const { CloudScript } = await import("./cloud.script-8bs9tp4j.js");
823
826
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
824
827
  host,
825
828
  workspaceId,
@@ -895,7 +898,10 @@ class SubspaceScript extends script("subspace", [SubspaceRunner]) {
895
898
 
896
899
  // pkgs/@akanjs/cli/subspace/subspace.command.ts
897
900
  class SubspaceCommand extends command("subspace", [SubspaceScript], ({ public: target }) => ({
898
- subspace: target({ desc: "Mirror apps and libraries between this workspace and the customer repos it serves" }).arg("action", String, {
901
+ subspace: target({
902
+ desc: "Mirror apps and libraries between this workspace and the customer repos it serves",
903
+ readOnly: ({ action }) => ["status", "status-all", "plan", "diff"].includes(String(action))
904
+ }).arg("action", String, {
899
905
  desc: "subspace action; plan reads this checkout alone, status-all and push-all take every declared subspace",
900
906
  default: "status",
901
907
  enum: ["status", "status-all", "plan", "diff", "push", "push-all", "pull", "upload-env"]
@@ -20,6 +20,19 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dic
20
20
  ${isUsingShared ? 'import { Auth } from "@libs/shared/ui";\n' : ""}import { rootLayout } from "akanjs/client";
21
21
 
22
22
  export default rootLayout()
23
+ .fonts([
24
+ {
25
+ name: "pretendard",
26
+ default: true,
27
+ subsets: ["latin", "ks-x-1001"],
28
+ paths: [
29
+ { src: "/fonts/Pretendard-Regular.woff2", weight: 400 },
30
+ { src: "/fonts/Pretendard-Medium.woff2", weight: 500 },
31
+ { src: "/fonts/Pretendard-SemiBold.woff2", weight: 600 },
32
+ { src: "/fonts/Pretendard-Bold.woff2", weight: 700 },
33
+ ],
34
+ },
35
+ ])
23
36
  .theme("light")
24
37
  .head(<title>${dict.appName}</title>)
25
38
  .render(({ children }) => {
@@ -65,3 +65,43 @@
65
65
  --input: #e5e5e5;
66
66
  --ring: #0a0a0a;
67
67
  }
68
+
69
+ /* Typography: Pretendard, the layout's default font, at -3% tracking. Font sizes are even and at least 12px —
70
+ Tailwind's steps from text-xs (12px) to text-9xl (128px) all are, so an arbitrary text-[…] keeps the same rule.
71
+ Text that may wrap takes 150% leading, every size's default; a single line takes the font's own (leading-auto). */
72
+ @theme {
73
+ --leading-auto: normal;
74
+ --text-xs--line-height: 1.5;
75
+ --text-xs--letter-spacing: -0.03em;
76
+ --text-sm--line-height: 1.5;
77
+ --text-sm--letter-spacing: -0.03em;
78
+ --text-base--line-height: 1.5;
79
+ --text-base--letter-spacing: -0.03em;
80
+ --text-lg--line-height: 1.5;
81
+ --text-lg--letter-spacing: -0.03em;
82
+ --text-xl--line-height: 1.5;
83
+ --text-xl--letter-spacing: -0.03em;
84
+ --text-2xl--line-height: 1.5;
85
+ --text-2xl--letter-spacing: -0.03em;
86
+ --text-3xl--line-height: 1.5;
87
+ --text-3xl--letter-spacing: -0.03em;
88
+ --text-4xl--line-height: 1.5;
89
+ --text-4xl--letter-spacing: -0.03em;
90
+ --text-5xl--line-height: 1.5;
91
+ --text-5xl--letter-spacing: -0.03em;
92
+ --text-6xl--line-height: 1.5;
93
+ --text-6xl--letter-spacing: -0.03em;
94
+ --text-7xl--line-height: 1.5;
95
+ --text-7xl--letter-spacing: -0.03em;
96
+ --text-8xl--line-height: 1.5;
97
+ --text-8xl--letter-spacing: -0.03em;
98
+ --text-9xl--line-height: 1.5;
99
+ --text-9xl--letter-spacing: -0.03em;
100
+ }
101
+
102
+ /* letter-spacing inherits as a length, not a ratio: text sized without a text-* class keeps -3% of the root's 16px. */
103
+ @layer base {
104
+ html {
105
+ letter-spacing: -0.03em;
106
+ }
107
+ }
@@ -127,9 +127,9 @@ export default page().render(() => {
127
127
  src="/logo.png"
128
128
  width={80}
129
129
  />
130
- <div className="leading-tight">
131
- <p className="font-black text-lg tracking-tight">{appName}</p>
132
- <p className="text-foreground/50 text-xs">
130
+ <div>
131
+ <p className="font-black text-lg leading-auto">{appName}</p>
132
+ <p className="text-foreground/50 text-xs leading-auto">
133
133
  {l.trans({ en: "Built with Akan.js", ko: "Akan.js로 만든 앱" })}
134
134
  </p>
135
135
  </div>
@@ -164,14 +164,14 @@ export default page().render(() => {
164
164
  </div>
165
165
 
166
166
  <div className="flex flex-col items-center text-center lg:items-start lg:text-left">
167
- <p className="intro-rise jelly-glass inline-flex items-center gap-2 rounded-full px-4 py-1.5 font-bold text-foreground/75 text-sm [--intro-delay:40ms]">
167
+ <p className="intro-rise jelly-glass inline-flex items-center gap-2 rounded-full px-4 py-1.5 font-bold text-foreground/75 text-sm leading-auto [--intro-delay:40ms]">
168
168
  <span className="size-2 rounded-full bg-success ring-4 ring-success/20" />
169
169
  {l.trans({ en: "Your app is running", ko: "앱이 실행 중입니다" })}
170
170
  </p>
171
- <h1 className="intro-rise wrap-anywhere mt-6 max-w-full font-black text-[clamp(3.5rem,12vw,8.5rem)] leading-[0.85] tracking-[-0.06em] [--intro-delay:80ms]">
171
+ <h1 className="intro-rise wrap-anywhere mt-6 max-w-full font-black text-6xl leading-auto [--intro-delay:80ms] sm:text-7xl md:text-8xl xl:text-9xl">
172
172
  {appName}
173
173
  </h1>
174
- <p className="intro-rise mt-6 max-w-xl font-bold text-foreground/60 text-lg leading-8 [--intro-delay:160ms]">
174
+ <p className="intro-rise mt-6 max-w-xl font-bold text-foreground/60 text-lg [--intro-delay:160ms]">
175
175
  {l.trans({
176
176
  en: "Built on Akan.js — the TypeScript framework, agents included.",
177
177
  ko: "에이전트까지 들어 있는 TypeScript 프레임워크, Akan.js로 만들었습니다.",
@@ -192,7 +192,7 @@ export default page().render(() => {
192
192
  />
193
193
  </span>
194
194
  </span>
195
- <span className="whitespace-nowrap rounded-full bg-foreground/6 px-2.5 py-0.5 font-bold text-[11px] text-foreground/60">
195
+ <span className="whitespace-nowrap rounded-full bg-foreground/6 px-2.5 py-0.5 font-bold text-foreground/60 text-xs leading-auto">
196
196
  {friend.role}
197
197
  </span>
198
198
  </li>
@@ -230,7 +230,7 @@ export default page().render(() => {
230
230
  {chapter.numeral}
231
231
  </span>
232
232
  <h3 className="mt-5 font-bold text-lg">{chapter.title}</h3>
233
- <p className="mt-2 text-foreground/60 text-sm leading-6">{chapter.body}</p>
233
+ <p className="mt-2 text-foreground/60 text-sm">{chapter.body}</p>
234
234
  </article>
235
235
  ))}
236
236
  </div>
@@ -249,7 +249,7 @@ export default page().render(() => {
249
249
  </span>
250
250
  <div className="min-w-0 flex-1">
251
251
  <h3 className="font-bold">{step.title}</h3>
252
- <p className="mt-1 text-foreground/60 text-sm leading-6">{step.body}</p>
252
+ <p className="mt-1 text-foreground/60 text-sm">{step.body}</p>
253
253
  <code className="mt-2 inline-block rounded-full bg-foreground/6 px-3 py-1 font-mono text-foreground/75 text-xs">
254
254
  {step.code}
255
255
  </code>
@@ -24,6 +24,7 @@ export default rootLayout()
24
24
  {
25
25
  name: "pretendard",
26
26
  default: true,
27
+ subsets: ["latin", "ks-x-1001"],
27
28
  paths: [
28
29
  { src: "/fonts/Pretendard-Thin.woff2", weight: 100 },
29
30
  { src: "/fonts/Pretendard-ExtraLight.woff2", weight: 200 },
@@ -96,6 +96,46 @@
96
96
  --radius-field: 0.875rem;
97
97
  }
98
98
 
99
+ /* Typography: Pretendard, the layout's default font, at -3% tracking. Font sizes are even and at least 12px —
100
+ Tailwind's steps from text-xs (12px) to text-9xl (128px) all are, so an arbitrary text-[…] keeps the same rule.
101
+ Text that may wrap takes 150% leading, every size's default; a single line takes the font's own (leading-auto). */
102
+ @theme {
103
+ --leading-auto: normal;
104
+ --text-xs--line-height: 1.5;
105
+ --text-xs--letter-spacing: -0.03em;
106
+ --text-sm--line-height: 1.5;
107
+ --text-sm--letter-spacing: -0.03em;
108
+ --text-base--line-height: 1.5;
109
+ --text-base--letter-spacing: -0.03em;
110
+ --text-lg--line-height: 1.5;
111
+ --text-lg--letter-spacing: -0.03em;
112
+ --text-xl--line-height: 1.5;
113
+ --text-xl--letter-spacing: -0.03em;
114
+ --text-2xl--line-height: 1.5;
115
+ --text-2xl--letter-spacing: -0.03em;
116
+ --text-3xl--line-height: 1.5;
117
+ --text-3xl--letter-spacing: -0.03em;
118
+ --text-4xl--line-height: 1.5;
119
+ --text-4xl--letter-spacing: -0.03em;
120
+ --text-5xl--line-height: 1.5;
121
+ --text-5xl--letter-spacing: -0.03em;
122
+ --text-6xl--line-height: 1.5;
123
+ --text-6xl--letter-spacing: -0.03em;
124
+ --text-7xl--line-height: 1.5;
125
+ --text-7xl--letter-spacing: -0.03em;
126
+ --text-8xl--line-height: 1.5;
127
+ --text-8xl--letter-spacing: -0.03em;
128
+ --text-9xl--line-height: 1.5;
129
+ --text-9xl--letter-spacing: -0.03em;
130
+ }
131
+
132
+ /* letter-spacing inherits as a length, not a ratio: text sized without a text-* class keeps -3% of the root's 16px. */
133
+ @layer base {
134
+ html {
135
+ letter-spacing: -0.03em;
136
+ }
137
+ }
138
+
99
139
  /* A sampled damped spring: overshoots the target by 18%, wobbles twice and settles. */
100
140
  @theme {
101
141
  --ease-jelly: linear(0, 0.42 6%, 0.86 13%, 1.12 21%, 1.18 26%, 1.13 32%, 1 41%, 0.95 48%, 0.97 56%, 1.01 66%, 1.005 78%, 1);
@@ -128,11 +168,6 @@
128
168
  mix-blend-mode: overlay;
129
169
  }
130
170
 
131
- h1,
132
- h2 {
133
- letter-spacing: -0.035em;
134
- }
135
-
136
171
  ::selection {
137
172
  background-color: color-mix(in oklab, var(--jelly) 24%, transparent);
138
173
  }