@senguoyun/dsh-arkme 0.1.77 → 0.1.79

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 (63) hide show
  1. package/lib/client.js +1037 -134
  2. package/lib/client.js.map +1 -1
  3. package/lib/harness-model-client.js +26 -4
  4. package/lib/harness-native-selection-client.js +26 -4
  5. package/lib/harness-session-client.js +13 -2
  6. package/lib/harness-sidebar-client.js +9 -1
  7. package/lib/index.js +32 -1
  8. package/lib/persistent-extension.js +1 -1
  9. package/lib/{persistent-runtime-eUVtjdJU.js → persistent-runtime-CB7mEj3E.js} +507 -111
  10. package/lib/sdk.js +9 -1
  11. package/lib/types/account-session-owner.d.ts +1 -1
  12. package/lib/types/account-session-owner.d.ts.map +1 -1
  13. package/lib/types/arkme-service.d.ts +16 -0
  14. package/lib/types/arkme-service.d.ts.map +1 -1
  15. package/lib/types/client/ArkmeAccountCancellation.d.ts +8 -0
  16. package/lib/types/client/ArkmeAccountCancellation.d.ts.map +1 -0
  17. package/lib/types/client/ArkmeLogin.d.ts +3 -0
  18. package/lib/types/client/ArkmeLogin.d.ts.map +1 -1
  19. package/lib/types/client/ArkmeRecordingSurface.d.ts +2 -1
  20. package/lib/types/client/ArkmeRecordingSurface.d.ts.map +1 -1
  21. package/lib/types/client/ArkmeSearchSurface.d.ts.map +1 -1
  22. package/lib/types/client/ArkmeSettingsSurface.d.ts +12 -1
  23. package/lib/types/client/ArkmeSettingsSurface.d.ts.map +1 -1
  24. package/lib/types/client/arkme-auth-flow.d.ts.map +1 -1
  25. package/lib/types/client/arkme-login-locales.d.ts +6 -0
  26. package/lib/types/client/arkme-login-locales.d.ts.map +1 -1
  27. package/lib/types/client/auth-store.d.ts.map +1 -1
  28. package/lib/types/client/harness-attachment-draft.d.ts +1 -1
  29. package/lib/types/client/harness-attachment-draft.d.ts.map +1 -1
  30. package/lib/types/client/harness-session-client.d.ts.map +1 -1
  31. package/lib/types/client/locales/actions-en.d.ts.map +1 -1
  32. package/lib/types/client/locales/en.d.ts.map +1 -1
  33. package/lib/types/client/recordings/RecordingSearchRow.d.ts +5 -0
  34. package/lib/types/client/recordings/RecordingSearchRow.d.ts.map +1 -0
  35. package/lib/types/client/recordings/recording-search-target.d.ts +4 -0
  36. package/lib/types/client/recordings/recording-search-target.d.ts.map +1 -0
  37. package/lib/types/client/ui-controller.d.ts +3 -5
  38. package/lib/types/client/ui-controller.d.ts.map +1 -1
  39. package/lib/types/host-api.d.ts.map +1 -1
  40. package/lib/types/index.d.ts +1 -1
  41. package/lib/types/index.d.ts.map +1 -1
  42. package/lib/types/local-database.d.ts +2 -0
  43. package/lib/types/local-database.d.ts.map +1 -1
  44. package/lib/types/recording-presentation.d.ts +1 -0
  45. package/lib/types/recording-presentation.d.ts.map +1 -1
  46. package/lib/types/recording-search-result.d.ts +3 -0
  47. package/lib/types/recording-search-result.d.ts.map +1 -0
  48. package/lib/types/recording-search-version.d.ts +17 -0
  49. package/lib/types/recording-search-version.d.ts.map +1 -0
  50. package/lib/types/sdk/index.d.ts +7 -1
  51. package/lib/types/sdk/index.d.ts.map +1 -1
  52. package/lib/types/services/auth-service.d.ts +30 -1
  53. package/lib/types/services/auth-service.d.ts.map +1 -1
  54. package/lib/types/services/recording-service.d.ts.map +1 -1
  55. package/lib/types/services/search-service.d.ts +3 -1
  56. package/lib/types/services/search-service.d.ts.map +1 -1
  57. package/lib/types/services/service.d.ts +4 -0
  58. package/lib/types/services/service.d.ts.map +1 -1
  59. package/lib/types/state-store.d.ts +7 -0
  60. package/lib/types/state-store.d.ts.map +1 -1
  61. package/lib/types/types.d.ts +45 -2
  62. package/lib/types/types.d.ts.map +1 -1
  63. package/package.json +5 -5
@@ -857,6 +857,12 @@ TA 公开分享的内容|Publicly shared content
857
857
  微信号|WeChat
858
858
  绑定|Connect
859
859
  换绑|Change
860
+ 解/换绑|Disconnect / change
861
+ 解绑手机号|Disconnect phone number
862
+ 返回更换手机号|Back to changing phone number
863
+ 确认解绑|Confirm disconnect
864
+ 当前仅绑定了手机号,请先绑定其他登录方式|Link another sign-in method before unlinking your phone number.
865
+ 账号状态未确认,请重新打开账号设置|Account status could not be confirmed. Reopen account settings.
860
866
  绑定中…|Connecting…
861
867
  通用|General
862
868
  隐私与权限|Privacy & permissions
@@ -1750,7 +1756,7 @@ Arkme 用户 {v0}|Arkme user {v0}
1750
1756
  return current.revision + 1;
1751
1757
  }
1752
1758
  function sameAuth(left, right) {
1753
- return left?.status === right?.status && left?.environment === right?.environment && left?.userId === right?.userId && left?.attemptId === right?.attemptId && left?.expiresAtMillis === right?.expiresAtMillis;
1759
+ return left?.status === right?.status && left?.environment === right?.environment && left?.userId === right?.userId && left?.attemptId === right?.attemptId && left?.expiresAtMillis === right?.expiresAtMillis && left?.restDaysCancel === right?.restDaysCancel && left?.cancellationNotice === right?.cancellationNotice;
1754
1760
  }
1755
1761
  var ArkmeAuthStore = class {
1756
1762
  state = {
@@ -1773,6 +1779,10 @@ Arkme 用户 {v0}|Arkme user {v0}
1773
1779
  };
1774
1780
  setAuth(auth) {
1775
1781
  if (sameAuth(this.state.auth, auth) && this.state.checked && !this.state.busy && this.state.error === "") return;
1782
+ if (!["authenticated", "binding-required"].includes(auth.status) && auth.cancellationNotice === void 0 && this.state.auth?.cancellationNotice !== void 0) auth = {
1783
+ ...auth,
1784
+ cancellationNotice: this.state.auth.cancellationNotice
1785
+ };
1776
1786
  this.authGeneration += 1;
1777
1787
  this.publish({
1778
1788
  ...this.state,
@@ -1803,8 +1813,12 @@ Arkme 用户 {v0}|Arkme user {v0}
1803
1813
  });
1804
1814
  const pending = Promise.all([callArkme("auth.status"), callArkme("auth.config")]).then(([auth, config]) => {
1805
1815
  const currentAuth = this.state.auth;
1806
- const preservePendingAttempt = currentAuth?.status === "pending" && (auth.status === "logged-out" || auth.status === "expired");
1807
- const effectiveAuth = this.authGeneration === authGeneration && !preservePendingAttempt ? auth : currentAuth ?? auth;
1816
+ const preservePendingAttempt = (currentAuth?.status === "pending" || currentAuth?.status === "cancellation-pending") && (auth.status === "logged-out" || auth.status === "expired");
1817
+ let effectiveAuth = this.authGeneration === authGeneration && !preservePendingAttempt ? auth : currentAuth ?? auth;
1818
+ if (!["authenticated", "binding-required"].includes(effectiveAuth.status) && effectiveAuth.cancellationNotice === void 0 && currentAuth?.cancellationNotice !== void 0) effectiveAuth = {
1819
+ ...effectiveAuth,
1820
+ cancellationNotice: currentAuth.cancellationNotice
1821
+ };
1808
1822
  this.publish({
1809
1823
  ...this.state,
1810
1824
  auth: effectiveAuth,
@@ -2277,7 +2291,15 @@ Arkme 用户 {v0}|Arkme user {v0}
2277
2291
  captcha
2278
2292
  }, signal);
2279
2293
  }
2280
- /** Verify a phone code and refresh the account auth/profile state. */
2294
+ async checkPhoneUnbindEligibility(expectedUserId, signal) {
2295
+ return await this.call("auth.phone.unbind.check", { expectedUserId }, signal);
2296
+ }
2297
+ async sendPhoneUnbindCode(captcha, signal) {
2298
+ return await this.call("auth.phone.unbind.send", { captcha }, signal);
2299
+ }
2300
+ async unbindPhone(code, signal) {
2301
+ return await this.call("auth.phone.unbind", { code: code.trim() }, signal);
2302
+ }
2281
2303
  async verifyPhoneCode(phone, code, signal) {
2282
2304
  const normalized = phone.replace(/[\s-]/g, "");
2283
2305
  const normalizedCode = code.trim();
@@ -36,7 +36,7 @@ window.__ModuleLoader__.load({
36
36
  return current.revision + 1;
37
37
  }
38
38
  function sameAuth(left, right) {
39
- return left?.status === right?.status && left?.environment === right?.environment && left?.userId === right?.userId && left?.attemptId === right?.attemptId && left?.expiresAtMillis === right?.expiresAtMillis;
39
+ return left?.status === right?.status && left?.environment === right?.environment && left?.userId === right?.userId && left?.attemptId === right?.attemptId && left?.expiresAtMillis === right?.expiresAtMillis && left?.restDaysCancel === right?.restDaysCancel && left?.cancellationNotice === right?.cancellationNotice;
40
40
  }
41
41
  var ArkmeAuthStore = class {
42
42
  state = {
@@ -59,6 +59,10 @@ window.__ModuleLoader__.load({
59
59
  };
60
60
  setAuth(auth) {
61
61
  if (sameAuth(this.state.auth, auth) && this.state.checked && !this.state.busy && this.state.error === "") return;
62
+ if (!["authenticated", "binding-required"].includes(auth.status) && auth.cancellationNotice === void 0 && this.state.auth?.cancellationNotice !== void 0) auth = {
63
+ ...auth,
64
+ cancellationNotice: this.state.auth.cancellationNotice
65
+ };
62
66
  this.authGeneration += 1;
63
67
  this.publish({
64
68
  ...this.state,
@@ -89,8 +93,12 @@ window.__ModuleLoader__.load({
89
93
  });
90
94
  const pending = Promise.all([callArkme("auth.status"), callArkme("auth.config")]).then(([auth, config]) => {
91
95
  const currentAuth = this.state.auth;
92
- const preservePendingAttempt = currentAuth?.status === "pending" && (auth.status === "logged-out" || auth.status === "expired");
93
- const effectiveAuth = this.authGeneration === authGeneration && !preservePendingAttempt ? auth : currentAuth ?? auth;
96
+ const preservePendingAttempt = (currentAuth?.status === "pending" || currentAuth?.status === "cancellation-pending") && (auth.status === "logged-out" || auth.status === "expired");
97
+ let effectiveAuth = this.authGeneration === authGeneration && !preservePendingAttempt ? auth : currentAuth ?? auth;
98
+ if (!["authenticated", "binding-required"].includes(effectiveAuth.status) && effectiveAuth.cancellationNotice === void 0 && currentAuth?.cancellationNotice !== void 0) effectiveAuth = {
99
+ ...effectiveAuth,
100
+ cancellationNotice: currentAuth.cancellationNotice
101
+ };
94
102
  this.publish({
95
103
  ...this.state,
96
104
  auth: effectiveAuth,
@@ -577,7 +585,15 @@ window.__ModuleLoader__.load({
577
585
  captcha
578
586
  }, signal);
579
587
  }
580
- /** Verify a phone code and refresh the account auth/profile state. */
588
+ async checkPhoneUnbindEligibility(expectedUserId, signal) {
589
+ return await this.call("auth.phone.unbind.check", { expectedUserId }, signal);
590
+ }
591
+ async sendPhoneUnbindCode(captcha, signal) {
592
+ return await this.call("auth.phone.unbind.send", { captcha }, signal);
593
+ }
594
+ async unbindPhone(code, signal) {
595
+ return await this.call("auth.phone.unbind", { code: code.trim() }, signal);
596
+ }
581
597
  async verifyPhoneCode(phone, code, signal) {
582
598
  const normalized = phone.replace(/[\s-]/g, "");
583
599
  const normalizedCode = code.trim();
@@ -3217,6 +3233,12 @@ TA 公开分享的内容|Publicly shared content
3217
3233
  微信号|WeChat
3218
3234
  绑定|Connect
3219
3235
  换绑|Change
3236
+ 解/换绑|Disconnect / change
3237
+ 解绑手机号|Disconnect phone number
3238
+ 返回更换手机号|Back to changing phone number
3239
+ 确认解绑|Confirm disconnect
3240
+ 当前仅绑定了手机号,请先绑定其他登录方式|Link another sign-in method before unlinking your phone number.
3241
+ 账号状态未确认,请重新打开账号设置|Account status could not be confirmed. Reopen account settings.
3220
3242
  绑定中…|Connecting…
3221
3243
  通用|General
3222
3244
  隐私与权限|Privacy & permissions
@@ -85,6 +85,7 @@ window.__ModuleLoader__.load({
85
85
  const workspaceId = await defaultWorkspace();
86
86
  check();
87
87
  if (!workspaceId) throw new Error("默认工作区尚未就绪,请重试");
88
+ attempt.workspaceId = workspaceId;
88
89
  return sessions.create({
89
90
  sessionId: attempt.id,
90
91
  workspaceId
@@ -100,6 +101,10 @@ window.__ModuleLoader__.load({
100
101
  await waitForDraftOperation(attempt.creation, signal);
101
102
  check();
102
103
  }
104
+ if (!defaultWorkspace) throw unsupported();
105
+ const confirmedWorkspace = await waitForDraftOperation(defaultWorkspace(attempt.id), signal);
106
+ check();
107
+ if (confirmedWorkspace !== attempt.workspaceId) throw new Error("目标对话工作区已变更,请重新选择快记后操作");
103
108
  const scope = sessions.scope(attempt.id);
104
109
  conversation = scope?.get("conversation");
105
110
  if (!scope || !conversation?.createDrafts || !conversation.fileUploads || !conversation.input?.for) throw unsupported();
@@ -335,11 +340,17 @@ window.__ModuleLoader__.load({
335
340
  };
336
341
  const accountId = surface.getAttribute("data-arkme-account-id");
337
342
  const accountScope = surface.getAttribute("data-arkme-account-scope");
338
- const drafts = createHarnessDraftBridge(sessions, () => surface.isConnected && surface.getAttribute("data-arkme-account-id") === accountId && surface.getAttribute("data-arkme-account-scope") === accountScope, async () => {
343
+ const drafts = createHarnessDraftBridge(sessions, () => surface.isConnected && surface.getAttribute("data-arkme-account-id") === accountId && surface.getAttribute("data-arkme-account-scope") === accountScope, async (sessionId) => {
339
344
  const encoded = document.querySelector("meta[name=\"arkme-default-workspace\"]")?.content;
340
345
  const workspaces = ctx.get("workspaces");
341
346
  if (!encoded || !workspaces?.create) throw new Error("当前 DSH 无法选择默认工作区,请升级客户端后重试");
342
- return (await workspaces.create({ path: decodeURIComponent(encoded) })).workspaceId;
347
+ if (sessionId) {
348
+ const known = workspaces.list?.getSnapshot().items.find((item) => item.sessionIds.includes(sessionId));
349
+ if (known) return known.workspaceId;
350
+ }
351
+ const workspace = await workspaces.create({ path: decodeURIComponent(encoded) });
352
+ if (sessionId && (!workspace.sessionIds.includes(sessionId) || !workspaces.list?.getSnapshot().items.some((item) => item.workspaceId === workspace.workspaceId && item.sessionIds.includes(sessionId)))) throw new Error("DSH 默认工作区尚未同步,请重试");
353
+ return workspace.workspaceId;
343
354
  });
344
355
  window[HARNESS_ATTACHMENT_DRAFT_KEY] = drafts;
345
356
  frameWindow[HARNESS_SESSION_NAVIGATION_KEY] = navigation;
@@ -501,7 +501,15 @@ window.__ModuleLoader__.load({
501
501
  captcha
502
502
  }, signal);
503
503
  }
504
- /** Verify a phone code and refresh the account auth/profile state. */
504
+ async checkPhoneUnbindEligibility(expectedUserId, signal) {
505
+ return await this.call("auth.phone.unbind.check", { expectedUserId }, signal);
506
+ }
507
+ async sendPhoneUnbindCode(captcha, signal) {
508
+ return await this.call("auth.phone.unbind.send", { captcha }, signal);
509
+ }
510
+ async unbindPhone(code, signal) {
511
+ return await this.call("auth.phone.unbind", { code: code.trim() }, signal);
512
+ }
505
513
  async verifyPhoneCode(phone, code, signal) {
506
514
  const normalized = phone.replace(/[\s-]/g, "");
507
515
  const normalizedCode = code.trim();
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as inspectNativeBundleArtifactV3, At as parseArkmeRecordReeditAttachments, Ct as isRecentEmojiId, D as bundleSha256, Dt as retryAfterMillis, E as arkmeSandboxEntryId, Et as ArkmePluginError, F as assertExtensionArtifactSize, Ft as __esmMin, G as validateVoiceprintPcm16Wav, I as canonicalExtensionJson, It as __exportAll, J as arkmeRequiredLinkMetadataFallback, K as arkmeExtensionShareRefFromLink, L as sha256Hex, Lt as __require, M as packLocalNativeBundleDirectoryV3, Mt as registerDSHAgentInputRecordSync, N as readNativeBundleTarballV3, Nt as createDesktopLifecycleReader, O as canonicalBundleJson, Ot as recordOwnerId, P as renderArkmeSandboxHostEntry, Pt as __commonJSMin, Q as ARKME_PROVIDER_CONTRACT_VERSION, R as unpackArkmeExtension, Rt as __toCommonJS, S as ARKME_BUNDLE_ARTIFACT_KIND, St as recordingImportFileNameKey, T as ArkmeBundleArtifactError, Tt as registerManagedAiProvider, 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 parseArkmeRecordReeditMentions, k as inspectBundleArtifact, kt as ArkmeRecordReeditDraftConflict, 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-eUVtjdJU.js";
1
+ import { A as inspectNativeBundleArtifactV3, At as parseArkmeRecordReeditAttachments, Ct as isRecentEmojiId, D as bundleSha256, Dt as retryAfterMillis, E as arkmeSandboxEntryId, Et as ArkmePluginError, F as assertExtensionArtifactSize, Ft as __esmMin, G as validateVoiceprintPcm16Wav, I as canonicalExtensionJson, It as __exportAll, J as arkmeRequiredLinkMetadataFallback, K as arkmeExtensionShareRefFromLink, L as sha256Hex, Lt as __require, M as packLocalNativeBundleDirectoryV3, Mt as registerDSHAgentInputRecordSync, N as readNativeBundleTarballV3, Nt as createDesktopLifecycleReader, O as canonicalBundleJson, Ot as recordOwnerId, P as renderArkmeSandboxHostEntry, Pt as __commonJSMin, Q as ARKME_PROVIDER_CONTRACT_VERSION, R as unpackArkmeExtension, Rt as __toCommonJS, S as ARKME_BUNDLE_ARTIFACT_KIND, St as recordingImportFileNameKey, T as ArkmeBundleArtifactError, Tt as registerManagedAiProvider, 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 parseArkmeRecordReeditMentions, k as inspectBundleArtifact, kt as ArkmeRecordReeditDraftConflict, 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-CB7mEj3E.js";
2
2
  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-Cwi2iuHi.js";
3
3
  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-BWIKYugE.js";
4
4
  import { i as invokeArkmeBundle, n as arkmeBundleActive, r as deactivateArkmeBundle } from "./bundle-runtime-QUG0eHSZ.js";
@@ -14299,8 +14299,16 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
14299
14299
  case "auth.app.poll": return await service.pollJiwoLogin(stringParam(params, "attemptId"));
14300
14300
  case "auth.app.cancel": return await service.cancelJiwoLogin(stringParam(params, "attemptId"));
14301
14301
  case "auth.test.login": return await service.testLogin(numberParam(params, "userId", 0));
14302
+ case "auth.email.send": return await service.sendEmailBindCode(numberParam(params, "expectedUserId", 0), stringParam(params, "email"));
14303
+ case "auth.email.bind": return await service.bindEmail(numberParam(params, "expectedUserId", 0), stringParam(params, "email"), stringParam(params, "code"));
14302
14304
  case "auth.phone.send": return await service.sendPhoneCode(stringParam(params, "phone"), captchaParam(params));
14305
+ case "auth.phone.unbind.check": return await service.checkPhoneUnbindEligibility(numberParam(params, "expectedUserId", 0));
14306
+ case "auth.phone.unbind.send": return await service.sendPhoneUnbindCode(captchaParam(params));
14307
+ case "auth.phone.unbind": return await service.unbindPhone(stringParam(params, "code"));
14303
14308
  case "auth.phone.verify": return await service.verifyPhoneCode(stringParam(params, "phone"), stringParam(params, "code"));
14309
+ case "auth.cancellation.preview": return await service.previewCancellation(numberParam(params, "expectedUserId", 0));
14310
+ case "auth.cancellation.submit": return await service.submitCancellation(numberParam(params, "expectedUserId", 0), stringParam(params, "expectedMode"));
14311
+ case "auth.cancellation.login.resolve": return await service.resolveCancellationLogin(requiredBooleanParam(params, "continueLogin"));
14304
14312
  case "auth.logout": return await service.logout();
14305
14313
  case "chat.direct-message-admission": return await service.directMessageAdmission(stringParam(params, "sourceRef"), requestSignal);
14306
14314
  case "chat.direct-message-refusal.set": return await service.setDirectMessageRefusal(stringParam(params, "sourceRef"), requiredBooleanParam(params, "refused"), numberParam(params, "expectedRevision", -1), requestSignal);
@@ -19530,6 +19538,12 @@ var ArkmeLocalDatabase = class {
19530
19538
  if (!this.database.prepare("PRAGMA table_info(user_profile_cache)").all().some((column) => column.name === "can_update_arkme_id")) this.database.exec("ALTER TABLE user_profile_cache ADD COLUMN can_update_arkme_id INTEGER");
19531
19539
  this.secureDatabaseFiles();
19532
19540
  }
19541
+ async readCancellationCompletion() {
19542
+ return await this.operationalState.readCancellationCompletion();
19543
+ }
19544
+ async writeCancellationCompletion(completion) {
19545
+ await this.operationalState.writeCancellationCompletion(completion);
19546
+ }
19533
19547
  async uniqueCode() {
19534
19548
  return await this.operationalState.uniqueCode();
19535
19549
  }
@@ -24801,6 +24815,12 @@ function legacyRecordReeditRevision(drafts, submissions) {
24801
24815
  }
24802
24816
  return revision;
24803
24817
  }
24818
+ function validCancellationCompletion(value) {
24819
+ if (value === null || typeof value !== "object") return false;
24820
+ const candidate = value;
24821
+ const result = candidate.result;
24822
+ return Number.isSafeInteger(candidate.userId) && candidate.userId > 0 && typeof candidate.sessionHash === "string" && /^[a-f0-9]{64}$/.test(candidate.sessionHash) && result != null && ["immediate", "waiting"].includes(result.mode) && ["done", "waiting"].includes(result.status) && Number.isSafeInteger(result.cancel_at) && typeof result.has_phone === "boolean";
24823
+ }
24804
24824
  function parseState(raw) {
24805
24825
  const parsed = JSON.parse(raw);
24806
24826
  if (parsed === null || typeof parsed !== "object") return emptyState$1();
@@ -24832,6 +24852,7 @@ function parseState(raw) {
24832
24852
  return {
24833
24853
  version: 2,
24834
24854
  uniqueCode: typeof source.uniqueCode === "string" && source.uniqueCode.trim() !== "" ? source.uniqueCode : randomUUID(),
24855
+ ...validCancellationCompletion(source.cancellationCompletion) ? { cancellationCompletion: source.cancellationCompletion } : {},
24835
24856
  pendingByUser,
24836
24857
  longArticleDraftsByUser,
24837
24858
  recordReeditDraftsByUser,
@@ -24905,6 +24926,16 @@ var ArkmeStateStore = class {
24905
24926
  constructor(directory) {
24906
24927
  this.path = join(directory, "state.json");
24907
24928
  }
24929
+ async readCancellationCompletion() {
24930
+ return await this.read((state) => state.cancellationCompletion === void 0 ? void 0 : structuredClone(state.cancellationCompletion));
24931
+ }
24932
+ async writeCancellationCompletion(completion) {
24933
+ if (completion !== void 0 && !validCancellationCompletion(completion)) throw new Error("注销完成记录无效");
24934
+ await this.update((state) => {
24935
+ if (completion === void 0) delete state.cancellationCompletion;
24936
+ else state.cancellationCompletion = structuredClone(completion);
24937
+ });
24938
+ }
24908
24939
  async uniqueCode() {
24909
24940
  return await this.read((state) => state.uniqueCode);
24910
24941
  }
@@ -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-eUVtjdJU.js";
1
+ import { a as persistentArkmeExtensionActive, i as invokePersistentArkmeExtension, n as applyPersistentArkmeHostExtension, o as persistentArkmeExtensionRuntimeState, r as deactivatePersistentArkmeExtension, t as activatePersistentArkmeExtension } from "./persistent-runtime-CB7mEj3E.js";
2
2
  export { activatePersistentArkmeExtension, applyPersistentArkmeHostExtension, deactivatePersistentArkmeExtension, invokePersistentArkmeExtension, persistentArkmeExtensionActive, persistentArkmeExtensionRuntimeState };