@xopcai/xopc 0.0.247 → 0.0.249
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/src/update-offset-store.js +17 -54
- package/dist/extensions/telegram/xopc.extension.json +1 -1
- package/dist/extensions/weixin/src/auth/accounts.js +3 -5
- package/dist/extensions/weixin/src/monitor/monitor.js +3 -5
- package/dist/extensions/weixin/src/storage/sync-buf.d.ts +3 -6
- package/dist/extensions/weixin/src/storage/sync-buf.js +9 -22
- package/dist/gateway/static/root/assets/{activity-store-BlxqErph.js → activity-store-B759R_qf.js} +1 -1
- package/dist/gateway/static/root/assets/{agent-avatar-dicebear-DmaFeojS.js → agent-avatar-dicebear-BUu7EnwM.js} +1 -1
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-C1rXNUAG.js +1 -0
- package/dist/gateway/static/root/assets/agents-DK9HjHO0.js +1 -0
- package/dist/gateway/static/root/assets/{api-BbXzyQMj.js → api-Cg0v7Lpn.js} +1 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-C9DkCW_d.js +1 -0
- package/dist/gateway/static/root/assets/appearance-settings-CFggS95Y.js +1 -0
- package/dist/gateway/static/root/assets/apps-page-jOvT-fzU.js +1 -0
- package/dist/gateway/static/root/assets/{archive-plugin-DD2SweEH.js → archive-plugin-BQrilVVv.js} +1 -1
- package/dist/gateway/static/root/assets/{attachment-load-BG82bNBQ.js → attachment-load-BG0BliqV.js} +1 -1
- package/dist/gateway/static/root/assets/{automations-page-CqBZ89He.js → automations-page-Bo4RiTkh.js} +1 -1
- package/dist/gateway/static/root/assets/automations-workspace-BKjKTlW8.js +6 -0
- package/dist/gateway/static/root/assets/{binary-plugins-B6LKm5Zv.js → binary-plugins-BCnyNU0C.js} +1 -1
- package/dist/gateway/static/root/assets/{block-editor-BJKvGVXd.js → block-editor-Db8DlVvg.js} +50 -50
- package/dist/gateway/static/root/assets/browser-settings-page-Dzq18pO1.js +8 -0
- package/dist/gateway/static/root/assets/{browser-workflow-inputs-BAAc151l.js → browser-workflow-inputs-C71vfl0b.js} +1 -1
- package/dist/gateway/static/root/assets/{browser-workflows-page-DoE4Uuns.js → browser-workflows-page-vvmSYKsO.js} +2 -2
- package/dist/gateway/static/root/assets/capabilities-settings-panel-DW4SBQf4.js +7 -0
- package/dist/gateway/static/root/assets/channels-settings-57OGuewD.js +1 -0
- package/dist/gateway/static/root/assets/{channels-status-swr-CCBCtLDg.js → channels-status-swr-CKyV3jY5.js} +1 -1
- package/dist/gateway/static/root/assets/{chat-terminal-dock-BsRWnz7M.js → chat-terminal-dock-B1Xd6OFB.js} +2 -2
- package/dist/gateway/static/root/assets/connectors-page-CT_I3kbR.js +2 -0
- package/dist/gateway/static/root/assets/{cron-expression-DdCgsH2c.js → cron-expression-D-F9vjtE.js} +1 -1
- package/dist/gateway/static/root/assets/{date-picker-dt37Lt8e.js → date-picker-B2OoYvic.js} +1 -1
- package/dist/gateway/static/root/assets/dependency-picker-BiGx9Sbj.js +1 -0
- package/dist/gateway/static/root/assets/{desktop-pet-Nw_Pgkk3.js → desktop-pet-BNMRqipe.js} +1 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-DeYbIV7A.js +1 -0
- package/dist/gateway/static/root/assets/{extension-debug-page-BHSst0WN.js → extension-debug-page-COyn05ub.js} +1 -1
- package/dist/gateway/static/root/assets/{extension-page-DXbL4cQZ.js → extension-page-oH43chS2.js} +1 -1
- package/dist/gateway/static/root/assets/extension-settings-page-BMO59994.js +1 -0
- package/dist/gateway/static/root/assets/gateway-config-api-cimpViGk.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-config-swr-826dipyU.js → gateway-config-swr-BGdHwT4e.js} +1 -1
- package/dist/gateway/static/root/assets/gateway-settings-BHJtnSic.js +1 -0
- package/dist/gateway/static/root/assets/{gateway-startup-retry-DyvcAIMm.js → gateway-startup-retry-CuaM3b4c.js} +1 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-DNhrZHqx.js +1 -0
- package/dist/gateway/static/root/assets/home-page-BiHwiBnQ.js +1 -0
- package/dist/gateway/static/root/assets/{image-generation-api-D7cyfks6.js → image-generation-api-D7duj7Uj.js} +1 -1
- package/dist/gateway/static/root/assets/index-DGeGmj4k.css +2 -0
- package/dist/gateway/static/root/assets/index-aBs0EfQB.js +72 -0
- package/dist/gateway/static/root/assets/{keyboard-shortcuts-settings-EY4cu-6W.js → keyboard-shortcuts-settings-D8Zw_lYd.js} +1 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-eBFVWmtH.js +2 -0
- package/dist/gateway/static/root/assets/{local-apps-page-Dh7OxX0S.js → local-apps-page-CvPDPRwb.js} +1 -1
- package/dist/gateway/static/root/assets/{locale-store-CBoCuIMx.js → locale-store-zEL8bkwx.js} +1 -1
- package/dist/gateway/static/root/assets/logs-page-ClvcWlL6.js +2 -0
- package/dist/gateway/static/root/assets/{management-settings-ZjiL3A-S.js → management-settings-D8moh99U.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-split-B4BxkTpU.js → markdown-split-D7V3j0vE.js} +1 -1
- package/dist/gateway/static/root/assets/{markdown-view-BXsHghJd.js → markdown-view-DGRN-8wP.js} +1 -1
- package/dist/gateway/static/root/assets/{media-plugins-D15XBiEo.js → media-plugins-BLaE5b1Y.js} +1 -1
- package/dist/gateway/static/root/assets/messages-W5P19VTF.js +11 -0
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-DiVDuCxl.js +1 -0
- package/dist/gateway/static/root/assets/note-detail-panel-CEEvR-fV.js +5 -0
- package/dist/gateway/static/root/assets/notes-page-BLqgXNCx.js +8 -0
- package/dist/gateway/static/root/assets/page-tabs-BFMGjA60.js +1 -0
- package/dist/gateway/static/root/assets/preview-open-alternatives-DNEWZN7H.js +1 -0
- package/dist/gateway/static/root/assets/{product-open-page-CAJeUXeU.js → product-open-page-Co5u7asH.js} +1 -1
- package/dist/gateway/static/root/assets/project-detail-page-CIiFJ5tk.js +1 -0
- package/dist/gateway/static/root/assets/projects-page-B3UF-Pfm.js +1 -0
- package/dist/gateway/static/root/assets/{registry-api-BhGKnvLP.js → registry-api-Cg92zSod.js} +1 -1
- package/dist/gateway/static/root/assets/remote-access-hub-BUtpkJPG.js +1 -0
- package/dist/gateway/static/root/assets/{runtime-tools-settings-panel-BhKcyEId.js → runtime-tools-settings-panel-C0ByNmlV.js} +2 -2
- package/dist/gateway/static/root/assets/{schema-form-L0s7RWCi.js → schema-form-Dq_VQpuY.js} +1 -1
- package/dist/gateway/static/root/assets/sessions-page-UgJmG-V4.js +1 -0
- package/dist/gateway/static/root/assets/settings-advanced-gate-DDCzpdkl.js +1 -0
- package/dist/gateway/static/root/assets/settings-form-section-CZu6FX4k.js +1 -0
- package/dist/gateway/static/root/assets/{settings-page-CTKoztlF.js → settings-page-S8ekeUZd.js} +1 -1
- package/dist/gateway/static/root/assets/setup-status-panel-BdVmwXMv.js +1 -0
- package/dist/gateway/static/root/assets/{share-preview-page-CiiLLz5A.js → share-preview-page-D2fEidbn.js} +1 -1
- package/dist/gateway/static/root/assets/shares-settings-BdsqnCYj.js +1 -0
- package/dist/gateway/static/root/assets/skill-reload-api-ghzAQKna.js +1 -0
- package/dist/gateway/static/root/assets/skills-page-AYiPlgZE.js +2 -0
- package/dist/gateway/static/root/assets/{skills-page.utils-CwRekJSJ.js → skills-page.utils-DGzl-ib-.js} +1 -1
- package/dist/gateway/static/root/assets/system-settings-panel-5Xd5mIiR.js +1 -0
- package/dist/gateway/static/root/assets/task-detail-page-BQAUaCDD.js +1 -0
- package/dist/gateway/static/root/assets/{theme-store-hybK3oC9.js → theme-store-ZVClZKQ0.js} +1 -1
- package/dist/gateway/static/root/assets/tunnel-api-CdZN1Jin.js +1 -0
- package/dist/gateway/static/root/assets/{use-autosave-DX5YZ3Nn.js → use-autosave-czRI0NBc.js} +1 -1
- package/dist/gateway/static/root/assets/user-model-page-W3GTm6nA.js +2 -0
- package/dist/gateway/static/root/assets/{voice-api-key-field-ocnZbAyi.js → voice-api-key-field-8YEvA3cU.js} +1 -1
- package/dist/gateway/static/root/assets/{voice-config-api-CBbiF1T3.js → voice-config-api-CopF64lY.js} +1 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-keLtqYYJ.js +1 -0
- package/dist/gateway/static/root/assets/{workflow-run-setup-panel-DaErGvxO.js → workflow-run-setup-panel-Dy5WgYMO.js} +2 -2
- package/dist/gateway/static/root/assets/workflows-page-BbAV3h7n.js +5 -0
- package/dist/gateway/static/root/index.html +10 -26
- package/dist/package.js +1 -1
- package/dist/src/agent/agent-instance-gateway.d.ts +2 -2
- package/dist/src/agent/agent-manager.d.ts +4 -4
- package/dist/src/agent/agent-manager.js +31 -15
- package/dist/src/agent/background-review/coordinator.d.ts +2 -4
- package/dist/src/agent/background-review/coordinator.js +5 -30
- package/dist/src/agent/background-review/prompts.d.ts +4 -2
- package/dist/src/agent/background-review/prompts.js +24 -19
- package/dist/src/agent/background-review/run-background-review.d.ts +6 -7
- package/dist/src/agent/background-review/run-background-review.js +47 -41
- package/dist/src/agent/background-review/settings.d.ts +0 -1
- package/dist/src/agent/background-review/settings.js +6 -7
- package/dist/src/agent/commands/command-registry.d.ts +1 -0
- package/dist/src/agent/commands/command-registry.js +12 -22
- package/dist/src/agent/context/audit.d.ts +36 -0
- package/dist/src/agent/context/audit.js +97 -0
- package/dist/src/agent/context/coordinator.d.ts +26 -0
- package/dist/src/agent/context/coordinator.js +72 -0
- package/dist/src/agent/context/execution-context.d.ts +54 -0
- package/dist/src/agent/context/execution-context.js +147 -0
- package/dist/src/agent/context/execution-scope.js +1 -1
- package/dist/src/agent/context/prepend.d.ts +2 -0
- package/dist/src/agent/context/prepend.js +28 -0
- package/dist/src/agent/context/project-context.d.ts +3 -3
- package/dist/src/agent/context/project-context.js +26 -23
- package/dist/src/agent/embedded/index.js +1 -1
- package/dist/src/agent/embedded/run-for-session.js +1 -0
- package/dist/src/agent/embedded/run-turn.js +22 -2
- package/dist/src/agent/embedded/types.d.ts +1 -25
- package/dist/src/agent/external-tools/composio-provider.js +87 -92
- package/dist/src/agent/external-tools/gateway-tools.d.ts +4 -1
- package/dist/src/agent/external-tools/gateway-tools.js +153 -41
- package/dist/src/agent/external-tools/index.js +1 -1
- package/dist/src/agent/external-tools/search-error.d.ts +12 -0
- package/dist/src/agent/external-tools/search-error.js +29 -0
- package/dist/src/agent/external-tools/service.d.ts +4 -0
- package/dist/src/agent/external-tools/service.js +22 -2
- package/dist/src/agent/ipc/inbox.d.ts +8 -31
- package/dist/src/agent/ipc/inbox.js +64 -133
- package/dist/src/agent/memory/compaction-policy.js +1 -1
- package/dist/src/agent/memory/compaction-promotion.js +45 -77
- package/dist/src/agent/memory/create-memory-manager.js +1 -3
- package/dist/src/agent/memory/index.d.ts +0 -5
- package/dist/src/agent/memory/index.js +2 -5
- package/dist/src/agent/memory/manager.d.ts +0 -16
- package/dist/src/agent/memory/manager.js +11 -40
- package/dist/src/agent/memory/memory-config.js +1 -1
- package/dist/src/agent/memory/runtime.d.ts +2 -2
- package/dist/src/agent/memory/runtime.js +9 -19
- package/dist/src/agent/memory/types.d.ts +1 -1
- package/dist/src/agent/orchestration/agent-orchestrator.js +13 -21
- package/dist/src/agent/prompt/sections/memory-skills.js +25 -36
- package/dist/src/agent/prompt/sections/tooling.js +10 -4
- package/dist/src/agent/prompt/service-prompt-builder.js +4 -3
- package/dist/src/agent/service/direct-turn-helpers.js +6 -23
- package/dist/src/agent/service/process-direct-one-shot.js +15 -10
- package/dist/src/agent/service/process-direct-streaming.js +5 -3
- package/dist/src/agent/service.js +4 -3
- package/dist/src/agent/tasks/task-judge-service.js +1 -1
- package/dist/src/agent/tools/clarify-tool.d.ts +1 -0
- package/dist/src/agent/tools/delegate-tool.js +5 -2
- package/dist/src/agent/tools/factory.js +36 -19
- package/dist/src/agent/tools/index.d.ts +3 -2
- package/dist/src/agent/tools/index.js +4 -3
- package/dist/src/agent/tools/knowledge-memory-tool.d.ts +9 -0
- package/dist/src/agent/tools/knowledge-memory-tool.js +129 -0
- package/dist/src/agent/tools/{dreaming-tool.d.ts → memory-maintenance-tool.d.ts} +2 -2
- package/dist/src/agent/tools/memory-maintenance-tool.js +31 -0
- package/dist/src/agent/tools/user-context-tool.d.ts +8 -0
- package/dist/src/agent/tools/user-context-tool.js +81 -0
- package/dist/src/agent/tools/xopc-use-tool.js +2 -2
- package/dist/src/agent/workflow/catalog.d.ts +1 -8
- package/dist/src/agent/workflow/catalog.js +44 -102
- package/dist/src/agent/workflow/index.d.ts +1 -1
- package/dist/src/agent/workflow/index.js +2 -2
- package/dist/src/automations/domain/types.d.ts +1 -0
- package/dist/src/automations/service/action-executor.js +2 -2
- package/dist/src/automations/service/automation-service.js +2 -2
- package/dist/src/channels/manager.d.ts +1 -1
- package/dist/src/channels/manager.js +2 -2
- package/dist/src/channels/outbound/persist-store.d.ts +2 -8
- package/dist/src/channels/outbound/persist-store.js +11 -38
- package/dist/src/channels/outbound-sender.d.ts +1 -1
- package/dist/src/channels/outbound-sender.js +2 -2
- package/dist/src/chat-commands/builtins/understanding.js +24 -6
- package/dist/src/cli/commands/doctor/checks/database-schema.js +1 -1
- package/dist/src/config/schema.d.ts +68 -75
- package/dist/src/config/schema.js +31 -20
- package/dist/src/config/web-patch.d.ts +1 -1
- package/dist/src/connectors/composio-managed-client.js +6 -2
- package/dist/src/connectors/composio-triggers.d.ts +2 -2
- package/dist/src/connectors/composio-triggers.js +8 -15
- package/dist/src/connectors/connected-source-understanding.d.ts +1 -3
- package/dist/src/connectors/connected-source-understanding.js +86 -99
- package/dist/src/connectors/connection-candidates.d.ts +11 -0
- package/dist/src/connectors/connection-candidates.js +58 -0
- package/dist/src/connectors/connection-capabilities.d.ts +4 -0
- package/dist/src/connectors/connection-capabilities.js +37 -0
- package/dist/src/connectors/connection-recovery-service.d.ts +42 -0
- package/dist/src/connectors/connection-recovery-service.js +396 -0
- package/dist/src/connectors/learning-coordinator.d.ts +0 -2
- package/dist/src/connectors/learning-coordinator.js +6 -7
- package/dist/src/connectors/principal.d.ts +5 -0
- package/dist/src/connectors/principal.js +18 -0
- package/dist/src/gateway/agent-builtin-tools.d.ts +28 -10
- package/dist/src/gateway/agent-builtin-tools.js +30 -9
- package/dist/src/gateway/automation-agent-session.js +3 -0
- package/dist/src/gateway/chat-stream/mapper.js +1 -28
- package/dist/src/gateway/chat-stream/protocol.d.ts +2 -24
- package/dist/src/gateway/clarify-bridge.d.ts +4 -0
- package/dist/src/gateway/clarify-bridge.js +9 -4
- package/dist/src/gateway/heartbeat/service.js +1 -1
- package/dist/src/gateway/hono/lib/config-payload.d.ts +52 -30
- package/dist/src/gateway/hono/lib/config-payload.js +4 -4
- package/dist/src/gateway/hono/lib/extension-store.js +8 -25
- package/dist/src/gateway/hono/middleware/auth.js +1 -2
- package/dist/src/gateway/hono/routes/config-patch/misc.d.ts +1 -1
- package/dist/src/gateway/hono/routes/config-patch/misc.js +72 -28
- package/dist/src/gateway/hono/routes/connection-waits.d.ts +3 -0
- package/dist/src/gateway/hono/routes/connection-waits.js +58 -0
- package/dist/src/gateway/hono/routes/connectors.js +4 -12
- package/dist/src/gateway/hono/routes/context-sources.d.ts +4 -0
- package/dist/src/gateway/hono/routes/context-sources.js +159 -0
- package/dist/src/gateway/hono/routes/index.js +4 -2
- package/dist/src/gateway/hono/routes/lazy-bundles.js +9 -4
- package/dist/src/gateway/hono/routes/notes.js +22 -7
- package/dist/src/gateway/hono/routes/projects.js +37 -45
- package/dist/src/gateway/hono/routes/session-input-handler.d.ts +15 -1
- package/dist/src/gateway/hono/routes/side-chats.js +13 -2
- package/dist/src/gateway/hono/routes/tasks.js +2 -2
- package/dist/src/gateway/hono/routes/user-model.d.ts +3 -0
- package/dist/src/gateway/hono/routes/user-model.js +480 -0
- package/dist/src/gateway/hono/routes/workflows.js +2 -2
- package/dist/src/gateway/memory-maintenance-automation-reconciler.d.ts +11 -0
- package/dist/src/gateway/memory-maintenance-automation-reconciler.js +72 -0
- package/dist/src/gateway/service/agent-runner.d.ts +9 -1
- package/dist/src/gateway/service/agent-runner.js +25 -1
- package/dist/src/gateway/service/config-coordinator.d.ts +2 -2
- package/dist/src/gateway/service/config-coordinator.js +4 -4
- package/dist/src/gateway/service/run-gateway-agent.d.ts +1 -0
- package/dist/src/gateway/service/run-gateway-agent.js +18 -14
- package/dist/src/gateway/service/session-input-coordinator.d.ts +3 -0
- package/dist/src/gateway/service/session-input-coordinator.js +12 -2
- package/dist/src/gateway/service.d.ts +3 -1
- package/dist/src/gateway/service.js +49 -19
- package/dist/src/gateway/side-chat/manager.d.ts +16 -3
- package/dist/src/gateway/side-chat/manager.js +117 -28
- package/dist/src/gateway/side-chat/run-service.d.ts +2 -0
- package/dist/src/gateway/side-chat/run-service.js +28 -5
- package/dist/src/gateway/side-chat/types.d.ts +9 -1
- package/dist/src/heartbeat/index.js +1 -1
- package/dist/src/knowledge/connected-knowledge-pipeline.d.ts +0 -2
- package/dist/src/knowledge/connected-knowledge-pipeline.js +46 -217
- package/dist/src/knowledge-memory/domain.d.ts +35 -0
- package/dist/src/knowledge-memory/index.d.ts +2 -0
- package/dist/src/knowledge-memory/index.js +2 -0
- package/dist/src/knowledge-memory/repository.d.ts +45 -0
- package/dist/src/knowledge-memory/repository.js +154 -0
- package/dist/src/memory-maintenance/index.d.ts +2 -0
- package/dist/src/memory-maintenance/index.js +3 -0
- package/dist/src/memory-maintenance/schedule.d.ts +13 -0
- package/dist/src/memory-maintenance/schedule.js +51 -0
- package/dist/src/memory-maintenance/service.d.ts +28 -0
- package/dist/src/memory-maintenance/service.js +216 -0
- package/dist/src/notes/index.d.ts +1 -1
- package/dist/src/notes/index.js +2 -2
- package/dist/src/notes/paths.d.ts +0 -3
- package/dist/src/notes/paths.js +1 -10
- package/dist/src/notes/service.d.ts +1 -1
- package/dist/src/notes/service.js +7 -4
- package/dist/src/notes/store.d.ts +0 -2
- package/dist/src/notes/store.js +33 -80
- package/dist/src/notes/types.d.ts +16 -0
- package/dist/src/proactive/execution/context.d.ts +2 -2
- package/dist/src/proactive/execution/context.js +16 -11
- package/dist/src/proactive/index.d.ts +1 -1
- package/dist/src/proactive/index.js +2 -2
- package/dist/src/projects/index.d.ts +1 -1
- package/dist/src/projects/index.js +2 -2
- package/dist/src/projects/knowledge-bind.d.ts +1 -0
- package/dist/src/projects/knowledge-bind.js +15 -0
- package/dist/src/projects/project-loop.d.ts +3 -3
- package/dist/src/projects/project-loop.js +4 -4
- package/dist/src/projects/project-store.js +2 -1
- package/dist/src/realtime/runtime.js +1 -0
- package/dist/src/runtime-tools/manager.js +1 -1
- package/dist/src/share/hosted-session-share.d.ts +1 -4
- package/dist/src/share/hosted-session-share.js +14 -47
- package/dist/src/share/share-auto.d.ts +1 -1
- package/dist/src/share/share-auto.js +2 -2
- package/dist/src/share/share-store.d.ts +2 -7
- package/dist/src/share/share-store.js +153 -195
- package/dist/src/share/share-types.d.ts +0 -4
- package/dist/src/share/site-share-store.d.ts +3 -8
- package/dist/src/share/site-share-store.js +94 -153
- package/dist/src/share/site-share-types.d.ts +0 -4
- package/dist/src/storage/sqlite/collaboration-rule-repository.d.ts +17 -0
- package/dist/src/storage/sqlite/collaboration-rule-repository.js +54 -0
- package/dist/src/storage/sqlite/connection-wait-repository.d.ts +30 -0
- package/dist/src/storage/sqlite/connection-wait-repository.js +338 -0
- package/dist/src/storage/sqlite/connection.d.ts +1 -2
- package/dist/src/storage/sqlite/connection.js +50 -47
- package/dist/src/storage/sqlite/connector-account-repository.js +1 -1
- package/dist/src/storage/sqlite/context-evidence-repository.d.ts +24 -0
- package/dist/src/storage/sqlite/context-evidence-repository.js +52 -0
- package/dist/src/storage/sqlite/durable-queue.d.ts +16 -0
- package/dist/src/storage/sqlite/durable-queue.js +52 -0
- package/dist/src/storage/sqlite/durable-state.d.ts +16 -0
- package/dist/src/storage/sqlite/durable-state.js +43 -0
- package/dist/src/storage/sqlite/index.d.ts +3 -5
- package/dist/src/storage/sqlite/index.js +4 -6
- package/dist/src/storage/sqlite/knowledge-repository.d.ts +0 -19
- package/dist/src/storage/sqlite/knowledge-repository.js +1 -90
- package/dist/src/storage/sqlite/migrations/146_understanding_focus_exclusions.sql +9 -0
- package/dist/src/storage/sqlite/migrations/147_durable_application_state.sql +39 -0
- package/dist/src/storage/sqlite/migrations/148_user_model_foundation.sql +554 -0
- package/dist/src/storage/sqlite/migrations/149_separate_source_index_from_memory.sql +18 -0
- package/dist/src/storage/sqlite/migrations/150_session_connection_waits.sql +47 -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.d.ts +2 -1
- package/dist/src/storage/sqlite/notes-repository.js +37 -3
- package/dist/src/storage/sqlite/schema.js +1 -1
- package/dist/src/storage/sqlite/session-input-repository.d.ts +14 -2
- package/dist/src/storage/sqlite/session-input-repository.js +16 -13
- package/dist/src/storage/sqlite/session-repository.js +4 -1
- package/dist/src/storage/sqlite/transcript-repository.js +1 -1
- package/dist/src/tasks/index.js +2 -2
- package/dist/src/tasks/project-operating-view-service.js +1 -1
- package/dist/src/tasks/task-application-service.js +6 -1
- package/dist/src/tasks/task-context-assembler.js +1 -1
- package/dist/src/tasks/task-context-repository.d.ts +0 -1
- package/dist/src/tasks/task-context-repository.js +1 -1
- package/dist/src/tasks/task-deletion-service.js +1 -1
- package/dist/src/tasks/task-handoff-service.js +1 -1
- package/dist/src/tasks/task-read-model-projector.js +1 -1
- package/dist/src/tasks/task-run-coordinator.js +1 -1
- package/dist/src/tasks/task-run-dispatcher.js +1 -1
- package/dist/src/tasks/task-run-repository.js +1 -0
- package/dist/src/tasks/task-signal-service.js +1 -1
- package/dist/src/tui/tool-summary.js +2 -1
- package/dist/src/tui/tui-scoped-models.js +9 -6
- package/dist/src/user-context/changes.d.ts +1 -1
- package/dist/src/user-context/config.d.ts +135 -153
- package/dist/src/user-context/config.js +94 -99
- package/dist/src/user-context/relationship-continuity.d.ts +2 -2
- package/dist/src/user-context/relationship-continuity.js +34 -24
- package/dist/src/user-context/sources/activity-clustering.d.ts +9 -3
- package/dist/src/user-context/sources/index.js +2 -2
- package/dist/src/user-context/sources/repository.d.ts +1 -21
- package/dist/src/user-context/sources/repository.js +1 -183
- package/dist/src/user-context/sources/types.d.ts +0 -23
- package/dist/src/user-model/capture/executor.d.ts +40 -0
- package/dist/src/user-model/capture/executor.js +134 -0
- package/dist/src/user-model/capture/index.d.ts +2 -0
- package/dist/src/user-model/capture/index.js +3 -0
- package/dist/src/user-model/capture/semantic.d.ts +21 -0
- package/dist/src/user-model/capture/semantic.js +197 -0
- package/dist/src/user-model/domain.d.ts +93 -0
- package/dist/src/user-model/domain.js +33 -0
- package/dist/src/user-model/goals.d.ts +58 -0
- package/dist/src/user-model/goals.js +89 -0
- package/dist/src/user-model/importance.d.ts +11 -0
- package/dist/src/user-model/importance.js +17 -0
- package/dist/src/user-model/index.d.ts +5 -0
- package/dist/src/user-model/index.js +6 -0
- package/dist/src/user-model/repository.d.ts +23 -0
- package/dist/src/user-model/repository.js +268 -0
- package/dist/src/user-model/temporal.d.ts +10 -0
- package/dist/src/user-model/temporal.js +44 -0
- package/dist/src/voice/realtime/agentEngine.js +63 -18
- package/dist/src/voice/realtime/conversationTurn.d.ts +20 -0
- package/dist/src/voice/realtime/conversationTurn.js +83 -0
- package/dist/src/voice/realtime/memory-context.d.ts +7 -2
- package/dist/src/voice/realtime/memory-context.js +39 -51
- package/dist/src/voice/realtime/omniEngine.js +72 -18
- package/dist/src/work-discovery/service.d.ts +3 -14
- package/dist/src/work-discovery/service.js +138 -99
- package/dist/src/work-discovery/types.d.ts +3 -3
- package/dist/src/workflows/authoring/workflow-draft-store.d.ts +1 -5
- package/dist/src/workflows/authoring/workflow-draft-store.js +23 -43
- package/dist/src/workflows/index.js +2 -2
- package/dist/src/workflows/service/workflow-run-service.js +1 -1
- package/dist/src/workflows/service/workflow-session-bridge.js +12 -20
- package/dist/src/workflows/store/event-store.d.ts +1 -2
- package/dist/src/workflows/store/event-store.js +19 -64
- package/dist/src/workflows/store/paths.d.ts +0 -2
- package/dist/src/workflows/store/paths.js +1 -7
- package/dist/src/workflows/store/run-store.d.ts +0 -1
- package/dist/src/workflows/store/run-store.js +1 -24
- package/package.json +3 -3
- package/dist/gateway/static/root/assets/agent-defaults-settings-panel-eG49pM-z.js +0 -1
- package/dist/gateway/static/root/assets/agents-CZwf1mgZ.js +0 -1
- package/dist/gateway/static/root/assets/app-management-settings-panel-BODskFTb.js +0 -1
- package/dist/gateway/static/root/assets/appearance-settings-DeaVvaYZ.js +0 -1
- package/dist/gateway/static/root/assets/apps-page-BZG3BK7f.js +0 -1
- package/dist/gateway/static/root/assets/automations-workspace-CB7Yl2_B.js +0 -6
- package/dist/gateway/static/root/assets/browser-settings-page-Bu42Ljfw.js +0 -8
- package/dist/gateway/static/root/assets/capabilities-settings-panel-Cg7zCxEH.js +0 -7
- package/dist/gateway/static/root/assets/channels-settings-EDTZ8P3y.js +0 -1
- package/dist/gateway/static/root/assets/cloud-C4-yfnnk.js +0 -1
- package/dist/gateway/static/root/assets/connectors-page-kh7PEkSS.js +0 -2
- package/dist/gateway/static/root/assets/dependency-picker-oi7cdv2C.js +0 -1
- package/dist/gateway/static/root/assets/desktop-pet-settings-D9OO-exo.js +0 -1
- package/dist/gateway/static/root/assets/ellipsis-0k4rZLoy.js +0 -1
- package/dist/gateway/static/root/assets/extension-settings-page-FTD7nE8v.js +0 -1
- package/dist/gateway/static/root/assets/eye-CABVeTq0.js +0 -1
- package/dist/gateway/static/root/assets/eye-off-DEAzt3g1.js +0 -1
- package/dist/gateway/static/root/assets/folder-open-CyzJ19I9.js +0 -1
- package/dist/gateway/static/root/assets/form-field-width-DJw_jULe.js +0 -1
- package/dist/gateway/static/root/assets/gateway-config-api-c-8ENciH.js +0 -1
- package/dist/gateway/static/root/assets/gateway-settings-BxvyTRl0.js +0 -1
- package/dist/gateway/static/root/assets/heartbeat-settings-C1S2Ccui.js +0 -1
- package/dist/gateway/static/root/assets/home-page-Bqx-SMWV.js +0 -1
- package/dist/gateway/static/root/assets/index-Cif1_3Jx.js +0 -71
- package/dist/gateway/static/root/assets/index-Dbh5SXyV.css +0 -2
- package/dist/gateway/static/root/assets/interaction-BmQogeqz.js +0 -1
- package/dist/gateway/static/root/assets/is-masked-secret-DOkL5b_X.js +0 -1
- package/dist/gateway/static/root/assets/link-2-D_ZKYUW7.js +0 -1
- package/dist/gateway/static/root/assets/local-app-workbench-page-sDdw7Y3Q.js +0 -2
- package/dist/gateway/static/root/assets/logs-page-DUsxXdDp.js +0 -2
- package/dist/gateway/static/root/assets/message-square-plus-XP0tGdlV.js +0 -1
- package/dist/gateway/static/root/assets/messages-BbdwoxVo.js +0 -3
- package/dist/gateway/static/root/assets/minimize-2-DtOGrlpo.js +0 -1
- package/dist/gateway/static/root/assets/mobile-pairing-wizard-Dv87XewB.js +0 -1
- package/dist/gateway/static/root/assets/models-hub-cache-88f4fzYS.js +0 -1
- package/dist/gateway/static/root/assets/notes-page-DOe0lOcQ.js +0 -1
- package/dist/gateway/static/root/assets/notes-workbench-Cy0oYbWP.js +0 -4
- package/dist/gateway/static/root/assets/oauth-api-BjSUDIgq.js +0 -1
- package/dist/gateway/static/root/assets/oauth-authorization-window-Cdolr2wE.js +0 -1
- package/dist/gateway/static/root/assets/page-tabs-BaEQMYm_.js +0 -1
- package/dist/gateway/static/root/assets/pencil-DmIY3Oa-.js +0 -1
- package/dist/gateway/static/root/assets/preview-open-alternatives-CsNVTKC0.js +0 -1
- package/dist/gateway/static/root/assets/project-detail-page-fgD1xc4O.js +0 -1
- package/dist/gateway/static/root/assets/projects-page-CiTiEcOc.js +0 -1
- package/dist/gateway/static/root/assets/remote-access-hub-Dc0GrNSp.js +0 -1
- package/dist/gateway/static/root/assets/rotate-cw-LIg3Am9S.js +0 -1
- package/dist/gateway/static/root/assets/search-DA7gz22f.js +0 -1
- package/dist/gateway/static/root/assets/sessions-page-BPOW3yaM.js +0 -1
- package/dist/gateway/static/root/assets/settings-advanced-gate-Bz4s9BBY.js +0 -1
- package/dist/gateway/static/root/assets/settings-form-section-DjWzRk4z.js +0 -1
- package/dist/gateway/static/root/assets/setup-status-panel-rllj-j7k.js +0 -1
- package/dist/gateway/static/root/assets/shares-settings-DMj7onCX.js +0 -1
- package/dist/gateway/static/root/assets/skill-reload-api-DRB366nS.js +0 -1
- package/dist/gateway/static/root/assets/skills-page-cBT9jCof.js +0 -2
- package/dist/gateway/static/root/assets/system-settings-panel-Byrk4DQy.js +0 -1
- package/dist/gateway/static/root/assets/task-detail-page-CheX3zmK.js +0 -1
- package/dist/gateway/static/root/assets/tunnel-api-jKzujxFU.js +0 -1
- package/dist/gateway/static/root/assets/user-context-page-CWy3Pqtk.js +0 -1
- package/dist/gateway/static/root/assets/work-discovery-overlay-DE4_YpDn.js +0 -1
- package/dist/gateway/static/root/assets/workflows-page-y4O9-BTf.js +0 -5
- package/dist/src/agent/memory/builtin-provider.d.ts +0 -37
- package/dist/src/agent/memory/builtin-provider.js +0 -225
- package/dist/src/agent/memory/context/types.d.ts +0 -40
- package/dist/src/agent/memory/understanding/quality.d.ts +0 -8
- package/dist/src/agent/memory/understanding/quality.js +0 -18
- package/dist/src/agent/memory/understanding/service.d.ts +0 -19
- package/dist/src/agent/memory/understanding/service.js +0 -209
- package/dist/src/agent/memory/understanding/types.d.ts +0 -34
- package/dist/src/agent/memory/understanding/types.js +0 -1
- package/dist/src/agent/memory/user-context-coordinator.d.ts +0 -23
- package/dist/src/agent/memory/user-context-coordinator.js +0 -113
- package/dist/src/agent/tools/dreaming-tool.js +0 -37
- package/dist/src/agent/tools/memory-tool.d.ts +0 -9
- package/dist/src/agent/tools/memory-tool.js +0 -119
- package/dist/src/gateway/dreaming-automation-reconciler.d.ts +0 -11
- package/dist/src/gateway/dreaming-automation-reconciler.js +0 -63
- package/dist/src/gateway/hono/routes/understanding-sources.d.ts +0 -21
- package/dist/src/gateway/hono/routes/understanding-sources.js +0 -387
- package/dist/src/gateway/hono/routes/you.d.ts +0 -3
- package/dist/src/gateway/hono/routes/you.js +0 -443
- package/dist/src/projects/memory-bind.d.ts +0 -1
- package/dist/src/projects/memory-bind.js +0 -14
- package/dist/src/storage/sqlite/context-consolidation-repository.d.ts +0 -37
- package/dist/src/storage/sqlite/context-consolidation-repository.js +0 -64
- package/dist/src/storage/sqlite/memory-records-repository.d.ts +0 -217
- package/dist/src/storage/sqlite/memory-records-repository.js +0 -715
- package/dist/src/storage/sqlite/remote-context-repository.d.ts +0 -3
- package/dist/src/storage/sqlite/remote-context-repository.js +0 -40
- package/dist/src/storage/sqlite/user-context-quality-repository.d.ts +0 -49
- package/dist/src/storage/sqlite/user-context-quality-repository.js +0 -118
- package/dist/src/storage/sqlite/user-context-repository.d.ts +0 -85
- package/dist/src/storage/sqlite/user-context-repository.js +0 -535
- package/dist/src/user-context/automatic-context.d.ts +0 -17
- package/dist/src/user-context/automatic-context.js +0 -85
- package/dist/src/user-context/consolidation.d.ts +0 -27
- package/dist/src/user-context/consolidation.js +0 -187
- package/dist/src/user-context/context-objects.d.ts +0 -17
- package/dist/src/user-context/context-objects.js +0 -99
- package/dist/src/user-context/evaluation/harness.d.ts +0 -13
- package/dist/src/user-context/evaluation/harness.js +0 -31
- package/dist/src/user-context/extraction/executor.d.ts +0 -22
- package/dist/src/user-context/extraction/executor.js +0 -142
- package/dist/src/user-context/extraction/repair.d.ts +0 -19
- package/dist/src/user-context/extraction/repair.js +0 -71
- package/dist/src/user-context/extraction/semantic.d.ts +0 -18
- package/dist/src/user-context/extraction/semantic.js +0 -148
- package/dist/src/user-context/focus-lifecycle.d.ts +0 -2
- package/dist/src/user-context/focus-lifecycle.js +0 -26
- package/dist/src/user-context/manual-understanding.d.ts +0 -12
- package/dist/src/user-context/manual-understanding.js +0 -37
- package/dist/src/user-context/planner.d.ts +0 -17
- package/dist/src/user-context/planner.js +0 -465
- package/dist/src/user-context/relationships/indexer.d.ts +0 -13
- package/dist/src/user-context/relationships/indexer.js +0 -185
- package/dist/src/user-context/relationships/service.d.ts +0 -22
- package/dist/src/user-context/relationships/service.js +0 -50
- package/dist/src/user-context/retriever.d.ts +0 -15
- package/dist/src/user-context/retriever.js +0 -124
- package/dist/src/user-context/scope.d.ts +0 -7
- package/dist/src/user-context/scope.js +0 -9
- package/dist/src/user-context/selection-policy.d.ts +0 -20
- package/dist/src/user-context/selection-policy.js +0 -33
- package/dist/src/user-context/understanding.d.ts +0 -15
- package/dist/src/user-context/understanding.js +0 -24
- package/dist/src/user-context/understandingQuality.d.ts +0 -5
- package/dist/src/user-context/understandingQuality.js +0 -48
- /package/dist/src/{agent/memory/context/types.js → knowledge-memory/domain.js} +0 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { getKnowledgeItem, searchKnowledgeItems, writeKnowledgeItem } from "../../knowledge-memory/repository.js";
|
|
2
|
+
import "../../knowledge-memory/index.js";
|
|
3
|
+
import { Type } from "@sinclair/typebox";
|
|
4
|
+
//#region src/agent/tools/knowledge-memory-tool.ts
|
|
5
|
+
const SearchSchema = Type.Object({
|
|
6
|
+
query: Type.String(),
|
|
7
|
+
maxResults: Type.Optional(Type.Integer({
|
|
8
|
+
minimum: 1,
|
|
9
|
+
maximum: 50
|
|
10
|
+
}))
|
|
11
|
+
});
|
|
12
|
+
const GetSchema = Type.Object({ id: Type.String() });
|
|
13
|
+
const WriteSchema = Type.Object({
|
|
14
|
+
kind: Type.Union([
|
|
15
|
+
Type.Literal("project_fact"),
|
|
16
|
+
Type.Literal("workspace_fact"),
|
|
17
|
+
Type.Literal("decision"),
|
|
18
|
+
Type.Literal("task_lesson"),
|
|
19
|
+
Type.Literal("commitment"),
|
|
20
|
+
Type.Literal("open_question"),
|
|
21
|
+
Type.Literal("episode"),
|
|
22
|
+
Type.Literal("note")
|
|
23
|
+
]),
|
|
24
|
+
content: Type.String(),
|
|
25
|
+
canonicalKey: Type.String(),
|
|
26
|
+
scope: Type.Union([Type.Literal("workspace"), Type.Literal("session")]),
|
|
27
|
+
importance: Type.Optional(Type.Number({
|
|
28
|
+
minimum: 0,
|
|
29
|
+
maximum: 1
|
|
30
|
+
}))
|
|
31
|
+
});
|
|
32
|
+
function visibility(options) {
|
|
33
|
+
return {
|
|
34
|
+
agentId: options.agentId,
|
|
35
|
+
workspaceId: options.workspaceId,
|
|
36
|
+
sessionId: options.getSessionId() ?? ""
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function createKnowledgeSearchTool(options) {
|
|
40
|
+
return {
|
|
41
|
+
name: "knowledge_search",
|
|
42
|
+
label: "Knowledge Search",
|
|
43
|
+
description: "Search project, workspace, and session knowledge for prior decisions, facts, lessons, and commitments.",
|
|
44
|
+
parameters: SearchSchema,
|
|
45
|
+
async execute(_toolCallId, raw) {
|
|
46
|
+
const input = raw;
|
|
47
|
+
const results = searchKnowledgeItems({
|
|
48
|
+
query: input.query,
|
|
49
|
+
context: visibility(options),
|
|
50
|
+
limit: input.maxResults ?? 12
|
|
51
|
+
});
|
|
52
|
+
return {
|
|
53
|
+
content: [{
|
|
54
|
+
type: "text",
|
|
55
|
+
text: JSON.stringify({ results }, null, 2)
|
|
56
|
+
}],
|
|
57
|
+
details: { results }
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
function visibleItem(options, item) {
|
|
63
|
+
return item.scope.type === "global" || item.scope.type === "agent" && item.scope.id === options.agentId || item.scope.type === "workspace" && item.scope.id === options.workspaceId || item.scope.type === "session" && item.scope.id === options.getSessionId();
|
|
64
|
+
}
|
|
65
|
+
function createKnowledgeGetTool(options) {
|
|
66
|
+
return {
|
|
67
|
+
name: "knowledge_get",
|
|
68
|
+
label: "Knowledge Get",
|
|
69
|
+
description: "Read one knowledge item returned by knowledge_search.",
|
|
70
|
+
parameters: GetSchema,
|
|
71
|
+
async execute(_toolCallId, raw) {
|
|
72
|
+
const id = raw.id;
|
|
73
|
+
const item = getKnowledgeItem(id);
|
|
74
|
+
return item && visibleItem(options, item) ? {
|
|
75
|
+
content: [{
|
|
76
|
+
type: "text",
|
|
77
|
+
text: JSON.stringify(item, null, 2)
|
|
78
|
+
}],
|
|
79
|
+
details: { item }
|
|
80
|
+
} : {
|
|
81
|
+
content: [{
|
|
82
|
+
type: "text",
|
|
83
|
+
text: `Knowledge item not found: ${id}`
|
|
84
|
+
}],
|
|
85
|
+
details: { id }
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
function createKnowledgeWriteTool(options) {
|
|
91
|
+
return {
|
|
92
|
+
name: "knowledge_write",
|
|
93
|
+
label: "Knowledge Write",
|
|
94
|
+
description: "Store a scoped knowledge candidate with provenance for later review and retrieval.",
|
|
95
|
+
parameters: WriteSchema,
|
|
96
|
+
async execute(_toolCallId, raw) {
|
|
97
|
+
const input = raw;
|
|
98
|
+
const sessionId = options.getSessionId();
|
|
99
|
+
if (input.scope === "session" && !sessionId) throw new Error("A current session is required for session knowledge.");
|
|
100
|
+
const result = writeKnowledgeItem({
|
|
101
|
+
kind: input.kind,
|
|
102
|
+
scope: input.scope === "workspace" ? {
|
|
103
|
+
type: "workspace",
|
|
104
|
+
id: options.workspaceId
|
|
105
|
+
} : {
|
|
106
|
+
type: "session",
|
|
107
|
+
id: sessionId
|
|
108
|
+
},
|
|
109
|
+
content: input.content,
|
|
110
|
+
canonicalKey: input.canonicalKey,
|
|
111
|
+
confidence: .7,
|
|
112
|
+
importance: input.importance ?? .5,
|
|
113
|
+
originClass: "agent",
|
|
114
|
+
sourceAgentId: options.agentId,
|
|
115
|
+
...sessionId ? { sourceSessionId: sessionId } : {},
|
|
116
|
+
source: { tool: "knowledge_write" }
|
|
117
|
+
});
|
|
118
|
+
return {
|
|
119
|
+
content: [{
|
|
120
|
+
type: "text",
|
|
121
|
+
text: JSON.stringify(result, null, 2)
|
|
122
|
+
}],
|
|
123
|
+
details: result
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { createKnowledgeGetTool, createKnowledgeSearchTool, createKnowledgeWriteTool };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
2
|
import type { Config } from '../../config/schema.js';
|
|
3
|
-
export interface
|
|
3
|
+
export interface MemoryMaintenanceToolDeps {
|
|
4
4
|
getConfig: () => Config | undefined;
|
|
5
5
|
}
|
|
6
|
-
export declare function
|
|
6
|
+
export declare function createMemoryMaintenanceTool(deps: MemoryMaintenanceToolDeps): AgentTool;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { resolveMemoryMaintenanceSchedules } from "../../memory-maintenance/schedule.js";
|
|
2
|
+
import { listMemoryMaintenanceRuns } from "../../memory-maintenance/service.js";
|
|
3
|
+
import "../../memory-maintenance/index.js";
|
|
4
|
+
import { Type } from "@sinclair/typebox";
|
|
5
|
+
//#region src/agent/tools/memory-maintenance-tool.ts
|
|
6
|
+
const StatusSchema = Type.Object({ action: Type.Literal("status") });
|
|
7
|
+
function createMemoryMaintenanceTool(deps) {
|
|
8
|
+
return {
|
|
9
|
+
name: "memory_maintenance",
|
|
10
|
+
label: "Memory maintenance",
|
|
11
|
+
description: "Show deterministic user-model and knowledge-memory maintenance schedules and runs.",
|
|
12
|
+
parameters: StatusSchema,
|
|
13
|
+
async execute() {
|
|
14
|
+
const config = deps.getConfig();
|
|
15
|
+
return {
|
|
16
|
+
content: [{
|
|
17
|
+
type: "text",
|
|
18
|
+
text: JSON.stringify({
|
|
19
|
+
enabled: Boolean(config && resolveMemoryMaintenanceSchedules(config).length),
|
|
20
|
+
schedules: config ? resolveMemoryMaintenanceSchedules(config) : [],
|
|
21
|
+
policy: "deterministic",
|
|
22
|
+
recentRuns: listMemoryMaintenanceRuns(20)
|
|
23
|
+
}, null, 2)
|
|
24
|
+
}],
|
|
25
|
+
details: {}
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { createMemoryMaintenanceTool };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { AgentTool } from '@earendil-works/pi-agent-core';
|
|
2
|
+
export interface UserContextToolOptions {
|
|
3
|
+
agentId: string;
|
|
4
|
+
workspaceId: string;
|
|
5
|
+
getSessionId: () => string | undefined;
|
|
6
|
+
}
|
|
7
|
+
export declare function createUserContextSearchTool(options: UserContextToolOptions): AgentTool;
|
|
8
|
+
export declare function createUserContextGetTool(options: UserContextToolOptions): AgentTool;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { retrievalLexicalSimilarity } from "../../retrieval/textFeatures.js";
|
|
2
|
+
import { getAssertionSlot, getUserAssertion, listUserAssertions } from "../../user-model/repository.js";
|
|
3
|
+
import "../../user-model/index.js";
|
|
4
|
+
import { Type } from "@sinclair/typebox";
|
|
5
|
+
//#region src/agent/tools/user-context-tool.ts
|
|
6
|
+
const SearchSchema = Type.Object({
|
|
7
|
+
query: Type.String(),
|
|
8
|
+
maxResults: Type.Optional(Type.Integer({
|
|
9
|
+
minimum: 1,
|
|
10
|
+
maximum: 50
|
|
11
|
+
}))
|
|
12
|
+
});
|
|
13
|
+
const GetSchema = Type.Object({ id: Type.String() });
|
|
14
|
+
function visible(options, slotId) {
|
|
15
|
+
const scope = getAssertionSlot(slotId)?.scope;
|
|
16
|
+
return scope?.type === "global" || scope?.type === "agent" && scope.id === options.agentId || scope?.type === "workspace" && scope.id === options.workspaceId || scope?.type === "session" && scope.id === options.getSessionId();
|
|
17
|
+
}
|
|
18
|
+
function createUserContextSearchTool(options) {
|
|
19
|
+
return {
|
|
20
|
+
name: "user_context_search",
|
|
21
|
+
label: "User Context Search",
|
|
22
|
+
description: "Search typed user assertions such as identity, preferences, routines, and current state.",
|
|
23
|
+
parameters: SearchSchema,
|
|
24
|
+
async execute(_toolCallId, raw) {
|
|
25
|
+
const input = raw;
|
|
26
|
+
const results = listUserAssertions({
|
|
27
|
+
statuses: ["active", "needs_review"],
|
|
28
|
+
limit: 1e3
|
|
29
|
+
}).filter((assertion) => visible(options, assertion.slotId)).map((assertion) => ({
|
|
30
|
+
assertion,
|
|
31
|
+
score: retrievalLexicalSimilarity(input.query, `${assertion.statement} ${assertion.normalizedValue}`)
|
|
32
|
+
})).filter((item) => item.score > 0).sort((left, right) => right.score - left.score).slice(0, input.maxResults ?? 12).map(({ assertion, score }) => ({
|
|
33
|
+
id: assertion.id,
|
|
34
|
+
kind: assertion.kind,
|
|
35
|
+
statement: assertion.statement,
|
|
36
|
+
status: assertion.status,
|
|
37
|
+
authority: assertion.authority,
|
|
38
|
+
score
|
|
39
|
+
}));
|
|
40
|
+
return {
|
|
41
|
+
content: [{
|
|
42
|
+
type: "text",
|
|
43
|
+
text: JSON.stringify({ results }, null, 2)
|
|
44
|
+
}],
|
|
45
|
+
details: { results }
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function createUserContextGetTool(options) {
|
|
51
|
+
return {
|
|
52
|
+
name: "user_context_get",
|
|
53
|
+
label: "User Context Get",
|
|
54
|
+
description: "Read one typed user assertion and its subject, predicate, and scope.",
|
|
55
|
+
parameters: GetSchema,
|
|
56
|
+
async execute(_toolCallId, raw) {
|
|
57
|
+
const id = raw.id;
|
|
58
|
+
const assertion = getUserAssertion(id);
|
|
59
|
+
if (!assertion || !visible(options, assertion.slotId)) return {
|
|
60
|
+
content: [{
|
|
61
|
+
type: "text",
|
|
62
|
+
text: `User assertion not found: ${id}`
|
|
63
|
+
}],
|
|
64
|
+
details: { id }
|
|
65
|
+
};
|
|
66
|
+
const result = {
|
|
67
|
+
assertion,
|
|
68
|
+
slot: getAssertionSlot(assertion.slotId)
|
|
69
|
+
};
|
|
70
|
+
return {
|
|
71
|
+
content: [{
|
|
72
|
+
type: "text",
|
|
73
|
+
text: JSON.stringify(result, null, 2)
|
|
74
|
+
}],
|
|
75
|
+
details: result
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { createUserContextGetTool, createUserContextSearchTool };
|
|
@@ -2,14 +2,14 @@ import { runWithActivityContext } from "../../activity/context.js";
|
|
|
2
2
|
import { runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
3
3
|
import { TaskCommandSchema, TaskContextInputSchema } from "../../../packages/gateway-contract/src/tasks.js";
|
|
4
4
|
import { appendProductDeliveryText } from "../../../packages/gateway-contract/src/product-delivery.js";
|
|
5
|
+
import { enqueueTaskChangedEvent } from "../../tasks/task-change-events.js";
|
|
6
|
+
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
5
7
|
import { getSessionMetadata } from "../../storage/sqlite/session-repository.js";
|
|
6
8
|
import "../../storage/sqlite/index.js";
|
|
7
9
|
import { ObjectLinkService } from "../../activity/service.js";
|
|
8
10
|
import "../../activity/index.js";
|
|
9
11
|
import { getDefaultAgentId, init_resolve_route } from "../../routing/resolve-route.js";
|
|
10
12
|
import { TaskRepository } from "../../tasks/task-repository.js";
|
|
11
|
-
import { enqueueTaskChangedEvent } from "../../tasks/task-change-events.js";
|
|
12
|
-
import { TaskRunRepository } from "../../tasks/task-run-repository.js";
|
|
13
13
|
import { TaskReadModelProjector } from "../../tasks/task-read-model-projector.js";
|
|
14
14
|
import { isValidProjectAgentId, normalizeProjectAgentId, resolveProjectAgentId } from "../../projects/project-agent.js";
|
|
15
15
|
import "../../projects/index.js";
|
|
@@ -3,7 +3,6 @@ export type WorkflowSource = 'user' | 'builtin';
|
|
|
3
3
|
export interface CatalogEntry {
|
|
4
4
|
name: string;
|
|
5
5
|
source: WorkflowSource;
|
|
6
|
-
path: string | null;
|
|
7
6
|
description: string;
|
|
8
7
|
title: string;
|
|
9
8
|
version: string;
|
|
@@ -32,21 +31,16 @@ export interface WorkflowCatalog {
|
|
|
32
31
|
list(): CatalogEntry[];
|
|
33
32
|
load(name: string): WorkflowDefinition;
|
|
34
33
|
save(input: SaveWorkflowInput): {
|
|
35
|
-
path: string;
|
|
36
34
|
definition: WorkflowDefinition;
|
|
37
35
|
};
|
|
38
36
|
listRevisions(name: string): WorkflowRevisionSummary[];
|
|
39
37
|
loadRevision(name: string, revision: number): WorkflowDefinition;
|
|
40
38
|
restore(name: string, revision: number, expectedRevision: number): {
|
|
41
|
-
path: string;
|
|
42
39
|
definition: WorkflowDefinition;
|
|
43
40
|
};
|
|
44
41
|
remove(name: string): boolean;
|
|
45
|
-
userDir: string;
|
|
46
42
|
}
|
|
47
|
-
export declare function createWorkflowCatalog(
|
|
48
|
-
userDir?: string;
|
|
49
|
-
}): WorkflowCatalog;
|
|
43
|
+
export declare function createWorkflowCatalog(): WorkflowCatalog;
|
|
50
44
|
export declare class WorkflowRevisionConflictError extends Error {
|
|
51
45
|
readonly currentRevision: number;
|
|
52
46
|
constructor(currentRevision: number);
|
|
@@ -56,4 +50,3 @@ export declare class WorkflowNameConflictError extends Error {
|
|
|
56
50
|
readonly currentRevision: number;
|
|
57
51
|
constructor(workflowName: string, currentRevision: number);
|
|
58
52
|
}
|
|
59
|
-
export declare function defaultUserDir(): string;
|
|
@@ -1,36 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { requireXopcDatabase } from "../../storage/sqlite/connection.js";
|
|
2
|
+
import { runSqliteWriteTransaction } from "../../storage/sqlite/transaction.js";
|
|
3
|
+
import { DurableState } from "../../storage/sqlite/durable-state.js";
|
|
2
4
|
import { buildWorkflowDefinition } from "../../workflows/domain/definition-utils.js";
|
|
3
5
|
import { validateWorkflowGraph } from "../../workflows/domain/validation.js";
|
|
4
6
|
import { BUILTIN_WORKFLOWS } from "./builtins/index.js";
|
|
5
|
-
import { join } from "node:path";
|
|
6
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
7
|
-
import { randomUUID } from "node:crypto";
|
|
8
7
|
//#region src/agent/workflow/catalog.ts
|
|
9
|
-
init_paths_state();
|
|
10
8
|
const NAME_RE = /^[a-z][a-z0-9_-]*$/;
|
|
11
|
-
function createWorkflowCatalog(
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
if (!existsSync(path)) return null;
|
|
16
|
-
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
17
|
-
assertStoredDefinition(parsed, name, path);
|
|
18
|
-
return parsed;
|
|
19
|
-
};
|
|
9
|
+
function createWorkflowCatalog() {
|
|
10
|
+
const definitions = new DurableState("workflow-definitions");
|
|
11
|
+
const revisions = (name) => new DurableState("workflow-revisions", name);
|
|
12
|
+
const loadUser = (name) => definitions.get(name) ?? null;
|
|
20
13
|
const list = () => {
|
|
21
|
-
const
|
|
22
|
-
for (const definition of
|
|
23
|
-
|
|
24
|
-
path: null
|
|
25
|
-
});
|
|
26
|
-
for (const name of listUserNames(userDir)) try {
|
|
27
|
-
const definition = loadUser(name);
|
|
28
|
-
if (definition) definitions.set(name, {
|
|
29
|
-
definition,
|
|
30
|
-
path: join(userDir, `${name}.json`)
|
|
31
|
-
});
|
|
32
|
-
} catch {}
|
|
33
|
-
return [...definitions.values()].map(({ definition, path }) => toCatalogEntry(definition, path)).sort((left, right) => left.name.localeCompare(right.name));
|
|
14
|
+
const items = new Map(BUILTIN_WORKFLOWS.map((definition) => [definition.name, definition]));
|
|
15
|
+
for (const definition of definitions.values()) items.set(definition.name, definition);
|
|
16
|
+
return [...items.values()].map(toCatalogEntry).sort((a, b) => a.name.localeCompare(b.name));
|
|
34
17
|
};
|
|
35
18
|
const load = (name) => {
|
|
36
19
|
requireValidName(name);
|
|
@@ -45,56 +28,40 @@ function createWorkflowCatalog(opts = {}) {
|
|
|
45
28
|
requireValidName(name);
|
|
46
29
|
const validation = validateWorkflowGraph(input.graph);
|
|
47
30
|
if (!validation.valid) throw new Error(validation.errors.map((issue) => issue.message).join(" "));
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
31
|
+
requireXopcDatabase();
|
|
32
|
+
return runSqliteWriteTransaction(() => {
|
|
33
|
+
const existing = loadUser(name);
|
|
34
|
+
const builtin = BUILTIN_WORKFLOWS.find((definition) => definition.name === name);
|
|
35
|
+
if (input.intent === "create" && (existing || builtin)) throw new WorkflowNameConflictError(name, existing?.revision ?? builtin?.revision ?? 0);
|
|
36
|
+
if (input.expectedRevision !== void 0 && input.expectedRevision !== (existing?.revision ?? 0)) throw new WorkflowRevisionConflictError(existing?.revision ?? 0);
|
|
37
|
+
const definition = buildWorkflowDefinition({
|
|
38
|
+
name,
|
|
39
|
+
source: "user",
|
|
40
|
+
graph: input.graph,
|
|
41
|
+
manifest: input.manifest,
|
|
42
|
+
revision: (existing?.revision ?? 0) + 1,
|
|
43
|
+
createdAtMs: existing?.metadata.createdAtMs
|
|
44
|
+
});
|
|
45
|
+
revisions(name).set(String(definition.revision), definition);
|
|
46
|
+
definitions.set(name, definition);
|
|
47
|
+
return { definition };
|
|
59
48
|
});
|
|
60
|
-
if (!existsSync(userDir)) mkdirSync(userDir, { recursive: true });
|
|
61
|
-
const path = join(userDir, `${name}.json`);
|
|
62
|
-
const revisionsDir = join(userDir, ".revisions", name);
|
|
63
|
-
mkdirSync(revisionsDir, { recursive: true });
|
|
64
|
-
writeJsonAtomic(join(revisionsDir, `${definition.revision}.json`), definition);
|
|
65
|
-
writeJsonAtomic(path, definition);
|
|
66
|
-
return {
|
|
67
|
-
path,
|
|
68
|
-
definition
|
|
69
|
-
};
|
|
70
49
|
};
|
|
71
50
|
const listRevisions = (name) => {
|
|
72
51
|
requireValidName(name);
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
return {
|
|
80
|
-
revision: definition.revision,
|
|
81
|
-
title: definition.title,
|
|
82
|
-
contentHash: definition.contentHash,
|
|
83
|
-
createdAtMs: definition.metadata.updatedAtMs
|
|
84
|
-
};
|
|
85
|
-
} catch {
|
|
86
|
-
return null;
|
|
87
|
-
}
|
|
88
|
-
}).filter((item) => item !== null).sort((left, right) => right.revision - left.revision);
|
|
52
|
+
return revisions(name).values().map((definition) => ({
|
|
53
|
+
revision: definition.revision,
|
|
54
|
+
title: definition.title,
|
|
55
|
+
contentHash: definition.contentHash,
|
|
56
|
+
createdAtMs: definition.metadata.updatedAtMs
|
|
57
|
+
})).sort((a, b) => b.revision - a.revision);
|
|
89
58
|
};
|
|
90
59
|
const loadRevision = (name, revision) => {
|
|
91
60
|
requireValidName(name);
|
|
92
61
|
if (!Number.isSafeInteger(revision) || revision < 1) throw new Error("invalid workflow revision");
|
|
93
|
-
const
|
|
94
|
-
if (!
|
|
95
|
-
|
|
96
|
-
assertStoredDefinition(definition, name, path);
|
|
97
|
-
return structuredClone(definition);
|
|
62
|
+
const definition = revisions(name).get(String(revision));
|
|
63
|
+
if (!definition) throw new Error(`workflow revision not found: ${name}@${revision}`);
|
|
64
|
+
return definition;
|
|
98
65
|
};
|
|
99
66
|
const restore = (name, revision, expectedRevision) => {
|
|
100
67
|
const selected = loadRevision(name, revision);
|
|
@@ -107,15 +74,12 @@ function createWorkflowCatalog(opts = {}) {
|
|
|
107
74
|
};
|
|
108
75
|
const remove = (name) => {
|
|
109
76
|
requireValidName(name);
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
recursive: true,
|
|
116
|
-
force: true
|
|
77
|
+
requireXopcDatabase();
|
|
78
|
+
return runSqliteWriteTransaction(() => {
|
|
79
|
+
const deleted = definitions.delete(name);
|
|
80
|
+
for (const [key] of revisions(name).entries()) revisions(name).delete(key);
|
|
81
|
+
return deleted;
|
|
117
82
|
});
|
|
118
|
-
return true;
|
|
119
83
|
};
|
|
120
84
|
return {
|
|
121
85
|
list,
|
|
@@ -124,8 +88,7 @@ function createWorkflowCatalog(opts = {}) {
|
|
|
124
88
|
listRevisions,
|
|
125
89
|
loadRevision,
|
|
126
90
|
restore,
|
|
127
|
-
remove
|
|
128
|
-
userDir
|
|
91
|
+
remove
|
|
129
92
|
};
|
|
130
93
|
}
|
|
131
94
|
var WorkflowRevisionConflictError = class extends Error {
|
|
@@ -143,26 +106,10 @@ var WorkflowNameConflictError = class extends Error {
|
|
|
143
106
|
this.name = "WorkflowNameConflictError";
|
|
144
107
|
}
|
|
145
108
|
};
|
|
146
|
-
function
|
|
147
|
-
return join(resolveStateDir(), "workflows");
|
|
148
|
-
}
|
|
149
|
-
function listUserNames(dir) {
|
|
150
|
-
try {
|
|
151
|
-
if (!existsSync(dir) || !statSync(dir).isDirectory()) return [];
|
|
152
|
-
return readdirSync(dir).filter((file) => file.endsWith(".json")).map((file) => file.slice(0, -5)).filter((name) => NAME_RE.test(name));
|
|
153
|
-
} catch {
|
|
154
|
-
return [];
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
function assertStoredDefinition(value, name, path) {
|
|
158
|
-
if (!value || typeof value !== "object" || value.name !== name || value.metadata?.source !== "user") throw new Error(`invalid workflow definition: ${path}`);
|
|
159
|
-
if (!validateWorkflowGraph(value.graph).valid) throw new Error(`invalid workflow graph: ${path}`);
|
|
160
|
-
}
|
|
161
|
-
function toCatalogEntry(definition, path) {
|
|
109
|
+
function toCatalogEntry(definition) {
|
|
162
110
|
return {
|
|
163
111
|
name: definition.name,
|
|
164
112
|
source: definition.metadata.source,
|
|
165
|
-
path,
|
|
166
113
|
description: definition.description,
|
|
167
114
|
title: definition.title,
|
|
168
115
|
version: definition.version,
|
|
@@ -175,11 +122,6 @@ function toCatalogEntry(definition, path) {
|
|
|
175
122
|
function requireValidName(name) {
|
|
176
123
|
if (!NAME_RE.test(name)) throw new Error(`invalid workflow name "${name}"; use lowercase letters, numbers, underscores, or hyphens`);
|
|
177
124
|
}
|
|
178
|
-
function writeJsonAtomic(path, value) {
|
|
179
|
-
const temporaryPath = `${path}.${randomUUID()}.tmp`;
|
|
180
|
-
writeFileSync(temporaryPath, `${JSON.stringify(value, null, 2)}\n`, "utf-8");
|
|
181
|
-
renameSync(temporaryPath, path);
|
|
182
|
-
}
|
|
183
125
|
function definitionToManifest(definition) {
|
|
184
126
|
return {
|
|
185
127
|
title: definition.title,
|
|
@@ -199,4 +141,4 @@ function definitionToManifest(definition) {
|
|
|
199
141
|
};
|
|
200
142
|
}
|
|
201
143
|
//#endregion
|
|
202
|
-
export { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflowCatalog
|
|
144
|
+
export { WorkflowNameConflictError, WorkflowRevisionConflictError, createWorkflowCatalog };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { applySubagentProgress } from './agent-progress.js';
|
|
2
2
|
export { BUILTIN_WORKFLOWS } from './builtins/index.js';
|
|
3
|
-
export { createWorkflowCatalog,
|
|
3
|
+
export { createWorkflowCatalog, type CatalogEntry, type SaveWorkflowInput, type WorkflowCatalog, type WorkflowSource, } from './catalog.js';
|
|
4
4
|
export type { ChannelProgressCapability, WorkflowProgressMode, WorkflowProgressPostInput, WorkflowProgressPostResult, } from './channel-capability.js';
|
|
5
5
|
export { WorkflowProgressBroker, getWorkflowProgressBroker, _resetWorkflowProgressBrokerForTests, type BrokerListenerHandle, type SessionBusLike, } from './progress-broker.js';
|
|
6
6
|
export { emptySnapshotFor } from './snapshot-empty.js';
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BUILTIN_WORKFLOWS } from "./builtins/index.js";
|
|
2
|
-
import { createWorkflowCatalog
|
|
2
|
+
import { createWorkflowCatalog } from "./catalog.js";
|
|
3
3
|
import { applySubagentProgress } from "./agent-progress.js";
|
|
4
4
|
import { emptySnapshotFor } from "./snapshot-empty.js";
|
|
5
5
|
import { createWorkflowSnapshot, previewValue, recomputeCounts, renderWorkflowText } from "./snapshot.js";
|
|
6
6
|
import { WorkflowProgressBroker, _resetWorkflowProgressBrokerForTests, getWorkflowProgressBroker } from "./progress-broker.js";
|
|
7
7
|
import { STRUCTURED_OUTPUT_TOOL_NAME, createStructuredOutputTool } from "./structured-output-tool.js";
|
|
8
8
|
import { DelegateSubagentRunner } from "./subagent-runner.js";
|
|
9
|
-
export { BUILTIN_WORKFLOWS, DelegateSubagentRunner, STRUCTURED_OUTPUT_TOOL_NAME, WorkflowProgressBroker, _resetWorkflowProgressBrokerForTests, applySubagentProgress, createStructuredOutputTool, createWorkflowCatalog, createWorkflowSnapshot,
|
|
9
|
+
export { BUILTIN_WORKFLOWS, DelegateSubagentRunner, STRUCTURED_OUTPUT_TOOL_NAME, WorkflowProgressBroker, _resetWorkflowProgressBrokerForTests, applySubagentProgress, createStructuredOutputTool, createWorkflowCatalog, createWorkflowSnapshot, emptySnapshotFor, getWorkflowProgressBroker, previewValue, recomputeCounts, renderWorkflowText };
|
|
@@ -3,7 +3,6 @@ import { init_logger } from "../../utils/logger.js";
|
|
|
3
3
|
import { init_agent_scope, normalizeAgentId } from "../../agent/agent-scope.js";
|
|
4
4
|
import { buildSessionKey, init_session_key } from "../../routing/session-key.js";
|
|
5
5
|
import { resolveAutomationTimeoutSeconds } from "../domain/defaults.js";
|
|
6
|
-
import crypto from "node:crypto";
|
|
7
6
|
//#region src/automations/service/action-executor.ts
|
|
8
7
|
init_agent_scope();
|
|
9
8
|
init_session_key();
|
|
@@ -158,7 +157,7 @@ var AutomationActionExecutor = class {
|
|
|
158
157
|
error: "Agent service is not available"
|
|
159
158
|
};
|
|
160
159
|
const agentId = normalizeAgentId(action.agentId || this.deps.getDefaultAgentId?.() || "main");
|
|
161
|
-
const peerId = automation.conversationMode === "continuous" ? automation.id : `${automation.id}-${
|
|
160
|
+
const peerId = automation.conversationMode === "continuous" ? automation.id : `${automation.id}-${run.id}`;
|
|
162
161
|
const sessionKey = buildSessionKey({
|
|
163
162
|
agentId,
|
|
164
163
|
source: "automation",
|
|
@@ -171,6 +170,7 @@ var AutomationActionExecutor = class {
|
|
|
171
170
|
currentPhase: "action"
|
|
172
171
|
});
|
|
173
172
|
await this.deps.prepareAgentSession?.({
|
|
173
|
+
automationName: automation.name,
|
|
174
174
|
sessionKey,
|
|
175
175
|
projectId: automation.projectId,
|
|
176
176
|
agentId,
|
|
@@ -365,7 +365,7 @@ var AutomationService = class {
|
|
|
365
365
|
this.appendRunEvent(run, status === "succeeded" ? "action.completed" : "action.failed", status === "succeeded" ? `${automation.action.kind} action completed` : `${automation.action.kind} action ${status}`, {
|
|
366
366
|
summary: task.summary,
|
|
367
367
|
error: task.error,
|
|
368
|
-
sessionKey: task.sessionKey,
|
|
368
|
+
sessionKey: task.sessionKey ?? run.sessionKey,
|
|
369
369
|
workflowRunId: task.workflowRunId,
|
|
370
370
|
model: task.model
|
|
371
371
|
});
|
|
@@ -374,7 +374,7 @@ var AutomationService = class {
|
|
|
374
374
|
status,
|
|
375
375
|
summary: task.summary,
|
|
376
376
|
error,
|
|
377
|
-
sessionKey: task.sessionKey,
|
|
377
|
+
sessionKey: task.sessionKey ?? run.sessionKey,
|
|
378
378
|
workflowRunId: task.workflowRunId,
|
|
379
379
|
model: task.model,
|
|
380
380
|
deadlineAtMs: task.deadlineAtMs ?? run.deadlineAtMs,
|
|
@@ -32,7 +32,7 @@ export declare class ChannelManager {
|
|
|
32
32
|
setOutboundHooks(hooks: OutboundChannelHooks): void;
|
|
33
33
|
/** Call before `initialize()` so plugins can persist per-session model overrides. */
|
|
34
34
|
setSessionModelHooks(hooks: ChannelPluginSessionModelHooks | undefined): void;
|
|
35
|
-
enableOutboundPersistence(
|
|
35
|
+
enableOutboundPersistence(agentId: string): void;
|
|
36
36
|
registerPlugin(plugin: ChannelPlugin): void;
|
|
37
37
|
getPlugin(id: string): ChannelPlugin | undefined;
|
|
38
38
|
getAllPlugins(): ChannelPlugin[];
|
|
@@ -45,8 +45,8 @@ var ChannelManager = class {
|
|
|
45
45
|
setSessionModelHooks(hooks) {
|
|
46
46
|
this.sessionModelHooks = hooks;
|
|
47
47
|
}
|
|
48
|
-
enableOutboundPersistence(
|
|
49
|
-
this.outbound.enablePersistence(
|
|
48
|
+
enableOutboundPersistence(agentId) {
|
|
49
|
+
this.outbound.enablePersistence(agentId);
|
|
50
50
|
}
|
|
51
51
|
registerPlugin(plugin) {
|
|
52
52
|
this.registry.register(plugin);
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Durable outbound queue (crash recovery): JSON file under agent internal dir.
|
|
3
|
-
*/
|
|
4
1
|
import type { OutboundMessage } from '../transport-types.js';
|
|
5
2
|
export interface PendingOutbound {
|
|
6
3
|
id: string;
|
|
@@ -8,11 +5,8 @@ export interface PendingOutbound {
|
|
|
8
5
|
message: OutboundMessage;
|
|
9
6
|
}
|
|
10
7
|
export declare class OutboundPersistStore {
|
|
11
|
-
private readonly
|
|
12
|
-
|
|
13
|
-
constructor(agentDir: string);
|
|
14
|
-
private load;
|
|
15
|
-
private flush;
|
|
8
|
+
private readonly queue;
|
|
9
|
+
constructor(scope: string);
|
|
16
10
|
enqueue(message: OutboundMessage): string;
|
|
17
11
|
ack(id: string): void;
|
|
18
12
|
peek(): readonly PendingOutbound[];
|