@iflow-mcp/jkheadley-instar 0.26.2
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/.claude/hooks/free-text-guard.sh +117 -0
- package/.claude/settings.json +201 -0
- package/.claude/skills/autonomous/hooks/autonomous-stop-hook.sh +234 -0
- package/.claude/skills/autonomous/hooks/hooks.json +15 -0
- package/.claude/skills/autonomous/scripts/setup-autonomous.sh +166 -0
- package/.claude/skills/autonomous/skill.md +254 -0
- package/.claude/skills/secret-setup/skill.md +210 -0
- package/.claude/skills/setup-wizard/skill.md +2132 -0
- package/LICENSE +21 -0
- package/README.md +214 -0
- package/dashboard/favicon.png +0 -0
- package/dashboard/index.html +5740 -0
- package/dashboard/logo.png +0 -0
- package/dist/cli.d.ts +21 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +1782 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/backup.d.ts +16 -0
- package/dist/commands/backup.d.ts.map +1 -0
- package/dist/commands/backup.js +84 -0
- package/dist/commands/backup.js.map +1 -0
- package/dist/commands/discovery.d.ts +158 -0
- package/dist/commands/discovery.d.ts.map +1 -0
- package/dist/commands/discovery.js +532 -0
- package/dist/commands/discovery.js.map +1 -0
- package/dist/commands/git.d.ts +25 -0
- package/dist/commands/git.d.ts.map +1 -0
- package/dist/commands/git.js +152 -0
- package/dist/commands/git.js.map +1 -0
- package/dist/commands/init.d.ts +52 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +4211 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/intent.d.ts +30 -0
- package/dist/commands/intent.d.ts.map +1 -0
- package/dist/commands/intent.js +349 -0
- package/dist/commands/intent.js.map +1 -0
- package/dist/commands/job.d.ts +42 -0
- package/dist/commands/job.d.ts.map +1 -0
- package/dist/commands/job.js +202 -0
- package/dist/commands/job.js.map +1 -0
- package/dist/commands/knowledge.d.ts +25 -0
- package/dist/commands/knowledge.d.ts.map +1 -0
- package/dist/commands/knowledge.js +127 -0
- package/dist/commands/knowledge.js.map +1 -0
- package/dist/commands/machine.d.ts +53 -0
- package/dist/commands/machine.d.ts.map +1 -0
- package/dist/commands/machine.js +680 -0
- package/dist/commands/machine.js.map +1 -0
- package/dist/commands/memory.d.ts +24 -0
- package/dist/commands/memory.d.ts.map +1 -0
- package/dist/commands/memory.js +163 -0
- package/dist/commands/memory.js.map +1 -0
- package/dist/commands/nuke.d.ts +22 -0
- package/dist/commands/nuke.d.ts.map +1 -0
- package/dist/commands/nuke.js +216 -0
- package/dist/commands/nuke.js.map +1 -0
- package/dist/commands/org.d.ts +16 -0
- package/dist/commands/org.d.ts.map +1 -0
- package/dist/commands/org.js +69 -0
- package/dist/commands/org.js.map +1 -0
- package/dist/commands/playbook.d.ts +91 -0
- package/dist/commands/playbook.d.ts.map +1 -0
- package/dist/commands/playbook.js +1016 -0
- package/dist/commands/playbook.js.map +1 -0
- package/dist/commands/reflect.d.ts +52 -0
- package/dist/commands/reflect.d.ts.map +1 -0
- package/dist/commands/reflect.js +316 -0
- package/dist/commands/reflect.js.map +1 -0
- package/dist/commands/relationship.d.ts +17 -0
- package/dist/commands/relationship.d.ts.map +1 -0
- package/dist/commands/relationship.js +156 -0
- package/dist/commands/relationship.js.map +1 -0
- package/dist/commands/relay.d.ts +26 -0
- package/dist/commands/relay.d.ts.map +1 -0
- package/dist/commands/relay.js +121 -0
- package/dist/commands/relay.js.map +1 -0
- package/dist/commands/review.d.ts +18 -0
- package/dist/commands/review.d.ts.map +1 -0
- package/dist/commands/review.js +193 -0
- package/dist/commands/review.js.map +1 -0
- package/dist/commands/semantic.d.ts +37 -0
- package/dist/commands/semantic.d.ts.map +1 -0
- package/dist/commands/semantic.js +198 -0
- package/dist/commands/semantic.js.map +1 -0
- package/dist/commands/server.d.ts +37 -0
- package/dist/commands/server.d.ts.map +1 -0
- package/dist/commands/server.js +4875 -0
- package/dist/commands/server.js.map +1 -0
- package/dist/commands/setup.d.ts +63 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +1235 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/slack-cli.d.ts +16 -0
- package/dist/commands/slack-cli.d.ts.map +1 -0
- package/dist/commands/slack-cli.js +259 -0
- package/dist/commands/slack-cli.js.map +1 -0
- package/dist/commands/status.d.ts +11 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +120 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/user.d.ts +17 -0
- package/dist/commands/user.d.ts.map +1 -0
- package/dist/commands/user.js +53 -0
- package/dist/commands/user.js.map +1 -0
- package/dist/commands/whatsapp.d.ts +31 -0
- package/dist/commands/whatsapp.d.ts.map +1 -0
- package/dist/commands/whatsapp.js +408 -0
- package/dist/commands/whatsapp.js.map +1 -0
- package/dist/config/ConfigDefaults.d.ts +40 -0
- package/dist/config/ConfigDefaults.d.ts.map +1 -0
- package/dist/config/ConfigDefaults.js +175 -0
- package/dist/config/ConfigDefaults.js.map +1 -0
- package/dist/config/LiveConfig.d.ts +97 -0
- package/dist/config/LiveConfig.d.ts.map +1 -0
- package/dist/config/LiveConfig.js +220 -0
- package/dist/config/LiveConfig.js.map +1 -0
- package/dist/core/AccessControl.d.ts +91 -0
- package/dist/core/AccessControl.d.ts.map +1 -0
- package/dist/core/AccessControl.js +184 -0
- package/dist/core/AccessControl.js.map +1 -0
- package/dist/core/AdaptationValidator.d.ts +44 -0
- package/dist/core/AdaptationValidator.d.ts.map +1 -0
- package/dist/core/AdaptationValidator.js +132 -0
- package/dist/core/AdaptationValidator.js.map +1 -0
- package/dist/core/AdaptiveTrust.d.ts +188 -0
- package/dist/core/AdaptiveTrust.d.ts.map +1 -0
- package/dist/core/AdaptiveTrust.js +354 -0
- package/dist/core/AdaptiveTrust.js.map +1 -0
- package/dist/core/AgentBus.d.ts +168 -0
- package/dist/core/AgentBus.d.ts.map +1 -0
- package/dist/core/AgentBus.js +369 -0
- package/dist/core/AgentBus.js.map +1 -0
- package/dist/core/AgentConnector.d.ts +76 -0
- package/dist/core/AgentConnector.d.ts.map +1 -0
- package/dist/core/AgentConnector.js +324 -0
- package/dist/core/AgentConnector.js.map +1 -0
- package/dist/core/AgentRegistry.d.ts +107 -0
- package/dist/core/AgentRegistry.d.ts.map +1 -0
- package/dist/core/AgentRegistry.js +569 -0
- package/dist/core/AgentRegistry.js.map +1 -0
- package/dist/core/AnthropicIntelligenceProvider.d.ts +24 -0
- package/dist/core/AnthropicIntelligenceProvider.d.ts.map +1 -0
- package/dist/core/AnthropicIntelligenceProvider.js +63 -0
- package/dist/core/AnthropicIntelligenceProvider.js.map +1 -0
- package/dist/core/AuditTrail.d.ts +207 -0
- package/dist/core/AuditTrail.d.ts.map +1 -0
- package/dist/core/AuditTrail.js +271 -0
- package/dist/core/AuditTrail.js.map +1 -0
- package/dist/core/AutoApprover.d.ts +63 -0
- package/dist/core/AutoApprover.d.ts.map +1 -0
- package/dist/core/AutoApprover.js +151 -0
- package/dist/core/AutoApprover.js.map +1 -0
- package/dist/core/AutoDispatcher.d.ts +170 -0
- package/dist/core/AutoDispatcher.d.ts.map +1 -0
- package/dist/core/AutoDispatcher.js +647 -0
- package/dist/core/AutoDispatcher.js.map +1 -0
- package/dist/core/AutoUpdater.d.ts +193 -0
- package/dist/core/AutoUpdater.d.ts.map +1 -0
- package/dist/core/AutoUpdater.js +648 -0
- package/dist/core/AutoUpdater.js.map +1 -0
- package/dist/core/AutonomousEvolution.d.ts +168 -0
- package/dist/core/AutonomousEvolution.d.ts.map +1 -0
- package/dist/core/AutonomousEvolution.js +384 -0
- package/dist/core/AutonomousEvolution.js.map +1 -0
- package/dist/core/AutonomyProfileManager.d.ts +108 -0
- package/dist/core/AutonomyProfileManager.d.ts.map +1 -0
- package/dist/core/AutonomyProfileManager.js +323 -0
- package/dist/core/AutonomyProfileManager.js.map +1 -0
- package/dist/core/AutonomySkill.d.ts +98 -0
- package/dist/core/AutonomySkill.d.ts.map +1 -0
- package/dist/core/AutonomySkill.js +497 -0
- package/dist/core/AutonomySkill.js.map +1 -0
- package/dist/core/BackupManager.d.ts +66 -0
- package/dist/core/BackupManager.d.ts.map +1 -0
- package/dist/core/BackupManager.js +266 -0
- package/dist/core/BackupManager.js.map +1 -0
- package/dist/core/BitwardenProvider.d.ts +85 -0
- package/dist/core/BitwardenProvider.d.ts.map +1 -0
- package/dist/core/BitwardenProvider.js +437 -0
- package/dist/core/BitwardenProvider.js.map +1 -0
- package/dist/core/BlockerLearningLoop.d.ts +99 -0
- package/dist/core/BlockerLearningLoop.d.ts.map +1 -0
- package/dist/core/BlockerLearningLoop.js +205 -0
- package/dist/core/BlockerLearningLoop.js.map +1 -0
- package/dist/core/BranchManager.d.ts +165 -0
- package/dist/core/BranchManager.d.ts.map +1 -0
- package/dist/core/BranchManager.js +413 -0
- package/dist/core/BranchManager.js.map +1 -0
- package/dist/core/CaffeinateManager.d.ts +50 -0
- package/dist/core/CaffeinateManager.d.ts.map +1 -0
- package/dist/core/CaffeinateManager.js +189 -0
- package/dist/core/CaffeinateManager.js.map +1 -0
- package/dist/core/CallbackRegistry.d.ts +67 -0
- package/dist/core/CallbackRegistry.d.ts.map +1 -0
- package/dist/core/CallbackRegistry.js +145 -0
- package/dist/core/CallbackRegistry.js.map +1 -0
- package/dist/core/CanonicalState.d.ts +132 -0
- package/dist/core/CanonicalState.d.ts.map +1 -0
- package/dist/core/CanonicalState.js +297 -0
- package/dist/core/CanonicalState.js.map +1 -0
- package/dist/core/CapabilityMapper.d.ts +192 -0
- package/dist/core/CapabilityMapper.d.ts.map +1 -0
- package/dist/core/CapabilityMapper.js +958 -0
- package/dist/core/CapabilityMapper.js.map +1 -0
- package/dist/core/CapabilityRegistryGenerator.d.ts +72 -0
- package/dist/core/CapabilityRegistryGenerator.d.ts.map +1 -0
- package/dist/core/CapabilityRegistryGenerator.js +310 -0
- package/dist/core/CapabilityRegistryGenerator.js.map +1 -0
- package/dist/core/ClaudeCliIntelligenceProvider.d.ts +21 -0
- package/dist/core/ClaudeCliIntelligenceProvider.d.ts.map +1 -0
- package/dist/core/ClaudeCliIntelligenceProvider.js +60 -0
- package/dist/core/ClaudeCliIntelligenceProvider.js.map +1 -0
- package/dist/core/CoherenceGate.d.ts +198 -0
- package/dist/core/CoherenceGate.d.ts.map +1 -0
- package/dist/core/CoherenceGate.js +986 -0
- package/dist/core/CoherenceGate.js.map +1 -0
- package/dist/core/CoherenceReviewer.d.ts +104 -0
- package/dist/core/CoherenceReviewer.d.ts.map +1 -0
- package/dist/core/CoherenceReviewer.js +185 -0
- package/dist/core/CoherenceReviewer.js.map +1 -0
- package/dist/core/Config.d.ts +32 -0
- package/dist/core/Config.d.ts.map +1 -0
- package/dist/core/Config.js +332 -0
- package/dist/core/Config.js.map +1 -0
- package/dist/core/ConflictNegotiator.d.ts +167 -0
- package/dist/core/ConflictNegotiator.d.ts.map +1 -0
- package/dist/core/ConflictNegotiator.js +280 -0
- package/dist/core/ConflictNegotiator.js.map +1 -0
- package/dist/core/ContextHierarchy.d.ts +102 -0
- package/dist/core/ContextHierarchy.d.ts.map +1 -0
- package/dist/core/ContextHierarchy.js +594 -0
- package/dist/core/ContextHierarchy.js.map +1 -0
- package/dist/core/ContextSnapshotBuilder.d.ts +80 -0
- package/dist/core/ContextSnapshotBuilder.d.ts.map +1 -0
- package/dist/core/ContextSnapshotBuilder.js +342 -0
- package/dist/core/ContextSnapshotBuilder.js.map +1 -0
- package/dist/core/ContextualEvaluator.d.ts +103 -0
- package/dist/core/ContextualEvaluator.d.ts.map +1 -0
- package/dist/core/ContextualEvaluator.js +389 -0
- package/dist/core/ContextualEvaluator.js.map +1 -0
- package/dist/core/ConvergenceChecker.d.ts +24 -0
- package/dist/core/ConvergenceChecker.d.ts.map +1 -0
- package/dist/core/ConvergenceChecker.js +113 -0
- package/dist/core/ConvergenceChecker.js.map +1 -0
- package/dist/core/CoordinationProtocol.d.ts +198 -0
- package/dist/core/CoordinationProtocol.d.ts.map +1 -0
- package/dist/core/CoordinationProtocol.js +363 -0
- package/dist/core/CoordinationProtocol.js.map +1 -0
- package/dist/core/CustomReviewerLoader.d.ts +45 -0
- package/dist/core/CustomReviewerLoader.d.ts.map +1 -0
- package/dist/core/CustomReviewerLoader.js +153 -0
- package/dist/core/CustomReviewerLoader.js.map +1 -0
- package/dist/core/DecisionJournal.d.ts +56 -0
- package/dist/core/DecisionJournal.d.ts.map +1 -0
- package/dist/core/DecisionJournal.js +132 -0
- package/dist/core/DecisionJournal.js.map +1 -0
- package/dist/core/DeferredDispatchTracker.d.ts +91 -0
- package/dist/core/DeferredDispatchTracker.d.ts.map +1 -0
- package/dist/core/DeferredDispatchTracker.js +213 -0
- package/dist/core/DeferredDispatchTracker.js.map +1 -0
- package/dist/core/DiscoveryEvaluator.d.ts +131 -0
- package/dist/core/DiscoveryEvaluator.d.ts.map +1 -0
- package/dist/core/DiscoveryEvaluator.js +377 -0
- package/dist/core/DiscoveryEvaluator.js.map +1 -0
- package/dist/core/DispatchDecisionJournal.d.ts +83 -0
- package/dist/core/DispatchDecisionJournal.d.ts.map +1 -0
- package/dist/core/DispatchDecisionJournal.js +181 -0
- package/dist/core/DispatchDecisionJournal.js.map +1 -0
- package/dist/core/DispatchExecutor.d.ts +127 -0
- package/dist/core/DispatchExecutor.d.ts.map +1 -0
- package/dist/core/DispatchExecutor.js +355 -0
- package/dist/core/DispatchExecutor.js.map +1 -0
- package/dist/core/DispatchManager.d.ts +200 -0
- package/dist/core/DispatchManager.d.ts.map +1 -0
- package/dist/core/DispatchManager.js +524 -0
- package/dist/core/DispatchManager.js.map +1 -0
- package/dist/core/DispatchScopeEnforcer.d.ts +57 -0
- package/dist/core/DispatchScopeEnforcer.d.ts.map +1 -0
- package/dist/core/DispatchScopeEnforcer.js +173 -0
- package/dist/core/DispatchScopeEnforcer.js.map +1 -0
- package/dist/core/DispatchVerifier.d.ts +76 -0
- package/dist/core/DispatchVerifier.d.ts.map +1 -0
- package/dist/core/DispatchVerifier.js +128 -0
- package/dist/core/DispatchVerifier.js.map +1 -0
- package/dist/core/EvolutionManager.d.ts +223 -0
- package/dist/core/EvolutionManager.d.ts.map +1 -0
- package/dist/core/EvolutionManager.js +630 -0
- package/dist/core/EvolutionManager.js.map +1 -0
- package/dist/core/ExecutionJournal.d.ts +101 -0
- package/dist/core/ExecutionJournal.d.ts.map +1 -0
- package/dist/core/ExecutionJournal.js +301 -0
- package/dist/core/ExecutionJournal.js.map +1 -0
- package/dist/core/ExternalOperationGate.d.ts +204 -0
- package/dist/core/ExternalOperationGate.d.ts.map +1 -0
- package/dist/core/ExternalOperationGate.js +413 -0
- package/dist/core/ExternalOperationGate.js.map +1 -0
- package/dist/core/FeatureDefinitions.d.ts +14 -0
- package/dist/core/FeatureDefinitions.d.ts.map +1 -0
- package/dist/core/FeatureDefinitions.js +374 -0
- package/dist/core/FeatureDefinitions.js.map +1 -0
- package/dist/core/FeatureRegistry.d.ts +337 -0
- package/dist/core/FeatureRegistry.d.ts.map +1 -0
- package/dist/core/FeatureRegistry.js +863 -0
- package/dist/core/FeatureRegistry.js.map +1 -0
- package/dist/core/FeedbackManager.d.ts +69 -0
- package/dist/core/FeedbackManager.d.ts.map +1 -0
- package/dist/core/FeedbackManager.js +284 -0
- package/dist/core/FeedbackManager.js.map +1 -0
- package/dist/core/FileClassifier.d.ts +74 -0
- package/dist/core/FileClassifier.d.ts.map +1 -0
- package/dist/core/FileClassifier.js +377 -0
- package/dist/core/FileClassifier.js.map +1 -0
- package/dist/core/ForegroundRestartWatcher.d.ts +55 -0
- package/dist/core/ForegroundRestartWatcher.d.ts.map +1 -0
- package/dist/core/ForegroundRestartWatcher.js +116 -0
- package/dist/core/ForegroundRestartWatcher.js.map +1 -0
- package/dist/core/GitStateManager.d.ts +78 -0
- package/dist/core/GitStateManager.d.ts.map +1 -0
- package/dist/core/GitStateManager.js +366 -0
- package/dist/core/GitStateManager.js.map +1 -0
- package/dist/core/GitSync.d.ts +199 -0
- package/dist/core/GitSync.d.ts.map +1 -0
- package/dist/core/GitSync.js +955 -0
- package/dist/core/GitSync.js.map +1 -0
- package/dist/core/GlobalInstallCleanup.d.ts +23 -0
- package/dist/core/GlobalInstallCleanup.d.ts.map +1 -0
- package/dist/core/GlobalInstallCleanup.js +130 -0
- package/dist/core/GlobalInstallCleanup.js.map +1 -0
- package/dist/core/GlobalSecretStore.d.ts +112 -0
- package/dist/core/GlobalSecretStore.d.ts.map +1 -0
- package/dist/core/GlobalSecretStore.js +396 -0
- package/dist/core/GlobalSecretStore.js.map +1 -0
- package/dist/core/HandoffManager.d.ts +163 -0
- package/dist/core/HandoffManager.d.ts.map +1 -0
- package/dist/core/HandoffManager.js +370 -0
- package/dist/core/HandoffManager.js.map +1 -0
- package/dist/core/HeartbeatManager.d.ts +120 -0
- package/dist/core/HeartbeatManager.d.ts.map +1 -0
- package/dist/core/HeartbeatManager.js +240 -0
- package/dist/core/HeartbeatManager.js.map +1 -0
- package/dist/core/InputGuard.d.ts +98 -0
- package/dist/core/InputGuard.d.ts.map +1 -0
- package/dist/core/InputGuard.js +316 -0
- package/dist/core/InputGuard.js.map +1 -0
- package/dist/core/IntentDriftDetector.d.ts +100 -0
- package/dist/core/IntentDriftDetector.d.ts.map +1 -0
- package/dist/core/IntentDriftDetector.js +325 -0
- package/dist/core/IntentDriftDetector.js.map +1 -0
- package/dist/core/JobReflector.d.ts +81 -0
- package/dist/core/JobReflector.d.ts.map +1 -0
- package/dist/core/JobReflector.js +244 -0
- package/dist/core/JobReflector.js.map +1 -0
- package/dist/core/LLMConflictResolver.d.ts +132 -0
- package/dist/core/LLMConflictResolver.d.ts.map +1 -0
- package/dist/core/LLMConflictResolver.js +372 -0
- package/dist/core/LLMConflictResolver.js.map +1 -0
- package/dist/core/LedgerAuth.d.ts +99 -0
- package/dist/core/LedgerAuth.d.ts.map +1 -0
- package/dist/core/LedgerAuth.js +215 -0
- package/dist/core/LedgerAuth.js.map +1 -0
- package/dist/core/MachineIdentity.d.ts +196 -0
- package/dist/core/MachineIdentity.d.ts.map +1 -0
- package/dist/core/MachineIdentity.js +476 -0
- package/dist/core/MachineIdentity.js.map +1 -0
- package/dist/core/MessageSentinel.d.ts +142 -0
- package/dist/core/MessageSentinel.d.ts.map +1 -0
- package/dist/core/MessageSentinel.js +426 -0
- package/dist/core/MessageSentinel.js.map +1 -0
- package/dist/core/MigrationProvenance.d.ts +62 -0
- package/dist/core/MigrationProvenance.d.ts.map +1 -0
- package/dist/core/MigrationProvenance.js +183 -0
- package/dist/core/MigrationProvenance.js.map +1 -0
- package/dist/core/MultiMachineCoordinator.d.ts +106 -0
- package/dist/core/MultiMachineCoordinator.d.ts.map +1 -0
- package/dist/core/MultiMachineCoordinator.js +311 -0
- package/dist/core/MultiMachineCoordinator.js.map +1 -0
- package/dist/core/NonceStore.d.ts +72 -0
- package/dist/core/NonceStore.d.ts.map +1 -0
- package/dist/core/NonceStore.js +163 -0
- package/dist/core/NonceStore.js.map +1 -0
- package/dist/core/OrgIntentManager.d.ts +58 -0
- package/dist/core/OrgIntentManager.d.ts.map +1 -0
- package/dist/core/OrgIntentManager.js +250 -0
- package/dist/core/OrgIntentManager.js.map +1 -0
- package/dist/core/OverlapGuard.d.ts +112 -0
- package/dist/core/OverlapGuard.d.ts.map +1 -0
- package/dist/core/OverlapGuard.js +241 -0
- package/dist/core/OverlapGuard.js.map +1 -0
- package/dist/core/PairingProtocol.d.ts +129 -0
- package/dist/core/PairingProtocol.d.ts.map +1 -0
- package/dist/core/PairingProtocol.js +265 -0
- package/dist/core/PairingProtocol.js.map +1 -0
- package/dist/core/PatternAnalyzer.d.ts +128 -0
- package/dist/core/PatternAnalyzer.d.ts.map +1 -0
- package/dist/core/PatternAnalyzer.js +388 -0
- package/dist/core/PatternAnalyzer.js.map +1 -0
- package/dist/core/PlatformActivityRegistry.d.ts +163 -0
- package/dist/core/PlatformActivityRegistry.d.ts.map +1 -0
- package/dist/core/PlatformActivityRegistry.js +307 -0
- package/dist/core/PlatformActivityRegistry.js.map +1 -0
- package/dist/core/PolicyEnforcementLayer.d.ts +63 -0
- package/dist/core/PolicyEnforcementLayer.d.ts.map +1 -0
- package/dist/core/PolicyEnforcementLayer.js +250 -0
- package/dist/core/PolicyEnforcementLayer.js.map +1 -0
- package/dist/core/PortRegistry.d.ts +9 -0
- package/dist/core/PortRegistry.d.ts.map +1 -0
- package/dist/core/PortRegistry.js +8 -0
- package/dist/core/PortRegistry.js.map +1 -0
- package/dist/core/PostUpdateMigrator.d.ts +170 -0
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -0
- package/dist/core/PostUpdateMigrator.js +3674 -0
- package/dist/core/PostUpdateMigrator.js.map +1 -0
- package/dist/core/Prerequisites.d.ts +37 -0
- package/dist/core/Prerequisites.d.ts.map +1 -0
- package/dist/core/Prerequisites.js +272 -0
- package/dist/core/Prerequisites.js.map +1 -0
- package/dist/core/ProcessIntegrity.d.ts +90 -0
- package/dist/core/ProcessIntegrity.d.ts.map +1 -0
- package/dist/core/ProcessIntegrity.js +119 -0
- package/dist/core/ProcessIntegrity.js.map +1 -0
- package/dist/core/ProjectMapper.d.ts +97 -0
- package/dist/core/ProjectMapper.d.ts.map +1 -0
- package/dist/core/ProjectMapper.js +370 -0
- package/dist/core/ProjectMapper.js.map +1 -0
- package/dist/core/PromptGuard.d.ts +121 -0
- package/dist/core/PromptGuard.d.ts.map +1 -0
- package/dist/core/PromptGuard.js +259 -0
- package/dist/core/PromptGuard.js.map +1 -0
- package/dist/core/RecipientResolver.d.ts +54 -0
- package/dist/core/RecipientResolver.d.ts.map +1 -0
- package/dist/core/RecipientResolver.js +143 -0
- package/dist/core/RecipientResolver.js.map +1 -0
- package/dist/core/ReflectionConsolidator.d.ts +73 -0
- package/dist/core/ReflectionConsolidator.d.ts.map +1 -0
- package/dist/core/ReflectionConsolidator.js +202 -0
- package/dist/core/ReflectionConsolidator.js.map +1 -0
- package/dist/core/RelationshipManager.d.ts +146 -0
- package/dist/core/RelationshipManager.d.ts.map +1 -0
- package/dist/core/RelationshipManager.js +736 -0
- package/dist/core/RelationshipManager.js.map +1 -0
- package/dist/core/RelevanceFilter.d.ts +61 -0
- package/dist/core/RelevanceFilter.d.ts.map +1 -0
- package/dist/core/RelevanceFilter.js +160 -0
- package/dist/core/RelevanceFilter.js.map +1 -0
- package/dist/core/ResearchRateLimiter.d.ts +76 -0
- package/dist/core/ResearchRateLimiter.d.ts.map +1 -0
- package/dist/core/ResearchRateLimiter.js +168 -0
- package/dist/core/ResearchRateLimiter.js.map +1 -0
- package/dist/core/ResumeValidator.d.ts +58 -0
- package/dist/core/ResumeValidator.d.ts.map +1 -0
- package/dist/core/ResumeValidator.js +195 -0
- package/dist/core/ResumeValidator.js.map +1 -0
- package/dist/core/ScopeCoherenceTracker.d.ts +87 -0
- package/dist/core/ScopeCoherenceTracker.d.ts.map +1 -0
- package/dist/core/ScopeCoherenceTracker.js +226 -0
- package/dist/core/ScopeCoherenceTracker.js.map +1 -0
- package/dist/core/ScopeVerifier.d.ts +122 -0
- package/dist/core/ScopeVerifier.d.ts.map +1 -0
- package/dist/core/ScopeVerifier.js +350 -0
- package/dist/core/ScopeVerifier.js.map +1 -0
- package/dist/core/SecretManager.d.ts +120 -0
- package/dist/core/SecretManager.d.ts.map +1 -0
- package/dist/core/SecretManager.js +324 -0
- package/dist/core/SecretManager.js.map +1 -0
- package/dist/core/SecretMigrator.d.ts +39 -0
- package/dist/core/SecretMigrator.d.ts.map +1 -0
- package/dist/core/SecretMigrator.js +182 -0
- package/dist/core/SecretMigrator.js.map +1 -0
- package/dist/core/SecretRedactor.d.ts +121 -0
- package/dist/core/SecretRedactor.d.ts.map +1 -0
- package/dist/core/SecretRedactor.js +309 -0
- package/dist/core/SecretRedactor.js.map +1 -0
- package/dist/core/SecretStore.d.ts +104 -0
- package/dist/core/SecretStore.d.ts.map +1 -0
- package/dist/core/SecretStore.js +405 -0
- package/dist/core/SecretStore.js.map +1 -0
- package/dist/core/SecurityLog.d.ts +58 -0
- package/dist/core/SecurityLog.d.ts.map +1 -0
- package/dist/core/SecurityLog.js +123 -0
- package/dist/core/SecurityLog.js.map +1 -0
- package/dist/core/SendGateway.d.ts +77 -0
- package/dist/core/SendGateway.d.ts.map +1 -0
- package/dist/core/SendGateway.js +181 -0
- package/dist/core/SendGateway.js.map +1 -0
- package/dist/core/SessionManager.d.ts +304 -0
- package/dist/core/SessionManager.d.ts.map +1 -0
- package/dist/core/SessionManager.js +1402 -0
- package/dist/core/SessionManager.js.map +1 -0
- package/dist/core/SleepWakeDetector.d.ts +37 -0
- package/dist/core/SleepWakeDetector.d.ts.map +1 -0
- package/dist/core/SleepWakeDetector.js +59 -0
- package/dist/core/SleepWakeDetector.js.map +1 -0
- package/dist/core/SoulManager.d.ts +107 -0
- package/dist/core/SoulManager.d.ts.map +1 -0
- package/dist/core/SoulManager.js +574 -0
- package/dist/core/SoulManager.js.map +1 -0
- package/dist/core/StaleProcessGuard.d.ts +113 -0
- package/dist/core/StaleProcessGuard.d.ts.map +1 -0
- package/dist/core/StaleProcessGuard.js +134 -0
- package/dist/core/StaleProcessGuard.js.map +1 -0
- package/dist/core/StateManager.d.ts +56 -0
- package/dist/core/StateManager.d.ts.map +1 -0
- package/dist/core/StateManager.js +266 -0
- package/dist/core/StateManager.js.map +1 -0
- package/dist/core/StateWriteAuthority.d.ts +101 -0
- package/dist/core/StateWriteAuthority.d.ts.map +1 -0
- package/dist/core/StateWriteAuthority.js +169 -0
- package/dist/core/StateWriteAuthority.js.map +1 -0
- package/dist/core/SurfacingTemplates.d.ts +63 -0
- package/dist/core/SurfacingTemplates.d.ts.map +1 -0
- package/dist/core/SurfacingTemplates.js +138 -0
- package/dist/core/SurfacingTemplates.js.map +1 -0
- package/dist/core/SyncOrchestrator.d.ts +308 -0
- package/dist/core/SyncOrchestrator.d.ts.map +1 -0
- package/dist/core/SyncOrchestrator.js +925 -0
- package/dist/core/SyncOrchestrator.js.map +1 -0
- package/dist/core/TemporalCoherenceChecker.d.ts +140 -0
- package/dist/core/TemporalCoherenceChecker.d.ts.map +1 -0
- package/dist/core/TemporalCoherenceChecker.js +375 -0
- package/dist/core/TemporalCoherenceChecker.js.map +1 -0
- package/dist/core/TopicClassifier.d.ts +54 -0
- package/dist/core/TopicClassifier.d.ts.map +1 -0
- package/dist/core/TopicClassifier.js +144 -0
- package/dist/core/TopicClassifier.js.map +1 -0
- package/dist/core/TopicResumeMap.d.ts +76 -0
- package/dist/core/TopicResumeMap.d.ts.map +1 -0
- package/dist/core/TopicResumeMap.js +252 -0
- package/dist/core/TopicResumeMap.js.map +1 -0
- package/dist/core/TrustElevationTracker.d.ts +178 -0
- package/dist/core/TrustElevationTracker.d.ts.map +1 -0
- package/dist/core/TrustElevationTracker.js +343 -0
- package/dist/core/TrustElevationTracker.js.map +1 -0
- package/dist/core/TrustRecovery.d.ts +109 -0
- package/dist/core/TrustRecovery.d.ts.map +1 -0
- package/dist/core/TrustRecovery.js +190 -0
- package/dist/core/TrustRecovery.js.map +1 -0
- package/dist/core/UpdateChecker.d.ts +108 -0
- package/dist/core/UpdateChecker.d.ts.map +1 -0
- package/dist/core/UpdateChecker.js +593 -0
- package/dist/core/UpdateChecker.js.map +1 -0
- package/dist/core/UpdateGate.d.ts +102 -0
- package/dist/core/UpdateGate.d.ts.map +1 -0
- package/dist/core/UpdateGate.js +149 -0
- package/dist/core/UpdateGate.js.map +1 -0
- package/dist/core/UpgradeGuideProcessor.d.ts +105 -0
- package/dist/core/UpgradeGuideProcessor.d.ts.map +1 -0
- package/dist/core/UpgradeGuideProcessor.js +278 -0
- package/dist/core/UpgradeGuideProcessor.js.map +1 -0
- package/dist/core/UpgradeNotifyManager.d.ts +98 -0
- package/dist/core/UpgradeNotifyManager.d.ts.map +1 -0
- package/dist/core/UpgradeNotifyManager.js +205 -0
- package/dist/core/UpgradeNotifyManager.js.map +1 -0
- package/dist/core/WorkLedger.d.ts +144 -0
- package/dist/core/WorkLedger.d.ts.map +1 -0
- package/dist/core/WorkLedger.js +246 -0
- package/dist/core/WorkLedger.js.map +1 -0
- package/dist/core/models.d.ts +70 -0
- package/dist/core/models.d.ts.map +1 -0
- package/dist/core/models.js +110 -0
- package/dist/core/models.js.map +1 -0
- package/dist/core/reviewers/capability-accuracy.d.ts +13 -0
- package/dist/core/reviewers/capability-accuracy.d.ts.map +1 -0
- package/dist/core/reviewers/capability-accuracy.js +38 -0
- package/dist/core/reviewers/capability-accuracy.js.map +1 -0
- package/dist/core/reviewers/claim-provenance.d.ts +14 -0
- package/dist/core/reviewers/claim-provenance.d.ts.map +1 -0
- package/dist/core/reviewers/claim-provenance.js +50 -0
- package/dist/core/reviewers/claim-provenance.js.map +1 -0
- package/dist/core/reviewers/context-completeness.d.ts +13 -0
- package/dist/core/reviewers/context-completeness.d.ts.map +1 -0
- package/dist/core/reviewers/context-completeness.js +43 -0
- package/dist/core/reviewers/context-completeness.js.map +1 -0
- package/dist/core/reviewers/conversational-tone.d.ts +13 -0
- package/dist/core/reviewers/conversational-tone.d.ts.map +1 -0
- package/dist/core/reviewers/conversational-tone.js +55 -0
- package/dist/core/reviewers/conversational-tone.js.map +1 -0
- package/dist/core/reviewers/escalation-resolution.d.ts +56 -0
- package/dist/core/reviewers/escalation-resolution.d.ts.map +1 -0
- package/dist/core/reviewers/escalation-resolution.js +239 -0
- package/dist/core/reviewers/escalation-resolution.js.map +1 -0
- package/dist/core/reviewers/gate-reviewer.d.ts +26 -0
- package/dist/core/reviewers/gate-reviewer.d.ts.map +1 -0
- package/dist/core/reviewers/gate-reviewer.js +130 -0
- package/dist/core/reviewers/gate-reviewer.js.map +1 -0
- package/dist/core/reviewers/information-leakage.d.ts +21 -0
- package/dist/core/reviewers/information-leakage.d.ts.map +1 -0
- package/dist/core/reviewers/information-leakage.js +72 -0
- package/dist/core/reviewers/information-leakage.js.map +1 -0
- package/dist/core/reviewers/settling-detection.d.ts +13 -0
- package/dist/core/reviewers/settling-detection.d.ts.map +1 -0
- package/dist/core/reviewers/settling-detection.js +48 -0
- package/dist/core/reviewers/settling-detection.js.map +1 -0
- package/dist/core/reviewers/url-validity.d.ts +18 -0
- package/dist/core/reviewers/url-validity.d.ts.map +1 -0
- package/dist/core/reviewers/url-validity.js +60 -0
- package/dist/core/reviewers/url-validity.js.map +1 -0
- package/dist/core/reviewers/value-alignment.d.ts +14 -0
- package/dist/core/reviewers/value-alignment.d.ts.map +1 -0
- package/dist/core/reviewers/value-alignment.js +71 -0
- package/dist/core/reviewers/value-alignment.js.map +1 -0
- package/dist/core/types.d.ts +2159 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +20 -0
- package/dist/core/types.js.map +1 -0
- package/dist/data/http-hook-templates.d.ts +53 -0
- package/dist/data/http-hook-templates.d.ts.map +1 -0
- package/dist/data/http-hook-templates.js +64 -0
- package/dist/data/http-hook-templates.js.map +1 -0
- package/dist/index.d.ts +263 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +164 -0
- package/dist/index.js.map +1 -0
- package/dist/knowledge/CoverageAuditor.d.ts +58 -0
- package/dist/knowledge/CoverageAuditor.d.ts.map +1 -0
- package/dist/knowledge/CoverageAuditor.js +153 -0
- package/dist/knowledge/CoverageAuditor.js.map +1 -0
- package/dist/knowledge/IntegrityManager.d.ts +46 -0
- package/dist/knowledge/IntegrityManager.d.ts.map +1 -0
- package/dist/knowledge/IntegrityManager.js +101 -0
- package/dist/knowledge/IntegrityManager.js.map +1 -0
- package/dist/knowledge/KnowledgeManager.d.ts +85 -0
- package/dist/knowledge/KnowledgeManager.d.ts.map +1 -0
- package/dist/knowledge/KnowledgeManager.js +194 -0
- package/dist/knowledge/KnowledgeManager.js.map +1 -0
- package/dist/knowledge/ProbeRegistry.d.ts +54 -0
- package/dist/knowledge/ProbeRegistry.d.ts.map +1 -0
- package/dist/knowledge/ProbeRegistry.js +119 -0
- package/dist/knowledge/ProbeRegistry.js.map +1 -0
- package/dist/knowledge/SelfKnowledgeTree.d.ts +108 -0
- package/dist/knowledge/SelfKnowledgeTree.d.ts.map +1 -0
- package/dist/knowledge/SelfKnowledgeTree.js +560 -0
- package/dist/knowledge/SelfKnowledgeTree.js.map +1 -0
- package/dist/knowledge/TreeGenerator.d.ts +57 -0
- package/dist/knowledge/TreeGenerator.d.ts.map +1 -0
- package/dist/knowledge/TreeGenerator.js +527 -0
- package/dist/knowledge/TreeGenerator.js.map +1 -0
- package/dist/knowledge/TreeSynthesis.d.ts +24 -0
- package/dist/knowledge/TreeSynthesis.d.ts.map +1 -0
- package/dist/knowledge/TreeSynthesis.js +61 -0
- package/dist/knowledge/TreeSynthesis.js.map +1 -0
- package/dist/knowledge/TreeTraversal.d.ts +93 -0
- package/dist/knowledge/TreeTraversal.d.ts.map +1 -0
- package/dist/knowledge/TreeTraversal.js +359 -0
- package/dist/knowledge/TreeTraversal.js.map +1 -0
- package/dist/knowledge/TreeTriage.d.ts +80 -0
- package/dist/knowledge/TreeTriage.d.ts.map +1 -0
- package/dist/knowledge/TreeTriage.js +413 -0
- package/dist/knowledge/TreeTriage.js.map +1 -0
- package/dist/knowledge/types.d.ts +183 -0
- package/dist/knowledge/types.d.ts.map +1 -0
- package/dist/knowledge/types.js +28 -0
- package/dist/knowledge/types.js.map +1 -0
- package/dist/lifeline/MessageQueue.d.ts +42 -0
- package/dist/lifeline/MessageQueue.d.ts.map +1 -0
- package/dist/lifeline/MessageQueue.js +63 -0
- package/dist/lifeline/MessageQueue.js.map +1 -0
- package/dist/lifeline/ServerSupervisor.d.ts +203 -0
- package/dist/lifeline/ServerSupervisor.d.ts.map +1 -0
- package/dist/lifeline/ServerSupervisor.js +1103 -0
- package/dist/lifeline/ServerSupervisor.js.map +1 -0
- package/dist/lifeline/SlackLifeline.d.ts +43 -0
- package/dist/lifeline/SlackLifeline.d.ts.map +1 -0
- package/dist/lifeline/SlackLifeline.js +227 -0
- package/dist/lifeline/SlackLifeline.js.map +1 -0
- package/dist/lifeline/TelegramLifeline.d.ts +180 -0
- package/dist/lifeline/TelegramLifeline.d.ts.map +1 -0
- package/dist/lifeline/TelegramLifeline.js +1533 -0
- package/dist/lifeline/TelegramLifeline.js.map +1 -0
- package/dist/memory/ActivityPartitioner.d.ts +67 -0
- package/dist/memory/ActivityPartitioner.d.ts.map +1 -0
- package/dist/memory/ActivityPartitioner.js +193 -0
- package/dist/memory/ActivityPartitioner.js.map +1 -0
- package/dist/memory/Chunker.d.ts +39 -0
- package/dist/memory/Chunker.d.ts.map +1 -0
- package/dist/memory/Chunker.js +154 -0
- package/dist/memory/Chunker.js.map +1 -0
- package/dist/memory/EmbeddingProvider.d.ts +82 -0
- package/dist/memory/EmbeddingProvider.d.ts.map +1 -0
- package/dist/memory/EmbeddingProvider.js +168 -0
- package/dist/memory/EmbeddingProvider.js.map +1 -0
- package/dist/memory/EpisodicMemory.d.ts +141 -0
- package/dist/memory/EpisodicMemory.d.ts.map +1 -0
- package/dist/memory/EpisodicMemory.js +303 -0
- package/dist/memory/EpisodicMemory.js.map +1 -0
- package/dist/memory/MemoryExporter.d.ts +82 -0
- package/dist/memory/MemoryExporter.d.ts.map +1 -0
- package/dist/memory/MemoryExporter.js +233 -0
- package/dist/memory/MemoryExporter.js.map +1 -0
- package/dist/memory/MemoryIndex.d.ts +76 -0
- package/dist/memory/MemoryIndex.d.ts.map +1 -0
- package/dist/memory/MemoryIndex.js +413 -0
- package/dist/memory/MemoryIndex.js.map +1 -0
- package/dist/memory/MemoryMigrator.d.ts +103 -0
- package/dist/memory/MemoryMigrator.d.ts.map +1 -0
- package/dist/memory/MemoryMigrator.js +510 -0
- package/dist/memory/MemoryMigrator.js.map +1 -0
- package/dist/memory/SemanticMemory.d.ts +255 -0
- package/dist/memory/SemanticMemory.d.ts.map +1 -0
- package/dist/memory/SemanticMemory.js +1130 -0
- package/dist/memory/SemanticMemory.js.map +1 -0
- package/dist/memory/TopicMemory.d.ts +227 -0
- package/dist/memory/TopicMemory.d.ts.map +1 -0
- package/dist/memory/TopicMemory.js +731 -0
- package/dist/memory/TopicMemory.js.map +1 -0
- package/dist/memory/TopicSummarizer.d.ts +69 -0
- package/dist/memory/TopicSummarizer.d.ts.map +1 -0
- package/dist/memory/TopicSummarizer.js +163 -0
- package/dist/memory/TopicSummarizer.js.map +1 -0
- package/dist/memory/VectorSearch.d.ts +80 -0
- package/dist/memory/VectorSearch.d.ts.map +1 -0
- package/dist/memory/VectorSearch.js +148 -0
- package/dist/memory/VectorSearch.js.map +1 -0
- package/dist/memory/WorkingMemoryAssembler.d.ts +122 -0
- package/dist/memory/WorkingMemoryAssembler.d.ts.map +1 -0
- package/dist/memory/WorkingMemoryAssembler.js +406 -0
- package/dist/memory/WorkingMemoryAssembler.js.map +1 -0
- package/dist/messaging/AdapterRegistry.d.ts +27 -0
- package/dist/messaging/AdapterRegistry.d.ts.map +1 -0
- package/dist/messaging/AdapterRegistry.js +40 -0
- package/dist/messaging/AdapterRegistry.js.map +1 -0
- package/dist/messaging/AgentTokenManager.d.ts +86 -0
- package/dist/messaging/AgentTokenManager.d.ts.map +1 -0
- package/dist/messaging/AgentTokenManager.js +213 -0
- package/dist/messaging/AgentTokenManager.js.map +1 -0
- package/dist/messaging/DeliveryRetryManager.d.ts +47 -0
- package/dist/messaging/DeliveryRetryManager.d.ts.map +1 -0
- package/dist/messaging/DeliveryRetryManager.js +201 -0
- package/dist/messaging/DeliveryRetryManager.js.map +1 -0
- package/dist/messaging/DropPickup.d.ts +37 -0
- package/dist/messaging/DropPickup.d.ts.map +1 -0
- package/dist/messaging/DropPickup.js +120 -0
- package/dist/messaging/DropPickup.js.map +1 -0
- package/dist/messaging/GitSyncTransport.d.ts +120 -0
- package/dist/messaging/GitSyncTransport.d.ts.map +1 -0
- package/dist/messaging/GitSyncTransport.js +296 -0
- package/dist/messaging/GitSyncTransport.js.map +1 -0
- package/dist/messaging/MessageDelivery.d.ts +27 -0
- package/dist/messaging/MessageDelivery.d.ts.map +1 -0
- package/dist/messaging/MessageDelivery.js +90 -0
- package/dist/messaging/MessageDelivery.js.map +1 -0
- package/dist/messaging/MessageFormatter.d.ts +30 -0
- package/dist/messaging/MessageFormatter.d.ts.map +1 -0
- package/dist/messaging/MessageFormatter.js +97 -0
- package/dist/messaging/MessageFormatter.js.map +1 -0
- package/dist/messaging/MessageRouter.d.ts +157 -0
- package/dist/messaging/MessageRouter.d.ts.map +1 -0
- package/dist/messaging/MessageRouter.js +657 -0
- package/dist/messaging/MessageRouter.js.map +1 -0
- package/dist/messaging/MessageStore.d.ts +52 -0
- package/dist/messaging/MessageStore.d.ts.map +1 -0
- package/dist/messaging/MessageStore.js +363 -0
- package/dist/messaging/MessageStore.js.map +1 -0
- package/dist/messaging/NotificationBatcher.d.ts +95 -0
- package/dist/messaging/NotificationBatcher.d.ts.map +1 -0
- package/dist/messaging/NotificationBatcher.js +253 -0
- package/dist/messaging/NotificationBatcher.js.map +1 -0
- package/dist/messaging/SessionSummarySentinel.d.ts +104 -0
- package/dist/messaging/SessionSummarySentinel.d.ts.map +1 -0
- package/dist/messaging/SessionSummarySentinel.js +386 -0
- package/dist/messaging/SessionSummarySentinel.js.map +1 -0
- package/dist/messaging/SpawnRequestManager.d.ts +88 -0
- package/dist/messaging/SpawnRequestManager.d.ts.map +1 -0
- package/dist/messaging/SpawnRequestManager.js +159 -0
- package/dist/messaging/SpawnRequestManager.js.map +1 -0
- package/dist/messaging/TelegramAdapter.d.ts +636 -0
- package/dist/messaging/TelegramAdapter.d.ts.map +1 -0
- package/dist/messaging/TelegramAdapter.js +3434 -0
- package/dist/messaging/TelegramAdapter.js.map +1 -0
- package/dist/messaging/TopicContentValidator.d.ts +81 -0
- package/dist/messaging/TopicContentValidator.d.ts.map +1 -0
- package/dist/messaging/TopicContentValidator.js +113 -0
- package/dist/messaging/TopicContentValidator.js.map +1 -0
- package/dist/messaging/WhatsAppAdapter.d.ts +224 -0
- package/dist/messaging/WhatsAppAdapter.d.ts.map +1 -0
- package/dist/messaging/WhatsAppAdapter.js +736 -0
- package/dist/messaging/WhatsAppAdapter.js.map +1 -0
- package/dist/messaging/backends/BaileysBackend.d.ts +74 -0
- package/dist/messaging/backends/BaileysBackend.d.ts.map +1 -0
- package/dist/messaging/backends/BaileysBackend.js +481 -0
- package/dist/messaging/backends/BaileysBackend.js.map +1 -0
- package/dist/messaging/backends/BusinessApiBackend.d.ts +173 -0
- package/dist/messaging/backends/BusinessApiBackend.d.ts.map +1 -0
- package/dist/messaging/backends/BusinessApiBackend.js +269 -0
- package/dist/messaging/backends/BusinessApiBackend.js.map +1 -0
- package/dist/messaging/backends/WhatsAppWebhookRoutes.d.ts +26 -0
- package/dist/messaging/backends/WhatsAppWebhookRoutes.d.ts.map +1 -0
- package/dist/messaging/backends/WhatsAppWebhookRoutes.js +50 -0
- package/dist/messaging/backends/WhatsAppWebhookRoutes.js.map +1 -0
- package/dist/messaging/shared/AuthGate.d.ts +102 -0
- package/dist/messaging/shared/AuthGate.d.ts.map +1 -0
- package/dist/messaging/shared/AuthGate.js +159 -0
- package/dist/messaging/shared/AuthGate.js.map +1 -0
- package/dist/messaging/shared/CommandRouter.d.ts +84 -0
- package/dist/messaging/shared/CommandRouter.d.ts.map +1 -0
- package/dist/messaging/shared/CommandRouter.js +145 -0
- package/dist/messaging/shared/CommandRouter.js.map +1 -0
- package/dist/messaging/shared/CrossPlatformAlerts.d.ts +67 -0
- package/dist/messaging/shared/CrossPlatformAlerts.d.ts.map +1 -0
- package/dist/messaging/shared/CrossPlatformAlerts.js +134 -0
- package/dist/messaging/shared/CrossPlatformAlerts.js.map +1 -0
- package/dist/messaging/shared/EncryptedAuthStore.d.ts +51 -0
- package/dist/messaging/shared/EncryptedAuthStore.d.ts.map +1 -0
- package/dist/messaging/shared/EncryptedAuthStore.js +194 -0
- package/dist/messaging/shared/EncryptedAuthStore.js.map +1 -0
- package/dist/messaging/shared/FeatureFlags.d.ts +21 -0
- package/dist/messaging/shared/FeatureFlags.d.ts.map +1 -0
- package/dist/messaging/shared/FeatureFlags.js +21 -0
- package/dist/messaging/shared/FeatureFlags.js.map +1 -0
- package/dist/messaging/shared/MessageBridge.d.ts +70 -0
- package/dist/messaging/shared/MessageBridge.d.ts.map +1 -0
- package/dist/messaging/shared/MessageBridge.js +178 -0
- package/dist/messaging/shared/MessageBridge.js.map +1 -0
- package/dist/messaging/shared/MessageLogger.d.ts +94 -0
- package/dist/messaging/shared/MessageLogger.d.ts.map +1 -0
- package/dist/messaging/shared/MessageLogger.js +173 -0
- package/dist/messaging/shared/MessageLogger.js.map +1 -0
- package/dist/messaging/shared/MessagingEventBus.d.ts +149 -0
- package/dist/messaging/shared/MessagingEventBus.d.ts.map +1 -0
- package/dist/messaging/shared/MessagingEventBus.js +111 -0
- package/dist/messaging/shared/MessagingEventBus.js.map +1 -0
- package/dist/messaging/shared/PhoneUtils.d.ts +44 -0
- package/dist/messaging/shared/PhoneUtils.d.ts.map +1 -0
- package/dist/messaging/shared/PhoneUtils.js +110 -0
- package/dist/messaging/shared/PhoneUtils.js.map +1 -0
- package/dist/messaging/shared/PrivacyConsent.d.ts +61 -0
- package/dist/messaging/shared/PrivacyConsent.d.ts.map +1 -0
- package/dist/messaging/shared/PrivacyConsent.js +132 -0
- package/dist/messaging/shared/PrivacyConsent.js.map +1 -0
- package/dist/messaging/shared/SessionChannelRegistry.d.ts +48 -0
- package/dist/messaging/shared/SessionChannelRegistry.d.ts.map +1 -0
- package/dist/messaging/shared/SessionChannelRegistry.js +144 -0
- package/dist/messaging/shared/SessionChannelRegistry.js.map +1 -0
- package/dist/messaging/shared/SmartChunker.d.ts +16 -0
- package/dist/messaging/shared/SmartChunker.d.ts.map +1 -0
- package/dist/messaging/shared/SmartChunker.js +100 -0
- package/dist/messaging/shared/SmartChunker.js.map +1 -0
- package/dist/messaging/shared/StallDetector.d.ts +85 -0
- package/dist/messaging/shared/StallDetector.d.ts.map +1 -0
- package/dist/messaging/shared/StallDetector.js +225 -0
- package/dist/messaging/shared/StallDetector.js.map +1 -0
- package/dist/messaging/shared/index.d.ts +22 -0
- package/dist/messaging/shared/index.d.ts.map +1 -0
- package/dist/messaging/shared/index.js +13 -0
- package/dist/messaging/shared/index.js.map +1 -0
- package/dist/messaging/slack/ChannelManager.d.ts +36 -0
- package/dist/messaging/slack/ChannelManager.d.ts.map +1 -0
- package/dist/messaging/slack/ChannelManager.js +100 -0
- package/dist/messaging/slack/ChannelManager.js.map +1 -0
- package/dist/messaging/slack/FileHandler.d.ts +30 -0
- package/dist/messaging/slack/FileHandler.d.ts.map +1 -0
- package/dist/messaging/slack/FileHandler.js +87 -0
- package/dist/messaging/slack/FileHandler.js.map +1 -0
- package/dist/messaging/slack/RingBuffer.d.ts +22 -0
- package/dist/messaging/slack/RingBuffer.d.ts.map +1 -0
- package/dist/messaging/slack/RingBuffer.js +48 -0
- package/dist/messaging/slack/RingBuffer.js.map +1 -0
- package/dist/messaging/slack/SlackAdapter.d.ts +283 -0
- package/dist/messaging/slack/SlackAdapter.d.ts.map +1 -0
- package/dist/messaging/slack/SlackAdapter.js +1524 -0
- package/dist/messaging/slack/SlackAdapter.js.map +1 -0
- package/dist/messaging/slack/SlackApiClient.d.ts +51 -0
- package/dist/messaging/slack/SlackApiClient.d.ts.map +1 -0
- package/dist/messaging/slack/SlackApiClient.js +94 -0
- package/dist/messaging/slack/SlackApiClient.js.map +1 -0
- package/dist/messaging/slack/SocketModeClient.d.ts +44 -0
- package/dist/messaging/slack/SocketModeClient.d.ts.map +1 -0
- package/dist/messaging/slack/SocketModeClient.js +209 -0
- package/dist/messaging/slack/SocketModeClient.js.map +1 -0
- package/dist/messaging/slack/index.d.ts +12 -0
- package/dist/messaging/slack/index.d.ts.map +1 -0
- package/dist/messaging/slack/index.js +15 -0
- package/dist/messaging/slack/index.js.map +1 -0
- package/dist/messaging/slack/sanitize.d.ts +39 -0
- package/dist/messaging/slack/sanitize.d.ts.map +1 -0
- package/dist/messaging/slack/sanitize.js +71 -0
- package/dist/messaging/slack/sanitize.js.map +1 -0
- package/dist/messaging/slack/types.d.ts +186 -0
- package/dist/messaging/slack/types.d.ts.map +1 -0
- package/dist/messaging/slack/types.js +54 -0
- package/dist/messaging/slack/types.js.map +1 -0
- package/dist/messaging/types.d.ts +400 -0
- package/dist/messaging/types.d.ts.map +1 -0
- package/dist/messaging/types.js +89 -0
- package/dist/messaging/types.js.map +1 -0
- package/dist/monitoring/AccountSwitcher.d.ts +61 -0
- package/dist/monitoring/AccountSwitcher.d.ts.map +1 -0
- package/dist/monitoring/AccountSwitcher.js +196 -0
- package/dist/monitoring/AccountSwitcher.js.map +1 -0
- package/dist/monitoring/CoherenceMonitor.d.ts +133 -0
- package/dist/monitoring/CoherenceMonitor.d.ts.map +1 -0
- package/dist/monitoring/CoherenceMonitor.js +550 -0
- package/dist/monitoring/CoherenceMonitor.js.map +1 -0
- package/dist/monitoring/CommitmentSentinel.d.ts +57 -0
- package/dist/monitoring/CommitmentSentinel.d.ts.map +1 -0
- package/dist/monitoring/CommitmentSentinel.js +251 -0
- package/dist/monitoring/CommitmentSentinel.js.map +1 -0
- package/dist/monitoring/CommitmentTracker.d.ts +186 -0
- package/dist/monitoring/CommitmentTracker.d.ts.map +1 -0
- package/dist/monitoring/CommitmentTracker.js +522 -0
- package/dist/monitoring/CommitmentTracker.js.map +1 -0
- package/dist/monitoring/CredentialProvider.d.ts +84 -0
- package/dist/monitoring/CredentialProvider.d.ts.map +1 -0
- package/dist/monitoring/CredentialProvider.js +196 -0
- package/dist/monitoring/CredentialProvider.js.map +1 -0
- package/dist/monitoring/DegradationReporter.d.ts +123 -0
- package/dist/monitoring/DegradationReporter.d.ts.map +1 -0
- package/dist/monitoring/DegradationReporter.js +241 -0
- package/dist/monitoring/DegradationReporter.js.map +1 -0
- package/dist/monitoring/FeedbackAnomalyDetector.d.ts +51 -0
- package/dist/monitoring/FeedbackAnomalyDetector.d.ts.map +1 -0
- package/dist/monitoring/FeedbackAnomalyDetector.js +120 -0
- package/dist/monitoring/FeedbackAnomalyDetector.js.map +1 -0
- package/dist/monitoring/HealthChecker.d.ts +45 -0
- package/dist/monitoring/HealthChecker.d.ts.map +1 -0
- package/dist/monitoring/HealthChecker.js +219 -0
- package/dist/monitoring/HealthChecker.js.map +1 -0
- package/dist/monitoring/HomeostasisMonitor.d.ts +102 -0
- package/dist/monitoring/HomeostasisMonitor.d.ts.map +1 -0
- package/dist/monitoring/HomeostasisMonitor.js +185 -0
- package/dist/monitoring/HomeostasisMonitor.js.map +1 -0
- package/dist/monitoring/HookEventReceiver.d.ts +132 -0
- package/dist/monitoring/HookEventReceiver.d.ts.map +1 -0
- package/dist/monitoring/HookEventReceiver.js +209 -0
- package/dist/monitoring/HookEventReceiver.js.map +1 -0
- package/dist/monitoring/InputClassifier.d.ts +68 -0
- package/dist/monitoring/InputClassifier.d.ts.map +1 -0
- package/dist/monitoring/InputClassifier.js +243 -0
- package/dist/monitoring/InputClassifier.js.map +1 -0
- package/dist/monitoring/InstructionsVerifier.d.ts +76 -0
- package/dist/monitoring/InstructionsVerifier.d.ts.map +1 -0
- package/dist/monitoring/InstructionsVerifier.js +116 -0
- package/dist/monitoring/InstructionsVerifier.js.map +1 -0
- package/dist/monitoring/MemoryPressureMonitor.d.ts +107 -0
- package/dist/monitoring/MemoryPressureMonitor.d.ts.map +1 -0
- package/dist/monitoring/MemoryPressureMonitor.js +329 -0
- package/dist/monitoring/MemoryPressureMonitor.js.map +1 -0
- package/dist/monitoring/OrphanProcessReaper.d.ts +125 -0
- package/dist/monitoring/OrphanProcessReaper.d.ts.map +1 -0
- package/dist/monitoring/OrphanProcessReaper.js +476 -0
- package/dist/monitoring/OrphanProcessReaper.js.map +1 -0
- package/dist/monitoring/PresenceProxy.d.ts +167 -0
- package/dist/monitoring/PresenceProxy.d.ts.map +1 -0
- package/dist/monitoring/PresenceProxy.js +972 -0
- package/dist/monitoring/PresenceProxy.js.map +1 -0
- package/dist/monitoring/PromptGate.d.ts +91 -0
- package/dist/monitoring/PromptGate.d.ts.map +1 -0
- package/dist/monitoring/PromptGate.js +411 -0
- package/dist/monitoring/PromptGate.js.map +1 -0
- package/dist/monitoring/QuotaCollector.d.ts +267 -0
- package/dist/monitoring/QuotaCollector.d.ts.map +1 -0
- package/dist/monitoring/QuotaCollector.js +790 -0
- package/dist/monitoring/QuotaCollector.js.map +1 -0
- package/dist/monitoring/QuotaExhaustionDetector.d.ts +21 -0
- package/dist/monitoring/QuotaExhaustionDetector.d.ts.map +1 -0
- package/dist/monitoring/QuotaExhaustionDetector.js +136 -0
- package/dist/monitoring/QuotaExhaustionDetector.js.map +1 -0
- package/dist/monitoring/QuotaManager.d.ts +191 -0
- package/dist/monitoring/QuotaManager.d.ts.map +1 -0
- package/dist/monitoring/QuotaManager.js +575 -0
- package/dist/monitoring/QuotaManager.js.map +1 -0
- package/dist/monitoring/QuotaNotifier.d.ts +38 -0
- package/dist/monitoring/QuotaNotifier.d.ts.map +1 -0
- package/dist/monitoring/QuotaNotifier.js +144 -0
- package/dist/monitoring/QuotaNotifier.js.map +1 -0
- package/dist/monitoring/QuotaTracker.d.ts +92 -0
- package/dist/monitoring/QuotaTracker.d.ts.map +1 -0
- package/dist/monitoring/QuotaTracker.js +239 -0
- package/dist/monitoring/QuotaTracker.js.map +1 -0
- package/dist/monitoring/ReflectionMetrics.d.ts +97 -0
- package/dist/monitoring/ReflectionMetrics.d.ts.map +1 -0
- package/dist/monitoring/ReflectionMetrics.js +170 -0
- package/dist/monitoring/ReflectionMetrics.js.map +1 -0
- package/dist/monitoring/SessionActivitySentinel.d.ts +95 -0
- package/dist/monitoring/SessionActivitySentinel.d.ts.map +1 -0
- package/dist/monitoring/SessionActivitySentinel.js +391 -0
- package/dist/monitoring/SessionActivitySentinel.js.map +1 -0
- package/dist/monitoring/SessionCredentialManager.d.ts +56 -0
- package/dist/monitoring/SessionCredentialManager.d.ts.map +1 -0
- package/dist/monitoring/SessionCredentialManager.js +91 -0
- package/dist/monitoring/SessionCredentialManager.js.map +1 -0
- package/dist/monitoring/SessionMigrator.d.ts +234 -0
- package/dist/monitoring/SessionMigrator.d.ts.map +1 -0
- package/dist/monitoring/SessionMigrator.js +604 -0
- package/dist/monitoring/SessionMigrator.js.map +1 -0
- package/dist/monitoring/SessionMonitor.d.ts +102 -0
- package/dist/monitoring/SessionMonitor.d.ts.map +1 -0
- package/dist/monitoring/SessionMonitor.js +238 -0
- package/dist/monitoring/SessionMonitor.js.map +1 -0
- package/dist/monitoring/SessionRecovery.d.ts +129 -0
- package/dist/monitoring/SessionRecovery.d.ts.map +1 -0
- package/dist/monitoring/SessionRecovery.js +496 -0
- package/dist/monitoring/SessionRecovery.js.map +1 -0
- package/dist/monitoring/SessionWatchdog.d.ts +138 -0
- package/dist/monitoring/SessionWatchdog.d.ts.map +1 -0
- package/dist/monitoring/SessionWatchdog.js +549 -0
- package/dist/monitoring/SessionWatchdog.js.map +1 -0
- package/dist/monitoring/StallTriageNurse.d.ts +96 -0
- package/dist/monitoring/StallTriageNurse.d.ts.map +1 -0
- package/dist/monitoring/StallTriageNurse.js +711 -0
- package/dist/monitoring/StallTriageNurse.js.map +1 -0
- package/dist/monitoring/StallTriageNurse.types.d.ts +124 -0
- package/dist/monitoring/StallTriageNurse.types.d.ts.map +1 -0
- package/dist/monitoring/StallTriageNurse.types.js +5 -0
- package/dist/monitoring/StallTriageNurse.types.js.map +1 -0
- package/dist/monitoring/SubagentTracker.d.ts +86 -0
- package/dist/monitoring/SubagentTracker.d.ts.map +1 -0
- package/dist/monitoring/SubagentTracker.js +199 -0
- package/dist/monitoring/SubagentTracker.js.map +1 -0
- package/dist/monitoring/SystemReviewer.d.ts +243 -0
- package/dist/monitoring/SystemReviewer.d.ts.map +1 -0
- package/dist/monitoring/SystemReviewer.js +697 -0
- package/dist/monitoring/SystemReviewer.js.map +1 -0
- package/dist/monitoring/TelemetryAuth.d.ts +64 -0
- package/dist/monitoring/TelemetryAuth.d.ts.map +1 -0
- package/dist/monitoring/TelemetryAuth.js +141 -0
- package/dist/monitoring/TelemetryAuth.js.map +1 -0
- package/dist/monitoring/TelemetryCollector.d.ts +95 -0
- package/dist/monitoring/TelemetryCollector.d.ts.map +1 -0
- package/dist/monitoring/TelemetryCollector.js +326 -0
- package/dist/monitoring/TelemetryCollector.js.map +1 -0
- package/dist/monitoring/TelemetryHeartbeat.d.ts +160 -0
- package/dist/monitoring/TelemetryHeartbeat.d.ts.map +1 -0
- package/dist/monitoring/TelemetryHeartbeat.js +450 -0
- package/dist/monitoring/TelemetryHeartbeat.js.map +1 -0
- package/dist/monitoring/TriageOrchestrator.d.ts +217 -0
- package/dist/monitoring/TriageOrchestrator.d.ts.map +1 -0
- package/dist/monitoring/TriageOrchestrator.js +801 -0
- package/dist/monitoring/TriageOrchestrator.js.map +1 -0
- package/dist/monitoring/WorktreeMonitor.d.ts +124 -0
- package/dist/monitoring/WorktreeMonitor.d.ts.map +1 -0
- package/dist/monitoring/WorktreeMonitor.js +379 -0
- package/dist/monitoring/WorktreeMonitor.js.map +1 -0
- package/dist/monitoring/crash-detector.d.ts +50 -0
- package/dist/monitoring/crash-detector.d.ts.map +1 -0
- package/dist/monitoring/crash-detector.js +224 -0
- package/dist/monitoring/crash-detector.js.map +1 -0
- package/dist/monitoring/jsonl-truncator.d.ts +44 -0
- package/dist/monitoring/jsonl-truncator.d.ts.map +1 -0
- package/dist/monitoring/jsonl-truncator.js +224 -0
- package/dist/monitoring/jsonl-truncator.js.map +1 -0
- package/dist/monitoring/probes/LifelineProbe.d.ts +38 -0
- package/dist/monitoring/probes/LifelineProbe.d.ts.map +1 -0
- package/dist/monitoring/probes/LifelineProbe.js +285 -0
- package/dist/monitoring/probes/LifelineProbe.js.map +1 -0
- package/dist/monitoring/probes/MessagingProbe.d.ts +23 -0
- package/dist/monitoring/probes/MessagingProbe.d.ts.map +1 -0
- package/dist/monitoring/probes/MessagingProbe.js +214 -0
- package/dist/monitoring/probes/MessagingProbe.js.map +1 -0
- package/dist/monitoring/probes/PlatformProbe.d.ts +15 -0
- package/dist/monitoring/probes/PlatformProbe.d.ts.map +1 -0
- package/dist/monitoring/probes/PlatformProbe.js +222 -0
- package/dist/monitoring/probes/PlatformProbe.js.map +1 -0
- package/dist/monitoring/probes/SchedulerProbe.d.ts +33 -0
- package/dist/monitoring/probes/SchedulerProbe.d.ts.map +1 -0
- package/dist/monitoring/probes/SchedulerProbe.js +196 -0
- package/dist/monitoring/probes/SchedulerProbe.js.map +1 -0
- package/dist/monitoring/probes/SessionProbe.d.ts +28 -0
- package/dist/monitoring/probes/SessionProbe.d.ts.map +1 -0
- package/dist/monitoring/probes/SessionProbe.js +234 -0
- package/dist/monitoring/probes/SessionProbe.js.map +1 -0
- package/dist/monitoring/stall-detector.d.ts +34 -0
- package/dist/monitoring/stall-detector.d.ts.map +1 -0
- package/dist/monitoring/stall-detector.js +151 -0
- package/dist/monitoring/stall-detector.js.map +1 -0
- package/dist/paste/PasteManager.d.ts +154 -0
- package/dist/paste/PasteManager.d.ts.map +1 -0
- package/dist/paste/PasteManager.js +524 -0
- package/dist/paste/PasteManager.js.map +1 -0
- package/dist/paste/TruncationDetector.d.ts +51 -0
- package/dist/paste/TruncationDetector.d.ts.map +1 -0
- package/dist/paste/TruncationDetector.js +220 -0
- package/dist/paste/TruncationDetector.js.map +1 -0
- package/dist/privacy/OutputPrivacyRouter.d.ts +65 -0
- package/dist/privacy/OutputPrivacyRouter.d.ts.map +1 -0
- package/dist/privacy/OutputPrivacyRouter.js +156 -0
- package/dist/privacy/OutputPrivacyRouter.js.map +1 -0
- package/dist/publishing/PrivateViewer.d.ts +63 -0
- package/dist/publishing/PrivateViewer.d.ts.map +1 -0
- package/dist/publishing/PrivateViewer.js +398 -0
- package/dist/publishing/PrivateViewer.js.map +1 -0
- package/dist/publishing/TelegraphService.d.ts +137 -0
- package/dist/publishing/TelegraphService.d.ts.map +1 -0
- package/dist/publishing/TelegraphService.js +410 -0
- package/dist/publishing/TelegraphService.js.map +1 -0
- package/dist/scaffold/bootstrap.d.ts +21 -0
- package/dist/scaffold/bootstrap.d.ts.map +1 -0
- package/dist/scaffold/bootstrap.js +125 -0
- package/dist/scaffold/bootstrap.js.map +1 -0
- package/dist/scaffold/templates.d.ts +47 -0
- package/dist/scaffold/templates.d.ts.map +1 -0
- package/dist/scaffold/templates.js +1506 -0
- package/dist/scaffold/templates.js.map +1 -0
- package/dist/scheduler/IntegrationGate.d.ts +81 -0
- package/dist/scheduler/IntegrationGate.d.ts.map +1 -0
- package/dist/scheduler/IntegrationGate.js +242 -0
- package/dist/scheduler/IntegrationGate.js.map +1 -0
- package/dist/scheduler/JobClaimManager.d.ts +137 -0
- package/dist/scheduler/JobClaimManager.d.ts.map +1 -0
- package/dist/scheduler/JobClaimManager.js +283 -0
- package/dist/scheduler/JobClaimManager.js.map +1 -0
- package/dist/scheduler/JobLoader.d.ts +28 -0
- package/dist/scheduler/JobLoader.d.ts.map +1 -0
- package/dist/scheduler/JobLoader.js +269 -0
- package/dist/scheduler/JobLoader.js.map +1 -0
- package/dist/scheduler/JobRunHistory.d.ts +180 -0
- package/dist/scheduler/JobRunHistory.d.ts.map +1 -0
- package/dist/scheduler/JobRunHistory.js +349 -0
- package/dist/scheduler/JobRunHistory.js.map +1 -0
- package/dist/scheduler/JobScheduler.d.ts +244 -0
- package/dist/scheduler/JobScheduler.d.ts.map +1 -0
- package/dist/scheduler/JobScheduler.js +1085 -0
- package/dist/scheduler/JobScheduler.js.map +1 -0
- package/dist/scheduler/SkipLedger.d.ts +65 -0
- package/dist/scheduler/SkipLedger.d.ts.map +1 -0
- package/dist/scheduler/SkipLedger.js +179 -0
- package/dist/scheduler/SkipLedger.js.map +1 -0
- package/dist/security/LLMSanitizer.d.ts +65 -0
- package/dist/security/LLMSanitizer.d.ts.map +1 -0
- package/dist/security/LLMSanitizer.js +153 -0
- package/dist/security/LLMSanitizer.js.map +1 -0
- package/dist/security/ManifestIntegrity.d.ts +72 -0
- package/dist/security/ManifestIntegrity.d.ts.map +1 -0
- package/dist/security/ManifestIntegrity.js +159 -0
- package/dist/security/ManifestIntegrity.js.map +1 -0
- package/dist/server/AgentServer.d.ts +134 -0
- package/dist/server/AgentServer.d.ts.map +1 -0
- package/dist/server/AgentServer.js +307 -0
- package/dist/server/AgentServer.js.map +1 -0
- package/dist/server/SecretDrop.d.ts +133 -0
- package/dist/server/SecretDrop.d.ts.map +1 -0
- package/dist/server/SecretDrop.js +473 -0
- package/dist/server/SecretDrop.js.map +1 -0
- package/dist/server/WebSocketManager.d.ts +80 -0
- package/dist/server/WebSocketManager.d.ts.map +1 -0
- package/dist/server/WebSocketManager.js +367 -0
- package/dist/server/WebSocketManager.js.map +1 -0
- package/dist/server/fileRoutes.d.ts +19 -0
- package/dist/server/fileRoutes.d.ts.map +1 -0
- package/dist/server/fileRoutes.js +578 -0
- package/dist/server/fileRoutes.js.map +1 -0
- package/dist/server/machineAuth.d.ts +87 -0
- package/dist/server/machineAuth.d.ts.map +1 -0
- package/dist/server/machineAuth.js +188 -0
- package/dist/server/machineAuth.js.map +1 -0
- package/dist/server/machineRoutes.d.ts +49 -0
- package/dist/server/machineRoutes.d.ts.map +1 -0
- package/dist/server/machineRoutes.js +305 -0
- package/dist/server/machineRoutes.js.map +1 -0
- package/dist/server/middleware.d.ts +32 -0
- package/dist/server/middleware.d.ts.map +1 -0
- package/dist/server/middleware.js +202 -0
- package/dist/server/middleware.js.map +1 -0
- package/dist/server/routes.d.ts +132 -0
- package/dist/server/routes.d.ts.map +1 -0
- package/dist/server/routes.js +8124 -0
- package/dist/server/routes.js.map +1 -0
- package/dist/threadline/A2AGateway.d.ts +184 -0
- package/dist/threadline/A2AGateway.d.ts.map +1 -0
- package/dist/threadline/A2AGateway.js +438 -0
- package/dist/threadline/A2AGateway.js.map +1 -0
- package/dist/threadline/AgentCard.d.ts +116 -0
- package/dist/threadline/AgentCard.d.ts.map +1 -0
- package/dist/threadline/AgentCard.js +212 -0
- package/dist/threadline/AgentCard.js.map +1 -0
- package/dist/threadline/AgentDiscovery.d.ts +156 -0
- package/dist/threadline/AgentDiscovery.d.ts.map +1 -0
- package/dist/threadline/AgentDiscovery.js +390 -0
- package/dist/threadline/AgentDiscovery.js.map +1 -0
- package/dist/threadline/AgentTrustManager.d.ts +190 -0
- package/dist/threadline/AgentTrustManager.d.ts.map +1 -0
- package/dist/threadline/AgentTrustManager.js +526 -0
- package/dist/threadline/AgentTrustManager.js.map +1 -0
- package/dist/threadline/ApprovalQueue.d.ts +71 -0
- package/dist/threadline/ApprovalQueue.d.ts.map +1 -0
- package/dist/threadline/ApprovalQueue.js +154 -0
- package/dist/threadline/ApprovalQueue.js.map +1 -0
- package/dist/threadline/AutonomyGate.d.ts +130 -0
- package/dist/threadline/AutonomyGate.d.ts.map +1 -0
- package/dist/threadline/AutonomyGate.js +267 -0
- package/dist/threadline/AutonomyGate.js.map +1 -0
- package/dist/threadline/CircuitBreaker.d.ts +89 -0
- package/dist/threadline/CircuitBreaker.d.ts.map +1 -0
- package/dist/threadline/CircuitBreaker.js +238 -0
- package/dist/threadline/CircuitBreaker.js.map +1 -0
- package/dist/threadline/ComputeMeter.d.ts +114 -0
- package/dist/threadline/ComputeMeter.d.ts.map +1 -0
- package/dist/threadline/ComputeMeter.js +350 -0
- package/dist/threadline/ComputeMeter.js.map +1 -0
- package/dist/threadline/ContentClassifier.d.ts +83 -0
- package/dist/threadline/ContentClassifier.d.ts.map +1 -0
- package/dist/threadline/ContentClassifier.js +201 -0
- package/dist/threadline/ContentClassifier.js.map +1 -0
- package/dist/threadline/ContextThreadMap.d.ts +103 -0
- package/dist/threadline/ContextThreadMap.d.ts.map +1 -0
- package/dist/threadline/ContextThreadMap.js +279 -0
- package/dist/threadline/ContextThreadMap.js.map +1 -0
- package/dist/threadline/DNSVerifier.d.ts +48 -0
- package/dist/threadline/DNSVerifier.d.ts.map +1 -0
- package/dist/threadline/DNSVerifier.js +138 -0
- package/dist/threadline/DNSVerifier.js.map +1 -0
- package/dist/threadline/DigestCollector.d.ts +70 -0
- package/dist/threadline/DigestCollector.d.ts.map +1 -0
- package/dist/threadline/DigestCollector.js +146 -0
- package/dist/threadline/DigestCollector.js.map +1 -0
- package/dist/threadline/HandshakeManager.d.ts +130 -0
- package/dist/threadline/HandshakeManager.d.ts.map +1 -0
- package/dist/threadline/HandshakeManager.js +402 -0
- package/dist/threadline/HandshakeManager.js.map +1 -0
- package/dist/threadline/InboundMessageGate.d.ts +80 -0
- package/dist/threadline/InboundMessageGate.d.ts.map +1 -0
- package/dist/threadline/InboundMessageGate.js +241 -0
- package/dist/threadline/InboundMessageGate.js.map +1 -0
- package/dist/threadline/InvitationManager.d.ts +91 -0
- package/dist/threadline/InvitationManager.d.ts.map +1 -0
- package/dist/threadline/InvitationManager.js +228 -0
- package/dist/threadline/InvitationManager.js.map +1 -0
- package/dist/threadline/ListenerSessionManager.d.ts +147 -0
- package/dist/threadline/ListenerSessionManager.d.ts.map +1 -0
- package/dist/threadline/ListenerSessionManager.js +326 -0
- package/dist/threadline/ListenerSessionManager.js.map +1 -0
- package/dist/threadline/MCPAuth.d.ts +98 -0
- package/dist/threadline/MCPAuth.d.ts.map +1 -0
- package/dist/threadline/MCPAuth.js +228 -0
- package/dist/threadline/MCPAuth.js.map +1 -0
- package/dist/threadline/OpenClawBridge.d.ts +143 -0
- package/dist/threadline/OpenClawBridge.d.ts.map +1 -0
- package/dist/threadline/OpenClawBridge.js +336 -0
- package/dist/threadline/OpenClawBridge.js.map +1 -0
- package/dist/threadline/OpenClawSkillManifest.d.ts +47 -0
- package/dist/threadline/OpenClawSkillManifest.d.ts.map +1 -0
- package/dist/threadline/OpenClawSkillManifest.js +148 -0
- package/dist/threadline/OpenClawSkillManifest.js.map +1 -0
- package/dist/threadline/RateLimiter.d.ts +105 -0
- package/dist/threadline/RateLimiter.d.ts.map +1 -0
- package/dist/threadline/RateLimiter.js +236 -0
- package/dist/threadline/RateLimiter.js.map +1 -0
- package/dist/threadline/RelayGroundingPreamble.d.ts +48 -0
- package/dist/threadline/RelayGroundingPreamble.d.ts.map +1 -0
- package/dist/threadline/RelayGroundingPreamble.js +68 -0
- package/dist/threadline/RelayGroundingPreamble.js.map +1 -0
- package/dist/threadline/SessionLifecycle.d.ts +136 -0
- package/dist/threadline/SessionLifecycle.d.ts.map +1 -0
- package/dist/threadline/SessionLifecycle.js +317 -0
- package/dist/threadline/SessionLifecycle.js.map +1 -0
- package/dist/threadline/ThreadResumeMap.d.ts +128 -0
- package/dist/threadline/ThreadResumeMap.d.ts.map +1 -0
- package/dist/threadline/ThreadResumeMap.js +324 -0
- package/dist/threadline/ThreadResumeMap.js.map +1 -0
- package/dist/threadline/ThreadlineBootstrap.d.ts +68 -0
- package/dist/threadline/ThreadlineBootstrap.d.ts.map +1 -0
- package/dist/threadline/ThreadlineBootstrap.js +293 -0
- package/dist/threadline/ThreadlineBootstrap.js.map +1 -0
- package/dist/threadline/ThreadlineCrypto.d.ts +53 -0
- package/dist/threadline/ThreadlineCrypto.d.ts.map +1 -0
- package/dist/threadline/ThreadlineCrypto.js +123 -0
- package/dist/threadline/ThreadlineCrypto.js.map +1 -0
- package/dist/threadline/ThreadlineEndpoints.d.ts +35 -0
- package/dist/threadline/ThreadlineEndpoints.d.ts.map +1 -0
- package/dist/threadline/ThreadlineEndpoints.js +313 -0
- package/dist/threadline/ThreadlineEndpoints.js.map +1 -0
- package/dist/threadline/ThreadlineMCPServer.d.ts +165 -0
- package/dist/threadline/ThreadlineMCPServer.d.ts.map +1 -0
- package/dist/threadline/ThreadlineMCPServer.js +885 -0
- package/dist/threadline/ThreadlineMCPServer.js.map +1 -0
- package/dist/threadline/ThreadlineRouter.d.ts +105 -0
- package/dist/threadline/ThreadlineRouter.d.ts.map +1 -0
- package/dist/threadline/ThreadlineRouter.js +323 -0
- package/dist/threadline/ThreadlineRouter.js.map +1 -0
- package/dist/threadline/TrustBootstrap.d.ts +92 -0
- package/dist/threadline/TrustBootstrap.d.ts.map +1 -0
- package/dist/threadline/TrustBootstrap.js +256 -0
- package/dist/threadline/TrustBootstrap.js.map +1 -0
- package/dist/threadline/adapters/AutoGenTool.d.ts +42 -0
- package/dist/threadline/adapters/AutoGenTool.d.ts.map +1 -0
- package/dist/threadline/adapters/AutoGenTool.js +145 -0
- package/dist/threadline/adapters/AutoGenTool.js.map +1 -0
- package/dist/threadline/adapters/CrewAITool.d.ts +31 -0
- package/dist/threadline/adapters/CrewAITool.d.ts.map +1 -0
- package/dist/threadline/adapters/CrewAITool.js +112 -0
- package/dist/threadline/adapters/CrewAITool.js.map +1 -0
- package/dist/threadline/adapters/LangGraphTool.d.ts +48 -0
- package/dist/threadline/adapters/LangGraphTool.d.ts.map +1 -0
- package/dist/threadline/adapters/LangGraphTool.js +153 -0
- package/dist/threadline/adapters/LangGraphTool.js.map +1 -0
- package/dist/threadline/adapters/RESTServer.d.ts +74 -0
- package/dist/threadline/adapters/RESTServer.d.ts.map +1 -0
- package/dist/threadline/adapters/RESTServer.js +291 -0
- package/dist/threadline/adapters/RESTServer.js.map +1 -0
- package/dist/threadline/adapters/index.d.ts +14 -0
- package/dist/threadline/adapters/index.d.ts.map +1 -0
- package/dist/threadline/adapters/index.js +10 -0
- package/dist/threadline/adapters/index.js.map +1 -0
- package/dist/threadline/client/IdentityManager.d.ts +40 -0
- package/dist/threadline/client/IdentityManager.d.ts.map +1 -0
- package/dist/threadline/client/IdentityManager.js +106 -0
- package/dist/threadline/client/IdentityManager.js.map +1 -0
- package/dist/threadline/client/MessageEncryptor.d.ts +63 -0
- package/dist/threadline/client/MessageEncryptor.d.ts.map +1 -0
- package/dist/threadline/client/MessageEncryptor.js +195 -0
- package/dist/threadline/client/MessageEncryptor.js.map +1 -0
- package/dist/threadline/client/RegistryRestClient.d.ts +46 -0
- package/dist/threadline/client/RegistryRestClient.d.ts.map +1 -0
- package/dist/threadline/client/RegistryRestClient.js +114 -0
- package/dist/threadline/client/RegistryRestClient.js.map +1 -0
- package/dist/threadline/client/RelayClient.d.ts +77 -0
- package/dist/threadline/client/RelayClient.d.ts.map +1 -0
- package/dist/threadline/client/RelayClient.js +249 -0
- package/dist/threadline/client/RelayClient.js.map +1 -0
- package/dist/threadline/client/ThreadlineClient.d.ts +117 -0
- package/dist/threadline/client/ThreadlineClient.d.ts.map +1 -0
- package/dist/threadline/client/ThreadlineClient.js +286 -0
- package/dist/threadline/client/ThreadlineClient.js.map +1 -0
- package/dist/threadline/client/index.d.ts +14 -0
- package/dist/threadline/client/index.d.ts.map +1 -0
- package/dist/threadline/client/index.js +9 -0
- package/dist/threadline/client/index.js.map +1 -0
- package/dist/threadline/index.d.ts +81 -0
- package/dist/threadline/index.d.ts.map +1 -0
- package/dist/threadline/index.js +57 -0
- package/dist/threadline/index.js.map +1 -0
- package/dist/threadline/mcp-stdio-entry.d.ts +24 -0
- package/dist/threadline/mcp-stdio-entry.d.ts.map +1 -0
- package/dist/threadline/mcp-stdio-entry.js +230 -0
- package/dist/threadline/mcp-stdio-entry.js.map +1 -0
- package/dist/threadline/relay/A2ABridge.d.ts +91 -0
- package/dist/threadline/relay/A2ABridge.d.ts.map +1 -0
- package/dist/threadline/relay/A2ABridge.js +457 -0
- package/dist/threadline/relay/A2ABridge.js.map +1 -0
- package/dist/threadline/relay/AbuseDetector.d.ts +131 -0
- package/dist/threadline/relay/AbuseDetector.d.ts.map +1 -0
- package/dist/threadline/relay/AbuseDetector.js +358 -0
- package/dist/threadline/relay/AbuseDetector.js.map +1 -0
- package/dist/threadline/relay/AdminServer.d.ts +55 -0
- package/dist/threadline/relay/AdminServer.d.ts.map +1 -0
- package/dist/threadline/relay/AdminServer.js +215 -0
- package/dist/threadline/relay/AdminServer.js.map +1 -0
- package/dist/threadline/relay/ConnectionManager.d.ts +86 -0
- package/dist/threadline/relay/ConnectionManager.d.ts.map +1 -0
- package/dist/threadline/relay/ConnectionManager.js +356 -0
- package/dist/threadline/relay/ConnectionManager.js.map +1 -0
- package/dist/threadline/relay/MessageRouter.d.ts +46 -0
- package/dist/threadline/relay/MessageRouter.d.ts.map +1 -0
- package/dist/threadline/relay/MessageRouter.js +138 -0
- package/dist/threadline/relay/MessageRouter.js.map +1 -0
- package/dist/threadline/relay/OfflineQueue.d.ts +87 -0
- package/dist/threadline/relay/OfflineQueue.d.ts.map +1 -0
- package/dist/threadline/relay/OfflineQueue.js +137 -0
- package/dist/threadline/relay/OfflineQueue.js.map +1 -0
- package/dist/threadline/relay/PresenceRegistry.d.ts +62 -0
- package/dist/threadline/relay/PresenceRegistry.d.ts.map +1 -0
- package/dist/threadline/relay/PresenceRegistry.js +148 -0
- package/dist/threadline/relay/PresenceRegistry.js.map +1 -0
- package/dist/threadline/relay/RegistryAuth.d.ts +45 -0
- package/dist/threadline/relay/RegistryAuth.d.ts.map +1 -0
- package/dist/threadline/relay/RegistryAuth.js +118 -0
- package/dist/threadline/relay/RegistryAuth.js.map +1 -0
- package/dist/threadline/relay/RegistryStore.d.ts +149 -0
- package/dist/threadline/relay/RegistryStore.d.ts.map +1 -0
- package/dist/threadline/relay/RegistryStore.js +542 -0
- package/dist/threadline/relay/RegistryStore.js.map +1 -0
- package/dist/threadline/relay/RelayMetrics.d.ts +62 -0
- package/dist/threadline/relay/RelayMetrics.d.ts.map +1 -0
- package/dist/threadline/relay/RelayMetrics.js +149 -0
- package/dist/threadline/relay/RelayMetrics.js.map +1 -0
- package/dist/threadline/relay/RelayRateLimiter.d.ts +58 -0
- package/dist/threadline/relay/RelayRateLimiter.d.ts.map +1 -0
- package/dist/threadline/relay/RelayRateLimiter.js +116 -0
- package/dist/threadline/relay/RelayRateLimiter.js.map +1 -0
- package/dist/threadline/relay/RelayServer.d.ts +94 -0
- package/dist/threadline/relay/RelayServer.d.ts.map +1 -0
- package/dist/threadline/relay/RelayServer.js +1049 -0
- package/dist/threadline/relay/RelayServer.js.map +1 -0
- package/dist/threadline/relay/index.d.ts +28 -0
- package/dist/threadline/relay/index.d.ts.map +1 -0
- package/dist/threadline/relay/index.js +17 -0
- package/dist/threadline/relay/index.js.map +1 -0
- package/dist/threadline/relay/types.d.ts +215 -0
- package/dist/threadline/relay/types.d.ts.map +1 -0
- package/dist/threadline/relay/types.js +21 -0
- package/dist/threadline/relay/types.js.map +1 -0
- package/dist/threadline/types.d.ts +39 -0
- package/dist/threadline/types.d.ts.map +1 -0
- package/dist/threadline/types.js +10 -0
- package/dist/threadline/types.js.map +1 -0
- package/dist/tunnel/TunnelManager.d.ts +113 -0
- package/dist/tunnel/TunnelManager.d.ts.map +1 -0
- package/dist/tunnel/TunnelManager.js +474 -0
- package/dist/tunnel/TunnelManager.js.map +1 -0
- package/dist/types/pipeline.d.ts +203 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/pipeline.js +152 -0
- package/dist/types/pipeline.js.map +1 -0
- package/dist/users/GdprCommands.d.ts +44 -0
- package/dist/users/GdprCommands.d.ts.map +1 -0
- package/dist/users/GdprCommands.js +153 -0
- package/dist/users/GdprCommands.js.map +1 -0
- package/dist/users/OnboardingGate.d.ts +107 -0
- package/dist/users/OnboardingGate.d.ts.map +1 -0
- package/dist/users/OnboardingGate.js +240 -0
- package/dist/users/OnboardingGate.js.map +1 -0
- package/dist/users/UserContextBuilder.d.ts +47 -0
- package/dist/users/UserContextBuilder.d.ts.map +1 -0
- package/dist/users/UserContextBuilder.js +174 -0
- package/dist/users/UserContextBuilder.js.map +1 -0
- package/dist/users/UserManager.d.ts +76 -0
- package/dist/users/UserManager.d.ts.map +1 -0
- package/dist/users/UserManager.js +213 -0
- package/dist/users/UserManager.js.map +1 -0
- package/dist/users/UserOnboarding.d.ts +145 -0
- package/dist/users/UserOnboarding.d.ts.map +1 -0
- package/dist/users/UserOnboarding.js +488 -0
- package/dist/users/UserOnboarding.js.map +1 -0
- package/dist/users/UserPropagator.d.ts +75 -0
- package/dist/users/UserPropagator.d.ts.map +1 -0
- package/dist/users/UserPropagator.js +145 -0
- package/dist/users/UserPropagator.js.map +1 -0
- package/dist/utils/jsonl-rotation.d.ts +27 -0
- package/dist/utils/jsonl-rotation.d.ts.map +1 -0
- package/dist/utils/jsonl-rotation.js +63 -0
- package/dist/utils/jsonl-rotation.js.map +1 -0
- package/dist/utils/privacy.d.ts +88 -0
- package/dist/utils/privacy.d.ts.map +1 -0
- package/dist/utils/privacy.js +182 -0
- package/dist/utils/privacy.js.map +1 -0
- package/dist/utils/sanitize.d.ts +81 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/sanitize.js +122 -0
- package/dist/utils/sanitize.js.map +1 -0
- package/package.json +1 -0
- package/playbook-scripts/atomic_write.py +133 -0
- package/playbook-scripts/bootstrap-manifest.json +92 -0
- package/playbook-scripts/playbook-annotate-context.py +239 -0
- package/playbook-scripts/playbook-assemble.py +385 -0
- package/playbook-scripts/playbook-dashboard.py +242 -0
- package/playbook-scripts/playbook-decay.py +377 -0
- package/playbook-scripts/playbook-dedup-job.py +252 -0
- package/playbook-scripts/playbook-dedup.py +341 -0
- package/playbook-scripts/playbook-delta-validator.py +576 -0
- package/playbook-scripts/playbook-dsar.py +291 -0
- package/playbook-scripts/playbook-eval-log.py +425 -0
- package/playbook-scripts/playbook-failsafe.py +513 -0
- package/playbook-scripts/playbook-feedback-quarantine.py +335 -0
- package/playbook-scripts/playbook-history.py +293 -0
- package/playbook-scripts/playbook-hmac.py +224 -0
- package/playbook-scripts/playbook-lifecycle.py +952 -0
- package/playbook-scripts/playbook-manifest.py +458 -0
- package/playbook-scripts/playbook-micro-eval.py +316 -0
- package/playbook-scripts/playbook-migrate-lessons.py +396 -0
- package/playbook-scripts/playbook-mount.py +393 -0
- package/playbook-scripts/playbook-offline-adapt.py +323 -0
- package/playbook-scripts/playbook-pii-screen.py +207 -0
- package/playbook-scripts/playbook-reflector.py +266 -0
- package/playbook-scripts/playbook-relevance.py +269 -0
- package/playbook-scripts/playbook-retirement.py +365 -0
- package/playbook-scripts/playbook-schema-validate.py +267 -0
- package/playbook-scripts/playbook-scratchpad.py +346 -0
- package/playbook-scripts/playbook-semantic-verify.py +280 -0
- package/playbook-scripts/playbook-spawn-contract.py +341 -0
- package/playbook-scripts/playbook-token-reestimate.py +248 -0
- package/playbook-scripts/playbook-verify.py +357 -0
- package/playbook-scripts/playbook_backend.py +249 -0
- package/playbook-scripts/playbook_paths.py +232 -0
- package/playbook-scripts/schemas/context-delta.schema.json +137 -0
- package/playbook-scripts/schemas/context-manifest.schema.json +200 -0
- package/playbook-scripts/schemas/playbook-config.schema.json +184 -0
- package/scripts/analyze-release.js +752 -0
- package/scripts/check-upgrade-guide.js +373 -0
- package/scripts/collect-metrics.py +248 -0
- package/scripts/demo-two-agents.mjs +187 -0
- package/scripts/fix-better-sqlite3.cjs +100 -0
- package/scripts/generate-builtin-manifest.cjs +440 -0
- package/scripts/pre-push-gate.js +177 -0
- package/scripts/relay-entrypoint.mjs +18 -0
- package/scripts/seed-registry.mjs +258 -0
- package/scripts/telemetry-worker/worker.js +776 -0
- package/scripts/telemetry-worker/wrangler.toml +7 -0
- package/scripts/test-bootstrap-relay.mjs +90 -0
- package/scripts/test-multi-agent-relay.mjs +395 -0
- package/scripts/test-relay-cloud.mjs +389 -0
- package/scripts/test-relay-live.mjs +550 -0
- package/src/data/builtin-manifest.json +1463 -0
- package/src/data/http-hook-templates.ts +81 -0
- package/src/templates/hooks/compaction-recovery.sh +371 -0
- package/src/templates/hooks/dangerous-command-guard.sh +100 -0
- package/src/templates/hooks/free-text-guard.sh +96 -0
- package/src/templates/hooks/grounding-before-messaging.sh +52 -0
- package/src/templates/hooks/session-start.sh +339 -0
- package/src/templates/hooks/settings-template.json +142 -0
- package/src/templates/hooks/slack-channel-context.sh +98 -0
- package/src/templates/hooks/telegram-topic-context.sh +117 -0
- package/src/templates/scripts/convergence-check.sh +99 -0
- package/src/templates/scripts/git-sync-gate.sh +89 -0
- package/src/templates/scripts/health-watchdog.sh +63 -0
- package/src/templates/scripts/serendipity-capture.sh +345 -0
- package/src/templates/scripts/slack-reply.sh +74 -0
- package/src/templates/scripts/smart-fetch.py +215 -0
- package/src/templates/scripts/telegram-reply.sh +67 -0
- package/src/templates/scripts/whatsapp-reply.sh +68 -0
- package/upgrades/0.10.0.md +254 -0
- package/upgrades/0.10.1.md +47 -0
- package/upgrades/0.10.2.md +26 -0
- package/upgrades/0.10.3.md +23 -0
- package/upgrades/0.10.4.md +26 -0
- package/upgrades/0.10.5.md +19 -0
- package/upgrades/0.10.6.md +35 -0
- package/upgrades/0.10.7.md +48 -0
- package/upgrades/0.10.8.md +53 -0
- package/upgrades/0.10.9.md +21 -0
- package/upgrades/0.11.0.md +146 -0
- package/upgrades/0.12.0.md +31 -0
- package/upgrades/0.12.1.md +21 -0
- package/upgrades/0.12.10.md +26 -0
- package/upgrades/0.12.11.md +23 -0
- package/upgrades/0.12.12.md +23 -0
- package/upgrades/0.12.13.md +19 -0
- package/upgrades/0.12.14.md +21 -0
- package/upgrades/0.12.15.md +26 -0
- package/upgrades/0.12.16.md +33 -0
- package/upgrades/0.12.17.md +38 -0
- package/upgrades/0.12.18.md +27 -0
- package/upgrades/0.12.19.md +31 -0
- package/upgrades/0.12.2.md +27 -0
- package/upgrades/0.12.20.md +24 -0
- package/upgrades/0.12.21.md +28 -0
- package/upgrades/0.12.22.md +23 -0
- package/upgrades/0.12.23.md +44 -0
- package/upgrades/0.12.24.md +24 -0
- package/upgrades/0.12.25.md +55 -0
- package/upgrades/0.12.26.md +31 -0
- package/upgrades/0.12.27.md +19 -0
- package/upgrades/0.12.28.md +19 -0
- package/upgrades/0.12.29.md +42 -0
- package/upgrades/0.12.3.md +22 -0
- package/upgrades/0.12.31.md +24 -0
- package/upgrades/0.12.32.md +34 -0
- package/upgrades/0.12.33.md +62 -0
- package/upgrades/0.12.34.md +59 -0
- package/upgrades/0.12.4.md +19 -0
- package/upgrades/0.12.5.md +31 -0
- package/upgrades/0.12.6.md +34 -0
- package/upgrades/0.12.7.md +24 -0
- package/upgrades/0.12.8.md +28 -0
- package/upgrades/0.12.9.md +30 -0
- package/upgrades/0.13.0.md +26 -0
- package/upgrades/0.14.0.md +75 -0
- package/upgrades/0.14.1.md +41 -0
- package/upgrades/0.15.0.md +59 -0
- package/upgrades/0.16.0.md +61 -0
- package/upgrades/0.17.0.md +88 -0
- package/upgrades/0.17.10.md +23 -0
- package/upgrades/0.17.11.md +25 -0
- package/upgrades/0.17.12.md +43 -0
- package/upgrades/0.17.13.md +24 -0
- package/upgrades/0.17.14.md +26 -0
- package/upgrades/0.17.2.md +42 -0
- package/upgrades/0.17.3.md +37 -0
- package/upgrades/0.17.4.md +27 -0
- package/upgrades/0.17.5.md +32 -0
- package/upgrades/0.17.6.md +32 -0
- package/upgrades/0.17.7.md +39 -0
- package/upgrades/0.17.8.md +34 -0
- package/upgrades/0.17.9.md +25 -0
- package/upgrades/0.18.1.md +34 -0
- package/upgrades/0.18.2.md +29 -0
- package/upgrades/0.18.3.md +26 -0
- package/upgrades/0.18.4.md +28 -0
- package/upgrades/0.18.5.md +25 -0
- package/upgrades/0.18.6.md +25 -0
- package/upgrades/0.18.7.md +30 -0
- package/upgrades/0.19.0.md +136 -0
- package/upgrades/0.19.1.md +27 -0
- package/upgrades/0.19.2.md +27 -0
- package/upgrades/0.19.3.md +32 -0
- package/upgrades/0.19.4.md +19 -0
- package/upgrades/0.19.6.md +17 -0
- package/upgrades/0.19.7.md +33 -0
- package/upgrades/0.20.0.md +54 -0
- package/upgrades/0.21.1.md +55 -0
- package/upgrades/0.21.2.md +48 -0
- package/upgrades/0.21.3.md +29 -0
- package/upgrades/0.21.4.md +33 -0
- package/upgrades/0.22.0.md +114 -0
- package/upgrades/0.23.0.md +81 -0
- package/upgrades/0.23.1.md +28 -0
- package/upgrades/0.23.10.md +19 -0
- package/upgrades/0.23.11.md +21 -0
- package/upgrades/0.23.12.md +30 -0
- package/upgrades/0.23.13.md +25 -0
- package/upgrades/0.23.14.md +23 -0
- package/upgrades/0.23.15.md +30 -0
- package/upgrades/0.23.16.md +21 -0
- package/upgrades/0.23.17.md +23 -0
- package/upgrades/0.23.18.md +41 -0
- package/upgrades/0.23.2.md +32 -0
- package/upgrades/0.23.4.md +21 -0
- package/upgrades/0.23.6.md +19 -0
- package/upgrades/0.23.7.md +33 -0
- package/upgrades/0.23.8.md +38 -0
- package/upgrades/0.23.9.md +35 -0
- package/upgrades/0.24.1.md +32 -0
- package/upgrades/0.24.10.md +23 -0
- package/upgrades/0.24.12.md +17 -0
- package/upgrades/0.24.13.md +16 -0
- package/upgrades/0.24.14.md +26 -0
- package/upgrades/0.24.15.md +49 -0
- package/upgrades/0.24.16.md +48 -0
- package/upgrades/0.24.17.md +40 -0
- package/upgrades/0.24.18-beta.0.md +35 -0
- package/upgrades/0.24.18.md +35 -0
- package/upgrades/0.24.19.md +21 -0
- package/upgrades/0.24.2.md +13 -0
- package/upgrades/0.24.20.md +45 -0
- package/upgrades/0.24.21.md +25 -0
- package/upgrades/0.24.22.md +35 -0
- package/upgrades/0.24.23.md +17 -0
- package/upgrades/0.24.24.md +15 -0
- package/upgrades/0.24.25.md +15 -0
- package/upgrades/0.24.26.md +15 -0
- package/upgrades/0.24.27.md +17 -0
- package/upgrades/0.24.28.md +35 -0
- package/upgrades/0.24.29.md +15 -0
- package/upgrades/0.24.30.md +40 -0
- package/upgrades/0.24.31.md +45 -0
- package/upgrades/0.24.32.md +19 -0
- package/upgrades/0.24.33.md +35 -0
- package/upgrades/0.24.34.md +29 -0
- package/upgrades/0.24.4.md +19 -0
- package/upgrades/0.24.5.md +20 -0
- package/upgrades/0.25.0.md +34 -0
- package/upgrades/0.25.1.md +24 -0
- package/upgrades/0.25.10.md +26 -0
- package/upgrades/0.25.2.md +23 -0
- package/upgrades/0.25.3.md +25 -0
- package/upgrades/0.25.4.md +24 -0
- package/upgrades/0.25.5.md +19 -0
- package/upgrades/0.25.6.md +35 -0
- package/upgrades/0.25.7.md +18 -0
- package/upgrades/0.25.8.md +24 -0
- package/upgrades/0.25.9.md +19 -0
- package/upgrades/0.26.0.md +23 -0
- package/upgrades/0.26.1.md +22 -0
- package/upgrades/0.26.2.md +15 -0
- package/upgrades/0.8.12.md +49 -0
- package/upgrades/0.8.13.md +38 -0
- package/upgrades/0.8.17.md +36 -0
- package/upgrades/0.8.22.md +43 -0
- package/upgrades/0.8.23.md +106 -0
- package/upgrades/0.9.1.md +91 -0
- package/upgrades/0.9.10.md +40 -0
- package/upgrades/0.9.11.md +77 -0
- package/upgrades/0.9.12.md +42 -0
- package/upgrades/0.9.13.md +55 -0
- package/upgrades/0.9.14.md +23 -0
- package/upgrades/0.9.15.md +106 -0
- package/upgrades/0.9.16.md +37 -0
- package/upgrades/0.9.17.md +15 -0
- package/upgrades/0.9.19.md +17 -0
- package/upgrades/0.9.20.md +24 -0
- package/upgrades/0.9.21.md +37 -0
- package/upgrades/0.9.22.md +41 -0
- package/upgrades/0.9.23.md +37 -0
- package/upgrades/0.9.24.md +46 -0
- package/upgrades/0.9.25.md +37 -0
- package/upgrades/0.9.28.md +20 -0
- package/upgrades/0.9.29.md +34 -0
- package/upgrades/0.9.32.md +30 -0
- package/upgrades/0.9.36.md +27 -0
- package/upgrades/0.9.8.md +125 -0
- package/upgrades/0.9.9.md +34 -0
- package/upgrades/NEXT.md +35 -0
|
@@ -0,0 +1,1130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SemanticMemory — Entity-relationship knowledge store with FTS5 + vector hybrid search.
|
|
3
|
+
*
|
|
4
|
+
* A typed, confidence-tracked knowledge graph stored in SQLite. Entities
|
|
5
|
+
* represent knowledge (facts, people, projects, tools, patterns, decisions,
|
|
6
|
+
* lessons) and edges represent relationships between them.
|
|
7
|
+
*
|
|
8
|
+
* Key features:
|
|
9
|
+
* - FTS5 full-text search with multi-signal ranking
|
|
10
|
+
* - Optional vector similarity search via sqlite-vec (Phase 5)
|
|
11
|
+
* - Hybrid scoring: FTS5 keyword + vector cosine similarity
|
|
12
|
+
* - Exponential confidence decay (lessons decay slower than facts)
|
|
13
|
+
* - BFS graph traversal with cycle detection
|
|
14
|
+
* - Export/import for portability
|
|
15
|
+
* - Formatted context generation for session injection
|
|
16
|
+
* - Graceful degradation: works FTS5-only when vectors unavailable
|
|
17
|
+
*
|
|
18
|
+
* Uses the same better-sqlite3 pattern as MemoryIndex and TopicMemory.
|
|
19
|
+
*/
|
|
20
|
+
import fs from 'node:fs';
|
|
21
|
+
import path from 'node:path';
|
|
22
|
+
import crypto from 'node:crypto';
|
|
23
|
+
import { VectorSearch } from './VectorSearch.js';
|
|
24
|
+
import { buildPrivacySqlFilter } from '../utils/privacy.js';
|
|
25
|
+
/**
|
|
26
|
+
* Strip FTS5 special syntax characters from a query.
|
|
27
|
+
* Prevents query manipulation via AND, OR, NOT, NEAR, *, column filters.
|
|
28
|
+
*/
|
|
29
|
+
function sanitizeFts5Query(query) {
|
|
30
|
+
return query
|
|
31
|
+
.replace(/\b(AND|OR|NOT|NEAR)\b/gi, '')
|
|
32
|
+
.replace(/[*:"^{}().$@#!~`?\\[\]]/g, '')
|
|
33
|
+
.replace(/\s+/g, ' ')
|
|
34
|
+
.trim();
|
|
35
|
+
}
|
|
36
|
+
export class SemanticMemory {
|
|
37
|
+
db = null;
|
|
38
|
+
config;
|
|
39
|
+
embeddingProvider = null;
|
|
40
|
+
vectorSearch = null;
|
|
41
|
+
_vectorAvailable = false;
|
|
42
|
+
jsonlPath;
|
|
43
|
+
constructor(config) {
|
|
44
|
+
this.config = config;
|
|
45
|
+
// JSONL append log lives alongside the database — source of truth for disaster recovery
|
|
46
|
+
this.jsonlPath = config.dbPath.replace(/\.db$/, '.jsonl');
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Whether hybrid vector search is active (sqlite-vec loaded + embeddings table created).
|
|
50
|
+
*/
|
|
51
|
+
get vectorSearchAvailable() {
|
|
52
|
+
return this._vectorAvailable;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Attach an EmbeddingProvider to enable hybrid search.
|
|
56
|
+
* Must be called BEFORE open() for full effect, but can be called after
|
|
57
|
+
* to enable vector search on an already-open database.
|
|
58
|
+
*/
|
|
59
|
+
setEmbeddingProvider(provider) {
|
|
60
|
+
this.embeddingProvider = provider;
|
|
61
|
+
this.vectorSearch = new VectorSearch({
|
|
62
|
+
tableName: 'entity_embeddings',
|
|
63
|
+
dimensions: provider.dimensions,
|
|
64
|
+
});
|
|
65
|
+
// If DB is already open, try to wire up vector search now
|
|
66
|
+
if (this.db) {
|
|
67
|
+
this.initVectorSearch();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
initVectorSearch() {
|
|
71
|
+
if (!this.db || !this.embeddingProvider || !this.vectorSearch)
|
|
72
|
+
return;
|
|
73
|
+
const loaded = this.embeddingProvider.loadVecExtension(this.db);
|
|
74
|
+
if (loaded) {
|
|
75
|
+
this.vectorSearch.createTable(this.db);
|
|
76
|
+
this._vectorAvailable = true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Async initialization for vector search.
|
|
81
|
+
* Loads sqlite-vec module, then wires up the extension and creates tables.
|
|
82
|
+
* Call this after open() and setEmbeddingProvider() for full hybrid search.
|
|
83
|
+
*/
|
|
84
|
+
async initializeVectorSearch() {
|
|
85
|
+
if (!this.db || !this.embeddingProvider || !this.vectorSearch)
|
|
86
|
+
return false;
|
|
87
|
+
const vecAvailable = await this.embeddingProvider.loadVecModule();
|
|
88
|
+
if (!vecAvailable)
|
|
89
|
+
return false;
|
|
90
|
+
this.initVectorSearch();
|
|
91
|
+
return this._vectorAvailable;
|
|
92
|
+
}
|
|
93
|
+
// ─── Lifecycle ──────────────────────────────────────────────────
|
|
94
|
+
async open() {
|
|
95
|
+
if (this.db)
|
|
96
|
+
return;
|
|
97
|
+
let BetterSqlite3;
|
|
98
|
+
try {
|
|
99
|
+
BetterSqlite3 = await import('better-sqlite3');
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
throw new Error('SemanticMemory requires better-sqlite3. Run: npm install better-sqlite3');
|
|
103
|
+
}
|
|
104
|
+
const constructor = BetterSqlite3.default || BetterSqlite3;
|
|
105
|
+
// Ensure parent directory exists
|
|
106
|
+
const dbDir = path.dirname(this.config.dbPath);
|
|
107
|
+
if (!fs.existsSync(dbDir)) {
|
|
108
|
+
fs.mkdirSync(dbDir, { recursive: true });
|
|
109
|
+
}
|
|
110
|
+
this.db = constructor(this.config.dbPath);
|
|
111
|
+
this.db.pragma('journal_mode = WAL');
|
|
112
|
+
this.db.pragma('busy_timeout = 5000');
|
|
113
|
+
this.db.pragma('foreign_keys = ON');
|
|
114
|
+
this.createSchema();
|
|
115
|
+
this.migrateIfNeeded();
|
|
116
|
+
// Initialize vector search if embedding provider is attached
|
|
117
|
+
this.initVectorSearch();
|
|
118
|
+
}
|
|
119
|
+
close() {
|
|
120
|
+
if (this.db) {
|
|
121
|
+
this.db.close();
|
|
122
|
+
this.db = null;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Checkpoint the WAL file. Call after sleep/wake to flush stale WAL locks.
|
|
127
|
+
* Uses PASSIVE mode (non-blocking) — safe to call at any time.
|
|
128
|
+
*/
|
|
129
|
+
checkpoint() {
|
|
130
|
+
if (this.db) {
|
|
131
|
+
try {
|
|
132
|
+
this.db.pragma('wal_checkpoint(PASSIVE)');
|
|
133
|
+
}
|
|
134
|
+
catch { /* non-critical */ }
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
ensureOpen() {
|
|
138
|
+
if (!this.db)
|
|
139
|
+
throw new Error('Database not open. Call open() first.');
|
|
140
|
+
return this.db;
|
|
141
|
+
}
|
|
142
|
+
// ─── JSONL Append Log ─────────────────────────────────────────
|
|
143
|
+
/**
|
|
144
|
+
* Append a mutation record to the JSONL log.
|
|
145
|
+
* This is the source of truth for disaster recovery — if semantic.db
|
|
146
|
+
* is lost, the JSONL can reconstruct the full knowledge graph.
|
|
147
|
+
*
|
|
148
|
+
* Actions: remember, connect, forget, verify, supersede, update, import
|
|
149
|
+
*/
|
|
150
|
+
appendToJournal(action, data) {
|
|
151
|
+
try {
|
|
152
|
+
const entry = JSON.stringify({ action, timestamp: new Date().toISOString(), ...data });
|
|
153
|
+
fs.appendFileSync(this.jsonlPath, entry + '\n');
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// @silent-fallback-ok: JSONL write failure is non-fatal — DB is still the primary query layer
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// ─── Schema ─────────────────────────────────────────────────────
|
|
160
|
+
createSchema() {
|
|
161
|
+
const db = this.ensureOpen();
|
|
162
|
+
db.exec(`
|
|
163
|
+
CREATE TABLE IF NOT EXISTS entities (
|
|
164
|
+
id TEXT PRIMARY KEY,
|
|
165
|
+
type TEXT NOT NULL,
|
|
166
|
+
name TEXT NOT NULL,
|
|
167
|
+
content TEXT NOT NULL,
|
|
168
|
+
confidence REAL NOT NULL DEFAULT 1.0,
|
|
169
|
+
created_at TEXT NOT NULL,
|
|
170
|
+
last_verified TEXT NOT NULL,
|
|
171
|
+
last_accessed TEXT NOT NULL,
|
|
172
|
+
expires_at TEXT,
|
|
173
|
+
source TEXT NOT NULL,
|
|
174
|
+
source_session TEXT,
|
|
175
|
+
tags TEXT NOT NULL DEFAULT '[]',
|
|
176
|
+
domain TEXT,
|
|
177
|
+
owner_id TEXT,
|
|
178
|
+
privacy_scope TEXT DEFAULT 'shared-project'
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
CREATE TABLE IF NOT EXISTS edges (
|
|
182
|
+
id TEXT PRIMARY KEY,
|
|
183
|
+
from_id TEXT NOT NULL,
|
|
184
|
+
to_id TEXT NOT NULL,
|
|
185
|
+
relation TEXT NOT NULL,
|
|
186
|
+
weight REAL NOT NULL DEFAULT 1.0,
|
|
187
|
+
context TEXT,
|
|
188
|
+
created_at TEXT NOT NULL,
|
|
189
|
+
UNIQUE(from_id, to_id, relation)
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
CREATE INDEX IF NOT EXISTS idx_edges_from ON edges(from_id);
|
|
193
|
+
CREATE INDEX IF NOT EXISTS idx_edges_to ON edges(to_id);
|
|
194
|
+
CREATE INDEX IF NOT EXISTS idx_entities_type ON entities(type);
|
|
195
|
+
CREATE INDEX IF NOT EXISTS idx_entities_confidence ON entities(confidence);
|
|
196
|
+
CREATE INDEX IF NOT EXISTS idx_entities_domain ON entities(domain);
|
|
197
|
+
CREATE INDEX IF NOT EXISTS idx_entities_source ON entities(source);
|
|
198
|
+
|
|
199
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS entities_fts USING fts5(
|
|
200
|
+
name,
|
|
201
|
+
content,
|
|
202
|
+
tags,
|
|
203
|
+
content='entities',
|
|
204
|
+
content_rowid='rowid',
|
|
205
|
+
tokenize='porter unicode61'
|
|
206
|
+
);
|
|
207
|
+
|
|
208
|
+
-- Triggers to keep FTS in sync with entities table
|
|
209
|
+
CREATE TRIGGER IF NOT EXISTS entities_fts_ai AFTER INSERT ON entities BEGIN
|
|
210
|
+
INSERT INTO entities_fts(rowid, name, content, tags)
|
|
211
|
+
VALUES (new.rowid, new.name, new.content, new.tags);
|
|
212
|
+
END;
|
|
213
|
+
|
|
214
|
+
CREATE TRIGGER IF NOT EXISTS entities_fts_ad AFTER DELETE ON entities BEGIN
|
|
215
|
+
INSERT INTO entities_fts(entities_fts, rowid, name, content, tags)
|
|
216
|
+
VALUES ('delete', old.rowid, old.name, old.content, old.tags);
|
|
217
|
+
END;
|
|
218
|
+
|
|
219
|
+
CREATE TRIGGER IF NOT EXISTS entities_fts_au AFTER UPDATE ON entities BEGIN
|
|
220
|
+
INSERT INTO entities_fts(entities_fts, rowid, name, content, tags)
|
|
221
|
+
VALUES ('delete', old.rowid, old.name, old.content, old.tags);
|
|
222
|
+
INSERT INTO entities_fts(rowid, name, content, tags)
|
|
223
|
+
VALUES (new.rowid, new.name, new.content, new.tags);
|
|
224
|
+
END;
|
|
225
|
+
`);
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Migrate existing databases to add privacy columns.
|
|
229
|
+
* Safe to call repeatedly — checks for column existence first.
|
|
230
|
+
*/
|
|
231
|
+
migrateIfNeeded() {
|
|
232
|
+
const db = this.ensureOpen();
|
|
233
|
+
// Check if owner_id column exists
|
|
234
|
+
const columns = db.prepare("PRAGMA table_info(entities)").all();
|
|
235
|
+
const columnNames = columns.map(c => c.name);
|
|
236
|
+
if (!columnNames.includes('owner_id')) {
|
|
237
|
+
db.exec(`
|
|
238
|
+
ALTER TABLE entities ADD COLUMN owner_id TEXT;
|
|
239
|
+
ALTER TABLE entities ADD COLUMN privacy_scope TEXT DEFAULT 'shared-project';
|
|
240
|
+
`);
|
|
241
|
+
}
|
|
242
|
+
// Always ensure indexes exist (safe for both fresh and migrated DBs)
|
|
243
|
+
db.exec(`
|
|
244
|
+
CREATE INDEX IF NOT EXISTS idx_entities_owner ON entities(owner_id);
|
|
245
|
+
CREATE INDEX IF NOT EXISTS idx_entities_privacy ON entities(privacy_scope);
|
|
246
|
+
`);
|
|
247
|
+
}
|
|
248
|
+
// ─── Entity CRUD ────────────────────────────────────────────────
|
|
249
|
+
/**
|
|
250
|
+
* Store a knowledge entity. Returns the generated UUID.
|
|
251
|
+
*/
|
|
252
|
+
remember(input) {
|
|
253
|
+
const db = this.ensureOpen();
|
|
254
|
+
const id = crypto.randomUUID();
|
|
255
|
+
const now = new Date().toISOString();
|
|
256
|
+
db.prepare(`
|
|
257
|
+
INSERT INTO entities (id, type, name, content, confidence, created_at, last_verified, last_accessed, expires_at, source, source_session, tags, domain, owner_id, privacy_scope)
|
|
258
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
259
|
+
`).run(id, input.type, input.name, input.content, input.confidence, now, input.lastVerified, now, input.expiresAt ?? null, input.source, input.sourceSession ?? null, JSON.stringify(input.tags), input.domain ?? null, input.ownerId ?? null, input.privacyScope ?? 'shared-project');
|
|
260
|
+
// Dual-write to JSONL append log
|
|
261
|
+
this.appendToJournal('remember', {
|
|
262
|
+
entity: {
|
|
263
|
+
id, type: input.type, name: input.name, content: input.content,
|
|
264
|
+
confidence: input.confidence, createdAt: now, lastVerified: input.lastVerified,
|
|
265
|
+
lastAccessed: now, expiresAt: input.expiresAt ?? null,
|
|
266
|
+
source: input.source, sourceSession: input.sourceSession ?? null,
|
|
267
|
+
tags: input.tags, domain: input.domain ?? null,
|
|
268
|
+
ownerId: input.ownerId ?? null, privacyScope: input.privacyScope ?? 'shared-project',
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
// Generate embedding asynchronously (fire-and-forget for write performance)
|
|
272
|
+
if (this._vectorAvailable && this.embeddingProvider && this.vectorSearch) {
|
|
273
|
+
const embeddingText = `${input.name} ${input.content}`;
|
|
274
|
+
this.embeddingProvider.embed(embeddingText).then(embedding => {
|
|
275
|
+
if (this.db && this.vectorSearch) {
|
|
276
|
+
this.vectorSearch.upsert(this.db, id, embedding);
|
|
277
|
+
}
|
|
278
|
+
}).catch(() => {
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
return id;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Store a knowledge entity AND generate its embedding synchronously.
|
|
285
|
+
* Use this when you need the embedding to be available immediately
|
|
286
|
+
* (e.g., during migration or when testing search after insert).
|
|
287
|
+
*/
|
|
288
|
+
async rememberWithEmbedding(input) {
|
|
289
|
+
const id = this.remember(input);
|
|
290
|
+
// Wait for embedding to be generated and stored
|
|
291
|
+
if (this._vectorAvailable && this.embeddingProvider && this.vectorSearch) {
|
|
292
|
+
const db = this.ensureOpen();
|
|
293
|
+
const embeddingText = `${input.name} ${input.content}`;
|
|
294
|
+
const embedding = await this.embeddingProvider.embed(embeddingText);
|
|
295
|
+
this.vectorSearch.upsert(db, id, embedding);
|
|
296
|
+
}
|
|
297
|
+
return id;
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Retrieve an entity by ID, including its connections.
|
|
301
|
+
* Updates lastAccessed on read.
|
|
302
|
+
*/
|
|
303
|
+
recall(id) {
|
|
304
|
+
const db = this.ensureOpen();
|
|
305
|
+
const row = db.prepare('SELECT * FROM entities WHERE id = ?').get(id);
|
|
306
|
+
if (!row)
|
|
307
|
+
return null;
|
|
308
|
+
// Update lastAccessed
|
|
309
|
+
const now = new Date().toISOString();
|
|
310
|
+
db.prepare('UPDATE entities SET last_accessed = ? WHERE id = ?').run(now, id);
|
|
311
|
+
const entity = rowToEntity({ ...row, last_accessed: now });
|
|
312
|
+
// Get connections (both outgoing and incoming)
|
|
313
|
+
const connections = this.getConnections(db, id);
|
|
314
|
+
return { entity, connections };
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Delete an entity and all its edges.
|
|
318
|
+
*/
|
|
319
|
+
forget(id, _reason) {
|
|
320
|
+
const db = this.ensureOpen();
|
|
321
|
+
// Delete edges first (both directions)
|
|
322
|
+
db.prepare('DELETE FROM edges WHERE from_id = ? OR to_id = ?').run(id, id);
|
|
323
|
+
// Delete embedding if vector search is active
|
|
324
|
+
if (this._vectorAvailable && this.vectorSearch) {
|
|
325
|
+
this.vectorSearch.delete(db, id);
|
|
326
|
+
}
|
|
327
|
+
// Delete entity
|
|
328
|
+
db.prepare('DELETE FROM entities WHERE id = ?').run(id);
|
|
329
|
+
// Dual-write to JSONL
|
|
330
|
+
this.appendToJournal('forget', { entityId: id, reason: _reason ?? null });
|
|
331
|
+
}
|
|
332
|
+
// ─── User-Scoped Queries ────────────────────────────────────────
|
|
333
|
+
/**
|
|
334
|
+
* Get all entities owned by a specific user.
|
|
335
|
+
* Used for GDPR data export (/mydata).
|
|
336
|
+
*/
|
|
337
|
+
getEntitiesByUser(userId) {
|
|
338
|
+
const db = this.ensureOpen();
|
|
339
|
+
const rows = db.prepare('SELECT * FROM entities WHERE owner_id = ?').all(userId);
|
|
340
|
+
return rows.map(rowToEntity);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Delete all entities owned by a specific user and their associated edges.
|
|
344
|
+
* Used for GDPR data erasure (/forget).
|
|
345
|
+
* Returns the number of entities deleted.
|
|
346
|
+
*/
|
|
347
|
+
deleteEntitiesByUser(userId) {
|
|
348
|
+
const db = this.ensureOpen();
|
|
349
|
+
// Get IDs of entities to delete
|
|
350
|
+
const ids = db.prepare('SELECT id FROM entities WHERE owner_id = ?').all(userId);
|
|
351
|
+
if (ids.length === 0)
|
|
352
|
+
return 0;
|
|
353
|
+
const deleteEdges = db.prepare('DELETE FROM edges WHERE from_id = ? OR to_id = ?');
|
|
354
|
+
const deleteEntity = db.prepare('DELETE FROM entities WHERE id = ?');
|
|
355
|
+
const runDeletion = db.transaction(() => {
|
|
356
|
+
for (const { id } of ids) {
|
|
357
|
+
deleteEdges.run(id, id);
|
|
358
|
+
if (this._vectorAvailable && this.vectorSearch) {
|
|
359
|
+
this.vectorSearch.delete(db, id);
|
|
360
|
+
}
|
|
361
|
+
deleteEntity.run(id);
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
runDeletion();
|
|
365
|
+
return ids.length;
|
|
366
|
+
}
|
|
367
|
+
// ─── Edge CRUD ──────────────────────────────────────────────────
|
|
368
|
+
/**
|
|
369
|
+
* Create a relationship between two entities.
|
|
370
|
+
* Returns the edge ID. Silently returns existing edge ID if duplicate.
|
|
371
|
+
*/
|
|
372
|
+
connect(fromId, toId, relation, context, weight = 1.0) {
|
|
373
|
+
const db = this.ensureOpen();
|
|
374
|
+
// Check for existing edge with same (from, to, relation)
|
|
375
|
+
const existing = db.prepare('SELECT id FROM edges WHERE from_id = ? AND to_id = ? AND relation = ?').get(fromId, toId, relation);
|
|
376
|
+
if (existing)
|
|
377
|
+
return existing.id;
|
|
378
|
+
const id = crypto.randomUUID();
|
|
379
|
+
const now = new Date().toISOString();
|
|
380
|
+
db.prepare(`
|
|
381
|
+
INSERT INTO edges (id, from_id, to_id, relation, weight, context, created_at)
|
|
382
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
383
|
+
`).run(id, fromId, toId, relation, weight, context ?? null, now);
|
|
384
|
+
// Dual-write to JSONL
|
|
385
|
+
this.appendToJournal('connect', {
|
|
386
|
+
edge: { id, fromId, toId, relation, weight, context: context ?? null, createdAt: now },
|
|
387
|
+
});
|
|
388
|
+
return id;
|
|
389
|
+
}
|
|
390
|
+
// ─── Lookup ─────────────────────────────────────────────────────
|
|
391
|
+
/**
|
|
392
|
+
* Find an entity by its exact source key.
|
|
393
|
+
* Used for deduplication during migration.
|
|
394
|
+
*/
|
|
395
|
+
findBySource(source) {
|
|
396
|
+
const db = this.ensureOpen();
|
|
397
|
+
const row = db.prepare('SELECT * FROM entities WHERE source = ?').get(source);
|
|
398
|
+
return row ? rowToEntity(row) : null;
|
|
399
|
+
}
|
|
400
|
+
// ─── Search ─────────────────────────────────────────────────────
|
|
401
|
+
/**
|
|
402
|
+
* Full-text search with multi-signal ranking.
|
|
403
|
+
*
|
|
404
|
+
* Without vector search:
|
|
405
|
+
* Score = (fts5_rank * 0.5) + (confidence * 0.3) + (access * 0.1) + (recency * 0.1)
|
|
406
|
+
*
|
|
407
|
+
* With vector search (hybrid mode):
|
|
408
|
+
* Score = (fts5_rank * 0.4) + (confidence * 0.3) + (access * 0.1) + (vector_sim * 0.2)
|
|
409
|
+
*/
|
|
410
|
+
search(query, options) {
|
|
411
|
+
const db = this.ensureOpen();
|
|
412
|
+
const sanitized = sanitizeFts5Query(query);
|
|
413
|
+
if (!sanitized)
|
|
414
|
+
return [];
|
|
415
|
+
const limit = options?.limit ?? 20;
|
|
416
|
+
// ─── FTS5 results ─────────────────────────────────────────
|
|
417
|
+
let sql = `
|
|
418
|
+
SELECT e.*, entities_fts.rank as fts_rank
|
|
419
|
+
FROM entities_fts
|
|
420
|
+
JOIN entities e ON e.rowid = entities_fts.rowid
|
|
421
|
+
WHERE entities_fts MATCH ?
|
|
422
|
+
`;
|
|
423
|
+
const params = [sanitized];
|
|
424
|
+
if (options?.types && options.types.length > 0) {
|
|
425
|
+
const placeholders = options.types.map(() => '?').join(',');
|
|
426
|
+
sql += ` AND e.type IN (${placeholders})`;
|
|
427
|
+
params.push(...options.types);
|
|
428
|
+
}
|
|
429
|
+
if (options?.domain) {
|
|
430
|
+
sql += ` AND e.domain = ?`;
|
|
431
|
+
params.push(options.domain);
|
|
432
|
+
}
|
|
433
|
+
if (options?.minConfidence !== undefined) {
|
|
434
|
+
sql += ` AND e.confidence >= ?`;
|
|
435
|
+
params.push(options.minConfidence);
|
|
436
|
+
}
|
|
437
|
+
// Privacy filtering: if userId is provided, filter by visibility
|
|
438
|
+
if (options?.userId) {
|
|
439
|
+
const privacyFilter = buildPrivacySqlFilter(options.userId, {
|
|
440
|
+
ownerColumn: 'e.owner_id',
|
|
441
|
+
scopeColumn: 'e.privacy_scope',
|
|
442
|
+
});
|
|
443
|
+
sql += ` AND ${privacyFilter.clause}`;
|
|
444
|
+
params.push(...privacyFilter.params);
|
|
445
|
+
}
|
|
446
|
+
sql += ` ORDER BY entities_fts.rank LIMIT ?`;
|
|
447
|
+
params.push(limit * 3); // Fetch extra for re-ranking
|
|
448
|
+
const rows = db.prepare(sql).all(...params);
|
|
449
|
+
// ─── Vector results (if available) ────────────────────────
|
|
450
|
+
// vectorScores is populated asynchronously via searchHybrid() for callers
|
|
451
|
+
// that need vector scoring. For synchronous search(), we use cached scores
|
|
452
|
+
// from _lastVectorScores if searchHybrid was recently called.
|
|
453
|
+
const vectorScores = this._lastVectorScores;
|
|
454
|
+
const useVectors = this._vectorAvailable && vectorScores !== null && vectorScores.size > 0;
|
|
455
|
+
// ─── Merge & re-rank ──────────────────────────────────────
|
|
456
|
+
const now = Date.now();
|
|
457
|
+
const entityMap = new Map();
|
|
458
|
+
for (const row of rows) {
|
|
459
|
+
const entity = rowToEntity(row);
|
|
460
|
+
const ftsScore = 1 / (1 + Math.abs(row.fts_rank));
|
|
461
|
+
const daysSinceAccessed = (now - new Date(entity.lastAccessed).getTime()) / (1000 * 60 * 60 * 24);
|
|
462
|
+
const accessScore = Math.exp(-0.01 * daysSinceAccessed);
|
|
463
|
+
let score;
|
|
464
|
+
if (useVectors) {
|
|
465
|
+
const vecSim = vectorScores.get(entity.id) ?? 0;
|
|
466
|
+
score =
|
|
467
|
+
ftsScore * 0.4 +
|
|
468
|
+
entity.confidence * 0.3 +
|
|
469
|
+
accessScore * 0.1 +
|
|
470
|
+
vecSim * 0.2;
|
|
471
|
+
}
|
|
472
|
+
else {
|
|
473
|
+
const daysSinceVerified = (now - new Date(entity.lastVerified).getTime()) / (1000 * 60 * 60 * 24);
|
|
474
|
+
const recencyScore = Math.exp(-0.02 * daysSinceVerified);
|
|
475
|
+
score =
|
|
476
|
+
ftsScore * 0.5 +
|
|
477
|
+
entity.confidence * 0.3 +
|
|
478
|
+
accessScore * 0.1 +
|
|
479
|
+
recencyScore * 0.1;
|
|
480
|
+
}
|
|
481
|
+
entityMap.set(entity.id, { ...entity, score });
|
|
482
|
+
}
|
|
483
|
+
// If vectors are available, also add vector-only hits (entities found by
|
|
484
|
+
// semantic similarity but missed by FTS5 keyword matching)
|
|
485
|
+
if (useVectors && vectorScores) {
|
|
486
|
+
vectorScores.forEach((vecSim, id) => {
|
|
487
|
+
if (!entityMap.has(id)) {
|
|
488
|
+
const row = db.prepare('SELECT * FROM entities WHERE id = ?').get(id);
|
|
489
|
+
if (row) {
|
|
490
|
+
const entity = rowToEntity(row);
|
|
491
|
+
// Apply type/domain/confidence filters
|
|
492
|
+
if (options?.types && options.types.length > 0 && !options.types.includes(entity.type))
|
|
493
|
+
return;
|
|
494
|
+
if (options?.domain && entity.domain !== options.domain)
|
|
495
|
+
return;
|
|
496
|
+
if (options?.minConfidence !== undefined && entity.confidence < options.minConfidence)
|
|
497
|
+
return;
|
|
498
|
+
const daysSinceAccessed = (now - new Date(entity.lastAccessed).getTime()) / (1000 * 60 * 60 * 24);
|
|
499
|
+
const accessScore = Math.exp(-0.01 * daysSinceAccessed);
|
|
500
|
+
// Vector-only result: no FTS score, so it contributes 0 for text signal
|
|
501
|
+
const score = 0 + // ftsScore * 0.4 = 0 (no keyword match)
|
|
502
|
+
entity.confidence * 0.3 +
|
|
503
|
+
accessScore * 0.1 +
|
|
504
|
+
vecSim * 0.2;
|
|
505
|
+
entityMap.set(entity.id, { ...entity, score });
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
const scored = Array.from(entityMap.values());
|
|
511
|
+
scored.sort((a, b) => b.score - a.score);
|
|
512
|
+
return scored.slice(0, limit);
|
|
513
|
+
}
|
|
514
|
+
// Cached vector scores from the most recent searchHybrid() call
|
|
515
|
+
_lastVectorScores = null;
|
|
516
|
+
/**
|
|
517
|
+
* Hybrid search — runs both FTS5 and vector KNN, then merges results.
|
|
518
|
+
* This is the recommended search method when vector search is available.
|
|
519
|
+
*
|
|
520
|
+
* Falls back to FTS5-only search when vectors are not available.
|
|
521
|
+
*/
|
|
522
|
+
async searchHybrid(query, options) {
|
|
523
|
+
if (!this._vectorAvailable || !this.embeddingProvider || !this.vectorSearch) {
|
|
524
|
+
// Graceful degradation: fall back to FTS5-only
|
|
525
|
+
return this.search(query, options);
|
|
526
|
+
}
|
|
527
|
+
const db = this.ensureOpen();
|
|
528
|
+
const limit = options?.limit ?? 20;
|
|
529
|
+
// Generate query embedding
|
|
530
|
+
const queryEmbedding = await this.embeddingProvider.embed(query);
|
|
531
|
+
// Run vector KNN search
|
|
532
|
+
const vecResults = this.vectorSearch.search(db, queryEmbedding, limit * 3);
|
|
533
|
+
// Build vector score map for the search() method to use
|
|
534
|
+
this._lastVectorScores = new Map();
|
|
535
|
+
for (const result of vecResults) {
|
|
536
|
+
this._lastVectorScores.set(result.id, result.similarity);
|
|
537
|
+
}
|
|
538
|
+
// Run the combined search (which now picks up vector scores)
|
|
539
|
+
const results = this.search(query, options);
|
|
540
|
+
// Clear cached scores
|
|
541
|
+
this._lastVectorScores = null;
|
|
542
|
+
return results;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* Batch-embed all entities that are missing embeddings.
|
|
546
|
+
* Used for migration when enabling vector search on an existing database.
|
|
547
|
+
*
|
|
548
|
+
* @returns Number of entities embedded
|
|
549
|
+
*/
|
|
550
|
+
async embedAllEntities(onProgress) {
|
|
551
|
+
if (!this._vectorAvailable || !this.embeddingProvider || !this.vectorSearch) {
|
|
552
|
+
return 0;
|
|
553
|
+
}
|
|
554
|
+
const db = this.ensureOpen();
|
|
555
|
+
const missingIds = this.vectorSearch.findMissingEmbeddings(db, 'entities');
|
|
556
|
+
if (missingIds.length === 0)
|
|
557
|
+
return 0;
|
|
558
|
+
let done = 0;
|
|
559
|
+
const batchSize = 32;
|
|
560
|
+
for (let i = 0; i < missingIds.length; i += batchSize) {
|
|
561
|
+
const batchIds = missingIds.slice(i, i + batchSize);
|
|
562
|
+
const batchTexts = [];
|
|
563
|
+
for (const id of batchIds) {
|
|
564
|
+
const row = db.prepare('SELECT name, content FROM entities WHERE id = ?')
|
|
565
|
+
.get(id);
|
|
566
|
+
if (row) {
|
|
567
|
+
batchTexts.push(`${row.name} ${row.content}`);
|
|
568
|
+
}
|
|
569
|
+
else {
|
|
570
|
+
batchTexts.push('');
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
const embeddings = await this.embeddingProvider.embedBatch(batchTexts);
|
|
574
|
+
const items = batchIds.map((id, idx) => ({
|
|
575
|
+
id,
|
|
576
|
+
embedding: embeddings[idx],
|
|
577
|
+
}));
|
|
578
|
+
this.vectorSearch.upsertBatch(db, items);
|
|
579
|
+
done += batchIds.length;
|
|
580
|
+
if (onProgress) {
|
|
581
|
+
onProgress(done, missingIds.length);
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
return done;
|
|
585
|
+
}
|
|
586
|
+
// ─── Confidence Decay ───────────────────────────────────────────
|
|
587
|
+
/**
|
|
588
|
+
* Apply exponential confidence decay to all entities.
|
|
589
|
+
* formula: new_confidence = confidence * exp(-0.693 * days_since_verified / half_life)
|
|
590
|
+
*/
|
|
591
|
+
decayAll() {
|
|
592
|
+
const db = this.ensureOpen();
|
|
593
|
+
const rows = db.prepare('SELECT * FROM entities').all();
|
|
594
|
+
const now = Date.now();
|
|
595
|
+
let decayed = 0;
|
|
596
|
+
let expired = 0;
|
|
597
|
+
let minConf = Infinity;
|
|
598
|
+
let maxConf = -Infinity;
|
|
599
|
+
let sumConf = 0;
|
|
600
|
+
const update = db.prepare('UPDATE entities SET confidence = ? WHERE id = ?');
|
|
601
|
+
const del = db.prepare('DELETE FROM entities WHERE id = ?');
|
|
602
|
+
const delEdges = db.prepare('DELETE FROM edges WHERE from_id = ? OR to_id = ?');
|
|
603
|
+
const runDecay = db.transaction(() => {
|
|
604
|
+
for (const row of rows) {
|
|
605
|
+
const halfLife = row.type === 'lesson'
|
|
606
|
+
? this.config.lessonDecayHalfLifeDays
|
|
607
|
+
: this.config.decayHalfLifeDays;
|
|
608
|
+
const daysSinceVerified = (now - new Date(row.last_verified).getTime()) / (1000 * 60 * 60 * 24);
|
|
609
|
+
const newConfidence = row.confidence * Math.exp(-0.693 * daysSinceVerified / halfLife);
|
|
610
|
+
// Check hard expiry
|
|
611
|
+
if (row.expires_at && new Date(row.expires_at).getTime() < now) {
|
|
612
|
+
delEdges.run(row.id, row.id);
|
|
613
|
+
// Clean up embedding if vector search active
|
|
614
|
+
if (this._vectorAvailable && this.vectorSearch) {
|
|
615
|
+
this.vectorSearch.delete(db, row.id);
|
|
616
|
+
}
|
|
617
|
+
del.run(row.id);
|
|
618
|
+
expired++;
|
|
619
|
+
continue;
|
|
620
|
+
}
|
|
621
|
+
if (Math.abs(newConfidence - row.confidence) > 0.001) {
|
|
622
|
+
update.run(newConfidence, row.id);
|
|
623
|
+
decayed++;
|
|
624
|
+
minConf = Math.min(minConf, newConfidence);
|
|
625
|
+
maxConf = Math.max(maxConf, newConfidence);
|
|
626
|
+
sumConf += newConfidence;
|
|
627
|
+
}
|
|
628
|
+
else {
|
|
629
|
+
minConf = Math.min(minConf, row.confidence);
|
|
630
|
+
maxConf = Math.max(maxConf, row.confidence);
|
|
631
|
+
sumConf += row.confidence;
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
runDecay();
|
|
636
|
+
const activeCount = rows.length - expired;
|
|
637
|
+
return {
|
|
638
|
+
entitiesProcessed: rows.length,
|
|
639
|
+
entitiesDecayed: decayed,
|
|
640
|
+
entitiesExpired: expired,
|
|
641
|
+
minConfidence: activeCount > 0 ? minConf : 0,
|
|
642
|
+
maxConfidence: activeCount > 0 ? maxConf : 0,
|
|
643
|
+
avgConfidence: activeCount > 0 ? sumConf / activeCount : 0,
|
|
644
|
+
};
|
|
645
|
+
}
|
|
646
|
+
// ─── Verify ─────────────────────────────────────────────────────
|
|
647
|
+
/**
|
|
648
|
+
* Re-verify an entity, refreshing lastVerified and optionally updating confidence.
|
|
649
|
+
*/
|
|
650
|
+
verify(id, newConfidence) {
|
|
651
|
+
const db = this.ensureOpen();
|
|
652
|
+
const now = new Date().toISOString();
|
|
653
|
+
if (newConfidence !== undefined) {
|
|
654
|
+
db.prepare('UPDATE entities SET last_verified = ?, confidence = ? WHERE id = ?')
|
|
655
|
+
.run(now, newConfidence, id);
|
|
656
|
+
}
|
|
657
|
+
else {
|
|
658
|
+
db.prepare('UPDATE entities SET last_verified = ? WHERE id = ?')
|
|
659
|
+
.run(now, id);
|
|
660
|
+
}
|
|
661
|
+
// Dual-write to JSONL
|
|
662
|
+
this.appendToJournal('verify', { entityId: id, confidence: newConfidence ?? null });
|
|
663
|
+
}
|
|
664
|
+
// ─── Supersede ──────────────────────────────────────────────────
|
|
665
|
+
/**
|
|
666
|
+
* Mark an entity as superseded by a newer one.
|
|
667
|
+
* Creates a 'supersedes' edge and lowers the old entity's confidence.
|
|
668
|
+
*/
|
|
669
|
+
supersede(oldId, newId, reason) {
|
|
670
|
+
const db = this.ensureOpen();
|
|
671
|
+
// Create supersedes edge (new -> old) — connect() already journals the edge
|
|
672
|
+
this.connect(newId, oldId, 'supersedes', reason);
|
|
673
|
+
// Lower old entity's confidence by half
|
|
674
|
+
const old = db.prepare('SELECT confidence FROM entities WHERE id = ?').get(oldId);
|
|
675
|
+
if (old) {
|
|
676
|
+
const newConf = old.confidence * 0.5;
|
|
677
|
+
db.prepare('UPDATE entities SET confidence = ? WHERE id = ?')
|
|
678
|
+
.run(newConf, oldId);
|
|
679
|
+
// Dual-write to JSONL
|
|
680
|
+
this.appendToJournal('supersede', { oldId, newId, newConfidence: newConf, reason: reason ?? null });
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
// ─── Graph Traversal ───────────────────────────────────────────
|
|
684
|
+
/**
|
|
685
|
+
* BFS graph traversal from a starting entity.
|
|
686
|
+
* Returns all reachable entities (excluding the start) up to maxDepth.
|
|
687
|
+
*/
|
|
688
|
+
explore(startId, options) {
|
|
689
|
+
const db = this.ensureOpen();
|
|
690
|
+
const maxDepth = options?.maxDepth ?? 2;
|
|
691
|
+
const relations = options?.relations;
|
|
692
|
+
const minWeight = options?.minWeight ?? 0;
|
|
693
|
+
const visited = new Set([startId]);
|
|
694
|
+
const result = [];
|
|
695
|
+
let frontier = [startId];
|
|
696
|
+
for (let depth = 0; depth < maxDepth && frontier.length > 0; depth++) {
|
|
697
|
+
const nextFrontier = [];
|
|
698
|
+
for (const nodeId of frontier) {
|
|
699
|
+
// Get outgoing edges
|
|
700
|
+
let outgoing = db.prepare('SELECT * FROM edges WHERE from_id = ?').all(nodeId);
|
|
701
|
+
// Get incoming edges
|
|
702
|
+
let incoming = db.prepare('SELECT * FROM edges WHERE to_id = ?').all(nodeId);
|
|
703
|
+
// Filter by relation type
|
|
704
|
+
if (relations) {
|
|
705
|
+
outgoing = outgoing.filter(e => relations.includes(e.relation));
|
|
706
|
+
incoming = incoming.filter(e => relations.includes(e.relation));
|
|
707
|
+
}
|
|
708
|
+
// Filter by weight
|
|
709
|
+
if (minWeight > 0) {
|
|
710
|
+
outgoing = outgoing.filter(e => e.weight >= minWeight);
|
|
711
|
+
incoming = incoming.filter(e => e.weight >= minWeight);
|
|
712
|
+
}
|
|
713
|
+
// Process outgoing: neighbor is the "to" end
|
|
714
|
+
for (const edge of outgoing) {
|
|
715
|
+
if (!visited.has(edge.to_id)) {
|
|
716
|
+
visited.add(edge.to_id);
|
|
717
|
+
const row = db.prepare('SELECT * FROM entities WHERE id = ?').get(edge.to_id);
|
|
718
|
+
if (row) {
|
|
719
|
+
result.push(rowToEntity(row));
|
|
720
|
+
nextFrontier.push(edge.to_id);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
// Process incoming: neighbor is the "from" end
|
|
725
|
+
for (const edge of incoming) {
|
|
726
|
+
if (!visited.has(edge.from_id)) {
|
|
727
|
+
visited.add(edge.from_id);
|
|
728
|
+
const row = db.prepare('SELECT * FROM entities WHERE id = ?').get(edge.from_id);
|
|
729
|
+
if (row) {
|
|
730
|
+
result.push(rowToEntity(row));
|
|
731
|
+
nextFrontier.push(edge.from_id);
|
|
732
|
+
}
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
frontier = nextFrontier;
|
|
737
|
+
}
|
|
738
|
+
return result;
|
|
739
|
+
}
|
|
740
|
+
// ─── Stale Detection ───────────────────────────────────────────
|
|
741
|
+
/**
|
|
742
|
+
* Find entities that are stale (low confidence or old).
|
|
743
|
+
*/
|
|
744
|
+
findStale(options) {
|
|
745
|
+
const db = this.ensureOpen();
|
|
746
|
+
const limit = options?.limit ?? 50;
|
|
747
|
+
let sql = 'SELECT * FROM entities WHERE 1=1';
|
|
748
|
+
const params = [];
|
|
749
|
+
if (options?.maxConfidence !== undefined) {
|
|
750
|
+
sql += ' AND confidence <= ?';
|
|
751
|
+
params.push(options.maxConfidence);
|
|
752
|
+
}
|
|
753
|
+
if (options?.olderThan) {
|
|
754
|
+
sql += ' AND last_verified < ?';
|
|
755
|
+
params.push(options.olderThan);
|
|
756
|
+
}
|
|
757
|
+
sql += ' ORDER BY confidence ASC, last_verified ASC LIMIT ?';
|
|
758
|
+
params.push(limit);
|
|
759
|
+
const rows = db.prepare(sql).all(...params);
|
|
760
|
+
return rows.map(rowToEntity);
|
|
761
|
+
}
|
|
762
|
+
// ─── Export / Import ───────────────────────────────────────────
|
|
763
|
+
/**
|
|
764
|
+
* Export all entities and edges as a JSON-serializable structure.
|
|
765
|
+
*/
|
|
766
|
+
export() {
|
|
767
|
+
const db = this.ensureOpen();
|
|
768
|
+
const entityRows = db.prepare('SELECT * FROM entities').all();
|
|
769
|
+
const edgeRows = db.prepare('SELECT * FROM edges').all();
|
|
770
|
+
return {
|
|
771
|
+
entities: entityRows.map(rowToEntity),
|
|
772
|
+
edges: edgeRows.map(rowToEdge),
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Import entities and edges, skipping duplicates by ID.
|
|
777
|
+
*/
|
|
778
|
+
import(data) {
|
|
779
|
+
const db = this.ensureOpen();
|
|
780
|
+
let entitiesImported = 0;
|
|
781
|
+
let edgesImported = 0;
|
|
782
|
+
let entitiesSkipped = 0;
|
|
783
|
+
let edgesSkipped = 0;
|
|
784
|
+
const insertEntity = db.prepare(`
|
|
785
|
+
INSERT INTO entities (id, type, name, content, confidence, created_at, last_verified, last_accessed, expires_at, source, source_session, tags, domain, owner_id, privacy_scope)
|
|
786
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
787
|
+
`);
|
|
788
|
+
const insertEdge = db.prepare(`
|
|
789
|
+
INSERT INTO edges (id, from_id, to_id, relation, weight, context, created_at)
|
|
790
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
791
|
+
`);
|
|
792
|
+
const checkEntity = db.prepare('SELECT id FROM entities WHERE id = ?');
|
|
793
|
+
const checkEdge = db.prepare('SELECT id FROM edges WHERE id = ?');
|
|
794
|
+
const runImport = db.transaction(() => {
|
|
795
|
+
for (const entity of data.entities) {
|
|
796
|
+
if (checkEntity.get(entity.id)) {
|
|
797
|
+
entitiesSkipped++;
|
|
798
|
+
continue;
|
|
799
|
+
}
|
|
800
|
+
insertEntity.run(entity.id, entity.type, entity.name, entity.content, entity.confidence, entity.createdAt, entity.lastVerified, entity.lastAccessed, entity.expiresAt ?? null, entity.source, entity.sourceSession ?? null, JSON.stringify(entity.tags), entity.domain ?? null, entity.ownerId ?? null, entity.privacyScope ?? 'shared-project');
|
|
801
|
+
entitiesImported++;
|
|
802
|
+
}
|
|
803
|
+
for (const edge of data.edges) {
|
|
804
|
+
if (checkEdge.get(edge.id)) {
|
|
805
|
+
edgesSkipped++;
|
|
806
|
+
continue;
|
|
807
|
+
}
|
|
808
|
+
insertEdge.run(edge.id, edge.fromId, edge.toId, edge.relation, edge.weight, edge.context ?? null, edge.createdAt);
|
|
809
|
+
edgesImported++;
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
runImport();
|
|
813
|
+
// Journal all successfully imported items (count-based — we know exactly how many were new)
|
|
814
|
+
if (entitiesImported > 0 || edgesImported > 0) {
|
|
815
|
+
this.appendToJournal('import', {
|
|
816
|
+
entitiesImported, edgesImported, entitiesSkipped, edgesSkipped,
|
|
817
|
+
});
|
|
818
|
+
}
|
|
819
|
+
return { entitiesImported, edgesImported, entitiesSkipped, edgesSkipped };
|
|
820
|
+
}
|
|
821
|
+
// ─── JSONL Rebuild (Disaster Recovery) ─────────────────────────
|
|
822
|
+
/**
|
|
823
|
+
* Import entities and edges from the JSONL append log.
|
|
824
|
+
* Replays all 'remember' and 'connect' actions, skipping duplicates.
|
|
825
|
+
* Applies 'forget' actions to remove deleted entities.
|
|
826
|
+
* Returns the number of entities and edges recovered.
|
|
827
|
+
*
|
|
828
|
+
* Follows TopicMemory's resilience pattern: JSONL is source of truth,
|
|
829
|
+
* SQLite is derived query layer that can be rebuilt at any time.
|
|
830
|
+
*/
|
|
831
|
+
importFromJsonl(jsonlPath) {
|
|
832
|
+
const db = this.ensureOpen();
|
|
833
|
+
const logPath = jsonlPath ?? this.jsonlPath;
|
|
834
|
+
if (!fs.existsSync(logPath))
|
|
835
|
+
return { entities: 0, edges: 0, forgotten: 0 };
|
|
836
|
+
const content = fs.readFileSync(logPath, 'utf-8');
|
|
837
|
+
const lines = content.split('\n').filter(Boolean);
|
|
838
|
+
let entities = 0;
|
|
839
|
+
let edges = 0;
|
|
840
|
+
let forgotten = 0;
|
|
841
|
+
const insertEntity = db.prepare(`
|
|
842
|
+
INSERT OR IGNORE INTO entities (id, type, name, content, confidence, created_at, last_verified, last_accessed, expires_at, source, source_session, tags, domain, owner_id, privacy_scope)
|
|
843
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
844
|
+
`);
|
|
845
|
+
const insertEdge = db.prepare(`
|
|
846
|
+
INSERT OR IGNORE INTO edges (id, from_id, to_id, relation, weight, context, created_at)
|
|
847
|
+
VALUES (?, ?, ?, ?, ?, ?, ?)
|
|
848
|
+
`);
|
|
849
|
+
const deleteEntity = db.prepare('DELETE FROM entities WHERE id = ?');
|
|
850
|
+
const deleteEdges = db.prepare('DELETE FROM edges WHERE from_id = ? OR to_id = ?');
|
|
851
|
+
const updateVerify = db.prepare('UPDATE entities SET last_verified = ?, confidence = COALESCE(?, confidence) WHERE id = ?');
|
|
852
|
+
const runReplay = db.transaction(() => {
|
|
853
|
+
for (const line of lines) {
|
|
854
|
+
try {
|
|
855
|
+
const entry = JSON.parse(line);
|
|
856
|
+
switch (entry.action) {
|
|
857
|
+
case 'remember': {
|
|
858
|
+
const e = entry.entity;
|
|
859
|
+
if (!e?.id)
|
|
860
|
+
break;
|
|
861
|
+
const result = insertEntity.run(e.id, e.type, e.name, e.content, e.confidence, e.createdAt, e.lastVerified, e.lastAccessed, e.expiresAt ?? null, e.source, e.sourceSession ?? null, JSON.stringify(e.tags ?? []), e.domain ?? null, e.ownerId ?? null, e.privacyScope ?? 'shared-project');
|
|
862
|
+
if (result.changes > 0)
|
|
863
|
+
entities++;
|
|
864
|
+
break;
|
|
865
|
+
}
|
|
866
|
+
case 'connect': {
|
|
867
|
+
const edge = entry.edge;
|
|
868
|
+
if (!edge?.id)
|
|
869
|
+
break;
|
|
870
|
+
const result = insertEdge.run(edge.id, edge.fromId, edge.toId, edge.relation, edge.weight ?? 1.0, edge.context ?? null, edge.createdAt);
|
|
871
|
+
if (result.changes > 0)
|
|
872
|
+
edges++;
|
|
873
|
+
break;
|
|
874
|
+
}
|
|
875
|
+
case 'forget': {
|
|
876
|
+
const id = entry.entityId;
|
|
877
|
+
if (!id)
|
|
878
|
+
break;
|
|
879
|
+
deleteEdges.run(id, id);
|
|
880
|
+
const result = deleteEntity.run(id);
|
|
881
|
+
if (result.changes > 0)
|
|
882
|
+
forgotten++;
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
case 'verify': {
|
|
886
|
+
const id = entry.entityId;
|
|
887
|
+
if (!id)
|
|
888
|
+
break;
|
|
889
|
+
updateVerify.run(entry.timestamp, entry.confidence ?? null, id);
|
|
890
|
+
break;
|
|
891
|
+
}
|
|
892
|
+
case 'supersede': {
|
|
893
|
+
// supersede journals are informational — the actual connect + confidence
|
|
894
|
+
// update are replayed from their own journal entries
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
catch { /* @silent-fallback-ok — skip corrupted JSONL lines */ }
|
|
900
|
+
}
|
|
901
|
+
});
|
|
902
|
+
runReplay();
|
|
903
|
+
// Rebuild FTS5 index to match recovered data
|
|
904
|
+
try {
|
|
905
|
+
db.exec(`INSERT INTO entities_fts(entities_fts) VALUES ('rebuild')`);
|
|
906
|
+
}
|
|
907
|
+
catch { /* @silent-fallback-ok — FTS rebuild non-critical */ }
|
|
908
|
+
return { entities, edges, forgotten };
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* Full rebuild — drop all entities and edges, rebuild from JSONL.
|
|
912
|
+
* This is the nuclear option for disaster recovery.
|
|
913
|
+
*
|
|
914
|
+
* Preserves the JSONL log (source of truth) and rebuilds SQLite from it.
|
|
915
|
+
*/
|
|
916
|
+
rebuild(jsonlPath) {
|
|
917
|
+
const db = this.ensureOpen();
|
|
918
|
+
db.exec('DELETE FROM edges');
|
|
919
|
+
db.exec('DELETE FROM entities');
|
|
920
|
+
db.exec(`INSERT INTO entities_fts(entities_fts) VALUES ('rebuild')`);
|
|
921
|
+
// Delete vector embeddings if available (they'll be regenerated)
|
|
922
|
+
if (this._vectorAvailable) {
|
|
923
|
+
try {
|
|
924
|
+
db.exec('DELETE FROM entity_embeddings');
|
|
925
|
+
}
|
|
926
|
+
catch { /* @silent-fallback-ok — vector table may not exist */ }
|
|
927
|
+
}
|
|
928
|
+
return this.importFromJsonl(jsonlPath);
|
|
929
|
+
}
|
|
930
|
+
/**
|
|
931
|
+
* Write a full JSON snapshot to disk for periodic backup.
|
|
932
|
+
* This is a point-in-time export that complements the JSONL append log.
|
|
933
|
+
*/
|
|
934
|
+
writeSnapshot(snapshotPath) {
|
|
935
|
+
const data = this.export();
|
|
936
|
+
const outPath = snapshotPath ?? this.config.dbPath.replace(/\.db$/, '-snapshot.json');
|
|
937
|
+
const dir = path.dirname(outPath);
|
|
938
|
+
if (!fs.existsSync(dir)) {
|
|
939
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
940
|
+
}
|
|
941
|
+
const json = JSON.stringify(data, null, 2);
|
|
942
|
+
fs.writeFileSync(outPath, json, 'utf-8');
|
|
943
|
+
return {
|
|
944
|
+
path: outPath,
|
|
945
|
+
entities: data.entities.length,
|
|
946
|
+
edges: data.edges.length,
|
|
947
|
+
sizeBytes: Buffer.byteLength(json),
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
// ─── Statistics ─────────────────────────────────────────────────
|
|
951
|
+
/**
|
|
952
|
+
* Get aggregate statistics about the memory store.
|
|
953
|
+
*/
|
|
954
|
+
stats() {
|
|
955
|
+
const db = this.ensureOpen();
|
|
956
|
+
const entityCount = db.prepare('SELECT COUNT(*) as cnt FROM entities').get().cnt;
|
|
957
|
+
const edgeCount = db.prepare('SELECT COUNT(*) as cnt FROM edges').get().cnt;
|
|
958
|
+
// Count by type
|
|
959
|
+
const typeCounts = db.prepare('SELECT type, COUNT(*) as cnt FROM entities GROUP BY type').all();
|
|
960
|
+
const entityCountsByType = {};
|
|
961
|
+
for (const row of typeCounts) {
|
|
962
|
+
entityCountsByType[row.type] = row.cnt;
|
|
963
|
+
}
|
|
964
|
+
// Avg confidence
|
|
965
|
+
const avgRow = db.prepare('SELECT AVG(confidence) as avg FROM entities').get();
|
|
966
|
+
const avgConfidence = avgRow.avg ?? 0;
|
|
967
|
+
// Stale count
|
|
968
|
+
const staleCount = db.prepare('SELECT COUNT(*) as cnt FROM entities WHERE confidence < ?').get(this.config.staleThreshold).cnt;
|
|
969
|
+
// DB file size
|
|
970
|
+
let dbSizeBytes = 0;
|
|
971
|
+
try {
|
|
972
|
+
dbSizeBytes = fs.statSync(this.config.dbPath).size;
|
|
973
|
+
}
|
|
974
|
+
catch {
|
|
975
|
+
// File may not exist yet @silent-fallback-ok: stat before DB fully flushed
|
|
976
|
+
}
|
|
977
|
+
// Vector search stats
|
|
978
|
+
let embeddingCount = 0;
|
|
979
|
+
if (this._vectorAvailable && this.vectorSearch) {
|
|
980
|
+
try {
|
|
981
|
+
embeddingCount = this.vectorSearch.count(db);
|
|
982
|
+
}
|
|
983
|
+
catch { // @silent-fallback-ok: vec0 table may not be queryable, report 0 embeddings
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
return {
|
|
987
|
+
totalEntities: entityCount,
|
|
988
|
+
totalEdges: edgeCount,
|
|
989
|
+
entityCountsByType: entityCountsByType,
|
|
990
|
+
avgConfidence: Math.round(avgConfidence * 100) / 100, // Round to 2 decimal places
|
|
991
|
+
staleCount,
|
|
992
|
+
dbSizeBytes,
|
|
993
|
+
vectorSearchAvailable: this._vectorAvailable,
|
|
994
|
+
embeddingCount,
|
|
995
|
+
};
|
|
996
|
+
}
|
|
997
|
+
// ─── Context Generation ─────────────────────────────────────────
|
|
998
|
+
/**
|
|
999
|
+
* Generate formatted markdown context for a query, suitable for session injection.
|
|
1000
|
+
* Returns empty string if no relevant entities found.
|
|
1001
|
+
*/
|
|
1002
|
+
getRelevantContext(query, options) {
|
|
1003
|
+
const maxTokens = options?.maxTokens ?? 2000;
|
|
1004
|
+
const limit = options?.limit ?? 10;
|
|
1005
|
+
const results = this.search(query, { limit, userId: options?.userId });
|
|
1006
|
+
if (results.length === 0)
|
|
1007
|
+
return '';
|
|
1008
|
+
const lines = [];
|
|
1009
|
+
let estimatedTokens = 0;
|
|
1010
|
+
for (const entity of results) {
|
|
1011
|
+
const entry = `### ${entity.name} (${entity.type})\n${entity.content}\n`;
|
|
1012
|
+
// Rough token estimate: ~0.75 tokens per word
|
|
1013
|
+
const entryTokens = entry.split(/\s+/).length / 0.75;
|
|
1014
|
+
if (estimatedTokens + entryTokens > maxTokens)
|
|
1015
|
+
break;
|
|
1016
|
+
lines.push(entry);
|
|
1017
|
+
estimatedTokens += entryTokens;
|
|
1018
|
+
}
|
|
1019
|
+
return lines.join('\n');
|
|
1020
|
+
}
|
|
1021
|
+
// ─── Private Helpers ───────────────────────────────────────────
|
|
1022
|
+
getConnections(db, entityId) {
|
|
1023
|
+
const connections = [];
|
|
1024
|
+
// Outgoing edges — use explicit column aliases to avoid JOIN collisions
|
|
1025
|
+
const outgoing = db.prepare(`
|
|
1026
|
+
SELECT
|
|
1027
|
+
e.id as edge_id, e.from_id, e.to_id, e.relation, e.weight,
|
|
1028
|
+
e.context as edge_context, e.created_at as edge_created_at,
|
|
1029
|
+
ent.id as ent_id, ent.type, ent.name, ent.content, ent.confidence,
|
|
1030
|
+
ent.created_at as ent_created_at, ent.last_verified, ent.last_accessed,
|
|
1031
|
+
ent.expires_at, ent.source, ent.source_session, ent.tags, ent.domain,
|
|
1032
|
+
ent.owner_id, ent.privacy_scope
|
|
1033
|
+
FROM edges e
|
|
1034
|
+
JOIN entities ent ON ent.id = e.to_id
|
|
1035
|
+
WHERE e.from_id = ?
|
|
1036
|
+
`).all(entityId);
|
|
1037
|
+
for (const row of outgoing) {
|
|
1038
|
+
connections.push({
|
|
1039
|
+
entity: joinRowToEntity(row),
|
|
1040
|
+
edge: joinRowToEdge(row),
|
|
1041
|
+
direction: 'outgoing',
|
|
1042
|
+
});
|
|
1043
|
+
}
|
|
1044
|
+
// Incoming edges
|
|
1045
|
+
const incoming = db.prepare(`
|
|
1046
|
+
SELECT
|
|
1047
|
+
e.id as edge_id, e.from_id, e.to_id, e.relation, e.weight,
|
|
1048
|
+
e.context as edge_context, e.created_at as edge_created_at,
|
|
1049
|
+
ent.id as ent_id, ent.type, ent.name, ent.content, ent.confidence,
|
|
1050
|
+
ent.created_at as ent_created_at, ent.last_verified, ent.last_accessed,
|
|
1051
|
+
ent.expires_at, ent.source, ent.source_session, ent.tags, ent.domain,
|
|
1052
|
+
ent.owner_id, ent.privacy_scope
|
|
1053
|
+
FROM edges e
|
|
1054
|
+
JOIN entities ent ON ent.id = e.from_id
|
|
1055
|
+
WHERE e.to_id = ?
|
|
1056
|
+
`).all(entityId);
|
|
1057
|
+
for (const row of incoming) {
|
|
1058
|
+
connections.push({
|
|
1059
|
+
entity: joinRowToEntity(row),
|
|
1060
|
+
edge: joinRowToEdge(row),
|
|
1061
|
+
direction: 'incoming',
|
|
1062
|
+
});
|
|
1063
|
+
}
|
|
1064
|
+
return connections;
|
|
1065
|
+
}
|
|
1066
|
+
}
|
|
1067
|
+
// ─── Converters ─────────────────────────────────────────────────
|
|
1068
|
+
function rowToEntity(row) {
|
|
1069
|
+
return {
|
|
1070
|
+
id: row.id,
|
|
1071
|
+
type: row.type,
|
|
1072
|
+
name: row.name,
|
|
1073
|
+
content: row.content,
|
|
1074
|
+
confidence: row.confidence,
|
|
1075
|
+
createdAt: row.created_at,
|
|
1076
|
+
lastVerified: row.last_verified,
|
|
1077
|
+
lastAccessed: row.last_accessed,
|
|
1078
|
+
expiresAt: row.expires_at ?? undefined,
|
|
1079
|
+
source: row.source,
|
|
1080
|
+
sourceSession: row.source_session ?? undefined,
|
|
1081
|
+
tags: JSON.parse(row.tags),
|
|
1082
|
+
domain: row.domain ?? undefined,
|
|
1083
|
+
ownerId: row.owner_id ?? undefined,
|
|
1084
|
+
privacyScope: row.privacy_scope ?? undefined,
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
function rowToEdge(row) {
|
|
1088
|
+
return {
|
|
1089
|
+
id: row.id,
|
|
1090
|
+
fromId: row.from_id,
|
|
1091
|
+
toId: row.to_id,
|
|
1092
|
+
relation: row.relation,
|
|
1093
|
+
weight: row.weight,
|
|
1094
|
+
context: row.context ?? undefined,
|
|
1095
|
+
createdAt: row.created_at,
|
|
1096
|
+
};
|
|
1097
|
+
}
|
|
1098
|
+
/** Convert a JOIN row (with explicit aliases) to a MemoryEntity */
|
|
1099
|
+
function joinRowToEntity(row) {
|
|
1100
|
+
return {
|
|
1101
|
+
id: row.ent_id,
|
|
1102
|
+
type: row.type,
|
|
1103
|
+
name: row.name,
|
|
1104
|
+
content: row.content,
|
|
1105
|
+
confidence: row.confidence,
|
|
1106
|
+
createdAt: row.ent_created_at,
|
|
1107
|
+
lastVerified: row.last_verified,
|
|
1108
|
+
lastAccessed: row.last_accessed,
|
|
1109
|
+
expiresAt: row.expires_at ?? undefined,
|
|
1110
|
+
source: row.source,
|
|
1111
|
+
sourceSession: row.source_session ?? undefined,
|
|
1112
|
+
tags: JSON.parse(row.tags),
|
|
1113
|
+
domain: row.domain ?? undefined,
|
|
1114
|
+
ownerId: row.owner_id ?? undefined,
|
|
1115
|
+
privacyScope: row.privacy_scope ?? undefined,
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
/** Convert a JOIN row (with explicit aliases) to a MemoryEdge */
|
|
1119
|
+
function joinRowToEdge(row) {
|
|
1120
|
+
return {
|
|
1121
|
+
id: row.edge_id,
|
|
1122
|
+
fromId: row.from_id,
|
|
1123
|
+
toId: row.to_id,
|
|
1124
|
+
relation: row.relation,
|
|
1125
|
+
weight: row.weight,
|
|
1126
|
+
context: row.edge_context ?? undefined,
|
|
1127
|
+
createdAt: row.edge_created_at,
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
//# sourceMappingURL=SemanticMemory.js.map
|