@akanjs/cli 3.2.0-rc.3 → 3.2.0-rc.31

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 (144) hide show
  1. package/.build-stamp +2 -1
  2. package/CodeAgent-c17abdbf.js +11 -0
  3. package/{CodeTui-wv9yf7eq.js → CodeTui-jed1nj82.js} +822 -666
  4. package/README.ko.md +26 -1
  5. package/README.md +26 -1
  6. package/TunnelShare-mbfcaqg0.js +18 -0
  7. package/agent.command-9whnc6vb.js +56 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-020cyesq.js +11 -0
  10. package/{application.command-6515t682.js → application.command-4eqvyxkw.js} +77 -36
  11. package/{applicationBuildRunner-bqbyeg84.js → applicationBuildRunner-frtcrqfd.js} +18 -13
  12. package/buildBatch.proc.js +26 -11
  13. package/{cloud.command-32esk0v1.js → cloud.command-hbvmeezn.js} +31 -28
  14. package/cloud.script-9kmbr3d6.js +35 -0
  15. package/{code.command-xk7rwq2x.js → code.command-0ayrenk4.js} +14 -9
  16. package/{context.command-jwenkkf0.js → context.command-php852kf.js} +28 -23
  17. package/context.runner-nngmn7c0.js +34 -0
  18. package/{dependencyScanner-78sq8m4q.js → dependencyScanner-ge10gb52.js} +2 -2
  19. package/{devTui-cd03z4mx.js → devTui-rf374y2w.js} +1 -1
  20. package/{fileSys-zpvt5gtf.js → fileSys-q22646yc.js} +1 -1
  21. package/{guideline.command-w6yqpdec.js → guideline.command-w1grfwh7.js} +9 -4
  22. package/guidelines/agentRule/agentRule.instruction.md +29 -12
  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 -0
  27. package/guidelines/conventions/rules/ts.md +3 -3
  28. package/guidelines/errorCodes/errorCodes.instruction.md +164 -0
  29. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  30. package/guidelines/mcpRule/mcpRule.instruction.md +171 -2
  31. package/guidelines/pageRule/pageRule.instruction.md +15 -1
  32. package/guidelines/runtimeRule/runtimeRule.instruction.md +12 -6
  33. package/guidelines/transportRule/transportRule.instruction.md +8 -1
  34. package/incrementalBuilder.proc.js +574 -410
  35. package/{index-w15mg3km.js → index-0dm25wvf.js} +1 -1
  36. package/{index-xrmrvafh.js → index-0gaj78wn.js} +808 -694
  37. package/{index-j1hjb477.js → index-11d7nh8a.js} +1 -1
  38. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  39. package/{index-ygrdw6jw.js → index-1pjwsh2g.js} +65 -8
  40. package/{index-43acpsc7.js → index-28nk8w3j.js} +12 -12
  41. package/{index-qd7xn2bk.js → index-2ny1e95c.js} +2 -2
  42. package/{index-8gm4yag8.js → index-42jhx2ya.js} +6 -6
  43. package/{index-2rqyrvcy.js → index-4st0hq72.js} +62 -33
  44. package/{index-bak9f2br.js → index-5d57kx0s.js} +15 -11
  45. package/{index-bdmgqzb5.js → index-6469101k.js} +58 -29
  46. package/{index-7kmbqp0b.js → index-6pxmcaq8.js} +1 -1
  47. package/{index-54s6knqe.js → index-6zb17wcm.js} +12 -10
  48. package/{index-0ba8nj4d.js → index-7bs463x7.js} +50 -38
  49. package/{index-y725zb1a.js → index-7v7tvgt7.js} +196 -168
  50. package/{index-r0a604h4.js → index-99kjwyma.js} +1 -1
  51. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  52. package/{index-386canwe.js → index-9rv2zt48.js} +186 -121
  53. package/{index-20wvskt8.js → index-9wab2ngg.js} +1 -1
  54. package/{index-2eym1yjb.js → index-9wjrwjgz.js} +288 -209
  55. package/{index-kcpk2d20.js → index-at6haq2x.js} +1474 -1139
  56. package/{index-6h775rv3.js → index-ba2xd32s.js} +53 -12
  57. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  58. package/{index-ngpt3zz3.js → index-bj8s07s7.js} +525 -440
  59. package/{index-bns3wcpc.js → index-by2tvsq6.js} +1 -1
  60. package/{index-vbhx60x5.js → index-cb91b6d8.js} +2140 -2165
  61. package/index-dss3ds74.js +127 -0
  62. package/{index-e22zedc2.js → index-f16kr6vj.js} +3 -3
  63. package/{index-ny2k80mv.js → index-ffa52fwf.js} +1 -1
  64. package/{index-djc5nxpy.js → index-fp5xf6ef.js} +6 -6
  65. package/{index-qrk06tfp.js → index-g45y5f3e.js} +2 -2
  66. package/{index-8jpc5fqv.js → index-g7jgd4xs.js} +2 -2
  67. package/index-j4yvgfhr.js +70 -0
  68. package/{index-ytpmk3pb.js → index-jgj31xvw.js} +18 -11
  69. package/{index-j6eeh5d7.js → index-knpm8sdm.js} +5 -5
  70. package/{index-s34v3y28.js → index-m3t28rt3.js} +11 -11
  71. package/{index-dpgywgeq.js → index-m5gg0wzv.js} +27 -16
  72. package/index-na8r4a27.js +30 -0
  73. package/{index-h0p6n4k1.js → index-nm7nt9vm.js} +3 -3
  74. package/{index-j4hkbzj6.js → index-p06kfhdf.js} +6 -6
  75. package/{index-35j83zkd.js → index-p5zh7pmc.js} +2 -2
  76. package/{index-cmg5ngqa.js → index-p7beqww9.js} +2 -2
  77. package/{index-zhkcab5a.js → index-prgvqqxe.js} +580 -364
  78. package/{index-wfmpxke3.js → index-qssq2d41.js} +2775 -3677
  79. package/{index-sc0g6zbm.js → index-rwgqba9p.js} +24 -11
  80. package/{index-zcdmnfrf.js → index-s3m89wt2.js} +9 -9
  81. package/{index-v50xjbbe.js → index-t4d0ckde.js} +1 -1
  82. package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
  83. package/{index-ddk49ypz.js → index-v929w7j7.js} +133 -49
  84. package/index-va90m8nd.js +25 -0
  85. package/index-vjbne22r.js +80 -0
  86. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  87. package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
  88. package/{index-84c2pgak.js → index-yvzm8mby.js} +94 -82
  89. package/{index-wr9magsr.js → index-yxkjsyx8.js} +3 -3
  90. package/index-ze48c0vd.js +788 -0
  91. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  92. package/index.js +29 -24
  93. package/libExecutor-tq994592.js +10 -0
  94. package/{library.command-qs8beggh.js → library.command-x219mhcx.js} +9 -4
  95. package/{localRegistry.command-hz4ged9n.js → localRegistry.command-zvdcejhn.js} +30 -24
  96. package/{module.command-z9js77m2.js → module.command-k6cwcm7g.js} +17 -8
  97. package/{package.command-zqenq8c0.js → package.command-vw7x09f8.js} +13 -8
  98. package/package.json +2 -2
  99. package/{page.command-t0nx1jat.js → page.command-gf06paq2.js} +9 -4
  100. package/{pipeline.command-2yjeas7m.js → pipeline.command-y07dgj9b.js} +14 -8
  101. package/pkgExecutor-stde3yc3.js +10 -0
  102. package/{primitive.command-v5kypwy4.js → primitive.command-edydvh07.js} +13 -8
  103. package/{projectTypecheck-s9hhe5sa.js → projectTypecheck-mk8wefvd.js} +2 -1
  104. package/{prompter-qrwx1p17.js → prompter-qyggfhqd.js} +2 -2
  105. package/{quality.command-q55j2htd.js → quality.command-mdb45vyr.js} +23 -16
  106. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  107. package/{repair.command-7ssbbdq2.js → repair.command-kvtaeecy.js} +13 -8
  108. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  109. package/{scalar.command-p5jb7z57.js → scalar.command-sjt9p5e1.js} +11 -6
  110. package/skills/akan-debug/SKILL.md +10 -3
  111. package/skills/akan-err/SKILL.md +7 -0
  112. package/skills/akan-mcp/SKILL.md +17 -2
  113. package/skills/akan-scaffold/SKILL.md +2 -2
  114. package/skills/akan-transport/SKILL.md +2 -0
  115. package/skills/akan-validate/SKILL.md +1 -0
  116. package/{subspace.command-7wxy6ptj.js → subspace.command-mkkqync4.js} +29 -23
  117. package/templates/app/page/_layout.tsx +13 -0
  118. package/templates/app/page/styles.css.template +40 -0
  119. package/templates/appSample/page/_index.tsx +9 -9
  120. package/templates/appSample/page/_layout.tsx +1 -0
  121. package/templates/appSample/page/styles.css.template +40 -5
  122. package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
  123. package/templates/biomeForm.ts +1 -1
  124. package/templates/env/_env.server.type.ts +1 -1
  125. package/templates/facetIndex/index.ts +2 -37
  126. package/templates/lib/sig.ts +0 -4
  127. package/templates/lib/useClient.ts +1 -1
  128. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  129. package/{tunnel.command-22g11n0x.js → tunnel.command-tr5b3030.js} +17 -12
  130. package/{typeChecker-s640r6c0.js → typeChecker-bfrd1n9n.js} +1 -1
  131. package/typecheck.proc.js +6 -3
  132. package/{verify.command-m0wnndd7.js → verify.command-0p9h8tpp.js} +26 -20
  133. package/{workflow.command-jx8dqs9n.js → workflow.command-9mfcwqzj.js} +37 -19
  134. package/{workspace.command-ca9kfyt3.js → workspace.command-5hjtmcfs.js} +61 -54
  135. package/CodeAgent-e9c712an.js +0 -11
  136. package/TunnelShare-zkfkrw8w.js +0 -14
  137. package/agent.command-9erafkcb.js +0 -51
  138. package/cloud.script-arsagnq6.js +0 -30
  139. package/context.runner-mqpp67br.js +0 -29
  140. package/index-x3x31df8.js +0 -14
  141. /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
  142. /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
  143. /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
  144. /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
package/README.ko.md CHANGED
@@ -82,6 +82,29 @@ akan repair generated
82
82
  실행합니다. 에이전트는 워크플로를 거쳐 코드를 고치므로 워크스페이스 규칙을 우회하지 않고 따릅니다. `akan code`는
83
83
  같은 규칙, 워크플로, 스킬 위에서 일하는 터미널 에이전트입니다.
84
84
 
85
+ ## 종료 코드
86
+
87
+ | 종료 코드 | `code` | 뜻 |
88
+ | --- | --- | --- |
89
+ | 0 | | 끝남 |
90
+ | 1 | `failed`, 또는 에러 자체의 코드 | 명령이 실패함 |
91
+ | 2 | `usage`, `unknownTarget` | 명령줄이나 그것이 가리키는 대상을 고쳐야 함: 모르는 플래그나 명령, 선택지 밖의 값, 물어볼 터미널이 없는 인자, 워크스페이스에 없는 앱·라이브러리·패키지·모듈 |
92
+ | 2 | `refused` | 거절됨: 새 스토어 빌드가 필요한 팩(`akan pack-update --against`, `akan push-update`, `akan register-binary`), Akan Cloud 프로젝트가 거절한 릴리스 |
93
+ | 3 | `checkFailed` | 검사가 돌았고 문제를 찾음: `akan verify`, `akan typecheck`와 `akan build`의 타입 검사, `akan preview`, `akan agent install --check` |
94
+ | 130 | `interrupted` | 중단됨, Ctrl+C로 닫은 프롬프트 포함 |
95
+
96
+ 일부 명령은 한 계열의 코드를 고정합니다. `akan pack-update`, `akan push-update`, `akan register-binary`는 usage나
97
+ unknown-target 실패에 1로 끝나므로, 이 명령의 2는 늘 스토어 빌드나 거절만 뜻합니다. `akan agent`도 같은 실패에
98
+ 1로 끝납니다. Claude Code가 훅의 종료 코드 2를 차단으로 읽기 때문에, `akan agent hook`은 2로 끝나지 않습니다.
99
+ `akan doctor --strict`, `akan workflow`, `akan subspace`는 보고서가 실패나 거절을 말할 때 1로 끝납니다.
100
+
101
+ `--json`이나 `--format json`을 주면 stdout에는 JSON만 나옵니다. 실패하면 마지막 줄이
102
+ `{"ok":false,"error":"<메시지>","code":"<코드>"}`이고, 메시지는 stderr로 갑니다. NDJSON 스트림(`akan code --json`,
103
+ `akan logs --json`)도 그 줄로 끝납니다. `akan verify`처럼 자체 JSON 보고서가 실패를 말하는 명령은 이 줄을
104
+ 덧붙이지 않습니다. 고유 코드를 쓰는 명령이 둘 있습니다. `akan pipeline`은 오류가 있는 계획이면 1, 계획을 세우지
105
+ 못하면 2로 끝나고, `akan migrate`는 자체 JSON 줄로 답하며 `usage`, `invalidParam`, `notFound` 코드면 2,
106
+ `verifyFailed`면 3으로 끝납니다.
107
+
85
108
  ## Akan Cloud
86
109
 
87
110
  ```bash
@@ -110,7 +133,9 @@ Akan 프레임워크 패키지는 `dist/pkgs/*`에서만 배포합니다. `verif
110
133
 
111
134
  릴리스 후보(rc)는 CI가 배포합니다. `rc` 브랜치에 push될 때마다 CI 전체를 돌린 뒤, 대기 중인 changeset이
112
135
  릴리스할 버전의 다음 `<version>-rc.N`을 npm provenance와 함께 배포하고 그 커밋에 `v<version>-rc.N` 태그를 붙입니다.
113
- 정식 릴리스는 지금처럼 수동입니다: `bun run changeset:version` 후 `akan deploy-akan --registry npm`.
136
+ 정식 릴리스는 지금처럼 수동입니다: `bun run changeset:version`, 커밋해서 `main`에 push, 그다음
137
+ `akan deploy-akan --registry npm`. npm 배포가 끝나면 `deploy-akan`이 그 커밋으로 에디터 확장 릴리스를 CI에
138
+ 요청합니다. 커밋이 아직 `main`에 없으면 push한 뒤 돌릴 `gh workflow run` 명령을 알려 줍니다.
114
139
  `npm-publish` environment는 `rc`만 허용하므로 `rc`에 push할 수 있는 사람은 rc를 배포할 수 있습니다. 저장소 규칙에서
115
140
  `rc` push 권한을 제한하세요.
116
141
 
package/README.md CHANGED
@@ -81,6 +81,29 @@ plans workflows in `plan` mode, and in `apply` mode — the mode `mcp-install` r
81
81
  validation and the repair tools. An agent changes code through the workflows, so it follows the workspace's rules
82
82
  instead of routing around them. `akan code` is a terminal agent built on the same rules, workflows and skills.
83
83
 
84
+ ## Exit Codes
85
+
86
+ | Exit | `code` | Meaning |
87
+ | --- | --- | --- |
88
+ | 0 | | done |
89
+ | 1 | `failed`, or the error's own code | the command broke |
90
+ | 2 | `usage`, `unknownTarget` | fix the command line or what it names: an unknown flag or command, a value outside the choices, an argument with no terminal to ask it on, an app, lib, package or module the workspace does not have |
91
+ | 2 | `refused` | the answer is no: a pack that needs a new store build (`akan pack-update --against`, `akan push-update`, `akan register-binary`), a release the Akan Cloud project rejected |
92
+ | 3 | `checkFailed` | a check ran and found problems: `akan verify`, `akan typecheck` and the typecheck of `akan build`, `akan preview`, `akan agent install --check` |
93
+ | 130 | `interrupted` | interrupted, a prompt closed with Ctrl+C included |
94
+
95
+ Some commands pin a family. `akan pack-update`, `akan push-update` and `akan register-binary` exit 1 for a usage
96
+ or unknown-target failure, so their 2 only ever means a store build or a refusal. `akan agent` exits 1 for one
97
+ too, since Claude Code reads a hook's exit 2 as a block, and `akan agent hook` never exits 2. `akan doctor
98
+ --strict`, `akan workflow` and `akan subspace` exit 1 when their report says it failed or was refused.
99
+
100
+ With `--json` or `--format json`, stdout holds only JSON: a failure ends it with one line,
101
+ `{"ok":false,"error":"<message>","code":"<code>"}`, and the message goes to stderr. An NDJSON stream
102
+ (`akan code --json`, `akan logs --json`) ends with that line too. A command whose own JSON report says it failed,
103
+ as `akan verify`'s does, adds no line. Two commands keep codes of their own: `akan pipeline` exits 1 for a plan
104
+ with errors and 2 when it could not plan, and `akan migrate` answers its own JSON line, exiting 2 for a `usage`,
105
+ `invalidParam` or `notFound` code and 3 for `verifyFailed`.
106
+
84
107
  ## Akan Cloud
85
108
 
86
109
  ```bash
@@ -109,7 +132,9 @@ artifact is built last and is not overwritten by the root `akan` bootstrap scrip
109
132
 
110
133
  Release candidates publish from CI: each push to the `rc` branch runs the CI suite, then publishes the next
111
134
  `<version>-rc.N` of the version the pending changesets will release, with npm provenance, and tags that commit
112
- `v<version>-rc.N`. Stable releases stay manual: `bun run changeset:version`, then `akan deploy-akan --registry npm`.
135
+ `v<version>-rc.N`. Stable releases stay manual: `bun run changeset:version`, commit and push it to `main`, then
136
+ `akan deploy-akan --registry npm`. Once npm has the packages, `deploy-akan` asks CI to release the editor extension
137
+ from that commit; if the commit is not on `main` yet, it prints the `gh workflow run` command to run after pushing.
113
138
  The `npm-publish` environment admits only `rc`, so whoever can push to `rc` can publish an rc: restrict pushes to
114
139
  `rc` in the repository's rules.
115
140
 
@@ -0,0 +1,18 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-11d7nh8a.js";
5
+ import"./index-f16kr6vj.js";
6
+ import"./index-fp5xf6ef.js";
7
+ import"./index-m9jj544v.js";
8
+ import"./index-yxkjsyx8.js";
9
+ import"./index-yvzm8mby.js";
10
+ import"./index-ze48c0vd.js";
11
+ import"./index-na8r4a27.js";
12
+ import"./index-dss3ds74.js";
13
+ import"./index-qssq2d41.js";
14
+ import"./index-j4yvgfhr.js";
15
+ import"./index-by2tvsq6.js";
16
+ export {
17
+ TunnelShare2 as TunnelShare
18
+ };
@@ -0,0 +1,56 @@
1
+ // @bun
2
+ import {
3
+ Workspace,
4
+ command
5
+ } from "./index-9rv2zt48.js";
6
+ import"./index-j4yvgfhr.js";
7
+ import"./index-qssq2d41.js";
8
+ import"./index-by2tvsq6.js";
9
+ import"./index-ze48c0vd.js";
10
+ import"./index-na8r4a27.js";
11
+ import"./index-dss3ds74.js";
12
+ import"./index-0gaj78wn.js";
13
+ import"./index-trffs83s.js";
14
+ import"./index-bj8s07s7.js";
15
+ import"./index-1p81ecbz.js";
16
+ import"./index-p5zh7pmc.js";
17
+ import"./index-knpm8sdm.js";
18
+ import"./index-at6haq2x.js";
19
+ import"./index-7v7tvgt7.js";
20
+ import"./index-fp5xf6ef.js";
21
+ import"./index-9wab2ngg.js";
22
+ import"./index-m9jj544v.js";
23
+ import"./index-yvzm8mby.js";
24
+ import"./index-yxkjsyx8.js";
25
+ import"./index-prgvqqxe.js";
26
+ import"./index-1pjwsh2g.js";
27
+ import"./index-62md4dwy.js";
28
+ import"./index-zyb0ebm4.js";
29
+ import"./index-ffa52fwf.js";
30
+ import"./index-t4d0ckde.js";
31
+ import"./index-m5gg0wzv.js";
32
+ import {
33
+ AgentScript
34
+ } from "./index-4st0hq72.js";
35
+ import"./index-g7jgd4xs.js";
36
+ import"./index-vjbne22r.js";
37
+
38
+ // pkgs/@akanjs/cli/agent/agent.command.ts
39
+ class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
40
+ agent: target({ desc: "Install Akan agent rules for editors and coding agents", stdio: true, usageExitCode: 1 }).arg("action", String, { desc: "install, or hook (run by Claude Code hooks)" }).arg("target", String, {
41
+ desc: "install: cursor, agents-md, claude, rules, skills, hooks, or all; hook: pre-edit, post-edit, stop",
42
+ nullable: true
43
+ }).option("force", Boolean, {
44
+ desc: "overwrite existing pointer files and generated files you took over",
45
+ default: false
46
+ }).option("check", Boolean, {
47
+ desc: "write nothing; exit 3 when install would create, change or remove a file",
48
+ default: false
49
+ }).with(Workspace).exec(async function(action, targetName, force, check, workspace) {
50
+ await this.agentScript.agent(workspace, action, targetName, { force, check });
51
+ })
52
+ })) {
53
+ }
54
+ export {
55
+ AgentCommand
56
+ };
package/akanCode.js CHANGED
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  PreviewChrome2,
4
4
  PreviewView2
5
- } from "./index-sc0g6zbm.js";
6
- import"./index-bns3wcpc.js";
5
+ } from "./index-rwgqba9p.js";
6
+ import"./index-by2tvsq6.js";
7
7
  import {
8
8
  akanCodePaths2
9
- } from "./index-35j83zkd.js";
9
+ } from "./index-p5zh7pmc.js";
10
10
  import {
11
11
  AkanEditScope2,
12
12
  DevLogFeedback2,
@@ -34,31 +34,31 @@ import {
34
34
  CodeMailbox2,
35
35
  CodeSessionFork2,
36
36
  CodeAgent2
37
- } from "./index-ytpmk3pb.js";
37
+ } from "./index-jgj31xvw.js";
38
38
  import {
39
39
  akanCodeDefaultModel2,
40
40
  akanCodeModel2,
41
41
  akanCodeModelSupportsImages2,
42
42
  akanCodeModelWarnings2,
43
43
  CodeAgentStreamPrinter2
44
- } from "./index-w15mg3km.js";
44
+ } from "./index-0dm25wvf.js";
45
45
  import {
46
46
  SubagentPool2,
47
47
  AkanCodeCompaction2
48
- } from "./index-qrk06tfp.js";
48
+ } from "./index-g45y5f3e.js";
49
49
  import {
50
50
  CodeAgentRpcHost2
51
51
  } from "./index-s4nvxpzm.js";
52
52
  import {
53
- CodeTuiLines2,
54
- CodeTuiAgents2,
55
- CodeTuiClipboard2,
56
53
  CodeTuiCommands2,
54
+ CodeTuiLines2,
57
55
  CodeTuiEditor2,
58
- CodeTuiFiles2,
56
+ CodeTuiAgents2,
59
57
  CodeTuiMarkdown2,
60
- CodeTuiParts2
61
- } from "./index-2mrn1mrg.js";
58
+ CodeTuiParts2,
59
+ CodeTuiClipboard2,
60
+ CodeTuiFiles2
61
+ } from "./index-9f3reh2y.js";
62
62
  import"./index-9bv479q5.js";
63
63
  export {
64
64
  AkanCli2 as AkanCli,
@@ -0,0 +1,11 @@
1
+ // @bun
2
+ import {
3
+ AppExecutor2
4
+ } from "./index-ze48c0vd.js";
5
+ import"./index-na8r4a27.js";
6
+ import"./index-qssq2d41.js";
7
+ import"./index-j4yvgfhr.js";
8
+ import"./index-by2tvsq6.js";
9
+ export {
10
+ AppExecutor2 as AppExecutor
11
+ };
@@ -1,4 +1,7 @@
1
1
  // @bun
2
+ import {
3
+ RouteJsBudget
4
+ } from "./index-7v7tvgt7.js";
2
5
  import {
3
6
  App,
4
7
  Apps,
@@ -7,21 +10,26 @@ import {
7
10
  Exec,
8
11
  Workspace,
9
12
  command
10
- } from "./index-386canwe.js";
11
- import"./index-bns3wcpc.js";
12
- import"./index-wfmpxke3.js";
13
- import"./index-y725zb1a.js";
14
- import"./index-djc5nxpy.js";
15
- import"./index-20wvskt8.js";
13
+ } from "./index-9rv2zt48.js";
14
+ import {
15
+ CliError
16
+ } from "./index-j4yvgfhr.js";
17
+ import"./index-qssq2d41.js";
18
+ import"./index-by2tvsq6.js";
19
+ import"./index-ze48c0vd.js";
20
+ import"./index-na8r4a27.js";
21
+ import"./index-dss3ds74.js";
22
+ import"./index-fp5xf6ef.js";
23
+ import"./index-9wab2ngg.js";
16
24
  import"./index-m9jj544v.js";
17
- import"./index-84c2pgak.js";
18
- import"./index-wr9magsr.js";
19
- import"./index-54s6knqe.js";
20
- import"./index-kcpk2d20.js";
21
- import"./index-sc0g6zbm.js";
25
+ import"./index-yvzm8mby.js";
26
+ import"./index-yxkjsyx8.js";
27
+ import"./index-6zb17wcm.js";
28
+ import"./index-at6haq2x.js";
29
+ import"./index-rwgqba9p.js";
22
30
  import {
23
31
  ApplicationScript
24
- } from "./index-ddk49ypz.js";
32
+ } from "./index-v929w7j7.js";
25
33
  import {
26
34
  writeOption,
27
35
  nativeTargetOption,
@@ -29,12 +37,20 @@ import {
29
37
  allowLocalOption,
30
38
  publicEnvOption
31
39
  } from "./index-mdjc93e1.js";
32
- import"./index-8jpc5fqv.js";
40
+ import"./index-g7jgd4xs.js";
33
41
  import"./index-9bv479q5.js";
42
+ import"./index-vjbne22r.js";
34
43
 
35
44
  // pkgs/@akanjs/cli/application/application.command.ts
36
45
  import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
37
46
  import { MigrationError } from "akanjs/server/migration/migrationError";
47
+ var packUpdateDesc = "Pack an unsigned over-the-air update of the mobile web bundle for a signer; records it in <out>/pack.json. Exits 2 when --against needs a new store build, 1 on any other failure";
48
+ var migrationFailureOf = (error, usage) => {
49
+ const message = MigrationError.messageOf(error);
50
+ if (usage || CliError.is(error, "usage"))
51
+ return new MigrationError("usage", message);
52
+ return CliError.is(error, "unknownTarget") ? new MigrationError("notFound", message) : error;
53
+ };
38
54
  var deviceOption = {
39
55
  desc: "simulator, emulator or device to run on: its id or name (e.g. 'iPhone 17' or 'Pixel_10')",
40
56
  default: ""
@@ -42,6 +58,7 @@ var deviceOption = {
42
58
  var teamOption = { flag: "T", desc: "Apple team id the signing is narrowed to", default: "" };
43
59
  var signDesc = "sign with the identity AKAN_NATIVE_MACOS_* / AKAN_NATIVE_WINDOWS_* names (without it the env signs nothing)";
44
60
  var notarizeDesc = "macOS: upload the signed app to Apple's notary service (takes --sign)";
61
+ var checkBudgetDesc = "fail on a route over its akan.budget.json entry or with none, or a missing or unreadable file";
45
62
  var devEnvs = ["local", "debug", "develop", "main"];
46
63
  var buildEnvOption = { enum: devEnvs, desc: "backend environment", default: "debug" };
47
64
  var startEnvOption = {
@@ -50,8 +67,7 @@ var startEnvOption = {
50
67
  default: "local"
51
68
  };
52
69
  var listOf = (value) => (value ?? "").split(",").map((entry) => entry.trim()).filter(Boolean);
53
-
54
- class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
70
+ var workspaceTargets = ({ public: target }) => ({
55
71
  createApplication: target({ desc: "Create a new application in the workspace" }).arg("appName", String, { desc: "name of application" }).option("start", Boolean, { desc: "start application", default: false }).with(Workspace).exec(async function(appName, start, workspace) {
56
72
  await this.applicationScript.createApplication(appName.toLowerCase().replace(/ /g, "-"), workspace, { start });
57
73
  }),
@@ -66,18 +82,22 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
66
82
  }),
67
83
  script: target({ desc: "Run a custom script in the application" }).with(App).arg("filename", String, { desc: "name of script", nullable: true }).exec(async function(app, filename) {
68
84
  await this.applicationScript.script(app, filename);
69
- }),
85
+ })
86
+ });
87
+ var migrationTargets = ({ public: target }) => ({
70
88
  migrate: target({
71
- desc: "List, plan, apply, verify or roll back the app's data migrations in script/migration",
89
+ desc: "List, plan, apply, verify or roll back the app's data migrations in script/migration, or list and prune the indexes it no longer declares",
72
90
  stdio: true,
73
91
  usageExitCode: 2,
74
92
  onFailure: async (error, { usage, given }) => {
75
93
  if (given.json !== true)
76
94
  return;
77
- const failure = usage ? new MigrationError("usage", MigrationError.messageOf(error)) : error;
78
- await MigrationCommand.print(MigrationCommand.failure(null, failure), true);
95
+ await MigrationCommand.print(MigrationCommand.failure(null, migrationFailureOf(error, usage)), true);
79
96
  }
80
- }).with(App).arg("action", String, { desc: "list, plan, apply, verify or rollback", default: "list" }).arg("target", String, { desc: "migration id; for rollback, an apply's run id too", nullable: true }).option("param", String, { desc: "a param the migration declares, as name=value", multiple: true }).option("expect", String, { desc: "the plan hash an apply must still match", nullable: true }).option("items", Number, { desc: "how many planned decisions to print", nullable: true }).option("actor", String, { desc: "who runs it, as the ledger records", nullable: true }).option("json", Boolean, { desc: "print the result as one JSON line", default: false }).exec(async function(app, action, target, param, expect, items, actor, json) {
97
+ }).with(App).arg("action", String, {
98
+ desc: "list, plan, apply, verify, rollback, indexes or prune-indexes",
99
+ default: "list"
100
+ }).arg("target", String, { desc: "migration id; for rollback, an apply's run id too", nullable: true }).option("param", String, { desc: "a param the migration declares, as name=value", multiple: true }).option("expect", String, { desc: "the plan hash an apply must still match", nullable: true }).option("items", Number, { desc: "how many planned decisions to print", nullable: true }).option("actor", String, { desc: "who runs it, as the ledger records", nullable: true }).option("json", Boolean, { desc: "print the result as one JSON line", default: false }).exec(async function(app, action, target, param, expect, items, actor, json) {
81
101
  await this.applicationScript.migrate(app, [
82
102
  action,
83
103
  ...target ? [target] : [],
@@ -90,12 +110,14 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
90
110
  }),
91
111
  createMigration: target({ desc: "Create a data migration in the app's script/migration" }).arg("migrationName", String, { desc: "what it does, in camelCase", example: "bizLicenseOwnership" }).with(App).exec(async function(migrationName, app) {
92
112
  await this.applicationScript.createMigration(app, migrationName);
93
- }),
113
+ })
114
+ });
115
+ var inspectTargets = ({ public: target }) => ({
94
116
  preview: target({
95
117
  desc: "Open pages of the app's dev server in a headless browser and print what broke, starting a server if none runs",
96
118
  stdio: true
97
119
  }).with(App).arg("paths", String, {
98
- desc: "page paths, comma-separated; the default locale is added when missing, but not to /_akan routes such as Studio or to files (default: /)",
120
+ desc: "page paths, comma-separated; the default locale is added when missing, except to a path the server answers outside a locale (/_akan, the API prefix, /__csr, /__rsc, /.well-known, /openapi.json, /mcp, the server's own files, public/ files), which opens as written; a full URL opens its path on the dev server (default: /)",
99
121
  example: "/board,/board/new",
100
122
  nullable: true
101
123
  }).option("changed", Boolean, {
@@ -178,7 +200,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
178
200
  follow,
179
201
  runtimeDir
180
202
  });
181
- }),
203
+ })
204
+ });
205
+ var buildAndTestTargets = ({ public: target }) => ({
182
206
  build: target({ short: true, desc: "Build the application for production (frontend + backend)" }).with(App).option("write", Boolean, writeOption).option("fast", Boolean, { desc: "fast build", default: false }).option("quiet", Boolean, { desc: "hide build progress output", default: false }).option("profile", String, {
183
207
  desc: "server env profile: bundle env/env.server.<env>.<profile>.ts in place of the environment's own file",
184
208
  nullable: true
@@ -186,17 +210,14 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
186
210
  enum: devEnvs,
187
211
  desc: "environment the server runs in (default: AKAN_PUBLIC_ENV of the shell, else of the workspace .env)",
188
212
  nullable: true
189
- }).option("updateBudget", Boolean, {
190
- desc: "write akan.budget.json: add each new route's JS and lower an entry a route now fits under, never raise one",
191
- default: false
192
- }).exec(async function(app, write, fast, quiet, profile, env, updateBudget) {
213
+ }).option("checkBudget", Boolean, { desc: checkBudgetDesc, default: false }).option("updateBudget", Boolean, { desc: "write akan.budget.json, never raising an entry", default: false }).option("raiseBudget", Boolean, { desc: "rewrite akan.budget.json at each route's measured JS", default: false }).exec(async function(app, write, fast, quiet, profile, env, checkBudget, updateBudget, raiseBudget) {
193
214
  await this.applicationScript.build(app, {
194
215
  write,
195
216
  fast,
196
217
  quiet,
197
218
  profile: profile ?? undefined,
198
219
  env: env ?? undefined,
199
- updateBudget
220
+ budget: RouteJsBudget.modeOf({ checkBudget, updateBudget, raiseBudget })
200
221
  });
201
222
  }),
202
223
  typecheck: target({ short: true, desc: "Typecheck an app or a library, its tests and specs included" }).with(SysOrOnlyApp).option("write", Boolean, writeOption).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).option("tests", Boolean, { desc: "check its *.test.ts / *.spec.ts too, which nothing imports", default: true }).exec(async function(sys, write, clean, incremental, tests) {
@@ -208,7 +229,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
208
229
  nullable: true
209
230
  }).option("write", Boolean, writeOption).option("coverage", Boolean, { desc: "measure coverage; lcov goes under local/coverage/<target>", default: false }).exec(async function(exec, files, write, coverage) {
210
231
  await this.applicationScript.test(exec, { write, files: listOf(files), coverage });
211
- }),
232
+ })
233
+ });
234
+ var nativeBuildTargets = ({ public: target }) => ({
212
235
  buildIos: target({ short: true, desc: "Build the iOS app on the native runtime" }).with(App).option("target", String, nativeTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, writeOption).exec(async function(app, target, env, debug, write) {
213
236
  await this.applicationScript.buildIos(app, { target, env, profile: debug ? "debug" : "release", write });
214
237
  }),
@@ -233,7 +256,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
233
256
  ...notarize ? { notarize } : {},
234
257
  ...arch ? { arch } : {}
235
258
  });
236
- }),
259
+ })
260
+ });
261
+ var startTargets = ({ public: target }) => ({
237
262
  start: target({ short: true, desc: "Start development server(s) (frontend SSR + backend)" }).with(Apps).option("plain", Boolean, { desc: "print prefixed lines instead of the full-screen view", default: false }).option("kill", Boolean, { flag: "k", desc: "free the dev ports first, whoever is holding them", default: false }).option("concurrency", Number, {
238
263
  desc: "apps to boot at a time (default: what this machine's memory and cores allow)",
239
264
  nullable: true
@@ -272,7 +297,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
272
297
  operation: release ? "release" : "local",
273
298
  write
274
299
  });
275
- }),
300
+ })
301
+ });
302
+ var releaseTargets = ({ public: target }) => ({
276
303
  releaseIos: target({ desc: "Build and sign the iOS app for the App Store (.ipa)" }).with(App).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("team", String, teamOption).option("adHoc", Boolean, { desc: "sign with an ad-hoc profile instead of app-store", default: false }).option("write", Boolean, writeOption).option("allowLocalRelease", Boolean, allowLocalOption("release")).option("publicEnv", String, publicEnvOption("the release")).exec(async function(app, target, env, team, adHoc, write, allowLocalRelease, publicEnv) {
277
304
  await this.applicationScript.releaseIos(app, {
278
305
  target,
@@ -292,10 +319,10 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
292
319
  allowLocalRelease,
293
320
  publicEnv: publicEnv ?? undefined
294
321
  });
295
- }),
296
- packUpdate: target({
297
- desc: "Pack an unsigned over-the-air update of the mobile web bundle for a signer; records it in <out>/pack.json. Exits 2 when --against needs a new store build, 1 on any other failure"
298
- }).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("out", String, {
322
+ })
323
+ });
324
+ var updateTargets = ({ public: target }) => ({
325
+ packUpdate: target({ desc: packUpdateDesc, usageExitCode: 1 }).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, nativeTargetOption).option("env", String, releaseEnvOption).option("out", String, {
299
326
  desc: "output folder (default: dist/native/<app>/<target>/updates/<platform>)",
300
327
  nullable: true
301
328
  }).option("against", String, {
@@ -358,7 +385,9 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
358
385
  write,
359
386
  allowLocalRelease
360
387
  });
361
- }),
388
+ })
389
+ });
390
+ var databaseTargets = ({ public: target }) => ({
362
391
  dbup: target({ desc: "Start local database services for a database mode" }).with(Workspace).option("mode", String, {
363
392
  desc: "database mode; left out, every mode the workspace's apps declare",
364
393
  enum: ["single", "multiple", "cluster"],
@@ -375,6 +404,18 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
375
404
  dbdown: target({ desc: "Stop local database services" }).with(Workspace).exec(async function(workspace) {
376
405
  await this.applicationScript.dbdown(workspace);
377
406
  })
407
+ });
408
+
409
+ class ApplicationCommand extends command("application", [ApplicationScript], (context) => ({
410
+ ...workspaceTargets(context),
411
+ ...migrationTargets(context),
412
+ ...inspectTargets(context),
413
+ ...buildAndTestTargets(context),
414
+ ...nativeBuildTargets(context),
415
+ ...startTargets(context),
416
+ ...releaseTargets(context),
417
+ ...updateTargets(context),
418
+ ...databaseTargets(context)
378
419
  })) {
379
420
  }
380
421
  export {
@@ -1,32 +1,36 @@
1
1
  // @bun
2
2
  import {
3
- ServerEnvProfile,
4
- Spinner,
5
3
  ProjectTypecheck2,
4
+ Spinner,
6
5
  parseEnvFile,
7
- WorkspaceExecutor
8
- } from "./index-wfmpxke3.js";
9
- import"./index-bns3wcpc.js";
6
+ WorkspaceExecutor,
7
+ ServerEnvProfile
8
+ } from "./index-qssq2d41.js";
9
+ import"./index-by2tvsq6.js";
10
+ import"./index-j4yvgfhr.js";
11
+ import"./index-ze48c0vd.js";
12
+ import"./index-na8r4a27.js";
13
+ import"./index-dss3ds74.js";
10
14
  import {
11
15
  NARROWABLE_VENDOR_SPECIFIERS
12
- } from "./index-vbhx60x5.js";
16
+ } from "./index-cb91b6d8.js";
13
17
  import {
14
18
  FontPruner,
15
19
  RouteJsBudget
16
- } from "./index-y725zb1a.js";
17
- import"./index-84c2pgak.js";
20
+ } from "./index-7v7tvgt7.js";
21
+ import"./index-yvzm8mby.js";
18
22
  import {
19
23
  AllRoutesBuilder,
20
24
  precompressArtifacts,
21
25
  SsrBaseArtifactBuilder,
22
26
  VendorImportScanner
23
- } from "./index-bdmgqzb5.js";
27
+ } from "./index-6469101k.js";
24
28
  import {
25
29
  CsrArtifactBuilder
26
- } from "./index-wr9magsr.js";
30
+ } from "./index-yxkjsyx8.js";
27
31
  import"./index-62md4dwy.js";
28
32
 
29
- // pkgs/@akanjs/devkit/applicationBuildRunner.ts
33
+ // pkgs/@akanjs/devkit/app/applicationBuildRunner.ts
30
34
  import path3 from "path";
31
35
  import { toError } from "akanjs/common";
32
36
  import { BUILD_ENV_FILE } from "akanjs/server/lifecycle/buildEnv";
@@ -123,7 +127,7 @@ var createServerEnvPlugin = ({
123
127
  };
124
128
  };
125
129
 
126
- // pkgs/@akanjs/devkit/applicationBuildRunner.ts
130
+ // pkgs/@akanjs/devkit/app/applicationBuildRunner.ts
127
131
  var BUILD_PHASE_EMOJIS = {
128
132
  prepare: "\uD83E\uDDF9",
129
133
  typecheck: "\uD83D\uDD0E",
@@ -393,7 +397,7 @@ void run().catch((error) => {
393
397
  const { baseDevEnv, branches } = await this.#app.getConfig();
394
398
  const routes = new AllRoutesBuilder(this.#app, "build");
395
399
  const allRoutes = await routes.build();
396
- const vendorExports = await VendorImportScanner.exportsUsedIn(path3.join(this.#app.dist.cwdPath, ".akan/artifact/client"), NARROWABLE_VENDOR_SPECIFIERS);
400
+ const vendorExports = await VendorImportScanner.exportsUsedIn(path3.join(this.#app.dist.cwdPath, ".akan/artifact/client"), NARROWABLE_VENDOR_SPECIFIERS, Object.values(allRoutes.manifest.clientManifest).map(({ id }) => id));
397
401
  const base = await new SsrBaseArtifactBuilder(this.#app, "build", {
398
402
  serverEnv: this.#serverEnvPlugin(baseDevEnv.env, branches),
399
403
  vendorExports
@@ -408,6 +412,7 @@ void run().catch((error) => {
408
412
  const budgetPath = path3.join(this.#app.cwdPath, RouteJsBudget.fileName);
409
413
  const { summary: status, warnings } = await RouteJsBudget.check(sizes, {
410
414
  mode: this.#budget,
415
+ app: this.#app.name,
411
416
  budgetPath,
412
417
  source: path3.relative(this.#app.workspace.workspaceRoot, budgetPath),
413
418
  environment
@@ -2,31 +2,37 @@
2
2
  import {
3
3
  FontOptimizer,
4
4
  ApplicationBuildReporter
5
- } from "./index-y725zb1a.js";
5
+ } from "./index-7v7tvgt7.js";
6
6
  import {
7
7
  resolveSsrPageEntriesForApp,
8
- WorkspaceExecutor,
9
- AppExecutor
10
- } from "./index-wfmpxke3.js";
8
+ AppExecutor2
9
+ } from "./index-ze48c0vd.js";
11
10
  import {
12
11
  computeRouteSeedIndex,
13
12
  saveRouteSeedIndex,
14
13
  CsrDevBundler,
15
14
  SsrDevBundler
16
- } from "./index-vbhx60x5.js";
17
- import"./index-bns3wcpc.js";
15
+ } from "./index-cb91b6d8.js";
16
+ import {
17
+ WorkspaceExecutor
18
+ } from "./index-qssq2d41.js";
19
+ import"./index-by2tvsq6.js";
20
+ import"./index-j4yvgfhr.js";
21
+ import"./index-na8r4a27.js";
22
+ import"./index-dss3ds74.js";
18
23
  import {
19
24
  ServerGraphFile,
20
25
  PagesBundleBuilder
21
- } from "./index-84c2pgak.js";
26
+ } from "./index-yvzm8mby.js";
22
27
  import {
23
28
  CssCompiler,
24
29
  SsrBaseArtifactBuilder
25
- } from "./index-bdmgqzb5.js";
30
+ } from "./index-6469101k.js";
26
31
  import {
27
32
  CsrArtifactBuilder
28
- } from "./index-wr9magsr.js";
33
+ } from "./index-yxkjsyx8.js";
29
34
  import"./index-62md4dwy.js";
35
+ import"./index-vjbne22r.js";
30
36
 
31
37
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
32
38
  import path from "path";
@@ -272,6 +278,15 @@ ${cssText}`).toString(36);
272
278
  return previous.files.some((fontFile) => path.resolve(fontFile) === normalized);
273
279
  });
274
280
  }
281
+ static #report(result) {
282
+ if (!process.send)
283
+ return Promise.resolve();
284
+ return new Promise((resolve) => {
285
+ process.once("disconnect", () => resolve());
286
+ process.send?.({ type: "build-batch-result", data: result });
287
+ setTimeout(() => process.disconnect?.(), 5000).unref();
288
+ });
289
+ }
275
290
  static async main() {
276
291
  const raw = process.argv[2];
277
292
  if (!raw)
@@ -285,14 +300,14 @@ ${cssText}`).toString(36);
285
300
  workspaceRoot: request.workspaceRoot,
286
301
  repoName: request.repoName
287
302
  });
288
- const app = AppExecutor.from(workspace, request.appName);
303
+ const app = AppExecutor2.from(workspace, request.appName);
289
304
  if (request.pageKeys)
290
305
  app.setPageKeys(request.pageKeys);
291
306
  const orphaned = () => process.exit(1);
292
307
  process.on("disconnect", orphaned);
293
308
  const result = await new BuildBatch(request, app).run();
294
- process.send?.({ type: "build-batch-result", data: result });
295
309
  process.off("disconnect", orphaned);
310
+ await BuildBatch.#report(result);
296
311
  }
297
312
  }
298
313
  await BuildBatch.main().catch((err) => {