@xopcai/xopc 0.0.178 → 0.0.180
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-BzGX__8I.js → activity-store-DFKtQDgE.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BzxntcaZ.js → agent-avatar-dicebear-CcTvB_4W.js} +1 -1
- package/dist/gateway/static/root/assets/agents-DgGj9bu6.js +2 -0
- package/dist/gateway/static/root/assets/{api-hi6f2Xtp.js → api-CUClAvuL.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-fTY1F7ac.js → app-management-settings-panel-Ib-cWKHM.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BZ-IxQfB.js → appearance-settings-CRSN8WuA.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-B5xahuT-.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-ZSLLG8wB.js → archive-plugin-BBF9zspN.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D4YktqIF.js → attachment-load-D3QQfA7w.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-BUYrvMmD.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-BIkPxfxj.js → binary-plugins-D78XOjJ3.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Q3v_YQom.js → block-editor-D_VVXlYX.js} +46 -46
- package/dist/gateway/static/root/assets/browser-settings-page-Cjw07q9h.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-M5lTEW1I.js → browser-workflow-inputs-_gu08MA4.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-B3T1KYk4.js → browser-workflows-page-58DBMXgG.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-D_dfVxHY.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-DE09c0VB.js → capability-presets-api-DhCn9rPv.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-LWWIYUT7.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-CFR5FBfS.js → channel-recipient-api-DYtoNV5A.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-Cyj5OunL.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-TEFnV0IG.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-B1mD-3pM.js → connector-logo-CxIXnifA.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-0TobCpBB.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-CwVSLL6N.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-settings-BOIp4q0Z.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BYQJ2XUS.js → directory-picker-path-field-C8_lsW6S.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-BXcb8fwx.js → dreaming-settings-Da9FeWQl.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-O1Xu1r4Q.js → extension-debug-page-CMNnSJP6.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C2Jraq8l.js → extension-page-t0pJqLvM.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DcXQDTpG.js → extension-settings-page-aiR-tKnW.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DmPIZrvg.js → gateway-config-api-CkyQBD6r.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BIZfAgfB.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-BZEkOdPm.js → gateway-startup-retry-CSU7UvzG.js} +1 -1
- package/dist/gateway/static/root/assets/goals-settings-Dx9uTyWF.js +1 -0
- package/dist/gateway/static/root/assets/{heartbeat-settings-BtKu2NWT.js → heartbeat-settings-Cnr5ORXL.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-05Gg8wsU.js → image-generation-api-BR6Kb77X.js} +1 -1
- package/dist/gateway/static/root/assets/index-B0Tdge_q.css +1 -0
- package/dist/gateway/static/root/assets/index-BA56bQ68.js +224 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-CfmDR9Sc.js → keyboard-shortcuts-settings-D76uYKeQ.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DSUNtLHg.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Df8BW1A_.js → local-apps-page-BsLnojTh.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CTwSy7yW.js → locale-store-BNC8HUCI.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-yI8kpQtO.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-B3FvKbaP.js → markdown-split-D6smTQWD.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DsjrvvB6.js → media-plugins-D1TmMF0A.js} +1 -1
- package/dist/gateway/static/root/assets/messages-H_iJjnEM.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-tuzIwy3c.js → notes-page-Vt-diFf0.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-BD297EZt.js +4 -0
- package/dist/gateway/static/root/assets/outcome-detail-page-C5i_ZR9a.js +1 -0
- package/dist/gateway/static/root/assets/{page-tabs-ke9s4nYi.js → page-tabs-BnSzIjH0.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Cp1eI4S9.js → preview-open-alternatives-CF12Eqi4.js} +1 -1
- package/dist/gateway/static/root/assets/product-delivery-BVG-eWQO.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-dXQCMAtH.js → product-open-page-Du0TE_CU.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-D1HGz7Dy.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-CqP2TnW-.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-BXdVJLS3.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-Bl30zjHc.js → save-bar-controls-B53UNtDM.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-DqhmXQKo.js → schedule-field-C3dIMN5q.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DkUCy6vf.js → schema-form-BKvpxqof.js} +1 -1
- package/dist/gateway/static/root/assets/{schemas-DgQq6Z5S.js → schemas-C6onAggk.js} +2 -2
- package/dist/gateway/static/root/assets/sessions-page-CPAwDdl5.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-C-jGsoft.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-C6ZbNpdy.js → settings-form-section-kt6GIS32.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Bk58_cr7.js → settings-loading-skeleton-85eUPcKz.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-k8iE_NdX.js → settings-page-Di5x6Xrc.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DgFSya2e.js → settings-page-layout-CkkCee_x.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-B_KDlyZA.js → setup-status-panel-uxEE6gAB.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CV7nL_J9.js → share-preview-page-BtLEstaI.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-2mcsMWgn.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-ocDwsrEt.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-9_jfsFU5.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-kahBIHg0.js → skills-page.utils-C2SHvq8V.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-JV3-MG5F.js → system-settings-panel-CIJ66cUy.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DFLyzoLO.js → theme-store-ClDa_Bci.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-D0zAsHOo.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-60Aqo-UJ.js → typed-models-lib-GsmwmB40.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CnTkHDnw.js → use-channel-catalog-BQz3K7xj.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-Bn4BLg4W.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-CNa8qUgS.js → voice-api-key-field-Blaxsbb3.js} +1 -1
- package/dist/gateway/static/root/assets/work-copy-Cwyan9Sn.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-iJ9RBSpu.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-CqTH7PQX.js +1 -0
- package/dist/gateway/static/root/assets/work-page-H3m99ccS.js +3 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-yV_x595t.js → workflow-run-setup-panel-CTG4RpRE.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BxZSKMfv.js +11 -0
- package/dist/gateway/static/root/index.html +9 -10
- package/dist/package.js +1 -1
- package/dist/packages/gateway-contract/src/outcomes.js +137 -0
- package/dist/packages/gateway-contract/src/product-delivery.js +1 -0
- package/dist/packages/gateway-contract/src/work-intake.js +85 -0
- package/dist/src/activity/service.d.ts +1 -0
- package/dist/src/activity/service.js +4 -1
- package/dist/src/agent/agent-manager.d.ts +4 -1
- package/dist/src/agent/agent-manager.js +21 -7
- package/dist/src/agent/bootstrap/filter-bootstrap-files.js +1 -1
- package/dist/src/agent/code-intelligence/binary.js +1 -1
- package/dist/src/agent/context/execution-scope.d.ts +1 -1
- package/dist/src/agent/context/execution-scope.js +6 -4
- package/dist/src/agent/embedded/model-runtime.js +1 -1
- package/dist/src/agent/embedded/run-for-session.d.ts +2 -0
- package/dist/src/agent/embedded/run-for-session.js +3 -1
- package/dist/src/agent/goals/post-turn.js +7 -6
- package/dist/src/agent/image/tool-model-config.js +1 -1
- package/dist/src/agent/inbound/turn-dispatcher.d.ts +6 -1
- package/dist/src/agent/inbound/turn-dispatcher.js +5 -2
- package/dist/src/agent/ipc/inbox.js +1 -1
- package/dist/src/agent/lifecycle/timeout-wrapper.d.ts +2 -0
- package/dist/src/agent/lifecycle/timeout-wrapper.js +39 -9
- package/dist/src/agent/mcp/bundle-mcp-materialize.js +2 -2
- package/dist/src/agent/mcp/bundle-mcp-runtime.js +6 -1
- package/dist/src/agent/mcp/bundle-mcp-types.d.ts +1 -1
- package/dist/src/agent/mcp/mcp-stdio-transport.js +1 -1
- package/dist/src/agent/mcp/mcp-transport-config.d.ts +2 -0
- package/dist/src/agent/mcp/mcp-transport-config.js +10 -3
- package/dist/src/agent/mcp/mcp-transport.d.ts +1 -0
- package/dist/src/agent/mcp/mcp-transport.js +5 -2
- package/dist/src/agent/memory/dreaming/config.js +1 -1
- package/dist/src/agent/memory/user-context-coordinator.d.ts +1 -0
- package/dist/src/agent/memory/user-context-coordinator.js +17 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.d.ts +1 -1
- package/dist/src/agent/orchestration/run-agent-turn-with-timeout.js +6 -2
- package/dist/src/agent/outcomes/{task-evaluation.d.ts → execution-evaluation.d.ts} +3 -3
- package/dist/src/agent/outcomes/{task-evaluation.js → execution-evaluation.js} +5 -5
- package/dist/src/agent/outcomes/execution-verifier.d.ts +29 -0
- package/dist/src/agent/outcomes/{task-verifier.js → execution-verifier.js} +4 -4
- package/dist/src/agent/service/direct-turn-helpers.d.ts +1 -0
- package/dist/src/agent/service/direct-turn-helpers.js +1 -0
- package/dist/src/agent/service/process-direct-one-shot.d.ts +3 -0
- package/dist/src/agent/service/process-direct-one-shot.js +4 -1
- package/dist/src/agent/service/process-direct-streaming.js +3 -1
- package/dist/src/agent/service.d.ts +1 -0
- package/dist/src/agent/service.js +5 -2
- package/dist/src/agent/session/session-inspector.js +1 -1
- package/dist/src/agent/skills/config.js +6 -0
- package/dist/src/agent/skills/filesystem-watcher.d.ts +4 -0
- package/dist/src/agent/skills/filesystem-watcher.js +16 -7
- package/dist/src/agent/skills/hub-lock.js +1 -1
- package/dist/src/agent/skills/index.d.ts +10 -7
- package/dist/src/agent/skills/index.js +56 -47
- package/dist/src/agent/skills/skill-manage-ops.js +1 -1
- package/dist/src/agent/skills/skill-manager.d.ts +5 -2
- package/dist/src/agent/skills/skill-manager.js +10 -5
- package/dist/src/agent/skills/skill-sources.d.ts +18 -0
- package/dist/src/agent/skills/skill-sources.js +143 -0
- package/dist/src/agent/skills/types.d.ts +25 -2
- package/dist/src/agent/tools/delegate-tool.js +2 -1
- package/dist/src/agent/tools/executor.d.ts +2 -0
- package/dist/src/agent/tools/executor.js +18 -11
- package/dist/src/agent/tools/factory.js +18 -1
- package/dist/src/agent/tools/goal-tool.js +5 -3
- package/dist/src/agent/tools/index.d.ts +1 -0
- package/dist/src/agent/tools/index.js +2 -1
- package/dist/src/agent/tools/managed-job-tool.d.ts +2 -0
- package/dist/src/agent/tools/managed-job-tool.js +160 -0
- package/dist/src/agent/tools/todo-tool.d.ts +5 -0
- package/dist/src/agent/tools/todo-tool.js +16 -4
- package/dist/src/agent/tools/update-plan-tool.d.ts +1 -0
- package/dist/src/agent/tools/update-plan-tool.js +6 -0
- package/dist/src/agent/workspace-runtime/registry.d.ts +3 -0
- package/dist/src/agent/workspace-runtime/registry.js +3 -1
- package/dist/src/agent-runtime/index.js +1 -1
- package/dist/src/agent-runtime/runtime-profile.js +1 -1
- package/dist/src/auth/credentials.d.ts +9 -1
- package/dist/src/auth/credentials.js +112 -56
- package/dist/src/auth/model-credential-store.js +7 -22
- package/dist/src/auth/oauth-provider-lock.d.ts +5 -0
- package/dist/src/auth/oauth-provider-lock.js +91 -0
- package/dist/src/auth/profiles/store.js +1 -1
- package/dist/src/auth/sync-provider-auth.js +2 -2
- package/dist/src/automations/domain/defaults.d.ts +8 -1
- package/dist/src/automations/domain/defaults.js +9 -2
- package/dist/src/automations/domain/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +33 -7
- package/dist/src/automations/domain/validation.d.ts +8 -0
- package/dist/src/automations/domain/validation.js +2 -0
- package/dist/src/automations/draft/automation-draft-validator.d.ts +2 -1
- package/dist/src/automations/index.js +2 -2
- package/dist/src/automations/service/action-executor.d.ts +2 -2
- package/dist/src/automations/service/action-executor.js +144 -34
- package/dist/src/automations/service/automation-service.d.ts +4 -0
- package/dist/src/automations/service/automation-service.js +197 -18
- package/dist/src/automations/storage/automation-run-repository.d.ts +1 -0
- package/dist/src/automations/storage/automation-run-repository.js +37 -7
- package/dist/src/automations/storage/index.js +2 -2
- package/dist/src/browser/providers/browser-ext-install.js +1 -1
- package/dist/src/browser/providers/cloakbrowser.js +2 -2
- package/dist/src/channels/attachments/voice-stt-webchat.d.ts +0 -3
- package/dist/src/channels/attachments/voice-stt-webchat.js +1 -24
- package/dist/src/chat-commands/builtins/goal.js +5 -4
- package/dist/src/cli/commands/agents.js +1 -1
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/cli/commands/doctor/checks/provider-auth.js +1 -1
- package/dist/src/cli/commands/goal.js +6 -5
- package/dist/src/cli/commands/models.js +1 -1
- package/dist/src/cli/commands/tunnel.js +3 -3
- package/dist/src/cli/utils/oauth-login.js +1 -7
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/config/index.js +4 -4
- package/dist/src/config/loader.js +1 -1
- package/dist/src/config/models-json.js +1 -1
- package/dist/src/config/schema.d.ts +3 -0
- package/dist/src/config/schema.js +2 -1
- package/dist/src/connectors/learning-coordinator.js +7 -1
- package/dist/src/connectors/source-change-publisher.d.ts +17 -0
- package/dist/src/connectors/source-change-publisher.js +148 -0
- package/dist/src/discussions/analyzer.d.ts +35 -0
- package/dist/src/discussions/analyzer.js +127 -0
- package/dist/src/discussions/index.d.ts +7 -0
- package/dist/src/discussions/index.js +7 -0
- package/dist/src/discussions/live-worker.d.ts +33 -0
- package/dist/src/discussions/live-worker.js +148 -0
- package/dist/src/discussions/pipeline.d.ts +33 -0
- package/dist/src/discussions/pipeline.js +205 -0
- package/dist/src/discussions/project-inference.d.ts +13 -0
- package/dist/src/discussions/project-inference.js +19 -0
- package/dist/src/discussions/repository.d.ts +29 -0
- package/dist/src/discussions/repository.js +255 -0
- package/dist/src/discussions/service.d.ts +51 -0
- package/dist/src/discussions/service.js +335 -0
- package/dist/src/discussions/transcript.d.ts +3 -0
- package/dist/src/discussions/transcript.js +15 -0
- package/dist/src/discussions/types.d.ts +116 -0
- package/dist/src/discussions/types.js +10 -0
- package/dist/src/discussions/worker.d.ts +18 -0
- package/dist/src/discussions/worker.js +74 -0
- package/dist/src/extensions/activation-context.js +2 -1
- package/dist/src/extensions/lockfile.js +1 -1
- package/dist/src/extensions/sdk/testing.js +1 -1
- package/dist/src/gateway/agents-admin.js +3 -3
- package/dist/src/gateway/chat-stream/mapper.js +53 -3
- package/dist/src/gateway/chat-stream/protocol.d.ts +17 -1
- package/dist/src/gateway/file-path-classifier.js +1 -1
- package/dist/src/gateway/hono/app.js +8 -3
- package/dist/src/gateway/hono/lib/config-payload.js +2 -2
- package/dist/src/gateway/hono/middleware/auth.js +2 -2
- package/dist/src/gateway/hono/middleware/logger.js +1 -1
- package/dist/src/gateway/hono/middleware/strict-rate-limit.js +1 -1
- package/dist/src/gateway/hono/oauth-async.js +1 -7
- package/dist/src/gateway/hono/oauth.js +1 -7
- package/dist/src/gateway/hono/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +2 -2
- package/dist/src/gateway/hono/routes/connectors.js +79 -0
- package/dist/src/gateway/hono/routes/discussions.d.ts +3 -0
- package/dist/src/gateway/hono/routes/discussions.js +177 -0
- package/dist/src/gateway/hono/routes/execution-receipts.d.ts +3 -0
- package/dist/src/gateway/hono/routes/execution-receipts.js +163 -0
- package/dist/src/gateway/hono/routes/exposure.js +1 -1
- package/dist/src/gateway/hono/routes/goals.js +3 -288
- package/dist/src/gateway/hono/routes/home.d.ts +2 -102
- package/dist/src/gateway/hono/routes/home.js +8 -424
- package/dist/src/gateway/hono/routes/index.js +6 -2
- package/dist/src/gateway/hono/routes/memory.js +7 -7
- package/dist/src/gateway/hono/routes/models.js +1 -1
- package/dist/src/gateway/hono/routes/notes.js +30 -0
- package/dist/src/gateway/hono/routes/projects.js +8 -152
- package/dist/src/gateway/hono/routes/shares.js +1 -1
- package/dist/src/gateway/hono/routes/status.js +2 -2
- package/dist/src/gateway/hono/routes/tunnel.js +3 -3
- package/dist/src/gateway/hono/routes/voice.js +1 -1
- package/dist/src/gateway/hono/routes/work.d.ts +3 -0
- package/dist/src/gateway/hono/routes/work.js +207 -0
- package/dist/src/gateway/hono/routes/you.js +13 -15
- package/dist/src/gateway/index.js +2 -2
- package/dist/src/gateway/runtime-config.js +2 -2
- package/dist/src/gateway/security/audit.js +2 -2
- package/dist/src/gateway/security/index.js +1 -1
- package/dist/src/gateway/service/config-coordinator.js +2 -2
- package/dist/src/gateway/service/run-gateway-agent.js +46 -51
- package/dist/src/gateway/service.d.ts +8 -1
- package/dist/src/gateway/service.js +142 -15
- package/dist/src/goals/goal-queue-store.d.ts +1 -0
- package/dist/src/goals/goal-queue-store.js +5 -1
- package/dist/src/goals/goal-queue-types.d.ts +11 -1
- package/dist/src/goals/goal-runner.js +10 -6
- package/dist/src/goals/goal-service.d.ts +2 -15
- package/dist/src/goals/goal-service.js +9 -42
- package/dist/src/goals/goal-store.d.ts +1 -18
- package/dist/src/goals/goal-store.js +25 -231
- package/dist/src/goals/goal-workflow-judge.js +1 -1
- package/dist/src/goals/index.d.ts +0 -4
- package/dist/src/goals/index.js +1 -3
- package/dist/src/goals/types.d.ts +4 -66
- package/dist/src/notes/agent-context.js +1 -1
- package/dist/src/notes/service.d.ts +1 -0
- package/dist/src/notes/service.js +10 -1
- package/dist/src/notes/types.d.ts +1 -0
- package/dist/src/proactive/events/product-event-bridge.d.ts +7 -0
- package/dist/src/proactive/events/product-event-bridge.js +84 -0
- package/dist/src/proactive/execution/context.d.ts +27 -11
- package/dist/src/proactive/execution/context.js +259 -25
- package/dist/src/proactive/execution/repository.js +18 -5
- package/dist/src/proactive/execution/types.d.ts +7 -1
- package/dist/src/proactive/execution/worker.js +7 -6
- package/dist/src/proactive/inbox/repository.js +8 -2
- package/dist/src/proactive/index.d.ts +4 -2
- package/dist/src/proactive/index.js +5 -3
- package/dist/src/proactive/temporal/worker.d.ts +16 -0
- package/dist/src/proactive/temporal/worker.js +110 -0
- package/dist/src/projects/project-loop.js +3 -3
- package/dist/src/providers/auth-runtime/oauth.js +12 -0
- package/dist/src/providers/auth-runtime/resolve-auth.js +1 -1
- package/dist/src/providers/index.js +2 -2
- package/dist/src/providers/model-registry.js +1 -1
- package/dist/src/providers/register-runtime-providers.js +1 -1
- package/dist/src/share/share-zip.js +1 -1
- package/dist/src/share/site-proxy.js +1 -1
- package/dist/src/storage/sqlite/activity-repository.d.ts +1 -0
- package/dist/src/storage/sqlite/activity-repository.js +4 -1
- package/dist/src/storage/sqlite/connector-sync-policy-repository.d.ts +20 -0
- package/dist/src/storage/sqlite/connector-sync-policy-repository.js +50 -0
- package/dist/src/storage/sqlite/execution-receipt-repository.d.ts +146 -0
- package/dist/src/storage/sqlite/execution-receipt-repository.js +235 -0
- package/dist/src/storage/sqlite/index.d.ts +4 -2
- package/dist/src/storage/sqlite/index.js +6 -4
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +3 -0
- package/dist/src/storage/sqlite/knowledge-repository.js +9 -1
- package/dist/src/storage/sqlite/memory-records-repository.js +1 -1
- package/dist/src/storage/sqlite/migrations/075_connector_sync_policies.sql +13 -0
- package/dist/src/storage/sqlite/migrations/076_meeting_preparation_scenario.sql +29 -0
- package/dist/src/storage/sqlite/migrations/077_proactive_insight_fingerprints.sql +4 -0
- package/dist/src/storage/sqlite/migrations/078_discussion_captures.sql +64 -0
- package/dist/src/storage/sqlite/migrations/079_discussion_follow_up_scenario.sql +29 -0
- package/dist/src/storage/sqlite/migrations/080_task_outcome_context.sql +15 -0
- package/dist/src/storage/sqlite/migrations/081_project_monitoring_policies.sql +10 -0
- package/dist/src/storage/sqlite/migrations/082_one_click_live_discussions.sql +100 -0
- package/dist/src/storage/sqlite/migrations/083_session_task_plans.sql +9 -0
- package/dist/src/storage/sqlite/migrations/084_work_intake_lifecycle.sql +26 -0
- package/dist/src/storage/sqlite/migrations/085_task_outcome_projection.sql +19 -0
- package/dist/src/storage/sqlite/migrations/086_outcome_aggregates.sql +168 -0
- package/dist/src/storage/sqlite/migrations/087_context_snapshots.sql +21 -0
- package/dist/src/storage/sqlite/migrations/088_automation_execution_deadlines.sql +5 -0
- package/dist/src/storage/sqlite/migrations/089_automation_run_leases.sql +8 -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/notes-repository.js +9 -0
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/schema.sql +89 -44
- package/dist/src/storage/sqlite/session-repository.js +1 -1
- package/dist/src/storage/sqlite/session-task-plan-repository.d.ts +20 -0
- package/dist/src/storage/sqlite/session-task-plan-repository.js +77 -0
- package/dist/src/tui/backends/embedded-backend.d.ts +2 -0
- package/dist/src/tui/backends/embedded-backend.js +12 -8
- package/dist/src/tui/tui-backend.d.ts +2 -0
- package/dist/src/tui/tui-oauth-login.js +1 -7
- package/dist/src/tui/tui-picker-overlay.js +1 -0
- package/dist/src/tui/tui-picker-services.d.ts +1 -0
- package/dist/src/tui/tui-skills-autocomplete.d.ts +6 -2
- package/dist/src/tui/tui-skills-autocomplete.js +10 -6
- package/dist/src/tui/tui-startup-resources.d.ts +3 -1
- package/dist/src/tui/tui-startup-resources.js +4 -3
- package/dist/src/tui/tui.js +4 -1
- package/dist/src/tunnel/frpc-binary.js +1 -1
- package/dist/src/tunnel/frpc-extract.js +1 -1
- package/dist/src/tunnel/index.js +2 -2
- package/dist/src/user-context/context-compiler.d.ts +31 -0
- package/dist/src/user-context/context-compiler.js +51 -0
- package/dist/src/voice/local/model-files.js +1 -1
- package/dist/src/voice/stt/config.d.ts +4 -0
- package/dist/src/voice/stt/config.js +26 -0
- package/dist/src/voice/stt/index.d.ts +1 -0
- package/dist/src/voice/stt/index.js +2 -1
- package/dist/src/voice/stt/list-providers.js +1 -1
- package/dist/src/work/attention-governor.d.ts +20 -0
- package/dist/src/work/attention-governor.js +46 -0
- package/dist/src/work/execution-context.d.ts +16 -0
- package/dist/src/work/execution-context.js +66 -0
- package/dist/src/work/home-query-service.d.ts +147 -0
- package/dist/src/work/home-query-service.js +389 -0
- package/dist/src/work/index.d.ts +14 -0
- package/dist/src/work/index.js +15 -0
- package/dist/src/work/outcome-contract-definition.d.ts +8 -0
- package/dist/src/work/outcome-contract-definition.js +15 -0
- package/dist/src/work/outcome-execution-service.d.ts +27 -0
- package/dist/src/work/outcome-execution-service.js +60 -0
- package/dist/src/work/outcome-projection-service.d.ts +7 -0
- package/dist/src/work/outcome-projection-service.js +51 -0
- package/dist/src/work/outcome-receipt-service.d.ts +13 -0
- package/dist/src/work/outcome-receipt-service.js +55 -0
- package/dist/src/work/outcome-repository.d.ts +50 -0
- package/dist/src/work/outcome-repository.js +112 -0
- package/dist/src/work/outcome-run-coordinator.d.ts +25 -0
- package/dist/src/work/outcome-run-coordinator.js +117 -0
- package/dist/src/work/project-monitoring-service.d.ts +21 -0
- package/dist/src/work/project-monitoring-service.js +76 -0
- package/dist/src/work/project-operating-view-service.d.ts +10 -0
- package/dist/src/work/project-operating-view-service.js +46 -0
- package/dist/src/work/work-intake-repository.d.ts +49 -0
- package/dist/src/work/work-intake-repository.js +97 -0
- package/dist/src/work/work-intake-service.d.ts +26 -0
- package/dist/src/work/work-intake-service.js +171 -0
- package/dist/src/work/work-value-metrics-service.d.ts +4 -0
- package/dist/src/work/work-value-metrics-service.js +88 -0
- package/dist/src/work-items/work-item-service.d.ts +0 -2
- package/dist/src/work-items/work-item-service.js +0 -28
- package/dist/src/workflows/service/workflow-run-service.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.types.d.ts +3 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
- package/package.json +1 -1
- package/dist/gateway/static/root/assets/agents-DC9F12Kw.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-5bKr05Fa.js +0 -1
- package/dist/gateway/static/root/assets/automation-suggestion-card-B7mxFRtf.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-Dg6dmt5g.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-BHoo6Rpq.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BlsqN8Fu.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DJeT8_B4.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-C4VVjYEm.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-vdf8kB16.js +0 -1
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DNcrDThX.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-B1urphOZ.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DTL6J3EP.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-DmObBx9b.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-BRhmmBe9.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-C1k7_s_O.js +0 -4
- package/dist/gateway/static/root/assets/goals-config-api-Fwu1wjEP.js +0 -1
- package/dist/gateway/static/root/assets/goals-page-hOu9uA3q.js +0 -2
- package/dist/gateway/static/root/assets/goals-settings-DY-JjvHz.js +0 -1
- package/dist/gateway/static/root/assets/index-C0CGebQ1.js +0 -212
- package/dist/gateway/static/root/assets/index-eqq25gvV.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-EjsNT7nJ.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-Dswjlraa.js +0 -7
- package/dist/gateway/static/root/assets/messages-DP6tPKk-.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-DSh3-hMY.js +0 -4
- package/dist/gateway/static/root/assets/product-delivery-BTRT9kCS.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-D0QPRHR_.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CI5Vz62F.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-S1jpzBS5.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-CTm66k7h.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-CU52AUVD.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DK6XK95e.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-Bvv_u4ii.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-BGHvVbay.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-XwpxdZFr.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-DBCMk-Vn.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-C1UIdsCl.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DEAQepB8.js +0 -1
- package/dist/gateway/static/root/assets/work-page-D5qYmCTq.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-yrK17ZZ5.js +0 -11
- package/dist/src/agent/outcomes/task-verifier.d.ts +0 -29
- package/dist/src/gateway/hono/routes/task-outcomes.d.ts +0 -3
- package/dist/src/gateway/hono/routes/task-outcomes.js +0 -109
- package/dist/src/goals/goal-contract-draft.d.ts +0 -15
- package/dist/src/goals/goal-contract-draft.js +0 -112
- package/dist/src/goals/goal-evidence-review.d.ts +0 -15
- package/dist/src/goals/goal-evidence-review.js +0 -89
- package/dist/src/storage/sqlite/task-outcome-repository.d.ts +0 -90
- package/dist/src/storage/sqlite/task-outcome-repository.js +0 -138
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { buildSessionKey, init_session_key, sanitizeSegment } from "../../../routing/session-key.js";
|
|
2
2
|
import { getDefaultAgentId, init_resolve_route } from "../../../routing/resolve-route.js";
|
|
3
3
|
import { GoalService, normalizeGoalUiLocale } from "../../../goals/goal-service.js";
|
|
4
|
-
import { draftGoalContract } from "../../../goals/goal-contract-draft.js";
|
|
5
|
-
import { reviewGoalEvidenceRequirement } from "../../../goals/goal-evidence-review.js";
|
|
6
4
|
import "../../../goals/index.js";
|
|
7
|
-
import { resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
8
|
-
import "../../../projects/index.js";
|
|
9
5
|
import { createWorkflowCatalog } from "../../../agent/workflow/catalog.js";
|
|
10
|
-
import { MAX_WEBCHAT_ATTACHMENT_FILE_BYTES } from "../../chat-limits.js";
|
|
11
6
|
//#region src/gateway/hono/routes/goals.ts
|
|
12
7
|
init_session_key();
|
|
13
8
|
init_resolve_route();
|
|
@@ -27,48 +22,6 @@ function parseBodyGoalStatus(raw) {
|
|
|
27
22
|
function parsePriority(raw) {
|
|
28
23
|
return raw === "low" || raw === "normal" || raw === "high" ? raw : void 0;
|
|
29
24
|
}
|
|
30
|
-
function parseGoalContract(raw) {
|
|
31
|
-
if (raw === void 0) return void 0;
|
|
32
|
-
if (!raw || typeof raw !== "object" || Array.isArray(raw)) return null;
|
|
33
|
-
const value = raw;
|
|
34
|
-
const list = (candidate) => {
|
|
35
|
-
if (candidate === void 0) return void 0;
|
|
36
|
-
if (!Array.isArray(candidate) || candidate.some((item) => typeof item !== "string")) return void 0;
|
|
37
|
-
return candidate.map((item) => item.trim()).filter(Boolean).slice(0, 20);
|
|
38
|
-
};
|
|
39
|
-
const evidencePlan = list(value.evidencePlan);
|
|
40
|
-
const criteria = list(value.criteria);
|
|
41
|
-
let outcomeMetric;
|
|
42
|
-
if (value.outcomeMetric === null) outcomeMetric = null;
|
|
43
|
-
else if (value.outcomeMetric !== void 0) {
|
|
44
|
-
if (!value.outcomeMetric || typeof value.outcomeMetric !== "object" || Array.isArray(value.outcomeMetric)) return null;
|
|
45
|
-
const metric = value.outcomeMetric;
|
|
46
|
-
if (typeof metric.name !== "string" || !metric.name.trim() || typeof metric.baselineValue !== "number" || !Number.isFinite(metric.baselineValue) || typeof metric.targetValue !== "number" || !Number.isFinite(metric.targetValue) || metric.currentValue !== void 0 && (typeof metric.currentValue !== "number" || !Number.isFinite(metric.currentValue)) || metric.direction !== void 0 && metric.direction !== "increase" && metric.direction !== "decrease" || metric.unit !== void 0 && typeof metric.unit !== "string" || metric.sourceUrl !== void 0 && typeof metric.sourceUrl !== "string" || metric.measuredAt !== void 0 && (typeof metric.measuredAt !== "number" || !Number.isFinite(metric.measuredAt))) return null;
|
|
47
|
-
outcomeMetric = {
|
|
48
|
-
name: metric.name.trim(),
|
|
49
|
-
baselineValue: metric.baselineValue,
|
|
50
|
-
targetValue: metric.targetValue,
|
|
51
|
-
currentValue: typeof metric.currentValue === "number" ? metric.currentValue : void 0,
|
|
52
|
-
unit: typeof metric.unit === "string" ? metric.unit.trim() || void 0 : void 0,
|
|
53
|
-
direction: metric.direction === "increase" || metric.direction === "decrease" ? metric.direction : void 0,
|
|
54
|
-
sourceUrl: typeof metric.sourceUrl === "string" ? metric.sourceUrl.trim() || void 0 : void 0,
|
|
55
|
-
measuredAt: typeof metric.measuredAt === "number" ? metric.measuredAt : void 0
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
if (value.evidencePlan !== void 0 && !evidencePlan || value.criteria !== void 0 && !criteria) return null;
|
|
59
|
-
if (value.objective !== void 0 && typeof value.objective !== "string") return null;
|
|
60
|
-
if (value.scopeBoundary !== void 0 && typeof value.scopeBoundary !== "string") return null;
|
|
61
|
-
return {
|
|
62
|
-
objective: typeof value.objective === "string" ? value.objective.trim() : void 0,
|
|
63
|
-
scopeBoundary: typeof value.scopeBoundary === "string" ? value.scopeBoundary.trim() : void 0,
|
|
64
|
-
evidencePlan,
|
|
65
|
-
criteria,
|
|
66
|
-
outcomeMetric
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function maxBase64CharsForBinary(maxBinaryBytes) {
|
|
70
|
-
return 4 * Math.ceil(maxBinaryBytes / 3);
|
|
71
|
-
}
|
|
72
25
|
function parseUserTurnAttachment(raw) {
|
|
73
26
|
if (!raw || typeof raw !== "object") return null;
|
|
74
27
|
const value = raw;
|
|
@@ -94,13 +47,6 @@ function parseUserTurnInput(raw) {
|
|
|
94
47
|
...attachments?.length ? { attachments } : {}
|
|
95
48
|
};
|
|
96
49
|
}
|
|
97
|
-
function validateUserTurnAttachments(attachments) {
|
|
98
|
-
if (!attachments?.length) return null;
|
|
99
|
-
if (attachments.length > 10) return `Too many attachments (max 10)`;
|
|
100
|
-
const maxDataChars = maxBase64CharsForBinary(MAX_WEBCHAT_ATTACHMENT_FILE_BYTES);
|
|
101
|
-
for (const attachment of attachments) if (attachment.data && attachment.data.length > maxDataChars) return `Attachment exceeds maximum size (${MAX_WEBCHAT_ATTACHMENT_FILE_BYTES} bytes)`;
|
|
102
|
-
return null;
|
|
103
|
-
}
|
|
104
50
|
const STOP_WORDS = new Set([
|
|
105
51
|
"a",
|
|
106
52
|
"an",
|
|
@@ -293,116 +239,6 @@ function registerGoalsRoutes(authenticated, deps) {
|
|
|
293
239
|
queue: deps.service.getGoalQueueSnapshot()
|
|
294
240
|
});
|
|
295
241
|
});
|
|
296
|
-
authenticated.post("/api/goals", async (c) => {
|
|
297
|
-
const body = await c.req.json().catch(() => ({}));
|
|
298
|
-
const title = typeof body.title === "string" ? body.title.trim() : "";
|
|
299
|
-
if (!title) return c.json({
|
|
300
|
-
ok: false,
|
|
301
|
-
error: "Missing title"
|
|
302
|
-
}, 400);
|
|
303
|
-
const contract = parseGoalContract(body.contract);
|
|
304
|
-
if (contract === null) return c.json({
|
|
305
|
-
ok: false,
|
|
306
|
-
error: "Invalid goal contract"
|
|
307
|
-
}, 400);
|
|
308
|
-
const sessionKey = typeof body.sessionKey === "string" && body.sessionKey.trim() ? body.sessionKey.trim() : void 0;
|
|
309
|
-
const contextMessage = parseUserTurnInput(body.contextMessage) ?? { text: "" };
|
|
310
|
-
const attachmentError = validateUserTurnAttachments(contextMessage.attachments);
|
|
311
|
-
if (attachmentError) return c.json({
|
|
312
|
-
ok: false,
|
|
313
|
-
error: attachmentError
|
|
314
|
-
}, 400);
|
|
315
|
-
const preparedContextAttachments = contextMessage.attachments?.length ? await deps.service.agentService.prepareInboundAttachments(sessionKey ?? `goal:${Date.now()}`, contextMessage.attachments) : void 0;
|
|
316
|
-
const projectId = typeof body.projectId === "string" && body.projectId.trim() ? body.projectId.trim() : void 0;
|
|
317
|
-
if (projectId && !deps.service.projects.get(projectId)) return c.json({
|
|
318
|
-
ok: false,
|
|
319
|
-
error: "Project not found"
|
|
320
|
-
}, 404);
|
|
321
|
-
const agentId = sessionKey ? typeof body.agentId === "string" && body.agentId.trim() ? body.agentId.trim() : void 0 : resolveProjectAgentId({
|
|
322
|
-
config: cfg(),
|
|
323
|
-
projects: deps.service.projects,
|
|
324
|
-
explicitAgentId: typeof body.agentId === "string" ? body.agentId : void 0,
|
|
325
|
-
projectId
|
|
326
|
-
});
|
|
327
|
-
const maxTurns = typeof body.maxTurns === "number" && Number.isFinite(body.maxTurns) ? Math.max(1, Math.min(500, Math.floor(body.maxTurns))) : void 0;
|
|
328
|
-
const goal = goals.create({
|
|
329
|
-
title,
|
|
330
|
-
description: contextMessage.text || void 0,
|
|
331
|
-
sessionKey,
|
|
332
|
-
agentId,
|
|
333
|
-
priority: body.priority === "low" || body.priority === "high" ? body.priority : "normal",
|
|
334
|
-
deadlineAt: typeof body.deadlineAt === "number" && Number.isFinite(body.deadlineAt) ? body.deadlineAt : void 0,
|
|
335
|
-
judgeModelRef: typeof body.judgeModelRef === "string" ? body.judgeModelRef : void 0,
|
|
336
|
-
maxTurns,
|
|
337
|
-
uiLocale: normalizeGoalUiLocale(body.uiLocale),
|
|
338
|
-
source: body.source === "cli" || body.source === "cron" || body.source === "workflow" || body.source === "channel" || body.source === "api" ? body.source : "chat",
|
|
339
|
-
projectId,
|
|
340
|
-
contract,
|
|
341
|
-
config: cfg()
|
|
342
|
-
});
|
|
343
|
-
goals.setContextMessage({
|
|
344
|
-
goalId: goal.id,
|
|
345
|
-
text: contextMessage.text,
|
|
346
|
-
attachments: preparedContextAttachments
|
|
347
|
-
});
|
|
348
|
-
return c.json({
|
|
349
|
-
ok: true,
|
|
350
|
-
goal: goals.get(goal.id)
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
authenticated.post("/api/goals/contract/draft", async (c) => {
|
|
354
|
-
const body = await c.req.json().catch(() => ({}));
|
|
355
|
-
const title = typeof body.title === "string" ? body.title.trim() : "";
|
|
356
|
-
if (!title) return c.json({
|
|
357
|
-
ok: false,
|
|
358
|
-
error: "Missing title"
|
|
359
|
-
}, 400);
|
|
360
|
-
const parsed = parseGoalContract({ criteria: body.criteria });
|
|
361
|
-
if (!parsed) return c.json({
|
|
362
|
-
ok: false,
|
|
363
|
-
error: "Invalid acceptance criteria"
|
|
364
|
-
}, 400);
|
|
365
|
-
const modelRef = typeof body.modelRef === "string" && body.modelRef.trim() ? body.modelRef.trim() : typeof body.judgeModelRef === "string" && body.judgeModelRef.trim() ? body.judgeModelRef.trim() : cfg()?.goals?.judgeModelRef;
|
|
366
|
-
const result = await draftGoalContract({
|
|
367
|
-
title,
|
|
368
|
-
context: typeof body.context === "string" ? body.context : void 0,
|
|
369
|
-
criteria: parsed.criteria,
|
|
370
|
-
uiLocale: normalizeGoalUiLocale(body.uiLocale),
|
|
371
|
-
modelRef
|
|
372
|
-
});
|
|
373
|
-
return c.json({
|
|
374
|
-
ok: true,
|
|
375
|
-
...result
|
|
376
|
-
});
|
|
377
|
-
});
|
|
378
|
-
authenticated.get("/api/goals/:goalId/contract", async (c) => {
|
|
379
|
-
const goal = goals.get(c.req.param("goalId"));
|
|
380
|
-
if (!goal) return c.json({
|
|
381
|
-
ok: false,
|
|
382
|
-
error: "Goal not found"
|
|
383
|
-
}, 404);
|
|
384
|
-
return c.json({
|
|
385
|
-
ok: true,
|
|
386
|
-
contract: goal.contract ?? null
|
|
387
|
-
});
|
|
388
|
-
});
|
|
389
|
-
authenticated.put("/api/goals/:goalId/contract", async (c) => {
|
|
390
|
-
const contract = parseGoalContract(await c.req.json().catch(() => ({})));
|
|
391
|
-
if (!contract) return c.json({
|
|
392
|
-
ok: false,
|
|
393
|
-
error: "Invalid goal contract"
|
|
394
|
-
}, 400);
|
|
395
|
-
const goal = goals.setContract(c.req.param("goalId"), contract);
|
|
396
|
-
if (!goal) return c.json({
|
|
397
|
-
ok: false,
|
|
398
|
-
error: "Goal not found"
|
|
399
|
-
}, 404);
|
|
400
|
-
return c.json({
|
|
401
|
-
ok: true,
|
|
402
|
-
goal,
|
|
403
|
-
contract: goal.contract
|
|
404
|
-
});
|
|
405
|
-
});
|
|
406
242
|
authenticated.get("/api/goals/:goalId/workflow-runs", async (c) => {
|
|
407
243
|
const goalId = c.req.param("goalId");
|
|
408
244
|
const goal = goals.get(goalId);
|
|
@@ -725,10 +561,8 @@ function registerGoalsRoutes(authenticated, deps) {
|
|
|
725
561
|
const readiness = goals.getCompletionReadiness(goalId);
|
|
726
562
|
if (readiness && !readiness.ready) return c.json({
|
|
727
563
|
ok: false,
|
|
728
|
-
error: "
|
|
729
|
-
|
|
730
|
-
pendingApproval: readiness.pendingApproval,
|
|
731
|
-
pendingOutcome: readiness.pendingOutcome
|
|
564
|
+
error: "Outcome acceptance criteria are still pending",
|
|
565
|
+
pendingCriteria: readiness.pendingCriteria
|
|
732
566
|
}, 409);
|
|
733
567
|
const goal = goals.complete(goalId);
|
|
734
568
|
if (!goal) return c.json({
|
|
@@ -855,17 +689,6 @@ function registerGoalsRoutes(authenticated, deps) {
|
|
|
855
689
|
evidence: goals.listEvidence(goalId, parseLimit(c.req.query("limit"), 100))
|
|
856
690
|
});
|
|
857
691
|
});
|
|
858
|
-
authenticated.get("/api/goals/:goalId/evidence-requirements", async (c) => {
|
|
859
|
-
const goalId = c.req.param("goalId");
|
|
860
|
-
if (!goals.get(goalId)) return c.json({
|
|
861
|
-
ok: false,
|
|
862
|
-
error: "Goal not found"
|
|
863
|
-
}, 404);
|
|
864
|
-
return c.json({
|
|
865
|
-
ok: true,
|
|
866
|
-
requirements: goals.listEvidenceRequirements(goalId)
|
|
867
|
-
});
|
|
868
|
-
});
|
|
869
692
|
authenticated.post("/api/goals/:goalId/evidence", async (c) => {
|
|
870
693
|
const goalId = c.req.param("goalId");
|
|
871
694
|
if (!goals.get(goalId)) return c.json({
|
|
@@ -875,7 +698,6 @@ function registerGoalsRoutes(authenticated, deps) {
|
|
|
875
698
|
const body = await c.req.json().catch(() => ({}));
|
|
876
699
|
const title = typeof body.title === "string" ? body.title.trim() : "";
|
|
877
700
|
const kind = body.kind;
|
|
878
|
-
const requirementId = typeof body.requirementId === "string" ? body.requirementId.trim() : "";
|
|
879
701
|
if (!title) return c.json({
|
|
880
702
|
ok: false,
|
|
881
703
|
error: "Missing title"
|
|
@@ -884,10 +706,6 @@ function registerGoalsRoutes(authenticated, deps) {
|
|
|
884
706
|
ok: false,
|
|
885
707
|
error: "Invalid evidence kind"
|
|
886
708
|
}, 400);
|
|
887
|
-
if (requirementId && !goals.listEvidenceRequirements(goalId).some((item) => item.id === requirementId)) return c.json({
|
|
888
|
-
ok: false,
|
|
889
|
-
error: "Evidence requirement not found"
|
|
890
|
-
}, 404);
|
|
891
709
|
const evidence = goals.addEvidence({
|
|
892
710
|
goalId,
|
|
893
711
|
runId: typeof body.runId === "string" ? body.runId : void 0,
|
|
@@ -897,112 +715,9 @@ function registerGoalsRoutes(authenticated, deps) {
|
|
|
897
715
|
uri: typeof body.uri === "string" ? body.uri : void 0,
|
|
898
716
|
data: body.data
|
|
899
717
|
});
|
|
900
|
-
const requirement = requirementId ? goals.linkEvidenceRequirement({
|
|
901
|
-
goalId,
|
|
902
|
-
requirementId,
|
|
903
|
-
evidenceId: evidence.id,
|
|
904
|
-
linkedBy: "user"
|
|
905
|
-
}) : void 0;
|
|
906
|
-
return c.json({
|
|
907
|
-
ok: true,
|
|
908
|
-
evidence: {
|
|
909
|
-
...evidence,
|
|
910
|
-
requirementIds: requirement ? [requirement.id] : []
|
|
911
|
-
},
|
|
912
|
-
requirement
|
|
913
|
-
});
|
|
914
|
-
});
|
|
915
|
-
authenticated.post("/api/goals/:goalId/evidence-requirements/:requirementId/link", async (c) => {
|
|
916
|
-
const goalId = c.req.param("goalId");
|
|
917
|
-
const body = await c.req.json().catch(() => ({}));
|
|
918
|
-
const evidenceId = typeof body.evidenceId === "string" ? body.evidenceId.trim() : "";
|
|
919
|
-
if (!evidenceId) return c.json({
|
|
920
|
-
ok: false,
|
|
921
|
-
error: "Missing evidence id"
|
|
922
|
-
}, 400);
|
|
923
|
-
const requirement = goals.linkEvidenceRequirement({
|
|
924
|
-
goalId,
|
|
925
|
-
requirementId: c.req.param("requirementId"),
|
|
926
|
-
evidenceId,
|
|
927
|
-
linkedBy: "user"
|
|
928
|
-
});
|
|
929
|
-
if (!requirement) return c.json({
|
|
930
|
-
ok: false,
|
|
931
|
-
error: "Evidence requirement or evidence not found"
|
|
932
|
-
}, 404);
|
|
933
|
-
return c.json({
|
|
934
|
-
ok: true,
|
|
935
|
-
requirement
|
|
936
|
-
});
|
|
937
|
-
});
|
|
938
|
-
authenticated.post("/api/goals/:goalId/evidence-requirements/:requirementId/review", async (c) => {
|
|
939
|
-
const goalId = c.req.param("goalId");
|
|
940
|
-
const goal = goals.get(goalId);
|
|
941
|
-
if (!goal) return c.json({
|
|
942
|
-
ok: false,
|
|
943
|
-
error: "Goal not found"
|
|
944
|
-
}, 404);
|
|
945
|
-
const requirement = goal.evidenceRequirements.find((item) => item.id === c.req.param("requirementId"));
|
|
946
|
-
if (!requirement) return c.json({
|
|
947
|
-
ok: false,
|
|
948
|
-
error: "Evidence requirement not found"
|
|
949
|
-
}, 404);
|
|
950
|
-
const body = await c.req.json().catch(() => ({}));
|
|
951
|
-
const evidenceById = new Map(goals.listEvidence(goalId, 500).map((item) => [item.id, item]));
|
|
952
|
-
const review = await reviewGoalEvidenceRequirement({
|
|
953
|
-
requirement,
|
|
954
|
-
evidence: requirement.evidenceIds.flatMap((id) => {
|
|
955
|
-
const item = evidenceById.get(id);
|
|
956
|
-
return item ? [item] : [];
|
|
957
|
-
}),
|
|
958
|
-
modelRef: typeof body.modelRef === "string" && body.modelRef.trim() ? body.modelRef.trim() : goal.judgeModelRef
|
|
959
|
-
});
|
|
960
|
-
const status = review.verdict === "approved" ? "ai_verified" : review.verdict === "rejected" ? "rejected" : "pending";
|
|
961
|
-
const updated = goals.reviewEvidenceRequirement({
|
|
962
|
-
goalId,
|
|
963
|
-
requirementId: requirement.id,
|
|
964
|
-
status,
|
|
965
|
-
reason: review.reason,
|
|
966
|
-
confidence: review.confidence,
|
|
967
|
-
reviewedBy: review.generated ? "ai" : "system"
|
|
968
|
-
});
|
|
969
|
-
return c.json({
|
|
970
|
-
ok: true,
|
|
971
|
-
requirement: updated,
|
|
972
|
-
review
|
|
973
|
-
});
|
|
974
|
-
});
|
|
975
|
-
authenticated.post("/api/goals/:goalId/evidence-requirements/:requirementId/approve", async (c) => {
|
|
976
|
-
const goalId = c.req.param("goalId");
|
|
977
|
-
const body = await c.req.json().catch(() => ({}));
|
|
978
|
-
const existing = goals.get(goalId);
|
|
979
|
-
if (!existing) return c.json({
|
|
980
|
-
ok: false,
|
|
981
|
-
error: "Goal not found"
|
|
982
|
-
}, 404);
|
|
983
|
-
const existingRequirement = existing.evidenceRequirements.find((item) => item.id === c.req.param("requirementId"));
|
|
984
|
-
if (!existingRequirement) return c.json({
|
|
985
|
-
ok: false,
|
|
986
|
-
error: "Evidence requirement not found"
|
|
987
|
-
}, 404);
|
|
988
|
-
if (existingRequirement.evidenceIds.length === 0) return c.json({
|
|
989
|
-
ok: false,
|
|
990
|
-
error: "Link evidence before approving this requirement"
|
|
991
|
-
}, 409);
|
|
992
|
-
const requirement = goals.reviewEvidenceRequirement({
|
|
993
|
-
goalId,
|
|
994
|
-
requirementId: c.req.param("requirementId"),
|
|
995
|
-
status: "approved",
|
|
996
|
-
reason: typeof body.reason === "string" && body.reason.trim() ? body.reason.trim() : "Approved by a user after reviewing the linked evidence.",
|
|
997
|
-
reviewedBy: "user"
|
|
998
|
-
});
|
|
999
|
-
if (!requirement) return c.json({
|
|
1000
|
-
ok: false,
|
|
1001
|
-
error: "Evidence requirement not found"
|
|
1002
|
-
}, 404);
|
|
1003
718
|
return c.json({
|
|
1004
719
|
ok: true,
|
|
1005
|
-
|
|
720
|
+
evidence
|
|
1006
721
|
});
|
|
1007
722
|
});
|
|
1008
723
|
authenticated.post("/api/goals/:goalId/checklist", async (c) => {
|
|
@@ -1,105 +1,5 @@
|
|
|
1
1
|
import type { Hono } from 'hono';
|
|
2
|
-
import { type HomeAttentionSubjectKind } from '../../../storage/sqlite/index.js';
|
|
3
2
|
import type { AuthenticatedRouteDeps } from './deps.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type HomeAttention = {
|
|
7
|
-
id: string;
|
|
8
|
-
kind: HomeAttentionSubjectKind;
|
|
9
|
-
runId: string;
|
|
10
|
-
title: string;
|
|
11
|
-
detail: string;
|
|
12
|
-
reason: 'run_failed' | 'run_timeout';
|
|
13
|
-
href: string;
|
|
14
|
-
updatedAt: number;
|
|
15
|
-
sessionKey?: string;
|
|
16
|
-
};
|
|
17
|
-
type HomeDecision = {
|
|
18
|
-
id: string;
|
|
19
|
-
kind: HomeDecisionKind;
|
|
20
|
-
title: string;
|
|
21
|
-
detail?: string;
|
|
22
|
-
reason: HomeDecisionReason;
|
|
23
|
-
urgency: 'now' | 'soon';
|
|
24
|
-
href: string;
|
|
25
|
-
projectId?: string;
|
|
26
|
-
projectName?: string;
|
|
27
|
-
updatedAt: number;
|
|
28
|
-
judgment?: {
|
|
29
|
-
inboxItemId: string;
|
|
30
|
-
whyNow: string;
|
|
31
|
-
impact: string;
|
|
32
|
-
workDone: string;
|
|
33
|
-
recommendation: string;
|
|
34
|
-
confidence: number;
|
|
35
|
-
decision?: {
|
|
36
|
-
question: string;
|
|
37
|
-
options: Array<{
|
|
38
|
-
id: string;
|
|
39
|
-
label: string;
|
|
40
|
-
consequence: string;
|
|
41
|
-
}>;
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
response?: {
|
|
45
|
-
kind: 'connector_approval';
|
|
46
|
-
approvalId: string;
|
|
47
|
-
} | {
|
|
48
|
-
kind: 'goal_evidence';
|
|
49
|
-
goalId: string;
|
|
50
|
-
requirementId: string;
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
type HomeBriefingWin = {
|
|
54
|
-
id: string;
|
|
55
|
-
kind: 'work_item' | 'workflow_run' | 'automation_run';
|
|
56
|
-
title: string;
|
|
57
|
-
href: string;
|
|
58
|
-
completedAt: number;
|
|
59
|
-
};
|
|
60
|
-
type HomeAutomation = {
|
|
61
|
-
id: string;
|
|
62
|
-
name?: string;
|
|
63
|
-
trigger: string;
|
|
64
|
-
action: string;
|
|
65
|
-
nextRunAt: string;
|
|
66
|
-
};
|
|
67
|
-
export declare function buildHomeBriefing(input: {
|
|
68
|
-
locale?: string;
|
|
69
|
-
decisions: HomeDecision[];
|
|
70
|
-
attention: HomeAttention[];
|
|
71
|
-
activeWorkCount: number;
|
|
72
|
-
activeWorkflowCount: number;
|
|
73
|
-
activeGoalCount: number;
|
|
74
|
-
wins: HomeBriefingWin[];
|
|
75
|
-
nextScheduled?: HomeAutomation;
|
|
76
|
-
nowMs: number;
|
|
77
|
-
}): {
|
|
78
|
-
generatedAt: number;
|
|
79
|
-
summary: string;
|
|
80
|
-
focus: HomeDecision[];
|
|
81
|
-
progress: {
|
|
82
|
-
activeWorkCount: number;
|
|
83
|
-
activeWorkflowCount: number;
|
|
84
|
-
activeGoalCount: number;
|
|
85
|
-
movingCount: number;
|
|
86
|
-
};
|
|
87
|
-
wins: HomeBriefingWin[];
|
|
88
|
-
nextScheduled: HomeAutomation;
|
|
89
|
-
};
|
|
90
|
-
/**
|
|
91
|
-
* GET /api/home — Aggregated data for the user's cross-project work home.
|
|
92
|
-
*
|
|
93
|
-
* Returns:
|
|
94
|
-
* - recentlyOpened: notes sorted by lastOpenedAt (continue rail)
|
|
95
|
-
* - inboxCount: number of notes with status === 'inbox'
|
|
96
|
-
* - pendingTasks: task notes where done === false
|
|
97
|
-
* - recentSessions: last 5 active AI sessions (threads)
|
|
98
|
-
* - activeAgent: default agent identity for this gateway
|
|
99
|
-
* - gateway: readiness + public tunnel status
|
|
100
|
-
* - workflowRuns: active and recent workflow runs
|
|
101
|
-
* - upcomingAutomations: upcoming enabled automations
|
|
102
|
-
* - recentAutomationRuns: latest automation executions
|
|
103
|
-
*/
|
|
3
|
+
export { buildHomeBriefing } from '../../../work/home-query-service.js';
|
|
4
|
+
/** Register the unified work-home read model and its decision actions. */
|
|
104
5
|
export declare function registerHomeRoutes(authenticated: Hono, deps: AuthenticatedRouteDeps): void;
|
|
105
|
-
export {};
|