better-dsh 0.0.0 → 0.2.3

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.
Files changed (142) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +294 -4
  3. package/control-prompt.md +37 -0
  4. package/cordis.patch.yml +53 -0
  5. package/docs/00_adr/0001-bridge-tool-layer-not-service-layer.md +14 -0
  6. package/docs/00_adr/0002-masking-is-presentation-only.md +15 -0
  7. package/docs/10_plans/A2A-messaging-channel-test-archive.md +256 -0
  8. package/docs/10_plans/code-mode-vs-rlm-ipython-comparison.md +137 -0
  9. package/docs/10_plans/dashr-blueprint-review.md +201 -0
  10. package/docs/10_plans/dashr-blueprint.md +561 -0
  11. package/docs/10_plans/dashr-compaction-window-and-archive.md +307 -0
  12. package/docs/10_plans/dashr-profile-layer-feasibility.md +367 -0
  13. package/docs/10_plans/dashr-sandbox-escalation-semantics-gap.md +171 -0
  14. package/docs/10_plans/dashr-security-sandbox-analysis.md +187 -0
  15. package/docs/10_plans/dashr-surface-invariant-and-omp-imports.md +97 -0
  16. package/docs/10_plans/ipython-kernel-interactive-interface-test-report.md +152 -0
  17. package/docs/10_plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft.md +146 -0
  18. package/docs/10_plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v3.md +50 -0
  19. package/docs/10_plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v4.md +79 -0
  20. package/docs/10_plans/kernel-refactoring/Dash-vs-PrimeAgent-systemprompt-toolcatalog-comparison.md +138 -0
  21. package/docs/10_plans/kernel-refactoring/RLM-system-prompt-injection-gap-report.md +161 -0
  22. package/docs/10_plans/kernel-refactoring/V0.1.5-development-plan.md +109 -0
  23. package/docs/10_plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_dsh.md +50 -0
  24. package/docs/10_plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_prime.md +113 -0
  25. package/docs/10_plans/recallable-compaction.md +147 -0
  26. package/docs/10_plans/spike-tag-repro.mjs +102 -0
  27. package/docs/10_plans/upstream-analysis.md +128 -0
  28. package/docs/50_test-reports/REPL-/345/267/245/345/205/267/350/260/203/347/224/250-/346/210/252/346/226/255/350/257/212/346/226/255.md +110 -0
  29. package/docs/50_test-reports/kernel-provisioning.md +44 -0
  30. package/docs/50_test-reports/repl-kernel-provisioning-test-report.md +87 -0
  31. package/docs/50_test-reports/upstream-dsh-0.1.2-alpha.5-local-test-report.md +81 -0
  32. package/docs/50_test-reports/upstream-dsh-0.1.2-alpha.5-report.md +93 -0
  33. package/docs/50_test-reports/v0.1.8-improved-/345/256/236/346/265/213/346/212/245/345/221/212.md +142 -0
  34. package/docs/50_test-reports/v0.1.8-/345/256/236/346/265/213/346/212/245/345/221/212.md +193 -0
  35. package/docs/50_test-reports/v0.1.8b-/345/256/236/346/265/213/346/212/245/345/221/212.md +96 -0
  36. package/docs/50_test-reports/v0.1.8c-/345/256/236/346/265/213/346/212/245/345/221/212.md +127 -0
  37. package/docs/50_test-reports/v0.1.8d-/345/256/236/346/265/213/346/212/245/345/221/212.md +150 -0
  38. package/docs/50_test-reports/v0.1.8d_artifacts/README.md +138 -0
  39. package/docs/50_test-reports/v0.1.8d_artifacts/code-mode-repl-only.observation.md +74 -0
  40. package/docs/50_test-reports/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.jsonl +3890 -0
  41. package/docs/50_test-reports/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.w-sample-0435.jsonl +544 -0
  42. package/docs/50_test-reports/v0.1.8d_artifacts/functions.json +592 -0
  43. package/docs/50_test-reports/v0.1.8d_artifacts/skills-catalog.snapshot.md +30 -0
  44. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.output-schemas.json +1236 -0
  45. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.python.txt +592 -0
  46. package/docs/50_test-reports/v0.1.8d_artifacts/tools-sdk.typescript.txt +516 -0
  47. package/docs/50_test-reports/v0.1.8d_artifacts/wire-vs-transcription.diff.md +54 -0
  48. package/docs/50_test-reports/v0.1.8e-/345/256/236/346/265/213/346/212/245/345/221/212.md +224 -0
  49. package/docs/50_test-reports/v0.1.9a-/345/256/236/346/265/213/346/212/245/345/221/212.md +168 -0
  50. package/docs/50_test-reports/v0.2.0b-/345/256/236/346/265/213/346/212/245/345/221/212.md +123 -0
  51. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/Cargo.lock +7 -0
  52. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/Cargo.toml +6 -0
  53. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/src/bin/messy.rs +8 -0
  54. package/docs/50_test-reports/v0.2.0b_artifacts/f2probe/src/main.rs +4 -0
  55. package/docs/50_test-reports/v0.2.0b_artifacts/hashline-probe.md +5 -0
  56. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/Cargo.lock +7 -0
  57. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/Cargo.toml +7 -0
  58. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/build.rs +4 -0
  59. package/docs/50_test-reports/v0.2.0b_artifacts/slowprobe/src/main.rs +13 -0
  60. package/docs/50_test-reports/v0.2.1-/345/256/236/346/265/213/346/212/245/345/221/212.md +110 -0
  61. package/docs/50_test-reports/v0.2.1b-/345/256/236/346/265/213/346/212/245/345/221/212.md +86 -0
  62. package/docs/50_test-reports/v0.2.1c-/345/256/236/346/265/213/346/212/245/345/221/212.md +66 -0
  63. package/docs/50_test-reports/v0.2.1d-/345/256/236/346/265/213/346/212/245/345/221/212.md +67 -0
  64. package/docs/50_test-reports/v0.2.1e-P1-/345/256/236/346/265/213/346/212/245/345/221/212.md +136 -0
  65. package/docs/50_test-reports/v0.2.1ef-dev-audit-report.md +73 -0
  66. package/docs/50_test-reports/v0.2.1f-plugin-shipped-ui-patches/345/256/236/346/265/213/346/212/245/345/221/212.md +102 -0
  67. package/docs/60_exploration-and-research/cordis-research.md +350 -0
  68. package/docs/60_exploration-and-research/dsh-web-profile-package-map.md +186 -0
  69. package/docs/60_exploration-and-research/dsh-web-ui-slot-system-research.md +310 -0
  70. package/docs/60_exploration-and-research/dsh-webui-strip-boundary-research.md +300 -0
  71. package/docs/60_exploration-and-research/ios-chat-app-bridge-research.md +324 -0
  72. package/docs/60_exploration-and-research/web-frontend-composability-research.md +191 -0
  73. package/docs/REPL-/345/267/245/345/205/267/350/260/203/347/224/250-/346/210/252/346/226/255/350/257/212/346/226/255.md +110 -0
  74. package/docs/adr/0001-bridge-tool-layer-not-service-layer.md +14 -0
  75. package/docs/adr/0002-masking-is-presentation-only.md +15 -0
  76. package/docs/distro-blueprint.md +81 -0
  77. package/docs/dsh-webUI-with-rlm-mode.png +0 -0
  78. package/docs/plans/A2A-messaging-channel-test-archive.md +256 -0
  79. package/docs/plans/code-mode-vs-rlm-ipython-comparison.md +137 -0
  80. package/docs/plans/dashr-blueprint-review.md +201 -0
  81. package/docs/plans/dashr-blueprint.md +561 -0
  82. package/docs/plans/dashr-compaction-window-and-archive.md +307 -0
  83. package/docs/plans/dashr-profile-layer-feasibility.md +367 -0
  84. package/docs/plans/dashr-sandbox-escalation-semantics-gap.md +171 -0
  85. package/docs/plans/dashr-security-sandbox-analysis.md +187 -0
  86. package/docs/plans/dashr-surface-invariant-and-omp-imports.md +97 -0
  87. package/docs/plans/ipython-kernel-interactive-interface-test-report.md +152 -0
  88. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft.md +146 -0
  89. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v3.md +50 -0
  90. package/docs/plans/kernel-refactoring/Dash-IPython-Control-Prompt-draft_v4.md +79 -0
  91. package/docs/plans/kernel-refactoring/Dash-vs-PrimeAgent-systemprompt-toolcatalog-comparison.md +138 -0
  92. package/docs/plans/kernel-refactoring/RLM-system-prompt-injection-gap-report.md +161 -0
  93. package/docs/plans/kernel-refactoring/V0.1.5-development-plan.md +109 -0
  94. package/docs/plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_dsh.md +50 -0
  95. package/docs/plans/kernel-refactoring/actinoable-surface-to-llm-in-agent-runtime_prime.md +113 -0
  96. package/docs/plans/recallable-compaction.md +147 -0
  97. package/docs/plans/spike-tag-repro.mjs +102 -0
  98. package/docs/plans/upstream-analysis.md +128 -0
  99. package/docs/repositioning-and-rebranding.md +102 -0
  100. package/docs/v0.1.8-improved-/345/256/236/346/265/213/346/212/245/345/221/212.md +142 -0
  101. package/docs/v0.1.8-/345/256/236/346/265/213/346/212/245/345/221/212.md +193 -0
  102. package/docs/v0.1.8b-/345/256/236/346/265/213/346/212/245/345/221/212.md +96 -0
  103. package/docs/v0.1.8c-/345/256/236/346/265/213/346/212/245/345/221/212.md +127 -0
  104. package/docs/v0.1.8d-/345/256/236/346/265/213/346/212/245/345/221/212.md +150 -0
  105. package/docs/v0.1.8d_artifacts/README.md +138 -0
  106. package/docs/v0.1.8d_artifacts/code-mode-repl-only.observation.md +74 -0
  107. package/docs/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.jsonl +3890 -0
  108. package/docs/v0.1.8d_artifacts/dsh-session-session-4a293388-9ae1-474b-87a0-9e17bb556d94.w-sample-0435.jsonl +544 -0
  109. package/docs/v0.1.8d_artifacts/functions.json +592 -0
  110. package/docs/v0.1.8d_artifacts/skills-catalog.snapshot.md +30 -0
  111. package/docs/v0.1.8d_artifacts/tools-sdk.output-schemas.json +1236 -0
  112. package/docs/v0.1.8d_artifacts/tools-sdk.python.txt +592 -0
  113. package/docs/v0.1.8d_artifacts/tools-sdk.typescript.txt +516 -0
  114. package/docs/v0.1.8d_artifacts/wire-vs-transcription.diff.md +54 -0
  115. package/docs/v0.1.8e-/345/256/236/346/265/213/346/212/245/345/221/212.md +224 -0
  116. package/docs/v0.1.9a-/345/256/236/346/265/213/346/212/245/345/221/212.md +168 -0
  117. package/docs/v0.2.0b-/345/256/236/346/265/213/346/212/245/345/221/212.md +123 -0
  118. package/docs/v0.2.0b_artifacts/f2probe/Cargo.lock +7 -0
  119. package/docs/v0.2.0b_artifacts/f2probe/Cargo.toml +6 -0
  120. package/docs/v0.2.0b_artifacts/f2probe/src/bin/messy.rs +8 -0
  121. package/docs/v0.2.0b_artifacts/f2probe/src/main.rs +4 -0
  122. package/docs/v0.2.0b_artifacts/hashline-probe.md +5 -0
  123. package/docs/v0.2.0b_artifacts/slowprobe/Cargo.lock +7 -0
  124. package/docs/v0.2.0b_artifacts/slowprobe/Cargo.toml +7 -0
  125. package/docs/v0.2.0b_artifacts/slowprobe/build.rs +4 -0
  126. package/docs/v0.2.0b_artifacts/slowprobe/src/main.rs +13 -0
  127. package/docs/v0.2.1-/345/256/236/346/265/213/346/212/245/345/221/212.md +110 -0
  128. package/docs/v0.2.1b-/345/256/236/346/265/213/346/212/245/345/221/212.md +86 -0
  129. package/docs/v0.2.1c-/345/256/236/346/265/213/346/212/245/345/221/212.md +66 -0
  130. package/lib/client/index.js +473 -0
  131. package/lib/index.d.ts +736 -0
  132. package/lib/index.js +11518 -0
  133. package/lib/kernel-env-hxaihi9C.js +195 -0
  134. package/lib/kernel-env.d.ts +80 -0
  135. package/lib/kernel-env.js +3 -0
  136. package/lib/py-sdk-BCaOGYz7.d.ts +125 -0
  137. package/lib/py-sdk-CbgYiX8O.js +691 -0
  138. package/lib/py-sdk.d.ts +2 -0
  139. package/lib/py-sdk.js +3 -0
  140. package/package.json +325 -4
  141. package/scripts/kernel-provision.mjs +35 -0
  142. package/index.js +0 -3
@@ -0,0 +1,592 @@
1
+ ## Writing code for run_code
2
+
3
+ `run_code` takes two required arguments: `code` — the body of an async Python function (top-level `await` and `return` both work) — and `description`, a short summary of what the program does. At run time exactly two of the names declared below are bound: `tools` and `ToolCallError`. Everything else is a STATIC STUB describing argument and return types — in particular the `TypedDict` classes do NOT exist at run time, so build arguments as plain `dict`/`list` JSON values: `await tools.name({"field": 1})`, never `FooArgs(field=1)`, which raises `NameError`. Inside the program:
4
+
5
+ - Call tools as `await tools.name(args)` — subscript access for exotic, reserved, or underscore-leading names: `await tools["my-tool"](args)`. Every call resolves to the tool's typed canonical JSON value (each method's return type below). Tool arguments must be lossless JSON.
6
+ - A FAILED tool call raises `ToolCallError`, whose `toolName` identifies the failed tool and whose message is human-readable — wrap in `try/except` to handle and continue.
7
+ - Independent read-only calls MAY overlap under `asyncio.gather` (safe calls run concurrently; mutating calls run alone, in submission order). Sequence dependent work with `await`.
8
+ - Emit the run's answer with `print(...)` and/or a top-level `return <value>`; the returned value must be lossless JSON. Only what you print and 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.
9
+
10
+ The available tools:
11
+
12
+ ```python
13
+ from typing import Any, Literal, NotRequired, Protocol, TypedDict
14
+
15
+ class ToolCallError(Exception):
16
+ toolName: str
17
+
18
+ class AskUserQuestionArgsQuestionsOptions(TypedDict):
19
+ # Short user-facing option label.
20
+ label: str
21
+ # One sentence explaining the tradeoff or impact.
22
+ description: NotRequired[str]
23
+ # Additional keys beyond those declared are allowed.
24
+
25
+ class AskUserQuestionArgsQuestions(TypedDict):
26
+ # Stable id for this question; echoed in the answer.
27
+ id: str
28
+ # The specific question to ask the user.
29
+ question: str
30
+ # Optional short heading for the question, such as "Confirm" or "Choose Mode".
31
+ header: NotRequired[str]
32
+ # Optional choices to show the user. If you recommend one, put it first and append "(Recommended)" to that label.
33
+ options: NotRequired[list[AskUserQuestionArgsQuestionsOptions]]
34
+ # Whether the user may select more than one option. Defaults to false.
35
+ multi_select: NotRequired[bool]
36
+ # Additional keys beyond those declared are allowed.
37
+
38
+ class AskUserQuestionArgs(TypedDict):
39
+ # Questions to ask the user before continuing.
40
+ questions: list[AskUserQuestionArgsQuestions]
41
+ # Additional keys beyond those declared are allowed.
42
+
43
+ class AskUserQuestionOutputAnswers(TypedDict):
44
+ id: str
45
+ selected: list[str]
46
+ custom: NotRequired[str]
47
+
48
+ class AskUserQuestionOutput(TypedDict):
49
+ answers: list[AskUserQuestionOutputAnswers]
50
+
51
+ class BashArgs(TypedDict):
52
+ # The bash command to execute.
53
+ command: str
54
+ # 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"; "npm install" → "Install package dependencies".
55
+ description: str
56
+ # Timeout in milliseconds. The executor applies its configured default and cap, and kills the command on expiry.
57
+ timeoutMs: NotRequired[float]
58
+ # Working directory for this command. Defaults to the session workspace; a relative path is resolved against it.
59
+ workdir: NotRequired[str]
60
+ # Run in the background and return a job id immediately (collect with job_output, stop with job_kill). No timeout applies.
61
+ run_in_background: NotRequired[bool]
62
+ # The wider sandbox mode this command needs. Only valid as a one-shot retry of a command the sandbox just denied; requires justification and user approval.
63
+ sandbox_permissions: NotRequired[Literal["workspace-write", "danger-full-access"]]
64
+ # Required with sandbox_permissions: one sentence for the user explaining why this exact command needs the wider access.
65
+ justification: NotRequired[str]
66
+ # Additional keys beyond those declared are allowed.
67
+
68
+ class BashOutput1(TypedDict):
69
+ kind: Literal["background"]
70
+ jobId: str
71
+
72
+ class BashOutput2Stdout(TypedDict):
73
+ text: str
74
+ truncated: bool
75
+ spillPath: NotRequired[str]
76
+
77
+ class BashOutput2Stderr(TypedDict):
78
+ text: str
79
+ truncated: bool
80
+ spillPath: NotRequired[str]
81
+
82
+ class BashOutput2Sandbox(TypedDict):
83
+ mode: str
84
+ denied: bool
85
+ enforcement: NotRequired[str]
86
+ runnerFailed: NotRequired[bool]
87
+
88
+ class BashOutput2(TypedDict):
89
+ kind: Literal["foreground"]
90
+ exitCode: int | None
91
+ signal: str | None
92
+ timedOut: bool
93
+ aborted: bool
94
+ timeoutMs: float
95
+ stdout: BashOutput2Stdout
96
+ stderr: BashOutput2Stderr
97
+ sandbox: NotRequired[BashOutput2Sandbox]
98
+
99
+ class CreateGoalArgs(TypedDict):
100
+ # The concrete completion objective inferred from the direct human request.
101
+ objective: str
102
+ # Optional positive safe-integer limit on automatic continuation rounds.
103
+ max_goal_rounds: NotRequired[float]
104
+ # Additional keys beyond those declared are allowed.
105
+
106
+ class CreateGoalOutput1(TypedDict):
107
+ goal: None
108
+
109
+ class CreateGoalOutput2GoalBlockedReason(TypedDict):
110
+ code: str
111
+ message: str
112
+
113
+ class CreateGoalOutput2Goal(TypedDict):
114
+ id: str
115
+ revision: int
116
+ objective: str
117
+ phase: Literal["active", "paused", "blocked", "complete"]
118
+ roundsStarted: int
119
+ maxGoalRounds: int
120
+ blockedReason: NotRequired[CreateGoalOutput2GoalBlockedReason]
121
+
122
+ class CreateGoalOutput2(TypedDict):
123
+ goal: CreateGoalOutput2Goal
124
+ activation: Literal["armed", "disarmed"]
125
+
126
+ class EditArgs(TypedDict):
127
+ # Path to edit, resolved by the filesystem backend.
128
+ file_path: str
129
+ # Literal text to replace. Must match exactly.
130
+ old_string: str
131
+ # Literal replacement text. Use an empty string to delete the match.
132
+ new_string: str
133
+ # Replace all matches. Defaults to false; when false, old_string must appear exactly once.
134
+ replace_all: NotRequired[bool]
135
+ # The wider sandbox mode this file operation needs. Only valid as a one-shot retry of an operation the sandbox just denied; requires justification and user approval.
136
+ sandbox_permissions: NotRequired[Literal["workspace-write", "danger-full-access"]]
137
+ # Required with sandbox_permissions: one sentence for the user explaining why this exact file operation needs the wider access.
138
+ justification: NotRequired[str]
139
+ # Additional keys beyond those declared are allowed.
140
+
141
+ class EditOutput(TypedDict):
142
+ path: str
143
+ before: str
144
+ after: str
145
+
146
+ class ExitPlanModeArgs(TypedDict):
147
+ # The complete plan, as markdown, starting with a # heading that names it.
148
+ plan: str
149
+ # Additional keys beyond those declared are allowed.
150
+
151
+ class ExitPlanModeOutput(TypedDict):
152
+ approved: Literal[True]
153
+
154
+ class GetGoalOutput1(TypedDict):
155
+ goal: None
156
+
157
+ class GetGoalOutput2GoalBlockedReason(TypedDict):
158
+ code: str
159
+ message: str
160
+
161
+ class GetGoalOutput2Goal(TypedDict):
162
+ id: str
163
+ revision: int
164
+ objective: str
165
+ phase: Literal["active", "paused", "blocked", "complete"]
166
+ roundsStarted: int
167
+ maxGoalRounds: int
168
+ blockedReason: NotRequired[GetGoalOutput2GoalBlockedReason]
169
+
170
+ class GetGoalOutput2(TypedDict):
171
+ goal: GetGoalOutput2Goal
172
+ activation: Literal["armed", "disarmed"]
173
+
174
+ class GlobArgs(TypedDict):
175
+ # Glob pattern to match file paths against (e.g. "**/*.ts", "src/**/*.test.js"). A pattern with no "/" matches the basename at any depth, so "*" and "*.ts" both search the whole tree; include a separator to anchor the depth.
176
+ pattern: str
177
+ # Directory to search in. Defaults to the session workspace; a relative path resolves against it.
178
+ path: NotRequired[str]
179
+ # Additional keys beyond those declared are allowed.
180
+
181
+ class GlobOutput(TypedDict):
182
+ root: str
183
+ paths: list[str]
184
+
185
+ class GrepArgs(TypedDict):
186
+ # Regular expression to search for (ripgrep syntax).
187
+ pattern: str
188
+ # File or directory to search. Defaults to the session workspace; a relative path resolves against it.
189
+ path: NotRequired[str]
190
+ # One glob filter for which files to search (e.g. "*.ts", "*.{js,jsx}"). Not a list; negation is not supported.
191
+ include: NotRequired[str]
192
+ # Additional keys beyond those declared are allowed.
193
+
194
+ class GrepOutputMatches(TypedDict):
195
+ path: str
196
+ lineNumber: int
197
+ line: str
198
+
199
+ class GrepOutput(TypedDict):
200
+ matches: list[GrepOutputMatches]
201
+
202
+ class InterruptAgentArgs(TypedDict):
203
+ # The agent id of the running agent to interrupt.
204
+ agent_id: str
205
+ # Additional keys beyond those declared are allowed.
206
+
207
+ class InterruptAgentOutput(TypedDict):
208
+ accepted: bool
209
+
210
+ class JobKillArgs(TypedDict):
211
+ # Job id returned by the tool that started the background work.
212
+ job_id: str
213
+ # Optional short reason, recorded in the log and forwarded to the job.
214
+ reason: NotRequired[str]
215
+ # Additional keys beyond those declared are allowed.
216
+
217
+ class JobKillOutputJob(TypedDict):
218
+ id: str
219
+ kind: str
220
+ label: str
221
+ status: Literal["running", "stopping", "completed", "killed", "failed"]
222
+ detail: NotRequired[str]
223
+ startedAt: int
224
+ finishedAt: NotRequired[int]
225
+
226
+ class JobKillOutput(TypedDict):
227
+ outcome: Literal["cancellation-requested", "already-finished"]
228
+ job: JobKillOutputJob
229
+
230
+ class JobListOutput(TypedDict):
231
+ id: str
232
+ kind: str
233
+ label: str
234
+ status: Literal["running", "stopping", "completed", "killed", "failed"]
235
+ detail: NotRequired[str]
236
+ startedAt: int
237
+ finishedAt: NotRequired[int]
238
+
239
+ class JobOutputArgs(TypedDict):
240
+ # Job id returned by the tool that started the background work.
241
+ job_id: str
242
+ # Block until the job reaches a terminal status or the timeout expires. A timed-out wait returns [status: running] and leaves the job alive.
243
+ wait: NotRequired[bool]
244
+ # Max wait in milliseconds (only meaningful with wait: true). Defaults to the configured wait timeout; capped by the configured maximum.
245
+ timeout_ms: NotRequired[float]
246
+ # Additional keys beyond those declared are allowed.
247
+
248
+ class JobOutputOutputJob(TypedDict):
249
+ id: str
250
+ kind: str
251
+ label: str
252
+ status: Literal["running", "stopping", "completed", "killed", "failed"]
253
+ detail: NotRequired[str]
254
+ startedAt: int
255
+ finishedAt: NotRequired[int]
256
+
257
+ class JobOutputOutput(TypedDict):
258
+ text: str
259
+ job: JobOutputOutputJob
260
+
261
+ class ListAgentsArgs(TypedDict):
262
+ # children (default) lists direct children only; descendants walks the complete tree below you.
263
+ scope: NotRequired[Literal["children", "descendants"]]
264
+ # Additional keys beyond those declared are allowed.
265
+
266
+ class ListAgentsOutput1(TypedDict):
267
+ kind: Literal["child"]
268
+ id: str
269
+ label: str
270
+ status: Literal["running", "idle", "ready"]
271
+ parent: NotRequired[str]
272
+ depth: NotRequired[float]
273
+
274
+ class ListAgentsOutput2(TypedDict):
275
+ kind: Literal["diagnostic"]
276
+ id: str
277
+ reason: Literal["corrupt", "unsupported", "unavailable"]
278
+ parent: NotRequired[str]
279
+ depth: NotRequired[float]
280
+
281
+ class RalphArgs(TypedDict):
282
+ # The immutable completion objective for every fresh Ralph round.
283
+ objective: str
284
+ # Optional positive safe-integer round cap, bounded by the deployment ceiling.
285
+ maxRounds: NotRequired[float]
286
+ # Additional keys beyond those declared are allowed.
287
+
288
+ class RalphOutput(TypedDict):
289
+ runId: str
290
+ agentsStarted: int
291
+ result: Any
292
+
293
+ class ReadArgs(TypedDict):
294
+ # Path to read, resolved by the filesystem backend.
295
+ file_path: str
296
+ # 1-based first line to return. Defaults to 1.
297
+ offset: NotRequired[float]
298
+ # Maximum number of lines to return. Defaults to 2000.
299
+ limit: NotRequired[float]
300
+ # Additional keys beyond those declared are allowed.
301
+
302
+ class ReadOutputLines(TypedDict):
303
+ number: int
304
+ text: str
305
+
306
+ class ReadOutput(TypedDict):
307
+ path: str
308
+ offset: int
309
+ lines: list[ReadOutputLines]
310
+ totalLines: int
311
+
312
+ class ReadImageArgs(TypedDict):
313
+ # Path to the image file, resolved by the filesystem backend.
314
+ file_path: str
315
+ # Additional keys beyond those declared are allowed.
316
+
317
+ class ReadImageOutputImageOriginalDimensions(TypedDict):
318
+ width: int
319
+ height: int
320
+
321
+ class ReadImageOutputImage(TypedDict):
322
+ attachmentId: str
323
+ mediaType: Literal["image/png", "image/jpeg", "image/webp", "image/gif"]
324
+ bytes: int
325
+ width: int
326
+ height: int
327
+ name: NotRequired[str]
328
+ originalDimensions: NotRequired[ReadImageOutputImageOriginalDimensions]
329
+
330
+ class ReadImageOutput(TypedDict):
331
+ path: str
332
+ image: ReadImageOutputImage
333
+
334
+ class SendMessageArgs(TypedDict):
335
+ # The subagent id returned when the background subagent was started.
336
+ subagent_id: str
337
+ # The message to deliver to the subagent.
338
+ message: str
339
+ # Additional keys beyond those declared are allowed.
340
+
341
+ class SendMessageOutput(TypedDict):
342
+ messageId: str
343
+
344
+ class SkillArgs(TypedDict):
345
+ # The exact skill name from the available skills list.
346
+ name: str
347
+ # Additional keys beyond those declared are allowed.
348
+
349
+ class SkillOutputResourceBase1(TypedDict):
350
+ kind: Literal["directory"]
351
+ path: str
352
+
353
+ class SkillOutputResourceBase2(TypedDict):
354
+ kind: Literal["url"]
355
+ url: str
356
+
357
+ class SkillOutputResourceBase3(TypedDict):
358
+ kind: Literal["opaque"]
359
+ description: str
360
+
361
+ class SkillOutput(TypedDict):
362
+ name: str
363
+ provider: str
364
+ resourceBase: NotRequired[SkillOutputResourceBase1 | SkillOutputResourceBase2 | SkillOutputResourceBase3]
365
+ content: str
366
+
367
+ class SubagentArgs(TypedDict):
368
+ # A short (3-5 word) description of the delegated task, for display.
369
+ description: str
370
+ # The complete, self-contained task for the subagent. It does not share this conversation's context, so include everything it needs.
371
+ prompt: str
372
+ # Whether to run in the background and return a durable subagent id immediately. Defaults to true. Set false to wait for the result when your next action depends on it.
373
+ run_in_background: NotRequired[bool]
374
+ # Additional keys beyond those declared are allowed.
375
+
376
+ class SubagentOutput1(TypedDict):
377
+ kind: Literal["background"]
378
+ jobId: str
379
+
380
+ class SubagentOutput2(TypedDict):
381
+ kind: Literal["continuable"]
382
+ subagentId: str
383
+
384
+ class SubagentOutput3(TypedDict):
385
+ kind: Literal["foreground"]
386
+ runId: str
387
+ output: list[Any]
388
+
389
+ class SubagentForkArgs(TypedDict):
390
+ # A short (3-5 word) description of the delegated task, for display.
391
+ description: str
392
+ # The task for the subagent. It already sees this conversation's completed turns, so build on them freely and state only what is new.
393
+ prompt: str
394
+ # Whether to run in the background and return a durable subagent id immediately. Defaults to true. Set false to wait for the result when your next action depends on it.
395
+ run_in_background: NotRequired[bool]
396
+ # Additional keys beyond those declared are allowed.
397
+
398
+ class SubagentForkOutput1(TypedDict):
399
+ kind: Literal["background"]
400
+ jobId: str
401
+
402
+ class SubagentForkOutput2(TypedDict):
403
+ kind: Literal["continuable"]
404
+ subagentId: str
405
+
406
+ class SubagentForkOutput3(TypedDict):
407
+ kind: Literal["foreground"]
408
+ runId: str
409
+ output: list[Any]
410
+
411
+ class TodoWriteArgsTodos(TypedDict):
412
+ # What the task is — a short imperative line.
413
+ content: str
414
+ # pending (not started) | in_progress (now) | completed (done).
415
+ status: Literal["pending", "in_progress", "completed"]
416
+
417
+ class TodoWriteArgs(TypedDict):
418
+ # The COMPLETE task list, replacing any previous list.
419
+ todos: list[TodoWriteArgsTodos]
420
+ # Additional keys beyond those declared are allowed.
421
+
422
+ class TodoWriteOutputTodos(TypedDict):
423
+ content: str
424
+ status: Literal["pending", "in_progress", "completed"]
425
+
426
+ class TodoWriteOutputCounts(TypedDict):
427
+ pending: int
428
+ inProgress: int
429
+ completed: int
430
+
431
+ class TodoWriteOutput(TypedDict):
432
+ todos: list[TodoWriteOutputTodos]
433
+ counts: TodoWriteOutputCounts
434
+
435
+ class UpdateGoalArgs(TypedDict):
436
+ # Exact id returned by get_goal.
437
+ goal_id: str
438
+ # Exact positive revision returned by get_goal.
439
+ revision: float
440
+ # edit | pause | resume | complete | blocked
441
+ action: Literal["edit", "pause", "resume", "complete", "blocked"]
442
+ # Replacement objective; valid only with action edit.
443
+ objective: NotRequired[str]
444
+ # Replacement cap; valid only with action edit.
445
+ max_goal_rounds: NotRequired[float]
446
+ # Concrete blocking condition; required only with action blocked.
447
+ blocked_reason: NotRequired[str]
448
+ # Additional keys beyond those declared are allowed.
449
+
450
+ class UpdateGoalOutput1(TypedDict):
451
+ goal: None
452
+
453
+ class UpdateGoalOutput2GoalBlockedReason(TypedDict):
454
+ code: str
455
+ message: str
456
+
457
+ class UpdateGoalOutput2Goal(TypedDict):
458
+ id: str
459
+ revision: int
460
+ objective: str
461
+ phase: Literal["active", "paused", "blocked", "complete"]
462
+ roundsStarted: int
463
+ maxGoalRounds: int
464
+ blockedReason: NotRequired[UpdateGoalOutput2GoalBlockedReason]
465
+
466
+ class UpdateGoalOutput2(TypedDict):
467
+ goal: UpdateGoalOutput2Goal
468
+ activation: Literal["armed", "disarmed"]
469
+
470
+ class WebSearchArgs(TypedDict):
471
+ # Required search queries; accepts 1–4 items and merges their results.
472
+ queries: list[str]
473
+ # Additional keys beyond those declared are allowed.
474
+
475
+ class WebSearchOutputSources(TypedDict):
476
+ url: str
477
+ title: NotRequired[str]
478
+ snippet: NotRequired[str]
479
+ publishedAt: NotRequired[str]
480
+
481
+ class WebSearchOutput(TypedDict):
482
+ content: NotRequired[str]
483
+ sources: list[WebSearchOutputSources]
484
+ truncated: bool
485
+
486
+ class WorkflowArgsMetaPhases(TypedDict):
487
+ # The phase title phase() calls match by exact string.
488
+ title: str
489
+ # Optional one-line description of the phase.
490
+ detail: NotRequired[str]
491
+ # Optional provider override this phase is expected to use.
492
+ provider: NotRequired[str]
493
+ # Optional model override this phase is expected to use.
494
+ model: NotRequired[str]
495
+ # Additional keys beyond those declared are allowed.
496
+
497
+ class WorkflowArgsMeta(TypedDict):
498
+ # Short kebab-case workflow name.
499
+ name: str
500
+ # One-line description of what the workflow does.
501
+ description: str
502
+ # Optional guidance on when this workflow applies.
503
+ whenToUse: NotRequired[str]
504
+ # Optional phase declarations matched by phase() calls.
505
+ phases: NotRequired[list[WorkflowArgsMetaPhases]]
506
+ # Additional keys beyond those declared are allowed.
507
+
508
+ class WorkflowArgs(TypedDict):
509
+ # The plain-JS workflow script body (top-level await allowed; NO `export const meta` statement; end with `return <json-value>`).
510
+ script: str
511
+ # The workflow identity block (plain JSON — never code).
512
+ meta: WorkflowArgsMeta
513
+ # Optional JSON input exposed to the script as the `args` global (wrap a bare list as a field, e.g. {"files": [...]}).
514
+ args: NotRequired[dict[str, Any]]
515
+ # Additional keys beyond those declared are allowed.
516
+
517
+ class WorkflowOutput(TypedDict):
518
+ runId: str
519
+ agentsStarted: int
520
+ result: Any
521
+
522
+ class WriteArgs(TypedDict):
523
+ # Path to write, resolved by the filesystem backend.
524
+ file_path: str
525
+ # Full UTF-8 text content to write.
526
+ content: str
527
+ # The wider sandbox mode this file operation needs. Only valid as a one-shot retry of an operation the sandbox just denied; requires justification and user approval.
528
+ sandbox_permissions: NotRequired[Literal["workspace-write", "danger-full-access"]]
529
+ # Required with sandbox_permissions: one sentence for the user explaining why this exact file operation needs the wider access.
530
+ justification: NotRequired[str]
531
+ # Additional keys beyond those declared are allowed.
532
+
533
+ class WriteOutput(TypedDict):
534
+ path: str
535
+ operation: Literal["create", "update"]
536
+ before: str | None
537
+ after: str
538
+
539
+ class Tools(Protocol):
540
+ async def ask_user_question(self, args: AskUserQuestionArgs) -> AskUserQuestionOutput:
541
+ """Ask the user a concise question when you need confirmation, a choice, or missing information before proceeding. Send one or more questions, each with a stable id that will be echoed in the answer."""
542
+ async def bash(self, args: BashArgs) -> BashOutput1 | BashOutput2:
543
+ """Execute a bash command (`bash -c`) and return its stdout/stderr. Each call runs in a fresh shell: no state (cwd, variables, functions) persists between calls — pass `workdir` instead of using `cd`. Non-zero exits are reported as `[exit code: N]`. Current harness environment facts are exposed through managed `$DSH_*` variables; inspect them when needed. Commands may run under a file sandbox; a blocked file operation is reported as `[sandbox: file access denied under <mode> mode]` — a policy denial, not a bug in the command; do not retry another way. Long output is truncated to its tail; the full output is saved to a file whose path is reported when available. Set `run_in_background: true` for long-running commands: the call returns a job id immediately; read its output with `job_output` and stop it with `job_kill`. Attempting a command the sandbox may deny is safe and expected: run it and read the marker rather than assuming the denial. When a command is denied and a wider mode would let it succeed, escalate immediately in the same turn — the one sanctioned exception to a denial: retry the exact same command once with `sandbox_permissions` (the narrowest wider mode that suffices) plus a one-sentence `justification`. Do not detour through chat to ask permission first — the approval prompt raised by that retry is how the user consents. If the session states approval prompts are disabled, there is no exception: a denial is final — do not set `sandbox_permissions`. Never escalate speculatively: ground the request in a real denial — normally the one this command just hit; escalating up front is fine only when this session already denied the same access. A rejected escalation is final for that command — stop and explain, never work around it — but it does not forbid attempting or escalating other commands later."""
544
+ async def create_goal(self, args: CreateGoalArgs) -> CreateGoalOutput1 | CreateGoalOutput2:
545
+ """Create one persisted same-session completion goal when the current direct human request is a long-running objective that should continue across autonomous goal rounds. You may infer that intent without requiring the user to say \"create a goal\". Do not use this for trivial single-turn work. Execution rejects non-human and subagent authority."""
546
+ async def edit(self, args: EditArgs) -> EditOutput:
547
+ """Edit an existing UTF-8 text file by replacing literal text."""
548
+ async def exit_plan_mode(self, args: ExitPlanModeArgs) -> ExitPlanModeOutput:
549
+ """Use only in plan mode. Present your plan for the user's review and, on approval, leave plan mode. Send the COMPLETE plan as markdown, starting with a # heading that names it. The user may approve (carry out the plan from your next step) or keep planning — their feedback comes back in the tool result; revise and present again."""
550
+ async def get_goal(self, args: dict[str, Any]) -> GetGoalOutput1 | GetGoalOutput2:
551
+ """Read the current same-session goal, including its exact id/revision, objective, phase, completed continuation rounds, round limit, blocker reason when present, and whether another continuation is armed. Call this before updating a goal."""
552
+ async def glob(self, args: GlobArgs) -> GlobOutput:
553
+ """Find files whose paths match a glob pattern. Returns matching file paths — never directories — including hidden and ignored files (VCS metadata directories are excluded). Up to 100 paths come back in modification-time order; a larger result returns the first 100 paths in modification-time order, says so, and reports where the complete sorted list was saved. This tool does not enumerate directory entries."""
554
+ async def grep(self, args: GrepArgs) -> GrepOutput:
555
+ """Search file contents with a ripgrep regular expression. Returns matching lines with line numbers, grouped by file. Returns the first 250 matches inline; a capped result reports where the complete match list was saved. Use read on a matched file for surrounding context."""
556
+ async def interrupt_agent(self, args: InterruptAgentArgs) -> InterruptAgentOutput:
557
+ """Request cancellation of a background agent's current turn by its agent id. The target may be your direct child or a deeper agent created under you. Only the current turn stops: messages already queued for the agent stay parked until a later send_message, agents it started keep running, and the agent itself stays available for follow-ups. This call returns as soon as the stop request is accepted, so the target may keep running briefly; interrupting an agent that already finished is an accepted no-op."""
558
+ async def job_kill(self, args: JobKillArgs) -> JobKillOutput:
559
+ """Request cancellation of a running background job by job id. Returns immediately; the job settles as killed once its work actually stops."""
560
+ async def job_list(self, args: dict[str, Any]) -> list[JobListOutput]:
561
+ """List your background jobs (running and finished) with their ids, kinds, and statuses."""
562
+ async def job_output(self, args: JobOutputArgs) -> JobOutputOutput:
563
+ """Read a background job. Stream jobs return only output since the previous read; final-output jobs return their result after settlement. Every response ends with `[status: ...]`. Reads are non-blocking unless `wait: true`, which waits up to the configured cap."""
564
+ async def list_agents(self, args: ListAgentsArgs) -> list[ListAgentsOutput1 | ListAgentsOutput2]:
565
+ """List your continuable background subagents by durable id and label. Use it to recall which ones you started, not to poll for completion — you are told when one finishes. Status comes from the live registry: running means the agent is working right now, idle means it is loaded but between turns (it may be waiting on agents it started), and ready means it exists only in storage — resumable, not terminal, and not a result waiting to be collected; a `send_message` starts a new turn on the same conversation, and a direct child remains a `send_message` candidate in every status. The snapshot is not a delivery promise — `send_message` performs the authoritative check and may still fail. Children that could not be read are reported as diagnostics instead of being silently dropped. Scope `descendants` walks the whole tree below you in stable pre-order, annotating each entry with its durable direct-parent session id and depth. You may use `send_message` only for depth-1 entries; deeper entries are candidates for `interrupt_agent` only."""
566
+ async def ralph(self, args: RalphArgs) -> RalphOutput:
567
+ """Run a foreground fresh-agent Ralph loop toward one immutable objective. Use only when the direct human explicitly asks for Ralph or fresh-agent iteration. Each round opens a new child with no parent conversation or prior child session; the shared workspace is long-term memory, and only a bounded structured report crosses rounds. The call returns when a worker reports completion or a concrete blocker, or at the round limit. Ordinary long-running same-session work belongs to goal tools."""
568
+ async def read(self, args: ReadArgs) -> ReadOutput:
569
+ """Read a UTF-8 text file and return line-numbered content."""
570
+ async def read_image(self, args: ReadImageArgs) -> ReadImageOutput:
571
+ """Read a PNG/JPEG/WebP/GIF file and return the image itself. Harness validates and downscales large supported images before the next model request, so use this tool directly instead of installing image libraries or creating thumbnails merely to inspect an image. Independent files may be read concurrently in small batches. Requires the current model to accept image input."""
572
+ async def send_message(self, args: SendMessageArgs) -> SendMessageOutput:
573
+ """Send a message to a background subagent by its subagent id, continuing the same conversation. It becomes the subagent's next turn: if it is still working, the message waits until its current turn finishes, so it cannot redirect work already underway. This call returns no answer from the subagent — only confirmation that the message was delivered — so use it to give it more work. A failure means the message was NOT delivered."""
574
+ async def skill(self, args: SkillArgs) -> SkillOutput:
575
+ """Load the full instructions for an available skill. Call this with the exact skill name from the session skill catalog before acting on a task that names or clearly matches that skill."""
576
+ async def subagent(self, args: SubagentArgs) -> SubagentOutput1 | SubagentOutput2 | SubagentOutput3:
577
+ """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. Give it a complete, standalone prompt: it does not see this conversation. This tool runs in the background by default, immediately returns a durable subagent id, and keeps the child conversation available for later turns. When that run settles, the runtime sends the parent a notice containing its outcome and any final assistant message; `send_message` starts a later turn in the same child conversation. Set `run_in_background: false` only when your next action depends on receiving the result."""
578
+ async def subagent_fork(self, args: SubagentForkArgs) -> SubagentForkOutput1 | SubagentForkOutput2 | SubagentForkOutput3:
579
+ """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 runs in the background by default, immediately returns a durable subagent id, and keeps the child conversation available for later turns. When that run settles, the runtime sends the parent a notice containing its outcome and any final assistant message; `send_message` starts a later turn in the same child conversation. Set `run_in_background: false` only when your next action depends on receiving the result."""
580
+ async def todo_write(self, args: TodoWriteArgs) -> TodoWriteOutput:
581
+ """Record and update a structured task list for the current work. Send the ENTIRE list every call — it REPLACES the previous list (there are no partial updates, no per-item edits). Use it to plan multi-step work and show progress: add one todo per concrete step before you start. Mark every todo being actively worked on `in_progress` — several at once when work genuinely runs in parallel (e.g. concurrent subagents or background commands), one for sequential work; while work remains, at least one task should be `in_progress`. Mark a todo `completed` the moment it is done (do not batch completions), and allow no `in_progress` item only once all work is complete. Skip the list for trivial single-step tasks. Statuses: `pending` (not started), `in_progress` (being worked on now), `completed` (finished)."""
582
+ async def update_goal(self, args: UpdateGoalArgs) -> UpdateGoalOutput1 | UpdateGoalOutput2:
583
+ """Update the exact current goal revision. edit, pause, and resume require a direct top-level human request. During an automatic continuation of the current goal, complete and blocked are also allowed. blocked is rejected before the configured minimum round count; the model remains responsible for judging that the same condition persisted across those rounds and must explain it in blocked_reason."""
584
+ async def web_search(self, args: WebSearchArgs) -> WebSearchOutput:
585
+ """Search the web for current information. Provide 1–4 queries in the required queries array. Returns an optional summary answer and a list of source URLs."""
586
+ async def workflow(self, args: WorkflowArgs) -> WorkflowOutput:
587
+ """Run a JavaScript workflow script that orchestrates subagents at scale. Use this for work that fans out across many independent pieces — an audit over many files, a migration, multi-angle research, adversarial verification of findings — where you write the orchestration as a script instead of delegating turn by turn. The workflow's identity rides the `meta` parameter as JSON: required `name` (short kebab-case) and `description` strings, optional `whenToUse` string and `phases` array (`{title, detail?, provider?, model?}`). The `script` parameter is the plain JavaScript body ONLY (NOT TypeScript, and NO `export const meta` statement — meta is a parameter, not code), running with top-level await; end with `return <value>` — the value must be JSON-serializable and is this tool's result. Script-body hooks: - `agent(prompt, opts?): Promise<any>` — run one subagent to completion. Without `opts.schema` it resolves to the child's final text; with `opts.schema` (an object-rooted JSON Schema using ONLY type/properties/required/additionalProperties/items/enum/const/oneOf — no pattern/format/numeric bounds) it resolves to the validated object. Resolves `null` when the child fails (filter with `.filter(Boolean)`). Other opts: `label` (display), `phase` (progress group), and independent `provider`/`model` LLM target overrides (either may be provided alone). Anything else (`effort`/`isolation`/`agentType`) is rejected loudly. - `pipeline(items, ...stages): Promise<any[]>` — run each item through the stages independently with NO barrier between stages (prefer this for multi-stage work). Each stage receives `(prev, item, index)`. An ordinary stage throw drops that ITEM to `null` and skips its remaining stages. - `parallel(thunks): Promise<any[]>` — run zero-argument functions concurrently and await ALL of them (a barrier; use only when a stage genuinely needs every prior result together). A throwing thunk resolves to `null`. - `phase(title)` — start a progress phase; `log(message)` — narrate progress; `args` — the tool call's `args` input, verbatim. Misused hooks (bad arguments, unknown options, unsupported schemas, tripped caps) throw errors that ALWAYS kill the script — they never dissolve into a per-item `null`. Constraints: concurrency and total-agent caps apply; no filesystem, network, timers, or Node.js APIs are provided — the agents do the work, the script only coordinates them. The run executes in the foreground: this call returns when the whole script finishes."""
588
+ async def write(self, args: WriteArgs) -> WriteOutput:
589
+ """Create or fully replace a UTF-8 text file."""
590
+
591
+ tools: Tools
592
+ ```