@sinm/kai 1.16.2 → 1.16.3
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/RELEASE_NOTES.md +25 -0
- package/dist-cli/kai-cli.js +15943 -8007
- package/dist-electron/main/plugin-host.js +8 -0
- package/dist-electron/renderer/assets/{ContextDraftStrip-CWXg4hmU.js → ContextDraftStrip-D9Q7rgd9.js} +3 -3
- package/dist-electron/renderer/assets/{desktop-overlay-reason-cfmtdoP4.js → desktop-overlay-reason-BgrDF4DO.js} +19 -5
- package/dist-electron/renderer/assets/{index-CObwhkO8.js → index-BJPUCrdN.js} +760 -650
- package/dist-electron/renderer/assets/{index-BBL4bwnW.js → index-DzZJWNOh.js} +2 -2
- package/dist-electron/renderer/assets/{index-PLhxSKC5.js → index-JieQdgYY.js} +3 -3
- package/dist-electron/renderer/assets/{index-DSggA-B_.css → index-KuVblOas.css} +195 -70
- package/dist-electron/renderer/assets/{localUrlCodec-Bg7FpeI8.js → localUrlCodec-BuWQTdsR.js} +8 -0
- package/dist-electron/renderer/assets/{office-preview-CyqocXBw.js → office-preview-BMWEQqup.js} +3 -3
- package/dist-electron/renderer/assets/{overlay-D8OF8lDc.js → overlay-KytgsaAW.js} +2 -2
- package/dist-electron/renderer/assets/{parser-qf1_X8VO.js → parser-DtygcKZW.js} +1 -1
- package/dist-electron/renderer/assets/{spreadsheet-kLECX3ut.js → spreadsheet-ByVa4YNq.js} +3 -3
- package/dist-electron/renderer/index.html +4 -4
- package/dist-electron/renderer/office-preview.html +2 -2
- package/dist-electron/renderer/overlay.html +3 -3
- package/package.json +11 -11
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid-render-gG8hfEWR.js","./preload-helper-DVzrZ_Op.js","./_commonjsHelpers-DWwsNxpa.js","./purify.es-CQMgT1WF.js","./transform-CHg3xPdk.js","./ContextDraftStrip-
|
|
2
|
-
import { p as resolveEventSpec, D as DELIVERABLE_TOOL_NAMES, I as IMAGE_DELIVERY_TOOL_NAMES, q as hasDeliveryAttachment, s as getTransportIfInitialized, v as createLogger, w as getHostContext, x as toFileUploadPayload, g as getTransport, y as normalizeSourceContexts, z as normalizeLegacyHostContext, A as getHostManifest, B as requestHostContext, R as React, C as setSendMessageHandler, E as getMimeType, T as TABLE_PREVIEW_EXTENSIONS, F as BINARY_PREVIEW_EXTENSIONS, G as TEXT_PREVIEW_EXTENSIONS, H as TEXT_PREVIEW_FILENAMES, J as toAvatarUploadPayload, r as reactExports, K as requireReact, L as getDefaults, M as keysFromSelector, N as getI18n, i as instance, O as isHttpUrl, Q as readableRpcError, S as requireReactDom, j as jsxRuntimeExports, U as resolveOwnerAvatarUrl, V as FILE_DELIVERY_TOOL_NAMES, W as onSettingsChanged, X as React$1, Y as DEFAULT_AGENT_ID, k as resolveLocalUrl, l as localHttpUrlToKaiUrl, t as toLocalPathSegment, Z as buildDownloadHttpUrl, m as buildDownloadUrl, _ as resolveAttachmentUrl, $ as buildLocalHttpUrl, a0 as isMessageBlockTooLargeError, a1 as MAX_SOURCE_CONTEXTS, a2 as describePluginPageIntentError, a3 as SESSION_MARK_KEYS, a4 as ATTACHMENT, a5 as isHostMode, a6 as isHostMessage, a7 as postToHost, a8 as subscribeHostContext, a9 as getErrorMessage, aa as normalizeDisabledTools, ab as DEFAULT_SEARCH_ENGINE_ID, ac as resolvePluginResourceUrl, d as describePluginPageOpenError, b as describePluginViewFailure, P as PluginViewHost, ad as pluginPageOpenErrorCode, e as describeDesktopOverlayReason, ae as getDesktopOverlayControl, af as getTransportError, ag as isEmbedMode, ah as structuredLogger, ai as initTransport, aj as ReactDOM } from "./desktop-overlay-reason-
|
|
3
|
-
import { n as canRenderMessageBlocks, o as estimateContentBudget, p as MAX_INLINE_STRUCTURE_DEPTH, q as MAX_INLINE_MESSAGE_BYTES, r as MAX_BLOCK_SUBTREE_BATCH_ITEMS, a as KAI_URL_SCHEME, i as isKaiLocalUrl, t as tryDecodeLocalPathSegment, k as kaiLocalUrlToPathSegment, s as extractPathFromFullLocalPathname, v as normalizeDirectLocalPathInput, f as decodeLocalPathSegment, w as kaiLocalUrlForAbsolutePath, x as buildAttachmentLocalUrl } from "./localUrlCodec-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./mermaid-render-gG8hfEWR.js","./preload-helper-DVzrZ_Op.js","./_commonjsHelpers-DWwsNxpa.js","./purify.es-CQMgT1WF.js","./transform-CHg3xPdk.js","./ContextDraftStrip-D9Q7rgd9.js","./desktop-overlay-reason-BgrDF4DO.js","./localUrlCodec-BuWQTdsR.js","./index-JieQdgYY.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import { p as resolveEventSpec, D as DELIVERABLE_TOOL_NAMES, I as IMAGE_DELIVERY_TOOL_NAMES, q as hasDeliveryAttachment, s as getTransportIfInitialized, v as createLogger, w as getHostContext, x as toFileUploadPayload, g as getTransport, y as normalizeSourceContexts, z as normalizeLegacyHostContext, A as getHostManifest, B as requestHostContext, R as React, C as setSendMessageHandler, E as getMimeType, T as TABLE_PREVIEW_EXTENSIONS, F as BINARY_PREVIEW_EXTENSIONS, G as TEXT_PREVIEW_EXTENSIONS, H as TEXT_PREVIEW_FILENAMES, J as toAvatarUploadPayload, r as reactExports, K as requireReact, L as getDefaults, M as keysFromSelector, N as getI18n, i as instance, O as isHttpUrl, Q as readableRpcError, S as requireReactDom, j as jsxRuntimeExports, U as resolveOwnerAvatarUrl, V as FILE_DELIVERY_TOOL_NAMES, W as onSettingsChanged, X as React$1, Y as DEFAULT_AGENT_ID, k as resolveLocalUrl, l as localHttpUrlToKaiUrl, t as toLocalPathSegment, Z as buildDownloadHttpUrl, m as buildDownloadUrl, _ as resolveAttachmentUrl, $ as buildLocalHttpUrl, a0 as isMessageBlockTooLargeError, a1 as MAX_SOURCE_CONTEXTS, a2 as describePluginPageIntentError, a3 as SESSION_MARK_KEYS, a4 as ATTACHMENT, a5 as isHostMode, a6 as isHostMessage, a7 as postToHost, a8 as subscribeHostContext, a9 as getErrorMessage, aa as normalizeDisabledTools, ab as DEFAULT_SEARCH_ENGINE_ID, ac as resolvePluginResourceUrl, d as describePluginPageOpenError, b as describePluginViewFailure, P as PluginViewHost, ad as pluginPageOpenErrorCode, e as describeDesktopOverlayReason, ae as getDesktopOverlayControl, af as getTransportError, ag as isEmbedMode, ah as structuredLogger, ai as initTransport, aj as ReactDOM } from "./desktop-overlay-reason-BgrDF4DO.js";
|
|
3
|
+
import { n as canRenderMessageBlocks, o as estimateContentBudget, p as MAX_INLINE_STRUCTURE_DEPTH, q as MAX_INLINE_MESSAGE_BYTES, r as MAX_BLOCK_SUBTREE_BATCH_ITEMS, a as KAI_URL_SCHEME, i as isKaiLocalUrl, t as tryDecodeLocalPathSegment, k as kaiLocalUrlToPathSegment, s as extractPathFromFullLocalPathname, v as normalizeDirectLocalPathInput, f as decodeLocalPathSegment, w as kaiLocalUrlForAbsolutePath, x as buildAttachmentLocalUrl } from "./localUrlCodec-BuWQTdsR.js";
|
|
4
4
|
import { _ as __vitePreload } from "./preload-helper-DVzrZ_Op.js";
|
|
5
5
|
import { g as getDefaultExportFromCjs } from "./_commonjsHelpers-DWwsNxpa.js";
|
|
6
6
|
const ACCENT_THEMES = [
|
|
@@ -1355,7 +1355,7 @@ function clearBodyCache() {
|
|
|
1355
1355
|
bodyCache.clear();
|
|
1356
1356
|
sessionAccounting.clear();
|
|
1357
1357
|
}
|
|
1358
|
-
const log$
|
|
1358
|
+
const log$1d = createLogger("messageStore");
|
|
1359
1359
|
async function handleHostSendMessage(data, getActiveSessionId2) {
|
|
1360
1360
|
const sessionId = getActiveSessionId2();
|
|
1361
1361
|
if (!sessionId) {
|
|
@@ -1373,7 +1373,7 @@ async function handleHostSendMessage(data, getActiveSessionId2) {
|
|
|
1373
1373
|
);
|
|
1374
1374
|
attachments.push(await getTransport().uploadAttachment(payload));
|
|
1375
1375
|
} catch (err) {
|
|
1376
|
-
log$
|
|
1376
|
+
log$1d.error("Failed to upload screenshot from host message:", err);
|
|
1377
1377
|
}
|
|
1378
1378
|
}
|
|
1379
1379
|
const elementArtifactRefs = data.elementContext ? await uploadLargeElementContextFields(data.elementContext, attachments) : void 0;
|
|
@@ -1637,7 +1637,7 @@ function applyBlockSubtreesToMessage(message2, items) {
|
|
|
1637
1637
|
transportRevision: appliedRevision
|
|
1638
1638
|
};
|
|
1639
1639
|
}
|
|
1640
|
-
const log$
|
|
1640
|
+
const log$1c = createLogger("blockMerge");
|
|
1641
1641
|
function applyBlockUpdate(blocks, block) {
|
|
1642
1642
|
const settledBlocks = settleStalePendingReasoningBlocks(blocks, block);
|
|
1643
1643
|
const pending2 = isBlockPending(block);
|
|
@@ -1700,7 +1700,7 @@ function applyRuntimeEventBlockUpdate(blocks, block, pending2) {
|
|
|
1700
1700
|
}
|
|
1701
1701
|
function applyNestedBlockUpdate(blocks, path2, block) {
|
|
1702
1702
|
if (block.type === "guidance") {
|
|
1703
|
-
log$
|
|
1703
|
+
log$1c.warn(
|
|
1704
1704
|
"[ProjectionGuard] ignoring nested guidance block; guidance is only valid at the top level"
|
|
1705
1705
|
);
|
|
1706
1706
|
return blocks;
|
|
@@ -2170,7 +2170,7 @@ function countBlocks(blocks) {
|
|
|
2170
2170
|
}
|
|
2171
2171
|
return count2;
|
|
2172
2172
|
}
|
|
2173
|
-
const log$
|
|
2173
|
+
const log$1b = createLogger("MessageProjection");
|
|
2174
2174
|
function getContextCompactionKey(sessionId, threadId) {
|
|
2175
2175
|
return `${sessionId}:${threadId}`;
|
|
2176
2176
|
}
|
|
@@ -2274,7 +2274,7 @@ function projectSingleEvent(event, messagesMap, state2) {
|
|
|
2274
2274
|
return projectDelegateCompleted(event);
|
|
2275
2275
|
default: {
|
|
2276
2276
|
const _exhaustive = event;
|
|
2277
|
-
log$
|
|
2277
|
+
log$1b.warn("Unhandled event:", _exhaustive);
|
|
2278
2278
|
return null;
|
|
2279
2279
|
}
|
|
2280
2280
|
}
|
|
@@ -2834,7 +2834,7 @@ function projectContextCompaction(event, state2) {
|
|
|
2834
2834
|
}
|
|
2835
2835
|
} else {
|
|
2836
2836
|
const _exhaustive = event.phase;
|
|
2837
|
-
log$
|
|
2837
|
+
log$1b.warn("Unhandled context.compaction phase:", _exhaustive);
|
|
2838
2838
|
}
|
|
2839
2839
|
return { contextCompactionMap: /* @__PURE__ */ new Map([[key, next]]) };
|
|
2840
2840
|
}
|
|
@@ -2986,7 +2986,7 @@ function warnAnonymousPendingTextLikeBlock(event) {
|
|
|
2986
2986
|
if (block.id) return;
|
|
2987
2987
|
if (!block.isPending) return;
|
|
2988
2988
|
if (block.type !== "text" && block.type !== "reasoning") return;
|
|
2989
|
-
log$
|
|
2989
|
+
log$1b.warn(
|
|
2990
2990
|
`[AnonymousPendingBlock] sessionId=${event.sessionId}, messageId=${event.messageId}, type=${block.type}`
|
|
2991
2991
|
);
|
|
2992
2992
|
}
|
|
@@ -4084,7 +4084,7 @@ function setArrayMapValueIfChanged(map2, key, value2) {
|
|
|
4084
4084
|
}
|
|
4085
4085
|
return new Map(map2).set(key, value2);
|
|
4086
4086
|
}
|
|
4087
|
-
const log$
|
|
4087
|
+
const log$1a = createLogger("messageStore");
|
|
4088
4088
|
function oldestPageMessage(pageMessages) {
|
|
4089
4089
|
let oldest;
|
|
4090
4090
|
for (const message2 of pageMessages) {
|
|
@@ -4147,7 +4147,7 @@ const createPageSlice = (deps) => (set, get) => ({
|
|
|
4147
4147
|
});
|
|
4148
4148
|
const timeoutId = setTimeout(() => {
|
|
4149
4149
|
if (!isCurrentMessageLoadGeneration(sessionId, generation)) return;
|
|
4150
|
-
log$
|
|
4150
|
+
log$1a.warn("message load timed out; releasing loading lock", {
|
|
4151
4151
|
sessionId,
|
|
4152
4152
|
timeoutMs: MESSAGE_LOAD_TIMEOUT_MS
|
|
4153
4153
|
});
|
|
@@ -4227,7 +4227,7 @@ const createPageSlice = (deps) => (set, get) => ({
|
|
|
4227
4227
|
pageMessages.map((message2) => message2.id)
|
|
4228
4228
|
);
|
|
4229
4229
|
} catch (error2) {
|
|
4230
|
-
log$
|
|
4230
|
+
log$1a.error("Failed to load messages:", error2);
|
|
4231
4231
|
set((state2) => ({
|
|
4232
4232
|
loadingMap: setMapValueIfChanged(state2.loadingMap, sessionId, false),
|
|
4233
4233
|
messageLoadStateMap: setMapValueIfChanged(state2.messageLoadStateMap, sessionId, "failed")
|
|
@@ -4271,7 +4271,7 @@ const createPageSlice = (deps) => (set, get) => ({
|
|
|
4271
4271
|
const misplaced = countWindowDiscontinuity(currentMsgMap, pageMessages);
|
|
4272
4272
|
if (misplaced > 0) {
|
|
4273
4273
|
noteWindowDiscontinuity();
|
|
4274
|
-
log$
|
|
4274
|
+
log$1a.warn("message window discontinuity: page is not older than the window head", {
|
|
4275
4275
|
sessionId,
|
|
4276
4276
|
misplaced,
|
|
4277
4277
|
pageSize: pageMessages.length,
|
|
@@ -4332,10 +4332,10 @@ const createPageSlice = (deps) => (set, get) => ({
|
|
|
4332
4332
|
};
|
|
4333
4333
|
});
|
|
4334
4334
|
if (trimTrace && shouldTraceWindowTrim(sessionId)) {
|
|
4335
|
-
log$
|
|
4335
|
+
log$1a.info("message window trimmed", { sessionId, ...trimTrace });
|
|
4336
4336
|
}
|
|
4337
4337
|
if (trimTrace?.overBudget) {
|
|
4338
|
-
log$
|
|
4338
|
+
log$1a.warn("message window over budget: pinned page alone exceeds the bound", {
|
|
4339
4339
|
sessionId,
|
|
4340
4340
|
keptMessages: trimTrace.keptMessages
|
|
4341
4341
|
});
|
|
@@ -4343,7 +4343,7 @@ const createPageSlice = (deps) => (set, get) => ({
|
|
|
4343
4343
|
deps.syncBodyCacheWindow(sessionId);
|
|
4344
4344
|
return result2.hasMore ? "loaded" : "exhausted";
|
|
4345
4345
|
} catch (error2) {
|
|
4346
|
-
log$
|
|
4346
|
+
log$1a.error("Failed to load more messages:", error2);
|
|
4347
4347
|
set((state2) => ({
|
|
4348
4348
|
loadingMoreMap: new Map(state2.loadingMoreMap).set(sessionId, false)
|
|
4349
4349
|
}));
|
|
@@ -4351,7 +4351,7 @@ const createPageSlice = (deps) => (set, get) => ({
|
|
|
4351
4351
|
}
|
|
4352
4352
|
}
|
|
4353
4353
|
});
|
|
4354
|
-
const log$
|
|
4354
|
+
const log$19 = createLogger("messageStore");
|
|
4355
4355
|
let binding = null;
|
|
4356
4356
|
function connectWindowBound(next) {
|
|
4357
4357
|
binding = next;
|
|
@@ -4402,7 +4402,7 @@ function requestWindowBound(sessionId, options = {}) {
|
|
|
4402
4402
|
if (outcome.overBudget) {
|
|
4403
4403
|
noteWindowBoundPinned(sessionId, window2.size);
|
|
4404
4404
|
if (shouldTraceWindowTrim(sessionId)) {
|
|
4405
|
-
log$
|
|
4405
|
+
log$19.warn("message window over budget: the anchor alone exceeds the bound", {
|
|
4406
4406
|
sessionId,
|
|
4407
4407
|
source: options.source ?? "event",
|
|
4408
4408
|
keptMessages: outcome.keptMessages
|
|
@@ -4428,7 +4428,7 @@ function requestWindowBound(sessionId, options = {}) {
|
|
|
4428
4428
|
clearWindowBoundPinned(sessionId);
|
|
4429
4429
|
deps.syncBodyCacheWindow(sessionId);
|
|
4430
4430
|
if (shouldTraceWindowTrim(sessionId)) {
|
|
4431
|
-
log$
|
|
4431
|
+
log$19.info("message window trimmed", {
|
|
4432
4432
|
sessionId,
|
|
4433
4433
|
source: options.source ?? "event",
|
|
4434
4434
|
...applied
|
|
@@ -4436,7 +4436,7 @@ function requestWindowBound(sessionId, options = {}) {
|
|
|
4436
4436
|
}
|
|
4437
4437
|
return applied;
|
|
4438
4438
|
}
|
|
4439
|
-
const log$
|
|
4439
|
+
const log$18 = createLogger("messageStore");
|
|
4440
4440
|
let connectedStore = null;
|
|
4441
4441
|
function connectMessageStore(api) {
|
|
4442
4442
|
connectedStore = api;
|
|
@@ -4562,7 +4562,7 @@ async function fetchAndApplyMessage(sessionId, messageId, key) {
|
|
|
4562
4562
|
settleBatch();
|
|
4563
4563
|
}
|
|
4564
4564
|
} catch (error2) {
|
|
4565
|
-
log$
|
|
4565
|
+
log$18.error("Failed to fetch message:", error2);
|
|
4566
4566
|
if (takenBatch) {
|
|
4567
4567
|
const pending2 = pendingFetchBlocks.get(key) ?? [];
|
|
4568
4568
|
pendingFetchBlocks.set(key, [...takenBatch, ...pending2]);
|
|
@@ -4572,7 +4572,7 @@ async function fetchAndApplyMessage(sessionId, messageId, key) {
|
|
|
4572
4572
|
if (failures >= MAX_MESSAGE_FETCH_ATTEMPTS) {
|
|
4573
4573
|
retriesExhausted = true;
|
|
4574
4574
|
messageFetchFailureCounts.delete(key);
|
|
4575
|
-
void store().getState().resyncRequired(sessionId, messageId).catch((resyncError) => log$
|
|
4575
|
+
void store().getState().resyncRequired(sessionId, messageId).catch((resyncError) => log$18.error("Failed to resync after fetch failure:", resyncError));
|
|
4576
4576
|
}
|
|
4577
4577
|
}
|
|
4578
4578
|
} finally {
|
|
@@ -4592,7 +4592,7 @@ function fetchMessageForReconcile(messageId) {
|
|
|
4592
4592
|
const existing = inFlightReconcileFetches.get(messageId);
|
|
4593
4593
|
if (existing) return existing;
|
|
4594
4594
|
const pending2 = getTransport().getMessage(messageId).catch((error2) => {
|
|
4595
|
-
log$
|
|
4595
|
+
log$18.error("Failed to re-read message for tool result reconcile:", error2);
|
|
4596
4596
|
return null;
|
|
4597
4597
|
}).finally(() => {
|
|
4598
4598
|
if (inFlightReconcileFetches.get(messageId) === pending2) {
|
|
@@ -4614,7 +4614,7 @@ async function hydrateFinalMessage(sessionId, messageId, runId, status2, key) {
|
|
|
4614
4614
|
applyFinalFetchedMessage(sessionId, message2, runId, status2);
|
|
4615
4615
|
await hydrateFinalMessageBody(sessionId, messageId);
|
|
4616
4616
|
} catch (error2) {
|
|
4617
|
-
log$
|
|
4617
|
+
log$18.error("Failed to hydrate final message:", error2);
|
|
4618
4618
|
} finally {
|
|
4619
4619
|
inFlightFinalMessageFetches.delete(key);
|
|
4620
4620
|
}
|
|
@@ -4671,9 +4671,9 @@ function requestBlockSnapshotThrottled(request) {
|
|
|
4671
4671
|
blockSnapshotRequestAt.clear();
|
|
4672
4672
|
}
|
|
4673
4673
|
blockSnapshotRequestAt.set(key, now);
|
|
4674
|
-
void getTransport().requestBlockSnapshot(request.sessionId, request.messageId, request.blockId).catch((error2) => log$
|
|
4674
|
+
void getTransport().requestBlockSnapshot(request.sessionId, request.messageId, request.blockId).catch((error2) => log$18.error("Failed to request block snapshot:", error2));
|
|
4675
4675
|
}
|
|
4676
|
-
const log$
|
|
4676
|
+
const log$17 = createLogger("messageStore");
|
|
4677
4677
|
function oldestMessage(window2) {
|
|
4678
4678
|
let oldest;
|
|
4679
4679
|
for (const message2 of window2.values()) {
|
|
@@ -4851,7 +4851,7 @@ const createHydrationSlice = (deps) => (set, get) => ({
|
|
|
4851
4851
|
}
|
|
4852
4852
|
}
|
|
4853
4853
|
const failure = lastError instanceof Error ? lastError : new Error("message_blocks_load_failed");
|
|
4854
|
-
log$
|
|
4854
|
+
log$17.error(
|
|
4855
4855
|
`loadMessageBlocks failed: session=${sessionId} message=${messageId} revision=${lastAttemptRevision ?? "undefined"} attempts=${MAX_MESSAGE_BLOCK_LOAD_ATTEMPTS} error=${failure.name}: ${failure.message}`
|
|
4856
4856
|
);
|
|
4857
4857
|
throw failure;
|
|
@@ -4937,7 +4937,7 @@ const createHydrationSlice = (deps) => (set, get) => ({
|
|
|
4937
4937
|
} catch (error2) {
|
|
4938
4938
|
if (getSessionEpoch(sessionId) !== epoch) return;
|
|
4939
4939
|
if (error2 instanceof DOMException && error2.name === "AbortError") return;
|
|
4940
|
-
log$
|
|
4940
|
+
log$17.warn("message block prefetch failed", {
|
|
4941
4941
|
sessionId,
|
|
4942
4942
|
targetCount: targetIds.length,
|
|
4943
4943
|
error: error2
|
|
@@ -5720,7 +5720,7 @@ function mergeMap(dst, src) {
|
|
|
5720
5720
|
src.forEach((v2, k2) => result2.set(k2, v2));
|
|
5721
5721
|
return result2;
|
|
5722
5722
|
}
|
|
5723
|
-
const log$
|
|
5723
|
+
const log$16 = createLogger("messageStore");
|
|
5724
5724
|
function noteWireProgress(event, result2) {
|
|
5725
5725
|
const sessionId = event.sessionId;
|
|
5726
5726
|
if (result2.snapshotReset) {
|
|
@@ -5891,7 +5891,7 @@ function commitEventFrame(event, bufferResult, snapshotBodyPrefetch, set, get, d
|
|
|
5891
5891
|
void get().resyncRequired(evt.sessionId, evt.messageId, {
|
|
5892
5892
|
origin: "gap",
|
|
5893
5893
|
unrecoverable: evt.reason === "gap-unrepaired"
|
|
5894
|
-
}).catch((error2) => log$
|
|
5894
|
+
}).catch((error2) => log$16.error("Failed to resync Session read model:", error2));
|
|
5895
5895
|
}
|
|
5896
5896
|
if (evt.type === "snapshot" || evt.type === "snapshot.v2") {
|
|
5897
5897
|
const pageMessages = evt.type === "snapshot" ? evt.messages : evt.snapshot.messagePage.messages;
|
|
@@ -5987,7 +5987,7 @@ function replaceToolCallBlock(blocks, toolCall) {
|
|
|
5987
5987
|
});
|
|
5988
5988
|
return changed ? next : blocks;
|
|
5989
5989
|
}
|
|
5990
|
-
const log$
|
|
5990
|
+
const log$15 = createLogger("messageStore");
|
|
5991
5991
|
const MAX_RESYNC_ATTEMPTS = 2;
|
|
5992
5992
|
const createRepairSlice = (deps) => (set, get) => ({
|
|
5993
5993
|
resyncRequired: async (sessionId, messageId, options) => {
|
|
@@ -6005,7 +6005,7 @@ const createRepairSlice = (deps) => (set, get) => ({
|
|
|
6005
6005
|
if (throttleApplies) {
|
|
6006
6006
|
const decision = resyncThrottle.allow({ sessionId, messageId, scope: scope2 });
|
|
6007
6007
|
if (!decision.allowed) {
|
|
6008
|
-
log$
|
|
6008
|
+
log$15.debug("resync throttled", { sessionId, messageId, scope: scope2, reason: decision.reason });
|
|
6009
6009
|
return;
|
|
6010
6010
|
}
|
|
6011
6011
|
}
|
|
@@ -6050,7 +6050,7 @@ const createRepairSlice = (deps) => (set, get) => ({
|
|
|
6050
6050
|
(result2) => result2.status === "fulfilled" ? assembleMessagesFromPage(result2.value) : []
|
|
6051
6051
|
);
|
|
6052
6052
|
if (rejections.length > 0) {
|
|
6053
|
-
log$
|
|
6053
|
+
log$15.warn("resync viewport partial failure", {
|
|
6054
6054
|
sessionId,
|
|
6055
6055
|
failed: rejections.length,
|
|
6056
6056
|
requested: viewportIds.length,
|
|
@@ -6223,7 +6223,7 @@ function isLocalOnlySlashCommand(content2, options) {
|
|
|
6223
6223
|
const name2 = SLASH_COMMAND_NAME_RE.exec(content2.trim())?.[1];
|
|
6224
6224
|
return name2 != null && LOCAL_ONLY_COMMANDS.includes(name2);
|
|
6225
6225
|
}
|
|
6226
|
-
const log$
|
|
6226
|
+
const log$14 = createLogger("messageStore");
|
|
6227
6227
|
const USER_MESSAGE_HOOK_BLOCKED_PREFIX = "发送被 Hooks 阻止";
|
|
6228
6228
|
class UserMessageSendError extends Error {
|
|
6229
6229
|
messageRetained;
|
|
@@ -6299,7 +6299,7 @@ const createSendSlice = (deps) => (set, get) => ({
|
|
|
6299
6299
|
};
|
|
6300
6300
|
});
|
|
6301
6301
|
if (overFlowTrim) {
|
|
6302
|
-
log$
|
|
6302
|
+
log$14.warn("send-time window trim: another write path already broke the window bound", {
|
|
6303
6303
|
sessionId,
|
|
6304
6304
|
...overFlowTrim
|
|
6305
6305
|
});
|
|
@@ -6397,7 +6397,7 @@ const createSendSlice = (deps) => (set, get) => ({
|
|
|
6397
6397
|
});
|
|
6398
6398
|
} catch (error2) {
|
|
6399
6399
|
const errMsg = error2 instanceof Error ? error2.message : String(error2);
|
|
6400
|
-
log$
|
|
6400
|
+
log$14.error("Failed to send message:", error2);
|
|
6401
6401
|
set((state2) => {
|
|
6402
6402
|
if (!localMsgId) return {};
|
|
6403
6403
|
const pending2 = state2.pendingUserMsgMap.get(sessionId)?.get(localMsgId);
|
|
@@ -7426,7 +7426,7 @@ function isSameExecutionDetailSelection(left2, right2) {
|
|
|
7426
7426
|
if (!left2 || !right2) return false;
|
|
7427
7427
|
return left2.sessionId === right2.sessionId && left2.ownerMessageId === right2.ownerMessageId && left2.blockId === right2.blockId;
|
|
7428
7428
|
}
|
|
7429
|
-
const log$
|
|
7429
|
+
const log$13 = createLogger("agentStore");
|
|
7430
7430
|
let resourceChangedUnsubscribe$1 = null;
|
|
7431
7431
|
const configInflight = /* @__PURE__ */ new Map();
|
|
7432
7432
|
function ensureResourceChangedSubscription(set, reload) {
|
|
@@ -7463,7 +7463,7 @@ const useAgentStore = create$1((set, get) => ({
|
|
|
7463
7463
|
const agents = await getTransport().listAgents();
|
|
7464
7464
|
set({ agents });
|
|
7465
7465
|
} catch (error2) {
|
|
7466
|
-
log$
|
|
7466
|
+
log$13.error("loadAgents failed", error2);
|
|
7467
7467
|
throw error2;
|
|
7468
7468
|
} finally {
|
|
7469
7469
|
set({ loading: false });
|
|
@@ -7598,14 +7598,14 @@ function pinnedTabsSnapshotFromPayload(payload) {
|
|
|
7598
7598
|
tabs: pinnedTabsFromSettings(payload)
|
|
7599
7599
|
};
|
|
7600
7600
|
}
|
|
7601
|
-
const log$
|
|
7601
|
+
const log$12 = createLogger("pinnedTabsIpc");
|
|
7602
7602
|
async function loadPinnedTabsFromMain() {
|
|
7603
7603
|
try {
|
|
7604
7604
|
const t = getTransport();
|
|
7605
7605
|
if (typeof t?.getPinnedTabSessionIds !== "function") return { revision: 0, tabs: /* @__PURE__ */ new Map() };
|
|
7606
7606
|
return pinnedTabsSnapshotFromPayload(await t.getPinnedTabSessionIds());
|
|
7607
7607
|
} catch (error2) {
|
|
7608
|
-
log$
|
|
7608
|
+
log$12.warn("读取固定标签失败,本次按空表显示", error2);
|
|
7609
7609
|
return { revision: 0, tabs: /* @__PURE__ */ new Map() };
|
|
7610
7610
|
}
|
|
7611
7611
|
}
|
|
@@ -8018,13 +8018,13 @@ const useTranslation = (ns, props = {}) => {
|
|
|
8018
8018
|
}
|
|
8019
8019
|
return ret;
|
|
8020
8020
|
};
|
|
8021
|
-
const log
|
|
8021
|
+
const log$11 = createLogger("sessionStore");
|
|
8022
8022
|
let resourceChangedUnsubscribe = null;
|
|
8023
8023
|
let pinnedTabsLoadPromise = null;
|
|
8024
8024
|
const ensureGroupSessionInflight = /* @__PURE__ */ new Map();
|
|
8025
8025
|
const ensureDirectSessionInflight = /* @__PURE__ */ new Map();
|
|
8026
8026
|
function reportPinnedTabsWriteFailure(action2, error2) {
|
|
8027
|
-
log
|
|
8027
|
+
log$11.error("固定标签写入失败", { action: action2, error: error2 });
|
|
8028
8028
|
toast$3.show(instance.t("session.tabs.persistFailed"), {
|
|
8029
8029
|
type: "error",
|
|
8030
8030
|
testId: "session-tabs-persist-failed"
|
|
@@ -8347,7 +8347,7 @@ const useSessionStore = create$1((set, get) => ({
|
|
|
8347
8347
|
void get().loadConversations();
|
|
8348
8348
|
}
|
|
8349
8349
|
if (event.resource === "group") {
|
|
8350
|
-
void get().loadOwnerDirectory().catch((error2) => log
|
|
8350
|
+
void get().loadOwnerDirectory().catch((error2) => log$11.error("群变更后刷新群目录失败:", error2));
|
|
8351
8351
|
}
|
|
8352
8352
|
});
|
|
8353
8353
|
}
|
|
@@ -8429,7 +8429,7 @@ const useSessionStore = create$1((set, get) => ({
|
|
|
8429
8429
|
}
|
|
8430
8430
|
}
|
|
8431
8431
|
} catch (error2) {
|
|
8432
|
-
log
|
|
8432
|
+
log$11.error("loadConversations failed", error2);
|
|
8433
8433
|
throw error2;
|
|
8434
8434
|
} finally {
|
|
8435
8435
|
if (get().conversationLoadGeneration === generation) set({ loading: false });
|
|
@@ -8507,7 +8507,7 @@ const useSessionStore = create$1((set, get) => ({
|
|
|
8507
8507
|
await get().loadGroupSessions(groupId);
|
|
8508
8508
|
return session.id;
|
|
8509
8509
|
} catch (error2) {
|
|
8510
|
-
log
|
|
8510
|
+
log$11.error("Failed to ensure an openable group session:", error2);
|
|
8511
8511
|
return null;
|
|
8512
8512
|
} finally {
|
|
8513
8513
|
ensureGroupSessionInflight.delete(groupId);
|
|
@@ -8525,7 +8525,7 @@ const useSessionStore = create$1((set, get) => ({
|
|
|
8525
8525
|
await get().loadDirectSessions(agentId);
|
|
8526
8526
|
return session.id;
|
|
8527
8527
|
} catch (error2) {
|
|
8528
|
-
log
|
|
8528
|
+
log$11.error("Failed to ensure an openable direct session:", error2);
|
|
8529
8529
|
return null;
|
|
8530
8530
|
} finally {
|
|
8531
8531
|
ensureDirectSessionInflight.delete(agentId);
|
|
@@ -8667,7 +8667,7 @@ const useSessionStore = create$1((set, get) => ({
|
|
|
8667
8667
|
try {
|
|
8668
8668
|
await getTransport().archiveSession(sessionId);
|
|
8669
8669
|
} catch (error2) {
|
|
8670
|
-
log
|
|
8670
|
+
log$11.error("归档群会话失败", { sessionId, groupId, error: error2 });
|
|
8671
8671
|
if (previousStatus) {
|
|
8672
8672
|
set((state22) => patchSessionStatusLocally(state22, owner, sessionId, previousStatus));
|
|
8673
8673
|
}
|
|
@@ -8692,7 +8692,7 @@ const useSessionStore = create$1((set, get) => ({
|
|
|
8692
8692
|
try {
|
|
8693
8693
|
await getTransport().archiveDirectSession(sessionId);
|
|
8694
8694
|
} catch (error2) {
|
|
8695
|
-
log
|
|
8695
|
+
log$11.error("归档直聊会话失败", { sessionId, agentId, error: error2 });
|
|
8696
8696
|
if (previousStatus) {
|
|
8697
8697
|
set((state2) => patchSessionStatusLocally(state2, owner, sessionId, previousStatus));
|
|
8698
8698
|
}
|
|
@@ -8793,7 +8793,7 @@ const useSessionStore = create$1((set, get) => ({
|
|
|
8793
8793
|
(sessions2) => sessions2.some((session) => session.id === sessionId)
|
|
8794
8794
|
);
|
|
8795
8795
|
if (!isGroupSession && !isDirectSession) {
|
|
8796
|
-
log
|
|
8796
|
+
log$11.warn("setSessionMark: session not loaded locally, skipped:", sessionId);
|
|
8797
8797
|
return;
|
|
8798
8798
|
}
|
|
8799
8799
|
if (isGroupSession) {
|
|
@@ -8847,7 +8847,7 @@ const useSessionStore = create$1((set, get) => ({
|
|
|
8847
8847
|
},
|
|
8848
8848
|
applyConversationEvent: (event) => {
|
|
8849
8849
|
if (event.type === "session.resync.required" && !event.messageId) {
|
|
8850
|
-
void get().loadConversations().catch((error2) => log
|
|
8850
|
+
void get().loadConversations().catch((error2) => log$11.error("Failed to reload Session metadata after resync:", error2));
|
|
8851
8851
|
return;
|
|
8852
8852
|
}
|
|
8853
8853
|
if (event.type === "session.created") {
|
|
@@ -14224,7 +14224,7 @@ const styles$2y = {
|
|
|
14224
14224
|
memberCount,
|
|
14225
14225
|
hint: hint$d
|
|
14226
14226
|
};
|
|
14227
|
-
const log$
|
|
14227
|
+
const log$10 = createLogger("EmptySessionGuide");
|
|
14228
14228
|
function EmptySessionGuide({ sessionTitle: sessionTitle2, groupId }) {
|
|
14229
14229
|
const { t } = useTranslation();
|
|
14230
14230
|
const agents = useAgentStore((state2) => state2.agents);
|
|
@@ -14236,7 +14236,7 @@ function EmptySessionGuide({ sessionTitle: sessionTitle2, groupId }) {
|
|
|
14236
14236
|
);
|
|
14237
14237
|
reactExports.useEffect(() => {
|
|
14238
14238
|
if (directoryLoaded) return;
|
|
14239
|
-
void useSessionStore.getState().loadOwnerDirectory().catch((error2) => log$
|
|
14239
|
+
void useSessionStore.getState().loadOwnerDirectory().catch((error2) => log$10.error("群目录加载失败,空态退化为标题 + hint:", error2));
|
|
14240
14240
|
}, [directoryLoaded]);
|
|
14241
14241
|
const memberAgents = reactExports.useMemo(() => {
|
|
14242
14242
|
if (!group2) return [];
|
|
@@ -20738,7 +20738,7 @@ function useProcessGroupCollapseGlide(expandedKeysByMessage) {
|
|
|
20738
20738
|
}, [collapsingByMessage]);
|
|
20739
20739
|
return { renderedKeysByMessage: renderingKeysByMessage, collapsingKeys };
|
|
20740
20740
|
}
|
|
20741
|
-
const log
|
|
20741
|
+
const log$$ = createLogger("uiPreferences");
|
|
20742
20742
|
const DEFAULT_UI_PREFERENCES = normalizeUiPreferences(void 0);
|
|
20743
20743
|
function useUiPreferences(onPersistError) {
|
|
20744
20744
|
const [preferences, setPreferences] = reactExports.useState(DEFAULT_UI_PREFERENCES);
|
|
@@ -20748,7 +20748,7 @@ function useUiPreferences(onPersistError) {
|
|
|
20748
20748
|
getTransport().getSettings().then((settings) => {
|
|
20749
20749
|
if (!cancelled) setPreferences(normalizeUiPreferences(settings.ui));
|
|
20750
20750
|
}).catch((error2) => {
|
|
20751
|
-
log
|
|
20751
|
+
log$$.warn("Failed to load UI preferences:", error2);
|
|
20752
20752
|
}).finally(() => {
|
|
20753
20753
|
if (!cancelled) setLoaded(true);
|
|
20754
20754
|
});
|
|
@@ -20775,7 +20775,7 @@ function useUiPreferences(onPersistError) {
|
|
|
20775
20775
|
(patch2, previous2) => {
|
|
20776
20776
|
setPreferences({ ...previous2, ...patch2 });
|
|
20777
20777
|
void getTransport().saveSettings({ ui: patch2 }).catch((error2) => {
|
|
20778
|
-
log
|
|
20778
|
+
log$$.warn("Failed to persist UI preferences:", error2);
|
|
20779
20779
|
setPreferences(previous2);
|
|
20780
20780
|
onPersistError?.(error2);
|
|
20781
20781
|
});
|
|
@@ -25212,7 +25212,7 @@ function AppTooltip({
|
|
|
25212
25212
|
) })
|
|
25213
25213
|
] });
|
|
25214
25214
|
}
|
|
25215
|
-
const log$
|
|
25215
|
+
const log$_ = createLogger("savedMessageStore");
|
|
25216
25216
|
let loadSavedMessagesPromise = null;
|
|
25217
25217
|
function applyState(state2) {
|
|
25218
25218
|
return {
|
|
@@ -25240,7 +25240,7 @@ const useSavedMessageStore = create$1((set, get) => ({
|
|
|
25240
25240
|
const state2 = await getTransport().getSavedMessages();
|
|
25241
25241
|
set(applyState(state2));
|
|
25242
25242
|
} catch (error2) {
|
|
25243
|
-
log$
|
|
25243
|
+
log$_.error("loadSavedMessages failed", error2);
|
|
25244
25244
|
throw error2;
|
|
25245
25245
|
} finally {
|
|
25246
25246
|
set({ loading: false });
|
|
@@ -48064,7 +48064,7 @@ function isLocalPathCandidate(value2) {
|
|
|
48064
48064
|
function isHtmlLanguage(language) {
|
|
48065
48065
|
return language.toLowerCase() === "html" || language.toLowerCase() === "htm";
|
|
48066
48066
|
}
|
|
48067
|
-
const log$
|
|
48067
|
+
const log$Z = createLogger("external-open");
|
|
48068
48068
|
function isExternalOpenEvent(event) {
|
|
48069
48069
|
return event.metaKey === true || event.ctrlKey === true;
|
|
48070
48070
|
}
|
|
@@ -48072,14 +48072,14 @@ function tryOpenWithSystemApp(event, target2, onOpenFailed) {
|
|
|
48072
48072
|
if (!isExternalOpenEvent(event)) return false;
|
|
48073
48073
|
if (isHttpUrl(target2)) {
|
|
48074
48074
|
getTransport().openExternalUrl(target2).catch((err) => {
|
|
48075
|
-
log$
|
|
48075
|
+
log$Z.error("openExternalUrl failed:", err);
|
|
48076
48076
|
onOpenFailed?.();
|
|
48077
48077
|
});
|
|
48078
48078
|
return true;
|
|
48079
48079
|
}
|
|
48080
48080
|
if (getTransport().meta?.env !== "electron") return false;
|
|
48081
48081
|
getTransport().openLocalPath(target2).catch((err) => {
|
|
48082
|
-
log$
|
|
48082
|
+
log$Z.error("openLocalPath failed:", err);
|
|
48083
48083
|
onOpenFailed?.();
|
|
48084
48084
|
});
|
|
48085
48085
|
return true;
|
|
@@ -50369,7 +50369,7 @@ function useResourceContextMenu(target2) {
|
|
|
50369
50369
|
) : null;
|
|
50370
50370
|
return { onContextMenu: handleContextMenu, menu: menu2 };
|
|
50371
50371
|
}
|
|
50372
|
-
const log$
|
|
50372
|
+
const log$Y = createLogger("MarkdownMessage");
|
|
50373
50373
|
function stripLocalUrlSuffix(url2) {
|
|
50374
50374
|
return url2.replace(/[?#].*$/, "");
|
|
50375
50375
|
}
|
|
@@ -50377,7 +50377,7 @@ function resolveLocalFileUrl(url2) {
|
|
|
50377
50377
|
return isKaiLocalUrl(url2) ? url2 : localHttpUrlToKaiUrl(url2);
|
|
50378
50378
|
}
|
|
50379
50379
|
function openExternalUrl(url2) {
|
|
50380
|
-
getTransport().openExternalUrl(url2).catch((err) => log$
|
|
50380
|
+
getTransport().openExternalUrl(url2).catch((err) => log$Y.error("openExternalUrl failed:", err));
|
|
50381
50381
|
}
|
|
50382
50382
|
function MarkdownLink({ href, children, title: title2 }) {
|
|
50383
50383
|
const { agentId, basePath, isStreaming } = useMarkdownRenderContext();
|
|
@@ -53004,7 +53004,7 @@ const taskRow$1 = "_taskRow_17feh_16";
|
|
|
53004
53004
|
const metaRow$3 = "_metaRow_17feh_17";
|
|
53005
53005
|
const title$J = "_title_17feh_41";
|
|
53006
53006
|
const meta$6 = "_meta_17feh_17";
|
|
53007
|
-
const field$
|
|
53007
|
+
const field$j = "_field_17feh_63";
|
|
53008
53008
|
const label$k = "_label_17feh_70";
|
|
53009
53009
|
const fieldContent = "_fieldContent_17feh_79";
|
|
53010
53010
|
const correctionNotice = "_correctionNotice_17feh_88";
|
|
@@ -53033,7 +53033,7 @@ const styles$2n = {
|
|
|
53033
53033
|
metaRow: metaRow$3,
|
|
53034
53034
|
title: title$J,
|
|
53035
53035
|
meta: meta$6,
|
|
53036
|
-
field: field$
|
|
53036
|
+
field: field$j,
|
|
53037
53037
|
label: label$k,
|
|
53038
53038
|
fieldContent,
|
|
53039
53039
|
correctionNotice,
|
|
@@ -54354,7 +54354,7 @@ const container$p = "_container_tfjgu_1";
|
|
|
54354
54354
|
const hero$3 = "_hero_tfjgu_12";
|
|
54355
54355
|
const identity = "_identity_tfjgu_13";
|
|
54356
54356
|
const sectionTitle$7 = "_sectionTitle_tfjgu_14";
|
|
54357
|
-
const field$
|
|
54357
|
+
const field$i = "_field_tfjgu_15";
|
|
54358
54358
|
const resourceItem = "_resourceItem_tfjgu_16";
|
|
54359
54359
|
const skillIcon$1 = "_skillIcon_tfjgu_34";
|
|
54360
54360
|
const heroText = "_heroText_tfjgu_47";
|
|
@@ -54376,7 +54376,7 @@ const styles$2l = {
|
|
|
54376
54376
|
hero: hero$3,
|
|
54377
54377
|
identity,
|
|
54378
54378
|
sectionTitle: sectionTitle$7,
|
|
54379
|
-
field: field$
|
|
54379
|
+
field: field$i,
|
|
54380
54380
|
resourceItem,
|
|
54381
54381
|
skillIcon: skillIcon$1,
|
|
54382
54382
|
heroText,
|
|
@@ -54968,7 +54968,7 @@ const container$l = "_container_1b9hn_1";
|
|
|
54968
54968
|
const compactContainer = "_compactContainer_1b9hn_2";
|
|
54969
54969
|
const hero = "_hero_1b9hn_17";
|
|
54970
54970
|
const heroMain = "_heroMain_1b9hn_18";
|
|
54971
|
-
const field$
|
|
54971
|
+
const field$h = "_field_1b9hn_19";
|
|
54972
54972
|
const metaRow$2 = "_metaRow_1b9hn_20";
|
|
54973
54973
|
const title$G = "_title_1b9hn_44";
|
|
54974
54974
|
const meta$3 = "_meta_1b9hn_20";
|
|
@@ -54986,7 +54986,7 @@ const styles$2h = {
|
|
|
54986
54986
|
compactContainer,
|
|
54987
54987
|
hero,
|
|
54988
54988
|
heroMain,
|
|
54989
|
-
field: field$
|
|
54989
|
+
field: field$h,
|
|
54990
54990
|
metaRow: metaRow$2,
|
|
54991
54991
|
title: title$G,
|
|
54992
54992
|
meta: meta$3,
|
|
@@ -56911,19 +56911,19 @@ function planStopAction(input2) {
|
|
|
56911
56911
|
if (!liveness.runId) return { kind: "ended", reason: "no-run-id" };
|
|
56912
56912
|
return { kind: "stop", runId: liveness.runId };
|
|
56913
56913
|
}
|
|
56914
|
-
const log$
|
|
56914
|
+
const log$X = createLogger("requestStopRun");
|
|
56915
56915
|
function requestStopRun({ sessionId, t }) {
|
|
56916
56916
|
const plan = planStopAction({
|
|
56917
56917
|
liveness: selectSessionRunLiveness(useMessageStore.getState(), sessionId)
|
|
56918
56918
|
});
|
|
56919
56919
|
if (plan.kind === "stop") {
|
|
56920
|
-
getTransport().stopRun(plan.runId).catch((err) => log$
|
|
56920
|
+
getTransport().stopRun(plan.runId).catch((err) => log$X.error("stopRun failed:", err));
|
|
56921
56921
|
telemetry.track("message.stopped", { runActive: true });
|
|
56922
56922
|
return;
|
|
56923
56923
|
}
|
|
56924
56924
|
telemetry.track("message.stop_ignored", { runActive: false, reason: plan.reason });
|
|
56925
56925
|
toast$3.info(t("input.stopEnded"));
|
|
56926
|
-
void getTransport().requestConversationSnapshot(sessionId).catch((err) => log$
|
|
56926
|
+
void getTransport().requestConversationSnapshot(sessionId).catch((err) => log$X.error("stop reconcile snapshot failed:", err));
|
|
56927
56927
|
}
|
|
56928
56928
|
function useRuntimeMetricsVisibility() {
|
|
56929
56929
|
return !useIsMobile();
|
|
@@ -60584,7 +60584,7 @@ const SEVERITY_ICON = {
|
|
|
60584
60584
|
}
|
|
60585
60585
|
)
|
|
60586
60586
|
};
|
|
60587
|
-
const log$
|
|
60587
|
+
const log$W = createLogger("surfaceViewStore");
|
|
60588
60588
|
const SURFACE_VIEW_TTL_MS = 1e4;
|
|
60589
60589
|
const READ_ATTEMPTS = 3;
|
|
60590
60590
|
const READ_RETRY_BASE_MS = 300;
|
|
@@ -60634,7 +60634,7 @@ const useSurfaceViewStore = create$1((set, get) => ({
|
|
|
60634
60634
|
}
|
|
60635
60635
|
}));
|
|
60636
60636
|
}).catch((error2) => {
|
|
60637
|
-
log$
|
|
60637
|
+
log$W.error(`getSurfaceView failed: ${sessionId} / ${surfaceId}`, error2);
|
|
60638
60638
|
const latest = get().entries[key];
|
|
60639
60639
|
set((state2) => ({
|
|
60640
60640
|
entries: {
|
|
@@ -60747,7 +60747,7 @@ const action$6 = "_action_n9d60_141";
|
|
|
60747
60747
|
const primary = "_primary_n9d60_150";
|
|
60748
60748
|
const secondary$1 = "_secondary_n9d60_156";
|
|
60749
60749
|
const ghost = "_ghost_n9d60_161";
|
|
60750
|
-
const field$
|
|
60750
|
+
const field$g = "_field_n9d60_183";
|
|
60751
60751
|
const fieldLabel$4 = "_fieldLabel_n9d60_190";
|
|
60752
60752
|
const fieldValue = "_fieldValue_n9d60_197";
|
|
60753
60753
|
const table$1 = "_table_n9d60_235";
|
|
@@ -60787,7 +60787,7 @@ const styles$21 = {
|
|
|
60787
60787
|
primary,
|
|
60788
60788
|
secondary: secondary$1,
|
|
60789
60789
|
ghost,
|
|
60790
|
-
field: field$
|
|
60790
|
+
field: field$g,
|
|
60791
60791
|
fieldLabel: fieldLabel$4,
|
|
60792
60792
|
fieldValue,
|
|
60793
60793
|
table: table$1,
|
|
@@ -62165,7 +62165,7 @@ const optionsList = "_optionsList_1kxjm_120";
|
|
|
62165
62165
|
const optionButton = "_optionButton_1kxjm_127";
|
|
62166
62166
|
const optionLabel = "_optionLabel_1kxjm_158";
|
|
62167
62167
|
const optionDescription = "_optionDescription_1kxjm_162";
|
|
62168
|
-
const textInput
|
|
62168
|
+
const textInput = "_textInput_1kxjm_167";
|
|
62169
62169
|
const optionPreview = "_optionPreview_1kxjm_193";
|
|
62170
62170
|
const previewLabel$1 = "_previewLabel_1kxjm_204";
|
|
62171
62171
|
const submitButton = "_submitButton_1kxjm_211";
|
|
@@ -62192,7 +62192,7 @@ const styles$1$ = {
|
|
|
62192
62192
|
optionButton,
|
|
62193
62193
|
optionLabel,
|
|
62194
62194
|
optionDescription,
|
|
62195
|
-
textInput
|
|
62195
|
+
textInput,
|
|
62196
62196
|
optionPreview,
|
|
62197
62197
|
previewLabel: previewLabel$1,
|
|
62198
62198
|
submitButton,
|
|
@@ -62719,7 +62719,7 @@ function resolveUserMessageInvocation({
|
|
|
62719
62719
|
}
|
|
62720
62720
|
return null;
|
|
62721
62721
|
}
|
|
62722
|
-
const log$
|
|
62722
|
+
const log$V = createLogger("BlockRenderer");
|
|
62723
62723
|
function buildBlockSubtreeOwner(context, ownerMessageId) {
|
|
62724
62724
|
if (!context.onExpandLoad) return void 0;
|
|
62725
62725
|
return {
|
|
@@ -63062,7 +63062,7 @@ class BlockErrorBoundary extends reactExports.Component {
|
|
|
63062
63062
|
return { hasError: true };
|
|
63063
63063
|
}
|
|
63064
63064
|
componentDidCatch(error2) {
|
|
63065
|
-
log$
|
|
63065
|
+
log$V.warn("render error:", error2.message);
|
|
63066
63066
|
}
|
|
63067
63067
|
render() {
|
|
63068
63068
|
if (this.state.hasError) {
|
|
@@ -63173,7 +63173,7 @@ function getBlockGroupEndIndex(group2) {
|
|
|
63173
63173
|
if (group2.type === "interject") return group2.entries[group2.entries.length - 1]?.index ?? 0;
|
|
63174
63174
|
return group2.index;
|
|
63175
63175
|
}
|
|
63176
|
-
const log$
|
|
63176
|
+
const log$U = createLogger("llmChannelCache");
|
|
63177
63177
|
let cached$1 = null;
|
|
63178
63178
|
let inflight$1 = null;
|
|
63179
63179
|
const listeners$3 = /* @__PURE__ */ new Set();
|
|
@@ -63190,7 +63190,7 @@ function loadLLMChannels({ force = false } = {}) {
|
|
|
63190
63190
|
publish(list2);
|
|
63191
63191
|
return list2;
|
|
63192
63192
|
}).catch((error2) => {
|
|
63193
|
-
log$
|
|
63193
|
+
log$U.error("listLLMChannels failed:", error2);
|
|
63194
63194
|
return cached$1 ?? [];
|
|
63195
63195
|
}).finally(() => {
|
|
63196
63196
|
inflight$1 = null;
|
|
@@ -64276,7 +64276,7 @@ function scrollMessageTopIntoView(container2, messageElement, reserveBottomScrol
|
|
|
64276
64276
|
function forceScrollToMessageTop(container2, getTargetTop) {
|
|
64277
64277
|
container2.scrollTo({ top: Math.max(0, getTargetTop()), behavior: "auto" });
|
|
64278
64278
|
}
|
|
64279
|
-
const log$
|
|
64279
|
+
const log$T = createLogger("quickReplyStore");
|
|
64280
64280
|
let loadQuickRepliesPromise = null;
|
|
64281
64281
|
function normalizeDraft(draft) {
|
|
64282
64282
|
return {
|
|
@@ -64312,7 +64312,7 @@ const useQuickReplyStore = create$1((set, get) => ({
|
|
|
64312
64312
|
loaded: true
|
|
64313
64313
|
});
|
|
64314
64314
|
} catch (error2) {
|
|
64315
|
-
log$
|
|
64315
|
+
log$T.error("loadQuickReplies failed", error2);
|
|
64316
64316
|
throw error2;
|
|
64317
64317
|
} finally {
|
|
64318
64318
|
set({ loading: false });
|
|
@@ -64577,10 +64577,10 @@ const att = "_att_1ufv1_385";
|
|
|
64577
64577
|
const attSize = "_attSize_1ufv1_413";
|
|
64578
64578
|
const omitted = "_omitted_1ufv1_418";
|
|
64579
64579
|
const dot$2 = "_dot_1ufv1_426";
|
|
64580
|
-
const field$
|
|
64580
|
+
const field$f = "_field_1ufv1_435";
|
|
64581
64581
|
const fieldLabel$3 = "_fieldLabel_1ufv1_441";
|
|
64582
64582
|
const optional = "_optional_1ufv1_449";
|
|
64583
|
-
const fieldHint$
|
|
64583
|
+
const fieldHint$4 = "_fieldHint_1ufv1_477";
|
|
64584
64584
|
const footer$h = "_footer_1ufv1_483";
|
|
64585
64585
|
const footHint$1 = "_footHint_1ufv1_489";
|
|
64586
64586
|
const actions$j = "_actions_1ufv1_497";
|
|
@@ -64625,10 +64625,10 @@ const styles$1X = {
|
|
|
64625
64625
|
attSize,
|
|
64626
64626
|
omitted,
|
|
64627
64627
|
dot: dot$2,
|
|
64628
|
-
field: field$
|
|
64628
|
+
field: field$f,
|
|
64629
64629
|
fieldLabel: fieldLabel$3,
|
|
64630
64630
|
optional,
|
|
64631
|
-
fieldHint: fieldHint$
|
|
64631
|
+
fieldHint: fieldHint$4,
|
|
64632
64632
|
footer: footer$h,
|
|
64633
64633
|
footHint: footHint$1,
|
|
64634
64634
|
actions: actions$j
|
|
@@ -65100,14 +65100,14 @@ function HandoffDialog({ message: message2, onClose, onSent }) {
|
|
|
65100
65100
|
}
|
|
65101
65101
|
const title$w = "_title_6msse_1";
|
|
65102
65102
|
const body$i = "_body_6msse_9";
|
|
65103
|
-
const field$
|
|
65103
|
+
const field$e = "_field_6msse_13";
|
|
65104
65104
|
const textarea$4 = "_textarea_6msse_22";
|
|
65105
65105
|
const hint$a = "_hint_6msse_48";
|
|
65106
65106
|
const actions$i = "_actions_6msse_54";
|
|
65107
65107
|
const styles$1W = {
|
|
65108
65108
|
title: title$w,
|
|
65109
65109
|
body: body$i,
|
|
65110
|
-
field: field$
|
|
65110
|
+
field: field$e,
|
|
65111
65111
|
textarea: textarea$4,
|
|
65112
65112
|
hint: hint$a,
|
|
65113
65113
|
actions: actions$i
|
|
@@ -70326,7 +70326,7 @@ function buildSourceContextOverride(input2) {
|
|
|
70326
70326
|
}
|
|
70327
70327
|
return { ok: true, contexts };
|
|
70328
70328
|
}
|
|
70329
|
-
const log$
|
|
70329
|
+
const log$S = createLogger("useChatActions");
|
|
70330
70330
|
function getMemoryUpdateSources(sources2) {
|
|
70331
70331
|
const normalizedSources = Array.isArray(sources2) ? sources2.filter(
|
|
70332
70332
|
(source2) => source2 !== null && typeof source2 === "object" && (source2.sourceKind === "direct" || source2.sourceKind === "group") && typeof source2.sessionId === "string" && typeof source2.title === "string" && typeof source2.date === "string" && typeof source2.messageCount === "number" && Number.isFinite(source2.messageCount) && source2.messageCount >= 0
|
|
@@ -70400,7 +70400,7 @@ function useChatActions({ sessionId, conversation, primaryAgent }) {
|
|
|
70400
70400
|
reactExports.useEffect(() => {
|
|
70401
70401
|
useMessageStore.getState().setConversationLoading(sessionId, true);
|
|
70402
70402
|
getTransport().requestConversationSnapshot(sessionId).catch((error2) => {
|
|
70403
|
-
log$
|
|
70403
|
+
log$S.error("Failed to request conversation snapshot:", error2);
|
|
70404
70404
|
useMessageStore.getState().setConversationLoading(sessionId, false);
|
|
70405
70405
|
});
|
|
70406
70406
|
}, [sessionId]);
|
|
@@ -70421,7 +70421,7 @@ function useChatActions({ sessionId, conversation, primaryAgent }) {
|
|
|
70421
70421
|
previewContexts
|
|
70422
70422
|
});
|
|
70423
70423
|
if (!budget.ok) {
|
|
70424
|
-
log$
|
|
70424
|
+
log$S.warn("Source context budget exceeded, aborting send:", {
|
|
70425
70425
|
requested: budget.requested,
|
|
70426
70426
|
accepted: budget.accepted
|
|
70427
70427
|
});
|
|
@@ -70458,7 +70458,7 @@ function useChatActions({ sessionId, conversation, primaryAgent }) {
|
|
|
70458
70458
|
});
|
|
70459
70459
|
} catch (error2) {
|
|
70460
70460
|
const msg = error2 instanceof Error ? error2.message : String(error2);
|
|
70461
|
-
log$
|
|
70461
|
+
log$S.error("Failed to send message:", error2);
|
|
70462
70462
|
return {
|
|
70463
70463
|
message: t("sendMessageFailed", { error: msg }),
|
|
70464
70464
|
messageRetained: error2 instanceof UserMessageSendError && error2.messageRetained
|
|
@@ -70481,7 +70481,7 @@ function useChatActions({ sessionId, conversation, primaryAgent }) {
|
|
|
70481
70481
|
intent: "summarize"
|
|
70482
70482
|
});
|
|
70483
70483
|
} catch (error2) {
|
|
70484
|
-
log$
|
|
70484
|
+
log$S.error("触发总结失败:", error2);
|
|
70485
70485
|
}
|
|
70486
70486
|
},
|
|
70487
70487
|
[handleSendMessage, t]
|
|
@@ -71096,7 +71096,7 @@ function triggerBrowserDownload(url2, filename2) {
|
|
|
71096
71096
|
function buildSessionDataDirTarget(owner, sessionId) {
|
|
71097
71097
|
return owner.kind === "group" ? { type: "groupSession", groupId: owner.groupId, sessionId } : { type: "directSession", agentId: owner.agentId, sessionId };
|
|
71098
71098
|
}
|
|
71099
|
-
const log$
|
|
71099
|
+
const log$R = createLogger("sessionContextMenu");
|
|
71100
71100
|
function isSessionBusy(source2, sessionId) {
|
|
71101
71101
|
return Boolean(source2.activeRunIdMap.get(sessionId)) || (source2.sendingMap.get(sessionId) ?? false) || (source2.queueCountMap.get(sessionId) ?? 0) > 0;
|
|
71102
71102
|
}
|
|
@@ -71117,7 +71117,7 @@ async function openSessionDirectory(owner, sessionId, t, errorLabelKey = "sessio
|
|
|
71117
71117
|
try {
|
|
71118
71118
|
await getTransport().openChatDataDir(buildSessionDataDirTarget(owner, sessionId));
|
|
71119
71119
|
} catch (error2) {
|
|
71120
|
-
log$
|
|
71120
|
+
log$R.error("Failed to open session directory:", error2);
|
|
71121
71121
|
toast$3.error(t(errorLabelKey));
|
|
71122
71122
|
}
|
|
71123
71123
|
}
|
|
@@ -71140,7 +71140,7 @@ async function exportSessionEventLog(owner, session, t) {
|
|
|
71140
71140
|
}
|
|
71141
71141
|
toast$3.success(t("sessionsPanel.exportEventLogDone"));
|
|
71142
71142
|
} catch (error2) {
|
|
71143
|
-
log$
|
|
71143
|
+
log$R.error("Failed to export session event log:", error2);
|
|
71144
71144
|
toast$3.error(t("sessionsPanel.exportEventLogFailed"));
|
|
71145
71145
|
}
|
|
71146
71146
|
}
|
|
@@ -71153,7 +71153,7 @@ async function archiveSession(owner, sessionId, t) {
|
|
|
71153
71153
|
}
|
|
71154
71154
|
toast$3.success(t("sessionsPanel.archived"));
|
|
71155
71155
|
} catch (error2) {
|
|
71156
|
-
log$
|
|
71156
|
+
log$R.error("Failed to archive session:", error2);
|
|
71157
71157
|
toast$3.error(t("sessionsPanel.archiveFailed"));
|
|
71158
71158
|
}
|
|
71159
71159
|
}
|
|
@@ -71166,7 +71166,7 @@ async function deleteSession(owner, sessionId, t) {
|
|
|
71166
71166
|
}
|
|
71167
71167
|
toast$3.success(t("sessionsPanel.deleted"));
|
|
71168
71168
|
} catch (error2) {
|
|
71169
|
-
log$
|
|
71169
|
+
log$R.error("Failed to delete session:", error2);
|
|
71170
71170
|
toast$3.error(t("sessionsPanel.deleteFailed"));
|
|
71171
71171
|
}
|
|
71172
71172
|
}
|
|
@@ -71598,7 +71598,7 @@ function withPluginMenuSection(items, target2, entries, ref, t, onInvoke) {
|
|
|
71598
71598
|
const rows2 = groups.map((group2) => buildPluginRow(group2, ref, t, onInvoke));
|
|
71599
71599
|
return [...items, "separator", ...rows2];
|
|
71600
71600
|
}
|
|
71601
|
-
const log$
|
|
71601
|
+
const log$Q = createLogger("pluginDialog");
|
|
71602
71602
|
let nextSerial = 0;
|
|
71603
71603
|
const usePluginDialogStore = create$1((set) => ({
|
|
71604
71604
|
session: null,
|
|
@@ -71640,7 +71640,7 @@ function openPluginDialogFromReceipt(receipt2, options = {}) {
|
|
|
71640
71640
|
if (shell2 !== "dialog") {
|
|
71641
71641
|
if (!warnedShellMismatch) {
|
|
71642
71642
|
warnedShellMismatch = true;
|
|
71643
|
-
log$
|
|
71643
|
+
log$Q.warn("ignored page receipt for non-dialog shell", { shell: String(shell2) });
|
|
71644
71644
|
}
|
|
71645
71645
|
return false;
|
|
71646
71646
|
}
|
|
@@ -71653,7 +71653,7 @@ function openPluginDialogFromReceipt(receipt2, options = {}) {
|
|
|
71653
71653
|
});
|
|
71654
71654
|
return true;
|
|
71655
71655
|
}
|
|
71656
|
-
const log$
|
|
71656
|
+
const log$P = createLogger("pluginActionInvoke");
|
|
71657
71657
|
const RUNNING_TOAST_DURATION_MS = 10 * 60 * 1e3;
|
|
71658
71658
|
const INVOKE_TIMEOUT_MS = 12e4;
|
|
71659
71659
|
const ERROR_DISPLAY_MAX_CHARS = 200;
|
|
@@ -71712,7 +71712,7 @@ async function execute(entry2, ref, t) {
|
|
|
71712
71712
|
return;
|
|
71713
71713
|
}
|
|
71714
71714
|
if (outcome.status === "timeout") {
|
|
71715
|
-
log$
|
|
71715
|
+
log$P.warn("plugin action invoke timed out", {
|
|
71716
71716
|
pluginId: entry2.pluginId,
|
|
71717
71717
|
commandId: entry2.commandId,
|
|
71718
71718
|
timeoutMs: INVOKE_TIMEOUT_MS
|
|
@@ -71720,7 +71720,7 @@ async function execute(entry2, ref, t) {
|
|
|
71720
71720
|
toast$3.error(t("pluginMenu.timeout", { plugin }));
|
|
71721
71721
|
return;
|
|
71722
71722
|
}
|
|
71723
|
-
log$
|
|
71723
|
+
log$P.error("plugin action failed", {
|
|
71724
71724
|
pluginId: entry2.pluginId,
|
|
71725
71725
|
commandId: entry2.commandId,
|
|
71726
71726
|
error: outcome.error
|
|
@@ -71872,7 +71872,7 @@ const styles$1M = {
|
|
|
71872
71872
|
tabCloseActive,
|
|
71873
71873
|
newBtn
|
|
71874
71874
|
};
|
|
71875
|
-
const log$
|
|
71875
|
+
const log$O = createLogger("SessionTabs");
|
|
71876
71876
|
const TABS_MENU_LABEL_KEYS = {
|
|
71877
71877
|
openDirectory: "session.tabs.openDirectory",
|
|
71878
71878
|
openDirectoryFailed: "session.tabs.openDirectoryFailed",
|
|
@@ -71982,7 +71982,7 @@ function SessionTabs({
|
|
|
71982
71982
|
label: t("session.tabs.restoreAutoTitle"),
|
|
71983
71983
|
onClick: () => {
|
|
71984
71984
|
void restoreSessionAutoTitle(sessionId).catch((error2) => {
|
|
71985
|
-
log$
|
|
71985
|
+
log$O.error("Failed to restore auto title:", error2);
|
|
71986
71986
|
toast$3.error(t("session.tabs.restoreAutoTitleFailed"));
|
|
71987
71987
|
});
|
|
71988
71988
|
}
|
|
@@ -72324,7 +72324,7 @@ const usePinnedProjectsStore = create$1((set) => ({
|
|
|
72324
72324
|
return projects;
|
|
72325
72325
|
}
|
|
72326
72326
|
}));
|
|
72327
|
-
const log$
|
|
72327
|
+
const log$N = createLogger("applySessionProjectPath");
|
|
72328
72328
|
async function applySessionProjectPath(sessionId, conversationType, projectPath) {
|
|
72329
72329
|
const transport = getTransport();
|
|
72330
72330
|
if (conversationType === "group") {
|
|
@@ -72336,13 +72336,13 @@ async function applySessionProjectPath(sessionId, conversationType, projectPath)
|
|
|
72336
72336
|
try {
|
|
72337
72337
|
await usePinnedProjectsStore.getState().add(projectPath);
|
|
72338
72338
|
} catch (error2) {
|
|
72339
|
-
log$
|
|
72339
|
+
log$N.warn("Failed to declare project for session path:", error2);
|
|
72340
72340
|
}
|
|
72341
72341
|
}
|
|
72342
72342
|
useSessionStore.getState().setSessionProjectPath(sessionId, projectPath);
|
|
72343
72343
|
useMessageStore.getState().patchConversationProjectPath(sessionId, projectPath ?? void 0);
|
|
72344
72344
|
}
|
|
72345
|
-
const log$
|
|
72345
|
+
const log$M = createLogger("useCreateAndSwitchSession");
|
|
72346
72346
|
function resolveInheritedProjectPath(owner) {
|
|
72347
72347
|
const state2 = useSessionStore.getState();
|
|
72348
72348
|
const sessions2 = owner.kind === "group" ? state2.groupSessionsByGroupId.get(owner.groupId) : state2.directSessionsByAgentId.get(owner.agentId);
|
|
@@ -72355,7 +72355,7 @@ async function inheritProjectPathSafely(sessionId, conversationType, projectPath
|
|
|
72355
72355
|
try {
|
|
72356
72356
|
await applySessionProjectPath(sessionId, conversationType, projectPath);
|
|
72357
72357
|
} catch (error2) {
|
|
72358
|
-
log$
|
|
72358
|
+
log$M.warn("Failed to inherit project path for new session", { sessionId, error: error2 });
|
|
72359
72359
|
}
|
|
72360
72360
|
}
|
|
72361
72361
|
function useCreateAndSwitchSession(owner, onCreated) {
|
|
@@ -72378,7 +72378,7 @@ function useCreateAndSwitchSession(owner, onCreated) {
|
|
|
72378
72378
|
onCreated?.(session.id);
|
|
72379
72379
|
}
|
|
72380
72380
|
} catch (error2) {
|
|
72381
|
-
log$
|
|
72381
|
+
log$M.error("Failed to create session", { owner, error: error2 });
|
|
72382
72382
|
toast$3.error(t("sidebar.sessionCreateFailed"));
|
|
72383
72383
|
}
|
|
72384
72384
|
}, [owner, onCreated, t]);
|
|
@@ -72496,7 +72496,7 @@ function partitionFiles(files, maxSize = DEFAULT_MAX_ATTACHMENT_SIZE, allowOvers
|
|
|
72496
72496
|
});
|
|
72497
72497
|
return { accepted, rejected };
|
|
72498
72498
|
}
|
|
72499
|
-
const log$
|
|
72499
|
+
const log$L = createLogger("audio-capture");
|
|
72500
72500
|
const SYSTEM_AUDIO_ACTIVITY_POLL_MS = 100;
|
|
72501
72501
|
const SYSTEM_AUDIO_ACTIVITY_THRESHOLD = 2;
|
|
72502
72502
|
const SYSTEM_AUDIO_ACTIVE_SAMPLE_COUNT = 2;
|
|
@@ -72580,7 +72580,7 @@ function monitorSystemAudioActivity(audioContext, source2, destination, onActive
|
|
|
72580
72580
|
if (activeSampleCount < SYSTEM_AUDIO_ACTIVE_SAMPLE_COUNT) return;
|
|
72581
72581
|
if (interval) clearInterval(interval);
|
|
72582
72582
|
interval = null;
|
|
72583
|
-
log$
|
|
72583
|
+
log$L.info("System audio PCM activity detected");
|
|
72584
72584
|
onActive();
|
|
72585
72585
|
}, SYSTEM_AUDIO_ACTIVITY_POLL_MS);
|
|
72586
72586
|
return () => {
|
|
@@ -72609,24 +72609,24 @@ async function requestMixedAudioCapture(options = {}) {
|
|
|
72609
72609
|
try {
|
|
72610
72610
|
systemStream = await navigator.mediaDevices.getDisplayMedia(DISPLAY_CAPTURE_CONSTRAINTS);
|
|
72611
72611
|
} catch (error2) {
|
|
72612
|
-
log$
|
|
72612
|
+
log$L.warn("System audio display capture request failed", toLoggableError(error2));
|
|
72613
72613
|
throw new AudioCaptureError("system-audio", error2);
|
|
72614
72614
|
}
|
|
72615
72615
|
const systemAudioTracks = systemStream.getAudioTracks();
|
|
72616
72616
|
const systemVideoTracks = systemStream.getVideoTracks();
|
|
72617
|
-
log$
|
|
72617
|
+
log$L.info("System audio display capture stream received", {
|
|
72618
72618
|
audioTracks: systemAudioTracks.map(describeAudioTrack),
|
|
72619
72619
|
videoTrackCount: systemVideoTracks.length
|
|
72620
72620
|
});
|
|
72621
72621
|
if (systemAudioTracks.length === 0) {
|
|
72622
72622
|
stopStream(systemStream);
|
|
72623
|
-
log$
|
|
72623
|
+
log$L.warn("Display capture stream did not contain a system audio track");
|
|
72624
72624
|
throw new AudioCaptureError("system-audio", createMissingSystemAudioError());
|
|
72625
72625
|
}
|
|
72626
72626
|
if (systemAudioTracks.some((track2) => track2.readyState === "ended")) {
|
|
72627
72627
|
stopStream(systemStream);
|
|
72628
72628
|
const error2 = createUnavailableSystemAudioError("The system audio track has already ended");
|
|
72629
|
-
log$
|
|
72629
|
+
log$L.warn("System audio track ended before mixer initialization", toLoggableError(error2));
|
|
72630
72630
|
throw new AudioCaptureError("system-audio", error2);
|
|
72631
72631
|
}
|
|
72632
72632
|
for (const track2 of systemVideoTracks) {
|
|
@@ -72665,7 +72665,7 @@ async function requestMixedAudioCapture(options = {}) {
|
|
|
72665
72665
|
disposeSystemAudioActivityMonitor
|
|
72666
72666
|
};
|
|
72667
72667
|
} catch (error2) {
|
|
72668
|
-
log$
|
|
72668
|
+
log$L.warn("Audio mixer initialization failed", toLoggableError(error2));
|
|
72669
72669
|
stopStream(microphoneStream);
|
|
72670
72670
|
stopStream(systemStream);
|
|
72671
72671
|
disposeSystemAudioActivityMonitor();
|
|
@@ -72702,7 +72702,7 @@ const RECORDING_SIZE_HEADROOM_BYTES = 1024 * 1024;
|
|
|
72702
72702
|
const MAX_RECORDING_SIZE = MAX_ATTACHMENT_SIZE - RECORDING_SIZE_HEADROOM_BYTES;
|
|
72703
72703
|
const WAVEFORM_BARS = 40;
|
|
72704
72704
|
const MIME_TYPES = ["audio/webm;codecs=opus", "audio/webm", "audio/ogg;codecs=opus"];
|
|
72705
|
-
const log$
|
|
72705
|
+
const log$K = createLogger("useAudioRecording");
|
|
72706
72706
|
function isRecordingSupported() {
|
|
72707
72707
|
return Boolean(
|
|
72708
72708
|
typeof navigator !== "undefined" && typeof MediaRecorder !== "undefined" && typeof navigator.mediaDevices?.getUserMedia === "function" && typeof AudioContext !== "undefined"
|
|
@@ -73121,7 +73121,7 @@ function useAudioRecording({
|
|
|
73121
73121
|
if (error22 instanceof AudioCaptureError && (error22.source === "system-audio" || error22.source === "mixer")) {
|
|
73122
73122
|
if (requestToken !== requestTokenRef.current) return;
|
|
73123
73123
|
systemAudioFallbackError = mapAudioCaptureError(error22);
|
|
73124
|
-
log$
|
|
73124
|
+
log$K.warn("System audio capture unavailable; continuing with microphone only", {
|
|
73125
73125
|
source: error22.source,
|
|
73126
73126
|
fallbackError: systemAudioFallbackError
|
|
73127
73127
|
});
|
|
@@ -73170,7 +73170,7 @@ function useAudioRecording({
|
|
|
73170
73170
|
return;
|
|
73171
73171
|
}
|
|
73172
73172
|
systemAudioEnded = true;
|
|
73173
|
-
log$
|
|
73173
|
+
log$K.warn("System audio track ended; recording continues with microphone");
|
|
73174
73174
|
stopSystemAudioCapture(capture);
|
|
73175
73175
|
recordingStoreUpdate({
|
|
73176
73176
|
systemAudioFallback: true,
|
|
@@ -73234,7 +73234,7 @@ function useAudioRecording({
|
|
|
73234
73234
|
setStatus("error");
|
|
73235
73235
|
}
|
|
73236
73236
|
reportRecordingFailure("append-failed");
|
|
73237
|
-
log$
|
|
73237
|
+
log$K.error("Failed to append recording chunk", appendError);
|
|
73238
73238
|
});
|
|
73239
73239
|
if (recordedBytesRef.current >= MAX_RECORDING_SIZE && recorder.state === "recording") {
|
|
73240
73240
|
sizeLimitReachedRef.current = true;
|
|
@@ -73332,7 +73332,7 @@ function useAudioRecording({
|
|
|
73332
73332
|
}
|
|
73333
73333
|
if (attachment.size > 0 && attachment.mimeType.startsWith("audio/")) {
|
|
73334
73334
|
if (nextPurpose === "meeting" && systemAudioSignalDetected === false) {
|
|
73335
|
-
log$
|
|
73335
|
+
log$K.warn("Meeting recording completed without confirmed system audio PCM activity");
|
|
73336
73336
|
}
|
|
73337
73337
|
reportRecordingOutcome(operationGeneration, "completed", {
|
|
73338
73338
|
durationMs: recordedDuration,
|
|
@@ -73363,7 +73363,7 @@ function useAudioRecording({
|
|
|
73363
73363
|
return;
|
|
73364
73364
|
}
|
|
73365
73365
|
reportRecordingFailure("finalize-failed");
|
|
73366
|
-
log$
|
|
73366
|
+
log$K.error("Failed to finalize recording", finalizeError);
|
|
73367
73367
|
setDurationMs(0);
|
|
73368
73368
|
setError("failed");
|
|
73369
73369
|
setStatus("error");
|
|
@@ -73401,7 +73401,7 @@ function useAudioRecording({
|
|
|
73401
73401
|
cleanup();
|
|
73402
73402
|
const mappedError = mapAudioCaptureError(recordingError);
|
|
73403
73403
|
reportRecordingFailure(mappedError);
|
|
73404
|
-
log$
|
|
73404
|
+
log$K.error("Failed to start audio recording", recordingError);
|
|
73405
73405
|
setError(mappedError);
|
|
73406
73406
|
setStatus("error");
|
|
73407
73407
|
} finally {
|
|
@@ -77694,7 +77694,7 @@ const state$1 = "_state_alc2h_261";
|
|
|
77694
77694
|
const emptyState$7 = "_emptyState_alc2h_262";
|
|
77695
77695
|
const emptyTitle$3 = "_emptyTitle_alc2h_272";
|
|
77696
77696
|
const emptyDescription = "_emptyDescription_alc2h_279";
|
|
77697
|
-
const field$
|
|
77697
|
+
const field$d = "_field_alc2h_292";
|
|
77698
77698
|
const editorActions$1 = "_editorActions_alc2h_324";
|
|
77699
77699
|
const editorHint = "_editorHint_alc2h_330";
|
|
77700
77700
|
const primaryAction$2 = "_primaryAction_alc2h_336";
|
|
@@ -77725,7 +77725,7 @@ const styles$1G = {
|
|
|
77725
77725
|
emptyState: emptyState$7,
|
|
77726
77726
|
emptyTitle: emptyTitle$3,
|
|
77727
77727
|
emptyDescription,
|
|
77728
|
-
field: field$
|
|
77728
|
+
field: field$d,
|
|
77729
77729
|
editorActions: editorActions$1,
|
|
77730
77730
|
editorHint,
|
|
77731
77731
|
primaryAction: primaryAction$2,
|
|
@@ -78879,7 +78879,7 @@ function useRepositionWhileOpen(open2, update, deps = []) {
|
|
|
78879
78879
|
};
|
|
78880
78880
|
}, [open2, update, ...deps]);
|
|
78881
78881
|
}
|
|
78882
|
-
const log$
|
|
78882
|
+
const log$J = createLogger("usePolishDraft");
|
|
78883
78883
|
function usePolishDraft(sessionId, groupId) {
|
|
78884
78884
|
const [isPolishing, setIsPolishing] = reactExports.useState(false);
|
|
78885
78885
|
const polish = reactExports.useCallback(
|
|
@@ -78895,7 +78895,7 @@ function usePolishDraft(sessionId, groupId) {
|
|
|
78895
78895
|
});
|
|
78896
78896
|
return result2;
|
|
78897
78897
|
} catch (err) {
|
|
78898
|
-
log$
|
|
78898
|
+
log$J.warn("输入润色失败:", err);
|
|
78899
78899
|
return null;
|
|
78900
78900
|
} finally {
|
|
78901
78901
|
setIsPolishing(false);
|
|
@@ -79283,9 +79283,9 @@ function rememberVoiceInputConsent(streamingUrl) {
|
|
|
79283
79283
|
} catch {
|
|
79284
79284
|
}
|
|
79285
79285
|
}
|
|
79286
|
-
const log$
|
|
79286
|
+
const log$I = createLogger("MessageInput");
|
|
79287
79287
|
const EMPTY_ARRAY = [];
|
|
79288
|
-
const loadContextDraftStrip = () => __vitePreload(() => import("./ContextDraftStrip-
|
|
79288
|
+
const loadContextDraftStrip = () => __vitePreload(() => import("./ContextDraftStrip-D9Q7rgd9.js"), true ? __vite__mapDeps([5,6,2,7,1]) : void 0, import.meta.url);
|
|
79289
79289
|
const ContextDraftStrip = reactExports.lazy(
|
|
79290
79290
|
() => loadContextDraftStrip().then((module) => ({ default: module.ContextDraftStrip }))
|
|
79291
79291
|
);
|
|
@@ -79920,7 +79920,7 @@ const MessageInput = reactExports.forwardRef(function MessageInput2({
|
|
|
79920
79920
|
}
|
|
79921
79921
|
sendingSessionIdsRef.current.add(sessionId);
|
|
79922
79922
|
onSend({ content: commandName, attachments: [], mentions: [] }).catch((error2) => {
|
|
79923
|
-
log$
|
|
79923
|
+
log$I.warn(`Failed to send ${commandName} command:`, error2);
|
|
79924
79924
|
}).finally(() => {
|
|
79925
79925
|
sendingSessionIdsRef.current.delete(sessionId);
|
|
79926
79926
|
setTimeout(() => textareaRef.current?.focus(), 0);
|
|
@@ -80858,7 +80858,7 @@ const SKILLS_CHANGED_EVENT = "kai:skills-changed";
|
|
|
80858
80858
|
function notifySkillsChanged() {
|
|
80859
80859
|
window.dispatchEvent(new Event(SKILLS_CHANGED_EVENT));
|
|
80860
80860
|
}
|
|
80861
|
-
const log$
|
|
80861
|
+
const log$H = createLogger("useAgentResources");
|
|
80862
80862
|
function useAgentResources(options = {}) {
|
|
80863
80863
|
const { projectPath } = options;
|
|
80864
80864
|
const channels = useLLMChannels();
|
|
@@ -80874,7 +80874,7 @@ function useAgentResources(options = {}) {
|
|
|
80874
80874
|
const data = await getTransport().getSkillListings(projectPath ? { projectPath } : void 0);
|
|
80875
80875
|
if (mountedRef.current && requestId === skillsRequestIdRef.current) setSkills(data);
|
|
80876
80876
|
} catch (e) {
|
|
80877
|
-
log$
|
|
80877
|
+
log$H.error("getSkills failed:", e);
|
|
80878
80878
|
}
|
|
80879
80879
|
}, [projectPath]);
|
|
80880
80880
|
reactExports.useEffect(() => {
|
|
@@ -80882,11 +80882,11 @@ function useAgentResources(options = {}) {
|
|
|
80882
80882
|
window.addEventListener(SKILLS_CHANGED_EVENT, refreshSkills);
|
|
80883
80883
|
Promise.all([
|
|
80884
80884
|
getTransport().getMcpServers().catch((e) => {
|
|
80885
|
-
log$
|
|
80885
|
+
log$H.error("getMcpServers failed:", e);
|
|
80886
80886
|
return [];
|
|
80887
80887
|
}),
|
|
80888
80888
|
getTransport().getAvailableTools().catch((e) => {
|
|
80889
|
-
log$
|
|
80889
|
+
log$H.error("getAvailableTools failed:", e);
|
|
80890
80890
|
return [];
|
|
80891
80891
|
}),
|
|
80892
80892
|
refreshSkills()
|
|
@@ -80903,7 +80903,7 @@ function useAgentResources(options = {}) {
|
|
|
80903
80903
|
const defaultChannel = channels.find((ch) => ch.isDefault);
|
|
80904
80904
|
return { channels, skills, mcpServers, tools, defaultChannel, isLoading, refreshSkills };
|
|
80905
80905
|
}
|
|
80906
|
-
const log$
|
|
80906
|
+
const log$G = createLogger("useSlashCommands");
|
|
80907
80907
|
function useSlashCommands() {
|
|
80908
80908
|
const [commands, setCommands] = reactExports.useState([]);
|
|
80909
80909
|
const requestIdRef = reactExports.useRef(0);
|
|
@@ -80916,7 +80916,7 @@ function useSlashCommands() {
|
|
|
80916
80916
|
setCommands(nextCommands);
|
|
80917
80917
|
}
|
|
80918
80918
|
} catch (error2) {
|
|
80919
|
-
log$
|
|
80919
|
+
log$G.error("listSlashCommands failed:", error2);
|
|
80920
80920
|
}
|
|
80921
80921
|
}, []);
|
|
80922
80922
|
reactExports.useEffect(() => {
|
|
@@ -81863,7 +81863,7 @@ const styles$1y = {
|
|
|
81863
81863
|
highlight,
|
|
81864
81864
|
emptyState: emptyState$6
|
|
81865
81865
|
};
|
|
81866
|
-
const log$
|
|
81866
|
+
const log$F = createLogger("ModelSelect");
|
|
81867
81867
|
function ModelSelect({
|
|
81868
81868
|
value: value2,
|
|
81869
81869
|
onChange,
|
|
@@ -81919,11 +81919,11 @@ function ModelSelect({
|
|
|
81919
81919
|
if (requestId !== requestIdRef.current) return;
|
|
81920
81920
|
setModels(result2.models);
|
|
81921
81921
|
if (result2.error) {
|
|
81922
|
-
log$
|
|
81922
|
+
log$F.warn("fetch models error:", result2.error);
|
|
81923
81923
|
}
|
|
81924
81924
|
} catch (err) {
|
|
81925
81925
|
if (requestId !== requestIdRef.current) return;
|
|
81926
|
-
log$
|
|
81926
|
+
log$F.warn("fetch models failed:", err);
|
|
81927
81927
|
} finally {
|
|
81928
81928
|
if (requestId === requestIdRef.current) setLoading(false);
|
|
81929
81929
|
}
|
|
@@ -82237,7 +82237,7 @@ const hint$8 = "_hint_rt5b7_72";
|
|
|
82237
82237
|
const srOnly$4 = "_srOnly_rt5b7_79";
|
|
82238
82238
|
const checkboxLabel$2 = "_checkboxLabel_rt5b7_91";
|
|
82239
82239
|
const emptyText$4 = "_emptyText_rt5b7_99";
|
|
82240
|
-
const field$
|
|
82240
|
+
const field$c = "_field_rt5b7_106";
|
|
82241
82241
|
const advancedToggle$1 = "_advancedToggle_rt5b7_123";
|
|
82242
82242
|
const advancedGrid = "_advancedGrid_rt5b7_133";
|
|
82243
82243
|
const segmentedGroup = "_segmentedGroup_rt5b7_139";
|
|
@@ -82258,7 +82258,7 @@ const styles$1x = {
|
|
|
82258
82258
|
srOnly: srOnly$4,
|
|
82259
82259
|
checkboxLabel: checkboxLabel$2,
|
|
82260
82260
|
emptyText: emptyText$4,
|
|
82261
|
-
field: field$
|
|
82261
|
+
field: field$c,
|
|
82262
82262
|
advancedToggle: advancedToggle$1,
|
|
82263
82263
|
advancedGrid,
|
|
82264
82264
|
segmentedGroup,
|
|
@@ -82339,7 +82339,7 @@ const modeName = "_modeName_y11mn_248";
|
|
|
82339
82339
|
const modeDescription = "_modeDescription_y11mn_254";
|
|
82340
82340
|
const modeNote = "_modeNote_y11mn_261";
|
|
82341
82341
|
const custom = "_custom_y11mn_268";
|
|
82342
|
-
const field$
|
|
82342
|
+
const field$b = "_field_y11mn_273";
|
|
82343
82343
|
const customNote = "_customNote_y11mn_280";
|
|
82344
82344
|
const advanced = "_advanced_y11mn_294";
|
|
82345
82345
|
const advancedHead = "_advancedHead_y11mn_299";
|
|
@@ -82387,7 +82387,7 @@ const styles$1w = {
|
|
|
82387
82387
|
modeDescription,
|
|
82388
82388
|
modeNote,
|
|
82389
82389
|
custom,
|
|
82390
|
-
field: field$
|
|
82390
|
+
field: field$b,
|
|
82391
82391
|
customNote,
|
|
82392
82392
|
advanced,
|
|
82393
82393
|
advancedHead,
|
|
@@ -82411,7 +82411,7 @@ const styles$1w = {
|
|
|
82411
82411
|
footActions,
|
|
82412
82412
|
close: close$3
|
|
82413
82413
|
};
|
|
82414
|
-
const log$
|
|
82414
|
+
const log$E = createLogger("SessionModelSelector");
|
|
82415
82415
|
function modeOrder(isGroup) {
|
|
82416
82416
|
return isGroup ? ["group", "agents", "override"] : ["group", "override"];
|
|
82417
82417
|
}
|
|
@@ -82574,7 +82574,7 @@ function SessionModelSelector({
|
|
|
82574
82574
|
setMode(selectionMode(override, isGroup));
|
|
82575
82575
|
setEffective(settings);
|
|
82576
82576
|
} catch (error2) {
|
|
82577
|
-
log$
|
|
82577
|
+
log$E.warn("load session model selection failed:", error2);
|
|
82578
82578
|
}
|
|
82579
82579
|
}, [actor, isGroup, sessionId]);
|
|
82580
82580
|
reactExports.useEffect(() => {
|
|
@@ -82598,7 +82598,7 @@ function SessionModelSelector({
|
|
|
82598
82598
|
await load();
|
|
82599
82599
|
return true;
|
|
82600
82600
|
} catch (error2) {
|
|
82601
|
-
log$
|
|
82601
|
+
log$E.warn("write session model selection failed:", error2);
|
|
82602
82602
|
toast$3.error(t("model.sessionSelector.saveFailed"));
|
|
82603
82603
|
return false;
|
|
82604
82604
|
} finally {
|
|
@@ -83861,7 +83861,7 @@ function ChatNotification({ message: message2 }) {
|
|
|
83861
83861
|
}
|
|
83862
83862
|
const NO_CHANNEL_CODES = /* @__PURE__ */ new Set(["ERROR_NO_DEFAULT_CHANNEL", "ERROR_LLM_CHANNEL_NOT_FOUND"]);
|
|
83863
83863
|
const MODEL_UNAVAILABLE_CODE = "ERROR_LLM_MODEL_UNAVAILABLE";
|
|
83864
|
-
const log$
|
|
83864
|
+
const log$D = createLogger("useOptimizeDescription");
|
|
83865
83865
|
function useOptimizeDescription() {
|
|
83866
83866
|
const { t } = useTranslation();
|
|
83867
83867
|
const [isOptimizing, setIsOptimizing] = reactExports.useState(false);
|
|
@@ -83877,7 +83877,7 @@ function useOptimizeDescription() {
|
|
|
83877
83877
|
);
|
|
83878
83878
|
onSuccess(optimized);
|
|
83879
83879
|
} catch (err) {
|
|
83880
|
-
log$
|
|
83880
|
+
log$D.error("优化失败:", err);
|
|
83881
83881
|
const message2 = readableRpcError(err).trim();
|
|
83882
83882
|
const separator2 = message2.indexOf(":");
|
|
83883
83883
|
const code2 = separator2 >= 0 ? message2.slice(0, separator2) : message2;
|
|
@@ -84079,7 +84079,7 @@ function useAgentSave() {
|
|
|
84079
84079
|
}
|
|
84080
84080
|
const header$o = "_header_1if1m_1";
|
|
84081
84081
|
const form$1 = "_form_1if1m_13";
|
|
84082
|
-
const field$
|
|
84082
|
+
const field$a = "_field_1if1m_19";
|
|
84083
84083
|
const labelRow = "_labelRow_1if1m_31";
|
|
84084
84084
|
const actions$f = "_actions_1if1m_65";
|
|
84085
84085
|
const actionButtons = "_actionButtons_1if1m_73";
|
|
@@ -84092,7 +84092,7 @@ const dismissError = "_dismissError_1if1m_156";
|
|
|
84092
84092
|
const styles$1s = {
|
|
84093
84093
|
header: header$o,
|
|
84094
84094
|
form: form$1,
|
|
84095
|
-
field: field$
|
|
84095
|
+
field: field$a,
|
|
84096
84096
|
labelRow,
|
|
84097
84097
|
actions: actions$f,
|
|
84098
84098
|
actionButtons,
|
|
@@ -84103,7 +84103,7 @@ const styles$1s = {
|
|
|
84103
84103
|
inlineError: inlineError$1,
|
|
84104
84104
|
dismissError
|
|
84105
84105
|
};
|
|
84106
|
-
const log$
|
|
84106
|
+
const log$C = createLogger("externalFullAccessAck");
|
|
84107
84107
|
function isExternalFullAccessAcknowledged(settings) {
|
|
84108
84108
|
const acknowledgedAt = settings?.externalFullAccessAcknowledgedAt;
|
|
84109
84109
|
return typeof acknowledgedAt === "string" && acknowledgedAt.length > 0;
|
|
@@ -84114,7 +84114,7 @@ async function acknowledgeExternalFullAccess() {
|
|
|
84114
84114
|
externalFullAccessAcknowledgedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
84115
84115
|
});
|
|
84116
84116
|
} catch (error2) {
|
|
84117
|
-
log$
|
|
84117
|
+
log$C.warn("Failed to persist external full access acknowledgement:", error2);
|
|
84118
84118
|
}
|
|
84119
84119
|
}
|
|
84120
84120
|
const section$8 = "_section_ah5s1_1";
|
|
@@ -84129,7 +84129,7 @@ const selectedCard = "_selectedCard_ah5s1_37";
|
|
|
84129
84129
|
const codexFields = "_codexFields_ah5s1_58";
|
|
84130
84130
|
const hint$7 = "_hint_ah5s1_59";
|
|
84131
84131
|
const launchArgsInput = "_launchArgsInput_ah5s1_97";
|
|
84132
|
-
const field$
|
|
84132
|
+
const field$9 = "_field_ah5s1_104";
|
|
84133
84133
|
const acpConfigReadRow = "_acpConfigReadRow_ah5s1_112";
|
|
84134
84134
|
const readButton = "_readButton_ah5s1_118";
|
|
84135
84135
|
const summary$5 = "_summary_ah5s1_136";
|
|
@@ -84155,7 +84155,7 @@ const styles$1r = {
|
|
|
84155
84155
|
codexFields,
|
|
84156
84156
|
hint: hint$7,
|
|
84157
84157
|
launchArgsInput,
|
|
84158
|
-
field: field$
|
|
84158
|
+
field: field$9,
|
|
84159
84159
|
acpConfigReadRow,
|
|
84160
84160
|
readButton,
|
|
84161
84161
|
summary: summary$5,
|
|
@@ -86257,7 +86257,7 @@ const formBody$1 = "_formBody_tgbsv_24";
|
|
|
86257
86257
|
const titleLabel = "_titleLabel_tgbsv_36";
|
|
86258
86258
|
const titleInput = "_titleInput_tgbsv_44";
|
|
86259
86259
|
const selectInput = "_selectInput_tgbsv_67";
|
|
86260
|
-
const fieldHint$
|
|
86260
|
+
const fieldHint$3 = "_fieldHint_tgbsv_81";
|
|
86261
86261
|
const body$b = "_body_tgbsv_96";
|
|
86262
86262
|
const searchRow$1 = "_searchRow_tgbsv_106";
|
|
86263
86263
|
const searchIcon$5 = "_searchIcon_tgbsv_123";
|
|
@@ -86295,7 +86295,7 @@ const styles$1o = {
|
|
|
86295
86295
|
titleLabel,
|
|
86296
86296
|
titleInput,
|
|
86297
86297
|
selectInput,
|
|
86298
|
-
fieldHint: fieldHint$
|
|
86298
|
+
fieldHint: fieldHint$3,
|
|
86299
86299
|
body: body$b,
|
|
86300
86300
|
searchRow: searchRow$1,
|
|
86301
86301
|
searchIcon: searchIcon$5,
|
|
@@ -86327,7 +86327,7 @@ const styles$1o = {
|
|
|
86327
86327
|
footHintBlocked,
|
|
86328
86328
|
groupEdit
|
|
86329
86329
|
};
|
|
86330
|
-
const log$
|
|
86330
|
+
const log$B = createLogger("GroupChatCreateDialog");
|
|
86331
86331
|
function describeSubmitFailure(error2, t) {
|
|
86332
86332
|
const message2 = error2 instanceof Error ? error2.message : String(error2);
|
|
86333
86333
|
if (message2.includes("GROUP_RUNTIME_BLOCKED")) {
|
|
@@ -86441,7 +86441,7 @@ function GroupChatCreateDialog({
|
|
|
86441
86441
|
if (editGroupId) {
|
|
86442
86442
|
const name2 = title2 || nameFallback;
|
|
86443
86443
|
if (!name2) {
|
|
86444
|
-
log$
|
|
86444
|
+
log$B.error("Cannot edit group: no name source", { groupId: editGroupId });
|
|
86445
86445
|
return;
|
|
86446
86446
|
}
|
|
86447
86447
|
const speakerId = defaultAgentId ?? pickDefaultAgent(selectedAgentIds, executionKinds);
|
|
@@ -86481,7 +86481,7 @@ function GroupChatCreateDialog({
|
|
|
86481
86481
|
try {
|
|
86482
86482
|
await submitForm();
|
|
86483
86483
|
} catch (error2) {
|
|
86484
|
-
log$
|
|
86484
|
+
log$B.error("Group create/update failed", { error: error2 });
|
|
86485
86485
|
setSubmitError(describeSubmitFailure(error2, t));
|
|
86486
86486
|
}
|
|
86487
86487
|
});
|
|
@@ -87388,14 +87388,14 @@ function SettingsPanelHeader({
|
|
|
87388
87388
|
] })
|
|
87389
87389
|
] });
|
|
87390
87390
|
}
|
|
87391
|
-
const field$
|
|
87391
|
+
const field$8 = "_field_1v49q_1";
|
|
87392
87392
|
const row$4 = "_row_1v49q_12";
|
|
87393
87393
|
const label$9 = "_label_1v49q_18";
|
|
87394
87394
|
const labelColumn = "_labelColumn_1v49q_28";
|
|
87395
87395
|
const hint$6 = "_hint_1v49q_35";
|
|
87396
87396
|
const error$d = "_error_1v49q_36";
|
|
87397
87397
|
const styles$1j = {
|
|
87398
|
-
field: field$
|
|
87398
|
+
field: field$8,
|
|
87399
87399
|
row: row$4,
|
|
87400
87400
|
label: label$9,
|
|
87401
87401
|
labelColumn,
|
|
@@ -90117,7 +90117,7 @@ function applyPluginThemeState(state2) {
|
|
|
90117
90117
|
}
|
|
90118
90118
|
rerender();
|
|
90119
90119
|
}
|
|
90120
|
-
const log$
|
|
90120
|
+
const log$A = createLogger("AppSettingsPanel");
|
|
90121
90121
|
const DEFAULT_WINDOW_CLOSE_ACTION = "ask";
|
|
90122
90122
|
function AppSettingsPanel({
|
|
90123
90123
|
onClose,
|
|
@@ -90293,7 +90293,7 @@ function AppSettingsPanel({
|
|
|
90293
90293
|
setSettingsLoaded(true);
|
|
90294
90294
|
}).catch((error2) => {
|
|
90295
90295
|
if (cancelled) return;
|
|
90296
|
-
log$
|
|
90296
|
+
log$A.error("Failed to load app settings:", error2);
|
|
90297
90297
|
toast$3.error(error2 instanceof Error ? error2.message : "读取设置失败");
|
|
90298
90298
|
});
|
|
90299
90299
|
return () => {
|
|
@@ -90306,7 +90306,7 @@ function AppSettingsPanel({
|
|
|
90306
90306
|
if (!cancelled) setTelemetryEnabled(enabled);
|
|
90307
90307
|
}).catch((error2) => {
|
|
90308
90308
|
if (cancelled) return;
|
|
90309
|
-
log$
|
|
90309
|
+
log$A.error("Failed to load telemetry setting:", error2);
|
|
90310
90310
|
});
|
|
90311
90311
|
return () => {
|
|
90312
90312
|
cancelled = true;
|
|
@@ -90322,7 +90322,7 @@ function AppSettingsPanel({
|
|
|
90322
90322
|
if (!cancelled) setNightlyMemoryAgentOff(!config.agentScope.enabled);
|
|
90323
90323
|
}).catch((error2) => {
|
|
90324
90324
|
if (cancelled) return;
|
|
90325
|
-
log$
|
|
90325
|
+
log$A.warn("Failed to read nightly memory config:", error2);
|
|
90326
90326
|
});
|
|
90327
90327
|
return () => {
|
|
90328
90328
|
cancelled = true;
|
|
@@ -90341,7 +90341,7 @@ function AppSettingsPanel({
|
|
|
90341
90341
|
setPluginThemeProvidesAccent(state2.active && state2.providesAccent);
|
|
90342
90342
|
applyPluginThemeState(state2);
|
|
90343
90343
|
} catch (error2) {
|
|
90344
|
-
log$
|
|
90344
|
+
log$A.error("Failed to load plugin themes:", error2);
|
|
90345
90345
|
}
|
|
90346
90346
|
}, []);
|
|
90347
90347
|
reactExports.useEffect(() => {
|
|
@@ -90366,7 +90366,7 @@ function AppSettingsPanel({
|
|
|
90366
90366
|
await refreshPluginTheme();
|
|
90367
90367
|
} catch (error2) {
|
|
90368
90368
|
if (changeId !== pluginThemeChangeIdRef.current) return;
|
|
90369
|
-
log$
|
|
90369
|
+
log$A.error("Failed to save plugin theme setting:", error2);
|
|
90370
90370
|
pluginThemeNeedsRetryRef.current = true;
|
|
90371
90371
|
setHasChanges(true);
|
|
90372
90372
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.saveFailed"));
|
|
@@ -90378,7 +90378,7 @@ function AppSettingsPanel({
|
|
|
90378
90378
|
try {
|
|
90379
90379
|
await getTransport().openDataDirInExplorer();
|
|
90380
90380
|
} catch (error2) {
|
|
90381
|
-
log$
|
|
90381
|
+
log$A.error("Failed to open the data directory:", error2);
|
|
90382
90382
|
toast$3.error(
|
|
90383
90383
|
error2 instanceof Error ? error2.message : t("settings.appSettings.appearance.openDirectoryFailed")
|
|
90384
90384
|
);
|
|
@@ -90409,7 +90409,7 @@ function AppSettingsPanel({
|
|
|
90409
90409
|
setHasChanges(hasPendingChanges());
|
|
90410
90410
|
} catch (error2) {
|
|
90411
90411
|
if (changeId !== themeChangeIdRef.current) return;
|
|
90412
|
-
log$
|
|
90412
|
+
log$A.error("Failed to save theme setting:", error2);
|
|
90413
90413
|
themeNeedsRetryRef.current = true;
|
|
90414
90414
|
setHasChanges(true);
|
|
90415
90415
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.saveFailed"));
|
|
@@ -90444,7 +90444,7 @@ function AppSettingsPanel({
|
|
|
90444
90444
|
setHasChanges(hasPendingChanges());
|
|
90445
90445
|
} catch (error2) {
|
|
90446
90446
|
if (changeId !== accentThemeChangeIdRef.current) return;
|
|
90447
|
-
log$
|
|
90447
|
+
log$A.error("Failed to save accent theme setting:", error2);
|
|
90448
90448
|
accentThemeNeedsRetryRef.current = true;
|
|
90449
90449
|
setHasChanges(true);
|
|
90450
90450
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.saveFailed"));
|
|
@@ -90467,7 +90467,7 @@ function AppSettingsPanel({
|
|
|
90467
90467
|
persistedContentWidthRef.current = next;
|
|
90468
90468
|
} catch (error2) {
|
|
90469
90469
|
if (changeId !== contentWidthChangeIdRef.current) return;
|
|
90470
|
-
log$
|
|
90470
|
+
log$A.error("Failed to save content width setting:", error2);
|
|
90471
90471
|
setContentWidthState(persistedContentWidthRef.current);
|
|
90472
90472
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.saveFailed"));
|
|
90473
90473
|
} finally {
|
|
@@ -90484,7 +90484,7 @@ function AppSettingsPanel({
|
|
|
90484
90484
|
try {
|
|
90485
90485
|
await getTransport().saveSettings({ ui: { renderUserMessageMarkdown: enabled } });
|
|
90486
90486
|
} catch (error2) {
|
|
90487
|
-
log$
|
|
90487
|
+
log$A.error("Failed to save renderUserMessageMarkdown setting:", error2);
|
|
90488
90488
|
setRenderUserMessageMarkdownState(!enabled);
|
|
90489
90489
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.saveFailed"));
|
|
90490
90490
|
} finally {
|
|
@@ -90607,7 +90607,7 @@ function AppSettingsPanel({
|
|
|
90607
90607
|
}
|
|
90608
90608
|
setTelemetryEnabled(savedEnabled);
|
|
90609
90609
|
} catch (error2) {
|
|
90610
|
-
log$
|
|
90610
|
+
log$A.error("Failed to save telemetry setting:", error2);
|
|
90611
90611
|
setTelemetryEnabled(previousEnabled);
|
|
90612
90612
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.saveFailed"));
|
|
90613
90613
|
} finally {
|
|
@@ -90677,7 +90677,7 @@ function AppSettingsPanel({
|
|
|
90677
90677
|
setHasChanges(false);
|
|
90678
90678
|
onClose();
|
|
90679
90679
|
} catch (error2) {
|
|
90680
|
-
log$
|
|
90680
|
+
log$A.error("Failed to save app settings:", error2);
|
|
90681
90681
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.saveFailed"));
|
|
90682
90682
|
setSettingsSaving(false);
|
|
90683
90683
|
}
|
|
@@ -91392,14 +91392,14 @@ const identityHeader = "_identityHeader_11u66_48";
|
|
|
91392
91392
|
const identityHeaderCopy = "_identityHeaderCopy_11u66_57";
|
|
91393
91393
|
const identityHeaderTitle = "_identityHeaderTitle_11u66_61";
|
|
91394
91394
|
const identityHeaderHint = "_identityHeaderHint_11u66_67";
|
|
91395
|
-
const field$
|
|
91395
|
+
const field$7 = "_field_11u66_74";
|
|
91396
91396
|
const fieldHeader = "_fieldHeader_11u66_81";
|
|
91397
91397
|
const label$7 = "_label_11u66_87";
|
|
91398
91398
|
const selectedCount$1 = "_selectedCount_11u66_93";
|
|
91399
91399
|
const input$6 = "_input_11u66_98";
|
|
91400
91400
|
const textarea$2 = "_textarea_11u66_99";
|
|
91401
91401
|
const optimizeBtn = "_optimizeBtn_11u66_129";
|
|
91402
|
-
const fieldHint$
|
|
91402
|
+
const fieldHint$2 = "_fieldHint_11u66_151";
|
|
91403
91403
|
const advancedSection = "_advancedSection_11u66_157";
|
|
91404
91404
|
const advancedHeader = "_advancedHeader_11u66_164";
|
|
91405
91405
|
const advancedIcon = "_advancedIcon_11u66_184";
|
|
@@ -91468,14 +91468,14 @@ const styles$19 = {
|
|
|
91468
91468
|
identityHeaderCopy,
|
|
91469
91469
|
identityHeaderTitle,
|
|
91470
91470
|
identityHeaderHint,
|
|
91471
|
-
field: field$
|
|
91471
|
+
field: field$7,
|
|
91472
91472
|
fieldHeader,
|
|
91473
91473
|
label: label$7,
|
|
91474
91474
|
selectedCount: selectedCount$1,
|
|
91475
91475
|
input: input$6,
|
|
91476
91476
|
textarea: textarea$2,
|
|
91477
91477
|
optimizeBtn,
|
|
91478
|
-
fieldHint: fieldHint$
|
|
91478
|
+
fieldHint: fieldHint$2,
|
|
91479
91479
|
advancedSection,
|
|
91480
91480
|
advancedHeader,
|
|
91481
91481
|
advancedIcon,
|
|
@@ -93751,7 +93751,7 @@ function ConfirmDeleteDialog({
|
|
|
93751
93751
|
}
|
|
93752
93752
|
);
|
|
93753
93753
|
}
|
|
93754
|
-
const log$
|
|
93754
|
+
const log$z = createLogger("AgentPanel");
|
|
93755
93755
|
function AgentPanel({
|
|
93756
93756
|
onClose: _onClose,
|
|
93757
93757
|
initialAgentId,
|
|
@@ -93773,7 +93773,7 @@ function AgentPanel({
|
|
|
93773
93773
|
}, [loadAgents]);
|
|
93774
93774
|
reactExports.useEffect(() => {
|
|
93775
93775
|
if (agents.length === 0) return;
|
|
93776
|
-
preloadAllConfigs().catch((e) => log$
|
|
93776
|
+
preloadAllConfigs().catch((e) => log$z.error("Load agent configs failed:", e));
|
|
93777
93777
|
}, [agents, preloadAllConfigs]);
|
|
93778
93778
|
reactExports.useEffect(() => {
|
|
93779
93779
|
if (!initialAgentId || agents.length === 0) return;
|
|
@@ -96598,7 +96598,7 @@ function RemoteTabs({ activeTab, accessState, a2aState, onTabChange }) {
|
|
|
96598
96598
|
);
|
|
96599
96599
|
}) });
|
|
96600
96600
|
}
|
|
96601
|
-
const log$
|
|
96601
|
+
const log$y = createLogger("RemoteAccessPanel");
|
|
96602
96602
|
const DEFAULT_PORT = 9527;
|
|
96603
96603
|
const POLL_INTERVAL$1 = 5e3;
|
|
96604
96604
|
const DEFAULT_A2A_STATUS = {
|
|
@@ -96678,7 +96678,7 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96678
96678
|
}, [maxConnectionsDirty]);
|
|
96679
96679
|
reactExports.useEffect(() => {
|
|
96680
96680
|
loadStatus().catch((error2) => {
|
|
96681
|
-
log$
|
|
96681
|
+
log$y.error("Failed to load remote access status:", error2);
|
|
96682
96682
|
}).finally(() => {
|
|
96683
96683
|
setLoading(false);
|
|
96684
96684
|
});
|
|
@@ -96687,13 +96687,13 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96687
96687
|
if (!status2.enabled && status2.status === "disabled") return;
|
|
96688
96688
|
const timer2 = window.setInterval(() => {
|
|
96689
96689
|
loadStatus().catch((error2) => {
|
|
96690
|
-
log$
|
|
96690
|
+
log$y.error("Failed to poll remote access status:", error2);
|
|
96691
96691
|
});
|
|
96692
96692
|
}, POLL_INTERVAL$1);
|
|
96693
96693
|
return () => window.clearInterval(timer2);
|
|
96694
96694
|
}, [loadStatus, status2.enabled, status2.status]);
|
|
96695
96695
|
reactExports.useEffect(() => {
|
|
96696
|
-
getTransport().listAgents().then((list2) => setA2aAgents(list2.map((agent2) => ({ id: agent2.id, name: agent2.name })))).catch((error2) => log$
|
|
96696
|
+
getTransport().listAgents().then((list2) => setA2aAgents(list2.map((agent2) => ({ id: agent2.id, name: agent2.name })))).catch((error2) => log$y.warn("Failed to load agents for A2A card:", error2));
|
|
96697
96697
|
}, []);
|
|
96698
96698
|
reactExports.useEffect(() => {
|
|
96699
96699
|
if (!accessUrl) {
|
|
@@ -96704,7 +96704,7 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96704
96704
|
width: 200,
|
|
96705
96705
|
margin: 1
|
|
96706
96706
|
}).then(setQrCodeUrl).catch((error2) => {
|
|
96707
|
-
log$
|
|
96707
|
+
log$y.error("Failed to generate remote access QR code:", error2);
|
|
96708
96708
|
setQrCodeUrl("");
|
|
96709
96709
|
});
|
|
96710
96710
|
}, [accessUrl]);
|
|
@@ -96729,12 +96729,12 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96729
96729
|
await getTransport().remoteAccessStart(DEFAULT_PORT);
|
|
96730
96730
|
await loadStatus();
|
|
96731
96731
|
} catch (error2) {
|
|
96732
|
-
log$
|
|
96732
|
+
log$y.error("Failed to toggle remote access:", error2);
|
|
96733
96733
|
toast$3.error(
|
|
96734
96734
|
error2 instanceof Error ? error2.message : t("settings.remote.errors.toggleFailed")
|
|
96735
96735
|
);
|
|
96736
96736
|
await loadStatus().catch(
|
|
96737
|
-
(err) => log$
|
|
96737
|
+
(err) => log$y.warn("Failed to refresh status after toggle error:", err)
|
|
96738
96738
|
);
|
|
96739
96739
|
} finally {
|
|
96740
96740
|
setToggling(false);
|
|
@@ -96748,12 +96748,12 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96748
96748
|
await loadStatus();
|
|
96749
96749
|
toast$3.success(t("settings.remote.rotateSuccess"));
|
|
96750
96750
|
} catch (error2) {
|
|
96751
|
-
log$
|
|
96751
|
+
log$y.error("Failed to rotate remote access link:", error2);
|
|
96752
96752
|
toast$3.error(
|
|
96753
96753
|
error2 instanceof Error ? error2.message : t("settings.remote.errors.rotateFailed")
|
|
96754
96754
|
);
|
|
96755
96755
|
await loadStatus().catch(
|
|
96756
|
-
(err) => log$
|
|
96756
|
+
(err) => log$y.warn("Failed to refresh status after rotate error:", err)
|
|
96757
96757
|
);
|
|
96758
96758
|
} finally {
|
|
96759
96759
|
setRotating(false);
|
|
@@ -96765,7 +96765,7 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96765
96765
|
await copyToClipboard(accessUrl, { sensitive: true });
|
|
96766
96766
|
setCopied(true);
|
|
96767
96767
|
} catch (error2) {
|
|
96768
|
-
log$
|
|
96768
|
+
log$y.error("Failed to copy remote access link:", error2);
|
|
96769
96769
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.remote.errors.copyFailed"));
|
|
96770
96770
|
}
|
|
96771
96771
|
};
|
|
@@ -96789,7 +96789,7 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96789
96789
|
await loadStatus();
|
|
96790
96790
|
toast$3.success(t("settings.remote.maxConnectionsSaved"));
|
|
96791
96791
|
} catch (error2) {
|
|
96792
|
-
log$
|
|
96792
|
+
log$y.error("Failed to save remote access max connections:", error2);
|
|
96793
96793
|
toast$3.error(
|
|
96794
96794
|
error2 instanceof Error ? error2.message : t("settings.remote.errors.maxConnectionsFailed")
|
|
96795
96795
|
);
|
|
@@ -96804,12 +96804,12 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96804
96804
|
await loadStatus();
|
|
96805
96805
|
toast$3.success(t("settings.remote.disconnectClientSuccess"));
|
|
96806
96806
|
} catch (error2) {
|
|
96807
|
-
log$
|
|
96807
|
+
log$y.error("Failed to disconnect remote access client:", error2);
|
|
96808
96808
|
toast$3.error(
|
|
96809
96809
|
error2 instanceof Error ? error2.message : t("settings.remote.errors.disconnectClientFailed")
|
|
96810
96810
|
);
|
|
96811
96811
|
await loadStatus().catch(
|
|
96812
|
-
(err) => log$
|
|
96812
|
+
(err) => log$y.warn("Failed to refresh status after disconnect error:", err)
|
|
96813
96813
|
);
|
|
96814
96814
|
} finally {
|
|
96815
96815
|
setDisconnectingClientId(null);
|
|
@@ -96827,12 +96827,12 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96827
96827
|
}
|
|
96828
96828
|
await loadStatus();
|
|
96829
96829
|
} catch (error2) {
|
|
96830
|
-
log$
|
|
96830
|
+
log$y.error("Failed to toggle A2A service:", error2);
|
|
96831
96831
|
toast$3.error(
|
|
96832
96832
|
error2 instanceof Error ? error2.message : t("settings.remote.a2a.errors.toggleFailed")
|
|
96833
96833
|
);
|
|
96834
96834
|
await loadStatus().catch(
|
|
96835
|
-
(err) => log$
|
|
96835
|
+
(err) => log$y.warn("Failed to refresh status after A2A toggle error:", err)
|
|
96836
96836
|
);
|
|
96837
96837
|
} finally {
|
|
96838
96838
|
setA2aBusy(false);
|
|
@@ -96845,7 +96845,7 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96845
96845
|
await copyToClipboard(cardUrl, { sensitive: false });
|
|
96846
96846
|
setCopiedCardUrl(true);
|
|
96847
96847
|
} catch (error2) {
|
|
96848
|
-
log$
|
|
96848
|
+
log$y.error("Failed to copy A2A card url:", error2);
|
|
96849
96849
|
toast$3.error(error2 instanceof Error ? error2.message : t("settings.remote.errors.copyFailed"));
|
|
96850
96850
|
}
|
|
96851
96851
|
};
|
|
@@ -96855,7 +96855,7 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96855
96855
|
await copyToClipboard(a2aToken, { sensitive: true });
|
|
96856
96856
|
toast$3.success(t("settings.remote.a2a.tokenCopied"));
|
|
96857
96857
|
} catch (error2) {
|
|
96858
|
-
log$
|
|
96858
|
+
log$y.error("Failed to copy A2A token:", error2);
|
|
96859
96859
|
toast$3.error(
|
|
96860
96860
|
error2 instanceof Error ? error2.message : t("settings.remote.a2a.errors.copyTokenFailed")
|
|
96861
96861
|
);
|
|
@@ -96873,12 +96873,12 @@ function RemoteAccessPanel({ onClose: _onClose }) {
|
|
|
96873
96873
|
await loadStatus();
|
|
96874
96874
|
toast$3.success(t("settings.remote.a2a.agentSwitched"));
|
|
96875
96875
|
} catch (error2) {
|
|
96876
|
-
log$
|
|
96876
|
+
log$y.error("Failed to switch A2A workspace:", error2);
|
|
96877
96877
|
toast$3.error(
|
|
96878
96878
|
error2 instanceof Error ? error2.message : t("settings.remote.a2a.errors.switchAgentFailed")
|
|
96879
96879
|
);
|
|
96880
96880
|
await loadStatus().catch(
|
|
96881
|
-
(err) => log$
|
|
96881
|
+
(err) => log$y.warn("Failed to refresh status after A2A agent switch error:", err)
|
|
96882
96882
|
);
|
|
96883
96883
|
} finally {
|
|
96884
96884
|
setA2aBusy(false);
|
|
@@ -98527,7 +98527,7 @@ function ScheduleEditor({
|
|
|
98527
98527
|
] })
|
|
98528
98528
|
] });
|
|
98529
98529
|
}
|
|
98530
|
-
const log$
|
|
98530
|
+
const log$x = createLogger("CronJobsPanel");
|
|
98531
98531
|
function formatSessionOption$1(session) {
|
|
98532
98532
|
return `${session.title}${session.status === "archived" ? " · 已归档" : ""}`;
|
|
98533
98533
|
}
|
|
@@ -98756,14 +98756,14 @@ function CronJobsPanel({ sessionId }) {
|
|
|
98756
98756
|
try {
|
|
98757
98757
|
await toggleTask(taskId, enabled);
|
|
98758
98758
|
} catch (error2) {
|
|
98759
|
-
log$
|
|
98759
|
+
log$x.error("Failed to toggle task:", error2);
|
|
98760
98760
|
toast$3.error(getErrorMessage(error2));
|
|
98761
98761
|
}
|
|
98762
98762
|
};
|
|
98763
98763
|
const confirmDelete = useConfirmDelete({
|
|
98764
98764
|
onDelete: deleteTask,
|
|
98765
98765
|
onError: (error2) => {
|
|
98766
|
-
log$
|
|
98766
|
+
log$x.error("Failed to delete task:", error2);
|
|
98767
98767
|
toast$3.error(getErrorMessage(error2));
|
|
98768
98768
|
}
|
|
98769
98769
|
});
|
|
@@ -98772,7 +98772,7 @@ function CronJobsPanel({ sessionId }) {
|
|
|
98772
98772
|
await createTask(taskData);
|
|
98773
98773
|
setShowCreateDialog(false);
|
|
98774
98774
|
} catch (error2) {
|
|
98775
|
-
log$
|
|
98775
|
+
log$x.error("Failed to create task:", error2);
|
|
98776
98776
|
toast$3.error(getErrorMessage(error2));
|
|
98777
98777
|
}
|
|
98778
98778
|
};
|
|
@@ -98782,7 +98782,7 @@ function CronJobsPanel({ sessionId }) {
|
|
|
98782
98782
|
await updateTask(editingTask.id, taskData);
|
|
98783
98783
|
setEditingTask(null);
|
|
98784
98784
|
} catch (error2) {
|
|
98785
|
-
log$
|
|
98785
|
+
log$x.error("Failed to update task:", error2);
|
|
98786
98786
|
toast$3.error(getErrorMessage(error2));
|
|
98787
98787
|
}
|
|
98788
98788
|
};
|
|
@@ -100541,7 +100541,7 @@ function WeComIcon({ size: size2 = 24, className }) {
|
|
|
100541
100541
|
/* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "M11.465 3.615a7.865 7.865 0 0 1 7.572 5.738l1.926-.538a9.865 9.865 0 0 0-9.498-7.2c-5.446 0-9.862 4.415-9.862 9.862a9.82 9.82 0 0 0 1.54 5.293l-1.905 4.57h9.022l1.473-.005h.012a9.845 9.845 0 0 0 4.037-.99l-.876-1.797a7.814 7.814 0 0 1-3.205.787l-1.444.005H4.239l1.173-2.815l-.327-.454a7.862 7.862 0 0 1 6.38-12.456Z" })
|
|
100542
100542
|
] });
|
|
100543
100543
|
}
|
|
100544
|
-
const log$
|
|
100544
|
+
const log$w = createLogger("channelStore");
|
|
100545
100545
|
function resetQrState(state2) {
|
|
100546
100546
|
return {
|
|
100547
100547
|
qrCodeUrl: null,
|
|
@@ -100576,7 +100576,7 @@ const useChannelStore = create$1((set, get) => ({
|
|
|
100576
100576
|
const list2 = await getTransport().channelList();
|
|
100577
100577
|
set({ channels: list2, loading: false });
|
|
100578
100578
|
} catch (e) {
|
|
100579
|
-
log$
|
|
100579
|
+
log$w.error("Failed to fetch channels:", e);
|
|
100580
100580
|
set({ loading: false });
|
|
100581
100581
|
}
|
|
100582
100582
|
},
|
|
@@ -100585,7 +100585,7 @@ const useChannelStore = create$1((set, get) => ({
|
|
|
100585
100585
|
const rows2 = await getTransport().listInstalledPlugins();
|
|
100586
100586
|
set({ installedPlugins: rows2 });
|
|
100587
100587
|
} catch (e) {
|
|
100588
|
-
log$
|
|
100588
|
+
log$w.error("Failed to fetch installed plugins:", e);
|
|
100589
100589
|
set({ installedPlugins: [] });
|
|
100590
100590
|
}
|
|
100591
100591
|
},
|
|
@@ -100635,7 +100635,7 @@ const useChannelStore = create$1((set, get) => ({
|
|
|
100635
100635
|
set({ bindConnectionId: result2.connectionId, bindStep: "test" });
|
|
100636
100636
|
return result2.connectionId;
|
|
100637
100637
|
} catch (e) {
|
|
100638
|
-
log$
|
|
100638
|
+
log$w.error("Failed to bind plugin channel:", e);
|
|
100639
100639
|
throw e;
|
|
100640
100640
|
}
|
|
100641
100641
|
}
|
|
@@ -100651,7 +100651,7 @@ const useChannelStore = create$1((set, get) => ({
|
|
|
100651
100651
|
set({ bindConnectionId: result2.connectionId, bindStep: "test" });
|
|
100652
100652
|
return result2.connectionId;
|
|
100653
100653
|
} catch (e) {
|
|
100654
|
-
log$
|
|
100654
|
+
log$w.error("Failed to bind channel:", e);
|
|
100655
100655
|
throw e;
|
|
100656
100656
|
}
|
|
100657
100657
|
},
|
|
@@ -101007,7 +101007,7 @@ function EnumControl({ field: field2, value: value2, disabled: disabled2, descri
|
|
|
101007
101007
|
}
|
|
101008
101008
|
);
|
|
101009
101009
|
}
|
|
101010
|
-
const log$
|
|
101010
|
+
const log$v = createLogger("PluginSettingSubjectPicker");
|
|
101011
101011
|
const SEPARATORS = /[,,;;\s]+/;
|
|
101012
101012
|
function parseSelection(raw) {
|
|
101013
101013
|
const out = [];
|
|
@@ -101039,7 +101039,7 @@ function PluginSettingSubjectPicker({
|
|
|
101039
101039
|
request.then((list2) => {
|
|
101040
101040
|
if (!cancelled) setOptions(list2);
|
|
101041
101041
|
}).catch((error2) => {
|
|
101042
|
-
log$
|
|
101042
|
+
log$v.error("加载选项失败", error2);
|
|
101043
101043
|
if (!cancelled) setFailed(true);
|
|
101044
101044
|
});
|
|
101045
101045
|
return () => {
|
|
@@ -101463,8 +101463,8 @@ const stepDotActive = "_stepDotActive_1ucw6_231";
|
|
|
101463
101463
|
const stepNum = "_stepNum_1ucw6_237";
|
|
101464
101464
|
const stepTitle = "_stepTitle_1ucw6_254";
|
|
101465
101465
|
const stepContent = "_stepContent_1ucw6_259";
|
|
101466
|
-
const field$
|
|
101467
|
-
const fieldHint$
|
|
101466
|
+
const field$6 = "_field_1ucw6_265";
|
|
101467
|
+
const fieldHint$1 = "_fieldHint_1ucw6_277";
|
|
101468
101468
|
const stepActions = "_stepActions_1ucw6_284";
|
|
101469
101469
|
const targetKind = "_targetKind_1ucw6_293";
|
|
101470
101470
|
const kindBtn = "_kindBtn_1ucw6_298";
|
|
@@ -101543,8 +101543,8 @@ const styles$_ = {
|
|
|
101543
101543
|
stepNum,
|
|
101544
101544
|
stepTitle,
|
|
101545
101545
|
stepContent,
|
|
101546
|
-
field: field$
|
|
101547
|
-
fieldHint: fieldHint$
|
|
101546
|
+
field: field$6,
|
|
101547
|
+
fieldHint: fieldHint$1,
|
|
101548
101548
|
stepActions,
|
|
101549
101549
|
targetKind,
|
|
101550
101550
|
kindBtn,
|
|
@@ -101730,7 +101730,7 @@ function PluginChannelCredentialsStep({
|
|
|
101730
101730
|
] })
|
|
101731
101731
|
] });
|
|
101732
101732
|
}
|
|
101733
|
-
const log$
|
|
101733
|
+
const log$u = createLogger("deliveryReviewStore");
|
|
101734
101734
|
class DeliveryReviewActionError extends Error {
|
|
101735
101735
|
constructor(code2, message2) {
|
|
101736
101736
|
super(message2);
|
|
@@ -101778,7 +101778,7 @@ const useDeliveryReviewStore = create$1((set, get) => ({
|
|
|
101778
101778
|
set({ reviews, loading: false, error: null });
|
|
101779
101779
|
} catch (error2) {
|
|
101780
101780
|
if (generation !== requestGeneration) return;
|
|
101781
|
-
log$
|
|
101781
|
+
log$u.error("Failed to fetch delivery reviews:", error2);
|
|
101782
101782
|
set({ loading: false, error: getErrorMessage(error2) });
|
|
101783
101783
|
} finally {
|
|
101784
101784
|
if (activeRequest?.generation === generation) activeRequest = null;
|
|
@@ -101793,7 +101793,7 @@ const useDeliveryReviewStore = create$1((set, get) => ({
|
|
|
101793
101793
|
const recoveryIssue = await getTransport().channelGetDeliveryRecovery();
|
|
101794
101794
|
set({ recoveryIssue, recoveryLoading: false, recoveryError: null });
|
|
101795
101795
|
} catch (error2) {
|
|
101796
|
-
log$
|
|
101796
|
+
log$u.error("Failed to fetch delivery recovery issue:", error2);
|
|
101797
101797
|
set({ recoveryLoading: false, recoveryError: getErrorMessage(error2) });
|
|
101798
101798
|
}
|
|
101799
101799
|
},
|
|
@@ -102400,7 +102400,7 @@ function DeliveryReviewSection({
|
|
|
102400
102400
|
)
|
|
102401
102401
|
] });
|
|
102402
102402
|
}
|
|
102403
|
-
const log$
|
|
102403
|
+
const log$t = createLogger("IntegrationPanel");
|
|
102404
102404
|
function formatCreatedAt(value2, locale) {
|
|
102405
102405
|
return new Intl.DateTimeFormat(locale, {
|
|
102406
102406
|
year: "numeric",
|
|
@@ -102731,7 +102731,7 @@ function EditTargetCard({ channel, onCancel, onDone }) {
|
|
|
102731
102731
|
setGroups(convList);
|
|
102732
102732
|
}
|
|
102733
102733
|
} catch (e) {
|
|
102734
|
-
log$
|
|
102734
|
+
log$t.error("Failed to load target data:", e);
|
|
102735
102735
|
}
|
|
102736
102736
|
}
|
|
102737
102737
|
load();
|
|
@@ -103155,7 +103155,7 @@ function BindFlow() {
|
|
|
103155
103155
|
setGroups(convList);
|
|
103156
103156
|
}
|
|
103157
103157
|
} catch (e) {
|
|
103158
|
-
log$
|
|
103158
|
+
log$t.error("Failed to load target data:", e);
|
|
103159
103159
|
}
|
|
103160
103160
|
}
|
|
103161
103161
|
load();
|
|
@@ -105161,11 +105161,7 @@ const threadStore = "_threadStore_hs7ml_1168";
|
|
|
105161
105161
|
const threadStoreStatus = "_threadStoreStatus_hs7ml_1178";
|
|
105162
105162
|
const threadStoreStatusLabel = "_threadStoreStatusLabel_hs7ml_1185";
|
|
105163
105163
|
const statusBad = "_statusBad_hs7ml_1190";
|
|
105164
|
-
const fieldRow = "_fieldRow_hs7ml_1194";
|
|
105165
|
-
const field$6 = "_field_hs7ml_1194";
|
|
105166
105164
|
const fieldLabel$2 = "_fieldLabel_hs7ml_1207";
|
|
105167
|
-
const fieldHint$1 = "_fieldHint_hs7ml_1213";
|
|
105168
|
-
const textInput = "_textInput_hs7ml_1219";
|
|
105169
105165
|
const tabs$3 = "_tabs_hs7ml_1230";
|
|
105170
105166
|
const tab$6 = "_tab_hs7ml_1007";
|
|
105171
105167
|
const tabActive$6 = "_tabActive_hs7ml_1261";
|
|
@@ -105173,7 +105169,6 @@ const pane$2 = "_pane_hs7ml_1";
|
|
|
105173
105169
|
const locationBanner = "_locationBanner_hs7ml_1273";
|
|
105174
105170
|
const locationBannerText = "_locationBannerText_hs7ml_1284";
|
|
105175
105171
|
const locationBannerLabel = "_locationBannerLabel_hs7ml_1292";
|
|
105176
|
-
const threadStoreConfigured = "_threadStoreConfigured_hs7ml_1298";
|
|
105177
105172
|
const configuredList = "_configuredList_hs7ml_1306";
|
|
105178
105173
|
const configuredRow = "_configuredRow_hs7ml_1315";
|
|
105179
105174
|
const configuredLabel = "_configuredLabel_hs7ml_1322";
|
|
@@ -105265,11 +105260,7 @@ const styles$W = {
|
|
|
105265
105260
|
threadStoreStatus,
|
|
105266
105261
|
threadStoreStatusLabel,
|
|
105267
105262
|
statusBad,
|
|
105268
|
-
fieldRow,
|
|
105269
|
-
field: field$6,
|
|
105270
105263
|
fieldLabel: fieldLabel$2,
|
|
105271
|
-
fieldHint: fieldHint$1,
|
|
105272
|
-
textInput,
|
|
105273
105264
|
tabs: tabs$3,
|
|
105274
105265
|
tab: tab$6,
|
|
105275
105266
|
tabActive: tabActive$6,
|
|
@@ -105277,13 +105268,12 @@ const styles$W = {
|
|
|
105277
105268
|
locationBanner,
|
|
105278
105269
|
locationBannerText,
|
|
105279
105270
|
locationBannerLabel,
|
|
105280
|
-
threadStoreConfigured,
|
|
105281
105271
|
configuredList,
|
|
105282
105272
|
configuredRow,
|
|
105283
105273
|
configuredLabel,
|
|
105284
105274
|
configuredHost
|
|
105285
105275
|
};
|
|
105286
|
-
const log$
|
|
105276
|
+
const log$s = createLogger("DataDirectorySection");
|
|
105287
105277
|
function getPhaseText(t, progress2) {
|
|
105288
105278
|
switch (progress2.phase) {
|
|
105289
105279
|
case "closing_db":
|
|
@@ -105324,7 +105314,7 @@ function DataDirectorySection() {
|
|
|
105324
105314
|
setPendingDataDir(info2.pendingDataDir);
|
|
105325
105315
|
setIsEnvironmentOverride(info2.isEnvironmentOverride);
|
|
105326
105316
|
}).catch((error2) => {
|
|
105327
|
-
if (!cancelled) log$
|
|
105317
|
+
if (!cancelled) log$s.error("Failed to load data directory:", error2);
|
|
105328
105318
|
});
|
|
105329
105319
|
return () => {
|
|
105330
105320
|
cancelled = true;
|
|
@@ -105345,7 +105335,7 @@ function DataDirectorySection() {
|
|
|
105345
105335
|
setMigrateData(true);
|
|
105346
105336
|
setMigrationError(null);
|
|
105347
105337
|
} catch (error2) {
|
|
105348
|
-
log$
|
|
105338
|
+
log$s.error("Failed to select data directory:", error2);
|
|
105349
105339
|
}
|
|
105350
105340
|
}, [dataDir, pendingDataDir, t]);
|
|
105351
105341
|
const handleConfirmChange = reactExports.useCallback(async () => {
|
|
@@ -105371,7 +105361,7 @@ function DataDirectorySection() {
|
|
|
105371
105361
|
);
|
|
105372
105362
|
setSelectedPath(null);
|
|
105373
105363
|
} catch (error2) {
|
|
105374
|
-
log$
|
|
105364
|
+
log$s.error("Failed to change data directory:", error2);
|
|
105375
105365
|
const errorMessage2 = error2 instanceof Error ? error2.message : t("storage.location.unknownError");
|
|
105376
105366
|
setMigrationError(t("storage.location.failed", { error: errorMessage2 }));
|
|
105377
105367
|
toast$3.error(
|
|
@@ -105421,7 +105411,7 @@ function DataDirectorySection() {
|
|
|
105421
105411
|
setPendingDataDir(null);
|
|
105422
105412
|
toast$3.success(t("storage.location.pendingCancelled"));
|
|
105423
105413
|
} catch (error2) {
|
|
105424
|
-
log$
|
|
105414
|
+
log$s.error("Failed to cancel pending data directory:", error2);
|
|
105425
105415
|
toast$3.error(t("storage.location.pendingCancelFailed"));
|
|
105426
105416
|
} finally {
|
|
105427
105417
|
setPendingActionLoading(false);
|
|
@@ -105429,7 +105419,7 @@ function DataDirectorySection() {
|
|
|
105429
105419
|
}, [dataDir, pendingActionLoading, pendingDataDir, t]);
|
|
105430
105420
|
const handleOpenDir = reactExports.useCallback(() => {
|
|
105431
105421
|
getTransport().openDataDirInExplorer().catch((error2) => {
|
|
105432
|
-
log$
|
|
105422
|
+
log$s.error("Failed to open data directory:", error2);
|
|
105433
105423
|
toast$3.error(t("storage.location.openFailed"));
|
|
105434
105424
|
});
|
|
105435
105425
|
}, [t]);
|
|
@@ -105573,7 +105563,7 @@ function DataDirectorySection() {
|
|
|
105573
105563
|
)
|
|
105574
105564
|
] });
|
|
105575
105565
|
}
|
|
105576
|
-
const log$
|
|
105566
|
+
const log$r = createLogger("useStorageOverview");
|
|
105577
105567
|
const DEFAULT_DAYS = {
|
|
105578
105568
|
tool_results: 7,
|
|
105579
105569
|
attachments: 30,
|
|
@@ -105624,7 +105614,7 @@ function useStorageOverview() {
|
|
|
105624
105614
|
setOverviewStale(false);
|
|
105625
105615
|
} catch (err) {
|
|
105626
105616
|
if (!isCurrent(seq, overviewSeqRef)) return;
|
|
105627
|
-
log$
|
|
105617
|
+
log$r.error("Failed to load storage overview:", err);
|
|
105628
105618
|
setError(errorMessage(err));
|
|
105629
105619
|
setOverviewStale(true);
|
|
105630
105620
|
} finally {
|
|
@@ -105645,7 +105635,7 @@ function useStorageOverview() {
|
|
|
105645
105635
|
setUsageStale(false);
|
|
105646
105636
|
} catch (err) {
|
|
105647
105637
|
if (!isCurrent(seq, usageSeqRef)) return;
|
|
105648
|
-
log$
|
|
105638
|
+
log$r.error("Failed to load storage usage:", err);
|
|
105649
105639
|
setUsageError(errorMessage(err));
|
|
105650
105640
|
setUsageStale(true);
|
|
105651
105641
|
} finally {
|
|
@@ -105702,30 +105692,29 @@ function useStorageOverview() {
|
|
|
105702
105692
|
cleanRegion
|
|
105703
105693
|
};
|
|
105704
105694
|
}
|
|
105705
|
-
const log$
|
|
105706
|
-
function
|
|
105707
|
-
const [
|
|
105695
|
+
const log$q = createLogger("ThreadStoreOverview");
|
|
105696
|
+
function useThreadStoreOverview() {
|
|
105697
|
+
const [overview, setOverview] = reactExports.useState(null);
|
|
105708
105698
|
const [failed2, setFailed] = reactExports.useState(false);
|
|
105709
|
-
const
|
|
105710
|
-
const scopeId = scope2?.id;
|
|
105699
|
+
const [unsupported2, setUnsupported] = reactExports.useState(false);
|
|
105711
105700
|
const refresh2 = reactExports.useCallback(async () => {
|
|
105712
105701
|
try {
|
|
105713
|
-
|
|
105714
|
-
await getTransport().getThreadStoreStatus(
|
|
105715
|
-
scopeKind === void 0 || scopeId === void 0 ? void 0 : { kind: scopeKind, id: scopeId }
|
|
105716
|
-
)
|
|
105717
|
-
);
|
|
105702
|
+
setOverview(await getTransport().getThreadStoreOverview() ?? { owners: [] });
|
|
105718
105703
|
setFailed(false);
|
|
105704
|
+
setUnsupported(false);
|
|
105719
105705
|
} catch (error2) {
|
|
105720
|
-
|
|
105706
|
+
if (error2 instanceof Error && error2.message.includes("not available in browser mode")) {
|
|
105707
|
+
setUnsupported(true);
|
|
105708
|
+
return;
|
|
105709
|
+
}
|
|
105710
|
+
log$q.error("Failed to read thread store overview:", error2);
|
|
105721
105711
|
setFailed(true);
|
|
105722
105712
|
}
|
|
105723
|
-
}, [
|
|
105713
|
+
}, []);
|
|
105724
105714
|
reactExports.useEffect(() => {
|
|
105725
|
-
setStatus(null);
|
|
105726
105715
|
void refresh2();
|
|
105727
105716
|
}, [refresh2]);
|
|
105728
|
-
return {
|
|
105717
|
+
return { overview, failed: failed2, unsupported: unsupported2, refresh: refresh2 };
|
|
105729
105718
|
}
|
|
105730
105719
|
function formatBytes(bytes) {
|
|
105731
105720
|
if (bytes <= 0) return "0 B";
|
|
@@ -105998,7 +105987,7 @@ function SessionRetentionDialog({ retention, onClose }) {
|
|
|
105998
105987
|
)
|
|
105999
105988
|
] });
|
|
106000
105989
|
}
|
|
106001
|
-
const log$
|
|
105990
|
+
const log$p = createLogger("useSessionRetention");
|
|
106002
105991
|
const RETENTION_BATCH_SIZE = 25;
|
|
106003
105992
|
function mergeExecutionResults(base, next) {
|
|
106004
105993
|
return {
|
|
@@ -106036,7 +106025,7 @@ function useSessionRetention() {
|
|
|
106036
106025
|
setSelectedIds(defaultSelection(next));
|
|
106037
106026
|
setPhase("ready");
|
|
106038
106027
|
} catch (err) {
|
|
106039
|
-
log$
|
|
106028
|
+
log$p.error("Failed to preview session retention:", err);
|
|
106040
106029
|
setError(err instanceof Error ? err.message : String(err));
|
|
106041
106030
|
setPhase("idle");
|
|
106042
106031
|
}
|
|
@@ -106084,7 +106073,7 @@ function useSessionRetention() {
|
|
|
106084
106073
|
setProgress({ processed, total: ids.length });
|
|
106085
106074
|
}
|
|
106086
106075
|
} catch (err) {
|
|
106087
|
-
log$
|
|
106076
|
+
log$p.error("Failed to execute session retention:", err);
|
|
106088
106077
|
setError(err instanceof Error ? err.message : String(err));
|
|
106089
106078
|
return settle();
|
|
106090
106079
|
}
|
|
@@ -106153,7 +106142,7 @@ const useSessionRegistryFocusStore = create$1((set) => ({
|
|
|
106153
106142
|
requestSeq: 0,
|
|
106154
106143
|
requestFocus: () => set((state2) => ({ requestSeq: state2.requestSeq + 1 }))
|
|
106155
106144
|
}));
|
|
106156
|
-
const log$
|
|
106145
|
+
const log$o = createLogger("sessionRegistryStatus");
|
|
106157
106146
|
function useSessionRegistryStatus() {
|
|
106158
106147
|
const [status2, setStatus] = reactExports.useState(null);
|
|
106159
106148
|
const [failed2, setFailed] = reactExports.useState(false);
|
|
@@ -106165,7 +106154,7 @@ function useSessionRegistryStatus() {
|
|
|
106165
106154
|
setFailed(false);
|
|
106166
106155
|
}).catch((error2) => {
|
|
106167
106156
|
if (cancelled) return;
|
|
106168
|
-
log$
|
|
106157
|
+
log$o.warn("Failed to read session registry status:", error2);
|
|
106169
106158
|
setStatus(null);
|
|
106170
106159
|
setFailed(true);
|
|
106171
106160
|
});
|
|
@@ -106525,7 +106514,7 @@ function toImportSummaryView(raw) {
|
|
|
106525
106514
|
backupPath: asString(record2.backupPath) || null
|
|
106526
106515
|
};
|
|
106527
106516
|
}
|
|
106528
|
-
const log$
|
|
106517
|
+
const log$n = createLogger("MigrationData");
|
|
106529
106518
|
function useMigrationProgress(weights, active2) {
|
|
106530
106519
|
const [progress2, setProgress] = reactExports.useState(null);
|
|
106531
106520
|
const [taskId, setTaskId] = reactExports.useState(null);
|
|
@@ -106559,7 +106548,7 @@ function useChannelAvailability() {
|
|
|
106559
106548
|
void getTransport().listLLMChannels().then((channels) => {
|
|
106560
106549
|
if (!cancelled) setStatus(hasUsableChannel(channels) ? "ready" : "unavailable");
|
|
106561
106550
|
}).catch((error2) => {
|
|
106562
|
-
log$
|
|
106551
|
+
log$n.error("Failed to read LLM channels:", error2);
|
|
106563
106552
|
if (!cancelled) setStatus("checking");
|
|
106564
106553
|
});
|
|
106565
106554
|
return () => {
|
|
@@ -106577,7 +106566,7 @@ function useAvailableBytes(enabled) {
|
|
|
106577
106566
|
void getTransport().getStorageUsage().then((usage) => {
|
|
106578
106567
|
if (!cancelled) setBytes(usage.volume?.availableBytes ?? null);
|
|
106579
106568
|
}).catch((error2) => {
|
|
106580
|
-
log$
|
|
106569
|
+
log$n.error("Failed to read storage volume:", error2);
|
|
106581
106570
|
if (!cancelled) setBytes(null);
|
|
106582
106571
|
});
|
|
106583
106572
|
return () => {
|
|
@@ -106606,7 +106595,7 @@ function useLastImportSummary(enabled = true) {
|
|
|
106606
106595
|
setRaw(summary2);
|
|
106607
106596
|
setStatus("ready");
|
|
106608
106597
|
}).catch((error2) => {
|
|
106609
|
-
log$
|
|
106598
|
+
log$n.error("Failed to read last import summary:", error2);
|
|
106610
106599
|
if (!cancelled) setStatus("error");
|
|
106611
106600
|
});
|
|
106612
106601
|
return () => {
|
|
@@ -106629,7 +106618,7 @@ function usePendingImport(enabled = true) {
|
|
|
106629
106618
|
setState(next);
|
|
106630
106619
|
setStatus("ready");
|
|
106631
106620
|
}).catch((error2) => {
|
|
106632
|
-
log$
|
|
106621
|
+
log$n.error("Failed to inspect pending import:", error2);
|
|
106633
106622
|
if (!cancelled) setStatus("error");
|
|
106634
106623
|
});
|
|
106635
106624
|
return () => {
|
|
@@ -106731,7 +106720,7 @@ const styles$U = {
|
|
|
106731
106720
|
tagList,
|
|
106732
106721
|
spin: spin$7
|
|
106733
106722
|
};
|
|
106734
|
-
const log$
|
|
106723
|
+
const log$m = createLogger("MigrationExport");
|
|
106735
106724
|
const CATEGORY_TEXT_KEYS = {
|
|
106736
106725
|
core: { name: "migration.categories.core.name", note: "migration.categories.core.note" },
|
|
106737
106726
|
conv: { name: "migration.categories.conv.name", note: "migration.categories.conv.note" },
|
|
@@ -106759,7 +106748,7 @@ function useExportPreview(keys2) {
|
|
|
106759
106748
|
cache2.current.set(signature, result2);
|
|
106760
106749
|
setState({ status: "ready", result: result2 });
|
|
106761
106750
|
}).catch((error2) => {
|
|
106762
|
-
log$
|
|
106751
|
+
log$m.error("export-preview failed:", error2);
|
|
106763
106752
|
if (!cancelled) setState({ status: "error", message: readableRpcError(error2) });
|
|
106764
106753
|
});
|
|
106765
106754
|
}, 250);
|
|
@@ -106847,7 +106836,7 @@ function ExportPanel({ onClose }) {
|
|
|
106847
106836
|
});
|
|
106848
106837
|
setPhase("done");
|
|
106849
106838
|
} catch (err) {
|
|
106850
|
-
log$
|
|
106839
|
+
log$m.error("export-start failed:", err);
|
|
106851
106840
|
const classified = classifyMigrationFailure(err);
|
|
106852
106841
|
if (classified.kind === "aborted") {
|
|
106853
106842
|
setPhase("cancelled");
|
|
@@ -106869,7 +106858,7 @@ function ExportPanel({ onClose }) {
|
|
|
106869
106858
|
setStopUnconfirmed(result2.reason === "timeout");
|
|
106870
106859
|
setPhase((current) => current === "stopping" ? "running" : current);
|
|
106871
106860
|
} catch (err) {
|
|
106872
|
-
log$
|
|
106861
|
+
log$m.error("cancel export failed:", err);
|
|
106873
106862
|
setStopUnconfirmed(true);
|
|
106874
106863
|
setPhase((current) => current === "stopping" ? "running" : current);
|
|
106875
106864
|
}
|
|
@@ -106882,7 +106871,7 @@ function ExportPanel({ onClose }) {
|
|
|
106882
106871
|
setTargetPath(picked);
|
|
106883
106872
|
setFieldError(null);
|
|
106884
106873
|
} catch (err) {
|
|
106885
|
-
log$
|
|
106874
|
+
log$m.error("pick target failed:", err);
|
|
106886
106875
|
} finally {
|
|
106887
106876
|
setPicking(false);
|
|
106888
106877
|
}
|
|
@@ -106892,7 +106881,7 @@ function ExportPanel({ onClose }) {
|
|
|
106892
106881
|
await navigator.clipboard.writeText(passphrase);
|
|
106893
106882
|
setCopied(true);
|
|
106894
106883
|
} catch (err) {
|
|
106895
|
-
log$
|
|
106884
|
+
log$m.error("copy passphrase failed:", err);
|
|
106896
106885
|
}
|
|
106897
106886
|
}, [passphrase]);
|
|
106898
106887
|
const handleVerify = reactExports.useCallback(async () => {
|
|
@@ -106901,7 +106890,7 @@ function ExportPanel({ onClose }) {
|
|
|
106901
106890
|
await getTransport().inspect({ path: targetPath.trim(), passphrase });
|
|
106902
106891
|
setVerified("ok");
|
|
106903
106892
|
} catch (err) {
|
|
106904
|
-
log$
|
|
106893
|
+
log$m.error("verify package failed:", err);
|
|
106905
106894
|
setFailure(classifyMigrationFailure(err));
|
|
106906
106895
|
setVerified("failed");
|
|
106907
106896
|
}
|
|
@@ -107366,7 +107355,7 @@ const styles$T = {
|
|
|
107366
107355
|
rebootNote,
|
|
107367
107356
|
spin: spin$6
|
|
107368
107357
|
};
|
|
107369
|
-
const log$
|
|
107358
|
+
const log$l = createLogger("MigrationImport");
|
|
107370
107359
|
const MAX_VISIBLE_CONFLICTS = 50;
|
|
107371
107360
|
const VERIFY_PHASE_WEIGHTS = { verify: [0, 100] };
|
|
107372
107361
|
const STEP_STAGES = [
|
|
@@ -107474,7 +107463,7 @@ function ImportFlow({ onClose }) {
|
|
|
107474
107463
|
const path2 = getTransport().getPathForFile(file);
|
|
107475
107464
|
if (path2) setPackagePath(path2);
|
|
107476
107465
|
} catch (error2) {
|
|
107477
|
-
log$
|
|
107466
|
+
log$l.error("getPathForFile failed:", error2);
|
|
107478
107467
|
}
|
|
107479
107468
|
}, []);
|
|
107480
107469
|
const resetToPass = reactExports.useCallback(() => {
|
|
@@ -107498,7 +107487,7 @@ function ImportFlow({ onClose }) {
|
|
|
107498
107487
|
}
|
|
107499
107488
|
resetToPass();
|
|
107500
107489
|
} catch (error2) {
|
|
107501
|
-
log$
|
|
107490
|
+
log$l.error("cancel verify failed:", error2);
|
|
107502
107491
|
setVerifyStopUnconfirmed(true);
|
|
107503
107492
|
setVerifyStopping(false);
|
|
107504
107493
|
}
|
|
@@ -107539,7 +107528,7 @@ function ImportFlow({ onClose }) {
|
|
|
107539
107528
|
setStep("inspect");
|
|
107540
107529
|
} catch (error2) {
|
|
107541
107530
|
if (verifyRun.current !== run) return;
|
|
107542
|
-
log$
|
|
107531
|
+
log$l.error("inspect failed:", error2);
|
|
107543
107532
|
const failure = classifyMigrationFailure(error2);
|
|
107544
107533
|
if (failure.kind === "passphrase") {
|
|
107545
107534
|
setPassError(null);
|
|
@@ -107568,7 +107557,7 @@ function ImportFlow({ onClose }) {
|
|
|
107568
107557
|
});
|
|
107569
107558
|
if (!outcome.ok) {
|
|
107570
107559
|
const { failure } = outcome;
|
|
107571
|
-
log$
|
|
107560
|
+
log$l.error("apply failed:", failure.code, failure.message);
|
|
107572
107561
|
if (failure.code === "aborted") {
|
|
107573
107562
|
setAbortedBytes(applyFeed.progressRef.current?.doneBytes ?? null);
|
|
107574
107563
|
setAbortRollback(failure.rollback ?? null);
|
|
@@ -107582,7 +107571,7 @@ function ImportFlow({ onClose }) {
|
|
|
107582
107571
|
setStep("restarting");
|
|
107583
107572
|
await getTransport().restart();
|
|
107584
107573
|
} catch (error2) {
|
|
107585
|
-
log$
|
|
107574
|
+
log$l.error("apply call failed:", error2);
|
|
107586
107575
|
const failure = classifyMigrationFailure(error2);
|
|
107587
107576
|
if (failure.kind === "aborted") {
|
|
107588
107577
|
setAbortedBytes(applyFeed.progressRef.current?.doneBytes ?? null);
|
|
@@ -107604,7 +107593,7 @@ function ImportFlow({ onClose }) {
|
|
|
107604
107593
|
try {
|
|
107605
107594
|
await getTransport().openDataDirInExplorer(subpath);
|
|
107606
107595
|
} catch (error2) {
|
|
107607
|
-
log$
|
|
107596
|
+
log$l.error("reveal backup failed:", error2);
|
|
107608
107597
|
}
|
|
107609
107598
|
}, []);
|
|
107610
107599
|
const handleCancelApply = reactExports.useCallback(async () => {
|
|
@@ -107625,7 +107614,7 @@ function ImportFlow({ onClose }) {
|
|
|
107625
107614
|
setApplyStopping(false);
|
|
107626
107615
|
setStep("aborted");
|
|
107627
107616
|
} catch (error2) {
|
|
107628
|
-
log$
|
|
107617
|
+
log$l.error("cancel apply failed:", error2);
|
|
107629
107618
|
setApplyStopUnconfirmed(true);
|
|
107630
107619
|
setApplyStopping(false);
|
|
107631
107620
|
}
|
|
@@ -108141,7 +108130,7 @@ const styles$S = {
|
|
|
108141
108130
|
actions: actions$9,
|
|
108142
108131
|
spin: spin$5
|
|
108143
108132
|
};
|
|
108144
|
-
const log$
|
|
108133
|
+
const log$k = createLogger("MigrationSummary");
|
|
108145
108134
|
function formatTime(value2) {
|
|
108146
108135
|
if (value2 === null) return "—";
|
|
108147
108136
|
const date = new Date(value2);
|
|
@@ -108158,7 +108147,7 @@ function ImportSummarySheet({ onClose }) {
|
|
|
108158
108147
|
try {
|
|
108159
108148
|
await getTransport().openDataDirInExplorer(subpath);
|
|
108160
108149
|
} catch (error2) {
|
|
108161
|
-
log$
|
|
108150
|
+
log$k.error("reveal backup failed:", error2);
|
|
108162
108151
|
}
|
|
108163
108152
|
}, []);
|
|
108164
108153
|
const subtitle2 = summary2 ? [
|
|
@@ -108281,7 +108270,7 @@ const styles$R = {
|
|
|
108281
108270
|
pendingError,
|
|
108282
108271
|
pendingActions
|
|
108283
108272
|
};
|
|
108284
|
-
const log$
|
|
108273
|
+
const log$j = createLogger("MigrationSection");
|
|
108285
108274
|
function formatDateTime$1(value2) {
|
|
108286
108275
|
if (value2 === null) return "—";
|
|
108287
108276
|
const date = new Date(value2);
|
|
@@ -108309,7 +108298,7 @@ function PendingImportBanner({ onSettled }) {
|
|
|
108309
108298
|
}
|
|
108310
108299
|
if (action2 === "continue" && stageBefore === "writing") setNeedsRestart(true);
|
|
108311
108300
|
} catch (error2) {
|
|
108312
|
-
log$
|
|
108301
|
+
log$j.error("pending import action failed:", action2, error2);
|
|
108313
108302
|
setFailure({
|
|
108314
108303
|
code: "pending-action-failed",
|
|
108315
108304
|
message: error2 instanceof Error ? error2.message : String(error2),
|
|
@@ -108542,14 +108531,14 @@ const MANUAL_ORDER = [
|
|
|
108542
108531
|
"group_workspaces",
|
|
108543
108532
|
"other"
|
|
108544
108533
|
];
|
|
108545
|
-
function configOf
|
|
108534
|
+
function configOf(id) {
|
|
108546
108535
|
return REGION_CONFIGS.find((config) => config.id === id);
|
|
108547
108536
|
}
|
|
108548
108537
|
function buildStorageTable(input2) {
|
|
108549
108538
|
const rows2 = [];
|
|
108550
108539
|
let emptyCount = 0;
|
|
108551
108540
|
for (const region of input2.regions) {
|
|
108552
|
-
const config = configOf
|
|
108541
|
+
const config = configOf(region.id);
|
|
108553
108542
|
if (config === void 0) continue;
|
|
108554
108543
|
const days = input2.daysMap[config.id];
|
|
108555
108544
|
const hasRow = region.cleanableBytes > 0 || region.totalBytes > 0;
|
|
@@ -108816,326 +108805,73 @@ function StorageTableRow(props) {
|
|
|
108816
108805
|
] })
|
|
108817
108806
|
] });
|
|
108818
108807
|
}
|
|
108819
|
-
function
|
|
108808
|
+
function ThreadStoreOverviewLine({
|
|
108809
|
+
overview,
|
|
108810
|
+
failed: failed2,
|
|
108811
|
+
unsupported: unsupported2 = false
|
|
108812
|
+
}) {
|
|
108820
108813
|
const { t } = useTranslation();
|
|
108814
|
+
if (unsupported2) {
|
|
108815
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t("storage.location.threadStoreRemoteUnsupported") });
|
|
108816
|
+
}
|
|
108821
108817
|
if (failed2) {
|
|
108822
108818
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.statusBad, children: t("storage.location.threadStoreUnreadable") });
|
|
108823
108819
|
}
|
|
108824
|
-
if (
|
|
108825
|
-
if (
|
|
108826
|
-
|
|
108827
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.statusBad, title: status2.detail, children: t("storage.location.threadStoreInvalid") });
|
|
108820
|
+
if (overview === null) return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t("storage.location.threadStoreLoading") });
|
|
108821
|
+
if (overview.invalid !== void 0) {
|
|
108822
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.statusBad, title: overview.invalid, children: t("storage.location.threadStoreInvalid") });
|
|
108828
108823
|
}
|
|
108829
|
-
|
|
108830
|
-
|
|
108831
|
-
)}`;
|
|
108832
|
-
const bad2 = status2.state !== "connected";
|
|
108833
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: bad2 ? styles$W.statusBad : void 0, title: status2.detail, children: label2 });
|
|
108834
|
-
}
|
|
108835
|
-
const log$g = createLogger("ThreadStoreSettingsBlock");
|
|
108836
|
-
const SECRET_REF = "thread-store-token";
|
|
108837
|
-
const SUBJECT_KINDS = ["agent", "group"];
|
|
108838
|
-
function readSettings(raw) {
|
|
108839
|
-
return typeof raw === "object" && raw !== null && !Array.isArray(raw) ? raw : {};
|
|
108840
|
-
}
|
|
108841
|
-
function configOf(settings, scope2, targetId) {
|
|
108842
|
-
if (scope2 === "default") return settings.default;
|
|
108843
|
-
const table2 = scope2 === SUBJECT_KINDS[0] ? settings.agents : settings.groups;
|
|
108844
|
-
return table2?.[targetId.trim()];
|
|
108845
|
-
}
|
|
108846
|
-
function secretRefFor(scope2, targetId) {
|
|
108847
|
-
return scope2 === "default" ? `${SECRET_REF}:default` : `${SECRET_REF}:${scope2}-${targetId.trim()}`;
|
|
108848
|
-
}
|
|
108849
|
-
function addressOf(endpoint) {
|
|
108850
|
-
try {
|
|
108851
|
-
const parsed = new URL(endpoint);
|
|
108852
|
-
return `${parsed.host}${parsed.pathname}`.replace(/\/+$/, "");
|
|
108853
|
-
} catch {
|
|
108854
|
-
return endpoint;
|
|
108855
|
-
}
|
|
108856
|
-
}
|
|
108857
|
-
function withEntry(settings, scope2, targetId, config) {
|
|
108858
|
-
const next = { ...settings };
|
|
108859
|
-
if (scope2 === "default") {
|
|
108860
|
-
if (config === void 0) delete next.default;
|
|
108861
|
-
else next.default = config;
|
|
108862
|
-
return next;
|
|
108824
|
+
if (overview.owners.length === 0) {
|
|
108825
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t("storage.location.threadStoreAllLocal") });
|
|
108863
108826
|
}
|
|
108864
|
-
const
|
|
108865
|
-
const
|
|
108866
|
-
|
|
108867
|
-
|
|
108868
|
-
|
|
108869
|
-
|
|
108870
|
-
return next;
|
|
108827
|
+
const lines = overview.localLinesTotal ?? 0;
|
|
108828
|
+
const hosts = overview.owners.map((owner) => owner.host).join("\n");
|
|
108829
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { title: hosts, children: [
|
|
108830
|
+
t("storage.location.threadStoreOwners", { count: overview.owners.length }),
|
|
108831
|
+
lines > 0 ? ` · ${t("storage.location.threadStoreLocalLines", { count: lines })}` : ""
|
|
108832
|
+
] });
|
|
108871
108833
|
}
|
|
108834
|
+
const log$i = createLogger("ThreadStoreSettingsBlock");
|
|
108835
|
+
const SUBJECT_KINDS = ["agent", "group"];
|
|
108872
108836
|
function ThreadStoreSettingsBlock() {
|
|
108873
108837
|
const { t } = useTranslation();
|
|
108874
|
-
const [settings, setSettings] = reactExports.useState({});
|
|
108875
|
-
const [scope2, setScope] = reactExports.useState("default");
|
|
108876
|
-
const [targetId, setTargetId] = reactExports.useState("");
|
|
108877
|
-
const [endpoint, setEndpoint] = reactExports.useState("");
|
|
108878
|
-
const [token, setToken] = reactExports.useState("");
|
|
108879
|
-
const [tokenState, setTokenState] = reactExports.useState("absent");
|
|
108880
|
-
const [busy2, setBusy] = reactExports.useState(false);
|
|
108881
|
-
const [presets, setPresets] = reactExports.useState([]);
|
|
108882
|
-
const [presetSource, setPresetSource] = reactExports.useState(null);
|
|
108883
108838
|
const [subjects, setSubjects] = reactExports.useState({
|
|
108884
108839
|
agents: [],
|
|
108885
108840
|
groups: []
|
|
108886
108841
|
});
|
|
108887
|
-
const
|
|
108888
|
-
const secretRef = current?.secretRef ?? secretRefFor(scope2, targetId);
|
|
108889
|
-
const statusScope = scope2 === "default" || targetId.trim() === "" ? void 0 : { kind: scope2, id: targetId.trim() };
|
|
108890
|
-
const { status: status2, failed: statusFailed, refresh: refreshStatus } = useThreadStoreStatus(statusScope);
|
|
108891
|
-
const probeSecret = reactExports.useCallback(async (ref) => {
|
|
108892
|
-
try {
|
|
108893
|
-
setTokenState(await getTransport().hasThreadStoreSecret(ref) ? "present" : "absent");
|
|
108894
|
-
} catch (error2) {
|
|
108895
|
-
log$g.error("Failed to probe thread store secret:", error2);
|
|
108896
|
-
setTokenState("unknown");
|
|
108897
|
-
}
|
|
108898
|
-
}, []);
|
|
108842
|
+
const { overview, failed: failed2, unsupported: unsupported2, refresh: refresh2 } = useThreadStoreOverview();
|
|
108899
108843
|
reactExports.useEffect(() => {
|
|
108900
108844
|
const transport = getTransport();
|
|
108901
|
-
transport.getSettings().then((raw) => {
|
|
108902
|
-
const next = readSettings(raw?.threadStore);
|
|
108903
|
-
setSettings(next);
|
|
108904
|
-
setEndpoint(next.default?.endpoint ?? "");
|
|
108905
|
-
void probeSecret(next.default?.secretRef ?? secretRefFor("default", ""));
|
|
108906
|
-
}).catch((error2) => log$g.error("Failed to read thread store settings:", error2));
|
|
108907
|
-
transport.listThreadStorePresets().then((rows2) => setPresets(Array.isArray(rows2) ? rows2 : [])).catch((error2) => log$g.error("Failed to list thread store presets:", error2));
|
|
108908
108845
|
Promise.all([transport.listAgents(), transport.listGroups()]).then(([agents, groups]) => {
|
|
108909
108846
|
setSubjects({
|
|
108910
108847
|
agents: agents.map((agent2) => ({ id: agent2.id, name: agent2.name })),
|
|
108911
108848
|
groups: groups.map((group2) => ({ id: group2.id, name: group2.name }))
|
|
108912
108849
|
});
|
|
108913
|
-
}).catch((error2) => log$
|
|
108914
|
-
}, [
|
|
108915
|
-
const selectTarget = (nextScope, nextTargetId) => {
|
|
108916
|
-
setScope(nextScope);
|
|
108917
|
-
setTargetId(nextTargetId);
|
|
108918
|
-
const config = configOf(settings, nextScope, nextTargetId);
|
|
108919
|
-
setEndpoint(config?.endpoint ?? "");
|
|
108920
|
-
setToken("");
|
|
108921
|
-
setPresetSource(null);
|
|
108922
|
-
if (nextScope === "default") {
|
|
108923
|
-
void probeSecret(config?.secretRef ?? secretRefFor("default", ""));
|
|
108924
|
-
return;
|
|
108925
|
-
}
|
|
108926
|
-
if (nextTargetId.trim() === "") {
|
|
108927
|
-
setTokenState("absent");
|
|
108928
|
-
return;
|
|
108929
|
-
}
|
|
108930
|
-
void probeSecret(config?.secretRef ?? secretRefFor(nextScope, nextTargetId));
|
|
108931
|
-
};
|
|
108932
|
-
const presetKey = (preset) => `${preset.pluginId}#${preset.presetId}`;
|
|
108933
|
-
const applyPreset = (key) => {
|
|
108934
|
-
const hit = presets.find((preset) => presetKey(preset) === key);
|
|
108935
|
-
if (hit === void 0) return;
|
|
108936
|
-
setEndpoint(hit.endpoint);
|
|
108937
|
-
setPresetSource(hit);
|
|
108938
|
-
};
|
|
108939
|
-
const handleSave = async () => {
|
|
108940
|
-
const trimmed = endpoint.trim().replace(/\/+$/, "");
|
|
108941
|
-
if (trimmed.length === 0) return;
|
|
108942
|
-
if (scope2 !== "default" && targetId.trim().length === 0) return;
|
|
108943
|
-
setBusy(true);
|
|
108944
|
-
try {
|
|
108945
|
-
if (token.trim().length > 0) {
|
|
108946
|
-
await getTransport().saveThreadStoreSecret(secretRef, token.trim());
|
|
108947
|
-
}
|
|
108948
|
-
const next = withEntry(settings, scope2, targetId.trim(), {
|
|
108949
|
-
kind: "http",
|
|
108950
|
-
endpoint: trimmed,
|
|
108951
|
-
secretRef
|
|
108952
|
-
});
|
|
108953
|
-
await getTransport().saveSettings({ threadStore: next });
|
|
108954
|
-
setSettings(next);
|
|
108955
|
-
setToken("");
|
|
108956
|
-
await refreshStatus();
|
|
108957
|
-
await probeSecret(secretRef);
|
|
108958
|
-
} catch (error2) {
|
|
108959
|
-
log$g.error("Failed to save thread store settings:", error2);
|
|
108960
|
-
} finally {
|
|
108961
|
-
setBusy(false);
|
|
108962
|
-
}
|
|
108963
|
-
};
|
|
108964
|
-
const handleRemove = async () => {
|
|
108965
|
-
setBusy(true);
|
|
108966
|
-
try {
|
|
108967
|
-
const next = withEntry(settings, scope2, targetId.trim(), void 0);
|
|
108968
|
-
await getTransport().saveSettings({ threadStore: next });
|
|
108969
|
-
setSettings(next);
|
|
108970
|
-
setEndpoint("");
|
|
108971
|
-
setToken("");
|
|
108972
|
-
setPresetSource(null);
|
|
108973
|
-
setTokenState("absent");
|
|
108974
|
-
await refreshStatus();
|
|
108975
|
-
} catch (error2) {
|
|
108976
|
-
log$g.error("Failed to remove thread store settings:", error2);
|
|
108977
|
-
} finally {
|
|
108978
|
-
setBusy(false);
|
|
108979
|
-
}
|
|
108980
|
-
};
|
|
108981
|
-
const nameOf = (kind2, id) => (kind2 === SUBJECT_KINDS[0] ? subjects.agents : subjects.groups).find((item2) => item2.id === id)?.name ?? id;
|
|
108850
|
+
}).catch((error2) => log$i.error("Failed to load thread store subjects:", error2));
|
|
108851
|
+
}, []);
|
|
108982
108852
|
const configuredRows = reactExports.useMemo(() => {
|
|
108983
|
-
const
|
|
108984
|
-
|
|
108985
|
-
|
|
108986
|
-
|
|
108987
|
-
|
|
108988
|
-
|
|
108989
|
-
|
|
108990
|
-
address: addressOf(settings.default.endpoint)
|
|
108991
|
-
});
|
|
108992
|
-
}
|
|
108993
|
-
for (const [id, config] of Object.entries(settings.agents ?? {})) {
|
|
108994
|
-
rows2.push({
|
|
108995
|
-
key: `agent:${id}`,
|
|
108996
|
-
scope: SUBJECT_KINDS[0],
|
|
108997
|
-
targetId: id,
|
|
108998
|
-
label: nameOf(SUBJECT_KINDS[0], id),
|
|
108999
|
-
address: addressOf(config.endpoint)
|
|
109000
|
-
});
|
|
109001
|
-
}
|
|
109002
|
-
for (const [id, config] of Object.entries(settings.groups ?? {})) {
|
|
109003
|
-
rows2.push({
|
|
109004
|
-
key: `group:${id}`,
|
|
109005
|
-
scope: SUBJECT_KINDS[1],
|
|
109006
|
-
targetId: id,
|
|
109007
|
-
label: nameOf(SUBJECT_KINDS[1], id),
|
|
109008
|
-
address: addressOf(config.endpoint)
|
|
109009
|
-
});
|
|
109010
|
-
}
|
|
109011
|
-
return rows2;
|
|
109012
|
-
}, [settings, subjects, t]);
|
|
109013
|
-
const targetOptions = scope2 === SUBJECT_KINDS[0] ? subjects.agents : subjects.groups;
|
|
108853
|
+
const nameOf = (kind2, id) => (kind2 === SUBJECT_KINDS[0] ? subjects.agents : subjects.groups).find((item2) => item2.id === id)?.name ?? id;
|
|
108854
|
+
return (overview?.owners ?? []).map((owner) => ({
|
|
108855
|
+
key: `${owner.kind}:${owner.id}`,
|
|
108856
|
+
label: owner.kind === "default" ? t("storage.page.threadStore.scopeDefault") : nameOf(owner.kind, owner.id),
|
|
108857
|
+
address: owner.host
|
|
108858
|
+
}));
|
|
108859
|
+
}, [overview, subjects, t]);
|
|
109014
108860
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$W.threadStore, children: [
|
|
109015
108861
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$W.threadStoreStatus, children: [
|
|
109016
108862
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.threadStoreStatusLabel, children: t("storage.location.threadStoreLabel") }),
|
|
109017
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
109018
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "sm", onClick: () => void
|
|
108863
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ThreadStoreOverviewLine, { overview, failed: failed2, unsupported: unsupported2 }),
|
|
108864
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "sm", onClick: () => void refresh2(), children: t("storage.page.threadStore.recheck") })
|
|
109019
108865
|
] }),
|
|
109020
108866
|
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$W.sectionHint, children: t("storage.page.threadStore.hint") }),
|
|
109021
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
109022
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$W.field, children: [
|
|
109023
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.fieldLabel, children: t("storage.page.threadStore.scope") }),
|
|
109024
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
109025
|
-
"select",
|
|
109026
|
-
{
|
|
109027
|
-
value: scope2,
|
|
109028
|
-
className: styles$W.daysSelect,
|
|
109029
|
-
"aria-label": t("storage.page.threadStore.scope"),
|
|
109030
|
-
onChange: (event) => selectTarget(event.target.value, ""),
|
|
109031
|
-
children: [
|
|
109032
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "default", children: t("storage.page.threadStore.scopeDefault") }),
|
|
109033
|
-
SUBJECT_KINDS.map((kind2) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: kind2, children: kind2 === SUBJECT_KINDS[0] ? t("storage.page.threadStore.scopeAgent") : t("storage.page.threadStore.scopeGroup") }, kind2))
|
|
109034
|
-
]
|
|
109035
|
-
}
|
|
109036
|
-
)
|
|
109037
|
-
] }),
|
|
109038
|
-
scope2 !== "default" && /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$W.field, children: [
|
|
109039
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.fieldLabel, children: scope2 === SUBJECT_KINDS[0] ? t("storage.page.threadStore.targetAgent") : t("storage.page.threadStore.targetGroup") }),
|
|
109040
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
109041
|
-
"select",
|
|
109042
|
-
{
|
|
109043
|
-
value: targetId,
|
|
109044
|
-
className: styles$W.daysSelect,
|
|
109045
|
-
"aria-label": scope2 === SUBJECT_KINDS[0] ? t("storage.page.threadStore.targetAgent") : t("storage.page.threadStore.targetGroup"),
|
|
109046
|
-
onChange: (event) => selectTarget(scope2, event.target.value),
|
|
109047
|
-
children: [
|
|
109048
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: t("storage.page.threadStore.targetPick") }),
|
|
109049
|
-
targetOptions.map((option2) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option2.id, children: option2.name }, option2.id))
|
|
109050
|
-
]
|
|
109051
|
-
}
|
|
109052
|
-
)
|
|
109053
|
-
] })
|
|
109054
|
-
] }),
|
|
109055
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$W.field, children: [
|
|
109056
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.fieldLabel, children: t("storage.page.threadStore.endpoint") }),
|
|
109057
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
109058
|
-
"input",
|
|
109059
|
-
{
|
|
109060
|
-
className: styles$W.textInput,
|
|
109061
|
-
value: endpoint,
|
|
109062
|
-
"aria-label": t("storage.page.threadStore.endpoint"),
|
|
109063
|
-
onChange: (event) => {
|
|
109064
|
-
setEndpoint(event.target.value);
|
|
109065
|
-
setPresetSource(null);
|
|
109066
|
-
},
|
|
109067
|
-
placeholder: "https://store.example.com",
|
|
109068
|
-
spellCheck: false
|
|
109069
|
-
}
|
|
109070
|
-
),
|
|
109071
|
-
presets.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
109072
|
-
"select",
|
|
109073
|
-
{
|
|
109074
|
-
className: styles$W.daysSelect,
|
|
109075
|
-
value: "",
|
|
109076
|
-
"aria-label": t("storage.page.threadStore.presetNone"),
|
|
109077
|
-
onChange: (event) => applyPreset(event.target.value),
|
|
109078
|
-
children: [
|
|
109079
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: t("storage.page.threadStore.presetNone") }),
|
|
109080
|
-
presets.map((preset) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: presetKey(preset), children: t("storage.page.threadStore.presetOption", {
|
|
109081
|
-
title: preset.title,
|
|
109082
|
-
plugin: preset.pluginName
|
|
109083
|
-
}) }, presetKey(preset)))
|
|
109084
|
-
]
|
|
109085
|
-
}
|
|
109086
|
-
),
|
|
109087
|
-
presetSource && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$W.fieldHint, children: [
|
|
109088
|
-
t("storage.page.threadStore.presetSource", { plugin: presetSource.pluginName }),
|
|
109089
|
-
presetSource.hint ? ` · ${presetSource.hint}` : ""
|
|
109090
|
-
] })
|
|
109091
|
-
] }),
|
|
109092
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$W.field, children: [
|
|
109093
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.fieldLabel, children: t("storage.page.threadStore.token") }),
|
|
109094
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
109095
|
-
"input",
|
|
109096
|
-
{
|
|
109097
|
-
className: styles$W.textInput,
|
|
109098
|
-
type: "password",
|
|
109099
|
-
value: token,
|
|
109100
|
-
"aria-label": t("storage.page.threadStore.token"),
|
|
109101
|
-
onChange: (event) => setToken(event.target.value),
|
|
109102
|
-
placeholder: tokenState === "present" ? t("storage.page.threadStore.tokenSaved") : tokenState === "unknown" ? t("storage.page.threadStore.tokenUnknown") : t("storage.page.threadStore.tokenEmpty"),
|
|
109103
|
-
autoComplete: "off"
|
|
109104
|
-
}
|
|
109105
|
-
),
|
|
109106
|
-
tokenState !== "present" && token.trim() === "" && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.fieldHint, children: t("storage.page.threadStore.tokenMissingHint") }),
|
|
109107
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.fieldHint, children: t("storage.page.threadStore.tokenHint") })
|
|
109108
|
-
] }),
|
|
109109
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$W.fieldRow, children: [
|
|
109110
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
109111
|
-
Button,
|
|
109112
|
-
{
|
|
109113
|
-
onClick: () => void handleSave(),
|
|
109114
|
-
disabled: busy2 || endpoint.trim().length === 0 || scope2 !== "default" && targetId.trim() === "",
|
|
109115
|
-
children: [
|
|
109116
|
-
busy2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { size: 14, className: styles$W.spin }) : null,
|
|
109117
|
-
t("storage.page.threadStore.save")
|
|
109118
|
-
]
|
|
109119
|
-
}
|
|
109120
|
-
),
|
|
109121
|
-
current !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { variant: "secondary", onClick: () => void handleRemove(), disabled: busy2, children: t("storage.page.threadStore.remove") })
|
|
109122
|
-
] }),
|
|
109123
|
-
configuredRows.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$W.threadStoreConfigured, children: [
|
|
108867
|
+
configuredRows.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
109124
108868
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.fieldLabel, children: t("storage.page.threadStore.configured") }),
|
|
109125
108869
|
/* @__PURE__ */ jsxRuntimeExports.jsx("ul", { className: styles$W.configuredList, children: configuredRows.map((row2) => /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { className: styles$W.configuredRow, children: [
|
|
109126
108870
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.configuredLabel, children: row2.label }),
|
|
109127
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.configuredHost, children: row2.address })
|
|
109128
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
109129
|
-
Button,
|
|
109130
|
-
{
|
|
109131
|
-
variant: "ghost",
|
|
109132
|
-
size: "sm",
|
|
109133
|
-
onClick: () => selectTarget(row2.scope, row2.targetId),
|
|
109134
|
-
children: t("storage.page.threadStore.editRow")
|
|
109135
|
-
}
|
|
109136
|
-
)
|
|
108871
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.configuredHost, children: row2.address })
|
|
109137
108872
|
] }, row2.key)) })
|
|
109138
|
-
] })
|
|
108873
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$W.sectionHint, children: t("storage.page.threadStore.configuredEmpty") }),
|
|
108874
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$W.sectionHint, children: t("storage.page.threadStore.whereHint") })
|
|
109139
108875
|
] });
|
|
109140
108876
|
}
|
|
109141
108877
|
const MINUTE_MS = 6e4;
|
|
@@ -109155,7 +108891,7 @@ const SCANNED_LABEL_KEYS = {
|
|
|
109155
108891
|
days: "storage.scanned.daysAgo"
|
|
109156
108892
|
};
|
|
109157
108893
|
const TABS$1 = ["space", "location", "migration"];
|
|
109158
|
-
const log$
|
|
108894
|
+
const log$h = createLogger("StorageManagementPanel");
|
|
109159
108895
|
function StorageManagementPanel() {
|
|
109160
108896
|
const { t } = useTranslation();
|
|
109161
108897
|
const {
|
|
@@ -109176,7 +108912,11 @@ function StorageManagementPanel() {
|
|
|
109176
108912
|
const [cleaningKey, setCleaningKey] = reactExports.useState(null);
|
|
109177
108913
|
const [pendingReclaimJump, setPendingReclaimJump] = reactExports.useState(false);
|
|
109178
108914
|
const retentionSectionRef = reactExports.useRef(null);
|
|
109179
|
-
const {
|
|
108915
|
+
const {
|
|
108916
|
+
overview: threadStoreOverview,
|
|
108917
|
+
failed: threadStoreOverviewFailed,
|
|
108918
|
+
unsupported: threadStoreOverviewUnsupported
|
|
108919
|
+
} = useThreadStoreOverview();
|
|
109180
108920
|
const canOpenDirs = getTransport().meta.env === "electron";
|
|
109181
108921
|
const busy2 = loading2 || usageLoading;
|
|
109182
108922
|
const stale2 = overviewStale || usageStale;
|
|
@@ -109222,7 +108962,7 @@ function StorageManagementPanel() {
|
|
|
109222
108962
|
}
|
|
109223
108963
|
}
|
|
109224
108964
|
} catch (err) {
|
|
109225
|
-
log$
|
|
108965
|
+
log$h.error("Failed to clean region:", target2.row.id, target2.row.mode, err);
|
|
109226
108966
|
toast$3.error(err instanceof Error ? err.message : t("storage.toast.cleanFailed"));
|
|
109227
108967
|
setCleaningKey(null);
|
|
109228
108968
|
return;
|
|
@@ -109236,7 +108976,7 @@ function StorageManagementPanel() {
|
|
|
109236
108976
|
const handleOpenDir = reactExports.useCallback(
|
|
109237
108977
|
(subpath) => {
|
|
109238
108978
|
getTransport().openDataDirInExplorer(subpath).catch((err) => {
|
|
109239
|
-
log$
|
|
108979
|
+
log$h.error("Failed to open data dir:", subpath, err);
|
|
109240
108980
|
toast$3.error(err instanceof Error ? err.message : t("storage.manual.openFailed"));
|
|
109241
108981
|
});
|
|
109242
108982
|
},
|
|
@@ -109346,10 +109086,11 @@ function StorageManagementPanel() {
|
|
|
109346
109086
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$W.locationBannerText, children: [
|
|
109347
109087
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$W.locationBannerLabel, children: t("storage.page.locationBanner") }),
|
|
109348
109088
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
109349
|
-
|
|
109089
|
+
ThreadStoreOverviewLine,
|
|
109350
109090
|
{
|
|
109351
|
-
|
|
109352
|
-
failed:
|
|
109091
|
+
overview: threadStoreOverview,
|
|
109092
|
+
failed: threadStoreOverviewFailed,
|
|
109093
|
+
unsupported: threadStoreOverviewUnsupported
|
|
109353
109094
|
}
|
|
109354
109095
|
)
|
|
109355
109096
|
] }),
|
|
@@ -112386,53 +112127,69 @@ async function listOwnerNightlyMemoryExecutions(actor, limit = 20) {
|
|
|
112386
112127
|
[]
|
|
112387
112128
|
);
|
|
112388
112129
|
}
|
|
112389
|
-
const section = "
|
|
112390
|
-
const sectionHeader = "
|
|
112391
|
-
const sectionTitle$1 = "
|
|
112392
|
-
const memoryLockRow = "
|
|
112393
|
-
const memoryLockLabel = "
|
|
112394
|
-
const memoryLockSwitch = "
|
|
112395
|
-
const emptyText$2 = "
|
|
112396
|
-
const configBadge = "
|
|
112397
|
-
const capabilityList = "
|
|
112398
|
-
const capabilityRow = "
|
|
112399
|
-
const capabilityActionsInline = "
|
|
112400
|
-
const automationTimeRow = "
|
|
112401
|
-
const automationTimeInput = "
|
|
112402
|
-
const automationTimeHint = "
|
|
112403
|
-
const capabilityProgress = "
|
|
112404
|
-
const capabilityProgressSpinner = "
|
|
112405
|
-
const capabilityActionColumn = "
|
|
112406
|
-
const capabilityLink = "
|
|
112407
|
-
const capabilityLabel = "
|
|
112408
|
-
const capabilityValue = "
|
|
112409
|
-
const workspaceFileRow = "
|
|
112410
|
-
const workspaceFileName = "
|
|
112411
|
-
const workspaceFileDescription = "
|
|
112412
|
-
const capabilityMeta = "
|
|
112413
|
-
const srOnly$2 = "
|
|
112414
|
-
const hint$1 = "
|
|
112415
|
-
const capabilityHint = "
|
|
112416
|
-
const sectionHeaderActions = "
|
|
112417
|
-
const sectionHeaderLeft = "
|
|
112418
|
-
const headerActionButton = "
|
|
112419
|
-
const modelSummary = "
|
|
112420
|
-
const modelSummaryPrimary = "
|
|
112421
|
-
const modelSummaryMeta = "
|
|
112422
|
-
const modelSummaryHint = "
|
|
112423
|
-
const summaryList = "
|
|
112424
|
-
const summaryItem = "
|
|
112425
|
-
const memberAvatar = "
|
|
112426
|
-
const summaryMain = "
|
|
112427
|
-
const memberList = "
|
|
112428
|
-
const memberNameButton = "
|
|
112429
|
-
const actionList = "
|
|
112430
|
-
const actionButton$2 = "
|
|
112431
|
-
const actionButtonActive = "
|
|
112432
|
-
const actionButtonDanger = "
|
|
112433
|
-
const dangerSection = "
|
|
112434
|
-
const dangerPill = "
|
|
112435
|
-
const actionMeta = "
|
|
112130
|
+
const section = "_section_1r17i_1";
|
|
112131
|
+
const sectionHeader = "_sectionHeader_1r17i_12";
|
|
112132
|
+
const sectionTitle$1 = "_sectionTitle_1r17i_20";
|
|
112133
|
+
const memoryLockRow = "_memoryLockRow_1r17i_27";
|
|
112134
|
+
const memoryLockLabel = "_memoryLockLabel_1r17i_38";
|
|
112135
|
+
const memoryLockSwitch = "_memoryLockSwitch_1r17i_45";
|
|
112136
|
+
const emptyText$2 = "_emptyText_1r17i_52";
|
|
112137
|
+
const configBadge = "_configBadge_1r17i_59";
|
|
112138
|
+
const capabilityList = "_capabilityList_1r17i_73";
|
|
112139
|
+
const capabilityRow = "_capabilityRow_1r17i_79";
|
|
112140
|
+
const capabilityActionsInline = "_capabilityActionsInline_1r17i_93";
|
|
112141
|
+
const automationTimeRow = "_automationTimeRow_1r17i_104";
|
|
112142
|
+
const automationTimeInput = "_automationTimeInput_1r17i_114";
|
|
112143
|
+
const automationTimeHint = "_automationTimeHint_1r17i_131";
|
|
112144
|
+
const capabilityProgress = "_capabilityProgress_1r17i_137";
|
|
112145
|
+
const capabilityProgressSpinner = "_capabilityProgressSpinner_1r17i_149";
|
|
112146
|
+
const capabilityActionColumn = "_capabilityActionColumn_1r17i_166";
|
|
112147
|
+
const capabilityLink = "_capabilityLink_1r17i_174";
|
|
112148
|
+
const capabilityLabel = "_capabilityLabel_1r17i_192";
|
|
112149
|
+
const capabilityValue = "_capabilityValue_1r17i_198";
|
|
112150
|
+
const workspaceFileRow = "_workspaceFileRow_1r17i_209";
|
|
112151
|
+
const workspaceFileName = "_workspaceFileName_1r17i_216";
|
|
112152
|
+
const workspaceFileDescription = "_workspaceFileDescription_1r17i_235";
|
|
112153
|
+
const capabilityMeta = "_capabilityMeta_1r17i_258";
|
|
112154
|
+
const srOnly$2 = "_srOnly_1r17i_265";
|
|
112155
|
+
const hint$1 = "_hint_1r17i_277";
|
|
112156
|
+
const capabilityHint = "_capabilityHint_1r17i_284";
|
|
112157
|
+
const sectionHeaderActions = "_sectionHeaderActions_1r17i_296";
|
|
112158
|
+
const sectionHeaderLeft = "_sectionHeaderLeft_1r17i_305";
|
|
112159
|
+
const headerActionButton = "_headerActionButton_1r17i_312";
|
|
112160
|
+
const modelSummary = "_modelSummary_1r17i_345";
|
|
112161
|
+
const modelSummaryPrimary = "_modelSummaryPrimary_1r17i_352";
|
|
112162
|
+
const modelSummaryMeta = "_modelSummaryMeta_1r17i_363";
|
|
112163
|
+
const modelSummaryHint = "_modelSummaryHint_1r17i_373";
|
|
112164
|
+
const summaryList = "_summaryList_1r17i_380";
|
|
112165
|
+
const summaryItem = "_summaryItem_1r17i_389";
|
|
112166
|
+
const memberAvatar = "_memberAvatar_1r17i_397";
|
|
112167
|
+
const summaryMain = "_summaryMain_1r17i_401";
|
|
112168
|
+
const memberList = "_memberList_1r17i_411";
|
|
112169
|
+
const memberNameButton = "_memberNameButton_1r17i_442";
|
|
112170
|
+
const actionList = "_actionList_1r17i_469";
|
|
112171
|
+
const actionButton$2 = "_actionButton_1r17i_478";
|
|
112172
|
+
const actionButtonActive = "_actionButtonActive_1r17i_496";
|
|
112173
|
+
const actionButtonDanger = "_actionButtonDanger_1r17i_507";
|
|
112174
|
+
const dangerSection = "_dangerSection_1r17i_515";
|
|
112175
|
+
const dangerPill = "_dangerPill_1r17i_519";
|
|
112176
|
+
const actionMeta = "_actionMeta_1r17i_531";
|
|
112177
|
+
const threadStoreMeta = "_threadStoreMeta_1r17i_538";
|
|
112178
|
+
const threadStoreRow = "_threadStoreRow_1r17i_548";
|
|
112179
|
+
const threadStoreRowText = "_threadStoreRowText_1r17i_556";
|
|
112180
|
+
const threadStoreDot = "_threadStoreDot_1r17i_569";
|
|
112181
|
+
const threadStoreDotBad = "_threadStoreDotBad_1r17i_570";
|
|
112182
|
+
const threadStoreDotIdle = "_threadStoreDotIdle_1r17i_571";
|
|
112183
|
+
const threadStoreError = "_threadStoreError_1r17i_587";
|
|
112184
|
+
const threadStoreFields = "_threadStoreFields_1r17i_598";
|
|
112185
|
+
const threadStoreField = "_threadStoreField_1r17i_598";
|
|
112186
|
+
const threadStoreFieldLabel = "_threadStoreFieldLabel_1r17i_609";
|
|
112187
|
+
const threadStoreInput = "_threadStoreInput_1r17i_614";
|
|
112188
|
+
const threadStoreActions = "_threadStoreActions_1r17i_631";
|
|
112189
|
+
const threadStoreActionsEnd = "_threadStoreActionsEnd_1r17i_639";
|
|
112190
|
+
const threadStoreProgress = "_threadStoreProgress_1r17i_643";
|
|
112191
|
+
const threadStoreProgressFill = "_threadStoreProgressFill_1r17i_651";
|
|
112192
|
+
const threadStoreFailure = "_threadStoreFailure_1r17i_658";
|
|
112436
112193
|
const styles$K = {
|
|
112437
112194
|
section,
|
|
112438
112195
|
sectionHeader,
|
|
@@ -112480,7 +112237,23 @@ const styles$K = {
|
|
|
112480
112237
|
actionButtonDanger,
|
|
112481
112238
|
dangerSection,
|
|
112482
112239
|
dangerPill,
|
|
112483
|
-
actionMeta
|
|
112240
|
+
actionMeta,
|
|
112241
|
+
threadStoreMeta,
|
|
112242
|
+
threadStoreRow,
|
|
112243
|
+
threadStoreRowText,
|
|
112244
|
+
threadStoreDot,
|
|
112245
|
+
threadStoreDotBad,
|
|
112246
|
+
threadStoreDotIdle,
|
|
112247
|
+
threadStoreError,
|
|
112248
|
+
threadStoreFields,
|
|
112249
|
+
threadStoreField,
|
|
112250
|
+
threadStoreFieldLabel,
|
|
112251
|
+
threadStoreInput,
|
|
112252
|
+
threadStoreActions,
|
|
112253
|
+
threadStoreActionsEnd,
|
|
112254
|
+
threadStoreProgress,
|
|
112255
|
+
threadStoreProgressFill,
|
|
112256
|
+
threadStoreFailure
|
|
112484
112257
|
};
|
|
112485
112258
|
const header$c = "_header_kb12f_5";
|
|
112486
112259
|
const headerInner = "_headerInner_kb12f_9";
|
|
@@ -113738,7 +113511,7 @@ const styles$G = {
|
|
|
113738
113511
|
stepperDisabled,
|
|
113739
113512
|
stepperInput
|
|
113740
113513
|
};
|
|
113741
|
-
const log$
|
|
113514
|
+
const log$g = createLogger("DelegateBanner");
|
|
113742
113515
|
const MIN_MAX_CONSECUTIVE_INTERVENTIONS = 1;
|
|
113743
113516
|
const MAX_MAX_CONSECUTIVE_INTERVENTIONS = 99;
|
|
113744
113517
|
function getEditableDelegateAgents(agents, memberAgentIds, currentDelegateAgentId) {
|
|
@@ -113892,7 +113665,7 @@ function DelegateEditDialog({
|
|
|
113892
113665
|
}).then(() => {
|
|
113893
113666
|
onClose();
|
|
113894
113667
|
}).catch((err) => {
|
|
113895
|
-
log$
|
|
113668
|
+
log$g.warn("updateDelegateConfig failed:", err);
|
|
113896
113669
|
setError(getDelegateSaveErrorLabel(err, t));
|
|
113897
113670
|
}).finally(() => {
|
|
113898
113671
|
setSaving(false);
|
|
@@ -115476,7 +115249,7 @@ function readHistory(history) {
|
|
|
115476
115249
|
...last ? { lastDowngrade: { at: last.at, max: last.max, size: last.size } } : {}
|
|
115477
115250
|
};
|
|
115478
115251
|
}
|
|
115479
|
-
const log$
|
|
115252
|
+
const log$f = createLogger("SessionResidentChannel");
|
|
115480
115253
|
function useSessionResidentChannel(coordinates, memberLabels) {
|
|
115481
115254
|
const [reading, setReading] = reactExports.useState(null);
|
|
115482
115255
|
const [releasingAgentId, setReleasingAgentId] = reactExports.useState(null);
|
|
@@ -115491,7 +115264,7 @@ function useSessionResidentChannel(coordinates, memberLabels) {
|
|
|
115491
115264
|
if (requestIdRef.current === requestId) setReading(result2 ?? null);
|
|
115492
115265
|
} catch (error2) {
|
|
115493
115266
|
if (requestIdRef.current === requestId) {
|
|
115494
|
-
log$
|
|
115267
|
+
log$f.warn("读取会话常驻通道失败", { coordinates, error: error2 });
|
|
115495
115268
|
setReading(null);
|
|
115496
115269
|
}
|
|
115497
115270
|
}
|
|
@@ -115508,7 +115281,7 @@ function useSessionResidentChannel(coordinates, memberLabels) {
|
|
|
115508
115281
|
const result2 = await getTransport().releaseSessionResidentChannel(target2);
|
|
115509
115282
|
setOutcome({ agentId, outcome: outcomeOf(result2) });
|
|
115510
115283
|
} catch (error2) {
|
|
115511
|
-
log$
|
|
115284
|
+
log$f.warn("释放会话常驻通道失败", { coordinates, agentId, error: error2 });
|
|
115512
115285
|
setOutcome({ agentId, outcome: "failed" });
|
|
115513
115286
|
} finally {
|
|
115514
115287
|
setReleasingAgentId(null);
|
|
@@ -115618,6 +115391,308 @@ function ResidentChannelSection({ coordinates, memberLabels }) {
|
|
|
115618
115391
|
outcomeLine
|
|
115619
115392
|
] });
|
|
115620
115393
|
}
|
|
115394
|
+
const log$e = createLogger("ThreadStoreStatus");
|
|
115395
|
+
function useThreadStoreStatus(scope2) {
|
|
115396
|
+
const [status2, setStatus] = reactExports.useState(null);
|
|
115397
|
+
const [failed2, setFailed] = reactExports.useState(false);
|
|
115398
|
+
const scopeKind = scope2.kind;
|
|
115399
|
+
const scopeId = scope2.id;
|
|
115400
|
+
const refresh2 = reactExports.useCallback(async () => {
|
|
115401
|
+
try {
|
|
115402
|
+
setStatus(await getTransport().getThreadStoreStatus({ kind: scopeKind, id: scopeId }) ?? null);
|
|
115403
|
+
setFailed(false);
|
|
115404
|
+
} catch (error2) {
|
|
115405
|
+
log$e.error("Failed to read thread store status:", error2);
|
|
115406
|
+
setFailed(true);
|
|
115407
|
+
}
|
|
115408
|
+
}, [scopeKind, scopeId]);
|
|
115409
|
+
reactExports.useEffect(() => {
|
|
115410
|
+
setStatus(null);
|
|
115411
|
+
void refresh2();
|
|
115412
|
+
}, [refresh2]);
|
|
115413
|
+
return { status: status2, failed: failed2, refresh: refresh2 };
|
|
115414
|
+
}
|
|
115415
|
+
const log$d = createLogger("ThreadStoreOwnerSection");
|
|
115416
|
+
const MIGRATION_BATCH = 20;
|
|
115417
|
+
function ThreadStoreOwnerSection({ owner }) {
|
|
115418
|
+
const { t } = useTranslation();
|
|
115419
|
+
const scope2 = { kind: owner.kind, id: owner.id };
|
|
115420
|
+
const { status: status2, failed: failed2, refresh: refresh2 } = useThreadStoreStatus(scope2);
|
|
115421
|
+
const [expanded, setExpanded] = reactExports.useState(false);
|
|
115422
|
+
const [endpoint, setEndpoint] = reactExports.useState("");
|
|
115423
|
+
const [token, setToken] = reactExports.useState("");
|
|
115424
|
+
const [busy2, setBusy] = reactExports.useState(false);
|
|
115425
|
+
const [error2, setError] = reactExports.useState(null);
|
|
115426
|
+
const [progress2, setProgress] = reactExports.useState(null);
|
|
115427
|
+
const [tally, setTally] = reactExports.useState(null);
|
|
115428
|
+
const generation = reactExports.useRef(0);
|
|
115429
|
+
const stopRef = reactExports.useRef(false);
|
|
115430
|
+
reactExports.useEffect(() => {
|
|
115431
|
+
generation.current += 1;
|
|
115432
|
+
stopRef.current = true;
|
|
115433
|
+
setExpanded(false);
|
|
115434
|
+
setEndpoint("");
|
|
115435
|
+
setToken("");
|
|
115436
|
+
setProgress(null);
|
|
115437
|
+
setTally(null);
|
|
115438
|
+
setError(null);
|
|
115439
|
+
}, [owner.kind, owner.id]);
|
|
115440
|
+
const openEditor = reactExports.useCallback(async () => {
|
|
115441
|
+
setError(null);
|
|
115442
|
+
setExpanded(true);
|
|
115443
|
+
try {
|
|
115444
|
+
const overview = await getTransport().getThreadStoreOverview();
|
|
115445
|
+
const own2 = overview?.owners.find((item2) => item2.kind === owner.kind && item2.id === owner.id);
|
|
115446
|
+
setEndpoint(own2?.endpoint ?? "");
|
|
115447
|
+
} catch (cause) {
|
|
115448
|
+
log$d.error("Failed to read thread store config:", cause);
|
|
115449
|
+
}
|
|
115450
|
+
}, [owner.id, owner.kind]);
|
|
115451
|
+
const save = reactExports.useCallback(async () => {
|
|
115452
|
+
if (endpoint.trim().length === 0) return;
|
|
115453
|
+
setBusy(true);
|
|
115454
|
+
setError(null);
|
|
115455
|
+
try {
|
|
115456
|
+
await getTransport().saveThreadStoreScope(scope2, {
|
|
115457
|
+
endpoint: endpoint.trim(),
|
|
115458
|
+
...token.trim().length === 0 ? {} : { token: token.trim() }
|
|
115459
|
+
});
|
|
115460
|
+
setExpanded(false);
|
|
115461
|
+
setToken("");
|
|
115462
|
+
setTally(null);
|
|
115463
|
+
await refresh2();
|
|
115464
|
+
} catch (cause) {
|
|
115465
|
+
log$d.error("Failed to save thread store config:", cause);
|
|
115466
|
+
setError(t("contextInspector.threadStore.saveFailed"));
|
|
115467
|
+
} finally {
|
|
115468
|
+
setBusy(false);
|
|
115469
|
+
}
|
|
115470
|
+
}, [endpoint, refresh2, scope2, t, token]);
|
|
115471
|
+
const revert2 = reactExports.useCallback(async () => {
|
|
115472
|
+
setBusy(true);
|
|
115473
|
+
setError(null);
|
|
115474
|
+
try {
|
|
115475
|
+
await getTransport().saveThreadStoreScope(scope2, null);
|
|
115476
|
+
setExpanded(false);
|
|
115477
|
+
setEndpoint("");
|
|
115478
|
+
setToken("");
|
|
115479
|
+
setTally(null);
|
|
115480
|
+
await refresh2();
|
|
115481
|
+
} catch (cause) {
|
|
115482
|
+
log$d.error("Failed to clear thread store config:", cause);
|
|
115483
|
+
setError(t("contextInspector.threadStore.saveFailed"));
|
|
115484
|
+
} finally {
|
|
115485
|
+
setBusy(false);
|
|
115486
|
+
}
|
|
115487
|
+
}, [refresh2, scope2, t]);
|
|
115488
|
+
const migrate = reactExports.useCallback(async () => {
|
|
115489
|
+
if (progress2 !== null) return;
|
|
115490
|
+
const run = generation.current;
|
|
115491
|
+
const alive = () => generation.current === run;
|
|
115492
|
+
stopRef.current = false;
|
|
115493
|
+
setError(null);
|
|
115494
|
+
setTally(null);
|
|
115495
|
+
const hint2 = status2?.kind === "external" ? status2.localLines ?? 0 : 0;
|
|
115496
|
+
setProgress({ done: 0, total: hint2 });
|
|
115497
|
+
let done = 0;
|
|
115498
|
+
let total = hint2;
|
|
115499
|
+
let migrated = 0;
|
|
115500
|
+
let remaining = hint2;
|
|
115501
|
+
const failures = [];
|
|
115502
|
+
let detail2;
|
|
115503
|
+
try {
|
|
115504
|
+
for (; ; ) {
|
|
115505
|
+
if (!alive()) return;
|
|
115506
|
+
const summary2 = await getTransport().migrateThreadStore(
|
|
115507
|
+
scope2,
|
|
115508
|
+
MIGRATION_BATCH,
|
|
115509
|
+
// 这一轮已经试过且没搬成的线不再试:固定的失败占住队头,只会让每批都白跑一趟。
|
|
115510
|
+
failures.map((failure) => failure.threadId)
|
|
115511
|
+
);
|
|
115512
|
+
if (!alive()) return;
|
|
115513
|
+
migrated += summary2.migrated;
|
|
115514
|
+
failures.push(...summary2.failures);
|
|
115515
|
+
done += summary2.migrated + summary2.skipped + summary2.failed;
|
|
115516
|
+
remaining = summary2.remaining;
|
|
115517
|
+
total = done + remaining;
|
|
115518
|
+
setProgress({ done, total });
|
|
115519
|
+
if (summary2.detail !== void 0) {
|
|
115520
|
+
detail2 = summary2.detail;
|
|
115521
|
+
break;
|
|
115522
|
+
}
|
|
115523
|
+
if (remaining <= 0) break;
|
|
115524
|
+
if (summary2.migrated + summary2.skipped === 0) break;
|
|
115525
|
+
if (stopRef.current) break;
|
|
115526
|
+
}
|
|
115527
|
+
} catch (cause) {
|
|
115528
|
+
log$d.error("Failed to migrate threads:", cause);
|
|
115529
|
+
detail2 = cause instanceof Error ? cause.message : String(cause);
|
|
115530
|
+
} finally {
|
|
115531
|
+
if (alive()) {
|
|
115532
|
+
setProgress(null);
|
|
115533
|
+
setTally({ migrated, remaining, failures, ...detail2 === void 0 ? {} : { detail: detail2 } });
|
|
115534
|
+
await refresh2();
|
|
115535
|
+
}
|
|
115536
|
+
}
|
|
115537
|
+
}, [progress2, refresh2, scope2, status2]);
|
|
115538
|
+
const view2 = status2 ?? null;
|
|
115539
|
+
const localLines = view2?.kind === "external" ? view2.localLines ?? 0 : 0;
|
|
115540
|
+
const connected = view2?.kind === "external" && view2.state === "connected";
|
|
115541
|
+
const meta2 = view2 === null || view2.kind === "local" ? null : view2.kind === "invalid" ? t("contextInspector.threadStore.invalid") : view2.source === "default" ? `${view2.host} · ${t("contextInspector.threadStore.followDefault")}` : view2.host;
|
|
115542
|
+
const stateText2 = view2 === null ? t("contextInspector.threadStore.reading") : view2.kind === "local" ? t("contextInspector.threadStore.local") : view2.kind === "invalid" ? t("contextInspector.threadStore.invalid") : view2.state === "connected" ? t("contextInspector.threadStore.connected") : view2.state === "unreachable" ? t("contextInspector.threadStore.unreachable") : t("contextInspector.threadStore.disabled");
|
|
115543
|
+
const broken = failed2 || view2?.kind === "invalid" || view2?.kind === "external" && view2.state !== "connected";
|
|
115544
|
+
const dotClass = view2?.kind === "local" || view2 === null ? styles$K.threadStoreDotIdle : broken ? styles$K.threadStoreDotBad : styles$K.threadStoreDot;
|
|
115545
|
+
const detailText = view2 !== null && view2.kind !== "local" ? view2.detail : void 0;
|
|
115546
|
+
const failureLines = tally?.failures ?? [];
|
|
115547
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
115548
|
+
"section",
|
|
115549
|
+
{
|
|
115550
|
+
className: styles$K.section,
|
|
115551
|
+
"data-section": "thread-store",
|
|
115552
|
+
"aria-label": t("contextInspector.threadStore.title"),
|
|
115553
|
+
children: [
|
|
115554
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$K.sectionHeader, children: [
|
|
115555
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$K.sectionHeaderLeft, children: [
|
|
115556
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: styles$K.sectionTitle, children: t("contextInspector.threadStore.title") }),
|
|
115557
|
+
meta2 === null ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$K.threadStoreMeta, title: meta2, "data-testid": "thread-store-meta", children: meta2 })
|
|
115558
|
+
] }),
|
|
115559
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$K.sectionHeaderActions, children: expanded ? null : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115560
|
+
"button",
|
|
115561
|
+
{
|
|
115562
|
+
type: "button",
|
|
115563
|
+
className: styles$K.headerActionButton,
|
|
115564
|
+
onClick: () => void openEditor(),
|
|
115565
|
+
"data-testid": "thread-store-edit",
|
|
115566
|
+
children: t("contextInspector.threadStore.edit")
|
|
115567
|
+
}
|
|
115568
|
+
) })
|
|
115569
|
+
] }),
|
|
115570
|
+
expanded ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
115571
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$K.threadStoreFields, children: [
|
|
115572
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$K.threadStoreField, children: [
|
|
115573
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$K.threadStoreFieldLabel, children: t("contextInspector.threadStore.endpoint") }),
|
|
115574
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115575
|
+
"input",
|
|
115576
|
+
{
|
|
115577
|
+
className: styles$K.threadStoreInput,
|
|
115578
|
+
value: endpoint,
|
|
115579
|
+
placeholder: "https://…",
|
|
115580
|
+
spellCheck: false,
|
|
115581
|
+
onChange: (event) => setEndpoint(event.target.value),
|
|
115582
|
+
"data-testid": "thread-store-endpoint"
|
|
115583
|
+
}
|
|
115584
|
+
)
|
|
115585
|
+
] }),
|
|
115586
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$K.threadStoreField, children: [
|
|
115587
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$K.threadStoreFieldLabel, children: t("contextInspector.threadStore.token") }),
|
|
115588
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115589
|
+
"input",
|
|
115590
|
+
{
|
|
115591
|
+
className: styles$K.threadStoreInput,
|
|
115592
|
+
type: "password",
|
|
115593
|
+
value: token,
|
|
115594
|
+
placeholder: t("contextInspector.threadStore.tokenKeep"),
|
|
115595
|
+
onChange: (event) => setToken(event.target.value),
|
|
115596
|
+
"data-testid": "thread-store-token"
|
|
115597
|
+
}
|
|
115598
|
+
)
|
|
115599
|
+
] })
|
|
115600
|
+
] }),
|
|
115601
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$K.threadStoreActions, children: [
|
|
115602
|
+
view2 !== null && view2.kind !== "local" ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115603
|
+
"button",
|
|
115604
|
+
{
|
|
115605
|
+
type: "button",
|
|
115606
|
+
className: styles$K.headerActionButton,
|
|
115607
|
+
onClick: () => void revert2(),
|
|
115608
|
+
disabled: busy2,
|
|
115609
|
+
"data-testid": "thread-store-revert",
|
|
115610
|
+
children: t("contextInspector.threadStore.revert")
|
|
115611
|
+
}
|
|
115612
|
+
) : null,
|
|
115613
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$K.threadStoreActionsEnd }),
|
|
115614
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115615
|
+
"button",
|
|
115616
|
+
{
|
|
115617
|
+
type: "button",
|
|
115618
|
+
className: styles$K.headerActionButton,
|
|
115619
|
+
onClick: () => {
|
|
115620
|
+
setExpanded(false);
|
|
115621
|
+
setToken("");
|
|
115622
|
+
setError(null);
|
|
115623
|
+
},
|
|
115624
|
+
disabled: busy2,
|
|
115625
|
+
children: t("contextInspector.threadStore.cancel")
|
|
115626
|
+
}
|
|
115627
|
+
),
|
|
115628
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115629
|
+
"button",
|
|
115630
|
+
{
|
|
115631
|
+
type: "button",
|
|
115632
|
+
className: styles$K.headerActionButton,
|
|
115633
|
+
onClick: () => void save(),
|
|
115634
|
+
disabled: busy2 || endpoint.trim().length === 0,
|
|
115635
|
+
"data-testid": "thread-store-save",
|
|
115636
|
+
children: t("contextInspector.threadStore.save")
|
|
115637
|
+
}
|
|
115638
|
+
)
|
|
115639
|
+
] })
|
|
115640
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
115641
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$K.threadStoreRow, children: [
|
|
115642
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$K.threadStoreRowText, title: detailText, children: [
|
|
115643
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: dotClass, "aria-hidden": "true" }),
|
|
115644
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { "data-testid": "thread-store-state", children: stateText2 }),
|
|
115645
|
+
progress2 !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { "data-testid": "thread-store-progress", children: ` · ${t("contextInspector.threadStore.migrating", progress2)}` }) : connected && localLines > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: ` · ${t("contextInspector.threadStore.localLines", { count: localLines })}` }) : null
|
|
115646
|
+
] }),
|
|
115647
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$K.threadStoreActionsEnd }),
|
|
115648
|
+
connected && localLines > 0 ? progress2 === null ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115649
|
+
"button",
|
|
115650
|
+
{
|
|
115651
|
+
type: "button",
|
|
115652
|
+
className: styles$K.headerActionButton,
|
|
115653
|
+
onClick: () => void migrate(),
|
|
115654
|
+
"data-testid": "thread-store-migrate",
|
|
115655
|
+
children: t("contextInspector.threadStore.migrate", { count: localLines })
|
|
115656
|
+
}
|
|
115657
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115658
|
+
"button",
|
|
115659
|
+
{
|
|
115660
|
+
type: "button",
|
|
115661
|
+
className: styles$K.headerActionButton,
|
|
115662
|
+
onClick: () => {
|
|
115663
|
+
stopRef.current = true;
|
|
115664
|
+
},
|
|
115665
|
+
"data-testid": "thread-store-stop",
|
|
115666
|
+
children: t("contextInspector.threadStore.stop")
|
|
115667
|
+
}
|
|
115668
|
+
) : null
|
|
115669
|
+
] }),
|
|
115670
|
+
progress2 !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$K.threadStoreProgress, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115671
|
+
"div",
|
|
115672
|
+
{
|
|
115673
|
+
className: styles$K.threadStoreProgressFill,
|
|
115674
|
+
style: {
|
|
115675
|
+
width: `${progress2.total === 0 ? 100 : Math.min(100, Math.round(progress2.done / progress2.total * 100))}%`
|
|
115676
|
+
}
|
|
115677
|
+
}
|
|
115678
|
+
) }) : null
|
|
115679
|
+
] }),
|
|
115680
|
+
tally !== null && tally.remaining === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$K.hint, role: "status", "data-testid": "thread-store-done", children: t("contextInspector.threadStore.done", { count: tally.migrated }) }) : null,
|
|
115681
|
+
tally !== null && tally.remaining > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: styles$K.hint, role: "status", "data-testid": "thread-store-remaining", children: [
|
|
115682
|
+
t("contextInspector.threadStore.remaining", { count: tally.remaining }),
|
|
115683
|
+
failureLines.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$K.threadStoreFailure, children: ` · ${t("contextInspector.threadStore.failed", { count: failureLines.length })}` }) : null
|
|
115684
|
+
] }) : null,
|
|
115685
|
+
failureLines.slice(0, 3).map((failure) => /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$K.hint, children: t("contextInspector.threadStore.failureReason", {
|
|
115686
|
+
threadId: failure.threadId,
|
|
115687
|
+
reason: failure.reason
|
|
115688
|
+
}) }, failure.threadId)),
|
|
115689
|
+
tally?.detail === void 0 ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$K.hint, role: "alert", children: tally.detail }),
|
|
115690
|
+
error2 === null ? null : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$K.hint, role: "alert", children: error2 }),
|
|
115691
|
+
expanded ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$K.hint, children: t("contextInspector.threadStore.hintEdit") }) : detailText !== void 0 && broken ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$K.threadStoreError, role: "alert", children: detailText }) : view2?.kind === "local" ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$K.hint, children: t("contextInspector.threadStore.hintLocal") }) : connected && localLines > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: styles$K.hint, children: t("contextInspector.threadStore.hintMigrate") }) : null
|
|
115692
|
+
]
|
|
115693
|
+
}
|
|
115694
|
+
);
|
|
115695
|
+
}
|
|
115621
115696
|
function ContextInspectorManagementTab({
|
|
115622
115697
|
viewModel,
|
|
115623
115698
|
onOpenSettings,
|
|
@@ -115707,6 +115782,7 @@ function GroupManagementShell({
|
|
|
115707
115782
|
onToggleLock: memoryPolicy.setLocked
|
|
115708
115783
|
}
|
|
115709
115784
|
),
|
|
115785
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ThreadStoreOwnerSection, { owner: { kind: "group", id: groupId } }),
|
|
115710
115786
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115711
115787
|
CapabilitiesSection,
|
|
115712
115788
|
{
|
|
@@ -115793,6 +115869,7 @@ function AgentManagementShell({
|
|
|
115793
115869
|
onToggleLock: memoryPolicy.setLocked
|
|
115794
115870
|
}
|
|
115795
115871
|
),
|
|
115872
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(ThreadStoreOwnerSection, { owner: { kind: "agent", id: agent2.agentId } }),
|
|
115796
115873
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
115797
115874
|
CapabilitiesSection,
|
|
115798
115875
|
{
|
|
@@ -120690,6 +120767,13 @@ const useRunUnreadStore = create$1((set, get) => ({
|
|
|
120690
120767
|
transport.requestRunUnread?.();
|
|
120691
120768
|
}
|
|
120692
120769
|
}));
|
|
120770
|
+
function activeUnreadToClear(entries, activeSessionId2) {
|
|
120771
|
+
if (!activeSessionId2) return null;
|
|
120772
|
+
return entries.some((entry2) => entry2.sessionId === activeSessionId2) ? activeSessionId2 : null;
|
|
120773
|
+
}
|
|
120774
|
+
function sessionInSight(activeSessionId2, chatViewVisible) {
|
|
120775
|
+
return chatViewVisible ? activeSessionId2 : null;
|
|
120776
|
+
}
|
|
120693
120777
|
function getSidebarItemMenuItems({
|
|
120694
120778
|
item: item2,
|
|
120695
120779
|
handlers: handlers2,
|
|
@@ -122874,30 +122958,44 @@ const styles$r = {
|
|
|
122874
122958
|
};
|
|
122875
122959
|
const SUCCESS_AUTO_DISMISS_MS = 6e3;
|
|
122876
122960
|
const STACK_GAP_PX = 8;
|
|
122877
|
-
|
|
122961
|
+
const NO_PINNED_SESSIONS = /* @__PURE__ */ new Set();
|
|
122962
|
+
function TaskUnreadToast({
|
|
122963
|
+
activeSessionId: activeSessionId2,
|
|
122964
|
+
onOpen,
|
|
122965
|
+
pinnedSessionIds = NO_PINNED_SESSIONS
|
|
122966
|
+
}) {
|
|
122878
122967
|
const { t } = useTranslation();
|
|
122879
122968
|
const entries = useRunUnreadStore((state2) => state2.entries);
|
|
122880
122969
|
const [visible, setVisible] = reactExports.useState([]);
|
|
122881
122970
|
const shown = reactExports.useRef(/* @__PURE__ */ new Set());
|
|
122882
122971
|
const timers = reactExports.useRef(/* @__PURE__ */ new Map());
|
|
122883
122972
|
const stackRef = reactExports.useRef(null);
|
|
122973
|
+
reactExports.useEffect(() => {
|
|
122974
|
+
if (!shown.current.size) return;
|
|
122975
|
+
const live = new Set(entries.map((entry2) => entry2.runId));
|
|
122976
|
+
for (const runId of shown.current) {
|
|
122977
|
+
if (!live.has(runId)) shown.current.delete(runId);
|
|
122978
|
+
}
|
|
122979
|
+
}, [entries]);
|
|
122884
122980
|
reactExports.useEffect(() => {
|
|
122885
122981
|
if (!document.hasFocus()) return;
|
|
122886
|
-
const fresh =
|
|
122887
|
-
|
|
122888
|
-
|
|
122889
|
-
|
|
122890
|
-
for (const entry2 of fresh) {
|
|
122982
|
+
const fresh = [];
|
|
122983
|
+
for (const entry2 of entries) {
|
|
122984
|
+
if (entry2.sessionId === activeSessionId2) continue;
|
|
122985
|
+
if (shown.current.has(entry2.runId)) continue;
|
|
122891
122986
|
shown.current.add(entry2.runId);
|
|
122987
|
+
if (entry2.kind === "completed" && pinnedSessionIds.has(entry2.sessionId)) continue;
|
|
122892
122988
|
if (entry2.kind === "completed") {
|
|
122893
122989
|
timers.current.set(
|
|
122894
122990
|
entry2.runId,
|
|
122895
122991
|
setTimeout(() => dismiss2(entry2.runId), SUCCESS_AUTO_DISMISS_MS)
|
|
122896
122992
|
);
|
|
122897
122993
|
}
|
|
122994
|
+
fresh.push(entry2);
|
|
122898
122995
|
}
|
|
122996
|
+
if (!fresh.length) return;
|
|
122899
122997
|
setVisible((current) => [...fresh, ...current].slice(0, 3));
|
|
122900
|
-
}, [entries, activeSessionId2]);
|
|
122998
|
+
}, [entries, activeSessionId2, pinnedSessionIds]);
|
|
122901
122999
|
reactExports.useEffect(
|
|
122902
123000
|
() => () => {
|
|
122903
123001
|
for (const timer2 of timers.current.values()) clearTimeout(timer2);
|
|
@@ -144135,7 +144233,7 @@ const styles$2 = {
|
|
|
144135
144233
|
sidebarSessionCountBadge
|
|
144136
144234
|
};
|
|
144137
144235
|
const log$2 = createLogger("App");
|
|
144138
|
-
const loadFilePreviewDrawer = () => __vitePreload(() => import("./index-
|
|
144236
|
+
const loadFilePreviewDrawer = () => __vitePreload(() => import("./index-JieQdgYY.js"), true ? __vite__mapDeps([8,6,2,7,1]) : void 0, import.meta.url);
|
|
144139
144237
|
const FilePreviewDrawer = reactExports.lazy(
|
|
144140
144238
|
() => loadFilePreviewDrawer().then((module) => ({ default: module.FilePreviewDrawer }))
|
|
144141
144239
|
);
|
|
@@ -144155,6 +144253,12 @@ function AppShell() {
|
|
|
144155
144253
|
const agents = useAgentStore((s15) => s15.agents);
|
|
144156
144254
|
const loadAgents = useAgentStore((s15) => s15.loadAgents);
|
|
144157
144255
|
const activeSessionId2 = useSessionStore((s15) => s15.activeSessionId);
|
|
144256
|
+
const runUnreadEntries = useRunUnreadStore((s15) => s15.entries);
|
|
144257
|
+
const pinnedTabSessionIds = useSessionStore((s15) => s15.pinnedTabSessionIds);
|
|
144258
|
+
const pinnedSessionIdSet = reactExports.useMemo(
|
|
144259
|
+
() => new Set([...pinnedTabSessionIds.values()].flat()),
|
|
144260
|
+
[pinnedTabSessionIds]
|
|
144261
|
+
);
|
|
144158
144262
|
const setActiveSessionId = useSessionStore((s15) => s15.setActiveSessionId);
|
|
144159
144263
|
const pendingSwitchSessionId = useSessionStore((s15) => s15.pendingSwitchSessionId);
|
|
144160
144264
|
const pendingHydrationSessionId = useSessionStore((s15) => s15.pendingHydrationSessionId);
|
|
@@ -144197,6 +144301,7 @@ function AppShell() {
|
|
|
144197
144301
|
const [firstLaunchChannel, setFirstLaunchChannel] = reactExports.useState(null);
|
|
144198
144302
|
const [showGroupCreate, setShowGroupCreate] = reactExports.useState(false);
|
|
144199
144303
|
const [mainView, setMainView] = reactExports.useState("chat");
|
|
144304
|
+
const visibleSessionId = sessionInSight(activeSessionId2, mainView === "chat");
|
|
144200
144305
|
const [extensionsOpen, setExtensionsOpen] = reactExports.useState(false);
|
|
144201
144306
|
const [openPanelOpen, setOpenPanelOpen] = reactExports.useState(false);
|
|
144202
144307
|
const [translationRequestSeq, setTranslationRequestSeq] = reactExports.useState(0);
|
|
@@ -144905,8 +145010,12 @@ function AppShell() {
|
|
|
144905
145010
|
useRunUnreadStore.getState().start();
|
|
144906
145011
|
}, []);
|
|
144907
145012
|
reactExports.useEffect(() => {
|
|
144908
|
-
if (
|
|
144909
|
-
}, [
|
|
145013
|
+
if (visibleSessionId) useRunUnreadStore.getState().clear(visibleSessionId);
|
|
145014
|
+
}, [visibleSessionId]);
|
|
145015
|
+
reactExports.useEffect(() => {
|
|
145016
|
+
const stale2 = activeUnreadToClear(runUnreadEntries, visibleSessionId);
|
|
145017
|
+
if (stale2) useRunUnreadStore.getState().clear(stale2);
|
|
145018
|
+
}, [visibleSessionId, runUnreadEntries]);
|
|
144910
145019
|
const handleOpenSavedMessages = reactExports.useCallback(() => {
|
|
144911
145020
|
cancelPendingNavigation();
|
|
144912
145021
|
setMainView("saved");
|
|
@@ -145221,7 +145330,8 @@ function AppShell() {
|
|
|
145221
145330
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
145222
145331
|
TaskUnreadToast,
|
|
145223
145332
|
{
|
|
145224
|
-
activeSessionId:
|
|
145333
|
+
activeSessionId: visibleSessionId,
|
|
145334
|
+
pinnedSessionIds: pinnedSessionIdSet,
|
|
145225
145335
|
onOpen: (entry2) => {
|
|
145226
145336
|
const controller = beginPendingNavigation(entry2.sessionId);
|
|
145227
145337
|
void activateOwnedSession(entry2.sessionId, controller.signal);
|