@senguoyun/dsh-arkme 0.1.33 → 0.1.34
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/lib/client.js +3747 -2608
- package/lib/client.js.map +1 -1
- package/lib/index.js +117 -13
- package/lib/persistent-extension.js +1 -1
- package/lib/{persistent-runtime-DUqdJv8K.js → persistent-runtime-CZQTfyC1.js} +1349 -746
- package/lib/types/arkme-service.d.ts +9 -1
- package/lib/types/arkme-service.d.ts.map +1 -1
- package/lib/types/client/ArkmeMessageSnapshotDialog.d.ts +17 -0
- package/lib/types/client/ArkmeMessageSnapshotDialog.d.ts.map +1 -0
- package/lib/types/client/ArkmeRichComposerInput.d.ts +3 -1
- package/lib/types/client/ArkmeRichComposerInput.d.ts.map +1 -1
- package/lib/types/client/ArkmeSettingsSurface.d.ts.map +1 -1
- package/lib/types/client/ArkmeSidebar.d.ts +1 -1
- package/lib/types/client/ArkmeSidebar.d.ts.map +1 -1
- package/lib/types/client/record-capture-location.d.ts +8 -0
- package/lib/types/client/record-capture-location.d.ts.map +1 -0
- package/lib/types/host-api.d.ts.map +1 -1
- package/lib/types/local-database.d.ts +1 -0
- package/lib/types/local-database.d.ts.map +1 -1
- package/lib/types/services/chat-service.d.ts +14 -1
- package/lib/types/services/chat-service.d.ts.map +1 -1
- package/lib/types/services/group-ai-polish-service.d.ts +3 -1
- package/lib/types/services/group-ai-polish-service.d.ts.map +1 -1
- package/lib/types/services/record-service.d.ts +10 -3
- package/lib/types/services/record-service.d.ts.map +1 -1
- package/lib/types/state-store.d.ts.map +1 -1
- package/lib/types/types.d.ts +50 -1
- 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-CZQTfyC1.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";
|
|
@@ -1517,6 +1517,43 @@ function numberParam(params, key, fallback) {
|
|
|
1517
1517
|
const value = params[key];
|
|
1518
1518
|
return typeof value === "number" && Number.isFinite(value) ? value : fallback;
|
|
1519
1519
|
}
|
|
1520
|
+
function captureContextParam(params) {
|
|
1521
|
+
const raw = params.captureContext;
|
|
1522
|
+
if (raw === void 0) return void 0;
|
|
1523
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) throw new ArkmePluginError("capture-context-invalid", "记忆快照参数无效", false, 400);
|
|
1524
|
+
const value = raw;
|
|
1525
|
+
const clientName = stringParam(value, "clientName").trim().slice(0, 120);
|
|
1526
|
+
const networkName = stringParam(value, "networkName").trim().slice(0, 120);
|
|
1527
|
+
const electric = typeof value.electric === "number" && Number.isFinite(value.electric) ? Math.trunc(value.electric) : void 0;
|
|
1528
|
+
const charge = Math.trunc(numberParam(value, "charge", 0));
|
|
1529
|
+
const context = {
|
|
1530
|
+
...clientName === "" ? {} : { clientName },
|
|
1531
|
+
...networkName === "" ? {} : { networkName },
|
|
1532
|
+
...electric === void 0 || electric < 0 || electric > 100 ? {} : { electric },
|
|
1533
|
+
...charge < 1 || charge > 3 ? {} : { charge }
|
|
1534
|
+
};
|
|
1535
|
+
return Object.keys(context).length === 0 ? void 0 : context;
|
|
1536
|
+
}
|
|
1537
|
+
function recordLocationCaptureParam(params) {
|
|
1538
|
+
const raw = params.location;
|
|
1539
|
+
if (raw === null || typeof raw !== "object" || Array.isArray(raw)) throw new ArkmePluginError("record-location-invalid", "位置快照参数无效", false, 400);
|
|
1540
|
+
const value = raw;
|
|
1541
|
+
const latitude = numberParam(value, "latitude", NaN);
|
|
1542
|
+
const longitude = numberParam(value, "longitude", NaN);
|
|
1543
|
+
if (!Number.isFinite(latitude) || latitude < -90 || latitude > 90 || !Number.isFinite(longitude) || longitude < -180 || longitude > 180) throw new ArkmePluginError("record-location-invalid", "位置坐标无效", false, 400);
|
|
1544
|
+
const altitudeMeters = numberParam(value, "altitudeMeters", NaN);
|
|
1545
|
+
const speedMetersPerSecond = numberParam(value, "speedMetersPerSecond", NaN);
|
|
1546
|
+
const accuracyMeters = numberParam(value, "accuracyMeters", NaN);
|
|
1547
|
+
const capturedAtMillis = Math.trunc(numberParam(value, "capturedAtMillis", 0));
|
|
1548
|
+
return {
|
|
1549
|
+
latitude,
|
|
1550
|
+
longitude,
|
|
1551
|
+
capturedAtMillis: capturedAtMillis > 0 ? capturedAtMillis : Date.now(),
|
|
1552
|
+
...Number.isFinite(accuracyMeters) && accuracyMeters >= 0 ? { accuracyMeters } : {},
|
|
1553
|
+
...Number.isFinite(altitudeMeters) ? { altitudeMeters } : {},
|
|
1554
|
+
...Number.isFinite(speedMetersPerSecond) && speedMetersPerSecond >= 0 ? { speedMetersPerSecond } : {}
|
|
1555
|
+
};
|
|
1556
|
+
}
|
|
1520
1557
|
const ARKME_DIRECTORY_SECTIONS = /* @__PURE__ */ new Set([
|
|
1521
1558
|
"groups",
|
|
1522
1559
|
"bots",
|
|
@@ -1773,6 +1810,8 @@ function botRefsParam(params) {
|
|
|
1773
1810
|
function richSendParam(params) {
|
|
1774
1811
|
const rawAssets = Array.isArray(params.assets) ? params.assets : [];
|
|
1775
1812
|
const thinkingDurationMillis = Math.max(0, Math.trunc(numberParam(params, "thinkingDurationMillis", 0)));
|
|
1813
|
+
const recordDurationMillis = Math.max(0, Math.trunc(numberParam(params, "recordDurationMillis", 0)));
|
|
1814
|
+
const captureContext = captureContextParam(params);
|
|
1776
1815
|
const humanMentions = humanMentionsParam(params);
|
|
1777
1816
|
const botMentions = botMentionsParam(params);
|
|
1778
1817
|
return {
|
|
@@ -1780,6 +1819,8 @@ function richSendParam(params) {
|
|
|
1780
1819
|
textContent: stringParam(params, "textContent"),
|
|
1781
1820
|
displayKind: numberParam(params, "displayKind", 0) === 1 ? 1 : 0,
|
|
1782
1821
|
...thinkingDurationMillis === 0 ? {} : { thinkingDurationMillis },
|
|
1822
|
+
...recordDurationMillis === 0 ? {} : { recordDurationMillis },
|
|
1823
|
+
...captureContext === void 0 ? {} : { captureContext },
|
|
1783
1824
|
...humanMentions.length === 0 ? {} : { humanMentions },
|
|
1784
1825
|
...botMentions.length === 0 ? {} : { botMentions },
|
|
1785
1826
|
assets: rawAssets.flatMap((raw) => {
|
|
@@ -2240,6 +2281,10 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
|
|
|
2240
2281
|
case "source.message-copy-link.resolve": return await service.resolveMessageCopyLink(stringParam(params, "sid"), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
2241
2282
|
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 });
|
|
2242
2283
|
case "source.shared-recording-detail": return await service.sharedRecordingDetail(stringParam(params, "detailRef"), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
2284
|
+
case "source.message-snapshot.detail": return await service.messageSnapshotDetail(stringParam(params, "sourceRef"), stringParam(params, "actionRef"), requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
2285
|
+
case "source.message-location.set":
|
|
2286
|
+
await service.saveMessageLocation(stringParam(params, "sourceRef"), stringParam(params, "itemUid"), recordLocationCaptureParam(params), numberParam(params, "recordVersion", 0) || void 0, requestSignal === void 0 ? {} : { signal: requestSignal });
|
|
2287
|
+
return { ok: true };
|
|
2243
2288
|
case "source.forward-messages": return await service.forwardSourceMessages(stringParam(params, "sourceRef"), messageActionRefsParam(params), {
|
|
2244
2289
|
...stringParam(params, "targetSourceRef") === "" ? {} : { targetSourceRef: stringParam(params, "targetSourceRef") },
|
|
2245
2290
|
...stringParam(params, "recordUid") === "" ? {} : { recordUid: stringParam(params, "recordUid") },
|
|
@@ -2251,9 +2296,12 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
|
|
|
2251
2296
|
const botRefs = botRefsParam(params);
|
|
2252
2297
|
const humanMentions = humanMentionsParam(params);
|
|
2253
2298
|
const botMentions = botMentionsParam(params);
|
|
2299
|
+
const captureContext = captureContextParam(params);
|
|
2254
2300
|
return await service.sendSourceText(stringParam(params, "sourceRef"), stringParam(params, "textContent"), {
|
|
2255
2301
|
...stringParam(params, "recordUid") === "" ? {} : { recordUid: stringParam(params, "recordUid") },
|
|
2256
2302
|
...stringParam(params, "relationUid") === "" ? {} : { relationUid: stringParam(params, "relationUid") },
|
|
2303
|
+
...numberParam(params, "recordDurationMillis", 0) <= 0 ? {} : { recordDurationMillis: Math.max(0, Math.trunc(numberParam(params, "recordDurationMillis", 0))) },
|
|
2304
|
+
...captureContext === void 0 ? {} : { captureContext },
|
|
2257
2305
|
...booleanParam(params, "agentAuthored") ? { agentAuthored: true } : {},
|
|
2258
2306
|
...botRefs.length === 0 ? {} : { botRefs },
|
|
2259
2307
|
...humanMentions.length === 0 ? {} : { humanMentions },
|
|
@@ -3753,6 +3801,8 @@ var ArkmeLocalDatabase = class {
|
|
|
3753
3801
|
sync_state TEXT NOT NULL CHECK (sync_state IN ('synced', 'pending', 'failed')),
|
|
3754
3802
|
attempts INTEGER NOT NULL DEFAULT 0,
|
|
3755
3803
|
last_error TEXT,
|
|
3804
|
+
record_duration_millis INTEGER NOT NULL DEFAULT 0,
|
|
3805
|
+
capture_context_json TEXT,
|
|
3756
3806
|
created_at_millis INTEGER NOT NULL,
|
|
3757
3807
|
updated_at_millis INTEGER NOT NULL,
|
|
3758
3808
|
PRIMARY KEY (user_id, record_uid)
|
|
@@ -3806,6 +3856,9 @@ var ArkmeLocalDatabase = class {
|
|
|
3806
3856
|
CREATE UNIQUE INDEX IF NOT EXISTS extension_review_outbox_user_record
|
|
3807
3857
|
ON extension_review_outbox (user_id, record_uid);
|
|
3808
3858
|
`);
|
|
3859
|
+
const recordColumns = this.database.prepare("PRAGMA table_info(record_cache)").all();
|
|
3860
|
+
if (!recordColumns.some((column) => column.name === "record_duration_millis")) this.database.exec("ALTER TABLE record_cache ADD COLUMN record_duration_millis INTEGER NOT NULL DEFAULT 0");
|
|
3861
|
+
if (!recordColumns.some((column) => column.name === "capture_context_json")) this.database.exec("ALTER TABLE record_cache ADD COLUMN capture_context_json TEXT");
|
|
3809
3862
|
const metaColumns = this.database.prepare("PRAGMA table_info(cache_meta)").all();
|
|
3810
3863
|
if (!metaColumns.some((column) => column.name === "pagination_initialized")) this.database.exec("ALTER TABLE cache_meta ADD COLUMN pagination_initialized INTEGER NOT NULL DEFAULT 0");
|
|
3811
3864
|
if (!metaColumns.some((column) => column.name === "revision")) this.database.exec("ALTER TABLE cache_meta ADD COLUMN revision INTEGER NOT NULL DEFAULT 0");
|
|
@@ -3964,18 +4017,25 @@ var ArkmeLocalDatabase = class {
|
|
|
3964
4017
|
async listPending(userId) {
|
|
3965
4018
|
await this.ensureMigrated(userId);
|
|
3966
4019
|
return this.database.prepare(`
|
|
3967
|
-
SELECT record_uid, text_content, created_at_millis, send_at_millis, attempts, last_error
|
|
4020
|
+
SELECT record_uid, text_content, created_at_millis, send_at_millis, attempts, last_error,
|
|
4021
|
+
record_duration_millis, capture_context_json
|
|
3968
4022
|
FROM record_cache
|
|
3969
4023
|
WHERE user_id = ? AND sync_state IN ('pending', 'failed')
|
|
3970
4024
|
ORDER BY created_at_millis ASC, record_uid ASC
|
|
3971
|
-
`).all(userId).map((row) =>
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
4025
|
+
`).all(userId).map((row) => {
|
|
4026
|
+
const captureContext = this.pendingCaptureContext(row.capture_context_json);
|
|
4027
|
+
const recordDurationMillis = Math.max(0, Math.trunc(row.record_duration_millis ?? 0));
|
|
4028
|
+
return {
|
|
4029
|
+
recordUid: row.record_uid,
|
|
4030
|
+
textContent: row.text_content,
|
|
4031
|
+
createdAtMillis: row.created_at_millis,
|
|
4032
|
+
sendAtMillis: row.send_at_millis,
|
|
4033
|
+
attempts: row.attempts,
|
|
4034
|
+
...recordDurationMillis === 0 ? {} : { recordDurationMillis },
|
|
4035
|
+
...captureContext === void 0 ? {} : { captureContext },
|
|
4036
|
+
...row.last_error == null || row.last_error === "" ? {} : { lastError: row.last_error }
|
|
4037
|
+
};
|
|
4038
|
+
});
|
|
3979
4039
|
}
|
|
3980
4040
|
async putPending(userId, pending) {
|
|
3981
4041
|
await this.ensureMigrated(userId);
|
|
@@ -4111,12 +4171,14 @@ var ArkmeLocalDatabase = class {
|
|
|
4111
4171
|
}
|
|
4112
4172
|
insertPending(userId, pending) {
|
|
4113
4173
|
const now = Date.now();
|
|
4174
|
+
const recordDurationMillis = Math.max(0, Math.trunc(pending.recordDurationMillis ?? 0));
|
|
4175
|
+
const captureContextJson = pending.captureContext === void 0 ? null : JSON.stringify(pending.captureContext);
|
|
4114
4176
|
this.database.prepare(`
|
|
4115
4177
|
INSERT INTO record_cache (
|
|
4116
4178
|
user_id, record_uid, send_at_millis, title, text_content, template_kind,
|
|
4117
4179
|
status, version, sync_state, attempts, last_error,
|
|
4118
|
-
created_at_millis, updated_at_millis
|
|
4119
|
-
) VALUES (?, ?, ?, '', ?, 1, 0, 0, 'pending', ?, ?, ?, ?)
|
|
4180
|
+
record_duration_millis, capture_context_json, created_at_millis, updated_at_millis
|
|
4181
|
+
) VALUES (?, ?, ?, '', ?, 1, 0, 0, 'pending', ?, ?, ?, ?, ?, ?)
|
|
4120
4182
|
ON CONFLICT(user_id, record_uid) DO UPDATE SET
|
|
4121
4183
|
send_at_millis = excluded.send_at_millis,
|
|
4122
4184
|
text_content = excluded.text_content,
|
|
@@ -4124,8 +4186,31 @@ var ArkmeLocalDatabase = class {
|
|
|
4124
4186
|
sync_state = 'pending',
|
|
4125
4187
|
attempts = excluded.attempts,
|
|
4126
4188
|
last_error = excluded.last_error,
|
|
4189
|
+
record_duration_millis = excluded.record_duration_millis,
|
|
4190
|
+
capture_context_json = excluded.capture_context_json,
|
|
4127
4191
|
updated_at_millis = excluded.updated_at_millis
|
|
4128
|
-
`).run(userId, pending.recordUid, pending.sendAtMillis, pending.textContent, pending.attempts, pending.lastError ?? null, pending.createdAtMillis, now);
|
|
4192
|
+
`).run(userId, pending.recordUid, pending.sendAtMillis, pending.textContent, pending.attempts, pending.lastError ?? null, recordDurationMillis, captureContextJson, pending.createdAtMillis, now);
|
|
4193
|
+
}
|
|
4194
|
+
pendingCaptureContext(raw) {
|
|
4195
|
+
if (raw == null || raw === "") return void 0;
|
|
4196
|
+
try {
|
|
4197
|
+
const value = JSON.parse(raw);
|
|
4198
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
4199
|
+
const source = value;
|
|
4200
|
+
const clientName = typeof source.clientName === "string" ? source.clientName.trim().slice(0, 120) : "";
|
|
4201
|
+
const networkName = typeof source.networkName === "string" ? source.networkName.trim().slice(0, 120) : "";
|
|
4202
|
+
const electric = typeof source.electric === "number" && Number.isFinite(source.electric) ? Math.trunc(source.electric) : void 0;
|
|
4203
|
+
const charge = typeof source.charge === "number" && Number.isFinite(source.charge) ? Math.trunc(source.charge) : 0;
|
|
4204
|
+
const result = {
|
|
4205
|
+
...clientName === "" ? {} : { clientName },
|
|
4206
|
+
...networkName === "" ? {} : { networkName },
|
|
4207
|
+
...electric === void 0 || electric < 0 || electric > 100 ? {} : { electric },
|
|
4208
|
+
...charge < 1 || charge > 3 ? {} : { charge }
|
|
4209
|
+
};
|
|
4210
|
+
return Object.keys(result).length === 0 ? void 0 : result;
|
|
4211
|
+
} catch {
|
|
4212
|
+
return;
|
|
4213
|
+
}
|
|
4129
4214
|
}
|
|
4130
4215
|
upsertSyncedRecord(userId, item) {
|
|
4131
4216
|
const now = Date.now();
|
|
@@ -9020,6 +9105,21 @@ function normalizedLongArticleDraft(value) {
|
|
|
9020
9105
|
function longArticleDraftKey(sourceRef, itemUid) {
|
|
9021
9106
|
return `${sourceRef}\u0000${itemUid ?? ""}`;
|
|
9022
9107
|
}
|
|
9108
|
+
function normalizedCaptureContext(value) {
|
|
9109
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
9110
|
+
const source = value;
|
|
9111
|
+
const clientName = typeof source.clientName === "string" ? source.clientName.trim().slice(0, 120) : "";
|
|
9112
|
+
const networkName = typeof source.networkName === "string" ? source.networkName.trim().slice(0, 120) : "";
|
|
9113
|
+
const electric = typeof source.electric === "number" && Number.isFinite(source.electric) ? Math.trunc(source.electric) : void 0;
|
|
9114
|
+
const charge = typeof source.charge === "number" && Number.isFinite(source.charge) ? Math.trunc(source.charge) : 0;
|
|
9115
|
+
const result = {
|
|
9116
|
+
...clientName === "" ? {} : { clientName },
|
|
9117
|
+
...networkName === "" ? {} : { networkName },
|
|
9118
|
+
...electric === void 0 || electric < 0 || electric > 100 ? {} : { electric },
|
|
9119
|
+
...charge < 1 || charge > 3 ? {} : { charge }
|
|
9120
|
+
};
|
|
9121
|
+
return Object.keys(result).length === 0 ? void 0 : result;
|
|
9122
|
+
}
|
|
9023
9123
|
function normalizedPending(value) {
|
|
9024
9124
|
if (!Array.isArray(value)) return [];
|
|
9025
9125
|
const result = [];
|
|
@@ -9028,12 +9128,16 @@ function normalizedPending(value) {
|
|
|
9028
9128
|
const source = item;
|
|
9029
9129
|
if (typeof source.recordUid !== "string" || source.recordUid.trim() === "") continue;
|
|
9030
9130
|
if (typeof source.textContent !== "string" || source.textContent.trim() === "") continue;
|
|
9131
|
+
const recordDurationMillis = typeof source.recordDurationMillis === "number" && Number.isFinite(source.recordDurationMillis) ? Math.max(0, Math.trunc(source.recordDurationMillis)) : 0;
|
|
9132
|
+
const captureContext = normalizedCaptureContext(source.captureContext);
|
|
9031
9133
|
result.push({
|
|
9032
9134
|
recordUid: source.recordUid,
|
|
9033
9135
|
textContent: source.textContent,
|
|
9034
9136
|
createdAtMillis: typeof source.createdAtMillis === "number" ? source.createdAtMillis : 0,
|
|
9035
9137
|
sendAtMillis: typeof source.sendAtMillis === "number" ? source.sendAtMillis : 0,
|
|
9036
9138
|
attempts: typeof source.attempts === "number" ? source.attempts : 0,
|
|
9139
|
+
...recordDurationMillis === 0 ? {} : { recordDurationMillis },
|
|
9140
|
+
...captureContext === void 0 ? {} : { captureContext },
|
|
9037
9141
|
...typeof source.lastError === "string" && source.lastError !== "" ? { lastError: source.lastError } : {}
|
|
9038
9142
|
});
|
|
9039
9143
|
}
|
|
@@ -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-CZQTfyC1.js";
|
|
2
2
|
export { activatePersistentArkmeExtension, applyPersistentArkmeHostExtension, deactivatePersistentArkmeExtension, invokePersistentArkmeExtension, persistentArkmeExtensionActive, persistentArkmeExtensionRuntimeState };
|