@xopcai/xopc 0.0.276 → 0.0.278
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/feishu/src/adapters/cli-login.js +3 -3
- package/dist/extensions/feishu/src/outbound/media-load.js +2 -2
- package/dist/extensions/telegram/src/inbound-processor.js +2 -2
- package/dist/extensions/telegram/src/outbound-sender.js +1 -1
- package/dist/extensions/telegram/src/plugin.js +2 -2
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/api/api.js +2 -2
- package/dist/extensions/weixin/src/auth/accounts.js +12 -12
- package/dist/extensions/weixin/src/messaging/debug-mode.js +5 -5
- package/dist/extensions/weixin/src/messaging/inbound.js +11 -11
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-sj_1IC5H.js → agent-avatar-dicebear-lRVOwbrK.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-DAqn5DdL.js +1 -0
- package/dist/gateway/static/root/assets/{agents-CIzev0Qj.js → agents-DNQNTDkU.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-oHTY5PDs.js +1 -0
- package/dist/gateway/static/root/assets/{appearance-settings-BeXvF-dZ.js → appearance-settings-B0YnZ3ig.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-Bh0etSmL.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-BSgaIIGE.js → archive-plugin-D4x142le.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CGNt02hP.js → attachment-load-zibD2Hod.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-DoafJiVA.js → automations-page-Dkp7gp_S.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-w4McwueN.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BsAL26Aq.js → binary-plugins-CfUzu1Hc.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BxB7m8aI.js → block-editor-r5nCBBan.js} +3 -3
- package/dist/gateway/static/root/assets/{browser-automation-inputs-DGCqIPXT.js → browser-automation-inputs-DcVLoIzc.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-automations-page-BNsO-Ip2.js → browser-automations-page-BnL4JnTM.js} +2 -2
- package/dist/gateway/static/root/assets/browser-settings-page-DxX-t0EJ.js +8 -0
- package/dist/gateway/static/root/assets/{button-B11EPpor.js → button-BA45yciM.js} +1 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CvacBQAI.js +8 -0
- package/dist/gateway/static/root/assets/channels-settings-CJzSNo-L.js +1 -0
- package/dist/gateway/static/root/assets/{chat-terminal-dock-ZCFwco1W.js → chat-terminal-dock-CWVnJtBp.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-DNBhBT0b.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-C26e13YU.js → cron-expression-CjrWuy2m.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-CpxFfgpg.js → date-picker-XjPSlgq_.js} +1 -1
- package/dist/gateway/static/root/assets/{dependency-picker-eCIGAfHa.js → dependency-picker-CkyfEP88.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-_MSZvIDO.js → desktop-pet-BAE_NVx5.js} +1 -1
- package/dist/gateway/static/root/assets/{desktop-pet-settings-feBnJWkV.js → desktop-pet-settings-BUw6V2R9.js} +1 -1
- package/dist/gateway/static/root/assets/device-pairing-wizard-DsR5NQEC.js +1 -0
- package/dist/gateway/static/root/assets/{dist-CpzYSoz7.js → dist-BGTk37IG.js} +1 -1
- package/dist/gateway/static/root/assets/{dist-DBS3OB8K.js → dist-CI_fqRk-.js} +1 -1
- package/dist/gateway/static/root/assets/{dist-DLmwHyAh.js → dist-Che_jiQF.js} +1 -1
- package/dist/gateway/static/root/assets/es2015-DBLcMg5B.js +41 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CotBlxJ-.js → extension-debug-page-giBeIVUT.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-CFBmQ7U3.js → extension-page-Bqo9bNtx.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-Cd1lfh8z.js → extension-settings-page-BX-6AA3k.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dil7vuyU.js +1 -0
- package/dist/gateway/static/root/assets/{heartbeat-settings-DRG0u1ON.js → heartbeat-settings-DWFAopk_.js} +1 -1
- package/dist/gateway/static/root/assets/home-page-Dpeuvazg.js +1 -0
- package/dist/gateway/static/root/assets/index-B03HGpzt.js +74 -0
- package/dist/gateway/static/root/assets/index-CXF9-BpI.css +2 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-BLHsdFIQ.js → keyboard-shortcuts-settings-BKGPpBnV.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-CBtemxFc.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BjAj1xhq.js → local-apps-page-B06ToOxB.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DibI1GsP.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-CPHxDaOw.js → management-settings-DJ6yMZCd.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-B2IR4E2r.js → markdown-view-DF3aJP_5.js} +4 -4
- package/dist/gateway/static/root/assets/{media-plugins-BUOzcXCL.js → media-plugins-CdrLNAks.js} +1 -1
- package/dist/gateway/static/root/assets/note-detail-panel-GOxomxOK.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-CQBgk3_x.js +8 -0
- package/dist/gateway/static/root/assets/{page-tabs-BgEYFhqS.js → page-tabs-B7LA4z-x.js} +1 -1
- package/dist/gateway/static/root/assets/popover-select-DGmMQt4t.js +1 -0
- package/dist/gateway/static/root/assets/{preview-open-alternatives-C-pQIx6W.js → preview-open-alternatives-DTQRN7WR.js} +1 -1
- package/dist/gateway/static/root/assets/proactive-card-BF3741px.js +1 -0
- package/dist/gateway/static/root/assets/proactive-page-1EM217v0.js +1 -0
- package/dist/gateway/static/root/assets/product-open-page-BazdmFYo.js +1 -0
- package/dist/gateway/static/root/assets/project-detail-page-B1Pm-fQd.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-DUrxyNR9.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-C6VzHUwx.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-DkAjFJ-9.js → runtime-tools-settings-panel-D-DZf4I1.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-BpDcuSsl.js → schema-form-B-Yj9DVW.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-DtemHfkv.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-ByEVQe0c.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-RElRijJw.js → settings-form-section-BxPUqwY6.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-CaixunoA.js → settings-page-zLn8lIrs.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BwIrk3Jx.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-CC-bFOTf.js → share-preview-page-DAc_FkVc.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-Dwdv6QyS.js +1 -0
- package/dist/gateway/static/root/assets/{skill-reload-api-CcOtxf53.js → skill-reload-api-CDzQWN60.js} +1 -1
- package/dist/gateway/static/root/assets/{skills-page-DmRvRxtY.js → skills-page-CO5XVkbY.js} +1 -1
- package/dist/gateway/static/root/assets/skills-page.utils-BR5bk2vT.js +1 -0
- package/dist/gateway/static/root/assets/{system-settings-panel-DRIJ5mXq.js → system-settings-panel-C0ptJutB.js} +1 -1
- package/dist/gateway/static/root/assets/task-detail-page-DOjcKOzQ.js +1 -0
- package/dist/gateway/static/root/assets/tunnel-api-BABuQvGD.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-Cq4--C1i.js → use-autosave-Dc5aN2px.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-UhsSP_pC.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CbJ6tKGI.js → voice-api-key-field-CY0DpJui.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-Brg9yJBr.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-vw1229Fh.js → workflow-run-setup-panel-D3fq7boB.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-S7XXNBWa.js +6 -0
- package/dist/gateway/static/root/index.html +9 -9
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +6 -1
- package/dist/src/agent/agent-manager.js +17 -17
- package/dist/src/agent/agent-scope.js +2 -2
- package/dist/src/agent/background-review/run-background-review.js +4 -4
- package/dist/src/agent/commands/command-isolation.d.ts +1 -0
- package/dist/src/agent/commands/command-isolation.js +17 -1
- package/dist/src/agent/commands/commandMounts.d.ts +2 -0
- package/dist/src/agent/commands/commandMounts.js +32 -0
- package/dist/src/agent/context/coordinator.js +3 -3
- package/dist/src/agent/context/execution-context.js +4 -4
- package/dist/src/agent/context/execution-scope.js +2 -2
- package/dist/src/agent/context/project-context.js +4 -4
- package/dist/src/agent/embedded/index.js +2 -2
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +5 -5
- package/dist/src/agent/embedded/run-turn.js +2 -2
- package/dist/src/agent/embedded/session-tool-result-guard.js +3 -3
- package/dist/src/agent/external-tools/composio-provider.js +1 -1
- package/dist/src/agent/external-tools/gateway-tools.js +1 -1
- package/dist/src/agent/external-tools/mcp-provider.js +2 -2
- package/dist/src/agent/image/generation/openai-images-provider.js +1 -1
- package/dist/src/agent/image/generation/providers/dashscope.js +1 -1
- package/dist/src/agent/image/generation/providers/fal.js +1 -1
- package/dist/src/agent/image/generation/providers/google.js +1 -1
- package/dist/src/agent/image/generation/runtime.js +1 -1
- package/dist/src/agent/image/index.js +1 -1
- package/dist/src/agent/image/load-image-media.js +1 -1
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/attachment-pipeline.js +1 -1
- package/dist/src/agent/inbound/inbound-loop.js +2 -2
- package/dist/src/agent/index.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-gateway.js +1 -1
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +2 -2
- package/dist/src/agent/mcp/index.js +2 -2
- package/dist/src/agent/mcp/mcp-transport.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-manager.js +1 -1
- package/dist/src/agent/mcp/oauth/mcp-oauth-store.js +1 -1
- package/dist/src/agent/memory/index.js +2 -2
- package/dist/src/agent/messaging/outbound-coordinator.js +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +5 -5
- package/dist/src/agent/prompt/service-prompt-builder.js +2 -2
- package/dist/src/agent/sandbox/command-validator.js +0 -20
- package/dist/src/agent/sandbox/exec-policy.d.ts +1 -0
- package/dist/src/agent/sandbox/exec-policy.js +3 -3
- package/dist/src/agent/sandbox/fileAccess.d.ts +7 -0
- package/dist/src/agent/sandbox/fileAccess.js +100 -0
- package/dist/src/agent/sandbox/path-policy.d.ts +2 -0
- package/dist/src/agent/sandbox/path-policy.js +54 -17
- package/dist/src/agent/sandbox/sanitize-env-vars.js +10 -9
- package/dist/src/agent/service/direct-turn-helpers.js +6 -6
- package/dist/src/agent/service/process-direct-one-shot.js +1 -1
- package/dist/src/agent/service/process-direct-streaming.js +5 -5
- package/dist/src/agent/service/webchat-tts.js +2 -2
- package/dist/src/agent/service.js +19 -19
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/filesystem-watcher.js +1 -1
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/hub-pull.js +3 -3
- package/dist/src/agent/skills/marketplace/adapters/store/adapter.js +1 -1
- package/dist/src/agent/skills/marketplace/adapters/store/store-api-client.js +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +5 -5
- package/dist/src/agent/tools/apply-patch.js +25 -38
- package/dist/src/agent/tools/create-share-tool.js +13 -5
- package/dist/src/agent/tools/delegate-tool.js +3 -3
- package/dist/src/agent/tools/exec-command.js +2 -1
- package/dist/src/agent/tools/executor.js +1 -1
- package/dist/src/agent/tools/factory.js +13 -13
- package/dist/src/agent/tools/find.js +5 -3
- package/dist/src/agent/tools/grep.js +21 -4
- package/dist/src/agent/tools/image-generate-tool.js +5 -6
- package/dist/src/agent/tools/index.js +5 -5
- package/dist/src/agent/tools/list-dir.js +2 -1
- package/dist/src/agent/tools/managed-job-tool.js +1 -0
- package/dist/src/agent/tools/publish-artifacts.js +4 -3
- package/dist/src/agent/tools/read.js +9 -6
- package/dist/src/agent/tools/repository-search.d.ts +2 -0
- package/dist/src/agent/tools/repository-search.js +51 -7
- package/dist/src/agent/tools/review-workspace.js +76 -10
- package/dist/src/agent/tools/send-media.js +5 -4
- package/dist/src/agent/tools/skills-tools.js +1 -1
- package/dist/src/agent/tools/tool-paths.js +3 -1
- package/dist/src/agent/tools/tts-tool.js +1 -1
- package/dist/src/agent/tools/user-context-tool.js +1 -1
- package/dist/src/agent/tools/write.js +6 -19
- package/dist/src/agent/tools/xopc-use-tool.js +6 -6
- package/dist/src/agent/workflow/subagent-runner.js +1 -1
- package/dist/src/agent-config/schema.d.ts +24 -0
- package/dist/src/agent-config/schema.js +2 -1
- package/dist/src/ai-assist/text-assist.js +1 -1
- package/dist/src/auth/credentials.js +2 -2
- package/dist/src/auth/oauth/xopc-cloud.js +1 -1
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/capabilities/store-connector.js +1 -1
- package/dist/src/channels/attachments/voice-stt-webchat.js +2 -2
- package/dist/src/channels/index.js +2 -2
- package/dist/src/channels/outbound-sender.js +1 -1
- package/dist/src/channels/pairing/allow-from-file.js +9 -9
- package/dist/src/channels/pairing/pairing-store.js +6 -6
- package/dist/src/chat-commands/builtins/config.js +2 -2
- package/dist/src/chat-commands/builtins/review.js +1 -1
- package/dist/src/chat-commands/builtins/session.js +1 -1
- package/dist/src/chat-commands/builtins/thinking.js +1 -1
- package/dist/src/chat-commands/builtins/tts.js +1 -1
- package/dist/src/chat-commands/builtins/understanding.js +1 -1
- package/dist/src/chat-commands/builtins/workflow.js +2 -2
- package/dist/src/chat-commands/context.js +2 -2
- package/dist/src/chat-commands/index.js +3 -3
- package/dist/src/cli/commands/agent.js +6 -6
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/channels.js +1 -1
- package/dist/src/cli/commands/config.js +1 -1
- package/dist/src/cli/commands/connectors.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +21 -20
- package/dist/src/cli/commands/extension-dev.js +1 -1
- package/dist/src/cli/commands/extension-marketplace.js +2 -2
- package/dist/src/cli/commands/extension.js +1 -1
- package/dist/src/cli/commands/gateway/shared.js +1 -1
- package/dist/src/cli/commands/gateway/token.js +1 -1
- package/dist/src/cli/commands/image.js +1 -1
- package/dist/src/cli/commands/init.js +1 -1
- package/dist/src/cli/commands/models.js +2 -2
- package/dist/src/cli/commands/onboard.js +2 -2
- package/dist/src/cli/commands/project.js +2 -2
- package/dist/src/cli/commands/runtime.js +1 -1
- package/dist/src/cli/commands/skills.js +2 -2
- package/dist/src/cli/commands/tui.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -3
- package/dist/src/cli/extension-cli-register.js +4 -4
- package/dist/src/cli/utils/gateway-client.js +1 -1
- package/dist/src/config/index.js +5 -5
- package/dist/src/config/loader.js +2 -2
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +16 -0
- package/dist/src/connectors/connected-source-understanding.js +2 -2
- package/dist/src/connectors/connection-recovery-service.js +3 -3
- package/dist/src/discussions/live-worker.js +1 -1
- package/dist/src/discussions/sealer.js +1 -1
- package/dist/src/extensions/api.js +3 -3
- package/dist/src/extensions/bundled-extension-activation.js +1 -1
- package/dist/src/extensions/index.js +1 -1
- package/dist/src/extensions/loader.js +1 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/index.js +1 -1
- package/dist/src/extensions/update.js +1 -1
- package/dist/src/gateway/agents-admin.js +4 -4
- package/dist/src/gateway/device-routes.js +2 -2
- package/dist/src/gateway/file-path-classifier.js +2 -2
- package/dist/src/gateway/hono/app.js +3 -3
- package/dist/src/gateway/hono/lib/config-payload.d.ts +1 -0
- package/dist/src/gateway/hono/lib/config-payload.js +3 -3
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/auth-registry-extensions.js +2 -2
- package/dist/src/gateway/hono/routes/browser.js +1 -1
- package/dist/src/gateway/hono/routes/commands-skills.js +3 -3
- package/dist/src/gateway/hono/routes/config-patch/gateway.js +1 -1
- package/dist/src/gateway/hono/routes/mcp.js +2 -2
- package/dist/src/gateway/hono/routes/media.js +1 -1
- package/dist/src/gateway/hono/routes/models.js +5 -5
- package/dist/src/gateway/hono/routes/notes.js +1 -1
- package/dist/src/gateway/hono/routes/proactive-control.js +4 -4
- package/dist/src/gateway/hono/routes/projects.js +2 -2
- package/dist/src/gateway/hono/routes/sessions.js +1 -1
- package/dist/src/gateway/hono/routes/shares.js +25 -4
- package/dist/src/gateway/hono/routes/site-shares.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +1 -1
- package/dist/src/gateway/hono/routes/tasks.js +10 -3
- package/dist/src/gateway/hono/routes/user-model.js +4 -4
- package/dist/src/gateway/hono/routes/voice.js +3 -3
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/image-generation-setup.js +1 -1
- package/dist/src/gateway/lock.js +10 -10
- package/dist/src/gateway/media-access.js +2 -2
- package/dist/src/gateway/ports.js +6 -6
- package/dist/src/gateway/server.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +4 -4
- package/dist/src/gateway/service/marketplace-service.js +3 -3
- package/dist/src/gateway/service/run-gateway-agent.js +3 -3
- package/dist/src/gateway/service.js +31 -31
- package/dist/src/gateway/session-context-summary.js +2 -2
- package/dist/src/gateway/workspace-editor-path.js +2 -2
- package/dist/src/infra/gateway-processes.js +2 -2
- package/dist/src/infra/path-env.js +3 -3
- package/dist/src/infra/update-global.js +10 -10
- package/dist/src/infra/update-runner.js +1 -1
- package/dist/src/local-apps/service.js +1 -1
- package/dist/src/media-shared/http/ssrf-guard.js +1 -1
- package/dist/src/notes/agent-context.js +3 -3
- package/dist/src/notes/service.js +3 -2
- package/dist/src/proactive/actions/service.js +1 -1
- package/dist/src/proactive/execution/agent-executor.js +1 -1
- package/dist/src/proactive/execution/context.js +1 -1
- package/dist/src/proactive/execution/worker.js +1 -1
- package/dist/src/proactive/experience.js +7 -2
- package/dist/src/proactive/follow-ups.js +1 -1
- package/dist/src/proactive/inbox/cards.js +2 -2
- package/dist/src/proactive/inbox/delivery.js +2 -2
- package/dist/src/proactive/inbox/digest.js +2 -2
- package/dist/src/proactive/inbox/notification-policy.js +1 -1
- package/dist/src/proactive/inbox/repository.js +1 -1
- package/dist/src/proactive/inbox/service.js +1 -1
- package/dist/src/proactive/index.js +1 -1
- package/dist/src/proactive/temporal/worker.js +1 -1
- package/dist/src/projects/project-skill-service.js +2 -2
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-reference-auditor.js +1 -1
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/remote-access/exposure-manager.js +1 -1
- package/dist/src/session/index.js +2 -2
- package/dist/src/session/session-title.js +1 -1
- package/dist/src/session/store.js +3 -3
- package/dist/src/session/thinking-resolve.js +1 -1
- package/dist/src/share/share-store.js +6 -2
- package/dist/src/share/share-thumbnail.js +1 -1
- package/dist/src/share/site-share-store.js +1 -1
- package/dist/src/storage/sqlite/connection.js +9 -9
- package/dist/src/tasks/execution-context.js +1 -1
- package/dist/src/tasks/home-query-service.js +4 -3
- package/dist/src/tasks/index.js +3 -3
- package/dist/src/tasks/project-operating-view-service.js +7 -4
- package/dist/src/tasks/task-application-service.js +109 -5
- package/dist/src/tasks/task-context-assembler.js +8 -4
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-read-model-projector.js +7 -5
- package/dist/src/tasks/task-run-coordinator.js +3 -1
- package/dist/src/tasks/task-run-repository.js +4 -1
- package/dist/src/tui/backends/embedded-backend.js +9 -9
- package/dist/src/tui/backends/gateway-realtime-backend.js +2 -2
- package/dist/src/tui/extension-host/load-extensions.js +1 -1
- package/dist/src/tui/tui-command-formatters.js +1 -1
- package/dist/src/tui/tui-commands.js +5 -5
- package/dist/src/tui/tui-picker-overlay.js +1 -1
- package/dist/src/tui/tui-skills-autocomplete.js +1 -1
- package/dist/src/tui/tui-startup-resources.js +5 -5
- package/dist/src/tui/tui.js +3 -3
- package/dist/src/tunnel/gateway-lifecycle.js +1 -1
- package/dist/src/voice/local/runtime-worker.js +1 -1
- package/dist/src/voice/realtime/memory-context.js +3 -3
- package/dist/src/voice/stt/index.js +2 -2
- package/dist/src/voice/stt/preflight.js +1 -1
- package/dist/src/voice/stt/providers/local-transcription.js +1 -1
- package/dist/src/voice/stt/transcribe-core.js +1 -1
- package/dist/src/voice/tts/index.js +3 -3
- package/dist/src/voice/tts/merge-config.js +1 -1
- package/dist/src/voice/tts/payload.js +1 -1
- package/dist/src/voice/tts/speak-core.js +1 -1
- package/dist/src/work-discovery/service.js +3 -3
- package/dist/src/workflows/context/workflow-context.js +1 -1
- package/dist/src/workflows/service/workflow-run-service.js +6 -6
- package/dist/src/workflows/service/workflow-session-bridge.js +1 -1
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-B5MRLEy8.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-DY3Vwxjq.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-Ch_9Ffgk.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-MACr99IO.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-Nvdoi0B1.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BluLJq5I.js +0 -8
- package/dist/gateway/static/root/assets/channels-settings-DYxxhcjb.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-Bpcp8UyE.js +0 -2
- package/dist/gateway/static/root/assets/device-pairing-wizard-D_fB0fml.js +0 -1
- package/dist/gateway/static/root/assets/es2015-BvLh9GaE.js +0 -41
- package/dist/gateway/static/root/assets/gateway-settings-BH35C8RI.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BlZk-aD4.js +0 -1
- package/dist/gateway/static/root/assets/index-CfQor-TM.js +0 -74
- package/dist/gateway/static/root/assets/index-DKy1Qn1_.css +0 -2
- package/dist/gateway/static/root/assets/local-app-workbench-page-DJd71FlC.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-5MWeZ6Ae.js +0 -2
- package/dist/gateway/static/root/assets/note-detail-panel-Bch98ut3.js +0 -5
- package/dist/gateway/static/root/assets/notes-page-CWO5dQKN.js +0 -8
- package/dist/gateway/static/root/assets/popover-select-Dz_Qis2R.js +0 -1
- package/dist/gateway/static/root/assets/proactive-card-DfjMVJUW.js +0 -1
- package/dist/gateway/static/root/assets/proactive-page-BGVcVsbd.js +0 -1
- package/dist/gateway/static/root/assets/product-open-page-DsQcgZkI.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DZFVirjV.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-B2g6inq-.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CbkUOkQY.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page--7-w-0WS.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BvZrH_sp.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-Ul06Y5YX.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DwV2Wh7S.js +0 -1
- package/dist/gateway/static/root/assets/skills-page.utils-CT0-daZD.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-BQjLHqSk.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-IvWcgZdD.js +0 -1
- package/dist/gateway/static/root/assets/user-model-page-hwc5-nqV.js +0 -2
- package/dist/gateway/static/root/assets/work-discovery-overlay-BG2pmXL3.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-DZWpJHDr.js +0 -6
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_paths, resolveBundledSkillsDir } from "../config/paths.js";
|
|
2
|
-
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "../agent/skills/workspace-skills-dir.js";
|
|
3
|
-
import { loadSkills, loadWorkspaceSkillInventory } from "../agent/skills/index.js";
|
|
4
2
|
import { removeSkillsLockEntry } from "../agent/skills/hub-lock.js";
|
|
5
3
|
import { deleteManagedSkill, installSkillFromZip, isValidSkillId } from "../agent/skills/managed-store.js";
|
|
4
|
+
import { resolveWorkspaceSkillsDir, resolveWorkspaceSkillsLockPath } from "../agent/skills/workspace-skills-dir.js";
|
|
5
|
+
import { loadSkills, loadWorkspaceSkillInventory } from "../agent/skills/index.js";
|
|
6
6
|
import { pullSkillFromSource } from "../agent/skills/hub-pull.js";
|
|
7
7
|
import { downloadFromMarketplace } from "../agent/skills/skills-marketplace.js";
|
|
8
8
|
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
2
1
|
import { getApiKeyFromEnv, init_env_keys } from "../env-keys.js";
|
|
2
|
+
import { init_sync_provider_auth, resolveProviderApiKeyForAgentSync } from "../../auth/sync-provider-auth.js";
|
|
3
3
|
import { getDefaultAuthProfileStore } from "./auth-profile-store.js";
|
|
4
4
|
//#region src/providers/auth-runtime/resolve-auth.ts
|
|
5
5
|
init_env_keys();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { __esmMin, __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
3
|
-
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
4
|
-
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
5
3
|
import { PROVIDER_ENV_MAP, getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
6
4
|
import { init_model_ref, splitProviderModelRef } from "./model-ref.js";
|
|
7
5
|
import { ModelRegistry, getModelRegistry, init_model_registry, prewarmModelRegistry, resetModelRegistry } from "./model-registry.js";
|
|
6
|
+
import { getModelOAuthProviderIds, init_registry } from "../auth/oauth/registry.js";
|
|
8
7
|
import { CredentialResolver, hasCredentials, init_credentials } from "../auth/credentials.js";
|
|
8
|
+
import { hasProviderAuthOnDiskSync, init_sync_provider_auth } from "../auth/sync-provider-auth.js";
|
|
9
9
|
import { EXTENSION_PROVIDER_BASE_URL, init_constants } from "./constants.js";
|
|
10
10
|
import { applyOfficialModelMetadataCorrections, getSupplementalModels, init_model_supplements } from "./model-supplements.js";
|
|
11
11
|
import { getProviderRegistry, init_plugin_registry } from "./plugin-registry.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
2
2
|
import { getModelRegistry, init_model_registry } from "./model-registry.js";
|
|
3
|
-
import { parseImageGenerationModelRef } from "../agent/image/generation/model-ref.js";
|
|
4
3
|
import { getImageGenerationProvider } from "../agent/image/generation/provider-registry.js";
|
|
4
|
+
import { parseImageGenerationModelRef } from "../agent/image/generation/model-ref.js";
|
|
5
5
|
//#region src/providers/model-reference-auditor.ts
|
|
6
6
|
init_model_catalog_store();
|
|
7
7
|
init_model_registry();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
|
-
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
5
4
|
import { init_resolve_config_value, resolveConfigValue, resolveHeaders } from "../config/resolve-config-value.js";
|
|
5
|
+
import { resolveModelsJsonPath } from "../config/paths.js";
|
|
6
6
|
import { getDefaultModelValues, init_models_json, validateModelsConfig } from "../config/models-json.js";
|
|
7
7
|
import { getApiKeyFromEnv, init_env_keys } from "./env-keys.js";
|
|
8
8
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
-
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
3
2
|
import { getModelCatalogStore, init_model_catalog_store } from "./model-catalog-store.js";
|
|
3
|
+
import { getOAuthProviderDefinition, init_registry } from "../auth/oauth/registry.js";
|
|
4
4
|
import { XOPC_CLOUD_PROVIDER_ID, init_xopc_cloud_config, resolveXopcModelRouterUrl } from "./xopc-cloud-config.js";
|
|
5
5
|
//#region src/providers/register-runtime-providers.ts
|
|
6
6
|
function registerRuntimeProvider(modelRuntime, source) {
|
|
@@ -2,9 +2,9 @@ import { createLogger } from "../utils/logger/index.js";
|
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
3
|
import { isTailscaleInstalled } from "../infra/tailscale.js";
|
|
4
4
|
import { resolveGatewayBindMode } from "../config/gateway-bind.js";
|
|
5
|
-
import { getTunnelService } from "../tunnel/tunnel-service.js";
|
|
6
5
|
import { collectExposureConflicts } from "./exposure-guards.js";
|
|
7
6
|
import { getTailscaleExposureState, maybeStartTailscaleFromConfig, stopTailscaleExposure } from "../gateway/tailscale-lifecycle.js";
|
|
7
|
+
import { getTunnelService } from "../tunnel/tunnel-service.js";
|
|
8
8
|
import { getTunnelConsentState } from "../tunnel/consent.js";
|
|
9
9
|
import { maybeAutoStartTunnelFromConfig } from "../tunnel/gateway-lifecycle.js";
|
|
10
10
|
//#region src/remote-access/exposure-manager.ts
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { buildSessionContextForLlm, isTranscriptContextEntry, mergeLlmMessagesPreservingContextRows, transcriptRowsFromJsonArray } from "./session-context-for-llm.js";
|
|
2
2
|
import { SessionStatus } from "./types.js";
|
|
3
3
|
import { effectiveWorkspacePathForSession, normalizeWorkingDirectoryInput, projectWorkspacePath } from "./session-workspace.js";
|
|
4
|
-
import { flattenMessageContent, messagesToClientHistory } from "./client-history.js";
|
|
5
|
-
import { emitSessionTranscriptUpdate, onSessionTranscriptUpdate } from "./transcript-events.js";
|
|
6
4
|
import { fallbackTitleFromMessages, generateSessionTitleFromMessages, getSessionTitleSource, isWebchatSessionKey, maybeRefineSessionTitleWithLlm, maybeSetProvisionalSessionTitle, provisionalTitleFromUserText, sanitizeGeneratedSessionTitle, sanitizeSessionTitle, shouldAutoTitleSessionKey, shouldRefineSessionTitleWithLlm } from "./session-title.js";
|
|
5
|
+
import { flattenMessageContent, messagesToClientHistory } from "./client-history.js";
|
|
7
6
|
import { SessionStore } from "./store.js";
|
|
8
7
|
import { applySessionPatchToMetadata } from "./patch-metadata.js";
|
|
9
8
|
import { SessionIndex } from "./manager.js";
|
|
9
|
+
import { emitSessionTranscriptUpdate, onSessionTranscriptUpdate } from "./transcript-events.js";
|
|
10
10
|
import { SessionConfigStore, resolveReasoningLevel, resolveThinkingLevel, resolveVerboseLevel } from "./config-store.js";
|
|
11
11
|
import { DEFAULT_ACTIVITY_DETAIL_LEVEL, resolveConfiguredActivityDetailDefault, resolveEffectiveReasoningLevel, resolveEffectiveThinkingLevel } from "./thinking-resolve.js";
|
|
12
12
|
import { DEFAULT_IDLE_MINUTES, DEFAULT_RESET_AT_HOUR, DEFAULT_RESET_MODE, evaluateSessionFreshness, resolveDailyResetAtMs, resolveSessionResetPolicy } from "./reset-policy.js";
|
|
@@ -4,8 +4,8 @@ import { isCronSessionKey } from "../routing/session-key-utils.js";
|
|
|
4
4
|
import { init_session_key, parseSessionKey } from "../routing/session-key.js";
|
|
5
5
|
import { init_providers, resolveModel } from "../providers/index.js";
|
|
6
6
|
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
7
|
-
import { readAgentMessageContent } from "../agent/memory/agent-message-access.js";
|
|
8
7
|
import { stripRuntimeContextFromUserMessage } from "./user-message-display.js";
|
|
8
|
+
import { readAgentMessageContent } from "../agent/memory/agent-message-access.js";
|
|
9
9
|
//#region src/session/session-title.ts
|
|
10
10
|
init_session_key();
|
|
11
11
|
init_providers();
|
|
@@ -12,14 +12,14 @@ import { appendCompactionBoundaryIfUnchanged, appendTranscriptEntry, listCompact
|
|
|
12
12
|
import { getSessionConfig, setSessionConfig } from "../storage/sqlite/config-repository.js";
|
|
13
13
|
import "../storage/sqlite/index.js";
|
|
14
14
|
import { resolveEffectiveAgentProfileForSession } from "../config/agent-profile.js";
|
|
15
|
-
import { transcriptRowsToClientHistory } from "./client-history.js";
|
|
16
|
-
import { SessionCompactor } from "../agent/memory/compaction.js";
|
|
17
|
-
import { resolveUserContextSessionAccess } from "../user-context/access-policy.js";
|
|
18
15
|
import { readPostCompactionContext } from "../agent/reply/post-compaction-context.js";
|
|
16
|
+
import { SessionCompactor } from "../agent/memory/compaction.js";
|
|
19
17
|
import { resolveCompactionPolicy } from "../agent/memory/compaction-policy.js";
|
|
20
18
|
import { promoteCompactionLedger } from "../agent/memory/compaction-promotion.js";
|
|
19
|
+
import { resolveUserContextSessionAccess } from "../user-context/access-policy.js";
|
|
21
20
|
import { SlidingWindow } from "../agent/memory/window.js";
|
|
22
21
|
import { isAppendOnlyLlmTranscriptMessage } from "./transcript-stats.js";
|
|
22
|
+
import { transcriptRowsToClientHistory } from "./client-history.js";
|
|
23
23
|
import { backfillStructuredTurnOutcomes } from "./turn-outcome-projector.js";
|
|
24
24
|
import { computeTranscriptUserRoundDeleteRange } from "./user-round-delete.js";
|
|
25
25
|
//#region src/session/store.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveReasoningLevel, resolveThinkingLevel } from "./config-store.js";
|
|
2
1
|
import { normalizeThinkLevel } from "../agent/transcript/thinking-types.js";
|
|
2
|
+
import { resolveReasoningLevel, resolveThinkingLevel } from "./config-store.js";
|
|
3
3
|
//#region src/session/thinking-resolve.ts
|
|
4
4
|
const FALLBACK = "medium";
|
|
5
5
|
/**
|
|
@@ -5,8 +5,8 @@ import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
|
5
5
|
import { runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
6
6
|
import { init_paths } from "../config/paths.js";
|
|
7
7
|
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
8
|
-
import { SHARE_CONFIG_DEFAULTS } from "./share-types.js";
|
|
9
8
|
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
9
|
+
import { SHARE_CONFIG_DEFAULTS } from "./share-types.js";
|
|
10
10
|
import { logShareAudit } from "./share-audit.js";
|
|
11
11
|
import { join, relative, resolve } from "node:path";
|
|
12
12
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -588,7 +588,11 @@ var ShareStore = class {
|
|
|
588
588
|
return runSqliteWriteTransaction(() => {
|
|
589
589
|
const record = this.shares.get(id);
|
|
590
590
|
if (!record) return null;
|
|
591
|
-
if (patch.extendTtlMs !== void 0)
|
|
591
|
+
if (patch.extendTtlMs !== void 0) {
|
|
592
|
+
if (record.revoked) throw new Error("Revoked shares cannot be renewed");
|
|
593
|
+
if (!Number.isFinite(patch.extendTtlMs) || patch.extendTtlMs < 6e4 || patch.extendTtlMs > this.config.maxTtlMs) throw new Error("Share duration is outside the configured limits");
|
|
594
|
+
record.expiresAt = new Date(Date.now() + patch.extendTtlMs).toISOString();
|
|
595
|
+
}
|
|
592
596
|
if (patch.maxViews !== void 0) record.maxViews = patch.maxViews;
|
|
593
597
|
this.shares.set(record.id, record);
|
|
594
598
|
logShareAudit("share.update", {
|
|
@@ -2,9 +2,9 @@ import { resolveStateDir } from "../config/paths-state.js";
|
|
|
2
2
|
import { createLogger } from "../utils/logger/index.js";
|
|
3
3
|
import { init_logger } from "../utils/logger.js";
|
|
4
4
|
import { init_paths } from "../config/paths.js";
|
|
5
|
+
import { loadPlaywrightCoreModule } from "../browser/providers/playwright-doctor.js";
|
|
5
6
|
import { getShareStore } from "./share-store.js";
|
|
6
7
|
import { getSiteShareStore } from "./site-share-store.js";
|
|
7
|
-
import { loadPlaywrightCoreModule } from "../browser/providers/playwright-doctor.js";
|
|
8
8
|
import { join } from "node:path";
|
|
9
9
|
import { mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
10
10
|
//#region src/share/share-thumbnail.ts
|
|
@@ -3,8 +3,8 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { requireXopcDatabase } from "../storage/sqlite/connection.js";
|
|
4
4
|
import { runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
5
5
|
import { DurableState } from "../storage/sqlite/durable-state.js";
|
|
6
|
-
import { SITE_SHARE_CONFIG_DEFAULTS } from "./site-share-types.js";
|
|
7
6
|
import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
7
|
+
import { SITE_SHARE_CONFIG_DEFAULTS } from "./site-share-types.js";
|
|
8
8
|
import { relative, resolve } from "node:path";
|
|
9
9
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
10
10
|
import { lstat, readdir, realpath, stat } from "node:fs/promises";
|
|
@@ -5,7 +5,7 @@ import { ensureXopcDatabaseSchema } from "./schema.js";
|
|
|
5
5
|
import { requireNodeSqlite } from "../../infra/node-sqlite.js";
|
|
6
6
|
import { installSqliteTransientRejectionHandler } from "../../infra/unhandled-rejections.js";
|
|
7
7
|
import path from "node:path";
|
|
8
|
-
import
|
|
8
|
+
import fsSync from "node:fs";
|
|
9
9
|
import childProcess from "node:child_process";
|
|
10
10
|
//#region src/storage/sqlite/connection.ts
|
|
11
11
|
init_logger();
|
|
@@ -28,7 +28,7 @@ function normalizeNonNegativeInteger(value, label) {
|
|
|
28
28
|
function findExistingVolumePath(targetPath) {
|
|
29
29
|
let current = path.resolve(targetPath);
|
|
30
30
|
while (true) try {
|
|
31
|
-
return
|
|
31
|
+
return fsSync.statSync(current).isDirectory() ? current : path.dirname(current);
|
|
32
32
|
} catch {
|
|
33
33
|
const parent = path.dirname(current);
|
|
34
34
|
if (parent === current) return null;
|
|
@@ -75,7 +75,7 @@ function parseMountCommandEntries(contents) {
|
|
|
75
75
|
}
|
|
76
76
|
function readMountEntries() {
|
|
77
77
|
try {
|
|
78
|
-
return parseProcMountInfoEntries(
|
|
78
|
+
return parseProcMountInfoEntries(fsSync.readFileSync(PROC_MOUNTINFO_PATH, "utf8"));
|
|
79
79
|
} catch {}
|
|
80
80
|
try {
|
|
81
81
|
return parseMountCommandEntries(String(childProcess.execFileSync("mount", [])));
|
|
@@ -102,7 +102,7 @@ function isNetworkMountEntryPath(targetPath) {
|
|
|
102
102
|
return mountEntry ? isNetworkMountType(mountEntry.fsType) : false;
|
|
103
103
|
}
|
|
104
104
|
function isNetworkBackedPath(targetPath) {
|
|
105
|
-
if (typeof
|
|
105
|
+
if (typeof fsSync.statfsSync !== "function") return isNetworkMountEntryPath(targetPath);
|
|
106
106
|
const checkedPath = findExistingVolumePath(targetPath);
|
|
107
107
|
if (!checkedPath) return false;
|
|
108
108
|
try {
|
|
@@ -111,7 +111,7 @@ function isNetworkBackedPath(targetPath) {
|
|
|
111
111
|
4283649346,
|
|
112
112
|
4266872130,
|
|
113
113
|
20859
|
|
114
|
-
].includes(
|
|
114
|
+
].includes(fsSync.statfsSync(checkedPath).type >>> 0)) return true;
|
|
115
115
|
} catch {
|
|
116
116
|
return isNetworkMountEntryPath(checkedPath);
|
|
117
117
|
}
|
|
@@ -156,13 +156,13 @@ let cachedDatabase = null;
|
|
|
156
156
|
function ensureDatabasePermissions(pathname) {
|
|
157
157
|
const dir = pathname.slice(0, Math.max(pathname.lastIndexOf("/"), pathname.lastIndexOf("\\")));
|
|
158
158
|
if (dir) {
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
fsSync.mkdirSync(dir, { recursive: true });
|
|
160
|
+
fsSync.chmodSync(dir, DB_DIR_MODE);
|
|
161
161
|
}
|
|
162
162
|
for (const suffix of DB_SIDECAR_SUFFIXES) {
|
|
163
163
|
const candidate = `${pathname}${suffix}`;
|
|
164
|
-
if (!
|
|
165
|
-
|
|
164
|
+
if (!fsSync.existsSync(candidate)) continue;
|
|
165
|
+
fsSync.chmodSync(candidate, DB_FILE_MODE);
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
function openDatabaseAtPath(pathname) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
2
|
import "../storage/sqlite/index.js";
|
|
3
|
-
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
4
3
|
import { getExecutionEnvironmentForSession } from "../execution-environments/subject.js";
|
|
4
|
+
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
5
5
|
//#region src/tasks/execution-context.ts
|
|
6
6
|
const ORIGINS = new Set([
|
|
7
7
|
"chat",
|
|
@@ -2,12 +2,12 @@ import { isHomeAttentionAcknowledged } from "../storage/sqlite/home-attention-re
|
|
|
2
2
|
import { getRelationshipSettings } from "../storage/sqlite/relationship-settings-repository.js";
|
|
3
3
|
import { listConnectorApprovals } from "../storage/sqlite/connector-repository.js";
|
|
4
4
|
import "../storage/sqlite/index.js";
|
|
5
|
-
import { TaskRepository } from "./task-repository.js";
|
|
6
|
-
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
7
5
|
import "../automations/domain/defaults.js";
|
|
8
6
|
import "../automations/index.js";
|
|
9
|
-
import { AttentionGovernor } from "./attention-governor.js";
|
|
10
7
|
import { listGatewayAgents } from "../gateway/agents-admin.js";
|
|
8
|
+
import { TaskRepository } from "./task-repository.js";
|
|
9
|
+
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
10
|
+
import { AttentionGovernor } from "./attention-governor.js";
|
|
11
11
|
//#region src/tasks/home-query-service.ts
|
|
12
12
|
function toHomeWorkflowRun(run) {
|
|
13
13
|
return {
|
|
@@ -63,6 +63,7 @@ function attentionDetail(kind, status, locale, timeoutSeconds) {
|
|
|
63
63
|
}
|
|
64
64
|
function decisionFromTask(model, projectName, locale) {
|
|
65
65
|
const task = model.task;
|
|
66
|
+
if (task.phase === "closed" || model.operationalState === "waiting" && model.attention.length === 0) return null;
|
|
66
67
|
const isChinese = locale?.toLowerCase().startsWith("zh") ?? task.locale === "zh";
|
|
67
68
|
if (task.phase === "review") return {
|
|
68
69
|
id: `task:${task.id}:review`,
|
package/dist/src/tasks/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChanged, enqueueTaskChangedEvent } from "./task-change-events.js";
|
|
2
2
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
3
|
+
import { TaskContextRepository } from "./task-context-repository.js";
|
|
3
4
|
import { TaskRepository } from "./task-repository.js";
|
|
4
|
-
import { TaskConversationConflictError, TaskConversationRepository } from "./task-conversation-repository.js";
|
|
5
5
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
6
|
-
import { TaskContextRepository } from "./task-context-repository.js";
|
|
7
6
|
import { TaskDependencyError, TaskDependencyService } from "./task-dependency-service.js";
|
|
8
7
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
9
8
|
import { ProjectMonitoringService, decideProactiveDisposition, isInQuietHours, nextQuietHoursEnd, proactiveDispositionReason } from "./project-monitoring-service.js";
|
|
9
|
+
import { TaskConversationConflictError, TaskConversationRepository } from "./task-conversation-repository.js";
|
|
10
|
+
import { assembleTaskContext, buildTaskExecutionDirective, getTaskContextManifest, getTaskExecutionBrief } from "./task-context-assembler.js";
|
|
10
11
|
import { resolveExecutionContext } from "./execution-context.js";
|
|
11
12
|
import { AttentionGovernor } from "./attention-governor.js";
|
|
12
13
|
import { HomeQueryService, buildHomeWorkbench, decisionFromTask } from "./home-query-service.js";
|
|
13
14
|
import { TaskWorkflowCoordinator } from "./task-workflow-coordinator.js";
|
|
14
15
|
import { defineTaskContract } from "./task-contract-definition.js";
|
|
15
16
|
import { ModelTaskContractPlanner, parseTaskContractResponse } from "./task-contract-planner.js";
|
|
16
|
-
import { assembleTaskContext, buildTaskExecutionDirective, getTaskContextManifest, getTaskExecutionBrief } from "./task-context-assembler.js";
|
|
17
17
|
import { TaskRunCoordinator } from "./task-run-coordinator.js";
|
|
18
18
|
import { ProjectOperatingViewService, summarizeProjectOperatingView } from "./project-operating-view-service.js";
|
|
19
19
|
import { TaskValueMetricsService } from "./task-value-metrics-service.js";
|
|
@@ -17,8 +17,9 @@ function summarizeProjectOperatingView(view) {
|
|
|
17
17
|
counts.needsUser += 1;
|
|
18
18
|
continue;
|
|
19
19
|
}
|
|
20
|
-
if (task.phase === "closed")
|
|
21
|
-
|
|
20
|
+
if (task.phase === "closed") {
|
|
21
|
+
if (task.resolution === "done") counts.done += 1;
|
|
22
|
+
} else if ([
|
|
22
23
|
"queued",
|
|
23
24
|
"running",
|
|
24
25
|
"verifying"
|
|
@@ -48,7 +49,8 @@ var ProjectOperatingViewService = class {
|
|
|
48
49
|
const cards = projectTasks.map((task) => {
|
|
49
50
|
const model = this.#projector.project(task);
|
|
50
51
|
const latest = this.#runs.getLatestRoot(task.id);
|
|
51
|
-
const receipt = latest ? this.#runs.getReceipt(latest.id) : void 0;
|
|
52
|
+
const receipt = latest?.contractVersion === task.latestContractVersion ? this.#runs.getReceipt(latest.id) : void 0;
|
|
53
|
+
const nextCheckAt = this.#runs.listActiveWaits(task.id).filter((wait) => wait.kind !== "paused" && wait.resumeAt !== void 0).map((wait) => wait.resumeAt).sort((a, b) => a - b)[0];
|
|
52
54
|
return {
|
|
53
55
|
id: task.id,
|
|
54
56
|
title: task.title,
|
|
@@ -62,6 +64,7 @@ var ProjectOperatingViewService = class {
|
|
|
62
64
|
blockedBy: this.#dependencies.listBlocking(task.id),
|
|
63
65
|
allowedCommands: model.allowedCommands,
|
|
64
66
|
...receipt ? { latestVerification: receipt.verification.status } : {},
|
|
67
|
+
...nextCheckAt !== void 0 && model.allowedCommands.includes("add_wait") ? { nextCheckAt } : {},
|
|
65
68
|
updatedAt: task.updatedAt
|
|
66
69
|
};
|
|
67
70
|
});
|
|
@@ -95,7 +98,7 @@ var ProjectOperatingViewService = class {
|
|
|
95
98
|
digest: {
|
|
96
99
|
health: cards.length === 0 ? "empty" : attentionCount > 0 ? "attention" : "healthy",
|
|
97
100
|
summary: cards.length === 0 ? "No tasks yet" : `${cards.filter(moving).length} moving, ${attentionCount} need attention`,
|
|
98
|
-
recommendedAction: cards.find(needsUser)?.attention[0]?.summary ?? cards.find((card) => card.attention.length > 0)?.attention[0]?.summary ?? cards.find(moving)?.title ?? cards.find((card) => card.phase === "ready")?.title ?? cards.find((card) => card.phase === "backlog")?.title
|
|
101
|
+
recommendedAction: cards.find(needsUser)?.attention[0]?.summary ?? cards.find((card) => card.attention.length > 0)?.attention[0]?.summary ?? cards.find(moving)?.title ?? cards.find((card) => card.phase === "ready" && card.allowedCommands.includes("start"))?.title ?? cards.find((card) => card.phase === "backlog" && card.operationalState === "idle")?.title
|
|
99
102
|
},
|
|
100
103
|
monitoring: this.#monitoring.get(project.id)
|
|
101
104
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { TaskExecutorSelectionSchema, verifiedTaskCriteria } from "../../packages/gateway-contract/src/tasks.js";
|
|
2
3
|
import { enqueueTaskAttentionRequiredEvent, enqueueTaskChangedEvent } from "./task-change-events.js";
|
|
3
4
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
5
|
+
import { TaskContextRepository } from "./task-context-repository.js";
|
|
4
6
|
import { TaskRepository } from "./task-repository.js";
|
|
5
7
|
import { TaskReadModelProjector } from "./task-read-model-projector.js";
|
|
6
|
-
import { TaskContextRepository } from "./task-context-repository.js";
|
|
7
8
|
import { TaskDependencyService } from "./task-dependency-service.js";
|
|
8
9
|
import { createHash, randomUUID } from "node:crypto";
|
|
9
10
|
//#region src/tasks/task-application-service.ts
|
|
@@ -208,7 +209,7 @@ var TaskApplicationService = class {
|
|
|
208
209
|
});
|
|
209
210
|
break;
|
|
210
211
|
case "request_review":
|
|
211
|
-
result = task.phase === "active" ? this.lifecycle(task.id, task.version, "review") : {
|
|
212
|
+
result = task.phase === "active" && !this.#runs.getActiveRoot(task.id) && this.#runs.listActiveWaits(task.id).length === 0 ? this.lifecycle(task.id, task.version, "review") : {
|
|
212
213
|
ok: false,
|
|
213
214
|
reason: "invalid_transition",
|
|
214
215
|
model
|
|
@@ -225,6 +226,14 @@ var TaskApplicationService = class {
|
|
|
225
226
|
};
|
|
226
227
|
break;
|
|
227
228
|
case "add_wait": {
|
|
229
|
+
if (task.phase === "closed") {
|
|
230
|
+
result = {
|
|
231
|
+
ok: false,
|
|
232
|
+
reason: "invalid_transition",
|
|
233
|
+
model
|
|
234
|
+
};
|
|
235
|
+
break;
|
|
236
|
+
}
|
|
228
237
|
const activeRun = this.#runs.getActiveRoot(task.id);
|
|
229
238
|
this.#runs.createWait({
|
|
230
239
|
taskId: task.id,
|
|
@@ -252,18 +261,92 @@ var TaskApplicationService = class {
|
|
|
252
261
|
reason: "not_found",
|
|
253
262
|
model
|
|
254
263
|
};
|
|
255
|
-
else if (wait.condition.type === "connection") result = {
|
|
264
|
+
else if (wait.status !== "active" || task.phase === "closed" || wait.condition.type === "connection") result = {
|
|
256
265
|
ok: false,
|
|
257
266
|
reason: "invalid_transition",
|
|
258
267
|
model
|
|
259
268
|
};
|
|
260
269
|
else {
|
|
270
|
+
const response = input.command.resolution;
|
|
271
|
+
if (response?.kind === "task_approval") {
|
|
272
|
+
if (actor.kind !== "user" || wait.kind !== "approval" || typeof wait.condition.capability !== "string" || response.decision !== "approve" && response.decision !== "deny") {
|
|
273
|
+
result = {
|
|
274
|
+
ok: false,
|
|
275
|
+
reason: "invalid_transition",
|
|
276
|
+
model
|
|
277
|
+
};
|
|
278
|
+
break;
|
|
279
|
+
}
|
|
280
|
+
if (response.decision === "deny") {
|
|
281
|
+
if (!this.#runs.listActiveWaits(task.id).some((item) => item.kind === "paused")) this.#runs.createWait({
|
|
282
|
+
taskId: task.id,
|
|
283
|
+
kind: "paused",
|
|
284
|
+
reason: "Approval declined by user",
|
|
285
|
+
condition: { approvalWaitId: wait.id }
|
|
286
|
+
});
|
|
287
|
+
const active = this.#runs.getActiveRoot(task.id);
|
|
288
|
+
if (active && [
|
|
289
|
+
"queued",
|
|
290
|
+
"running",
|
|
291
|
+
"verifying"
|
|
292
|
+
].includes(active.status)) this.#runs.setStatus({
|
|
293
|
+
runId: active.id,
|
|
294
|
+
expectedVersion: active.version,
|
|
295
|
+
from: [active.status],
|
|
296
|
+
to: "waiting",
|
|
297
|
+
actor
|
|
298
|
+
});
|
|
299
|
+
result = {
|
|
300
|
+
ok: true,
|
|
301
|
+
model: this.#projector.get(task.id)
|
|
302
|
+
};
|
|
303
|
+
break;
|
|
304
|
+
}
|
|
305
|
+
this.#context.grant({
|
|
306
|
+
taskId: task.id,
|
|
307
|
+
capability: wait.condition.capability,
|
|
308
|
+
scope: {
|
|
309
|
+
waitId: wait.id,
|
|
310
|
+
contractVersion: task.latestContractVersion
|
|
311
|
+
},
|
|
312
|
+
grantedBy: actor
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
if (response?.kind === "user_answer") {
|
|
316
|
+
if (actor.kind !== "user" || wait.kind !== "user_input" || typeof response.answer !== "string" || !response.answer.trim() || response.answer.length > 12e3) {
|
|
317
|
+
result = {
|
|
318
|
+
ok: false,
|
|
319
|
+
reason: "invalid_transition",
|
|
320
|
+
model
|
|
321
|
+
};
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
this.#context.add({
|
|
325
|
+
taskId: task.id,
|
|
326
|
+
targetKind: "source",
|
|
327
|
+
targetId: wait.id,
|
|
328
|
+
role: "input",
|
|
329
|
+
title: wait.reason,
|
|
330
|
+
pinned: true,
|
|
331
|
+
metadata: { userAnswer: response.answer.trim() },
|
|
332
|
+
createdBy: actor
|
|
333
|
+
});
|
|
334
|
+
}
|
|
261
335
|
this.#runs.resolveWait({
|
|
262
336
|
waitId: wait.id,
|
|
263
337
|
actor,
|
|
264
338
|
resolution: input.command.resolution
|
|
265
339
|
});
|
|
266
|
-
|
|
340
|
+
const executor = TaskExecutorSelectionSchema.safeParse(wait.condition.executor);
|
|
341
|
+
result = response?.kind === "task_approval" && executor.success && !this.#runs.getActiveRoot(task.id) && this.#runs.listActiveWaits(task.id).length === 0 ? this.start(task.id, task.version, executor.data, {
|
|
342
|
+
idempotencyKey: input.idempotencyKey,
|
|
343
|
+
actor,
|
|
344
|
+
correlationId: input.idempotencyKey
|
|
345
|
+
}) : {
|
|
346
|
+
ok: true,
|
|
347
|
+
model: this.#projector.get(task.id)
|
|
348
|
+
};
|
|
349
|
+
if (result.ok === false && result.reason === "blocked") result = {
|
|
267
350
|
ok: true,
|
|
268
351
|
model: this.#projector.get(task.id)
|
|
269
352
|
};
|
|
@@ -364,6 +447,20 @@ var TaskApplicationService = class {
|
|
|
364
447
|
model: this.#projector.get(run.taskId)
|
|
365
448
|
};
|
|
366
449
|
const task = this.#tasks.require(run.taskId);
|
|
450
|
+
if (run.parentRunId || task.phase === "closed" || this.#runs.listActiveWaits(task.id).length > 0 || run.contractVersion !== task.latestContractVersion) {
|
|
451
|
+
enqueueTaskChangedEvent(db, {
|
|
452
|
+
taskId: task.id,
|
|
453
|
+
projectId: task.projectId,
|
|
454
|
+
version: task.version,
|
|
455
|
+
changedFields: ["runs", "receipts"],
|
|
456
|
+
actor: input.actor,
|
|
457
|
+
source: input.actor ? void 0 : "runtime"
|
|
458
|
+
});
|
|
459
|
+
return {
|
|
460
|
+
ok: true,
|
|
461
|
+
model: this.#projector.project(task)
|
|
462
|
+
};
|
|
463
|
+
}
|
|
367
464
|
if (input.receipt.status !== "succeeded") {
|
|
368
465
|
const model = this.#projector.project(task);
|
|
369
466
|
enqueueTaskAttentionRequiredEvent(db, {
|
|
@@ -391,7 +488,9 @@ var TaskApplicationService = class {
|
|
|
391
488
|
model
|
|
392
489
|
};
|
|
393
490
|
}
|
|
394
|
-
const
|
|
491
|
+
const verifiedCriteria = verifiedTaskCriteria(input.receipt);
|
|
492
|
+
const criteria = task.contract?.acceptanceCriteria ?? [];
|
|
493
|
+
const verified = criteria.length > 0 && criteria.every((criterion) => verifiedCriteria.has(criterion)) && input.receipt.verification.status === "passed" && input.receipt.completionVerdict === "achieved" && input.receipt.remainingWork.length === 0 && !input.receipt.needsUser;
|
|
395
494
|
const phase = task.contract?.acceptancePolicy === "verified_auto" && verified ? "closed" : "review";
|
|
396
495
|
const updated = this.#tasks.setLifecycle({
|
|
397
496
|
taskId: task.id,
|
|
@@ -446,6 +545,11 @@ var TaskApplicationService = class {
|
|
|
446
545
|
reason: "invalid_transition",
|
|
447
546
|
model: this.#projector.project(task)
|
|
448
547
|
};
|
|
548
|
+
if (this.#runs.listActiveWaits(taskId).length > 0) return {
|
|
549
|
+
ok: false,
|
|
550
|
+
reason: "blocked",
|
|
551
|
+
model: this.#projector.project(task)
|
|
552
|
+
};
|
|
449
553
|
const blocking = this.#dependencies.listBlocking(taskId);
|
|
450
554
|
if (blocking.length > 0) {
|
|
451
555
|
const existingWaits = this.#runs.listActiveWaits(taskId);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { isXopcDatabaseOpen } from "../storage/sqlite/connection.js";
|
|
2
|
+
import { verifiedTaskCriteria } from "../../packages/gateway-contract/src/tasks.js";
|
|
2
3
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
3
4
|
import "../storage/sqlite/index.js";
|
|
5
|
+
import { TaskContextRepository } from "./task-context-repository.js";
|
|
4
6
|
import { TaskRepository } from "./task-repository.js";
|
|
5
7
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
6
|
-
import { TaskContextRepository } from "./task-context-repository.js";
|
|
7
8
|
//#region src/tasks/task-context-assembler.ts
|
|
8
9
|
const STANDARD = {
|
|
9
10
|
profile: "standard",
|
|
@@ -17,11 +18,13 @@ function taskIdForSession(sessionKey) {
|
|
|
17
18
|
function getTaskExecutionBrief(taskId) {
|
|
18
19
|
if (!isXopcDatabaseOpen()) return void 0;
|
|
19
20
|
const task = new TaskRepository().get(taskId);
|
|
20
|
-
if (!task?.contract) return void 0;
|
|
21
|
+
if (!task?.contract || task.phase === "closed") return void 0;
|
|
21
22
|
const runs = new TaskRunRepository();
|
|
23
|
+
if (runs.listActiveWaits(taskId).some((wait) => wait.kind === "paused")) return void 0;
|
|
22
24
|
const latestRun = runs.getLatestRoot(taskId);
|
|
23
|
-
const latestReceipt = latestRun ? runs.getReceipt(latestRun.id) : void 0;
|
|
24
|
-
const
|
|
25
|
+
const latestReceipt = latestRun?.contractVersion === task.latestContractVersion ? runs.getReceipt(latestRun.id) : void 0;
|
|
26
|
+
const passedCriteria = verifiedTaskCriteria(latestReceipt);
|
|
27
|
+
const remainingCriteria = task.contract.acceptanceCriteria.filter((criterion) => !passedCriteria.has(criterion));
|
|
25
28
|
const critical = task.priority === "critical" || task.contract.risks.length > 0 || task.contract.approvalRequired.length > 0;
|
|
26
29
|
const allocation = critical ? {
|
|
27
30
|
profile: "critical",
|
|
@@ -121,6 +124,7 @@ function buildTaskExecutionDirective(sessionKey) {
|
|
|
121
124
|
`Remaining acceptance criteria: ${remainingCriteria.join("; ")}`,
|
|
122
125
|
contract.constraints.length ? `Constraints: ${contract.constraints.join("; ")}` : "",
|
|
123
126
|
contract.approvalRequired.length ? `Authority required: ${contract.approvalRequired.join("; ")}` : "",
|
|
127
|
+
...new TaskContextRepository().list(task.id).filter((edge) => typeof edge.metadata.userAnswer === "string").slice(-20).map((edge) => `User response to ${edge.title ?? "question"}: ${JSON.stringify(edge.metadata.userAnswer)}`),
|
|
124
128
|
handoffPayload ? `Handoff snapshot: ${handoffPayload}` : "",
|
|
125
129
|
"Take safe in-scope steps and produce inspectable evidence. Do not claim completion without verification.",
|
|
126
130
|
"</xopc_task_execution>"
|
|
@@ -3,9 +3,9 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
4
4
|
import { init_agent_scope, listAgentEntries, normalizeAgentId } from "../agent/agent-scope.js";
|
|
5
5
|
import { buildSessionKey, init_session_key, sanitizeSegment } from "../routing/session-key.js";
|
|
6
|
+
import { TaskContextRepository } from "./task-context-repository.js";
|
|
6
7
|
import { TaskRepository } from "./task-repository.js";
|
|
7
8
|
import { TaskConversationRepository } from "./task-conversation-repository.js";
|
|
8
|
-
import { TaskContextRepository } from "./task-context-repository.js";
|
|
9
9
|
//#region src/tasks/task-handoff-service.ts
|
|
10
10
|
init_agent_scope();
|
|
11
11
|
init_session_key();
|
|
@@ -13,6 +13,7 @@ var TaskReadModelProjector = class {
|
|
|
13
13
|
const activeRun = this.#runs.getActiveRoot(task.id);
|
|
14
14
|
const latestRun = activeRun ?? this.#runs.getLatestRoot(task.id);
|
|
15
15
|
const waits = this.#runs.listActiveWaits(task.id);
|
|
16
|
+
const paused = waits.some((wait) => wait.kind === "paused");
|
|
16
17
|
const hasIncompleteDependency = Boolean(getSqliteDatabase().prepare(`SELECT 1 FROM task_dependencies edge
|
|
17
18
|
JOIN tasks dependency ON dependency.task_id = edge.depends_on_task_id
|
|
18
19
|
WHERE edge.task_id = ?
|
|
@@ -48,8 +49,8 @@ var TaskReadModelProjector = class {
|
|
|
48
49
|
waits,
|
|
49
50
|
hasIncompleteDependency
|
|
50
51
|
}),
|
|
51
|
-
attention,
|
|
52
|
-
allowedCommands: this.allowedCommands(task, activeRun?.status, waits.length > 0)
|
|
52
|
+
attention: task.phase === "closed" || paused ? [] : attention,
|
|
53
|
+
allowedCommands: this.allowedCommands(task, activeRun?.status, waits.length > 0, paused)
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
summary(taskId) {
|
|
@@ -65,6 +66,7 @@ var TaskReadModelProjector = class {
|
|
|
65
66
|
}
|
|
66
67
|
operationalState(input) {
|
|
67
68
|
if (input.task.phase === "closed") return "idle";
|
|
69
|
+
if (input.waits.some((wait) => wait.kind === "paused")) return "waiting";
|
|
68
70
|
if (input.activeRun?.status === "running") return "running";
|
|
69
71
|
if (input.activeRun?.status === "verifying") return "verifying";
|
|
70
72
|
if (input.activeRun?.status === "queued") return "queued";
|
|
@@ -74,15 +76,15 @@ var TaskReadModelProjector = class {
|
|
|
74
76
|
if (input.hasIncompleteDependency) return "blocked";
|
|
75
77
|
return "idle";
|
|
76
78
|
}
|
|
77
|
-
allowedCommands(task, activeRunStatus, hasWaits) {
|
|
79
|
+
allowedCommands(task, activeRunStatus, hasWaits, paused) {
|
|
78
80
|
if (task.phase === "closed") return ["reopen"];
|
|
79
81
|
const commands = ["revise_contract", "close"];
|
|
82
|
+
if (!paused) commands.push("add_wait");
|
|
80
83
|
if (!activeRunStatus && !hasWaits) commands.unshift("move");
|
|
81
84
|
if (hasWaits) commands.unshift("resolve_wait");
|
|
82
|
-
else if (activeRunStatus === "running" || activeRunStatus === "verifying") commands.unshift("add_wait");
|
|
83
85
|
if (task.phase === "backlog") commands.unshift("mark_ready");
|
|
84
86
|
if (!activeRunStatus && !hasWaits && task.phase !== "backlog") commands.unshift("start");
|
|
85
|
-
if (task.phase === "active" && !activeRunStatus) commands.push("request_review");
|
|
87
|
+
if (task.phase === "active" && !activeRunStatus && !hasWaits) commands.push("request_review");
|
|
86
88
|
return commands;
|
|
87
89
|
}
|
|
88
90
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TaskRunRepository } from "./task-run-repository.js";
|
|
2
|
-
import { TaskRepository } from "./task-repository.js";
|
|
3
2
|
import { TaskContextRepository } from "./task-context-repository.js";
|
|
3
|
+
import { TaskRepository } from "./task-repository.js";
|
|
4
4
|
import { TaskApplicationService } from "./task-application-service.js";
|
|
5
5
|
//#region src/tasks/task-run-coordinator.ts
|
|
6
6
|
var TaskRunCoordinator = class TaskRunCoordinator {
|
|
@@ -16,7 +16,9 @@ var TaskRunCoordinator = class TaskRunCoordinator {
|
|
|
16
16
|
const task = tasks.get(input.context.taskId);
|
|
17
17
|
if (!task || task.phase === "closed") return void 0;
|
|
18
18
|
const runs = new TaskRunRepository();
|
|
19
|
+
if (runs.listActiveWaits(task.id).length > 0) return void 0;
|
|
19
20
|
let run = runs.get(input.runId);
|
|
21
|
+
if (run && (run.taskId !== task.id || run.parentRunId || run.sessionKey && run.sessionKey !== input.context.sessionKey)) return void 0;
|
|
20
22
|
if (!run) {
|
|
21
23
|
if (runs.getActiveRoot(task.id)) return void 0;
|
|
22
24
|
const agentId = task.delegateAgentId ?? input.context.agentId;
|