@akanjs/cli 3.0.0-beta.16 → 3.0.0-beta.18

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 (134) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-zgccwajm.js → CodeAgent-0035exh3.js} +2 -2
  3. package/{CodeTui-993tx7gf.js → CodeTui-eweg1hep.js} +384 -28
  4. package/{agent.command-n664dtcv.js → agent.command-65zqfkg0.js} +6 -6
  5. package/akanCode.js +11 -9
  6. package/{application.command-t5542jte.js → application.command-2wcj5da3.js} +18 -11
  7. package/{applicationBuildRunner-x4gbfn7y.js → applicationBuildRunner-m0hhgwsx.js} +6 -5
  8. package/{applicationReleasePackager-z61ep017.js → applicationReleasePackager-vykfzgx3.js} +1 -1
  9. package/buildBatch.proc.js +2 -2
  10. package/{capacitorApp-shv3ajh5.js → capacitorApp-2daqhb5h.js} +2 -2
  11. package/{cloud.command-4x35k1z6.js → cloud.command-960bgbf4.js} +8 -8
  12. package/{cloud.script-3k8nbbpn.js → cloud.script-qhcnqt1n.js} +8 -8
  13. package/{code.command-mrfb7a1g.js → code.command-4feh3ef7.js} +7 -7
  14. package/{context.command-pqsm5jrk.js → context.command-kzehkx48.js} +14 -14
  15. package/context.runner-z0rrcz7b.js +22 -0
  16. package/{devTui-gy6mendg.js → devTui-ffjsarqa.js} +3 -3
  17. package/{devTuiView-y1548wy6.js → devTuiView-1q1mdgrv.js} +1 -1
  18. package/{guideline.command-rpc2emw8.js → guideline.command-3w2g20x4.js} +8 -13
  19. package/guidelines/conventions/conventions.instruction.md +37 -22
  20. package/guidelines/queryRule/queryRule.instruction.md +1 -1
  21. package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
  22. package/guidelines/transportRule/transportRule.instruction.md +10 -8
  23. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +4 -3
  24. package/incrementalBuilder.proc.js +1 -1
  25. package/{index-sxg87a8f.js → index-14zrtgfa.js} +164 -98
  26. package/{index-57p9p179.js → index-3hpxeys1.js} +6 -5
  27. package/{index-sn7dnzq4.js → index-4r42ext5.js} +1 -1
  28. package/{index-3mg4h788.js → index-6q589y9t.js} +2 -2
  29. package/index-9dp031by.js +12 -0
  30. package/{index-p4p9t45x.js → index-bwxpk2cj.js} +4 -18
  31. package/{index-g9zghs4h.js → index-cjw1sj1x.js} +12 -12
  32. package/{index-te0y1c0m.js → index-d9fjz06h.js} +12 -7
  33. package/{index-4n4821gp.js → index-dw943k93.js} +4 -4
  34. package/{index-4cvpzkq6.js → index-ef228gzf.js} +3 -3
  35. package/{index-3cymrzsb.js → index-erfc1x40.js} +17 -3
  36. package/{index-ns128c4q.js → index-h94faz96.js} +13 -20
  37. package/index-jd01kj5r.js +656 -0
  38. package/{index-5405kc0x.js → index-jwexzh42.js} +363 -247
  39. package/{index-wfwknnje.js → index-jwrpsrg3.js} +8 -6
  40. package/{index-kvzjda3v.js → index-m41ptvat.js} +5 -5
  41. package/{index-qh7brn20.js → index-mt2154s2.js} +6 -2
  42. package/{index-xjc7gg65.js → index-pn8mhpps.js} +23 -33
  43. package/{index-vpx68e4x.js → index-q9c3c0hy.js} +2 -2
  44. package/{index-v17gj504.js → index-rpgxs245.js} +2 -2
  45. package/{index-twq9p2sp.js → index-s5rhm04y.js} +0 -6
  46. package/{index-018dszb3.js → index-sbfk9daf.js} +10 -3
  47. package/{index-zg0v1zte.js → index-wcg582a8.js} +5 -5
  48. package/{index-6na0sd2b.js → index-ycy302an.js} +5 -2
  49. package/{index-qhtj9y6j.js → index-yw6g3bbv.js} +74 -21
  50. package/{index-2pm1j01n.js → index-zmj143x7.js} +4 -4
  51. package/{index-zn8qgeqx.js → index-zq0mr3hh.js} +1 -1
  52. package/index.js +21 -21
  53. package/{library.command-m8p2r1dh.js → library.command-fp0nhr62.js} +3 -3
  54. package/{localRegistry.command-tt00nwwg.js → localRegistry.command-8y0ecxb9.js} +7 -7
  55. package/{module.command-mfzvqt0n.js → module.command-kqkn48t2.js} +5 -5
  56. package/{package.command-8sy6jjwy.js → package.command-qverjh22.js} +4 -4
  57. package/package.json +8 -6
  58. package/{page.command-taenb02b.js → page.command-94bwhd0g.js} +3 -3
  59. package/{primitive.command-7kpncmkk.js → primitive.command-2ydvtah2.js} +6 -6
  60. package/{prompter-9mn3kp36.js → prompter-1f8d9pcc.js} +1 -1
  61. package/{quality.command-1ar94hrw.js → quality.command-fa0gth4p.js} +3 -4
  62. package/{repair.command-n08t6j8p.js → repair.command-4qng2hpm.js} +5 -5
  63. package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
  64. package/{scalar.command-mq8qfp4t.js → scalar.command-pb2y95sh.js} +4 -4
  65. package/skills/akan-code/SKILL.md +122 -0
  66. package/skills/akan-module/SKILL.md +2 -2
  67. package/skills/akan-store/SKILL.md +6 -2
  68. package/{subspace.command-x9897gj4.js → subspace.command-vkxmwp74.js} +4 -4
  69. package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
  70. package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
  71. package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
  72. package/templates/appSample/lib/task/task.abstract.ts +12 -32
  73. package/templates/appSample/lib/task/task.signal.spec.ts +15 -18
  74. package/templates/appSample/lib/task/task.signal.test.ts +14 -0
  75. package/templates/appSample/lib/task/task.signal.ts +1 -1
  76. package/templates/appSample/srvkit/AuthGuard.ts +4 -1
  77. package/templates/appSample/srvkit/SessionInternalArg.ts +3 -1
  78. package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
  79. package/templates/crudPages/[__model__Id]/page.tsx +2 -1
  80. package/templates/crudPages/new/page.tsx +2 -1
  81. package/templates/crudPages/page.tsx +2 -1
  82. package/templates/crudSinglePage/page.tsx +2 -1
  83. package/templates/module/__model__.signal.ts +12 -4
  84. package/templates/pkgRoot/tsconfig.json.template +2 -7
  85. package/templates/service/__model__.abstract.md.template +8 -0
  86. package/{tunnel.command-ht2es78c.js → tunnel.command-02cvp9nf.js} +2 -2
  87. package/{workflow.command-tvz4nm9n.js → workflow.command-132txnrh.js} +9 -9
  88. package/{workspace.command-ayqa1rgt.js → workspace.command-d5wkswek.js} +21 -21
  89. package/context.runner-bys6ykcp.js +0 -22
  90. package/guidelines/agentRule/agentRule.generate.json +0 -31
  91. package/guidelines/componentRule/componentRule.generate.json +0 -31
  92. package/guidelines/conventions/conventions.generate.json +0 -25
  93. package/guidelines/cssRule/cssRule.generate.json +0 -31
  94. package/guidelines/docPageRule/docPageRule.generate.json +0 -31
  95. package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
  96. package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
  97. package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
  98. package/guidelines/enumConstant/enumConstant.generate.json +0 -31
  99. package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
  100. package/guidelines/fieldRule/fieldRule.generate.json +0 -31
  101. package/guidelines/framework/framework.generate.json +0 -32
  102. package/guidelines/mcpRule/mcpRule.generate.json +0 -35
  103. package/guidelines/modelConstant/modelConstant.generate.json +0 -32
  104. package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
  105. package/guidelines/modelDocument/modelDocument.generate.json +0 -31
  106. package/guidelines/modelService/modelService.generate.json +0 -31
  107. package/guidelines/modelSignal/modelSignal.generate.json +0 -31
  108. package/guidelines/modelStore/modelStore.generate.json +0 -31
  109. package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
  110. package/guidelines/modelUnit/modelUnit.generate.json +0 -31
  111. package/guidelines/modelUtil/modelUtil.generate.json +0 -31
  112. package/guidelines/modelView/modelView.generate.json +0 -31
  113. package/guidelines/modelZone/modelZone.generate.json +0 -31
  114. package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
  115. package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
  116. package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
  117. package/guidelines/queryRule/queryRule.generate.json +0 -31
  118. package/guidelines/recipeRule/recipeRule.generate.json +0 -31
  119. package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
  120. package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
  121. package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
  122. package/guidelines/scalarModule/scalarModule.generate.json +0 -31
  123. package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
  124. package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
  125. package/guidelines/ssrRule/ssrRule.generate.json +0 -31
  126. package/guidelines/transportRule/transportRule.generate.json +0 -31
  127. package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
  128. package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
  129. package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
  130. package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -34
  131. package/index-jgrnpt6y.js +0 -121
  132. package/templates/__scalar/__model__/__model__.abstract.md +0 -28
  133. package/templates/module/__model__.abstract.md +0 -28
  134. package/templates/service/__model__.abstract.md +0 -28
@@ -3,13 +3,13 @@ import {
3
3
  Lib,
4
4
  Workspace,
5
5
  command
6
- } from "./index-6na0sd2b.js";
6
+ } from "./index-ycy302an.js";
7
7
  import"./index-q0y2jq9j.js";
8
- import"./index-p4p9t45x.js";
8
+ import"./index-bwxpk2cj.js";
9
9
  import"./index-6wwzs1bc.js";
10
10
  import {
11
11
  LibraryScript
12
- } from "./index-3mg4h788.js";
12
+ } from "./index-6q589y9t.js";
13
13
 
14
14
  // pkgs/@akanjs/cli/library/library.command.ts
15
15
  class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
@@ -4,28 +4,28 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-6na0sd2b.js";
7
+ } from "./index-ycy302an.js";
8
8
  import"./index-q0y2jq9j.js";
9
9
  import {
10
10
  PkgExecutor
11
- } from "./index-p4p9t45x.js";
11
+ } from "./index-bwxpk2cj.js";
12
12
  import"./index-6wwzs1bc.js";
13
13
  import {
14
14
  ApplicationScript
15
- } from "./index-ns128c4q.js";
16
- import"./index-3mg4h788.js";
15
+ } from "./index-h94faz96.js";
16
+ import"./index-6q589y9t.js";
17
17
  import"./index-hwkygn9s.js";
18
18
  import"./index-7md2g9vw.js";
19
19
  import"./index-myj01w9r.js";
20
20
  import {
21
21
  getNpmRegistryUrl,
22
22
  CloudRunner
23
- } from "./index-57p9p179.js";
23
+ } from "./index-3hpxeys1.js";
24
24
  import"./index-kcxmv48c.js";
25
25
  import {
26
26
  PackageScript
27
- } from "./index-018dszb3.js";
28
- import"./index-sn7dnzq4.js";
27
+ } from "./index-sbfk9daf.js";
28
+ import"./index-4r42ext5.js";
29
29
 
30
30
  // pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
31
31
  import { mkdir, rm } from "fs/promises";
@@ -3,17 +3,17 @@ import {
3
3
  Sys,
4
4
  Module,
5
5
  command
6
- } from "./index-6na0sd2b.js";
6
+ } from "./index-ycy302an.js";
7
7
  import"./index-q0y2jq9j.js";
8
- import"./index-p4p9t45x.js";
8
+ import"./index-bwxpk2cj.js";
9
9
  import"./index-6wwzs1bc.js";
10
10
  import {
11
11
  renderPrimitiveReport
12
- } from "./index-qhtj9y6j.js";
13
- import"./index-qh7brn20.js";
12
+ } from "./index-yw6g3bbv.js";
13
+ import"./index-mt2154s2.js";
14
14
  import {
15
15
  ModuleScript
16
- } from "./index-xjc7gg65.js";
16
+ } from "./index-pn8mhpps.js";
17
17
 
18
18
  // pkgs/@akanjs/cli/module/module.command.ts
19
19
  import { Logger, lowerlize } from "akanjs/common";
@@ -3,21 +3,21 @@ import {
3
3
  Pkg,
4
4
  Workspace,
5
5
  command
6
- } from "./index-6na0sd2b.js";
6
+ } from "./index-ycy302an.js";
7
7
  import"./index-q0y2jq9j.js";
8
- import"./index-p4p9t45x.js";
8
+ import"./index-bwxpk2cj.js";
9
9
  import"./index-6wwzs1bc.js";
10
10
  import"./index-kcxmv48c.js";
11
11
  import {
12
12
  PackageScript
13
- } from "./index-018dszb3.js";
13
+ } from "./index-sbfk9daf.js";
14
14
 
15
15
  // pkgs/@akanjs/cli/package/package.command.ts
16
16
  class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
17
17
  version: target({ desc: "Show version information for all packages" }).with(Workspace).exec(async function(workspace) {
18
18
  await this.packageScript.version(workspace);
19
19
  }),
20
- createPackage: target({ desc: "Create a new package in pkgs/akanjs/" }).option("name", String, { desc: "name of package" }).with(Workspace).exec(async function(name, workspace) {
20
+ createPackage: target({ desc: "Create a new package in pkgs/<name>/" }).option("name", String, { desc: "name of package" }).with(Workspace).exec(async function(name, workspace) {
21
21
  await this.packageScript.createPackage(workspace, name.toLowerCase().replace(/ /g, "-"));
22
22
  }),
23
23
  removePackage: target({ desc: "Remove a package from the workspace" }).with(Pkg).exec(async function(pkg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.0.0-beta.16",
3
+ "version": "3.0.0-beta.18",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -31,14 +31,16 @@
31
31
  "./package.json": "./package.json"
32
32
  },
33
33
  "dependencies": {
34
- "@earendil-works/pi-agent-core": "0.80.6",
35
- "@earendil-works/pi-ai": "0.80.6",
36
- "@earendil-works/pi-coding-agent": "0.80.6",
37
- "@earendil-works/pi-tui": "0.80.6",
34
+ "@earendil-works/chord": "0.86.1",
35
+ "@earendil-works/pi-agent-core": "0.86.1",
36
+ "@earendil-works/pi-ai": "0.86.1",
37
+ "@earendil-works/pi-coding-agent": "0.86.1",
38
+ "@earendil-works/pi-telemetry": "0.86.1",
39
+ "@earendil-works/pi-tui": "0.86.1",
38
40
  "@inquirer/prompts": "^8.4.3",
39
41
  "@tailwindcss/node": "^4.3.0",
40
42
  "@trapezedev/project": "^7.1.4",
41
- "akanjs": "3.0.0-beta.16",
43
+ "akanjs": "3.0.0-beta.18",
42
44
  "chalk": "^5.6.2",
43
45
  "commander": "^14.0.3",
44
46
  "dayjs": "^1.11.20",
@@ -3,13 +3,13 @@ import {
3
3
  App,
4
4
  Module,
5
5
  command
6
- } from "./index-6na0sd2b.js";
6
+ } from "./index-ycy302an.js";
7
7
  import"./index-q0y2jq9j.js";
8
- import"./index-p4p9t45x.js";
8
+ import"./index-bwxpk2cj.js";
9
9
  import"./index-6wwzs1bc.js";
10
10
  import {
11
11
  PageScript
12
- } from "./index-qh7brn20.js";
12
+ } from "./index-mt2154s2.js";
13
13
 
14
14
  // pkgs/@akanjs/cli/page/page.command.ts
15
15
  class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
@@ -2,18 +2,18 @@
2
2
  import {
3
3
  Workspace,
4
4
  command
5
- } from "./index-6na0sd2b.js";
5
+ } from "./index-ycy302an.js";
6
6
  import"./index-q0y2jq9j.js";
7
- import"./index-p4p9t45x.js";
7
+ import"./index-bwxpk2cj.js";
8
8
  import"./index-6wwzs1bc.js";
9
9
  import {
10
10
  renderPrimitiveReport
11
- } from "./index-qhtj9y6j.js";
12
- import"./index-qh7brn20.js";
13
- import"./index-xjc7gg65.js";
11
+ } from "./index-yw6g3bbv.js";
12
+ import"./index-mt2154s2.js";
13
+ import"./index-pn8mhpps.js";
14
14
  import {
15
15
  PrimitiveScript
16
- } from "./index-te0y1c0m.js";
16
+ } from "./index-d9fjz06h.js";
17
17
 
18
18
  // pkgs/@akanjs/cli/primitive/primitive.command.ts
19
19
  import { Logger } from "akanjs/common";
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  Prompter2
4
- } from "./index-twq9p2sp.js";
4
+ } from "./index-s5rhm04y.js";
5
5
  import"./index-6wwzs1bc.js";
6
6
  export {
7
7
  Prompter2 as Prompter
@@ -4,13 +4,13 @@ import {
4
4
  runner,
5
5
  script,
6
6
  command
7
- } from "./index-6na0sd2b.js";
7
+ } from "./index-ycy302an.js";
8
8
  import"./index-q0y2jq9j.js";
9
9
  import {
10
10
  rootAllowedFiles,
11
11
  rootAllowedDirs,
12
12
  isAllowedLibFacetRootFile
13
- } from "./index-p4p9t45x.js";
13
+ } from "./index-bwxpk2cj.js";
14
14
  import"./index-6wwzs1bc.js";
15
15
 
16
16
  // pkgs/@akanjs/devkit/qualityScanner.ts
@@ -28,7 +28,6 @@ class AbstractDoc {
28
28
  siblingFiles;
29
29
  static suffix = ".abstract.md";
30
30
  static maxLines = 300;
31
- static compactMinLines = 40;
32
31
  static #facetRoots = "{lib,ui,webkit,srvkit,common,plugin}";
33
32
  static isAbstractPath(filePath) {
34
33
  return filePath.endsWith(AbstractDoc.suffix);
@@ -551,7 +550,7 @@ var RULE_FIXES = {
551
550
  "akan.global.duplicate-exported-function-body": "Extract the shared implementation into a single exported helper and import it, instead of copying the body.",
552
551
  "akan.file.recommended-max-lines": "Split the file by responsibility \u2014 move Zones, Utils, or subcomponents into sibling files.",
553
552
  "akan.file.max-lines": "Break the file into smaller focused modules; keep one primary responsibility per file.",
554
- "akan.file.abstract-max-lines": "Run `akan compact <app-or-lib>` to rewrite the abstract with the AI editor, keeping only the invariants and workflows the source files cannot show.",
553
+ "akan.file.abstract-max-lines": "Trim the abstract by hand to a title, one sentence naming what the module owns, a `## Rules` list of the invariants the source cannot show, and an optional workflow chain.",
555
554
  "akan.file.placeholder-export": "Remove the placeholder export; generated indexes should only re-export real modules.",
556
555
  "akan.file.bang-comment-in-client": "Rewrite the marker as `// FIXME:` or `// TODO:`. Keep the bang form for server, srvkit, and CLI files.",
557
556
  "akan.file.dictionary-stale-text": "Replace the scaffold text with real localized copy for this dictionary entry.",
@@ -3,16 +3,16 @@ import {
3
3
  Workspace,
4
4
  script,
5
5
  command
6
- } from "./index-6na0sd2b.js";
6
+ } from "./index-ycy302an.js";
7
7
  import"./index-q0y2jq9j.js";
8
- import"./index-p4p9t45x.js";
8
+ import"./index-bwxpk2cj.js";
9
9
  import"./index-6wwzs1bc.js";
10
10
  import"./index-by5gpp8x.js";
11
- import"./index-qhtj9y6j.js";
12
- import"./index-v17gj504.js";
11
+ import"./index-yw6g3bbv.js";
12
+ import"./index-rpgxs245.js";
13
13
  import {
14
14
  RepairRunner
15
- } from "./index-4cvpzkq6.js";
15
+ } from "./index-ef228gzf.js";
16
16
 
17
17
  // pkgs/@akanjs/cli/repair/repair.script.ts
18
18
  import { Logger } from "akanjs/common";
@@ -57,12 +57,6 @@ class RouteSourceValidator {
57
57
  if (exported.has("head") && exported.has("generateHead")) {
58
58
  throw new Error(`[route-convention] head and generateHead cannot both be exported in ${filePath}`);
59
59
  }
60
- if (!options.rootLayout && (exported.has("head") || exported.has("generateHead")) && (exported.has("metadata") || exported.has("generateMetadata"))) {
61
- throw new Error(`[route-convention] head/generateHead and metadata/generateMetadata cannot both be exported in ${filePath}`);
62
- }
63
- if (exported.has("metadata") && exported.has("generateMetadata")) {
64
- throw new Error(`[route-convention] metadata and generateMetadata cannot both be exported in ${filePath}`);
65
- }
66
60
  const chain = RouteSourceValidator.#readChain(sourceFile, filePath);
67
61
  if (!chain)
68
62
  return { devOnly: RouteSourceValidator.#readDevOnly(sourceFile, filePath) };
@@ -2,16 +2,16 @@
2
2
  import {
3
3
  Sys,
4
4
  command
5
- } from "./index-6na0sd2b.js";
5
+ } from "./index-ycy302an.js";
6
6
  import"./index-q0y2jq9j.js";
7
- import"./index-p4p9t45x.js";
7
+ import"./index-bwxpk2cj.js";
8
8
  import"./index-6wwzs1bc.js";
9
9
  import {
10
10
  renderPrimitiveReport
11
- } from "./index-qhtj9y6j.js";
11
+ } from "./index-yw6g3bbv.js";
12
12
  import {
13
13
  ScalarScript
14
- } from "./index-vpx68e4x.js";
14
+ } from "./index-q9c3c0hy.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/scalar/scalar.command.ts
17
17
  import { Logger, lowerlize } from "akanjs/common";
@@ -0,0 +1,122 @@
1
+ ---
2
+ name: akan-code
3
+ description: "Answer a question about `akan code` itself — how to add or remove an MCP server, sign one in, switch model, fork or resume a session, what the slash commands and keys are, and where its files live. Read this before telling anyone how to use this tool."
4
+ ---
5
+
6
+ # akan code — the manual
7
+
8
+ This is the tool the user is talking to right now. When they ask how to do something *with it* — rather than
9
+ with their code — answer from here, and quote the exact gesture: the slash command to type, or the file to
10
+ edit. Do not guess a command; everything this tool offers is listed below.
11
+
12
+ You cannot type a slash command yourself. They are the host's, not yours — say which one to type. You *can*
13
+ edit the files named below, which is the useful half of most of these answers: write the change, then say
14
+ which command makes it take effect.
15
+
16
+ ## MCP servers
17
+
18
+ Declared in **`.akan/code/mcp.json`**, in the same `mcpServers` shape Claude, Cursor and VS Code already
19
+ write, so a block can be pasted across rather than translated. VS Code's `servers` spelling is read too, and
20
+ whichever key the file already uses is the one a write goes back into.
21
+
22
+ ```jsonc
23
+ {
24
+ "mcpServers": {
25
+ "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"] },
26
+ "linear": { "url": "https://mcp.linear.app/sse" },
27
+ "internal": { "url": "https://…/mcp", "headers": { "x-api-key": "…" } },
28
+ "old": { "command": "x", "disabled": true }
29
+ }
30
+ }
31
+ ```
32
+
33
+ A `url` is an http server; anything else is a command with its argv. `env` passes variables to a stdio
34
+ server, `headers` goes on every http request (a server behind a static token needs nothing else), and
35
+ `disabled: true` keeps an entry without connecting it.
36
+
37
+ From the prompt:
38
+
39
+ ```
40
+ /mcp what is declared, what connected, and how many tools each gave
41
+ /mcp <name> the tools that one server published
42
+ /mcp add <name> <command> [args…]
43
+ /mcp add <name> <https://…>
44
+ /mcp remove <name>
45
+ /mcp login <name> OAuth, in the browser
46
+ /mcp logout <name> forget the token, leaving the server declared
47
+ /mcp reload reopen this session so the file takes effect
48
+ ```
49
+
50
+ **A server added now is not reachable until the session reloads.** The tool allowlist is fixed when the
51
+ session is created, so `add`, `remove`, `login` and `logout` all reload by themselves — a session that has
52
+ said nothing yet has nothing on disk to reopen, and says so. If you edit `mcp.json` yourself, tell the user to
53
+ run `/mcp reload`.
54
+
55
+ Sign-in is discovered, not configured: the server's `401` names its resource metadata, that names the
56
+ authorization server, and most hosted servers register a client on demand — so a url is usually the whole
57
+ entry. For a provider that issues client ids by hand, add `"oauth": { "clientId": "…", "scope": "…" }`.
58
+ Tokens are stored per server in `~/.akan/code/mcpAuth.json` at mode 0600, never in the repo, and refreshed
59
+ silently; `/mcp` shows `sign-in needed` when a server wants one.
60
+
61
+ ## Sessions
62
+
63
+ Stored under `.akan/code/sessions` — project history, so a second checkout of the same repo has its own.
64
+
65
+ - `←` at the start of the prompt lists past sessions; enter reopens the chosen one.
66
+ - `akan code --resume <id>` (`-R`) reopens one from the shell.
67
+ - `/fork [name]` continues the conversation twice: the copy takes over here, and the notice names the command
68
+ that reopens the original.
69
+ - `/name <text>` names this one, which is what the session list is read by.
70
+ - `/peers` lists other `akan code` sessions running in this workspace; `/msg <peer> <text>` hands one a
71
+ message.
72
+ - `/clear` wipes the screen and keeps the conversation; `/compact [notes]` shortens what the model carries.
73
+
74
+ ## Model, effort, keys
75
+
76
+ - `/model <provider>/<id>`, e.g. `/model deepseek/deepseek-v4-pro`. `/effort <level>` for how hard it thinks.
77
+ - A provider is authorized by **`<PROVIDER>_API_KEY`** — `DEEPSEEK_API_KEY`, `ANTHROPIC_API_KEY`. The
78
+ workspace's own `.env` is read as well as the environment, and a key found there is used for the run and
79
+ never copied anywhere.
80
+ - Credentials and the model catalogue live in `~/.akan/code/` (`auth.json`, `models.json`). **`AKAN_CODE_HOME`
81
+ moves the whole directory** — for a container with no home, or a checkout that wants its own.
82
+
83
+ ## What the agent reads, and how to change it
84
+
85
+ - Every `AGENTS.md` / `CLAUDE.md` from the workspace root down to the working directory, `.cursorrules`, and
86
+ any `.cursor/rules/*.mdc` that applies unconditionally (`alwaysApply: true`, or no frontmatter at all).
87
+ Edit those to change how this agent behaves in this repo — they are the files the editor beside it reads.
88
+ - Skills: drop a `<name>/SKILL.md` into `.akan/code/skills`. Extensions: `.akan/code/extensions`. Neither is
89
+ read from a home directory, so a session behaves the same in two checkouts.
90
+
91
+ ## Keys
92
+
93
+ ```
94
+ enter send · shift+enter newline · ↑↓ move (history at the edges) · ←→ move
95
+ esc interrupt · pgup/pgdn scroll · ^c quit · tab completes a slash command
96
+ @ completes a file in this repo · wheel scrolls the transcript (hold shift to select text instead)
97
+ cmd+v attaches an image from the clipboard · ^v does too, without the terminal in the way
98
+ ```
99
+
100
+ Most terminals send the same byte for enter and shift+enter, so the key only arrives where the terminal can
101
+ say which was pressed. In VS Code, bind it with `workbench.action.terminal.sendSequence` and a `text` of
102
+ `"\\\u001b\r"`; iTerm2 calls the same thing "Send Text". Either spelling of that sequence works here, and
103
+ the backslash a shell would read as a line continuation never reaches the prompt.
104
+
105
+ ## Starting it
106
+
107
+ ```
108
+ akan code open the session
109
+ akan code "<prompt>" run one turn and print the answer
110
+ akan code -i "<prompt>" open the session with the prompt already sent
111
+ --app <name> narrow the agent to one app
112
+ --profile local|pod|review|web what it may do (default local)
113
+ --model <provider>/<id> --thinking, --json, --rpc, --resume <id>
114
+ ```
115
+
116
+ `review` reads and never writes, loads no project context files, and keeps no session on disk. `pod` has
117
+ nobody in front of it: it cannot ask a question. MCP is off in both.
118
+
119
+ ## The rest of the commands
120
+
121
+ `/help` prints all of this list · `/tools` what this session can call · `/agents` what a sub-agent may be and
122
+ what one may spend · `/thinking` shows or folds the reasoning · `/abort` stops the running turn · `/quit`.
@@ -41,5 +41,5 @@ module. Collection-level helpers go `static` on the full model.
41
41
  - Read the module's `<module>.abstract.md` before changing it, and update it when an invariant or workflow
42
42
  changes — not for formatting.
43
43
 
44
- Deeper detail per layer is a `get_guideline` call away: `moduleOverview`, `moduleCodegen`, `modelConstant`,
45
- `modelDocument`, `modelService`, `modelSignal`, `modelStore`, `modelDictionary`.
44
+ Deeper detail per layer is a `get_guideline` call away: `moduleOverview`, `modelConstant`, `modelDocument`,
45
+ `modelService`, `modelSignal`, `modelStore`, `modelDictionary`.
@@ -37,14 +37,18 @@ Only what the generated set does not cover: extra client state, a multi-step or
37
37
  calls to the non-CRUD endpoints you added in the signal. Each is an `async` method using `this.set(...)` /
38
38
  `this.get()` / `this.pick(...)`.
39
39
 
40
+ To reach another store, cast `this`: `import type { RootStore } from "../st"`, then
41
+ `(this as unknown as RootStore).logout()` to call its action or `(this as unknown as RootStore).set({ … })` /
42
+ `.get()` to write or read its state. Every store is mixed into one root at runtime, so the cast only tells the
43
+ type what `this` already is. Keep it `import type` — `st.ts` imports every store, so a value import is a cycle.
44
+
40
45
  A store that needs none of this stays empty. `store(sig.comment, () => ({}))` with an empty body is the
41
46
  correct, complete result — an empty store is not an unfinished one.
42
47
 
43
- ## Two rules the linter enforces
48
+ ## The rule the linter enforces
44
49
 
45
50
  - **An action returns nothing.** Every method dispatches through `st.do.<action>()` and is typed `void`, so a
46
51
  returned value is unreachable. Write it into state with `this.set({ … })`.
47
- - **Never `import type { RootStore } from "../st"`** — it crashes `akan build` with a Bun SSR segfault.
48
52
 
49
53
  ## From UI
50
54
 
@@ -11,16 +11,16 @@ import {
11
11
  runner,
12
12
  script,
13
13
  command
14
- } from "./index-6na0sd2b.js";
14
+ } from "./index-ycy302an.js";
15
15
  import {
16
16
  Executor,
17
17
  WorkspaceExecutor,
18
18
  AppExecutor
19
- } from "./index-p4p9t45x.js";
19
+ } from "./index-bwxpk2cj.js";
20
20
  import"./index-6wwzs1bc.js";
21
21
  import {
22
22
  SlicePlanner
23
- } from "./index-sn7dnzq4.js";
23
+ } from "./index-4r42ext5.js";
24
24
  import {
25
25
  LibSource
26
26
  } from "./index-3d9y066c.js";
@@ -725,7 +725,7 @@ class SubspaceRunner extends runner("subspace") {
725
725
  if (!asked)
726
726
  return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
727
727
  const { libs } = await subspace.slice();
728
- const { CloudScript } = await import("./cloud.script-3k8nbbpn.js");
728
+ const { CloudScript } = await import("./cloud.script-qhcnqt1n.js");
729
729
  const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
730
730
  host,
731
731
  workspaceId,
@@ -0,0 +1,8 @@
1
+ # <%= model %> Abstract
2
+
3
+ <One sentence: the value this scalar holds, and what embeds it.>
4
+
5
+ ## Rules
6
+
7
+ - <What a caller may assume about the value that the constant file cannot say: an order, a unit, a fixed value.>
8
+ - <Two to five of them. A single field's meaning goes in a trailing comment beside it in the constant file.>
@@ -3,45 +3,14 @@ import type { AppInfo, LibInfo } from "akanjs";
3
3
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { appName: string }) {
4
4
  return {
5
5
  filename: "workHistory.abstract.md",
6
- content: `# WorkHistory Scalar Abstract
7
-
8
- ## Akan.js Module Pattern
9
-
10
- WorkHistory is a **scalar module** — a reusable value type under lib/__scalar/.
11
- Scalar modules are embedded into models via field([ScalarType]), not stored independently.
12
- They live under the double-underscore prefix to distinguish them from database models.
13
-
14
- Standard scalar layers:
15
- - workHistory.constant.ts — enum (WorkHistoryAction) + entry class (WorkHistory) defined via via() + enumOf()
16
- - workHistory.dictionary.ts — i18n via scalarDictionary() (fewer layers than modelDictionary)
17
- - workHistory.abstract.md — embedding rules and intent
18
-
19
- ## Convention: lib/__scalar/<type>/ directory naming
20
-
21
- - Scalar modules use double-underscore prefix: lib/__scalar/workHistory/
22
- - Files drop the underscores: workHistory.constant.ts, not __workHistory.constant.ts
23
- - Models embed scalars via field([WorkHistory]) — list-of-scalar embedding
24
-
25
- ## Embedding Example (in task.constant.ts)
26
-
27
- TaskObject embeds a list of WorkHistory:
28
- import { WorkHistory } from "../../__scalar/workHistory/workHistory.constant";
29
- export class TaskObject extends via(TaskInput, (field) => ({
30
- workHistory: field([WorkHistory]),
31
- }))
32
-
33
- Each status change (create, start, complete) pushes a new entry.
34
-
35
- ## Agent Notes
36
-
37
- - Read this abstract before modifying the WorkHistory scalar.
38
- - Update when new action types or fields are added.
39
- - Do not duplicate workHistory fields in individual models; always reuse this scalar.
40
-
41
- ## Related Modules
42
-
43
- - lib/task/ — database module embedding workHistory as a list field
44
- - lib/_noti/ — pure service module (different module type, no scalar usage)
6
+ content: `# workHistory Abstract
7
+ One step in a task's history: which move happened, when, and an optional note.
8
+
9
+ ## Rules
10
+ - Entries are only appended — by \`Task\`'s chain methods and by the task service on create — and never edited or
11
+ removed, so the list reads as the task's moves in order.
12
+ - \`at\` is the moment the entry was built when the writer gives none.
13
+ - \`note\` is empty on every entry the app writes itself.
45
14
  `,
46
15
  };
47
16
  }
@@ -3,36 +3,13 @@ import type { AppInfo, LibInfo } from "akanjs";
3
3
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { appName: string }) {
4
4
  return {
5
5
  filename: "noti.abstract.md",
6
- content: `# Noti Abstract
6
+ content: `# noti Service Abstract
7
+ Noti holds the in-app notification list on the client: the messages the app shows, an unread count, and dismissal.
7
8
 
8
- ## Akan.js Module Pattern
9
-
10
- Noti is a **pure service module** — not a database module. It demonstrates the Akan.js convention
11
- for modules that orchestrate behavior without owning a persistent document model.
12
-
13
- Both module types follow the same layer pattern, but service modules have fewer layers:
14
- no constant.ts (no data shape), no document.ts (no DB queries), no UI components.
15
-
16
- - noti.service.ts — business logic via serve("noti" as const, ...) (named service, no DB binding)
17
- - noti.signal.ts — real-time pubsub endpoint bound via endpoint(srv.noti, ...)
18
- - noti.store.ts — client state via store("noti" as const, ...) (named store, no signal binding)
19
- - noti.dictionary.ts — i18n via serviceDictionary() (no model field labels)
20
-
21
- ## Convention: lib/_<service>/ directory naming
22
-
23
- - Service modules live under lib/_<service>/ — the underscore prefix signals "this is a service, not a database model."
24
- - Files drop the underscore: lib/_noti/noti.service.ts, not lib/_noti/_noti.service.ts.
25
- - Scan registers into the same barrel files: srv.ts, sig.ts, st.ts, dict.ts.
26
-
27
- ## Convention: named serve/store (no DB binding)
28
-
29
- - serve("noti" as const, ...) — service name passed as string, no db.<module> binding.
30
- - store("noti" as const, ...) — store name passed as string, no sig.<module> binding.
31
-
32
- ## Related Modules
33
-
34
- - lib/task/ — database module reference (compare structure differences)
35
- - lib/__scalar/workHistory/ — reusable scalar field modules (double-underscore prefix, embedded in models)
9
+ ## Rules
10
+ - Notifications live only in the client store; the server side declares nothing yet, so a reload starts empty.
11
+ - \`unreadCount\` counts additions since the last \`markAllRead()\`, not the list's length — removing a notification
12
+ does not lower it.
36
13
  `,
37
14
  };
38
15
  }
@@ -3,38 +3,18 @@ import type { AppInfo, LibInfo } from "akanjs";
3
3
  export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { appName: string }) {
4
4
  return {
5
5
  filename: "task.abstract.md",
6
- content: `# Task Abstract
7
-
8
- ## Akan.js Module Pattern
9
-
10
- Task is a **database-backed domain module** — the standard Akan.js pattern for persisted entities.
11
- This module demonstrates the full Akan.js module lifecycle:
12
- constant -> document -> service -> signal -> store -> UI.
13
-
14
- Every database module in Akan.js follows this layered architecture:
15
- - task.constant.ts — data shape (enum, Input, Object, Light, Full layers via via())
16
- - task.document.ts — DB queries, filters, sorts, indexes, Document chain methods
17
- - task.dictionary.ts — i18n labels, error messages, UI translations
18
- - task.service.ts — business logic orchestration bound to DB via serve(db.task, ...)
19
- - task.signal.ts — API surface (query, mutation, pubsub endpoints bound via endpoint(srv.task, ...))
20
- - task.store.ts — client state management bound to signal via store(sig.task, ...)
21
- - Task.*.tsx — UI components (Zone -> Load -> Unit / View / Template / Util)
22
-
23
- ## Convention: lib/<module>/ directory naming
24
-
25
- - Database modules live under lib/<module>/ (no underscore prefix)
26
- - Files follow <module>.<layer>.ts naming — e.g., task.constant.ts, task.service.ts
27
- - UI files use PascalCase with explicit suffix: Task.Zone.tsx, Task.Unit.tsx, Task.View.tsx
28
-
29
- ## Convention: scan-registered barrels
30
-
31
- akan sync auto-discovers each file and registers it in the corresponding barrel:
32
- cnst.ts, db.ts, dict.ts, srv.ts, sig.ts, st.ts
33
-
34
- ## Related Modules
35
-
36
- - lib/__scalar/workHistory/ — standard scalar modules with double-underscore prefix (reusable field sets)
37
- - lib/_noti/ — pure service module (compare structure differences: no constant/document, serve without DB binding)
6
+ content: `# task Abstract
7
+ A task is one unit of work that moves from todo through in progress to completed, and keeps a record of each move.
8
+
9
+ ## Rules
10
+ - A task only moves forward: \`start()\` needs \`todo\` and \`complete()\` needs \`inProgress\`; any other state throws.
11
+ - Every move appends one \`workHistory\` entry, and creation writes the first (\`created\`), so the history is never
12
+ empty and its last entry always matches \`status\`.
13
+ - Anyone may read a task; creating, changing, starting and completing one needs a signed-in caller. There is no
14
+ generated admin API (\`root: None\`).
15
+ - Removal is soft: a removed task keeps its row with \`removedAt\` set.
16
+
17
+ todo -> inProgress -> completed
38
18
  `,
39
19
  };
40
20
  }