@senguoyun/dsh-arkme 0.1.22 → 0.1.23

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 (143) hide show
  1. package/assets/desktop_call/gallery-linear.svg +5 -0
  2. package/docs/consumer-plugin-contract.md +4 -0
  3. package/docs/third-party-notices.md +13 -0
  4. package/lib/client.js +32263 -15241
  5. package/lib/client.js.map +1 -1
  6. package/lib/extension-profile-restart-helper.js +19 -7
  7. package/lib/index.js +613 -84
  8. package/lib/{install-store-Beau1y-o.js → install-store-C1tAM346.js} +1 -1
  9. package/lib/persistent-extension.js +1 -1
  10. package/lib/{persistent-runtime-CNdmWCSF.js → persistent-runtime-BIJ2Er-6.js} +9419 -7883
  11. package/lib/plugin-updater-helper-Ddppbids.js +2 -0
  12. package/lib/{plugin-updater-helper-CEnlAUhI.js → plugin-updater-helper-Lmz7W2ph.js} +47 -10
  13. package/lib/plugin-updater-helper.js +1 -1
  14. package/lib/{profile-package-manager-DwuQu8ZL.js → profile-bundle-policy-CvojZuTD.js} +76 -1
  15. package/lib/sdk.js +59 -1
  16. package/lib/types/arkme-service.d.ts +26 -3
  17. package/lib/types/arkme-service.d.ts.map +1 -1
  18. package/lib/types/chat-realtime.d.ts +13 -1
  19. package/lib/types/chat-realtime.d.ts.map +1 -1
  20. package/lib/types/client/ArkmeCallSurface.d.ts.map +1 -1
  21. package/lib/types/client/ArkmeChatMemberActions.d.ts +3 -0
  22. package/lib/types/client/ArkmeChatMemberActions.d.ts.map +1 -1
  23. package/lib/types/client/ArkmeEmojiPicker.d.ts +25 -1
  24. package/lib/types/client/ArkmeEmojiPicker.d.ts.map +1 -1
  25. package/lib/types/client/ArkmeGroupChatControls.d.ts +2 -0
  26. package/lib/types/client/ArkmeGroupChatControls.d.ts.map +1 -1
  27. package/lib/types/client/ArkmeLogin.d.ts.map +1 -1
  28. package/lib/types/client/ArkmeMarketplace.d.ts +6 -3
  29. package/lib/types/client/ArkmeMarketplace.d.ts.map +1 -1
  30. package/lib/types/client/ArkmeMessageReadReceipt.d.ts +24 -0
  31. package/lib/types/client/ArkmeMessageReadReceipt.d.ts.map +1 -0
  32. package/lib/types/client/ArkmeNoteDetails.d.ts +14 -0
  33. package/lib/types/client/ArkmeNoteDetails.d.ts.map +1 -0
  34. package/lib/types/client/ArkmePersistentShell.d.ts +7 -1
  35. package/lib/types/client/ArkmePersistentShell.d.ts.map +1 -1
  36. package/lib/types/client/ArkmeProductNavigation.d.ts.map +1 -1
  37. package/lib/types/client/ArkmeQuickAdd.d.ts.map +1 -1
  38. package/lib/types/client/ArkmeRichComposerInput.d.ts +11 -0
  39. package/lib/types/client/ArkmeRichComposerInput.d.ts.map +1 -1
  40. package/lib/types/client/ArkmeRichContent.d.ts +9 -1
  41. package/lib/types/client/ArkmeRichContent.d.ts.map +1 -1
  42. package/lib/types/client/ArkmeSearchSurface.d.ts +19 -1
  43. package/lib/types/client/ArkmeSearchSurface.d.ts.map +1 -1
  44. package/lib/types/client/ArkmeSidebar.d.ts +37 -2
  45. package/lib/types/client/ArkmeSidebar.d.ts.map +1 -1
  46. package/lib/types/client/ArkmeSourceBreadcrumb.d.ts +29 -5
  47. package/lib/types/client/ArkmeSourceBreadcrumb.d.ts.map +1 -1
  48. package/lib/types/client/ArkmeTopicCreateDialog.d.ts +3 -1
  49. package/lib/types/client/ArkmeTopicCreateDialog.d.ts.map +1 -1
  50. package/lib/types/client/ArkmeTopicDirectoryPopover.d.ts +8 -1
  51. package/lib/types/client/ArkmeTopicDirectoryPopover.d.ts.map +1 -1
  52. package/lib/types/client/ArkmeTopicManagementDialog.d.ts +22 -0
  53. package/lib/types/client/ArkmeTopicManagementDialog.d.ts.map +1 -0
  54. package/lib/types/client/ArkmeUpdateSurfaces.d.ts.map +1 -1
  55. package/lib/types/client/ArkmeVirtualWorkspace.d.ts +10 -1
  56. package/lib/types/client/ArkmeVirtualWorkspace.d.ts.map +1 -1
  57. package/lib/types/client/ArkmeVoiceContent.d.ts +16 -0
  58. package/lib/types/client/ArkmeVoiceContent.d.ts.map +1 -0
  59. package/lib/types/client/ArkmeWorldSurface.d.ts +11 -3
  60. package/lib/types/client/ArkmeWorldSurface.d.ts.map +1 -1
  61. package/lib/types/client/account-settings-nav-icon.d.ts +10 -0
  62. package/lib/types/client/account-settings-nav-icon.d.ts.map +1 -0
  63. package/lib/types/client/api.d.ts +1 -1
  64. package/lib/types/client/api.d.ts.map +1 -1
  65. package/lib/types/client/arkme-login-locales.d.ts +2 -6
  66. package/lib/types/client/arkme-login-locales.d.ts.map +1 -1
  67. package/lib/types/client/arkme-theme.d.ts +1 -1
  68. package/lib/types/client/arkme-voice-compat.d.ts +7 -0
  69. package/lib/types/client/arkme-voice-compat.d.ts.map +1 -0
  70. package/lib/types/client/chat-directory-store.d.ts.map +1 -1
  71. package/lib/types/client/composer-draft-store.d.ts +6 -1
  72. package/lib/types/client/composer-draft-store.d.ts.map +1 -1
  73. package/lib/types/client/index.d.ts.map +1 -1
  74. package/lib/types/client/message-read-receipt-store.d.ts +63 -0
  75. package/lib/types/client/message-read-receipt-store.d.ts.map +1 -0
  76. package/lib/types/client/navigation-cache.d.ts.map +1 -1
  77. package/lib/types/client/realtime-client-events.d.ts.map +1 -1
  78. package/lib/types/client/source-list.d.ts.map +1 -1
  79. package/lib/types/client/source-tree.d.ts +13 -1
  80. package/lib/types/client/source-tree.d.ts.map +1 -1
  81. package/lib/types/client/ui-controller.d.ts +18 -0
  82. package/lib/types/client/ui-controller.d.ts.map +1 -1
  83. package/lib/types/extensions/client-owner.d.ts +10 -5
  84. package/lib/types/extensions/client-owner.d.ts.map +1 -1
  85. package/lib/types/extensions/manager.d.ts +18 -3
  86. package/lib/types/extensions/manager.d.ts.map +1 -1
  87. package/lib/types/extensions/persistent-client-bundle.d.ts +2 -2
  88. package/lib/types/extensions/persistent-client-bundle.d.ts.map +1 -1
  89. package/lib/types/extensions/profile-bundle-policy.d.ts +16 -0
  90. package/lib/types/extensions/profile-bundle-policy.d.ts.map +1 -0
  91. package/lib/types/extensions/profile-installer.d.ts +2 -0
  92. package/lib/types/extensions/profile-installer.d.ts.map +1 -1
  93. package/lib/types/extensions/profile-restart-helper.d.ts +5 -1
  94. package/lib/types/extensions/profile-restart-helper.d.ts.map +1 -1
  95. package/lib/types/extensions/types.d.ts +2 -0
  96. package/lib/types/extensions/types.d.ts.map +1 -1
  97. package/lib/types/host-api.d.ts.map +1 -1
  98. package/lib/types/index.d.ts +1 -1
  99. package/lib/types/index.d.ts.map +1 -1
  100. package/lib/types/mention-metadata.d.ts +3 -0
  101. package/lib/types/mention-metadata.d.ts.map +1 -0
  102. package/lib/types/outgoing-call-assets.d.ts.map +1 -1
  103. package/lib/types/plugin-update.d.ts +1 -0
  104. package/lib/types/plugin-update.d.ts.map +1 -1
  105. package/lib/types/plugin-updater-helper.d.ts +9 -1
  106. package/lib/types/plugin-updater-helper.d.ts.map +1 -1
  107. package/lib/types/rich-media-routes.d.ts.map +1 -1
  108. package/lib/types/sdk/index.d.ts +15 -2
  109. package/lib/types/sdk/index.d.ts.map +1 -1
  110. package/lib/types/services/bot-service.d.ts +19 -1
  111. package/lib/types/services/bot-service.d.ts.map +1 -1
  112. package/lib/types/services/calendar-service.d.ts +3 -1
  113. package/lib/types/services/calendar-service.d.ts.map +1 -1
  114. package/lib/types/services/chat-realtime-service.d.ts +1 -0
  115. package/lib/types/services/chat-realtime-service.d.ts.map +1 -1
  116. package/lib/types/services/chat-service.d.ts +31 -4
  117. package/lib/types/services/chat-service.d.ts.map +1 -1
  118. package/lib/types/services/media-service.d.ts +13 -1
  119. package/lib/types/services/media-service.d.ts.map +1 -1
  120. package/lib/types/services/privacy-visibility.d.ts +17 -0
  121. package/lib/types/services/privacy-visibility.d.ts.map +1 -0
  122. package/lib/types/services/record-service.d.ts +6 -1
  123. package/lib/types/services/record-service.d.ts.map +1 -1
  124. package/lib/types/services/search-service.d.ts +7 -1
  125. package/lib/types/services/search-service.d.ts.map +1 -1
  126. package/lib/types/services/source-service.d.ts +45 -3
  127. package/lib/types/services/source-service.d.ts.map +1 -1
  128. package/lib/types/services/world-service.d.ts.map +1 -1
  129. package/lib/types/tools/business/conversation/favorite-stickers.d.ts +5 -0
  130. package/lib/types/tools/business/conversation/favorite-stickers.d.ts.map +1 -0
  131. package/lib/types/tools/business/conversation/index.d.ts.map +1 -1
  132. package/lib/types/tools/business/conversation/read-receipts.d.ts +4 -0
  133. package/lib/types/tools/business/conversation/read-receipts.d.ts.map +1 -0
  134. package/lib/types/tools/business/conversation/unread.d.ts +4 -0
  135. package/lib/types/tools/business/conversation/unread.d.ts.map +1 -0
  136. package/lib/types/tools/business/index.d.ts.map +1 -1
  137. package/lib/types/tools/ports/conversations.d.ts +18 -1
  138. package/lib/types/tools/ports/conversations.d.ts.map +1 -1
  139. package/lib/types/tools/prompts/business.d.ts.map +1 -1
  140. package/lib/types/types.d.ts +177 -4
  141. package/lib/types/types.d.ts.map +1 -1
  142. package/package.json +12 -5
  143. package/lib/plugin-updater-helper-Bg28PYR7.js +0 -2
@@ -1,7 +1,7 @@
1
- import { n as prepareProfilePackageManager, t as localExtensionPnpmArgs } from "./profile-package-manager-DwuQu8ZL.js";
2
- import { t as ArkmeExtensionInstallStore } from "./install-store-Beau1y-o.js";
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";
3
3
  import { closeSync, openSync } from "node:fs";
4
- import { relative, resolve } from "node:path";
4
+ import { join, relative, resolve } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { spawn, spawnSync } from "node:child_process";
7
7
  import { readFile, rm, unlink } from "node:fs/promises";
@@ -34,10 +34,16 @@ function parseExtensionProfileRestartPlan(value) {
34
34
  cleanupPaths: Array.isArray(source.cleanupPaths) ? source.cleanupPaths.map(stringValue).filter((item) => item !== void 0) : [],
35
35
  installStoreDirectory: stringValue(source.installStoreDirectory),
36
36
  previousInstalled: source.previousInstalled !== null && typeof source.previousInstalled === "object" ? source.previousInstalled : void 0,
37
+ activationChange: source.activationChange === true ? true : void 0,
38
+ previousProfileIncluded: typeof source.previousProfileIncluded === "boolean" ? source.previousProfileIncluded : void 0,
37
39
  healthUrl: stringValue(source.healthUrl),
38
40
  logPath: stringValue(source.logPath)
39
41
  };
40
- if (![1, 2].includes(plan.schemaVersion) || typeof plan.parentPid !== "number" || !Number.isSafeInteger(plan.parentPid) || plan.parentPid <= 0 || plan.execPath === void 0 || plan.dshBinPath === void 0 || plan.restartArgv.length === 0 || plan.dshHome === void 0 || plan.profileName === void 0 || plan.packageName === void 0 || plan.extensionId === void 0 || typeof plan.expectActive !== "boolean" || plan.installStoreDirectory === void 0 || plan.healthUrl === void 0 || plan.logPath === void 0 || (plan.schemaVersion === 1 ? !/^@arkme-local\/ext-[a-f0-9]{16}$/.test(plan.packageName) : !/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/.test(plan.packageName))) throw new Error("extension restart plan is incomplete");
42
+ if (![
43
+ 1,
44
+ 2,
45
+ 3
46
+ ].includes(plan.schemaVersion) || typeof plan.parentPid !== "number" || !Number.isSafeInteger(plan.parentPid) || plan.parentPid <= 0 || plan.execPath === void 0 || plan.dshBinPath === void 0 || plan.restartArgv.length === 0 || plan.dshHome === void 0 || plan.profileName === void 0 || plan.packageName === void 0 || plan.extensionId === void 0 || typeof plan.expectActive !== "boolean" || plan.installStoreDirectory === void 0 || plan.healthUrl === void 0 || plan.logPath === void 0 || plan.schemaVersion === 3 && (plan.activationChange !== true || plan.previousInstalled === void 0 || plan.previousProfileIncluded === void 0) || plan.schemaVersion !== 3 && plan.activationChange === true || (plan.schemaVersion === 1 ? !/^@arkme-local\/ext-[a-f0-9]{16}$/.test(plan.packageName) : !/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/.test(plan.packageName))) throw new Error("extension restart plan is incomplete");
41
47
  const health = new URL(plan.healthUrl);
42
48
  if (health.protocol !== "http:" || !["127.0.0.1", "localhost"].includes(health.hostname)) throw new Error("extension restart health URL must be loopback HTTP");
43
49
  return {
@@ -88,7 +94,7 @@ async function healthy(plan) {
88
94
  if (response.ok) {
89
95
  const body = await response.json();
90
96
  const installed = body.value?.find((item) => item.extensionId === plan.extensionId);
91
- if (body.ok === true && (plan.expectActive ? installed?.active === true : installed === void 0)) return true;
97
+ if (body.ok === true && (plan.activationChange === true ? plan.expectActive ? installed?.enabled === true && installed.active === true : installed?.enabled === false && installed.active === false : plan.expectActive ? installed?.active === true : installed === void 0)) return true;
92
98
  }
93
99
  } catch {}
94
100
  await new Promise((resolve) => setTimeout(resolve, 500));
@@ -117,6 +123,7 @@ const defaultOperations = {
117
123
  start,
118
124
  isHealthy: healthy,
119
125
  profileCommand,
126
+ applyBundlePolicy: applyArkmeProfileBundlePolicy,
120
127
  removePath: async (path) => await rm(path, {
121
128
  recursive: true,
122
129
  force: true
@@ -136,7 +143,11 @@ async function cleanup(plan, helper) {
136
143
  }
137
144
  }
138
145
  async function rollback(plan, restart, helper) {
139
- if (!helper.profileCommand(plan, extensionProfileRollbackArgs(plan))) throw new Error("extension profile rollback failed");
146
+ if (plan.activationChange === true) helper.applyBundlePolicy(join(plan.dshHome, "profiles", plan.profileName), [{
147
+ packageName: plan.packageName,
148
+ enabled: plan.previousProfileIncluded === true
149
+ }]);
150
+ else if (!helper.profileCommand(plan, extensionProfileRollbackArgs(plan))) throw new Error("extension profile rollback failed");
140
151
  const store = new ArkmeExtensionInstallStore(plan.installStoreDirectory);
141
152
  try {
142
153
  if (plan.previousInstalled === void 0) store.remove(plan.extensionId);
@@ -150,6 +161,7 @@ async function rollback(plan, restart, helper) {
150
161
  if (restart) helper.start(plan);
151
162
  }
152
163
  function extensionProfileRollbackArgs(plan) {
164
+ if (plan.activationChange === true) throw new Error("activation restart rollback does not use DSH plugin commands");
153
165
  if (plan.previousBundlePath === void 0) return ["remove", plan.packageName];
154
166
  return plan.schemaVersion === 1 ? ["add", `link:${plan.previousBundlePath}`] : ["add", plan.previousBundlePath];
155
167
  }
@@ -196,7 +208,7 @@ async function main() {
196
208
  if (planPath === void 0) throw new Error("extension restart plan path is required");
197
209
  const rawPlan = JSON.parse(await readFile(planPath, "utf8"));
198
210
  if (managed && isPluginUpdateRestartPlan(rawPlan)) {
199
- const pluginUpdate = await import("./plugin-updater-helper-Bg28PYR7.js");
211
+ const pluginUpdate = await import("./plugin-updater-helper-Ddppbids.js");
200
212
  if (mode === "--managed-finalize") {
201
213
  const healthUrl = process.argv[4];
202
214
  if (healthUrl === void 0) throw new Error("managed plugin update health URL is required");