@xopcai/xopc 0.0.353 → 0.0.355
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/telegram/xopc.extension.json +1 -1
- 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-BVIuZcCP.js → agent-avatar-dicebear-DiEBNuSv.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DpBmB3QX.js +1 -0
- package/dist/gateway/static/root/assets/agent-plugin-dialog-DlojWUY_.js +1 -0
- package/dist/gateway/static/root/assets/agents-CeSCdUHP.js +66 -0
- package/dist/gateway/static/root/assets/app-chrome-BeB4KgOf.js +1 -0
- package/dist/gateway/static/root/assets/app-management-settings-panel-MkSa6isi.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-B7hCkaT_.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-D_CduJuC.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BZXXJvpX.js → archive-plugin-QfOaQPL_.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-C7VKkDb5.js → automations-page-uEnQawd7.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-pdiSK3Qk.js +7 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DoT3g5SP.js → binary-plugins-BF2lVwR9.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-sqqrCafh.js → block-editor-r4mKGacz.js} +39 -39
- package/dist/gateway/static/root/assets/bot-DjLkhyZL.js +1 -0
- package/dist/gateway/static/root/assets/{browser-automation-inputs-CZOKsAaa.js → browser-automation-inputs-FW3bYZ-z.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-TEeTmkGP.js → browser-automations-page-Blrxyy_h.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DGuwrO7j.js +3 -0
- package/dist/gateway/static/root/assets/{capabilities-BOrLei_L.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-DUIA2K--.js +2 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CwPNQsJS.js +8 -0
- package/dist/gateway/static/root/assets/capability-header-actions-CyvI2F5x.js +1 -0
- package/dist/gateway/static/root/assets/channels-DBxDJV8I.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-Q99iKyiO.js → chat-terminal-dock-YdxhecE7.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-BuCrA8yD.js +1 -0
- package/dist/gateway/static/root/assets/connector-service-page-BiB2GYkp.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-nQAgZk-5.js +2 -0
- package/dist/gateway/static/root/assets/copy-text-row-BHDs3cBa.js +1 -0
- package/dist/gateway/static/root/assets/date-picker-BJtADyRQ.js +1 -0
- package/dist/gateway/static/root/assets/{dependency-picker-BjH8XrKb.js → dependency-picker-D-Ko0G40.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-DyGxNAVW.js → desktop-pet-CVPWcWwC.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-BcN_I-7y.js +1 -0
- package/dist/gateway/static/root/assets/device-pairing-wizard-CoKKoUlt.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-m0CubGEP.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-Dd88ynHj.js +1 -0
- package/dist/gateway/static/root/assets/extension-provider-CUpbXB2k.js +1 -0
- package/dist/gateway/static/root/assets/extension-settings-page-Dq1MXh6D.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-C_bTRQeE.js +1 -0
- package/dist/gateway/static/root/assets/git-branch-Dh9uxTot.js +1 -0
- package/dist/gateway/static/root/assets/home-page-xbqSikkK.js +1 -0
- package/dist/gateway/static/root/assets/imports-page-Cd4tcbLU.js +1 -0
- package/dist/gateway/static/root/assets/index-BuzC93X-.css +1 -0
- package/dist/gateway/static/root/assets/index-CYeGnj-L.js +106 -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-CoYdyBRh.js → keyboard-shortcuts-settings-CmalfzgQ.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-BquHHLj6.js +1 -0
- package/dist/gateway/static/root/assets/{local-apps-page-CeBhXeoX.js → local-apps-page-RPLHMvYs.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-7NMGltSw.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-zwFewbhp.js +1 -0
- package/dist/gateway/static/root/assets/markdown-view-7tzqIp_G.js +201 -0
- package/dist/gateway/static/root/assets/{media-plugins-C9ya5rUH.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/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-CwMg9cvF.js +5 -0
- package/dist/gateway/static/root/assets/notes-api-J0yhflxC.js +1 -0
- package/dist/gateway/static/root/assets/notes-page-CWJwrvo7.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-DqmAq4Ov.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-Bbgx_dgV.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-DUPsiVP9.js → product-open-page-SsG2sljT.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-wp5cFhM7.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-Brfi519S.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BdtF8Cvk.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-C25xEYTK.js → runtime-tools-settings-panel-CT6HKczq.js} +2 -2
- package/dist/gateway/static/root/assets/scenes-page-BmlI42OR.js +2 -0
- package/dist/gateway/static/root/assets/schema-form-DEcsbgne.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/sessions-page-C_G8fZwV.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-CDxdzwDs.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-DqCJHcdG.js → settings-page-P50kLPUz.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-DtnwH0wN.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-7Ak_MsJg.js +1 -0
- package/dist/gateway/static/root/assets/skill-api-CcdHQhxd.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-ChjXDxdX.js +2 -0
- package/dist/gateway/static/root/assets/sparkles-DHlfQFAF.js +1 -0
- package/dist/gateway/static/root/assets/system-settings-panel-DAR0w3Xi.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DEx0kXDV.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-CBy97LfF.js +1 -0
- package/dist/gateway/static/root/assets/usage-page-BdX6VPQC.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-CRxiQnWG.js +2 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-Bw05QB_V.js +1 -0
- package/dist/gateway/static/root/assets/{work-discovery-overlay-BnfD6w0k.js → work-discovery-overlay-DvwmD9Ma.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DSy57rBr.js → workflow-run-setup-panel-BQ3fmhM-.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-Bl8rd4fM.js +6 -0
- package/dist/gateway/static/root/assets/workspace-api-BbBT75Kg.js +2 -0
- package/dist/gateway/static/root/index.html +61 -19
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +19 -2
- package/dist/src/agent/agent-manager.js +4 -4
- package/dist/src/agent/embedded/run-for-session.d.ts +1 -0
- package/dist/src/agent/embedded/run-for-session.js +2 -1
- package/dist/src/agent/embedded/run-turn.js +30 -2
- package/dist/src/agent/embedded/types.d.ts +1 -0
- package/dist/src/agent/prompt/sections/messaging-runtime.js +2 -1
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -0
- package/dist/src/agent/service/process-direct-streaming.js +1 -0
- package/dist/src/agent/service.js +4 -1
- 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/tools/factory.js +21 -14
- package/dist/src/agent/tools/personal-preference-tool.d.ts +10 -0
- package/dist/src/agent/tools/personal-preference-tool.js +44 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +29 -0
- package/dist/src/agent/tools/personal-task-tool.js +184 -0
- package/dist/src/agent/tools/xopc-use-tool.js +3 -2
- package/dist/src/agent-catalog/service.d.ts +1 -1
- package/dist/src/agent-catalog/service.js +2 -1
- package/dist/src/agent-config/index.js +2 -2
- package/dist/src/agent-config/schema.d.ts +153 -1
- package/dist/src/agent-config/schema.js +42 -3
- package/dist/src/chat-commands/builtins/thinking.js +12 -2
- package/dist/src/chat-commands/context.js +7 -1
- package/dist/src/cli/commands/auth.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/commands/providers.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/routes/lazy-bundles.js +8 -0
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/personal-agent.d.ts +3 -0
- package/dist/src/gateway/hono/routes/personal-agent.js +122 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +1 -1
- package/dist/src/gateway/hono/routes/sessions.js +5 -0
- package/dist/src/gateway/hono/routes/side-chats.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +64 -1
- package/dist/src/gateway/hono/routes/voice.js +8 -0
- package/dist/src/gateway/service/agent-runner.js +41 -0
- package/dist/src/gateway/service/run-gateway-agent.js +2 -1
- package/dist/src/gateway/service/session-command-service.js +7 -1
- package/dist/src/gateway/service/sessions-api.js +11 -1
- package/dist/src/gateway/service.js +10 -10
- package/dist/src/gateway/session-reset-service.js +5 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.d.ts +9 -0
- package/dist/src/gateway/xopc-cloud-capability-setup.js +42 -2
- package/dist/src/home-intelligence/host.js +2 -2
- 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 +49 -0
- package/dist/src/personal-agent/service.js +234 -0
- package/dist/src/session/resolve-session.js +4 -2
- 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 +3 -0
- package/dist/src/tasks/task-application-service.js +6 -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-main-update-decision-service.js +6 -0
- package/dist/src/tasks/task-main-update-delivery.js +5 -2
- package/dist/src/tasks/task-origin-repository.d.ts +4 -1
- package/dist/src/tasks/task-origin-repository.js +3 -3
- package/dist/src/tasks/task-run-coordinator.d.ts +1 -0
- package/dist/src/tasks/task-run-coordinator.js +13 -7
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +6 -4
- package/package.json +4 -4
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-CcTnphqy.js +0 -1
- package/dist/gateway/static/root/assets/agent-plugin-dialog-CdCzMPhC.js +0 -1
- package/dist/gateway/static/root/assets/agents-BiNKpndr.js +0 -66
- package/dist/gateway/static/root/assets/app-management-settings-panel-BvGDN5J6.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-BhQYkuQj.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BQZJuM-C.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-y4qcvlg8.js +0 -7
- package/dist/gateway/static/root/assets/browser-settings-page--N4P7V0l.js +0 -3
- package/dist/gateway/static/root/assets/capabilities-page-F7OAv-iz.js +0 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CaiIo1S1.js +0 -8
- package/dist/gateway/static/root/assets/capability-header-actions-CR_O9_Vr.js +0 -1
- package/dist/gateway/static/root/assets/channels-Bb-8c4wl.js +0 -1
- package/dist/gateway/static/root/assets/computer-settings-page-QuXZBfky.js +0 -1
- package/dist/gateway/static/root/assets/connector-service-page-BIqzVqCO.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-CZ24DSBJ.js +0 -2
- package/dist/gateway/static/root/assets/date-picker-Ck-FmYEL.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-C1rKgB-S.js +0 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-UrPcOU6Q.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-BYxUgMZb.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-CGL0jpQA.js +0 -1
- package/dist/gateway/static/root/assets/extension-page-DPWf-tYg.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-DZWBY39d.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-D5w5aYXK.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DPQwxBGy.js +0 -1
- package/dist/gateway/static/root/assets/imports-page-CnRWDtGz.js +0 -1
- package/dist/gateway/static/root/assets/index-B-w6Rk9Z.css +0 -1
- package/dist/gateway/static/root/assets/index-DU5Eb1V8.js +0 -106
- package/dist/gateway/static/root/assets/local-app-workbench-page-hjFeYlIq.js +0 -1
- package/dist/gateway/static/root/assets/logs-page-CzpZDjkA.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-Beu_R_Rc.js +0 -1
- package/dist/gateway/static/root/assets/markdown-view-BlzX7Ze5.js +0 -201
- package/dist/gateway/static/root/assets/note-detail-panel-D8bpTGwP.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-OmgXowUG.js +0 -8
- package/dist/gateway/static/root/assets/page-context-capture-button-BjjjuLkz.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-_DiuzxyD.js +0 -1
- package/dist/gateway/static/root/assets/popover-select-0p9PIHRy.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-BKvUadws.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-CWlCg2x5.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-NbVNo0tP.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CD8HrqGC.js +0 -1
- package/dist/gateway/static/root/assets/scenes-page-DbWaemwR.js +0 -2
- package/dist/gateway/static/root/assets/schema-form-_3LQ4hyB.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-B7ZUdXlb.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CpKzZMft.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-DS80hVSY.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-De-kC3yJ.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-T-0g_rwr.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-Dz33T3du.js +0 -1
- package/dist/gateway/static/root/assets/skill-api-Cx6GGpSY.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DyJ-Duem.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-B2iyN-kP.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-By3SZQR_.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-4yHUTs4_.js +0 -1
- package/dist/gateway/static/root/assets/tasks-BH8_WMUF.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-BoH0LBkw.js +0 -1
- package/dist/gateway/static/root/assets/usage-page-dKU5X9zT.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-YKCwQvqT.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-Uht32LPP.js +0 -2
- package/dist/gateway/static/root/assets/voice-api-key-field-DiqHIA8l.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-Cq3vRUbc.js +0 -6
- /package/dist/gateway/static/root/assets/{dist-CI_fqRk-2.js → dist-CI_fqRk-.js} +0 -0
|
@@ -8,7 +8,7 @@ function verifiedTaskCriteria(receipt) {
|
|
|
8
8
|
const evidence = new Set(receipt?.evidence.filter((item) => item.strength === "verified").map((item) => item.title));
|
|
9
9
|
return new Set(receipt?.verification.checks.filter((check) => check.status === "passed" && check.evidenceTitles.some((title) => evidence.has(title))).map((check) => check.criterion));
|
|
10
10
|
}
|
|
11
|
-
var TaskPrioritySchema, TaskChangedFieldSchema, TaskAcceptancePolicySchema, ActorRefSchema, TaskContractSchema, TaskSchema, TaskContextRoleSchema, TaskContextEdgeSchema, TaskAuthorityGrantSchema, TaskDependencySummarySchema, TaskEvidenceSchema, TaskJudgmentSchema, TaskRunReceiptSchema, TaskExecutorSelectionSchema, TaskContractInputSchema, TaskContextInputSchema, TaskCreateRequestSchema, TaskPatchRequestSchema, TaskWaitInputSchema, TaskCommandSchema, TaskCommandRequestSchema, TaskDependencyUpdateRequestSchema, TaskBoardPositionRequestSchema, TaskListResponseSchema, TaskConversationStateSchema, TaskSessionLinkSchema, TaskHandoffRequestSchema, TaskDetailResponseSchema;
|
|
11
|
+
var TaskPrioritySchema, TaskChangedFieldSchema, TaskAcceptancePolicySchema, ActorRefSchema, TaskContractSchema, TaskSchema, TaskContextRoleSchema, TaskContextEdgeSchema, TaskAuthorityGrantSchema, TaskDependencySummarySchema, TaskEvidenceSchema, TaskJudgmentSchema, TaskRunReceiptSchema, TaskCriterionReviewSchema, TaskCriterionReviewInputSchema, TaskExecutorSelectionSchema, TaskContractInputSchema, TaskContextInputSchema, TaskCreateRequestSchema, TaskPatchRequestSchema, TaskWaitInputSchema, TaskCommandSchema, TaskCommandRequestSchema, TaskDependencyUpdateRequestSchema, TaskBoardPositionRequestSchema, TaskListResponseSchema, TaskConversationStateSchema, TaskSessionLinkSchema, TaskHandoffRequestSchema, TaskDetailResponseSchema;
|
|
12
12
|
var init_tasks = __esmMin((() => {
|
|
13
13
|
init_task_lifecycle();
|
|
14
14
|
init_task_runs();
|
|
@@ -36,6 +36,7 @@ var init_tasks = __esmMin((() => {
|
|
|
36
36
|
"context",
|
|
37
37
|
"runs",
|
|
38
38
|
"receipts",
|
|
39
|
+
"acceptance",
|
|
39
40
|
"feedback",
|
|
40
41
|
"attention",
|
|
41
42
|
"conversation"
|
|
@@ -236,6 +237,21 @@ var init_tasks = __esmMin((() => {
|
|
|
236
237
|
contextTraceId: z.string().optional(),
|
|
237
238
|
finalizedAt: z.number().int().nonnegative()
|
|
238
239
|
});
|
|
240
|
+
TaskCriterionReviewSchema = z.object({
|
|
241
|
+
contractVersion: z.number().int().positive(),
|
|
242
|
+
criterionIndex: z.number().int().nonnegative(),
|
|
243
|
+
criterionText: z.string(),
|
|
244
|
+
status: z.enum(["passed", "failed"]),
|
|
245
|
+
note: z.string().optional(),
|
|
246
|
+
reviewedBy: ActorRefSchema,
|
|
247
|
+
reviewedAt: z.number().int().nonnegative()
|
|
248
|
+
});
|
|
249
|
+
TaskCriterionReviewInputSchema = z.object({
|
|
250
|
+
expectedVersion: z.number().int().positive(),
|
|
251
|
+
contractVersion: z.number().int().positive(),
|
|
252
|
+
status: z.enum(["passed", "failed"]),
|
|
253
|
+
note: z.string().trim().max(2e3).optional()
|
|
254
|
+
}).strict();
|
|
239
255
|
TaskExecutorSelectionSchema = z.discriminatedUnion("kind", [
|
|
240
256
|
z.object({
|
|
241
257
|
kind: z.literal("agent"),
|
|
@@ -448,6 +464,7 @@ var init_tasks = __esmMin((() => {
|
|
|
448
464
|
waits: z.array(TaskWaitSchema),
|
|
449
465
|
runs: z.array(TaskRunSchema),
|
|
450
466
|
receipts: z.array(TaskRunReceiptSchema),
|
|
467
|
+
criterionReviews: z.array(TaskCriterionReviewSchema),
|
|
451
468
|
context: z.array(TaskContextEdgeSchema),
|
|
452
469
|
conversation: TaskConversationStateSchema,
|
|
453
470
|
sessions: z.array(TaskSessionLinkSchema),
|
|
@@ -463,4 +480,4 @@ var init_tasks = __esmMin((() => {
|
|
|
463
480
|
}));
|
|
464
481
|
//#endregion
|
|
465
482
|
init_tasks();
|
|
466
|
-
export { ActorRefSchema, TaskAcceptancePolicySchema, TaskAuthorityGrantSchema, TaskBoardPositionRequestSchema, TaskChangedFieldSchema, TaskCommandRequestSchema, TaskCommandSchema, TaskContextEdgeSchema, TaskContextInputSchema, TaskContextRoleSchema, TaskContractInputSchema, TaskContractSchema, TaskConversationStateSchema, TaskCreateRequestSchema, TaskDependencySummarySchema, TaskDependencyUpdateRequestSchema, TaskDetailResponseSchema, TaskEvidenceSchema, TaskExecutorSelectionSchema, TaskHandoffRequestSchema, TaskJudgmentSchema, TaskListResponseSchema, TaskPatchRequestSchema, TaskPrioritySchema, TaskRunReceiptSchema, TaskSchema, TaskSessionLinkSchema, init_tasks, verifiedTaskCriteria };
|
|
483
|
+
export { ActorRefSchema, TaskAcceptancePolicySchema, TaskAuthorityGrantSchema, TaskBoardPositionRequestSchema, TaskChangedFieldSchema, TaskCommandRequestSchema, TaskCommandSchema, TaskContextEdgeSchema, TaskContextInputSchema, TaskContextRoleSchema, TaskContractInputSchema, TaskContractSchema, TaskConversationStateSchema, TaskCreateRequestSchema, TaskCriterionReviewInputSchema, TaskCriterionReviewSchema, TaskDependencySummarySchema, TaskDependencyUpdateRequestSchema, TaskDetailResponseSchema, TaskEvidenceSchema, TaskExecutorSelectionSchema, TaskHandoffRequestSchema, TaskJudgmentSchema, TaskListResponseSchema, TaskPatchRequestSchema, TaskPrioritySchema, TaskRunReceiptSchema, TaskSchema, TaskSessionLinkSchema, init_tasks, verifiedTaskCriteria };
|
|
@@ -686,7 +686,7 @@ var AgentManager = class {
|
|
|
686
686
|
conversationId: instance.conversationId,
|
|
687
687
|
modelRef: instance.effectiveProfile.primaryModelRef?.trim() || this.defaultModel,
|
|
688
688
|
agentId: instance.effectiveProfile.agentId,
|
|
689
|
-
thinkingLevel: this.config.thinkingLevel ?? "medium",
|
|
689
|
+
thinkingLevel: instance.effectiveProfile.config.runtime.thinkingLevel ?? this.config.thinkingLevel ?? "medium",
|
|
690
690
|
activeProjectContext: instance.activeProjectContext
|
|
691
691
|
});
|
|
692
692
|
replaceAgentSystemPrompt(instance.agent, newPrompt);
|
|
@@ -761,7 +761,7 @@ var AgentManager = class {
|
|
|
761
761
|
conversationId: instance.conversationId,
|
|
762
762
|
modelRef: instance.effectiveProfile.primaryModelRef?.trim() || this.defaultModel,
|
|
763
763
|
agentId: instance.effectiveProfile.agentId,
|
|
764
|
-
thinkingLevel: this.config.thinkingLevel ?? "medium",
|
|
764
|
+
thinkingLevel: instance.effectiveProfile.config.runtime.thinkingLevel ?? this.config.thinkingLevel ?? "medium",
|
|
765
765
|
activeProjectContext: instance.activeProjectContext
|
|
766
766
|
});
|
|
767
767
|
replaceAgentSystemPrompt(instance.agent, newPrompt);
|
|
@@ -887,7 +887,7 @@ var AgentManager = class {
|
|
|
887
887
|
const rt = this.workspaceRuntimes.getOrCreate(resolvedWorkspacePath, instance.effectiveProfile.agentId);
|
|
888
888
|
const contextFiles = this.resolveContextFilesForSession(conversationId, instance.effectiveProfile);
|
|
889
889
|
const modelRef = instance.effectiveProfile.primaryModelRef?.trim() || this.defaultModel;
|
|
890
|
-
const thinkingLevel = this.config.thinkingLevel ?? "medium";
|
|
890
|
+
const thinkingLevel = instance.effectiveProfile.config.runtime.thinkingLevel ?? this.config.thinkingLevel ?? "medium";
|
|
891
891
|
const activeProjectContext = this.buildExecutionScopeContext(conversationId);
|
|
892
892
|
replaceAgentSystemPrompt(instance.agent, rt.systemPromptBuilder.build(contextFiles, {
|
|
893
893
|
externalMemoryInstructions: this.buildExternalMemoryInstructions(conversationId, rt),
|
|
@@ -1006,7 +1006,7 @@ var AgentManager = class {
|
|
|
1006
1006
|
getSkillManager: () => rt.skillManager
|
|
1007
1007
|
});
|
|
1008
1008
|
const registeredToolNames = tools.map((t) => t.name);
|
|
1009
|
-
const thinkingLevel = this.config.thinkingLevel ?? "medium";
|
|
1009
|
+
const thinkingLevel = profile.config.runtime.thinkingLevel ?? this.config.thinkingLevel ?? "medium";
|
|
1010
1010
|
const turnPolicy = this.buildAgentTurnPolicy(conversationId, profile);
|
|
1011
1011
|
const providerStreamFn = createExtensionAwareStreamFn();
|
|
1012
1012
|
agent = new Agent({
|
|
@@ -15,6 +15,7 @@ export type RunEmbeddedForSessionParams = {
|
|
|
15
15
|
modelManager: ModelManager;
|
|
16
16
|
thinkingOverride?: string | null;
|
|
17
17
|
presentation?: 'voice';
|
|
18
|
+
requireVisibleReply?: boolean;
|
|
18
19
|
abortSignal?: AbortSignal;
|
|
19
20
|
/** Absolute parent deadline. The turn's own timeout is capped to the remaining budget. */
|
|
20
21
|
deadlineAtMs?: number;
|
|
@@ -209,7 +209,8 @@ async function runEmbeddedTurnForSession(params) {
|
|
|
209
209
|
abortSignal: supervisor.signal,
|
|
210
210
|
onEvent: params.onEvent,
|
|
211
211
|
onAgentEvent: (event) => agentManager.emitRuntimeEvent(conversationId, event),
|
|
212
|
-
resumeLastUserMessage
|
|
212
|
+
resumeLastUserMessage,
|
|
213
|
+
requireVisibleReply: params.requireVisibleReply
|
|
213
214
|
}), runId);
|
|
214
215
|
if (turnResult.ok) {
|
|
215
216
|
if (isFallbackAttempt) log.info({
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { isXopcDatabaseOpen } from "../../storage/sqlite/connection.js";
|
|
3
4
|
import { getClarification, getClarificationResumeInput, init_clarification_wait_repository, isClarificationSuspended } from "../../storage/sqlite/clarification-wait-repository.js";
|
|
4
5
|
import { getConnectionResumeInput, init_connection_wait_repository, isConnectionSuspended } from "../../storage/sqlite/connection-wait-repository.js";
|
|
6
|
+
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
7
|
+
import { init_session_repository } from "../../storage/sqlite/session-repository.js";
|
|
8
|
+
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
9
|
+
import { resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
|
|
5
10
|
import { continuesAfterTool, trackAiUsageStream } from "../../usage/recorder.js";
|
|
6
11
|
import { runWithEmbeddedExecutionSession } from "./execution-context.js";
|
|
7
12
|
import { isComputerControlActive, isComputerLeaseTool, stopComputerControl } from "../../computer/control-guard.js";
|
|
@@ -26,11 +31,15 @@ import { markTurnToolResult } from "../memory/turn-provenance.js";
|
|
|
26
31
|
import { RepositoryInstructions } from "../coding/repository-instructions.js";
|
|
27
32
|
import { RunVerification } from "../coding/run-verification.js";
|
|
28
33
|
import { withDelegationScope } from "../orchestration/delegation-scope.js";
|
|
34
|
+
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
35
|
+
import "../messaging/no-reply.js";
|
|
29
36
|
import { createAssistantMessageEventStream, getCurrentSystemPrompt, getCurrentTools, isRecoverableLength } from "@earendil-works/pi-ai";
|
|
30
37
|
//#region src/agent/embedded/run-turn.ts
|
|
31
38
|
init_connection_wait_repository();
|
|
32
39
|
init_clarification_wait_repository();
|
|
33
40
|
init_logger();
|
|
41
|
+
init_sqlite();
|
|
42
|
+
init_session_repository();
|
|
34
43
|
const log = createLogger("EmbeddedRun");
|
|
35
44
|
const LOG_PREVIEW_MAX_CHARS = 300;
|
|
36
45
|
function truncateForLog(value, maxChars = LOG_PREVIEW_MAX_CHARS) {
|
|
@@ -234,6 +243,8 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
234
243
|
const { conversationId, runId, userMessage, model, tools, systemPrompt, thinkingLevel, workspaceDir, sessionStore, onEvent } = params;
|
|
235
244
|
const timeoutMs = params.timeoutMs || resolveAgentTurnTimeoutMs();
|
|
236
245
|
const resolvedModel = requireEmbeddedModel(model, params.modelRef);
|
|
246
|
+
const configuredThinking = isXopcDatabaseOpen() && getSessionMetadata(conversationId) ? resolveEffectiveAgentConfigForSession(conversationId).config.runtime.thinkingLevel : void 0;
|
|
247
|
+
if (configuredThinking && !getModelThinking(resolvedModel).options.includes(configuredThinking)) throw new Error(`Agent requires a model that supports thinking ${configuredThinking}`);
|
|
237
248
|
const promptCachePolicy = resolvePromptCachePolicy(params.promptCachePolicy);
|
|
238
249
|
const compactionPolicy = params.compactionPolicy ?? resolveCompactionPolicy();
|
|
239
250
|
const transcriptRuntime = params.transcriptRuntime ?? (sessionStore ? await createSqliteTranscriptRuntime({
|
|
@@ -263,7 +274,7 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
263
274
|
modelRef: params.modelRef,
|
|
264
275
|
tools,
|
|
265
276
|
systemPrompt: [systemPrompt, rootInstructions].filter(Boolean).join("\n\n"),
|
|
266
|
-
thinkingLevel: thinkingLevel ?? "medium",
|
|
277
|
+
thinkingLevel: configuredThinking ?? thinkingLevel ?? "medium",
|
|
267
278
|
transcriptRuntime
|
|
268
279
|
});
|
|
269
280
|
const { session, reused } = runner;
|
|
@@ -486,6 +497,7 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
486
497
|
let policyStopped = false;
|
|
487
498
|
let connectionStopped = false;
|
|
488
499
|
let clarificationStopped = false;
|
|
500
|
+
let sentVisibleMessage = false;
|
|
489
501
|
params.turnPolicy?.reset();
|
|
490
502
|
session.agent.beforeToolCall = async (context, signal) => {
|
|
491
503
|
const resume = getClarificationResumeInput(conversationId, runId);
|
|
@@ -559,7 +571,10 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
559
571
|
};
|
|
560
572
|
unsubscribe = subscribeEmbeddedSessionEvents(session, (event) => {
|
|
561
573
|
if (event.type === "message_end" && event.message.role === "assistant") recordPromptCacheTouch(conversationId, resolvedModel, event.message.usage);
|
|
562
|
-
if (event.type === "tool_execution_end")
|
|
574
|
+
if (event.type === "tool_execution_end") {
|
|
575
|
+
markTurnToolResult(conversationId, runId, event.toolName);
|
|
576
|
+
if (event.toolName === "send_message" && !event.isError) sentVisibleMessage = true;
|
|
577
|
+
}
|
|
563
578
|
onEvent?.({
|
|
564
579
|
...event,
|
|
565
580
|
runId
|
|
@@ -614,6 +629,14 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
614
629
|
useAuthoritativeProjection = true;
|
|
615
630
|
}
|
|
616
631
|
});
|
|
632
|
+
if (params.requireVisibleReply && !sentVisibleMessage && !policyStopped && !runAbortSignal.aborted && !isAssistantTurnFailed(session.agent) && !isAssistantTurnAborted(session.agent) && lastAssistantPlainText(session).trim() === "NO_REPLY") {
|
|
633
|
+
await session.sendCustomMessage({
|
|
634
|
+
customType: "visible_reply_required",
|
|
635
|
+
content: "The direct user message still needs a visible response in this conversation. Answer it now. If it is unclear, ask one short clarifying question. Do not output NO_REPLY.",
|
|
636
|
+
display: false
|
|
637
|
+
}, { triggerTurn: true });
|
|
638
|
+
await session.agent.waitForIdle();
|
|
639
|
+
}
|
|
617
640
|
const pending = await verification.pendingContext();
|
|
618
641
|
if ((params.verifyChanges ?? false) && pending && !policyStopped && !runAbortSignal.aborted && !isAssistantTurnFailed(session.agent) && !isAssistantTurnAborted(session.agent)) {
|
|
619
642
|
await session.sendCustomMessage({
|
|
@@ -651,6 +674,11 @@ async function runXopcEmbeddedTurn(params) {
|
|
|
651
674
|
errorMessage: getAssistantTurnErrorMessage(session.agent) ?? "Assistant turn failed",
|
|
652
675
|
lastAssistantText: lastAssistantPlainText(session)
|
|
653
676
|
};
|
|
677
|
+
if (params.requireVisibleReply && !sentVisibleMessage && lastAssistantPlainText(session).trim() === "NO_REPLY") return {
|
|
678
|
+
ok: false,
|
|
679
|
+
retryable: false,
|
|
680
|
+
errorMessage: "Assistant did not produce a visible reply"
|
|
681
|
+
};
|
|
654
682
|
runner.piSm.appendCustomEntry("xopc.model-selection", {
|
|
655
683
|
runId,
|
|
656
684
|
model: `${session.agent.state.model?.provider ?? resolvedModel.provider}/${session.agent.state.model?.id ?? resolvedModel.id}`,
|
|
@@ -87,6 +87,7 @@ export type RunXopcEmbeddedTurnParams = {
|
|
|
87
87
|
/** Continue from the persisted trailing user row instead of appending it again. */
|
|
88
88
|
resumeLastUserMessage?: boolean;
|
|
89
89
|
verifyChanges?: boolean;
|
|
90
|
+
requireVisibleReply?: boolean;
|
|
90
91
|
};
|
|
91
92
|
export type RunXopcEmbeddedTurnResult = {
|
|
92
93
|
ok: boolean;
|
|
@@ -15,7 +15,8 @@ function buildSilentRepliesSection(params) {
|
|
|
15
15
|
if (params.isMinimal || params.silentReplyPromptMode === "none") return "";
|
|
16
16
|
return [
|
|
17
17
|
"## Silent Replies",
|
|
18
|
-
`
|
|
18
|
+
`Use ${NO_REPLY} only for background or system-generated events that need no user-facing update, or after you have already delivered the reply with send_message.`,
|
|
19
|
+
"Always answer a direct message from a person in the current conversation, even if it is brief, unclear, repeated, or looks like a test. Acknowledge it or ask a short clarifying question.",
|
|
19
20
|
"",
|
|
20
21
|
"Rules:",
|
|
21
22
|
"- It must be your ENTIRE message — nothing else",
|
|
@@ -70,6 +70,7 @@ export interface RunDirectAgentTurnInput {
|
|
|
70
70
|
sourceImages?: ImageContent[];
|
|
71
71
|
sourceContexts?: AgentSourceContext[];
|
|
72
72
|
presentation?: 'voice';
|
|
73
|
+
requireVisibleReply?: boolean;
|
|
73
74
|
onEvent?: (event: EmbeddedStreamEvent) => void;
|
|
74
75
|
}
|
|
75
76
|
export interface RunDirectAgentTurnResult {
|
|
@@ -116,6 +116,7 @@ async function runDirectAgentTurn(deps, input) {
|
|
|
116
116
|
dynamicSystemContext: userContext.dynamicSystemContext,
|
|
117
117
|
llmImages,
|
|
118
118
|
presentation: input.presentation,
|
|
119
|
+
requireVisibleReply: input.requireVisibleReply,
|
|
119
120
|
sessionStore: deps.sessionStore,
|
|
120
121
|
agentManager: deps.agentManager,
|
|
121
122
|
modelManager: deps.modelManager,
|
|
@@ -342,6 +342,7 @@ async function* runProcessDirectStreaming(deps, input) {
|
|
|
342
342
|
abortSignal: signal,
|
|
343
343
|
sourceContexts,
|
|
344
344
|
presentation: input.presentation,
|
|
345
|
+
requireVisibleReply: input.origin.type === "endpoint",
|
|
345
346
|
runId: input.runId,
|
|
346
347
|
onEvent: (embeddedEvent) => {
|
|
347
348
|
const event = { ...embeddedEvent };
|
|
@@ -6,7 +6,7 @@ import { extractTextContent } from "./context/workspace.js";
|
|
|
6
6
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
7
7
|
import { applyConfigOverrides } from "../config/runtime-overrides.js";
|
|
8
8
|
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../routing/agent-session-key.js";
|
|
9
|
-
import { extractProfileAgentId } from "../config/agent-profile.js";
|
|
9
|
+
import { extractProfileAgentId, resolveEffectiveAgentConfigForSession } from "../config/agent-profile.js";
|
|
10
10
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../session/session-workspace.js";
|
|
12
12
|
import { getProjectForSession } from "../projects/workspace.js";
|
|
@@ -22,6 +22,7 @@ import { onSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
|
22
22
|
import { persistInboundAttachments } from "../channels/attachments/inbound-persist.js";
|
|
23
23
|
import { buildTranscriptUserMessage, hydrateUserTurnForLlm } from "./inbound/attachment-pipeline.js";
|
|
24
24
|
import { resolveCompactionPolicy } from "./memory/compaction-policy.js";
|
|
25
|
+
import { getModelThinking } from "../providers/model-thinking.js";
|
|
25
26
|
import { runXopcEmbeddedTurn } from "./embedded/run-turn.js";
|
|
26
27
|
import { resolveResponseLanguageForSession } from "./prompt/response-language.js";
|
|
27
28
|
import { normalizeSkillInstallTarget } from "./skills/install-target.js";
|
|
@@ -629,6 +630,8 @@ var AgentService = class {
|
|
|
629
630
|
}), params.runId);
|
|
630
631
|
}
|
|
631
632
|
async switchModelForSession(conversationId, modelId) {
|
|
633
|
+
const configuredThinking = resolveEffectiveAgentConfigForSession(conversationId).config.runtime.thinkingLevel;
|
|
634
|
+
if (configuredThinking && !getModelThinking(resolveModel(modelId)).options.includes(configuredThinking)) return false;
|
|
632
635
|
if (!await this.modelManager.switchModelForSession(conversationId, modelId)) return false;
|
|
633
636
|
await this.sessionConfigStore.update(conversationId, { modelOverride: modelId });
|
|
634
637
|
if (this.agentManager.setModelForSession(conversationId, modelId)) this.sessionTracker.touchSession(conversationId);
|
|
@@ -3,11 +3,12 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { chooseModelThinking } from "../../../packages/gateway-contract/src/model-selection.js";
|
|
4
4
|
import { init_src } from "../../../packages/gateway-contract/src/index.js";
|
|
5
5
|
import { ResponseLanguageSchema, init_response_language } from "../../i18n/response-language.js";
|
|
6
|
+
import { resolveEffectiveAgentConfigForSession } from "../../config/agent-profile.js";
|
|
6
7
|
import { normalizeWorkingDirectoryInput } from "../../session/session-workspace.js";
|
|
7
8
|
import { getProjectWorkspacePathForSession } from "../../projects/workspace.js";
|
|
9
|
+
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
8
10
|
import { normalizeReasoningLevel, normalizeThinkLevel, normalizeVerboseLevel } from "../transcript/thinking-types.js";
|
|
9
11
|
import "../../session/index.js";
|
|
10
|
-
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
11
12
|
import { mkdir } from "node:fs/promises";
|
|
12
13
|
//#region src/agent/session/session-config-service.ts
|
|
13
14
|
init_src();
|
|
@@ -25,6 +26,16 @@ var SessionConfigService = class {
|
|
|
25
26
|
* invalid field. Model and thinking are validated together and committed in one write.
|
|
26
27
|
*/
|
|
27
28
|
async patch(conversationId, partial) {
|
|
29
|
+
const configuredThinking = resolveEffectiveAgentConfigForSession(conversationId).config.runtime.thinkingLevel;
|
|
30
|
+
if (configuredThinking && partial.thinkingLevel !== void 0 && partial.thinkingLevel !== configuredThinking) return {
|
|
31
|
+
ok: false,
|
|
32
|
+
code: "INVALID_THINKING",
|
|
33
|
+
error: `This agent uses thinking ${configuredThinking}`
|
|
34
|
+
};
|
|
35
|
+
if (configuredThinking && (partial.model !== void 0 || partial.thinkingLevel !== void 0)) partial = {
|
|
36
|
+
...partial,
|
|
37
|
+
thinkingLevel: configuredThinking
|
|
38
|
+
};
|
|
28
39
|
if (partial.model !== void 0 || partial.thinkingLevel !== void 0 || partial.fixedModel) {
|
|
29
40
|
const existing = await this.opts.sessionConfigStore.get(conversationId);
|
|
30
41
|
if (partial.configVersion !== void 0 && partial.configVersion !== (existing?.updatedAt ?? 0)) return {
|
|
@@ -134,6 +145,13 @@ var SessionConfigService = class {
|
|
|
134
145
|
}
|
|
135
146
|
/** Materialize a restored/new chat choice; unavailable identities stay visible for repair. */
|
|
136
147
|
async initializeModelSelection(conversationId, modelRef, thinkingLevel, configVersion) {
|
|
148
|
+
const configuredThinking = resolveEffectiveAgentConfigForSession(conversationId).config.runtime.thinkingLevel;
|
|
149
|
+
if (configuredThinking && thinkingLevel !== void 0 && thinkingLevel !== configuredThinking) return {
|
|
150
|
+
ok: false,
|
|
151
|
+
code: "INVALID_THINKING",
|
|
152
|
+
error: `This agent uses thinking ${configuredThinking}`
|
|
153
|
+
};
|
|
154
|
+
if (configuredThinking) thinkingLevel = configuredThinking;
|
|
137
155
|
const existing = await this.opts.sessionConfigStore.get(conversationId);
|
|
138
156
|
if (configVersion !== void 0 && configVersion !== (existing?.updatedAt ?? 0)) return {
|
|
139
157
|
ok: false,
|
|
@@ -147,6 +165,11 @@ var SessionConfigService = class {
|
|
|
147
165
|
fixedModel: true,
|
|
148
166
|
configVersion
|
|
149
167
|
});
|
|
168
|
+
if (configuredThinking) return {
|
|
169
|
+
ok: false,
|
|
170
|
+
code: "INVALID_MODEL",
|
|
171
|
+
error: `Select an available model that supports thinking ${configuredThinking}`
|
|
172
|
+
};
|
|
150
173
|
if (!modelRef.trim() || !modelRef.includes("/")) return {
|
|
151
174
|
ok: false,
|
|
152
175
|
code: "INVALID_MODEL",
|
|
@@ -192,6 +215,9 @@ var SessionConfigService = class {
|
|
|
192
215
|
*/
|
|
193
216
|
async applyAutomationModelOverride(conversationId, model) {
|
|
194
217
|
const raw = model?.trim();
|
|
218
|
+
const configuredThinking = resolveEffectiveAgentConfigForSession(conversationId).config.runtime.thinkingLevel;
|
|
219
|
+
const selectedModel = raw ? this.opts.modelManager.findByRef(raw) : void 0;
|
|
220
|
+
if (configuredThinking && (!selectedModel || !getModelThinking(selectedModel).options.includes(configuredThinking))) return false;
|
|
195
221
|
if (!raw) {
|
|
196
222
|
await this.clearModelOverride(conversationId);
|
|
197
223
|
return true;
|
|
@@ -3,9 +3,9 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { getExecutionEnvironmentForSession } from "../../execution-environments/subject.js";
|
|
4
4
|
import { effectiveWorkspacePathForSession, normalizeWorkingDirectoryInput, projectWorkspacePath } from "../../session/session-workspace.js";
|
|
5
5
|
import { getProjectForSession } from "../../projects/workspace.js";
|
|
6
|
+
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
6
7
|
import { resolveEffectiveThinkingLevel } from "../../session/thinking-resolve.js";
|
|
7
8
|
import "../../session/index.js";
|
|
8
|
-
import { getModelThinking } from "../../providers/model-thinking.js";
|
|
9
9
|
import { mkdir, stat } from "node:fs/promises";
|
|
10
10
|
//#region src/agent/session/session-hydrator.ts
|
|
11
11
|
/**
|
|
@@ -61,6 +61,8 @@ import { createManagedJobTool } from "./managed-job-tool.js";
|
|
|
61
61
|
import { createImageTool } from "./image-tool.js";
|
|
62
62
|
import { createImageGenerateTool } from "./image-generate-tool.js";
|
|
63
63
|
import "./index.js";
|
|
64
|
+
import { createPersonalTaskTool } from "./personal-task-tool.js";
|
|
65
|
+
import { createPersonalPreferenceTool } from "./personal-preference-tool.js";
|
|
64
66
|
import { resolveUserContextSessionAccess } from "../../user-context/access-policy.js";
|
|
65
67
|
import { createBrowserUseTool } from "./browser/tool/browser-use-tool.js";
|
|
66
68
|
import { ComputerRuntime } from "../../computer/runtime.js";
|
|
@@ -210,6 +212,7 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
210
212
|
const getSkillMgr = options?.getSkillManager;
|
|
211
213
|
const disabled = options?.disabledTools;
|
|
212
214
|
const allowed = options?.toolAllowlist ? new Set(options.toolAllowlist) : void 0;
|
|
215
|
+
const personalToolsConfigured = Boolean(allowed?.has("personal_task") || allowed?.has("personal_preference"));
|
|
213
216
|
const primary = getPrimary?.();
|
|
214
217
|
const modelHasVision = primary?.input?.includes("image") ?? false;
|
|
215
218
|
const cfg = this.deps.getConfig?.();
|
|
@@ -261,6 +264,22 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
261
264
|
const listDir = createListDirTool(workspace);
|
|
262
265
|
const grep = createGrepTool(workspace);
|
|
263
266
|
const find = createFindTool(workspace);
|
|
267
|
+
const productToolDeps = {
|
|
268
|
+
getWorkspace: () => this.deps.workspace,
|
|
269
|
+
getConfig: () => this.deps.getConfig?.(),
|
|
270
|
+
getCurrentAgentId: () => options?.agentId,
|
|
271
|
+
getCurrentConversationId: () => this.deps.getCurrentContext()?.conversationId,
|
|
272
|
+
getAutomationService: this.deps.getAutomationService,
|
|
273
|
+
getSceneAccess: this.deps.getSceneAccess,
|
|
274
|
+
getNotesService: this.deps.getNotesService,
|
|
275
|
+
getProjectService: this.deps.getProjectService,
|
|
276
|
+
getWorkDiscovery: this.deps.getWorkDiscovery,
|
|
277
|
+
getLocalAppService: this.deps.getLocalAppService,
|
|
278
|
+
getChatPreviewService: this.deps.getChatPreviewService,
|
|
279
|
+
dispatchTaskEvents: this.deps.dispatchTaskEvents,
|
|
280
|
+
dispatchTaskRuns: this.deps.dispatchTaskRuns,
|
|
281
|
+
onAgentCatalogMutate: this.deps.onAgentCatalogMutate
|
|
282
|
+
};
|
|
264
283
|
const core = [
|
|
265
284
|
createSessionStatusTool(),
|
|
266
285
|
createMemoryMaintenanceTool({ getConfig: () => this.deps.getConfig?.() }),
|
|
@@ -432,22 +451,10 @@ var AgentToolsFactory = class AgentToolsFactory {
|
|
|
432
451
|
getProjectService: this.deps.getProjectService
|
|
433
452
|
})] : [],
|
|
434
453
|
...browserEnabled && this.deps.getBrowserAutomationService ? [createBrowserAutomationTool({ getBrowserAutomationService: this.deps.getBrowserAutomationService })] : [],
|
|
435
|
-
...this.deps.getAutomationService || this.deps.getSceneAccess || this.deps.getProjectService || this.deps.getNotesService || this.deps.getLocalAppService || this.deps.getChatPreviewService || this.deps.dispatchTaskEvents || this.deps.dispatchTaskRuns ? [createXopcUseTool({
|
|
436
|
-
getWorkspace: () => this.deps.workspace,
|
|
437
|
-
getConfig: () => this.deps.getConfig?.(),
|
|
438
|
-
getCurrentAgentId: () => options.agentId,
|
|
454
|
+
...this.deps.getAutomationService || this.deps.getSceneAccess || this.deps.getProjectService || this.deps.getNotesService || this.deps.getLocalAppService || this.deps.getChatPreviewService || this.deps.dispatchTaskEvents || this.deps.dispatchTaskRuns ? [createXopcUseTool(productToolDeps), ...personalToolsConfigured ? [createPersonalTaskTool(productToolDeps), createPersonalPreferenceTool({
|
|
439
455
|
getCurrentConversationId: () => this.deps.getCurrentContext()?.conversationId,
|
|
440
|
-
getAutomationService: this.deps.getAutomationService,
|
|
441
|
-
getSceneAccess: this.deps.getSceneAccess,
|
|
442
|
-
getNotesService: this.deps.getNotesService,
|
|
443
|
-
getProjectService: this.deps.getProjectService,
|
|
444
|
-
getWorkDiscovery: this.deps.getWorkDiscovery,
|
|
445
|
-
getLocalAppService: this.deps.getLocalAppService,
|
|
446
|
-
getChatPreviewService: this.deps.getChatPreviewService,
|
|
447
|
-
dispatchTaskEvents: this.deps.dispatchTaskEvents,
|
|
448
|
-
dispatchTaskRuns: this.deps.dispatchTaskRuns,
|
|
449
456
|
onAgentCatalogMutate: this.deps.onAgentCatalogMutate
|
|
450
|
-
})] : [],
|
|
457
|
+
})] : []] : [],
|
|
451
458
|
...cfg?.computer.enabled && this.deps.endpointTools ? [createComputerUseTool({
|
|
452
459
|
runtime: this.ensureComputerRuntime(),
|
|
453
460
|
context: () => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
declare const PreferenceSchema: import("@sinclair/typebox").TObject<{
|
|
3
|
+
field: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"addressAs">, import("@sinclair/typebox").TLiteral<"warmth">, import("@sinclair/typebox").TLiteral<"humor">, import("@sinclair/typebox").TLiteral<"supportMode">, import("@sinclair/typebox").TLiteral<"detailLevel">, import("@sinclair/typebox").TLiteral<"proactivity">, import("@sinclair/typebox").TLiteral<"guidance">]>;
|
|
4
|
+
value: import("@sinclair/typebox").TString;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function createPersonalPreferenceTool(deps: {
|
|
7
|
+
getCurrentConversationId: () => string | undefined;
|
|
8
|
+
onAgentCatalogMutate?: () => void;
|
|
9
|
+
}): AgentTool<typeof PreferenceSchema, Record<string, never>>;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { getPersonalAgentByConversation } from "../../personal-agent/repository.js";
|
|
2
|
+
import { PersonalPreferencesSchema, updatePersonalProfileRecord } from "../../personal-agent/service.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
//#region src/agent/tools/personal-preference-tool.ts
|
|
5
|
+
const PreferenceSchema = Type.Object({
|
|
6
|
+
field: Type.Union([
|
|
7
|
+
Type.Literal("addressAs"),
|
|
8
|
+
Type.Literal("warmth"),
|
|
9
|
+
Type.Literal("humor"),
|
|
10
|
+
Type.Literal("supportMode"),
|
|
11
|
+
Type.Literal("detailLevel"),
|
|
12
|
+
Type.Literal("proactivity"),
|
|
13
|
+
Type.Literal("guidance")
|
|
14
|
+
]),
|
|
15
|
+
value: Type.String({ description: "Use the exact enum for warmth, humor, supportMode, detailLevel, or proactivity. addressAs is a name. guidance is free text for the user’s precise, explicitly requested lasting response preference; preserve their meaning. Do not store temporary mood or guesswork." })
|
|
16
|
+
});
|
|
17
|
+
function createPersonalPreferenceTool(deps) {
|
|
18
|
+
return {
|
|
19
|
+
name: "personal_preference",
|
|
20
|
+
label: "Personal Preference",
|
|
21
|
+
description: "Save how the user explicitly wants you to respond in future conversations. Do not save guesses, a temporary mood, or a one-time instruction.",
|
|
22
|
+
parameters: PreferenceSchema,
|
|
23
|
+
async execute(_toolCallId, input) {
|
|
24
|
+
const conversationId = deps.getCurrentConversationId();
|
|
25
|
+
const personal = conversationId ? getPersonalAgentByConversation(conversationId) : null;
|
|
26
|
+
if (!personal || personal.state !== "ready") throw new Error("Personal AI conversation is unavailable");
|
|
27
|
+
const next = PersonalPreferencesSchema.parse({
|
|
28
|
+
...personal.preferences,
|
|
29
|
+
[input.field]: input.value.trim()
|
|
30
|
+
});
|
|
31
|
+
if (!await updatePersonalProfileRecord(personal.ownerId, personal.revision, personal.displayName, next, personal.appearance)) throw new Error("Preference changed concurrently; read the current profile and try again");
|
|
32
|
+
deps.onAgentCatalogMutate?.();
|
|
33
|
+
return {
|
|
34
|
+
content: [{
|
|
35
|
+
type: "text",
|
|
36
|
+
text: `Saved ${input.field} as an explicit preference. It takes effect on the next reply.`
|
|
37
|
+
}],
|
|
38
|
+
details: {}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
//#endregion
|
|
44
|
+
export { createPersonalPreferenceTool };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
import { type XopcUseToolDeps } from './xopc-use-tool.js';
|
|
3
|
+
declare const PersonalTaskSchema: import("@sinclair/typebox").TObject<{
|
|
4
|
+
command: import("@sinclair/typebox").TUnion<[import("@sinclair/typebox").TLiteral<"agents">, import("@sinclair/typebox").TLiteral<"create">, import("@sinclair/typebox").TLiteral<"list">, import("@sinclair/typebox").TLiteral<"get">, import("@sinclair/typebox").TLiteral<"instruct">, import("@sinclair/typebox").TLiteral<"answer">]>;
|
|
5
|
+
title: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
6
|
+
objective: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
7
|
+
description: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
8
|
+
agentId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
9
|
+
taskId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
10
|
+
instruction: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
11
|
+
questionId: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
12
|
+
expectedOutputs: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
13
|
+
acceptanceCriteria: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
14
|
+
constraints: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
15
|
+
requiredTools: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TArray<import("@sinclair/typebox").TString>>;
|
|
16
|
+
idempotencyKey: import("@sinclair/typebox").TOptional<import("@sinclair/typebox").TString>;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function buildPersonalTaskBrief(input: {
|
|
19
|
+
title?: string;
|
|
20
|
+
objective: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
}): {
|
|
23
|
+
title: string;
|
|
24
|
+
objective: string;
|
|
25
|
+
body?: string;
|
|
26
|
+
};
|
|
27
|
+
/** A narrow Task surface for the fast personal conversation. */
|
|
28
|
+
export declare function createPersonalTaskTool(deps: XopcUseToolDeps): AgentTool<typeof PersonalTaskSchema, Record<string, never>>;
|
|
29
|
+
export {};
|