适配 DSH 0.2.1-alpha.2 并核对原生功能分工

This commit is contained in:
yexi committed 2026-10-09 20:45:12 +08:00
1 parent feafd8b1df
commit 70008e2c54
31 files changed
+2459 -276

No files matched your search

+301 -21
View File
@@ -131,7 +131,7 @@
"properties": {
"file_path": {
"type": "string",
"description": "Path to edit, resolved by the filesystem backend."
"description": "Path to edit, resolved by the filesystem backend. Provide `file_path` before `old_string` and `new_string` in the arguments."
},
"old_string": {
"type": "string",
@@ -235,7 +235,7 @@
},
{
"name": "interrupt_agent",
"description": "Ask a subagent to stop its current work. This call returns without waiting for it to stop. You can continue a direct child's conversation later with send_message. Subagents it started will keep running.",
"description": "Ask a subagent to stop its current work. This call returns without waiting for it to stop. You can continue a local direct child's conversation later with send_message. External executions stop permanently and cannot receive follow-ups. Subagents it started will keep running.",
"parameters": {
"type": "object",
"properties": {
@@ -340,7 +340,7 @@
},
"target": {
"type": "string",
"description": "Plugin entry id, bundle package name, or installation spec, according to action."
"description": "Plugin entry id, bundle package name, or installation spec, according to action. For an Official catalog entry, pass list_bundles installTarget.spec to install_bundle."
},
"enabled": {
"type": "boolean",
@@ -414,18 +414,18 @@
},
{
"name": "pwsh",
"description": "Execute a PowerShell command (`pwsh -Command`) and return its stdout/stderr. Each call runs in a fresh pwsh process; pass `workdir` instead of using `cd`. Paths use native Windows form (`C:\\...`); read environment variables with `$env:NAME`. Managed `$env:DSH_*` variables expose current harness environment facts. Long output is truncated to its tail; the full output is saved to a file whose path is reported when available. On Windows a force-killed command settles as `[exit code: 1]` without a signal marker — treat it as an interruption, not a command failure. Before any delete or move, verify that the resolved absolute target path is the intended one; never run it against a computed path you have not checked. Do not assign to automatic variables such as `$HOME`; variable names are case-insensitive, so `$home` is the same read-only variable. Commands may run under a file sandbox; a blocked file operation is reported as `[sandbox: file access denied under <mode> mode]`, a policy denial: do not retry another way. Under the Windows sandbox, read-only pwsh runs in PowerShell ConstrainedLanguage mode, while workspace-write stays in FullLanguage unless host policy says otherwise. In read-only, prefer cmdlets and core types (`[string]`, `[datetime]`, `[regex]`, `[guid]`); .NET static calls (`[System.IO.*]::`, `[math]::`), `Add-Type`, COM objects, and reflection fail with \"only core types\" errors. `-f` formatting, property access, and core cmdlets work. In both confined modes, programs cannot open named pipes, so a command that captures another program's output through piped stdio (Node.js `child_process.spawn`/`exec` with the default `stdio: 'pipe'`) fails with EPERM, while `stdio: 'inherit'` and `stdio: 'ignore'` spawns work and PowerShell's own pipelines are unaffected. That EPERM is the documented boundary: do not retry the command another way — escalate the exact command once or restructure it to avoid capturing output.",
"description": "Execute a PowerShell command (`pwsh -Command`) and return its stdout/stderr. Each call runs in a fresh pwsh process; pass `workdir` instead of using `cd`. Paths use native Windows form (`C:\\...`); read environment variables with `$env:NAME`. Managed `$env:DSH_*` variables expose current harness environment facts. Long output is truncated to its tail; the full output is saved to a file whose path is reported when available. On Windows a force-killed command settles as `[exit code: 1]` without a signal marker — treat it as an interruption, not a command failure. Provide `description` before `command` in the arguments. Before any delete or move, verify that the resolved absolute target path is the intended one; never run it against a computed path you have not checked. Do not assign to automatic variables such as `$HOME`; variable names are case-insensitive, so `$home` is the same read-only variable. Commands may run under a file sandbox; a blocked file operation is reported as `[sandbox: file access denied under <mode> mode]`, a policy denial: do not retry another way. Under the Windows sandbox, read-only pwsh runs in PowerShell ConstrainedLanguage mode, while workspace-write stays in FullLanguage unless host policy says otherwise. In read-only, prefer cmdlets and core types (`[string]`, `[datetime]`, `[regex]`, `[guid]`); .NET static calls (`[System.IO.*]::`, `[math]::`), `Add-Type`, COM objects, and reflection fail with \"only core types\" errors. `-f` formatting, property access, and core cmdlets work. In both confined modes, programs cannot open named pipes, so a command that captures another program's output through piped stdio (Node.js `child_process.spawn`/`exec` with the default `stdio: 'pipe'`) fails with EPERM, while `stdio: 'inherit'` and `stdio: 'ignore'` spawns work and PowerShell's own pipelines are unaffected. That EPERM is the documented boundary: do not retry the command another way — escalate the exact command once or restructure it to avoid capturing output.",
"parameters": {
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "The PowerShell command to execute."
},
"description": {
"type": "string",
"description": "Clear, concise description of what this command does in active voice, 5-10 words (shown in the UI). Examples: \"ls\" → \"List files in current directory\"; \"git status\" → \"Show working tree status\"; \"Get-Process\" → \"List running processes\"."
},
"command": {
"type": "string",
"description": "The PowerShell command to execute."
},
"timeoutMs": {
"type": "number",
"description": "Timeout in milliseconds. The executor applies its configured default and cap; on expiry the command moves to the background as a job instead of being killed."
@@ -452,8 +452,8 @@
}
},
"required": [
"command",
"description"
"description",
"command"
]
}
},
@@ -497,6 +497,273 @@
]
}
},
{
"name": "schedule_create",
"description": "Create a reminder in the current session that delivers prompt when it becomes due. Supply exactly one timing parameter: after_seconds, at, every_seconds, daily, weekly, or cron. Local times that do not exist in the zone are skipped; repeated local times fire once, at the earlier instant. After downtime, a recurring reminder delivers only its latest missed occurrence. Delivery can repeat after a crash.",
"parameters": {
"type": "object",
"properties": {
"prompt": {
"type": "string",
"description": "Reminder content to present when the target becomes due."
},
"title": {
"type": "string",
"description": "Task name of at most 120 characters, shown on the task card and in task lists."
},
"after_seconds": {
"type": "number",
"description": "Delay in whole seconds."
},
"every_seconds": {
"type": "number",
"description": "Fixed-rate interval in whole seconds, at least 60, aligned to the creation time; changing it with schedule_update re-aligns it to the save time."
},
"daily": {
"type": "object",
"description": "Every day at a local time.",
"additionalProperties": false,
"properties": {
"time": {
"type": "string",
"description": "HH:mm:ss with optional 1-3 fractional digits, for example 23:00:00."
},
"time_zone": {
"type": "string",
"description": "UTC or IANA Area/Location, for example Asia/Shanghai."
}
},
"required": [
"time",
"time_zone"
]
},
"weekly": {
"type": "object",
"description": "On the given weekdays at a local time.",
"additionalProperties": false,
"properties": {
"time": {
"type": "string",
"description": "HH:mm:ss with optional 1-3 fractional digits, for example 09:00:00."
},
"time_zone": {
"type": "string",
"description": "UTC or IANA Area/Location, for example Asia/Shanghai."
},
"weekdays": {
"type": "array",
"description": "ISO weekdays, Monday 1 through Sunday 7, without repetitions.",
"items": {
"type": "integer"
}
}
},
"required": [
"time",
"time_zone",
"weekdays"
]
},
"cron": {
"type": "object",
"description": "Five-field Vixie cron expression in a time zone.",
"additionalProperties": false,
"properties": {
"expression": {
"type": "string",
"description": "minute hour day-of-month month day-of-week, for example \"*/15 9-17 * * 1-5\". When both day fields are restricted, a date matches if either one matches."
},
"time_zone": {
"type": "string",
"description": "UTC or IANA Area/Location, for example Asia/Shanghai."
}
},
"required": [
"expression",
"time_zone"
]
},
"at": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"time_zone": {
"type": "string"
}
},
"required": [
"date",
"time",
"time_zone"
]
}
],
"description": "Absolute target: an RFC 3339 date-time with offset, or a local date, time, and IANA time_zone."
}
},
"required": [
"prompt",
"title"
]
}
},
{
"name": "schedule_delete",
"description": "Delete a reminder in the current session, active or inactive. Deletion does not retract a reminder message that is already queued.",
"parameters": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Exact schedule id."
}
},
"required": [
"id"
]
}
},
{
"name": "schedule_list",
"description": "List the active reminders in the current session.",
"parameters": {
"type": "object",
"properties": {}
}
},
{
"name": "schedule_update",
"description": "Change a reminder in place, keeping its id. Supply a new title, prompt, or at most one timing parameter; omitted fields keep their stored values. To change a relative delay, create a new reminder.",
"parameters": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Schedule id returned by schedule_list."
},
"title": {
"type": "string",
"description": "New task name of at most 120 characters."
},
"prompt": {
"type": "string",
"description": "New reminder content."
},
"every_seconds": {
"type": "number",
"description": "Fixed-rate interval in whole seconds, at least 60, aligned to the creation time; changing it with schedule_update re-aligns it to the save time."
},
"daily": {
"type": "object",
"description": "Every day at a local time.",
"additionalProperties": false,
"properties": {
"time": {
"type": "string",
"description": "HH:mm:ss with optional 1-3 fractional digits, for example 23:00:00."
},
"time_zone": {
"type": "string",
"description": "UTC or IANA Area/Location, for example Asia/Shanghai."
}
},
"required": [
"time",
"time_zone"
]
},
"weekly": {
"type": "object",
"description": "On the given weekdays at a local time.",
"additionalProperties": false,
"properties": {
"time": {
"type": "string",
"description": "HH:mm:ss with optional 1-3 fractional digits, for example 09:00:00."
},
"time_zone": {
"type": "string",
"description": "UTC or IANA Area/Location, for example Asia/Shanghai."
},
"weekdays": {
"type": "array",
"description": "ISO weekdays, Monday 1 through Sunday 7, without repetitions.",
"items": {
"type": "integer"
}
}
},
"required": [
"time",
"time_zone",
"weekdays"
]
},
"cron": {
"type": "object",
"description": "Five-field Vixie cron expression in a time zone.",
"additionalProperties": false,
"properties": {
"expression": {
"type": "string",
"description": "minute hour day-of-month month day-of-week, for example \"*/15 9-17 * * 1-5\". When both day fields are restricted, a date matches if either one matches."
},
"time_zone": {
"type": "string",
"description": "UTC or IANA Area/Location, for example Asia/Shanghai."
}
},
"required": [
"expression",
"time_zone"
]
},
"at": {
"oneOf": [
{
"type": "string"
},
{
"type": "object",
"additionalProperties": false,
"properties": {
"date": {
"type": "string"
},
"time": {
"type": "string"
},
"time_zone": {
"type": "string"
}
},
"required": [
"date",
"time",
"time_zone"
]
}
],
"description": "Absolute target: an RFC 3339 date-time with offset, or a local date, time, and IANA time_zone."
}
},
"required": [
"id"
]
}
},
{
"name": "send_message",
"description": "Send a message to an agent. A working agent receives it at its next step; an idle agent starts a new turn with it. Returns delivery confirmation, not the agent's answer.",
@@ -536,10 +803,14 @@
},
{
"name": "subagent",
"description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. It runs in the background by default and returns a subagent id you can continue with `send_message`; you are notified when the run settles.",
"description": "Delegate a self-contained task to a subagent (a separate agent that works in its own context) to offload focused, independent work — research, a scoped implementation, an analysis — so it does not consume this conversation's context. The subagent returns its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. The runtime notifies you when it finishes. The child reports results with `send_message`; use `send_message` to steer it while running or continue its conversation after it finishes.",
"parameters": {
"type": "object",
"properties": {
"cwd": {
"type": "string",
"description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
},
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display."
@@ -547,10 +818,6 @@
"prompt": {
"type": "string",
"description": "The complete, self-contained task for the subagent. It does not share this conversation's context, so include everything it needs."
},
"run_in_background": {
"type": "boolean",
"description": "Defaults to true. Set false only when your next action depends on the result."
}
},
"required": [
@@ -561,10 +828,14 @@
},
{
"name": "subagent_fork",
"description": "Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. It runs in the background by default and returns a subagent id you can continue with `send_message`; you are notified when the run settles.",
"description": "Delegate a task to a subagent that inherits this conversation: a child agent seeded with all completed turns so far (it does not see the current in-flight turn). Use this when the subtask builds on this conversation's context — a follow-up analysis, a review, a continuation — without consuming this conversation's context for the work itself. You receive its result, not its intermediate steps. This tool starts an independently managed subagent and immediately returns its id. The runtime notifies you when it finishes. The child reports results with `send_message`; use `send_message` to steer it while running or continue its conversation after it finishes.",
"parameters": {
"type": "object",
"properties": {
"cwd": {
"type": "string",
"description": "Initial child working directory. Relative paths use your current directory; omitted inherits it. Later directory changes in either agent are independent."
},
"description": {
"type": "string",
"description": "A short (3-5 word) description of the delegated task, for display."
@@ -572,10 +843,6 @@
"prompt": {
"type": "string",
"description": "The task for the subagent. It already sees this conversation's completed turns, so build on them freely and state only what is new."
},
"run_in_background": {
"type": "boolean",
"description": "Defaults to true. Set false only when your next action depends on the result."
}
},
"required": [
@@ -781,6 +1048,19 @@
]
}
},
{
"name": "working_directory",
"description": "Read the current working directory, or change it with cd. Relative paths use the current directory. Existing shells and running processes keep their own directories.",
"parameters": {
"type": "object",
"properties": {
"cd": {
"type": "string",
"description": "Existing directory to enter. Omit to read the current directory."
}
}
}
},
{
"name": "write",
"description": "Create or fully replace a UTF-8 text file.",
@@ -789,7 +1069,7 @@
"properties": {
"file_path": {
"type": "string",
"description": "Path to write, resolved by the filesystem backend."
"description": "Path to write, resolved by the filesystem backend. Provide `file_path` before `content` in the arguments."
},
"content": {
"type": "string",