@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
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  JsonFormatter
4
- } from "./index-wfmpxke3.js";
4
+ } from "./index-qssq2d41.js";
5
5
 
6
- // pkgs/@akanjs/devkit/maintainabilityBaseline.ts
6
+ // pkgs/@akanjs/devkit/quality/maintainabilityBaseline.ts
7
7
  class MaintainabilityBaseline {
8
8
  sections;
9
9
  reasons;
@@ -19,8 +19,12 @@ class MaintainabilityBaseline {
19
19
  "akan.store.root-write-chain",
20
20
  "akan.component.write-chain",
21
21
  "akan.write.placement",
22
- "akan.service.call-in-loop"
22
+ "akan.service.call-in-loop",
23
+ "akan.error.bare-error"
23
24
  ];
25
+ static lateRules = new Set(["akan.error.bare-error"]);
26
+ static totalRules = new Set(["akan.error.bare-error"]);
27
+ static totalKey = "(total)";
24
28
  static reasonedRules = new Set([
25
29
  "akan.size.file",
26
30
  "akan.size.component",
@@ -40,6 +44,8 @@ class MaintainabilityBaseline {
40
44
  return violation.writeCount;
41
45
  if (violation.kind === "writePlacement")
42
46
  return violation.writes.length;
47
+ if (violation.kind === "bareError")
48
+ return violation.lines.length;
43
49
  return violation.calls.length;
44
50
  }
45
51
  static isDebtRule(name) {
@@ -97,6 +103,21 @@ class MaintainabilityBaseline {
97
103
  const recorded = this.recordedOf(violation);
98
104
  return recorded !== undefined && MaintainabilityBaseline.countOf(violation) <= recorded;
99
105
  }
106
+ unallowed(violations) {
107
+ const measured = MaintainabilityBaseline.of(violations);
108
+ return violations.filter((violation) => !(MaintainabilityBaseline.totalRules.has(violation.rule) && measured.totalOf(violation.rule) <= this.totalOf(violation.rule)) && !this.allows(violation));
109
+ }
110
+ staleTotals(violations) {
111
+ const measured = MaintainabilityBaseline.of(violations);
112
+ return [...MaintainabilityBaseline.totalRules].flatMap((rule) => {
113
+ const count = measured.totalOf(rule);
114
+ const recorded = this.totalOf(rule);
115
+ return count < recorded ? [{ rule, count, recorded }] : [];
116
+ });
117
+ }
118
+ totalOf(rule) {
119
+ return [...this.sections.get(rule)?.values() ?? []].reduce((sum, count) => sum + count, 0);
120
+ }
100
121
  recordedOf(violation) {
101
122
  return this.sections.get(violation.rule)?.get(violation.key);
102
123
  }
@@ -114,19 +135,55 @@ class MaintainabilityBaseline {
114
135
  }))
115
136
  ]));
116
137
  }
138
+ rulesOutside(other) {
139
+ return [...this.sections].filter(([rule, counts]) => counts.size && (other === null || MaintainabilityBaseline.lateRules.has(rule) && !other.sections.has(rule))).map(([rule]) => rule);
140
+ }
141
+ withSectionsOf(other, rules) {
142
+ if (!other)
143
+ return this;
144
+ const sections = new Map(this.sections);
145
+ for (const rule of rules)
146
+ sections.set(rule, other.sections.get(rule) ?? new Map);
147
+ return new MaintainabilityBaseline(sections, this.reasons);
148
+ }
149
+ movedBy(moves) {
150
+ if (!moves.size)
151
+ return this;
152
+ const movedKey = (key) => {
153
+ const file = key.split("#", 1)[0] ?? key;
154
+ const to = moves.get(file);
155
+ return to === undefined ? key : `${to}${key.slice(file.length)}`;
156
+ };
157
+ const sections = new Map([...this.sections].map(([rule, counts]) => {
158
+ const moved = new Map;
159
+ for (const [key, count] of counts) {
160
+ const to = movedKey(key);
161
+ moved.set(to, Math.max(moved.get(to) ?? 0, count));
162
+ }
163
+ return [rule, moved];
164
+ }));
165
+ return new MaintainabilityBaseline(sections, new Map([...this.reasons].map(([key, reason]) => [movedKey(key), reason])));
166
+ }
117
167
  tightenedBy(violations) {
118
168
  const current = MaintainabilityBaseline.of(violations);
119
- const sections = new Map([...this.sections].map(([rule, counts]) => [
120
- rule,
121
- MaintainabilityBaseline.#lowered(counts, current.sections.get(rule) ?? new Map)
122
- ]));
169
+ const sections = new Map([...this.sections].map(([rule, counts]) => {
170
+ const measured = current.sections.get(rule) ?? new Map;
171
+ if (!MaintainabilityBaseline.totalRules.has(rule))
172
+ return [rule, MaintainabilityBaseline.#lowered(counts, measured)];
173
+ return [rule, current.totalOf(rule) > this.totalOf(rule) ? counts : measured];
174
+ }));
123
175
  return new MaintainabilityBaseline(sections).#withReasonsOf(this.reasons);
124
176
  }
125
177
  #withReasonsOf(reasons) {
126
178
  return new MaintainabilityBaseline(this.sections, new Map([...reasons].filter(([key]) => this.#holdsReasoned(key))));
127
179
  }
128
180
  grownFrom(committed) {
129
- return [...this.sections].flatMap(([rule, counts]) => MaintainabilityBaseline.#raised(counts, committed.sections.get(rule) ?? new Map).filter(([key]) => !(MaintainabilityBaseline.reasonedRules.has(rule) && this.reasonOf(key))).map(([key, count, recorded]) => ({ rule, key, count, committed: recorded })));
181
+ return [...this.sections].flatMap(([rule, counts]) => MaintainabilityBaseline.totalRules.has(rule) ? this.#totalGrownFrom(committed, rule) : MaintainabilityBaseline.#raised(counts, committed.sections.get(rule) ?? new Map).filter(([key]) => !(MaintainabilityBaseline.reasonedRules.has(rule) && this.reasonOf(key))).map(([key, count, recorded]) => ({ rule, key, count, committed: recorded })));
182
+ }
183
+ #totalGrownFrom(committed, rule) {
184
+ const count = this.totalOf(rule);
185
+ const recorded = committed.sections.has(rule) ? committed.totalOf(rule) : undefined;
186
+ return count > (recorded ?? 0) ? [{ rule, key: MaintainabilityBaseline.totalKey, count, committed: recorded }] : [];
130
187
  }
131
188
  stringify() {
132
189
  const sections = MaintainabilityBaseline.debtRules.flatMap((rule) => {
@@ -1,19 +1,21 @@
1
1
  // @bun
2
2
  import {
3
- AkanContextAnalyzer
4
- } from "./index-0mqga3h9.js";
3
+ runner
4
+ } from "./index-9rv2zt48.js";
5
5
  import {
6
6
  writeWorkflowRunArtifact,
7
7
  generatedFilePathsForTarget,
8
8
  writeGeneratedSyncState,
9
9
  createRepairReport,
10
- isWorkflowSysName,
11
- isWorkflowModuleName,
12
10
  renderRepairReport
13
- } from "./index-xq97me1h.js";
11
+ } from "./index-a41vv4cy.js";
14
12
  import {
15
- runner
16
- } from "./index-386canwe.js";
13
+ AkanContextAnalyzer
14
+ } from "./index-nmxszh6x.js";
15
+ import {
16
+ isWorkflowSysName,
17
+ isWorkflowModuleName
18
+ } from "./index-va90m8nd.js";
17
19
 
18
20
  // pkgs/@akanjs/cli/repair/repair.runner.ts
19
21
  var akanArgPattern = /^(?:--?[a-z][a-zA-Z0-9-]*|[A-Za-z0-9@_][A-Za-z0-9@._/:,=-]*)$/;