squish-memory 1.2.0 → 1.2.1
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/bin/squish-mcp.mjs +40 -42
- package/core/scheduler/cron-scheduler.ts +10 -1
- package/core/worker.ts +10 -1
- package/package.json +119 -119
- package/packages/mcp/src/index.ts +99 -36
- package/dist/config.d.ts +0 -106
- package/dist/config.js +0 -194
- package/dist/core/adapters/config/claude-code.d.ts +0 -45
- package/dist/core/adapters/config/claude-code.js +0 -113
- package/dist/core/adapters/config/cursor.d.ts +0 -26
- package/dist/core/adapters/config/cursor.js +0 -74
- package/dist/core/adapters/config/opencode.d.ts +0 -23
- package/dist/core/adapters/config/opencode.js +0 -73
- package/dist/core/adapters/config/windsurf.d.ts +0 -26
- package/dist/core/adapters/config/windsurf.js +0 -74
- package/dist/core/adapters/index.d.ts +0 -45
- package/dist/core/adapters/index.js +0 -84
- package/dist/core/adapters/scripts/install-adapter.d.ts +0 -19
- package/dist/core/adapters/scripts/install-adapter.js +0 -149
- package/dist/core/adapters/timeline.d.ts +0 -23
- package/dist/core/adapters/timeline.js +0 -88
- package/dist/core/adapters/types.d.ts +0 -137
- package/dist/core/adapters/types.js +0 -50
- package/dist/core/agent-preferences.d.ts +0 -16
- package/dist/core/agent-preferences.js +0 -124
- package/dist/core/algorithms/analytics/token-estimator.d.ts +0 -50
- package/dist/core/algorithms/analytics/token-estimator.js +0 -154
- package/dist/core/algorithms/detection/hash-filters.d.ts +0 -47
- package/dist/core/algorithms/detection/hash-filters.js +0 -190
- package/dist/core/algorithms/detection/semantic-ranker.d.ts +0 -32
- package/dist/core/algorithms/detection/semantic-ranker.js +0 -118
- package/dist/core/algorithms/detection/two-stage-detector.d.ts +0 -52
- package/dist/core/algorithms/detection/two-stage-detector.js +0 -299
- package/dist/core/algorithms/handlers/approve-merge.d.ts +0 -22
- package/dist/core/algorithms/handlers/approve-merge.js +0 -179
- package/dist/core/algorithms/handlers/detect-duplicates.d.ts +0 -47
- package/dist/core/algorithms/handlers/detect-duplicates.js +0 -145
- package/dist/core/algorithms/handlers/get-stats.d.ts +0 -39
- package/dist/core/algorithms/handlers/get-stats.js +0 -88
- package/dist/core/algorithms/handlers/list-proposals.d.ts +0 -45
- package/dist/core/algorithms/handlers/list-proposals.js +0 -83
- package/dist/core/algorithms/handlers/preview-merge.d.ts +0 -39
- package/dist/core/algorithms/handlers/preview-merge.js +0 -93
- package/dist/core/algorithms/handlers/reject-merge.d.ts +0 -28
- package/dist/core/algorithms/handlers/reject-merge.js +0 -69
- package/dist/core/algorithms/handlers/reverse-merge.d.ts +0 -21
- package/dist/core/algorithms/handlers/reverse-merge.js +0 -121
- package/dist/core/algorithms/index.d.ts +0 -21
- package/dist/core/algorithms/index.js +0 -26
- package/dist/core/algorithms/operations/cache-maintenance.d.ts +0 -12
- package/dist/core/algorithms/operations/cache-maintenance.js +0 -157
- package/dist/core/algorithms/safety/safety-checks.d.ts +0 -18
- package/dist/core/algorithms/safety/safety-checks.js +0 -179
- package/dist/core/algorithms/strategies/merge-strategies.d.ts +0 -50
- package/dist/core/algorithms/strategies/merge-strategies.js +0 -288
- package/dist/core/algorithms/types.d.ts +0 -125
- package/dist/core/algorithms/types.js +0 -5
- package/dist/core/algorithms/utils/response-builder.d.ts +0 -28
- package/dist/core/algorithms/utils/response-builder.js +0 -37
- package/dist/core/associations.d.ts +0 -33
- package/dist/core/associations.js +0 -284
- package/dist/core/autosave.d.ts +0 -19
- package/dist/core/autosave.js +0 -16
- package/dist/core/beliefs/decay.d.ts +0 -27
- package/dist/core/beliefs/decay.js +0 -217
- package/dist/core/beliefs/extractor.d.ts +0 -9
- package/dist/core/beliefs/extractor.js +0 -113
- package/dist/core/beliefs/store.d.ts +0 -46
- package/dist/core/beliefs/store.js +0 -466
- package/dist/core/beliefs/types.d.ts +0 -28
- package/dist/core/beliefs/types.js +0 -2
- package/dist/core/commands/mcp-server.d.ts +0 -2
- package/dist/core/commands/mcp-server.js +0 -6
- package/dist/core/commands/remember.d.ts +0 -24
- package/dist/core/commands/remember.js +0 -144
- package/dist/core/compression.d.ts +0 -45
- package/dist/core/compression.js +0 -160
- package/dist/core/consolidation.d.ts +0 -37
- package/dist/core/consolidation.js +0 -248
- package/dist/core/context/agent-context.d.ts +0 -106
- package/dist/core/context/agent-context.js +0 -274
- package/dist/core/context/context-paging.d.ts +0 -80
- package/dist/core/context/context-paging.js +0 -328
- package/dist/core/context/context-window.d.ts +0 -40
- package/dist/core/context/context-window.js +0 -177
- package/dist/core/context/context.d.ts +0 -7
- package/dist/core/context/context.js +0 -22
- package/dist/core/embeddings/embeddings.d.ts +0 -29
- package/dist/core/embeddings/embeddings.js +0 -546
- package/dist/core/embeddings/google-multimodal.d.ts +0 -14
- package/dist/core/embeddings/google-multimodal.js +0 -146
- package/dist/core/embeddings/local-embeddings.d.ts +0 -11
- package/dist/core/embeddings/local-embeddings.js +0 -11
- package/dist/core/embeddings/qmd-client.d.ts +0 -136
- package/dist/core/embeddings/qmd-client.js +0 -403
- package/dist/core/embeddings/transformers-local.d.ts +0 -64
- package/dist/core/embeddings/transformers-local.js +0 -213
- package/dist/core/embeddings.d.ts +0 -2
- package/dist/core/embeddings.js +0 -3
- package/dist/core/error-handling.d.ts +0 -63
- package/dist/core/error-handling.js +0 -173
- package/dist/core/graph/entity-deduplicator.d.ts +0 -24
- package/dist/core/graph/entity-deduplicator.js +0 -183
- package/dist/core/graph/graph-builder.d.ts +0 -46
- package/dist/core/graph/graph-builder.js +0 -174
- package/dist/core/graph/graph-traversal.d.ts +0 -80
- package/dist/core/graph/graph-traversal.js +0 -315
- package/dist/core/graph/index.d.ts +0 -19
- package/dist/core/graph/index.js +0 -13
- package/dist/core/graph/llm-entity-extractor.d.ts +0 -49
- package/dist/core/graph/llm-entity-extractor.js +0 -313
- package/dist/core/graph/multi-hop-retrieval.d.ts +0 -48
- package/dist/core/graph/multi-hop-retrieval.js +0 -215
- package/dist/core/graph/relationship-extractor.d.ts +0 -48
- package/dist/core/graph/relationship-extractor.js +0 -351
- package/dist/core/hooks/agent-hooks.d.ts +0 -83
- package/dist/core/hooks/agent-hooks.js +0 -521
- package/dist/core/hooks/auto-tagger.d.ts +0 -19
- package/dist/core/hooks/auto-tagger.js +0 -155
- package/dist/core/hooks/capture-filter.d.ts +0 -41
- package/dist/core/hooks/capture-filter.js +0 -128
- package/dist/core/hot-cache.d.ts +0 -86
- package/dist/core/hot-cache.js +0 -285
- package/dist/core/index.d.ts +0 -10
- package/dist/core/index.js +0 -11
- package/dist/core/ingestion/agent-memory.d.ts +0 -22
- package/dist/core/ingestion/agent-memory.js +0 -109
- package/dist/core/ingestion/core-memory.d.ts +0 -78
- package/dist/core/ingestion/core-memory.js +0 -226
- package/dist/core/ingestion/learnings.d.ts +0 -57
- package/dist/core/ingestion/learnings.js +0 -205
- package/dist/core/ingestion/signal-engine.d.ts +0 -41
- package/dist/core/ingestion/signal-engine.js +0 -201
- package/dist/core/integrations/obsidian-vault.d.ts +0 -31
- package/dist/core/integrations/obsidian-vault.js +0 -156
- package/dist/core/layers/generator.d.ts +0 -25
- package/dist/core/layers/generator.js +0 -76
- package/dist/core/lib/db-client.d.ts +0 -114
- package/dist/core/lib/db-client.js +0 -130
- package/dist/core/lib/parse-embedding.d.ts +0 -9
- package/dist/core/lib/parse-embedding.js +0 -58
- package/dist/core/lib/schemas.d.ts +0 -132
- package/dist/core/lib/schemas.js +0 -87
- package/dist/core/lib/types.d.ts +0 -45
- package/dist/core/lib/types.js +0 -6
- package/dist/core/lib/utils.d.ts +0 -18
- package/dist/core/lib/utils.js +0 -145
- package/dist/core/lib/validation.d.ts +0 -38
- package/dist/core/lib/validation.js +0 -151
- package/dist/core/lifecycle.d.ts +0 -25
- package/dist/core/lifecycle.js +0 -292
- package/dist/core/logger.d.ts +0 -17
- package/dist/core/logger.js +0 -46
- package/dist/core/mcp/client.d.ts +0 -17
- package/dist/core/mcp/client.js +0 -101
- package/dist/core/mcp/index.d.ts +0 -6
- package/dist/core/mcp/index.js +0 -6
- package/dist/core/mcp/server.d.ts +0 -18
- package/dist/core/mcp/server.js +0 -157
- package/dist/core/mcp/standalone-server.d.ts +0 -13
- package/dist/core/mcp/standalone-server.js +0 -46
- package/dist/core/mcp/tools.d.ts +0 -7
- package/dist/core/mcp/tools.js +0 -278
- package/dist/core/mcp/types.d.ts +0 -87
- package/dist/core/mcp/types.js +0 -48
- package/dist/core/memory/bridge-discovery.d.ts +0 -50
- package/dist/core/memory/bridge-discovery.js +0 -291
- package/dist/core/memory/categorizer.d.ts +0 -27
- package/dist/core/memory/categorizer.js +0 -306
- package/dist/core/memory/conflict-detector.d.ts +0 -7
- package/dist/core/memory/conflict-detector.js +0 -43
- package/dist/core/memory/consolidation.d.ts +0 -42
- package/dist/core/memory/consolidation.js +0 -277
- package/dist/core/memory/context-collector.d.ts +0 -10
- package/dist/core/memory/context-collector.js +0 -56
- package/dist/core/memory/contradiction-resolver.d.ts +0 -40
- package/dist/core/memory/contradiction-resolver.js +0 -368
- package/dist/core/memory/edit-workflow.d.ts +0 -19
- package/dist/core/memory/edit-workflow.js +0 -120
- package/dist/core/memory/entity-extractor.d.ts +0 -37
- package/dist/core/memory/entity-extractor.js +0 -350
- package/dist/core/memory/entity-resolver.d.ts +0 -23
- package/dist/core/memory/entity-resolver.js +0 -64
- package/dist/core/memory/explain.d.ts +0 -18
- package/dist/core/memory/explain.js +0 -92
- package/dist/core/memory/fact-deriver.d.ts +0 -31
- package/dist/core/memory/fact-deriver.js +0 -236
- package/dist/core/memory/fact-extractor.d.ts +0 -24
- package/dist/core/memory/fact-extractor.js +0 -89
- package/dist/core/memory/feedback-tracker.d.ts +0 -12
- package/dist/core/memory/feedback-tracker.js +0 -155
- package/dist/core/memory/hooks.d.ts +0 -88
- package/dist/core/memory/hooks.js +0 -174
- package/dist/core/memory/hybrid-retrieval.d.ts +0 -27
- package/dist/core/memory/hybrid-retrieval.js +0 -37
- package/dist/core/memory/hybrid-scorer.d.ts +0 -40
- package/dist/core/memory/hybrid-scorer.js +0 -267
- package/dist/core/memory/hybrid-search.d.ts +0 -23
- package/dist/core/memory/hybrid-search.js +0 -596
- package/dist/core/memory/importance.d.ts +0 -46
- package/dist/core/memory/importance.js +0 -241
- package/dist/core/memory/index.d.ts +0 -9
- package/dist/core/memory/index.js +0 -11
- package/dist/core/memory/loader.d.ts +0 -31
- package/dist/core/memory/loader.js +0 -141
- package/dist/core/memory/markdown/markdown-storage.d.ts +0 -72
- package/dist/core/memory/markdown/markdown-storage.js +0 -243
- package/dist/core/memory/memories.d.ts +0 -43
- package/dist/core/memory/memories.js +0 -452
- package/dist/core/memory/memory-lifecycle.d.ts +0 -8
- package/dist/core/memory/memory-lifecycle.js +0 -47
- package/dist/core/memory/memory-manager.d.ts +0 -15
- package/dist/core/memory/memory-manager.js +0 -46
- package/dist/core/memory/migrate.d.ts +0 -21
- package/dist/core/memory/migrate.js +0 -134
- package/dist/core/memory/normalization.d.ts +0 -7
- package/dist/core/memory/normalization.js +0 -26
- package/dist/core/memory/path-strengthener.d.ts +0 -39
- package/dist/core/memory/path-strengthener.js +0 -150
- package/dist/core/memory/progressive-disclosure.d.ts +0 -43
- package/dist/core/memory/progressive-disclosure.js +0 -280
- package/dist/core/memory/query-processor.d.ts +0 -21
- package/dist/core/memory/query-processor.js +0 -106
- package/dist/core/memory/query-rewriter.d.ts +0 -13
- package/dist/core/memory/query-rewriter.js +0 -118
- package/dist/core/memory/response-analyzer.d.ts +0 -9
- package/dist/core/memory/response-analyzer.js +0 -61
- package/dist/core/memory/retrieval-feedback.d.ts +0 -70
- package/dist/core/memory/retrieval-feedback.js +0 -213
- package/dist/core/memory/serialization.d.ts +0 -10
- package/dist/core/memory/serialization.js +0 -84
- package/dist/core/memory/stale-cleaner.d.ts +0 -26
- package/dist/core/memory/stale-cleaner.js +0 -97
- package/dist/core/memory/stats.d.ts +0 -32
- package/dist/core/memory/stats.js +0 -143
- package/dist/core/memory/telemetry.d.ts +0 -69
- package/dist/core/memory/telemetry.js +0 -313
- package/dist/core/memory/temporal-facts.d.ts +0 -41
- package/dist/core/memory/temporal-facts.js +0 -283
- package/dist/core/memory/temporal-parser.d.ts +0 -32
- package/dist/core/memory/temporal-parser.js +0 -385
- package/dist/core/memory/trigger-detector.d.ts +0 -21
- package/dist/core/memory/trigger-detector.js +0 -79
- package/dist/core/memory/write-gate.d.ts +0 -54
- package/dist/core/memory/write-gate.js +0 -210
- package/dist/core/places/index.d.ts +0 -14
- package/dist/core/places/index.js +0 -14
- package/dist/core/places/memory-places.d.ts +0 -68
- package/dist/core/places/memory-places.js +0 -261
- package/dist/core/places/places.d.ts +0 -88
- package/dist/core/places/places.js +0 -314
- package/dist/core/places/rules.d.ts +0 -74
- package/dist/core/places/rules.js +0 -240
- package/dist/core/places/walking.d.ts +0 -56
- package/dist/core/places/walking.js +0 -121
- package/dist/core/projects.d.ts +0 -17
- package/dist/core/projects.js +0 -116
- package/dist/core/redis.d.ts +0 -11
- package/dist/core/redis.js +0 -69
- package/dist/core/responses.d.ts +0 -96
- package/dist/core/responses.js +0 -122
- package/dist/core/runtime/trust-report.d.ts +0 -102
- package/dist/core/runtime/trust-report.js +0 -107
- package/dist/core/runtime/trust-state.d.ts +0 -12
- package/dist/core/runtime/trust-state.js +0 -309
- package/dist/core/scheduler/cron-scheduler.d.ts +0 -32
- package/dist/core/scheduler/cron-scheduler.js +0 -493
- package/dist/core/scheduler/heartbeat.d.ts +0 -11
- package/dist/core/scheduler/heartbeat.js +0 -73
- package/dist/core/scheduler/index.d.ts +0 -8
- package/dist/core/scheduler/index.js +0 -8
- package/dist/core/scheduler/job-runner.d.ts +0 -11
- package/dist/core/scheduler/job-runner.js +0 -164
- package/dist/core/search/conversations.d.ts +0 -25
- package/dist/core/search/conversations.js +0 -110
- package/dist/core/search/entities.d.ts +0 -12
- package/dist/core/search/entities.js +0 -31
- package/dist/core/search/folder-context.d.ts +0 -25
- package/dist/core/search/folder-context.js +0 -119
- package/dist/core/search/graph-boost.d.ts +0 -7
- package/dist/core/search/graph-boost.js +0 -23
- package/dist/core/search/index.d.ts +0 -4
- package/dist/core/search/index.js +0 -5
- package/dist/core/search/qmd-wrapper.d.ts +0 -36
- package/dist/core/search/qmd-wrapper.js +0 -58
- package/dist/core/security/encrypt.d.ts +0 -6
- package/dist/core/security/encrypt.js +0 -47
- package/dist/core/security/governance.d.ts +0 -26
- package/dist/core/security/governance.js +0 -79
- package/dist/core/security/privacy.d.ts +0 -23
- package/dist/core/security/privacy.js +0 -82
- package/dist/core/security/secret-detector.d.ts +0 -32
- package/dist/core/security/secret-detector.js +0 -88
- package/dist/core/session/auto-load.d.ts +0 -6
- package/dist/core/session/auto-load.js +0 -144
- package/dist/core/session/entity-tracker.d.ts +0 -62
- package/dist/core/session/entity-tracker.js +0 -287
- package/dist/core/session/index.d.ts +0 -7
- package/dist/core/session/index.js +0 -7
- package/dist/core/session/reference-resolver.d.ts +0 -26
- package/dist/core/session/reference-resolver.js +0 -121
- package/dist/core/session/self-iteration-job.d.ts +0 -35
- package/dist/core/session/self-iteration-job.js +0 -387
- package/dist/core/session/session-hooks.d.ts +0 -18
- package/dist/core/session/session-hooks.js +0 -58
- package/dist/core/session/types.d.ts +0 -26
- package/dist/core/session/types.js +0 -10
- package/dist/core/session/working-set.d.ts +0 -50
- package/dist/core/session/working-set.js +0 -212
- package/dist/core/snapshots/cleanup.d.ts +0 -9
- package/dist/core/snapshots/cleanup.js +0 -12
- package/dist/core/snapshots/comparison.d.ts +0 -19
- package/dist/core/snapshots/comparison.js +0 -43
- package/dist/core/snapshots/creation.d.ts +0 -13
- package/dist/core/snapshots/creation.js +0 -117
- package/dist/core/snapshots/retrieval.d.ts +0 -7
- package/dist/core/snapshots/retrieval.js +0 -41
- package/dist/core/snapshots/stats.d.ts +0 -11
- package/dist/core/snapshots/stats.js +0 -52
- package/dist/core/storage/cache.d.ts +0 -13
- package/dist/core/storage/cache.js +0 -202
- package/dist/core/storage/database.d.ts +0 -12
- package/dist/core/storage/database.js +0 -12
- package/dist/core/summarization/cleanup.d.ts +0 -9
- package/dist/core/summarization/cleanup.js +0 -12
- package/dist/core/summarization/queries.d.ts +0 -9
- package/dist/core/summarization/queries.js +0 -28
- package/dist/core/summarization/stats.d.ts +0 -14
- package/dist/core/summarization/stats.js +0 -52
- package/dist/core/summarization/strategies.d.ts +0 -24
- package/dist/core/summarization/strategies.js +0 -28
- package/dist/core/summarization.d.ts +0 -37
- package/dist/core/summarization.js +0 -188
- package/dist/core/temporal-facts.d.ts +0 -54
- package/dist/core/temporal-facts.js +0 -193
- package/dist/core/tracing/collector.d.ts +0 -111
- package/dist/core/tracing/collector.js +0 -350
- package/dist/core/tracing/visualizer.d.ts +0 -32
- package/dist/core/tracing/visualizer.js +0 -165
- package/dist/core/utils/cleanup-operations.d.ts +0 -13
- package/dist/core/utils/cleanup-operations.js +0 -44
- package/dist/core/utils/content-extraction.d.ts +0 -19
- package/dist/core/utils/content-extraction.js +0 -75
- package/dist/core/utils/filter-builder.d.ts +0 -13
- package/dist/core/utils/filter-builder.js +0 -44
- package/dist/core/utils/history-traversal.d.ts +0 -13
- package/dist/core/utils/history-traversal.js +0 -50
- package/dist/core/utils/memory-operations.d.ts +0 -17
- package/dist/core/utils/memory-operations.js +0 -43
- package/dist/core/utils/query-operations.d.ts +0 -18
- package/dist/core/utils/query-operations.js +0 -65
- package/dist/core/utils/summarization-helpers.d.ts +0 -17
- package/dist/core/utils/summarization-helpers.js +0 -33
- package/dist/core/utils/temporal-queries.d.ts +0 -13
- package/dist/core/utils/temporal-queries.js +0 -27
- package/dist/core/utils/vector-operations.d.ts +0 -71
- package/dist/core/utils/vector-operations.js +0 -129
- package/dist/core/utils/version-management.d.ts +0 -9
- package/dist/core/utils/version-management.js +0 -61
- package/dist/core/worker.d.ts +0 -82
- package/dist/core/worker.js +0 -272
- package/dist/db/adapter.d.ts +0 -7
- package/dist/db/adapter.js +0 -175
- package/dist/db/bootstrap.d.ts +0 -11
- package/dist/db/bootstrap.js +0 -1034
- package/dist/db/drizzle/schema-sqlite.d.ts +0 -5538
- package/dist/db/drizzle/schema-sqlite.js +0 -763
- package/dist/db/drizzle/schema.d.ts +0 -4734
- package/dist/db/drizzle/schema.js +0 -859
- package/dist/db/drizzle.config.d.ts +0 -3
- package/dist/db/drizzle.config.js +0 -12
- package/dist/db/index.d.ts +0 -7
- package/dist/db/index.js +0 -89
- package/dist/db/migrations/associations.d.ts +0 -6
- package/dist/db/migrations/associations.js +0 -29
- package/dist/db/migrations/beliefs.d.ts +0 -10
- package/dist/db/migrations/beliefs.js +0 -76
- package/dist/db/migrations/core-memory.d.ts +0 -6
- package/dist/db/migrations/core-memory.js +0 -29
- package/dist/db/migrations/fts.d.ts +0 -6
- package/dist/db/migrations/fts.js +0 -52
- package/dist/db/migrations/index.d.ts +0 -25
- package/dist/db/migrations/index.js +0 -51
- package/dist/db/migrations/indexes.d.ts +0 -6
- package/dist/db/migrations/indexes.js +0 -30
- package/dist/db/migrations/learnings.d.ts +0 -7
- package/dist/db/migrations/learnings.js +0 -26
- package/dist/db/migrations/maintenance.d.ts +0 -6
- package/dist/db/migrations/maintenance.js +0 -61
- package/dist/db/migrations/memories.d.ts +0 -7
- package/dist/db/migrations/memories.js +0 -16
- package/dist/db/migrations/memory-places.d.ts +0 -6
- package/dist/db/migrations/memory-places.js +0 -29
- package/dist/db/migrations/places.d.ts +0 -6
- package/dist/db/migrations/places.js +0 -43
- package/dist/db/migrations/projects.d.ts +0 -3
- package/dist/db/migrations/projects.js +0 -13
- package/dist/db/migrations/tier-conversion.d.ts +0 -7
- package/dist/db/migrations/tier-conversion.js +0 -20
- package/dist/db/neon.d.ts +0 -8
- package/dist/db/neon.js +0 -20
- package/dist/db/schema/beliefs.d.ts +0 -9
- package/dist/db/schema/beliefs.js +0 -46
- package/dist/db/schema/generator.d.ts +0 -38
- package/dist/db/schema/generator.js +0 -108
- package/dist/db/schema/index.d.ts +0 -39
- package/dist/db/schema/index.js +0 -51
- package/dist/db/schema/learnings.d.ts +0 -7
- package/dist/db/schema/learnings.js +0 -30
- package/dist/db/schema/memories.d.ts +0 -7
- package/dist/db/schema/memories.js +0 -81
- package/dist/db/schema/projects.d.ts +0 -4
- package/dist/db/schema/projects.js +0 -31
- package/dist/db/schema/tables/context-sessions.d.ts +0 -9
- package/dist/db/schema/tables/context-sessions.js +0 -37
- package/dist/db/schema/tables/conversations.d.ts +0 -9
- package/dist/db/schema/tables/conversations.js +0 -47
- package/dist/db/schema/tables/core-memory.d.ts +0 -9
- package/dist/db/schema/tables/core-memory.js +0 -41
- package/dist/db/schema/tables/entities.d.ts +0 -9
- package/dist/db/schema/tables/entities.js +0 -39
- package/dist/db/schema/tables/entity-relations.d.ts +0 -9
- package/dist/db/schema/tables/entity-relations.js +0 -31
- package/dist/db/schema/tables/learnings.d.ts +0 -9
- package/dist/db/schema/tables/learnings.js +0 -66
- package/dist/db/schema/tables/memories.d.ts +0 -9
- package/dist/db/schema/tables/memories.js +0 -161
- package/dist/db/schema/tables/memory-associations.d.ts +0 -9
- package/dist/db/schema/tables/memory-associations.js +0 -39
- package/dist/db/schema/tables/memory-hash-cache.d.ts +0 -9
- package/dist/db/schema/tables/memory-hash-cache.js +0 -29
- package/dist/db/schema/tables/memory-merge-history.d.ts +0 -9
- package/dist/db/schema/tables/memory-merge-history.js +0 -33
- package/dist/db/schema/tables/memory-merge-proposals.d.ts +0 -9
- package/dist/db/schema/tables/memory-merge-proposals.js +0 -39
- package/dist/db/schema/tables/messages.d.ts +0 -9
- package/dist/db/schema/tables/messages.js +0 -41
- package/dist/db/schema/tables/namespaces.d.ts +0 -9
- package/dist/db/schema/tables/namespaces.js +0 -37
- package/dist/db/schema/tables/projects.d.ts +0 -9
- package/dist/db/schema/tables/projects.js +0 -31
- package/dist/db/schema/tables/users.d.ts +0 -9
- package/dist/db/schema/tables/users.js +0 -27
- package/dist/db/schema.d.ts +0 -3
- package/dist/db/schema.js +0 -11
- package/dist/db/supabase.d.ts +0 -9
- package/dist/db/supabase.js +0 -24
- package/dist/packages/mcp/src/index.d.ts +0 -3
- package/dist/packages/mcp/src/index.js +0 -733
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
export function formatContextReport(input) {
|
|
2
|
-
const lines = [
|
|
3
|
-
'Current project',
|
|
4
|
-
`- ${input.currentProject.name} (${input.currentProject.path})`,
|
|
5
|
-
`- resolution: ${input.currentProject.resolution}`,
|
|
6
|
-
'',
|
|
7
|
-
'Runtime state',
|
|
8
|
-
`- session working set: ${input.runtime.sessionSummary || 'none'}`,
|
|
9
|
-
`- active places: ${input.runtime.activePlaces.join(', ') || 'none'}`,
|
|
10
|
-
`- signals: captured ${input.runtime.signalSummary.captured}, suppressed ${input.runtime.signalSummary.suppressed}, session-only ${input.runtime.signalSummary.sessionOnly}, durable ${input.runtime.signalSummary.durable}, durable+raw ${input.runtime.signalSummary.durableWithRaw}`,
|
|
11
|
-
`- graph: ${input.runtime.graphSummary}`,
|
|
12
|
-
'',
|
|
13
|
-
'Recent durable memories',
|
|
14
|
-
];
|
|
15
|
-
if (input.durableMemories.length === 0) {
|
|
16
|
-
lines.push('- none yet');
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
for (const memory of input.durableMemories) {
|
|
20
|
-
lines.push(`- [${memory.type}] ${memory.content}${memory.place ? ` @ ${memory.place}` : ''}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
if (input.otherProjects.length > 0) {
|
|
24
|
-
lines.push('', 'Other projects');
|
|
25
|
-
for (const project of input.otherProjects) {
|
|
26
|
-
lines.push(`- ${project.name} (${project.path}) [${project.resolution}]`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (input.beliefs && input.beliefs.length > 0) {
|
|
30
|
-
lines.push('', 'Derived beliefs');
|
|
31
|
-
for (const belief of input.beliefs) {
|
|
32
|
-
lines.push(`- [${belief.type}] ${belief.statement} (${belief.status})`);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (input.nextStep) {
|
|
36
|
-
lines.push('', `Next step: ${input.nextStep}`);
|
|
37
|
-
}
|
|
38
|
-
return lines.join('\n');
|
|
39
|
-
}
|
|
40
|
-
export function formatHealthReport(input) {
|
|
41
|
-
const lines = [
|
|
42
|
-
`Status: ${input.severity}`,
|
|
43
|
-
`Current project: ${input.currentProject}`,
|
|
44
|
-
'',
|
|
45
|
-
'Subsystems',
|
|
46
|
-
...input.checks.map((check) => `- ${check.name}: ${check.status} (${check.detail})`),
|
|
47
|
-
];
|
|
48
|
-
if (input.diagnostics && input.diagnostics.length > 0) {
|
|
49
|
-
lines.push('', 'Diagnostics');
|
|
50
|
-
for (const diagnostic of input.diagnostics) {
|
|
51
|
-
lines.push(`- ${diagnostic.name}: ${diagnostic.status} (${diagnostic.detail})`);
|
|
52
|
-
if (diagnostic.fix) {
|
|
53
|
-
lines.push(` fix: ${diagnostic.fix}`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
if (input.nextStep)
|
|
58
|
-
lines.push('', `Next step: ${input.nextStep}`);
|
|
59
|
-
return lines.join('\n');
|
|
60
|
-
}
|
|
61
|
-
export function formatStatsReport(input) {
|
|
62
|
-
const lines = [
|
|
63
|
-
`Current project: ${input.currentProject}`,
|
|
64
|
-
`Memory totals: ${input.totals.memories} total, ${input.totals.durable} durable, ${input.totals.sessionLocal} session-local`,
|
|
65
|
-
'',
|
|
66
|
-
'Capture-era signals',
|
|
67
|
-
`- captured: ${input.signal.captured}`,
|
|
68
|
-
`- suppressed: ${input.signal.suppressed}`,
|
|
69
|
-
`- session-only: ${input.signal.sessionOnly}`,
|
|
70
|
-
`- signal-tracked durable: ${input.signal.durable}`,
|
|
71
|
-
`- signal-tracked durable+raw: ${input.signal.durableWithRaw}`,
|
|
72
|
-
`- token savings: ${input.signal.tokensSaved}`,
|
|
73
|
-
`- place routed: ${input.signal.placeRouted}`,
|
|
74
|
-
`- graph enriched: ${input.signal.graphEnriched}`,
|
|
75
|
-
'',
|
|
76
|
-
`Places: ${input.places.active} active (${input.places.named.join(', ') || 'none'})`,
|
|
77
|
-
`Graph: ${input.graph.status}; ${input.graph.enrichments} enrichments`,
|
|
78
|
-
`Wake-up: ${input.wakeUp}`,
|
|
79
|
-
];
|
|
80
|
-
if (input.signalNote) {
|
|
81
|
-
lines.push(`Signal note: ${input.signalNote}`);
|
|
82
|
-
}
|
|
83
|
-
return lines.join('\n');
|
|
84
|
-
}
|
|
85
|
-
export function formatInspectReport(input) {
|
|
86
|
-
const lines = [
|
|
87
|
-
`Memory ${input.id}`,
|
|
88
|
-
`Classification: ${input.classification}`,
|
|
89
|
-
`Storage reason: ${input.storageReason}`,
|
|
90
|
-
`Durability: ${input.durability}`,
|
|
91
|
-
`Place: ${input.place ?? 'none'}${input.placeType ? ` (${input.placeType})` : ''}`,
|
|
92
|
-
`Graph: ${input.graphStatus ?? 'none'}`,
|
|
93
|
-
`Raw fallback: ${input.rawFallback ?? 'none'}`,
|
|
94
|
-
`Wake-up priority: ${input.wakeUpPriority ?? 'n/a'}`,
|
|
95
|
-
];
|
|
96
|
-
if (input.metadataAvailability) {
|
|
97
|
-
lines.push(`Metadata: ${input.metadataAvailability}`);
|
|
98
|
-
}
|
|
99
|
-
if (input.beliefs && input.beliefs.length > 0) {
|
|
100
|
-
lines.push('Beliefs:');
|
|
101
|
-
for (const belief of input.beliefs) {
|
|
102
|
-
lines.push(`- [${belief.type}] ${belief.statement} (${belief.status}, c=${belief.confidence.toFixed(2)})`);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
return lines.join('\n');
|
|
106
|
-
}
|
|
107
|
-
//# sourceMappingURL=trust-report.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ContextReportInput, CurrentProjectSummary, HealthReportInput, InspectReportInput, StatsReportInput } from './trust-report.js';
|
|
2
|
-
export interface TrustProjectScope {
|
|
3
|
-
currentProject: CurrentProjectSummary;
|
|
4
|
-
otherProjects: CurrentProjectSummary[];
|
|
5
|
-
nextStep: string | null;
|
|
6
|
-
}
|
|
7
|
-
export declare function resolveProjectScope(projectPath?: string): Promise<TrustProjectScope>;
|
|
8
|
-
export declare function buildContextState(projectPath?: string, limit?: number): Promise<ContextReportInput>;
|
|
9
|
-
export declare function buildStatsState(projectPath?: string): Promise<StatsReportInput>;
|
|
10
|
-
export declare function buildHealthState(projectPath?: string): Promise<HealthReportInput>;
|
|
11
|
-
export declare function buildInspectState(id: string): Promise<InspectReportInput | null>;
|
|
12
|
-
//# sourceMappingURL=trust-state.d.ts.map
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import { getDbClient } from '../lib/db-client.js';
|
|
2
|
-
import { getRecent } from '../memory/memories.js';
|
|
3
|
-
import { getMemoryStats } from '../memory/stats.js';
|
|
4
|
-
import { explainMemory } from '../memory/explain.js';
|
|
5
|
-
import { getLatestProjectWorkingSetSummary, getProjectSignalStats } from '../session/working-set.js';
|
|
6
|
-
import { getGraphStats } from '../graph/index.js';
|
|
7
|
-
import { getAllProjects, getProjectByPath, ensureProject } from '../projects.js';
|
|
8
|
-
import { getProjectPlaces } from '../places/places.js';
|
|
9
|
-
import { getMemoryPlace } from '../places/memory-places.js';
|
|
10
|
-
import { getPlace } from '../places/places.js';
|
|
11
|
-
import { config } from '../../config.js';
|
|
12
|
-
import { getBeliefsForMemory } from '../beliefs/store.js';
|
|
13
|
-
function isLegacyPlaceholderProject(project, currentWorkspacePath) {
|
|
14
|
-
const normalizedPath = project.path.trim();
|
|
15
|
-
if (normalizedPath === '.')
|
|
16
|
-
return true;
|
|
17
|
-
if (!currentWorkspacePath)
|
|
18
|
-
return false;
|
|
19
|
-
return normalizedPath === currentWorkspacePath && String(project.metadata?.source ?? '') === 'mcp';
|
|
20
|
-
}
|
|
21
|
-
function filterNormalOtherProjects(projects, currentProjectId, currentWorkspacePath) {
|
|
22
|
-
return projects.filter((candidate) => {
|
|
23
|
-
if (candidate.id === currentProjectId)
|
|
24
|
-
return false;
|
|
25
|
-
return !isLegacyPlaceholderProject(candidate, currentWorkspacePath);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function inferResolution(project, mode) {
|
|
29
|
-
if (mode !== 'inferred')
|
|
30
|
-
return mode;
|
|
31
|
-
const source = String(project.metadata?.source ?? '');
|
|
32
|
-
return source === 'mcp' ? 'auto-created' : 'inferred';
|
|
33
|
-
}
|
|
34
|
-
function toProjectSummary(project, mode) {
|
|
35
|
-
return {
|
|
36
|
-
id: project.id,
|
|
37
|
-
name: project.name,
|
|
38
|
-
path: project.path,
|
|
39
|
-
resolution: inferResolution(project, mode),
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
export async function resolveProjectScope(projectPath) {
|
|
43
|
-
const projects = await getAllProjects();
|
|
44
|
-
const explicitPath = projectPath?.trim();
|
|
45
|
-
if (explicitPath) {
|
|
46
|
-
let project = await getProjectByPath(explicitPath);
|
|
47
|
-
let resolution = 'explicit';
|
|
48
|
-
if (!project) {
|
|
49
|
-
project = await ensureProject(explicitPath);
|
|
50
|
-
resolution = 'auto-created';
|
|
51
|
-
}
|
|
52
|
-
if (!project) {
|
|
53
|
-
throw new Error(`Unable to resolve project: ${explicitPath}`);
|
|
54
|
-
}
|
|
55
|
-
return {
|
|
56
|
-
currentProject: toProjectSummary(project, resolution),
|
|
57
|
-
otherProjects: filterNormalOtherProjects(projects, project.id, explicitPath)
|
|
58
|
-
.map((candidate) => toProjectSummary(candidate, 'inferred')),
|
|
59
|
-
nextStep: null,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
const cwd = process.cwd();
|
|
63
|
-
const cwdProject = await getProjectByPath(cwd);
|
|
64
|
-
if (cwdProject) {
|
|
65
|
-
return {
|
|
66
|
-
currentProject: toProjectSummary(cwdProject, 'inferred'),
|
|
67
|
-
otherProjects: filterNormalOtherProjects(projects, cwdProject.id, cwd)
|
|
68
|
-
.map((candidate) => toProjectSummary(candidate, 'inferred')),
|
|
69
|
-
nextStep: null,
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
if (projects.length === 1) {
|
|
73
|
-
return {
|
|
74
|
-
currentProject: toProjectSummary(projects[0], 'inferred'),
|
|
75
|
-
otherProjects: [],
|
|
76
|
-
nextStep: null,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
const autoProject = await ensureProject(cwd);
|
|
80
|
-
if (!autoProject) {
|
|
81
|
-
throw new Error(`Unable to create project for current workspace: ${cwd}`);
|
|
82
|
-
}
|
|
83
|
-
const otherProjects = projects
|
|
84
|
-
.filter((candidate) => candidate.id !== autoProject.id)
|
|
85
|
-
.filter((candidate) => !isLegacyPlaceholderProject(candidate, cwd))
|
|
86
|
-
.map((candidate) => toProjectSummary(candidate, 'inferred'));
|
|
87
|
-
return {
|
|
88
|
-
currentProject: toProjectSummary(autoProject, 'auto-created'),
|
|
89
|
-
otherProjects,
|
|
90
|
-
nextStep: otherProjects.length > 0
|
|
91
|
-
? 'Pass --project with the intended workspace path if this is not the project you meant.'
|
|
92
|
-
: null,
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
async function getMemoryPlaceName(memoryId) {
|
|
96
|
-
const placeId = await getMemoryPlace(memoryId);
|
|
97
|
-
if (!placeId)
|
|
98
|
-
return null;
|
|
99
|
-
const place = await getPlace(placeId);
|
|
100
|
-
return place?.name ?? null;
|
|
101
|
-
}
|
|
102
|
-
export async function buildContextState(projectPath, limit = 10) {
|
|
103
|
-
const scope = await resolveProjectScope(projectPath);
|
|
104
|
-
const projectPathResolved = scope.currentProject.path;
|
|
105
|
-
const [sessionSummary, signalSummary, graphStats, memories] = await Promise.all([
|
|
106
|
-
getLatestProjectWorkingSetSummary(projectPathResolved),
|
|
107
|
-
getProjectSignalStats(projectPathResolved),
|
|
108
|
-
getGraphStats(projectPathResolved),
|
|
109
|
-
getRecent(projectPathResolved, limit),
|
|
110
|
-
]);
|
|
111
|
-
const project = await getProjectByPath(projectPathResolved);
|
|
112
|
-
const places = project ? await getProjectPlaces(project.id) : [];
|
|
113
|
-
const activePlaces = places.filter((place) => place.memoryCount > 0).map((place) => place.name);
|
|
114
|
-
const durableMemories = await Promise.all(memories.map(async (memory) => ({
|
|
115
|
-
id: memory.id,
|
|
116
|
-
type: memory.type,
|
|
117
|
-
content: memory.content,
|
|
118
|
-
place: await getMemoryPlaceName(memory.id),
|
|
119
|
-
})));
|
|
120
|
-
const beliefRows = await Promise.all(memories.map((memory) => getBeliefsForMemory(memory.id)));
|
|
121
|
-
const beliefs = beliefRows.flat().slice(0, 6).map((belief) => ({
|
|
122
|
-
type: belief.type,
|
|
123
|
-
statement: belief.statement,
|
|
124
|
-
status: belief.status,
|
|
125
|
-
}));
|
|
126
|
-
return {
|
|
127
|
-
currentProject: scope.currentProject,
|
|
128
|
-
otherProjects: scope.otherProjects,
|
|
129
|
-
runtime: {
|
|
130
|
-
sessionSummary,
|
|
131
|
-
activePlaces,
|
|
132
|
-
signalSummary: {
|
|
133
|
-
captured: signalSummary.captured,
|
|
134
|
-
suppressed: signalSummary.suppressed,
|
|
135
|
-
sessionOnly: signalSummary.sessionOnly,
|
|
136
|
-
durable: signalSummary.durable,
|
|
137
|
-
durableWithRaw: signalSummary.durableWithRaw,
|
|
138
|
-
},
|
|
139
|
-
graphSummary: graphStats.entityCount > 0 || graphStats.relationCount > 0
|
|
140
|
-
? `enabled; ${graphStats.entityCount} entities, ${graphStats.relationCount} relations`
|
|
141
|
-
: 'enabled; no graph enrichments yet',
|
|
142
|
-
},
|
|
143
|
-
durableMemories,
|
|
144
|
-
beliefs,
|
|
145
|
-
nextStep: scope.nextStep,
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
export async function buildStatsState(projectPath) {
|
|
149
|
-
const scope = await resolveProjectScope(projectPath);
|
|
150
|
-
const projectPathResolved = scope.currentProject.path;
|
|
151
|
-
const [stats, graphStats, sessionSummary] = await Promise.all([
|
|
152
|
-
getMemoryStats(projectPathResolved),
|
|
153
|
-
getGraphStats(projectPathResolved),
|
|
154
|
-
getLatestProjectWorkingSetSummary(projectPathResolved),
|
|
155
|
-
]);
|
|
156
|
-
const project = await getProjectByPath(projectPathResolved);
|
|
157
|
-
const places = project ? await getProjectPlaces(project.id) : [];
|
|
158
|
-
return {
|
|
159
|
-
currentProject: `${scope.currentProject.name} (${scope.currentProject.path})`,
|
|
160
|
-
totals: {
|
|
161
|
-
memories: stats.totalMemories,
|
|
162
|
-
durable: Math.max(stats.totalMemories, (stats.signal?.durable ?? 0) + (stats.signal?.durableWithRaw ?? 0)),
|
|
163
|
-
sessionLocal: stats.signal?.sessionOnly ?? 0,
|
|
164
|
-
},
|
|
165
|
-
signal: {
|
|
166
|
-
captured: stats.signal?.captured ?? 0,
|
|
167
|
-
suppressed: stats.signal?.suppressed ?? 0,
|
|
168
|
-
sessionOnly: stats.signal?.sessionOnly ?? 0,
|
|
169
|
-
durable: stats.signal?.durable ?? 0,
|
|
170
|
-
durableWithRaw: stats.signal?.durableWithRaw ?? 0,
|
|
171
|
-
tokensSaved: stats.signal?.tokensSaved ?? 0,
|
|
172
|
-
placeRouted: stats.signal?.placeRouted ?? 0,
|
|
173
|
-
graphEnriched: stats.signal?.graphEnriched ?? 0,
|
|
174
|
-
},
|
|
175
|
-
places: {
|
|
176
|
-
active: places.filter((place) => place.memoryCount > 0).length,
|
|
177
|
-
named: places.filter((place) => place.memoryCount > 0).map((place) => place.name),
|
|
178
|
-
},
|
|
179
|
-
graph: {
|
|
180
|
-
status: graphStats.entityCount > 0 || graphStats.relationCount > 0 ? 'enabled' : 'enabled (idle)',
|
|
181
|
-
enrichments: stats.signal?.graphEnriched ?? 0,
|
|
182
|
-
},
|
|
183
|
-
wakeUp: sessionSummary || 'No working set yet',
|
|
184
|
-
signalNote: stats.totalMemories > 0 && (stats.signal?.captured ?? 0) === 0
|
|
185
|
-
? 'Signal counts cover capture-era writes only. Legacy durable memories may exist without signal telemetry.'
|
|
186
|
-
: 'Signal counts cover capture-era writes only.',
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
export async function buildHealthState(projectPath) {
|
|
190
|
-
const scope = await resolveProjectScope(projectPath);
|
|
191
|
-
const checks = [];
|
|
192
|
-
let severity = 'ok';
|
|
193
|
-
let nextStep = scope.nextStep;
|
|
194
|
-
try {
|
|
195
|
-
await getDbClient();
|
|
196
|
-
checks.push({ name: 'database', status: 'ok', detail: 'Database connection succeeded.' });
|
|
197
|
-
}
|
|
198
|
-
catch (error) {
|
|
199
|
-
severity = 'broken';
|
|
200
|
-
nextStep = 'Fix database initialization before relying on memory reads or writes.';
|
|
201
|
-
checks.push({
|
|
202
|
-
name: 'database',
|
|
203
|
-
status: 'broken',
|
|
204
|
-
detail: error?.message ?? 'Database initialization failed.',
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
checks.push({
|
|
208
|
-
name: 'project resolution',
|
|
209
|
-
status: 'ok',
|
|
210
|
-
detail: `${scope.currentProject.name} at ${scope.currentProject.path} (${scope.currentProject.resolution})`,
|
|
211
|
-
});
|
|
212
|
-
try {
|
|
213
|
-
await getRecent(scope.currentProject.path, 1);
|
|
214
|
-
checks.push({ name: 'memory write path', status: 'ok', detail: 'Memory store is readable for this project.' });
|
|
215
|
-
}
|
|
216
|
-
catch (error) {
|
|
217
|
-
severity = severity === 'broken' ? 'broken' : 'degraded';
|
|
218
|
-
nextStep = nextStep ?? 'Run `squish doctor` to repair local storage before writing memories.';
|
|
219
|
-
checks.push({
|
|
220
|
-
name: 'memory write path',
|
|
221
|
-
status: 'degraded',
|
|
222
|
-
detail: error?.message ?? 'Memory store could not be read.',
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
try {
|
|
226
|
-
const sessionSummary = await getLatestProjectWorkingSetSummary(scope.currentProject.path);
|
|
227
|
-
checks.push({
|
|
228
|
-
name: 'session working set',
|
|
229
|
-
status: sessionSummary ? 'ok' : 'degraded',
|
|
230
|
-
detail: sessionSummary || 'No compact working set has been captured yet.',
|
|
231
|
-
});
|
|
232
|
-
if (!sessionSummary && severity === 'ok') {
|
|
233
|
-
severity = 'degraded';
|
|
234
|
-
nextStep = nextStep ?? 'Run a normal session or memory write so Squish can build a working-set wake-up summary.';
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
catch (error) {
|
|
238
|
-
severity = severity === 'broken' ? 'broken' : 'degraded';
|
|
239
|
-
checks.push({
|
|
240
|
-
name: 'session working set',
|
|
241
|
-
status: 'degraded',
|
|
242
|
-
detail: error?.message ?? 'Working-set state could not be loaded.',
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
const project = await getProjectByPath(scope.currentProject.path);
|
|
246
|
-
const places = project ? await getProjectPlaces(project.id) : [];
|
|
247
|
-
const activePlaces = places.filter((place) => place.memoryCount > 0);
|
|
248
|
-
checks.push({
|
|
249
|
-
name: 'places',
|
|
250
|
-
status: activePlaces.length > 0 ? 'ok' : 'degraded',
|
|
251
|
-
detail: activePlaces.length > 0
|
|
252
|
-
? `${activePlaces.length} active places: ${activePlaces.map((place) => place.name).join(', ')}`
|
|
253
|
-
: 'No populated places yet.',
|
|
254
|
-
});
|
|
255
|
-
if (activePlaces.length === 0 && severity === 'ok') {
|
|
256
|
-
severity = 'degraded';
|
|
257
|
-
nextStep = nextStep ?? 'Store or recall project memories to populate place routing.';
|
|
258
|
-
}
|
|
259
|
-
const graphStats = await getGraphStats(scope.currentProject.path);
|
|
260
|
-
checks.push({
|
|
261
|
-
name: 'graph',
|
|
262
|
-
status: graphStats.entityCount > 0 || graphStats.relationCount > 0 ? 'ok' : 'degraded',
|
|
263
|
-
detail: graphStats.entityCount > 0 || graphStats.relationCount > 0
|
|
264
|
-
? `${graphStats.entityCount} entities and ${graphStats.relationCount} relations available.`
|
|
265
|
-
: 'Graph is enabled but has no extracted entities yet.',
|
|
266
|
-
});
|
|
267
|
-
if (graphStats.entityCount === 0 && graphStats.relationCount === 0 && severity === 'ok') {
|
|
268
|
-
severity = 'degraded';
|
|
269
|
-
nextStep = nextStep ?? 'Write or recall durable memories so graph enrichment has material to process.';
|
|
270
|
-
}
|
|
271
|
-
checks.push({
|
|
272
|
-
name: 'mode',
|
|
273
|
-
status: 'ok',
|
|
274
|
-
detail: `${config.isManagedMode ? 'managed' : 'local'} mode; embeddings ${config.embeddingsProvider}`,
|
|
275
|
-
});
|
|
276
|
-
return {
|
|
277
|
-
severity,
|
|
278
|
-
currentProject: `${scope.currentProject.name} (${scope.currentProject.path})`,
|
|
279
|
-
checks,
|
|
280
|
-
nextStep,
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
|
-
export async function buildInspectState(id) {
|
|
284
|
-
const inspection = await explainMemory(id);
|
|
285
|
-
if (!inspection)
|
|
286
|
-
return null;
|
|
287
|
-
return {
|
|
288
|
-
id: inspection.id,
|
|
289
|
-
classification: inspection.classification,
|
|
290
|
-
storageReason: inspection.reasons.join('; ') || 'Stored as durable memory.',
|
|
291
|
-
durability: inspection.classification === 'session-only' ? 'session-only' : 'durable',
|
|
292
|
-
place: inspection.place ?? null,
|
|
293
|
-
placeType: inspection.placeType ?? null,
|
|
294
|
-
graphStatus: inspection.graphStatus ?? null,
|
|
295
|
-
rawFallback: inspection.rawFallbackSnapshotId ?? null,
|
|
296
|
-
wakeUpPriority: inspection.nuanceSuppressed ? 'high' : 'normal',
|
|
297
|
-
metadataAvailability: inspection.legacyMetadata
|
|
298
|
-
? 'Legacy durable record; signal-era metadata is unavailable.'
|
|
299
|
-
: 'Signal metadata available.',
|
|
300
|
-
beliefs: (inspection.beliefs ?? []).map((belief) => ({
|
|
301
|
-
id: belief.id,
|
|
302
|
-
type: belief.type,
|
|
303
|
-
statement: belief.statement,
|
|
304
|
-
status: belief.status,
|
|
305
|
-
confidence: belief.confidence,
|
|
306
|
-
})),
|
|
307
|
-
};
|
|
308
|
-
}
|
|
309
|
-
//# sourceMappingURL=trust-state.js.map
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/** Cron Scheduler - Persistent cron-based job scheduling with fallback support */
|
|
2
|
-
export type JobType = 'nightly' | 'weekly' | 'hourly' | 'daily';
|
|
3
|
-
export type JobStatus = 'success' | 'failed' | 'skipped';
|
|
4
|
-
export interface ScheduledJob {
|
|
5
|
-
id: string;
|
|
6
|
-
jobName: string;
|
|
7
|
-
jobType: JobType;
|
|
8
|
-
cronExpression: string;
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
lastRunAt: Date | null;
|
|
11
|
-
nextRunAt: Date | null;
|
|
12
|
-
jobConfig: Record<string, unknown>;
|
|
13
|
-
}
|
|
14
|
-
export interface JobExecutionContext {
|
|
15
|
-
jobId: string;
|
|
16
|
-
jobName: string;
|
|
17
|
-
jobType: JobType;
|
|
18
|
-
config: Record<string, unknown>;
|
|
19
|
-
startedAt: Date;
|
|
20
|
-
}
|
|
21
|
-
export type JobHandler = (context: JobExecutionContext) => Promise<{
|
|
22
|
-
recordsProcessed: number;
|
|
23
|
-
summary: Record<string, unknown>;
|
|
24
|
-
}>;
|
|
25
|
-
export declare function registerJobHandler(jobName: string, handler: JobHandler): void;
|
|
26
|
-
export declare function initializeScheduler(): Promise<void>;
|
|
27
|
-
export declare function scheduleJob(job: ScheduledJob): Promise<void>;
|
|
28
|
-
export declare function executeJob(job: ScheduledJob): Promise<void>;
|
|
29
|
-
export declare function getScheduledJobs(): Promise<ScheduledJob[]>;
|
|
30
|
-
export declare function getOverdueJobs(): Promise<ScheduledJob[]>;
|
|
31
|
-
export declare function stopAllJobs(): void;
|
|
32
|
-
//# sourceMappingURL=cron-scheduler.d.ts.map
|