@senguoyun/dsh-arkme 0.1.25 → 0.1.27

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 (33) hide show
  1. package/lib/client.js +4170 -2744
  2. package/lib/client.js.map +1 -1
  3. package/lib/index.js +30 -1
  4. package/lib/persistent-extension.js +1 -1
  5. package/lib/{persistent-runtime-NuR8Mqae.js → persistent-runtime-DGgyCDGU.js} +316 -19
  6. package/lib/types/arkme-service.d.ts +31 -1
  7. package/lib/types/arkme-service.d.ts.map +1 -1
  8. package/lib/types/client/ArkmeBotConversationSurface.d.ts +7 -0
  9. package/lib/types/client/ArkmeBotConversationSurface.d.ts.map +1 -0
  10. package/lib/types/client/ArkmeBotCreateDialog.d.ts +2 -0
  11. package/lib/types/client/ArkmeBotCreateDialog.d.ts.map +1 -1
  12. package/lib/types/client/ArkmeBotSettingsPanel.d.ts +8 -0
  13. package/lib/types/client/ArkmeBotSettingsPanel.d.ts.map +1 -0
  14. package/lib/types/client/ArkmeRecordingSurface.d.ts +1 -8
  15. package/lib/types/client/ArkmeRecordingSurface.d.ts.map +1 -1
  16. package/lib/types/client/ArkmeSidebar.d.ts.map +1 -1
  17. package/lib/types/client/ArkmeVirtualWorkspace.d.ts +4 -1
  18. package/lib/types/client/ArkmeVirtualWorkspace.d.ts.map +1 -1
  19. package/lib/types/client/api.d.ts +1 -1
  20. package/lib/types/client/api.d.ts.map +1 -1
  21. package/lib/types/client/ui-controller.d.ts +6 -3
  22. package/lib/types/client/ui-controller.d.ts.map +1 -1
  23. package/lib/types/host-api.d.ts.map +1 -1
  24. package/lib/types/index.d.ts.map +1 -1
  25. package/lib/types/recording-presentation.d.ts +4 -1
  26. package/lib/types/recording-presentation.d.ts.map +1 -1
  27. package/lib/types/services/bot-service.d.ts +40 -1
  28. package/lib/types/services/bot-service.d.ts.map +1 -1
  29. package/lib/types/services/recording-service.d.ts +9 -1
  30. package/lib/types/services/recording-service.d.ts.map +1 -1
  31. package/lib/types/types.d.ts +55 -1
  32. package/lib/types/types.d.ts.map +1 -1
  33. 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 { A as readNativeBundleTarballV3, B as ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE, C as arkmeSandboxEntryId, D as inspectNativeBundleArtifactV3, E as inspectBundleArtifact, F as unpackArkmeExtension, H as validateVoiceprintPcm16Wav, I as ARKME_EXTENSION_FORMAT, J as ARKME_WORLD_PUBLISH_MAX_IMAGES, M as assertExtensionArtifactSize, N as canonicalExtensionJson, O as packBundleFiles, P as sha256Hex, Q as ArkmeOutgoingCallError, S as ArkmeBundleArtifactError, T as canonicalBundleJson, U as ARKME_DEFAULT_SHARE_WEBSITE, V as ArkmeService, W as ARKME_PROVIDER_CONTRACT_VERSION, X as isArkmeBotAvatarRef, Y as ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES, Z as ArkmePluginError, _ as verifyExtensionResolutionSignature, c as quarantinePersistentExtension, d as writePersistentExtensionActivation, f as renderArkmeBundleClientBundle, g as verifyBundleResolutionSignature, h as arkmeClientContentDigestFromSource, i as invokePersistentArkmeExtension, j as renderArkmeSandboxHostEntry, k as packLocalNativeBundleDirectoryV3, l as readPersistentExtensionActivation, m as arkmeClientContentDigest, o as persistentArkmeExtensionRuntimeState, p as activeProfileExtensionOwnerConflicts, r as deactivatePersistentArkmeExtension, s as materializePersistentExtensionBundle, t as activatePersistentArkmeExtension, u as refreshPersistentClientWrapper, v as verifyNativeBundleResolutionSignature, w as bundleSha256, x as ARKME_NATIVE_BUNDLE_ARTIFACT_KIND, y as ARKME_BUNDLE_ARTIFACT_KIND } from "./persistent-runtime-NuR8Mqae.js";
2
+ import { A as readNativeBundleTarballV3, B as ARKME_EXTENSION_RUNTIME_UNAVAILABLE_MESSAGE, C as arkmeSandboxEntryId, D as inspectNativeBundleArtifactV3, E as inspectBundleArtifact, F as unpackArkmeExtension, H as validateVoiceprintPcm16Wav, I as ARKME_EXTENSION_FORMAT, J as ARKME_WORLD_PUBLISH_MAX_IMAGES, M as assertExtensionArtifactSize, N as canonicalExtensionJson, O as packBundleFiles, P as sha256Hex, Q as ArkmeOutgoingCallError, S as ArkmeBundleArtifactError, T as canonicalBundleJson, U as ARKME_DEFAULT_SHARE_WEBSITE, V as ArkmeService, W as ARKME_PROVIDER_CONTRACT_VERSION, X as isArkmeBotAvatarRef, Y as ARKME_WORLD_PUBLISH_MAX_IMAGE_BYTES, Z as ArkmePluginError, _ as verifyExtensionResolutionSignature, c as quarantinePersistentExtension, d as writePersistentExtensionActivation, f as renderArkmeBundleClientBundle, g as verifyBundleResolutionSignature, h as arkmeClientContentDigestFromSource, i as invokePersistentArkmeExtension, j as renderArkmeSandboxHostEntry, k as packLocalNativeBundleDirectoryV3, l as readPersistentExtensionActivation, m as arkmeClientContentDigest, o as persistentArkmeExtensionRuntimeState, p as activeProfileExtensionOwnerConflicts, r as deactivatePersistentArkmeExtension, s as materializePersistentExtensionBundle, t as activatePersistentArkmeExtension, u as refreshPersistentClientWrapper, v as verifyNativeBundleResolutionSignature, w as bundleSha256, x as ARKME_NATIVE_BUNDLE_ARTIFACT_KIND, y as ARKME_BUNDLE_ARTIFACT_KIND } from "./persistent-runtime-DGgyCDGU.js";
3
3
  import { _ as validatePluginUpdateArtifactOrigin, d as ARKME_PLUGIN_PACKAGE_NAME, f as PluginUpdateArtifactError, g as pluginUpdateEndpointUrl, h as parsePluginUpdateManifest, m as existingCachedPluginArtifactPath, n as buildTargetInstallArgs, o as reconcilePluginUpdaterProfilePolicy, p as downloadAndCachePluginArtifact, t as assertTargetArtifactIntegrity, u as PluginUpdateInstallStateStore, v as validatePluginUpdateServiceOrigin } from "./plugin-updater-helper-Lmz7W2ph.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";
@@ -1717,6 +1717,25 @@ function createArkmeHostApi(service, options) {
1717
1717
  }
1718
1718
  };
1719
1719
  }
1720
+ function botManageUpdateInputParam(params) {
1721
+ const rawSecurity = params.webhookSecurity;
1722
+ const security = rawSecurity !== null && typeof rawSecurity === "object" && !Array.isArray(rawSecurity) ? rawSecurity : void 0;
1723
+ const avatar = botAvatarParam(params);
1724
+ const mentionEntryEnabled = typeof params.mentionEntryEnabled === "boolean" ? params.mentionEntryEnabled : void 0;
1725
+ return {
1726
+ name: stringParam(params, "name"),
1727
+ description: stringParam(params, "description"),
1728
+ ...avatar === "" ? {} : { avatar },
1729
+ ...mentionEntryEnabled === void 0 ? {} : { mentionEntryEnabled },
1730
+ ...security === void 0 ? {} : { webhookSecurity: {
1731
+ keywordEnabled: security.keywordEnabled === true,
1732
+ keyword: stringParam(security, "keyword"),
1733
+ tokenEnabled: security.tokenEnabled === true,
1734
+ ipWhitelistEnabled: security.ipWhitelistEnabled === true,
1735
+ ipWhitelist: Array.isArray(security.ipWhitelist) ? security.ipWhitelist.filter((item) => typeof item === "string").map((item) => item.trim()).filter((item) => item !== "").slice(0, 100) : []
1736
+ } }
1737
+ };
1738
+ }
1720
1739
  async function dispatchArkmeHostOperation(service, operation, params, updateManager, extensionManager, extensionInstallTasks, ownedExtensionInventory, requestSignal) {
1721
1740
  switch (operation) {
1722
1741
  case "provider.capabilities": return service.providerCapabilities();
@@ -1798,6 +1817,15 @@ async function dispatchArkmeHostOperation(service, operation, params, updateMana
1798
1817
  });
1799
1818
  }
1800
1819
  case "bots.list": return await service.listBots(requestSignal === void 0 ? {} : { signal: requestSignal });
1820
+ case "bots.manage.profile": return await service.manageBotProfile(stringParam(params, "botRef").trim(), requestSignal === void 0 ? {} : { signal: requestSignal });
1821
+ case "bots.manage.update": return await service.updateManagedBot(stringParam(params, "botRef").trim(), botManageUpdateInputParam(params), requestSignal === void 0 ? {} : { signal: requestSignal });
1822
+ case "bots.manage.reveal-token": return await service.revealManagedBotToken(stringParam(params, "botRef").trim(), requestSignal === void 0 ? {} : { signal: requestSignal });
1823
+ case "bots.manage.delete": return await service.deleteManagedBot(stringParam(params, "botRef").trim(), stringParam(params, "confirmationName"), requestSignal === void 0 ? {} : { signal: requestSignal });
1824
+ case "bots.private-chat.notification.status": return await service.botNotificationPreference(stringParam(params, "botRef").trim(), requestSignal === void 0 ? {} : { signal: requestSignal });
1825
+ case "bots.private-chat.notification.update": return await service.updateBotNotificationPreference(stringParam(params, "botRef").trim(), booleanParam(params, "muted"), requestSignal === void 0 ? {} : { signal: requestSignal });
1826
+ case "bots.private-chat.open": return await service.openBotPrivateChat(stringParam(params, "botRef").trim(), requestSignal === void 0 ? {} : { signal: requestSignal });
1827
+ case "bots.private-chat.directory": return await service.listBotPrivateChatDirectory(requestSignal === void 0 ? {} : { signal: requestSignal });
1828
+ case "bots.private-chat.send": return await service.sendBotPrivateChatMessage(stringParam(params, "botRef").trim(), stringParam(params, "content"), requestSignal === void 0 ? {} : { signal: requestSignal });
1801
1829
  case "recordings.calendar": return await service.recordingCalendar(numberParam(params, "fromStamp", 0), numberParam(params, "toStamp", 0));
1802
1830
  case "recordings.day": return await service.recordingDay(numberParam(params, "dateStamp", 0));
1803
1831
  case "calendar.buckets": return await service.calendarBuckets({
@@ -14215,6 +14243,7 @@ function validateConfig(ctx, config) {
14215
14243
  if (config.environment === "prod") {
14216
14244
  if ([
14217
14245
  config.authBaseUrl,
14246
+ config.subjectBaseUrl,
14218
14247
  config.recordBaseUrl,
14219
14248
  config.dataBaseUrl,
14220
14249
  config.chatBaseUrl,
@@ -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-NuR8Mqae.js";
1
+ import { a as persistentArkmeExtensionActive, i as invokePersistentArkmeExtension, n as applyPersistentArkmeHostExtension, o as persistentArkmeExtensionRuntimeState, r as deactivatePersistentArkmeExtension, t as activatePersistentArkmeExtension } from "./persistent-runtime-DGgyCDGU.js";
2
2
  export { activatePersistentArkmeExtension, applyPersistentArkmeHostExtension, deactivatePersistentArkmeExtension, invokePersistentArkmeExtension, persistentArkmeExtensionActive, persistentArkmeExtensionRuntimeState };
@@ -4224,6 +4224,93 @@ function arkmeNormalizeBotProvider(value) {
4224
4224
  const normalized = stringValue$1(value).trim().toLowerCase();
4225
4225
  if (normalized === "openclaw" || normalized === "webhook") return normalized;
4226
4226
  }
4227
+ const BOT_CHAT_SESSION_UID_KEYS = [
4228
+ "chat_session_uid",
4229
+ "chatSessionUid",
4230
+ "direct_chat_session_uid",
4231
+ "directChatSessionUid",
4232
+ "private_chat_session_uid",
4233
+ "privateChatSessionUid"
4234
+ ];
4235
+ /** Read the standard-session aliases accepted by the Flutter desktop client. */
4236
+ function botChatSessionUid(data) {
4237
+ const read = (value, allowUid = false) => {
4238
+ for (const key of BOT_CHAT_SESSION_UID_KEYS) {
4239
+ const candidate = stringValue$1(value[key]).trim();
4240
+ if (candidate !== "" && candidate !== "null") return candidate;
4241
+ }
4242
+ const uid = allowUid ? stringValue$1(value.uid).trim() : "";
4243
+ return uid !== "" && uid !== "null" ? uid : void 0;
4244
+ };
4245
+ const direct = read(data);
4246
+ if (direct !== void 0) return direct;
4247
+ for (const key of [
4248
+ "chat_session",
4249
+ "direct_chat_session",
4250
+ "private_chat_session"
4251
+ ]) {
4252
+ const nested = read(objectValue$1(data[key]), true);
4253
+ if (nested !== void 0) return nested;
4254
+ }
4255
+ }
4256
+ /**
4257
+ * Flutter accepts the legacy `session_id` returned by the Bot endpoint only
4258
+ * after proving it resolves to a chat session. Keep the same guard here: a
4259
+ * bot id (or a raw Bot topic id) must never become a generic chat source.
4260
+ */
4261
+ function legacyBotChatSessionCandidate(value, botId) {
4262
+ const candidate = stringValue$1(value).trim();
4263
+ if (candidate === "" || candidate === botId) return void 0;
4264
+ if (candidate.includes("_bot") && !candidate.startsWith("chat_session_")) return void 0;
4265
+ return candidate;
4266
+ }
4267
+ function botPrivateChatTimestamp(value) {
4268
+ const numeric = numberValue$19(value);
4269
+ if (numeric <= 0) return 0;
4270
+ if (numeric < 1e10) return numeric * 1e3;
4271
+ let millis = numeric;
4272
+ while (millis >= 0x5af3107a4000) millis = Math.trunc(millis / 1e3);
4273
+ return millis;
4274
+ }
4275
+ function botWebhookSecurity(value) {
4276
+ const raw = objectValue$1(value);
4277
+ return {
4278
+ keywordEnabled: booleanValue$10(raw.keyword_enabled),
4279
+ keyword: stringValue$1(raw.keyword).trim(),
4280
+ tokenEnabled: booleanValue$10(raw.token_enabled ?? raw.signature_enabled),
4281
+ ipWhitelistEnabled: booleanValue$10(raw.ip_whitelist_enabled),
4282
+ ipWhitelist: listValue$20(raw.ip_whitelist).map((item) => stringValue$1(item).trim()).filter((item) => item !== "").slice(0, 100)
4283
+ };
4284
+ }
4285
+ function botProfileSource(data) {
4286
+ const bot = objectValue$1(data.bot);
4287
+ return Object.keys(bot).length === 0 ? data : bot;
4288
+ }
4289
+ function botProfileSubjectUid(data) {
4290
+ const bot = botProfileSource(data);
4291
+ return stringValue$1(bot.subject_uid ?? bot.topic_uid ?? data.subject_uid ?? data.topic_uid).trim();
4292
+ }
4293
+ function botPrivateChatMessage(value, fallbackContent = "") {
4294
+ const raw = objectValue$1(value);
4295
+ return {
4296
+ role: stringValue$1(raw.role).trim().toLowerCase() === "user" ? "user" : "assistant",
4297
+ content: stringValue$1(raw.content).trim() || fallbackContent,
4298
+ status: stringValue$1(raw.status).trim() || "sent",
4299
+ createdAtMillis: botPrivateChatTimestamp(raw.created_at ?? raw.createdAt)
4300
+ };
4301
+ }
4302
+ function botWithPrivateChatActivity(bot, messages) {
4303
+ const latest = messages.reduce((current, message) => {
4304
+ if (current === void 0 || message.createdAtMillis >= current.createdAtMillis) return message;
4305
+ return current;
4306
+ }, void 0);
4307
+ if (latest === void 0) return bot;
4308
+ return {
4309
+ ...bot,
4310
+ ...latest.createdAtMillis > 0 ? { latestMessageAtMillis: latest.createdAtMillis } : {},
4311
+ ...latest.content === "" ? {} : { latestMessagePreview: latest.content }
4312
+ };
4313
+ }
4227
4314
  var BotService = class {
4228
4315
  runtime;
4229
4316
  source;
@@ -4328,22 +4415,141 @@ var BotService = class {
4328
4415
  if (!token.startsWith("jbot_")) throw new ArkmePluginError("bot-token-contract-invalid", "Bot 凭据响应无效", false, 502);
4329
4416
  return new SecretValue(token);
4330
4417
  }
4418
+ async manageBotProfile(botRef, options = {}) {
4419
+ const session = await this.runtime.requireSession();
4420
+ const reference = await this.openBotRef(botRef, session.userId);
4421
+ const data = await this.runtime.authenticatedBotPost("/api/v1/bot/profile", { bot_id: reference.botId }, session, options.signal);
4422
+ return await this.botManageProfileFromData(data, session.userId);
4423
+ }
4424
+ async updateManagedBot(botRef, input, options = {}) {
4425
+ const name = input.name.trim();
4426
+ const description = input.description.trim();
4427
+ if (name === "" || [...name].length > 50) throw new ArkmePluginError("bot-name-invalid", "Bot 名称需为 1-50 个字符", false, 400);
4428
+ if ([...description].length > 200) throw new ArkmePluginError("bot-description-invalid", "Bot 简介不能超过 200 个字符", false, 400);
4429
+ if (input.avatar !== void 0 && !isArkmeBotAvatarRef(input.avatar)) throw new ArkmePluginError("bot-avatar-invalid", "Bot 头像引用无效", false, 400);
4430
+ const session = await this.runtime.requireSession();
4431
+ const reference = await this.openBotRef(botRef, session.userId);
4432
+ const current = botProfileSource(await this.runtime.authenticatedBotPost("/api/v1/bot/profile", { bot_id: reference.botId }, session, options.signal));
4433
+ const provider = arkmeNormalizeBotProvider(current.provider);
4434
+ if (provider === void 0) throw new ArkmePluginError("bot-contract-invalid", "Bot 配置响应不完整", true, 502);
4435
+ const security = input.webhookSecurity;
4436
+ if (security !== void 0 && provider !== "webhook") throw new ArkmePluginError("bot-webhook-security-invalid", "仅 Webhook Bot 支持安全设置", false, 400);
4437
+ await this.runtime.authenticatedBotPost("/api/v1/bot/update", {
4438
+ bot_id: reference.botId,
4439
+ name,
4440
+ description,
4441
+ avatar: input.avatar ?? stringValue$1(current.avatar).trim(),
4442
+ ...input.mentionEntryEnabled === void 0 ? {} : { mention_entry_enabled: input.mentionEntryEnabled },
4443
+ ...security === void 0 ? {} : { webhook_security: {
4444
+ keyword_enabled: security.keywordEnabled,
4445
+ keyword: security.keyword.trim(),
4446
+ token_enabled: security.tokenEnabled,
4447
+ ip_whitelist_enabled: security.ipWhitelistEnabled,
4448
+ ip_whitelist: security.ipWhitelist.map((item) => item.trim()).filter((item) => item !== "").slice(0, 100)
4449
+ } }
4450
+ }, session, options.signal);
4451
+ const refreshed = await this.runtime.authenticatedBotPost("/api/v1/bot/profile", { bot_id: reference.botId }, session, options.signal);
4452
+ return await this.botManageProfileFromData(refreshed, session.userId);
4453
+ }
4454
+ async revealManagedBotToken(botRef, options = {}) {
4455
+ return { token: (await this.revealBotSecret(botRef, options)).reveal() };
4456
+ }
4457
+ async deleteManagedBot(botRef, confirmationName, options = {}) {
4458
+ const session = await this.runtime.requireSession();
4459
+ const reference = await this.openBotRef(botRef, session.userId);
4460
+ const data = await this.runtime.authenticatedBotPost("/api/v1/bot/profile", { bot_id: reference.botId }, session, options.signal);
4461
+ if (confirmationName.trim() !== stringValue$1(botProfileSource(data).name).trim()) throw new ArkmePluginError("bot-delete-confirmation-invalid", "请输入完整 Bot 名称以确认删除", false, 400);
4462
+ await this.runtime.authenticatedBotPost("/api/v1/bot/delete", { bot_id: reference.botId }, session, options.signal);
4463
+ this.deleteBotRef(botRef);
4464
+ }
4465
+ async botNotificationPreference(botRef, options = {}) {
4466
+ const { session, subjectUid } = await this.botNotificationTarget(botRef, options);
4467
+ return { muted: (await this.runtime.authenticatedSubjectPost("/api/v1/subject/get-able-push-status", { subject_uid: subjectUid }, session, options.signal)).able_push === false };
4468
+ }
4469
+ async updateBotNotificationPreference(botRef, muted, options = {}) {
4470
+ const { session, subjectUid } = await this.botNotificationTarget(botRef, options);
4471
+ await this.runtime.authenticatedSubjectPost("/api/v1/subject/set-able-push-status", {
4472
+ subject_uid: subjectUid,
4473
+ able_push: !muted
4474
+ }, session, options.signal);
4475
+ return { muted };
4476
+ }
4477
+ async botNotificationTarget(botRef, options = {}) {
4478
+ const session = await this.runtime.requireSession();
4479
+ const reference = await this.openBotRef(botRef, session.userId);
4480
+ const subjectUid = botProfileSubjectUid(await this.runtime.authenticatedBotPost("/api/v1/bot/profile", { bot_id: reference.botId }, session, options.signal));
4481
+ if (subjectUid === "") throw new ArkmePluginError("bot-notification-unavailable", "当前 Bot 未返回可用私聊通知标识", false, 409);
4482
+ return {
4483
+ session,
4484
+ subjectUid
4485
+ };
4486
+ }
4487
+ async openBotPrivateChat(botRef, options = {}) {
4488
+ const session = await this.runtime.requireSession();
4489
+ const bot = (await this.listBots(options)).items.find((item) => item.botRef === botRef);
4490
+ if (bot === void 0) throw new ArkmePluginError("bot-ref-not-owned", "当前账号不存在该 Bot", false, 404);
4491
+ return await this.openBotPrivateChatForSummary(bot, session, options.signal);
4492
+ }
4493
+ async listBotPrivateChatDirectory(options = {}) {
4494
+ const session = await this.runtime.requireSession();
4495
+ const { items } = await this.listBots(options);
4496
+ return { items: await Promise.all(items.map(async (bot) => {
4497
+ try {
4498
+ return (await this.openBotPrivateChatForSummary(bot, session, options.signal)).bot;
4499
+ } catch {
4500
+ return bot;
4501
+ }
4502
+ })) };
4503
+ }
4504
+ async openBotPrivateChatForSummary(bot, session, signal) {
4505
+ const reference = await this.openBotRef(bot.botRef, session.userId);
4506
+ const messages = listValue$20((await this.runtime.authenticatedBotPost("/api/v1/bot/private-chat/open", { bot_id: reference.botId }, session, signal)).messages).map((message) => botPrivateChatMessage(message));
4507
+ return {
4508
+ bot: botWithPrivateChatActivity(bot, messages),
4509
+ messages
4510
+ };
4511
+ }
4512
+ async sendBotPrivateChatMessage(botRef, contentInput, options = {}) {
4513
+ const content = contentInput.trim();
4514
+ if (content === "") throw new ArkmePluginError("bot-private-chat-content-invalid", "请输入消息内容", false, 400);
4515
+ if (content.length > 2e4) throw new ArkmePluginError("bot-private-chat-content-invalid", "消息不能超过 20000 个字符", false, 400);
4516
+ const session = await this.runtime.requireSession();
4517
+ const reference = await this.openBotRef(botRef, session.userId);
4518
+ const data = await this.runtime.authenticatedBotPost("/api/v1/bot/private-chat/message/send", {
4519
+ bot_id: reference.botId,
4520
+ content
4521
+ }, session, options.signal);
4522
+ const botMessages = [...listValue$20(data.bot_messages).map((message) => botPrivateChatMessage(message)), ...Object.keys(objectValue$1(data.bot_message)).length === 0 ? [] : [botPrivateChatMessage(data.bot_message)]];
4523
+ return {
4524
+ userMessage: botPrivateChatMessage(data.user_message, content),
4525
+ botMessages,
4526
+ status: stringValue$1(data.status).trim() || "ok"
4527
+ };
4528
+ }
4331
4529
  async openBotChat(botRef, options = {}) {
4332
4530
  const session = await this.runtime.requireSession();
4333
4531
  const reference = await this.openBotRef(botRef, session.userId);
4334
4532
  const bot = (await this.listBots(options)).items.find((item) => item.botRef === botRef);
4335
4533
  if (bot === void 0) throw new ArkmePluginError("bot-ref-not-owned", "当前账号不存在该 OpenClaw Bot", false, 404);
4336
- const chatSessionUid = stringValue$1((await this.runtime.authenticatedBotPost("/api/v1/bot/private-chat/open", { bot_id: reference.botId }, session, options.signal)).chat_session_uid).trim();
4337
- if (chatSessionUid === "") throw new ArkmePluginError("bot-chat-source-unavailable", "当前 Bot 私聊仍使用旧会话协议,暂时不能复用统一 source 读写链路", false, 409);
4338
- const source = {
4339
- sourceRef: await this.source.sealSourceRef(session.userId, "private_chat", chatSessionUid, bot.name),
4340
- kind: "private_chat",
4341
- displayName: bot.name,
4342
- activeAtMillis: 0,
4343
- unreadCount: 0
4344
- };
4345
- this.source.setChatSourceByKey(`${String(session.userId)}:${chatSessionUid}`, source);
4346
- return source;
4534
+ const data = await this.runtime.authenticatedBotPost("/api/v1/bot/private-chat/open", { bot_id: reference.botId }, session, options.signal);
4535
+ const chatSessionUid = botChatSessionUid(data);
4536
+ if (chatSessionUid !== void 0) {
4537
+ const source = {
4538
+ sourceRef: await this.source.sealSourceRef(session.userId, "private_chat", chatSessionUid, bot.name),
4539
+ kind: "private_chat",
4540
+ displayName: bot.name,
4541
+ activeAtMillis: 0,
4542
+ unreadCount: 0
4543
+ };
4544
+ this.source.setChatSourceByKey(`${String(session.userId)}:${chatSessionUid}`, source);
4545
+ return source;
4546
+ }
4547
+ const legacySessionId = legacyBotChatSessionCandidate(data.session_id, reference.botId);
4548
+ if (legacySessionId !== void 0) {
4549
+ const source = await this.source.searchTargetSource(3, legacySessionId, bot.name, options.signal);
4550
+ if (source !== void 0) return source;
4551
+ }
4552
+ throw new ArkmePluginError("bot-chat-source-unavailable", "当前 Bot 私聊未返回可用会话,暂时不能复用统一 source 读写链路", false, 409);
4347
4553
  }
4348
4554
  async resolveBotConnectionMetadata(botRef, options = {}) {
4349
4555
  const session = await this.runtime.requireSession();
@@ -4454,6 +4660,7 @@ var BotService = class {
4454
4660
  if (botId === "" || name === "" || provider === void 0) throw new ArkmePluginError("bot-contract-invalid", "Bot 响应不完整", true, 502);
4455
4661
  const rawStatus = stringValue$1(raw.status).trim();
4456
4662
  const status = rawStatus === "online" || rawStatus === "offline" ? rawStatus : "unknown";
4663
+ const createdAtMillis = botPrivateChatTimestamp(raw.created_at ?? raw.createdAt);
4457
4664
  return {
4458
4665
  botRef: this.sealBotRef(userId, botId, provider),
4459
4666
  name,
@@ -4461,9 +4668,30 @@ var BotService = class {
4461
4668
  description: stringValue$1(raw.description).trim(),
4462
4669
  status,
4463
4670
  directChatAvailable: stringValue$1(raw.subject_uid).trim() !== "" || stringValue$1(raw.chat_session_uid).trim() !== "",
4671
+ ...createdAtMillis === 0 ? {} : { createdAtMillis },
4464
4672
  ...this.botAvatarProjection(raw, userId, botId)
4465
4673
  };
4466
4674
  }
4675
+ async botManageProfileFromData(data, userId) {
4676
+ const raw = botProfileSource(data);
4677
+ const summary = await this.botSummaryFromData(raw, userId);
4678
+ const joinedGroups = listValue$20(data.joined_groups).map((value) => objectValue$1(value)).map((group) => ({
4679
+ title: stringValue$1(group.subject_title).trim() || stringValue$1(group.subject_uid).trim() || "未命名群聊",
4680
+ installedAtMillis: botPrivateChatTimestamp(group.installed_at)
4681
+ }));
4682
+ return {
4683
+ ...summary,
4684
+ mentionEntryEnabled: raw.mention_entry_enabled !== false,
4685
+ tokenPreview: stringValue$1(raw.token_preview).trim(),
4686
+ canRevealToken: raw.can_reveal_token !== false,
4687
+ tokenRevealEnabled: data.token_reveal_enabled !== false,
4688
+ gatewayUrl: stringValue$1(data.gateway_url).trim(),
4689
+ webhookUrl: stringValue$1(data.webhook_url).trim(),
4690
+ recordCount: Math.max(-1, Math.trunc(numberValue$19(raw.record_count))),
4691
+ webhookSecurity: botWebhookSecurity(data.webhook_security ?? raw.webhook_security),
4692
+ joinedGroups
4693
+ };
4694
+ }
4467
4695
  botAvatarProjection(raw, userId, botId) {
4468
4696
  const sourceUrl = stringValue$1(raw.avatar_url ?? raw.avatarUrl).trim();
4469
4697
  if (sourceUrl === "") return {};
@@ -12072,6 +12300,11 @@ function optionalNumberValue(value) {
12072
12300
  if (Number.isFinite(parsed)) return parsed;
12073
12301
  }
12074
12302
  }
12303
+ function positiveNumberValue(value) {
12304
+ const parsed = optionalNumberValue(value);
12305
+ if (parsed === void 0 || !Number.isSafeInteger(parsed) || parsed <= 0) return void 0;
12306
+ return parsed;
12307
+ }
12075
12308
  function uniqueStrings(values) {
12076
12309
  return [...new Set(values.map((value) => stringValue(value).trim()).filter((value) => value !== ""))];
12077
12310
  }
@@ -12081,7 +12314,7 @@ function displayTimestamp(value) {
12081
12314
  const parsed = Date.parse(stringValue(value));
12082
12315
  return Number.isFinite(parsed) ? parsed : 0;
12083
12316
  }
12084
- function projectRecordingTranscripts(response, speakerResponse) {
12317
+ function projectRecordingTranscripts(response, speakerResponse, profilesByUserId = /* @__PURE__ */ new Map()) {
12085
12318
  const data = objectValue(response);
12086
12319
  const sessions = /* @__PURE__ */ new Map();
12087
12320
  const sessionSpeakerColorIndexes = /* @__PURE__ */ new Map();
@@ -12112,7 +12345,7 @@ function projectRecordingTranscripts(response, speakerResponse) {
12112
12345
  const speakerRows = Array.isArray(speakerResponse) ? speakerResponse : listValue$6(objectValue(speakerResponse).speaker_ls ?? objectValue(speakerResponse).speakers);
12113
12346
  for (const rawSpeaker of speakerRows) {
12114
12347
  const speaker = objectValue(rawSpeaker);
12115
- const id = stringValue(speaker.id ?? speaker.spk_id).trim();
12348
+ const id = stringValue(speaker.id ?? speaker.speaker_id ?? speaker.spk_id).trim();
12116
12349
  if (id !== "") speakers.set(id, speaker);
12117
12350
  }
12118
12351
  const projected = [];
@@ -12135,11 +12368,13 @@ function projectRecordingTranscripts(response, speakerResponse) {
12135
12368
  const sessionSpeaker = sessionSpeakers.find((candidate) => numberValue$5(candidate.num) === rawSpeakerNumber) ?? {};
12136
12369
  const formalSpeakerId = stringValue(row.effective_spk_id ?? sessionSpeaker.spk_id ?? sessionSpeaker.speaker_id).trim();
12137
12370
  const formalSpeaker = speakers.get(formalSpeakerId) ?? {};
12138
- const isSelf = numberValue$5(formalSpeaker.ref_usr_id ?? formalSpeaker.ref_user_id) > 0 && numberValue$5(formalSpeaker.ref_usr_id ?? formalSpeaker.ref_user_id) === numberValue$5(session.belong_usr);
12371
+ const speakerUserId = positiveNumberValue(formalSpeaker.ref_usr_id ?? formalSpeaker.ref_user_id ?? formalSpeaker.user_id);
12372
+ const profile = speakerUserId === void 0 ? void 0 : profilesByUserId.get(speakerUserId);
12373
+ const isSelf = speakerUserId !== void 0 && speakerUserId === numberValue$5(session.belong_usr);
12139
12374
  const persistentSpeakerNumber = optionalNumberValue(sessionSpeaker.speaker_display_number ?? sessionSpeaker.speakerDisplayNumber);
12140
12375
  const speakerNumber = persistentSpeakerNumber !== void 0 && persistentSpeakerNumber > 0 ? persistentSpeakerNumber : rawSpeakerNumber;
12141
12376
  const speakerColorIndex = sessionSpeakerColorIndexes.get(`${sessionId}:${rawSpeakerNumber}`) ?? Math.max(0, rawSpeakerNumber);
12142
- const speakerLabel = speakerNumber >= 0 ? `说话人 ${speakerNumber}` : "未知说话人";
12377
+ const speakerLabel = stringValue(formalSpeaker.nick_name ?? formalSpeaker.nickname ?? formalSpeaker.display_name ?? formalSpeaker.name).trim() || profile?.displayName.trim() || (speakerNumber >= 0 ? `说话人 ${speakerNumber}` : "未知说话人");
12143
12378
  const startOffset = numberValue$5(row.s ?? row.start_at);
12144
12379
  const endOffset = Math.max(startOffset, numberValue$5(row.e ?? row.end_at));
12145
12380
  projected.push({
@@ -12153,6 +12388,7 @@ function projectRecordingTranscripts(response, speakerResponse) {
12153
12388
  speakerNumber,
12154
12389
  speakerColorIndex,
12155
12390
  speakerLabel,
12391
+ ...profile?.avatarRef === void 0 ? {} : { speakerAvatarRef: profile.avatarRef },
12156
12392
  isSelf,
12157
12393
  isBackground,
12158
12394
  text,
@@ -12355,6 +12591,18 @@ function numberValue$4(value) {
12355
12591
  function listValue$5(value) {
12356
12592
  return Array.isArray(value) ? value : [];
12357
12593
  }
12594
+ function positiveUserId(value) {
12595
+ const numeric = numberValue$4(value);
12596
+ const userId = Math.trunc(numeric);
12597
+ return Number.isSafeInteger(userId) && userId > 0 ? userId : void 0;
12598
+ }
12599
+ function speakerUserIds(speakerData) {
12600
+ return [...new Set(speakerData.flatMap((raw) => {
12601
+ const speaker = objectValue$1(raw);
12602
+ const userId = positiveUserId(speaker.ref_usr_id ?? speaker.ref_user_id ?? speaker.user_id);
12603
+ return userId === void 0 ? [] : [userId];
12604
+ }))];
12605
+ }
12358
12606
  function encodeOpaqueJson$2(value) {
12359
12607
  return Buffer.from(JSON.stringify(value), "utf8").toString("base64url");
12360
12608
  }
@@ -12368,8 +12616,10 @@ function safeFailureMessage$1(error) {
12368
12616
  }
12369
12617
  var RecordingService = class {
12370
12618
  runtime;
12371
- constructor(runtime) {
12619
+ profile;
12620
+ constructor(runtime, profile) {
12372
12621
  this.runtime = runtime;
12622
+ this.profile = profile;
12373
12623
  }
12374
12624
  async recordingCalendar(fromStamp, toStamp, signal) {
12375
12625
  const from = Math.trunc(fromStamp);
@@ -12406,7 +12656,7 @@ var RecordingService = class {
12406
12656
  const dayStart = this.recordingDayStart(dateStamp);
12407
12657
  const date = dayStart.getTime();
12408
12658
  const session = await this.runtime.requireSession();
12409
- const [transcriptResult, speakerResult] = await Promise.allSettled([this.runtime.authenticatedAudioPost("/api/v1/audio/one-day-trans-v2", {
12659
+ const [transcriptResult, speakerResult] = await Promise.allSettled([this.runtime.authenticatedAudioPost("/api/v1/audio/one-day-trans", {
12410
12660
  start_at: date,
12411
12661
  tz_offset: -dayStart.getTimezoneOffset() * 6e4
12412
12662
  }, session, signal), this.runtime.authenticatedAudioPost("/api/v1/audio/get-speaker-ls", {}, session, signal)]);
@@ -12414,7 +12664,9 @@ var RecordingService = class {
12414
12664
  let totalDurationMillis = 0;
12415
12665
  for (const rawSession of listValue$5(transcriptResult.value.session_ls)) totalDurationMillis += Math.max(0, numberValue$4(objectValue$1(rawSession).duration));
12416
12666
  const speakerData = speakerResult.status === "fulfilled" ? listValue$5(speakerResult.value.spk_ls) : [];
12417
- const items = projectRecordingTranscripts(transcriptResult.value, speakerData);
12667
+ const userIds = speakerUserIds(speakerData);
12668
+ const profilesByUserId = await this.recordingSpeakerProfiles(userIds, session, signal);
12669
+ const items = projectRecordingTranscripts(transcriptResult.value, speakerData, profilesByUserId);
12418
12670
  return {
12419
12671
  state: items.length > 0 ? "ready" : "empty",
12420
12672
  items,
@@ -12502,6 +12754,24 @@ var RecordingService = class {
12502
12754
  async recordingCursorKey(userId) {
12503
12755
  return createHmac("sha256", await this.runtime.stateStore.uniqueCode()).update(`arkme-recording-cursor:${String(userId)}`).digest();
12504
12756
  }
12757
+ async recordingSpeakerProfiles(userIds, session, signal) {
12758
+ if (this.profile === void 0) return /* @__PURE__ */ new Map();
12759
+ if (userIds.length === 0) return /* @__PURE__ */ new Map();
12760
+ try {
12761
+ const publicProfiles = await this.profile.publicProfileSummariesByUserIds(userIds, session, signal);
12762
+ const entries = await Promise.all([...publicProfiles].map(async ([userId, profile]) => {
12763
+ const displayName = profile.displayName.trim() || profile.nickname.trim();
12764
+ const avatarRef = profile.avatarUrl === void 0 ? void 0 : await this.profile.sealProfileImageRef(session.userId, userId);
12765
+ return [userId, {
12766
+ displayName,
12767
+ ...avatarRef === void 0 ? {} : { avatarRef }
12768
+ }];
12769
+ }));
12770
+ return new Map(entries);
12771
+ } catch {
12772
+ return /* @__PURE__ */ new Map();
12773
+ }
12774
+ }
12505
12775
  recordingDayStart(dateStamp) {
12506
12776
  const date = Math.trunc(dateStamp);
12507
12777
  const dayStart = new Date(date);
@@ -15746,8 +16016,8 @@ var ArkmeService = class {
15746
16016
  this.arrangement = new ArrangementService(this.runtime);
15747
16017
  this.calendar = new CalendarService(this.runtime, this.privacy);
15748
16018
  this.wechat = new WechatService(this.runtime);
15749
- this.recording = new RecordingService(this.runtime);
15750
16019
  this.profile = new ProfileService(this.runtime);
16020
+ this.recording = new RecordingService(this.runtime, this.profile);
15751
16021
  this.callHistory = new CallHistoryService(this.runtime, this.profile);
15752
16022
  this.extensionReview = new ExtensionReviewService(this.runtime, this.profile, { createTextForConversation: async (recordUid, textContent) => {
15753
16023
  return await this.createTextForConversation(recordUid, textContent);
@@ -15831,6 +16101,9 @@ var ArkmeService = class {
15831
16101
  async listBots(options = {}) {
15832
16102
  return await this.bot.listBots(options);
15833
16103
  }
16104
+ async listBotPrivateChatDirectory(options = {}) {
16105
+ return await this.bot.listBotPrivateChatDirectory(options);
16106
+ }
15834
16107
  async createBot(input, options = {}) {
15835
16108
  return await this.bot.createBot(input, options);
15836
16109
  }
@@ -15840,9 +16113,33 @@ var ArkmeService = class {
15840
16113
  async revealBotSecret(botRef, options = {}) {
15841
16114
  return await this.bot.revealBotSecret(botRef, options);
15842
16115
  }
16116
+ async manageBotProfile(botRef, options = {}) {
16117
+ return await this.bot.manageBotProfile(botRef, options);
16118
+ }
16119
+ async updateManagedBot(botRef, input, options = {}) {
16120
+ return await this.bot.updateManagedBot(botRef, input, options);
16121
+ }
16122
+ async revealManagedBotToken(botRef, options = {}) {
16123
+ return await this.bot.revealManagedBotToken(botRef, options);
16124
+ }
16125
+ async deleteManagedBot(botRef, confirmationName, options = {}) {
16126
+ await this.bot.deleteManagedBot(botRef, confirmationName, options);
16127
+ }
16128
+ async botNotificationPreference(botRef, options = {}) {
16129
+ return await this.bot.botNotificationPreference(botRef, options);
16130
+ }
16131
+ async updateBotNotificationPreference(botRef, muted, options = {}) {
16132
+ return await this.bot.updateBotNotificationPreference(botRef, muted, options);
16133
+ }
15843
16134
  async openBotChat(botRef, options = {}) {
15844
16135
  return await this.bot.openBotChat(botRef, options);
15845
16136
  }
16137
+ async openBotPrivateChat(botRef, options = {}) {
16138
+ return await this.bot.openBotPrivateChat(botRef, options);
16139
+ }
16140
+ async sendBotPrivateChatMessage(botRef, content, options = {}) {
16141
+ return await this.bot.sendBotPrivateChatMessage(botRef, content, options);
16142
+ }
15846
16143
  async listGroupBots(groupSourceRef, options = {}) {
15847
16144
  return await this.bot.listGroupBots(groupSourceRef, options);
15848
16145
  }
@@ -6,11 +6,12 @@ import { ArkmeOutgoingCallBroker } from './outgoing-call-broker.js';
6
6
  import type { ArkmeOutgoingCallIntentClaim, ArkmeOutgoingCallIntentResolutionInput, ArkmeOutgoingCallMediaType, ArkmeOutgoingCallPrepareResult, ArkmeOutgoingCallToolResult } from './outgoing-call-contract.js';
7
7
  import type { ArkmeRequestStats } from './request-coordinator.js';
8
8
  import { SecretValue } from './secret-value.js';
9
+ import { type ArkmeBotManageUpdateInput } from './services/bot-service.js';
9
10
  import { type ArkmeExtensionAuthorProjection } from './services/extension-review-service.js';
10
11
  import { type ArkmeMediaDescriptor } from './services/media-service.js';
11
12
  import { type ArkmeRemoteRequestOptions, type ArkmeServiceConfig, type FetchLike, type StateStore } from './services/service.js';
12
13
  import type { ArkmeBotCreateInput, ArkmeBotCreateResult, ArkmeGroupBotList, ArkmeGroupBotMutationResult } from './tools/ports/bots.js';
13
- import type { ArkmeAiVideoJob, ArkmeAiVideoJobStatus, ArkmeAiVideoListResult, ArkmeAiVideoPreflightResult, ArkmeAiVideoSegmentSelector, ArkmeArkoAskResult, ArkmeArkoCancelResult, ArkmeArkoHistoryPage, ArkmeArkoModelCatalog, ArkmeArkoProfile, ArkmeArkoRunStatus, ArkmeArkoSession, ArkmeArrangementDetail, ArkmeArrangementListStatus, ArkmeArrangementMutationIntent, ArkmeArrangementMutationResult, ArkmeArrangementPage, ArkmeArrangementReminderPage, ArkmeArrangementReminderSummary, ArkmeArrangementReminderToggleResult, ArkmeArrangementReminderWriteResult, ArkmeAuthSnapshot, ArkmeBotList, ArkmeBotSummary, ArkmeCalendarBucketPage, ArkmeCalendarDayRecordPage, ArkmeCallDetail, ArkmeCallHistoryOptions, ArkmeCallHistoryPage, ArkmeCallSummaryRetryResult, ArkmeCachedQueryResult, ArkmeCachedSnapshot, ArkmeCaptchaResult, ArkmeChatClientEvent, ArkmeChatRealtimeState, ArkmeClientConfig, ArkmeContactAddResult, ArkmeContactSearchResult, ArkmeDirectoryContactProfile, ArkmeDirectoryPage, ArkmeDirectorySectionKind, ArkmeConversationWriteResult, ArkmeConversationMemberList, ArkmeConversationMemberRecordMode, ArkmeConversationMemberRecordPage, ArkmeCreateTextResult, ArkmeDirectTextSendResult, ArkmeFileAssetDisplayItem, ArkmeFavoriteStickerList, ArkmeFavoriteStickerAddInput, ArkmeFavoriteStickerManageAction, ArkmeGroupActionResult, ArkmeGroupAiPolishMutationResult, ArkmeGroupAiPolishNotice, ArkmeGroupAiPolishRuleCandidate, ArkmeGroupAiPolishSnapshot, ArkmeGroupMemberList, ArkmeGroupMemberAddResult, ArkmeGroupMemberCandidateList, ArkmeGroupInvitePreview, ArkmeGroupNotificationResult, ArkmeGroupSettingsSnapshot, ArkmeIdAvailabilitySnapshot, ArkmeIdMutationResult, ArkmeImageBytes, ArkmeImageSearchResult, ArkmeInterwovenBootstrap, ArkmeInterwovenDetail, ArkmeLongArticleDetail, ArkmeLongArticleDraft, ArkmeMessageReadReceiptDetail, ArkmeMessageReadReceiptQueryItem, ArkmeMessageReadReceiptSummaryList, ArkmeMessageReportResult, ArkmeOfficialAuthorProfile, ArkmeOpenPrivateChatResult, ArkmePendingWrite, ArkmeProviderCapabilities, ArkmeProviderState, ArkmeRecordCursor, ArkmeRecordSearchResult, ArkmeRecordingCalendarMonth, ArkmeRecordingCursorPayload, ArkmeRecordingDay, ArkmeRecordingProjectionKind, ArkmeRecordingSearchResult, ArkmeRecordingSection, ArkmeRecordingTranscriptSection, ArkmeRecordingVersion, ArkmeRelatedRecordingEligibility, ArkmeRelatedRecordingPage, ArkmeRelatedRecordingPageOptions, ArkmeRichSendInput, ArkmeBotMentionInput, ArkmeHumanMentionInput, ArkmeSearchHistoryResult, ArkmeSearchSceneKind, ArkmeSelfRecordList, ArkmeSelfSummary, ArkmeSourceDirectory, ArkmeSourceItem, ArkmeSourceList, ArkmeSourceReadResult, ArkmeSourceSendResult, ArkmeTimelineCursor, ArkmeTimelinePage, ArkmeTopicCreateResult, ArkmeTopicDissolveResult, ArkmeTopicDissolveTask, ArkmeTopicHierarchyMoveResult, ArkmeTopicRenameResult, ArkmeUploadedAsset, ArkmeUnmarkedSpeakerInferenceRetry, ArkmeUnmarkedSpeakerMarkResult, ArkmeUnmarkedSpeakerOptions, ArkmeUnmarkedSpeakerSegmentPage, ArkmeUserCardSnapshot, ArkmeUserProfileSnapshot, ArkmeWechatCallFilter, ArkmeWechatCommonGroupPage, ArkmeWechatConversationDetail, ArkmeWechatConversationPage, ArkmeWechatGroupMemberPage, ArkmeWechatLocationPage, ArkmeWechatMessageFilter, ArkmeWechatMessagePage, ArkmeWechatMoneyFlowPage, ArkmeWechatPhonePage, ArkmeWorldFeedPage, ArkmeWorldAuthorLabel, ArkmeWorldVoiceprintAvailability, ArkmeWorldVoiceprintInviteResult, ArkmeWorldVoiceprintPlaybackChunk, ArkmeWorldVoiceprintSocialContext, ArkmeWorldInteractionCreateResult, ArkmeWorldInteractionPage, ArkmeWorldPublishFileAssetsInput, ArkmeWorldPublishResult, ArkmeWorldPublishTextInput, ArkmeWorldRecordList } from './types.js';
14
+ import type { ArkmeAiVideoJob, ArkmeAiVideoJobStatus, ArkmeAiVideoListResult, ArkmeAiVideoPreflightResult, ArkmeAiVideoSegmentSelector, ArkmeArkoAskResult, ArkmeArkoCancelResult, ArkmeArkoHistoryPage, ArkmeArkoModelCatalog, ArkmeArkoProfile, ArkmeArkoRunStatus, ArkmeArkoSession, ArkmeArrangementDetail, ArkmeArrangementListStatus, ArkmeArrangementMutationIntent, ArkmeArrangementMutationResult, ArkmeArrangementPage, ArkmeArrangementReminderPage, ArkmeArrangementReminderSummary, ArkmeArrangementReminderToggleResult, ArkmeArrangementReminderWriteResult, ArkmeAuthSnapshot, ArkmeBotList, ArkmeBotManageProfile, ArkmeBotNotificationPreference, ArkmeBotSummary, ArkmeCalendarBucketPage, ArkmeCalendarDayRecordPage, ArkmeCallDetail, ArkmeCallHistoryOptions, ArkmeCallHistoryPage, ArkmeCallSummaryRetryResult, ArkmeCachedQueryResult, ArkmeCachedSnapshot, ArkmeCaptchaResult, ArkmeChatClientEvent, ArkmeChatRealtimeState, ArkmeClientConfig, ArkmeContactAddResult, ArkmeContactSearchResult, ArkmeDirectoryContactProfile, ArkmeDirectoryPage, ArkmeDirectorySectionKind, ArkmeConversationWriteResult, ArkmeConversationMemberList, ArkmeConversationMemberRecordMode, ArkmeConversationMemberRecordPage, ArkmeCreateTextResult, ArkmeDirectTextSendResult, ArkmeFileAssetDisplayItem, ArkmeFavoriteStickerList, ArkmeFavoriteStickerAddInput, ArkmeFavoriteStickerManageAction, ArkmeGroupActionResult, ArkmeGroupAiPolishMutationResult, ArkmeGroupAiPolishNotice, ArkmeGroupAiPolishRuleCandidate, ArkmeGroupAiPolishSnapshot, ArkmeGroupMemberList, ArkmeGroupMemberAddResult, ArkmeGroupMemberCandidateList, ArkmeGroupInvitePreview, ArkmeGroupNotificationResult, ArkmeGroupSettingsSnapshot, ArkmeIdAvailabilitySnapshot, ArkmeIdMutationResult, ArkmeImageBytes, ArkmeImageSearchResult, ArkmeInterwovenBootstrap, ArkmeInterwovenDetail, ArkmeLongArticleDetail, ArkmeLongArticleDraft, ArkmeMessageReadReceiptDetail, ArkmeMessageReadReceiptQueryItem, ArkmeMessageReadReceiptSummaryList, ArkmeMessageReportResult, ArkmeOfficialAuthorProfile, ArkmeOpenPrivateChatResult, ArkmePendingWrite, ArkmeProviderCapabilities, ArkmeProviderState, ArkmeRecordCursor, ArkmeRecordSearchResult, ArkmeRecordingCalendarMonth, ArkmeRecordingCursorPayload, ArkmeRecordingDay, ArkmeRecordingProjectionKind, ArkmeRecordingSearchResult, ArkmeRecordingSection, ArkmeRecordingTranscriptSection, ArkmeRecordingVersion, ArkmeRelatedRecordingEligibility, ArkmeRelatedRecordingPage, ArkmeRelatedRecordingPageOptions, ArkmeRichSendInput, ArkmeBotMentionInput, ArkmeHumanMentionInput, ArkmeSearchHistoryResult, ArkmeSearchSceneKind, ArkmeSelfRecordList, ArkmeSelfSummary, ArkmeSourceDirectory, ArkmeSourceItem, ArkmeSourceList, ArkmeSourceReadResult, ArkmeSourceSendResult, ArkmeTimelineCursor, ArkmeTimelinePage, ArkmeTopicCreateResult, ArkmeTopicDissolveResult, ArkmeTopicDissolveTask, ArkmeTopicHierarchyMoveResult, ArkmeTopicRenameResult, ArkmeUploadedAsset, ArkmeUnmarkedSpeakerInferenceRetry, ArkmeUnmarkedSpeakerMarkResult, ArkmeUnmarkedSpeakerOptions, ArkmeUnmarkedSpeakerSegmentPage, ArkmeUserCardSnapshot, ArkmeUserProfileSnapshot, ArkmeWechatCallFilter, ArkmeWechatCommonGroupPage, ArkmeWechatConversationDetail, ArkmeWechatConversationPage, ArkmeWechatGroupMemberPage, ArkmeWechatLocationPage, ArkmeWechatMessageFilter, ArkmeWechatMessagePage, ArkmeWechatMoneyFlowPage, ArkmeWechatPhonePage, ArkmeWorldFeedPage, ArkmeWorldAuthorLabel, ArkmeWorldVoiceprintAvailability, ArkmeWorldVoiceprintInviteResult, ArkmeWorldVoiceprintPlaybackChunk, ArkmeWorldVoiceprintSocialContext, ArkmeWorldInteractionCreateResult, ArkmeWorldInteractionPage, ArkmeWorldPublishFileAssetsInput, ArkmeWorldPublishResult, ArkmeWorldPublishTextInput, ArkmeWorldRecordList } from './types.js';
14
15
  export { MAX_ARKME_IMAGE_BYTES } from './services/media-service.js';
15
16
  export { MAX_ARKME_RELATED_RECORDING_CURSOR_LENGTH, MAX_ARKME_RELATED_RECORDING_PAGE_SIZE, } from './services/related-recording-service.js';
16
17
  export { ArkmePluginError, type ArkmeServiceConfig } from './services/service.js';
@@ -66,6 +67,9 @@ export declare class ArkmeService {
66
67
  listBots(options?: {
67
68
  signal?: AbortSignal;
68
69
  }): Promise<ArkmeBotList>;
70
+ listBotPrivateChatDirectory(options?: {
71
+ signal?: AbortSignal;
72
+ }): Promise<import("./types.js").ArkmeBotPrivateChatDirectory>;
69
73
  createBot(input: ArkmeBotCreateInput, options?: {
70
74
  signal?: AbortSignal;
71
75
  }): Promise<ArkmeBotCreateResult>;
@@ -75,9 +79,35 @@ export declare class ArkmeService {
75
79
  revealBotSecret(botRef: string, options?: {
76
80
  signal?: AbortSignal;
77
81
  }): Promise<SecretValue>;
82
+ manageBotProfile(botRef: string, options?: {
83
+ signal?: AbortSignal;
84
+ }): Promise<ArkmeBotManageProfile>;
85
+ updateManagedBot(botRef: string, input: ArkmeBotManageUpdateInput, options?: {
86
+ signal?: AbortSignal;
87
+ }): Promise<ArkmeBotManageProfile>;
88
+ revealManagedBotToken(botRef: string, options?: {
89
+ signal?: AbortSignal;
90
+ }): Promise<{
91
+ token: string;
92
+ }>;
93
+ deleteManagedBot(botRef: string, confirmationName: string, options?: {
94
+ signal?: AbortSignal;
95
+ }): Promise<void>;
96
+ botNotificationPreference(botRef: string, options?: {
97
+ signal?: AbortSignal;
98
+ }): Promise<ArkmeBotNotificationPreference>;
99
+ updateBotNotificationPreference(botRef: string, muted: boolean, options?: {
100
+ signal?: AbortSignal;
101
+ }): Promise<ArkmeBotNotificationPreference>;
78
102
  openBotChat(botRef: string, options?: {
79
103
  signal?: AbortSignal;
80
104
  }): Promise<ArkmeSourceItem>;
105
+ openBotPrivateChat(botRef: string, options?: {
106
+ signal?: AbortSignal;
107
+ }): Promise<import("./types.js").ArkmeBotPrivateChatConversation>;
108
+ sendBotPrivateChatMessage(botRef: string, content: string, options?: {
109
+ signal?: AbortSignal;
110
+ }): Promise<import("./types.js").ArkmeBotPrivateChatSendResult>;
81
111
  listGroupBots(groupSourceRef: string, options?: {
82
112
  signal?: AbortSignal;
83
113
  }): Promise<ArkmeGroupBotList>;