supermemory/packages/tools/src
Rohit 76470610ff fix(tools): align claude-memory insert with memory_20250818 line semantics
Anthropic's memory_20250818 spec defines insert as: insert_text is inserted
AFTER line insert_line, 0 inserts at the beginning of the file, and the valid
range is [0, n_lines]. The implementation treated insert_line as a 1-based
insert-BEFORE index with range [1, n_lines + 1].

Since the caller of this tool is Claude itself, which is trained on the spec
semantics, every model-driven insert landed one line earlier than intended,
insert_line: 0 (insert at top of file) was rejected as invalid, and
insert_line: n_lines (append) inserted before the last line instead of after
it.

Fix the validation range to [0, n_lines], splice at insert_line directly
(0-based insert-after), and update the error and success messages to match.
One existing tool-operations test encoded the old insert-before behavior; its
insert_line is adjusted so its expected output is unchanged under spec
semantics. Adds four regression tests covering top-of-file, middle,
append, and both out-of-range directions.
2026-10-02 18:35:07 -07:00
..
mastra feat(tools): SDK-level cross-source memory deduplication (#1531) 2026-09-01 06:10:36 +00:00
openai fix(tools): isolate OpenAI middleware clients 2026-10-02 18:35:07 -07:00
shared feat(tools): SDK-level cross-source memory deduplication (#1531) 2026-09-01 06:10:36 +00:00
vercel feat(tools): SDK-level cross-source memory deduplication (#1531) 2026-09-01 06:10:36 +00:00
voltagent feat(tools): SDK-level cross-source memory deduplication (#1531) 2026-09-01 06:10:36 +00:00
ai-sdk.ts feat(tools): 7-tool parity and description refresh (#1432) 2026-09-01 05:59:57 +00:00
claude-memory-simple-example.ts feat: mobile responsive, lint formats, toast, render issue fix (#688) 2026-01-21 03:11:53 +00:00
claude-memory.test.ts fix(tools): align claude-memory insert with memory_20250818 line semantics 2026-10-02 18:35:07 -07:00
claude-memory.ts fix(tools): align claude-memory insert with memory_20250818 line semantics 2026-10-02 18:35:07 -07:00
conversations-client.ts feat(tools): 7-tool parity and description refresh (#1432) 2026-09-01 05:59:57 +00:00
index.ts feat(tools): 7-tool parity and description refresh (#1432) 2026-09-01 05:59:57 +00:00
mastra.ts mastra integration (#717) 2026-02-03 00:43:08 +00:00
tool-operations.test.ts fix(tools): align claude-memory insert with memory_20250818 line semantics 2026-10-02 18:35:07 -07:00
tools-shared.test.ts feat(tools): SDK-level cross-source memory deduplication (#1531) 2026-09-01 06:10:36 +00:00
tools-shared.ts feat(tools): SDK-level cross-source memory deduplication (#1531) 2026-09-01 06:10:36 +00:00
tools.test.ts fix(tools): repair SDK call mismatches that broke five tools (#1186) 2026-07-10 18:30:41 -07:00
types.ts feat: tools package strict mode for openai models (#699) 2026-01-23 03:15:39 +00:00