@akanjs/cli 3.0.0-alpha.7 → 3.0.0-alpha.70

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 (119) hide show
  1. package/.build-stamp +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/{abstractCompactor-e5yq60qz.js → abstractCompactor-20e0cwbs.js} +2 -2
  5. package/{agent.command-pggr92jj.js → agent.command-964bf8qg.js} +9 -7
  6. package/{application.command-692yap1d.js → application.command-n45n18sc.js} +8 -6
  7. package/{applicationBuildRunner-ha3y8ew8.js → applicationBuildRunner-af0wtspv.js} +19 -14
  8. package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
  9. package/buildBatch.proc.js +7 -5
  10. package/{capacitorApp-p0z5yab2.js → capacitorApp-vnvnvdhf.js} +29 -27
  11. package/{cloud.command-wqfsyzv2.js → cloud.command-kx1bh5yq.js} +12 -10
  12. package/{context.command-9bxtdn0w.js → context.command-g1a65x6j.js} +17 -15
  13. package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
  14. package/getDirname-ka11hm7e.js +8 -0
  15. package/{guideline.command-nfqahxex.js → guideline.command-xphyhvwh.js} +8 -6
  16. package/guidelines/agentRule/agentRule.generate.json +31 -0
  17. package/guidelines/agentRule/agentRule.instruction.md +525 -0
  18. package/guidelines/conventions/conventions.generate.json +25 -0
  19. package/guidelines/conventions/conventions.instruction.md +1020 -0
  20. package/guidelines/cssRule/cssRule.instruction.md +7 -0
  21. package/guidelines/framework/framework.instruction.md +1 -0
  22. package/guidelines/mcpRule/mcpRule.generate.json +25 -0
  23. package/guidelines/mcpRule/mcpRule.instruction.md +220 -0
  24. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
  25. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +638 -0
  26. package/incrementalBuilder.proc.js +8 -6
  27. package/{index-azv0xjb5.js → index-0ngvvgry.js} +8 -4
  28. package/index-1577bej2.js +7 -0
  29. package/{index-p3f4q532.js → index-4rw4qhe6.js} +14 -13
  30. package/{index-bjpxzr6s.js → index-5vy2jzar.js} +1 -1
  31. package/{index-js368gk9.js → index-8gybxemv.js} +6 -6
  32. package/{index-qb61h0k7.js → index-abyjt72y.js} +333 -540
  33. package/{index-4hek879p.js → index-bqqts262.js} +1 -1
  34. package/{index-6rhabeev.js → index-e31ghfp5.js} +5 -3
  35. package/index-f39512t6.js +255 -0
  36. package/{index-5pmx7bkg.js → index-fahkq20v.js} +3 -3
  37. package/{index-xhgtkekh.js → index-hee7egtm.js} +1 -1
  38. package/{index-7myvn0f0.js → index-j37qq1f2.js} +1 -1
  39. package/{index-5dw57f0d.js → index-mkn5qagt.js} +14 -14
  40. package/{index-ztpw544k.js → index-nj3w0r34.js} +3 -3
  41. package/{index-vg0sj9nc.js → index-nkwmnqwn.js} +257 -97
  42. package/{index-a1e0j63x.js → index-p681w089.js} +15 -7
  43. package/{index-j9cxndc0.js → index-qnv0aqmm.js} +9 -6
  44. package/{index-w6wbb612.js → index-qt4nfr0n.js} +13 -13
  45. package/{index-bz2sfzzt.js → index-rb65xnw9.js} +4 -4
  46. package/{index-gex7c8kd.js → index-rbnpe8cp.js} +37 -6
  47. package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
  48. package/{index-gmy45vz2.js → index-v5fdxdre.js} +4 -4
  49. package/{index-mssqn2sq.js → index-va15r8h5.js} +54 -15
  50. package/{index-vtj3zps1.js → index-yg3hxk2k.js} +8 -8
  51. package/{index-2c3e2xh8.js → index-ytaqtc04.js} +1 -1
  52. package/index.js +21 -19
  53. package/{library.command-md9715jz.js → library.command-rfpd27yv.js} +6 -4
  54. package/{localRegistry.command-exkbamyj.js → localRegistry.command-pyxfe0fs.js} +11 -9
  55. package/{module.command-w5aaddxk.js → module.command-qhaxad0p.js} +10 -8
  56. package/{package.command-yfkrcy0z.js → package.command-2k22q9nt.js} +6 -4
  57. package/package.json +4 -5
  58. package/{page.command-echbavp4.js → page.command-ymk9dqh4.js} +6 -4
  59. package/{primitive.command-9fbhspw2.js → primitive.command-9k45zpc1.js} +11 -9
  60. package/{quality.command-3pnt9yep.js → quality.command-bf6vkxe5.js} +192 -97
  61. package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
  62. package/{repair.command-carj4vax.js → repair.command-egvvm6xf.js} +8 -6
  63. package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-7fycdqyv.js} +1 -1
  64. package/{scalar.command-51ryzypc.js → scalar.command-bt1facyj.js} +9 -7
  65. package/templates/app/env/env.client.debug.ts.template +1 -5
  66. package/templates/app/env/env.client.develop.ts.template +1 -5
  67. package/templates/app/env/env.client.local.ts.template +1 -5
  68. package/templates/app/env/env.client.main.ts.template +1 -5
  69. package/templates/app/env/env.client.testing.ts.template +1 -5
  70. package/templates/app/env/env.client.type.ts +2 -6
  71. package/templates/app/env/env.server.debug.ts.template +1 -5
  72. package/templates/app/env/env.server.develop.ts.template +1 -5
  73. package/templates/app/env/env.server.local.ts.template +1 -5
  74. package/templates/app/env/env.server.main.ts.template +1 -5
  75. package/templates/app/main.ts +3 -1
  76. package/templates/app/page/styles.css.template +3 -3
  77. package/templates/appSample/srvkit/AuthGuard.ts +9 -5
  78. package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
  79. package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
  80. package/templates/crudPages/new/page.tsx +1 -1
  81. package/templates/crudSinglePage/page.tsx +1 -1
  82. package/templates/env/_env.server.type.ts +7 -5
  83. package/templates/lib/db.ts +1 -1
  84. package/templates/lib/dict.ts +1 -1
  85. package/templates/lib/sig.ts +1 -1
  86. package/templates/lib/srv.ts +6 -2
  87. package/templates/module/__Model__.Util.tsx +1 -1
  88. package/templates/module/__Model__.Zone.tsx +3 -5
  89. package/templates/workspaceRoot/AGENTS.md.template +0 -972
  90. package/templates/workspaceRoot/CLAUDE.md.template +19 -0
  91. package/templates/workspaceRoot/biome.json.template +4 -244
  92. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +10 -14
  93. package/templates/workspaceRoot/docs/GENERATED.md.template +12 -10
  94. package/templates/workspaceRoot/package.json.template +1 -1
  95. package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
  96. package/typecheck.proc.js +1 -1
  97. package/{workflow.command-91wmvm8k.js → workflow.command-v1n3wg7v.js} +16 -14
  98. package/{workspace.command-wa10mfd9.js → workspace.command-yvvqvhzz.js} +71 -52
  99. package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
  100. package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -34
  101. package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
  102. package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
  103. package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
  104. package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
  105. package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
  106. package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
  107. package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
  108. package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -19
  109. package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -62
  110. package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
  111. package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
  112. package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
  113. package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -99
  114. package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
  115. package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
  116. package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
  117. package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
  118. package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
  119. /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
@@ -2,16 +2,17 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-6rhabeev.js";
5
+ } from "./index-e31ghfp5.js";
6
6
  import {
7
7
  LibExecutor
8
- } from "./index-vg0sj9nc.js";
8
+ } from "./index-nkwmnqwn.js";
9
9
 
10
10
  // pkgs/@akanjs/cli/semver.ts
11
- function parseVersion(version) {
11
+ var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
12
+ var parseVersion = (version) => {
12
13
  return version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
13
- }
14
- function compareSemver(a, b) {
14
+ };
15
+ var compareNumeric = (a, b) => {
15
16
  const left = parseVersion(a);
16
17
  const right = parseVersion(b);
17
18
  const length = Math.max(left.length, right.length);
@@ -21,7 +22,14 @@ function compareSemver(a, b) {
21
22
  return diff > 0 ? 1 : -1;
22
23
  }
23
24
  return 0;
24
- }
25
+ };
26
+ var compareSemver = (a, b) => {
27
+ try {
28
+ return Bun.semver.order(stripRangeOperator(a), stripRangeOperator(b));
29
+ } catch {
30
+ return compareNumeric(a, b);
31
+ }
32
+ };
25
33
 
26
34
  // pkgs/@akanjs/cli/library/library.runner.ts
27
35
  class LibraryRunner extends runner("library") {
@@ -70,7 +78,7 @@ class LibraryRunner extends runner("library") {
70
78
  return [dep, newerVersion];
71
79
  }));
72
80
  Object.keys(allDependencies).sort().forEach((dep) => {
73
- if (!!libPackageJson.dependencies?.[dep] || !!rootPackageJson.dependencies?.[dep])
81
+ if (libPackageJson.dependencies?.[dep] || rootPackageJson.dependencies?.[dep])
74
82
  dependencies[dep] = allDependencies[dep];
75
83
  else
76
84
  devDependencies[dep] = allDependencies[dep];
@@ -849,6 +849,7 @@ class ClientEntriesBundler {
849
849
  #externalSubpaths;
850
850
  #externalAliases;
851
851
  #command;
852
+ #target;
852
853
  #outputSubdir;
853
854
  #reactFastRefresh;
854
855
  #artifactDir;
@@ -870,6 +871,7 @@ class ClientEntriesBundler {
870
871
  this.#externalSubpaths = options.externalSubpaths ?? [];
871
872
  this.#externalAliases = options.externalAliases ?? {};
872
873
  this.#command = options.command ?? "start";
874
+ this.#target = options.target ?? "browser";
873
875
  this.#outputSubdir = options.outputSubdir ?? "client";
874
876
  this.#reactFastRefresh = options.reactFastRefresh ?? false;
875
877
  this.#artifactDir = `${this.#command === "build" ? this.#app.dist.cwdPath : this.#app.cwdPath}/.akan/artifact`;
@@ -883,7 +885,7 @@ class ClientEntriesBundler {
883
885
  entrypoints: this.#opaqueEntries.entries,
884
886
  outdir: this.#outdir,
885
887
  splitting: true,
886
- target: "browser",
888
+ target: this.#target,
887
889
  format: "esm",
888
890
  naming: CLIENT_BUNDLE_NAMING,
889
891
  metafile: true,
@@ -1117,7 +1119,8 @@ var VENDOR_SPECIFIERS = [
1117
1119
  "akanjs/store",
1118
1120
  "akanjs/base",
1119
1121
  "akanjs/common",
1120
- "akanjs/constant"
1122
+ "akanjs/constant",
1123
+ "akanjs/fetch"
1121
1124
  ];
1122
1125
 
1123
1126
  // pkgs/@akanjs/devkit/frontendBuild/routeClientBuilder.ts
@@ -1226,12 +1229,11 @@ class RouteClientBuilder {
1226
1229
  }).bundle();
1227
1230
  }
1228
1231
  async#buildSsrBundle(bootstrapEntries) {
1229
- const externalOptions = RouteClientBuilder.resolveSsrClientExternalOptions(this.#command);
1230
1232
  return new ClientEntriesBundler({
1231
1233
  app: this.#app,
1232
1234
  entries: bootstrapEntries.buildEntries,
1233
1235
  plugins: [await createBarrelImportsPlugin(this.#app)],
1234
- ...externalOptions,
1236
+ ...RouteClientBuilder.resolveSsrClientBundleOptions(this.#command),
1235
1237
  outputSubdir: "client-ssr",
1236
1238
  command: this.#command
1237
1239
  }).bundle();
@@ -1293,15 +1295,16 @@ ${defaultNames.map((name) => `export default ${name};`).join(`
1293
1295
  const serverEntry = RouteClientBuilder.resolveAkanServerEntry();
1294
1296
  return { [Bun.resolveSync("akanjs/fetch", serverEntry)]: "akanjs/fetch" };
1295
1297
  }
1296
- static resolveSsrClientExternalOptions(command) {
1298
+ static resolveSsrClientBundleOptions(command) {
1297
1299
  if (command === "start") {
1298
1300
  return {
1301
+ target: "bun",
1299
1302
  external: SSR_CLIENT_EXTERNALS,
1300
1303
  externalSubpaths: ["akanjs/fetch"],
1301
1304
  externalAliases: RouteClientBuilder.resolveSsrClientRuntimeAliases()
1302
1305
  };
1303
1306
  }
1304
- return { external: SSR_CLIENT_ALIAS_EXTERNALS };
1307
+ return { target: "bun", external: SSR_CLIENT_ALIAS_EXTERNALS };
1305
1308
  }
1306
1309
  static resolveAkanServerEntry() {
1307
1310
  try {
@@ -1,22 +1,22 @@
1
1
  // @bun
2
2
  import {
3
3
  RepairRunner
4
- } from "./index-ztpw544k.js";
4
+ } from "./index-nj3w0r34.js";
5
5
  import {
6
6
  WorkflowRunner
7
- } from "./index-5pmx7bkg.js";
7
+ } from "./index-fahkq20v.js";
8
+ import {
9
+ ScalarScript
10
+ } from "./index-v5fdxdre.js";
8
11
  import {
9
12
  PrimitiveScript
10
- } from "./index-bz2sfzzt.js";
13
+ } from "./index-rb65xnw9.js";
11
14
  import {
12
15
  ModuleScript
13
- } from "./index-vtj3zps1.js";
14
- import {
15
- ScalarScript
16
- } from "./index-gmy45vz2.js";
16
+ } from "./index-yg3hxk2k.js";
17
17
  import {
18
18
  isPlaceholderAppId
19
- } from "./index-xhgtkekh.js";
19
+ } from "./index-hee7egtm.js";
20
20
  import {
21
21
  AkanContextAnalyzer,
22
22
  akanMcpInstallConfigPaths,
@@ -27,17 +27,17 @@ import {
27
27
  renderDoctorText,
28
28
  resourceList,
29
29
  upsertCodexMcpServerBlock
30
- } from "./index-mssqn2sq.js";
30
+ } from "./index-va15r8h5.js";
31
31
  import {
32
32
  buildAkanModuleContextIndex,
33
33
  createWorkflowBaselineSummary,
34
34
  createWorkflowStepRegistry,
35
35
  jsonText,
36
36
  toolingRolloutGate
37
- } from "./index-2c3e2xh8.js";
37
+ } from "./index-ytaqtc04.js";
38
38
  import {
39
39
  Prompter
40
- } from "./index-7myvn0f0.js";
40
+ } from "./index-j37qq1f2.js";
41
41
  import {
42
42
  getMobileTargets
43
43
  } from "./index-76rn3g2c.js";
@@ -45,10 +45,10 @@ import {
45
45
  CommandContainer,
46
46
  runner,
47
47
  script
48
- } from "./index-6rhabeev.js";
48
+ } from "./index-e31ghfp5.js";
49
49
  import {
50
50
  AppExecutor
51
- } from "./index-vg0sj9nc.js";
51
+ } from "./index-nkwmnqwn.js";
52
52
 
53
53
  // pkgs/@akanjs/cli/context/context.script.ts
54
54
  import { Logger } from "akanjs/common";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  ModuleScript
4
- } from "./index-vtj3zps1.js";
4
+ } from "./index-yg3hxk2k.js";
5
5
  import {
6
6
  addFieldUiPolicyForType,
7
7
  coerceFieldDefault,
@@ -34,15 +34,15 @@ import {
34
34
  sourceFile,
35
35
  validationCommandsForTarget,
36
36
  viaBuilderParameterName
37
- } from "./index-2c3e2xh8.js";
37
+ } from "./index-ytaqtc04.js";
38
38
  import {
39
39
  script
40
- } from "./index-6rhabeev.js";
40
+ } from "./index-e31ghfp5.js";
41
41
  import {
42
42
  AppExecutor,
43
43
  LibExecutor,
44
44
  ModuleExecutor
45
- } from "./index-vg0sj9nc.js";
45
+ } from "./index-nkwmnqwn.js";
46
46
 
47
47
  // pkgs/@akanjs/cli/primitive/primitive.script.ts
48
48
  import { capitalize } from "akanjs/common";
@@ -1,22 +1,25 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-mssqn2sq.js";
4
+ } from "./index-va15r8h5.js";
5
5
  import {
6
6
  Prompter
7
- } from "./index-7myvn0f0.js";
7
+ } from "./index-j37qq1f2.js";
8
8
  import {
9
9
  runner,
10
10
  script
11
- } from "./index-6rhabeev.js";
11
+ } from "./index-e31ghfp5.js";
12
12
  import {
13
13
  AGENT_BLOCK_END,
14
14
  AGENT_BLOCK_START,
15
15
  AppExecutor,
16
+ CLAUDE_COMMENT_RULE,
16
17
  LibExecutor,
18
+ readDevkitVersion,
17
19
  renderRecipeEntries,
20
+ stampBlockVersion,
18
21
  upsertAgentBlock
19
- } from "./index-vg0sj9nc.js";
22
+ } from "./index-nkwmnqwn.js";
20
23
  import {
21
24
  collectRecipeSources,
22
25
  scanRecipes
@@ -103,19 +106,33 @@ ${scopeIndexPointer}
103
106
 
104
107
  `;
105
108
  };
109
+ var renderGuides = async (context) => {
110
+ const conventions = (await Prompter.getInstruction("conventions")).trim();
111
+ if (context.pkgs.some((pkg) => pkg.name === "akanjs"))
112
+ return conventions;
113
+ const onboarding = (await Prompter.getInstruction("workspaceOnboarding")).trim();
114
+ const appName = context.apps[0]?.name ?? "app";
115
+ return `${conventions}
116
+
117
+ ${onboarding.replaceAll("<%= appName %>", appName)}`;
118
+ };
106
119
  var renderManagedBlock = async (workspace) => {
107
120
  const context = await AkanContextAnalyzer.analyze(workspace);
108
121
  const frameworkGuide = await Prompter.getInstruction("framework");
109
122
  const appNames = context.apps.map((app) => app.name);
110
123
  const sampleCleanup = await renderSampleCleanup(workspace, appNames);
111
124
  const recipeIndex = await renderRecipeIndex(workspace);
112
- return `## Workspace
125
+ const guides = await renderGuides(context);
126
+ const version = await readDevkitVersion();
127
+ const block = `## Workspace
113
128
 
114
129
  - Repo: ${context.repoName}
115
130
  - Apps: ${context.apps.map((app) => app.name).join(", ") || "none"}
116
131
  - Libraries: ${context.libs.map((lib) => lib.name).join(", ") || "none"}
117
132
  - Packages: ${context.pkgs.map((pkg) => pkg.name).join(", ") || "none"}
118
133
 
134
+ ${guides}
135
+
119
136
  ${sampleCleanup}## Akan Module Abstracts
120
137
 
121
138
  - Before changing a domain, service, or scalar module, read its \`*.abstract.md\` file first.
@@ -148,7 +165,19 @@ ${context.validationCommands.map((command) => `- \`${command}\``).join(`
148
165
 
149
166
  ## Framework Guide
150
167
 
151
- ${frameworkGuide.trim()}`;
168
+ ${frameworkGuide.trim()}
169
+
170
+ ## Before You Finish
171
+
172
+ 1. \`bun run akan lint <appName>\` \u2014 Tailwind class order, \`Err\`, \`console\`, \`#private\` scope, unused imports.
173
+ 2. \`bun run akan typecheck <appName>\` \u2014 server/client boundary violations.
174
+ 3. \`bun run akan sync <appName>\` if you added, renamed, or deleted any file.
175
+ 4. Did you write or change a \`.tsx\` file? \`bun run akan quality ssr\` \u2014 did the server share hold, and did you add
176
+ a \`"use client"\` you cannot justify?
177
+ 5. Re-read the file you wrote against its section above.
178
+ 6. Did you add a comment? Delete it unless it documents an external constraint or a security decision.
179
+ 7. Did behavior or an invariant change? Update the module's \`*.abstract.md\`.`;
180
+ return version ? stampBlockVersion(block, version) : block;
152
181
  };
153
182
  var renderAgentsMd = async (workspace, existing) => {
154
183
  const block = await renderManagedBlock(workspace);
@@ -171,6 +200,8 @@ var renderClaudeMd = async (workspace) => {
171
200
  return `# ${context.repoName} \u2014 Claude Code Guide
172
201
 
173
202
  @AGENTS.md
203
+
204
+ ${CLAUDE_COMMENT_RULE}
174
205
  `;
175
206
  };
176
207
  var renderCursorRule = () => `---
@@ -240,7 +240,7 @@ import { ChatOpenAI } from "@langchain/openai";
240
240
  import { Logger } from "akanjs/common";
241
241
  import chalk from "chalk";
242
242
  var MAX_ASK_TRY = 300;
243
- var deepSeekLlmModels = ["deepseek-chat", "deepseek-reasoner"];
243
+ var deepSeekLlmModels = ["deepseek-v4-flash", "deepseek-v4-pro"];
244
244
  var openAiLlmModels = ["gpt-5.5"];
245
245
  var supportedLlmModels = [...deepSeekLlmModels, ...openAiLlmModels];
246
246
  var isOpenAiLlmModel = (model) => openAiLlmModels.includes(model);
@@ -4,19 +4,19 @@ import {
4
4
  } from "./index-ss469dec.js";
5
5
  import {
6
6
  AiSession
7
- } from "./index-0cj2zxbm.js";
7
+ } from "./index-sh01r3pm.js";
8
8
  import {
9
9
  createPassedPrimitiveReport,
10
10
  generatedFilesForSync,
11
11
  scalarChangedFiles
12
- } from "./index-2c3e2xh8.js";
12
+ } from "./index-ytaqtc04.js";
13
13
  import {
14
14
  Prompter
15
- } from "./index-7myvn0f0.js";
15
+ } from "./index-j37qq1f2.js";
16
16
  import {
17
17
  runner,
18
18
  script
19
- } from "./index-6rhabeev.js";
19
+ } from "./index-e31ghfp5.js";
20
20
 
21
21
  // pkgs/@akanjs/cli/scalar/scalar.prompt.ts
22
22
  import { input } from "@inquirer/prompts";
@@ -2,14 +2,16 @@
2
2
  import {
3
3
  workflowRunArtifactPath,
4
4
  workflowSyncDir
5
- } from "./index-2c3e2xh8.js";
5
+ } from "./index-ytaqtc04.js";
6
6
  import {
7
7
  AppExecutor,
8
8
  LibExecutor,
9
- appRootAllowedDirs,
10
- appRootAllowedFiles,
11
- isScannedAppRootEntry
12
- } from "./index-vg0sj9nc.js";
9
+ extractBlockVersion,
10
+ isScannedRootEntry,
11
+ readDevkitVersion,
12
+ rootAllowedDirs,
13
+ rootAllowedFiles
14
+ } from "./index-nkwmnqwn.js";
13
15
  import {
14
16
  collectRecipeSources,
15
17
  findInlineRecipeDuplicates,
@@ -124,7 +126,9 @@ var validationCommands = [
124
126
  "akan typecheck <app-name>",
125
127
  "akan test <app-or-lib-or-pkg>",
126
128
  "akan build <app-name>",
127
- "akan doctor --strict --format json"
129
+ "akan doctor --strict --format json",
130
+ "akan quality scan [--format json]",
131
+ "akan quality ssr [--format json]"
128
132
  ];
129
133
  var unknownGeneratedFilesFreshness = {
130
134
  status: "unknown",
@@ -365,6 +369,29 @@ class AkanContextAnalyzer {
365
369
  validationCommands
366
370
  };
367
371
  }
372
+ static async#agentGuideDrift(workspace) {
373
+ const installed = await readDevkitVersion();
374
+ if (!installed)
375
+ return null;
376
+ const content = await safeReadText(path.join(workspace.workspaceRoot, "AGENTS.md"));
377
+ if (content === null)
378
+ return null;
379
+ const stamped = extractBlockVersion(content);
380
+ if (stamped === installed)
381
+ return null;
382
+ const hint = "Re-render the AGENTS.md managed block from the installed framework release.";
383
+ if (!stamped)
384
+ return {
385
+ code: "agent-guide-unstamped",
386
+ message: `AGENTS.md carries no generated-version stamp, so its conventions may predate @akanjs/devkit ${installed}`,
387
+ hint
388
+ };
389
+ return {
390
+ code: "agent-guide-stale",
391
+ message: `AGENTS.md was generated by @akanjs/devkit ${stamped}, but ${installed} is installed`,
392
+ hint
393
+ };
394
+ }
368
395
  static async doctor(workspace, {
369
396
  strict = false,
370
397
  runIdOrPlan = null,
@@ -377,25 +404,37 @@ class AkanContextAnalyzer {
377
404
  repairAction("generated", "akan repair generated --app <app-or-lib>", "Refresh generated Akan files.", true),
378
405
  repairAction("format", "akan repair format --target <app-or-lib-or-pkg>", "Run the formatter/linter repair path.", true)
379
406
  ];
380
- for (const app of context.apps) {
381
- const appPath = path.join(workspace.workspaceRoot, app.path);
382
- for (const entry of await safeReadDir(appPath)) {
383
- if (!isScannedAppRootEntry(entry.name))
407
+ for (const sys of [...context.apps, ...context.libs]) {
408
+ const sysPath = path.join(workspace.workspaceRoot, sys.path);
409
+ for (const entry of await safeReadDir(sysPath)) {
410
+ if (!isScannedRootEntry(sys.type, entry.name))
384
411
  continue;
385
- const allowed = entry.isDirectory() ? appRootAllowedDirs.has(entry.name) : appRootAllowedFiles.has(entry.name);
412
+ const allowed = entry.isDirectory() ? rootAllowedDirs[sys.type].has(entry.name) : rootAllowedFiles[sys.type].has(entry.name);
386
413
  if (!allowed) {
387
- const action = repairAction("module-shape", `akan repair module-shape --app ${app.name}`, "Review app root shape and remove or move the unknown entry.", false);
414
+ const action = repairAction("module-shape", `akan repair module-shape --app ${sys.name}`, `Review ${sys.type} root shape and remove or move the unknown entry.`, false);
388
415
  diagnostics.push({
389
416
  severity: "error",
390
- code: "app-root-unknown-entry",
391
- path: `${app.path}/${entry.name}`,
392
- message: `Unexpected ${entry.isDirectory() ? "folder" : "file"} in app root: ${app.path}/${entry.name}`,
417
+ code: `${sys.type}-root-unknown-entry`,
418
+ path: `${sys.path}/${entry.name}`,
419
+ message: `Unexpected ${entry.isDirectory() ? "folder" : "file"} in ${sys.type} root: ${sys.path}/${entry.name}`,
393
420
  repairActions: [action]
394
421
  });
395
422
  repairActions.push(action);
396
423
  }
397
424
  }
398
425
  }
426
+ const agentDrift = await AkanContextAnalyzer.#agentGuideDrift(workspace);
427
+ if (agentDrift) {
428
+ const action = repairAction("generated", "akan agent install agents-md", agentDrift.hint, true);
429
+ diagnostics.push({
430
+ severity: "warning",
431
+ code: agentDrift.code,
432
+ path: "AGENTS.md",
433
+ message: agentDrift.message,
434
+ repairActions: [action]
435
+ });
436
+ repairActions.push(action);
437
+ }
399
438
  for (const sys of [...context.apps, ...context.libs]) {
400
439
  for (const module of sys.modules) {
401
440
  if (!module.abstract.exists) {
@@ -1,13 +1,13 @@
1
1
  // @bun
2
- import {
3
- PageScript
4
- } from "./index-4hek879p.js";
5
2
  import {
6
3
  pluralizeName
7
4
  } from "./index-ss469dec.js";
5
+ import {
6
+ PageScript
7
+ } from "./index-bqqts262.js";
8
8
  import {
9
9
  AiSession
10
- } from "./index-0cj2zxbm.js";
10
+ } from "./index-sh01r3pm.js";
11
11
  import {
12
12
  bilingualDescriptionForField,
13
13
  bilingualLabelForField,
@@ -15,17 +15,17 @@ import {
15
15
  generatedFilesForSync,
16
16
  moduleSourcePaths,
17
17
  sourceFile
18
- } from "./index-2c3e2xh8.js";
18
+ } from "./index-ytaqtc04.js";
19
19
  import {
20
20
  Prompter
21
- } from "./index-7myvn0f0.js";
21
+ } from "./index-j37qq1f2.js";
22
22
  import {
23
23
  runner,
24
24
  script
25
- } from "./index-6rhabeev.js";
25
+ } from "./index-e31ghfp5.js";
26
26
  import {
27
27
  ModuleExecutor
28
- } from "./index-vg0sj9nc.js";
28
+ } from "./index-nkwmnqwn.js";
29
29
  import {
30
30
  FileSys
31
31
  } from "./index-67546d0j.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AppExecutor,
4
4
  LibExecutor
5
- } from "./index-vg0sj9nc.js";
5
+ } from "./index-nkwmnqwn.js";
6
6
 
7
7
  // pkgs/@akanjs/devkit/workflow/utils.ts
8
8
  var jsonText = (value, { trailingNewline = true } = {}) => `${JSON.stringify(value, null, 2)}${trailingNewline ? `
package/index.js CHANGED
@@ -4,35 +4,37 @@ import {
4
4
  getTargetCommandNames,
5
5
  getTargetMetas,
6
6
  runCommands
7
- } from "./index-6rhabeev.js";
8
- import"./index-vg0sj9nc.js";
7
+ } from "./index-e31ghfp5.js";
8
+ import"./index-nkwmnqwn.js";
9
+ import"./index-f39512t6.js";
9
10
  import"./index-mxvakhsm.js";
11
+ import"./index-1577bej2.js";
10
12
  import"./index-67546d0j.js";
11
13
  import {
12
14
  __require
13
- } from "./index-r24hmh0q.js";
15
+ } from "./index-yb2wsc7f.js";
14
16
 
15
17
  // pkgs/@akanjs/cli/commandManifest.ts
16
18
  import path from "path";
17
19
 
18
20
  // pkgs/@akanjs/cli/commandModules.ts
19
21
  var commandModules = {
20
- workspace: async () => (await import("./workspace.command-wa10mfd9.js")).WorkspaceCommand,
21
- agent: async () => (await import("./agent.command-pggr92jj.js")).AgentCommand,
22
- application: async () => (await import("./application.command-692yap1d.js")).ApplicationCommand,
23
- library: async () => (await import("./library.command-md9715jz.js")).LibraryCommand,
24
- localRegistry: async () => (await import("./localRegistry.command-exkbamyj.js")).LocalRegistryCommand,
25
- package: async () => (await import("./package.command-yfkrcy0z.js")).PackageCommand,
26
- module: async () => (await import("./module.command-w5aaddxk.js")).ModuleCommand,
27
- page: async () => (await import("./page.command-echbavp4.js")).PageCommand,
28
- context: async () => (await import("./context.command-9bxtdn0w.js")).ContextCommand,
29
- cloud: async () => (await import("./cloud.command-wqfsyzv2.js")).CloudCommand,
30
- guideline: async () => (await import("./guideline.command-nfqahxex.js")).GuidelineCommand,
31
- scalar: async () => (await import("./scalar.command-51ryzypc.js")).ScalarCommand,
32
- primitive: async () => (await import("./primitive.command-9fbhspw2.js")).PrimitiveCommand,
33
- quality: async () => (await import("./quality.command-3pnt9yep.js")).QualityCommand,
34
- repair: async () => (await import("./repair.command-carj4vax.js")).RepairCommand,
35
- workflow: async () => (await import("./workflow.command-91wmvm8k.js")).WorkflowCommand
22
+ workspace: async () => (await import("./workspace.command-yvvqvhzz.js")).WorkspaceCommand,
23
+ agent: async () => (await import("./agent.command-964bf8qg.js")).AgentCommand,
24
+ application: async () => (await import("./application.command-n45n18sc.js")).ApplicationCommand,
25
+ library: async () => (await import("./library.command-rfpd27yv.js")).LibraryCommand,
26
+ localRegistry: async () => (await import("./localRegistry.command-pyxfe0fs.js")).LocalRegistryCommand,
27
+ package: async () => (await import("./package.command-2k22q9nt.js")).PackageCommand,
28
+ module: async () => (await import("./module.command-qhaxad0p.js")).ModuleCommand,
29
+ page: async () => (await import("./page.command-ymk9dqh4.js")).PageCommand,
30
+ context: async () => (await import("./context.command-g1a65x6j.js")).ContextCommand,
31
+ cloud: async () => (await import("./cloud.command-kx1bh5yq.js")).CloudCommand,
32
+ guideline: async () => (await import("./guideline.command-xphyhvwh.js")).GuidelineCommand,
33
+ scalar: async () => (await import("./scalar.command-bt1facyj.js")).ScalarCommand,
34
+ primitive: async () => (await import("./primitive.command-9k45zpc1.js")).PrimitiveCommand,
35
+ quality: async () => (await import("./quality.command-bf6vkxe5.js")).QualityCommand,
36
+ repair: async () => (await import("./repair.command-egvvm6xf.js")).RepairCommand,
37
+ workflow: async () => (await import("./workflow.command-v1n3wg7v.js")).WorkflowCommand
36
38
  };
37
39
  var commandModuleIds = Object.keys(commandModules);
38
40
 
@@ -1,16 +1,18 @@
1
1
  // @bun
2
2
  import {
3
3
  LibraryScript
4
- } from "./index-a1e0j63x.js";
4
+ } from "./index-p681w089.js";
5
5
  import {
6
6
  Lib,
7
7
  Workspace,
8
8
  command
9
- } from "./index-6rhabeev.js";
10
- import"./index-vg0sj9nc.js";
9
+ } from "./index-e31ghfp5.js";
10
+ import"./index-nkwmnqwn.js";
11
+ import"./index-f39512t6.js";
11
12
  import"./index-mxvakhsm.js";
13
+ import"./index-1577bej2.js";
12
14
  import"./index-67546d0j.js";
13
- import"./index-r24hmh0q.js";
15
+ import"./index-yb2wsc7f.js";
14
16
 
15
17
  // pkgs/@akanjs/cli/library/library.command.ts
16
18
  class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
@@ -2,31 +2,33 @@
2
2
  import {
3
3
  CloudRunner,
4
4
  getNpmRegistryUrl
5
- } from "./index-p3f4q532.js";
5
+ } from "./index-4rw4qhe6.js";
6
6
  import {
7
7
  PackageScript
8
- } from "./index-azv0xjb5.js";
9
- import"./index-0cj2zxbm.js";
8
+ } from "./index-0ngvvgry.js";
9
+ import"./index-sh01r3pm.js";
10
10
  import {
11
11
  ApplicationScript
12
- } from "./index-5dw57f0d.js";
12
+ } from "./index-mkn5qagt.js";
13
+ import"./index-p681w089.js";
13
14
  import"./index-76rn3g2c.js";
14
- import"./index-a1e0j63x.js";
15
15
  import {
16
16
  Workspace,
17
17
  command,
18
18
  runner,
19
19
  script
20
- } from "./index-6rhabeev.js";
20
+ } from "./index-e31ghfp5.js";
21
21
  import"./index-fgc8r6dj.js";
22
- import"./index-bjpxzr6s.js";
22
+ import"./index-5vy2jzar.js";
23
23
  import {
24
24
  PkgExecutor
25
- } from "./index-vg0sj9nc.js";
25
+ } from "./index-nkwmnqwn.js";
26
+ import"./index-f39512t6.js";
26
27
  import"./index-mxvakhsm.js";
28
+ import"./index-1577bej2.js";
27
29
  import"./index-46tjzh6s.js";
28
30
  import"./index-67546d0j.js";
29
- import"./index-r24hmh0q.js";
31
+ import"./index-yb2wsc7f.js";
30
32
 
31
33
  // pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
32
34
  import { mkdir, rm } from "fs/promises";
@@ -1,23 +1,25 @@
1
1
  // @bun
2
2
  import {
3
3
  ModuleScript
4
- } from "./index-vtj3zps1.js";
5
- import"./index-4hek879p.js";
4
+ } from "./index-yg3hxk2k.js";
6
5
  import"./index-ss469dec.js";
7
- import"./index-0cj2zxbm.js";
6
+ import"./index-bqqts262.js";
7
+ import"./index-sh01r3pm.js";
8
8
  import {
9
9
  renderPrimitiveReport
10
- } from "./index-2c3e2xh8.js";
11
- import"./index-7myvn0f0.js";
10
+ } from "./index-ytaqtc04.js";
11
+ import"./index-j37qq1f2.js";
12
12
  import {
13
13
  Module,
14
14
  Sys,
15
15
  command
16
- } from "./index-6rhabeev.js";
17
- import"./index-vg0sj9nc.js";
16
+ } from "./index-e31ghfp5.js";
17
+ import"./index-nkwmnqwn.js";
18
+ import"./index-f39512t6.js";
18
19
  import"./index-mxvakhsm.js";
20
+ import"./index-1577bej2.js";
19
21
  import"./index-67546d0j.js";
20
- import"./index-r24hmh0q.js";
22
+ import"./index-yb2wsc7f.js";
21
23
 
22
24
  // pkgs/@akanjs/cli/module/module.command.ts
23
25
  import { Logger, lowerlize } from "akanjs/common";