@akanjs/cli 3.2.0-rc.22 → 3.2.0-rc.24

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,2 +1,2 @@
1
- 0018601bd7b80c0a8f0b71960a59cf4fc033f87b77335b612f0d4f351f543d35
2
- b32cfaf2-7c00-4a10-a90a-784494553fc4
1
+ dcbcd94203ef4c5c9ad76f291cfe7eb19ce55485ab0d278f65cb2ef180b0563f
2
+ 57fb187c-e934-47af-b251-de7eb0dfce25
@@ -69,7 +69,7 @@ pages declaring one name never clash, and a registry kept outside the surface re
69
69
  panel the app already titles, and `defaultDraft` opens the composer with text in it without sending it. A panel driven by a
70
70
  controlled `open` with **no** `onOpenChange` draws no close button at all rather than an inert one. Then the
71
71
  slots: `AgentLauncher`, `AgentSteps`, `AgentBubble`, `AgentComposer`, `AgentApproval`,
72
- `AgentQuestion`, `AgentToolCard`, `AgentQueued`, `AgentMenu`, `AgentMarkdown` and `AgentCode` each replace one part in `_overrides.tsx`, and
72
+ `AgentQuestion`, `AgentToolCard`, `AgentToolRow`, `AgentQueued`, `AgentMenu`, `AgentMarkdown` and `AgentCode` each replace one part in `_overrides.tsx`, and
73
73
  `akanjs/ui` exports every default beside them (`DefaultBubble`, `DefaultComposer`, …) so a skin composes the
74
74
  one it is replacing. **`AgentSteps` is one agent turn** — the messages between the user message that opened it
75
75
  and the next one, with `isRunning` saying whether more are still coming — which is the grain a chat needs to
@@ -126,9 +126,10 @@ pages declaring one name never clash, and a registry kept outside the surface re
126
126
  carries `{ provider, status }`, the hostname and the HTTP status; the provider's own sentence goes to the server
127
127
  log only, because it can quote an account id or part of a key and `Err` data reaches the browser.
128
128
  `LlmOverflow.refusal(host, status, reason)` builds it, and reads the one refusal a chat can undo — a prompt past
129
- the window, recognized from each provider's own sentence — as `agent.error.contextOverflow` with the `limit` it
130
- named, which the relay flags so the chat compacts and asks again. An adaptor an app wrote throws through the same function, so its refusals
131
- translate and recover the way the shipped ones do without a key in the framework's dictionary it cannot add.
129
+ the window, recognized from each provider's own sentence — as `agent.error.contextOverflow` with the `limit` and
130
+ `requested` it named, which the relay flags so the chat compacts and asks again. An adaptor an app wrote throws through the same function, so its refusals
131
+ translate and recover the way the shipped ones do without a key in the framework's dictionary it cannot add. An
132
+ adaptor's own size cap throws that error with `{ limit, requested }` in its own unit, bytes included.
132
133
  - **`accepts` is answered per model, through `option.setLlm({ accepts })`.** An adaptor answers for an API and one
133
134
  API serves models that differ, so the override rides beside the `model` it is a fact about. It is not a table
134
135
  the framework keeps: a table is a claim about models that ship after it, and getting this wrong is the worst
@@ -603,8 +604,8 @@ pages declaring one name never clash, and a registry kept outside the surface re
603
604
  `window − answer ceiling (8,192 when unreported) − compact.buffer (13,000, the margin Claude Code leaves)` —
604
605
  measured by the provider's own count of the last turn (`done.usage`, kept on that assistant message) plus the
605
606
  four-character estimate for what arrived since, so a Korean transcript the character rule reads as small is
606
- still caught. The window comes from `option.setLlm({ contextWindow })` or from the first refusal that names it;
607
- with neither, only the ceiling runs. **A refusal for length is answered once**: a relay flags it `overflow` on
607
+ still caught. The window comes from `option.setLlm({ contextWindow })` or from a refusal that names it, scaled by
608
+ its `limit / requested` to this estimate when it gives both; with neither, only the ceiling runs. **A refusal for length is answered once**: a relay flags it `overflow` on
608
609
  the wire, and the session compacts and sends the same turn again, and a second refusal in the same send fails
609
610
  with `agent.error.contextOverflow`. Either way the history above the last `keep` messages
610
611
  becomes one message standing in for it, flagged `summary` on the wire — `<Agent.Chat compact={{ at, keep, buffer }} />`
@@ -791,7 +792,9 @@ pages declaring one name never clash, and a registry kept outside the surface re
791
792
  keeps a free-text row either way, because the model wrote the options and only the user knows whether the answer
792
793
  is among them. The loop parks on the question exactly as it parks on an approval, a dismissal is the tool's
793
794
  error result rather than a silent empty answer, and the settled exchange renders as question-and-answer instead
794
- of a tool row. **Never re-implement it per screen** — a `st.tool("askAboutX")` that opens a modal is the same
795
+ of a tool row. A restored transcript that ends on an unanswered `askUser` — a server run that parked on it while
796
+ no chat was open, or a reload mid-question — opens on that question, and settling it runs the turn on through the
797
+ runner; a turn started first closes it as unanswered instead. **Never re-implement it per screen** — a `st.tool("askAboutX")` that opens a modal is the same
795
798
  thing with a worse transcript — and a hook tool named `askUser` shadows it like any other built-in. The line
796
799
  between it and a `.card()` tool is what the answer *is*: a sentence or a pick off a list is `askUser` and belongs
797
800
  to the conversation, while a shape the model must not invent — fields, a form, a signature — is a card the screen
@@ -546,6 +546,10 @@ at every event.
546
546
  (`akanjs/ui`), sent over your own transport. It is client input, and a name an endpoint holds is dropped. The run
547
547
  never runs one: `approve` is asked, then the run ends `awaiting` with `client: true`. Have the page `run(call)`,
548
548
  append its result — or your own error when no page answers — and resume.
549
+ - **Asking the member.** `ask: true` lists `askUser({ question, choices?, multiple? })`, the in-page chat's own tool.
550
+ A call ends the run `awaiting` with `question: true`; put the question to the member, append
551
+ `{ id, name: "askUser", result }` — or an `error` when they dismiss it — and resume. It never reaches `approve`,
552
+ counts as no tool call, and `untrusted` never sees the answer. A `clientTools` entry by that name is dropped.
549
553
  - **Writes after untrusted input.** `untrusted(result)` marks a result third parties wrote, and every later call
550
554
  reaches `approve(call, { tainted, tool })` with `tainted` set. A batch is judged before it runs, since the model
551
555
  wrote it before reading its results. Without `approve`, a `needsConfirm` tool — on this catalogue, a mutation
@@ -571,6 +575,10 @@ at every event.
571
575
  short neutral prompt stands in, as each adaptor's own fallback is about a screen. `compact { at, keep }` summarizes
572
576
  the head, and a tool result is capped at 20,000 characters as the browser caps it. Its calls carry no ip, so an
573
577
  ip-scoped `rateLimit` counts them under one unknown address.
578
+ - **A refusal for length.** With `compact` set, a round whose call fails as `agent.error.contextOverflow` compacts
579
+ regardless of `at` and asks once more, as one round; a second refusal, or nothing to cut, ends the run with the
580
+ error. An adaptor with its own size cap throws that error with `{ limit, requested }` in its own unit, bytes
581
+ included, and the run lowers `at` to where that request would have fit.
574
582
 
575
583
  ## Rolling MCP Out To An App
576
584
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/cli",
3
- "version": "3.2.0-rc.22",
3
+ "version": "3.2.0-rc.24",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -39,7 +39,7 @@
39
39
  "@earendil-works/pi-tui": "1.3.0",
40
40
  "@inquirer/prompts": "^8.7.3",
41
41
  "@tailwindcss/node": "^4.3.3",
42
- "akanjs": "3.2.0-rc.22",
42
+ "akanjs": "3.2.0-rc.24",
43
43
  "chalk": "^6.0.1",
44
44
  "commander": "^15.0.0",
45
45
  "dayjs": "^1.11.23",
@@ -40,7 +40,8 @@ an endpoint with a real guard is published, one with none is refused, and so is
40
40
  runs a model over those tools until it answers; `option.setAgentAccountResolver` resolves a stored `principal`
41
41
  before every round. Each round is metered as its own turn with `turn.loop` and `turn.meta`. `toolkits` holds named
42
42
  groups of `allow` back until the model calls `openToolkit`; `clientTools` (from `AgentClientTools` on an open page)
43
- parks a call as `awaiting { client: true }` for the page to run.
43
+ parks a call as `awaiting { client: true }` for the page to run; `ask: true` lists `askUser`, which parks as
44
+ `awaiting { question: true }` until you append the member's answer.
44
45
 
45
46
  ## Verify
46
47