u-foo 2.5.15 → 3.0.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/package.json +1 -1
- package/src/code/agent.js +350 -246
- package/src/code/commands.js +16 -0
- package/src/code/context/assembler.js +18 -13
- package/src/code/context/executionSegment.js +102 -119
- package/src/code/context/index.js +11 -1
- package/src/code/context/planGraph.js +1410 -0
- package/src/code/context/planGraphService.js +857 -0
- package/src/code/context/planMode.js +405 -0
- package/src/code/context/planProjection.js +432 -0
- package/src/code/context/promptLayers.js +21 -5
- package/src/code/context/stateCommit.js +2 -0
- package/src/code/context/toolRuntime.js +172 -0
- package/src/code/context/userInteraction.js +457 -0
- package/src/code/context/userNudge.js +116 -0
- package/src/code/dispatch.js +17 -1
- package/src/code/index.js +4 -0
- package/src/code/nativeRunner.js +589 -172
- package/src/code/protocol/controlPlane.js +93 -0
- package/src/code/protocol/faultHarness.js +90 -0
- package/src/code/protocol/index.js +20 -0
- package/src/code/protocol/loopEvents.js +102 -0
- package/src/code/protocol/materialize.js +107 -0
- package/src/code/protocol/messageFixtures.js +116 -0
- package/src/code/protocol/ownership.js +147 -0
- package/src/code/protocol/protocolValidator.js +165 -0
- package/src/code/protocol/suspension.js +173 -0
- package/src/code/protocol/toolCallLedger.js +222 -0
- package/src/code/protocol/transitions.js +97 -0
- package/src/code/providers/anthropicMessagesTransport.js +93 -0
- package/src/code/providers/index.js +7 -0
- package/src/code/providers/openaiChatTransport.js +98 -0
- package/src/code/providers/transportContract.js +46 -0
- package/src/code/repl.js +147 -18
- package/src/code/runtime/agentWakeup.js +58 -0
- package/src/code/runtime/graphOwner.js +41 -0
- package/src/code/runtime/graphYieldRouter.js +42 -0
- package/src/code/runtime/index.js +15 -0
- package/src/code/runtime/loopMailbox.js +124 -0
- package/src/code/runtime/runtimeEvents.js +39 -0
- package/src/code/runtime/taskControl.js +565 -0
- package/src/code/runtime/taskFocus.js +165 -0
- package/src/code/runtime/taskLoop.js +394 -0
- package/src/code/runtime/taskRun.js +348 -0
- package/src/code/runtime/toolProvenance.js +70 -0
- package/src/code/runtime/workspaceLease.js +249 -0
- package/src/code/sessionStore.js +1 -10
- package/src/code/skills/injection.js +1 -0
- package/src/code/taskDecomposer.js +32 -8
- package/src/code/taskRoute.js +73 -0
- package/src/code/tools/askUser.js +11 -0
- package/src/code/tools/planGraph.js +29 -0
- package/src/ui/format/index.js +25 -1
- package/src/ui/format/markdownRenderer.js +224 -2
- package/src/ui/ink/UcodeApp.js +268 -22
- package/src/code/context/featureFlag.js +0 -13
package/src/code/commands.js
CHANGED
|
@@ -8,6 +8,7 @@ const UCODE_COMMAND_REGISTRY = [
|
|
|
8
8
|
{ cmd: "/help", desc: "Show available commands", order: 10 },
|
|
9
9
|
{ cmd: "/status", desc: "Show session / usage status", order: 20 },
|
|
10
10
|
{ cmd: "/model", desc: "Show or switch the active model", order: 25 },
|
|
11
|
+
{ cmd: "/plan", desc: "Show plan progress or set plan mode", order: 27 },
|
|
11
12
|
{ cmd: "/ubus", desc: "Check pending bus messages", order: 30 },
|
|
12
13
|
{ cmd: "/resume", desc: "Resume a saved session", order: 40 },
|
|
13
14
|
{ cmd: "/skills", desc: "List or show skills", order: 50 },
|
|
@@ -23,6 +24,20 @@ const UCODE_COMMAND_TREE = {
|
|
|
23
24
|
hasArguments: true,
|
|
24
25
|
optionalArguments: true,
|
|
25
26
|
},
|
|
27
|
+
"/plan": {
|
|
28
|
+
desc: "Show plan progress or set plan mode",
|
|
29
|
+
hasArguments: true,
|
|
30
|
+
optionalArguments: true,
|
|
31
|
+
children: {
|
|
32
|
+
on: { desc: "Enable plan mode", order: 1 },
|
|
33
|
+
off: { desc: "Disable plan mode", order: 2 },
|
|
34
|
+
show: { desc: "Show plan band and status", order: 3 },
|
|
35
|
+
hide: { desc: "Hide plan band", order: 4 },
|
|
36
|
+
focus: { desc: "Expand plan band with task detail", order: 5 },
|
|
37
|
+
debug: { desc: "Show raw graph debug band", order: 6 },
|
|
38
|
+
clear: { desc: "Clear plan graph (stay in mode)", order: 7 },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
26
41
|
"/ubus": { desc: "Check pending bus messages" },
|
|
27
42
|
"/resume": { desc: "Resume a saved session", hasArguments: true },
|
|
28
43
|
"/skills": {
|
|
@@ -45,6 +60,7 @@ function listUcodeCommandsForHelp() {
|
|
|
45
60
|
" /ubus",
|
|
46
61
|
" /status",
|
|
47
62
|
" /model [model-id]",
|
|
63
|
+
" /plan [on|off|show|hide|focus|debug|clear]",
|
|
48
64
|
" /skills [list]",
|
|
49
65
|
" /skills show <name>",
|
|
50
66
|
" /bg <task>",
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const { isContextV2Enabled } = require("./featureFlag");
|
|
4
3
|
const {
|
|
5
4
|
loadTranscript,
|
|
6
5
|
transcriptEventsToMessages,
|
|
@@ -33,6 +32,8 @@ const {
|
|
|
33
32
|
pruneWorkingSetByRetention,
|
|
34
33
|
} = require("./workingSet");
|
|
35
34
|
const { renderExecutionSegmentContext } = require("./executionSegment");
|
|
35
|
+
const { renderPlanModeContext } = require("./planMode");
|
|
36
|
+
const { drainAgentMailboxForTurn } = require("../runtime/agentWakeup");
|
|
36
37
|
|
|
37
38
|
const DEFAULT_TRANSCRIPT_WINDOW = 12;
|
|
38
39
|
const DEFAULT_RECENT_TOOL_EVENTS = 4;
|
|
@@ -47,7 +48,6 @@ function defaultContextPolicy(env = process.env) {
|
|
|
47
48
|
return {
|
|
48
49
|
transcriptWindow: resolveTranscriptWindow(env),
|
|
49
50
|
commitInterval: resolveCommitInterval(env),
|
|
50
|
-
v2: isContextV2Enabled(env),
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -342,11 +342,11 @@ function buildModelMessagesFromTranscript(transcriptEvents = [], session = {}, w
|
|
|
342
342
|
}
|
|
343
343
|
|
|
344
344
|
function buildRecentMessages(transcriptEvents = [], windowSize = DEFAULT_TRANSCRIPT_WINDOW, session = null) {
|
|
345
|
-
if (session
|
|
345
|
+
if (session) {
|
|
346
346
|
return buildModelMessagesFromTranscript(transcriptEvents, session, windowSize);
|
|
347
347
|
}
|
|
348
348
|
const recent = eventsSliceWindow(transcriptEvents, windowSize);
|
|
349
|
-
return recent.map((event) => eventToModelMessage(event, { preferArtifact:
|
|
349
|
+
return recent.map((event) => eventToModelMessage(event, { preferArtifact: true })).filter(Boolean);
|
|
350
350
|
}
|
|
351
351
|
|
|
352
352
|
function eventsSliceWindow(events = [], windowSize = DEFAULT_TRANSCRIPT_WINDOW) {
|
|
@@ -397,6 +397,16 @@ function assembleModelContext(session = {}, request = {}, env = process.env) {
|
|
|
397
397
|
].filter(Boolean).join("\n\n"),
|
|
398
398
|
turnDynamic: [
|
|
399
399
|
request.turnDynamic || "",
|
|
400
|
+
(() => {
|
|
401
|
+
try {
|
|
402
|
+
const { MAX_CONCURRENT_WRITE_LEASES } = require("../runtime/workspaceLease");
|
|
403
|
+
return `Current max concurrent writing TaskRuns: ${MAX_CONCURRENT_WRITE_LEASES}`;
|
|
404
|
+
} catch {
|
|
405
|
+
return "";
|
|
406
|
+
}
|
|
407
|
+
})(),
|
|
408
|
+
renderPlanModeContext(session.executionState),
|
|
409
|
+
drainAgentMailboxForTurn(session.executionState).text,
|
|
400
410
|
renderProjectSnapshotContext(session.projectSnapshot),
|
|
401
411
|
renderWorkingSetContext(session.workingSet, session),
|
|
402
412
|
renderExecutionSegmentContext(session.executionState),
|
|
@@ -541,7 +551,7 @@ function syncMessagesToTranscript(session = {}, messages = [], workspaceRoot = p
|
|
|
541
551
|
: null;
|
|
542
552
|
if (baseline == null) {
|
|
543
553
|
const existingMessages = transcriptEventsToMessages(prior, {
|
|
544
|
-
preferArtifact:
|
|
554
|
+
preferArtifact: true,
|
|
545
555
|
});
|
|
546
556
|
baseline = matchTranscriptBaseline(existingMessages, full);
|
|
547
557
|
}
|
|
@@ -549,7 +559,7 @@ function syncMessagesToTranscript(session = {}, messages = [], workspaceRoot = p
|
|
|
549
559
|
|
|
550
560
|
if (full.length <= baseline) {
|
|
551
561
|
session.nlMessages = transcriptEventsToMessages(session.transcriptEvents, {
|
|
552
|
-
preferArtifact:
|
|
562
|
+
preferArtifact: true,
|
|
553
563
|
});
|
|
554
564
|
return session.transcriptEvents || prior;
|
|
555
565
|
}
|
|
@@ -560,15 +570,10 @@ function syncMessagesToTranscript(session = {}, messages = [], workspaceRoot = p
|
|
|
560
570
|
? session.executionState.currentSegmentId
|
|
561
571
|
: "",
|
|
562
572
|
};
|
|
563
|
-
|
|
564
|
-
appendTranscriptMessagesForStorage(workspaceRoot, sessionId, delta, extra);
|
|
565
|
-
} else {
|
|
566
|
-
const { appendTranscriptMessages } = require("./transcript");
|
|
567
|
-
appendTranscriptMessages(workspaceRoot, sessionId, delta, extra);
|
|
568
|
-
}
|
|
573
|
+
appendTranscriptMessagesForStorage(workspaceRoot, sessionId, delta, extra);
|
|
569
574
|
session.transcriptEvents = loadTranscript(workspaceRoot, sessionId).events;
|
|
570
575
|
session.nlMessages = transcriptEventsToMessages(session.transcriptEvents, {
|
|
571
|
-
preferArtifact:
|
|
576
|
+
preferArtifact: true,
|
|
572
577
|
});
|
|
573
578
|
session.summary = buildRollingSummary(session.transcriptEvents, session.summary, session);
|
|
574
579
|
return session.transcriptEvents;
|
|
@@ -1,17 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { randomUUID } = require("crypto");
|
|
4
|
+
const {
|
|
5
|
+
executePlanGraph,
|
|
6
|
+
planGraphFromExecutionSegment,
|
|
7
|
+
compilePlanGraph,
|
|
8
|
+
} = require("./planGraph");
|
|
4
9
|
|
|
5
10
|
function emptyExecutionState() {
|
|
11
|
+
// Durable execution control plane. Field ownership: see
|
|
12
|
+
// src/code/protocol/ownership.js (STATE_OWNERSHIP / DURABLE_FIELDS).
|
|
6
13
|
return {
|
|
7
14
|
currentSegmentId: "",
|
|
8
15
|
mode: "single_action",
|
|
16
|
+
planMode: false,
|
|
17
|
+
planModeSource: "",
|
|
18
|
+
// R5 orthognal fields (dual-written with planMode during migration)
|
|
19
|
+
planningPolicy: "direct_allowed",
|
|
20
|
+
executionOwner: { kind: "none", id: "" },
|
|
9
21
|
steps: {},
|
|
10
22
|
modifiedFiles: [],
|
|
11
23
|
lastExitCodes: [],
|
|
12
24
|
approvals: [],
|
|
13
25
|
retries: {},
|
|
14
26
|
segments: [],
|
|
27
|
+
pendingUserPrompts: [],
|
|
28
|
+
planGraph: require("./planGraphService").emptyPlanGraphState(),
|
|
29
|
+
graphs: {},
|
|
30
|
+
taskRuns: require("../runtime/taskRun").emptyTaskRunStore(),
|
|
31
|
+
agentMailbox: require("../runtime/loopMailbox").emptyMailbox(),
|
|
32
|
+
taskMailboxes: {},
|
|
33
|
+
workspaceLease: require("../runtime/workspaceLease").emptyWorkspaceLease(),
|
|
34
|
+
planUi: { bandMode: "auto" },
|
|
35
|
+
pendingUserInteraction: null,
|
|
15
36
|
};
|
|
16
37
|
}
|
|
17
38
|
|
|
@@ -93,19 +114,29 @@ function shouldStopSegment(executionState = null, {
|
|
|
93
114
|
}
|
|
94
115
|
|
|
95
116
|
function renderExecutionSegmentContext(executionState = null) {
|
|
96
|
-
if (!executionState ||
|
|
97
|
-
const lines = [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
lines.push(
|
|
107
|
-
|
|
108
|
-
|
|
117
|
+
if (!executionState || typeof executionState !== "object") return "";
|
|
118
|
+
const lines = [];
|
|
119
|
+
if (executionState.planMode) {
|
|
120
|
+
// Detailed plan-mode instructions come from renderPlanModeContext.
|
|
121
|
+
lines.push("Execution mode: plan_mode");
|
|
122
|
+
}
|
|
123
|
+
if (!executionState.currentSegmentId && !(executionState.planGraph && executionState.planGraph.graphId)) {
|
|
124
|
+
return lines.join("\n");
|
|
125
|
+
}
|
|
126
|
+
if (executionState.currentSegmentId) {
|
|
127
|
+
lines.push(
|
|
128
|
+
"Current Execution Segment:",
|
|
129
|
+
`- Segment: ${executionState.currentSegmentId}`,
|
|
130
|
+
`- Mode: ${executionState.mode || "single_action"}`,
|
|
131
|
+
);
|
|
132
|
+
const steps = executionState.steps && typeof executionState.steps === "object"
|
|
133
|
+
? Object.entries(executionState.steps)
|
|
134
|
+
: [];
|
|
135
|
+
if (steps.length > 0) {
|
|
136
|
+
lines.push("Step status:");
|
|
137
|
+
for (const [id, info] of steps) {
|
|
138
|
+
lines.push(`- ${id}: ${info.status}${info.error ? ` (${info.error})` : ""}`);
|
|
139
|
+
}
|
|
109
140
|
}
|
|
110
141
|
}
|
|
111
142
|
return lines.join("\n");
|
|
@@ -118,21 +149,9 @@ function parseExecutionSegment(sideEffects = null) {
|
|
|
118
149
|
return null;
|
|
119
150
|
}
|
|
120
151
|
|
|
121
|
-
const DEFAULT_MAX_SEGMENT_STEPS =
|
|
152
|
+
const DEFAULT_MAX_SEGMENT_STEPS = 16;
|
|
122
153
|
const SIDE_EFFECT_TOOLS = new Set(["write", "edit"]);
|
|
123
154
|
|
|
124
|
-
function resolveStepArgs(args = {}, stepOutputs = new Map()) {
|
|
125
|
-
const next = args && typeof args === "object" ? { ...args } : {};
|
|
126
|
-
const argsJson = JSON.stringify(next);
|
|
127
|
-
for (const [depId, depValue] of stepOutputs.entries()) {
|
|
128
|
-
const token = `\${${depId}.matches}`;
|
|
129
|
-
if (argsJson.includes(token) && depValue && depValue.matches) {
|
|
130
|
-
next.matches = depValue.matches;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return next;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
155
|
function isSideEffectTool(tool = "") {
|
|
137
156
|
return SIDE_EFFECT_TOOLS.has(String(tool || "").trim().toLowerCase());
|
|
138
157
|
}
|
|
@@ -146,9 +165,14 @@ function formatSegmentResultMessage(result = {}) {
|
|
|
146
165
|
stoppedAt: result.stoppedAt || "",
|
|
147
166
|
steps: Array.isArray(result.results) ? result.results : [],
|
|
148
167
|
error: result.error || "",
|
|
168
|
+
plan: result.summary || null,
|
|
149
169
|
});
|
|
150
170
|
}
|
|
151
171
|
|
|
172
|
+
/**
|
|
173
|
+
* Execute a legacy execution_segment via the unified plan graph engine.
|
|
174
|
+
* Preserves the previous return shape used by agent/nativeRunner.
|
|
175
|
+
*/
|
|
152
176
|
function executeExecutionSegment({
|
|
153
177
|
segment = {},
|
|
154
178
|
executionState = null,
|
|
@@ -162,113 +186,69 @@ function executeExecutionSegment({
|
|
|
162
186
|
const cappedSegment = { ...normalized, steps: cappedSteps };
|
|
163
187
|
const { state: startedState, segmentId } = startExecutionSegment(executionState, cappedSegment);
|
|
164
188
|
let state = startedState;
|
|
165
|
-
const stepOutputs = new Map();
|
|
166
|
-
const results = [];
|
|
167
|
-
const checkpointAfter = new Set(
|
|
168
|
-
Array.isArray(cappedSegment.checkpoint && cappedSegment.checkpoint.after)
|
|
169
|
-
? cappedSegment.checkpoint.after.map(String)
|
|
170
|
-
: [],
|
|
171
|
-
);
|
|
172
|
-
let stoppedAt = "";
|
|
173
|
-
let fatalError = "";
|
|
174
189
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
190
|
+
const plan = planGraphFromExecutionSegment(cappedSegment);
|
|
191
|
+
plan.id = segmentId;
|
|
192
|
+
|
|
193
|
+
const graphResult = executePlanGraph(plan, {
|
|
194
|
+
maxNodeRuns: Math.max(1, Math.floor(maxSteps)) * 2,
|
|
195
|
+
runStep: ({ stepId, tool, args }) => {
|
|
196
|
+
if (typeof onStepStart === "function") {
|
|
197
|
+
try {
|
|
198
|
+
onStepStart({ stepId, tool, args });
|
|
199
|
+
} catch {
|
|
200
|
+
// ignore
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
const result = runStep({ stepId, tool, args }) || { ok: false, error: "step failed" };
|
|
204
|
+
if (typeof onStepComplete === "function") {
|
|
205
|
+
try {
|
|
206
|
+
onStepComplete({ stepId, tool, args, result });
|
|
207
|
+
} catch {
|
|
208
|
+
// ignore
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
if (result && result.ok !== false) {
|
|
179
212
|
state = recordStepResult(state, {
|
|
180
|
-
stepId
|
|
213
|
+
stepId,
|
|
214
|
+
status: "success",
|
|
215
|
+
artifactId: result.artifactId || "",
|
|
216
|
+
exitCode: Number.isFinite(result.code) ? result.code : null,
|
|
217
|
+
});
|
|
218
|
+
} else {
|
|
219
|
+
state = recordStepResult(state, {
|
|
220
|
+
stepId,
|
|
181
221
|
status: "failed",
|
|
182
|
-
error:
|
|
222
|
+
error: String((result && result.error) || "step failed"),
|
|
183
223
|
});
|
|
184
|
-
fatalError = `segment dependency missing: ${dep}`;
|
|
185
|
-
state = completeExecutionSegment(state, { status: "failed", error: fatalError });
|
|
186
|
-
return {
|
|
187
|
-
ok: false,
|
|
188
|
-
segmentId,
|
|
189
|
-
objective: cappedSegment.objective,
|
|
190
|
-
executionState: state,
|
|
191
|
-
results,
|
|
192
|
-
error: fatalError,
|
|
193
|
-
stoppedAt: "dependency",
|
|
194
|
-
};
|
|
195
224
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
if (typeof onStepStart === "function") {
|
|
200
|
-
try {
|
|
201
|
-
onStepStart({ stepId: step.id, tool: step.tool, args });
|
|
202
|
-
} catch {
|
|
203
|
-
// ignore
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
const result = runStep({ stepId: step.id, tool: step.tool, args }) || { ok: false, error: "step failed" };
|
|
208
|
-
const stepRecord = {
|
|
209
|
-
stepId: step.id,
|
|
210
|
-
tool: step.tool,
|
|
211
|
-
ok: result.ok !== false,
|
|
212
|
-
artifactId: result.artifactId || "",
|
|
213
|
-
error: result.error || "",
|
|
214
|
-
};
|
|
215
|
-
results.push(stepRecord);
|
|
216
|
-
|
|
217
|
-
if (result.ok === false) {
|
|
218
|
-
state = recordStepResult(state, {
|
|
219
|
-
stepId: step.id,
|
|
220
|
-
status: "failed",
|
|
221
|
-
error: String(result.error || "step failed"),
|
|
222
|
-
});
|
|
223
|
-
fatalError = String(result.error || "segment step failed");
|
|
224
|
-
state = completeExecutionSegment(state, { status: "failed", error: fatalError });
|
|
225
|
-
return {
|
|
226
|
-
ok: false,
|
|
227
|
-
segmentId,
|
|
228
|
-
objective: cappedSegment.objective,
|
|
229
|
-
executionState: state,
|
|
230
|
-
results,
|
|
231
|
-
error: fatalError,
|
|
232
|
-
stoppedAt: "error",
|
|
233
|
-
};
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
stepOutputs.set(step.id, result);
|
|
237
|
-
state = recordStepResult(state, {
|
|
238
|
-
stepId: step.id,
|
|
239
|
-
status: "success",
|
|
240
|
-
artifactId: result.artifactId || "",
|
|
241
|
-
exitCode: Number.isFinite(result.code) ? result.code : null,
|
|
242
|
-
});
|
|
225
|
+
return result;
|
|
226
|
+
},
|
|
227
|
+
});
|
|
243
228
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
}
|
|
250
|
-
}
|
|
229
|
+
const results = Array.isArray(graphResult.results) ? graphResult.results : [];
|
|
230
|
+
const stoppedAt = String(graphResult.stoppedAt || "");
|
|
231
|
+
const fatalError = graphResult.ok === false
|
|
232
|
+
? String(graphResult.error || "segment failed")
|
|
233
|
+
: "";
|
|
251
234
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (isSideEffectTool(step.tool)) {
|
|
257
|
-
stoppedAt = "side_effect";
|
|
258
|
-
break;
|
|
259
|
-
}
|
|
260
|
-
}
|
|
235
|
+
let finalStatus = "success";
|
|
236
|
+
if (fatalError) finalStatus = "failed";
|
|
237
|
+
else if (stoppedAt === "checkpoint" || stoppedAt === "waiting_llm") finalStatus = "checkpoint";
|
|
238
|
+
else if (stoppedAt === "side_effect") finalStatus = "success";
|
|
261
239
|
|
|
262
|
-
|
|
263
|
-
state = completeExecutionSegment(state, { status: finalStatus });
|
|
240
|
+
state = completeExecutionSegment(state, { status: finalStatus, error: fatalError });
|
|
264
241
|
return {
|
|
265
|
-
ok:
|
|
242
|
+
ok: graphResult.ok !== false,
|
|
266
243
|
segmentId,
|
|
267
244
|
objective: cappedSegment.objective,
|
|
268
245
|
executionState: state,
|
|
269
246
|
results,
|
|
270
|
-
error:
|
|
247
|
+
error: fatalError,
|
|
271
248
|
stoppedAt,
|
|
249
|
+
waitingFor: graphResult.waitingFor || null,
|
|
250
|
+
summary: graphResult.summary || null,
|
|
251
|
+
compile: graphResult.compile || null,
|
|
272
252
|
};
|
|
273
253
|
}
|
|
274
254
|
|
|
@@ -311,4 +291,7 @@ module.exports = {
|
|
|
311
291
|
executeExecutionSegment,
|
|
312
292
|
formatSegmentResultMessage,
|
|
313
293
|
isSideEffectTool,
|
|
294
|
+
planGraphFromExecutionSegment,
|
|
295
|
+
compilePlanGraph,
|
|
296
|
+
executePlanGraph,
|
|
314
297
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
module.exports = {
|
|
4
|
-
...require("./featureFlag"),
|
|
5
4
|
...require("./transcript"),
|
|
6
5
|
...require("./transcriptSync"),
|
|
7
6
|
...require("./artifacts"),
|
|
@@ -14,5 +13,16 @@ module.exports = {
|
|
|
14
13
|
...require("./stateCommit"),
|
|
15
14
|
...require("./workingSet"),
|
|
16
15
|
...require("./executionSegment"),
|
|
16
|
+
...require("./planGraph"),
|
|
17
|
+
...require("./planGraphService"),
|
|
18
|
+
...require("./toolRuntime"),
|
|
19
|
+
...require("./planMode"),
|
|
20
|
+
...require("./planProjection"),
|
|
21
|
+
...require("./userNudge"),
|
|
22
|
+
...require("./userInteraction"),
|
|
17
23
|
...require("./assembler"),
|
|
18
24
|
};
|
|
25
|
+
|
|
26
|
+
// Runtime TaskLoop surface (avoid name clashes by nesting under .runtime if needed by callers)
|
|
27
|
+
module.exports.runtime = require("../runtime");
|
|
28
|
+
|