@akanjs/cli 3.1.1-rc.9 → 3.1.1

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 (184) hide show
  1. package/.build-stamp +1 -1
  2. package/CodeAgent-35wnb7w5.js +9 -0
  3. package/{CodeTui-z5vkm9ea.js → CodeTui-h6yz2kvq.js} +1 -1
  4. package/TunnelShare-xyjpa7gx.js +14 -0
  5. package/agent.command-3r4jsck8.js +46 -0
  6. package/akanCode.js +10 -6
  7. package/{application.command-wthg8nn9.js → application.command-g7xv6ad0.js} +44 -11
  8. package/{applicationBuildRunner-t2r84sz6.js → applicationBuildRunner-qvjnhr9j.js} +9 -6
  9. package/buildBatch.proc.js +6 -6
  10. package/{cloud.command-sz11hpre.js → cloud.command-6ebygmhw.js} +17 -15
  11. package/cloud.script-0s1jybd5.js +26 -0
  12. package/{code.command-9h3yrzhe.js → code.command-mpkm2emr.js} +6 -6
  13. package/commandManifest.json +1 -1
  14. package/{context.command-15j9b7c0.js → context.command-svdh6b2w.js} +18 -17
  15. package/context.runner-ch0z3a8g.js +26 -0
  16. package/{devTui-q7k7bakd.js → devTui-evr3b35y.js} +1 -1
  17. package/{guideline.command-snh85ctf.js → guideline.command-qwp3tnjx.js} +3 -3
  18. package/guidelines/conventions/core.md +106 -0
  19. package/guidelines/conventions/rules/app.md +83 -0
  20. package/guidelines/conventions/rules/auth.md +45 -0
  21. package/guidelines/conventions/rules/config.md +56 -0
  22. package/guidelines/conventions/rules/constant.md +24 -0
  23. package/guidelines/conventions/rules/gates.md +31 -0
  24. package/guidelines/conventions/rules/layer.md +25 -0
  25. package/guidelines/conventions/rules/migration.md +27 -0
  26. package/guidelines/conventions/rules/module.md +90 -0
  27. package/guidelines/conventions/rules/page.md +56 -0
  28. package/guidelines/conventions/rules/sensitive.md +16 -0
  29. package/guidelines/conventions/rules/server.md +86 -0
  30. package/guidelines/conventions/rules/ssr.md +47 -0
  31. package/guidelines/conventions/rules/style.md +43 -0
  32. package/guidelines/conventions/rules/test.md +34 -0
  33. package/guidelines/conventions/rules/ts.md +95 -0
  34. package/guidelines/conventions/rules/tsx.md +75 -0
  35. package/guidelines/mcpRule/mcpRule.instruction.md +1 -1
  36. package/guidelines/pageRule/pageRule.instruction.md +4 -3
  37. package/guidelines/queryRule/queryRule.instruction.md +4 -0
  38. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +3 -3
  39. package/incrementalBuilder.proc.js +6 -6
  40. package/{index-pcwzkdqb.js → index-1p0qbq3m.js} +1 -1
  41. package/{index-xb8809yb.js → index-1shvxzt0.js} +3 -3
  42. package/{index-a58emady.js → index-266dewjs.js} +11 -11
  43. package/{index-bt438yxm.js → index-3yz30c07.js} +5 -4
  44. package/{index-xjf5j657.js → index-4mj92tsh.js} +952 -47
  45. package/index-4pdts00b.js +1604 -0
  46. package/{index-42j4a8zq.js → index-8559hsz4.js} +4 -3
  47. package/{index-wcej7g4z.js → index-8scw1pjk.js} +93 -23
  48. package/{index-a5dhqkdr.js → index-96wzdhfh.js} +74 -233
  49. package/index-9bv479q5.js +1 -0
  50. package/index-9rvcs76p.js +653 -0
  51. package/index-am36s3jh.js +3582 -0
  52. package/index-b8c289dx.js +444 -0
  53. package/{index-espk51ah.js → index-dd44g6vz.js} +3 -3
  54. package/{index-3wypz6xj.js → index-eja64h28.js} +7 -3
  55. package/index-fbewhg4g.js +590 -0
  56. package/index-jje9qzyq.js +27 -0
  57. package/{index-j9vyj3dj.js → index-k5jbcxyh.js} +3 -3
  58. package/{index-2mwc0g0d.js → index-ksfgqq1x.js} +1 -1
  59. package/index-m5n3ka0p.js +18 -0
  60. package/{index-5nd1wtkv.js → index-p6x5b7hr.js} +1 -1
  61. package/{index-6txx6a9p.js → index-payhwt51.js} +21 -29
  62. package/{index-2azahjaw.js → index-qkkdhjm6.js} +2 -2
  63. package/{index-74tjjsnc.js → index-qxzrp5xt.js} +33 -37
  64. package/{index-qfp55x1y.js → index-r0k3ham2.js} +4 -4
  65. package/{index-hmt54t45.js → index-r2w2eh93.js} +4 -4
  66. package/index-r2wedvqn.js +138 -0
  67. package/{index-skk9zc1x.js → index-rnphv731.js} +2 -2
  68. package/{index-9th4gszy.js → index-s6da8ta9.js} +82 -1227
  69. package/index-tenw3mah.js +225 -0
  70. package/{index-31es1yev.js → index-tgt2fnd6.js} +107 -6
  71. package/{index-55j120r8.js → index-vxmy1p4f.js} +16 -36
  72. package/{index-301pdbzz.js → index-w4k2ragk.js} +7 -7
  73. package/{index-js6geqjn.js → index-w7q6h97v.js} +1 -1
  74. package/{index-dy0jx9ay.js → index-wwe9rsrx.js} +14 -0
  75. package/{index-2xcc2ax5.js → index-xq543a5y.js} +2 -2
  76. package/{index-0fz95kxe.js → index-xqgwjz7a.js} +1 -1
  77. package/{index-40brg4px.js → index-xxfy1jp2.js} +4 -4
  78. package/{index-905qdgqp.js → index-z4b84y6k.js} +1 -1
  79. package/index-zcf6k8a5.js +410 -0
  80. package/index.js +23 -22
  81. package/{library.command-gycrwhf1.js → library.command-2853y6mk.js} +3 -3
  82. package/{localRegistry.command-jtd8gaes.js → localRegistry.command-76ds31p4.js} +19 -15
  83. package/{module.command-v6hgs1bc.js → module.command-yfnb0abs.js} +5 -5
  84. package/{package.command-shzpcfph.js → package.command-d9s86hp9.js} +3 -3
  85. package/package.json +2 -2
  86. package/{page.command-ptxn5kqk.js → page.command-6a8a8rd1.js} +3 -3
  87. package/{pipeline.command-zz31pgax.js → pipeline.command-rt3rwd2z.js} +2 -2
  88. package/{primitive.command-a1vse91z.js → primitive.command-emcebgrq.js} +6 -6
  89. package/{projectTypecheck-2ztky9cf.js → projectTypecheck-51m7eh1f.js} +1 -1
  90. package/{prompter-76k56b37.js → prompter-hgcta8pb.js} +1 -1
  91. package/quality.command-xtrk0n3x.js +76 -0
  92. package/{repair.command-cvazbz99.js → repair.command-51szxnxx.js} +5 -5
  93. package/{routeSourceValidator-6jd0q6r6.js → routeSourceValidator-4h947v7c.js} +13 -3
  94. package/{scalar.command-0acvyp26.js → scalar.command-8qv27t82.js} +4 -4
  95. package/skills/akan-agent/SKILL.md +36 -0
  96. package/skills/akan-code/SKILL.md +1 -0
  97. package/skills/akan-debug/SKILL.md +40 -6
  98. package/skills/akan-deps/SKILL.md +1 -2
  99. package/skills/akan-mcp/SKILL.md +40 -0
  100. package/skills/akan-page/SKILL.md +44 -0
  101. package/skills/akan-query/SKILL.md +38 -0
  102. package/skills/akan-runtime/SKILL.md +40 -0
  103. package/skills/akan-scaffold/SKILL.md +16 -6
  104. package/skills/akan-transport/SKILL.md +40 -0
  105. package/skills/akan-validate/SKILL.md +13 -11
  106. package/{subspace.command-822qx2bx.js → subspace.command-pn56pnh8.js} +8 -8
  107. package/templates/__scalar/__model__/__model__.constant.ts +3 -5
  108. package/templates/__scalar/__model__/__model__.dictionary.ts +6 -5
  109. package/templates/__scalar/__model__/__model__.document.ts +3 -3
  110. package/templates/app/akan.config.ts +2 -3
  111. package/templates/app/env/env.client.ts +2 -4
  112. package/templates/app/env/env.client.type.ts +2 -3
  113. package/templates/app/env/env.server.ts +2 -3
  114. package/templates/app/lib/___appName__/__appName__.dictionary.ts +1 -2
  115. package/templates/app/lib/___appName__/__appName__.service.ts +3 -3
  116. package/templates/app/lib/___appName__/__appName__.signal.ts +5 -5
  117. package/templates/app/lib/___appName__/__appName__.store.ts +4 -6
  118. package/templates/app/lib/option.ts +2 -3
  119. package/templates/app/main.ts +2 -4
  120. package/templates/app/page/_index.tsx +3 -3
  121. package/templates/app/page/_layout.tsx +13 -10
  122. package/templates/appSample/lib/__scalar/workHistory/workHistory.constant.ts +1 -5
  123. package/templates/appSample/lib/__scalar/workHistory/workHistory.dictionary.ts +1 -1
  124. package/templates/appSample/lib/_noti/noti.signal.ts +1 -1
  125. package/templates/appSample/lib/task/Task.Template.tsx +2 -1
  126. package/templates/appSample/lib/task/Task.Unit.tsx +3 -2
  127. package/templates/appSample/lib/task/Task.Util.tsx +16 -4
  128. package/templates/appSample/lib/task/task.constant.ts +1 -5
  129. package/templates/appSample/lib/task/task.dictionary.ts +2 -8
  130. package/templates/appSample/lib/task/task.document.ts +1 -1
  131. package/templates/appSample/page/task/_index.tsx +2 -1
  132. package/templates/appSample/page/task/new.tsx +2 -1
  133. package/templates/appSample/ui/QuantityControl.tsx +5 -9
  134. package/templates/biomeForm.ts +144 -0
  135. package/templates/crudPages/[__model__Id]/edit/page.tsx +3 -3
  136. package/templates/crudPages/[__model__Id]/page.tsx +5 -5
  137. package/templates/crudPages/new/page.tsx +4 -3
  138. package/templates/crudPages/page.tsx +3 -3
  139. package/templates/crudSinglePage/page.tsx +9 -5
  140. package/templates/libRoot/akan.config.ts +2 -3
  141. package/templates/libRoot/lib/___libName__/__libName__.dictionary.ts +1 -2
  142. package/templates/libRoot/lib/___libName__/__libName__.service.ts +5 -4
  143. package/templates/libRoot/lib/___libName__/__libName__.signal.ts +6 -5
  144. package/templates/libRoot/lib/___libName__/__libName__.store.ts +5 -6
  145. package/templates/libRoot/lib/option.ts +1 -2
  146. package/templates/module/__Model__.Template.tsx +11 -10
  147. package/templates/module/__Model__.Unit.tsx +18 -5
  148. package/templates/module/__Model__.Util.tsx +9 -7
  149. package/templates/module/__Model__.View.tsx +9 -6
  150. package/templates/module/__Model__.Zone.tsx +25 -17
  151. package/templates/module/__model__.constant.ts +8 -9
  152. package/templates/module/__model__.dictionary.ts +16 -17
  153. package/templates/module/__model__.document.ts +6 -8
  154. package/templates/module/__model__.service.ts +3 -3
  155. package/templates/module/__model__.signal.ts +11 -10
  156. package/templates/module/__model__.store.ts +3 -5
  157. package/templates/service/__model__.dictionary.ts +6 -5
  158. package/templates/service/__model__.service.ts +3 -3
  159. package/templates/service/__model__.signal.ts +5 -4
  160. package/templates/service/__model__.store.ts +3 -5
  161. package/templates/workspaceRoot/.gitignore.template +3 -0
  162. package/templates/workspaceRoot/.vscode/settings.json.template +21 -21
  163. package/templates/workspaceRoot/AGENTS.md.template +4 -10
  164. package/{tunnel.command-ycmja19q.js → tunnel.command-q2h0j2en.js} +7 -7
  165. package/{typeChecker-px49mezc.js → typeChecker-j2jdnqsr.js} +1 -1
  166. package/typecheck.proc.js +6 -1
  167. package/verify.command-z1dsbmrt.js +91 -0
  168. package/{workflow.command-abb1d5xy.js → workflow.command-r3y67jeq.js} +47 -13
  169. package/workspace.command-t2f0xsrw.js +263 -0
  170. package/CodeAgent-8d5qs787.js +0 -9
  171. package/TunnelShare-qkm8zp03.js +0 -14
  172. package/agent.command-ydftceda.js +0 -25
  173. package/cloud.script-nqevg5qw.js +0 -24
  174. package/context.runner-8gg030b0.js +0 -25
  175. package/guidelines/conventions/conventions.instruction.md +0 -617
  176. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +0 -291
  177. package/index-4vgbysa0.js +0 -279
  178. package/index-7md2g9vw.js +0 -6
  179. package/index-b70zct19.js +0 -856
  180. package/index-zzvvc845.js +0 -74
  181. package/quality.command-ah8qcakd.js +0 -1478
  182. package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +0 -69
  183. package/templates/workspaceRoot/docs/GENERATED.md.template +0 -55
  184. package/workspace.command-qm7cw29v.js +0 -521
@@ -1,20 +1,23 @@
1
1
  // @bun
2
2
  import {
3
3
  SubagentPool2,
4
- akanCodePaths2,
5
4
  McpServerConfig,
6
5
  McpSignIn,
7
6
  AkanCodeCompaction2
8
- } from "./index-55j120r8.js";
7
+ } from "./index-vxmy1p4f.js";
9
8
  import {
9
+ PreviewView2,
10
10
  stripAnsi
11
- } from "./index-7md2g9vw.js";
11
+ } from "./index-tenw3mah.js";
12
12
  import {
13
13
  akanCodeDefaultModel2,
14
14
  akanCodeModel2,
15
15
  akanCodeModelSupportsImages2,
16
16
  akanCodeModelWarnings2
17
17
  } from "./index-c6eggbee.js";
18
+ import {
19
+ akanCodePaths2
20
+ } from "./index-jje9qzyq.js";
18
21
 
19
22
  // pkgs/@akanjs/devkit/codeAgent/agent/AkanCodeServices.ts
20
23
  import { existsSync as existsSync4, mkdirSync, mkdtempSync } from "fs";
@@ -150,7 +153,7 @@ var akanSystemPrompt2 = (profile) => {
150
153
  "- 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
154
  ];
152
155
  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.");
156
+ 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
157
  else
155
158
  lines.push("- This session is read-only: there is no write, edit or bash tool. Report what should change instead of changing it.");
156
159
  if (profile.tools.subagent)
@@ -330,7 +333,7 @@ import { existsSync as existsSync5, statSync as statSync4 } from "fs";
330
333
  import path5 from "path";
331
334
 
332
335
  // pkgs/@akanjs/devkit/codeAgent/tools/AkanEditScope.ts
333
- var empty = { paths: [], apps: [], libs: [], needsSync: false, touchesTsx: false };
336
+ var empty = { paths: [], apps: [], libs: [], pkgs: [], needsSync: false, touchesTsx: false };
334
337
 
335
338
  class AkanEditScope2 {
336
339
  static async since(cwd, baseline) {
@@ -344,6 +347,7 @@ class AkanEditScope2 {
344
347
  paths,
345
348
  apps: AkanEditScope2.#targets(paths, "apps"),
346
349
  libs: AkanEditScope2.#targets(paths, "libs"),
350
+ pkgs: AkanEditScope2.#targets(paths, "pkgs"),
347
351
  needsSync: entries.some((entry) => /[ARD?]/.test(entry.code) && /^(apps|libs)\//.test(entry.file)),
348
352
  touchesTsx: paths.some((file) => file.endsWith(".tsx"))
349
353
  };
@@ -360,7 +364,10 @@ class AkanEditScope2 {
360
364
  `).filter((line) => line.trim().length > 3));
361
365
  }
362
366
  static #targets(paths, root) {
363
- const names = paths.filter((file) => file.startsWith(`${root}/`)).map((file) => file.split("/")[1] ?? "").filter(Boolean);
367
+ const names = paths.filter((file) => file.startsWith(`${root}/`)).map((file) => {
368
+ const [, first = "", second = ""] = file.split("/");
369
+ return first.startsWith("@") && second ? `${first}/${second}` : first;
370
+ }).filter(Boolean);
364
371
  return [...new Set(names)];
365
372
  }
366
373
  }
@@ -435,149 +442,6 @@ ${lines.join(`
435
442
  }
436
443
  }
437
444
 
438
- // pkgs/@akanjs/devkit/codeAgent/feedback/PreviewChrome.ts
439
- import { existsSync as existsSync6 } from "fs";
440
- import { homedir } from "os";
441
- import path6 from "path";
442
-
443
- class PreviewChrome2 {
444
- static pathEnvKey = "BUN_CHROME_PATH";
445
- static backendEnvKey = "AKAN_CODE_WEBVIEW_BACKEND";
446
- static executables = [
447
- "chromium",
448
- "chromium-browser",
449
- "google-chrome-stable",
450
- "google-chrome",
451
- "brave-browser",
452
- "microsoft-edge",
453
- "chrome"
454
- ];
455
- static appBundles = [
456
- "Google Chrome.app/Contents/MacOS/Google Chrome",
457
- "Google Chrome Canary.app/Contents/MacOS/Google Chrome Canary",
458
- "Chromium.app/Contents/MacOS/Chromium",
459
- "Brave Browser.app/Contents/MacOS/Brave Browser",
460
- "Microsoft Edge.app/Contents/MacOS/Microsoft Edge"
461
- ];
462
- static get backend() {
463
- const declared = process.env[PreviewChrome2.backendEnvKey];
464
- if (declared === "webkit" || declared === "chrome")
465
- return declared;
466
- return process.platform === "darwin" ? "webkit" : "chrome";
467
- }
468
- static executable() {
469
- const declared = process.env[PreviewChrome2.pathEnvKey];
470
- if (declared)
471
- return declared;
472
- for (const name of PreviewChrome2.executables) {
473
- const found = Bun.which(name);
474
- if (found)
475
- return found;
476
- }
477
- if (process.platform !== "darwin")
478
- return;
479
- for (const root of ["/Applications", path6.join(homedir(), "Applications")])
480
- for (const bundle of PreviewChrome2.appBundles) {
481
- const candidate = path6.join(root, bundle);
482
- if (existsSync6(candidate))
483
- return candidate;
484
- }
485
- return;
486
- }
487
- static get available() {
488
- return PreviewChrome2.backend === "webkit" ? process.platform === "darwin" : !!PreviewChrome2.executable();
489
- }
490
- static backendOption() {
491
- if (PreviewChrome2.backend === "webkit")
492
- return "webkit";
493
- const argv = ["--disable-dev-shm-usage"];
494
- if (process.getuid?.() === 0)
495
- argv.push("--no-sandbox");
496
- return { type: "chrome", argv };
497
- }
498
- static dockerRuns = [
499
- "apt-get update && apt-get install -y --no-install-recommends chromium fonts-liberation fonts-noto-color-emoji fonts-noto-cjk && rm -rf /var/lib/apt/lists/*"
500
- ];
501
- static unavailableReason() {
502
- if (PreviewChrome2.available)
503
- return;
504
- if (PreviewChrome2.backend === "webkit")
505
- return `The webkit WebView backend exists only on macOS. Set ${PreviewChrome2.backendEnvKey}=chrome and install a browser.`;
506
- return [
507
- "The page preview needs a browser and this machine has none on PATH.",
508
- `Install one (${PreviewChrome2.dockerRuns[0]}) or point ${PreviewChrome2.pathEnvKey} at an existing Chrome.`
509
- ].join(" ");
510
- }
511
- }
512
-
513
- // pkgs/@akanjs/devkit/codeAgent/feedback/PreviewView.ts
514
- class PreviewView2 {
515
- static get available() {
516
- return typeof Bun.WebView === "function" && PreviewChrome2.available;
517
- }
518
- static unavailableReason() {
519
- if (typeof Bun.WebView !== "function")
520
- return "This Bun build has no WebView, so the page preview is off.";
521
- return PreviewChrome2.unavailableReason();
522
- }
523
- static async probe(url, { screenshot = false, width = 1280, height = 800 } = {}) {
524
- const logs = [];
525
- const view = PreviewView2.#open({ width, height, onConsole: (line) => logs.push(line) });
526
- try {
527
- await view.navigate(url);
528
- const result = {
529
- url,
530
- title: view.title,
531
- consoleErrors: logs.filter((line) => line.startsWith("error") || line.startsWith("warn")),
532
- pageErrors: PreviewView2.#strings(await view.evaluate(pageErrorsExpression)),
533
- domFindings: PreviewView2.#strings(await view.evaluate(domFindingsExpression))
534
- };
535
- if (screenshot)
536
- result.screenshot = await view.screenshot({ encoding: "base64" });
537
- return result;
538
- } finally {
539
- await view.close();
540
- }
541
- }
542
- static #open({ width, height, onConsole }) {
543
- const Ctor = Bun.WebView;
544
- return new Ctor({
545
- width,
546
- height,
547
- dataStore: "ephemeral",
548
- backend: PreviewChrome2.backendOption(),
549
- console: (type, ...args) => onConsole(`${type} ${args.map(String).join(" ")}`)
550
- });
551
- }
552
- static #strings(value) {
553
- return Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : [];
554
- }
555
- }
556
- var pageErrorsExpression = `(() => {
557
- const found = [];
558
- const root = document.getElementById("__next") || document.body;
559
- const rendered = root ? Array.from(root.children).filter((el) => !["SCRIPT", "STYLE", "TEMPLATE", "LINK", "NOSCRIPT"].includes(el.tagName)) : [];
560
- if (!rendered.length && !(root && root.innerText && root.innerText.trim())) found.push("The page body rendered empty.");
561
- const overlay = document.querySelector("[data-nextjs-dialog], .error-overlay, #akan-error");
562
- if (overlay) found.push("An error overlay is on the page: " + overlay.textContent.slice(0, 400));
563
- return found;
564
- })()`;
565
- var domFindingsExpression = `(() => {
566
- const found = [];
567
- const all = Array.from(document.querySelectorAll("body *"));
568
- const overflowing = all.filter((el) => el.scrollWidth > document.documentElement.clientWidth + 8);
569
- if (overflowing.length) found.push(overflowing.length + " element(s) overflow the viewport horizontally, first: " + (overflowing[0].tagName + "." + overflowing[0].className).slice(0, 120));
570
- const invisibleText = all.filter((el) => {
571
- if (!el.textContent || !el.textContent.trim()) return false;
572
- const style = getComputedStyle(el);
573
- return style.color === style.backgroundColor && style.backgroundColor !== "rgba(0, 0, 0, 0)";
574
- });
575
- if (invisibleText.length) found.push(invisibleText.length + " element(s) render text in the same colour as their background.");
576
- const unresolved = all.filter((el) => /(^|\\s)(bg|text|border)-(base-100|base-content|primary-content|error)(\\s|$)/.test(el.className || ""));
577
- if (unresolved.length) found.push(unresolved.length + " element(s) use a dropped daisyUI colour slot that renders no CSS.");
578
- return found;
579
- })()`;
580
-
581
445
  // pkgs/@akanjs/devkit/codeAgent/feedback/PreviewFeedback.ts
582
446
  class PreviewFeedback2 {
583
447
  key = "preview";
@@ -600,7 +464,7 @@ class PreviewFeedback2 {
600
464
  for (const route of this.#options.routes ?? ["/en/"]) {
601
465
  const url = new URL(route, this.#options.previewUrl).toString();
602
466
  const probe = await PreviewView2.probe(url, { screenshot: !!this.#options.canSeeImages });
603
- const problems = [...probe.pageErrors, ...probe.consoleErrors, ...probe.domFindings];
467
+ const problems = [...probe.pageErrors, ...probe.consoleErrors, ...probe.consoleWarnings, ...probe.domFindings];
604
468
  if (!problems.length)
605
469
  continue;
606
470
  findings.push(`**${url}**
@@ -686,8 +550,8 @@ class TurnFeedback2 {
686
550
  }
687
551
 
688
552
  // pkgs/@akanjs/devkit/codeAgent/tools/AkanCli.ts
689
- import { existsSync as existsSync7 } from "fs";
690
- import path7 from "path";
553
+ import { existsSync as existsSync6 } from "fs";
554
+ import path6 from "path";
691
555
  class AkanCli2 {
692
556
  #cwd;
693
557
  #entry;
@@ -700,7 +564,7 @@ class AkanCli2 {
700
564
  cwd: this.#cwd,
701
565
  stdout: "pipe",
702
566
  stderr: "pipe",
703
- env: { ...process.env, FORCE_COLOR: "0", NO_COLOR: "1" }
567
+ env: { ...process.env, FORCE_COLOR: "0", NO_COLOR: "1", AKAN_LOG_STDOUT_LEVEL: "warn" }
704
568
  });
705
569
  const timer = setTimeout(() => proc.kill(), timeoutMs);
706
570
  const [stdout, stderr, exitCode] = await Promise.all([
@@ -714,58 +578,37 @@ class AkanCli2 {
714
578
  }
715
579
  static #resolveEntry() {
716
580
  const candidates = [
717
- path7.join(import.meta.dir, "index.js"),
718
- path7.join(import.meta.dir, "..", "..", "..", "cli", "index.ts")
581
+ path6.join(import.meta.dir, "index.js"),
582
+ path6.join(import.meta.dir, "..", "..", "..", "cli", "index.ts")
719
583
  ];
720
- return candidates.find((candidate) => existsSync7(candidate)) ?? Bun.main;
584
+ return candidates.find((candidate) => existsSync6(candidate)) ?? Bun.main;
721
585
  }
722
586
  }
723
587
 
724
588
  // pkgs/@akanjs/devkit/codeAgent/tools/AkanVerifier.ts
725
589
  class AkanVerifier2 {
590
+ static tailLines = 20;
726
591
  #cli;
727
592
  constructor(cwd) {
728
593
  this.#cli = new AkanCli2(cwd);
729
594
  }
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
- `);
595
+ async verify(paths = []) {
596
+ const args = ["verify", ...paths.length ? ["--files", paths.join(",")] : []];
597
+ const result = await this.#cli.run(args, { timeoutMs: 600000 });
598
+ return { ok: result.ok, text: AkanVerifier2.summarize(result) };
760
599
  }
761
- }
762
- var tail = (text, lines) => {
763
- const all = text.split(`
600
+ static summarize(result) {
601
+ if (result.output.startsWith("verify "))
602
+ return result.output;
603
+ const lines = result.output.split(`
764
604
  `);
765
- return all.length <= lines ? text : `\u2026
766
- ${all.slice(-lines).join(`
605
+ const tail = lines.length <= AkanVerifier2.tailLines ? result.output : `\u2026
606
+ ${lines.slice(-AkanVerifier2.tailLines).join(`
767
607
  `)}`;
768
- };
608
+ return `${result.command} exited ${result.exitCode} before reporting:
609
+ ${tail}`;
610
+ }
611
+ }
769
612
 
770
613
  // pkgs/@akanjs/devkit/codeAgent/feedback/VerifyFeedback.ts
771
614
  class VerifyFeedback2 {
@@ -782,14 +625,12 @@ class VerifyFeedback2 {
782
625
  }
783
626
  async observe() {
784
627
  const scope = await AkanEditScope2.since(this.#options.cwd, this.#baseline);
785
- if (!scope.apps.length && !scope.libs.length)
628
+ if (!scope.apps.length && !scope.libs.length && !scope.pkgs.length)
786
629
  return;
787
630
  if (this.#options.readOnly)
788
631
  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);
632
+ const report = await this.#verifier.verify(scope.paths);
633
+ return report.ok ? undefined : report.text;
793
634
  }
794
635
  static #readOnlyNotice(needsSync, targets) {
795
636
  if (!needsSync)
@@ -809,7 +650,7 @@ class AkanToolPack2 {
809
650
  return { name: "akan-tools", factory: async (pi) => await this.#register(pi) };
810
651
  }
811
652
  async names() {
812
- const { ContextRunner } = await import("./context.runner-8gg030b0.js");
653
+ const { ContextRunner } = await import("./context.runner-ch0z3a8g.js");
813
654
  return [
814
655
  ...new ContextRunner().listMcpTools(this.#options.mode).map((tool) => tool.name),
815
656
  AkanToolPack2.verifyToolName
@@ -817,7 +658,7 @@ class AkanToolPack2 {
817
658
  }
818
659
  static verifyToolName = "akan_verify";
819
660
  async#register(pi) {
820
- const { ContextRunner } = await import("./context.runner-8gg030b0.js");
661
+ const { ContextRunner } = await import("./context.runner-ch0z3a8g.js");
821
662
  const runner = new ContextRunner;
822
663
  const guidelineNames = await AkanToolPack2.#guidelineNames();
823
664
  for (const tool of runner.listMcpTools(this.#options.mode, { guidelineNames })) {
@@ -844,23 +685,18 @@ class AkanToolPack2 {
844
685
  pi.registerTool({
845
686
  name: AkanToolPack2.verifyToolName,
846
687
  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",
688
+ 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.",
689
+ promptSnippet: "akan_verify: sync, lint, typecheck and build what the working tree changed, in one call",
849
690
  parameters: Type.Object({}),
850
691
  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
- };
692
+ const report = await verifier.verify();
693
+ return { content: [{ type: "text", text: report.text }], details: undefined, isError: !report.ok };
858
694
  }
859
695
  });
860
696
  }
861
697
  static async#guidelineNames() {
862
698
  try {
863
- const { Prompter } = await import("./prompter-76k56b37.js");
699
+ const { Prompter } = await import("./prompter-hgcta8pb.js");
864
700
  return await Prompter.listGuidelines();
865
701
  } catch {
866
702
  return [];
@@ -1765,6 +1601,7 @@ class AkanCodePlugins2 {
1765
1601
  workspace: options.workspace,
1766
1602
  cwd: options.cwd,
1767
1603
  parent: options.profile,
1604
+ ...options.model ? { model: options.model } : {},
1768
1605
  depth: options.depth,
1769
1606
  ...options.subagentSpend ? { spend: options.subagentSpend } : {},
1770
1607
  ...options.onNotice ? { onNotice: options.onNotice } : {},
@@ -2085,7 +1922,7 @@ class CodeAgentEventMapper2 {
2085
1922
  }
2086
1923
 
2087
1924
  // pkgs/@akanjs/devkit/codeAgent/agent/CodeAgentGate.ts
2088
- import path8 from "path";
1925
+ import path7 from "path";
2089
1926
  var writeTools = new Set(["write", "edit"]);
2090
1927
  var commandTools = new Set(["bash"]);
2091
1928
 
@@ -2124,9 +1961,9 @@ class CodeAgentGate2 {
2124
1961
  return `The command names "${hit}", which the profile's deny list covers. Ask the user for the value instead of reading the file.`;
2125
1962
  }
2126
1963
  #deniedReason(target) {
2127
- const absolute = path8.isAbsolute(target) ? target : path8.resolve(this.#profile.paths.root, target);
2128
- const relative = path8.relative(this.#profile.paths.root, absolute);
2129
- if (relative.startsWith("..") || path8.isAbsolute(relative))
1964
+ const absolute = path7.isAbsolute(target) ? target : path7.resolve(this.#profile.paths.root, target);
1965
+ const relative = path7.relative(this.#profile.paths.root, absolute);
1966
+ if (relative.startsWith("..") || path7.isAbsolute(relative))
2130
1967
  return `Path is outside the agent root (${this.#profile.paths.root}).`;
2131
1968
  if (this.#deny.some((glob) => glob.match(absolute) || glob.match(relative)))
2132
1969
  return "Path is on the profile's deny list (secrets and environment files are never readable).";
@@ -2221,8 +2058,8 @@ class CodeAgentProxy {
2221
2058
  }
2222
2059
 
2223
2060
  // pkgs/@akanjs/devkit/codeAgent/agent/CodeAgentSuspended.ts
2224
- import { existsSync as existsSync8, mkdirSync as mkdirSync2, readFileSync as readFileSync4, rmSync, writeFileSync } from "fs";
2225
- import path9 from "path";
2061
+ import { existsSync as existsSync7, mkdirSync as mkdirSync2, readFileSync as readFileSync4, rmSync, writeFileSync } from "fs";
2062
+ import path8 from "path";
2226
2063
 
2227
2064
  class CodeAgentSuspended {
2228
2065
  #file;
@@ -2232,7 +2069,7 @@ class CodeAgentSuspended {
2232
2069
  this.#state = CodeAgentSuspended.#read(file);
2233
2070
  }
2234
2071
  static fileOf(sessionDir, sessionId) {
2235
- return sessionDir ? path9.join(sessionDir, `${sessionId}.suspended.json`) : null;
2072
+ return sessionDir ? path8.join(sessionDir, `${sessionId}.suspended.json`) : null;
2236
2073
  }
2237
2074
  get question() {
2238
2075
  return this.#state.question;
@@ -2277,12 +2114,12 @@ class CodeAgentSuspended {
2277
2114
  rmSync(this.#file, { force: true });
2278
2115
  return;
2279
2116
  }
2280
- mkdirSync2(path9.dirname(this.#file), { recursive: true });
2117
+ mkdirSync2(path8.dirname(this.#file), { recursive: true });
2281
2118
  writeFileSync(this.#file, `${JSON.stringify(this.#state)}
2282
2119
  `);
2283
2120
  }
2284
2121
  static #read(file) {
2285
- if (!file || !existsSync8(file))
2122
+ if (!file || !existsSync7(file))
2286
2123
  return { approvals: [] };
2287
2124
  try {
2288
2125
  const parsed = JSON.parse(readFileSync4(file, "utf8"));
@@ -2336,7 +2173,7 @@ class CodeAgentUi2 {
2336
2173
  // pkgs/@akanjs/devkit/codeAgent/agent/CodeMailbox.ts
2337
2174
  import {
2338
2175
  appendFileSync,
2339
- existsSync as existsSync9,
2176
+ existsSync as existsSync8,
2340
2177
  mkdirSync as mkdirSync3,
2341
2178
  readdirSync as readdirSync3,
2342
2179
  readFileSync as readFileSync5,
@@ -2344,7 +2181,7 @@ import {
2344
2181
  statSync as statSync5,
2345
2182
  writeFileSync as writeFileSync2
2346
2183
  } from "fs";
2347
- import path10 from "path";
2184
+ import path9 from "path";
2348
2185
  class CodeMailbox2 {
2349
2186
  static staleMs = 20000;
2350
2187
  static beatMs = 5000;
@@ -2363,11 +2200,11 @@ class CodeMailbox2 {
2363
2200
  this.#name = name;
2364
2201
  }
2365
2202
  get inbox() {
2366
- return path10.join(this.#dir, "inbox", `${this.#id}.jsonl`);
2203
+ return path9.join(this.#dir, "inbox", `${this.#id}.jsonl`);
2367
2204
  }
2368
2205
  open(cwd, onMail) {
2369
- mkdirSync3(path10.join(this.#dir, "live"), { recursive: true });
2370
- mkdirSync3(path10.join(this.#dir, "inbox"), { recursive: true });
2206
+ mkdirSync3(path9.join(this.#dir, "live"), { recursive: true });
2207
+ mkdirSync3(path9.join(this.#dir, "inbox"), { recursive: true });
2371
2208
  this.#read = readJsonLines(this.inbox).length;
2372
2209
  this.beat(cwd);
2373
2210
  this.#beat = setInterval(() => this.beat(cwd), CodeMailbox2.beatMs);
@@ -2384,7 +2221,7 @@ class CodeMailbox2 {
2384
2221
  this.#beat = null;
2385
2222
  this.#poll = null;
2386
2223
  try {
2387
- rmSync2(path10.join(this.#dir, "live", `${this.#id}.json`), { force: true });
2224
+ rmSync2(path9.join(this.#dir, "live", `${this.#id}.json`), { force: true });
2388
2225
  } catch {}
2389
2226
  }
2390
2227
  rename(name, cwd) {
@@ -2394,15 +2231,15 @@ class CodeMailbox2 {
2394
2231
  beat(cwd) {
2395
2232
  const peer = { id: this.#id, name: this.#name, cwd, pid: process.pid, at: Date.now() };
2396
2233
  try {
2397
- writeFileSync2(path10.join(this.#dir, "live", `${this.#id}.json`), JSON.stringify(peer));
2234
+ writeFileSync2(path9.join(this.#dir, "live", `${this.#id}.json`), JSON.stringify(peer));
2398
2235
  } catch {}
2399
2236
  }
2400
2237
  peers() {
2401
- const dir = path10.join(this.#dir, "live");
2402
- if (!existsSync9(dir))
2238
+ const dir = path9.join(this.#dir, "live");
2239
+ if (!existsSync8(dir))
2403
2240
  return [];
2404
2241
  const now = Date.now();
2405
- return readdirSync3(dir).filter((entry) => entry.endsWith(".json")).map((entry) => CodeMailbox2.#peer(path10.join(dir, entry))).filter((peer) => !!peer && peer.id !== this.#id && now - peer.at < CodeMailbox2.staleMs).sort((left, right) => right.at - left.at);
2242
+ return readdirSync3(dir).filter((entry) => entry.endsWith(".json")).map((entry) => CodeMailbox2.#peer(path9.join(dir, entry))).filter((peer) => !!peer && peer.id !== this.#id && now - peer.at < CodeMailbox2.staleMs).sort((left, right) => right.at - left.at);
2406
2243
  }
2407
2244
  find(target) {
2408
2245
  const needle = target.trim().toLowerCase();
@@ -2420,8 +2257,8 @@ class CodeMailbox2 {
2420
2257
  throw new Error(`Too many messages: ${CodeMailbox2.sendsPerMinute} a minute is the ceiling.`);
2421
2258
  this.#sent.push(now);
2422
2259
  const mail = { at: now, from: this.#id, fromName: this.#name, text };
2423
- mkdirSync3(path10.join(this.#dir, "inbox"), { recursive: true });
2424
- appendFileSync(path10.join(this.#dir, "inbox", `${to}.jsonl`), `${JSON.stringify(mail)}
2260
+ mkdirSync3(path9.join(this.#dir, "inbox"), { recursive: true });
2261
+ appendFileSync(path9.join(this.#dir, "inbox", `${to}.jsonl`), `${JSON.stringify(mail)}
2425
2262
  `);
2426
2263
  }
2427
2264
  #drain() {
@@ -2445,7 +2282,7 @@ class CodeMailbox2 {
2445
2282
  // pkgs/@akanjs/devkit/codeAgent/agent/CodeSessionFork.ts
2446
2283
  import { randomBytes } from "crypto";
2447
2284
  import { readFileSync as readFileSync6, writeFileSync as writeFileSync3 } from "fs";
2448
- import path11 from "path";
2285
+ import path10 from "path";
2449
2286
  import { codeAgentSessionName } from "akanjs/common";
2450
2287
  class CodeSessionFork2 {
2451
2288
  static fork(dir, id, name) {
@@ -2465,7 +2302,7 @@ class CodeSessionFork2 {
2465
2302
  first.id = forked;
2466
2303
  first.timestamp = at.toISOString();
2467
2304
  records.push(CodeSessionFork2.#named(records, name ?? CodeSessionFork2.#nameOf(records), at));
2468
- const file = path11.join(dir, `${at.toISOString().replace(/[:.]/g, "-")}_${forked}.jsonl`);
2305
+ const file = path10.join(dir, `${at.toISOString().replace(/[:.]/g, "-")}_${forked}.jsonl`);
2469
2306
  writeFileSync3(file, `${records.map((record) => JSON.stringify(record)).join(`
2470
2307
  `)}
2471
2308
  `);
@@ -2529,6 +2366,10 @@ class CodeAgent2 {
2529
2366
  profile: options.profile,
2530
2367
  apps: options.apps ?? [],
2531
2368
  canSeeImages: akanCodeModelSupportsImages2(model),
2369
+ model: () => {
2370
+ const current = agent.#session?.model;
2371
+ return current ? { provider: current.provider, id: current.id } : undefined;
2372
+ },
2532
2373
  deepseek: await DeepSeekWeb.fromRuntime(modelRuntime, !!proxy),
2533
2374
  depth: options.depth ?? 0,
2534
2375
  ...options.subagentSpend ? { subagentSpend: options.subagentSpend } : {},
@@ -2962,4 +2803,4 @@ Continue the task.`);
2962
2803
  }
2963
2804
  }
2964
2805
 
2965
- export { AkanEditScope2, DevLogFeedback2, PreviewChrome2, PreviewView2, PreviewFeedback2, TurnFeedback2, AkanCli2, AkanVerifier2, VerifyFeedback2, AkanToolPack2, MailToolPack2, McpUnauthorized2, McpClient2, McpToolPack2, SessionToolPack2, WebToolPack2, AkanCodePlugins2, AkanEnvKeys2, akanSystemPrompt2, CodeSessionIndex2, AkanCodeServices2, CodeAgentAsks2, CodeAgentEventMapper2, CodeAgentGate2, CodeAgentUi2, CodeMailbox2, CodeSessionFork2, CodeAgent2 };
2806
+ export { AkanEditScope2, DevLogFeedback2, PreviewFeedback2, TurnFeedback2, AkanCli2, AkanVerifier2, VerifyFeedback2, AkanToolPack2, MailToolPack2, McpUnauthorized2, McpClient2, McpToolPack2, SessionToolPack2, WebToolPack2, AkanCodePlugins2, AkanEnvKeys2, akanSystemPrompt2, CodeSessionIndex2, AkanCodeServices2, CodeAgentAsks2, CodeAgentEventMapper2, CodeAgentGate2, CodeAgentUi2, CodeMailbox2, CodeSessionFork2, CodeAgent2 };
@@ -0,0 +1 @@
1
+ // @bun