From 0634f2048c7c9a474aab1d8104b964b3bf70a064 Mon Sep 17 00:00:00 2001 From: tanaka takashi Date: Sat, 4 Jul 2026 17:21:32 +0900 Subject: feat(P1-002): migrate offline JSONL import/export to dedicated CLI - Replace the MCP import_messages tool with standalone CLI commands: iny-convmem-mcp --data-dir --import iny-convmem-mcp --data-dir --export - Add src/cli/{import,export,cli.h} and a CTest process test (tiny-convmem-mcp.cli) covering round-trip, manifest generation, overwrite/reject policies, and include_deleted export. - Fix Debug heap corruption in iny_store_import() by deep-copying imported messages instead of taking ownership of caller-allocated records, which were later freed by the caller. - Remove the now-redundant src/mcp/tools/import_messages.c and keep the tool registry at 7 MCP tools. - Update docs/development-plan.md (P1-002 complete) and docs/implementation-status.md with CLI test coverage. --- src/cli/cli.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/cli/cli.h (limited to 'src/cli/cli.h') diff --git a/src/cli/cli.h b/src/cli/cli.h new file mode 100644 index 0000000..1b173b4 --- /dev/null +++ b/src/cli/cli.h @@ -0,0 +1,21 @@ +#ifndef TINY_CONVMEM_CLI_H +#define TINY_CONVMEM_CLI_H + +#include "storage/store.h" + +#define TINY_CLI_LINE_MAX (TINY_CONTENT_MAX + 4096U) + +typedef struct tiny_cli_options +{ + const char *data_dir; + const char *import_path; + const char *export_path; + const char *session_id; + const char *policy_name; + int include_deleted; +} tiny_cli_options_t; + +int tiny_cli_import(tiny_store_t *store, const tiny_cli_options_t *options); +int tiny_cli_export(tiny_store_t *store, const tiny_cli_options_t *options); + +#endif -- cgit v1.2.3