@xopcai/xopc 0.0.177 → 0.0.179
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-Wu2ikfbM.js → activity-store-A5FUMjeV.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-B0_biISn.js → agent-avatar-dicebear-NghNiDWx.js} +1 -1
- package/dist/gateway/static/root/assets/agents-Baq8Shzy.js +2 -0
- package/dist/gateway/static/root/assets/{api-DljBt-N5.js → api-Bmzslx0Z.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-CKoZRi7Y.js → app-management-settings-panel-DDWS_BBJ.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-DOdXhNDo.js → appearance-settings-C6znvVtX.js} +1 -1
- package/dist/gateway/static/root/assets/apps-page-d-Y0Jbe1.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-D18gyP76.js → archive-plugin-fvTZhPUr.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-CZh9fc8u.js → attachment-load-BFEgvg-Q.js} +1 -1
- package/dist/gateway/static/root/assets/automations-page-CFYOCBlQ.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-DdSyGL6M.js → binary-plugins-CuI2bOc7.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BOpNApiX.js → block-editor-Z_k8W0al.js} +46 -46
- package/dist/gateway/static/root/assets/browser-settings-page-CGApoYPr.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-C0SnSj_R.js → browser-workflow-inputs-gs6b5e9-.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-CzlzH7HA.js → browser-workflows-page-Cq5qXStp.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-BC-8n4Hl.js +7 -0
- package/dist/gateway/static/root/assets/{capability-presets-api-RM6S7ES5.js → capability-presets-api-BTKhPoDC.js} +1 -1
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-D7WQ0oBN.js +1 -0
- package/dist/gateway/static/root/assets/{channel-recipient-api-B4sha-30.js → channel-recipient-api-TwMak0SE.js} +1 -1
- package/dist/gateway/static/root/assets/channels-settings-DysELlO_.js +1 -0
- package/dist/gateway/static/root/assets/channels-status-swr-BAC-R8IK.js +1 -0
- package/dist/gateway/static/root/assets/{connector-logo-BPsKIyoM.js → connector-logo-DBKotvNr.js} +1 -1
- package/dist/gateway/static/root/assets/connectors-page-QH-0WnOo.js +2 -0
- package/dist/gateway/static/root/assets/desktop-pet-Dwml8znf.js +1 -0
- package/dist/gateway/static/root/assets/desktop-pet-settings-CyIg2jJp.js +1 -0
- package/dist/gateway/static/root/assets/{directory-picker-path-field-BoZGualI.js → directory-picker-path-field-B6fc_7SL.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-s3gn3f9h.js → dreaming-settings-CUQxGnDf.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-DIbMngCF.js → extension-debug-page-AbRNi2ON.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-D94f2bWQ.js → extension-page-ClYfiLXC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-B7TI13ex.js → extension-settings-page-BGVP2hw1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-Do77rV8R.js → gateway-config-api-B7GqtklK.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BMeK8igT.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-WaXTw3fi.js → gateway-startup-retry-CKKL96r_.js} +1 -1
- package/dist/gateway/static/root/assets/goals-settings-Dj0ao2qA.js +1 -0
- package/dist/gateway/static/root/assets/{heartbeat-settings-C3kzg6ai.js → heartbeat-settings-CTI2nPKa.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-BgISY8i-.js → image-generation-api-BY3VQ5Mv.js} +1 -1
- package/dist/gateway/static/root/assets/index-B0Tdge_q.css +1 -0
- package/dist/gateway/static/root/assets/index-BDzspHrg.js +224 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-0KSmaPu0.js → keyboard-shortcuts-settings-CELtDFz3.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-m8CTSGix.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-BMrU8u7w.js → local-apps-page-CF5uUd1n.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-DVGhFXRz.js → locale-store-DIVc0AQs.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-DmH7Tk4k.js +7 -0
- package/dist/gateway/static/root/assets/{markdown-split-BVqbtN9o.js → markdown-split-CN85EdB8.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-Dr_wtkNJ.js → media-plugins-CxYEc-b8.js} +1 -1
- package/dist/gateway/static/root/assets/messages-DYqBwJAK.js +3 -0
- package/dist/gateway/static/root/assets/{notes-page-BWZRXsq6.js → notes-page-Goab4781.js} +1 -1
- package/dist/gateway/static/root/assets/notes-workbench-C4jDBVBN.js +4 -0
- package/dist/gateway/static/root/assets/outcome-detail-page-DNRfeLZp.js +1 -0
- package/dist/gateway/static/root/assets/{page-tabs-DWWgy0bF.js → page-tabs-tQNQcAts.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Bnfs93ZP.js → preview-open-alternatives-BSTlgsDB.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-BR7QFmT-.js → product-open-page-iQ5gTCip.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-D7anK-eu.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-BePESKWy.js +1 -0
- package/dist/gateway/static/root/assets/remote-access-hub-CHrzBKIs.js +1 -0
- package/dist/gateway/static/root/assets/{save-bar-controls-BzS-rRTP.js → save-bar-controls-BsPf5Gkk.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-Cl2IIDAN.js → schedule-field-kAytH7mq.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-BjKjp5eZ.js → schema-form-Bbw8l2ri.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-He5YAczL.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-2eAC9GCP.js +1 -0
- package/dist/gateway/static/root/assets/{settings-form-section-BSDNBfHn.js → settings-form-section-BqbibcnJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-BD4peoAv.js → settings-loading-skeleton-DNLNCEGT.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-S-P3U7at.js → settings-page-BR6Ss0bK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-BQTLh-86.js → settings-page-layout-Cdb1e2Cz.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-W3p6kNyA.js → setup-status-panel-moT-D-ia.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-DQjMxyvw.js → share-preview-page-CkrASny2.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-X49zY21H.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-CjpnFfOH.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-DEwfSOUE.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-CXnpudm6.js → skills-page.utils-BG5dGkyA.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-BhFwdYJP.js → system-settings-panel-XdY8eyYf.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DQI-HPL-.js → theme-store-DtwI_VLT.js} +1 -1
- package/dist/gateway/static/root/assets/time-picker-UghsQu_I.js +1 -0
- package/dist/gateway/static/root/assets/{typed-models-lib-C-M3Fv2N.js → typed-models-lib-DOnpwsrE.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-Bndq4y4I.js → use-channel-catalog-BWDtfNvQ.js} +1 -1
- package/dist/gateway/static/root/assets/user-context-page-BtNBEtKj.js +1 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-p_g4UI1-.js → voice-api-key-field-DP80jW-W.js} +1 -1
- package/dist/gateway/static/root/assets/work-copy-hQmivDgT.js +1 -0
- package/dist/gateway/static/root/assets/work-discovery-page-CkDOVZBr.js +1 -0
- package/dist/gateway/static/root/assets/work-item-detail-page-CqvkcFcR.js +1 -0
- package/dist/gateway/static/root/assets/work-page-BL8TZW4Z.js +3 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-CHEXVvhH.js → workflow-run-setup-panel-BLlVqKdA.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BgsdRu3_.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/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 +3 -0
- package/dist/src/agent/embedded/run-for-session.js +18 -5
- package/dist/src/agent/embedded/run-turn.js +6 -3
- package/dist/src/agent/embedded/types.d.ts +2 -0
- package/dist/src/agent/goals/post-turn.js +6 -5
- package/dist/src/agent/mcp/mcp-stdio-transport.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/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/process-direct-streaming.js +3 -1
- package/dist/src/agent/tools/factory.js +16 -1
- package/dist/src/agent/tools/goal-tool.js +5 -3
- 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/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/goal.js +6 -5
- package/dist/src/cli/commands/tunnel.js +3 -3
- package/dist/src/config/agent-profile.js +1 -1
- package/dist/src/connectors/composio-sessions.js +1 -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/sdk/testing.js +1 -1
- package/dist/src/gateway/agents-admin.js +2 -2
- 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/hono/app.js +8 -3
- package/dist/src/gateway/hono/lib/config-payload.js +1 -1
- 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/routes/agents.js +1 -1
- package/dist/src/gateway/hono/routes/browser-install.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/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 +12 -14
- 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 +1 -1
- 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 +139 -12
- 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/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 +9 -0
- 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/providers/provider-auth-service.js +3 -0
- package/dist/src/providers/register-bundled-oauth-flows.d.ts +2 -0
- package/dist/src/providers/register-bundled-oauth-flows.js +16 -0
- package/dist/src/session/store.d.ts +2 -0
- package/dist/src/session/store.js +30 -0
- 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/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.js +1 -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 +118 -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 +1 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +2 -2
- package/package.json +3 -11
- package/dist/gateway/static/root/assets/agents-TpIpJk59.js +0 -2
- package/dist/gateway/static/root/assets/apps-page-Cxbn5hy8.js +0 -1
- package/dist/gateway/static/root/assets/automation-suggestion-card-DKrVoiiK.js +0 -1
- package/dist/gateway/static/root/assets/automations-page-DYv16QMU.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-DlcqaGu1.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-QPX4wsGZ.js +0 -7
- package/dist/gateway/static/root/assets/capability-presets-settings-panel-DmCeusO8.js +0 -1
- package/dist/gateway/static/root/assets/channels-settings-HcKoP1wm.js +0 -1
- package/dist/gateway/static/root/assets/channels-status-swr-D3xr2enH.js +0 -1
- package/dist/gateway/static/root/assets/circle-alert-BEjgurr2.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-DwbThFvd.js +0 -2
- package/dist/gateway/static/root/assets/desktop-pet-DjL1GWON.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-u_abAXh7.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-Dt1PNJmb.js +0 -1
- package/dist/gateway/static/root/assets/goal-create-dialog-DEiOOLGU.js +0 -1
- package/dist/gateway/static/root/assets/goal-detail-page-C1Qj4o1K.js +0 -4
- package/dist/gateway/static/root/assets/goals-config-api-BL0fAEns.js +0 -1
- package/dist/gateway/static/root/assets/goals-page-qJDcEDzc.js +0 -2
- package/dist/gateway/static/root/assets/goals-settings-DV3ZlrdI.js +0 -1
- package/dist/gateway/static/root/assets/index-C1h0zkNo.js +0 -212
- package/dist/gateway/static/root/assets/index-Da36E3WH.css +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-DcD4mVId.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-CW5m9Cov.js +0 -7
- package/dist/gateway/static/root/assets/messages-r8L6Ur3A.js +0 -3
- package/dist/gateway/static/root/assets/notes-workbench-DdnwNz9x.js +0 -4
- package/dist/gateway/static/root/assets/product-delivery-BTRT9kCS.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-B8GeS4dl.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-DOeu1Hk_.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-De94rxnE.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-A7p8G0OJ.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-BsGzjmqx.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-Xo3N99PO.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-ByPEG5t1.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-C019Ml5q.js +0 -2
- package/dist/gateway/static/root/assets/time-picker-C0DCya4U.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-fYBzpus-.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-page-DI0gCZRw.js +0 -1
- package/dist/gateway/static/root/assets/work-item-detail-page-DnBRP2wI.js +0 -1
- package/dist/gateway/static/root/assets/work-page-Z-nUaS_n.js +0 -3
- package/dist/gateway/static/root/assets/workflows-page-BDfwnM-Y.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
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { createLogger } from "../../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../../utils/logger.js";
|
|
3
|
+
import { listKnowledgeSourceItems } from "../../storage/sqlite/knowledge-repository.js";
|
|
4
|
+
import { getConnectorSyncPolicy } from "../../storage/sqlite/connector-sync-policy-repository.js";
|
|
5
|
+
//#region src/proactive/temporal/worker.ts
|
|
6
|
+
init_logger();
|
|
7
|
+
const log = createLogger("Proactive:Temporal");
|
|
8
|
+
const MEETING_SCENARIO = "meeting_preparation";
|
|
9
|
+
function metadataString(metadata, key) {
|
|
10
|
+
const value = metadata[key];
|
|
11
|
+
return typeof value === "string" && value.trim() ? value : void 0;
|
|
12
|
+
}
|
|
13
|
+
function meetingWindow(startMs, nowMs) {
|
|
14
|
+
const untilStart = startMs - nowMs;
|
|
15
|
+
if (untilStart <= 0) return null;
|
|
16
|
+
if (untilStart <= 120 * 6e4) return "2h";
|
|
17
|
+
if (untilStart <= 1440 * 6e4) return "24h";
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
var ProactiveTemporalWorker = class {
|
|
21
|
+
timer = null;
|
|
22
|
+
running = false;
|
|
23
|
+
constructor(events, intervalMs = 6e4) {
|
|
24
|
+
this.events = events;
|
|
25
|
+
this.intervalMs = intervalMs;
|
|
26
|
+
}
|
|
27
|
+
start() {
|
|
28
|
+
if (this.timer) return;
|
|
29
|
+
this.tick();
|
|
30
|
+
this.timer = setInterval(() => void this.tick(), Math.max(5e3, this.intervalMs));
|
|
31
|
+
this.timer.unref?.();
|
|
32
|
+
}
|
|
33
|
+
stop() {
|
|
34
|
+
if (this.timer) clearInterval(this.timer);
|
|
35
|
+
this.timer = null;
|
|
36
|
+
}
|
|
37
|
+
async tick(now = /* @__PURE__ */ new Date()) {
|
|
38
|
+
if (this.running) return {
|
|
39
|
+
scanned: 0,
|
|
40
|
+
published: 0,
|
|
41
|
+
skipped: 0
|
|
42
|
+
};
|
|
43
|
+
this.running = true;
|
|
44
|
+
const result = {
|
|
45
|
+
scanned: 0,
|
|
46
|
+
published: 0,
|
|
47
|
+
skipped: 0
|
|
48
|
+
};
|
|
49
|
+
try {
|
|
50
|
+
const nowMs = now.getTime();
|
|
51
|
+
const pageSize = 500;
|
|
52
|
+
for (let offset = 0;; offset += pageSize) {
|
|
53
|
+
const items = listKnowledgeSourceItems({
|
|
54
|
+
itemType: "calendar_event",
|
|
55
|
+
occurredAfterMs: nowMs,
|
|
56
|
+
occurredBeforeMs: nowMs + 1440 * 6e4,
|
|
57
|
+
orderBy: "occurred_asc",
|
|
58
|
+
limit: pageSize,
|
|
59
|
+
offset
|
|
60
|
+
});
|
|
61
|
+
for (const item of items) {
|
|
62
|
+
result.scanned += 1;
|
|
63
|
+
const connectionId = metadataString(item.metadata, "connectionId");
|
|
64
|
+
const workspaceId = metadataString(item.metadata, "workspaceId");
|
|
65
|
+
const connectorId = metadataString(item.metadata, "connectorId");
|
|
66
|
+
const agentId = metadataString(item.metadata, "agentId");
|
|
67
|
+
const window = meetingWindow(item.occurredAt ? Date.parse(item.occurredAt) : NaN, nowMs);
|
|
68
|
+
const policy = connectionId ? getConnectorSyncPolicy(connectionId) : void 0;
|
|
69
|
+
const scenarioAllowed = !policy?.allowedScenarioKeys.length || policy.allowedScenarioKeys.includes(MEETING_SCENARIO);
|
|
70
|
+
if (!connectionId || !workspaceId || !connectorId || !window || !policy?.scanEnabled || !policy.proactiveEnabled || !scenarioAllowed || item.sensitivity === "secret" || item.sensitivity === "regulated") {
|
|
71
|
+
result.skipped += 1;
|
|
72
|
+
continue;
|
|
73
|
+
}
|
|
74
|
+
if (this.events.publish({
|
|
75
|
+
type: "connected_source.calendar_window.v1",
|
|
76
|
+
schemaVersion: 1,
|
|
77
|
+
source: {
|
|
78
|
+
kind: "connector",
|
|
79
|
+
id: connectionId
|
|
80
|
+
},
|
|
81
|
+
subject: {
|
|
82
|
+
kind: "knowledge_source_item",
|
|
83
|
+
id: item.id
|
|
84
|
+
},
|
|
85
|
+
actor: { kind: "system" },
|
|
86
|
+
scope: {
|
|
87
|
+
workspaceId,
|
|
88
|
+
...agentId ? { agentId } : {}
|
|
89
|
+
},
|
|
90
|
+
occurredAt: now.toISOString(),
|
|
91
|
+
dedupeKey: `calendar-window:${item.id}:${item.occurredAt}:${window}`,
|
|
92
|
+
sensitivity: item.sensitivity === "normal" ? "personal" : item.sensitivity,
|
|
93
|
+
payload: {
|
|
94
|
+
sourceItemId: item.id,
|
|
95
|
+
meetingStartsAt: item.occurredAt,
|
|
96
|
+
window
|
|
97
|
+
}
|
|
98
|
+
}, now).inserted) result.published += 1;
|
|
99
|
+
}
|
|
100
|
+
if (items.length < pageSize) break;
|
|
101
|
+
}
|
|
102
|
+
if (result.published > 0) log.info(result, "Temporal meeting signals published");
|
|
103
|
+
return result;
|
|
104
|
+
} finally {
|
|
105
|
+
this.running = false;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
//#endregion
|
|
110
|
+
export { ProactiveTemporalWorker };
|
|
@@ -2,11 +2,13 @@ import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
|
2
2
|
import { init_paths, resolveModelsJsonPath } from "../config/paths.js";
|
|
3
3
|
import { CredentialResolver, init_credentials } from "../auth/credentials.js";
|
|
4
4
|
import { XopcModelCredentialStore, init_model_credential_store } from "../auth/model-credential-store.js";
|
|
5
|
+
import { init_register_bundled_oauth_flows, registerBundledOAuthFlows } from "./register-bundled-oauth-flows.js";
|
|
5
6
|
import { init_register_runtime_providers, registerRuntimeProviders } from "./register-runtime-providers.js";
|
|
6
7
|
import { InMemoryModelsStore } from "@earendil-works/pi-ai";
|
|
7
8
|
import { ModelRuntime } from "@earendil-works/pi-coding-agent";
|
|
8
9
|
//#region src/providers/provider-auth-service.ts
|
|
9
10
|
async function createAuthRuntime(credentials) {
|
|
11
|
+
registerBundledOAuthFlows();
|
|
10
12
|
const runtime = await ModelRuntime.create({
|
|
11
13
|
credentials,
|
|
12
14
|
modelsPath: resolveModelsJsonPath(),
|
|
@@ -32,6 +34,7 @@ var init_provider_auth_service = __esmMin((() => {
|
|
|
32
34
|
init_credentials();
|
|
33
35
|
init_model_credential_store();
|
|
34
36
|
init_paths();
|
|
37
|
+
init_register_bundled_oauth_flows();
|
|
35
38
|
init_register_runtime_providers();
|
|
36
39
|
ProviderAuthService = class {
|
|
37
40
|
credentials;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __esmMin } from "../../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { registerBunOAuthFlows } from "@earendil-works/pi-ai/bun-oauth";
|
|
3
|
+
//#region src/providers/register-bundled-oauth-flows.ts
|
|
4
|
+
/** Statically include pi-ai OAuth flows for single-file runtimes such as Electron. */
|
|
5
|
+
function registerBundledOAuthFlows() {
|
|
6
|
+
if (registered) return;
|
|
7
|
+
registerBunOAuthFlows();
|
|
8
|
+
registered = true;
|
|
9
|
+
}
|
|
10
|
+
var registered;
|
|
11
|
+
var init_register_bundled_oauth_flows = __esmMin((() => {
|
|
12
|
+
registered = false;
|
|
13
|
+
}));
|
|
14
|
+
//#endregion
|
|
15
|
+
init_register_bundled_oauth_flows();
|
|
16
|
+
export { init_register_bundled_oauth_flows, registerBundledOAuthFlows };
|
|
@@ -26,6 +26,7 @@ export interface SessionCompactionHooks {
|
|
|
26
26
|
compactedCount: number;
|
|
27
27
|
}) => Promise<void> | void;
|
|
28
28
|
}
|
|
29
|
+
export type ModelFallbackPreparation = 'prompt' | 'resume' | 'unsafe';
|
|
29
30
|
export declare class SessionStore {
|
|
30
31
|
private options;
|
|
31
32
|
private window;
|
|
@@ -78,6 +79,7 @@ export declare class SessionStore {
|
|
|
78
79
|
private buildSessionDetail;
|
|
79
80
|
loadTranscriptRows(key: string): Promise<TranscriptStoredRow[]>;
|
|
80
81
|
loadTranscriptHistoryRows(key: string): Promise<TranscriptStoredRow[]>;
|
|
82
|
+
prepareModelFallback(key: string, rowsBeforeAttempt: readonly TranscriptStoredRow[]): Promise<ModelFallbackPreparation>;
|
|
81
83
|
getMetadata(key: string): Promise<SessionMetadata | null>;
|
|
82
84
|
resolveKeyBySessionId(sessionId: string): Promise<string | null>;
|
|
83
85
|
updateMetadata(key: string, updates: Partial<SessionMetadata>): Promise<void>;
|
|
@@ -21,6 +21,16 @@ init_paths_state();
|
|
|
21
21
|
init_logger();
|
|
22
22
|
const log = createLogger("SessionStore");
|
|
23
23
|
const INDEX_VERSION = "1.0";
|
|
24
|
+
function isTranscriptMessageRole(row, role) {
|
|
25
|
+
return !!row && typeof row === "object" && "role" in row && row.role === role;
|
|
26
|
+
}
|
|
27
|
+
function isErrorAssistantRow(row) {
|
|
28
|
+
return isTranscriptMessageRole(row, "assistant") && row.stopReason === "error";
|
|
29
|
+
}
|
|
30
|
+
function transcriptPrefixMatches(expected, current) {
|
|
31
|
+
if (current.length < expected.length) return false;
|
|
32
|
+
return expected.every((row, index) => JSON.stringify(row) === JSON.stringify(current[index]));
|
|
33
|
+
}
|
|
24
34
|
var SessionStore = class {
|
|
25
35
|
window;
|
|
26
36
|
compactor;
|
|
@@ -186,6 +196,26 @@ var SessionStore = class {
|
|
|
186
196
|
requireXopcDatabase();
|
|
187
197
|
return loadTranscriptHistoryRowsForSession(key);
|
|
188
198
|
}
|
|
199
|
+
async prepareModelFallback(key, rowsBeforeAttempt) {
|
|
200
|
+
return this.runStoreMutation(async () => {
|
|
201
|
+
requireXopcDatabase();
|
|
202
|
+
const currentRows = loadTranscriptRowsForSession(key);
|
|
203
|
+
if (!transcriptPrefixMatches(rowsBeforeAttempt, currentRows)) return "unsafe";
|
|
204
|
+
let preparedRows = currentRows;
|
|
205
|
+
let removedError = false;
|
|
206
|
+
if (isErrorAssistantRow(preparedRows.at(-1))) {
|
|
207
|
+
preparedRows = preparedRows.slice(0, -1);
|
|
208
|
+
removedError = true;
|
|
209
|
+
}
|
|
210
|
+
const appendedRows = preparedRows.slice(rowsBeforeAttempt.length);
|
|
211
|
+
if (appendedRows.length === 1 && isTranscriptMessageRole(appendedRows[0], "user") || removedError && appendedRows.length === 0 && isTranscriptMessageRole(preparedRows.at(-1), "user")) {
|
|
212
|
+
if (removedError) replaceTranscriptRows(key, preparedRows);
|
|
213
|
+
return "resume";
|
|
214
|
+
}
|
|
215
|
+
if (!removedError && appendedRows.length === 0) return "prompt";
|
|
216
|
+
return "unsafe";
|
|
217
|
+
});
|
|
218
|
+
}
|
|
189
219
|
async getMetadata(key) {
|
|
190
220
|
requireXopcDatabase();
|
|
191
221
|
return getSessionMetadata(key);
|
|
@@ -2,8 +2,8 @@ import { isPathUnderWorkspace } from "../gateway/workspace-editor-path.js";
|
|
|
2
2
|
import { relative, resolve } from "node:path";
|
|
3
3
|
import { createReadStream } from "node:fs";
|
|
4
4
|
import { lstat, readdir, realpath, stat } from "node:fs/promises";
|
|
5
|
-
import { Readable, Transform } from "node:stream";
|
|
6
5
|
import { pipeline } from "node:stream/promises";
|
|
6
|
+
import { Readable, Transform } from "node:stream";
|
|
7
7
|
import { crc32, createDeflateRaw } from "node:zlib";
|
|
8
8
|
//#region src/share/share-zip.ts
|
|
9
9
|
const SIG_LOCAL = 67324752;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createLogger } from "../utils/logger/index.js";
|
|
2
2
|
import { init_logger } from "../utils/logger.js";
|
|
3
|
-
import { request } from "undici";
|
|
4
3
|
import { Readable } from "node:stream";
|
|
4
|
+
import { request } from "undici";
|
|
5
5
|
import * as ws from "ws";
|
|
6
6
|
//#region src/share/site-proxy.ts
|
|
7
7
|
init_logger();
|
|
@@ -6,3 +6,4 @@ export declare function listObjectActivityRecords(options: ListObjectActivityOpt
|
|
|
6
6
|
export declare function listProjectActivityRecords(options: ListProjectActivityOptions): ActivityListResult;
|
|
7
7
|
export declare function createObjectLinkRecord(input: CreateObjectLinkInput): ObjectLink;
|
|
8
8
|
export declare function listObjectLinkRecords(object: ActivityObjectRef): ObjectLink[];
|
|
9
|
+
export declare function deleteObjectLinkRecord(id: string): boolean;
|
|
@@ -202,5 +202,8 @@ function listObjectLinkRecords(object) {
|
|
|
202
202
|
WHERE (from_kind = ? AND from_id = ?) OR (to_kind = ? AND to_id = ?)
|
|
203
203
|
ORDER BY created_at DESC, id DESC`).all(object.kind, object.id, object.kind, object.id).map((row) => objectLinkFromRow(row));
|
|
204
204
|
}
|
|
205
|
+
function deleteObjectLinkRecord(id) {
|
|
206
|
+
return runSqliteWriteTransaction((db) => db.prepare("DELETE FROM object_links WHERE id = ?").run(id).changes > 0);
|
|
207
|
+
}
|
|
205
208
|
//#endregion
|
|
206
|
-
export { createObjectLinkRecord, getActivityEventRecord, listActivityRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, recordActivityEvent };
|
|
209
|
+
export { createObjectLinkRecord, deleteObjectLinkRecord, getActivityEventRecord, listActivityRecords, listObjectActivityRecords, listObjectLinkRecords, listProjectActivityRecords, recordActivityEvent };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type ConnectorSyncPolicy = {
|
|
2
|
+
connectionId: string;
|
|
3
|
+
scanEnabled: boolean;
|
|
4
|
+
proactiveEnabled: boolean;
|
|
5
|
+
intervalMinutes?: number;
|
|
6
|
+
allowedScenarioKeys: string[];
|
|
7
|
+
revision: number;
|
|
8
|
+
updatedAt: string;
|
|
9
|
+
};
|
|
10
|
+
export declare function getConnectorSyncPolicy(connectionId: string): ConnectorSyncPolicy | undefined;
|
|
11
|
+
export declare function listConnectorSyncPolicies(): ConnectorSyncPolicy[];
|
|
12
|
+
export declare function upsertConnectorSyncPolicy(input: {
|
|
13
|
+
connectionId: string;
|
|
14
|
+
scanEnabled?: boolean;
|
|
15
|
+
proactiveEnabled?: boolean;
|
|
16
|
+
intervalMinutes?: number | null;
|
|
17
|
+
defaultIntervalMinutes?: number;
|
|
18
|
+
allowedScenarioKeys?: string[];
|
|
19
|
+
nowMs?: number;
|
|
20
|
+
}): ConnectorSyncPolicy;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
//#region src/storage/sqlite/connector-sync-policy-repository.ts
|
|
3
|
+
function stringArray(value) {
|
|
4
|
+
try {
|
|
5
|
+
const parsed = JSON.parse(value);
|
|
6
|
+
return Array.isArray(parsed) ? parsed.filter((item) => typeof item === "string") : [];
|
|
7
|
+
} catch {
|
|
8
|
+
return [];
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function fromRow(row) {
|
|
12
|
+
return {
|
|
13
|
+
connectionId: row.connection_id,
|
|
14
|
+
scanEnabled: row.scan_enabled === 1,
|
|
15
|
+
proactiveEnabled: row.proactive_enabled === 1,
|
|
16
|
+
...row.interval_minutes == null ? {} : { intervalMinutes: row.interval_minutes },
|
|
17
|
+
allowedScenarioKeys: stringArray(row.allowed_scenario_keys_json),
|
|
18
|
+
revision: row.revision,
|
|
19
|
+
updatedAt: new Date(row.updated_at).toISOString()
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function getConnectorSyncPolicy(connectionId) {
|
|
23
|
+
const row = getSqliteDatabase().prepare("SELECT * FROM connector_sync_policies WHERE connection_id = ?").get(connectionId);
|
|
24
|
+
return row ? fromRow(row) : void 0;
|
|
25
|
+
}
|
|
26
|
+
function listConnectorSyncPolicies() {
|
|
27
|
+
return getSqliteDatabase().prepare("SELECT * FROM connector_sync_policies ORDER BY connection_id ASC").all().map(fromRow);
|
|
28
|
+
}
|
|
29
|
+
function upsertConnectorSyncPolicy(input) {
|
|
30
|
+
const current = getConnectorSyncPolicy(input.connectionId);
|
|
31
|
+
const now = input.nowMs ?? Date.now();
|
|
32
|
+
const intervalMinutes = input.intervalMinutes === null ? null : Math.max(5, Math.min(1440, input.intervalMinutes ?? current?.intervalMinutes ?? input.defaultIntervalMinutes ?? 30));
|
|
33
|
+
const allowedScenarioKeys = [...new Set((input.allowedScenarioKeys ?? current?.allowedScenarioKeys ?? []).map((key) => key.trim()).filter(Boolean))].sort();
|
|
34
|
+
runSqliteWriteTransaction((db) => {
|
|
35
|
+
db.prepare(`INSERT INTO connector_sync_policies (
|
|
36
|
+
connection_id, scan_enabled, proactive_enabled, interval_minutes,
|
|
37
|
+
allowed_scenario_keys_json, revision, updated_at
|
|
38
|
+
) VALUES (?, ?, ?, ?, ?, 1, ?)
|
|
39
|
+
ON CONFLICT(connection_id) DO UPDATE SET
|
|
40
|
+
scan_enabled = excluded.scan_enabled,
|
|
41
|
+
proactive_enabled = excluded.proactive_enabled,
|
|
42
|
+
interval_minutes = excluded.interval_minutes,
|
|
43
|
+
allowed_scenario_keys_json = excluded.allowed_scenario_keys_json,
|
|
44
|
+
revision = connector_sync_policies.revision + 1,
|
|
45
|
+
updated_at = excluded.updated_at`).run(input.connectionId, input.scanEnabled ?? current?.scanEnabled ?? true ? 1 : 0, input.proactiveEnabled ?? current?.proactiveEnabled ?? false ? 1 : 0, intervalMinutes, JSON.stringify(allowedScenarioKeys), now);
|
|
46
|
+
});
|
|
47
|
+
return getConnectorSyncPolicy(input.connectionId);
|
|
48
|
+
}
|
|
49
|
+
//#endregion
|
|
50
|
+
export { getConnectorSyncPolicy, listConnectorSyncPolicies, upsertConnectorSyncPolicy };
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type ExecutionFailureCode, type ExecutionFailurePhase, type ExecutionRecoveryAction, type ExecutionVerification } from '../../agent/outcomes/execution-verifier.js';
|
|
2
|
+
export type ExecutionReceiptStatus = 'running' | 'succeeded' | 'failed' | 'cancelled';
|
|
3
|
+
export type ExecutionFeedbackOutcome = 'helpful' | 'not_helpful';
|
|
4
|
+
export type ExecutionVerdict = 'achieved' | 'partial' | 'not_achieved';
|
|
5
|
+
export type ExecutionReceiptOrigin = 'chat' | 'goal' | 'workflow' | 'automation' | 'browser' | 'proactive';
|
|
6
|
+
export type ExecutionReceiptTrigger = 'user' | 'schedule' | 'webhook' | 'proactive' | 'retry';
|
|
7
|
+
export interface ExecutionReceiptContext {
|
|
8
|
+
outcomeId?: string;
|
|
9
|
+
projectId?: string;
|
|
10
|
+
goalId?: string;
|
|
11
|
+
workItemId?: string;
|
|
12
|
+
origin?: ExecutionReceiptOrigin;
|
|
13
|
+
triggerKind?: ExecutionReceiptTrigger;
|
|
14
|
+
parentRunId?: string;
|
|
15
|
+
contextTraceId?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ExecutionContract {
|
|
18
|
+
objective: string;
|
|
19
|
+
deliverables: string[];
|
|
20
|
+
acceptanceCriteria: string[];
|
|
21
|
+
constraints: string[];
|
|
22
|
+
approvalRequired: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface ExecutionEvidence {
|
|
25
|
+
kind: 'artifact' | 'test' | 'state' | 'source';
|
|
26
|
+
title: string;
|
|
27
|
+
summary: string;
|
|
28
|
+
uri?: string;
|
|
29
|
+
verifies?: string[];
|
|
30
|
+
}
|
|
31
|
+
export interface ExecutionReceipt {
|
|
32
|
+
runId: string;
|
|
33
|
+
sessionKey: string;
|
|
34
|
+
channel: string;
|
|
35
|
+
objective: string;
|
|
36
|
+
status: ExecutionReceiptStatus;
|
|
37
|
+
summary?: string;
|
|
38
|
+
contract?: ExecutionContract;
|
|
39
|
+
contractVersion?: number;
|
|
40
|
+
attempt: number;
|
|
41
|
+
strategy?: string;
|
|
42
|
+
evidence: ExecutionEvidence[];
|
|
43
|
+
verification: ExecutionVerification;
|
|
44
|
+
context: ExecutionReceiptContext;
|
|
45
|
+
nextAction?: string;
|
|
46
|
+
needsUser: boolean;
|
|
47
|
+
completionVerdict?: ExecutionVerdict;
|
|
48
|
+
completionVerdictSource?: 'system' | 'user';
|
|
49
|
+
correctionText?: string;
|
|
50
|
+
projectionVersion: number;
|
|
51
|
+
projectedAt?: number;
|
|
52
|
+
failure?: {
|
|
53
|
+
code: ExecutionFailureCode;
|
|
54
|
+
phase: ExecutionFailurePhase;
|
|
55
|
+
recoveryAction: ExecutionRecoveryAction;
|
|
56
|
+
};
|
|
57
|
+
feedback?: {
|
|
58
|
+
outcome: ExecutionFeedbackOutcome;
|
|
59
|
+
reason?: string;
|
|
60
|
+
needsCorrection?: boolean;
|
|
61
|
+
supportFit?: boolean;
|
|
62
|
+
};
|
|
63
|
+
startedAt: number;
|
|
64
|
+
completedAt?: number;
|
|
65
|
+
updatedAt: number;
|
|
66
|
+
}
|
|
67
|
+
export interface ExecutionReceiptMetrics {
|
|
68
|
+
total: number;
|
|
69
|
+
completed: number;
|
|
70
|
+
succeeded: number;
|
|
71
|
+
verified: number;
|
|
72
|
+
helpful: number;
|
|
73
|
+
notHelpful: number;
|
|
74
|
+
completionRate: number;
|
|
75
|
+
successRate: number;
|
|
76
|
+
verificationRate: number;
|
|
77
|
+
helpfulRate: number;
|
|
78
|
+
}
|
|
79
|
+
export declare function startExecutionReceipt(input: {
|
|
80
|
+
runId: string;
|
|
81
|
+
sessionKey: string;
|
|
82
|
+
channel: string;
|
|
83
|
+
objective: string;
|
|
84
|
+
context?: ExecutionReceiptContext;
|
|
85
|
+
contract?: ExecutionContract;
|
|
86
|
+
contractVersion?: number;
|
|
87
|
+
attempt?: number;
|
|
88
|
+
strategy?: string;
|
|
89
|
+
now?: number;
|
|
90
|
+
}): ExecutionReceipt;
|
|
91
|
+
export declare function completeExecutionReceipt(input: {
|
|
92
|
+
runId: string;
|
|
93
|
+
status: Exclude<ExecutionReceiptStatus, 'running'>;
|
|
94
|
+
summary: string;
|
|
95
|
+
now?: number;
|
|
96
|
+
}): ExecutionReceipt | undefined;
|
|
97
|
+
export declare function setExecutionVerdict(input: {
|
|
98
|
+
runId: string;
|
|
99
|
+
verdict: ExecutionVerdict;
|
|
100
|
+
correctionText?: string;
|
|
101
|
+
now?: number;
|
|
102
|
+
}): ExecutionReceipt | undefined;
|
|
103
|
+
export declare function markExecutionReceiptProjected(input: {
|
|
104
|
+
runId: string;
|
|
105
|
+
projectionVersion: number;
|
|
106
|
+
now?: number;
|
|
107
|
+
}): ExecutionReceipt | undefined;
|
|
108
|
+
export declare function listUnprojectedExecutionReceipts(input: {
|
|
109
|
+
projectionVersion: number;
|
|
110
|
+
limit?: number;
|
|
111
|
+
}): ExecutionReceipt[];
|
|
112
|
+
export declare function updateExecutionReceipt(input: {
|
|
113
|
+
runId: string;
|
|
114
|
+
contract?: ExecutionContract;
|
|
115
|
+
evidence?: ExecutionEvidence[];
|
|
116
|
+
summary?: string;
|
|
117
|
+
nextAction?: string | null;
|
|
118
|
+
needsUser?: boolean;
|
|
119
|
+
contextTraceId?: string | null;
|
|
120
|
+
now?: number;
|
|
121
|
+
}): ExecutionReceipt | undefined;
|
|
122
|
+
type ExecutionReceiptFeedbackInput = {
|
|
123
|
+
outcome: ExecutionFeedbackOutcome;
|
|
124
|
+
reason?: string;
|
|
125
|
+
needsCorrection?: boolean;
|
|
126
|
+
supportFit?: boolean;
|
|
127
|
+
now?: number;
|
|
128
|
+
};
|
|
129
|
+
export declare function setExecutionReceiptFeedback(input: ExecutionReceiptFeedbackInput & {
|
|
130
|
+
sessionKey: string;
|
|
131
|
+
assistantTimestamp: number;
|
|
132
|
+
}): ExecutionReceipt | undefined;
|
|
133
|
+
export declare function setExecutionReceiptFeedbackByRunId(input: ExecutionReceiptFeedbackInput & {
|
|
134
|
+
runId: string;
|
|
135
|
+
}): ExecutionReceipt | undefined;
|
|
136
|
+
export declare function getExecutionReceipt(runId: string): ExecutionReceipt | undefined;
|
|
137
|
+
export declare function findExecutionReceiptForAssistant(sessionKey: string, assistantTimestamp: number): ExecutionReceipt | undefined;
|
|
138
|
+
export declare function listExecutionReceipts(input?: {
|
|
139
|
+
outcomeId?: string;
|
|
140
|
+
sessionKey?: string;
|
|
141
|
+
projectId?: string;
|
|
142
|
+
workItemId?: string;
|
|
143
|
+
limit?: number;
|
|
144
|
+
}): ExecutionReceipt[];
|
|
145
|
+
export declare function summarizeExecutionReceipts(): ExecutionReceiptMetrics;
|
|
146
|
+
export {};
|