@akanjs/cli 3.1.0-rc.20 → 3.1.0-rc.21

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 (69) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-n3tzjm91.js → CodeAgent-gzfc5t52.js} +2 -2
  3. package/{CodeTui-fnm9ft4d.js → CodeTui-bpsjs8wz.js} +1 -1
  4. package/TunnelShare-tfrnftgr.js +14 -0
  5. package/{agent.command-3qxf4xcj.js → agent.command-67ysh3n6.js} +5 -5
  6. package/akanCode.js +2 -2
  7. package/{application.command-zfja7x4r.js → application.command-q0tqw5pc.js} +35 -9
  8. package/{applicationBuildRunner-vh4j6vdv.js → applicationBuildRunner-wsszr305.js} +5 -5
  9. package/buildBatch.proc.js +5 -5
  10. package/{cloud.command-fcc8e8tp.js → cloud.command-e7tkxyx6.js} +13 -13
  11. package/cloud.script-krzh3d7k.js +24 -0
  12. package/{code.command-130bdmhe.js → code.command-ttk8tje2.js} +6 -6
  13. package/commandManifest.json +1 -1
  14. package/{context.command-0qx447mb.js → context.command-bdsk2z2r.js} +16 -16
  15. package/context.runner-bxzv0gm0.js +25 -0
  16. package/{guideline.command-cv5bmrx2.js → guideline.command-man90n70.js} +2 -2
  17. package/guidelines/conventions/conventions.instruction.md +24 -1
  18. package/incrementalBuilder.proc.js +3 -3
  19. package/{index-trpasv9q.js → index-033wne2j.js} +1 -1
  20. package/{index-w44cy4vs.js → index-1r5a8bzx.js} +2 -2
  21. package/{index-86jt2a0e.js → index-27y8t17p.js} +1 -1
  22. package/{index-1djcjcre.js → index-2w8j2fnv.js} +3 -3
  23. package/{index-g1mbppa9.js → index-35m6bzm7.js} +3 -3
  24. package/{index-awbdfcf2.js → index-4393nb4b.js} +4 -4
  25. package/{index-qwa5k1j8.js → index-48edp6q4.js} +1 -1
  26. package/{index-vk0pa0mn.js → index-4v43h00g.js} +1 -1
  27. package/{index-axs61rna.js → index-54wc2phm.js} +3 -3
  28. package/{index-1xj2t7cb.js → index-75n5q4ph.js} +7 -7
  29. package/{index-hsadfb6c.js → index-844q7f8z.js} +7 -7
  30. package/{index-4mhy6qme.js → index-8jehkey8.js} +4 -4
  31. package/{index-pydbnfez.js → index-9mt4smfy.js} +2 -2
  32. package/{index-dye8pnxx.js → index-cae9m5jz.js} +1 -1
  33. package/{index-j237xtew.js → index-ebarbgba.js} +2 -2
  34. package/{index-va06nr10.js → index-g6ax17x4.js} +24 -4
  35. package/{index-1p98exm2.js → index-g9ks2k8c.js} +2 -2
  36. package/{index-192ha4xh.js → index-h3r3nr9y.js} +1 -1
  37. package/{index-qtfmtcrw.js → index-h6czey01.js} +71 -18
  38. package/{index-cpb3nvma.js → index-jrmzcp66.js} +2 -2
  39. package/{index-5edzv8fn.js → index-nv79n88g.js} +2 -2
  40. package/{index-665zp9rs.js → index-nx64dz92.js} +2 -2
  41. package/{index-fmzcs8v6.js → index-p2r64bpa.js} +4 -4
  42. package/{index-j4mkhz93.js → index-pg1t468s.js} +3 -3
  43. package/{index-fyq1z6kt.js → index-rc51f9ht.js} +3 -3
  44. package/{index-tamvyvj3.js → index-ta1dychm.js} +3 -3
  45. package/{index-jw1zm273.js → index-vkb9m4z7.js} +53 -9
  46. package/{index-35hc95h5.js → index-xsd96yzw.js} +1 -1
  47. package/{index-d72hfmdm.js → index-zv5s8x58.js} +8 -8
  48. package/index.js +22 -22
  49. package/{library.command-erp2f56n.js → library.command-6amzsrb8.js} +3 -3
  50. package/{localRegistry.command-hj3p16p5.js → localRegistry.command-yqc0nyhh.js} +12 -12
  51. package/{module.command-gs2r615e.js → module.command-10x6jv6c.js} +5 -5
  52. package/{package.command-j10r76ax.js → package.command-pwfvecjf.js} +3 -3
  53. package/package.json +2 -2
  54. package/{page.command-4h4a8pnh.js → page.command-ahhgx9y1.js} +3 -3
  55. package/{pipeline.command-a2nrk26m.js → pipeline.command-1ptr3e9y.js} +2 -2
  56. package/{primitive.command-w6t0asqz.js → primitive.command-g5xwv6tj.js} +6 -6
  57. package/{projectTypecheck-f534enqj.js → projectTypecheck-fx8x7cat.js} +1 -1
  58. package/{quality.command-77x7vbbx.js → quality.command-fw9ck061.js} +2 -2
  59. package/{repair.command-y6sstev7.js → repair.command-g8kecj96.js} +5 -5
  60. package/{scalar.command-20b8cy0k.js → scalar.command-fprap51w.js} +4 -4
  61. package/{subspace.command-baz73jpk.js → subspace.command-sc0t527y.js} +8 -8
  62. package/templates/migration/__migrationId__.ts +23 -0
  63. package/templates/server.ts +8 -1
  64. package/{tunnel.command-2kw8vt9g.js → tunnel.command-mqnsqbwf.js} +7 -7
  65. package/{workflow.command-2djwmpqf.js → workflow.command-j0jgkr13.js} +10 -10
  66. package/{workspace.command-jqs7vjhe.js → workspace.command-1r9hvvw0.js} +24 -24
  67. package/TunnelShare-661cxz5e.js +0 -14
  68. package/cloud.script-1xt3tnts.js +0 -24
  69. package/context.runner-1vsjztjg.js +0 -25
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- 6ee016177b53c853f3bec400bfc5dd004b72cdb2f4e216c9b3d40c0ac292dcfe
1
+ 5cd1b4a580fd87bc2eb87ac99ed7ddef9d11f9cff7b04559b77daedc42dbe881
@@ -1,8 +1,8 @@
1
1
  // @bun
2
2
  import {
3
3
  CodeAgent2
4
- } from "./index-1djcjcre.js";
5
- import"./index-dye8pnxx.js";
4
+ } from "./index-2w8j2fnv.js";
5
+ import"./index-cae9m5jz.js";
6
6
  import"./index-7md2g9vw.js";
7
7
  export {
8
8
  CodeAgent2 as CodeAgent
@@ -5,7 +5,7 @@ import {
5
5
  McpTokenStore,
6
6
  McpSignIn,
7
7
  AkanCodeCompaction2
8
- } from "./index-dye8pnxx.js";
8
+ } from "./index-cae9m5jz.js";
9
9
  import {
10
10
  CodeTuiLines2,
11
11
  CodeTuiAgents2,
@@ -0,0 +1,14 @@
1
+ // @bun
2
+ import {
3
+ TunnelShare2
4
+ } from "./index-48edp6q4.js";
5
+ import"./index-jrmzcp66.js";
6
+ import"./index-35m6bzm7.js";
7
+ import"./index-m9jj544v.js";
8
+ import"./index-nx64dz92.js";
9
+ import"./index-h3r3nr9y.js";
10
+ import"./index-g6ax17x4.js";
11
+ import"./index-52w0fvh8.js";
12
+ export {
13
+ TunnelShare2 as TunnelShare
14
+ };
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-jw1zm273.js";
5
+ } from "./index-vkb9m4z7.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-va06nr10.js";
7
+ import"./index-g6ax17x4.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-trpasv9q.js";
10
- import"./index-5edzv8fn.js";
9
+ import"./index-033wne2j.js";
10
+ import"./index-nv79n88g.js";
11
11
  import"./index-zzvvc845.js";
12
12
  import {
13
13
  AgentScript
14
- } from "./index-tamvyvj3.js";
14
+ } from "./index-ta1dychm.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/agent/agent.command.ts
17
17
  class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
package/akanCode.js CHANGED
@@ -28,7 +28,7 @@ import {
28
28
  CodeMailbox2,
29
29
  CodeSessionFork2,
30
30
  CodeAgent2
31
- } from "./index-1djcjcre.js";
31
+ } from "./index-2w8j2fnv.js";
32
32
  import {
33
33
  akanCodeDefaultModel2,
34
34
  akanCodeModel2,
@@ -40,7 +40,7 @@ import {
40
40
  SubagentPool2,
41
41
  akanCodePaths2,
42
42
  AkanCodeCompaction2
43
- } from "./index-dye8pnxx.js";
43
+ } from "./index-cae9m5jz.js";
44
44
  import"./index-7md2g9vw.js";
45
45
  import {
46
46
  CodeAgentRpcHost2
@@ -7,18 +7,18 @@ import {
7
7
  Exec,
8
8
  Workspace,
9
9
  command
10
- } from "./index-jw1zm273.js";
10
+ } from "./index-vkb9m4z7.js";
11
11
  import"./index-52w0fvh8.js";
12
- import"./index-va06nr10.js";
12
+ import"./index-g6ax17x4.js";
13
13
  import"./index-5nd1wtkv.js";
14
- import"./index-vk0pa0mn.js";
14
+ import"./index-4v43h00g.js";
15
15
  import"./index-m9jj544v.js";
16
- import"./index-g1mbppa9.js";
17
- import"./index-192ha4xh.js";
18
- import"./index-pydbnfez.js";
16
+ import"./index-35m6bzm7.js";
17
+ import"./index-h3r3nr9y.js";
18
+ import"./index-9mt4smfy.js";
19
19
  import {
20
20
  ApplicationScript
21
- } from "./index-qtfmtcrw.js";
21
+ } from "./index-h6czey01.js";
22
22
  import"./index-7md2g9vw.js";
23
23
  import {
24
24
  writeOption,
@@ -27,10 +27,12 @@ import {
27
27
  allowLocalOption,
28
28
  publicEnvOption
29
29
  } from "./index-mdjc93e1.js";
30
- import"./index-35hc95h5.js";
31
- import"./index-665zp9rs.js";
30
+ import"./index-xsd96yzw.js";
31
+ import"./index-nx64dz92.js";
32
32
 
33
33
  // pkgs/@akanjs/cli/application/application.command.ts
34
+ import { MigrationCommand } from "akanjs/server/migration/migrationCommand";
35
+ import { MigrationError } from "akanjs/server/migration/migrationError";
34
36
  var deviceOption = {
35
37
  desc: "simulator, emulator or device to run on: its id or name (e.g. 'iPhone 17' or 'Pixel_10')",
36
38
  default: ""
@@ -62,6 +64,30 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
62
64
  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) {
63
65
  await this.applicationScript.script(app, filename);
64
66
  }),
67
+ migrate: target({
68
+ desc: "List, plan, apply, verify or roll back the app's data migrations in script/migration",
69
+ stdio: true,
70
+ usageExitCode: 2,
71
+ onFailure: async (error, { usage, given }) => {
72
+ if (given.json !== true)
73
+ return;
74
+ const failure = usage ? new MigrationError("usage", MigrationError.messageOf(error)) : error;
75
+ await MigrationCommand.print(MigrationCommand.failure(null, failure), true);
76
+ }
77
+ }).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) {
78
+ await this.applicationScript.migrate(app, [
79
+ action,
80
+ ...target ? [target] : [],
81
+ ...param.map((each) => `--param=${each}`),
82
+ ...expect ? [`--expect=${expect}`] : [],
83
+ ...items === null ? [] : [`--items=${items}`],
84
+ ...actor ? [`--actor=${actor}`] : [],
85
+ ...json ? ["--json"] : []
86
+ ]);
87
+ }),
88
+ 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) {
89
+ await this.applicationScript.createMigration(app, migrationName);
90
+ }),
65
91
  console: target({ desc: "Open an interactive server console for the application" }).with(App).exec(async function(app) {
66
92
  await this.applicationScript.console(app);
67
93
  }),
@@ -4,20 +4,20 @@ import {
4
4
  Spinner,
5
5
  ProjectTypecheck2,
6
6
  WorkspaceExecutor
7
- } from "./index-va06nr10.js";
7
+ } from "./index-g6ax17x4.js";
8
8
  import"./index-52w0fvh8.js";
9
- import"./index-w44cy4vs.js";
10
- import"./index-192ha4xh.js";
9
+ import"./index-1r5a8bzx.js";
10
+ import"./index-h3r3nr9y.js";
11
11
  import {
12
12
  AllRoutesBuilder,
13
13
  FontPruner,
14
14
  precompressArtifacts,
15
15
  SsrBaseArtifactBuilder
16
- } from "./index-axs61rna.js";
16
+ } from "./index-54wc2phm.js";
17
17
  import"./index-62md4dwy.js";
18
18
  import {
19
19
  CsrArtifactBuilder
20
- } from "./index-665zp9rs.js";
20
+ } from "./index-nx64dz92.js";
21
21
 
22
22
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
23
23
  import path2 from "path";
@@ -6,27 +6,27 @@ import {
6
6
  resolveSsrPageEntriesForApp,
7
7
  WorkspaceExecutor,
8
8
  AppExecutor
9
- } from "./index-va06nr10.js";
9
+ } from "./index-g6ax17x4.js";
10
10
  import {
11
11
  computeRouteSeedIndex,
12
12
  saveRouteSeedIndex,
13
13
  CsrDevBundler,
14
14
  SsrDevBundler
15
- } from "./index-w44cy4vs.js";
15
+ } from "./index-1r5a8bzx.js";
16
16
  import"./index-52w0fvh8.js";
17
17
  import {
18
18
  ServerGraphFile,
19
19
  PagesBundleBuilder
20
- } from "./index-192ha4xh.js";
20
+ } from "./index-h3r3nr9y.js";
21
21
  import {
22
22
  CssCompiler,
23
23
  FontOptimizer,
24
24
  SsrBaseArtifactBuilder
25
- } from "./index-axs61rna.js";
25
+ } from "./index-54wc2phm.js";
26
26
  import"./index-62md4dwy.js";
27
27
  import {
28
28
  CsrArtifactBuilder
29
- } from "./index-665zp9rs.js";
29
+ } from "./index-nx64dz92.js";
30
30
 
31
31
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
32
32
  import path from "path";
@@ -3,26 +3,26 @@ import {
3
3
  App,
4
4
  Workspace,
5
5
  command
6
- } from "./index-jw1zm273.js";
6
+ } from "./index-vkb9m4z7.js";
7
7
  import"./index-52w0fvh8.js";
8
- import"./index-va06nr10.js";
9
- import"./index-cpb3nvma.js";
8
+ import"./index-g6ax17x4.js";
9
+ import"./index-jrmzcp66.js";
10
10
  import {
11
11
  PlatformTestRun
12
- } from "./index-fyq1z6kt.js";
13
- import"./index-vk0pa0mn.js";
12
+ } from "./index-rc51f9ht.js";
13
+ import"./index-4v43h00g.js";
14
14
  import"./index-m9jj544v.js";
15
- import"./index-g1mbppa9.js";
16
- import"./index-192ha4xh.js";
15
+ import"./index-35m6bzm7.js";
16
+ import"./index-h3r3nr9y.js";
17
17
  import"./index-5nd1wtkv.js";
18
- import"./index-pydbnfez.js";
19
- import"./index-qtfmtcrw.js";
18
+ import"./index-9mt4smfy.js";
19
+ import"./index-h6czey01.js";
20
20
  import"./index-7md2g9vw.js";
21
21
  import"./index-tvehn2sp.js";
22
- import"./index-j237xtew.js";
22
+ import"./index-ebarbgba.js";
23
23
  import {
24
24
  CloudScript2
25
- } from "./index-hsadfb6c.js";
25
+ } from "./index-844q7f8z.js";
26
26
  import {
27
27
  writeOption,
28
28
  oneNativeTargetOption,
@@ -33,8 +33,8 @@ import {
33
33
  hostOption,
34
34
  subspaceOption
35
35
  } from "./index-mdjc93e1.js";
36
- import"./index-35hc95h5.js";
37
- import"./index-665zp9rs.js";
36
+ import"./index-xsd96yzw.js";
37
+ import"./index-nx64dz92.js";
38
38
 
39
39
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
40
40
  var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
@@ -0,0 +1,24 @@
1
+ // @bun
2
+ import {
3
+ CloudScript2
4
+ } from "./index-844q7f8z.js";
5
+ import"./index-rc51f9ht.js";
6
+ import"./index-h6czey01.js";
7
+ import"./index-xsd96yzw.js";
8
+ import"./index-9mt4smfy.js";
9
+ import"./index-ebarbgba.js";
10
+ import"./index-4v43h00g.js";
11
+ import"./index-jrmzcp66.js";
12
+ import"./index-35m6bzm7.js";
13
+ import"./index-m9jj544v.js";
14
+ import"./index-vkb9m4z7.js";
15
+ import"./index-7md2g9vw.js";
16
+ import"./index-nx64dz92.js";
17
+ import"./index-5nd1wtkv.js";
18
+ import"./index-h3r3nr9y.js";
19
+ import"./index-g6ax17x4.js";
20
+ import"./index-tvehn2sp.js";
21
+ import"./index-52w0fvh8.js";
22
+ export {
23
+ CloudScript2 as CloudScript
24
+ };
@@ -4,9 +4,9 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-jw1zm273.js";
7
+ } from "./index-vkb9m4z7.js";
8
8
  import"./index-52w0fvh8.js";
9
- import"./index-va06nr10.js";
9
+ import"./index-g6ax17x4.js";
10
10
  import {
11
11
  akanCodeDefaultModel2,
12
12
  CodeAgentStreamPrinter2
@@ -19,7 +19,7 @@ class CodeRunner extends runner("code") {
19
19
  async serve(options, listen) {
20
20
  await import("./consoleToStderr-h5bryj94.js");
21
21
  const [{ CodeAgent }, { CodeAgentRpcHost }, { CodeAgentRpcListener }] = await Promise.all([
22
- import("./CodeAgent-n3tzjm91.js"),
22
+ import("./CodeAgent-gzfc5t52.js"),
23
23
  import("./CodeAgentRpcHost-9g27hmer.js"),
24
24
  import("./CodeAgentRpcListener-7p7z5dd7.js")
25
25
  ]);
@@ -34,8 +34,8 @@ class CodeRunner extends runner("code") {
34
34
  }
35
35
  async tui(options, seed) {
36
36
  const [{ CodeAgent }, { CodeTui }] = await Promise.all([
37
- import("./CodeAgent-n3tzjm91.js"),
38
- import("./CodeTui-fnm9ft4d.js")
37
+ import("./CodeAgent-gzfc5t52.js"),
38
+ import("./CodeTui-bpsjs8wz.js")
39
39
  ]);
40
40
  const agentOptions = await CodeRunner.#agentOptions(options, false);
41
41
  let resume = options.resume;
@@ -67,7 +67,7 @@ class CodeRunner extends runner("code") {
67
67
  }
68
68
  }
69
69
  async run(prompt, options) {
70
- const { CodeAgent } = await import("./CodeAgent-n3tzjm91.js");
70
+ const { CodeAgent } = await import("./CodeAgent-gzfc5t52.js");
71
71
  const agent = await CodeAgent.create(await CodeRunner.#agentOptions(options, false));
72
72
  const printer = new CodeAgentStreamPrinter2({ json: options.json, thinking: options.thinking });
73
73
  agent.on((event) => printer.print(event));
@@ -1 +1 @@
1
- {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"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","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"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","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"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","pipeline":"pipeline","tunnel":"tunnel"}}
1
+ {"byCommand":{"create-workspace":"workspace","generate-agent-rules":"workspace","lint":"workspace","lint-all":"workspace","machine-keygen":"workspace","sync-all":"workspace","init":"workspace","agent":"agent","code":"code","create-application":"application","remove-application":"application","plan-slice":"application","sync":"application","script":"application","migrate":"application","create-migration":"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","build-desktop":"application","bd":"application","start":"application","s":"application","start-ios":"application","si":"application","start-android":"application","sa":"application","start-desktop":"application","sd":"application","release-ios":"application","release-android":"application","pack-update":"application","update-keygen":"application","publish-update":"application","dbup":"application","db-export":"application","db-import":"application","dbdown":"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","push-update":"cloud","register-binary":"cloud","upload-secret":"cloud","list-secrets":"cloud","remove-secret":"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","pipeline":"pipeline","tunnel":"tunnel"}}
@@ -2,28 +2,28 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-jw1zm273.js";
5
+ } from "./index-vkb9m4z7.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-va06nr10.js";
7
+ import"./index-g6ax17x4.js";
8
8
  import"./index-hj6w4ka1.js";
9
- import"./index-trpasv9q.js";
10
- import"./index-5edzv8fn.js";
11
- import"./index-d72hfmdm.js";
12
- import"./index-vk0pa0mn.js";
9
+ import"./index-033wne2j.js";
10
+ import"./index-nv79n88g.js";
11
+ import"./index-zv5s8x58.js";
12
+ import"./index-4v43h00g.js";
13
13
  import"./index-m9jj544v.js";
14
- import"./index-g1mbppa9.js";
15
- import"./index-192ha4xh.js";
14
+ import"./index-35m6bzm7.js";
15
+ import"./index-h3r3nr9y.js";
16
16
  import"./index-zzvvc845.js";
17
- import"./index-j4mkhz93.js";
18
- import"./index-86jt2a0e.js";
19
- import"./index-fmzcs8v6.js";
20
- import"./index-awbdfcf2.js";
21
- import"./index-1p98exm2.js";
22
- import"./index-1xj2t7cb.js";
17
+ import"./index-pg1t468s.js";
18
+ import"./index-27y8t17p.js";
19
+ import"./index-p2r64bpa.js";
20
+ import"./index-4393nb4b.js";
21
+ import"./index-g9ks2k8c.js";
22
+ import"./index-75n5q4ph.js";
23
23
  import {
24
24
  ContextScript
25
- } from "./index-4mhy6qme.js";
26
- import"./index-665zp9rs.js";
25
+ } from "./index-8jehkey8.js";
26
+ import"./index-nx64dz92.js";
27
27
 
28
28
  // pkgs/@akanjs/cli/context/context.command.ts
29
29
  class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
@@ -0,0 +1,25 @@
1
+ // @bun
2
+ import {
3
+ ContextRunner2
4
+ } from "./index-zv5s8x58.js";
5
+ import"./index-75n5q4ph.js";
6
+ import"./index-g9ks2k8c.js";
7
+ import"./index-4393nb4b.js";
8
+ import"./index-pg1t468s.js";
9
+ import"./index-p2r64bpa.js";
10
+ import"./index-27y8t17p.js";
11
+ import"./index-4v43h00g.js";
12
+ import"./index-35m6bzm7.js";
13
+ import"./index-m9jj544v.js";
14
+ import"./index-nv79n88g.js";
15
+ import"./index-033wne2j.js";
16
+ import"./index-zzvvc845.js";
17
+ import"./index-vkb9m4z7.js";
18
+ import"./index-nx64dz92.js";
19
+ import"./index-h3r3nr9y.js";
20
+ import"./index-g6ax17x4.js";
21
+ import"./index-hj6w4ka1.js";
22
+ import"./index-52w0fvh8.js";
23
+ export {
24
+ ContextRunner2 as ContextRunner
25
+ };
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  script,
4
4
  command
5
- } from "./index-jw1zm273.js";
5
+ } from "./index-vkb9m4z7.js";
6
6
  import"./index-52w0fvh8.js";
7
- import"./index-va06nr10.js";
7
+ import"./index-g6ax17x4.js";
8
8
  import {
9
9
  Prompter2
10
10
  } from "./index-zzvvc845.js";
@@ -55,7 +55,8 @@ not "fix" it back.
55
55
  the module dictionary's `.error({})` — imported from `"../dict"` on the server, from `"@libs/<lib>/client"` /
56
56
  `"@apps/<app>/client"` in UI. A `throw` is an error; a raw `Error` rejected, returned or stored loses the key and
57
57
  status too (a warning for now). Exempt: tests, `*.constant.ts`, a root `native/` folder (plugins throw
58
- `AkanNativeError`), and `common/**` / `env/**`, which have no legal `Err` import — keep throwing code out of them.
58
+ `AkanNativeError`), `script/migration/**` (an operator reads its message), and `common/**` / `env/**`, which have
59
+ no legal `Err` import — keep throwing code out of them.
59
60
  - **Never import a third-party package** from `page/**`, any barrel, a module logic file
60
61
  (`*.{constant,dictionary,document,service,signal,store}.ts`) or module component
61
62
  (`*.{Template,Unit,Util,View,Zone}.tsx`) — re-export it through a lib first (one-line shims in a lib's `common/`,
@@ -551,6 +552,28 @@ export default page()
551
552
  barrel holds only `export *` lines). `ui/<Folder>/index_.tsx` is the `"use client"` + `lazy()` boundary beside a
552
553
  server-safe `index.tsx` — merging the pair breaks RSC.
553
554
 
555
+ ## Data Migrations (`apps/*/script/migration/**`)
556
+
557
+ A change that reshapes stored documents ships a migration: `akan create-migration <name> <app>` writes
558
+ `script/migration/<yyyyMMddHHmm>_<name>.ts`, a default-exported `migration(title)` from `akanjs/server`, which
559
+ `akan migrate <app>` runs locally and `bun main.js ops migrate` in a built container (the `cheatsheet/dev/migration`
560
+ docs page).
561
+
562
+ - The new code reads both shapes until every environment has applied it — a deploy serves traffic first.
563
+ - Write only through `table(refName)`, never a service, a document or raw `sql` — a service write runs the model's
564
+ hooks, and none of them reaches the change log a rollback reverts. Call nothing outside the database.
565
+ - `plan` reads only and must hash the same on unchanged data: a timestamp, `createId()` or random value in it makes
566
+ every `apply --expect <planHash>` refuse as `planChanged`.
567
+ - Past about five seconds on SQLite, an apply's one transaction makes the live server's writes fail. Take
568
+ `.config({ transaction: false })`, which commits each `rewrite` batch and resumes a `partial` run from the top of
569
+ `apply` — so a second run must change nothing (a `where` the new shape no longer matches).
570
+ - `$ne` leaves out rows whose path is missing or `null` (match them with `{ path: null }`; `$exists: false` misses a
571
+ stored `null`); `find`, `count` and `rewrite` include removed rows unless `{ withRemoved: false }`; a `table()` write
572
+ leaves `updatedAt` alone.
573
+ - Throw a plain `Error` an operator can act on. Never edit a migration an environment has applied — write another;
574
+ delete it once every environment has, unless its `.rollback(fn)` may still be needed: without the file a rollback
575
+ runs the default undo.
576
+
554
577
  ## Present In The Code — Do Not Imitate
555
578
 
556
579
  Warts in older files — never copy them; when two shapes disagree, follow the newer neighbour: `children: any`
@@ -8,7 +8,7 @@ import {
8
8
  CodegenLock,
9
9
  WorkspaceExecutor,
10
10
  AppExecutor
11
- } from "./index-va06nr10.js";
11
+ } from "./index-g6ax17x4.js";
12
12
  import"./index-52w0fvh8.js";
13
13
  import {
14
14
  GraphClientEntryDiscovery,
@@ -19,10 +19,10 @@ import {
19
19
  DevChangePlanner,
20
20
  DevGeneratedIndexSync,
21
21
  SsrDevBundler
22
- } from "./index-w44cy4vs.js";
22
+ } from "./index-1r5a8bzx.js";
23
23
  import {
24
24
  ServerGraphFile
25
- } from "./index-192ha4xh.js";
25
+ } from "./index-h3r3nr9y.js";
26
26
  import {
27
27
  prepareDevWatchBatch
28
28
  } from "./index-a5vmm6x4.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AppExecutor,
4
4
  LibExecutor
5
- } from "./index-va06nr10.js";
5
+ } from "./index-g6ax17x4.js";
6
6
 
7
7
  // pkgs/@akanjs/devkit/workflow/artifacts.ts
8
8
  import { capitalize } from "akanjs/common";
@@ -19,11 +19,11 @@ import {
19
19
  CsrDevPaths,
20
20
  PagesEntrySourceGenerator,
21
21
  PagesBundleBuilder
22
- } from "./index-192ha4xh.js";
22
+ } from "./index-h3r3nr9y.js";
23
23
  import {
24
24
  AsyncDefaultExportDetector,
25
25
  resolveSsrPageEntriesForApp
26
- } from "./index-va06nr10.js";
26
+ } from "./index-g6ax17x4.js";
27
27
 
28
28
  // pkgs/@akanjs/devkit/frontendBuild/autoImportSync.ts
29
29
  import { readdir, readFile, stat } from "fs/promises";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-jw1zm273.js";
5
+ } from "./index-vkb9m4z7.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/page/page.runner.ts
8
8
  class PageRunner extends runner("page") {
@@ -5,7 +5,7 @@ import {
5
5
  McpServerConfig,
6
6
  McpSignIn,
7
7
  AkanCodeCompaction2
8
- } from "./index-dye8pnxx.js";
8
+ } from "./index-cae9m5jz.js";
9
9
  import {
10
10
  stripAnsi
11
11
  } from "./index-7md2g9vw.js";
@@ -809,7 +809,7 @@ class AkanToolPack2 {
809
809
  return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
810
810
  }
811
811
  async names() {
812
- const { ContextRunner } = await import("./context.runner-1vsjztjg.js");
812
+ const { ContextRunner } = await import("./context.runner-bxzv0gm0.js");
813
813
  return [
814
814
  ...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
815
815
  AkanToolPack2.verifyToolName
@@ -817,7 +817,7 @@ class AkanToolPack2 {
817
817
  }
818
818
  static verifyToolName = "akan_verify";
819
819
  async#register(pi) {
820
- const { ContextRunner } = await import("./context.runner-1vsjztjg.js");
820
+ const { ContextRunner } = await import("./context.runner-bxzv0gm0.js");
821
821
  const runner = new ContextRunner;
822
822
  const guidelineNames = await AkanToolPack2.#guidelineNames();
823
823
  for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
@@ -4,17 +4,17 @@ import {
4
4
  ServerEnvProfile,
5
5
  Executor,
6
6
  WorkspaceExecutor
7
- } from "./index-va06nr10.js";
7
+ } from "./index-g6ax17x4.js";
8
8
  import {
9
9
  resolveAppId,
10
10
  targetHtmlFilename
11
11
  } from "./index-m9jj544v.js";
12
12
  import {
13
13
  ExitCodeError
14
- } from "./index-jw1zm273.js";
14
+ } from "./index-vkb9m4z7.js";
15
15
  import {
16
16
  CsrArtifactBuilder
17
- } from "./index-665zp9rs.js";
17
+ } from "./index-nx64dz92.js";
18
18
 
19
19
  // pkgs/@akanjs/devkit/mobile/desktopBin.ts
20
20
  import { chmod, mkdir, rename, rm, writeFile } from "fs/promises";
@@ -1,12 +1,12 @@
1
1
  // @bun
2
2
  import {
3
3
  script
4
- } from "./index-jw1zm273.js";
4
+ } from "./index-vkb9m4z7.js";
5
5
  import {
6
6
  AppExecutor,
7
7
  LibExecutor,
8
8
  ModuleExecutor
9
- } from "./index-va06nr10.js";
9
+ } from "./index-g6ax17x4.js";
10
10
  import {
11
11
  workflowStatus,
12
12
  compactDiagnostics,
@@ -41,10 +41,10 @@ import {
41
41
  hasSignalFactoryEntry,
42
42
  insertSignalFactoryEntry,
43
43
  addFieldUiPolicyForType
44
- } from "./index-trpasv9q.js";
44
+ } from "./index-033wne2j.js";
45
45
  import {
46
46
  ModuleScript
47
- } from "./index-fmzcs8v6.js";
47
+ } from "./index-p2r64bpa.js";
48
48
 
49
49
  // pkgs/@akanjs/cli/primitive/primitive.script.ts
50
50
  import { capitalize, lowerlize } from "akanjs/common";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  GlobalConfig,
4
4
  CloudApi
5
- } from "./index-cpb3nvma.js";
5
+ } from "./index-jrmzcp66.js";
6
6
 
7
7
  // pkgs/@akanjs/cli/tunnel/TunnelShare.ts
8
8
  import { TunnelAgent } from "akanjs/server/tunnel";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  DesktopBin,
4
4
  UpdatePackFolder
5
- } from "./index-g1mbppa9.js";
5
+ } from "./index-35m6bzm7.js";
6
6
  // pkgs/@akanjs/devkit/mobile/desktopServerStage.ts
7
7
  import { cp, mkdir, readdir, rm, writeFile } from "fs/promises";
8
8
  import path from "path";