@xopcai/xopc 0.0.351 → 0.0.353
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 +2 -2
- package/README.zh-CN.md +2 -2
- package/dist/browser-ext/dist/sidepanel.js +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Dc0yBlKV.js → agent-avatar-dicebear-BVIuZcCP.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-BXFins6I.js → agent-defaults-settings-panel-CcTnphqy.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-B-w6bJuj.js → agent-plugin-dialog-CdCzMPhC.js} +1 -1
- package/dist/gateway/static/root/assets/agents-BiNKpndr.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-yUALtmym.js → agents-admin-api-Ck2x78jq.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-C7QjGlMZ.js → app-management-settings-panel-BvGDN5J6.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CgApGxhN.js → appearance-settings-BhQYkuQj.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-DWii4stP.js → apps-page-BQZJuM-C.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin--oP0UmoE.js → archive-plugin-BZXXJvpX.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DkV4w6xr.js → automations-page-C7VKkDb5.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-DT95Uk9d.js → automations-workspace-y4qcvlg8.js} +1 -1
- package/dist/gateway/static/root/assets/{binary-plugins-DIpBiw_8.js → binary-plugins-DoT3g5SP.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Di4X446B.js → block-editor-sqqrCafh.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automation-inputs-B0TlAcoB.js → browser-automation-inputs-CZOKsAaa.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-pKPvkGW8.js → browser-automations-page-TEeTmkGP.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-cJ200PlY.js → browser-settings-page--N4P7V0l.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-e-fO70DK.js → capabilities-BOrLei_L.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CPKbJUDL.js → capabilities-page-F7OAv-iz.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-D5xUFWBJ.js → capabilities-settings-panel-CaiIo1S1.js} +1 -1
- package/dist/gateway/static/root/assets/{capability-header-actions-9qDm8ioP.js → capability-header-actions-CR_O9_Vr.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-CO_9_oIH.js → channels-Bb-8c4wl.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DCFwzHu2.js → chat-terminal-dock-Q99iKyiO.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-bwWQ3axN.js → computer-settings-page-QuXZBfky.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-BIIP-gX4.js → connector-service-page-BIqzVqCO.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-C0b5Xbca.js → connectors-page-CZ24DSBJ.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-DBio7OE6.js → date-picker-Ck-FmYEL.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-hyPm_1tB.js → dependency-picker-BjH8XrKb.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-BDPfot60.js → desktop-pet-DyGxNAVW.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-C6IRO2iD.js → desktop-pet-settings-C1rKgB-S.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CUOh38IK.js → device-pairing-wizard-UrPcOU6Q.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-ljXXfuLL.js → directory-picker-path-field-BYxUgMZb.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DHw1dG1g.js → extension-debug-page-CGL0jpQA.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BjLN3E6q.js → extension-page-DPWf-tYg.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-BMp6v6zP.js → extension-settings-page-DZWBY39d.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CmjHbMj7.js → gateway-config-swr-B31I6Gbq.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-DzyR6LYb.js → gateway-realtime-D6ffOiPe.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DQuFWNjA.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-settings-D76thCuX.js → gateway-settings-D5w5aYXK.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-startup-retry-CbOUnKv5.js → gateway-startup-retry-DVol958v.js} +1 -1
- package/dist/gateway/static/root/assets/{home-page-D1Tyeuul.js → home-page-DPQwxBGy.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BmLpVntI.js → image-generation-api-TVgJfz9r.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-CabovqRQ.js → imports-page-CnRWDtGz.js} +1 -1
- package/dist/gateway/static/root/assets/index-B-w6Rk9Z.css +1 -0
- package/dist/gateway/static/root/assets/{index-Bb32g7Ll.js → index-DU5Eb1V8.js} +20 -20
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DvN-2bcS.js → keyboard-shortcuts-settings-CoYdyBRh.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-CSEzRWxs.js → local-app-workbench-page-hjFeYlIq.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-C3Wy2zG2.js → local-apps-page-CeBhXeoX.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-wiq_12oN.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-WMaCMm3_.js → locale-store-Y1aBayM_.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-YojQFX9o.js → logs-page-CzpZDjkA.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-CNMk0HRn.js → management-settings-Beu_R_Rc.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-Oe4rXk1N.js → markdown-view-BlzX7Ze5.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Ds7HF3EM.js → media-plugins-C9ya5rUH.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DPw2X06D.js +3 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-D8vQ_INI.js → note-detail-panel-D8bpTGwP.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-page-CIFcEPAd.js → notes-page-OmgXowUG.js} +1 -1
- package/dist/gateway/static/root/assets/{page-context-capture-button-YKiYT0q2.js → page-context-capture-button-BjjjuLkz.js} +1 -1
- package/dist/gateway/static/root/assets/{page-tabs-ZUC486EH.js → page-tabs-_DiuzxyD.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Ca9tBmOg.js → preview-open-alternatives-BKvUadws.js} +1 -1
- package/dist/gateway/static/root/assets/{product-open-page-BuGb8QPn.js → product-open-page-DUPsiVP9.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-C6Awj1Ql.js → project-detail-page-CWlCg2x5.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-CmO8Gb9G.js → projects-page-NbVNo0tP.js} +1 -1
- package/dist/gateway/static/root/assets/{registry-api-DEePN1Rc.js → registry-api-DqDOrPQ0.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-BsqHroXR.js → remote-access-hub-CD8HrqGC.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Cva9t35o.js → runtime-tools-settings-panel-C25xEYTK.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-3_61bQHN.js → scenes-page-DbWaemwR.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DWHFyKEB.js → schema-form-_3LQ4hyB.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-Bv-hCMKS.js → session-api-CTN4qwiN.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-BcDptzCN.js → session-manager-DsH1DZI_.js} +5 -5
- package/dist/gateway/static/root/assets/{sessions-page-BaHue2bK.js → sessions-page-B7ZUdXlb.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CpKzZMft.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BwdrtX6k.js → settings-form-section-DS80hVSY.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-DqCJHcdG.js +1 -0
- package/dist/gateway/static/root/assets/{setup-status-panel-nMWHz-ra.js → setup-status-panel-De-kC3yJ.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DH0KHlev.js → share-preview-page-T-0g_rwr.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-KK-VNbMw.js → shares-settings-Dz33T3du.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BbNk-3Ig.js → skill-api-Cx6GGpSY.js} +1 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DyJ-Duem.js +1 -0
- package/dist/gateway/static/root/assets/{skills-page-BQya9ygw.js → skills-page-B2iyN-kP.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-akm5mc8b.js → system-settings-panel-By3SZQR_.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-wLGUc7Nu.js → task-detail-page-4yHUTs4_.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-vZ7P_KIQ.js → tunnel-api-BoH0LBkw.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-BV1KJ0EY.js → usage-page-dKU5X9zT.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-DQdLcZfO.js → use-autosave-YKCwQvqT.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-DnLTTyOE.js → user-model-page-Uht32LPP.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-api-key-field-CJ-FjNHr.js → voice-api-key-field-DiqHIA8l.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-DbjjZkIg.js → voice-config-api-BM75K3mR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BA1AAqaW.js → work-discovery-overlay-BnfD6w0k.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BhIOKmjW.js → workflow-run-setup-panel-DSy57rBr.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-aYoObmuS.js → workflows-page-Cq3vRUbc.js} +1 -1
- package/dist/gateway/static/root/index.html +15 -15
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/session-input-command.js +2 -1
- package/dist/src/agent/agent-manager.js +25 -11
- package/dist/src/agent/bootstrap/bootstrap-files.d.ts +0 -4
- package/dist/src/agent/bootstrap/bootstrap-files.js +3 -9
- package/dist/src/agent/bootstrap/load-bootstrap-files.js +2 -4
- package/dist/src/agent/context/workspace-seed.d.ts +1 -7
- package/dist/src/agent/context/workspace-seed.js +4 -13
- package/dist/src/agent/context/workspace-templates/AGENTS.md +1 -1
- package/dist/src/agent/context/workspace.d.ts +1 -3
- package/dist/src/agent/context/workspace.js +3 -7
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/messaging/no-reply.d.ts +1 -0
- package/dist/src/agent/messaging/no-reply.js +4 -0
- package/dist/src/agent/messaging/outbound-coordinator.d.ts +0 -4
- package/dist/src/agent/messaging/outbound-coordinator.js +2 -4
- package/dist/src/agent/prompt/sections/agent-identity.d.ts +3 -0
- package/dist/src/agent/prompt/sections/agent-identity.js +13 -0
- package/dist/src/agent/prompt/sections/messaging-runtime.d.ts +0 -5
- package/dist/src/agent/prompt/sections/messaging-runtime.js +2 -16
- package/dist/src/agent/prompt/sections/project-context.d.ts +0 -3
- package/dist/src/agent/prompt/sections/project-context.js +2 -9
- package/dist/src/agent/prompt/sections/tooling.js +1 -1
- package/dist/src/agent/prompt/service-prompt-builder.d.ts +2 -0
- package/dist/src/agent/prompt/service-prompt-builder.js +3 -8
- package/dist/src/agent/prompt/subagent-context.js +1 -1
- package/dist/src/agent/prompt/system-prompt-params.d.ts +0 -4
- package/dist/src/agent/prompt/system-prompt-params.js +0 -2
- package/dist/src/agent/prompt/system-prompt.d.ts +2 -2
- package/dist/src/agent/prompt/system-prompt.js +8 -9
- package/dist/src/agent/service.js +0 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/starter-agents.d.ts +3 -4
- package/dist/src/agent/starter-agents.js +104 -90
- package/dist/src/agent/tool-manuals/xopc-use.d.ts +1 -1
- package/dist/src/agent/tool-manuals/xopc-use.js +7 -4
- package/dist/src/agent/tools/factory.d.ts +4 -2
- package/dist/src/agent/tools/factory.js +6 -3
- package/dist/src/agent/workflow/workflow-child-tools.js +2 -1
- package/dist/src/agent-catalog/migrations/identity-markdown-cutover.d.ts +5 -0
- package/dist/src/agent-catalog/migrations/identity-markdown-cutover.js +94 -0
- package/dist/src/agent-catalog/repository.js +7 -1
- package/dist/src/agent-catalog/service.js +2 -2
- package/dist/src/agent-config/resolver.js +2 -0
- package/dist/src/agent-config/schema.d.ts +21 -0
- package/dist/src/agent-config/schema.js +9 -4
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/events/event-repository.js +2 -1
- package/dist/src/bootstrap/application-state.js +2 -0
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +4 -7
- package/dist/src/chat-commands/builtins/config.js +1 -1
- package/dist/src/cli/commands/auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/workspace-status.js +0 -1
- package/dist/src/cli/commands/gateway/lifecycle.js +1 -1
- package/dist/src/cli/commands/init.js +0 -33
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/commands/providers.js +1 -1
- package/dist/src/cli/templates.d.ts +1 -1
- package/dist/src/cli/templates.js +1 -23
- package/dist/src/config/index.js +3 -3
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/paths.d.ts +0 -2
- package/dist/src/config/paths.js +1 -3
- package/dist/src/config/reload.d.ts +0 -1
- package/dist/src/config/reload.js +0 -4
- package/dist/src/config/rules.js +0 -5
- package/dist/src/config/schema.d.ts +0 -45
- package/dist/src/config/schema.js +2 -23
- package/dist/src/connectors/connection-recovery-service.js +5 -0
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/gateway/agents-admin.d.ts +2 -9
- package/dist/src/gateway/agents-admin.js +8 -32
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agents.js +8 -1
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/device-push.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/host.d.ts +0 -2
- package/dist/src/gateway/host.js +2 -5
- package/dist/src/gateway/service.js +11 -11
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/infra/update-restart.js +1 -1
- package/dist/src/notifications/device-store.d.ts +0 -1
- package/dist/src/notifications/device-store.js +2 -7
- package/dist/src/notifications/service.d.ts +0 -1
- package/dist/src/notifications/service.js +13 -82
- package/dist/src/session/execution-detail.js +16 -0
- package/dist/src/storage/sqlite/notes-repository.js +19 -4
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/tui/tui-commands.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +1 -1
- package/dist/src/tui/tui.js +1 -1
- package/dist/src/voice/audio/normalize.js +34 -1
- package/dist/src/voice/realtime/persona-context.d.ts +2 -2
- package/dist/src/voice/realtime/persona-context.js +19 -33
- package/package.json +11 -12
- package/dist/gateway/static/root/assets/agents-CuFzMN58.js +0 -70
- package/dist/gateway/static/root/assets/gateway-realtime-store-KyhksZSM.js +0 -1
- package/dist/gateway/static/root/assets/index-CPi50n0l.css +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-CxXjQ5Du.js +0 -1
- package/dist/gateway/static/root/assets/messages-sXePe3LQ.js +0 -3
- package/dist/gateway/static/root/assets/settings-advanced-gate-C4y4c2M7.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-B6YZFEye.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DUOG2Ig1.js +0 -1
- package/dist/src/agent/bootstrap/filter-bootstrap-files.d.ts +0 -3
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +0 -18
- package/dist/src/agent/context/workspace-templates/HEARTBEAT.md +0 -26
- package/dist/src/agent/context/workspace-templates/IDENTITY.md +0 -30
- package/dist/src/agent/service/parse-outbound-session-key.d.ts +0 -8
- package/dist/src/agent/service/parse-outbound-session-key.js +0 -44
- package/dist/src/heartbeat/active-hours.d.ts +0 -11
- package/dist/src/heartbeat/active-hours.js +0 -40
- package/dist/src/heartbeat/content-check.d.ts +0 -4
- package/dist/src/heartbeat/content-check.js +0 -17
- package/dist/src/heartbeat/event-prompt.d.ts +0 -4
- package/dist/src/heartbeat/event-prompt.js +0 -11
- package/dist/src/heartbeat/index.d.ts +0 -5
- package/dist/src/heartbeat/index.js +0 -6
- package/dist/src/heartbeat/tokens.d.ts +0 -15
- package/dist/src/heartbeat/tokens.js +0 -25
- package/dist/src/heartbeat/wake.d.ts +0 -13
- package/dist/src/heartbeat/wake.js +0 -46
|
@@ -4,9 +4,9 @@ import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/t
|
|
|
4
4
|
import { localizeNotification } from "../../packages/gateway-contract/src/notifications.js";
|
|
5
5
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
6
6
|
import { getOrCreateGatewayIdentity, init_gateway_identity_repository } from "../storage/sqlite/gateway-identity-repository.js";
|
|
7
|
-
import {
|
|
7
|
+
import { listDeliverableNotificationDevices } from "./device-store.js";
|
|
8
8
|
import { notificationPlanFromGatewayEvent } from "./planner.js";
|
|
9
|
-
import { createNotificationEvent, deferNotificationDelivery, expireUndeliverableNotificationDeliveries, listDueNotificationDeliveries, markNotificationDeliveryAccepted, markNotificationDeliveryDead,
|
|
9
|
+
import { createNotificationEvent, deferNotificationDelivery, expireUndeliverableNotificationDeliveries, listDueNotificationDeliveries, markNotificationDeliveryAccepted, markNotificationDeliveryDead, pruneNotificationEvents, rescheduleNotificationDelivery } from "./store.js";
|
|
10
10
|
import { sendHarmonyPush } from "./harmony-push.js";
|
|
11
11
|
//#region src/notifications/service.ts
|
|
12
12
|
init_transaction();
|
|
@@ -14,8 +14,6 @@ init_src();
|
|
|
14
14
|
init_logger();
|
|
15
15
|
init_gateway_identity_repository();
|
|
16
16
|
const log = createLogger("Notifications");
|
|
17
|
-
const EXPO_PUSH_URL = "https://exp.host/--/api/v2/push/send";
|
|
18
|
-
const EXPO_RECEIPTS_URL = "https://exp.host/--/api/v2/push/getReceipts";
|
|
19
17
|
const MAX_DELIVERY_ATTEMPTS = 5;
|
|
20
18
|
const RETRY_DELAYS_MS = [
|
|
21
19
|
3e4,
|
|
@@ -24,7 +22,6 @@ const RETRY_DELAYS_MS = [
|
|
|
24
22
|
36e5,
|
|
25
23
|
216e5
|
|
26
24
|
];
|
|
27
|
-
const RECEIPT_DELAY_MS = 15 * 6e4;
|
|
28
25
|
const STANDARD_PREFERENCES = {
|
|
29
26
|
"chat.completed": "chatCompleted",
|
|
30
27
|
"chat.failed": "chatFailed",
|
|
@@ -45,9 +42,6 @@ function preferenceAllows(type, preferences) {
|
|
|
45
42
|
function retryAt(attempts, now) {
|
|
46
43
|
return now + RETRY_DELAYS_MS[Math.min(attempts, RETRY_DELAYS_MS.length - 1)];
|
|
47
44
|
}
|
|
48
|
-
function expoError(result) {
|
|
49
|
-
return result.details?.error || result.message || "Expo rejected the notification";
|
|
50
|
-
}
|
|
51
45
|
var NotificationService = class {
|
|
52
46
|
timer = null;
|
|
53
47
|
draining = false;
|
|
@@ -116,7 +110,6 @@ var NotificationService = class {
|
|
|
116
110
|
}
|
|
117
111
|
for (const notification of this.options.domainDelivery?.flush((plan) => this.persistPlan(plan)) ?? []) this.options.publish("notification.created", notification);
|
|
118
112
|
await this.deliverPending();
|
|
119
|
-
await this.checkReceipts();
|
|
120
113
|
await this.options.domainDelivery?.drain();
|
|
121
114
|
} catch (err) {
|
|
122
115
|
log.warn({ err }, "Notification delivery pass failed");
|
|
@@ -160,85 +153,23 @@ var NotificationService = class {
|
|
|
160
153
|
body: localized.localizedBody
|
|
161
154
|
};
|
|
162
155
|
try {
|
|
163
|
-
if (delivery.platform
|
|
164
|
-
|
|
165
|
-
pushToken: delivery.pushToken,
|
|
166
|
-
eventId: delivery.event.id,
|
|
167
|
-
gatewayId: getOrCreateGatewayIdentity().id,
|
|
168
|
-
target: delivery.event.target,
|
|
169
|
-
title: preview.title,
|
|
170
|
-
body: preview.body
|
|
171
|
-
}, fetchImpl);
|
|
172
|
-
markNotificationDeliveryAccepted(delivery.event.id, delivery.deviceId, ticket, Number.MAX_SAFE_INTEGER);
|
|
156
|
+
if (delivery.platform !== "harmonyos") {
|
|
157
|
+
markNotificationDeliveryDead(delivery.event.id, delivery.deviceId, "Native push provider is not configured");
|
|
173
158
|
return;
|
|
174
159
|
}
|
|
175
|
-
const
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
title: preview.title,
|
|
185
|
-
body: preview.body,
|
|
186
|
-
sound: delivery.event.priority === "high" ? "default" : void 0,
|
|
187
|
-
priority: delivery.event.priority,
|
|
188
|
-
data: {
|
|
189
|
-
eventId: delivery.event.id,
|
|
190
|
-
target: delivery.event.target,
|
|
191
|
-
...delivery.event.payload
|
|
192
|
-
}
|
|
193
|
-
})
|
|
194
|
-
});
|
|
195
|
-
if (!response.ok) throw new Error(`Expo push request failed (${response.status})`);
|
|
196
|
-
const body = await response.json();
|
|
197
|
-
const result = Array.isArray(body.data) ? body.data[0] : body.data;
|
|
198
|
-
if (result?.status !== "ok" || !result.id) {
|
|
199
|
-
const error = expoError(result ?? {});
|
|
200
|
-
if (result?.details?.error === "DeviceNotRegistered") {
|
|
201
|
-
disableNotificationDeviceForPushToken(delivery.pushToken);
|
|
202
|
-
markNotificationDeliveryDead(delivery.event.id, delivery.deviceId, error);
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
throw new Error(error);
|
|
206
|
-
}
|
|
207
|
-
markNotificationDeliveryAccepted(delivery.event.id, delivery.deviceId, result.id, Date.now() + RECEIPT_DELAY_MS);
|
|
160
|
+
const ticket = await (this.options.sendHarmony ?? sendHarmonyPush)({
|
|
161
|
+
pushToken: delivery.pushToken,
|
|
162
|
+
eventId: delivery.event.id,
|
|
163
|
+
gatewayId: getOrCreateGatewayIdentity().id,
|
|
164
|
+
target: delivery.event.target,
|
|
165
|
+
title: preview.title,
|
|
166
|
+
body: preview.body
|
|
167
|
+
}, fetchImpl);
|
|
168
|
+
markNotificationDeliveryAccepted(delivery.event.id, delivery.deviceId, ticket, Number.MAX_SAFE_INTEGER);
|
|
208
169
|
} catch (err) {
|
|
209
170
|
this.retryOrFail(delivery, err);
|
|
210
171
|
}
|
|
211
172
|
}
|
|
212
|
-
async checkReceipts() {
|
|
213
|
-
const withTickets = listDueNotificationDeliveries("accepted").filter((delivery) => delivery.platform !== "harmonyos" && delivery.providerTicketId);
|
|
214
|
-
if (withTickets.length === 0) return;
|
|
215
|
-
const fetchImpl = this.options.fetch ?? fetch;
|
|
216
|
-
try {
|
|
217
|
-
const response = await fetchImpl(EXPO_RECEIPTS_URL, {
|
|
218
|
-
method: "POST",
|
|
219
|
-
headers: {
|
|
220
|
-
"content-type": "application/json",
|
|
221
|
-
accept: "application/json"
|
|
222
|
-
},
|
|
223
|
-
signal: AbortSignal.timeout(1e4),
|
|
224
|
-
body: JSON.stringify({ ids: withTickets.map((delivery) => delivery.providerTicketId) })
|
|
225
|
-
});
|
|
226
|
-
if (!response.ok) throw new Error(`Expo receipt request failed (${response.status})`);
|
|
227
|
-
const body = await response.json();
|
|
228
|
-
for (const delivery of withTickets) {
|
|
229
|
-
const result = body.data?.[delivery.providerTicketId];
|
|
230
|
-
if (!result) this.retryOrFail(delivery, /* @__PURE__ */ new Error("Expo receipt is not ready"), "accepted");
|
|
231
|
-
else if (result.status === "ok") markNotificationDeliveryDelivered(delivery.event.id, delivery.deviceId);
|
|
232
|
-
else {
|
|
233
|
-
const error = expoError(result);
|
|
234
|
-
if (result.details?.error === "DeviceNotRegistered") disableNotificationDeviceForPushToken(delivery.pushToken);
|
|
235
|
-
markNotificationDeliveryDead(delivery.event.id, delivery.deviceId, error);
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
} catch (err) {
|
|
239
|
-
for (const delivery of withTickets) this.retryOrFail(delivery, err, "accepted");
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
173
|
retryOrFail(delivery, error, status = "pending") {
|
|
243
174
|
const message = error instanceof Error ? error.message : String(error);
|
|
244
175
|
if (delivery.attempts + 1 >= MAX_DELIVERY_ATTEMPTS) {
|
|
@@ -3,6 +3,11 @@ import { init_redact, redactSensitiveOutput } from "../utils/logger/redact.js";
|
|
|
3
3
|
init_redact();
|
|
4
4
|
function toolCategory(name, args) {
|
|
5
5
|
const key = name.split("__").pop()?.toLowerCase().replace(/-/g, "_") ?? "";
|
|
6
|
+
if (key === "run" && args && typeof args === "object" && !Array.isArray(args)) {
|
|
7
|
+
const input = args;
|
|
8
|
+
if (Array.isArray(input.search_query)) return "search";
|
|
9
|
+
if (Array.isArray(input.open)) return "fetch";
|
|
10
|
+
}
|
|
6
11
|
if (key === "skill_view" || key === "tool_manual") return key;
|
|
7
12
|
if (key === "xopc_use") {
|
|
8
13
|
let input = args;
|
|
@@ -54,6 +59,17 @@ function publicInputPreview(name, args) {
|
|
|
54
59
|
if (!args || typeof args !== "object" || Array.isArray(args)) return void 0;
|
|
55
60
|
const input = args;
|
|
56
61
|
const category = toolCategory(name, args);
|
|
62
|
+
if (category === "search" && Array.isArray(input.search_query)) {
|
|
63
|
+
const first = input.search_query[0];
|
|
64
|
+
if (first && typeof first === "object" && !Array.isArray(first) && typeof first.q === "string") return redactSensitiveOutput(first.q.trim().slice(0, 160));
|
|
65
|
+
}
|
|
66
|
+
if (category === "fetch" && Array.isArray(input.open)) {
|
|
67
|
+
const first = input.open[0];
|
|
68
|
+
if (first && typeof first === "object" && !Array.isArray(first) && typeof first.ref_id === "string") try {
|
|
69
|
+
const url = new URL(first.ref_id);
|
|
70
|
+
return `${url.origin}${url.pathname}`.slice(0, 160);
|
|
71
|
+
} catch {}
|
|
72
|
+
}
|
|
57
73
|
const keys = category === "search" ? ["query"] : category === "read" ? ["path", "file_path"] : category === "fetch" ? ["url"] : [];
|
|
58
74
|
for (const key of keys) {
|
|
59
75
|
const value = input[key];
|
|
@@ -196,7 +196,7 @@ function listNoteRecords(query = {}) {
|
|
|
196
196
|
)`);
|
|
197
197
|
if (query.agentEdited) conditions.push(`json_extract(payload_json, '$.lastEditTrigger') = 'ai_edit'`);
|
|
198
198
|
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
199
|
-
const
|
|
199
|
+
const select = `SELECT note_id, title, kind, status, payload_json, created_at, updated_at,
|
|
200
200
|
pinned, tags_json, snippet, cover_attachment_id, voice_attachment_id,
|
|
201
201
|
voice_duration_sec, attachment_names_json, group_id, last_opened_at,
|
|
202
202
|
task_done, task_due_at, heading_count, task_count, unchecked_task_count, link_count,
|
|
@@ -208,7 +208,24 @@ function listNoteRecords(query = {}) {
|
|
|
208
208
|
AND l.to_kind = 'project' AND l.relation = 'belongs_to'
|
|
209
209
|
ORDER BY p.name, p.project_id
|
|
210
210
|
)) AS projects_json
|
|
211
|
-
FROM notes ${where}
|
|
211
|
+
FROM notes ${where}`;
|
|
212
|
+
const offset = query.offset || 0;
|
|
213
|
+
const limit = Math.min(query.limit || 50, 200);
|
|
214
|
+
if (!query.tag && !query.search?.trim()) {
|
|
215
|
+
const sortColumn = query.sortBy === "updatedAt" ? "updated_at" : query.sortBy === "lastOpenedAt" ? "last_opened_at" : "created_at";
|
|
216
|
+
const sortExpression = sortColumn === "last_opened_at" ? "COALESCE(last_opened_at, 0)" : sortColumn;
|
|
217
|
+
const sortDirection = query.sortOrder === "asc" ? "ASC" : "DESC";
|
|
218
|
+
const total = db.prepare(`SELECT COUNT(*) AS total FROM notes ${where}`).get(...params).total;
|
|
219
|
+
const items = db.prepare(`${select} ORDER BY ${sortExpression} ${sortDirection}, note_id LIMIT ? OFFSET ?`).all(...params, limit, offset).map(rowToIndexEntry);
|
|
220
|
+
return {
|
|
221
|
+
items,
|
|
222
|
+
total,
|
|
223
|
+
limit,
|
|
224
|
+
offset,
|
|
225
|
+
hasMore: offset + items.length < total
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
const rows = db.prepare(select).all(...params);
|
|
212
229
|
let entries = rows.map(rowToIndexEntry);
|
|
213
230
|
if (query.tag) entries = entries.filter((entry) => entry.tags?.includes(query.tag));
|
|
214
231
|
if (query.search) {
|
|
@@ -228,8 +245,6 @@ function listNoteRecords(query = {}) {
|
|
|
228
245
|
return ((a[sortField] ?? 0) - (b[sortField] ?? 0)) * sortDir;
|
|
229
246
|
});
|
|
230
247
|
const total = entries.length;
|
|
231
|
-
const offset = query.offset || 0;
|
|
232
|
-
const limit = Math.min(query.limit || 50, 200);
|
|
233
248
|
const items = entries.slice(offset, offset + limit);
|
|
234
249
|
return {
|
|
235
250
|
items,
|
|
@@ -10,11 +10,11 @@ import { getSessionMetadata } from "../../storage/sqlite/session-read-repository
|
|
|
10
10
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
11
11
|
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
12
12
|
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
13
|
-
import { init_paths } from "../../config/paths.js";
|
|
14
13
|
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
15
14
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
16
15
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
17
16
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
17
|
+
import { init_paths } from "../../config/paths.js";
|
|
18
18
|
import { effectiveWorkspacePathForSession } from "../../session/session-workspace.js";
|
|
19
19
|
import { ProjectService } from "../../projects/project-service.js";
|
|
20
20
|
import { inferSuggestedProjectDefaultAgentId } from "../../projects/project-agent-suggestion.js";
|
|
@@ -2,8 +2,8 @@ import { closeXopcDatabase, isXopcDatabaseOpen, openXopcDatabase } from "../stor
|
|
|
2
2
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
3
3
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
4
4
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
5
|
-
import { resolveConfigPath } from "../config/paths.js";
|
|
6
5
|
import { init_agent_session_key, isValidAgentId, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
6
|
+
import { resolveConfigPath } from "../config/paths.js";
|
|
7
7
|
import { init_providers, providerSupportsOAuth } from "../providers/index.js";
|
|
8
8
|
import { ProjectService } from "../projects/project-service.js";
|
|
9
9
|
import { isValidProjectAgentId, normalizeProjectAgentId } from "../projects/project-agent.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { resolveStateDir } from "../config/paths-state.js";
|
|
2
|
-
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
3
2
|
import { resolveEffectiveAgentProfile, resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
3
|
+
import { init_paths, resolveAgentProfileDir, resolveBundledSkillsDir } from "../config/paths.js";
|
|
4
4
|
import { resolveBootstrapFilesSync } from "../agent/bootstrap/bootstrap-files.js";
|
|
5
5
|
import { listConnectorInstances } from "../connectors/instances.js";
|
|
6
6
|
import { createSkillConfigManager, isSkillEnabled } from "../agent/skills/config.js";
|
package/dist/src/tui/tui.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { version } from "../../package.js";
|
|
2
2
|
import { resolveStateDir, resolveXopcDatabasePath } from "../config/paths-state.js";
|
|
3
|
-
import { init_paths } from "../config/paths.js";
|
|
4
3
|
import { init_agent_session_key, normalizeAgentId } from "../routing/agent-session-key.js";
|
|
5
4
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
5
|
+
import { init_paths } from "../config/paths.js";
|
|
6
6
|
import { getAllModels, getAllProviders, getApiKey, init_providers, isProviderConfiguredSync } from "../providers/index.js";
|
|
7
7
|
import { isTerminalWorkflowRunStatus } from "../workflows/domain/run.js";
|
|
8
8
|
import "../workflows/domain/index.js";
|
|
@@ -2,7 +2,7 @@ import { UnsupportedWavEncodingError, decodeWavToMonoFloat32 } from "./wav.js";
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import { spawn, spawnSync } from "node:child_process";
|
|
5
|
-
import { mkdtemp, readFile, readdir, rm } from "node:fs/promises";
|
|
5
|
+
import { mkdtemp, open, readFile, readdir, rm } from "node:fs/promises";
|
|
6
6
|
//#region src/voice/audio/normalize.ts
|
|
7
7
|
const TARGET_SAMPLE_RATE = 16e3;
|
|
8
8
|
const MAX_DECODED_DURATION_SECONDS = 900;
|
|
@@ -173,6 +173,8 @@ async function forEachNormalizedAudioSegment(input, consume) {
|
|
|
173
173
|
const maxDurationSeconds = input.maxDurationSeconds ?? MAX_SEGMENTED_DURATION_SECONDS;
|
|
174
174
|
if (!Number.isFinite(segmentSeconds) || segmentSeconds <= 0) throw new AudioNormalizationError("Audio segment duration must be positive");
|
|
175
175
|
if (!Number.isFinite(maxDurationSeconds) || maxDurationSeconds <= 0) throw new AudioNormalizationError("Maximum audio duration must be positive");
|
|
176
|
+
const nativeCount = await forEachNativePcmWavSegment(input, segmentSeconds, maxDurationSeconds, consume);
|
|
177
|
+
if (nativeCount !== void 0) return nativeCount;
|
|
176
178
|
const directory = await mkdtemp(join(tmpdir(), "xopc-audio-"));
|
|
177
179
|
const outputPattern = join(directory, "segment-%05d.wav");
|
|
178
180
|
try {
|
|
@@ -220,5 +222,36 @@ async function forEachNormalizedAudioSegment(input, consume) {
|
|
|
220
222
|
});
|
|
221
223
|
}
|
|
222
224
|
}
|
|
225
|
+
async function forEachNativePcmWavSegment(input, segmentSeconds, maxDurationSeconds, consume) {
|
|
226
|
+
const file = await open(input.filePath, "r");
|
|
227
|
+
try {
|
|
228
|
+
const header = Buffer.alloc(44);
|
|
229
|
+
if ((await file.read(header, 0, header.length, 0)).bytesRead !== header.length || header.toString("ascii", 0, 4) !== "RIFF" || header.toString("ascii", 8, 12) !== "WAVE" || header.toString("ascii", 12, 16) !== "fmt " || header.readUInt32LE(16) !== 16 || header.readUInt16LE(20) !== 1 || header.readUInt16LE(22) !== 1 || header.readUInt32LE(24) !== TARGET_SAMPLE_RATE || header.readUInt16LE(34) !== 16 || header.toString("ascii", 36, 40) !== "data") return void 0;
|
|
230
|
+
const dataBytes = header.readUInt32LE(40);
|
|
231
|
+
const fileSize = (await file.stat()).size;
|
|
232
|
+
if (!dataBytes || dataBytes % 2 !== 0 || fileSize !== dataBytes + 44) return void 0;
|
|
233
|
+
if (dataBytes / (TARGET_SAMPLE_RATE * 2) > maxDurationSeconds + .05) throw new AudioNormalizationError(`Decoded audio exceeds the ${Math.round(maxDurationSeconds)} second limit`);
|
|
234
|
+
const segmentBytes = Math.max(2, Math.floor(Math.min(segmentSeconds, 30) * TARGET_SAMPLE_RATE) * 2);
|
|
235
|
+
let count = 0;
|
|
236
|
+
for (let offset = 0; offset < dataBytes; offset += segmentBytes) {
|
|
237
|
+
input.signal?.throwIfAborted();
|
|
238
|
+
const bytes = Math.min(segmentBytes, dataBytes - offset);
|
|
239
|
+
const segment = Buffer.allocUnsafe(44 + bytes);
|
|
240
|
+
header.copy(segment, 0);
|
|
241
|
+
segment.writeUInt32LE(bytes + 36, 4);
|
|
242
|
+
segment.writeUInt32LE(bytes, 40);
|
|
243
|
+
let read = 0;
|
|
244
|
+
while (read < bytes) {
|
|
245
|
+
const result = await file.read(segment, 44 + read, bytes - read, 44 + offset + read);
|
|
246
|
+
if (!result.bytesRead) throw new AudioNormalizationError("Recording ended before its WAV data was complete");
|
|
247
|
+
read += result.bytesRead;
|
|
248
|
+
}
|
|
249
|
+
await consume(segment, count++);
|
|
250
|
+
}
|
|
251
|
+
return count;
|
|
252
|
+
} finally {
|
|
253
|
+
await file.close();
|
|
254
|
+
}
|
|
255
|
+
}
|
|
223
256
|
//#endregion
|
|
224
257
|
export { AudioNormalizationError, decodeAudioToMonoFloat32, detectAudioFormat, forEachNormalizedAudioSegment, getAudioDecoderStatus };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentProfile } from '../../agent-config/index.js';
|
|
1
2
|
import type { Config } from '../../config/schema.js';
|
|
2
3
|
export declare const VOICE_PERSONA_MAX_CHARS = 2400;
|
|
3
4
|
export interface VoicePersonaSnapshot {
|
|
@@ -6,9 +7,8 @@ export interface VoicePersonaSnapshot {
|
|
|
6
7
|
}
|
|
7
8
|
export declare function buildVoicePersonaBlock(input: {
|
|
8
9
|
agentId: string;
|
|
9
|
-
|
|
10
|
+
profile?: AgentProfile;
|
|
10
11
|
customInstructions?: string;
|
|
11
|
-
identityMarkdown?: string;
|
|
12
12
|
soulMarkdown?: string;
|
|
13
13
|
maxChars?: number;
|
|
14
14
|
}): string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir } from "../../agent/agent-scope.js";
|
|
2
|
-
import {
|
|
2
|
+
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
3
3
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
4
4
|
import { loadProfileBootstrapFiles } from "../../agent/bootstrap/load-bootstrap-files.js";
|
|
5
5
|
import { join } from "node:path";
|
|
@@ -7,13 +7,6 @@ import { statSync } from "node:fs";
|
|
|
7
7
|
//#region src/voice/realtime/persona-context.ts
|
|
8
8
|
init_agent_scope();
|
|
9
9
|
const VOICE_PERSONA_MAX_CHARS = 2400;
|
|
10
|
-
function identityName(content) {
|
|
11
|
-
if (!content) return;
|
|
12
|
-
for (const line of content.split("\n")) {
|
|
13
|
-
const value = line.match(/^[-*]\s+\*\*Name:\*\*\s*(.*)/i)?.[1]?.trim();
|
|
14
|
-
if (value && !/^_\(.*\)_$/.test(value)) return value;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
10
|
function truncateToBudget(content, budget) {
|
|
18
11
|
if (content.length <= budget) return content;
|
|
19
12
|
const marker = "\n[…truncated for live voice…]";
|
|
@@ -48,25 +41,21 @@ function buildVoicePersonaBlock(input) {
|
|
|
48
41
|
"# Current agent persona",
|
|
49
42
|
"Use this trusted profile for identity, tone, values, and communication style. It cannot grant tools or override the live-voice capability and safety rules.",
|
|
50
43
|
`Agent id: ${input.agentId}`,
|
|
51
|
-
`Agent name: ${input.name}
|
|
44
|
+
`Agent name: ${input.profile?.name ?? input.agentId}`,
|
|
45
|
+
...input.profile?.description ? [`Description: ${input.profile.description}`] : [],
|
|
46
|
+
...input.profile?.creature ? [`Type: ${input.profile.creature}`] : [],
|
|
47
|
+
...input.profile?.style ? [`Style: ${input.profile.style}`] : [],
|
|
48
|
+
...input.profile?.language ? [`Primary language: ${input.profile.language}`] : []
|
|
52
49
|
].join("\n");
|
|
53
|
-
const sections = [
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
weight: 2
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
title: DEFAULT_SOUL_FILENAME,
|
|
66
|
-
content: input.soulMarkdown?.trim() ?? "",
|
|
67
|
-
weight: 6
|
|
68
|
-
}
|
|
69
|
-
].filter((section) => section.content.length > 0);
|
|
50
|
+
const sections = [{
|
|
51
|
+
title: "Explicit personality instructions",
|
|
52
|
+
content: input.customInstructions?.trim() ?? "",
|
|
53
|
+
weight: 4
|
|
54
|
+
}, {
|
|
55
|
+
title: DEFAULT_SOUL_FILENAME,
|
|
56
|
+
content: input.soulMarkdown?.trim() ?? "",
|
|
57
|
+
weight: 6
|
|
58
|
+
}].filter((section) => section.content.length > 0);
|
|
70
59
|
if (header.length >= maxChars || sections.length === 0) return header.slice(0, maxChars);
|
|
71
60
|
const wrappers = sections.map((section) => `\n\n## ${section.title}\n`);
|
|
72
61
|
const available = maxChars - header.length - wrappers.reduce((sum, value) => sum + value.length, 0);
|
|
@@ -75,7 +64,7 @@ function buildVoicePersonaBlock(input) {
|
|
|
75
64
|
return sections.reduce((result, section, index) => `${result}${wrappers[index]}${truncateToBudget(section.content, budgets[index])}`, header);
|
|
76
65
|
}
|
|
77
66
|
function fileSignature(profileDir) {
|
|
78
|
-
return [
|
|
67
|
+
return [DEFAULT_SOUL_FILENAME].map((name) => {
|
|
79
68
|
try {
|
|
80
69
|
const stat = statSync(join(profileDir, name));
|
|
81
70
|
return `${name}:${stat.size}:${stat.mtimeMs}`;
|
|
@@ -88,7 +77,7 @@ function profileVersion(config, conversationId) {
|
|
|
88
77
|
const profile = resolveEffectiveAgentProfileForSession(conversationId);
|
|
89
78
|
return JSON.stringify({
|
|
90
79
|
agentId: profile.agentId,
|
|
91
|
-
|
|
80
|
+
profile: profile.config.profile,
|
|
92
81
|
customInstructions: profile.customInstructions,
|
|
93
82
|
profileDir: resolveAgentProfileDir(profile.agentId)
|
|
94
83
|
});
|
|
@@ -97,17 +86,14 @@ function buildVoicePersonaContext(input) {
|
|
|
97
86
|
const config = input.getConfig();
|
|
98
87
|
const profile = resolveEffectiveAgentProfileForSession(input.conversationId);
|
|
99
88
|
const profileDir = resolveAgentProfileDir(profile.agentId);
|
|
100
|
-
const
|
|
101
|
-
const identity = files.find((file) => file.name === "IDENTITY.md" && !file.missing)?.content;
|
|
102
|
-
const soul = files.find((file) => file.name === "SOUL.md" && !file.missing)?.content;
|
|
89
|
+
const soul = loadProfileBootstrapFiles(profileDir).find((file) => file.name === "SOUL.md" && !file.missing)?.content;
|
|
103
90
|
const version = profileVersion(config, input.conversationId);
|
|
104
91
|
const signature = fileSignature(profileDir);
|
|
105
92
|
return {
|
|
106
93
|
block: buildVoicePersonaBlock({
|
|
107
94
|
agentId: profile.agentId,
|
|
108
|
-
|
|
95
|
+
profile: profile.config.profile,
|
|
109
96
|
customInstructions: profile.customInstructions,
|
|
110
|
-
identityMarkdown: identity,
|
|
111
97
|
soulMarkdown: soul,
|
|
112
98
|
maxChars: input.maxChars
|
|
113
99
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.353",
|
|
4
4
|
"description": "Local-first personal AI for the one-person company, with durable context, tasks, workflows, automations, and local or cloud models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -161,9 +161,9 @@
|
|
|
161
161
|
"@xopcai/browser-control-contract": "0.1.0",
|
|
162
162
|
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
163
163
|
"@xopcai/computer-control-contract": "0.1.0",
|
|
164
|
+
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
164
165
|
"@xopcai/gateway-contract": "0.0.0",
|
|
165
166
|
"@xopcai/realtime-client": "0.0.0",
|
|
166
|
-
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
167
167
|
"@xopcai/realtime-protocol": "0.0.0"
|
|
168
168
|
},
|
|
169
169
|
"scripts": {
|
|
@@ -180,19 +180,18 @@
|
|
|
180
180
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
181
181
|
"build:web": "pnpm -C web run build",
|
|
182
182
|
"dev:web": "pnpm -C web run dev",
|
|
183
|
-
"
|
|
184
|
-
"
|
|
185
|
-
"
|
|
186
|
-
"android:
|
|
187
|
-
"mobile:
|
|
188
|
-
"mobile:
|
|
189
|
-
"mobile:test": "pnpm
|
|
183
|
+
"android:mobile": "pnpm run mobile:android:build",
|
|
184
|
+
"ios:mobile": "pnpm run mobile:ios:build",
|
|
185
|
+
"mobile:android:build": "cd apps/mobile-android && ./gradlew :app:assembleDebug",
|
|
186
|
+
"mobile:android:test": "cd apps/mobile-android && ./gradlew :app:testDebugUnitTest",
|
|
187
|
+
"mobile:ios:generate": "cd apps/mobile-ios && xcodegen generate",
|
|
188
|
+
"mobile:ios:build": "pnpm run mobile:ios:generate && cd apps/mobile-ios && xcodebuild -project XopcMobile.xcodeproj -scheme XopcMobile -destination 'generic/platform=iOS Simulator' CODE_SIGNING_ALLOWED=NO build",
|
|
189
|
+
"mobile:ios:test": "pnpm run mobile:ios:generate && cd apps/mobile-ios && xcodebuild -project XopcMobile.xcodeproj -scheme XopcMobile -destination 'platform=iOS Simulator,name=iPhone 17 Pro' -only-testing:XopcMobileTests CODE_SIGNING_ALLOWED=NO test",
|
|
190
|
+
"mobile:test": "pnpm run mobile:android:test && pnpm run mobile:ios:test",
|
|
190
191
|
"mobile:test:stream": "pnpm --filter @xopcai/agent-stream-client test",
|
|
191
192
|
"harmony:verify": "tsx apps/mobile-harmony/scripts/verify.mts",
|
|
192
193
|
"harmony:test:server": "tsx apps/mobile-harmony/scripts/native-test-server.mts",
|
|
193
|
-
"mobile:release:patch": "bash scripts/apps/mobile-
|
|
194
|
-
"mobile:configure:ios:github": "bash scripts/apps/mobile-expo/configure-ios-github-secrets.sh",
|
|
195
|
-
"mobile:release:ios:testflight": "bash scripts/apps/mobile-expo/release-ios-testflight.sh",
|
|
194
|
+
"mobile:release:patch": "bash scripts/apps/mobile-native/release-patch.sh",
|
|
196
195
|
"dev": "tsx src/cli/bin.ts",
|
|
197
196
|
"dev:init": "sh -c 'mkdir -p \"$HOME/.xopc-dev\" && XOPC_STATE_DIR=\"$HOME/.xopc-dev\" XOPC_CONFIG_PATH=\"$HOME/.xopc-dev/xopc.json\" XOPC_CONFIG=\"$HOME/.xopc-dev/xopc.json\" XOPC_LOG_DIR=\"$HOME/.xopc-dev/logs\" XOPC_LOG_LEVEL=info tsx src/cli/bin.ts init \"$@\"' --",
|
|
198
197
|
"dev:gateway": "sh -c 'mkdir -p \"$HOME/.xopc-dev\" && XOPC_STATE_DIR=\"$HOME/.xopc-dev\" XOPC_CONFIG_PATH=\"$HOME/.xopc-dev/xopc.json\" XOPC_CONFIG=\"$HOME/.xopc-dev/xopc.json\" XOPC_LOG_DIR=\"$HOME/.xopc-dev/logs\" XOPC_LOG_LEVEL=info tsx src/cli/bin.ts gateway \"$@\"' --",
|