@xopcai/xopc 0.0.178 → 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-BzGX__8I.js → activity-store-A5FUMjeV.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-BzxntcaZ.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-hi6f2Xtp.js → api-Bmzslx0Z.js} +1 -1
- package/dist/gateway/static/root/assets/{app-management-settings-panel-fTY1F7ac.js → app-management-settings-panel-DDWS_BBJ.js} +1 -1
- package/dist/gateway/static/root/assets/{appearance-settings-BZ-IxQfB.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-ZSLLG8wB.js → archive-plugin-fvTZhPUr.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-D4YktqIF.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-BIkPxfxj.js → binary-plugins-CuI2bOc7.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-Q3v_YQom.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-M5lTEW1I.js → browser-workflow-inputs-gs6b5e9-.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-B3T1KYk4.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-DE09c0VB.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-CFR5FBfS.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-B1mD-3pM.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-BYQJ2XUS.js → directory-picker-path-field-B6fc_7SL.js} +1 -1
- package/dist/gateway/static/root/assets/{dreaming-settings-BXcb8fwx.js → dreaming-settings-CUQxGnDf.js} +3 -3
- package/dist/gateway/static/root/assets/{extension-debug-page-O1Xu1r4Q.js → extension-debug-page-AbRNi2ON.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-C2Jraq8l.js → extension-page-ClYfiLXC.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-settings-page-DcXQDTpG.js → extension-settings-page-BGVP2hw1.js} +1 -1
- package/dist/gateway/static/root/assets/{gateway-config-api-DmPIZrvg.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-BZEkOdPm.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-BtKu2NWT.js → heartbeat-settings-CTI2nPKa.js} +1 -1
- package/dist/gateway/static/root/assets/{image-generation-api-05Gg8wsU.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-CfmDR9Sc.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-Df8BW1A_.js → local-apps-page-CF5uUd1n.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CTwSy7yW.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-B3FvKbaP.js → markdown-split-CN85EdB8.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-DsjrvvB6.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-tuzIwy3c.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-ke9s4nYi.js → page-tabs-tQNQcAts.js} +1 -1
- package/dist/gateway/static/root/assets/{preview-open-alternatives-Cp1eI4S9.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-dXQCMAtH.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-Bl30zjHc.js → save-bar-controls-BsPf5Gkk.js} +1 -1
- package/dist/gateway/static/root/assets/{schedule-field-DqhmXQKo.js → schedule-field-kAytH7mq.js} +1 -1
- package/dist/gateway/static/root/assets/{schema-form-DkUCy6vf.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-C6ZbNpdy.js → settings-form-section-BqbibcnJ.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-loading-skeleton-Bk58_cr7.js → settings-loading-skeleton-DNLNCEGT.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-k8iE_NdX.js → settings-page-BR6Ss0bK.js} +1 -1
- package/dist/gateway/static/root/assets/{settings-page-layout-DgFSya2e.js → settings-page-layout-Cdb1e2Cz.js} +1 -1
- package/dist/gateway/static/root/assets/{setup-status-panel-B_KDlyZA.js → setup-status-panel-moT-D-ia.js} +1 -1
- package/dist/gateway/static/root/assets/{share-preview-page-CV7nL_J9.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-kahBIHg0.js → skills-page.utils-BG5dGkyA.js} +1 -1
- package/dist/gateway/static/root/assets/{system-settings-panel-JV3-MG5F.js → system-settings-panel-XdY8eyYf.js} +1 -1
- package/dist/gateway/static/root/assets/{theme-store-DFLyzoLO.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-60Aqo-UJ.js → typed-models-lib-DOnpwsrE.js} +1 -1
- package/dist/gateway/static/root/assets/{use-channel-catalog-CnTkHDnw.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-CNa8qUgS.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-yV_x595t.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/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/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 +1 -1
- 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/heartbeat/service.js +1 -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/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/heartbeat/index.js +1 -1
- 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/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 +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
|
@@ -97,8 +97,17 @@ function resolveSessionKey(getSessionKey) {
|
|
|
97
97
|
function createTodoTool(options) {
|
|
98
98
|
const getSessionKey = options?.getSessionKey ?? (() => "default");
|
|
99
99
|
const stores = /* @__PURE__ */ new Map();
|
|
100
|
-
const
|
|
101
|
-
const
|
|
100
|
+
const activeRepository = () => {
|
|
101
|
+
const repository = options?.repository;
|
|
102
|
+
return repository && (repository.isAvailable?.() ?? true) ? repository : void 0;
|
|
103
|
+
};
|
|
104
|
+
const getStore = (key) => {
|
|
105
|
+
const repository = activeRepository();
|
|
106
|
+
if (repository) {
|
|
107
|
+
const store = new TodoStore();
|
|
108
|
+
store.write(repository.read(key), false);
|
|
109
|
+
return store;
|
|
110
|
+
}
|
|
102
111
|
let s = stores.get(key);
|
|
103
112
|
if (!s) {
|
|
104
113
|
s = new TodoStore();
|
|
@@ -112,8 +121,10 @@ function createTodoTool(options) {
|
|
|
112
121
|
description: "Plan and track tasks for complex multi-step work.\n\nUSAGE:\n- Provide `todos` array to write/update tasks\n- Omit `todos` to read the current list\n- Set `merge: true` to update existing items by id without replacing the whole list\n- Each item needs: id (unique string), content (task description), status\n- Valid statuses: pending, in_progress, completed, cancelled\n\nWHEN TO USE:\n- At the start of complex tasks (3+ steps) to plan your approach\n- After completing each step to update progress\n- When the user asks about progress or remaining work\n\nBEST PRACTICES:\n- Keep only one item in_progress at a time\n- Use merge=true to update status without rewriting the whole list\n- Create concrete, actionable items (not vague goals)",
|
|
113
122
|
parameters: TodoSchema,
|
|
114
123
|
async execute(_toolCallId, params, _signal) {
|
|
115
|
-
|
|
124
|
+
let store;
|
|
116
125
|
try {
|
|
126
|
+
const key = resolveSessionKey(getSessionKey);
|
|
127
|
+
store = getStore(key);
|
|
117
128
|
if (params.todos === void 0) {
|
|
118
129
|
const items = store.read();
|
|
119
130
|
return {
|
|
@@ -126,6 +137,7 @@ function createTodoTool(options) {
|
|
|
126
137
|
}
|
|
127
138
|
const p = params;
|
|
128
139
|
const items = store.write(p.todos, p.merge ?? false);
|
|
140
|
+
activeRepository()?.write(key, items);
|
|
129
141
|
return {
|
|
130
142
|
content: [{
|
|
131
143
|
type: "text",
|
|
@@ -139,7 +151,7 @@ function createTodoTool(options) {
|
|
|
139
151
|
type: "text",
|
|
140
152
|
text: `Error: ${error instanceof Error ? error.message : String(error)}`
|
|
141
153
|
}],
|
|
142
|
-
details: { items: store
|
|
154
|
+
details: { items: store?.read() ?? [] }
|
|
143
155
|
};
|
|
144
156
|
}
|
|
145
157
|
}
|
|
@@ -6,6 +6,10 @@ const VALID_STATUSES = new Set([
|
|
|
6
6
|
"completed"
|
|
7
7
|
]);
|
|
8
8
|
const PlanStepSchema = Type.Object({
|
|
9
|
+
id: Type.Optional(Type.String({
|
|
10
|
+
minLength: 1,
|
|
11
|
+
description: "Stable identifier for this step"
|
|
12
|
+
})),
|
|
9
13
|
step: Type.String({
|
|
10
14
|
minLength: 1,
|
|
11
15
|
description: "Short task step"
|
|
@@ -28,11 +32,13 @@ function normalizePlan(raw) {
|
|
|
28
32
|
if (!Array.isArray(raw)) throw new Error("plan must be an array");
|
|
29
33
|
const plan = raw.map((item) => {
|
|
30
34
|
const rec = item && typeof item === "object" ? item : {};
|
|
35
|
+
const id = typeof rec.id === "string" && rec.id.trim() ? rec.id.trim() : void 0;
|
|
31
36
|
const step = String(rec.step ?? "").trim();
|
|
32
37
|
const statusRaw = String(rec.status ?? "").trim();
|
|
33
38
|
if (!step) throw new Error("each plan item must include a non-empty step");
|
|
34
39
|
if (!VALID_STATUSES.has(statusRaw)) throw new Error(`invalid plan status: ${statusRaw || "(empty)"}`);
|
|
35
40
|
return {
|
|
41
|
+
...id ? { id } : {},
|
|
36
42
|
step,
|
|
37
43
|
status: statusRaw
|
|
38
44
|
};
|
|
@@ -11,9 +11,9 @@ import { createReadStream, createWriteStream } from "node:fs";
|
|
|
11
11
|
import { spawn } from "node:child_process";
|
|
12
12
|
import { createHash } from "node:crypto";
|
|
13
13
|
import { mkdir, mkdtemp, rm, stat } from "node:fs/promises";
|
|
14
|
-
import AdmZip from "adm-zip";
|
|
15
|
-
import { Readable, Transform } from "node:stream";
|
|
16
14
|
import { pipeline } from "node:stream/promises";
|
|
15
|
+
import { Readable, Transform } from "node:stream";
|
|
16
|
+
import AdmZip from "adm-zip";
|
|
17
17
|
//#region src/browser/providers/cloakbrowser.ts
|
|
18
18
|
/**
|
|
19
19
|
* CloakBrowser provider — anti-fingerprint Chromium with stealth capabilities.
|
|
@@ -3,9 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { STTConfig } from '../../voice/stt/types.js';
|
|
5
5
|
import { type InboundAttachmentInput, type MediaRef } from './inbound-persist.js';
|
|
6
|
-
export declare function mergeSttConfigFromAppConfig(stt: Partial<STTConfig> | undefined, toolsMedia?: {
|
|
7
|
-
models?: STTConfig['sharedModels'];
|
|
8
|
-
}): STTConfig;
|
|
9
6
|
export declare function isVoiceLikeAttachment(att: InboundAttachmentInput | MediaRef): boolean;
|
|
10
7
|
export declare function mergeVoiceTranscriptsIntoUserText(prepared: (InboundAttachmentInput | MediaRef)[] | undefined, userText: string, sttConfig: STTConfig, opts?: {
|
|
11
8
|
skipVoiceTranscription?: boolean;
|
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
import { decodeInboundAttachmentBase64, readInboundAttachmentBuffer } from "./inbound-persist.js";
|
|
2
|
-
import { DEFAULT_STT_CONFIG } from "../../voice/stt/types.js";
|
|
3
2
|
import { transcribe } from "../../voice/stt/transcribe-core.js";
|
|
4
3
|
import { isSTTAvailable } from "../../voice/stt/availability.js";
|
|
5
4
|
import "../../voice/stt/index.js";
|
|
6
5
|
//#region src/channels/attachments/voice-stt-webchat.ts
|
|
7
6
|
const STT_MAX_BYTES = 25 * 1024 * 1024;
|
|
8
|
-
function mergeSttProviders(base, patch) {
|
|
9
|
-
if (!base && !patch) return void 0;
|
|
10
|
-
const merged = { ...base ?? {} };
|
|
11
|
-
for (const [id, slice] of Object.entries(patch ?? {})) merged[id] = {
|
|
12
|
-
...merged[id] ?? {},
|
|
13
|
-
...slice
|
|
14
|
-
};
|
|
15
|
-
return merged;
|
|
16
|
-
}
|
|
17
|
-
function mergeSttConfigFromAppConfig(stt, toolsMedia) {
|
|
18
|
-
const p = stt ?? {};
|
|
19
|
-
return {
|
|
20
|
-
...DEFAULT_STT_CONFIG,
|
|
21
|
-
...p,
|
|
22
|
-
providers: mergeSttProviders(DEFAULT_STT_CONFIG.providers, p.providers),
|
|
23
|
-
fallback: {
|
|
24
|
-
...DEFAULT_STT_CONFIG.fallback,
|
|
25
|
-
...p.fallback
|
|
26
|
-
},
|
|
27
|
-
...toolsMedia?.models?.length ? { sharedModels: toolsMedia.models } : {}
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
7
|
function isVoiceLikeAttachment(att) {
|
|
31
8
|
if (att.type === "voice") return true;
|
|
32
9
|
return (att.mimeType?.toLowerCase() ?? "").startsWith("audio/");
|
|
@@ -88,4 +65,4 @@ async function mergeVoiceTranscriptsIntoUserText(prepared, userText, sttConfig,
|
|
|
88
65
|
};
|
|
89
66
|
}
|
|
90
67
|
//#endregion
|
|
91
|
-
export { isVoiceLikeAttachment,
|
|
68
|
+
export { isVoiceLikeAttachment, mergeVoiceTranscriptsIntoUserText };
|
|
@@ -3,6 +3,8 @@ import "../../storage/sqlite/index.js";
|
|
|
3
3
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
4
4
|
import { GoalService } from "../../goals/goal-service.js";
|
|
5
5
|
import "../../goals/index.js";
|
|
6
|
+
import { OutcomeExecutionService } from "../../work/outcome-execution-service.js";
|
|
7
|
+
import "../../work/index.js";
|
|
6
8
|
import { commandRegistry } from "../registry.js";
|
|
7
9
|
//#region src/chat-commands/builtins/goal.ts
|
|
8
10
|
init_resolve_route();
|
|
@@ -98,14 +100,13 @@ const goalCommand = {
|
|
|
98
100
|
content: "Agent is running — use /goal status / pause / clear mid-run, or wait for the current turn to finish before setting a new goal.",
|
|
99
101
|
success: false
|
|
100
102
|
};
|
|
101
|
-
const goal =
|
|
102
|
-
|
|
103
|
+
const goal = new OutcomeExecutionService().create({
|
|
104
|
+
objective: t,
|
|
103
105
|
sessionKey: ctx.sessionKey,
|
|
104
106
|
agentId: getDefaultAgentId(ctx.config),
|
|
105
|
-
config: ctx.config,
|
|
106
107
|
source: ctx.source === "cli" ? "cli" : ctx.source === "api" ? "api" : "channel",
|
|
107
108
|
projectId: getSessionMetadata(ctx.sessionKey)?.projectId
|
|
108
|
-
});
|
|
109
|
+
}).goal;
|
|
109
110
|
ctx.persistentGoalApis?.scheduleContinuation(ctx.sessionKey, goal.title);
|
|
110
111
|
return {
|
|
111
112
|
content: `⊙ Goal set (${goal.maxTurns}-turn budget): ${goal.title}\nI'll keep working until the goal is done, you pause/archive it, or the budget is exhausted.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { init_agent_scope, listAgentEntries, normalizeAgentId, resolveAgentDir, resolveAgentProfileDir, resolveAgentWorkspaceDir, resolveDefaultAgentId, validateAgentIdForNewAgent } from "../../agent/agent-scope.js";
|
|
2
2
|
import { init_paths, resolveConfigPath } from "../../config/paths.js";
|
|
3
3
|
import { init_loader, loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
|
-
import { applyAgentConfig, findAgentEntryIndex, getAgentDeleteBlocker, pruneAgentConfig, removeAgentDirsFromDisk } from "../../commands/agents.config.js";
|
|
5
4
|
import { seedAgentProfileMarkdownFiles } from "../../agent/context/workspace-seed.js";
|
|
5
|
+
import { applyAgentConfig, findAgentEntryIndex, getAgentDeleteBlocker, pruneAgentConfig, removeAgentDirsFromDisk } from "../../commands/agents.config.js";
|
|
6
6
|
import { colors } from "../utils/colors.js";
|
|
7
7
|
import { mkdir } from "node:fs/promises";
|
|
8
8
|
//#region src/cli/commands/agents.ts
|
|
@@ -52,7 +52,7 @@ async function checkDatabaseSchema(ctx) {
|
|
|
52
52
|
id: "database-schema",
|
|
53
53
|
label: "Database schema",
|
|
54
54
|
status: "pass",
|
|
55
|
-
message: `SQLite schema v${status.dbVersion} (current release
|
|
55
|
+
message: `SQLite schema v${status.dbVersion} (current release v87).`,
|
|
56
56
|
hints: []
|
|
57
57
|
};
|
|
58
58
|
}
|
|
@@ -3,9 +3,11 @@ import "../../storage/sqlite/index.js";
|
|
|
3
3
|
import { init_loader, loadConfig } from "../../config/loader.js";
|
|
4
4
|
import { GoalService } from "../../goals/goal-service.js";
|
|
5
5
|
import "../../goals/index.js";
|
|
6
|
+
import { OutcomeExecutionService } from "../../work/outcome-execution-service.js";
|
|
6
7
|
import { ProjectService } from "../../projects/project-service.js";
|
|
7
8
|
import { resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
8
9
|
import "../../projects/index.js";
|
|
10
|
+
import "../../work/index.js";
|
|
9
11
|
import { formatExamples, register } from "../registry.js";
|
|
10
12
|
import { Command } from "commander";
|
|
11
13
|
//#region src/cli/commands/goal.ts
|
|
@@ -81,7 +83,7 @@ function createGoalCommand(ctx) {
|
|
|
81
83
|
}));
|
|
82
84
|
cmd.addCommand(new Command("new").description("Create a goal").argument("<title>", "Goal title").option("--session-key <key>", "Link to a session key").option("--agent-id <id>", "Agent id").option("--max-turns <n>", "Turn budget").option("--priority <level>", "low, normal, or high", "normal").option("--project <id-or-slug>", "Attach the goal to a project").action(async (title, options) => {
|
|
83
85
|
const cfg = loadConfig(ctx.configPath);
|
|
84
|
-
await withGoals(ctx, async (
|
|
86
|
+
await withGoals(ctx, async (_goals) => {
|
|
85
87
|
const projectId = resolveProjectId(options.project);
|
|
86
88
|
const agentId = options.sessionKey && !options.agentId ? void 0 : resolveProjectAgentId({
|
|
87
89
|
config: cfg,
|
|
@@ -89,16 +91,15 @@ function createGoalCommand(ctx) {
|
|
|
89
91
|
explicitAgentId: options.agentId,
|
|
90
92
|
projectId
|
|
91
93
|
});
|
|
92
|
-
const goal =
|
|
93
|
-
title,
|
|
94
|
+
const goal = new OutcomeExecutionService().create({
|
|
95
|
+
objective: title,
|
|
94
96
|
sessionKey: options.sessionKey,
|
|
95
97
|
agentId,
|
|
96
98
|
priority: options.priority === "low" || options.priority === "high" ? options.priority : "normal",
|
|
97
99
|
maxTurns: options.maxTurns ? Number(options.maxTurns) : void 0,
|
|
98
|
-
config: cfg,
|
|
99
100
|
source: "cli",
|
|
100
101
|
projectId
|
|
101
|
-
});
|
|
102
|
+
}).goal;
|
|
102
103
|
console.log(`Created goal ${goal.id}`);
|
|
103
104
|
console.log(` ${goal.title}`);
|
|
104
105
|
});
|
|
@@ -3,15 +3,15 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
4
4
|
import { resolveGatewayEffectiveHost } from "../../config/gateway-bind.js";
|
|
5
5
|
import { loadTunnelState } from "../../tunnel/tunnel-state.js";
|
|
6
|
-
import { formatExamples, register } from "../registry.js";
|
|
7
|
-
import "../../config/index.js";
|
|
8
6
|
import { TUNNEL_RISK_SUMMARY_LINES, TunnelConsentError, assertTunnelMayStart, hasValidTunnelConsent } from "../../tunnel/consent.js";
|
|
9
7
|
import { resolveTunnelBrokerUrl, resolveTunnelRegistrationSecret } from "../../tunnel/env.js";
|
|
8
|
+
import { applyTunnelConsentToConfig, mergeTunnelConfigPatch, setTunnelEnabledInConfig } from "../../tunnel/tunnel-config.js";
|
|
10
9
|
import { ensureFrpcBinary } from "../../tunnel/frpc-binary.js";
|
|
11
10
|
import { getTunnelService } from "../../tunnel/tunnel-service.js";
|
|
12
11
|
import { resolveFrpSubdomainHost } from "../../tunnel/frp-subdomain-host.js";
|
|
13
|
-
import { applyTunnelConsentToConfig, mergeTunnelConfigPatch, setTunnelEnabledInConfig } from "../../tunnel/tunnel-config.js";
|
|
14
12
|
import "../../tunnel/index.js";
|
|
13
|
+
import { formatExamples, register } from "../registry.js";
|
|
14
|
+
import "../../config/index.js";
|
|
15
15
|
import { Command } from "commander";
|
|
16
16
|
//#region src/cli/commands/tunnel.ts
|
|
17
17
|
init_logger();
|
|
@@ -3,6 +3,7 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { claimNextConnectorLearningJob, enqueueConnectorLearningJob, listConnectorLearningJobs, recoverStaleConnectorLearningJobs, setConnectorLearningPaused, updateConnectorLearningJob } from "../storage/sqlite/connector-learning-repository.js";
|
|
4
4
|
import { pruneBoundedKnowledgeSourceItems } from "../storage/sqlite/knowledge-repository.js";
|
|
5
5
|
import { getConnectorInstallation, listConnectorConnections, upsertConnectorConnection } from "../storage/sqlite/connector-repository.js";
|
|
6
|
+
import { getConnectorSyncPolicy } from "../storage/sqlite/connector-sync-policy-repository.js";
|
|
6
7
|
import "../storage/sqlite/index.js";
|
|
7
8
|
import { ComposioSessionsAdapter } from "./composio-sessions.js";
|
|
8
9
|
import { getConnectorDefinition } from "./catalog.js";
|
|
@@ -34,6 +35,8 @@ function startConnectorLearningCoordinator(options) {
|
|
|
34
35
|
if (!learningEnabled(options.getConfig())) return null;
|
|
35
36
|
const connection = listConnectorConnections().find((item) => item.id === connectionId && item.status === "active");
|
|
36
37
|
if (!connection) return null;
|
|
38
|
+
const syncPolicy = getConnectorSyncPolicy(connection.id);
|
|
39
|
+
if (request.reason !== "manual" && syncPolicy?.scanEnabled === false) return null;
|
|
37
40
|
const definition = getConnectorDefinition(connection.connectorId);
|
|
38
41
|
if (definition?.runtime.type !== "composio" || definition.runtime.role !== "toolkit") return null;
|
|
39
42
|
if (!getConnectorLearningPlan(definition.runtime.toolkit)) return null;
|
|
@@ -141,7 +144,10 @@ function startConnectorLearningCoordinator(options) {
|
|
|
141
144
|
finished: true
|
|
142
145
|
}));
|
|
143
146
|
pruneBoundedKnowledgeSourceItems(job.sourceInstanceId, Date.now() - plan.bootstrapWindowDays * 24 * 60 * 6e4);
|
|
144
|
-
const
|
|
147
|
+
const syncPolicy = getConnectorSyncPolicy(job.connectionId);
|
|
148
|
+
if (syncPolicy?.scanEnabled === false) return;
|
|
149
|
+
const intervalMinutes = syncPolicy?.intervalMinutes ?? plan.intervalMinutes;
|
|
150
|
+
const nextRunAt = Date.now() + intervalMinutes * 6e4;
|
|
145
151
|
enqueueConnection(job.connectionId, {
|
|
146
152
|
mode: "incremental",
|
|
147
153
|
reason: "schedule",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ProactiveEventService } from '../proactive/service.js';
|
|
2
|
+
export type SourceChangePublishResult = {
|
|
3
|
+
published: number;
|
|
4
|
+
skipped: number;
|
|
5
|
+
sources: number;
|
|
6
|
+
};
|
|
7
|
+
export declare class ConnectedSourceChangePublisher {
|
|
8
|
+
private readonly eventService;
|
|
9
|
+
private readonly intervalMs;
|
|
10
|
+
private timer;
|
|
11
|
+
private running;
|
|
12
|
+
constructor(eventService: ProactiveEventService, intervalMs?: number);
|
|
13
|
+
start(): void;
|
|
14
|
+
stop(): void;
|
|
15
|
+
runNow(): Promise<SourceChangePublishResult>;
|
|
16
|
+
private publishSource;
|
|
17
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { createLogger } from "../utils/logger/index.js";
|
|
2
|
+
import { init_logger } from "../utils/logger.js";
|
|
3
|
+
import { getKnowledgeConsumerWatermark, getKnowledgeSourceItem, listKnowledgeSourceChanges, setKnowledgeConsumerWatermark } from "../storage/sqlite/knowledge-repository.js";
|
|
4
|
+
import { listConnectorConnections } from "../storage/sqlite/connector-repository.js";
|
|
5
|
+
import { getConnectorSyncPolicy } from "../storage/sqlite/connector-sync-policy-repository.js";
|
|
6
|
+
//#region src/connectors/source-change-publisher.ts
|
|
7
|
+
init_logger();
|
|
8
|
+
const log = createLogger("Connector:SourceChanges");
|
|
9
|
+
const CONSUMER_ID = "proactive-connected-source-v1";
|
|
10
|
+
function sensitivity(value) {
|
|
11
|
+
if (value === "regulated") return "restricted";
|
|
12
|
+
if (value === "secret") return "confidential";
|
|
13
|
+
return "personal";
|
|
14
|
+
}
|
|
15
|
+
function metadataString(metadata, key) {
|
|
16
|
+
const value = metadata[key];
|
|
17
|
+
return typeof value === "string" && value.trim() ? value : void 0;
|
|
18
|
+
}
|
|
19
|
+
var ConnectedSourceChangePublisher = class {
|
|
20
|
+
timer = null;
|
|
21
|
+
running = false;
|
|
22
|
+
constructor(eventService, intervalMs = 1e4) {
|
|
23
|
+
this.eventService = eventService;
|
|
24
|
+
this.intervalMs = intervalMs;
|
|
25
|
+
}
|
|
26
|
+
start() {
|
|
27
|
+
if (this.timer) return;
|
|
28
|
+
this.runNow();
|
|
29
|
+
this.timer = setInterval(() => void this.runNow(), Math.max(2e3, this.intervalMs));
|
|
30
|
+
this.timer.unref?.();
|
|
31
|
+
}
|
|
32
|
+
stop() {
|
|
33
|
+
if (this.timer) clearInterval(this.timer);
|
|
34
|
+
this.timer = null;
|
|
35
|
+
}
|
|
36
|
+
async runNow() {
|
|
37
|
+
if (this.running) return {
|
|
38
|
+
published: 0,
|
|
39
|
+
skipped: 0,
|
|
40
|
+
sources: 0
|
|
41
|
+
};
|
|
42
|
+
this.running = true;
|
|
43
|
+
const total = {
|
|
44
|
+
published: 0,
|
|
45
|
+
skipped: 0,
|
|
46
|
+
sources: 0
|
|
47
|
+
};
|
|
48
|
+
try {
|
|
49
|
+
const connections = listConnectorConnections({ principalId: "local-owner" }).filter((connection) => connection.status === "active");
|
|
50
|
+
for (const connection of connections) {
|
|
51
|
+
const sourceInstanceId = `composio:${connection.connectorId}:${connection.id}`;
|
|
52
|
+
try {
|
|
53
|
+
const result = this.publishSource(sourceInstanceId, connection.id);
|
|
54
|
+
total.published += result.published;
|
|
55
|
+
total.skipped += result.skipped;
|
|
56
|
+
total.sources += 1;
|
|
57
|
+
} catch (err) {
|
|
58
|
+
const em = err instanceof Error ? err.message : String(err);
|
|
59
|
+
log.warn({
|
|
60
|
+
err,
|
|
61
|
+
connectionId: connection.id,
|
|
62
|
+
sourceInstanceId
|
|
63
|
+
}, `Connected source change publication failed: ${em}`);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return total;
|
|
67
|
+
} finally {
|
|
68
|
+
this.running = false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
publishSource(sourceInstanceId, connectionId) {
|
|
72
|
+
const policy = getConnectorSyncPolicy(connectionId);
|
|
73
|
+
let watermark = getKnowledgeConsumerWatermark(CONSUMER_ID, sourceInstanceId);
|
|
74
|
+
const changes = listKnowledgeSourceChanges({
|
|
75
|
+
sourceInstanceId,
|
|
76
|
+
afterSequence: watermark,
|
|
77
|
+
limit: 250
|
|
78
|
+
});
|
|
79
|
+
let published = 0;
|
|
80
|
+
let skipped = 0;
|
|
81
|
+
for (const change of changes) {
|
|
82
|
+
const item = getKnowledgeSourceItem(change.sourceItemId);
|
|
83
|
+
if (!policy?.scanEnabled || !policy.proactiveEnabled || !item || item.sensitivity === "secret" || item.sensitivity === "regulated") {
|
|
84
|
+
skipped += 1;
|
|
85
|
+
watermark = change.sequence;
|
|
86
|
+
setKnowledgeConsumerWatermark(CONSUMER_ID, sourceInstanceId, watermark);
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
const workspaceId = metadataString(item.metadata, "workspaceId");
|
|
90
|
+
const connectorId = metadataString(item.metadata, "connectorId");
|
|
91
|
+
if (!workspaceId || !connectorId) {
|
|
92
|
+
skipped += 1;
|
|
93
|
+
watermark = change.sequence;
|
|
94
|
+
setKnowledgeConsumerWatermark(CONSUMER_ID, sourceInstanceId, watermark);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const eventType = change.kind === "added" ? "connected_source.item_created.v1" : change.kind === "deleted" ? "connected_source.item_deleted.v1" : "connected_source.item_updated.v1";
|
|
98
|
+
const agentId = metadataString(item.metadata, "agentId");
|
|
99
|
+
this.eventService.publish({
|
|
100
|
+
type: eventType,
|
|
101
|
+
schemaVersion: 1,
|
|
102
|
+
source: {
|
|
103
|
+
kind: "connector",
|
|
104
|
+
id: connectionId
|
|
105
|
+
},
|
|
106
|
+
subject: {
|
|
107
|
+
kind: "knowledge_source_item",
|
|
108
|
+
id: item.id
|
|
109
|
+
},
|
|
110
|
+
actor: {
|
|
111
|
+
kind: "integration",
|
|
112
|
+
id: connectorId
|
|
113
|
+
},
|
|
114
|
+
scope: {
|
|
115
|
+
workspaceId,
|
|
116
|
+
...agentId ? { agentId } : {}
|
|
117
|
+
},
|
|
118
|
+
occurredAt: item.sourceUpdatedAt ?? item.occurredAt ?? change.changedAt,
|
|
119
|
+
dedupeKey: `knowledge-change:${change.sequence}`,
|
|
120
|
+
sensitivity: sensitivity(item.sensitivity),
|
|
121
|
+
payload: {
|
|
122
|
+
sourceInstanceId,
|
|
123
|
+
sourceItemId: item.id,
|
|
124
|
+
collectionScope: item.collectionScope,
|
|
125
|
+
itemType: item.itemType,
|
|
126
|
+
changeKind: change.kind,
|
|
127
|
+
contentHash: item.contentHash
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
published += 1;
|
|
131
|
+
watermark = change.sequence;
|
|
132
|
+
setKnowledgeConsumerWatermark(CONSUMER_ID, sourceInstanceId, watermark);
|
|
133
|
+
}
|
|
134
|
+
if (published > 0) log.info({
|
|
135
|
+
connectionId,
|
|
136
|
+
sourceInstanceId,
|
|
137
|
+
published,
|
|
138
|
+
skipped
|
|
139
|
+
}, "Connected source changes published");
|
|
140
|
+
return {
|
|
141
|
+
published,
|
|
142
|
+
skipped,
|
|
143
|
+
sources: 1
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
//#endregion
|
|
148
|
+
export { ConnectedSourceChangePublisher };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { Config } from '../config/schema.js';
|
|
3
|
+
import type { DiscussionAnalysis } from './types.js';
|
|
4
|
+
declare const LiveEnrichmentSchema: z.ZodObject<{
|
|
5
|
+
title: z.ZodString;
|
|
6
|
+
projectCandidateId: z.ZodOptional<z.ZodString>;
|
|
7
|
+
projectConfidence: z.ZodOptional<z.ZodNumber>;
|
|
8
|
+
projectAlternativeConfidence: z.ZodOptional<z.ZodNumber>;
|
|
9
|
+
}, z.core.$strip>;
|
|
10
|
+
export declare function normalizeDiscussionAnalysis(value: unknown): DiscussionAnalysis;
|
|
11
|
+
export declare function analyzeDiscussion(input: {
|
|
12
|
+
config: Config;
|
|
13
|
+
transcript: string;
|
|
14
|
+
languageHint?: string;
|
|
15
|
+
projects?: Array<{
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
}>;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
}): Promise<{
|
|
21
|
+
analysis: DiscussionAnalysis;
|
|
22
|
+
modelRef: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function enrichLiveDiscussion(input: {
|
|
25
|
+
config: Config;
|
|
26
|
+
transcript: string;
|
|
27
|
+
projects: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
signal?: AbortSignal;
|
|
32
|
+
}): Promise<z.infer<typeof LiveEnrichmentSchema> & {
|
|
33
|
+
modelRef: string;
|
|
34
|
+
}>;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { getAgentDefaultModelRef, init_schema } from "../config/schema.js";
|
|
2
|
+
import { init_providers, resolveModel } from "../providers/index.js";
|
|
3
|
+
import { completeWithResolvedCredentials } from "../providers/model-call.js";
|
|
4
|
+
import { createHash } from "node:crypto";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
//#region src/discussions/analyzer.ts
|
|
7
|
+
init_schema();
|
|
8
|
+
init_providers();
|
|
9
|
+
const MAX_TRANSCRIPT_CHARS = 12e4;
|
|
10
|
+
const AnalysisSchema = z.object({
|
|
11
|
+
title: z.string().trim().min(1).max(200),
|
|
12
|
+
summary: z.string().trim().min(1).max(4e3),
|
|
13
|
+
keyPoints: z.array(z.string().trim().min(1).max(1e3)).max(12).default([]),
|
|
14
|
+
decisions: z.array(z.string().trim().min(1).max(1e3)).max(12).default([]),
|
|
15
|
+
actionItems: z.array(z.object({
|
|
16
|
+
id: z.string().trim().min(1).max(100).optional(),
|
|
17
|
+
title: z.string().trim().min(1).max(500),
|
|
18
|
+
owner: z.string().trim().min(1).max(200).optional(),
|
|
19
|
+
dueDate: z.string().trim().min(1).max(100).optional()
|
|
20
|
+
})).max(20).default([]),
|
|
21
|
+
risks: z.array(z.string().trim().min(1).max(1e3)).max(12).default([]),
|
|
22
|
+
openQuestions: z.array(z.string().trim().min(1).max(1e3)).max(12).default([]),
|
|
23
|
+
projectCandidateId: z.string().trim().min(1).max(200).optional(),
|
|
24
|
+
projectConfidence: z.number().min(0).max(1).optional(),
|
|
25
|
+
projectAlternativeConfidence: z.number().min(0).max(1).optional()
|
|
26
|
+
});
|
|
27
|
+
const LiveEnrichmentSchema = z.object({
|
|
28
|
+
title: z.string().trim().min(1).max(200),
|
|
29
|
+
projectCandidateId: z.string().trim().min(1).max(200).optional(),
|
|
30
|
+
projectConfidence: z.number().min(0).max(1).optional(),
|
|
31
|
+
projectAlternativeConfidence: z.number().min(0).max(1).optional()
|
|
32
|
+
});
|
|
33
|
+
function extractText(content) {
|
|
34
|
+
if (typeof content === "string") return content;
|
|
35
|
+
if (!Array.isArray(content)) return "";
|
|
36
|
+
return content.map((part) => {
|
|
37
|
+
if (!part || typeof part !== "object") return "";
|
|
38
|
+
const value = part;
|
|
39
|
+
return value.type === "text" && typeof value.text === "string" ? value.text : "";
|
|
40
|
+
}).join("");
|
|
41
|
+
}
|
|
42
|
+
function parseJsonObject(raw) {
|
|
43
|
+
const stripped = raw.trim().replace(/^```json\s*/i, "").replace(/```$/i, "").trim();
|
|
44
|
+
try {
|
|
45
|
+
return JSON.parse(stripped);
|
|
46
|
+
} catch {
|
|
47
|
+
const start = stripped.indexOf("{");
|
|
48
|
+
const end = stripped.lastIndexOf("}");
|
|
49
|
+
if (start < 0 || end <= start) throw new Error("Discussion analysis did not return valid JSON");
|
|
50
|
+
return JSON.parse(stripped.slice(start, end + 1));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function actionId(title, index) {
|
|
54
|
+
return createHash("sha256").update(`${index}:${title}`).digest("hex").slice(0, 16);
|
|
55
|
+
}
|
|
56
|
+
function normalizeDiscussionAnalysis(value) {
|
|
57
|
+
const parsed = AnalysisSchema.safeParse(value);
|
|
58
|
+
if (!parsed.success) throw new Error(`Invalid discussion analysis: ${parsed.error.issues[0]?.message ?? "schema mismatch"}`);
|
|
59
|
+
return {
|
|
60
|
+
...parsed.data,
|
|
61
|
+
actionItems: parsed.data.actionItems.map((item, index) => ({
|
|
62
|
+
id: item.id ?? actionId(item.title, index),
|
|
63
|
+
title: item.title,
|
|
64
|
+
...item.owner ? { owner: item.owner } : {},
|
|
65
|
+
...item.dueDate ? { dueDate: item.dueDate } : {}
|
|
66
|
+
}))
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
async function analyzeDiscussion(input) {
|
|
70
|
+
const modelRef = getAgentDefaultModelRef(input.config);
|
|
71
|
+
if (!modelRef) throw new Error("No default model configured for discussion analysis");
|
|
72
|
+
const transcript = input.transcript.trim().slice(0, MAX_TRANSCRIPT_CHARS);
|
|
73
|
+
if (!transcript) throw new Error("Discussion transcript is empty");
|
|
74
|
+
const message = {
|
|
75
|
+
role: "user",
|
|
76
|
+
content: [
|
|
77
|
+
"Analyze the supplied workplace discussion transcript.",
|
|
78
|
+
"Use only facts explicitly present in the transcript. Do not invent owners, dates, decisions, or commitments.",
|
|
79
|
+
"Return exactly one JSON object with: title, summary, keyPoints, decisions, actionItems, risks, openQuestions, and optional projectCandidateId, projectConfidence, and projectAlternativeConfidence.",
|
|
80
|
+
"title is a short concrete note title derived from the discussion.",
|
|
81
|
+
"actionItems contains title and optional owner and dueDate. Omit owner or dueDate when not explicit.",
|
|
82
|
+
"Keep unresolved possibilities in openQuestions, not decisions.",
|
|
83
|
+
input.projects?.length ? `Choose projectCandidateId only from this catalog when the discussion clearly belongs to it; otherwise omit it. projectConfidence is the top probability and projectAlternativeConfidence is the runner-up probability: ${JSON.stringify(input.projects.slice(0, 100))}` : "Omit projectCandidateId and projectConfidence.",
|
|
84
|
+
`Use ${input.languageHint === "en" ? "English" : input.languageHint === "zh" ? "Simplified Chinese" : "the main language of the transcript"} for every user-facing string.`,
|
|
85
|
+
"",
|
|
86
|
+
transcript
|
|
87
|
+
].join("\n"),
|
|
88
|
+
timestamp: Date.now()
|
|
89
|
+
};
|
|
90
|
+
return {
|
|
91
|
+
modelRef,
|
|
92
|
+
analysis: normalizeDiscussionAnalysis(parseJsonObject(extractText((await completeWithResolvedCredentials(resolveModel(modelRef), { messages: [message] }, {
|
|
93
|
+
maxTokens: 3e3,
|
|
94
|
+
temperature: .1,
|
|
95
|
+
signal: input.signal
|
|
96
|
+
})).content)))
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
async function enrichLiveDiscussion(input) {
|
|
100
|
+
const modelRef = getAgentDefaultModelRef(input.config);
|
|
101
|
+
if (!modelRef) throw new Error("No default model configured for discussion enrichment");
|
|
102
|
+
const transcript = input.transcript.trim().slice(0, 12e3);
|
|
103
|
+
if (!transcript) throw new Error("Discussion transcript is empty");
|
|
104
|
+
const message = {
|
|
105
|
+
role: "user",
|
|
106
|
+
content: [
|
|
107
|
+
"Create a short concrete note title for this partial workplace discussion transcript.",
|
|
108
|
+
"Return exactly one JSON object with title and optional projectCandidateId, projectConfidence, and projectAlternativeConfidence.",
|
|
109
|
+
"Choose a project only when the transcript clearly belongs to it. Never invent a project id.",
|
|
110
|
+
`Project catalog: ${JSON.stringify(input.projects.slice(0, 100))}`,
|
|
111
|
+
"",
|
|
112
|
+
transcript
|
|
113
|
+
].join("\n"),
|
|
114
|
+
timestamp: Date.now()
|
|
115
|
+
};
|
|
116
|
+
const response = await completeWithResolvedCredentials(resolveModel(modelRef), { messages: [message] }, {
|
|
117
|
+
maxTokens: 400,
|
|
118
|
+
temperature: .1,
|
|
119
|
+
signal: input.signal
|
|
120
|
+
});
|
|
121
|
+
return {
|
|
122
|
+
modelRef,
|
|
123
|
+
...LiveEnrichmentSchema.parse(parseJsonObject(extractText(response.content)))
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
//#endregion
|
|
127
|
+
export { analyzeDiscussion, enrichLiveDiscussion, normalizeDiscussionAnalysis };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { DISCUSSION_AUDIO_MAX_BYTES, DISCUSSION_MAX_DURATION_MS, DiscussionService, DiscussionServiceError, } from './service.js';
|
|
2
|
+
export { analyzeDiscussion } from './analyzer.js';
|
|
3
|
+
export { DiscussionPipeline, mergeDiscussionAnalysisIntoMarkdown } from './pipeline.js';
|
|
4
|
+
export { DiscussionLiveWorker } from './live-worker.js';
|
|
5
|
+
export { DiscussionWorker } from './worker.js';
|
|
6
|
+
export { DISCUSSION_STATUSES } from './types.js';
|
|
7
|
+
export type * from './types.js';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { analyzeDiscussion } from "./analyzer.js";
|
|
2
|
+
import { DISCUSSION_AUDIO_MAX_BYTES, DISCUSSION_MAX_DURATION_MS, DiscussionService, DiscussionServiceError } from "./service.js";
|
|
3
|
+
import { DiscussionPipeline, mergeDiscussionAnalysisIntoMarkdown } from "./pipeline.js";
|
|
4
|
+
import { DiscussionLiveWorker } from "./live-worker.js";
|
|
5
|
+
import { DiscussionWorker } from "./worker.js";
|
|
6
|
+
import { DISCUSSION_STATUSES } from "./types.js";
|
|
7
|
+
export { DISCUSSION_AUDIO_MAX_BYTES, DISCUSSION_MAX_DURATION_MS, DISCUSSION_STATUSES, DiscussionLiveWorker, DiscussionPipeline, DiscussionService, DiscussionServiceError, DiscussionWorker, analyzeDiscussion, mergeDiscussionAnalysisIntoMarkdown };
|