@xopcai/xopc 0.0.364 → 0.0.367
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/dist/sidepanel.js +16 -4
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-GvR2gZ0T.js → activity-store-Cuf3JFFJ.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-7Ct-ZlfL.js → agent-avatar-dicebear-DyATPNTe.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-gT9_j4tr.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CLXCJ6JN.js +1 -0
- package/dist/gateway/static/root/assets/agents-BAUfOMsq.js +66 -0
- package/dist/gateway/static/root/assets/{agents-admin-api-BkXb7VEZ.js → agents-admin-api-D842OcNo.js} +1 -1
- package/dist/gateway/static/root/assets/app-link-4gpFbdsr.js +1 -0
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CjfsIn9A.js → app-management-settings-panel-CoIFxQKH.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-qqHZ15GU.js → appearance-settings-DQr0o6Lm.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-Ba2VkQk6.js → apps-page-CltMV4Xp.js} +1 -1
- package/dist/gateway/static/root/assets/{archive-plugin-CKe3qAaL.js → archive-plugin-DT8Nio-r.js} +1 -1
- package/dist/gateway/static/root/assets/automation-display-DCkjVzA0.js +2 -0
- package/dist/gateway/static/root/assets/{automations-page-Bt8Q58ut.js → automations-page-BIfWS_3Y.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BCGPjsdU.js +6 -0
- package/dist/gateway/static/root/assets/binary-plugins-7qs3qcW9.js +2 -0
- package/dist/gateway/static/root/assets/{block-editor-ClRFbHP7.js → block-editor-BFPUlxJ6.js} +28 -28
- package/dist/gateway/static/root/assets/{browser-automation-inputs-5B3qAdmb.js → browser-automation-inputs-BUAIKIX0.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BjMub7JM.js → browser-automations-page-CSwu1U1F.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-C1ReMNqX.js +3 -0
- package/dist/gateway/static/root/assets/capabilities-BzWFO_x_.js +1 -0
- package/dist/gateway/static/root/assets/{capabilities-BKu9BqPe.js → capabilities-K0Zb_lH0.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-page-BdTSqloI.js +2 -0
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-gZ8auLwa.js → capabilities-settings-panel-BUblBMZC.js} +4 -4
- package/dist/gateway/static/root/assets/{capability-header-actions-L1NvoOUG.js → capability-header-actions-AMn_vTNv.js} +1 -1
- package/dist/gateway/static/root/assets/channels-CXCf5qO6.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DsCpKPBe.js → chat-terminal-dock-C7nAROhF.js} +2 -2
- package/dist/gateway/static/root/assets/chevron-left-DqFhpbvK.js +1 -0
- package/dist/gateway/static/root/assets/computer-settings-page-B5SuSZ3G.js +1 -0
- package/dist/gateway/static/root/assets/{connector-service-page-mtH9mEBf.js → connector-service-page-CTx1B8wx.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-DfnK1crf.js +2 -0
- package/dist/gateway/static/root/assets/date-formatters-CUZAyDEg.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-Cx_xIKvN.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-B_fPQBTM.js → dependency-picker-DYm96PDu.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-CJrO9Vd_.js → desktop-pet-D90OzgeR.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-DYAfri9w.js → desktop-pet-settings-CmdCecjm.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-CqRys2R8.js → device-pairing-wizard-s2ogSa4l.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-D7_qSxNZ.js → directory-picker-path-field-DZpaoeNa.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-BGyJpRv4.js → extension-debug-page-Bv6QE8kC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D1zBmd8F.js → extension-page-CEsq71Cm.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-F9JzOWZ3.js → extension-provider-CX-sK0Tw.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-CTR8AjCG.js → extension-settings-page-UyOHF39P.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-Chhv4Nfv.js → fallback-models-CKv_Wqg8.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-swr-CoRoOG1l.js → gateway-config-swr-Cjnkle5J.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-realtime-D0ygm6bc.js → gateway-realtime-DCCLdyQD.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-C_Th8kGg.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-CZ73IpbP.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-FDS6S6qa.js → gateway-startup-retry-CXKmdVzN.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-BQWq4kYi.js +2 -0
- package/dist/gateway/static/root/assets/{image-generation-api-BPd76jW5.js → image-generation-api-NLHzm4Nc.js} +1 -1
- package/dist/gateway/static/root/assets/{imports-page-9EnECtcl.js → imports-page-C7qvlBTQ.js} +1 -1
- package/dist/gateway/static/root/assets/index-BQgqzhQj.js +106 -0
- package/dist/gateway/static/root/assets/index-COB4QIJp.css +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-MC7mG2h2.js → keyboard-shortcuts-settings-pkgFWJb-.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-dMDhZXAi.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-c3HncHZ3.js → local-apps-page-TpUAfOn2.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-Cvv7I0fw.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-DId6-v2R.js → locale-store-C8TMD2gn.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-B-Y9oZLh.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-B2lzsw6X.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-Dse7rkio.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-XLewwq2q.js → media-plugins-BZrnzaBM.js} +1 -1
- package/dist/gateway/static/root/assets/messages-Dy26npMy.js +3 -0
- package/dist/gateway/static/root/assets/{models-hub-cache-B9SKjidc.js → models-hub-cache-B1C86nRp.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-DL__qP6U.js +5 -0
- package/dist/gateway/static/root/assets/{notes-api-Byt65v3r.js → notes-api-DKiVeQKG.js} +1 -1
- package/dist/gateway/static/root/assets/notes-page-DTBbg9Hs.js +8 -0
- package/dist/gateway/static/root/assets/{oauth-api-BYsCbyGZ.js → oauth-api-BwpzpRwC.js} +1 -1
- package/dist/gateway/static/root/assets/open-route-MyZ2sB9C.js +1 -0
- package/dist/gateway/static/root/assets/{page-context-capture-button-RBp1QK0F.js → page-context-capture-button-Cxzd4QPB.js} +1 -1
- package/dist/gateway/static/root/assets/personal-page-CzaTnHeD.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-D4hoEWiu.js +1 -0
- package/dist/gateway/static/root/assets/product-preview-content-aR38El2E.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-D20QH4YB.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Bf3BIcT6.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-7F2WNEZC.js → registry-api-AdnxowbH.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CKxqncqW.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-B0c120iI.js → runtime-tools-settings-panel-CBN3raz1.js} +1 -1
- package/dist/gateway/static/root/assets/scenes-page-Cv_5ozfX.js +2 -0
- package/dist/gateway/static/root/assets/{schema-form-DQpQc9tH.js → schema-form-CxrMGsT9.js} +1 -1
- package/dist/gateway/static/root/assets/secret-input-D93UrW4C.js +1 -0
- package/dist/gateway/static/root/assets/{send-session-input-D1oc6BC6.js → send-session-input-CgOzhDZ0.js} +1 -1
- package/dist/gateway/static/root/assets/{session-api-N3N37MrR.js → session-api-_HIN8or3.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-CzCto5zT.js +16 -0
- package/dist/gateway/static/root/assets/sessions-page-DZcu6NLJ.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DazqeDQ7.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-GgBEp6O7.js → settings-page-D8Q3H3-o.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DvLMMiuS.js +1 -0
- package/dist/gateway/static/root/assets/{share-link-dialog-TBBGJPfT.js → share-link-dialog-Dg5os066.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DyRLPsPv.js → share-preview-page-DMvohAyr.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-api-DU0fHP2G.js → shares-api-C96IO4qJ.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-DJ1ME-XM.js → shares-settings-CsDATuCw.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-1Puv6wOz.js → skill-api-C10ML0CH.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-reload-api-ClyFqHk7.js → skill-reload-api-DNbJzSfB.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page-DObMKvA6.js +2 -0
- package/dist/gateway/static/root/assets/{system-settings-panel--yV67a8L.js → system-settings-panel-Bn3khdzb.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BR2L1L8l.js +2 -0
- package/dist/gateway/static/root/assets/task-expandable-content-DL2Q2gre.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-CH6KoBeY.js → tasks-DwKXgZ-I.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-OhcbFEUR.js → theme-store-DQ6KJa4l.js} +1 -1
- package/dist/gateway/static/root/assets/tracing-settings-page-Ed8_GYUT.js +1 -0
- package/dist/gateway/static/root/assets/{tunnel-api-COLdiP_E.js → tunnel-api-D3X8jDwo.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-CtM5IfrL.js → usage-page-BqzRyyb9.js} +1 -1
- package/dist/gateway/static/root/assets/{use-autosave-veoM0dHn.js → use-autosave-CRFefpzO.js} +1 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-OLrvSjn5.js +2 -0
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-Bope6MW6.js → use-file-preview-expanded-CJvzfQvw.js} +2 -2
- package/dist/gateway/static/root/assets/user-model-page-CG6wqIKP.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CwD6a3KQ.js → voice-api-key-field-R9zNWYR_.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-Daexehmc.js → voice-config-api-DLudE9Rc.js} +1 -1
- package/dist/gateway/static/root/assets/{work-discovery-overlay-C9u7tuEc.js → work-discovery-overlay-DVmQrolV.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-BMOBbf33.js → workflow-run-setup-panel-DEkmuD3T.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-pqCB3sh4.js +6 -0
- package/dist/gateway/static/root/assets/workspace-api-CdVUhyPo.js +2 -0
- package/dist/gateway/static/root/index.html +33 -31
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/automations.js +1 -0
- package/dist/packages/gateway-contract/src/home.js +14 -0
- package/dist/packages/gateway-contract/src/index.js +2 -0
- package/dist/packages/gateway-contract/src/notifications.js +2 -1
- package/dist/packages/gateway-contract/src/personal-proactivity.js +139 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +1 -0
- package/dist/packages/image-providers/src/catalog.js +373 -0
- package/dist/packages/image-providers/src/execute.js +372 -0
- package/dist/packages/image-providers/src/http.js +94 -0
- package/dist/packages/image-providers/src/index.js +5 -0
- package/dist/packages/image-providers/src/types.d.ts +95 -0
- package/dist/packages/image-providers/src/validation.js +52 -0
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +35 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/commands/command-registry.js +1 -1
- package/dist/src/agent/context/execution-context.js +1 -1
- package/dist/src/agent/context/project-context.js +4 -4
- package/dist/src/agent/embedded/run-for-session.js +1 -1
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/failover-error.d.ts +1 -1
- package/dist/src/agent/failover-error.js +7 -0
- package/dist/src/agent/image/generation/native-provider.d.ts +2 -0
- package/dist/src/agent/image/generation/native-provider.js +118 -0
- package/dist/src/agent/image/generation/openai-images-provider.d.ts +1 -1
- package/dist/src/agent/image/generation/openai-images-provider.js +48 -32
- package/dist/src/agent/image/generation/provider-registry.js +4 -13
- package/dist/src/agent/image/generation/providers/xopc-cloud.js +5 -34
- package/dist/src/agent/image/generation/runtime-types.d.ts +2 -4
- package/dist/src/agent/image/generation/runtime.js +28 -23
- package/dist/src/agent/image/generation/types.d.ts +3 -50
- package/dist/src/agent/image/generation/validation.d.ts +6 -0
- package/dist/src/agent/image/generation/validation.js +16 -0
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/prompt/voice-presentation.d.ts +1 -1
- package/dist/src/agent/prompt/voice-presentation.js +1 -1
- package/dist/src/agent/service/direct-turn-helpers.js +17 -1
- package/dist/src/agent/service.js +3 -3
- package/dist/src/agent/skills/index.js +1 -1
- package/dist/src/agent/skills/managed-store.js +1 -1
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/tools/delegation-parent-policy.js +2 -0
- package/dist/src/agent/tools/delegation-policy.js +2 -0
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +31 -4
- package/dist/src/agent/tools/image-generate-tool.js +5 -19
- package/dist/src/agent/tools/index.d.ts +2 -2
- package/dist/src/agent/tools/index.js +3 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +2 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +60 -1
- package/dist/src/agent/tools/personal-attention-tool.d.ts +21 -0
- package/dist/src/agent/tools/personal-attention-tool.js +191 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +12 -8
- package/dist/src/agent/tools/personal-task-tool.js +35 -41
- package/dist/src/agent/tools/user-context-tool.d.ts +2 -0
- package/dist/src/agent/tools/user-context-tool.js +61 -2
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/agent-catalog/migrations/legacy-config-cutover.js +1 -1
- package/dist/src/agent-catalog/repository.d.ts +1 -0
- package/dist/src/agent-catalog/repository.js +4 -1
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +2 -0
- package/dist/src/automations/domain/types.d.ts +1 -1
- package/dist/src/automations/domain/validation.d.ts +4 -0
- package/dist/src/automations/domain/validation.js +1 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/personal-command-policy.d.ts +2 -0
- package/dist/src/chat-commands/personal-command-policy.js +9 -0
- package/dist/src/chat-commands/registry.js +6 -0
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/models.js +4 -9
- package/dist/src/cli/commands/onboard/model.js +2 -2
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/models-json.d.ts +170 -0
- package/dist/src/config/models-json.js +23 -8
- package/dist/src/extensions/agent-plugins/validation.js +1 -1
- package/dist/src/files/file-service.d.ts +6 -0
- package/dist/src/files/file-service.js +38 -1
- package/dist/src/gateway/agent-builtin-tools.d.ts +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- package/dist/src/gateway/custom-image-providers.d.ts +34 -0
- package/dist/src/gateway/file-path-classifier.js +12 -3
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +1 -1
- package/dist/src/gateway/hono/routes/files.js +13 -2
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/observability.js +8 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +41 -0
- package/dist/src/gateway/hono/routes/projects.js +3 -3
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +2 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +9 -1
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +1 -1
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +1 -0
- package/dist/src/gateway/service/agent-runner.js +12 -1
- package/dist/src/gateway/service/run-gateway-agent.d.ts +1 -0
- package/dist/src/gateway/service/run-gateway-agent.js +15 -0
- package/dist/src/gateway/service/session-command-service.js +5 -3
- package/dist/src/gateway/service/session-input-coordinator.d.ts +12 -0
- package/dist/src/gateway/service/session-input-coordinator.js +63 -5
- 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 +54 -9
- package/dist/src/gateway/session-context-summary.js +1 -1
- package/dist/src/gateway/session-reset-service.js +1 -1
- package/dist/src/gateway/xopc-cloud-capability-setup.js +1 -1
- package/dist/src/home-intelligence/host.js +2 -2
- package/dist/src/local-apps/service.js +2 -2
- package/dist/src/notifications/planner.js +32 -0
- package/dist/src/notifications/service.d.ts +2 -0
- package/dist/src/personal-agent/capability-service.js +3 -2
- package/dist/src/personal-agent/communication.d.ts +3 -2
- package/dist/src/personal-agent/communication.js +4 -3
- package/dist/src/personal-agent/conversation-state.d.ts +5 -0
- package/dist/src/personal-agent/conversation-state.js +17 -0
- package/dist/src/personal-agent/notifications.d.ts +4 -0
- package/dist/src/personal-agent/notifications.js +40 -0
- package/dist/src/personal-agent/persona.d.ts +6 -0
- package/dist/src/personal-agent/persona.js +16 -0
- package/dist/src/personal-agent/policy.d.ts +3 -1
- package/dist/src/personal-agent/policy.js +28 -6
- package/dist/src/personal-agent/proactivity/automation.d.ts +3 -0
- package/dist/src/personal-agent/proactivity/automation.js +41 -0
- package/dist/src/personal-agent/proactivity/follow-up-request.d.ts +5 -0
- package/dist/src/personal-agent/proactivity/follow-up-request.js +44 -0
- package/dist/src/personal-agent/proactivity/repository.d.ts +128 -0
- package/dist/src/personal-agent/proactivity/repository.js +403 -0
- package/dist/src/personal-agent/proactivity/routes.d.ts +3 -0
- package/dist/src/personal-agent/proactivity/routes.js +182 -0
- package/dist/src/personal-agent/proactivity/service.d.ts +32 -0
- package/dist/src/personal-agent/proactivity/service.js +496 -0
- package/dist/src/personal-agent/prompt-context.d.ts +10 -0
- package/dist/src/personal-agent/prompt-context.js +119 -0
- package/dist/src/personal-agent/prompts.d.ts +7 -0
- package/dist/src/personal-agent/prompts.js +135 -0
- package/dist/src/personal-agent/reply-composer.d.ts +1 -1
- package/dist/src/personal-agent/reply-composer.js +41 -13
- package/dist/src/personal-agent/repository.d.ts +1 -1
- package/dist/src/personal-agent/repository.js +1 -1
- package/dist/src/personal-agent/request-delivery.js +1 -1
- package/dist/src/personal-agent/request-service.js +2 -2
- package/dist/src/personal-agent/service.d.ts +1 -2
- package/dist/src/personal-agent/service.js +5 -93
- package/dist/src/personal-agent/specialist-capabilities.d.ts +9 -0
- package/dist/src/personal-agent/specialist-capabilities.js +37 -0
- package/dist/src/personal-agent/unread.d.ts +10 -0
- package/dist/src/personal-agent/unread.js +43 -0
- package/dist/src/providers/env-keys.js +6 -0
- package/dist/src/providers/model-catalog-persistence.js +3 -22
- package/dist/src/providers/model-catalog-store.js +1 -8
- package/dist/src/providers/model-catalog-types.d.ts +1 -9
- package/dist/src/providers/xopc-cloud-model-source.js +4 -25
- package/dist/src/session/client-history.d.ts +2 -0
- package/dist/src/session/client-history.js +26 -0
- package/dist/src/session/init-session-turn.js +10 -0
- package/dist/src/session/session-context-for-llm.js +28 -0
- package/dist/src/session/store.js +1 -1
- package/dist/src/storage/sqlite/migrations/235_personal_conversation_priority.sql +3 -0
- package/dist/src/storage/sqlite/migrations/236_personal_proactivity.sql +53 -0
- package/dist/src/storage/sqlite/migrations/237_personal_strategy_versions.sql +18 -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-input-repository.d.ts +2 -0
- package/dist/src/storage/sqlite/session-input-repository.js +18 -5
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +27 -1
- package/dist/src/tasks/task-main-update-decision-service.js +1 -1
- package/dist/src/tasks/task-result-delivery-service.js +1 -1
- package/dist/src/tui/backends/embedded-backend.js +1 -1
- package/dist/src/voice/platform-catalog.d.ts +1 -9
- package/dist/src/voice/realtime/agentEngine.js +32 -7
- package/dist/src/voice/realtime/engine.d.ts +1 -0
- package/dist/src/voice/realtime/omniEngine.d.ts +1 -0
- package/dist/src/voice/realtime/omniEngine.js +10 -0
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/dist/src/voice/realtime/runtime.d.ts +1 -0
- package/dist/src/voice/realtime/runtime.js +5 -0
- package/dist/src/voice/realtime/runtime.types.d.ts +2 -0
- package/dist/src/work-discovery/service.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/package.json +4 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-wYj-iyqv.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-C9HYMhnJ.js +0 -1
- package/dist/gateway/static/root/assets/agents-hPkFQ81z.js +0 -66
- package/dist/gateway/static/root/assets/app-link-DRL0YnPs.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-Ch0ViAJW.js +0 -7
- package/dist/gateway/static/root/assets/binary-plugins-J51oS7-D.js +0 -2
- package/dist/gateway/static/root/assets/browser-settings-page-CYrPA-Fp.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-CT_ZW9fT.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-page-dW6FXtOy.js +0 -2
- package/dist/gateway/static/root/assets/channels-Dx5T2G73.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-6FWwxYLe.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DgDLaws0.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-BDcwEaIx.js +0 -1
- package/dist/gateway/static/root/assets/gateway-realtime-store-DBvCRclh.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BVfz4Tla.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BF_9C9yW.js +0 -1
- package/dist/gateway/static/root/assets/index-BpXej9jJ.js +0 -106
- package/dist/gateway/static/root/assets/index-CbJNcWAn.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CytNu0-_.js +0 -1
- package/dist/gateway/static/root/assets/local-session-drafts-gbemPamv.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-D4aXtitd.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-CRzWi_iJ.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-DQZ51j9e.js +0 -201
- package/dist/gateway/static/root/assets/messages-BHvpZNe9.js +0 -3
- package/dist/gateway/static/root/assets/note-detail-panel-BgbByI-4.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-R2BX5XCE.js +0 -8
- package/dist/gateway/static/root/assets/personal-page-F0jTBWva.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-BtDK68qb.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DmQEm0yH.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CrLQvkHX.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-C25_hQAd.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DM64yMnx.js +0 -2
- package/dist/gateway/static/root/assets/secret-input-DPl3VYM8.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-CMGUwtbN.js +0 -16
- package/dist/gateway/static/root/assets/sessions-page-DvDO8LtA.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BNhgbmcX.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-10bMi6yL.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-D52pEr5x.js +0 -2
- package/dist/gateway/static/root/assets/task-detail-page-D-tcS2bS.js +0 -2
- package/dist/gateway/static/root/assets/tracing-settings-page-DoBJ0TYY.js +0 -1
- package/dist/gateway/static/root/assets/use-composer-attachments-DB0bBGzZ.js +0 -2
- package/dist/gateway/static/root/assets/user-model-page-CSh61kZ5.js +0 -2
- package/dist/gateway/static/root/assets/workflows-page-BrD9vXqO.js +0 -6
- package/dist/gateway/static/root/assets/workspace-api-Cs4sjV2A.js +0 -2
- package/dist/src/agent/image/generation/normalization.d.ts +0 -38
- package/dist/src/agent/image/generation/normalization.js +0 -181
- package/dist/src/agent/image/generation/providers/dashscope.d.ts +0 -35
- package/dist/src/agent/image/generation/providers/dashscope.js +0 -257
- package/dist/src/agent/image/generation/providers/fal.d.ts +0 -15
- package/dist/src/agent/image/generation/providers/fal.js +0 -323
- package/dist/src/agent/image/generation/providers/google.d.ts +0 -16
- package/dist/src/agent/image/generation/providers/google.js +0 -244
- package/dist/src/agent/image/generation/providers/minimax.d.ts +0 -23
- package/dist/src/agent/image/generation/providers/minimax.js +0 -215
- package/dist/src/agent/image/generation/providers/openai.d.ts +0 -5
- package/dist/src/agent/image/generation/providers/openai.js +0 -134
|
@@ -34,11 +34,16 @@ function contextRefsMatchFrozenSnapshot(requested, frozen) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
var SessionInputCoordinator = class {
|
|
37
|
+
pendingSubmissions = /* @__PURE__ */ new Map();
|
|
38
|
+
resumeAfter = /* @__PURE__ */ new Map();
|
|
37
39
|
draining = /* @__PURE__ */ new Set();
|
|
38
40
|
submissionTails = /* @__PURE__ */ new Map();
|
|
39
41
|
constructor(deps) {
|
|
40
42
|
this.deps = deps;
|
|
41
43
|
}
|
|
44
|
+
isAcceptingInput(conversationId) {
|
|
45
|
+
return (this.pendingSubmissions.get(conversationId) ?? 0) > 0;
|
|
46
|
+
}
|
|
42
47
|
snapshot(conversationId) {
|
|
43
48
|
return getSessionInputState(conversationId);
|
|
44
49
|
}
|
|
@@ -52,6 +57,7 @@ var SessionInputCoordinator = class {
|
|
|
52
57
|
content: input.content.trim(),
|
|
53
58
|
attachments,
|
|
54
59
|
contextRefs: contexts.map(summarizeSourceContext),
|
|
60
|
+
interruptRequested: input.interrupt !== false && this.deps.prioritizeInput?.(input) === true,
|
|
55
61
|
contextSnapshots: contexts,
|
|
56
62
|
thinking: input.thinking,
|
|
57
63
|
origin: input.origin
|
|
@@ -63,7 +69,12 @@ var SessionInputCoordinator = class {
|
|
|
63
69
|
await this.runSubmissionExclusive(input.conversationId, async () => {
|
|
64
70
|
const row = getSessionInputById(conversationId, inputId);
|
|
65
71
|
const state = this.snapshot(input.conversationId);
|
|
66
|
-
if (!row || row.status !== "queued"
|
|
72
|
+
if (!row || row.status !== "queued") return;
|
|
73
|
+
if (row.interruptRequested) {
|
|
74
|
+
this.prioritizeAcceptedInput(row, state);
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
if (row.requestedDelivery !== "steer" || !state.activeRunId || row.attachments?.length || row.contextSnapshots?.length || state.preparation && state.preparation.state !== "ready") return;
|
|
67
78
|
setSessionInputStatus(row.id, "injecting", {
|
|
68
79
|
effectiveDelivery: "steer",
|
|
69
80
|
targetRunId: state.activeRunId
|
|
@@ -83,6 +94,26 @@ var SessionInputCoordinator = class {
|
|
|
83
94
|
this.publish(row.conversationId);
|
|
84
95
|
});
|
|
85
96
|
}
|
|
97
|
+
prioritizeAcceptedInput(row, runtime) {
|
|
98
|
+
const conversationId = row.conversationId;
|
|
99
|
+
this.resumeAfter.set(conversationId, Date.now() + (this.deps.coalesceWindowMs ?? 200));
|
|
100
|
+
this.publish(conversationId);
|
|
101
|
+
if (runtime.activeRunId && this.deps.interrupt) {
|
|
102
|
+
this.deps.emit("session.input-interrupt", {
|
|
103
|
+
conversationId,
|
|
104
|
+
runId: runtime.activeRunId,
|
|
105
|
+
inputId: row.id
|
|
106
|
+
});
|
|
107
|
+
this.deps.interrupt(conversationId, runtime.activeRunId).catch((err) => {
|
|
108
|
+
log.warn({
|
|
109
|
+
err,
|
|
110
|
+
conversationId,
|
|
111
|
+
runId: runtime.activeRunId
|
|
112
|
+
}, "Conversation interruption failed; accepted input remains queued");
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
this.drain(conversationId);
|
|
116
|
+
}
|
|
86
117
|
publish(conversationId) {
|
|
87
118
|
const state = this.snapshot(conversationId);
|
|
88
119
|
this.deps.emit("session.input-state", state);
|
|
@@ -104,15 +135,25 @@ var SessionInputCoordinator = class {
|
|
|
104
135
|
if (this.submissionTails.get(conversationId) === tail) this.submissionTails.delete(conversationId);
|
|
105
136
|
}
|
|
106
137
|
}
|
|
138
|
+
async withSubmission(conversationId, operation) {
|
|
139
|
+
this.deps.onInputReceived?.(conversationId);
|
|
140
|
+
this.pendingSubmissions.set(conversationId, (this.pendingSubmissions.get(conversationId) ?? 0) + 1);
|
|
141
|
+
try {
|
|
142
|
+
return await operation();
|
|
143
|
+
} finally {
|
|
144
|
+
const remaining = (this.pendingSubmissions.get(conversationId) ?? 1) - 1;
|
|
145
|
+
if (remaining) this.pendingSubmissions.set(conversationId, remaining);
|
|
146
|
+
else this.pendingSubmissions.delete(conversationId);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
107
149
|
async submit(input) {
|
|
108
150
|
input = structuredClone(input);
|
|
109
151
|
const conversationId = input.conversationId.trim();
|
|
110
|
-
this.deps.onInputReceived?.(conversationId);
|
|
111
152
|
try {
|
|
112
|
-
return await this.runSubmissionExclusive(conversationId, () => this.submitLocked({
|
|
153
|
+
return await this.withSubmission(conversationId, () => this.runSubmissionExclusive(conversationId, () => this.submitLocked({
|
|
113
154
|
...input,
|
|
114
155
|
conversationId
|
|
115
|
-
}));
|
|
156
|
+
})));
|
|
116
157
|
} catch (error) {
|
|
117
158
|
if (error instanceof SessionInstanceChangedError) return {
|
|
118
159
|
ok: false,
|
|
@@ -242,7 +283,8 @@ var SessionInputCoordinator = class {
|
|
|
242
283
|
};
|
|
243
284
|
}
|
|
244
285
|
const runtime = this.snapshot(conversationId);
|
|
245
|
-
const
|
|
286
|
+
const priority = input.interrupt !== false && this.deps.prioritizeInput?.(input) === true;
|
|
287
|
+
const canSteer = !priority && input.delivery === "steer" && runtime.activeRunId !== void 0 && !attachments?.length && !sourceContexts?.length;
|
|
246
288
|
const effectiveDelivery = canSteer ? "steer" : "next";
|
|
247
289
|
const row = insertSessionInput({
|
|
248
290
|
expectedTranscriptId: input.expectedTranscriptId,
|
|
@@ -250,6 +292,7 @@ var SessionInputCoordinator = class {
|
|
|
250
292
|
conversationId,
|
|
251
293
|
clientMessageId,
|
|
252
294
|
requestedDelivery: input.delivery,
|
|
295
|
+
interruptRequested: priority,
|
|
253
296
|
effectiveDelivery,
|
|
254
297
|
status: canSteer ? "injecting" : "queued",
|
|
255
298
|
content,
|
|
@@ -262,6 +305,14 @@ var SessionInputCoordinator = class {
|
|
|
262
305
|
});
|
|
263
306
|
invalidateConnectionResumeIntent(conversationId);
|
|
264
307
|
supersedeActiveClarification(conversationId);
|
|
308
|
+
if (priority) {
|
|
309
|
+
this.prioritizeAcceptedInput(row, runtime);
|
|
310
|
+
return {
|
|
311
|
+
ok: true,
|
|
312
|
+
effectiveDelivery: "next",
|
|
313
|
+
state: this.publish(conversationId)
|
|
314
|
+
};
|
|
315
|
+
}
|
|
265
316
|
if (canSteer) {
|
|
266
317
|
if (!await this.deps.steer(conversationId, content)) {
|
|
267
318
|
setSessionInputStatus(row.id, "queued", {
|
|
@@ -293,6 +344,12 @@ var SessionInputCoordinator = class {
|
|
|
293
344
|
this.draining.add(conversationId);
|
|
294
345
|
try {
|
|
295
346
|
while (true) {
|
|
347
|
+
const delay = (this.resumeAfter.get(conversationId) ?? 0) - Date.now();
|
|
348
|
+
if (delay > 0) {
|
|
349
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
352
|
+
this.resumeAfter.delete(conversationId);
|
|
296
353
|
const runId = crypto.randomUUID();
|
|
297
354
|
const input = claimNextSessionInput(conversationId, runId);
|
|
298
355
|
if (!input) return;
|
|
@@ -320,6 +377,7 @@ var SessionInputCoordinator = class {
|
|
|
320
377
|
let result;
|
|
321
378
|
try {
|
|
322
379
|
result = await this.deps.execute({
|
|
380
|
+
inputReceivedAtMs: input.createdAtMs,
|
|
323
381
|
runId,
|
|
324
382
|
taskRunId: input.taskRunId,
|
|
325
383
|
conversationId,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
2
|
+
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
2
3
|
import { retireSessionMcpRuntimeForConversationId } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
3
4
|
import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
4
5
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
5
|
-
import { isPersonalConversation } from "../../personal-agent/repository.js";
|
|
6
6
|
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
7
7
|
import { collectMediaUrisFromValues, deleteMediaUris } from "../../media/session-references.js";
|
|
8
8
|
import { withModelConfigLock } from "../../session/model-config-lock.js";
|
|
@@ -129,6 +129,7 @@ export declare class GatewayService {
|
|
|
129
129
|
private createNotificationService;
|
|
130
130
|
private readonly taskRunDispatch;
|
|
131
131
|
private readonly taskMainUpdateDispatch;
|
|
132
|
+
private readonly personalProactivity;
|
|
132
133
|
private readonly taskResultDispatch;
|
|
133
134
|
dispatchTaskRuns(): void;
|
|
134
135
|
ensureTaskConversation(taskId: string, options?: {
|
|
@@ -151,6 +152,7 @@ export declare class GatewayService {
|
|
|
151
152
|
ok: false;
|
|
152
153
|
code: "BAD_REQUEST" | "QUEUE_FULL" | "CONTEXT_UNAVAILABLE" | "SESSION_CHANGED";
|
|
153
154
|
}>;
|
|
155
|
+
withSessionInputSubmission<T>(conversationId: string, operation: () => Promise<T>): Promise<T>;
|
|
154
156
|
prepareSessionCommandInput(input: Parameters<GatewayAgentRunner['inputs']['prepareInput']>[0]): Promise<{
|
|
155
157
|
status: "queued";
|
|
156
158
|
requestedDelivery: import("../storage/sqlite/session-input-repository.js").SessionInputDelivery;
|
|
@@ -158,6 +160,7 @@ export declare class GatewayService {
|
|
|
158
160
|
content: string;
|
|
159
161
|
attachments: import("./user-turn-input.js").UserTurnAttachment[];
|
|
160
162
|
contextRefs: import("../agent/source-context/types.js").SourceContextRefSummary[];
|
|
163
|
+
interruptRequested: boolean;
|
|
161
164
|
contextSnapshots: import("../agent/source-context/types.js").AgentSourceContext[];
|
|
162
165
|
thinking: string;
|
|
163
166
|
origin: {
|
|
@@ -8,7 +8,7 @@ import { init_logger } from "../utils/logger.js";
|
|
|
8
8
|
import { closeXopcDatabase } from "../storage/sqlite/connection.js";
|
|
9
9
|
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
10
10
|
import { getBrowserTabBindingById, init_browser_tab_binding_repository } from "../storage/sqlite/browser-tab-binding-repository.js";
|
|
11
|
-
import { findSessionInput, init_session_input_repository, insertSessionInput } from "../storage/sqlite/session-input-repository.js";
|
|
11
|
+
import { bumpSessionInputRevision, findSessionInput, init_session_input_repository, insertSessionInput } from "../storage/sqlite/session-input-repository.js";
|
|
12
12
|
import { TaskRepository } from "../tasks/task-repository.js";
|
|
13
13
|
import { TaskRunRepository, init_task_run_repository } from "../tasks/task-run-repository.js";
|
|
14
14
|
import { init_changes, notifyUserContextChange } from "../user-context/changes.js";
|
|
@@ -29,9 +29,10 @@ import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.
|
|
|
29
29
|
import { prewarmModelRegistry } from "../providers/model-registry.js";
|
|
30
30
|
import { init_providers, providers_exports } from "../providers/index.js";
|
|
31
31
|
import { AI_USAGE_RETENTION_MS, markStaleAiUsageEventsUnknown, pruneAiUsageEvents } from "../storage/sqlite/ai-usage-repository.js";
|
|
32
|
-
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
33
32
|
import { listKnowledgeItems } from "../knowledge-memory/repository.js";
|
|
34
33
|
import "../knowledge-memory/index.js";
|
|
34
|
+
import { getPersonalAgentByConversation } from "../personal-agent/repository.js";
|
|
35
|
+
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
35
36
|
import { getEmbeddedExecutionSession } from "../agent/embedded/execution-context.js";
|
|
36
37
|
import { disposeAllSessionMcpRuntimes } from "../agent/mcp/bundle-mcp-runtime.js";
|
|
37
38
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
@@ -91,15 +92,13 @@ import { DiscussionSealer } from "../discussions/sealer.js";
|
|
|
91
92
|
import "../discussions/index.js";
|
|
92
93
|
import { EndpointToolRuntime } from "../endpoint-tools/runtime.js";
|
|
93
94
|
import "../endpoint-tools/index.js";
|
|
94
|
-
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
95
|
-
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
96
|
-
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
97
|
-
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
98
95
|
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
99
96
|
import { prepareAutomationAgentSession } from "./automation-agent-session.js";
|
|
100
97
|
import { stopTailscaleExposure } from "./tailscale-lifecycle.js";
|
|
101
98
|
import { getGatewayFileSpaceService } from "./file-space-service.js";
|
|
102
99
|
import { reconcileHomeIntelligenceAutomation } from "./home-intelligence-automation-reconciler.js";
|
|
100
|
+
import { PersonalProactivityService } from "../personal-agent/proactivity/service.js";
|
|
101
|
+
import { reconcilePersonalProactivityAutomation } from "../personal-agent/proactivity/automation.js";
|
|
103
102
|
import { createBackgroundTask } from "../infra/background-task.js";
|
|
104
103
|
import { buildTaskAgentContext } from "../agent/source-context/task-context.js";
|
|
105
104
|
import { buildFileAgentContext } from "../agent/source-context/file-context.js";
|
|
@@ -153,10 +152,15 @@ import { createGatewayStartupTrace } from "./startup-trace.js";
|
|
|
153
152
|
import { GatewaySceneHost } from "./scenes/host.js";
|
|
154
153
|
import { TaskCollaborationDelivery } from "../tasks/task-collaboration-delivery.js";
|
|
155
154
|
import { TaskMainUpdateDelivery } from "../tasks/task-main-update-delivery.js";
|
|
155
|
+
import { allowsPersonalTaskNotification, personalReplyNotification, personalRunDelegated } from "../personal-agent/notifications.js";
|
|
156
156
|
import { TaskMainUpdateDecisionService } from "../tasks/task-main-update-decision-service.js";
|
|
157
157
|
import { selectTaskMainUpdateAttempt, submitAndConfirmTaskMainUpdate } from "../tasks/task-main-update-input.js";
|
|
158
158
|
import { checkAppContextAccess, prepareAppContext } from "./service/app-context-access.js";
|
|
159
159
|
import { applyAutomaticVoiceLanguage, inferProductLanguageFromEnvironment, initializeVoiceDefaults } from "../voice/language-profile.js";
|
|
160
|
+
import { HomeAdviceGenerator } from "../home-intelligence/generator.js";
|
|
161
|
+
import { HomeIntelligenceHost } from "../home-intelligence/host.js";
|
|
162
|
+
import { HomeSnapshotBuilder } from "../home-intelligence/snapshot.js";
|
|
163
|
+
import { HomeCapabilityPreflightService } from "../home-intelligence/capability-preflight.js";
|
|
160
164
|
import crypto from "node:crypto";
|
|
161
165
|
//#region src/gateway/service.ts
|
|
162
166
|
init_session_repository();
|
|
@@ -261,6 +265,9 @@ var GatewayService = class {
|
|
|
261
265
|
});
|
|
262
266
|
this.emit("session.transcript_updated", { key: conversationId });
|
|
263
267
|
},
|
|
268
|
+
onConversationInput: (conversationId) => {
|
|
269
|
+
bumpSessionInputRevision(getSqliteDatabase(), conversationId);
|
|
270
|
+
},
|
|
264
271
|
getConfig: () => this.config,
|
|
265
272
|
sessionExists: async (conversationId) => Boolean(await this.sessionIndex.getSessionMetadata(conversationId)),
|
|
266
273
|
sessionBusy: (conversationId) => Boolean(this.agentRunner.getActiveRunId(conversationId)) || this.agentRunner.inputs.snapshot(conversationId).inputs.some((input) => input.status === "queued"),
|
|
@@ -803,6 +810,7 @@ var GatewayService = class {
|
|
|
803
810
|
if (!this.notificationService) this.notificationService = new NotificationService({
|
|
804
811
|
publish: (type, payload) => this.realtime.broker.publish("gateway", type, payload),
|
|
805
812
|
allowsNotification: (notification) => {
|
|
813
|
+
if (!allowsPersonalTaskNotification(notification)) return false;
|
|
806
814
|
if (notification.target.kind !== "task") return true;
|
|
807
815
|
const taskId = notification.target.taskId;
|
|
808
816
|
return (this.sceneHost?.http.activationAdapters.list() ?? []).every((adapter) => adapter.allowsTaskNotification?.(taskId) !== false);
|
|
@@ -844,7 +852,7 @@ var GatewayService = class {
|
|
|
844
852
|
await new TaskMainUpdateDelivery().drain({
|
|
845
853
|
isAvailable: (conversationId) => {
|
|
846
854
|
const state = this.agentRunner.inputs.snapshot(conversationId);
|
|
847
|
-
return !state.activeRunId && state.inputs.every((item) => item.status === "interrupted") && (!this.voiceRealtime.hasConversation(conversationId) || this.voiceRealtime.canOfferTaskUpdate(conversationId));
|
|
855
|
+
return !this.agentRunner.inputs.isAcceptingInput(conversationId) && !state.activeRunId && state.inputs.every((item) => item.status === "interrupted") && (!this.voiceRealtime.hasConversation(conversationId) || this.voiceRealtime.canOfferTaskUpdate(conversationId));
|
|
848
856
|
},
|
|
849
857
|
decide: (input) => new TaskMainUpdateDecisionService({
|
|
850
858
|
getModelRef: (conversationId) => this.ensureAgentService().getModelForSession(conversationId),
|
|
@@ -884,6 +892,16 @@ var GatewayService = class {
|
|
|
884
892
|
phase: "task_main_update_dispatch"
|
|
885
893
|
}, `Main Agent update dispatch failed: ${errorMessage}`);
|
|
886
894
|
});
|
|
895
|
+
personalProactivity = new PersonalProactivityService({
|
|
896
|
+
getConfig: () => this.config,
|
|
897
|
+
isAvailable: (conversationId) => !this.stopping && !this.agentRunner.hasActiveRun(conversationId) && !this.agentRunner.inputs.isAcceptingInput(conversationId) && (!this.voiceRealtime.hasConversation(conversationId) || this.voiceRealtime.canPublishReply(conversationId)),
|
|
898
|
+
notify: (conversationId, outreachId) => {
|
|
899
|
+
this.emit("session.transcript_updated", {
|
|
900
|
+
key: conversationId,
|
|
901
|
+
outreachId
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
});
|
|
887
905
|
taskResultDispatch = createBackgroundTask(async () => {
|
|
888
906
|
const notify = (conversationId, deliveryId) => {
|
|
889
907
|
this.realtime.broker.publish("sessions", "session.task-result", {
|
|
@@ -894,9 +912,11 @@ var GatewayService = class {
|
|
|
894
912
|
key: conversationId,
|
|
895
913
|
deliveryId
|
|
896
914
|
});
|
|
915
|
+
const reply = personalReplyNotification(conversationId, deliveryId);
|
|
916
|
+
if (reply) this.emit("personal.reply.delivered", reply);
|
|
897
917
|
};
|
|
898
918
|
await new TaskResultDeliveryService().drain(notify);
|
|
899
|
-
new PersonalReplyComposer().drain(notify).catch((err) => {
|
|
919
|
+
new PersonalReplyComposer().drain(notify, (conversationId) => !this.agentRunner.hasActiveRun(conversationId) && !this.agentRunner.inputs.isAcceptingInput(conversationId) && (!this.voiceRealtime.hasConversation(conversationId) || this.voiceRealtime.canPublishReply(conversationId))).catch((err) => {
|
|
900
920
|
log.error({
|
|
901
921
|
err,
|
|
902
922
|
phase: "task_result_reply"
|
|
@@ -1005,6 +1025,9 @@ var GatewayService = class {
|
|
|
1005
1025
|
submitSessionInput(...args) {
|
|
1006
1026
|
return this.agentRunner.submitSessionInput(...args);
|
|
1007
1027
|
}
|
|
1028
|
+
withSessionInputSubmission(conversationId, operation) {
|
|
1029
|
+
return this.agentRunner.inputs.withSubmission(conversationId, operation);
|
|
1030
|
+
}
|
|
1008
1031
|
prepareSessionCommandInput(input) {
|
|
1009
1032
|
return this.agentRunner.inputs.prepareInput(input);
|
|
1010
1033
|
}
|
|
@@ -1388,6 +1411,9 @@ var GatewayService = class {
|
|
|
1388
1411
|
});
|
|
1389
1412
|
await trace.measure("automations.initialize", () => this.automationService.initialize());
|
|
1390
1413
|
await trace.measure("homeIntelligence.reconcileAutomation", () => reconcileHomeIntelligenceAutomation(this.automationService));
|
|
1414
|
+
this.personalProactivity.start();
|
|
1415
|
+
await trace.measure("personalProactivity.reconcile", () => reconcilePersonalProactivityAutomation(this.automationService));
|
|
1416
|
+
this.personalProactivity.tick();
|
|
1391
1417
|
await trace.measure("memoryMaintenance.reconcile", () => this.reconcileMemoryMaintenanceAutomations());
|
|
1392
1418
|
await this.notesService.initialize();
|
|
1393
1419
|
this.discussionLiveWorker.start();
|
|
@@ -1581,6 +1607,7 @@ var GatewayService = class {
|
|
|
1581
1607
|
this.lastChannelConnectDeferSource = "off";
|
|
1582
1608
|
await this.channelManager.stop();
|
|
1583
1609
|
await this.extensionLoader?.shutdown();
|
|
1610
|
+
await this.personalProactivity.stop();
|
|
1584
1611
|
await this.automationService.stop();
|
|
1585
1612
|
this.stopSessionTranscriptAutomationEvents?.();
|
|
1586
1613
|
this.stopSessionTranscriptAutomationEvents = null;
|
|
@@ -1847,6 +1874,10 @@ var GatewayService = class {
|
|
|
1847
1874
|
});
|
|
1848
1875
|
}
|
|
1849
1876
|
executeSystemAutomationAction(input) {
|
|
1877
|
+
if (input.capability === "personal.proactivity.tick") {
|
|
1878
|
+
this.personalProactivity.tick();
|
|
1879
|
+
return { summary: "Personal attention checks queued" };
|
|
1880
|
+
}
|
|
1850
1881
|
if (input.capability === "home.advisor.refresh") {
|
|
1851
1882
|
const generationId = this.homeIntelligence.requestRefresh("scheduled_refresh", `automation:${input.runId}`);
|
|
1852
1883
|
return { summary: generationId === "disabled" ? "Home AI suggestions are disabled" : `Home advice refresh queued: ${generationId}` };
|
|
@@ -1925,7 +1956,20 @@ var GatewayService = class {
|
|
|
1925
1956
|
});
|
|
1926
1957
|
}
|
|
1927
1958
|
this.realtime.broker.publish("gateway", type, payload);
|
|
1928
|
-
|
|
1959
|
+
let notificationPayload = payload;
|
|
1960
|
+
if (type === "agent.run.ended" && payload && typeof payload === "object") {
|
|
1961
|
+
const event = payload;
|
|
1962
|
+
if (event.status === "success" && event.conversationId && event.runId && getPersonalAgentByConversation(event.conversationId) && personalRunDelegated(event.conversationId, event.runId)) return;
|
|
1963
|
+
if (event.conversationId && getPersonalAgentByConversation(event.conversationId)) notificationPayload = {
|
|
1964
|
+
...event,
|
|
1965
|
+
target: {
|
|
1966
|
+
kind: "chat",
|
|
1967
|
+
conversationId: event.conversationId,
|
|
1968
|
+
personal: true
|
|
1969
|
+
}
|
|
1970
|
+
};
|
|
1971
|
+
}
|
|
1972
|
+
this.createNotificationService().handleGatewayEvent(type, notificationPayload);
|
|
1929
1973
|
}
|
|
1930
1974
|
async handleAutomationRunCompleted(run, context) {
|
|
1931
1975
|
this.emit("automation.run.completed", {
|
|
@@ -1959,6 +2003,7 @@ var GatewayService = class {
|
|
|
1959
2003
|
return this.automationService.ingestEvent(event, options?.targetAutomationIds);
|
|
1960
2004
|
}
|
|
1961
2005
|
projectAutomationEvent(event) {
|
|
2006
|
+
this.personalProactivity.ingestEvent(event);
|
|
1962
2007
|
if (event.source === "local_apps") this.emit(event.type, event.payload);
|
|
1963
2008
|
if (event.type === "project.deleted" && typeof event.payload.projectId === "string") {
|
|
1964
2009
|
const runIds = event.payload.deletedUnderstandingRunIds;
|
|
@@ -6,10 +6,10 @@ import { TaskRepository, init_task_repository } from "../tasks/task-repository.j
|
|
|
6
6
|
import { getSessionMetadata } from "../storage/sqlite/session-read-repository.js";
|
|
7
7
|
import { getCurrentTranscriptId, init_session_repository } from "../storage/sqlite/session-repository.js";
|
|
8
8
|
import { getSessionConfig, init_config_repository } from "../storage/sqlite/config-repository.js";
|
|
9
|
-
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
10
9
|
import { getExecutionEnvironmentForSession } from "../execution-environments/subject.js";
|
|
11
10
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
11
|
import { ProjectStore } from "../projects/project-store.js";
|
|
12
|
+
import { TaskConversationRepository } from "../tasks/task-conversation-repository.js";
|
|
13
13
|
import { runExec } from "../infra/exec.js";
|
|
14
14
|
import { TaskCollaborationRepository } from "../tasks/task-collaboration-repository.js";
|
|
15
15
|
import { TaskOriginRepository } from "../tasks/task-origin-repository.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { isPersonalConversation } from "../personal-agent/repository.js";
|
|
3
4
|
import { retireSessionMcpRuntimeForConversationId } from "../agent/mcp/bundle-mcp-runtime.js";
|
|
4
5
|
import { abortEmbeddedRun } from "../agent/embedded/runs.js";
|
|
5
|
-
import { isPersonalConversation } from "../personal-agent/repository.js";
|
|
6
6
|
import "../agent/mcp/bundle-mcp-tools.js";
|
|
7
7
|
//#region src/gateway/session-reset-service.ts
|
|
8
8
|
init_logger();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
2
|
-
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
3
2
|
import { getModelCatalogStore, init_model_catalog_store } from "../providers/model-catalog-store.js";
|
|
4
3
|
import { getAvailableModels, init_providers } from "../providers/index.js";
|
|
5
4
|
import { compareCatalogModels } from "../providers/model-catalog-ranking.js";
|
|
5
|
+
import { AgentCatalogService } from "../agent-catalog/service.js";
|
|
6
6
|
import { prepareUpdateGlobalDefaults } from "./global-defaults-admin.js";
|
|
7
7
|
//#region src/gateway/xopc-cloud-capability-setup.ts
|
|
8
8
|
init_repository();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { HomeAdviceBudgetExceededError } from "./generator.js";
|
|
3
4
|
import { homePatternKey } from "./strategy.js";
|
|
5
|
+
import { HomeAdvicePolicy } from "./policy.js";
|
|
4
6
|
import { HomeIntelligenceRepository } from "./repository.js";
|
|
5
7
|
import { HomeOpportunityApplicationService } from "./application-service.js";
|
|
6
|
-
import { HomeAdvicePolicy } from "./policy.js";
|
|
7
|
-
import { HomeAdviceBudgetExceededError } from "./generator.js";
|
|
8
8
|
import { buildHomeOpportunityNotification } from "./notification.js";
|
|
9
9
|
import { createHash } from "node:crypto";
|
|
10
10
|
//#region src/home-intelligence/host.ts
|
|
@@ -5,10 +5,10 @@ import { currentOperationId, init_operation_context } from "../infra/operation-c
|
|
|
5
5
|
import { afterSqliteCommit, init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { ExtensionCapabilityBindingsSchema, extensionCapabilityPermissions } from "../../packages/gateway-contract/src/extension-capabilities.js";
|
|
7
7
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
8
|
-
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
9
8
|
import { init_paths, resolveExtensionsDir } from "../config/paths.js";
|
|
10
|
-
import { LocalAppStore } from "./store.js";
|
|
11
9
|
import { slugifyProjectName } from "../projects/project-store.js";
|
|
10
|
+
import { LocalAppStore } from "./store.js";
|
|
11
|
+
import { CapabilityError } from "../capabilities/runtime/errors.js";
|
|
12
12
|
import { DomainOutboxDispatcher } from "../infra/domain-outbox-dispatcher.js";
|
|
13
13
|
import { validateLocalAppCapabilityContracts } from "./capabilities/contracts.js";
|
|
14
14
|
import { buildLocalAppFixGuidance } from "./fix-guidance.js";
|
|
@@ -42,6 +42,37 @@ function chatPlan(payload) {
|
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
+
function personalReplyPlan(payload) {
|
|
46
|
+
if (!payload || typeof payload !== "object") return null;
|
|
47
|
+
const event = payload;
|
|
48
|
+
if (typeof event.conversationId !== "string" || !event.conversationId || typeof event.deliveryId !== "string" || !event.deliveryId.startsWith("reply:")) return null;
|
|
49
|
+
const preview = markdownNotificationPreview(typeof event.text === "string" ? event.text : "", 180);
|
|
50
|
+
const displayName = typeof event.displayName === "string" ? event.displayName.trim().slice(0, 120) : "";
|
|
51
|
+
return {
|
|
52
|
+
dedupeKey: `personal.reply:${event.deliveryId}`,
|
|
53
|
+
notification: {
|
|
54
|
+
type: event.failed === true ? "chat.failed" : "chat.completed",
|
|
55
|
+
target: {
|
|
56
|
+
kind: "chat",
|
|
57
|
+
conversationId: event.conversationId,
|
|
58
|
+
personal: true
|
|
59
|
+
},
|
|
60
|
+
priority: event.failed === true ? "high" : "normal",
|
|
61
|
+
title: {
|
|
62
|
+
en: displayName || "Personal AI",
|
|
63
|
+
zh: displayName || "Personal AI"
|
|
64
|
+
},
|
|
65
|
+
body: preview ? {
|
|
66
|
+
en: preview,
|
|
67
|
+
zh: preview
|
|
68
|
+
} : {
|
|
69
|
+
en: "Your task result is ready.",
|
|
70
|
+
zh: "你的任务有了新结果。"
|
|
71
|
+
},
|
|
72
|
+
payload: { deliveryId: event.deliveryId }
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
}
|
|
45
76
|
function taskPlan(payload) {
|
|
46
77
|
if (!payload || typeof payload !== "object") return null;
|
|
47
78
|
const data = payload;
|
|
@@ -180,6 +211,7 @@ function homeOpportunityPlan(payload) {
|
|
|
180
211
|
};
|
|
181
212
|
}
|
|
182
213
|
function notificationPlanFromGatewayEvent(type, payload) {
|
|
214
|
+
if (type === "personal.reply.delivered") return personalReplyPlan(payload);
|
|
183
215
|
if (type === "agent.run.ended") return chatPlan(payload);
|
|
184
216
|
if (type === "task.attention_required.v2" || type === "task.phase_changed.v2") return taskPlan(payload);
|
|
185
217
|
if (type === "automation.run.completed") return automationPlan(payload);
|
|
@@ -39,6 +39,7 @@ export declare class NotificationService {
|
|
|
39
39
|
} | {
|
|
40
40
|
kind: "chat";
|
|
41
41
|
conversationId: string;
|
|
42
|
+
personal?: boolean;
|
|
42
43
|
} | {
|
|
43
44
|
kind: "task";
|
|
44
45
|
taskId: string;
|
|
@@ -79,6 +80,7 @@ export declare class NotificationService {
|
|
|
79
80
|
} | {
|
|
80
81
|
kind: "chat";
|
|
81
82
|
conversationId: string;
|
|
83
|
+
personal?: boolean;
|
|
82
84
|
} | {
|
|
83
85
|
kind: "task";
|
|
84
86
|
taskId: string;
|
|
@@ -2,11 +2,12 @@ import { getConnectorInstallation, init_connector_repository, listConnectorConne
|
|
|
2
2
|
import { resolveEffectiveAgentConfig } from "../agent-config/resolver.js";
|
|
3
3
|
import { init_agent_config } from "../agent-config/index.js";
|
|
4
4
|
import { AgentCatalogRepository, init_repository } from "../agent-catalog/repository.js";
|
|
5
|
+
import { isPersonalConversation } from "./repository.js";
|
|
6
|
+
import { getAvailablePersonalAgentTools, personalAgentModelAvailability } from "./specialist-capabilities.js";
|
|
5
7
|
import { canAccessConnectorAccount, currentAccountConnections } from "../connectors/account-access.js";
|
|
6
8
|
import { connectorPrincipalForSession } from "../connectors/principal.js";
|
|
7
9
|
import { connectionCandidates, resolveConnectionCandidate } from "../connectors/connection-candidates.js";
|
|
8
|
-
import
|
|
9
|
-
import { getAvailablePersonalAgentTools, personalAgentModelAvailability } from "../agent/tools/personal-task-tool.js";
|
|
10
|
+
import "../agent/tools/personal-task-tool.js";
|
|
10
11
|
//#region src/personal-agent/capability-service.ts
|
|
11
12
|
init_repository();
|
|
12
13
|
init_agent_config();
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export
|
|
1
|
+
export { PERSONAL_PERSONA_GUIDANCE } from './persona.js';
|
|
2
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 [
|
|
3
|
+
export declare const PERSONAL_COMMUNICATION_RULES: readonly [string, "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.", "Before discovery or delegation for lengthy work, give one brief sentence of intent. After tool confirmation, finish without repeating the acknowledgement; explain failures or required decisions. Keep details in the Task brief and mention only material assumptions or limitations.", "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
4
|
export declare const PERSONAL_WORKER_RESULT_GUIDANCE: string;
|
|
5
|
+
export declare const PERSONAL_PREVIOUS_DELEGATION_COMMUNICATION = "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.";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { PERSONAL_PERSONA_GUIDANCE } from "./persona.js";
|
|
1
2
|
//#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
3
|
const PERSONAL_RELIABILITY_RULES = [
|
|
4
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
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.",
|
|
@@ -9,7 +9,7 @@ const PERSONAL_RELIABILITY_RULES = [
|
|
|
9
9
|
const PERSONAL_COMMUNICATION_RULES = [
|
|
10
10
|
PERSONAL_PERSONA_GUIDANCE,
|
|
11
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
|
-
"
|
|
12
|
+
"Before discovery or delegation for lengthy work, give one brief sentence of intent. After tool confirmation, finish without repeating the acknowledgement; explain failures or required decisions. Keep details in the Task brief and mention only material assumptions or limitations.",
|
|
13
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
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
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.",
|
|
@@ -20,5 +20,6 @@ const PERSONAL_WORKER_RESULT_GUIDANCE = [
|
|
|
20
20
|
"Provide a complete, evidence-grounded result for the originating conversation. The personal assistant may synthesize its final reply from your report. Match the user’s language and requested depth; preserve requested content, relevant sources, verified data cutoffs, uncertainty, and partial failures. Distinguish reported findings from verified facts. Do not invent a friendly opening or assume a new user request.",
|
|
21
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
22
|
].join("\n");
|
|
23
|
+
const PERSONAL_PREVIOUS_DELEGATION_COMMUNICATION = "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.";
|
|
23
24
|
//#endregion
|
|
24
|
-
export { PERSONAL_COMMUNICATION_RULES, PERSONAL_PERSONA_GUIDANCE, PERSONAL_RELIABILITY_RULES, PERSONAL_WORKER_RESULT_GUIDANCE };
|
|
25
|
+
export { PERSONAL_COMMUNICATION_RULES, PERSONAL_PERSONA_GUIDANCE, PERSONAL_PREVIOUS_DELEGATION_COMMUNICATION, PERSONAL_RELIABILITY_RULES, PERSONAL_WORKER_RESULT_GUIDANCE };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
//#region src/personal-agent/conversation-state.ts
|
|
3
|
+
init_transaction();
|
|
4
|
+
/** A conversation revision also changes when foreground work finishes, invalidating old-context drafts. */
|
|
5
|
+
function personalConversationState(conversationId) {
|
|
6
|
+
const db = getSqliteDatabase();
|
|
7
|
+
const runtime = db.prepare("SELECT revision, active_run_id FROM session_input_runtime WHERE conversation_id = ?").get(conversationId);
|
|
8
|
+
const pending = db.prepare(`SELECT 1 FROM session_inputs WHERE conversation_id = ?
|
|
9
|
+
AND status IN ('queued','running','injecting') LIMIT 1`).get(conversationId);
|
|
10
|
+
const preparation = db.prepare("SELECT state FROM session_preparations WHERE conversation_id = ?").get(conversationId);
|
|
11
|
+
return {
|
|
12
|
+
revision: runtime?.revision ?? 0,
|
|
13
|
+
idle: !runtime?.active_run_id && !pending && (!preparation || preparation.state === "ready")
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { personalConversationState };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { ProductNotification } from '@xopcai/gateway-contract';
|
|
2
|
+
export declare function allowsPersonalTaskNotification(notification: Pick<ProductNotification, 'target' | 'type'>): boolean;
|
|
3
|
+
export declare function personalReplyNotification(conversationId: string, deliveryId: string): Record<string, unknown> | null;
|
|
4
|
+
export declare function personalRunDelegated(conversationId: string, runId: string): boolean;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { getSqliteDatabase, init_transaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { getPersonalAgentByConversation } from "./repository.js";
|
|
3
|
+
//#region src/personal-agent/notifications.ts
|
|
4
|
+
init_transaction();
|
|
5
|
+
function personalTask(taskId) {
|
|
6
|
+
return Boolean(getSqliteDatabase().prepare(`SELECT 1 FROM task_origin_links o
|
|
7
|
+
JOIN sessions s ON s.conversation_id = o.conversation_id
|
|
8
|
+
WHERE o.task_id = ? AND json_extract(s.custom_data_json, '$.personalAgent') = 1`).get(taskId));
|
|
9
|
+
}
|
|
10
|
+
function allowsPersonalTaskNotification(notification) {
|
|
11
|
+
if (notification.target.kind === "task") return notification.type === "task.needs_input" || !personalTask(notification.target.taskId);
|
|
12
|
+
if (notification.target.kind === "chat") return !getSqliteDatabase().prepare(`SELECT o.task_id FROM task_sessions w
|
|
13
|
+
JOIN task_origin_links o ON o.task_id = w.task_id
|
|
14
|
+
JOIN sessions s ON s.conversation_id = o.conversation_id
|
|
15
|
+
WHERE w.conversation_id = ? AND json_extract(s.custom_data_json, '$.personalAgent') = 1 LIMIT 1`).get(notification.target.conversationId);
|
|
16
|
+
return true;
|
|
17
|
+
}
|
|
18
|
+
function personalReplyNotification(conversationId, deliveryId) {
|
|
19
|
+
if (!deliveryId.startsWith("reply:")) return null;
|
|
20
|
+
const personal = getPersonalAgentByConversation(conversationId);
|
|
21
|
+
if (!personal) return null;
|
|
22
|
+
const row = getSqliteDatabase().prepare(`SELECT reply_text, reply_status, payload_json FROM task_result_deliveries
|
|
23
|
+
WHERE delivery_id = ? AND conversation_id = ?`).get(deliveryId.slice(6), conversationId);
|
|
24
|
+
if (!row || row.reply_status !== "delivered") return null;
|
|
25
|
+
const delivery = JSON.parse(row.payload_json);
|
|
26
|
+
return {
|
|
27
|
+
conversationId,
|
|
28
|
+
deliveryId,
|
|
29
|
+
text: row.reply_text,
|
|
30
|
+
displayName: personal.displayName,
|
|
31
|
+
failed: delivery.outcome.status === "failed" || delivery.outcome.status === "partial"
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function personalRunDelegated(conversationId, runId) {
|
|
35
|
+
return Boolean(getSqliteDatabase().prepare(`SELECT 1 FROM task_origin_links o
|
|
36
|
+
JOIN session_inputs i ON i.id = o.request_input_id
|
|
37
|
+
WHERE o.conversation_id = ? AND i.run_id = ? LIMIT 1`).get(conversationId, runId));
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
40
|
+
export { allowsPersonalTaskNotification, personalReplyNotification, personalRunDelegated };
|