@sinm/kai 1.15.8 → 1.15.10
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/README.md +1 -1
- package/RELEASE_NOTES.md +75 -0
- package/dist-cli/kai-cli.js +89519 -85867
- package/dist-electron/main/image-worker.js +3 -1
- package/dist-electron/main/plugin-host.js +179 -22
- package/dist-electron/renderer/assets/{ContextDraftStrip-BdkjcFzK.js → ContextDraftStrip-CM-2aRnV.js} +34 -5
- package/dist-electron/renderer/assets/{desktop-overlay-reason-Brz0kEaz.js → desktop-overlay-reason-Lk3ArWYm.js} +108 -59
- package/dist-electron/renderer/assets/{index-DZMGo-eK.js → index-2o21y_A2.js} +10372 -6588
- package/dist-electron/renderer/assets/{index-BmJPPSwb.css → index-CNIvLq5A.css} +3942 -1721
- package/dist-electron/renderer/assets/{index-Dw1GJ0F4.js → index-D-VQacpk.js} +2 -2
- package/dist-electron/renderer/assets/{index-CxNNir1f.js → index-D13SQmIx.js} +63 -11
- package/dist-electron/renderer/assets/{localUrlCodec-BE9hUkWM.js → localUrlCodec-DIa41KGx.js} +29 -15
- package/dist-electron/renderer/assets/{index.es-B-PFCvGY.js → office-preview-BS5mB52v.js} +526 -1
- package/dist-electron/renderer/assets/{overlay-jC_zo_GK.js → overlay-CBbZ1t7x.js} +53 -7
- package/dist-electron/renderer/assets/{parser-Bgw_IcYs.js → parser-BfKF1DWc.js} +1 -1
- package/dist-electron/renderer/assets/{spreadsheet-DCnzJbCU.js → spreadsheet-1QmRJRGI.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 +1 -1
- package/dist-electron/renderer/assets/office-preview-D7ZVJjw5.js +0 -240
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./spreadsheet-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./spreadsheet-1QmRJRGI.js","./preload-helper-DVzrZ_Op.js","./assets-tzxXyukA.js","./index-B5MYHOIO.js","./zoom-jYhmkcQX.js","./options-SsS0Y_ki.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import { _ as __vitePreload } from "./preload-helper-DVzrZ_Op.js";
|
|
3
3
|
import { D as DEFAULT_RENDERER_DEFINITIONS } from "./index-B5MYHOIO.js";
|
|
4
4
|
const spreadsheetDefinition = DEFAULT_RENDERER_DEFINITIONS.find((definition) => definition.id === "spreadsheet-openxml");
|
|
@@ -9,7 +9,7 @@ if (!spreadsheetDefinition || !dbfDefinition) {
|
|
|
9
9
|
const spreadsheetRendererDefinition = spreadsheetDefinition;
|
|
10
10
|
const dbfRendererDefinition = dbfDefinition;
|
|
11
11
|
const renderFileViewerSpreadsheet = (buffer, target, type, context) => __vitePreload(async () => {
|
|
12
|
-
const { default: renderSpreadsheet } = await import("./spreadsheet-
|
|
12
|
+
const { default: renderSpreadsheet } = await import("./spreadsheet-1QmRJRGI.js").then((n) => n.s);
|
|
13
13
|
return { default: renderSpreadsheet };
|
|
14
14
|
}, true ? __vite__mapDeps([0,1,2,3,4,5]) : void 0, import.meta.url).then(({ default: renderSpreadsheet }) => renderSpreadsheet(buffer, target, type, context));
|
|
15
15
|
({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as reactExports, j as jsxRuntimeExports, g as getTransport, f as resolveConnectionTarget, u as urlHostLabel, h as isBuiltinPreviewableExtension, n as normalizePreviewerExtension, d as describePluginPageOpenError, b as describePluginViewFailure, P as PluginViewHost, k as resolveLocalUrl, t as toLocalPathSegment, l as localHttpUrlToKaiUrl, m as buildDownloadUrl, o as buildOfficePreviewUrl } from "./desktop-overlay-reason-
|
|
2
|
-
import { c as createLucideIcon, S as SyntaxHighlighter, d as styles, u as useTranslation, e as subscribeComposerAvailability, f as getComposerBlockedReason, s as subscribePreviewSelectionDrafts, g as getPreviewSelectionDrafts, t as toast, M as MAX_PREVIEW_SELECTION_DRAFTS, h as buildPreviewSelectionDraft, i as appendPreviewSelectionDraft, j as genId, k as ID_TYPE, l as usePopoverMenu, b as clsx, A as AppTooltip, m as reactDomExports, n as TriangleAlert, X, o as telemetry, L as LoaderCircle, p as useLayerAbove, D as Download, q as useEnclosingLayer, v as subscribeClosableLayers, R as RefreshCw, P as Pencil, w as isAbsoluteLocalPath, x as usePluginDisplayName, y as pluginDisplayFallbackName, z as ExternalLink, B as useTheme, C as useSessionStore, F as useActiveView, G as useFilePreviewStore, H as usePluginPreviewerStore, J as useFileTreeStore, K as useRightDockLayout, N as useRightDockWidthBounds, O as useResizablePanelWidth, Q as useRightDockActiveView, U as useRightDockEntry, V as useRightDockHost, W as useTextSelectionQuote, Y as useClosableLayer, Z as pushClosableLayer, _ as isPreviewableImage, $ as isPreviewableAudio, a0 as isPreviewableVideo, a1 as Copy, a2 as copyToClipboard, a3 as Link, a4 as Globe, a5 as FolderOpen, a6 as PictureInPicture2, a7 as PanelRight, a8 as RightDockActions, a9 as QuoteSelectionButton, aa as CircleAlert, ab as FileTypeIcon, ac as DiffViewer, ad as atomOneDark, ae as githubGist, af as MarkdownMessage, ag as ContextMenu, ah as Eye, ai as CodeXml, aj as Crosshair, ak as ToolbarMoreMenu, al as TranslationDialog, am as ImageViewer, an as RightPanelShell, ao as RIGHT_DOCK_WIDTH_STORAGE_VERSION, ap as closeTopmostClosableLayer, aq as saveLocalFileAsWithToast, ar as Search, as as ChevronUp, at as ChevronDown, au as trackMessageActionClick, av as formatFileQuoteText, aw as appendQuoteDraft, ax as ClosableLayerProvider, ay as ChevronRight, az as Folder, aA as tryOpenWithSystemApp } from "./index-
|
|
3
|
-
import { K as KAI_LOCAL_URL_PREFIX, a as KAI_URL_SCHEME, O as OFFICE_PREVIEW_FORMATS } from "./localUrlCodec-
|
|
1
|
+
import { r as reactExports, j as jsxRuntimeExports, g as getTransport, f as resolveConnectionTarget, u as urlHostLabel, h as isBuiltinPreviewableExtension, n as normalizePreviewerExtension, d as describePluginPageOpenError, b as describePluginViewFailure, P as PluginViewHost, k as resolveLocalUrl, t as toLocalPathSegment, l as localHttpUrlToKaiUrl, m as buildDownloadUrl, o as buildOfficePreviewUrl } from "./desktop-overlay-reason-Lk3ArWYm.js";
|
|
2
|
+
import { c as createLucideIcon, S as SyntaxHighlighter, d as styles, u as useTranslation, e as subscribeComposerAvailability, f as getComposerBlockedReason, s as subscribePreviewSelectionDrafts, g as getPreviewSelectionDrafts, t as toast, M as MAX_PREVIEW_SELECTION_DRAFTS, h as buildPreviewSelectionDraft, i as appendPreviewSelectionDraft, j as genId, k as ID_TYPE, l as usePopoverMenu, b as clsx, A as AppTooltip, m as reactDomExports, n as TriangleAlert, X, o as telemetry, L as LoaderCircle, p as useLayerAbove, D as Download, q as useEnclosingLayer, v as subscribeClosableLayers, R as RefreshCw, P as Pencil, w as isAbsoluteLocalPath, x as usePluginDisplayName, y as pluginDisplayFallbackName, z as ExternalLink, B as useTheme, C as useSessionStore, F as useActiveView, G as useFilePreviewStore, H as usePluginPreviewerStore, J as useFileTreeStore, K as useRightDockLayout, N as useRightDockWidthBounds, O as useResizablePanelWidth, Q as useRightDockActiveView, U as useRightDockEntry, V as useRightDockHost, W as useTextSelectionQuote, Y as useClosableLayer, Z as pushClosableLayer, _ as isPreviewableImage, $ as isPreviewableAudio, a0 as isPreviewableVideo, a1 as Copy, a2 as copyToClipboard, a3 as Link, a4 as Globe, a5 as FolderOpen, a6 as PictureInPicture2, a7 as PanelRight, a8 as RightDockActions, a9 as QuoteSelectionButton, aa as CircleAlert, ab as FileTypeIcon, ac as DiffViewer, ad as atomOneDark, ae as githubGist, af as MarkdownMessage, ag as ContextMenu, ah as Eye, ai as CodeXml, aj as Crosshair, ak as ToolbarMoreMenu, al as TranslationDialog, am as ImageViewer, an as RightPanelShell, ao as RIGHT_DOCK_WIDTH_STORAGE_VERSION, ap as closeTopmostClosableLayer, aq as saveLocalFileAsWithToast, ar as Search, as as ChevronUp, at as ChevronDown, au as trackMessageActionClick, av as formatFileQuoteText, aw as appendQuoteDraft, ax as ClosableLayerProvider, ay as ChevronRight, az as Folder, aA as tryOpenWithSystemApp } from "./index-2o21y_A2.js";
|
|
3
|
+
import { K as KAI_LOCAL_URL_PREFIX, a as KAI_URL_SCHEME, O as OFFICE_PREVIEW_FORMATS } from "./localUrlCodec-DIa41KGx.js";
|
|
4
4
|
import "./_commonjsHelpers-DWwsNxpa.js";
|
|
5
5
|
import "./preload-helper-DVzrZ_Op.js";
|
|
6
6
|
const PICKABLE_OFFICE_PREVIEW_FORMATS = [
|
|
@@ -9,7 +9,13 @@ const PICKABLE_OFFICE_PREVIEW_FORMATS = [
|
|
|
9
9
|
// pdf 的粒度与另两个不同:单页矩形框选 + 框内文本增强(不是形状级,见
|
|
10
10
|
// `office-preview-pdf-region.ts` 文件头)。它仍在这份清单里——清单回答的是「这个格式能不能指」,
|
|
11
11
|
// 不回答「用哪种手势」。
|
|
12
|
-
"pdf"
|
|
12
|
+
"pdf",
|
|
13
|
+
// 表格:手势又不同(**选区驱动**,见 `office-preview-xlsx.ts` 文件头)。同样只回答「能不能指」。
|
|
14
|
+
// legacy `xls` 与 `csv` / `tsv` 共用同一个渲染器与同一条契约位,所以一起认领。
|
|
15
|
+
"xlsx",
|
|
16
|
+
"xls",
|
|
17
|
+
"csv",
|
|
18
|
+
"tsv"
|
|
13
19
|
];
|
|
14
20
|
const PREVIEW_PICKER_ASSET_PATH = "/preview-shared/preview-picker.js";
|
|
15
21
|
const PREVIEW_PICKER_DOCUMENT_PARAM = "kai-preview-pick";
|
|
@@ -262,6 +268,11 @@ function useReloadHint(active) {
|
|
|
262
268
|
function SkeletonLines({ testId }) {
|
|
263
269
|
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.skeletonLines, "data-testid": testId, "aria-hidden": "true", children: SKELETON_LINE_WIDTHS.map((width) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles.skeletonLine, style: { width } }, width)) });
|
|
264
270
|
}
|
|
271
|
+
function pickButtonMode(input) {
|
|
272
|
+
if (!input.isPicking) return "enter";
|
|
273
|
+
if (!input.submit) return "exit";
|
|
274
|
+
return input.submit.ready ? "submit" : "submit-blocked";
|
|
275
|
+
}
|
|
265
276
|
const FAILURE_KEYS = {
|
|
266
277
|
"preview-unavailable": "filePreview.pick.failed.previewUnavailable",
|
|
267
278
|
"pick-unavailable": "filePreview.pick.failed.pickUnavailable",
|
|
@@ -279,7 +290,8 @@ const FAILURE_KEYS = {
|
|
|
279
290
|
"overlay-tampered": "filePreview.pick.failed.overlayTampered",
|
|
280
291
|
"capture-too-large": "filePreview.pick.failed.captureTooLarge",
|
|
281
292
|
"format-unresolved": "filePreview.pick.failed.formatUnresolved",
|
|
282
|
-
"format-unsupported": "filePreview.pick.failed.formatUnsupported"
|
|
293
|
+
"format-unsupported": "filePreview.pick.failed.formatUnsupported",
|
|
294
|
+
"sheet-unresolved": "filePreview.pick.failed.sheetUnresolved"
|
|
283
295
|
};
|
|
284
296
|
const FALLBACK_KEY = "filePreview.pick.failed.unknown";
|
|
285
297
|
function pickFailureMessageKey(reason) {
|
|
@@ -291,6 +303,7 @@ function useUrlPreviewPick(sessionId, adapter, surfaceName) {
|
|
|
291
303
|
const { t } = useTranslation();
|
|
292
304
|
const [previewTarget, setPreviewTarget] = reactExports.useState(null);
|
|
293
305
|
const [isPicking, setIsPicking] = reactExports.useState(false);
|
|
306
|
+
const [pickSubmit, setPickSubmit] = reactExports.useState(null);
|
|
294
307
|
const isPickingRef = reactExports.useRef(false);
|
|
295
308
|
isPickingRef.current = isPicking;
|
|
296
309
|
const lastBlockedNoticeRef = reactExports.useRef(null);
|
|
@@ -346,8 +359,30 @@ function useUrlPreviewPick(sessionId, adapter, surfaceName) {
|
|
|
346
359
|
},
|
|
347
360
|
[adapter]
|
|
348
361
|
);
|
|
362
|
+
const submitPick = reactExports.useCallback(
|
|
363
|
+
(id) => {
|
|
364
|
+
if (adapter) return Promise.resolve(null);
|
|
365
|
+
return getTransport().nativeUrlPreviewPick({ direction: "capture", id }).catch(() => null);
|
|
366
|
+
},
|
|
367
|
+
[adapter]
|
|
368
|
+
);
|
|
349
369
|
const togglePick = reactExports.useCallback(async () => {
|
|
350
370
|
if (isPicking) {
|
|
371
|
+
const mode = pickButtonMode({ isPicking, submit: adapter ? null : pickSubmit });
|
|
372
|
+
if (mode === "submit-blocked") {
|
|
373
|
+
noticeBlocked(t("filePreview.pick.disabled.noSelection"));
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (mode === "submit") {
|
|
377
|
+
if (!previewId) return;
|
|
378
|
+
const result2 = await submitPick(previewId);
|
|
379
|
+
if (!result2) {
|
|
380
|
+
reportPickFailure("pick-unavailable");
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
if (!result2.ok && result2.reason) reportPickFailure(result2.reason);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
351
386
|
setIsPicking(false);
|
|
352
387
|
if (previewId) cancelPick(previewId);
|
|
353
388
|
return;
|
|
@@ -364,13 +399,17 @@ function useUrlPreviewPick(sessionId, adapter, surfaceName) {
|
|
|
364
399
|
}
|
|
365
400
|
if (!result.ok && result.reason) reportPickFailure(result.reason);
|
|
366
401
|
}, [
|
|
402
|
+
adapter,
|
|
367
403
|
cancelPick,
|
|
368
404
|
isPicking,
|
|
369
405
|
noticeBlocked,
|
|
370
406
|
pickBlockedReason,
|
|
407
|
+
pickSubmit,
|
|
371
408
|
previewId,
|
|
372
409
|
reportPickFailure,
|
|
373
|
-
startPick
|
|
410
|
+
startPick,
|
|
411
|
+
submitPick,
|
|
412
|
+
t
|
|
374
413
|
]);
|
|
375
414
|
const handlePicked = reactExports.useCallback(
|
|
376
415
|
(picked) => {
|
|
@@ -389,13 +428,17 @@ function useUrlPreviewPick(sessionId, adapter, surfaceName) {
|
|
|
389
428
|
const handlePickState = reactExports.useCallback(
|
|
390
429
|
(state) => {
|
|
391
430
|
setIsPicking(state.picking);
|
|
431
|
+
setPickSubmit(state.picking && state.submit ? state.submit : null);
|
|
392
432
|
if (state.reason) reportPickFailure(state.reason);
|
|
393
433
|
},
|
|
394
434
|
[reportPickFailure]
|
|
395
435
|
);
|
|
396
436
|
const handlePreviewStateChange = reactExports.useCallback((target) => {
|
|
397
437
|
setPreviewTarget(target);
|
|
398
|
-
if (!target)
|
|
438
|
+
if (!target) {
|
|
439
|
+
setIsPicking(false);
|
|
440
|
+
setPickSubmit(null);
|
|
441
|
+
}
|
|
399
442
|
}, []);
|
|
400
443
|
reactExports.useEffect(() => {
|
|
401
444
|
if (!previewId) return;
|
|
@@ -416,9 +459,12 @@ function useUrlPreviewPick(sessionId, adapter, surfaceName) {
|
|
|
416
459
|
window.addEventListener("keydown", onKeyDown, true);
|
|
417
460
|
return () => window.removeEventListener("keydown", onKeyDown, true);
|
|
418
461
|
}, [cancelPick, isPicking, previewId]);
|
|
462
|
+
const pickButton = pickButtonMode({ isPicking, submit: adapter ? null : pickSubmit });
|
|
419
463
|
return {
|
|
420
464
|
isPicking,
|
|
421
465
|
pickBlockedReason,
|
|
466
|
+
pickButton,
|
|
467
|
+
pickButtonBlockedReason: pickButton === "submit-blocked" ? t("filePreview.pick.disabled.noSelection") : void 0,
|
|
422
468
|
togglePick,
|
|
423
469
|
handlePicked,
|
|
424
470
|
handlePickState,
|
|
@@ -1533,7 +1579,8 @@ function OfficePreviewHost({
|
|
|
1533
1579
|
if (state.id !== generation || disposed) return;
|
|
1534
1580
|
callbacksRef.current.onPickState?.({
|
|
1535
1581
|
picking: state.picking,
|
|
1536
|
-
...state.reason ? { reason: state.reason } : {}
|
|
1582
|
+
...state.reason ? { reason: state.reason } : {},
|
|
1583
|
+
...state.submit ? { submit: state.submit } : {}
|
|
1537
1584
|
});
|
|
1538
1585
|
});
|
|
1539
1586
|
const resizeObserver = new ResizeObserver(sync);
|
|
@@ -2702,15 +2749,20 @@ function FilePreviewDrawer() {
|
|
|
2702
2749
|
const canonical = resolveLocalUrl(filePath);
|
|
2703
2750
|
return localHttpUrlToKaiUrl(canonical) ?? canonical;
|
|
2704
2751
|
}, [contentKind, fileName, filePath, t]);
|
|
2705
|
-
const
|
|
2752
|
+
const pickEntryLabel = officePreviewFormat ? t("filePreview.pick.actionDocument") : t("filePreview.pick.action");
|
|
2706
2753
|
const {
|
|
2707
2754
|
isPicking,
|
|
2708
2755
|
pickBlockedReason,
|
|
2756
|
+
pickButton,
|
|
2757
|
+
pickButtonBlockedReason,
|
|
2709
2758
|
togglePick: handleTogglePick,
|
|
2710
2759
|
handlePicked: handlePreviewPicked,
|
|
2711
2760
|
handlePickState: handlePreviewPickState,
|
|
2712
2761
|
handlePreviewStateChange
|
|
2713
2762
|
} = useUrlPreviewPick(activeSessionId, htmlPickAdapter, fileName);
|
|
2763
|
+
const pickSubmittable = pickButton === "submit" || pickButton === "submit-blocked";
|
|
2764
|
+
const pickActionLabel = pickSubmittable ? t("filePreview.pick.actionSubmit") : pickEntryLabel;
|
|
2765
|
+
const pickHint = pickButtonBlockedReason ?? pickBlockedReason ?? pickActionLabel;
|
|
2714
2766
|
if (dockActiveView !== "files" && !isClosing) return null;
|
|
2715
2767
|
const handleOpenExternal = () => {
|
|
2716
2768
|
if (filePath) {
|
|
@@ -3507,7 +3559,7 @@ function FilePreviewDrawer() {
|
|
|
3507
3559
|
readActions.push({
|
|
3508
3560
|
id: "pick",
|
|
3509
3561
|
// 不可用时菜单项说原因(与 tooltip 同一句):灰着不解释等于让用户以为自己不会用
|
|
3510
|
-
label:
|
|
3562
|
+
label: pickHint,
|
|
3511
3563
|
icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Crosshair, { size: 15, "aria-hidden": "true" }),
|
|
3512
3564
|
onSelect: () => {
|
|
3513
3565
|
trackFilePreviewAction("pick");
|
|
@@ -3607,7 +3659,7 @@ function FilePreviewDrawer() {
|
|
|
3607
3659
|
className: styles.toolbarGroup,
|
|
3608
3660
|
role: "group",
|
|
3609
3661
|
"aria-label": t("filePreview.pick.group"),
|
|
3610
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppTooltip, { content:
|
|
3662
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(AppTooltip, { content: pickHint, children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles.tooltipTrigger, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
3611
3663
|
"button",
|
|
3612
3664
|
{
|
|
3613
3665
|
className: clsx(styles.toolbarButton, isPicking && styles.toolbarButtonActive),
|
package/dist-electron/renderer/assets/{localUrlCodec-BE9hUkWM.js → localUrlCodec-DIa41KGx.js}
RENAMED
|
@@ -19,8 +19,8 @@ const IPC_CANCEL_COMPACT_SESSION = "CANCEL_COMPACT_SESSION";
|
|
|
19
19
|
const IPC_CANCEL_QUEUED_MESSAGES = "CANCEL_QUEUED_MESSAGES";
|
|
20
20
|
const IPC_GUIDE_QUEUED_MESSAGE = "GUIDE_QUEUED_MESSAGE";
|
|
21
21
|
const IPC_CANCEL_GUIDANCE = "CANCEL_GUIDANCE";
|
|
22
|
-
const
|
|
23
|
-
const
|
|
22
|
+
const IPC_LIST_QUESTIONS = "LIST_QUESTIONS";
|
|
23
|
+
const IPC_ANSWER_QUESTION = "ANSWER_QUESTION";
|
|
24
24
|
const IPC_PRUNE_SESSION_TODO = "PRUNE_SESSION_TODO";
|
|
25
25
|
const IPC_REQUEST_SESSION_SNAPSHOT = "SUBSCRIBE_SESSION";
|
|
26
26
|
const IPC_SESSION_EVENT = "SESSION_EVENT";
|
|
@@ -91,6 +91,17 @@ const IPC_SETTINGS_CHANGE_DATA_DIR = "SETTINGS:CHANGE_DATA_DIR";
|
|
|
91
91
|
const IPC_SETTINGS_OPEN_DATA_DIR = "SETTINGS:OPEN_DATA_DIR";
|
|
92
92
|
const IPC_SETTINGS_ON_MIGRATION_PROGRESS = "SETTINGS:ON_MIGRATION_PROGRESS";
|
|
93
93
|
const IPC_SETTINGS_RESTART_APP = "SETTINGS:RESTART_APP";
|
|
94
|
+
const IPC_MIGRATION_EXPORT_PREVIEW = "MIGRATION:EXPORT_PREVIEW";
|
|
95
|
+
const IPC_MIGRATION_EXPORT_START = "MIGRATION:EXPORT_START";
|
|
96
|
+
const IPC_MIGRATION_INSPECT = "MIGRATION:INSPECT";
|
|
97
|
+
const IPC_MIGRATION_APPLY = "MIGRATION:APPLY";
|
|
98
|
+
const IPC_MIGRATION_CANCEL = "MIGRATION:CANCEL";
|
|
99
|
+
const IPC_MIGRATION_RESTART = "MIGRATION:RESTART";
|
|
100
|
+
const IPC_MIGRATION_LAST_SUMMARY = "MIGRATION:LAST_SUMMARY";
|
|
101
|
+
const IPC_MIGRATION_PROGRESS = "MIGRATION:PROGRESS";
|
|
102
|
+
const IPC_MIGRATION_PENDING_INSPECT = "MIGRATION:PENDING_INSPECT";
|
|
103
|
+
const IPC_MIGRATION_PENDING_CONTINUE = "MIGRATION:PENDING_CONTINUE";
|
|
104
|
+
const IPC_MIGRATION_PENDING_DISCARD = "MIGRATION:PENDING_DISCARD";
|
|
94
105
|
const IPC_GET_MCP_SERVERS = "GET_MCP_SERVERS";
|
|
95
106
|
const IPC_SAVE_MCP_SERVERS = "SAVE_MCP_SERVERS";
|
|
96
107
|
const IPC_TEST_MCP_SERVER = "TEST_MCP_SERVER";
|
|
@@ -131,7 +142,6 @@ const IPC_POLISH_MESSAGE_DRAFT = "POLISH_MESSAGE_DRAFT";
|
|
|
131
142
|
const IPC_GET_AGENT_CHANNELS = "GET_AGENT_CHANNELS";
|
|
132
143
|
const IPC_UPDATE_AGENT_CHANNELS = "UPDATE_AGENT_CHANNELS";
|
|
133
144
|
const IPC_SWITCH_CHANNEL = "SWITCH_CHANNEL";
|
|
134
|
-
const IPC_CREATE_SESSION = "CREATE_SESSION";
|
|
135
145
|
const IPC_GET_SESSION = "GET_SESSION";
|
|
136
146
|
const IPC_LIST_SESSIONS = "LIST_SESSIONS";
|
|
137
147
|
const IPC_LIST_RUNNING_SESSIONS = "SESSION:LIST_RUNNING_SESSIONS";
|
|
@@ -361,6 +371,8 @@ const NO_HOSTS = [];
|
|
|
361
371
|
const IPC_ENDPOINTS = {
|
|
362
372
|
// ChatApi
|
|
363
373
|
sendUserMessage: { channel: IPC_SEND_USER_MESSAGE, hosts: ALL_HOSTS },
|
|
374
|
+
listQuestions: { channel: IPC_LIST_QUESTIONS, hosts: ALL_HOSTS },
|
|
375
|
+
answerQuestion: { channel: IPC_ANSWER_QUESTION, hosts: ALL_HOSTS },
|
|
364
376
|
stopRun: { channel: IPC_STOP_RUN, hosts: ALL_HOSTS },
|
|
365
377
|
abortDelegate: { channel: IPC_DELEGATE_ABORT, hosts: ALL_HOSTS },
|
|
366
378
|
updateDelegateConfig: { channel: IPC_DELEGATE_UPDATE_CONFIG, hosts: ALL_HOSTS },
|
|
@@ -394,7 +406,6 @@ const IPC_ENDPOINTS = {
|
|
|
394
406
|
updateAgentChannels: { channel: IPC_UPDATE_AGENT_CHANNELS, hosts: ALL_HOSTS },
|
|
395
407
|
switchChannel: { channel: IPC_SWITCH_CHANNEL, hosts: ALL_HOSTS },
|
|
396
408
|
// SessionApi
|
|
397
|
-
createSession: { channel: IPC_CREATE_SESSION, hosts: ALL_HOSTS },
|
|
398
409
|
getSession: { channel: IPC_GET_SESSION, hosts: ALL_HOSTS },
|
|
399
410
|
listSessions: { channel: IPC_LIST_SESSIONS, hosts: ALL_HOSTS },
|
|
400
411
|
listRunningSessions: { channel: IPC_LIST_RUNNING_SESSIONS, hosts: ALL_HOSTS },
|
|
@@ -678,6 +689,18 @@ const IPC_ENDPOINTS = {
|
|
|
678
689
|
openDataDirInExplorer: { channel: IPC_SETTINGS_OPEN_DATA_DIR, hosts: IPC_ONLY },
|
|
679
690
|
onDataDirMigrationProgress: { channel: IPC_SETTINGS_ON_MIGRATION_PROGRESS, hosts: ALL_HOSTS },
|
|
680
691
|
restartApp: { channel: IPC_SETTINGS_RESTART_APP, hosts: ALL_HOSTS },
|
|
692
|
+
// MigrationApi(specs/migration-package.md §7)
|
|
693
|
+
exportPreview: { channel: IPC_MIGRATION_EXPORT_PREVIEW, hosts: ALL_HOSTS },
|
|
694
|
+
exportStart: { channel: IPC_MIGRATION_EXPORT_START, hosts: ALL_HOSTS },
|
|
695
|
+
inspect: { channel: IPC_MIGRATION_INSPECT, hosts: ALL_HOSTS },
|
|
696
|
+
apply: { channel: IPC_MIGRATION_APPLY, hosts: ALL_HOSTS },
|
|
697
|
+
cancel: { channel: IPC_MIGRATION_CANCEL, hosts: ALL_HOSTS },
|
|
698
|
+
restart: { channel: IPC_MIGRATION_RESTART, hosts: ALL_HOSTS },
|
|
699
|
+
getLastSummary: { channel: IPC_MIGRATION_LAST_SUMMARY, hosts: ALL_HOSTS },
|
|
700
|
+
onProgress: { channel: IPC_MIGRATION_PROGRESS, hosts: ALL_HOSTS },
|
|
701
|
+
pendingInspect: { channel: IPC_MIGRATION_PENDING_INSPECT, hosts: ALL_HOSTS },
|
|
702
|
+
pendingContinue: { channel: IPC_MIGRATION_PENDING_CONTINUE, hosts: ALL_HOSTS },
|
|
703
|
+
pendingDiscard: { channel: IPC_MIGRATION_PENDING_DISCARD, hosts: ALL_HOSTS },
|
|
681
704
|
// TelemetryApi
|
|
682
705
|
telemetryTrack: { channel: IPC_TELEMETRY_TRACK, hosts: ALL_HOSTS },
|
|
683
706
|
telemetryFeedback: { channel: IPC_TELEMETRY_FEEDBACK, hosts: ALL_HOSTS },
|
|
@@ -757,16 +780,6 @@ const IPC_ENDPOINTS = {
|
|
|
757
780
|
decideExternalApproval: { channel: IPC_EXTERNAL_APPROVAL_DECIDE, hosts: ALL_HOSTS },
|
|
758
781
|
acknowledgeExternalApproval: { channel: IPC_EXTERNAL_APPROVAL_ACKNOWLEDGE, hosts: ALL_HOSTS },
|
|
759
782
|
onExternalApprovalEvent: { channel: IPC_EXTERNAL_APPROVAL_ON_EVENT, hosts: ALL_HOSTS },
|
|
760
|
-
// 显式重定会话工具上限(P1):纯本地写(读档案 / 群记录 + 写一条 thread 事件),不认识宿主特有
|
|
761
|
-
// 能力 ⇒ `ALL_HOSTS`(`IPC_ONLY` 只留给要原生对话框 / 存盘那类格子)。命令行入口(CLI)与桌面同源:
|
|
762
|
-
// 动作的生产绑定在组合根,接站面只做「取来交给 handler」。
|
|
763
|
-
raiseSessionToolCeiling: { channel: IPC_RAISE_SESSION_TOOL_CEILING, hosts: ALL_HOSTS },
|
|
764
|
-
// 会话工具面的陈旧度读数(C):纯本地只读(读各线上限 + 当下的面开关),不认识宿主特有能力 ⇒
|
|
765
|
-
// `ALL_HOSTS`(`IPC_ONLY` 只留给原生对话框 / 存盘那类格子)。
|
|
766
|
-
getSessionToolCeilingStaleness: {
|
|
767
|
-
channel: IPC_GET_SESSION_TOOL_CEILING_STALENESS,
|
|
768
|
-
hosts: ALL_HOSTS
|
|
769
|
-
},
|
|
770
783
|
// 台账清理(§2.15):纯本地写(读一条线的台账 + 写一条 thread 事件),不认识宿主特有能力 ⇒
|
|
771
784
|
// `ALL_HOSTS`;与工具上限重设同一档(动作的生产绑定在组合根,接站面只做「取来交给 handler」)。
|
|
772
785
|
pruneSessionTodo: { channel: IPC_PRUNE_SESSION_TODO, hosts: ALL_HOSTS },
|
|
@@ -1040,7 +1053,8 @@ const CONTENT_BLOCK_TYPE_LIST = {
|
|
|
1040
1053
|
attachments: true,
|
|
1041
1054
|
task: true,
|
|
1042
1055
|
"runtime-event": true,
|
|
1043
|
-
"declarative-ui": true
|
|
1056
|
+
"declarative-ui": true,
|
|
1057
|
+
question: true
|
|
1044
1058
|
};
|
|
1045
1059
|
new Set(Object.keys(CONTENT_BLOCK_TYPE_LIST));
|
|
1046
1060
|
function encodePathPreservingSlashes(pathSegment) {
|