@akanjs/cli 3.2.0-rc.2 → 3.2.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 (132) hide show
  1. package/.build-stamp +2 -1
  2. package/CodeAgent-faqv7t4g.js +11 -0
  3. package/{CodeTui-zyc7zaq6.js → CodeTui-vqck9tet.js} +822 -666
  4. package/README.ko.md +26 -1
  5. package/README.md +26 -1
  6. package/TunnelShare-bwe3ddv7.js +18 -0
  7. package/agent.command-p75jvgrd.js +56 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-020cyesq.js +11 -0
  10. package/{application.command-vb278qnq.js → application.command-ta2knqxm.js} +72 -34
  11. package/{applicationBuildRunner-bqbyeg84.js → applicationBuildRunner-gkh82j2b.js} +18 -13
  12. package/buildBatch.proc.js +26 -11
  13. package/{cloud.command-ca777ee2.js → cloud.command-v3jhfvm5.js} +31 -28
  14. package/cloud.script-be9s1432.js +35 -0
  15. package/{code.command-j08txqcd.js → code.command-mh7dh1st.js} +14 -9
  16. package/{context.command-2fa6egp9.js → context.command-1ycfjkdd.js} +28 -23
  17. package/context.runner-333jkz86.js +34 -0
  18. package/{dependencyScanner-78sq8m4q.js → dependencyScanner-ge10gb52.js} +2 -2
  19. package/{devTui-w38ch13a.js → devTui-rf374y2w.js} +1 -1
  20. package/{fileSys-zpvt5gtf.js → fileSys-q22646yc.js} +1 -1
  21. package/{guideline.command-w6yqpdec.js → guideline.command-w1grfwh7.js} +9 -4
  22. package/guidelines/agentRule/agentRule.instruction.md +17 -5
  23. package/guidelines/akanApi/akanApi.instruction.md +5 -3
  24. package/guidelines/conventions/core.md +23 -5
  25. package/guidelines/conventions/rules/app.md +4 -1
  26. package/guidelines/conventions/rules/page.md +5 -0
  27. package/guidelines/errorCodes/errorCodes.instruction.md +158 -0
  28. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  29. package/guidelines/mcpRule/mcpRule.instruction.md +86 -2
  30. package/guidelines/pageRule/pageRule.instruction.md +11 -1
  31. package/guidelines/runtimeRule/runtimeRule.instruction.md +7 -2
  32. package/guidelines/transportRule/transportRule.instruction.md +8 -1
  33. package/incrementalBuilder.proc.js +574 -410
  34. package/{index-c5ymqb05.js → index-013n6z7m.js} +12 -12
  35. package/{index-w15mg3km.js → index-0dm25wvf.js} +1 -1
  36. package/{index-8nbx607g.js → index-0hj82f9w.js} +136 -48
  37. package/{index-ebwkh7bt.js → index-1c0mjc2b.js} +25 -7
  38. package/{index-6h775rv3.js → index-1jk52ffq.js} +53 -12
  39. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  40. package/{index-ygrdw6jw.js → index-1pjwsh2g.js} +65 -8
  41. package/{index-cbcwxp5v.js → index-22g3jq43.js} +9 -7
  42. package/{index-466z5931.js → index-2d9nm03s.js} +580 -364
  43. package/{index-0fj9ra3q.js → index-2k6mve6a.js} +18 -11
  44. package/{index-qd7xn2bk.js → index-2ny1e95c.js} +2 -2
  45. package/{index-j7p0jgaq.js → index-52w4jb87.js} +6 -6
  46. package/{index-e22zedc2.js → index-5h888r6j.js} +3 -3
  47. package/{index-7kmbqp0b.js → index-6pxmcaq8.js} +1 -1
  48. package/{index-xa0289eg.js → index-6zb17wcm.js} +16 -9
  49. package/{index-qgazn58x.js → index-7a07tdap.js} +50 -38
  50. package/{index-m5sg5spm.js → index-7ehdht84.js} +565 -187
  51. package/{index-y725zb1a.js → index-7v7tvgt7.js} +196 -168
  52. package/{index-pq5rjkch.js → index-88s746ns.js} +7 -2
  53. package/{index-r0a604h4.js → index-99kjwyma.js} +1 -1
  54. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  55. package/{index-386canwe.js → index-9rv2zt48.js} +186 -121
  56. package/{index-wr9magsr.js → index-9zswcze5.js} +3 -3
  57. package/{index-xq97me1h.js → index-a41vv4cy.js} +811 -697
  58. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  59. package/{index-bdmgqzb5.js → index-bket1068.js} +58 -29
  60. package/{index-bns3wcpc.js → index-by2tvsq6.js} +1 -1
  61. package/{index-1cb9apzn.js → index-czf94w8c.js} +2 -2
  62. package/{index-65b6ms4c.js → index-d3178asw.js} +15 -11
  63. package/index-dss3ds74.js +127 -0
  64. package/{index-annxfpgz.js → index-eyfty8kk.js} +9 -9
  65. package/{index-ny2k80mv.js → index-ffa52fwf.js} +1 -1
  66. package/{index-8jpc5fqv.js → index-g7jgd4xs.js} +2 -2
  67. package/{index-abfbf01s.js → index-gwsesvqc.js} +2 -2
  68. package/{index-kcpk2d20.js → index-h1w4wqgd.js} +1474 -1139
  69. package/{index-j1hjb477.js → index-hp2c7xc2.js} +1 -1
  70. package/index-j4yvgfhr.js +70 -0
  71. package/{index-84c2pgak.js → index-jx2jcw1r.js} +89 -78
  72. package/{index-j6eeh5d7.js → index-knpm8sdm.js} +5 -5
  73. package/{index-2gees180.js → index-mpp4aas6.js} +62 -33
  74. package/index-na8r4a27.js +30 -0
  75. package/{index-0mqga3h9.js → index-nmxszh6x.js} +525 -440
  76. package/{index-35j83zkd.js → index-p5zh7pmc.js} +2 -2
  77. package/{index-20wvskt8.js → index-pt0agdck.js} +1 -1
  78. package/{index-htxck0pn.js → index-q444k260.js} +15 -10
  79. package/{index-wfmpxke3.js → index-qssq2d41.js} +2775 -3677
  80. package/{index-23860fej.js → index-rwgqba9p.js} +24 -9
  81. package/{index-v50xjbbe.js → index-t4d0ckde.js} +1 -1
  82. package/index-va90m8nd.js +25 -0
  83. package/index-vjbne22r.js +80 -0
  84. package/{index-djc5nxpy.js → index-w23tf30e.js} +6 -6
  85. package/{index-mvwvxgtd.js → index-wa01phm9.js} +289 -210
  86. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  87. package/{index-vbhx60x5.js → index-xwe7y0gf.js} +2140 -2165
  88. package/index-ze48c0vd.js +788 -0
  89. package/{index-dk4g0x0d.js → index-zttyg7tg.js} +27 -16
  90. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  91. package/index.js +29 -24
  92. package/libExecutor-tq994592.js +10 -0
  93. package/{library.command-8d03a0pq.js → library.command-x219mhcx.js} +9 -4
  94. package/{localRegistry.command-vyv5k6t0.js → localRegistry.command-4p17wa9t.js} +30 -24
  95. package/{module.command-vy3kg965.js → module.command-tjthnvvr.js} +17 -8
  96. package/{package.command-qjh13rs9.js → package.command-c6df2hxx.js} +13 -8
  97. package/package.json +2 -2
  98. package/{page.command-t0nx1jat.js → page.command-gf06paq2.js} +9 -4
  99. package/{pipeline.command-2yjeas7m.js → pipeline.command-y07dgj9b.js} +14 -8
  100. package/pkgExecutor-stde3yc3.js +10 -0
  101. package/{primitive.command-8vm49279.js → primitive.command-0enfygxn.js} +13 -8
  102. package/{projectTypecheck-s9hhe5sa.js → projectTypecheck-mk8wefvd.js} +2 -1
  103. package/{prompter-qrwx1p17.js → prompter-qyggfhqd.js} +2 -2
  104. package/{quality.command-v76fev72.js → quality.command-dkbdztad.js} +23 -16
  105. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  106. package/{repair.command-fp4m3w03.js → repair.command-g5vd95ax.js} +13 -8
  107. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  108. package/{scalar.command-hxe6try8.js → scalar.command-7909pg0d.js} +11 -6
  109. package/skills/akan-debug/SKILL.md +10 -3
  110. package/skills/akan-err/SKILL.md +7 -0
  111. package/skills/akan-mcp/SKILL.md +13 -2
  112. package/skills/akan-scaffold/SKILL.md +2 -2
  113. package/skills/akan-transport/SKILL.md +2 -0
  114. package/skills/akan-validate/SKILL.md +1 -0
  115. package/{subspace.command-q42n1844.js → subspace.command-at4jt1fb.js} +29 -23
  116. package/templates/biomeForm.ts +1 -1
  117. package/templates/env/_env.server.type.ts +1 -1
  118. package/templates/facetIndex/index.ts +2 -37
  119. package/templates/lib/sig.ts +0 -4
  120. package/templates/lib/useClient.ts +1 -1
  121. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  122. package/{tunnel.command-22g11n0x.js → tunnel.command-91h92dwr.js} +17 -12
  123. package/{typeChecker-s640r6c0.js → typeChecker-bfrd1n9n.js} +1 -1
  124. package/typecheck.proc.js +6 -3
  125. package/{verify.command-rx43bha1.js → verify.command-pzky05ts.js} +26 -20
  126. package/{workflow.command-yg0d8mmq.js → workflow.command-mqqe4n12.js} +37 -19
  127. package/{workspace.command-fcfztvn5.js → workspace.command-y4rznvhx.js} +64 -53
  128. package/CodeAgent-6cpjtj25.js +0 -11
  129. package/TunnelShare-zkfkrw8w.js +0 -14
  130. package/agent.command-kf1g3nh4.js +0 -51
  131. package/cloud.script-agpxzq6j.js +0 -30
  132. package/context.runner-ftv8373t.js +0 -29
@@ -102,15 +102,8 @@ class PreviewView2 {
102
102
  settleMs = 0
103
103
  } = {}) {
104
104
  const logs = [];
105
- const view = PreviewView2.#open({ width, height, engine, onConsole: (line) => logs.push(line) });
105
+ const view = await PreviewView2.#start(() => PreviewView2.#open({ width, height, engine, onConsole: (line) => logs.push(line) }), engine, { startTimeoutMs, timeoutMs });
106
106
  try {
107
- const startMs = PreviewView2.#stalled.has(engine) ? Math.min(startTimeoutMs, timeoutMs) : startTimeoutMs;
108
- const stalled = new Error(`Timed out starting the ${engine} browser after ${startMs / 1000} s.`);
109
- await PreviewView2.#within(view.navigate("about:blank"), Date.now() + startMs, stalled).then(() => PreviewView2.#stalled.delete(engine), (error) => {
110
- if (error === stalled)
111
- PreviewView2.#stalled.add(engine);
112
- throw error;
113
- });
114
107
  const deadline = Date.now() + timeoutMs;
115
108
  const within = (work, what) => PreviewView2.#within(work, deadline, new Error(`Timed out ${what} ${url}; the dev server may be rebuilding or stuck.`));
116
109
  let page = await PreviewView2.#load(view, url, settleMs, within);
@@ -136,6 +129,28 @@ class PreviewView2 {
136
129
  await view.close();
137
130
  }
138
131
  }
132
+ static async#start(open, engine, { startTimeoutMs, timeoutMs }) {
133
+ for (let attempt = 1;; attempt++) {
134
+ const startMs = PreviewView2.#stalled.has(engine) ? Math.min(startTimeoutMs, timeoutMs) : startTimeoutMs;
135
+ const stalled = new Error(`Timed out starting the ${engine} browser after ${startMs / 1000} s.`);
136
+ let view;
137
+ try {
138
+ view = open();
139
+ await PreviewView2.#within(view.navigate("about:blank"), Date.now() + startMs, stalled);
140
+ PreviewView2.#stalled.delete(engine);
141
+ return view;
142
+ } catch (error) {
143
+ await view?.close();
144
+ if (error === stalled)
145
+ PreviewView2.#stalled.add(engine);
146
+ else
147
+ PreviewView2.#stalled.delete(engine);
148
+ if (error === stalled || attempt > 1)
149
+ throw error;
150
+ await Bun.sleep(100);
151
+ }
152
+ }
153
+ }
139
154
  static async#load(view, url, settleMs, within) {
140
155
  await within(view.navigate(url), "loading");
141
156
  if (settleMs > 0)
@@ -228,7 +243,7 @@ var readPageExpression = `(() => {
228
243
  return { href: location.href, title: document.title, text, status, empty, pageErrors, domFindings };
229
244
  })()`;
230
245
 
231
- // pkgs/@akanjs/devkit/stripAnsi.ts
246
+ // pkgs/@akanjs/devkit/util/stripAnsi.ts
232
247
  var ansi = new RegExp(`${String.fromCharCode(27)}(?:[@-Z\\\\-_]|\\[[\\s\\S]*?[@-~])`, "g");
233
248
  var stripAnsi = (text) => text.replace(ansi, "");
234
249
 
@@ -95,7 +95,7 @@ var addFieldWorkflowSpec = {
95
95
  type: {
96
96
  type: "string",
97
97
  required: true,
98
- description: "Field type or scalar name. Use Int for integer fields or Float for decimal fields; do not use Number."
98
+ description: "Field type: a built-in or akanjs/base type, or a scalar or model of the target by class name, which apply imports. Use Int for integer fields or Float for decimal fields; do not use Number."
99
99
  },
100
100
  values: { type: "string-list", description: "Comma-separated enum values when type is enum." },
101
101
  default: {
@@ -0,0 +1,25 @@
1
+ // @bun
2
+ // pkgs/@akanjs/devkit/workflow/plainName.ts
3
+ var sysNamePattern = /^[a-z0-9][a-zA-Z0-9_-]*$/;
4
+ var identifierPattern = /^_{0,2}[a-zA-Z][a-zA-Z0-9_-]*$/;
5
+ var packageNamePattern = /^(@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/;
6
+ var isWorkflowSysName = (value) => typeof value === "string" && sysNamePattern.test(value);
7
+ var isWorkflowModuleName = (value) => typeof value === "string" && identifierPattern.test(value);
8
+ var plainNameProblem = (kind, name) => {
9
+ const isSys = kind === "app" || kind === "lib";
10
+ if (isSys ? isWorkflowSysName(name) : isWorkflowModuleName(name))
11
+ return null;
12
+ return `${JSON.stringify(name)} is no ${kind} name; use letters, digits, - and _, starting with ${isSys ? "a lowercase letter or digit" : "a letter"}`;
13
+ };
14
+ var assertPlainName = (kind, name) => {
15
+ const problem = plainNameProblem(kind, name);
16
+ if (problem)
17
+ throw new Error(problem);
18
+ };
19
+ var assertPackageName = (name) => {
20
+ if (packageNamePattern.test(name))
21
+ return;
22
+ throw new Error(`${JSON.stringify(name)} is no package name; use name or @scope/name, each of lowercase letters, digits, -, . and _, starting with a letter or digit`);
23
+ };
24
+
25
+ export { sysNamePattern, identifierPattern, isWorkflowSysName, isWorkflowModuleName, plainNameProblem, assertPlainName, assertPackageName };
@@ -0,0 +1,80 @@
1
+ // @bun
2
+ import {
3
+ execEmoji,
4
+ Executor
5
+ } from "./index-qssq2d41.js";
6
+ // pkgs/@akanjs/devkit/executors/moduleExecutor.ts
7
+ class ModuleExecutor extends Executor {
8
+ sys;
9
+ emoji = execEmoji.module;
10
+ constructor({ sys, name }) {
11
+ super(name, `${sys.workspace.workspaceRoot}/${sys.type}s/${sys.name}/lib/${name}`);
12
+ this.sys = sys;
13
+ }
14
+ static from(sysExecutor, name) {
15
+ return new ModuleExecutor({ sys: sysExecutor, name });
16
+ }
17
+ }
18
+ // pkgs/@akanjs/devkit/util/errorReport.ts
19
+ import { realpathSync } from "fs";
20
+ import path from "path";
21
+
22
+ class ErrorReport {
23
+ static shownNestedErrors = 20;
24
+ static format(error, workspaceRoot = process.cwd()) {
25
+ return ErrorReport.#format(error, workspaceRoot, []);
26
+ }
27
+ static #format(error, workspaceRoot, ancestors) {
28
+ if (ancestors.includes(error))
29
+ return "[circular]";
30
+ const chain = [...ancestors, error];
31
+ if (error instanceof AggregateError) {
32
+ const shown = error.errors.slice(0, ErrorReport.shownNestedErrors);
33
+ const hidden = error.errors.length - shown.length;
34
+ const nestedMessages = [
35
+ ...shown.map((nestedError, index) => ErrorReport.#format(nestedError, workspaceRoot, chain).trim() || `Unknown error ${index + 1}`),
36
+ ...hidden > 0 ? [`\u2026and ${hidden} more`] : []
37
+ ].map((message) => message.replace(/^/gm, " ")).join(`
38
+ `);
39
+ const message = nestedMessages ? `${error.message}
40
+ ${nestedMessages}` : error.message;
41
+ return `${message}${ErrorReport.#causeOf(error, workspaceRoot, chain)}`;
42
+ }
43
+ if (error instanceof Error)
44
+ return `${ErrorReport.#withLocation(error.message, error, workspaceRoot)}${ErrorReport.#causeOf(error, workspaceRoot, chain)}`;
45
+ if (typeof error === "object" && error !== null && "message" in error)
46
+ return ErrorReport.#withLocation(String(error.message), error, workspaceRoot);
47
+ return String(error);
48
+ }
49
+ static #causeOf(error, workspaceRoot, chain) {
50
+ return error.cause ? `
51
+ Caused by: ${ErrorReport.#format(error.cause, workspaceRoot, chain)}` : "";
52
+ }
53
+ static #withLocation(message, error, workspaceRoot) {
54
+ const { position } = error;
55
+ if (!position?.file)
56
+ return message;
57
+ const file = ErrorReport.#relativeToWorkspace(position.file, workspaceRoot);
58
+ const location = position.line > 0 ? `${file}:${position.line}:${position.column}` : file;
59
+ return message.includes(location) ? message : message.replace(/^.*/, (headline) => `${headline} (${location})`);
60
+ }
61
+ static #relativeToWorkspace(file, workspaceRoot) {
62
+ if (!path.isAbsolute(file))
63
+ return file;
64
+ for (const root of [workspaceRoot, ErrorReport.#realpathOf(workspaceRoot)]) {
65
+ const relative = path.relative(root, file);
66
+ if (!relative.startsWith(`..${path.sep}`) && !path.isAbsolute(relative))
67
+ return relative.replaceAll(path.sep, "/");
68
+ }
69
+ return file;
70
+ }
71
+ static #realpathOf(dir) {
72
+ try {
73
+ return realpathSync(dir);
74
+ } catch {
75
+ return dir;
76
+ }
77
+ }
78
+ }
79
+
80
+ export { ModuleExecutor, ErrorReport };
@@ -1,21 +1,21 @@
1
1
  // @bun
2
2
  import {
3
3
  binPlatforms,
4
- ServerEnvProfile,
5
- AkanAppConfig,
6
4
  Executor,
7
- WorkspaceExecutor
8
- } from "./index-wfmpxke3.js";
5
+ WorkspaceExecutor,
6
+ ServerEnvProfile,
7
+ AkanAppConfig
8
+ } from "./index-qssq2d41.js";
9
9
  import {
10
10
  resolveAppId,
11
11
  targetHtmlFilename
12
12
  } from "./index-m9jj544v.js";
13
13
  import {
14
14
  CsrArtifactBuilder
15
- } from "./index-wr9magsr.js";
15
+ } from "./index-9zswcze5.js";
16
16
  import {
17
17
  ExitCodeError
18
- } from "./index-386canwe.js";
18
+ } from "./index-9rv2zt48.js";
19
19
 
20
20
  // pkgs/@akanjs/devkit/mobile/desktopBin.ts
21
21
  import { chmod, mkdir, rename, rm, writeFile } from "fs/promises";