@senguoyun/dsh-arkme 0.1.67 → 0.1.68

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.
Files changed (167) hide show
  1. package/docs/chat-add-long-article.md +39 -0
  2. package/docs/desktop-direct-recording.md +40 -0
  3. package/docs/desktop-membership-handoff.md +36 -0
  4. package/docs/desktop-regression-2026-09-19.md +77 -0
  5. package/docs/desktop-screenshot.md +59 -0
  6. package/docs/private-interaction-directory-handoff.md +95 -0
  7. package/docs/recording-calendar-coverage.md +41 -0
  8. package/docs/recording-presence-handoff.md +155 -0
  9. package/lib/client.js +49834 -45144
  10. package/lib/client.js.map +1 -1
  11. package/lib/harness-model-client.js +8 -0
  12. package/lib/harness-native-selection-client.js +72 -5
  13. package/lib/harness-sidebar-client.js +46 -2
  14. package/lib/index.js +27 -3
  15. package/lib/persistent-extension.js +1 -1
  16. package/lib/{persistent-runtime-C_Geaa4B.js → persistent-runtime-DlJzDZlE.js} +816 -94
  17. package/lib/sdk.js +8 -0
  18. package/lib/types/arkme-service.d.ts +18 -1
  19. package/lib/types/arkme-service.d.ts.map +1 -1
  20. package/lib/types/call-record-presentation.d.ts +2 -0
  21. package/lib/types/call-record-presentation.d.ts.map +1 -1
  22. package/lib/types/client/ArkmeArticlePicker.d.ts +10 -0
  23. package/lib/types/client/ArkmeArticlePicker.d.ts.map +1 -0
  24. package/lib/types/client/ArkmeCallDetailContent.d.ts.map +1 -1
  25. package/lib/types/client/ArkmeCallRecordContent.d.ts.map +1 -1
  26. package/lib/types/client/ArkmeCallSurface.d.ts +3 -1
  27. package/lib/types/client/ArkmeCallSurface.d.ts.map +1 -1
  28. package/lib/types/client/ArkmeChatMemberActions.d.ts +2 -0
  29. package/lib/types/client/ArkmeChatMemberActions.d.ts.map +1 -1
  30. package/lib/types/client/ArkmeComposerScreenshotButton.d.ts +13 -0
  31. package/lib/types/client/ArkmeComposerScreenshotButton.d.ts.map +1 -0
  32. package/lib/types/client/ArkmeComposerSendButton.d.ts.map +1 -1
  33. package/lib/types/client/ArkmeDetailShell.d.ts +2 -1
  34. package/lib/types/client/ArkmeDetailShell.d.ts.map +1 -1
  35. package/lib/types/client/ArkmeDshMenu.d.ts +2 -0
  36. package/lib/types/client/ArkmeDshMenu.d.ts.map +1 -1
  37. package/lib/types/client/ArkmeEmojiPicker.d.ts.map +1 -1
  38. package/lib/types/client/ArkmeFileViewer.d.ts.map +1 -1
  39. package/lib/types/client/ArkmeGroupChatControls.d.ts +32 -0
  40. package/lib/types/client/ArkmeGroupChatControls.d.ts.map +1 -1
  41. package/lib/types/client/ArkmeLinkQuickView.d.ts +8 -0
  42. package/lib/types/client/ArkmeLinkQuickView.d.ts.map +1 -0
  43. package/lib/types/client/ArkmeLongArticleDialog.d.ts +6 -3
  44. package/lib/types/client/ArkmeLongArticleDialog.d.ts.map +1 -1
  45. package/lib/types/client/ArkmeLongArticleQuickView.d.ts +6 -0
  46. package/lib/types/client/ArkmeLongArticleQuickView.d.ts.map +1 -0
  47. package/lib/types/client/ArkmeMarkdownBody.d.ts +4 -1
  48. package/lib/types/client/ArkmeMarkdownBody.d.ts.map +1 -1
  49. package/lib/types/client/ArkmeMembershipDialog.d.ts +14 -0
  50. package/lib/types/client/ArkmeMembershipDialog.d.ts.map +1 -0
  51. package/lib/types/client/ArkmeMessageReadReceipt.d.ts.map +1 -1
  52. package/lib/types/client/ArkmeNoteDetails.d.ts +1 -1
  53. package/lib/types/client/ArkmeNoteDetails.d.ts.map +1 -1
  54. package/lib/types/client/ArkmeProductNavigation.d.ts.map +1 -1
  55. package/lib/types/client/ArkmeQuickAdd.d.ts +2 -1
  56. package/lib/types/client/ArkmeQuickAdd.d.ts.map +1 -1
  57. package/lib/types/client/ArkmeReadReceiptIcon.d.ts +7 -0
  58. package/lib/types/client/ArkmeReadReceiptIcon.d.ts.map +1 -0
  59. package/lib/types/client/ArkmeRecordingSurface.d.ts +3 -1
  60. package/lib/types/client/ArkmeRecordingSurface.d.ts.map +1 -1
  61. package/lib/types/client/ArkmeRichContent.d.ts.map +1 -1
  62. package/lib/types/client/ArkmeRichText.d.ts +6 -2
  63. package/lib/types/client/ArkmeRichText.d.ts.map +1 -1
  64. package/lib/types/client/ArkmeRightPanelHeader.d.ts +3 -1
  65. package/lib/types/client/ArkmeRightPanelHeader.d.ts.map +1 -1
  66. package/lib/types/client/ArkmeScreenshotCropDialog.d.ts +9 -0
  67. package/lib/types/client/ArkmeScreenshotCropDialog.d.ts.map +1 -0
  68. package/lib/types/client/ArkmeSearchSurface.d.ts.map +1 -1
  69. package/lib/types/client/ArkmeSidebar.d.ts +9 -0
  70. package/lib/types/client/ArkmeSidebar.d.ts.map +1 -1
  71. package/lib/types/client/ArkmeSourceBreadcrumb.d.ts.map +1 -1
  72. package/lib/types/client/ArkmeVoiceprintSurface.d.ts.map +1 -1
  73. package/lib/types/client/ArkmeWideConversation.d.ts.map +1 -1
  74. package/lib/types/client/api.d.ts +1 -1
  75. package/lib/types/client/api.d.ts.map +1 -1
  76. package/lib/types/client/arkme-membership.d.ts +15 -0
  77. package/lib/types/client/arkme-membership.d.ts.map +1 -0
  78. package/lib/types/client/browser-screenshot.d.ts +27 -0
  79. package/lib/types/client/browser-screenshot.d.ts.map +1 -0
  80. package/lib/types/client/chat-directory-store.d.ts.map +1 -1
  81. package/lib/types/client/composer-article-store.d.ts +35 -0
  82. package/lib/types/client/composer-article-store.d.ts.map +1 -0
  83. package/lib/types/client/composer-paste-focus.d.ts +21 -0
  84. package/lib/types/client/composer-paste-focus.d.ts.map +1 -0
  85. package/lib/types/client/composer-selection-request.d.ts +2 -0
  86. package/lib/types/client/composer-selection-request.d.ts.map +1 -1
  87. package/lib/types/client/conversation-menu-layer.d.ts +9 -2
  88. package/lib/types/client/conversation-menu-layer.d.ts.map +1 -1
  89. package/lib/types/client/conversation-selector-style.d.ts +2 -2
  90. package/lib/types/client/conversation-selector-style.d.ts.map +1 -1
  91. package/lib/types/client/directory-search-layout.d.ts +1 -1
  92. package/lib/types/client/directory-search-layout.d.ts.map +1 -1
  93. package/lib/types/client/file-send-tasks.d.ts +1 -1
  94. package/lib/types/client/file-send-tasks.d.ts.map +1 -1
  95. package/lib/types/client/harness-session-hover.d.ts.map +1 -1
  96. package/lib/types/client/mention-read-status.d.ts +10 -0
  97. package/lib/types/client/mention-read-status.d.ts.map +1 -0
  98. package/lib/types/client/menu-hover-region.d.ts +5 -0
  99. package/lib/types/client/menu-hover-region.d.ts.map +1 -0
  100. package/lib/types/client/recordings/ArkmeDirectRecording.d.ts +10 -0
  101. package/lib/types/client/recordings/ArkmeDirectRecording.d.ts.map +1 -0
  102. package/lib/types/client/recordings/ArkmeRecordingNavigationHint.d.ts +9 -0
  103. package/lib/types/client/recordings/ArkmeRecordingNavigationHint.d.ts.map +1 -0
  104. package/lib/types/client/recordings/ArkmeRecordingTimeline.d.ts +4 -2
  105. package/lib/types/client/recordings/ArkmeRecordingTimeline.d.ts.map +1 -1
  106. package/lib/types/client/recordings/direct-recording-capture.d.ts +14 -0
  107. package/lib/types/client/recordings/direct-recording-capture.d.ts.map +1 -0
  108. package/lib/types/client/recordings/direct-recording-journal.d.ts +33 -0
  109. package/lib/types/client/recordings/direct-recording-journal.d.ts.map +1 -0
  110. package/lib/types/client/recordings/direct-recording-store.d.ts +68 -0
  111. package/lib/types/client/recordings/direct-recording-store.d.ts.map +1 -0
  112. package/lib/types/client/recordings/recording-breath.d.ts +6 -0
  113. package/lib/types/client/recordings/recording-breath.d.ts.map +1 -0
  114. package/lib/types/client/recordings/recording-coverage.d.ts +6 -0
  115. package/lib/types/client/recordings/recording-coverage.d.ts.map +1 -0
  116. package/lib/types/client/redesign/styles.d.ts.map +1 -1
  117. package/lib/types/client/search-source-rows.d.ts +9 -0
  118. package/lib/types/client/search-source-rows.d.ts.map +1 -0
  119. package/lib/types/client/self-topic-menu-bridge.d.ts +2 -6
  120. package/lib/types/client/self-topic-menu-bridge.d.ts.map +1 -1
  121. package/lib/types/client/self-topic-menu-hover.d.ts.map +1 -1
  122. package/lib/types/client/text-link-parser.d.ts +1 -9
  123. package/lib/types/client/text-link-parser.d.ts.map +1 -1
  124. package/lib/types/client/text-link-tlds.d.ts +1 -1
  125. package/lib/types/client/text-link-tlds.d.ts.map +1 -1
  126. package/lib/types/client/use-conversation-name-search.d.ts +9 -0
  127. package/lib/types/client/use-conversation-name-search.d.ts.map +1 -0
  128. package/lib/types/client/use-resizable-note-detail.d.ts +3 -3
  129. package/lib/types/client/use-resizable-note-detail.d.ts.map +1 -1
  130. package/lib/types/desktop-screenshot-contract.d.ts +14 -0
  131. package/lib/types/desktop-screenshot-contract.d.ts.map +1 -0
  132. package/lib/types/desktop-screenshot.d.ts +22 -0
  133. package/lib/types/desktop-screenshot.d.ts.map +1 -0
  134. package/lib/types/host-api.d.ts.map +1 -1
  135. package/lib/types/markdown.d.ts +6 -1
  136. package/lib/types/markdown.d.ts.map +1 -1
  137. package/lib/types/recording-coverage.d.ts +12 -0
  138. package/lib/types/recording-coverage.d.ts.map +1 -0
  139. package/lib/types/sdk/index.d.ts +6 -0
  140. package/lib/types/sdk/index.d.ts.map +1 -1
  141. package/lib/types/search-record-links.d.ts +3 -0
  142. package/lib/types/search-record-links.d.ts.map +1 -0
  143. package/lib/types/services/background-sound-membership-service.d.ts +5 -0
  144. package/lib/types/services/background-sound-membership-service.d.ts.map +1 -1
  145. package/lib/types/services/call-history-service.d.ts +1 -1
  146. package/lib/types/services/call-history-service.d.ts.map +1 -1
  147. package/lib/types/services/chat-service.d.ts +8 -1
  148. package/lib/types/services/chat-service.d.ts.map +1 -1
  149. package/lib/types/services/membership-service.d.ts +13 -0
  150. package/lib/types/services/membership-service.d.ts.map +1 -0
  151. package/lib/types/services/record-service.d.ts +1 -1
  152. package/lib/types/services/record-service.d.ts.map +1 -1
  153. package/lib/types/services/recording-service.d.ts.map +1 -1
  154. package/lib/types/services/search-service.d.ts.map +1 -1
  155. package/lib/types/services/service.d.ts +1 -1
  156. package/lib/types/services/service.d.ts.map +1 -1
  157. package/lib/types/services/source-service.d.ts +7 -1
  158. package/lib/types/services/source-service.d.ts.map +1 -1
  159. package/lib/types/state-store.d.ts +1 -1
  160. package/lib/types/state-store.d.ts.map +1 -1
  161. package/lib/types/text-link-parser.d.ts +10 -0
  162. package/lib/types/text-link-parser.d.ts.map +1 -0
  163. package/lib/types/text-link-tlds.d.ts +2 -0
  164. package/lib/types/text-link-tlds.d.ts.map +1 -0
  165. package/lib/types/types.d.ts +53 -3
  166. package/lib/types/types.d.ts.map +1 -1
  167. package/package.json +5 -5
@@ -1303,6 +1303,14 @@ window.__ModuleLoader__.load({
1303
1303
  const { signal, ...params } = options;
1304
1304
  return await this.call("calendar.chat-statistics", params, signal);
1305
1305
  }
1306
+ /** Search one viewer-owned conversation directory page by remark or nickname. */
1307
+ async searchConversationNames(query, options = {}) {
1308
+ const { signal, ...params } = options;
1309
+ return await this.call("search.conversations", {
1310
+ query,
1311
+ ...params
1312
+ }, signal);
1313
+ }
1306
1314
  /** Search current-account server records, including retained DSH navigation identity. */
1307
1315
  async searchRemote(query, options = {}) {
1308
1316
  const { signal, ...params } = options;
@@ -100,6 +100,27 @@ window.__ModuleLoader__.load({
100
100
  };
101
101
  }
102
102
  //#endregion
103
+ //#region src/client/menu-hover-region.ts
104
+ /** The trigger, portaled menu and their narrow crossing gap are one hover target. */
105
+ function inMenuHoverRegion(x, y, anchor, menu) {
106
+ const contains = (rect) => x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
107
+ if (contains(anchor) || contains(menu)) return true;
108
+ const top = Math.max(anchor.top, menu.top), bottom = Math.min(anchor.bottom, menu.bottom);
109
+ if (menu.right <= anchor.left && anchor.left - menu.right <= 24) return contains({
110
+ left: menu.right,
111
+ right: anchor.left,
112
+ top,
113
+ bottom
114
+ });
115
+ if (anchor.right <= menu.left && menu.left - anchor.right <= 24) return contains({
116
+ left: anchor.right,
117
+ right: menu.left,
118
+ top,
119
+ bottom
120
+ });
121
+ return false;
122
+ }
123
+ //#endregion
103
124
  //#region src/client/ArkmeDshMenu.tsx
104
125
  const conversationMenuCss = `
105
126
  [role="menu"]:has(.arkme-conversation-actions-menu-label) {
@@ -213,6 +234,26 @@ window.__ModuleLoader__.load({
213
234
  const focused = (0, react.useRef)(false);
214
235
  const closeRef = (0, react.useRef)(props.onClose);
215
236
  closeRef.current = props.onClose;
237
+ const focusFirstItem = (0, react.useCallback)(() => {
238
+ if (!props.autoFocus || focused.current) return;
239
+ const button = menu.current?.querySelector("[role=\"menuitem\"]:not(:disabled)");
240
+ if (!button) return;
241
+ const previous = document.activeElement instanceof HTMLElement ? document.activeElement : null;
242
+ button.focus({ preventScroll: true });
243
+ if (document.activeElement === button) {
244
+ returnFocus.current = previous;
245
+ focused.current = true;
246
+ }
247
+ }, [props.autoFocus]);
248
+ (0, react.useEffect)(() => {
249
+ if (!open || !props.autoFocus || focused.current) return;
250
+ const frame = requestAnimationFrame(focusFirstItem);
251
+ return () => cancelAnimationFrame(frame);
252
+ }, [
253
+ open,
254
+ props.autoFocus,
255
+ focusFirstItem
256
+ ]);
216
257
  const getAnchorRect = (0, react.useCallback)(() => {
217
258
  if (!props.point) return props.getAnchorRect?.() ?? root.current?.querySelector("button")?.getBoundingClientRect() ?? root.current?.getBoundingClientRect() ?? null;
218
259
  let { x, y } = props.point;
@@ -283,6 +324,36 @@ window.__ModuleLoader__.load({
283
324
  props.point !== void 0,
284
325
  props.pointDocument
285
326
  ]);
327
+ (0, react.useEffect)(() => {
328
+ const anchor = props.hoverAnchor;
329
+ if (!open || !anchor || typeof document === "undefined") return;
330
+ const doc = anchor.ownerDocument;
331
+ const close = () => closeRef.current();
332
+ const move = (event) => {
333
+ if (event.pointerType === "touch") return;
334
+ const list = menu.current;
335
+ if (!anchor.isConnected || list && !inMenuHoverRegion(event.clientX, event.clientY, anchor.getBoundingClientRect(), list.getBoundingClientRect())) close();
336
+ };
337
+ const leave = (event) => {
338
+ if (event.relatedTarget === null) close();
339
+ };
340
+ const observer = new MutationObserver(() => {
341
+ if (!anchor.isConnected) close();
342
+ });
343
+ observer.observe(doc.body, {
344
+ childList: true,
345
+ subtree: true
346
+ });
347
+ doc.addEventListener("pointermove", move, true);
348
+ doc.addEventListener("pointerout", leave, true);
349
+ doc.defaultView?.addEventListener("blur", close);
350
+ return () => {
351
+ observer.disconnect();
352
+ doc.removeEventListener("pointermove", move, true);
353
+ doc.removeEventListener("pointerout", leave, true);
354
+ doc.defaultView?.removeEventListener("blur", close);
355
+ };
356
+ }, [open, props.hoverAnchor]);
286
357
  const actions = props.actions.filter((action) => !!action);
287
358
  const items = actions.map((action) => "type" in action ? action : {
288
359
  id: action.id,
@@ -295,11 +366,7 @@ window.__ModuleLoader__.load({
295
366
  if (typeof action.label === "string") node.closest("button")?.setAttribute("aria-label", action.label);
296
367
  list.setAttribute("aria-label", props.label);
297
368
  list.setAttribute("data-arkme-action-menu", "true");
298
- if (props.autoFocus && !focused.current) {
299
- returnFocus.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
300
- focused.current = true;
301
- list.querySelector("[role=\"menuitem\"]:not(:disabled)")?.focus();
302
- }
369
+ focusFirstItem();
303
370
  },
304
371
  children: action.label
305
372
  }),
@@ -71,6 +71,50 @@ 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/arkme-theme.ts
75
+ /**
76
+ * Arkme semantic colors. DSH owns the active light/dark/system preference and
77
+ * swaps every referenced token when `data-ds-dark-theme` changes on `<body>`.
78
+ * Arkme deliberately has no second theme store or independent toggle.
79
+ */
80
+ const arkmeTheme = {
81
+ base: "var(--dsw-alias-bg-base, #ffffff)",
82
+ layer1: "var(--dsw-alias-bg-layer-1, #f8f9fa)",
83
+ layer2: "var(--dsw-alias-bg-layer-2, #f3f4f6)",
84
+ layer3: "var(--dsw-alias-bg-layer-3, #ffffff)",
85
+ sidebar: "var(--dsw-specific-sidebar-fill, var(--dsw-alias-bg-layer-1, #f8f9fa))",
86
+ input: "var(--dsw-specific-input-major, var(--dsw-alias-bg-layer-2, #ffffff))",
87
+ menu: "var(--dsw-specific-menu, var(--dsw-alias-bg-layer-3, #ffffff))",
88
+ messageOwn: "var(--arkme-chat-self-bubble, var(--dsw-alias-state-business-tertiary, #eef1f8))",
89
+ messageOther: "var(--arkme-chat-other-bubble, var(--dsw-specific-bubble, var(--dsw-alias-bg-layer-2, #f3f4f6)))",
90
+ memberRecordOther: "var(--arkme-member-record-other-bubble, var(--dsw-specific-bubble-highlight, var(--dsw-alias-bg-layer-3, #e1e5ee)))",
91
+ subtle: "var(--dsw-alias-bg-module-platform, var(--dsw-alias-bg-layer-1, #f5f6f8))",
92
+ extensionSource: "var(--dsw-alias-fill-secondary, var(--dsw-alias-bg-module-platform, #f2f2f2))",
93
+ elevated: "var(--dsw-alias-button-elevated-fill, var(--dsw-alias-bg-layer-2, #ffffff))",
94
+ primaryAction: "var(--dsw-alias-button-primary-fill, #17191c)",
95
+ onPrimaryAction: "var(--dsw-alias-label-primary-inverted, #ffffff)",
96
+ hover: "var(--dsw-alias-interactive-bg-hover, rgba(38, 49, 72, 0.06))",
97
+ active: "var(--dsw-alias-interactive-bg-active, rgba(38, 49, 72, 0.10))",
98
+ text: "var(--dsw-alias-label-primary, #17191c)",
99
+ secondary: "var(--dsw-alias-label-secondary, #68707c)",
100
+ tertiary: "var(--dsw-alias-label-tertiary, #9097a1)",
101
+ caption: "var(--dsw-alias-label-caption, #a3a8ae)",
102
+ foreground: "var(--dsw-static-neutral-bluish-00, #ffffff)",
103
+ border: "var(--dsw-alias-border-l2, rgba(0, 0, 0, 0.10))",
104
+ borderSoft: "var(--dsw-alias-border-l1, rgba(0, 0, 0, 0.04))",
105
+ accent: "var(--dsw-alias-state-business-primary, #8295e8)",
106
+ accentSoft: "var(--dsw-alias-state-business-tertiary, #f1f2f6)",
107
+ info: "var(--dsw-alias-state-business-primary, #3964fe)",
108
+ infoSoft: "var(--dsw-alias-state-business-tertiary, #e9f0ff)",
109
+ success: "var(--dsw-alias-state-success-primary, #52c41a)",
110
+ danger: "var(--dsw-alias-state-error-primary, #c2413b)",
111
+ dangerSoft: "var(--dsw-alias-interactive-bg-hover-danger, rgba(194, 65, 59, 0.10))",
112
+ warning: "var(--dsw-alias-state-warn-label, #a16207)",
113
+ recordHistoryLatest: "#edbe09",
114
+ warningSoft: "var(--dsw-alias-state-warn-tertiary, #fff8e6)",
115
+ shadow: "var(--dsw-shadow-lv2, 0 4px 16px rgba(0, 0, 0, 0.12))"
116
+ };
117
+ //#endregion
74
118
  //#region src/client/conversation-selector-style.ts
75
119
  /** Native DSH menu metrics, shared by both topic-menu entry points and the session adapter. */
76
120
  const CONVERSATION_MENU_LAYOUT = {
@@ -94,8 +138,8 @@ window.__ModuleLoader__.load({
94
138
  };
95
139
  /** Keep the current selection distinct from a transient hover in both menus. */
96
140
  const CONVERSATION_MENU_COLORS = {
97
- selected: "#eef1f8",
98
- hover: "var(--dsw-alias-interactive-bg-hover, #f3f4f7)"
141
+ selected: arkmeTheme.accentSoft,
142
+ hover: arkmeTheme.hover
99
143
  };
100
144
  const CONVERSATION_MENU_SURFACE = {
101
145
  background: "var(--dsw-specific-sidebar-fill, #f9fafb)",
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as inspectNativeBundleArtifactV3, At as parseArkmeRecordReeditMentions, Ct as isRecentEmojiId, D as bundleSha256, Dt as recordOwnerId, E as arkmeSandboxEntryId, Et as retryAfterMillis, F as assertExtensionArtifactSize, Ft as __exportAll, G as validateVoiceprintPcm16Wav, I as canonicalExtensionJson, It as __require, J as arkmeRequiredLinkMetadataFallback, K as arkmeExtensionShareRefFromLink, L as sha256Hex, Lt as __toCommonJS, M as packLocalNativeBundleDirectoryV3, Mt as createDesktopLifecycleReader, N as readNativeBundleTarballV3, Nt as __commonJSMin, O as canonicalBundleJson, Ot as ArkmeRecordReeditDraftConflict, P as renderArkmeSandboxHostEntry, Pt as __esmMin, Q as ARKME_PROVIDER_CONTRACT_VERSION, R as unpackArkmeExtension, S as ARKME_BUNDLE_ARTIFACT_KIND, St as recordingImportFileNameKey, T as ArkmeBundleArtifactError, Tt as ArkmePluginError, U as ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE, W as ArkmeService, X as arkmeRichBackgroundSound, Y as arkmeFileBackgroundSound, Z as ARKME_DEFAULT_SHARE_WEBSITE, _ as arkmeClientContentDigest, _t as isRecordingInstantOnOrAfterUnixEpoch, at as cachedMemberItem, b as verifyExtensionResolutionSignature, bt as sameRecordingImportIdentity, c as persistentExtensionBundleDirectory, ct as ARKME_RUNTIME_INSTANCE_ID, d as readPersistentExtensionActivation, dt as arkmeNormalizedFileMimeType, f as refreshPersistentClientWrapper, ft as arkmePickedFileKind, g as activeProfileExtensionOwnerConflicts, gt as ArkmeDirectMessageAdmissionError, h as renderArkmeBundleClientBundle, ht as SecretValue, i as invokePersistentArkmeExtension, it as applyMemberUpdate, j as packBundleFiles, jt as registerDSHAgentInputRecordSync, k as inspectBundleArtifact, kt as parseArkmeRecordReeditAttachments, l as persistentExtensionPackageIdentity, lt as ARKME_TOOL_FILE_MAX_BYTES, m as writePersistentExtensionActivation, mt as ArkmeOutgoingCallError, nt as ARKME_WORLD_PUBLISH_MAX_IMAGES, o as persistentArkmeExtensionRuntimeState, ot as mergeMemberJoinEvents, p as repairPersistentExtensionInstallation, pt as isArkmeBotAvatarRef, q as arkmeIsGenericLinkMetadataTitle, r as deactivatePersistentArkmeExtension, rt as ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES, s as materializePersistentExtensionBundle, st as validateMemberUpdate, t as activatePersistentArkmeExtension, u as quarantinePersistentExtension, ut as arkmeCanInlineLocalFile, v as arkmeClientContentDigestFromSource, vt as isUnresolvedRecordingImportJob, w as ARKME_NATIVE_BUNDLE_ARTIFACT_KIND, wt as normalizeRecentEmojiIds, x as verifyNativeBundleResolutionSignature, y as verifyBundleResolutionSignature, yt as recordingImportFileKind, z as ARKME_EXTENSION_FORMAT } from "./persistent-runtime-C_Geaa4B.js";
1
+ import { A as inspectNativeBundleArtifactV3, At as parseArkmeRecordReeditMentions, Ct as isRecentEmojiId, D as bundleSha256, Dt as recordOwnerId, E as arkmeSandboxEntryId, Et as retryAfterMillis, F as assertExtensionArtifactSize, Ft as __exportAll, G as validateVoiceprintPcm16Wav, I as canonicalExtensionJson, It as __require, J as arkmeRequiredLinkMetadataFallback, K as arkmeExtensionShareRefFromLink, L as sha256Hex, Lt as __toCommonJS, M as packLocalNativeBundleDirectoryV3, Mt as createDesktopLifecycleReader, N as readNativeBundleTarballV3, Nt as __commonJSMin, O as canonicalBundleJson, Ot as ArkmeRecordReeditDraftConflict, P as renderArkmeSandboxHostEntry, Pt as __esmMin, Q as ARKME_PROVIDER_CONTRACT_VERSION, R as unpackArkmeExtension, S as ARKME_BUNDLE_ARTIFACT_KIND, St as recordingImportFileNameKey, T as ArkmeBundleArtifactError, Tt as ArkmePluginError, U as ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE, W as ArkmeService, X as arkmeRichBackgroundSound, Y as arkmeFileBackgroundSound, Z as ARKME_DEFAULT_SHARE_WEBSITE, _ as arkmeClientContentDigest, _t as isRecordingInstantOnOrAfterUnixEpoch, at as cachedMemberItem, b as verifyExtensionResolutionSignature, bt as sameRecordingImportIdentity, c as persistentExtensionBundleDirectory, ct as ARKME_RUNTIME_INSTANCE_ID, d as readPersistentExtensionActivation, dt as arkmeNormalizedFileMimeType, f as refreshPersistentClientWrapper, ft as arkmePickedFileKind, g as activeProfileExtensionOwnerConflicts, gt as ArkmeDirectMessageAdmissionError, h as renderArkmeBundleClientBundle, ht as SecretValue, i as invokePersistentArkmeExtension, it as applyMemberUpdate, j as packBundleFiles, jt as registerDSHAgentInputRecordSync, k as inspectBundleArtifact, kt as parseArkmeRecordReeditAttachments, l as persistentExtensionPackageIdentity, lt as ARKME_TOOL_FILE_MAX_BYTES, m as writePersistentExtensionActivation, mt as ArkmeOutgoingCallError, nt as ARKME_WORLD_PUBLISH_MAX_IMAGES, o as persistentArkmeExtensionRuntimeState, ot as mergeMemberJoinEvents, p as repairPersistentExtensionInstallation, pt as isArkmeBotAvatarRef, q as arkmeIsGenericLinkMetadataTitle, r as deactivatePersistentArkmeExtension, rt as ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES, s as materializePersistentExtensionBundle, st as validateMemberUpdate, t as activatePersistentArkmeExtension, u as quarantinePersistentExtension, ut as arkmeCanInlineLocalFile, v as arkmeClientContentDigestFromSource, vt as isUnresolvedRecordingImportJob, w as ARKME_NATIVE_BUNDLE_ARTIFACT_KIND, wt as normalizeRecentEmojiIds, x as verifyNativeBundleResolutionSignature, y as verifyBundleResolutionSignature, yt as recordingImportFileKind, z as ARKME_EXTENSION_FORMAT } from "./persistent-runtime-DlJzDZlE.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-Ny1szQA0.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";
@@ -11232,6 +11232,12 @@ function createArkmeHostApi(service, options) {
11232
11232
  }
11233
11233
  const request = await readRequest(req);
11234
11234
  const params = request.params ?? {};
11235
+ if (request.operation === "desktop.screenshot.capture" || request.operation === "desktop.screenshot.capability") {
11236
+ if (!isLoopback$6(req.socket.remoteAddress)) throw new ArkmePluginError("loopback-required", "截屏仅允许本机访问", false, 403);
11237
+ if (origin === void 0) throw new ArkmePluginError("origin-required", "截屏必须从当前 DSH 页面发起", false, 403);
11238
+ const url = new URL(origin);
11239
+ if (!["http:", "https:"].includes(url.protocol) || url.host !== req.headers.host) throw new ArkmePluginError("origin-rejected", "截屏必须从当前 DSH 页面发起", false, 403);
11240
+ }
11235
11241
  if (request.operation === "link.metadata" && origin === void 0) throw new ArkmePluginError("origin-required", "网址名称解析必须从当前 DSH 页面发起", false, 403);
11236
11242
  if (["user-ban.ban", "user-ban.unban"].includes(request.operation) && origin === void 0) throw new ArkmePluginError("origin-required", "封禁操作必须从当前 DSH 页面发起", false, 403);
11237
11243
  if ([
@@ -11404,6 +11410,8 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
11404
11410
  case "remote.renameDesktop": return await requireRemoteHost(remoteHost, remoteUnavailableReason).renameDesktop(stringParam(params, "displayName"));
11405
11411
  case "billing.quota": return await service.billingQuota();
11406
11412
  case "billing.products": return await service.billingProducts();
11413
+ case "membership.current": return await service.membershipCurrent(numberParam(params, "expectedUserId", NaN));
11414
+ case "membership.catalog": return await service.membershipCatalog(numberParam(params, "expectedUserId", NaN));
11407
11415
  case "billing.order.create": return await service.createBillingOrder({
11408
11416
  productId: billingIdentifierParam(params, "productId", "billing-product-id-invalid", "购买套餐无效"),
11409
11417
  paymentMethod: billingPaymentMethodParam(params),
@@ -11558,6 +11566,11 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
11558
11566
  ...cursor === void 0 ? {} : { cursor }
11559
11567
  });
11560
11568
  }
11569
+ case "search.conversations": return await service.searchConversationNames({
11570
+ query: stringParam(params, "query"),
11571
+ ...stringParam(params, "cursor") === "" ? {} : { cursor: stringParam(params, "cursor") },
11572
+ ...requestSignal === void 0 ? {} : { signal: requestSignal }
11573
+ });
11561
11574
  case "search.records": return await service.searchRemote({
11562
11575
  query: stringParam(params, "query"),
11563
11576
  limit: numberParam(params, "limit", 20),
@@ -11877,6 +11890,8 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
11877
11890
  ...stringParam(params, "recordUid") === "" ? {} : { recordUid: stringParam(params, "recordUid") },
11878
11891
  ...stringParam(params, "relationUid") === "" ? {} : { relationUid: stringParam(params, "relationUid") },
11879
11892
  ...stringParam(params, "commentText") === "" ? {} : { commentText: stringParam(params, "commentText") },
11893
+ ...params.expectedUserId === void 0 ? {} : { expectedUserId: numberParam(params, "expectedUserId", 0) },
11894
+ ...params.sendAtMillis === void 0 ? {} : { sendAtMillis: numberParam(params, "sendAtMillis", 0) },
11880
11895
  ...requestSignal === void 0 ? {} : { signal: requestSignal }
11881
11896
  });
11882
11897
  case "message-actions.forward": return await service.forwardMessageActions(stringParam(params, "conversationRef").trim(), messageActionRefsParam(params), {
@@ -11972,6 +11987,12 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
11972
11987
  case "chat.official-author.private.open": return await service.openOfficialAuthorPrivateChat();
11973
11988
  case "chat.member.private.open": return await service.openPrivateChatFromMember(stringParam(params, "sourceRef"), stringParam(params, "memberRef"), requestSignal === void 0 ? {} : { signal: requestSignal });
11974
11989
  case "files.capabilities": return service.fileCapabilities();
11990
+ case "desktop.screenshot.capability": return await service.screenshotCapability();
11991
+ case "desktop.screenshot.capture": {
11992
+ const expectedUserId = fileExpectedUserIdParam(params);
11993
+ if (expectedUserId === void 0) throw new ArkmePluginError("screenshot-account-required", "请先登录后再截屏", false, 400);
11994
+ return await service.captureScreenshot(expectedUserId, requestSignal);
11995
+ }
11975
11996
  case "files.local.list": return await service.fileList();
11976
11997
  case "files.local.open-folder": return await service.fileOpenLocalFolder(stringParam(params, "fileRef"), requestSignal);
11977
11998
  case "files.local.open": return await service.fileOpenLocal(stringParam(params, "fileRef"), requestSignal);
@@ -12028,7 +12049,9 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
12028
12049
  ...stringParam(params, "relationUid") === "" ? {} : { relationUid: stringParam(params, "relationUid") }
12029
12050
  });
12030
12051
  case "favorite-stickers.manage": return await service.manageFavoriteSticker(stringParam(params, "fileAssetUid"), favoriteStickerManageActionParam(params));
12052
+ case "source.long-article.own": return await service.ownLongArticle(stringParam(params, "itemUid"), numberParam(params, "expectedUserId", 0), requestSignal);
12031
12053
  case "source.long-article.publish": return await service.publishLongArticle(stringParam(params, "sourceRef"), {
12054
+ ...params.expectedUserId === void 0 ? {} : { expectedUserId: numberParam(params, "expectedUserId", 0) },
12032
12055
  title: stringParam(params, "title"),
12033
12056
  textContent: stringParam(params, "textContent"),
12034
12057
  textFormat: params.textFormat === "markdown" ? "markdown" : "plain",
@@ -12062,7 +12085,7 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
12062
12085
  durationMillis: Math.max(0, Math.trunc(numberParam(params, "durationMillis", 0))),
12063
12086
  updatedAtMillis: Date.now()
12064
12087
  });
12065
- case "source.long-article.draft.delete": return await service.removeLongArticleDraft(stringParam(params, "sourceRef"), stringParam(params, "itemUid") || void 0);
12088
+ case "source.long-article.draft.delete": return await service.removeLongArticleDraft(stringParam(params, "sourceRef"), stringParam(params, "itemUid") || void 0, ...params.expectedRecordUid === void 0 ? [] : [stringParam(params, "expectedRecordUid")]);
12066
12089
  case "source.record-reedit.detail": return await service.recordReeditEditor(stringParam(params, "sourceRef"), stringParam(params, "itemUid"));
12067
12090
  case "source.record-reedit.draft.put": return {
12068
12091
  saved: true,
@@ -22951,11 +22974,12 @@ var ArkmeStateStore = class {
22951
22974
  if (Object.keys(jobs).length === 0) delete state.recordingImportJobsByUser[userKey];
22952
22975
  });
22953
22976
  }
22954
- async removeLongArticleDraft(userId, sourceRef, itemUid) {
22977
+ async removeLongArticleDraft(userId, sourceRef, itemUid, expectedRecordUid) {
22955
22978
  await this.update((state) => {
22956
22979
  const userKey = String(userId);
22957
22980
  const drafts = state.longArticleDraftsByUser[userKey];
22958
22981
  if (drafts === void 0) return;
22982
+ if (expectedRecordUid !== void 0 && drafts[longArticleDraftKey(sourceRef, itemUid)]?.recordUid !== expectedRecordUid) return;
22959
22983
  delete drafts[longArticleDraftKey(sourceRef, itemUid)];
22960
22984
  if (Object.keys(drafts).length === 0) delete state.longArticleDraftsByUser[userKey];
22961
22985
  });
@@ -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-C_Geaa4B.js";
1
+ import { a as persistentArkmeExtensionActive, i as invokePersistentArkmeExtension, n as applyPersistentArkmeHostExtension, o as persistentArkmeExtensionRuntimeState, r as deactivatePersistentArkmeExtension, t as activatePersistentArkmeExtension } from "./persistent-runtime-DlJzDZlE.js";
2
2
  export { activatePersistentArkmeExtension, applyPersistentArkmeHostExtension, deactivatePersistentArkmeExtension, invokePersistentArkmeExtension, persistentArkmeExtensionActive, persistentArkmeExtensionRuntimeState };