@akanjs/cli 3.0.0-beta.3 → 3.0.0-beta.30

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 (194) hide show
  1. package/.build-stamp +1 -1
  2. package/CodeAgent-xnfyyz8h.js +9 -0
  3. package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
  4. package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
  5. package/CodeTui-h66xb1fh.js +1457 -0
  6. package/README.md +3 -0
  7. package/TunnelShare-cwh9ezsm.js +9 -0
  8. package/{agent.command-d2gfxfck.js → agent.command-c4v7kjff.js} +8 -9
  9. package/akanCode.js +102 -0
  10. package/application.command-yzsswrz6.js +241 -0
  11. package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-qkt6spd5.js} +121 -77
  12. package/buildBatch.proc.js +120 -32
  13. package/cloud.command-v8h688jc.js +95 -0
  14. package/cloud.script-yct1sk4k.js +20 -0
  15. package/code.command-jff3tw7y.js +154 -0
  16. package/commandManifest.json +1 -1
  17. package/consoleToStderr-h5bryj94.js +7 -0
  18. package/context.command-y5sevk3c.js +48 -0
  19. package/context.runner-90hsmacr.js +21 -0
  20. package/{dependencyScanner-shs82ynp.js → dependencyScanner-06z2dmrr.js} +2 -2
  21. package/{devTui-40ggmd99.js → devTui-q7k7bakd.js} +122 -40
  22. package/fileSys-wzzrntkw.js +9 -0
  23. package/guideline.command-11cndccb.js +42 -0
  24. package/guidelines/agentRule/agentRule.instruction.md +209 -33
  25. package/guidelines/conventions/conventions.instruction.md +143 -41
  26. package/guidelines/fieldRule/fieldRule.instruction.md +1 -0
  27. package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
  28. package/guidelines/queryRule/queryRule.instruction.md +21 -7
  29. package/guidelines/runtimeRule/runtimeRule.instruction.md +268 -6
  30. package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
  31. package/guidelines/transportRule/transportRule.instruction.md +51 -0
  32. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +20 -0
  33. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +66 -3
  34. package/incrementalBuilder.proc.js +564 -109
  35. package/{index-fz5q3gd7.js → index-0ncc0mbk.js} +10 -17
  36. package/index-167c77aq.js +69 -0
  37. package/{index-kcxmv48c.js → index-2ahj896a.js} +45 -79
  38. package/index-2wc41k5w.js +49 -0
  39. package/{index-j9yhg404.js → index-35mmm9ca.js} +4 -7
  40. package/{index-a64esmtb.js → index-376gpdds.js} +523 -1022
  41. package/index-3hx1z96c.js +87 -0
  42. package/{index-v0qh106m.js → index-3rh7thcx.js} +961 -892
  43. package/{index-hwkygn9s.js → index-48k96p55.js} +325 -36
  44. package/{index-q0y2jq9j.js → index-52w0fvh8.js} +21 -4
  45. package/index-5rp0h6na.js +1119 -0
  46. package/index-6x9p8dpb.js +4300 -0
  47. package/index-7md2g9vw.js +6 -0
  48. package/index-8tv7356t.js +700 -0
  49. package/index-94s080qm.js +266 -0
  50. package/index-9dp031by.js +12 -0
  51. package/{index-ws5e0j51.js → index-a4s954kq.js} +43 -26
  52. package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
  53. package/{index-ne2qy0nk.js → index-bxmejydw.js} +12 -12
  54. package/index-c6eggbee.js +123 -0
  55. package/index-d2242ksy.js +99 -0
  56. package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
  57. package/{index-259dsnz3.js → index-gxamdf18.js} +5 -8
  58. package/{index-4edzf1gr.js → index-hf6f4xnb.js} +77 -150
  59. package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
  60. package/{index-gyd220p2.js → index-hmdq5pqm.js} +554 -577
  61. package/{index-600zhnve.js → index-hqd0h1pb.js} +75 -203
  62. package/index-kb16nzyt.js +997 -0
  63. package/index-mk3b9rk1.js +2729 -0
  64. package/{index-2tv3fdx4.js → index-n3jk2501.js} +1205 -1458
  65. package/index-p6pbz9n5.js +25 -0
  66. package/{index-zry5nz81.js → index-qcejqgts.js} +51 -30
  67. package/{index-7737gxcp.js → index-rtwhw4aq.js} +107 -241
  68. package/{index-pnqbkf5p.js → index-se643zvp.js} +6 -2
  69. package/index-tsb0f8ya.js +53 -0
  70. package/{index-ktb5njgy.js → index-tzc1gtrg.js} +49 -99
  71. package/index-wa5jbxj1.js +760 -0
  72. package/index-wfwgcnyc.js +187 -0
  73. package/{index-mak3cd28.js → index-xb7qhxa8.js} +137 -255
  74. package/{index-h7yw2z9n.js → index-zzvvc845.js} +8 -14
  75. package/index.js +23 -22
  76. package/{library.command-nbsky672.js → library.command-n9kp7yms.js} +4 -5
  77. package/{localRegistry.command-yeq57wjr.js → localRegistry.command-jx6kxt2x.js} +23 -42
  78. package/{module.command-29vqzrh8.js → module.command-q2xjf6cx.js} +8 -11
  79. package/{package.command-axv0abmn.js → package.command-q5a3nsw5.js} +6 -7
  80. package/package.json +15 -7
  81. package/{page.command-vs9s3zrh.js → page.command-ppenrxjn.js} +4 -5
  82. package/{primitive.command-cbxmqbtc.js → primitive.command-dvgg8nem.js} +9 -22
  83. package/prompter-76k56b37.js +8 -0
  84. package/{quality.command-gmbs7nws.js → quality.command-pz7kg3pc.js} +205 -377
  85. package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
  86. package/{repair.command-bqsjptsj.js → repair.command-a6py9xvz.js} +11 -35
  87. package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
  88. package/{scalar.command-6k1vhe9s.js → scalar.command-7f3xfpen.js} +7 -10
  89. package/skills/akan-code/SKILL.md +130 -0
  90. package/skills/akan-debug/SKILL.md +42 -0
  91. package/skills/akan-deps/SKILL.md +50 -0
  92. package/skills/akan-err/SKILL.md +39 -0
  93. package/skills/akan-module/SKILL.md +45 -0
  94. package/skills/akan-scaffold/SKILL.md +76 -0
  95. package/skills/akan-scalar/SKILL.md +52 -0
  96. package/skills/akan-service/SKILL.md +34 -0
  97. package/skills/akan-store/SKILL.md +67 -0
  98. package/skills/akan-ui/SKILL.md +63 -0
  99. package/skills/akan-validate/SKILL.md +44 -0
  100. package/{subspace.command-fwjfcts7.js → subspace.command-z7nqs508.js} +138 -67
  101. package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
  102. package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
  103. package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
  104. package/templates/appSample/lib/task/task.abstract.ts +12 -32
  105. package/templates/appSample/lib/task/task.signal.spec.ts +15 -18
  106. package/templates/appSample/lib/task/task.signal.test.ts +15 -1
  107. package/templates/appSample/lib/task/task.signal.ts +1 -1
  108. package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +7 -4
  109. package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +6 -4
  110. package/templates/client.ts +7 -30
  111. package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
  112. package/templates/crudPages/[__model__Id]/page.tsx +2 -1
  113. package/templates/crudPages/new/page.tsx +2 -1
  114. package/templates/crudPages/page.tsx +2 -1
  115. package/templates/crudSinglePage/page.tsx +2 -1
  116. package/templates/lib/__lib/lib.dictionary.ts +0 -2
  117. package/templates/lib/__lib/lib.document.ts +0 -2
  118. package/templates/lib/sig.ts +8 -30
  119. package/templates/localDev/docker-compose.yaml.template +3 -14
  120. package/templates/module/__model__.signal.ts +12 -4
  121. package/templates/pkgRoot/tsconfig.json.template +2 -7
  122. package/templates/server.ts +1 -3
  123. package/templates/service/__model__.abstract.md.template +8 -0
  124. package/templates/workspaceRoot/.gitignore.template +0 -1
  125. package/templates/workspaceRoot/package.json.template +1 -3
  126. package/tunnel.command-zy4wbcgt.js +129 -0
  127. package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
  128. package/typecheck.proc.js +1 -1
  129. package/workflow.command-f142t17s.js +79 -0
  130. package/{workspace.command-8s050m0h.js → workspace.command-gpk1149x.js} +77 -109
  131. package/abstractCompactor-mjh5ppsq.js +0 -101
  132. package/application.command-pj2m7584.js +0 -204
  133. package/applicationReleasePackager-4yasxwv9.js +0 -244
  134. package/capacitorApp-36rbr858.js +0 -12
  135. package/cloud.command-jshwdq22.js +0 -93
  136. package/context.command-ez8a0zyz.js +0 -80
  137. package/devTuiView-c08ccbat.js +0 -9
  138. package/getDirname-dr3jz1xg.js +0 -7
  139. package/guideline.command-xmqwx8zm.js +0 -359
  140. package/guidelines/agentRule/agentRule.generate.json +0 -31
  141. package/guidelines/componentRule/componentRule.generate.json +0 -31
  142. package/guidelines/conventions/conventions.generate.json +0 -25
  143. package/guidelines/cssRule/cssRule.generate.json +0 -31
  144. package/guidelines/docPageRule/docPageRule.generate.json +0 -31
  145. package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
  146. package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
  147. package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
  148. package/guidelines/enumConstant/enumConstant.generate.json +0 -31
  149. package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
  150. package/guidelines/fieldRule/fieldRule.generate.json +0 -31
  151. package/guidelines/framework/framework.generate.json +0 -32
  152. package/guidelines/mcpRule/mcpRule.generate.json +0 -35
  153. package/guidelines/modelConstant/modelConstant.generate.json +0 -32
  154. package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
  155. package/guidelines/modelDocument/modelDocument.generate.json +0 -31
  156. package/guidelines/modelService/modelService.generate.json +0 -31
  157. package/guidelines/modelSignal/modelSignal.generate.json +0 -31
  158. package/guidelines/modelStore/modelStore.generate.json +0 -31
  159. package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
  160. package/guidelines/modelUnit/modelUnit.generate.json +0 -31
  161. package/guidelines/modelUtil/modelUtil.generate.json +0 -31
  162. package/guidelines/modelView/modelView.generate.json +0 -31
  163. package/guidelines/modelZone/modelZone.generate.json +0 -31
  164. package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
  165. package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
  166. package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
  167. package/guidelines/queryRule/queryRule.generate.json +0 -31
  168. package/guidelines/recipeRule/recipeRule.generate.json +0 -31
  169. package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
  170. package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
  171. package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
  172. package/guidelines/scalarModule/scalarModule.generate.json +0 -31
  173. package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
  174. package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
  175. package/guidelines/ssrRule/ssrRule.generate.json +0 -31
  176. package/guidelines/transportRule/transportRule.generate.json +0 -31
  177. package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
  178. package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
  179. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
  180. package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -33
  181. package/index-2hq52jq3.js +0 -465
  182. package/index-47pj3aee.js +0 -76
  183. package/index-6wwzs1bc.js +0 -7
  184. package/index-8pm30m73.js +0 -841
  185. package/index-kn1h7p1x.js +0 -560
  186. package/index-meh558jy.js +0 -65
  187. package/index-rwg2aa4f.js +0 -229
  188. package/index-w8kmx1b6.js +0 -2176
  189. package/index-wt7qrtd4.js +0 -1516
  190. package/templates/__scalar/__model__/__model__.abstract.md +0 -28
  191. package/templates/module/__model__.abstract.md +0 -28
  192. package/templates/service/__model__.abstract.md +0 -28
  193. package/templates/workspaceRoot/patches/react-dom@19.2.7.patch.template +0 -62
  194. package/workflow.command-nwpcdc8p.js +0 -107
package/README.md CHANGED
@@ -74,6 +74,9 @@ artifact is built last and is not overwritten by the root `akan` bootstrap scrip
74
74
  - Use `@akanjs/cli` as the user-facing executable package.
75
75
  - `@akanjs/devkit` is bundled into the CLI for published CLI usage; it is not required as a separate
76
76
  runtime dependency for ordinary CLI users.
77
+ - The `akan code` agent follows that same split: its engine, tools and skills are a devkit facet
78
+ (`@akanjs/devkit/codeAgent`), and `@akanjs/cli/code` is the terminal host plus the SDK entry that
79
+ re-exports both.
77
80
 
78
81
  ## Requirements
79
82
 
@@ -0,0 +1,9 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-2wc41k5w.js";
5
+ import"./index-94s080qm.js";
6
+ import"./index-52w0fvh8.js";
7
+ export {
8
+ TunnelShare2 as TunnelShare
9
+ };
@@ -2,17 +2,16 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-mak3cd28.js";
6
- import"./index-q0y2jq9j.js";
7
- import"./index-2tv3fdx4.js";
8
- import"./index-6wwzs1bc.js";
9
- import"./index-by5gpp8x.js";
10
- import"./index-gyd220p2.js";
11
- import"./index-ktb5njgy.js";
12
- import"./index-h7yw2z9n.js";
5
+ } from "./index-xb7qhxa8.js";
6
+ import"./index-52w0fvh8.js";
7
+ import"./index-n3jk2501.js";
8
+ import"./index-hj6w4ka1.js";
9
+ import"./index-hmdq5pqm.js";
10
+ import"./index-tzc1gtrg.js";
11
+ import"./index-zzvvc845.js";
13
12
  import {
14
13
  AgentScript
15
- } from "./index-ne2qy0nk.js";
14
+ } from "./index-bxmejydw.js";
16
15
 
17
16
  // pkgs/@akanjs/cli/agent/agent.command.ts
18
17
  class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
package/akanCode.js ADDED
@@ -0,0 +1,102 @@
1
+ // @bun
2
+ import {
3
+ AkanEditScope2,
4
+ DevLogFeedback2,
5
+ PreviewChrome2,
6
+ PreviewView2,
7
+ PreviewFeedback2,
8
+ TurnFeedback2,
9
+ AkanCli2,
10
+ AkanVerifier2,
11
+ VerifyFeedback2,
12
+ AkanToolPack2,
13
+ MailToolPack2,
14
+ McpUnauthorized2,
15
+ McpClient2,
16
+ McpToolPack2,
17
+ SessionToolPack2,
18
+ WebToolPack2,
19
+ AkanCodePlugins2,
20
+ AkanEnvKeys2,
21
+ akanSystemPrompt2,
22
+ CodeSessionIndex2,
23
+ AkanCodeServices2,
24
+ CodeAgentAsks2,
25
+ CodeAgentEventMapper2,
26
+ CodeAgentGate2,
27
+ CodeAgentUi2,
28
+ CodeMailbox2,
29
+ CodeSessionFork2,
30
+ CodeAgent2
31
+ } from "./index-mk3b9rk1.js";
32
+ import {
33
+ akanCodeDefaultModel2,
34
+ akanCodeModel2,
35
+ akanCodeModelSupportsImages2,
36
+ akanCodeModelWarnings2,
37
+ CodeAgentStreamPrinter2
38
+ } from "./index-c6eggbee.js";
39
+ import {
40
+ SubagentPool2,
41
+ akanCodePaths2
42
+ } from "./index-8tv7356t.js";
43
+ import"./index-7md2g9vw.js";
44
+ import {
45
+ CodeAgentRpcHost2
46
+ } from "./index-d2242ksy.js";
47
+ import {
48
+ CodeTuiLines2,
49
+ CodeTuiAgents2,
50
+ CodeTuiClipboard2,
51
+ CodeTuiCommands2,
52
+ CodeTuiEditor2,
53
+ CodeTuiFiles2,
54
+ CodeTuiMarkdown2,
55
+ CodeTuiParts2
56
+ } from "./index-wa5jbxj1.js";
57
+ export {
58
+ AkanCli2 as AkanCli,
59
+ AkanCodePlugins2 as AkanCodePlugins,
60
+ AkanCodeServices2 as AkanCodeServices,
61
+ AkanEditScope2 as AkanEditScope,
62
+ AkanEnvKeys2 as AkanEnvKeys,
63
+ AkanToolPack2 as AkanToolPack,
64
+ AkanVerifier2 as AkanVerifier,
65
+ CodeAgent2 as CodeAgent,
66
+ CodeAgentAsks2 as CodeAgentAsks,
67
+ CodeAgentEventMapper2 as CodeAgentEventMapper,
68
+ CodeAgentGate2 as CodeAgentGate,
69
+ CodeAgentRpcHost2 as CodeAgentRpcHost,
70
+ CodeAgentStreamPrinter2 as CodeAgentStreamPrinter,
71
+ CodeAgentUi2 as CodeAgentUi,
72
+ CodeMailbox2 as CodeMailbox,
73
+ CodeSessionFork2 as CodeSessionFork,
74
+ CodeSessionIndex2 as CodeSessionIndex,
75
+ CodeTuiAgents2 as CodeTuiAgents,
76
+ CodeTuiClipboard2 as CodeTuiClipboard,
77
+ CodeTuiCommands2 as CodeTuiCommands,
78
+ CodeTuiEditor2 as CodeTuiEditor,
79
+ CodeTuiFiles2 as CodeTuiFiles,
80
+ CodeTuiLines2 as CodeTuiLines,
81
+ CodeTuiMarkdown2 as CodeTuiMarkdown,
82
+ CodeTuiParts2 as CodeTuiParts,
83
+ DevLogFeedback2 as DevLogFeedback,
84
+ MailToolPack2 as MailToolPack,
85
+ McpClient2 as McpClient,
86
+ McpToolPack2 as McpToolPack,
87
+ McpUnauthorized2 as McpUnauthorized,
88
+ PreviewChrome2 as PreviewChrome,
89
+ PreviewFeedback2 as PreviewFeedback,
90
+ PreviewView2 as PreviewView,
91
+ SessionToolPack2 as SessionToolPack,
92
+ SubagentPool2 as SubagentPool,
93
+ TurnFeedback2 as TurnFeedback,
94
+ VerifyFeedback2 as VerifyFeedback,
95
+ WebToolPack2 as WebToolPack,
96
+ akanCodeDefaultModel2 as akanCodeDefaultModel,
97
+ akanCodeModel2 as akanCodeModel,
98
+ akanCodeModelSupportsImages2 as akanCodeModelSupportsImages,
99
+ akanCodeModelWarnings2 as akanCodeModelWarnings,
100
+ akanCodePaths2 as akanCodePaths,
101
+ akanSystemPrompt2 as akanSystemPrompt
102
+ };
@@ -0,0 +1,241 @@
1
+ // @bun
2
+ import {
3
+ App,
4
+ Apps,
5
+ Sys,
6
+ Exec,
7
+ Workspace,
8
+ command
9
+ } from "./index-xb7qhxa8.js";
10
+ import"./index-52w0fvh8.js";
11
+ import"./index-n3jk2501.js";
12
+ import {
13
+ getMobileTargetChoices
14
+ } from "./index-kb16nzyt.js";
15
+ import"./index-48k96p55.js";
16
+ import"./index-gxamdf18.js";
17
+ import {
18
+ ApplicationScript
19
+ } from "./index-3rh7thcx.js";
20
+ import"./index-7md2g9vw.js";
21
+ import"./index-35mmm9ca.js";
22
+
23
+ // pkgs/@akanjs/cli/application/application.command.ts
24
+ var mobileTargetOption = {
25
+ desc: "native target name (a key of native.targets) or all",
26
+ ask: "Select native target",
27
+ enum: async ({ app }) => await getMobileTargetChoices(app)
28
+ };
29
+ var deviceOption = {
30
+ desc: "simulator, emulator or device to run on: its id or name (e.g. 'iPhone 17' or 'Pixel_10')",
31
+ default: ""
32
+ };
33
+ var teamOption = { flag: "T", desc: "Apple team id the signing is narrowed to", default: "" };
34
+ var devEnvs = ["local", "debug", "develop", "main"];
35
+ var buildEnvOption = { enum: devEnvs, desc: "backend environment", default: "debug" };
36
+ var startEnvOption = {
37
+ enum: devEnvs,
38
+ desc: "backend environment of a --release build; a dev build follows `akan start`, which keeps its own",
39
+ default: "local"
40
+ };
41
+ var releaseEnvOption = {
42
+ enum: ["debug", "develop", "main", "local"],
43
+ desc: "backend environment",
44
+ default: "main"
45
+ };
46
+
47
+ class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
48
+ 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) {
49
+ await this.applicationScript.createApplication(appName.toLowerCase().replace(/ /g, "-"), workspace, { start });
50
+ }),
51
+ removeApplication: target({ desc: "Remove an application from the workspace" }).with(App).exec(async function(app) {
52
+ await this.applicationScript.removeApplication(app);
53
+ }),
54
+ planSlice: target({ desc: "List the exact files an app needs to live in a workspace of its own" }).with(App).option("format", String, { desc: "output format", default: "text", enum: ["text", "json"] }).exec(async function(app, format) {
55
+ await this.applicationScript.planSlice(app, format);
56
+ }),
57
+ sync: target({ desc: "Sync dependencies and configuration for an app or library" }).with(Sys).exec(async function(sys) {
58
+ await this.applicationScript.sync(sys);
59
+ }),
60
+ 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) {
61
+ await this.applicationScript.script(app, filename);
62
+ }),
63
+ console: target({ desc: "Open an interactive server console for the application" }).with(App).exec(async function(app) {
64
+ await this.applicationScript.console(app);
65
+ }),
66
+ logs: target({ desc: "Tail the running application's logs, filtered (attaches to akan-control.sock)" }).with(App).option("level", String, { desc: "minimum level: trace, verbose, debug, info, warn, error", nullable: true }).option("grep", String, { desc: "substring the message must contain", nullable: true }).option("endpoint", String, {
67
+ desc: "endpoint glob(s), comma-separated: mutation:*, query:userList",
68
+ nullable: true
69
+ }).option("trace", String, { desc: "one request's traceId", nullable: true }).option("child", String, { desc: "replica index(es), comma-separated", nullable: true }).option("role", String, {
70
+ flag: "R",
71
+ desc: "process role(s): gateway, federation, batch, all, rsc-worker",
72
+ nullable: true
73
+ }).option("origin", String, { desc: "call origin(s): http, websocket, mcp, internal, page", nullable: true }).option("since", String, {
74
+ desc: "only records newer than this: a duration ago in ms, s, m, h or d (30s, 5m, 2h), or an epoch-ms timestamp",
75
+ nullable: true
76
+ }).option("replay", Number, { flag: "n", desc: "records to replay from the buffer before following", default: 0 }).option("json", Boolean, { desc: "print NDJSON records instead of rendered lines", default: false }).option("follow", Boolean, { desc: "keep streaming; pass --follow false for history only", default: true }).option("runtimeDir", String, {
77
+ flag: "d",
78
+ desc: "runtime dir holding akan-control.sock (default: local/apps/<app>/runtime)",
79
+ nullable: true
80
+ }).exec(async function(app, level, grep, endpoint, trace, child, role, origin, since, replay, json, follow, runtimeDir) {
81
+ await this.applicationScript.logs(app, {
82
+ level,
83
+ grep,
84
+ endpoint,
85
+ trace,
86
+ child,
87
+ role,
88
+ origin,
89
+ since,
90
+ replay,
91
+ json,
92
+ follow,
93
+ runtimeDir
94
+ });
95
+ }),
96
+ build: target({ short: true, desc: "Build the application for production (frontend + backend)" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("fast", Boolean, { desc: "fast build", default: false }).option("quiet", Boolean, { desc: "hide build progress output", default: false }).exec(async function(app, write, fast, quiet) {
97
+ await this.applicationScript.build(app, { write, fast, quiet });
98
+ }),
99
+ typecheck: target({ short: true, desc: "Typecheck the application" }).with(App).option("write", Boolean, { desc: "write code generation", default: true }).option("clean", Boolean, { desc: "clear typecheck cache before running", default: false }).option("incremental", Boolean, { desc: "reuse TypeScript incremental cache", default: true }).exec(async function(app, write, clean, incremental) {
100
+ await this.applicationScript.typecheck(app, { write, clean, incremental });
101
+ }),
102
+ test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(exec, write) {
103
+ await this.applicationScript.test(exec, { write });
104
+ }),
105
+ buildIos: target({ short: true, desc: "Build the iOS app on the native runtime" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, write) {
106
+ await this.applicationScript.buildIos(app, { target, env, profile: debug ? "debug" : "release", write });
107
+ }),
108
+ buildAndroid: target({ short: true, desc: "Build the Android app (apk) on the native runtime" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, write) {
109
+ await this.applicationScript.buildAndroid(app, { target, env, profile: debug ? "debug" : "release", write });
110
+ }),
111
+ buildDesktop: target({ short: true, desc: "Build the desktop app for this computer (macOS, Windows or Linux)" }).with(App).option("target", String, mobileTargetOption).option("env", String, buildEnvOption).option("debug", Boolean, { desc: "debug build instead of release", default: false }).option("installer", Boolean, {
112
+ desc: "Windows: also an NSIS setup program (per user, /S for a silent install)",
113
+ default: false
114
+ }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, debug, installer, write) {
115
+ await this.applicationScript.buildDesktop(app, {
116
+ target,
117
+ env,
118
+ profile: debug ? "debug" : "release",
119
+ installer,
120
+ write
121
+ });
122
+ }),
123
+ 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, {
124
+ desc: "apps to boot at a time (default: what this machine's memory and cores allow)",
125
+ nullable: true
126
+ }).option("dbup", Boolean, { desc: "start the local database first", default: true }).option("open", Boolean, { desc: "open web browser?", default: false }).option("share", Boolean, { desc: "also share each app on a public URL through an akan tunnel", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(apps, plain, kill, concurrency, dbup, open, share, write) {
127
+ await this.applicationScript.start(apps, { plain, kill, concurrency, dbup, open, share, write });
128
+ }),
129
+ startIos: target({ short: true, desc: "Run the iOS app in a simulator or on an iPhone, following `akan start`" }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("device", String, deviceOption).option("team", String, teamOption).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, device, team, write) {
130
+ await this.applicationScript.startIos(app, {
131
+ target,
132
+ env,
133
+ operation: release ? "release" : "local",
134
+ device: device || undefined,
135
+ teamId: team || undefined,
136
+ write
137
+ });
138
+ }),
139
+ startAndroid: target({
140
+ short: true,
141
+ desc: "Run the Android app in an emulator or on a device, following `akan start`"
142
+ }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("device", String, deviceOption).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, device, write) {
143
+ await this.applicationScript.startAndroid(app, {
144
+ target,
145
+ env,
146
+ operation: release ? "release" : "local",
147
+ device: device || undefined,
148
+ write
149
+ });
150
+ }),
151
+ startDesktop: target({
152
+ short: true,
153
+ desc: "Run the desktop app on this computer (macOS, Windows or Linux), following `akan start`"
154
+ }).with(App).option("target", String, mobileTargetOption).option("env", String, startEnvOption).option("release", Boolean, { desc: "run a release build of its own bundle instead", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, target, env, release, write) {
155
+ await this.applicationScript.startDesktop(app, {
156
+ target,
157
+ env,
158
+ operation: release ? "release" : "local",
159
+ write
160
+ });
161
+ }),
162
+ releaseIos: target({ desc: "Build and sign the iOS app for the App Store (.ipa)" }).with(App).option("target", String, mobileTargetOption).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, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, target, env, team, adHoc, write, allowLocalRelease) {
163
+ await this.applicationScript.releaseIos(app, {
164
+ target,
165
+ env,
166
+ teamId: team || undefined,
167
+ adHoc,
168
+ write,
169
+ allowLocalRelease
170
+ });
171
+ }),
172
+ releaseAndroid: target({ desc: "Build and sign the Android app for the Play Store (aab, or apk)" }).with(App).option("assembleType", String, { enum: ["aab", "apk"], default: "aab" }).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, assembleType, target, env, write, allowLocalRelease) {
173
+ await this.applicationScript.releaseAndroid(app, assembleType, {
174
+ target,
175
+ env,
176
+ write,
177
+ allowLocalRelease
178
+ });
179
+ }),
180
+ packUpdate: target({
181
+ desc: "Pack an unsigned over-the-air update of the mobile web bundle, for the signer to publish"
182
+ }).with(App).option("platform", String, { enum: ["ios", "android"], desc: "the app it updates" }).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("out", String, {
183
+ desc: "output folder (default: .akan/native/<target>/updates/<platform>)",
184
+ nullable: true
185
+ }).option("against", String, {
186
+ desc: "bundle.json of the store build it must run in; fails when it needs a new one",
187
+ nullable: true
188
+ }).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow packing with --env local", default: false }).exec(async function(app, platform, target, env, out, against, write, allowLocalRelease) {
189
+ await this.applicationScript.packUpdate(app, platform, {
190
+ target,
191
+ env,
192
+ out: out ?? undefined,
193
+ against: against ?? undefined,
194
+ write,
195
+ allowLocalRelease
196
+ });
197
+ }),
198
+ updateKeygen: target({ desc: "Make (once) the key an app's update releases are signed with; print its public key" }).with(App).option("platform", String, {
199
+ enum: ["desktop", "android", "ios"],
200
+ default: "desktop",
201
+ desc: "the platform whose app id the key signs for (an appId may differ per platform)"
202
+ }).option("target", String, mobileTargetOption).exec(async function(app, platform, target) {
203
+ await this.applicationScript.updateKeygen(app, platform, { target });
204
+ }),
205
+ publishUpdate: target({ desc: "Build and sign an update release installed apps take (desktop, android or ios)" }).with(App).option("platform", String, {
206
+ enum: ["desktop", "android", "ios"],
207
+ default: "desktop",
208
+ desc: "desktop is this computer's OS and CPU; android and ios publish the web bundle"
209
+ }).option("target", String, mobileTargetOption).option("env", String, releaseEnvOption).option("channel", String, {
210
+ desc: "the manifest to publish to (default: the target's updates.channel, else --env)",
211
+ nullable: true
212
+ }).option("write", Boolean, { desc: "write code generation", default: true }).option("allowLocalRelease", Boolean, { flag: "l", desc: "allow release with --env local", default: false }).exec(async function(app, platform, target, env, channel, write, allowLocalRelease) {
213
+ await this.applicationScript.publishUpdate(app, platform, {
214
+ target,
215
+ env,
216
+ ...channel ? { channel } : {},
217
+ write,
218
+ allowLocalRelease
219
+ });
220
+ }),
221
+ dbup: target({ desc: "Start local database services for a database mode" }).with(Workspace).option("mode", String, {
222
+ desc: "database mode; left out, every mode the workspace's apps declare",
223
+ enum: ["single", "multiple", "cluster"],
224
+ nullable: true
225
+ }).exec(async function(workspace, mode) {
226
+ await this.applicationScript.dbupDeclared(workspace, mode);
227
+ }),
228
+ dbExport: target({ desc: "Write every model table of an app to one NDJSON file each" }).with(App).option("dir", String, { desc: "directory under the workspace to write", default: "local/transfer" }).exec(async function(app, dir) {
229
+ await this.applicationScript.transferDatabase(app, "export", dir);
230
+ }),
231
+ dbImport: target({ desc: "Read files db-export wrote into an app's database, in the mode the shell names" }).with(App).option("dir", String, { desc: "directory under the workspace to read", default: "local/transfer" }).exec(async function(app, dir) {
232
+ await this.applicationScript.transferDatabase(app, "import", dir);
233
+ }),
234
+ dbdown: target({ desc: "Stop local database services" }).with(Workspace).exec(async function(workspace) {
235
+ await this.applicationScript.dbdown(workspace);
236
+ })
237
+ })) {
238
+ }
239
+ export {
240
+ ApplicationCommand
241
+ };