@senguoyun/dsh-arkme 0.1.47 → 0.1.49

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 (160) hide show
  1. package/docs/dsh-remote-liveness.md +46 -0
  2. package/docs/member-directory-premerge-review.md +99 -0
  3. package/docs/member-directory-review.md +53 -0
  4. package/docs/shared-conversation-members.md +61 -0
  5. package/docs/sidebar-local-first-review.md +104 -0
  6. package/docs/sidebar-local-first.md +61 -0
  7. package/lib/bundle-runtime.js +1 -1
  8. package/lib/client.js +68338 -66607
  9. package/lib/client.js.map +1 -1
  10. package/lib/extension-profile-restart-helper.js +5 -5
  11. package/lib/harness-model-client.js +36 -2
  12. package/lib/harness-session-client.js +124 -0
  13. package/lib/index.js +10940 -822
  14. package/lib/{install-store-C1tAM346.js → install-store-bnyQDtYt.js} +1 -1
  15. package/lib/persistent-extension.js +1 -1
  16. package/lib/{persistent-runtime-DpNP9UKr.js → persistent-runtime-D2pt8S-e.js} +1587 -280
  17. package/lib/{plugin-updater-helper-BByro9U_.js → plugin-updater-helper-B0yVav4f.js} +1 -1
  18. package/lib/{plugin-updater-helper-BByw0ZyG.js → plugin-updater-helper-BbjKUV9T.js} +3 -3
  19. package/lib/plugin-updater-helper.js +1 -1
  20. package/lib/sdk.js +36 -2
  21. package/lib/types/arkme-service.d.ts +14 -0
  22. package/lib/types/arkme-service.d.ts.map +1 -1
  23. package/lib/types/chat-realtime.d.ts +6 -3
  24. package/lib/types/chat-realtime.d.ts.map +1 -1
  25. package/lib/types/client/ArkmeAvatar.d.ts +2 -1
  26. package/lib/types/client/ArkmeAvatar.d.ts.map +1 -1
  27. package/lib/types/client/ArkmeContactAddSurface.d.ts +2 -1
  28. package/lib/types/client/ArkmeContactAddSurface.d.ts.map +1 -1
  29. package/lib/types/client/ArkmeDSHBetaCommunityEntry.d.ts.map +1 -1
  30. package/lib/types/client/ArkmeDirectoryWindow.d.ts +6 -0
  31. package/lib/types/client/ArkmeDirectoryWindow.d.ts.map +1 -0
  32. package/lib/types/client/ArkmeGroupChatControls.d.ts +1 -1
  33. package/lib/types/client/ArkmeGroupChatControls.d.ts.map +1 -1
  34. package/lib/types/client/ArkmeMessageReadReceipt.d.ts.map +1 -1
  35. package/lib/types/client/ArkmePersistentShell.d.ts +1 -1
  36. package/lib/types/client/ArkmePersistentShell.d.ts.map +1 -1
  37. package/lib/types/client/ArkmeRecordingSurface.d.ts +3 -1
  38. package/lib/types/client/ArkmeRecordingSurface.d.ts.map +1 -1
  39. package/lib/types/client/ArkmeSidebar.d.ts.map +1 -1
  40. package/lib/types/client/ArkmeVirtualWorkspace.d.ts +2 -1
  41. package/lib/types/client/ArkmeVirtualWorkspace.d.ts.map +1 -1
  42. package/lib/types/client/DeepSeekHarnessSurface.d.ts +3 -1
  43. package/lib/types/client/DeepSeekHarnessSurface.d.ts.map +1 -1
  44. package/lib/types/client/api.d.ts +1 -1
  45. package/lib/types/client/api.d.ts.map +1 -1
  46. package/lib/types/client/avatar-image-store.d.ts +3 -2
  47. package/lib/types/client/avatar-image-store.d.ts.map +1 -1
  48. package/lib/types/client/bot-chat-directory-projection.d.ts +2 -0
  49. package/lib/types/client/bot-chat-directory-projection.d.ts.map +1 -1
  50. package/lib/types/client/bot-directory-preferences.d.ts +2 -0
  51. package/lib/types/client/bot-directory-preferences.d.ts.map +1 -1
  52. package/lib/types/client/chat-directory-store.d.ts +4 -0
  53. package/lib/types/client/chat-directory-store.d.ts.map +1 -1
  54. package/lib/types/client/conversation-members-store.d.ts +46 -0
  55. package/lib/types/client/conversation-members-store.d.ts.map +1 -0
  56. package/lib/types/client/harness-session-client.d.ts +5 -0
  57. package/lib/types/client/harness-session-client.d.ts.map +1 -0
  58. package/lib/types/client/message-read-receipt-store.d.ts +7 -1
  59. package/lib/types/client/message-read-receipt-store.d.ts.map +1 -1
  60. package/lib/types/client/realtime-client-events.d.ts.map +1 -1
  61. package/lib/types/client/recordings/ArkmeRecordingImportDialog.d.ts +4 -1
  62. package/lib/types/client/recordings/ArkmeRecordingImportDialog.d.ts.map +1 -1
  63. package/lib/types/client/redesign/contacts/CollapsibleDirectorySection.d.ts +3 -2
  64. package/lib/types/client/redesign/contacts/CollapsibleDirectorySection.d.ts.map +1 -1
  65. package/lib/types/client/redesign/contacts/ContactDirectoryAddDialog.d.ts +8 -0
  66. package/lib/types/client/redesign/contacts/ContactDirectoryAddDialog.d.ts.map +1 -0
  67. package/lib/types/client/redesign/contacts/ContactDirectorySurface.d.ts +13 -4
  68. package/lib/types/client/redesign/contacts/ContactDirectorySurface.d.ts.map +1 -1
  69. package/lib/types/client/redesign/contacts/ContactDirectoryToolbar.d.ts +7 -0
  70. package/lib/types/client/redesign/contacts/ContactDirectoryToolbar.d.ts.map +1 -0
  71. package/lib/types/client/redesign/contacts/ContactProfileDetail.d.ts +12 -2
  72. package/lib/types/client/redesign/contacts/ContactProfileDetail.d.ts.map +1 -1
  73. package/lib/types/client/redesign/contacts/ContactRemarkDialog.d.ts +9 -0
  74. package/lib/types/client/redesign/contacts/ContactRemarkDialog.d.ts.map +1 -0
  75. package/lib/types/client/redesign/contacts/ContactWorldList.d.ts +2 -0
  76. package/lib/types/client/redesign/contacts/ContactWorldList.d.ts.map +1 -1
  77. package/lib/types/client/redesign/contacts/DirectoryDetailPane.d.ts +3 -2
  78. package/lib/types/client/redesign/contacts/DirectoryDetailPane.d.ts.map +1 -1
  79. package/lib/types/client/redesign/contacts/contact-date.d.ts +3 -0
  80. package/lib/types/client/redesign/contacts/contact-date.d.ts.map +1 -0
  81. package/lib/types/client/redesign/contacts/contact-directory-search.d.ts +10 -0
  82. package/lib/types/client/redesign/contacts/contact-directory-search.d.ts.map +1 -0
  83. package/lib/types/client/redesign/contacts/contact-directory-state.d.ts +4 -1
  84. package/lib/types/client/redesign/contacts/contact-directory-state.d.ts.map +1 -1
  85. package/lib/types/client/redesign/contacts/contacts-tab-store.d.ts +6 -2
  86. package/lib/types/client/redesign/contacts/contacts-tab-store.d.ts.map +1 -1
  87. package/lib/types/client/use-arkme-avatar-image.d.ts +2 -1
  88. package/lib/types/client/use-arkme-avatar-image.d.ts.map +1 -1
  89. package/lib/types/client/use-conversation-members.d.ts +3 -0
  90. package/lib/types/client/use-conversation-members.d.ts.map +1 -0
  91. package/lib/types/dsh-remote/api-proxy-adapter.d.ts +1 -0
  92. package/lib/types/dsh-remote/api-proxy-adapter.d.ts.map +1 -1
  93. package/lib/types/dsh-remote/channel-manager.d.ts +9 -2
  94. package/lib/types/dsh-remote/channel-manager.d.ts.map +1 -1
  95. package/lib/types/dsh-remote/connection-diagnostics.d.ts +35 -0
  96. package/lib/types/dsh-remote/connection-diagnostics.d.ts.map +1 -0
  97. package/lib/types/dsh-remote/current-session-tool.d.ts +3 -0
  98. package/lib/types/dsh-remote/current-session-tool.d.ts.map +1 -0
  99. package/lib/types/dsh-remote/default-socket-factory.d.ts.map +1 -1
  100. package/lib/types/dsh-remote/desktop-session-presence.d.ts +21 -0
  101. package/lib/types/dsh-remote/desktop-session-presence.d.ts.map +1 -0
  102. package/lib/types/dsh-remote/dsh-event-contract.d.ts +2 -0
  103. package/lib/types/dsh-remote/dsh-event-contract.d.ts.map +1 -1
  104. package/lib/types/dsh-remote/host.d.ts +40 -6
  105. package/lib/types/dsh-remote/host.d.ts.map +1 -1
  106. package/lib/types/dsh-remote/live-event-batcher.d.ts +46 -0
  107. package/lib/types/dsh-remote/live-event-batcher.d.ts.map +1 -0
  108. package/lib/types/dsh-remote/protocol-v1.d.ts.map +1 -1
  109. package/lib/types/dsh-remote/realtime-transport.d.ts +19 -1
  110. package/lib/types/dsh-remote/realtime-transport.d.ts.map +1 -1
  111. package/lib/types/dsh-remote/types.d.ts +18 -2
  112. package/lib/types/dsh-remote/types.d.ts.map +1 -1
  113. package/lib/types/harness-embed-contract.d.ts +2 -0
  114. package/lib/types/harness-embed-contract.d.ts.map +1 -1
  115. package/lib/types/harness-embed-route.d.ts +4 -0
  116. package/lib/types/harness-embed-route.d.ts.map +1 -1
  117. package/lib/types/host-api.d.ts.map +1 -1
  118. package/lib/types/index.d.ts +1 -0
  119. package/lib/types/index.d.ts.map +1 -1
  120. package/lib/types/local-database.d.ts +11 -1
  121. package/lib/types/local-database.d.ts.map +1 -1
  122. package/lib/types/member-directory.d.ts +11 -0
  123. package/lib/types/member-directory.d.ts.map +1 -0
  124. package/lib/types/sdk/index.d.ts +24 -3
  125. package/lib/types/sdk/index.d.ts.map +1 -1
  126. package/lib/types/services/bot-service.d.ts +3 -0
  127. package/lib/types/services/bot-service.d.ts.map +1 -1
  128. package/lib/types/services/chat-realtime-service.d.ts +1 -0
  129. package/lib/types/services/chat-realtime-service.d.ts.map +1 -1
  130. package/lib/types/services/chat-service.d.ts +14 -1
  131. package/lib/types/services/chat-service.d.ts.map +1 -1
  132. package/lib/types/services/contact-directory-service.d.ts +3 -0
  133. package/lib/types/services/contact-directory-service.d.ts.map +1 -1
  134. package/lib/types/services/conversation-directory-service.d.ts +72 -0
  135. package/lib/types/services/conversation-directory-service.d.ts.map +1 -0
  136. package/lib/types/services/desktop-attention-bridge.d.ts +6 -1
  137. package/lib/types/services/desktop-attention-bridge.d.ts.map +1 -1
  138. package/lib/types/services/group-service.d.ts.map +1 -1
  139. package/lib/types/services/media-service.d.ts +1 -0
  140. package/lib/types/services/media-service.d.ts.map +1 -1
  141. package/lib/types/services/service.d.ts +11 -0
  142. package/lib/types/services/service.d.ts.map +1 -1
  143. package/lib/types/services/source-service.d.ts +3 -0
  144. package/lib/types/services/source-service.d.ts.map +1 -1
  145. package/lib/types/services/unmarked-speaker-service.d.ts.map +1 -1
  146. package/lib/types/tools/business/conversation/index.d.ts.map +1 -1
  147. package/lib/types/tools/business/conversation/list-sources.d.ts +1 -0
  148. package/lib/types/tools/business/conversation/list-sources.d.ts.map +1 -1
  149. package/lib/types/tools/business/conversation/member-pages.d.ts +2 -0
  150. package/lib/types/tools/business/conversation/member-pages.d.ts.map +1 -0
  151. package/lib/types/tools/business/conversation/read-receipts.d.ts.map +1 -1
  152. package/lib/types/tools/business/index.d.ts.map +1 -1
  153. package/lib/types/tools/ports/conversations.d.ts +13 -1
  154. package/lib/types/tools/ports/conversations.d.ts.map +1 -1
  155. package/lib/types/tools/registry/registrar.d.ts.map +1 -1
  156. package/lib/types/types.d.ts +66 -2
  157. package/lib/types/types.d.ts.map +1 -1
  158. package/package.json +7 -6
  159. package/lib/{bundle-runtime-BTzRlc6V.js → bundle-runtime-CE73h3vS.js} +1 -1
  160. package/lib/{profile-bundle-policy-CvojZuTD.js → profile-bundle-policy-DLXDyohJ.js} +1 -1
@@ -1,10 +1,10 @@
1
- import { i as prepareProfilePackageManager, r as localExtensionPnpmArgs, t as applyArkmeProfileBundlePolicy } from "./profile-bundle-policy-CvojZuTD.js";
2
- import { t as ArkmeExtensionInstallStore } from "./install-store-C1tAM346.js";
1
+ import { i as prepareProfilePackageManager, r as localExtensionPnpmArgs, t as applyArkmeProfileBundlePolicy } from "./profile-bundle-policy-DLXDyohJ.js";
2
+ import { t as ArkmeExtensionInstallStore } from "./install-store-bnyQDtYt.js";
3
3
  import { closeSync, openSync } from "node:fs";
4
+ import { readFile, rm, unlink } from "node:fs/promises";
5
+ import { spawn, spawnSync } from "node:child_process";
4
6
  import { join, relative, resolve } from "node:path";
5
7
  import { fileURLToPath } from "node:url";
6
- import { spawn, spawnSync } from "node:child_process";
7
- import { readFile, rm, unlink } from "node:fs/promises";
8
8
  //#region src/extensions/profile-restart-helper.ts
9
9
  const PARENT_EXIT_TIMEOUT_MS = 2e4;
10
10
  const HEALTH_TIMEOUT_MS = 45e3;
@@ -220,7 +220,7 @@ async function main() {
220
220
  if (planPath === void 0) throw new Error("extension restart plan path is required");
221
221
  const rawPlan = JSON.parse(await readFile(planPath, "utf8"));
222
222
  if (managed && isPluginUpdateRestartPlan(rawPlan)) {
223
- const pluginUpdate = await import("./plugin-updater-helper-BByro9U_.js");
223
+ const pluginUpdate = await import("./plugin-updater-helper-B0yVav4f.js");
224
224
  if (mode === "--managed-finalize") {
225
225
  const healthUrl = process.argv[4];
226
226
  if (healthUrl === void 0) throw new Error("managed plugin update health URL is required");
@@ -717,12 +717,22 @@ window.__ModuleLoader__.load({
717
717
  }, signal);
718
718
  }
719
719
  async listSources(directory, options = {}) {
720
+ if (options.localFirst === true && (await this.capabilities(options.signal)).features.localFirstDirectory !== true) throw new Error("当前 Provider 不支持本地会话目录");
720
721
  return await this.call("sources.list", {
721
722
  directory,
723
+ ...options.localFirst === void 0 ? {} : { localFirst: options.localFirst },
724
+ ...options.refresh === void 0 ? {} : { refresh: options.refresh },
722
725
  ...options.limit === void 0 ? {} : { limit: options.limit },
723
726
  ...options.cursor === void 0 ? {} : { cursor: options.cursor }
724
727
  }, options.signal);
725
728
  }
729
+ async setBotDirectoryPin(botRef, pinned, signal) {
730
+ if ((await this.capabilities(signal)).features.localFirstDirectory !== true) throw new Error("当前 Provider 不支持本地会话目录");
731
+ await this.call("conversation.directory.bot-pin", {
732
+ botRef,
733
+ pinned
734
+ }, signal);
735
+ }
726
736
  async listGroupMembers(sourceRef, signal) {
727
737
  if (sourceRef.trim() === "") throw new TypeError("Arkme group source reference must not be empty");
728
738
  return await this.call("group.members", {
@@ -762,6 +772,26 @@ window.__ModuleLoader__.load({
762
772
  if (confirmationRef.trim() === "") throw new TypeError("Arkme AI polish confirmation reference must not be empty");
763
773
  return await this.call("source.ai-polish.confirm-disable", { confirmationRef }, signal);
764
774
  }
775
+ async cachedSourceMembers(sourceRef, signal) {
776
+ if (sourceRef.trim() === "") throw new TypeError("Arkme source reference must not be empty");
777
+ return await this.call("source.members.cached", { sourceRef }, signal);
778
+ }
779
+ async pageSourceMembers(sourceRef, options = {}) {
780
+ if (sourceRef.trim() === "") throw new TypeError("Arkme source reference must not be empty");
781
+ if (options.limit !== void 0 && (!Number.isSafeInteger(options.limit) || options.limit < 1 || options.limit > 100)) throw new TypeError("Arkme member page limit must be 1-100");
782
+ return await this.call("source.members.page", {
783
+ sourceRef,
784
+ ...options.cursor === void 0 ? {} : { cursor: options.cursor },
785
+ ...options.limit === void 0 ? {} : { limit: options.limit }
786
+ }, options.signal);
787
+ }
788
+ async sourceMembersPresentation(sourceRef, memberRefs, signal) {
789
+ if (!sourceRef.trim() || memberRefs.length < 1 || memberRefs.length > 50 || memberRefs.some((ref) => !ref.trim())) throw new TypeError("Arkme member presentation needs 1-50 member references");
790
+ return await this.call("source.members.presentation", {
791
+ sourceRef,
792
+ memberRefs: [...memberRefs]
793
+ }, signal);
794
+ }
765
795
  async listSourceMembers(sourceRef, signal) {
766
796
  if (sourceRef.trim() === "") throw new TypeError("Arkme chat source reference must not be empty");
767
797
  return await this.call("source.members", {
@@ -873,14 +903,15 @@ window.__ModuleLoader__.load({
873
903
  items: normalizedItems
874
904
  }, signal);
875
905
  }
876
- async messageReadReceiptDetail(sourceRef, itemUid, sequence, signal) {
906
+ async messageReadReceiptDetail(sourceRef, itemUid, sequence, signal, options = {}) {
877
907
  const normalizedSourceRef = sourceRef.trim();
878
908
  const normalizedItemUid = itemUid.trim();
879
909
  if (normalizedSourceRef === "" || normalizedItemUid === "" || !Number.isSafeInteger(sequence) || sequence <= 0) throw new TypeError("Arkme group message read receipt identity is invalid");
880
910
  return await this.call("source.read-receipts.detail", {
881
911
  sourceRef: normalizedSourceRef,
882
912
  itemUid: normalizedItemUid,
883
- sequence
913
+ sequence,
914
+ ...options.basicOnly === void 0 ? {} : { basicOnly: options.basicOnly }
884
915
  }, signal);
885
916
  }
886
917
  async sendText(sourceRef, textContent, options = {}) {
@@ -1265,6 +1296,9 @@ window.__ModuleLoader__.load({
1265
1296
  if (timeout !== void 0) clearTimeout(timeout);
1266
1297
  };
1267
1298
  }
1299
+ async currentDesktopSession(signal) {
1300
+ return await this.call("remote.currentSession", void 0, signal);
1301
+ }
1268
1302
  async remoteStatus(signal) {
1269
1303
  return await this.call("remote.getStatus", void 0, signal);
1270
1304
  }
@@ -0,0 +1,124 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "@senguoyun/dsh-arkme/harness-session",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ //#region src/client/harness-session-client.ts
8
+ const inject = ["sessions"];
9
+ const REFRESH_MS = 1e4;
10
+ /** The iframe reads selection through the public DSH store; Arkme owns visibility. */
11
+ function apply(ctx) {
12
+ ctx.effect(() => {
13
+ const surface = window.frameElement?.parentElement;
14
+ if (surface?.getAttribute("data-arkme-owned") !== "deepseek-harness-surface") return () => void 0;
15
+ 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
+ const sessions = ctx.sessions;
18
+ if (sessions === void 0) return () => void 0;
19
+ const windowRef = crypto.randomUUID();
20
+ let revision = 0;
21
+ let stopped = false;
22
+ let busy = false;
23
+ let dirty = false;
24
+ let timer;
25
+ let fingerprint = "";
26
+ let renew = false;
27
+ let controller;
28
+ const report = async () => {
29
+ if (stopped) return;
30
+ if (busy) {
31
+ dirty = true;
32
+ return;
33
+ }
34
+ busy = true;
35
+ if (timer !== void 0) clearTimeout(timer);
36
+ do {
37
+ dirty = false;
38
+ const accountId = surface.getAttribute("data-arkme-account-id") ?? "";
39
+ const current = sessions.list.getSnapshot().current;
40
+ const sessionRef = surface.getAttribute("data-arkme-follow-session") === "true" ? current ?? null : null;
41
+ renew = accountId !== "" && sessionRef !== null;
42
+ fingerprint = JSON.stringify([accountId, sessionRef]);
43
+ if (accountId !== "") {
44
+ controller = new AbortController();
45
+ const deadline = setTimeout(() => {
46
+ controller?.abort();
47
+ }, 2e3);
48
+ try {
49
+ await fetch(apiPath, {
50
+ method: "POST",
51
+ headers: { "content-type": "application/json" },
52
+ body: JSON.stringify({
53
+ operation: "remote.reportCurrentSession",
54
+ params: {
55
+ accountId,
56
+ windowRef,
57
+ revision: ++revision,
58
+ sessionRef
59
+ }
60
+ }),
61
+ signal: controller.signal
62
+ });
63
+ } catch {} finally {
64
+ clearTimeout(deadline);
65
+ }
66
+ }
67
+ } while (dirty && !stopped);
68
+ busy = false;
69
+ if (!stopped && renew) timer = setTimeout(() => {
70
+ report();
71
+ }, REFRESH_MS);
72
+ };
73
+ const changed = () => {
74
+ const accountId = surface.getAttribute("data-arkme-account-id") ?? "";
75
+ const current = surface.getAttribute("data-arkme-follow-session") === "true" ? sessions.list.getSnapshot().current ?? null : null;
76
+ if (JSON.stringify([accountId, current]) !== fingerprint) report();
77
+ };
78
+ const clearSelection = () => {
79
+ controller?.abort();
80
+ if (timer !== void 0) clearTimeout(timer);
81
+ dirty = false;
82
+ renew = false;
83
+ const accountId = surface.getAttribute("data-arkme-account-id") ?? "";
84
+ fingerprint = JSON.stringify([accountId, null]);
85
+ if (accountId === "") return;
86
+ try {
87
+ navigator.sendBeacon(apiPath, new Blob([JSON.stringify({
88
+ operation: "remote.reportCurrentSession",
89
+ params: {
90
+ accountId,
91
+ windowRef,
92
+ revision: ++revision,
93
+ sessionRef: null
94
+ }
95
+ })], { type: "application/json" }));
96
+ } catch {}
97
+ };
98
+ const observer = new MutationObserver(changed);
99
+ observer.observe(surface, {
100
+ attributes: true,
101
+ attributeFilter: ["data-arkme-follow-session", "data-arkme-account-id"]
102
+ });
103
+ const unsubscribe = sessions.list.subscribe(changed);
104
+ document.addEventListener("visibilitychange", changed);
105
+ window.addEventListener("pagehide", clearSelection);
106
+ window.addEventListener("pageshow", changed);
107
+ report();
108
+ return () => {
109
+ stopped = true;
110
+ clearSelection();
111
+ observer.disconnect();
112
+ unsubscribe();
113
+ document.removeEventListener("visibilitychange", changed);
114
+ window.removeEventListener("pagehide", clearSelection);
115
+ window.removeEventListener("pageshow", changed);
116
+ };
117
+ }, "arkme: visible desktop DSH session");
118
+ }
119
+ //#endregion
120
+ exports.apply = apply;
121
+ exports.inject = inject;
122
+ return module.exports;
123
+ }
124
+ });