@nuvin/session 0.2.0-rc.7 → 0.2.0-rc.9
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-7LEIACBZ.js +85 -0
- package/dist/{chunk-I5U3WU6B.js → chunk-KQHHBUVY.js} +112 -32
- package/dist/{chunk-MRVGQ4DK.js → chunk-O3UBTUIO.js} +1 -1
- package/dist/client/daemon-client.d.ts.map +1 -1
- package/dist/client/data-client.d.ts +10 -15
- package/dist/client/data-client.d.ts.map +1 -1
- package/dist/client/directory.d.ts +12 -14
- package/dist/client/directory.d.ts.map +1 -1
- package/dist/client/http-data-client.d.ts +5 -0
- package/dist/client/http-data-client.d.ts.map +1 -1
- package/dist/client/index.js +90 -23
- package/dist/client/session-client.d.ts +2 -2
- package/dist/client/session-client.d.ts.map +1 -1
- package/dist/controller/agent-channel.d.ts +2 -2
- package/dist/controller/agent-channel.d.ts.map +1 -1
- package/dist/controller/index.js +131 -52
- package/dist/controller/session-controller.d.ts +12 -12
- package/dist/controller/session-controller.d.ts.map +1 -1
- package/dist/protocol/data-rpc.d.ts +13 -14
- package/dist/protocol/data-rpc.d.ts.map +1 -1
- package/dist/protocol/history-text.d.ts +4 -0
- package/dist/protocol/history-text.d.ts.map +1 -0
- package/dist/protocol/index.d.ts +1 -0
- package/dist/protocol/index.d.ts.map +1 -1
- package/dist/protocol/index.js +12 -4
- package/dist/protocol/model-identity.d.ts +7 -0
- package/dist/protocol/model-identity.d.ts.map +1 -1
- package/dist/protocol/types.d.ts +85 -18
- package/dist/protocol/types.d.ts.map +1 -1
- package/dist/protocol/version.d.ts +1 -1
- package/dist/state/index.d.ts +2 -0
- package/dist/state/index.d.ts.map +1 -1
- package/dist/state/index.js +13 -3
- package/dist/state/messages.d.ts +11 -3
- package/dist/state/messages.d.ts.map +1 -1
- package/dist/state/questions.d.ts +5 -0
- package/dist/state/questions.d.ts.map +1 -0
- package/dist/state/session.d.ts.map +1 -1
- package/dist/state/tool-key.d.ts +2 -0
- package/dist/state/tool-key.d.ts.map +1 -0
- package/dist/state/tool-preview.d.ts.map +1 -1
- package/dist/state/tool-preview.js +27 -27
- package/dist/test-utils/index.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-7HGJO7ZX.js +0 -9
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// src/protocol/history-text.ts
|
|
2
|
+
function stripTerminalStringSequences(value) {
|
|
3
|
+
let sanitized = "";
|
|
4
|
+
for (let index = 0; index < value.length; ) {
|
|
5
|
+
const code = value.charCodeAt(index);
|
|
6
|
+
const next = value.charCodeAt(index + 1);
|
|
7
|
+
const isSevenBitSequence = code === 27 && [80, 88, 93, 94, 95].includes(next);
|
|
8
|
+
const isEightBitSequence = [144, 152, 157, 158, 159].includes(code);
|
|
9
|
+
if (!isSevenBitSequence && !isEightBitSequence) {
|
|
10
|
+
sanitized += value[index];
|
|
11
|
+
index += 1;
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
index += isSevenBitSequence ? 2 : 1;
|
|
15
|
+
while (index < value.length) {
|
|
16
|
+
const terminator = value.charCodeAt(index);
|
|
17
|
+
if (terminator === 7 || terminator === 156) {
|
|
18
|
+
index += 1;
|
|
19
|
+
break;
|
|
20
|
+
}
|
|
21
|
+
if (terminator === 27 && value.charCodeAt(index + 1) === 92) {
|
|
22
|
+
index += 2;
|
|
23
|
+
break;
|
|
24
|
+
}
|
|
25
|
+
index += 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return sanitized;
|
|
29
|
+
}
|
|
30
|
+
function stripTerminalControlSequences(value) {
|
|
31
|
+
let sanitized = "";
|
|
32
|
+
for (let index = 0; index < value.length; ) {
|
|
33
|
+
const code = value.charCodeAt(index);
|
|
34
|
+
const isCsi = code === 155 || code === 27 && value.charCodeAt(index + 1) === 91;
|
|
35
|
+
if (isCsi) {
|
|
36
|
+
index += code === 27 ? 2 : 1;
|
|
37
|
+
while (index < value.length) {
|
|
38
|
+
const current = value.charCodeAt(index);
|
|
39
|
+
index += 1;
|
|
40
|
+
if (current >= 64 && current <= 126) break;
|
|
41
|
+
}
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
if (code === 27) {
|
|
45
|
+
index += 1;
|
|
46
|
+
while (index < value.length) {
|
|
47
|
+
const current = value.charCodeAt(index);
|
|
48
|
+
index += 1;
|
|
49
|
+
if (current < 32 || current > 47) break;
|
|
50
|
+
}
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
sanitized += value[index];
|
|
54
|
+
index += 1;
|
|
55
|
+
}
|
|
56
|
+
return sanitized;
|
|
57
|
+
}
|
|
58
|
+
function sanitizeHistoryDisplayText(value) {
|
|
59
|
+
return stripTerminalControlSequences(stripTerminalStringSequences(value.normalize("NFKC"))).replace(new RegExp("\\p{Cc}", "gu"), (control) => /\s/u.test(control) ? " " : "").replace(/\s+/gu, " ").trim();
|
|
60
|
+
}
|
|
61
|
+
function normalizeHistoryText(value) {
|
|
62
|
+
return sanitizeHistoryDisplayText(value).toLowerCase();
|
|
63
|
+
}
|
|
64
|
+
function escapeLikeLiteral(value) {
|
|
65
|
+
return value.replaceAll("\\", "\\\\").replaceAll("%", "\\%").replaceAll("_", "\\_");
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/protocol/model-identity.ts
|
|
69
|
+
function modelNameFromIdentity(modelIdentity) {
|
|
70
|
+
const separator = modelIdentity.indexOf(":");
|
|
71
|
+
return separator === -1 ? modelIdentity : modelIdentity.slice(separator + 1);
|
|
72
|
+
}
|
|
73
|
+
function providerFromIdentity(modelIdentity) {
|
|
74
|
+
const separator = modelIdentity.indexOf(":");
|
|
75
|
+
if (separator <= 0) return void 0;
|
|
76
|
+
return modelIdentity.slice(0, separator);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export {
|
|
80
|
+
sanitizeHistoryDisplayText,
|
|
81
|
+
normalizeHistoryText,
|
|
82
|
+
escapeLikeLiteral,
|
|
83
|
+
modelNameFromIdentity,
|
|
84
|
+
providerFromIdentity
|
|
85
|
+
};
|
|
@@ -12,8 +12,8 @@ var BACKGROUNDLESS_TOOLS = /* @__PURE__ */ new Set([
|
|
|
12
12
|
"FileNew",
|
|
13
13
|
"TodoWrite",
|
|
14
14
|
"UpdateTopic",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"Memory",
|
|
16
|
+
"MemoryRead",
|
|
17
17
|
"InvokeCommand"
|
|
18
18
|
]);
|
|
19
19
|
function isToolAutoApprovedForMode(mode, permissionClass) {
|
|
@@ -47,6 +47,11 @@ function asJsonObject(value) {
|
|
|
47
47
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
+
// src/state/tool-key.ts
|
|
51
|
+
function scopedToolKey(parentToolCallId, toolCallId) {
|
|
52
|
+
return JSON.stringify([parentToolCallId ?? null, toolCallId]);
|
|
53
|
+
}
|
|
54
|
+
|
|
50
55
|
// src/state/messages.ts
|
|
51
56
|
import { getReasoningTextFromMessage, getTextFromMessage } from "@nuvin/agent-core/formats";
|
|
52
57
|
function createMessageId(state) {
|
|
@@ -117,6 +122,17 @@ function settleLiveReasoning(state, parentToolCallId, now) {
|
|
|
117
122
|
});
|
|
118
123
|
return changed ? { ...state, messages } : state;
|
|
119
124
|
}
|
|
125
|
+
function settleAllLiveReasoning(state, now) {
|
|
126
|
+
let changed = false;
|
|
127
|
+
const messages = state.messages.map((message) => {
|
|
128
|
+
if (message.role === "reasoning" && message.live) {
|
|
129
|
+
changed = true;
|
|
130
|
+
return { ...message, live: false, completedAt: message.completedAt ?? now };
|
|
131
|
+
}
|
|
132
|
+
return message;
|
|
133
|
+
});
|
|
134
|
+
return changed ? { ...state, messages } : state;
|
|
135
|
+
}
|
|
120
136
|
function summarizeToolInput(input) {
|
|
121
137
|
const objectInput = asJsonObject(input);
|
|
122
138
|
if (!objectInput) {
|
|
@@ -210,7 +226,8 @@ function mergeToolResultText(currentText, result) {
|
|
|
210
226
|
return currentText;
|
|
211
227
|
}
|
|
212
228
|
function ensureToolMessage(state, toolCall, parentToolCallId) {
|
|
213
|
-
const
|
|
229
|
+
const toolKey = scopedToolKey(parentToolCallId, toolCall.id);
|
|
230
|
+
const existingId = state.toolMessageIds[toolKey];
|
|
214
231
|
if (existingId) {
|
|
215
232
|
return withUpdatedMessage(state, existingId, (message) => {
|
|
216
233
|
if (message.role !== "tool" || message.input !== void 0) {
|
|
@@ -238,12 +255,12 @@ function ensureToolMessage(state, toolCall, parentToolCallId) {
|
|
|
238
255
|
...nextState,
|
|
239
256
|
toolMessageIds: {
|
|
240
257
|
...nextState.toolMessageIds,
|
|
241
|
-
[
|
|
258
|
+
[toolKey]: id
|
|
242
259
|
}
|
|
243
260
|
};
|
|
244
261
|
}
|
|
245
|
-
function setToolMessageStatus(state, toolCallId, status) {
|
|
246
|
-
const toolMessageId = state.toolMessageIds[toolCallId];
|
|
262
|
+
function setToolMessageStatus(state, toolCallId, status, parentToolCallId) {
|
|
263
|
+
const toolMessageId = state.toolMessageIds[scopedToolKey(parentToolCallId, toolCallId)];
|
|
247
264
|
if (!toolMessageId) {
|
|
248
265
|
return state;
|
|
249
266
|
}
|
|
@@ -257,8 +274,8 @@ function setToolMessageStatus(state, toolCallId, status) {
|
|
|
257
274
|
};
|
|
258
275
|
});
|
|
259
276
|
}
|
|
260
|
-
function setToolMessageApprovalKind(state, toolCallId, approvalKind) {
|
|
261
|
-
const toolMessageId = state.toolMessageIds[toolCallId];
|
|
277
|
+
function setToolMessageApprovalKind(state, toolCallId, approvalKind, parentToolCallId) {
|
|
278
|
+
const toolMessageId = state.toolMessageIds[scopedToolKey(parentToolCallId, toolCallId)];
|
|
262
279
|
if (!toolMessageId) {
|
|
263
280
|
return state;
|
|
264
281
|
}
|
|
@@ -272,8 +289,8 @@ function setToolMessageApprovalKind(state, toolCallId, approvalKind) {
|
|
|
272
289
|
};
|
|
273
290
|
});
|
|
274
291
|
}
|
|
275
|
-
function setToolMessageHidden(state, toolCallId, hidden) {
|
|
276
|
-
const toolMessageId = state.toolMessageIds[toolCallId];
|
|
292
|
+
function setToolMessageHidden(state, toolCallId, hidden, parentToolCallId) {
|
|
293
|
+
const toolMessageId = state.toolMessageIds[scopedToolKey(parentToolCallId, toolCallId)];
|
|
277
294
|
if (!toolMessageId) {
|
|
278
295
|
return state;
|
|
279
296
|
}
|
|
@@ -287,9 +304,10 @@ function setToolMessageHidden(state, toolCallId, hidden) {
|
|
|
287
304
|
};
|
|
288
305
|
});
|
|
289
306
|
}
|
|
290
|
-
function applyToolResult(state, result, now) {
|
|
307
|
+
function applyToolResult(state, result, now, parentToolCallId) {
|
|
291
308
|
const status = asJsonObject(result.structured)?.error === "tool_rejected" ? "rejected" : result.status;
|
|
292
|
-
const
|
|
309
|
+
const toolKey = scopedToolKey(parentToolCallId, result.callId);
|
|
310
|
+
const toolMessageId = state.toolMessageIds[toolKey];
|
|
293
311
|
if (!toolMessageId) {
|
|
294
312
|
const id = createMessageId(state);
|
|
295
313
|
const next = addMessage(state, {
|
|
@@ -301,13 +319,14 @@ function applyToolResult(state, result, now) {
|
|
|
301
319
|
status,
|
|
302
320
|
summary: "",
|
|
303
321
|
text: result.output,
|
|
304
|
-
structured: result.structured
|
|
322
|
+
structured: result.structured,
|
|
323
|
+
...parentToolCallId ? { parentToolCallId } : {}
|
|
305
324
|
});
|
|
306
325
|
return {
|
|
307
326
|
...next,
|
|
308
327
|
toolMessageIds: {
|
|
309
328
|
...next.toolMessageIds,
|
|
310
|
-
[
|
|
329
|
+
[toolKey]: id
|
|
311
330
|
}
|
|
312
331
|
};
|
|
313
332
|
}
|
|
@@ -344,7 +363,7 @@ function createMessageStateFromMessages(messages) {
|
|
|
344
363
|
const toolMessageIds = {};
|
|
345
364
|
for (const message of messages) {
|
|
346
365
|
if (message.role === "tool") {
|
|
347
|
-
toolMessageIds[message.toolCallId] = message.id;
|
|
366
|
+
toolMessageIds[scopedToolKey(message.parentToolCallId, message.toolCallId)] = message.id;
|
|
348
367
|
}
|
|
349
368
|
}
|
|
350
369
|
return {
|
|
@@ -469,7 +488,7 @@ function applyAgentEvent(state, event, parentToolCallId, now = Date.now()) {
|
|
|
469
488
|
return ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
470
489
|
case "tool_started": {
|
|
471
490
|
const toolState = ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
472
|
-
const toolMessageId = toolState.toolMessageIds[event.toolCall.id];
|
|
491
|
+
const toolMessageId = toolState.toolMessageIds[scopedToolKey(parentToolCallId, event.toolCall.id)];
|
|
473
492
|
return withUpdatedMessage(toolState, toolMessageId, (message) => {
|
|
474
493
|
if (message.role !== "tool") {
|
|
475
494
|
return message;
|
|
@@ -483,7 +502,7 @@ function applyAgentEvent(state, event, parentToolCallId, now = Date.now()) {
|
|
|
483
502
|
}
|
|
484
503
|
case "tool_output_chunk": {
|
|
485
504
|
const toolState = ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
486
|
-
const toolMessageId = toolState.toolMessageIds[event.toolCall.id];
|
|
505
|
+
const toolMessageId = toolState.toolMessageIds[scopedToolKey(parentToolCallId, event.toolCall.id)];
|
|
487
506
|
return withUpdatedMessage(toolState, toolMessageId, (message) => {
|
|
488
507
|
if (message.role !== "tool") {
|
|
489
508
|
return message;
|
|
@@ -503,13 +522,13 @@ function applyAgentEvent(state, event, parentToolCallId, now = Date.now()) {
|
|
|
503
522
|
}
|
|
504
523
|
case "tool_completed": {
|
|
505
524
|
const toolState = ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
506
|
-
return applyToolResult(toolState, event.result, now);
|
|
525
|
+
return applyToolResult(toolState, event.result, now, parentToolCallId);
|
|
507
526
|
}
|
|
508
527
|
case "tool_result":
|
|
509
|
-
return applyToolResult(state, event.result, now);
|
|
528
|
+
return applyToolResult(state, event.result, now, parentToolCallId);
|
|
510
529
|
case "tool_rejected": {
|
|
511
530
|
const toolState = ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
512
|
-
const toolMessageId = toolState.toolMessageIds[event.toolCall.id];
|
|
531
|
+
const toolMessageId = toolState.toolMessageIds[scopedToolKey(parentToolCallId, event.toolCall.id)];
|
|
513
532
|
return withUpdatedMessage(toolState, toolMessageId, (message) => {
|
|
514
533
|
if (message.role !== "tool") {
|
|
515
534
|
return message;
|
|
@@ -536,6 +555,25 @@ function applyAgentEvent(state, event, parentToolCallId, now = Date.now()) {
|
|
|
536
555
|
}
|
|
537
556
|
}
|
|
538
557
|
|
|
558
|
+
// src/state/questions.ts
|
|
559
|
+
function createQuestionQueueState() {
|
|
560
|
+
return { active: null, pending: [] };
|
|
561
|
+
}
|
|
562
|
+
function enqueueQuestion(state, question) {
|
|
563
|
+
if (state.active === null) {
|
|
564
|
+
return { ...state, active: question };
|
|
565
|
+
}
|
|
566
|
+
return { ...state, pending: [...state.pending, question] };
|
|
567
|
+
}
|
|
568
|
+
function removeQuestion(state, questionId) {
|
|
569
|
+
if (state.active?.questionId === questionId) {
|
|
570
|
+
const [active, ...pending2] = state.pending;
|
|
571
|
+
return { active: active ?? null, pending: pending2 };
|
|
572
|
+
}
|
|
573
|
+
const pending = state.pending.filter((question) => question.questionId !== questionId);
|
|
574
|
+
return pending.length === state.pending.length ? state : { ...state, pending };
|
|
575
|
+
}
|
|
576
|
+
|
|
539
577
|
// src/state/workflow-view.ts
|
|
540
578
|
function createWorkflowViewState(runId) {
|
|
541
579
|
return { runId, status: "running", tree: [], counts: {}, tokens: 0, lastSeq: -1, nodeKeys: {} };
|
|
@@ -604,7 +642,7 @@ function createSessionViewState() {
|
|
|
604
642
|
queuedCount: 0,
|
|
605
643
|
queued: [],
|
|
606
644
|
workflows: {},
|
|
607
|
-
question:
|
|
645
|
+
question: createQuestionQueueState()
|
|
608
646
|
};
|
|
609
647
|
}
|
|
610
648
|
function reduceSessionEvent(state, event) {
|
|
@@ -617,9 +655,19 @@ function reduceSessionEvent(state, event) {
|
|
|
617
655
|
event.at
|
|
618
656
|
);
|
|
619
657
|
if (event.toolStatus && event.event.type === "tool_call") {
|
|
620
|
-
messages = setToolMessageStatus(
|
|
658
|
+
messages = setToolMessageStatus(
|
|
659
|
+
messages,
|
|
660
|
+
event.event.toolCall.id,
|
|
661
|
+
event.toolStatus,
|
|
662
|
+
event.scope?.parentToolCallId
|
|
663
|
+
);
|
|
621
664
|
if (event.toolStatus === "approved") {
|
|
622
|
-
messages = setToolMessageApprovalKind(
|
|
665
|
+
messages = setToolMessageApprovalKind(
|
|
666
|
+
messages,
|
|
667
|
+
event.event.toolCall.id,
|
|
668
|
+
"auto",
|
|
669
|
+
event.scope?.parentToolCallId
|
|
670
|
+
);
|
|
623
671
|
}
|
|
624
672
|
}
|
|
625
673
|
return { ...state, messages };
|
|
@@ -633,36 +681,63 @@ function reduceSessionEvent(state, event) {
|
|
|
633
681
|
return {
|
|
634
682
|
...state,
|
|
635
683
|
approval: enqueueApproval(state.approval, event.approval),
|
|
636
|
-
messages: setToolMessageHidden(
|
|
684
|
+
messages: setToolMessageHidden(
|
|
685
|
+
state.messages,
|
|
686
|
+
event.approval.toolCallId,
|
|
687
|
+
true,
|
|
688
|
+
event.approval.parentToolCallId
|
|
689
|
+
)
|
|
637
690
|
};
|
|
638
691
|
case "approval-settled": {
|
|
639
|
-
let stamped = setToolMessageStatus(
|
|
692
|
+
let stamped = setToolMessageStatus(
|
|
693
|
+
state.messages,
|
|
694
|
+
event.toolCallId,
|
|
695
|
+
event.status,
|
|
696
|
+
event.parentToolCallId
|
|
697
|
+
);
|
|
640
698
|
if (event.status === "approved" && event.by === "client") {
|
|
641
|
-
stamped = setToolMessageApprovalKind(
|
|
699
|
+
stamped = setToolMessageApprovalKind(
|
|
700
|
+
stamped,
|
|
701
|
+
event.toolCallId,
|
|
702
|
+
"user",
|
|
703
|
+
event.parentToolCallId
|
|
704
|
+
);
|
|
642
705
|
}
|
|
643
706
|
return {
|
|
644
707
|
...state,
|
|
645
|
-
approval: removeApproval(
|
|
708
|
+
approval: removeApproval(
|
|
709
|
+
state.approval,
|
|
710
|
+
(item) => item.toolCallId === event.toolCallId && item.parentToolCallId === event.parentToolCallId
|
|
711
|
+
),
|
|
646
712
|
// Approved tools materialize as a transcript row; rejected ones never
|
|
647
713
|
// ran and stay hidden.
|
|
648
|
-
messages: event.status === "approved" ? setToolMessageHidden(stamped, event.toolCallId, false) : stamped
|
|
714
|
+
messages: event.status === "approved" ? setToolMessageHidden(stamped, event.toolCallId, false, event.parentToolCallId) : stamped
|
|
649
715
|
};
|
|
650
716
|
}
|
|
651
717
|
case "question-asked":
|
|
652
|
-
return { ...state, question:
|
|
718
|
+
return { ...state, question: enqueueQuestion(state.question, event.question) };
|
|
653
719
|
case "question-settled":
|
|
654
|
-
return
|
|
655
|
-
case "turn-status":
|
|
720
|
+
return { ...state, question: removeQuestion(state.question, event.questionId) };
|
|
721
|
+
case "turn-status": {
|
|
722
|
+
const messages = event.busy ? state.messages : settleAllLiveReasoning(state.messages, event.at);
|
|
656
723
|
return {
|
|
657
724
|
...state,
|
|
658
725
|
busy: event.busy,
|
|
726
|
+
messages,
|
|
659
727
|
queuedCount: event.queuedCount,
|
|
660
728
|
queued: event.queued ?? []
|
|
661
729
|
};
|
|
730
|
+
}
|
|
662
731
|
case "info":
|
|
663
732
|
return { ...state, messages: appendInfoMessage(state.messages, event.message) };
|
|
664
733
|
case "error":
|
|
665
|
-
return {
|
|
734
|
+
return {
|
|
735
|
+
...state,
|
|
736
|
+
messages: appendErrorMessage(
|
|
737
|
+
settleAllLiveReasoning(state.messages, event.at),
|
|
738
|
+
event.message
|
|
739
|
+
)
|
|
740
|
+
};
|
|
666
741
|
case "session-meta":
|
|
667
742
|
return { ...state, meta: event.meta };
|
|
668
743
|
case "metrics":
|
|
@@ -693,6 +768,8 @@ export {
|
|
|
693
768
|
dequeueActiveApproval,
|
|
694
769
|
removeApproval,
|
|
695
770
|
asJsonObject,
|
|
771
|
+
scopedToolKey,
|
|
772
|
+
settleAllLiveReasoning,
|
|
696
773
|
setToolMessageStatus,
|
|
697
774
|
setToolMessageApprovalKind,
|
|
698
775
|
setToolMessageHidden,
|
|
@@ -703,6 +780,9 @@ export {
|
|
|
703
780
|
appendInfoMessage,
|
|
704
781
|
appendWarningMessage,
|
|
705
782
|
applyAgentEvent,
|
|
783
|
+
createQuestionQueueState,
|
|
784
|
+
enqueueQuestion,
|
|
785
|
+
removeQuestion,
|
|
706
786
|
createSessionViewState,
|
|
707
787
|
reduceSessionEvent
|
|
708
788
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daemon-client.d.ts","sourceRoot":"","sources":["../../src/client/daemon-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEzE,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,yBAAyB,EAC/B,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,YAAY,GACpB;IACE,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,OAAO,CAAC,M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,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,MAAM,CAAC,KAAK,MAAM,CAAC,GACnF,CAAC,GAAG,IAAI,EAAE,CAAC,KAAK,CAAC,GACjB,KAAK,CAAC;AAEV,MAAM,MAAM,qBAAqB,GAAG;KACjC,CAAC,IAAI,MAAM,gBAAgB,GAAG,YAAY,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC;CACjE,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE,wBAAwB,CAAC;IACpC,KAAK,IAAI,IAAI,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,IAAI,CAAC,yBAAyB,EAAE,YAAY,GAAG,YAAY,CAAC,CAAC;AAEpG,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAC;IACrC,iBAAiB,IAAI,qBAAqB,CAAC;IAC3C,WAAW,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,wBAAwB,GAAG,iBAAiB,CAAC;IACtF,KAAK,IAAI,IAAI,CAAC;CACf;AASD,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,EACxB,QAAQ,EAAE,MAAM,GACf,qBAAqB,CAmBvB;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,gBAAqB,GAC1B,YAAY,CA8Md"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddProviderInput, ConfigMutationResult, DaemonDirectoryRow, HistoryPage, ProfileSummary, ProviderConfigSummary, ProviderCredentialInput, SessionSnapshot, UpdateWorkspaceInput, WorkspaceConfigSummary } from "../protocol/index.ts";
|
|
1
|
+
import type { AddProviderInput, ConfigMutationResult, DaemonDirectoryRow, HistoryPage, ListHistoryParams, ListHistoryWorkspacesParams, ListHistoryWorkspacesResult, ListWorkspaceHistoryParams, PersistenceIdentity, ProfileSummary, ProviderConfigSummary, ProviderCredentialInput, SessionSnapshot, UpdateWorkspaceInput, WorkspaceConfigSummary, WorkspaceHistoryPage } from "../protocol/index.ts";
|
|
2
2
|
import type { TransportCredential } from "./endpoint.ts";
|
|
3
3
|
/** Discovery payload: the daemon directory (account-scoped cloud, machine-scoped local). */
|
|
4
4
|
export type DaemonDirectory = {
|
|
@@ -33,16 +33,14 @@ export interface DaemonDirectoryClient {
|
|
|
33
33
|
* message; everything else is a plain `Error`.
|
|
34
34
|
*/
|
|
35
35
|
export interface DaemonDataClient {
|
|
36
|
-
fetchTranscript(daemonId: string,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
cursor?: string;
|
|
45
|
-
}): Promise<HistoryPage>;
|
|
36
|
+
fetchTranscript(daemonId: string, identity: PersistenceIdentity): Promise<SessionSnapshot>;
|
|
37
|
+
fetchHistory(daemonId: string, opts?: ListHistoryParams): Promise<HistoryPage>;
|
|
38
|
+
listHistoryWorkspaces(daemonId: string, opts?: ListHistoryWorkspacesParams & {
|
|
39
|
+
signal?: AbortSignal;
|
|
40
|
+
}): Promise<ListHistoryWorkspacesResult>;
|
|
41
|
+
listWorkspaceHistory(daemonId: string, opts?: ListWorkspaceHistoryParams & {
|
|
42
|
+
signal?: AbortSignal;
|
|
43
|
+
}): Promise<WorkspaceHistoryPage>;
|
|
46
44
|
listWorkspaces(daemonId: string, opts?: {
|
|
47
45
|
profile?: string;
|
|
48
46
|
}): Promise<WorkspaceConfigSummary[]>;
|
|
@@ -51,10 +49,7 @@ export interface DaemonDataClient {
|
|
|
51
49
|
root?: string;
|
|
52
50
|
profile?: string;
|
|
53
51
|
}): Promise<WorkspaceConfigSummary>;
|
|
54
|
-
deleteSession(daemonId: string,
|
|
55
|
-
workspace?: string;
|
|
56
|
-
profile?: string;
|
|
57
|
-
}): Promise<void>;
|
|
52
|
+
deleteSession(daemonId: string, identity: PersistenceIdentity): Promise<void>;
|
|
58
53
|
listProfiles(daemonId: string): Promise<ProfileSummary[]>;
|
|
59
54
|
listProviders(daemonId: string, opts?: {
|
|
60
55
|
profile?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-client.d.ts","sourceRoot":"","sources":["../../src/client/data-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"data-client.d.ts","sourceRoot":"","sources":["../../src/client/data-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,oBAAoB,EACpB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,0BAA0B,EAC1B,mBAAmB,EACnB,cAAc,EACd,qBAAqB,EACrB,uBAAuB,EACvB,eAAe,EACf,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAEzD,4FAA4F;AAC5F,MAAM,MAAM,eAAe,GAAG;IAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE3F;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,UAAU,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAE9E;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACpC,WAAW,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC;IACxC,eAAe,CAAC,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
|
|
1
|
-
import type { SessionDescriptor } from "../protocol/types.ts";
|
|
1
|
+
import type { PersistenceIdentity, SessionDescriptor } from "../protocol/types.ts";
|
|
2
2
|
import type { SessionApprovalMode } from "../state/approvals.ts";
|
|
3
3
|
import type { GetEndpoint } from "./endpoint.ts";
|
|
4
4
|
import { type TransportSocket } from "./socket.ts";
|
|
@@ -37,6 +37,15 @@ export type DirectoryServerView = {
|
|
|
37
37
|
export type DirectoryView = {
|
|
38
38
|
servers: DirectoryServerView[];
|
|
39
39
|
};
|
|
40
|
+
export type DaemonRequestErrorCode = "transcript-unavailable" | "transcript-corrupt" | "history-state-conflict" | "ambiguous-session-identity";
|
|
41
|
+
export declare class DaemonRequestError extends Error {
|
|
42
|
+
readonly code?: DaemonRequestErrorCode;
|
|
43
|
+
readonly identity?: PersistenceIdentity;
|
|
44
|
+
constructor(message: string, options?: {
|
|
45
|
+
code?: string;
|
|
46
|
+
identity?: PersistenceIdentity;
|
|
47
|
+
});
|
|
48
|
+
}
|
|
40
49
|
export type ServerDirectoryOptions = {
|
|
41
50
|
servers: DirectoryServerConfig[];
|
|
42
51
|
/** Test seam / socket override. Defaults to the global WHATWG WebSocket (browsers, node >= 22). */
|
|
@@ -80,19 +89,8 @@ export interface ServerDirectory {
|
|
|
80
89
|
activeProvider?: string;
|
|
81
90
|
activeModel?: string;
|
|
82
91
|
}): Promise<SessionDescriptor>;
|
|
83
|
-
/**
|
|
84
|
-
|
|
85
|
-
* resolves the live `SessionDescriptor` the daemon rehydrated. The cold
|
|
86
|
-
* transcript carries no cwd, so the caller supplies the cwd the rehydrated
|
|
87
|
-
* runtime runs in. Idempotent daemon-side (an already-live id resolves to the
|
|
88
|
-
* existing live session).
|
|
89
|
-
*/
|
|
90
|
-
resumeSession(server: string, historyId: string, options: {
|
|
91
|
-
cwd: string;
|
|
92
|
-
name?: string;
|
|
93
|
-
workspace?: string;
|
|
94
|
-
profile?: string;
|
|
95
|
-
}): Promise<SessionDescriptor>;
|
|
92
|
+
/** Resume one exact durable session identity. */
|
|
93
|
+
resumeSession(server: string, identity: PersistenceIdentity): Promise<SessionDescriptor>;
|
|
96
94
|
killSession(server: string, sessionId: string, options?: {
|
|
97
95
|
delete?: boolean;
|
|
98
96
|
}): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../../src/client/directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"directory.d.ts","sourceRoot":"","sources":["../../src/client/directory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,mBAAmB,EACnB,iBAAiB,EAClB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAqB,MAAM,eAAe,CAAC;AACpE,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAEzE;;;;;GAKG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,kFAAkF;IAClF,aAAa,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,eAAe,CAAC;CAClD,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAC7B;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,GACvB;IAAE,KAAK,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,iBAAiB,EAAE,CAAA;CAAE,GAClD;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAExC,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EA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AAE,mBAAmB,CAAC;QACnC,cAAc,CAAC,EAAE,MAAM,CAAC;QACxB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,GACA,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9B,iDAAiD;IACjD,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,mBAAmB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzF,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9F,gEAAgE;IAChE,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAChE,KAAK,IAAI,IAAI,CAAC;CACf;AAqDD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,sBAAsB,GAAG,eAAe,CAsatF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { DataRpcError } from "../protocol/index.ts";
|
|
1
2
|
import type { DataClient } from "./data-client.ts";
|
|
2
3
|
export type HttpDataClientOptions = {
|
|
3
4
|
/** "" / absent ⇒ same-origin (local). Absolute relay origin ⇒ cloud. */
|
|
@@ -10,6 +11,10 @@ export type HttpDataClientOptions = {
|
|
|
10
11
|
onUnauthorized?: () => void;
|
|
11
12
|
fetchImpl?: typeof fetch;
|
|
12
13
|
};
|
|
14
|
+
export declare class DataRpcClientError extends Error {
|
|
15
|
+
readonly code: DataRpcError["code"];
|
|
16
|
+
constructor(code: DataRpcError["code"], message: string);
|
|
17
|
+
}
|
|
13
18
|
/** Derive the daemon's HTTP origin from its ws url: ws→http, wss→https. */
|
|
14
19
|
export declare function httpBaseFromWsUrl(wsUrl: string): string;
|
|
15
20
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-data-client.d.ts","sourceRoot":"","sources":["../../src/client/http-data-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"http-data-client.d.ts","sourceRoot":"","sources":["../../src/client/http-data-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAKV,YAAY,EAQb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAmC,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAGpF,MAAM,MAAM,qBAAqB,GAAG;IAClC,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,QAAQ,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACxC,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,MAAM,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IAClD,8DAA8D;IAC9D,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,KAAK,CAAC;CAC1B,CAAC;AAEF,qBAAa,kBAAmB,SAAQ,KAAK;IAEzC,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC;gBAA1B,IAAI,EAAE,YAAY,CAAC,MAAM,CAAC,EACnC,OAAO,EAAE,MAAM;CAKlB;AAED,2EAA2E;AAC3E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIvD;AA6CD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,qBAA0B,GAAG,UAAU,CAgXpF"}
|