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

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 (129) 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-xdvw642m.js} +9 -7
  6. package/{application.command-692yap1d.js → application.command-g3f7xj25.js} +31 -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-b0ppke3m.js} +29 -27
  11. package/{cloud.command-wqfsyzv2.js → cloud.command-0hmsv44q.js} +12 -10
  12. package/commandManifest.json +1 -1
  13. package/{context.command-9bxtdn0w.js → context.command-x92afrnf.js} +17 -15
  14. package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
  15. package/getDirname-ka11hm7e.js +8 -0
  16. package/{guideline.command-nfqahxex.js → guideline.command-hpq08q66.js} +8 -6
  17. package/guidelines/agentRule/agentRule.generate.json +31 -0
  18. package/guidelines/agentRule/agentRule.instruction.md +525 -0
  19. package/guidelines/conventions/conventions.generate.json +25 -0
  20. package/guidelines/conventions/conventions.instruction.md +839 -0
  21. package/guidelines/cssRule/cssRule.instruction.md +7 -0
  22. package/guidelines/framework/framework.generate.json +3 -2
  23. package/guidelines/framework/framework.instruction.md +1 -9
  24. package/guidelines/mcpRule/mcpRule.generate.json +25 -0
  25. package/guidelines/mcpRule/mcpRule.instruction.md +217 -0
  26. package/guidelines/queryRule/queryRule.generate.json +31 -0
  27. package/guidelines/queryRule/queryRule.instruction.md +143 -0
  28. package/guidelines/runtimeRule/runtimeRule.generate.json +25 -0
  29. package/guidelines/runtimeRule/runtimeRule.instruction.md +176 -0
  30. package/guidelines/transportRule/transportRule.generate.json +31 -0
  31. package/guidelines/transportRule/transportRule.instruction.md +60 -0
  32. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
  33. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +263 -0
  34. package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +33 -0
  35. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +402 -0
  36. package/incrementalBuilder.proc.js +8 -6
  37. package/index-1577bej2.js +7 -0
  38. package/{index-vg0sj9nc.js → index-5f4gnt4c.js} +258 -97
  39. package/{index-bjpxzr6s.js → index-5vy2jzar.js} +1 -1
  40. package/{index-mssqn2sq.js → index-6d5r8q6k.js} +54 -15
  41. package/{index-p3f4q532.js → index-737aj4fm.js} +14 -13
  42. package/{index-2c3e2xh8.js → index-8besc14m.js} +1 -1
  43. package/{index-qb61h0k7.js → index-abyjt72y.js} +333 -540
  44. package/{index-xhgtkekh.js → index-cbfp5wyp.js} +1 -1
  45. package/{index-5dw57f0d.js → index-cp00yns2.js} +80 -14
  46. package/{index-ztpw544k.js → index-ety6takb.js} +3 -3
  47. package/index-f39512t6.js +255 -0
  48. package/{index-6rhabeev.js → index-gvq17wqn.js} +5 -3
  49. package/{index-js368gk9.js → index-hs70d8ed.js} +6 -6
  50. package/{index-7myvn0f0.js → index-j37qq1f2.js} +1 -1
  51. package/{index-azv0xjb5.js → index-jybbmwed.js} +8 -4
  52. package/{index-4hek879p.js → index-m5gfc86a.js} +1 -1
  53. package/{index-w6wbb612.js → index-nq3avsf6.js} +13 -13
  54. package/{index-vtj3zps1.js → index-p27h7535.js} +8 -8
  55. package/{index-5pmx7bkg.js → index-pehn44hr.js} +3 -3
  56. package/{index-j9cxndc0.js → index-qnv0aqmm.js} +9 -6
  57. package/{index-gmy45vz2.js → index-r691v756.js} +4 -4
  58. package/{index-0cj2zxbm.js → index-sh01r3pm.js} +1 -1
  59. package/{index-a1e0j63x.js → index-sqsfv8wg.js} +15 -7
  60. package/{index-gex7c8kd.js → index-wbbswwqt.js} +51 -24
  61. package/{index-bz2sfzzt.js → index-wybbcgxn.js} +4 -4
  62. package/index.js +21 -19
  63. package/{library.command-md9715jz.js → library.command-8vgrdtwy.js} +6 -4
  64. package/{localRegistry.command-exkbamyj.js → localRegistry.command-0gtqj0r0.js} +11 -9
  65. package/{module.command-w5aaddxk.js → module.command-rama4zya.js} +10 -8
  66. package/{package.command-yfkrcy0z.js → package.command-6jxapdsg.js} +6 -4
  67. package/package.json +4 -5
  68. package/{page.command-echbavp4.js → page.command-hxy7x525.js} +6 -4
  69. package/{primitive.command-9fbhspw2.js → primitive.command-4bf6xcc3.js} +11 -9
  70. package/{quality.command-3pnt9yep.js → quality.command-h5edwegz.js} +192 -97
  71. package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
  72. package/{repair.command-carj4vax.js → repair.command-rgqf6px6.js} +8 -6
  73. package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-7fycdqyv.js} +1 -1
  74. package/{scalar.command-51ryzypc.js → scalar.command-6krkz6tw.js} +9 -7
  75. package/templates/app/env/env.client.debug.ts.template +1 -5
  76. package/templates/app/env/env.client.develop.ts.template +1 -5
  77. package/templates/app/env/env.client.local.ts.template +1 -5
  78. package/templates/app/env/env.client.main.ts.template +1 -5
  79. package/templates/app/env/env.client.testing.ts.template +1 -5
  80. package/templates/app/env/env.client.type.ts +2 -6
  81. package/templates/app/env/env.server.debug.ts.template +1 -5
  82. package/templates/app/env/env.server.develop.ts.template +1 -5
  83. package/templates/app/env/env.server.local.ts.template +1 -5
  84. package/templates/app/env/env.server.main.ts.template +1 -5
  85. package/templates/app/main.ts +3 -1
  86. package/templates/app/page/styles.css.template +3 -3
  87. package/templates/appSample/srvkit/AuthGuard.ts +9 -5
  88. package/templates/appSample/srvkit/SessionInternalArg.ts +4 -3
  89. package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
  90. package/templates/crudPages/new/page.tsx +1 -1
  91. package/templates/crudSinglePage/page.tsx +1 -1
  92. package/templates/env/_env.server.type.ts +7 -5
  93. package/templates/lib/db.ts +1 -1
  94. package/templates/lib/dict.ts +1 -1
  95. package/templates/lib/sig.ts +1 -1
  96. package/templates/lib/srv.ts +6 -2
  97. package/templates/module/__Model__.Util.tsx +1 -1
  98. package/templates/module/__Model__.Zone.tsx +3 -5
  99. package/templates/workspaceRoot/AGENTS.md.template +4 -972
  100. package/templates/workspaceRoot/CLAUDE.md.template +19 -0
  101. package/templates/workspaceRoot/biome.json.template +4 -244
  102. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +10 -14
  103. package/templates/workspaceRoot/docs/GENERATED.md.template +12 -10
  104. package/templates/workspaceRoot/package.json.template +1 -1
  105. package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
  106. package/typecheck.proc.js +1 -1
  107. package/{workflow.command-91wmvm8k.js → workflow.command-dwhwrqhd.js} +16 -14
  108. package/{workspace.command-wa10mfd9.js → workspace.command-f5h11gjn.js} +71 -52
  109. package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
  110. package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -34
  111. package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
  112. package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
  113. package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
  114. package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
  115. package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
  116. package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
  117. package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
  118. package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -19
  119. package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -62
  120. package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
  121. package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
  122. package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
  123. package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -99
  124. package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
  125. package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
  126. package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
  127. package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
  128. package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
  129. /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
@@ -422,7 +422,7 @@ class HmrWatcher {
422
422
  this.#unreportedChanges += unreported;
423
423
  if (!this.#reportedCompensating) {
424
424
  this.#reportedCompensating = true;
425
- this.#logger.info(`[hmr] recovered ${unreported} change(s) that fs.watch did not report; Bun coalesces concurrent saves and drops all but one, so changes are resolved by mtime`);
425
+ this.#logger.verbose(`[hmr] recovered ${unreported} change(s) that fs.watch did not report; Bun coalesces concurrent saves and drops all but one, so changes are resolved by mtime`);
426
426
  }
427
427
  this.#logger.verbose(`[hmr] mtime scan found ${unreported} change(s) fs.watch never reported (${this.#unreportedChanges} total)`);
428
428
  }
@@ -2,14 +2,16 @@
2
2
  import {
3
3
  workflowRunArtifactPath,
4
4
  workflowSyncDir
5
- } from "./index-2c3e2xh8.js";
5
+ } from "./index-8besc14m.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-5f4gnt4c.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) {
@@ -4,24 +4,17 @@ import {
4
4
  CloudApi,
5
5
  GlobalConfig,
6
6
  getDefaultHostConfig
7
- } from "./index-0cj2zxbm.js";
7
+ } from "./index-sh01r3pm.js";
8
8
  import {
9
9
  openBrowser
10
- } from "./index-5dw57f0d.js";
10
+ } from "./index-cp00yns2.js";
11
11
  import {
12
12
  runner
13
- } from "./index-6rhabeev.js";
13
+ } from "./index-gvq17wqn.js";
14
14
  import {
15
15
  AppExecutor,
16
16
  WorkspaceExecutor
17
- } from "./index-vg0sj9nc.js";
18
-
19
- // pkgs/@akanjs/cli/cloud/cloud.runner.ts
20
- import path from "path";
21
- import { confirm, input, select } from "@inquirer/prompts";
22
- import { Logger, sleep } from "akanjs/common";
23
- import chalk from "chalk";
24
- import * as QRcode from "qrcode";
17
+ } from "./index-5f4gnt4c.js";
25
18
 
26
19
  // pkgs/@akanjs/cli/npmRegistry.ts
27
20
  var defaultNpmRegistry = "https://registry.npmjs.org";
@@ -40,6 +33,11 @@ async function getLatestPackageVersion(packageName, tag = "latest", registryUrl)
40
33
  }
41
34
 
42
35
  // pkgs/@akanjs/cli/cloud/cloud.runner.ts
36
+ import path from "path";
37
+ import { confirm, input, select } from "@inquirer/prompts";
38
+ import { Logger, sleep } from "akanjs/common";
39
+ import chalk from "chalk";
40
+ import * as QRcode from "qrcode";
43
41
  var addRemoteEnvServerValue = "__addRemoteEnvServer";
44
42
  var removeRemoteEnvServerValue = "__removeRemoteEnvServer";
45
43
 
@@ -285,7 +283,10 @@ ${chalk.green("\u27A4")} Authentication Required`));
285
283
  return;
286
284
  }
287
285
  }
288
- await Promise.all(akanPkgs.map(async (library) => {
286
+ Logger.info("Logging in to npm...");
287
+ await workspace.spawn("npm", ["login"], { stdio: "inherit" });
288
+ Logger.info("Logged in to npm");
289
+ for (const library of akanPkgs) {
289
290
  Logger.info(`Publishing ${library}@${nextVersion} to ${registry ?? "npm"}...`);
290
291
  await workspace.spawn("npm", ["publish", "--tag", tag, ...this.#getRegistryArgs(registry), ...this.#getLocalRegistryAuthArgs(registry)], {
291
292
  cwd: path.join(workspace.workspaceRoot, "dist/pkgs", library),
@@ -293,7 +294,7 @@ ${chalk.green("\u27A4")} Authentication Required`));
293
294
  stdio: "inherit"
294
295
  });
295
296
  Logger.info(`${library}@${nextVersion} is published to ${registry ?? "npm"}`);
296
- }));
297
+ }
297
298
  Logger.info(`All libraries are published to ${registry ?? "npm"}`);
298
299
  }
299
300
  async update(workspace, tag = "latest", { registryUrl } = {}) {
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AppExecutor,
4
4
  LibExecutor
5
- } from "./index-vg0sj9nc.js";
5
+ } from "./index-5f4gnt4c.js";
6
6
 
7
7
  // pkgs/@akanjs/devkit/workflow/utils.ts
8
8
  var jsonText = (value, { trailingNewline = true } = {}) => `${JSON.stringify(value, null, 2)}${trailingNewline ? `