chore: 同步 DSH 0.2.2-rc.3 原版提示词快照、补充样式清理并升级至 v0.2.9

This commit is contained in:
yexi committed 2026-11-15 10:33:19 +08:00
1 parent 1383c6c168
commit c7afd4e03d
29 files changed
+518 -187

No files matched your search

+84 -27
View File
@@ -30,7 +30,7 @@ Only create or modify scheduled tasks at the user's explicit request; prior expl
Start independent delegations with `subagent` or `subagent_fork` together in one assistant message and continue useful work while they run. When only waiting for their results remains, end your turn instead of sleeping or polling; the next result starts a new turn. Collect the subagent results required to complete the task before giving the user a final answer.
Agents may use different working directories; changes to shared files affect other agents. Split parallel write work into disjoint file or directory scopes. Bash, formatters, code generators, and scripts can overwrite concurrent edits without conflict detection; coordinate their changes explicitly. The agent integrating the work must review the final diff and run relevant tests.
Bash, formatters, code generators, and scripts can overwrite concurrent edits without conflict detection; coordinate their changes explicitly. The agent integrating the work must review the final diff and run relevant tests.
## Writing code for run_code
@@ -38,16 +38,20 @@ Agents may use different working directories; changes to shared files affect oth
Inside the program:
- Call tools as `await tools.name(args)` — quoted access for exotic names: `tools["my-tool"](args)`. Every call resolves to the tool's typed canonical JSON value. Tool arguments must be lossless JSON.
- Call tools as `await tools.name(args)` — quoted access for exotic names: `tools["my-tool"](args)`. Every call resolves to its declared value, which may be an Image. Tool arguments must be lossless JSON.
- A FAILED tool call rejects with `ToolCallError`, whose `toolName` identifies the failed tool and whose `message` is human-readable — `try/catch` it to handle and continue.
- Independent read-only calls MAY overlap under `Promise.all` (safe calls run concurrently; mutating calls run alone, in submission order). Sequence dependent work with `await`.
- Emit results with `return` and/or `console.log(...)`. Only what you print or return is program output. A successful tool result containing an image is attached after the run so you can inspect it on the next step; every other intermediate result stays out of the conversation, so extract just what you need.
- Show selected values and images with `inspect(...values)`; every other intermediate result stays out of the conversation, so extract just what you need.
Program-only SDK bindings:
```ts
type JsonValue = null | boolean | number | string | JsonValue[] | { [key: string]: JsonValue }
declare class Image { private constructor(); readonly attachmentId: string; readonly path: string; readonly width: number; readonly height: number; }
declare function inspect(...values: unknown[]): void;
interface ToolArgsMap {
/** Ask the user a concise question when you need confirmation, a choice, or missing information before proceeding. An answer item with empty selected and no custom means the user skipped that question: continue without it, do not ask it again, and do not treat the skip as permission. */
ask_user_question: {
@@ -115,11 +119,6 @@ interface ToolArgsMap {
/** One glob filter for which files to search (e.g. "*.ts", "*.{js,jsx}"). Not a list; negation is not supported. */
include?: string;
} & Record<string, JsonValue>;
/** Ask a subagent to stop its current work. This call returns without waiting for it to stop. You can continue a local subagent's conversation later with send_message. External executions stop permanently and cannot receive follow-ups. Subagents it started will keep running. */
interrupt_agent: {
/** The name of an agent created under you: your direct child or a deeper descendant. */
agent: string;
} & Record<string, JsonValue>;
/** Request cancellation of a running background job. */
job_kill: {
/** Job id returned by the tool that started the background work. */
@@ -147,6 +146,35 @@ interface ToolArgsMap {
/** Exact model id; requires provider. */
model?: string;
} & Record<string, JsonValue>;
/** Convert a document to another format. Return a temporary file to copy to its destination with the shell. */
office_convert: {
/** Path to doc, docx, odt, xls, xlsx, ods, ppt, pptx, or odp; not modified. */
input: string;
/** Word: pdf, docx, odt, txt. Excel: pdf, xlsx, ods, csv. PowerPoint: pdf, pptx, odp. */
format: "pdf" | "docx" | "odt" | "txt" | "xlsx" | "ods" | "csv" | "pptx" | "odp";
/** Exact worksheet name for CSV only; required when the workbook has several sheets. */
sheet?: string;
} & Record<string, JsonValue>;
/** Recalculate spreadsheet formulas. Return a temporary workbook to copy to its destination with the shell. */
office_recalculate: {
/** Path to an xls, xlsx, or ods workbook; not modified. */
input: string;
/** Output workbook format. */
format: "xlsx" | "ods";
} & Record<string, JsonValue>;
/** Render document pages, slides, or worksheet areas as images you can view. */
office_render: {
/** Path to doc, docx, odt, xls, xlsx, ods, ppt, pptx, odp, or pdf; not modified. */
input: string;
/** Distinct one-based pages or slides; omit for all. Spreadsheets use sheet and range instead. */
pages?: number[];
/** Exact worksheet name; omit to render every visible sheet. */
sheet?: string;
/** A1 range, such as A1:H40; requires sheet. Omit for the used area. */
range?: string;
/** Resolution from 24 to 600; default 144. */
dpi?: number;
} & Record<string, JsonValue>;
/** Declare existing files as final deliverables for the user. Hosts may show presented files only after your turn ends, so call it once the files are final. If the user needs to review files earlier, such as before a tool call that waits for their answer, link them in your message instead. Use it when the user needs a separate file, especially Office documents, spreadsheets, and slide decks; prefer your final response when that suffices. The user opens the current files; their contents are not copied. */
present: {
/** Usually the 1-2 most important deliverables; at most 4 per call. */
@@ -442,9 +470,6 @@ interface ToolOutputMap {
line: string;
}[];
};
interrupt_agent: {
accepted: boolean;
};
job_kill: {
outcome: "cancellation-requested" | "already-finished";
job: {
@@ -484,6 +509,53 @@ interface ToolOutputMap {
description?: string;
})[];
list_subagent_models: string;
office_convert: {
operation: "convert";
/** Canonical absolute input path. */
path: string;
/** Absolute path of the temporary output file. */
file: string;
format: "pdf" | "docx" | "odt" | "txt" | "xlsx" | "ods" | "csv" | "pptx" | "odp";
bytes: number;
/** Page count the converter reports for the output. */
pageCount?: number;
missingFonts: string[];
};
office_recalculate: {
operation: "recalculate";
/** Canonical absolute input path. */
path: string;
/** Absolute path of the temporary output file. */
file: string;
format: "xlsx" | "ods";
bytes: number;
/** Page count the converter reports for the output. */
pageCount?: number;
missingFonts: string[];
};
office_render: {
operation: "render";
/** Canonical absolute input path. */
path: string;
/** Pages or slides of a document, or visible worksheets. */
pageCount: number;
dpi: number;
images: ({
page?: number;
sheet?: string;
range?: string;
attachmentId: string;
mediaType: "image/png" | "image/jpeg" | "image/webp";
bytes: number;
width: number;
height: number;
originalDimensions?: {
width: number;
height: number;
};
})[];
missingFonts: string[];
};
present: {
turn: number;
files: {
@@ -537,22 +609,7 @@ interface ToolOutputMap {
}[];
totalLines: number;
};
read_image: {
/** Canonical absolute path in the filesystem execution world. */
path: string;
image: {
attachmentId: string;
mediaType: "image/png" | "image/jpeg" | "image/webp" | "image/gif";
bytes: number;
width: number;
height: number;
name?: string;
originalDimensions?: {
width: number;
height: number;
};
};
};
read_image: Image;
schedule_create: {
id: string;
title: string;