@askalf/dario 4.8.28 → 4.8.29
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/dist/cc-template-data.json +101 -0
- package/dist/cc-template.d.ts +7 -1
- package/dist/cc-template.js +8 -2
- package/dist/shim/runtime.cjs +1 -1
- package/package.json +1 -1
|
@@ -385,6 +385,107 @@
|
|
|
385
385
|
"additionalProperties": false
|
|
386
386
|
}
|
|
387
387
|
},
|
|
388
|
+
{
|
|
389
|
+
"name": "Glob",
|
|
390
|
+
"description": "Fast file pattern matching. Supports glob patterns like \"**/*.js\" or \"src/**/*.ts\". Returns matching file paths sorted by modification time.",
|
|
391
|
+
"input_schema": {
|
|
392
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
393
|
+
"type": "object",
|
|
394
|
+
"properties": {
|
|
395
|
+
"pattern": {
|
|
396
|
+
"description": "The glob pattern to match files against",
|
|
397
|
+
"type": "string"
|
|
398
|
+
},
|
|
399
|
+
"path": {
|
|
400
|
+
"description": "The directory to search in. If not specified, the current working directory will be used. IMPORTANT: Omit this field to use the default directory. DO NOT enter \"undefined\" or \"null\" - simply omit it for the default behavior. Must be a valid directory path if provided.",
|
|
401
|
+
"type": "string"
|
|
402
|
+
}
|
|
403
|
+
},
|
|
404
|
+
"required": [
|
|
405
|
+
"pattern"
|
|
406
|
+
],
|
|
407
|
+
"additionalProperties": false
|
|
408
|
+
}
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
"name": "Grep",
|
|
412
|
+
"description": "Content search built on ripgrep. Prefer this over `grep`/`rg` via Bash — results integrate with the permission UI and file links.\n\n- Full regex syntax (e.g. \"log.*Error\", \"function\\s+\\w+\"). Ripgrep, not grep — escape literal braces (`interface\\{\\}`).\n- Filter with `glob` (e.g. \"**/*.tsx\") or `type` (e.g. \"js\", \"py\", \"rust\").\n- `output_mode`: \"content\" (matching lines), \"files_with_matches\" (paths only, default), or \"count\".\n- `multiline: true` for patterns that span lines.",
|
|
413
|
+
"input_schema": {
|
|
414
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
415
|
+
"type": "object",
|
|
416
|
+
"properties": {
|
|
417
|
+
"pattern": {
|
|
418
|
+
"description": "The regular expression pattern to search for in file contents",
|
|
419
|
+
"type": "string"
|
|
420
|
+
},
|
|
421
|
+
"path": {
|
|
422
|
+
"description": "File or directory to search in (rg PATH). Defaults to current working directory.",
|
|
423
|
+
"type": "string"
|
|
424
|
+
},
|
|
425
|
+
"glob": {
|
|
426
|
+
"description": "Glob pattern to filter files (e.g. \"*.js\", \"*.{ts,tsx}\") - maps to rg --glob",
|
|
427
|
+
"type": "string"
|
|
428
|
+
},
|
|
429
|
+
"output_mode": {
|
|
430
|
+
"description": "Output mode: \"content\" shows matching lines (supports -A/-B/-C context, -n line numbers, head_limit), \"files_with_matches\" shows file paths (supports head_limit), \"count\" shows match counts (supports head_limit). Defaults to \"files_with_matches\".",
|
|
431
|
+
"type": "string",
|
|
432
|
+
"enum": [
|
|
433
|
+
"content",
|
|
434
|
+
"files_with_matches",
|
|
435
|
+
"count"
|
|
436
|
+
]
|
|
437
|
+
},
|
|
438
|
+
"-B": {
|
|
439
|
+
"description": "Number of lines to show before each match (rg -B). Requires output_mode: \"content\", ignored otherwise.",
|
|
440
|
+
"type": "number"
|
|
441
|
+
},
|
|
442
|
+
"-A": {
|
|
443
|
+
"description": "Number of lines to show after each match (rg -A). Requires output_mode: \"content\", ignored otherwise.",
|
|
444
|
+
"type": "number"
|
|
445
|
+
},
|
|
446
|
+
"-C": {
|
|
447
|
+
"description": "Alias for context.",
|
|
448
|
+
"type": "number"
|
|
449
|
+
},
|
|
450
|
+
"context": {
|
|
451
|
+
"description": "Number of lines to show before and after each match (rg -C). Requires output_mode: \"content\", ignored otherwise.",
|
|
452
|
+
"type": "number"
|
|
453
|
+
},
|
|
454
|
+
"-n": {
|
|
455
|
+
"description": "Show line numbers in output (rg -n). Requires output_mode: \"content\", ignored otherwise. Defaults to true.",
|
|
456
|
+
"type": "boolean"
|
|
457
|
+
},
|
|
458
|
+
"-i": {
|
|
459
|
+
"description": "Case insensitive search (rg -i)",
|
|
460
|
+
"type": "boolean"
|
|
461
|
+
},
|
|
462
|
+
"-o": {
|
|
463
|
+
"description": "Print only the matched (non-empty) parts of each matching line, one match per output line (rg -o / --only-matching). Requires output_mode: \"content\", ignored otherwise. Defaults to false.",
|
|
464
|
+
"type": "boolean"
|
|
465
|
+
},
|
|
466
|
+
"type": {
|
|
467
|
+
"description": "File type to search (rg --type). Common types: js, py, rust, go, java, etc. More efficient than include for standard file types.",
|
|
468
|
+
"type": "string"
|
|
469
|
+
},
|
|
470
|
+
"head_limit": {
|
|
471
|
+
"description": "Limit output to first N lines/entries, equivalent to \"| head -N\". Works across all output modes: content (limits output lines), files_with_matches (limits file paths), count (limits count entries). Defaults to 250 when unspecified. Pass 0 for unlimited (use sparingly — large result sets waste context).",
|
|
472
|
+
"type": "number"
|
|
473
|
+
},
|
|
474
|
+
"offset": {
|
|
475
|
+
"description": "Skip first N lines/entries before applying head_limit, equivalent to \"| tail -n +N | head -N\". Works across all output modes. Defaults to 0.",
|
|
476
|
+
"type": "number"
|
|
477
|
+
},
|
|
478
|
+
"multiline": {
|
|
479
|
+
"description": "Enable multiline mode where . matches newlines and patterns can span lines (rg -U --multiline-dotall). Default: false.",
|
|
480
|
+
"type": "boolean"
|
|
481
|
+
}
|
|
482
|
+
},
|
|
483
|
+
"required": [
|
|
484
|
+
"pattern"
|
|
485
|
+
],
|
|
486
|
+
"additionalProperties": false
|
|
487
|
+
}
|
|
488
|
+
},
|
|
388
489
|
{
|
|
389
490
|
"name": "Monitor",
|
|
390
491
|
"description": "Start a background monitor that streams events from a long-running script. Each stdout line is an event — you keep working and notifications arrive in the chat. Events arrive on their own schedule and are not replies from the user, even if one lands while you're waiting for the user to answer a question.\n\nPick by how many notifications you need:\n- **One** (\"tell me when the server is ready / the build finishes\") → use **Bash with `run_in_background`** and a command that exits when the condition is true, e.g. `until grep -q \"Ready in\" dev.log; do sleep 0.5; done`. You get a single completion notification when it exits.\n- **One per occurrence, indefinitely** (\"tell me every time an ERROR line appears\") → Monitor with an unbounded command (`tail -f`, `inotifywait -m`, `while true`).\n- **One per occurrence, until a known end** (\"emit each CI step result, stop when the run completes\") → Monitor with a command that emits lines and then exits.\n\nYour script's stdout is the event stream. Each line becomes a notification. Exit ends the watch.\n\n # Each matching log line is an event\n tail -f /var/log/app.log | grep --line-buffered \"ERROR\"\n\n # Each file change is an event\n inotifywait -m --format '%e %f' /watched/dir\n\n # Poll GitHub for new PR comments and emit one line per new comment\n last=$(date -u +%Y-%m-%dT%H:%M:%SZ)\n while true; do\n now=$(date -u +%Y-%m-%dT%H:%M:%SZ)\n gh api \"repos/owner/repo/issues/123/comments?since=$last\" --jq '.[] | \"\\(.user.login): \\(.body)\"'\n last=$now; sleep 30\n done\n\n # Node script that emits events as they arrive (e.g. WebSocket listener)\n node watch-for-events.js\n\n # Per-occurrence with a natural end: emit each CI check as it lands, exit when the run completes\n prev=\"\"\n while true; do\n s=$(gh pr checks 123 --json name,bucket)\n cur=$(jq -r '.[] | select(.bucket!=\"pending\") | \"\\(.name): \\(.bucket)\"' <<<\"$s\" | sort)\n comm -13 <(echo \"$prev\") <(echo \"$cur\")\n prev=$cur\n jq -e 'all(.bucket!=\"pending\")' <<<\"$s\" >/dev/null && break\n sleep 30\n done\n\n**Don't use an unbounded command for a single notification.** `tail -f`, `inotifywait -m`, and `while true` never exit on their own, so the monitor stays armed until timeout even after the event has fired. For \"tell me when X is ready,\" use Bash `run_in_background` with an `until` loop instead (one notification, ends in seconds). Note that `tail -f log | grep -m 1 ...` does *not* fix this: if the log goes quiet after the match, `tail` never receives SIGPIPE and the pipeline hangs anyway.\n\n**Script quality:**\n- Every pipe stage must flush per line or matches sit in its buffer unseen: `grep` needs `--line-buffered`, `awk` needs `fflush()`. `head` cannot flush at all — `| head -N` delivers nothing until N matches accumulate, then ends the stream.\n- In poll loops, handle transient failures (`curl ... || true`) — one failed request shouldn't kill the monitor.\n- Poll intervals: 30s+ for remote APIs (rate limits), 0.5-1s for local checks.\n- Write a specific `description` — it appears in every notification (\"errors in deploy.log\" not \"watching logs\").\n- Only stdout is the event stream. Stderr goes to the output file (readable via Read) but does not trigger notifications — for a command you run directly (e.g. `python train.py 2>&1 | grep --line-buffered ...`), merge stderr with `2>&1` so its failures reach your filter. (No effect on `tail -f` of an existing log — that file only contains what its writer redirected.)\n\n**Coverage — silence is not success.** When watching a job or process for an outcome, your filter must match every terminal state, not just the happy path. A monitor that greps only for the success marker stays silent through a crashloop, a hung process, or an unexpected exit — and silence looks identical to \"still running.\" Before arming, ask: *if this process crashed right now, would my filter emit anything?* If not, widen it.\n\n # Wrong — silent on crash, hang, or any non-success exit\n tail -f run.log | grep --line-buffered \"elapsed_steps=\"\n\n # Right — one alternation covering progress + the failure signatures you'd act on\n tail -f run.log | grep -E --line-buffered \"elapsed_steps=|Traceback|Error|FAILED|assert|Killed|OOM\"\n\nFor poll loops checking job state, emit on every terminal status (`succeeded|failed|cancelled|timeout`), not just success. If you cannot confidently enumerate the failure signatures, broaden the grep alternation rather than narrow it — some extra noise is better than missing a crashloop.\n\n**Output volume**: Every stdout line is a conversation message, so the filter should be selective — but selective means \"the lines you'd act on,\" not \"only good news.\" Never pipe raw logs; filter to exactly the success and failure signals you care about. Monitors that produce too many events are automatically stopped; restart with a tighter filter if this happens.\n\nStdout lines within 200ms are batched into a single notification, so multiline output from a single event groups naturally.\n\nThe script runs in the same shell environment as Bash. Exit ends the watch (exit code is reported). Timeout → killed. Set `persistent: true` for session-length watches (PR monitoring, log tails) — the monitor runs until you call TaskStop or the session ends. Use TaskStop to cancel early.",
|
package/dist/cc-template.d.ts
CHANGED
|
@@ -20,7 +20,13 @@ export declare const CC_TEMPLATE: TemplateData;
|
|
|
20
20
|
* coming back for a tool the client has no handler for.
|
|
21
21
|
*
|
|
22
22
|
* PowerShell shipped in CC v2.1.116 on Windows; POSIX CC installs do not
|
|
23
|
-
* advertise it.
|
|
23
|
+
* advertise it. As of CC v2.1.162 the Glob/Grep tools are the same shape:
|
|
24
|
+
* Windows CC advertises them, POSIX CC drops them and steers the agent to
|
|
25
|
+
* shell `find`/`grep` instead (which PowerShell has no native equivalent
|
|
26
|
+
* for). Registering them here filters them to win32 clients AND keeps a
|
|
27
|
+
* POSIX auto-bake from dropping them out of the union — the v4.8.28
|
|
28
|
+
* regression, where a Linux runner re-baked the bundle down to 28 tools.
|
|
29
|
+
* Add new platform-scoped tools here as CC adds them.
|
|
24
30
|
*/
|
|
25
31
|
export declare const PLATFORM_ONLY_TOOLS: Record<string, Set<string>>;
|
|
26
32
|
/** Keep tool `t` unless its name is listed under a platform other than the current one. */
|
package/dist/cc-template.js
CHANGED
|
@@ -22,10 +22,16 @@ export const CC_TEMPLATE = TEMPLATE;
|
|
|
22
22
|
* coming back for a tool the client has no handler for.
|
|
23
23
|
*
|
|
24
24
|
* PowerShell shipped in CC v2.1.116 on Windows; POSIX CC installs do not
|
|
25
|
-
* advertise it.
|
|
25
|
+
* advertise it. As of CC v2.1.162 the Glob/Grep tools are the same shape:
|
|
26
|
+
* Windows CC advertises them, POSIX CC drops them and steers the agent to
|
|
27
|
+
* shell `find`/`grep` instead (which PowerShell has no native equivalent
|
|
28
|
+
* for). Registering them here filters them to win32 clients AND keeps a
|
|
29
|
+
* POSIX auto-bake from dropping them out of the union — the v4.8.28
|
|
30
|
+
* regression, where a Linux runner re-baked the bundle down to 28 tools.
|
|
31
|
+
* Add new platform-scoped tools here as CC adds them.
|
|
26
32
|
*/
|
|
27
33
|
export const PLATFORM_ONLY_TOOLS = {
|
|
28
|
-
win32: new Set(['PowerShell']),
|
|
34
|
+
win32: new Set(['PowerShell', 'Glob', 'Grep']),
|
|
29
35
|
};
|
|
30
36
|
/** Keep tool `t` unless its name is listed under a platform other than the current one. */
|
|
31
37
|
export function filterToolsForPlatform(tools, platform) {
|
package/dist/shim/runtime.cjs
CHANGED
|
@@ -156,7 +156,7 @@ function rewriteBody(bodyText, tmpl) {
|
|
|
156
156
|
// step with the proxy's filter so shim-rewritten and proxy-rewritten bodies
|
|
157
157
|
// carry the same outbound tool set on the same host.
|
|
158
158
|
const PLATFORM_ONLY_TOOLS = {
|
|
159
|
-
win32: new Set(['PowerShell']),
|
|
159
|
+
win32: new Set(['PowerShell', 'Glob', 'Grep']),
|
|
160
160
|
};
|
|
161
161
|
function filterToolsForPlatform(tools, platform) {
|
|
162
162
|
return tools.filter((tool) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@askalf/dario",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.29",
|
|
4
4
|
"description": "Use your Claude Pro/Max subscription in any tool — Cursor, Cline, Aider, the Agent SDK, your scripts — at subscription pricing, not per-token API bills. One local Anthropic + OpenAI-compatible endpoint.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|