@link-assistant/agent 0.27.0 → 0.27.1
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 +47 -5
- package/package.json +41 -42
- package/src/cli/argv.ts +1 -1
- package/src/cli/cmd/run.ts +7 -1
- package/src/cli/continuous-mode.js +38 -12
- package/src/cli/event-handler.js +3 -1
- package/src/cli/model-config.js +20 -4
- package/src/cli/run-options.js +144 -78
- package/src/config/config.ts +306 -105
- package/src/config/defaults.ts +13 -5
- package/src/config/file-config.ts +16 -0
- package/src/file/ripgrep.ts +38 -5
- package/src/file/time.ts +86 -9
- package/src/index.js +39 -33
- package/src/mcp/index.ts +370 -106
- package/src/permission/index.ts +22 -0
- package/src/project/instance.ts +5 -1
- package/src/project/project.ts +35 -2
- package/src/provider/free-tier-error.ts +1 -1
- package/src/provider/kilo-deprecation.ts +30 -0
- package/src/provider/kilo.ts +25 -7
- package/src/provider/provider.ts +53 -22
- package/src/provider/retry-fetch.ts +5 -0
- package/src/provider/transform.ts +139 -17
- package/src/session/compaction.ts +18 -2
- package/src/session/index.ts +30 -3
- package/src/session/message-v2.ts +318 -32
- package/src/session/processor.ts +274 -140
- package/src/session/prompt.ts +154 -128
- package/src/session/retry.ts +26 -13
- package/src/session/summary.ts +4 -1
- package/src/tool/bash.ts +232 -45
- package/src/tool/bash.txt +1 -1
- package/src/tool/codesearch.ts +15 -78
- package/src/tool/edit.ts +111 -30
- package/src/tool/glob.ts +2 -1
- package/src/tool/grep.ts +175 -57
- package/src/tool/ls.ts +2 -1
- package/src/tool/multiedit.ts +3 -1
- package/src/tool/read.ts +169 -41
- package/src/tool/task.ts +26 -18
- package/src/tool/tool.ts +4 -1
- package/src/tool/webfetch.ts +68 -56
- package/src/tool/webfetch.txt +4 -4
- package/src/tool/websearch.ts +20 -75
- package/src/tool/websearch.txt +2 -0
- package/src/tool/write.ts +23 -6
- package/src/util/bom.ts +32 -0
- package/src/util/exa-mcp.ts +82 -0
- package/src/util/legacy-error-names.ts +39 -0
- package/src/util/read-bounded.ts +32 -0
- package/src/util/sse-usage-extractor.ts +67 -13
- package/src/util/timeout.ts +3 -4
- package/src/util/verbose-fetch.ts +40 -1
package/src/cli/run-options.js
CHANGED
|
@@ -158,82 +158,148 @@ export function buildRunOptions(yargs, defaultOptions = {}) {
|
|
|
158
158
|
}, true)
|
|
159
159
|
: parser;
|
|
160
160
|
|
|
161
|
-
return
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
161
|
+
return (
|
|
162
|
+
normalizedParser
|
|
163
|
+
.option('generate-title', {
|
|
164
|
+
type: 'boolean',
|
|
165
|
+
description:
|
|
166
|
+
'Generate session titles using AI (default: false). Disabling saves tokens and prevents rate limit issues.',
|
|
167
|
+
default: false,
|
|
168
|
+
})
|
|
169
|
+
.option('retry-timeout', {
|
|
170
|
+
type: 'number',
|
|
171
|
+
description:
|
|
172
|
+
'Maximum total retry time in seconds for rate limit errors (default: 604800 = 7 days)',
|
|
173
|
+
})
|
|
174
|
+
.option('retry-on-rate-limits', {
|
|
175
|
+
type: 'boolean',
|
|
176
|
+
description:
|
|
177
|
+
'Retry AI completions API requests when rate limited (HTTP 429). Use --no-retry-on-rate-limits in integration tests to fail fast instead of waiting.',
|
|
178
|
+
default: true,
|
|
179
|
+
})
|
|
180
|
+
.option('output-response-model', {
|
|
181
|
+
type: 'boolean',
|
|
182
|
+
description: 'Include model info in step_finish output',
|
|
183
|
+
default: true,
|
|
184
|
+
})
|
|
185
|
+
.option('summarize-session', {
|
|
186
|
+
type: 'boolean',
|
|
187
|
+
description:
|
|
188
|
+
'Generate AI session summaries (default: true). Use --no-summarize-session to disable. Automatically off for a model declared as having no context limit (`unlimited: true` or `limit.context: null` in the provider config).',
|
|
189
|
+
default: true,
|
|
190
|
+
})
|
|
191
|
+
.option('compaction-model', {
|
|
192
|
+
type: 'string',
|
|
193
|
+
description:
|
|
194
|
+
'Model to use for context compaction and session summaries, in format providerID/modelID. Use "same" to use the base model. Default: kilo/nemotron-3-ultra-free (free, Kilo authentication recommended, 1M context), which falls back to the --model model when --model points at another provider. Overridden by --compaction-models if both are specified.',
|
|
195
|
+
default: defaultCompactionModel,
|
|
196
|
+
})
|
|
197
|
+
.option('compaction-models', {
|
|
198
|
+
type: 'string',
|
|
199
|
+
description:
|
|
200
|
+
'Ordered cascade of compaction models in links notation sequence format: "(model1 model2 ... same)". ' +
|
|
201
|
+
"Models are tried from smallest/cheapest context to largest. If used context exceeds a model's limit or its rate limit is reached, the next model is tried. " +
|
|
202
|
+
'The special value "same" uses the base model. Overrides --compaction-model when specified. ' +
|
|
203
|
+
'The default cascade is Kilo-specific: when --model points at another provider, its entries from other providers are dropped so secondary calls inherit --model. A cascade given explicitly is used as written.',
|
|
204
|
+
default: defaultCompactionModels,
|
|
205
|
+
})
|
|
206
|
+
.option('compaction-safety-margin', {
|
|
207
|
+
type: 'number',
|
|
208
|
+
description:
|
|
209
|
+
'Safety margin (%) of usable context window before triggering compaction. Only applies when the compaction model has equal or smaller context than the base model. Default: 25.',
|
|
210
|
+
default: defaultCompactionSafetyMarginPercent,
|
|
211
|
+
})
|
|
212
|
+
.option('temperature', {
|
|
213
|
+
type: 'number',
|
|
214
|
+
description:
|
|
215
|
+
'Override the temperature for model completions. When not set, the default per-model temperature is used.',
|
|
216
|
+
})
|
|
217
|
+
.option('read-only', {
|
|
218
|
+
type: 'boolean',
|
|
219
|
+
description:
|
|
220
|
+
'Enforceable read-only / planning mode. Disables all filesystem-mutating and shell tools (bash, edit, write, multiedit, patch) so the agent can only read, search and plan. Maps to agent-commander --read-only.',
|
|
221
|
+
default: false,
|
|
222
|
+
})
|
|
223
|
+
.option('disable-tools', {
|
|
224
|
+
type: 'string',
|
|
225
|
+
description:
|
|
226
|
+
'Comma-separated list of tool ids to disable (e.g. "bash,write,edit"). Disabled tools are never exposed to the model and are rejected if invoked via batch.',
|
|
227
|
+
})
|
|
228
|
+
.option('permission-mode', {
|
|
229
|
+
type: 'string',
|
|
230
|
+
choices: ['auto', 'plan', 'readonly', 'ask'],
|
|
231
|
+
description:
|
|
232
|
+
'Permission policy for mutating tools. "auto" (default) allows everything; "plan" allows read-only shell and asks before mutations; "readonly" denies all mutations; "ask" asks before every mutating tool. Approvals are driven over JSON (permission_request / permission_response).',
|
|
233
|
+
default: 'auto',
|
|
234
|
+
})
|
|
235
|
+
.option('permission', {
|
|
236
|
+
type: 'string',
|
|
237
|
+
description:
|
|
238
|
+
'OpenCode-compatible permission override as JSON, merged on top of --permission-mode. Example: \'{"edit":"ask","bash":{"git push*":"ask","*":"allow"},"webfetch":"allow"}\'.',
|
|
239
|
+
})
|
|
240
|
+
// Compatibility switches (issue #335). They are resolved (together with
|
|
241
|
+
// their LINK_ASSISTANT_AGENT_* env vars) by initConfig() in
|
|
242
|
+
// src/config/config.ts; they are declared here so they show up in --help.
|
|
243
|
+
// No defaults here, so an env var is not shadowed by a yargs default.
|
|
244
|
+
.option('bash-shell', {
|
|
245
|
+
type: 'string',
|
|
246
|
+
description:
|
|
247
|
+
'Shell for the bash tool: "auto" (default, $SHELL if POSIX, else bash, else /bin/sh), "legacy" (/bin/sh as before) or a shell path. Env: LINK_ASSISTANT_AGENT_BASH_SHELL',
|
|
248
|
+
})
|
|
249
|
+
.option('legacy-tool-output', {
|
|
250
|
+
type: 'boolean',
|
|
251
|
+
description:
|
|
252
|
+
'Restore previous tool output formats (empty edit/write output, head-truncated bash output, empty read past EOF). Env: LINK_ASSISTANT_AGENT_LEGACY_TOOL_OUTPUT',
|
|
253
|
+
})
|
|
254
|
+
.option('legacy-edit-matching', {
|
|
255
|
+
type: 'boolean',
|
|
256
|
+
description:
|
|
257
|
+
'Restore previous edit matching (empty oldString overwrites a file, loose fuzzy thresholds). Env: LINK_ASSISTANT_AGENT_LEGACY_EDIT_MATCHING',
|
|
258
|
+
})
|
|
259
|
+
.option('glob-follow-symlinks', {
|
|
260
|
+
type: 'boolean',
|
|
261
|
+
description:
|
|
262
|
+
'Follow symlinked directories in glob and ls (previous behaviour). Env: LINK_ASSISTANT_AGENT_GLOB_FOLLOW_SYMLINKS',
|
|
263
|
+
})
|
|
264
|
+
.option('grep-hidden', {
|
|
265
|
+
type: 'boolean',
|
|
266
|
+
description:
|
|
267
|
+
'Search hidden files in grep (default true; --no-grep-hidden restores previous behaviour). Env: LINK_ASSISTANT_AGENT_GREP_HIDDEN',
|
|
268
|
+
})
|
|
269
|
+
.option('grep-timeout-ms', {
|
|
270
|
+
type: 'number',
|
|
271
|
+
description:
|
|
272
|
+
'Timeout of one grep search in ms (default 30000, 0 = none). Env: LINK_ASSISTANT_AGENT_GREP_TIMEOUT_MS',
|
|
273
|
+
})
|
|
274
|
+
.option('read-max-lines', {
|
|
275
|
+
type: 'number',
|
|
276
|
+
description:
|
|
277
|
+
'Max lines one read call returns (default 2000, 0 = no cap). Env: LINK_ASSISTANT_AGENT_READ_MAX_LINES',
|
|
278
|
+
})
|
|
279
|
+
.option('read-max-bytes', {
|
|
280
|
+
type: 'number',
|
|
281
|
+
description:
|
|
282
|
+
'Max bytes one read call returns (default 51200, 0 = no cap). Env: LINK_ASSISTANT_AGENT_READ_MAX_BYTES',
|
|
283
|
+
})
|
|
284
|
+
.option('legacy-error-names', {
|
|
285
|
+
type: 'boolean',
|
|
286
|
+
description:
|
|
287
|
+
'Report ContextOverflowError as APIError in JSON output (previous name). Env: LINK_ASSISTANT_AGENT_LEGACY_ERROR_NAMES',
|
|
288
|
+
})
|
|
289
|
+
.option('legacy-token-usage', {
|
|
290
|
+
type: 'boolean',
|
|
291
|
+
description:
|
|
292
|
+
'Report tokens.output including reasoning tokens (previous accounting). Env: LINK_ASSISTANT_AGENT_LEGACY_TOKEN_USAGE',
|
|
293
|
+
})
|
|
294
|
+
.option('legacy-loop-exit', {
|
|
295
|
+
type: 'boolean',
|
|
296
|
+
description:
|
|
297
|
+
'End the turn on a "stop" finish even if tools ran in that step (previous behaviour). Env: LINK_ASSISTANT_AGENT_LEGACY_LOOP_EXIT',
|
|
298
|
+
})
|
|
299
|
+
.option('mcp-connect-timeout', {
|
|
300
|
+
type: 'number',
|
|
301
|
+
description:
|
|
302
|
+
'Default MCP connect/initialize timeout in ms (default 30000, 0 = none). Env: LINK_ASSISTANT_AGENT_MCP_CONNECT_TIMEOUT',
|
|
303
|
+
})
|
|
304
|
+
);
|
|
239
305
|
}
|