@humain/humain-code 0.8.1 → 0.8.3
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/CHANGELOG.md +36 -0
- package/dist/bundle/chunks/{chunk-E7OBH44W.js → chunk-2XD7TLKB.js} +6 -6
- package/dist/bundle/chunks/{chunk-3CGMVKHA.js → chunk-3E37CJCE.js} +1 -1
- package/dist/bundle/chunks/{chunk-ROFZVEFN.js → chunk-4GB7A76U.js} +77 -72
- package/dist/bundle/chunks/{chunk-P2Y2H7SD.js → chunk-6JTCRCNF.js} +2 -2
- package/dist/bundle/chunks/{chunk-6TTMNQXI.js → chunk-7LSTTCSC.js} +145 -120
- package/dist/bundle/chunks/{chunk-QRRVZYTG.js → chunk-AW24RHGJ.js} +2 -2
- package/dist/bundle/chunks/{chunk-7X6DNT45.js → chunk-B3ZLWVDA.js} +8 -6
- package/dist/bundle/chunks/{chunk-APNPBT7Y.js → chunk-BRSLXHED.js} +1 -1
- package/dist/bundle/chunks/{chunk-KONLZKPL.js → chunk-E4VUW4RI.js} +1 -1
- package/dist/bundle/chunks/{chunk-NICPFMOP.js → chunk-JKX5EGOT.js} +1 -1
- package/dist/bundle/chunks/{chunk-D3KYOSQY.js → chunk-JSHKS7VH.js} +1 -1
- package/dist/bundle/chunks/{chunk-SXOIQWNX.js → chunk-JX6YIPNK.js} +1 -1
- package/dist/bundle/chunks/{chunk-WBSGWISD.js → chunk-M5TVWJ5T.js} +5 -4
- package/dist/bundle/chunks/{chunk-XZ7FTBXS.js → chunk-MUN4ZZZP.js} +1189 -1195
- package/dist/bundle/chunks/{chunk-CQ2CE3RB.js → chunk-QFDZEUFU.js} +2 -2
- package/dist/bundle/chunks/{chunk-DD5UT56Y.js → chunk-R2KD2HFT.js} +67 -66
- package/dist/bundle/chunks/chunk-S2US54IU.js +37 -0
- package/dist/bundle/chunks/{chunk-IMUFBWEK.js → chunk-T2ZGMEMV.js} +42 -41
- package/dist/bundle/chunks/{chunk-FQ4KS5S4.js → chunk-UZOIHLNU.js} +1 -1
- package/dist/bundle/chunks/{chunk-6YVORXTX.js → chunk-VSXVZVBE.js} +253 -232
- package/dist/bundle/chunks/{chunk-P42E6YY6.js → chunk-ZAHVC5V2.js} +206 -194
- package/dist/bundle/chunks/{chunk-DJG2WUNM.js → chunk-ZSWU5KKA.js} +1 -1
- package/dist/bundle/chunks/{compat-SRCNS6OQ.js → compat-4ILE5BEC.js} +1 -1
- package/dist/bundle/chunks/{dist-TRAK7EXI.js → dist-I6CI3CG5.js} +6 -6
- package/dist/bundle/chunks/{dist-4OMLHRJE.js → dist-NXHRL2KY.js} +1 -1
- package/dist/bundle/chunks/{easter-egg-3d-VVUF3C3X.js → easter-egg-3d-VZC5WOYV.js} +1 -1
- package/dist/bundle/chunks/{entry-SRYLSS5P.js → entry-6XDR2IDE.js} +1 -1
- package/dist/bundle/chunks/{execute-I3WGGPWL.js → execute-6MEJJF2T.js} +2 -2
- package/dist/bundle/chunks/{flow-implementer-4KO3Q4B5.js → flow-implementer-XOP4MG5X.js} +4 -4
- package/dist/bundle/chunks/{inprocess-TOBRVK4C.js → inprocess-MBKFGDM2.js} +4 -4
- package/dist/bundle/chunks/{interactive-mode-BJJKPBXD.js → interactive-mode-3322RQEH.js} +2 -2
- package/dist/bundle/chunks/{session-picker-4JQEGLDD.js → session-picker-EYKCMFQR.js} +1 -1
- package/dist/bundle/chunks/{startup-ui-AKTA4NDP.js → startup-ui-7ODOR34R.js} +2 -2
- package/dist/bundle/chunks/{trace-command-7ORDQ3JS.js → trace-command-VM7FBWPE.js} +4 -4
- package/dist/bundle/chunks/{virtual-modules-3CT5BMBA.js → virtual-modules-47MGUPYN.js} +8 -8
- package/dist/bundle/cli-runtime.js +3 -3
- package/dist/bundle/index.js +8 -8
- package/dist/bundle/rpc-entry.js +3 -3
- package/dist/coordination/adapter/delivery.d.ts +27 -0
- package/dist/coordination/adapter/delivery.d.ts.map +1 -1
- package/dist/coordination/adapter/delivery.js +164 -4
- package/dist/coordination/adapter/delivery.js.map +1 -1
- package/dist/coordination/adapter/index.d.ts.map +1 -1
- package/dist/coordination/adapter/index.js +31 -5
- package/dist/coordination/adapter/index.js.map +1 -1
- package/dist/coordination/adapter/presence.d.ts +5 -0
- package/dist/coordination/adapter/presence.d.ts.map +1 -1
- package/dist/coordination/adapter/presence.js +25 -3
- package/dist/coordination/adapter/presence.js.map +1 -1
- package/dist/coordination/adapter/question-routing.d.ts +7 -0
- package/dist/coordination/adapter/question-routing.d.ts.map +1 -0
- package/dist/coordination/adapter/question-routing.js +40 -0
- package/dist/coordination/adapter/question-routing.js.map +1 -0
- package/dist/coordination/adapter/receipts.d.ts +7 -0
- package/dist/coordination/adapter/receipts.d.ts.map +1 -1
- package/dist/coordination/adapter/receipts.js +25 -2
- package/dist/coordination/adapter/receipts.js.map +1 -1
- package/dist/coordination/adapter/tool.d.ts +19 -3
- package/dist/coordination/adapter/tool.d.ts.map +1 -1
- package/dist/coordination/adapter/tool.js +93 -19
- package/dist/coordination/adapter/tool.js.map +1 -1
- package/dist/coordination/client/client.d.ts +2 -2
- package/dist/coordination/client/client.d.ts.map +1 -1
- package/dist/coordination/client/client.js +4 -0
- package/dist/coordination/client/client.js.map +1 -1
- package/dist/coordination/transport/protocol.d.ts.map +1 -1
- package/dist/coordination/transport/protocol.js +23 -0
- package/dist/coordination/transport/protocol.js.map +1 -1
- package/dist/coordination/transport/types.d.ts +11 -1
- package/dist/coordination/transport/types.d.ts.map +1 -1
- package/dist/coordination/transport/types.js.map +1 -1
- package/dist/core/model-resolver.js +2 -2
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +14 -8
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/oauth-account-pool.d.ts +14 -0
- package/dist/core/oauth-account-pool.d.ts.map +1 -1
- package/dist/core/oauth-account-pool.js +166 -14
- package/dist/core/oauth-account-pool.js.map +1 -1
- package/dist/core/run-outcome.d.ts +1 -1
- package/dist/core/run-outcome.d.ts.map +1 -1
- package/dist/core/run-outcome.js +2 -2
- package/dist/core/run-outcome.js.map +1 -1
- package/dist/core/run-preflight.d.ts.map +1 -1
- package/dist/core/run-preflight.js +15 -8
- package/dist/core/run-preflight.js.map +1 -1
- package/dist/core/settings-manager.d.ts +4 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +17 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/settings-schema.d.ts +2 -0
- package/dist/core/settings-schema.d.ts.map +1 -1
- package/dist/core/settings-schema.js +10 -0
- package/dist/core/settings-schema.js.map +1 -1
- package/dist/extensions/usage/index.js +5 -5
- package/dist/extensions/usage/index.js.map +1 -1
- package/dist/humain/gateway/client.d.ts.map +1 -1
- package/dist/humain/gateway/client.js +36 -9
- package/dist/humain/gateway/client.js.map +1 -1
- package/dist/humain/gateway/http.d.ts.map +1 -1
- package/dist/humain/gateway/http.js +26 -6
- package/dist/humain/gateway/http.js.map +1 -1
- package/dist/humain/gateway/provider.d.ts.map +1 -1
- package/dist/humain/gateway/provider.js +9 -2
- package/dist/humain/gateway/provider.js.map +1 -1
- package/dist/humain/hcode/facade.d.ts +12 -1
- package/dist/humain/hcode/facade.d.ts.map +1 -1
- package/dist/humain/hcode/facade.js +35 -8
- package/dist/humain/hcode/facade.js.map +1 -1
- package/dist/humain/hcode/login-copy.d.ts.map +1 -1
- package/dist/humain/hcode/login-copy.js +10 -0
- package/dist/humain/hcode/login-copy.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +2 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +6 -0
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +26 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/status-indicator.d.ts +35 -1
- package/dist/modes/interactive/components/status-indicator.d.ts.map +1 -1
- package/dist/modes/interactive/components/status-indicator.js +179 -3
- package/dist/modes/interactive/components/status-indicator.js.map +1 -1
- package/dist/modes/interactive/components/working-indicator-engine.d.ts +32 -0
- package/dist/modes/interactive/components/working-indicator-engine.d.ts.map +1 -0
- package/dist/modes/interactive/components/working-indicator-engine.js +112 -0
- package/dist/modes/interactive/components/working-indicator-engine.js.map +1 -0
- package/dist/modes/interactive/fullscreen.d.ts +13 -0
- package/dist/modes/interactive/fullscreen.d.ts.map +1 -0
- package/dist/modes/interactive/fullscreen.js +25 -0
- package/dist/modes/interactive/fullscreen.js.map +1 -0
- package/dist/modes/interactive/interactive-mode.d.ts +4 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +117 -19
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/humain-dark.json +5 -4
- package/dist/modes/interactive/theme/humain-light.json +6 -5
- package/docs/cli.md +6 -0
- package/docs/coordination.md +16 -4
- package/docs/development.md +7 -0
- package/docs/environment-variables.md +2 -1
- package/docs/providers.md +19 -5
- package/docs/settings.md +20 -0
- package/docs/usage.md +2 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/schemas/settings.schema.json +29 -0
- package/dist/bundle/chunks/chunk-UEW6TUSP.js +0 -36
- package/dist/bundle/chunks/chunk-YPZPCHNV.js +0 -3
|
@@ -66,11 +66,12 @@
|
|
|
66
66
|
"syntaxOperator": "text",
|
|
67
67
|
"syntaxPunctuation": "text",
|
|
68
68
|
"thinkingOff": "dimText",
|
|
69
|
-
"thinkingMinimal": "#
|
|
70
|
-
"thinkingLow": "#
|
|
71
|
-
"thinkingMedium": "
|
|
69
|
+
"thinkingMinimal": "#7d8c89",
|
|
70
|
+
"thinkingLow": "#00b89c",
|
|
71
|
+
"thinkingMedium": "#3fb8e6",
|
|
72
72
|
"thinkingHigh": "oasis",
|
|
73
|
-
"thinkingXhigh": "#
|
|
73
|
+
"thinkingXhigh": "#f2b134",
|
|
74
|
+
"thinkingMax": "#ff6b4a",
|
|
74
75
|
"bashMode": "green"
|
|
75
76
|
},
|
|
76
77
|
"export": {
|
|
@@ -65,12 +65,13 @@
|
|
|
65
65
|
"syntaxType": "#009688",
|
|
66
66
|
"syntaxOperator": "text",
|
|
67
67
|
"syntaxPunctuation": "text",
|
|
68
|
-
"thinkingOff": "
|
|
68
|
+
"thinkingOff": "#647170",
|
|
69
69
|
"thinkingMinimal": "#74827f",
|
|
70
|
-
"thinkingLow": "#
|
|
71
|
-
"thinkingMedium": "
|
|
72
|
-
"thinkingHigh": "#
|
|
73
|
-
"thinkingXhigh": "#
|
|
70
|
+
"thinkingLow": "#008570",
|
|
71
|
+
"thinkingMedium": "#007da3",
|
|
72
|
+
"thinkingHigh": "#638500",
|
|
73
|
+
"thinkingXhigh": "#a56a00",
|
|
74
|
+
"thinkingMax": "#c44628",
|
|
74
75
|
"bashMode": "green"
|
|
75
76
|
},
|
|
76
77
|
"export": {
|
package/docs/cli.md
CHANGED
|
@@ -267,6 +267,12 @@ See [Configuration](configuration.md) for saved configuration, [Security](securi
|
|
|
267
267
|
|
|
268
268
|
Extensions may register additional long-form options. Unknown short options are rejected.
|
|
269
269
|
|
|
270
|
+
## Session coordination
|
|
271
|
+
|
|
272
|
+
Inside a Git worktree on macOS or Linux, top-level sessions automatically publish repository, branch, worktree, recent written paths and task focus. Use the agent's `coordination ask` action for deterministic status-first question routing; broadcasts default to quiet notices. Direct sends, including status/verdict and untyped replies, qualify to wake interactive/RPC sessions within the existing wake budget. Answers to broadcast questions batch for up to 30 seconds (or flush when every addressed peer answers), including replies without `kind`; answers to direct sends wake immediately. Resolved-question replies, ack/decline replies and unaddressed broadcasts stay quiet under routing rules. Quiet messages expire after 15 minutes; the next model turn receives a digest and `coordination inbox` reads them without causing a wake. Use `coordination resolve` with the returned broadcast-question ID to close batching; pending answers move to the quiet inbox, and later replies to the resolved question also stay quiet; new direct messages still qualify to wake. These are tool actions, not new shell subcommands. See [Session coordination](coordination.md#wake-rules-and-quiet-inbox) for optional intent/audience/kind fields, limits and safety.
|
|
273
|
+
|
|
274
|
+
`--no-coordinate`, `coordination.enabled:false`, or `--no-extensions` disables participation. Print/JSON sessions never start a turn for peer messages. Peers grant no authority to commit, merge or use tools.
|
|
275
|
+
|
|
270
276
|
## Package commands
|
|
271
277
|
|
|
272
278
|
```sh
|
package/docs/coordination.md
CHANGED
|
@@ -10,7 +10,7 @@ Turn it off with `--no-coordinate`, the `coordination.enabled` setting, or `--no
|
|
|
10
10
|
|
|
11
11
|
## Messages
|
|
12
12
|
|
|
13
|
-
The agent uses the `coordination` tool with `peers`, `send`,
|
|
13
|
+
The agent uses the `coordination` tool with `peers`, `ask`, `send`, `broadcast`, `inbox` and `resolve` for messages. Its record, artifact and handoff actions are described in [Shared records](#shared-records), [Artifacts](#artifacts) and [Handoffs and integration](#handoffs-and-integration). Incoming messages appear as advisory cards with `repo · branch — focus (handle)`. The session name replaces a missing focus; missing location parts are omitted. Handles are the shortest unique suffix of a session ID among live sessions, at least four characters, with hyphens removed. They grow when suffixes collide. Metadata is sanitized, bounded and displayed as literal text, never markup or commands.
|
|
14
14
|
|
|
15
15
|
Cards are on by default, with no extra setting. Incoming cards start with `⇠ peer`; outgoing sends start with `⇢ to` and show `✓ delivered`, `⏳ queued`, or `✗ failed: <reason>`. Uncertain delivery stays explicitly uncertain: it is not confirmation or permission to send a new message. The existing expand-tool-output keybinding (`ctrl+o` by default) reveals the full sender or recipient ID and message ID. Inbound expansion also shows the worktree path and the full safety sentence. The model still receives the original full peer header, disclaimer and message body, and unchanged send-result text.
|
|
16
16
|
|
|
@@ -18,13 +18,25 @@ Cards are on by default, with no extra setting. Incoming cards start with `⇠ p
|
|
|
18
18
|
|
|
19
19
|
1. Run `coordination action:"peers"` with optional `repo`, `query` and `path` filters. Results are grouped by repository, your repository first. Filters combine with AND: `repo` is a case-insensitive label substring, `query` matches repository, branch, name or focus, and `path` is a prefix of the session's repository-relative working directory or written paths. Each result includes focus and at most five matching written paths per session. Brackets in displayed paths are percent-escaped (`[` as `%5B`, `]` as `%5D`; existing `%` becomes `%25`). Oversized lists are truncated; narrow the filters.
|
|
20
20
|
2. Send to the chosen session with `action:"send" to:"<session id>" text:"..."`. Exact targets resolve first, live sessions before offline ones: a session ID, `to:"<repo>/<name>"` (an exact, case-sensitive repository label and name; both must be defined), or a bare name, which matches case-insensitively in your repository first, then across the device. After exact IDs and names, a unique live suffix handle resolves device-wide (for example `to:"8b2c"`). Ambiguous handles are refused with full candidate IDs; they never fall through to a prefix guess. Disconnected sessions still need an exact ID or name, or an existing ID prefix. Only when no exact target or live handle matches does a unique ID prefix or the name prefix of a connected session resolve, in your repository first and never to the sender. Multiple matches return `E_AMBIGUOUS_TARGET` with at most five candidates formatted as `<repo>/<name> (<id>)`, followed by `... and N more` when needed. Repository labels and names are self-reported by sessions; the broker does not verify them. Continue the thread with `replyTo:"<message id>"` and send to the original sender's ID.
|
|
21
|
-
3.
|
|
21
|
+
3. Prefer `action:"ask" text:"Who owns #261 in src/router.ts?"`. Routing deterministically selects the best 1–3 status matches (exact ID/name tokens, MR/issue references in focus, paths/prefixes, repository and branch), breaking score ties by session ID. The result explains the matched fields. With no match it broadcasts in the current repository, inferring the repository audience and path hints from the question; `scope:"device"` explicitly widens fallback discovery. No classifier runs. Respond with directed `send`, `replyTo` and `kind:"answer"` (or `"ack"` / `"decline"`). Broadcast without `scope` defaults to `"repo"`; unrelated repositories receive nothing.
|
|
22
22
|
4. Update `action:"presence_set" focus:"..."` when your task changes materially. An empty focus clears the override.
|
|
23
23
|
|
|
24
24
|
Repository labels come from the `origin` remote path (for example `humain/deploynow`), falling back to the worktree root basename. Focus is one line, at most 256 characters: an explicit override wins until cleared, otherwise the session name wins, otherwise the first line of the latest user prompt. **Automatic focus copies prompt text into presence, visible to every same-user session on this device.**
|
|
25
25
|
|
|
26
|
+
MR (`!996`) and issue (`#261`) references from user prompts are automatically retained in the published focus, even when a session name or explicit focus is set (up to 16 references within the 256-character focus limit). The next model turn nudges a refresh after a successful commit/push command, a new user task phase, or about 15 minutes without a refresh. Branch and worktree are derived automatically; no model classifier is involved.
|
|
27
|
+
|
|
26
28
|
Presence retains the most recent 20 repository-relative paths successfully written through this session's own `edit` and `write` tools, deduplicated and timestamped, newest first. Reads, bash-driven writes, failed writes and paths outside the worktree are not tracked. `subpath` is the working directory relative to the worktree root.
|
|
27
29
|
|
|
30
|
+
### Wake rules and quiet inbox
|
|
31
|
+
|
|
32
|
+
All routing fields are optional. Broadcasts default to `intent:"notice"`; use `intent:"question"` for a question. New senders mark broadcast deliveries on the wire even when intent is omitted. Older senders implemented broadcast as independent, unmarked directed sends; receivers cannot distinguish those from legacy direct messages, so they retain direct-send behavior. Older receivers may ignore the new fields and still wake for notices. Optional `audience` is an object with `repo`, `paths` (prefixes) and/or `sessions` (exact IDs or names). Direct sends always qualify to wake, including status/verdict messages and typed or untyped replies, except `ack`/`decline` replies and replies to resolved questions. Existing wake budgets and busy-session delivery still apply. Broadcasts naming this session by an exact ID/name token, matching its audience, or mentioning a recently written path wake too; substrings of names do not match. Broadcasts targeting more than three named live sessions or more than three audience sessions stay quiet, even if this session is named. Peer-supplied intent alone never forces a wake.
|
|
33
|
+
|
|
34
|
+
A reply with `replyTo` referencing this session's prior message counts as an answer even when `kind` is omitted, unless it is explicitly `ack` or `decline`. Answers to direct sends (including status-matched `ask` deliveries) wake immediately without batching. For a locally registered broadcast question, answers from addressed peers open a 30-second batching window; all addressed peers answering flushes early. One combined message uses the existing wake budget and held queue. Pending answers reserve their sender/message-ID receipt claim on arrival, before batching; a different sender reusing a held ID is deferred for broker redelivery, never allowed to displace the original answer. Reserved answers are not judged missing from the conversation until handed to the host. Every member must fit receipt tracking before the combined message is handed to the host; a partially admitted batch is refused, never injected with contradictory receipts. All answers received during an active window are included, including multipart and untyped replies. Subsequent answers can start another batch while the question remains open. Typed question context includes the exact sender ID, question ID and reply fields. Close broadcast-question batching with `action:"resolve" messageId:"<question ID>"` (the broadcast/fallback ask result prints the group ID). Pending answers move to the quiet inbox on resolution; later replies to the resolved question, typed or untyped, also stay quiet. New direct messages still qualify to wake.
|
|
35
|
+
|
|
36
|
+
Replies to resolved questions, `ack`/`decline` replies and unaddressed broadcasts are quiet under these routing rules; an acknowledgement or decline reply stays quiet even if its body or audience names this receiver. Quiet messages never trigger a turn or steer. They remain in a session-local inbox for 15 minutes, capped at 64 entries and 1 MiB (oldest entries evicted). A one-line digest is added to the next model turn's context (including the next turn of an already-running session), without starting a turn. `action:"inbox"` reads the retained messages even while disconnected, preserving the peer-content safety banner. This inbox is in memory, not durable across process exit; its messages receive `not_injected` with a quiet-inbox explanation. Batches and open-question tracking are also session-local and bounded.
|
|
37
|
+
|
|
38
|
+
For messages that qualify to wake:
|
|
39
|
+
|
|
28
40
|
- A busy session sees the message at its next safe point.
|
|
29
41
|
- An idle interactive or RPC session starts a turn for it, up to `coordination.peerWakeLimit` turns per 10 minutes (default 6). Set it to `0` to never wake. The setting is clamped to the range 0-60.
|
|
30
42
|
- An idle print or JSON session keeps the message for its next turn.
|
|
@@ -32,11 +44,11 @@ Presence retains the most recent 20 repository-relative paths successfully writt
|
|
|
32
44
|
|
|
33
45
|
### Delivery guarantees
|
|
34
46
|
|
|
35
|
-
If a send reports uncertain delivery, the tool returns the accepted message ID, delivery state, error code, `retryable` and `outcomeKnown`. The message may still arrive. Retry with `action:"send" messageId:"<returned ID>"` and the same recipient, text and `
|
|
47
|
+
If a send reports uncertain delivery, the tool returns the accepted message ID, delivery state, error code, `retryable` and `outcomeKnown`. The message may still arrive. Retry with `action:"send" messageId:"<returned ID>"` and the same recipient, text, `replyTo`, `intent`, `audience` and `kind`; preserve `broadcast:true` when retrying a broadcast (omit it when originally absent). Do not create a new message ID. An uncertain broadcast returns one ID per recipient: retry those messages individually with directed `send`, not another broadcast.
|
|
36
48
|
|
|
37
49
|
- **Confirmed socket delivery.** Built-in HUMAIN recipients promise receipts. A send reports `socket_delivered` only after the receiving endpoint confirms arrival, not merely because its socket accepted a write. This confirms receipt, not injection. If no confirmation arrives within 5 seconds, or the receiver disconnects first, the result is `delivery: "unknown"`, `retryable: true`, `outcomeKnown: false` (`E_RECEIPT_TIMEOUT` or `E_RECEIVER_DISCONNECTED`). The message may still arrive; it remains durable, and retrying the same authored message ID never creates a second mailbox entry. Plain protocol clients that do not promise receipts retain immediate socket results. Set `HUMAIN_TERMINAL_COORDINATION_RECEIPT_TIMEOUT_MS` before the broker starts to change the deadline (positive integer below 10000).
|
|
38
50
|
- **Durable until acknowledged.** The broker saves every accepted message to its mailbox before it writes anything to the recipient and before it tells the sender `socket_delivered` or `queued`. A message stays in the mailbox after it is written to the recipient's socket. It is removed only when the recipient reports a final outcome (`injected` or `not_injected`), when it expires after 24 hours, when the sender cancels it, or when a later message supersedes it. `receiver_received` does not remove it, and a receipt from any other session is ignored.
|
|
39
|
-
- **Deferred at shutdown.** If the recipient session ends before a message reaches its conversation, it reports `deferred`. The broker keeps the message and delivers it again when that same session resumes. A session that never resumes (for example one started with `--no-session`) loses it when it expires after 24 hours. `not_injected`
|
|
51
|
+
- **Deferred at shutdown.** If the recipient session ends before a message reaches its conversation, it reports `deferred`. The broker keeps the message and delivers it again when that same session resumes. A session that never resumes (for example one started with `--no-session`) loses it when it expires after 24 hours. `not_injected` also covers messages retained only in the bounded quiet inbox, as well as refused messages such as oversized ones.
|
|
40
52
|
- **At least once, deduplicated.** If the recipient disconnects, or the broker restarts, before the final outcome arrives, the message is delivered again on reconnect. A recipient never injects the same message twice: a repeat of a message it already handled is answered with the same final outcome, and after a restart a message already present in the resumed session is reported as `injected` without being added again. A sender's retry of a message the broker still holds is answered from the broker's record and queues nothing new. A message id already used by another sender is refused with `E_INVALID_REQUEST`. Reusing your own id with different content returns `E_MESSAGE_ID_REUSE`.
|
|
41
53
|
- **Per-sender ordering.** Messages from one sender to one recipient are delivered in the order they were sent, across live delivery, queued mail, reconnects, broker restarts, and retries. A new message never overtakes an older one that has not been written yet, for example while the recipient is reading slowly.
|
|
42
54
|
- **Limits.** Each recipient can hold up to 256 messages and 8 MiB, and the broker holds up to 12 MiB in total (each message counted as its saved size, including messages written but not yet acknowledged). A message that would exceed a limit is refused with the retryable error `E_MAILBOX_FULL` before anything changes; accepted mail is never dropped to make room. When the broker restarts it keeps each recipient's newest messages that fit these limits. Message ids are 1-128 characters; a longer id is refused with `E_MESSAGE_ID_TOO_LONG` before anything is saved.
|
package/docs/development.md
CHANGED
|
@@ -61,6 +61,13 @@ npm test # Run all tests
|
|
|
61
61
|
npm test -- test/specific.test.ts # Run specific test
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
+
Account and login selectors use fullscreen overlays. Test hosts that exercise the real `InteractiveMode.showSelector` must provide `ui.terminal.rows` and `ui.showOverlay()` with a hide handle, and read the opened overlay instead of an editor child. Keep usage/freshness assertions on the real components. After changing account or usage presentation, run the freshness regression as well as the fullscreen tests from the repository root:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npm run hydrate:model-data:pinned
|
|
68
|
+
(cd packages/coding-agent && ../../test.sh node ../../node_modules/vitest/dist/cli.js --run test/suite/regressions/183-claude-usage-freshness.test.ts test/accounts-fullscreen.test.ts)
|
|
69
|
+
```
|
|
70
|
+
|
|
64
71
|
### Efficiency budgets
|
|
65
72
|
|
|
66
73
|
Before releases and for performance changes, run `npm run build` followed by `npm run bench:budgets` from the repository root on an idle machine. The offline workloads measure built Node startup, optional compiled Bun startup, session loading/rendering, streaming Markdown, shell spill output and fullscreen search, with one warm-up and seven measured runs. Any median more than 15% above `bench/budgets/<platform>-<arch>.json` fails; a missing baseline is informational. Review the ranges before establishing or deliberately replacing it with `npm run bench:budgets -- --write-baseline`; this check is not part of `npm run check` or CI.
|
|
@@ -105,7 +105,8 @@ These variables are read by HUMAIN Code CLI itself:
|
|
|
105
105
|
| `HUMAIN_TERMINAL_TUI_ESC_TIMEOUT` | How long to wait after a lone ESC before treating it as Escape, in milliseconds; defaults to `100` over SSH and `10` otherwise. Increase if Alt-key input is misread as Escape |
|
|
106
106
|
| `HUMAIN_TERMINAL_CLIPBOARD_OSC52` | Set to `1` to also send copied text to the terminal with OSC 52 after the local clipboard write, as HUMAIN Code CLI does over SSH. Use it when a remote client reaches HUMAIN Code CLI without SSH variables, such as a multiplexer attached from another machine or a remote IDE daemon |
|
|
107
107
|
| `VISUAL`, `EDITOR` | External editor fallback when `externalEditor` is unset |
|
|
108
|
-
| `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests |
|
|
108
|
+
| `HTTP_PROXY`, `HTTPS_PROXY` | Proxy outbound HTTP requests, including early Forge Run catalog discovery and auth startup. Desktop setup initializes transport before auth; native Run initializes before discovery without desktop settings. Later desktop settings/timeout updates still reconfigure transport |
|
|
109
|
+
| `NO_PROXY` | Hosts that bypass the outbound HTTP proxy |
|
|
109
110
|
| `HUMAIN_TERMINAL_RPC_SUBAGENT_PROGRESS` | Set to exactly `1` before starting RPC mode to enable optional subagent progress metadata. Default off; unset and all other values disable it. Read once per RPC runtime, not persisted in settings; reload and session replacement retain the startup choice. See [RPC subagent progress](rpc.md#subagent-progress). |
|
|
110
111
|
| `HUMAIN_TERMINAL_SUBAGENT_MAX_DEPTH` | Maximum nesting depth for the `subagent` tool. Default `1`, ceiling `3`. |
|
|
111
112
|
| `HUMAIN_TERMINAL_SUBAGENT_MAX_CONCURRENCY` | Maximum children running at once in parallel mode. Default `4`, ceiling `8`. |
|
package/docs/providers.md
CHANGED
|
@@ -17,6 +17,8 @@ On a remote or headless machine, an OAuth callback may not reach the local proce
|
|
|
17
17
|
|
|
18
18
|
Run `/accounts [provider]` to switch, rename, add, reauthenticate, or remove saved OAuth and API-key accounts. `/logout` can select a saved account to remove. Removing an active account selects the next account of the same credential type, or signs the provider out when none remains. It never silently selects an API key after removing OAuth. Removal defaults to keeping the account and does not revoke access at the provider.
|
|
19
19
|
|
|
20
|
+
Account selection, `/login` authentication-method and provider choices, and `/logout` provider selection use the same full-width, full-height opaque overlay as `/usage`. Escape closes the selector and restores the underlying chat; account confirmations also cover the chat.
|
|
21
|
+
|
|
20
22
|
Environment, runtime and configuration sources appear as read-only entries. Change those sources outside `/accounts`; removing an account does not unset them.
|
|
21
23
|
|
|
22
24
|
`auth.json` and `oauth-accounts.json` can contain API keys and OAuth tokens. Keep both files and their migration backups private and do not commit them.
|
|
@@ -263,13 +265,15 @@ To use a service-account key file instead, set `GOOGLE_APPLICATION_CREDENTIALS`
|
|
|
263
265
|
|
|
264
266
|
Native provider `humain-code-account` is shown as **HUMAIN Code** in production, **HUMAIN Code (Dev)** in dev, and **HUMAIN Code (Staging)** in staging. Under **Sign in with HUMAIN**, order is Code, Node, Gateway, Fuse. All entries render at once. Code shows `checking connection…` (greyed) until the selected environment's `/api/cli/config` proves the complete qualified native device/issuer/audience/scopes/expiry/revocation profile and the issuer's discovery document matches it; it then shows `✓ connected`. HUMAIN Code CLI starts this check at startup and reuses a ready result for 5 minutes, so the menu is usually already connected; otherwise opening the menu checks again and updates it without losing search or selection. Selecting Code while the check runs waits inline with a spinner and continues to sign-in when it succeeds. Failures never block independent providers and name the cause:
|
|
265
267
|
|
|
266
|
-
- `✗ Can't reach <host>: check VPN/Zscaler [Retry]`: DNS, connection, TLS
|
|
268
|
+
- `✗ Can't reach <host>: check VPN/Zscaler [Retry]`: DNS, connection, TLS or timeout; not an HTTP rejection. Enter retries and continues when ready.
|
|
269
|
+
- `✗ HUMAIN Code isn't available on <environment> yet (server: hcode_unavailable). Try another environment or contact support. [Retry]`: `/api/cli/config` returned HTTP 503 with `code: hcode_unavailable`; this is not a VPN failure.
|
|
270
|
+
- `✗ Sign-in server returned HTTP <status>: <message> [Retry]`: another HTTP rejection, with a bounded, sanitized server message when available; without a message, only the status is shown.
|
|
267
271
|
- `✗ Server sign-in settings don't match this CLI version [Details]`: the server answered with settings this CLI does not accept. Enter explains: update the CLI, or ask the HUMAIN Code platform team to check the server's CLI sign-in configuration.
|
|
268
|
-
- `✗ Sign-in is
|
|
272
|
+
- `✗ Sign-in is not available in this environment [Retry]`: offline mode or another failure.
|
|
269
273
|
|
|
270
274
|
Start with `humain-code --env dev`, `--env staging` (alias `stg`), or `--env production`. Origins are `https://code.dev.humain.com`, `https://code.stg.humain.com`, and `https://code.humain.com`; production is the default. There is no arbitrary endpoint override or cross-environment fallback. This flag does not redirect Node, Gateway, Fuse, Local or DeployNow.
|
|
271
275
|
|
|
272
|
-
Use `/login humain-code-account`. An unreachable server says `Can't reach <host>: check VPN/Zscaler, then try /login again.`; other unavailable readiness says `HUMAIN Code is unavailable for this environment. Try /login again later.` (with the selected environment suffix when applicable). Readiness proves presentation only, not account eligibility or model availability. Browser/device sign-in always displays the validated verification URI and user code for remote use; MFA remains issuer-controlled. Device-code polling retries DNS, connection and 5xx errors with backoff (1 s doubling to 30 s) until the code expires; an invalid token response still fails at once.
|
|
276
|
+
Use `/login humain-code-account`. A classified `503 hcode_unavailable` shows the same not-available-on-this-environment explanation as the menu; other HTTP rejections show the same status and sanitized message. Direct commands omit the menu's `[Retry]` label; run `/login humain-code-account` again to retry. An unreachable server still says `Can't reach <host>: check VPN/Zscaler, then try /login again.`; other unavailable readiness says `HUMAIN Code is unavailable for this environment. Try /login again later.` (with the selected environment suffix when applicable). Readiness proves presentation only, not account eligibility or model availability. Browser/device sign-in always displays the validated verification URI and user code for remote use; MFA remains issuer-controlled. Device-code polling retries DNS, connection and 5xx errors with backoff (1 s doubling to 30 s) until the code expires; an invalid token response still fails at once.
|
|
273
277
|
|
|
274
278
|
Persistent login encrypts private account files under the agent directory's `hcode/accounts/<environment>` with a purpose key in the OS keychain. Generic auth holds only an environment/account/generation reference, never access or refresh tokens. One native account is active per environment; native grants are not pooled or automatically switched. The saved sign-in is shared by every `humain-code` process that uses the same agent directory and environment: a terminal opened later starts signed in, and `/login` and `/model` re-read a sign-in or sign-out made in another terminal. A terminal started without `--env` targets production; when only another environment has a saved sign-in, startup and `/login status` name it and the `--env` flag that selects it.
|
|
275
279
|
|
|
@@ -328,6 +332,8 @@ Both Gateway hosts are reachable only from the HUMAIN corporate network.
|
|
|
328
332
|
|
|
329
333
|
Over SSH, or if the browser or local callback is unavailable, open the **HUMAIN Gateway sign-in (paste code)** link printed in the terminal. Sign in and paste the one-time `hc_...` code into the masked prompt. The code expires after 2 minutes, and any exchange attempt uses it up.
|
|
330
334
|
|
|
335
|
+
Sign-in exchanges the one-time code with `POST /ai-gateway/handoff/exchange`. A server error (5xx) leaves local sign-in unchanged: no new session is saved. The CLI may start one fresh sign-in, but never resends the same exchange code.
|
|
336
|
+
|
|
331
337
|
The Gateway issues a personal session key, which HUMAIN Code CLI stores in the OS keychain: macOS Keychain, Linux Secret Service, or Windows Credential Manager. WSL uses Windows Credential Manager through Windows PowerShell, not a Linux desktop keyring. `auth.json` keeps only the environment, a session ID, and your email. Before opening the browser, sign-in writes, reads back, and deletes a temporary non-session value to verify the store. It never falls back to a plaintext file or another credential backend.
|
|
332
338
|
|
|
333
339
|
#### Linux and WSL prerequisites
|
|
@@ -341,6 +347,8 @@ To smoke-test WSL persistence, sign in, exit HUMAIN Code CLI, save work, and run
|
|
|
341
347
|
|
|
342
348
|
### 3. Choose a model
|
|
343
349
|
|
|
350
|
+
After saving the session, the CLI discovers models with `GET /ai-gateway/v1/models` and account restrictions with `GET /ai-gateway/api/cli/me/access`. These read-only requests retry HTTP 500, 502, 503 and 504 at most twice, with 500 ms then 1 s backoff. A valid `Retry-After` can extend each wait to at most 2 s; a longer or unreadable delay, or `x-should-retry: false`, stops retries. Discovery failures do not undo a successful sign-in or erase the last model list for that session. Wait and reopen `/model`; you do not need to enter another key or sign in again for a 5xx.
|
|
351
|
+
|
|
344
352
|
Run `/model` and pick a `humain-gateway` model. Only chat models your account is entitled to appear; models the Gateway blocks for HUMAIN Code are hidden and named in a warning with the reason. Press `Ctrl+S` on a model to make it the default for new sessions.
|
|
345
353
|
|
|
346
354
|
For print mode, sign in interactively once, then pass the provider and model:
|
|
@@ -367,7 +375,9 @@ CI and unattended runs are not supported: every session needs an interactive Mic
|
|
|
367
375
|
| --- | --- |
|
|
368
376
|
| `Could not reach HUMAIN Gateway to finish sign-in.` / browser shows `ERR_CONNECTION_CLOSED` | Connect to the HUMAIN corporate network. Staging may require separate access from the Gateway team. |
|
|
369
377
|
| `HUMAIN Gateway sign-in code is invalid or expired.` | Run `/login` again; codes last 2 minutes and work once. |
|
|
370
|
-
| `HUMAIN Gateway
|
|
378
|
+
| `HUMAIN Gateway is temporarily unavailable (503); no new session was saved.` (or another 5xx) | Complete the fresh sign-in if prompted. If the error persists, wait and run `/login` again. Any existing local sign-in is unchanged. Do not reuse an earlier code. |
|
|
379
|
+
| `HUMAIN Gateway is temporarily unavailable (503); your saved sign-in is unchanged.` (or another 5xx) | Sign-in was already saved. Wait and reopen `/model` to retry discovery; do not delete credentials. If failures persist, ask the Gateway team to inspect the failing path and timestamp. |
|
|
380
|
+
| `HUMAIN Gateway is temporarily unavailable (HTTP 503). Try again in a moment.` (or another 5xx during a model call) | Wait before trying the prompt again. The CLI does not add inference retries for these outages: a request may already have reached a billed model. Saved sign-in is unchanged. HTTP status, request ID/error code when supplied, and a sanitized upstream reason (at most 120 characters) remain in diagnostics for the Gateway team. |
|
|
371
381
|
| Keychain or Secret Service error | Unlock the keychain. On Linux, check `secret-tool`, the current D-Bus session, and the running Secret Service keyring. |
|
|
372
382
|
| WSL Windows Credential Manager error | Check that Windows `powershell.exe` runs from WSL and Windows interoperability is enabled. Sign in as the Windows user whose credential store holds the session. |
|
|
373
383
|
| `HUMAIN Gateway CLI session unavailable. Sign in again.` | Your access was revoked or rotated; run `/login` again. |
|
|
@@ -449,6 +459,10 @@ The design spec's `zai-coding` wording names the global Coding Plan product, not
|
|
|
449
459
|
|
|
450
460
|
Legacy unidentified Codex credentials have a separate removal action in `/logout`, alongside any saved-account choices. Its confirmation defaults to keeping the credential. Removing that credential keeps unrelated saved accounts; selecting a saved account removes only that account. Concurrent credential changes prevent deletion. Account-read and removal failures display sanitized guidance, never backend error details or credential values.
|
|
451
461
|
|
|
462
|
+
Refresh results stay bound to the local entry and upstream account that issued the refresh grant, under the existing credential locks and current-credential checks. Provider-returned local keys cannot redirect a refresh; a different upstream account or workspace is rejected. Switching changes only the selection and never moves credentials between entries. Codex reconciliation uses the access token's account identity rather than a conflicting local stamp. Load-time quarantine requires another existing slot as ownership evidence: a foreign local stamp must point to an existing neighbor; a Codex token/account-ID mismatch must name an existing neighbor through either identity. A self-stamped legacy Codex upstream-key slot holding a different token identity is quarantined only when the token's canonical neighboring slot exists and holds that identity, retaining the original slot identity for reauthentication. Detected crosslinks stay in place, not restamped or deleted. An unstamped alias (including an expired one), a stamp pointing to an absent slot, or inconsistent identity metadata in a single-entry pool is not enough to infer corruption on load. Loading preserves those grants unchanged and performs no refresh or persistence. Auth reconciliation repairs conflicting account-ID metadata only when the stamp names a different stored owner (or fills a missing ID); otherwise it retains the mismatch for downstream identity validation instead of silently making it valid. These load constraints do not weaken refresh-time binding or upstream-identity checks. Generated local keys are not upstream IDs; independent grants in those slots remain valid. Reads detect quarantine without writing; the next successful mutation persists its ownership evidence alongside the unchanged credential. Quarantined entries cannot activate, refresh, serve inference, rotate, return automatically, or become removal/credit fallback targets. Use `/accounts` → Reauthenticate with the slot's expected upstream identity to replace its grant and clear quarantine; a different or unidentifiable identity is rejected. If no identity can be established, use Add another account instead. Equal upstream identities alone are not corruption: independent grants are retained. Signing in again to the same upstream account updates its matching entry. Request and refresh-failure attribution uses the credential actually consumed, not a later active selection, including failures during stream request preparation. Preflight authentication and quota errors name the observed account label and upstream ID when available, not the account selected after dispatch; raw provider errors and credentials remain hidden.
|
|
463
|
+
|
|
464
|
+
Refresh and switching use the same auth lock; pool operations acquire the pool lock before the auth lock. Before consuming a grant, usage refresh re-reads auth under both locks and replans if the complete credential value differs (including account key, upstream identity, access token, refresh token and expiry). Inference likewise refreshes the credential re-read under the auth lock, not its optimistic pre-lock snapshot. Refresh stays under that lock through persistence, so a switch cannot commit over an in-flight refresh. This is a full credential-value comparison, not a separate monotonic grant-revision counter. A delayed caller may complete after another account is selected without moving its refreshed grant to that account.
|
|
465
|
+
|
|
452
466
|
Pooled accounts remain in `~/.humain-terminal/agent/oauth-accounts.json`, while `auth.json` holds the active credential. The first mutation migrates a legacy pool to `{ "version": 2, "providers": { ... } }` after saving a private migration backup. Both pool and backup use mode `0600`. Corrupt or unsupported documents refuse mutation. Custom SDK credential stores use an in-memory pool unless the host explicitly supplies one.
|
|
453
467
|
|
|
454
468
|
Automatic usage-limit rotation tries another usable account of the same credential type and keeps the same provider and model. OAuth rotation keeps its existing defaults. API-key rotation requires subscription-marked API-key authentication, such as `zai`, `zai-coding-cn` or Kimi Coding; ordinary paid API keys do not rotate implicitly. The global `oauthAccounts.autoSwitch` default is `true`; `oauthAccounts.providers.<id>.autoSwitch` overrides it for one provider. See [Settings](settings.md#oauth-accounts).
|
|
@@ -467,4 +481,4 @@ Account recovery happens inside the shared request dispatch. An orchestrator see
|
|
|
467
481
|
|
|
468
482
|
OpenAI Codex additionally supports usage-limit rotation and its existing credit-related behavior. Run `/login openai-codex` again to add another ChatGPT account. Each account is tried at most once per prompt during quota rotation; exhausted or otherwise unusable accounts may be skipped. When no untried usable account remains, Codex can continue with credits automatically only on an account observed serving responses that may have been billed to credits. The provider does not confirm billing.
|
|
469
483
|
|
|
470
|
-
For credentials created by an older HUMAIN Code version without
|
|
484
|
+
For opaque credentials created by an older HUMAIN Code version without any resolvable upstream identity or account stamp, a refresh is treated as a refresh of the currently active account. If that older version logs in to a different account and writes an unstamped credential, it can overwrite the active account's stored entry.
|
package/docs/settings.md
CHANGED
|
@@ -158,6 +158,8 @@ See [Compaction Reference](compaction.md) for trigger, summarization, and valida
|
|
|
158
158
|
| Setting | Type | Default | Description |
|
|
159
159
|
|---|---|---|---|
|
|
160
160
|
| `theme` | string | `"system"` | Built-in or custom theme name. `system` derives colors from the terminal theme. |
|
|
161
|
+
| `workingIndicator` | `"rotate" \| "classic" \| "life" \| "rain" \| "decode"` | `"rotate"` | One session-stable random binary indicator, or a pinned style; live preview in `/settings`. |
|
|
162
|
+
| `reducedMotion` | boolean | `false` | Use a still working-indicator frame instead of animation. |
|
|
161
163
|
| `quietStartup` | boolean \| `"header"` | `false` | `true` hides the startup header and loaded-resource listing. `"header"` keeps the header (version and key hints) but hides the model scope line and loaded-resource listing. |
|
|
162
164
|
| `tuiMode` | `"regular" \| "fullscreen"` | `"fullscreen"` | Interactive terminal UI mode. |
|
|
163
165
|
| `fullscreenExitOutput` | `"transcript" \| "resume-hint"` | `"transcript"` | Output printed when fullscreen mode exits. |
|
|
@@ -182,6 +184,24 @@ See [Compaction Reference](compaction.md) for trigger, summarization, and valida
|
|
|
182
184
|
|
|
183
185
|
See [Themes](themes.md) and [Terminal Setup](terminal-setup.md) for format and platform details.
|
|
184
186
|
|
|
187
|
+
`workingIndicator` defaults to `rotate`: one random choice of `life`, `rain`, or `decode` per interactive session, stable across turns and settings previews. Set an explicit style to pin it; switching back to `rotate` restores the session's original choice without another random draw. Supported pins are `classic` (the existing braille frames, capped at 10 updates/s like all working indicators), `life` (6/8/10 binary cells with a Working suffix, 3–10 updates/s), `rain` (4–12 falling-bit columns with elapsed time and level on the right), or `decode` (binary scramble resolving left to right into the current action). Higher thinking levels lengthen decode scrambling and increase rain speed (4–12 rows/s, computed at a fixed 10 Hz) and trail length. Rain's inner rule uses the same thinking-level color as the editor border. Decoded labels hold until the phase changes: Thinking for reasoning, Writing for text, and Reading/Editing/Running/Searching for tools. Animation uses only the active model's thinking level; non-reasoning models use off.
|
|
188
|
+
|
|
189
|
+
`reducedMotion: true` disables working animation (default `false`). Redirected output and `NO_COLOR` also use a still frame of the selected style (decode shows the resolved phase). Print and JSON modes do not create these interactive animations. `/settings` offers both settings and previews changes immediately; the preview stops when settings close. A still-running response restores its working indicator only when no retry, compaction, or summary indicator owns the status area. While settings are open, the preview replaces the working animation rather than running alongside it. Thinking-level and theme changes update the visible animation without resetting elapsed time; decoded words stop ticking while held. Extension-supplied working-indicator frames retain precedence over built-in styles.
|
|
190
|
+
|
|
191
|
+
The built-in HUMAIN thinking-border colors follow this ramp. Light colors are darkened for at least 3:1 contrast against white and the theme's export/editor-panel backgrounds (minimum measured ratio: 3.435:1). Terminal background overrides can change contrast.
|
|
192
|
+
|
|
193
|
+
| Level | `humain-dark` | `humain-light` |
|
|
194
|
+
|---|---|---|
|
|
195
|
+
| off | `#647170` | `#647170` |
|
|
196
|
+
| minimal | `#7d8c89` | `#74827f` |
|
|
197
|
+
| low | `#00b89c` | `#008570` |
|
|
198
|
+
| medium | `#3fb8e6` | `#007da3` |
|
|
199
|
+
| high | `#b8e636` | `#638500` |
|
|
200
|
+
| xhigh | `#f2b134` | `#a56a00` |
|
|
201
|
+
| max (`thinkingMax`) | `#ff6b4a` | `#c44628` |
|
|
202
|
+
|
|
203
|
+
Each visible working indicator owns at most one timer, capped at 10 frames/s and stopped on disposal or while a decoded word is held. Only timer ticks advance preallocated engine buffers; input and theme renders never advance simulation. Rain computes only visible columns, reuses glyph/color strings and a scratch buffer, and caches its border rule until width, metadata length or theme changes. Elapsed metadata changes only once per second. Its known-width ASCII border bypasses generic ANSI wrapping; only changed terminal lines require new strings. Frames use the existing TUI diff renderer, so unchanged transcript and input lines are not rewritten. Performance regressions cover 10,000 ticks per binary engine under 100 ms thread CPU, each style's scheduled/rendered frames under 0.15 ms thread CPU per frame (median of five 10,000-frame runs after 1,000 warm-up frames, including scheduler overhead), and real-TUI typing/render latency under 100 ms. Run them from `packages/coding-agent` with `../../test.sh node ../../node_modules/vitest/dist/cli.js --run test/working-indicator-performance.test.ts test/status-indicator.test.ts` (Node 26 supports the thread CPU clock).
|
|
204
|
+
|
|
185
205
|
## Network and retries
|
|
186
206
|
|
|
187
207
|
| Setting | Type | Default | Description |
|
package/docs/usage.md
CHANGED
|
@@ -87,6 +87,8 @@ Type `/` to search the available commands. The commands you will use most often
|
|
|
87
87
|
- `/login` and `/logout` manage provider access.
|
|
88
88
|
- `/settings` changes common preferences.
|
|
89
89
|
|
|
90
|
+
Account selection (including `/login` account choices and `/accounts`) and Usage's Accounts view use the same full-width, fullscreen overlay. The opaque black surface covers the transcript, editor, and status area; Usage confirmations also cover the underlying view. Press `Escape` to go back without changing an account.
|
|
91
|
+
|
|
90
92
|
Automatic effort is off by default. Enable it under `/settings` → **Automation**. Selection shows `Choosing effort…` before dispatch; on failure it keeps the current effort. Explicitly enable **Auto effort this session** to resume automation after a manual choice. See [Automatic effort](settings.md#automatic-effort) for latency and usage costs.
|
|
91
93
|
|
|
92
94
|
Prompt templates, skills, and extensions can add more commands to the same menu. See [Choose a Model](models.md), [Configuration](configuration.md), or the complete [Slash Commands reference](slash-commands.md).
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humain/humain-code",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@humain/humain-code",
|
|
9
|
-
"version": "0.8.
|
|
9
|
+
"version": "0.8.3",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@humain/humain-code-contracts": "0.4.22",
|
package/package.json
CHANGED
|
@@ -103,6 +103,35 @@
|
|
|
103
103
|
],
|
|
104
104
|
"default": "one-at-a-time"
|
|
105
105
|
},
|
|
106
|
+
"workingIndicator": {
|
|
107
|
+
"anyOf": [
|
|
108
|
+
{
|
|
109
|
+
"type": "string",
|
|
110
|
+
"const": "rotate"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"type": "string",
|
|
114
|
+
"const": "classic"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"type": "string",
|
|
118
|
+
"const": "life"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"type": "string",
|
|
122
|
+
"const": "rain"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"type": "string",
|
|
126
|
+
"const": "decode"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"default": "rotate"
|
|
130
|
+
},
|
|
131
|
+
"reducedMotion": {
|
|
132
|
+
"type": "boolean",
|
|
133
|
+
"default": false
|
|
134
|
+
},
|
|
106
135
|
"theme": {
|
|
107
136
|
"type": "string"
|
|
108
137
|
},
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
function peerHandle(id,liveIds){let compact=id.replace(/-/g,""),length=Math.min(4,compact.length);for(;length<compact.length&&liveIds.some(other=>other!==id&&other.replace(/-/g,"").endsWith(compact.slice(-length)));)length++;return compact.slice(-length)}function resolveHandleTargets(sessions,target){let compact=target.replace(/-/g,"");return compact.length<4?[]:sessions.filter(session=>session.info.id.replace(/-/g,"").endsWith(compact))}function resolveExactTargets(sessions,target,scopeId){let exact=sessions.
|
|
3
|
-
filter(session=>session.info.id===target);if(exact.length)return exact;let lower=target.toLowerCase(),qualified=sessions.filter(session=>session.info.repo!==void 0&&session.info.name!==void 0&&`${session.info.repo}/${session.info.name}`===target);if(qualified.length)return qualified;let names=sessions.filter(session=>session.info.name?.toLowerCase()===lower),local=names.filter(session=>session.scopeId===scopeId);return local.length?local:names}function resolvePrefixTargets(sessions,target,scopeId){
|
|
4
|
-
if(!target)return[];let ids=sessions.filter(session=>session.info.id.startsWith(target));if(ids.length)return ids;let lower=target.toLowerCase(),names=sessions.filter(session=>session.info.name?.toLowerCase().startsWith(lower)),local=names.filter(session=>session.scopeId===scopeId);return local.length?local:names}function matchesPeer(session,filters){return(!filters.repo||(session.repo??"").toLowerCase().includes(filters.repo.toLowerCase()))&&(!filters.query||[session.repo,session.branch,session.
|
|
5
|
-
name,session.focus].some(field=>field?.toLowerCase().includes(filters.query.toLowerCase())))&&(!filters.path||(session.subpath??"").startsWith(filters.path)||(session.touchedPaths??[]).some(entry=>entry.path.startsWith(filters.path)))}import{createHash}from"node:crypto";var MAX_MESSAGE_ID_CHARS=128,ID_IN_USE_DETAIL="message id is still held by another sender; retry later";function isValidMessageId(value){return typeof value=="string"&&value.length>0&&value.length<=MAX_MESSAGE_ID_CHARS}var MAX_SESSION_FIELD_CHARS={id:256,name:256,model:256,status:256,branch:256,cwd:4096,worktreeRoot:4096,repo:256,focus:256,subpath:4096};function isRecord(value){return typeof value=="object"&&value!==null&&!Array.isArray(value)}function isBoundedString(value,maxChars){
|
|
6
|
-
return typeof value=="string"&&value.length<=maxChars}function isOptionalBoundedString(value,maxChars){return value===void 0||isBoundedString(value,maxChars)}function isMessageReceiptStatus(value){return value==="receiver_received"||value==="queued"||value==="injected"||value==="not_injected"||value==="deferred"||value==="acknowledged"||value==="expired"||value==="cancelled"||value==="superseded"||value==="cancellation_requested"}var MAX_RECEIPT_DETAIL_CHARS=1024,MAX_REQUEST_ID_CHARS=256,WORST_CASE_REQUEST_ID="\
|
|
7
|
-
".repeat(MAX_REQUEST_ID_CHARS);function truncateChars(text,maxChars){if(text.length<=maxChars)return text;let cut=text.slice(0,maxChars),last=cut.charCodeAt(cut.length-1);return last>=55296&&last<=56319?cut.slice(0,-1):cut}function canonicalMessageReceipt(receipt){return{messageId:receipt.messageId,status:receipt.status,timestamp:receipt.timestamp,...receipt.detail!==void 0?{detail:truncateChars(receipt.detail,MAX_RECEIPT_DETAIL_CHARS)}:{}}}function isMessageReceipt(value){return!isRecord(value)||
|
|
8
|
-
typeof value.messageId!="string"||!isMessageReceiptStatus(value.status)||typeof value.timestamp!="number"?!1:value.detail===void 0||typeof value.detail=="string"}function isMessageControl(value){return!isRecord(value)||typeof value.messageId!="string"||typeof value.timestamp!="number"||value.action!=="cancel"&&value.action!=="supersede"||value.supersededBy!==void 0&&typeof value.supersededBy!="string"?!1:value.detail===void 0||typeof value.detail=="string"}function isAttachment(value){return!isRecord(
|
|
9
|
-
value)||value.type!=="file"&&value.type!=="snippet"&&value.type!=="context"||typeof value.name!="string"||typeof value.content!="string"?!1:value.language===void 0||typeof value.language=="string"}function isMessageProvenance(value){return isRecord(value)?value.type==="extension_outbox"&&typeof value.extensionId=="string"&&typeof value.extensionName=="string"&&typeof value.requestId=="string":!1}function isMessage(value){if(!isRecord(value)||typeof value.id!="string"||typeof value.timestamp!="nu\
|
|
10
|
-
mber")return!1;for(let key of["senderSequence","brokerReceivedAt","brokerDeliveredAt","receiverReceivedAt","injectedAt"])if(value[key]!==void 0&&typeof value[key]!="number")return!1;return value.supersedes!==void 0&&typeof value.supersedes!="string"||value.retryOf!==void 0&&typeof value.retryOf!="string"||value.replyTo!==void 0&&typeof value.replyTo!="string"||value.expectsReply!==void 0&&typeof value.expectsReply!="boolean"||value.provenance!==void 0&&!isMessageProvenance(value.provenance)||!isRecord(
|
|
11
|
-
value.content)||typeof value.content.text!="string"?!1:value.content.attachments===void 0||Array.isArray(value.content.attachments)&&value.content.attachments.every(isAttachment)}function messageDeliveryFingerprint(message,targetId){let canonical=JSON.stringify({targetId,text:message.content.text,attachments:message.content.attachments,replyTo:message.replyTo,expectsReply:message.expectsReply,supersedes:message.supersedes,retryOf:message.retryOf,provenance:message.provenance});return createHash(
|
|
12
|
-
"sha256").update(canonical).digest("hex")}function isTouchedPaths(value){return Array.isArray(value)&&value.length<=20&&value.every(entry=>isRecord(entry)&&isBoundedString(entry.path,4096)&&entry.path.length>0&&!entry.path.startsWith("/")&&!entry.path.split("/").includes("..")&&typeof entry.timestamp=="number"&&Number.isFinite(entry.timestamp)&&entry.timestamp>=0)&&new Set(value.map(entry=>entry.path)).size===value.length}function isDiscoveryPresence(value){return isOptionalBoundedString(value.repo,
|
|
13
|
-
256)&&isOptionalBoundedString(value.focus,256)&&(value.focus===void 0||!/[\r\n\u2028\u2029]/.test(String(value.focus)))&&isOptionalBoundedString(value.subpath,4096)&&(value.touchedPaths===void 0||isTouchedPaths(value.touchedPaths))}function isSessionInfo(value){if(!isRecord(value)||!isBoundedString(value.id,MAX_SESSION_FIELD_CHARS.id)||!isBoundedString(value.cwd,MAX_SESSION_FIELD_CHARS.cwd)||!isBoundedString(value.model,MAX_SESSION_FIELD_CHARS.model)||typeof value.pid!="number"||typeof value.startedAt!=
|
|
14
|
-
"number"||typeof value.lastActivity!="number"||!isOptionalBoundedString(value.handle,MAX_SESSION_FIELD_CHARS.id)||value.endpointEpoch!==void 0&&typeof value.endpointEpoch!="string"||!isOptionalBoundedString(value.name,MAX_SESSION_FIELD_CHARS.name)||value.runtimeFallbackAlias!==void 0&&typeof value.runtimeFallbackAlias!="boolean"||!isOptionalBoundedString(value.status,MAX_SESSION_FIELD_CHARS.status)||value.peerUid!==void 0&&typeof value.peerUid!="number")return!1;for(let key of["contextPct","cont\
|
|
15
|
-
extTokens","contextWindow"])if(value[key]!==void 0&&typeof value[key]!="number")return!1;return!isOptionalBoundedString(value.worktreeRoot,MAX_SESSION_FIELD_CHARS.worktreeRoot)||!isOptionalBoundedString(value.branch,MAX_SESSION_FIELD_CHARS.branch)?!1:isDiscoveryPresence(value)&&(value.trustedLocal===void 0||typeof value.trustedLocal=="boolean")}function isSessionId(value){return isBoundedString(value,MAX_SESSION_FIELD_CHARS.id)&&value.trim().length>0}function isSessionRegistration(value){return!isRecord(
|
|
16
|
-
value)||!isBoundedString(value.cwd,MAX_SESSION_FIELD_CHARS.cwd)||!isBoundedString(value.model,MAX_SESSION_FIELD_CHARS.model)||typeof value.pid!="number"||typeof value.startedAt!="number"||typeof value.lastActivity!="number"||!isOptionalBoundedString(value.name,MAX_SESSION_FIELD_CHARS.name)||value.runtimeFallbackAlias!==void 0&&typeof value.runtimeFallbackAlias!="boolean"||value.extensions!==void 0&&!Array.isArray(value.extensions)||!isOptionalBoundedString(value.worktreeRoot,MAX_SESSION_FIELD_CHARS.
|
|
17
|
-
worktreeRoot)||!isOptionalBoundedString(value.branch,MAX_SESSION_FIELD_CHARS.branch)||value.ownership!==void 0&&!isOwnershipMode(value.ownership)||value.acknowledgesReceipts!==void 0&&typeof value.acknowledgesReceipts!="boolean"||value.livenessIntervalMs!==void 0&&(typeof value.livenessIntervalMs!="number"||!Number.isSafeInteger(value.livenessIntervalMs)||value.livenessIntervalMs<=0)?!1:isDiscoveryPresence(value)&&isOptionalBoundedString(value.status,MAX_SESSION_FIELD_CHARS.status)}var MAX_RECORD_VALUE_BYTES=65536,
|
|
18
|
-
MAX_RECORD_VALUE_DEPTH=16,MAX_RECORD_ARTIFACT_REFS=64,MAX_RECORDS=1024,RECORD_KEY_PATTERN=/^[a-z0-9][a-z0-9._-]{0,127}$/,RESERVED_RECORD_KEYS=["presence","policy","integration"],RESERVED_NAMESPACE_PREFIX="humain.coord.",RECORD_NAMESPACE_PREFIX="humain.coord.record:",POLICY_NAMESPACE="humain.coord.policy",ARTIFACT_NAMESPACE_PREFIX="humain.coord.artifact:",MAX_ARTIFACT_BYTES=16*1024*1024,ARTIFACT_QUOTA_BYTES=256*1024*1024,MAX_ARTIFACTS=1024,MAX_ARTIFACT_NAME_CHARS=256,MAX_ARTIFACT_NAME_SEGMENTS=8,
|
|
19
|
-
ARTIFACT_SEGMENT_PATTERN=/^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$/,STAGED_FILE_PATTERN=/^[a-f0-9]{32}\.part$/,ARTIFACT_RETENTION_MS=10080*60*1e3,RECORD_TOMBSTONE_RETENTION_MS=ARTIFACT_RETENTION_MS,STALE_STAGED_FILE_MS=3600*1e3,FORBIDDEN_JSON_KEYS=new Set(["__proto__","constructor","prototype"]);function findJsonUnsafe(value,depth,maxDepth,ancestors,budget){let overBudget=`value is larger than the limit of ${budget.limit} bytes`;if(value===null)return budget.remaining-=4,budget.remaining<0?overBudget:void 0;
|
|
20
|
-
switch(typeof value){case"boolean":return budget.remaining-=4,budget.remaining<0?overBudget:void 0;case"string":return budget.remaining-=2,budget.remaining<0?overBudget:void 0;case"number":return Number.isFinite(value)?(budget.remaining-=1,budget.remaining<0?overBudget:void 0):"numbers must be finite";case"object":break;default:return`${typeof value} values are not JSON`}if(ancestors.has(value))return"value contains a cycle";if(depth>maxDepth)return`value is nested deeper than ${maxDepth} levels`;
|
|
21
|
-
ancestors.add(value);try{if(Array.isArray(value)){if(Object.getPrototypeOf(value)!==Array.prototype)return"only plain arrays are allowed";if(budget.remaining-=2+Math.max(0,value.length-1),budget.remaining<0)return overBudget;for(let key of Reflect.ownKeys(value)){if(typeof key=="symbol")return"symbol keys are not JSON";if(key==="length")continue;let index=Number(key);if(!Number.isInteger(index)||index<0||index>=value.length||String(index)!==key)return`arrays must not have non-index key "${key}"`;
|
|
22
|
-
if(!Object.getOwnPropertyDescriptor(value,key)?.enumerable)return`non-enumerable key "${key}" is not JSON`}for(let index=0;index<value.length;index+=1){if(!Object.hasOwn(value,index))return"arrays must not have holes";let reason=findJsonUnsafe(value[index],depth+1,maxDepth,ancestors,budget);if(reason)return reason}return}let prototype=Object.getPrototypeOf(value);if(prototype!==Object.prototype&&prototype!==null)return"only plain objects are allowed";if(budget.remaining-=2,budget.remaining<0)return overBudget;
|
|
23
|
-
let first=!0;for(let key of Reflect.ownKeys(value)){if(typeof key=="symbol")return"symbol keys are not JSON";if(!Object.getOwnPropertyDescriptor(value,key)?.enumerable)return`non-enumerable key "${key}" is not JSON`;if(budget.remaining-=first?3:4,budget.remaining<0)return overBudget;if(first=!1,FORBIDDEN_JSON_KEYS.has(key))return`key "${key}" is not allowed`;let reason=findJsonUnsafe(value[key],depth+1,maxDepth,ancestors,budget);if(reason)return reason}return}finally{ancestors.delete(value)}}function validateJsonSafe(value,limits){
|
|
24
|
-
let reason=findJsonUnsafe(value,1,limits.maxDepth,new Set,{remaining:limits.maxBytes,limit:limits.maxBytes});if(reason)return{ok:!1,reason};let bytes=Buffer.byteLength(JSON.stringify(value),"utf8");return bytes>limits.maxBytes?{ok:!1,reason:`value is ${bytes} bytes; the limit is ${limits.maxBytes}`}:{ok:!0,bytes}}function isRequestId(value){return isBoundedString(value,MAX_REQUEST_ID_CHARS)&&value.length>0}function isOwnershipMode(value){return value==="on"||value==="off"}function isRecordKey(value){
|
|
25
|
-
return typeof value=="string"&&RECORD_KEY_PATTERN.test(value)}function isReservedRecordKey(key){return RESERVED_RECORD_KEYS.some(reserved=>key===reserved||key.startsWith(`${reserved}.`))}function isReservedNamespace(namespace){return namespace.startsWith(RESERVED_NAMESPACE_PREFIX)}function isSha256Hex(value){return typeof value=="string"&&/^[a-f0-9]{64}$/.test(value)}function isArtifactName(value){if(typeof value!="string"||value.length===0||value.length>MAX_ARTIFACT_NAME_CHARS)return!1;let segments=value.
|
|
26
|
-
split("/");return segments.length<=MAX_ARTIFACT_NAME_SEGMENTS&&segments.every(segment=>ARTIFACT_SEGMENT_PATTERN.test(segment))}function isRecordState(value){return value==="open"||value==="done"}var INTEGRATION_NAMESPACE="humain.coord.integration",HANDOFF_KEY_PREFIX="integration.handoff.",RESOLUTION_KEY_PREFIX="integration.resolution.",MAX_HANDOFFS=48,MAX_HANDOFF_COMMITS=32,MAX_HANDOFF_DEPENDENCIES=16,MAX_HANDOFF_VERIFICATIONS=16,MAX_HANDOFF_ARTIFACT_REFS=16,MAX_BRANCH_NAME_CHARS=200,MAX_VERIFICATION_COMMAND_CHARS=256,
|
|
27
|
-
MAX_VERIFICATION_SUMMARY_CHARS=512,MAX_HANDOFF_NOTE_CHARS=1024,MAX_ATTEMPTS=6,MAX_WRITERS=6,MAX_CHECKOUT_ROOT_CHARS=512,MAX_CONFLICT_FILES=10,MAX_CONFLICT_FILE_CHARS=80,MAX_EVIDENCE_CHARS=256;function hasControlChars(value,allowNewline=!1){for(let index=0;index<value.length;index+=1){let code=value.charCodeAt(index);if(!(code===10&&allowNewline)&&(code<32||code===127))return!0}return!1}function isGitObjectId(value){return typeof value=="string"&&/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/.test(value)}function isHandoffId(value){return typeof value=="string"&&/^[a-f0-9]{16}$/.test(value)}function isValidBranchName(value){return typeof value!="string"||value.length===0||value.length>MAX_BRANCH_NAME_CHARS||
|
|
28
|
-
!/^[\x21-\x7e]+$/.test(value)||value==="@"||value==="HEAD"||value.startsWith("-")||value.startsWith("/")||value.endsWith("/")||value.endsWith(".")||value.includes("..")||value.includes("//")||value.includes("@{")||/[~^:?*[\\]/.test(value)?!1:value.split("/").every(part=>!part.startsWith(".")&&!part.endsWith(".lock"))}function uniqueStrings(values,isValid){for(let index=0;index<values.length;index+=1)if(!Object.hasOwn(values,index)||!isValid(values[index]))return!1;return new Set(values).size===values.
|
|
29
|
-
length}function parseVerification(value){if(!isRecord(value))return"each verification must be an object";let{command,result,summary}=value;return typeof command!="string"||command.length===0||command.length>MAX_VERIFICATION_COMMAND_CHARS||hasControlChars(command)?`verification command must be 1-${MAX_VERIFICATION_COMMAND_CHARS} characters without control characters`:result!=="passed"&&result!=="failed"&&result!=="not_run"?'verification result must be "passed", "failed" or "not_run"':summary!==void 0&&
|
|
30
|
-
(typeof summary!="string"||summary.length>MAX_VERIFICATION_SUMMARY_CHARS||hasControlChars(summary))?`verification summary must be at most ${MAX_VERIFICATION_SUMMARY_CHARS} characters without control characters`:{command,result,...summary!==void 0?{summary}:{}}}function validateHandoffInput(value){if(!isRecord(value))return{ok:!1,reason:"handoff must be an object"};let{branch,commits,base,target,dependencies=[],verification=[],artifactRefs=[],note}=value;if(!isValidBranchName(branch))return{ok:!1,
|
|
31
|
-
reason:"branch is not a valid branch name"};if(!isValidBranchName(target))return{ok:!1,reason:"target is not a valid branch name"};if(!isGitObjectId(base))return{ok:!1,reason:"base must be a full commit id"};if(!Array.isArray(commits)||commits.length===0||commits.length>MAX_HANDOFF_COMMITS||!uniqueStrings(commits,isGitObjectId))return{ok:!1,reason:`commits must be 1-${MAX_HANDOFF_COMMITS} unique full commit ids`};if(commits.includes(base)||commits.some(commit=>commit.length!==base.length))return{
|
|
32
|
-
ok:!1,reason:"commits must not contain the base and must use the same id length as it"};if(!Array.isArray(dependencies)||dependencies.length>MAX_HANDOFF_DEPENDENCIES||!uniqueStrings(dependencies,isHandoffId))return{ok:!1,reason:`dependencies must be at most ${MAX_HANDOFF_DEPENDENCIES} unique handoff ids`};if(!Array.isArray(verification)||verification.length>MAX_HANDOFF_VERIFICATIONS)return{ok:!1,reason:`verification must be an array of at most ${MAX_HANDOFF_VERIFICATIONS} entries`};let checks=[];
|
|
33
|
-
for(let entry of verification){let parsed=parseVerification(entry);if(typeof parsed=="string")return{ok:!1,reason:parsed};checks.push(parsed)}return!Array.isArray(artifactRefs)||artifactRefs.length>MAX_HANDOFF_ARTIFACT_REFS||!uniqueStrings(artifactRefs,isSha256Hex)?{ok:!1,reason:`artifactRefs must be at most ${MAX_HANDOFF_ARTIFACT_REFS} unique SHA-256 hex strings`}:note!==void 0&&(typeof note!="string"||note.length>MAX_HANDOFF_NOTE_CHARS||hasControlChars(note,!0))?{ok:!1,reason:`note must be at \
|
|
34
|
-
most ${MAX_HANDOFF_NOTE_CHARS} characters without control characters`}:{ok:!0,value:{branch,commits:[...commits],base,target,dependencies:[...dependencies],verification:checks,artifactRefs:[...artifactRefs],...note!==void 0?{note}:{}}}}var EXTENSION_BUS_FEATURE="extension-bus-v1",EXACT_SEND_FEATURE="exact-send-v1",SESSION_HELD_ERROR_CODE="E_SESSION_HELD",COORD_RECORDS_FEATURE="coord-records-v1",COORD_INTEGRATION_FEATURE="coord-integration-v1";export{peerHandle,resolveHandleTargets,resolveExactTargets,resolvePrefixTargets,matchesPeer,MAX_MESSAGE_ID_CHARS,ID_IN_USE_DETAIL,isValidMessageId,MAX_SESSION_FIELD_CHARS,isBoundedString,MAX_REQUEST_ID_CHARS,WORST_CASE_REQUEST_ID,truncateChars,canonicalMessageReceipt,isMessageReceipt,isMessageControl,isMessage,messageDeliveryFingerprint,isTouchedPaths,isSessionInfo,isSessionId,isSessionRegistration,MAX_RECORD_VALUE_BYTES,MAX_RECORD_VALUE_DEPTH,MAX_RECORD_ARTIFACT_REFS,MAX_RECORDS,RECORD_NAMESPACE_PREFIX,
|
|
35
|
-
POLICY_NAMESPACE,ARTIFACT_NAMESPACE_PREFIX,MAX_ARTIFACT_BYTES,ARTIFACT_QUOTA_BYTES,MAX_ARTIFACTS,STAGED_FILE_PATTERN,ARTIFACT_RETENTION_MS,RECORD_TOMBSTONE_RETENTION_MS,STALE_STAGED_FILE_MS,validateJsonSafe,isRequestId,isOwnershipMode,isRecordKey,isReservedRecordKey,isReservedNamespace,isSha256Hex,isArtifactName,isRecordState,INTEGRATION_NAMESPACE,HANDOFF_KEY_PREFIX,RESOLUTION_KEY_PREFIX,MAX_HANDOFFS,MAX_HANDOFF_COMMITS,MAX_BRANCH_NAME_CHARS,MAX_ATTEMPTS,MAX_WRITERS,MAX_CHECKOUT_ROOT_CHARS,MAX_CONFLICT_FILES,
|
|
36
|
-
MAX_CONFLICT_FILE_CHARS,MAX_EVIDENCE_CHARS,isGitObjectId,isHandoffId,isValidBranchName,validateHandoffInput,EXTENSION_BUS_FEATURE,EXACT_SEND_FEATURE,SESSION_HELD_ERROR_CODE,COORD_RECORDS_FEATURE,COORD_INTEGRATION_FEATURE};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import { createRequire as __piCreateRequire } from "node:module"; const require = __piCreateRequire(import.meta.url);
|
|
2
|
-
var STRING_SEQUENCE=/\u001b[P\]X^_][\s\S]*?(?:\u0007|\u001b\\|$)|[\u0090\u0098\u009d-\u009f][\s\S]*?(?:\u0007|\u009c|\u001b\\|$)/g,CSI_SEQUENCE=/(?:\u001b\[|\u009b)[0-?]*[ -/]*[@-~]?/g,OTHER_ESCAPE=/\u001b[\s\S]?/g,CONTROL_CHARS=/[\u0000-\u0008\u000b-\u001f\u007f-\u009f]/g,BIDI_CONTROLS=/[\u061c\u200e\u200f\u202a-\u202e\u2066-\u2069]/g;function sanitizeForTerminal(text){return text.replace(STRING_SEQUENCE,"").replace(CSI_SEQUENCE,"").replace(OTHER_ESCAPE,"").replace(CONTROL_CHARS,"").replace(BIDI_CONTROLS,
|
|
3
|
-
"")}export{sanitizeForTerminal};
|