@akanjs/cli 3.0.0-beta.17 → 3.0.0-beta.19

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 (149) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-gjqnc2mg.js → CodeAgent-6cm97kay.js} +2 -2
  3. package/{CodeAgentRpcHost-qvwfv0n9.js → CodeAgentRpcHost-p7h6n2hp.js} +1 -1
  4. package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
  5. package/{CodeTui-nd9hqvrw.js → CodeTui-za4jsm41.js} +205 -34
  6. package/{TunnelShare-r5tc2qk5.js → TunnelShare-2j6s511d.js} +2 -2
  7. package/{agent.command-n664dtcv.js → agent.command-e0wpbbyg.js} +6 -6
  8. package/akanCode.js +7 -5
  9. package/{application.command-t5542jte.js → application.command-8wyxqc8q.js} +28 -15
  10. package/{applicationBuildRunner-x4gbfn7y.js → applicationBuildRunner-n9gzaxd0.js} +35 -10
  11. package/{applicationReleasePackager-z61ep017.js → applicationReleasePackager-vpggfqgq.js} +1 -1
  12. package/buildBatch.proc.js +3 -3
  13. package/{capacitorApp-shv3ajh5.js → capacitorApp-q3z0qht0.js} +2 -2
  14. package/{cloud.command-dk5tj39k.js → cloud.command-4zwa5dsx.js} +34 -12
  15. package/cloud.script-fwx3vb34.js +20 -0
  16. package/{code.command-88sebgnn.js → code.command-468c9d7s.js} +41 -19
  17. package/commandManifest.json +1 -1
  18. package/{context.command-pqsm5jrk.js → context.command-dsnw0jby.js} +14 -14
  19. package/context.runner-rs4rj15d.js +22 -0
  20. package/{dependencyScanner-shs82ynp.js → dependencyScanner-0z2h2tks.js} +1 -1
  21. package/{devTui-gy6mendg.js → devTui-ffjsarqa.js} +3 -3
  22. package/{devTuiView-y1548wy6.js → devTuiView-1q1mdgrv.js} +1 -1
  23. package/{guideline.command-rpc2emw8.js → guideline.command-vhw13pqr.js} +8 -13
  24. package/guidelines/agentRule/agentRule.instruction.md +27 -10
  25. package/guidelines/conventions/conventions.instruction.md +53 -26
  26. package/guidelines/queryRule/queryRule.instruction.md +17 -7
  27. package/guidelines/runtimeRule/runtimeRule.instruction.md +74 -0
  28. package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
  29. package/guidelines/transportRule/transportRule.instruction.md +10 -8
  30. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +4 -3
  31. package/incrementalBuilder.proc.js +3 -2
  32. package/{index-4n4821gp.js → index-10dkrrww.js} +4 -4
  33. package/{index-bzakk0c2.js → index-14zrtgfa.js} +5 -3
  34. package/{index-v17gj504.js → index-18zybgkc.js} +2 -2
  35. package/{index-qh7brn20.js → index-22xtgmhn.js} +6 -2
  36. package/{index-qhtj9y6j.js → index-2446k7b4.js} +74 -21
  37. package/{index-g9zghs4h.js → index-3jrp517k.js} +12 -12
  38. package/{index-vpx68e4x.js → index-4m929vvn.js} +2 -2
  39. package/{index-4cvpzkq6.js → index-53176s7j.js} +3 -3
  40. package/{index-jwrpsrg3.js → index-667w0yah.js} +1 -1
  41. package/{index-3mg4h788.js → index-7ep8qtvp.js} +2 -2
  42. package/{index-w8kmx1b6.js → index-89hy31kf.js} +30 -7
  43. package/index-9d6nvkz2.js +656 -0
  44. package/index-9dp031by.js +12 -0
  45. package/{index-zn8qgeqx.js → index-a1w6934z.js} +3 -3
  46. package/{index-p0tew3fq.js → index-ab0c38ea.js} +10 -5
  47. package/index-bc88j1ry.js +1166 -0
  48. package/{index-ns128c4q.js → index-bftkz6cp.js} +280 -73
  49. package/{index-kcxmv48c.js → index-bhtmj233.js} +4 -1
  50. package/{index-kvzjda3v.js → index-bwf965h6.js} +5 -5
  51. package/{index-p4p9t45x.js → index-crmeqnmf.js} +56 -44
  52. package/{index-8k16atqy.js → index-d2242ksy.js} +23 -6
  53. package/{index-2sq06vv0.js → index-e4v6vhxq.js} +417 -105
  54. package/{index-xjc7gg65.js → index-esk82rvk.js} +23 -33
  55. package/{index-sn7dnzq4.js → index-kwaq3n9n.js} +1 -1
  56. package/{index-gm76f0qb.js → index-n3cv0tm4.js} +1 -1
  57. package/{index-6na0sd2b.js → index-qdgzsnhg.js} +5 -2
  58. package/{index-twq9p2sp.js → index-s5rhm04y.js} +0 -6
  59. package/{index-n8kt2wh6.js → index-sq2dzkzm.js} +35 -10
  60. package/{index-myj01w9r.js → index-srmay5jw.js} +15 -2
  61. package/{index-2pm1j01n.js → index-txr7dj2g.js} +4 -4
  62. package/{index-3cymrzsb.js → index-vqx8bdxz.js} +17 -3
  63. package/{index-te0y1c0m.js → index-zqgj2rt2.js} +12 -7
  64. package/index.js +21 -21
  65. package/{library.command-m8p2r1dh.js → library.command-cqr175dy.js} +3 -3
  66. package/{localRegistry.command-yppdqrxv.js → localRegistry.command-49z55qqz.js} +9 -9
  67. package/{module.command-mfzvqt0n.js → module.command-9p8mm3b0.js} +5 -5
  68. package/{package.command-cgp2p2v5.js → package.command-wxyz909t.js} +5 -5
  69. package/package.json +2 -2
  70. package/{page.command-taenb02b.js → page.command-gsrsfqqs.js} +3 -3
  71. package/{primitive.command-7kpncmkk.js → primitive.command-ns1mptje.js} +6 -6
  72. package/{prompter-9mn3kp36.js → prompter-1f8d9pcc.js} +1 -1
  73. package/{quality.command-1ar94hrw.js → quality.command-e76k2q9k.js} +18 -17
  74. package/{repair.command-n08t6j8p.js → repair.command-pkrsm3cw.js} +5 -5
  75. package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
  76. package/{scalar.command-mq8qfp4t.js → scalar.command-0cpt3fc8.js} +4 -4
  77. package/skills/akan-code/SKILL.md +122 -0
  78. package/skills/akan-module/SKILL.md +2 -2
  79. package/skills/akan-store/SKILL.md +6 -2
  80. package/{subspace.command-jqv5n79w.js → subspace.command-fktpwp0g.js} +20 -10
  81. package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
  82. package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
  83. package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
  84. package/templates/appSample/lib/task/task.abstract.ts +12 -32
  85. package/templates/appSample/lib/task/task.signal.spec.ts +15 -18
  86. package/templates/appSample/lib/task/task.signal.test.ts +15 -1
  87. package/templates/appSample/lib/task/task.signal.ts +1 -1
  88. package/templates/appSample/srvkit/AuthGuard.ts +4 -1
  89. package/templates/appSample/srvkit/SessionInternalArg.ts +3 -1
  90. package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
  91. package/templates/crudPages/[__model__Id]/page.tsx +2 -1
  92. package/templates/crudPages/new/page.tsx +2 -1
  93. package/templates/crudPages/page.tsx +2 -1
  94. package/templates/crudSinglePage/page.tsx +2 -1
  95. package/templates/localDev/docker-compose.yaml.template +3 -14
  96. package/templates/module/__model__.signal.ts +12 -4
  97. package/templates/pkgRoot/tsconfig.json.template +2 -7
  98. package/templates/service/__model__.abstract.md.template +8 -0
  99. package/{tunnel.command-ht2es78c.js → tunnel.command-d5jy9gk8.js} +4 -4
  100. package/{workflow.command-tvz4nm9n.js → workflow.command-6tkcysmx.js} +9 -9
  101. package/{workspace.command-txv1yv5e.js → workspace.command-gv84eh1p.js} +25 -24
  102. package/cloud.script-ch3xrw3s.js +0 -20
  103. package/context.runner-bys6ykcp.js +0 -22
  104. package/guidelines/agentRule/agentRule.generate.json +0 -31
  105. package/guidelines/componentRule/componentRule.generate.json +0 -31
  106. package/guidelines/conventions/conventions.generate.json +0 -25
  107. package/guidelines/cssRule/cssRule.generate.json +0 -31
  108. package/guidelines/docPageRule/docPageRule.generate.json +0 -31
  109. package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
  110. package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
  111. package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
  112. package/guidelines/enumConstant/enumConstant.generate.json +0 -31
  113. package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
  114. package/guidelines/fieldRule/fieldRule.generate.json +0 -31
  115. package/guidelines/framework/framework.generate.json +0 -32
  116. package/guidelines/mcpRule/mcpRule.generate.json +0 -35
  117. package/guidelines/modelConstant/modelConstant.generate.json +0 -32
  118. package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
  119. package/guidelines/modelDocument/modelDocument.generate.json +0 -31
  120. package/guidelines/modelService/modelService.generate.json +0 -31
  121. package/guidelines/modelSignal/modelSignal.generate.json +0 -31
  122. package/guidelines/modelStore/modelStore.generate.json +0 -31
  123. package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
  124. package/guidelines/modelUnit/modelUnit.generate.json +0 -31
  125. package/guidelines/modelUtil/modelUtil.generate.json +0 -31
  126. package/guidelines/modelView/modelView.generate.json +0 -31
  127. package/guidelines/modelZone/modelZone.generate.json +0 -31
  128. package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
  129. package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
  130. package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
  131. package/guidelines/queryRule/queryRule.generate.json +0 -31
  132. package/guidelines/recipeRule/recipeRule.generate.json +0 -31
  133. package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
  134. package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
  135. package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
  136. package/guidelines/scalarModule/scalarModule.generate.json +0 -31
  137. package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
  138. package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
  139. package/guidelines/ssrRule/ssrRule.generate.json +0 -31
  140. package/guidelines/transportRule/transportRule.generate.json +0 -31
  141. package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
  142. package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
  143. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
  144. package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -34
  145. package/index-57p9p179.js +0 -461
  146. package/index-qt8dqgnf.js +0 -250
  147. package/templates/__scalar/__model__/__model__.abstract.md +0 -28
  148. package/templates/module/__model__.abstract.md +0 -28
  149. package/templates/service/__model__.abstract.md +0 -28
@@ -6,17 +6,17 @@ import {
6
6
  Exec,
7
7
  Workspace,
8
8
  command
9
- } from "./index-6na0sd2b.js";
9
+ } from "./index-qdgzsnhg.js";
10
10
  import"./index-q0y2jq9j.js";
11
- import"./index-p4p9t45x.js";
11
+ import"./index-crmeqnmf.js";
12
12
  import"./index-6wwzs1bc.js";
13
13
  import {
14
14
  ApplicationScript
15
- } from "./index-ns128c4q.js";
16
- import"./index-3mg4h788.js";
15
+ } from "./index-bftkz6cp.js";
16
+ import"./index-7ep8qtvp.js";
17
17
  import"./index-hwkygn9s.js";
18
18
  import"./index-7md2g9vw.js";
19
- import"./index-sn7dnzq4.js";
19
+ import"./index-kwaq3n9n.js";
20
20
  import {
21
21
  getMobileTargetChoices
22
22
  } from "./index-47pj3aee.js";
@@ -51,7 +51,14 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
51
51
  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, {
52
52
  desc: "endpoint glob(s), comma-separated: mutation:*, query:userList",
53
53
  nullable: true
54
- }).option("trace", String, { desc: "one request's traceId", nullable: true }).option("child", String, { desc: "replica index(es), comma-separated", nullable: true }).option("role", String, { flag: "R", desc: "process role(s): gateway, all, batch, rsc-worker", nullable: true }).option("origin", String, { desc: "call origin(s): http, websocket, mcp, internal, page", nullable: true }).option("since", String, { desc: "only records newer than this: 5m, 30s, or epoch ms", nullable: true }).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, {
54
+ }).option("trace", String, { desc: "one request's traceId", nullable: true }).option("child", String, { desc: "replica index(es), comma-separated", nullable: true }).option("role", String, {
55
+ flag: "R",
56
+ desc: "process role(s): gateway, federation, batch, all, rsc-worker",
57
+ nullable: true
58
+ }).option("origin", String, { desc: "call origin(s): http, websocket, mcp, internal, page", nullable: true }).option("since", String, {
59
+ desc: "only records newer than this: a duration ago in ms, s, m, h or d (30s, 5m, 2h), or an epoch-ms timestamp",
60
+ nullable: true
61
+ }).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, {
55
62
  flag: "d",
56
63
  desc: "runtime dir holding akan-control.sock (default: local/apps/<app>/runtime)",
57
64
  nullable: true
@@ -104,13 +111,13 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
104
111
  enum: ["local", "debug", "develop", "main"],
105
112
  desc: "backend environment",
106
113
  default: "local"
107
- }).option("open", Boolean, { desc: "open ios simulator", default: false }).option("release", Boolean, { desc: "release mode", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).option("noAllowProvisioningUpdates", Boolean, {
108
- desc: "disable automatic iOS provisioning updates for physical devices",
109
- default: false
114
+ }).option("open", Boolean, { desc: "open ios simulator", default: false }).option("release", Boolean, { desc: "release mode", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).option("allowProvisioningUpdates", Boolean, {
115
+ desc: "let Xcode create or update provisioning profiles for a physical device",
116
+ default: true
110
117
  }).option("device", String, {
111
118
  desc: "run target to select non-interactively: udid, device name, or runtime (e.g. 'iPhone 16' or 'iOS 18')",
112
119
  default: ""
113
- }).exec(async function(app, target, env, open, release, write, regenerate, noAllowProvisioningUpdates, device) {
120
+ }).exec(async function(app, target, env, open, release, write, regenerate, allowProvisioningUpdates, device) {
114
121
  await this.applicationScript.startIos(app, {
115
122
  target,
116
123
  env,
@@ -118,7 +125,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
118
125
  operation: release ? "release" : "local",
119
126
  write,
120
127
  regenerate,
121
- noAllowProvisioningUpdates,
128
+ noAllowProvisioningUpdates: !allowProvisioningUpdates,
122
129
  device: device || undefined
123
130
  });
124
131
  }),
@@ -176,11 +183,17 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
176
183
  await this.applicationScript.codepush(app, os);
177
184
  }),
178
185
  dbup: target({ desc: "Start local database services for a database mode" }).with(Workspace).option("mode", String, {
179
- desc: "database mode",
180
- default: "multiple",
181
- enum: ["single", "multiple", "cluster"]
186
+ desc: "database mode; left out, every mode the workspace's apps declare",
187
+ enum: ["single", "multiple", "cluster"],
188
+ nullable: true
182
189
  }).exec(async function(workspace, mode) {
183
- await this.applicationScript.dbup(workspace, mode);
190
+ await this.applicationScript.dbupDeclared(workspace, mode);
191
+ }),
192
+ 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) {
193
+ await this.applicationScript.transferDatabase(app, "export", dir);
194
+ }),
195
+ 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) {
196
+ await this.applicationScript.transferDatabase(app, "import", dir);
184
197
  }),
185
198
  dbdown: target({ desc: "Stop local database services" }).with(Workspace).exec(async function(workspace) {
186
199
  await this.applicationScript.dbdown(workspace);
@@ -1,15 +1,15 @@
1
1
  // @bun
2
2
  import {
3
3
  Spinner
4
- } from "./index-p4p9t45x.js";
4
+ } from "./index-crmeqnmf.js";
5
5
  import {
6
6
  AllRoutesBuilder,
7
7
  CsrArtifactBuilder,
8
8
  FontPruner,
9
9
  precompressArtifacts,
10
10
  SsrBaseArtifactBuilder
11
- } from "./index-zn8qgeqx.js";
12
- import"./index-w8kmx1b6.js";
11
+ } from "./index-a1w6934z.js";
12
+ import"./index-89hy31kf.js";
13
13
  import"./index-q0y2jq9j.js";
14
14
  import"./index-hwkygn9s.js";
15
15
  import"./index-n68jx79w.js";
@@ -111,9 +111,29 @@ class ApplicationBuildRunner {
111
111
  const akanConfig = await this.#app.getConfig();
112
112
  await Promise.all([
113
113
  this.#app.dist.writeJson("package.json", akanConfig.getProductionPackageJson()),
114
- this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/Dockerfile`, akanConfig.dockerfile)
114
+ this.#app.dist.writeFile(`${this.#app.dist.cwdPath}/Dockerfile`, akanConfig.dockerfile),
115
+ this.#app.dist.writeJson("akan.build.json", {
116
+ buildId: await this.#resolveBuildId(),
117
+ akanVersion: akanConfig.akanVersion,
118
+ builtAt: new Date().toISOString()
119
+ })
115
120
  ]);
116
121
  }
122
+ async#resolveBuildId() {
123
+ const fromEnv = process.env.AKAN_BUILD_ID?.trim();
124
+ if (fromEnv)
125
+ return fromEnv;
126
+ const root = this.#app.workspace.workspaceRoot;
127
+ const sha = Bun.spawnSync(["git", "rev-parse", "--short=12", "HEAD"], { cwd: root, stderr: "ignore" });
128
+ if (sha.exitCode !== 0)
129
+ return null;
130
+ const dirty = Bun.spawnSync(["git", "status", "--porcelain", "--untracked-files=no"], {
131
+ cwd: root,
132
+ stderr: "ignore"
133
+ });
134
+ const suffix = dirty.exitCode === 0 && dirty.stdout.toString().trim() ? "-dirty" : "";
135
+ return `${sha.stdout.toString().trim()}${suffix}`;
136
+ }
117
137
  async#buildBackend() {
118
138
  const akanConfig = await this.#app.getConfig();
119
139
  const backendExternals = [
@@ -125,15 +145,19 @@ class ApplicationBuildRunner {
125
145
  if (!await Bun.file(entrypoint).exists())
126
146
  throw new Error(`Backend entrypoint not found: ${entrypoint}`);
127
147
  }
128
- const backendResult = await this.#buildOrThrow("backend", {
129
- entrypoints: backendEntryPoints,
148
+ const backendConfig = {
130
149
  outdir: this.#app.dist.cwdPath,
131
150
  target: "bun",
132
151
  minify: AKAN_BACKEND_MINIFY,
133
152
  naming: { entry: "[name].[ext]", chunk: "chunk-[hash].[ext]" },
134
153
  define: { "process.env.NODE_ENV": JSON.stringify("production") },
135
154
  plugins: backendExternals.length > 0 ? [this.#createExternalSpecifiersPlugin(backendExternals)] : []
136
- });
155
+ };
156
+ const [mainResult, serverResult] = [
157
+ await this.#buildOrThrow("backend", { ...backendConfig, entrypoints: [backendEntryPoints[0]] }),
158
+ await this.#buildOrThrow("backend", { ...backendConfig, entrypoints: [backendEntryPoints[1]], splitting: true })
159
+ ];
160
+ const backendResult = { outputs: [...mainResult.outputs, ...serverResult.outputs] };
137
161
  const rscWorkerResult = web.ssr ? await this.#buildOrThrow("rsc-worker", {
138
162
  entrypoints: [this.#resolveRscWorkerBuildEntry()],
139
163
  outdir: this.#app.dist.cwdPath,
@@ -159,11 +183,12 @@ class ApplicationBuildRunner {
159
183
  };
160
184
  }
161
185
  async#writeConsoleShim() {
162
- await Bun.write(path.join(this.#app.dist.cwdPath, "console.js"), `import { cnst, db, dict, option, server, sig, srv } from "./server.js";
163
- import { assertAkanConsoleAllowed, startAkanConsole } from "./console-runtime.js";
186
+ await Bun.write(path.join(this.#app.dist.cwdPath, "console.js"), `process.env.AKAN_COMMAND_TYPE = "console";
187
+ const { cnst, db, dict, option, server, sig, srv } = await import("./server.js");
188
+ const { assertAkanConsoleAllowed, startAkanConsole } = await import("./console-runtime.js");
164
189
 
165
190
  const run = async () => {
166
- assertAkanConsoleAllowed(server.env);
191
+ assertAkanConsoleAllowed();
167
192
  await server.start({ listen: false, web: false });
168
193
  try {
169
194
  await startAkanConsole(server, { globals: { cnst, db, dict, option, sig, srv } });
@@ -4,7 +4,7 @@ import {
4
4
  } from "./index-q0y2jq9j.js";
5
5
  import {
6
6
  Spinner
7
- } from "./index-p4p9t45x.js";
7
+ } from "./index-crmeqnmf.js";
8
8
 
9
9
  // pkgs/@akanjs/devkit/applicationReleasePackager.ts
10
10
  import { cp, mkdir, rm } from "fs/promises";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  WorkspaceExecutor,
4
4
  AppExecutor
5
- } from "./index-p4p9t45x.js";
5
+ } from "./index-crmeqnmf.js";
6
6
  import"./index-q0y2jq9j.js";
7
7
  import"./index-6wwzs1bc.js";
8
8
  import {
@@ -11,8 +11,8 @@ import {
11
11
  CsrArtifactBuilder,
12
12
  FontOptimizer,
13
13
  SsrBaseArtifactBuilder
14
- } from "./index-zn8qgeqx.js";
15
- import"./index-w8kmx1b6.js";
14
+ } from "./index-a1w6934z.js";
15
+ import"./index-89hy31kf.js";
16
16
  import"./index-hwkygn9s.js";
17
17
  import"./index-n68jx79w.js";
18
18
 
@@ -2,8 +2,8 @@
2
2
  import {
3
3
  isPlaceholderAppId2,
4
4
  CapacitorApp2
5
- } from "./index-3cymrzsb.js";
6
- import"./index-p4p9t45x.js";
5
+ } from "./index-vqx8bdxz.js";
6
+ import"./index-crmeqnmf.js";
7
7
  import"./index-6wwzs1bc.js";
8
8
  import"./index-q0y2jq9j.js";
9
9
  export {
@@ -2,24 +2,26 @@
2
2
  import"./index-q0y2jq9j.js";
3
3
  import {
4
4
  GlobalConfig
5
- } from "./index-myj01w9r.js";
5
+ } from "./index-srmay5jw.js";
6
6
  import {
7
7
  Workspace,
8
8
  command
9
- } from "./index-6na0sd2b.js";
10
- import"./index-p4p9t45x.js";
9
+ } from "./index-qdgzsnhg.js";
10
+ import"./index-crmeqnmf.js";
11
11
  import"./index-6wwzs1bc.js";
12
- import"./index-ns128c4q.js";
13
- import"./index-3mg4h788.js";
12
+ import {
13
+ PlatformTestRun
14
+ } from "./index-bc88j1ry.js";
15
+ import"./index-bftkz6cp.js";
16
+ import"./index-7ep8qtvp.js";
14
17
  import"./index-hwkygn9s.js";
15
18
  import"./index-7md2g9vw.js";
16
- import"./index-kcxmv48c.js";
17
- import"./index-p0tew3fq.js";
18
- import"./index-57p9p179.js";
19
+ import"./index-bhtmj233.js";
20
+ import"./index-ab0c38ea.js";
19
21
  import {
20
22
  CloudScript2
21
- } from "./index-n8kt2wh6.js";
22
- import"./index-sn7dnzq4.js";
23
+ } from "./index-sq2dzkzm.js";
24
+ import"./index-kwaq3n9n.js";
23
25
 
24
26
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
25
27
  var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
@@ -42,10 +44,30 @@ class CloudCommand extends command("cloud", [CloudScript2], ({ public: target })
42
44
  { label: "local", value: "local" },
43
45
  { label: "npm", value: "npm" }
44
46
  ]
45
- }).with(Workspace).exec(async function(test, registry, workspace) {
47
+ }).option("platforms", String, {
48
+ desc: "platforms to test on besides this machine, comma-separated: linux, windows (none to skip)",
49
+ default: "linux,windows"
50
+ }).with(Workspace).exec(async function(test, registry, platforms, workspace) {
46
51
  await this.cloudScript.deployAkan(workspace, {
47
52
  test,
48
- registryUrl: resolveRegistryUrl(registry)
53
+ registryUrl: resolveRegistryUrl(registry),
54
+ platforms: PlatformTestRun.parsePlatforms(platforms)
55
+ });
56
+ }),
57
+ testPlatforms: target({
58
+ devOnly: true,
59
+ desc: "Run the Akan package suites on Linux (Docker) and Windows (SSH) against a snapshot of this tree"
60
+ }).option("platforms", String, {
61
+ desc: "platforms to test on, comma-separated: linux, windows",
62
+ default: "linux,windows"
63
+ }).option("pkgs", String, {
64
+ flag: "k",
65
+ desc: "packages to test, comma-separated (default: every Akan package)",
66
+ nullable: true
67
+ }).with(Workspace).exec(async function(platforms, pkgs, workspace) {
68
+ await this.cloudScript.testPlatforms(workspace, {
69
+ platforms: PlatformTestRun.parsePlatforms(platforms),
70
+ pkgs: pkgs?.split(",").map((pkg) => pkg.trim()).filter(Boolean)
49
71
  });
50
72
  }),
51
73
  update: target({ desc: "Update Akan.js framework to the latest version" }).with(Workspace).option("tag", String, {
@@ -0,0 +1,20 @@
1
+ // @bun
2
+ import {
3
+ CloudScript2
4
+ } from "./index-sq2dzkzm.js";
5
+ import"./index-bc88j1ry.js";
6
+ import"./index-bftkz6cp.js";
7
+ import"./index-kwaq3n9n.js";
8
+ import"./index-7ep8qtvp.js";
9
+ import"./index-ab0c38ea.js";
10
+ import"./index-srmay5jw.js";
11
+ import"./index-qdgzsnhg.js";
12
+ import"./index-7md2g9vw.js";
13
+ import"./index-hwkygn9s.js";
14
+ import"./index-crmeqnmf.js";
15
+ import"./index-6wwzs1bc.js";
16
+ import"./index-bhtmj233.js";
17
+ import"./index-q0y2jq9j.js";
18
+ export {
19
+ CloudScript2 as CloudScript
20
+ };
@@ -4,26 +4,28 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-6na0sd2b.js";
7
+ } from "./index-qdgzsnhg.js";
8
8
  import"./index-q0y2jq9j.js";
9
- import"./index-p4p9t45x.js";
9
+ import"./index-crmeqnmf.js";
10
10
  import"./index-6wwzs1bc.js";
11
11
  import {
12
12
  akanCodeDefaultModel2,
13
13
  CodeAgentStreamPrinter2
14
- } from "./index-jwrpsrg3.js";
14
+ } from "./index-667w0yah.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/code/code.runner.ts
17
17
  import { codeAgentPresets, isCodeAgentPresetName } from "akanjs/common";
18
18
 
19
19
  class CodeRunner extends runner("code") {
20
- async serve(options) {
20
+ async serve(options, listen) {
21
21
  await import("./consoleToStderr-h5bryj94.js");
22
- const [{ CodeAgent }, { CodeAgentRpcHost }] = await Promise.all([
23
- import("./CodeAgent-gjqnc2mg.js"),
24
- import("./CodeAgentRpcHost-qvwfv0n9.js")
22
+ const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
23
+ import("./CodeAgent-6cm97kay.js"),
24
+ import("./CodeAgentRpcHost-p7h6n2hp.js"),
25
+ import("./CodeAgentRpcListener-7p7z5dd7.js")
25
26
  ]);
26
- const profile = CodeRunner.profileOf(options);
27
+ const address = listen ? CodeAgentRpcListener.parse(listen) : null;
28
+ const profile = CodeRunner.profileOf(options, { hostAttached: true });
27
29
  const agent = await CodeAgent.create({
28
30
  workspace: options.workspace,
29
31
  cwd: profile.paths.root,
@@ -32,14 +34,19 @@ class CodeRunner extends runner("code") {
32
34
  model: CodeRunner.modelOf(options.model),
33
35
  mode: "rpc"
34
36
  });
35
- await new CodeAgentRpcHost(agent).serve();
37
+ if (!address)
38
+ return await new CodeAgentRpcHost(agent).serve();
39
+ const listener = new CodeAgentRpcListener(new CodeAgentRpcHost(agent, null), address).listen();
40
+ process.stderr.write(`akan code rpc listening on ${"unix" in address ? address.unix : `${address.hostname}:${listener.port}`}
41
+ `);
42
+ await listener.serve();
36
43
  }
37
44
  async tui(options, seed) {
38
45
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
39
- import("./CodeAgent-gjqnc2mg.js"),
40
- import("./CodeTui-nd9hqvrw.js")
46
+ import("./CodeAgent-6cm97kay.js"),
47
+ import("./CodeTui-za4jsm41.js")
41
48
  ]);
42
- const profile = CodeRunner.profileOf(options);
49
+ const profile = CodeRunner.profileOf(options, { hostAttached: false });
43
50
  const apps = options.app ? [options.app] : await options.workspace.getApps();
44
51
  let resume = options.resume;
45
52
  let prompt = seed;
@@ -71,8 +78,8 @@ class CodeRunner extends runner("code") {
71
78
  }
72
79
  }
73
80
  async run(prompt, options) {
74
- const { CodeAgent } = await import("./CodeAgent-gjqnc2mg.js");
75
- const profile = CodeRunner.profileOf(options);
81
+ const { CodeAgent } = await import("./CodeAgent-6cm97kay.js");
82
+ const profile = CodeRunner.profileOf(options, { hostAttached: false });
76
83
  const agent = await CodeAgent.create({
77
84
  workspace: options.workspace,
78
85
  cwd: profile.paths.root,
@@ -91,11 +98,20 @@ class CodeRunner extends runner("code") {
91
98
  agent.dispose();
92
99
  }
93
100
  }
94
- static profileOf(options) {
101
+ static profileOf(options, { hostAttached }) {
95
102
  if (!isCodeAgentPresetName(options.profile))
96
103
  throw new Error(`Unknown profile: ${options.profile}. Use local, pod, review, or web.`);
97
104
  const root = options.app ? `${options.workspace.workspaceRoot}/apps/${options.app}` : options.workspace.workspaceRoot;
98
- return codeAgentPresets[options.profile](root);
105
+ const profile = codeAgentPresets[options.profile](root);
106
+ return { ...profile, ui: { ...profile.ui, canPrompt: CodeRunner.canPrompt(profile, hostAttached) } };
107
+ }
108
+ static canPrompt(profile, hostAttached) {
109
+ const forced = process.env.AKAN_CODE_CAN_PROMPT;
110
+ if (forced === "1")
111
+ return true;
112
+ if (forced === "0")
113
+ return false;
114
+ return hostAttached || profile.ui.canPrompt;
99
115
  }
100
116
  static modelOf(model) {
101
117
  if (!model)
@@ -119,6 +135,8 @@ class CodeScript extends script("code", [CodeRunner]) {
119
135
  thinking: options.thinking,
120
136
  ...options.resume ? { resume: options.resume } : {}
121
137
  };
138
+ if (options.rpcListen)
139
+ return await this.codeRunner.serve(run, options.rpcListen);
122
140
  if (options.rpc)
123
141
  return await this.codeRunner.serve(run);
124
142
  const interactive = options.interactive || !prompt.trim() && !options.json && !!process.stdout.isTTY;
@@ -132,12 +150,16 @@ class CodeScript extends script("code", [CodeRunner]) {
132
150
 
133
151
  // pkgs/@akanjs/cli/code/code.command.ts
134
152
  class CodeCommand extends command("code", [CodeScript], ({ public: target }) => ({
135
- code: target({ desc: "Run the akan coding agent on a prompt" }).arg("prompt", String, { desc: "what the agent should do", nullable: true }).option("app", String, { desc: "narrow the agent to one app instead of the whole repo", nullable: true }).option("profile", String, { desc: "local, pod, review, or web", default: "local" }).option("model", String, { desc: "<provider>/<id>, e.g. deepseek/deepseek-v4-flash", nullable: true }).option("json", Boolean, { desc: "print one event per line as JSON", default: false }).option("thinking", Boolean, { desc: "print the model's reasoning", default: false }).option("rpc", Boolean, { desc: "serve the agent over stdio for another process to drive", default: false }).option("resume", String, { desc: "continue a stored session by id", flag: "R", nullable: true }).option("interactive", Boolean, {
153
+ code: target({ desc: "Run the akan coding agent on a prompt" }).arg("prompt", String, { desc: "what the agent should do", nullable: true }).option("app", String, { desc: "narrow the agent to one app instead of the whole repo", nullable: true }).option("profile", String, { desc: "local, pod, review, or web", default: "local" }).option("model", String, { desc: "<provider>/<id>, e.g. deepseek/deepseek-flash", nullable: true }).option("json", Boolean, { desc: "print one event per line as JSON", default: false }).option("thinking", Boolean, { desc: "print the model's reasoning", default: false }).option("rpc", Boolean, { desc: "serve the agent over stdio for another process to drive", default: false }).option("rpcListen", String, {
154
+ desc: "serve the RPC wire on unix:<path> or tcp:[host:]<port> instead of stdio",
155
+ flag: "L",
156
+ nullable: true
157
+ }).option("resume", String, { desc: "continue a stored session by id", flag: "R", nullable: true }).option("interactive", Boolean, {
136
158
  desc: "open the full-screen session even when a prompt is given",
137
159
  flag: "i",
138
160
  default: false
139
- }).with(Workspace).exec(async function(prompt, app, profile, model, json, thinking, rpc, resume, interactive, workspace) {
140
- const options = { app, profile, model, json, thinking, rpc, interactive, resume };
161
+ }).with(Workspace).exec(async function(prompt, app, profile, model, json, thinking, rpc, rpcListen, resume, interactive, workspace) {
162
+ const options = { app, profile, model, json, thinking, rpc, rpcListen, interactive, resume };
141
163
  await this.codeScript.run(workspace, prompt ?? "", options);
142
164
  })
143
165
  })) {
@@ -1 +1 @@
1
- {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","release-ios":"application","release-android":"application","release-source":"application","codepush":"application","dbup":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","tunnel":"tunnel"}}
1
+ {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","console":"application","logs":"application","build":"application","b":"application","typecheck":"application","t":"application","test":"application","build-ios":"application","bi":"application","build-android":"application","ba":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","release-ios":"application","release-android":"application","release-source":"application","codepush":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"application","configure-app":"application","create-library":"library","remove-library":"library","sync-library":"library","library-status":"library","install-library":"library","start-registry":"localRegistry","reset-registry":"localRegistry","smoke-registry":"localRegistry","version":"package","create-package":"package","remove-package":"package","sync-package":"package","build-package":"package","verify-dist-package":"package","verify-akan-publish-packages":"package","create-module":"module","remove-module":"module","create-service":"module","create-view":"module","create-unit":"module","create-template":"module","create-crud-page":"page","context":"context","doctor":"context","mcp-install":"context","mcp":"context","mcp-call":"context","login":"cloud","logout":"cloud","deploy-akan":"cloud","test-platforms":"cloud","update":"cloud","download-env":"cloud","upload-env":"cloud","subspace":"subspace","guideline":"guideline","create-scalar":"scalar","remove-scalar":"scalar","create-ui":"primitive","add-field":"primitive","add-enum-field":"primitive","quality":"quality","repair":"repair","workflow":"workflow","tunnel":"tunnel"}}
@@ -2,25 +2,25 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-6na0sd2b.js";
5
+ } from "./index-qdgzsnhg.js";
6
6
  import"./index-q0y2jq9j.js";
7
- import"./index-p4p9t45x.js";
7
+ import"./index-crmeqnmf.js";
8
8
  import"./index-6wwzs1bc.js";
9
9
  import"./index-by5gpp8x.js";
10
- import"./index-qhtj9y6j.js";
11
- import"./index-v17gj504.js";
12
- import"./index-g9zghs4h.js";
13
- import"./index-3cymrzsb.js";
14
- import"./index-twq9p2sp.js";
15
- import"./index-4cvpzkq6.js";
16
- import"./index-2pm1j01n.js";
17
- import"./index-qh7brn20.js";
18
- import"./index-xjc7gg65.js";
19
- import"./index-te0y1c0m.js";
20
- import"./index-vpx68e4x.js";
10
+ import"./index-2446k7b4.js";
11
+ import"./index-18zybgkc.js";
12
+ import"./index-3jrp517k.js";
13
+ import"./index-vqx8bdxz.js";
14
+ import"./index-s5rhm04y.js";
15
+ import"./index-53176s7j.js";
16
+ import"./index-txr7dj2g.js";
17
+ import"./index-22xtgmhn.js";
18
+ import"./index-esk82rvk.js";
19
+ import"./index-zqgj2rt2.js";
20
+ import"./index-4m929vvn.js";
21
21
  import {
22
22
  ContextScript
23
- } from "./index-4n4821gp.js";
23
+ } from "./index-10dkrrww.js";
24
24
 
25
25
  // pkgs/@akanjs/cli/context/context.command.ts
26
26
  class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
@@ -0,0 +1,22 @@
1
+ // @bun
2
+ import {
3
+ ContextRunner2
4
+ } from "./index-3jrp517k.js";
5
+ import"./index-53176s7j.js";
6
+ import"./index-txr7dj2g.js";
7
+ import"./index-4m929vvn.js";
8
+ import"./index-zqgj2rt2.js";
9
+ import"./index-esk82rvk.js";
10
+ import"./index-22xtgmhn.js";
11
+ import"./index-18zybgkc.js";
12
+ import"./index-2446k7b4.js";
13
+ import"./index-s5rhm04y.js";
14
+ import"./index-vqx8bdxz.js";
15
+ import"./index-qdgzsnhg.js";
16
+ import"./index-crmeqnmf.js";
17
+ import"./index-by5gpp8x.js";
18
+ import"./index-6wwzs1bc.js";
19
+ import"./index-q0y2jq9j.js";
20
+ export {
21
+ ContextRunner2 as ContextRunner
22
+ };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  TypeScriptDependencyScanner2
4
- } from "./index-kcxmv48c.js";
4
+ } from "./index-bhtmj233.js";
5
5
  import"./index-q0y2jq9j.js";
6
6
  export {
7
7
  TypeScriptDependencyScanner2 as TypeScriptDependencyScanner
@@ -2,12 +2,12 @@
2
2
  import {
3
3
  stripAnsi
4
4
  } from "./index-7md2g9vw.js";
5
- import {
6
- openBrowser
7
- } from "./index-ns128c4q.js";
8
5
  import {
9
6
  writeClipboard
10
7
  } from "./index-p6pbz9n5.js";
8
+ import {
9
+ openBrowser
10
+ } from "./index-9dp031by.js";
11
11
 
12
12
  // pkgs/@akanjs/cli/application/devTui.tsx
13
13
  import { render } from "ink";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // pkgs/@akanjs/cli/application/devTuiView.ts
3
3
  var createDevTuiView = async (supervisor) => {
4
- const { DevTui } = await import("./devTui-gy6mendg.js");
4
+ const { DevTui } = await import("./devTui-ffjsarqa.js");
5
5
  return new DevTui(supervisor);
6
6
  };
7
7
  export {
@@ -2,30 +2,29 @@
2
2
  import {
3
3
  script,
4
4
  command
5
- } from "./index-6na0sd2b.js";
5
+ } from "./index-qdgzsnhg.js";
6
6
  import"./index-q0y2jq9j.js";
7
- import"./index-p4p9t45x.js";
7
+ import"./index-crmeqnmf.js";
8
8
  import"./index-6wwzs1bc.js";
9
9
  import {
10
10
  Prompter2
11
- } from "./index-twq9p2sp.js";
11
+ } from "./index-s5rhm04y.js";
12
12
 
13
13
  // pkgs/@akanjs/cli/guideline/guideline.script.ts
14
14
  import { Logger } from "akanjs/common";
15
15
 
16
16
  class GuidelineScript extends script("guideline") {
17
- async guideline(action, name = null, format = "markdown") {
17
+ async guideline(action, name = null) {
18
18
  if (action === "list") {
19
19
  const guidelines = await Prompter2.listGuidelines();
20
- Logger.rawLog(format === "json" ? JSON.stringify({ guidelines }, null, 2) : guidelines.join(`
20
+ Logger.rawLog(guidelines.join(`
21
21
  `));
22
22
  return;
23
23
  }
24
24
  if (action === "show") {
25
25
  if (!name)
26
26
  throw new Error("Guideline name is required. Example: akan guideline show framework");
27
- const [instruction, guideJson] = await Promise.all([Prompter2.getInstruction(name), Prompter2.getGuideJson(name)]);
28
- Logger.rawLog(format === "json" ? JSON.stringify({ name, instruction, guideJson }, null, 2) : instruction);
27
+ Logger.rawLog(await Prompter2.getInstruction(name));
29
28
  return;
30
29
  }
31
30
  throw new Error(`Unknown guideline action: ${action}. Use "list" or "show".`);
@@ -34,12 +33,8 @@ class GuidelineScript extends script("guideline") {
34
33
 
35
34
  // pkgs/@akanjs/cli/guideline/guideline.command.ts
36
35
  class GuidelineCommand extends command("guideline", [GuidelineScript], ({ public: target }) => ({
37
- guideline: target({ desc: "List or show Akan AI guideline instructions" }).arg("action", String, { desc: "list or show" }).arg("name", String, { desc: "guideline name for show", nullable: true }).option("format", String, {
38
- desc: "output format",
39
- default: "markdown",
40
- enum: ["markdown", "json"]
41
- }).exec(async function(action, name, format) {
42
- await this.guidelineScript.guideline(action, name, format);
36
+ guideline: target({ desc: "List or show Akan AI guideline instructions" }).arg("action", String, { desc: "list or show" }).arg("name", String, { desc: "guideline name for show", nullable: true }).exec(async function(action, name) {
37
+ await this.guidelineScript.guideline(action, name);
43
38
  })
44
39
  })) {
45
40
  }