@dudko.dev/agent 0.0.59 → 0.0.61
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 +3 -3
- package/dist/cli.js +138 -135
- package/dist/index.cjs +61 -61
- package/dist/index.d.cts +7 -3
- package/dist/index.d.ts +7 -3
- package/dist/index.js +61 -61
- package/dist/subagent-worker.js +55 -55
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -909,7 +909,7 @@ agent.getToolApprovalMode()
|
|
|
909
909
|
|
|
910
910
|
`onRequest` may also answer **`{ park: true }`**: "the answer will come later, from outside the run" - the run parks at the end of the tool round and is resumed with the answer (needs `persistence.journal`; see [Parking a run](#parking-a-run-a-persons-answer-or-a-result-from-outside)). Without the journal it is a denial.
|
|
911
911
|
|
|
912
|
-
Each call is decided in this order: (1)
|
|
912
|
+
Each call is decided in this order: (1) the most specific matching rule — exact name over the longest `*` glob — says `allow`, `ask` or `deny`: `ask` asks EVERY time, and no earlier "always allow" answers it ("ask every time" means every time; the request and its `tool.approval-requested` event carry `rule`, the rule's name or pattern, so a UI need not offer "always allow" there); (2) the mode refusing the call (`read-only`, a tool that may write) - an earlier "always allow" does not outrank it; (3) a tool approved earlier with `remember: true` runs; (4) the mode: `autopilot` allows, `read-only` allows read-only tools and denies the rest, `ask-writes` allows read-only tools and asks for the rest, `ask-all` asks. Built-in tools are always allowed. An `ask` without `onRequest` is a denial. The browser sibling decides in the same order.
|
|
913
913
|
|
|
914
914
|
A tool is read-only when its MCP descriptor says `annotations.readOnlyHint: true`, or when a native tool is marked with `markReadOnly(tool)` (`isReadOnlyTool(tool)` checks). The request shows the input after `inputSanitizer`.
|
|
915
915
|
|
|
@@ -1563,7 +1563,7 @@ createAgent({
|
|
|
1563
1563
|
})
|
|
1564
1564
|
```
|
|
1565
1565
|
|
|
1566
|
-
The path is absolute (or a `file:` URL); `resourceLimits` bounds the worker's heap. The browser sibling ships a ready implementation on the browser's codecs (`fitReferenceImage`); Node has no canvas, so this package ships none.
|
|
1566
|
+
The path is absolute (or a `file:` URL); `resourceLimits` bounds the worker's heap. The browser sibling ships a ready implementation on the browser's codecs (`fitReferenceImage`); Node has no canvas, so this package ships none. The REPL (`dd-agent`) is a host too: with `sharp` installed it uses the recipe above (a PNG kept when its smaller copy fits, else a JPEG on white; EXIF orientation applied) - `AGENT_MEDIA_FIT_REFERENCE`.
|
|
1567
1567
|
|
|
1568
1568
|
**Audio attachments.** `run({ input, files: [{ data, name?, mediaType? }] })` takes audio as bytes, base64 or a data URL. Each file is transcribed **once**, before planning, and its text is put under the input in a fenced block that says what it is:
|
|
1569
1569
|
|
|
@@ -2180,7 +2180,7 @@ dd-agent --env-file=.env
|
|
|
2180
2180
|
|
|
2181
2181
|
`--env-file=<path>` is loaded via Node's built-in `process.loadEnvFile`, so no `dotenv` dependency is needed. Without the flag the CLI reads the ambient process env. `-h` / `--help` prints the supported flags and the in-REPL slash commands (`/status`, `/usage`, `/tools`, `/history`, `/reset`, `/compact`, `/autopilot`, `/approval <mode>`, `/reconnect`, `/skills`, `/forget <name>`, `/agents`, `/stop [n]`, `/exit` — `/quit` does the same).
|
|
2182
2182
|
|
|
2183
|
-
The newer features are env-driven too: `AGENT_THINKING` (`off | minimal | low | medium | high | xhigh | <budget tokens>`), `AGENT_MAX_INPUT_TOKENS` / `AGENT_MAX_OUTPUT_TOKENS` / `AGENT_MAX_REASONING_TOKENS` / `AGENT_MAX_TOTAL_TOKENS`, `AGENT_MAX_TOOL_CALLS`, `AGENT_PER_CALL_TOKENS` (JSON `{"executor":16000,"synthesizer":0}` — per-stage output caps, `0` = no cap, see [Token limits](#token-limits-and-step-caps)), `AGENT_TOOL_APPROVAL` (`autopilot | ask-writes | ask-all | read-only`), `AGENT_TOOL_RULES` (JSON `{ "<tool or glob*>": "allow" | "ask" | "deny" }`, beats the mode — e.g. `{"github__delete_*":"deny"}`), `AGENT_EGRESS` (`on | off`; with `AGENT_EGRESS_ALLOW`, `AGENT_EGRESS_DENY`, `AGENT_EGRESS_PROTOCOLS`, `AGENT_EGRESS_ALLOW_PRIVATE` — see [Egress](#egress-what-the-model-may-fetch)), `AGENT_SEARCH` (`google | off` - Google Search through Gemini grounding, the one provider the CLI offers: another search API is a function, which an environment cannot carry; with `AGENT_SEARCH_API_KEY` (a Gemini key; `AGENT_API_KEY` is used when `AGENT_PROVIDER_TYPE=google`), `AGENT_SEARCH_MODEL`, `AGENT_SEARCH_BASE_URL`, `AGENT_SEARCH_MAX_RESULTS`, `AGENT_SEARCH_ALLOW_PRIVATE` — see [Search](#search-finding-the-page-to-fetch)), `AGENT_SANDBOX` (`on | off`; with `AGENT_SANDBOX_TIMEOUT_MS`, `AGENT_SANDBOX_MEMORY_MB` — see [Running code](#running-code-the-sandbox)), `AGENT_SUBAGENTS` (`on | off`; with `AGENT_SUBAGENTS_MAX_DEPTH`, `AGENT_SUBAGENTS_MAX_CHILDREN`, `AGENT_SUBAGENTS_MAX_CONCURRENT` — see [Dynamic subagents](#dynamic-subagents-helpers-the-model-starts-itself); `/agents` and `/stop` list and stop helpers, and an approval prompt says when a helper is asking), `AGENT_IMAGE_MODEL` / `AGENT_SPEECH_MODEL` / `AGENT_TRANSCRIPTION_MODEL` (a model id each; each mounts its tool - with `AGENT_MEDIA_PROVIDER_TYPE` / `AGENT_MEDIA_API_KEY` / `AGENT_MEDIA_BASE_URL` / `AGENT_MEDIA_PROVIDER_OPTIONS` when those models live at another provider than the main one, `AGENT_MEDIA_DIR` (default `./agent-media`), `AGENT_MEDIA_MAX_CALLS`, `AGENT_SPEECH_VOICE` — see [Media](#media-images-speech-and-transcription); in the REPL `/audio <file> [question]` attaches an audio file, and `/usage` shows the media calls beside the tokens), `AGENT_SKILLS_DIR`, `AGENT_LEARNING` (`on | off`; `AGENT_LEARNING_DIR` keeps the lessons across sessions — see [Learning](#learning-lessons-that-outlive-the-task)), `AGENT_TOOL_SELECTION_STRATEGY` (`auto | all | plan-narrowed | search`), `AGENT_CONTEXT_WINDOW_TOKENS`, `AGENT_COMPACTION_THRESHOLD` (percent of the window where auto-compaction starts, default 85) and `AGENT_COMPACTION=off`. The REPL prints the model's thoughts dimmed, auto-compacts its history with the same settings, and — when the approval mode asks — prompts `allow? [y]es / [n]o / [a]lways` right in the terminal; `/autopilot` toggles between autopilot and the last asking mode. A question nobody answers within 5 minutes is denied, and the prompt is closed with one line (`[approve] closed: no decision within 300000ms - <tool> did not run`); Ctrl-C closes it the same way (`the run was stopped`). An MCP server's question at the prompt is closed likewise when its own time runs out or the run stops. The next question is shown as usual - none waits behind one nobody can answer any more.
|
|
2183
|
+
The newer features are env-driven too: `AGENT_THINKING` (`off | minimal | low | medium | high | xhigh | <budget tokens>`), `AGENT_MAX_INPUT_TOKENS` / `AGENT_MAX_OUTPUT_TOKENS` / `AGENT_MAX_REASONING_TOKENS` / `AGENT_MAX_TOTAL_TOKENS`, `AGENT_MAX_TOOL_CALLS`, `AGENT_PER_CALL_TOKENS` (JSON `{"executor":16000,"synthesizer":0}` — per-stage output caps, `0` = no cap, see [Token limits](#token-limits-and-step-caps)), `AGENT_TOOL_APPROVAL` (`autopilot | ask-writes | ask-all | read-only`), `AGENT_TOOL_RULES` (JSON `{ "<tool or glob*>": "allow" | "ask" | "deny" }`, beats the mode — e.g. `{"github__delete_*":"deny"}`), `AGENT_EGRESS` (`on | off`; with `AGENT_EGRESS_ALLOW`, `AGENT_EGRESS_DENY`, `AGENT_EGRESS_PROTOCOLS`, `AGENT_EGRESS_ALLOW_PRIVATE` — see [Egress](#egress-what-the-model-may-fetch)), `AGENT_SEARCH` (`google | off` - Google Search through Gemini grounding, the one provider the CLI offers: another search API is a function, which an environment cannot carry; with `AGENT_SEARCH_API_KEY` (a Gemini key; `AGENT_API_KEY` is used when `AGENT_PROVIDER_TYPE=google`), `AGENT_SEARCH_MODEL`, `AGENT_SEARCH_BASE_URL`, `AGENT_SEARCH_MAX_RESULTS`, `AGENT_SEARCH_ALLOW_PRIVATE` — see [Search](#search-finding-the-page-to-fetch)), `AGENT_SANDBOX` (`on | off`; with `AGENT_SANDBOX_TIMEOUT_MS`, `AGENT_SANDBOX_MEMORY_MB` — see [Running code](#running-code-the-sandbox)), `AGENT_SUBAGENTS` (`on | off`; with `AGENT_SUBAGENTS_MAX_DEPTH`, `AGENT_SUBAGENTS_MAX_CHILDREN`, `AGENT_SUBAGENTS_MAX_CONCURRENT` — see [Dynamic subagents](#dynamic-subagents-helpers-the-model-starts-itself); `/agents` and `/stop` list and stop helpers, and an approval prompt says when a helper is asking), `AGENT_IMAGE_MODEL` / `AGENT_SPEECH_MODEL` / `AGENT_TRANSCRIPTION_MODEL` (a model id each; each mounts its tool - with `AGENT_MEDIA_PROVIDER_TYPE` / `AGENT_MEDIA_API_KEY` / `AGENT_MEDIA_BASE_URL` / `AGENT_MEDIA_PROVIDER_OPTIONS` when those models live at another provider than the main one, `AGENT_MEDIA_DIR` (default `./agent-media`), `AGENT_MEDIA_MAX_CALLS`, `AGENT_SPEECH_VOICE`, `AGENT_MEDIA_FIT_REFERENCE` (`auto | on | off`: a reference picture over 4096 px / 8 MiB is sent as a smaller copy made with [`sharp`](https://sharp.pixelplumbing.com) when it is installed - `npm install sharp`, an optional peer the REPL loads only with an image model; `on` requires it, `off` refuses such a picture as before; the start line says which) — see [Media](#media-images-speech-and-transcription); in the REPL `/audio <file> [question]` attaches an audio file, and `/usage` shows the media calls beside the tokens), `AGENT_SKILLS_DIR`, `AGENT_LEARNING` (`on | off`; `AGENT_LEARNING_DIR` keeps the lessons across sessions — see [Learning](#learning-lessons-that-outlive-the-task)), `AGENT_TOOL_SELECTION_STRATEGY` (`auto | all | plan-narrowed | search`), `AGENT_CONTEXT_WINDOW_TOKENS`, `AGENT_COMPACTION_THRESHOLD` (percent of the window where auto-compaction starts, default 85) and `AGENT_COMPACTION=off`. The REPL prints the model's thoughts dimmed, auto-compacts its history with the same settings, and — when the approval mode asks — prompts `allow? [y]es / [n]o / [a]lways` right in the terminal; `/autopilot` toggles between autopilot and the last asking mode. A question nobody answers within 5 minutes is denied, and the prompt is closed with one line (`[approve] closed: no decision within 300000ms - <tool> did not run`); Ctrl-C closes it the same way (`the run was stopped`). An MCP server's question at the prompt is closed likewise when its own time runs out or the run stops. The next question is shown as usual - none waits behind one nobody can answer any more.
|
|
2184
2184
|
|
|
2185
2185
|
**`AGENT_MCP_ELICITATION`** (`off` by default, `form`, `all`) lets a connected MCP server ask *you* something in the middle of a tool call ([MCP elicitation](#mcp-elicitation-a-server-asks-the-user)). The question is printed as a quotation (`| …` in front of every line: the server's words, not the CLI's) and answered at the prompt, in the same queue as the approval questions: `y` fills in the form field by field (Enter takes a field's default or skips an optional one, a value of the wrong kind is asked for again up to three times, `/cancel` dismisses), `n` declines, anything else cancels. `all` also accepts URL mode: the link is printed for you to open yourself - the CLI never opens it. What you type goes to that server only; a question nobody decided (a cap, a timeout, a form that cannot be shown) is reported as `!! <tool>: the server's question was answered "cancel" automatically (<reason>)`. The defaults of the library apply (5 minutes per question, 5 per tool call, 20 per run); helpers started with `AGENT_SUBAGENTS` cannot ask.
|
|
2186
2186
|
|