opcode-pg-memory 2.2.5 → 2.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/cli.js +42 -2
- package/dist/index.js +185 -174
- package/dist/mcp-server.js +107 -61
- package/dist/src/db/init-db.d.ts +1 -0
- package/dist/src/db/init-db.d.ts.map +1 -1
- package/dist/src/hooks/message-part-updated.d.ts.map +1 -1
- package/dist/src/hooks/message-updated.d.ts.map +1 -1
- package/dist/src/hooks/session-compacting.d.ts.map +1 -1
- package/dist/src/hooks/session-completed.d.ts.map +1 -1
- package/dist/src/hooks/session-created.d.ts.map +1 -1
- package/dist/src/hooks/tool-execute.d.ts.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/mcp/hindsight-reflect-omo.d.ts.map +1 -1
- package/dist/src/mcp/hindsight-reflect.d.ts.map +1 -1
- package/dist/src/mcp/recall-memory-omo.d.ts.map +1 -1
- package/dist/src/mcp/recall-memory.d.ts.map +1 -1
- package/package.json +70 -68
package/dist/mcp-server.js
CHANGED
|
@@ -16062,6 +16062,48 @@ var defaults = import_lib.default.defaults;
|
|
|
16062
16062
|
|
|
16063
16063
|
// src/db/init-db.ts
|
|
16064
16064
|
var import_pgvector = __toESM(require_src(), 1);
|
|
16065
|
+
|
|
16066
|
+
// src/services/logger.ts
|
|
16067
|
+
var LEVEL_MAP = {
|
|
16068
|
+
debug: 0,
|
|
16069
|
+
info: 1,
|
|
16070
|
+
warn: 2,
|
|
16071
|
+
error: 3
|
|
16072
|
+
};
|
|
16073
|
+
var LEVEL_NAMES = {
|
|
16074
|
+
debug: "DEBUG",
|
|
16075
|
+
info: "INFO",
|
|
16076
|
+
warn: "WARN",
|
|
16077
|
+
error: "ERROR"
|
|
16078
|
+
};
|
|
16079
|
+
function getConfiguredLevel() {
|
|
16080
|
+
const env = process.env.PG_MEMORY_LOG_LEVEL ?? "info";
|
|
16081
|
+
const level = env.toLowerCase();
|
|
16082
|
+
if (level in LEVEL_MAP) {
|
|
16083
|
+
return LEVEL_MAP[level];
|
|
16084
|
+
}
|
|
16085
|
+
return LEVEL_MAP.info;
|
|
16086
|
+
}
|
|
16087
|
+
var currentLevel = getConfiguredLevel();
|
|
16088
|
+
function log(level, module, msg, data) {
|
|
16089
|
+
if (currentLevel > LEVEL_MAP[level]) {
|
|
16090
|
+
return;
|
|
16091
|
+
}
|
|
16092
|
+
const line = data !== undefined ? `[PG Memory] [${LEVEL_NAMES[level]}] [${module}] ${msg} ${JSON.stringify(data)}
|
|
16093
|
+
` : `[PG Memory] [${LEVEL_NAMES[level]}] [${module}] ${msg}
|
|
16094
|
+
`;
|
|
16095
|
+
process.stderr.write(line);
|
|
16096
|
+
}
|
|
16097
|
+
function createLogger(module) {
|
|
16098
|
+
return {
|
|
16099
|
+
debug: (msg, data) => log("debug", module, msg, data),
|
|
16100
|
+
info: (msg, data) => log("info", module, msg, data),
|
|
16101
|
+
warn: (msg, data) => log("warn", module, msg, data),
|
|
16102
|
+
error: (msg, data) => log("error", module, msg, data)
|
|
16103
|
+
};
|
|
16104
|
+
}
|
|
16105
|
+
|
|
16106
|
+
// src/db/init-db.ts
|
|
16065
16107
|
var DEFAULT_DB_CONFIG = {
|
|
16066
16108
|
host: process.env.PG_HOST || "localhost",
|
|
16067
16109
|
port: parseInt(process.env.PG_PORT || "5432", 10),
|
|
@@ -16075,6 +16117,7 @@ var DEFAULT_DB_CONFIG = {
|
|
|
16075
16117
|
class DatabaseInitializer {
|
|
16076
16118
|
pool = null;
|
|
16077
16119
|
config;
|
|
16120
|
+
logger = createLogger("init-db");
|
|
16078
16121
|
constructor(config = {}) {
|
|
16079
16122
|
this.config = { ...DEFAULT_DB_CONFIG, ...config };
|
|
16080
16123
|
}
|
|
@@ -16101,9 +16144,9 @@ class DatabaseInitializer {
|
|
|
16101
16144
|
const client = await this.pool.connect();
|
|
16102
16145
|
const result = await client.query("SELECT NOW() as now");
|
|
16103
16146
|
client.release();
|
|
16104
|
-
|
|
16147
|
+
this.logger.info("Database connected:", result.rows[0].now);
|
|
16105
16148
|
} catch (error) {
|
|
16106
|
-
|
|
16149
|
+
this.logger.error("Database connection failed:", error);
|
|
16107
16150
|
throw new Error(`Failed to connect to PostgreSQL: ${error}`);
|
|
16108
16151
|
}
|
|
16109
16152
|
}
|
|
@@ -16119,10 +16162,10 @@ class DatabaseInitializer {
|
|
|
16119
16162
|
await this.migrateSessionsData(client);
|
|
16120
16163
|
await this.initializeOmOSchema(client);
|
|
16121
16164
|
await client.query("COMMIT");
|
|
16122
|
-
|
|
16165
|
+
this.logger.info("Database schema initialized successfully");
|
|
16123
16166
|
} catch (error) {
|
|
16124
16167
|
await client.query("ROLLBACK");
|
|
16125
|
-
|
|
16168
|
+
this.logger.error("Database setup failed:", error);
|
|
16126
16169
|
throw error;
|
|
16127
16170
|
} finally {
|
|
16128
16171
|
client.release();
|
|
@@ -16133,7 +16176,7 @@ class DatabaseInitializer {
|
|
|
16133
16176
|
CREATE EXTENSION IF NOT EXISTS vector;
|
|
16134
16177
|
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
|
16135
16178
|
`);
|
|
16136
|
-
|
|
16179
|
+
this.logger.info("Extensions created");
|
|
16137
16180
|
}
|
|
16138
16181
|
async createEnums(client) {
|
|
16139
16182
|
await client.query(`
|
|
@@ -16148,7 +16191,7 @@ class DatabaseInitializer {
|
|
|
16148
16191
|
END IF;
|
|
16149
16192
|
END $$;
|
|
16150
16193
|
`);
|
|
16151
|
-
|
|
16194
|
+
this.logger.info("Enums created");
|
|
16152
16195
|
}
|
|
16153
16196
|
async createTables(client) {
|
|
16154
16197
|
await client.query(`
|
|
@@ -16287,7 +16330,7 @@ class DatabaseInitializer {
|
|
|
16287
16330
|
created_at TIMESTAMPTZ DEFAULT NOW()
|
|
16288
16331
|
);
|
|
16289
16332
|
`);
|
|
16290
|
-
|
|
16333
|
+
this.logger.info("Tables created");
|
|
16291
16334
|
}
|
|
16292
16335
|
async createIndexes(client) {
|
|
16293
16336
|
await client.query(`
|
|
@@ -16381,7 +16424,7 @@ class DatabaseInitializer {
|
|
|
16381
16424
|
DROP INDEX IF EXISTS idx_reflection_errors_session;
|
|
16382
16425
|
DROP INDEX IF EXISTS idx_token_usage_session;
|
|
16383
16426
|
`);
|
|
16384
|
-
|
|
16427
|
+
this.logger.info("Indexes created");
|
|
16385
16428
|
}
|
|
16386
16429
|
async migrateLegacyColumnNames(client) {
|
|
16387
16430
|
const tables = [
|
|
@@ -16407,13 +16450,13 @@ class DatabaseInitializer {
|
|
|
16407
16450
|
await client.query(`
|
|
16408
16451
|
ALTER TABLE "${table}" RENAME COLUMN session_id TO session_map_id
|
|
16409
16452
|
`);
|
|
16410
|
-
|
|
16453
|
+
this.logger.info(`Renamed ${table}.session_id → session_map_id`);
|
|
16411
16454
|
}
|
|
16412
16455
|
} catch (err) {
|
|
16413
|
-
|
|
16456
|
+
this.logger.info(`Skipped column rename for ${table}: ${err}`);
|
|
16414
16457
|
}
|
|
16415
16458
|
}
|
|
16416
|
-
|
|
16459
|
+
this.logger.info("Legacy column migration complete");
|
|
16417
16460
|
}
|
|
16418
16461
|
async migrateSessionsData(client) {
|
|
16419
16462
|
try {
|
|
@@ -16422,7 +16465,7 @@ class DatabaseInitializer {
|
|
|
16422
16465
|
WHERE table_schema = 'public' AND table_name = 'sessions'
|
|
16423
16466
|
`);
|
|
16424
16467
|
if (exists.rows.length === 0) {
|
|
16425
|
-
|
|
16468
|
+
this.logger.info("No legacy sessions table found, skipping migration");
|
|
16426
16469
|
return;
|
|
16427
16470
|
}
|
|
16428
16471
|
await client.query(`
|
|
@@ -16434,18 +16477,18 @@ class DatabaseInitializer {
|
|
|
16434
16477
|
FROM sessions
|
|
16435
16478
|
ON CONFLICT (opencode_session_id) DO NOTHING;
|
|
16436
16479
|
`);
|
|
16437
|
-
|
|
16480
|
+
this.logger.info("Legacy sessions data migrated to session_map");
|
|
16438
16481
|
} catch (error) {
|
|
16439
|
-
|
|
16482
|
+
this.logger.warn("Sessions migration warning (non-fatal):", error);
|
|
16440
16483
|
}
|
|
16441
16484
|
}
|
|
16442
16485
|
async initializeOmOSchema(client) {
|
|
16443
16486
|
const omOEnabled = process.env.OMO_ENABLED === "true" || process.env.OMO_INTEGRATION === "enabled";
|
|
16444
16487
|
if (!omOEnabled) {
|
|
16445
|
-
|
|
16488
|
+
this.logger.info("OmO integration not enabled, skipping OmO schema");
|
|
16446
16489
|
return;
|
|
16447
16490
|
}
|
|
16448
|
-
|
|
16491
|
+
this.logger.info("Initializing OmO schema...");
|
|
16449
16492
|
const tablesWithAgent = ["observations", "semantic_cache", "entities", "reflections"];
|
|
16450
16493
|
for (const table of tablesWithAgent) {
|
|
16451
16494
|
try {
|
|
@@ -16461,7 +16504,7 @@ class DatabaseInitializer {
|
|
|
16461
16504
|
CREATE INDEX IF NOT EXISTS idx_${table}_agent_task ON ${table}(agent_task_id)
|
|
16462
16505
|
`);
|
|
16463
16506
|
} catch (error) {
|
|
16464
|
-
|
|
16507
|
+
this.logger.warn(`Schema update warning for ${table}:`, error);
|
|
16465
16508
|
}
|
|
16466
16509
|
}
|
|
16467
16510
|
await client.query(`
|
|
@@ -16499,13 +16542,13 @@ class DatabaseInitializer {
|
|
|
16499
16542
|
await client.query(`
|
|
16500
16543
|
CREATE INDEX IF NOT EXISTS idx_omo_wisdom_type ON omo_wisdom(type)
|
|
16501
16544
|
`);
|
|
16502
|
-
|
|
16545
|
+
this.logger.info("OmO schema initialized");
|
|
16503
16546
|
}
|
|
16504
16547
|
async close() {
|
|
16505
16548
|
if (this.pool) {
|
|
16506
16549
|
await this.pool.end();
|
|
16507
16550
|
this.pool = null;
|
|
16508
|
-
|
|
16551
|
+
this.logger.info("Database connection closed");
|
|
16509
16552
|
}
|
|
16510
16553
|
}
|
|
16511
16554
|
getPool() {
|
|
@@ -22453,6 +22496,7 @@ function getEmbeddingService() {
|
|
|
22453
22496
|
}
|
|
22454
22497
|
|
|
22455
22498
|
// src/mcp/recall-memory.ts
|
|
22499
|
+
var logger = createLogger("recall-memory");
|
|
22456
22500
|
var DEFAULT_CONFIG = {
|
|
22457
22501
|
weights: {
|
|
22458
22502
|
semantic: 0.5,
|
|
@@ -22467,7 +22511,7 @@ var PER_STRATEGY_LIMIT = 20;
|
|
|
22467
22511
|
async function recallMemory(input, pool, config = {}) {
|
|
22468
22512
|
const mergedConfig = { ...DEFAULT_CONFIG, ...config };
|
|
22469
22513
|
const startTime = Date.now();
|
|
22470
|
-
|
|
22514
|
+
logger.info(`recall_memory called: "${input.query.substring(0, 100)}..."`);
|
|
22471
22515
|
try {
|
|
22472
22516
|
const sessionId = await resolveSessionId(input, pool);
|
|
22473
22517
|
const embeddingService = getEmbeddingService();
|
|
@@ -22483,7 +22527,7 @@ async function recallMemory(input, pool, config = {}) {
|
|
|
22483
22527
|
if (fusionResult) {
|
|
22484
22528
|
fusedEmbedding = fusionResult.fusedEmbedding;
|
|
22485
22529
|
contextUsed = fusionResult.contextUsed;
|
|
22486
|
-
|
|
22530
|
+
logger.info(`Topic fusion applied (topic: ${fusionResult.contextUsed.topic_segment_id.substring(0, 8)}...)`);
|
|
22487
22531
|
}
|
|
22488
22532
|
}
|
|
22489
22533
|
const strategies = input.retrieval_strategies || ["semantic", "bm25", "graph"];
|
|
@@ -22522,7 +22566,7 @@ async function recallMemory(input, pool, config = {}) {
|
|
|
22522
22566
|
};
|
|
22523
22567
|
});
|
|
22524
22568
|
const retrievalTime = Date.now() - startTime;
|
|
22525
|
-
|
|
22569
|
+
logger.info(`recall_memory completed: ${results.length} results in ${retrievalTime}ms`);
|
|
22526
22570
|
return {
|
|
22527
22571
|
query: input.query,
|
|
22528
22572
|
context_used: contextUsed,
|
|
@@ -22534,7 +22578,7 @@ async function recallMemory(input, pool, config = {}) {
|
|
|
22534
22578
|
session_id: sessionId
|
|
22535
22579
|
};
|
|
22536
22580
|
} catch (error) {
|
|
22537
|
-
|
|
22581
|
+
logger.error("recall_memory error:", error);
|
|
22538
22582
|
const retrievalTime = Date.now() - startTime;
|
|
22539
22583
|
return {
|
|
22540
22584
|
query: input.query,
|
|
@@ -22561,13 +22605,13 @@ async function resolveSessionId(input, pool) {
|
|
|
22561
22605
|
try {
|
|
22562
22606
|
const recent = await pool.query("SELECT id, opencode_session_id FROM session_map ORDER BY last_active_at DESC LIMIT 1");
|
|
22563
22607
|
if (recent.rows.length > 0) {
|
|
22564
|
-
|
|
22608
|
+
logger.info(`Auto-detected session: ${recent.rows[0].opencode_session_id}`);
|
|
22565
22609
|
return recent.rows[0].id;
|
|
22566
22610
|
}
|
|
22567
22611
|
} catch {}
|
|
22568
22612
|
const recentSession = await pool.query("SELECT id, external_id FROM sessions ORDER BY updated_at DESC NULLS LAST, created_at DESC LIMIT 1");
|
|
22569
22613
|
if (recentSession.rows.length > 0) {
|
|
22570
|
-
|
|
22614
|
+
logger.info(`Auto-detected session (legacy): ${recentSession.rows[0].external_id}`);
|
|
22571
22615
|
return recentSession.rows[0].id;
|
|
22572
22616
|
}
|
|
22573
22617
|
throw new Error("No session found. Please start a conversation first or provide session_id explicitly.");
|
|
@@ -22628,7 +22672,7 @@ async function topicContextFusion(externalSessionId, queryEmbedding, embeddingSe
|
|
|
22628
22672
|
}
|
|
22629
22673
|
};
|
|
22630
22674
|
} catch (err) {
|
|
22631
|
-
|
|
22675
|
+
logger.warn("Topic context fusion skipped:", err);
|
|
22632
22676
|
return null;
|
|
22633
22677
|
}
|
|
22634
22678
|
}
|
|
@@ -22657,7 +22701,7 @@ async function parallelRetrieve(query, queryEmbedding, sessionId, strategies, po
|
|
|
22657
22701
|
const r2 = await semanticSearch(queryEmbedding, sessionId, pool, filterSQL);
|
|
22658
22702
|
results.set("semantic", r2);
|
|
22659
22703
|
} catch (err) {
|
|
22660
|
-
|
|
22704
|
+
logger.warn("Semantic search failed:", err);
|
|
22661
22705
|
results.set("semantic", []);
|
|
22662
22706
|
}
|
|
22663
22707
|
})());
|
|
@@ -22668,7 +22712,7 @@ async function parallelRetrieve(query, queryEmbedding, sessionId, strategies, po
|
|
|
22668
22712
|
const r2 = await bm25Search(query, sessionId, pool, filterSQL);
|
|
22669
22713
|
results.set("bm25", r2);
|
|
22670
22714
|
} catch (err) {
|
|
22671
|
-
|
|
22715
|
+
logger.warn("BM25 search failed:", err);
|
|
22672
22716
|
results.set("bm25", []);
|
|
22673
22717
|
}
|
|
22674
22718
|
})());
|
|
@@ -22679,7 +22723,7 @@ async function parallelRetrieve(query, queryEmbedding, sessionId, strategies, po
|
|
|
22679
22723
|
const r2 = await graphTraversal(query, embeddingServiceFallback(query), sessionId, pool, filterSQL);
|
|
22680
22724
|
results.set("graph", r2);
|
|
22681
22725
|
} catch (err) {
|
|
22682
|
-
|
|
22726
|
+
logger.warn("Graph traversal failed:", err);
|
|
22683
22727
|
results.set("graph", []);
|
|
22684
22728
|
}
|
|
22685
22729
|
})());
|
|
@@ -22690,7 +22734,7 @@ async function parallelRetrieve(query, queryEmbedding, sessionId, strategies, po
|
|
|
22690
22734
|
const r2 = await keywordSearch(query, sessionId, pool, filterSQL);
|
|
22691
22735
|
results.set("keyword", r2);
|
|
22692
22736
|
} catch (err) {
|
|
22693
|
-
|
|
22737
|
+
logger.warn("Keyword search failed:", err);
|
|
22694
22738
|
results.set("keyword", []);
|
|
22695
22739
|
}
|
|
22696
22740
|
})());
|
|
@@ -22755,7 +22799,7 @@ async function semanticSearch(queryEmbedding, sessionId, pool, filters) {
|
|
|
22755
22799
|
_timestamp: row.created_at
|
|
22756
22800
|
})));
|
|
22757
22801
|
} catch (err) {
|
|
22758
|
-
|
|
22802
|
+
logger.warn("Entity semantic search error:", err);
|
|
22759
22803
|
}
|
|
22760
22804
|
try {
|
|
22761
22805
|
const obsQuery = `
|
|
@@ -22789,7 +22833,7 @@ async function semanticSearch(queryEmbedding, sessionId, pool, filters) {
|
|
|
22789
22833
|
_timestamp: row.created_at
|
|
22790
22834
|
})));
|
|
22791
22835
|
} catch (err) {
|
|
22792
|
-
|
|
22836
|
+
logger.warn("Observation semantic search error:", err);
|
|
22793
22837
|
}
|
|
22794
22838
|
try {
|
|
22795
22839
|
const refQuery = `
|
|
@@ -22823,7 +22867,7 @@ async function semanticSearch(queryEmbedding, sessionId, pool, filters) {
|
|
|
22823
22867
|
_timestamp: row.created_at
|
|
22824
22868
|
})));
|
|
22825
22869
|
} catch (err) {
|
|
22826
|
-
|
|
22870
|
+
logger.warn("Reflection semantic search error:", err);
|
|
22827
22871
|
}
|
|
22828
22872
|
return facts;
|
|
22829
22873
|
}
|
|
@@ -22869,7 +22913,7 @@ async function bm25Search(query, sessionId, pool, filters) {
|
|
|
22869
22913
|
_timestamp: row.created_at
|
|
22870
22914
|
})));
|
|
22871
22915
|
} catch (err) {
|
|
22872
|
-
|
|
22916
|
+
logger.warn("BM25 search failed (pg_trgm may not be installed):", err);
|
|
22873
22917
|
}
|
|
22874
22918
|
return facts;
|
|
22875
22919
|
}
|
|
@@ -22931,7 +22975,7 @@ async function graphTraversal(query, _queryEmb, sessionId, pool, filters) {
|
|
|
22931
22975
|
_timestamp: row.created_at
|
|
22932
22976
|
}));
|
|
22933
22977
|
} catch (err) {
|
|
22934
|
-
|
|
22978
|
+
logger.warn("Graph traversal error:", err);
|
|
22935
22979
|
return [];
|
|
22936
22980
|
}
|
|
22937
22981
|
}
|
|
@@ -22971,7 +23015,7 @@ async function keywordSearch(query, sessionId, pool, filters) {
|
|
|
22971
23015
|
_timestamp: row.created_at
|
|
22972
23016
|
}));
|
|
22973
23017
|
} catch (err) {
|
|
22974
|
-
|
|
23018
|
+
logger.warn("Keyword search error:", err);
|
|
22975
23019
|
return [];
|
|
22976
23020
|
}
|
|
22977
23021
|
}
|
|
@@ -23172,6 +23216,7 @@ function formatVectorLiteral(embedding) {
|
|
|
23172
23216
|
}
|
|
23173
23217
|
|
|
23174
23218
|
// src/mcp/hindsight-reflect.ts
|
|
23219
|
+
var logger2 = createLogger("hindsight-reflect");
|
|
23175
23220
|
var DEFAULT_REFLECTION_SYSTEM_PROMPT = `You are a reflection engine that analyzes coding session observations to extract reusable patterns and insights.
|
|
23176
23221
|
|
|
23177
23222
|
## Task
|
|
@@ -23271,11 +23316,11 @@ async function hindsightReflect(input, pool, config = {}) {
|
|
|
23271
23316
|
const mergedConfig = { ...DEFAULT_CONFIG2, ...config };
|
|
23272
23317
|
const startTime = Date.now();
|
|
23273
23318
|
let totalTokens = { input: 0, output: 0, total: 0 };
|
|
23274
|
-
|
|
23319
|
+
logger2.info(`hindsight_reflect called: session=${input.session_id || "none"}, ` + `omo_task=${input.omo_task_id || "none"}, ` + `topic_segment=${input.topic_segment_id || "none"}, ` + `aggregate=${input.aggregate ?? false}`);
|
|
23275
23320
|
try {
|
|
23276
23321
|
const scope = await resolveScope(input, pool);
|
|
23277
23322
|
if (!scope.observable) {
|
|
23278
|
-
|
|
23323
|
+
logger2.info("hindsight_reflect: no observations available for scope");
|
|
23279
23324
|
return {
|
|
23280
23325
|
generated_reflections: [],
|
|
23281
23326
|
token_usage: totalTokens,
|
|
@@ -23284,17 +23329,17 @@ async function hindsightReflect(input, pool, config = {}) {
|
|
|
23284
23329
|
}
|
|
23285
23330
|
const observations = await collectObservations(input, scope, mergedConfig, pool);
|
|
23286
23331
|
if (observations.length === 0) {
|
|
23287
|
-
|
|
23332
|
+
logger2.info("hindsight_reflect: zero observations collected");
|
|
23288
23333
|
return {
|
|
23289
23334
|
generated_reflections: [],
|
|
23290
23335
|
token_usage: totalTokens,
|
|
23291
23336
|
duration_ms: Date.now() - startTime
|
|
23292
23337
|
};
|
|
23293
23338
|
}
|
|
23294
|
-
|
|
23339
|
+
logger2.info(`Fetched ${observations.length} observations for reflection`);
|
|
23295
23340
|
const threshold = mergedConfig.observationThreshold;
|
|
23296
23341
|
if (observations.length < threshold && input.trigger_type !== "manual") {
|
|
23297
|
-
|
|
23342
|
+
logger2.info(`hindsight_reflect: observation count (${observations.length}) ` + `below threshold (${threshold}), skipping`);
|
|
23298
23343
|
return {
|
|
23299
23344
|
generated_reflections: [],
|
|
23300
23345
|
token_usage: totalTokens,
|
|
@@ -23303,7 +23348,7 @@ async function hindsightReflect(input, pool, config = {}) {
|
|
|
23303
23348
|
}
|
|
23304
23349
|
const shouldAggregate = input.aggregate === true || !!input.omo_task_id && input.aggregate !== false;
|
|
23305
23350
|
const segments = groupObservationsBySegment(observations, shouldAggregate);
|
|
23306
|
-
|
|
23351
|
+
logger2.info(`Grouped into ${segments.length} segment(s) ` + `(aggregate=${shouldAggregate})`);
|
|
23307
23352
|
const generatedReflections = [];
|
|
23308
23353
|
for (const segment of segments) {
|
|
23309
23354
|
const segmentReflections = await reflectOnSegment(segment, scope, input, mergedConfig, pool);
|
|
@@ -23313,7 +23358,7 @@ async function hindsightReflect(input, pool, config = {}) {
|
|
|
23313
23358
|
}
|
|
23314
23359
|
await updateReflectionTimestamp(scope, pool);
|
|
23315
23360
|
const elapsed = Date.now() - startTime;
|
|
23316
|
-
|
|
23361
|
+
logger2.info(`hindsight_reflect completed: ` + `${generatedReflections.length} reflections in ${elapsed}ms`);
|
|
23317
23362
|
return {
|
|
23318
23363
|
generated_reflections: generatedReflections,
|
|
23319
23364
|
token_usage: totalTokens,
|
|
@@ -23321,7 +23366,7 @@ async function hindsightReflect(input, pool, config = {}) {
|
|
|
23321
23366
|
};
|
|
23322
23367
|
} catch (error) {
|
|
23323
23368
|
const elapsed = Date.now() - startTime;
|
|
23324
|
-
|
|
23369
|
+
logger2.error("hindsight_reflect error:", error);
|
|
23325
23370
|
await logReflectionError(input, error, pool);
|
|
23326
23371
|
return {
|
|
23327
23372
|
generated_reflections: [],
|
|
@@ -23387,21 +23432,21 @@ async function collectObservations(input, scope, config, pool) {
|
|
|
23387
23432
|
try {
|
|
23388
23433
|
return await collectObservationsForSegment(scope.topicSegmentId, config, pool);
|
|
23389
23434
|
} catch (err) {
|
|
23390
|
-
|
|
23435
|
+
logger2.warn("New-schema segment collection failed, falling back:", err);
|
|
23391
23436
|
}
|
|
23392
23437
|
}
|
|
23393
23438
|
if (scope.omoTaskId && scope.usesNewSchema && scope.sessionMapIds.length > 0) {
|
|
23394
23439
|
try {
|
|
23395
23440
|
return await collectObservationsForOmoTask(scope.omoTaskId, config, pool);
|
|
23396
23441
|
} catch (err) {
|
|
23397
|
-
|
|
23442
|
+
logger2.warn("New-schema omo_task collection failed, falling back:", err);
|
|
23398
23443
|
}
|
|
23399
23444
|
}
|
|
23400
23445
|
if (scope.usesNewSchema && scope.sessionMapIds.length > 0) {
|
|
23401
23446
|
try {
|
|
23402
23447
|
return await collectObservationsForSessionMaps(scope.sessionMapIds, config, pool);
|
|
23403
23448
|
} catch (err) {
|
|
23404
|
-
|
|
23449
|
+
logger2.warn("New-schema session_map collection failed, falling back:", err);
|
|
23405
23450
|
}
|
|
23406
23451
|
}
|
|
23407
23452
|
return collectObservationsLegacy(scope.sessionInternalIds, config, pool);
|
|
@@ -23549,7 +23594,7 @@ function buildReflectionPrompt(segment, batch, config, _input) {
|
|
|
23549
23594
|
return template.replace("{topic_summary}", segment.topicSummary).replace("{session_context}", sessionContext).replace("{topics_summary}", segment.topicSummary).replace("{observations_json}", observationsJson);
|
|
23550
23595
|
}
|
|
23551
23596
|
async function performReflectionWithLLM(observations, topicSummary, config, prompt) {
|
|
23552
|
-
|
|
23597
|
+
logger2.info(`Performing reflection with ${config.modelSize} model ` + `on ${observations.length} observations (topic: ${topicSummary})`);
|
|
23553
23598
|
return performHeuristicReflection(observations, topicSummary);
|
|
23554
23599
|
}
|
|
23555
23600
|
function performHeuristicReflection(observations, topicSummary) {
|
|
@@ -23657,7 +23702,7 @@ async function storeReflection(pattern, segment, scope, pool, config, input) {
|
|
|
23657
23702
|
JSON.stringify(metadata)
|
|
23658
23703
|
]);
|
|
23659
23704
|
} catch {
|
|
23660
|
-
|
|
23705
|
+
logger2.warn("New schema INSERT failed, falling back to legacy");
|
|
23661
23706
|
}
|
|
23662
23707
|
}
|
|
23663
23708
|
if (!insertResult && scope.sessionInternalIds.length > 0) {
|
|
@@ -23675,7 +23720,7 @@ async function storeReflection(pattern, segment, scope, pool, config, input) {
|
|
|
23675
23720
|
]);
|
|
23676
23721
|
}
|
|
23677
23722
|
if (!insertResult) {
|
|
23678
|
-
|
|
23723
|
+
logger2.warn("No valid session reference to store reflection");
|
|
23679
23724
|
return null;
|
|
23680
23725
|
}
|
|
23681
23726
|
return {
|
|
@@ -23690,7 +23735,7 @@ async function storeReflection(pattern, segment, scope, pool, config, input) {
|
|
|
23690
23735
|
metadata
|
|
23691
23736
|
};
|
|
23692
23737
|
} catch (error) {
|
|
23693
|
-
|
|
23738
|
+
logger2.error("Failed to store reflection:", error);
|
|
23694
23739
|
return null;
|
|
23695
23740
|
}
|
|
23696
23741
|
}
|
|
@@ -23714,7 +23759,7 @@ async function updateReflectionTimestamp(scope, pool) {
|
|
|
23714
23759
|
WHERE id = $1`, [internalId]);
|
|
23715
23760
|
}
|
|
23716
23761
|
} catch (error) {
|
|
23717
|
-
|
|
23762
|
+
logger2.warn("Failed to update reflection timestamp:", error);
|
|
23718
23763
|
}
|
|
23719
23764
|
}
|
|
23720
23765
|
async function logReflectionError(input, error, pool) {
|
|
@@ -23733,7 +23778,7 @@ async function logReflectionError(input, error, pool) {
|
|
|
23733
23778
|
observation_count, retry_count
|
|
23734
23779
|
) VALUES ($1, $2, $3, $4, $5)`, [sessionId, errorMessage, errorStack, 0, 0]);
|
|
23735
23780
|
} catch (logError) {
|
|
23736
|
-
|
|
23781
|
+
logger2.error("Failed to log reflection error:", logError);
|
|
23737
23782
|
}
|
|
23738
23783
|
}
|
|
23739
23784
|
async function tableExists(pool, tableName) {
|
|
@@ -23805,6 +23850,7 @@ function generateReflectionSummary(topicSummary, patterns, observationCount) {
|
|
|
23805
23850
|
}
|
|
23806
23851
|
|
|
23807
23852
|
// mcp-server.ts
|
|
23853
|
+
var logger3 = createLogger("mcp-server");
|
|
23808
23854
|
var dbConfig = {
|
|
23809
23855
|
host: process.env.PG_HOST || "localhost",
|
|
23810
23856
|
port: parseInt(process.env.PG_PORT || "5432", 10),
|
|
@@ -23921,13 +23967,13 @@ var TOOLS = [
|
|
|
23921
23967
|
}
|
|
23922
23968
|
];
|
|
23923
23969
|
async function main() {
|
|
23924
|
-
|
|
23970
|
+
logger3.info("Starting server...");
|
|
23925
23971
|
let pool;
|
|
23926
23972
|
try {
|
|
23927
23973
|
pool = await initializeDatabase(dbConfig);
|
|
23928
|
-
|
|
23974
|
+
logger3.info("Database connected");
|
|
23929
23975
|
} catch (error) {
|
|
23930
|
-
|
|
23976
|
+
logger3.error("Database connection failed", error);
|
|
23931
23977
|
process.exit(1);
|
|
23932
23978
|
}
|
|
23933
23979
|
const server = new Server({
|
|
@@ -24012,7 +24058,7 @@ async function main() {
|
|
|
24012
24058
|
}
|
|
24013
24059
|
throw new Error(`Unknown tool: ${name}`);
|
|
24014
24060
|
} catch (error) {
|
|
24015
|
-
|
|
24061
|
+
logger3.error(`Error calling tool ${name}`, error);
|
|
24016
24062
|
return {
|
|
24017
24063
|
content: [
|
|
24018
24064
|
{
|
|
@@ -24029,19 +24075,19 @@ async function main() {
|
|
|
24029
24075
|
});
|
|
24030
24076
|
const transport = new StdioServerTransport;
|
|
24031
24077
|
await server.connect(transport);
|
|
24032
|
-
|
|
24078
|
+
logger3.info("Server running on stdio");
|
|
24033
24079
|
process.on("SIGINT", async () => {
|
|
24034
|
-
|
|
24080
|
+
logger3.info("Shutting down...");
|
|
24035
24081
|
await pool.end();
|
|
24036
24082
|
process.exit(0);
|
|
24037
24083
|
});
|
|
24038
24084
|
process.on("SIGTERM", async () => {
|
|
24039
|
-
|
|
24085
|
+
logger3.info("Shutting down...");
|
|
24040
24086
|
await pool.end();
|
|
24041
24087
|
process.exit(0);
|
|
24042
24088
|
});
|
|
24043
24089
|
}
|
|
24044
24090
|
main().catch((error) => {
|
|
24045
|
-
|
|
24091
|
+
logger3.error("Fatal error", error);
|
|
24046
24092
|
process.exit(1);
|
|
24047
24093
|
});
|
package/dist/src/db/init-db.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare const DEFAULT_DB_CONFIG: DatabaseConfig;
|
|
|
12
12
|
export declare class DatabaseInitializer {
|
|
13
13
|
private pool;
|
|
14
14
|
private config;
|
|
15
|
+
private logger;
|
|
15
16
|
constructor(config?: Partial<DatabaseConfig>);
|
|
16
17
|
initialize(): Promise<Pool>;
|
|
17
18
|
private testConnection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-db.d.ts","sourceRoot":"","sources":["../../../src/db/init-db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"init-db.d.ts","sourceRoot":"","sources":["../../../src/db/init-db.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAc,MAAM,IAAI,CAAC;AAItC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,eAAO,MAAM,iBAAiB,EAAE,cAQ/B,CAAC;AAEF,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,IAAI,CAAqB;IACjC,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,MAAM,CAA2B;gBAE7B,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM;IAI1C,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;YA4BnB,cAAc;YAYd,aAAa;YAqCb,gBAAgB;YAQhB,WAAW;YAgBX,YAAY;YAgKZ,aAAa;IAkI3B;;;;;;OAMG;YACW,wBAAwB;IA8BtC;;;;;OAKG;YACW,mBAAmB;YA8BnB,mBAAmB;IAmF3B,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAQ5B,OAAO,IAAI,IAAI;CAMhB;AAKD,wBAAgB,sBAAsB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,mBAAmB,CAK5F;AAED,wBAAsB,kBAAkB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxF;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAKnD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-part-updated.d.ts","sourceRoot":"","sources":["../../../src/hooks/message-part-updated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"message-part-updated.d.ts","sourceRoot":"","sources":["../../../src/hooks/message-part-updated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAK7E,MAAM,WAAW,+BAA+B;IAC9C,gBAAgB,EAAE,MAAM,CAAC;IACzB,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAgBD;;;;;;;;;GASG;AACH,wBAAsB,wBAAwB,CAC5C,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,wBAAwB,EAAK,iBAAiB;AACtD,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,+BAA+B,CAAM,GACpD,OAAO,CAAC,IAAI,CAAC,CAkDf;AA0JD;;;GAGG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,GAAE,MAAe,GAAG,IAAI,CAc1E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message-updated.d.ts","sourceRoot":"","sources":["../../../src/hooks/message-updated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EAGrB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"message-updated.d.ts","sourceRoot":"","sources":["../../../src/hooks/message-updated.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EAGrB,MAAM,UAAU,CAAC;AAOlB,MAAM,WAAW,2BAA2B;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AASD;;;;;;;;;;;;GAYG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,oBAAoB,EAAK,iBAAiB;AAClD,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,2BAA2B,CAAM,GAChD,OAAO,CAAC,IAAI,CAAC,CAyCf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-compacting.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-compacting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"session-compacting.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-compacting.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAK3E,MAAM,WAAW,8BAA8B;IAC7C,kCAAkC,EAAE,OAAO,CAAC;IAC5C,uBAAuB,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAQD;;;;;;;;;GASG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,sBAAsB,EAC7B,MAAM,EAAE,uBAAuB,EAAK,iBAAiB;AACrD,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,8BAA8B,CAAM,GACnD,OAAO,CAAC,IAAI,CAAC,CA0Df;AAgED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI;IACxC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,OAAO,CAAC;CACzB,CAOA;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,sBAAsB,EAC7B,MAAM,EAAE,uBAAuB,EAAK,iBAAiB;AACrD,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,8BAA8B,CAAM,GACnD,OAAO,CAAC,IAAI,CAAC,CAKf;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,OAAO,CAAC,CAYlB;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC;IACT,iBAAiB,EAAE,MAAM,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0BAA0B,EAAE,MAAM,CAAC;CACpC,CAAC,CA2BD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-completed.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-completed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"session-completed.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-completed.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAKzE,MAAM,WAAW,6BAA6B;IAC5C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,uBAAuB,EAAE,MAAM,CAAC;IAChC,uBAAuB,EAAE,MAAM,CAAC;IAChC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,qBAAqB,EAC5B,MAAM,EAAE,sBAAsB,EAAK,iBAAiB;AACpD,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,6BAA6B,CAAM,GAClD,OAAO,CAAC,IAAI,CAAC,CAuFf;AA6RD;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,KAAK,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,MAAM,CAAC;IACzB,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC,CAAC,CAmBF;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,EACV,UAAU,GAAE,MAAU,GACrB,OAAO,CAAC,IAAI,CAAC,CAkCf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-created.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-created.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EAIrB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"session-created.d.ts","sourceRoot":"","sources":["../../../src/hooks/session-created.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EAIrB,MAAM,UAAU,CAAC;AAWlB,MAAM,WAAW,2BAA2B;IAC1C,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB;AAUD;;;;;;;;;;GAUG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,oBAAoB,EAAK,iBAAiB;AAClD,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,2BAA2B,CAAM,GAChD,OAAO,CAAC,IAAI,CAAC,CAyCf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-execute.d.ts","sourceRoot":"","sources":["../../../src/hooks/tool-execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-execute.d.ts","sourceRoot":"","sources":["../../../src/hooks/tool-execute.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAC1B,OAAO,EACL,sBAAsB,EACtB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAMlB,MAAM,WAAW,wBAAwB;IACvC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAQD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,sBAAsB,EAC7B,MAAM,EAAE,uBAAuB,EAAK,iBAAiB;AACrD,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAC7C,OAAO,CAAC,IAAI,CAAC,CAuDf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,KAAK,EAAE,qBAAqB,EAC5B,MAAM,EAAE,sBAAsB,EAAK,iBAAiB;AACpD,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,wBAAwB,CAAM,GAC7C,OAAO,CAAC,IAAI,CAAC,CAyGf"}
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAqBA,UAAU,aAAa;IACrB,0BAA0B;IAC1B,MAAM,EAAE,GAAG,CAAC;IACZ,uBAAuB;IACvB,OAAO,EAAE,GAAG,CAAC;IACb,wBAAwB;IACxB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,uCAAuC;AACvC,KAAK,MAAM,GAAG,CAAC,GAAG,EAAE,aAAa,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAE3D,UAAU,WAAW;IACnB,mDAAmD;IACnD,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;SAAE,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/F,0CAA0C;IAC1C,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,MAAM,EAAE;QAAE,IAAI,EAAE,GAAG,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7H,iDAAiD;IACjD,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,GAAG,CAAA;KAAE,EAAE,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,GAAG,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1K,8BAA8B;IAC9B,iCAAiC,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,MAAM,EAAE;QAAE,OAAO,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpI,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAClC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED,UAAU,UAAU;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1B,OAAO,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE;QAAE,MAAM,EAAE,GAAG,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CACpF;AAwJD,eAAO,MAAM,gBAAgB,EAAE,MA+hB9B,CAAC;AA+JF,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hindsight-reflect-omo.d.ts","sourceRoot":"","sources":["../../../src/mcp/hindsight-reflect-omo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"hindsight-reflect-omo.d.ts","sourceRoot":"","sources":["../../../src/mcp/hindsight-reflect-omo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,OAAO,EAAoB,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAItG,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IAErE,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAG3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IAG3B,gBAAgB,CAAC,EAAE,YAAY,GAAG,WAAW,GAAG,cAAc,GAAG,cAAc,CAAC;IAGhF,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,yBAA0B,SAAQ,sBAAsB;IAEvE,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IAGf,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,CAAC,EAAE,KAAK,CAAC;QACzB,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IAGH,iBAAiB,CAAC,EAAE;QAClB,kBAAkB,EAAE,MAAM,CAAC;QAC3B,gBAAgB,EAAE,MAAM,CAAC;QACzB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,wBAAwB,EAAE,MAAM,CAAC;KAClC,CAAC;IAGF,mBAAmB,EAAE;QACnB,wBAAwB,EAAE,OAAO,CAAC;QAClC,qBAAqB,EAAE,OAAO,CAAC;QAC/B,gBAAgB,EAAE,OAAO,CAAC;KAC3B,CAAC;CACH;AAED;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,EAAE,wBAAwB,EAC/B,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,yBAAyB,CAAC,CA6FpC;AAuND;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,KAAK,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,iBAAiB,EAAE,GAAG,CAAC;CACxB,CAAC,CAAC,CASF;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hindsight-reflect.d.ts","sourceRoot":"","sources":["../../../src/mcp/hindsight-reflect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"hindsight-reflect.d.ts","sourceRoot":"","sources":["../../../src/mcp/hindsight-reflect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAQ3C,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,YAAY,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,CAAC;IACpD,UAAU,CAAC,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,+EAA+E;IAC/E,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC;AAED,MAAM,WAAW,sBAAsB;IACrC,qBAAqB,EAAE,UAAU,EAAE,CAAC;IACpC,WAAW,EAAE;QACX,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,WAAW,EAAE,MAAM,CAAC;CACrB;AAMD,MAAM,WAAW,sBAAsB;IACrC,oBAAoB,EAAE,MAAM,CAAC;IAC7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,IAAI,GAAG,KAAK,GAAG,MAAM,CAAC;IACjC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,yBAAyB,EAAE,MAAM,CAAC;IAClC,kDAAkD;IAClD,wBAAwB,EAAE,MAAM,CAAC;IACjC,0CAA0C;IAC1C,mBAAmB,EAAE,MAAM,CAAC;IAC5B,yEAAyE;IACzE,OAAO,EAAE;QACP,YAAY,EAAE,MAAM,CAAC;QACrB,oBAAoB,EAAE,MAAM,CAAC;QAC7B,mBAAmB,EAAE,MAAM,CAAC;KAC7B,CAAC;CACH;AAOD,eAAO,MAAM,gCAAgC,+xEA2DO,CAAC;AAErD,eAAO,MAAM,+BAA+B,wVAQxB,CAAC;AAErB,eAAO,MAAM,6BAA6B,uXAQtB,CAAC;AAwBrB;;;;;;;;;;;;GAYG;AACH,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,qBAAqB,EAC5B,IAAI,EAAE,IAAI,EACV,MAAM,GAAE,OAAO,CAAC,sBAAsB,CAAM,GAC3C,OAAO,CAAC,sBAAsB,CAAC,CA+GjC;AAg4BD;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,CAAC,EAAE;IAAE,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,OAAO,CAI1E;AAED;;GAEG;AACH,wBAAsB,kBAAkB,CACtC,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,IAAI,GACT,OAAO,CAAC;IACT,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,gBAAgB,EAAE,IAAI,GAAG,IAAI,CAAC;CAC/B,CAAC,CAwCD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"recall-memory-omo.d.ts","sourceRoot":"","sources":["../../../src/mcp/recall-memory-omo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"recall-memory-omo.d.ts","sourceRoot":"","sources":["../../../src/mcp/recall-memory-omo.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,OAAO,EAAgB,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAItF,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;IAE7D,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,QAAQ,GAAG,UAAU,GAAG,KAAK,CAAC;IAGlE,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAG7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,WAAW,GAAG,OAAO,GAAG,cAAc,CAAC;CAC5D;AAED,MAAM,WAAW,qBAAsB,SAAQ,kBAAkB;IAE/D,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAGjB,mBAAmB,EAAE;QACnB,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,CAAC;QACrB,gBAAgB,EAAE,MAAM,CAAC;QACzB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IAGF,kBAAkB,EAAE;QAClB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAGF,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACnC,KAAK,EAAE,oBAAoB,EAC3B,IAAI,EAAE,IAAI,GACT,OAAO,CAAC,qBAAqB,CAAC,CAmFhC"}
|