@jeffober/thatch 0.1.12 → 0.1.14

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/src/tool-defs.ts CHANGED
@@ -340,6 +340,33 @@ const markCheckedDef: ToolDef = {
340
340
  },
341
341
  };
342
342
 
343
+ /**
344
+ * Acknowledge that the extraction nudge has been handled. Drains the
345
+ * extraction buffer so the nudge does not replay on the next turn.
346
+ *
347
+ * The actual draining happens in the host's post-tool hook
348
+ * (tool.execute.after for opencode, PostToolBatch/appendBatch for MCP) —
349
+ * this tool's execute function is a no-op confirmation. The tool exists so
350
+ * the model can call it in the parent session after dispatching the
351
+ * fact-extractor to a sub-agent, giving the hook a recognizable tool name
352
+ * to key on. Without it, the buffer only drains when a memory_remember
353
+ * call lands in the same session (or a tracked child session), which fails
354
+ * if the sub-agent errors out or the host doesn't expose parent-child
355
+ * session relationships.
356
+ */
357
+ const extractionDoneDef: ToolDef = {
358
+ name: "extraction_done",
359
+ description:
360
+ "Acknowledge that the extraction nudge has been dispatched to a sub-agent. " +
361
+ "Drains the extraction buffer so the nudge does not replay. " +
362
+ "Call this in the parent session after dispatching a background task " +
363
+ "to run the thatch-fact-extractor skill.",
364
+ args: {},
365
+ async execute() {
366
+ return "[acknowledged] extraction buffer drained";
367
+ },
368
+ };
369
+
343
370
  /**
344
371
  * All tool definitions, in the order they should be presented to the agent.
345
372
  * The opencode plugin wraps each in `tool()`; the MCP server exposes them
@@ -354,4 +381,5 @@ export const TOOL_DEFS: ToolDef[] = [
354
381
  listStoresDef,
355
382
  findDuplicatesDef,
356
383
  markCheckedDef,
384
+ extractionDoneDef,
357
385
  ];