@tangle-network/agent-app 0.60.46 → 0.60.48
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/assistant/index.js +5 -5
- package/dist/chat-react/index.js +3 -3
- package/dist/chat-routes/index.d.ts +1 -0
- package/dist/chat-routes/index.js +39 -15
- package/dist/chat-routes/index.js.map +1 -1
- package/dist/chat-routes/turn-progress.d.ts +88 -0
- package/dist/chat-routes/turn-routes.d.ts +7 -1
- package/dist/chat-routes/wire.d.ts +3 -1
- package/dist/chat-store/index.js +2 -2
- package/dist/{chunk-FZJRATBY.js → chunk-7GMERKA3.js} +1104 -1068
- package/dist/chunk-7GMERKA3.js.map +1 -0
- package/dist/{chunk-FPCIJCS3.js → chunk-IKESHQ5B.js} +2 -2
- package/dist/{chunk-TCPRFFZK.js → chunk-MFDH4C2F.js} +2 -2
- package/dist/{chunk-GBGSC42G.js → chunk-MJRVFRJB.js} +2 -2
- package/dist/{chunk-4EVEBEJX.js → chunk-TNEFHE2K.js} +76 -4
- package/dist/chunk-TNEFHE2K.js.map +1 -0
- package/dist/{chunk-HOZMP3AR.js → chunk-VC5AGH7C.js} +126 -3
- package/dist/chunk-VC5AGH7C.js.map +1 -0
- package/dist/public-consultation/index.d.ts +1 -1
- package/dist/public-consultation/index.js +3 -3
- package/dist/web-react/chat-stream.d.ts +4 -0
- package/dist/web-react/index.d.ts +6 -1
- package/dist/web-react/index.js +26 -6
- package/dist/web-react/turn-progress.d.ts +24 -0
- package/package.json +1 -1
- package/dist/chunk-4EVEBEJX.js.map +0 -1
- package/dist/chunk-FZJRATBY.js.map +0 -1
- package/dist/chunk-HOZMP3AR.js.map +0 -1
- /package/dist/{chunk-FPCIJCS3.js.map → chunk-IKESHQ5B.js.map} +0 -0
- /package/dist/{chunk-TCPRFFZK.js.map → chunk-MFDH4C2F.js.map} +0 -0
- /package/dist/{chunk-GBGSC42G.js.map → chunk-MJRVFRJB.js.map} +0 -0
package/dist/assistant/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
chatToolCallPart
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-7GMERKA3.js";
|
|
4
4
|
import "../chunk-FAU5FIFD.js";
|
|
5
5
|
import "../chunk-3HUFJ5LO.js";
|
|
6
6
|
import "../chunk-FBVLEGEG.js";
|
|
7
7
|
import "../chunk-Y6PRDUFJ.js";
|
|
8
8
|
import {
|
|
9
9
|
ChatComposer
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-MFDH4C2F.js";
|
|
11
11
|
import "../chunk-L7MB2LLM.js";
|
|
12
12
|
import "../chunk-KHCJKVQN.js";
|
|
13
13
|
import "../chunk-XEURJVS5.js";
|
|
@@ -22,14 +22,14 @@ import {
|
|
|
22
22
|
AsyncView
|
|
23
23
|
} from "../chunk-LSUELMHY.js";
|
|
24
24
|
import "../chunk-FQYAJYPW.js";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-MJRVFRJB.js";
|
|
26
26
|
import "../chunk-MLG6XKPV.js";
|
|
27
27
|
import "../chunk-MCYJON3F.js";
|
|
28
28
|
import "../chunk-B7CL7ENS.js";
|
|
29
29
|
import "../chunk-PV33JZKV.js";
|
|
30
30
|
import "../chunk-7YA4QNTU.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
31
|
+
import "../chunk-IKESHQ5B.js";
|
|
32
|
+
import "../chunk-VC5AGH7C.js";
|
|
33
33
|
import "../chunk-ZVEEWGDK.js";
|
|
34
34
|
import "../chunk-TXD5HXLE.js";
|
|
35
35
|
import "../chunk-ZGUXI5SI.js";
|
package/dist/chat-react/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ComposerModeControls,
|
|
3
3
|
EntryComposer
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-MFDH4C2F.js";
|
|
5
5
|
import "../chunk-L7MB2LLM.js";
|
|
6
6
|
import "../chunk-NJDQ2JCP.js";
|
|
7
7
|
import "../chunk-HG4OONJA.js";
|
|
8
8
|
import "../chunk-SJWIZT7B.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-MJRVFRJB.js";
|
|
10
10
|
import "../chunk-MLG6XKPV.js";
|
|
11
11
|
import "../chunk-MCYJON3F.js";
|
|
12
12
|
import "../chunk-7YA4QNTU.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-VC5AGH7C.js";
|
|
14
14
|
import "../chunk-TXD5HXLE.js";
|
|
15
15
|
export {
|
|
16
16
|
ComposerModeControls,
|
|
@@ -10,6 +10,7 @@ export * from './wire';
|
|
|
10
10
|
export * from './binary-sniff';
|
|
11
11
|
export * from './attachment-validation';
|
|
12
12
|
export * from './turn-routes';
|
|
13
|
+
export * from './turn-progress';
|
|
13
14
|
export * from './gateway-adapter';
|
|
14
15
|
export * from './stale-turn-lock';
|
|
15
16
|
export * from './sandbox-producer';
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
checkAttachmentType,
|
|
25
25
|
sanitizeAttachmentFileName,
|
|
26
26
|
sniffBinary
|
|
27
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-MJRVFRJB.js";
|
|
28
28
|
import {
|
|
29
29
|
DEFAULT_STALE_TURN_LOCK_GRACE_MS,
|
|
30
30
|
DEFAULT_TERMINAL_TURN_LOCK_GRACE_MS,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
rowIdOf,
|
|
66
66
|
storeSupportsDraftPersistence,
|
|
67
67
|
streamChatRouteAsSandboxEvents
|
|
68
|
-
} from "../chunk-
|
|
68
|
+
} from "../chunk-TNEFHE2K.js";
|
|
69
69
|
import "../chunk-UKZMJND6.js";
|
|
70
70
|
import "../chunk-UTAIRVOK.js";
|
|
71
71
|
import "../chunk-RN4WPTBH.js";
|
|
@@ -80,7 +80,7 @@ import {
|
|
|
80
80
|
attachmentInputToPart,
|
|
81
81
|
attachmentKindForMime,
|
|
82
82
|
toChatMessageParts
|
|
83
|
-
} from "../chunk-
|
|
83
|
+
} from "../chunk-IKESHQ5B.js";
|
|
84
84
|
import {
|
|
85
85
|
ChatTurnInputError,
|
|
86
86
|
DISPATCH_MAX_MEDIA_PARTS,
|
|
@@ -89,19 +89,29 @@ import {
|
|
|
89
89
|
DISPATCH_STRUCTURAL_RESERVE_BYTES,
|
|
90
90
|
INLINE_PARTS_MAX_BYTES,
|
|
91
91
|
MENTION_MAX_COUNT,
|
|
92
|
+
TURN_PHASE_EVENT,
|
|
93
|
+
TURN_PROGRESS_FIRST,
|
|
94
|
+
TURN_PROGRESS_HEADER,
|
|
95
|
+
TURN_RESPONSE_EVENT,
|
|
96
|
+
TURN_ROUTE_PHASE_MESSAGES,
|
|
97
|
+
TURN_STREAM_LOST_CODE,
|
|
92
98
|
assertPromptPartsWithinCap,
|
|
93
99
|
base64WireLen,
|
|
94
100
|
buildMentionPromptBlock,
|
|
101
|
+
buildTurnPhaseEvent,
|
|
95
102
|
chatTurnRequestInit,
|
|
96
103
|
fileMentionsToParts,
|
|
97
104
|
formatBytes,
|
|
105
|
+
isTurnPhaseEvent,
|
|
98
106
|
mediaTypeForMentionPath,
|
|
99
107
|
mentionKindForPath,
|
|
100
108
|
parseChatTurnParts,
|
|
101
109
|
parseFileMentions,
|
|
102
110
|
promptPartsByteSize,
|
|
111
|
+
settleTurnResponse,
|
|
112
|
+
turnResponseEventFor,
|
|
103
113
|
validateSandboxMentionPath
|
|
104
|
-
} from "../chunk-
|
|
114
|
+
} from "../chunk-VC5AGH7C.js";
|
|
105
115
|
import "../chunk-ZVEEWGDK.js";
|
|
106
116
|
import {
|
|
107
117
|
isWorkspaceFileExportable
|
|
@@ -1835,9 +1845,13 @@ function abortedToolCall(parts) {
|
|
|
1835
1845
|
}
|
|
1836
1846
|
return void 0;
|
|
1837
1847
|
}
|
|
1838
|
-
function
|
|
1848
|
+
function admittedWorkIsLive(status, runsByTurnId, admittedTurnIds, dispatchMayBePending) {
|
|
1839
1849
|
if (status.status !== "queued" && status.status !== "running") return false;
|
|
1840
|
-
|
|
1850
|
+
if (status.raw?.state === "stale") return false;
|
|
1851
|
+
return admittedTurnIds.some((turnId) => {
|
|
1852
|
+
const run = runsByTurnId.get(turnId);
|
|
1853
|
+
return run ? run.status === "active" : dispatchMayBePending;
|
|
1854
|
+
});
|
|
1841
1855
|
}
|
|
1842
1856
|
function missingTurnReceipt(turnId, error) {
|
|
1843
1857
|
return { turnId, state: "failed", text: "", parts: [], usage: {}, error };
|
|
@@ -1873,8 +1887,11 @@ async function observeNativeCompletion(options) {
|
|
|
1873
1887
|
]));
|
|
1874
1888
|
}
|
|
1875
1889
|
const exactSession = session;
|
|
1890
|
+
const dispatchMayBePending = now - options.registeredAt < (options.absentDispatchDeadlineMs ?? DEFAULT_ABSENT_DISPATCH_DEADLINE_MS);
|
|
1891
|
+
let runsByTurnId;
|
|
1892
|
+
const readRuns = async () => runsByTurnId ??= new Map((await exactSession.runs()).map((run) => [run.executionId, run]));
|
|
1876
1893
|
if (admission.state === "open") {
|
|
1877
|
-
if (
|
|
1894
|
+
if (admittedWorkIsLive(status, await readRuns(), admission.admittedTurnIds, dispatchMayBePending)) {
|
|
1878
1895
|
admission = await options.admissionStore.renew(options.executionId, new Date(now)) ?? admission;
|
|
1879
1896
|
} else if (leaseUntil <= now) {
|
|
1880
1897
|
admission = await options.admissionStore.closeExpired(options.executionId, new Date(now)) ?? admission;
|
|
@@ -1885,18 +1902,15 @@ async function observeNativeCompletion(options) {
|
|
|
1885
1902
|
if (admittedTurnIds.length === 0 || admittedTurnIds[0] !== options.turnId) {
|
|
1886
1903
|
throw new Error("Native completion admission has an invalid turn sequence");
|
|
1887
1904
|
}
|
|
1888
|
-
const
|
|
1889
|
-
const
|
|
1890
|
-
|
|
1891
|
-
if (
|
|
1892
|
-
return { state: "running" };
|
|
1893
|
-
}
|
|
1894
|
-
if (admittedTurnIds.some((turnId) => runsByTurnId.get(turnId)?.status === "active")) return { state: "running" };
|
|
1905
|
+
const ledger = await readRuns();
|
|
1906
|
+
const missingExecution = admittedTurnIds.find((turnId) => !ledger.has(turnId));
|
|
1907
|
+
if (missingExecution && dispatchMayBePending) return { state: "running" };
|
|
1908
|
+
if (admittedTurnIds.some((turnId) => ledger.get(turnId)?.status === "active")) return { state: "running" };
|
|
1895
1909
|
const since = Math.max(0, options.registeredAt - MESSAGE_READ_SKEW_MS);
|
|
1896
1910
|
let messages;
|
|
1897
1911
|
const recovered = [];
|
|
1898
1912
|
for (const turnId of admittedTurnIds) {
|
|
1899
|
-
const run =
|
|
1913
|
+
const run = ledger.get(turnId);
|
|
1900
1914
|
if (!run) {
|
|
1901
1915
|
recovered.push(missingTurnReceipt(turnId, "Native Sandbox execution ledger is missing the admitted turn"));
|
|
1902
1916
|
continue;
|
|
@@ -3405,6 +3419,12 @@ export {
|
|
|
3405
3419
|
PROMOTE_MAX_FILE_BYTES,
|
|
3406
3420
|
RUNTIME_RESTARTED_ERROR,
|
|
3407
3421
|
TOOL_ABORTED_ERROR,
|
|
3422
|
+
TURN_PHASE_EVENT,
|
|
3423
|
+
TURN_PROGRESS_FIRST,
|
|
3424
|
+
TURN_PROGRESS_HEADER,
|
|
3425
|
+
TURN_RESPONSE_EVENT,
|
|
3426
|
+
TURN_ROUTE_PHASE_MESSAGES,
|
|
3427
|
+
TURN_STREAM_LOST_CODE,
|
|
3408
3428
|
UPLOAD_INLINE_MAX_BYTES,
|
|
3409
3429
|
UPLOAD_MAX_FILE_BYTES,
|
|
3410
3430
|
aggregateNativeCompletionReceipts,
|
|
@@ -3416,6 +3436,7 @@ export {
|
|
|
3416
3436
|
boundNativeCompletionReceipt,
|
|
3417
3437
|
buildDispatchParts,
|
|
3418
3438
|
buildMentionPromptBlock,
|
|
3439
|
+
buildTurnPhaseEvent,
|
|
3419
3440
|
bytesToBase64,
|
|
3420
3441
|
chatTurnRequestInit,
|
|
3421
3442
|
checkAttachmentType,
|
|
@@ -3436,6 +3457,7 @@ export {
|
|
|
3436
3457
|
isCommittingSandboxEvent,
|
|
3437
3458
|
isDraftContentEvent,
|
|
3438
3459
|
isLiveLifecycleEvent,
|
|
3460
|
+
isTurnPhaseEvent,
|
|
3439
3461
|
mediaTypeForMentionPath,
|
|
3440
3462
|
mentionKindForPath,
|
|
3441
3463
|
normalizeChatPromptForSandbox,
|
|
@@ -3458,6 +3480,7 @@ export {
|
|
|
3458
3480
|
runDetachedTurn,
|
|
3459
3481
|
sanitizeAttachmentFileName,
|
|
3460
3482
|
sanitizeUploadFilename,
|
|
3483
|
+
settleTurnResponse,
|
|
3461
3484
|
sniffBinary,
|
|
3462
3485
|
sniffMimeFromName,
|
|
3463
3486
|
storeSupportsDraftPersistence,
|
|
@@ -3465,6 +3488,7 @@ export {
|
|
|
3465
3488
|
streamPlanFollowUpEvents,
|
|
3466
3489
|
streamWithModelFailover,
|
|
3467
3490
|
summarizeFailoverReason,
|
|
3491
|
+
turnResponseEventFor,
|
|
3468
3492
|
unwrapSessionEventPayload,
|
|
3469
3493
|
validateSandboxMentionPath,
|
|
3470
3494
|
withDurableChatProjection
|