@akanjs/cli 3.1.0-rc.8 → 3.1.0

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 (92) hide show
  1. package/.build-stamp +1 -1
  2. package/{CodeAgent-rkjyxgec.js → CodeAgent-c53dm40p.js} +2 -2
  3. package/{CodeAgentRpcHost-p7h6n2hp.js → CodeAgentRpcHost-9g27hmer.js} +1 -1
  4. package/{CodeTui-h7pyj6xa.js → CodeTui-xz9jtrn3.js} +47 -4
  5. package/README.ko.md +1 -1
  6. package/README.md +1 -1
  7. package/TunnelShare-59zd4j8n.js +14 -0
  8. package/{agent.command-3qxf4xcj.js → agent.command-qawf7z4s.js} +5 -5
  9. package/akanCode.js +7 -5
  10. package/{application.command-m1kcd7jf.js → application.command-jqrgqk6j.js} +35 -9
  11. package/{applicationBuildRunner-dj0xkrep.js → applicationBuildRunner-grgrey5c.js} +23 -8
  12. package/buildBatch.proc.js +9 -9
  13. package/{cloud.command-3jzym8q7.js → cloud.command-p9067ssj.js} +13 -13
  14. package/cloud.script-f0r4ce7j.js +24 -0
  15. package/{code.command-0ad6gw2a.js → code.command-t6j55sbk.js} +25 -12
  16. package/commandManifest.json +1 -1
  17. package/{context.command-0qx447mb.js → context.command-eqbzbgth.js} +16 -16
  18. package/context.runner-1cs88ags.js +25 -0
  19. package/{guideline.command-cv5bmrx2.js → guideline.command-w905q73w.js} +2 -2
  20. package/guidelines/agentRule/agentRule.instruction.md +25 -10
  21. package/guidelines/conventions/conventions.instruction.md +71 -24
  22. package/guidelines/fieldRule/fieldRule.instruction.md +17 -0
  23. package/guidelines/mcpRule/mcpRule.instruction.md +93 -48
  24. package/guidelines/modelDocument/modelDocument.instruction.md +2 -1
  25. package/guidelines/modelStore/modelStore.instruction.md +7 -0
  26. package/guidelines/pageRule/pageRule.instruction.md +55 -8
  27. package/guidelines/queryRule/queryRule.instruction.md +24 -10
  28. package/guidelines/runtimeRule/runtimeRule.instruction.md +12 -4
  29. package/guidelines/ssrRule/ssrRule.instruction.md +9 -6
  30. package/guidelines/transportRule/transportRule.instruction.md +36 -5
  31. package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +5 -3
  32. package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +28 -8
  33. package/incrementalBuilder.proc.js +3 -3
  34. package/{index-j4mkhz93.js → index-0dd6z4b9.js} +3 -3
  35. package/{index-h47cf1gg.js → index-1de5f0qq.js} +7 -7
  36. package/{index-6xn2n442.js → index-1enc9rga.js} +4 -4
  37. package/index-25ks6x4k.js +643 -0
  38. package/{index-wa5jbxj1.js → index-2mrn1mrg.js} +1 -0
  39. package/{index-qwa5k1j8.js → index-3aynkpf8.js} +1 -1
  40. package/{index-vk0pa0mn.js → index-3hvmytbs.js} +2 -1
  41. package/{index-w44cy4vs.js → index-45c0mxb6.js} +2 -2
  42. package/{index-fyq1z6kt.js → index-48n4yhm4.js} +3 -3
  43. package/{index-192ha4xh.js → index-64pjry21.js} +1 -1
  44. package/{index-5edzv8fn.js → index-aqwdjn4x.js} +2 -2
  45. package/{index-d2242ksy.js → index-at7bz0xq.js} +3 -0
  46. package/{index-9z426msb.js → index-avjqbtkj.js} +7 -6
  47. package/{index-20bxxyvn.js → index-bs9yr4we.js} +40 -2
  48. package/{index-d72hfmdm.js → index-cgexcnwd.js} +8 -8
  49. package/{index-1xj2t7cb.js → index-dkfadmrx.js} +7 -7
  50. package/{index-35hc95h5.js → index-eabfsarf.js} +1 -1
  51. package/{index-pydbnfez.js → index-er62k6w3.js} +35 -9
  52. package/{index-1p98exm2.js → index-f2gfq0yh.js} +2 -2
  53. package/{index-jw1zm273.js → index-fbw3kmt5.js} +54 -10
  54. package/{index-4mhy6qme.js → index-fnqj2d2w.js} +4 -4
  55. package/{index-awbdfcf2.js → index-hqh4mpgt.js} +4 -4
  56. package/{index-fmzcs8v6.js → index-j4dzazmw.js} +4 -4
  57. package/{index-va06nr10.js → index-n8dsax1f.js} +64 -19
  58. package/{index-g1mbppa9.js → index-nr8m4j21.js} +5 -5
  59. package/{index-86jt2a0e.js → index-qh73jnyb.js} +1 -1
  60. package/{index-8fp3b47h.js → index-vtj332gj.js} +281 -46
  61. package/{index-tamvyvj3.js → index-wt7m1hfc.js} +3 -3
  62. package/{index-cpb3nvma.js → index-yfy3t4kw.js} +2 -2
  63. package/{index-trpasv9q.js → index-yyxy7aff.js} +1 -1
  64. package/{index-d47ypebv.js → index-z5cxrbvv.js} +75 -19
  65. package/index.js +40 -22
  66. package/{library.command-erp2f56n.js → library.command-z1v7zepj.js} +3 -3
  67. package/{localRegistry.command-xxpqgxjw.js → localRegistry.command-48n23bjy.js} +12 -12
  68. package/{module.command-gs2r615e.js → module.command-rv307dk7.js} +5 -5
  69. package/{package.command-7343f74r.js → package.command-7xkzc8m1.js} +3 -3
  70. package/package.json +22 -22
  71. package/{page.command-4h4a8pnh.js → page.command-34hpdt7v.js} +3 -3
  72. package/{pipeline.command-a2nrk26m.js → pipeline.command-ckvhrpyg.js} +2 -2
  73. package/{primitive.command-w6t0asqz.js → primitive.command-em0twr5a.js} +6 -6
  74. package/{projectTypecheck-f534enqj.js → projectTypecheck-fy6hn05y.js} +1 -1
  75. package/{quality.command-77x7vbbx.js → quality.command-c6p2819k.js} +2 -2
  76. package/{repair.command-y6sstev7.js → repair.command-j6czdgrv.js} +5 -5
  77. package/{routeSourceValidator-7ycnfz0e.js → routeSourceValidator-6jd0q6r6.js} +47 -14
  78. package/{scalar.command-20b8cy0k.js → scalar.command-17e20sj2.js} +4 -4
  79. package/skills/akan-code/SKILL.md +4 -0
  80. package/skills/akan-store/SKILL.md +4 -2
  81. package/{subspace.command-92xkc0s0.js → subspace.command-n3j7vv0w.js} +8 -17
  82. package/templates/migration/__migrationId__.ts +23 -0
  83. package/templates/server.ts +8 -1
  84. package/templates/workspaceRoot/.gitignore.template +1 -1
  85. package/templates/workspaceRoot/biome.json.template +1 -1
  86. package/{tunnel.command-2kw8vt9g.js → tunnel.command-cm578f4s.js} +7 -7
  87. package/{workflow.command-2djwmpqf.js → workflow.command-h9vkr6jb.js} +10 -10
  88. package/{workspace.command-5se6spqb.js → workspace.command-tp8ysvjs.js} +30 -28
  89. package/TunnelShare-661cxz5e.js +0 -14
  90. package/cloud.script-r4nskbc6.js +0 -24
  91. package/context.runner-1vsjztjg.js +0 -25
  92. package/index-665zp9rs.js +0 -271
@@ -142,7 +142,19 @@ export class TaskService extends serve(db.task, ({ plug }) => ({
142
142
  }
143
143
  ```
144
144
 
145
- For a custom adapter class (not a predefined role), pass the class itself, e.g. `ipfsApi: plug(IpfsApi)`.
145
+ To reach the file itself (a `Bun.file()` response with ranges, a CLI tool, a size check), ask the role where it
146
+ lives: `this.storage.resolveLocalPath?.(path, access)` (`access` optional) answers the absolute disk path
147
+ `BlobStorage` uses, picking the root as its writes do with `access` and by the `private/` prefix without it. It
148
+ answers `null` for a key that is rooted, holds a NUL, or leaves that root — refuse that key, never fall back to
149
+ `readData()` for it. Fall back only when the adaptor has no `resolveLocalPath` at all (object storage). **A key
150
+ that reaches you from a request passes `access: "public"`**: without it a `private/` key resolves under the private
151
+ root, so a public route would serve private files. Never cast the role to reach `root` / `privateRoot`.
152
+
153
+ For a custom adapter class (not a predefined role), pass the class itself, e.g. `ipfsApi: plug(IpfsApi)`. Two framework
154
+ adapters are plugged that way: `rateLimit: plug(RateLimit)` to count a business key, and
155
+ `endpointCache: plug(EndpointCacheControl)` to drop an endpoint's `{ cache }` answers after the write that made them
156
+ stale: `await this.endpointCache.invalidate("bannerListInPublic")`, plus `"bannerInsightInPublic"` for a slice's
157
+ count.
146
158
  Injecting a file/image field is usually simpler than calling
147
159
  storage directly: declare `image: field(File).optional()` (or `images: field([File])`) on the model and let the
148
160
  store's generated `upload<Field>On<Model>(fileList)` action handle the upload. Add `{ cascade: "removeRef" }` to that
@@ -286,7 +298,11 @@ async startTask(taskId: string) {
286
298
 
287
299
  // 6. <Model>.Util.tsx — Reusable button component
288
300
  export const Start = ({ taskId }: { taskId: string }) => (
289
- <button className={buttonRecipe({ variant: "primary", size: "xs" })} onClick={() => st.do.startTask(taskId)}>
301
+ <button
302
+ type="button"
303
+ className={buttonRecipe({ variant: "primary", size: "xs" })}
304
+ onClick={() => st.do.startTask(taskId)}
305
+ >
290
306
  Start
291
307
  </button>
292
308
  );
@@ -410,9 +426,9 @@ export default page()
410
426
  .config({ transition: "stack" })
411
427
  .head(({ projectId }) => <title>{projectId}</title>)
412
428
  .prompt("briefProject", "Brief one project: its status and what is due.")
413
- .render(async ({ projectId, tab }) => {
429
+ .render(({ projectId, tab }) => {
414
430
  const { l } = usePage();
415
- const { projectView } = await fetch.viewProject(projectId);
431
+ const { projectView } = fetch.viewProject(projectId);
416
432
  return <Project.Zone.View view={projectView} tab={tab} />;
417
433
  });
418
434
  ```
@@ -435,7 +451,7 @@ export default page()
435
451
 
436
452
  Rules the loader and `akan sync` enforce: a chain module has no other export; `page()` belongs in a page file and
437
453
  `layout()` / `rootLayout()` in a `_layout.tsx`; a page names every `[x]` of its path, a layout may name a subset;
438
- `.param()` and `.prompt()` names are string literals; `import "./styles.css"` stays the first line of a root layout;
454
+ `.param()`, `.prompt()` and `.app()` names are string literals; `import "./styles.css"` stays the first line of a root layout;
439
455
  `_overrides.tsx` is untouched. MCP: `prompts/get` now runs the page's body under the caller's token and hands the
440
456
  model the description, what the page fetched, and the tools of those modules — see `mcpRule`.
441
457
 
@@ -537,7 +553,7 @@ akan sync automatically generates APIs across all layers. Only write custom logi
537
553
  | Auto-Generated | Description |
538
554
  |---------------|-------------|
539
555
  | `this.<model>Model` | Auto-injected model adaptor |
540
- | `get<Model>(id)`, `load<Model>(id)` | Single document lookup |
556
+ | `get<Model>(id)`, `load<Model>(id)` | Single document lookup: `get` throws `NoDocumentError` for a missing or removed id, answered 404 `base.error.documentNotFound`; `load` returns `null` |
541
557
  | `create<Model>(data)`, `update<Model>(id, data)`, `remove<Model>(id)` | CRUD operations — named after the model, e.g. `createTask`/`updateTask`/`removeTask` (there is no literal `createModel`) |
542
558
  | `list<Query>(args)`, `find<Query>(args)`, `pick<Query>(args)` | Filter-based queries |
543
559
  | `exists<Query>(args)`, `count<Query>(args)`, `insight<Query>(args)` | Filter-based helpers |
@@ -554,7 +570,10 @@ akan sync automatically generates APIs across all layers. Only write custom logi
554
570
  | `new[Model](partial)`, `edit[Model](model)`, `view[Model](model)` | Form/view state actions |
555
571
  | `[slice]List`, `[slice]InitList`, `[slice]Insight`, `[slice]Selection`, `hasMoreOf[Slice]` | Slice states |
556
572
  | `init[Slice](args)`, `refresh[Slice]()`, `setPageOf[Slice](page)`, `loadMoreOf[Slice]()` | Slice actions |
573
+ | `invalidate[Model]()` | Marks every slice stale without a request, so the next `Load.Units` / `Load.View` mount refetches — for a custom mutation whose changed rows the store never received |
557
574
  | `set[Field]On[Model](value)` | Auto-setters for each model field |
575
+ | `upload[Field]On[Model](fileList, idx?)` | Upload into a `File` field, scoped to the form that started it |
576
+ | `[model]FormUploading` | Pending uploads per `File` field (`{}` when idle); submits save nothing until empty |
558
577
 
559
578
  **Rule**: Write custom store actions only for toast messages (`msg.loading`/`msg.success`) or multi-step workflows. State fields and CRUD actions are already auto-generated.
560
579
 
@@ -568,8 +587,9 @@ akan sync automatically generates APIs across all layers. Only write custom logi
568
587
  | `exists[Query](args)`, `count[Query](args)` | Existence check and count |
569
588
  | `insight[Query](args)`, `query[Query](args)` | Insight and raw query |
570
589
  | `remove[Query](args)`, `removeOne[Query](args)` | Query-level soft remove — all matches, or the newest one (`createdAt` desc, not caller-chosen) |
590
+ | `purge[Query](args)` | Hard delete of every match, removed rows too, returning the count — no undo |
571
591
  | `update[Query](args).set(patch)`, `updateOne[Query](args).set(patch)` | Query-level update — the patch lands on a terminal `.set()`, because a filter's trailing args may be optional |
572
592
 
573
- **Rule**: Define `Filter` with `.query()` conditions in `document.ts`. akan sync auto-generates all 14 query helper methods per filter. Write `Document` chain methods only for state transitions with validation.
593
+ **Rule**: Define `Filter` with `.query()` conditions in `document.ts`. akan sync auto-generates all 15 query helper methods per filter. Write `Document` chain methods only for state transitions with validation.
574
594
 
575
- **The four query-level writes fire no hooks**, so no `_pre`/`_postRemove` and no cascade run — same as `updateManyByQuery`. Reach for them when the model carries no removal side effect; otherwise remove documents one at a time. A filter keyed after its own model (filter `chat` on model `chat`) is rejected at boot, because `removeChat`/`updateChat` would otherwise shadow the generated single-document CRUD.
595
+ **The five query-level writes fire no hooks**, so no `_pre`/`_postRemove` and no cascade run — same as `updateManyByQuery`. Reach for them when the model carries no removal side effect; otherwise remove documents one at a time. A filter keyed after its own model (filter `chat` on model `chat`) is rejected at boot, because `removeChat`/`updateChat` would otherwise shadow the generated single-document CRUD.
@@ -8,7 +8,7 @@ import {
8
8
  CodegenLock,
9
9
  WorkspaceExecutor,
10
10
  AppExecutor
11
- } from "./index-va06nr10.js";
11
+ } from "./index-n8dsax1f.js";
12
12
  import"./index-52w0fvh8.js";
13
13
  import {
14
14
  GraphClientEntryDiscovery,
@@ -19,10 +19,10 @@ import {
19
19
  DevChangePlanner,
20
20
  DevGeneratedIndexSync,
21
21
  SsrDevBundler
22
- } from "./index-w44cy4vs.js";
22
+ } from "./index-45c0mxb6.js";
23
23
  import {
24
24
  ServerGraphFile
25
- } from "./index-192ha4xh.js";
25
+ } from "./index-64pjry21.js";
26
26
  import {
27
27
  prepareDevWatchBatch
28
28
  } from "./index-a5vmm6x4.js";
@@ -5,13 +5,13 @@ import {
5
5
  writeGeneratedSyncState,
6
6
  createRepairReport,
7
7
  renderRepairReport
8
- } from "./index-trpasv9q.js";
8
+ } from "./index-yyxy7aff.js";
9
9
  import {
10
10
  AkanContextAnalyzer
11
- } from "./index-5edzv8fn.js";
11
+ } from "./index-aqwdjn4x.js";
12
12
  import {
13
13
  runner
14
- } from "./index-jw1zm273.js";
14
+ } from "./index-fbw3kmt5.js";
15
15
 
16
16
  // pkgs/@akanjs/cli/repair/repair.runner.ts
17
17
  var spawnShell = async (workspace, command) => await workspace.spawn("bash", ["-lc", command.startsWith("akan ") ? `bun run ${command}` : command], {
@@ -4,26 +4,26 @@ import {
4
4
  CloudApi,
5
5
  CloudUpdates,
6
6
  PipelineSecrets
7
- } from "./index-cpb3nvma.js";
7
+ } from "./index-yfy3t4kw.js";
8
8
  import {
9
9
  PkgExecutor
10
- } from "./index-va06nr10.js";
10
+ } from "./index-n8dsax1f.js";
11
11
  import {
12
12
  NativePublicEnv,
13
13
  UpdatePackFolder
14
- } from "./index-g1mbppa9.js";
14
+ } from "./index-nr8m4j21.js";
15
15
  import {
16
16
  script
17
- } from "./index-jw1zm273.js";
17
+ } from "./index-fbw3kmt5.js";
18
18
  import {
19
19
  ApplicationScript
20
- } from "./index-d47ypebv.js";
20
+ } from "./index-z5cxrbvv.js";
21
21
  import {
22
22
  PackageScript
23
- } from "./index-6xn2n442.js";
23
+ } from "./index-1enc9rga.js";
24
24
  import {
25
25
  CloudRunner
26
- } from "./index-fyq1z6kt.js";
26
+ } from "./index-48n4yhm4.js";
27
27
 
28
28
  // pkgs/@akanjs/cli/cloud/cloud.script.ts
29
29
  import { Logger } from "akanjs/common";
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-jw1zm273.js";
5
+ } from "./index-fbw3kmt5.js";
6
6
  import {
7
7
  FileSys2
8
8
  } from "./index-52w0fvh8.js";
9
9
  import {
10
10
  PkgExecutor
11
- } from "./index-va06nr10.js";
11
+ } from "./index-n8dsax1f.js";
12
12
  import {
13
13
  TypeScriptDependencyScanner2
14
14
  } from "./index-tvehn2sp.js";
@@ -159,10 +159,10 @@ class PackageRunner extends runner("package") {
159
159
  const packageRuntimeDependencies = {
160
160
  "@akanjs/devkit": [
161
161
  "tailwind-scrollbar",
162
- "@earendil-works/chord",
163
162
  "@earendil-works/pi-agent-core",
164
163
  "@earendil-works/pi-ai",
165
- "@earendil-works/pi-telemetry",
164
+ "@earendil-works/pi-codemode",
165
+ "@earendil-works/pi-mcp",
166
166
  "@earendil-works/pi-tui"
167
167
  ]
168
168
  };