@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
|
@@ -19,7 +19,7 @@ const log = createLogger('Sqlite:Migrations');
|
|
|
19
19
|
export const XOPC_DB_BASELINE_SCHEMA_VERSION = 11;
|
|
20
20
|
|
|
21
21
|
/** Latest schema version this release supports (increment when adding migrations). */
|
|
22
|
-
export const XOPC_DB_SCHEMA_VERSION =
|
|
22
|
+
export const XOPC_DB_SCHEMA_VERSION = 87;
|
|
23
23
|
|
|
24
24
|
const MODULE_DIR = dirname(fileURLToPath(import.meta.url));
|
|
25
25
|
|
|
@@ -177,6 +177,15 @@ function listNoteRecords(query = {}) {
|
|
|
177
177
|
params.push(query.groupId);
|
|
178
178
|
}
|
|
179
179
|
if (query.pendingTasksOnly) conditions.push(`kind = 'task' AND (task_done IS NULL OR task_done = 0)`);
|
|
180
|
+
if (query.projectId) {
|
|
181
|
+
conditions.push(`EXISTS (
|
|
182
|
+
SELECT 1 FROM object_links
|
|
183
|
+
WHERE relation = 'belongs_to'
|
|
184
|
+
AND from_kind = 'note' AND from_id = notes.note_id
|
|
185
|
+
AND to_kind = 'project' AND to_id = ?
|
|
186
|
+
)`);
|
|
187
|
+
params.push(query.projectId);
|
|
188
|
+
}
|
|
180
189
|
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
181
190
|
const rows = db.prepare(`SELECT note_id, title, kind, status, payload_json, created_at, updated_at,
|
|
182
191
|
pinned, tags_json, snippet, cover_attachment_id, voice_attachment_id,
|
|
@@ -31,7 +31,7 @@ function ensureXopcDatabaseSchema(db) {
|
|
|
31
31
|
bootstrapFreshDatabase(db);
|
|
32
32
|
currentVersion = 11;
|
|
33
33
|
}
|
|
34
|
-
applyPendingMigrations(db, { targetVersion:
|
|
34
|
+
applyPendingMigrations(db, { targetVersion: 87 });
|
|
35
35
|
}
|
|
36
36
|
//#endregion
|
|
37
37
|
export { SCHEMA_META_SCHEMA_VERSION_KEY, XOPC_DB_BASELINE_SCHEMA_VERSION, XOPC_DB_SCHEMA_VERSION, ensureSchemaMetaTable, ensureXopcDatabaseSchema, readSchemaVersion, readSchemaVersionForTest, setSchemaVersion };
|
|
@@ -536,6 +536,95 @@ CREATE TABLE IF NOT EXISTS activity_related_projects (
|
|
|
536
536
|
CREATE INDEX IF NOT EXISTS idx_activity_related_projects_project
|
|
537
537
|
ON activity_related_projects(project_id, activity_id);
|
|
538
538
|
|
|
539
|
+
CREATE TABLE IF NOT EXISTS discussion_captures (
|
|
540
|
+
id TEXT PRIMARY KEY,
|
|
541
|
+
client_request_id TEXT NOT NULL UNIQUE,
|
|
542
|
+
note_id TEXT NOT NULL UNIQUE,
|
|
543
|
+
project_id TEXT,
|
|
544
|
+
audio_attachment_id TEXT,
|
|
545
|
+
source TEXT NOT NULL CHECK (source IN ('web', 'electron')),
|
|
546
|
+
status TEXT NOT NULL CHECK (status IN (
|
|
547
|
+
'recording',
|
|
548
|
+
'finalizing',
|
|
549
|
+
'completed',
|
|
550
|
+
'failed',
|
|
551
|
+
'cancelled'
|
|
552
|
+
)),
|
|
553
|
+
processing_stage TEXT CHECK (processing_stage IN (
|
|
554
|
+
'original_upload',
|
|
555
|
+
'final_transcription',
|
|
556
|
+
'analysis',
|
|
557
|
+
'note_write'
|
|
558
|
+
)),
|
|
559
|
+
duration_ms INTEGER,
|
|
560
|
+
expected_last_sequence INTEGER,
|
|
561
|
+
mime_type TEXT,
|
|
562
|
+
audio_size_bytes INTEGER,
|
|
563
|
+
audio_sha256 TEXT,
|
|
564
|
+
transcript_raw TEXT,
|
|
565
|
+
transcript_sha256 TEXT,
|
|
566
|
+
transcript_language TEXT,
|
|
567
|
+
stt_provider TEXT,
|
|
568
|
+
analysis_json TEXT,
|
|
569
|
+
analysis_input_hash TEXT,
|
|
570
|
+
analyzer_model_ref TEXT,
|
|
571
|
+
generated_title TEXT,
|
|
572
|
+
project_inference_score REAL,
|
|
573
|
+
project_inference_source TEXT,
|
|
574
|
+
finalization_revision INTEGER NOT NULL DEFAULT 0,
|
|
575
|
+
attempt_count INTEGER NOT NULL DEFAULT 0,
|
|
576
|
+
next_attempt_at INTEGER,
|
|
577
|
+
lease_owner TEXT,
|
|
578
|
+
lease_expires_at INTEGER,
|
|
579
|
+
last_error_code TEXT,
|
|
580
|
+
last_error_message TEXT,
|
|
581
|
+
recording_started_at INTEGER NOT NULL,
|
|
582
|
+
recording_finished_at INTEGER,
|
|
583
|
+
created_at INTEGER NOT NULL,
|
|
584
|
+
updated_at INTEGER NOT NULL,
|
|
585
|
+
completed_at INTEGER,
|
|
586
|
+
audio_deleted_at INTEGER,
|
|
587
|
+
FOREIGN KEY (note_id) REFERENCES notes(note_id) ON DELETE CASCADE,
|
|
588
|
+
FOREIGN KEY (project_id) REFERENCES projects(project_id) ON DELETE SET NULL
|
|
589
|
+
);
|
|
590
|
+
|
|
591
|
+
CREATE INDEX IF NOT EXISTS idx_discussion_captures_queue
|
|
592
|
+
ON discussion_captures(status, next_attempt_at, created_at);
|
|
593
|
+
|
|
594
|
+
CREATE INDEX IF NOT EXISTS idx_discussion_captures_project
|
|
595
|
+
ON discussion_captures(project_id, updated_at DESC);
|
|
596
|
+
|
|
597
|
+
CREATE TABLE IF NOT EXISTS discussion_transcript_segments (
|
|
598
|
+
discussion_id TEXT NOT NULL,
|
|
599
|
+
sequence INTEGER NOT NULL,
|
|
600
|
+
audio_sha256 TEXT NOT NULL,
|
|
601
|
+
audio_blob BLOB,
|
|
602
|
+
started_at_ms INTEGER NOT NULL,
|
|
603
|
+
ended_at_ms INTEGER NOT NULL,
|
|
604
|
+
status TEXT NOT NULL CHECK (status IN ('uploaded', 'transcribing', 'completed', 'failed')),
|
|
605
|
+
transcript TEXT,
|
|
606
|
+
provider TEXT,
|
|
607
|
+
attempt_count INTEGER NOT NULL DEFAULT 0,
|
|
608
|
+
next_attempt_at INTEGER,
|
|
609
|
+
lease_owner TEXT,
|
|
610
|
+
lease_expires_at INTEGER,
|
|
611
|
+
last_error TEXT,
|
|
612
|
+
created_at INTEGER NOT NULL,
|
|
613
|
+
updated_at INTEGER NOT NULL,
|
|
614
|
+
PRIMARY KEY (discussion_id, sequence),
|
|
615
|
+
FOREIGN KEY (discussion_id) REFERENCES discussion_captures(id) ON DELETE CASCADE
|
|
616
|
+
);
|
|
617
|
+
|
|
618
|
+
CREATE INDEX IF NOT EXISTS idx_discussion_segments_queue
|
|
619
|
+
ON discussion_transcript_segments(status, next_attempt_at, created_at);
|
|
620
|
+
|
|
621
|
+
CREATE TABLE IF NOT EXISTS discussion_capture_settings (
|
|
622
|
+
workspace_id TEXT PRIMARY KEY,
|
|
623
|
+
consent_policy_version INTEGER NOT NULL,
|
|
624
|
+
consent_acknowledged_at INTEGER,
|
|
625
|
+
updated_at INTEGER NOT NULL
|
|
626
|
+
);
|
|
627
|
+
|
|
539
628
|
CREATE TABLE IF NOT EXISTS goal_context_messages (
|
|
540
629
|
goal_id TEXT PRIMARY KEY,
|
|
541
630
|
text TEXT NOT NULL DEFAULT '',
|
|
@@ -545,17 +634,6 @@ CREATE TABLE IF NOT EXISTS goal_context_messages (
|
|
|
545
634
|
FOREIGN KEY (goal_id) REFERENCES goals(goal_id) ON DELETE CASCADE
|
|
546
635
|
);
|
|
547
636
|
|
|
548
|
-
CREATE TABLE IF NOT EXISTS goal_contracts (
|
|
549
|
-
goal_id TEXT PRIMARY KEY,
|
|
550
|
-
version INTEGER NOT NULL DEFAULT 1,
|
|
551
|
-
objective TEXT NOT NULL,
|
|
552
|
-
scope_boundary TEXT,
|
|
553
|
-
evidence_plan_json TEXT NOT NULL DEFAULT '[]',
|
|
554
|
-
created_at INTEGER NOT NULL,
|
|
555
|
-
updated_at INTEGER NOT NULL,
|
|
556
|
-
FOREIGN KEY (goal_id) REFERENCES goals(goal_id) ON DELETE CASCADE
|
|
557
|
-
);
|
|
558
|
-
|
|
559
637
|
CREATE TABLE IF NOT EXISTS goal_queue (
|
|
560
638
|
queue_id TEXT PRIMARY KEY,
|
|
561
639
|
goal_id TEXT NOT NULL,
|
|
@@ -652,39 +730,6 @@ CREATE TABLE IF NOT EXISTS goal_evidence (
|
|
|
652
730
|
CREATE INDEX IF NOT EXISTS idx_goal_evidence_goal_created
|
|
653
731
|
ON goal_evidence(goal_id, created_at DESC);
|
|
654
732
|
|
|
655
|
-
CREATE TABLE IF NOT EXISTS goal_evidence_requirements (
|
|
656
|
-
requirement_id TEXT PRIMARY KEY,
|
|
657
|
-
goal_id TEXT NOT NULL,
|
|
658
|
-
text TEXT NOT NULL,
|
|
659
|
-
status TEXT NOT NULL DEFAULT 'pending',
|
|
660
|
-
review_reason TEXT,
|
|
661
|
-
review_confidence REAL,
|
|
662
|
-
reviewed_by TEXT,
|
|
663
|
-
reviewed_at INTEGER,
|
|
664
|
-
requires_human_approval INTEGER NOT NULL DEFAULT 1,
|
|
665
|
-
created_at INTEGER NOT NULL,
|
|
666
|
-
updated_at INTEGER NOT NULL,
|
|
667
|
-
sort_order INTEGER NOT NULL,
|
|
668
|
-
UNIQUE(goal_id, text),
|
|
669
|
-
FOREIGN KEY (goal_id) REFERENCES goals(goal_id) ON DELETE CASCADE
|
|
670
|
-
);
|
|
671
|
-
|
|
672
|
-
CREATE INDEX IF NOT EXISTS idx_goal_evidence_requirements_goal_order
|
|
673
|
-
ON goal_evidence_requirements(goal_id, sort_order ASC);
|
|
674
|
-
|
|
675
|
-
CREATE TABLE IF NOT EXISTS goal_evidence_requirement_links (
|
|
676
|
-
requirement_id TEXT NOT NULL,
|
|
677
|
-
evidence_id TEXT NOT NULL,
|
|
678
|
-
linked_by TEXT NOT NULL,
|
|
679
|
-
created_at INTEGER NOT NULL,
|
|
680
|
-
PRIMARY KEY (requirement_id, evidence_id),
|
|
681
|
-
FOREIGN KEY (requirement_id) REFERENCES goal_evidence_requirements(requirement_id) ON DELETE CASCADE,
|
|
682
|
-
FOREIGN KEY (evidence_id) REFERENCES goal_evidence(evidence_id) ON DELETE CASCADE
|
|
683
|
-
);
|
|
684
|
-
|
|
685
|
-
CREATE INDEX IF NOT EXISTS idx_goal_evidence_requirement_links_evidence
|
|
686
|
-
ON goal_evidence_requirement_links(evidence_id);
|
|
687
|
-
|
|
688
733
|
CREATE TABLE IF NOT EXISTS goal_session_links (
|
|
689
734
|
goal_id TEXT NOT NULL,
|
|
690
735
|
session_key TEXT NOT NULL,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
import { validateSessionId } from "../../session/session-id.js";
|
|
2
3
|
import { buildDefaultSessionMetadata } from "./session-metadata.js";
|
|
3
4
|
import { buildGlobalSessionStats, metadataToSessionInsert, sessionRowToMetadata } from "./row-mappers.js";
|
|
4
|
-
import { validateSessionId } from "../../session/session-id.js";
|
|
5
5
|
import { escapeFts5Query } from "./fts.js";
|
|
6
6
|
import { randomUUID } from "node:crypto";
|
|
7
7
|
//#region src/storage/sqlite/session-repository.ts
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type SessionTaskPlanItemStatus = 'pending' | 'in_progress' | 'completed' | 'cancelled';
|
|
2
|
+
export type SessionTaskPlanItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
content: string;
|
|
5
|
+
status: SessionTaskPlanItemStatus;
|
|
6
|
+
};
|
|
7
|
+
export type SessionTaskPlan = {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
planId: string;
|
|
10
|
+
items: SessionTaskPlanItem[];
|
|
11
|
+
revision: number;
|
|
12
|
+
updatedAt: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function getSessionTaskPlan(sessionKey: string, planId?: string): SessionTaskPlan | undefined;
|
|
15
|
+
export declare function setSessionTaskPlan(input: {
|
|
16
|
+
sessionKey: string;
|
|
17
|
+
planId?: string;
|
|
18
|
+
items: SessionTaskPlanItem[];
|
|
19
|
+
now?: number;
|
|
20
|
+
}): SessionTaskPlan | undefined;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "./transaction.js";
|
|
2
|
+
import { getCurrentSessionId } from "./session-repository.js";
|
|
3
|
+
//#region src/storage/sqlite/session-task-plan-repository.ts
|
|
4
|
+
const VALID_STATUSES = new Set([
|
|
5
|
+
"pending",
|
|
6
|
+
"in_progress",
|
|
7
|
+
"completed",
|
|
8
|
+
"cancelled"
|
|
9
|
+
]);
|
|
10
|
+
function parseItems(value) {
|
|
11
|
+
try {
|
|
12
|
+
const raw = JSON.parse(value);
|
|
13
|
+
if (!Array.isArray(raw)) return [];
|
|
14
|
+
return raw.flatMap((value) => {
|
|
15
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return [];
|
|
16
|
+
const item = value;
|
|
17
|
+
const id = typeof item.id === "string" ? item.id.trim() : "";
|
|
18
|
+
const content = typeof item.content === "string" ? item.content.trim() : "";
|
|
19
|
+
const status = item.status;
|
|
20
|
+
return id && content && VALID_STATUSES.has(status) ? [{
|
|
21
|
+
id,
|
|
22
|
+
content,
|
|
23
|
+
status
|
|
24
|
+
}] : [];
|
|
25
|
+
});
|
|
26
|
+
} catch {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
function fromRow(row) {
|
|
31
|
+
return {
|
|
32
|
+
sessionId: row.session_id,
|
|
33
|
+
planId: row.plan_id,
|
|
34
|
+
items: parseItems(row.items_json),
|
|
35
|
+
revision: row.revision,
|
|
36
|
+
updatedAt: row.updated_at
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function getSessionTaskPlan(sessionKey, planId = "todo") {
|
|
40
|
+
const sessionId = getCurrentSessionId(sessionKey);
|
|
41
|
+
if (!sessionId) return void 0;
|
|
42
|
+
const row = getSqliteDatabase().prepare(`SELECT session_id, plan_id, items_json, revision, updated_at
|
|
43
|
+
FROM session_task_plans
|
|
44
|
+
WHERE session_id = ? AND plan_id = ?`).get(sessionId, planId);
|
|
45
|
+
return row ? fromRow(row) : void 0;
|
|
46
|
+
}
|
|
47
|
+
function setSessionTaskPlan(input) {
|
|
48
|
+
const planId = input.planId?.trim() || "todo";
|
|
49
|
+
if (!input.items.some((item) => item.status === "pending" || item.status === "in_progress")) {
|
|
50
|
+
deleteSessionTaskPlan(input.sessionKey, planId);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const sessionId = getCurrentSessionId(input.sessionKey);
|
|
54
|
+
if (!sessionId) return void 0;
|
|
55
|
+
const now = input.now ?? Date.now();
|
|
56
|
+
runSqliteWriteTransaction((db) => {
|
|
57
|
+
db.prepare(`INSERT INTO session_task_plans (session_id, plan_id, items_json, revision, updated_at)
|
|
58
|
+
VALUES (?, ?, ?, 1, ?)
|
|
59
|
+
ON CONFLICT(session_id, plan_id) DO UPDATE SET
|
|
60
|
+
items_json = excluded.items_json,
|
|
61
|
+
revision = session_task_plans.revision + 1,
|
|
62
|
+
updated_at = excluded.updated_at`).run(sessionId, planId, JSON.stringify(input.items), now);
|
|
63
|
+
});
|
|
64
|
+
return getSessionTaskPlan(input.sessionKey, planId);
|
|
65
|
+
}
|
|
66
|
+
function deleteSessionTaskPlan(sessionKey, planId = "todo") {
|
|
67
|
+
const sessionId = getCurrentSessionId(sessionKey);
|
|
68
|
+
if (!sessionId) return false;
|
|
69
|
+
let deleted = false;
|
|
70
|
+
runSqliteWriteTransaction((db) => {
|
|
71
|
+
deleted = db.prepare(`DELETE FROM session_task_plans
|
|
72
|
+
WHERE session_id = ? AND plan_id = ?`).run(sessionId, planId).changes > 0;
|
|
73
|
+
});
|
|
74
|
+
return deleted;
|
|
75
|
+
}
|
|
76
|
+
//#endregion
|
|
77
|
+
export { getSessionTaskPlan, setSessionTaskPlan };
|
|
@@ -10,6 +10,7 @@ import { init_agent_scope, listAgentEntries, normalizeAgentId } from "../../agen
|
|
|
10
10
|
import { loadConfig, saveConfig } from "../../config/loader.js";
|
|
11
11
|
import { effectiveWorkspacePathForSession } from "../../session/session-workspace.js";
|
|
12
12
|
import { createCreateShareTool, isShareToolAvailable } from "../../agent/tools/create-share-tool.js";
|
|
13
|
+
import { setTuiDefaultAgentConfig } from "../../commands/agents.config.js";
|
|
13
14
|
import { ProjectService } from "../../projects/project-service.js";
|
|
14
15
|
import { inferSuggestedProjectDefaultAgentId } from "../../projects/project-agent-suggestion.js";
|
|
15
16
|
import "../../projects/index.js";
|
|
@@ -23,7 +24,6 @@ import { parseModelRef } from "../../agent/models/selection.js";
|
|
|
23
24
|
import { buildReviewContext, resolveGitRoot } from "../../review/review-git.js";
|
|
24
25
|
import { MessageBus, MessageBusShutdownError } from "../../infra/bus/queue.js";
|
|
25
26
|
import "../../infra/bus/index.js";
|
|
26
|
-
import { setTuiDefaultAgentConfig } from "../../commands/agents.config.js";
|
|
27
27
|
import { getWorkspacePath } from "../../config/workspace-path-helpers.js";
|
|
28
28
|
import "../../config/index.js";
|
|
29
29
|
import { buildWorkflowChildTools } from "../../agent/workflow/workflow-child-tools.js";
|
|
@@ -6,8 +6,8 @@ import { tmpdir } from "node:os";
|
|
|
6
6
|
import { join } from "node:path";
|
|
7
7
|
import { chmodSync, createWriteStream, existsSync, mkdirSync, rmSync } from "node:fs";
|
|
8
8
|
import { randomBytes } from "node:crypto";
|
|
9
|
-
import { Readable } from "node:stream";
|
|
10
9
|
import { pipeline } from "node:stream/promises";
|
|
10
|
+
import { Readable } from "node:stream";
|
|
11
11
|
//#region src/tunnel/frpc-binary.ts
|
|
12
12
|
init_paths();
|
|
13
13
|
init_logger();
|
|
@@ -3,8 +3,8 @@ import { init_logger } from "../utils/logger.js";
|
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { spawn } from "node:child_process";
|
|
6
|
-
import AdmZip from "adm-zip";
|
|
7
6
|
import { gunzipSync } from "node:zlib";
|
|
7
|
+
import AdmZip from "adm-zip";
|
|
8
8
|
//#region src/tunnel/frpc-extract.ts
|
|
9
9
|
init_logger();
|
|
10
10
|
const log = createLogger("TunnelFrpcExtract");
|
package/dist/src/tunnel/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { loadTunnelState, resolveTunnelStatePath, saveTunnelState } from "./tunnel-state.js";
|
|
2
2
|
import { buildMobileConnectQrPayload, resolveLanGatewayUrl } from "./tunnel-qr.js";
|
|
3
3
|
import { CURRENT_TUNNEL_CONSENT_VERSION, TUNNEL_CONSENT_REQUIRED_CODE, TUNNEL_RISK_SUMMARY_LINES, TunnelConsentError, assertTunnelMayStart, getTunnelConsentState, hasValidTunnelConsent } from "./consent.js";
|
|
4
|
-
import { getTunnelRegistrationSecretMeta, isMaskedTunnelSecretPatchValue, isProductionTunnelBroker, resolveTunnelBrokerUrl, resolveTunnelRegistrationSecret } from "./env.js";
|
|
5
4
|
import { TunnelBrokerClient, resolveBrokerApiBase } from "./broker-client.js";
|
|
5
|
+
import { getTunnelRegistrationSecretMeta, isMaskedTunnelSecretPatchValue, isProductionTunnelBroker, resolveTunnelBrokerUrl, resolveTunnelRegistrationSecret } from "./env.js";
|
|
6
|
+
import { applyTunnelConsentToConfig, mergeTunnelConfigPatch, sanitizeTunnelConfig, setTunnelEnabledInConfig } from "./tunnel-config.js";
|
|
6
7
|
import { FRPC_VERSION, clearFrpcPathForProcess, ensureFrpcBinary, publishFrpcPathForProcess } from "./frpc-binary.js";
|
|
7
8
|
import { consumePairingSecret, createPairingSecret, resetPairingSessionsForTests } from "./pairing.js";
|
|
8
9
|
import { logTunnelAudit } from "./tunnel-audit.js";
|
|
@@ -10,6 +11,5 @@ import { TunnelService, getTunnelService, hashGatewayToken } from "./tunnel-serv
|
|
|
10
11
|
import { resolveFrpSubdomainHost } from "./frp-subdomain-host.js";
|
|
11
12
|
import { clearTunnelWellKnownCache, fetchTunnelWellKnown } from "./well-known.js";
|
|
12
13
|
import { configureTunnelFromGatewayConfig, maybeAutoStartTunnelFromConfig, wireTunnelEventsToGateway } from "./gateway-lifecycle.js";
|
|
13
|
-
import { applyTunnelConsentToConfig, mergeTunnelConfigPatch, sanitizeTunnelConfig, setTunnelEnabledInConfig } from "./tunnel-config.js";
|
|
14
14
|
import { consumeTunnelMutationLimit, resetTunnelMutationLimitsForTests } from "./tunnel-rate-limit.js";
|
|
15
15
|
export { CURRENT_TUNNEL_CONSENT_VERSION, FRPC_VERSION, TUNNEL_CONSENT_REQUIRED_CODE, TUNNEL_RISK_SUMMARY_LINES, TunnelBrokerClient, TunnelConsentError, TunnelService, applyTunnelConsentToConfig, assertTunnelMayStart, buildMobileConnectQrPayload, clearFrpcPathForProcess, clearTunnelWellKnownCache, configureTunnelFromGatewayConfig, consumePairingSecret, consumeTunnelMutationLimit, createPairingSecret, ensureFrpcBinary, fetchTunnelWellKnown, getTunnelConsentState, getTunnelRegistrationSecretMeta, getTunnelService, hasValidTunnelConsent, hashGatewayToken, isMaskedTunnelSecretPatchValue, isProductionTunnelBroker, loadTunnelState, logTunnelAudit, maybeAutoStartTunnelFromConfig, mergeTunnelConfigPatch, publishFrpcPathForProcess, resetPairingSessionsForTests, resetTunnelMutationLimitsForTests, resolveBrokerApiBase, resolveFrpSubdomainHost, resolveLanGatewayUrl, resolveTunnelBrokerUrl, resolveTunnelRegistrationSecret, resolveTunnelStatePath, sanitizeTunnelConfig, saveTunnelState, setTunnelEnabledInConfig, wireTunnelEventsToGateway };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { UserContextPlan } from '../agent/memory/context/types.js';
|
|
2
|
+
import { type RelationshipSettings } from '../storage/sqlite/index.js';
|
|
3
|
+
export interface ContextSnapshot {
|
|
4
|
+
id: string;
|
|
5
|
+
traceId: string;
|
|
6
|
+
sessionKey: string;
|
|
7
|
+
query: string;
|
|
8
|
+
selectedItems: UserContextPlan['items'];
|
|
9
|
+
rejectedItems: UserContextPlan['rejected'];
|
|
10
|
+
consentRequests: UserContextPlan['consentRequests'];
|
|
11
|
+
relationshipPolicy: RelationshipSettings;
|
|
12
|
+
estimatedTokens: number;
|
|
13
|
+
outcomeId?: string;
|
|
14
|
+
runId?: string;
|
|
15
|
+
createdAt: number;
|
|
16
|
+
}
|
|
17
|
+
export declare class ContextCompiler {
|
|
18
|
+
capture(input: {
|
|
19
|
+
sessionKey: string;
|
|
20
|
+
query: string;
|
|
21
|
+
plan: UserContextPlan;
|
|
22
|
+
now?: number;
|
|
23
|
+
}): ContextSnapshot;
|
|
24
|
+
get(id: string): ContextSnapshot | undefined;
|
|
25
|
+
latestForSession(sessionKey: string, since?: number): ContextSnapshot | undefined;
|
|
26
|
+
linkToRun(input: {
|
|
27
|
+
snapshotId: string;
|
|
28
|
+
outcomeId?: string;
|
|
29
|
+
runId: string;
|
|
30
|
+
}): ContextSnapshot | undefined;
|
|
31
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { getSqliteDatabase, runSqliteWriteTransaction } from "../storage/sqlite/transaction.js";
|
|
2
|
+
import { getRelationshipSettings } from "../storage/sqlite/relationship-settings-repository.js";
|
|
3
|
+
import "../storage/sqlite/index.js";
|
|
4
|
+
import { randomUUID } from "node:crypto";
|
|
5
|
+
//#region src/user-context/context-compiler.ts
|
|
6
|
+
function fromRow(row) {
|
|
7
|
+
return {
|
|
8
|
+
id: row.snapshot_id,
|
|
9
|
+
traceId: row.trace_id,
|
|
10
|
+
sessionKey: row.session_key,
|
|
11
|
+
query: row.query,
|
|
12
|
+
selectedItems: JSON.parse(row.selected_items_json),
|
|
13
|
+
rejectedItems: JSON.parse(row.rejected_items_json),
|
|
14
|
+
consentRequests: JSON.parse(row.consent_requests_json),
|
|
15
|
+
relationshipPolicy: JSON.parse(row.relationship_policy_json),
|
|
16
|
+
estimatedTokens: row.estimated_tokens,
|
|
17
|
+
...row.outcome_id ? { outcomeId: row.outcome_id } : {},
|
|
18
|
+
...row.run_id ? { runId: row.run_id } : {},
|
|
19
|
+
createdAt: row.created_at
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
var ContextCompiler = class {
|
|
23
|
+
capture(input) {
|
|
24
|
+
const now = input.now ?? Date.now();
|
|
25
|
+
const id = randomUUID();
|
|
26
|
+
runSqliteWriteTransaction((db) => {
|
|
27
|
+
db.prepare(`INSERT INTO context_snapshots (
|
|
28
|
+
snapshot_id, trace_id, session_key, query, selected_items_json,
|
|
29
|
+
rejected_items_json, consent_requests_json, relationship_policy_json,
|
|
30
|
+
estimated_tokens, created_at
|
|
31
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(id, input.plan.traceId, input.sessionKey, input.query.trim(), JSON.stringify(input.plan.items), JSON.stringify(input.plan.rejected), JSON.stringify(input.plan.consentRequests), JSON.stringify(getRelationshipSettings()), input.plan.estimatedTokens, now);
|
|
32
|
+
});
|
|
33
|
+
return this.get(id);
|
|
34
|
+
}
|
|
35
|
+
get(id) {
|
|
36
|
+
const row = getSqliteDatabase().prepare("SELECT * FROM context_snapshots WHERE snapshot_id = ?").get(id);
|
|
37
|
+
return row ? fromRow(row) : void 0;
|
|
38
|
+
}
|
|
39
|
+
latestForSession(sessionKey, since = 0) {
|
|
40
|
+
const row = getSqliteDatabase().prepare(`SELECT * FROM context_snapshots
|
|
41
|
+
WHERE session_key = ? AND created_at >= ?
|
|
42
|
+
ORDER BY created_at DESC LIMIT 1`).get(sessionKey, since);
|
|
43
|
+
return row ? fromRow(row) : void 0;
|
|
44
|
+
}
|
|
45
|
+
linkToRun(input) {
|
|
46
|
+
getSqliteDatabase().prepare(`UPDATE context_snapshots SET outcome_id = ?, run_id = ? WHERE snapshot_id = ?`).run(input.outcomeId ?? null, input.runId, input.snapshotId);
|
|
47
|
+
return this.get(input.snapshotId);
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
//#endregion
|
|
51
|
+
export { ContextCompiler };
|
|
@@ -2,8 +2,8 @@ import { dirname, join } from "node:path";
|
|
|
2
2
|
import { createReadStream, createWriteStream } from "node:fs";
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { mkdir, rm, stat } from "node:fs/promises";
|
|
5
|
-
import { Readable } from "node:stream";
|
|
6
5
|
import { pipeline } from "node:stream/promises";
|
|
6
|
+
import { Readable } from "node:stream";
|
|
7
7
|
//#region src/voice/local/model-files.ts
|
|
8
8
|
function resolveModelFileUrl(remoteHost, model, file) {
|
|
9
9
|
const base = remoteHost.endsWith("/") ? remoteHost : `${remoteHost}/`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DEFAULT_STT_CONFIG } from "./types.js";
|
|
2
|
+
//#region src/voice/stt/config.ts
|
|
3
|
+
function mergeSttProviders(base, patch) {
|
|
4
|
+
if (!base && !patch) return void 0;
|
|
5
|
+
const merged = { ...base ?? {} };
|
|
6
|
+
for (const [id, slice] of Object.entries(patch ?? {})) merged[id] = {
|
|
7
|
+
...merged[id] ?? {},
|
|
8
|
+
...slice
|
|
9
|
+
};
|
|
10
|
+
return merged;
|
|
11
|
+
}
|
|
12
|
+
function mergeSttConfigFromAppConfig(stt, toolsMedia) {
|
|
13
|
+
const patch = stt ?? {};
|
|
14
|
+
return {
|
|
15
|
+
...DEFAULT_STT_CONFIG,
|
|
16
|
+
...patch,
|
|
17
|
+
providers: mergeSttProviders(DEFAULT_STT_CONFIG.providers, patch.providers),
|
|
18
|
+
fallback: {
|
|
19
|
+
...DEFAULT_STT_CONFIG.fallback,
|
|
20
|
+
...patch.fallback
|
|
21
|
+
},
|
|
22
|
+
...toolsMedia?.models?.length ? { sharedModels: toolsMedia.models } : {}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { mergeSttConfigFromAppConfig };
|
|
@@ -9,6 +9,7 @@ import './providers/index.js';
|
|
|
9
9
|
import type { STTConfig, STTOptions, STTResult } from './types.js';
|
|
10
10
|
export { transcribe } from './transcribe-core.js';
|
|
11
11
|
export { isSTTAvailable } from './availability.js';
|
|
12
|
+
export { mergeSttConfigFromAppConfig } from './config.js';
|
|
12
13
|
/**
|
|
13
14
|
* Single-provider transcription helper. Used by chat-commands /stt so a user
|
|
14
15
|
* can force a specific provider regardless of fallback config.
|
|
@@ -4,6 +4,7 @@ import "./providers/index.js";
|
|
|
4
4
|
import { resolveSTTProviderChain, resolveSTTProviderConfig, resolveSTTProviderOrder } from "./factory.js";
|
|
5
5
|
import { transcribe } from "./transcribe-core.js";
|
|
6
6
|
import { isSTTAvailable } from "./availability.js";
|
|
7
|
+
import { mergeSttConfigFromAppConfig } from "./config.js";
|
|
7
8
|
import { checkMentionInTranscription } from "./mention.js";
|
|
8
9
|
import { audioPreflightTranscribe } from "./preflight.js";
|
|
9
10
|
//#region src/voice/stt/index.ts
|
|
@@ -28,4 +29,4 @@ async function transcribeWithProvider(audioBuffer, providerName, config, options
|
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
//#endregion
|
|
31
|
-
export { alibabaTranscriptionProvider, audioPreflightTranscribe, checkMentionInTranscription, isSTTAvailable, openAiTranscriptionProvider, resolveSTTProviderChain, resolveSTTProviderConfig, resolveSTTProviderOrder, transcribe, transcribeWithProvider };
|
|
32
|
+
export { alibabaTranscriptionProvider, audioPreflightTranscribe, checkMentionInTranscription, isSTTAvailable, mergeSttConfigFromAppConfig, openAiTranscriptionProvider, resolveSTTProviderChain, resolveSTTProviderConfig, resolveSTTProviderOrder, transcribe, transcribeWithProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { listMediaUnderstandingProviders } from "../../media-understanding/registry.js";
|
|
2
2
|
import { resolveSTTProviderConfig } from "./factory.js";
|
|
3
|
-
import { mergeSttConfigFromAppConfig } from "
|
|
3
|
+
import { mergeSttConfigFromAppConfig } from "./config.js";
|
|
4
4
|
import { getVoiceProviderMetadata } from "../metadata/registry.js";
|
|
5
5
|
import "../metadata/index.js";
|
|
6
6
|
//#region src/voice/stt/list-providers.ts
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { WorkHomeAttention, WorkHomeDecision } from '@xopcai/gateway-contract';
|
|
2
|
+
export interface AttentionProjection {
|
|
3
|
+
decisions: WorkHomeDecision[];
|
|
4
|
+
attention: WorkHomeAttention[];
|
|
5
|
+
policy: {
|
|
6
|
+
visibleDecisionCount: number;
|
|
7
|
+
suppressedDecisionCount: number;
|
|
8
|
+
visibleAttentionCount: number;
|
|
9
|
+
suppressedAttentionCount: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export declare class AttentionGovernor {
|
|
13
|
+
project(input: {
|
|
14
|
+
decisions: WorkHomeDecision[];
|
|
15
|
+
attention: WorkHomeAttention[];
|
|
16
|
+
proactiveEnabled: boolean;
|
|
17
|
+
maxDecisions?: number;
|
|
18
|
+
maxAttention?: number;
|
|
19
|
+
}): AttentionProjection;
|
|
20
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//#region src/work/attention-governor.ts
|
|
2
|
+
function decisionScore(item) {
|
|
3
|
+
if (item.reason === "approval_required") return 100;
|
|
4
|
+
if (item.reason === "needs_input") return 95;
|
|
5
|
+
if (item.reason === "blocked") return 85;
|
|
6
|
+
if (item.reason === "in_review") return 80;
|
|
7
|
+
if (item.kind === "agent_judgment") return Math.round((item.judgment?.valueScore ?? 0) * 70) + (item.urgency === "now" ? 20 : 0);
|
|
8
|
+
if (item.reason === "overdue") return 70;
|
|
9
|
+
return 50;
|
|
10
|
+
}
|
|
11
|
+
function decisionKey(item) {
|
|
12
|
+
const title = item.title.trim().toLocaleLowerCase();
|
|
13
|
+
return item.response ? item.id : `${item.projectId ?? "global"}:${title}:${item.reason === "approval_required" ? item.id : ""}`;
|
|
14
|
+
}
|
|
15
|
+
function keepDecision(item, proactiveEnabled) {
|
|
16
|
+
if (item.kind !== "agent_judgment") return true;
|
|
17
|
+
if (!proactiveEnabled) return false;
|
|
18
|
+
return (item.judgment?.confidence ?? 0) >= .65 && (item.judgment?.valueScore ?? 0) >= .6;
|
|
19
|
+
}
|
|
20
|
+
var AttentionGovernor = class {
|
|
21
|
+
project(input) {
|
|
22
|
+
const maxDecisions = Math.max(1, Math.min(20, input.maxDecisions ?? 7));
|
|
23
|
+
const maxAttention = Math.max(1, Math.min(10, input.maxAttention ?? 5));
|
|
24
|
+
const seen = /* @__PURE__ */ new Set();
|
|
25
|
+
const eligible = [...input.decisions].filter((item) => keepDecision(item, input.proactiveEnabled)).sort((left, right) => decisionScore(right) - decisionScore(left) || right.updatedAt - left.updatedAt).filter((item) => {
|
|
26
|
+
const key = decisionKey(item);
|
|
27
|
+
if (seen.has(key)) return false;
|
|
28
|
+
seen.add(key);
|
|
29
|
+
return true;
|
|
30
|
+
});
|
|
31
|
+
const attention = [...input.attention].sort((left, right) => right.updatedAt - left.updatedAt).slice(0, maxAttention);
|
|
32
|
+
const decisions = eligible.slice(0, maxDecisions);
|
|
33
|
+
return {
|
|
34
|
+
decisions,
|
|
35
|
+
attention,
|
|
36
|
+
policy: {
|
|
37
|
+
visibleDecisionCount: decisions.length,
|
|
38
|
+
suppressedDecisionCount: Math.max(0, input.decisions.length - decisions.length),
|
|
39
|
+
visibleAttentionCount: attention.length,
|
|
40
|
+
suppressedAttentionCount: Math.max(0, input.attention.length - attention.length)
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
//#endregion
|
|
46
|
+
export { AttentionGovernor };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SessionMetadata } from '../session/types.js';
|
|
2
|
+
import type { ExecutionReceiptContext } from '../storage/sqlite/execution-receipt-repository.js';
|
|
3
|
+
export interface ExecutionContext extends ExecutionReceiptContext {
|
|
4
|
+
runId: string;
|
|
5
|
+
sessionKey: string;
|
|
6
|
+
channel: string;
|
|
7
|
+
agentId?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function resolveExecutionContext(input: {
|
|
10
|
+
runId: string;
|
|
11
|
+
sessionKey: string;
|
|
12
|
+
channel: string;
|
|
13
|
+
metadata: SessionMetadata;
|
|
14
|
+
agentId?: string;
|
|
15
|
+
}): ExecutionContext;
|
|
16
|
+
export declare function executionReceiptContext(context: ExecutionContext): ExecutionReceiptContext;
|