taskflow-hosts 0.1.8 → 0.2.1
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 +27 -12
- package/dist/child-env.d.ts +6 -0
- package/dist/child-env.d.ts.map +1 -0
- package/dist/child-env.js +43 -0
- package/dist/child-env.js.map +1 -0
- package/dist/claude-runner.d.ts +27 -15
- package/dist/claude-runner.d.ts.map +1 -1
- package/dist/claude-runner.js +163 -31
- package/dist/claude-runner.js.map +1 -1
- package/dist/codex-runner.d.ts +8 -1
- package/dist/codex-runner.d.ts.map +1 -1
- package/dist/codex-runner.js +85 -20
- package/dist/codex-runner.js.map +1 -1
- package/dist/grok-runner.d.ts +133 -0
- package/dist/grok-runner.d.ts.map +1 -0
- package/dist/grok-runner.js +350 -0
- package/dist/grok-runner.js.map +1 -0
- package/dist/index.d.ts +7 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/opencode-runner.d.ts +16 -0
- package/dist/opencode-runner.d.ts.map +1 -1
- package/dist/opencode-runner.js +82 -13
- package/dist/opencode-runner.js.map +1 -1
- package/package.json +22 -9
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Grok Build subagent runner — the Grok host's `SubagentRunner` implementation.
|
|
3
|
+
*
|
|
4
|
+
* Spawns an isolated `grok -p --output-format streaming-json` process per task
|
|
5
|
+
* and folds its NDJSON event stream into the same host-neutral `RunResult` the
|
|
6
|
+
* pi/codex/claude/opencode runners produce, so the engine (runtime.ts) treats a
|
|
7
|
+
* Grok subagent identically.
|
|
8
|
+
*
|
|
9
|
+
* Official headless streaming-json schema (docs.x.ai / ~/.grok/docs/user-guide/14-headless-mode.md):
|
|
10
|
+
* {"type":"text","data":"…"} ← response text chunk
|
|
11
|
+
* {"type":"thought","data":"…"} ← reasoning (not answer)
|
|
12
|
+
* {"type":"end","stopReason":"EndTurn","sessionId":"…","requestId":"…"}
|
|
13
|
+
* {"type":"error","message":"…"} ← fatal
|
|
14
|
+
* (also non-exhaustive: max_turns_reached, auto_compact_*, …)
|
|
15
|
+
*
|
|
16
|
+
* Mapping to the host-neutral contract:
|
|
17
|
+
* - output = concatenated `text` event data (final answer)
|
|
18
|
+
* - lastActivity = latest text/thought chunk or end/error summary
|
|
19
|
+
* - usage = zeros today because Grok 0.2.93 streaming-json does not
|
|
20
|
+
* emit token/cost fields. The runner advertises that fact
|
|
21
|
+
* so budgeted MCP runs are rejected instead of silently
|
|
22
|
+
* running without a ceiling.
|
|
23
|
+
* - failure = an `error` event, or a non-zero process exit
|
|
24
|
+
*
|
|
25
|
+
* Permission mapping (codex `sandboxForTools` analogue):
|
|
26
|
+
* - read-only whitelist → an operator-configured custom profile extending
|
|
27
|
+
* `read-only`, a known-good `--tools` allowlist, and mutator deny rules
|
|
28
|
+
* - mutating / no whitelist → an operator-configured custom sandbox plus
|
|
29
|
+
* `--always-approve`. Grok's built-in profiles can warn and continue
|
|
30
|
+
* unsandboxed on unsupported hosts; explicit custom profiles fail closed.
|
|
31
|
+
*
|
|
32
|
+
* Process handling (idle watchdog, abort, signal-kill, stderr cap, sanitize)
|
|
33
|
+
* is delegated to shared `runSubagentProcess` in taskflow-core.
|
|
34
|
+
*
|
|
35
|
+
* @see https://docs.x.ai/build/overview
|
|
36
|
+
* @see ~/.grok/docs/user-guide/14-headless-mode.md
|
|
37
|
+
* @see ~/.grok/docs/user-guide/07-mcp-servers.md
|
|
38
|
+
* @see ~/.grok/docs/user-guide/09-plugins.md
|
|
39
|
+
*/
|
|
40
|
+
import { runSubagentProcess, sanitizeErrorMessage, unknownAgentResult, } from "taskflow-core";
|
|
41
|
+
import { emptyUsage } from "taskflow-core";
|
|
42
|
+
import { filteredChildEnv } from "./child-env.js";
|
|
43
|
+
/**
|
|
44
|
+
* Grok built-in tool ids a read-only phase may use. Web ids are deliberately
|
|
45
|
+
* omitted because Grok 0.2.93's allowlist parser fails open on them.
|
|
46
|
+
*/
|
|
47
|
+
const READ_ONLY_TOOL_MAP = {
|
|
48
|
+
read: "read_file",
|
|
49
|
+
read_file: "read_file",
|
|
50
|
+
grep: "grep",
|
|
51
|
+
glob: "list_dir",
|
|
52
|
+
ls: "list_dir",
|
|
53
|
+
list: "list_dir",
|
|
54
|
+
list_dir: "list_dir",
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Defence in depth for Grok 0.2.93. That version warns that web_search /
|
|
58
|
+
* web_fetch are "unmappable" in `--tools` and then restores its full toolset.
|
|
59
|
+
* We therefore never put those ids in the allowlist, and also remove every
|
|
60
|
+
* known mutator after allowlist processing. `--deny` is a second, independent
|
|
61
|
+
* enforcement layer in case a future CLI regresses allowlist handling again.
|
|
62
|
+
*/
|
|
63
|
+
const MUTATING_GROK_TOOLS = ["run_terminal_cmd", "search_replace", "write", "write_file", "Agent"];
|
|
64
|
+
/** Custom sandbox profile required for mutating Grok phases. Built-in profiles
|
|
65
|
+
* may warn and continue without enforcement when the host cannot apply them;
|
|
66
|
+
* Grok documents explicitly requested custom profiles as fail-closed. */
|
|
67
|
+
export const GROK_MUTATING_SANDBOX_PROFILE_ENV = "PI_TASKFLOW_GROK_MUTATING_SANDBOX_PROFILE";
|
|
68
|
+
export const GROK_READONLY_SANDBOX_PROFILE_ENV = "PI_TASKFLOW_GROK_READONLY_SANDBOX_PROFILE";
|
|
69
|
+
const BUILTIN_GROK_SANDBOX_PROFILES = new Set(["off", "workspace", "devbox", "read-only", "strict"]);
|
|
70
|
+
export function newGrokAccumulator(model) {
|
|
71
|
+
return { usage: emptyUsage(), model, finalText: "", lastActivity: "" };
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Fold one Grok streaming-json NDJSON line into the accumulator. Returns a
|
|
75
|
+
* LiveUpdate when the stream produced new activity, else null. Empty/malformed
|
|
76
|
+
* lines are ignored — robust to partial buffers and noise, unit-testable
|
|
77
|
+
* without spawning a process.
|
|
78
|
+
*/
|
|
79
|
+
export function foldGrokEventLine(acc, line) {
|
|
80
|
+
if (!line.trim())
|
|
81
|
+
return null;
|
|
82
|
+
let event;
|
|
83
|
+
try {
|
|
84
|
+
event = JSON.parse(line);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
let activity = "";
|
|
90
|
+
const type = typeof event.type === "string" ? event.type : "";
|
|
91
|
+
switch (type) {
|
|
92
|
+
case "text": {
|
|
93
|
+
const data = typeof event.data === "string" ? event.data : "";
|
|
94
|
+
if (data) {
|
|
95
|
+
acc.finalText += data;
|
|
96
|
+
activity = data.trim() || acc.finalText.trim();
|
|
97
|
+
}
|
|
98
|
+
break;
|
|
99
|
+
}
|
|
100
|
+
case "thought": {
|
|
101
|
+
const data = typeof event.data === "string" ? event.data : "";
|
|
102
|
+
if (data.trim())
|
|
103
|
+
activity = data.trim();
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
case "end": {
|
|
107
|
+
acc.terminalSeen = true;
|
|
108
|
+
if (typeof event.stopReason === "string")
|
|
109
|
+
acc.stopReason = event.stopReason;
|
|
110
|
+
if (typeof event.sessionId === "string")
|
|
111
|
+
acc.sessionId = event.sessionId;
|
|
112
|
+
// Some builds may put the full text on the end event as a convenience.
|
|
113
|
+
if (typeof event.text === "string" && event.text.trim() && !acc.finalText.trim()) {
|
|
114
|
+
acc.finalText = event.text;
|
|
115
|
+
}
|
|
116
|
+
activity = acc.finalText.trim() || `end:${acc.stopReason ?? "unknown"}`;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
case "error": {
|
|
120
|
+
const msg = (typeof event.message === "string" && event.message.trim()) ||
|
|
121
|
+
(typeof event.data === "string" && event.data.trim()) ||
|
|
122
|
+
"grok run failed";
|
|
123
|
+
acc.fatalError = msg;
|
|
124
|
+
activity = `error: ${msg}`;
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case "max_turns_reached": {
|
|
128
|
+
const msg = (typeof event.message === "string" && event.message.trim()) ||
|
|
129
|
+
(typeof event.data === "string" && event.data.trim()) ||
|
|
130
|
+
"grok reached its maximum turn limit before completing the task";
|
|
131
|
+
acc.fatalError = msg;
|
|
132
|
+
acc.stopReason = "max_turns_reached";
|
|
133
|
+
activity = `error: ${msg}`;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
default:
|
|
137
|
+
// auto_compact_* / unknown — ignore for forward compatibility.
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
if (activity)
|
|
141
|
+
acc.lastActivity = activity.replace(/\s+/g, " ").trim();
|
|
142
|
+
return { text: acc.lastActivity, usage: { ...acc.usage }, model: acc.model };
|
|
143
|
+
}
|
|
144
|
+
/** Override the grok binary (tests / unusual installs). */
|
|
145
|
+
export function grokBin() {
|
|
146
|
+
return process.env.PI_TASKFLOW_GROK_BIN || "grok";
|
|
147
|
+
}
|
|
148
|
+
export function grokChildEnv(source = process.env) {
|
|
149
|
+
return filteredChildEnv(source, [], ["GROK_", "XAI_", "PI_TASKFLOW_GROK_"]);
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Map a phase's tool whitelist to Grok headless permission flags.
|
|
153
|
+
*
|
|
154
|
+
* - no whitelist / mutating tools → an operator-configured fail-closed custom
|
|
155
|
+
* sandbox plus `--always-approve`
|
|
156
|
+
* - read-only whitelist → a fail-closed custom read-only sandbox plus a narrow
|
|
157
|
+
* allowlist and independent deny rules (still pairs with `--always-approve`
|
|
158
|
+
* so the remaining safe tools never block on confirm)
|
|
159
|
+
*/
|
|
160
|
+
export function resolveGrokMutatingSandboxProfile(env = process.env) {
|
|
161
|
+
const profile = env[GROK_MUTATING_SANDBOX_PROFILE_ENV]?.trim();
|
|
162
|
+
return profile || undefined;
|
|
163
|
+
}
|
|
164
|
+
export function resolveGrokReadOnlySandboxProfile(env = process.env) {
|
|
165
|
+
const profile = env[GROK_READONLY_SANDBOX_PROFILE_ENV]?.trim();
|
|
166
|
+
return profile || undefined;
|
|
167
|
+
}
|
|
168
|
+
function requireCustomSandbox(profile, envName, phaseKind) {
|
|
169
|
+
if (!profile) {
|
|
170
|
+
throw new Error(`${phaseKind} Grok phases require a fail-closed custom sandbox profile. ` +
|
|
171
|
+
`Define one in ~/.grok/sandbox.toml and set ${envName}=<profile>.`);
|
|
172
|
+
}
|
|
173
|
+
if (BUILTIN_GROK_SANDBOX_PROFILES.has(profile)) {
|
|
174
|
+
throw new Error(`Grok sandbox '${profile}' is built in and may continue unsandboxed when enforcement is unavailable. ` +
|
|
175
|
+
`${envName} must name a custom profile from ~/.grok/sandbox.toml.`);
|
|
176
|
+
}
|
|
177
|
+
return profile;
|
|
178
|
+
}
|
|
179
|
+
export function permissionArgsForGrokTools(tools, mutatingSandboxProfile, readOnlySandboxProfile) {
|
|
180
|
+
if (!tools || tools.length === 0) {
|
|
181
|
+
return ["--sandbox", requireCustomSandbox(mutatingSandboxProfile, GROK_MUTATING_SANDBOX_PROFILE_ENV, "Mutating/default"), "--always-approve"];
|
|
182
|
+
}
|
|
183
|
+
const mutating = new Set([
|
|
184
|
+
"write",
|
|
185
|
+
"write_file",
|
|
186
|
+
"edit",
|
|
187
|
+
"bash",
|
|
188
|
+
"apply_patch",
|
|
189
|
+
"run_terminal_cmd",
|
|
190
|
+
"run_terminal_command",
|
|
191
|
+
"search_replace",
|
|
192
|
+
]);
|
|
193
|
+
const canMutate = tools.some((t) => mutating.has(t));
|
|
194
|
+
if (canMutate) {
|
|
195
|
+
return ["--sandbox", requireCustomSandbox(mutatingSandboxProfile, GROK_MUTATING_SANDBOX_PROFILE_ENV, "Mutating"), "--always-approve"];
|
|
196
|
+
}
|
|
197
|
+
const allowed = [...new Set(tools.map((t) => READ_ONLY_TOOL_MAP[t]).filter((t) => Boolean(t)))];
|
|
198
|
+
// Keep the allowlist non-empty: an empty --tools value is treated as if the
|
|
199
|
+
// flag were absent by some Grok builds, which would fail open to all tools.
|
|
200
|
+
if (allowed.length === 0)
|
|
201
|
+
allowed.push("read_file");
|
|
202
|
+
return [
|
|
203
|
+
"--sandbox",
|
|
204
|
+
requireCustomSandbox(readOnlySandboxProfile, GROK_READONLY_SANDBOX_PROFILE_ENV, "Read-only"),
|
|
205
|
+
"--tools",
|
|
206
|
+
allowed.join(","),
|
|
207
|
+
"--disallowed-tools",
|
|
208
|
+
MUTATING_GROK_TOOLS.join(","),
|
|
209
|
+
"--deny",
|
|
210
|
+
"Bash",
|
|
211
|
+
"--deny",
|
|
212
|
+
"Edit",
|
|
213
|
+
"--deny",
|
|
214
|
+
"Write",
|
|
215
|
+
"--deny",
|
|
216
|
+
"MCPTool",
|
|
217
|
+
"--no-subagents",
|
|
218
|
+
"--always-approve",
|
|
219
|
+
];
|
|
220
|
+
}
|
|
221
|
+
/** Map Taskflow/Pi thinking levels to Grok's --reasoning-effort contract. */
|
|
222
|
+
export function resolveGrokThinking(thinking) {
|
|
223
|
+
if (!thinking)
|
|
224
|
+
return undefined;
|
|
225
|
+
const normalized = thinking.trim().toLowerCase();
|
|
226
|
+
if (normalized === "off")
|
|
227
|
+
return "none";
|
|
228
|
+
if (normalized === "ultra")
|
|
229
|
+
return "max";
|
|
230
|
+
if (["none", "minimal", "low", "medium", "high", "xhigh", "max"].includes(normalized))
|
|
231
|
+
return normalized;
|
|
232
|
+
throw new Error(`Unsupported Grok thinking level '${thinking}'. Use off, none, minimal, low, medium, high, xhigh, max, or ultra.`);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Resolve a modelRoles/pi model id for `grok -m`, or `undefined` to let Grok
|
|
236
|
+
* use its configured default. Drop pi-provider paths (contain `/` with more
|
|
237
|
+
* than one segment is rare for grok; a single slash may be a custom model id
|
|
238
|
+
* from config.toml `[model.x]`) and unresolved `{{placeholder}}`s.
|
|
239
|
+
*
|
|
240
|
+
* Grok custom models are flat keys in `~/.grok/config.toml` (e.g. `my-model`,
|
|
241
|
+
* `grok-build`); pi-style `provider/model` paths are not valid Grok model ids
|
|
242
|
+
* unless the user defined them literally.
|
|
243
|
+
*/
|
|
244
|
+
export function resolveGrokModel(model) {
|
|
245
|
+
if (!model)
|
|
246
|
+
return undefined;
|
|
247
|
+
if (/^\{\{.*\}\}$/.test(model))
|
|
248
|
+
return undefined;
|
|
249
|
+
// Drop openrouter multi-segment paths (openrouter/vendor/model).
|
|
250
|
+
if ((model.match(/\//g)?.length ?? 0) >= 2)
|
|
251
|
+
return undefined;
|
|
252
|
+
// Drop pi thinking suffixes.
|
|
253
|
+
if (/:\s*(?:xhigh|high|medium|low|off)$/.test(model))
|
|
254
|
+
return undefined;
|
|
255
|
+
return model;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Build the full `grok -p` argv from a phase's resolved context — PURE
|
|
259
|
+
* (no process.env, no spawn). Extracted so the host's CLI flag contract is
|
|
260
|
+
* unit-testable in CI without a live Grok session.
|
|
261
|
+
*
|
|
262
|
+
* grok -p <task> --output-format streaming-json
|
|
263
|
+
* [--sandbox <custom-mutating> --always-approve |
|
|
264
|
+
* --sandbox <custom-read-only> --tools … --always-approve]
|
|
265
|
+
* [--model m] [--reasoning-effort level] [--cwd dir] [--rules systemPrompt]
|
|
266
|
+
*/
|
|
267
|
+
export function buildGrokArgs(ctx) {
|
|
268
|
+
const grokModel = resolveGrokModel(ctx.model);
|
|
269
|
+
const grokThinking = resolveGrokThinking(ctx.thinking);
|
|
270
|
+
const args = ["-p", ctx.task, "--output-format", "streaming-json"];
|
|
271
|
+
args.push(...permissionArgsForGrokTools(ctx.tools, ctx.mutatingSandboxProfile, ctx.readOnlySandboxProfile));
|
|
272
|
+
if (grokModel)
|
|
273
|
+
args.push("-m", grokModel);
|
|
274
|
+
if (grokThinking)
|
|
275
|
+
args.push("--reasoning-effort", grokThinking);
|
|
276
|
+
if (ctx.cwd)
|
|
277
|
+
args.push("--cwd", ctx.cwd);
|
|
278
|
+
if (ctx.systemPrompt.trim())
|
|
279
|
+
args.push("--rules", ctx.systemPrompt.trim());
|
|
280
|
+
return args;
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Run a single subagent task via `grok -p --output-format streaming-json`.
|
|
284
|
+
* Resolves the agent from `agents` by name; returns the same structured
|
|
285
|
+
* `RunResult` the other host runners do.
|
|
286
|
+
*/
|
|
287
|
+
export async function runGrokAgentTask(defaultCwd, agents, agentName, task, opts, globalThinking) {
|
|
288
|
+
const agent = agents.find((a) => a.name === agentName);
|
|
289
|
+
if (!agent)
|
|
290
|
+
return unknownAgentResult(agentName, task, agents);
|
|
291
|
+
const model = opts.model ?? agent.model;
|
|
292
|
+
const tools = opts.tools ?? agent.tools;
|
|
293
|
+
const thinking = opts.thinking ?? agent.thinking ?? globalThinking;
|
|
294
|
+
const cwd = opts.cwd ?? defaultCwd;
|
|
295
|
+
let args;
|
|
296
|
+
try {
|
|
297
|
+
args = buildGrokArgs({
|
|
298
|
+
systemPrompt: agent.systemPrompt,
|
|
299
|
+
task,
|
|
300
|
+
model,
|
|
301
|
+
thinking,
|
|
302
|
+
tools,
|
|
303
|
+
cwd,
|
|
304
|
+
mutatingSandboxProfile: resolveGrokMutatingSandboxProfile(),
|
|
305
|
+
readOnlySandboxProfile: resolveGrokReadOnlySandboxProfile(),
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
catch (error) {
|
|
309
|
+
const message = sanitizeErrorMessage(error instanceof Error ? error.message : String(error));
|
|
310
|
+
return {
|
|
311
|
+
agent: agentName,
|
|
312
|
+
task,
|
|
313
|
+
exitCode: 1,
|
|
314
|
+
output: "",
|
|
315
|
+
stderr: message,
|
|
316
|
+
usage: emptyUsage(),
|
|
317
|
+
model,
|
|
318
|
+
stopReason: "error",
|
|
319
|
+
errorMessage: message,
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
return runSubagentProcess({
|
|
323
|
+
agent: agentName,
|
|
324
|
+
task,
|
|
325
|
+
model,
|
|
326
|
+
bin: grokBin(),
|
|
327
|
+
args,
|
|
328
|
+
env: grokChildEnv(),
|
|
329
|
+
cwd,
|
|
330
|
+
idleTimeoutMs: opts.idleTimeoutMs,
|
|
331
|
+
signal: opts.signal,
|
|
332
|
+
onLive: opts.onLive,
|
|
333
|
+
acc: newGrokAccumulator(model),
|
|
334
|
+
foldLine: foldGrokEventLine,
|
|
335
|
+
requireTerminalEvent: true,
|
|
336
|
+
terminalEventLabel: "Grok end",
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
// Preserve the capability when consumers inject the bare function into
|
|
340
|
+
// RuntimeDeps instead of passing the SubagentRunner object through an adapter.
|
|
341
|
+
runGrokAgentTask.usageAccounting = "unavailable";
|
|
342
|
+
/**
|
|
343
|
+
* The Grok host's `SubagentRunner`. Drops into `RuntimeDeps.runTask` exactly
|
|
344
|
+
* like the other host runners, so the engine runs unchanged on Grok Build.
|
|
345
|
+
*/
|
|
346
|
+
export const grokSubagentRunner = {
|
|
347
|
+
runTask: runGrokAgentTask,
|
|
348
|
+
usageAccounting: "unavailable",
|
|
349
|
+
};
|
|
350
|
+
//# sourceMappingURL=grok-runner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grok-runner.js","sourceRoot":"","sources":["../src/grok-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,EACN,kBAAkB,EAClB,oBAAoB,EACpB,kBAAkB,GAOlB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElD;;;GAGG;AACH,MAAM,kBAAkB,GAAqC;IAC5D,IAAI,EAAE,WAAW;IACjB,SAAS,EAAE,WAAW;IACtB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,UAAU;IAChB,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,UAAU;CACpB,CAAC;AAEF;;;;;;GAMG;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SAC3D,CAAC,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,OAAO,GAAG,oBAAoB,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC7F,OAAO;YACN,KAAK,EAAE,SAAS;YAChB,IAAI;YACJ,QAAQ,EAAE,CAAC;YACX,MAAM,EAAE,EAAE;YACV,MAAM,EAAE,OAAO;YACf,KAAK,EAAE,UAAU,EAAE;YACnB,KAAK;YACL,UAAU,EAAE,OAAO;YACnB,YAAY,EAAE,OAAO;SACrB,CAAC;IACH,CAAC;IAED,OAAO,kBAAkB,CAAC;QACzB,KAAK,EAAE,SAAS;QAChB,IAAI;QACJ,KAAK;QACL,GAAG,EAAE,OAAO,EAAE;QACd,IAAI;QACJ,GAAG,EAAE,YAAY,EAAE;QACnB,GAAG;QACH,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,GAAG,EAAE,kBAAkB,CAAC,KAAK,CAAC;QAC9B,QAAQ,EAAE,iBAAiB;QAC3B,oBAAoB,EAAE,IAAI;QAC1B,kBAAkB,EAAE,UAAU;KAC9B,CAAC,CAAC;AACJ,CAAC;AAED,uEAAuE;AACvE,+EAA+E;AAC9E,gBAAiF,CAAC,eAAe,GAAG,aAAa,CAAC;AAEnH;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAgC;IAC9D,OAAO,EAAE,gBAAgB;IACzB,eAAe,EAAE,aAAa;CAC9B,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* taskflow-hosts — the shared collection of host-runner implementations.
|
|
3
3
|
*
|
|
4
|
-
* Each non-pi host (codex / claude / opencode) has two halves:
|
|
4
|
+
* Each non-pi host (codex / claude / opencode / grok) has two halves:
|
|
5
5
|
* 1. the **runner** — a `SubagentRunner` that spawns that host's CLI, folds
|
|
6
6
|
* its event stream, and classifies the outcome into a host-neutral
|
|
7
7
|
* `RunResult`. PLUS the pure argv builders (`buildXxxArgs`) and
|
|
8
8
|
* permission/model helpers.
|
|
9
9
|
* 2. the **delivery** — the per-host MCP server + bin + plugin scaffold,
|
|
10
10
|
* which lives in that host's own package (codex-taskflow /
|
|
11
|
-
* claude-taskflow / opencode-taskflow) because it's the
|
|
12
|
-
* install target (`codex plugin add`, `claude plugin
|
|
11
|
+
* claude-taskflow / opencode-taskflow / grok-taskflow) because it's the
|
|
12
|
+
* host-ecosystem install target (`codex plugin add`, `claude plugin
|
|
13
|
+
* install`, `grok plugin install`, …).
|
|
13
14
|
*
|
|
14
15
|
* This package holds only #1 — the runners — so all host runners live in one
|
|
15
16
|
* place. A new host adds a `<host>-runner.ts` here; its delivery package
|
|
16
|
-
* imports the runner from `taskflow-hosts`.
|
|
17
|
-
*
|
|
17
|
+
* imports the runner from `taskflow-hosts`. Host delivery packages re-export
|
|
18
|
+
* from here (or import the runner directly into their `mcp/server`).
|
|
18
19
|
*
|
|
19
20
|
* The barrel re-exports the full public surface of each runner so a consumer
|
|
20
21
|
* can `import { codexSubagentRunner, buildCodexArgs } from "taskflow-hosts"`,
|
|
@@ -23,4 +24,5 @@
|
|
|
23
24
|
export * from "./codex-runner.ts";
|
|
24
25
|
export * from "./claude-runner.ts";
|
|
25
26
|
export * from "./opencode-runner.ts";
|
|
27
|
+
export * from "./grok-runner.ts";
|
|
26
28
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* taskflow-hosts — the shared collection of host-runner implementations.
|
|
3
3
|
*
|
|
4
|
-
* Each non-pi host (codex / claude / opencode) has two halves:
|
|
4
|
+
* Each non-pi host (codex / claude / opencode / grok) has two halves:
|
|
5
5
|
* 1. the **runner** — a `SubagentRunner` that spawns that host's CLI, folds
|
|
6
6
|
* its event stream, and classifies the outcome into a host-neutral
|
|
7
7
|
* `RunResult`. PLUS the pure argv builders (`buildXxxArgs`) and
|
|
8
8
|
* permission/model helpers.
|
|
9
9
|
* 2. the **delivery** — the per-host MCP server + bin + plugin scaffold,
|
|
10
10
|
* which lives in that host's own package (codex-taskflow /
|
|
11
|
-
* claude-taskflow / opencode-taskflow) because it's the
|
|
12
|
-
* install target (`codex plugin add`, `claude plugin
|
|
11
|
+
* claude-taskflow / opencode-taskflow / grok-taskflow) because it's the
|
|
12
|
+
* host-ecosystem install target (`codex plugin add`, `claude plugin
|
|
13
|
+
* install`, `grok plugin install`, …).
|
|
13
14
|
*
|
|
14
15
|
* This package holds only #1 — the runners — so all host runners live in one
|
|
15
16
|
* place. A new host adds a `<host>-runner.ts` here; its delivery package
|
|
16
|
-
* imports the runner from `taskflow-hosts`.
|
|
17
|
-
*
|
|
17
|
+
* imports the runner from `taskflow-hosts`. Host delivery packages re-export
|
|
18
|
+
* from here (or import the runner directly into their `mcp/server`).
|
|
18
19
|
*
|
|
19
20
|
* The barrel re-exports the full public surface of each runner so a consumer
|
|
20
21
|
* can `import { codexSubagentRunner, buildCodexArgs } from "taskflow-hosts"`,
|
|
@@ -23,4 +24,5 @@
|
|
|
23
24
|
export * from "./codex-runner.js";
|
|
24
25
|
export * from "./claude-runner.js";
|
|
25
26
|
export * from "./opencode-runner.js";
|
|
27
|
+
export * from "./grok-runner.js";
|
|
26
28
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC"}
|
|
@@ -36,6 +36,15 @@
|
|
|
36
36
|
* error sanitization) mirrors the other runners so behavior is uniform.
|
|
37
37
|
*/
|
|
38
38
|
import { type AgentConfig, type LiveUpdate, type RunOptions, type RunResult, type SubagentRunner, type UsageStats } from "taskflow-core";
|
|
39
|
+
/** The permission policy injected (via OPENCODE_CONFIG_CONTENT) for a read-only
|
|
40
|
+
* phase: deny every mutating capability so a listed-tools phase without
|
|
41
|
+
* write/edit/bash cannot change the workspace. */
|
|
42
|
+
export declare const OPENCODE_READ_ONLY_CONFIG: string;
|
|
43
|
+
/** Explicit operator acknowledgement required before OpenCode may use its
|
|
44
|
+
* unsandboxed `--auto` mode for mutating/default-capable phases. */
|
|
45
|
+
export declare const OPENCODE_UNSAFE_AUTO_ENV = "PI_TASKFLOW_OPENCODE_UNSAFE_AUTO";
|
|
46
|
+
export declare function opencodeUnsafeAutoEnabled(env?: NodeJS.ProcessEnv): boolean;
|
|
47
|
+
export declare function opencodeChildEnv(source?: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
39
48
|
/** Accumulated state folded from an opencode JSON event stream. */
|
|
40
49
|
export interface OpencodeAccumulator {
|
|
41
50
|
usage: UsageStats;
|
|
@@ -45,6 +54,7 @@ export interface OpencodeAccumulator {
|
|
|
45
54
|
lastActivity: string;
|
|
46
55
|
/** Set when the stream reported a fatal `error` event. */
|
|
47
56
|
fatalError?: string;
|
|
57
|
+
terminalSeen?: boolean;
|
|
48
58
|
}
|
|
49
59
|
export declare function newOpencodeAccumulator(model?: string): OpencodeAccumulator;
|
|
50
60
|
/**
|
|
@@ -74,14 +84,20 @@ export declare function isReadOnlyPhase(tools: string[] | undefined): boolean;
|
|
|
74
84
|
* A clean `provider/model` passes straight through.
|
|
75
85
|
*/
|
|
76
86
|
export declare function resolveOpencodeModel(model: string | undefined): string | undefined;
|
|
87
|
+
/** Normalize Taskflow aliases before OpenCode resolves the provider-specific variant. */
|
|
88
|
+
export declare function resolveOpencodeThinking(thinking: string | undefined): string | undefined;
|
|
77
89
|
/** Context for {@link buildOpencodeArgs} — the pure inputs to argv construction. */
|
|
78
90
|
export interface OpencodeArgsCtx {
|
|
79
91
|
systemPrompt: string;
|
|
80
92
|
task: string;
|
|
81
93
|
/** Already-resolved model (opts.model ?? agent.model). */
|
|
82
94
|
model?: string;
|
|
95
|
+
/** Resolved phase -> agent -> global reasoning variant. */
|
|
96
|
+
thinking?: string;
|
|
83
97
|
tools?: string[];
|
|
84
98
|
cwd?: string;
|
|
99
|
+
/** Explicit acknowledgement for OpenCode's unsandboxed `--auto` mode. */
|
|
100
|
+
allowUnsafeAuto?: boolean;
|
|
85
101
|
}
|
|
86
102
|
/** Result of {@link buildOpencodeArgs}: the argv plus whether a read-only
|
|
87
103
|
* permission policy should be injected via OPENCODE_CONFIG_CONTENT (the env
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"opencode-runner.d.ts","sourceRoot":"","sources":["../src/opencode-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"opencode-runner.d.ts","sourceRoot":"","sources":["../src/opencode-runner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAE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