poe-code 3.0.203 → 3.0.205
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/dist/cli/commands/braintrust.d.ts +3 -0
- package/dist/cli/commands/braintrust.js +77 -0
- package/dist/cli/commands/braintrust.js.map +1 -0
- package/dist/cli/commands/configure.d.ts +1 -0
- package/dist/cli/commands/configure.js +197 -0
- package/dist/cli/commands/configure.js.map +1 -1
- package/dist/cli/commands/experiment.js +42 -5
- package/dist/cli/commands/experiment.js.map +1 -1
- package/dist/cli/commands/harness.d.ts +3 -0
- package/dist/cli/commands/harness.js +260 -0
- package/dist/cli/commands/harness.js.map +1 -0
- package/dist/cli/commands/pipeline.js +58 -24
- package/dist/cli/commands/pipeline.js.map +1 -1
- package/dist/cli/commands/ralph.js +8 -3
- package/dist/cli/commands/ralph.js.map +1 -1
- package/dist/cli/commands/runtime/build.d.ts +7 -0
- package/dist/cli/commands/runtime/build.js +128 -0
- package/dist/cli/commands/runtime/build.js.map +1 -0
- package/dist/cli/commands/runtime/index.d.ts +3 -0
- package/dist/cli/commands/runtime/index.js +14 -0
- package/dist/cli/commands/runtime/index.js.map +1 -0
- package/dist/cli/commands/runtime/init.d.ts +7 -0
- package/dist/cli/commands/runtime/init.js +39 -0
- package/dist/cli/commands/runtime/init.js.map +1 -0
- package/dist/cli/commands/runtime/jobs/attach.d.ts +3 -0
- package/dist/cli/commands/runtime/jobs/attach.js +35 -0
- package/dist/cli/commands/runtime/jobs/attach.js.map +1 -0
- package/dist/cli/commands/runtime/jobs/index.d.ts +3 -0
- package/dist/cli/commands/runtime/jobs/index.js +16 -0
- package/dist/cli/commands/runtime/jobs/index.js.map +1 -0
- package/dist/cli/commands/runtime/jobs/logs.d.ts +3 -0
- package/dist/cli/commands/runtime/jobs/logs.js +27 -0
- package/dist/cli/commands/runtime/jobs/logs.js.map +1 -0
- package/dist/cli/commands/runtime/jobs/ls.d.ts +3 -0
- package/dist/cli/commands/runtime/jobs/ls.js +60 -0
- package/dist/cli/commands/runtime/jobs/ls.js.map +1 -0
- package/dist/cli/commands/runtime/jobs/sandbox.d.ts +3 -0
- package/dist/cli/commands/runtime/jobs/sandbox.js +15 -0
- package/dist/cli/commands/runtime/jobs/sandbox.js.map +1 -0
- package/dist/cli/commands/runtime/jobs/shared.d.ts +22 -0
- package/dist/cli/commands/runtime/jobs/shared.js +124 -0
- package/dist/cli/commands/runtime/jobs/shared.js.map +1 -0
- package/dist/cli/commands/runtime/jobs/stop.d.ts +3 -0
- package/dist/cli/commands/runtime/jobs/stop.js +31 -0
- package/dist/cli/commands/runtime/jobs/stop.js.map +1 -0
- package/dist/cli/commands/runtime/jobs/sync.d.ts +3 -0
- package/dist/cli/commands/runtime/jobs/sync.js +25 -0
- package/dist/cli/commands/runtime/jobs/sync.js.map +1 -0
- package/dist/cli/commands/runtime/shared.d.ts +20 -0
- package/dist/cli/commands/runtime/shared.js +69 -0
- package/dist/cli/commands/runtime/shared.js.map +1 -0
- package/dist/cli/commands/runtime/templates/clear.d.ts +3 -0
- package/dist/cli/commands/runtime/templates/clear.js +53 -0
- package/dist/cli/commands/runtime/templates/clear.js.map +1 -0
- package/dist/cli/commands/runtime/templates/index.d.ts +3 -0
- package/dist/cli/commands/runtime/templates/index.js +10 -0
- package/dist/cli/commands/runtime/templates/index.js.map +1 -0
- package/dist/cli/commands/runtime/templates/ls.d.ts +3 -0
- package/dist/cli/commands/runtime/templates/ls.js +52 -0
- package/dist/cli/commands/runtime/templates/ls.js.map +1 -0
- package/dist/cli/commands/runtime-options.d.ts +1 -0
- package/dist/cli/commands/runtime-options.js +5 -2
- package/dist/cli/commands/runtime-options.js.map +1 -1
- package/dist/cli/commands/spawn.js +27 -4
- package/dist/cli/commands/spawn.js.map +1 -1
- package/dist/cli/program.js +17 -1
- package/dist/cli/program.js.map +1 -1
- package/dist/index.js +24192 -2429
- package/dist/index.js.map +4 -4
- package/dist/providers/claude-code.js +1692 -93
- package/dist/providers/claude-code.js.map +4 -4
- package/dist/providers/codex.js +1692 -93
- package/dist/providers/codex.js.map +4 -4
- package/dist/providers/goose.js +1687 -88
- package/dist/providers/goose.js.map +4 -4
- package/dist/providers/kimi.js +1692 -93
- package/dist/providers/kimi.js.map +4 -4
- package/dist/providers/opencode.js +1692 -93
- package/dist/providers/opencode.js.map +4 -4
- package/dist/providers/poe-agent.js +1580 -308
- package/dist/providers/poe-agent.js.map +4 -4
- package/dist/providers/spawn-options.d.ts +4 -1
- package/dist/sdk/experiment.js +1 -0
- package/dist/sdk/experiment.js.map +1 -1
- package/dist/sdk/ralph.js +108 -16
- package/dist/sdk/ralph.js.map +1 -1
- package/dist/sdk/spawn.js +11 -4
- package/dist/sdk/spawn.js.map +1 -1
- package/dist/sdk/types.d.ts +12 -1
- package/dist/utils/command-checks.js +2 -29
- package/dist/utils/command-checks.js.map +1 -1
- package/package.json +12 -7
- package/packages/design-system/dist/components/help-formatter-plain.d.ts +4 -0
- package/packages/design-system/dist/components/help-formatter-plain.js +132 -0
- package/packages/design-system/dist/components/help-formatter.d.ts +13 -0
- package/packages/design-system/dist/components/help-formatter.js +116 -7
- package/packages/design-system/dist/components/index.d.ts +2 -2
- package/packages/design-system/dist/components/index.js +1 -1
- package/packages/design-system/dist/components/text.d.ts +1 -0
- package/packages/design-system/dist/components/text.js +8 -0
- package/packages/design-system/dist/index.d.ts +3 -2
- package/packages/design-system/dist/index.js +2 -1
- package/packages/memory/dist/index.js +1201 -115
- package/packages/memory/dist/index.js.map +4 -4
- package/packages/superintendent/dist/commands/run.d.ts +10 -0
- package/packages/superintendent/dist/commands/run.js +96 -49
- package/packages/superintendent/dist/commands/superintendent-group.d.ts +6 -0
- package/packages/superintendent/dist/runtime/agent-runner.d.ts +1 -0
- package/packages/superintendent/dist/runtime/agent-runner.js +4 -2
- package/packages/superintendent/dist/runtime/loop.d.ts +1 -0
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { type RuntimeOverrideOptions } from "@poe-code/agent-harness-tools";
|
|
1
2
|
import { select, type Dashboard } from "@poe-code/design-system";
|
|
3
|
+
import { type Integrations } from "@poe-code/poe-code-config";
|
|
2
4
|
import { type AgentRunInput, type AgentRunResult, type RunLoopOptions, type SuperintendentFileSystem, type SuperintendentRunResult } from "../runtime/loop.js";
|
|
3
5
|
export type SuperintendentRunCommandResult = SuperintendentRunResult & {
|
|
4
6
|
docPath: string;
|
|
@@ -14,6 +16,7 @@ export type RunCommandOptions = {
|
|
|
14
16
|
runtimeTemplate?: string;
|
|
15
17
|
detach?: boolean;
|
|
16
18
|
mountPoeCode?: boolean;
|
|
19
|
+
runnerSync?: RuntimeOverrideOptions["runnerSync"];
|
|
17
20
|
configuredDefaultAgent?: string | null;
|
|
18
21
|
planDirectory?: string;
|
|
19
22
|
assumeYes?: boolean;
|
|
@@ -45,6 +48,7 @@ export type RunCommandOptions = {
|
|
|
45
48
|
openInEditor?: (absolutePath: string, env: Record<string, string | undefined>) => void;
|
|
46
49
|
stderr?: NodeJS.WritableStream;
|
|
47
50
|
exit?: (code: number) => never;
|
|
51
|
+
integrations?: Integrations | null;
|
|
48
52
|
};
|
|
49
53
|
export declare const runCommand: import("toolcraft").Command<{
|
|
50
54
|
[x: string]: never;
|
|
@@ -56,6 +60,7 @@ export declare const runCommand: import("toolcraft").Command<{
|
|
|
56
60
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
57
61
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
58
62
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
63
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
59
64
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
60
65
|
}>, undefined, SuperintendentRunCommandResult> & {
|
|
61
66
|
readonly __agentKitCommandTypeInfo: import("toolcraft").CommandTypeInfo<"run", import("toolcraft-schema").ObjectSchema<{
|
|
@@ -66,6 +71,7 @@ export declare const runCommand: import("toolcraft").Command<{
|
|
|
66
71
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
67
72
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
68
73
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
74
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
69
75
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
70
76
|
}>, SuperintendentRunCommandResult, ("cli" | "sdk")[], undefined>;
|
|
71
77
|
};
|
|
@@ -82,6 +88,7 @@ export declare function createRunMcpCommand(runners?: RunMcpCommandRunners): imp
|
|
|
82
88
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
83
89
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
84
90
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
91
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
85
92
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
86
93
|
}>, undefined, SuperintendentRunCommandResult> & {
|
|
87
94
|
readonly __agentKitCommandTypeInfo: import("toolcraft").CommandTypeInfo<"run", import("toolcraft-schema").ObjectSchema<{
|
|
@@ -92,6 +99,7 @@ export declare function createRunMcpCommand(runners?: RunMcpCommandRunners): imp
|
|
|
92
99
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
93
100
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
94
101
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
102
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
95
103
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
96
104
|
}>, SuperintendentRunCommandResult, "mcp"[], undefined>;
|
|
97
105
|
};
|
|
@@ -105,6 +113,7 @@ export declare const runMcpCommand: import("toolcraft").Command<{
|
|
|
105
113
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
106
114
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
107
115
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
116
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
108
117
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
109
118
|
}>, undefined, SuperintendentRunCommandResult> & {
|
|
110
119
|
readonly __agentKitCommandTypeInfo: import("toolcraft").CommandTypeInfo<"run", import("toolcraft-schema").ObjectSchema<{
|
|
@@ -115,6 +124,7 @@ export declare const runMcpCommand: import("toolcraft").Command<{
|
|
|
115
124
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
116
125
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
117
126
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
127
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
118
128
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
119
129
|
}>, SuperintendentRunCommandResult, "mcp"[], undefined>;
|
|
120
130
|
};
|
|
@@ -7,7 +7,7 @@ import { parseAgentSpecifier } from "@poe-code/agent-defs";
|
|
|
7
7
|
import { executePoeAgent } from "./poe-agent-runner.js";
|
|
8
8
|
import { S, UserError, defineCommand } from "toolcraft";
|
|
9
9
|
import { acp, cancel, createDashboard, isCancel, resolveOutputFormat, select, shouldUseInteractiveDashboard, text } from "@poe-code/design-system";
|
|
10
|
-
import { planConfigScope, readMergedDocument, resolveConfigPath, resolveProjectConfigPath, resolveScope } from "@poe-code/poe-code-config";
|
|
10
|
+
import { planConfigScope, loadIntegrations, mergeLoopCallbacks, readMergedDocument, resolveConfigPath, resolveProjectConfigPath, resolveScope } from "@poe-code/poe-code-config";
|
|
11
11
|
import { superintendentConfigScope } from "../config-scope.js";
|
|
12
12
|
import { parseSuperintendentDoc, readExplicitBuilderAgent } from "../document/parse.js";
|
|
13
13
|
import { runLoop } from "../runtime/loop.js";
|
|
@@ -34,6 +34,9 @@ const runParams = S.Object({
|
|
|
34
34
|
mountPoeCode: S.Optional(S.Boolean({
|
|
35
35
|
description: "Mount the local poe-code checkout into the runtime"
|
|
36
36
|
})),
|
|
37
|
+
runnerSync: S.Optional(S.Enum(["both", "upload", "none"], {
|
|
38
|
+
description: "Override runner workspace sync: both, upload, or none"
|
|
39
|
+
})),
|
|
37
40
|
tui: S.Optional(S.Boolean({ description: "Show a live dashboard while Superintendent is running" }))
|
|
38
41
|
});
|
|
39
42
|
export const runCommand = defineCommand({
|
|
@@ -46,24 +49,35 @@ export const runCommand = defineCommand({
|
|
|
46
49
|
const cwd = process.cwd();
|
|
47
50
|
const homeDir = process.env.HOME ?? process.env.USERPROFILE ?? cwd;
|
|
48
51
|
const commandConfig = await resolveSuperintendentCommandConfig(cwd, homeDir, process.env);
|
|
52
|
+
const integrations = await loadIntegrations(commandConfig.configDoc);
|
|
49
53
|
const tuiEnabled = params.tui ?? commandConfig.tui;
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
54
|
+
try {
|
|
55
|
+
const runOptions = {
|
|
56
|
+
cwd,
|
|
57
|
+
homeDir,
|
|
58
|
+
docPath: params.doc,
|
|
59
|
+
...(params.agent ? { builderAgent: params.agent } : {}),
|
|
60
|
+
...(params.runtime ? { runtime: params.runtime } : {}),
|
|
61
|
+
...(params.runtimeImage ? { runtimeImage: params.runtimeImage } : {}),
|
|
62
|
+
...(params.runtimeTemplate ? { runtimeTemplate: params.runtimeTemplate } : {}),
|
|
63
|
+
...(params.detach ? { detach: params.detach } : {}),
|
|
64
|
+
...(params.mountPoeCode ? { mountPoeCode: params.mountPoeCode } : {}),
|
|
65
|
+
...(params.runnerSync ? { runnerSync: params.runnerSync } : {}),
|
|
66
|
+
configuredDefaultAgent: commandConfig.configuredDefaultAgent,
|
|
67
|
+
assumeYes: process.argv.includes("--yes"),
|
|
68
|
+
interactive: Boolean(process.stdin.isTTY),
|
|
69
|
+
useDashboard: shouldUseInteractiveDashboard(tuiEnabled) && resolveOutputFormat() === "terminal",
|
|
70
|
+
env: process.env,
|
|
71
|
+
integrations,
|
|
72
|
+
...(commandConfig.planDirectory ? { planDirectory: commandConfig.planDirectory } : {})
|
|
73
|
+
};
|
|
74
|
+
return integrations
|
|
75
|
+
? await integrations.traceRun("superintendent", params.doc ?? "run", () => runSuperintendentCommand(runOptions))
|
|
76
|
+
: await runSuperintendentCommand(runOptions);
|
|
77
|
+
}
|
|
78
|
+
finally {
|
|
79
|
+
await integrations?.shutdown();
|
|
80
|
+
}
|
|
67
81
|
},
|
|
68
82
|
render: {
|
|
69
83
|
rich: (result, { logger }) => {
|
|
@@ -104,24 +118,34 @@ export function createRunMcpCommand(runners) {
|
|
|
104
118
|
const cwd = process.cwd();
|
|
105
119
|
const homeDir = process.env.HOME ?? process.env.USERPROFILE ?? cwd;
|
|
106
120
|
const commandConfig = await resolveSuperintendentCommandConfig(cwd, homeDir, process.env);
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
const integrations = await loadIntegrations(commandConfig.configDoc);
|
|
122
|
+
try {
|
|
123
|
+
const runOptions = {
|
|
124
|
+
cwd,
|
|
125
|
+
homeDir,
|
|
126
|
+
docPath: params.doc,
|
|
127
|
+
...(params.agent ? { builderAgent: params.agent } : {}),
|
|
128
|
+
...(params.runtime ? { runtime: params.runtime } : {}),
|
|
129
|
+
...(params.runtimeImage ? { runtimeImage: params.runtimeImage } : {}),
|
|
130
|
+
...(params.runtimeTemplate ? { runtimeTemplate: params.runtimeTemplate } : {}),
|
|
131
|
+
...(params.detach ? { detach: params.detach } : {}),
|
|
132
|
+
...(params.mountPoeCode ? { mountPoeCode: params.mountPoeCode } : {}),
|
|
133
|
+
configuredDefaultAgent: commandConfig.configuredDefaultAgent,
|
|
134
|
+
assumeYes: true,
|
|
135
|
+
interactive: false,
|
|
136
|
+
useDashboard: false,
|
|
137
|
+
env: process.env,
|
|
138
|
+
integrations,
|
|
139
|
+
...(commandConfig.planDirectory ? { planDirectory: commandConfig.planDirectory } : {}),
|
|
140
|
+
...(runners?.runLoop ? { runLoop: runners.runLoop } : {})
|
|
141
|
+
};
|
|
142
|
+
return integrations
|
|
143
|
+
? await integrations.traceRun("superintendent", params.doc ?? "run", () => runSuperintendentCommand(runOptions))
|
|
144
|
+
: await runSuperintendentCommand(runOptions);
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
await integrations?.shutdown();
|
|
148
|
+
}
|
|
125
149
|
},
|
|
126
150
|
render: runCommand.render
|
|
127
151
|
});
|
|
@@ -136,13 +160,14 @@ async function resolveSuperintendentCommandConfig(cwd, homeDir, env, fs) {
|
|
|
136
160
|
const superintendentResolved = resolveScope(superintendentConfigScope.schema, document[superintendentConfigScope.scope], env);
|
|
137
161
|
const coreResolved = resolveScope(coreDefaultAgentConfigSchema, document.core, env);
|
|
138
162
|
return {
|
|
163
|
+
configDoc: document,
|
|
139
164
|
configuredDefaultAgent: normalizeAgentSelection(coreResolved.defaultAgent) ?? null,
|
|
140
165
|
...(planDirectory ? { planDirectory } : {}),
|
|
141
166
|
tui: superintendentResolved.tui === true
|
|
142
167
|
};
|
|
143
168
|
}
|
|
144
169
|
catch {
|
|
145
|
-
return { configuredDefaultAgent: null, tui: false };
|
|
170
|
+
return { configDoc: {}, configuredDefaultAgent: null, tui: false };
|
|
146
171
|
}
|
|
147
172
|
}
|
|
148
173
|
async function resolveSuperintendentPlanDirectory(cwd, homeDir, env, fs) {
|
|
@@ -195,6 +220,16 @@ export async function runSuperintendentCommand(options) {
|
|
|
195
220
|
const useDashboard = options.useDashboard ?? resolveOutputFormat() === "terminal";
|
|
196
221
|
const stderr = options.stderr ?? process.stderr;
|
|
197
222
|
const exitProcess = options.exit ?? ((code) => process.exit(code));
|
|
223
|
+
const integrations = options.integrations ?? null;
|
|
224
|
+
const shutdownAndExit = (code) => {
|
|
225
|
+
if (!integrations) {
|
|
226
|
+
exitProcess(code);
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
void integrations.shutdown().finally(() => {
|
|
230
|
+
exitProcess(code);
|
|
231
|
+
});
|
|
232
|
+
};
|
|
198
233
|
const selectedDocPath = await resolveDocPath({
|
|
199
234
|
cwd: options.cwd,
|
|
200
235
|
homeDir: options.homeDir,
|
|
@@ -233,7 +268,7 @@ export async function runSuperintendentCommand(options) {
|
|
|
233
268
|
const headlessAbort = new AbortController();
|
|
234
269
|
const headlessSigint = () => {
|
|
235
270
|
headlessAbort.abort();
|
|
236
|
-
|
|
271
|
+
shutdownAndExit(130);
|
|
237
272
|
};
|
|
238
273
|
process.on("SIGINT", headlessSigint);
|
|
239
274
|
try {
|
|
@@ -244,7 +279,7 @@ export async function runSuperintendentCommand(options) {
|
|
|
244
279
|
...(options.fs ? { fs } : {}),
|
|
245
280
|
signal: headlessAbort.signal,
|
|
246
281
|
logDir: runLogDir,
|
|
247
|
-
callbacks: {
|
|
282
|
+
callbacks: mergeLoopCallbacks({
|
|
248
283
|
onBuilderStart: () => {
|
|
249
284
|
activeStage = "builder";
|
|
250
285
|
},
|
|
@@ -275,17 +310,19 @@ export async function runSuperintendentCommand(options) {
|
|
|
275
310
|
onOwnerComplete: () => {
|
|
276
311
|
activeStage = undefined;
|
|
277
312
|
}
|
|
278
|
-
},
|
|
313
|
+
}, integrations?.superintendentCallbacks),
|
|
279
314
|
runAgent: createAgentRunner({
|
|
280
315
|
session: undefined,
|
|
281
316
|
executeAgent: options.executeAgent,
|
|
282
317
|
selectedBuilderAgent,
|
|
318
|
+
integrations,
|
|
283
319
|
runtime: {
|
|
284
320
|
runtime: options.runtime,
|
|
285
321
|
runtimeImage: options.runtimeImage,
|
|
286
322
|
runtimeTemplate: options.runtimeTemplate,
|
|
287
323
|
detach: options.detach,
|
|
288
|
-
mountPoeCode: options.mountPoeCode
|
|
324
|
+
mountPoeCode: options.mountPoeCode,
|
|
325
|
+
runnerSync: options.runnerSync
|
|
289
326
|
},
|
|
290
327
|
activeStage: () => activeStage,
|
|
291
328
|
now,
|
|
@@ -452,7 +489,7 @@ export async function runSuperintendentCommand(options) {
|
|
|
452
489
|
abortController.abort();
|
|
453
490
|
session.dashboard.stop();
|
|
454
491
|
session.dashboard.destroy();
|
|
455
|
-
|
|
492
|
+
shutdownAndExit(130);
|
|
456
493
|
};
|
|
457
494
|
const handleDashboardCommand = (command) => {
|
|
458
495
|
if (command === "forceQuit") {
|
|
@@ -525,19 +562,21 @@ export async function runSuperintendentCommand(options) {
|
|
|
525
562
|
cwd: options.cwd,
|
|
526
563
|
homeDir: options.homeDir,
|
|
527
564
|
...(options.fs ? { fs } : {}),
|
|
528
|
-
callbacks,
|
|
565
|
+
callbacks: mergeLoopCallbacks(callbacks, integrations?.superintendentCallbacks),
|
|
529
566
|
signal: abortController.signal,
|
|
530
567
|
logDir: runLogDir,
|
|
531
568
|
runAgent: createAgentRunner({
|
|
532
569
|
session,
|
|
533
570
|
executeAgent: options.executeAgent,
|
|
534
571
|
selectedBuilderAgent,
|
|
572
|
+
integrations,
|
|
535
573
|
runtime: {
|
|
536
574
|
runtime: options.runtime,
|
|
537
575
|
runtimeImage: options.runtimeImage,
|
|
538
576
|
runtimeTemplate: options.runtimeTemplate,
|
|
539
577
|
detach: options.detach,
|
|
540
|
-
mountPoeCode: options.mountPoeCode
|
|
578
|
+
mountPoeCode: options.mountPoeCode,
|
|
579
|
+
runnerSync: options.runnerSync
|
|
541
580
|
},
|
|
542
581
|
activeStage: () => session.activeStage,
|
|
543
582
|
now,
|
|
@@ -683,7 +722,8 @@ function createAgentRunner(options) {
|
|
|
683
722
|
return async (input) => {
|
|
684
723
|
const activeStage = options.activeStage();
|
|
685
724
|
const agent = activeStage === "builder" ? options.selectedBuilderAgent : input.agent;
|
|
686
|
-
const executeAgent = options.executeAgent ??
|
|
725
|
+
const executeAgent = options.executeAgent ??
|
|
726
|
+
((nextAgent, nextInput) => executeSpawnAgent(nextAgent, nextInput, options.integrations));
|
|
687
727
|
const stageLabel = formatStageLabel(activeStage);
|
|
688
728
|
const emitLine = (kind, line) => {
|
|
689
729
|
if (line.length === 0) {
|
|
@@ -755,12 +795,12 @@ function formatStageLabel(stage) {
|
|
|
755
795
|
}
|
|
756
796
|
return `inspector:${stage.inspector}`;
|
|
757
797
|
}
|
|
758
|
-
async function executeSpawnAgent(agent, input) {
|
|
798
|
+
async function executeSpawnAgent(agent, input, integrations) {
|
|
759
799
|
if (parseAgentSpecifier(agent).agent === "poe-agent") {
|
|
760
800
|
return executePoeAgent(agent, input);
|
|
761
801
|
}
|
|
762
802
|
if ((input.onStdout || input.onStderr) && supportsStreaming(agent)) {
|
|
763
|
-
return executeSpawnAgentStreaming(agent, input);
|
|
803
|
+
return executeSpawnAgentStreaming(agent, input, integrations);
|
|
764
804
|
}
|
|
765
805
|
const tee = input.onStdout || input.onStderr
|
|
766
806
|
? {
|
|
@@ -781,6 +821,7 @@ async function executeSpawnAgent(agent, input) {
|
|
|
781
821
|
...(input.runtimeTemplate ? { runtimeTemplate: input.runtimeTemplate } : {}),
|
|
782
822
|
...(input.detach ? { detach: input.detach } : {}),
|
|
783
823
|
...(input.mountPoeCode ? { mountPoeCode: input.mountPoeCode } : {}),
|
|
824
|
+
...(input.runnerSync ? { runnerSync: input.runnerSync } : {}),
|
|
784
825
|
...(tee ? { tee } : {})
|
|
785
826
|
});
|
|
786
827
|
return {
|
|
@@ -795,7 +836,7 @@ function supportsStreaming(agent) {
|
|
|
795
836
|
const config = getSpawnConfig(agent);
|
|
796
837
|
return config?.kind === "cli";
|
|
797
838
|
}
|
|
798
|
-
async function executeSpawnAgentStreaming(agent, input) {
|
|
839
|
+
async function executeSpawnAgentStreaming(agent, input, integrations) {
|
|
799
840
|
const writer = (line) => {
|
|
800
841
|
input.onStdout?.(`${line}\n`);
|
|
801
842
|
};
|
|
@@ -812,6 +853,7 @@ async function executeSpawnAgentStreaming(agent, input) {
|
|
|
812
853
|
...(input.runtimeTemplate ? { runtimeTemplate: input.runtimeTemplate } : {}),
|
|
813
854
|
...(input.detach ? { detach: input.detach } : {}),
|
|
814
855
|
...(input.mountPoeCode ? { mountPoeCode: input.mountPoeCode } : {}),
|
|
856
|
+
...(input.runnerSync ? { runnerSync: input.runnerSync } : {}),
|
|
815
857
|
...(input.onStderr ? { tee: { stderr: { write: input.onStderr } } } : {})
|
|
816
858
|
});
|
|
817
859
|
const middlewareContext = {
|
|
@@ -826,7 +868,12 @@ async function executeSpawnAgentStreaming(agent, input) {
|
|
|
826
868
|
...(input.logPath ? { logPath: input.logPath } : {}),
|
|
827
869
|
...(input.mode ? { mode: input.mode } : {})
|
|
828
870
|
};
|
|
829
|
-
await applyMiddlewares([
|
|
871
|
+
await applyMiddlewares([
|
|
872
|
+
spawnLog,
|
|
873
|
+
usageCapture,
|
|
874
|
+
sessionCapture,
|
|
875
|
+
...(integrations?.spawnMiddleware ? [integrations.spawnMiddleware] : [])
|
|
876
|
+
], middlewareContext);
|
|
830
877
|
await acp.withAcpWriter(writer, () => renderAcpStream(middlewareContext.eventStream ?? rawEvents));
|
|
831
878
|
const final = await done;
|
|
832
879
|
const logFile = middlewareContext.logFile ?? final.logFile;
|
|
@@ -127,6 +127,7 @@ export declare const superintendentGroup: import("toolcraft").Group<{
|
|
|
127
127
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
128
128
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
129
129
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
130
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
130
131
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
131
132
|
}>, undefined, import("./run.js").SuperintendentRunCommandResult> & {
|
|
132
133
|
readonly __agentKitCommandTypeInfo: import("toolcraft").CommandTypeInfo<"run", import("toolcraft-schema").ObjectSchema<{
|
|
@@ -137,6 +138,7 @@ export declare const superintendentGroup: import("toolcraft").Group<{
|
|
|
137
138
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
138
139
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
139
140
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
141
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
140
142
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
141
143
|
}>, import("./run.js").SuperintendentRunCommandResult, ("cli" | "sdk")[], undefined>;
|
|
142
144
|
}) | (import("toolcraft").Command<{
|
|
@@ -229,6 +231,7 @@ export declare function createSuperintendentMcpGroup(runners?: SuperintendentMcp
|
|
|
229
231
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
230
232
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
231
233
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
234
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
232
235
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
233
236
|
}>, undefined, import("./run.js").SuperintendentRunCommandResult> & {
|
|
234
237
|
readonly __agentKitCommandTypeInfo: import("toolcraft").CommandTypeInfo<"run", import("toolcraft-schema").ObjectSchema<{
|
|
@@ -239,6 +242,7 @@ export declare function createSuperintendentMcpGroup(runners?: SuperintendentMcp
|
|
|
239
242
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
240
243
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
241
244
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
245
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
242
246
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
243
247
|
}>, import("./run.js").SuperintendentRunCommandResult, "mcp"[], undefined>;
|
|
244
248
|
}) | (import("toolcraft").Command<{
|
|
@@ -330,6 +334,7 @@ export declare const superintendentMcpGroup: import("toolcraft").Group<{
|
|
|
330
334
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
331
335
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
332
336
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
337
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
333
338
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
334
339
|
}>, undefined, import("./run.js").SuperintendentRunCommandResult> & {
|
|
335
340
|
readonly __agentKitCommandTypeInfo: import("toolcraft").CommandTypeInfo<"run", import("toolcraft-schema").ObjectSchema<{
|
|
@@ -340,6 +345,7 @@ export declare const superintendentMcpGroup: import("toolcraft").Group<{
|
|
|
340
345
|
readonly runtimeTemplate: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").StringSchema>;
|
|
341
346
|
readonly detach: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
342
347
|
readonly mountPoeCode: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
348
|
+
readonly runnerSync: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").EnumSchema<readonly ["both", "upload", "none"]>>;
|
|
343
349
|
readonly tui: import("toolcraft-schema").OptionalSchema<import("toolcraft-schema").BooleanSchema>;
|
|
344
350
|
}>, import("./run.js").SuperintendentRunCommandResult, "mcp"[], undefined>;
|
|
345
351
|
}) | (import("toolcraft").Command<{
|
|
@@ -26,7 +26,8 @@ export async function runAutonomousAgent(input) {
|
|
|
26
26
|
...(input.runtimeImage ? { runtimeImage: input.runtimeImage } : {}),
|
|
27
27
|
...(input.runtimeTemplate ? { runtimeTemplate: input.runtimeTemplate } : {}),
|
|
28
28
|
...(input.detach ? { detach: input.detach } : {}),
|
|
29
|
-
...(input.mountPoeCode ? { mountPoeCode: input.mountPoeCode } : {})
|
|
29
|
+
...(input.mountPoeCode ? { mountPoeCode: input.mountPoeCode } : {}),
|
|
30
|
+
...(input.runnerSync ? { runnerSync: input.runnerSync } : {})
|
|
30
31
|
});
|
|
31
32
|
}
|
|
32
33
|
const spawnArgs = buildSpawnArgs(input.agent, {
|
|
@@ -47,7 +48,8 @@ export async function runAutonomousAgent(input) {
|
|
|
47
48
|
runtimeImage: input.runtimeImage,
|
|
48
49
|
runtimeTemplate: input.runtimeTemplate,
|
|
49
50
|
detach: input.detach,
|
|
50
|
-
mountPoeCode: input.mountPoeCode
|
|
51
|
+
mountPoeCode: input.mountPoeCode,
|
|
52
|
+
runnerSync: input.runnerSync
|
|
51
53
|
},
|
|
52
54
|
openSpec: {
|
|
53
55
|
execution: {
|