@akanjs/cli 3.2.0-rc.9 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/.build-stamp +2 -2
  2. package/CodeAgent-fx6088tv.js +11 -0
  3. package/{CodeTui-qstk5vpj.js → CodeTui-zee8atsr.js} +822 -666
  4. package/README.ko.md +7 -0
  5. package/README.md +7 -0
  6. package/TunnelShare-9ry4vh0y.js +18 -0
  7. package/agent.command-x65f2ags.js +61 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-79azsb2w.js +11 -0
  10. package/{application.command-m4rq4wc2.js → application.command-azbd1pb2.js} +83 -37
  11. package/{applicationBuildRunner-df7rx3ra.js → applicationBuildRunner-trfxv3pd.js} +49 -18
  12. package/buildBatch.proc.js +25 -11
  13. package/{cloud.command-a0gy0qq2.js → cloud.command-gapp4634.js} +33 -29
  14. package/cloud.script-3b401efv.js +35 -0
  15. package/{code.command-5rsdqw8s.js → code.command-5smx61yf.js} +13 -9
  16. package/context.command-ym5jbkny.js +64 -0
  17. package/context.runner-kctbfsde.js +34 -0
  18. package/{dependencyScanner-78sq8m4q.js → dependencyScanner-ge10gb52.js} +2 -2
  19. package/{devTui-h77zrjv5.js → devTui-rf374y2w.js} +1 -1
  20. package/{fileSys-zpvt5gtf.js → fileSys-q22646yc.js} +1 -1
  21. package/{guideline.command-mffxknbr.js → guideline.command-zwypaqsh.js} +9 -5
  22. package/guidelines/agentRule/agentRule.instruction.md +25 -9
  23. package/guidelines/akanApi/akanApi.instruction.md +6 -4
  24. package/guidelines/conventions/core.md +23 -5
  25. package/guidelines/conventions/rules/app.md +4 -1
  26. package/guidelines/conventions/rules/page.md +5 -4
  27. package/guidelines/conventions/rules/ts.md +3 -3
  28. package/guidelines/errorCodes/errorCodes.instruction.md +165 -0
  29. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  30. package/guidelines/mcpRule/mcpRule.instruction.md +225 -5
  31. package/guidelines/pageRule/pageRule.instruction.md +10 -1
  32. package/guidelines/queryRule/queryRule.instruction.md +3 -1
  33. package/guidelines/runtimeRule/runtimeRule.instruction.md +14 -8
  34. package/guidelines/transportRule/transportRule.instruction.md +31 -1
  35. package/incrementalBuilder.proc.js +577 -411
  36. package/{index-w15mg3km.js → index-0dm25wvf.js} +1 -1
  37. package/{index-0gg15zwa.js → index-0s7w2085.js} +6 -6
  38. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  39. package/{index-swwjakt0.js → index-275a4r3n.js} +11 -11
  40. package/{index-j6gc8n14.js → index-2jmvfa62.js} +11 -9
  41. package/{index-qd7xn2bk.js → index-2ny1e95c.js} +2 -2
  42. package/{index-exn38bzx.js → index-2yn3r67f.js} +116 -54
  43. package/{index-34792nh7.js → index-3txdtztz.js} +1 -1
  44. package/{index-28x1aszt.js → index-41a03gkj.js} +149 -53
  45. package/{index-2mf1aen9.js → index-4ss4gkv3.js} +2 -2
  46. package/{index-an76bdrv.js → index-612fdtbk.js} +1 -1
  47. package/{index-5radqwn2.js → index-67sd09ag.js} +12 -12
  48. package/{index-0hbtve0a.js → index-6dzjer7p.js} +32 -28
  49. package/{index-3ghdb7p5.js → index-71y6176j.js} +2777 -3676
  50. package/{index-xyn02k0w.js → index-78y75t0a.js} +662 -433
  51. package/index-7wf8snar.js +80 -0
  52. package/{index-skmtj8rm.js → index-8jtqfye2.js} +27 -10
  53. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  54. package/{index-nmvhjn8c.js → index-9wh04mqy.js} +93 -82
  55. package/{index-xvk2a75m.js → index-a860mx0m.js} +3 -3
  56. package/{index-5zwr4n6k.js → index-baccvws5.js} +65 -8
  57. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  58. package/{index-bns3wcpc.js → index-by2tvsq6.js} +1 -1
  59. package/{index-r0a604h4.js → index-c669pbyb.js} +5 -4
  60. package/{index-x40bdsca.js → index-dadwp2aw.js} +33 -98
  61. package/{index-vm0dn0mt.js → index-dmcpetwe.js} +200 -138
  62. package/{index-43f4h4cm.js → index-ebn9kgea.js} +6 -6
  63. package/{index-hqv34wzq.js → index-gt8phqpt.js} +10 -10
  64. package/{index-yckz5t8b.js → index-h901f24n.js} +516 -434
  65. package/{index-j3v29pq7.js → index-j0wr4e32.js} +219 -175
  66. package/{index-gcx48get.js → index-j592zfqc.js} +2 -2
  67. package/{index-grxs6fts.js → index-j6jjmn2r.js} +57 -31
  68. package/{index-w8yasvpc.js → index-jek2re5k.js} +2136 -2175
  69. package/{index-ny2k80mv.js → index-jf4vk1s0.js} +9 -2
  70. package/{index-gxav1bjz.js → index-k6vwww45.js} +9 -9
  71. package/{index-99qvtff2.js → index-kfvjzk8r.js} +5 -5
  72. package/{index-j6eeh5d7.js → index-knpm8sdm.js} +5 -5
  73. package/{index-2r9ff9qm.js → index-nc3br31y.js} +2 -2
  74. package/{index-35j83zkd.js → index-p5zh7pmc.js} +2 -2
  75. package/{index-cmg5ngqa.js → index-p7beqww9.js} +2 -2
  76. package/{index-b4qq3rq0.js → index-rwgqba9p.js} +1 -1
  77. package/{index-rfzp4pqs.js → index-s885g0jj.js} +3 -3
  78. package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
  79. package/{index-k92x3vne.js → index-v7ajmsh3.js} +1 -1
  80. package/index-w1zexzpx.js +127 -0
  81. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  82. package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
  83. package/{index-rp4yf32g.js → index-xwwex8rf.js} +36 -29
  84. package/{index-ra9fvn7s.js → index-ybcb9wc8.js} +74 -38
  85. package/index-z92zm3wd.js +788 -0
  86. package/{index-j9790rhk.js → index-z96ks033.js} +1509 -1121
  87. package/index-zfnz878d.js +30 -0
  88. package/{index-2vgv7fs7.js → index-zmd9xxgd.js} +727 -693
  89. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  90. package/index.js +28 -24
  91. package/libExecutor-jc6f8hm6.js +10 -0
  92. package/{library.command-bmd7zc5m.js → library.command-nxvesvhb.js} +12 -5
  93. package/{localRegistry.command-y6en1599.js → localRegistry.command-xz62e4ng.js} +29 -24
  94. package/{module.command-7exfffqw.js → module.command-aaws9byg.js} +11 -7
  95. package/{package.command-adskw2rj.js → package.command-j7hv26p0.js} +14 -10
  96. package/package.json +8 -8
  97. package/{page.command-dw01272p.js → page.command-7yffs7n9.js} +8 -4
  98. package/{pipeline.command-0b1r3y5r.js → pipeline.command-7yk0zcng.js} +15 -9
  99. package/pkgExecutor-arxmvx4t.js +10 -0
  100. package/{primitive.command-byw6vc04.js → primitive.command-7a1pt715.js} +12 -8
  101. package/{projectTypecheck-kkrpq60a.js → projectTypecheck-f4qhbecd.js} +1 -1
  102. package/{prompter-qrwx1p17.js → prompter-qyggfhqd.js} +2 -2
  103. package/{quality.command-6rqnhzct.js → quality.command-c6mvrjh1.js} +25 -16
  104. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  105. package/{repair.command-rw5zymak.js → repair.command-093adzt9.js} +12 -8
  106. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  107. package/{scalar.command-2dyp9nh9.js → scalar.command-2ex84spb.js} +10 -6
  108. package/skills/akan-debug/SKILL.md +8 -5
  109. package/skills/akan-err/SKILL.md +7 -0
  110. package/skills/akan-mcp/SKILL.md +19 -1
  111. package/skills/akan-scaffold/SKILL.md +1 -1
  112. package/skills/akan-validate/SKILL.md +3 -3
  113. package/{subspace.command-111ynwv1.js → subspace.command-4n4n4jpv.js} +32 -24
  114. package/templates/app/page/_layout.tsx +13 -0
  115. package/templates/app/page/styles.css.template +40 -0
  116. package/templates/appSample/page/_index.tsx +9 -9
  117. package/templates/appSample/page/_layout.tsx +1 -0
  118. package/templates/appSample/page/styles.css.template +40 -5
  119. package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
  120. package/templates/biomeForm.ts +1 -1
  121. package/templates/env/_env.server.type.ts +1 -1
  122. package/templates/facetIndex/index.ts +2 -37
  123. package/templates/lib/sig.ts +0 -4
  124. package/templates/lib/useClient.ts +1 -1
  125. package/templates/workspaceRoot/.devcontainer/devcontainer.json.template +1 -1
  126. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  127. package/templates/workspaceRoot/README.ts +4 -2
  128. package/{tunnel.command-2gcpfbdj.js → tunnel.command-f7ep1qfa.js} +17 -13
  129. package/{typeChecker-s640r6c0.js → typeChecker-7jt6abrs.js} +1 -1
  130. package/typecheck.proc.js +3 -2
  131. package/{verify.command-djgs86ma.js → verify.command-zrkxnvct.js} +21 -17
  132. package/{workflow.command-n0k2mxr5.js → workflow.command-ks16jegk.js} +21 -14
  133. package/{workspace.command-fh1qwxfx.js → workspace.command-ahhfpaag.js} +60 -54
  134. package/CodeAgent-x2p3a3e0.js +0 -11
  135. package/TunnelShare-c4xsfzg5.js +0 -15
  136. package/agent.command-9et2e27p.js +0 -52
  137. package/cloud.script-xze4zh7n.js +0 -31
  138. package/context.command-rk1dwrg4.js +0 -57
  139. package/context.runner-83ky5m1b.js +0 -30
  140. /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
  141. /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
  142. /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
  143. /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
@@ -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,42 @@ import {
5
5
  runner,
6
6
  script,
7
7
  command
8
- } from "./index-exn38bzx.js";
8
+ } from "./index-2yn3r67f.js";
9
9
  import"./index-j4yvgfhr.js";
10
+ import {
11
+ Executor,
12
+ LibSource,
13
+ WorkspaceExecutor
14
+ } from "./index-71y6176j.js";
10
15
  import {
11
16
  FileSys2
12
- } from "./index-bns3wcpc.js";
17
+ } from "./index-by2tvsq6.js";
13
18
  import {
14
- LibSource,
15
- Executor,
16
- WorkspaceExecutor,
17
- AppExecutor
18
- } from "./index-3ghdb7p5.js";
19
+ AppExecutor2
20
+ } from "./index-z92zm3wd.js";
21
+ import"./index-zfnz878d.js";
22
+ import"./index-w1zexzpx.js";
19
23
  import {
20
24
  GlobalConfig
21
- } from "./index-rfzp4pqs.js";
25
+ } from "./index-s885g0jj.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-ebn9kgea.js";
28
+ import"./index-9wh04mqy.js";
29
+ import"./index-a860mx0m.js";
26
30
  import {
27
31
  SubspaceConfig
28
- } from "./index-h7hehkw6.js";
32
+ } from "./index-xczjdng6.js";
29
33
  import {
30
34
  SlicePlanner
31
- } from "./index-gcx48get.js";
35
+ } from "./index-j592zfqc.js";
36
+ import"./index-7wf8snar.js";
32
37
 
33
- // pkgs/@akanjs/devkit/subspace.ts
38
+ // pkgs/@akanjs/devkit/subspace/subspace.ts
34
39
  import { mkdir as mkdir2 } from "fs/promises";
35
40
  import path2 from "path";
36
41
  import { toError as toError2 } from "akanjs/common";
37
42
 
38
- // pkgs/@akanjs/devkit/subspaceClone.ts
43
+ // pkgs/@akanjs/devkit/subspace/subspaceClone.ts
39
44
  import { mkdir, readdir, rename, rm } from "fs/promises";
40
45
  import path from "path";
41
46
  import { toError } from "akanjs/common";
@@ -74,9 +79,9 @@ class SubspaceClone {
74
79
  if (!await FileSys2.dirExists(path.join(this.#clonePath, ".git"))) {
75
80
  await rm(this.#clonePath, { recursive: true, force: true });
76
81
  await mkdir(path.dirname(this.#clonePath), { recursive: true });
77
- await this.#workspace.spawn("git", ["clone", "--quiet", this.#declaration.repo, this.#clonePath]);
82
+ await this.#workspace.spawn("git", ["clone", "--quiet", "--", this.#declaration.repo, this.#clonePath]);
78
83
  }
79
- await this.#clone.spawn("git", ["fetch", "--quiet", "origin", branch]);
84
+ await this.#clone.spawn("git", ["fetch", "--quiet", "--", "origin", branch]);
80
85
  await this.#clone.spawn("git", ["checkout", "--quiet", "-f", "-B", branch, `origin/${branch}`]);
81
86
  await this.#clone.spawn("git", ["clean", "-qfd"]);
82
87
  }
@@ -125,7 +130,7 @@ class SubspaceClone {
125
130
  await this.#clone.spawn("git", ["add", "-A"]);
126
131
  const message = `${SubspaceClone.syncSubjectPrefix}${this.#workspace.repoName}@${sha}`;
127
132
  await this.#clone.spawn("git", ["commit", "--quiet", "-m", message]);
128
- await this.#clone.spawn("git", ["push", "--quiet", "origin", branch]);
133
+ await this.#clone.spawn("git", ["push", "--quiet", "--", "origin", branch]);
129
134
  return (await this.#clone.spawn("git", ["rev-parse", "--short", "HEAD"])).trim();
130
135
  }
131
136
  async#writeAnchorFile(branch, sha) {
@@ -330,7 +335,7 @@ class SubspaceClone {
330
335
  }
331
336
  }
332
337
 
333
- // pkgs/@akanjs/devkit/subspace.ts
338
+ // pkgs/@akanjs/devkit/subspace/subspace.ts
334
339
  class Subspace {
335
340
  static retiredConfigFile = "akan.subspace.ts";
336
341
  static #retiredConfigRefusal = `${Subspace.retiredConfigFile} is no longer read: move it under \`subspace\` in akan.config.ts and delete it`;
@@ -372,7 +377,7 @@ class Subspace {
372
377
  else
373
378
  await this.#git(["remote", "add", this.#remote, this.#declaration.repo]);
374
379
  try {
375
- await this.#git(["fetch", "--quiet", this.#remote, branch]);
380
+ await this.#git(["fetch", "--quiet", "--", this.#remote, branch]);
376
381
  return true;
377
382
  } catch {
378
383
  return false;
@@ -392,7 +397,7 @@ class Subspace {
392
397
  return { commit, incoming };
393
398
  }
394
399
  async slice() {
395
- const plans = await Promise.all(this.#declaration.apps.map(async (appName) => await new SlicePlanner(AppExecutor.from(this.#workspace, appName)).plan()));
400
+ const plans = await Promise.all(this.#declaration.apps.map(async (appName) => await new SlicePlanner(AppExecutor2.from(this.#workspace, appName)).plan()));
396
401
  const libs = [...new Set(plans.flatMap((plan) => plan.libs))].sort();
397
402
  const paths = [...this.#declaration.apps.map((app) => `apps/${app}`), ...libs.map((lib) => `libs/${lib}`)];
398
403
  return { plans, libs, paths };
@@ -585,7 +590,7 @@ class Subspace {
585
590
  }
586
591
  }
587
592
 
588
- // pkgs/@akanjs/devkit/subspaceReport.ts
593
+ // pkgs/@akanjs/devkit/subspace/subspaceReport.ts
589
594
  class SubspaceReport {
590
595
  static statuses(statuses) {
591
596
  const sections = [
@@ -819,7 +824,7 @@ class SubspaceRunner extends runner("subspace") {
819
824
  if (!asked)
820
825
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
821
826
  const { libs } = await subspace.slice();
822
- const { CloudScript } = await import("./cloud.script-xze4zh7n.js");
827
+ const { CloudScript } = await import("./cloud.script-3b401efv.js");
823
828
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
824
829
  host,
825
830
  workspaceId,
@@ -895,7 +900,10 @@ class SubspaceScript extends script("subspace", [SubspaceRunner]) {
895
900
 
896
901
  // pkgs/@akanjs/cli/subspace/subspace.command.ts
897
902
  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, {
903
+ subspace: target({
904
+ desc: "Mirror apps and libraries between this workspace and the customer repos it serves",
905
+ readOnly: ({ action }) => ["status", "status-all", "plan", "diff"].includes(String(action))
906
+ }).arg("action", String, {
899
907
  desc: "subspace action; plan reads this checkout alone, status-all and push-all take every declared subspace",
900
908
  default: "status",
901
909
  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
  }
@@ -8,7 +8,7 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { a
8
8
  /** Sugared gummy button with the same variants as akanjs's \`buttonRecipe\`; \`page/_overrides.tsx\` binds it to every akanjs/ui Button. ghost/outline/link stay surfaceless. */
9
9
  export const jellyButtonRecipe = recipe(
10
10
  tv({
11
- base: "squish inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-full font-bold focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
11
+ base: "squish inline-flex cursor-pointer items-center justify-center gap-2 whitespace-nowrap rounded-full font-bold leading-auto focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
12
12
  variants: {
13
13
  variant: {
14
14
  default: "text-foreground",
@@ -1,4 +1,4 @@
1
- import { compareExportNames } from "./facetIndex";
1
+ import { compareExportNames } from "akanjs/common";
2
2
 
3
3
  export interface JsxElement {
4
4
  tag: string;
@@ -1,5 +1,5 @@
1
1
  import type { AppInfo, LibInfo } from "akanjs";
2
- import { compareExportNames } from "../facetIndex";
2
+ import { compareExportNames } from "akanjs/common";
3
3
 
4
4
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [key: string]: string } = {}) {
5
5
  if (!scanInfo) return null;
@@ -1,5 +1,6 @@
1
1
  import type { SysExecutor } from "@akanjs/devkit/executors";
2
2
  import type { AppInfo, LibInfo } from "akanjs";
3
+ import { facetBarrelOf } from "akanjs/common";
3
4
 
4
5
  interface Dict {
5
6
  [key: string]: string;
@@ -10,47 +11,11 @@ interface Options {
10
11
  facet?: string;
11
12
  }
12
13
 
13
- const sourceFilePattern = /\.(ts|tsx)$/;
14
- const excludedFilePattern = /(^index\.tsx?$|\.d\.ts$|\.(test|spec)\.(ts|tsx)$|\.css$|\.scss$|\.sass$)/;
15
- // `ui` exports PascalCase names only; `common`/`srvkit`/`webkit` export camelCase names only. Names with
16
- // dots, underscores, or hyphens (e.g. `foo.helper`, `Globe_Dynamic`, `kebab-case`) match neither and are skipped.
17
- const pascalCasePattern = /^[A-Z][A-Za-z0-9]*$/;
18
- const camelCasePattern = /^[a-z][A-Za-z0-9]*$/;
19
- const nameCasePatternForFacet = (facet: string) => (facet === "ui" ? pascalCasePattern : camelCasePattern);
20
- //? Biome's organizeImports order, or `akan lint` reorders the barrel: A < a < B < b, a digit before a letter, and a
21
- //? run of digits compared by its length first. DevGeneratedIndexSync sorts the same way; the env template imports it.
22
- const letterRankOf = (char: string) => char.toLowerCase().charCodeAt(0) * 2 + (char === char.toLowerCase() ? 1 : 0);
23
- const digitRunAt = (name: string, idx: number) => /^\d+/.exec(name.slice(idx))?.[0] ?? "";
24
- export const compareExportNames = (a: string, b: string) => {
25
- for (let idx = 0; idx < a.length && idx < b.length; ) {
26
- const [runA, runB] = [digitRunAt(a, idx), digitRunAt(b, idx)];
27
- if (runA && runB && runA !== runB) return runA.length - runB.length || (runA < runB ? -1 : 1);
28
- if (runA && runB) idx += runA.length;
29
- else if (runA || runB) return runA ? -1 : 1;
30
- else if (a.charAt(idx) !== b.charAt(idx)) return letterRankOf(a.charAt(idx)) - letterRankOf(b.charAt(idx));
31
- else idx++;
32
- }
33
- return a.length - b.length;
34
- };
35
-
36
14
  export default async function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}, options: Options = {}) {
37
15
  const { exec, facet } = options;
38
16
  if (!exec || !facet || !(await exec.exists(facet))) return null;
39
17
 
40
- const nameCasePattern = nameCasePatternForFacet(facet);
41
18
  const { files, dirs } = await exec.getFilesAndDirs(facet);
42
- const exportNames = [
43
- ...files
44
- .filter((filename) => sourceFilePattern.test(filename) && !excludedFilePattern.test(filename))
45
- .map((filename) => filename.replace(sourceFilePattern, "")),
46
- ...dirs.filter((dirname) => !dirname.startsWith(".")),
47
- ]
48
- .filter((name) => nameCasePattern.test(name))
49
- .sort(compareExportNames);
50
-
51
- //? Not null: a null result writes nothing, so a barrel still exporting a deleted file would outlive the file.
52
- const content = exportNames.length
53
- ? `${exportNames.map((name) => `export * from "./${name}";`).join("\n")}\n`
54
- : "export {};\n";
19
+ const content = facetBarrelOf(facet, files, dirs);
55
20
  return { filename: "index.ts", content };
56
21
  }
@@ -19,7 +19,6 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
19
19
  return `
20
20
  import { FetchClient, type FetchClientType } from "akanjs/fetch";
21
21
  import { SignalRegistry, serverSignal${libs.length === 0 ? ", fetch as base" : ""} } from "akanjs/signal";
22
- import { Err } from "./dict";
23
22
  ${libs.map((lib) => `import { fetch as ${lib} } from "@libs/${lib}/lib/sig";`).join("\n")}
24
23
 
25
24
  ${databaseModules.map((module) => `import * as ${module}Sig from "./${module}/${module}.signal";`).join("\n")}
@@ -37,9 +36,6 @@ ${serviceModules.map((module) => `export const ${module} = SignalRegistry.regist
37
36
  export const fetchSignals = [${signalNames.join(", ")}] as const;
38
37
  export type Fetch = FetchClientType<typeof fetchSignals>;
39
38
  export const fetch = FetchClient.from(...fetchSignals) as unknown as Fetch;
40
- // A failure restored from another process is this scope's own Err, so a server hop that rethrows one keeps its
41
- // dictionary key and data instead of answering the original caller with Internal Server Error.
42
- fetch.setErrorConstructor(Err);
43
39
 
44
40
  export const getSerializedSignal = () => fetch.ownSerializedSignal
45
41
  `;
@@ -18,7 +18,7 @@ ${
18
18
  const dictionary = {};`
19
19
  }
20
20
  const pageProto = makePageProto<typeof dict>(dictionary);
21
- const fetchProto = FetchClient.build<typeof signal>(cnst, getSerializedSignal(), { Err: pageProto.Err });
21
+ const fetchProto = FetchClient.build<typeof signal>(cnst, getSerializedSignal());
22
22
  export const runtime = registerClientRuntime({ ...pageProto, ...fetchProto }, { scope: ${JSON.stringify(scanInfo?.type ?? "lib")} });
23
23
 
24
24
  export const { msg, Err, usePage, sig, fetch } = runtime;
@@ -10,7 +10,7 @@
10
10
  "remoteEnv": {
11
11
  "PATH": "/home/vscode/.bun/bin:${containerEnv:PATH}"
12
12
  },
13
- "onCreateCommand": "export PATH=\"/home/vscode/.bun/bin:$PATH\" && bun add -g @akanjs/cli@latest",
13
+ "onCreateCommand": "export PATH=\"/home/vscode/.bun/bin:$PATH\" && v=\"$(bun -e \"const p=require('./package.json'),v=p.dependencies?.akanjs??p.devDependencies?.akanjs;if(!v){console.error('package.json lists no akanjs in dependencies or devDependencies');process.exit(1)}console.log(v)\")\" && bun add -g \"@akanjs/cli@$v\"",
14
14
  "postCreateCommand": "bun install",
15
15
  "forwardPorts": [8282, 8283, 8284, 8285, 8286, 8287, 8288, 8289, 8290],
16
16
  "portsAttributes": {
@@ -7,7 +7,8 @@ the framework generate the repeated surfaces.
7
7
 
8
8
  If you hit an Akan.js bug, or a fix that one framework change would solve more easily than app-level workarounds,
9
9
  draft a GitHub issue for <https://github.com/akan-team/akanjs/issues> (version, repro, expected vs actual) and ask
10
- the user before filing it. Keep any interim workaround small and marked `// TODO: <issue url>`.
10
+ the user before filing it, since an issue is public. Meanwhile finish the task with a small interim workaround marked
11
+ `// TODO: <issue url>`.
11
12
 
12
13
  ## Generated Context
13
14
 
@@ -21,13 +21,15 @@ and deployment artifacts with strict conventions.
21
21
 
22
22
  ## Quick Start
23
23
 
24
- Install dependencies:
24
+ Install dependencies, and the \`akan\` CLI at the version of \`akanjs\` this workspace depends on:
25
25
 
26
26
  \`\`\`bash
27
27
  bun install
28
- bun install -g @akanjs/cli
28
+ v="$(bun -e "const p=require('./package.json'),v=p.dependencies?.akanjs??p.devDependencies?.akanjs;if(!v){console.error('package.json lists no akanjs in dependencies or devDependencies');process.exit(1)}console.log(v)")" && bun install -g "@akanjs/cli@$v"
29
29
  \`\`\`
30
30
 
31
+ A CLI of another major or minor version refuses to write to the workspace; run \`akan update\` to move both.
32
+
31
33
  Start the app:
32
34
 
33
35
  \`\`\`bash