@kitakitsune/memoria 0.1.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.
@@ -0,0 +1,6 @@
1
+ import { Command } from 'commander';
2
+
3
+ declare function createProgram(): Command;
4
+ declare function run(): Promise<void>;
5
+
6
+ export { createProgram, run };
@@ -0,0 +1,377 @@
1
+ import {
2
+ MEMORY_TYPES,
3
+ TYPE_TO_CATEGORY,
4
+ configExists,
5
+ createNotionClient,
6
+ endSession,
7
+ getDocument,
8
+ getRecentHandoffs,
9
+ getSession,
10
+ initVault,
11
+ listDocuments,
12
+ pullFromNotion,
13
+ pushToNotion,
14
+ resolveVault,
15
+ searchDocuments,
16
+ startSession,
17
+ storeDocument,
18
+ updateCheckpoint,
19
+ writeConfig
20
+ } from "../chunk-R6AR3ICV.js";
21
+
22
+ // src/cli/index.ts
23
+ import { Command } from "commander";
24
+
25
+ // src/commands/init.ts
26
+ import { resolve } from "path";
27
+ import chalk from "chalk";
28
+ async function initCommand(targetPath, options) {
29
+ const vaultPath = resolve(targetPath);
30
+ const name = options.name || targetPath.split("/").pop() || "memoria";
31
+ if (await configExists(vaultPath)) {
32
+ console.log(chalk.yellow(`Vault already exists at ${vaultPath}`));
33
+ return;
34
+ }
35
+ const config = await initVault(vaultPath, name);
36
+ console.log(chalk.green(`Initialized Memoria vault "${config.name}" at ${vaultPath}`));
37
+ console.log(chalk.dim(`Categories: ${config.categories.join(", ")}`));
38
+ }
39
+
40
+ // src/commands/store.ts
41
+ import chalk2 from "chalk";
42
+ async function storeCommand(category, title, options) {
43
+ const config = await resolveVault(options.vault);
44
+ const tags = options.tags ? options.tags.split(",").map((t) => t.trim()) : [];
45
+ const doc = await storeDocument(config.path, {
46
+ category,
47
+ title,
48
+ content: options.content || "",
49
+ frontmatter: tags.length > 0 ? { tags } : void 0,
50
+ overwrite: options.overwrite
51
+ });
52
+ console.log(chalk2.green(`Stored: ${doc.path}`));
53
+ console.log(chalk2.dim(`Category: ${doc.category} | Title: ${doc.title}`));
54
+ }
55
+
56
+ // src/commands/remember.ts
57
+ import chalk3 from "chalk";
58
+ async function rememberCommand(type, title, options) {
59
+ if (!MEMORY_TYPES.includes(type)) {
60
+ console.log(chalk3.red(`Invalid memory type: "${type}"`));
61
+ console.log(chalk3.dim(`Valid types: ${MEMORY_TYPES.join(", ")}`));
62
+ process.exit(1);
63
+ }
64
+ const memType = type;
65
+ const category = TYPE_TO_CATEGORY[memType];
66
+ const config = await resolveVault(options.vault);
67
+ const tags = options.tags ? options.tags.split(",").map((t) => t.trim()) : [];
68
+ const doc = await storeDocument(config.path, {
69
+ category,
70
+ title,
71
+ content: options.content || "",
72
+ frontmatter: { type: memType, ...tags.length > 0 ? { tags } : {} },
73
+ overwrite: options.overwrite
74
+ });
75
+ console.log(chalk3.green(`Remembered ${memType}: ${doc.title}`));
76
+ console.log(chalk3.dim(`Stored in: ${doc.path}`));
77
+ }
78
+
79
+ // src/commands/list.ts
80
+ import chalk4 from "chalk";
81
+ async function listCommand(category, options) {
82
+ const config = await resolveVault(options.vault);
83
+ let docs = await listDocuments(config.path, category);
84
+ if (options.tags) {
85
+ const filterTags = options.tags.split(",").map((t) => t.trim().toLowerCase());
86
+ docs = docs.filter(
87
+ (doc) => filterTags.some((ft) => doc.tags.map((t) => t.toLowerCase()).includes(ft))
88
+ );
89
+ }
90
+ if (docs.length === 0) {
91
+ console.log(chalk4.dim("No documents found."));
92
+ return;
93
+ }
94
+ console.log(chalk4.bold(`${docs.length} document(s):
95
+ `));
96
+ for (const doc of docs) {
97
+ const tags = doc.tags.length > 0 ? chalk4.dim(` [${doc.tags.join(", ")}]`) : "";
98
+ console.log(` ${chalk4.cyan(doc.category)}/${chalk4.white(doc.title)}${tags}`);
99
+ }
100
+ }
101
+
102
+ // src/commands/get.ts
103
+ import chalk5 from "chalk";
104
+ async function getCommand(id, options) {
105
+ const config = await resolveVault(options.vault);
106
+ try {
107
+ const doc = await getDocument(config.path, id);
108
+ console.log(chalk5.bold(doc.title));
109
+ console.log(chalk5.dim(`Category: ${doc.category} | Created: ${doc.created}`));
110
+ if (doc.tags.length > 0) {
111
+ console.log(chalk5.dim(`Tags: ${doc.tags.join(", ")}`));
112
+ }
113
+ console.log();
114
+ console.log(doc.content);
115
+ } catch {
116
+ console.log(chalk5.red(`Document not found: ${id}`));
117
+ process.exit(1);
118
+ }
119
+ }
120
+
121
+ // src/commands/search.ts
122
+ import chalk6 from "chalk";
123
+ async function searchCommand(query, options) {
124
+ const config = await resolveVault(options.vault);
125
+ const docs = await listDocuments(config.path);
126
+ const limit = options.limit ? parseInt(options.limit, 10) : 10;
127
+ const results = searchDocuments(docs, query, {
128
+ limit,
129
+ category: options.category
130
+ });
131
+ if (results.length === 0) {
132
+ console.log(chalk6.dim(`No results for "${query}"`));
133
+ return;
134
+ }
135
+ console.log(chalk6.bold(`${results.length} result(s) for "${query}":
136
+ `));
137
+ for (const result of results) {
138
+ const score = (result.score * 100).toFixed(0);
139
+ console.log(
140
+ ` ${chalk6.cyan(result.document.category)}/${chalk6.white(result.document.title)} ${chalk6.dim(`(${score}%)`)}`
141
+ );
142
+ console.log(chalk6.dim(` ${result.snippet}`));
143
+ console.log();
144
+ }
145
+ }
146
+
147
+ // src/commands/wake.ts
148
+ import chalk7 from "chalk";
149
+ async function wakeCommand(options) {
150
+ const config = await resolveVault(options.vault);
151
+ const session = await getSession(config.path);
152
+ if (session.state === "active") {
153
+ console.log(chalk7.yellow("Session already active."));
154
+ console.log(chalk7.dim(`Started: ${session.startedAt}`));
155
+ if (session.workingOn) {
156
+ console.log(chalk7.dim(`Working on: ${session.workingOn}`));
157
+ }
158
+ return;
159
+ }
160
+ await startSession(config.path);
161
+ console.log(chalk7.green(`Memoria vault "${config.name}" is awake.
162
+ `));
163
+ const handoffs = await getRecentHandoffs(config.path);
164
+ if (handoffs.length > 0) {
165
+ console.log(chalk7.bold("Recent handoffs:"));
166
+ for (const h of handoffs) {
167
+ console.log(chalk7.dim(` [${h.created.slice(0, 10)}]`));
168
+ const lines = h.summary.split("\n").filter((l) => l.trim());
169
+ for (const line of lines.slice(0, 3)) {
170
+ console.log(` ${line}`);
171
+ }
172
+ }
173
+ console.log();
174
+ }
175
+ const docs = await listDocuments(config.path);
176
+ const recent = docs.sort((a, b) => b.updated.localeCompare(a.updated)).slice(0, 5);
177
+ if (recent.length > 0) {
178
+ console.log(chalk7.bold("Recent memories:"));
179
+ for (const doc of recent) {
180
+ console.log(` ${chalk7.cyan(doc.category)}/${chalk7.white(doc.title)}`);
181
+ }
182
+ }
183
+ }
184
+
185
+ // src/commands/sleep.ts
186
+ import chalk8 from "chalk";
187
+ async function sleepCommand(summary, options) {
188
+ const config = await resolveVault(options.vault);
189
+ const session = await getSession(config.path);
190
+ if (session.state !== "active") {
191
+ console.log(chalk8.yellow('No active session. Run "memoria wake" first.'));
192
+ return;
193
+ }
194
+ const handoff = await endSession(config.path, summary, options.next);
195
+ console.log(chalk8.green("Session ended. Handoff saved."));
196
+ console.log(chalk8.dim(`Summary: ${summary}`));
197
+ if (options.next) {
198
+ console.log(chalk8.dim(`Next steps: ${options.next}`));
199
+ }
200
+ console.log(chalk8.dim(`Handoff: sessions/handoffs/${handoff.created.slice(0, 10)}.md`));
201
+ }
202
+
203
+ // src/commands/checkpoint.ts
204
+ import chalk9 from "chalk";
205
+ async function checkpointCommand(options) {
206
+ const config = await resolveVault(options.vault);
207
+ const session = await getSession(config.path);
208
+ if (session.state !== "active") {
209
+ console.log(chalk9.yellow('No active session. Run "memoria wake" first.'));
210
+ return;
211
+ }
212
+ const updated = await updateCheckpoint(
213
+ config.path,
214
+ options.workingOn,
215
+ options.focus
216
+ );
217
+ console.log(chalk9.green("Checkpoint saved."));
218
+ if (updated.workingOn) {
219
+ console.log(chalk9.dim(`Working on: ${updated.workingOn}`));
220
+ }
221
+ if (updated.focus) {
222
+ console.log(chalk9.dim(`Focus: ${updated.focus}`));
223
+ }
224
+ console.log(chalk9.dim(`Time: ${updated.lastCheckpoint}`));
225
+ }
226
+
227
+ // src/commands/status.ts
228
+ import chalk10 from "chalk";
229
+ async function statusCommand(options) {
230
+ const config = await resolveVault(options.vault);
231
+ const session = await getSession(config.path);
232
+ const docs = await listDocuments(config.path);
233
+ console.log(chalk10.bold(`Memoria: ${config.name}
234
+ `));
235
+ console.log(` Path: ${config.path}`);
236
+ console.log(` Documents: ${docs.length}`);
237
+ console.log(` Categories: ${config.categories.length}`);
238
+ console.log(` Session: ${session.state === "active" ? chalk10.green("active") : chalk10.dim("idle")}`);
239
+ if (session.state === "active") {
240
+ if (session.startedAt) {
241
+ console.log(` Started: ${session.startedAt}`);
242
+ }
243
+ if (session.workingOn) {
244
+ console.log(` Working on: ${session.workingOn}`);
245
+ }
246
+ if (session.focus) {
247
+ console.log(` Focus: ${session.focus}`);
248
+ }
249
+ if (session.lastCheckpoint) {
250
+ console.log(` Checkpoint: ${session.lastCheckpoint}`);
251
+ }
252
+ }
253
+ if (docs.length > 0) {
254
+ const byCat = {};
255
+ for (const doc of docs) {
256
+ byCat[doc.category] = (byCat[doc.category] || 0) + 1;
257
+ }
258
+ console.log(chalk10.bold("\n By category:"));
259
+ for (const [cat, count] of Object.entries(byCat).sort((a, b) => b[1] - a[1])) {
260
+ console.log(` ${chalk10.cyan(cat)}: ${count}`);
261
+ }
262
+ }
263
+ if (config.notion) {
264
+ console.log(chalk10.bold("\n Notion:"));
265
+ console.log(` Connected: ${chalk10.green("yes")}`);
266
+ console.log(` Root page: ${config.notion.rootPageId}`);
267
+ } else {
268
+ console.log(chalk10.dim("\n Notion: not configured"));
269
+ }
270
+ }
271
+
272
+ // src/commands/setup-notion.ts
273
+ import chalk11 from "chalk";
274
+ async function setupNotionCommand(options) {
275
+ if (!options.token || !options.page) {
276
+ console.log(chalk11.red("Both --token and --page are required."));
277
+ console.log(chalk11.dim("Usage: memoria setup-notion --token <token> --page <root-page-id>"));
278
+ process.exit(1);
279
+ }
280
+ const config = await resolveVault(options.vault);
281
+ const client = createNotionClient(options.token);
282
+ try {
283
+ await client.pages.retrieve({ page_id: options.page });
284
+ } catch (err) {
285
+ console.log(chalk11.red("Failed to access Notion page. Check your token and page ID."));
286
+ console.log(chalk11.dim(err instanceof Error ? err.message : String(err)));
287
+ process.exit(1);
288
+ }
289
+ config.notion = {
290
+ token: options.token,
291
+ rootPageId: options.page
292
+ };
293
+ await writeConfig(config);
294
+ console.log(chalk11.green("Notion integration configured."));
295
+ console.log(chalk11.dim(`Root page: ${options.page}`));
296
+ console.log(chalk11.dim('Run "memoria sync --push" to push your vault to Notion.'));
297
+ }
298
+
299
+ // src/commands/sync.ts
300
+ import chalk12 from "chalk";
301
+ async function syncCommand(options) {
302
+ const config = await resolveVault(options.vault);
303
+ if (!config.notion) {
304
+ console.log(chalk12.red('Notion not configured. Run "memoria setup-notion" first.'));
305
+ process.exit(1);
306
+ }
307
+ const client = createNotionClient(config.notion.token);
308
+ const doPush = options.push || !options.push && !options.pull;
309
+ const doPull = options.pull || !options.push && !options.pull;
310
+ if (options.dryRun) {
311
+ console.log(chalk12.dim("Dry run mode -- no changes will be made.\n"));
312
+ }
313
+ if (doPush) {
314
+ console.log(chalk12.bold("Pushing to Notion..."));
315
+ const report = await pushToNotion(client, config, { dryRun: options.dryRun });
316
+ printReport("Push", report);
317
+ }
318
+ if (doPull) {
319
+ console.log(chalk12.bold("Pulling from Notion..."));
320
+ const report = await pullFromNotion(client, config, {
321
+ preferNotion: options.preferNotion,
322
+ dryRun: options.dryRun
323
+ });
324
+ printReport("Pull", report);
325
+ }
326
+ }
327
+ function printReport(direction, report) {
328
+ if (report.pushed.length > 0) {
329
+ console.log(chalk12.green(` ${direction}: ${report.pushed.length} pushed`));
330
+ }
331
+ if (report.pulled.length > 0) {
332
+ console.log(chalk12.green(` ${direction}: ${report.pulled.length} pulled`));
333
+ }
334
+ if (report.conflicts.length > 0) {
335
+ console.log(chalk12.yellow(` ${direction}: ${report.conflicts.length} conflict(s) (local preferred)`));
336
+ for (const c of report.conflicts) {
337
+ console.log(chalk12.dim(` - ${c}`));
338
+ }
339
+ }
340
+ if (report.errors.length > 0) {
341
+ console.log(chalk12.red(` ${direction}: ${report.errors.length} error(s)`));
342
+ for (const e of report.errors) {
343
+ console.log(chalk12.dim(` - ${e}`));
344
+ }
345
+ }
346
+ if (report.pushed.length === 0 && report.pulled.length === 0 && report.conflicts.length === 0 && report.errors.length === 0) {
347
+ console.log(chalk12.dim(` ${direction}: everything up to date`));
348
+ }
349
+ console.log();
350
+ }
351
+
352
+ // src/cli/index.ts
353
+ function createProgram() {
354
+ const program = new Command();
355
+ program.name("memoria").description("Structured memory system for AI agents with Notion sync").version("0.1.0");
356
+ program.command("init <path>").description("Initialize a new Memoria vault").option("-n, --name <name>", "Vault name").action(initCommand);
357
+ program.command("store <category> <title>").description("Store a document in an explicit category").option("-c, --content <content>", "Document content").option("-t, --tags <tags>", "Comma-separated tags").option("-v, --vault <path>", "Vault path").option("--overwrite", "Overwrite existing document").action(storeCommand);
358
+ program.command("remember <type> <title>").description("Store a typed memory (fact, decision, lesson, etc.)").option("-c, --content <content>", "Memory content").option("-t, --tags <tags>", "Comma-separated tags").option("-v, --vault <path>", "Vault path").option("--overwrite", "Overwrite existing document").action(rememberCommand);
359
+ program.command("list [category]").description("List documents in the vault").option("-t, --tags <tags>", "Filter by comma-separated tags").option("-v, --vault <path>", "Vault path").action(listCommand);
360
+ program.command("get <id>").description("Get a specific document by ID (category/slug)").option("-v, --vault <path>", "Vault path").action(getCommand);
361
+ program.command("search <query>").description("Search documents by text query").option("--category <category>", "Filter by category").option("-l, --limit <n>", "Max results", "10").option("-v, --vault <path>", "Vault path").action(searchCommand);
362
+ program.command("wake").description("Start a new session, load recent context").option("-v, --vault <path>", "Vault path").action(wakeCommand);
363
+ program.command("sleep <summary>").description("End the current session with a handoff summary").option("--next <steps>", "Next steps for the following session").option("-v, --vault <path>", "Vault path").action(sleepCommand);
364
+ program.command("checkpoint").description("Save a mid-session checkpoint").option("--working-on <task>", "What you are working on").option("--focus <focus>", "Current focus area").option("-v, --vault <path>", "Vault path").action(checkpointCommand);
365
+ program.command("status").description("Show vault stats and session state").option("-v, --vault <path>", "Vault path").action(statusCommand);
366
+ program.command("setup-notion").description("Configure Notion integration").requiredOption("--token <token>", "Notion integration token").requiredOption("--page <pageId>", "Root Notion page ID").option("-v, --vault <path>", "Vault path").action(setupNotionCommand);
367
+ program.command("sync").description("Sync vault with Notion (push and/or pull)").option("--push", "Push local changes to Notion").option("--pull", "Pull Notion changes to local").option("--prefer-notion", "On conflict, prefer Notion version").option("--dry-run", "Show what would change without modifying anything").option("-v, --vault <path>", "Vault path").action(syncCommand);
368
+ return program;
369
+ }
370
+ async function run() {
371
+ const program = createProgram();
372
+ await program.parseAsync(process.argv);
373
+ }
374
+ export {
375
+ createProgram,
376
+ run
377
+ };
@@ -0,0 +1,136 @@
1
+ import { Client } from '@notionhq/client';
2
+ import { BlockObjectRequest } from '@notionhq/client/build/src/api-endpoints.js';
3
+
4
+ interface VaultConfig {
5
+ path: string;
6
+ name: string;
7
+ categories: string[];
8
+ notion?: NotionConfig;
9
+ }
10
+ interface NotionConfig {
11
+ token: string;
12
+ rootPageId: string;
13
+ databases?: Record<string, string>;
14
+ }
15
+ interface VaultMeta {
16
+ name: string;
17
+ version: string;
18
+ created: string;
19
+ lastUpdated: string;
20
+ categories: string[];
21
+ documentCount: number;
22
+ }
23
+ interface MemDocument {
24
+ id: string;
25
+ path: string;
26
+ category: string;
27
+ title: string;
28
+ content: string;
29
+ frontmatter: Record<string, unknown>;
30
+ tags: string[];
31
+ created: string;
32
+ updated: string;
33
+ }
34
+ interface SearchResult {
35
+ document: MemDocument;
36
+ score: number;
37
+ snippet: string;
38
+ }
39
+ interface SearchOptions {
40
+ limit?: number;
41
+ minScore?: number;
42
+ category?: string;
43
+ tags?: string[];
44
+ }
45
+ interface StoreOptions {
46
+ category: string;
47
+ title: string;
48
+ content: string;
49
+ frontmatter?: Record<string, unknown>;
50
+ overwrite?: boolean;
51
+ }
52
+ type MemoryType = 'fact' | 'decision' | 'lesson' | 'commitment' | 'preference' | 'relationship' | 'project';
53
+ declare const MEMORY_TYPES: MemoryType[];
54
+ declare const TYPE_TO_CATEGORY: Record<MemoryType, string>;
55
+ declare const DEFAULT_CATEGORIES: string[];
56
+ type SessionState = 'idle' | 'active';
57
+ interface SessionData {
58
+ state: SessionState;
59
+ startedAt?: string;
60
+ workingOn?: string;
61
+ focus?: string;
62
+ lastCheckpoint?: string;
63
+ }
64
+ interface HandoffDocument {
65
+ created: string;
66
+ summary: string;
67
+ workingOn?: string;
68
+ focus?: string;
69
+ nextSteps?: string;
70
+ decisions?: string[];
71
+ openQuestions?: string[];
72
+ }
73
+ interface SyncStateEntry {
74
+ localPath: string;
75
+ notionPageId: string;
76
+ lastSyncedAt: string;
77
+ localUpdatedAt: string;
78
+ notionUpdatedAt: string;
79
+ }
80
+ interface SyncState {
81
+ lastSyncAt: string;
82
+ databases: Record<string, string>;
83
+ entries: Record<string, SyncStateEntry>;
84
+ }
85
+
86
+ declare function initVault(vaultPath: string, name: string, categories?: string[]): Promise<VaultConfig>;
87
+ declare function resolveVault(startPath?: string): Promise<VaultConfig>;
88
+ declare function storeDocument(vaultPath: string, options: StoreOptions): Promise<MemDocument>;
89
+ declare function getDocument(vaultPath: string, id: string): Promise<MemDocument>;
90
+ declare function listDocuments(vaultPath: string, category?: string): Promise<MemDocument[]>;
91
+ declare function deleteDocument(vaultPath: string, id: string): Promise<void>;
92
+
93
+ declare function readConfig(vaultPath: string): Promise<VaultConfig>;
94
+ declare function writeConfig(config: VaultConfig): Promise<void>;
95
+
96
+ declare function parseDocument(raw: string, filePath: string, category: string): MemDocument;
97
+ declare function serializeDocument(doc: {
98
+ title: string;
99
+ content: string;
100
+ frontmatter?: Record<string, unknown>;
101
+ tags?: string[];
102
+ type?: string;
103
+ }): string;
104
+ declare function slugify(text: string): string;
105
+
106
+ declare function searchDocuments(docs: MemDocument[], query: string, options?: SearchOptions): SearchResult[];
107
+
108
+ declare function getSession(vaultPath: string): Promise<SessionData>;
109
+ declare function startSession(vaultPath: string): Promise<SessionData>;
110
+ declare function updateCheckpoint(vaultPath: string, workingOn?: string, focus?: string): Promise<SessionData>;
111
+ declare function endSession(vaultPath: string, summary: string, nextSteps?: string): Promise<HandoffDocument>;
112
+ declare function getRecentHandoffs(vaultPath: string, limit?: number): Promise<HandoffDocument[]>;
113
+
114
+ declare function createNotionClient(token: string): Client;
115
+
116
+ declare function markdownToBlocks(markdown: string): BlockObjectRequest[];
117
+ declare function blocksToMarkdown(blocks: unknown[]): string;
118
+
119
+ declare function readSyncState(vaultPath: string): Promise<SyncState>;
120
+ declare function writeSyncState(vaultPath: string, state: SyncState): Promise<void>;
121
+
122
+ interface SyncReport {
123
+ pushed: string[];
124
+ pulled: string[];
125
+ conflicts: string[];
126
+ errors: string[];
127
+ }
128
+ declare function pushToNotion(client: Client, config: VaultConfig, options?: {
129
+ dryRun?: boolean;
130
+ }): Promise<SyncReport>;
131
+ declare function pullFromNotion(client: Client, config: VaultConfig, options?: {
132
+ preferNotion?: boolean;
133
+ dryRun?: boolean;
134
+ }): Promise<SyncReport>;
135
+
136
+ export { DEFAULT_CATEGORIES, type HandoffDocument, MEMORY_TYPES, type MemDocument, type MemoryType, type NotionConfig, type SearchOptions, type SearchResult, type SessionData, type SessionState, type StoreOptions, type SyncState, type SyncStateEntry, TYPE_TO_CATEGORY, type VaultConfig, type VaultMeta, blocksToMarkdown, createNotionClient, deleteDocument, endSession, getDocument, getRecentHandoffs, getSession, initVault, listDocuments, markdownToBlocks, parseDocument, pullFromNotion, pushToNotion, readConfig, readSyncState, resolveVault, searchDocuments, serializeDocument, slugify, startSession, storeDocument, updateCheckpoint, writeConfig, writeSyncState };
package/dist/index.js ADDED
@@ -0,0 +1,58 @@
1
+ import {
2
+ DEFAULT_CATEGORIES,
3
+ MEMORY_TYPES,
4
+ TYPE_TO_CATEGORY,
5
+ blocksToMarkdown,
6
+ createNotionClient,
7
+ deleteDocument,
8
+ endSession,
9
+ getDocument,
10
+ getRecentHandoffs,
11
+ getSession,
12
+ initVault,
13
+ listDocuments,
14
+ markdownToBlocks,
15
+ parseDocument,
16
+ pullFromNotion,
17
+ pushToNotion,
18
+ readConfig,
19
+ readSyncState,
20
+ resolveVault,
21
+ searchDocuments,
22
+ serializeDocument,
23
+ slugify,
24
+ startSession,
25
+ storeDocument,
26
+ updateCheckpoint,
27
+ writeConfig,
28
+ writeSyncState
29
+ } from "./chunk-R6AR3ICV.js";
30
+ export {
31
+ DEFAULT_CATEGORIES,
32
+ MEMORY_TYPES,
33
+ TYPE_TO_CATEGORY,
34
+ blocksToMarkdown,
35
+ createNotionClient,
36
+ deleteDocument,
37
+ endSession,
38
+ getDocument,
39
+ getRecentHandoffs,
40
+ getSession,
41
+ initVault,
42
+ listDocuments,
43
+ markdownToBlocks,
44
+ parseDocument,
45
+ pullFromNotion,
46
+ pushToNotion,
47
+ readConfig,
48
+ readSyncState,
49
+ resolveVault,
50
+ searchDocuments,
51
+ serializeDocument,
52
+ slugify,
53
+ startSession,
54
+ storeDocument,
55
+ updateCheckpoint,
56
+ writeConfig,
57
+ writeSyncState
58
+ };
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@kitakitsune/memoria",
3
+ "version": "0.1.0",
4
+ "description": "Structured memory system for AI agents with local markdown vault and Notion sync",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "bin": {
15
+ "memoria": "bin/memoria.js"
16
+ },
17
+ "files": [
18
+ "dist",
19
+ "bin"
20
+ ],
21
+ "scripts": {
22
+ "build": "tsup src/index.ts src/cli/index.ts --format esm --dts --clean",
23
+ "dev": "tsup src/index.ts src/cli/index.ts --format esm --dts --watch",
24
+ "test": "vitest run",
25
+ "typecheck": "tsc --noEmit",
26
+ "prepublishOnly": "npm run build"
27
+ },
28
+ "keywords": [
29
+ "ai-agent",
30
+ "memory",
31
+ "notion",
32
+ "markdown",
33
+ "knowledge-management",
34
+ "llm",
35
+ "agent-memory"
36
+ ],
37
+ "license": "MIT",
38
+ "publishConfig": {
39
+ "registry": "https://registry.npmjs.org/",
40
+ "access": "public"
41
+ },
42
+ "engines": {
43
+ "node": ">=18"
44
+ },
45
+ "dependencies": {
46
+ "@notionhq/client": "^2.2.15",
47
+ "chalk": "^5.3.0",
48
+ "commander": "^12.0.0",
49
+ "glob": "^10.3.10",
50
+ "gray-matter": "^4.0.3",
51
+ "natural": "^6.10.4"
52
+ },
53
+ "devDependencies": {
54
+ "@types/node": "^20.11.0",
55
+ "tsup": "^8.0.1",
56
+ "typescript": "^5.3.3",
57
+ "vitest": "^1.2.0"
58
+ }
59
+ }