pulseed 0.5.3 → 0.5.4
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/base/state/state-manager-goal-state.d.ts +40 -0
- package/dist/base/state/state-manager-goal-state.d.ts.map +1 -0
- package/dist/base/state/state-manager-goal-state.js +235 -0
- package/dist/base/state/state-manager-goal-state.js.map +1 -0
- package/dist/base/state/state-manager.d.ts +0 -5
- package/dist/base/state/state-manager.d.ts.map +1 -1
- package/dist/base/state/state-manager.js +27 -273
- package/dist/base/state/state-manager.js.map +1 -1
- package/dist/base/types/goal-activation.d.ts +25 -0
- package/dist/base/types/goal-activation.d.ts.map +1 -0
- package/dist/base/types/goal-activation.js +9 -0
- package/dist/base/types/goal-activation.js.map +1 -0
- package/dist/interface/chat/chat-history.d.ts +129 -0
- package/dist/interface/chat/chat-history.d.ts.map +1 -1
- package/dist/interface/chat/chat-history.js +135 -0
- package/dist/interface/chat/chat-history.js.map +1 -1
- package/dist/interface/chat/chat-runner-command-helpers.d.ts +50 -0
- package/dist/interface/chat/chat-runner-command-helpers.d.ts.map +1 -0
- package/dist/interface/chat/chat-runner-command-helpers.js +189 -0
- package/dist/interface/chat/chat-runner-command-helpers.js.map +1 -0
- package/dist/interface/chat/chat-runner-commands.d.ts +76 -0
- package/dist/interface/chat/chat-runner-commands.d.ts.map +1 -0
- package/dist/interface/chat/chat-runner-commands.js +814 -0
- package/dist/interface/chat/chat-runner-commands.js.map +1 -0
- package/dist/interface/chat/chat-runner-event-bridge.d.ts +53 -0
- package/dist/interface/chat/chat-runner-event-bridge.d.ts.map +1 -0
- package/dist/interface/chat/chat-runner-event-bridge.js +311 -0
- package/dist/interface/chat/chat-runner-event-bridge.js.map +1 -0
- package/dist/interface/chat/chat-runner-routes.d.ts +67 -0
- package/dist/interface/chat/chat-runner-routes.d.ts.map +1 -0
- package/dist/interface/chat/chat-runner-routes.js +594 -0
- package/dist/interface/chat/chat-runner-routes.js.map +1 -0
- package/dist/interface/chat/chat-runner-runtime.d.ts +37 -0
- package/dist/interface/chat/chat-runner-runtime.d.ts.map +1 -0
- package/dist/interface/chat/chat-runner-runtime.js +236 -0
- package/dist/interface/chat/chat-runner-runtime.js.map +1 -0
- package/dist/interface/chat/chat-runner-state.d.ts +20 -0
- package/dist/interface/chat/chat-runner-state.d.ts.map +1 -0
- package/dist/interface/chat/chat-runner-state.js +157 -0
- package/dist/interface/chat/chat-runner-state.js.map +1 -0
- package/dist/interface/chat/chat-runner-support.d.ts +15 -0
- package/dist/interface/chat/chat-runner-support.d.ts.map +1 -0
- package/dist/interface/chat/chat-runner-support.js +116 -0
- package/dist/interface/chat/chat-runner-support.js.map +1 -0
- package/dist/interface/chat/chat-runner.d.ts +10 -153
- package/dist/interface/chat/chat-runner.d.ts.map +1 -1
- package/dist/interface/chat/chat-runner.js +299 -2642
- package/dist/interface/chat/chat-runner.js.map +1 -1
- package/dist/interface/chat/chat-session-store.d.ts +32 -0
- package/dist/interface/chat/chat-session-store.d.ts.map +1 -1
- package/dist/interface/chat/chat-session-store.js +100 -10
- package/dist/interface/chat/chat-session-store.js.map +1 -1
- package/dist/interface/chat/cross-platform-session.d.ts.map +1 -1
- package/dist/interface/chat/cross-platform-session.js +2 -5
- package/dist/interface/chat/cross-platform-session.js.map +1 -1
- package/dist/interface/chat/event-subscriber.d.ts.map +1 -1
- package/dist/interface/chat/event-subscriber.js +41 -0
- package/dist/interface/chat/event-subscriber.js.map +1 -1
- package/dist/interface/chat/ingress-router.d.ts +0 -25
- package/dist/interface/chat/ingress-router.d.ts.map +1 -1
- package/dist/interface/chat/ingress-router.js +12 -85
- package/dist/interface/chat/ingress-router.js.map +1 -1
- package/dist/interface/chat/tend-command.d.ts.map +1 -1
- package/dist/interface/chat/tend-command.js +2 -0
- package/dist/interface/chat/tend-command.js.map +1 -1
- package/dist/interface/cli/commands/daemon-shared.d.ts +32 -0
- package/dist/interface/cli/commands/daemon-shared.d.ts.map +1 -0
- package/dist/interface/cli/commands/daemon-shared.js +120 -0
- package/dist/interface/cli/commands/daemon-shared.js.map +1 -0
- package/dist/interface/cli/commands/daemon.d.ts +2 -2
- package/dist/interface/cli/commands/daemon.d.ts.map +1 -1
- package/dist/interface/cli/commands/daemon.js +4 -120
- package/dist/interface/cli/commands/daemon.js.map +1 -1
- package/dist/interface/cli/commands/schedule/history.d.ts.map +1 -1
- package/dist/interface/cli/commands/schedule/history.js +5 -1
- package/dist/interface/cli/commands/schedule/history.js.map +1 -1
- package/dist/interface/cli/commands/schedule.js +34 -4
- package/dist/interface/cli/commands/schedule.js.map +1 -1
- package/dist/interface/tui/app.d.ts.map +1 -1
- package/dist/interface/tui/app.js +14 -1
- package/dist/interface/tui/app.js.map +1 -1
- package/dist/interface/tui/chat/suggestions.d.ts.map +1 -1
- package/dist/interface/tui/chat/suggestions.js +118 -4
- package/dist/interface/tui/chat/suggestions.js.map +1 -1
- package/dist/interface/tui/entry-approval.d.ts +8 -0
- package/dist/interface/tui/entry-approval.d.ts.map +1 -0
- package/dist/interface/tui/entry-approval.js +59 -0
- package/dist/interface/tui/entry-approval.js.map +1 -0
- package/dist/interface/tui/entry-daemon.d.ts +12 -0
- package/dist/interface/tui/entry-daemon.d.ts.map +1 -0
- package/dist/interface/tui/entry-daemon.js +74 -0
- package/dist/interface/tui/entry-daemon.js.map +1 -0
- package/dist/interface/tui/entry-deps.d.ts +22 -0
- package/dist/interface/tui/entry-deps.d.ts.map +1 -0
- package/dist/interface/tui/entry-deps.js +409 -0
- package/dist/interface/tui/entry-deps.js.map +1 -0
- package/dist/interface/tui/entry.d.ts +2 -4
- package/dist/interface/tui/entry.d.ts.map +1 -1
- package/dist/interface/tui/entry.js +10 -557
- package/dist/interface/tui/entry.js.map +1 -1
- package/dist/interface/tui/fullscreen-chat-render.d.ts +127 -0
- package/dist/interface/tui/fullscreen-chat-render.d.ts.map +1 -0
- package/dist/interface/tui/fullscreen-chat-render.js +667 -0
- package/dist/interface/tui/fullscreen-chat-render.js.map +1 -0
- package/dist/interface/tui/fullscreen-chat.d.ts +2 -111
- package/dist/interface/tui/fullscreen-chat.d.ts.map +1 -1
- package/dist/interface/tui/fullscreen-chat.js +4 -663
- package/dist/interface/tui/fullscreen-chat.js.map +1 -1
- package/dist/interface/tui/help-overlay.d.ts.map +1 -1
- package/dist/interface/tui/help-overlay.js +1 -1
- package/dist/interface/tui/help-overlay.js.map +1 -1
- package/dist/interface/tui/intent-recognizer.js +2 -2
- package/dist/interface/tui/intent-recognizer.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js +8 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-default-profile.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-router.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-router.js +2 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-router.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.d.ts +2 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.js +31 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-tool-runtime.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.d.ts +1 -0
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/agent-loop-turn-context.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts +1 -0
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js +36 -2
- package/dist/orchestrator/execution/agent-loop/bounded-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js +2 -1
- package/dist/orchestrator/execution/agent-loop/chat-agent-loop-runner.js.map +1 -1
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.d.ts +19 -0
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.d.ts.map +1 -1
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.js +164 -14
- package/dist/orchestrator/execution/agent-loop/core-loop-control-tools.js.map +1 -1
- package/dist/orchestrator/execution/reflection-generator.d.ts +1 -0
- package/dist/orchestrator/execution/reflection-generator.d.ts.map +1 -1
- package/dist/orchestrator/execution/reflection-generator.js +10 -1
- package/dist/orchestrator/execution/reflection-generator.js.map +1 -1
- package/dist/orchestrator/execution/task/task-context-enricher.d.ts +2 -0
- package/dist/orchestrator/execution/task/task-context-enricher.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-context-enricher.js +9 -4
- package/dist/orchestrator/execution/task/task-context-enricher.js.map +1 -1
- package/dist/orchestrator/execution/task/task-execution-helpers-internal.d.ts +5 -0
- package/dist/orchestrator/execution/task/task-execution-helpers-internal.d.ts.map +1 -0
- package/dist/orchestrator/execution/task/task-execution-helpers-internal.js +6 -0
- package/dist/orchestrator/execution/task/task-execution-helpers-internal.js.map +1 -0
- package/dist/orchestrator/execution/task/task-generation.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-generation.js +8 -3
- package/dist/orchestrator/execution/task/task-generation.js.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts +73 -0
- package/dist/orchestrator/execution/task/task-lifecycle-runner.d.ts.map +1 -0
- package/dist/orchestrator/execution/task/task-lifecycle-runner.js +184 -0
- package/dist/orchestrator/execution/task/task-lifecycle-runner.js.map +1 -0
- package/dist/orchestrator/execution/task/task-lifecycle.d.ts +7 -7
- package/dist/orchestrator/execution/task/task-lifecycle.d.ts.map +1 -1
- package/dist/orchestrator/execution/task/task-lifecycle.js +37 -181
- package/dist/orchestrator/execution/task/task-lifecycle.js.map +1 -1
- package/dist/orchestrator/execution/task/task-verifier-internal.d.ts +2 -0
- package/dist/orchestrator/execution/task/task-verifier-internal.d.ts.map +1 -0
- package/dist/orchestrator/execution/task/task-verifier-internal.js +2 -0
- package/dist/orchestrator/execution/task/task-verifier-internal.js.map +1 -0
- package/dist/orchestrator/goal/goal-negotiator.d.ts.map +1 -1
- package/dist/orchestrator/goal/goal-negotiator.js +23 -3
- package/dist/orchestrator/goal/goal-negotiator.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/contracts.d.ts +1 -0
- package/dist/orchestrator/loop/core-loop/contracts.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/contracts.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel-knowledge.d.ts +7 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel-knowledge.d.ts.map +1 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel-knowledge.js +43 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel-knowledge.js.map +1 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel-wait.d.ts +14 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel-wait.d.ts.map +1 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel-wait.js +41 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel-wait.js.map +1 -0
- package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts +3 -2
- package/dist/orchestrator/loop/core-loop/iteration-kernel.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/iteration-kernel.js +16 -87
- package/dist/orchestrator/loop/core-loop/iteration-kernel.js.map +1 -1
- package/dist/orchestrator/loop/core-loop/phase-policy.js +5 -5
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.d.ts +9 -0
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.d.ts.map +1 -0
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.js +297 -0
- package/dist/orchestrator/loop/core-loop/task-cycle-stall.js.map +1 -0
- package/dist/orchestrator/loop/core-loop/task-cycle-wait.d.ts +11 -0
- package/dist/orchestrator/loop/core-loop/task-cycle-wait.d.ts.map +1 -0
- package/dist/orchestrator/loop/core-loop/task-cycle-wait.js +176 -0
- package/dist/orchestrator/loop/core-loop/task-cycle-wait.js.map +1 -0
- package/dist/orchestrator/loop/core-loop/task-cycle.d.ts +3 -15
- package/dist/orchestrator/loop/core-loop/task-cycle.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop/task-cycle.js +10 -444
- package/dist/orchestrator/loop/core-loop/task-cycle.js.map +1 -1
- package/dist/orchestrator/loop/core-loop.d.ts +3 -0
- package/dist/orchestrator/loop/core-loop.d.ts.map +1 -1
- package/dist/orchestrator/loop/core-loop.js +4 -0
- package/dist/orchestrator/loop/core-loop.js.map +1 -1
- package/dist/orchestrator/strategy/portfolio-manager.d.ts +3 -2
- package/dist/orchestrator/strategy/portfolio-manager.d.ts.map +1 -1
- package/dist/orchestrator/strategy/portfolio-manager.js +16 -11
- package/dist/orchestrator/strategy/portfolio-manager.js.map +1 -1
- package/dist/orchestrator/strategy/portfolio-rebalance.d.ts +1 -1
- package/dist/orchestrator/strategy/portfolio-rebalance.d.ts.map +1 -1
- package/dist/orchestrator/strategy/portfolio-rebalance.js +31 -9
- package/dist/orchestrator/strategy/portfolio-rebalance.js.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager-base.d.ts +12 -2
- package/dist/orchestrator/strategy/strategy-manager-base.d.ts.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager-base.js +23 -7
- package/dist/orchestrator/strategy/strategy-manager-base.js.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager.d.ts +1 -11
- package/dist/orchestrator/strategy/strategy-manager.d.ts.map +1 -1
- package/dist/orchestrator/strategy/strategy-manager.js +78 -19
- package/dist/orchestrator/strategy/strategy-manager.js.map +1 -1
- package/dist/platform/dream/dream-consolidator/fs-metrics.d.ts +18 -0
- package/dist/platform/dream/dream-consolidator/fs-metrics.d.ts.map +1 -0
- package/dist/platform/dream/dream-consolidator/fs-metrics.js +130 -0
- package/dist/platform/dream/dream-consolidator/fs-metrics.js.map +1 -0
- package/dist/platform/dream/dream-consolidator.d.ts +4 -14
- package/dist/platform/dream/dream-consolidator.d.ts.map +1 -1
- package/dist/platform/dream/dream-consolidator.js +46 -166
- package/dist/platform/dream/dream-consolidator.js.map +1 -1
- package/dist/platform/dream/dream-soil-sync.d.ts +1 -0
- package/dist/platform/dream/dream-soil-sync.d.ts.map +1 -1
- package/dist/platform/dream/dream-soil-sync.js +8 -1
- package/dist/platform/dream/dream-soil-sync.js.map +1 -1
- package/dist/platform/dream/dream-types.d.ts +5 -0
- package/dist/platform/dream/dream-types.d.ts.map +1 -1
- package/dist/platform/dream/dream-types.js +1 -0
- package/dist/platform/dream/dream-types.js.map +1 -1
- package/dist/platform/dream/playbook-memory.d.ts +4 -4
- package/dist/platform/drive/stall-detector/analysis.d.ts +5 -0
- package/dist/platform/drive/stall-detector/analysis.d.ts.map +1 -0
- package/dist/platform/drive/stall-detector/analysis.js +55 -0
- package/dist/platform/drive/stall-detector/analysis.js.map +1 -0
- package/dist/platform/drive/stall-detector/repetitive.d.ts +3 -0
- package/dist/platform/drive/stall-detector/repetitive.d.ts.map +1 -0
- package/dist/platform/drive/stall-detector/repetitive.js +72 -0
- package/dist/platform/drive/stall-detector/repetitive.js.map +1 -0
- package/dist/platform/drive/stall-detector/thresholds.d.ts +10 -0
- package/dist/platform/drive/stall-detector/thresholds.d.ts.map +1 -0
- package/dist/platform/drive/stall-detector/thresholds.js +61 -0
- package/dist/platform/drive/stall-detector/thresholds.js.map +1 -0
- package/dist/platform/drive/stall-detector.d.ts +2 -20
- package/dist/platform/drive/stall-detector.d.ts.map +1 -1
- package/dist/platform/drive/stall-detector.js +9 -202
- package/dist/platform/drive/stall-detector.js.map +1 -1
- package/dist/platform/knowledge/knowledge-manager-agent-memory.d.ts +55 -0
- package/dist/platform/knowledge/knowledge-manager-agent-memory.d.ts.map +1 -0
- package/dist/platform/knowledge/knowledge-manager-agent-memory.js +232 -0
- package/dist/platform/knowledge/knowledge-manager-agent-memory.js.map +1 -0
- package/dist/platform/knowledge/knowledge-manager-internals.d.ts +10 -0
- package/dist/platform/knowledge/knowledge-manager-internals.d.ts.map +1 -0
- package/dist/platform/knowledge/knowledge-manager-internals.js +43 -0
- package/dist/platform/knowledge/knowledge-manager-internals.js.map +1 -0
- package/dist/platform/knowledge/knowledge-manager-store.d.ts +13 -0
- package/dist/platform/knowledge/knowledge-manager-store.d.ts.map +1 -0
- package/dist/platform/knowledge/knowledge-manager-store.js +67 -0
- package/dist/platform/knowledge/knowledge-manager-store.js.map +1 -0
- package/dist/platform/knowledge/knowledge-manager.d.ts +6 -2
- package/dist/platform/knowledge/knowledge-manager.d.ts.map +1 -1
- package/dist/platform/knowledge/knowledge-manager.js +43 -344
- package/dist/platform/knowledge/knowledge-manager.js.map +1 -1
- package/dist/platform/knowledge/memory/memory-lifecycle-storage.d.ts +4 -0
- package/dist/platform/knowledge/memory/memory-lifecycle-storage.d.ts.map +1 -0
- package/dist/platform/knowledge/memory/memory-lifecycle-storage.js +106 -0
- package/dist/platform/knowledge/memory/memory-lifecycle-storage.js.map +1 -0
- package/dist/platform/knowledge/memory/memory-lifecycle.d.ts.map +1 -1
- package/dist/platform/knowledge/memory/memory-lifecycle.js +6 -112
- package/dist/platform/knowledge/memory/memory-lifecycle.js.map +1 -1
- package/dist/platform/observation/capability-detector/prompts.d.ts +18 -0
- package/dist/platform/observation/capability-detector/prompts.d.ts.map +1 -0
- package/dist/platform/observation/capability-detector/prompts.js +80 -0
- package/dist/platform/observation/capability-detector/prompts.js.map +1 -0
- package/dist/platform/observation/capability-detector/recommendations.d.ts +5 -0
- package/dist/platform/observation/capability-detector/recommendations.d.ts.map +1 -0
- package/dist/platform/observation/capability-detector/recommendations.js +76 -0
- package/dist/platform/observation/capability-detector/recommendations.js.map +1 -0
- package/dist/platform/observation/capability-detector/types.d.ts +112 -0
- package/dist/platform/observation/capability-detector/types.d.ts.map +1 -0
- package/dist/platform/observation/capability-detector/types.js +75 -0
- package/dist/platform/observation/capability-detector/types.js.map +1 -0
- package/dist/platform/observation/capability-detector.d.ts +4 -9
- package/dist/platform/observation/capability-detector.d.ts.map +1 -1
- package/dist/platform/observation/capability-detector.js +12 -212
- package/dist/platform/observation/capability-detector.js.map +1 -1
- package/dist/platform/observation/context-provider/collector.d.ts +13 -0
- package/dist/platform/observation/context-provider/collector.d.ts.map +1 -0
- package/dist/platform/observation/context-provider/collector.js +259 -0
- package/dist/platform/observation/context-provider/collector.js.map +1 -0
- package/dist/platform/observation/context-provider/search-terms.d.ts +2 -0
- package/dist/platform/observation/context-provider/search-terms.d.ts.map +1 -0
- package/dist/platform/observation/context-provider/search-terms.js +24 -0
- package/dist/platform/observation/context-provider/search-terms.js.map +1 -0
- package/dist/platform/observation/context-provider/shared.d.ts +17 -0
- package/dist/platform/observation/context-provider/shared.d.ts.map +1 -0
- package/dist/platform/observation/context-provider/shared.js +87 -0
- package/dist/platform/observation/context-provider/shared.js.map +1 -0
- package/dist/platform/observation/context-provider.d.ts +3 -28
- package/dist/platform/observation/context-provider.d.ts.map +1 -1
- package/dist/platform/observation/context-provider.js +7 -395
- package/dist/platform/observation/context-provider.js.map +1 -1
- package/dist/platform/soil/compiled-memory-projections.d.ts +2 -0
- package/dist/platform/soil/compiled-memory-projections.d.ts.map +1 -1
- package/dist/platform/soil/compiled-memory-projections.js +59 -0
- package/dist/platform/soil/compiled-memory-projections.js.map +1 -1
- package/dist/platform/soil/contracts.d.ts +2 -2
- package/dist/platform/soil/retriever.d.ts +25 -0
- package/dist/platform/soil/retriever.d.ts.map +1 -1
- package/dist/platform/soil/retriever.js +94 -5
- package/dist/platform/soil/retriever.js.map +1 -1
- package/dist/platform/soil/sqlite-repository-helpers.d.ts +80 -0
- package/dist/platform/soil/sqlite-repository-helpers.d.ts.map +1 -0
- package/dist/platform/soil/sqlite-repository-helpers.js +143 -0
- package/dist/platform/soil/sqlite-repository-helpers.js.map +1 -0
- package/dist/platform/soil/sqlite-repository-search.d.ts +8 -0
- package/dist/platform/soil/sqlite-repository-search.d.ts.map +1 -0
- package/dist/platform/soil/sqlite-repository-search.js +367 -0
- package/dist/platform/soil/sqlite-repository-search.js.map +1 -0
- package/dist/platform/soil/sqlite-repository-storage.d.ts +8 -0
- package/dist/platform/soil/sqlite-repository-storage.d.ts.map +1 -0
- package/dist/platform/soil/sqlite-repository-storage.js +278 -0
- package/dist/platform/soil/sqlite-repository-storage.js.map +1 -0
- package/dist/platform/soil/sqlite-repository.d.ts +1 -4
- package/dist/platform/soil/sqlite-repository.d.ts.map +1 -1
- package/dist/platform/soil/sqlite-repository.js +26 -820
- package/dist/platform/soil/sqlite-repository.js.map +1 -1
- package/dist/runtime/daemon/index.d.ts +1 -1
- package/dist/runtime/daemon/index.d.ts.map +1 -1
- package/dist/runtime/daemon/index.js +1 -1
- package/dist/runtime/daemon/index.js.map +1 -1
- package/dist/runtime/daemon/maintenance.d.ts +2 -10
- package/dist/runtime/daemon/maintenance.d.ts.map +1 -1
- package/dist/runtime/daemon/maintenance.js +14 -45
- package/dist/runtime/daemon/maintenance.js.map +1 -1
- package/dist/runtime/daemon/runner-bootstrap.d.ts +25 -0
- package/dist/runtime/daemon/runner-bootstrap.d.ts.map +1 -0
- package/dist/runtime/daemon/runner-bootstrap.js +77 -0
- package/dist/runtime/daemon/runner-bootstrap.js.map +1 -0
- package/dist/runtime/daemon/runner-commands.d.ts +7 -7
- package/dist/runtime/daemon/runner-commands.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-commands.js +35 -20
- package/dist/runtime/daemon/runner-commands.js.map +1 -1
- package/dist/runtime/daemon/runner-goal-cycle.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-goal-cycle.js +3 -5
- package/dist/runtime/daemon/runner-goal-cycle.js.map +1 -1
- package/dist/runtime/daemon/runner-resident-curiosity.d.ts +12 -0
- package/dist/runtime/daemon/runner-resident-curiosity.d.ts.map +1 -0
- package/dist/runtime/daemon/runner-resident-curiosity.js +155 -0
- package/dist/runtime/daemon/runner-resident-curiosity.js.map +1 -0
- package/dist/runtime/daemon/runner-resident-dream.d.ts +20 -0
- package/dist/runtime/daemon/runner-resident-dream.d.ts.map +1 -0
- package/dist/runtime/daemon/runner-resident-dream.js +148 -0
- package/dist/runtime/daemon/runner-resident-dream.js.map +1 -0
- package/dist/runtime/daemon/runner-resident-proactive.d.ts +4 -0
- package/dist/runtime/daemon/runner-resident-proactive.d.ts.map +1 -0
- package/dist/runtime/daemon/runner-resident-proactive.js +113 -0
- package/dist/runtime/daemon/runner-resident-proactive.js.map +1 -0
- package/dist/runtime/daemon/runner-resident-shared.d.ts +40 -0
- package/dist/runtime/daemon/runner-resident-shared.d.ts.map +1 -0
- package/dist/runtime/daemon/runner-resident-shared.js +101 -0
- package/dist/runtime/daemon/runner-resident-shared.js.map +1 -0
- package/dist/runtime/daemon/runner-resident.d.ts +4 -68
- package/dist/runtime/daemon/runner-resident.d.ts.map +1 -1
- package/dist/runtime/daemon/runner-resident.js +4 -506
- package/dist/runtime/daemon/runner-resident.js.map +1 -1
- package/dist/runtime/daemon/runner-runtime.d.ts +12 -0
- package/dist/runtime/daemon/runner-runtime.d.ts.map +1 -0
- package/dist/runtime/daemon/runner-runtime.js +43 -0
- package/dist/runtime/daemon/runner-runtime.js.map +1 -0
- package/dist/runtime/daemon/runner-startup.js +3 -4
- package/dist/runtime/daemon/runner-startup.js.map +1 -1
- package/dist/runtime/daemon/runner.d.ts +10 -23
- package/dist/runtime/daemon/runner.d.ts.map +1 -1
- package/dist/runtime/daemon/runner.js +27 -110
- package/dist/runtime/daemon/runner.js.map +1 -1
- package/dist/runtime/daemon/wait-deadline-resolver.d.ts +5 -2
- package/dist/runtime/daemon/wait-deadline-resolver.d.ts.map +1 -1
- package/dist/runtime/daemon/wait-deadline-resolver.js +55 -35
- package/dist/runtime/daemon/wait-deadline-resolver.js.map +1 -1
- package/dist/runtime/event/dispatcher.d.ts +0 -2
- package/dist/runtime/event/dispatcher.d.ts.map +1 -1
- package/dist/runtime/event/dispatcher.js +0 -4
- package/dist/runtime/event/dispatcher.js.map +1 -1
- package/dist/runtime/executor/goal-worker.d.ts +2 -1
- package/dist/runtime/executor/goal-worker.d.ts.map +1 -1
- package/dist/runtime/executor/goal-worker.js +2 -1
- package/dist/runtime/executor/goal-worker.js.map +1 -1
- package/dist/runtime/executor/loop-supervisor.d.ts +3 -0
- package/dist/runtime/executor/loop-supervisor.d.ts.map +1 -1
- package/dist/runtime/executor/loop-supervisor.js +37 -11
- package/dist/runtime/executor/loop-supervisor.js.map +1 -1
- package/dist/runtime/schedule/engine-cron-reflection.d.ts +31 -0
- package/dist/runtime/schedule/engine-cron-reflection.d.ts.map +1 -0
- package/dist/runtime/schedule/engine-cron-reflection.js +229 -0
- package/dist/runtime/schedule/engine-cron-reflection.js.map +1 -0
- package/dist/runtime/schedule/engine-execution.d.ts +47 -0
- package/dist/runtime/schedule/engine-execution.d.ts.map +1 -0
- package/dist/runtime/schedule/engine-execution.js +424 -0
- package/dist/runtime/schedule/engine-execution.js.map +1 -0
- package/dist/runtime/schedule/engine-heartbeat.d.ts +5 -0
- package/dist/runtime/schedule/engine-heartbeat.d.ts.map +1 -0
- package/dist/runtime/schedule/engine-heartbeat.js +104 -0
- package/dist/runtime/schedule/engine-heartbeat.js.map +1 -0
- package/dist/runtime/schedule/engine-layers.d.ts +2 -0
- package/dist/runtime/schedule/engine-layers.d.ts.map +1 -1
- package/dist/runtime/schedule/engine-layers.js +12 -228
- package/dist/runtime/schedule/engine-layers.js.map +1 -1
- package/dist/runtime/schedule/engine-mutations.d.ts +37 -0
- package/dist/runtime/schedule/engine-mutations.d.ts.map +1 -0
- package/dist/runtime/schedule/engine-mutations.js +263 -0
- package/dist/runtime/schedule/engine-mutations.js.map +1 -0
- package/dist/runtime/schedule/engine.d.ts +11 -38
- package/dist/runtime/schedule/engine.d.ts.map +1 -1
- package/dist/runtime/schedule/engine.js +65 -810
- package/dist/runtime/schedule/engine.js.map +1 -1
- package/dist/runtime/schedule/history.d.ts +16 -0
- package/dist/runtime/schedule/history.d.ts.map +1 -1
- package/dist/runtime/schedule/history.js +8 -0
- package/dist/runtime/schedule/history.js.map +1 -1
- package/dist/runtime/schedule/index.d.ts +1 -0
- package/dist/runtime/schedule/index.d.ts.map +1 -1
- package/dist/runtime/schedule/index.js +1 -0
- package/dist/runtime/schedule/index.js.map +1 -1
- package/dist/runtime/schedule/legacy-cron-migration.d.ts +9 -0
- package/dist/runtime/schedule/legacy-cron-migration.d.ts.map +1 -0
- package/dist/runtime/schedule/legacy-cron-migration.js +89 -0
- package/dist/runtime/schedule/legacy-cron-migration.js.map +1 -0
- package/dist/runtime/schedule/wait-projection.d.ts +6 -0
- package/dist/runtime/schedule/wait-projection.d.ts.map +1 -0
- package/dist/runtime/schedule/wait-projection.js +102 -0
- package/dist/runtime/schedule/wait-projection.js.map +1 -0
- package/dist/runtime/session-registry/registry-helpers.d.ts +34 -0
- package/dist/runtime/session-registry/registry-helpers.d.ts.map +1 -0
- package/dist/runtime/session-registry/registry-helpers.js +241 -0
- package/dist/runtime/session-registry/registry-helpers.js.map +1 -0
- package/dist/runtime/session-registry/registry.d.ts.map +1 -1
- package/dist/runtime/session-registry/registry.js +14 -243
- package/dist/runtime/session-registry/registry.js.map +1 -1
- package/dist/runtime/session-registry/types.d.ts +36 -36
- package/dist/runtime/store/runtime-operation-schemas.d.ts +36 -36
- package/dist/runtime/store/runtime-schemas.d.ts +2 -2
- package/dist/runtime/types/daemon.d.ts +10 -0
- package/dist/runtime/types/daemon.d.ts.map +1 -1
- package/dist/runtime/types/daemon.js +2 -0
- package/dist/runtime/types/daemon.js.map +1 -1
- package/dist/runtime/types/schedule.d.ts +65 -0
- package/dist/runtime/types/schedule.d.ts.map +1 -1
- package/dist/runtime/types/schedule.js +5 -0
- package/dist/runtime/types/schedule.js.map +1 -1
- package/dist/tools/builtin/exports.d.ts +1 -0
- package/dist/tools/builtin/exports.d.ts.map +1 -1
- package/dist/tools/builtin/exports.js +1 -0
- package/dist/tools/builtin/exports.js.map +1 -1
- package/dist/tools/builtin/factory.d.ts +2 -0
- package/dist/tools/builtin/factory.d.ts.map +1 -1
- package/dist/tools/builtin/factory.js +8 -1
- package/dist/tools/builtin/factory.js.map +1 -1
- package/dist/tools/fs/FileValidationTool/protected-path-policy.d.ts +1 -0
- package/dist/tools/fs/FileValidationTool/protected-path-policy.d.ts.map +1 -1
- package/dist/tools/fs/FileValidationTool/protected-path-policy.js +17 -4
- package/dist/tools/fs/FileValidationTool/protected-path-policy.js.map +1 -1
- package/dist/tools/fs/ListDirTool/ListDirTool.js +1 -1
- package/dist/tools/fs/ListDirTool/ListDirTool.js.map +1 -1
- package/dist/tools/kaggle/paths.d.ts.map +1 -1
- package/dist/tools/kaggle/paths.js +6 -0
- package/dist/tools/kaggle/paths.js.map +1 -1
- package/dist/tools/query/CodeSearchRepairTool/CodeSearchRepairTool.d.ts.map +1 -1
- package/dist/tools/query/CodeSearchRepairTool/CodeSearchRepairTool.js +23 -2
- package/dist/tools/query/CodeSearchRepairTool/CodeSearchRepairTool.js.map +1 -1
- package/dist/tools/query/CodeSearchTool/CodeSearchTool.d.ts.map +1 -1
- package/dist/tools/query/CodeSearchTool/CodeSearchTool.js +24 -2
- package/dist/tools/query/CodeSearchTool/CodeSearchTool.js.map +1 -1
- package/dist/tools/query/SoilQueryTool/SoilQueryTool.d.ts.map +1 -1
- package/dist/tools/query/SoilQueryTool/SoilQueryTool.js +43 -9
- package/dist/tools/query/SoilQueryTool/SoilQueryTool.js.map +1 -1
- package/dist/tools/query/code-search-root.d.ts +8 -0
- package/dist/tools/query/code-search-root.d.ts.map +1 -0
- package/dist/tools/query/code-search-root.js +41 -0
- package/dist/tools/query/code-search-root.js.map +1 -0
- package/dist/tools/query/runtime-session-tools.d.ts +560 -0
- package/dist/tools/query/runtime-session-tools.d.ts.map +1 -0
- package/dist/tools/query/runtime-session-tools.js +1015 -0
- package/dist/tools/query/runtime-session-tools.js.map +1 -0
- package/dist/tools/runtime/LongRunningRuntimeTools.d.ts +821 -0
- package/dist/tools/runtime/LongRunningRuntimeTools.d.ts.map +1 -0
- package/dist/tools/runtime/LongRunningRuntimeTools.js +845 -0
- package/dist/tools/runtime/LongRunningRuntimeTools.js.map +1 -0
- package/dist/tools/system/ProcessSessionTool/ProcessSessionTool.d.ts +1 -0
- package/dist/tools/system/ProcessSessionTool/ProcessSessionTool.d.ts.map +1 -1
- package/dist/tools/system/ProcessSessionTool/ProcessSessionTool.js +11 -0
- package/dist/tools/system/ProcessSessionTool/ProcessSessionTool.js.map +1 -1
- package/dist/tools/system/ShellTool/ShellTool.d.ts.map +1 -1
- package/dist/tools/system/ShellTool/ShellTool.js +2 -1
- package/dist/tools/system/ShellTool/ShellTool.js.map +1 -1
- package/dist/tools/types.d.ts +2 -0
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js.map +1 -1
- package/package.json +1 -1
- package/dist/base/types/cron.d.ts +0 -2
- package/dist/base/types/cron.d.ts.map +0 -1
- package/dist/base/types/cron.js +0 -3
- package/dist/base/types/cron.js.map +0 -1
- package/dist/runtime/cron-scheduler.d.ts +0 -13
- package/dist/runtime/cron-scheduler.d.ts.map +0 -1
- package/dist/runtime/cron-scheduler.js +0 -90
- package/dist/runtime/cron-scheduler.js.map +0 -1
- package/dist/runtime/types/cron.d.ts +0 -59
- package/dist/runtime/types/cron.d.ts.map +0 -1
- package/dist/runtime/types/cron.js +0 -13
- package/dist/runtime/types/cron.js.map +0 -1
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { cosineSimilarity } from "../knowledge/embedding-client.js";
|
|
2
|
+
import { SoilSearchRequestSchema, } from "./contracts.js";
|
|
3
|
+
import { buildSnippet, decodeEmbedding, dedupeCandidates, parseJsonObject, unique, } from "./sqlite-repository-helpers.js";
|
|
4
|
+
function hasExplicitMetadataFilter(request) {
|
|
5
|
+
const recordFilter = request.record_filter;
|
|
6
|
+
const pageFilter = request.page_filter;
|
|
7
|
+
return Boolean(recordFilter.record_ids?.length ||
|
|
8
|
+
recordFilter.record_keys?.length ||
|
|
9
|
+
recordFilter.record_types?.length ||
|
|
10
|
+
recordFilter.statuses?.length ||
|
|
11
|
+
recordFilter.goal_ids?.length ||
|
|
12
|
+
recordFilter.task_ids?.length ||
|
|
13
|
+
recordFilter.source_types?.length ||
|
|
14
|
+
recordFilter.source_ids?.length ||
|
|
15
|
+
recordFilter.valid_at ||
|
|
16
|
+
recordFilter.updated_after ||
|
|
17
|
+
recordFilter.updated_before ||
|
|
18
|
+
pageFilter.page_ids?.length ||
|
|
19
|
+
pageFilter.soil_ids?.length ||
|
|
20
|
+
pageFilter.routes?.length ||
|
|
21
|
+
pageFilter.kinds?.length ||
|
|
22
|
+
pageFilter.page_statuses?.length ||
|
|
23
|
+
pageFilter.relative_paths?.length);
|
|
24
|
+
}
|
|
25
|
+
export function buildRecordFilterSql(request, params) {
|
|
26
|
+
const clauses = [];
|
|
27
|
+
const filter = request.record_filter;
|
|
28
|
+
if (filter.active_only) {
|
|
29
|
+
clauses.push("r.is_active = 1");
|
|
30
|
+
}
|
|
31
|
+
if (filter.record_ids?.length) {
|
|
32
|
+
clauses.push(`r.record_id IN (${filter.record_ids.map(() => "?").join(", ")})`);
|
|
33
|
+
params.push(...filter.record_ids);
|
|
34
|
+
}
|
|
35
|
+
if (filter.record_keys?.length) {
|
|
36
|
+
clauses.push(`r.record_key IN (${filter.record_keys.map(() => "?").join(", ")})`);
|
|
37
|
+
params.push(...filter.record_keys);
|
|
38
|
+
}
|
|
39
|
+
if (filter.record_types?.length) {
|
|
40
|
+
clauses.push(`r.record_type IN (${filter.record_types.map(() => "?").join(", ")})`);
|
|
41
|
+
params.push(...filter.record_types);
|
|
42
|
+
}
|
|
43
|
+
if (filter.statuses?.length) {
|
|
44
|
+
clauses.push(`r.status IN (${filter.statuses.map(() => "?").join(", ")})`);
|
|
45
|
+
params.push(...filter.statuses);
|
|
46
|
+
}
|
|
47
|
+
if (filter.goal_ids?.length) {
|
|
48
|
+
clauses.push(`r.goal_id IN (${filter.goal_ids.map(() => "?").join(", ")})`);
|
|
49
|
+
params.push(...filter.goal_ids);
|
|
50
|
+
}
|
|
51
|
+
if (filter.task_ids?.length) {
|
|
52
|
+
clauses.push(`r.task_id IN (${filter.task_ids.map(() => "?").join(", ")})`);
|
|
53
|
+
params.push(...filter.task_ids);
|
|
54
|
+
}
|
|
55
|
+
if (filter.source_types?.length) {
|
|
56
|
+
clauses.push(`r.source_type IN (${filter.source_types.map(() => "?").join(", ")})`);
|
|
57
|
+
params.push(...filter.source_types);
|
|
58
|
+
}
|
|
59
|
+
if (filter.source_ids?.length) {
|
|
60
|
+
clauses.push(`r.source_id IN (${filter.source_ids.map(() => "?").join(", ")})`);
|
|
61
|
+
params.push(...filter.source_ids);
|
|
62
|
+
}
|
|
63
|
+
if (filter.valid_at) {
|
|
64
|
+
clauses.push("(r.valid_from IS NULL OR r.valid_from <= ?)");
|
|
65
|
+
clauses.push("(r.valid_to IS NULL OR r.valid_to > ?)");
|
|
66
|
+
params.push(filter.valid_at, filter.valid_at);
|
|
67
|
+
}
|
|
68
|
+
if (filter.updated_after) {
|
|
69
|
+
clauses.push("r.updated_at >= ?");
|
|
70
|
+
params.push(filter.updated_after);
|
|
71
|
+
}
|
|
72
|
+
if (filter.updated_before) {
|
|
73
|
+
clauses.push("r.updated_at <= ?");
|
|
74
|
+
params.push(filter.updated_before);
|
|
75
|
+
}
|
|
76
|
+
return clauses;
|
|
77
|
+
}
|
|
78
|
+
function buildPageFilterSql(request, params) {
|
|
79
|
+
const clauses = [];
|
|
80
|
+
const filter = request.page_filter;
|
|
81
|
+
if (filter.page_ids?.length) {
|
|
82
|
+
clauses.push(`p.page_id IN (${filter.page_ids.map(() => "?").join(", ")})`);
|
|
83
|
+
params.push(...filter.page_ids);
|
|
84
|
+
}
|
|
85
|
+
if (filter.soil_ids?.length) {
|
|
86
|
+
clauses.push(`p.soil_id IN (${filter.soil_ids.map(() => "?").join(", ")})`);
|
|
87
|
+
params.push(...filter.soil_ids);
|
|
88
|
+
}
|
|
89
|
+
if (filter.routes?.length) {
|
|
90
|
+
clauses.push(`p.route IN (${filter.routes.map(() => "?").join(", ")})`);
|
|
91
|
+
params.push(...filter.routes);
|
|
92
|
+
}
|
|
93
|
+
if (filter.kinds?.length) {
|
|
94
|
+
clauses.push(`p.kind IN (${filter.kinds.map(() => "?").join(", ")})`);
|
|
95
|
+
params.push(...filter.kinds);
|
|
96
|
+
}
|
|
97
|
+
if (filter.page_statuses?.length) {
|
|
98
|
+
clauses.push(`p.status IN (${filter.page_statuses.map(() => "?").join(", ")})`);
|
|
99
|
+
params.push(...filter.page_statuses);
|
|
100
|
+
}
|
|
101
|
+
if (filter.relative_paths?.length) {
|
|
102
|
+
clauses.push(`p.relative_path IN (${filter.relative_paths.map(() => "?").join(", ")})`);
|
|
103
|
+
params.push(...filter.relative_paths);
|
|
104
|
+
}
|
|
105
|
+
return clauses;
|
|
106
|
+
}
|
|
107
|
+
function buildPageExistsSql(recordIdExpr, request, params) {
|
|
108
|
+
const pagePredicates = buildPageFilterSql(request, params);
|
|
109
|
+
if (pagePredicates.length === 0) {
|
|
110
|
+
return [];
|
|
111
|
+
}
|
|
112
|
+
return [
|
|
113
|
+
`EXISTS (
|
|
114
|
+
SELECT 1
|
|
115
|
+
FROM soil_page_members spm
|
|
116
|
+
JOIN soil_pages p ON p.page_id = spm.page_id
|
|
117
|
+
WHERE spm.record_id = ${recordIdExpr}
|
|
118
|
+
AND ${pagePredicates.join(" AND ")}
|
|
119
|
+
)`,
|
|
120
|
+
];
|
|
121
|
+
}
|
|
122
|
+
function buildCandidatePageIdSql(recordIdExpr, request, params) {
|
|
123
|
+
const pagePredicates = buildPageFilterSql(request, params);
|
|
124
|
+
const baseQuery = pagePredicates.length > 0
|
|
125
|
+
? `SELECT spm.page_id
|
|
126
|
+
FROM soil_page_members spm
|
|
127
|
+
JOIN soil_pages p ON p.page_id = spm.page_id
|
|
128
|
+
WHERE spm.record_id = ${recordIdExpr}
|
|
129
|
+
AND ${pagePredicates.join(" AND ")}
|
|
130
|
+
ORDER BY CASE WHEN spm.role = 'primary' THEN 0 ELSE 1 END, spm.ordinal, p.relative_path, spm.page_id
|
|
131
|
+
LIMIT 1`
|
|
132
|
+
: `SELECT spm.page_id
|
|
133
|
+
FROM soil_page_members spm
|
|
134
|
+
WHERE spm.record_id = ${recordIdExpr}
|
|
135
|
+
ORDER BY CASE WHEN spm.role = 'primary' THEN 0 ELSE 1 END, spm.ordinal, spm.page_id
|
|
136
|
+
LIMIT 1`;
|
|
137
|
+
return `(${baseQuery})`;
|
|
138
|
+
}
|
|
139
|
+
export function lookupDirectCandidates(db, input) {
|
|
140
|
+
const request = SoilSearchRequestSchema.parse(input);
|
|
141
|
+
if (!request.direct_lookup) {
|
|
142
|
+
return { request, candidates: [] };
|
|
143
|
+
}
|
|
144
|
+
const pageParams = [request.query, request.query, request.query];
|
|
145
|
+
const pageWhere = ["(soil_id = ? OR relative_path = ? OR page_id = ?)"];
|
|
146
|
+
pageWhere.push(...buildPageFilterSql(request, pageParams));
|
|
147
|
+
pageParams.push(request.limit);
|
|
148
|
+
const pageMatches = db.prepare(`
|
|
149
|
+
SELECT page_id, soil_id
|
|
150
|
+
FROM soil_pages p
|
|
151
|
+
WHERE ${pageWhere.join(" AND ")}
|
|
152
|
+
LIMIT ?
|
|
153
|
+
`).all(...pageParams);
|
|
154
|
+
const recordParams = [request.query, request.query, request.query, request.query];
|
|
155
|
+
const recordWhere = ["(r.record_id = ? OR r.record_key = ? OR r.soil_id = ? OR r.source_id = ?)"];
|
|
156
|
+
recordWhere.push(...buildRecordFilterSql(request, recordParams));
|
|
157
|
+
recordParams.push(request.limit);
|
|
158
|
+
const recordRows = db.prepare(`
|
|
159
|
+
SELECT *
|
|
160
|
+
FROM soil_records r
|
|
161
|
+
WHERE ${recordWhere.join(" AND ")}
|
|
162
|
+
LIMIT ?
|
|
163
|
+
`).all(...recordParams);
|
|
164
|
+
const pageIdBySoilId = new Map();
|
|
165
|
+
for (const page of pageMatches) {
|
|
166
|
+
if (!pageIdBySoilId.has(page.soil_id)) {
|
|
167
|
+
pageIdBySoilId.set(page.soil_id, page.page_id);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
const firstChunkByRecordId = new Map();
|
|
171
|
+
const recordIds = unique(recordRows.map((row) => row.record_id));
|
|
172
|
+
if (recordIds.length > 0) {
|
|
173
|
+
const chunkRows = db
|
|
174
|
+
.prepare(`
|
|
175
|
+
SELECT *
|
|
176
|
+
FROM soil_chunks
|
|
177
|
+
WHERE record_id IN (${recordIds.map(() => "?").join(", ")})
|
|
178
|
+
ORDER BY record_id, chunk_index
|
|
179
|
+
`)
|
|
180
|
+
.all(...recordIds);
|
|
181
|
+
for (const chunk of chunkRows) {
|
|
182
|
+
if (!firstChunkByRecordId.has(chunk.record_id)) {
|
|
183
|
+
firstChunkByRecordId.set(chunk.record_id, chunk);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
const firstPageMemberByPageId = new Map();
|
|
188
|
+
const pageIds = unique(pageMatches.map((page) => page.page_id));
|
|
189
|
+
if (pageIds.length > 0) {
|
|
190
|
+
const pageMemberRows = db
|
|
191
|
+
.prepare(`
|
|
192
|
+
SELECT spm.page_id, spm.record_id, sc.chunk_id, sc.chunk_text
|
|
193
|
+
FROM soil_page_members spm
|
|
194
|
+
LEFT JOIN soil_chunks sc ON sc.record_id = spm.record_id
|
|
195
|
+
WHERE spm.page_id IN (${pageIds.map(() => "?").join(", ")})
|
|
196
|
+
ORDER BY spm.page_id, spm.ordinal, sc.chunk_index
|
|
197
|
+
`)
|
|
198
|
+
.all(...pageIds);
|
|
199
|
+
for (const row of pageMemberRows) {
|
|
200
|
+
if (!firstPageMemberByPageId.has(row.page_id)) {
|
|
201
|
+
firstPageMemberByPageId.set(row.page_id, row);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
const candidates = [];
|
|
206
|
+
const representedPageIds = new Set();
|
|
207
|
+
for (const row of recordRows) {
|
|
208
|
+
const chunk = firstChunkByRecordId.get(row.record_id);
|
|
209
|
+
const page_id = pageIdBySoilId.get(row.soil_id) ?? null;
|
|
210
|
+
if (page_id) {
|
|
211
|
+
representedPageIds.add(page_id);
|
|
212
|
+
}
|
|
213
|
+
candidates.push({
|
|
214
|
+
chunk_id: chunk?.chunk_id ?? `record:${row.record_id}`,
|
|
215
|
+
record_id: row.record_id,
|
|
216
|
+
soil_id: row.soil_id,
|
|
217
|
+
lane: "direct",
|
|
218
|
+
rank: candidates.length + 1,
|
|
219
|
+
score: 1,
|
|
220
|
+
snippet: chunk ? buildSnippet(chunk.chunk_text, request.query) : row.summary ?? row.title,
|
|
221
|
+
page_id,
|
|
222
|
+
metadata_json: parseJsonObject(row.metadata_json),
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
for (const page of pageMatches) {
|
|
226
|
+
if (representedPageIds.has(page.page_id))
|
|
227
|
+
continue;
|
|
228
|
+
representedPageIds.add(page.page_id);
|
|
229
|
+
const member = firstPageMemberByPageId.get(page.page_id);
|
|
230
|
+
candidates.push({
|
|
231
|
+
chunk_id: member?.chunk_id ?? `page:${page.page_id}`,
|
|
232
|
+
record_id: member?.record_id ?? `page:${page.page_id}`,
|
|
233
|
+
soil_id: page.soil_id,
|
|
234
|
+
lane: "direct",
|
|
235
|
+
rank: candidates.length + 1,
|
|
236
|
+
score: 1,
|
|
237
|
+
snippet: member?.chunk_text ? buildSnippet(member.chunk_text, request.query) : page.soil_id,
|
|
238
|
+
page_id: page.page_id,
|
|
239
|
+
metadata_json: {},
|
|
240
|
+
});
|
|
241
|
+
}
|
|
242
|
+
return { request, candidates: candidates.slice(0, request.limit) };
|
|
243
|
+
}
|
|
244
|
+
export function searchLexicalCandidates(db, input) {
|
|
245
|
+
const request = SoilSearchRequestSchema.parse(input);
|
|
246
|
+
const pageIdParams = [];
|
|
247
|
+
const pageIdSql = buildCandidatePageIdSql("r.record_id", request, pageIdParams);
|
|
248
|
+
const whereParams = [];
|
|
249
|
+
const where = ["soil_chunk_fts MATCH ?"];
|
|
250
|
+
where.push(...buildRecordFilterSql(request, whereParams));
|
|
251
|
+
where.push(...buildPageExistsSql("r.record_id", request, whereParams));
|
|
252
|
+
const params = [...pageIdParams, request.query, ...whereParams, request.lexical_top_k];
|
|
253
|
+
const rows = db.prepare(`
|
|
254
|
+
SELECT
|
|
255
|
+
soil_chunk_fts.chunk_id AS chunk_id,
|
|
256
|
+
soil_chunk_fts.record_id AS record_id,
|
|
257
|
+
soil_chunk_fts.soil_id AS soil_id,
|
|
258
|
+
${pageIdSql} AS page_id,
|
|
259
|
+
r.title AS title,
|
|
260
|
+
r.summary AS summary,
|
|
261
|
+
sc.chunk_text AS chunk_text,
|
|
262
|
+
bm25(soil_chunk_fts, 8.0, 5.0, 3.0, 1.0) AS score
|
|
263
|
+
FROM soil_chunk_fts
|
|
264
|
+
JOIN soil_chunks sc ON sc.chunk_id = soil_chunk_fts.chunk_id
|
|
265
|
+
JOIN soil_records r ON r.record_id = soil_chunk_fts.record_id
|
|
266
|
+
WHERE ${where.join(" AND ")}
|
|
267
|
+
ORDER BY score
|
|
268
|
+
LIMIT ?
|
|
269
|
+
`).all(...params);
|
|
270
|
+
const candidates = rows.map((row, index) => ({
|
|
271
|
+
chunk_id: row.chunk_id,
|
|
272
|
+
record_id: row.record_id,
|
|
273
|
+
soil_id: row.soil_id,
|
|
274
|
+
page_id: row.page_id,
|
|
275
|
+
lane: "lexical",
|
|
276
|
+
rank: index + 1,
|
|
277
|
+
score: -1 * row.score,
|
|
278
|
+
snippet: buildSnippet(row.chunk_text, request.query),
|
|
279
|
+
metadata_json: { title: row.title, summary: row.summary },
|
|
280
|
+
}));
|
|
281
|
+
return dedupeCandidates(candidates, request.limit);
|
|
282
|
+
}
|
|
283
|
+
export function searchDenseCandidates(db, input, excludedRecordIds) {
|
|
284
|
+
const request = SoilSearchRequestSchema.parse(input);
|
|
285
|
+
if (!request.query_embedding?.length) {
|
|
286
|
+
return [];
|
|
287
|
+
}
|
|
288
|
+
const pageIdParams = [];
|
|
289
|
+
const pageIdSql = buildCandidatePageIdSql("r.record_id", request, pageIdParams);
|
|
290
|
+
const params = [];
|
|
291
|
+
const where = buildRecordFilterSql(request, params);
|
|
292
|
+
where.push(...buildPageExistsSql("r.record_id", request, params));
|
|
293
|
+
const denseCandidateRecordIds = request.dense_candidate_record_ids ? unique(request.dense_candidate_record_ids) : null;
|
|
294
|
+
if (denseCandidateRecordIds?.length === 0) {
|
|
295
|
+
return [];
|
|
296
|
+
}
|
|
297
|
+
if (denseCandidateRecordIds) {
|
|
298
|
+
where.push(`r.record_id IN (${denseCandidateRecordIds.map(() => "?").join(", ")})`);
|
|
299
|
+
params.push(...denseCandidateRecordIds);
|
|
300
|
+
}
|
|
301
|
+
if (excludedRecordIds.length > 0) {
|
|
302
|
+
where.push(`r.record_id NOT IN (${excludedRecordIds.map(() => "?").join(", ")})`);
|
|
303
|
+
params.push(...excludedRecordIds);
|
|
304
|
+
}
|
|
305
|
+
if (request.query_embedding_model) {
|
|
306
|
+
where.push("se.model = ?");
|
|
307
|
+
params.push(request.query_embedding_model);
|
|
308
|
+
}
|
|
309
|
+
where.push(`
|
|
310
|
+
NOT EXISTS (
|
|
311
|
+
SELECT 1
|
|
312
|
+
FROM soil_embeddings newer
|
|
313
|
+
WHERE newer.chunk_id = se.chunk_id
|
|
314
|
+
AND newer.model = se.model
|
|
315
|
+
AND newer.embedding_version > se.embedding_version
|
|
316
|
+
)
|
|
317
|
+
`);
|
|
318
|
+
const queryParams = [...pageIdParams, ...params];
|
|
319
|
+
const rows = db.prepare(`
|
|
320
|
+
SELECT
|
|
321
|
+
se.chunk_id,
|
|
322
|
+
se.model,
|
|
323
|
+
se.embedding_version,
|
|
324
|
+
se.encoding,
|
|
325
|
+
se.embedding,
|
|
326
|
+
se.embedded_at,
|
|
327
|
+
sc.record_id,
|
|
328
|
+
sc.soil_id,
|
|
329
|
+
sc.chunk_text,
|
|
330
|
+
r.title,
|
|
331
|
+
r.summary,
|
|
332
|
+
${pageIdSql} AS page_id
|
|
333
|
+
FROM soil_embeddings se
|
|
334
|
+
JOIN soil_chunks sc ON sc.chunk_id = se.chunk_id
|
|
335
|
+
JOIN soil_records r ON r.record_id = sc.record_id
|
|
336
|
+
${where.length > 0 ? `WHERE ${where.join(" AND ")}` : ""}
|
|
337
|
+
`).all(...queryParams);
|
|
338
|
+
const scored = [];
|
|
339
|
+
for (const row of rows) {
|
|
340
|
+
try {
|
|
341
|
+
scored.push({
|
|
342
|
+
row,
|
|
343
|
+
similarity: cosineSimilarity(request.query_embedding, decodeEmbedding(row)),
|
|
344
|
+
});
|
|
345
|
+
}
|
|
346
|
+
catch {
|
|
347
|
+
continue;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
scored.sort((left, right) => right.similarity - left.similarity);
|
|
351
|
+
const candidates = scored.slice(0, request.dense_top_k).map(({ row, similarity }, index) => ({
|
|
352
|
+
chunk_id: row.chunk_id,
|
|
353
|
+
record_id: row.record_id,
|
|
354
|
+
soil_id: row.soil_id,
|
|
355
|
+
page_id: row.page_id,
|
|
356
|
+
lane: "dense",
|
|
357
|
+
rank: index + 1,
|
|
358
|
+
score: similarity,
|
|
359
|
+
snippet: buildSnippet(row.chunk_text, request.query),
|
|
360
|
+
metadata_json: { model: row.model, embedding_version: row.embedding_version, title: row.title, summary: row.summary },
|
|
361
|
+
}));
|
|
362
|
+
return dedupeCandidates(candidates, request.limit);
|
|
363
|
+
}
|
|
364
|
+
export function shouldRunDenseSearch(request, lexicalRecordIds) {
|
|
365
|
+
return lexicalRecordIds.length > 0 || hasExplicitMetadataFilter(request);
|
|
366
|
+
}
|
|
367
|
+
//# sourceMappingURL=sqlite-repository-search.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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AAC,MAAM,GAAG,CAAC,IAAI,yBAAyB,CAAC,OAAO,CAAC,CAAC;AAC3E,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type SoilMutationInput, type SoilPageMember } from "./contracts.js";
|
|
2
|
+
import { type SqliteDatabase } from "./sqlite-repository-helpers.js";
|
|
3
|
+
export declare function initializeSoilSqlite(db: SqliteDatabase): void;
|
|
4
|
+
export declare function initializeReadonlySoilSqlite(db: SqliteDatabase): void;
|
|
5
|
+
export declare function applySoilMutation(db: SqliteDatabase, input: SoilMutationInput): void;
|
|
6
|
+
export declare function replaceSoilPageMembers(db: SqliteDatabase, pageId: string, members: SoilPageMember[]): void;
|
|
7
|
+
export declare function loadOpenEmbeddingReindexRecordIds(db: SqliteDatabase): string[];
|
|
8
|
+
//# sourceMappingURL=sqlite-repository-storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sqlite-repository-storage.d.ts","sourceRoot":"","sources":["../../../src/platform/soil/sqlite-repository-storage.ts"],"names":[],"mappings":"AAEA,OAAO,EAIL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EACpB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAKL,KAAK,cAAc,EAEpB,MAAM,gCAAgC,CAAC;AAExC,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,CAI7D;AAED,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,cAAc,GAAG,IAAI,CAErE;AAED,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,cAAc,EAAE,KAAK,EAAE,iBAAiB,GAAG,IAAI,CA8MpF;AAED,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,GAAG,IAAI,CAY1G;AAED,wBAAgB,iCAAiC,CAAC,EAAE,EAAE,cAAc,GAAG,MAAM,EAAE,CAY9E"}
|