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
package/dist/core/mcp/server.js
DELETED
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import express from 'express';
|
|
2
|
-
import cors from 'cors';
|
|
3
|
-
import rateLimit from 'express-rate-limit';
|
|
4
|
-
import { logger } from '../logger.js';
|
|
5
|
-
export class MCPServer {
|
|
6
|
-
app = express();
|
|
7
|
-
httpServer = null;
|
|
8
|
-
tools = new Map();
|
|
9
|
-
port;
|
|
10
|
-
serverName;
|
|
11
|
-
serverVersion;
|
|
12
|
-
constructor(port = 8767, serverName = 'squish-mcp', serverVersion = '0.9.0') {
|
|
13
|
-
this.port = port;
|
|
14
|
-
this.serverName = serverName;
|
|
15
|
-
this.serverVersion = serverVersion;
|
|
16
|
-
this.setupMiddleware();
|
|
17
|
-
this.setupRoutes();
|
|
18
|
-
}
|
|
19
|
-
setupMiddleware() {
|
|
20
|
-
const allowedOrigins = process.env.SQUISH_CORS_ORIGINS?.split(',').map(s => s.trim()) || ['http://localhost:*', 'http://127.0.0.1:*'];
|
|
21
|
-
const appCors = cors({
|
|
22
|
-
origin: (origin, callback) => {
|
|
23
|
-
if (!origin || allowedOrigins.some(allowed => {
|
|
24
|
-
if (allowed.endsWith(':*')) {
|
|
25
|
-
const prefix = allowed.slice(0, -1);
|
|
26
|
-
return origin.startsWith(prefix);
|
|
27
|
-
}
|
|
28
|
-
return origin === allowed;
|
|
29
|
-
})) {
|
|
30
|
-
callback(null, true);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
callback(new Error('Not allowed by CORS'));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const limiter = rateLimit({
|
|
38
|
-
windowMs: 15 * 60 * 1000,
|
|
39
|
-
max: 100,
|
|
40
|
-
message: { error: 'Too many requests, please try again later.' },
|
|
41
|
-
standardHeaders: true,
|
|
42
|
-
legacyHeaders: false,
|
|
43
|
-
});
|
|
44
|
-
this.app.use(appCors);
|
|
45
|
-
this.app.use(limiter);
|
|
46
|
-
this.app.use(express.json());
|
|
47
|
-
}
|
|
48
|
-
setupRoutes() {
|
|
49
|
-
this.app.get('/sse', (req, res) => {
|
|
50
|
-
res.setHeader('Content-Type', 'text/event-stream');
|
|
51
|
-
res.setHeader('Cache-Control', 'no-cache');
|
|
52
|
-
res.setHeader('Connection', 'keep-alive');
|
|
53
|
-
res.flushHeaders();
|
|
54
|
-
res.write('data: {"type":"connected"}\n\n');
|
|
55
|
-
req.on('close', () => {
|
|
56
|
-
logger.info('SSE client disconnected');
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
this.app.post('/initialize', async (req, res) => {
|
|
60
|
-
try {
|
|
61
|
-
const request = req.body;
|
|
62
|
-
const response = {
|
|
63
|
-
protocolVersion: '2024-11-05',
|
|
64
|
-
capabilities: {
|
|
65
|
-
tools: {
|
|
66
|
-
listChanged: true,
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
serverInfo: {
|
|
70
|
-
name: this.serverName,
|
|
71
|
-
version: this.serverVersion,
|
|
72
|
-
},
|
|
73
|
-
};
|
|
74
|
-
res.json(response);
|
|
75
|
-
}
|
|
76
|
-
catch (error) {
|
|
77
|
-
logger.error('Initialize error:', error);
|
|
78
|
-
res.status(400).json({ error: 'Invalid initialize request' });
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
this.app.get('/tools/list', (req, res) => {
|
|
82
|
-
const tools = Array.from(this.tools.values()).map(def => def.tool);
|
|
83
|
-
res.json({ tools });
|
|
84
|
-
});
|
|
85
|
-
this.app.post('/tools/call', async (req, res) => {
|
|
86
|
-
try {
|
|
87
|
-
const { name, arguments: args } = req.body;
|
|
88
|
-
if (!name || typeof name !== 'string') {
|
|
89
|
-
return res.status(400).json({ error: 'Tool name required' });
|
|
90
|
-
}
|
|
91
|
-
const toolDef = this.tools.get(name);
|
|
92
|
-
if (!toolDef) {
|
|
93
|
-
return res.status(404).json({ error: `Tool not found: ${name}` });
|
|
94
|
-
}
|
|
95
|
-
const result = await toolDef.handler(args || {});
|
|
96
|
-
res.json(result);
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
logger.error('Tool call error:', error);
|
|
100
|
-
res.status(500).json({
|
|
101
|
-
error: error instanceof Error ? error.message : 'Tool execution failed'
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
this.app.get('/health', (req, res) => {
|
|
106
|
-
res.json({
|
|
107
|
-
status: 'ok',
|
|
108
|
-
server: this.serverName,
|
|
109
|
-
version: this.serverVersion,
|
|
110
|
-
tools: this.tools.size
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
registerTool(definition) {
|
|
115
|
-
this.tools.set(definition.tool.name, definition);
|
|
116
|
-
logger.info(`Registered MCP tool: ${definition.tool.name}`);
|
|
117
|
-
}
|
|
118
|
-
registerTools(definitions) {
|
|
119
|
-
definitions.forEach(def => this.registerTool(def));
|
|
120
|
-
}
|
|
121
|
-
async start() {
|
|
122
|
-
return new Promise((resolve, reject) => {
|
|
123
|
-
this.httpServer = this.app.listen(this.port, () => {
|
|
124
|
-
logger.info(`MCP server listening on port ${this.port}`);
|
|
125
|
-
logger.info(`SSE endpoint: http://localhost:${this.port}/sse`);
|
|
126
|
-
logger.info(`Tools available: ${this.tools.size}`);
|
|
127
|
-
resolve();
|
|
128
|
-
});
|
|
129
|
-
this.httpServer.on('error', (error) => {
|
|
130
|
-
logger.error('MCP server error:', error);
|
|
131
|
-
reject(error);
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
async stop() {
|
|
136
|
-
return new Promise((resolve, reject) => {
|
|
137
|
-
if (!this.httpServer) {
|
|
138
|
-
resolve();
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
this.httpServer.close((error) => {
|
|
142
|
-
if (error) {
|
|
143
|
-
logger.error('Error stopping MCP server:', error);
|
|
144
|
-
reject(error);
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
logger.info('MCP server stopped');
|
|
148
|
-
resolve();
|
|
149
|
-
}
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
getToolCount() {
|
|
154
|
-
return this.tools.size;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
//# sourceMappingURL=server.js.map
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MCPServer } from './server.js';
|
|
2
|
-
export declare class SquishMCPServer {
|
|
3
|
-
private server;
|
|
4
|
-
constructor();
|
|
5
|
-
initialize(): Promise<void>;
|
|
6
|
-
start(): Promise<void>;
|
|
7
|
-
stop(): Promise<void>;
|
|
8
|
-
getServer(): MCPServer;
|
|
9
|
-
}
|
|
10
|
-
export declare function getSquishMCPServer(): Promise<SquishMCPServer>;
|
|
11
|
-
export declare function startMCPServer(): Promise<SquishMCPServer>;
|
|
12
|
-
export declare function stopMCPServer(): Promise<void>;
|
|
13
|
-
//# sourceMappingURL=standalone-server.d.ts.map
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { MCPServer } from './server.js';
|
|
2
|
-
import { getAllSquishTools } from './tools.js';
|
|
3
|
-
import { logger } from '../logger.js';
|
|
4
|
-
import { config } from '../../config.js';
|
|
5
|
-
export class SquishMCPServer {
|
|
6
|
-
server;
|
|
7
|
-
constructor() {
|
|
8
|
-
this.server = new MCPServer(config.mcpServerPort || 8767, 'squish-mcp', '0.9.0');
|
|
9
|
-
}
|
|
10
|
-
async initialize() {
|
|
11
|
-
const tools = getAllSquishTools();
|
|
12
|
-
this.server.registerTools(tools);
|
|
13
|
-
logger.info(`Squish MCP server initialized with ${tools.length} tools`);
|
|
14
|
-
}
|
|
15
|
-
async start() {
|
|
16
|
-
await this.server.start();
|
|
17
|
-
logger.info(`Squish MCP server started on port ${config.mcpServerPort || 8767}`);
|
|
18
|
-
}
|
|
19
|
-
async stop() {
|
|
20
|
-
await this.server.stop();
|
|
21
|
-
logger.info('Squish MCP server stopped');
|
|
22
|
-
}
|
|
23
|
-
getServer() {
|
|
24
|
-
return this.server;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
let serverInstance = null;
|
|
28
|
-
export async function getSquishMCPServer() {
|
|
29
|
-
if (!serverInstance) {
|
|
30
|
-
serverInstance = new SquishMCPServer();
|
|
31
|
-
await serverInstance.initialize();
|
|
32
|
-
}
|
|
33
|
-
return serverInstance;
|
|
34
|
-
}
|
|
35
|
-
export async function startMCPServer() {
|
|
36
|
-
const server = await getSquishMCPServer();
|
|
37
|
-
await server.start();
|
|
38
|
-
return server;
|
|
39
|
-
}
|
|
40
|
-
export async function stopMCPServer() {
|
|
41
|
-
if (serverInstance) {
|
|
42
|
-
await serverInstance.stop();
|
|
43
|
-
serverInstance = null;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
//# sourceMappingURL=standalone-server.js.map
|
package/dist/core/mcp/tools.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MCPToolDefinition } from './types.js';
|
|
2
|
-
export declare const squishSearchTool: MCPToolDefinition;
|
|
3
|
-
export declare const squishRememberTool: MCPToolDefinition;
|
|
4
|
-
export declare const squishRecallTool: MCPToolDefinition;
|
|
5
|
-
export declare const squishHealthTool: MCPToolDefinition;
|
|
6
|
-
export declare function getAllSquishTools(): MCPToolDefinition[];
|
|
7
|
-
//# sourceMappingURL=tools.d.ts.map
|
package/dist/core/mcp/tools.js
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { hybridSearch } from '../memory/hybrid-retrieval.js';
|
|
2
|
-
import { rememberMemory, getMemory } from '../memory/memories.js';
|
|
3
|
-
import { getQMDClient } from '../embeddings/qmd-client.js';
|
|
4
|
-
import { logger } from '../logger.js';
|
|
5
|
-
function textResult(text) {
|
|
6
|
-
return {
|
|
7
|
-
content: [{ type: 'text', text }],
|
|
8
|
-
};
|
|
9
|
-
}
|
|
10
|
-
function errorResult(error) {
|
|
11
|
-
return {
|
|
12
|
-
content: [{ type: 'text', text: `Error: ${error}` }],
|
|
13
|
-
isError: true,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export const squishSearchTool = {
|
|
17
|
-
tool: {
|
|
18
|
-
name: 'squish_search',
|
|
19
|
-
description: 'Search Squish memory using hybrid scoring (semantic + recency + importance)',
|
|
20
|
-
inputSchema: {
|
|
21
|
-
type: 'object',
|
|
22
|
-
properties: {
|
|
23
|
-
query: {
|
|
24
|
-
type: 'string',
|
|
25
|
-
description: 'Search query',
|
|
26
|
-
},
|
|
27
|
-
limit: {
|
|
28
|
-
type: 'number',
|
|
29
|
-
description: 'Maximum results to return (default: 5)',
|
|
30
|
-
},
|
|
31
|
-
project: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'Project path filter',
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
required: ['query'],
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
handler: async (args) => {
|
|
40
|
-
try {
|
|
41
|
-
const { query, limit = 5, project } = args;
|
|
42
|
-
if (!query) {
|
|
43
|
-
return errorResult('Query is required');
|
|
44
|
-
}
|
|
45
|
-
const results = await hybridSearch({
|
|
46
|
-
query,
|
|
47
|
-
limit,
|
|
48
|
-
project,
|
|
49
|
-
candidateLimit: 50,
|
|
50
|
-
resultLimit: limit,
|
|
51
|
-
});
|
|
52
|
-
const formatted = results.map((r, i) => `${i + 1}. [${r.type || 'memory'}] ${r.content?.substring(0, 200)}... (score: ${r.hybridScore?.toFixed(2)})`).join('\n');
|
|
53
|
-
return textResult(`Found ${results.length} memories:\n\n${formatted}`);
|
|
54
|
-
}
|
|
55
|
-
catch (error) {
|
|
56
|
-
logger.error('Search error:', error);
|
|
57
|
-
return errorResult(error instanceof Error ? error.message : 'Search failed');
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
};
|
|
61
|
-
export const squishRememberTool = {
|
|
62
|
-
tool: {
|
|
63
|
-
name: 'squish_remember',
|
|
64
|
-
description: 'Store a new memory in Squish',
|
|
65
|
-
inputSchema: {
|
|
66
|
-
type: 'object',
|
|
67
|
-
properties: {
|
|
68
|
-
content: {
|
|
69
|
-
type: 'string',
|
|
70
|
-
description: 'Memory content to store',
|
|
71
|
-
},
|
|
72
|
-
type: {
|
|
73
|
-
type: 'string',
|
|
74
|
-
description: 'Memory type (observation, fact, decision, context, preference)',
|
|
75
|
-
},
|
|
76
|
-
tags: {
|
|
77
|
-
type: 'array',
|
|
78
|
-
items: { type: 'string' },
|
|
79
|
-
description: 'Optional tags',
|
|
80
|
-
},
|
|
81
|
-
project: {
|
|
82
|
-
type: 'string',
|
|
83
|
-
description: 'Project path',
|
|
84
|
-
},
|
|
85
|
-
// Rich context fields (Agent 4 feedback)
|
|
86
|
-
source: {
|
|
87
|
-
type: 'string',
|
|
88
|
-
description: 'Source of this memory (e.g., "voice", "chat", "document")',
|
|
89
|
-
},
|
|
90
|
-
reasoning: {
|
|
91
|
-
type: 'string',
|
|
92
|
-
description: 'Why this memory is important',
|
|
93
|
-
},
|
|
94
|
-
context: {
|
|
95
|
-
type: 'string',
|
|
96
|
-
description: 'What triggered this memory',
|
|
97
|
-
},
|
|
98
|
-
examples: {
|
|
99
|
-
type: 'string',
|
|
100
|
-
description: 'When to apply this knowledge',
|
|
101
|
-
},
|
|
102
|
-
exceptions: {
|
|
103
|
-
type: 'string',
|
|
104
|
-
description: 'When NOT to apply this',
|
|
105
|
-
},
|
|
106
|
-
tier: {
|
|
107
|
-
type: 'string',
|
|
108
|
-
description: 'Memory tier: hot (active) or cold (archived)',
|
|
109
|
-
enum: ['hot', 'cold'],
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
required: ['content'],
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
handler: async (args) => {
|
|
116
|
-
try {
|
|
117
|
-
const { content, type = 'observation', tags = [], project, source, reasoning, context, examples, exceptions, tier = 'hot' } = args;
|
|
118
|
-
if (!content) {
|
|
119
|
-
return errorResult('Content is required');
|
|
120
|
-
}
|
|
121
|
-
const memory = await rememberMemory({
|
|
122
|
-
content,
|
|
123
|
-
type,
|
|
124
|
-
tags,
|
|
125
|
-
project,
|
|
126
|
-
source,
|
|
127
|
-
reasoning,
|
|
128
|
-
memoryContext: context,
|
|
129
|
-
examples,
|
|
130
|
-
exceptions,
|
|
131
|
-
tier,
|
|
132
|
-
});
|
|
133
|
-
return textResult(`Memory stored: ${memory.id}`);
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
logger.error('Remember error:', error);
|
|
137
|
-
return errorResult(error instanceof Error ? error.message : 'Failed to store memory');
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
};
|
|
141
|
-
export const squishRecallTool = {
|
|
142
|
-
tool: {
|
|
143
|
-
name: 'squish_recall',
|
|
144
|
-
description: 'Retrieve a specific memory by ID',
|
|
145
|
-
inputSchema: {
|
|
146
|
-
type: 'object',
|
|
147
|
-
properties: {
|
|
148
|
-
memoryId: {
|
|
149
|
-
type: 'string',
|
|
150
|
-
description: 'Memory ID to retrieve',
|
|
151
|
-
},
|
|
152
|
-
},
|
|
153
|
-
required: ['memoryId'],
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
handler: async (args) => {
|
|
157
|
-
try {
|
|
158
|
-
const { memoryId } = args;
|
|
159
|
-
if (!memoryId) {
|
|
160
|
-
return errorResult('Memory ID is required');
|
|
161
|
-
}
|
|
162
|
-
const memory = await getMemory(memoryId);
|
|
163
|
-
if (!memory) {
|
|
164
|
-
return errorResult('Memory not found');
|
|
165
|
-
}
|
|
166
|
-
return textResult(JSON.stringify(memory, null, 2));
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
logger.error('Recall error:', error);
|
|
170
|
-
return errorResult(error instanceof Error ? error.message : 'Failed to retrieve memory');
|
|
171
|
-
}
|
|
172
|
-
},
|
|
173
|
-
};
|
|
174
|
-
export const squishHealthTool = {
|
|
175
|
-
tool: {
|
|
176
|
-
name: 'squish_health',
|
|
177
|
-
description: 'Check Squish health status',
|
|
178
|
-
inputSchema: {
|
|
179
|
-
type: 'object',
|
|
180
|
-
properties: {},
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
handler: async (args) => {
|
|
184
|
-
try {
|
|
185
|
-
const qmdClient = await getQMDClient();
|
|
186
|
-
const qmdAvailable = await qmdClient.isAvailable();
|
|
187
|
-
return textResult(JSON.stringify({
|
|
188
|
-
status: 'ok',
|
|
189
|
-
version: '0.9.0',
|
|
190
|
-
qmd: qmdAvailable ? 'available' : 'unavailable',
|
|
191
|
-
timestamp: new Date().toISOString(),
|
|
192
|
-
}, null, 2));
|
|
193
|
-
}
|
|
194
|
-
catch (error) {
|
|
195
|
-
return errorResult(error instanceof Error ? error.message : 'Health check failed');
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
};
|
|
199
|
-
const squishGetSearchTracesTool = {
|
|
200
|
-
tool: {
|
|
201
|
-
name: 'squish_get_search_traces',
|
|
202
|
-
description: 'Get recent search traces for debugging and performance analysis',
|
|
203
|
-
inputSchema: {
|
|
204
|
-
type: 'object',
|
|
205
|
-
properties: {
|
|
206
|
-
limit: {
|
|
207
|
-
type: 'number',
|
|
208
|
-
description: 'Maximum traces to return (default: 10)',
|
|
209
|
-
},
|
|
210
|
-
sessionId: {
|
|
211
|
-
type: 'string',
|
|
212
|
-
description: 'Session ID filter',
|
|
213
|
-
},
|
|
214
|
-
},
|
|
215
|
-
required: [],
|
|
216
|
-
},
|
|
217
|
-
},
|
|
218
|
-
handler: async (args) => {
|
|
219
|
-
try {
|
|
220
|
-
const { limit = 10, sessionId } = args;
|
|
221
|
-
const collectorModule = await import('../tracing/collector.js');
|
|
222
|
-
const { getTraces } = collectorModule;
|
|
223
|
-
const traces = await getTraces({ limit, sessionId });
|
|
224
|
-
const formatted = traces.map((t, i) => `${i + 1}. [${t.id.substring(0, 8)}] Query: "${t.query.substring(0, 50)}" Duration: ${t.totalDurationMs}ms`).join('\n');
|
|
225
|
-
return textResult(`Found ${traces.length} traces:\n\n${formatted}`);
|
|
226
|
-
}
|
|
227
|
-
catch (error) {
|
|
228
|
-
logger.error('Get search traces error:', error);
|
|
229
|
-
return errorResult(error instanceof Error ? error.message : 'Get traces failed');
|
|
230
|
-
}
|
|
231
|
-
},
|
|
232
|
-
};
|
|
233
|
-
const squishGetTraceByIdTool = {
|
|
234
|
-
tool: {
|
|
235
|
-
name: 'squish_get_trace_by_id',
|
|
236
|
-
description: 'Get a specific search trace by ID with full stage details',
|
|
237
|
-
inputSchema: {
|
|
238
|
-
type: 'object',
|
|
239
|
-
properties: {
|
|
240
|
-
traceId: {
|
|
241
|
-
type: 'string',
|
|
242
|
-
description: 'Trace ID to retrieve',
|
|
243
|
-
},
|
|
244
|
-
},
|
|
245
|
-
required: ['traceId'],
|
|
246
|
-
},
|
|
247
|
-
},
|
|
248
|
-
handler: async (args) => {
|
|
249
|
-
try {
|
|
250
|
-
const { traceId } = args;
|
|
251
|
-
const collectorModule = await import('../tracing/collector.js');
|
|
252
|
-
const { getTraceById } = collectorModule;
|
|
253
|
-
const visualizerModule = await import('../tracing/visualizer.js');
|
|
254
|
-
const { visualizeTrace } = visualizerModule;
|
|
255
|
-
const trace = await getTraceById(traceId);
|
|
256
|
-
if (!trace) {
|
|
257
|
-
return errorResult('Trace not found');
|
|
258
|
-
}
|
|
259
|
-
const visualization = visualizeTrace(trace);
|
|
260
|
-
return textResult(`\n${visualization}\n`);
|
|
261
|
-
}
|
|
262
|
-
catch (error) {
|
|
263
|
-
logger.error('Get trace by ID error:', error);
|
|
264
|
-
return errorResult(error instanceof Error ? error.message : 'Get trace by ID failed');
|
|
265
|
-
}
|
|
266
|
-
},
|
|
267
|
-
};
|
|
268
|
-
export function getAllSquishTools() {
|
|
269
|
-
return [
|
|
270
|
-
squishSearchTool,
|
|
271
|
-
squishRememberTool,
|
|
272
|
-
squishRecallTool,
|
|
273
|
-
squishHealthTool,
|
|
274
|
-
squishGetSearchTracesTool,
|
|
275
|
-
squishGetTraceByIdTool,
|
|
276
|
-
];
|
|
277
|
-
}
|
|
278
|
-
//# sourceMappingURL=tools.js.map
|
package/dist/core/mcp/types.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export declare const MCPToolSchema: z.ZodObject<{
|
|
3
|
-
name: z.ZodString;
|
|
4
|
-
description: z.ZodString;
|
|
5
|
-
inputSchema: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
6
|
-
}, z.core.$strip>;
|
|
7
|
-
export declare const MCPToolCallSchema: z.ZodObject<{
|
|
8
|
-
name: z.ZodString;
|
|
9
|
-
arguments: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
export declare const MCPToolResultSchema: z.ZodObject<{
|
|
12
|
-
content: z.ZodArray<z.ZodObject<{
|
|
13
|
-
type: z.ZodEnum<{
|
|
14
|
-
text: "text";
|
|
15
|
-
image: "image";
|
|
16
|
-
resource: "resource";
|
|
17
|
-
}>;
|
|
18
|
-
text: z.ZodOptional<z.ZodString>;
|
|
19
|
-
data: z.ZodOptional<z.ZodString>;
|
|
20
|
-
mimeType: z.ZodOptional<z.ZodString>;
|
|
21
|
-
}, z.core.$strip>>;
|
|
22
|
-
isError: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
-
}, z.core.$strip>;
|
|
24
|
-
export declare const MCPCapabilitiesSchema: z.ZodObject<{
|
|
25
|
-
tools: z.ZodOptional<z.ZodObject<{
|
|
26
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
-
}, z.core.$strip>>;
|
|
28
|
-
resources: z.ZodOptional<z.ZodObject<{
|
|
29
|
-
subscribe: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
31
|
-
}, z.core.$strip>>;
|
|
32
|
-
prompts: z.ZodOptional<z.ZodObject<{
|
|
33
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
34
|
-
}, z.core.$strip>>;
|
|
35
|
-
}, z.core.$strip>;
|
|
36
|
-
export declare const MCPInitializeRequestSchema: z.ZodObject<{
|
|
37
|
-
protocolVersion: z.ZodString;
|
|
38
|
-
capabilities: z.ZodObject<{
|
|
39
|
-
tools: z.ZodOptional<z.ZodObject<{
|
|
40
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
41
|
-
}, z.core.$strip>>;
|
|
42
|
-
resources: z.ZodOptional<z.ZodObject<{
|
|
43
|
-
subscribe: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
-
}, z.core.$strip>>;
|
|
46
|
-
prompts: z.ZodOptional<z.ZodObject<{
|
|
47
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
48
|
-
}, z.core.$strip>>;
|
|
49
|
-
}, z.core.$strip>;
|
|
50
|
-
clientInfo: z.ZodObject<{
|
|
51
|
-
name: z.ZodString;
|
|
52
|
-
version: z.ZodString;
|
|
53
|
-
}, z.core.$strip>;
|
|
54
|
-
}, z.core.$strip>;
|
|
55
|
-
export declare const MCPInitializeResponseSchema: z.ZodObject<{
|
|
56
|
-
protocolVersion: z.ZodString;
|
|
57
|
-
capabilities: z.ZodObject<{
|
|
58
|
-
tools: z.ZodOptional<z.ZodObject<{
|
|
59
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
-
}, z.core.$strip>>;
|
|
61
|
-
resources: z.ZodOptional<z.ZodObject<{
|
|
62
|
-
subscribe: z.ZodOptional<z.ZodBoolean>;
|
|
63
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
64
|
-
}, z.core.$strip>>;
|
|
65
|
-
prompts: z.ZodOptional<z.ZodObject<{
|
|
66
|
-
listChanged: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
-
}, z.core.$strip>>;
|
|
68
|
-
}, z.core.$strip>;
|
|
69
|
-
serverInfo: z.ZodObject<{
|
|
70
|
-
name: z.ZodString;
|
|
71
|
-
version: z.ZodString;
|
|
72
|
-
}, z.core.$strip>;
|
|
73
|
-
}, z.core.$strip>;
|
|
74
|
-
export type MCPTool = z.infer<typeof MCPToolSchema>;
|
|
75
|
-
export type MCPToolCall = z.infer<typeof MCPToolCallSchema>;
|
|
76
|
-
export type MCPToolResult = z.infer<typeof MCPToolResultSchema>;
|
|
77
|
-
export type MCPCapabilities = z.infer<typeof MCPCapabilitiesSchema>;
|
|
78
|
-
export type MCPInitializeRequest = z.infer<typeof MCPInitializeRequestSchema>;
|
|
79
|
-
export type MCPInitializeResponse = z.infer<typeof MCPInitializeResponseSchema>;
|
|
80
|
-
export interface MCPToolHandler {
|
|
81
|
-
(args: Record<string, any>): Promise<MCPToolResult>;
|
|
82
|
-
}
|
|
83
|
-
export interface MCPToolDefinition {
|
|
84
|
-
tool: MCPTool;
|
|
85
|
-
handler: MCPToolHandler;
|
|
86
|
-
}
|
|
87
|
-
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/mcp/types.js
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
export const MCPToolSchema = z.object({
|
|
3
|
-
name: z.string(),
|
|
4
|
-
description: z.string(),
|
|
5
|
-
inputSchema: z.record(z.string(), z.any()),
|
|
6
|
-
});
|
|
7
|
-
export const MCPToolCallSchema = z.object({
|
|
8
|
-
name: z.string(),
|
|
9
|
-
arguments: z.record(z.string(), z.any()),
|
|
10
|
-
});
|
|
11
|
-
export const MCPToolResultSchema = z.object({
|
|
12
|
-
content: z.array(z.object({
|
|
13
|
-
type: z.enum(['text', 'image', 'resource']),
|
|
14
|
-
text: z.string().optional(),
|
|
15
|
-
data: z.string().optional(),
|
|
16
|
-
mimeType: z.string().optional(),
|
|
17
|
-
})),
|
|
18
|
-
isError: z.boolean().optional(),
|
|
19
|
-
});
|
|
20
|
-
export const MCPCapabilitiesSchema = z.object({
|
|
21
|
-
tools: z.object({
|
|
22
|
-
listChanged: z.boolean().optional(),
|
|
23
|
-
}).optional(),
|
|
24
|
-
resources: z.object({
|
|
25
|
-
subscribe: z.boolean().optional(),
|
|
26
|
-
listChanged: z.boolean().optional(),
|
|
27
|
-
}).optional(),
|
|
28
|
-
prompts: z.object({
|
|
29
|
-
listChanged: z.boolean().optional(),
|
|
30
|
-
}).optional(),
|
|
31
|
-
});
|
|
32
|
-
export const MCPInitializeRequestSchema = z.object({
|
|
33
|
-
protocolVersion: z.string(),
|
|
34
|
-
capabilities: MCPCapabilitiesSchema,
|
|
35
|
-
clientInfo: z.object({
|
|
36
|
-
name: z.string(),
|
|
37
|
-
version: z.string(),
|
|
38
|
-
}),
|
|
39
|
-
});
|
|
40
|
-
export const MCPInitializeResponseSchema = z.object({
|
|
41
|
-
protocolVersion: z.string(),
|
|
42
|
-
capabilities: MCPCapabilitiesSchema,
|
|
43
|
-
serverInfo: z.object({
|
|
44
|
-
name: z.string(),
|
|
45
|
-
version: z.string(),
|
|
46
|
-
}),
|
|
47
|
-
});
|
|
48
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bridge Discovery
|
|
3
|
-
* Discovers indirect connections between memories through shared associations
|
|
4
|
-
* Uses bidirectional BFS with Dijkstra-style weight prioritization
|
|
5
|
-
* Finds "waypoint" memories that connect otherwise distant memory clusters
|
|
6
|
-
*/
|
|
7
|
-
export interface BridgePath {
|
|
8
|
-
route: string[];
|
|
9
|
-
distance: number;
|
|
10
|
-
weight: number;
|
|
11
|
-
associationTypes: string[];
|
|
12
|
-
}
|
|
13
|
-
export interface BridgeMemory {
|
|
14
|
-
memoryId: string;
|
|
15
|
-
memory: any;
|
|
16
|
-
bridgeScore: number;
|
|
17
|
-
pathsThrough: number;
|
|
18
|
-
examplePaths: BridgePath[];
|
|
19
|
-
connectionDensity: number;
|
|
20
|
-
importance: 'critical' | 'major' | 'minor';
|
|
21
|
-
}
|
|
22
|
-
export interface BridgeOptions {
|
|
23
|
-
maxPathLength?: number;
|
|
24
|
-
topBridges?: number;
|
|
25
|
-
minPathWeight?: number;
|
|
26
|
-
includeExamplePaths?: boolean;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Discover bridge memories connecting seed memory clusters
|
|
30
|
-
*/
|
|
31
|
-
export declare function discoverBridges(seedMemoryIds: string[], projectId: string, options?: BridgeOptions): Promise<BridgeMemory[]>;
|
|
32
|
-
/**
|
|
33
|
-
* Get bridge memories for a single memory (find what it connects to)
|
|
34
|
-
*/
|
|
35
|
-
export declare function getMemoryBridges(memoryId: string, projectId: string, topK?: number): Promise<BridgeMemory[]>;
|
|
36
|
-
/**
|
|
37
|
-
* Analyze overall network connectivity using bridge metrics
|
|
38
|
-
*/
|
|
39
|
-
export declare function analyzeNetworkConnectivity(projectId: string, topBridges?: number): Promise<{
|
|
40
|
-
totalMemories: number;
|
|
41
|
-
totalConnections: number;
|
|
42
|
-
averageDegree: number;
|
|
43
|
-
bridgeMemories: BridgeMemory[];
|
|
44
|
-
networkDensity: number;
|
|
45
|
-
clustering: {
|
|
46
|
-
tightClusters: number;
|
|
47
|
-
looseClusters: number;
|
|
48
|
-
};
|
|
49
|
-
}>;
|
|
50
|
-
//# sourceMappingURL=bridge-discovery.d.ts.map
|