@senguoyun/dsh-arkme 0.1.60 → 0.1.62
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/cordis.patch.yml +6 -0
- package/docs/search-dsh-navigation.md +37 -0
- package/lib/client.js +3537 -2457
- package/lib/client.js.map +1 -1
- package/lib/harness-model-client.js +12 -0
- package/lib/harness-native-selection-client.js +1341 -0
- package/lib/harness-onboarding-client.js +64 -2
- package/lib/harness-session-client.js +88 -2
- package/lib/index.js +135 -156
- package/lib/persistent-extension.js +1 -1
- package/lib/{persistent-runtime-DqPfc6RO.js → persistent-runtime-DUrok1U3.js} +29882 -29485
- package/lib/sdk.js +12 -0
- package/lib/types/arkme-service.d.ts +8 -2
- package/lib/types/arkme-service.d.ts.map +1 -1
- package/lib/types/client/ArkmeAvatar.d.ts.map +1 -1
- package/lib/types/client/ArkmeChatMemberActions.d.ts +1 -1
- package/lib/types/client/ArkmeChatMemberActions.d.ts.map +1 -1
- package/lib/types/client/ArkmeConversationSearch.d.ts.map +1 -1
- package/lib/types/client/ArkmeDetailShell.d.ts +3 -1
- package/lib/types/client/ArkmeDetailShell.d.ts.map +1 -1
- package/lib/types/client/ArkmeFileViewer.d.ts +1 -0
- package/lib/types/client/ArkmeFileViewer.d.ts.map +1 -1
- package/lib/types/client/ArkmeLongArticleDialog.d.ts +5 -0
- package/lib/types/client/ArkmeLongArticleDialog.d.ts.map +1 -1
- package/lib/types/client/ArkmeMessageActions.d.ts.map +1 -1
- package/lib/types/client/ArkmeNoteDetails.d.ts +2 -1
- package/lib/types/client/ArkmeNoteDetails.d.ts.map +1 -1
- package/lib/types/client/ArkmePrivateCallMenu.d.ts.map +1 -1
- package/lib/types/client/ArkmeProductNavigation.d.ts.map +1 -1
- package/lib/types/client/ArkmeRecordEditHistory.d.ts +10 -0
- package/lib/types/client/ArkmeRecordEditHistory.d.ts.map +1 -0
- package/lib/types/client/ArkmeRichContent.d.ts +5 -1
- package/lib/types/client/ArkmeRichContent.d.ts.map +1 -1
- package/lib/types/client/ArkmeSearchSurface.d.ts.map +1 -1
- package/lib/types/client/ArkmeSidebar.d.ts.map +1 -1
- package/lib/types/client/ArkmeTopicDirectoryPopover.d.ts +2 -1
- package/lib/types/client/ArkmeTopicDirectoryPopover.d.ts.map +1 -1
- package/lib/types/client/ArkmeVirtualWorkspace.d.ts.map +1 -1
- package/lib/types/client/ArkmeWorldSurface.d.ts +3 -3
- package/lib/types/client/ArkmeWorldSurface.d.ts.map +1 -1
- package/lib/types/client/DeepSeekHarnessSurface.d.ts +4 -0
- package/lib/types/client/DeepSeekHarnessSurface.d.ts.map +1 -1
- package/lib/types/client/api.d.ts +1 -1
- package/lib/types/client/api.d.ts.map +1 -1
- package/lib/types/client/arkme-theme.d.ts +1 -0
- package/lib/types/client/arkme-theme.d.ts.map +1 -1
- package/lib/types/client/clipboard-text.d.ts +2 -0
- package/lib/types/client/clipboard-text.d.ts.map +1 -0
- package/lib/types/client/harness-native-selection-client.d.ts +13 -0
- package/lib/types/client/harness-native-selection-client.d.ts.map +1 -0
- package/lib/types/client/harness-native-selection-geometry.d.ts +47 -0
- package/lib/types/client/harness-native-selection-geometry.d.ts.map +1 -0
- package/lib/types/client/harness-native-selection-loader.d.ts +4 -0
- package/lib/types/client/harness-native-selection-loader.d.ts.map +1 -0
- package/lib/types/client/harness-native-selection.d.ts +35 -0
- package/lib/types/client/harness-native-selection.d.ts.map +1 -0
- package/lib/types/client/harness-onboarding-client.d.ts.map +1 -1
- package/lib/types/client/harness-session-client.d.ts.map +1 -1
- package/lib/types/client/harness-session-selection.d.ts +9 -0
- package/lib/types/client/harness-session-selection.d.ts.map +1 -0
- package/lib/types/client/harness-session-summary.d.ts +0 -7
- package/lib/types/client/harness-session-summary.d.ts.map +1 -1
- package/lib/types/client/harness-slots-contract.d.ts +12 -0
- package/lib/types/client/harness-slots-contract.d.ts.map +1 -0
- package/lib/types/client/harness-window-drag.d.ts +16 -0
- package/lib/types/client/harness-window-drag.d.ts.map +1 -0
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/interwoven-moments.d.ts.map +1 -1
- package/lib/types/client/member-records-loader.d.ts +10 -0
- package/lib/types/client/member-records-loader.d.ts.map +1 -0
- package/lib/types/client/member-records-viewport.d.ts +10 -0
- package/lib/types/client/member-records-viewport.d.ts.map +1 -0
- package/lib/types/client/message-selection-presentation.d.ts +42 -2
- package/lib/types/client/message-selection-presentation.d.ts.map +1 -1
- package/lib/types/client/redesign/contacts/ContactProfileDetail.d.ts.map +1 -1
- package/lib/types/client/redesign/contacts/ContactWorldList.d.ts +2 -1
- package/lib/types/client/redesign/contacts/ContactWorldList.d.ts.map +1 -1
- package/lib/types/client/timeline-message-order.d.ts +4 -0
- package/lib/types/client/timeline-message-order.d.ts.map +1 -0
- package/lib/types/client/ui-controller.d.ts +7 -1
- package/lib/types/client/ui-controller.d.ts.map +1 -1
- package/lib/types/dsh-search-origins.d.ts +4 -0
- package/lib/types/dsh-search-origins.d.ts.map +1 -0
- package/lib/types/harness-embed-contract.d.ts +10 -0
- package/lib/types/harness-embed-contract.d.ts.map +1 -1
- package/lib/types/harness-embed-route.d.ts +2 -1
- package/lib/types/harness-embed-route.d.ts.map +1 -1
- package/lib/types/harness-session-restore-script.d.ts +9 -0
- package/lib/types/harness-session-restore-script.d.ts.map +1 -0
- package/lib/types/host-api.d.ts.map +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/managed-ai/adapter.d.ts.map +1 -1
- package/lib/types/managed-ai/transport.d.ts.map +1 -1
- package/lib/types/record-edit-history.d.ts +21 -0
- package/lib/types/record-edit-history.d.ts.map +1 -0
- package/lib/types/sdk/index.d.ts +10 -0
- package/lib/types/sdk/index.d.ts.map +1 -1
- package/lib/types/services/chat-service.d.ts +2 -0
- package/lib/types/services/chat-service.d.ts.map +1 -1
- package/lib/types/services/contact-directory-service.d.ts.map +1 -1
- package/lib/types/services/file-transfers.d.ts +5 -1
- package/lib/types/services/file-transfers.d.ts.map +1 -1
- package/lib/types/services/media-service.d.ts +7 -0
- package/lib/types/services/media-service.d.ts.map +1 -1
- package/lib/types/services/record-edit-history-service.d.ts +25 -0
- package/lib/types/services/record-edit-history-service.d.ts.map +1 -0
- package/lib/types/services/record-service.d.ts.map +1 -1
- package/lib/types/services/search-service.d.ts +1 -0
- package/lib/types/services/search-service.d.ts.map +1 -1
- package/lib/types/services/source-service.d.ts.map +1 -1
- package/lib/types/types.d.ts +20 -2
- package/lib/types/types.d.ts.map +1 -1
- package/package.json +5 -5
|
@@ -21,19 +21,79 @@ window.__ModuleLoader__.load({
|
|
|
21
21
|
} catch {}
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
|
+
//#region src/harness-embed-contract.ts
|
|
25
|
+
const ARKME_NATIVE_SELECTION_CLIENT_ID = "@senguoyun/dsh-arkme/harness-native-selection";
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/client/harness-native-selection-loader.ts
|
|
28
|
+
/** Called after native readiness. This resource is deliberately absent from the boot graph. */
|
|
29
|
+
function loadNativeSelection(ctx, doc, url) {
|
|
30
|
+
const modules = ctx.modules;
|
|
31
|
+
if (typeof modules?.import !== "function") return () => {};
|
|
32
|
+
let stopped = false;
|
|
33
|
+
let restore;
|
|
34
|
+
const script = doc.createElement("script");
|
|
35
|
+
script.src = url;
|
|
36
|
+
script.async = true;
|
|
37
|
+
const failed = () => {
|
|
38
|
+
script.remove();
|
|
39
|
+
console.warn("Arkme native selection unavailable; native chat remains active.");
|
|
40
|
+
};
|
|
41
|
+
script.onerror = failed;
|
|
42
|
+
script.onload = () => {
|
|
43
|
+
modules.import(ARKME_NATIVE_SELECTION_CLIENT_ID).then((value) => {
|
|
44
|
+
if (stopped) return;
|
|
45
|
+
const module = value;
|
|
46
|
+
if (typeof module?.install !== "function") throw new Error("Missing native selection entry");
|
|
47
|
+
restore = module.install(ctx, doc);
|
|
48
|
+
}).catch(() => {
|
|
49
|
+
if (!stopped) failed();
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
doc.head.append(script);
|
|
53
|
+
return () => {
|
|
54
|
+
if (stopped) return;
|
|
55
|
+
stopped = true;
|
|
56
|
+
script.onload = null;
|
|
57
|
+
script.onerror = null;
|
|
58
|
+
script.remove();
|
|
59
|
+
restore?.();
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
24
63
|
//#region src/client/harness-onboarding-client.tsx
|
|
25
|
-
const inject = [
|
|
64
|
+
const inject = [
|
|
65
|
+
"slots",
|
|
66
|
+
"sessions",
|
|
67
|
+
"modules"
|
|
68
|
+
];
|
|
26
69
|
/** Runs in the native iframe. The settings coordinator owns when this step mounts. */
|
|
27
70
|
function apply(ctx) {
|
|
28
71
|
const sessions = ctx.sessions;
|
|
29
72
|
let completed = false;
|
|
30
73
|
let wasActive;
|
|
74
|
+
let selectionStarted = false;
|
|
75
|
+
let disposeSelection;
|
|
76
|
+
let selectionTimer;
|
|
31
77
|
const publish = () => {
|
|
32
78
|
const snapshot = sessions.list.getSnapshot();
|
|
33
79
|
const active = snapshot.phase === "ready" && (snapshot.current === void 0 || snapshot.byId[snapshot.current]?.blank === true);
|
|
34
80
|
if (active && wasActive === false) completed = false;
|
|
35
81
|
wasActive = active;
|
|
36
|
-
const
|
|
82
|
+
const ready = snapshot.phase === "ready" && (!active || completed);
|
|
83
|
+
const state = ready ? "ready" : "pending";
|
|
84
|
+
if (ready && !selectionStarted) {
|
|
85
|
+
const asset = document.querySelector("meta[name=\"arkme-native-selection\"]")?.content;
|
|
86
|
+
if (asset && /^\/arkme-self\/harness-native-selection-client\.js\?rev=[a-f0-9]+$/.test(asset)) {
|
|
87
|
+
selectionStarted = true;
|
|
88
|
+
selectionTimer = setTimeout(() => {
|
|
89
|
+
try {
|
|
90
|
+
disposeSelection = loadNativeSelection(ctx, document, asset);
|
|
91
|
+
} catch (error) {
|
|
92
|
+
console.warn("Arkme native selection could not start.", error);
|
|
93
|
+
}
|
|
94
|
+
}, 0);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
37
97
|
if (document.body.dataset.arkmeHarnessOnboarding !== state) {
|
|
38
98
|
document.body.dataset.arkmeHarnessOnboarding = state;
|
|
39
99
|
homeTourDiagnostic("harness-onboarding-state", {
|
|
@@ -56,6 +116,8 @@ window.__ModuleLoader__.load({
|
|
|
56
116
|
const unsubscribe = sessions.list.subscribe(publish);
|
|
57
117
|
return () => {
|
|
58
118
|
unsubscribe();
|
|
119
|
+
clearTimeout(selectionTimer);
|
|
120
|
+
disposeSelection?.();
|
|
59
121
|
delete document.body.dataset.arkmeHarnessOnboarding;
|
|
60
122
|
};
|
|
61
123
|
}, "arkme: native onboarding readiness");
|
|
@@ -4,8 +4,62 @@ window.__ModuleLoader__.load({
|
|
|
4
4
|
var module = { exports: {} };
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
|
+
//#region src/harness-embed-contract.ts
|
|
8
|
+
/** Same-origin bridge owned and disposed by the embedded session client. */
|
|
9
|
+
const HARNESS_SESSION_NAVIGATION_KEY = "__arkmeHarnessSessionNavigation";
|
|
10
|
+
//#endregion
|
|
11
|
+
//#region src/client/harness-session-selection.ts
|
|
12
|
+
/** The embedded runtime owns selection. Visibility/presence clears must never erase it. */
|
|
13
|
+
function observeHarnessSessionSelection(sessions, bridge) {
|
|
14
|
+
if (bridge === void 0) return () => {};
|
|
15
|
+
let stopped = false;
|
|
16
|
+
let pending;
|
|
17
|
+
let retry;
|
|
18
|
+
const persist = async (selection) => {
|
|
19
|
+
if (stopped || pending !== selection) return;
|
|
20
|
+
try {
|
|
21
|
+
if (!await bridge.save(selection.sessionId, selection.subagentAddress)) stopped = true;
|
|
22
|
+
} catch (error) {
|
|
23
|
+
if (stopped || pending !== selection) return;
|
|
24
|
+
console.warn("Arkme could not persist the current Harness session.", error);
|
|
25
|
+
if (++selection.failures <= 3) retry = setTimeout(() => {
|
|
26
|
+
retry = void 0;
|
|
27
|
+
persist(selection);
|
|
28
|
+
}, 1e3);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
const changed = () => {
|
|
32
|
+
const snapshot = sessions.list.getSnapshot();
|
|
33
|
+
if (stopped || snapshot.phase !== "ready" || !snapshot.current || !snapshot.byId[snapshot.current]) return;
|
|
34
|
+
const key = JSON.stringify([snapshot.current, snapshot.currentAddress]);
|
|
35
|
+
if (pending?.key === key) return;
|
|
36
|
+
if (retry !== void 0) {
|
|
37
|
+
clearTimeout(retry);
|
|
38
|
+
retry = void 0;
|
|
39
|
+
}
|
|
40
|
+
pending = {
|
|
41
|
+
sessionId: snapshot.current,
|
|
42
|
+
subagentAddress: snapshot.currentAddress,
|
|
43
|
+
key,
|
|
44
|
+
failures: 0
|
|
45
|
+
};
|
|
46
|
+
persist(pending);
|
|
47
|
+
};
|
|
48
|
+
const unsubscribe = sessions.list.subscribe(changed);
|
|
49
|
+
changed();
|
|
50
|
+
return () => {
|
|
51
|
+
stopped = true;
|
|
52
|
+
if (retry !== void 0) clearTimeout(retry);
|
|
53
|
+
unsubscribe();
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
7
57
|
//#region src/client/harness-session-client.ts
|
|
8
|
-
const inject = [
|
|
58
|
+
const inject = [
|
|
59
|
+
"sessions",
|
|
60
|
+
"remote",
|
|
61
|
+
"remote.session"
|
|
62
|
+
];
|
|
9
63
|
const REFRESH_MS = 1e4;
|
|
10
64
|
/** The iframe reads selection through the public DSH store; Arkme owns visibility. */
|
|
11
65
|
function apply(ctx) {
|
|
@@ -13,9 +67,40 @@ window.__ModuleLoader__.load({
|
|
|
13
67
|
const surface = window.frameElement?.parentElement;
|
|
14
68
|
if (surface?.getAttribute("data-arkme-owned") !== "deepseek-harness-surface") return () => void 0;
|
|
15
69
|
const apiPath = document.querySelector("meta[name=\"arkme-session-api\"]")?.content;
|
|
16
|
-
if (apiPath === void 0 || !/^\/[A-Za-z0-9/_-]+$/.test(apiPath)) return () => void 0;
|
|
17
70
|
const sessions = ctx.sessions;
|
|
18
71
|
if (sessions === void 0) return () => void 0;
|
|
72
|
+
const parent = window.parent;
|
|
73
|
+
const stopPersistence = observeHarnessSessionSelection(sessions, parent?.arkmeDesktop?.sessionSelection);
|
|
74
|
+
const frameWindow = window;
|
|
75
|
+
const navigation = {
|
|
76
|
+
async has(sessionId) {
|
|
77
|
+
if (!/^[A-Za-z0-9_.:-]{1,256}$/.test(sessionId)) throw new Error("DSH 对话标识无效");
|
|
78
|
+
const remote = ctx.remote?.session;
|
|
79
|
+
if (typeof remote?.list !== "function") throw new Error("当前 DSH 版本无法核验本机会话");
|
|
80
|
+
const result = await remote.list({});
|
|
81
|
+
if (!result.ok) throw new Error(result.error?.message || "本机会话列表读取失败,请稍后重试");
|
|
82
|
+
if (!Array.isArray(result.value?.items)) throw new Error("本机会话列表响应不完整");
|
|
83
|
+
if (!result.value.items.some((item) => item.sessionId === sessionId)) return false;
|
|
84
|
+
const refreshable = sessions;
|
|
85
|
+
if (sessions.list.getSnapshot().byId[sessionId] === void 0) {
|
|
86
|
+
if (typeof refreshable.refresh !== "function") throw new Error("本机会话列表尚未就绪,请稍后重试");
|
|
87
|
+
await refreshable.refresh();
|
|
88
|
+
}
|
|
89
|
+
if (sessions.list.getSnapshot().byId[sessionId] === void 0) throw new Error("本机会话列表尚未就绪,请稍后重试");
|
|
90
|
+
return true;
|
|
91
|
+
},
|
|
92
|
+
open(sessionId) {
|
|
93
|
+
if (typeof sessionId !== "string" || sessionId.trim() === "") throw new Error("DSH 对话标识无效");
|
|
94
|
+
if (typeof sessions.open !== "function") throw new Error("当前 DSH 版本暂不支持打开任务");
|
|
95
|
+
sessions.open(sessionId);
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
frameWindow[HARNESS_SESSION_NAVIGATION_KEY] = navigation;
|
|
99
|
+
const disposeNavigation = () => {
|
|
100
|
+
stopPersistence();
|
|
101
|
+
if (frameWindow["__arkmeHarnessSessionNavigation"] === navigation) delete frameWindow[HARNESS_SESSION_NAVIGATION_KEY];
|
|
102
|
+
};
|
|
103
|
+
if (apiPath === void 0 || !/^\/[A-Za-z0-9/_-]+$/.test(apiPath)) return disposeNavigation;
|
|
19
104
|
const windowRef = crypto.randomUUID();
|
|
20
105
|
let revision = 0;
|
|
21
106
|
let stopped = false;
|
|
@@ -106,6 +191,7 @@ window.__ModuleLoader__.load({
|
|
|
106
191
|
window.addEventListener("pageshow", changed);
|
|
107
192
|
report();
|
|
108
193
|
return () => {
|
|
194
|
+
disposeNavigation();
|
|
109
195
|
stopped = true;
|
|
110
196
|
clearSelection();
|
|
111
197
|
observer.disconnect();
|
package/lib/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as ARKME_DEFAULT_SHARE_WEBSITE, A as inspectNativeBundleArtifactV3, At as
|
|
1
|
+
import { $ as ARKME_DEFAULT_SHARE_WEBSITE, A as inspectNativeBundleArtifactV3, At as registerDSHAgentInputRecordSync, D as bundleSha256, Dt as ArkmePluginError, E as arkmeSandboxEntryId, Et as normalizeRecentEmojiIds, F as assertExtensionArtifactSize, Ft as __require, G as validateVoiceprintPcm16Wav, I as canonicalExtensionJson, It as __toCommonJS, J as arkmeRequiredLinkMetadataFallback, K as arkmeExtensionShareRefFromLink, L as sha256Hex, M as packLocalNativeBundleDirectoryV3, Mt as __commonJSMin, N as readNativeBundleTarballV3, Nt as __esmMin, O as canonicalBundleJson, Ot as retryAfterMillis, P as renderArkmeSandboxHostEntry, Pt as __exportAll, Q as parseArkmeRecordReeditAttachments, R as unpackArkmeExtension, S as ARKME_BUNDLE_ARTIFACT_KIND, St as sameRecordingImportIdentity, T as ArkmeBundleArtifactError, Tt as isRecentEmojiId, U as ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE, W as ArkmeService, X as arkmeRichBackgroundSound, Y as arkmeFileBackgroundSound, Z as ArkmeRecordReeditDraftConflict, _ as arkmeClientContentDigest, _t as SecretValue, at as ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES, b as verifyExtensionResolutionSignature, bt as isUnresolvedRecordingImportJob, c as persistentExtensionBundleDirectory, ct as mergeMemberJoinEvents, d as readPersistentExtensionActivation, dt as ARKME_TOOL_FILE_MAX_BYTES, et as ARKME_PROVIDER_CONTRACT_VERSION, f as refreshPersistentClientWrapper, ft as arkmeCanInlineLocalFile, g as activeProfileExtensionOwnerConflicts, gt as ArkmeOutgoingCallError, h as renderArkmeBundleClientBundle, ht as isArkmeBotAvatarRef, i as invokePersistentArkmeExtension, it as ARKME_WORLD_PUBLISH_MAX_IMAGES, j as packBundleFiles, jt as createDesktopLifecycleReader, k as inspectBundleArtifact, kt as recordOwnerId, l as persistentExtensionPackageIdentity, lt as validateMemberUpdate, m as writePersistentExtensionActivation, mt as arkmePickedFileKind, o as persistentArkmeExtensionRuntimeState, ot as applyMemberUpdate, p as repairPersistentExtensionInstallation, pt as arkmeNormalizedFileMimeType, q as arkmeIsGenericLinkMetadataTitle, r as deactivatePersistentArkmeExtension, s as materializePersistentExtensionBundle, st as cachedMemberItem, t as activatePersistentArkmeExtension, u as quarantinePersistentExtension, ut as ARKME_RUNTIME_INSTANCE_ID, v as arkmeClientContentDigestFromSource, vt as ArkmeDirectMessageAdmissionError, w as ARKME_NATIVE_BUNDLE_ARTIFACT_KIND, wt as recordingImportFileNameKey, x as verifyNativeBundleResolutionSignature, xt as recordingImportFileKind, y as verifyBundleResolutionSignature, yt as isRecordingInstantOnOrAfterUnixEpoch, z as ARKME_EXTENSION_FORMAT } from "./persistent-runtime-DUrok1U3.js";
|
|
2
2
|
import { _ as parsePluginUpdateManifest, b as validatePluginUpdateServiceOrigin, d as writePluginUpdateLifecycleLog, f as PluginUpdateInstallStateStore, g as existingCachedPluginArtifactPath, h as downloadAndCachePluginArtifact, m as PluginUpdateArtifactError, n as buildTargetInstallArgs, o as reconcilePluginUpdaterProfilePolicy, p as ARKME_PLUGIN_PACKAGE_NAME$1, t as assertTargetArtifactIntegrity, u as detachManagedProfilePluginLink, v as pluginUpdateEndpointUrl, y as validatePluginUpdateArtifactOrigin } from "./plugin-updater-helper-y7wzJLOx.js";
|
|
3
3
|
import { a as securePrivateDirectory, c as securePrivateFileSync, i as prepareProfilePackageManager, n as isArkmeProfilePackageName, o as securePrivateDirectorySync, r as localExtensionPnpmArgs, s as securePrivateFile, t as applyArkmeProfileBundlePolicy } from "./profile-bundle-policy-DLXDyohJ.js";
|
|
4
4
|
import { i as invokeArkmeBundle, n as arkmeBundleActive, r as deactivateArkmeBundle } from "./bundle-runtime-CE73h3vS.js";
|
|
@@ -148,6 +148,7 @@ const ARKME_HARNESS_MODEL_CLIENT_PATH = "/arkme-self/harness-model-client.js";
|
|
|
148
148
|
const ARKME_HARNESS_ONBOARDING_CLIENT_PATH = "/arkme-self/harness-onboarding-client.js";
|
|
149
149
|
const ARKME_HARNESS_TRAJECTORY_CLIENT_PATH = "/arkme-self/harness-trajectory-client.js";
|
|
150
150
|
const ARKME_HARNESS_SIDEBAR_CLIENT_PATH = "/arkme-self/harness-sidebar-client.js";
|
|
151
|
+
const ARKME_NATIVE_SELECTION_CLIENT_PATH = "/arkme-self/harness-native-selection-client.js";
|
|
151
152
|
//#endregion
|
|
152
153
|
//#region src/plugin-update-policy.ts
|
|
153
154
|
const PLUGIN_UPDATE_TERMINAL_STATE_TTL_MS = 10 * 6e4;
|
|
@@ -10481,103 +10482,6 @@ function createOpenClawFileSecretStore(options) {
|
|
|
10481
10482
|
};
|
|
10482
10483
|
}
|
|
10483
10484
|
//#endregion
|
|
10484
|
-
//#region src/dsh-agent-input-sync.ts
|
|
10485
|
-
function sessionEventSource(value) {
|
|
10486
|
-
return value !== null && typeof value === "object" && typeof value.on === "function" ? value : void 0;
|
|
10487
|
-
}
|
|
10488
|
-
function objectValue$2(value) {
|
|
10489
|
-
return value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
10490
|
-
}
|
|
10491
|
-
function stringValue(value) {
|
|
10492
|
-
return typeof value === "string" ? value : "";
|
|
10493
|
-
}
|
|
10494
|
-
function numberValue(value) {
|
|
10495
|
-
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
10496
|
-
}
|
|
10497
|
-
function stableRecordUid(namespace, key) {
|
|
10498
|
-
const bytes = createHash("sha256").update(`dsh-arkme:${namespace}:${key}`).digest().subarray(0, 16);
|
|
10499
|
-
bytes[6] = (bytes[6] ?? 0) & 15 | 80;
|
|
10500
|
-
bytes[8] = (bytes[8] ?? 0) & 63 | 128;
|
|
10501
|
-
const hex = bytes.toString("hex");
|
|
10502
|
-
return `${hex.slice(0, 8)}-${hex.slice(8, 12)}-${hex.slice(12, 16)}-${hex.slice(16, 20)}-${hex.slice(20)}`;
|
|
10503
|
-
}
|
|
10504
|
-
function dshAgentInputRecordUid(sessionId, eventSeq) {
|
|
10505
|
-
return stableRecordUid("dsh-agent-input", `${sessionId}\0${String(eventSeq)}`);
|
|
10506
|
-
}
|
|
10507
|
-
function dshAgentInputTextFromEvent(event) {
|
|
10508
|
-
const envelope = objectValue$2(event);
|
|
10509
|
-
if (envelope.type !== "user/message") return void 0;
|
|
10510
|
-
const data = objectValue$2(envelope.data);
|
|
10511
|
-
if (objectValue$2(data.source).kind !== "user") return void 0;
|
|
10512
|
-
const text = (Array.isArray(data.content) ? data.content : []).map((block) => {
|
|
10513
|
-
const item = objectValue$2(block);
|
|
10514
|
-
return item.type === "text" ? stringValue(item.text).trim() : "";
|
|
10515
|
-
}).filter(Boolean).join("\n").trim();
|
|
10516
|
-
return text === "" ? void 0 : text;
|
|
10517
|
-
}
|
|
10518
|
-
function registerDSHAgentInputRecordSync(ctx, service, options = {}) {
|
|
10519
|
-
const logger = options.logger ?? ctx.logger;
|
|
10520
|
-
const maxAttempts = Math.max(1, Math.trunc(options.maxAttempts ?? 3));
|
|
10521
|
-
const retryDelayMillis = Math.max(0, Math.trunc(options.retryDelayMillis ?? 5e3));
|
|
10522
|
-
const inFlight = /* @__PURE__ */ new Set();
|
|
10523
|
-
const synced = /* @__PURE__ */ new Set();
|
|
10524
|
-
const timers = /* @__PURE__ */ new Set();
|
|
10525
|
-
let disposed = false;
|
|
10526
|
-
const sync = (key, recordUid, text, sendAtMillis, attempt) => {
|
|
10527
|
-
inFlight.add(key);
|
|
10528
|
-
let retrying = false;
|
|
10529
|
-
service.createDSHAgentInputText(recordUid, text, sendAtMillis).then(() => {
|
|
10530
|
-
if (disposed) return;
|
|
10531
|
-
synced.add(key);
|
|
10532
|
-
}).catch((error) => {
|
|
10533
|
-
if (disposed) return;
|
|
10534
|
-
if (attempt < maxAttempts) {
|
|
10535
|
-
retrying = true;
|
|
10536
|
-
const timer = setTimeout(() => {
|
|
10537
|
-
timers.delete(timer);
|
|
10538
|
-
if (disposed) {
|
|
10539
|
-
inFlight.delete(key);
|
|
10540
|
-
return;
|
|
10541
|
-
}
|
|
10542
|
-
sync(key, recordUid, text, sendAtMillis, attempt + 1);
|
|
10543
|
-
}, retryDelayMillis);
|
|
10544
|
-
timers.add(timer);
|
|
10545
|
-
return;
|
|
10546
|
-
}
|
|
10547
|
-
const message = error instanceof Error && error.message.trim() !== "" ? error.message : String(error);
|
|
10548
|
-
logger.warn(`dsh-arkme: failed to sync DSH Agent input record: ${message}`);
|
|
10549
|
-
}).finally(() => {
|
|
10550
|
-
if (!retrying || disposed) inFlight.delete(key);
|
|
10551
|
-
});
|
|
10552
|
-
};
|
|
10553
|
-
const listener = (rawSession, rawEvent) => {
|
|
10554
|
-
if (disposed) return;
|
|
10555
|
-
const event = objectValue$2(rawEvent);
|
|
10556
|
-
const sessionId = stringValue(objectValue$2(rawSession).id).trim();
|
|
10557
|
-
const eventSeq = Math.trunc(numberValue(event.seq));
|
|
10558
|
-
if (sessionId === "" || eventSeq < 0) return;
|
|
10559
|
-
const text = dshAgentInputTextFromEvent(event);
|
|
10560
|
-
if (text === void 0) return;
|
|
10561
|
-
const key = `${sessionId}\0${String(eventSeq)}`;
|
|
10562
|
-
if (inFlight.has(key) || synced.has(key)) return;
|
|
10563
|
-
sync(key, dshAgentInputRecordUid(sessionId, eventSeq), text, numberValue(event.time), 1);
|
|
10564
|
-
};
|
|
10565
|
-
ctx.effect(() => {
|
|
10566
|
-
const source = sessionEventSource(ctx);
|
|
10567
|
-
if (source === void 0) {
|
|
10568
|
-
logger.warn("dsh-arkme: DSH session/event API is unavailable; DSH Agent input sync disabled");
|
|
10569
|
-
return () => {};
|
|
10570
|
-
}
|
|
10571
|
-
const dispose = source.on("session/event", listener, { global: true });
|
|
10572
|
-
return () => {
|
|
10573
|
-
disposed = true;
|
|
10574
|
-
dispose();
|
|
10575
|
-
for (const timer of timers) clearTimeout(timer);
|
|
10576
|
-
timers.clear();
|
|
10577
|
-
};
|
|
10578
|
-
}, "dsh-arkme: DSH Agent input record sync");
|
|
10579
|
-
}
|
|
10580
|
-
//#endregion
|
|
10581
10485
|
//#region src/directory-reader.ts
|
|
10582
10486
|
/** Transport-neutral dispatch only: each business owner keeps its own projection and credentials. */
|
|
10583
10487
|
function readDirectoryPage(service, teams, section, options = {}) {
|
|
@@ -11825,6 +11729,7 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
|
|
|
11825
11729
|
case "source.interwoven-detail": return await service.interwovenMomentDetail(requiredInterwovenParam(params, "sourceRef"), requiredInterwovenParam(params, "momentRef"));
|
|
11826
11730
|
case "source.related-quick-notes.from-message": return await service.relatedQuickNotesFromMessage(requiredRelatedQuickNoteParam(params, "sourceRef"), requiredRelatedQuickNoteParam(params, "messageActionRef", MAX_MESSAGE_ACTION_REF_CHARS), requestSignal);
|
|
11827
11731
|
case "source.related-quick-notes.from-moment": return await service.relatedQuickNotesFromMoment(requiredRelatedQuickNoteParam(params, "sourceRef"), requiredRelatedQuickNoteParam(params, "momentRef"), requestSignal);
|
|
11732
|
+
case "source.record-edit-history": return await service.recordEditHistoryPage(stringParam(params, "sourceRef"), stringParam(params, "messageActionRef"), numberParam(params, "cursorEditAt", 0), requestSignal);
|
|
11828
11733
|
case "source.related-quick-note.detail": return await service.relatedQuickNoteDetail(requiredRelatedQuickNoteParam(params, "sourceRef"), requiredRelatedQuickNoteParam(params, "relatedRef"), requestSignal);
|
|
11829
11734
|
case "source.message-preparing.report":
|
|
11830
11735
|
case "source.message-preparing.cancel": {
|
|
@@ -11986,7 +11891,8 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
|
|
|
11986
11891
|
case "chat.member.private.open": return await service.openPrivateChatFromMember(stringParam(params, "sourceRef"), stringParam(params, "memberRef"), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
11987
11892
|
case "files.capabilities": return service.fileCapabilities();
|
|
11988
11893
|
case "files.local.list": return await service.fileList();
|
|
11989
|
-
case "files.local.open": return await service.
|
|
11894
|
+
case "files.local.open-folder": return await service.fileOpenLocalFolder(stringParam(params, "fileRef"), requestSignal);
|
|
11895
|
+
case "files.local.open": return await service.fileOpenLocal(stringParam(params, "fileRef"), requestSignal);
|
|
11990
11896
|
case "files.local.remove":
|
|
11991
11897
|
await service.fileRemove(stringParam(params, "fileRef"));
|
|
11992
11898
|
return { removed: true };
|
|
@@ -12351,6 +12257,25 @@ async function openDshHostPath(ctx, path, signal) {
|
|
|
12351
12257
|
if (response.result.ok !== true || !isRecord(response.result.value) || response.result.value.opened !== true) throw new Error("DSH apiProxy.host.openPath 返回了无效响应");
|
|
12352
12258
|
}
|
|
12353
12259
|
//#endregion
|
|
12260
|
+
//#region src/harness-session-restore-script.ts
|
|
12261
|
+
/**
|
|
12262
|
+
* The outer runtime and native iframe share an origin, but own different stores.
|
|
12263
|
+
* An outer pending-list projection can overwrite the native boot key with {}.
|
|
12264
|
+
* Route only this iframe's official selection read to the parent preload cache;
|
|
12265
|
+
* do not change other keys, sessionStorage, writes, or the upstream runtime.
|
|
12266
|
+
* This must precede every boot script, including asynchronously loaded modules.
|
|
12267
|
+
*/
|
|
12268
|
+
const HARNESS_SESSION_RESTORE_SCRIPT = `(() => {
|
|
12269
|
+
const bridge = window.parent?.arkmeDesktop?.sessionSelection;
|
|
12270
|
+
if (typeof bridge?.restore !== 'function') return;
|
|
12271
|
+
const storage = window.localStorage;
|
|
12272
|
+
const getItem = Storage.prototype.getItem;
|
|
12273
|
+
Storage.prototype.getItem = function(key) {
|
|
12274
|
+
if (this === storage && key === 'dsh.sessions.current') return bridge.restore();
|
|
12275
|
+
return getItem.call(this, key);
|
|
12276
|
+
};
|
|
12277
|
+
})();`;
|
|
12278
|
+
//#endregion
|
|
12354
12279
|
//#region src/harness-embed-route.ts
|
|
12355
12280
|
const ARKME_PLUGIN_PACKAGE_NAME = "@senguoyun/dsh-arkme";
|
|
12356
12281
|
const DSH_CLIENT_HMR_PACKAGE_NAME = "@deepseek-ai/dsh-client-hmr";
|
|
@@ -12560,6 +12485,11 @@ function createHarnessEmbedRouteHandler(options) {
|
|
|
12560
12485
|
}
|
|
12561
12486
|
let html = replaceHarnessBootGraph(await options.readRootHtml(request), fullGraph, projectedGraph);
|
|
12562
12487
|
if (options.sessionClient !== void 0) {
|
|
12488
|
+
if (!/<head(?:\s[^>]*)?>/i.test(html)) throw new Error("harness session restore requires a document head");
|
|
12489
|
+
html = html.replace(/<head(?:\s[^>]*)?>/i, (head) => `${head}<script data-arkme-session-restore>${HARNESS_SESSION_RESTORE_SCRIPT}<\/script>`);
|
|
12490
|
+
}
|
|
12491
|
+
if (options.selectionClientRevision && /^[a-f0-9]+$/.test(options.selectionClientRevision)) html = html.replace("</head>", `<meta name="arkme-native-selection" content="/arkme-self/harness-native-selection-client.js?rev=${options.selectionClientRevision}"></head>`);
|
|
12492
|
+
if (options.sessionClient?.apiPath !== void 0) {
|
|
12563
12493
|
const apiPath = options.sessionClient.apiPath;
|
|
12564
12494
|
if (!/^\/[A-Za-z0-9/_-]+$/.test(apiPath) || !html.includes("</head>")) throw new Error("harness session observer configuration is invalid");
|
|
12565
12495
|
html = html.replace("</head>", `<meta name="arkme-session-api" content="${apiPath}"></head>`);
|
|
@@ -16596,10 +16526,9 @@ async function parseHttpError(response) {
|
|
|
16596
16526
|
}
|
|
16597
16527
|
function requestImageAttachments(options) {
|
|
16598
16528
|
const result = [];
|
|
16599
|
-
for (const message of options.messages)
|
|
16600
|
-
|
|
16601
|
-
|
|
16602
|
-
}
|
|
16529
|
+
for (const message of options.messages) if (message.role === "system") assertTextOnly(message.content, "系统消息");
|
|
16530
|
+
else if (message.role === "assistant") assertAssistantBlocks(message.content);
|
|
16531
|
+
else for (const block of userContentLeaves(message.content)) if (block.type === "image") result.push(block.attachment);
|
|
16603
16532
|
return result;
|
|
16604
16533
|
}
|
|
16605
16534
|
function inputAssetOwnerAttachmentScope(bearer, attachment) {
|
|
@@ -16633,15 +16562,11 @@ function assertTextOnly(blocks, location) {
|
|
|
16633
16562
|
function assertAssistantBlocks(blocks) {
|
|
16634
16563
|
for (const block of blocks) if (block.type !== "text" && block.type !== "reasoning" && block.type !== "tool-call") throw new LlmError(`助手消息不支持内容类型“${block.type}”`, "UNSUPPORTED_CONTENT");
|
|
16635
16564
|
}
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16639
|
-
|
|
16640
|
-
|
|
16641
|
-
continue;
|
|
16642
|
-
}
|
|
16643
|
-
throw new LlmError(`用户消息不支持内容类型“${block.type}”`, "UNSUPPORTED_CONTENT");
|
|
16644
|
-
}
|
|
16565
|
+
/** One traversal for validation, image accounting and tool-result serialization. */
|
|
16566
|
+
function* userContentLeaves(blocks) {
|
|
16567
|
+
for (const block of blocks) if (block.type === "text" || block.type === "image") yield block;
|
|
16568
|
+
else if (block.type === "tool-result") yield* userContentLeaves(block.content);
|
|
16569
|
+
else throw new LlmError(`用户或工具结果不支持内容类型“${block.type}”`, "UNSUPPORTED_CONTENT");
|
|
16645
16570
|
}
|
|
16646
16571
|
function limitConcurrency(maximum, operation, signal) {
|
|
16647
16572
|
let active = 0;
|
|
@@ -16706,47 +16631,78 @@ function serializeAssistant(message) {
|
|
|
16706
16631
|
};
|
|
16707
16632
|
}
|
|
16708
16633
|
async function serializeMessages(messages, resolveImage, signal) {
|
|
16709
|
-
for (const message of messages) if (message.role === "system") assertTextOnly(message.content, "系统消息");
|
|
16710
|
-
else if (message.role === "assistant") assertAssistantBlocks(message.content);
|
|
16711
|
-
else assertUserBlocks(message.content);
|
|
16712
16634
|
const resolveImageLimited = limitConcurrency(MAX_CONCURRENT_INPUT_ASSET_UPLOADS, resolveImage, signal);
|
|
16713
|
-
|
|
16714
|
-
|
|
16715
|
-
|
|
16716
|
-
|
|
16717
|
-
|
|
16718
|
-
|
|
16635
|
+
const contentParts = async (blocks) => (await Promise.all(Array.from(userContentLeaves(blocks), async (block) => block.type === "text" ? {
|
|
16636
|
+
type: "text",
|
|
16637
|
+
text: block.text
|
|
16638
|
+
} : {
|
|
16639
|
+
type: "image_asset",
|
|
16640
|
+
asset_ref: await resolveImageLimited(block.attachment)
|
|
16641
|
+
}))).filter((part) => part.type !== "text" || part.text.length > 0);
|
|
16642
|
+
const groups = await Promise.all(messages.map(async (message) => {
|
|
16643
|
+
if (message.role === "system") return {
|
|
16644
|
+
regular: {
|
|
16645
|
+
role: "system",
|
|
16646
|
+
content: flattenText(message.content)
|
|
16647
|
+
},
|
|
16648
|
+
tools: [],
|
|
16649
|
+
toolImages: []
|
|
16650
|
+
};
|
|
16651
|
+
if (message.role === "assistant") return {
|
|
16652
|
+
regular: serializeAssistant(message),
|
|
16653
|
+
tools: [],
|
|
16654
|
+
toolImages: []
|
|
16655
|
+
};
|
|
16719
16656
|
const toolResults = message.content.filter((block) => block.type === "tool-result");
|
|
16720
|
-
const parts =
|
|
16721
|
-
|
|
16722
|
-
|
|
16723
|
-
|
|
16724
|
-
|
|
16725
|
-
|
|
16726
|
-
type: "image_asset",
|
|
16727
|
-
asset_ref: await resolveImageLimited(block.attachment)
|
|
16728
|
-
};
|
|
16729
|
-
}))).filter((part) => part !== void 0);
|
|
16730
|
-
const wire = [];
|
|
16731
|
-
if (parts.length > 0 || toolResults.length === 0) if (parts.length === 0) wire.push({
|
|
16657
|
+
const [parts, results] = await Promise.all([contentParts(message.content.filter((block) => block.type !== "tool-result")), Promise.all(toolResults.map(async (result) => ({
|
|
16658
|
+
result,
|
|
16659
|
+
parts: await contentParts(result.content)
|
|
16660
|
+
})))]);
|
|
16661
|
+
let regular;
|
|
16662
|
+
if (parts.length > 0 || toolResults.length === 0) regular = {
|
|
16732
16663
|
role: "user",
|
|
16733
|
-
content: ""
|
|
16734
|
-
}
|
|
16735
|
-
|
|
16736
|
-
|
|
16737
|
-
|
|
16738
|
-
|
|
16739
|
-
|
|
16664
|
+
content: parts.every((part) => part.type === "text") ? parts.map((part) => part.type === "text" ? part.text : "").join("") : parts
|
|
16665
|
+
};
|
|
16666
|
+
const tools = [];
|
|
16667
|
+
const toolImages = [];
|
|
16668
|
+
for (const { result, parts: resultParts } of results) {
|
|
16669
|
+
tools.push({
|
|
16670
|
+
role: "tool",
|
|
16671
|
+
tool_call_id: String(result.toolCallId),
|
|
16672
|
+
content: resultParts.map((part) => part.type === "text" ? part.text : "").join("") || "(no output)"
|
|
16673
|
+
});
|
|
16674
|
+
const images = resultParts.filter((part) => part.type === "image_asset");
|
|
16675
|
+
if (images.length > 0) toolImages.push({
|
|
16676
|
+
type: "text",
|
|
16677
|
+
text: `Images from tool call ${String(result.toolCallId)}:`
|
|
16678
|
+
}, ...images);
|
|
16679
|
+
}
|
|
16680
|
+
return {
|
|
16681
|
+
...regular === void 0 ? {} : { regular },
|
|
16682
|
+
tools,
|
|
16683
|
+
toolImages
|
|
16684
|
+
};
|
|
16685
|
+
}));
|
|
16686
|
+
const wire = [];
|
|
16687
|
+
let pendingToolImages = [];
|
|
16688
|
+
const flushToolImages = () => {
|
|
16689
|
+
if (pendingToolImages.length === 0) return;
|
|
16690
|
+
wire.push({
|
|
16740
16691
|
role: "user",
|
|
16741
|
-
content:
|
|
16742
|
-
});
|
|
16743
|
-
for (const result of toolResults) wire.push({
|
|
16744
|
-
role: "tool",
|
|
16745
|
-
tool_call_id: String(result.toolCallId),
|
|
16746
|
-
content: flattenText(result.content) || "(no output)"
|
|
16692
|
+
content: pendingToolImages
|
|
16747
16693
|
});
|
|
16748
|
-
|
|
16749
|
-
}
|
|
16694
|
+
pendingToolImages = [];
|
|
16695
|
+
};
|
|
16696
|
+
for (const group of groups) {
|
|
16697
|
+
if (group.regular !== void 0) {
|
|
16698
|
+
flushToolImages();
|
|
16699
|
+
wire.push(group.regular);
|
|
16700
|
+
}
|
|
16701
|
+
wire.push(...group.tools);
|
|
16702
|
+
pendingToolImages.push(...group.toolImages);
|
|
16703
|
+
}
|
|
16704
|
+
flushToolImages();
|
|
16705
|
+
return wire;
|
|
16750
16706
|
}
|
|
16751
16707
|
async function serializeRequest(options, resolveImage, signal) {
|
|
16752
16708
|
const messages = [];
|
|
@@ -17354,6 +17310,10 @@ function managedAiLocalizedFailure(facts) {
|
|
|
17354
17310
|
code: facts.code,
|
|
17355
17311
|
message: "无法读取历史图片,请检查本地附件存储后重试"
|
|
17356
17312
|
};
|
|
17313
|
+
if (facts.code === "UNSUPPORTED_CONTENT") return {
|
|
17314
|
+
code: facts.code,
|
|
17315
|
+
message: "当前模型或图片服务不支持这类内容,请检查模型选择和附件后重试"
|
|
17316
|
+
};
|
|
17357
17317
|
if (facts.code === "CONTEXT_WINDOW_EXCEEDED") return {
|
|
17358
17318
|
code: facts.code,
|
|
17359
17319
|
message: "对话内容过长,请新建对话或减少上下文后重试"
|
|
@@ -36514,7 +36474,7 @@ function apply(ctx, config) {
|
|
|
36514
36474
|
...config,
|
|
36515
36475
|
fileStateDirectory: join(stateDirectory, "files"),
|
|
36516
36476
|
recordingImportDirectory: join(stateDirectory, "recording-imports")
|
|
36517
|
-
}, sessionStore, localDatabase, fetch, pendingSessionStore);
|
|
36477
|
+
}, sessionStore, localDatabase, fetch, pendingSessionStore, void 0, void 0, void 0, () => ctx.get("sessionQuery"));
|
|
36518
36478
|
const openApiMcpCredentialNamespace = `${config.keychainServicePrefix}.${config.environment}.openapi-mcp`;
|
|
36519
36479
|
const openApiMcpController = new ManagedOpenApiMcpController({
|
|
36520
36480
|
mountMcp: config.openApiMcpEnabled,
|
|
@@ -36887,11 +36847,11 @@ function apply(ctx, config) {
|
|
|
36887
36847
|
expectedPort: ctx.webServer.port,
|
|
36888
36848
|
allowNonLoopback: config.allowNonLoopback
|
|
36889
36849
|
});
|
|
36890
|
-
const sessionClient =
|
|
36850
|
+
const sessionClient = {
|
|
36891
36851
|
source: readFileSync(new URL("../lib/harness-session-client.js", import.meta.url)),
|
|
36892
|
-
apiPath: config.routePath
|
|
36893
|
-
}
|
|
36894
|
-
|
|
36852
|
+
...config.dshRemoteFeatureEnabled ? { apiPath: config.routePath } : {}
|
|
36853
|
+
};
|
|
36854
|
+
ctx.effect(() => ctx.webServer.register({
|
|
36895
36855
|
kind: "exact",
|
|
36896
36856
|
path: HARNESS_SESSION_CLIENT_PATH,
|
|
36897
36857
|
handler: (_request, response) => {
|
|
@@ -36906,6 +36866,24 @@ function apply(ctx, config) {
|
|
|
36906
36866
|
const harnessOnboardingClient = readFileSync(new URL("../lib/harness-onboarding-client.js", import.meta.url));
|
|
36907
36867
|
const harnessTrajectoryClient = readFileSync(new URL("../lib/harness-trajectory-client.js", import.meta.url));
|
|
36908
36868
|
const harnessSidebarClient = readFileSync(new URL("../lib/harness-sidebar-client.js", import.meta.url));
|
|
36869
|
+
let selectionClientRevision;
|
|
36870
|
+
try {
|
|
36871
|
+
const selectionClient = readFileSync(new URL("../lib/harness-native-selection-client.js", import.meta.url));
|
|
36872
|
+
selectionClientRevision = createHash("sha256").update(selectionClient).digest("hex");
|
|
36873
|
+
ctx.effect(() => ctx.webServer.register({
|
|
36874
|
+
kind: "exact",
|
|
36875
|
+
path: ARKME_NATIVE_SELECTION_CLIENT_PATH,
|
|
36876
|
+
handler: (_request, response) => {
|
|
36877
|
+
response.writeHead(200, {
|
|
36878
|
+
"Content-Type": "application/javascript",
|
|
36879
|
+
"Cache-Control": "no-cache"
|
|
36880
|
+
});
|
|
36881
|
+
response.end(selectionClient);
|
|
36882
|
+
}
|
|
36883
|
+
}), "arkme: optional native selection asset");
|
|
36884
|
+
} catch {
|
|
36885
|
+
ctx.logger.warn("dsh-arkme: optional native selection asset unavailable");
|
|
36886
|
+
}
|
|
36909
36887
|
ctx.effect(() => ctx.webServer.register({
|
|
36910
36888
|
kind: "exact",
|
|
36911
36889
|
path: ARKME_HARNESS_SIDEBAR_CLIENT_PATH,
|
|
@@ -36940,6 +36918,7 @@ function apply(ctx, config) {
|
|
|
36940
36918
|
}
|
|
36941
36919
|
}), "arkme: Harness onboarding bridge asset");
|
|
36942
36920
|
const harnessEmbedHandler = createHarnessEmbedRouteHandler({
|
|
36921
|
+
...selectionClientRevision === void 0 ? {} : { selectionClientRevision },
|
|
36943
36922
|
sidebarClient: {
|
|
36944
36923
|
id: "@senguoyun/dsh-arkme/harness-sidebar",
|
|
36945
36924
|
url: ARKME_HARNESS_SIDEBAR_CLIENT_PATH,
|
|
@@ -36956,10 +36935,10 @@ function apply(ctx, config) {
|
|
|
36956
36935
|
rev: createHash("sha256").update(harnessOnboardingClient).digest("hex"),
|
|
36957
36936
|
external: ["react"]
|
|
36958
36937
|
},
|
|
36959
|
-
|
|
36938
|
+
sessionClient: {
|
|
36960
36939
|
revision: createHash("sha256").update(sessionClient.source).digest("hex").slice(0, 12),
|
|
36961
|
-
apiPath: sessionClient.apiPath
|
|
36962
|
-
}
|
|
36940
|
+
..."apiPath" in sessionClient ? { apiPath: sessionClient.apiPath } : {}
|
|
36941
|
+
},
|
|
36963
36942
|
modelClient: {
|
|
36964
36943
|
id: "@senguoyun/dsh-arkme/harness-model",
|
|
36965
36944
|
url: ARKME_HARNESS_MODEL_CLIENT_PATH,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as persistentArkmeExtensionActive, i as invokePersistentArkmeExtension, n as applyPersistentArkmeHostExtension, o as persistentArkmeExtensionRuntimeState, r as deactivatePersistentArkmeExtension, t as activatePersistentArkmeExtension } from "./persistent-runtime-
|
|
1
|
+
import { a as persistentArkmeExtensionActive, i as invokePersistentArkmeExtension, n as applyPersistentArkmeHostExtension, o as persistentArkmeExtensionRuntimeState, r as deactivatePersistentArkmeExtension, t as activatePersistentArkmeExtension } from "./persistent-runtime-DUrok1U3.js";
|
|
2
2
|
export { activatePersistentArkmeExtension, applyPersistentArkmeHostExtension, deactivatePersistentArkmeExtension, invokePersistentArkmeExtension, persistentArkmeExtensionActive, persistentArkmeExtensionRuntimeState };
|