@qredence/fleet 0.10.2 → 0.10.4
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/CHANGELOG.md +20 -0
- package/dist/runtime-manifest.json +14 -14
- package/dist/web/client/assets/{artifacts-panel-CfWH5cQn.js → artifacts-panel-CDuvwZXW.js} +1 -1
- package/dist/web/client/assets/{chat-command-palette-CKGrP-Ke.js → chat-command-palette-DSpwG3Ph.js} +1 -1
- package/dist/web/client/assets/{ipython-tool-bieUhw9K.js → cpython-tool-CcGMkNQ4.js} +1 -1
- package/dist/web/client/assets/globals-CR3boQb2.css +2 -0
- package/dist/web/client/assets/index-BpqhS0Xv.js +12 -0
- package/dist/web/client/assets/prime-agent-artifacts-CuR1D_ch.js +5 -0
- package/dist/web/client/assets/reasoning-line-B79r9oqP.js +1 -0
- package/dist/web/client/assets/{repl-panel-5xgkDXO5.js → repl-panel-Dj0nX5A6.js} +1 -1
- package/dist/web/client/assets/right-panel-registry-HNH3niQ8.js +2 -0
- package/dist/web/client/assets/routes-CJRPrnVB.js +14 -0
- package/dist/web/client/assets/session-activity-panel-Dvy044_T.js +1 -0
- package/dist/web/client/assets/{session-insights-panel-BXEmuJKf.js → session-insights-panel-Bltz_o6C.js} +1 -1
- package/dist/web/client/assets/{session-tool-renderer-CGMatufW.js → session-tool-renderer-BLFqj28b.js} +7 -7
- package/dist/web/client/assets/{subagent-chat-panel-xm-zBsFL.js → subagent-chat-panel-Cr57arv9.js} +1 -1
- package/dist/web/client/assets/subagent-transcript-CqAEPEJp.js +1 -0
- package/dist/web/client/assets/subagents-panel-DCjSDcM4.js +1 -0
- package/dist/web/client/assets/tool-action-icon-vTW_L1Fj.js +1 -0
- package/dist/web/client/assets/tool-output-normalizer-DDoLNo4P.js +4 -0
- package/dist/web/client/assets/tool-part-normalizer-DdgmYc9z.js +4 -0
- package/dist/web/client/assets/{tool-result-C_RIixge.js → tool-result-DxWDQJSF.js} +3 -3
- package/dist/web/client/assets/tool-timeline-BoWCZg0K.js +2 -0
- package/dist/web/client/bundle-budget.json +5 -5
- package/dist/web/server/{_tanstack-start-manifest_v-CGHXgy5L-KSOQEPW7.js → _tanstack-start-manifest_v-BhSwNUm2-HUY424SL.js} +9 -9
- package/dist/web/server/{agents-DOgCHixY-KUZP2VDO.js → agents-DOgCHixY-U362NTZW.js} +1 -1
- package/dist/web/server/{agents-page-BdiR9H8w-M6X6SXMF.js → agents-page-BdiR9H8w-WK3UCXSA.js} +7 -7
- package/dist/web/server/{artifacts-panel-CHPMYc6C-OWIYGSRM.js → artifacts-panel-C9OUKEU0-N74QLS6E.js} +19 -19
- package/dist/web/server/{chat-command-palette-VF4C0ttN-GY52QBFP.js → chat-command-palette-CnKy1Q4g-GJJGAVQ4.js} +13 -13
- package/dist/web/server/{chunk-GNXIDE26.js → chunk-2R5CY7DW.js} +2 -2
- package/dist/web/server/{chunk-W72ZBCJ5.js → chunk-37MAYG3X.js} +15 -15
- package/dist/web/server/{chunk-MDGXRDJM.js → chunk-3KHS4HHI.js} +13 -13
- package/dist/web/server/{chunk-BD7YKYWL.js → chunk-4ISLMQ2M.js} +3 -3
- package/dist/web/server/{chunk-FSQWWR2M.js → chunk-4ZKBYAHH.js} +1 -1
- package/dist/web/server/{chunk-BLGKLQJG.js → chunk-63IBRYZL.js} +6 -6
- package/dist/web/server/{chunk-TXZDDJCT.js → chunk-6OZY4XH7.js} +3 -3
- package/dist/web/server/{chunk-7DUB7HGF.js → chunk-A6LRK2MC.js} +174 -51
- package/dist/web/server/{chunk-PBNUO4IN.js → chunk-BG4DVGLL.js} +2 -2
- package/dist/web/server/{chunk-KSGGSGOA.js → chunk-BVSDXFQ6.js} +1 -1
- package/dist/web/server/{chunk-35RIM6VP.js → chunk-CPB76YQU.js} +1251 -740
- package/dist/web/server/{chunk-HAFELESQ.js → chunk-ETTLRHDY.js} +3 -3
- package/dist/web/server/{chunk-2ETDIMNM.js → chunk-ETVLY2KE.js} +1 -1
- package/dist/web/server/{chunk-BZ2EAUZZ.js → chunk-F6P2FTIT.js} +3 -3
- package/dist/web/server/{chunk-CE7U5QB2.js → chunk-FGOT5FGH.js} +2 -2
- package/dist/web/server/{chunk-GW7HYECO.js → chunk-FSIRN7F7.js} +105 -95
- package/dist/web/server/{chunk-R4BS3KYI.js → chunk-FVTCXLYO.js} +12 -12
- package/dist/web/server/{chunk-NDU4LK5M.js → chunk-IJZDCYFG.js} +15 -10
- package/dist/web/server/{chunk-FT7HNDR5.js → chunk-JR5TXTGV.js} +5 -5
- package/dist/web/server/{chunk-PQVTLG3E.js → chunk-NEMK2RTM.js} +4 -4
- package/dist/web/server/{chunk-AXN2OBPF.js → chunk-O5CPI2JH.js} +1 -1
- package/dist/web/server/{chunk-Q4ECIATK.js → chunk-ORO7KXHF.js} +4 -4
- package/dist/web/server/{chunk-VDEUVEWL.js → chunk-U26ZMWVI.js} +300 -300
- package/dist/web/server/{chunk-APOS34PW.js → chunk-U73UDYRF.js} +2 -2
- package/dist/web/server/{chunk-P3ZJ6L7V.js → chunk-USP4O3V7.js} +2 -2
- package/dist/web/server/{chunk-FNV3WZXL.js → chunk-VFW2KPLD.js} +2 -2
- package/dist/web/server/{chunk-5MOXRFX6.js → chunk-Y3YE73VQ.js} +45 -5
- package/dist/web/server/{chunk-LYJ3XDEZ.js → chunk-ZRISZYHZ.js} +14 -14
- package/dist/web/server/{connectors-Dv_uPdv0-2X5VWQXK.js → connectors-Dv_uPdv0-WIJGW5CQ.js} +1 -1
- package/dist/web/server/{connectors-page-DW75T-uH-EKRHUZ6K.js → connectors-page-DW75T-uH-3KBZRVAT.js} +10 -10
- package/dist/web/server/{create-project-dialog-CSZHeLNg-EEW3DRTY.js → create-project-dialog-dwXNUwY--APUSOU5G.js} +14 -14
- package/dist/web/server/{fork-picker-dialog-DFpKOdAw-JPLJSYYU.js → fork-picker-dialog-DFpKOdAw-WJPMXHSE.js} +6 -6
- package/dist/web/server/{markdown-Cc8V9dOF-JTNTJKQU.js → markdown-Cc8V9dOF-MMI3ZBVZ.js} +4 -4
- package/dist/web/server/{markdown-code-gaRnbgNM-V5LIRYCD.js → markdown-code-gaRnbgNM-ND6VVJ7D.js} +4 -4
- package/dist/web/server/{message-queue-nQ2_kU82-KKSLYR4S.js → message-queue-nQ2_kU82-3PN7CKFG.js} +4 -4
- package/dist/web/server/{model-selector-list-q8bMnmhy-SPFJGUBT.js → model-selector-list-q8bMnmhy-W6JM2N7G.js} +8 -8
- package/dist/web/server/{openui-renderer-BkDeIpwC-S5BOLH5L.js → openui-renderer-Das3EemD-AODSN4I2.js} +15 -15
- package/dist/web/server/{prompt-suggestions-B67Uy5Rk-5SMTSIFQ.js → prompt-suggestions-B67Uy5Rk-6MV56U6N.js} +4 -4
- package/dist/web/server/{repl-panel-1kSS1UGd-POXRYDDJ.js → repl-panel-DfC-BCfn-4OZEKSFX.js} +8 -8
- package/dist/web/server/{resources-panel-tCQCqEQv-NJO5FRHW.js → resources-panel-BL41dm3H-UWWMTOFL.js} +11 -11
- package/dist/web/server/{router-DBc-HYGW-CC6DTCFR.js → router-DJDog9kJ-IHEFPUCH.js} +6 -6
- package/dist/web/server/{routes-CcRh_tDy-M7ZRBLVA.js → routes-BWk0YodE-CEPOI27O.js} +30 -32
- package/dist/web/server/server.js +1415 -1004
- package/dist/web/server/{session-activity-panel-CS56rTyW-J4GAZSTC.js → session-activity-panel-B56ALLHr-6PDGEA2M.js} +84 -19
- package/dist/web/server/{session-insights-panel-BiVObm_6-AP4FITT7.js → session-insights-panel-cS12HsWt-YX7QOWIA.js} +2 -2
- package/dist/web/server/{session-reasoning-panel-DlqaQNE2-RMOBVYVD.js → session-reasoning-panel-CtQUqSv9-JIXRXBH7.js} +10 -10
- package/dist/web/server/{session-tool-renderer-CHYJwJej-Z3K5TRIZ.js → session-tool-renderer-Co466pSk-QUTYNAOE.js} +13 -13
- package/dist/web/server/{session-tree-panel-B2GT3Hf_-WGHVVRRR.js → session-tree-panel-B23gApxX-44NFOCFB.js} +10 -10
- package/dist/web/server/{settings-dialog-7V9x-CPC-6IEB2DFH.js → settings-dialog-CdRjXyfc-IYMPCNR5.js} +17 -17
- package/dist/web/server/{subagent-chat-panel-Cjg1oOFO-PNWSFYNA.js → subagent-chat-panel-DwvOMUnh-EPVZRTRM.js} +16 -16
- package/dist/web/server/{subagents-panel-DPfqOHdw-B74PSAMP.js → subagents-panel-DlFBFoX6-SAWYBVZJ.js} +32 -31
- package/dist/web/server/{workspace-panel-DRaU8AWD-7AYOEM55.js → workspace-panel-CxUsWmIE-3BMZFN5O.js} +11 -11
- package/package.json +1 -1
- package/dist/web/client/assets/globals-C6h6fq-s.css +0 -2
- package/dist/web/client/assets/index-D3OD2pV7.js +0 -13
- package/dist/web/client/assets/prime-agent-artifacts-C-g1VPiW.js +0 -5
- package/dist/web/client/assets/reasoning-line-DGdPUMwT.js +0 -1
- package/dist/web/client/assets/right-panel-registry-BkBAryPm.js +0 -2
- package/dist/web/client/assets/routes-DgbWbQOu.js +0 -14
- package/dist/web/client/assets/session-activity-panel-BloVPsLJ.js +0 -1
- package/dist/web/client/assets/subagent-transcript-BzToBVWk.js +0 -1
- package/dist/web/client/assets/subagents-panel-B5ooG4sS.js +0 -1
- package/dist/web/client/assets/tool-output-normalizer-DDU09Zc6.js +0 -4
- package/dist/web/client/assets/tool-part-normalizer-CJ2sY87r.js +0 -4
- package/dist/web/client/assets/tool-timeline-BVY5VQ3a.js +0 -2
- package/dist/web/client/assets/wrench-BXX_Ah2s.js +0 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
CardDescription,
|
|
5
5
|
CardHeader,
|
|
6
6
|
CardTitle
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BVSDXFQ6.js";
|
|
8
8
|
import {
|
|
9
9
|
isModelPatternEnabled
|
|
10
10
|
} from "./chunk-TAPQMXA7.js";
|
|
@@ -86,7 +86,7 @@ import {
|
|
|
86
86
|
} from "./chunk-7DQQMT5V.js";
|
|
87
87
|
import {
|
|
88
88
|
Toaster
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-U73UDYRF.js";
|
|
90
90
|
import {
|
|
91
91
|
__exportAll
|
|
92
92
|
} from "./chunk-OO7NBFQQ.js";
|
|
@@ -121,9 +121,9 @@ import {
|
|
|
121
121
|
createRootRoute,
|
|
122
122
|
createRouter,
|
|
123
123
|
lazyRouteComponent
|
|
124
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-CPB76YQU.js";
|
|
125
125
|
|
|
126
|
-
// web/app/dist/server/assets/router-
|
|
126
|
+
// web/app/dist/server/assets/router-DJDog9kJ.js
|
|
127
127
|
import { useEffect, useLayoutEffect, useState } from "react";
|
|
128
128
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
129
129
|
import { chmod, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, stat, unlink, writeFile } from "node:fs/promises";
|
|
@@ -2194,7 +2194,7 @@ function getQueryClient() {
|
|
|
2194
2194
|
if (!browserQueryClient) browserQueryClient = makeQueryClient();
|
|
2195
2195
|
return browserQueryClient;
|
|
2196
2196
|
}
|
|
2197
|
-
var globals_default = "/assets/globals-
|
|
2197
|
+
var globals_default = "/assets/globals-CR3boQb2.css";
|
|
2198
2198
|
var Route$32 = createRootRoute({
|
|
2199
2199
|
head: () => ({
|
|
2200
2200
|
meta: [
|
|
@@ -2266,11 +2266,11 @@ function RootDocument({ children }) {
|
|
|
2266
2266
|
})]
|
|
2267
2267
|
});
|
|
2268
2268
|
}
|
|
2269
|
-
var $$splitComponentImporter$2 = () => import("./routes-
|
|
2269
|
+
var $$splitComponentImporter$2 = () => import("./routes-BWk0YodE-CEPOI27O.js").then((n) => n.t);
|
|
2270
2270
|
var Route$31 = createFileRoute("/")({ component: lazyRouteComponent($$splitComponentImporter$2, "component") });
|
|
2271
|
-
var $$splitComponentImporter$1 = () => import("./agents-DOgCHixY-
|
|
2271
|
+
var $$splitComponentImporter$1 = () => import("./agents-DOgCHixY-U362NTZW.js");
|
|
2272
2272
|
var Route$30 = createFileRoute("/agents")({ component: lazyRouteComponent($$splitComponentImporter$1, "component") });
|
|
2273
|
-
var $$splitComponentImporter = () => import("./connectors-Dv_uPdv0-
|
|
2273
|
+
var $$splitComponentImporter = () => import("./connectors-Dv_uPdv0-WIJGW5CQ.js");
|
|
2274
2274
|
var Route$29 = createFileRoute("/connectors")({ component: lazyRouteComponent($$splitComponentImporter, "component") });
|
|
2275
2275
|
var ManagedAttachmentValidationError = class extends Error {
|
|
2276
2276
|
status;
|
|
@@ -3046,7 +3046,7 @@ function createFleetErrorEnvelope(err, fallbackMessage = "An unexpected error oc
|
|
|
3046
3046
|
isTerminal: false,
|
|
3047
3047
|
remediation: {
|
|
3048
3048
|
action: "restart_kernel",
|
|
3049
|
-
label: "Restart
|
|
3049
|
+
label: "Restart CPython Kernel"
|
|
3050
3050
|
}
|
|
3051
3051
|
};
|
|
3052
3052
|
if (lower.includes("timeout") || lower.includes("timed out")) return {
|
|
@@ -3307,6 +3307,12 @@ function toolResultOutput(msg) {
|
|
|
3307
3307
|
isError: msg.isError === true
|
|
3308
3308
|
};
|
|
3309
3309
|
}
|
|
3310
|
+
function isToolResultError(isError, result) {
|
|
3311
|
+
if (isError === true) return true;
|
|
3312
|
+
if (!result || typeof result !== "object") return false;
|
|
3313
|
+
const details = result.details;
|
|
3314
|
+
return !!details && typeof details === "object" && details.status === "error";
|
|
3315
|
+
}
|
|
3310
3316
|
function extractToolErrorText(result) {
|
|
3311
3317
|
if (!result) return "Tool execution failed";
|
|
3312
3318
|
if (typeof result === "string") return result;
|
|
@@ -3374,7 +3380,7 @@ function toChatMessagesFromAgentMessages(messages, sessionId) {
|
|
|
3374
3380
|
const result = message;
|
|
3375
3381
|
const toolCallId = typeof result.toolCallId === "string" ? result.toolCallId : void 0;
|
|
3376
3382
|
const toolName = typeof result.toolName === "string" ? result.toolName : "tool";
|
|
3377
|
-
const isError = result.isError
|
|
3383
|
+
const isError = isToolResultError(result.isError, result);
|
|
3378
3384
|
const errorText = isError ? extractToolErrorText(result) : void 0;
|
|
3379
3385
|
const errorEnvelope = errorText ? createFleetErrorEnvelope(errorText) : void 0;
|
|
3380
3386
|
const durationMs = typeof result.durationMs === "number" ? result.durationMs : typeof result.details?.durationMs === "number" ? result.details.durationMs : void 0;
|
|
@@ -4615,28 +4621,28 @@ var PRIME_AGENT_RUNTIME_default = {
|
|
|
4615
4621
|
tarball: "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.9.8/prime-agent-0.9.8.tgz",
|
|
4616
4622
|
sha256: "d7b72785119efc28bfbca8ec4a7f47a1fcdcf47fcd8cebdb60bffaa79e3e1274",
|
|
4617
4623
|
rust: {
|
|
4618
|
-
"version": "0.10.
|
|
4619
|
-
"baseUrl": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.10.
|
|
4624
|
+
"version": "0.10.2",
|
|
4625
|
+
"baseUrl": "https://pub-728493de92a943e2a9b2d17b4719f318.r2.dev/releases/v0.10.2",
|
|
4620
4626
|
"platforms": {
|
|
4621
4627
|
"darwin-arm64": {
|
|
4622
|
-
"archive": "prime-agent-0.10.
|
|
4623
|
-
"sha256": "
|
|
4624
|
-
"executableSha256": "
|
|
4628
|
+
"archive": "prime-agent-0.10.2-darwin-arm64.tar.gz",
|
|
4629
|
+
"sha256": "2f0894811f8ba047eb1874cc1d7392f45c0d6135be6090e7601983de17a6d1d7",
|
|
4630
|
+
"executableSha256": "85fc476f45bc3b316152bb266b685b14a744464c057211c3334eab2da78c727a"
|
|
4625
4631
|
},
|
|
4626
4632
|
"darwin-x64": {
|
|
4627
|
-
"archive": "prime-agent-0.10.
|
|
4628
|
-
"sha256": "
|
|
4629
|
-
"executableSha256": "
|
|
4633
|
+
"archive": "prime-agent-0.10.2-darwin-x64.tar.gz",
|
|
4634
|
+
"sha256": "32683ec045940093f6fea66ad234894f0361fd7c466932365c09097edf97499a",
|
|
4635
|
+
"executableSha256": "6643b29e6a5bb2f8c943b7c372acab71091ab8a35f7f4ee47cc047fb877b0c92"
|
|
4630
4636
|
},
|
|
4631
4637
|
"linux-arm64": {
|
|
4632
|
-
"archive": "prime-agent-0.10.
|
|
4633
|
-
"sha256": "
|
|
4634
|
-
"executableSha256": "
|
|
4638
|
+
"archive": "prime-agent-0.10.2-linux-arm64.tar.gz",
|
|
4639
|
+
"sha256": "cd31de3a52dac3bdee44b723f10341cc5255f135acbcde8894575e324fa852b7",
|
|
4640
|
+
"executableSha256": "b522a2462e0242d51083c410afc85bdeaf4924708a98a3cac6d2b9bd1994521b"
|
|
4635
4641
|
},
|
|
4636
4642
|
"linux-x64": {
|
|
4637
|
-
"archive": "prime-agent-0.10.
|
|
4638
|
-
"sha256": "
|
|
4639
|
-
"executableSha256": "
|
|
4643
|
+
"archive": "prime-agent-0.10.2-linux-x64.tar.gz",
|
|
4644
|
+
"sha256": "09659961dfde201cc39f1e69b607385d708da3e591f267a4fea04970afb8b005",
|
|
4645
|
+
"executableSha256": "f13e3e5ebcb1aa044bd4d5f8375479dbd1ca0210ded37db0d4a360a2be103b23"
|
|
4640
4646
|
}
|
|
4641
4647
|
}
|
|
4642
4648
|
}
|
|
@@ -5870,6 +5876,10 @@ function createEventMapperState(init) {
|
|
|
5870
5876
|
currentMessageId: void 0,
|
|
5871
5877
|
currentText: "",
|
|
5872
5878
|
reasoningTextByContentIndex: /* @__PURE__ */ new Map(),
|
|
5879
|
+
claimedReasoningIndexes: /* @__PURE__ */ new Set(),
|
|
5880
|
+
reasoningEpisodeSeq: 0,
|
|
5881
|
+
activeReasoningByRuntimeIndex: /* @__PURE__ */ new Map(),
|
|
5882
|
+
reasoningFleetIndexByRuntime: /* @__PURE__ */ new Map(),
|
|
5873
5883
|
currentAssistantMessage: void 0,
|
|
5874
5884
|
currentAssistantImages: [],
|
|
5875
5885
|
currentAssistantErrors: [],
|
|
@@ -5912,6 +5922,10 @@ function resetRun(state) {
|
|
|
5912
5922
|
state.currentMessageId = void 0;
|
|
5913
5923
|
state.currentText = "";
|
|
5914
5924
|
state.reasoningTextByContentIndex.clear();
|
|
5925
|
+
state.claimedReasoningIndexes.clear();
|
|
5926
|
+
state.reasoningEpisodeSeq = 0;
|
|
5927
|
+
state.activeReasoningByRuntimeIndex.clear();
|
|
5928
|
+
state.reasoningFleetIndexByRuntime.clear();
|
|
5915
5929
|
state.currentAssistantMessage = void 0;
|
|
5916
5930
|
state.currentAssistantImages = [];
|
|
5917
5931
|
state.currentAssistantErrors = [];
|
|
@@ -6258,6 +6272,14 @@ function rememberAssistantMessage(state, message) {
|
|
|
6258
6272
|
state.currentAssistantMessage = message;
|
|
6259
6273
|
if (!state.currentMessageId) state.currentMessageId = `${state.runId}-a${state.messageSeq++}`;
|
|
6260
6274
|
const chatMessage = toChatMessageFromAssistant(message, state.currentMessageId);
|
|
6275
|
+
for (const part of chatMessage.parts) {
|
|
6276
|
+
if (part.type !== "reasoning") continue;
|
|
6277
|
+
const fleetIndex = state.reasoningFleetIndexByRuntime.get(part.contentIndex) ?? part.contentIndex;
|
|
6278
|
+
part.contentIndex = fleetIndex;
|
|
6279
|
+
const streamed = state.reasoningTextByContentIndex.get(fleetIndex);
|
|
6280
|
+
if (streamed !== void 0) part.text = streamed;
|
|
6281
|
+
part.state = "complete";
|
|
6282
|
+
}
|
|
6261
6283
|
for (const [contentIndex, text] of state.reasoningTextByContentIndex) {
|
|
6262
6284
|
const existing = chatMessage.parts.find((part) => part.type === "reasoning" && part.contentIndex === contentIndex);
|
|
6263
6285
|
if (existing?.type === "reasoning") {
|
|
@@ -6271,7 +6293,13 @@ function rememberAssistantMessage(state, message) {
|
|
|
6271
6293
|
});
|
|
6272
6294
|
}
|
|
6273
6295
|
appendFinalAssistantText(state, textFromAssistantMessage(message));
|
|
6274
|
-
for (const part of chatMessage.parts)
|
|
6296
|
+
for (const part of chatMessage.parts) {
|
|
6297
|
+
if (!isChatToolPart(part)) continue;
|
|
6298
|
+
upsertCurrentToolPart(state, state.currentToolParts.find((existing) => existing.toolCallId === part.toolCallId)?.state === "output-error" ? {
|
|
6299
|
+
...part,
|
|
6300
|
+
state: "output-error"
|
|
6301
|
+
} : part);
|
|
6302
|
+
}
|
|
6275
6303
|
state.currentAssistantImages = chatMessage.parts.filter((part) => part.type === "image");
|
|
6276
6304
|
state.currentAssistantErrors = chatMessage.parts.filter((part) => part.type === "error");
|
|
6277
6305
|
return chatMessage;
|
|
@@ -6391,6 +6419,7 @@ function mapCoreAgentEvent(state, event) {
|
|
|
6391
6419
|
}
|
|
6392
6420
|
return [];
|
|
6393
6421
|
case "tool_execution_start": {
|
|
6422
|
+
const closed = closeActiveReasoningEpisodes(state);
|
|
6394
6423
|
const startToolName = typeof event.toolName === "string" ? event.toolName : void 0;
|
|
6395
6424
|
if (startToolName) state.toolCallStarts.set(event.toolCallId, {
|
|
6396
6425
|
toolName: startToolName,
|
|
@@ -6403,11 +6432,15 @@ function mapCoreAgentEvent(state, event) {
|
|
|
6403
6432
|
state: "input-streaming",
|
|
6404
6433
|
input: event.args
|
|
6405
6434
|
});
|
|
6406
|
-
return [
|
|
6407
|
-
|
|
6408
|
-
|
|
6409
|
-
|
|
6410
|
-
|
|
6435
|
+
return [
|
|
6436
|
+
...closed,
|
|
6437
|
+
reasoningFrame(state, "executing", true),
|
|
6438
|
+
{
|
|
6439
|
+
type: "tool",
|
|
6440
|
+
part,
|
|
6441
|
+
messageId: state.currentMessageId
|
|
6442
|
+
}
|
|
6443
|
+
];
|
|
6411
6444
|
}
|
|
6412
6445
|
case "tool_execution_update": {
|
|
6413
6446
|
const frame = event;
|
|
@@ -6434,7 +6467,8 @@ function mapCoreAgentEvent(state, event) {
|
|
|
6434
6467
|
const cachedInput = state.toolCallStarts.get(event.toolCallId)?.args;
|
|
6435
6468
|
state.toolCallStarts.delete(event.toolCallId);
|
|
6436
6469
|
state.toolNamesByCallId.delete(event.toolCallId);
|
|
6437
|
-
const
|
|
6470
|
+
const isError = isToolResultError(event.isError, event.result);
|
|
6471
|
+
const errorText = isError ? extractToolErrorText(event.result) : void 0;
|
|
6438
6472
|
const errorEnvelope = errorText ? createFleetErrorEnvelope(errorText) : void 0;
|
|
6439
6473
|
const durationMs = typeof event.result?.durationMs === "number" ? event.result.durationMs : typeof event.result?.details?.durationMs === "number" ? event.result.details.durationMs : void 0;
|
|
6440
6474
|
const backgroundOutput = extractToolBackgroundOutput(event.result);
|
|
@@ -6443,7 +6477,7 @@ function mapCoreAgentEvent(state, event) {
|
|
|
6443
6477
|
part: upsertCurrentToolPart(state, {
|
|
6444
6478
|
...identity,
|
|
6445
6479
|
toolCallId: event.toolCallId,
|
|
6446
|
-
state:
|
|
6480
|
+
state: isError ? "output-error" : "output-available",
|
|
6447
6481
|
...cachedInput !== void 0 ? { input: cachedInput } : {},
|
|
6448
6482
|
output: event.result,
|
|
6449
6483
|
result: event.result,
|
|
@@ -6465,59 +6499,128 @@ function reasoningContentIndex(state, event) {
|
|
|
6465
6499
|
if (partial && Array.isArray(partial.content)) {
|
|
6466
6500
|
for (let index2 = partial.content.length - 1; index2 >= 0; index2--) if (partial.content[index2]?.type === "thinking") return index2;
|
|
6467
6501
|
}
|
|
6468
|
-
return [...state.
|
|
6502
|
+
return [...state.activeReasoningByRuntimeIndex.keys()].at(-1) ?? 0;
|
|
6503
|
+
}
|
|
6504
|
+
function beginReasoningEpisode(state, runtimeIndex) {
|
|
6505
|
+
let fleetIndex = runtimeIndex;
|
|
6506
|
+
if (state.claimedReasoningIndexes.has(fleetIndex)) {
|
|
6507
|
+
fleetIndex = Math.max(state.reasoningEpisodeSeq, runtimeIndex + 1);
|
|
6508
|
+
while (state.claimedReasoningIndexes.has(fleetIndex)) fleetIndex++;
|
|
6509
|
+
}
|
|
6510
|
+
state.claimedReasoningIndexes.add(fleetIndex);
|
|
6511
|
+
state.reasoningEpisodeSeq = Math.max(state.reasoningEpisodeSeq, fleetIndex + 1);
|
|
6512
|
+
state.activeReasoningByRuntimeIndex.set(runtimeIndex, fleetIndex);
|
|
6513
|
+
state.reasoningFleetIndexByRuntime.set(runtimeIndex, fleetIndex);
|
|
6514
|
+
return fleetIndex;
|
|
6515
|
+
}
|
|
6516
|
+
function resolveActiveReasoningEpisode(state, runtimeIndex) {
|
|
6517
|
+
const active = state.activeReasoningByRuntimeIndex.get(runtimeIndex);
|
|
6518
|
+
if (active !== void 0) return active;
|
|
6519
|
+
return beginReasoningEpisode(state, runtimeIndex);
|
|
6520
|
+
}
|
|
6521
|
+
function closeActiveReasoningEpisodes(state) {
|
|
6522
|
+
if (state.activeReasoningByRuntimeIndex.size === 0) return [];
|
|
6523
|
+
if (!state.currentMessageId) state.currentMessageId = `${state.runId}-a${state.messageSeq++}`;
|
|
6524
|
+
const frames = [];
|
|
6525
|
+
for (const [runtimeIndex, contentIndex] of [...state.activeReasoningByRuntimeIndex]) {
|
|
6526
|
+
frames.push({
|
|
6527
|
+
type: "reasoning_text",
|
|
6528
|
+
phase: "end",
|
|
6529
|
+
contentIndex,
|
|
6530
|
+
text: state.reasoningTextByContentIndex.get(contentIndex) ?? "",
|
|
6531
|
+
messageId: state.currentMessageId
|
|
6532
|
+
});
|
|
6533
|
+
state.activeReasoningByRuntimeIndex.delete(runtimeIndex);
|
|
6534
|
+
}
|
|
6535
|
+
return frames;
|
|
6469
6536
|
}
|
|
6470
6537
|
function mapAssistantStreamEvent(state, event) {
|
|
6471
6538
|
switch (event.type) {
|
|
6472
6539
|
case "start":
|
|
6473
6540
|
if (!state.currentMessageId) state.currentMessageId = `${state.runId}-a${state.messageSeq++}`;
|
|
6474
6541
|
state.reasoningTextByContentIndex.clear();
|
|
6542
|
+
state.activeReasoningByRuntimeIndex.clear();
|
|
6543
|
+
state.reasoningFleetIndexByRuntime.clear();
|
|
6475
6544
|
return [];
|
|
6476
|
-
case "text_delta":
|
|
6545
|
+
case "text_delta": {
|
|
6546
|
+
const closed = closeActiveReasoningEpisodes(state);
|
|
6477
6547
|
if (!state.currentMessageId) state.currentMessageId = `${state.runId}-a${state.messageSeq++}`;
|
|
6478
6548
|
state.currentText += event.delta;
|
|
6479
|
-
return [
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6549
|
+
return [
|
|
6550
|
+
...closed,
|
|
6551
|
+
reasoningFrame(state, "responding", true),
|
|
6552
|
+
{
|
|
6553
|
+
type: "delta",
|
|
6554
|
+
text: event.delta,
|
|
6555
|
+
messageId: state.currentMessageId
|
|
6556
|
+
}
|
|
6557
|
+
];
|
|
6558
|
+
}
|
|
6484
6559
|
case "thinking_delta": {
|
|
6485
|
-
const
|
|
6560
|
+
const runtimeIndex = reasoningContentIndex(state, event);
|
|
6561
|
+
const hadActive = state.activeReasoningByRuntimeIndex.has(runtimeIndex);
|
|
6562
|
+
const contentIndex = resolveActiveReasoningEpisode(state, runtimeIndex);
|
|
6486
6563
|
if (!state.currentMessageId) state.currentMessageId = `${state.runId}-a${state.messageSeq++}`;
|
|
6487
6564
|
state.reasoningTextByContentIndex.set(contentIndex, (state.reasoningTextByContentIndex.get(contentIndex) ?? "") + event.delta);
|
|
6488
|
-
|
|
6565
|
+
const frames = [reasoningFrame(state, "planning", true)];
|
|
6566
|
+
if (!hadActive) frames.push({
|
|
6567
|
+
type: "reasoning_text",
|
|
6568
|
+
phase: "start",
|
|
6569
|
+
contentIndex,
|
|
6570
|
+
text: "",
|
|
6571
|
+
messageId: state.currentMessageId
|
|
6572
|
+
});
|
|
6573
|
+
frames.push({
|
|
6489
6574
|
type: "reasoning_text",
|
|
6490
6575
|
phase: "delta",
|
|
6491
6576
|
contentIndex,
|
|
6492
6577
|
text: event.delta,
|
|
6493
6578
|
messageId: state.currentMessageId
|
|
6494
|
-
}
|
|
6579
|
+
});
|
|
6580
|
+
return frames;
|
|
6495
6581
|
}
|
|
6496
6582
|
case "text_start":
|
|
6497
|
-
case "text_end":
|
|
6498
6583
|
case "toolcall_start":
|
|
6584
|
+
return closeActiveReasoningEpisodes(state);
|
|
6585
|
+
case "text_end":
|
|
6499
6586
|
case "toolcall_delta":
|
|
6500
6587
|
case "toolcall_end":
|
|
6501
6588
|
case "error":
|
|
6502
6589
|
return [];
|
|
6503
6590
|
case "thinking_start": {
|
|
6504
|
-
const
|
|
6591
|
+
const runtimeIndex = reasoningContentIndex(state, event);
|
|
6505
6592
|
if (!state.currentMessageId) state.currentMessageId = `${state.runId}-a${state.messageSeq++}`;
|
|
6593
|
+
const frames = [];
|
|
6594
|
+
const previous = state.activeReasoningByRuntimeIndex.get(runtimeIndex);
|
|
6595
|
+
if (previous !== void 0) {
|
|
6596
|
+
frames.push({
|
|
6597
|
+
type: "reasoning_text",
|
|
6598
|
+
phase: "end",
|
|
6599
|
+
contentIndex: previous,
|
|
6600
|
+
text: state.reasoningTextByContentIndex.get(previous) ?? "",
|
|
6601
|
+
messageId: state.currentMessageId
|
|
6602
|
+
});
|
|
6603
|
+
state.activeReasoningByRuntimeIndex.delete(runtimeIndex);
|
|
6604
|
+
}
|
|
6605
|
+
const contentIndex = beginReasoningEpisode(state, runtimeIndex);
|
|
6506
6606
|
state.reasoningTextByContentIndex.set(contentIndex, "");
|
|
6507
|
-
|
|
6607
|
+
frames.push(reasoningFrame(state, "planning", true), {
|
|
6508
6608
|
type: "reasoning_text",
|
|
6509
6609
|
phase: "start",
|
|
6510
6610
|
contentIndex,
|
|
6511
6611
|
text: "",
|
|
6512
6612
|
messageId: state.currentMessageId
|
|
6513
|
-
}
|
|
6613
|
+
});
|
|
6614
|
+
return frames;
|
|
6514
6615
|
}
|
|
6515
6616
|
case "thinking_end": {
|
|
6516
|
-
const
|
|
6617
|
+
const runtimeIndex = reasoningContentIndex(state, event);
|
|
6618
|
+
const contentIndex = resolveActiveReasoningEpisode(state, runtimeIndex);
|
|
6517
6619
|
const endedEvent = event;
|
|
6518
|
-
const block = endedEvent.partial?.content?.[
|
|
6620
|
+
const block = endedEvent.partial?.content?.[runtimeIndex];
|
|
6519
6621
|
const finalText = typeof endedEvent.content === "string" ? endedEvent.content : block?.type === "thinking" && typeof block.thinking === "string" ? block.thinking : void 0;
|
|
6520
6622
|
if (finalText !== void 0) state.reasoningTextByContentIndex.set(contentIndex, finalText);
|
|
6623
|
+
state.activeReasoningByRuntimeIndex.delete(runtimeIndex);
|
|
6521
6624
|
return [{
|
|
6522
6625
|
type: "reasoning_text",
|
|
6523
6626
|
phase: "end",
|
|
@@ -6772,10 +6875,30 @@ function finalizeAssistantMessage(state) {
|
|
|
6772
6875
|
text: state.currentText || value.text
|
|
6773
6876
|
});
|
|
6774
6877
|
} else if (value.type === "thinking") {
|
|
6775
|
-
|
|
6776
|
-
if (
|
|
6878
|
+
let fleetIndex = state.reasoningFleetIndexByRuntime.get(contentIndex);
|
|
6879
|
+
if (fleetIndex === void 0) {
|
|
6880
|
+
fleetIndex = contentIndex;
|
|
6881
|
+
if (state.claimedReasoningIndexes.has(fleetIndex)) {
|
|
6882
|
+
fleetIndex = Math.max(state.reasoningEpisodeSeq, contentIndex + 1);
|
|
6883
|
+
while (state.claimedReasoningIndexes.has(fleetIndex)) fleetIndex++;
|
|
6884
|
+
}
|
|
6885
|
+
state.claimedReasoningIndexes.add(fleetIndex);
|
|
6886
|
+
state.reasoningEpisodeSeq = Math.max(state.reasoningEpisodeSeq, fleetIndex + 1);
|
|
6887
|
+
state.reasoningFleetIndexByRuntime.set(contentIndex, fleetIndex);
|
|
6888
|
+
}
|
|
6889
|
+
for (const [pendingIndex, pendingText] of [...state.reasoningTextByContentIndex].sort(([left], [right]) => left - right)) {
|
|
6890
|
+
if (pendingIndex >= fleetIndex) break;
|
|
6891
|
+
if (!parts.some((part) => part.type === "reasoning" && part.contentIndex === pendingIndex)) parts.push({
|
|
6892
|
+
type: "reasoning",
|
|
6893
|
+
contentIndex: pendingIndex,
|
|
6894
|
+
text: pendingText,
|
|
6895
|
+
state: "complete"
|
|
6896
|
+
});
|
|
6897
|
+
}
|
|
6898
|
+
const text = state.reasoningTextByContentIndex.get(fleetIndex) ?? (typeof value.thinking === "string" ? value.thinking : void 0);
|
|
6899
|
+
if (typeof text === "string" && !parts.some((part) => part.type === "reasoning" && part.contentIndex === fleetIndex)) parts.push({
|
|
6777
6900
|
type: "reasoning",
|
|
6778
|
-
contentIndex,
|
|
6901
|
+
contentIndex: fleetIndex,
|
|
6779
6902
|
text,
|
|
6780
6903
|
state: "complete"
|
|
6781
6904
|
});
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
CodeBlockCopyButton,
|
|
17
17
|
CodeBlockHeader,
|
|
18
18
|
CodeBlockTitle
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-VFW2KPLD.js";
|
|
20
20
|
import {
|
|
21
21
|
Ban,
|
|
22
22
|
Braces,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
SquareTerminal,
|
|
31
31
|
Wrench,
|
|
32
32
|
cn
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-U26ZMWVI.js";
|
|
34
34
|
|
|
35
35
|
// web/app/dist/server/assets/tool-result-BcSxAK-P.js
|
|
36
36
|
import { useCallback, useEffect, useId, useLayoutEffect, useMemo, useRef, useState } from "react";
|