@margay/ccl-core 1.4.1-beta-duo.0 → 1.4.5-rc.10
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/QUICKSTART.md +82 -39
- package/README.md +99 -42
- package/dist/cli.js +357543 -349800
- package/dist/sdk/errorDiagnostics.d.ts +90 -0
- package/dist/sdk/errorDiagnostics.js +156 -4
- package/dist/sdk/index.d.ts +2 -0
- package/dist/sdk/query.d.ts +0 -27
- package/dist/sdk/query.js +46 -2
- package/dist/sdk/requestProgress.d.ts +14 -0
- package/dist/sdk/requestProgress.js +26 -0
- package/dist/sdk/types.d.ts +32 -1
- package/docs/agent-owned-error-recovery-ux-2026-10-04.md +146 -0
- package/docs/analytics-capabilities-2026-10-08.md +223 -0
- package/docs/ccl-duo-agent.md +141 -0
- package/docs/ccl-ide-usage.md +75 -0
- package/docs/cli-installation.md +86 -0
- package/docs/dev-quickstart.md +105 -0
- package/docs/error-recovery-usage.md +220 -0
- package/docs/features/business-facts.md +115 -0
- package/docs/features/copy-on-select.md +36 -0
- package/docs/gateway-quickstart.md +260 -0
- package/docs/index.md +105 -0
- package/docs/local-analytics-quickstart.md +96 -0
- package/docs/operations-client-integration.md +102 -0
- package/docs/peer-development-review.md +60 -0
- package/docs/releases/1.4.5-rc.1.md +39 -0
- package/docs/releases/1.4.5-rc.10.md +50 -0
- package/docs/releases/1.4.5-rc.2.md +26 -0
- package/docs/releases/1.4.5-rc.3.md +9 -0
- package/docs/releases/1.4.5-rc.6.md +11 -0
- package/docs/releases/1.4.5-rc.7.md +14 -0
- package/docs/releases/1.4.5-rc.8.md +18 -0
- package/docs/releases/1.4.5-rc.9.md +22 -0
- package/docs/self-hosted-product-events.md +86 -0
- package/examples/operations/README.md +58 -0
- package/examples/operations/minimal_client.py +195 -0
- package/examples/operations/test_minimal_client.py +102 -0
- package/package.json +33 -4
- package/sdk/API.md +402 -0
- package/sdk/README.md +185 -0
package/QUICKSTART.md
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
# CCL Quick Start
|
|
2
2
|
|
|
3
3
|
This guide gets a new user from install to first useful session with CCL
|
|
4
|
-
|
|
4
|
+
from an npm package or source checkout. For the full feature map, see [README.md](./README.md) and
|
|
5
5
|
[docs/index.md](./docs/index.md).
|
|
6
6
|
|
|
7
7
|
## 1. Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install -g @margay/ccl-core
|
|
11
|
-
|
|
12
|
-
#
|
|
11
|
+
margay --version
|
|
12
|
+
# Prints the installed version; npm uses the published default tag.
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
Starting with `1.4.5-rc.10`, the package registers both `ccl` and `margay` for the
|
|
16
|
+
same CLI. The `1.4.5-rc.9` package registers only `margay`.
|
|
17
|
+
See [CLI installation and upgrades](docs/cli-installation.md) for local
|
|
18
|
+
versus global installation and migration of older launchers.
|
|
19
|
+
|
|
15
20
|
From a source checkout:
|
|
16
21
|
|
|
17
22
|
```bash
|
|
@@ -20,39 +25,69 @@ npm run build
|
|
|
20
25
|
node dist/cli.js --version
|
|
21
26
|
```
|
|
22
27
|
|
|
28
|
+
## Local analytics on the upgraded workstation
|
|
29
|
+
|
|
30
|
+
Use `margay analytics status` to inspect collection and `margay analytics gate status` to inspect the analysis feature. Collection starts disabled and requires an authorized local website account to upload; installing this build does not change your login or connect production events. See [viewing events and controlling switches](docs/local-analytics-quickstart.md).
|
|
31
|
+
|
|
23
32
|
## 2. Choose Authentication
|
|
24
33
|
|
|
25
34
|
Use one of these paths.
|
|
26
35
|
|
|
27
|
-
### Margay
|
|
36
|
+
### Margay website account (current source checkout)
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
|
|
38
|
+
The website-account flow is implemented in this checkout and has passed local
|
|
39
|
+
client tests. Live website authorization and commercial readiness are still
|
|
40
|
+
unverified; installing a published package does not establish that it includes
|
|
41
|
+
these changes. Build the checkout as shown above, then run:
|
|
31
42
|
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
/
|
|
43
|
+
```bash
|
|
44
|
+
node dist/cli.js login
|
|
45
|
+
node dist/cli.js account status
|
|
35
46
|
```
|
|
36
47
|
|
|
37
|
-
|
|
48
|
+
Complete login or registration at `https://margay-ai.com`, approve CLI access,
|
|
49
|
+
and wait for the terminal to confirm sign-in. Existing Margay users should use
|
|
50
|
+
the same website login method. No separate CLI password is created.
|
|
51
|
+
|
|
52
|
+
Inside the interactive CLI, `/gateway login` or `/gateway register` without
|
|
53
|
+
arguments opens the same website flow. `/gateway status` shows the saved
|
|
54
|
+
account's verified membership and balance. `/gateway logout` signs out locally.
|
|
55
|
+
The first-launch account step supports Enter to sign in and S/Esc to set up
|
|
56
|
+
later; Esc cancels an in-progress TUI login. `/login` remains Claude OAuth.
|
|
57
|
+
|
|
58
|
+
Website credentials use the system credential store; `gateway.json` contains
|
|
59
|
+
an account reference and metadata. Store access failure stops login without
|
|
60
|
+
falling back to plaintext. To change the website account, use
|
|
61
|
+
`node dist/cli.js login --force`; cancellation or failure preserves the old
|
|
62
|
+
saved session. To sign out from a shell, use `node dist/cli.js logout`.
|
|
63
|
+
|
|
64
|
+
### Manual gateway credentials / invite codes
|
|
65
|
+
|
|
66
|
+
These existing TUI paths remain available:
|
|
38
67
|
|
|
39
68
|
```text
|
|
40
|
-
|
|
69
|
+
margay
|
|
41
70
|
/gateway login <GATEWAY_URL> <GATEWAY_TOKEN>
|
|
71
|
+
/gateway register <GATEWAY_URL> <INVITE_CODE> [username] [email] [phone]
|
|
72
|
+
/gateway register --invite <INVITE_CODE>
|
|
42
73
|
/gateway doctor
|
|
43
|
-
/gateway status
|
|
44
74
|
```
|
|
45
75
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
76
|
+
Manual credentials use the legacy configuration storage and do not acquire the
|
|
77
|
+
website flow's system-store guarantee. If a website account is already saved,
|
|
78
|
+
run `/gateway logout` before replacing it with manual credentials.
|
|
79
|
+
|
|
80
|
+
Explicit `CCL_GATEWAY_*` environment credentials may override the saved website
|
|
81
|
+
account for model requests. Inspect `/gateway doctor` and clear an obsolete
|
|
82
|
+
complete tuple in the launching shell; website logout does not remove an
|
|
83
|
+
explicit environment override. See the
|
|
84
|
+
[account and gateway guide](./docs/gateway-quickstart.md) for defaults,
|
|
85
|
+
status meanings, storage prerequisites, and troubleshooting.
|
|
51
86
|
|
|
52
87
|
### Claude OAuth
|
|
53
88
|
|
|
54
89
|
```text
|
|
55
|
-
|
|
90
|
+
margay
|
|
56
91
|
/login
|
|
57
92
|
```
|
|
58
93
|
|
|
@@ -62,7 +97,7 @@ The first interactive launch can also guide you through OAuth login.
|
|
|
62
97
|
|
|
63
98
|
```bash
|
|
64
99
|
export ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY>
|
|
65
|
-
|
|
100
|
+
margay --model sonnet
|
|
66
101
|
```
|
|
67
102
|
|
|
68
103
|
Do not paste real keys into docs, shell history examples, bug reports, or shared
|
|
@@ -73,23 +108,23 @@ screenshots.
|
|
|
73
108
|
Interactive:
|
|
74
109
|
|
|
75
110
|
```bash
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
111
|
+
margay
|
|
112
|
+
margay --model deepseek-v4-pro
|
|
113
|
+
margay --cwd /path/to/project
|
|
79
114
|
```
|
|
80
115
|
|
|
81
116
|
One-shot:
|
|
82
117
|
|
|
83
118
|
```bash
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
119
|
+
margay -p "explain this error" < error.log
|
|
120
|
+
margay -p "summarize the current repository" --max-turns 20
|
|
121
|
+
margay -p "return JSON" --output-format json
|
|
87
122
|
```
|
|
88
123
|
|
|
89
124
|
Streaming automation:
|
|
90
125
|
|
|
91
126
|
```bash
|
|
92
|
-
|
|
127
|
+
margay -p "run a compact audit" --output-format stream-json --verbose
|
|
93
128
|
```
|
|
94
129
|
|
|
95
130
|
## 4. Useful First Slash Commands
|
|
@@ -118,13 +153,13 @@ Run slash commands inside the interactive TUI.
|
|
|
118
153
|
## 5. Common CLI Options
|
|
119
154
|
|
|
120
155
|
```bash
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
156
|
+
margay --help
|
|
157
|
+
margay -p "task" --model sonnet --effort high
|
|
158
|
+
margay -p "task" --allowedTools "Bash(git:*) Edit"
|
|
159
|
+
margay -p "task" --disallowedTools "Bash(rm:*)"
|
|
160
|
+
margay --bare -p "minimal startup task"
|
|
161
|
+
margay --resume <SESSION_ID>
|
|
162
|
+
margay --continue
|
|
128
163
|
```
|
|
129
164
|
|
|
130
165
|
Important safety options:
|
|
@@ -139,10 +174,10 @@ Important safety options:
|
|
|
139
174
|
## 6. Workflows
|
|
140
175
|
|
|
141
176
|
```bash
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
177
|
+
margay workflow validate <name-or-path>
|
|
178
|
+
margay workflow run <name-or-path> --json
|
|
179
|
+
margay workflow run <name-or-path> --dry-run
|
|
180
|
+
margay workflow generate "produce a release audit workflow"
|
|
146
181
|
```
|
|
147
182
|
|
|
148
183
|
Inside CCL:
|
|
@@ -177,10 +212,18 @@ embedding CCL in a host process.
|
|
|
177
212
|
|
|
178
213
|
## 8. Troubleshooting
|
|
179
214
|
|
|
215
|
+
For recovery prompts and SDK outcomes, see the
|
|
216
|
+
[recovery guide](./docs/error-recovery-usage.md). Short, low-risk repairs can
|
|
217
|
+
proceed within existing permissions. A recovery that needs your consent waits
|
|
218
|
+
for approval; declining or cancelling leaves that action unperformed. In
|
|
219
|
+
headless mode, `needs_user` means user intervention is needed before continuing.
|
|
220
|
+
|
|
180
221
|
| Symptom | Fix |
|
|
181
222
|
|---|---|
|
|
182
|
-
| Gateway login worked but a new shell uses the old gateway | Check
|
|
183
|
-
| No credentials found |
|
|
223
|
+
| Gateway login worked but a new shell uses the old gateway | Check and clear or update all four exported Gateway fields |
|
|
224
|
+
| No credentials found | Margay: `/gateway login`; Claude: `/login` or `ANTHROPIC_API_KEY` |
|
|
225
|
+
| Persistent network, authentication, or account-credit failure | Follow the reported `blocked_external` reason; restore access or credit, then continue after checking prior tool results |
|
|
226
|
+
| Output budget lower than configured | The observed gateway/model ceiling clamps output tokens; this is separate from account credit |
|
|
184
227
|
| Model unavailable | Use `/model` to inspect configured options or check the gateway model list |
|
|
185
228
|
| Automation loops too long | Set `--max-turns`, `--max-budget-usd`, or `CCL_PRINT_MAX_TURNS` |
|
|
186
229
|
| Tool calls need policy control | Use CLI allow/deny options or the SDK `canUseTool` callback |
|
package/README.md
CHANGED
|
@@ -5,17 +5,22 @@ interactive coding assistant by default, supports non-interactive scripting with
|
|
|
5
5
|
`--print`, and can run either direct Claude channels or Margay gateway routed
|
|
6
6
|
models from the same CLI surface.
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
The package version is recorded in `package.json`. Check the installed runtime
|
|
9
|
+
with `--version`; a source checkout and an installed npm package can differ.
|
|
9
10
|
|
|
10
11
|
This file is the public package entry point. The full authoritative
|
|
11
12
|
documentation index is [docs/index.md](./docs/index.md), and the fast path for
|
|
12
13
|
new users is [QUICKSTART.md](./QUICKSTART.md).
|
|
13
14
|
|
|
15
|
+
## Local analytics preview
|
|
16
|
+
|
|
17
|
+
The analytics commands support opt-in event upload, funnel/retention/path/experiment queries and local/remote control of `analytics.query`. See the [analytics user guide](docs/local-analytics-quickstart.md) for viewing events, switches, account prerequisites and troubleshooting, and the [event/query contract](docs/self-hosted-product-events.md) for supported data and limits.
|
|
18
|
+
|
|
14
19
|
## Requirements
|
|
15
20
|
|
|
16
21
|
- Node.js 20 or newer.
|
|
17
22
|
- At least one authentication path:
|
|
18
|
-
- Margay gateway token for gateway-routed models.
|
|
23
|
+
- Margay website account or gateway token for gateway-routed models.
|
|
19
24
|
- Claude OAuth for subscription-backed Claude use.
|
|
20
25
|
- Anthropic API key for direct API-key Claude use.
|
|
21
26
|
|
|
@@ -23,10 +28,15 @@ new users is [QUICKSTART.md](./QUICKSTART.md).
|
|
|
23
28
|
|
|
24
29
|
```bash
|
|
25
30
|
npm install -g @margay/ccl-core
|
|
26
|
-
|
|
27
|
-
#
|
|
31
|
+
margay --version
|
|
32
|
+
# Prints the installed version; npm uses the published default tag.
|
|
28
33
|
```
|
|
29
34
|
|
|
35
|
+
Starting with `1.4.5-rc.10`, the package registers both `ccl` and `margay` for the
|
|
36
|
+
same CLI. The `1.4.5-rc.9` package registers only `margay`.
|
|
37
|
+
For installation scope, dual-entry verification and old
|
|
38
|
+
launcher migration, see [CLI installation and upgrades](docs/cli-installation.md).
|
|
39
|
+
|
|
30
40
|
From a source checkout:
|
|
31
41
|
|
|
32
42
|
```bash
|
|
@@ -38,18 +48,18 @@ node dist/cli.js --version
|
|
|
38
48
|
## Start A Session
|
|
39
49
|
|
|
40
50
|
```bash
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
margay
|
|
52
|
+
margay "review the current git diff"
|
|
53
|
+
margay --model deepseek-v4-pro
|
|
54
|
+
margay --cwd /path/to/project
|
|
45
55
|
```
|
|
46
56
|
|
|
47
57
|
Use `--print` for scripts and pipelines:
|
|
48
58
|
|
|
49
59
|
```bash
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
60
|
+
margay -p "explain this stack trace" < error.log
|
|
61
|
+
margay -p "return JSON only" --output-format json
|
|
62
|
+
margay -p "stream events" --output-format stream-json --verbose
|
|
53
63
|
```
|
|
54
64
|
|
|
55
65
|
## Authentication
|
|
@@ -59,16 +69,23 @@ configuration.
|
|
|
59
69
|
|
|
60
70
|
| Channel | Use For | Setup |
|
|
61
71
|
|---|---|---|
|
|
62
|
-
| Margay
|
|
63
|
-
|
|
|
72
|
+
| Margay website account (current checkout) | Shared Margay identity and gateway-routed models | Build this checkout, then `node dist/cli.js login`, or use `/gateway login` in the TUI |
|
|
73
|
+
| Manual Margay gateway | Existing gateway tokens or invite codes | `/gateway login <url> <token>` or `/gateway register <url> <invite>` |
|
|
74
|
+
| Claude OAuth | Claude subscription sessions | Run `margay` and follow the login prompt, or use `/login` |
|
|
64
75
|
| Anthropic API key | Direct Anthropic API use | Set `ANTHROPIC_API_KEY=<key>` or pass `--api-key <key>` |
|
|
65
76
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
The website-account implementation is available in this source checkout; real
|
|
78
|
+
website authorization and commercial readiness remain unverified. No published
|
|
79
|
+
release is claimed here. It opens `https://margay-ai.com` for login/registration,
|
|
80
|
+
verifies the returned identity with the selected gateway, and stores credentials
|
|
81
|
+
in the system credential store. `~/.ccl/gateway.json` holds the website account's
|
|
82
|
+
reference and metadata, without its token. A locked/unavailable store fails
|
|
83
|
+
closed. An explicit config directory changes this file location.
|
|
84
|
+
|
|
85
|
+
The manual token/invite paths retain their existing configuration storage.
|
|
86
|
+
They verify a Gateway credential using `/auth/me` before saving it; do not
|
|
87
|
+
supply an upstream model-provider API key. A saved website account must be
|
|
88
|
+
logged out before replacement with a manual credential.
|
|
72
89
|
|
|
73
90
|
If a parent terminal explicitly exports a Gateway configuration, use all four
|
|
74
91
|
variables as one atomic set: `CCL_GATEWAY_URL`, `CCL_GATEWAY_KEY`,
|
|
@@ -81,6 +98,8 @@ quarantines untyped opaque or issuer-mismatched credentials before any request.
|
|
|
81
98
|
Run these inside an interactive CCL session:
|
|
82
99
|
|
|
83
100
|
```text
|
|
101
|
+
/gateway login
|
|
102
|
+
/gateway register
|
|
84
103
|
/gateway register <url> <invite_code> [username] [email] [phone]
|
|
85
104
|
/gateway login <url> <token>
|
|
86
105
|
/gateway status
|
|
@@ -88,15 +107,26 @@ Run these inside an interactive CCL session:
|
|
|
88
107
|
/gateway logout
|
|
89
108
|
```
|
|
90
109
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
110
|
+
With no arguments, `login` and `register` open website authorization. With a
|
|
111
|
+
URL/token or URL/invite, they use the existing manual flow. `/login` remains
|
|
112
|
+
Claude OAuth. Website sign-out removes the local account; it does not revoke
|
|
113
|
+
the website session or cancel a subscription. Explicit environment overrides
|
|
114
|
+
remain effective until removed from the launching shell.
|
|
115
|
+
|
|
116
|
+
Shell account commands in the current source build:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
node dist/cli.js login
|
|
120
|
+
node dist/cli.js account status
|
|
121
|
+
node dist/cli.js logout
|
|
122
|
+
```
|
|
94
123
|
|
|
95
|
-
|
|
124
|
+
For account switching, test endpoints, membership/credit status, and error
|
|
125
|
+
recovery, see [docs/gateway-quickstart.md](./docs/gateway-quickstart.md).
|
|
96
126
|
|
|
97
127
|
## CLI Surface
|
|
98
128
|
|
|
99
|
-
`
|
|
129
|
+
`margay --help` is the exact runtime source for command-line behavior. The current
|
|
100
130
|
top-level commands are:
|
|
101
131
|
|
|
102
132
|
| Command | Purpose |
|
|
@@ -162,13 +192,16 @@ defines these public command families:
|
|
|
162
192
|
|
|
163
193
|
Use `/help` in the TUI for command availability in the current build.
|
|
164
194
|
|
|
165
|
-
### Duo collaboration (
|
|
195
|
+
### Duo collaboration (reviewed local candidate)
|
|
166
196
|
|
|
167
|
-
Use `/duo-agent` (alias `/duo`) to enter standby, then
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
197
|
+
Use `/duo-agent` (alias `/duo`) to enter standby, then provide a task. The
|
|
198
|
+
reviewed candidate resolves Auto execution and critic roles to two distinct
|
|
199
|
+
concrete models. `/model` and `/duo --reviewer-model <fixed-model-id>` can
|
|
200
|
+
override a role. Completion requires actual requests from both models, a
|
|
201
|
+
current review and executor acceptance; accepted tasks return to standby for
|
|
202
|
+
the next task, and `/duo exit` releases input even if cleanup fails. See the
|
|
203
|
+
[Duo guide](docs/ccl-duo-agent.md). This candidate is not yet on npm `next`;
|
|
204
|
+
RC8/RC10/C790 release acceptance remains on HOLD.
|
|
172
205
|
|
|
173
206
|
### Lightweight peer development and review
|
|
174
207
|
|
|
@@ -183,7 +216,9 @@ messages. The reviewer tests an independent copy of each submission; only its
|
|
|
183
216
|
approval of the current content completes the protected task. Disagreements,
|
|
184
217
|
cancellation and exhausted limits remain unfinished. Both models are fixed for
|
|
185
218
|
the pair; automatic routing aliases are rejected. Ordinary `/buddy` and Team
|
|
186
|
-
usage remain available.
|
|
219
|
+
usage remain available. Ordinary `/buddy` first creates or reuses a Team, then
|
|
220
|
+
starts Agent with the team name actually returned by TeamCreate. Its prompt
|
|
221
|
+
alone does not prove the teammate started.
|
|
187
222
|
|
|
188
223
|
The current mode requires a Git working directory and runs in one CCL interface.
|
|
189
224
|
Copies isolate normal test output, not hostile same-user shell commands. See
|
|
@@ -207,8 +242,8 @@ Useful controls:
|
|
|
207
242
|
For one-off runs:
|
|
208
243
|
|
|
209
244
|
```bash
|
|
210
|
-
|
|
211
|
-
|
|
245
|
+
margay -p "summarize this diff" --model sonnet
|
|
246
|
+
margay -p "generate a migration plan" --model deepseek-v4-pro --effort high
|
|
212
247
|
```
|
|
213
248
|
|
|
214
249
|
Capability pools use explicit `cost-first ranking` and `quality-first ranking`
|
|
@@ -231,11 +266,11 @@ The `workflow` command and `/workflows` slash command run multi-step task
|
|
|
231
266
|
automation.
|
|
232
267
|
|
|
233
268
|
```bash
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
269
|
+
margay workflow run <name-or-path>
|
|
270
|
+
margay workflow run <name-or-path> --params '{"out":"report.md"}' --json
|
|
271
|
+
margay workflow run <name-or-path> --dry-run
|
|
272
|
+
margay workflow validate <name-or-path>
|
|
273
|
+
margay workflow generate "create a regression audit workflow"
|
|
239
274
|
```
|
|
240
275
|
|
|
241
276
|
Inside the TUI:
|
|
@@ -275,6 +310,25 @@ SDK references:
|
|
|
275
310
|
- [sdk/README.md](./sdk/README.md)
|
|
276
311
|
- [sdk/API.md](./sdk/API.md)
|
|
277
312
|
|
|
313
|
+
## Recovery And User Intervention
|
|
314
|
+
|
|
315
|
+
The agent is instructed to investigate and verify short, low-risk repairs within
|
|
316
|
+
its existing authority, then report the outcome. Long, uncertain, sensitive, or
|
|
317
|
+
experience-changing repairs require consent. Runtime recovery prompts offer
|
|
318
|
+
**Keep current settings** or **Approve this recovery**; cancellation does not
|
|
319
|
+
approve the action. Existing tool permissions still apply.
|
|
320
|
+
|
|
321
|
+
Persistent network, authentication, or account-credit failures stop with an
|
|
322
|
+
actionable request for help. Output-token limits are handled separately from
|
|
323
|
+
account credit: known gateway limits clamp requests, while recovery that raises
|
|
324
|
+
an output budget or disables reasoning requires consent.
|
|
325
|
+
|
|
326
|
+
In `--print` and SDK mode, runtime recovery proposals that require interaction
|
|
327
|
+
end with `recovery.status = needs_user`. External blockers use `blocked_external`.
|
|
328
|
+
A terminal result does not imply the task succeeded. See the
|
|
329
|
+
[recovery guide](./docs/error-recovery-usage.md) for user actions, fallback rules,
|
|
330
|
+
and the SDK distinction between recovery outcomes and pending tool approvals.
|
|
331
|
+
|
|
278
332
|
## Configuration And Environment
|
|
279
333
|
|
|
280
334
|
| Variable | Purpose |
|
|
@@ -282,6 +336,7 @@ SDK references:
|
|
|
282
336
|
| `CCL_GATEWAY_URL`, `CCL_GATEWAY_KEY` | Margay gateway URL and credential; prefer `/gateway login` over manual export |
|
|
283
337
|
| `CCL_GATEWAY_CREDENTIAL_TYPE`, `CCL_GATEWAY_ISSUER` | Credential admission metadata; required as an atomic pair for opaque environment credentials |
|
|
284
338
|
| `ANTHROPIC_API_KEY`, `ANTHROPIC_BASE_URL` | Direct Anthropic API-key channel |
|
|
339
|
+
| `CCL_MAX_OUTPUT_TOKENS` | Output budget; takes precedence over `CLAUDE_CODE_MAX_OUTPUT_TOKENS` and remains subject to model/gateway limits |
|
|
285
340
|
| `CCL_MODEL` | Default model |
|
|
286
341
|
| `CCL_ROUTING_PRIORITY` | Default routing preference, usually `cost` or `quality` |
|
|
287
342
|
| `CCL_PRINT_MAX_TURNS` | Default `--max-turns` for `--print` |
|
|
@@ -314,12 +369,12 @@ Config locations:
|
|
|
314
369
|
|
|
315
370
|
| Symptom | Check |
|
|
316
371
|
|---|---|
|
|
317
|
-
| `
|
|
372
|
+
| `margay` cannot authenticate | Run `/doctor`, `/gateway doctor`, or `/login` |
|
|
318
373
|
| Gateway status differs between shells | Check exported `CCL_GATEWAY_URL` and `CCL_GATEWAY_KEY` versus `~/.ccl/gateway.json` |
|
|
319
374
|
| A model name fails | Run `/model` or query the gateway's model list |
|
|
320
375
|
| `--print` runs too long | Set `--max-turns`, `--max-budget-usd`, or `CCL_PRINT_MAX_TURNS` |
|
|
321
376
|
| Tool permission prompts block automation | Use `--allowedTools`, `--disallowedTools`, `--permission-mode`, or the SDK `canUseTool` callback |
|
|
322
|
-
| MCP servers behave unexpectedly | Run `
|
|
377
|
+
| MCP servers behave unexpectedly | Run `margay doctor` from a trusted directory and inspect `--mcp-config` inputs |
|
|
323
378
|
|
|
324
379
|
## Source Of Truth
|
|
325
380
|
|
|
@@ -329,9 +384,11 @@ The current authoritative documentation set is:
|
|
|
329
384
|
- [QUICKSTART.md](./QUICKSTART.md): shortest working setup.
|
|
330
385
|
- [docs/index.md](./docs/index.md): official documentation information architecture.
|
|
331
386
|
- [docs/gateway-quickstart.md](./docs/gateway-quickstart.md): current gateway setup.
|
|
387
|
+
- [docs/error-recovery-usage.md](./docs/error-recovery-usage.md): recovery and user intervention.
|
|
388
|
+
- [docs/releases/1.4.5-rc.4.md](./docs/releases/1.4.5-rc.4.md): candidate delivery and validation boundaries.
|
|
332
389
|
- [sdk/README.md](./sdk/README.md) and [sdk/API.md](./sdk/API.md): SDK contract.
|
|
333
|
-
-
|
|
334
|
-
inventory
|
|
390
|
+
- `docs/official-docs-coverage-matrix.json` (source checkout only): historical
|
|
391
|
+
inventory snapshot; not certification of this candidate.
|
|
335
392
|
|
|
336
393
|
### Project instructions
|
|
337
394
|
|