chainlesschain 0.166.145 → 0.166.147
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/README.md +67 -10
- package/package.json +2 -2
- package/src/assets/linux-subreaper/linux-arm64/manifest.json +1 -1
- package/src/assets/linux-subreaper/linux-x64/manifest.json +1 -1
- package/src/command-help-index.json +2 -2
- package/src/commands/agent.js +20 -1
- package/src/commands/mcp-tasks.js +37 -4
- package/src/commands/mcp.js +24 -0
- package/src/commands/memory.js +131 -7
- package/src/data/changelog.json +26 -0
- package/src/generated/cc-agent-protocol.schema.json +175 -69
- package/src/harness/jsonl-session-store.js +4 -0
- package/src/harness/mcp-client.js +273 -48
- package/src/harness/prompt-compressor.js +1 -0
- package/src/harness/session-index.js +8 -0
- package/src/harness/session-list-index.js +2 -0
- package/src/lib/agent-session-export.js +19 -0
- package/src/lib/app-server/context-memory-notifications.js +11 -2
- package/src/lib/app-server/server.js +1 -0
- package/src/lib/background-launch-profile.js +38 -6
- package/src/lib/context-memory-kernel/local-semantic-source.js +426 -0
- package/src/lib/context-memory-kernel/local-semantic-worker.py +109 -0
- package/src/lib/context-memory-kernel/memory-service.js +35 -2
- package/src/lib/context-memory-kernel/provider-context.js +1 -1
- package/src/lib/context-memory-kernel/runtime.js +40 -0
- package/src/lib/evolution/evolution-artifact-ports.js +36 -1
- package/src/lib/evolution/evolution-ledger-file-manifest-head-store.js +19 -0
- package/src/lib/evolution/evolution-ledger-manifest-catalog.js +13 -0
- package/src/lib/evolution/evolution-ledger-manifest-head-store.js +17 -0
- package/src/lib/evolution/evolution-ledger-v2-manifest-backend.js +29 -2
- package/src/lib/formal-budget-authority.js +56 -3
- package/src/lib/formal-budget-contract.js +90 -5
- package/src/lib/mcp-client.js +1 -0
- package/src/lib/mcp-stateless-protocol.js +158 -0
- package/src/lib/mcp-task-continuation-contract.js +129 -0
- package/src/lib/mcp-task-continuation.js +147 -0
- package/src/lib/mcp-task-journal-projection.js +49 -4
- package/src/lib/mcp-task-runtime.js +148 -1
- package/src/lib/mcp-tasks.js +24 -0
- package/src/lib/session-host-snapshot.js +31 -0
- package/src/lib/session-input-lifecycle.js +147 -0
- package/src/lib/session-input-receipt.js +64 -0
- package/src/lib/session-message-provenance.js +6 -5
- package/src/lib/session-model-usage-recovery.js +115 -0
- package/src/lib/session-transcript-history.js +3 -0
- package/src/lib/session-transcript-structure.js +8 -1
- package/src/lib/storage-failure-cause-codes.js +79 -0
- package/src/repl/agent-repl.js +348 -23
- package/src/runtime/agent-core.js +29 -11
- package/src/runtime/headless-runner.js +1 -0
- package/src/runtime/headless-stream.js +40 -33
- package/src/runtime/mcp-config.js +5 -3
- package/src/runtime/policies/agent-policy.js +1 -0
package/README.md
CHANGED
|
@@ -2,19 +2,35 @@
|
|
|
2
2
|
|
|
3
3
|
Command-line interface for installing, configuring, and managing [ChainlessChain](https://www.chainlesschain.com), including the coding agent, governed tools, sessions, memory, and IDE integrations.
|
|
4
4
|
|
|
5
|
-
## CLI 0.166.
|
|
5
|
+
## CLI 0.166.147 / IDE pairing (2026-11-11 candidate)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
**0.37.181** and JetBrains **0.4.198**. Session Core must be published and
|
|
9
|
-
verified before CLI; the paired IDE releases follow independent CLI registry readback.
|
|
7
|
+
This version retains original manifest catalog/head ownership through Evolution Ledger factories, rejecting substituted directories and mixed head ports while preserving custom-backend behavior. These local storage capabilities do not grant promotion authority. The evaluation harness has a separate original 36-task plus nine-first-run round with fixed source, model, budgets and independent acceptance; preparation is not a new task-completion result.
|
|
10
8
|
|
|
11
|
-
After
|
|
12
|
-
`npm i -g chainlesschain@0.166.145 --registry https://registry.npmjs.org`,
|
|
13
|
-
restart CLI / IDE hosts, then run `cc --version` and `cc doctor`.
|
|
9
|
+
After the official OIDC release is verified, install `npm i -g chainlesschain@0.166.147 --registry https://registry.npmjs.org`, restart hosts, and run `cc --version` and `cc doctor`. Pairing targets are Open VSX **0.37.186** and JetBrains **0.4.201**, each published after the CLI. Session Core **0.3.27**, Protocol **0.1.13**, Agent SDK **0.2.18** and Context/Memory Kernel **0.1.12** are unchanged.
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
The [upgrade and release-status guide](../../docs-site/docs/chainlesschain/cli-ide-update-2026-11-11-147.md) separates candidate gates from public availability. Currently verified public versions are CLI **0.166.146**, Open VSX **0.37.185** and JetBrains **0.4.200**. Microsoft Marketplace and new mobile/PC client releases remain separate. Automatic promotion, independent business effects, invoice reconciliation and paid admission remain incomplete; **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain.
|
|
12
|
+
|
|
13
|
+
## Previous public CLI 0.166.146 / verified IDE pairing (2026-11-10)
|
|
14
|
+
|
|
15
|
+
CLI **0.166.146**, Context/Memory Kernel **0.1.12**, Protocol **0.1.13** and Agent SDK **0.2.18** are public. Session Core remains **0.3.27**. Immutable source `daafda2cf7790580467dae8ce006ceaa1285d3b4` passed the [official Actions OIDC publication](https://github.com/chainlesschain/chainlesschain/actions/runs/42758119265), including exact-source CLI CI / Strict Sandbox gates, public registry bytes/provenance and registry-only child installation. Public npm version queries also succeeded. [Publication receipt](../../docs/research/cli/evidence/release146-public/publication.json).
|
|
16
|
+
|
|
17
|
+
Install `npm i -g chainlesschain@0.166.146 --registry https://registry.npmjs.org`, restart CLI/IDE hosts, then run `cc --version` and `cc doctor`.
|
|
18
|
+
|
|
19
|
+
Paired Open VSX **0.37.185** and JetBrains **0.4.199** are public and both recommend CLI **0.166.146**. The [VS Code/Open VSX release](https://github.com/chainlesschain/chainlesschain/actions/runs/42819326161) uses source `2ae832f9054ac834b06d00a38ce1a95038ff43bb`; the [JetBrains release](https://github.com/chainlesschain/chainlesschain/actions/runs/42761723143) uses `daafda2cf7790580467dae8ce006ceaa1285d3b4` and has completed Marketplace approval. Microsoft Marketplace remains unpublished; VS Code users can install the versioned Open VSX VSIX.
|
|
20
|
+
|
|
21
|
+
PC/mobile **v5.0.3.146** is not fully released; public clients remain **v5.0.3.145**. Android's fixed bundle still contains CLI .145 and failed the release version check; a bundle refresh has started, and complete five-platform product and public-asset verification remains required. Successful IDE or individual platform builds do not upgrade the public clients. See the [current upgrade guide](../../docs-site/docs/chainlesschain/cli-ide-update-2026-11-10-146.md). The earlier publication receipt and candidate records retain their dated scope.
|
|
22
|
+
|
|
23
|
+
This release adds canonical `memory inspect` and revision-checked `memory correct`, body-free correction notifications and persisted stream model-input diagnostics. The paired public JetBrains plugin restores tool traces; VS Code .185 retains the strict Remote-SSH host gate with bounded container dependency installation. A correction conflicts on a stale revision; an error after durable publication exits 2 and must be inspected without automatic replay. SQLite stores that contain correction events require the newer reader. Explicit output-token limits and durable MCP continuation retain their documented scope. Natural-language multilingual retrieval, complete lifecycle/platform acceptance, billing reconciliation and paid admission remain incomplete. **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain.
|
|
24
|
+
|
|
25
|
+
## Historical public CLI 0.166.145 / verified IDE pairing
|
|
26
|
+
|
|
27
|
+
Public versions checked 2026-11-09: Session Core **0.3.27**, CLI **0.166.145**, Open VSX **0.37.181**, JetBrains **0.4.198**. Both IDEs recommend CLI .145. Open VSX passed **70K+ downloads** (owner-confirmed milestone). Source VS Code .182 is separate from public .181.
|
|
28
|
+
|
|
29
|
+
Install `npm i -g chainlesschain@0.166.145 --registry https://registry.npmjs.org`, restart CLI / IDE hosts, then run `cc --version` and `cc doctor`.
|
|
30
|
+
|
|
31
|
+
Immutable source `4e4b421bfb42e524f071c9ad70c2a2a2ce607374`: CLI CI **75 passed, 1 skipped**, Strict Sandbox **6 passed** and Actions OIDC publication succeeded. Public npm integrity and IDE download/pairing readbacks are archived in [the documentation review](../../docs/research/cli/evidence/documentation-refresh-20261109/README.md). Cryptographic attestation verification and full IDE artifact parity were not rerun for this review.
|
|
32
|
+
|
|
33
|
+
Candidate .144 retains its immutable blocked tag. Public .145 includes Memory dispatch authority repair and explicit goal transfer/signed rollback commands; native import still requires matching newer desktop builds and explicit confirmation. Public PC/mobile clients remain **v5.0.3.145**. Later main recovery, MCP Tasks, Memory and pricing changes retain separate source scopes. **NOT_PAID_READY / NOT_ADMITTED / HOLD** remain; this documentation update adds no model-task acceptance.
|
|
18
34
|
|
|
19
35
|
For an interactive session, `cc agent --no-recall-memory` disables automatic
|
|
20
36
|
startup and per-request Memory recall, including inherited sub-agent recall.
|
|
@@ -408,6 +424,41 @@ cc agent process-ownership recover <execution-id> --timeout-ms 5000 --json
|
|
|
408
424
|
|
|
409
425
|
Recovery verifies the exact persisted cgroup, stops it, and clears quarantine only after confirmed cleanup. It never resumes the task; Windows/macOS reject this Linux-specific operation. Windows native evaluation keeps wall-time, capability/admission and failed-cleanup evidence; diagnostics and CLI release checks do not qualify a formal effect experiment.
|
|
410
426
|
|
|
427
|
+
### Correcting canonical Memory (source candidate)
|
|
428
|
+
|
|
429
|
+
Inspect the exact record before replacing an incorrect fact or updating an
|
|
430
|
+
existing rule:
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
cc memory inspect <memory-id> --json
|
|
434
|
+
cc memory correct <memory-id> "Corrected content" --expected-revision 1 --json
|
|
435
|
+
```
|
|
436
|
+
|
|
437
|
+
Use the revision returned by `inspect`. Correction keeps the memory ID and its
|
|
438
|
+
scope, sensitivity, sinks and retention policy, increments the revision, and
|
|
439
|
+
clears the old summary. Only active or reinforced records without a `contentRef`
|
|
440
|
+
can be corrected; correction does not restore archived or deleted memory.
|
|
441
|
+
Reference-backed records are rejected with
|
|
442
|
+
`memory_correction_content_ref_unsupported` until durable content reconciliation
|
|
443
|
+
is supported. This refusal leaves the original record and reference unchanged,
|
|
444
|
+
so a later authorized deletion still has the external-content cleanup target.
|
|
445
|
+
Adding another entry is a separate operation and does not automatically replace
|
|
446
|
+
an earlier rule.
|
|
447
|
+
|
|
448
|
+
A concurrent edit rejects the stale revision. The command never refreshes that
|
|
449
|
+
revision or retries an uncertain write. Read the current record again before
|
|
450
|
+
deciding on another edit; a conflict alone does not prove that your edit committed.
|
|
451
|
+
Exit code2 with `CONTEXT_MEMORY_COMMIT_PUBLISHED` means the new version was
|
|
452
|
+
published but maintenance failed; the JSON retains durability and cleanup status.
|
|
453
|
+
The correction event keeps predecessor/new digests and revisions, not old content
|
|
454
|
+
or the free-form reason. Existing source metadata describes provenance history,
|
|
455
|
+
not independent verification of the corrected fact.
|
|
456
|
+
|
|
457
|
+
These commands require canonical mode and the updated kernel. They are not part
|
|
458
|
+
of the currently published CLI. Older SQLite readers reject correction events;
|
|
459
|
+
mixed-version and downgrade acceptance remain unverified. The change adds no
|
|
460
|
+
semantic-quality, paid-admission or publication claim.
|
|
461
|
+
|
|
411
462
|
### Memory pagination (public 0.166.88)
|
|
412
463
|
|
|
413
464
|
Requires canonical memory mode; legacy/shadow rejects paging and does not migrate automatically. Back up and arrange the supported canonical cutover first.
|
|
@@ -999,6 +1050,12 @@ Built-in tools (19): `read_file`, `write_file`, `edit_file`, `edit_file_hashed`,
|
|
|
999
1050
|
|
|
1000
1051
|
For gateways with a smaller context allowance, use `cc agent --context-window 32768 -p "your task"`. This operator-declared planning window accepts integers from 1024 to 16777216 and applies to interactive, headless and streamed sessions. It does not change the model's official capabilities, output cap or turn budget. Token planning does not guarantee a serialized request fits a gateway's byte limit; verify the actual request size for that gateway.
|
|
1001
1052
|
|
|
1053
|
+
In the source candidate, `cc agent --max-output-tokens 1024 -p "your task"` requests an output cap for each main agent/tool-loop model request. The same option applies to interactive and IDE stream-json sessions and is retained when a background launch is reconstructed. It accepts a positive safe integer; omit it to retain existing provider defaults. Provider-specific limits still apply. Auxiliary compaction/advisor budgets, total session tokens, time, invoicing and paid-production admission remain separate.
|
|
1054
|
+
|
|
1055
|
+
Background profiles carrying this option use version 2 so older readers reject them instead of silently dropping the cap. Existing uncapped version 1 profiles retain their format and fingerprints.
|
|
1056
|
+
|
|
1057
|
+
Anthropic legacy manual thinking needs an output cap above 1024 tokens. An incompatible combination is rejected before the provider request; the CLI preserves your cap and thinking setting. Choose a larger cap or explicitly disable thinking. See the [provider's manual-thinking budget rules](https://platform.claude.com/docs/en/build-with-claude/extended-thinking#budget-rules-and-tuning).
|
|
1058
|
+
|
|
1002
1059
|
**Search first, then read the relevant source.** Use `web_search` with keywords when no URL is known. It returns source links and bounded snippets (`maxResults`, default 8; `maxSnippetChars`, default 2000). The configured provider is respected; `auto` selects an available API key or keyless DuckDuckGo. Captcha, authentication, rate-limit and network failures are errors, never a claim that no sources exist. Configure `.chainlesschain/config.json:webSearch` with an available provider if keyless search is blocked.
|
|
1003
1060
|
|
|
1004
1061
|
**Download once, read or search locally.** `web_fetch` downloads the page, extracts text, saves a local snapshot, and returns the first chunk (`maxChars`, default 20000). Continue with the original URL, format, `snapshotId` and returned `nextOffset` as `offset`; later reads need no network access. Pass a literal `query` with `snapshotId` to search the saved page, then pass a hit's `nextRead` arguments to `web_fetch` to inspect it. Snapshots are process-local, expire after 30 minutes, and are bounded by 32 entries / 128 MB of UTF-16 disk storage; eviction or expiry returns an explicit error. Normal process exit removes them.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chainlesschain",
|
|
3
|
-
"version": "0.166.
|
|
3
|
+
"version": "0.166.147",
|
|
4
4
|
"description": "CLI for ChainlessChain - install, configure, and manage your personal AI management system",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"homepage": "https://www.chainlesschain.com",
|
|
101
101
|
"dependencies": {
|
|
102
102
|
"@aws-sdk/client-s3": "^3.700.0",
|
|
103
|
-
"@chainlesschain/context-memory-kernel": "0.1.
|
|
103
|
+
"@chainlesschain/context-memory-kernel": "0.1.12",
|
|
104
104
|
"@chainlesschain/core-config": "0.1.2",
|
|
105
105
|
"@chainlesschain/core-db": "0.1.5",
|
|
106
106
|
"@chainlesschain/core-env": "0.1.2",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"a2a": "Usage: chainlesschain a2a [options] [command]\n\nA2A Protocol — agent-to-agent communication\n\nOptions:\n -h, --help display help for command\n\nCommands:\n register [options] <name> Register an agent card\n discover [options] Discover agents by capability or skill\n submit [options] <agent-id> <input> Submit a task to an agent\n status [options] <task-id> Get task status\n complete <task-id> <output> Mark a task as completed\n fail <task-id> <error> Mark a task as failed\n peers [options] List all registered agents\n cards [options] List all agent cards with details\n negotiate [options] <agent-id> <capabilities> Check if an agent supports required capabilities\n task-statuses [options] List V2 task statuses (Phase 81)\n card-statuses [options] List V2 card statuses (Phase 81)\n subscription-types [options] List V2 subscription types (Phase 81)\n negotiation-results [options] List V2 negotiation outcomes (Phase 81)\n validate-card [options] <name> Validate an agent card against the A2A schema\n set-card-status [options] <cardId> <status> Transition a card between active/inactive/expired\n card-status [options] <cardId> Show a card's V2 status\n send-task-v2 [options] <agentId> <input> Submit a V2 task (in-memory, with optional timeout)\n start-working [options] <taskId> Transition a V2 task to working\n request-input [options] <taskId> <prompt> Request user input while a V2 task is working\n provide-input [options] <taskId> <input> Provide input for an input-required V2 task\n complete-task-v2 [options] <taskId> [output] Complete a V2 task (from working only)\n fail-task-v2 [options] <taskId> [error] Fail a V2 task with an error message\n cancel-task [options] <taskId> [reason] Cancel a non-terminal V2 task\n check-timeout [options] <taskId> Check V2 task timeout (auto-fails if past deadline)\n task-v2 [options] <taskId> Show a V2 task snapshot\n tasks-v2 [options] List V2 tasks\n negotiate-v2 [options] <cardJson> Phase 81 capability negotiation against an agent card\n stats-v2 [options] Aggregate V2 stats (tasks + cards + subscriptions)\n enums-v2 Show V2 governance enums\n register-agent-v2 [options] Register an a2a agent profile (pending)\n activate-agent-v2 <id> Activate agent\n suspend-agent-v2 <id> Suspend agent\n retire-agent-v2 <id> Retire agent (terminal)\n touch-agent-v2 <id> Refresh lastTouchedAt\n get-agent-v2 <id> Get agent\n list-agents-v2 List agents\n create-message-v2 [options] Create an a2a message (queued)\n start-message-v2 <id> Transition message to sending\n deliver-message-v2 <id> Transition message to delivered\n fail-message-v2 [options] <id> Fail message\n cancel-message-v2 [options] <id> Cancel message\n get-message-v2 <id> Get message\n list-messages-v2 List messages\n set-max-active-agents-v2 <n> Set per-owner active cap\n set-max-pending-messages-v2 <n> Set per-agent pending cap\n set-agent-idle-ms-v2 <n> Set idle threshold\n set-message-stuck-ms-v2 <n> Set stuck threshold\n auto-suspend-idle-agents-v2 Auto-suspend idle agents\n auto-fail-stuck-messages-v2 Auto-fail stuck sending messages\n gov-stats-v2 V2 governance aggregate stats\n help [command] display help for command\n",
|
|
6
6
|
"activitypub": "Usage: chainlesschain activitypub|ap [options] [command]\n\nActivityPub C2S bridge — actors, outbox/inbox, Follow/Create/Like/Announce\n\nOptions:\n -h, --help display help for command\n\nCommands:\n actor Manage local and remote ActivityPub actors\n publish [options] <content> Publish a Create(Note) activity to the actor's outbox\n follow [options] <target> Publish a Follow activity (target: username or actor URL)\n accept [options] <follow-activity-id> Accept a pending Follow request\n unfollow [options] <target> Publish an Undo(Follow) activity\n like [options] <object-id> Publish a Like activity for an object URL\n announce [options] <object-id> Publish an Announce (boost) activity for an object URL\n outbox [options] <username> List an actor's outbox activities\n inbox [options] <username> List an actor's inbox activities\n deliver [options] <username> <activity-json> Simulate inbox delivery — push a JSON activity into a local actor's inbox\n followers [options] <username> List followers of an actor\n search [options] <query> Search actors and/or notes in the local Fediverse index\n following [options] <username> List who this actor is following\n enums-v2 Show V2 enums\n register-actor-v2 [options] Register an AP actor profile (pending)\n activate-actor-v2 <id> Activate actor\n suspend-actor-v2 <id> Suspend actor\n deactivate-actor-v2 <id> Deactivate actor (terminal)\n touch-actor-v2 <id> Refresh lastTouchedAt\n get-actor-v2 <id> Get actor\n list-actors-v2 List actors\n create-activity-v2 [options] Create an AP activity (queued)\n start-activity-v2 <id> Transition activity to delivering\n deliver-activity-v2 <id> Transition activity to delivered\n fail-activity-v2 [options] <id> Fail activity\n cancel-activity-v2 [options] <id> Cancel activity\n get-activity-v2 <id> Get activity\n list-activities-v2 List activities\n set-max-active-actors-v2 <n> Set per-owner active cap\n set-max-pending-activities-v2 <n> Set per-actor pending cap\n set-actor-idle-ms-v2 <n> Set idle threshold\n set-activity-stuck-ms-v2 <n> Set stuck threshold\n auto-suspend-idle-actors-v2 Auto-suspend idle actors\n auto-fail-stuck-activities-v2 Auto-fail stuck delivering activities\n gov-stats-v2 V2 governance aggregate stats\n help [command] display help for command\n",
|
|
7
7
|
"agenda": "Usage: chainlesschain agenda [options] [command]\n\nFire agent-scheduled wakeups / crons / monitors (persisted by the `schedule`\ntool)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n list [options] List all scheduled entries\n run [options] Fire every entry that is due now\n cancel [options] <id> Remove a scheduled entry by id\n prune [options] Remove finished entries (fired / matched / exhausted /\n expired)\n help [command] display help for command\n",
|
|
8
|
-
"agent": "Usage: chainlesschain agent|a [options] [command] [task...]\n\nStart an agentic AI session (reads/writes files, runs commands)\n\nArguments:\n task Headless task 鈥?when given (or with -p /\n piped stdin), runs non-interactively\n\nOptions:\n --model <model> Model name\n --context-window <tokens> Operator-declared planning window\n (1024-16777216 tokens); not runtime\n verified\n --provider <provider> LLM provider (ollama, openai,\n volcengine, deepseek, ...)\n --base-url <url> API base URL\n --service-tier <tier> Reviewed provider service tier\n (standard, fast, flex, ultrafast)\n --api-key <key> API key\n --think [level] Enable Anthropic extended thinking\n (level: think | hard | ultra; Anthropic\n models only)\n --ultrathink Maximum Anthropic extended thinking (=\n --think ultra)\n --thinking-budget <n> Thinking token budget for legacy Claude\n models (Sonnet 4.5 / Opus 4.0-4.5 /\n older); clamped below max_tokens.\n Adaptive-thinking models ignore it (they\n use --think's effort). Requires\n --think/--ultrathink.\n --image <path> Attach an image (png/jpg/jpeg/gif/webp)\n to the prompt for a vision-capable model\n (headless; repeatable)\n --vision-model <id> Explicit image model override\n (otherwise: multimodal main model, then\n config llm.visionModel or\n doubao-seed-2-0-lite-260215)\n --session <id> Resume a previous agent session\n -c, --continue Resume the most recent session (no id\n needed 鈥?claude --continue parity)\n --resume [id] Resume a session by id (no id 鈫?most\n recent 鈥?claude --resume parity)\n --fork-session When resuming, branch into a NEW session\n id and leave the original untouched\n (claude --fork-session parity)\n --fork-request-id <key> Stable idempotency key for\n --fork-session retries (omit for a new\n fork each invocation)\n --add-dir <dir> Extra working directory the agent may\n read/search/edit (repeatable)\n --checkpoint Auto-snapshot the work tree before each\n mutating tool (DEFAULT inside a git\n repo; cc checkpoint restore to roll\n back)\n --no-checkpoint Disable auto-checkpointing (it is on by\n default inside git repos)\n --managed-checkpoint Checkpoint bounded mutating tools with\n Process Broker; unavailable writer\n lifetimes are reported as coverage none\n --managed-checkpoint-state <dir> Durable managed-checkpoint state\n directory (must be outside the\n workspace)\n --managed-checkpoint-exclude <path> Explicit workspace path excluded from\n managed checkpoints; repeatable and\n reported as partial coverage\n --safe-mode Run bare: disable project memory,\n settings hooks, memory recall, IDE\n context, status line and update notice\n (permission rules STAY active)\n --bare Everything --safe-mode disables PLUS\n skills, plugins and MCP/IDE auto-connect\n — minimal fast surface for scripted\n calls (explicit --mcp-config still\n loads; permission rules STAY active)\n --no-plugins Disable plugin customizations for this\n run\n --ephemeral No session persistence: nothing is\n written to the session store (headless;\n a --resume id still replays history\n read-only)\n --decision-mode <mode> Typed Skill-routing experiment for\n durable headless sessions: off | shadow\n | suggest (default: \"off\")\n --decision-provider <provider> Decision provider: typesafe | laya\n (local) | system-one (compatible API)\n (default: \"typesafe\")\n --decision-model <model> Decision model (defaults:\n typesafe=jev-latest, laya=laya; required\n for system-one)\n --decision-base-url <url> System One API base URL (laya: loopback\n only; other providers: HTTPS or\n loopback)\n --decision-timeout-ms <ms> Decision timeout in milliseconds\n (50-30000; default: 800)\n --capabilities Print a machine-readable capability\n manifest (JSON: protocol version, tools,\n permission modes, exit codes) and exit\n --disable-slash-commands Interactive REPL: don't dispatch '/'\n input as slash commands — it reaches the\n model verbatim (/exit and /quit stay\n live)\n --ax-screen-reader Screen-reader friendly output: no ANSI\n colors, no in-place status line repaints\n (also CC_SCREEN_READER=1)\n --worktree Run this session in a fresh git worktree\n (isolated branch; auto-removed when the\n session changes nothing)\n --no-worktree Background Git task: explicitly share\n the current work tree (intended for\n read-only tasks; writable runs are not\n isolated)\n --unattended Enable fail-closed shell action policy\n for scheduled/event-driven runs\n --unattended-allow <classes> Comma-separated action classes\n explicitly allowed for unattended shell\n runs\n --sandbox [image] Run shell commands in an ephemeral\n Docker sandbox (network disabled by\n default)\n --sandbox-mode <mode> Sandbox posture: off | workspace-write |\n strict (explicit isolation modes fail\n closed)\n --sandbox-network Allow network access inside --sandbox\n --otlp <file> Write the agent run's OpenTelemetry\n spans (model/tool/retry) as OTLP/JSON to\n <file>\n --otlp-content Include prompt/response CONTENT in\n --otlp spans (off by default; content is\n redacted unless this is set)\n --auto-rewake When an async `asyncRewake` hook (e.g. a\n background test) fails at turn end,\n re-engage the agent to fix it (bounded\n by --max-rewakes)\n --auto-pin Force-pin the original task (first user\n turn) through compaction (ON by default;\n disable with CC_AUTO_PIN=0 or config\n context.autoPin=false)\n --max-rewakes <n> Max auto-rewake re-drives per run\n (default 1); implies --auto-rewake\n --bg, --background Start as a detached background agent and\n return its id immediately\n --agent-id <id> Agent id for scoped memory recall\n --recall-limit <n> Top-K memories to inject into system\n prompt\n --recall-query <q> Query string for startup memory recall\n --no-recall-memory Disable automatic Memory recall in the\n interactive session\n --vim Start the interactive REPL in vim-mode\n line editing (toggle later with /vim; or\n CC_VIM=1)\n --no-stream Disable streamed response rendering\n --no-park-on-exit Close the session-core handle on exit\n instead of parking it\n --bundle <path> Agent bundle directory (may execute\n local MCP commands from mcp.json)\n -p, --print [prompt] Headless: run one non-interactive turn\n and exit\n --output-format <fmt> Headless output: text | json |\n stream-json (default: \"text\")\n --max-turns <n> Cap agent loop iterations (0 =\n unlimited; interactive streams default\n to unlimited, unattended runs to 50)\n --review-changes Headless: review write/edit tool changes\n once within remaining budgets; final\n text only (no partial deltas)\n --json-schema <file> Headless structured output: final reply\n must be JSON validating against this\n schema (invalid replies retried)\n --allowed-tools <list> Comma/space-separated tool allow-list\n (headless)\n --disallowed-tools <list> Comma/space-separated tool deny-list\n (headless)\n --permission-mode <mode> manual | auto | dontAsk | default | plan\n | acceptEdits | bypassPermissions (plan\n headless-only)\n --no-file-refs Disable @path file-reference expansion\n in the prompt (headless)\n --no-slash-macros Disable /name custom-command\n (.claude/commands) expansion in the\n prompt (headless)\n --system-prompt <text> Replace the built-in system prompt\n (literal text or @file)\n --append-system-prompt <text> Append extra guidance to the system\n prompt (literal text or @file)\n --no-project-memory Skip auto-loaded project memory (cc.md /\n CLAUDE.md / AGENTS.md hierarchy,\n .chainlesschain/rules.md,\n .claude/rules/*.md) — a lean system\n prompt for token-tight surfaces (e.g.\n IDE chat). The agent can still read\n those files with tools when it needs\n them.\n --output-style <name> Apply a named output-style persona\n (.claude/output-styles/<name>.md or a\n built-in: concise | explanatory |\n learning)\n --input-format <fmt> Headless input: text | stream-json\n (NDJSON user events on stdin,\n multi-turn) (default: \"text\")\n --trace-id <id> Correlation id stamped as `trace_id` on\n every stream-json output line (also read\n from CC_TRACE_ID). Lets an IDE/bridge\n trace one run across its own logs, the\n CLI, transcripts and diagnostics.\n Auto-generated per run when omitted.\n --fallback-model <model> Backup model(s) to try in order when the\n primary fails (transient error or\n model-not-found). Repeatable or\n comma-separated; up to 3. A\n `provider:model` entry (e.g.\n openai:gpt-4o) falls back\n cross-provider, using that provider's\n API key from its env var (skipped if\n unset — never reuses the primary key).\n Defaults to config llm.fallbackModels.\n --include-partial-messages Emit live assistant-text deltas as\n stream_event lines (requires\n --output-format stream-json)\n --include-hook-events Emit redacted hook and subagent\n lifecycle events (requires\n --output-format stream-json)\n --goal [id] Bind a cc goal into the run (id, or omit\n the value to auto-resolve the active\n goal)\n --goal-assess After the run, ask the model to assess\n goal progress and persist it (opt-in;\n costs one extra completion; requires\n --goal)\n --goal-condition <spec> Session completion condition; prefer\n verify:<manifest.json> for independent\n engineering acceptance, or\n exit-zero:/file-exists:/contains:/regex:;\n model:<desc> uses model judgment\n --goal-recovery-reviewed Resume an interrupted goal after\n reviewing prior effects and usage\n (requires --resume/--continue and\n --goal-condition)\n --max-outer-turns <n> Max outer re-drive turns for\n --goal-condition (default 10, hard cap\n 100)\n --goal-max-tokens <n> Token budget across --goal-condition\n outer turns\n --goal-max-cost <usd> Cost budget (USD) across\n --goal-condition outer turns\n --goal-max-time <ms> Wall-clock budget (ms) across\n --goal-condition outer turns\n --mcp-config <file> Load ad-hoc MCP servers from a JSON file\n for this run (headless); their tools\n become callable (mcp__<server>__<tool>)\n --no-mcp Don't auto-connect MCP servers\n registered with `cc mcp add\n --auto-connect` (--mcp-config still\n loads)\n --no-mcp-auto-connect Disable implicit MCP and editor\n discovery (explicit --mcp-config or\n bridge flags still apply)\n --ide Force-enable IDE bridge auto-connect:\n discover a running editor's MCP server\n via ~/.chainlesschain/ide/*.json\n (default: auto inside an IDE integrated\n terminal)\n --no-ide Disable IDE bridge auto-connect\n --pdh Force-enable PDH bridge auto-connect:\n discover the Android app's\n device-capability MCP server via\n ~/.chainlesschain/pdh-bridge/*.json\n (default: auto when\n CHAINLESSCHAIN_PDH_PORT is set)\n --no-pdh Disable PDH bridge auto-connect\n --jetbrains Force-enable IntelliJ IDEA built-in MCP\n (IDEA >= 2025.2) as server `idea`\n (default: auto when the ChainlessChain\n JetBrains plugin injects\n CHAINLESSCHAIN_JETBRAINS_MCP_URL)\n --no-jetbrains Disable IDEA built-in MCP auto-connect\n --interactive-approvals Stream mode: confirm-tier approvals\n become approval_request/approval\n stdin-stdout events instead of failing\n closed (chat-panel UX)\n --permission-prompt-tool <tool> Defer tool approvals to an MCP tool\n (mcp__<server>__<tool>; requires\n --mcp-config) instead of headless\n fail-closed\n --remote-control Route confirm-tier approvals to paired\n mobile/web devices — requires a relay or\n explicit LAN opt-in; headless waits\n fail-closed, interactive races the\n terminal prompt (also /remote-control)\n --remote-control-allow-lan Permit --remote-control to expose its\n authenticated WS endpoint on a trusted\n LAN\n --channels <list> Inbound channels for the interactive\n session (webhook[:port],telegram) —\n external events enter as user turns;\n webhook needs its bearer token, telegram\n needs channels.telegram.allowFrom\n --settings <file> Merge an extra\n .claude/settings.json-shaped file for\n this run: permission rules\n (allow/ask/deny) + native config\n overrides (model, env)\n --max-budget-usd <amount> Hard USD spend cap: stop the run before\n the next paid LLM call once the\n estimated cost reaches this (headless;\n uses the cc cost price table)\n --session-budget Enable the durable session-wide budget\n authority (headless; requires\n --session/--resume/--continue)\n --session-max-concurrent <n> Durable session cap for concurrent child\n work\n --session-max-spawns <n> Durable session cap for total child-work\n admissions\n --session-max-depth <n> Durable session cap for child-agent\n nesting depth\n --session-max-turns <n> Durable session cap for model turns\n across resumes\n --session-max-tokens <n> Durable session cap for\n provider-reported tokens across resumes\n --session-max-cost-usd <amount> Durable session cost cap across resumes\n (requires priced provider usage)\n --session-max-wall-ms <n> Durable session cap for cumulative\n active wall time\n --session-max-tool-ms <n> Durable session cap for aggregate tool\n execution time\n --observability-workspace <id> Persist a workspace scope on new session\n authority for causal reports\n --observability-team <id> Persist a team scope on new session\n authority for causal reports\n --observability-policy <id> Persist a policy scope on new session\n authority for causal reports\n --strict-mcp-config Use ONLY --mcp-config servers; ignore\n registered (cc mcp add) and IDE-bridge\n MCP for a reproducible tool surface\n --project-mcp Opt in to loading a project-scoped\n .mcp.json (default off; a checked-in\n .mcp.json can spawn commands)\n --replay-user-messages Stream-input mode: echo each accepted\n stdin user message back as a `user`\n event (transcript/correlation)\n --allow-dangerous-bypass Bypass all permission prompts in\n headless mode (DANGEROUS: auto-approves\n all tool calls) (default: false)\n -y, --yolo Alias for --allow-dangerous-bypass\n (default: false)\n --dangerously-skip-permissions Alias for --allow-dangerous-bypass\n (default: false)\n -h, --help display help for command\n\nCommands:\n controlled-host [options] Run against a pre-provisioned Linux\n permission authority (one-shot, dontAsk)\n process-ownership Inspect Linux process quarantine or\n explicitly stop one recoverable\n execution\n",
|
|
8
|
+
"agent": "Usage: chainlesschain agent|a [options] [command] [task...]\n\nStart an agentic AI session (reads/writes files, runs commands)\n\nArguments:\n task Headless task 鈥?when given (or with -p /\n piped stdin), runs non-interactively\n\nOptions:\n --model <model> Model name\n --context-window <tokens> Operator-declared planning window\n (1024-16777216 tokens); not runtime\n verified\n --max-output-tokens <tokens> Maximum provider output tokens per\n agent-loop request (positive safe\n integer)\n --provider <provider> LLM provider (ollama, openai,\n volcengine, deepseek, ...)\n --base-url <url> API base URL\n --service-tier <tier> Reviewed provider service tier\n (standard, fast, flex, ultrafast)\n --api-key <key> API key\n --think [level] Enable Anthropic extended thinking\n (level: think | hard | ultra; Anthropic\n models only)\n --ultrathink Maximum Anthropic extended thinking (=\n --think ultra)\n --thinking-budget <n> Thinking token budget for legacy Claude\n models (Sonnet 4.5 / Opus 4.0-4.5 /\n older); clamped below max_tokens.\n Adaptive-thinking models ignore it (they\n use --think's effort). Requires\n --think/--ultrathink.\n --image <path> Attach an image (png/jpg/jpeg/gif/webp)\n to the prompt for a vision-capable model\n (headless; repeatable)\n --vision-model <id> Explicit image model override\n (otherwise: multimodal main model, then\n config llm.visionModel or\n doubao-seed-2-0-lite-260215)\n --session <id> Resume a previous agent session\n -c, --continue Resume the most recent session (no id\n needed 鈥?claude --continue parity)\n --resume [id] Resume a session by id (no id 鈫?most\n recent 鈥?claude --resume parity)\n --fork-session When resuming, branch into a NEW session\n id and leave the original untouched\n (claude --fork-session parity)\n --fork-request-id <key> Stable idempotency key for\n --fork-session retries (omit for a new\n fork each invocation)\n --add-dir <dir> Extra working directory the agent may\n read/search/edit (repeatable)\n --checkpoint Auto-snapshot the work tree before each\n mutating tool (DEFAULT inside a git\n repo; cc checkpoint restore to roll\n back)\n --no-checkpoint Disable auto-checkpointing (it is on by\n default inside git repos)\n --managed-checkpoint Checkpoint bounded mutating tools with\n Process Broker; unavailable writer\n lifetimes are reported as coverage none\n --managed-checkpoint-state <dir> Durable managed-checkpoint state\n directory (must be outside the\n workspace)\n --managed-checkpoint-exclude <path> Explicit workspace path excluded from\n managed checkpoints; repeatable and\n reported as partial coverage\n --safe-mode Run bare: disable project memory,\n settings hooks, memory recall, IDE\n context, status line and update notice\n (permission rules STAY active)\n --bare Everything --safe-mode disables PLUS\n skills, plugins and MCP/IDE auto-connect\n — minimal fast surface for scripted\n calls (explicit --mcp-config still\n loads; permission rules STAY active)\n --no-plugins Disable plugin customizations for this\n run\n --ephemeral No session persistence: nothing is\n written to the session store (headless;\n a --resume id still replays history\n read-only)\n --decision-mode <mode> Typed Skill-routing experiment for\n durable headless sessions: off | shadow\n | suggest (default: \"off\")\n --decision-provider <provider> Decision provider: typesafe | laya\n (local) | system-one (compatible API)\n (default: \"typesafe\")\n --decision-model <model> Decision model (defaults:\n typesafe=jev-latest, laya=laya; required\n for system-one)\n --decision-base-url <url> System One API base URL (laya: loopback\n only; other providers: HTTPS or\n loopback)\n --decision-timeout-ms <ms> Decision timeout in milliseconds\n (50-30000; default: 800)\n --capabilities Print a machine-readable capability\n manifest (JSON: protocol version, tools,\n permission modes, exit codes) and exit\n --disable-slash-commands Interactive REPL: don't dispatch '/'\n input as slash commands — it reaches the\n model verbatim (/exit and /quit stay\n live)\n --ax-screen-reader Screen-reader friendly output: no ANSI\n colors, no in-place status line repaints\n (also CC_SCREEN_READER=1)\n --worktree Run this session in a fresh git worktree\n (isolated branch; auto-removed when the\n session changes nothing)\n --no-worktree Background Git task: explicitly share\n the current work tree (intended for\n read-only tasks; writable runs are not\n isolated)\n --unattended Enable fail-closed shell action policy\n for scheduled/event-driven runs\n --unattended-allow <classes> Comma-separated action classes\n explicitly allowed for unattended shell\n runs\n --sandbox [image] Run shell commands in an ephemeral\n Docker sandbox (network disabled by\n default)\n --sandbox-mode <mode> Sandbox posture: off | workspace-write |\n strict (explicit isolation modes fail\n closed)\n --sandbox-network Allow network access inside --sandbox\n --otlp <file> Write the agent run's OpenTelemetry\n spans (model/tool/retry) as OTLP/JSON to\n <file>\n --otlp-content Include prompt/response CONTENT in\n --otlp spans (off by default; content is\n redacted unless this is set)\n --auto-rewake When an async `asyncRewake` hook (e.g. a\n background test) fails at turn end,\n re-engage the agent to fix it (bounded\n by --max-rewakes)\n --auto-pin Force-pin the original task (first user\n turn) through compaction (ON by default;\n disable with CC_AUTO_PIN=0 or config\n context.autoPin=false)\n --max-rewakes <n> Max auto-rewake re-drives per run\n (default 1); implies --auto-rewake\n --bg, --background Start as a detached background agent and\n return its id immediately\n --agent-id <id> Agent id for scoped memory recall\n --recall-limit <n> Top-K memories to inject into system\n prompt\n --recall-query <q> Query string for startup memory recall\n --no-recall-memory Disable automatic Memory recall in the\n interactive session\n --vim Start the interactive REPL in vim-mode\n line editing (toggle later with /vim; or\n CC_VIM=1)\n --no-stream Disable streamed response rendering\n --no-park-on-exit Close the session-core handle on exit\n instead of parking it\n --bundle <path> Agent bundle directory (may execute\n local MCP commands from mcp.json)\n -p, --print [prompt] Headless: run one non-interactive turn\n and exit\n --output-format <fmt> Headless output: text | json |\n stream-json (default: \"text\")\n --max-turns <n> Cap agent loop iterations (0 =\n unlimited; interactive streams default\n to unlimited, unattended runs to 50)\n --review-changes Headless: review write/edit tool changes\n once within remaining budgets; final\n text only (no partial deltas)\n --json-schema <file> Headless structured output: final reply\n must be JSON validating against this\n schema (invalid replies retried)\n --allowed-tools <list> Comma/space-separated tool allow-list\n (headless)\n --disallowed-tools <list> Comma/space-separated tool deny-list\n (headless)\n --permission-mode <mode> manual | auto | dontAsk | default | plan\n | acceptEdits | bypassPermissions (plan\n headless-only)\n --no-file-refs Disable @path file-reference expansion\n in the prompt (headless)\n --no-slash-macros Disable /name custom-command\n (.claude/commands) expansion in the\n prompt (headless)\n --system-prompt <text> Replace the built-in system prompt\n (literal text or @file)\n --append-system-prompt <text> Append extra guidance to the system\n prompt (literal text or @file)\n --no-project-memory Skip auto-loaded project memory (cc.md /\n CLAUDE.md / AGENTS.md hierarchy,\n .chainlesschain/rules.md,\n .claude/rules/*.md) — a lean system\n prompt for token-tight surfaces (e.g.\n IDE chat). The agent can still read\n those files with tools when it needs\n them.\n --output-style <name> Apply a named output-style persona\n (.claude/output-styles/<name>.md or a\n built-in: concise | explanatory |\n learning)\n --input-format <fmt> Headless input: text | stream-json\n (NDJSON user events on stdin,\n multi-turn) (default: \"text\")\n --trace-id <id> Correlation id stamped as `trace_id` on\n every stream-json output line (also read\n from CC_TRACE_ID). Lets an IDE/bridge\n trace one run across its own logs, the\n CLI, transcripts and diagnostics.\n Auto-generated per run when omitted.\n --fallback-model <model> Backup model(s) to try in order when the\n primary fails (transient error or\n model-not-found). Repeatable or\n comma-separated; up to 3. A\n `provider:model` entry (e.g.\n openai:gpt-4o) falls back\n cross-provider, using that provider's\n API key from its env var (skipped if\n unset — never reuses the primary key).\n Defaults to config llm.fallbackModels.\n --include-partial-messages Emit live assistant-text deltas as\n stream_event lines (requires\n --output-format stream-json)\n --include-hook-events Emit redacted hook and subagent\n lifecycle events (requires\n --output-format stream-json)\n --goal [id] Bind a cc goal into the run (id, or omit\n the value to auto-resolve the active\n goal)\n --goal-assess After the run, ask the model to assess\n goal progress and persist it (opt-in;\n costs one extra completion; requires\n --goal)\n --goal-condition <spec> Session completion condition; prefer\n verify:<manifest.json> for independent\n engineering acceptance, or\n exit-zero:/file-exists:/contains:/regex:;\n model:<desc> uses model judgment\n --goal-recovery-reviewed Resume an interrupted goal after\n reviewing prior effects and usage\n (requires --resume/--continue and\n --goal-condition)\n --max-outer-turns <n> Max outer re-drive turns for\n --goal-condition (default 10, hard cap\n 100)\n --goal-max-tokens <n> Token budget across --goal-condition\n outer turns\n --goal-max-cost <usd> Cost budget (USD) across\n --goal-condition outer turns\n --goal-max-time <ms> Wall-clock budget (ms) across\n --goal-condition outer turns\n --mcp-config <file> Load ad-hoc MCP servers from a JSON file\n for this run (headless); their tools\n become callable (mcp__<server>__<tool>)\n --no-mcp Don't auto-connect MCP servers\n registered with `cc mcp add\n --auto-connect` (--mcp-config still\n loads)\n --no-mcp-auto-connect Disable implicit MCP and editor\n discovery (explicit --mcp-config or\n bridge flags still apply)\n --ide Force-enable IDE bridge auto-connect:\n discover a running editor's MCP server\n via ~/.chainlesschain/ide/*.json\n (default: auto inside an IDE integrated\n terminal)\n --no-ide Disable IDE bridge auto-connect\n --pdh Force-enable PDH bridge auto-connect:\n discover the Android app's\n device-capability MCP server via\n ~/.chainlesschain/pdh-bridge/*.json\n (default: auto when\n CHAINLESSCHAIN_PDH_PORT is set)\n --no-pdh Disable PDH bridge auto-connect\n --jetbrains Force-enable IntelliJ IDEA built-in MCP\n (IDEA >= 2025.2) as server `idea`\n (default: auto when the ChainlessChain\n JetBrains plugin injects\n CHAINLESSCHAIN_JETBRAINS_MCP_URL)\n --no-jetbrains Disable IDEA built-in MCP auto-connect\n --interactive-approvals Stream mode: confirm-tier approvals\n become approval_request/approval\n stdin-stdout events instead of failing\n closed (chat-panel UX)\n --permission-prompt-tool <tool> Defer tool approvals to an MCP tool\n (mcp__<server>__<tool>; requires\n --mcp-config) instead of headless\n fail-closed\n --remote-control Route confirm-tier approvals to paired\n mobile/web devices — requires a relay or\n explicit LAN opt-in; headless waits\n fail-closed, interactive races the\n terminal prompt (also /remote-control)\n --remote-control-allow-lan Permit --remote-control to expose its\n authenticated WS endpoint on a trusted\n LAN\n --channels <list> Inbound channels for the interactive\n session (webhook[:port],telegram) —\n external events enter as user turns;\n webhook needs its bearer token, telegram\n needs channels.telegram.allowFrom\n --settings <file> Merge an extra\n .claude/settings.json-shaped file for\n this run: permission rules\n (allow/ask/deny) + native config\n overrides (model, env)\n --max-budget-usd <amount> Hard USD spend cap: stop the run before\n the next paid LLM call once the\n estimated cost reaches this (headless;\n uses the cc cost price table)\n --session-budget Enable the durable session-wide budget\n authority (headless; requires\n --session/--resume/--continue)\n --session-max-concurrent <n> Durable session cap for concurrent child\n work\n --session-max-spawns <n> Durable session cap for total child-work\n admissions\n --session-max-depth <n> Durable session cap for child-agent\n nesting depth\n --session-max-turns <n> Durable session cap for model turns\n across resumes\n --session-max-tokens <n> Durable session cap for\n provider-reported tokens across resumes\n --session-max-cost-usd <amount> Durable session cost cap across resumes\n (requires priced provider usage)\n --session-max-wall-ms <n> Durable session cap for cumulative\n active wall time\n --session-max-tool-ms <n> Durable session cap for aggregate tool\n execution time\n --observability-workspace <id> Persist a workspace scope on new session\n authority for causal reports\n --observability-team <id> Persist a team scope on new session\n authority for causal reports\n --observability-policy <id> Persist a policy scope on new session\n authority for causal reports\n --strict-mcp-config Use ONLY --mcp-config servers; ignore\n registered (cc mcp add) and IDE-bridge\n MCP for a reproducible tool surface\n --project-mcp Opt in to loading a project-scoped\n .mcp.json (default off; a checked-in\n .mcp.json can spawn commands)\n --replay-user-messages Stream-input mode: echo each accepted\n stdin user message back as a `user`\n event (transcript/correlation)\n --allow-dangerous-bypass Bypass all permission prompts in\n headless mode (DANGEROUS: auto-approves\n all tool calls) (default: false)\n -y, --yolo Alias for --allow-dangerous-bypass\n (default: false)\n --dangerously-skip-permissions Alias for --allow-dangerous-bypass\n (default: false)\n -h, --help display help for command\n\nCommands:\n controlled-host [options] Run against a pre-provisioned Linux\n permission authority (one-shot, dontAsk)\n process-ownership Inspect Linux process quarantine or\n explicitly stop one recoverable\n execution\n",
|
|
9
9
|
"agent-network": "Usage: chainlesschain agent-network|anet [options] [command]\n\nDecentralized Agent Network (Phase 24) — DID / registry / credentials / task\nrouting\n\nOptions:\n -h, --help display help for command\n\nCommands:\n config [options] Show network constants & reputation weights\n dimensions [options] List reputation dimensions\n task-statuses [options] List task lifecycle statuses\n did-create [options] Create an Agent DID (Ed25519 + DID document)\n did-resolve [options] <did> Resolve DID → DID document\n dids [options] List Agent DIDs\n did-deactivate [options] <did> Deactivate a DID (also forces registry offline)\n sign [options] <did> <data> Sign data with agent's Ed25519 key\n verify [options] <did> <data> <signature> Verify a signature from an agent\n register [options] <did> <orgId> Register an Agent in the federated registry\n unregister [options] <did> Remove an Agent from the registry\n heartbeat [options] <did> Bump last_heartbeat (forces online)\n discover [options] Discover agents (capability / org / status)\n sweep [options] Mark stale online agents offline\n peer-add [options] <peerId> Add/update a Kademlia peer (k-bucket auto-computed)\n peer-remove [options] <peerId> Remove a peer\n peers [options] List peers (optionally by k-bucket)\n auth-start [options] <did> Issue an auth challenge for a DID\n auth-complete [options] <sessionId> <signature> Complete auth with signature over challenge\n auth-validate [options] <token> Validate a session token (returns agentDid or exits 1)\n auth-sessions [options] List auth sessions\n credential-issue [options] <issuerDid> <subjectDid> Issue a VC with HMAC/Ed25519 proof\n credential-verify [options] <id> Verify a VC (signature + expiry + revocation)\n credential-revoke [options] <id> Revoke a credential\n credential-show [options] <id> Show a credential\n credentials [options] List credentials (filter by subject/issuer/status/type)\n task-route [options] <sourceOrg> <taskType> Route task → pick best-rep agent matching capability\n task-show [options] <taskId> Show a task\n task-status [options] <taskId> <status> Update task status (terminal states set completedAt)\n task-cancel [options] <taskId> Cancel a task (sets CANCELLED + reason)\n tasks [options] List tasks\n rep-update [options] <did> <dimension> <score> Record a reputation observation\n rep-show [options] <did> Show reputation summary (weighted total + per-dim avg)\n rep-history [options] <did> Show reputation history (newest first)\n rep-top [options] Top agents by dimension (or total)\n stats [options] Network-level statistics\n agent-maturities-v2 List V2 agent maturity states\n task-lifecycles-v2 List V2 task lifecycle states\n stats-v2 V2 agent-network stats\n get-max-active-agents-v2 Get max active agents per network (V2)\n set-max-active-agents-v2 <n> Set max active agents per network (V2)\n get-max-pending-tasks-v2 Get max pending tasks per agent (V2)\n set-max-pending-tasks-v2 <n> Set max pending tasks per agent (V2)\n get-agent-idle-ms-v2 Get agent idle threshold (V2)\n set-agent-idle-ms-v2 <ms> Set agent idle threshold (V2)\n get-task-stuck-ms-v2 Get task stuck threshold (V2)\n set-task-stuck-ms-v2 <ms> Set task stuck threshold (V2)\n active-agent-count-v2 <networkId> Active agent count for network (V2)\n pending-task-count-v2 <agentId> Pending task count for agent (V2)\n register-agent-v2 [options] <id> Register a V2 agent\n get-agent-v2 <id> Get a V2 agent\n list-agents-v2 [options] List V2 agents\n set-agent-status-v2 <id> <next> Set V2 agent status\n activate-agent-v2 <id> Activate a V2 agent\n suspend-agent-v2 <id> Suspend a V2 agent\n revoke-agent-v2 <id> Revoke a V2 agent\n touch-agent-v2 <id> Touch a V2 agent\n create-task-v2 [options] <id> Create a V2 task\n get-task-v2 <id> Get a V2 task\n list-tasks-v2 [options] List V2 tasks\n set-task-status-v2 <id> <next> Set V2 task status\n start-task-v2 <id> Start a V2 task\n complete-task-v2 <id> Complete a V2 task\n fail-task-v2 <id> Fail a V2 task\n cancel-task-v2 <id> Cancel a V2 task\n auto-suspend-idle-agents-v2 Auto-suspend idle V2 agents\n auto-fail-stuck-tasks-v2 Auto-fail stuck V2 tasks\n help [command] display help for command\n",
|
|
10
10
|
"agents": "Usage: chainlesschain agents [options] [command]\n\nUser-defined subagents (.claude/agents/*.md)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n background|bg [options] List background agent sessions\n logs [options] <id> Print recent output from a background agent\n view [options] <id> Show a detailed background agent view\n stop [options] <id> Stop a running background agent\n rename [options] <id> <title...> Rename a background agent session\n list|ls [options] List discovered subagents (project +\n personal)\n show [options] <name> Show an agent's metadata + system prompt\n run [options] <name> [task...] Run a task headlessly as the named subagent\n new [options] <name> Scaffold a new agent file (project-native\n .chainlesschain/agents/)\n help [command] display help for command\n",
|
|
11
11
|
"android": "Usage: chainlesschain android [options] [command]\n\nAndroid-native bridge: ContentResolver / SAF / Accessibility / Shizuku / root\n(Plan A A7)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n caps [options] Probe what bridge capabilities are available on this\n device\n contacts ContentResolver: contacts\n sms ContentResolver: SMS\n calls ContentResolver: call log\n app PackageManager: app inventory + Intent\n fs SAF / sandbox filesystem\n a11y Accessibility Service\n shizuku Shizuku ADB-like privileges\n root Magisk root su\n perms [options] <name> Check (and request) a runtime permission\n help [command] display help for command\n",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"mcp": "Usage: chainlesschain mcp [options] [command]\n\nMCP server management and tool execution\n\nOptions:\n -h, --help display help for command\n\nCommands:\n tasks Track durable server tasks in a canonical session (experimental, HTTP(S))\n login [options] <target> Authorize a remote MCP server via OAuth (opens a browser, or prints the URL in headless/SSH environments); stores the token. <target> is a URL or a configured server name.\n logout <target> Delete the stored OAuth token for a remote MCP server (<target> is a URL or a configured server name)\n auth [options] List stored MCP OAuth tokens\n serve [options] Expose local file tools (read/list/search/write, root-confined) as a Streamable-HTTP MCP server for other clients\n computer-use [options] Expose GUI control (screenshot/window-list/click/type/scroll/clipboard/app-launch) as a Streamable-HTTP MCP server. OFF by default; input verbs need confirm:true; high-risk apps (terminals/IDEs/settings/password managers) always confirm\n servers|list [options] List configured MCP servers\n materialize-package [options] <name> Replace one exact JavaScript package launcher with a content-addressed, guarded dependency capsule\n trust-executable [options] <name> Review and trust the current executable and interpreter-entrypoint bytes for one stdio MCP server\n add [options] <name> Add or update an MCP server configuration\n remove [options] <name> Remove an MCP server configuration\n get [options] <name> Show one MCP server configuration and its source\n doctor [options] [name] Validate MCP configuration and test transport handshakes\n connect [options] <name> Connect to an MCP server and verify its capabilities\n disconnect <name> Disconnect from an MCP server\n tools [options] List available MCP tools\n call [options] <tool> Call an MCP tool\n resources [options] List resources exposed by MCP servers\n read-resource [options] <uri> Read an MCP resource by URI\n prompts [options] List prompts exposed by MCP servers\n get-prompt [options] <name> Fetch a rendered MCP prompt by name\n trust-helper [options] <name> Trust the exact headers helper command for a workspace-local MCP server\n trust-project [options] Re-trust the project .mcp.json after reviewing a content change (records its fingerprint for --project-mcp runs)\n scaffold [options] <name> Scaffold a new MCP server project (stdio or http+sse)\n registry Browse the curated catalog of community MCP servers\n server-maturities-v2 List MCP server maturity states (V2)\n invocation-lifecycle-v2 List MCP invocation lifecycle states (V2)\n stats-v2 Show MCP registry V2 stats\n config-v2 Show MCP registry V2 config\n register-server-v2 <id> <owner> <endpoint> Register an MCP server (V2)\n activate-server-v2 <id> Activate an MCP server (V2)\n degrade-server-v2 <id> Degrade an MCP server (V2)\n retire-server-v2 <id> Retire an MCP server (V2)\n touch-server-v2 <id> Touch an MCP server (V2)\n get-server-v2 <id> Get an MCP server (V2)\n list-servers-v2 List MCP servers (V2)\n create-invocation-v2 <id> <serverId> <tool> Create an MCP invocation (V2)\n dispatch-invocation-v2 <id> Dispatch an MCP invocation (V2)\n complete-invocation-v2 <id> Complete an MCP invocation (V2)\n fail-invocation-v2 <id> [reason] Fail an MCP invocation (V2)\n cancel-invocation-v2 <id> [reason] Cancel an MCP invocation (V2)\n get-invocation-v2 <id> Get an MCP invocation (V2)\n list-invocations-v2 List MCP invocations (V2)\n auto-degrade-idle-servers-v2 Auto-degrade idle MCP servers (V2)\n auto-fail-stuck-invocations-v2 Auto-fail stuck MCP invocations (V2)\n set-max-active-servers-v2 <n> Set max active servers per owner (V2)\n set-max-pending-invocations-v2 <n> Set max pending invocations per server (V2)\n set-server-idle-ms-v2 <n> Set MCP server idle timeout in ms (V2)\n set-invocation-stuck-ms-v2 <n> Set MCP invocation stuck timeout in ms (V2)\n reset-state-v2 Reset MCP registry V2 in-memory state\n help [command] display help for command\n",
|
|
92
92
|
"mcpscaf": "Usage: chainlesschain mcpscaf [options] [command]\n\nMCP Scaffold V2 governance\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n config-v2\n set-max-active-v2 <n>\n set-max-pending-v2 <n>\n set-idle-ms-v2 <n>\n set-stuck-ms-v2 <n>\n register-profile-v2 [options] <id> <owner>\n activate-profile-v2 <id>\n stale-profile-v2 <id>\n archive-profile-v2 <id>\n touch-profile-v2 <id>\n get-profile-v2 <id>\n list-profiles-v2\n create-generation-v2 [options] <id> <profileId>\n generating-generation-v2 <id>\n generate-generation-v2 <id>\n fail-generation-v2 <id> [reason]\n cancel-generation-v2 <id> [reason]\n get-generation-v2 <id>\n list-generations-v2\n auto-stale-idle-v2\n auto-fail-stuck-v2\n gov-stats-v2\n reset-state-v2\n help [command] display help for command\n",
|
|
93
93
|
"meminj": "Usage: chainlesschain meminj [options] [command]\n\nMemory Injection V2 governance\n\nOptions:\n -h, --help display help for command\n\nCommands:\n enums-v2\n config-v2\n set-max-active-v2 <n>\n set-max-pending-v2 <n>\n set-idle-ms-v2 <n>\n set-stuck-ms-v2 <n>\n register-rule-v2 [options] <id> <owner>\n activate-rule-v2 <id>\n pause-rule-v2 <id>\n archive-rule-v2 <id>\n touch-rule-v2 <id>\n get-rule-v2 <id>\n list-rules-v2\n create-injection-v2 [options] <id> <ruleId>\n injecting-injection-v2 <id>\n apply-injection-v2 <id>\n fail-injection-v2 <id> [reason]\n cancel-injection-v2 <id> [reason]\n get-injection-v2 <id>\n list-injections-v2\n auto-pause-idle-v2\n auto-fail-stuck-v2\n gov-stats-v2\n reset-state-v2\n help [command] display help for command\n",
|
|
94
|
-
"memory": "Usage: chainlesschain memory [options] [command]\n\nPersistent memory and daily notes\n\nOptions:\n -h, --help display help for command\n\nCommands:\n files [options] List the project-memory files cc agent\n auto-loads here (cc.md hierarchy +\n imports + path-scoped rules)\n show [options] Show memory entries\n export [options] Export all memory entries as JSON (module\n 101 §8.3 backup)\n import [options] Import memory entries from a JSON array\n file (idempotent upsert by id; §8.3)\n add [options] <text> Add a memory entry\n search [options] <query> Search memory entries\n delete <id> Delete a memory entry\n reconcile [options] <operation-id> Resume a pending canonical memory\n deletion\n daily [options] [date] View or append to daily notes\n recall [options] [query] Recall scoped memory (session-core\n MemoryStore)\n store [options] <content> Write a scoped memory (session-core\n MemoryStore)\n consolidate [options] Consolidate a session's trace into scoped\n memory\n file [options] View or edit the long-term MEMORY.md file\n entry-maturities-v2 List V2 entry maturity states\n consolidation-lifecycles-v2 List V2 consolidation job lifecycle\n states\n stats-v2 Show V2 governance stats\n get-max-active-entries-v2 Get max active entries per category\n set-max-active-entries-v2 <n> Set max active entries per category\n get-max-running-jobs-v2 Get max running jobs per source\n set-max-running-jobs-v2 <n> Set max running jobs per source\n get-entry-idle-ms-v2 Get entry idle threshold (ms)\n set-entry-idle-ms-v2 <n> Set entry idle threshold (ms)\n get-job-stuck-ms-v2 Get job stuck threshold (ms)\n set-job-stuck-ms-v2 <n> Set job stuck threshold (ms)\n active-entry-count-v2 <category> Count active entries for a category\n running-job-count-v2 <source> Count running jobs for a source\n register-entry-v2 [options] <id> Register a V2 entry\n get-entry-v2 <id> Get a V2 entry\n list-entries-v2 [options] List V2 entries\n activate-entry-v2 <id> pending|parked → active\n park-entry-v2 <id> active → parked\n archive-entry-v2 <id> → archived (terminal)\n touch-entry-v2 <id> Update lastSeenAt\n create-job-v2 [options] <id> Create a V2 consolidation job\n get-job-v2 <id> Get a V2 consolidation job\n list-jobs-v2 [options] List V2 consolidation jobs\n start-job-v2 <id> queued → running\n succeed-job-v2 <id> running → succeeded (terminal)\n fail-job-v2 <id> running → failed (terminal)\n cancel-job-v2 <id> queued|running → cancelled (terminal)\n auto-park-idle-entries-v2 Flip idle active entries → parked\n auto-fail-stuck-jobs-v2 Flip stuck running jobs → failed\n help [command] display help for command\n",
|
|
94
|
+
"memory": "Usage: chainlesschain memory [options] [command]\n\nPersistent memory and daily notes\n\nOptions:\n -h, --help display help for command\n\nCommands:\n files [options] List the project-memory files cc agent\n auto-loads here (cc.md hierarchy +\n imports + path-scoped rules)\n show [options] Show memory entries\n export [options] Export all memory entries as JSON (module\n 101 §8.3 backup)\n import [options] Import memory entries from a JSON array\n file (idempotent upsert by id; §8.3)\n add [options] <text> Add a memory entry\n inspect [options] <id> Read one canonical memory's current\n content, revision and digest\n correct [options] <id> <text> Replace one canonical memory's content at\n the inspected revision\n search [options] <query> Search memory entries\n delete <id> Delete a memory entry\n reconcile [options] <operation-id> Resume a pending canonical memory\n deletion\n daily [options] [date] View or append to daily notes\n recall [options] [query] Recall scoped memory (session-core\n MemoryStore)\n store [options] <content> Write a scoped memory (session-core\n MemoryStore)\n consolidate [options] Consolidate a session's trace into scoped\n memory\n file [options] View or edit the long-term MEMORY.md file\n entry-maturities-v2 List V2 entry maturity states\n consolidation-lifecycles-v2 List V2 consolidation job lifecycle\n states\n stats-v2 Show V2 governance stats\n get-max-active-entries-v2 Get max active entries per category\n set-max-active-entries-v2 <n> Set max active entries per category\n get-max-running-jobs-v2 Get max running jobs per source\n set-max-running-jobs-v2 <n> Set max running jobs per source\n get-entry-idle-ms-v2 Get entry idle threshold (ms)\n set-entry-idle-ms-v2 <n> Set entry idle threshold (ms)\n get-job-stuck-ms-v2 Get job stuck threshold (ms)\n set-job-stuck-ms-v2 <n> Set job stuck threshold (ms)\n active-entry-count-v2 <category> Count active entries for a category\n running-job-count-v2 <source> Count running jobs for a source\n register-entry-v2 [options] <id> Register a V2 entry\n get-entry-v2 <id> Get a V2 entry\n list-entries-v2 [options] List V2 entries\n activate-entry-v2 <id> pending|parked → active\n park-entry-v2 <id> active → parked\n archive-entry-v2 <id> → archived (terminal)\n touch-entry-v2 <id> Update lastSeenAt\n create-job-v2 [options] <id> Create a V2 consolidation job\n get-job-v2 <id> Get a V2 consolidation job\n list-jobs-v2 [options] List V2 consolidation jobs\n start-job-v2 <id> queued → running\n succeed-job-v2 <id> running → succeeded (terminal)\n fail-job-v2 <id> running → failed (terminal)\n cancel-job-v2 <id> queued|running → cancelled (terminal)\n auto-park-idle-entries-v2 Flip idle active entries → parked\n auto-fail-stuck-jobs-v2 Flip stuck running jobs → failed\n help [command] display help for command\n",
|
|
95
95
|
"mtc": "Usage: chainlesschain mtc [options] [command]\n\nMerkle Tree Certificates — batch issuance & verification\n\nOptions:\n -h, --help display help for command\n\nCommands:\n batch [options] <input> Build a tree + landmark + envelopes from a list of leaves\n verify [options] <envelope> Verify an MTC envelope against a landmark\n landmark Landmark utilities\n batch-dids [options] Build a batch from DIDs in the local DB (all by default)\n batch-skills [options] Build a batch from local CLI skills (all by default)\n publish-skills [options] Marketplace publisher daemon: detect skill deltas + auto-close batches\n publish-status [options] <state-file> Read a publish-skills state file and print its current state + recent history\n serve [options] Run a verifier daemon: subscribe to landmarks, persist to disk, ingest\n federation Phase 3 federation MTCA — manage M-of-N member registry\n help [command] display help for command\n",
|
|
96
96
|
"multimodal": "Usage: chainlesschain multimodal|mm [options] [command]\n\nMultimodal collaboration (Phase 27)\n\nOptions:\n -h, --help display help for command\n\nCommands:\n modalities [options] List 5 input modalities with weights\n input-formats [options] List 7 supported document formats (4 native)\n output-formats [options] List 6 output formats\n statuses [options] List session statuses\n session-create [options] Create a multimodal session\n session-show [options] <sessionId> Show session details\n sessions [options] List sessions\n session-complete [options] <sessionId> Mark session as completed\n session-delete [options] <sessionId> Delete session and all artifacts\n add [options] <sessionId> Add a modality input to a session\n modalities-of [options] <sessionId> List modalities added to a session\n fuse [options] <sessionId> Weighted fusion of all input artifacts\n parse [options] <filePath> Parse a document (txt/md/csv/json native)\n build-context [options] <sessionId> Build context from session artifacts\n get-context [options] <sessionId> Get cached/stored context\n clear-context [options] <sessionId> Clear the session's context\n trim-context [options] <sessionId> Trim current context to max tokens\n generate [options] Generate output in one of 6 formats\n artifacts [options] <sessionId> List artifacts for a session\n stats [options] Multimodal system statistics\n session-maturities-v2 [options] List V2 session maturity states\n artifact-lifecycles-v2 [options] List V2 artifact lifecycle states\n default-max-active-sessions-per-owner Show V2 default per-owner active-session cap\n max-active-sessions-per-owner Show current V2 per-owner active-session cap\n set-max-active-sessions-per-owner <n> Set V2 per-owner active-session cap\n default-max-artifacts-per-session Show V2 default per-session artifact cap\n max-artifacts-per-session Show current V2 per-session artifact cap\n set-max-artifacts-per-session <n> Set V2 per-session artifact cap\n default-session-idle-ms Show V2 default session-idle window (ms)\n session-idle-ms Show current V2 session-idle window (ms)\n set-session-idle-ms <ms> Set V2 session-idle window (ms)\n default-artifact-stale-ms Show V2 default artifact-stale window (ms)\n artifact-stale-ms Show current V2 artifact-stale window (ms)\n set-artifact-stale-ms <ms> Set V2 artifact-stale window (ms)\n active-session-count [options] Count active V2 sessions (optionally scoped by owner)\n artifact-count [options] Count open V2 artifacts (optionally scoped by session)\n register-session-v2 [options] <session-id> Register a V2 session\n session-v2 <session-id> Show a V2 session\n set-session-maturity-v2 [options] <session-id> <status> Set V2 session maturity status\n activate-session [options] <session-id> Activate a V2 session\n pause-session [options] <session-id> Pause a V2 session\n complete-session-v2 [options] <session-id> Complete a V2 session\n archive-session [options] <session-id> Archive a V2 session\n touch-session-activity <session-id> Bump lastActivityAt on a V2 session\n register-artifact-v2 [options] <artifact-id> Register a V2 artifact\n artifact-v2 <artifact-id> Show a V2 artifact\n set-artifact-status-v2 [options] <artifact-id> <status> Set V2 artifact lifecycle status\n mark-artifact-ready [options] <artifact-id> Mark V2 artifact ready\n purge-artifact [options] <artifact-id> Purge a V2 artifact\n touch-artifact-access <artifact-id> Bump lastAccessAt on a V2 artifact\n auto-archive-idle-sessions Auto-flip idle V2 sessions to ARCHIVED\n auto-purge-stale-artifacts Auto-flip stale READY V2 artifacts to PURGED\n stats-v2 V2 multimodal stats (counts by state + config)\n help [command] display help for command\n",
|
|
97
97
|
"multisig": "Usage: chainlesschain multisig [options] [command]\n\nM-of-N multi-signature proposals beyond MTC publisher_signature\n\nOptions:\n -h, --help display help for command\n\nCommands:\n propose [options] <domain> Create a new M-of-N proposal and sign as\n initiator\n sign [options] <proposalId> Add a signature to an existing pending\n proposal\n cancel [options] <proposalId> Cancel a pending or reached proposal\n finalize [options] <proposalId> Mark a reached proposal as consumed\n (business operation complete)\n list [options] List proposals\n show [options] <proposalId> Show detailed proposal with all signatures\n sweep [options] Expire all pending proposals past their\n deadline\n policy Manage per-domain multisig policies\n help [command] display help for command\n",
|
package/src/commands/agent.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import fs from "node:fs";
|
|
11
11
|
import { randomUUID } from "node:crypto";
|
|
12
|
+
import { InvalidArgumentError } from "commander";
|
|
12
13
|
import { createAgentRuntimeFactory } from "../runtime/runtime-factory.js";
|
|
13
14
|
import {
|
|
14
15
|
captureAgentEvolutionRuntimeComposition,
|
|
@@ -25,7 +26,10 @@ import {
|
|
|
25
26
|
import { resolveImages, resolveVisionLlm } from "../lib/image-input.js";
|
|
26
27
|
import { resolveLlmConnection } from "../lib/llm-connection-resolution.js";
|
|
27
28
|
import { loadConfig } from "../lib/config-manager.js";
|
|
28
|
-
import {
|
|
29
|
+
import {
|
|
30
|
+
resolveAgentOutputBudget,
|
|
31
|
+
resolveModelCapabilityProfile,
|
|
32
|
+
} from "../lib/model-capabilities.js";
|
|
29
33
|
import { captureUnattendedActionPolicy } from "../lib/unattended-action-policy.js";
|
|
30
34
|
import {
|
|
31
35
|
assertSandboxCapabilities,
|
|
@@ -317,6 +321,18 @@ export function registerAgentCommand(program, dependencies = {}) {
|
|
|
317
321
|
contextMemoryModelWindowTokens: value,
|
|
318
322
|
}).contextWindowTokens,
|
|
319
323
|
)
|
|
324
|
+
.option(
|
|
325
|
+
"--max-output-tokens <tokens>",
|
|
326
|
+
"Maximum provider output tokens per agent-loop request (positive safe integer)",
|
|
327
|
+
(value) => {
|
|
328
|
+
try {
|
|
329
|
+
return resolveAgentOutputBudget({ maxOutputTokens: value })
|
|
330
|
+
.requestMaxOutputTokens;
|
|
331
|
+
} catch {
|
|
332
|
+
throw new InvalidArgumentError("expected a positive safe integer");
|
|
333
|
+
}
|
|
334
|
+
},
|
|
335
|
+
)
|
|
320
336
|
.option(
|
|
321
337
|
"--provider <provider>",
|
|
322
338
|
"LLM provider (ollama, openai, volcengine, deepseek, ...)",
|
|
@@ -1698,6 +1714,7 @@ export function registerAgentCommand(program, dependencies = {}) {
|
|
|
1698
1714
|
contextMemoryModelWindowTokens: options.contextWindow,
|
|
1699
1715
|
thinking,
|
|
1700
1716
|
thinkingBudget,
|
|
1717
|
+
maxOutputTokens: options.maxOutputTokens,
|
|
1701
1718
|
provider: options.provider,
|
|
1702
1719
|
baseUrl: options.baseUrl,
|
|
1703
1720
|
apiKey: options.apiKey,
|
|
@@ -2008,6 +2025,7 @@ export function registerAgentCommand(program, dependencies = {}) {
|
|
|
2008
2025
|
visionModel: options.visionModel,
|
|
2009
2026
|
thinking,
|
|
2010
2027
|
thinkingBudget,
|
|
2028
|
+
maxOutputTokens: options.maxOutputTokens,
|
|
2011
2029
|
provider: visionLlm.provider || options.provider,
|
|
2012
2030
|
baseUrl: visionLlm.baseUrl || options.baseUrl,
|
|
2013
2031
|
apiKey: visionLlm.apiKey || options.apiKey,
|
|
@@ -2279,6 +2297,7 @@ export function registerAgentCommand(program, dependencies = {}) {
|
|
|
2279
2297
|
visionModel: options.visionModel,
|
|
2280
2298
|
thinking,
|
|
2281
2299
|
thinkingBudget,
|
|
2300
|
+
maxOutputTokens: options.maxOutputTokens,
|
|
2282
2301
|
provider: options.provider,
|
|
2283
2302
|
baseUrl: options.baseUrl,
|
|
2284
2303
|
apiKey: options.apiKey,
|
|
@@ -34,7 +34,12 @@ function emit(value, json) {
|
|
|
34
34
|
? "result_saved"
|
|
35
35
|
: record.remoteStatus || record.phase) +
|
|
36
36
|
(record.resultSaved ? " result saved" : "") +
|
|
37
|
-
(record.outcomeUnknown ? " outcome unknown" : "")
|
|
37
|
+
(record.outcomeUnknown ? " outcome unknown" : "") +
|
|
38
|
+
(record.continuationOutcomeUnknown
|
|
39
|
+
? " continuation outcome unknown"
|
|
40
|
+
: record.continuationStatus === "settled"
|
|
41
|
+
? " continuation saved"
|
|
42
|
+
: ""),
|
|
38
43
|
);
|
|
39
44
|
}
|
|
40
45
|
} else if (value.delivered === true) {
|
|
@@ -136,7 +141,23 @@ export function registerMcpTaskCommands(
|
|
|
136
141
|
const result =
|
|
137
142
|
operation === "create"
|
|
138
143
|
? await runtime.create(serverName, item, args, { ttl })
|
|
139
|
-
:
|
|
144
|
+
: operation === "watch"
|
|
145
|
+
? await runtime.watch(item, {
|
|
146
|
+
intervalMs: numericOption(options.interval, {
|
|
147
|
+
name: "--interval",
|
|
148
|
+
integer: true,
|
|
149
|
+
min: 0,
|
|
150
|
+
max: 60_000,
|
|
151
|
+
}),
|
|
152
|
+
timeoutMs: numericOption(options.timeout, {
|
|
153
|
+
name: "--timeout",
|
|
154
|
+
integer: true,
|
|
155
|
+
min: 1,
|
|
156
|
+
max: 24 * 60 * 60 * 1000,
|
|
157
|
+
}),
|
|
158
|
+
deliver: options.deliver !== false,
|
|
159
|
+
})
|
|
160
|
+
: await runtime[operation](item);
|
|
140
161
|
emit(result, options.json);
|
|
141
162
|
} catch (error) {
|
|
142
163
|
process.exitCode = 1;
|
|
@@ -186,7 +207,7 @@ export function registerMcpTaskCommands(
|
|
|
186
207
|
.option("--ttl <ms>", "Requested task lifetime in milliseconds")
|
|
187
208
|
.option("--json", "Output as JSON")
|
|
188
209
|
.action(action("create"));
|
|
189
|
-
for (const operation of ["poll", "result", "deliver", "cancel"]) {
|
|
210
|
+
for (const operation of ["poll", "result", "deliver", "cancel", "watch"]) {
|
|
190
211
|
tasks
|
|
191
212
|
.command(operation + " <local-id>")
|
|
192
213
|
.description(
|
|
@@ -196,9 +217,21 @@ export function registerMcpTaskCommands(
|
|
|
196
217
|
? "Retrieve and save a result, or read its saved copy"
|
|
197
218
|
: operation === "deliver"
|
|
198
219
|
? "Deliver a saved result once to its session as external reference data"
|
|
199
|
-
:
|
|
220
|
+
: operation === "watch"
|
|
221
|
+
? "Poll a remote task until its result is saved, then deliver once"
|
|
222
|
+
: "Request cancellation; remote side effects may already have occurred",
|
|
200
223
|
)
|
|
201
224
|
.requiredOption("--session <id>", "Owning canonical session")
|
|
225
|
+
.option("--interval <ms>", "Polling interval in milliseconds")
|
|
226
|
+
.option(
|
|
227
|
+
"--timeout <ms>",
|
|
228
|
+
"Maximum watch duration in milliseconds",
|
|
229
|
+
String(15 * 60 * 1000),
|
|
230
|
+
)
|
|
231
|
+
.option(
|
|
232
|
+
"--no-deliver",
|
|
233
|
+
"Save the result without appending a delivery event",
|
|
234
|
+
)
|
|
202
235
|
.option("--json", "Output as JSON")
|
|
203
236
|
.action(action(operation));
|
|
204
237
|
}
|
package/src/commands/mcp.js
CHANGED
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
MCP_CONFIG_SCOPES,
|
|
18
18
|
inferTransport,
|
|
19
19
|
normalizeMcpConfigScope,
|
|
20
|
+
mcpProtocolVersionField,
|
|
20
21
|
} from "../harness/mcp-client.js";
|
|
21
22
|
import {
|
|
22
23
|
validateMcpServer,
|
|
@@ -418,6 +419,7 @@ export function managedMcpRowsFromSettings(settings, file) {
|
|
|
418
419
|
...(sandboxPolicy ? { sandboxPolicy } : {}),
|
|
419
420
|
url: config.url || null,
|
|
420
421
|
transport: inferTransport(config),
|
|
422
|
+
...mcpProtocolVersionField(config),
|
|
421
423
|
headers:
|
|
422
424
|
config.headers && typeof config.headers === "object"
|
|
423
425
|
? config.headers
|
|
@@ -504,6 +506,7 @@ export function readProjectMcpRows(cwd = process.cwd()) {
|
|
|
504
506
|
...(sandboxPolicy ? { sandboxPolicy } : {}),
|
|
505
507
|
url: config.url || null,
|
|
506
508
|
transport: inferTransport(config),
|
|
509
|
+
...mcpProtocolVersionField(config),
|
|
507
510
|
headers:
|
|
508
511
|
config.headers && typeof config.headers === "object"
|
|
509
512
|
? config.headers
|
|
@@ -585,6 +588,16 @@ export function writeProjectMcpServer(name, server, cwd = process.cwd()) {
|
|
|
585
588
|
if (retainedPolicy.policy) config.sandboxPolicy = retainedPolicy.policy;
|
|
586
589
|
if (server.url) config.url = server.url;
|
|
587
590
|
if (server.transport) config.transport = server.transport;
|
|
591
|
+
Object.assign(
|
|
592
|
+
config,
|
|
593
|
+
mcpProtocolVersionField({
|
|
594
|
+
...server,
|
|
595
|
+
protocolVersion:
|
|
596
|
+
server.protocolVersion === undefined
|
|
597
|
+
? existing?.protocolVersion
|
|
598
|
+
: server.protocolVersion,
|
|
599
|
+
}),
|
|
600
|
+
);
|
|
588
601
|
if (server.headers && Object.keys(server.headers).length > 0) {
|
|
589
602
|
config.headers = server.headers;
|
|
590
603
|
}
|
|
@@ -1237,6 +1250,10 @@ export function registerMcpCommand(program) {
|
|
|
1237
1250
|
"--headers-helper <command>",
|
|
1238
1251
|
"Shell command that prints fresh HTTP headers as one JSON object",
|
|
1239
1252
|
)
|
|
1253
|
+
.option(
|
|
1254
|
+
"--protocol-version <version>",
|
|
1255
|
+
"Explicit MCP protocol revision (2026-07-28 requires HTTP(S))",
|
|
1256
|
+
)
|
|
1240
1257
|
.option("--auto-connect", "Auto-connect on startup")
|
|
1241
1258
|
.option(
|
|
1242
1259
|
"--mode <mode>",
|
|
@@ -1384,6 +1401,13 @@ export function registerMcpCommand(program) {
|
|
|
1384
1401
|
url: options.url || null,
|
|
1385
1402
|
transport,
|
|
1386
1403
|
env: {},
|
|
1404
|
+
...(options.protocolVersion === undefined
|
|
1405
|
+
? {}
|
|
1406
|
+
: mcpProtocolVersionField({
|
|
1407
|
+
transport,
|
|
1408
|
+
url: options.url,
|
|
1409
|
+
protocolVersion: options.protocolVersion,
|
|
1410
|
+
})),
|
|
1387
1411
|
autoConnect: !!options.autoConnect,
|
|
1388
1412
|
headers: Object.keys(headers).length > 0 ? headers : undefined,
|
|
1389
1413
|
...headersHelperField(options.headersHelper),
|