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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/.build-stamp +2 -1
  2. package/CodeAgent-c17abdbf.js +11 -0
  3. package/{CodeTui-wv9yf7eq.js → CodeTui-jed1nj82.js} +822 -666
  4. package/README.ko.md +26 -1
  5. package/README.md +26 -1
  6. package/TunnelShare-mbfcaqg0.js +18 -0
  7. package/agent.command-9whnc6vb.js +56 -0
  8. package/akanCode.js +12 -12
  9. package/appExecutor-020cyesq.js +11 -0
  10. package/{application.command-6515t682.js → application.command-4eqvyxkw.js} +77 -36
  11. package/{applicationBuildRunner-bqbyeg84.js → applicationBuildRunner-frtcrqfd.js} +18 -13
  12. package/buildBatch.proc.js +26 -11
  13. package/{cloud.command-32esk0v1.js → cloud.command-hbvmeezn.js} +31 -28
  14. package/cloud.script-9kmbr3d6.js +35 -0
  15. package/{code.command-xk7rwq2x.js → code.command-0ayrenk4.js} +14 -9
  16. package/{context.command-jwenkkf0.js → context.command-php852kf.js} +28 -23
  17. package/context.runner-nngmn7c0.js +34 -0
  18. package/{dependencyScanner-78sq8m4q.js → dependencyScanner-ge10gb52.js} +2 -2
  19. package/{devTui-cd03z4mx.js → devTui-rf374y2w.js} +1 -1
  20. package/{fileSys-zpvt5gtf.js → fileSys-q22646yc.js} +1 -1
  21. package/{guideline.command-w6yqpdec.js → guideline.command-w1grfwh7.js} +9 -4
  22. package/guidelines/agentRule/agentRule.instruction.md +29 -12
  23. package/guidelines/akanApi/akanApi.instruction.md +6 -4
  24. package/guidelines/conventions/core.md +23 -5
  25. package/guidelines/conventions/rules/app.md +4 -1
  26. package/guidelines/conventions/rules/page.md +5 -0
  27. package/guidelines/conventions/rules/ts.md +3 -3
  28. package/guidelines/errorCodes/errorCodes.instruction.md +164 -0
  29. package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
  30. package/guidelines/mcpRule/mcpRule.instruction.md +171 -2
  31. package/guidelines/pageRule/pageRule.instruction.md +15 -1
  32. package/guidelines/runtimeRule/runtimeRule.instruction.md +12 -6
  33. package/guidelines/transportRule/transportRule.instruction.md +8 -1
  34. package/incrementalBuilder.proc.js +574 -410
  35. package/{index-w15mg3km.js → index-0dm25wvf.js} +1 -1
  36. package/{index-xrmrvafh.js → index-0gaj78wn.js} +808 -694
  37. package/{index-j1hjb477.js → index-11d7nh8a.js} +1 -1
  38. package/{index-hj6w4ka1.js → index-1p81ecbz.js} +1 -1
  39. package/{index-ygrdw6jw.js → index-1pjwsh2g.js} +65 -8
  40. package/{index-43acpsc7.js → index-28nk8w3j.js} +12 -12
  41. package/{index-qd7xn2bk.js → index-2ny1e95c.js} +2 -2
  42. package/{index-8gm4yag8.js → index-42jhx2ya.js} +6 -6
  43. package/{index-2rqyrvcy.js → index-4st0hq72.js} +62 -33
  44. package/{index-bak9f2br.js → index-5d57kx0s.js} +15 -11
  45. package/{index-bdmgqzb5.js → index-6469101k.js} +58 -29
  46. package/{index-7kmbqp0b.js → index-6pxmcaq8.js} +1 -1
  47. package/{index-54s6knqe.js → index-6zb17wcm.js} +12 -10
  48. package/{index-0ba8nj4d.js → index-7bs463x7.js} +50 -38
  49. package/{index-y725zb1a.js → index-7v7tvgt7.js} +196 -168
  50. package/{index-r0a604h4.js → index-99kjwyma.js} +1 -1
  51. package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
  52. package/{index-386canwe.js → index-9rv2zt48.js} +186 -121
  53. package/{index-20wvskt8.js → index-9wab2ngg.js} +1 -1
  54. package/{index-2eym1yjb.js → index-9wjrwjgz.js} +288 -209
  55. package/{index-kcpk2d20.js → index-at6haq2x.js} +1474 -1139
  56. package/{index-6h775rv3.js → index-ba2xd32s.js} +53 -12
  57. package/{index-yf9wc28h.js → index-bejy9zyc.js} +1 -1
  58. package/{index-ngpt3zz3.js → index-bj8s07s7.js} +525 -440
  59. package/{index-bns3wcpc.js → index-by2tvsq6.js} +1 -1
  60. package/{index-vbhx60x5.js → index-cb91b6d8.js} +2140 -2165
  61. package/index-dss3ds74.js +127 -0
  62. package/{index-e22zedc2.js → index-f16kr6vj.js} +3 -3
  63. package/{index-ny2k80mv.js → index-ffa52fwf.js} +1 -1
  64. package/{index-djc5nxpy.js → index-fp5xf6ef.js} +6 -6
  65. package/{index-qrk06tfp.js → index-g45y5f3e.js} +2 -2
  66. package/{index-8jpc5fqv.js → index-g7jgd4xs.js} +2 -2
  67. package/index-j4yvgfhr.js +70 -0
  68. package/{index-ytpmk3pb.js → index-jgj31xvw.js} +18 -11
  69. package/{index-j6eeh5d7.js → index-knpm8sdm.js} +5 -5
  70. package/{index-s34v3y28.js → index-m3t28rt3.js} +11 -11
  71. package/{index-dpgywgeq.js → index-m5gg0wzv.js} +27 -16
  72. package/index-na8r4a27.js +30 -0
  73. package/{index-h0p6n4k1.js → index-nm7nt9vm.js} +3 -3
  74. package/{index-j4hkbzj6.js → index-p06kfhdf.js} +6 -6
  75. package/{index-35j83zkd.js → index-p5zh7pmc.js} +2 -2
  76. package/{index-cmg5ngqa.js → index-p7beqww9.js} +2 -2
  77. package/{index-zhkcab5a.js → index-prgvqqxe.js} +580 -364
  78. package/{index-wfmpxke3.js → index-qssq2d41.js} +2775 -3677
  79. package/{index-sc0g6zbm.js → index-rwgqba9p.js} +24 -11
  80. package/{index-zcdmnfrf.js → index-s3m89wt2.js} +9 -9
  81. package/{index-v50xjbbe.js → index-t4d0ckde.js} +1 -1
  82. package/{index-9p260r4e.js → index-trffs83s.js} +538 -250
  83. package/{index-ddk49ypz.js → index-v929w7j7.js} +133 -49
  84. package/index-va90m8nd.js +25 -0
  85. package/index-vjbne22r.js +80 -0
  86. package/{index-h7hehkw6.js → index-xczjdng6.js} +3 -1
  87. package/{index-39jz41jb.js → index-xs9a3ddt.js} +3 -3
  88. package/{index-84c2pgak.js → index-yvzm8mby.js} +94 -82
  89. package/{index-wr9magsr.js → index-yxkjsyx8.js} +3 -3
  90. package/index-ze48c0vd.js +788 -0
  91. package/{index-ygdbn9jn.js → index-zyb0ebm4.js} +1 -1
  92. package/index.js +29 -24
  93. package/libExecutor-tq994592.js +10 -0
  94. package/{library.command-qs8beggh.js → library.command-x219mhcx.js} +9 -4
  95. package/{localRegistry.command-hz4ged9n.js → localRegistry.command-zvdcejhn.js} +30 -24
  96. package/{module.command-z9js77m2.js → module.command-k6cwcm7g.js} +17 -8
  97. package/{package.command-zqenq8c0.js → package.command-vw7x09f8.js} +13 -8
  98. package/package.json +2 -2
  99. package/{page.command-t0nx1jat.js → page.command-gf06paq2.js} +9 -4
  100. package/{pipeline.command-2yjeas7m.js → pipeline.command-y07dgj9b.js} +14 -8
  101. package/pkgExecutor-stde3yc3.js +10 -0
  102. package/{primitive.command-v5kypwy4.js → primitive.command-edydvh07.js} +13 -8
  103. package/{projectTypecheck-s9hhe5sa.js → projectTypecheck-mk8wefvd.js} +2 -1
  104. package/{prompter-qrwx1p17.js → prompter-qyggfhqd.js} +2 -2
  105. package/{quality.command-q55j2htd.js → quality.command-mdb45vyr.js} +23 -16
  106. package/{recipeScanner-4b69ybe0.js → recipeScanner-rrx69awy.js} +1 -1
  107. package/{repair.command-7ssbbdq2.js → repair.command-kvtaeecy.js} +13 -8
  108. package/{routeSourceValidator-4h947v7c.js → routeSourceValidator-8n6j1vn7.js} +4 -2
  109. package/{scalar.command-p5jb7z57.js → scalar.command-sjt9p5e1.js} +11 -6
  110. package/skills/akan-debug/SKILL.md +10 -3
  111. package/skills/akan-err/SKILL.md +7 -0
  112. package/skills/akan-mcp/SKILL.md +17 -2
  113. package/skills/akan-scaffold/SKILL.md +2 -2
  114. package/skills/akan-transport/SKILL.md +2 -0
  115. package/skills/akan-validate/SKILL.md +1 -0
  116. package/{subspace.command-7wxy6ptj.js → subspace.command-mkkqync4.js} +29 -23
  117. package/templates/app/page/_layout.tsx +13 -0
  118. package/templates/app/page/styles.css.template +40 -0
  119. package/templates/appSample/page/_index.tsx +9 -9
  120. package/templates/appSample/page/_layout.tsx +1 -0
  121. package/templates/appSample/page/styles.css.template +40 -5
  122. package/templates/appSample/ui/Recipe/jellyButton.ts +1 -1
  123. package/templates/biomeForm.ts +1 -1
  124. package/templates/env/_env.server.type.ts +1 -1
  125. package/templates/facetIndex/index.ts +2 -37
  126. package/templates/lib/sig.ts +0 -4
  127. package/templates/lib/useClient.ts +1 -1
  128. package/templates/workspaceRoot/AGENTS.md.template +2 -1
  129. package/{tunnel.command-22g11n0x.js → tunnel.command-tr5b3030.js} +17 -12
  130. package/{typeChecker-s640r6c0.js → typeChecker-bfrd1n9n.js} +1 -1
  131. package/typecheck.proc.js +6 -3
  132. package/{verify.command-m0wnndd7.js → verify.command-0p9h8tpp.js} +26 -20
  133. package/{workflow.command-jx8dqs9n.js → workflow.command-9mfcwqzj.js} +37 -19
  134. package/{workspace.command-ca9kfyt3.js → workspace.command-5hjtmcfs.js} +61 -54
  135. package/CodeAgent-e9c712an.js +0 -11
  136. package/TunnelShare-zkfkrw8w.js +0 -14
  137. package/agent.command-9erafkcb.js +0 -51
  138. package/cloud.script-arsagnq6.js +0 -30
  139. package/context.runner-mqpp67br.js +0 -29
  140. package/index-x3x31df8.js +0 -14
  141. /package/templates/{appSample → app}/public/fonts/Pretendard-Bold.woff2 +0 -0
  142. /package/templates/{appSample → app}/public/fonts/Pretendard-Medium.woff2 +0 -0
  143. /package/templates/{appSample → app}/public/fonts/Pretendard-Regular.woff2 +0 -0
  144. /package/templates/{appSample → app}/public/fonts/Pretendard-SemiBold.woff2 +0 -0
@@ -2,21 +2,23 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-386canwe.js";
5
+ } from "./index-9rv2zt48.js";
6
6
  import {
7
- LibSource,
8
- formatLibStatuses,
9
7
  CommandExecutionError,
10
- LibExecutor
11
- } from "./index-wfmpxke3.js";
8
+ LibSource,
9
+ formatLibStatuses
10
+ } from "./index-qssq2d41.js";
11
+ import {
12
+ LibExecutor2
13
+ } from "./index-na8r4a27.js";
12
14
  import {
13
15
  assertPlainName
14
- } from "./index-x3x31df8.js";
16
+ } from "./index-va90m8nd.js";
15
17
 
16
18
  // pkgs/@akanjs/cli/library/library.script.ts
17
19
  import { Logger } from "akanjs/common";
18
20
 
19
- // pkgs/@akanjs/devkit/semver.ts
21
+ // pkgs/@akanjs/devkit/util/semver.ts
20
22
  var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
21
23
  var parseVersion = (version) => version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
22
24
  var compareNumeric = (a, b) => {
@@ -46,7 +48,7 @@ class LibraryRunner extends runner("library") {
46
48
  async createLibrary(libName, workspace) {
47
49
  await workspace.mkdir(`libs/${libName}`);
48
50
  await workspace.applyTemplate({ basePath: `libs/${libName}`, template: "libRoot", dict: { libName } });
49
- return LibExecutor.from(workspace, libName);
51
+ return LibExecutor2.from(workspace, libName);
50
52
  }
51
53
  async removeLibrary(lib) {
52
54
  await lib.workspace.removeDir(`libs/${lib.name}`);
@@ -102,7 +104,7 @@ class LibraryRunner extends runner("library") {
102
104
  const testingEnv = `libs/${libName}/env/env.server.testing.ts`;
103
105
  if (!await workspace.exists(testingEnv))
104
106
  await workspace.cp(`libs/${libName}/env/env.server.example.ts`, testingEnv);
105
- const lib = LibExecutor.from(workspace, libName);
107
+ const lib = LibExecutor2.from(workspace, libName);
106
108
  const stamp = await new LibSource(lib).write(source);
107
109
  if (await workspace.hasChanges())
108
110
  await workspace.commit(`Install ${libName} library from ${stamp.origin}`);
@@ -110,7 +112,7 @@ class LibraryRunner extends runner("library") {
110
112
  }
111
113
  async libraryStatuses(workspace) {
112
114
  const libNames = await workspace.getLibs();
113
- return await Promise.all(libNames.map((libName) => new LibSource(LibExecutor.from(workspace, libName)).status()));
115
+ return await Promise.all(libNames.map((libName) => new LibSource(LibExecutor2.from(workspace, libName)).status()));
114
116
  }
115
117
  async mergeLibraryDependencies(lib) {
116
118
  const [libPackageJson, rootPackageJson] = await Promise.all([lib.getPackageJson(), lib.workspace.getPackageJson()]);
@@ -1,54 +1,61 @@
1
1
  // @bun
2
2
  import {
3
3
  script
4
- } from "./index-386canwe.js";
4
+ } from "./index-9rv2zt48.js";
5
5
  import {
6
- AppExecutor,
7
- LibExecutor,
8
- ModuleExecutor
9
- } from "./index-wfmpxke3.js";
6
+ AppExecutor2
7
+ } from "./index-ze48c0vd.js";
8
+ import {
9
+ LibExecutor2
10
+ } from "./index-na8r4a27.js";
10
11
  import {
11
12
  InteractionScaffold,
12
13
  workflowStatus,
13
14
  compactDiagnostics,
14
15
  generatedFilePathsForTarget,
15
- sourceFile,
16
- moduleComponentName,
17
- moduleSourcePaths,
18
- generatedFilesForSync,
19
- validationCommandsForTarget,
20
- nextActionsForTarget,
21
- createPrimitiveWriteReport,
22
- normalizeFieldType,
16
+ hasSourceParseErrors,
23
17
  ensureNamedImport,
24
18
  ensureBaseImport,
25
- ensureBaseTypeImport,
26
- coerceFieldDefault,
27
- fieldExpression,
19
+ ensureEnumImport,
20
+ ensureConstantTypeImport,
28
21
  viaBuilderParameterName,
29
22
  insertIntoObject,
30
23
  insertLightProjectionField,
31
- insertTemplateField,
32
- ensureEnumImport,
33
24
  insertEnumClass,
34
- insertDictionaryModelField,
35
25
  hasConstantInputField,
26
+ insertDictionaryModelField,
36
27
  hasDictionaryModelField,
37
- ensureConstantTypeImport,
38
28
  insertDictionaryEnum,
29
+ normalizeFieldType,
30
+ coerceFieldDefault,
31
+ fieldExpression,
39
32
  parseValues,
40
- hasSourceParseErrors,
33
+ moduleComponentName,
34
+ moduleSourcePaths,
35
+ addFieldUiPolicyForType,
36
+ withFieldTypeImport,
37
+ KeyRename,
41
38
  hasClassMethod,
42
39
  insertClassMethod,
43
40
  hasSignalFactoryEntry,
44
41
  insertSignalFactoryEntry,
45
- addFieldUiPolicyForType,
46
- KeyRename,
47
- MutationScaffold
48
- } from "./index-xrmrvafh.js";
42
+ MutationScaffold,
43
+ sourceFile,
44
+ generatedFilesForSync,
45
+ validationCommandsForTarget,
46
+ nextActionsForTarget,
47
+ createPrimitiveWriteReport,
48
+ insertTemplateField
49
+ } from "./index-0gaj78wn.js";
49
50
  import {
50
51
  ModuleScript
51
- } from "./index-s34v3y28.js";
52
+ } from "./index-m3t28rt3.js";
53
+ import {
54
+ plainNameProblem
55
+ } from "./index-va90m8nd.js";
56
+ import {
57
+ ModuleExecutor
58
+ } from "./index-vjbne22r.js";
52
59
 
53
60
  // pkgs/@akanjs/cli/primitive/primitive.script.ts
54
61
  import { capitalize, lowerlize } from "akanjs/common";
@@ -58,18 +65,16 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
58
65
  return null;
59
66
  const [apps, libs] = await workspace.getSyss();
60
67
  if (apps.includes(target))
61
- return AppExecutor.from(workspace, target);
68
+ return AppExecutor2.from(workspace, target);
62
69
  if (libs.includes(target))
63
- return LibExecutor.from(workspace, target);
70
+ return LibExecutor2.from(workspace, target);
64
71
  return null;
65
72
  }
66
73
  async createUi(workspace, input) {
67
74
  const sys = await this.resolveSys(workspace, input.app);
68
- if (!sys || !input.module)
69
- return PrimitiveScript.#refuse("create-ui", compactDiagnostics([
70
- !sys && PrimitiveScript.#targetMissing(),
71
- !input.module && PrimitiveScript.#inputMissing("module")
72
- ]));
75
+ const moduleProblem = PrimitiveScript.#moduleProblem(input.module);
76
+ if (!sys || !input.module || moduleProblem)
77
+ return PrimitiveScript.#refuse("create-ui", compactDiagnostics([!sys && PrimitiveScript.#targetMissing(), moduleProblem]));
73
78
  const mod = ModuleExecutor.from(sys, input.module);
74
79
  if (input.surface === "view")
75
80
  return await this.moduleScript.createView(mod);
@@ -91,7 +96,7 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
91
96
  const normalizedType = input.type ? normalizeFieldType(input.type) : null;
92
97
  const diagnostics = compactDiagnostics([
93
98
  !sys && PrimitiveScript.#targetMissing(),
94
- !input.module && PrimitiveScript.#inputMissing("module"),
99
+ PrimitiveScript.#moduleProblem(input.module),
95
100
  !input.field && PrimitiveScript.#inputMissing("field"),
96
101
  !input.type && PrimitiveScript.#inputMissing("type"),
97
102
  enumValues?.length === 0 && PrimitiveScript.#inputMissing("values", "Enum values are required."),
@@ -157,7 +162,7 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
157
162
  const defaultCoercion = coerceFieldDefault(input.type, input.defaultValue);
158
163
  if (defaultCoercion.diagnostic)
159
164
  diagnostics.push(defaultCoercion.diagnostic);
160
- constantContent = ensureBaseTypeImport(constantContent, input.type);
165
+ constantContent = await withFieldTypeImport(sys, input.module, input.type, constantContent, diagnostics);
161
166
  if (input.type === "Date" && defaultCoercion.expression)
162
167
  constantContent = ensureBaseImport(constantContent, "dayjs");
163
168
  }
@@ -451,13 +456,14 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
451
456
  });
452
457
  }
453
458
  static #report(command, sys, changedFiles, diagnostics) {
459
+ const failed = workflowStatus(diagnostics) === "failed";
454
460
  return createPrimitiveWriteReport({
455
461
  command,
456
462
  changedFiles,
457
- generatedFiles: generatedFilesForSync(sys),
458
- validationCommands: validationCommandsForTarget(sys.name),
463
+ generatedFiles: failed ? [] : generatedFilesForSync(sys),
464
+ validationCommands: failed ? [] : validationCommandsForTarget(sys.name),
459
465
  diagnostics,
460
- nextActions: nextActionsForTarget(sys.name)
466
+ nextActions: failed ? [] : nextActionsForTarget(sys.name)
461
467
  });
462
468
  }
463
469
  static #targetMissing() {
@@ -466,6 +472,12 @@ class PrimitiveScript extends script("primitive", [ModuleScript]) {
466
472
  static #inputMissing(input, message = `${capitalize(input)} is required.`) {
467
473
  return { severity: "error", code: "primitive-input-missing", message, input };
468
474
  }
475
+ static #moduleProblem(module) {
476
+ if (!module)
477
+ return PrimitiveScript.#inputMissing("module");
478
+ const message = plainNameProblem("module", module);
479
+ return message ? { severity: "error", code: "primitive-input-invalid", message, input: "module" } : null;
480
+ }
469
481
  static #sourceMissing(kind, path) {
470
482
  return {
471
483
  severity: "error",