@xopcai/xopc 0.0.358 → 0.0.360
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/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +1 -1
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DEs_xwQi.js → agent-avatar-dicebear-CQTERenW.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CPF0lunJ.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BjDaZlKy.js +1 -0
- package/dist/gateway/static/root/assets/agents-XopBILLB.js +66 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-BqyvMQXO.js → app-management-settings-panel-V5QVeMvW.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-Cn9qgXLw.js → appearance-settings-BDkRcoI6.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-ChPOmrPa.js → apps-page-DzCyL89L.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-OUapkL2D.js → automations-page-DOu1wMOV.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-CiY_2otj.js +7 -0
- package/dist/gateway/static/root/assets/{block-editor-_-QK0EnY.js → block-editor-K6is5GrS.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CnLQ649y.js → browser-automation-inputs-MmkUGn9W.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-DZlWdikj.js → browser-automations-page-B8IiXEBs.js} +2 -2
- package/dist/gateway/static/root/assets/{browser-settings-page-CEF_LSjz.js → browser-settings-page-Cms2Bu3Q.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-page-BAFRNHQv.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Cws6od1d.js +8 -0
- package/dist/gateway/static/root/assets/{capability-header-actions-CA_XNTSW.js → capability-header-actions-wh3Nr0qS.js} +1 -1
- package/dist/gateway/static/root/assets/channels-DxwismTc.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DRV-4qeP.js → chat-terminal-dock-BU-X9nu1.js} +2 -2
- package/dist/gateway/static/root/assets/computer-settings-page-MyXsSqFJ.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-BKAt0jvO.js → connector-service-page-DyxPM_MZ.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-C7-OC3MW.js +2 -0
- package/dist/gateway/static/root/assets/{constants-Co2_smKQ.js → constants-Dy8Gw0sF.js} +1 -1
- package/dist/gateway/static/root/assets/date-picker-WRFvi7Pu.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-D0RWVtBt.js → dependency-picker-CLun5Tst.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-9B1PIjsV.js → desktop-pet-iaVa9vVM.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-cq5n59Pr.js → desktop-pet-settings-0RS3sP3Z.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DVAGb04L.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-C40-GlX1.js → directory-picker-path-field-Btlldlt3.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BodxNAys.js → extension-debug-page-BImQT4PU.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-BshgQ_pO.js → extension-page-BmuLv-ET.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-aigS3RJu.js → extension-provider-Dg7cRxDX.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DAJZVzIQ.js → extension-settings-page-7Kr8UJK4.js} +1 -1
- package/dist/gateway/static/root/assets/fallback-models-B0w1lumZ.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-DmPvmwYp.js +1 -0
- package/dist/gateway/static/root/assets/home-page-N0Mp-eTJ.js +1 -0
- package/dist/gateway/static/root/assets/{imports-page-Bsn8Qted.js → imports-page-BLOJY67-.js} +1 -1
- package/dist/gateway/static/root/assets/{index-DUgsBdV3.css → index-B7AHDHSO.css} +1 -1
- package/dist/gateway/static/root/assets/index-BXrBL_Hb.js +106 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-DjuXyBbC.js → keyboard-shortcuts-settings-Dlbsip2R.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-D77r2CKa.js → local-app-workbench-page-nyWeTK0r.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-GsohMT3J.js → local-apps-page-CfEpFLs0.js} +1 -1
- package/dist/gateway/static/root/assets/{logs-page-DeBeNPb4.js → logs-page-A38cawkA.js} +2 -2
- package/dist/gateway/static/root/assets/{management-settings-Di9r7yBX.js → management-settings-Cse9K61x.js} +1 -1
- package/dist/gateway/static/root/assets/{note-detail-panel-CLq8afeQ.js → note-detail-panel-CUGVyo2V.js} +3 -3
- package/dist/gateway/static/root/assets/notes-page-Dk89l5dC.js +8 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-C9H1dHg2.js → page-context-capture-button-C72qIgBg.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-DCtduzh8.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-BgSdSbCL.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-pW662VEC.js → product-open-page-CT98FsVl.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-3_Bqq0OV.js → project-detail-page-BlqOVwKP.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-D85PDbCM.js → projects-page-DVN2q_yR.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BP5kUgIN.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BUgsyhm_.js → runtime-tools-settings-panel-ry0jprz7.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-Bds4V34P.js → scenes-page-CV1GkOj6.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BQz6ezGe.js → schema-form-C5zMrxgR.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-OaBPDJ9E.js → send-session-input-Dt0t5SoR.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-DDR-gv_e.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-BXtGeOsR.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CvFVkELy.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CKmMkdPu.js → settings-page-C88fsfZF.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-Cjv6CDgq.js → setup-status-panel-DESlRgZS.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-QAjExHAL.js → share-link-dialog-BvSRHs1P.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-M_rAQR60.js → share-preview-page-D5Gey-6E.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-btoP07Fx.js +1 -0
- package/dist/gateway/static/root/assets/{skill-api-BO1b2oYj.js → skill-api-1hbX3qDC.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DYJbwwBT.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-CIDRPUj4.js → system-settings-panel-DbNk-Jwq.js} +1 -1
- package/dist/gateway/static/root/assets/{task-detail-page-ZmkA0E9f.js → task-detail-page-DoLKOJrE.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-BkgD61qc.js → tunnel-api-H3FheXYH.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-BjgYDab4.js → usage-page-DGbqcsV6.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-qK3z-EGz.js → use-composer-attachments-pzPAUV_o.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-D809I8ur.js → use-file-preview-expanded-DNhXjL0W.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-7pW4Pazn.js +2 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Ce3PKQvh.js → work-discovery-overlay-DfyI9kVf.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-Dv6xUycS.js → workflow-run-setup-panel-De80GODZ.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BuH3pC1C.js +6 -0
- package/dist/gateway/static/root/assets/{workspace-api-BtXzxf_w.js → workspace-api-Dwa8kHdY.js} +2 -2
- package/dist/gateway/static/root/index.html +11 -12
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/task-result-delivery.js +30 -0
- package/dist/src/agent/agent-manager.js +13 -13
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/prompts.js +1 -1
- package/dist/src/agent/background-review/run-background-review.js +3 -3
- package/dist/src/agent/coding/repository-instructions.js +1 -1
- package/dist/src/agent/context/coordinator.js +2 -2
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +2 -2
- package/dist/src/agent/context/project-context.js +3 -3
- package/dist/src/agent/context/workspace-templates/SOUL.md +2 -0
- package/dist/src/agent/data-acquisition/service.js +1 -1
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +4 -4
- package/dist/src/agent/embedded/run-turn.js +5 -5
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/embedded/tool-result-truncation.js +1 -1
- package/dist/src/agent/external-tools/cliProvider.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +3 -3
- package/dist/src/agent/external-tools/gateway-tools.js +42 -2
- package/dist/src/agent/external-tools/mcp-provider.js +3 -3
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-config.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/mcp/plugin-http-fetch.js +1 -1
- package/dist/src/agent/memory/context-recovery.js +1 -1
- package/dist/src/agent/memory/index.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +1 -1
- package/dist/src/agent/prompt/sections/behavior.js +4 -1
- package/dist/src/agent/prompt/sections/memory-skills.js +2 -0
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/sandbox/exec-policy.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +4 -4
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +20 -20
- package/dist/src/agent/session/session-config-service.js +12 -4
- package/dist/src/agent/session/session-hydrator.js +1 -1
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/source-context/index.js +2 -2
- package/dist/src/agent/tasks/task-judge-service.js +4 -4
- package/dist/src/agent/tools/create-share-tool.js +3 -3
- package/dist/src/agent/tools/dataBatch.js +1 -1
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/delegation-parent-policy.js +1 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +48 -22
- package/dist/src/agent/tools/fetch-text.js +1 -1
- package/dist/src/agent/tools/image-generate-tool.js +3 -3
- package/dist/src/agent/tools/index.js +6 -6
- package/dist/src/agent/tools/list-dir.js +1 -1
- package/dist/src/agent/tools/personal-preference-tool.js +11 -0
- package/dist/src/agent/tools/personal-request-result-tool.d.ts +22 -0
- package/dist/src/agent/tools/personal-request-result-tool.js +84 -0
- package/dist/src/agent/tools/personal-request-tool.d.ts +3 -0
- package/dist/src/agent/tools/personal-request-tool.js +100 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +6 -0
- package/dist/src/agent/tools/personal-task-tool.js +14 -12
- package/dist/src/agent/tools/publish-artifacts.js +2 -2
- package/dist/src/agent/tools/read.js +2 -2
- package/dist/src/agent/tools/review-workspace.js +1 -1
- package/dist/src/agent/tools/send-media.js +2 -2
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/tool-media.js +2 -3
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +2 -2
- package/dist/src/agent/tools/xopc-use-tool.js +3 -3
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/index.js +4 -4
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/backup/archive.js +1 -1
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/chat-commands/builtins/config.js +3 -3
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +3 -3
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +6 -6
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/channel-plugins.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/gateway-health.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +2 -2
- package/dist/src/cli/commands/doctor/checks/tool-runtimes.js +1 -1
- package/dist/src/cli/commands/extension-agent-plugin.js +2 -2
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension.js +4 -4
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard.js +1 -1
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tunnel.js +4 -4
- package/dist/src/cli/extension-cli-register.js +5 -5
- package/dist/src/cli/templates.js +4 -0
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/cli/utils/session.js +1 -1
- package/dist/src/computer/runtime.js +2 -2
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/connectors/cli/authorization.js +1 -1
- package/dist/src/connectors/cli/runtime.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -1
- package/dist/src/connectors/composio.js +1 -1
- package/dist/src/connectors/connected-source-understanding.js +3 -3
- package/dist/src/connectors/connection-recovery-service.d.ts +2 -0
- package/dist/src/connectors/connection-recovery-service.js +28 -10
- package/dist/src/connectors/health.js +1 -1
- package/dist/src/connectors/plugin-mcp-recovery.js +1 -1
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/recording.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/extensions/activation-context.js +3 -3
- package/dist/src/extensions/api.js +4 -4
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +3 -3
- package/dist/src/extensions/install.js +1 -1
- package/dist/src/extensions/loader.js +2 -2
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/sdk/media.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +1 -1
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/global-defaults-admin.js +1 -1
- package/dist/src/gateway/hono/app.js +3 -3
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +1 -1
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +4 -4
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +5 -4
- package/dist/src/gateway/hono/routes/models.js +6 -6
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.js +69 -1
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +3 -3
- package/dist/src/gateway/hono/routes/sessions.js +2 -2
- package/dist/src/gateway/hono/routes/shares.js +3 -3
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/user-model-refresh.js +1 -1
- package/dist/src/gateway/hono/routes/user-model.js +5 -5
- package/dist/src/gateway/hono/routes/voice.js +7 -7
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/lock.js +11 -11
- package/dist/src/gateway/media-access.js +3 -3
- package/dist/src/gateway/mobile-privacy.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/run-loop.js +1 -1
- package/dist/src/gateway/scenes/mailContext.js +1 -1
- package/dist/src/gateway/scenes/slackThreadSource.js +1 -1
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/agent-runner.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/gateway/service/session-command-service.js +2 -2
- package/dist/src/gateway/service/sessions-api.js +1 -1
- package/dist/src/gateway/service.d.ts +3 -0
- package/dist/src/gateway/service.js +81 -40
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +10 -10
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/mcp/gateway-http-client.js +1 -1
- package/dist/src/media/index.js +2 -2
- package/dist/src/media/session-references.d.ts +2 -0
- package/dist/src/media/session-references.js +22 -2
- package/dist/src/media/store.d.ts +1 -0
- package/dist/src/media/store.js +2 -1
- package/dist/src/media-understanding/openai-compatible-audio.js +1 -1
- package/dist/src/notes/agent-context.js +4 -4
- package/dist/src/notes/index.js +1 -1
- package/dist/src/notes/service.js +1 -1
- package/dist/src/notes/store.js +1 -1
- package/dist/src/personal-agent/capability-service.d.ts +14 -0
- package/dist/src/personal-agent/capability-service.js +63 -0
- package/dist/src/personal-agent/communication.d.ts +4 -0
- package/dist/src/personal-agent/communication.js +24 -0
- package/dist/src/personal-agent/model-config.d.ts +5 -0
- package/dist/src/personal-agent/model-config.js +59 -0
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +2 -0
- package/dist/src/personal-agent/repository.d.ts +1 -0
- package/dist/src/personal-agent/repository.js +3 -1
- package/dist/src/personal-agent/request-delivery.d.ts +4 -0
- package/dist/src/personal-agent/request-delivery.js +159 -0
- package/dist/src/personal-agent/request-repository.d.ts +33 -0
- package/dist/src/personal-agent/request-repository.js +71 -0
- package/dist/src/personal-agent/request-result.d.ts +21 -0
- package/dist/src/personal-agent/request-result.js +45 -0
- package/dist/src/personal-agent/request-service.d.ts +18 -0
- package/dist/src/personal-agent/request-service.js +308 -0
- package/dist/src/personal-agent/service.js +30 -7
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/scenes/taskFollowUp/agentExecutor.js +4 -4
- package/dist/src/scenes/taskFollowUp/resources.js +1 -1
- package/dist/src/scenes/taskFollowUp/service.js +4 -4
- package/dist/src/session/client-history.d.ts +2 -1
- package/dist/src/session/client-history.js +40 -0
- package/dist/src/session/compact-history.js +9 -5
- package/dist/src/session/config-store.js +2 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/resolve-session.js +1 -1
- package/dist/src/session/session-context-for-llm.js +55 -0
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +6 -4
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/session/types.d.ts +2 -0
- package/dist/src/share/share-store.js +1 -1
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +5 -1
- package/dist/src/storage/sqlite/connection-wait-repository.js +38 -8
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/storage/sqlite/migrations/231_task_result_deliveries.sql +32 -0
- package/dist/src/storage/sqlite/migrations/232_personal_requests.sql +28 -0
- package/dist/src/storage/sqlite/migrations/runner.d.ts +1 -1
- package/dist/src/storage/sqlite/migrations/runner.js +3 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-repository.js +33 -0
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +3 -3
- package/dist/src/tasks/index.js +4 -4
- package/dist/src/tasks/task-application-service.d.ts +1 -0
- package/dist/src/tasks/task-application-service.js +10 -3
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +2 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tasks/task-main-update-delivery.js +32 -1
- package/dist/src/tasks/task-result-delivery-repository.d.ts +18 -0
- package/dist/src/tasks/task-result-delivery-repository.js +144 -0
- package/dist/src/tasks/task-result-delivery-service.d.ts +4 -0
- package/dist/src/tasks/task-result-delivery-service.js +128 -0
- package/dist/src/tasks/task-run-coordinator.js +6 -1
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -0
- package/dist/src/tasks/task-run-dispatcher.js +22 -3
- package/dist/src/tui/backends/embedded-backend.js +10 -10
- package/dist/src/tui/backends/gateway-realtime-backend.js +1 -1
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +6 -6
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +4 -4
- package/dist/src/tui/tui.js +7 -7
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/realtime/runtime.js +4 -4
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/alibaba-transcription.js +1 -1
- package/dist/src/voice/stt/providers/xopc-cloud-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/providers/xopc-cloud-speech.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/incremental-repository.js +1 -1
- package/dist/src/work-discovery/index.js +1 -1
- package/dist/src/work-discovery/service.js +5 -5
- package/dist/src/workflows/engine/workflow-engine.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +8 -8
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B23VK3UU.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BuKJ-Ybo.js +0 -1
- package/dist/gateway/static/root/assets/agents-DxH-UFs7.js +0 -66
- package/dist/gateway/static/root/assets/automations-workspace-DMqpfefB.js +0 -7
- package/dist/gateway/static/root/assets/capabilities-page-KUggKcIq.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CD5K7e1B.js +0 -8
- package/dist/gateway/static/root/assets/channels-CG_xCUnf.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-CqY40STw.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Cn14oruE.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-B4jSGi8k.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DKO8iqDJ.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DAQu7q_Q.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BHS2713D.js +0 -1
- package/dist/gateway/static/root/assets/index-BcTY7RBG.js +0 -106
- package/dist/gateway/static/root/assets/notes-page-FORwlFnt.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-BpTFGG44.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-BNZZDJpO.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CzzTxbhr.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-BK5IvdGz.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-DkXKhSWK.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-C7ww6VRj.js +0 -1
- package/dist/gateway/static/root/assets/settings-shell-layer-context-BTQUDoJ2.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DXpj-oOC.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-cwXzLyU0.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-DpPGpkkg.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-CgJlVdec.js +0 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolveBrewPathDirs } from "./brew.js";
|
|
2
2
|
import os from "node:os";
|
|
3
3
|
import path from "node:path";
|
|
4
|
-
import
|
|
4
|
+
import fs from "node:fs";
|
|
5
5
|
//#region src/infra/path-env.ts
|
|
6
6
|
function isTruthyEnvValue(value) {
|
|
7
7
|
if (!value) return false;
|
|
@@ -10,7 +10,7 @@ function isTruthyEnvValue(value) {
|
|
|
10
10
|
}
|
|
11
11
|
function isExecutable(filePath) {
|
|
12
12
|
try {
|
|
13
|
-
|
|
13
|
+
fs.accessSync(filePath, fs.constants.X_OK);
|
|
14
14
|
return true;
|
|
15
15
|
} catch {
|
|
16
16
|
return false;
|
|
@@ -18,7 +18,7 @@ function isExecutable(filePath) {
|
|
|
18
18
|
}
|
|
19
19
|
function isDirectory(dirPath) {
|
|
20
20
|
try {
|
|
21
|
-
return
|
|
21
|
+
return fs.statSync(dirPath).isDirectory();
|
|
22
22
|
} catch {
|
|
23
23
|
return false;
|
|
24
24
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { resolveExecPathBinPrepend } from "./path-env.js";
|
|
2
1
|
import { applyPathPrepend } from "./path-prepend.js";
|
|
2
|
+
import { resolveExecPathBinPrepend } from "./path-env.js";
|
|
3
3
|
import { readPackageVersion } from "./package-json.js";
|
|
4
4
|
import { createDefaultCommandRunner } from "./run-command.js";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import
|
|
7
|
-
import fs from "node:fs/promises";
|
|
6
|
+
import fs from "node:fs";
|
|
7
|
+
import fs$1 from "node:fs/promises";
|
|
8
8
|
//#region src/infra/update-global.ts
|
|
9
9
|
const XOPC_PACKAGE_NAME = "@xopcai/xopc";
|
|
10
10
|
const GLOBAL_RENAME_PREFIX = ".";
|
|
@@ -18,7 +18,7 @@ const NPM_GLOBAL_INSTALL_OMIT_OPTIONAL_FLAGS = ["--omit=optional", ...NPM_GLOBAL
|
|
|
18
18
|
const GLOBAL_DETECT_TIMEOUT_MS = 15e3;
|
|
19
19
|
async function pathExists(targetPath) {
|
|
20
20
|
try {
|
|
21
|
-
await fs.access(targetPath);
|
|
21
|
+
await fs$1.access(targetPath);
|
|
22
22
|
return true;
|
|
23
23
|
} catch {
|
|
24
24
|
return false;
|
|
@@ -26,7 +26,7 @@ async function pathExists(targetPath) {
|
|
|
26
26
|
}
|
|
27
27
|
async function tryRealpath(targetPath) {
|
|
28
28
|
try {
|
|
29
|
-
return await fs.realpath(targetPath);
|
|
29
|
+
return await fs$1.realpath(targetPath);
|
|
30
30
|
} catch {
|
|
31
31
|
return path.resolve(targetPath);
|
|
32
32
|
}
|
|
@@ -49,14 +49,14 @@ function resolvePreferredNpmCommand(pkgRoot) {
|
|
|
49
49
|
const prefix = inferNpmPrefixFromPackageRoot(pkgRoot);
|
|
50
50
|
if (!prefix) return null;
|
|
51
51
|
const candidate = process.platform === "win32" ? path.join(prefix, "npm.cmd") : path.join(prefix, "bin", "npm");
|
|
52
|
-
return
|
|
52
|
+
return fs.existsSync(candidate) ? candidate : null;
|
|
53
53
|
}
|
|
54
54
|
function resolveNpmFromExecPath() {
|
|
55
55
|
const execPath = process.execPath?.trim();
|
|
56
56
|
if (!execPath) return null;
|
|
57
57
|
const binDir = path.dirname(execPath);
|
|
58
58
|
const candidate = process.platform === "win32" ? path.join(binDir, "npm.cmd") : path.join(binDir, "npm");
|
|
59
|
-
return
|
|
59
|
+
return fs.existsSync(candidate) ? candidate : null;
|
|
60
60
|
}
|
|
61
61
|
function resolvePreferredGlobalManagerCommand(manager, pkgRoot) {
|
|
62
62
|
if (manager !== "npm") return manager;
|
|
@@ -204,7 +204,7 @@ async function cleanupGlobalRenameDirs(params) {
|
|
|
204
204
|
const prefix = `${GLOBAL_RENAME_PREFIX}${name}-`;
|
|
205
205
|
let entries = [];
|
|
206
206
|
try {
|
|
207
|
-
entries = await fs.readdir(root);
|
|
207
|
+
entries = await fs$1.readdir(root);
|
|
208
208
|
} catch {
|
|
209
209
|
return { removed };
|
|
210
210
|
}
|
|
@@ -212,8 +212,8 @@ async function cleanupGlobalRenameDirs(params) {
|
|
|
212
212
|
if (!entry.startsWith(prefix)) continue;
|
|
213
213
|
const target = path.join(root, entry);
|
|
214
214
|
try {
|
|
215
|
-
if (!(await fs.lstat(target)).isDirectory()) continue;
|
|
216
|
-
await fs.rm(target, {
|
|
215
|
+
if (!(await fs$1.lstat(target)).isDirectory()) continue;
|
|
216
|
+
await fs$1.rm(target, {
|
|
217
217
|
recursive: true,
|
|
218
218
|
force: true
|
|
219
219
|
});
|
|
@@ -7,9 +7,9 @@ import { ExtensionCapabilityBindingsSchema, extensionCapabilityPermissions } fro
|
|
|
7
7
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
8
8
|
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
9
9
|
import { init_paths, resolveExtensionsDir } from "../config/paths.js";
|
|
10
|
+
import { LocalAppStore } from "./store.js";
|
|
10
11
|
import { slugifyProjectName } from "../projects/project-store.js";
|
|
11
12
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
12
|
-
import { LocalAppStore } from "./store.js";
|
|
13
13
|
import { validateLocalAppCapabilityContracts } from "./capabilities/contracts.js";
|
|
14
14
|
import { buildLocalAppFixGuidance } from "./fix-guidance.js";
|
|
15
15
|
import { readLocalAppAcceptanceConfig } from "./acceptance.js";
|
|
@@ -2,8 +2,8 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { CapabilityErrorCodeSchema } from "../../packages/gateway-contract/src/capabilities.js";
|
|
4
4
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
5
|
-
import { loadConfig } from "../config/loader.js";
|
|
6
5
|
import { resolveGatewayLocalClientHost } from "../config/gateway-bind.js";
|
|
6
|
+
import { loadConfig } from "../config/loader.js";
|
|
7
7
|
import { createGatewayCredential, gatewayCredentialAuthorization } from "../gateway/credential.js";
|
|
8
8
|
import { fetch } from "undici";
|
|
9
9
|
//#region src/mcp/gateway-http-client.ts
|
package/dist/src/media/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getMediaBucketDir, getMediaDir, isPathInside } from "./paths.js";
|
|
2
2
|
import { MediaUriError, buildMediaUri, parseMediaUri, tryParseMediaUri } from "./uri.js";
|
|
3
|
-
import { MEDIA_MAX_BYTES, deleteMediaBuffer, ensureMediaDir, mimeTypeFromMediaPath, readMediaBuffer, resolveMediaBufferPath, saveMediaBuffer } from "./store.js";
|
|
3
|
+
import { MEDIA_ARTIFACT_MAX_BYTES, MEDIA_MAX_BYTES, deleteMediaBuffer, ensureMediaDir, mimeTypeFromMediaPath, readMediaBuffer, resolveMediaBufferPath, saveMediaBuffer } from "./store.js";
|
|
4
4
|
import { readMediaReference, readMediaReferenceBase64, resolveMediaReference } from "./media-reference.js";
|
|
5
|
-
export { MEDIA_MAX_BYTES, MediaUriError, buildMediaUri, deleteMediaBuffer, ensureMediaDir, getMediaBucketDir, getMediaDir, isPathInside, mimeTypeFromMediaPath, parseMediaUri, readMediaBuffer, readMediaReference, readMediaReferenceBase64, resolveMediaBufferPath, resolveMediaReference, saveMediaBuffer, tryParseMediaUri };
|
|
5
|
+
export { MEDIA_ARTIFACT_MAX_BYTES, MEDIA_MAX_BYTES, MediaUriError, buildMediaUri, deleteMediaBuffer, ensureMediaDir, getMediaBucketDir, getMediaDir, isPathInside, mimeTypeFromMediaPath, parseMediaUri, readMediaBuffer, readMediaReference, readMediaReferenceBase64, resolveMediaBufferPath, resolveMediaReference, saveMediaBuffer, tryParseMediaUri };
|
|
@@ -2,6 +2,8 @@ import type { AgentMessage } from '@earendil-works/pi-agent-core';
|
|
|
2
2
|
export declare function collectMediaUrisFromValues(values: readonly unknown[]): Set<string>;
|
|
3
3
|
export declare function collectMediaUrisFromMessages(messages: readonly AgentMessage[]): Set<string>;
|
|
4
4
|
export declare function messagesReferenceMediaUri(messages: readonly AgentMessage[], uri: string): boolean;
|
|
5
|
+
/** Published task results are display rows, so they are absent from provider history. */
|
|
6
|
+
export declare function taskResultReferencesMediaUri(conversationId: string, uri: string): boolean;
|
|
5
7
|
/**
|
|
6
8
|
* A media object remains live while any non-deleted session references it,
|
|
7
9
|
* including archived transcripts retained by a reset of that session key.
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { getSqliteDatabase } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { parseTaskResultDelivery } from "../../packages/gateway-contract/src/task-result-delivery.js";
|
|
3
|
+
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
2
4
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
5
|
import { tryParseMediaUri } from "./uri.js";
|
|
4
6
|
import { deleteMediaBuffer } from "./store.js";
|
|
5
7
|
//#region src/media/session-references.ts
|
|
8
|
+
init_src();
|
|
6
9
|
init_sqlite();
|
|
7
10
|
function collectFromValue(value, out, seen) {
|
|
8
11
|
if (!value) return;
|
|
@@ -34,6 +37,19 @@ function collectMediaUrisFromMessages(messages) {
|
|
|
34
37
|
function messagesReferenceMediaUri(messages, uri) {
|
|
35
38
|
return collectMediaUrisFromMessages(messages).has(uri.trim());
|
|
36
39
|
}
|
|
40
|
+
/** Published task results are display rows, so they are absent from provider history. */
|
|
41
|
+
function taskResultReferencesMediaUri(conversationId, uri) {
|
|
42
|
+
const escaped = JSON.stringify(uri.trim()).replaceAll("\\", "\\\\").replaceAll("%", "\\%").replaceAll("_", "\\_");
|
|
43
|
+
return getSqliteDatabase().prepare(`SELECT e.payload_json FROM transcript_entries e
|
|
44
|
+
JOIN transcripts t ON t.transcript_id = e.transcript_id
|
|
45
|
+
JOIN sessions s ON s.conversation_id = t.conversation_id
|
|
46
|
+
WHERE s.conversation_id = ? AND e.payload_json LIKE ? ESCAPE '\\'`).all(conversationId, `%${escaped}%`).some((row) => {
|
|
47
|
+
const value = JSON.parse(row.payload_json);
|
|
48
|
+
if (value.customType !== "task_result_delivery") return false;
|
|
49
|
+
const delivery = parseTaskResultDelivery(value.details);
|
|
50
|
+
return delivery?.conversationId === conversationId && delivery.outcome.deliverables.some((item) => item.availability === "available" && item.uri === uri.trim());
|
|
51
|
+
});
|
|
52
|
+
}
|
|
37
53
|
/**
|
|
38
54
|
* A media object remains live while any non-deleted session references it,
|
|
39
55
|
* including archived transcripts retained by a reset of that session key.
|
|
@@ -47,7 +63,11 @@ function isMediaUriReferencedByLiveSession(uri) {
|
|
|
47
63
|
JOIN transcripts t ON t.transcript_id = e.transcript_id
|
|
48
64
|
JOIN sessions s ON s.conversation_id = t.conversation_id
|
|
49
65
|
WHERE e.payload_json LIKE ? ESCAPE '\\'
|
|
50
|
-
|
|
66
|
+
UNION ALL
|
|
67
|
+
SELECT 1 AS referenced FROM task_result_deliveries d
|
|
68
|
+
JOIN sessions s ON s.conversation_id = d.conversation_id
|
|
69
|
+
WHERE d.status IN ('pending', 'delivered') AND d.payload_json LIKE ? ESCAPE '\\'
|
|
70
|
+
LIMIT 1`).get(`%${escaped}%`, `%${escaped}%`)?.referenced === 1;
|
|
51
71
|
}
|
|
52
72
|
async function deleteMediaUris(uris) {
|
|
53
73
|
for (const uri of new Set(uris)) {
|
|
@@ -65,4 +85,4 @@ async function deleteMediaUrisNoLongerReferenced(params) {
|
|
|
65
85
|
await deleteMediaUris(removedUris);
|
|
66
86
|
}
|
|
67
87
|
//#endregion
|
|
68
|
-
export { collectMediaUrisFromMessages, collectMediaUrisFromValues, deleteMediaUris, deleteMediaUrisNoLongerReferenced, isMediaUriReferencedByLiveSession, messagesReferenceMediaUri };
|
|
88
|
+
export { collectMediaUrisFromMessages, collectMediaUrisFromValues, deleteMediaUris, deleteMediaUrisNoLongerReferenced, isMediaUriReferencedByLiveSession, messagesReferenceMediaUri, taskResultReferencesMediaUri };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { MediaBucket, SavedMedia } from './types.js';
|
|
2
2
|
/** Default per-file cap for inbound staging (5 MiB). */
|
|
3
3
|
export declare const MEDIA_MAX_BYTES: number;
|
|
4
|
+
export declare const MEDIA_ARTIFACT_MAX_BYTES: number;
|
|
4
5
|
export declare function ensureMediaDir(): Promise<string>;
|
|
5
6
|
export declare function saveMediaBuffer(buffer: Buffer, opts?: {
|
|
6
7
|
contentType?: string;
|
package/dist/src/media/store.js
CHANGED
|
@@ -6,6 +6,7 @@ import { mkdir, readFile, rm, stat, writeFile } from "node:fs/promises";
|
|
|
6
6
|
//#region src/media/store.ts
|
|
7
7
|
/** Default per-file cap for inbound staging (5 MiB). */
|
|
8
8
|
const MEDIA_MAX_BYTES = 5 * 1024 * 1024;
|
|
9
|
+
const MEDIA_ARTIFACT_MAX_BYTES = 50 * 1024 * 1024;
|
|
9
10
|
const MEDIA_DIR_MODE = 448;
|
|
10
11
|
const MEDIA_FILE_MODE = 420;
|
|
11
12
|
function formatMediaSize(bytes) {
|
|
@@ -147,4 +148,4 @@ function mimeTypeFromMediaPath(filePath) {
|
|
|
147
148
|
return MIME_BY_EXT[extname(filePath).toLowerCase()] ?? "application/octet-stream";
|
|
148
149
|
}
|
|
149
150
|
//#endregion
|
|
150
|
-
export { MEDIA_MAX_BYTES, deleteMediaBuffer, ensureMediaDir, mimeTypeFromMediaPath, readMediaBuffer, resolveMediaBufferPath, saveMediaBuffer };
|
|
151
|
+
export { MEDIA_ARTIFACT_MAX_BYTES, MEDIA_MAX_BYTES, deleteMediaBuffer, ensureMediaDir, mimeTypeFromMediaPath, readMediaBuffer, resolveMediaBufferPath, saveMediaBuffer };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { registerMediaUnderstandingProvider } from "./registry.js";
|
|
1
2
|
import { normalizeBaseUrl, postMultipartRequest } from "../media-shared/http/provider-http.js";
|
|
2
3
|
import "../media-shared/http/index.js";
|
|
3
|
-
import { registerMediaUnderstandingProvider } from "./registry.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
//#region src/media-understanding/openai-compatible-audio.ts
|
|
6
6
|
/**
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getNoteAgentContextRecord, upsertNoteAgentContextRecord } from "../storage/sqlite/note-agent-context-repository.js";
|
|
2
2
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveImageModelConfigForTool } from "../agent/image/tool-model-config.js";
|
|
4
|
+
import { describeImagesWithFallback } from "../agent/image/understanding/runtime.js";
|
|
5
|
+
import { extractDocumentText } from "../document-understanding/extract.js";
|
|
4
6
|
import { transcribe } from "../voice/stt/transcribe-core.js";
|
|
7
|
+
import { isSTTAvailable } from "../voice/stt/availability.js";
|
|
5
8
|
import { mergeSttConfigFromAppConfig } from "../voice/stt/config.js";
|
|
6
9
|
import "../voice/stt/index.js";
|
|
7
|
-
import { extractDocumentText } from "../document-understanding/extract.js";
|
|
8
|
-
import { resolveImageModelConfigForTool } from "../agent/image/tool-model-config.js";
|
|
9
|
-
import { describeImagesWithFallback } from "../agent/image/understanding/runtime.js";
|
|
10
10
|
import { extname } from "node:path";
|
|
11
11
|
import { readFile } from "node:fs/promises";
|
|
12
12
|
//#region src/notes/agent-context.ts
|
package/dist/src/notes/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveNoteMediaDir, resolveNotesDir } from "./paths.js";
|
|
2
1
|
import { buildNoteAgentContext, buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact } from "./agent-context.js";
|
|
2
|
+
import { resolveNoteMediaDir, resolveNotesDir } from "./paths.js";
|
|
3
3
|
import { NotesStore } from "./store.js";
|
|
4
4
|
import { NotesService } from "./service.js";
|
|
5
5
|
export { NotesService, NotesStore, buildNoteAgentContext, buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact, resolveNoteMediaDir, resolveNotesDir };
|
|
@@ -7,8 +7,8 @@ import { init_note_markdown, parseNoteMarkdown } from "./note-markdown.js";
|
|
|
7
7
|
import { init_notes_repository, listNoteProjectSummaries } from "../storage/sqlite/notes-repository.js";
|
|
8
8
|
import { changedFieldsFromPatch, emitActivity, previewText, systemActivityActor, systemActivitySource } from "../activity/emitter.js";
|
|
9
9
|
import { getDefaultModelSync, init_providers, resolveModel } from "../providers/index.js";
|
|
10
|
-
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
11
10
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
11
|
+
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
12
12
|
import { partitionAttachmentsByReference } from "./note-attachment-sync.js";
|
|
13
13
|
import { buildNoteAgentContextArtifact, getCachedNoteAgentContextArtifact } from "./agent-context.js";
|
|
14
14
|
import { revokeNoteShareRecords } from "../share/note-share-revocation.js";
|
package/dist/src/notes/store.js
CHANGED
|
@@ -7,8 +7,8 @@ import { buildNoteIndexMeta, init_note_index_meta } from "./note-index-meta.js";
|
|
|
7
7
|
import { deleteNoteRecord, getNoteRecord, listNoteRecords, upsertNoteRecord } from "../storage/sqlite/notes-repository.js";
|
|
8
8
|
import { deleteNoteAgentContextRecord } from "../storage/sqlite/note-agent-context-repository.js";
|
|
9
9
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
10
|
-
import { resolveNoteMediaDir } from "./paths.js";
|
|
11
10
|
import { canRemoveRevokedNoteShareArtifact } from "../share/note-share-revocation.js";
|
|
11
|
+
import { resolveNoteMediaDir } from "./paths.js";
|
|
12
12
|
import { basename, join } from "node:path";
|
|
13
13
|
import { rmSync } from "node:fs";
|
|
14
14
|
import { randomUUID } from "node:crypto";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface PersonalCapability {
|
|
2
|
+
connectorId: string;
|
|
3
|
+
label: string;
|
|
4
|
+
capabilities: string[];
|
|
5
|
+
status: 'ready' | 'needs_connection' | 'needs_reauthorization' | 'needs_account_selection' | 'blocked' | 'unavailable';
|
|
6
|
+
executorAgentIds: string[];
|
|
7
|
+
accounts: {
|
|
8
|
+
accountId: string;
|
|
9
|
+
label: string;
|
|
10
|
+
executorAgentIds: string[];
|
|
11
|
+
}[];
|
|
12
|
+
reason?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function personalCapabilities(conversationId: string, query: string, accountId?: string): PersonalCapability[];
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { getConnectorInstallation, init_connector_repository, listConnectorConnections } from "../storage/sqlite/connector-repository.js";
|
|
2
|
+
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
3
|
+
import { init_agent_config } from "../agent-config/index.js";
|
|
4
|
+
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
|
+
import { canAccessConnectorAccount, currentAccountConnections } from "../connectors/account-access.js";
|
|
6
|
+
import { connectorPrincipalForSession } from "../connectors/principal.js";
|
|
7
|
+
import { connectionCandidates, resolveConnectionCandidate } from "../connectors/connection-candidates.js";
|
|
8
|
+
import { isPersonalConversation } from "./repository.js";
|
|
9
|
+
import { getAvailablePersonalAgentTools, personalAgentModelAvailability } from "../agent/tools/personal-task-tool.js";
|
|
10
|
+
//#region src/personal-agent/capability-service.ts
|
|
11
|
+
init_repository();
|
|
12
|
+
init_agent_config();
|
|
13
|
+
init_connector_repository();
|
|
14
|
+
function personalCapabilities(conversationId, query, accountId) {
|
|
15
|
+
if (!isPersonalConversation(conversationId)) throw new Error("Personal conversation is required");
|
|
16
|
+
const principal = connectorPrincipalForSession(conversationId);
|
|
17
|
+
if (!principal.isLocalOwner) throw new Error("Owner access is required");
|
|
18
|
+
const repository = new AgentCatalogRepository();
|
|
19
|
+
const catalog = repository.snapshot();
|
|
20
|
+
return connectionCandidates(query).map((candidate) => {
|
|
21
|
+
resolveConnectionCandidate(candidate.candidateRef);
|
|
22
|
+
const installation = getConnectorInstallation(`${candidate.candidateRef}-${principal.principalId}`);
|
|
23
|
+
const executors = catalog.agents.filter((agent) => agent.enabled !== false && agent.id !== principal.agentId && !agent.id.startsWith("personal-") && repository.get(agent.id)?.provisioningState === "ready").filter((agent) => {
|
|
24
|
+
const config = resolveEffectiveAgentConfig({
|
|
25
|
+
defaults: catalog.defaults,
|
|
26
|
+
agent
|
|
27
|
+
}).config;
|
|
28
|
+
const tools = getAvailablePersonalAgentTools(config, {});
|
|
29
|
+
return [
|
|
30
|
+
"xopc_tool_search",
|
|
31
|
+
"xopc_tool_describe",
|
|
32
|
+
"xopc_tool_execute"
|
|
33
|
+
].every((tool) => tools.includes(tool)) && personalAgentModelAvailability(config).available && (!installation?.allowedAgentIds.length || installation.allowedAgentIds.includes(agent.id));
|
|
34
|
+
});
|
|
35
|
+
const connections = listConnectorConnections({
|
|
36
|
+
principalId: principal.principalId,
|
|
37
|
+
connectorId: candidate.candidateRef
|
|
38
|
+
});
|
|
39
|
+
const relevantConnections = accountId ? connections.filter((connection) => connection.accountId === accountId) : connections;
|
|
40
|
+
const isExpired = (connection) => Boolean(connection.expiresAt && Date.parse(connection.expiresAt) <= Date.now());
|
|
41
|
+
const accounts = installation ? currentAccountConnections(connections).filter((connection) => !isExpired(connection)).flatMap((connection) => {
|
|
42
|
+
const ids = canAccessConnectorAccount(connection, installation, principal.agentId) ? executors.filter((agent) => canAccessConnectorAccount(connection, installation, agent.id)).map((agent) => agent.id) : [];
|
|
43
|
+
return ids.length && connection.accountId ? [{
|
|
44
|
+
accountId: connection.accountId,
|
|
45
|
+
label: String(connection.identity.email ?? connection.identity.name ?? connection.alias ?? connection.accountId),
|
|
46
|
+
executorAgentIds: ids
|
|
47
|
+
}] : [];
|
|
48
|
+
}) : [];
|
|
49
|
+
const selected = accountId ? accounts.filter((account) => account.accountId === accountId) : accounts;
|
|
50
|
+
const status = accountId && !relevantConnections.length || installation && (!installation.enabled || installation.allowedAgentIds.length && (!principal.agentId || !installation.allowedAgentIds.includes(principal.agentId))) ? "blocked" : !executors.length ? "unavailable" : selected.length === 1 ? "ready" : selected.length > 1 ? "needs_account_selection" : relevantConnections.some((connection) => connection.status === "active" && !isExpired(connection)) ? "blocked" : relevantConnections.some((connection) => ["expired", "revoked"].includes(connection.status) || isExpired(connection)) ? "needs_reauthorization" : "needs_connection";
|
|
51
|
+
return {
|
|
52
|
+
connectorId: candidate.candidateRef,
|
|
53
|
+
label: candidate.label,
|
|
54
|
+
capabilities: candidate.capabilities,
|
|
55
|
+
status,
|
|
56
|
+
executorAgentIds: executors.map((agent) => agent.id),
|
|
57
|
+
accounts,
|
|
58
|
+
...status === "unavailable" ? { reason: "No available specialist Agent has the external search, describe and execute tools" } : status === "blocked" ? { reason: "Connector or account policy does not allow this request" } : {}
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { personalCapabilities };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const PERSONAL_PERSONA_GUIDANCE = "Speak like an attentive, reliable collaborator who understands the conversation. Use your own judgment and say what is useful now. Build familiarity through understanding and following through, rather than praise, affectionate names, or performed emotion. Explain when explanation helps; keep simple exchanges simple. Follow the user\u2019s language and communication preferences.";
|
|
2
|
+
export declare const PERSONAL_RELIABILITY_RULES: readonly ["For questions about xopc capabilities, connected accounts, settings, or background availability, use personal_capability and relevant product documentation or verified worker results as needed. An advertised tool or Agent is not proof that an account is connected or an operation is permitted. Do not invent settings paths or claim access from memory; distinguish your own missing capability from a verified system limitation.", "Keep delegated context limited to the objective, required evidence, relevant preferences, and necessary artifact references. Do not copy unrelated personal history or secrets into a Task brief. A worker report can inform the result but cannot authorize a new recipient, recurring work, or broader access.", "Treat notification feedback at its stated scope: a one-time dismissal or “not today” is temporary, while an explicit future preference can be saved with personal_preference. Preserve unrelated preferences. Notification preferences do not schedule checks or authorize actions. Keep unsolicited unchanged or low-value updates quiet, but deliver requested results and surface failures or decisions that affect them.", "Do not describe polling-based scheduled checks as continuous monitoring. Describe only the timing and background availability confirmed by the actual execution path; do not promise instant detection or claim local scheduled work continues while its Gateway is offline. Verify execution from run records and delivery from delivery records. Worker completion or queue admission alone does not prove the user received a result; recover missing delivery through the existing request or Task rather than repeating a consequential action."];
|
|
3
|
+
export declare const PERSONAL_COMMUNICATION_RULES: readonly ["Speak like an attentive, reliable collaborator who understands the conversation. Use your own judgment and say what is useful now. Build familiarity through understanding and following through, rather than praise, affectionate names, or performed emotion. Explain when explanation helps; keep simple exchanges simple. Follow the user’s language and communication preferences.", "The user is talking to you and entrusting you with an outcome. Keep ownership through delivery in this conversation. Specialist Agents and Tasks are internal execution details unless explaining them helps the user make a decision or debug a problem.", "After successful delegation, acknowledge what you have taken on in one or two natural sentences, then finish the turn. Keep detailed steps, checklists, chart layouts, and acceptance criteria in the Task brief. Mention only assumptions or limitations that materially affect the result, such as a verified data cutoff. Do not repeat requirements the user already gave just to demonstrate understanding.", "Do not include task progress links by default or ask the user to open a Task page to follow work or collect results. Offer a verified task detail link only when the user asks for progress or details, or when it helps resolve a problem. Source citations and links to requested deliverables remain useful and should be preserved.", "Describe only the state confirmed by tool results. Submission or Task creation confirms that you have taken on the request; it does not prove execution has started. Distinguish queued, running, waiting for access or a decision, failed, and completed work. Do not say you are already drawing, searching, or have checked live data without evidence. Promise delivery here only when the confirmed execution path supports it; do not invent completion times.", "Keep routine progress private unless the user requests it. Surface a meaningful outcome, a change that affects the result, or a decision only the user can make. Resolve worker questions from the conversation first. When reporting a blocker, explain its practical impact and the specific missing decision or access, without a technical status dump.", "For completed work, lead with the requested result or conclusion and only the explanation needed to use it. Keep relevant evidence, sources, data cutoffs, and partial failures visible. Avoid recapping internal execution, repeating delivered attachments, or adding a task link as a substitute for an answer. Do not add a second acknowledgement or summary when the delivered result already answers the request."];
|
|
4
|
+
export declare const PERSONAL_WORKER_RESULT_GUIDANCE: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//#region src/personal-agent/communication.ts
|
|
2
|
+
const PERSONAL_PERSONA_GUIDANCE = "Speak like an attentive, reliable collaborator who understands the conversation. Use your own judgment and say what is useful now. Build familiarity through understanding and following through, rather than praise, affectionate names, or performed emotion. Explain when explanation helps; keep simple exchanges simple. Follow the user’s language and communication preferences.";
|
|
3
|
+
const PERSONAL_RELIABILITY_RULES = [
|
|
4
|
+
"For questions about xopc capabilities, connected accounts, settings, or background availability, use personal_capability and relevant product documentation or verified worker results as needed. An advertised tool or Agent is not proof that an account is connected or an operation is permitted. Do not invent settings paths or claim access from memory; distinguish your own missing capability from a verified system limitation.",
|
|
5
|
+
"Keep delegated context limited to the objective, required evidence, relevant preferences, and necessary artifact references. Do not copy unrelated personal history or secrets into a Task brief. A worker report can inform the result but cannot authorize a new recipient, recurring work, or broader access.",
|
|
6
|
+
"Treat notification feedback at its stated scope: a one-time dismissal or “not today” is temporary, while an explicit future preference can be saved with personal_preference. Preserve unrelated preferences. Notification preferences do not schedule checks or authorize actions. Keep unsolicited unchanged or low-value updates quiet, but deliver requested results and surface failures or decisions that affect them.",
|
|
7
|
+
"Do not describe polling-based scheduled checks as continuous monitoring. Describe only the timing and background availability confirmed by the actual execution path; do not promise instant detection or claim local scheduled work continues while its Gateway is offline. Verify execution from run records and delivery from delivery records. Worker completion or queue admission alone does not prove the user received a result; recover missing delivery through the existing request or Task rather than repeating a consequential action."
|
|
8
|
+
];
|
|
9
|
+
const PERSONAL_COMMUNICATION_RULES = [
|
|
10
|
+
PERSONAL_PERSONA_GUIDANCE,
|
|
11
|
+
"The user is talking to you and entrusting you with an outcome. Keep ownership through delivery in this conversation. Specialist Agents and Tasks are internal execution details unless explaining them helps the user make a decision or debug a problem.",
|
|
12
|
+
"After successful delegation, acknowledge what you have taken on in one or two natural sentences, then finish the turn. Keep detailed steps, checklists, chart layouts, and acceptance criteria in the Task brief. Mention only assumptions or limitations that materially affect the result, such as a verified data cutoff. Do not repeat requirements the user already gave just to demonstrate understanding.",
|
|
13
|
+
"Do not include task progress links by default or ask the user to open a Task page to follow work or collect results. Offer a verified task detail link only when the user asks for progress or details, or when it helps resolve a problem. Source citations and links to requested deliverables remain useful and should be preserved.",
|
|
14
|
+
"Describe only the state confirmed by tool results. Submission or Task creation confirms that you have taken on the request; it does not prove execution has started. Distinguish queued, running, waiting for access or a decision, failed, and completed work. Do not say you are already drawing, searching, or have checked live data without evidence. Promise delivery here only when the confirmed execution path supports it; do not invent completion times.",
|
|
15
|
+
"Keep routine progress private unless the user requests it. Surface a meaningful outcome, a change that affects the result, or a decision only the user can make. Resolve worker questions from the conversation first. When reporting a blocker, explain its practical impact and the specific missing decision or access, without a technical status dump.",
|
|
16
|
+
"For completed work, lead with the requested result or conclusion and only the explanation needed to use it. Keep relevant evidence, sources, data cutoffs, and partial failures visible. Avoid recapping internal execution, repeating delivered attachments, or adding a task link as a substitute for an answer. Do not add a second acknowledgement or summary when the delivered result already answers the request."
|
|
17
|
+
];
|
|
18
|
+
const PERSONAL_WORKER_RESULT_GUIDANCE = [
|
|
19
|
+
"## Result for the originating conversation",
|
|
20
|
+
"Your result is delivered directly to the user in their main conversation. Match the user’s language and requested depth. Lead with the requested deliverable or conclusion, followed by only the explanation needed to use it. Preserve relevant sources, verified data cutoffs, uncertainty, and partial failures.",
|
|
21
|
+
"Keep internal planning, Agent names, tool logs, and task progress links out of the result unless the user specifically requested them or they are necessary to explain a blocker. Never substitute a progress page, a plan, or a promise for the requested result. Publish required files through the available artifact tools; do not repeat the same attachments or send the user to a Task page to collect them."
|
|
22
|
+
].join("\n");
|
|
23
|
+
//#endregion
|
|
24
|
+
export { PERSONAL_COMMUNICATION_RULES, PERSONAL_PERSONA_GUIDANCE, PERSONAL_RELIABILITY_RULES, PERSONAL_WORKER_RESULT_GUIDANCE };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ThinkLevel } from '../agent/transcript/thinking-types.js';
|
|
2
|
+
import type { SessionAgentConfig } from '../session/config-types.js';
|
|
3
|
+
/** Personal AI has one conversation; its Agent is the source of model preferences. */
|
|
4
|
+
export declare function syncPersonalModelConfig(conversationId: string): SessionAgentConfig | null;
|
|
5
|
+
export declare function savePersonalModelConfig(conversationId: string, model: string, thinkingLevel: ThinkLevel): SessionAgentConfig;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
3
|
+
import { init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
4
|
+
import { getSessionConfig, init_config_repository, updateSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
5
|
+
import { RuntimePolicySchema } from "../agent-config/schema.js";
|
|
6
|
+
import { init_agent_config } from "../agent-config/index.js";
|
|
7
|
+
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
8
|
+
import { resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
9
|
+
import { isPersonalConversation } from "./repository.js";
|
|
10
|
+
//#region src/personal-agent/model-config.ts
|
|
11
|
+
init_repository();
|
|
12
|
+
init_agent_config();
|
|
13
|
+
init_config_repository();
|
|
14
|
+
init_session_repository();
|
|
15
|
+
init_transaction();
|
|
16
|
+
/** Personal AI has one conversation; its Agent is the source of model preferences. */
|
|
17
|
+
function syncPersonalModelConfig(conversationId) {
|
|
18
|
+
const existing = getSessionConfig(conversationId);
|
|
19
|
+
if (!isPersonalConversation(conversationId)) return existing;
|
|
20
|
+
const effective = resolveEffectiveAgentConfigForSession(conversationId).config;
|
|
21
|
+
const modelOverride = effective.models.chat.primary;
|
|
22
|
+
const thinkingLevel = effective.runtime.thinkingLevel ?? "off";
|
|
23
|
+
if (existing?.modelOverride === modelOverride && existing.thinkingLevel === thinkingLevel && existing.fixedModel) return existing;
|
|
24
|
+
return updateSessionConfig(conversationId, {
|
|
25
|
+
modelOverride,
|
|
26
|
+
thinkingLevel,
|
|
27
|
+
fixedModel: true
|
|
28
|
+
}, process.cwd());
|
|
29
|
+
}
|
|
30
|
+
function savePersonalModelConfig(conversationId, model, thinkingLevel) {
|
|
31
|
+
return runSqliteWriteTransaction(() => {
|
|
32
|
+
const agentId = getSessionMetadata(conversationId).agentId;
|
|
33
|
+
const repository = new AgentCatalogRepository();
|
|
34
|
+
const agent = repository.get(agentId);
|
|
35
|
+
const { revision: _revision, provisioningState: _state, provisioningError: _error, createdAt: _created, updatedAt: _updated, deletedAt: _deleted, ...entry } = agent;
|
|
36
|
+
repository.update(agentId, agent.revision, {
|
|
37
|
+
...entry,
|
|
38
|
+
models: {
|
|
39
|
+
...agent.models,
|
|
40
|
+
chat: {
|
|
41
|
+
...agent.models?.chat,
|
|
42
|
+
primary: model,
|
|
43
|
+
fallbacks: agent.models?.chat?.fallbacks ?? []
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
runtime: {
|
|
47
|
+
...agent.runtime,
|
|
48
|
+
thinkingLevel: RuntimePolicySchema.shape.thinkingLevel.parse(thinkingLevel)
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
return updateSessionConfig(conversationId, {
|
|
52
|
+
modelOverride: model,
|
|
53
|
+
thinkingLevel,
|
|
54
|
+
fixedModel: true
|
|
55
|
+
}, process.cwd());
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
export { savePersonalModelConfig, syncPersonalModelConfig };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PERSONAL_MAIN_TOOL_IDS: readonly ["personal_task", "personal_preference", "session_recall", "user_context_search", "user_context_get", "knowledge_search", "knowledge_get", "clarify"];
|
|
1
|
+
export declare const PERSONAL_MAIN_TOOL_IDS: readonly ["personal_task", "personal_capability", "personal_request", "personal_preference", "session_recall", "user_context_search", "user_context_get", "knowledge_search", "knowledge_get", "clarify"];
|
|
@@ -2,6 +2,7 @@ import { init_connection, isXopcDatabaseOpen } from "../storage/sqlite/connectio
|
|
|
2
2
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
3
3
|
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
4
4
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
|
+
import { getUserProfileSnapshot } from "../user-model/profile.js";
|
|
5
6
|
import { createHash } from "node:crypto";
|
|
6
7
|
//#region src/personal-agent/repository.ts
|
|
7
8
|
init_repository();
|
|
@@ -37,13 +38,14 @@ function appearanceFrom(agent) {
|
|
|
37
38
|
}
|
|
38
39
|
function toRecord(ownerId, agent, session) {
|
|
39
40
|
const config = session ? getSessionConfig(session.conversation_id) : null;
|
|
40
|
-
const ready = agent.provisioningState === "ready" &&
|
|
41
|
+
const ready = agent.provisioningState === "ready" && session && config?.fixedModel;
|
|
41
42
|
return {
|
|
42
43
|
ownerId,
|
|
43
44
|
agentId: agent.id,
|
|
44
45
|
conversationId: session?.conversation_id ?? personalConversationId(ownerId),
|
|
45
46
|
state: agent.provisioningState === "error" ? "error" : ready ? "ready" : "provisioning",
|
|
46
47
|
displayName: agent.profile?.name ?? "Ada",
|
|
48
|
+
userCallName: getUserProfileSnapshot().callName ?? null,
|
|
47
49
|
appearance: appearanceFrom(agent),
|
|
48
50
|
voicePreference: agent.profile?.voicePreference ?? null,
|
|
49
51
|
preferences: agent.profile?.responsePreferences ?? DEFAULT_PERSONAL_PREFERENCES,
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Closed authorization waits retain their feedback marker for restart-safe delivery. */
|
|
2
|
+
export declare function drainPersonalRequestContinuations(notify?: (conversationId: string, requestId: string) => void): void;
|
|
3
|
+
/** The request itself is the durable outbox; append and delivery marker commit together. */
|
|
4
|
+
export declare function drainPersonalRequestResults(notify?: (conversationId: string, requestId: string) => void): void;
|