noormme 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +71 -306
- package/dist/cjs/agentic/ActionJournal.d.ts +55 -0
- package/dist/cjs/agentic/ActionJournal.js +130 -0
- package/dist/cjs/agentic/CapabilityManager.d.ts +43 -0
- package/dist/cjs/agentic/CapabilityManager.js +131 -0
- package/dist/cjs/agentic/CognitiveRepository.d.ts +24 -0
- package/dist/cjs/agentic/CognitiveRepository.js +77 -0
- package/dist/cjs/agentic/ContextBuffer.d.ts +54 -0
- package/dist/cjs/agentic/ContextBuffer.js +112 -0
- package/dist/cjs/agentic/Cortex.d.ts +85 -0
- package/dist/cjs/agentic/Cortex.js +152 -0
- package/dist/cjs/agentic/EpisodicMemory.d.ts +43 -0
- package/dist/cjs/agentic/EpisodicMemory.js +103 -0
- package/dist/cjs/agentic/PersonaManager.d.ts +47 -0
- package/dist/cjs/agentic/PersonaManager.js +100 -0
- package/dist/cjs/agentic/PolicyEnforcer.d.ts +57 -0
- package/dist/cjs/agentic/PolicyEnforcer.js +171 -0
- package/dist/cjs/agentic/ResourceMonitor.d.ts +48 -0
- package/dist/cjs/agentic/ResourceMonitor.js +95 -0
- package/dist/cjs/agentic/SessionCompressor.d.ts +26 -0
- package/dist/cjs/agentic/SessionCompressor.js +87 -0
- package/dist/cjs/agentic/SessionManager.d.ts +66 -0
- package/dist/cjs/agentic/SessionManager.js +249 -0
- package/dist/cjs/agentic/VectorIndexer.d.ts +37 -0
- package/dist/cjs/agentic/VectorIndexer.js +113 -0
- package/dist/cjs/agentic/improvement/AblationEngine.d.ts +31 -0
- package/dist/cjs/agentic/improvement/AblationEngine.js +139 -0
- package/dist/cjs/agentic/improvement/ActionRefiner.d.ts +26 -0
- package/dist/cjs/agentic/improvement/ActionRefiner.js +88 -0
- package/dist/cjs/agentic/improvement/ConflictResolver.d.ts +21 -0
- package/dist/cjs/agentic/improvement/ConflictResolver.js +98 -0
- package/dist/cjs/agentic/improvement/CortexJanitor.d.ts +36 -0
- package/dist/cjs/agentic/improvement/CortexJanitor.js +118 -0
- package/dist/cjs/agentic/improvement/CuriosityEngine.d.ts +45 -0
- package/dist/cjs/agentic/improvement/CuriosityEngine.js +220 -0
- package/dist/cjs/agentic/improvement/EvolutionaryPilot.d.ts +20 -0
- package/dist/cjs/agentic/improvement/EvolutionaryPilot.js +88 -0
- package/dist/cjs/agentic/improvement/GoalArchitect.d.ts +53 -0
- package/dist/cjs/agentic/improvement/GoalArchitect.js +158 -0
- package/dist/cjs/agentic/improvement/GovernanceManager.d.ts +25 -0
- package/dist/cjs/agentic/improvement/GovernanceManager.js +104 -0
- package/dist/cjs/agentic/improvement/HiveLink.d.ts +25 -0
- package/dist/cjs/agentic/improvement/HiveLink.js +116 -0
- package/dist/cjs/agentic/improvement/KnowledgeDistiller.d.ts +87 -0
- package/dist/cjs/agentic/improvement/KnowledgeDistiller.js +301 -0
- package/dist/cjs/agentic/improvement/RecursiveReasoner.d.ts +35 -0
- package/dist/cjs/agentic/improvement/RecursiveReasoner.js +136 -0
- package/dist/cjs/agentic/improvement/ReflectionEngine.d.ts +25 -0
- package/dist/cjs/agentic/improvement/ReflectionEngine.js +74 -0
- package/dist/cjs/agentic/improvement/RitualOrchestrator.d.ts +28 -0
- package/dist/cjs/agentic/improvement/RitualOrchestrator.js +151 -0
- package/dist/cjs/agentic/improvement/RuleEngine.d.ts +56 -0
- package/dist/cjs/agentic/improvement/RuleEngine.js +132 -0
- package/dist/cjs/agentic/improvement/SelfEvolution.d.ts +50 -0
- package/dist/cjs/agentic/improvement/SelfEvolution.js +284 -0
- package/dist/cjs/agentic/improvement/SelfTestRegistry.d.ts +25 -0
- package/dist/cjs/agentic/improvement/SelfTestRegistry.js +168 -0
- package/dist/cjs/agentic/improvement/SovereignMetrics.d.ts +66 -0
- package/dist/cjs/agentic/improvement/SovereignMetrics.js +128 -0
- package/dist/cjs/agentic/improvement/StrategicPlanner.d.ts +71 -0
- package/dist/cjs/agentic/improvement/StrategicPlanner.js +222 -0
- package/dist/cjs/agentic/telemetry/CognitiveSynthesizer.d.ts +26 -0
- package/dist/cjs/agentic/telemetry/CognitiveSynthesizer.js +164 -0
- package/dist/cjs/agentic/telemetry/EventHarvester.d.ts +12 -0
- package/dist/cjs/agentic/telemetry/EventHarvester.js +34 -0
- package/dist/cjs/agentic/telemetry/ResearchAlchemist.d.ts +20 -0
- package/dist/cjs/agentic/telemetry/ResearchAlchemist.js +48 -0
- package/dist/cjs/agentic/telemetry/TelemetryOrchestrator.d.ts +21 -0
- package/dist/cjs/agentic/telemetry/TelemetryOrchestrator.js +45 -0
- package/dist/cjs/cache/cache-manager.d.ts +1 -1
- package/dist/cjs/cache/cache-manager.js +16 -14
- package/dist/cjs/cli/commands/analyze.js +46 -25
- package/dist/cjs/cli/commands/generate.js +5 -2
- package/dist/cjs/cli/commands/inspect.js +25 -8
- package/dist/cjs/cli/commands/migrate.js +29 -154
- package/dist/cjs/cli/commands/optimize.js +18 -4
- package/dist/cjs/cli/commands/status.js +30 -10
- package/dist/cjs/cli/commands/watch.js +142 -135
- package/dist/cjs/dialect/database-introspector.d.ts +23 -2
- package/dist/cjs/dialect/database-introspector.js +119 -37
- package/dist/cjs/dialect/postgresql/postgresql-adapter.d.ts +81 -0
- package/dist/cjs/dialect/postgresql/postgresql-adapter.js +40 -0
- package/dist/cjs/dialect/postgresql/postgresql-dialect-config.d.ts +65 -0
- package/dist/cjs/dialect/postgresql/postgresql-dialect-config.js +2 -0
- package/dist/cjs/dialect/postgresql/postgresql-dialect.d.ts +80 -0
- package/dist/cjs/dialect/postgresql/postgresql-dialect.js +76 -0
- package/dist/cjs/dialect/postgresql/postgresql-driver.d.ts +51 -0
- package/dist/cjs/dialect/postgresql/postgresql-driver.js +159 -0
- package/dist/cjs/dialect/postgresql/postgresql-features.d.ts +377 -0
- package/dist/cjs/dialect/postgresql/postgresql-features.js +459 -0
- package/dist/cjs/dialect/postgresql/postgresql-introspector.d.ts +34 -0
- package/dist/cjs/dialect/postgresql/postgresql-introspector.js +324 -0
- package/dist/cjs/dialect/postgresql/postgresql-query-compiler.d.ts +11 -0
- package/dist/cjs/dialect/postgresql/postgresql-query-compiler.js +39 -0
- package/dist/cjs/dialect/sqlite/sqlite-driver.js +2 -3
- package/dist/cjs/dialect/sqlite/sqlite-introspector.d.ts +10 -0
- package/dist/cjs/dialect/sqlite/sqlite-introspector.js +36 -21
- package/dist/cjs/edge-runtime/edge-config.d.ts +8 -2
- package/dist/cjs/edge-runtime/edge-config.js +26 -29
- package/dist/cjs/helpers/agent-schema.d.ts +19 -0
- package/dist/cjs/helpers/agent-schema.js +292 -0
- package/dist/cjs/helpers/postgresql.d.ts +96 -0
- package/dist/cjs/helpers/postgresql.js +147 -0
- package/dist/cjs/helpers/schema-evolution.d.ts +30 -0
- package/dist/cjs/helpers/schema-evolution.js +122 -0
- package/dist/cjs/index.d.ts +40 -2
- package/dist/cjs/index.js +53 -2
- package/dist/cjs/kysely.d.ts +1 -2
- package/dist/cjs/kysely.js +1 -7
- package/dist/cjs/logging/logger.js +58 -2
- package/dist/cjs/migration/data_migrator.d.ts +40 -0
- package/dist/cjs/migration/data_migrator.js +230 -0
- package/dist/cjs/migration/database_migration_manager.d.ts +77 -0
- package/dist/cjs/migration/database_migration_manager.js +383 -0
- package/dist/cjs/migration/index.d.ts +19 -0
- package/dist/cjs/migration/index.js +53 -0
- package/dist/cjs/migration/migration-types.d.ts +157 -0
- package/dist/cjs/migration/migration-types.js +5 -0
- package/dist/cjs/migration/schema_differ.d.ts +24 -0
- package/dist/cjs/migration/schema_differ.js +323 -0
- package/dist/cjs/migration/schema_introspector.d.ts +13 -0
- package/dist/cjs/migration/schema_introspector.js +364 -0
- package/dist/cjs/migration/type_mapper.d.ts +23 -0
- package/dist/cjs/migration/type_mapper.js +263 -0
- package/dist/cjs/noormme.d.ts +29 -0
- package/dist/cjs/noormme.js +98 -3
- package/dist/cjs/operation-node/add-index-node.d.ts +2 -1
- package/dist/cjs/operation-node/create-index-node.d.ts +2 -2
- package/dist/cjs/operation-node/data-type-node.d.ts +1 -1
- package/dist/cjs/operation-node/data-type-node.js +26 -0
- package/dist/cjs/operation-node/delete-query-node.d.ts +0 -9
- package/dist/cjs/operation-node/delete-query-node.js +0 -11
- package/dist/cjs/operation-node/index-type-node.d.ts +13 -0
- package/dist/cjs/operation-node/index-type-node.js +18 -0
- package/dist/cjs/operation-node/insert-query-node.d.ts +0 -2
- package/dist/cjs/operation-node/operation-node-transformer.d.ts +2 -0
- package/dist/cjs/operation-node/operation-node-transformer.js +5 -1
- package/dist/cjs/operation-node/operation-node-visitor.d.ts +2 -0
- package/dist/cjs/operation-node/operation-node-visitor.js +1 -0
- package/dist/cjs/operation-node/operation-node.d.ts +1 -1
- package/dist/cjs/operation-node/select-query-node.d.ts +0 -9
- package/dist/cjs/operation-node/select-query-node.js +0 -11
- package/dist/cjs/parser/join-parser.js +1 -1
- package/dist/cjs/parser/order-by-parser.d.ts +1 -14
- package/dist/cjs/parser/order-by-parser.js +0 -12
- package/dist/cjs/performance/query-optimizer.d.ts +1 -1
- package/dist/cjs/performance/query-optimizer.js +5 -9
- package/dist/cjs/performance/services/metrics-collector.d.ts +11 -2
- package/dist/cjs/performance/services/metrics-collector.js +89 -3
- package/dist/cjs/query-builder/aggregate-function-builder.d.ts +1 -25
- package/dist/cjs/query-builder/delete-query-builder.d.ts +115 -17
- package/dist/cjs/query-builder/order-by-interface.d.ts +1 -14
- package/dist/cjs/query-builder/over-builder.d.ts +1 -14
- package/dist/cjs/query-builder/select-query-builder.d.ts +1 -13
- package/dist/cjs/query-builder/update-query-builder.d.ts +2 -17
- package/dist/cjs/query-compiler/default-query-compiler.d.ts +2 -0
- package/dist/cjs/query-compiler/default-query-compiler.js +3 -6
- package/dist/cjs/relationships/relationship-engine.js +2 -2
- package/dist/cjs/repository/repository-factory.d.ts +11 -7
- package/dist/cjs/repository/repository-factory.js +203 -212
- package/dist/cjs/schema/builders/alter-table-add-index-builder.d.ts +1 -1
- package/dist/cjs/schema/builders/alter-table-add-index-builder.js +2 -2
- package/dist/cjs/schema/builders/create-index-builder.d.ts +3 -2
- package/dist/cjs/schema/builders/create-index-builder.js +5 -3
- package/dist/cjs/schema/core/discovery/relationship-discovery.js +45 -6
- package/dist/cjs/schema/core/discovery/table-metadata-discovery.js +11 -7
- package/dist/cjs/schema/core/discovery/view-discovery.js +14 -15
- package/dist/cjs/schema/core/factories/discovery-factory.d.ts +5 -8
- package/dist/cjs/schema/core/factories/discovery-factory.js +23 -1
- package/dist/cjs/schema/core/utils/type-mapper.js +21 -0
- package/dist/cjs/schema/dialects/postgresql/postgresql-discovery.coordinator.d.ts +44 -0
- package/dist/cjs/schema/dialects/postgresql/postgresql-discovery.coordinator.js +116 -0
- package/dist/cjs/schema/dialects/sqlite/sqlite-discovery.coordinator.js +38 -10
- package/dist/cjs/schema/test/discovery-factory.test.js +1 -1
- package/dist/cjs/schema/test/error-handling.test.js +1 -1
- package/dist/cjs/schema/test/integration.test.js +4 -2
- package/dist/cjs/schema/test/sqlite-discovery-coordinator.test.js +12 -4
- package/dist/cjs/sqlite-migration/sqlite-migration-manager.d.ts +18 -1
- package/dist/cjs/sqlite-migration/sqlite-migration-manager.js +108 -34
- package/dist/cjs/sqlite-migration/sqlite-migration-provider.d.ts +0 -6
- package/dist/cjs/sqlite-migration/sqlite-migration-provider.js +72 -70
- package/dist/cjs/types/index.d.ts +253 -1
- package/dist/cjs/types/type-generator.d.ts +0 -4
- package/dist/cjs/types/type-generator.js +15 -57
- package/dist/cjs/util/similarity.d.ts +12 -0
- package/dist/cjs/util/similarity.js +69 -0
- package/dist/cjs/watch/schema-watcher.d.ts +2 -0
- package/dist/cjs/watch/schema-watcher.js +95 -19
- package/dist/esm/agentic/ActionJournal.d.ts +55 -0
- package/dist/esm/agentic/ActionJournal.js +127 -0
- package/dist/esm/agentic/CapabilityManager.d.ts +43 -0
- package/dist/esm/agentic/CapabilityManager.js +128 -0
- package/dist/esm/agentic/CognitiveRepository.d.ts +24 -0
- package/dist/esm/agentic/CognitiveRepository.js +74 -0
- package/dist/esm/agentic/ContextBuffer.d.ts +54 -0
- package/dist/esm/agentic/ContextBuffer.js +109 -0
- package/dist/esm/agentic/Cortex.d.ts +85 -0
- package/dist/esm/agentic/Cortex.js +149 -0
- package/dist/esm/agentic/EpisodicMemory.d.ts +43 -0
- package/dist/esm/agentic/EpisodicMemory.js +100 -0
- package/dist/esm/agentic/PersonaManager.d.ts +47 -0
- package/dist/esm/agentic/PersonaManager.js +97 -0
- package/dist/esm/agentic/PolicyEnforcer.d.ts +57 -0
- package/dist/esm/agentic/PolicyEnforcer.js +168 -0
- package/dist/esm/agentic/ResourceMonitor.d.ts +48 -0
- package/dist/esm/agentic/ResourceMonitor.js +92 -0
- package/dist/esm/agentic/SessionCompressor.d.ts +26 -0
- package/dist/esm/agentic/SessionCompressor.js +84 -0
- package/dist/esm/agentic/SessionManager.d.ts +66 -0
- package/dist/esm/agentic/SessionManager.js +246 -0
- package/dist/esm/agentic/VectorIndexer.d.ts +37 -0
- package/dist/esm/agentic/VectorIndexer.js +110 -0
- package/dist/esm/agentic/improvement/AblationEngine.d.ts +31 -0
- package/dist/esm/agentic/improvement/AblationEngine.js +136 -0
- package/dist/esm/agentic/improvement/ActionRefiner.d.ts +26 -0
- package/dist/esm/agentic/improvement/ActionRefiner.js +85 -0
- package/dist/esm/agentic/improvement/ConflictResolver.d.ts +21 -0
- package/dist/esm/agentic/improvement/ConflictResolver.js +95 -0
- package/dist/esm/agentic/improvement/CortexJanitor.d.ts +36 -0
- package/dist/esm/agentic/improvement/CortexJanitor.js +115 -0
- package/dist/esm/agentic/improvement/CuriosityEngine.d.ts +45 -0
- package/dist/esm/agentic/improvement/CuriosityEngine.js +217 -0
- package/dist/esm/agentic/improvement/EvolutionaryPilot.d.ts +20 -0
- package/dist/esm/agentic/improvement/EvolutionaryPilot.js +85 -0
- package/dist/esm/agentic/improvement/GoalArchitect.d.ts +53 -0
- package/dist/esm/agentic/improvement/GoalArchitect.js +155 -0
- package/dist/esm/agentic/improvement/GovernanceManager.d.ts +25 -0
- package/dist/esm/agentic/improvement/GovernanceManager.js +101 -0
- package/dist/esm/agentic/improvement/HiveLink.d.ts +25 -0
- package/dist/esm/agentic/improvement/HiveLink.js +113 -0
- package/dist/esm/agentic/improvement/KnowledgeDistiller.d.ts +87 -0
- package/dist/esm/agentic/improvement/KnowledgeDistiller.js +298 -0
- package/dist/esm/agentic/improvement/RecursiveReasoner.d.ts +35 -0
- package/dist/esm/agentic/improvement/RecursiveReasoner.js +133 -0
- package/dist/esm/agentic/improvement/ReflectionEngine.d.ts +25 -0
- package/dist/esm/agentic/improvement/ReflectionEngine.js +71 -0
- package/dist/esm/agentic/improvement/RitualOrchestrator.d.ts +28 -0
- package/dist/esm/agentic/improvement/RitualOrchestrator.js +148 -0
- package/dist/esm/agentic/improvement/RuleEngine.d.ts +56 -0
- package/dist/esm/agentic/improvement/RuleEngine.js +129 -0
- package/dist/esm/agentic/improvement/SelfEvolution.d.ts +50 -0
- package/dist/esm/agentic/improvement/SelfEvolution.js +248 -0
- package/dist/esm/agentic/improvement/SelfTestRegistry.d.ts +25 -0
- package/dist/esm/agentic/improvement/SelfTestRegistry.js +165 -0
- package/dist/esm/agentic/improvement/SovereignMetrics.d.ts +66 -0
- package/dist/esm/agentic/improvement/SovereignMetrics.js +125 -0
- package/dist/esm/agentic/improvement/StrategicPlanner.d.ts +71 -0
- package/dist/esm/agentic/improvement/StrategicPlanner.js +219 -0
- package/dist/esm/agentic/telemetry/CognitiveSynthesizer.d.ts +26 -0
- package/dist/esm/agentic/telemetry/CognitiveSynthesizer.js +161 -0
- package/dist/esm/agentic/telemetry/EventHarvester.d.ts +12 -0
- package/dist/esm/agentic/telemetry/EventHarvester.js +31 -0
- package/dist/esm/agentic/telemetry/ResearchAlchemist.d.ts +20 -0
- package/dist/esm/agentic/telemetry/ResearchAlchemist.js +45 -0
- package/dist/esm/agentic/telemetry/TelemetryOrchestrator.d.ts +21 -0
- package/dist/esm/agentic/telemetry/TelemetryOrchestrator.js +42 -0
- package/dist/esm/cache/cache-manager.d.ts +1 -1
- package/dist/esm/cache/cache-manager.js +16 -14
- package/dist/esm/cli/commands/analyze.js +46 -25
- package/dist/esm/cli/commands/generate.js +5 -2
- package/dist/esm/cli/commands/inspect.js +25 -8
- package/dist/esm/cli/commands/migrate.js +29 -121
- package/dist/esm/cli/commands/optimize.js +18 -4
- package/dist/esm/cli/commands/status.js +30 -10
- package/dist/esm/cli/commands/watch.js +109 -135
- package/dist/esm/dialect/database-introspector.d.ts +23 -2
- package/dist/esm/dialect/database-introspector.js +119 -37
- package/dist/esm/dialect/postgresql/postgresql-adapter.d.ts +81 -0
- package/dist/esm/dialect/postgresql/postgresql-adapter.js +37 -0
- package/dist/esm/dialect/postgresql/postgresql-dialect-config.d.ts +65 -0
- package/dist/esm/dialect/postgresql/postgresql-dialect-config.js +2 -0
- package/dist/esm/dialect/postgresql/postgresql-dialect.d.ts +80 -0
- package/dist/esm/dialect/postgresql/postgresql-dialect.js +73 -0
- package/dist/esm/dialect/postgresql/postgresql-driver.d.ts +51 -0
- package/dist/esm/dialect/postgresql/postgresql-driver.js +123 -0
- package/dist/esm/dialect/postgresql/postgresql-features.d.ts +377 -0
- package/dist/esm/dialect/postgresql/postgresql-features.js +457 -0
- package/dist/esm/dialect/postgresql/postgresql-introspector.d.ts +34 -0
- package/dist/esm/dialect/postgresql/postgresql-introspector.js +321 -0
- package/dist/esm/dialect/postgresql/postgresql-query-compiler.d.ts +11 -0
- package/dist/esm/dialect/postgresql/postgresql-query-compiler.js +36 -0
- package/dist/esm/dialect/sqlite/sqlite-driver.js +2 -3
- package/dist/esm/dialect/sqlite/sqlite-introspector.d.ts +10 -0
- package/dist/esm/dialect/sqlite/sqlite-introspector.js +36 -21
- package/dist/esm/edge-runtime/edge-config.d.ts +8 -2
- package/dist/esm/edge-runtime/edge-config.js +26 -29
- package/dist/esm/helpers/agent-schema.d.ts +19 -0
- package/dist/esm/helpers/agent-schema.js +289 -0
- package/dist/esm/helpers/postgresql.d.ts +96 -0
- package/dist/esm/helpers/postgresql.js +126 -0
- package/dist/esm/helpers/schema-evolution.d.ts +30 -0
- package/dist/esm/helpers/schema-evolution.js +119 -0
- package/dist/esm/index.d.ts +40 -2
- package/dist/esm/index.js +41 -1
- package/dist/esm/kysely.d.ts +1 -2
- package/dist/esm/kysely.js +1 -7
- package/dist/esm/logging/logger.js +25 -2
- package/dist/esm/migration/data_migrator.d.ts +40 -0
- package/dist/esm/migration/data_migrator.js +225 -0
- package/dist/esm/migration/database_migration_manager.d.ts +77 -0
- package/dist/esm/migration/database_migration_manager.js +379 -0
- package/dist/esm/migration/index.d.ts +19 -0
- package/dist/esm/migration/index.js +21 -0
- package/dist/esm/migration/migration-types.d.ts +157 -0
- package/dist/esm/migration/migration-types.js +5 -0
- package/dist/esm/migration/schema_differ.d.ts +24 -0
- package/dist/esm/migration/schema_differ.js +319 -0
- package/dist/esm/migration/schema_introspector.d.ts +13 -0
- package/dist/esm/migration/schema_introspector.js +361 -0
- package/dist/esm/migration/type_mapper.d.ts +23 -0
- package/dist/esm/migration/type_mapper.js +258 -0
- package/dist/esm/noormme.d.ts +29 -0
- package/dist/esm/noormme.js +98 -3
- package/dist/esm/operation-node/add-index-node.d.ts +2 -1
- package/dist/esm/operation-node/create-index-node.d.ts +2 -2
- package/dist/esm/operation-node/data-type-node.d.ts +1 -1
- package/dist/esm/operation-node/data-type-node.js +26 -0
- package/dist/esm/operation-node/delete-query-node.d.ts +0 -9
- package/dist/esm/operation-node/delete-query-node.js +0 -11
- package/dist/esm/operation-node/index-type-node.d.ts +13 -0
- package/dist/esm/operation-node/index-type-node.js +16 -0
- package/dist/esm/operation-node/insert-query-node.d.ts +0 -2
- package/dist/esm/operation-node/operation-node-transformer.d.ts +2 -0
- package/dist/esm/operation-node/operation-node-transformer.js +5 -1
- package/dist/esm/operation-node/operation-node-visitor.d.ts +2 -0
- package/dist/esm/operation-node/operation-node-visitor.js +1 -0
- package/dist/esm/operation-node/operation-node.d.ts +1 -1
- package/dist/esm/operation-node/select-query-node.d.ts +0 -9
- package/dist/esm/operation-node/select-query-node.js +0 -11
- package/dist/esm/parser/join-parser.js +1 -1
- package/dist/esm/parser/order-by-parser.d.ts +1 -14
- package/dist/esm/parser/order-by-parser.js +0 -12
- package/dist/esm/performance/query-optimizer.d.ts +1 -1
- package/dist/esm/performance/query-optimizer.js +5 -9
- package/dist/esm/performance/services/metrics-collector.d.ts +11 -2
- package/dist/esm/performance/services/metrics-collector.js +56 -3
- package/dist/esm/query-builder/aggregate-function-builder.d.ts +1 -25
- package/dist/esm/query-builder/delete-query-builder.d.ts +115 -17
- package/dist/esm/query-builder/order-by-interface.d.ts +1 -14
- package/dist/esm/query-builder/over-builder.d.ts +1 -14
- package/dist/esm/query-builder/select-query-builder.d.ts +1 -13
- package/dist/esm/query-builder/update-query-builder.d.ts +2 -17
- package/dist/esm/query-compiler/default-query-compiler.d.ts +2 -0
- package/dist/esm/query-compiler/default-query-compiler.js +3 -6
- package/dist/esm/relationships/relationship-engine.js +2 -2
- package/dist/esm/repository/repository-factory.d.ts +11 -7
- package/dist/esm/repository/repository-factory.js +203 -212
- package/dist/esm/schema/builders/alter-table-add-index-builder.d.ts +1 -1
- package/dist/esm/schema/builders/alter-table-add-index-builder.js +2 -2
- package/dist/esm/schema/builders/create-index-builder.d.ts +3 -2
- package/dist/esm/schema/builders/create-index-builder.js +5 -3
- package/dist/esm/schema/core/discovery/relationship-discovery.js +45 -6
- package/dist/esm/schema/core/discovery/table-metadata-discovery.js +11 -7
- package/dist/esm/schema/core/discovery/view-discovery.js +14 -15
- package/dist/esm/schema/core/factories/discovery-factory.d.ts +5 -8
- package/dist/esm/schema/core/factories/discovery-factory.js +23 -1
- package/dist/esm/schema/core/utils/type-mapper.js +21 -0
- package/dist/esm/schema/dialects/postgresql/postgresql-discovery.coordinator.d.ts +44 -0
- package/dist/esm/schema/dialects/postgresql/postgresql-discovery.coordinator.js +113 -0
- package/dist/esm/schema/dialects/sqlite/sqlite-discovery.coordinator.js +38 -10
- package/dist/esm/schema/test/discovery-factory.test.js +1 -1
- package/dist/esm/schema/test/error-handling.test.js +1 -1
- package/dist/esm/schema/test/integration.test.js +4 -2
- package/dist/esm/schema/test/sqlite-discovery-coordinator.test.js +12 -4
- package/dist/esm/sqlite-migration/sqlite-migration-manager.d.ts +18 -1
- package/dist/esm/sqlite-migration/sqlite-migration-manager.js +75 -34
- package/dist/esm/sqlite-migration/sqlite-migration-provider.d.ts +0 -6
- package/dist/esm/sqlite-migration/sqlite-migration-provider.js +39 -70
- package/dist/esm/types/index.d.ts +253 -1
- package/dist/esm/types/type-generator.d.ts +0 -4
- package/dist/esm/types/type-generator.js +15 -57
- package/dist/esm/util/similarity.d.ts +12 -0
- package/dist/esm/util/similarity.js +66 -0
- package/dist/esm/watch/schema-watcher.d.ts +2 -0
- package/dist/esm/watch/schema-watcher.js +95 -19
- package/package.json +20 -20
package/README.md
CHANGED
|
@@ -1,344 +1,109 @@
|
|
|
1
|
-
# NOORMME
|
|
1
|
+
# NOORMME: The Agentic Data Engine
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/noormme)
|
|
5
|
-
[](https://opensource.org/licenses/Apache-2.0)
|
|
6
|
-
[](https://www.typescriptlang.org/)
|
|
7
|
-
[](https://nodejs.org/)
|
|
3
|
+
**NOORMME** is a sovereign persistence layer and cognitive operating system designed for **Autonomous AI Agents**. It transcends legacy ORM patterns by providing a self-healing, evolutionary data infrastructure that functions as an extension of the agent's internal reasoning loop.
|
|
8
4
|
|
|
9
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/noormme)
|
|
6
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
7
|
+
[](#-autonomous-governance)
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
**The Mission**: Make AI-assisted development so easy, even your grandma could build a startup (if she wanted to).
|
|
14
|
-
|
|
15
|
-
## 🤔 Why Should You Care? (Spoiler: You Should)
|
|
16
|
-
|
|
17
|
-
### **The Problem (AKA Why You're Reading This):**
|
|
18
|
-
You're probably here because:
|
|
19
|
-
- Setting up databases makes you want to throw your laptop out the window
|
|
20
|
-
- You've spent more time configuring ORMs than actually coding
|
|
21
|
-
- AI tools keep suggesting code that doesn't work with your setup
|
|
22
|
-
- You're tired of feeling like you need a computer science degree to build a simple app
|
|
23
|
-
- Your project structure looks like a tornado hit a code factory
|
|
24
|
-
|
|
25
|
-
### **The NOORMME Solution (AKA Your New Best Friend):**
|
|
26
|
-
We fixed all that nonsense:
|
|
27
|
-
- **Zero-config database** - Point, click, done (well, almost)
|
|
28
|
-
- **AI that actually helps** - No more "helpful" suggestions that break everything
|
|
29
|
-
- **Organized by default** - Your code will look like a senior dev wrote it
|
|
30
|
-
- **Minimal setup** - From "I have an idea" to "I have an app" in 5 minutes
|
|
31
|
-
- **No vendor lock-in** - You're not trapped in framework jail
|
|
32
|
-
|
|
33
|
-
### **Real Benefits (The Stuff That Actually Matters):**
|
|
34
|
-
- 🚀 **Feel like a coding wizard** - AI that understands your project
|
|
35
|
-
- 💰 **Save money** - No expensive database servers to maintain
|
|
36
|
-
- 🔧 **Deploy easily** - One file instead of a server farm
|
|
37
|
-
- ⚡ **Go fast** - Direct file access beats network calls every time
|
|
38
|
-
- 🛡️ **Stay secure** - No network = no network attacks
|
|
39
|
-
- 😊 **Have fun** - Finally, coding that doesn't make you cry
|
|
40
|
-
|
|
41
|
-
**Bottom line:** You get enterprise-grade superpowers with the simplicity of a single file.
|
|
42
|
-
|
|
43
|
-
## 🚀 What's the Big Deal? (Spoiler: It's Actually Pretty Big)
|
|
44
|
-
|
|
45
|
-
**Before NOORMME:** You spend 8 hours setting up a database, 4 hours organizing your project, and 2 hours fighting with AI tools that suggest code from 2019.
|
|
46
|
-
|
|
47
|
-
**With NOORMME:** Your development environment becomes AI-ready in 5 minutes:
|
|
48
|
-
- ✅ **SQLite that acts like PostgreSQL** - All the power, none of the pain
|
|
49
|
-
- ✅ **Organized architecture** - Patterns that actually make sense
|
|
50
|
-
- ✅ **AI context rules** - Cursor IDE integration that works
|
|
51
|
-
- ✅ **Type safety** - TypeScript that doesn't make you want to throw things
|
|
52
|
-
- ✅ **Production features** - WAL mode, caching, and performance optimization
|
|
53
|
-
|
|
54
|
-
**It's literally a development environment that makes AI assistance useful.** 🤯
|
|
55
|
-
|
|
56
|
-
## ⚡ Get Started in 60 Seconds (No, Really)
|
|
57
|
-
|
|
58
|
-
### 1. Install It (The Easy Part)
|
|
59
|
-
```bash
|
|
60
|
-
npm install noormme
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### 2. Initialize Your Project (The Even Easier Part)
|
|
64
|
-
```bash
|
|
65
|
-
npx noormme init
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
### 3. Point at Your Database (The "Wait, That's It?" Part)
|
|
69
|
-
```typescript
|
|
70
|
-
import { NOORMME } from 'noormme'
|
|
71
|
-
|
|
72
|
-
const db = new NOORMME({
|
|
73
|
-
dialect: 'sqlite',
|
|
74
|
-
connection: {
|
|
75
|
-
database: './your-database.sqlite' // Point to your existing database
|
|
76
|
-
}
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
await db.initialize()
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
### 4. Start Building with AI Assistance (The "I'm a Genius Now" Part)
|
|
83
|
-
```typescript
|
|
84
|
-
// NOORMME automatically finds your 'users' table and creates methods
|
|
85
|
-
const userRepo = db.getRepository('users')
|
|
86
|
-
|
|
87
|
-
// These methods are automatically available based on your table columns:
|
|
88
|
-
const users = await userRepo.findAll()
|
|
89
|
-
const user = await userRepo.findByEmail('john@example.com')
|
|
90
|
-
const activeUsers = await userRepo.findManyByStatus('active')
|
|
91
|
-
|
|
92
|
-
// Full CRUD with type safety (because we're not animals)
|
|
93
|
-
const newUser = await userRepo.create({
|
|
94
|
-
name: 'Jane Doe',
|
|
95
|
-
email: 'jane@example.com'
|
|
96
|
-
})
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
**That's it!** Your development environment is now AI-ready and organized. 🎉
|
|
100
|
-
|
|
101
|
-
## 🎯 What NOORMME Does For You (The Magic Behind the Curtain)
|
|
102
|
-
|
|
103
|
-
### 🔍 **Database Automation (AKA "How Did It Know That?")**
|
|
104
|
-
NOORMME looks at your SQLite database and goes "Oh, I see what you're trying to do here":
|
|
105
|
-
- **Auto-discovery** - Finds tables, columns, and relationships (like a detective, but for databases)
|
|
106
|
-
- **Type generation** - Creates TypeScript interfaces (because guessing types is for amateurs)
|
|
107
|
-
- **Performance optimization** - WAL mode, caching, and index recommendations (because slow is the enemy)
|
|
108
|
-
- **Health monitoring** - Real-time performance tracking (because knowing is half the battle)
|
|
109
|
-
|
|
110
|
-
### 🏗️ **Organized Architecture (AKA "Finally, Code That Makes Sense")**
|
|
111
|
-
NOORMME applies patterns from frameworks that actually work:
|
|
112
|
-
- **Django-style structure** - Organized folders and clear separation (because chaos is not a feature)
|
|
113
|
-
- **Laravel-style services** - Service classes and repository patterns (because organization is beautiful)
|
|
114
|
-
- **Rails-style conventions** - Naming conventions and file organization (because consistency is key)
|
|
115
|
-
- **Next.js patterns** - App Router, Server Components, and modern React patterns (because we live in 2025)
|
|
116
|
-
|
|
117
|
-
### 🤖 **AI-Ready Development (AKA "Finally, AI That Actually Helps")**
|
|
118
|
-
NOORMME makes AI assistance useful (revolutionary, we know):
|
|
119
|
-
- **Cursor IDE integration** - Context rules that AI tools understand (because context matters)
|
|
120
|
-
- **Consistent patterns** - AI generates code that follows your conventions (because consistency is everything)
|
|
121
|
-
- **Type safety** - AI suggestions are always type-safe (because runtime errors are for the weak)
|
|
122
|
-
- **Documentation** - AI understands your project structure (because understanding is power)
|
|
123
|
-
|
|
124
|
-
### ⚡ **Performance Optimization (AKA "Speed Is Life")**
|
|
125
|
-
NOORMME automatically makes everything faster:
|
|
126
|
-
- **WAL mode** - Concurrent read/write operations (because waiting is for losers)
|
|
127
|
-
- **Intelligent caching** - Cache frequently accessed data (because memory is cheap, time is not)
|
|
128
|
-
- **Query optimization** - Automatic index recommendations (because slow queries are the enemy)
|
|
129
|
-
- **Real-time monitoring** - Performance metrics and health checks (because ignorance is not bliss)
|
|
130
|
-
|
|
131
|
-
## 🔥 WAL Mode: Why This Changes Everything (The Technical Stuff Made Simple)
|
|
132
|
-
|
|
133
|
-
**The Problem:** Most SQLite databases are slow and lock up when multiple people try to use them. It's like having a single-lane road for a busy intersection during rush hour.
|
|
134
|
-
|
|
135
|
-
**The NOORMME Solution:** WAL Mode (Write-Ahead Logging) turns your SQLite file into a multi-lane highway with express lanes.
|
|
136
|
-
|
|
137
|
-
### **What WAL Mode Actually Does (In Plain English):**
|
|
9
|
+
---
|
|
138
10
|
|
|
139
|
-
|
|
140
|
-
- When someone writes to the database, EVERYONE has to wait
|
|
141
|
-
- Reading data blocks writing data (and vice versa)
|
|
142
|
-
- Your app freezes when multiple users try to do things at once
|
|
143
|
-
- It's like having one checkout lane at Walmart on Black Friday
|
|
11
|
+
## 🏗 The Agentic Data Loop
|
|
144
12
|
|
|
145
|
-
|
|
146
|
-
- ✅ **Multiple readers can access data simultaneously** - No more waiting in line
|
|
147
|
-
- ✅ **Writers don't block readers** - Updates happen in the background
|
|
148
|
-
- ✅ **3x faster write operations** - Append-only logging is lightning fast
|
|
149
|
-
- ✅ **Better crash recovery** - Your data is safer than Fort Knox
|
|
150
|
-
- ✅ **Real production performance** - Handles thousands of concurrent users
|
|
13
|
+
NOORMME implements a closed-loop system where data is not merely "stored" but continuously distilled, questioned, and evolved.
|
|
151
14
|
|
|
152
|
-
###
|
|
153
|
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
157
|
-
- Provides enterprise-level reliability in a simple SQLite file
|
|
15
|
+
### 🧠 Cognitive Orchestration
|
|
16
|
+
- **Strategic Planner**: Proactively suggests and applies persona mutations (roles, policies, capabilities) based on real-time success/latency telemetry.
|
|
17
|
+
- **Knowledge Distiller**: Extracts structured entities and facts from raw history using Jaccard similarity-based consolidation and confidence gradients.
|
|
18
|
+
- **Curiosity Engine**: Identifies "Knowledge Gaps" and "Factual Contradictions," generating research hypotheses and active questions for the agent to resolve.
|
|
19
|
+
- **Ablation Labs**: Conducts "Zombie Pruning" and "Impact Tests"—temporarily disabling knowledge to evaluate its necessity in the reasoning path.
|
|
158
20
|
|
|
159
|
-
|
|
160
|
-
Instead of one database file, WAL Mode creates three files:
|
|
161
|
-
- `your-database.db` - Your actual data (the main file)
|
|
162
|
-
- `your-database.db-wal` - Pending changes (like a shopping cart)
|
|
163
|
-
- `your-database.db-shm` - Coordination between processes (like traffic lights)
|
|
21
|
+
---
|
|
164
22
|
|
|
165
|
-
|
|
23
|
+
## 💎 Technical Moats
|
|
166
24
|
|
|
167
|
-
###
|
|
168
|
-
|
|
169
|
-
-
|
|
170
|
-
-
|
|
171
|
-
-
|
|
172
|
-
- 🛡️ **More reliable** - Your data is safer with better crash recovery
|
|
25
|
+
### 🧬 Evolutionary Infrastructure & "DNA Inversion"
|
|
26
|
+
NOORMME allows agents to autonomously mutate their own schema.
|
|
27
|
+
- **Dynamic DDL**: Agents can propose `CREATE TABLE`, `ADD COLUMN`, or `CREATE INDEX` mutations via the **Evolutionary Pilot**.
|
|
28
|
+
- **Structural Rollback**: The **DNA Inverter** automatically generates inverse SQL for any DDL mutation (e.g., inverting an `ADD COLUMN` to a `DROP COLUMN`) to ensure safe structural experimentation.
|
|
29
|
+
- **Real-Time Type Synthesis**: TypeScript interfaces and types are regenerated and written to disk the moment a structural change is committed.
|
|
173
30
|
|
|
174
|
-
|
|
31
|
+
### 🚥 Autonomous Governance (Logic Probes)
|
|
32
|
+
The **Self-Test Registry** enables agents to maintain their own integrity through automated "probes":
|
|
33
|
+
- **Integrity Audits**: Detects orphaned records and semantic memory failures.
|
|
34
|
+
- **Performance Drift**: Detects when autonomous schema changes cause query latency to drift more than 50% from a rolling 100-query baseline.
|
|
35
|
+
- **Consistency Probes**: Verifies that new knowledge doesn't contradict established "Hive" facts.
|
|
175
36
|
|
|
176
|
-
|
|
37
|
+
### 📊 Deep Behavioral Telemetry
|
|
38
|
+
A three-layered telemetry stack for research and production observation:
|
|
39
|
+
1. **Raw Event Harvester**: High-fidelity capture of every interaction, pivot, and failure.
|
|
40
|
+
2. **Cognitive Synthesizer**: Serializes the strategic "Evolution Path" and calculates dynamic **Autonomy Levels**.
|
|
41
|
+
3. **Research Alchemist**: Transmutes events into high-order metrics like **Time-to-Magic**, **Discovery Index**, and **Trust Signals**.
|
|
177
42
|
|
|
178
|
-
|
|
43
|
+
---
|
|
179
44
|
|
|
180
|
-
|
|
181
|
-
```bash
|
|
182
|
-
# See what's slow and get recommendations
|
|
183
|
-
npx noormme analyze --database ./app.sqlite
|
|
184
|
-
```
|
|
45
|
+
## ⚡ Performance Engineering
|
|
185
46
|
|
|
186
|
-
###
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
```
|
|
47
|
+
### Query Intelligence
|
|
48
|
+
- **N+1 Detection**: Real-time pattern analysis to identify and warn about inefficient recursive queries.
|
|
49
|
+
- **Semantic Caching**: Context-aware result caching that understands query patterns rather than just raw SQL.
|
|
50
|
+
- **Dialect Optimization**: Native WAL-mode management for SQLite and optimized JSONB/Vector operations for PostgreSQL.
|
|
191
51
|
|
|
192
|
-
###
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
npx noormme watch --auto-optimize
|
|
196
|
-
```
|
|
52
|
+
### High-Fidelity Infrastructure
|
|
53
|
+
- **Unified Vector Abstraction**: Seamless semantic search across `PGVector`, `SQLite-vss`, and a optimized **Manual Cosine Fallback**.
|
|
54
|
+
- **Ritual Orchestration**: Automated background "rituals" for semantic compression, stale history pruning, and database vacuuming.
|
|
197
55
|
|
|
198
|
-
|
|
199
|
-
```bash
|
|
200
|
-
# Create organized Next.js project with NOORMME
|
|
201
|
-
npx noormme create --template nextjs --name my-app
|
|
202
|
-
```
|
|
56
|
+
---
|
|
203
57
|
|
|
204
|
-
##
|
|
58
|
+
## 🚀 Implementation
|
|
205
59
|
|
|
206
|
-
###
|
|
60
|
+
### Initializing the Mind
|
|
207
61
|
```typescript
|
|
208
|
-
|
|
209
|
-
dialect: 'sqlite',
|
|
210
|
-
connection: { database: './blog.sqlite' }
|
|
211
|
-
})
|
|
212
|
-
|
|
213
|
-
await db.initialize()
|
|
214
|
-
|
|
215
|
-
// Auto-generated repositories (because we're not writing boilerplate)
|
|
216
|
-
const postRepo = db.getRepository('posts')
|
|
217
|
-
const userRepo = db.getRepository('users')
|
|
62
|
+
import { NOORMME } from 'noormme';
|
|
218
63
|
|
|
219
|
-
// Smart methods based on your schema (because we're smart like that)
|
|
220
|
-
const recentPosts = await postRepo.findManyByPublished(true)
|
|
221
|
-
const adminUsers = await userRepo.findManyByRole('admin')
|
|
222
|
-
|
|
223
|
-
// Complex queries with full type safety (because we're not animals)
|
|
224
|
-
const postWithAuthor = await db.getKysely()
|
|
225
|
-
.selectFrom('posts')
|
|
226
|
-
.innerJoin('users', 'users.id', 'posts.author_id')
|
|
227
|
-
.select(['posts.title', 'users.name as author'])
|
|
228
|
-
.where('posts.published', '=', true)
|
|
229
|
-
.execute()
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### E-commerce App with Organized Architecture (The "I Want to Make Money" Example)
|
|
233
|
-
```typescript
|
|
234
|
-
// Point at your existing e-commerce database
|
|
235
64
|
const db = new NOORMME({
|
|
236
65
|
dialect: 'sqlite',
|
|
237
|
-
connection: { database: './
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
const orderRepo = db.getRepository('orders')
|
|
66
|
+
connection: { database: './mind.sqlite' },
|
|
67
|
+
agentic: {
|
|
68
|
+
enableSelfEvolution: true,
|
|
69
|
+
enableSelfHealing: true
|
|
70
|
+
}
|
|
71
|
+
});
|
|
244
72
|
|
|
245
|
-
//
|
|
246
|
-
|
|
247
|
-
const pendingOrders = await orderRepo.findManyByStatus('pending')
|
|
73
|
+
// Provisions 20+ tables for goals, knowledge, episodes, and logic probes
|
|
74
|
+
await db.initialize();
|
|
248
75
|
```
|
|
249
76
|
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
For most people, the default settings work perfectly. But if you want to customize (because you're a special snowflake):
|
|
253
|
-
|
|
77
|
+
### Strategic Interaction
|
|
254
78
|
```typescript
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
connection: {
|
|
258
|
-
database: './app.sqlite'
|
|
259
|
-
},
|
|
260
|
-
automation: {
|
|
261
|
-
enableAutoOptimization: true, // Make it fast automatically
|
|
262
|
-
enableIndexRecommendations: true, // Suggest better indexes
|
|
263
|
-
enableQueryAnalysis: true, // Find slow queries
|
|
264
|
-
},
|
|
265
|
-
performance: {
|
|
266
|
-
enableCaching: true, // Cache results for speed
|
|
267
|
-
maxCacheSize: 1000 // How much to cache
|
|
268
|
-
}
|
|
269
|
-
})
|
|
270
|
-
```
|
|
271
|
-
|
|
272
|
-
## 🚀 Production Ready (Because We're Not Playing Around)
|
|
273
|
-
|
|
274
|
-
NOORMME is already running in production applications with real-world success stories. It includes:
|
|
275
|
-
|
|
276
|
-
- **Health monitoring** - Know when something's wrong (because ignorance is not bliss)
|
|
277
|
-
- **Performance metrics** - See how fast your queries are (because speed is life)
|
|
278
|
-
- **Security features** - Protection against common attacks (because security matters)
|
|
279
|
-
- **Migration support** - Move from PostgreSQL to SQLite easily (because change is good)
|
|
280
|
-
- **Backup strategies** - Your data is safe (because data loss is not fun)
|
|
281
|
-
- **WAL Mode implementation** - Proven in production at DreamBeesArt with enterprise-level performance
|
|
282
|
-
|
|
283
|
-
### **Real Production Success (Because We Don't Make Stuff Up):**
|
|
284
|
-
The DreamBeesArt application successfully migrated from Drizzle ORM to NOORMME with WAL Mode, achieving:
|
|
285
|
-
- **Better concurrent access** - Multiple users can create/edit content simultaneously
|
|
286
|
-
- **Improved write performance** - 3x faster operations with append-only logging
|
|
287
|
-
- **Enhanced reliability** - Better crash recovery and data integrity
|
|
288
|
-
- **Reduced complexity** - From complex database server setup to a single SQLite file
|
|
289
|
-
- **Lower costs** - No database hosting fees while maintaining enterprise performance
|
|
290
|
-
|
|
291
|
-
## ❓ FAQ for Normies (The Questions You're Too Afraid to Ask)
|
|
292
|
-
|
|
293
|
-
**Q: Do I need to learn SQL?**
|
|
294
|
-
A: Nope! NOORMME handles most things automatically. You only need SQL for complex queries (and even then, we'll help you).
|
|
295
|
-
|
|
296
|
-
**Q: Can I use my existing database?**
|
|
297
|
-
A: Yes! Just point NOORMME at your existing SQLite file and it figures everything out (because we're not picky).
|
|
79
|
+
// Access the higher-order cognitive facade
|
|
80
|
+
const cortex = db.agent.cortex;
|
|
298
81
|
|
|
299
|
-
|
|
300
|
-
|
|
82
|
+
// Execute a background knowledge distillation ritual
|
|
83
|
+
await cortex.rituals.runPendingRituals();
|
|
301
84
|
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
**Q: Do I need TypeScript?**
|
|
306
|
-
A: NOORMME works with JavaScript too, but TypeScript gives you the best experience (because types are your friends).
|
|
307
|
-
|
|
308
|
-
**Q: How does this work with AI tools like Cursor?**
|
|
309
|
-
A: NOORMME includes Cursor IDE context rules that make AI assistance actually useful. The AI understands your project structure and generates code that follows your conventions (because we're not savages).
|
|
310
|
-
|
|
311
|
-
**Q: What makes this different from other toolkits?**
|
|
312
|
-
A: NOORMME combines database automation, organized architecture, and AI-ready patterns in one integrated toolkit. It's not just an ORM - it's a complete development environment (because we're ambitious).
|
|
313
|
-
|
|
314
|
-
**Q: Will this make me a better developer?**
|
|
315
|
-
A: Probably not, but it will make you feel like one (which is half the battle).
|
|
316
|
-
|
|
317
|
-
## 🤝 Contributing (Because We're Not Perfect)
|
|
318
|
-
|
|
319
|
-
Found a bug? Have an idea? We'd love your help! (Because we're not too proud to ask for help)
|
|
320
|
-
|
|
321
|
-
```bash
|
|
322
|
-
git clone https://github.com/cardsorting/noormme.git
|
|
323
|
-
cd noormme
|
|
324
|
-
npm install
|
|
325
|
-
npm test
|
|
85
|
+
// Challenge existing knowledge with new evidence
|
|
86
|
+
await cortex.knowledge.challengeKnowledge('SystemArchitecture', 'New facts contradict old.', 0.95);
|
|
326
87
|
```
|
|
327
88
|
|
|
328
|
-
|
|
89
|
+
---
|
|
329
90
|
|
|
330
|
-
|
|
91
|
+
## 🗄 Dialect Matrix
|
|
331
92
|
|
|
332
|
-
|
|
93
|
+
| Feature | SQLite (Edge) | PostgreSQL (Enterprise) |
|
|
94
|
+
| :--- | :--- | :--- |
|
|
95
|
+
| **Search** | `sqlite-vss` / Fallback | `pgvector` |
|
|
96
|
+
| **Persistence** | WAL Mode | Native Pooling / SSL |
|
|
97
|
+
| **Evolution** | DNA Inversion | Structural Migrations |
|
|
98
|
+
| **Reliability** | Local Atomicity | Multi-Tenant Isolation |
|
|
333
99
|
|
|
334
|
-
|
|
100
|
+
---
|
|
335
101
|
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
```
|
|
102
|
+
## 🤝 Community & Contribution
|
|
103
|
+
NOORMME is an Apache 2.0 open-source project. We invite AI researchers and data engineers to contribute to the future of autonomous persistence.
|
|
339
104
|
|
|
340
|
-
|
|
105
|
+
[Contribution Guide](CONTRIBUTING.md) | [Security Audit](SECURITY.md)
|
|
341
106
|
|
|
342
107
|
---
|
|
343
108
|
|
|
344
|
-
*
|
|
109
|
+
*Transforming passive records into sovereign intelligence.*
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Kysely } from '../kysely.js';
|
|
2
|
+
import type { AgenticConfig, AgentAction } from '../types/index.js';
|
|
3
|
+
import type { TelemetryOrchestrator } from './telemetry/TelemetryOrchestrator.js';
|
|
4
|
+
export interface ActionTable {
|
|
5
|
+
id: number | string;
|
|
6
|
+
session_id: number | string;
|
|
7
|
+
message_id: number | string | null;
|
|
8
|
+
tool_name: string;
|
|
9
|
+
arguments: string;
|
|
10
|
+
outcome: string | null;
|
|
11
|
+
status: 'success' | 'failure' | 'pending';
|
|
12
|
+
duration_ms: number | null;
|
|
13
|
+
metadata: string | null;
|
|
14
|
+
created_at: string | Date;
|
|
15
|
+
}
|
|
16
|
+
export interface ActionDatabase {
|
|
17
|
+
agent_actions: ActionTable;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* ActionJournal records tool usage and outcomes to help agents learn
|
|
21
|
+
* from their past actions.
|
|
22
|
+
*/
|
|
23
|
+
export declare class ActionJournal {
|
|
24
|
+
private db;
|
|
25
|
+
private config;
|
|
26
|
+
private telemetry?;
|
|
27
|
+
private actionsTable;
|
|
28
|
+
constructor(db: Kysely<any>, config?: AgenticConfig, telemetry?: TelemetryOrchestrator | undefined);
|
|
29
|
+
private get typedDb();
|
|
30
|
+
/**
|
|
31
|
+
* Log an action (tool call)
|
|
32
|
+
*/
|
|
33
|
+
logAction(sessionId: string | number, toolName: string, args: Record<string, any>, messageId?: string | number): Promise<AgentAction>;
|
|
34
|
+
/**
|
|
35
|
+
* Update action with outcome
|
|
36
|
+
*/
|
|
37
|
+
recordOutcome(actionId: string | number, status: AgentAction['status'], outcome: string, durationMs?: number, metadata?: Record<string, any>): Promise<AgentAction>;
|
|
38
|
+
/**
|
|
39
|
+
* Get actions for a session
|
|
40
|
+
*/
|
|
41
|
+
getSessionActions(sessionId: string | number): Promise<AgentAction[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Get actions by tool name across all sessions.
|
|
44
|
+
*/
|
|
45
|
+
getActionsByTool(toolName: string, limit?: number): Promise<AgentAction[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Generate a report of tool failures.
|
|
48
|
+
*/
|
|
49
|
+
getFailureReport(): Promise<{
|
|
50
|
+
toolName: string;
|
|
51
|
+
failureCount: number;
|
|
52
|
+
lastFailure: string;
|
|
53
|
+
}[]>;
|
|
54
|
+
private parseAction;
|
|
55
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionJournal = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* ActionJournal records tool usage and outcomes to help agents learn
|
|
6
|
+
* from their past actions.
|
|
7
|
+
*/
|
|
8
|
+
class ActionJournal {
|
|
9
|
+
db;
|
|
10
|
+
config;
|
|
11
|
+
telemetry;
|
|
12
|
+
actionsTable;
|
|
13
|
+
constructor(db, config = {}, telemetry) {
|
|
14
|
+
this.db = db;
|
|
15
|
+
this.config = config;
|
|
16
|
+
this.telemetry = telemetry;
|
|
17
|
+
this.actionsTable = config.actionsTable || 'agent_actions';
|
|
18
|
+
}
|
|
19
|
+
get typedDb() {
|
|
20
|
+
return this.db;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Log an action (tool call)
|
|
24
|
+
*/
|
|
25
|
+
async logAction(sessionId, toolName, args, messageId) {
|
|
26
|
+
const action = await this.typedDb
|
|
27
|
+
.insertInto(this.actionsTable)
|
|
28
|
+
.values({
|
|
29
|
+
session_id: sessionId,
|
|
30
|
+
message_id: messageId || null,
|
|
31
|
+
tool_name: toolName,
|
|
32
|
+
arguments: JSON.stringify(args),
|
|
33
|
+
status: 'pending',
|
|
34
|
+
created_at: new Date()
|
|
35
|
+
})
|
|
36
|
+
.returningAll()
|
|
37
|
+
.executeTakeFirstOrThrow();
|
|
38
|
+
const parsed = this.parseAction(action);
|
|
39
|
+
// Telemetry: Track action start
|
|
40
|
+
if (this.telemetry) {
|
|
41
|
+
await this.telemetry.track(sessionId, 'action', `Tool call: ${toolName}`, { actionId: action.id, arguments: args });
|
|
42
|
+
}
|
|
43
|
+
return parsed;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Update action with outcome
|
|
47
|
+
*/
|
|
48
|
+
async recordOutcome(actionId, status, outcome, durationMs, metadata) {
|
|
49
|
+
const action = await this.typedDb
|
|
50
|
+
.updateTable(this.actionsTable)
|
|
51
|
+
.set({
|
|
52
|
+
status,
|
|
53
|
+
outcome,
|
|
54
|
+
duration_ms: durationMs || null,
|
|
55
|
+
metadata: metadata ? JSON.stringify(metadata) : null
|
|
56
|
+
})
|
|
57
|
+
.where('id', '=', actionId)
|
|
58
|
+
.returningAll()
|
|
59
|
+
.executeTakeFirstOrThrow();
|
|
60
|
+
const parsed = this.parseAction(action);
|
|
61
|
+
// Telemetry: Track outcome and failures
|
|
62
|
+
if (this.telemetry) {
|
|
63
|
+
if (status === 'failure') {
|
|
64
|
+
await this.telemetry.track(parsed.sessionId, 'error', `Action failed: ${outcome}`, { actionId, status });
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return parsed;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get actions for a session
|
|
71
|
+
*/
|
|
72
|
+
async getSessionActions(sessionId) {
|
|
73
|
+
const actions = await this.typedDb
|
|
74
|
+
.selectFrom(this.actionsTable)
|
|
75
|
+
.selectAll()
|
|
76
|
+
.where('session_id', '=', sessionId)
|
|
77
|
+
.orderBy('created_at', 'asc')
|
|
78
|
+
.execute();
|
|
79
|
+
return actions.map(a => this.parseAction(a));
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get actions by tool name across all sessions.
|
|
83
|
+
*/
|
|
84
|
+
async getActionsByTool(toolName, limit = 50) {
|
|
85
|
+
const actions = await this.typedDb
|
|
86
|
+
.selectFrom(this.actionsTable)
|
|
87
|
+
.selectAll()
|
|
88
|
+
.where('tool_name', '=', toolName)
|
|
89
|
+
.orderBy('created_at', 'desc')
|
|
90
|
+
.limit(limit)
|
|
91
|
+
.execute();
|
|
92
|
+
return actions.map(a => this.parseAction(a));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Generate a report of tool failures.
|
|
96
|
+
*/
|
|
97
|
+
async getFailureReport() {
|
|
98
|
+
const results = await this.typedDb
|
|
99
|
+
.selectFrom(this.actionsTable)
|
|
100
|
+
.select([
|
|
101
|
+
'tool_name',
|
|
102
|
+
(eb) => eb.fn.count('id').as('failureCount'),
|
|
103
|
+
(eb) => eb.fn.max('created_at').as('lastFailure')
|
|
104
|
+
])
|
|
105
|
+
.where('status', '=', 'failure')
|
|
106
|
+
.groupBy('tool_name')
|
|
107
|
+
.orderBy((eb) => eb.fn.count('id'), 'desc')
|
|
108
|
+
.execute();
|
|
109
|
+
return results.map((r) => ({
|
|
110
|
+
toolName: r.tool_name,
|
|
111
|
+
failureCount: Number(r.failureCount),
|
|
112
|
+
lastFailure: r.lastFailure
|
|
113
|
+
}));
|
|
114
|
+
}
|
|
115
|
+
parseAction(action) {
|
|
116
|
+
return {
|
|
117
|
+
id: action.id,
|
|
118
|
+
sessionId: action.session_id,
|
|
119
|
+
messageId: action.message_id,
|
|
120
|
+
toolName: action.tool_name,
|
|
121
|
+
arguments: typeof action.arguments === 'string' ? JSON.parse(action.arguments) : (action.arguments || {}),
|
|
122
|
+
status: action.status,
|
|
123
|
+
outcome: action.outcome,
|
|
124
|
+
durationMs: action.duration_ms,
|
|
125
|
+
metadata: typeof action.metadata === 'string' ? JSON.parse(action.metadata) : (action.metadata || {}),
|
|
126
|
+
createdAt: new Date(action.created_at)
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
exports.ActionJournal = ActionJournal;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Kysely } from '../kysely.js';
|
|
2
|
+
import type { AgenticConfig, AgentCapability } from '../types/index.js';
|
|
3
|
+
export interface CapabilityTable {
|
|
4
|
+
id: number | string;
|
|
5
|
+
name: string;
|
|
6
|
+
version: string;
|
|
7
|
+
description: string | null;
|
|
8
|
+
reliability: number;
|
|
9
|
+
metadata: string | null;
|
|
10
|
+
created_at: string | Date;
|
|
11
|
+
updated_at: string | Date;
|
|
12
|
+
}
|
|
13
|
+
export interface CapabilityDatabase {
|
|
14
|
+
agent_capabilities: CapabilityTable;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* CapabilityManager tracks the skills (tools) available to an agent
|
|
18
|
+
* and their historical reliability.
|
|
19
|
+
*/
|
|
20
|
+
export declare class CapabilityManager {
|
|
21
|
+
private db;
|
|
22
|
+
private config;
|
|
23
|
+
private capabilitiesTable;
|
|
24
|
+
constructor(db: Kysely<any>, config?: AgenticConfig);
|
|
25
|
+
private get typedDb();
|
|
26
|
+
/**
|
|
27
|
+
* Register or update a capability (skill)
|
|
28
|
+
*/
|
|
29
|
+
registerCapability(name: string, version: string, description?: string, metadata?: Record<string, any>): Promise<AgentCapability>;
|
|
30
|
+
/**
|
|
31
|
+
* Update reliability based on action outcome using a damped moving average.
|
|
32
|
+
*/
|
|
33
|
+
reportOutcome(name: string, success: boolean): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Get reliability score for a capability.
|
|
36
|
+
*/
|
|
37
|
+
getReliability(name: string): Promise<number>;
|
|
38
|
+
/**
|
|
39
|
+
* Get all registered capabilities
|
|
40
|
+
*/
|
|
41
|
+
getCapabilities(): Promise<AgentCapability[]>;
|
|
42
|
+
private parseCapability;
|
|
43
|
+
}
|