@akanjs/cli 3.0.0-alpha.16 → 3.0.0-alpha.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/.build-stamp +1 -1
  2. package/README.ko.md +1 -1
  3. package/README.md +1 -1
  4. package/{abstractCompactor-e5yq60qz.js → abstractCompactor-khr60389.js} +1 -1
  5. package/{agent.command-h6tc0pzh.js → agent.command-e835fjem.js} +6 -6
  6. package/{application.command-kphnfwyg.js → application.command-bexm4597.js} +5 -5
  7. package/{applicationBuildRunner-9ps10a0h.js → applicationBuildRunner-sgr3aq5b.js} +5 -6
  8. package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-93nzdfsy.js} +1 -1
  9. package/buildBatch.proc.js +4 -4
  10. package/{capacitorApp-9ejk3k7q.js → capacitorApp-qv7g3dp2.js} +27 -27
  11. package/{cloud.command-zn6mfscb.js → cloud.command-v44fdp23.js} +8 -8
  12. package/{context.command-pkbccyys.js → context.command-q8r0tge3.js} +13 -13
  13. package/{dependencyScanner-f6grrep3.js → dependencyScanner-rbs2407b.js} +1 -1
  14. package/{getDirname-m9s0cmhq.js → getDirname-ka11hm7e.js} +1 -1
  15. package/{guideline.command-0jj2k77g.js → guideline.command-pye36g73.js} +3 -3
  16. package/guidelines/conventions/conventions.instruction.md +84 -6
  17. package/incrementalBuilder.proc.js +3 -3
  18. package/{index-xwfkgss0.js → index-33zce8gt.js} +8 -4
  19. package/{index-w7farjxd.js → index-3dp7x6rc.js} +3 -3
  20. package/{index-p42te6qb.js → index-73rnbwgg.js} +14 -6
  21. package/{index-1twehz1x.js → index-8vkkm7v0.js} +8 -18
  22. package/{index-g3brq942.js → index-9djnsdgf.js} +5 -5
  23. package/{index-b9m84bjp.js → index-d4d3q2r8.js} +10 -10
  24. package/{index-96vpa123.js → index-fb2wa7j3.js} +3 -3
  25. package/{index-djh5gpb7.js → index-g9e2fhw2.js} +2 -2
  26. package/{index-4v0wvt37.js → index-hxp90q94.js} +4 -4
  27. package/{index-7ecpft60.js → index-k6fvbcj1.js} +3 -3
  28. package/{index-aak9cctp.js → index-myy6xy5w.js} +4 -4
  29. package/{index-gz91pc3p.js → index-mz5jtaq7.js} +1 -1
  30. package/{index-bkwnr08k.js → index-n706txcv.js} +2 -2
  31. package/{index-gyvrhtpm.js → index-qc0tnhs2.js} +1 -1
  32. package/{index-j9cxndc0.js → index-qyffprfs.js} +7 -5
  33. package/{index-8d9r0df5.js → index-sn71brf9.js} +2 -2
  34. package/{index-9s991k9v.js → index-tsmjxph2.js} +1 -1
  35. package/{index-2m11t9ek.js → index-v5vmgh0z.js} +3 -208
  36. package/{index-rv16ck4r.js → index-x2w0y8sz.js} +8 -8
  37. package/{index-4agbdds8.js → index-xyrb7pk5.js} +3 -3
  38. package/index.js +19 -19
  39. package/{library.command-wbptp6q3.js → library.command-v5cyaw9t.js} +4 -4
  40. package/{localRegistry.command-6ea3pgq0.js → localRegistry.command-tqnh5g77.js} +7 -7
  41. package/{module.command-ghkf919z.js → module.command-wxsvyadc.js} +6 -6
  42. package/{package.command-ph2m34tv.js → package.command-qkcs60ts.js} +4 -4
  43. package/package.json +3 -4
  44. package/{page.command-atnzfn88.js → page.command-qj5bfnh9.js} +4 -4
  45. package/{primitive.command-7qbdhfc2.js → primitive.command-c5jtk3e9.js} +7 -7
  46. package/{quality.command-51q9kmhj.js → quality.command-f8drhx6c.js} +3 -3
  47. package/{recipeScanner-tghkzrrt.js → recipeScanner-zrzev25x.js} +3 -3
  48. package/{repair.command-weakn0yr.js → repair.command-mzwtejpk.js} +6 -6
  49. package/{routeSourceValidator-e4jmbfcx.js → routeSourceValidator-7fycdqyv.js} +1 -1
  50. package/{scalar.command-xdjhvsgb.js → scalar.command-0yvwfv8m.js} +5 -5
  51. package/{typeChecker-kravn7ns.js → typeChecker-g6bh0xfv.js} +1 -1
  52. package/typecheck.proc.js +1 -1
  53. package/{workflow.command-msm2tjee.js → workflow.command-ak6at7nz.js} +10 -10
  54. package/{workspace.command-gr8z82z9.js → workspace.command-9ncr56g4.js} +19 -20
  55. /package/{index-r24hmh0q.js → index-yb2wsc7f.js} +0 -0
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- de2c79f1b77d3ad7b42a84df41633392b3eba192d3d15335be7a976440157d1f
1
+ 04e275c86b39878b8f59c901ec9b2e94fe61c317e6279d0f7b890998dc0fb6f4
package/README.ko.md CHANGED
@@ -64,7 +64,7 @@ metadata를 검증합니다.
64
64
 
65
65
  ## 요구사항
66
66
 
67
- - [Bun](https://bun.sh) `>=1.3.13`
67
+ - [Bun](https://bun.sh) `>=1.4.0`
68
68
  - TypeScript 기반 Akan 워크스페이스
69
69
 
70
70
  ## 라이선스
package/README.md CHANGED
@@ -77,7 +77,7 @@ artifact is built last and is not overwritten by the root `akan` bootstrap scrip
77
77
 
78
78
  ## Requirements
79
79
 
80
- - [Bun](https://bun.sh) `>=1.3.13`
80
+ - [Bun](https://bun.sh) `>=1.4.0`
81
81
  - A TypeScript Akan workspace
82
82
 
83
83
  ## License
@@ -7,7 +7,7 @@ import {
7
7
  } from "./index-0wae5ebk.js";
8
8
  import"./index-mxvakhsm.js";
9
9
  import"./index-67546d0j.js";
10
- import"./index-r24hmh0q.js";
10
+ import"./index-yb2wsc7f.js";
11
11
 
12
12
  // pkgs/@akanjs/devkit/abstractCompactor.ts
13
13
  import { Logger } from "akanjs/common";
@@ -1,20 +1,20 @@
1
1
  // @bun
2
2
  import {
3
3
  AgentScript
4
- } from "./index-7ecpft60.js";
5
- import"./index-djh5gpb7.js";
6
- import"./index-9s991k9v.js";
4
+ } from "./index-k6fvbcj1.js";
5
+ import"./index-g9e2fhw2.js";
6
+ import"./index-tsmjxph2.js";
7
7
  import"./index-j37qq1f2.js";
8
8
  import {
9
9
  Workspace,
10
10
  command
11
- } from "./index-bkwnr08k.js";
12
- import"./index-1twehz1x.js";
11
+ } from "./index-n706txcv.js";
12
+ import"./index-8vkkm7v0.js";
13
13
  import"./index-mxvakhsm.js";
14
14
  import"./index-xys926f2.js";
15
15
  import"./index-1577bej2.js";
16
16
  import"./index-67546d0j.js";
17
- import"./index-r24hmh0q.js";
17
+ import"./index-yb2wsc7f.js";
18
18
 
19
19
  // pkgs/@akanjs/cli/agent/agent.command.ts
20
20
  class AgentCommand extends command("agent", [AgentScript], ({ public: target }) => ({
@@ -4,8 +4,8 @@ import {
4
4
  } from "./index-0wae5ebk.js";
5
5
  import {
6
6
  ApplicationScript
7
- } from "./index-rv16ck4r.js";
8
- import"./index-p42te6qb.js";
7
+ } from "./index-x2w0y8sz.js";
8
+ import"./index-73rnbwgg.js";
9
9
  import {
10
10
  getMobileTargetChoices
11
11
  } from "./index-76rn3g2c.js";
@@ -15,14 +15,14 @@ import {
15
15
  Sys,
16
16
  Workspace,
17
17
  command
18
- } from "./index-bkwnr08k.js";
18
+ } from "./index-n706txcv.js";
19
19
  import"./index-fgc8r6dj.js";
20
20
  import"./index-bjpxzr6s.js";
21
- import"./index-1twehz1x.js";
21
+ import"./index-8vkkm7v0.js";
22
22
  import"./index-mxvakhsm.js";
23
23
  import"./index-1577bej2.js";
24
24
  import"./index-67546d0j.js";
25
- import"./index-r24hmh0q.js";
25
+ import"./index-yb2wsc7f.js";
26
26
 
27
27
  // pkgs/@akanjs/cli/application/application.command.ts
28
28
  import { select } from "@inquirer/prompts";
@@ -4,14 +4,14 @@ import {
4
4
  CsrArtifactBuilder,
5
5
  SsrBaseArtifactBuilder,
6
6
  precompressArtifacts
7
- } from "./index-2m11t9ek.js";
7
+ } from "./index-v5vmgh0z.js";
8
8
  import"./index-xjd3rqzj.js";
9
- import"./index-j9cxndc0.js";
9
+ import"./index-qyffprfs.js";
10
10
  import"./index-bjpxzr6s.js";
11
11
  import {
12
12
  Spinner
13
13
  } from "./index-mxvakhsm.js";
14
- import"./index-r24hmh0q.js";
14
+ import"./index-yb2wsc7f.js";
15
15
 
16
16
  // pkgs/@akanjs/devkit/applicationBuildRunner.ts
17
17
  import { mkdir, rm } from "fs/promises";
@@ -39,7 +39,6 @@ var SSR_RENDER_EXTERNALS = [
39
39
  var AKAN_OPTIONAL_BACKEND_EXTERNALS = [
40
40
  "@libsql/client",
41
41
  "bullmq",
42
- "croner",
43
42
  "ioredis",
44
43
  "postgres",
45
44
  "protobufjs"
@@ -287,6 +286,6 @@ void run().catch((error) => {
287
286
  }
288
287
  }
289
288
  export {
290
- ApplicationBuildRunner,
291
- AKAN_OPTIONAL_BACKEND_EXTERNALS
289
+ AKAN_OPTIONAL_BACKEND_EXTERNALS,
290
+ ApplicationBuildRunner
292
291
  };
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  FileSys
7
7
  } from "./index-67546d0j.js";
8
- import"./index-r24hmh0q.js";
8
+ import"./index-yb2wsc7f.js";
9
9
 
10
10
  // pkgs/@akanjs/devkit/applicationReleasePackager.ts
11
11
  import { cp, mkdir, rm } from "fs/promises";
@@ -5,18 +5,18 @@ import {
5
5
  FontOptimizer,
6
6
  PagesBundleBuilder,
7
7
  SsrBaseArtifactBuilder
8
- } from "./index-2m11t9ek.js";
8
+ } from "./index-v5vmgh0z.js";
9
9
  import"./index-xjd3rqzj.js";
10
- import"./index-j9cxndc0.js";
10
+ import"./index-qyffprfs.js";
11
11
  import"./index-bjpxzr6s.js";
12
12
  import {
13
13
  AppExecutor,
14
14
  WorkspaceExecutor
15
- } from "./index-1twehz1x.js";
15
+ } from "./index-8vkkm7v0.js";
16
16
  import"./index-mxvakhsm.js";
17
17
  import"./index-1577bej2.js";
18
18
  import"./index-67546d0j.js";
19
- import"./index-r24hmh0q.js";
19
+ import"./index-yb2wsc7f.js";
20
20
 
21
21
  // pkgs/@akanjs/devkit/incrementalBuilder/buildBatch.proc.ts
22
22
  import path from "path";
@@ -25,37 +25,37 @@ import {
25
25
  selectLocalDevHost,
26
26
  sortIosRunTargets,
27
27
  writeRootCapacitorConfig
28
- } from "./index-gz91pc3p.js";
28
+ } from "./index-mz5jtaq7.js";
29
29
  import"./index-76rn3g2c.js";
30
- import"./index-1twehz1x.js";
30
+ import"./index-8vkkm7v0.js";
31
31
  import"./index-mxvakhsm.js";
32
32
  import"./index-1577bej2.js";
33
33
  import"./index-67546d0j.js";
34
- import"./index-r24hmh0q.js";
34
+ import"./index-yb2wsc7f.js";
35
35
  export {
36
- writeRootCapacitorConfig,
37
- sortIosRunTargets,
38
- selectLocalDevHost,
39
- sanitizeIosNativeRunEnv,
40
- rootCapacitorConfigPaths,
41
- rootCapacitorConfigFilenames,
42
- raiseGradleMinSdkVersion,
43
- parseSimctlDevices,
44
- parseIosRuntimeMajor,
45
- parseDevicectlDevices,
46
- materializeCapacitorConfig,
47
- isPlaceholderAppId,
48
- getMissingAndroidReleaseSigningKeys,
49
- getAndroidLocalServerHost,
50
- getAdbDeviceStateIssues,
51
- formatIosRunFailureMessage,
52
- formatAndroidReleaseSigningError,
53
- clearRootCapacitorConfigs,
54
- classifyIosRunFailure,
55
- buildIosNativeRunCommand,
56
- assertJsonSerializable,
57
- SWIFTUICORE_MIN_IOS_MAJOR,
58
- PLACEHOLDER_APP_IDS,
36
+ ANDROID_MIN_SDK_VERSION,
59
37
  CapacitorApp,
60
- ANDROID_MIN_SDK_VERSION
38
+ PLACEHOLDER_APP_IDS,
39
+ SWIFTUICORE_MIN_IOS_MAJOR,
40
+ assertJsonSerializable,
41
+ buildIosNativeRunCommand,
42
+ classifyIosRunFailure,
43
+ clearRootCapacitorConfigs,
44
+ formatAndroidReleaseSigningError,
45
+ formatIosRunFailureMessage,
46
+ getAdbDeviceStateIssues,
47
+ getAndroidLocalServerHost,
48
+ getMissingAndroidReleaseSigningKeys,
49
+ isPlaceholderAppId,
50
+ materializeCapacitorConfig,
51
+ parseDevicectlDevices,
52
+ parseIosRuntimeMajor,
53
+ parseSimctlDevices,
54
+ raiseGradleMinSdkVersion,
55
+ rootCapacitorConfigFilenames,
56
+ rootCapacitorConfigPaths,
57
+ sanitizeIosNativeRunEnv,
58
+ selectLocalDevHost,
59
+ sortIosRunTargets,
60
+ writeRootCapacitorConfig
61
61
  };
@@ -1,27 +1,27 @@
1
1
  // @bun
2
2
  import {
3
3
  CloudScript
4
- } from "./index-g3brq942.js";
5
- import"./index-96vpa123.js";
6
- import"./index-xwfkgss0.js";
4
+ } from "./index-9djnsdgf.js";
5
+ import"./index-fb2wa7j3.js";
6
+ import"./index-33zce8gt.js";
7
7
  import {
8
8
  GlobalConfig
9
9
  } from "./index-0cj2zxbm.js";
10
- import"./index-rv16ck4r.js";
11
- import"./index-p42te6qb.js";
10
+ import"./index-x2w0y8sz.js";
11
+ import"./index-73rnbwgg.js";
12
12
  import"./index-76rn3g2c.js";
13
13
  import {
14
14
  Workspace,
15
15
  command
16
- } from "./index-bkwnr08k.js";
16
+ } from "./index-n706txcv.js";
17
17
  import"./index-fgc8r6dj.js";
18
18
  import"./index-bjpxzr6s.js";
19
- import"./index-1twehz1x.js";
19
+ import"./index-8vkkm7v0.js";
20
20
  import"./index-mxvakhsm.js";
21
21
  import"./index-1577bej2.js";
22
22
  import"./index-46tjzh6s.js";
23
23
  import"./index-67546d0j.js";
24
- import"./index-r24hmh0q.js";
24
+ import"./index-yb2wsc7f.js";
25
25
 
26
26
  // pkgs/@akanjs/cli/cloud/cloud.command.ts
27
27
  var localRegistryUrl = () => process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873";
@@ -1,30 +1,30 @@
1
1
  // @bun
2
2
  import {
3
3
  ContextScript
4
- } from "./index-b9m84bjp.js";
5
- import"./index-4agbdds8.js";
6
- import"./index-w7farjxd.js";
7
- import"./index-8d9r0df5.js";
8
- import"./index-4v0wvt37.js";
9
- import"./index-aak9cctp.js";
4
+ } from "./index-d4d3q2r8.js";
5
+ import"./index-xyrb7pk5.js";
6
+ import"./index-3dp7x6rc.js";
7
+ import"./index-sn71brf9.js";
8
+ import"./index-hxp90q94.js";
9
+ import"./index-myy6xy5w.js";
10
10
  import"./index-ss469dec.js";
11
- import"./index-gyvrhtpm.js";
12
- import"./index-gz91pc3p.js";
11
+ import"./index-qc0tnhs2.js";
12
+ import"./index-mz5jtaq7.js";
13
13
  import"./index-0cj2zxbm.js";
14
- import"./index-djh5gpb7.js";
15
- import"./index-9s991k9v.js";
14
+ import"./index-g9e2fhw2.js";
15
+ import"./index-tsmjxph2.js";
16
16
  import"./index-j37qq1f2.js";
17
17
  import"./index-76rn3g2c.js";
18
18
  import {
19
19
  Workspace,
20
20
  command
21
- } from "./index-bkwnr08k.js";
22
- import"./index-1twehz1x.js";
21
+ } from "./index-n706txcv.js";
22
+ import"./index-8vkkm7v0.js";
23
23
  import"./index-mxvakhsm.js";
24
24
  import"./index-xys926f2.js";
25
25
  import"./index-1577bej2.js";
26
26
  import"./index-67546d0j.js";
27
- import"./index-r24hmh0q.js";
27
+ import"./index-yb2wsc7f.js";
28
28
 
29
29
  // pkgs/@akanjs/cli/context/context.command.ts
30
30
  class ContextCommand extends command("context", [ContextScript], ({ public: target }) => ({
@@ -3,7 +3,7 @@ import {
3
3
  TypeScriptDependencyScanner
4
4
  } from "./index-46tjzh6s.js";
5
5
  import"./index-67546d0j.js";
6
- import"./index-r24hmh0q.js";
6
+ import"./index-yb2wsc7f.js";
7
7
  export {
8
8
  TypeScriptDependencyScanner
9
9
  };
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  getDirname
4
4
  } from "./index-1577bej2.js";
5
- import"./index-r24hmh0q.js";
5
+ import"./index-yb2wsc7f.js";
6
6
  export {
7
7
  getDirname
8
8
  };
@@ -10,8 +10,8 @@ import {
10
10
  command,
11
11
  runner,
12
12
  script
13
- } from "./index-bkwnr08k.js";
14
- import"./index-1twehz1x.js";
13
+ } from "./index-n706txcv.js";
14
+ import"./index-8vkkm7v0.js";
15
15
  import"./index-mxvakhsm.js";
16
16
  import {
17
17
  getDirname
@@ -19,7 +19,7 @@ import {
19
19
  import {
20
20
  FileSys
21
21
  } from "./index-67546d0j.js";
22
- import"./index-r24hmh0q.js";
22
+ import"./index-yb2wsc7f.js";
23
23
 
24
24
  // pkgs/@akanjs/cli/guideline/guideline.script.ts
25
25
  import { Logger } from "akanjs/common";
@@ -57,6 +57,12 @@ that looks wrong; do not "fix" it back.
57
57
  unreachable — write it into state with `this.set({ ... })`. A bare `return;` guard, a `return` inside a nested
58
58
  callback, a getter, and a `static` helper are all still fine.
59
59
  - **Never redeclare a generated CRUD endpoint name** in `*.signal.ts` (`no-redeclare-predefined-endpoint.grit`).
60
+ - **Never type a `*.Util.tsx` / `*.Zone.tsx` prop as a `cnst` model** (`no-model-type-in-util-zone.grit`). Those two
61
+ roles are always client components, so a `cnst.Banner` / `cnst.LightBanner` prop is a class instance the server has
62
+ to hand across the boundary; take `bannerId: string` and read the model from the store instead. Two shapes are
63
+ exempt because neither is an instance: `cnst.<Enum>["value"]`, whose indexed access resolves to a string union, and
64
+ a `ClientInit` / `ClientView` / `ClientEdit` type argument, which the framework maps to `GetStateObject<…>` plain
65
+ data. Any *other* indexed access is still flagged — `cnst.Banner["image"]` is a `File`.
60
66
  - **No deep imports past a barrel** (`no-deep-internal-import.grit`). Cross-module constant references such as
61
67
  `../map/map.constant` are the sanctioned exception.
62
68
  - **Never import across the client/server boundary.** Client files (`ui/`, `webkit/`, `page/`, `*.store.ts`, every
@@ -464,7 +470,7 @@ Conventions that hold for both shapes:
464
470
  - Resolve secrets as `process.env.X ?? options.x ?? deterministicGenerator(...)` **inside a function**, never at module scope.
465
471
  - Extend a function by appending an optional trailing parameter with a default, never by changing arity.
466
472
  - Parameters: up to three required primitives positional; optional flags in a trailing `{ … } = {}`; four or more parameters, or any two same-typed strings, in one named destructured object.
467
- - Release locks in `finally`. Load heavy optional dependencies through a module-level memoized promise (`sharpLoad ??= import("sharp")`).
473
+ - Release locks in `finally`. Load heavy optional dependencies through a module-level memoized promise (`puppeteerLoad ??= import("puppeteer")`).
468
474
 
469
475
  ### Error Placement
470
476
 
@@ -483,17 +489,27 @@ authorization decision and `filterForAccount` re-reads them per caller on every
483
489
  switch says nothing the guards do not — while guaranteeing that every endpoint added later is invisible to agents
484
490
  until somebody remembers it.
485
491
 
486
- Settings live in the app's `main.ts` — `new AkanApp("./server", { mcp: { … } })` which takes `enabled`, `readOnly`,
487
- `path`, `version`, `instructions`, `allowedOrigins`, `pageSize`, `language`, and `auth`. That is the only
488
- app-authored place for it: `server.ts` is generated and takes no options, and the gateway configures a child
489
- through its environment so each field also has an env spelling (`AKAN_MCP`, `AKAN_MCP_READONLY`,
492
+ Settings live in the app's `lib/option.ts` — `option.setMcp({ … })`, taking `enabled`, `readOnly`, `path`,
493
+ `version`, `instructions`, `allowedOrigins`, `pageSize`, `language`, and `auth`. **Not `main.ts`**: the gateway
494
+ there only spawns children, and `option.ts` is the app-authored file `server.ts` already hands to the process that
495
+ mounts `/mcp`. Every lib's option is read in mount order with the app's last, so an app tightens what a library
496
+ declared without restating it. Each field also has an env spelling (`AKAN_MCP`, `AKAN_MCP_READONLY`,
490
497
  `AKAN_MCP_PATH`, `AKAN_MCP_VERSION`, `AKAN_MCP_INSTRUCTIONS`, `AKAN_MCP_ALLOWED_ORIGINS`, `AKAN_MCP_PAGE_SIZE`,
491
- `AKAN_MCP_LANGUAGE`, `AKAN_MCP_AUTH_SERVERS`, `AKAN_MCP_SCOPES`, `AKAN_MCP_RESOURCE`), which code overrides.
498
+ `AKAN_MCP_LANGUAGE`, `AKAN_MCP_AUTH_SERVERS`, `AKAN_MCP_SCOPES`, `AKAN_MCP_RESOURCE`) for a deployment that
499
+ configures what the source does not, which the option overrides.
492
500
  The two booleans answer to `AKAN_PUBLIC_MCP` / `AKAN_PUBLIC_MCP_READONLY` too, the same pairing `AKAN_OPENAPI`
493
501
  has, and a value written in code wins over the env of the same name — an explicit `undefined` is not a value.
494
502
  `AKAN_MCP_PATH` is normalized to a leading `/`, because the route key and the OAuth metadata path are both built by
495
503
  concatenation.
496
504
 
505
+ ```typescript
506
+ // apps/<app>/lib/option.ts
507
+ export const option = new AkanOption<ModulesOptions>().setMcp({
508
+ instructions: "Domain tools for the akan app. Start from taskInTodo.",
509
+ language: "en",
510
+ });
511
+ ```
512
+
497
513
  ```typescript
498
514
  // <model>.signal.ts — every one of these is an MCP tool or prompt, with no `mcp:` option anywhere
499
515
  export class TaskSlice extends slice(
@@ -617,6 +633,68 @@ frames down included, and is a no-op when nobody is streaming — so the same co
617
633
  websocket, and in tests. `McpProgress.streaming` says whether anyone is reading, for a report whose message
618
634
  costs something to assemble.
619
635
 
636
+ ## In-Page Agent
637
+
638
+ Every akan app can host a component-level agent that reads the rendered screen and drives it. Tools, state, and
639
+ context are **derived from the rendered screen, not from the bundle**: a store joins the surface only while a
640
+ mounted component reads one of its keys (`st.use` / `st.sel` / `st.ref` all count), and only that store's
641
+ catalogued actions and state are published. `Load` scopes, the route, and the live keys complete the context, so
642
+ most screens publish a full surface with zero agent code. The React core is the `use-agentic` package; apps and
643
+ libs never import it directly (`no-import-external-library`) — everything reaches them through `st.*` and
644
+ `akanjs/ui`.
645
+
646
+ - **Mount `<Agent.Chat />` once in a layout.** That is the floating chat, the approval card, and the client-side
647
+ loop. The default runner drives `runAgentTurn`, which the **framework serves on every app** — no lib to mount,
648
+ `AKAN_AGENT=false` takes it off — and negotiates streaming via `accept`, so assistant text arrives as it is
649
+ generated with zero app code. The endpoint is a stateless relay and **never executes tools**: every tool runs in
650
+ the caller's own browser session, gated by guards and the approval card. Its guard is `AgentRelayAccess`, which
651
+ defaults to allow and **warns at boot while no policy is registered** — a product with accounts locks it in its
652
+ `option.ts`, `option.setAgentAccess((ctx) => !!ctx.get("account"))`, or anonymous visitors spend the LLM key.
653
+ `persist` keeps the transcript across reloads (sessionStorage; `{ storage: "local" }` to outlive the tab),
654
+ default off. Re-skin through the `AgentChat` slot in `_overrides.tsx`.
655
+ - **The LLM is configured in `option.ts`, never through the environment.** `option.setLlm({ apiKey, model, host })`
656
+ — or `setLlm((options) => …)` to read the key out of the app's own env object, which is where a secret belongs —
657
+ fills whichever adaptor holds `LlmAdaptorRole`, reaching it as the `llmOption` use. The settings are the role's
658
+ rather than one provider's, so they survive a swap. **DeepSeek is the built-in default** (`deepseek-chat` at
659
+ `https://api.deepseek.com`); with no `apiKey` the app still boots and the chat answers `llmUnavailable`. Swap
660
+ providers the way middleware is applied: `option.applyAdaptor(LlmAdaptorRole, ClaudeLlm)`, where the
661
+ implementation is an `adapt()` class in a `srvkit/` implementing `LlmAdaptor.chat(request, onDelta?)` — ignore
662
+ `onDelta` and the chat still answers whole.
663
+ - **`<Agent.Zone id="comments">` runs a second agent over one section, in parallel with the root.** Everything
664
+ mounted inside — `st.use` subscriptions, hook tools, Guides — belongs to that zone's own conversation *and*
665
+ stays visible to the root agent: **zones are views, never walls**, so wrapping a section costs the root nothing.
666
+ An `Agent.Chat` inside binds to the zone session automatically; a zone's `readScreen` reads only its own
667
+ `data-agent-zone` container; guides follow the layout cascade (ancestors and own, never a sibling's). Zone
668
+ membership is positional — there is no per-declaration zone key, so a lib component joins whatever zone the app
669
+ mounts it in.
670
+ - **Route guidance is `<Agent.Guide instructions="..." />`** rendered from a `_layout.tsx` or a page — the render
671
+ tree is the cascade: nested Guides concatenate outer-to-inner and navigating away withdraws them. It is a
672
+ component, not a pageConfig field. Module `*.abstract.md` files are developer docs and are never served to the
673
+ agent.
674
+ - **Exposure is the store author's to trim.** `static agent = false` on a store class keeps the whole module off
675
+ the surface (the framework's base store declares it — its keys are plumbing and `tryJwt` is a credential);
676
+ `static agent = { exclude: ["setMapBounds", "mapCamera"] }` withholds named actions and state keys that are not
677
+ real levers (state a component writes into but never reads back). `st.use.x({ agent: false })` subscribes
678
+ without counting toward liveness. Generated `set<Key>` conveniences are never published — declare a typed action
679
+ or `st.tool` when an agent should set one.
680
+ - **Hooks are the escape hatch, not the norm.** `st.useState(name, initial, meta)` publishes local state
681
+ (read-only unless `set:` names a type), `st.expose(name, value)` a derived value, and
682
+ `st.tool("x", { desc }).arg("id", ID).exec(fn)` a one-off action. `.exec()` is the only hook, so the chain
683
+ completes in one unconditional statement; its callable carries `data-akan-action`, so pass it to `onClick` by
684
+ reference like a store setter. `remove*`-named tools default to a confirm gate.
685
+ - **Model-facing text is English, always** — tool `desc`, `instructions`, Guide text. The `l()` rule covers
686
+ strings a *user* reads: Chat's own buttons go through `l("base.*")`, the model's text never does.
687
+ - A masked model never crosses the boundary: a value whose `hidden`/`secret` fields are populated is refused at
688
+ read unless a `mask:` model is named — the same rule and wording as `AgentBridge.read`.
689
+ - **`prompt()` endpoints double as the chat's slash commands.** There is no listing endpoint — the client reads
690
+ its own serialized signals — so a prompt's dictionary `.desc()` is what the menu shows, and its guards are
691
+ enforced by the prompt's own GET at call time.
692
+ - The framework publishes three built-ins on every store surface: `navigate` (internal paths only, the same
693
+ router `Link` rides), `readScreen` (the rendered DOM as compact text — headings, links, control values; the
694
+ chat's own UI is skipped via `data-agent-ui`, and a password value is never read), and `readState(key)` (one
695
+ masked store key). Declaring a store action or hook tool under one of those names shadows the built-in, so
696
+ reuse them only to mean that.
697
+
620
698
  ## Scalar Modeling (`**/*.constant.ts`)
621
699
 
622
700
  - Define Akan models in `.constant.ts` files with `via` from `akanjs/constant`.
@@ -8,7 +8,7 @@ import {
8
8
  DevGeneratedIndexSync,
9
9
  GraphClientEntryDiscovery,
10
10
  RouteClientBuilder
11
- } from "./index-j9cxndc0.js";
11
+ } from "./index-qyffprfs.js";
12
12
  import {
13
13
  HmrWatcher,
14
14
  WatchRootResolver
@@ -16,11 +16,11 @@ import {
16
16
  import {
17
17
  AppExecutor,
18
18
  WorkspaceExecutor
19
- } from "./index-1twehz1x.js";
19
+ } from "./index-8vkkm7v0.js";
20
20
  import"./index-mxvakhsm.js";
21
21
  import"./index-1577bej2.js";
22
22
  import"./index-67546d0j.js";
23
- import"./index-r24hmh0q.js";
23
+ import"./index-yb2wsc7f.js";
24
24
 
25
25
  // pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.proc.ts
26
26
  import path2 from "path";
@@ -2,10 +2,10 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-bkwnr08k.js";
5
+ } from "./index-n706txcv.js";
6
6
  import {
7
7
  PkgExecutor
8
- } from "./index-1twehz1x.js";
8
+ } from "./index-8vkkm7v0.js";
9
9
  import {
10
10
  TypeScriptDependencyScanner
11
11
  } from "./index-46tjzh6s.js";
@@ -163,13 +163,17 @@ class PackageRunner extends runner("package") {
163
163
  "tailwind-scrollbar"
164
164
  ].filter((dep) => dep !== "akanjs" && dep !== "@akanjs/devkit");
165
165
  }
166
- const bundledRuntimeDeps = new Set(pkg.name === "@akanjs/cli" ? ["@akanjs/devkit"] : []);
166
+ const packageBundledRuntimeDependencies = {
167
+ "@akanjs/cli": ["@akanjs/devkit"],
168
+ akanjs: ["use-agentic"]
169
+ };
170
+ const bundledRuntimeDeps = new Set(packageBundledRuntimeDependencies[pkg.name] ?? []);
167
171
  const forcedRuntimeDeps = packageRuntimeDependencies[pkg.name] ?? [];
168
172
  const forcedRuntimeDevDeps = packageRuntimeDevDependencies[pkg.name] ?? [];
169
173
  const [rootPackageJson, pkgJson] = await Promise.all([pkg.workspace.getPackageJson(), pkg.getPackageJson()]);
170
174
  const optionalPeerDeps = new Set(Object.entries(pkgJson.peerDependenciesMeta ?? {}).filter(([, meta]) => meta.optional).map(([dep]) => dep));
171
175
  const packageRuntimeDeps = [...new Set([...npmDeps, ...forcedRuntimeDeps])].filter((dep) => !optionalPeerDeps.has(dep) && !bundledRuntimeDeps.has(dep));
172
- const packageRuntimeDevDeps = [...new Set([...npmDevDeps, ...forcedRuntimeDevDeps])].filter((dep) => !optionalPeerDeps.has(dep));
176
+ const packageRuntimeDevDeps = [...new Set([...npmDevDeps, ...forcedRuntimeDevDeps])].filter((dep) => !optionalPeerDeps.has(dep) && !bundledRuntimeDeps.has(dep));
173
177
  const rootDeps = { ...rootPackageJson.dependencies, ...rootPackageJson.devDependencies };
174
178
  const missingForcedDeps = forcedRuntimeDeps.filter((dep) => !rootDeps[dep]);
175
179
  const missingForcedDevDeps = forcedRuntimeDevDeps.filter((dep) => !rootDeps[dep]);
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  AkanContextAnalyzer
4
- } from "./index-djh5gpb7.js";
4
+ } from "./index-g9e2fhw2.js";
5
5
  import {
6
6
  WorkflowExecutor,
7
7
  compactWorkflowInputs,
@@ -23,10 +23,10 @@ import {
23
23
  workflowCommandsForPlan,
24
24
  workflowPlanApproval,
25
25
  writeWorkflowRunArtifact
26
- } from "./index-9s991k9v.js";
26
+ } from "./index-tsmjxph2.js";
27
27
  import {
28
28
  runner
29
- } from "./index-bkwnr08k.js";
29
+ } from "./index-n706txcv.js";
30
30
 
31
31
  // pkgs/@akanjs/cli/workflow/workflow.runner.ts
32
32
  import { mkdir, readFile, writeFile } from "fs/promises";
@@ -2,16 +2,17 @@
2
2
  import {
3
3
  runner,
4
4
  script
5
- } from "./index-bkwnr08k.js";
5
+ } from "./index-n706txcv.js";
6
6
  import {
7
7
  LibExecutor
8
- } from "./index-1twehz1x.js";
8
+ } from "./index-8vkkm7v0.js";
9
9
 
10
10
  // pkgs/@akanjs/cli/semver.ts
11
- function parseVersion(version) {
11
+ var stripRangeOperator = (version) => version.replace(/^[\s^~>=<v]+/, "").trim();
12
+ var parseVersion = (version) => {
12
13
  return version.replace(/^[^\d]*/, "").split(/[.-]/).map((part) => Number.parseInt(part, 10)).map((part) => Number.isFinite(part) ? part : 0);
13
- }
14
- function compareSemver(a, b) {
14
+ };
15
+ var compareNumeric = (a, b) => {
15
16
  const left = parseVersion(a);
16
17
  const right = parseVersion(b);
17
18
  const length = Math.max(left.length, right.length);
@@ -21,7 +22,14 @@ function compareSemver(a, b) {
21
22
  return diff > 0 ? 1 : -1;
22
23
  }
23
24
  return 0;
24
- }
25
+ };
26
+ var compareSemver = (a, b) => {
27
+ try {
28
+ return Bun.semver.order(stripRangeOperator(a), stripRangeOperator(b));
29
+ } catch {
30
+ return compareNumeric(a, b);
31
+ }
32
+ };
25
33
 
26
34
  // pkgs/@akanjs/cli/library/library.runner.ts
27
35
  class LibraryRunner extends runner("library") {