@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
@@ -0,0 +1,127 @@
1
+ // @bun
2
+ import {
3
+ execEmoji,
4
+ Executor,
5
+ PkgInfo,
6
+ WorkspaceExecutor
7
+ } from "./index-qssq2d41.js";
8
+
9
+ // pkgs/@akanjs/devkit/executors/pkgExecutor.ts
10
+ import path from "path";
11
+ class PkgExecutor2 extends Executor {
12
+ workspace;
13
+ name;
14
+ dist;
15
+ emoji = execEmoji.pkg;
16
+ constructor({ workspace = WorkspaceExecutor.fromRoot(), name }) {
17
+ super(name, `${workspace.workspaceRoot}/pkgs/${name}`);
18
+ this.workspace = workspace;
19
+ this.name = name;
20
+ this.dist = new Executor(`dist/${name}`, `${this.workspace.workspaceRoot}/dist/pkgs/${name}`);
21
+ }
22
+ static from(executor, name) {
23
+ return new PkgExecutor2({ workspace: executor instanceof WorkspaceExecutor ? executor : executor.workspace, name });
24
+ }
25
+ #scanInfo = null;
26
+ async scan({ refresh } = {}) {
27
+ if (this.#scanInfo && !refresh)
28
+ return this.#scanInfo;
29
+ const scanInfo = await PkgInfo.fromExecutor(this, { refresh });
30
+ this.#scanInfo = scanInfo;
31
+ return scanInfo;
32
+ }
33
+ async#getDependencyVersion(rootPackageJson, dep) {
34
+ const rootDeps = {
35
+ ...rootPackageJson.dependencies,
36
+ ...rootPackageJson.devDependencies
37
+ };
38
+ const rootVersion = rootDeps[dep];
39
+ if (rootVersion)
40
+ return rootVersion;
41
+ const overrideVersion = rootPackageJson.overrides?.[dep];
42
+ if (typeof overrideVersion === "string")
43
+ return overrideVersion;
44
+ try {
45
+ const packageJsonPath = `pkgs/${dep}/package.json`;
46
+ if (!await Bun.file(path.join(this.workspace.workspaceRoot, packageJsonPath)).exists())
47
+ return;
48
+ const packageJson = await this.workspace.readJson(packageJsonPath);
49
+ if (packageJson.name === dep)
50
+ return packageJson.version;
51
+ } catch {
52
+ return;
53
+ }
54
+ }
55
+ async#toDependencyMap(rootPackageJson, dependencies = [], devDependencies = []) {
56
+ const dependencyNames = [...new Set(dependencies)].sort();
57
+ const devDependencyNames = [...new Set(devDependencies)].filter((dep) => !dependencyNames.includes(dep)).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
58
+ const dependencyVersions = new Map;
59
+ const missingDeps = [];
60
+ for (const dep of [...dependencyNames, ...devDependencyNames]) {
61
+ const version = await this.#getDependencyVersion(rootPackageJson, dep);
62
+ if (version)
63
+ dependencyVersions.set(dep, version);
64
+ else
65
+ missingDeps.push(dep);
66
+ }
67
+ if (missingDeps.length > 0)
68
+ throw new Error(`Missing dependency versions in root package.json: ${missingDeps.join(", ")}`);
69
+ const toDependencyMap = (names) => Object.fromEntries(names.map((dep) => [dep, dependencyVersions.get(dep)]));
70
+ return { dependencies: toDependencyMap(dependencyNames), devDependencies: toDependencyMap(devDependencyNames) };
71
+ }
72
+ async updatePackageJsonDependencies(dependencies = [], devDependencies = []) {
73
+ const [rootPackageJson, pkgJson] = await Promise.all([this.workspace.getPackageJson(), this.getPackageJson()]);
74
+ const dependencyMaps = await this.#toDependencyMap(rootPackageJson, dependencies, devDependencies);
75
+ const newPkgJson = {
76
+ ...pkgJson,
77
+ ...dependencyMaps
78
+ };
79
+ await this.writeJson("package.json", newPkgJson);
80
+ return newPkgJson;
81
+ }
82
+ async generateDistPackageJson(dependencies = [], devDependencies = []) {
83
+ const [rootPackageJson, pkgJson] = await Promise.all([this.workspace.getPackageJson(), this.getPackageJson()]);
84
+ const dependencyMaps = await this.#toDependencyMap(rootPackageJson, dependencies, devDependencies);
85
+ const distPkgJson = {
86
+ ...pkgJson,
87
+ type: "module",
88
+ exports: {
89
+ ...pkgJson.exports,
90
+ ".": {
91
+ import: "./index.ts",
92
+ types: "./index.ts",
93
+ default: "./index.ts"
94
+ }
95
+ },
96
+ engines: { bun: ">=1.4.4" },
97
+ ...dependencyMaps
98
+ };
99
+ await Promise.all([this.dist.writeJson("package.json", distPkgJson), this.writeJson("package.json", distPkgJson)]);
100
+ return distPkgJson;
101
+ }
102
+ async build() {
103
+ await Bun.build({
104
+ root: this.cwdPath,
105
+ entrypoints: [`${this.cwdPath}/index.ts`],
106
+ splitting: false,
107
+ target: "bun"
108
+ });
109
+ await this.cp(`${this.cwdPath}/dist`, this.dist.cwdPath);
110
+ }
111
+ async generateTsconfigJson() {
112
+ const [rootTsconfig, pkgTsconfig] = await Promise.all([this.workspace.getTsConfig(), this.getTsConfig()]);
113
+ const tsconfig = {
114
+ ...rootTsconfig,
115
+ ...pkgTsconfig,
116
+ compilerOptions: {
117
+ ...rootTsconfig.compilerOptions,
118
+ ...pkgTsconfig.compilerOptions,
119
+ paths: {}
120
+ }
121
+ };
122
+ await this.dist.writeJson("tsconfig.json", tsconfig);
123
+ return tsconfig;
124
+ }
125
+ }
126
+
127
+ export { PkgExecutor2 };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  FileSys2
4
- } from "./index-bns3wcpc.js";
4
+ } from "./index-by2tvsq6.js";
5
5
  import {
6
6
  resolveMobileTargets
7
7
  } from "./index-m9jj544v.js";
@@ -9,10 +9,10 @@ import {
9
9
  UpdatePackFolder,
10
10
  NativePublicEnv,
11
11
  NativeApp
12
- } from "./index-djc5nxpy.js";
12
+ } from "./index-fp5xf6ef.js";
13
13
  import {
14
14
  ExitCodeError
15
- } from "./index-386canwe.js";
15
+ } from "./index-9rv2zt48.js";
16
16
  import {
17
17
  ConfigLock
18
18
  } from "./index-bqbf654f.js";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ShellOnlyEnv
4
- } from "./index-yf9wc28h.js";
4
+ } from "./index-bejy9zyc.js";
5
5
 
6
6
  // pkgs/@akanjs/cli/npmRegistry.ts
7
7
  import { Logger } from "akanjs/common";
@@ -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-yxkjsyx8.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";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  akanCodePaths2
4
- } from "./index-35j83zkd.js";
4
+ } from "./index-p5zh7pmc.js";
5
5
  import {
6
6
  ConfigLock
7
7
  } from "./index-bqbf654f.js";
@@ -157,7 +157,7 @@ class SubagentPool2 {
157
157
  }
158
158
  }
159
159
  async#run(id, kind, prompt, signal) {
160
- const { CodeAgent } = await import("./CodeAgent-e9c712an.js");
160
+ const { CodeAgent } = await import("./CodeAgent-c17abdbf.js");
161
161
  const budget = this.#options.parent.tools.subagent;
162
162
  const child = SubagentPool2.childOf(this.#options.parent, kind);
163
163
  const model = this.#options.model?.();
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  AppInfo
4
- } from "./index-wfmpxke3.js";
4
+ } from "./index-qssq2d41.js";
5
5
 
6
- // pkgs/@akanjs/devkit/slicePlanner.ts
6
+ // pkgs/@akanjs/devkit/workspace/slicePlanner.ts
7
7
  class SlicePlanner {
8
8
  static memberDirs = ["apps", "libs", "pkgs"];
9
9
  static toolchainDependencies = [
@@ -0,0 +1,70 @@
1
+ // @bun
2
+ // pkgs/@akanjs/devkit/commandDecorators/cliError.ts
3
+ import { AkanError } from "akanjs/base";
4
+
5
+ class CliError extends AkanError {
6
+ static exitCodes = {
7
+ failed: 1,
8
+ usage: 2,
9
+ unknownTarget: 2,
10
+ refused: 2,
11
+ checkFailed: 3,
12
+ interrupted: 130
13
+ };
14
+ static usageCodes = ["usage", "unknownTarget"];
15
+ exitCode;
16
+ constructor(code, message, { exitCode, cause } = {}) {
17
+ super(code, message, { cause });
18
+ this.exitCode = exitCode ?? CliError.#exitCodeOfCode(code) ?? 1;
19
+ }
20
+ static failureCodeOf(error) {
21
+ if (AkanError.is(error))
22
+ return error.code;
23
+ return CliError.#isPromptExit(error) ? "interrupted" : "failed";
24
+ }
25
+ static exitCodeOf(error) {
26
+ if (error instanceof CliError)
27
+ return error.exitCode;
28
+ const code = CliError.failureCodeOf(error);
29
+ return code === "failed" ? null : CliError.#exitCodeOfCode(code);
30
+ }
31
+ static messageOf(error) {
32
+ if (error instanceof Error)
33
+ return error.message || error.name;
34
+ if (typeof error === "string")
35
+ return error.trim() || "Unknown error";
36
+ if (error === null || error === undefined)
37
+ return "Unknown error";
38
+ try {
39
+ const json = JSON.stringify(error);
40
+ if (json)
41
+ return json;
42
+ } catch {
43
+ return String(error);
44
+ }
45
+ return String(error) || "Unknown error";
46
+ }
47
+ static failureOf(error) {
48
+ return { ok: false, error: CliError.messageOf(error), code: CliError.failureCodeOf(error) };
49
+ }
50
+ static #exitCodeOfCode(code) {
51
+ return Object.hasOwn(CliError.exitCodes, code) ? CliError.exitCodes[code] : null;
52
+ }
53
+ static #isPromptExit(error) {
54
+ return error instanceof Error && error.name === "ExitPromptError";
55
+ }
56
+ }
57
+
58
+ // pkgs/@akanjs/devkit/typecheck/typecheckFailure.ts
59
+ class TypecheckFailure extends CliError {
60
+ records;
61
+ static workerExitCode = 3;
62
+ constructor(records) {
63
+ super("checkFailed", records.slice(0, 20).map((record) => `${record.file ?? "-"}:${record.line}:${record.col} ${record.code} ${record.message}`).join(`
64
+ `) || "Typecheck failed");
65
+ this.records = records;
66
+ this.name = "TypecheckFailure";
67
+ }
68
+ }
69
+
70
+ export { CliError, TypecheckFailure };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AkanCodeEnv,
4
4
  akanCodePaths2
5
- } from "./index-35j83zkd.js";
5
+ } from "./index-p5zh7pmc.js";
6
6
  import {
7
7
  akanCodeDefaultModel2,
8
8
  akanCodeModel2,
@@ -10,16 +10,16 @@ import {
10
10
  akanCodeModelWarnings2,
11
11
  McpServerConfig,
12
12
  WorkspaceTrust
13
- } from "./index-w15mg3km.js";
13
+ } from "./index-0dm25wvf.js";
14
14
  import {
15
15
  PreviewView2,
16
16
  stripAnsi
17
- } from "./index-sc0g6zbm.js";
17
+ } from "./index-rwgqba9p.js";
18
18
  import {
19
19
  SubagentPool2,
20
20
  McpSignIn,
21
21
  AkanCodeCompaction2
22
- } from "./index-qrk06tfp.js";
22
+ } from "./index-g45y5f3e.js";
23
23
  import {
24
24
  codeAgentIsLoopback,
25
25
  codeAgentHostListed,
@@ -171,7 +171,7 @@ var akanSystemPrompt2 = (profile) => {
171
171
  lines.push(`- Some tool calls need the user's approval (policy: ${profile.approval}). A refusal is an answer; do not retry it a different way.`);
172
172
  if (profile.network.askOutside)
173
173
  lines.push("- `web_fetch` to a host outside a short list of documentation sites, and a shell command that reaches the network (`curl`, `wget`, `ssh`, \u2026), wait for the user's approval. A refusal is an answer; do not retry it a different way.");
174
- lines.push("- Secrets are refused at the tool boundary. If you need a value from `.env`, ask the user for it rather than looking for another way to read the file.", "", "## How to answer", "", "- Answer in as few words as carry the answer. A short question gets one sentence with no heading.", "- Do not open with what you are about to do, and do not close with a summary of what you did. The tool calls are already on the user's screen.", "- Skip headings, bold labels and bullet lists unless the answer is genuinely a list. Prose is shorter.", "- State a file as `path:line`. Do not paste a file back that the user can open.", "- Say what you could not do, and why, in one line. Do not offer alternatives nobody asked for.");
174
+ lines.push("- Secrets are refused at the tool boundary. If you need a value from `.env`, ask the user for it rather than looking for another way to read the file.", "", "## How to answer", "", "- Answer in as few words as carry the answer. A short question gets one sentence with no heading.", "- Do not open with what you are about to do, and do not retell the tool calls at the end; they are already on the user's screen. A turn that changed files closes with those files and what `akan_verify` said.", "- Skip headings, bold labels and bullet lists unless the answer is genuinely a list. Prose is shorter.", "- State a file as `path:line`. Do not paste a file back that the user can open.", "- Say what you could not do, and why, in one line. Do not offer alternatives nobody asked for.");
175
175
  return lines.join(`
176
176
  `);
177
177
  };
@@ -659,7 +659,7 @@ class AkanToolPack2 {
659
659
  return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
660
660
  }
661
661
  async names() {
662
- const { ContextRunner } = await import("./context.runner-mqpp67br.js");
662
+ const { ContextRunner } = await import("./context.runner-nngmn7c0.js");
663
663
  return [
664
664
  ...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
665
665
  AkanToolPack2.verifyToolName
@@ -667,7 +667,7 @@ class AkanToolPack2 {
667
667
  }
668
668
  static verifyToolName = "akan_verify";
669
669
  async#register(pi) {
670
- const { ContextRunner } = await import("./context.runner-mqpp67br.js");
670
+ const { ContextRunner } = await import("./context.runner-nngmn7c0.js");
671
671
  const runner = new ContextRunner;
672
672
  const guidelineNames = await AkanToolPack2.#guidelineNames();
673
673
  for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
@@ -705,7 +705,7 @@ class AkanToolPack2 {
705
705
  }
706
706
  static async#guidelineNames() {
707
707
  try {
708
- const { Prompter } = await import("./prompter-qrwx1p17.js");
708
+ const { Prompter } = await import("./prompter-qyggfhqd.js");
709
709
  return await Prompter.listGuidelines();
710
710
  } catch {
711
711
  return [];
@@ -854,6 +854,7 @@ import {
854
854
  import { Type as Type4 } from "typebox";
855
855
 
856
856
  // pkgs/@akanjs/devkit/codeAgent/tools/McpClient.ts
857
+ import { FailureCode, MCP_FAILURE_META } from "akanjs/common";
857
858
  var protocolVersion = "2025-06-18";
858
859
 
859
860
  class McpUnauthorized2 extends Error {
@@ -909,8 +910,14 @@ class McpClient2 {
909
910
  async callTool(name, args) {
910
911
  const response = await this.#call("tools/call", { name, arguments: args });
911
912
  if (response.error)
912
- return { text: response.error.message, isError: true };
913
- return { text: McpClient2.#renderContent(response.result?.content), isError: !!response.result?.isError };
913
+ return { text: response.error.message, isError: true, ...McpClient2.#coded(response.error.data) };
914
+ const isError = !!response.result?.isError;
915
+ const failure = isError ? response.result?._meta?.[MCP_FAILURE_META] : undefined;
916
+ return { text: McpClient2.#renderContent(response.result?.content), isError, ...McpClient2.#coded(failure) };
917
+ }
918
+ static #coded(carrier) {
919
+ const code = carrier && typeof carrier === "object" ? carrier.code : undefined;
920
+ return FailureCode.is(code) ? { code } : {};
914
921
  }
915
922
  close() {
916
923
  this.#proc?.kill();
@@ -1098,7 +1105,7 @@ class McpToolPack2 {
1098
1105
  const result = await this.#call(server, tool.name, params ?? {});
1099
1106
  return {
1100
1107
  content: [{ type: "text", text: codeAgentClip(result.text, codeAgentOutputChars) }],
1101
- details: undefined,
1108
+ details: result.code === undefined ? undefined : { code: result.code },
1102
1109
  isError: result.isError
1103
1110
  };
1104
1111
  }
@@ -1,9 +1,9 @@
1
1
  // @bun
2
2
  import {
3
3
  getDirname2
4
- } from "./index-bns3wcpc.js";
4
+ } from "./index-by2tvsq6.js";
5
5
 
6
- // pkgs/@akanjs/devkit/conventionSet.ts
6
+ // pkgs/@akanjs/devkit/guideline/conventionSet.ts
7
7
  import fsPromise from "fs/promises";
8
8
  import path from "path";
9
9
 
@@ -25,7 +25,7 @@ class ConventionSet {
25
25
  if (!match)
26
26
  throw new Error(`Convention rule ${name} has no frontmatter`);
27
27
  const front = match[1] ?? "";
28
- const described = /^description:\s*(.+)$/m.exec(front);
28
+ const described = /^description:(.*)$/m.exec(front);
29
29
  const description = described?.[1]?.trim() ?? "";
30
30
  const paths = [...front.matchAll(/^\s+-\s+"([^"]+)"$/gm)].map((entry) => entry[1] ?? "");
31
31
  if (!description || paths.length === 0)
@@ -61,13 +61,13 @@ class ConventionSet {
61
61
  }
62
62
  }
63
63
 
64
- // pkgs/@akanjs/devkit/prompter.ts
64
+ // pkgs/@akanjs/devkit/guideline/prompter.ts
65
65
  import fsPromise2 from "fs/promises";
66
66
  import { input, select } from "@inquirer/prompts";
67
67
  class Prompter2 {
68
68
  static async#getGuidelineRoot() {
69
69
  const dirname = getDirname2(import.meta.url);
70
- const candidates = [`${dirname}/guidelines`, `${dirname}/../cli/guidelines`];
70
+ const candidates = [`${dirname}/guidelines`, `${dirname}/../../cli/guidelines`];
71
71
  for (const candidate of candidates) {
72
72
  try {
73
73
  await fsPromise2.access(candidate);
@@ -2,27 +2,27 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-386canwe.js";
5
+ } from "./index-9rv2zt48.js";
6
6
  import {
7
- ModuleExecutor
8
- } from "./index-wfmpxke3.js";
9
- import {
10
- sourceFile,
7
+ bilingualLabelForField,
8
+ bilingualDescriptionForField,
11
9
  moduleSourcePaths,
10
+ sourceFile,
12
11
  generatedFilesForSync,
13
- createPassedPrimitiveReport,
14
- bilingualLabelForField,
15
- bilingualDescriptionForField
16
- } from "./index-xrmrvafh.js";
12
+ createPassedPrimitiveReport
13
+ } from "./index-0gaj78wn.js";
17
14
  import {
18
15
  PageScript
19
- } from "./index-7kmbqp0b.js";
16
+ } from "./index-6pxmcaq8.js";
20
17
  import {
21
18
  pluralizeName
22
19
  } from "./index-nz8prx9g.js";
23
20
  import {
24
21
  assertPlainName
25
- } from "./index-x3x31df8.js";
22
+ } from "./index-va90m8nd.js";
23
+ import {
24
+ ModuleExecutor
25
+ } from "./index-vjbne22r.js";
26
26
 
27
27
  // pkgs/@akanjs/cli/module/module.script.ts
28
28
  import { capitalize as capitalize2 } from "akanjs/common";
@@ -1,20 +1,28 @@
1
1
  // @bun
2
2
  import {
3
3
  ApplicationBuildReporter
4
- } from "./index-y725zb1a.js";
4
+ } from "./index-7v7tvgt7.js";
5
5
  import {
6
6
  parseBiomeReport,
7
7
  Linter,
8
- TypecheckFailure,
9
- ProjectTypecheck2,
10
- AppExecutor,
11
- LibExecutor,
12
- PkgExecutor
13
- } from "./index-wfmpxke3.js";
8
+ ProjectTypecheck2
9
+ } from "./index-qssq2d41.js";
10
+ import {
11
+ TypecheckFailure
12
+ } from "./index-j4yvgfhr.js";
13
+ import {
14
+ AppExecutor2
15
+ } from "./index-ze48c0vd.js";
16
+ import {
17
+ LibExecutor2
18
+ } from "./index-na8r4a27.js";
19
+ import {
20
+ PkgExecutor2
21
+ } from "./index-dss3ds74.js";
14
22
  import {
15
23
  WorkspaceRunner,
16
24
  AkanQualityScanner
17
- } from "./index-zhkcab5a.js";
25
+ } from "./index-prgvqqxe.js";
18
26
 
19
27
  // pkgs/@akanjs/cli/verify/verifyComments.ts
20
28
  import { existsSync } from "fs";
@@ -25,6 +33,7 @@ class VerifyComments {
25
33
  static fix = "keep only a fact the code cannot say (vendor quirk, constraint, security, domain meaning, rejected alternative); delete the rest";
26
34
  static #codeFile = /\.[cm]?[jt]sx?$/;
27
35
  static #directive = /^(\/\/\/?|\/\*+)\s*(biome-ignore|@ts-|eslint-|prettier-ignore|#region|#endregion|<reference|[#@]__PURE__|@__NO_SIDE_EFFECTS__)/;
36
+ static #trackedTodo = /^(\/\/|\/\*+)\s*TODO:?\s*https?:\/\/\S[^\n]*$/;
28
37
  static #typescriptLoad;
29
38
  static #templateCommentsLoad;
30
39
  static #loadTypescript() {
@@ -49,6 +58,8 @@ class VerifyComments {
49
58
  for (const comment of VerifyComments.commentsOf(typescript, file, text)) {
50
59
  if (VerifyComments.#directive.test(comment.text))
51
60
  continue;
61
+ if (VerifyComments.#trackedTodo.test(comment.text))
62
+ continue;
52
63
  if (VerifyComments.#scaffolded(comment, templateComments))
53
64
  continue;
54
65
  if (lines && !VerifyComments.#touches(comment, lines))
@@ -627,9 +638,9 @@ class VerifyPipeline {
627
638
  }
628
639
  async#sync(target) {
629
640
  if (target.type === "app")
630
- await AppExecutor.from(this.#workspace, target.name).scanSync();
641
+ await AppExecutor2.from(this.#workspace, target.name).scanSync();
631
642
  else
632
- await LibExecutor.from(this.#workspace, target.name).scan();
643
+ await LibExecutor2.from(this.#workspace, target.name).scan();
633
644
  return { diagnostics: [] };
634
645
  }
635
646
  async#lint(target, { comments, rewritten }) {
@@ -694,12 +705,12 @@ class VerifyPipeline {
694
705
  async#typecheck(target) {
695
706
  try {
696
707
  if (target.type === "app")
697
- await this.#applicationRunner.typecheck(AppExecutor.from(this.#workspace, target.name), {
708
+ await this.#applicationRunner.typecheck(AppExecutor2.from(this.#workspace, target.name), {
698
709
  tests: true,
699
710
  report: "records"
700
711
  });
701
712
  else if (target.type === "lib")
702
- await this.#applicationRunner.typecheckLibrary(LibExecutor.from(this.#workspace, target.name), {
713
+ await this.#applicationRunner.typecheckLibrary(LibExecutor2.from(this.#workspace, target.name), {
703
714
  tests: true,
704
715
  report: "records"
705
716
  });
@@ -717,7 +728,7 @@ class VerifyPipeline {
717
728
  }
718
729
  }
719
730
  async#build(target) {
720
- const { routeJsWarnings = [] } = await this.#applicationRunner.build(AppExecutor.from(this.#workspace, target.name), { fast: true });
731
+ const { routeJsWarnings = [] } = await this.#applicationRunner.build(AppExecutor2.from(this.#workspace, target.name), { fast: true });
721
732
  return { diagnostics: routeJsWarnings.map((warning) => VerifyDiagnostics.fromRouteJsBudget(warning)) };
722
733
  }
723
734
  async#ssr(scope) {
@@ -727,10 +738,10 @@ class VerifyPipeline {
727
738
  }
728
739
  #execOf(target) {
729
740
  if (target.type === "app")
730
- return AppExecutor.from(this.#workspace, target.name);
741
+ return AppExecutor2.from(this.#workspace, target.name);
731
742
  if (target.type === "lib")
732
- return LibExecutor.from(this.#workspace, target.name);
733
- return PkgExecutor.from(this.#workspace, target.name);
743
+ return LibExecutor2.from(this.#workspace, target.name);
744
+ return PkgExecutor2.from(this.#workspace, target.name);
734
745
  }
735
746
  }
736
747
 
@@ -0,0 +1,30 @@
1
+ // @bun
2
+ import {
3
+ execEmoji,
4
+ Executor,
5
+ SysExecutor,
6
+ WorkspaceExecutor,
7
+ AkanLibConfig
8
+ } from "./index-qssq2d41.js";
9
+
10
+ // pkgs/@akanjs/devkit/executors/libExecutor.ts
11
+ class LibExecutor2 extends SysExecutor {
12
+ dist;
13
+ emoji = execEmoji.lib;
14
+ constructor({ workspace, name }) {
15
+ super({ workspace, name, type: "lib" });
16
+ this.dist = new Executor(`dist/${name}`, `${this.workspace.workspaceRoot}/dist/libs/${name}`);
17
+ }
18
+ static from(executor, name) {
19
+ return new LibExecutor2({ workspace: executor instanceof WorkspaceExecutor ? executor : executor.workspace, name });
20
+ }
21
+ #akanConfig = null;
22
+ async getConfig({ refresh } = {}) {
23
+ if (this.#akanConfig && !refresh)
24
+ return this.#akanConfig;
25
+ this.#akanConfig = await AkanLibConfig.from(this, { bustImportCache: refresh });
26
+ return this.#akanConfig;
27
+ }
28
+ }
29
+
30
+ export { LibExecutor2 };
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-386canwe.js";
5
+ } from "./index-9rv2zt48.js";
6
6
  import {
7
7
  generatedFilesForSync,
8
8
  createPassedPrimitiveReport,
9
9
  scalarChangedFiles
10
- } from "./index-xrmrvafh.js";
10
+ } from "./index-0gaj78wn.js";
11
11
  import {
12
12
  pluralizeName
13
13
  } from "./index-nz8prx9g.js";
14
14
  import {
15
15
  assertPlainName
16
- } from "./index-x3x31df8.js";
16
+ } from "./index-va90m8nd.js";
17
17
 
18
18
  // pkgs/@akanjs/cli/scalar/scalar.runner.ts
19
19
  class ScalarRunner extends runner("scalar") {
@@ -1,16 +1,16 @@
1
1
  // @bun
2
2
  import {
3
- akanMcpInstallTargets
4
- } from "./index-ngpt3zz3.js";
3
+ script
4
+ } from "./index-9rv2zt48.js";
5
5
  import {
6
6
  jsonText
7
- } from "./index-xrmrvafh.js";
7
+ } from "./index-0gaj78wn.js";
8
8
  import {
9
- script
10
- } from "./index-386canwe.js";
9
+ akanMcpInstallTargets
10
+ } from "./index-bj8s07s7.js";
11
11
  import {
12
12
  ContextRunner2
13
- } from "./index-2eym1yjb.js";
13
+ } from "./index-9wjrwjgz.js";
14
14
 
15
15
  // pkgs/@akanjs/cli/context/context.script.ts
16
16
  import { Logger } from "akanjs/common";
@@ -1,10 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  FileSys2
4
- } from "./index-bns3wcpc.js";
4
+ } from "./index-by2tvsq6.js";
5
5
  import {
6
6
  ShellOnlyEnv
7
- } from "./index-yf9wc28h.js";
7
+ } from "./index-bejy9zyc.js";
8
8
 
9
9
  // pkgs/@akanjs/devkit/codeAgent/agent/akanCodePaths.ts
10
10
  import { existsSync } from "fs";
@@ -2,9 +2,9 @@
2
2
  import {
3
3
  FrameworkMapBuilder,
4
4
  FrameworkMapDoc
5
- } from "./index-9p260r4e.js";
5
+ } from "./index-trffs83s.js";
6
6
 
7
- // pkgs/@akanjs/devkit/frameworkGraph.ts
7
+ // pkgs/@akanjs/devkit/docs/frameworkGraph.ts
8
8
  import { readdir, readFile, realpath, stat } from "fs/promises";
9
9
  import path from "path";
10
10
  import ts from "typescript";