@akanjs/cli 3.0.0-alpha.24 → 3.0.0-alpha.26

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.
package/.build-stamp CHANGED
@@ -1 +1 @@
1
- 0fb579b02dc3022112bef8d3d36df4c2748660c6188e296548f8bd508e77deca
1
+ 59d3e69d221bdeaa608f457ad4f938e158ba537d0af0028c939e0596c53197ce
@@ -635,12 +635,13 @@ costs something to assemble.
635
635
 
636
636
  ## In-Page Agent
637
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
638
+ Every akan app can host a component-level agent that reads the rendered screen and drives it. **A component
639
+ declaration is the surface, exactly**: `st.tool` publishes one action, and `st.use` / `st.sel` / `st.ref` make one
640
+ store key readable while the reading component is mounted. Nothing is derived from a store class declaring a
641
+ method on a `store(...)` gives an agent nothing at all, because a lever the screen does not offer the user is not
642
+ one an agent may pull in their place, and a module's whole vocabulary published at once was noise the model paid
643
+ for. `Load` scopes, the route, and the live keys complete the context. The React core is the `use-agentic` package;
644
+ apps and libs never import it directly (`no-import-external-library`) — everything reaches them through `st.*` and
644
645
  `akanjs/ui`.
645
646
 
646
647
  - **Mount `<Agent.Chat />` once in a layout.** That is the floating chat, the approval card, and the client-side
@@ -672,22 +673,21 @@ libs never import it directly (`no-import-external-library`) — everything reac
672
673
  tree is the cascade: nested Guides concatenate outer-to-inner and navigating away withdraws them. It is a
673
674
  component, not a pageConfig field. Module `*.abstract.md` files are developer docs and are never served to the
674
675
  agent.
675
- - **Exposure is the store author's to trim.** `static agent = false` on a store class keeps the whole module off
676
- the surface (the framework's base store declares it its keys are plumbing and `tryJwt` is a credential);
677
- `static agent = { exclude: ["setMapBounds", "mapCamera"] }` withholds named actions and state keys that are not
678
- real levers (state a component writes into but never reads back). `st.use.x({ agent: false })` subscribes
679
- without counting toward liveness. Generated `set<Key>` conveniences are never published declare a typed action
680
- or `st.tool` when an agent should set one. Form setters for the base document fields (`setIdOnX`,
681
- `setCreatedAtOnX`, `setUpdatedAtOnX`, `setRemovedAtOnX`) are never published either: the server stamps those.
682
- An action named after an endpoint is published with the endpoint's argument schema **only when it can consume
683
- it** one declaring fewer parameters than the endpoint is refused (and warned once in the console), because
684
- the schema-shaped call would drop the tail and read stale form state instead; trailing extras beyond the
685
- endpoint's arguments stay legal (`create<Model>(data, options?)` is the generated shape).
686
- - **Hooks are the escape hatch, not the norm.** `st.useState(name, initial, meta)` publishes local state
687
- (read-only unless `set:` names a type), `st.expose(name, value)` a derived value, and
688
- `st.tool("x", { desc }).arg("id", ID).exec(fn)` a one-off action. `.exec()` is the only hook, so the chain
689
- completes in one unconditional statement; its callable carries `data-akan-action`, so pass it to `onClick` by
690
- reference like a store setter. `remove*`-named tools default to a confirm gate.
676
+ - **Declare the tool beside the control that already does it.**
677
+ `st.tool("x", { desc }).arg("id", ID).exec(fn)` publishes one action and returns the callable to hand to
678
+ `onClick` one handler for the person and the agent, which is the point: a button wired to an inline arrow can
679
+ be clicked by a person and by nobody else. `.exec()` is the only hook, so the chain completes in one
680
+ unconditional statement, and the callable carries `data-akan-action` like a store setter does. A `remove*` name
681
+ defaults to a confirm gate. Reach a store action from the body `.exec((id) => st.do.removeX(id))` — which is
682
+ how an agent gets CRUD; `st.do` on its own reaches nobody.
683
+ - **Reading is per key, not per store.** `st.useState(name, initial, meta)` publishes local state (read-only
684
+ unless `set:` names a type) and `st.expose(name, value)` a derived value. A subscribed store key is listed in
685
+ the state context block by name and pulled with `readState(key)`, masked by the model that key declares — while
686
+ a key the screen does not read stays unreadable even when a sibling key of the same store is live. **There is no
687
+ store-level exposure declaration**: a store class says nothing about agents, and `st.use.x({ agent: false })` is
688
+ how the component that subscribes a value keeps it off the surface. Base-store plumbing does the same at the
689
+ call site — `st.use.path({ agent: false })`, `st.use.tryJwt({ agent: false })` so routing and the caller's
690
+ credential stay off the surface unless a component opts a key in, as ThemeToggle does for `theme`.
691
691
  - **Model-facing text is English, always** — tool `desc`, `instructions`, Guide text. The `l()` rule covers
692
692
  strings a *user* reads: Chat's own buttons go through `l("base.*")`, the model's text never does.
693
693
  - A masked model never crosses the boundary: a value whose `hidden`/`secret` fields are populated is refused at
@@ -698,8 +698,8 @@ libs never import it directly (`no-import-external-library`) — everything reac
698
698
  - The framework publishes three built-ins on every store surface: `navigate` (internal paths only, the same
699
699
  router `Link` rides), `readScreen` (the rendered DOM as compact text — headings, links, control values; the
700
700
  chat's own UI is skipped via `data-agent-ui`, and a password value is never read), and `readState(key)` (one
701
- masked store key). Declaring a store action or hook tool under one of those names shadows the built-in, so
702
- reuse them only to mean that.
701
+ masked store key). Declaring a hook tool under one of those names shadows the built-in, so reuse them only to
702
+ mean that.
703
703
 
704
704
  ## Scalar Modeling (`**/*.constant.ts`)
705
705
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.0.0-alpha.24",
3
+ "version": "3.0.0-alpha.26",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -34,7 +34,7 @@
34
34
  "@langchain/openai": "^1.4.6",
35
35
  "@tailwindcss/node": "^4.3.0",
36
36
  "@trapezedev/project": "^7.1.4",
37
- "akanjs": "3.0.0-alpha.24",
37
+ "akanjs": "3.0.0-alpha.26",
38
38
  "chalk": "^5.6.2",
39
39
  "commander": "^14.0.3",
40
40
  "dayjs": "^1.11.20",