@gethmy/mcp 2.16.0 → 2.17.0

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/dist/cli.js CHANGED
@@ -2032,6 +2032,8 @@ class HarmonyApiClient {
2032
2032
  params.set("offset", String(options.offset));
2033
2033
  if (options.include_superseded)
2034
2034
  params.set("include_superseded", "true");
2035
+ if (options.include_episodes)
2036
+ params.set("include_episodes", "true");
2035
2037
  return this.request("GET", `/memory/entities?${params.toString()}`);
2036
2038
  }
2037
2039
  async getMemoryEntity(entityId) {
@@ -2047,7 +2049,8 @@ class HarmonyApiClient {
2047
2049
  const search = await this.searchMemoryEntities(options.workspaceId, options.query, {
2048
2050
  project_id: options.projectId,
2049
2051
  type: options.type?.length === 1 ? options.type[0] : undefined,
2050
- limit: fetchLimit
2052
+ limit: fetchLimit,
2053
+ include_episodes: options.includeEpisodes
2051
2054
  });
2052
2055
  entities = search.entities ?? [];
2053
2056
  } else {
@@ -2058,7 +2061,8 @@ class HarmonyApiClient {
2058
2061
  type: options.type?.length === 1 ? options.type[0] : undefined,
2059
2062
  tags: options.tags,
2060
2063
  min_confidence: options.minConfidence,
2061
- limit: fetchLimit
2064
+ limit: fetchLimit,
2065
+ include_episodes: options.includeEpisodes
2062
2066
  });
2063
2067
  entities = list.entities ?? [];
2064
2068
  }
@@ -2119,6 +2123,8 @@ class HarmonyApiClient {
2119
2123
  params.append("tags", tag);
2120
2124
  if (options?.include_superseded)
2121
2125
  params.set("include_superseded", "true");
2126
+ if (options?.include_episodes)
2127
+ params.set("include_episodes", "true");
2122
2128
  return this.request("GET", `/memory/search?${params.toString()}`);
2123
2129
  }
2124
2130
  async getVaultIndex(options) {
@@ -2130,6 +2136,8 @@ class HarmonyApiClient {
2130
2136
  params.set("type", options.type);
2131
2137
  if (options.limit !== undefined)
2132
2138
  params.set("limit", String(options.limit));
2139
+ if (options.include_episodes)
2140
+ params.set("include_episodes", "true");
2133
2141
  return this.request("GET", `/memory/index?${params.toString()}`);
2134
2142
  }
2135
2143
  async getVaultIndexMarkdown(options) {
@@ -2141,6 +2149,8 @@ class HarmonyApiClient {
2141
2149
  params.set("type", options.type);
2142
2150
  if (options.limit !== undefined)
2143
2151
  params.set("limit", String(options.limit));
2152
+ if (options.include_episodes)
2153
+ params.set("include_episodes", "true");
2144
2154
  return this.requestRaw("GET", `/memory/index?${params.toString()}`, undefined, {
2145
2155
  accept: "text/markdown"
2146
2156
  });
@@ -2198,6 +2208,8 @@ class HarmonyApiClient {
2198
2208
  params.set("type", options.type);
2199
2209
  if (options?.limit !== undefined)
2200
2210
  params.set("limit", String(options.limit));
2211
+ if (options?.include_episodes)
2212
+ params.set("include_episodes", "true");
2201
2213
  return this.requestRaw("GET", `/memory/search?${params.toString()}`, undefined, {
2202
2214
  accept: "text/markdown"
2203
2215
  });
@@ -4833,6 +4845,10 @@ var TOOLS = {
4833
4845
  include_superseded: {
4834
4846
  type: "boolean",
4835
4847
  description: "Include rows whose `superseded_at` is set (default false). Use when investigating supersede chains."
4848
+ },
4849
+ include_episodes: {
4850
+ type: "boolean",
4851
+ description: "Include agent-run episodes — the daemon's per-run implement/review captures (default false). Excluded by default so recall surfaces curated, durable memory. Set true to audit the agent's run history."
4836
4852
  }
4837
4853
  }
4838
4854
  }
@@ -5018,7 +5034,11 @@ var TOOLS = {
5018
5034
  type: "string",
5019
5035
  description: "Project ID (optional)"
5020
5036
  },
5021
- limit: { type: "number", description: "Max results (default: 20)" }
5037
+ limit: { type: "number", description: "Max results (default: 20)" },
5038
+ include_episodes: {
5039
+ type: "boolean",
5040
+ description: "Include agent-run episodes — the daemon's per-run captures (default false). Excluded by default so search surfaces curated memory."
5041
+ }
5022
5042
  },
5023
5043
  required: ["query"]
5024
5044
  }
@@ -5059,6 +5079,10 @@ var TOOLS = {
5059
5079
  limit: {
5060
5080
  type: "number",
5061
5081
  description: "Max entities to return (default: 200)"
5082
+ },
5083
+ include_episodes: {
5084
+ type: "boolean",
5085
+ description: "Include agent-run episodes — the daemon's per-run captures (default false). Excluded by default so the index shows curated vault content, not run noise."
5062
5086
  }
5063
5087
  },
5064
5088
  required: []
@@ -6486,6 +6510,7 @@ async function handleToolCall(name, args, deps) {
6486
6510
  const topK = args.top_k;
6487
6511
  const budgetTokens = args.budget_tokens;
6488
6512
  const includeSuperseded = Boolean(args.include_superseded);
6513
+ const includeEpisodes = Boolean(args.include_episodes);
6489
6514
  const queryText = args.query;
6490
6515
  const fetchLimit = Math.min(Math.max(requestedLimit ?? 20, topK ?? 0, 50), 200);
6491
6516
  const projectId = args.projectId || deps.getActiveProjectId() || undefined;
@@ -6502,7 +6527,8 @@ async function handleToolCall(name, args, deps) {
6502
6527
  type: args.type,
6503
6528
  limit: fetchLimit,
6504
6529
  tags: requestedTags && requestedTags.length > 0 ? requestedTags : undefined,
6505
- include_superseded: includeSuperseded
6530
+ include_superseded: includeSuperseded,
6531
+ include_episodes: includeEpisodes
6506
6532
  });
6507
6533
  entities = searchResult.entities ?? [];
6508
6534
  const minConfidence = args.minConfidence;
@@ -6525,7 +6551,8 @@ async function handleToolCall(name, args, deps) {
6525
6551
  tags: args.tags,
6526
6552
  min_confidence: args.minConfidence,
6527
6553
  limit: fetchLimit,
6528
- include_superseded: includeSuperseded
6554
+ include_superseded: includeSuperseded,
6555
+ include_episodes: includeEpisodes
6529
6556
  });
6530
6557
  entities = listed;
6531
6558
  if (excludeSessionFromLongTerm) {
@@ -6745,7 +6772,8 @@ async function handleToolCall(name, args, deps) {
6745
6772
  const markdown = await client3.searchMemoryEntitiesMarkdown(workspaceId, query, {
6746
6773
  project_id: args.projectId || deps.getActiveProjectId() || undefined,
6747
6774
  type: args.type,
6748
- limit: args.limit
6775
+ limit: args.limit,
6776
+ include_episodes: Boolean(args.include_episodes)
6749
6777
  });
6750
6778
  const searchMemSession = getActiveMemorySession();
6751
6779
  if (searchMemSession) {
@@ -6762,7 +6790,8 @@ async function handleToolCall(name, args, deps) {
6762
6790
  workspace_id: workspaceId,
6763
6791
  project_id: args.projectId || deps.getActiveProjectId() || undefined,
6764
6792
  type: args.type,
6765
- limit: args.limit
6793
+ limit: args.limit,
6794
+ include_episodes: Boolean(args.include_episodes)
6766
6795
  });
6767
6796
  return markdown || "No entities found.";
6768
6797
  }
package/dist/index.js CHANGED
@@ -2027,6 +2027,8 @@ class HarmonyApiClient {
2027
2027
  params.set("offset", String(options.offset));
2028
2028
  if (options.include_superseded)
2029
2029
  params.set("include_superseded", "true");
2030
+ if (options.include_episodes)
2031
+ params.set("include_episodes", "true");
2030
2032
  return this.request("GET", `/memory/entities?${params.toString()}`);
2031
2033
  }
2032
2034
  async getMemoryEntity(entityId) {
@@ -2042,7 +2044,8 @@ class HarmonyApiClient {
2042
2044
  const search = await this.searchMemoryEntities(options.workspaceId, options.query, {
2043
2045
  project_id: options.projectId,
2044
2046
  type: options.type?.length === 1 ? options.type[0] : undefined,
2045
- limit: fetchLimit
2047
+ limit: fetchLimit,
2048
+ include_episodes: options.includeEpisodes
2046
2049
  });
2047
2050
  entities = search.entities ?? [];
2048
2051
  } else {
@@ -2053,7 +2056,8 @@ class HarmonyApiClient {
2053
2056
  type: options.type?.length === 1 ? options.type[0] : undefined,
2054
2057
  tags: options.tags,
2055
2058
  min_confidence: options.minConfidence,
2056
- limit: fetchLimit
2059
+ limit: fetchLimit,
2060
+ include_episodes: options.includeEpisodes
2057
2061
  });
2058
2062
  entities = list.entities ?? [];
2059
2063
  }
@@ -2114,6 +2118,8 @@ class HarmonyApiClient {
2114
2118
  params.append("tags", tag);
2115
2119
  if (options?.include_superseded)
2116
2120
  params.set("include_superseded", "true");
2121
+ if (options?.include_episodes)
2122
+ params.set("include_episodes", "true");
2117
2123
  return this.request("GET", `/memory/search?${params.toString()}`);
2118
2124
  }
2119
2125
  async getVaultIndex(options) {
@@ -2125,6 +2131,8 @@ class HarmonyApiClient {
2125
2131
  params.set("type", options.type);
2126
2132
  if (options.limit !== undefined)
2127
2133
  params.set("limit", String(options.limit));
2134
+ if (options.include_episodes)
2135
+ params.set("include_episodes", "true");
2128
2136
  return this.request("GET", `/memory/index?${params.toString()}`);
2129
2137
  }
2130
2138
  async getVaultIndexMarkdown(options) {
@@ -2136,6 +2144,8 @@ class HarmonyApiClient {
2136
2144
  params.set("type", options.type);
2137
2145
  if (options.limit !== undefined)
2138
2146
  params.set("limit", String(options.limit));
2147
+ if (options.include_episodes)
2148
+ params.set("include_episodes", "true");
2139
2149
  return this.requestRaw("GET", `/memory/index?${params.toString()}`, undefined, {
2140
2150
  accept: "text/markdown"
2141
2151
  });
@@ -2193,6 +2203,8 @@ class HarmonyApiClient {
2193
2203
  params.set("type", options.type);
2194
2204
  if (options?.limit !== undefined)
2195
2205
  params.set("limit", String(options.limit));
2206
+ if (options?.include_episodes)
2207
+ params.set("include_episodes", "true");
2196
2208
  return this.requestRaw("GET", `/memory/search?${params.toString()}`, undefined, {
2197
2209
  accept: "text/markdown"
2198
2210
  });
@@ -4828,6 +4840,10 @@ var TOOLS = {
4828
4840
  include_superseded: {
4829
4841
  type: "boolean",
4830
4842
  description: "Include rows whose `superseded_at` is set (default false). Use when investigating supersede chains."
4843
+ },
4844
+ include_episodes: {
4845
+ type: "boolean",
4846
+ description: "Include agent-run episodes — the daemon's per-run implement/review captures (default false). Excluded by default so recall surfaces curated, durable memory. Set true to audit the agent's run history."
4831
4847
  }
4832
4848
  }
4833
4849
  }
@@ -5013,7 +5029,11 @@ var TOOLS = {
5013
5029
  type: "string",
5014
5030
  description: "Project ID (optional)"
5015
5031
  },
5016
- limit: { type: "number", description: "Max results (default: 20)" }
5032
+ limit: { type: "number", description: "Max results (default: 20)" },
5033
+ include_episodes: {
5034
+ type: "boolean",
5035
+ description: "Include agent-run episodes — the daemon's per-run captures (default false). Excluded by default so search surfaces curated memory."
5036
+ }
5017
5037
  },
5018
5038
  required: ["query"]
5019
5039
  }
@@ -5054,6 +5074,10 @@ var TOOLS = {
5054
5074
  limit: {
5055
5075
  type: "number",
5056
5076
  description: "Max entities to return (default: 200)"
5077
+ },
5078
+ include_episodes: {
5079
+ type: "boolean",
5080
+ description: "Include agent-run episodes — the daemon's per-run captures (default false). Excluded by default so the index shows curated vault content, not run noise."
5057
5081
  }
5058
5082
  },
5059
5083
  required: []
@@ -6481,6 +6505,7 @@ async function handleToolCall(name, args, deps) {
6481
6505
  const topK = args.top_k;
6482
6506
  const budgetTokens = args.budget_tokens;
6483
6507
  const includeSuperseded = Boolean(args.include_superseded);
6508
+ const includeEpisodes = Boolean(args.include_episodes);
6484
6509
  const queryText = args.query;
6485
6510
  const fetchLimit = Math.min(Math.max(requestedLimit ?? 20, topK ?? 0, 50), 200);
6486
6511
  const projectId = args.projectId || deps.getActiveProjectId() || undefined;
@@ -6497,7 +6522,8 @@ async function handleToolCall(name, args, deps) {
6497
6522
  type: args.type,
6498
6523
  limit: fetchLimit,
6499
6524
  tags: requestedTags && requestedTags.length > 0 ? requestedTags : undefined,
6500
- include_superseded: includeSuperseded
6525
+ include_superseded: includeSuperseded,
6526
+ include_episodes: includeEpisodes
6501
6527
  });
6502
6528
  entities = searchResult.entities ?? [];
6503
6529
  const minConfidence = args.minConfidence;
@@ -6520,7 +6546,8 @@ async function handleToolCall(name, args, deps) {
6520
6546
  tags: args.tags,
6521
6547
  min_confidence: args.minConfidence,
6522
6548
  limit: fetchLimit,
6523
- include_superseded: includeSuperseded
6549
+ include_superseded: includeSuperseded,
6550
+ include_episodes: includeEpisodes
6524
6551
  });
6525
6552
  entities = listed;
6526
6553
  if (excludeSessionFromLongTerm) {
@@ -6740,7 +6767,8 @@ async function handleToolCall(name, args, deps) {
6740
6767
  const markdown = await client3.searchMemoryEntitiesMarkdown(workspaceId, query, {
6741
6768
  project_id: args.projectId || deps.getActiveProjectId() || undefined,
6742
6769
  type: args.type,
6743
- limit: args.limit
6770
+ limit: args.limit,
6771
+ include_episodes: Boolean(args.include_episodes)
6744
6772
  });
6745
6773
  const searchMemSession = getActiveMemorySession();
6746
6774
  if (searchMemSession) {
@@ -6757,7 +6785,8 @@ async function handleToolCall(name, args, deps) {
6757
6785
  workspace_id: workspaceId,
6758
6786
  project_id: args.projectId || deps.getActiveProjectId() || undefined,
6759
6787
  type: args.type,
6760
- limit: args.limit
6788
+ limit: args.limit,
6789
+ include_episodes: Boolean(args.include_episodes)
6761
6790
  });
6762
6791
  return markdown || "No entities found.";
6763
6792
  }
@@ -1479,6 +1479,8 @@ class HarmonyApiClient {
1479
1479
  params.set("offset", String(options.offset));
1480
1480
  if (options.include_superseded)
1481
1481
  params.set("include_superseded", "true");
1482
+ if (options.include_episodes)
1483
+ params.set("include_episodes", "true");
1482
1484
  return this.request("GET", `/memory/entities?${params.toString()}`);
1483
1485
  }
1484
1486
  async getMemoryEntity(entityId) {
@@ -1494,7 +1496,8 @@ class HarmonyApiClient {
1494
1496
  const search = await this.searchMemoryEntities(options.workspaceId, options.query, {
1495
1497
  project_id: options.projectId,
1496
1498
  type: options.type?.length === 1 ? options.type[0] : undefined,
1497
- limit: fetchLimit
1499
+ limit: fetchLimit,
1500
+ include_episodes: options.includeEpisodes
1498
1501
  });
1499
1502
  entities = search.entities ?? [];
1500
1503
  } else {
@@ -1505,7 +1508,8 @@ class HarmonyApiClient {
1505
1508
  type: options.type?.length === 1 ? options.type[0] : undefined,
1506
1509
  tags: options.tags,
1507
1510
  min_confidence: options.minConfidence,
1508
- limit: fetchLimit
1511
+ limit: fetchLimit,
1512
+ include_episodes: options.includeEpisodes
1509
1513
  });
1510
1514
  entities = list.entities ?? [];
1511
1515
  }
@@ -1566,6 +1570,8 @@ class HarmonyApiClient {
1566
1570
  params.append("tags", tag);
1567
1571
  if (options?.include_superseded)
1568
1572
  params.set("include_superseded", "true");
1573
+ if (options?.include_episodes)
1574
+ params.set("include_episodes", "true");
1569
1575
  return this.request("GET", `/memory/search?${params.toString()}`);
1570
1576
  }
1571
1577
  async getVaultIndex(options) {
@@ -1577,6 +1583,8 @@ class HarmonyApiClient {
1577
1583
  params.set("type", options.type);
1578
1584
  if (options.limit !== undefined)
1579
1585
  params.set("limit", String(options.limit));
1586
+ if (options.include_episodes)
1587
+ params.set("include_episodes", "true");
1580
1588
  return this.request("GET", `/memory/index?${params.toString()}`);
1581
1589
  }
1582
1590
  async getVaultIndexMarkdown(options) {
@@ -1588,6 +1596,8 @@ class HarmonyApiClient {
1588
1596
  params.set("type", options.type);
1589
1597
  if (options.limit !== undefined)
1590
1598
  params.set("limit", String(options.limit));
1599
+ if (options.include_episodes)
1600
+ params.set("include_episodes", "true");
1591
1601
  return this.requestRaw("GET", `/memory/index?${params.toString()}`, undefined, {
1592
1602
  accept: "text/markdown"
1593
1603
  });
@@ -1645,6 +1655,8 @@ class HarmonyApiClient {
1645
1655
  params.set("type", options.type);
1646
1656
  if (options?.limit !== undefined)
1647
1657
  params.set("limit", String(options.limit));
1658
+ if (options?.include_episodes)
1659
+ params.set("include_episodes", "true");
1648
1660
  return this.requestRaw("GET", `/memory/search?${params.toString()}`, undefined, {
1649
1661
  accept: "text/markdown"
1650
1662
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gethmy/mcp",
3
- "version": "2.16.0",
3
+ "version": "2.17.0",
4
4
  "description": "MCP server for Harmony Kanban board - enables AI coding agents to manage your boards",
5
5
  "publishConfig": {
6
6
  "access": "public"
package/src/api-client.ts CHANGED
@@ -1185,6 +1185,9 @@ export class HarmonyApiClient {
1185
1185
  limit?: number;
1186
1186
  offset?: number;
1187
1187
  include_superseded?: boolean;
1188
+ // Opt in to agent-run episodes (default excluded, #677). Only the daemon's
1189
+ // own rolling-episode lookup should set this.
1190
+ include_episodes?: boolean;
1188
1191
  }): Promise<{ entities: unknown[]; count: number }> {
1189
1192
  const params = new URLSearchParams();
1190
1193
  params.set("workspace_id", options.workspace_id);
@@ -1201,6 +1204,7 @@ export class HarmonyApiClient {
1201
1204
  if (options.offset !== undefined)
1202
1205
  params.set("offset", String(options.offset));
1203
1206
  if (options.include_superseded) params.set("include_superseded", "true");
1207
+ if (options.include_episodes) params.set("include_episodes", "true");
1204
1208
  return this.request("GET", `/memory/entities?${params.toString()}`);
1205
1209
  }
1206
1210
 
@@ -1249,6 +1253,9 @@ export class HarmonyApiClient {
1249
1253
  tags?: string[];
1250
1254
  minConfidence?: number;
1251
1255
  topK?: number;
1256
+ // Opt in to agent-run episodes (default excluded server-side, #677). The
1257
+ // daemon sets this when looking up its own rolling implement/review episode.
1258
+ includeEpisodes?: boolean;
1252
1259
  }): Promise<{ entities: unknown[] }> {
1253
1260
  // Over-fetch beyond topK so client-side filters (multi-type, memory_tier,
1254
1261
  // tags) have headroom — matches the MCP server's recall path (server.ts).
@@ -1265,6 +1272,7 @@ export class HarmonyApiClient {
1265
1272
  project_id: options.projectId,
1266
1273
  type: options.type?.length === 1 ? options.type[0] : undefined,
1267
1274
  limit: fetchLimit,
1275
+ include_episodes: options.includeEpisodes,
1268
1276
  },
1269
1277
  );
1270
1278
  entities = (search.entities ?? []) as Array<Record<string, unknown>>;
@@ -1277,6 +1285,7 @@ export class HarmonyApiClient {
1277
1285
  tags: options.tags,
1278
1286
  min_confidence: options.minConfidence,
1279
1287
  limit: fetchLimit,
1288
+ include_episodes: options.includeEpisodes,
1280
1289
  });
1281
1290
  entities = (list.entities ?? []) as Array<Record<string, unknown>>;
1282
1291
  }
@@ -1360,6 +1369,7 @@ export class HarmonyApiClient {
1360
1369
  limit?: number;
1361
1370
  tags?: string[];
1362
1371
  include_superseded?: boolean;
1372
+ include_episodes?: boolean;
1363
1373
  },
1364
1374
  ): Promise<{ entities: unknown[]; count: number }> {
1365
1375
  const params = new URLSearchParams();
@@ -1373,6 +1383,7 @@ export class HarmonyApiClient {
1373
1383
  // matches against the canonical `tags_normalized` column (#299).
1374
1384
  for (const tag of options?.tags ?? []) params.append("tags", tag);
1375
1385
  if (options?.include_superseded) params.set("include_superseded", "true");
1386
+ if (options?.include_episodes) params.set("include_episodes", "true");
1376
1387
  return this.request("GET", `/memory/search?${params.toString()}`);
1377
1388
  }
1378
1389
 
@@ -1383,12 +1394,14 @@ export class HarmonyApiClient {
1383
1394
  project_id?: string;
1384
1395
  type?: string;
1385
1396
  limit?: number;
1397
+ include_episodes?: boolean;
1386
1398
  }): Promise<{ entities: unknown[]; count: number }> {
1387
1399
  const params = new URLSearchParams();
1388
1400
  params.set("workspace_id", options.workspace_id);
1389
1401
  if (options.project_id) params.set("project_id", options.project_id);
1390
1402
  if (options.type) params.set("type", options.type);
1391
1403
  if (options.limit !== undefined) params.set("limit", String(options.limit));
1404
+ if (options.include_episodes) params.set("include_episodes", "true");
1392
1405
  return this.request("GET", `/memory/index?${params.toString()}`);
1393
1406
  }
1394
1407
 
@@ -1397,12 +1410,14 @@ export class HarmonyApiClient {
1397
1410
  project_id?: string;
1398
1411
  type?: string;
1399
1412
  limit?: number;
1413
+ include_episodes?: boolean;
1400
1414
  }): Promise<string> {
1401
1415
  const params = new URLSearchParams();
1402
1416
  params.set("workspace_id", options.workspace_id);
1403
1417
  if (options.project_id) params.set("project_id", options.project_id);
1404
1418
  if (options.type) params.set("type", options.type);
1405
1419
  if (options.limit !== undefined) params.set("limit", String(options.limit));
1420
+ if (options.include_episodes) params.set("include_episodes", "true");
1406
1421
  return this.requestRaw(
1407
1422
  "GET",
1408
1423
  `/memory/index?${params.toString()}`,
@@ -1489,6 +1504,7 @@ export class HarmonyApiClient {
1489
1504
  project_id?: string;
1490
1505
  type?: string;
1491
1506
  limit?: number;
1507
+ include_episodes?: boolean;
1492
1508
  },
1493
1509
  ): Promise<string> {
1494
1510
  const params = new URLSearchParams();
@@ -1498,6 +1514,7 @@ export class HarmonyApiClient {
1498
1514
  if (options?.type) params.set("type", options.type);
1499
1515
  if (options?.limit !== undefined)
1500
1516
  params.set("limit", String(options.limit));
1517
+ if (options?.include_episodes) params.set("include_episodes", "true");
1501
1518
  return this.requestRaw(
1502
1519
  "GET",
1503
1520
  `/memory/search?${params.toString()}`,
package/src/server.ts CHANGED
@@ -1743,6 +1743,11 @@ export const TOOLS = {
1743
1743
  description:
1744
1744
  "Include rows whose `superseded_at` is set (default false). Use when investigating supersede chains.",
1745
1745
  },
1746
+ include_episodes: {
1747
+ type: "boolean",
1748
+ description:
1749
+ "Include agent-run episodes — the daemon's per-run implement/review captures (default false). Excluded by default so recall surfaces curated, durable memory. Set true to audit the agent's run history.",
1750
+ },
1746
1751
  },
1747
1752
  },
1748
1753
  },
@@ -1934,6 +1939,11 @@ export const TOOLS = {
1934
1939
  description: "Project ID (optional)",
1935
1940
  },
1936
1941
  limit: { type: "number", description: "Max results (default: 20)" },
1942
+ include_episodes: {
1943
+ type: "boolean",
1944
+ description:
1945
+ "Include agent-run episodes — the daemon's per-run captures (default false). Excluded by default so search surfaces curated memory.",
1946
+ },
1937
1947
  },
1938
1948
  required: ["query"],
1939
1949
  },
@@ -1978,6 +1988,11 @@ export const TOOLS = {
1978
1988
  type: "number",
1979
1989
  description: "Max entities to return (default: 200)",
1980
1990
  },
1991
+ include_episodes: {
1992
+ type: "boolean",
1993
+ description:
1994
+ "Include agent-run episodes — the daemon's per-run captures (default false). Excluded by default so the index shows curated vault content, not run noise.",
1995
+ },
1981
1996
  },
1982
1997
  required: [],
1983
1998
  },
@@ -4108,6 +4123,8 @@ async function handleToolCall(
4108
4123
  const topK = args.top_k as number | undefined;
4109
4124
  const budgetTokens = args.budget_tokens as number | undefined;
4110
4125
  const includeSuperseded = Boolean(args.include_superseded);
4126
+ // #677: agent-run episodes are excluded from recall by default; opt in.
4127
+ const includeEpisodes = Boolean(args.include_episodes);
4111
4128
  const queryText = args.query as string | undefined;
4112
4129
 
4113
4130
  // Over-fetch when top_k is smaller than limit so the rescorer has
@@ -4166,6 +4183,7 @@ async function handleToolCall(
4166
4183
  ? requestedTags
4167
4184
  : undefined,
4168
4185
  include_superseded: includeSuperseded,
4186
+ include_episodes: includeEpisodes,
4169
4187
  },
4170
4188
  );
4171
4189
  entities = (searchResult.entities ?? []) as any[];
@@ -4199,6 +4217,7 @@ async function handleToolCall(
4199
4217
  min_confidence: args.minConfidence as number | undefined,
4200
4218
  limit: fetchLimit,
4201
4219
  include_superseded: includeSuperseded,
4220
+ include_episodes: includeEpisodes,
4202
4221
  });
4203
4222
  entities = listed as any[];
4204
4223
  if (excludeSessionFromLongTerm) {
@@ -4543,6 +4562,7 @@ async function handleToolCall(
4543
4562
  undefined,
4544
4563
  type: args.type as string | undefined,
4545
4564
  limit: args.limit as number | undefined,
4565
+ include_episodes: Boolean(args.include_episodes),
4546
4566
  },
4547
4567
  );
4548
4568
 
@@ -4570,6 +4590,7 @@ async function handleToolCall(
4570
4590
  (args.projectId as string) || deps.getActiveProjectId() || undefined,
4571
4591
  type: args.type as string | undefined,
4572
4592
  limit: args.limit as number | undefined,
4593
+ include_episodes: Boolean(args.include_episodes),
4573
4594
  });
4574
4595
  return markdown || "No entities found.";
4575
4596
  }