mnemosyne-core 2.0.2 → 2.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.
Files changed (47) hide show
  1. package/README.md +42 -25
  2. package/dist/{Store-BtdYuiUx.d.mts → Store-BJ8b6xbs.d.mts} +2 -0
  3. package/dist/{Store-BtdYuiUx.d.ts → Store-BJ8b6xbs.d.ts} +2 -0
  4. package/dist/cli/index.js +475 -5708
  5. package/dist/cli/index.js.map +1 -1
  6. package/dist/cli/index.mjs +475 -5709
  7. package/dist/cli/index.mjs.map +1 -1
  8. package/dist/{index-yTOihMUk.d.mts → index-2AoCh09i.d.mts} +1 -1
  9. package/dist/{index-B2oTMNlL.d.ts → index-BZrUZX8Z.d.ts} +1 -1
  10. package/dist/{index-B8PTQKy9.d.mts → index-CHbW0NJZ.d.mts} +1 -1
  11. package/dist/{index-DWk78ifo.d.ts → index-CfqixdlW.d.ts} +1 -1
  12. package/dist/index.d.mts +4 -4
  13. package/dist/index.d.ts +4 -4
  14. package/dist/index.js +328 -5739
  15. package/dist/index.js.map +1 -1
  16. package/dist/index.mjs +327 -5739
  17. package/dist/index.mjs.map +1 -1
  18. package/dist/mcp/index.d.mts +2 -2
  19. package/dist/mcp/index.d.ts +2 -2
  20. package/dist/mcp/index.js +19 -2
  21. package/dist/mcp/index.js.map +1 -1
  22. package/dist/mcp/index.mjs +26 -2
  23. package/dist/mcp/index.mjs.map +1 -1
  24. package/dist/sdk/index.d.mts +202 -50
  25. package/dist/sdk/index.d.ts +202 -50
  26. package/dist/sdk/index.js +76 -34
  27. package/dist/sdk/index.js.map +1 -1
  28. package/dist/sdk/index.mjs +76 -34
  29. package/dist/sdk/index.mjs.map +1 -1
  30. package/dist/server/api.d.mts +1 -1
  31. package/dist/server/api.d.ts +1 -1
  32. package/dist/server/api.js +231 -154
  33. package/dist/server/api.js.map +1 -1
  34. package/dist/server/api.mjs +231 -154
  35. package/dist/server/api.mjs.map +1 -1
  36. package/dist/server/index.d.mts +2 -2
  37. package/dist/server/index.d.ts +2 -2
  38. package/dist/server/index.js +296 -5711
  39. package/dist/server/index.js.map +1 -1
  40. package/dist/server/index.mjs +295 -5711
  41. package/dist/server/index.mjs.map +1 -1
  42. package/dist/server/websocket.d.mts +1 -1
  43. package/dist/server/websocket.d.ts +1 -1
  44. package/dist/ws/index.d.mts +1 -1
  45. package/dist/ws/index.d.ts +1 -1
  46. package/package.json +1 -1
  47. package/dist/sharp-win32-x64-CXV3GA3G.node +0 -0
@@ -1,63 +1,104 @@
1
1
  /**
2
- * SDK shared types — mirror of core types with runtime-safe defaults.
2
+ * SDK shared types — mirror of server responses with runtime-safe defaults.
3
3
  */
4
- interface Atom {
4
+ interface Project {
5
5
  id: string;
6
6
  name: string;
7
- assistant_id: string;
8
- content_type: "text" | "image" | "audio" | "file";
9
- content: string;
10
- embedding_type?: string;
7
+ description: string | null;
8
+ icon: string;
9
+ color: string;
10
+ created_at: number;
11
+ updated_at: number;
12
+ owner: string;
13
+ metadata: Record<string, any>;
14
+ }
15
+ interface Atom {
16
+ id: string;
11
17
  project_id: string;
12
- created_at: string;
13
- updated_at: string;
18
+ parent_id: string | null;
19
+ title: string;
20
+ summary: string | null;
21
+ type: string;
22
+ icon: string;
23
+ color: string | null;
24
+ status: string;
25
+ metadata: Record<string, any>;
26
+ auto_path?: string;
27
+ path_overridden?: boolean;
28
+ status_updated_at?: number;
29
+ block_count?: number;
30
+ bond_count?: number;
31
+ template_id?: string | null;
32
+ embedding_status?: string | null;
33
+ state: {
34
+ lock: {
35
+ assistantId: string;
36
+ reason: string;
37
+ } | null;
38
+ queue: any[];
39
+ blockCount: number;
40
+ lastActivity: number;
41
+ };
14
42
  }
15
43
  interface Block {
16
44
  id: string;
17
45
  atom_id: string;
18
- block_type: "content" | "file" | "export" | "import";
19
- content: string;
20
- file_path?: string;
21
- file_original_name?: string;
22
- file_type?: string;
23
- source_type?: string;
24
- created_at: string;
46
+ type: string;
47
+ content: string | null;
48
+ order_index: number;
49
+ created_at: number;
50
+ updated_at: number;
51
+ metadata: Record<string, any>;
25
52
  }
26
- interface Project {
53
+ interface Bond {
27
54
  id: string;
28
- name: string;
29
- description?: string;
30
- created_at: string;
55
+ source_id: string;
56
+ target_id: string;
57
+ label: string;
58
+ color: string | null;
59
+ created_at: number;
31
60
  }
32
61
  interface Assistant {
33
62
  id: string;
34
63
  name: string;
35
- role?: string;
36
- model?: string;
37
- system_prompt?: string;
38
- created_at: string;
39
- }
40
- interface Bond {
41
- id: string;
42
- source_id: string;
43
- target_id: string;
44
- bond_type: "related" | "child" | "parent" | "reference";
45
- strength: number;
46
- created_at: string;
64
+ role: string;
65
+ permissions: Record<string, any>;
66
+ status: string;
67
+ provider: string | null;
68
+ connected_at: number;
69
+ last_seen: number;
70
+ metadata: Record<string, any>;
47
71
  }
48
72
  interface SearchResult {
49
- atoms: Array<Atom & {
73
+ query: string;
74
+ semantic: boolean;
75
+ count: number;
76
+ results: Array<Atom & {
50
77
  similarity?: number;
51
78
  score?: number;
52
79
  }>;
53
- time: number;
54
- total: number;
55
80
  }
56
81
  interface HealthStatus {
57
82
  status: "ok" | "degraded" | "error";
58
83
  version: string;
59
84
  database: string;
60
85
  uptime: number;
86
+ counts: Record<string, number>;
87
+ }
88
+ interface CheckoutResult {
89
+ success: boolean;
90
+ queuePosition?: number;
91
+ }
92
+ interface QueueStatus {
93
+ atomId: string;
94
+ queue: Array<{
95
+ id: string;
96
+ assistant_id: string;
97
+ requested_at: number;
98
+ priority: number;
99
+ status: string;
100
+ reason: string | null;
101
+ }>;
61
102
  }
62
103
 
63
104
  interface ClientOptions {
@@ -72,20 +113,90 @@ declare class MnemosyneClient {
72
113
  constructor(options: ClientOptions);
73
114
  private request;
74
115
  health(): Promise<HealthStatus>;
75
- listProjects(): Promise<Project[]>;
76
- getProject(id: string): Promise<Project>;
77
- createProject(data: Omit<Project, "id" | "created_at">): Promise<Project>;
78
- deleteProject(id: string): Promise<void>;
79
- listAtoms(projectId?: string): Promise<Atom[]>;
80
- getAtom(id: string): Promise<Atom>;
81
- createAtom(data: Omit<Atom, "id" | "created_at" | "updated_at">): Promise<Atom>;
82
- updateAtom(id: string, data: Partial<Omit<Atom, "id" | "created_at">>): Promise<Atom>;
83
- deleteAtom(id: string): Promise<void>;
116
+ listProjects(): Promise<{
117
+ projects: Project[];
118
+ }>;
119
+ getProject(id: string): Promise<{
120
+ project: Project;
121
+ }>;
122
+ createProject(data: {
123
+ name: string;
124
+ description?: string;
125
+ }): Promise<{
126
+ success: boolean;
127
+ project: Project;
128
+ }>;
129
+ deleteProject(id: string): Promise<{
130
+ success: boolean;
131
+ }>;
132
+ listAtoms(projectId?: string): Promise<{
133
+ atoms: Atom[];
134
+ }>;
135
+ getAtom(id: string): Promise<{
136
+ atom: Atom;
137
+ children: any[];
138
+ blocks: Block[];
139
+ bonds: Bond[];
140
+ }>;
141
+ createAtom(data: {
142
+ project_id: string;
143
+ title: string;
144
+ type?: string;
145
+ parent_id?: string | null;
146
+ tags?: string[];
147
+ template?: string;
148
+ status?: string;
149
+ auto_path?: string;
150
+ path_overridden?: boolean;
151
+ }): Promise<{
152
+ atom: Atom;
153
+ }>;
154
+ updateAtom(id: string, data: {
155
+ title?: string;
156
+ summary?: string;
157
+ tags?: string[];
158
+ status?: string;
159
+ auto_path?: string;
160
+ path_overridden?: boolean;
161
+ parent_id?: string | null;
162
+ }): Promise<{
163
+ atom: Atom;
164
+ }>;
165
+ deleteAtom(id: string): Promise<{
166
+ success: boolean;
167
+ }>;
84
168
  getBlocks(atomId: string): Promise<Block[]>;
85
- createBlock(atomId: string, data: Omit<Block, "id" | "atom_id" | "created_at">): Promise<Block>;
86
- listBonds(): Promise<Bond[]>;
87
- createBond(data: Omit<Bond, "id" | "created_at">): Promise<Bond>;
88
- deleteBond(id: string): Promise<void>;
169
+ createBlock(atomId: string, data: {
170
+ type: string;
171
+ content: string;
172
+ tags?: string[];
173
+ }): Promise<{
174
+ block: Block;
175
+ }>;
176
+ updateBlock(id: string, data: {
177
+ content?: string;
178
+ type?: string;
179
+ metadata?: Record<string, any>;
180
+ }): Promise<{
181
+ block: Block;
182
+ }>;
183
+ deleteBlock(id: string): Promise<{
184
+ success: boolean;
185
+ }>;
186
+ listBonds(atomId?: string): Promise<Bond[] | {
187
+ outgoing: Bond[];
188
+ incoming: Bond[];
189
+ }>;
190
+ createBond(atomId: string, data: {
191
+ target_id: string;
192
+ label?: string;
193
+ color?: string;
194
+ }): Promise<{
195
+ bond: Bond;
196
+ }>;
197
+ deleteBond(id: string): Promise<{
198
+ success: boolean;
199
+ }>;
89
200
  searchSemantic(query: string, options?: {
90
201
  projectId?: string;
91
202
  limit?: number;
@@ -94,9 +205,50 @@ declare class MnemosyneClient {
94
205
  projectId?: string;
95
206
  limit?: number;
96
207
  }): Promise<SearchResult>;
97
- listAssistants(): Promise<Assistant[]>;
98
- getAssistant(id: string): Promise<Assistant>;
99
- createAssistant(data: Omit<Assistant, "id" | "created_at">): Promise<Assistant>;
208
+ searchKeyword(query: string, options?: {
209
+ projectId?: string;
210
+ limit?: number;
211
+ }): Promise<SearchResult>;
212
+ listAssistants(): Promise<{
213
+ assistants: Assistant[];
214
+ }>;
215
+ getAssistant(id: string): Promise<{
216
+ assistant: Assistant;
217
+ }>;
218
+ createAssistant(data: {
219
+ id?: string;
220
+ name: string;
221
+ role: string;
222
+ capabilities?: string[];
223
+ description?: string;
224
+ provider?: string;
225
+ instructions?: string;
226
+ config?: Record<string, any>;
227
+ }): Promise<{
228
+ success: boolean;
229
+ token: string;
230
+ assistant: Assistant;
231
+ }>;
232
+ updateAssistant(id: string, data: {
233
+ name?: string;
234
+ role?: string;
235
+ description?: string;
236
+ provider?: string;
237
+ instructions?: string;
238
+ config?: Record<string, any>;
239
+ capabilities?: string[];
240
+ status?: string;
241
+ }): Promise<{
242
+ assistant: Assistant;
243
+ }>;
244
+ deleteAssistant(id: string): Promise<{
245
+ success: boolean;
246
+ }>;
247
+ checkoutAtom(atomId: string, mode?: "exclusive" | "shared", reason?: string): Promise<CheckoutResult>;
248
+ releaseCheckout(atomId: string): Promise<{
249
+ success: boolean;
250
+ }>;
251
+ getQueueStatus(atomId: string): Promise<QueueStatus>;
100
252
  }
101
253
 
102
254
  export { type Assistant, type Atom, type Block, type Bond, type HealthStatus, MnemosyneClient, type Project, type SearchResult };
@@ -1,63 +1,104 @@
1
1
  /**
2
- * SDK shared types — mirror of core types with runtime-safe defaults.
2
+ * SDK shared types — mirror of server responses with runtime-safe defaults.
3
3
  */
4
- interface Atom {
4
+ interface Project {
5
5
  id: string;
6
6
  name: string;
7
- assistant_id: string;
8
- content_type: "text" | "image" | "audio" | "file";
9
- content: string;
10
- embedding_type?: string;
7
+ description: string | null;
8
+ icon: string;
9
+ color: string;
10
+ created_at: number;
11
+ updated_at: number;
12
+ owner: string;
13
+ metadata: Record<string, any>;
14
+ }
15
+ interface Atom {
16
+ id: string;
11
17
  project_id: string;
12
- created_at: string;
13
- updated_at: string;
18
+ parent_id: string | null;
19
+ title: string;
20
+ summary: string | null;
21
+ type: string;
22
+ icon: string;
23
+ color: string | null;
24
+ status: string;
25
+ metadata: Record<string, any>;
26
+ auto_path?: string;
27
+ path_overridden?: boolean;
28
+ status_updated_at?: number;
29
+ block_count?: number;
30
+ bond_count?: number;
31
+ template_id?: string | null;
32
+ embedding_status?: string | null;
33
+ state: {
34
+ lock: {
35
+ assistantId: string;
36
+ reason: string;
37
+ } | null;
38
+ queue: any[];
39
+ blockCount: number;
40
+ lastActivity: number;
41
+ };
14
42
  }
15
43
  interface Block {
16
44
  id: string;
17
45
  atom_id: string;
18
- block_type: "content" | "file" | "export" | "import";
19
- content: string;
20
- file_path?: string;
21
- file_original_name?: string;
22
- file_type?: string;
23
- source_type?: string;
24
- created_at: string;
46
+ type: string;
47
+ content: string | null;
48
+ order_index: number;
49
+ created_at: number;
50
+ updated_at: number;
51
+ metadata: Record<string, any>;
25
52
  }
26
- interface Project {
53
+ interface Bond {
27
54
  id: string;
28
- name: string;
29
- description?: string;
30
- created_at: string;
55
+ source_id: string;
56
+ target_id: string;
57
+ label: string;
58
+ color: string | null;
59
+ created_at: number;
31
60
  }
32
61
  interface Assistant {
33
62
  id: string;
34
63
  name: string;
35
- role?: string;
36
- model?: string;
37
- system_prompt?: string;
38
- created_at: string;
39
- }
40
- interface Bond {
41
- id: string;
42
- source_id: string;
43
- target_id: string;
44
- bond_type: "related" | "child" | "parent" | "reference";
45
- strength: number;
46
- created_at: string;
64
+ role: string;
65
+ permissions: Record<string, any>;
66
+ status: string;
67
+ provider: string | null;
68
+ connected_at: number;
69
+ last_seen: number;
70
+ metadata: Record<string, any>;
47
71
  }
48
72
  interface SearchResult {
49
- atoms: Array<Atom & {
73
+ query: string;
74
+ semantic: boolean;
75
+ count: number;
76
+ results: Array<Atom & {
50
77
  similarity?: number;
51
78
  score?: number;
52
79
  }>;
53
- time: number;
54
- total: number;
55
80
  }
56
81
  interface HealthStatus {
57
82
  status: "ok" | "degraded" | "error";
58
83
  version: string;
59
84
  database: string;
60
85
  uptime: number;
86
+ counts: Record<string, number>;
87
+ }
88
+ interface CheckoutResult {
89
+ success: boolean;
90
+ queuePosition?: number;
91
+ }
92
+ interface QueueStatus {
93
+ atomId: string;
94
+ queue: Array<{
95
+ id: string;
96
+ assistant_id: string;
97
+ requested_at: number;
98
+ priority: number;
99
+ status: string;
100
+ reason: string | null;
101
+ }>;
61
102
  }
62
103
 
63
104
  interface ClientOptions {
@@ -72,20 +113,90 @@ declare class MnemosyneClient {
72
113
  constructor(options: ClientOptions);
73
114
  private request;
74
115
  health(): Promise<HealthStatus>;
75
- listProjects(): Promise<Project[]>;
76
- getProject(id: string): Promise<Project>;
77
- createProject(data: Omit<Project, "id" | "created_at">): Promise<Project>;
78
- deleteProject(id: string): Promise<void>;
79
- listAtoms(projectId?: string): Promise<Atom[]>;
80
- getAtom(id: string): Promise<Atom>;
81
- createAtom(data: Omit<Atom, "id" | "created_at" | "updated_at">): Promise<Atom>;
82
- updateAtom(id: string, data: Partial<Omit<Atom, "id" | "created_at">>): Promise<Atom>;
83
- deleteAtom(id: string): Promise<void>;
116
+ listProjects(): Promise<{
117
+ projects: Project[];
118
+ }>;
119
+ getProject(id: string): Promise<{
120
+ project: Project;
121
+ }>;
122
+ createProject(data: {
123
+ name: string;
124
+ description?: string;
125
+ }): Promise<{
126
+ success: boolean;
127
+ project: Project;
128
+ }>;
129
+ deleteProject(id: string): Promise<{
130
+ success: boolean;
131
+ }>;
132
+ listAtoms(projectId?: string): Promise<{
133
+ atoms: Atom[];
134
+ }>;
135
+ getAtom(id: string): Promise<{
136
+ atom: Atom;
137
+ children: any[];
138
+ blocks: Block[];
139
+ bonds: Bond[];
140
+ }>;
141
+ createAtom(data: {
142
+ project_id: string;
143
+ title: string;
144
+ type?: string;
145
+ parent_id?: string | null;
146
+ tags?: string[];
147
+ template?: string;
148
+ status?: string;
149
+ auto_path?: string;
150
+ path_overridden?: boolean;
151
+ }): Promise<{
152
+ atom: Atom;
153
+ }>;
154
+ updateAtom(id: string, data: {
155
+ title?: string;
156
+ summary?: string;
157
+ tags?: string[];
158
+ status?: string;
159
+ auto_path?: string;
160
+ path_overridden?: boolean;
161
+ parent_id?: string | null;
162
+ }): Promise<{
163
+ atom: Atom;
164
+ }>;
165
+ deleteAtom(id: string): Promise<{
166
+ success: boolean;
167
+ }>;
84
168
  getBlocks(atomId: string): Promise<Block[]>;
85
- createBlock(atomId: string, data: Omit<Block, "id" | "atom_id" | "created_at">): Promise<Block>;
86
- listBonds(): Promise<Bond[]>;
87
- createBond(data: Omit<Bond, "id" | "created_at">): Promise<Bond>;
88
- deleteBond(id: string): Promise<void>;
169
+ createBlock(atomId: string, data: {
170
+ type: string;
171
+ content: string;
172
+ tags?: string[];
173
+ }): Promise<{
174
+ block: Block;
175
+ }>;
176
+ updateBlock(id: string, data: {
177
+ content?: string;
178
+ type?: string;
179
+ metadata?: Record<string, any>;
180
+ }): Promise<{
181
+ block: Block;
182
+ }>;
183
+ deleteBlock(id: string): Promise<{
184
+ success: boolean;
185
+ }>;
186
+ listBonds(atomId?: string): Promise<Bond[] | {
187
+ outgoing: Bond[];
188
+ incoming: Bond[];
189
+ }>;
190
+ createBond(atomId: string, data: {
191
+ target_id: string;
192
+ label?: string;
193
+ color?: string;
194
+ }): Promise<{
195
+ bond: Bond;
196
+ }>;
197
+ deleteBond(id: string): Promise<{
198
+ success: boolean;
199
+ }>;
89
200
  searchSemantic(query: string, options?: {
90
201
  projectId?: string;
91
202
  limit?: number;
@@ -94,9 +205,50 @@ declare class MnemosyneClient {
94
205
  projectId?: string;
95
206
  limit?: number;
96
207
  }): Promise<SearchResult>;
97
- listAssistants(): Promise<Assistant[]>;
98
- getAssistant(id: string): Promise<Assistant>;
99
- createAssistant(data: Omit<Assistant, "id" | "created_at">): Promise<Assistant>;
208
+ searchKeyword(query: string, options?: {
209
+ projectId?: string;
210
+ limit?: number;
211
+ }): Promise<SearchResult>;
212
+ listAssistants(): Promise<{
213
+ assistants: Assistant[];
214
+ }>;
215
+ getAssistant(id: string): Promise<{
216
+ assistant: Assistant;
217
+ }>;
218
+ createAssistant(data: {
219
+ id?: string;
220
+ name: string;
221
+ role: string;
222
+ capabilities?: string[];
223
+ description?: string;
224
+ provider?: string;
225
+ instructions?: string;
226
+ config?: Record<string, any>;
227
+ }): Promise<{
228
+ success: boolean;
229
+ token: string;
230
+ assistant: Assistant;
231
+ }>;
232
+ updateAssistant(id: string, data: {
233
+ name?: string;
234
+ role?: string;
235
+ description?: string;
236
+ provider?: string;
237
+ instructions?: string;
238
+ config?: Record<string, any>;
239
+ capabilities?: string[];
240
+ status?: string;
241
+ }): Promise<{
242
+ assistant: Assistant;
243
+ }>;
244
+ deleteAssistant(id: string): Promise<{
245
+ success: boolean;
246
+ }>;
247
+ checkoutAtom(atomId: string, mode?: "exclusive" | "shared", reason?: string): Promise<CheckoutResult>;
248
+ releaseCheckout(atomId: string): Promise<{
249
+ success: boolean;
250
+ }>;
251
+ getQueueStatus(atomId: string): Promise<QueueStatus>;
100
252
  }
101
253
 
102
254
  export { type Assistant, type Atom, type Block, type Bond, type HealthStatus, MnemosyneClient, type Project, type SearchResult };