@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
|
@@ -9,15 +9,16 @@ import { buildSessionKey, init_session_key } from "../../../routing/session-key.
|
|
|
9
9
|
import { resolveEffectiveAgentProfile } from "../../../config/agent-profile.js";
|
|
10
10
|
import { GoalService } from "../../../goals/goal-service.js";
|
|
11
11
|
import "../../../goals/index.js";
|
|
12
|
+
import { WORK_ITEM_ATTACHMENT_MAX_BYTES } from "../../../work-items/work-item-service.js";
|
|
13
|
+
import "../../../work-items/index.js";
|
|
14
|
+
import { OutcomeExecutionService } from "../../../work/outcome-execution-service.js";
|
|
12
15
|
import { ProjectWorkspaceConflictError, ProjectWorkspaceMissingError } from "../../../projects/workspace-project.js";
|
|
13
16
|
import { isValidProjectAgentId, normalizeProjectAgentId, resolveProjectAgentId } from "../../../projects/project-agent.js";
|
|
14
17
|
import { inferProjectKind } from "../../../projects/project-kind.js";
|
|
15
18
|
import { inferSuggestedProjectDefaultAgentId } from "../../../projects/project-agent-suggestion.js";
|
|
16
19
|
import { buildProjectLoopOverview } from "../../../projects/project-loop.js";
|
|
17
20
|
import "../../../projects/index.js";
|
|
18
|
-
import
|
|
19
|
-
import { buildWorkItemAgentContext } from "../../../work-items/agent-context.js";
|
|
20
|
-
import "../../../work-items/index.js";
|
|
21
|
+
import "../../../work/index.js";
|
|
21
22
|
import { createGatewayRouteLogger } from "../lib/route-logger.js";
|
|
22
23
|
import { parseActivityIncludeRelated, parseActivityQuery } from "./activity.js";
|
|
23
24
|
import { fuzzySearchWorkspaceFiles } from "../../workspace-file-search.js";
|
|
@@ -528,50 +529,6 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
528
529
|
...match
|
|
529
530
|
});
|
|
530
531
|
});
|
|
531
|
-
authenticated.get("/api/projects/:id/overview", async (c) => {
|
|
532
|
-
const project = service.projects.getWithDetails(c.req.param("id"));
|
|
533
|
-
if (!project) return c.json({
|
|
534
|
-
ok: false,
|
|
535
|
-
error: "Project not found"
|
|
536
|
-
}, 404);
|
|
537
|
-
const loop = buildProjectLoopOverview({
|
|
538
|
-
project,
|
|
539
|
-
goals: service.projects.listGoalIds(project.id, parseLimit(c.req.query("goalLimit"), 100)).map((id) => goals.get(id)).filter((goal) => Boolean(goal)),
|
|
540
|
-
recentWorkflowRuns: project.recentWorkflowRuns,
|
|
541
|
-
failedWorkflowRuns: listFailedProjectWorkflowRuns(project.id),
|
|
542
|
-
memoryRecords: listMemoryRecords({
|
|
543
|
-
projectId: project.id,
|
|
544
|
-
status: "active",
|
|
545
|
-
limit: 5
|
|
546
|
-
})
|
|
547
|
-
});
|
|
548
|
-
return c.json({
|
|
549
|
-
ok: true,
|
|
550
|
-
overview: {
|
|
551
|
-
project: enrichProjectWorkspace(service, project),
|
|
552
|
-
stats: {
|
|
553
|
-
sessionCount: project.sessionCount,
|
|
554
|
-
goalCount: project.goalCount,
|
|
555
|
-
activeGoalCount: project.activeGoalCount,
|
|
556
|
-
recentWorkflowRunCount: project.recentWorkflowRuns.length,
|
|
557
|
-
staleGoalCount: loop.staleGoals.length,
|
|
558
|
-
attentionCount: loop.attentionItems.length,
|
|
559
|
-
failedWorkflowRunCount: loop.failedWorkflowRuns.length
|
|
560
|
-
},
|
|
561
|
-
activeGoals: loop.activeGoals,
|
|
562
|
-
blockedGoals: loop.blockedGoals,
|
|
563
|
-
staleGoals: loop.staleGoals,
|
|
564
|
-
nextActions: loop.nextActions,
|
|
565
|
-
attentionItems: loop.attentionItems,
|
|
566
|
-
timeline: loop.timeline,
|
|
567
|
-
digest: loop.digest,
|
|
568
|
-
failedWorkflowRuns: loop.failedWorkflowRuns,
|
|
569
|
-
recentSessions: project.recentSessions,
|
|
570
|
-
recentWorkflowRuns: project.recentWorkflowRuns,
|
|
571
|
-
recommendedAction: loop.recommendedAction
|
|
572
|
-
}
|
|
573
|
-
});
|
|
574
|
-
});
|
|
575
532
|
authenticated.get("/api/projects/:id/activity", (c) => {
|
|
576
533
|
const project = service.projects.get(c.req.param("id"));
|
|
577
534
|
if (!project) return c.json({
|
|
@@ -974,53 +931,6 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
974
931
|
item: updated
|
|
975
932
|
}, 201);
|
|
976
933
|
});
|
|
977
|
-
authenticated.post("/api/work-items/:id/create-goal", async (c) => {
|
|
978
|
-
const item = workItems.getWorkItem(c.req.param("id"));
|
|
979
|
-
if (!item) return c.json({
|
|
980
|
-
ok: false,
|
|
981
|
-
error: "Work item not found"
|
|
982
|
-
}, 404);
|
|
983
|
-
const project = service.projects.get(item.projectId);
|
|
984
|
-
if (!project) return c.json({
|
|
985
|
-
ok: false,
|
|
986
|
-
error: "Project not found"
|
|
987
|
-
}, 404);
|
|
988
|
-
const attachments = await workItems.snapshotAttachmentsForGoal(item.id);
|
|
989
|
-
if (!attachments) return c.json({
|
|
990
|
-
ok: false,
|
|
991
|
-
error: "Work item not found"
|
|
992
|
-
}, 404);
|
|
993
|
-
const context = await buildWorkItemAgentContext(item, {
|
|
994
|
-
attachments,
|
|
995
|
-
includeImages: false
|
|
996
|
-
});
|
|
997
|
-
const goal = goals.create({
|
|
998
|
-
title: item.title,
|
|
999
|
-
description: item.description || item.nextAction,
|
|
1000
|
-
priority: item.priority === "urgent" ? "high" : item.priority,
|
|
1001
|
-
agentId: item.ownerAgentId || project.defaultAgentId || void 0,
|
|
1002
|
-
projectId: project.id,
|
|
1003
|
-
source: "api",
|
|
1004
|
-
config: service.currentConfig
|
|
1005
|
-
});
|
|
1006
|
-
const goalWithContext = goals.setContextMessage({
|
|
1007
|
-
goalId: goal.id,
|
|
1008
|
-
text: context.text,
|
|
1009
|
-
attachments
|
|
1010
|
-
}) ?? goal;
|
|
1011
|
-
workItems.addLink(item.id, {
|
|
1012
|
-
kind: "goal",
|
|
1013
|
-
targetId: goal.id,
|
|
1014
|
-
title: goal.title,
|
|
1015
|
-
statusSnapshot: goal.status
|
|
1016
|
-
}, "goal_created");
|
|
1017
|
-
const updated = item.status === "todo" || item.status === "backlog" ? workItems.updateWorkItem(item.id, { status: "in_progress" }) : workItems.getWorkItem(item.id);
|
|
1018
|
-
return c.json({
|
|
1019
|
-
ok: true,
|
|
1020
|
-
goal: goalWithContext,
|
|
1021
|
-
item: updated
|
|
1022
|
-
}, 201);
|
|
1023
|
-
});
|
|
1024
934
|
authenticated.post("/api/work-items/:id/workflows/run", async (c) => {
|
|
1025
935
|
const item = workItems.getWorkItem(c.req.param("id"));
|
|
1026
936
|
if (!item) return c.json({
|
|
@@ -1169,8 +1079,8 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
1169
1079
|
error: "Missing title"
|
|
1170
1080
|
}, 400);
|
|
1171
1081
|
const reason = typeof body.reason === "string" ? body.reason.trim() : "";
|
|
1172
|
-
const goal =
|
|
1173
|
-
title,
|
|
1082
|
+
const goal = new OutcomeExecutionService().create({
|
|
1083
|
+
objective: title,
|
|
1174
1084
|
description: reason || void 0,
|
|
1175
1085
|
agentId: resolveProjectAgentId({
|
|
1176
1086
|
config: service.currentConfig,
|
|
@@ -1180,7 +1090,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
1180
1090
|
priority: body.priority === "low" || body.priority === "normal" || body.priority === "high" ? body.priority : "high",
|
|
1181
1091
|
source: "api",
|
|
1182
1092
|
projectId: project.id
|
|
1183
|
-
});
|
|
1093
|
+
}).goal;
|
|
1184
1094
|
const blocked = goals.setStatus(goal.id, "blocked", { reason: reason || title });
|
|
1185
1095
|
if (reason) goals.setContextMessage({
|
|
1186
1096
|
goalId: goal.id,
|
|
@@ -1188,7 +1098,7 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
1188
1098
|
});
|
|
1189
1099
|
return c.json({
|
|
1190
1100
|
ok: true,
|
|
1191
|
-
|
|
1101
|
+
blocker: blocked ?? goals.get(goal.id)
|
|
1192
1102
|
}, 201);
|
|
1193
1103
|
});
|
|
1194
1104
|
authenticated.post("/api/projects/:id/pin", async (c) => {
|
|
@@ -1292,20 +1202,6 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
1292
1202
|
}, 404);
|
|
1293
1203
|
}
|
|
1294
1204
|
});
|
|
1295
|
-
authenticated.get("/api/projects/:id/goals", async (c) => {
|
|
1296
|
-
try {
|
|
1297
|
-
const ids = service.projects.listGoalIds(c.req.param("id"), parseLimit(c.req.query("limit"), 100));
|
|
1298
|
-
return c.json({
|
|
1299
|
-
ok: true,
|
|
1300
|
-
goals: ids.map((id) => goals.get(id)).filter(Boolean)
|
|
1301
|
-
});
|
|
1302
|
-
} catch (error) {
|
|
1303
|
-
return c.json({
|
|
1304
|
-
ok: false,
|
|
1305
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1306
|
-
}, 404);
|
|
1307
|
-
}
|
|
1308
|
-
});
|
|
1309
1205
|
authenticated.get("/api/projects/:id/files", async (c) => {
|
|
1310
1206
|
const resolved = await resolveProjectWorkspacePath(service, c.req.param("id"), c.req.query("path"));
|
|
1311
1207
|
if (resolved.ok === false) return c.json({
|
|
@@ -1655,46 +1551,6 @@ function registerProjectsRoutes(authenticated, deps) {
|
|
|
1655
1551
|
record
|
|
1656
1552
|
}, 201);
|
|
1657
1553
|
});
|
|
1658
|
-
authenticated.post("/api/projects/:id/goals/:goalId", async (c) => {
|
|
1659
|
-
try {
|
|
1660
|
-
service.projects.attachGoal(c.req.param("goalId"), c.req.param("id"));
|
|
1661
|
-
return c.json({
|
|
1662
|
-
ok: true,
|
|
1663
|
-
goal: goals.get(c.req.param("goalId"))
|
|
1664
|
-
});
|
|
1665
|
-
} catch (error) {
|
|
1666
|
-
return c.json({
|
|
1667
|
-
ok: false,
|
|
1668
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1669
|
-
}, 404);
|
|
1670
|
-
}
|
|
1671
|
-
});
|
|
1672
|
-
authenticated.delete("/api/projects/:id/goals/:goalId", async (c) => {
|
|
1673
|
-
try {
|
|
1674
|
-
const projectId = c.req.param("id");
|
|
1675
|
-
const goalId = c.req.param("goalId");
|
|
1676
|
-
if (!service.projects.get(projectId)) return c.json({
|
|
1677
|
-
ok: false,
|
|
1678
|
-
error: "Project not found"
|
|
1679
|
-
}, 404);
|
|
1680
|
-
const goal = goals.get(goalId);
|
|
1681
|
-
if (!goal) return c.json({
|
|
1682
|
-
ok: false,
|
|
1683
|
-
error: "Goal not found"
|
|
1684
|
-
}, 404);
|
|
1685
|
-
if (goal.projectId !== projectId) return c.json({
|
|
1686
|
-
ok: false,
|
|
1687
|
-
error: "Goal is not attached to this project"
|
|
1688
|
-
}, 409);
|
|
1689
|
-
service.projects.detachGoal(goalId);
|
|
1690
|
-
return c.json({ ok: true });
|
|
1691
|
-
} catch (error) {
|
|
1692
|
-
return c.json({
|
|
1693
|
-
ok: false,
|
|
1694
|
-
error: error instanceof Error ? error.message : String(error)
|
|
1695
|
-
}, 404);
|
|
1696
|
-
}
|
|
1697
|
-
});
|
|
1698
1554
|
}
|
|
1699
1555
|
//#endregion
|
|
1700
1556
|
export { registerProjectsRoutes };
|
|
@@ -8,8 +8,8 @@ import { resolveShareUrl, resolveSiteShareUrl } from "../../../share/share-url.j
|
|
|
8
8
|
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
9
9
|
import { audienceDefaults, cleanupStagedSite, decideShareKind, forgetStagedSite, makeDescription, makeTitle, probeShareTarget, rememberStagedSite, stageSingleHtmlAsSite } from "../../../share/share-auto.js";
|
|
10
10
|
import { deleteThumbnail, placeholderSvg, readThumbnail, scheduleThumbnail, thumbnailContentType, thumbnailExists } from "../../../share/share-thumbnail.js";
|
|
11
|
-
import { extractToken } from "../../auth.js";
|
|
12
11
|
import { getClientIpFromHeaders } from "../../security/loopback.js";
|
|
12
|
+
import { extractToken } from "../../auth.js";
|
|
13
13
|
import { renderFolderLandingPage, renderShareExpiredPage, renderShareLandingPage } from "../../../share/share-landing.js";
|
|
14
14
|
import { consumeSharePublicLimit } from "../../../share/share-rate-limit.js";
|
|
15
15
|
import { createZipStream, planDirectoryFiles } from "../../../share/share-zip.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { getDefaultModelSync, init_providers, resolveModel } from "../../../providers/index.js";
|
|
2
|
+
import { getGatewayAgentEffectiveManifest } from "../../agents-admin.js";
|
|
2
3
|
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
4
|
+
import { mergeSttConfigFromAppConfig } from "../../../voice/stt/config.js";
|
|
3
5
|
import "../../../voice/stt/index.js";
|
|
4
|
-
import { mergeSttConfigFromAppConfig } from "../../../channels/attachments/voice-stt-webchat.js";
|
|
5
|
-
import { getGatewayAgentEffectiveManifest } from "../../agents-admin.js";
|
|
6
6
|
import { createHash } from "node:crypto";
|
|
7
7
|
//#region src/gateway/hono/routes/status.ts
|
|
8
8
|
init_providers();
|
|
@@ -2,18 +2,18 @@ import { init_public_url, validatePublicUrl } from "../../../config/public-url.j
|
|
|
2
2
|
import { resolveGatewayEffectiveHost } from "../../../config/gateway-bind.js";
|
|
3
3
|
import { loadTunnelState } from "../../../tunnel/tunnel-state.js";
|
|
4
4
|
import { resolveReverseProxyPublicUrl } from "../../public-url.js";
|
|
5
|
-
import { extractToken } from "../../auth.js";
|
|
6
5
|
import { TUNNEL_CONSENT_REQUIRED_CODE, TunnelConsentError, assertTunnelMayStart, getTunnelConsentState } from "../../../tunnel/consent.js";
|
|
7
6
|
import { getTunnelRegistrationSecretMeta, readTunnelRegistrationSecretFromConfigOnly, resolveTunnelBrokerUrl } from "../../../tunnel/env.js";
|
|
7
|
+
import { applyTunnelConsentToConfig, setTunnelEnabledInConfig } from "../../../tunnel/tunnel-config.js";
|
|
8
8
|
import { createPairingSecret, exchangePairingSecretOnce, getCachedPairingExchange } from "../../../tunnel/pairing.js";
|
|
9
9
|
import { logTunnelAudit } from "../../../tunnel/tunnel-audit.js";
|
|
10
10
|
import { getTunnelService, hashGatewayToken } from "../../../tunnel/tunnel-service.js";
|
|
11
11
|
import { configureTunnelFromGatewayConfig } from "../../../tunnel/gateway-lifecycle.js";
|
|
12
|
-
import { applyTunnelConsentToConfig, setTunnelEnabledInConfig } from "../../../tunnel/tunnel-config.js";
|
|
13
12
|
import { getClientIpFromHeaders } from "../../security/loopback.js";
|
|
14
|
-
import { applyLanPairingGatewayPatch } from "../../../tunnel/enable-lan-pairing.js";
|
|
15
13
|
import { consumeTunnelMutationLimit } from "../../../tunnel/tunnel-rate-limit.js";
|
|
16
14
|
import "../../../tunnel/index.js";
|
|
15
|
+
import { extractToken } from "../../auth.js";
|
|
16
|
+
import { applyLanPairingGatewayPatch } from "../../../tunnel/enable-lan-pairing.js";
|
|
17
17
|
import { buildMobileConnectUrlOrder, resolveMobilePairLanUrl, validateMobilePairBaseUrl } from "../../../tunnel/pair-url.js";
|
|
18
18
|
import { buildMobilePairContext } from "../../../tunnel/pair-context.js";
|
|
19
19
|
import { consumePairingExchangeFailLimit } from "../../../tunnel/pairing-rate-limit.js";
|
|
@@ -8,8 +8,8 @@ import { getLocalVoiceRuntimeClient } from "../../../voice/local/runtime-client.
|
|
|
8
8
|
import { resolveSttProviderConfigSlice } from "../../../voice/stt/config-slice.js";
|
|
9
9
|
import { transcribe } from "../../../voice/stt/transcribe-core.js";
|
|
10
10
|
import { isSTTAvailable } from "../../../voice/stt/availability.js";
|
|
11
|
+
import { mergeSttConfigFromAppConfig } from "../../../voice/stt/config.js";
|
|
11
12
|
import "../../../voice/stt/index.js";
|
|
12
|
-
import { mergeSttConfigFromAppConfig } from "../../../channels/attachments/voice-stt-webchat.js";
|
|
13
13
|
import { listSttProvidersForApi } from "../../../voice/stt/list-providers.js";
|
|
14
14
|
import "../../../voice/tts/index.js";
|
|
15
15
|
import { listLocalVoiceModelStatuses, removeLocalVoiceModel, startLocalVoiceModelInstall } from "../../../voice/local/model-manager.js";
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { GoalService } from "../../../goals/goal-service.js";
|
|
2
|
+
import { OutcomeRepository } from "../../../work/outcome-repository.js";
|
|
3
|
+
import "../../../goals/index.js";
|
|
4
|
+
import { OutcomeActionRequestSchema, OutcomeUserStatusSchema } from "../../../../packages/gateway-contract/src/outcomes.js";
|
|
5
|
+
import { ProjectMonitoringUpdateSchema, WorkIntakeConfirmRequestSchema, WorkIntakeCreateRequestSchema } from "../../../../packages/gateway-contract/src/work-intake.js";
|
|
6
|
+
import { OutcomeReceiptService } from "../../../work/outcome-receipt-service.js";
|
|
7
|
+
import { ProjectMonitoringService } from "../../../work/project-monitoring-service.js";
|
|
8
|
+
import { ProjectOperatingViewService } from "../../../work/project-operating-view-service.js";
|
|
9
|
+
import { WorkIntakeService } from "../../../work/work-intake-service.js";
|
|
10
|
+
import { WorkValueMetricsService } from "../../../work/work-value-metrics-service.js";
|
|
11
|
+
//#region src/gateway/hono/routes/work.ts
|
|
12
|
+
function registerWorkRoutes(authenticated, deps) {
|
|
13
|
+
const intake = new WorkIntakeService(deps.service.projects, { enqueue: (goalId, options) => deps.service.enqueueGoalRun(goalId, options) });
|
|
14
|
+
const operatingViews = new ProjectOperatingViewService(deps.service.projects, deps.service.workItems);
|
|
15
|
+
const monitoring = new ProjectMonitoringService();
|
|
16
|
+
const metrics = new WorkValueMetricsService();
|
|
17
|
+
const outcomes = new OutcomeRepository();
|
|
18
|
+
const receipts = new OutcomeReceiptService();
|
|
19
|
+
const goals = new GoalService();
|
|
20
|
+
authenticated.get("/api/outcomes", (c) => {
|
|
21
|
+
const status = OutcomeUserStatusSchema.safeParse(c.req.query("status"));
|
|
22
|
+
const rawLimit = Number(c.req.query("limit") ?? 50);
|
|
23
|
+
const limit = Number.isFinite(rawLimit) ? rawLimit : 50;
|
|
24
|
+
return c.json({
|
|
25
|
+
ok: true,
|
|
26
|
+
items: outcomes.list({
|
|
27
|
+
...status.success ? { status: status.data } : {},
|
|
28
|
+
limit
|
|
29
|
+
})
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
authenticated.get("/api/outcomes/:id", (c) => {
|
|
33
|
+
const outcome = outcomes.get(c.req.param("id"));
|
|
34
|
+
return outcome ? c.json({
|
|
35
|
+
ok: true,
|
|
36
|
+
outcome,
|
|
37
|
+
receipts: receipts.list({
|
|
38
|
+
outcomeId: outcome.id,
|
|
39
|
+
limit: 100
|
|
40
|
+
})
|
|
41
|
+
}) : c.json({
|
|
42
|
+
ok: false,
|
|
43
|
+
error: "Outcome not found"
|
|
44
|
+
}, 404);
|
|
45
|
+
});
|
|
46
|
+
authenticated.post("/api/outcomes/:id/actions", deps.strictRateLimitMiddleware, async (c) => {
|
|
47
|
+
const outcome = outcomes.get(c.req.param("id"));
|
|
48
|
+
if (!outcome) return c.json({
|
|
49
|
+
ok: false,
|
|
50
|
+
error: "Outcome not found"
|
|
51
|
+
}, 404);
|
|
52
|
+
const parsed = OutcomeActionRequestSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
53
|
+
if (!parsed.success) return c.json({
|
|
54
|
+
ok: false,
|
|
55
|
+
error: "Invalid outcome action"
|
|
56
|
+
}, 400);
|
|
57
|
+
const goalId = outcomes.listLinks(outcome.id).find((link) => link.kind === "goal")?.id;
|
|
58
|
+
const goal = goalId ? goals.get(goalId) : void 0;
|
|
59
|
+
if (parsed.data.action === "pause") {
|
|
60
|
+
if (goal && goal.status !== "done" && goal.status !== "archived" && goal.status !== "paused") goals.pause(goal.id, "Paused by the user");
|
|
61
|
+
return c.json({
|
|
62
|
+
ok: true,
|
|
63
|
+
outcome: outcomes.updateState({
|
|
64
|
+
id: outcome.id,
|
|
65
|
+
userStatus: "running",
|
|
66
|
+
internalStatus: "paused"
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (parsed.data.action === "cancel") {
|
|
71
|
+
if (goal && goal.status !== "done" && goal.status !== "archived") goals.pause(goal.id, "Cancelled by the user");
|
|
72
|
+
return c.json({
|
|
73
|
+
ok: true,
|
|
74
|
+
outcome: outcomes.updateState({
|
|
75
|
+
id: outcome.id,
|
|
76
|
+
userStatus: "completed",
|
|
77
|
+
internalStatus: "cancelled"
|
|
78
|
+
})
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
if (!goal) return c.json({
|
|
82
|
+
ok: false,
|
|
83
|
+
error: "Outcome has no executable goal"
|
|
84
|
+
}, 409);
|
|
85
|
+
if (goal.status === "done" || goal.status === "archived") goals.reopen(goal.id);
|
|
86
|
+
else if (goal.status !== "active") goals.resume(goal.id);
|
|
87
|
+
const queued = deps.service.enqueueGoalRun(goal.id, {
|
|
88
|
+
source: "api",
|
|
89
|
+
executionContext: {
|
|
90
|
+
outcomeId: outcome.id,
|
|
91
|
+
triggerKind: parsed.data.action === "resume" ? "retry" : "user"
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return c.json({
|
|
95
|
+
ok: true,
|
|
96
|
+
outcome: outcomes.updateState({
|
|
97
|
+
id: outcome.id,
|
|
98
|
+
userStatus: "running",
|
|
99
|
+
internalStatus: "continuing"
|
|
100
|
+
}),
|
|
101
|
+
queued
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
authenticated.post("/api/work/intakes", deps.strictRateLimitMiddleware, async (c) => {
|
|
105
|
+
const parsed = WorkIntakeCreateRequestSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
106
|
+
if (!parsed.success) return c.json({
|
|
107
|
+
ok: false,
|
|
108
|
+
error: "Invalid work intake request"
|
|
109
|
+
}, 400);
|
|
110
|
+
try {
|
|
111
|
+
const proposal = intake.propose({ ...parsed.data });
|
|
112
|
+
return c.json({
|
|
113
|
+
ok: true,
|
|
114
|
+
proposal
|
|
115
|
+
}, 201);
|
|
116
|
+
} catch (error) {
|
|
117
|
+
return c.json({
|
|
118
|
+
ok: false,
|
|
119
|
+
error: error instanceof Error ? error.message : String(error)
|
|
120
|
+
}, 400);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
authenticated.post("/api/work/intakes/:id/confirm", deps.strictRateLimitMiddleware, async (c) => {
|
|
124
|
+
const parsed = WorkIntakeConfirmRequestSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
125
|
+
if (!parsed.success) return c.json({
|
|
126
|
+
ok: false,
|
|
127
|
+
error: "Invalid work intake confirmation"
|
|
128
|
+
}, 400);
|
|
129
|
+
try {
|
|
130
|
+
const work = intake.confirm({
|
|
131
|
+
proposalId: c.req.param("id"),
|
|
132
|
+
...parsed.data
|
|
133
|
+
});
|
|
134
|
+
return work ? c.json({
|
|
135
|
+
ok: true,
|
|
136
|
+
work
|
|
137
|
+
}, 201) : c.json({
|
|
138
|
+
ok: false,
|
|
139
|
+
error: "Work intake expired or was not found"
|
|
140
|
+
}, 404);
|
|
141
|
+
} catch (error) {
|
|
142
|
+
return c.json({
|
|
143
|
+
ok: false,
|
|
144
|
+
error: error instanceof Error ? error.message : String(error)
|
|
145
|
+
}, 400);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
authenticated.get("/api/projects/:projectId/operating-view", (c) => {
|
|
149
|
+
const view = operatingViews.get(c.req.param("projectId"));
|
|
150
|
+
return view ? c.json({
|
|
151
|
+
ok: true,
|
|
152
|
+
view
|
|
153
|
+
}) : c.json({
|
|
154
|
+
ok: false,
|
|
155
|
+
error: "Project not found"
|
|
156
|
+
}, 404);
|
|
157
|
+
});
|
|
158
|
+
authenticated.get("/api/work/metrics", (c) => c.json({
|
|
159
|
+
ok: true,
|
|
160
|
+
metrics: metrics.get()
|
|
161
|
+
}));
|
|
162
|
+
authenticated.get("/api/projects/:projectId/monitoring", (c) => {
|
|
163
|
+
const projectId = c.req.param("projectId");
|
|
164
|
+
if (!deps.service.projects.get(projectId)) return c.json({
|
|
165
|
+
ok: false,
|
|
166
|
+
error: "Project not found"
|
|
167
|
+
}, 404);
|
|
168
|
+
return c.json({
|
|
169
|
+
ok: true,
|
|
170
|
+
policy: monitoring.get(projectId)
|
|
171
|
+
});
|
|
172
|
+
});
|
|
173
|
+
authenticated.patch("/api/projects/:projectId/monitoring", deps.strictRateLimitMiddleware, async (c) => {
|
|
174
|
+
const projectId = c.req.param("projectId");
|
|
175
|
+
if (!deps.service.projects.get(projectId)) return c.json({
|
|
176
|
+
ok: false,
|
|
177
|
+
error: "Project not found"
|
|
178
|
+
}, 404);
|
|
179
|
+
const parsed = ProjectMonitoringUpdateSchema.safeParse(await c.req.json().catch(() => ({})));
|
|
180
|
+
if (!parsed.success) return c.json({
|
|
181
|
+
ok: false,
|
|
182
|
+
error: "Invalid monitoring policy"
|
|
183
|
+
}, 400);
|
|
184
|
+
const current = monitoring.get(projectId);
|
|
185
|
+
try {
|
|
186
|
+
const policy = monitoring.configure({
|
|
187
|
+
projectId,
|
|
188
|
+
mode: parsed.data.mode ?? current.mode,
|
|
189
|
+
quietHours: parsed.data.quietHours === null ? void 0 : parsed.data.quietHours ?? current.quietHours,
|
|
190
|
+
allowedActions: parsed.data.allowedActions ?? current.allowedActions,
|
|
191
|
+
confidenceThreshold: parsed.data.confidenceThreshold ?? current.confidenceThreshold,
|
|
192
|
+
scenarios: parsed.data.scenarios ?? (current.configured ? current.scenarios : void 0)
|
|
193
|
+
});
|
|
194
|
+
return c.json({
|
|
195
|
+
ok: true,
|
|
196
|
+
policy
|
|
197
|
+
});
|
|
198
|
+
} catch (error) {
|
|
199
|
+
return c.json({
|
|
200
|
+
ok: false,
|
|
201
|
+
error: error instanceof Error ? error.message : String(error)
|
|
202
|
+
}, 400);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
//#endregion
|
|
207
|
+
export { registerWorkRoutes };
|
|
@@ -13,16 +13,18 @@ import "../../../storage/sqlite/index.js";
|
|
|
13
13
|
import { UserContextConfigSchema, init_config } from "../../../user-context/config.js";
|
|
14
14
|
import { init_agent_scope, resolveDefaultAgentId } from "../../../agent/agent-scope.js";
|
|
15
15
|
import { GoalService } from "../../../goals/goal-service.js";
|
|
16
|
-
import { draftGoalContract } from "../../../goals/goal-contract-draft.js";
|
|
17
16
|
import "../../../goals/index.js";
|
|
18
17
|
import { revokeComposioConnection } from "../../../connectors/composio.js";
|
|
19
18
|
import { listConnectorCatalog } from "../../../connectors/catalog.js";
|
|
19
|
+
import { readUserProfileFile, writeUserProfileFile } from "../../agents-admin.js";
|
|
20
|
+
import { OutcomeExecutionService } from "../../../work/outcome-execution-service.js";
|
|
21
|
+
import { defineOutcomeContract } from "../../../work/outcome-contract-definition.js";
|
|
22
|
+
import "../../../work/index.js";
|
|
20
23
|
import { nextMemoryReviewAt, resolveMemoryStability } from "../../../agent/memory/lifecycle.js";
|
|
21
24
|
import { PERSONAL_PLAYBOOK_DISABLED_TAG, PERSONAL_PLAYBOOK_ORDER_PREFIX, PERSONAL_PLAYBOOK_RULE_TAG, patchPersonalPlaybookContextTags, personalPlaybookContext } from "../../../user-context/personal-playbook.js";
|
|
22
25
|
import { listConnectorInstances } from "../../../connectors/instances.js";
|
|
23
26
|
import { uninstallConnector } from "../../../connectors/install.js";
|
|
24
27
|
import { renderUserClaim } from "../../../knowledge/connected-understanding-pipeline.js";
|
|
25
|
-
import { readUserProfileFile, writeUserProfileFile } from "../../agents-admin.js";
|
|
26
28
|
import { isUserContextMemoryKind, isUserContextRecord, projectPersonalContextSources, projectUserContextRecord, recordsDerivedFromPersonalContextSource } from "../../../user-context/projection.js";
|
|
27
29
|
import { prepareUserContextImport } from "../../../user-context/import.js";
|
|
28
30
|
import { buildUserProfileSetup, parseUserProfileMarkdown, patchUserProfileMarkdown } from "../../../user-context/profile.js";
|
|
@@ -850,23 +852,19 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
850
852
|
}
|
|
851
853
|
const title = existing.content.trim().split(/\r?\n/)[0].slice(0, 72);
|
|
852
854
|
const uiLocale = body.uiLocale === "zh" ? "zh" : "en";
|
|
853
|
-
const
|
|
854
|
-
title,
|
|
855
|
-
context: existing.content,
|
|
856
|
-
uiLocale,
|
|
857
|
-
modelRef: config.goals?.judgeModelRef
|
|
858
|
-
});
|
|
855
|
+
const contract = defineOutcomeContract(title);
|
|
859
856
|
const goals = new GoalService();
|
|
860
|
-
const goal =
|
|
861
|
-
|
|
857
|
+
const goal = new OutcomeExecutionService().create({
|
|
858
|
+
objective: contract.objective,
|
|
862
859
|
description: existing.content,
|
|
860
|
+
deliverables: contract.deliverables,
|
|
861
|
+
acceptanceCriteria: contract.acceptanceCriteria,
|
|
862
|
+
constraints: contract.constraints,
|
|
863
863
|
agentId: selectedAgentId(config),
|
|
864
864
|
priority: "normal",
|
|
865
865
|
uiLocale,
|
|
866
|
-
source: "api"
|
|
867
|
-
|
|
868
|
-
config
|
|
869
|
-
});
|
|
866
|
+
source: "api"
|
|
867
|
+
}).goal;
|
|
870
868
|
goals.setContextMessage({
|
|
871
869
|
goalId: goal.id,
|
|
872
870
|
text: existing.content
|
|
@@ -884,7 +882,7 @@ function registerYouRoutes(authenticated, deps) {
|
|
|
884
882
|
ok: true,
|
|
885
883
|
status: queued ? "queued" : "saved",
|
|
886
884
|
goal: goals.get(goal.id),
|
|
887
|
-
href: `/
|
|
885
|
+
href: `/work/${encodeURIComponent(goal.outcomeId)}`
|
|
888
886
|
});
|
|
889
887
|
});
|
|
890
888
|
authenticated.patch("/api/you/controls", deps.strictRateLimitMiddleware, async (c) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { buildDefaultCorsOrigins, isAllInterfacesHost, isLoopbackHost, resolveEffectiveGatewayPort, resolveGatewayServiceListenPort } from "./host.js";
|
|
2
2
|
import { defaultGatewayBindMode, isContainerEnvironment, resolveGatewayBindHost, resolveGatewayBindHostSync, resolveGatewayBindMode, resolveGatewayEffectiveHost } from "../config/gateway-bind.js";
|
|
3
|
-
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
4
|
-
import { resolveGatewayListenHost, resolveGatewayListenPlan } from "./listen.js";
|
|
5
3
|
import { buckets } from "./rate-limit/buckets.js";
|
|
6
4
|
import { isGatewayStrictSecurityEnabled } from "./rate-limit/env-flags.js";
|
|
7
5
|
import "./rate-limit/index.js";
|
|
6
|
+
import { assertGatewayAuthConfigured, extractToken, resolveGatewayAuth, validateToken } from "./auth.js";
|
|
7
|
+
import { resolveGatewayListenHost, resolveGatewayListenPlan } from "./listen.js";
|
|
8
8
|
import { assertGatewayRuntimeConfig } from "./runtime-config.js";
|
|
9
9
|
import { restartGatewayProcessWithFreshPid } from "./respawn.js";
|
|
10
10
|
import { GatewayService } from "./service.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isAllInterfacesHost, isLoopbackHost } from "./host.js";
|
|
2
|
-
import { resolveGatewayListenPlan } from "./listen.js";
|
|
3
|
-
import { assertTailscaleExposureCompatible } from "./tailscale-lifecycle.js";
|
|
4
2
|
import { isAuthRateLimitGloballyDisabled, isGatewayStrictSecurityEnabled } from "./rate-limit/env-flags.js";
|
|
5
3
|
import "./rate-limit/index.js";
|
|
4
|
+
import { resolveGatewayListenPlan } from "./listen.js";
|
|
5
|
+
import { assertTailscaleExposureCompatible } from "./tailscale-lifecycle.js";
|
|
6
6
|
//#region src/gateway/runtime-config.ts
|
|
7
7
|
function normalizeCorsOrigins(cfg) {
|
|
8
8
|
return (cfg.gateway?.corsOrigins ?? []).map((value) => value.trim()).filter(Boolean);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { isAuthRateLimitGloballyDisabled, isGatewayStrictSecurityEnabled } from "../rate-limit/env-flags.js";
|
|
4
|
+
import "../rate-limit/index.js";
|
|
3
5
|
import { assertGatewayAuthConfigured, resolveGatewayAuth } from "../auth.js";
|
|
4
6
|
import { resolveGatewayListenPlan } from "../listen.js";
|
|
5
7
|
import { collectExposureConflicts, isRemoteGatewayInsecure, isTailnetBindUnavailable } from "../../remote-access/exposure-guards.js";
|
|
6
|
-
import { isAuthRateLimitGloballyDisabled, isGatewayStrictSecurityEnabled } from "../rate-limit/env-flags.js";
|
|
7
|
-
import "../rate-limit/index.js";
|
|
8
8
|
import { assertGatewayRuntimeConfig } from "../runtime-config.js";
|
|
9
9
|
//#region src/gateway/security/audit.ts
|
|
10
10
|
init_logger();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { safeEqualSecret } from "./secret-equal.js";
|
|
2
2
|
import { KNOWN_WEAK_GATEWAY_TOKEN_PLACEHOLDERS, assertGatewayAuthNotKnownWeak } from "./known-weak-secrets.js";
|
|
3
3
|
import { auditGatewayConfig, collectGatewayConfigFindings, collectGatewaySecurityFindings, collectGatewayStartupGuardFindings } from "./audit.js";
|
|
4
|
+
import { detectSuspiciousPatterns, wrapExternalContent, wrapWebContent } from "./external-content.js";
|
|
4
5
|
import { buildGatewayConsoleCspHeader, computeInlineScriptHashes } from "./csp.js";
|
|
5
6
|
import { checkBrowserOrigin } from "./origin-check.js";
|
|
6
7
|
import { ADMIN_SCOPE, DEFAULT_OPERATOR_SCOPES, KNOWN_OPERATOR_SCOPES, READ_SCOPE, WRITE_SCOPE, authorizeRouteScope, authorizeScope, isOperatorScope, parseScopesHeader } from "./operator-scopes.js";
|
|
7
8
|
import { DEFAULT_GATEWAY_HTTP_TOOL_DENY, filterDangerousHttpTools, isDangerousHttpTool } from "./dangerous-tools.js";
|
|
8
|
-
import { detectSuspiciousPatterns, wrapExternalContent, wrapWebContent } from "./external-content.js";
|
|
9
9
|
import { createPreauthConnectionBudget, getMaxPreauthConnectionsPerIp } from "./preauth-connection-budget.js";
|
|
10
10
|
export { ADMIN_SCOPE, DEFAULT_GATEWAY_HTTP_TOOL_DENY, DEFAULT_OPERATOR_SCOPES, KNOWN_OPERATOR_SCOPES, KNOWN_WEAK_GATEWAY_TOKEN_PLACEHOLDERS, READ_SCOPE, WRITE_SCOPE, assertGatewayAuthNotKnownWeak, auditGatewayConfig, authorizeRouteScope, authorizeScope, buildGatewayConsoleCspHeader, checkBrowserOrigin, collectGatewayConfigFindings, collectGatewaySecurityFindings, collectGatewayStartupGuardFindings, computeInlineScriptHashes, createPreauthConnectionBudget, detectSuspiciousPatterns, filterDangerousHttpTools, getMaxPreauthConnectionsPerIp, isDangerousHttpTool, isOperatorScope, parseScopesHeader, safeEqualSecret, wrapExternalContent, wrapWebContent };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createLogger } from "../../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../../utils/logger.js";
|
|
3
|
-
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
3
|
import { getModelRegistry } from "../../providers/model-registry.js";
|
|
4
|
+
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
5
5
|
import { init_providers } from "../../providers/index.js";
|
|
6
|
+
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
6
7
|
import { reloadImageGenerationProviders } from "../../agent/image/generation/provider-registry.js";
|
|
7
8
|
import { disposeAllSessionMcpRuntimes } from "../../agent/mcp/bundle-mcp-runtime.js";
|
|
8
9
|
import "../../agent/mcp/bundle-mcp-tools.js";
|
|
9
10
|
import { ConfigHotReloader } from "../../config/reload.js";
|
|
10
11
|
import "../../config/index.js";
|
|
11
12
|
import { computeBundledExtensionExtensionsPatch } from "../../extensions/bundled-extension-activation.js";
|
|
12
|
-
import { sanitizeTunnelConfig } from "../../tunnel/tunnel-config.js";
|
|
13
13
|
//#region src/gateway/service/config-coordinator.ts
|
|
14
14
|
init_providers();
|
|
15
15
|
init_logger();
|