@senguoyun/dsh-arkme 0.1.34 → 0.1.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/plugin-release.md +14 -1
- package/lib/client.js +33306 -30787
- package/lib/client.js.map +1 -1
- package/lib/index.js +46 -4
- package/lib/persistent-extension.js +1 -1
- package/lib/{persistent-runtime-CZQTfyC1.js → persistent-runtime-e4gV6dqq.js} +1071 -609
- package/lib/sdk.js +19 -0
- package/lib/types/arkme-service.d.ts +5 -1
- package/lib/types/arkme-service.d.ts.map +1 -1
- package/lib/types/billing-gateway.d.ts.map +1 -1
- package/lib/types/client/ArkmeAvatar.d.ts +16 -10
- package/lib/types/client/ArkmeAvatar.d.ts.map +1 -1
- package/lib/types/client/ArkmeBillingSettings.d.ts +4 -0
- package/lib/types/client/ArkmeBillingSettings.d.ts.map +1 -1
- package/lib/types/client/ArkmeCalendarSurface.d.ts.map +1 -1
- package/lib/types/client/ArkmeCallHistorySurface.d.ts.map +1 -1
- package/lib/types/client/ArkmeCallSurface.d.ts.map +1 -1
- package/lib/types/client/ArkmeChatMemberActions.d.ts +4 -3
- package/lib/types/client/ArkmeChatMemberActions.d.ts.map +1 -1
- package/lib/types/client/ArkmeExtensionReviews.d.ts +2 -1
- package/lib/types/client/ArkmeExtensionReviews.d.ts.map +1 -1
- package/lib/types/client/ArkmeGroupChatControls.d.ts.map +1 -1
- package/lib/types/client/ArkmeMarketplace.d.ts +4 -2
- package/lib/types/client/ArkmeMarketplace.d.ts.map +1 -1
- package/lib/types/client/ArkmeMessageReportDialog.d.ts +8 -0
- package/lib/types/client/ArkmeMessageReportDialog.d.ts.map +1 -0
- package/lib/types/client/ArkmeNoteDetails.d.ts.map +1 -1
- package/lib/types/client/ArkmeOutgoingCallHost.d.ts.map +1 -1
- package/lib/types/client/ArkmePersistentShell.d.ts.map +1 -1
- package/lib/types/client/ArkmeRelatedQuickNotes.d.ts +47 -0
- package/lib/types/client/ArkmeRelatedQuickNotes.d.ts.map +1 -0
- package/lib/types/client/ArkmeRichComposerInput.d.ts.map +1 -1
- package/lib/types/client/ArkmeSearchSurface.d.ts.map +1 -1
- package/lib/types/client/ArkmeSidebar.d.ts +7 -4
- package/lib/types/client/ArkmeSidebar.d.ts.map +1 -1
- package/lib/types/client/ArkmeVirtualWorkspace.d.ts.map +1 -1
- package/lib/types/client/ArkmeWorldSurface.d.ts +6 -1
- package/lib/types/client/ArkmeWorldSurface.d.ts.map +1 -1
- package/lib/types/client/api.d.ts +1 -1
- package/lib/types/client/api.d.ts.map +1 -1
- package/lib/types/client/arkme-billing.d.ts +7 -1
- package/lib/types/client/arkme-billing.d.ts.map +1 -1
- package/lib/types/client/avatar-image-runtime.d.ts +3 -0
- package/lib/types/client/avatar-image-runtime.d.ts.map +1 -0
- package/lib/types/client/avatar-image-store.d.ts +44 -0
- package/lib/types/client/avatar-image-store.d.ts.map +1 -0
- package/lib/types/client/calendar-invalidation-store.d.ts +26 -0
- package/lib/types/client/calendar-invalidation-store.d.ts.map +1 -0
- package/lib/types/client/chat-directory-store.d.ts +23 -13
- package/lib/types/client/chat-directory-store.d.ts.map +1 -1
- package/lib/types/client/composer-draft-store.d.ts +3 -3
- package/lib/types/client/composer-draft-store.d.ts.map +1 -1
- package/lib/types/client/composer-placeholder.d.ts +13 -0
- package/lib/types/client/composer-placeholder.d.ts.map +1 -0
- package/lib/types/client/conversation-memory-cache.d.ts +11 -14
- package/lib/types/client/conversation-memory-cache.d.ts.map +1 -1
- package/lib/types/client/file-send-tasks.d.ts +3 -1
- package/lib/types/client/file-send-tasks.d.ts.map +1 -1
- package/lib/types/client/interwoven-moments.d.ts +13 -2
- package/lib/types/client/interwoven-moments.d.ts.map +1 -1
- package/lib/types/client/navigation-cache.d.ts.map +1 -1
- package/lib/types/client/presentation-maintenance-runtime.d.ts +13 -0
- package/lib/types/client/presentation-maintenance-runtime.d.ts.map +1 -0
- package/lib/types/client/provider-instance-runtime.d.ts +5 -2
- package/lib/types/client/provider-instance-runtime.d.ts.map +1 -1
- package/lib/types/client/realtime-client-events.d.ts +6 -0
- package/lib/types/client/realtime-client-events.d.ts.map +1 -1
- package/lib/types/client/redesign/contacts/contacts-tab-store.d.ts.map +1 -1
- package/lib/types/client/related-recordings.d.ts +1 -1
- package/lib/types/client/source-identity.d.ts +5 -0
- package/lib/types/client/source-identity.d.ts.map +1 -0
- package/lib/types/client/ui-controller.d.ts +6 -0
- package/lib/types/client/ui-controller.d.ts.map +1 -1
- package/lib/types/client/use-arkme-avatar-image.d.ts +3 -0
- package/lib/types/client/use-arkme-avatar-image.d.ts.map +1 -0
- package/lib/types/extensions/manager.d.ts.map +1 -1
- package/lib/types/extensions/types.d.ts +1 -0
- package/lib/types/extensions/types.d.ts.map +1 -1
- package/lib/types/host-api.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/request-coordinator.d.ts.map +1 -1
- package/lib/types/sdk/index.d.ts +7 -2
- package/lib/types/sdk/index.d.ts.map +1 -1
- package/lib/types/services/chat-realtime-service.d.ts.map +1 -1
- package/lib/types/services/chat-service.d.ts +7 -1
- package/lib/types/services/chat-service.d.ts.map +1 -1
- package/lib/types/services/interwoven-service.d.ts +3 -0
- package/lib/types/services/interwoven-service.d.ts.map +1 -1
- package/lib/types/services/related-quick-note-service.d.ts +38 -0
- package/lib/types/services/related-quick-note-service.d.ts.map +1 -0
- package/lib/types/services/world-service.d.ts.map +1 -1
- package/lib/types/types.d.ts +62 -5
- package/lib/types/types.d.ts.map +1 -1
- package/package.json +5 -5
package/lib/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
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-CvojZuTD.js";
|
|
2
|
-
import { $ as ARKME_RUNTIME_INSTANCE_ID, A as inspectNativeBundleArtifactV3, D as bundleSha256, E as arkmeSandboxEntryId, F as assertExtensionArtifactSize, G as validateVoiceprintPcm16Wav, I as canonicalExtensionJson, K as ARKME_DEFAULT_SHARE_WEBSITE, L as sha256Hex, M as packLocalNativeBundleDirectoryV3, N as readNativeBundleTarballV3, O as canonicalBundleJson, P as renderArkmeSandboxHostEntry, Q as ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES, R as unpackArkmeExtension, S as ARKME_BUNDLE_ARTIFACT_KIND, T as ArkmeBundleArtifactError, U as ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE, W as ArkmeService, Z as ARKME_WORLD_PUBLISH_MAX_IMAGES, _ as arkmeClientContentDigest, at as ArkmePluginError, b as verifyExtensionResolutionSignature, c as persistentExtensionBundleDirectory, d as readPersistentExtensionActivation, et as ARKME_TOOL_FILE_MAX_BYTES, f as refreshPersistentClientWrapper, g as activeProfileExtensionOwnerConflicts, h as renderArkmeBundleClientBundle, i as invokePersistentArkmeExtension, it as isArkmeBotAvatarRef, j as packBundleFiles, k as inspectBundleArtifact, l as persistentExtensionPackageIdentity, m as writePersistentExtensionActivation, nt as arkmeNormalizedFileMimeType, o as persistentArkmeExtensionRuntimeState, ot as ArkmeOutgoingCallError, p as repairPersistentExtensionInstallation, q as ARKME_PROVIDER_CONTRACT_VERSION, r as deactivatePersistentArkmeExtension, rt as arkmePickedFileKind, s as materializePersistentExtensionBundle, t as activatePersistentArkmeExtension, tt as arkmeCanInlineLocalFile, u as quarantinePersistentExtension, v as arkmeClientContentDigestFromSource, w as ARKME_NATIVE_BUNDLE_ARTIFACT_KIND, x as verifyNativeBundleResolutionSignature, y as verifyBundleResolutionSignature, z as ARKME_EXTENSION_FORMAT } from "./persistent-runtime-
|
|
2
|
+
import { $ as ARKME_RUNTIME_INSTANCE_ID, A as inspectNativeBundleArtifactV3, D as bundleSha256, E as arkmeSandboxEntryId, F as assertExtensionArtifactSize, G as validateVoiceprintPcm16Wav, I as canonicalExtensionJson, K as ARKME_DEFAULT_SHARE_WEBSITE, L as sha256Hex, M as packLocalNativeBundleDirectoryV3, N as readNativeBundleTarballV3, O as canonicalBundleJson, P as renderArkmeSandboxHostEntry, Q as ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES, R as unpackArkmeExtension, S as ARKME_BUNDLE_ARTIFACT_KIND, T as ArkmeBundleArtifactError, U as ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE, W as ArkmeService, Z as ARKME_WORLD_PUBLISH_MAX_IMAGES, _ as arkmeClientContentDigest, at as ArkmePluginError, b as verifyExtensionResolutionSignature, c as persistentExtensionBundleDirectory, d as readPersistentExtensionActivation, et as ARKME_TOOL_FILE_MAX_BYTES, f as refreshPersistentClientWrapper, g as activeProfileExtensionOwnerConflicts, h as renderArkmeBundleClientBundle, i as invokePersistentArkmeExtension, it as isArkmeBotAvatarRef, j as packBundleFiles, k as inspectBundleArtifact, l as persistentExtensionPackageIdentity, m as writePersistentExtensionActivation, nt as arkmeNormalizedFileMimeType, o as persistentArkmeExtensionRuntimeState, ot as ArkmeOutgoingCallError, p as repairPersistentExtensionInstallation, q as ARKME_PROVIDER_CONTRACT_VERSION, r as deactivatePersistentArkmeExtension, rt as arkmePickedFileKind, s as materializePersistentExtensionBundle, t as activatePersistentArkmeExtension, tt as arkmeCanInlineLocalFile, u as quarantinePersistentExtension, v as arkmeClientContentDigestFromSource, w as ARKME_NATIVE_BUNDLE_ARTIFACT_KIND, x as verifyNativeBundleResolutionSignature, y as verifyBundleResolutionSignature, z as ARKME_EXTENSION_FORMAT } from "./persistent-runtime-e4gV6dqq.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-BByw0ZyG.js";
|
|
4
4
|
import { i as invokeArkmeBundle, n as arkmeBundleActive, r as deactivateArkmeBundle } from "./bundle-runtime-BTzRlc6V.js";
|
|
5
5
|
import { t as ArkmeExtensionInstallStore } from "./install-store-C1tAM346.js";
|
|
@@ -1458,7 +1458,10 @@ function arkmeRequiredLinkMetadataFallback(rawUrl) {
|
|
|
1458
1458
|
}
|
|
1459
1459
|
//#endregion
|
|
1460
1460
|
//#region src/host-api.ts
|
|
1461
|
-
const
|
|
1461
|
+
const MAX_STANDARD_REQUEST_BYTES = 128 * 1024;
|
|
1462
|
+
const MAX_MESSAGE_ACTION_REF_CHARS = 1024 * 1024;
|
|
1463
|
+
const MAX_MESSAGE_REPORT_REF_CHARS = 4096;
|
|
1464
|
+
const MAX_REQUEST_BYTES = 1114112;
|
|
1462
1465
|
function isLoopback$5(address) {
|
|
1463
1466
|
return address === "127.0.0.1" || address === "::1" || address === "::ffff:127.0.0.1";
|
|
1464
1467
|
}
|
|
@@ -1480,6 +1483,7 @@ async function readRequest(req) {
|
|
|
1480
1483
|
if (value === null || typeof value !== "object") throw new ArkmePluginError("request-invalid", "请求格式无效", false);
|
|
1481
1484
|
const source = value;
|
|
1482
1485
|
if (typeof source.operation !== "string") throw new ArkmePluginError("operation-required", "缺少操作类型", false);
|
|
1486
|
+
if (bytes > MAX_STANDARD_REQUEST_BYTES && source.operation !== "source.related-quick-notes.from-message") throw new ArkmePluginError("request-too-large", "请求内容过大", false, 413);
|
|
1483
1487
|
return {
|
|
1484
1488
|
operation: source.operation,
|
|
1485
1489
|
...source.params !== null && typeof source.params === "object" ? { params: source.params } : {}
|
|
@@ -1652,6 +1656,24 @@ function stringListParam(params, key) {
|
|
|
1652
1656
|
function messageActionRefsParam(params) {
|
|
1653
1657
|
return stringListParam(params, "actionRefs").map((value) => value.trim()).filter((value) => value !== "");
|
|
1654
1658
|
}
|
|
1659
|
+
function messageReportParam(params) {
|
|
1660
|
+
const messageRef = stringParam(params, "messageRef").trim();
|
|
1661
|
+
const reportType = numberParam(params, "reportType", 0);
|
|
1662
|
+
const reason = stringParam(params, "reason").trim();
|
|
1663
|
+
const requestUid = stringParam(params, "requestUid").trim().toLowerCase();
|
|
1664
|
+
if (messageRef === "" || messageRef.length > MAX_MESSAGE_REPORT_REF_CHARS || !Number.isInteger(reportType) || ![
|
|
1665
|
+
1,
|
|
1666
|
+
2,
|
|
1667
|
+
3,
|
|
1668
|
+
4
|
|
1669
|
+
].includes(reportType) || reportType === 4 && reason === "" || [...reason].length > 500 || requestUid !== "" && !/^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/.test(requestUid)) throw new ArkmePluginError("message-report-invalid", "举报类型或补充说明无效", false, 400);
|
|
1670
|
+
return {
|
|
1671
|
+
messageRef,
|
|
1672
|
+
reportType,
|
|
1673
|
+
...reason === "" ? {} : { reason },
|
|
1674
|
+
...requestUid === "" ? {} : { requestUid }
|
|
1675
|
+
};
|
|
1676
|
+
}
|
|
1655
1677
|
function aiPolishThreadMessagesParam(params) {
|
|
1656
1678
|
if (!Array.isArray(params.threadMessages)) return [];
|
|
1657
1679
|
return params.threadMessages.slice(-40).flatMap((raw) => {
|
|
@@ -1709,6 +1731,11 @@ function requiredInterwovenParam(params, key) {
|
|
|
1709
1731
|
if (value === "" || value.length > 4096) throw new ArkmePluginError("interwoven-param-invalid", "交织瞬间请求参数无效", false, 400);
|
|
1710
1732
|
return value;
|
|
1711
1733
|
}
|
|
1734
|
+
function requiredRelatedQuickNoteParam(params, key, maxLength = 4096) {
|
|
1735
|
+
const value = stringParam(params, key).trim();
|
|
1736
|
+
if (value === "" || value.length > maxLength) throw new ArkmePluginError("related-quick-note-param-invalid", "相关快记请求参数无效", false, 400);
|
|
1737
|
+
return value;
|
|
1738
|
+
}
|
|
1712
1739
|
function outgoingMediaTypeParam(params) {
|
|
1713
1740
|
const value = stringParam(params, "mediaType");
|
|
1714
1741
|
if (value !== "audio" && value !== "video") throw new ArkmePluginError("call-media-type-invalid", "呼叫媒体类型无效", false);
|
|
@@ -1768,8 +1795,11 @@ function humanMentionsParam(params) {
|
|
|
1768
1795
|
if (value === null || typeof value !== "object" || Array.isArray(value)) throw new ArkmePluginError("human-mention-invalid", "真人 mention 参数无效", false, 400);
|
|
1769
1796
|
const item = value;
|
|
1770
1797
|
const all = item.all === true;
|
|
1798
|
+
const mentionRef = stringParam(item, "mentionRef");
|
|
1799
|
+
const memberRef = stringParam(item, "memberRef");
|
|
1800
|
+
if (all ? mentionRef !== "" || memberRef !== "" : mentionRef === "" || memberRef !== "") throw new ArkmePluginError("human-mention-invalid", "真人 mention 类型与引用不匹配", false, 400);
|
|
1771
1801
|
return {
|
|
1772
|
-
...all ? { all } : {
|
|
1802
|
+
...all ? { all } : { mentionRef },
|
|
1773
1803
|
startIndex: numberParam(item, "startIndex", -1),
|
|
1774
1804
|
length: numberParam(item, "length", 0)
|
|
1775
1805
|
};
|
|
@@ -2274,9 +2304,20 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
|
|
|
2274
2304
|
});
|
|
2275
2305
|
case "source.interwoven-moments": return await service.interwovenMoments(requiredInterwovenParam(params, "sourceRef"));
|
|
2276
2306
|
case "source.interwoven-detail": return await service.interwovenMomentDetail(requiredInterwovenParam(params, "sourceRef"), requiredInterwovenParam(params, "momentRef"));
|
|
2307
|
+
case "source.related-quick-notes.from-message": return await service.relatedQuickNotesFromMessage(requiredRelatedQuickNoteParam(params, "sourceRef"), requiredRelatedQuickNoteParam(params, "messageActionRef", MAX_MESSAGE_ACTION_REF_CHARS), requestSignal);
|
|
2308
|
+
case "source.related-quick-notes.from-moment": return await service.relatedQuickNotesFromMoment(requiredRelatedQuickNoteParam(params, "sourceRef"), requiredRelatedQuickNoteParam(params, "momentRef"), requestSignal);
|
|
2309
|
+
case "source.related-quick-note.detail": return await service.relatedQuickNoteDetail(requiredRelatedQuickNoteParam(params, "sourceRef"), requiredRelatedQuickNoteParam(params, "relatedRef"), requestSignal);
|
|
2277
2310
|
case "source.mark-read": return await service.markSourceRead(stringParam(params, "sourceRef"), numberParam(params, "readSequence", 0));
|
|
2278
2311
|
case "source.read-receipts.summary-list": return await service.messageReadReceiptSummaries(stringParam(params, "sourceRef"), messageReadReceiptItemsParam(params), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
2279
2312
|
case "source.read-receipts.detail": return await service.messageReadReceiptDetail(stringParam(params, "sourceRef"), stringParam(params, "itemUid"), numberParam(params, "sequence", 0), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
2313
|
+
case "source.message-report": {
|
|
2314
|
+
const report = messageReportParam(params);
|
|
2315
|
+
return await service.reportMessage(report.messageRef, report.reportType, {
|
|
2316
|
+
...report.reason === void 0 ? {} : { reason: report.reason },
|
|
2317
|
+
...report.requestUid === void 0 ? {} : { requestUid: report.requestUid },
|
|
2318
|
+
...requestSignal === void 0 ? {} : { signal: requestSignal }
|
|
2319
|
+
});
|
|
2320
|
+
}
|
|
2280
2321
|
case "source.message-copy-link": return await service.copySourceMessageLink(stringParam(params, "sourceRef"), messageActionRefsParam(params), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
2281
2322
|
case "source.message-copy-link.resolve": return await service.resolveMessageCopyLink(stringParam(params, "sid"), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
2282
2323
|
case "source.message-copy-link.extend": return await service.extendMessageCopyLink(stringParam(params, "sid"), numberParam(params, "itemIndex", 0), stringParam(params, "textContent"), stringParam(params, "recordUid"), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
@@ -5511,7 +5552,8 @@ function completedPublishSession(session, fallbackVersion) {
|
|
|
5511
5552
|
return session.status === "published" ? {
|
|
5512
5553
|
extension_id: session.extension_id,
|
|
5513
5554
|
version: session.version ?? fallbackVersion,
|
|
5514
|
-
status: "published"
|
|
5555
|
+
status: "published",
|
|
5556
|
+
...session.share === void 0 ? {} : { share: session.share }
|
|
5515
5557
|
} : void 0;
|
|
5516
5558
|
}
|
|
5517
5559
|
function requireBundleUploadSlots(session) {
|
|
@@ -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-
|
|
1
|
+
import { a as persistentArkmeExtensionActive, i as invokePersistentArkmeExtension, n as applyPersistentArkmeHostExtension, o as persistentArkmeExtensionRuntimeState, r as deactivatePersistentArkmeExtension, t as activatePersistentArkmeExtension } from "./persistent-runtime-e4gV6dqq.js";
|
|
2
2
|
export { activatePersistentArkmeExtension, applyPersistentArkmeHostExtension, deactivatePersistentArkmeExtension, invokePersistentArkmeExtension, persistentArkmeExtensionActive, persistentArkmeExtensionRuntimeState };
|