@nuvin/session 0.2.0-rc.7 → 0.2.0-rc.8
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-I5U3WU6B.js → chunk-2OTEZX2E.js} +87 -28
- package/dist/chunk-7LEIACBZ.js +85 -0
- package/dist/{chunk-MRVGQ4DK.js → chunk-MPBST5DM.js} +1 -1
- package/dist/client/daemon-client.d.ts.map +1 -1
- package/dist/client/data-client.d.ts +9 -9
- 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 +86 -22
- 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 +108 -49
- package/dist/controller/session-controller.d.ts +4 -11
- package/dist/controller/session-controller.d.ts.map +1 -1
- package/dist/protocol/data-rpc.d.ts +12 -8
- 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 +51 -16
- 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 +9 -1
- package/dist/state/messages.d.ts +3 -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/test-utils/index.js +2 -2
- package/package.json +3 -3
- package/dist/chunk-7HGJO7ZX.js +0 -9
|
@@ -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) {
|
|
@@ -210,7 +215,8 @@ function mergeToolResultText(currentText, result) {
|
|
|
210
215
|
return currentText;
|
|
211
216
|
}
|
|
212
217
|
function ensureToolMessage(state, toolCall, parentToolCallId) {
|
|
213
|
-
const
|
|
218
|
+
const toolKey = scopedToolKey(parentToolCallId, toolCall.id);
|
|
219
|
+
const existingId = state.toolMessageIds[toolKey];
|
|
214
220
|
if (existingId) {
|
|
215
221
|
return withUpdatedMessage(state, existingId, (message) => {
|
|
216
222
|
if (message.role !== "tool" || message.input !== void 0) {
|
|
@@ -238,12 +244,12 @@ function ensureToolMessage(state, toolCall, parentToolCallId) {
|
|
|
238
244
|
...nextState,
|
|
239
245
|
toolMessageIds: {
|
|
240
246
|
...nextState.toolMessageIds,
|
|
241
|
-
[
|
|
247
|
+
[toolKey]: id
|
|
242
248
|
}
|
|
243
249
|
};
|
|
244
250
|
}
|
|
245
|
-
function setToolMessageStatus(state, toolCallId, status) {
|
|
246
|
-
const toolMessageId = state.toolMessageIds[toolCallId];
|
|
251
|
+
function setToolMessageStatus(state, toolCallId, status, parentToolCallId) {
|
|
252
|
+
const toolMessageId = state.toolMessageIds[scopedToolKey(parentToolCallId, toolCallId)];
|
|
247
253
|
if (!toolMessageId) {
|
|
248
254
|
return state;
|
|
249
255
|
}
|
|
@@ -257,8 +263,8 @@ function setToolMessageStatus(state, toolCallId, status) {
|
|
|
257
263
|
};
|
|
258
264
|
});
|
|
259
265
|
}
|
|
260
|
-
function setToolMessageApprovalKind(state, toolCallId, approvalKind) {
|
|
261
|
-
const toolMessageId = state.toolMessageIds[toolCallId];
|
|
266
|
+
function setToolMessageApprovalKind(state, toolCallId, approvalKind, parentToolCallId) {
|
|
267
|
+
const toolMessageId = state.toolMessageIds[scopedToolKey(parentToolCallId, toolCallId)];
|
|
262
268
|
if (!toolMessageId) {
|
|
263
269
|
return state;
|
|
264
270
|
}
|
|
@@ -272,8 +278,8 @@ function setToolMessageApprovalKind(state, toolCallId, approvalKind) {
|
|
|
272
278
|
};
|
|
273
279
|
});
|
|
274
280
|
}
|
|
275
|
-
function setToolMessageHidden(state, toolCallId, hidden) {
|
|
276
|
-
const toolMessageId = state.toolMessageIds[toolCallId];
|
|
281
|
+
function setToolMessageHidden(state, toolCallId, hidden, parentToolCallId) {
|
|
282
|
+
const toolMessageId = state.toolMessageIds[scopedToolKey(parentToolCallId, toolCallId)];
|
|
277
283
|
if (!toolMessageId) {
|
|
278
284
|
return state;
|
|
279
285
|
}
|
|
@@ -287,9 +293,10 @@ function setToolMessageHidden(state, toolCallId, hidden) {
|
|
|
287
293
|
};
|
|
288
294
|
});
|
|
289
295
|
}
|
|
290
|
-
function applyToolResult(state, result, now) {
|
|
296
|
+
function applyToolResult(state, result, now, parentToolCallId) {
|
|
291
297
|
const status = asJsonObject(result.structured)?.error === "tool_rejected" ? "rejected" : result.status;
|
|
292
|
-
const
|
|
298
|
+
const toolKey = scopedToolKey(parentToolCallId, result.callId);
|
|
299
|
+
const toolMessageId = state.toolMessageIds[toolKey];
|
|
293
300
|
if (!toolMessageId) {
|
|
294
301
|
const id = createMessageId(state);
|
|
295
302
|
const next = addMessage(state, {
|
|
@@ -301,13 +308,14 @@ function applyToolResult(state, result, now) {
|
|
|
301
308
|
status,
|
|
302
309
|
summary: "",
|
|
303
310
|
text: result.output,
|
|
304
|
-
structured: result.structured
|
|
311
|
+
structured: result.structured,
|
|
312
|
+
...parentToolCallId ? { parentToolCallId } : {}
|
|
305
313
|
});
|
|
306
314
|
return {
|
|
307
315
|
...next,
|
|
308
316
|
toolMessageIds: {
|
|
309
317
|
...next.toolMessageIds,
|
|
310
|
-
[
|
|
318
|
+
[toolKey]: id
|
|
311
319
|
}
|
|
312
320
|
};
|
|
313
321
|
}
|
|
@@ -344,7 +352,7 @@ function createMessageStateFromMessages(messages) {
|
|
|
344
352
|
const toolMessageIds = {};
|
|
345
353
|
for (const message of messages) {
|
|
346
354
|
if (message.role === "tool") {
|
|
347
|
-
toolMessageIds[message.toolCallId] = message.id;
|
|
355
|
+
toolMessageIds[scopedToolKey(message.parentToolCallId, message.toolCallId)] = message.id;
|
|
348
356
|
}
|
|
349
357
|
}
|
|
350
358
|
return {
|
|
@@ -469,7 +477,7 @@ function applyAgentEvent(state, event, parentToolCallId, now = Date.now()) {
|
|
|
469
477
|
return ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
470
478
|
case "tool_started": {
|
|
471
479
|
const toolState = ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
472
|
-
const toolMessageId = toolState.toolMessageIds[event.toolCall.id];
|
|
480
|
+
const toolMessageId = toolState.toolMessageIds[scopedToolKey(parentToolCallId, event.toolCall.id)];
|
|
473
481
|
return withUpdatedMessage(toolState, toolMessageId, (message) => {
|
|
474
482
|
if (message.role !== "tool") {
|
|
475
483
|
return message;
|
|
@@ -483,7 +491,7 @@ function applyAgentEvent(state, event, parentToolCallId, now = Date.now()) {
|
|
|
483
491
|
}
|
|
484
492
|
case "tool_output_chunk": {
|
|
485
493
|
const toolState = ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
486
|
-
const toolMessageId = toolState.toolMessageIds[event.toolCall.id];
|
|
494
|
+
const toolMessageId = toolState.toolMessageIds[scopedToolKey(parentToolCallId, event.toolCall.id)];
|
|
487
495
|
return withUpdatedMessage(toolState, toolMessageId, (message) => {
|
|
488
496
|
if (message.role !== "tool") {
|
|
489
497
|
return message;
|
|
@@ -503,13 +511,13 @@ function applyAgentEvent(state, event, parentToolCallId, now = Date.now()) {
|
|
|
503
511
|
}
|
|
504
512
|
case "tool_completed": {
|
|
505
513
|
const toolState = ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
506
|
-
return applyToolResult(toolState, event.result, now);
|
|
514
|
+
return applyToolResult(toolState, event.result, now, parentToolCallId);
|
|
507
515
|
}
|
|
508
516
|
case "tool_result":
|
|
509
|
-
return applyToolResult(state, event.result, now);
|
|
517
|
+
return applyToolResult(state, event.result, now, parentToolCallId);
|
|
510
518
|
case "tool_rejected": {
|
|
511
519
|
const toolState = ensureToolMessage(state, event.toolCall, parentToolCallId);
|
|
512
|
-
const toolMessageId = toolState.toolMessageIds[event.toolCall.id];
|
|
520
|
+
const toolMessageId = toolState.toolMessageIds[scopedToolKey(parentToolCallId, event.toolCall.id)];
|
|
513
521
|
return withUpdatedMessage(toolState, toolMessageId, (message) => {
|
|
514
522
|
if (message.role !== "tool") {
|
|
515
523
|
return message;
|
|
@@ -536,6 +544,25 @@ function applyAgentEvent(state, event, parentToolCallId, now = Date.now()) {
|
|
|
536
544
|
}
|
|
537
545
|
}
|
|
538
546
|
|
|
547
|
+
// src/state/questions.ts
|
|
548
|
+
function createQuestionQueueState() {
|
|
549
|
+
return { active: null, pending: [] };
|
|
550
|
+
}
|
|
551
|
+
function enqueueQuestion(state, question) {
|
|
552
|
+
if (state.active === null) {
|
|
553
|
+
return { ...state, active: question };
|
|
554
|
+
}
|
|
555
|
+
return { ...state, pending: [...state.pending, question] };
|
|
556
|
+
}
|
|
557
|
+
function removeQuestion(state, questionId) {
|
|
558
|
+
if (state.active?.questionId === questionId) {
|
|
559
|
+
const [active, ...pending2] = state.pending;
|
|
560
|
+
return { active: active ?? null, pending: pending2 };
|
|
561
|
+
}
|
|
562
|
+
const pending = state.pending.filter((question) => question.questionId !== questionId);
|
|
563
|
+
return pending.length === state.pending.length ? state : { ...state, pending };
|
|
564
|
+
}
|
|
565
|
+
|
|
539
566
|
// src/state/workflow-view.ts
|
|
540
567
|
function createWorkflowViewState(runId) {
|
|
541
568
|
return { runId, status: "running", tree: [], counts: {}, tokens: 0, lastSeq: -1, nodeKeys: {} };
|
|
@@ -604,7 +631,7 @@ function createSessionViewState() {
|
|
|
604
631
|
queuedCount: 0,
|
|
605
632
|
queued: [],
|
|
606
633
|
workflows: {},
|
|
607
|
-
question:
|
|
634
|
+
question: createQuestionQueueState()
|
|
608
635
|
};
|
|
609
636
|
}
|
|
610
637
|
function reduceSessionEvent(state, event) {
|
|
@@ -617,9 +644,19 @@ function reduceSessionEvent(state, event) {
|
|
|
617
644
|
event.at
|
|
618
645
|
);
|
|
619
646
|
if (event.toolStatus && event.event.type === "tool_call") {
|
|
620
|
-
messages = setToolMessageStatus(
|
|
647
|
+
messages = setToolMessageStatus(
|
|
648
|
+
messages,
|
|
649
|
+
event.event.toolCall.id,
|
|
650
|
+
event.toolStatus,
|
|
651
|
+
event.scope?.parentToolCallId
|
|
652
|
+
);
|
|
621
653
|
if (event.toolStatus === "approved") {
|
|
622
|
-
messages = setToolMessageApprovalKind(
|
|
654
|
+
messages = setToolMessageApprovalKind(
|
|
655
|
+
messages,
|
|
656
|
+
event.event.toolCall.id,
|
|
657
|
+
"auto",
|
|
658
|
+
event.scope?.parentToolCallId
|
|
659
|
+
);
|
|
623
660
|
}
|
|
624
661
|
}
|
|
625
662
|
return { ...state, messages };
|
|
@@ -633,25 +670,43 @@ function reduceSessionEvent(state, event) {
|
|
|
633
670
|
return {
|
|
634
671
|
...state,
|
|
635
672
|
approval: enqueueApproval(state.approval, event.approval),
|
|
636
|
-
messages: setToolMessageHidden(
|
|
673
|
+
messages: setToolMessageHidden(
|
|
674
|
+
state.messages,
|
|
675
|
+
event.approval.toolCallId,
|
|
676
|
+
true,
|
|
677
|
+
event.approval.parentToolCallId
|
|
678
|
+
)
|
|
637
679
|
};
|
|
638
680
|
case "approval-settled": {
|
|
639
|
-
let stamped = setToolMessageStatus(
|
|
681
|
+
let stamped = setToolMessageStatus(
|
|
682
|
+
state.messages,
|
|
683
|
+
event.toolCallId,
|
|
684
|
+
event.status,
|
|
685
|
+
event.parentToolCallId
|
|
686
|
+
);
|
|
640
687
|
if (event.status === "approved" && event.by === "client") {
|
|
641
|
-
stamped = setToolMessageApprovalKind(
|
|
688
|
+
stamped = setToolMessageApprovalKind(
|
|
689
|
+
stamped,
|
|
690
|
+
event.toolCallId,
|
|
691
|
+
"user",
|
|
692
|
+
event.parentToolCallId
|
|
693
|
+
);
|
|
642
694
|
}
|
|
643
695
|
return {
|
|
644
696
|
...state,
|
|
645
|
-
approval: removeApproval(
|
|
697
|
+
approval: removeApproval(
|
|
698
|
+
state.approval,
|
|
699
|
+
(item) => item.toolCallId === event.toolCallId && item.parentToolCallId === event.parentToolCallId
|
|
700
|
+
),
|
|
646
701
|
// Approved tools materialize as a transcript row; rejected ones never
|
|
647
702
|
// ran and stay hidden.
|
|
648
|
-
messages: event.status === "approved" ? setToolMessageHidden(stamped, event.toolCallId, false) : stamped
|
|
703
|
+
messages: event.status === "approved" ? setToolMessageHidden(stamped, event.toolCallId, false, event.parentToolCallId) : stamped
|
|
649
704
|
};
|
|
650
705
|
}
|
|
651
706
|
case "question-asked":
|
|
652
|
-
return { ...state, question:
|
|
707
|
+
return { ...state, question: enqueueQuestion(state.question, event.question) };
|
|
653
708
|
case "question-settled":
|
|
654
|
-
return
|
|
709
|
+
return { ...state, question: removeQuestion(state.question, event.questionId) };
|
|
655
710
|
case "turn-status":
|
|
656
711
|
return {
|
|
657
712
|
...state,
|
|
@@ -693,6 +748,7 @@ export {
|
|
|
693
748
|
dequeueActiveApproval,
|
|
694
749
|
removeApproval,
|
|
695
750
|
asJsonObject,
|
|
751
|
+
scopedToolKey,
|
|
696
752
|
setToolMessageStatus,
|
|
697
753
|
setToolMessageApprovalKind,
|
|
698
754
|
setToolMessageHidden,
|
|
@@ -703,6 +759,9 @@ export {
|
|
|
703
759
|
appendInfoMessage,
|
|
704
760
|
appendWarningMessage,
|
|
705
761
|
applyAgentEvent,
|
|
762
|
+
createQuestionQueueState,
|
|
763
|
+
enqueueQuestion,
|
|
764
|
+
removeQuestion,
|
|
706
765
|
createSessionViewState,
|
|
707
766
|
reduceSessionEvent
|
|
708
767
|
};
|
|
@@ -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
|
+
};
|
|
@@ -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,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC3C,CAAC;AAEN,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,EAA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AC,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, 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,19 @@ export interface DaemonDirectoryClient {
|
|
|
33
33
|
* message; everything else is a plain `Error`.
|
|
34
34
|
*/
|
|
35
35
|
export interface DaemonDataClient {
|
|
36
|
-
fetchTranscript(daemonId: string,
|
|
37
|
-
workspace?: string;
|
|
38
|
-
profile?: string;
|
|
39
|
-
}): Promise<SessionSnapshot>;
|
|
36
|
+
fetchTranscript(daemonId: string, identity: PersistenceIdentity): Promise<SessionSnapshot>;
|
|
40
37
|
fetchHistory(daemonId: string, opts?: {
|
|
41
38
|
profile?: string;
|
|
42
39
|
cwd?: string;
|
|
43
40
|
limit?: number;
|
|
44
41
|
cursor?: string;
|
|
45
42
|
}): Promise<HistoryPage>;
|
|
43
|
+
listHistoryWorkspaces(daemonId: string, opts?: ListHistoryWorkspacesParams & {
|
|
44
|
+
signal?: AbortSignal;
|
|
45
|
+
}): Promise<ListHistoryWorkspacesResult>;
|
|
46
|
+
listWorkspaceHistory(daemonId: string, opts?: ListWorkspaceHistoryParams & {
|
|
47
|
+
signal?: AbortSignal;
|
|
48
|
+
}): Promise<WorkspaceHistoryPage>;
|
|
46
49
|
listWorkspaces(daemonId: string, opts?: {
|
|
47
50
|
profile?: string;
|
|
48
51
|
}): Promise<WorkspaceConfigSummary[]>;
|
|
@@ -51,10 +54,7 @@ export interface DaemonDataClient {
|
|
|
51
54
|
root?: string;
|
|
52
55
|
profile?: string;
|
|
53
56
|
}): Promise<WorkspaceConfigSummary>;
|
|
54
|
-
deleteSession(daemonId: string,
|
|
55
|
-
workspace?: string;
|
|
56
|
-
profile?: string;
|
|
57
|
-
}): Promise<void>;
|
|
57
|
+
deleteSession(daemonId: string, identity: PersistenceIdentity): Promise<void>;
|
|
58
58
|
listProfiles(daemonId: string): Promise<ProfileSummary[]>;
|
|
59
59
|
listProviders(daemonId: string, opts?: {
|
|
60
60
|
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,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,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAAC;CAC5D;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,eAAe,CAAC,QAAQ,EAAE,M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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,CA6WpF"}
|