@xopcai/xopc 0.0.197 → 0.0.200
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser-ext/manifest.json +1 -1
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/gateway/static/root/assets/{activity-store-BwmdJ5pv.js → activity-store-DYVN1hRp.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-C5st7lt5.js → agent-avatar-dicebear-eMarz29u.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DeLW-454.js +68 -0
- package/dist/gateway/static/root/assets/{api-BM1hNzjw.js → api-B8mzbAle.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-yfb68wq9.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-B8SPknFM.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-Bmor22Ny.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-qL07mwnY.js → archive-plugin-DmYRiOP3.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CqSobpdi.js → attachment-load-D66JvcPi.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-Q4e8m11h.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DBRPyLYE.js → binary-plugins-ChIsZArT.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-6wG1LU7t.js → block-editor-Ck-k_d0Z.js} +4 -4
- package/dist/gateway/static/root/assets/browser-settings-page--uVL73Sb.js +8 -0
- package/dist/gateway/static/root/assets/browser-workflow-inputs-_ndaecsf.js +1 -0
- package/dist/gateway/static/root/assets/{browser-workflows-page-BEu3E0et.js → browser-workflows-page-BC5jm1zL.js} +2 -2
- package/dist/gateway/static/root/assets/button-CSEbl4zT.js +1 -0
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DXpf3QYN.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-BoOzFotX.js → capability-presets-api-Dy1jZJKs.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-NAjCsrTi.js +3 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-_8IiTxRB.js → channel-recipient-api-D-9qiuio.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-CiWUo7jW.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-B4Rbh3bM.js +1 -0
- package/dist/gateway/static/root/assets/connectors-api-5xiCRVUS.js +1 -0
- package/dist/gateway/static/root/assets/connectors-page-DOwlMseU.js +2 -0
- package/dist/gateway/static/root/assets/copy-Dv6d4Dvw.js +1 -0
- package/dist/gateway/static/root/assets/cron-expression-B3PebXKZ.js +2 -0
- package/dist/gateway/static/root/assets/date-picker-C1Vke7Xn.js +1 -0
- package/dist/gateway/static/root/assets/dependency-picker-FrQ0tsBC.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-CsLR4pWB.js → desktop-pet-CPBAzNJi.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-D6s3glDP.js +1 -0
- package/dist/gateway/static/root/assets/directory-picker-path-field-CbNQ7QQS.js +1 -0
- package/dist/gateway/static/root/assets/dist-BPoKqzeH.js +1 -0
- package/dist/gateway/static/root/assets/dist-DY4Af0fY.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-CD73euAM.js → extension-debug-page-dTK14hUv.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DAKjpNwd.js → extension-page-Cpdj1Kip.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-iNHUZGd5.js +1 -0
- package/dist/gateway/static/root/assets/external-link-DjqjBmc3.js +1 -0
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-api-SvMvWqMM.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-swr-jB0hAhWO.js +1 -0
- package/dist/gateway/static/root/assets/gateway-settings-BilR3dGZ.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry--2njcDpC.js → gateway-startup-retry-C-fRlHCL.js} +1 -1
- package/dist/gateway/static/root/assets/globe-DSSGFWFn.js +1 -0
- package/dist/gateway/static/root/assets/heartbeat-settings-zK40dcQ5.js +1 -0
- package/dist/gateway/static/root/assets/home-page-NyXy5MLr.js +3 -0
- package/dist/gateway/static/root/assets/index-Bp8I_eX4.css +1 -0
- package/dist/gateway/static/root/assets/index-CCK8zdlS.js +152 -0
- package/dist/gateway/static/root/assets/interaction-BmQogeqz.js +1 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-HMhxgOuD.js → keyboard-shortcuts-settings-nKzsroud.js} +1 -1
- package/dist/gateway/static/root/assets/loader-circle-CifKLtgG.js +1 -0
- package/dist/gateway/static/root/assets/local-app-workbench-page-Ds3sPXTh.js +2 -0
- package/dist/gateway/static/root/assets/local-apps-page-DV1s_FYh.js +1 -0
- package/dist/gateway/static/root/assets/{locale-store-Bjvw7jtg.js → locale-store-xULEcFVs.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-Biz4eA02.js +2 -0
- package/dist/gateway/static/root/assets/management-settings-D7KjYgHu.js +1 -0
- package/dist/gateway/static/root/assets/{markdown-split-DvVBewS4.js → markdown-split-CTYbpkrd.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-YVj7NVzD.js → media-plugins-BXYnaiZ6.js} +1 -1
- package/dist/gateway/static/root/assets/messages-3qRsLZuX.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-BDzuL2I9.js → notes-page-CWWVXpw5.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-DnBkQihH.js +4 -0
- package/dist/gateway/static/root/assets/page-tabs-BaEQMYm_.js +1 -0
- package/dist/gateway/static/root/assets/popover-select-BzdnTy3h.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-pimQAkeI.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-Bwx_CQht.js → product-open-page-BoYSS_YR.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-ZO7t1UkB.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-By-vq41g.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-C0C_Y9d0.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-Fe05Nus6.js → runtime-tools-settings-panel-DT8flaX1.js} +4 -4
- package/dist/gateway/static/root/assets/schema-form-DabEP-UI.js +1 -0
- package/dist/gateway/static/root/assets/sessions-page-BNlVwUzV.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-CxYBQDaM.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-draft-Dy10ldo8.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-DCsfZAtC.js +1 -0
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BRE_-7Da.js → settings-loading-skeleton-Dac6Yd0T.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-C1zxCpqB.js → settings-page-BDoYoEar.js} +1 -1
- package/dist/gateway/static/root/assets/settings-page-layout-BRQNel6r.js +1 -0
- package/dist/gateway/static/root/assets/settings-shell-dialog-layer-BU3UuiJr.js +1 -0
- package/dist/gateway/static/root/assets/setup-status-panel-DWijJ1rw.js +1 -0
- package/dist/gateway/static/root/assets/share-preview-page-ie9I2_7h.js +2 -0
- package/dist/gateway/static/root/assets/shares-settings-DU9VrJLf.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-C5RaIvoE.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-N0YhaR5S.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-CYwFWTso.js → skills-page.utils-C639DLXr.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-CpshpQtC.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-DsTocYkK.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-DtxpMC5S.js → theme-store-CHQRiuCF.js} +1 -1
- package/dist/gateway/static/root/assets/tool-activity-R8V9l6nk.js +1 -0
- package/dist/gateway/static/root/assets/typed-models-lib-q5-Vfqd8.js +1 -0
- package/dist/gateway/static/root/assets/use-autosave-ms6rDy59.js +1 -0
- package/dist/gateway/static/root/assets/user-context-page-BUxIemwy.js +1 -0
- package/dist/gateway/static/root/assets/voice-api-key-field-CObrQWh2.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-overlay-BBxrnEFt.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-DN3l-HW3.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DqIb1oBB.js → workflow-run-setup-panel-BxXhe3IV.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BCHkjd1i.js +5 -0
- package/dist/gateway/static/root/assets/working-directory-picker-modal-D-IgcHPp.js +1 -0
- package/dist/gateway/static/root/index.html +23 -8
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/tasks.js +103 -9
- package/dist/src/agent/agent-manager.d.ts +1 -0
- package/dist/src/agent/agent-manager.js +1 -0
- package/dist/src/agent/context/execution-scope.js +3 -1
- package/dist/src/agent/service.js +1 -0
- package/dist/src/agent/service.types.d.ts +1 -0
- package/dist/src/agent/tasks/task-judge-service.d.ts +1 -1
- package/dist/src/agent/tasks/task-judge-service.js +3 -2
- package/dist/src/agent/tools/factory.d.ts +2 -0
- package/dist/src/agent/tools/factory.js +2 -1
- package/dist/src/agent/tools/xopc-use-tool.d.ts +1 -0
- package/dist/src/agent/tools/xopc-use-tool.js +69 -9
- package/dist/src/automations/domain/validation.d.ts +40 -12
- package/dist/src/automations/draft/automation-draft-validator.d.ts +4 -4
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/rules.js +2 -2
- package/dist/src/gateway/hono/app.d.ts +2 -0
- package/dist/src/gateway/hono/app.js +10 -3
- package/dist/src/gateway/hono/middleware/strict-rate-limit.d.ts +4 -0
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +8 -1
- package/dist/src/gateway/hono/routes/agent-stream.js +2 -74
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -1
- package/dist/src/gateway/hono/routes/config.js +9 -0
- package/dist/src/gateway/hono/routes/deps.d.ts +1 -0
- package/dist/src/gateway/hono/routes/projects.js +55 -0
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +62 -0
- package/dist/src/gateway/hono/routes/session-input-handler.js +82 -0
- package/dist/src/gateway/hono/routes/tasks.js +272 -20
- package/dist/src/gateway/host.d.ts +9 -1
- package/dist/src/gateway/host.js +22 -5
- package/dist/src/gateway/rate-limit/buckets.d.ts +3 -0
- package/dist/src/gateway/rate-limit/buckets.js +12 -0
- package/dist/src/gateway/runtime-config.js +6 -5
- package/dist/src/gateway/security/audit.js +0 -7
- package/dist/src/gateway/server.js +4 -1
- package/dist/src/gateway/service/task-conversation-query-service.d.ts +58 -0
- package/dist/src/gateway/service/task-conversation-query-service.js +84 -0
- package/dist/src/gateway/service.d.ts +11 -0
- package/dist/src/gateway/service.js +75 -38
- package/dist/src/proactive/actions/service.d.ts +2 -0
- package/dist/src/proactive/actions/service.js +80 -0
- package/dist/src/proactive/execution/insight.js +20 -0
- package/dist/src/proactive/execution/repository.js +8 -2
- package/dist/src/proactive/execution/types.d.ts +14 -0
- package/dist/src/proactive/inbox/repository.js +59 -9
- package/dist/src/proactive/inbox/service.d.ts +2 -2
- package/dist/src/proactive/inbox/service.js +7 -2
- package/dist/src/proactive/inbox/types.d.ts +14 -0
- package/dist/src/proactive/inbox/worker.js +2 -0
- package/dist/src/proactive/scenarios/prompt-composer.js +2 -2
- package/dist/src/projects/project-agent.js +1 -1
- package/dist/src/storage/sqlite/migrations/118_task_board_rank.sql +6 -0
- package/dist/src/storage/sqlite/migrations/119_proactive_disposition.sql +13 -0
- package/dist/src/storage/sqlite/migrations/120_task_conversation.sql +112 -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/migrations/runner.ts +1 -1
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/tasks/execution-context.js +8 -4
- package/dist/src/tasks/home-query-service.d.ts +5 -0
- package/dist/src/tasks/home-query-service.js +7 -2
- package/dist/src/tasks/index.d.ts +3 -0
- package/dist/src/tasks/index.js +6 -3
- package/dist/src/tasks/project-monitoring-service.d.ts +9 -0
- package/dist/src/tasks/project-monitoring-service.js +41 -3
- package/dist/src/tasks/project-operating-view-service.d.ts +1 -2
- package/dist/src/tasks/project-operating-view-service.js +26 -23
- package/dist/src/tasks/task-application-service.js +107 -21
- package/dist/src/tasks/task-change-events.d.ts +13 -0
- package/dist/src/tasks/task-change-events.js +29 -0
- package/dist/src/tasks/task-context-assembler.js +9 -4
- package/dist/src/tasks/task-context-repository.d.ts +0 -6
- package/dist/src/tasks/task-context-repository.js +0 -4
- package/dist/src/tasks/task-conversation-repository.d.ts +71 -0
- package/dist/src/tasks/task-conversation-repository.js +194 -0
- package/dist/src/tasks/task-handoff-service.d.ts +31 -0
- package/dist/src/tasks/task-handoff-service.js +143 -0
- package/dist/src/tasks/task-read-model-projector.js +3 -6
- package/dist/src/tasks/task-repository.d.ts +7 -2
- package/dist/src/tasks/task-repository.js +31 -15
- package/dist/src/tasks/task-run-coordinator.js +3 -1
- package/dist/src/tunnel/enable-lan-pairing.js +15 -26
- package/dist/src/tunnel/pair-context.js +1 -1
- package/dist/src/tunnel/pair-url.js +1 -1
- package/dist/src/tunnel/tunnel-qr.d.ts +0 -7
- package/dist/src/tunnel/tunnel-qr.js +2 -19
- package/dist/src/workflows/service/workflow-run-service.js +4 -2
- package/package.json +5 -3
- package/dist/gateway/static/root/assets/agents-Baxfj44y.js +0 -68
- package/dist/gateway/static/root/assets/app-management-settings-panel-S8LhoD6G.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-D8Cd5vDP.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-0uCxKyE5.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-XyDat125.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-CrYNMR4w.js +0 -8
- package/dist/gateway/static/root/assets/browser-workflow-inputs-Abil4puY.js +0 -1
- package/dist/gateway/static/root/assets/capabilities-settings-panel-CvMcDhGf.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-CHJDY-Ih.js +0 -3
- package/dist/gateway/static/root/assets/channels-settings-Ds9BJbcY.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-DPaJSYX_.js +0 -1
- package/dist/gateway/static/root/assets/connectors-api-CgWjgPSI.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-NUs-Zf7F.js +0 -2
- package/dist/gateway/static/root/assets/cron-expression-ZdDBAoqA.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-BGeB1jpn.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-CCjT1bdo.js +0 -1
- package/dist/gateway/static/root/assets/directory-picker-path-field-C-Te1QN3.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BLSNdlgd.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-api-CQrf0k3D.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-CvgH8IJI.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-SPpnqbjl.js +0 -1
- package/dist/gateway/static/root/assets/home-page-BFoD6047.js +0 -3
- package/dist/gateway/static/root/assets/index-84ys9u-K.js +0 -152
- package/dist/gateway/static/root/assets/index-D-srnucP.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-D5uL2_Fd.js +0 -2
- package/dist/gateway/static/root/assets/local-apps-page-DIWkFa3g.js +0 -1
- package/dist/gateway/static/root/assets/logs-page--6v8qq6y.js +0 -2
- package/dist/gateway/static/root/assets/management-settings-DtEuS-kR.js +0 -1
- package/dist/gateway/static/root/assets/messages-DQ5X6cXp.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-IdjuNXvH.js +0 -4
- package/dist/gateway/static/root/assets/page-tabs-7bSEWfSX.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-tgLbHgcV.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-DnJXSuM4.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DckZKlBI.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-CfbUHBUH.js +0 -1
- package/dist/gateway/static/root/assets/schema-form-CFfyC4CB.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BCfCh4My.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Cbi4FvzO.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-gEnEYT_3.js +0 -1
- package/dist/gateway/static/root/assets/settings-page-layout-CRpXF_05.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BcHdpmFf.js +0 -1
- package/dist/gateway/static/root/assets/share-preview-page-DU8L68A5.js +0 -2
- package/dist/gateway/static/root/assets/shares-settings-kjTqH9yY.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-QAGpwzIM.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-lE1-YRdK.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-CVDsiPKn.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-DsM13-cy.js +0 -1
- package/dist/gateway/static/root/assets/typed-models-lib-DelyYgoc.js +0 -1
- package/dist/gateway/static/root/assets/use-autosave-C50Mq5yQ.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-D-VEOt2A.js +0 -1
- package/dist/gateway/static/root/assets/voice-api-key-field-DYfgTe3Y.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-DPbujsp3.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-D77opady.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-B9-PLmlX.js +0 -5
- package/dist/src/gateway/ensure-network-cors.d.ts +0 -3
- package/dist/src/gateway/ensure-network-cors.js +0 -23
|
@@ -8,6 +8,40 @@ const TaskPrioritySchema = z.enum([
|
|
|
8
8
|
"high",
|
|
9
9
|
"critical"
|
|
10
10
|
]);
|
|
11
|
+
const TaskChangedFieldSchema = z.enum([
|
|
12
|
+
"title",
|
|
13
|
+
"body",
|
|
14
|
+
"phase",
|
|
15
|
+
"resolution",
|
|
16
|
+
"priority",
|
|
17
|
+
"dueAt",
|
|
18
|
+
"projectId",
|
|
19
|
+
"milestoneId",
|
|
20
|
+
"parentTaskId",
|
|
21
|
+
"ownerId",
|
|
22
|
+
"delegateAgentId",
|
|
23
|
+
"boardRank",
|
|
24
|
+
"contract",
|
|
25
|
+
"dependencies",
|
|
26
|
+
"context",
|
|
27
|
+
"runs",
|
|
28
|
+
"receipts",
|
|
29
|
+
"attention",
|
|
30
|
+
"conversation"
|
|
31
|
+
]);
|
|
32
|
+
z.object({
|
|
33
|
+
taskId: z.string().min(1),
|
|
34
|
+
projectId: z.string().min(1).optional(),
|
|
35
|
+
version: z.number().int().positive(),
|
|
36
|
+
changedFields: z.array(TaskChangedFieldSchema).min(1),
|
|
37
|
+
source: z.enum([
|
|
38
|
+
"user",
|
|
39
|
+
"agent",
|
|
40
|
+
"runtime"
|
|
41
|
+
]),
|
|
42
|
+
actorId: z.string().min(1).optional(),
|
|
43
|
+
occurredAt: z.number().int().nonnegative()
|
|
44
|
+
});
|
|
11
45
|
const TaskAcceptancePolicySchema = z.enum([
|
|
12
46
|
"verified_auto",
|
|
13
47
|
"verified_then_review",
|
|
@@ -53,6 +87,7 @@ const TaskSchema = z.object({
|
|
|
53
87
|
source: z.string(),
|
|
54
88
|
locale: z.enum(["en", "zh"]).optional(),
|
|
55
89
|
latestContractVersion: z.number().int().positive(),
|
|
90
|
+
boardRank: z.number().finite().default(0),
|
|
56
91
|
version: z.number().int().positive(),
|
|
57
92
|
contract: TaskContractSchema.optional(),
|
|
58
93
|
createdAt: z.number().int().nonnegative(),
|
|
@@ -244,7 +279,7 @@ const TaskCreateRequestSchema = z.object({
|
|
|
244
279
|
phase: z.enum(["backlog", "ready"]).default("backlog")
|
|
245
280
|
}), z.object({
|
|
246
281
|
mode: z.literal("start"),
|
|
247
|
-
executor: TaskExecutorSelectionSchema,
|
|
282
|
+
executor: TaskExecutorSelectionSchema.optional(),
|
|
248
283
|
scheduleAt: z.number().int().nonnegative().optional()
|
|
249
284
|
})])
|
|
250
285
|
}).strict();
|
|
@@ -257,8 +292,7 @@ const TaskPatchRequestSchema = z.object({
|
|
|
257
292
|
parentTaskId: z.string().trim().min(1).nullable().optional(),
|
|
258
293
|
priority: TaskPrioritySchema.optional(),
|
|
259
294
|
dueAt: z.number().int().nonnegative().nullable().optional(),
|
|
260
|
-
ownerId: z.string().trim().min(1).nullable().optional()
|
|
261
|
-
delegateAgentId: z.string().trim().min(1).nullable().optional()
|
|
295
|
+
ownerId: z.string().trim().min(1).nullable().optional()
|
|
262
296
|
}).strict();
|
|
263
297
|
const TaskWaitInputSchema = z.object({
|
|
264
298
|
kind: z.enum([
|
|
@@ -275,6 +309,15 @@ const TaskWaitInputSchema = z.object({
|
|
|
275
309
|
resumeAt: z.number().int().nonnegative().optional()
|
|
276
310
|
});
|
|
277
311
|
const TaskCommandSchema = z.discriminatedUnion("type", [
|
|
312
|
+
z.object({
|
|
313
|
+
type: z.literal("move"),
|
|
314
|
+
phase: z.enum([
|
|
315
|
+
"backlog",
|
|
316
|
+
"ready",
|
|
317
|
+
"active",
|
|
318
|
+
"review"
|
|
319
|
+
])
|
|
320
|
+
}),
|
|
278
321
|
z.object({ type: z.literal("mark_ready") }),
|
|
279
322
|
z.object({
|
|
280
323
|
type: z.literal("start"),
|
|
@@ -288,7 +331,12 @@ const TaskCommandSchema = z.discriminatedUnion("type", [
|
|
|
288
331
|
}),
|
|
289
332
|
z.object({
|
|
290
333
|
type: z.literal("reopen"),
|
|
291
|
-
phase: z.enum([
|
|
334
|
+
phase: z.enum([
|
|
335
|
+
"backlog",
|
|
336
|
+
"ready",
|
|
337
|
+
"active",
|
|
338
|
+
"review"
|
|
339
|
+
])
|
|
292
340
|
}),
|
|
293
341
|
z.object({
|
|
294
342
|
type: z.literal("add_wait"),
|
|
@@ -299,10 +347,6 @@ const TaskCommandSchema = z.discriminatedUnion("type", [
|
|
|
299
347
|
waitId: z.string(),
|
|
300
348
|
resolution: z.unknown().optional()
|
|
301
349
|
}),
|
|
302
|
-
z.object({
|
|
303
|
-
type: z.literal("delegate"),
|
|
304
|
-
agentId: z.string().optional()
|
|
305
|
-
}),
|
|
306
350
|
z.object({
|
|
307
351
|
type: z.literal("revise_contract"),
|
|
308
352
|
contract: TaskContractInputSchema
|
|
@@ -317,6 +361,10 @@ const TaskDependencyUpdateRequestSchema = z.object({
|
|
|
317
361
|
dependsOnTaskIds: z.array(z.string().trim().min(1)),
|
|
318
362
|
expectedVersion: z.number().int().positive()
|
|
319
363
|
}).strict();
|
|
364
|
+
const TaskBoardPositionRequestSchema = z.object({
|
|
365
|
+
expectedVersion: z.number().int().positive(),
|
|
366
|
+
beforeTaskId: z.string().trim().min(1).nullable().optional()
|
|
367
|
+
}).strict();
|
|
320
368
|
z.object({
|
|
321
369
|
ok: z.literal(true),
|
|
322
370
|
items: z.array(z.object({
|
|
@@ -331,6 +379,50 @@ z.object({
|
|
|
331
379
|
operationalState: TaskOperationalStateSchema,
|
|
332
380
|
run: TaskRunSchema.optional()
|
|
333
381
|
});
|
|
382
|
+
const TaskConversationStateSchema = z.object({
|
|
383
|
+
taskId: z.string(),
|
|
384
|
+
activeSessionKey: z.string().optional(),
|
|
385
|
+
currentExecutorAgentId: z.string().optional(),
|
|
386
|
+
assignmentEpoch: z.number().int().nonnegative(),
|
|
387
|
+
status: z.enum(["idle", "active"]),
|
|
388
|
+
updatedAt: z.number().int().nonnegative()
|
|
389
|
+
});
|
|
390
|
+
const TaskSessionLinkSchema = z.object({
|
|
391
|
+
id: z.string(),
|
|
392
|
+
taskId: z.string(),
|
|
393
|
+
sessionKey: z.string(),
|
|
394
|
+
role: z.enum([
|
|
395
|
+
"primary",
|
|
396
|
+
"discussion",
|
|
397
|
+
"execution"
|
|
398
|
+
]),
|
|
399
|
+
agentId: z.string().optional(),
|
|
400
|
+
runId: z.string().optional(),
|
|
401
|
+
assignmentEpoch: z.number().int().nonnegative(),
|
|
402
|
+
status: z.enum([
|
|
403
|
+
"active",
|
|
404
|
+
"completed",
|
|
405
|
+
"superseded",
|
|
406
|
+
"failed"
|
|
407
|
+
]),
|
|
408
|
+
startedAt: z.number().int().nonnegative(),
|
|
409
|
+
endedAt: z.number().int().nonnegative().optional(),
|
|
410
|
+
createdAt: z.number().int().nonnegative()
|
|
411
|
+
});
|
|
412
|
+
const TaskHandoffRequestSchema = z.object({
|
|
413
|
+
toAgentId: z.string().trim().min(1),
|
|
414
|
+
expectedVersion: z.number().int().positive(),
|
|
415
|
+
idempotencyKey: z.string().trim().min(1).max(200)
|
|
416
|
+
}).strict();
|
|
417
|
+
z.object({
|
|
418
|
+
ok: z.literal(true),
|
|
419
|
+
task: TaskSchema,
|
|
420
|
+
conversation: TaskConversationStateSchema,
|
|
421
|
+
fromAgentId: z.string().optional(),
|
|
422
|
+
toAgentId: z.string(),
|
|
423
|
+
activeSessionKey: z.string(),
|
|
424
|
+
assignmentEpoch: z.number().int().positive()
|
|
425
|
+
});
|
|
334
426
|
z.object({
|
|
335
427
|
ok: z.literal(true),
|
|
336
428
|
task: TaskSchema,
|
|
@@ -340,6 +432,8 @@ z.object({
|
|
|
340
432
|
runs: z.array(TaskRunSchema),
|
|
341
433
|
receipts: z.array(TaskRunReceiptSchema),
|
|
342
434
|
context: z.array(TaskContextEdgeSchema),
|
|
435
|
+
conversation: TaskConversationStateSchema,
|
|
436
|
+
sessions: z.array(TaskSessionLinkSchema),
|
|
343
437
|
authorityGrants: z.array(TaskAuthorityGrantSchema),
|
|
344
438
|
dependencies: z.array(TaskDependencySummarySchema),
|
|
345
439
|
dependents: z.array(TaskDependencySummarySchema),
|
|
@@ -350,4 +444,4 @@ z.object({
|
|
|
350
444
|
items: z.array(TaskRunReceiptSchema)
|
|
351
445
|
});
|
|
352
446
|
//#endregion
|
|
353
|
-
export { TaskCommandRequestSchema, TaskCommandSchema, TaskContextInputSchema, TaskCreateRequestSchema, TaskDependencyUpdateRequestSchema, TaskExecutorSelectionSchema, TaskPatchRequestSchema };
|
|
447
|
+
export { TaskBoardPositionRequestSchema, TaskCommandRequestSchema, TaskCommandSchema, TaskContextInputSchema, TaskCreateRequestSchema, TaskDependencyUpdateRequestSchema, TaskExecutorSelectionSchema, TaskHandoffRequestSchema, TaskPatchRequestSchema };
|
|
@@ -91,6 +91,7 @@ export interface AgentManagerConfig {
|
|
|
91
91
|
getNotesService?: () => NotesService | undefined;
|
|
92
92
|
getProjectService?: () => ProjectService | undefined;
|
|
93
93
|
getLocalAppService?: () => import('../local-apps/index.js').LocalAppService | undefined;
|
|
94
|
+
dispatchTaskEvents?: () => void;
|
|
94
95
|
dispatchTaskRuns?: () => void;
|
|
95
96
|
/** Gateway: starts persisted workflow runs (dedicated chat session per run). */
|
|
96
97
|
getWorkflowRunService?: () => import('../workflows/service/workflow-run-service.types.js').WorkflowRunServiceLike | undefined;
|
|
@@ -250,6 +250,7 @@ var AgentManager = class {
|
|
|
250
250
|
getNotesService: this.config.getNotesService,
|
|
251
251
|
getProjectService: this.config.getProjectService,
|
|
252
252
|
getLocalAppService: this.config.getLocalAppService,
|
|
253
|
+
dispatchTaskEvents: this.config.dispatchTaskEvents,
|
|
253
254
|
dispatchTaskRuns: this.config.dispatchTaskRuns,
|
|
254
255
|
getWorkflowRunService: this.config.getWorkflowRunService,
|
|
255
256
|
getSkillIndexingContext: () => {
|
|
@@ -3,6 +3,7 @@ import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
|
3
3
|
import "../../storage/sqlite/index.js";
|
|
4
4
|
import { sanitizeForPromptLiteral } from "../prompt/sanitize-for-prompt.js";
|
|
5
5
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
6
|
+
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
6
7
|
import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
|
|
7
8
|
import { buildActiveProjectContextForPrompt } from "./project-context.js";
|
|
8
9
|
//#region src/agent/context/execution-scope.ts
|
|
@@ -14,7 +15,8 @@ function bounded(value, max = MAX_OBJECTIVE_TEXT) {
|
|
|
14
15
|
return text.length <= max ? text : `${text.slice(0, max - 1).trimEnd()}…`;
|
|
15
16
|
}
|
|
16
17
|
function taskObjective(sessionKey) {
|
|
17
|
-
const
|
|
18
|
+
const taskId = new TaskConversationRepository().resolveActiveExecutionSession(sessionKey)?.taskId;
|
|
19
|
+
const task = taskId ? new TaskRepository().get(taskId) : void 0;
|
|
18
20
|
if (!task) return void 0;
|
|
19
21
|
const contract = task.contract;
|
|
20
22
|
return {
|
|
@@ -236,6 +236,7 @@ var AgentService = class {
|
|
|
236
236
|
getNotesService: config.getNotesService,
|
|
237
237
|
getProjectService: config.getProjectService,
|
|
238
238
|
getLocalAppService: config.getLocalAppService,
|
|
239
|
+
dispatchTaskEvents: config.dispatchTaskEvents,
|
|
239
240
|
dispatchTaskRuns: config.dispatchTaskRuns,
|
|
240
241
|
getWorkflowRunService: config.getWorkflowRunService,
|
|
241
242
|
onSkillsUpdated: config.onSkillsUpdated,
|
|
@@ -33,6 +33,7 @@ export interface AgentServiceConfig {
|
|
|
33
33
|
getNotesService?: () => NotesService | undefined;
|
|
34
34
|
getProjectService?: () => ProjectService | undefined;
|
|
35
35
|
getLocalAppService?: () => LocalAppService | undefined;
|
|
36
|
+
dispatchTaskEvents?: () => void;
|
|
36
37
|
dispatchTaskRuns?: () => void;
|
|
37
38
|
/**
|
|
38
39
|
* Gateway: reuse the gateway `SessionManager` store so web API and agent share one index + files.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import type { TaskJudgment } from '@xopcai/gateway-contract';
|
|
1
2
|
import { type Config } from '../../config/schema.js';
|
|
2
3
|
import type { SessionStore } from '../../session/store.js';
|
|
3
|
-
import type { TaskJudgment } from '@xopcai/gateway-contract';
|
|
4
4
|
import type { ModelManager } from '../models/index.js';
|
|
5
5
|
export interface TaskTurnCompletion {
|
|
6
6
|
sessionKey: string;
|
|
@@ -4,6 +4,7 @@ import { getAgentDefaultModelRef, init_schema } from "../../config/schema.js";
|
|
|
4
4
|
import { resolveEffectiveAgentProfileForSession } from "../../config/agent-profile.js";
|
|
5
5
|
import { getApiKey, init_providers, resolveModel } from "../../providers/index.js";
|
|
6
6
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
7
|
+
import { TaskConversationRepository } from "../../tasks/task-conversation-repository.js";
|
|
7
8
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
8
9
|
import { completeWithResolvedCredentials } from "../../providers/model-call.js";
|
|
9
10
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
@@ -61,13 +62,13 @@ var TaskJudgeService = class {
|
|
|
61
62
|
#tasks = new TaskRepository();
|
|
62
63
|
#runs = new TaskRunRepository();
|
|
63
64
|
#application = new TaskApplicationService();
|
|
65
|
+
#conversations = new TaskConversationRepository();
|
|
64
66
|
constructor(options) {
|
|
65
67
|
this.options = options;
|
|
66
68
|
}
|
|
67
69
|
async reviewTurn(payload) {
|
|
68
70
|
if (payload.skipTaskReview || payload.aborted || payload.streamError) return;
|
|
69
|
-
const
|
|
70
|
-
const taskId = typeof metadata?.customData?.taskId === "string" ? metadata.customData.taskId.trim() : "";
|
|
71
|
+
const taskId = this.#conversations.resolveActiveExecutionSession(payload.sessionKey)?.taskId;
|
|
71
72
|
if (!taskId) return;
|
|
72
73
|
const task = this.#tasks.get(taskId);
|
|
73
74
|
if (!task?.contract) return;
|
|
@@ -57,6 +57,8 @@ export interface ToolFactoryDeps {
|
|
|
57
57
|
getNotesService?: () => NotesService | undefined;
|
|
58
58
|
getProjectService?: () => ProjectService | undefined;
|
|
59
59
|
getLocalAppService?: () => LocalAppService | undefined;
|
|
60
|
+
/** Gateway: publishes durable Task change notifications. */
|
|
61
|
+
dispatchTaskEvents?: () => void;
|
|
60
62
|
/** Gateway: queues Task execution for xopc_use task start/resume/verify actions. */
|
|
61
63
|
dispatchTaskRuns?: () => void;
|
|
62
64
|
/** Gateway: starts persisted workflow runs (dedicated chat session per run). */
|
|
@@ -305,7 +305,7 @@ var AgentToolsFactory = class {
|
|
|
305
305
|
})] : [],
|
|
306
306
|
...this.deps.getAutomationService ? [createAutomationTool({ getAutomationService: this.deps.getAutomationService })] : [],
|
|
307
307
|
...browserEnabled && this.deps.getBrowserRecipeService ? [createBrowserRecipeTool({ getBrowserRecipeService: this.deps.getBrowserRecipeService })] : [],
|
|
308
|
-
...this.deps.getAutomationService || this.deps.getProjectService || this.deps.getNotesService || this.deps.getLocalAppService || this.deps.dispatchTaskRuns ? [createXopcUseTool({
|
|
308
|
+
...this.deps.getAutomationService || this.deps.getProjectService || this.deps.getNotesService || this.deps.getLocalAppService || this.deps.dispatchTaskEvents || this.deps.dispatchTaskRuns ? [createXopcUseTool({
|
|
309
309
|
getConfig: () => this.deps.getConfig?.(),
|
|
310
310
|
getCurrentAgentId: () => options.agentId,
|
|
311
311
|
getCurrentSessionKey: () => this.deps.getCurrentContext()?.sessionKey,
|
|
@@ -313,6 +313,7 @@ var AgentToolsFactory = class {
|
|
|
313
313
|
getNotesService: this.deps.getNotesService,
|
|
314
314
|
getProjectService: this.deps.getProjectService,
|
|
315
315
|
getLocalAppService: this.deps.getLocalAppService,
|
|
316
|
+
dispatchTaskEvents: this.deps.dispatchTaskEvents,
|
|
316
317
|
dispatchTaskRuns: this.deps.dispatchTaskRuns
|
|
317
318
|
})] : [],
|
|
318
319
|
...browserEnabled ? [createBrowserUseTool({
|
|
@@ -26,6 +26,7 @@ export interface XopcUseToolDeps {
|
|
|
26
26
|
getNotesService?: () => NotesService | undefined;
|
|
27
27
|
getProjectService?: () => ProjectService | undefined;
|
|
28
28
|
getLocalAppService?: () => LocalAppService | undefined;
|
|
29
|
+
dispatchTaskEvents?: () => void;
|
|
29
30
|
dispatchTaskRuns?: () => void;
|
|
30
31
|
}
|
|
31
32
|
type XopcUseDetails = {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { runWithActivityContext } from "../../activity/context.js";
|
|
2
|
+
import { runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
2
3
|
import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
3
4
|
import "../../storage/sqlite/index.js";
|
|
4
5
|
import { ObjectLinkService } from "../../activity/service.js";
|
|
5
6
|
import "../../activity/index.js";
|
|
7
|
+
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
6
8
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
7
9
|
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
8
10
|
import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
|
|
@@ -10,9 +12,10 @@ import { TaskCommandSchema, TaskContextInputSchema } from "../../../packages/gat
|
|
|
10
12
|
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
11
13
|
import { CreateAutomationSchema, UpdateAutomationSchema } from "../../automations/domain/validation.js";
|
|
12
14
|
import "../../automations/index.js";
|
|
13
|
-
import { isValidProjectAgentId, normalizeProjectAgentId } from "../../projects/project-agent.js";
|
|
15
|
+
import { isValidProjectAgentId, normalizeProjectAgentId, resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
14
16
|
import "../../projects/index.js";
|
|
15
17
|
import { TaskContextRepository } from "../../tasks/task-context-repository.js";
|
|
18
|
+
import { enqueueTaskChangedEvent } from "../../tasks/task-change-events.js";
|
|
16
19
|
import { TaskDependencyError, TaskDependencyService } from "../../tasks/task-dependency-service.js";
|
|
17
20
|
import { TaskApplicationService } from "../../tasks/task-application-service.js";
|
|
18
21
|
import { defineTaskContract } from "../../tasks/task-contract-definition.js";
|
|
@@ -20,6 +23,7 @@ import "../../tasks/index.js";
|
|
|
20
23
|
import { randomUUID } from "node:crypto";
|
|
21
24
|
import { Type } from "@sinclair/typebox";
|
|
22
25
|
//#region src/agent/tools/xopc-use-tool.ts
|
|
26
|
+
init_resolve_route();
|
|
23
27
|
const XopcUseToolSchema = Type.Object({
|
|
24
28
|
mode: Type.Union([
|
|
25
29
|
Type.Literal("project"),
|
|
@@ -90,7 +94,6 @@ const TASK_COMMANDS = new Set([
|
|
|
90
94
|
"reopen",
|
|
91
95
|
"add_wait",
|
|
92
96
|
"resolve_wait",
|
|
93
|
-
"delegate",
|
|
94
97
|
"revise_contract"
|
|
95
98
|
]);
|
|
96
99
|
const TASK_CREATE_MODES = new Set(["capture", "start"]);
|
|
@@ -1189,13 +1192,22 @@ async function handleTask(command, args, deps, dryRun) {
|
|
|
1189
1192
|
contract[field] = value;
|
|
1190
1193
|
}
|
|
1191
1194
|
const sessionKey = trimString(args.sessionKey) ?? deps.getCurrentSessionKey?.();
|
|
1192
|
-
const
|
|
1195
|
+
const config = deps.getConfig?.();
|
|
1196
|
+
const projectService = deps.getProjectService?.();
|
|
1197
|
+
const explicitAgentId = trimString(args.agentId);
|
|
1198
|
+
const agentId = config && projectService ? resolveProjectAgentId({
|
|
1199
|
+
config,
|
|
1200
|
+
projects: projectService,
|
|
1201
|
+
explicitAgentId,
|
|
1202
|
+
projectId
|
|
1203
|
+
}) : explicitAgentId ?? (config ? getDefaultAgentId(config) : deps.getCurrentAgentId?.() ?? "main");
|
|
1193
1204
|
const input = {
|
|
1194
1205
|
idempotencyKey: trimString(args.idempotencyKey) ?? randomUUID(),
|
|
1195
1206
|
title: trimString(args.title) ?? objective,
|
|
1196
1207
|
priority: priority ?? "normal",
|
|
1197
1208
|
...dueAt === void 0 ? {} : { dueAt },
|
|
1198
1209
|
...projectId ? { projectId } : {},
|
|
1210
|
+
delegateAgentId: agentId,
|
|
1199
1211
|
...locale ? { locale } : {},
|
|
1200
1212
|
contract: {
|
|
1201
1213
|
...contract,
|
|
@@ -1241,6 +1253,7 @@ async function handleTask(command, args, deps, dryRun) {
|
|
|
1241
1253
|
...created
|
|
1242
1254
|
};
|
|
1243
1255
|
if (created.runId) deps.dispatchTaskRuns?.();
|
|
1256
|
+
else deps.dispatchTaskEvents?.();
|
|
1244
1257
|
return {
|
|
1245
1258
|
ok: true,
|
|
1246
1259
|
task: created.model.task,
|
|
@@ -1274,13 +1287,28 @@ async function handleTask(command, args, deps, dryRun) {
|
|
|
1274
1287
|
dependsOnTaskIds
|
|
1275
1288
|
};
|
|
1276
1289
|
try {
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
task: dependencies.replace({
|
|
1290
|
+
const task = runSqliteWriteTransaction((db) => {
|
|
1291
|
+
const changed = dependencies.replace({
|
|
1280
1292
|
taskId: id,
|
|
1281
1293
|
dependsOnTaskIds,
|
|
1282
1294
|
expectedVersion
|
|
1283
|
-
})
|
|
1295
|
+
});
|
|
1296
|
+
enqueueTaskChangedEvent(db, {
|
|
1297
|
+
taskId: changed.id,
|
|
1298
|
+
projectId: changed.projectId,
|
|
1299
|
+
version: changed.version,
|
|
1300
|
+
changedFields: ["dependencies"],
|
|
1301
|
+
actor: {
|
|
1302
|
+
kind: "agent",
|
|
1303
|
+
id: deps.getCurrentAgentId?.()
|
|
1304
|
+
}
|
|
1305
|
+
});
|
|
1306
|
+
return changed;
|
|
1307
|
+
});
|
|
1308
|
+
deps.dispatchTaskEvents?.();
|
|
1309
|
+
return {
|
|
1310
|
+
ok: true,
|
|
1311
|
+
task,
|
|
1284
1312
|
dependencies: dependencies.listDependencies(id),
|
|
1285
1313
|
dependents: dependencies.listDependents(id)
|
|
1286
1314
|
};
|
|
@@ -1330,9 +1358,22 @@ async function handleTask(command, args, deps, dryRun) {
|
|
|
1330
1358
|
action: "add_task_context",
|
|
1331
1359
|
input
|
|
1332
1360
|
};
|
|
1361
|
+
const task = tasks.require(id);
|
|
1362
|
+
const edge = runSqliteWriteTransaction((db) => {
|
|
1363
|
+
const created = context.add(input);
|
|
1364
|
+
enqueueTaskChangedEvent(db, {
|
|
1365
|
+
taskId: task.id,
|
|
1366
|
+
projectId: task.projectId,
|
|
1367
|
+
version: task.version,
|
|
1368
|
+
changedFields: ["context"],
|
|
1369
|
+
actor: input.createdBy
|
|
1370
|
+
});
|
|
1371
|
+
return created;
|
|
1372
|
+
});
|
|
1373
|
+
deps.dispatchTaskEvents?.();
|
|
1333
1374
|
return {
|
|
1334
1375
|
ok: true,
|
|
1335
|
-
edge
|
|
1376
|
+
edge,
|
|
1336
1377
|
context: context.list(id)
|
|
1337
1378
|
};
|
|
1338
1379
|
}
|
|
@@ -1354,7 +1395,24 @@ async function handleTask(command, args, deps, dryRun) {
|
|
|
1354
1395
|
taskId: id,
|
|
1355
1396
|
edgeId
|
|
1356
1397
|
};
|
|
1357
|
-
|
|
1398
|
+
const task = tasks.get(id);
|
|
1399
|
+
const actor = {
|
|
1400
|
+
kind: "agent",
|
|
1401
|
+
id: deps.getCurrentAgentId?.()
|
|
1402
|
+
};
|
|
1403
|
+
const removed = task ? runSqliteWriteTransaction((db) => {
|
|
1404
|
+
const didRemove = context.remove(id, edgeId);
|
|
1405
|
+
if (didRemove) enqueueTaskChangedEvent(db, {
|
|
1406
|
+
taskId: task.id,
|
|
1407
|
+
projectId: task.projectId,
|
|
1408
|
+
version: task.version,
|
|
1409
|
+
changedFields: ["context"],
|
|
1410
|
+
actor
|
|
1411
|
+
});
|
|
1412
|
+
return didRemove;
|
|
1413
|
+
}) : false;
|
|
1414
|
+
if (removed) deps.dispatchTaskEvents?.();
|
|
1415
|
+
return removed ? {
|
|
1358
1416
|
ok: true,
|
|
1359
1417
|
taskId: id,
|
|
1360
1418
|
edgeId,
|
|
@@ -1418,6 +1476,7 @@ async function handleTask(command, args, deps, dryRun) {
|
|
|
1418
1476
|
...result
|
|
1419
1477
|
};
|
|
1420
1478
|
if (result.runId) deps.dispatchTaskRuns?.();
|
|
1479
|
+
else deps.dispatchTaskEvents?.();
|
|
1421
1480
|
return {
|
|
1422
1481
|
ok: true,
|
|
1423
1482
|
task: result.model.task,
|
|
@@ -1527,6 +1586,7 @@ async function handleTaskRun(command, args, dryRun, deps) {
|
|
|
1527
1586
|
error: result.reason,
|
|
1528
1587
|
...result
|
|
1529
1588
|
};
|
|
1589
|
+
deps.dispatchTaskEvents?.();
|
|
1530
1590
|
return {
|
|
1531
1591
|
ok: true,
|
|
1532
1592
|
run: runs.get(runId),
|
|
@@ -67,6 +67,14 @@ export declare const AutomationActionSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
67
67
|
kind: z.ZodLiteral<"task_command">;
|
|
68
68
|
taskId: z.ZodString;
|
|
69
69
|
command: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
70
|
+
type: z.ZodLiteral<"move">;
|
|
71
|
+
phase: z.ZodEnum<{
|
|
72
|
+
active: "active";
|
|
73
|
+
review: "review";
|
|
74
|
+
ready: "ready";
|
|
75
|
+
backlog: "backlog";
|
|
76
|
+
}>;
|
|
77
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
70
78
|
type: z.ZodLiteral<"mark_ready">;
|
|
71
79
|
}, z.core.$strip>, z.ZodObject<{
|
|
72
80
|
type: z.ZodLiteral<"start">;
|
|
@@ -101,7 +109,9 @@ export declare const AutomationActionSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
101
109
|
type: z.ZodLiteral<"reopen">;
|
|
102
110
|
phase: z.ZodEnum<{
|
|
103
111
|
active: "active";
|
|
112
|
+
review: "review";
|
|
104
113
|
ready: "ready";
|
|
114
|
+
backlog: "backlog";
|
|
105
115
|
}>;
|
|
106
116
|
}, z.core.$strip>, z.ZodObject<{
|
|
107
117
|
type: z.ZodLiteral<"add_wait">;
|
|
@@ -123,9 +133,6 @@ export declare const AutomationActionSchema: z.ZodDiscriminatedUnion<[z.ZodObjec
|
|
|
123
133
|
type: z.ZodLiteral<"resolve_wait">;
|
|
124
134
|
waitId: z.ZodString;
|
|
125
135
|
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
126
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
127
|
-
type: z.ZodLiteral<"delegate">;
|
|
128
|
-
agentId: z.ZodOptional<z.ZodString>;
|
|
129
136
|
}, z.core.$strip>, z.ZodObject<{
|
|
130
137
|
type: z.ZodLiteral<"revise_contract">;
|
|
131
138
|
contract: z.ZodObject<{
|
|
@@ -245,6 +252,14 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
245
252
|
kind: z.ZodLiteral<"task_command">;
|
|
246
253
|
taskId: z.ZodString;
|
|
247
254
|
command: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
255
|
+
type: z.ZodLiteral<"move">;
|
|
256
|
+
phase: z.ZodEnum<{
|
|
257
|
+
active: "active";
|
|
258
|
+
review: "review";
|
|
259
|
+
ready: "ready";
|
|
260
|
+
backlog: "backlog";
|
|
261
|
+
}>;
|
|
262
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
248
263
|
type: z.ZodLiteral<"mark_ready">;
|
|
249
264
|
}, z.core.$strip>, z.ZodObject<{
|
|
250
265
|
type: z.ZodLiteral<"start">;
|
|
@@ -279,7 +294,9 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
279
294
|
type: z.ZodLiteral<"reopen">;
|
|
280
295
|
phase: z.ZodEnum<{
|
|
281
296
|
active: "active";
|
|
297
|
+
review: "review";
|
|
282
298
|
ready: "ready";
|
|
299
|
+
backlog: "backlog";
|
|
283
300
|
}>;
|
|
284
301
|
}, z.core.$strip>, z.ZodObject<{
|
|
285
302
|
type: z.ZodLiteral<"add_wait">;
|
|
@@ -301,9 +318,6 @@ export declare const AutomationSchema: z.ZodObject<{
|
|
|
301
318
|
type: z.ZodLiteral<"resolve_wait">;
|
|
302
319
|
waitId: z.ZodString;
|
|
303
320
|
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
304
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
305
|
-
type: z.ZodLiteral<"delegate">;
|
|
306
|
-
agentId: z.ZodOptional<z.ZodString>;
|
|
307
321
|
}, z.core.$strip>, z.ZodObject<{
|
|
308
322
|
type: z.ZodLiteral<"revise_contract">;
|
|
309
323
|
contract: z.ZodObject<{
|
|
@@ -398,6 +412,14 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
398
412
|
kind: z.ZodLiteral<"task_command">;
|
|
399
413
|
taskId: z.ZodString;
|
|
400
414
|
command: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
415
|
+
type: z.ZodLiteral<"move">;
|
|
416
|
+
phase: z.ZodEnum<{
|
|
417
|
+
active: "active";
|
|
418
|
+
review: "review";
|
|
419
|
+
ready: "ready";
|
|
420
|
+
backlog: "backlog";
|
|
421
|
+
}>;
|
|
422
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
401
423
|
type: z.ZodLiteral<"mark_ready">;
|
|
402
424
|
}, z.core.$strip>, z.ZodObject<{
|
|
403
425
|
type: z.ZodLiteral<"start">;
|
|
@@ -432,7 +454,9 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
432
454
|
type: z.ZodLiteral<"reopen">;
|
|
433
455
|
phase: z.ZodEnum<{
|
|
434
456
|
active: "active";
|
|
457
|
+
review: "review";
|
|
435
458
|
ready: "ready";
|
|
459
|
+
backlog: "backlog";
|
|
436
460
|
}>;
|
|
437
461
|
}, z.core.$strip>, z.ZodObject<{
|
|
438
462
|
type: z.ZodLiteral<"add_wait">;
|
|
@@ -454,9 +478,6 @@ export declare const CreateAutomationSchema: z.ZodObject<{
|
|
|
454
478
|
type: z.ZodLiteral<"resolve_wait">;
|
|
455
479
|
waitId: z.ZodString;
|
|
456
480
|
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
457
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
458
|
-
type: z.ZodLiteral<"delegate">;
|
|
459
|
-
agentId: z.ZodOptional<z.ZodString>;
|
|
460
481
|
}, z.core.$strip>, z.ZodObject<{
|
|
461
482
|
type: z.ZodLiteral<"revise_contract">;
|
|
462
483
|
contract: z.ZodObject<{
|
|
@@ -578,6 +599,14 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
578
599
|
kind: z.ZodLiteral<"task_command">;
|
|
579
600
|
taskId: z.ZodString;
|
|
580
601
|
command: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
602
|
+
type: z.ZodLiteral<"move">;
|
|
603
|
+
phase: z.ZodEnum<{
|
|
604
|
+
active: "active";
|
|
605
|
+
review: "review";
|
|
606
|
+
ready: "ready";
|
|
607
|
+
backlog: "backlog";
|
|
608
|
+
}>;
|
|
609
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
581
610
|
type: z.ZodLiteral<"mark_ready">;
|
|
582
611
|
}, z.core.$strip>, z.ZodObject<{
|
|
583
612
|
type: z.ZodLiteral<"start">;
|
|
@@ -612,7 +641,9 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
612
641
|
type: z.ZodLiteral<"reopen">;
|
|
613
642
|
phase: z.ZodEnum<{
|
|
614
643
|
active: "active";
|
|
644
|
+
review: "review";
|
|
615
645
|
ready: "ready";
|
|
646
|
+
backlog: "backlog";
|
|
616
647
|
}>;
|
|
617
648
|
}, z.core.$strip>, z.ZodObject<{
|
|
618
649
|
type: z.ZodLiteral<"add_wait">;
|
|
@@ -634,9 +665,6 @@ export declare const UpdateAutomationSchema: z.ZodObject<{
|
|
|
634
665
|
type: z.ZodLiteral<"resolve_wait">;
|
|
635
666
|
waitId: z.ZodString;
|
|
636
667
|
resolution: z.ZodOptional<z.ZodUnknown>;
|
|
637
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
638
|
-
type: z.ZodLiteral<"delegate">;
|
|
639
|
-
agentId: z.ZodOptional<z.ZodString>;
|
|
640
668
|
}, z.core.$strip>, z.ZodObject<{
|
|
641
669
|
type: z.ZodLiteral<"revise_contract">;
|
|
642
670
|
contract: z.ZodObject<{
|
|
@@ -43,6 +43,9 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
43
43
|
kind: "task_command";
|
|
44
44
|
taskId: string;
|
|
45
45
|
command?: {
|
|
46
|
+
type: "move";
|
|
47
|
+
phase: "active" | "review" | "ready" | "backlog";
|
|
48
|
+
} | {
|
|
46
49
|
type: "mark_ready";
|
|
47
50
|
} | {
|
|
48
51
|
type: "start";
|
|
@@ -70,7 +73,7 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
70
73
|
resolution: "cancelled" | "done" | "duplicate" | "wont_do";
|
|
71
74
|
} | {
|
|
72
75
|
type: "reopen";
|
|
73
|
-
phase: "active" | "ready";
|
|
76
|
+
phase: "active" | "review" | "ready" | "backlog";
|
|
74
77
|
} | {
|
|
75
78
|
type: "add_wait";
|
|
76
79
|
wait: {
|
|
@@ -83,9 +86,6 @@ export declare function buildAutomationDraftResponse(draft: GeneratedAutomationD
|
|
|
83
86
|
type: "resolve_wait";
|
|
84
87
|
waitId: string;
|
|
85
88
|
resolution?: unknown;
|
|
86
|
-
} | {
|
|
87
|
-
type: "delegate";
|
|
88
|
-
agentId?: string;
|
|
89
89
|
} | {
|
|
90
90
|
type: "revise_contract";
|
|
91
91
|
contract: {
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v120).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
package/dist/src/config/rules.js
CHANGED
|
@@ -2,6 +2,8 @@ import { Hono } from 'hono';
|
|
|
2
2
|
import type { GatewayService } from '../service.js';
|
|
3
3
|
export interface HonoAppConfig {
|
|
4
4
|
service: GatewayService;
|
|
5
|
+
/** Actual host selected for this process; bind config changes take effect after restart. */
|
|
6
|
+
listenHost?: string;
|
|
5
7
|
}
|
|
6
8
|
/**
|
|
7
9
|
* Extension sandbox HTML under `/api/extensions/:id/assets/*` ships its own CSP
|