@xopcai/xopc 0.0.385 → 0.0.387
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 +1 -1
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-Cb9eaXxR.js → agent-avatar-dicebear-Bv8M5ygD.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-defaults-settings-panel-DEV-xtgm.js → agent-defaults-settings-panel-UBy01-65.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-plugin-dialog-DXKc3Luj.js → agent-plugin-dialog-Q9guA8kU.js} +1 -1
- package/dist/gateway/static/root/assets/{agents-DcNxwpJQ.js → agents-yfJFubD0.js} +3 -3
- package/dist/gateway/static/root/assets/{app-management-settings-panel-X5i0Tz7_.js → app-management-settings-panel-Cdyad8c1.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-CmHHzquT.js → appearance-settings-DPPvnKH_.js} +1 -1
- package/dist/gateway/static/root/assets/{apps-page-ChFA4Zp0.js → apps-page-Bn_jwaeA.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-BFqsIqOI.js → automations-page-CAB2sLJ5.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-workspace-Blfak-fT.js → automations-workspace-CYRUhhH4.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-CpOLG3Co.js → block-editor-B9DmMEa8.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BSbTJ9j2.js → browser-automations-page-BHAWpZE2.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-settings-page-BUlILJrB.js → browser-settings-page-BG_17NcQ.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-2Do3eKMM.js → capabilities-BX1rCiVm.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-XFwwUNU3.js → capabilities-CW389yo6.js} +1 -1
- package/dist/gateway/static/root/assets/{capabilities-page-CeRdkwRf.js → capabilities-page-BAnBYWlY.js} +2 -2
- package/dist/gateway/static/root/assets/{capabilities-settings-panel-S-cKsGja.js → capabilities-settings-panel-Ca-d6lXk.js} +3 -3
- package/dist/gateway/static/root/assets/{capability-header-actions-6w8pQhnn.js → capability-header-actions-B3TL8TcF.js} +1 -1
- package/dist/gateway/static/root/assets/{channels-DfNTGBmp.js → channels-BadpS-nq.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-DnoQHpDc.js → chat-terminal-dock-C_vntFpP.js} +1 -1
- package/dist/gateway/static/root/assets/{chunk-KS7C4IRE-BMYIfy9x.js → chunk-KS7C4IRE--EKdQGRF.js} +1 -1
- package/dist/gateway/static/root/assets/{computer-settings-page-7yliE7sG.js → computer-settings-page-B-5kxk70.js} +1 -1
- package/dist/gateway/static/root/assets/{connector-service-page-DOLAUFSW.js → connector-service-page-DTnfpLHL.js} +1 -1
- package/dist/gateway/static/root/assets/{connectors-page-DAsn97XG.js → connectors-page-CmJV7gqj.js} +1 -1
- package/dist/gateway/static/root/assets/constants-DeXt1mV-.js +1 -0
- package/dist/gateway/static/root/assets/{date-picker-DNDqr4Fk.js → date-picker-D5zYeC8q.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-B5oG7RgE.js → dependency-picker-D72vT-tb.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-K7kUCX1O.js → desktop-pet-DvoeVPf_.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-KgOAuqSh.js → desktop-pet-settings-Dfb392hs.js} +1 -1
- package/dist/gateway/static/root/assets/{device-pairing-wizard-DvqniZDm.js → device-pairing-wizard-B06Sqn5D.js} +1 -1
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BmOguLDl.js → directory-picker-path-field-CA3H3bc-.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-debug-page-DtHNy4TE.js → extension-debug-page-B0wTBCx4.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DSSuMQxp.js → extension-page-BeHiXhB1.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-provider-nbgU7xBS.js → extension-provider-CJZ5EVpQ.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DSd__mNd.js → extension-settings-page-Q88-LFCJ.js} +1 -1
- package/dist/gateway/static/root/assets/{fallback-models-D7bjbiwZ.js → fallback-models-BXoPCvzq.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-settings-hSXGWumL.js → gateway-settings-IICLMGDI.js} +1 -1
- package/dist/gateway/static/root/assets/{highlighted-body-KQOG7T2V-C7xJwE61.js → highlighted-body-KQOG7T2V-D336so8z.js} +1 -1
- package/dist/gateway/static/root/assets/home-page--MvqsFhQ.js +2 -0
- package/dist/gateway/static/root/assets/{imports-page-BufZPzGE.js → imports-page-muV1SduS.js} +1 -1
- package/dist/gateway/static/root/assets/index-D0qMv3jf.js +260 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-B8pPP5RF.js → keyboard-shortcuts-settings-i1sDWcwl.js} +1 -1
- package/dist/gateway/static/root/assets/{local-app-workbench-page-zEtvE7pJ.js → local-app-workbench-page-DY9tXEO6.js} +1 -1
- package/dist/gateway/static/root/assets/{local-apps-page-Bli7e_eg.js → local-apps-page-BHD73STy.js} +1 -1
- package/dist/gateway/static/root/assets/local-session-drafts-Be4BGM4Z.js +1 -0
- package/dist/gateway/static/root/assets/{logs-page-BimZk3R4.js → logs-page-DsPpe8Ws.js} +1 -1
- package/dist/gateway/static/root/assets/{management-settings-5Y4COyU9.js → management-settings-Buwi2wQE.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-DHfQAvZQ.js → markdown-view-CBjl-XEc.js} +2 -2
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-D2mip-f9.js +1 -0
- package/dist/gateway/static/root/assets/{note-detail-panel-KLDPLVg7.js → note-detail-panel-D8n80Gbr.js} +3 -3
- package/dist/gateway/static/root/assets/{notes-api-nqN2wKYc.js → notes-api-BlGP533W.js} +1 -1
- package/dist/gateway/static/root/assets/{notes-page-DST0oPXD.js → notes-page-Btf-jSS_.js} +5 -5
- package/dist/gateway/static/root/assets/{page-context-capture-button-Bmed83-6.js → page-context-capture-button-97RL8Gc7.js} +1 -1
- package/dist/gateway/static/root/assets/{personal-page-BG4Ystrm.js → personal-page-B04L8Oz5.js} +1 -1
- package/dist/gateway/static/root/assets/product-open-page-9zEDvZa7.js +1 -0
- package/dist/gateway/static/root/assets/{product-preview-content-DjmupQSq.js → product-preview-content-DynBrIXq.js} +1 -1
- package/dist/gateway/static/root/assets/{project-detail-page-CzBmV0P6.js → project-detail-page-BM7MsoVA.js} +1 -1
- package/dist/gateway/static/root/assets/{projects-page-DByqe5Em.js → projects-page-pcyeEJnz.js} +1 -1
- package/dist/gateway/static/root/assets/{remote-access-hub-DTjj-odF.js → remote-access-hub-CphyTu22.js} +1 -1
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-B_ptn3T8.js → runtime-tools-settings-panel-DPafoO0G.js} +1 -1
- package/dist/gateway/static/root/assets/{scenes-page-wkua4l5y.js → scenes-page-j97FrDRW.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-VvOSM84Y.js → schema-form-CuJNwKHO.js} +1 -1
- package/dist/gateway/static/root/assets/{send-session-input-BCAF-Ikt.js → send-session-input-C293-Hbx.js} +1 -1
- package/dist/gateway/static/root/assets/session-manager-COd9RECl.js +16 -0
- package/dist/gateway/static/root/assets/{sessions-page-D06XwYAT.js → sessions-page-D8t_8fMl.js} +1 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CDkitNHA.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-C-6BJdb1.js → settings-page-DS9DMYUe.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-L0JSG0K-.js → setup-status-panel-DRDvm9yZ.js} +1 -1
- package/dist/gateway/static/root/assets/{share-link-dialog-C47Xgzta.js → share-link-dialog-BKGI8Kr0.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-nJ2FWAEP.js → share-preview-page-BF2WaO43.js} +1 -1
- package/dist/gateway/static/root/assets/{shares-settings-BbgAUM3v.js → shares-settings-DQTQZu6V.js} +1 -1
- package/dist/gateway/static/root/assets/{skill-api-BFU1tPyw.js → skill-api-DzVa7G-O.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DZw6el4o.js → skills-page-CfJIjRdS.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-DshSGWNg.js → system-settings-panel-Bzhqed-a.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-BYQFC0-U.js +2 -0
- package/dist/gateway/static/root/assets/task-expandable-content-C9ohICpw.js +1 -0
- package/dist/gateway/static/root/assets/{tasks-DJIeIk9C.js → tasks-PuIUgF9L.js} +1 -1
- package/dist/gateway/static/root/assets/{tunnel-api-DFDXwWnU.js → tunnel-api-DrgpZ81I.js} +1 -1
- package/dist/gateway/static/root/assets/{usage-page-2RJLg54s.js → usage-page-Drk8FWnj.js} +1 -1
- package/dist/gateway/static/root/assets/{use-composer-attachments-BFP3k6oC.js → use-composer-attachments-rgW7h4sD.js} +1 -1
- package/dist/gateway/static/root/assets/{use-file-preview-expanded-B1BiTQNS.js → use-file-preview-expanded-DSKIxfz9.js} +1 -1
- package/dist/gateway/static/root/assets/{user-model-page-y1gjGYPI.js → user-model-page-07t2-nFE.js} +2 -2
- package/dist/gateway/static/root/assets/{work-discovery-overlay-Ch-KfpCF.js → work-discovery-overlay-TQ5bjVot.js} +1 -1
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CTu297Hc.js → workflow-run-setup-panel-C9HP2uGG.js} +1 -1
- package/dist/gateway/static/root/assets/{workflows-page-CRZXG_rm.js → workflows-page-DK01JRI1.js} +3 -3
- package/dist/gateway/static/root/assets/{workspace-api-Xr3wz8T3.js → workspace-api-JWHOFos6.js} +2 -2
- package/dist/gateway/static/root/assets/{xopc-cloud-account-card-hEfjVjnc.js → xopc-cloud-account-card-B-BhQdAf.js} +1 -1
- package/dist/gateway/static/root/index.html +16 -16
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/index.js +4 -0
- package/dist/packages/gateway-contract/src/result-reference.js +25 -0
- package/dist/packages/gateway-contract/src/session-input-command.js +2 -1
- package/dist/packages/gateway-contract/src/task-research-result.js +90 -0
- package/dist/packages/gateway-contract/src/task-result-delivery.js +21 -0
- package/dist/packages/gateway-contract/src/tasks.js +7 -1
- package/dist/packages/gateway-contract/src/turn-outcome.js +4 -0
- package/dist/src/agent/agent-manager.js +3 -3
- package/dist/src/agent/background-review/run-background-review.js +1 -1
- package/dist/src/agent/child-agent-factory.d.ts +4 -1
- package/dist/src/agent/child-agent-factory.js +86 -12
- package/dist/src/agent/context/connection-objective-context.d.ts +1 -0
- package/dist/src/agent/context/connection-objective-context.js +33 -0
- package/dist/src/agent/data-acquisition/service.js +41 -6
- package/dist/src/agent/data-acquisition/types.d.ts +2 -0
- package/dist/src/agent/embedded/agent-profile-context.d.ts +7 -0
- package/dist/src/agent/embedded/agent-profile-context.js +92 -0
- package/dist/src/agent/embedded/run-for-session.js +5 -2
- package/dist/src/agent/embedded/run-turn.js +19 -6
- package/dist/src/agent/embedded/runs.d.ts +9 -2
- package/dist/src/agent/embedded/runs.js +30 -7
- package/dist/src/agent/embedded/session-runner.js +5 -2
- package/dist/src/agent/embedded/types.d.ts +4 -0
- package/dist/src/agent/embedded/xopc-tools-bridge.js +13 -2
- package/dist/src/agent/external-tools/cliProvider.js +1 -1
- package/dist/src/agent/external-tools/composio-provider.js +2 -2
- package/dist/src/agent/external-tools/endpoint-provider.js +2 -2
- package/dist/src/agent/external-tools/gateway-tools.js +8 -4
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/orchestration/agent-run-supervisor.js +2 -1
- package/dist/src/agent/orchestration/agent-turn-policy.js +5 -1
- package/dist/src/agent/orchestration/delegation-budget.d.ts +7 -1
- package/dist/src/agent/orchestration/delegation-budget.js +17 -9
- package/dist/src/agent/orchestration/research-checkpoint.d.ts +56 -0
- package/dist/src/agent/orchestration/research-checkpoint.js +64 -0
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +3 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +15 -2
- package/dist/src/agent/orchestration/run-termination.d.ts +12 -0
- package/dist/src/agent/orchestration/run-termination.js +24 -0
- package/dist/src/agent/orchestration/turn-recovery.d.ts +4 -1
- package/dist/src/agent/orchestration/turn-recovery.js +19 -3
- package/dist/src/agent/prompt/sections/agent-identity.js +12 -7
- package/dist/src/agent/prompt/sections/messaging-runtime.js +1 -1
- package/dist/src/agent/prompt/sections/project-context.js +1 -1
- package/dist/src/agent/prompt/sections/response-language.d.ts +1 -1
- package/dist/src/agent/prompt/sections/response-language.js +6 -2
- package/dist/src/agent/prompt/subagent-context.js +1 -1
- package/dist/src/agent/prompt/system-prompt.js +4 -6
- package/dist/src/agent/service/direct-turn-helpers.d.ts +2 -0
- package/dist/src/agent/service/direct-turn-helpers.js +4 -0
- package/dist/src/agent/service/process-direct-one-shot.js +4 -1
- package/dist/src/agent/service/process-direct-streaming.js +3 -2
- package/dist/src/agent/service.js +2 -2
- 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/source-context/index.js +1 -1
- package/dist/src/agent/source-context/result-context.d.ts +2 -0
- package/dist/src/agent/source-context/result-context.js +32 -0
- package/dist/src/agent/source-context/types.d.ts +2 -2
- package/dist/src/agent/source-context/types.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -1
- package/dist/src/agent/tools/apply-patch.js +1 -1
- package/dist/src/agent/tools/delegate-tool.js +216 -121
- package/dist/src/agent/tools/delegation-policy.js +13 -1
- package/dist/src/agent/tools/exec-command.js +47 -2
- package/dist/src/agent/tools/factory.js +19 -10
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/language-diagnostics.js +1 -1
- package/dist/src/agent/tools/personal-performance.d.ts +2 -0
- package/dist/src/agent/tools/personal-performance.js +82 -0
- package/dist/src/agent/tools/personal-read-tool.js +1 -1
- package/dist/src/agent/tools/personal-request-tool.js +9 -14
- package/dist/src/agent/tools/personal-result-tool.d.ts +2 -0
- package/dist/src/agent/tools/personal-result-tool.js +106 -0
- package/dist/src/agent/tools/personal-task-tool.d.ts +12 -3
- package/dist/src/agent/tools/personal-task-tool.js +115 -10
- package/dist/src/agent/tools/publish-artifacts.js +1 -1
- package/dist/src/agent/tools/research-checkpoint-tool.d.ts +3 -0
- package/dist/src/agent/tools/research-checkpoint-tool.js +28 -0
- package/dist/src/agent/tools/review-workspace.js +21 -2
- package/dist/src/agent/tools/search/cache.d.ts +20 -0
- package/dist/src/agent/tools/search/cache.js +19 -0
- package/dist/src/agent/tools/search/errors.d.ts +19 -0
- package/dist/src/agent/tools/search/errors.js +69 -0
- package/dist/src/agent/tools/search/providers/bing-api.js +2 -1
- package/dist/src/agent/tools/search/providers/bing-html.js +2 -1
- package/dist/src/agent/tools/search/providers/brave.js +2 -1
- package/dist/src/agent/tools/search/providers/duckduckgo-html.js +2 -1
- package/dist/src/agent/tools/search/providers/searxng.js +2 -1
- package/dist/src/agent/tools/search/providers/tavily.js +2 -1
- package/dist/src/agent/tools/search/providers/xopc-cloud.d.ts +1 -0
- package/dist/src/agent/tools/search/providers/xopc-cloud.js +7 -2
- package/dist/src/agent/tools/search/registry.d.ts +21 -5
- package/dist/src/agent/tools/search/registry.js +252 -25
- package/dist/src/agent/tools/search/types.d.ts +25 -0
- package/dist/src/agent/tools/send-media.js +1 -1
- package/dist/src/agent/tools/task-collaboration-tool.d.ts +9 -1
- package/dist/src/agent/tools/task-collaboration-tool.js +121 -2
- package/dist/src/agent/tools/task-evidence.d.ts +3 -0
- package/dist/src/agent/tools/task-evidence.js +71 -0
- package/dist/src/agent/tools/task-result-tool.d.ts +2 -0
- package/dist/src/agent/tools/task-result-tool.js +93 -0
- package/dist/src/agent/tools/tool-media.js +1 -1
- package/dist/src/agent/tools/web.d.ts +16 -2
- package/dist/src/agent/tools/web.js +74 -29
- package/dist/src/agent/tools/xopc-use-tool.js +27 -6
- package/dist/src/agent/workspace-runtime/registry.js +1 -1
- package/dist/src/agent-catalog/capabilities.js +2 -2
- package/dist/src/automations/capabilities/drafts.js +1 -1
- package/dist/src/automations/capabilities/write.d.ts +4 -4
- package/dist/src/automations/domain/validation.d.ts +8 -8
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -2
- package/dist/src/automations/service/action-executor.js +1 -1
- package/dist/src/bootstrap/application-state.js +1 -1
- package/dist/src/browser/automations/schema.d.ts +2 -2
- package/dist/src/browser/automations/service.d.ts +2 -2
- package/dist/src/capabilities/runtime/dispatcher.js +1 -1
- package/dist/src/capabilities/runtime/product.js +1 -1
- package/dist/src/chat-commands/agent-edit.js +1 -1
- package/dist/src/cli/commands/agent.js +1 -1
- 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/models.js +1 -1
- package/dist/src/cli/commands/onboard/model.js +1 -1
- package/dist/src/cli/utils/init-workspace-core.js +1 -1
- package/dist/src/config/agent-profile.js +2 -2
- package/dist/src/config/index.js +2 -2
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +1 -0
- package/dist/src/config/schema.js +5 -2
- package/dist/src/connectors/connection-recovery-service.d.ts +3 -1
- package/dist/src/connectors/connection-recovery-service.js +67 -6
- package/dist/src/discussions/action-tasks.d.ts +2 -2
- package/dist/src/extensions/agent-plugins/validation.js +1 -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/hono/lib/config-payload.js +1 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/connectors.js +1 -1
- package/dist/src/gateway/hono/routes/context-sources.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +2 -2
- package/dist/src/gateway/hono/routes/projects.js +3 -3
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +18 -2
- package/dist/src/gateway/hono/routes/session-input-handler.js +2 -2
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +1 -1
- package/dist/src/gateway/media-access.js +1 -1
- package/dist/src/gateway/service/agent-runner.d.ts +2 -0
- package/dist/src/gateway/service/agent-runner.js +30 -17
- package/dist/src/gateway/service/run-gateway-agent.js +32 -2
- package/dist/src/gateway/service/session-input-coordinator.d.ts +10 -1
- package/dist/src/gateway/service/session-input-coordinator.js +214 -27
- package/dist/src/gateway/service.d.ts +1 -0
- package/dist/src/gateway/service.js +49 -16
- package/dist/src/gateway/session-context-summary.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 +1 -1
- package/dist/src/media/session-references.js +1 -1
- package/dist/src/personal-agent/communication.js +1 -0
- package/dist/src/personal-agent/performance.d.ts +83 -0
- package/dist/src/personal-agent/performance.js +65 -0
- package/dist/src/personal-agent/policy.d.ts +1 -1
- package/dist/src/personal-agent/policy.js +1 -0
- package/dist/src/personal-agent/proactivity/service.js +1 -1
- package/dist/src/personal-agent/prompt-context.js +3 -1
- package/dist/src/personal-agent/prompts.js +10 -4
- package/dist/src/personal-agent/reply-composer.d.ts +1 -0
- package/dist/src/personal-agent/reply-composer.js +149 -20
- package/dist/src/personal-agent/reply-style.d.ts +1 -1
- package/dist/src/personal-agent/reply-style.js +1 -0
- 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 +3 -1
- package/dist/src/personal-agent/request-repository.d.ts +2 -0
- package/dist/src/personal-agent/request-service.d.ts +4 -0
- package/dist/src/personal-agent/request-service.js +91 -20
- package/dist/src/personal-agent/result-extraction.d.ts +42 -0
- package/dist/src/personal-agent/result-extraction.js +209 -0
- package/dist/src/personal-agent/result-file-links.d.ts +3 -0
- package/dist/src/personal-agent/result-file-links.js +21 -0
- package/dist/src/personal-agent/result-read-continuations.d.ts +13 -0
- package/dist/src/personal-agent/result-read-continuations.js +78 -0
- package/dist/src/personal-agent/result-reader.d.ts +43 -0
- package/dist/src/personal-agent/result-reader.js +461 -0
- package/dist/src/personal-agent/service.js +2 -2
- package/dist/src/personal-agent/task-cancel.js +85 -35
- package/dist/src/providers/model-catalog-persistence.js +1 -1
- package/dist/src/routing/resolve-route.js +1 -1
- package/dist/src/routing/resolve-tui-session-key.js +1 -1
- package/dist/src/scenes/taskFollowUp/service.d.ts +15 -5
- package/dist/src/session/client-history.d.ts +1 -1
- package/dist/src/session/client-history.js +1 -1
- package/dist/src/session/session-context-for-llm.js +4 -2
- package/dist/src/session/store.d.ts +3 -1
- package/dist/src/session/store.js +13 -3
- package/dist/src/share/hosted-session-share.js +1 -1
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +5 -2
- package/dist/src/storage/sqlite/connection-wait-repository.js +42 -17
- package/dist/src/storage/sqlite/index.d.ts +1 -0
- package/dist/src/storage/sqlite/index.js +3 -1
- package/dist/src/storage/sqlite/migrations/250_research_checkpoints.sql +15 -0
- package/dist/src/storage/sqlite/migrations/251_personal_result_reads.sql +40 -0
- package/dist/src/storage/sqlite/migrations/252_task_work_revisions.sql +15 -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/research-checkpoint-repository.d.ts +24 -0
- package/dist/src/storage/sqlite/research-checkpoint-repository.js +91 -0
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-creation-repository.js +3 -2
- package/dist/src/storage/sqlite/session-input-repository.d.ts +16 -0
- package/dist/src/storage/sqlite/session-input-repository.js +41 -7
- package/dist/src/tasks/capabilities/management.d.ts +2 -2
- package/dist/src/tasks/capabilities/read.js +2 -2
- package/dist/src/tasks/capabilities/relations.d.ts +7 -7
- package/dist/src/tasks/capabilities/write.d.ts +2 -2
- package/dist/src/tasks/capabilities/write.js +1 -1
- package/dist/src/tasks/index.js +1 -1
- package/dist/src/tasks/task-allocation-service.d.ts +2 -0
- package/dist/src/tasks/task-allocation-service.js +100 -8
- package/dist/src/tasks/task-application-service.d.ts +18 -0
- package/dist/src/tasks/task-application-service.js +133 -2
- package/dist/src/tasks/task-context-assembler.js +13 -5
- package/dist/src/tasks/task-continuation.d.ts +1 -0
- package/dist/src/tasks/task-continuation.js +1 -0
- package/dist/src/tasks/task-contract-definition.d.ts +3 -0
- package/dist/src/tasks/task-contract-planner.d.ts +1 -0
- package/dist/src/tasks/task-contract-planner.js +61 -20
- package/dist/src/tasks/task-conversation-repository.js +1 -1
- package/dist/src/tasks/task-evidence-ranges.d.ts +7 -0
- package/dist/src/tasks/task-evidence-ranges.js +20 -0
- package/dist/src/tasks/task-execution-capabilities.d.ts +26 -0
- package/dist/src/tasks/task-execution-capabilities.js +117 -0
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-handoff.d.ts +56 -0
- package/dist/src/tasks/task-handoff.js +510 -0
- package/dist/src/tasks/task-model-call.d.ts +7 -0
- package/dist/src/tasks/task-model-call.js +35 -0
- package/dist/src/tasks/task-read-model-projector.d.ts +6 -0
- package/dist/src/tasks/task-read-model-projector.js +12 -1
- package/dist/src/tasks/task-research-repair.d.ts +19 -0
- package/dist/src/tasks/task-research-repair.js +79 -0
- package/dist/src/tasks/task-research-result.d.ts +99 -0
- package/dist/src/tasks/task-research-result.js +478 -0
- package/dist/src/tasks/task-result-delivery-repository.js +37 -3
- package/dist/src/tasks/task-result-delivery-service.js +38 -10
- package/dist/src/tasks/task-run-coordinator.js +71 -15
- package/dist/src/tasks/task-run-dispatcher.d.ts +1 -0
- package/dist/src/tasks/task-run-dispatcher.js +3 -1
- package/dist/src/tasks/task-run-repository.d.ts +5 -0
- package/dist/src/tasks/task-run-repository.js +88 -1
- package/dist/src/tui/backends/embedded-backend.js +2 -2
- package/dist/src/voice/realtime/persona-context.js +1 -1
- package/package.json +12 -6
- package/dist/gateway/static/root/assets/constants-Dy8Gw0sF.js +0 -1
- package/dist/gateway/static/root/assets/home-page-DJNmlMfH.js +0 -2
- package/dist/gateway/static/root/assets/index-K8SXDtxr.js +0 -260
- package/dist/gateway/static/root/assets/local-session-drafts-D_tYFy7d.js +0 -1
- package/dist/gateway/static/root/assets/mermaid-MCJ5UELQ-DBRj4-1-.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-CXkYP9xE.js +0 -1
- package/dist/gateway/static/root/assets/session-manager-_yy4bxhT.js +0 -16
- package/dist/gateway/static/root/assets/settings-advanced-gate-DoAHy1wj.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CfZhq4XZ.js +0 -2
- package/dist/gateway/static/root/assets/task-expandable-content-CF6Bj-Qa.js +0 -1
|
@@ -4,10 +4,13 @@ import { afterSqliteCommit, getSqliteDatabase, init_transaction, runSqliteWriteT
|
|
|
4
4
|
import { TurnOutcomeSchema } from "../../packages/gateway-contract/src/turn-outcome.js";
|
|
5
5
|
import { TaskResultDeliverySchema } from "../../packages/gateway-contract/src/task-result-delivery.js";
|
|
6
6
|
import { init_src } from "../../packages/gateway-contract/src/index.js";
|
|
7
|
+
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
7
8
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
8
9
|
import { init_request_repository, personalRequestForTask } from "../personal-agent/request-repository.js";
|
|
9
10
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
10
11
|
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
12
|
+
import { hasPersonalResultFileLinks, sanitizePersonalResultFileLinks } from "../personal-agent/result-file-links.js";
|
|
13
|
+
import { taskInstructionSequence } from "./task-research-result.js";
|
|
11
14
|
import { randomUUID } from "node:crypto";
|
|
12
15
|
//#region src/tasks/task-result-delivery-repository.ts
|
|
13
16
|
init_src();
|
|
@@ -15,6 +18,7 @@ init_transaction();
|
|
|
15
18
|
init_task_run_repository();
|
|
16
19
|
init_logger();
|
|
17
20
|
init_request_repository();
|
|
21
|
+
init_task_repository();
|
|
18
22
|
const log = createLogger("TaskResultDelivery");
|
|
19
23
|
const queuedListeners = /* @__PURE__ */ new Set();
|
|
20
24
|
function onTaskResultQueued(listener) {
|
|
@@ -58,21 +62,46 @@ var TaskResultDeliveryRepository = class {
|
|
|
58
62
|
WHERE task_run_id = ? AND assignment_epoch = ? ORDER BY created_at, rowid LIMIT 100`).all(runId, state.assignmentEpoch).map((row) => TurnOutcomeSchema.parse(JSON.parse(row.outcome_json)));
|
|
59
63
|
const latest = outcomes.at(-1);
|
|
60
64
|
if (!latest) return false;
|
|
65
|
+
const research = [...outcomes].reverse().find((outcome) => outcome.research)?.research;
|
|
66
|
+
const task = new TaskRepository().require(run.taskId);
|
|
67
|
+
const validResearch = research && research.contractVersion === task.latestContractVersion && research.instructionSequence === taskInstructionSequence(task.id) ? research : void 0;
|
|
68
|
+
const selectionRequired = !personalRequestForTask(task.id) && Boolean(task.body?.includes("finalArtifactIds"));
|
|
69
|
+
const researchGap = selectionRequired && !research || Boolean(research && (!validResearch || !validResearch.checks.length || validResearch.checks.length !== task.contract?.acceptanceCriteria.length || validResearch.checks.some((check) => check.status !== "passed") || validResearch.instructionChecks?.some((check) => check.status !== "passed") || validResearch.claims.some((claim) => claim.support !== "supported")));
|
|
61
70
|
const artifacts = /* @__PURE__ */ new Map();
|
|
62
71
|
for (const outcome of outcomes) for (const item of outcome.deliverables) artifacts.set(item.sourceFileId ?? item.artifactId, item);
|
|
63
|
-
const
|
|
64
|
-
const
|
|
72
|
+
const allArtifacts = outcomes.flatMap((outcome) => outcome.deliverables);
|
|
73
|
+
const deliverables = research?.finalArtifactIds !== void 0 ? research.finalArtifactIds.map((id) => allArtifacts.findLast((item) => item.artifactId === id)).filter((item) => Boolean(item)) : selectionRequired ? [] : [...artifacts.values()].slice(-50);
|
|
74
|
+
const selectedManifest = validResearch?.finalArtifactIds !== void 0;
|
|
75
|
+
const selectedMissing = selectedManifest && deliverables.length !== validResearch.finalArtifactIds.length;
|
|
76
|
+
const rawText = resultText?.trim() && resultText.trim() !== "NO_REPLY" ? resultText.trim() : void 0;
|
|
77
|
+
const unpublishedFile = Boolean(rawText && hasPersonalResultFileLinks(rawText) && !deliverables.some((item) => item.availability === "available"));
|
|
78
|
+
const text = rawText ? sanitizePersonalResultFileLinks(rawText) || (unpublishedFile ? "The file has not been published for download." : void 0) : void 0;
|
|
65
79
|
if (!deliverables.length && (!text || status !== "succeeded")) return false;
|
|
66
80
|
if (!deliverables.length && personalRequestForTask(run.taskId)) return false;
|
|
67
81
|
const outcome = {
|
|
68
82
|
...latest,
|
|
83
|
+
research: validResearch,
|
|
69
84
|
deliverables,
|
|
70
85
|
evidence: [],
|
|
71
86
|
changeSet: void 0,
|
|
72
87
|
summary,
|
|
73
|
-
status: status === "failed" || deliverables.some((item) => item.availability !== "available") ? "partial" : "succeeded"
|
|
88
|
+
status: selectedManifest ? status === "failed" || researchGap || selectedMissing || unpublishedFile || deliverables.some((item) => item.availability !== "available") ? "partial" : "succeeded" : latest.status === "failed" ? "failed" : status === "failed" || latest.status === "partial" || unpublishedFile || researchGap || deliverables.some((item) => item.availability !== "available") ? "partial" : "succeeded"
|
|
74
89
|
};
|
|
75
90
|
const now = Date.now();
|
|
91
|
+
const previous = db.prepare(`SELECT delivery_id, payload_json FROM task_result_deliveries WHERE task_run_id IN
|
|
92
|
+
(SELECT run_id FROM task_runs WHERE task_id = ?) ORDER BY created_at DESC, rowid DESC LIMIT 1`).get(task.id);
|
|
93
|
+
const superseded = new Set(db.prepare("SELECT supersedes_json FROM task_work_revisions WHERE task_id = ? AND contract_version <= ?").all(task.id, task.latestContractVersion).flatMap((row) => JSON.parse(row.supersedes_json)));
|
|
94
|
+
const adoption = new TaskCollaborationRepository().coordination(task.id).filter((entry) => ["main_agent", "user"].includes(entry.authorKind) && ["answer", "instruction"].includes(entry.kind)).map((entry) => {
|
|
95
|
+
const check = validResearch?.instructionChecks?.find((item) => item.sequence === entry.sequence);
|
|
96
|
+
return {
|
|
97
|
+
entryId: entry.id,
|
|
98
|
+
sequence: entry.sequence,
|
|
99
|
+
status: superseded.has(entry.id) ? "superseded" : check?.status === "passed" ? "applied" : check?.claimIds.some((id) => validResearch?.claims.some((claim) => claim.id === id && claim.support === "supported")) ? "partially_applied" : "not_applied",
|
|
100
|
+
verification: check?.status ?? "unverified",
|
|
101
|
+
claimIds: check?.claimIds ?? [],
|
|
102
|
+
note: check?.note ?? "No verified adoption evidence for this revision."
|
|
103
|
+
};
|
|
104
|
+
});
|
|
76
105
|
const delivery = TaskResultDeliverySchema.parse({
|
|
77
106
|
version: 1,
|
|
78
107
|
deliveryId: randomUUID(),
|
|
@@ -83,6 +112,11 @@ var TaskResultDeliveryRepository = class {
|
|
|
83
112
|
originTranscriptId: origin.origin_transcript_id,
|
|
84
113
|
...origin.request_input_id ? { requestInputId: origin.request_input_id } : {},
|
|
85
114
|
assignmentEpoch: state.assignmentEpoch,
|
|
115
|
+
contractVersion: task.latestContractVersion,
|
|
116
|
+
instructionSequence: taskInstructionSequence(task.id),
|
|
117
|
+
resultRevision: previous ? (JSON.parse(previous.payload_json).resultRevision ?? 1) + 1 : 1,
|
|
118
|
+
...previous ? { previousResultId: previous.delivery_id } : {},
|
|
119
|
+
adoption,
|
|
86
120
|
outcome,
|
|
87
121
|
...text ? { text } : {},
|
|
88
122
|
createdAt: now
|
|
@@ -10,11 +10,16 @@ import { appendTranscriptEntry, init_transcript_repository } from "../storage/sq
|
|
|
10
10
|
import { getPersonalAgentByConversation } from "../personal-agent/repository.js";
|
|
11
11
|
import { emitSessionTranscriptUpdate } from "../session/transcript-events.js";
|
|
12
12
|
import { resolveTaskLocale } from "./task-language.js";
|
|
13
|
-
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
14
13
|
import { tryParseMediaUri } from "../media/uri.js";
|
|
15
14
|
import { resolveMediaBufferPath } from "../media/store.js";
|
|
15
|
+
import { warmPersonalResult } from "../personal-agent/result-reader.js";
|
|
16
|
+
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
16
17
|
import { TaskResultDeliveryRepository } from "./task-result-delivery-repository.js";
|
|
18
|
+
import { taskInstructionSequence } from "./task-research-result.js";
|
|
19
|
+
import { recordPersonalPerformance } from "../personal-agent/performance.js";
|
|
17
20
|
import { enqueuePersonalReply } from "../personal-agent/reply-composer.js";
|
|
21
|
+
import { createReadStream } from "node:fs";
|
|
22
|
+
import { createHash } from "node:crypto";
|
|
18
23
|
import { lstat } from "node:fs/promises";
|
|
19
24
|
//#region src/tasks/task-result-delivery-service.ts
|
|
20
25
|
init_src();
|
|
@@ -36,12 +41,17 @@ async function materializedArtifact(item) {
|
|
|
36
41
|
const media = item.uri ? tryParseMediaUri(item.uri) : null;
|
|
37
42
|
if (media?.bucket === "outbound" && item.location === "artifact_store") {
|
|
38
43
|
const file = await lstat(resolveMediaBufferPath(media.id, media.bucket)).catch(() => null);
|
|
39
|
-
if (file?.isFile() && file.size <= 52428800)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
if (file?.isFile() && file.size <= 52428800) {
|
|
45
|
+
const digest = createHash("sha256");
|
|
46
|
+
for await (const chunk of createReadStream(resolveMediaBufferPath(media.id, media.bucket))) digest.update(chunk);
|
|
47
|
+
return {
|
|
48
|
+
...artifact,
|
|
49
|
+
sha256: digest.digest("hex"),
|
|
50
|
+
sizeBytes: file.size,
|
|
51
|
+
shareUrl: void 0,
|
|
52
|
+
capabilities: item.capabilities.filter((capability) => capability === "preview" || capability === "download")
|
|
53
|
+
};
|
|
54
|
+
}
|
|
45
55
|
return {
|
|
46
56
|
...artifact,
|
|
47
57
|
availability: "missing",
|
|
@@ -82,7 +92,7 @@ var TaskResultDeliveryService = class {
|
|
|
82
92
|
const state = new TaskConversationRepository().getState(delivery.taskId);
|
|
83
93
|
const session = db.prepare("SELECT active_transcript_id FROM sessions WHERE conversation_id = ?").get(delivery.conversationId);
|
|
84
94
|
const task = db.prepare("SELECT resolution FROM tasks WHERE task_id = ?").get(delivery.taskId);
|
|
85
|
-
if (!session || !run || !["succeeded", "failed"].includes(run.status) || task.resolution && task.resolution !== "done" || new TaskRunRepository().getLatestRoot(delivery.taskId)?.id !== run.id || state?.assignmentEpoch !== delivery.assignmentEpoch || state.activeConversationId !== run.conversationId) {
|
|
95
|
+
if (delivery.instructionSequence !== void 0 && delivery.instructionSequence !== taskInstructionSequence(delivery.taskId) || !session || !run || !["succeeded", "failed"].includes(run.status) || task.resolution && task.resolution !== "done" || new TaskRunRepository().getLatestRoot(delivery.taskId)?.id !== run.id || state?.assignmentEpoch !== delivery.assignmentEpoch || state.activeConversationId !== run.conversationId) {
|
|
86
96
|
db.prepare("UPDATE task_result_deliveries SET status = 'stale' WHERE delivery_id = ?").run(row.delivery_id);
|
|
87
97
|
return false;
|
|
88
98
|
}
|
|
@@ -92,8 +102,9 @@ var TaskResultDeliveryService = class {
|
|
|
92
102
|
deliverables,
|
|
93
103
|
status: deliverables.length > 0 && available === 0 ? "failed" : available < deliverables.length ? "partial" : delivery.outcome.status
|
|
94
104
|
};
|
|
95
|
-
const statusText = resolveTaskLocale(new TaskRepository().require(delivery.taskId)) === "zh" ? `${delivery.taskTitle}:${
|
|
105
|
+
const statusText = resolveTaskLocale(new TaskRepository().require(delivery.taskId)) === "zh" ? `${delivery.taskTitle}:${outcome.status === "failed" ? "请求未完成" : outcome.status === "partial" ? "部分内容已完成" : deliverables.length ? "成果已生成" : "结果已返回"}。` : `${delivery.taskTitle}: ${outcome.status === "failed" ? "Request incomplete" : outcome.status === "partial" ? "Partial results ready" : deliverables.length ? "Results ready" : "Result returned"}.`;
|
|
96
106
|
const personal = getPersonalAgentByConversation(delivery.conversationId);
|
|
107
|
+
if (personal) warmPersonalResult(delivery.conversationId, delivery.deliveryId);
|
|
97
108
|
if (personal && !personalRequestForTask(delivery.taskId)) enqueuePersonalReply({
|
|
98
109
|
delivery: {
|
|
99
110
|
...delivery,
|
|
@@ -117,9 +128,26 @@ var TaskResultDeliveryService = class {
|
|
|
117
128
|
timestamp: Date.now()
|
|
118
129
|
}) : void 0;
|
|
119
130
|
db.prepare(`UPDATE task_result_deliveries SET status = 'delivered', payload_json = ?,
|
|
120
|
-
message_entry_id = ?, delivered_at = ? WHERE delivery_id = ?`).run(JSON.stringify(
|
|
131
|
+
message_entry_id = ?, delivered_at = ? WHERE delivery_id = ?`).run(JSON.stringify({
|
|
132
|
+
...delivery,
|
|
133
|
+
outcome
|
|
134
|
+
}), entry?.entry_id ?? null, Date.now(), row.delivery_id);
|
|
121
135
|
return true;
|
|
122
136
|
})) continue;
|
|
137
|
+
const saved = getSqliteDatabase().prepare("SELECT message_entry_id, delivered_at FROM task_result_deliveries WHERE delivery_id = ?").get(row.delivery_id);
|
|
138
|
+
if (saved?.message_entry_id && getPersonalAgentByConversation(delivery.conversationId)) recordPersonalPerformance({
|
|
139
|
+
phase: "result_to_chat",
|
|
140
|
+
conversationId: delivery.conversationId,
|
|
141
|
+
taskId: delivery.taskId,
|
|
142
|
+
runId: delivery.taskRunId,
|
|
143
|
+
deliveryId: delivery.deliveryId,
|
|
144
|
+
resultRevision: delivery.resultRevision,
|
|
145
|
+
contractVersion: delivery.contractVersion,
|
|
146
|
+
instructionSequence: delivery.instructionSequence,
|
|
147
|
+
assignmentEpoch: delivery.assignmentEpoch,
|
|
148
|
+
durationMs: Math.max(0, Number(saved.delivered_at) - delivery.createdAt),
|
|
149
|
+
status: "success"
|
|
150
|
+
});
|
|
123
151
|
}
|
|
124
152
|
emitSessionTranscriptUpdate({ conversationId: delivery.conversationId });
|
|
125
153
|
notify(delivery.conversationId, delivery.deliveryId);
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
import { init_transaction, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
2
|
import { TaskRepository, init_task_repository } from "./task-repository.js";
|
|
3
3
|
import { TaskRunRepository, init_task_run_repository } from "./task-run-repository.js";
|
|
4
|
+
import { init_request_repository, personalRequestForTask } from "../personal-agent/request-repository.js";
|
|
4
5
|
import { loadTranscriptRowsForSession } from "../storage/sqlite/transcript-repository.js";
|
|
5
6
|
import { init_sqlite } from "../storage/sqlite/index.js";
|
|
6
7
|
import { isTransientProviderErrorMessage } from "../providers/model-response.js";
|
|
7
|
-
import { canResumeAfterModelFailure } from "../agent/orchestration/turn-recovery.js";
|
|
8
|
+
import { ACCEPTANCE_REPAIR_READ_TOOLS, canResumeAfterModelFailure } from "../agent/orchestration/turn-recovery.js";
|
|
8
9
|
import { resolveTaskLocale } from "./task-language.js";
|
|
9
10
|
import { TaskAllocationRepository } from "./task-allocation-repository.js";
|
|
10
|
-
import { TaskContextRepository } from "./task-context-repository.js";
|
|
11
11
|
import { TaskCollaborationRepository } from "./task-collaboration-repository.js";
|
|
12
12
|
import { TaskResultDeliveryRepository } from "./task-result-delivery-repository.js";
|
|
13
|
+
import { currentTaskResearchResult, taskInstructionSequence } from "./task-research-result.js";
|
|
14
|
+
import { TaskContextRepository } from "./task-context-repository.js";
|
|
13
15
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
16
|
+
import { buildResearchRepair, inspectTaskPublications } from "./task-research-repair.js";
|
|
14
17
|
//#region src/tasks/task-run-coordinator.ts
|
|
18
|
+
init_request_repository();
|
|
15
19
|
init_transaction();
|
|
16
20
|
init_task_repository();
|
|
17
21
|
init_task_run_repository();
|
|
@@ -139,24 +143,75 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
139
143
|
].includes(run.status)) return;
|
|
140
144
|
if (run.status === "waiting" && run.policySnapshot.continuation) return;
|
|
141
145
|
if (run.status === "waiting" && this.#runs.listActiveWaits(run.taskId).length > 0) return;
|
|
142
|
-
if (input.status === "failed" && isTransientProviderErrorMessage(input.summary) && run.conversationId && canResumeAfterModelFailure(loadTranscriptRowsForSession(run.conversationId)) && this.#runs.scheduleContinuation({
|
|
143
|
-
runId: run.id,
|
|
144
|
-
expectedVersion: run.version,
|
|
145
|
-
reason: "model_failure",
|
|
146
|
-
message: "The previous model request failed. Continue the same task using the recorded completed tool results. Do not replay completed operations; finish only the remaining work."
|
|
147
|
-
})) return;
|
|
148
146
|
const hasAssistantResult = Boolean(input.assistantText?.trim() && input.assistantText.trim() !== "NO_REPLY");
|
|
149
147
|
const hasBoardResult = new TaskCollaborationRepository().recent(run.taskId, void 0, 20).some((entry) => entry.taskRunId === run.id && entry.kind === "result");
|
|
150
148
|
const emptySuccess = input.status === "succeeded" && !hasAssistantResult && !hasBoardResult && !this.#hasDeliverables && this.#evidence.length === 0;
|
|
151
149
|
const task = new TaskRepository().require(run.taskId);
|
|
152
150
|
const zh = resolveTaskLocale(task) === "zh";
|
|
153
151
|
const status = emptySuccess ? "failed" : input.status;
|
|
154
|
-
const
|
|
152
|
+
const recoveryOptions = { allowFailedReadTools: ACCEPTANCE_REPAIR_READ_TOOLS };
|
|
153
|
+
const unconfirmedEffects = status === "failed" && Boolean(run.conversationId && !canResumeAfterModelFailure(loadTranscriptRowsForSession(run.conversationId), recoveryOptions));
|
|
155
154
|
const summary = emptySuccess ? zh ? "助手执行未返回结果或证据" : "Agent run returned no result or evidence" : zh ? {
|
|
156
155
|
"Message processed": "消息已处理",
|
|
157
156
|
Interrupted: "执行已中断",
|
|
158
157
|
"Agent run ended unexpectedly": "助手执行意外结束"
|
|
159
158
|
}[input.summary] ?? input.summary : input.summary;
|
|
159
|
+
const research = currentTaskResearchResult(run.id);
|
|
160
|
+
const currentResearch = research && research.contractVersion === task.latestContractVersion && research.instructionSequence === taskInstructionSequence(task.id) ? research : void 0;
|
|
161
|
+
const publications = inspectTaskPublications(run.id, currentResearch);
|
|
162
|
+
const repair = buildResearchRepair({
|
|
163
|
+
research: currentResearch,
|
|
164
|
+
stale: Boolean(research && !currentResearch),
|
|
165
|
+
instructionSequence: taskInstructionSequence(task.id),
|
|
166
|
+
publications,
|
|
167
|
+
criteria: task.contract?.acceptanceCriteria ?? [],
|
|
168
|
+
requiresReview: !personalRequestForTask(task.id) && Boolean(task.body?.includes("publish_task_result"))
|
|
169
|
+
});
|
|
170
|
+
const repairBlocked = Boolean(repair && run.conversationId && !canResumeAfterModelFailure(loadTranscriptRowsForSession(run.conversationId), { allowFailedReadTools: ACCEPTANCE_REPAIR_READ_TOOLS }));
|
|
171
|
+
if (status === "failed" && isTransientProviderErrorMessage(input.summary) && !unconfirmedEffects && this.#runs.scheduleContinuation({
|
|
172
|
+
runId: run.id,
|
|
173
|
+
expectedVersion: run.version,
|
|
174
|
+
reason: "model_failure",
|
|
175
|
+
message: ["The previous model request failed transiently. Continue this same task from recorded completed operations; do not replay external effects.", ...repair ? [repair.message] : ["Finish only the remaining work."]].join("\n")
|
|
176
|
+
})) return;
|
|
177
|
+
if (status === "succeeded" && repair && !repairBlocked && this.#runs.scheduleContinuation({
|
|
178
|
+
runId: run.id,
|
|
179
|
+
expectedVersion: run.version,
|
|
180
|
+
reason: "acceptance_repair",
|
|
181
|
+
repairFingerprint: repair.fingerprint,
|
|
182
|
+
message: repair.message
|
|
183
|
+
})) return;
|
|
184
|
+
const researchEvidence = currentResearch?.claims.map((claim) => ({
|
|
185
|
+
kind: "source",
|
|
186
|
+
title: `Research claim: ${claim.id}`,
|
|
187
|
+
summary: claim.statement,
|
|
188
|
+
uri: currentResearch.sources.find((source) => claim.sourceIds.includes(source.id))?.url,
|
|
189
|
+
provenance: "judge",
|
|
190
|
+
strength: claim.support === "supported" ? "verified" : "observed",
|
|
191
|
+
observedAt: Date.now(),
|
|
192
|
+
verifies: currentResearch.checks.filter((check) => check.status === "passed" && check.claimIds.includes(claim.id)).map((check) => check.criterion)
|
|
193
|
+
})) ?? [];
|
|
194
|
+
const checks = currentResearch?.checks.map((check) => ({
|
|
195
|
+
criterion: check.criterion,
|
|
196
|
+
status: check.status,
|
|
197
|
+
evidenceTitles: check.claimIds.map((id) => `Research claim: ${id}`),
|
|
198
|
+
note: check.note,
|
|
199
|
+
method: currentResearch.review === "model_reviewed" ? "model_reviewed" : "unverified"
|
|
200
|
+
})) ?? (task.contract?.acceptanceCriteria ?? []).map((criterion) => ({
|
|
201
|
+
criterion,
|
|
202
|
+
status: "unverified",
|
|
203
|
+
evidenceTitles: [],
|
|
204
|
+
method: "unverified",
|
|
205
|
+
note: zh ? "未提交有证据关联的核验结果。" : "No evidence-linked verification result was submitted."
|
|
206
|
+
}));
|
|
207
|
+
const instructionChecks = (currentResearch?.instructionChecks ?? []).map((check) => ({
|
|
208
|
+
criterion: check.instruction,
|
|
209
|
+
status: check.status,
|
|
210
|
+
evidenceTitles: check.claimIds.map((id) => `Research claim: ${id}`),
|
|
211
|
+
note: check.note,
|
|
212
|
+
method: "model_reviewed"
|
|
213
|
+
}));
|
|
214
|
+
const achieved = status === "succeeded" && checks.length > 0 && checks.length === task.contract?.acceptanceCriteria.length && checks.every((check) => check.status === "passed") && !repair && currentResearch.claims.every((claim) => claim.support === "supported");
|
|
160
215
|
this.#application.completeRun({
|
|
161
216
|
runId: run.id,
|
|
162
217
|
expectedRunVersion: run.version,
|
|
@@ -165,14 +220,15 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
165
220
|
status,
|
|
166
221
|
summary,
|
|
167
222
|
changes: this.#evidence.filter((item) => item.kind === "state"),
|
|
168
|
-
evidence: this.#evidence,
|
|
223
|
+
evidence: [...this.#evidence, ...researchEvidence],
|
|
169
224
|
verification: {
|
|
170
|
-
status: "unverified",
|
|
171
|
-
checks: []
|
|
225
|
+
status: achieved ? "passed" : [...checks, ...instructionChecks].some((check) => check.status === "failed") ? "failed" : "unverified",
|
|
226
|
+
checks: [...checks, ...instructionChecks]
|
|
172
227
|
},
|
|
173
|
-
remainingWork: emptySuccess ? [task.contract?.objective ?? (zh ? "完成任务" : "Complete the task")] : status === "succeeded" ? task.contract?.acceptanceCriteria ?? [] : [],
|
|
174
|
-
needsUser: unconfirmedEffects,
|
|
175
|
-
|
|
228
|
+
remainingWork: repair ? repair.gaps : emptySuccess ? [task.contract?.objective ?? (zh ? "完成任务" : "Complete the task")] : achieved ? [] : status === "succeeded" ? currentResearch ? [...currentResearch.checks.filter((check) => check.status !== "passed").map((check) => check.criterion), ...currentResearch.claims.filter((claim) => claim.support !== "supported").map((claim) => claim.note ?? claim.statement)] : task.contract?.acceptanceCriteria ?? [] : [],
|
|
229
|
+
needsUser: unconfirmedEffects || repairBlocked,
|
|
230
|
+
...repairBlocked ? { nextAction: zh ? "先确认上次未确认操作的实际影响,再继续补查。" : "Confirm the effects of the unconfirmed operation before repair." } : {},
|
|
231
|
+
completionVerdict: achieved ? "achieved" : status === "succeeded" ? "partial" : "not_achieved",
|
|
176
232
|
...status === "failed" ? { failure: {
|
|
177
233
|
code: unconfirmedEffects ? "tool_outcome_unconfirmed" : emptySuccess ? "empty_agent_run" : "agent_run_failed",
|
|
178
234
|
phase: "execution",
|
|
@@ -5,6 +5,7 @@ export declare class TaskRunDispatcher {
|
|
|
5
5
|
workerId: string;
|
|
6
6
|
maxConcurrency?: number;
|
|
7
7
|
ensureSession: (taskId: string, runId: string, agentId?: string) => Promise<string>;
|
|
8
|
+
validateExecutor?: (taskId: string, agentId?: string) => void;
|
|
8
9
|
runAgent: (runId: string, conversationId: string, message: string) => Promise<void>;
|
|
9
10
|
});
|
|
10
11
|
dispatch(): void;
|
|
@@ -39,6 +39,7 @@ var TaskRunDispatcher = class {
|
|
|
39
39
|
}
|
|
40
40
|
async drain() {
|
|
41
41
|
if (this.#stopped) return;
|
|
42
|
+
this.#runs.reconcileCancelledRuns();
|
|
42
43
|
this.reconcileExpiredRuns();
|
|
43
44
|
const count = Math.max(1, Math.min(8, this.deps.maxConcurrency ?? 3));
|
|
44
45
|
await Promise.all(Array.from({ length: count }, (_, slot) => this.drainSlot(`${this.deps.workerId}:${slot}`)));
|
|
@@ -113,6 +114,7 @@ var TaskRunDispatcher = class {
|
|
|
113
114
|
const agentId = typeof run.executorRef.agentId === "string" ? run.executorRef.agentId : void 0;
|
|
114
115
|
const conversationId = await this.deps.ensureSession(task.id, run.id, agentId);
|
|
115
116
|
if (this.#stopped) return;
|
|
117
|
+
this.deps.validateExecutor?.(task.id, agentId);
|
|
116
118
|
this.#activeRunIds.add(run.id);
|
|
117
119
|
const heartbeat = setInterval(() => {
|
|
118
120
|
if (!this.#runs.heartbeat({
|
|
@@ -183,7 +185,7 @@ var TaskRunDispatcher = class {
|
|
|
183
185
|
function buildTaskRunMessage(objective, trigger, body, taskId) {
|
|
184
186
|
const brief = body?.trim();
|
|
185
187
|
const taskMessage = brief ? `${objective}\n\n<task_brief>\n${brief.slice(0, 12e3)}\n</task_brief>` : objective;
|
|
186
|
-
const completeBrief = taskId && brief && brief.length > 12e3 ? `${taskMessage}\n\nThe task brief above is an excerpt. Before execution read
|
|
188
|
+
const completeBrief = taskId && brief && brief.length > 12e3 ? `${taskMessage}\n\nThe task brief above is an excerpt. Before execution read every page with task_collaboration({command:"get",section:"brief",offset:0}) and nextOffset. Preserve all instructions and acceptance criteria.` : taskMessage;
|
|
187
189
|
const context = trigger.context;
|
|
188
190
|
if (!context || typeof context !== "object" || Array.isArray(context)) return completeBrief;
|
|
189
191
|
const serialized = JSON.stringify(context);
|
|
@@ -56,12 +56,15 @@ export declare class TaskRunRepository {
|
|
|
56
56
|
now?: number;
|
|
57
57
|
}): TaskRun | undefined;
|
|
58
58
|
listExpiredLeasedRunning(now?: number, limit?: number): TaskRun[];
|
|
59
|
+
/** Finish cancellations persisted before an earlier process could observe execution exit. */
|
|
60
|
+
reconcileCancelledRuns(): number;
|
|
59
61
|
/** Resume the same TaskRun and conversation within its original deadline and attempt budget. */
|
|
60
62
|
scheduleContinuation(input: {
|
|
61
63
|
runId: string;
|
|
62
64
|
expectedVersion: number;
|
|
63
65
|
message: string;
|
|
64
66
|
reason: string;
|
|
67
|
+
repairFingerprint?: string;
|
|
65
68
|
now?: number;
|
|
66
69
|
}): boolean;
|
|
67
70
|
finalize(input: {
|
|
@@ -101,6 +104,8 @@ export declare class TaskRunRepository {
|
|
|
101
104
|
getWait(waitId: string): TaskWait | undefined;
|
|
102
105
|
requireWait(waitId: string): TaskWait;
|
|
103
106
|
listActiveWaits(taskId: string): TaskWait[];
|
|
107
|
+
/** A Run's cancellation owns all its waits, never those of another Run on the same Task. */
|
|
108
|
+
resolveCancelledRunWaits(runId: string, actor: ActorRef): number;
|
|
104
109
|
resolveWait(input: {
|
|
105
110
|
waitId: string;
|
|
106
111
|
actor: ActorRef;
|
|
@@ -74,7 +74,7 @@ function receiptFromRow(row) {
|
|
|
74
74
|
finalizedAt: row.finalized_at
|
|
75
75
|
};
|
|
76
76
|
}
|
|
77
|
-
var ACTIVE_RUN_STATUSES, TaskRunRepository;
|
|
77
|
+
var ACTIVE_RUN_STATUSES, CANCELLED_ACTIVE_RUNS, TaskRunRepository;
|
|
78
78
|
var init_task_run_repository = __esmMin((() => {
|
|
79
79
|
init_transaction();
|
|
80
80
|
init_task_change_events();
|
|
@@ -85,6 +85,19 @@ var init_task_run_repository = __esmMin((() => {
|
|
|
85
85
|
"waiting",
|
|
86
86
|
"verifying"
|
|
87
87
|
];
|
|
88
|
+
CANCELLED_ACTIVE_RUNS = `SELECT run.run_id FROM task_runs run
|
|
89
|
+
WHERE ((run.status = 'cancelled' AND EXISTS (SELECT 1 FROM task_waits remaining
|
|
90
|
+
WHERE remaining.task_run_id = run.run_id AND remaining.status = 'active'))
|
|
91
|
+
OR (run.status IN ('queued','running','waiting','verifying') AND (
|
|
92
|
+
EXISTS (SELECT 1 FROM session_connection_waits wait WHERE wait.status = 'closed'
|
|
93
|
+
AND json_extract(wait.data_json, '$.resolution') = 'cancelled' AND (
|
|
94
|
+
json_extract(wait.data_json, '$.taskRunId') = run.run_id
|
|
95
|
+
OR EXISTS (SELECT 1 FROM session_inputs origin WHERE origin.id = json_extract(wait.data_json, '$.originInputId')
|
|
96
|
+
AND origin.task_run_id = run.run_id)
|
|
97
|
+
OR EXISTS (SELECT 1 FROM task_waits task_wait WHERE task_wait.task_run_id = run.run_id
|
|
98
|
+
AND json_extract(task_wait.condition_json, '$.connectionWaitId') = wait.id)))
|
|
99
|
+
OR EXISTS (SELECT 1 FROM command_deduplication command WHERE command.command_type = 'task.close'
|
|
100
|
+
AND command.subject_id = run.task_id AND json_extract(command.result_json, '$.cancellationRunId') = run.run_id))))`;
|
|
88
101
|
TaskRunRepository = class {
|
|
89
102
|
nextAgentInputClientMessageId(runId) {
|
|
90
103
|
const finished = getSqliteDatabase().prepare(`SELECT COUNT(*) AS count FROM session_inputs
|
|
@@ -204,11 +217,59 @@ var init_task_run_repository = __esmMin((() => {
|
|
|
204
217
|
AND lease_expires_at IS NOT NULL AND lease_expires_at <= ?
|
|
205
218
|
ORDER BY lease_expires_at LIMIT ?`).all(now, Math.max(1, Math.min(200, Math.floor(limit)))).map(fromRow);
|
|
206
219
|
}
|
|
220
|
+
/** Finish cancellations persisted before an earlier process could observe execution exit. */
|
|
221
|
+
reconcileCancelledRuns() {
|
|
222
|
+
return runSqliteWriteTransaction((db) => {
|
|
223
|
+
const rows = db.prepare(CANCELLED_ACTIVE_RUNS).all();
|
|
224
|
+
let completed = 0;
|
|
225
|
+
for (const row of rows) {
|
|
226
|
+
const run = this.get(row.run_id);
|
|
227
|
+
if (!run) continue;
|
|
228
|
+
const cleared = this.resolveCancelledRunWaits(run.id, { kind: "system" });
|
|
229
|
+
if (run.status === "cancelled") {
|
|
230
|
+
if (cleared) completed++;
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
if (run && this.finalize({
|
|
234
|
+
runId: run.id,
|
|
235
|
+
expectedVersion: run.version,
|
|
236
|
+
actor: { kind: "system" },
|
|
237
|
+
terminalCode: "cancelled_by_user",
|
|
238
|
+
receipt: {
|
|
239
|
+
status: "cancelled",
|
|
240
|
+
summary: "Task cancelled",
|
|
241
|
+
changes: [],
|
|
242
|
+
evidence: [],
|
|
243
|
+
verification: {
|
|
244
|
+
status: "unverified",
|
|
245
|
+
checks: []
|
|
246
|
+
},
|
|
247
|
+
remainingWork: [],
|
|
248
|
+
needsUser: false,
|
|
249
|
+
completionVerdict: "not_achieved"
|
|
250
|
+
}
|
|
251
|
+
})) {
|
|
252
|
+
const task = new TaskRepository().require(run.taskId);
|
|
253
|
+
enqueueTaskChangedEvent(db, {
|
|
254
|
+
taskId: task.id,
|
|
255
|
+
projectId: task.projectId,
|
|
256
|
+
version: task.version,
|
|
257
|
+
changedFields: ["runs", "receipts"],
|
|
258
|
+
actor: { kind: "system" },
|
|
259
|
+
source: "runtime"
|
|
260
|
+
});
|
|
261
|
+
completed++;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return completed;
|
|
265
|
+
});
|
|
266
|
+
}
|
|
207
267
|
/** Resume the same TaskRun and conversation within its original deadline and attempt budget. */
|
|
208
268
|
scheduleContinuation(input) {
|
|
209
269
|
const now = input.now ?? Date.now();
|
|
210
270
|
return runSqliteWriteTransaction((db) => {
|
|
211
271
|
const run = this.get(input.runId);
|
|
272
|
+
if (db.prepare(`${CANCELLED_ACTIVE_RUNS} AND run.run_id = ?`).get(input.runId)) return false;
|
|
212
273
|
if (!run || run.version !== input.expectedVersion || !["running", "verifying"].includes(run.status) || run.parentRunId || !run.conversationId || run.timeoutAt !== void 0 && run.timeoutAt <= now || this.listActiveWaits(run.taskId).length > 0) return false;
|
|
213
274
|
const execution = db.prepare("SELECT active_conversation_id FROM task_conversation_state WHERE task_id = ?").get(run.taskId);
|
|
214
275
|
if (execution?.active_conversation_id && execution.active_conversation_id !== run.conversationId) return false;
|
|
@@ -217,9 +278,11 @@ var init_task_run_repository = __esmMin((() => {
|
|
|
217
278
|
const attempts = Number(run.policySnapshot.continuationAttempts ?? 0);
|
|
218
279
|
const maxAttempts = Math.max(1, Math.min(3, Number(run.retryPolicy.maxAttempts ?? 1)));
|
|
219
280
|
if (!Number.isFinite(attempts) || !Number.isFinite(maxAttempts) || attempts >= maxAttempts - 1) return false;
|
|
281
|
+
if (input.repairFingerprint && run.policySnapshot.repairFingerprint === input.repairFingerprint) return false;
|
|
220
282
|
const policy = {
|
|
221
283
|
...run.policySnapshot,
|
|
222
284
|
continuationAttempts: attempts + 1,
|
|
285
|
+
...input.repairFingerprint ? { repairFingerprint: input.repairFingerprint } : {},
|
|
223
286
|
continuation: {
|
|
224
287
|
message: input.message,
|
|
225
288
|
reason: input.reason,
|
|
@@ -332,6 +395,30 @@ var init_task_run_repository = __esmMin((() => {
|
|
|
332
395
|
return getSqliteDatabase().prepare(`SELECT * FROM task_waits WHERE task_id = ? AND status = 'active'
|
|
333
396
|
ORDER BY created_at ASC`).all(taskId).map(waitFromRow);
|
|
334
397
|
}
|
|
398
|
+
/** A Run's cancellation owns all its waits, never those of another Run on the same Task. */
|
|
399
|
+
resolveCancelledRunWaits(runId, actor) {
|
|
400
|
+
return runSqliteWriteTransaction((db) => {
|
|
401
|
+
const run = this.get(runId);
|
|
402
|
+
if (!run) return 0;
|
|
403
|
+
let resolved = 0;
|
|
404
|
+
for (const wait of this.listActiveWaits(run.taskId)) if (wait.taskRunId === run.id && this.resolveWait({
|
|
405
|
+
waitId: wait.id,
|
|
406
|
+
actor,
|
|
407
|
+
resolution: { cancelled: true }
|
|
408
|
+
})) resolved++;
|
|
409
|
+
if (resolved) {
|
|
410
|
+
const task = new TaskRepository().require(run.taskId);
|
|
411
|
+
enqueueTaskChangedEvent(db, {
|
|
412
|
+
taskId: task.id,
|
|
413
|
+
projectId: task.projectId,
|
|
414
|
+
version: task.version,
|
|
415
|
+
changedFields: ["runs"],
|
|
416
|
+
actor
|
|
417
|
+
});
|
|
418
|
+
}
|
|
419
|
+
return resolved;
|
|
420
|
+
});
|
|
421
|
+
}
|
|
335
422
|
resolveWait(input) {
|
|
336
423
|
const now = input.now ?? Date.now();
|
|
337
424
|
return runSqliteWriteTransaction((db) => {
|
|
@@ -8,10 +8,9 @@ import { cancelQueuedSessionInput, claimNextSessionInput, finishSessionInputRun,
|
|
|
8
8
|
import { appendComposerInputHistory, listComposerInputHistory } from "../../storage/sqlite/composer-input-history-repository.js";
|
|
9
9
|
import { getSessionMetadata } from "../../storage/sqlite/session-read-repository.js";
|
|
10
10
|
import { init_sqlite } from "../../storage/sqlite/index.js";
|
|
11
|
+
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
11
12
|
import { normalizeAgentId } from "../../agent-catalog/id.js";
|
|
12
13
|
import { init_agent_scope, listAgentEntries } from "../../agent/agent-scope.js";
|
|
13
|
-
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
14
|
-
import { init_agent_session_key, resolveAgentIdFromConversationId } from "../../routing/agent-session-key.js";
|
|
15
14
|
import { resolveEffectiveAgentProfile } from "../../config/agent-profile.js";
|
|
16
15
|
import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
17
16
|
import { init_paths } from "../../config/paths.js";
|
|
@@ -24,6 +23,7 @@ import { buildSessionTimeline } from "../../session/transcript-outline.js";
|
|
|
24
23
|
import { transcriptRowsToClientHistory } from "../../session/client-history.js";
|
|
25
24
|
import { createCreateShareTool, isShareToolAvailable } from "../../agent/tools/create-share-tool.js";
|
|
26
25
|
import { evictEmbeddedSessionRunner } from "../../agent/embedded/session-runner.js";
|
|
26
|
+
import { AgentCatalogService } from "../../agent-catalog/service.js";
|
|
27
27
|
import { SessionIndex } from "../../session/manager.js";
|
|
28
28
|
import "../../session/index.js";
|
|
29
29
|
import { parseModelRef } from "../../agent/models/selection.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { init_agent_scope, resolveAgentProfileDir } from "../../agent/agent-scope.js";
|
|
2
|
-
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
3
2
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
3
|
+
import { DEFAULT_SOUL_FILENAME } from "../../agent/context/workspace.js";
|
|
4
4
|
import { loadProfileBootstrapFiles } from "../../agent/bootstrap/load-bootstrap-files.js";
|
|
5
5
|
import { join } from "node:path";
|
|
6
6
|
import { statSync } from "node:fs";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xopcai/xopc",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.387",
|
|
4
4
|
"description": "Local-first personal AI with Ada, task delegation, files, projects, workflows, and automations. Use cloud or local models.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"markdown-it": "^14.2.0",
|
|
107
107
|
"node-edge-tts": "^1.2.10",
|
|
108
108
|
"openai": "^6.48.0",
|
|
109
|
+
"pdfjs-dist": "6.2.108",
|
|
109
110
|
"pino": "^10.3.1",
|
|
110
111
|
"pino-pretty": "^13.1.3",
|
|
111
112
|
"proper-lockfile": "^4.1.2",
|
|
@@ -168,14 +169,15 @@
|
|
|
168
169
|
"vitepress": "^1.6.4",
|
|
169
170
|
"vitest": "4.1.5",
|
|
170
171
|
"vue": "^3.5.35",
|
|
171
|
-
"
|
|
172
|
+
"xlsx": "file:web/vendor/xlsx-0.20.3.tgz",
|
|
173
|
+
"@xopcai/gateway-contract": "0.0.0",
|
|
172
174
|
"@xopcai/endpoint-tools-client": "0.0.0",
|
|
173
|
-
"@xopcai/
|
|
175
|
+
"@xopcai/computer-control-contract": "0.1.0",
|
|
174
176
|
"@xopcai/endpoint-tools-protocol": "0.0.0",
|
|
175
|
-
"@xopcai/
|
|
177
|
+
"@xopcai/browser-control-contract": "0.1.0",
|
|
176
178
|
"@xopcai/image-providers": "0.1.0",
|
|
177
|
-
"@xopcai/realtime-
|
|
178
|
-
"@xopcai/realtime-
|
|
179
|
+
"@xopcai/realtime-client": "0.0.0",
|
|
180
|
+
"@xopcai/realtime-protocol": "0.0.0"
|
|
179
181
|
},
|
|
180
182
|
"scripts": {
|
|
181
183
|
"generate:device-tools": "tsx scripts/devices/generate-mobile-tools.mts",
|
|
@@ -242,6 +244,10 @@
|
|
|
242
244
|
"test:startup:gateway:check": "node --import tsx scripts/bench-gateway-startup.ts --runs 2 --warmup 0 --ready-budget-ms 20000",
|
|
243
245
|
"test:startup:imports": "node scripts/check-cli-bootstrap-imports.mjs",
|
|
244
246
|
"eval:coder": "tsx evals/coder/apps/cli/src/main.ts",
|
|
247
|
+
"eval:personal:p0": "tsx scripts/personal-delivery-benchmark.mts",
|
|
248
|
+
"eval:personal:p1": "tsx scripts/personal-delivery-benchmark.mts --suite p1",
|
|
249
|
+
"eval:personal:p2": "tsx scripts/personal-delivery-benchmark.mts --suite p2",
|
|
250
|
+
"eval:personal:live-repair": "tsx scripts/personal-repair-live-benchmark.mts",
|
|
245
251
|
"eval:coder:check": "pnpm -C evals/coder run check",
|
|
246
252
|
"eval:coder:smoke": "pnpm -C evals/coder run smoke",
|
|
247
253
|
"eval:coder:web": "tsx evals/coder/apps/web/src/server.ts",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,l as t,p as n,r,s as i,t as a,u as o}from"./schemas-CObaziC7.js";var s=a([`document`,`spreadsheet`,`presentation`,`pdf`,`image`,`video`,`audio`,`site`,`archive`,`file`]),c=a([`workspace`,`external_host`,`worktree`,`remote_runtime`,`artifact_store`]),l=a([`materializing`,`available`,`expired`,`missing`,`failed`]),u=a([`preview`,`download`,`open`,`import`,`share`,`regenerate`]),d=o({artifactId:n().min(1),sourceFileId:n().min(1).optional(),title:n().min(1),kind:s,mimeType:n().optional(),sizeBytes:t().nonnegative().optional(),availability:l,location:c,capabilities:r(u),uri:n().optional(),workspaceRelativePath:n().optional(),shareUrl:n().url().optional(),thumbnailUrl:n().optional(),expiresAt:n().optional()}),f=o({path:n().min(1),status:a([`added`,`modified`,`deleted`,`renamed`]).optional(),added:t().nonnegative().optional(),removed:t().nonnegative().optional()}),p=o({changeSetId:n().min(1),files:r(f),added:t().nonnegative(),removed:t().nonnegative(),diff:n(),diffTruncated:e().optional(),environment:a([`workspace`,`worktree`,`remote_runtime`])}),m=o({evidenceId:n().min(1),kind:a([`check`,`screenshot`,`video`,`log`]),label:n().min(1),status:a([`passed`,`failed`,`warning`]),durationMs:t().nonnegative().optional(),command:n().optional(),artifactId:n().optional(),revision:n().optional(),logPath:n().optional()}),h=o({version:i(1),outcomeId:n().min(1),runId:n().min(1),turnId:n().min(1),status:a([`succeeded`,`partial`,`failed`]),summary:n().optional(),deliverables:r(d),changeSet:p.optional(),evidence:r(m),createdAt:n()}),g=`xopc-file:`;function _(e){if(!e.startsWith(g))return null;try{return decodeURIComponent(e.slice(10)).trim()||null}catch{return null}}function v(e){let t=new Map(e.map(e=>[e.artifactId,e])),n=new Map,r=e=>e.availability===`available`?e.location===`artifact_store`?2:1:0;for(let e of t.values()){let t=e.sourceFileId??_(e.uri??``),i=t?`source:${t}`:`artifact:${e.artifactId}`,a=n.get(i);(!a||r(e)>=r(a))&&n.set(i,e)}return[...n.values()]}function y(e){let t=h.safeParse(e);return t.success?{...t.data,deliverables:v(t.data.deliverables)}:null}var b=32*1024*1024;export{y as i,h as n,_ as r,b as t};
|