summaryrefslogtreecommitdiff
path: root/src/cli/cli.h
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-07-04 17:21:32 +0900
committertanaka takashi <isazaka@gmail.com>2026-07-04 17:21:32 +0900
commit0634f2048c7c9a474aab1d8104b964b3bf70a064 (patch)
tree508c305a64cbd3b01f5146776e22865d283d5dbb /src/cli/cli.h
parenteb5e9d9f37bda7d78f69614da70402357794168a (diff)
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 <path> --import <file> iny-convmem-mcp --data-dir <path> --export <file> - 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.
Diffstat (limited to 'src/cli/cli.h')
-rw-r--r--src/cli/cli.h21
1 files changed, 21 insertions, 0 deletions
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