@goah/cli 0.13.4 → 0.13.5
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/{chunk-EK6BTCFG.js → chunk-24NAHA3D.js} +4 -1
- package/dist/{chunk-R6GKCNTB.js → chunk-J32EKOQ4.js} +1 -1
- package/dist/{chunk-5PZFP5CO.js → chunk-ORAANUAR.js} +16 -7
- package/dist/{chunk-SQJZ5OFH.js → chunk-RDUUXBZ2.js} +68 -20
- package/dist/cli.js +23 -9
- package/dist/console/assets/{index-B1vGMXKr.js → index-DYdJZskp.js} +5 -5
- package/dist/console/assets/{index-B1vGMXKr.js.map → index-DYdJZskp.js.map} +1 -1
- package/dist/console/index.html +1 -1
- package/dist/{dist-QW77PKUJ.js → dist-EYYNPOYG.js} +1 -1
- package/dist/execution.d.ts +24 -1
- package/dist/faux-runner-worker.js +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.js +4 -4
- package/dist/pi-worker.js +27 -6
- package/dist/runner-pi.d.ts +18 -2
- package/dist/runner-pi.js +1 -1
- package/dist/{runner-registry-3WSOMXRW.js → runner-registry-XCGUS2P3.js} +2 -2
- package/dist/supervisor.d.ts +24 -0
- package/dist/supervisor.js +1 -1
- package/dist/testkit.d.ts +16 -0
- package/package.json +1 -1
package/dist/console/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="theme-color" content="#f7f7f4" />
|
|
7
7
|
<title>Goah Console</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-DYdJZskp.js"></script>
|
|
9
9
|
<link rel="stylesheet" crossorigin href="/assets/index-3sYrDMmt.css">
|
|
10
10
|
</head>
|
|
11
11
|
<body>
|
package/dist/execution.d.ts
CHANGED
|
@@ -328,6 +328,28 @@ interface RunnerTraceEvent {
|
|
|
328
328
|
type: string;
|
|
329
329
|
data: JsonValue;
|
|
330
330
|
}
|
|
331
|
+
type AssistantLiveDelta = {
|
|
332
|
+
type: "start" | "text_start" | "text_end" | "thinking_start" | "thinking_end" | "toolcall_start" | "toolcall_end";
|
|
333
|
+
contentIndex?: number;
|
|
334
|
+
} | {
|
|
335
|
+
type: "text_delta" | "thinking_delta" | "toolcall_delta";
|
|
336
|
+
contentIndex: number;
|
|
337
|
+
delta: string;
|
|
338
|
+
};
|
|
339
|
+
interface RunnerLiveEvent {
|
|
340
|
+
type: "message.assistant.delta";
|
|
341
|
+
data: {
|
|
342
|
+
messageId: string;
|
|
343
|
+
delta: AssistantLiveDelta;
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
interface TurnLiveSnapshot {
|
|
347
|
+
revision: number;
|
|
348
|
+
messageId: string;
|
|
349
|
+
text: string;
|
|
350
|
+
thinking: string;
|
|
351
|
+
thinkingActive: boolean;
|
|
352
|
+
}
|
|
331
353
|
type AgentCapability = "ledger.search" | "mail.send" | "schedule.set" | "goal.put" | "team.list" | "goal.get" | "goal.create" | "goal.work" | "goal.delegate" | "goal.reassign" | "goal.revise" | "goal.pause" | "goal.resume" | "goal.complete" | "human.request" | "work_record.list" | "work_record.read" | "work_record.history" | "work_record.diff" | "work_record.search" | "work_record.update" | "memory.append";
|
|
332
354
|
type RunnerControlMethod = "goal.handoff.validate";
|
|
333
355
|
type RunnerRpcMethod = AgentCapability | RunnerControlMethod;
|
|
@@ -431,6 +453,7 @@ interface RunRequest {
|
|
|
431
453
|
context: JsonValue;
|
|
432
454
|
now(): string;
|
|
433
455
|
emit(event: RunnerTraceEvent): void;
|
|
456
|
+
emitLive?(event: RunnerLiveEvent): void;
|
|
434
457
|
rpc?(method: RunnerRpcMethod, params: JsonValue): Promise<JsonValue>;
|
|
435
458
|
}
|
|
436
459
|
type RunnerCandidateResult = {
|
|
@@ -554,4 +577,4 @@ declare function assertTurnOutput(value: TurnOutput): void;
|
|
|
554
577
|
declare function assertGoalSnapshot(value: GoalSnapshot): void;
|
|
555
578
|
|
|
556
579
|
export { assertAgentHandoff, assertGoalSnapshot, assertGoalTransition, assertHandoff, assertTurnOutput, assertWakeTransition, goalAutomaticTarget, goalCommitment, goalRoute, humanInboxRoute, humanRequestRoute, noGoalCommitment, normalizeAssistantText, specialistAutomaticTarget, specialistInboxRoute };
|
|
557
|
-
export type { AgentCapability, AgentHandoff, AgentProfile, AgentRole, AutomaticTarget, CommittedTurnOutput, DelegationRequest, DelegationResult, GoalChangeAuthority, GoalChangeMetadata, GoalChangeOperation, GoalChangedData, GoalCommitment, GoalCompletionRequest, GoalHandoff, GoalOutcome, GoalPhase, GoalSnapshot, Handoff, HandoffCommit, HandoffValidationIssue, HandoffValidationRequest, HandoffValidationResult, HumanTurnAdmissionRequest, HumanTurnAdmissionResult, Ledger, MailLevel, MailRoute, MailSnapshot, ReassignmentRequest, ReassignmentResult, RunRequest, Runner, RunnerCandidateResult, RunnerChoice, RunnerCommandResult, RunnerConfigurator, RunnerControlMethod, RunnerDiagnostic, RunnerHandle, RunnerManifest, RunnerProfile, RunnerRpcMethod, RunnerSetupInteraction, RunnerSetupProgress, RunnerSetupTransaction, RunnerTraceEvent, ScheduleSnapshot, ScheduleStatus, SpecialistRole, TeamMemberMotion, TeamMemberView, ThreadSnapshot, TurnContext, TurnItemSnapshot, TurnItemStatus, TurnItemType, TurnOutput, TurnSnapshot, TurnStatus, TurnTrigger, TurnTriggerKind, WakeSnapshot, WakeStatus, WakeTriggerSnapshot, WakeTriggerStatus, WorkRecordDiff, WorkRecordSnapshot, WorkRecordUpdateRequest };
|
|
580
|
+
export type { AgentCapability, AgentHandoff, AgentProfile, AgentRole, AssistantLiveDelta, AutomaticTarget, CommittedTurnOutput, DelegationRequest, DelegationResult, GoalChangeAuthority, GoalChangeMetadata, GoalChangeOperation, GoalChangedData, GoalCommitment, GoalCompletionRequest, GoalHandoff, GoalOutcome, GoalPhase, GoalSnapshot, Handoff, HandoffCommit, HandoffValidationIssue, HandoffValidationRequest, HandoffValidationResult, HumanTurnAdmissionRequest, HumanTurnAdmissionResult, Ledger, MailLevel, MailRoute, MailSnapshot, ReassignmentRequest, ReassignmentResult, RunRequest, Runner, RunnerCandidateResult, RunnerChoice, RunnerCommandResult, RunnerConfigurator, RunnerControlMethod, RunnerDiagnostic, RunnerHandle, RunnerLiveEvent, RunnerManifest, RunnerProfile, RunnerRpcMethod, RunnerSetupInteraction, RunnerSetupProgress, RunnerSetupTransaction, RunnerTraceEvent, ScheduleSnapshot, ScheduleStatus, SpecialistRole, TeamMemberMotion, TeamMemberView, ThreadSnapshot, TurnContext, TurnItemSnapshot, TurnItemStatus, TurnItemType, TurnLiveSnapshot, TurnOutput, TurnSnapshot, TurnStatus, TurnTrigger, TurnTriggerKind, WakeSnapshot, WakeStatus, WakeTriggerSnapshot, WakeTriggerStatus, WorkRecordDiff, WorkRecordSnapshot, WorkRecordUpdateRequest };
|
|
@@ -2,7 +2,7 @@ import { createRequire as __goahCreateRequire } from "node:module";
|
|
|
2
2
|
const require = __goahCreateRequire(import.meta.url);
|
|
3
3
|
import {
|
|
4
4
|
runProcessWorker
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-24NAHA3D.js";
|
|
6
6
|
import "./chunk-6M3OOCKO.js";
|
|
7
7
|
import "./chunk-K26BVR6O.js";
|
|
8
8
|
import "./chunk-IIJQ3DW4.js";
|
package/dist/index.d.ts
CHANGED
|
@@ -310,6 +310,28 @@ interface RunnerTraceEvent {
|
|
|
310
310
|
type: string;
|
|
311
311
|
data: JsonValue;
|
|
312
312
|
}
|
|
313
|
+
type AssistantLiveDelta = {
|
|
314
|
+
type: "start" | "text_start" | "text_end" | "thinking_start" | "thinking_end" | "toolcall_start" | "toolcall_end";
|
|
315
|
+
contentIndex?: number;
|
|
316
|
+
} | {
|
|
317
|
+
type: "text_delta" | "thinking_delta" | "toolcall_delta";
|
|
318
|
+
contentIndex: number;
|
|
319
|
+
delta: string;
|
|
320
|
+
};
|
|
321
|
+
interface RunnerLiveEvent {
|
|
322
|
+
type: "message.assistant.delta";
|
|
323
|
+
data: {
|
|
324
|
+
messageId: string;
|
|
325
|
+
delta: AssistantLiveDelta;
|
|
326
|
+
};
|
|
327
|
+
}
|
|
328
|
+
interface TurnLiveSnapshot {
|
|
329
|
+
revision: number;
|
|
330
|
+
messageId: string;
|
|
331
|
+
text: string;
|
|
332
|
+
thinking: string;
|
|
333
|
+
thinkingActive: boolean;
|
|
334
|
+
}
|
|
313
335
|
type AgentCapability = "ledger.search" | "mail.send" | "schedule.set" | "goal.put" | "team.list" | "goal.get" | "goal.create" | "goal.work" | "goal.delegate" | "goal.reassign" | "goal.revise" | "goal.pause" | "goal.resume" | "goal.complete" | "human.request" | "work_record.list" | "work_record.read" | "work_record.history" | "work_record.diff" | "work_record.search" | "work_record.update" | "memory.append";
|
|
314
336
|
type RunnerControlMethod = "goal.handoff.validate";
|
|
315
337
|
type RunnerRpcMethod = AgentCapability | RunnerControlMethod;
|
|
@@ -346,6 +368,7 @@ interface RunRequest {
|
|
|
346
368
|
context: JsonValue;
|
|
347
369
|
now(): string;
|
|
348
370
|
emit(event: RunnerTraceEvent): void;
|
|
371
|
+
emitLive?(event: RunnerLiveEvent): void;
|
|
349
372
|
rpc?(method: RunnerRpcMethod, params: JsonValue): Promise<JsonValue>;
|
|
350
373
|
}
|
|
351
374
|
type RunnerCandidateResult = {
|
|
@@ -597,6 +620,7 @@ declare class Supervisor {
|
|
|
597
620
|
goal: GoalSnapshot;
|
|
598
621
|
}>;
|
|
599
622
|
interruptTurn(turnId: string): Promise<TurnSnapshot>;
|
|
623
|
+
liveTurnSnapshot(turnId: string, afterRevision?: number): TurnLiveSnapshot | null;
|
|
600
624
|
sendToCeo(body: JsonValue): Promise<{
|
|
601
625
|
threadId: string;
|
|
602
626
|
turnId: string;
|
package/dist/index.js
CHANGED
|
@@ -31,11 +31,11 @@ import {
|
|
|
31
31
|
updateWorkspaceRunnerProfile,
|
|
32
32
|
writeDefaultConfig,
|
|
33
33
|
writeDefaultRunnerProfile
|
|
34
|
-
} from "./chunk-
|
|
35
|
-
import "./chunk-
|
|
34
|
+
} from "./chunk-ORAANUAR.js";
|
|
35
|
+
import "./chunk-J32EKOQ4.js";
|
|
36
36
|
import "./chunk-CDELLMIJ.js";
|
|
37
|
-
import "./chunk-
|
|
38
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-RDUUXBZ2.js";
|
|
38
|
+
import "./chunk-24NAHA3D.js";
|
|
39
39
|
import "./chunk-6M3OOCKO.js";
|
|
40
40
|
import "./chunk-K26BVR6O.js";
|
|
41
41
|
import "./chunk-IIJQ3DW4.js";
|
package/dist/pi-worker.js
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-XALZLRYK.js";
|
|
6
6
|
import {
|
|
7
7
|
runProcessWorker
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-24NAHA3D.js";
|
|
9
9
|
import {
|
|
10
10
|
createPiModel,
|
|
11
11
|
fauxAssistantMessage,
|
|
@@ -51,7 +51,7 @@ ${summary}`, timestamp: Date.now() },
|
|
|
51
51
|
];
|
|
52
52
|
}
|
|
53
53
|
async function runPiWorker() {
|
|
54
|
-
await runProcessWorker(async (request, emit, rpc, controls) => {
|
|
54
|
+
await runProcessWorker(async (request, emit, rpc, controls, emitLive) => {
|
|
55
55
|
const contextRecord = typeof request.context === "object" && request.context !== null && !Array.isArray(request.context) ? request.context : {};
|
|
56
56
|
const legacyRequest = request.turn === void 0;
|
|
57
57
|
const binding = request.turn?.goalCommitment;
|
|
@@ -122,6 +122,7 @@ Follow the current Goal and explicit tools.
|
|
|
122
122
|
let responseFailure = "";
|
|
123
123
|
let compactions = 0;
|
|
124
124
|
let messageCounter = 0;
|
|
125
|
+
let activeAssistantMessageId = null;
|
|
125
126
|
const messageIds = /* @__PURE__ */ new WeakMap();
|
|
126
127
|
const emittedUsers = /* @__PURE__ */ new Set();
|
|
127
128
|
const idFor = (message) => {
|
|
@@ -205,7 +206,7 @@ This Turn has no Goal commitment. Finish with an ordinary response and do not ca
|
|
|
205
206
|
output = null;
|
|
206
207
|
const handoff = args;
|
|
207
208
|
const currentText = assistantResponseText(assistantMessage);
|
|
208
|
-
const candidate = currentText ? { id: idFor(assistantMessage), text: currentText } : lastReadableMessage;
|
|
209
|
+
const candidate = currentText ? activeAssistantMessageId ? { id: activeAssistantMessageId, text: currentText } : lastReadableMessage?.text === currentText ? lastReadableMessage : { id: idFor(assistantMessage), text: currentText } : lastReadableMessage;
|
|
209
210
|
try {
|
|
210
211
|
const result = await rpc("goal.handoff.validate", { handoff, candidateMessageId: candidate?.id ?? "", candidateMessage: candidate?.text ?? "" });
|
|
211
212
|
if (result.accepted) {
|
|
@@ -239,16 +240,25 @@ ${reason}`, terminate: result.fatal };
|
|
|
239
240
|
agent.subscribe((event) => {
|
|
240
241
|
if (event.type === "turn_start")
|
|
241
242
|
emit({ type: "turn.started", data: {} });
|
|
242
|
-
else if (event.type === "message_start"
|
|
243
|
+
else if (event.type === "message_start") {
|
|
244
|
+
if (event.message.role === "assistant") {
|
|
245
|
+
activeAssistantMessageId = idFor(event.message);
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (event.message.role !== "user")
|
|
249
|
+
return;
|
|
243
250
|
const id = idFor(event.message);
|
|
244
251
|
if (!emittedUsers.has(id)) {
|
|
245
252
|
emittedUsers.add(id);
|
|
246
253
|
emit({ type: "message.user", data: { message: transcriptMessage(event.message, id) } });
|
|
247
254
|
}
|
|
248
255
|
} else if (event.type === "message_update") {
|
|
249
|
-
|
|
256
|
+
const delta = minimalLiveDelta(event.assistantMessageEvent);
|
|
257
|
+
if (delta)
|
|
258
|
+
emitLive({ type: "message.assistant.delta", data: { messageId: activeAssistantMessageId ?? idFor(event.message), delta } });
|
|
250
259
|
} else if (event.type === "message_end" && event.message.role === "assistant") {
|
|
251
|
-
const messageId = idFor(event.message);
|
|
260
|
+
const messageId = activeAssistantMessageId ?? idFor(event.message);
|
|
261
|
+
messageIds.set(event.message, messageId);
|
|
252
262
|
const text = assistantResponseText(event.message);
|
|
253
263
|
if (text)
|
|
254
264
|
lastReadableMessage = { id: messageId, text };
|
|
@@ -256,6 +266,7 @@ ${reason}`, terminate: result.fatal };
|
|
|
256
266
|
responseFailure = event.message.errorMessage;
|
|
257
267
|
const handoffIntent = hasAgentToolCall(event.message, "handoff");
|
|
258
268
|
emit({ type: "message.assistant.completed", data: { message: transcriptMessage(event.message, messageId), commitState: handoffIntent ? "provisional" : "committed" } });
|
|
269
|
+
activeAssistantMessageId = null;
|
|
259
270
|
} else if (event.type === "tool_execution_start")
|
|
260
271
|
emit({ type: "tool.called", data: { callId: event.toolCallId, name: event.toolName, arguments: JSON.parse(JSON.stringify(event.args)) } });
|
|
261
272
|
else if (event.type === "tool_execution_end")
|
|
@@ -311,6 +322,15 @@ function transcriptMessage(message, id) {
|
|
|
311
322
|
const role = message.role === "assistant" ? "assistant" : message.role === "user" ? "user" : "tool";
|
|
312
323
|
return { id, role, content: value.content ?? value, ...value.usage !== void 0 ? { usage: value.usage } : {}, ...typeof value.stopReason === "string" ? { stopReason: value.stopReason } : {}, ...typeof value.errorMessage === "string" ? { errorMessage: value.errorMessage } : {} };
|
|
313
324
|
}
|
|
325
|
+
function minimalLiveDelta(event) {
|
|
326
|
+
if (event.type === "start")
|
|
327
|
+
return { type: "start" };
|
|
328
|
+
if (event.type === "text_delta" || event.type === "thinking_delta" || event.type === "toolcall_delta")
|
|
329
|
+
return { type: event.type, contentIndex: event.contentIndex, delta: event.delta };
|
|
330
|
+
if (event.type === "text_start" || event.type === "text_end" || event.type === "thinking_start" || event.type === "thinking_end" || event.type === "toolcall_start" || event.type === "toolcall_end")
|
|
331
|
+
return { type: event.type, contentIndex: event.contentIndex };
|
|
332
|
+
return null;
|
|
333
|
+
}
|
|
314
334
|
function createTools(root, handoff, rpc, capabilities, goalState, protectedPaths = []) {
|
|
315
335
|
const handoffTool = {
|
|
316
336
|
name: "handoff",
|
|
@@ -683,6 +703,7 @@ export {
|
|
|
683
703
|
compactMessages,
|
|
684
704
|
compactMessagesToTokenBudget,
|
|
685
705
|
linuxSandboxArgs,
|
|
706
|
+
minimalLiveDelta,
|
|
686
707
|
resolveContextPolicy,
|
|
687
708
|
runBashCommand,
|
|
688
709
|
runPiWorker,
|
package/dist/runner-pi.d.ts
CHANGED
|
@@ -103,6 +103,21 @@ interface RunnerTraceEvent {
|
|
|
103
103
|
type: string;
|
|
104
104
|
data: JsonValue;
|
|
105
105
|
}
|
|
106
|
+
type AssistantLiveDelta = {
|
|
107
|
+
type: "start" | "text_start" | "text_end" | "thinking_start" | "thinking_end" | "toolcall_start" | "toolcall_end";
|
|
108
|
+
contentIndex?: number;
|
|
109
|
+
} | {
|
|
110
|
+
type: "text_delta" | "thinking_delta" | "toolcall_delta";
|
|
111
|
+
contentIndex: number;
|
|
112
|
+
delta: string;
|
|
113
|
+
};
|
|
114
|
+
interface RunnerLiveEvent {
|
|
115
|
+
type: "message.assistant.delta";
|
|
116
|
+
data: {
|
|
117
|
+
messageId: string;
|
|
118
|
+
delta: AssistantLiveDelta;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
106
121
|
type AgentCapability = "ledger.search" | "mail.send" | "schedule.set" | "goal.put" | "team.list" | "goal.get" | "goal.create" | "goal.work" | "goal.delegate" | "goal.reassign" | "goal.revise" | "goal.pause" | "goal.resume" | "goal.complete" | "human.request" | "work_record.list" | "work_record.read" | "work_record.history" | "work_record.diff" | "work_record.search" | "work_record.update" | "memory.append";
|
|
107
122
|
type RunnerControlMethod = "goal.handoff.validate";
|
|
108
123
|
type RunnerRpcMethod = AgentCapability | RunnerControlMethod;
|
|
@@ -191,6 +206,7 @@ interface RunRequest {
|
|
|
191
206
|
context: JsonValue;
|
|
192
207
|
now(): string;
|
|
193
208
|
emit(event: RunnerTraceEvent): void;
|
|
209
|
+
emitLive?(event: RunnerLiveEvent): void;
|
|
194
210
|
rpc?(method: RunnerRpcMethod, params: JsonValue): Promise<JsonValue>;
|
|
195
211
|
}
|
|
196
212
|
type RunnerCandidateResult = {
|
|
@@ -316,7 +332,7 @@ interface ProcessRunnerOptions {
|
|
|
316
332
|
}
|
|
317
333
|
declare function piWorkerPath(): string;
|
|
318
334
|
declare function verificationWorkerPath(): string;
|
|
319
|
-
type WorkerRequest = Omit<RunRequest, "now" | "emit" | "rpc" | "turn"> & {
|
|
335
|
+
type WorkerRequest = Omit<RunRequest, "now" | "emit" | "emitLive" | "rpc" | "turn"> & {
|
|
320
336
|
turn?: TurnContext;
|
|
321
337
|
runtime?: JsonValue;
|
|
322
338
|
};
|
|
@@ -335,7 +351,7 @@ interface WorkerControls {
|
|
|
335
351
|
type WorkerRun = (request: WorkerRequest, emit: (event: {
|
|
336
352
|
type: string;
|
|
337
353
|
data: JsonValue;
|
|
338
|
-
}) => void, rpc: WorkerRpc, controls: WorkerControls) => Promise<RunnerCandidateResult>;
|
|
354
|
+
}) => void, rpc: WorkerRpc, controls: WorkerControls, emitLive: (event: RunnerLiveEvent) => void) => Promise<RunnerCandidateResult>;
|
|
339
355
|
/** Entry helper for runner executables. It exits when its parent disappears. */
|
|
340
356
|
declare function runProcessWorker(run: WorkerRun): Promise<void>;
|
|
341
357
|
|
package/dist/runner-pi.js
CHANGED
|
@@ -3,8 +3,8 @@ const require = __goahCreateRequire(import.meta.url);
|
|
|
3
3
|
import {
|
|
4
4
|
runnerManifests,
|
|
5
5
|
runnerPlugin
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-J32EKOQ4.js";
|
|
7
|
+
import "./chunk-24NAHA3D.js";
|
|
8
8
|
import "./chunk-6M3OOCKO.js";
|
|
9
9
|
import "./chunk-K26BVR6O.js";
|
|
10
10
|
import "./chunk-IIJQ3DW4.js";
|
package/dist/supervisor.d.ts
CHANGED
|
@@ -277,6 +277,28 @@ interface RunnerTraceEvent {
|
|
|
277
277
|
type: string;
|
|
278
278
|
data: JsonValue;
|
|
279
279
|
}
|
|
280
|
+
type AssistantLiveDelta = {
|
|
281
|
+
type: "start" | "text_start" | "text_end" | "thinking_start" | "thinking_end" | "toolcall_start" | "toolcall_end";
|
|
282
|
+
contentIndex?: number;
|
|
283
|
+
} | {
|
|
284
|
+
type: "text_delta" | "thinking_delta" | "toolcall_delta";
|
|
285
|
+
contentIndex: number;
|
|
286
|
+
delta: string;
|
|
287
|
+
};
|
|
288
|
+
interface RunnerLiveEvent {
|
|
289
|
+
type: "message.assistant.delta";
|
|
290
|
+
data: {
|
|
291
|
+
messageId: string;
|
|
292
|
+
delta: AssistantLiveDelta;
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
interface TurnLiveSnapshot {
|
|
296
|
+
revision: number;
|
|
297
|
+
messageId: string;
|
|
298
|
+
text: string;
|
|
299
|
+
thinking: string;
|
|
300
|
+
thinkingActive: boolean;
|
|
301
|
+
}
|
|
280
302
|
type AgentCapability = "ledger.search" | "mail.send" | "schedule.set" | "goal.put" | "team.list" | "goal.get" | "goal.create" | "goal.work" | "goal.delegate" | "goal.reassign" | "goal.revise" | "goal.pause" | "goal.resume" | "goal.complete" | "human.request" | "work_record.list" | "work_record.read" | "work_record.history" | "work_record.diff" | "work_record.search" | "work_record.update" | "memory.append";
|
|
281
303
|
type RunnerControlMethod = "goal.handoff.validate";
|
|
282
304
|
type RunnerRpcMethod = AgentCapability | RunnerControlMethod;
|
|
@@ -313,6 +335,7 @@ interface RunRequest {
|
|
|
313
335
|
context: JsonValue;
|
|
314
336
|
now(): string;
|
|
315
337
|
emit(event: RunnerTraceEvent): void;
|
|
338
|
+
emitLive?(event: RunnerLiveEvent): void;
|
|
316
339
|
rpc?(method: RunnerRpcMethod, params: JsonValue): Promise<JsonValue>;
|
|
317
340
|
}
|
|
318
341
|
type RunnerCandidateResult = {
|
|
@@ -574,6 +597,7 @@ declare class Supervisor {
|
|
|
574
597
|
goal: GoalSnapshot;
|
|
575
598
|
}>;
|
|
576
599
|
interruptTurn(turnId: string): Promise<TurnSnapshot>;
|
|
600
|
+
liveTurnSnapshot(turnId: string, afterRevision?: number): TurnLiveSnapshot | null;
|
|
577
601
|
sendToCeo(body: JsonValue): Promise<{
|
|
578
602
|
threadId: string;
|
|
579
603
|
turnId: string;
|
package/dist/supervisor.js
CHANGED
package/dist/testkit.d.ts
CHANGED
|
@@ -283,6 +283,21 @@ interface RunnerTraceEvent {
|
|
|
283
283
|
type: string;
|
|
284
284
|
data: JsonValue;
|
|
285
285
|
}
|
|
286
|
+
type AssistantLiveDelta = {
|
|
287
|
+
type: "start" | "text_start" | "text_end" | "thinking_start" | "thinking_end" | "toolcall_start" | "toolcall_end";
|
|
288
|
+
contentIndex?: number;
|
|
289
|
+
} | {
|
|
290
|
+
type: "text_delta" | "thinking_delta" | "toolcall_delta";
|
|
291
|
+
contentIndex: number;
|
|
292
|
+
delta: string;
|
|
293
|
+
};
|
|
294
|
+
interface RunnerLiveEvent {
|
|
295
|
+
type: "message.assistant.delta";
|
|
296
|
+
data: {
|
|
297
|
+
messageId: string;
|
|
298
|
+
delta: AssistantLiveDelta;
|
|
299
|
+
};
|
|
300
|
+
}
|
|
286
301
|
type AgentCapability = "ledger.search" | "mail.send" | "schedule.set" | "goal.put" | "team.list" | "goal.get" | "goal.create" | "goal.work" | "goal.delegate" | "goal.reassign" | "goal.revise" | "goal.pause" | "goal.resume" | "goal.complete" | "human.request" | "work_record.list" | "work_record.read" | "work_record.history" | "work_record.diff" | "work_record.search" | "work_record.update" | "memory.append";
|
|
287
302
|
type RunnerControlMethod = "goal.handoff.validate";
|
|
288
303
|
type RunnerRpcMethod = AgentCapability | RunnerControlMethod;
|
|
@@ -306,6 +321,7 @@ interface RunRequest {
|
|
|
306
321
|
context: JsonValue;
|
|
307
322
|
now(): string;
|
|
308
323
|
emit(event: RunnerTraceEvent): void;
|
|
324
|
+
emitLive?(event: RunnerLiveEvent): void;
|
|
309
325
|
rpc?(method: RunnerRpcMethod, params: JsonValue): Promise<JsonValue>;
|
|
310
326
|
}
|
|
311
327
|
interface HandoffCommit {
|