@nuvin/session 0.4.0-rc.11 → 0.4.0-rc.13
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-4FXP5TSI.js → chunk-B54P6RLO.js} +90 -6
- package/dist/{chunk-O3YF6Q77.js → chunk-STY4IJ7W.js} +1 -1
- package/dist/client/index.js +2 -2
- package/dist/controller/index.js +73 -14
- package/dist/controller/session-controller.d.ts +12 -1
- package/dist/controller/session-controller.d.ts.map +1 -1
- package/dist/protocol/index.js +1 -1
- package/dist/protocol/version.d.ts +1 -1
- package/dist/state/index.js +5 -1
- package/dist/state/messages.d.ts +4 -1
- package/dist/state/messages.d.ts.map +1 -1
- package/dist/state/session.d.ts.map +1 -1
- package/dist/test-utils/index.js +1 -1
- package/package.json +2 -2
|
@@ -164,6 +164,7 @@ function scopedToolKey(toolCallPath, toolCallId) {
|
|
|
164
164
|
}
|
|
165
165
|
|
|
166
166
|
// src/state/messages.ts
|
|
167
|
+
import { isModelUsageTotals } from "@nuvin/agent-core/agent";
|
|
167
168
|
import { getReasoningTextFromMessage, getTextFromMessage } from "@nuvin/agent-core/formats";
|
|
168
169
|
function isProviderRetryMessage(message) {
|
|
169
170
|
return message.role === "warning" && message.providerRetry !== void 0;
|
|
@@ -177,8 +178,77 @@ function withUpdatedMessage(state, id, update) {
|
|
|
177
178
|
messages: state.messages.map((message) => message.id === id ? update(message) : message)
|
|
178
179
|
};
|
|
179
180
|
}
|
|
181
|
+
function cloneDelegatedMetrics(metrics) {
|
|
182
|
+
const base = {
|
|
183
|
+
runId: metrics.runId,
|
|
184
|
+
turnNumber: metrics.turnNumber,
|
|
185
|
+
...metrics.turnId === void 0 ? {} : { turnId: metrics.turnId },
|
|
186
|
+
cumulativeUsage: { ...metrics.cumulativeUsage }
|
|
187
|
+
};
|
|
188
|
+
if (metrics.phase === "start") return { ...base, phase: "start", revision: 0 };
|
|
189
|
+
if (metrics.phase === "terminal")
|
|
190
|
+
return { ...base, phase: "terminal", revision: metrics.revision };
|
|
191
|
+
return {
|
|
192
|
+
...base,
|
|
193
|
+
phase: "active",
|
|
194
|
+
revision: metrics.revision,
|
|
195
|
+
...metrics.live === void 0 ? {} : {
|
|
196
|
+
live: {
|
|
197
|
+
requestId: metrics.live.requestId,
|
|
198
|
+
attempt: metrics.live.attempt,
|
|
199
|
+
estimatedOutputTokensPerSecond: metrics.live.estimatedOutputTokensPerSecond
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function isNonemptyString(value) {
|
|
205
|
+
return typeof value === "string" && value.length > 0;
|
|
206
|
+
}
|
|
207
|
+
function isNonnegativeSafeInteger(value) {
|
|
208
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
209
|
+
}
|
|
210
|
+
function isValidDelegatedMetrics(metrics, source) {
|
|
211
|
+
if (typeof metrics !== "object" || metrics === null || Array.isArray(metrics)) return false;
|
|
212
|
+
if (!isNonemptyString(metrics.runId) || metrics.turnId !== void 0 && !isNonemptyString(metrics.turnId) || !isNonnegativeSafeInteger(metrics.turnNumber) || !isNonnegativeSafeInteger(metrics.revision) || !isModelUsageTotals(metrics.cumulativeUsage))
|
|
213
|
+
return false;
|
|
214
|
+
if (source === "recovery") {
|
|
215
|
+
return metrics.phase === "terminal" && metrics.revision === 0 && metrics.live === void 0 && (metrics.turnNumber > 0 || metrics.turnId === void 0);
|
|
216
|
+
}
|
|
217
|
+
if (metrics.turnNumber === 0) return false;
|
|
218
|
+
if (metrics.phase === "start") return metrics.revision === 0 && metrics.live === void 0;
|
|
219
|
+
if (metrics.phase !== "active" && metrics.phase !== "terminal") return false;
|
|
220
|
+
if (metrics.revision === 0) return false;
|
|
221
|
+
if (metrics.phase === "terminal") return metrics.live === void 0;
|
|
222
|
+
const live = metrics.live;
|
|
223
|
+
return live === void 0 || typeof live === "object" && live !== null && !Array.isArray(live) && isNonemptyString(live.requestId) && isNonnegativeSafeInteger(live.attempt) && typeof live.estimatedOutputTokensPerSecond === "number" && Number.isFinite(live.estimatedOutputTokensPerSecond) && live.estimatedOutputTokensPerSecond >= 0;
|
|
224
|
+
}
|
|
225
|
+
function withDelegatedMetrics(message, metrics, source) {
|
|
226
|
+
if (message.toolName !== "AssignTask" || !isValidDelegatedMetrics(metrics, source))
|
|
227
|
+
return message;
|
|
228
|
+
const bindings = delegatedRunBindings(message);
|
|
229
|
+
if (bindings.some((runId) => runId !== metrics.runId)) return message;
|
|
230
|
+
if (bindings.length === 0 && !(source === "event" && metrics.phase === "start") && !(source === "recovery" && metrics.phase === "terminal"))
|
|
231
|
+
return message;
|
|
232
|
+
if (message.delegatedModel !== void 0 && message.delegatedModel.turnNumber > metrics.turnNumber)
|
|
233
|
+
return message;
|
|
234
|
+
const prior = message.delegatedMetrics;
|
|
235
|
+
if (prior !== void 0) {
|
|
236
|
+
if (metrics.turnNumber < prior.turnNumber) return message;
|
|
237
|
+
if (metrics.turnNumber === prior.turnNumber && (prior.phase === "terminal" || prior.turnId !== metrics.turnId || metrics.revision <= prior.revision))
|
|
238
|
+
return message;
|
|
239
|
+
}
|
|
240
|
+
return { ...message, delegatedMetrics: cloneDelegatedMetrics(metrics) };
|
|
241
|
+
}
|
|
242
|
+
function delegatedRunBindings(message) {
|
|
243
|
+
return [
|
|
244
|
+
message.structured?.runId,
|
|
245
|
+
message.delegatedModel?.runId,
|
|
246
|
+
message.delegatedMetrics?.runId
|
|
247
|
+
].filter((runId) => typeof runId === "string");
|
|
248
|
+
}
|
|
180
249
|
function withDelegatedModel(message, model) {
|
|
181
250
|
if (message.toolName !== "AssignTask") return message;
|
|
251
|
+
if (delegatedRunBindings(message).some((runId) => runId !== model.runId)) return message;
|
|
182
252
|
const prior = message.delegatedModel;
|
|
183
253
|
if (prior !== void 0) {
|
|
184
254
|
if (prior.runId !== model.runId || prior.turnNumber > model.turnNumber) return message;
|
|
@@ -638,13 +708,14 @@ function createMessageState() {
|
|
|
638
708
|
}
|
|
639
709
|
function createMessageStateFromMessages(messages) {
|
|
640
710
|
const normalizedMessages = messages.map((message) => {
|
|
641
|
-
const
|
|
642
|
-
|
|
643
|
-
if (
|
|
644
|
-
|
|
711
|
+
const cloned = message.role === "tool" && message.delegatedMetrics !== void 0 ? { ...message, delegatedMetrics: cloneDelegatedMetrics(message.delegatedMetrics) } : message;
|
|
712
|
+
const toolCallPath = cloneToolCallPath(cloned.toolCallPath);
|
|
713
|
+
if (toolCallPath) return { ...cloned, toolCallPath };
|
|
714
|
+
if (cloned.toolCallPath !== void 0) {
|
|
715
|
+
const { toolCallPath: _toolCallPath, ...rootMessage } = cloned;
|
|
645
716
|
return rootMessage;
|
|
646
717
|
}
|
|
647
|
-
return
|
|
718
|
+
return cloned;
|
|
648
719
|
});
|
|
649
720
|
const nextId = normalizedMessages.reduce((max, message) => {
|
|
650
721
|
const match = /^message-(\d+)$/.exec(message.id);
|
|
@@ -859,6 +930,13 @@ function applyAgentEvent(state, event, toolCallPath, now = Date.now()) {
|
|
|
859
930
|
toolCallPath,
|
|
860
931
|
now
|
|
861
932
|
);
|
|
933
|
+
case "delegated_metrics": {
|
|
934
|
+
const id = state.toolMessageIds[scopedToolKey(toolCallPath, event.parentToolCallId)];
|
|
935
|
+
const message = state.messages.find((item) => item.id === id);
|
|
936
|
+
if (message?.role !== "tool") return state;
|
|
937
|
+
const updated = withDelegatedMetrics(message, event, "event");
|
|
938
|
+
return updated === message ? state : withUpdatedMessage(state, message.id, () => updated);
|
|
939
|
+
}
|
|
862
940
|
case "delegated_model_resolved": {
|
|
863
941
|
const id = state.toolMessageIds[scopedToolKey(toolCallPath, event.parentToolCallId)];
|
|
864
942
|
if (id === void 0) return state;
|
|
@@ -1032,7 +1110,11 @@ function cloneQuestion2(question) {
|
|
|
1032
1110
|
return toolCallPath && toolCallPath.length > 0 ? { ...rootQuestion, toolCallPath: [...toolCallPath] } : rootQuestion;
|
|
1033
1111
|
}
|
|
1034
1112
|
function cloneMessage(message) {
|
|
1035
|
-
const cloned = message.role === "tool"
|
|
1113
|
+
const cloned = message.role === "tool" ? {
|
|
1114
|
+
...message,
|
|
1115
|
+
...message.delegatedModel === void 0 ? {} : { delegatedModel: { ...message.delegatedModel } },
|
|
1116
|
+
...message.delegatedMetrics === void 0 ? {} : { delegatedMetrics: cloneDelegatedMetrics(message.delegatedMetrics) }
|
|
1117
|
+
} : message;
|
|
1036
1118
|
const { toolCallPath, ...rootMessage } = cloned;
|
|
1037
1119
|
return toolCallPath && toolCallPath.length > 0 ? { ...rootMessage, toolCallPath: [...toolCallPath] } : rootMessage;
|
|
1038
1120
|
}
|
|
@@ -1293,6 +1375,8 @@ export {
|
|
|
1293
1375
|
asJsonObject,
|
|
1294
1376
|
scopedToolKey,
|
|
1295
1377
|
isProviderRetryMessage,
|
|
1378
|
+
cloneDelegatedMetrics,
|
|
1379
|
+
withDelegatedMetrics,
|
|
1296
1380
|
withDelegatedModel,
|
|
1297
1381
|
settleAllProviderRetries,
|
|
1298
1382
|
settleAllLiveReasoning,
|
package/dist/client/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSessionViewState,
|
|
3
3
|
reduceSessionEvent
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-B54P6RLO.js";
|
|
5
5
|
import {
|
|
6
6
|
PROTOCOL_VERSION,
|
|
7
7
|
parseAbortRecoveryRequest,
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
parseBackgroundWorkCancellation,
|
|
10
10
|
parseBackgroundWorkInspection,
|
|
11
11
|
parseBackgroundWorkPage
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-STY4IJ7W.js";
|
|
13
13
|
|
|
14
14
|
// src/client/control-center-socket.ts
|
|
15
15
|
var CONTROL_CENTER_UNSUPPORTED = "Control Center is unavailable on this daemon. Update or restart the daemon and try again.";
|
package/dist/controller/index.js
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
sanitizeCoordinatorDeliveryText,
|
|
14
14
|
scopedToolKey,
|
|
15
15
|
summarizeToolCallInput
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-B54P6RLO.js";
|
|
17
17
|
|
|
18
18
|
// src/controller/agent-channel.ts
|
|
19
19
|
import { EventEmitter } from "events";
|
|
@@ -293,7 +293,7 @@ function createSessionController(deps) {
|
|
|
293
293
|
if (persistenceInFlight.size > 0) {
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
const discarded = queue.splice(0);
|
|
297
297
|
activeHumans.length = 0;
|
|
298
298
|
alwaysApproved.clear();
|
|
299
299
|
abortController?.abort(new Error("Session loaded; the active turn was cancelled."));
|
|
@@ -312,6 +312,7 @@ function createSessionController(deps) {
|
|
|
312
312
|
recall: loaded.recall
|
|
313
313
|
}
|
|
314
314
|
});
|
|
315
|
+
notifyDiscarded(discarded, "Session loaded.");
|
|
315
316
|
});
|
|
316
317
|
deps.channel.setToolDecider((request) => {
|
|
317
318
|
if (request.executionId !== void 0 && (executionOwner?.control.executionId !== request.executionId || !executionOwner.control.claimActivity("tool"))) {
|
|
@@ -535,20 +536,40 @@ function createSessionController(deps) {
|
|
|
535
536
|
function allowsSteering(opts) {
|
|
536
537
|
return opts.turnId === void 0 || deps.headless !== true && opts.submission?.origin === "coordinator" && opts.submission.deliveryKind === "subagent-report";
|
|
537
538
|
}
|
|
539
|
+
function terminalObserver(observer) {
|
|
540
|
+
if (!observer) return void 0;
|
|
541
|
+
return (result) => {
|
|
542
|
+
const notify = observer;
|
|
543
|
+
observer = void 0;
|
|
544
|
+
if (!notify) return;
|
|
545
|
+
try {
|
|
546
|
+
void Promise.resolve(notify({ ...result })).catch(() => {
|
|
547
|
+
});
|
|
548
|
+
} catch {
|
|
549
|
+
}
|
|
550
|
+
};
|
|
551
|
+
}
|
|
552
|
+
function notifyDiscarded(entries, message) {
|
|
553
|
+
for (const entry of entries) entry.opts.onTerminal?.({ status: "aborted", message });
|
|
554
|
+
}
|
|
538
555
|
function startNextQueuedSubmission() {
|
|
539
556
|
if (closing || abortController || hostBusyCount > 0) return;
|
|
540
557
|
let next = queue.shift();
|
|
541
|
-
|
|
558
|
+
const dropped = [];
|
|
542
559
|
while (next?.opts.signal?.aborted) {
|
|
543
|
-
dropped
|
|
560
|
+
dropped.push(next);
|
|
544
561
|
next = queue.shift();
|
|
545
562
|
}
|
|
546
|
-
if (dropped) emitTurnStatus();
|
|
547
|
-
if (!next)
|
|
563
|
+
if (dropped.length > 0) emitTurnStatus();
|
|
564
|
+
if (!next) {
|
|
565
|
+
notifyDiscarded(dropped, "Submission cancelled before execution.");
|
|
566
|
+
return;
|
|
567
|
+
}
|
|
548
568
|
const coordinatorOwned = next.opts.submission?.origin === "coordinator";
|
|
549
569
|
const turn = startTrackedTurn(next.input, {
|
|
550
570
|
echo: coordinatorOwned || next.opts.silent ? void 0 : next.opts,
|
|
551
571
|
human: next.opts.human,
|
|
572
|
+
onTerminal: next.opts.onTerminal,
|
|
552
573
|
turnId: next.opts.turnId,
|
|
553
574
|
allowSteering: allowsSteering(next.opts),
|
|
554
575
|
submission: next.opts.submission ?? { origin: "user" },
|
|
@@ -556,6 +577,7 @@ function createSessionController(deps) {
|
|
|
556
577
|
...next.opts.signal === void 0 ? {} : { signal: next.opts.signal }
|
|
557
578
|
});
|
|
558
579
|
if (next.opts.waitFor === "acceptance") observeAcceptedTurn(turn, next.opts.turnId);
|
|
580
|
+
notifyDiscarded(dropped, "Submission cancelled before execution.");
|
|
559
581
|
}
|
|
560
582
|
function sealExecution(owner) {
|
|
561
583
|
owner.phase = "finished";
|
|
@@ -619,6 +641,8 @@ function createSessionController(deps) {
|
|
|
619
641
|
if (opts.signal.aborted) abortFromCaller();
|
|
620
642
|
else opts.signal.addEventListener("abort", abortFromCaller, { once: true });
|
|
621
643
|
}
|
|
644
|
+
const terminalObservers = /* @__PURE__ */ new Set();
|
|
645
|
+
if (opts.onTerminal) terminalObservers.add(opts.onTerminal);
|
|
622
646
|
const steeringClosed = () => owner.phase === "recovering" || owner.phase === "finished";
|
|
623
647
|
const drainSteering = async () => {
|
|
624
648
|
if (abortController !== controller || controller.signal.aborted || steeringClosed())
|
|
@@ -627,6 +651,12 @@ function createSessionController(deps) {
|
|
|
627
651
|
const steeringCount = barrierIndex === -1 ? queue.length : barrierIndex;
|
|
628
652
|
if (steeringCount === 0) return [];
|
|
629
653
|
const drained = queue.splice(0, steeringCount);
|
|
654
|
+
for (const entry of drained)
|
|
655
|
+
if (entry.opts.onTerminal) terminalObservers.add(entry.opts.onTerminal);
|
|
656
|
+
const rejectSteering = (entry, status, message) => {
|
|
657
|
+
if (entry.opts.onTerminal) terminalObservers.delete(entry.opts.onTerminal);
|
|
658
|
+
entry.opts.onTerminal?.({ status, message });
|
|
659
|
+
};
|
|
630
660
|
for (const entry of drained) {
|
|
631
661
|
if (entry.opts.submission?.origin === "user" && entry.opts.submission.humanSubmission !== void 0)
|
|
632
662
|
activeHumans.push(entry.opts.submission.humanSubmission);
|
|
@@ -634,9 +664,15 @@ function createSessionController(deps) {
|
|
|
634
664
|
emitTurnStatus();
|
|
635
665
|
const accepted = [];
|
|
636
666
|
for (const entry of drained) {
|
|
637
|
-
if (entry.opts.signal?.aborted)
|
|
667
|
+
if (entry.opts.signal?.aborted) {
|
|
668
|
+
rejectSteering(entry, "aborted", "Submission cancelled before steering.");
|
|
669
|
+
continue;
|
|
670
|
+
}
|
|
638
671
|
const guarded = await guardQueuedSteering(entry.input);
|
|
639
|
-
if (entry.opts.signal?.aborted)
|
|
672
|
+
if (entry.opts.signal?.aborted) {
|
|
673
|
+
rejectSteering(entry, "aborted", "Submission cancelled during steering guard.");
|
|
674
|
+
continue;
|
|
675
|
+
}
|
|
640
676
|
if (guarded.ok) {
|
|
641
677
|
accepted.push({
|
|
642
678
|
input: preservesVerbatimCoordinatorInput(entry.opts.submission) ? entry.input : guarded.prompt,
|
|
@@ -645,6 +681,7 @@ function createSessionController(deps) {
|
|
|
645
681
|
});
|
|
646
682
|
} else {
|
|
647
683
|
emit({ type: "error", message: guarded.message });
|
|
684
|
+
rejectSteering(entry, "failed", guarded.message);
|
|
648
685
|
}
|
|
649
686
|
}
|
|
650
687
|
if (abortController !== controller || controller.signal.aborted || steeringClosed())
|
|
@@ -684,6 +721,7 @@ function createSessionController(deps) {
|
|
|
684
721
|
abortController = controller;
|
|
685
722
|
let terminalStatus = "completed";
|
|
686
723
|
let terminalMessage;
|
|
724
|
+
let escapedFailure;
|
|
687
725
|
try {
|
|
688
726
|
emit({ type: "active-human-submission", key: owner.key });
|
|
689
727
|
if (opts.echo) {
|
|
@@ -812,6 +850,10 @@ function createSessionController(deps) {
|
|
|
812
850
|
emit({ type: "error", message: terminalMessage });
|
|
813
851
|
}
|
|
814
852
|
}
|
|
853
|
+
} catch (error) {
|
|
854
|
+
escapedFailure = {};
|
|
855
|
+
escapedFailure.message = errorDetail(error);
|
|
856
|
+
throw error;
|
|
815
857
|
} finally {
|
|
816
858
|
owner.settle();
|
|
817
859
|
opts.signal?.removeEventListener("abort", abortFromCaller);
|
|
@@ -836,6 +878,8 @@ function createSessionController(deps) {
|
|
|
836
878
|
terminalStatus = "failed";
|
|
837
879
|
terminalMessage = policyDenial;
|
|
838
880
|
}
|
|
881
|
+
const observedStatus = escapedFailure === void 0 ? terminalStatus : controller.signal.aborted && policyDenial === void 0 ? "aborted" : "failed";
|
|
882
|
+
const observedMessage = policyDenial ?? escapedFailure?.message ?? terminalMessage;
|
|
839
883
|
if (opts.turnId !== void 0) {
|
|
840
884
|
emit(
|
|
841
885
|
{
|
|
@@ -851,6 +895,13 @@ function createSessionController(deps) {
|
|
|
851
895
|
if (!opts.systemInitiated) activePolicyDenial = void 0;
|
|
852
896
|
activeTurnId = previousTurnId;
|
|
853
897
|
}
|
|
898
|
+
const observers = [...terminalObservers];
|
|
899
|
+
terminalObservers.clear();
|
|
900
|
+
for (const notify of observers)
|
|
901
|
+
notify({
|
|
902
|
+
status: observedStatus,
|
|
903
|
+
...observedMessage === void 0 ? {} : { message: observedMessage }
|
|
904
|
+
});
|
|
854
905
|
if (ownedTurn) startNextQueuedSubmission();
|
|
855
906
|
}
|
|
856
907
|
}
|
|
@@ -884,7 +935,7 @@ function createSessionController(deps) {
|
|
|
884
935
|
abortListeners.clear();
|
|
885
936
|
}
|
|
886
937
|
function cancelRecoveryOwner(owner) {
|
|
887
|
-
|
|
938
|
+
const discarded = queue.splice(0);
|
|
888
939
|
const reason = new Error("User aborted the current turn.");
|
|
889
940
|
for (const listener of abortListeners) {
|
|
890
941
|
try {
|
|
@@ -901,6 +952,7 @@ function createSessionController(deps) {
|
|
|
901
952
|
}
|
|
902
953
|
owner.controller.abort(reason);
|
|
903
954
|
rejectAllPending(reason.message);
|
|
955
|
+
notifyDiscarded(discarded, reason.message);
|
|
904
956
|
}
|
|
905
957
|
function abort(intent = "cancel") {
|
|
906
958
|
const reason = new Error("User aborted the current turn.");
|
|
@@ -910,9 +962,10 @@ function createSessionController(deps) {
|
|
|
910
962
|
} catch {
|
|
911
963
|
}
|
|
912
964
|
}
|
|
913
|
-
|
|
965
|
+
const discarded = queue.splice(0);
|
|
914
966
|
abortController?.abort(reason);
|
|
915
967
|
rejectAllPending("User aborted the current turn.");
|
|
968
|
+
notifyDiscarded(discarded, reason.message);
|
|
916
969
|
}
|
|
917
970
|
return {
|
|
918
971
|
abortWithRecovery(request) {
|
|
@@ -1037,7 +1090,7 @@ function createSessionController(deps) {
|
|
|
1037
1090
|
},
|
|
1038
1091
|
commitCompaction({ messages, recall }) {
|
|
1039
1092
|
copyRecallState(recall);
|
|
1040
|
-
|
|
1093
|
+
const discarded = queue.splice(0);
|
|
1041
1094
|
activeHumans.length = 0;
|
|
1042
1095
|
rejectAllPending("Session compacted; pending interactions were cancelled.");
|
|
1043
1096
|
alwaysApproved.clear();
|
|
@@ -1052,15 +1105,17 @@ function createSessionController(deps) {
|
|
|
1052
1105
|
recall
|
|
1053
1106
|
}
|
|
1054
1107
|
});
|
|
1108
|
+
notifyDiscarded(discarded, "Session compacted.");
|
|
1055
1109
|
},
|
|
1056
1110
|
close() {
|
|
1057
1111
|
if (closePromise) return closePromise;
|
|
1058
1112
|
closing = true;
|
|
1059
1113
|
const shouldEmitTurnStatus = queue.length > 0 || abortController !== null || hostBusyCount > 0;
|
|
1060
|
-
|
|
1114
|
+
const discarded = queue.splice(0);
|
|
1061
1115
|
abortController?.abort(new Error("Session closed."));
|
|
1062
1116
|
rejectAllPending("Session closed.");
|
|
1063
1117
|
if (shouldEmitTurnStatus) emitTurnStatus();
|
|
1118
|
+
notifyDiscarded(discarded, "Session closed.");
|
|
1064
1119
|
const active = activeTurnPromise;
|
|
1065
1120
|
const recovery = recoveryPromise;
|
|
1066
1121
|
if (!active && !recovery) {
|
|
@@ -1074,8 +1129,9 @@ function createSessionController(deps) {
|
|
|
1074
1129
|
dequeue(queuedId) {
|
|
1075
1130
|
const index = queue.findIndex((q) => q.id === queuedId);
|
|
1076
1131
|
if (index === -1) return false;
|
|
1077
|
-
queue.splice(index, 1);
|
|
1132
|
+
const discarded = queue.splice(index, 1);
|
|
1078
1133
|
emitTurnStatus();
|
|
1134
|
+
notifyDiscarded(discarded, "Submission dequeued.");
|
|
1079
1135
|
return true;
|
|
1080
1136
|
},
|
|
1081
1137
|
decideApproval(toolCallId, decision, comment, grantDir, toolCallPath) {
|
|
@@ -1265,7 +1321,7 @@ function createSessionController(deps) {
|
|
|
1265
1321
|
if (persistenceInFlight.size > 0) {
|
|
1266
1322
|
return;
|
|
1267
1323
|
}
|
|
1268
|
-
|
|
1324
|
+
const discarded = queue.splice(0);
|
|
1269
1325
|
activeHumans.length = 0;
|
|
1270
1326
|
if (options.preserveHostBusy !== true) hostBusyCount = 0;
|
|
1271
1327
|
abortController?.abort(new Error("Session reset."));
|
|
@@ -1282,6 +1338,7 @@ function createSessionController(deps) {
|
|
|
1282
1338
|
mcp: state.mcp
|
|
1283
1339
|
}
|
|
1284
1340
|
});
|
|
1341
|
+
notifyDiscarded(discarded, "Session reset.");
|
|
1285
1342
|
},
|
|
1286
1343
|
setApprovalMode(mode) {
|
|
1287
1344
|
approvalMode = mode;
|
|
@@ -1299,6 +1356,7 @@ function createSessionController(deps) {
|
|
|
1299
1356
|
if (closing) throw new Error("Session is closing.");
|
|
1300
1357
|
opts.signal?.throwIfAborted();
|
|
1301
1358
|
opts = admitHuman(input, opts);
|
|
1359
|
+
opts = { ...opts, onTerminal: terminalObserver(opts.onTerminal) };
|
|
1302
1360
|
if (abortController || hostBusyCount > 0) {
|
|
1303
1361
|
queue.push({
|
|
1304
1362
|
id: `q-${++queueCounter}`,
|
|
@@ -1314,6 +1372,7 @@ function createSessionController(deps) {
|
|
|
1314
1372
|
const turn = startTrackedTurn(input, {
|
|
1315
1373
|
echo: coordinatorOwned || opts.silent ? void 0 : opts,
|
|
1316
1374
|
human: opts.human,
|
|
1375
|
+
onTerminal: opts.onTerminal,
|
|
1317
1376
|
turnId: opts.turnId,
|
|
1318
1377
|
allowSteering: allowsSteering(opts),
|
|
1319
1378
|
submission: opts.submission ?? { origin: "user" },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AgentMetricsSnapshot } from "@nuvin/agent-core/agent";
|
|
2
|
-
import { type AgentInput, type AgentSubmission, type AskUserAnswers, type Message, type RootExecutionControl, type SteeringInputDrain } from "@nuvin/agent-core/shared";
|
|
2
|
+
import { type AgentInput, type AgentSubmission, type AskUserAnswers, type Message, type RootExecutionControl, type SteeringInputDrain, type TurnResultStatus } from "@nuvin/agent-core/shared";
|
|
3
3
|
import type { AbortRecoveryRequest, AbortRecoveryResult, BackgroundAgentStatus, BackgroundWorkActiveState, BashPolicyApprovalDiagnostics, HumanSubmissionRequest, McpAuthFlowState, McpViewState, PersistBashPermissionRequest, PersistBashPermissionResult, RecallState, ServerEvent, SessionMeta, SessionSnapshot, SlashCommandDescriptor, SubmissionKey } from "../protocol/types.ts";
|
|
4
4
|
import { type SessionApprovalMode } from "../state/approvals.ts";
|
|
5
5
|
import { type TuiMessage } from "../state/messages.ts";
|
|
@@ -81,6 +81,17 @@ export type SubmitOptions = {
|
|
|
81
81
|
* Omit to retain the normal idle-turn completion / busy-queue acceptance behavior.
|
|
82
82
|
*/
|
|
83
83
|
waitFor?: "acceptance";
|
|
84
|
+
/**
|
|
85
|
+
* Trusted in-process observation of this admitted submission's terminal boundary.
|
|
86
|
+
* Follows its consuming execution (including steering), or queued discard/guard
|
|
87
|
+
* rejection. Never sent to the agent or wire, never awaited, and errors are isolated.
|
|
88
|
+
* Successful processing/persistence must be established separately by the caller.
|
|
89
|
+
* Pre-admission rejection is still reported by submit's rejected promise.
|
|
90
|
+
*/
|
|
91
|
+
onTerminal?: (result: Readonly<{
|
|
92
|
+
status: TurnResultStatus | "failed";
|
|
93
|
+
message?: string;
|
|
94
|
+
}>) => void | Promise<void>;
|
|
84
95
|
attachmentLabels?: string[];
|
|
85
96
|
/** Immutable ownership metadata forwarded with this exact agent send. */
|
|
86
97
|
submission?: AgentSubmission;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-controller.d.ts","sourceRoot":"","sources":["../../src/controller/session-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EAInB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAEzB,KAAK,kBAAkB,
|
|
1
|
+
{"version":3,"file":"session-controller.d.ts","sourceRoot":"","sources":["../../src/controller/session-controller.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,cAAc,EAInB,KAAK,OAAO,EACZ,KAAK,oBAAoB,EAEzB,KAAK,kBAAkB,EAGvB,KAAK,gBAAgB,EACtB,MAAM,0BAA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@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
appendWarningMessage,
|
|
14
14
|
applyAgentEvent,
|
|
15
15
|
asJsonObject,
|
|
16
|
+
cloneDelegatedMetrics,
|
|
16
17
|
copyRecallState,
|
|
17
18
|
createApprovalQueueState,
|
|
18
19
|
createMessageState,
|
|
@@ -40,8 +41,9 @@ import {
|
|
|
40
41
|
settleAllProviderRetries,
|
|
41
42
|
splitSanitizableDelivery,
|
|
42
43
|
summarizeToolCallInput,
|
|
44
|
+
withDelegatedMetrics,
|
|
43
45
|
withDelegatedModel
|
|
44
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-B54P6RLO.js";
|
|
45
47
|
export {
|
|
46
48
|
BACKGROUNDLESS_TOOLS,
|
|
47
49
|
DISPLAY_TEXT_MAX_BYTES,
|
|
@@ -53,6 +55,7 @@ export {
|
|
|
53
55
|
appendWarningMessage,
|
|
54
56
|
applyAgentEvent,
|
|
55
57
|
asJsonObject,
|
|
58
|
+
cloneDelegatedMetrics,
|
|
56
59
|
copyRecallState,
|
|
57
60
|
createApprovalQueueState,
|
|
58
61
|
createMessageState,
|
|
@@ -82,5 +85,6 @@ export {
|
|
|
82
85
|
settleAllProviderRetries,
|
|
83
86
|
splitSanitizableDelivery,
|
|
84
87
|
summarizeToolCallInput,
|
|
88
|
+
withDelegatedMetrics,
|
|
85
89
|
withDelegatedModel
|
|
86
90
|
};
|
package/dist/state/messages.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentEvent, DelegatedModelIdentity, JsonObject, JsonValue, ModelUsageTotals } from "@nuvin/agent-core/shared";
|
|
1
|
+
import type { AgentEvent, DelegatedMetricsSnapshot, DelegatedModelIdentity, JsonObject, JsonValue, ModelUsageTotals } from "@nuvin/agent-core/shared";
|
|
2
2
|
import type { ResolvedSubagentReport, SubagentReportStatus } from "./subagent-report.ts";
|
|
3
3
|
export type ToolMessageStatus = "approved" | "error" | "ok" | "pending" | "rejected" | "running";
|
|
4
4
|
export type ProviderRetryAttemptRecord = {
|
|
@@ -76,6 +76,7 @@ export type ToolTuiMessage = {
|
|
|
76
76
|
approvalKind?: "auto" | "user";
|
|
77
77
|
completedAt?: number;
|
|
78
78
|
delegatedModel?: DelegatedModelMetadata;
|
|
79
|
+
delegatedMetrics?: DelegatedMetricsSnapshot;
|
|
79
80
|
id: string;
|
|
80
81
|
/** Tool-call ancestry for nested rendering; omitted for root tools. */
|
|
81
82
|
toolCallPath?: string[];
|
|
@@ -133,6 +134,8 @@ export type MessageState = {
|
|
|
133
134
|
reasoningMessageIds: Record<string, string>;
|
|
134
135
|
toolMessageIds: Record<string, string>;
|
|
135
136
|
};
|
|
137
|
+
export declare function cloneDelegatedMetrics(metrics: DelegatedMetricsSnapshot): DelegatedMetricsSnapshot;
|
|
138
|
+
export declare function withDelegatedMetrics(message: ToolTuiMessage, metrics: DelegatedMetricsSnapshot, source: "event" | "recovery"): ToolTuiMessage;
|
|
136
139
|
export declare function withDelegatedModel(message: ToolTuiMessage, model: DelegatedModelMetadata): ToolTuiMessage;
|
|
137
140
|
/**
|
|
138
141
|
* Settle every still-retrying provider row as "stopped": the turn ended (idle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/state/messages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/state/messages.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EAEV,wBAAwB,EACxB,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,gBAAgB,EAGjB,MAAM,0BAA0B,CAAC;AAIlC,OAAO,KAAK,EAAE,sBAAsB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGzF,MAAM,MAAM,iBAAiB,GAAG,UAAU,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjG,MAAM,MAAM,0BAA0B,G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kBAAkB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAMlF;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAMjF;AAED,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,sBAAsB,GAC7B,YAAY,CAUd;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY,CAMpF;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,YAAY,EACnB,KAAK,EAAE,UAAU,EACjB,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,EAChC,GAAG,GAAE,MAAmB,GACvB,YAAY,CA+Qd"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/state/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAKV,WAAW,EACX,WAAW,EACX,WAAW,EACX,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/state/session.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAKV,WAAW,EACX,WAAW,EACX,WAAW,EACX,gBAAgB,EACjB,MAAM,sBAAsB,CAAC;AAiG9B,wBAAgB,sBAAsB,IAAI,gBAAgB,CAiBzD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,WAAW,GAAG,gBAAgB,CAuMhG;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,GAAG,WAAW,CA2BrF;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAgBhE"}
|
package/dist/test-utils/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuvin/session",
|
|
3
|
-
"version": "0.4.0-rc.
|
|
3
|
+
"version": "0.4.0-rc.13",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Headless session layer for Nuvin: state reducers, wire protocol, session controller",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"ws": "^8.20.0",
|
|
53
|
-
"@nuvin/agent-core": "^0.4.0-rc.
|
|
53
|
+
"@nuvin/agent-core": "^0.4.0-rc.18"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/node": "^22.0.0",
|