@senguoyun/dsh-arkme 0.1.59 → 0.1.61
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/dsh-input-system-topic.md +7 -3
- package/docs/search-dsh-navigation.md +37 -0
- package/lib/client.js +5823 -3562
- package/lib/client.js.map +1 -1
- package/lib/harness-model-client.js +9 -0
- package/lib/harness-native-selection-client.js +1341 -0
- package/lib/harness-onboarding-client.js +64 -2
- package/lib/harness-session-client.js +39 -2
- package/lib/harness-sidebar-client.js +214 -23
- package/lib/index.js +114 -156
- package/lib/persistent-extension.js +1 -1
- package/lib/{persistent-runtime-ByM3JB3z.js → persistent-runtime-CXd9RuRR.js} +30263 -29553
- package/lib/sdk.js +9 -0
- package/lib/types/arkme-service.d.ts +7 -1
- package/lib/types/arkme-service.d.ts.map +1 -1
- package/lib/types/client/ArkmeCalendarSurface.d.ts +22 -1
- package/lib/types/client/ArkmeCalendarSurface.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/ArkmeDetailShell.d.ts +3 -1
- package/lib/types/client/ArkmeDetailShell.d.ts.map +1 -1
- package/lib/types/client/ArkmeDshMenu.d.ts +38 -0
- package/lib/types/client/ArkmeDshMenu.d.ts.map +1 -0
- package/lib/types/client/ArkmeFileViewer.d.ts +1 -0
- package/lib/types/client/ArkmeFileViewer.d.ts.map +1 -1
- package/lib/types/client/ArkmeGroupChatControls.d.ts +4 -0
- package/lib/types/client/ArkmeGroupChatControls.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/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 +2 -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/ArkmeSourceBreadcrumb.d.ts +6 -2
- package/lib/types/client/ArkmeSourceBreadcrumb.d.ts.map +1 -1
- package/lib/types/client/ArkmeTopicDirectoryPopover.d.ts +5 -2
- 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/PrivateChatActions.d.ts +15 -3
- package/lib/types/client/PrivateChatActions.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/calendar-invalidation-store.d.ts +10 -1
- package/lib/types/client/calendar-invalidation-store.d.ts.map +1 -1
- package/lib/types/client/calendar-month-cache.d.ts +37 -0
- package/lib/types/client/calendar-month-cache.d.ts.map +1 -0
- 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/conversation-export.d.ts +18 -0
- package/lib/types/client/conversation-export.d.ts.map +1 -0
- package/lib/types/client/conversation-menu-layer.d.ts +27 -0
- package/lib/types/client/conversation-menu-layer.d.ts.map +1 -0
- package/lib/types/client/conversation-menu-scrollbars.d.ts +3 -0
- package/lib/types/client/conversation-menu-scrollbars.d.ts.map +1 -0
- package/lib/types/client/conversation-selector-style.d.ts +34 -0
- package/lib/types/client/conversation-selector-style.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-dropdown.d.ts.map +1 -1
- package/lib/types/client/harness-session-hover.d.ts +1 -1
- package/lib/types/client/harness-session-hover.d.ts.map +1 -1
- package/lib/types/client/harness-session-menu-bridge.d.ts +2 -0
- package/lib/types/client/harness-session-menu-bridge.d.ts.map +1 -1
- 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-surface-viewport.d.ts +7 -0
- package/lib/types/client/harness-surface-viewport.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/navigation-cache.d.ts +6 -1
- package/lib/types/client/navigation-cache.d.ts.map +1 -1
- package/lib/types/client/provider-instance-runtime.d.ts.map +1 -1
- package/lib/types/client/realtime-client-events.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/self-topic-directory-cache.d.ts +42 -0
- package/lib/types/client/self-topic-directory-cache.d.ts.map +1 -0
- package/lib/types/client/self-topic-expansion-preference.d.ts +23 -0
- package/lib/types/client/self-topic-expansion-preference.d.ts.map +1 -0
- package/lib/types/client/self-topic-menu-bridge.d.ts +20 -0
- package/lib/types/client/self-topic-menu-bridge.d.ts.map +1 -0
- package/lib/types/client/self-topic-menu-hover.d.ts +3 -0
- package/lib/types/client/self-topic-menu-hover.d.ts.map +1 -0
- 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/client/use-calendar-month.d.ts +4 -0
- package/lib/types/client/use-calendar-month.d.ts.map +1 -0
- package/lib/types/dsh-agent-input-source.d.ts +2 -0
- package/lib/types/dsh-agent-input-source.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/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 +7 -0
- package/lib/types/sdk/index.d.ts.map +1 -1
- package/lib/types/services/calendar-service.d.ts +10 -0
- package/lib/types/services/calendar-service.d.ts.map +1 -1
- package/lib/types/services/chat-realtime-service.d.ts +3 -1
- package/lib/types/services/chat-realtime-service.d.ts.map +1 -1
- package/lib/types/services/chat-service.d.ts +5 -1
- 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/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/service.d.ts +5 -0
- package/lib/types/services/service.d.ts.map +1 -1
- package/lib/types/services/source-service.d.ts +3 -0
- package/lib/types/services/source-service.d.ts.map +1 -1
- package/lib/types/types.d.ts +21 -3
- 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,16 @@ 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
|
|
7
11
|
//#region src/client/harness-session-client.ts
|
|
8
|
-
const inject = [
|
|
12
|
+
const inject = [
|
|
13
|
+
"sessions",
|
|
14
|
+
"remote",
|
|
15
|
+
"remote.session"
|
|
16
|
+
];
|
|
9
17
|
const REFRESH_MS = 1e4;
|
|
10
18
|
/** The iframe reads selection through the public DSH store; Arkme owns visibility. */
|
|
11
19
|
function apply(ctx) {
|
|
@@ -13,9 +21,37 @@ window.__ModuleLoader__.load({
|
|
|
13
21
|
const surface = window.frameElement?.parentElement;
|
|
14
22
|
if (surface?.getAttribute("data-arkme-owned") !== "deepseek-harness-surface") return () => void 0;
|
|
15
23
|
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
24
|
const sessions = ctx.sessions;
|
|
18
25
|
if (sessions === void 0) return () => void 0;
|
|
26
|
+
const frameWindow = window;
|
|
27
|
+
const navigation = {
|
|
28
|
+
async has(sessionId) {
|
|
29
|
+
if (!/^[A-Za-z0-9_.:-]{1,256}$/.test(sessionId)) throw new Error("DSH 对话标识无效");
|
|
30
|
+
const remote = ctx.remote?.session;
|
|
31
|
+
if (typeof remote?.list !== "function") throw new Error("当前 DSH 版本无法核验本机会话");
|
|
32
|
+
const result = await remote.list({});
|
|
33
|
+
if (!result.ok) throw new Error(result.error?.message || "本机会话列表读取失败,请稍后重试");
|
|
34
|
+
if (!Array.isArray(result.value?.items)) throw new Error("本机会话列表响应不完整");
|
|
35
|
+
if (!result.value.items.some((item) => item.sessionId === sessionId)) return false;
|
|
36
|
+
const refreshable = sessions;
|
|
37
|
+
if (sessions.list.getSnapshot().byId[sessionId] === void 0) {
|
|
38
|
+
if (typeof refreshable.refresh !== "function") throw new Error("本机会话列表尚未就绪,请稍后重试");
|
|
39
|
+
await refreshable.refresh();
|
|
40
|
+
}
|
|
41
|
+
if (sessions.list.getSnapshot().byId[sessionId] === void 0) throw new Error("本机会话列表尚未就绪,请稍后重试");
|
|
42
|
+
return true;
|
|
43
|
+
},
|
|
44
|
+
open(sessionId) {
|
|
45
|
+
if (typeof sessionId !== "string" || sessionId.trim() === "") throw new Error("DSH 对话标识无效");
|
|
46
|
+
if (typeof sessions.open !== "function") throw new Error("当前 DSH 版本暂不支持打开任务");
|
|
47
|
+
sessions.open(sessionId);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
frameWindow[HARNESS_SESSION_NAVIGATION_KEY] = navigation;
|
|
51
|
+
const disposeNavigation = () => {
|
|
52
|
+
if (frameWindow["__arkmeHarnessSessionNavigation"] === navigation) delete frameWindow[HARNESS_SESSION_NAVIGATION_KEY];
|
|
53
|
+
};
|
|
54
|
+
if (apiPath === void 0 || !/^\/[A-Za-z0-9/_-]+$/.test(apiPath)) return disposeNavigation;
|
|
19
55
|
const windowRef = crypto.randomUUID();
|
|
20
56
|
let revision = 0;
|
|
21
57
|
let stopped = false;
|
|
@@ -106,6 +142,7 @@ window.__ModuleLoader__.load({
|
|
|
106
142
|
window.addEventListener("pageshow", changed);
|
|
107
143
|
report();
|
|
108
144
|
return () => {
|
|
145
|
+
disposeNavigation();
|
|
109
146
|
stopped = true;
|
|
110
147
|
clearSelection();
|
|
111
148
|
observer.disconnect();
|
|
@@ -71,6 +71,181 @@ window.__ModuleLoader__.load({
|
|
|
71
71
|
const HARNESS_MENU_CLOSE = "arkme:harness-menu-close";
|
|
72
72
|
const HARNESS_MENU_POSITION = "arkme:harness-menu-position";
|
|
73
73
|
//#endregion
|
|
74
|
+
//#region src/client/conversation-selector-style.ts
|
|
75
|
+
/** Native DSH menu metrics, shared by both topic-menu entry points and the session adapter. */
|
|
76
|
+
const CONVERSATION_MENU_LAYOUT = {
|
|
77
|
+
width: 320,
|
|
78
|
+
maxHeight: 560,
|
|
79
|
+
paddingY: 8,
|
|
80
|
+
paddingX: 10,
|
|
81
|
+
rowHeight: 32,
|
|
82
|
+
rowGap: 2,
|
|
83
|
+
titleFontSize: 14,
|
|
84
|
+
secondaryFontSize: 12,
|
|
85
|
+
lineHeight: "20px",
|
|
86
|
+
listBottomPadding: 16,
|
|
87
|
+
fadeHeight: 24,
|
|
88
|
+
createHeight: 38,
|
|
89
|
+
hoverGap: 8,
|
|
90
|
+
viewportInset: 12,
|
|
91
|
+
scrollbarWidth: 8,
|
|
92
|
+
scrollbarContentPadding: 2,
|
|
93
|
+
scrollbarLingerMs: 2e3
|
|
94
|
+
};
|
|
95
|
+
/** Keep the current selection distinct from a transient hover in both menus. */
|
|
96
|
+
const CONVERSATION_MENU_COLORS = {
|
|
97
|
+
selected: "#eef1f8",
|
|
98
|
+
hover: "var(--dsw-alias-interactive-bg-hover, #f3f4f7)"
|
|
99
|
+
};
|
|
100
|
+
const CONVERSATION_MENU_SURFACE = {
|
|
101
|
+
background: "var(--dsw-specific-sidebar-fill, #f9fafb)",
|
|
102
|
+
border: "1px solid var(--dsw-alias-border-l3, #e5e7eb)",
|
|
103
|
+
borderRadius: 10,
|
|
104
|
+
boxShadow: "0 10px 32px #0000001f"
|
|
105
|
+
};
|
|
106
|
+
/** Shared by the native DSH adapter and the self-topic selector, including focus feedback. */
|
|
107
|
+
const CONVERSATION_SELECTOR_CSS = `
|
|
108
|
+
/* Both menus use the native scrollbar tokens and a stable gutter. The list's
|
|
109
|
+
own variables deliberately override the native sidebar's ancestor quietBars. */
|
|
110
|
+
[data-arkme-menu-scroll] {
|
|
111
|
+
--dsh-scrollbar-thumb: transparent;
|
|
112
|
+
--dsh-scrollbar-thumb-hover: transparent;
|
|
113
|
+
scrollbar-gutter: stable;
|
|
114
|
+
padding-right: ${CONVERSATION_MENU_LAYOUT.scrollbarContentPadding}px;
|
|
115
|
+
padding-bottom: ${CONVERSATION_MENU_LAYOUT.listBottomPadding}px;
|
|
116
|
+
}
|
|
117
|
+
[data-arkme-menu-scrollbars="visible"] [data-arkme-menu-scroll] {
|
|
118
|
+
--dsh-scrollbar-thumb: var(--dsw-alias-scrollbar-bg-l2);
|
|
119
|
+
--dsh-scrollbar-thumb-hover: var(--dsw-alias-scrollbar-hover-l2);
|
|
120
|
+
}
|
|
121
|
+
[data-arkme-menu-scroll]::-webkit-scrollbar { width: ${CONVERSATION_MENU_LAYOUT.scrollbarWidth}px; height: ${CONVERSATION_MENU_LAYOUT.scrollbarWidth}px; }
|
|
122
|
+
[data-arkme-menu-scroll]::-webkit-scrollbar-thumb { background: var(--dsh-scrollbar-thumb); border-radius: 4px; }
|
|
123
|
+
[data-arkme-menu-scroll]::-webkit-scrollbar-thumb:hover { background: var(--dsh-scrollbar-thumb-hover); }
|
|
124
|
+
[data-arkme-menu-scroll]::-webkit-scrollbar-track, [data-arkme-menu-scroll]::-webkit-scrollbar-corner { background: transparent; }
|
|
125
|
+
@supports not selector(::-webkit-scrollbar) {
|
|
126
|
+
[data-arkme-menu-scroll] { scrollbar-width: thin; scrollbar-color: var(--dsh-scrollbar-thumb) transparent; }
|
|
127
|
+
}
|
|
128
|
+
/* Match DSH's solid selector footer and its native New Session / View Options controls. */
|
|
129
|
+
:is([data-arkme-workspace], [data-arkme-self-topic-menu]) .arkme-self-topic-create-button { flex: 1; }
|
|
130
|
+
:is([data-arkme-workspace], [data-arkme-self-topic-menu]) .arkme-self-topic-create-button,
|
|
131
|
+
[data-arkme-session-create] {
|
|
132
|
+
min-width: 0;
|
|
133
|
+
height: 38px;
|
|
134
|
+
border: 1px solid var(--dsw-alias-border-l2, #dfe1e5);
|
|
135
|
+
border-radius: 12px;
|
|
136
|
+
background: var(--dsw-alias-button-elevated-fill, #fff);
|
|
137
|
+
color: var(--dsw-alias-label-primary, #171923);
|
|
138
|
+
padding: 8px 16px;
|
|
139
|
+
gap: 6px;
|
|
140
|
+
font-size: 14px;
|
|
141
|
+
font-weight: 500;
|
|
142
|
+
line-height: 22px;
|
|
143
|
+
white-space: nowrap;
|
|
144
|
+
}
|
|
145
|
+
:is([data-arkme-workspace], [data-arkme-self-topic-menu]) .arkme-self-topic-create-button:hover:not(:disabled),
|
|
146
|
+
[data-arkme-session-create]:hover:not(:disabled) {
|
|
147
|
+
background: var(--dsw-alias-button-floating-hover, #f3f4f7);
|
|
148
|
+
border-color: var(--dsw-alias-border-l2, #d9dade);
|
|
149
|
+
}
|
|
150
|
+
:is([data-arkme-workspace], [data-arkme-self-topic-menu]) .arkme-dsh-view-options-button,
|
|
151
|
+
[data-arkme-session-tools-actions] button {
|
|
152
|
+
corner-shape: round;
|
|
153
|
+
box-sizing: border-box;
|
|
154
|
+
width: 28px;
|
|
155
|
+
height: 28px;
|
|
156
|
+
flex: none;
|
|
157
|
+
display: inline-flex;
|
|
158
|
+
align-items: center;
|
|
159
|
+
justify-content: center;
|
|
160
|
+
padding: 0;
|
|
161
|
+
border: none;
|
|
162
|
+
border-radius: 50%;
|
|
163
|
+
background: transparent;
|
|
164
|
+
color: var(--dsw-alias-label-secondary);
|
|
165
|
+
cursor: pointer;
|
|
166
|
+
}
|
|
167
|
+
:is([data-arkme-workspace], [data-arkme-self-topic-menu]) .arkme-dsh-view-options-button:hover,
|
|
168
|
+
[data-arkme-session-tools-actions] button:hover {
|
|
169
|
+
background: var(--dsw-alias-interactive-bg-hover);
|
|
170
|
+
}
|
|
171
|
+
[data-arkme-conversation-selector] {
|
|
172
|
+
display: inline-flex; align-items: stretch; gap: 0; min-width: 0; max-width: 100%; height: 30px;
|
|
173
|
+
border: 1px solid var(--dsw-alias-border-l3, #d4d6da); border-radius: 10px; padding: 0; margin-left: 0; box-sizing: border-box;
|
|
174
|
+
color: var(--dsw-alias-label-primary, inherit); background: var(--dsw-alias-button-elevated-fill, #fff); font: inherit;
|
|
175
|
+
font-size: 16px; font-weight: 600; line-height: 28px; overflow: hidden; cursor: pointer; outline: none;
|
|
176
|
+
}
|
|
177
|
+
[data-arkme-conversation-selector] > span:first-child { padding: 0 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
178
|
+
[data-arkme-conversation-selector] > span:last-child {
|
|
179
|
+
color: var(--dsw-alias-label-secondary, #626872); flex: none; width: 28px;
|
|
180
|
+
border-left: 1px solid var(--dsw-alias-border-l3, #d4d6da); display: flex; align-items: center; justify-content: center;
|
|
181
|
+
}
|
|
182
|
+
[data-arkme-conversation-selector][aria-expanded="true"] svg { transform: rotate(180deg); }
|
|
183
|
+
[data-arkme-conversation-selector]:hover, [data-arkme-conversation-selector][aria-expanded="true"] { background: var(--dsw-alias-interactive-bg-hover, #f3f4f6); }
|
|
184
|
+
[data-arkme-conversation-selector]:focus-visible { outline: 2px solid #4c70ef; outline-offset: -2px; }
|
|
185
|
+
`;
|
|
186
|
+
//#endregion
|
|
187
|
+
//#region src/client/conversation-menu-layer.ts
|
|
188
|
+
function conversationMenuPosition(anchor, width, height, viewport) {
|
|
189
|
+
const { hoverGap, viewportInset } = CONVERSATION_MENU_LAYOUT;
|
|
190
|
+
const right = anchor.right + hoverGap;
|
|
191
|
+
const left = right + width <= viewport.width - viewportInset ? right : anchor.left - width - hoverGap;
|
|
192
|
+
return {
|
|
193
|
+
left: Math.max(viewportInset, Math.min(left, viewport.width - width - viewportInset)),
|
|
194
|
+
top: Math.max(viewportInset, Math.min(anchor.top, viewport.height - height - viewportInset))
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/client/conversation-menu-scrollbars.ts
|
|
199
|
+
/** The native DSH recipe: reveal on entry, linger for 2s on exit, never resize. */
|
|
200
|
+
function watchConversationMenuScrollbars(menu, list) {
|
|
201
|
+
const doc = menu.ownerDocument;
|
|
202
|
+
const win = doc.defaultView;
|
|
203
|
+
let timer;
|
|
204
|
+
let visible = false;
|
|
205
|
+
const setVisible = (next) => {
|
|
206
|
+
visible = next;
|
|
207
|
+
menu.setAttribute("data-arkme-menu-scrollbars", next ? "visible" : "quiet");
|
|
208
|
+
};
|
|
209
|
+
const cancel = () => {
|
|
210
|
+
win.clearTimeout(timer);
|
|
211
|
+
timer = void 0;
|
|
212
|
+
};
|
|
213
|
+
const enter = () => {
|
|
214
|
+
cancel();
|
|
215
|
+
setVisible(true);
|
|
216
|
+
};
|
|
217
|
+
const leave = () => {
|
|
218
|
+
if (!visible || timer !== void 0) return;
|
|
219
|
+
timer = win.setTimeout(() => {
|
|
220
|
+
timer = void 0;
|
|
221
|
+
setVisible(false);
|
|
222
|
+
}, CONVERSATION_MENU_LAYOUT.scrollbarLingerMs);
|
|
223
|
+
};
|
|
224
|
+
const move = (event) => {
|
|
225
|
+
if (!visible) return;
|
|
226
|
+
const rect = menu.getBoundingClientRect();
|
|
227
|
+
if (event.clientX >= rect.left && event.clientX < rect.right && event.clientY >= rect.top && event.clientY < rect.bottom) cancel();
|
|
228
|
+
else leave();
|
|
229
|
+
};
|
|
230
|
+
list.setAttribute("data-arkme-menu-scroll", "");
|
|
231
|
+
setVisible(menu.matches(":hover"));
|
|
232
|
+
menu.addEventListener("pointerenter", enter);
|
|
233
|
+
menu.addEventListener("pointerleave", leave);
|
|
234
|
+
menu.addEventListener("dragenter", enter);
|
|
235
|
+
doc.addEventListener("pointermove", move);
|
|
236
|
+
doc.addEventListener("dragover", move);
|
|
237
|
+
return () => {
|
|
238
|
+
cancel();
|
|
239
|
+
menu.removeEventListener("pointerenter", enter);
|
|
240
|
+
menu.removeEventListener("pointerleave", leave);
|
|
241
|
+
menu.removeEventListener("dragenter", enter);
|
|
242
|
+
doc.removeEventListener("pointermove", move);
|
|
243
|
+
doc.removeEventListener("dragover", move);
|
|
244
|
+
menu.removeAttribute("data-arkme-menu-scrollbars");
|
|
245
|
+
list.removeAttribute("data-arkme-menu-scroll");
|
|
246
|
+
};
|
|
247
|
+
}
|
|
248
|
+
//#endregion
|
|
74
249
|
//#region src/client/harness-session-dropdown.ts
|
|
75
250
|
const PREFIX = "data-arkme-session-";
|
|
76
251
|
const HEADER = "[data-slot=\"conversation.session.header\"] > header";
|
|
@@ -183,6 +358,8 @@ window.__ModuleLoader__.load({
|
|
|
183
358
|
const rowFocusCleanups = /* @__PURE__ */ new Map();
|
|
184
359
|
let toolbarMarks = [];
|
|
185
360
|
let summaryMarks = [];
|
|
361
|
+
let scrollList;
|
|
362
|
+
let stopScrollbars;
|
|
186
363
|
let initiallyCollapsed = false;
|
|
187
364
|
let expandedByUs = false;
|
|
188
365
|
let columnBefore = {
|
|
@@ -196,6 +373,7 @@ window.__ModuleLoader__.load({
|
|
|
196
373
|
trigger.type = "button";
|
|
197
374
|
trigger.setAttribute("aria-haspopup", "dialog");
|
|
198
375
|
trigger.setAttribute("aria-expanded", "false");
|
|
376
|
+
trigger.setAttribute("data-arkme-conversation-selector", "");
|
|
199
377
|
mark(trigger, "trigger");
|
|
200
378
|
const label = doc.createElement("span");
|
|
201
379
|
const arrow = doc.createElement("span");
|
|
@@ -222,26 +400,27 @@ window.__ModuleLoader__.load({
|
|
|
222
400
|
html[${PREFIX}preview] body { visibility: hidden !important; }
|
|
223
401
|
html[${PREFIX}preview] [${PREFIX}column], html[${PREFIX}preview] [role="menu"],
|
|
224
402
|
html[${PREFIX}preview] [role="dialog"], html[${PREFIX}preview] [role="alertdialog"] { visibility: visible !important; }
|
|
225
|
-
[${PREFIX}frame] { grid-template-columns: 0px minmax(0, 1fr) var(--arkme-session-rightbar) !important; }
|
|
403
|
+
[${PREFIX}frame] { grid-template-columns: 0px minmax(0, 1fr) var(--arkme-session-rightbar) !important; transition: none !important; }
|
|
226
404
|
[${PREFIX}frame] > :nth-child(2) { grid-column: 2; }
|
|
227
405
|
[${PREFIX}frame] > [data-rightbar-col] { grid-column: 3; }
|
|
228
406
|
[${PREFIX}frame] > [data-side="sidebar"] { display: none !important; }
|
|
229
407
|
[${PREFIX}column] {
|
|
230
408
|
position: fixed !important; left: var(--arkme-session-left); top: var(--arkme-session-top);
|
|
231
409
|
width: var(--arkme-session-width); height: auto; max-height: var(--arkme-session-height); z-index: 80;
|
|
232
|
-
border:
|
|
233
|
-
box-shadow:
|
|
410
|
+
border: ${CONVERSATION_MENU_SURFACE.border}; border-radius: ${CONVERSATION_MENU_SURFACE.borderRadius}px;
|
|
411
|
+
background: ${CONVERSATION_MENU_SURFACE.background}; box-shadow: ${CONVERSATION_MENU_SURFACE.boxShadow}; box-sizing: border-box; overflow: visible !important;
|
|
234
412
|
display: none !important; pointer-events: none;
|
|
235
413
|
}
|
|
236
414
|
[${PREFIX}column][${PREFIX}open] { display: block !important; pointer-events: auto; }
|
|
237
|
-
[${PREFIX}
|
|
415
|
+
html[data-arkme-harness-viewport] [${PREFIX}column] { box-shadow: none; }
|
|
416
|
+
[${PREFIX}root] { width: 100% !important; height: auto; max-height: var(--arkme-session-height); border-radius: 9px; padding: ${CONVERSATION_MENU_LAYOUT.paddingY}px ${CONVERSATION_MENU_LAYOUT.paddingX}px !important; position: relative; }
|
|
238
417
|
[${PREFIX}brand], [${PREFIX}native-title] { display: none !important; }
|
|
239
418
|
[${PREFIX}create] { order: 10; flex-shrink: 0; margin: 8px 0 0 !important; }
|
|
240
419
|
[${PREFIX}root][${PREFIX}compact-tools] [${PREFIX}create] { width: calc(100% - var(--arkme-session-tools-width) - 8px); }
|
|
241
420
|
[${PREFIX}tools-header] { display: contents !important; }
|
|
242
421
|
[${PREFIX}tools-label], [${PREFIX}tools-search] { display: none !important; }
|
|
243
422
|
[${PREFIX}tools-actions] {
|
|
244
|
-
position: absolute !important; bottom:
|
|
423
|
+
position: absolute !important; bottom: ${CONVERSATION_MENU_LAYOUT.paddingY}px; right: ${CONVERSATION_MENU_LAYOUT.paddingX}px; height: ${CONVERSATION_MENU_LAYOUT.createHeight}px;
|
|
245
424
|
display: flex !important; align-items: center; gap: 4px; max-width: none !important;
|
|
246
425
|
opacity: 1 !important; visibility: visible !important; transform: none !important;
|
|
247
426
|
}
|
|
@@ -253,21 +432,15 @@ window.__ModuleLoader__.load({
|
|
|
253
432
|
[${PREFIX}summary] [data-slot="conversation.session.header.actions"] > * { font-size: inherit; line-height: inherit; }
|
|
254
433
|
[${PREFIX}turn-count] { display: inline-flex; align-items: center; white-space: nowrap; }
|
|
255
434
|
[${PREFIX}summary] [data-slot="conversation.session.header.actions"] > * + [${PREFIX}turn-count]::before { content: '·'; margin: 0 7px; }
|
|
256
|
-
[${PREFIX}anchor][${PREFIX}fallback] {
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
border: 1px solid var(--dsw-alias-border-l3, #d4d6da); border-radius: 10px; padding: 0; margin-left: 0; box-sizing: border-box;
|
|
260
|
-
color: var(--dsw-alias-label-primary, inherit); background: var(--dsw-alias-button-elevated-fill, #fff); font: inherit;
|
|
261
|
-
font-size: 16px; font-weight: 600; line-height: 28px; overflow: hidden; cursor: pointer;
|
|
262
|
-
}
|
|
263
|
-
[${PREFIX}trigger] > span:first-child { padding: 0 10px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
264
|
-
[${PREFIX}trigger] > span:last-child {
|
|
265
|
-
color: var(--dsw-alias-label-secondary, #626872); flex: none; width: 28px;
|
|
266
|
-
border-left: 1px solid var(--dsw-alias-border-l3, #d4d6da); display: flex; align-items: center; justify-content: center;
|
|
435
|
+
[${PREFIX}anchor][${PREFIX}fallback] {
|
|
436
|
+
width: max-content; position: absolute; top: 10px;
|
|
437
|
+
left: 20px; z-index: 10; max-width: calc(100% - 40px);
|
|
267
438
|
}
|
|
268
|
-
|
|
269
|
-
[${PREFIX}
|
|
270
|
-
[${PREFIX}
|
|
439
|
+
${CONVERSATION_SELECTOR_CSS}
|
|
440
|
+
[${PREFIX}column] [role="treeitem"][aria-selected]:hover { background: ${CONVERSATION_MENU_COLORS.hover}; }
|
|
441
|
+
[${PREFIX}column] [role="treeitem"][aria-selected="true"],
|
|
442
|
+
[${PREFIX}column] [role="treeitem"][aria-selected="true"]:hover { background: ${CONVERSATION_MENU_COLORS.selected}; }
|
|
443
|
+
[${PREFIX}column] [role="treeitem"]:focus-visible { outline: 2px solid #4c70ef; outline-offset: -2px; }
|
|
271
444
|
`;
|
|
272
445
|
doc.head.append(style);
|
|
273
446
|
function close(focus = false) {
|
|
@@ -283,6 +456,9 @@ window.__ModuleLoader__.load({
|
|
|
283
456
|
}
|
|
284
457
|
function restore() {
|
|
285
458
|
close();
|
|
459
|
+
stopScrollbars?.();
|
|
460
|
+
stopScrollbars = void 0;
|
|
461
|
+
scrollList = void 0;
|
|
286
462
|
for (const cleanup of rowFocusCleanups.values()) cleanup();
|
|
287
463
|
for (const [node, key] of toolbarMarks) node.removeAttribute(PREFIX + key);
|
|
288
464
|
toolbarMarks = [];
|
|
@@ -320,13 +496,17 @@ window.__ModuleLoader__.load({
|
|
|
320
496
|
function position() {
|
|
321
497
|
if (!current) return;
|
|
322
498
|
const rect = trigger.getBoundingClientRect();
|
|
323
|
-
const width = Math.min(
|
|
499
|
+
const width = Math.min(CONVERSATION_MENU_LAYOUT.width, win.innerWidth - 24);
|
|
324
500
|
const anchor = external?.anchor();
|
|
325
|
-
const
|
|
326
|
-
|
|
501
|
+
const hoverPosition = anchor && conversationMenuPosition(anchor, width, Math.min(CONVERSATION_MENU_LAYOUT.maxHeight, win.innerHeight - 24), {
|
|
502
|
+
width: win.innerWidth,
|
|
503
|
+
height: win.innerHeight
|
|
504
|
+
});
|
|
505
|
+
const top = hoverPosition?.top ?? Math.max(8, Math.min(rect.bottom + 7, win.innerHeight - 100));
|
|
506
|
+
variable(current.column, "--arkme-session-left", `${hoverPosition?.left ?? Math.max(CONVERSATION_MENU_LAYOUT.viewportInset, Math.min(rect.left, win.innerWidth - width - CONVERSATION_MENU_LAYOUT.viewportInset))}px`);
|
|
327
507
|
variable(current.column, "--arkme-session-top", `${top}px`);
|
|
328
508
|
variable(current.column, "--arkme-session-width", `${width}px`);
|
|
329
|
-
variable(current.column, "--arkme-session-height", `${Math.min(
|
|
509
|
+
variable(current.column, "--arkme-session-height", `${Math.min(CONVERSATION_MENU_LAYOUT.maxHeight, win.innerHeight - top - CONVERSATION_MENU_LAYOUT.viewportInset)}px`);
|
|
330
510
|
external?.onLayout();
|
|
331
511
|
}
|
|
332
512
|
function sync() {
|
|
@@ -355,6 +535,17 @@ window.__ModuleLoader__.load({
|
|
|
355
535
|
mark(next.root, "root");
|
|
356
536
|
mark(next.brand, "brand");
|
|
357
537
|
mark(next.create, "create");
|
|
538
|
+
const tree = next.root.querySelector("[data-slot=\"sidebar.workspaces\"] [role=\"tree\"]");
|
|
539
|
+
let list = tree ?? void 0;
|
|
540
|
+
for (let node = tree; node && node !== next.root; node = node.parentElement) if (win.getComputedStyle(node).overflowY === "auto") {
|
|
541
|
+
list = node;
|
|
542
|
+
break;
|
|
543
|
+
}
|
|
544
|
+
if (list !== scrollList) {
|
|
545
|
+
stopScrollbars?.();
|
|
546
|
+
scrollList = list;
|
|
547
|
+
stopScrollbars = list ? watchConversationMenuScrollbars(next.root, list) : void 0;
|
|
548
|
+
}
|
|
358
549
|
const nextTools = compactTools(next);
|
|
359
550
|
for (const [node, key] of toolbarMarks) if (!nextTools.some(([nextNode, nextKey]) => node === nextNode && key === nextKey)) node.removeAttribute(PREFIX + key);
|
|
360
551
|
toolbarMarks = nextTools;
|