@xopcai/xopc 0.0.352 → 0.0.354
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/activity-YogQEteU.js +1 -0
- package/dist/gateway/static/root/assets/activity-store-X7CG9pzB.js +1 -0
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-ChlaFmiD.js → agent-avatar-dicebear-B8PS1eLP.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CLBSL9hl.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-BninweSg.js +1 -0
- package/dist/gateway/static/root/assets/agents-CcVLP_WP.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-C_3ucZGI.js → agents-admin-api-Ck2x78jq.js} +1 -1
- package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-COdQOmdT.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-CDNjc2yy.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-C-kvpPj8.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D4EiLLyl.js → archive-plugin-QfOaQPL_.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CMxBpT5v.js → automations-page-87DN5nXX.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BdZ8NO8k.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DQc_BlYP.js → binary-plugins-BF2lVwR9.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-C3S6gqnS.js → block-editor-B04Kv5DU.js} +39 -39
- package/dist/gateway/static/root/assets/bot-DjLkhyZL.js +1 -0
- package/dist/gateway/static/root/assets/{browser-automation-inputs-D2SwaQ2F.js → browser-automation-inputs-FW3bYZ-z.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-CGG1740U.js → browser-automations-page-Ck6Zb9aU.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DHlyYItE.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-D4qdO980.js → capabilities-BCF_160Z.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-CF4-mrIa.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-page-C-6RLFNh.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CST_HBkR.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-PBPJJsp6.js +1 -0
- package/dist/gateway/static/root/assets/channels-CM4sIvcP.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DfTUgrey.js → chat-terminal-dock-DTd7mWyE.js} +2 -2
- package/dist/gateway/static/root/assets/chevron-right-BweFrslA.js +1 -0
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +1 -0
- package/dist/gateway/static/root/assets/circle-dashed-8qMD7gHf.js +1 -0
- package/dist/gateway/static/root/assets/circle-dot-BAseJTrF.js +1 -0
- package/dist/gateway/static/root/assets/circle-pause-CN9jYH2s.js +1 -0
- package/dist/gateway/static/root/assets/clock-3-DnrAnuyZ.js +1 -0
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page--9rh1mvu.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-v6Is0BOO.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-CryQzmEZ.js +2 -0
- package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-DTsMzjoZ.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-CV2ybJJd.js → dependency-picker-Y1QYCcLp.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DipFHe4X.js → desktop-pet-D9dfZrOp.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BHVOHZUL.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-Cy5YDZ2b.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-DeMo9KlE.js +1 -0
- package/dist/gateway/static/root/assets/dist-3h6cXXhT.js +1 -0
- package/dist/gateway/static/root/assets/dist-Che_jiQF.js +1 -0
- package/dist/gateway/static/root/assets/extension-debug-page-BrGWLJg9.js +1 -0
- package/dist/gateway/static/root/assets/extension-page-AWrvy1Nb.js +1 -0
- package/dist/gateway/static/root/assets/extension-provider-CUpbXB2k.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-C5KgmhYu.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-DZWFlfJr.js → gateway-config-swr-B31I6Gbq.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-HO9tL9xo.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-DC-lok0J.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-Cg1nbxJR.js → gateway-startup-retry-DVol958v.js} +1 -1
- package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
- package/dist/gateway/static/root/assets/home-page-C29_VFAs.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-DSnPfr_U.js → image-generation-api-TVgJfz9r.js} +1 -1
- package/dist/gateway/static/root/assets/imports-page-BKVKfVMA.js +1 -0
- package/dist/gateway/static/root/assets/index-BJh5gU04.css +1 -0
- package/dist/gateway/static/root/assets/index-ByFXhQ-T.js +107 -0
- package/dist/gateway/static/root/assets/index.module-Cd9ENXfk.js +1 -0
- package/dist/gateway/static/root/assets/interaction-BdhHBbYa.js +1 -0
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-ixQ8_6ad.js → keyboard-shortcuts-settings-DiwE4gKU.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-Dt3TC64L.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BV3NFUJQ.js → local-apps-page-DFPhWkxU.js} +1 -1
- package/dist/gateway/static/root/assets/{local-session-drafts-CuyTzbfW.js → local-session-drafts-wiq_12oN.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-qcYD05PF.js → locale-store-Y1aBayM_.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-C4faHZHj.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-pZLdvIiw.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-7tzqIp_G.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-cpalRgVI.js → media-plugins-cjgrKnne.js} +1 -1
- package/dist/gateway/static/root/assets/message-square-fVE7Ghj1.js +1 -0
- package/dist/gateway/static/root/assets/messages-DPw2X06D.js +3 -0
- package/dist/gateway/static/root/assets/mic-CuUb7zc-.js +1 -0
- package/dist/gateway/static/root/assets/model-display-name-DXhO9rcM.js +1 -0
- package/dist/gateway/static/root/assets/models-hub-cache-HGrORbzR.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-BLnT1tYJ.js +5 -0
- package/dist/gateway/static/root/assets/notes-api-J0yhflxC.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-BawArJvP.js +8 -0
- package/dist/gateway/static/root/assets/oauth-api-CYe61zfD.js +1 -0
- package/dist/gateway/static/root/assets/page-context-capture-button-CiBUm2Br.js +1 -0
- package/dist/gateway/static/root/assets/page-tabs-D2xpUV26.js +1 -0
- package/dist/gateway/static/root/assets/pause-DuPxgSxk.js +1 -0
- package/dist/gateway/static/root/assets/personal-page-Cng583RH.js +1 -0
- package/dist/gateway/static/root/assets/play-kxZvpBg8.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-DcsFzD_i.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-Dvey7GwU.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-BJwEshPw.js → product-open-page-B8_w6c3J.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CDZdKiTz.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BvahSrZi.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-C0j3sKT4.js → registry-api-DqDOrPQ0.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CU_UdkuI.js +1 -0
- package/dist/gateway/static/root/assets/rotate-ccw-JM1TBLpp.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-SbIgL9Ya.js → runtime-tools-settings-panel-BnMS50vK.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-CDR1-q25.js +2 -0
- package/dist/gateway/static/root/assets/schema-form-B4Xa8w8S.js +1 -0
- package/dist/gateway/static/root/assets/secret-input-DPl3VYM8.js +1 -0
- package/dist/gateway/static/root/assets/send-session-input-C7Nqy0sK.js +1 -0
- package/dist/gateway/static/root/assets/{session-api-iR1SFNHe.js → session-api-CTN4qwiN.js} +1 -1
- package/dist/gateway/static/root/assets/{session-manager-3YOU74jt.js → session-manager-DsH1DZI_.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-Ymyg98G-.js +1 -0
- package/dist/gateway/static/root/assets/settings-2-D-csvaET.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-wMZhxwTM.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-exRhP9xn.js +1 -0
- package/dist/gateway/static/root/assets/settings-page-CHZdpvkT.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-HESfALIF.js +1 -0
- package/dist/gateway/static/root/assets/share-link-dialog-COlX10Dc.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-NtRLUieq.js +2 -0
- package/dist/gateway/static/root/assets/shares-api-DICV5EKH.js +1 -0
- package/dist/gateway/static/root/assets/shares-settings-CXEBo5YL.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-DYgcO7y0.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-utils-C7V4JVXM.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CWH3Fmx4.js +1 -0
- package/dist/gateway/static/root/assets/skill-wire-pattern-BPpeIcCi.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-Dx5v64jU.js +2 -0
- package/dist/gateway/static/root/assets/sparkles-DHlfQFAF.js +1 -0
- package/dist/gateway/static/root/assets/system-settings-panel-wXCBwYwE.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-hoIyr7tp.js +1 -0
- package/dist/gateway/static/root/assets/tasks-Buv1mgPF.js +1 -0
- package/dist/gateway/static/root/assets/theme-store-BKgBPLH4.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-C0t8y3Mi.js +1 -0
- package/dist/gateway/static/root/assets/usage-page-A2DZAidl.js +1 -0
- package/dist/gateway/static/root/assets/use-async-resource-GrnWNwMZ.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-Cn6hqqyM.js +1 -0
- package/dist/gateway/static/root/assets/use-composer-attachments-DL61XeSu.js +2 -0
- package/dist/gateway/static/root/assets/use-file-preview-expanded-Cl9mU32w.js +2 -0
- package/dist/gateway/static/root/assets/user-model-page-C1jGTwjK.js +2 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-Bw05QB_V.js +1 -0
- package/dist/gateway/static/root/assets/{voice-config-api-CylVelIb.js → voice-config-api-BM75K3mR.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-9bULjfGk.js → work-discovery-overlay-xB0QpOFk.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-VYQHBiz3.js → workflow-run-setup-panel-rM4U1FXc.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-QKC34FzQ.js +6 -0
- package/dist/gateway/static/root/assets/workspace-api-BbBT75Kg.js +2 -0
- package/dist/gateway/static/root/index.html +68 -26
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +19 -2
- package/dist/src/agent/agent-manager.js +27 -22
- 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 +4 -4
- 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/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-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/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 +15 -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/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- 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 +2 -2
- 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/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/orchestration/agent-orchestrator.js +1 -1
- 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 +5 -10
- 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/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 +24 -22
- package/dist/src/agent/session/session-config-service.js +27 -1
- 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/starter-agents.d.ts +0 -4
- package/dist/src/agent/starter-agents.js +57 -98
- package/dist/src/agent/tasks/task-judge-service.js +4 -4
- 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/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.d.ts +1 -1
- package/dist/src/agent/tools/factory.js +37 -30
- 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.d.ts +10 -0
- package/dist/src/agent/tools/personal-preference-tool.js +43 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +28 -0
- package/dist/src/agent/tools/personal-task-tool.js +165 -0
- 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/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 +8 -7
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- 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.d.ts +1 -1
- package/dist/src/agent-catalog/service.js +4 -3
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +167 -0
- package/dist/src/agent-config/schema.js +47 -6
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +1 -1
- package/dist/src/auth/oauth-provider-lock.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +1 -1
- package/dist/src/automations/capabilities/drafts.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/bootstrap/application-state.js +3 -1
- package/dist/src/browser/native-messaging-host.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.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 +4 -7
- package/dist/src/chat-commands/builtins/config.js +4 -4
- 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 +13 -3
- 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 +10 -4
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +7 -7
- package/dist/src/cli/commands/agents.js +1 -1
- 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/doctor/checks/workspace-status.js +0 -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 -34
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/onboard/channels/registry.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +2 -2
- 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.d.ts +1 -1
- package/dist/src/cli/templates.js +1 -23
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +2 -2
- package/dist/src/cli/utils/session.js +1 -1
- package/dist/src/computer/runtime.js +2 -2
- package/dist/src/config/index.js +8 -8
- package/dist/src/config/loader.js +3 -3
- 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 +3 -24
- 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.js +5 -5
- 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/agent-plugins/validation.js +1 -1
- 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/agents-admin.d.ts +1 -9
- package/dist/src/gateway/agents-admin.js +9 -34
- 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.d.ts +1 -0
- package/dist/src/gateway/hono/lib/config-payload.js +4 -4
- 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/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/home.js +1 -1
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +5 -5
- package/dist/src/gateway/hono/routes/notes.js +3 -3
- package/dist/src/gateway/hono/routes/personal-agent.d.ts +3 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +107 -0
- package/dist/src/gateway/hono/routes/projects.js +4 -4
- package/dist/src/gateway/hono/routes/session-command-handler.js +1 -1
- package/dist/src/gateway/hono/routes/session-input-handler.js +4 -4
- package/dist/src/gateway/hono/routes/sessions.js +6 -1
- 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 +66 -3
- 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 +14 -6
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +3 -3
- package/dist/src/gateway/index.js +1 -1
- package/dist/src/gateway/lock.js +11 -11
- package/dist/src/gateway/media-access.js +1 -1
- 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/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 +7 -1
- package/dist/src/gateway/service/sessions-api.js +12 -2
- package/dist/src/gateway/service.js +49 -49
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/session-reset-service.js +5 -0
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/generator.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- 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 +2 -2
- package/dist/src/mcp/gateway-http-client.js +1 -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/policy.d.ts +1 -0
- package/dist/src/personal-agent/policy.js +13 -0
- package/dist/src/personal-agent/repository.d.ts +25 -0
- package/dist/src/personal-agent/repository.js +68 -0
- package/dist/src/personal-agent/service.d.ts +48 -0
- package/dist/src/personal-agent/service.js +222 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/providers/model-reference-auditor.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/index.js +2 -2
- package/dist/src/session/resolve-session.js +4 -2
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +4 -4
- package/dist/src/session/thinking-resolve.js +1 -1
- 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.js +9 -9
- package/dist/src/storage/sqlite/migrations/229_task_criterion_reviews.sql +12 -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/schema.sql +13 -0
- package/dist/src/storage/sqlite/session-repository.js +6 -2
- package/dist/src/storage/sqlite/transcript-repository.js +2 -1
- package/dist/src/tasks/capabilities/read.js +5 -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.js +8 -3
- package/dist/src/tasks/task-collaboration-delivery.js +1 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-criterion-review-repository.d.ts +22 -0
- package/dist/src/tasks/task-criterion-review-repository.js +74 -0
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-main-update-decision-service.js +7 -1
- package/dist/src/tui/backends/embedded-backend.js +12 -12
- 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/persona-context.d.ts +2 -2
- package/dist/src/voice/realtime/persona-context.js +19 -33
- package/dist/src/voice/realtime/runtime.js +3 -3
- 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 +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CgNagNMG.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CDhtsMpV.js +0 -1
- package/dist/gateway/static/root/assets/agents-BLP0zRru.js +0 -70
- package/dist/gateway/static/root/assets/app-management-settings-panel-DqC-oj5_.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-Cfhepf6U.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-C6n5r8AP.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-DJ_-_kGh.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page-COTo7btH.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-BsC346Ym.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CRL4gfk5.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-B_60-buR.js +0 -1
- package/dist/gateway/static/root/assets/channels-DNxr72oD.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-Bk84TKyF.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-B2pC--2X.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Bu15_14O.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-CCN30yiy.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-Dg3RM_vY.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DUy1HymM.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-BTuFpGIK.js +0 -1
- package/dist/gateway/static/root/assets/dist-CKkafhaS.js +0 -1
- package/dist/gateway/static/root/assets/dist-io9jFpN72.js +0 -1
- package/dist/gateway/static/root/assets/extension-debug-page-xM8vfbRZ.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-Cl8zlion.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-DODk0nOi.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-B01fiKrV.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BL3C7Q9w.js +0 -1
- package/dist/gateway/static/root/assets/home-page-CjJVq_Ff.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-By9oc8sD.js +0 -1
- package/dist/gateway/static/root/assets/index-B-w6Rk9Z.css +0 -1
- package/dist/gateway/static/root/assets/index-S4z-eKe-.js +0 -106
- package/dist/gateway/static/root/assets/local-app-workbench-page-Bnz5YOks.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-DVqwybaT.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-CUoDWFg7.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-BhFHoVtG.js +0 -201
- package/dist/gateway/static/root/assets/messages-vL3EpIrL.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-CxbZWvj1.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-DkEOEza6.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-CjCYNkVb.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-Dnzie6QW.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-0p9PIHRy.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-D1H4_Nfl.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-BWC89e7l.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-BYmHC91B.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-DuVzpZ9R.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-BBl_4U1U.js +0 -2
- package/dist/gateway/static/root/assets/schema-form-Rj-wi9sm.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BnipzwJ6.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-C7oNKVxC.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-6gOr-ype.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-D1tVcmlR.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-CR0VBBw3.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-CK0Bg_-o.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-B3Ghvh3c.js +0 -1
- package/dist/gateway/static/root/assets/skill-api-CoIsCPbI.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DMIwfISw.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-CDkm7yig.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-Cfv-jDmY.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-eYs6qgcW.js +0 -1
- package/dist/gateway/static/root/assets/tasks-BH8_WMUF.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-CpOQaCFN.js +0 -1
- package/dist/gateway/static/root/assets/usage-page-Cye-2eKA.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-o6YLrkpO.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Bg-jeU7W.js +0 -2
- package/dist/gateway/static/root/assets/voice-api-key-field-FMNwQIho.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-KnoMMEDN.js +0 -6
- 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
- /package/dist/gateway/static/root/assets/{dist-CI_fqRk-2.js → dist-CI_fqRk-.js} +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { init_connection, isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
3
|
+
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
4
|
+
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
//#region src/personal-agent/repository.ts
|
|
7
|
+
init_repository();
|
|
8
|
+
init_connection();
|
|
9
|
+
init_config_repository();
|
|
10
|
+
init_transaction();
|
|
11
|
+
const DEFAULT_PERSONAL_PREFERENCES = {
|
|
12
|
+
warmth: "balanced",
|
|
13
|
+
humor: "none",
|
|
14
|
+
supportMode: "untangle",
|
|
15
|
+
detailLevel: "balanced",
|
|
16
|
+
proactivity: "decisions"
|
|
17
|
+
};
|
|
18
|
+
function personalAgentId(ownerId) {
|
|
19
|
+
return `personal-${createHash("sha256").update(ownerId).digest("hex").slice(0, 12)}`;
|
|
20
|
+
}
|
|
21
|
+
function personalConversationId(ownerId) {
|
|
22
|
+
const hash = createHash("sha256").update(`personal-conversation:${ownerId}`).digest("hex");
|
|
23
|
+
return `${hash.slice(0, 8)}-${hash.slice(8, 12)}-5${hash.slice(13, 16)}-8${hash.slice(17, 20)}-${hash.slice(20, 32)}`;
|
|
24
|
+
}
|
|
25
|
+
function personalSession(column, value) {
|
|
26
|
+
if (!isXopcDatabaseOpen()) return null;
|
|
27
|
+
return getSqliteDatabase().prepare(`SELECT conversation_id, agent_id
|
|
28
|
+
FROM sessions WHERE ${column} = ? AND json_extract(custom_data_json, '$.personalAgent') = 1
|
|
29
|
+
ORDER BY created_at LIMIT 1`).get(value) ?? null;
|
|
30
|
+
}
|
|
31
|
+
function appearanceFrom(agent) {
|
|
32
|
+
return agent.profile?.emoji === "☁" ? "cloud" : agent.profile?.emoji === "◕" ? "bean" : "spark";
|
|
33
|
+
}
|
|
34
|
+
function toRecord(ownerId, agent, session) {
|
|
35
|
+
const config = session ? getSessionConfig(session.conversation_id) : null;
|
|
36
|
+
const ready = agent.provisioningState === "ready" && agent.runtime?.thinkingLevel === "off" && session && config?.thinkingLevel === "off" && config.fixedModel;
|
|
37
|
+
return {
|
|
38
|
+
ownerId,
|
|
39
|
+
agentId: agent.id,
|
|
40
|
+
conversationId: session?.conversation_id ?? personalConversationId(ownerId),
|
|
41
|
+
state: agent.provisioningState === "error" ? "error" : ready ? "ready" : "provisioning",
|
|
42
|
+
displayName: agent.profile?.name ?? "Personal AI",
|
|
43
|
+
appearance: appearanceFrom(agent),
|
|
44
|
+
preferences: agent.profile?.responsePreferences ?? DEFAULT_PERSONAL_PREFERENCES,
|
|
45
|
+
revision: agent.revision,
|
|
46
|
+
errorMessage: agent.provisioningError ?? null
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function getPersonalAgent(ownerId) {
|
|
50
|
+
if (!isXopcDatabaseOpen()) return null;
|
|
51
|
+
const agent = new AgentCatalogRepository().get(personalAgentId(ownerId));
|
|
52
|
+
return agent ? toRecord(ownerId, agent, personalSession("agent_id", agent.id)) : null;
|
|
53
|
+
}
|
|
54
|
+
function getPersonalAgentByConversation(conversationId) {
|
|
55
|
+
const session = personalSession("conversation_id", conversationId);
|
|
56
|
+
if (!session) return null;
|
|
57
|
+
const agent = new AgentCatalogRepository().get(session.agent_id);
|
|
58
|
+
if (!agent) return null;
|
|
59
|
+
const ownerId = "local-owner";
|
|
60
|
+
return agent.id === personalAgentId(ownerId) ? toRecord(ownerId, agent, session) : null;
|
|
61
|
+
}
|
|
62
|
+
function isPersonalConversation(conversationId) {
|
|
63
|
+
if (!isXopcDatabaseOpen()) return false;
|
|
64
|
+
return Boolean(getSqliteDatabase().prepare(`SELECT 1 FROM sessions WHERE conversation_id = ?
|
|
65
|
+
AND agent_id = ? AND json_extract(custom_data_json, '$.personalAgent') = 1`).get(conversationId, personalAgentId("local-owner")));
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { DEFAULT_PERSONAL_PREFERENCES, getPersonalAgent, getPersonalAgentByConversation, isPersonalConversation, personalAgentId, personalConversationId };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { GatewayService } from '../gateway/service.js';
|
|
3
|
+
import { type PersonalAgentRecord } from './repository.js';
|
|
4
|
+
export declare const PersonalPreferencesSchema: z.ZodObject<{
|
|
5
|
+
addressAs: z.ZodOptional<z.ZodString>;
|
|
6
|
+
warmth: z.ZodOptional<z.ZodEnum<{
|
|
7
|
+
balanced: "balanced";
|
|
8
|
+
reserved: "reserved";
|
|
9
|
+
gentle: "gentle";
|
|
10
|
+
}>>;
|
|
11
|
+
humor: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
none: "none";
|
|
13
|
+
occasional: "occasional";
|
|
14
|
+
playful: "playful";
|
|
15
|
+
}>>;
|
|
16
|
+
supportMode: z.ZodOptional<z.ZodEnum<{
|
|
17
|
+
listen: "listen";
|
|
18
|
+
untangle: "untangle";
|
|
19
|
+
solutions: "solutions";
|
|
20
|
+
}>>;
|
|
21
|
+
detailLevel: z.ZodOptional<z.ZodEnum<{
|
|
22
|
+
brief: "brief";
|
|
23
|
+
balanced: "balanced";
|
|
24
|
+
detailed: "detailed";
|
|
25
|
+
}>>;
|
|
26
|
+
proactivity: z.ZodOptional<z.ZodEnum<{
|
|
27
|
+
open: "open";
|
|
28
|
+
decisions: "decisions";
|
|
29
|
+
important: "important";
|
|
30
|
+
}>>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
export type PersonalPreferences = z.infer<typeof PersonalPreferencesSchema>;
|
|
33
|
+
export declare const PersonalAppearanceSchema: z.ZodEnum<{
|
|
34
|
+
cloud: "cloud";
|
|
35
|
+
spark: "spark";
|
|
36
|
+
bean: "bean";
|
|
37
|
+
}>;
|
|
38
|
+
export type PersonalAppearance = z.infer<typeof PersonalAppearanceSchema>;
|
|
39
|
+
export declare function personalInstructions(preferences: PersonalPreferences): string;
|
|
40
|
+
export declare function refreshPersonalDelegationGuidance(service: GatewayService, ownerId: string): Promise<void>;
|
|
41
|
+
export declare function listPersonalModels(): Promise<Array<{
|
|
42
|
+
id: string;
|
|
43
|
+
name: string;
|
|
44
|
+
}>>;
|
|
45
|
+
export declare function ensurePersonalConversationVisibility(ownerId: string): void;
|
|
46
|
+
export declare function createOrResumePersonalAgent(service: GatewayService, ownerId: string, requestedModel?: string, availableModels?: typeof listPersonalModels): Promise<PersonalAgentRecord>;
|
|
47
|
+
export declare function patchPersonalProfile(service: GatewayService, ownerId: string, revision: number, displayName: string, preferences: PersonalPreferences, appearance: PersonalAppearance): Promise<PersonalAgentRecord | null>;
|
|
48
|
+
export declare function updatePersonalProfileRecord(ownerId: string, revision: number, displayName: string, preferences: PersonalPreferences, appearance: PersonalAppearance): Promise<PersonalAgentRecord | null>;
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
2
|
+
import { init_session_repository, patchSessionMetadata } from "../storage/sqlite/session-repository.js";
|
|
3
|
+
import { init_config_repository, setSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
4
|
+
import { ResponsePreferencesSchema } from "../agent-config/schema.js";
|
|
5
|
+
import { init_agent_config } from "../agent-config/index.js";
|
|
6
|
+
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
7
|
+
import { createConversation, init_conversation_repository } from "../storage/sqlite/conversation-repository.js";
|
|
8
|
+
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
9
|
+
import { getModelThinking } from "../providers/model-thinking.js";
|
|
10
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
11
|
+
import { DEFAULT_PERSONAL_PREFERENCES, getPersonalAgent, personalAgentId } from "./repository.js";
|
|
12
|
+
import { PERSONAL_MAIN_TOOL_IDS } from "./policy.js";
|
|
13
|
+
import { z } from "zod";
|
|
14
|
+
//#region src/personal-agent/service.ts
|
|
15
|
+
init_agent_config();
|
|
16
|
+
init_repository();
|
|
17
|
+
init_providers();
|
|
18
|
+
init_conversation_repository();
|
|
19
|
+
init_session_repository();
|
|
20
|
+
init_config_repository();
|
|
21
|
+
const PersonalPreferencesSchema = ResponsePreferencesSchema;
|
|
22
|
+
const PersonalAppearanceSchema = z.enum([
|
|
23
|
+
"spark",
|
|
24
|
+
"cloud",
|
|
25
|
+
"bean"
|
|
26
|
+
]);
|
|
27
|
+
function appearanceEmoji(appearance) {
|
|
28
|
+
return appearance === "cloud" ? "☁" : appearance === "bean" ? "◕" : "✦";
|
|
29
|
+
}
|
|
30
|
+
const LEGACY_DELEGATION_RULE = "Answer simple requests directly. For complex work, use personal_task agents to find a suitable specialist, then create a Task and remain available to talk. Never claim a task was created before the tool confirms it.";
|
|
31
|
+
const PREVIOUS_DELEGATION_RULES = [
|
|
32
|
+
"Route by required capability, not task length. Answer directly only when your own tools and knowledge are sufficient. For current facts, web pages, or any tool you lack, call personal_task(command=\"agents\"), choose an Agent with the needed availableTools, then create a Task. Your own lack of browsing does not mean xopc cannot browse. Never claim the system cannot help, ask the user to switch models, or ask them to paste sources before checking Agents.",
|
|
33
|
+
"For current news, delegate to an Agent with web_search. Include the requested date or time window and topic in the brief; require source links, publication dates, and a distinction between confirmed news and uncertain reports. Tell the user briefly that you are checking. Stay available while the Task runs, then summarize verified results in their preferred style.",
|
|
34
|
+
"If no suitable Agent is available, explain the specific missing capability and offer the next useful option. Never claim a Task was created before the tool confirms it."
|
|
35
|
+
].join("\n");
|
|
36
|
+
const DELEGATION_RULES = [
|
|
37
|
+
"Own the user’s request through completion. If you cannot reliably do it yourself because of missing tools, access, knowledge, time, or specialist judgment, first call personal_task(command=\"agents\"). Match the request to another Agent’s description and availableTools, then create a Task for a plausible candidate. This applies to short requests too. Your own limitation is not a system limitation. Do not stop at “I cannot” or ask the user to switch models or do your work before checking Agents.",
|
|
38
|
+
"If the chosen Agent or tool cannot complete the Task, inspect the actual blocker and try another suitable Agent or a reasonable alternative within the user’s authorization. Do not repeat the same failed approach indefinitely. Ask the user only for a decision, access, or information that no available Agent can supply. Explain a concrete blocker only after checking the available paths; never imply that an untried path was attempted.",
|
|
39
|
+
"For current news or other live facts, find an Agent with web_search and require dated sources. For coding, analysis, writing, media, or connected-app work, choose by the Agent’s role and tools rather than a fixed name. Give the Task a short title and a complete Markdown brief. After Task creation succeeds, tell the user briefly what is happening, stay available, and summarize verified outcomes in their preferred style.",
|
|
40
|
+
"Never claim a Task was created or completed before its tool result confirms that state. Respect the user’s authorization and the selected Agent’s permissions."
|
|
41
|
+
];
|
|
42
|
+
function personalInstructions(preferences) {
|
|
43
|
+
const rules = [
|
|
44
|
+
"You are the user’s personal AI: capable, clear, attentive, and responsive. Match the user’s language. Let the user’s stated preferences and current situation shape how you speak; do not impose a cute or affectionate persona.",
|
|
45
|
+
...DELEGATION_RULES,
|
|
46
|
+
"When creating a Task, provide a short title that names the work, a one-sentence objective, and a Markdown description with all detailed instructions. Keep the title free of checklists and long background. Preserve user requirements in the description.",
|
|
47
|
+
"Adapt to the user’s current words first, then their saved preferences. If the user explicitly changes how they want you to respond in future, save it with personal_preference. Do not infer a lasting emotional trait from one conversation or claim human feelings or experiences.",
|
|
48
|
+
"Give the accurate answer or next step in the order this user prefers. Acknowledge feelings only when relevant, without guessing how the user feels. Avoid formulaic reassurance, praise, pet names, emojis, or jokes unless the user welcomes them and the moment fits. Be accurate about task state, evidence, and uncertainty."
|
|
49
|
+
];
|
|
50
|
+
if (preferences.addressAs) rules.push(`Address the user as ${JSON.stringify(preferences.addressAs)} when a name fits naturally.`);
|
|
51
|
+
if (preferences.warmth) rules.push({
|
|
52
|
+
reserved: "Tone: calm and direct; skip emotional preambles.",
|
|
53
|
+
balanced: "Tone: friendly and natural.",
|
|
54
|
+
gentle: "Tone: softly supportive without being sentimental."
|
|
55
|
+
}[preferences.warmth]);
|
|
56
|
+
if (preferences.humor) rules.push({
|
|
57
|
+
none: "Do not add jokes.",
|
|
58
|
+
occasional: "Use an occasional light touch when the moment fits.",
|
|
59
|
+
playful: "Be lightly playful in easy moments."
|
|
60
|
+
}[preferences.humor]);
|
|
61
|
+
if (preferences.supportMode) rules.push({
|
|
62
|
+
listen: "When the user is struggling, listen and reflect briefly before proposing fixes.",
|
|
63
|
+
untangle: "When the user is struggling, help name the core problem and make it manageable.",
|
|
64
|
+
solutions: "When the user is struggling, offer a concrete next step promptly."
|
|
65
|
+
}[preferences.supportMode]);
|
|
66
|
+
if (preferences.detailLevel) rules.push({
|
|
67
|
+
brief: "Keep replies short and lead with the answer.",
|
|
68
|
+
balanced: "Give the answer and only the context needed to act.",
|
|
69
|
+
detailed: "Explain reasoning and tradeoffs when useful."
|
|
70
|
+
}[preferences.detailLevel]);
|
|
71
|
+
if (preferences.proactivity) rules.push({
|
|
72
|
+
decisions: "Only proactively surface decisions and outcomes.",
|
|
73
|
+
important: "Proactively surface important milestones as well as outcomes.",
|
|
74
|
+
open: "You may offer useful suggestions without flooding the user."
|
|
75
|
+
}[preferences.proactivity]);
|
|
76
|
+
return rules.join("\n");
|
|
77
|
+
}
|
|
78
|
+
async function refreshPersonalDelegationGuidance(service, ownerId) {
|
|
79
|
+
const agent = new AgentCatalogRepository().get(personalAgentId(ownerId));
|
|
80
|
+
const instructions = agent?.profile?.instructions;
|
|
81
|
+
if (!agent || !instructions) return;
|
|
82
|
+
const oldRule = instructions.includes(PREVIOUS_DELEGATION_RULES) ? PREVIOUS_DELEGATION_RULES : instructions.includes(LEGACY_DELEGATION_RULE) ? LEGACY_DELEGATION_RULE : null;
|
|
83
|
+
if (!oldRule) return;
|
|
84
|
+
try {
|
|
85
|
+
await new AgentCatalogService().update(agent.id, { profile: {
|
|
86
|
+
...agent.profile,
|
|
87
|
+
instructions: instructions.replace(oldRule, DELEGATION_RULES.join("\n"))
|
|
88
|
+
} }, agent.revision);
|
|
89
|
+
service.refreshAgentCatalog?.();
|
|
90
|
+
const conversationId = getPersonalAgent(ownerId)?.conversationId;
|
|
91
|
+
if (conversationId) service.agentService?.evictSessionAgent(conversationId);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
if (!(error instanceof Error && error.message === "Agent revision conflict")) throw error;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
async function listPersonalModels() {
|
|
97
|
+
return (await getAvailableModels()).filter((model) => getModelThinking(model).options.includes("off")).map((model) => ({
|
|
98
|
+
id: `${model.provider}/${model.id}`,
|
|
99
|
+
name: model.name ?? model.id
|
|
100
|
+
}));
|
|
101
|
+
}
|
|
102
|
+
const inFlightProvisioning = /* @__PURE__ */ new Map();
|
|
103
|
+
function ensurePersonalConversationVisibility(ownerId) {
|
|
104
|
+
const conversationId = getPersonalAgent(ownerId)?.conversationId;
|
|
105
|
+
if (!conversationId) return;
|
|
106
|
+
const session = getSessionMetadata(conversationId);
|
|
107
|
+
if (!session || session.hiddenFromSessionList && session.customData?.keepHiddenFromSessionList === true) return;
|
|
108
|
+
patchSessionMetadata(conversationId, {
|
|
109
|
+
hiddenFromSessionList: true,
|
|
110
|
+
customData: {
|
|
111
|
+
...session.customData,
|
|
112
|
+
keepHiddenFromSessionList: true
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function createOrResumePersonalAgent(service, ownerId, requestedModel, availableModels = listPersonalModels) {
|
|
117
|
+
const current = inFlightProvisioning.get(ownerId);
|
|
118
|
+
if (current) return current;
|
|
119
|
+
const pending = provisionPersonalAgent(service, ownerId, requestedModel, availableModels);
|
|
120
|
+
inFlightProvisioning.set(ownerId, pending);
|
|
121
|
+
pending.finally(() => {
|
|
122
|
+
if (inFlightProvisioning.get(ownerId) === pending) inFlightProvisioning.delete(ownerId);
|
|
123
|
+
}).catch(() => {});
|
|
124
|
+
return pending;
|
|
125
|
+
}
|
|
126
|
+
async function provisionPersonalAgent(service, ownerId, requestedModel, availableModels = listPersonalModels) {
|
|
127
|
+
const existingIdentity = getPersonalAgent(ownerId);
|
|
128
|
+
if (existingIdentity?.state === "ready") {
|
|
129
|
+
await refreshPersonalDelegationGuidance(service, ownerId);
|
|
130
|
+
ensurePersonalConversationVisibility(ownerId);
|
|
131
|
+
return getPersonalAgent(ownerId) ?? existingIdentity;
|
|
132
|
+
}
|
|
133
|
+
const agentId = personalAgentId(ownerId);
|
|
134
|
+
const existing = new AgentCatalogRepository().get(agentId);
|
|
135
|
+
const available = await availableModels();
|
|
136
|
+
const preferredModel = requestedModel ?? existing?.models?.chat?.primary;
|
|
137
|
+
const fastModel = preferredModel ? void 0 : new AgentCatalogRepository().getSettings().defaults.models.intents.fast?.primary;
|
|
138
|
+
const chosen = preferredModel ? available.find((model) => model.id === preferredModel) : available.find((model) => model.id === fastModel) ?? available[0];
|
|
139
|
+
if (!chosen) throw new Error("Choose a configured model that supports thinking off");
|
|
140
|
+
const catalog = new AgentCatalogService();
|
|
141
|
+
if (!existing) await catalog.create({
|
|
142
|
+
id: agentId,
|
|
143
|
+
enabled: true,
|
|
144
|
+
profile: {
|
|
145
|
+
name: "Personal AI",
|
|
146
|
+
description: "A personal AI that adapts its responses to the user and coordinates work.",
|
|
147
|
+
creature: "assistant",
|
|
148
|
+
language: "zh",
|
|
149
|
+
emoji: appearanceEmoji("spark"),
|
|
150
|
+
responsePreferences: DEFAULT_PERSONAL_PREFERENCES,
|
|
151
|
+
instructions: personalInstructions(DEFAULT_PERSONAL_PREFERENCES)
|
|
152
|
+
},
|
|
153
|
+
toolAllowlist: [...PERSONAL_MAIN_TOOL_IDS],
|
|
154
|
+
skills: {
|
|
155
|
+
mode: "replace",
|
|
156
|
+
include: []
|
|
157
|
+
},
|
|
158
|
+
runtime: { thinkingLevel: "off" },
|
|
159
|
+
models: { chat: {
|
|
160
|
+
primary: chosen.id,
|
|
161
|
+
fallbacks: []
|
|
162
|
+
} }
|
|
163
|
+
});
|
|
164
|
+
else if (existing.provisioningState !== "ready" || existing.models?.chat?.primary !== chosen.id || existing.runtime?.thinkingLevel !== "off") await catalog.update(agentId, {
|
|
165
|
+
models: { chat: {
|
|
166
|
+
primary: chosen.id,
|
|
167
|
+
fallbacks: []
|
|
168
|
+
} },
|
|
169
|
+
runtime: {
|
|
170
|
+
...existing.runtime,
|
|
171
|
+
thinkingLevel: "off"
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
const record = getPersonalAgent(ownerId);
|
|
175
|
+
if (!record) throw new Error("Personal Agent provisioning did not complete");
|
|
176
|
+
const conversationId = record.conversationId;
|
|
177
|
+
service.refreshAgentCatalog();
|
|
178
|
+
if (!getSessionMetadata(conversationId)) createConversation({
|
|
179
|
+
agentId,
|
|
180
|
+
sourceChannel: "webchat",
|
|
181
|
+
name: record.displayName,
|
|
182
|
+
hiddenFromSessionList: true,
|
|
183
|
+
customData: {
|
|
184
|
+
personalAgent: true,
|
|
185
|
+
keepHiddenFromSessionList: true
|
|
186
|
+
}
|
|
187
|
+
}, "", conversationId);
|
|
188
|
+
ensurePersonalConversationVisibility(ownerId);
|
|
189
|
+
setSessionConfig(conversationId, {
|
|
190
|
+
modelOverride: chosen.id,
|
|
191
|
+
fixedModel: true,
|
|
192
|
+
thinkingLevel: "off"
|
|
193
|
+
}, process.cwd());
|
|
194
|
+
return getPersonalAgent(ownerId) ?? record;
|
|
195
|
+
}
|
|
196
|
+
async function patchPersonalProfile(service, ownerId, revision, displayName, preferences, appearance) {
|
|
197
|
+
const updated = await updatePersonalProfileRecord(ownerId, revision, displayName, preferences, appearance);
|
|
198
|
+
if (!updated) return null;
|
|
199
|
+
service.refreshAgentCatalog();
|
|
200
|
+
service.agentService.evictSessionAgent(updated.conversationId);
|
|
201
|
+
return updated;
|
|
202
|
+
}
|
|
203
|
+
async function updatePersonalProfileRecord(ownerId, revision, displayName, preferences, appearance) {
|
|
204
|
+
const current = new AgentCatalogRepository().get(personalAgentId(ownerId));
|
|
205
|
+
if (!current || current.provisioningState !== "ready" || current.revision !== revision || getPersonalAgent(ownerId)?.state !== "ready") return null;
|
|
206
|
+
const profile = {
|
|
207
|
+
...current.profile,
|
|
208
|
+
name: displayName,
|
|
209
|
+
emoji: appearanceEmoji(appearance),
|
|
210
|
+
responsePreferences: preferences,
|
|
211
|
+
instructions: personalInstructions(preferences)
|
|
212
|
+
};
|
|
213
|
+
try {
|
|
214
|
+
await new AgentCatalogService().update(current.id, { profile }, revision);
|
|
215
|
+
} catch (error) {
|
|
216
|
+
if (error instanceof Error && error.message === "Agent revision conflict") return null;
|
|
217
|
+
throw error;
|
|
218
|
+
}
|
|
219
|
+
return getPersonalAgent(ownerId);
|
|
220
|
+
}
|
|
221
|
+
//#endregion
|
|
222
|
+
export { PersonalAppearanceSchema, PersonalPreferencesSchema, createOrResumePersonalAgent, ensurePersonalConversationVisibility, listPersonalModels, patchPersonalProfile, personalInstructions, refreshPersonalDelegationGuidance, updatePersonalProfileRecord };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
1
|
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
|
+
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
+
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
3
5
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
4
6
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
5
7
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
-
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
7
8
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { init_paths_state, resolveXopcCloudCatalogCachePath } from "../config/paths-state.js";
|
|
3
|
-
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
4
3
|
import { ComputerProfileSchema, init_src } from "../../packages/computer-control-contract/src/index.js";
|
|
4
|
+
import { init_write_file_atomic, writeTextAtomic } from "../infra/write-file-atomic.js";
|
|
5
5
|
import { voiceManifestSchema } from "../../packages/realtime-protocol/src/voice-catalog.js";
|
|
6
6
|
import { init_voice } from "../../packages/realtime-protocol/src/voice.js";
|
|
7
7
|
import { readFileSync, rmSync } from "node:fs";
|
|
@@ -2,8 +2,8 @@ import { AgentCatalogRepository, init_repository } from "../agent-catalog/reposi
|
|
|
2
2
|
import { init_model_policy, isComputerModel, isDedicatedComputerProfile } from "../computer/model-policy.js";
|
|
3
3
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
4
4
|
import { getModelRegistry, init_model_registry } from "./model-registry.js";
|
|
5
|
-
import { getImageGenerationProvider } from "../agent/image/generation/provider-registry.js";
|
|
6
5
|
import { parseImageGenerationModelRef } from "../agent/image/generation/model-ref.js";
|
|
6
|
+
import { getImageGenerationProvider } from "../agent/image/generation/provider-registry.js";
|
|
7
7
|
//#region src/providers/model-reference-auditor.ts
|
|
8
8
|
init_repository();
|
|
9
9
|
init_model_policy();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
2
|
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
|
+
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -2,9 +2,9 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { isTailscaleInstalled } from "../infra/tailscale.js";
|
|
4
4
|
import { resolveGatewayBindMode } from "../config/gateway-bind.js";
|
|
5
|
+
import { getTunnelService } from "../tunnel/tunnel-service.js";
|
|
5
6
|
import { collectExposureConflicts } from "./exposure-guards.js";
|
|
6
7
|
import { getTailscaleExposureState, maybeStartTailscaleFromConfig, stopTailscaleExposure } from "../gateway/tailscale-lifecycle.js";
|
|
7
|
-
import { getTunnelService } from "../tunnel/tunnel-service.js";
|
|
8
8
|
import { getTunnelConsentState } from "../tunnel/consent.js";
|
|
9
9
|
import { maybeAutoStartTunnelFromConfig } from "../tunnel/gateway-lifecycle.js";
|
|
10
10
|
//#region src/remote-access/exposure-manager.ts
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { MessageBus } from "../../infra/bus/queue.js";
|
|
2
|
-
import "../../infra/bus/index.js";
|
|
3
|
-
import { SessionStore } from "../../session/store.js";
|
|
4
1
|
import { createSqliteTranscriptRuntime } from "../../agent/embedded/transcript-runtime.js";
|
|
5
|
-
import { createStructuredOutputTool } from "../../agent/workflow/structured-output-tool.js";
|
|
6
2
|
import { createDelegateChildHandle } from "../../agent/child-agent-factory.js";
|
|
7
3
|
import { createDelegationParentPolicy } from "../../agent/tools/delegation-parent-policy.js";
|
|
4
|
+
import { SessionStore } from "../../session/store.js";
|
|
5
|
+
import { MessageBus } from "../../infra/bus/queue.js";
|
|
6
|
+
import "../../infra/bus/index.js";
|
|
7
|
+
import { createStructuredOutputTool } from "../../agent/workflow/structured-output-tool.js";
|
|
8
8
|
import { createScopedWorkspaceTools } from "../../agent/tools/scoped-workspace-tools.js";
|
|
9
9
|
import { taskFollowUpTemplate } from "./contracts.js";
|
|
10
10
|
import { z } from "zod";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths_state, resolveStateDir } from "../../config/paths-state.js";
|
|
2
2
|
import { ExecutionEnvironmentStore } from "../../execution-environments/store.js";
|
|
3
3
|
import { ProjectStore } from "../../projects/project-store.js";
|
|
4
|
-
import { LocalWorktreeManager } from "../../execution-environments/local-worktree-manager.js";
|
|
5
4
|
import { readWorkspaceFile } from "../../agent/sandbox/fileAccess.js";
|
|
5
|
+
import { LocalWorktreeManager } from "../../execution-environments/local-worktree-manager.js";
|
|
6
6
|
import { workspaceFingerprint } from "./workspaceFingerprint.js";
|
|
7
7
|
import { dirname, join, resolve } from "node:path";
|
|
8
8
|
import { existsSync, lstatSync, mkdirSync, readdirSync, realpathSync } from "node:fs";
|
|
@@ -5,14 +5,14 @@ import { TaskRunRepository, init_task_run_repository } from "../../tasks/task-ru
|
|
|
5
5
|
import { AgentCatalogRepository, init_repository } from "../../agent-catalog/repository.js";
|
|
6
6
|
import { init_agent_scope, resolveDefaultAgentId } from "../../agent/agent-scope.js";
|
|
7
7
|
import { init_providers, isProviderConfiguredSync, resolveModel } from "../../providers/index.js";
|
|
8
|
-
import { runProcess } from "../../process/run-process.js";
|
|
9
8
|
import { ExecutionEnvironmentStore } from "../../execution-environments/store.js";
|
|
10
9
|
import { ProjectStore } from "../../projects/project-store.js";
|
|
11
|
-
import {
|
|
10
|
+
import { runProcess } from "../../process/run-process.js";
|
|
11
|
+
import { removeCommandContainer } from "../../agent/commands/command-isolation.js";
|
|
12
|
+
import { inspectGitRepository } from "../../execution-environments/git.js";
|
|
12
13
|
import { TaskContextRepository } from "../../tasks/task-context-repository.js";
|
|
13
14
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
14
|
-
import {
|
|
15
|
-
import { removeCommandContainer } from "../../agent/commands/command-isolation.js";
|
|
15
|
+
import { resolveModelSelector } from "../../config/agent-model-intents.js";
|
|
16
16
|
import { sceneContentHash } from "../contracts.js";
|
|
17
17
|
import { SceneConflictError, SceneNotFoundError, SceneRepository } from "../repository.js";
|
|
18
18
|
import { SceneSetupError } from "../service.js";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { buildSessionContextForLlm, init_session_context_for_llm, isTranscriptContextEntry, mergeLlmMessagesPreservingContextRows, transcriptRowsFromJsonArray } from "./session-context-for-llm.js";
|
|
2
2
|
import { SessionStatus, init_types } from "./types.js";
|
|
3
3
|
import { effectiveWorkspacePathForSession, normalizeWorkingDirectoryInput, projectWorkspacePath } from "./session-workspace.js";
|
|
4
|
-
import { fallbackTitleFromMessages, generateSessionTitleFromMessages, getSessionTitleSource, isWebchatConversationId, maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle, provisionalTitleFromUserText, sanitizeGeneratedSessionTitle, sanitizeSessionTitle, shouldAutoTitleConversationId, shouldRefineSessionTitleWithLlm } from "./session-title.js";
|
|
5
4
|
import { flattenMessageContent, messagesToClientHistory } from "./client-history.js";
|
|
5
|
+
import { emitSessionTranscriptUpdate, onSessionTranscriptUpdate } from "./transcript-events.js";
|
|
6
|
+
import { fallbackTitleFromMessages, generateSessionTitleFromMessages, getSessionTitleSource, isWebchatConversationId, maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle, provisionalTitleFromUserText, sanitizeGeneratedSessionTitle, sanitizeSessionTitle, shouldAutoTitleConversationId, shouldRefineSessionTitleWithLlm } from "./session-title.js";
|
|
6
7
|
import { SessionStore } from "./store.js";
|
|
7
8
|
import { applySessionPatchToMetadata } from "./patch-metadata.js";
|
|
8
9
|
import { SessionIndex } from "./manager.js";
|
|
9
|
-
import { emitSessionTranscriptUpdate, onSessionTranscriptUpdate } from "./transcript-events.js";
|
|
10
10
|
import { SessionConfigStore, resolveReasoningLevel, resolveThinkingLevel, resolveVerboseLevel } from "./config-store.js";
|
|
11
11
|
import { DEFAULT_ACTIVITY_DETAIL_LEVEL, resolveConfiguredActivityDetailDefault, resolveEffectiveReasoningLevel, resolveEffectiveThinkingLevel } from "./thinking-resolve.js";
|
|
12
12
|
import { DEFAULT_IDLE_MINUTES, DEFAULT_RESET_AT_HOUR, DEFAULT_RESET_MODE, evaluateSessionFreshness, resolveDailyResetAtMs, resolveSessionResetPolicy } from "./reset-policy.js";
|
|
@@ -6,6 +6,7 @@ import { findConversationIdByTranscriptId } from "../storage/sqlite/session-repo
|
|
|
6
6
|
import { getSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
7
7
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
8
8
|
import { SessionConfigSchema, init_schema } from "../config/schema.js";
|
|
9
|
+
import { isPersonalConversation } from "../personal-agent/repository.js";
|
|
9
10
|
import { normalizeThinkLevel, normalizeVerboseLevel } from "../agent/transcript/thinking-types.js";
|
|
10
11
|
import { evaluateSessionFreshness, resolveSessionResetPolicy } from "./reset-policy.js";
|
|
11
12
|
import { resolveChannelResetConfig, resolveSessionResetType } from "./reset-type.js";
|
|
@@ -51,12 +52,13 @@ async function resolveSession(opts) {
|
|
|
51
52
|
sessionStartedAt: sessionMetadata.sessionStartedAt ? Date.parse(sessionMetadata.sessionStartedAt) : void 0,
|
|
52
53
|
lastInteractionAt: sessionMetadata.lastInteractionAt ? Date.parse(sessionMetadata.lastInteractionAt) : void 0
|
|
53
54
|
} : void 0 });
|
|
54
|
-
const
|
|
55
|
+
const freshness = sessionMetadata ? evaluateSessionFreshness({
|
|
55
56
|
updatedAt: Date.parse(sessionMetadata.updatedAt),
|
|
56
57
|
...lifecycle,
|
|
57
58
|
now,
|
|
58
59
|
policy: resetPolicy
|
|
59
|
-
}) : { fresh: false }
|
|
60
|
+
}) : { fresh: false };
|
|
61
|
+
const fresh = Boolean(sessionMetadata && conversationId && isPersonalConversation(conversationId)) || freshness.fresh;
|
|
60
62
|
const transcriptId = opts.transcriptId?.trim() || (fresh ? sessionMetadata?.transcriptId : void 0) || randomUUID();
|
|
61
63
|
const isNewSession = !fresh && !opts.transcriptId?.trim();
|
|
62
64
|
if (isNewSession && conversationId) log.debug({
|
|
@@ -5,8 +5,8 @@ import { isCronConversationId } from "../routing/agent-session-key.js";
|
|
|
5
5
|
import { init_session_key } from "../routing/session-key.js";
|
|
6
6
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
7
7
|
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
8
|
-
import { stripRuntimeContextFromUserMessage } from "./user-message-display.js";
|
|
9
8
|
import { readAgentMessageContent } from "../agent/memory/agent-message-access.js";
|
|
9
|
+
import { stripRuntimeContextFromUserMessage } from "./user-message-display.js";
|
|
10
10
|
//#region src/session/session-title.ts
|
|
11
11
|
init_session_key();
|
|
12
12
|
init_providers();
|
|
@@ -13,16 +13,16 @@ import { appendCompactionBoundaryIfUnchanged, appendTranscriptEntry, listCompact
|
|
|
13
13
|
import { getSessionConfig, setSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
14
14
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
15
15
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
16
|
-
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
17
16
|
import { resolveEffectiveAgentProfile } from "../config/agent-profile.js";
|
|
18
|
-
import {
|
|
17
|
+
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
18
|
+
import { transcriptRowsToClientHistory } from "./client-history.js";
|
|
19
19
|
import { SessionCompactor } from "../agent/memory/compaction.js";
|
|
20
20
|
import { resolveCompactionPolicy } from "../agent/memory/compaction-policy.js";
|
|
21
|
-
import { promoteCompactionLedger } from "../agent/memory/compaction-promotion.js";
|
|
22
21
|
import { resolveUserContextSessionAccess } from "../user-context/access-policy.js";
|
|
22
|
+
import { readPostCompactionContext } from "../agent/reply/post-compaction-context.js";
|
|
23
|
+
import { promoteCompactionLedger } from "../agent/memory/compaction-promotion.js";
|
|
23
24
|
import { SlidingWindow } from "../agent/memory/window.js";
|
|
24
25
|
import { isAppendOnlyLlmTranscriptMessage } from "./transcript-stats.js";
|
|
25
|
-
import { transcriptRowsToClientHistory } from "./client-history.js";
|
|
26
26
|
import { compactHistory } from "./compact-history.js";
|
|
27
27
|
import { backfillStructuredTurnOutcomes } from "./turn-outcome-projector.js";
|
|
28
28
|
import { computeTranscriptUserRoundDeleteRange } from "./user-round-delete.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { normalizeThinkLevel } from "../agent/transcript/thinking-types.js";
|
|
2
1
|
import { resolveReasoningLevel, resolveThinkingLevel } from "./config-store.js";
|
|
2
|
+
import { normalizeThinkLevel } from "../agent/transcript/thinking-types.js";
|
|
3
3
|
//#region src/session/thinking-resolve.ts
|
|
4
4
|
const FALLBACK = "medium";
|
|
5
5
|
/**
|
|
@@ -5,8 +5,8 @@ import { init_connection, requireXopcDatabase } from "../storage/sqlite/connecti
|
|
|
5
5
|
import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { init_paths } from "../config/paths.js";
|
|
7
7
|
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
8
|
-
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
9
8
|
import { SHARE_CONFIG_DEFAULTS } from "./share-types.js";
|
|
9
|
+
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
10
10
|
import { logShareAudit } from "./share-audit.js";
|
|
11
11
|
import { join, relative, resolve } from "node:path";
|
|
12
12
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -2,9 +2,9 @@ import { resolveStateDir } from "../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
4
|
import { init_paths } from "../config/paths.js";
|
|
5
|
-
import { loadPlaywrightCoreModule } from "../browser/providers/playwright-doctor.js";
|
|
6
5
|
import { getShareStore } from "./share-store.js";
|
|
7
6
|
import { getSiteShareStore } from "./site-share-store.js";
|
|
7
|
+
import { loadPlaywrightCoreModule } from "../browser/providers/playwright-doctor.js";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
10
10
|
//#region src/share/share-thumbnail.ts
|
|
@@ -2,8 +2,8 @@ import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
|
2
2
|
import { relative, resolve } from "node:path";
|
|
3
3
|
import { createReadStream } from "node:fs";
|
|
4
4
|
import { lstat, readdir, realpath, stat } from "node:fs/promises";
|
|
5
|
-
import { Readable, Transform } from "node:stream";
|
|
6
5
|
import { pipeline } from "node:stream/promises";
|
|
6
|
+
import { Readable, Transform } from "node:stream";
|
|
7
7
|
import { crc32, createDeflateRaw } from "node:zlib";
|
|
8
8
|
//#region src/share/share-zip.ts
|
|
9
9
|
const SIG_LOCAL = 67324752;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { request } from "undici";
|
|
3
4
|
import { Readable } from "node:stream";
|
|
4
5
|
import * as ws from "ws";
|
|
5
|
-
import { request } from "undici";
|
|
6
6
|
//#region src/share/site-proxy.ts
|
|
7
7
|
init_logger();
|
|
8
8
|
const wsAny = ws;
|
|
@@ -3,8 +3,8 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { init_connection, requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
4
4
|
import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
5
5
|
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
6
|
-
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
7
6
|
import { SITE_SHARE_CONFIG_DEFAULTS } from "./site-share-types.js";
|
|
7
|
+
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
8
8
|
import { relative, resolve } from "node:path";
|
|
9
9
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
10
10
|
import { lstat, readdir, realpath, stat } from "node:fs/promises";
|