@akanjs/cli 3.1.1-rc.15 → 3.1.1-rc.17

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 (120) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-gtwn7tmb.js → CodeAgent-fbcq8vks.js} +2 -2
  3. package/{CodeTui-v941fqdh.js → CodeTui-0626gxqd.js} +1 -1
  4. package/TunnelShare-2p24xxza.js +14 -0
  5. package/agent.command-hpza0pg9.js +46 -0
  6. package/akanCode.js +5 -3
  7. package/{application.command-j1reb9p1.js → application.command-3a7q1hs2.js} +11 -10
  8. package/{applicationBuildRunner-w20x63mz.js → applicationBuildRunner-s7yt71j4.js} +6 -5
  9. package/buildBatch.proc.js +6 -6
  10. package/{cloud.command-zd2mfkm0.js → cloud.command-4vg0pcea.js} +15 -14
  11. package/cloud.script-nkmeyhet.js +25 -0
  12. package/{code.command-dyet4xn6.js → code.command-fbntb67p.js} +6 -6
  13. package/commandManifest.json +1 -1
  14. package/{context.command-79gxczm4.js → context.command-31rm54v0.js} +18 -17
  15. package/context.runner-w01a32ph.js +26 -0
  16. package/{guideline.command-xwkskvky.js → guideline.command-cv3by2ng.js} +3 -3
  17. package/guidelines/conventions/core.md +104 -0
  18. package/guidelines/conventions/rules/app.md +83 -0
  19. package/guidelines/conventions/rules/auth.md +45 -0
  20. package/guidelines/conventions/rules/config.md +56 -0
  21. package/guidelines/conventions/rules/constant.md +24 -0
  22. package/guidelines/conventions/rules/gates.md +31 -0
  23. package/guidelines/conventions/rules/layer.md +25 -0
  24. package/guidelines/conventions/rules/migration.md +27 -0
  25. package/guidelines/conventions/rules/module.md +90 -0
  26. package/guidelines/conventions/rules/page.md +56 -0
  27. package/guidelines/conventions/rules/sensitive.md +16 -0
  28. package/guidelines/conventions/rules/server.md +86 -0
  29. package/guidelines/conventions/rules/ssr.md +47 -0
  30. package/guidelines/conventions/rules/style.md +43 -0
  31. package/guidelines/conventions/rules/test.md +34 -0
  32. package/guidelines/conventions/rules/ts.md +95 -0
  33. package/guidelines/conventions/rules/tsx.md +75 -0
  34. package/guidelines/mcpRule/mcpRule.instruction.md +1 -1
  35. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +3 -3
  36. package/incrementalBuilder.proc.js +6 -6
  37. package/{index-pqdz7rat.js → index-05nxx4m5.js} +952 -47
  38. package/{index-41d3zx66.js → index-0ht91675.js} +37 -59
  39. package/{index-cz9g85xh.js → index-0zwznvv1.js} +1 -1
  40. package/{index-7ktk2hnz.js → index-0zyatd10.js} +2 -2
  41. package/{index-8jb5ep2e.js → index-12kzwak1.js} +3 -3
  42. package/{index-yknrmkmt.js → index-1dhf8ymv.js} +2 -2
  43. package/{index-qmeh0s05.js → index-3gccwenr.js} +2 -2
  44. package/{index-hdzjaq7s.js → index-3txrjt6n.js} +2 -2
  45. package/{index-tzzs52h0.js → index-57q1ayd2.js} +18 -1240
  46. package/index-5kh9scvs.js +514 -0
  47. package/index-5n5hds19.js +1246 -0
  48. package/{index-pc9ps0hx.js → index-6269mf2s.js} +10 -9
  49. package/{index-1e2955yd.js → index-64g9fsjy.js} +43 -12
  50. package/index-7zeb5r1p.js +653 -0
  51. package/{index-kr62ph5a.js → index-8s8b4eba.js} +45 -4
  52. package/{index-wvvwdzfw.js → index-922k2zwq.js} +3 -3
  53. package/{index-brpk7gd8.js → index-9ndw5d8j.js} +7 -7
  54. package/{index-xeh7m2j5.js → index-et6ce601.js} +1 -1
  55. package/{index-jtydvvq7.js → index-f5adsa58.js} +4 -4
  56. package/index-fbewhg4g.js +590 -0
  57. package/{index-7abjzny1.js → index-hm7x0c11.js} +33 -37
  58. package/{index-rshwdv9w.js → index-hvv5rnaq.js} +2 -2
  59. package/index-jje9qzyq.js +27 -0
  60. package/index-js1gj6f6.js +410 -0
  61. package/{index-2qzzp0c9.js → index-kjrvwzav.js} +3 -3
  62. package/index-m5n3ka0p.js +18 -0
  63. package/index-m6r88hhr.js +3582 -0
  64. package/{index-4rwfh2de.js → index-mt0wa941.js} +4 -4
  65. package/{index-553xyb55.js → index-mwj9q2ya.js} +1 -1
  66. package/{index-5nd1wtkv.js → index-p6x5b7hr.js} +1 -1
  67. package/index-r2wedvqn.js +138 -0
  68. package/{index-ygy8c12j.js → index-rvynj5gz.js} +1 -1
  69. package/{index-nmy1rana.js → index-tdv66eah.js} +4 -4
  70. package/{index-8rvwgd1r.js → index-w134p86k.js} +1 -1
  71. package/{index-jjd97ya6.js → index-wfczhj1z.js} +14 -36
  72. package/{index-dy0jx9ay.js → index-wwe9rsrx.js} +14 -0
  73. package/{index-kbbyzs6j.js → index-x5ecanqh.js} +2 -2
  74. package/{index-ch1sv7ke.js → index-zre4m2ce.js} +9 -21
  75. package/index.js +23 -22
  76. package/{library.command-td8t85kb.js → library.command-sh70fyvy.js} +3 -3
  77. package/{localRegistry.command-jx9zkmxf.js → localRegistry.command-2nbyy84d.js} +17 -14
  78. package/{module.command-j70mqgpp.js → module.command-n0bmtzwy.js} +5 -5
  79. package/{package.command-1b1v6k5v.js → package.command-7h9r51bz.js} +3 -3
  80. package/package.json +2 -2
  81. package/{page.command-m31w2tsz.js → page.command-vjtpfbb1.js} +3 -3
  82. package/{pipeline.command-q7b8wy55.js → pipeline.command-c93se3ar.js} +2 -2
  83. package/{primitive.command-4zrbhkb9.js → primitive.command-a3075qp2.js} +6 -6
  84. package/{projectTypecheck-synx6qff.js → projectTypecheck-sf9xwaga.js} +1 -1
  85. package/{prompter-76k56b37.js → prompter-hgcta8pb.js} +1 -1
  86. package/quality.command-dw1y9hmy.js +76 -0
  87. package/{repair.command-98n6zxg7.js → repair.command-tg57d8yt.js} +5 -5
  88. package/{scalar.command-rak5pjk3.js → scalar.command-cwzge353.js} +4 -4
  89. package/skills/akan-agent/SKILL.md +36 -0
  90. package/skills/akan-debug/SKILL.md +3 -3
  91. package/skills/akan-deps/SKILL.md +1 -2
  92. package/skills/akan-mcp/SKILL.md +40 -0
  93. package/skills/akan-page/SKILL.md +44 -0
  94. package/skills/akan-query/SKILL.md +38 -0
  95. package/skills/akan-runtime/SKILL.md +40 -0
  96. package/skills/akan-scaffold/SKILL.md +16 -6
  97. package/skills/akan-transport/SKILL.md +40 -0
  98. package/skills/akan-validate/SKILL.md +13 -11
  99. package/{subspace.command-ej0rk116.js → subspace.command-3h03c7kc.js} +8 -8
  100. package/templates/workspaceRoot/.gitignore.template +3 -0
  101. package/templates/workspaceRoot/AGENTS.md.template +4 -10
  102. package/{tunnel.command-kdx3amrc.js → tunnel.command-czaz6ys4.js} +7 -7
  103. package/{typeChecker-px49mezc.js → typeChecker-j2jdnqsr.js} +1 -1
  104. package/typecheck.proc.js +6 -1
  105. package/verify.command-nzwhtz71.js +91 -0
  106. package/{workflow.command-gffk9nj9.js → workflow.command-srhky88x.js} +47 -13
  107. package/workspace.command-9stchcd2.js +262 -0
  108. package/TunnelShare-26ty9skr.js +0 -14
  109. package/agent.command-h82gepwn.js +0 -25
  110. package/cloud.script-vdj8ymch.js +0 -24
  111. package/context.runner-ejag7mhr.js +0 -25
  112. package/guidelines/conventions/conventions.instruction.md +0 -617
  113. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +0 -291
  114. package/index-6pzt55w3.js +0 -279
  115. package/index-y5m4j2w6.js +0 -856
  116. package/index-zzvvc845.js +0 -74
  117. package/quality.command-cy0pgqjz.js +0 -1478
  118. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +0 -69
  119. package/templates/workspaceRoot/docs/GENERATED.md.template +0 -55
  120. package/workspace.command-097hv6n1.js +0 -521
@@ -1,11 +1,10 @@
1
1
  // @bun
2
2
  import {
3
3
  SubagentPool2,
4
- akanCodePaths2,
5
4
  McpServerConfig,
6
5
  McpSignIn,
7
6
  AkanCodeCompaction2
8
- } from "./index-jjd97ya6.js";
7
+ } from "./index-wfczhj1z.js";
9
8
  import {
10
9
  stripAnsi
11
10
  } from "./index-7md2g9vw.js";
@@ -15,6 +14,9 @@ import {
15
14
  akanCodeModelSupportsImages2,
16
15
  akanCodeModelWarnings2
17
16
  } from "./index-c6eggbee.js";
17
+ import {
18
+ akanCodePaths2
19
+ } from "./index-jje9qzyq.js";
18
20
 
19
21
  // pkgs/@akanjs/devkit/codeAgent/agent/AkanCodeServices.ts
20
22
  import { existsSync as existsSync4, mkdirSync, mkdtempSync } from "fs";
@@ -150,7 +152,7 @@ var akanSystemPrompt2 = (profile) => {
150
152
  "- Never hand-edit a generated file (`lib/cnst.ts`, `db.ts`, `st.ts`, any `*/index.ts` barrel). Fix the owning source and run `repair_generated` or `akan sync`."
151
153
  ];
152
154
  if (profile.tools.builtin.includes("write"))
153
- lines.push("- After editing, call `akan_verify`. It runs sync, lint, typecheck and the SSR check over what the working tree changed. A turn that edits and does not verify is not finished.");
155
+ lines.push("- After editing, call `akan_verify` once. It runs sync, lint, typecheck, a fast build and the SSR check over what the working tree changed; never run `akan lint`, `akan typecheck` or `akan build` separately. A turn that edits and does not verify is not finished.");
154
156
  else
155
157
  lines.push("- This session is read-only: there is no write, edit or bash tool. Report what should change instead of changing it.");
156
158
  if (profile.tools.subagent)
@@ -330,7 +332,7 @@ import { existsSync as existsSync5, statSync as statSync4 } from "fs";
330
332
  import path5 from "path";
331
333
 
332
334
  // pkgs/@akanjs/devkit/codeAgent/tools/AkanEditScope.ts
333
- var empty = { paths: [], apps: [], libs: [], needsSync: false, touchesTsx: false };
335
+ var empty = { paths: [], apps: [], libs: [], pkgs: [], needsSync: false, touchesTsx: false };
334
336
 
335
337
  class AkanEditScope2 {
336
338
  static async since(cwd, baseline) {
@@ -344,6 +346,7 @@ class AkanEditScope2 {
344
346
  paths,
345
347
  apps: AkanEditScope2.#targets(paths, "apps"),
346
348
  libs: AkanEditScope2.#targets(paths, "libs"),
349
+ pkgs: AkanEditScope2.#targets(paths, "pkgs"),
347
350
  needsSync: entries.some((entry) => /[ARD?]/.test(entry.code) && /^(apps|libs)\//.test(entry.file)),
348
351
  touchesTsx: paths.some((file) => file.endsWith(".tsx"))
349
352
  };
@@ -360,7 +363,10 @@ class AkanEditScope2 {
360
363
  `).filter((line) => line.trim().length > 3));
361
364
  }
362
365
  static #targets(paths, root) {
363
- const names = paths.filter((file) => file.startsWith(`${root}/`)).map((file) => file.split("/")[1] ?? "").filter(Boolean);
366
+ const names = paths.filter((file) => file.startsWith(`${root}/`)).map((file) => {
367
+ const [, first = "", second = ""] = file.split("/");
368
+ return first.startsWith("@") && second ? `${first}/${second}` : first;
369
+ }).filter(Boolean);
364
370
  return [...new Set(names)];
365
371
  }
366
372
  }
@@ -700,7 +706,7 @@ class AkanCli2 {
700
706
  cwd: this.#cwd,
701
707
  stdout: "pipe",
702
708
  stderr: "pipe",
703
- env: { ...process.env, FORCE_COLOR: "0", NO_COLOR: "1" }
709
+ env: { ...process.env, FORCE_COLOR: "0", NO_COLOR: "1", AKAN_LOG_STDOUT_LEVEL: "warn" }
704
710
  });
705
711
  const timer = setTimeout(() => proc.kill(), timeoutMs);
706
712
  const [stdout, stderr, exitCode] = await Promise.all([
@@ -723,49 +729,28 @@ class AkanCli2 {
723
729
 
724
730
  // pkgs/@akanjs/devkit/codeAgent/tools/AkanVerifier.ts
725
731
  class AkanVerifier2 {
732
+ static tailLines = 20;
726
733
  #cli;
727
734
  constructor(cwd) {
728
735
  this.#cli = new AkanCli2(cwd);
729
736
  }
730
- async verify(scope) {
731
- const steps = [];
732
- const targets = [...scope.apps, ...scope.libs];
733
- if (scope.needsSync)
734
- for (const target of targets)
735
- steps.push(await this.#cli.run(["sync", target]));
736
- for (const target of targets)
737
- steps.push(await this.#cli.run(["lint", target]));
738
- for (const app of scope.apps)
739
- steps.push(await this.#cli.run(["typecheck", app]));
740
- if (scope.touchesTsx)
741
- steps.push(await this.#cli.run(["quality", "ssr"]));
742
- return { ok: steps.every((step) => step.ok), steps, scope };
743
- }
744
- static summarize(report, { tailLines = 40 } = {}) {
745
- if (!report.steps.length)
746
- return "No akan target was touched, so there was nothing to verify.";
747
- if (report.ok)
748
- return `Verification passed: ${report.steps.map((step) => step.command).join(", ")}.`;
749
- const failed = report.steps.filter((step) => !step.ok);
750
- const passed = report.steps.filter((step) => step.ok).map((step) => step.command);
751
- const blocks = failed.map((step) => `### ${step.command} (exit ${step.exitCode})
752
- ${tail(step.output, tailLines)}`);
753
- return [
754
- `Verification failed: ${failed.map((step) => step.command).join(", ")}.`,
755
- passed.length ? `Passed: ${passed.join(", ")}.` : "",
756
- ...blocks
757
- ].filter(Boolean).join(`
758
-
759
- `);
737
+ async verify(paths = []) {
738
+ const args = ["verify", ...paths.length ? ["--files", paths.join(",")] : []];
739
+ const result = await this.#cli.run(args, { timeoutMs: 600000 });
740
+ return { ok: result.ok, text: AkanVerifier2.summarize(result) };
760
741
  }
761
- }
762
- var tail = (text, lines) => {
763
- const all = text.split(`
742
+ static summarize(result) {
743
+ if (result.output.startsWith("verify "))
744
+ return result.output;
745
+ const lines = result.output.split(`
764
746
  `);
765
- return all.length <= lines ? text : `\u2026
766
- ${all.slice(-lines).join(`
747
+ const tail = lines.length <= AkanVerifier2.tailLines ? result.output : `\u2026
748
+ ${lines.slice(-AkanVerifier2.tailLines).join(`
767
749
  `)}`;
768
- };
750
+ return `${result.command} exited ${result.exitCode} before reporting:
751
+ ${tail}`;
752
+ }
753
+ }
769
754
 
770
755
  // pkgs/@akanjs/devkit/codeAgent/feedback/VerifyFeedback.ts
771
756
  class VerifyFeedback2 {
@@ -782,14 +767,12 @@ class VerifyFeedback2 {
782
767
  }
783
768
  async observe() {
784
769
  const scope = await AkanEditScope2.since(this.#options.cwd, this.#baseline);
785
- if (!scope.apps.length && !scope.libs.length)
770
+ if (!scope.apps.length && !scope.libs.length && !scope.pkgs.length)
786
771
  return;
787
772
  if (this.#options.readOnly)
788
773
  return VerifyFeedback2.#readOnlyNotice(scope.needsSync, [...scope.apps, ...scope.libs]);
789
- const report = await this.#verifier.verify(scope);
790
- if (report.ok)
791
- return;
792
- return AkanVerifier2.summarize(report);
774
+ const report = await this.#verifier.verify(scope.paths);
775
+ return report.ok ? undefined : report.text;
793
776
  }
794
777
  static #readOnlyNotice(needsSync, targets) {
795
778
  if (!needsSync)
@@ -809,7 +792,7 @@ class AkanToolPack2 {
809
792
  return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
810
793
  }
811
794
  async names() {
812
- const { ContextRunner } = await import("./context.runner-ejag7mhr.js");
795
+ const { ContextRunner } = await import("./context.runner-w01a32ph.js");
813
796
  return [
814
797
  ...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
815
798
  AkanToolPack2.verifyToolName
@@ -817,7 +800,7 @@ class AkanToolPack2 {
817
800
  }
818
801
  static verifyToolName = "akan_verify";
819
802
  async#register(pi) {
820
- const { ContextRunner } = await import("./context.runner-ejag7mhr.js");
803
+ const { ContextRunner } = await import("./context.runner-w01a32ph.js");
821
804
  const runner = new ContextRunner;
822
805
  const guidelineNames = await AkanToolPack2.#guidelineNames();
823
806
  for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
@@ -844,23 +827,18 @@ class AkanToolPack2 {
844
827
  pi.registerTool({
845
828
  name: AkanToolPack2.verifyToolName,
846
829
  label: "akan verify",
847
- description: "Run the akan validation chain (sync, lint, typecheck, and quality ssr for .tsx changes) over everything the working tree has changed, and report what failed. Call this after editing before you finish.",
848
- promptSnippet: "akan_verify: run sync/lint/typecheck/quality over the working tree's changes",
830
+ description: "Run `akan verify` over everything the working tree has changed: sync, lint (with fixes), typecheck, a fast build of each changed app, and the SSR check for .tsx changes, in one call. It prints one line when it passes and one line per problem when it fails. Call this after editing, before you finish; never run lint, typecheck or build separately.",
831
+ promptSnippet: "akan_verify: sync, lint, typecheck and build what the working tree changed, in one call",
849
832
  parameters: Type.Object({}),
850
833
  execute: async () => {
851
- const scope = await AkanEditScope2.since(this.#options.cwd, new Set);
852
- const report = await verifier.verify(scope);
853
- return {
854
- content: [{ type: "text", text: AkanVerifier2.summarize(report) }],
855
- details: undefined,
856
- isError: !report.ok
857
- };
834
+ const report = await verifier.verify();
835
+ return { content: [{ type: "text", text: report.text }], details: undefined, isError: !report.ok };
858
836
  }
859
837
  });
860
838
  }
861
839
  static async#guidelineNames() {
862
840
  try {
863
- const { Prompter } = await import("./prompter-76k56b37.js");
841
+ const { Prompter } = await import("./prompter-hgcta8pb.js");
864
842
  return await Prompter.listGuidelines();
865
843
  } catch {
866
844
  return [];
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  AsyncDefaultExportDetector,
4
4
  resolveSsrPageEntriesForApp
5
- } from "./index-1e2955yd.js";
5
+ } from "./index-64g9fsjy.js";
6
6
  import {
7
7
  FileSys2
8
8
  } from "./index-52w0fvh8.js";
@@ -9,10 +9,10 @@ import {
9
9
  UpdatePackFolder,
10
10
  NativePublicEnv,
11
11
  NativeApp
12
- } from "./index-2qzzp0c9.js";
12
+ } from "./index-kjrvwzav.js";
13
13
  import {
14
14
  ExitCodeError
15
- } from "./index-qmeh0s05.js";
15
+ } from "./index-3gccwenr.js";
16
16
  import {
17
17
  ConfigLock
18
18
  } from "./index-bqbf654f.js";
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  SOURCE_EXTS,
7
7
  WatchRootResolver
8
- } from "./index-5nd1wtkv.js";
8
+ } from "./index-p6x5b7hr.js";
9
9
  import {
10
10
  bundleDefine,
11
11
  CsrEntryFiles,
@@ -19,11 +19,11 @@ import {
19
19
  CsrDevPaths,
20
20
  PagesEntrySourceGenerator,
21
21
  PagesBundleBuilder
22
- } from "./index-cz9g85xh.js";
22
+ } from "./index-0zwznvv1.js";
23
23
  import {
24
24
  AsyncDefaultExportDetector,
25
25
  resolveSsrPageEntriesForApp
26
- } from "./index-1e2955yd.js";
26
+ } from "./index-64g9fsjy.js";
27
27
 
28
28
  // pkgs/@akanjs/devkit/frontendBuild/autoImportSync.ts
29
29
  import { readdir, readFile, stat } from "fs/promises";
@@ -1,13 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  resolveSsrPageEntriesForApp
4
- } from "./index-1e2955yd.js";
4
+ } from "./index-64g9fsjy.js";
5
5
  import {
6
6
  bundleDefine,
7
7
  CsrEntryFiles,
8
8
  PagesEntrySourceGenerator,
9
9
  PagesBundleBuilder
10
- } from "./index-cz9g85xh.js";
10
+ } from "./index-0zwznvv1.js";
11
11
 
12
12
  // pkgs/@akanjs/devkit/frontendBuild/csrArtifactBuilder.ts
13
13
  import { mkdir as mkdir2, rm as rm2, unlink as unlink2 } from "fs/promises";
@@ -10,7 +10,7 @@ import {
10
10
  LibExecutor,
11
11
  PkgExecutor,
12
12
  ModuleExecutor
13
- } from "./index-1e2955yd.js";
13
+ } from "./index-64g9fsjy.js";
14
14
 
15
15
  // pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
16
16
  var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
@@ -857,4 +857,4 @@ function command(refName, depsOrBuilder, builder) {
857
857
  }
858
858
  return CommandBase;
859
859
  }
860
- export { getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, Workspace, CommandContainer, runner, script, ExitCodeError, markCliErrorPrinted, assertPromptable, runCommands, command };
860
+ export { camelToKebabCase, getTargetMetas, getTargetCommandNames, App, Apps, Lib, Sys, SysOrOnlyApp, Exec, Pkg, Module, Workspace, CommandContainer, runner, script, ExitCodeError, markCliErrorPrinted, assertPromptable, runCommands, command };
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-qmeh0s05.js";
5
+ } from "./index-3gccwenr.js";
6
6
  import {
7
7
  FileSys2
8
8
  } from "./index-52w0fvh8.js";
9
9
  import {
10
10
  PkgExecutor
11
- } from "./index-1e2955yd.js";
11
+ } from "./index-64g9fsjy.js";
12
12
  import {
13
13
  TypeScriptDependencyScanner2
14
14
  } from "./index-tvehn2sp.js";