@lanonasis/memory-client 1.0.1 → 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.
- package/dist/core/index.d.ts +948 -0
- package/dist/core/index.js +1027 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/tsconfig.tsbuildinfo +1 -0
- package/dist/index.d.ts +703 -352
- package/dist/index.esm.js +1070 -277
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1098 -283
- package/dist/index.js.map +1 -1
- package/dist/node/index.d.ts +329 -0
- package/dist/node/index.js +647 -0
- package/dist/node/index.js.map +1 -0
- package/dist/node/tsconfig.tsbuildinfo +1 -0
- package/dist/presets/index.d.ts +146 -0
- package/dist/presets/index.js +234 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/presets/tsconfig.tsbuildinfo +1 -0
- package/dist/react/index.d.ts +235 -0
- package/dist/react/index.js +333 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/tsconfig.tsbuildinfo +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/vue/index.d.ts +316 -0
- package/dist/vue/index.js +341 -0
- package/dist/vue/index.js.map +1 -0
- package/dist/vue/tsconfig.tsbuildinfo +1 -0
- package/package.json +67 -13
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import * as vue from 'vue';
|
|
2
|
+
import { App, InjectionKey, Ref } from 'vue';
|
|
3
|
+
import { CoreMemoryClientConfig, CoreMemoryClient } from '../core/client';
|
|
4
|
+
export { ApiResponse, CoreMemoryClient, CoreMemoryClientConfig, PaginatedResponse } from '../core/client';
|
|
5
|
+
import { MemoryType, MemoryStatus, UpdateMemoryRequest, CreateMemoryRequest, MemoryEntry, SearchMemoryRequest } from '../core/types';
|
|
6
|
+
export { CreateMemoryRequest, MemoryEntry, MemorySearchResult, MemoryStatus, MemoryTopic, MemoryType, SearchMemoryRequest, UpdateMemoryRequest, UserMemoryStats } from '../core/types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Vue Plugin for Memory Client
|
|
10
|
+
*
|
|
11
|
+
* Provides a Memory Client instance to all components via Vue's provide/inject
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
declare const MEMORY_CLIENT_KEY: InjectionKey<CoreMemoryClient>;
|
|
15
|
+
interface MemoryPluginOptions extends CoreMemoryClientConfig {
|
|
16
|
+
/** Automatically authenticate on plugin installation */
|
|
17
|
+
autoAuth?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Vue plugin for Memory Client
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* import { createApp } from 'vue';
|
|
25
|
+
* import { createMemoryPlugin } from '@lanonasis/memory-client/vue';
|
|
26
|
+
* import App from './App.vue';
|
|
27
|
+
*
|
|
28
|
+
* const app = createApp(App);
|
|
29
|
+
*
|
|
30
|
+
* app.use(createMemoryPlugin({
|
|
31
|
+
* apiUrl: 'https://api.lanonasis.com',
|
|
32
|
+
* apiKey: import.meta.env.VITE_LANONASIS_KEY
|
|
33
|
+
* }));
|
|
34
|
+
*
|
|
35
|
+
* app.mount('#app');
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
declare function createMemoryPlugin(options: MemoryPluginOptions): {
|
|
39
|
+
install(app: App): void;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Hook to access the Memory Client instance
|
|
43
|
+
*
|
|
44
|
+
* @throws Error if used without installing the plugin
|
|
45
|
+
*/
|
|
46
|
+
declare function useMemoryClient(): CoreMemoryClient;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Composable to list memories with optional filtering
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```vue
|
|
53
|
+
* <script setup>
|
|
54
|
+
* import { useMemories } from '@lanonasis/memory-client/vue';
|
|
55
|
+
*
|
|
56
|
+
* const { memories, loading, error, refresh } = useMemories({
|
|
57
|
+
* memory_type: 'project',
|
|
58
|
+
* limit: 20
|
|
59
|
+
* });
|
|
60
|
+
* </script>
|
|
61
|
+
*
|
|
62
|
+
* <template>
|
|
63
|
+
* <div v-if="loading">Loading...</div>
|
|
64
|
+
* <div v-else-if="error">Error: {{ error.message }}</div>
|
|
65
|
+
* <div v-else>
|
|
66
|
+
* <div v-for="memory in memories" :key="memory.id">
|
|
67
|
+
* {{ memory.title }}
|
|
68
|
+
* </div>
|
|
69
|
+
* <button @click="refresh">Refresh</button>
|
|
70
|
+
* </div>
|
|
71
|
+
* </template>
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
declare function useMemories(options?: {
|
|
75
|
+
page?: number;
|
|
76
|
+
limit?: number;
|
|
77
|
+
memory_type?: string;
|
|
78
|
+
topic_id?: string;
|
|
79
|
+
project_ref?: string;
|
|
80
|
+
status?: string;
|
|
81
|
+
tags?: string[];
|
|
82
|
+
sort?: string;
|
|
83
|
+
order?: 'asc' | 'desc';
|
|
84
|
+
}): {
|
|
85
|
+
memories: vue.ComputedRef<{
|
|
86
|
+
id: string;
|
|
87
|
+
title: string;
|
|
88
|
+
content: string;
|
|
89
|
+
summary?: string | undefined;
|
|
90
|
+
memory_type: MemoryType;
|
|
91
|
+
status: MemoryStatus;
|
|
92
|
+
relevance_score?: number | undefined;
|
|
93
|
+
access_count: number;
|
|
94
|
+
last_accessed?: string | undefined;
|
|
95
|
+
user_id: string;
|
|
96
|
+
topic_id?: string | undefined;
|
|
97
|
+
project_ref?: string | undefined;
|
|
98
|
+
tags: string[];
|
|
99
|
+
metadata?: Record<string, unknown> | undefined;
|
|
100
|
+
created_at: string;
|
|
101
|
+
updated_at: string;
|
|
102
|
+
}[]>;
|
|
103
|
+
loading: vue.ComputedRef<boolean>;
|
|
104
|
+
error: vue.ComputedRef<{
|
|
105
|
+
code: ErrorCode;
|
|
106
|
+
message: string;
|
|
107
|
+
statusCode?: number | undefined;
|
|
108
|
+
details?: unknown;
|
|
109
|
+
requestId?: string | undefined;
|
|
110
|
+
timestamp?: string | undefined;
|
|
111
|
+
} | null>;
|
|
112
|
+
refresh: () => Promise<void>;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Composable to fetch and manage a single memory by ID
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```vue
|
|
119
|
+
* <script setup>
|
|
120
|
+
* import { useMemory } from '@lanonasis/memory-client/vue';
|
|
121
|
+
*
|
|
122
|
+
* const props = defineProps<{ id: string }>();
|
|
123
|
+
* const { memory, loading, error, update, deleteMemory } = useMemory(() => props.id);
|
|
124
|
+
* </script>
|
|
125
|
+
*
|
|
126
|
+
* <template>
|
|
127
|
+
* <div v-if="loading">Loading...</div>
|
|
128
|
+
* <div v-else-if="error">Error: {{ error.message }}</div>
|
|
129
|
+
* <div v-else-if="memory">
|
|
130
|
+
* <h1>{{ memory.title }}</h1>
|
|
131
|
+
* <p>{{ memory.content }}</p>
|
|
132
|
+
* <button @click="update({ title: 'Updated Title' })">Update</button>
|
|
133
|
+
* <button @click="deleteMemory">Delete</button>
|
|
134
|
+
* </div>
|
|
135
|
+
* </template>
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
declare function useMemory(id: Ref<string> | (() => string) | string): {
|
|
139
|
+
memory: vue.ComputedRef<{
|
|
140
|
+
id: string;
|
|
141
|
+
title: string;
|
|
142
|
+
content: string;
|
|
143
|
+
summary?: string | undefined;
|
|
144
|
+
memory_type: MemoryType;
|
|
145
|
+
status: MemoryStatus;
|
|
146
|
+
relevance_score?: number | undefined;
|
|
147
|
+
access_count: number;
|
|
148
|
+
last_accessed?: string | undefined;
|
|
149
|
+
user_id: string;
|
|
150
|
+
topic_id?: string | undefined;
|
|
151
|
+
project_ref?: string | undefined;
|
|
152
|
+
tags: string[];
|
|
153
|
+
metadata?: Record<string, unknown> | undefined;
|
|
154
|
+
created_at: string;
|
|
155
|
+
updated_at: string;
|
|
156
|
+
} | null>;
|
|
157
|
+
loading: vue.ComputedRef<boolean>;
|
|
158
|
+
error: vue.ComputedRef<{
|
|
159
|
+
code: ErrorCode;
|
|
160
|
+
message: string;
|
|
161
|
+
statusCode?: number | undefined;
|
|
162
|
+
details?: unknown;
|
|
163
|
+
requestId?: string | undefined;
|
|
164
|
+
timestamp?: string | undefined;
|
|
165
|
+
} | null>;
|
|
166
|
+
refresh: () => Promise<void>;
|
|
167
|
+
update: (updates: UpdateMemoryRequest) => Promise<void>;
|
|
168
|
+
deleteMemory: () => Promise<void>;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Composable to create new memories
|
|
172
|
+
*
|
|
173
|
+
* @example
|
|
174
|
+
* ```vue
|
|
175
|
+
* <script setup>
|
|
176
|
+
* import { ref } from 'vue';
|
|
177
|
+
* import { useCreateMemory } from '@lanonasis/memory-client/vue';
|
|
178
|
+
*
|
|
179
|
+
* const title = ref('');
|
|
180
|
+
* const content = ref('');
|
|
181
|
+
* const { createMemory, loading, error } = useCreateMemory();
|
|
182
|
+
*
|
|
183
|
+
* async function handleSubmit() {
|
|
184
|
+
* const memory = await createMemory({
|
|
185
|
+
* title: title.value,
|
|
186
|
+
* content: content.value
|
|
187
|
+
* });
|
|
188
|
+
* if (memory) {
|
|
189
|
+
* console.log('Created:', memory.id);
|
|
190
|
+
* title.value = '';
|
|
191
|
+
* content.value = '';
|
|
192
|
+
* }
|
|
193
|
+
* }
|
|
194
|
+
* </script>
|
|
195
|
+
*
|
|
196
|
+
* <template>
|
|
197
|
+
* <form @submit.prevent="handleSubmit">
|
|
198
|
+
* <input v-model="title" placeholder="Title" />
|
|
199
|
+
* <textarea v-model="content" placeholder="Content" />
|
|
200
|
+
* <button type="submit" :disabled="loading">Create</button>
|
|
201
|
+
* <div v-if="error">Error: {{ error.message }}</div>
|
|
202
|
+
* </form>
|
|
203
|
+
* </template>
|
|
204
|
+
* ```
|
|
205
|
+
*/
|
|
206
|
+
declare function useCreateMemory(): {
|
|
207
|
+
createMemory: (memory: CreateMemoryRequest) => Promise<MemoryEntry | null>;
|
|
208
|
+
loading: vue.ComputedRef<boolean>;
|
|
209
|
+
error: vue.ComputedRef<{
|
|
210
|
+
code: ErrorCode;
|
|
211
|
+
message: string;
|
|
212
|
+
statusCode?: number | undefined;
|
|
213
|
+
details?: unknown;
|
|
214
|
+
requestId?: string | undefined;
|
|
215
|
+
timestamp?: string | undefined;
|
|
216
|
+
} | null>;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Composable to search memories
|
|
220
|
+
*
|
|
221
|
+
* @example
|
|
222
|
+
* ```vue
|
|
223
|
+
* <script setup>
|
|
224
|
+
* import { ref, watch } from 'vue';
|
|
225
|
+
* import { useSearchMemories } from '@lanonasis/memory-client/vue';
|
|
226
|
+
*
|
|
227
|
+
* const query = ref('');
|
|
228
|
+
* const { results, loading, error, search, totalResults, searchTime } = useSearchMemories();
|
|
229
|
+
*
|
|
230
|
+
* watch(query, (newQuery) => {
|
|
231
|
+
* if (newQuery.length > 2) {
|
|
232
|
+
* search(newQuery, { limit: 10 });
|
|
233
|
+
* }
|
|
234
|
+
* });
|
|
235
|
+
* </script>
|
|
236
|
+
*
|
|
237
|
+
* <template>
|
|
238
|
+
* <div>
|
|
239
|
+
* <input v-model="query" placeholder="Search memories..." />
|
|
240
|
+
* <div v-if="loading">Searching...</div>
|
|
241
|
+
* <div v-if="error">Error: {{ error.message }}</div>
|
|
242
|
+
* <div v-for="result in results" :key="result.id">
|
|
243
|
+
* <h3>{{ result.title }}</h3>
|
|
244
|
+
* <span>Score: {{ result.similarity_score.toFixed(2) }}</span>
|
|
245
|
+
* </div>
|
|
246
|
+
* <div v-if="totalResults > 0">
|
|
247
|
+
* Found {{ totalResults }} results in {{ searchTime }}ms
|
|
248
|
+
* </div>
|
|
249
|
+
* </div>
|
|
250
|
+
* </template>
|
|
251
|
+
* ```
|
|
252
|
+
*/
|
|
253
|
+
declare function useSearchMemories(debounceMs?: number): {
|
|
254
|
+
results: vue.ComputedRef<{
|
|
255
|
+
similarity_score: number;
|
|
256
|
+
id: string;
|
|
257
|
+
title: string;
|
|
258
|
+
content: string;
|
|
259
|
+
summary?: string | undefined;
|
|
260
|
+
memory_type: MemoryType;
|
|
261
|
+
status: MemoryStatus;
|
|
262
|
+
relevance_score?: number | undefined;
|
|
263
|
+
access_count: number;
|
|
264
|
+
last_accessed?: string | undefined;
|
|
265
|
+
user_id: string;
|
|
266
|
+
topic_id?: string | undefined;
|
|
267
|
+
project_ref?: string | undefined;
|
|
268
|
+
tags: string[];
|
|
269
|
+
metadata?: Record<string, unknown> | undefined;
|
|
270
|
+
created_at: string;
|
|
271
|
+
updated_at: string;
|
|
272
|
+
}[]>;
|
|
273
|
+
loading: vue.ComputedRef<boolean>;
|
|
274
|
+
error: vue.ComputedRef<{
|
|
275
|
+
code: ErrorCode;
|
|
276
|
+
message: string;
|
|
277
|
+
statusCode?: number | undefined;
|
|
278
|
+
details?: unknown;
|
|
279
|
+
requestId?: string | undefined;
|
|
280
|
+
timestamp?: string | undefined;
|
|
281
|
+
} | null>;
|
|
282
|
+
search: (query: string, options?: Omit<SearchMemoryRequest, "query">) => Promise<void>;
|
|
283
|
+
totalResults: vue.ComputedRef<number>;
|
|
284
|
+
searchTime: vue.ComputedRef<number>;
|
|
285
|
+
};
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Error handling for Memory Client
|
|
289
|
+
* Browser-safe, no Node.js dependencies
|
|
290
|
+
*/
|
|
291
|
+
/**
|
|
292
|
+
* Standardized error codes for programmatic error handling
|
|
293
|
+
*/
|
|
294
|
+
declare const ERROR_CODES: readonly ["API_ERROR", "AUTH_ERROR", "VALIDATION_ERROR", "TIMEOUT_ERROR", "RATE_LIMIT_ERROR", "NOT_FOUND", "NETWORK_ERROR", "FORBIDDEN", "CONFLICT", "SERVER_ERROR"];
|
|
295
|
+
type ErrorCode = typeof ERROR_CODES[number];
|
|
296
|
+
/**
|
|
297
|
+
* Structured API error response - replaces plain string errors
|
|
298
|
+
* Enables programmatic error handling with typed codes
|
|
299
|
+
*/
|
|
300
|
+
interface ApiErrorResponse {
|
|
301
|
+
/** Machine-readable error code for programmatic handling */
|
|
302
|
+
code: ErrorCode;
|
|
303
|
+
/** Human-readable error message */
|
|
304
|
+
message: string;
|
|
305
|
+
/** HTTP status code if from API response */
|
|
306
|
+
statusCode?: number;
|
|
307
|
+
/** Additional error details (validation errors, etc.) */
|
|
308
|
+
details?: unknown;
|
|
309
|
+
/** Request ID for debugging/support */
|
|
310
|
+
requestId?: string;
|
|
311
|
+
/** Timestamp when error occurred */
|
|
312
|
+
timestamp?: string;
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
export { MEMORY_CLIENT_KEY, createMemoryPlugin, useCreateMemory, useMemories, useMemory, useMemoryClient, useSearchMemories };
|
|
316
|
+
export type { ApiErrorResponse, ErrorCode, MemoryPluginOptions };
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
import { inject, ref, onMounted, computed, watch } from 'vue';
|
|
2
|
+
import { createMemoryClient } from '../core/client';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Vue Plugin for Memory Client
|
|
6
|
+
*
|
|
7
|
+
* Provides a Memory Client instance to all components via Vue's provide/inject
|
|
8
|
+
*/
|
|
9
|
+
const MEMORY_CLIENT_KEY = Symbol('MemoryClient');
|
|
10
|
+
/**
|
|
11
|
+
* Vue plugin for Memory Client
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { createApp } from 'vue';
|
|
16
|
+
* import { createMemoryPlugin } from '@lanonasis/memory-client/vue';
|
|
17
|
+
* import App from './App.vue';
|
|
18
|
+
*
|
|
19
|
+
* const app = createApp(App);
|
|
20
|
+
*
|
|
21
|
+
* app.use(createMemoryPlugin({
|
|
22
|
+
* apiUrl: 'https://api.lanonasis.com',
|
|
23
|
+
* apiKey: import.meta.env.VITE_LANONASIS_KEY
|
|
24
|
+
* }));
|
|
25
|
+
*
|
|
26
|
+
* app.mount('#app');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
function createMemoryPlugin(options) {
|
|
30
|
+
return {
|
|
31
|
+
install(app) {
|
|
32
|
+
const client = createMemoryClient(options);
|
|
33
|
+
app.provide(MEMORY_CLIENT_KEY, client);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Hook to access the Memory Client instance
|
|
39
|
+
*
|
|
40
|
+
* @throws Error if used without installing the plugin
|
|
41
|
+
*/
|
|
42
|
+
function useMemoryClient() {
|
|
43
|
+
const client = inject(MEMORY_CLIENT_KEY);
|
|
44
|
+
if (!client) {
|
|
45
|
+
throw new Error('Memory client not provided. Did you install the createMemoryPlugin?');
|
|
46
|
+
}
|
|
47
|
+
return client;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Vue Composables for Memory Client
|
|
52
|
+
*
|
|
53
|
+
* Provides convenient Vue composables for working with memories
|
|
54
|
+
*/
|
|
55
|
+
/**
|
|
56
|
+
* Composable to list memories with optional filtering
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```vue
|
|
60
|
+
* <script setup>
|
|
61
|
+
* import { useMemories } from '@lanonasis/memory-client/vue';
|
|
62
|
+
*
|
|
63
|
+
* const { memories, loading, error, refresh } = useMemories({
|
|
64
|
+
* memory_type: 'project',
|
|
65
|
+
* limit: 20
|
|
66
|
+
* });
|
|
67
|
+
* </script>
|
|
68
|
+
*
|
|
69
|
+
* <template>
|
|
70
|
+
* <div v-if="loading">Loading...</div>
|
|
71
|
+
* <div v-else-if="error">Error: {{ error.message }}</div>
|
|
72
|
+
* <div v-else>
|
|
73
|
+
* <div v-for="memory in memories" :key="memory.id">
|
|
74
|
+
* {{ memory.title }}
|
|
75
|
+
* </div>
|
|
76
|
+
* <button @click="refresh">Refresh</button>
|
|
77
|
+
* </div>
|
|
78
|
+
* </template>
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
function useMemories(options) {
|
|
82
|
+
const client = useMemoryClient();
|
|
83
|
+
const memories = ref([]);
|
|
84
|
+
const loading = ref(true);
|
|
85
|
+
const error = ref(null);
|
|
86
|
+
async function loadMemories() {
|
|
87
|
+
loading.value = true;
|
|
88
|
+
error.value = null;
|
|
89
|
+
const result = await client.listMemories(options);
|
|
90
|
+
if (result.error) {
|
|
91
|
+
error.value = result.error;
|
|
92
|
+
memories.value = [];
|
|
93
|
+
}
|
|
94
|
+
else if (result.data) {
|
|
95
|
+
memories.value = result.data.data;
|
|
96
|
+
}
|
|
97
|
+
loading.value = false;
|
|
98
|
+
}
|
|
99
|
+
onMounted(loadMemories);
|
|
100
|
+
return {
|
|
101
|
+
memories: computed(() => memories.value),
|
|
102
|
+
loading: computed(() => loading.value),
|
|
103
|
+
error: computed(() => error.value),
|
|
104
|
+
refresh: loadMemories
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Composable to fetch and manage a single memory by ID
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```vue
|
|
112
|
+
* <script setup>
|
|
113
|
+
* import { useMemory } from '@lanonasis/memory-client/vue';
|
|
114
|
+
*
|
|
115
|
+
* const props = defineProps<{ id: string }>();
|
|
116
|
+
* const { memory, loading, error, update, deleteMemory } = useMemory(() => props.id);
|
|
117
|
+
* </script>
|
|
118
|
+
*
|
|
119
|
+
* <template>
|
|
120
|
+
* <div v-if="loading">Loading...</div>
|
|
121
|
+
* <div v-else-if="error">Error: {{ error.message }}</div>
|
|
122
|
+
* <div v-else-if="memory">
|
|
123
|
+
* <h1>{{ memory.title }}</h1>
|
|
124
|
+
* <p>{{ memory.content }}</p>
|
|
125
|
+
* <button @click="update({ title: 'Updated Title' })">Update</button>
|
|
126
|
+
* <button @click="deleteMemory">Delete</button>
|
|
127
|
+
* </div>
|
|
128
|
+
* </template>
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
function useMemory(id) {
|
|
132
|
+
const client = useMemoryClient();
|
|
133
|
+
const memory = ref(null);
|
|
134
|
+
const loading = ref(true);
|
|
135
|
+
const error = ref(null);
|
|
136
|
+
const memoryId = computed(() => {
|
|
137
|
+
if (typeof id === 'function') {
|
|
138
|
+
return id();
|
|
139
|
+
}
|
|
140
|
+
else if (typeof id === 'string') {
|
|
141
|
+
return id;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
return id.value;
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
async function loadMemory() {
|
|
148
|
+
if (!memoryId.value) {
|
|
149
|
+
memory.value = null;
|
|
150
|
+
loading.value = false;
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
loading.value = true;
|
|
154
|
+
error.value = null;
|
|
155
|
+
const result = await client.getMemory(memoryId.value);
|
|
156
|
+
if (result.error) {
|
|
157
|
+
error.value = result.error;
|
|
158
|
+
memory.value = null;
|
|
159
|
+
}
|
|
160
|
+
else if (result.data) {
|
|
161
|
+
memory.value = result.data;
|
|
162
|
+
}
|
|
163
|
+
loading.value = false;
|
|
164
|
+
}
|
|
165
|
+
async function update(updates) {
|
|
166
|
+
if (!memoryId.value)
|
|
167
|
+
return;
|
|
168
|
+
const result = await client.updateMemory(memoryId.value, updates);
|
|
169
|
+
if (result.error) {
|
|
170
|
+
error.value = result.error;
|
|
171
|
+
}
|
|
172
|
+
else if (result.data) {
|
|
173
|
+
memory.value = result.data;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
async function deleteMemory() {
|
|
177
|
+
if (!memoryId.value)
|
|
178
|
+
return;
|
|
179
|
+
const result = await client.deleteMemory(memoryId.value);
|
|
180
|
+
if (result.error) {
|
|
181
|
+
error.value = result.error;
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
memory.value = null;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
onMounted(loadMemory);
|
|
188
|
+
// Watch for ID changes and reload
|
|
189
|
+
watch(memoryId, loadMemory);
|
|
190
|
+
return {
|
|
191
|
+
memory: computed(() => memory.value),
|
|
192
|
+
loading: computed(() => loading.value),
|
|
193
|
+
error: computed(() => error.value),
|
|
194
|
+
refresh: loadMemory,
|
|
195
|
+
update,
|
|
196
|
+
deleteMemory
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Composable to create new memories
|
|
201
|
+
*
|
|
202
|
+
* @example
|
|
203
|
+
* ```vue
|
|
204
|
+
* <script setup>
|
|
205
|
+
* import { ref } from 'vue';
|
|
206
|
+
* import { useCreateMemory } from '@lanonasis/memory-client/vue';
|
|
207
|
+
*
|
|
208
|
+
* const title = ref('');
|
|
209
|
+
* const content = ref('');
|
|
210
|
+
* const { createMemory, loading, error } = useCreateMemory();
|
|
211
|
+
*
|
|
212
|
+
* async function handleSubmit() {
|
|
213
|
+
* const memory = await createMemory({
|
|
214
|
+
* title: title.value,
|
|
215
|
+
* content: content.value
|
|
216
|
+
* });
|
|
217
|
+
* if (memory) {
|
|
218
|
+
* console.log('Created:', memory.id);
|
|
219
|
+
* title.value = '';
|
|
220
|
+
* content.value = '';
|
|
221
|
+
* }
|
|
222
|
+
* }
|
|
223
|
+
* </script>
|
|
224
|
+
*
|
|
225
|
+
* <template>
|
|
226
|
+
* <form @submit.prevent="handleSubmit">
|
|
227
|
+
* <input v-model="title" placeholder="Title" />
|
|
228
|
+
* <textarea v-model="content" placeholder="Content" />
|
|
229
|
+
* <button type="submit" :disabled="loading">Create</button>
|
|
230
|
+
* <div v-if="error">Error: {{ error.message }}</div>
|
|
231
|
+
* </form>
|
|
232
|
+
* </template>
|
|
233
|
+
* ```
|
|
234
|
+
*/
|
|
235
|
+
function useCreateMemory() {
|
|
236
|
+
const client = useMemoryClient();
|
|
237
|
+
const loading = ref(false);
|
|
238
|
+
const error = ref(null);
|
|
239
|
+
async function createMemory(memory) {
|
|
240
|
+
loading.value = true;
|
|
241
|
+
error.value = null;
|
|
242
|
+
const result = await client.createMemory(memory);
|
|
243
|
+
if (result.error) {
|
|
244
|
+
error.value = result.error;
|
|
245
|
+
loading.value = false;
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
loading.value = false;
|
|
249
|
+
return result.data || null;
|
|
250
|
+
}
|
|
251
|
+
return {
|
|
252
|
+
createMemory,
|
|
253
|
+
loading: computed(() => loading.value),
|
|
254
|
+
error: computed(() => error.value)
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Composable to search memories
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```vue
|
|
262
|
+
* <script setup>
|
|
263
|
+
* import { ref, watch } from 'vue';
|
|
264
|
+
* import { useSearchMemories } from '@lanonasis/memory-client/vue';
|
|
265
|
+
*
|
|
266
|
+
* const query = ref('');
|
|
267
|
+
* const { results, loading, error, search, totalResults, searchTime } = useSearchMemories();
|
|
268
|
+
*
|
|
269
|
+
* watch(query, (newQuery) => {
|
|
270
|
+
* if (newQuery.length > 2) {
|
|
271
|
+
* search(newQuery, { limit: 10 });
|
|
272
|
+
* }
|
|
273
|
+
* });
|
|
274
|
+
* </script>
|
|
275
|
+
*
|
|
276
|
+
* <template>
|
|
277
|
+
* <div>
|
|
278
|
+
* <input v-model="query" placeholder="Search memories..." />
|
|
279
|
+
* <div v-if="loading">Searching...</div>
|
|
280
|
+
* <div v-if="error">Error: {{ error.message }}</div>
|
|
281
|
+
* <div v-for="result in results" :key="result.id">
|
|
282
|
+
* <h3>{{ result.title }}</h3>
|
|
283
|
+
* <span>Score: {{ result.similarity_score.toFixed(2) }}</span>
|
|
284
|
+
* </div>
|
|
285
|
+
* <div v-if="totalResults > 0">
|
|
286
|
+
* Found {{ totalResults }} results in {{ searchTime }}ms
|
|
287
|
+
* </div>
|
|
288
|
+
* </div>
|
|
289
|
+
* </template>
|
|
290
|
+
* ```
|
|
291
|
+
*/
|
|
292
|
+
function useSearchMemories(debounceMs = 300) {
|
|
293
|
+
const client = useMemoryClient();
|
|
294
|
+
const results = ref([]);
|
|
295
|
+
const loading = ref(false);
|
|
296
|
+
const error = ref(null);
|
|
297
|
+
const totalResults = ref(0);
|
|
298
|
+
const searchTime = ref(0);
|
|
299
|
+
let debounceTimer = null;
|
|
300
|
+
async function search(query, options) {
|
|
301
|
+
// Clear existing timer
|
|
302
|
+
if (debounceTimer) {
|
|
303
|
+
clearTimeout(debounceTimer);
|
|
304
|
+
}
|
|
305
|
+
// Set new timer
|
|
306
|
+
debounceTimer = setTimeout(async () => {
|
|
307
|
+
loading.value = true;
|
|
308
|
+
error.value = null;
|
|
309
|
+
const result = await client.searchMemories({
|
|
310
|
+
query,
|
|
311
|
+
status: options?.status ?? 'active',
|
|
312
|
+
limit: options?.limit ?? 20,
|
|
313
|
+
threshold: options?.threshold ?? 0.7,
|
|
314
|
+
...options
|
|
315
|
+
});
|
|
316
|
+
if (result.error) {
|
|
317
|
+
error.value = result.error;
|
|
318
|
+
results.value = [];
|
|
319
|
+
totalResults.value = 0;
|
|
320
|
+
searchTime.value = 0;
|
|
321
|
+
}
|
|
322
|
+
else if (result.data) {
|
|
323
|
+
results.value = result.data.results;
|
|
324
|
+
totalResults.value = result.data.total_results;
|
|
325
|
+
searchTime.value = result.data.search_time_ms;
|
|
326
|
+
}
|
|
327
|
+
loading.value = false;
|
|
328
|
+
}, debounceMs);
|
|
329
|
+
}
|
|
330
|
+
return {
|
|
331
|
+
results: computed(() => results.value),
|
|
332
|
+
loading: computed(() => loading.value),
|
|
333
|
+
error: computed(() => error.value),
|
|
334
|
+
search,
|
|
335
|
+
totalResults: computed(() => totalResults.value),
|
|
336
|
+
searchTime: computed(() => searchTime.value)
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export { MEMORY_CLIENT_KEY, createMemoryPlugin, useCreateMemory, useMemories, useMemory, useMemoryClient, useSearchMemories };
|
|
341
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/vue/plugin.ts","../../../src/vue/composables.ts"],"sourcesContent":["/**\n * Vue Plugin for Memory Client\n *\n * Provides a Memory Client instance to all components via Vue's provide/inject\n */\n\nimport { type App, type InjectionKey, inject } from 'vue';\nimport { createMemoryClient, type CoreMemoryClient, type CoreMemoryClientConfig } from '../core/client';\n\nexport const MEMORY_CLIENT_KEY: InjectionKey<CoreMemoryClient> = Symbol('MemoryClient');\n\nexport interface MemoryPluginOptions extends CoreMemoryClientConfig {\n /** Automatically authenticate on plugin installation */\n autoAuth?: boolean;\n}\n\n/**\n * Vue plugin for Memory Client\n *\n * @example\n * ```ts\n * import { createApp } from 'vue';\n * import { createMemoryPlugin } from '@lanonasis/memory-client/vue';\n * import App from './App.vue';\n *\n * const app = createApp(App);\n *\n * app.use(createMemoryPlugin({\n * apiUrl: 'https://api.lanonasis.com',\n * apiKey: import.meta.env.VITE_LANONASIS_KEY\n * }));\n *\n * app.mount('#app');\n * ```\n */\nexport function createMemoryPlugin(options: MemoryPluginOptions) {\n return {\n install(app: App) {\n const client = createMemoryClient(options);\n app.provide(MEMORY_CLIENT_KEY, client);\n }\n };\n}\n\n/**\n * Hook to access the Memory Client instance\n *\n * @throws Error if used without installing the plugin\n */\nexport function useMemoryClient(): CoreMemoryClient {\n const client = inject(MEMORY_CLIENT_KEY);\n\n if (!client) {\n throw new Error('Memory client not provided. Did you install the createMemoryPlugin?');\n }\n\n return client;\n}\n","/**\n * Vue Composables for Memory Client\n *\n * Provides convenient Vue composables for working with memories\n */\n\nimport { ref, computed, onMounted, watch, type Ref } from 'vue';\nimport { useMemoryClient } from './plugin';\nimport type {\n MemoryEntry,\n CreateMemoryRequest,\n UpdateMemoryRequest,\n SearchMemoryRequest,\n MemorySearchResult\n} from '../core/types';\nimport type { ApiErrorResponse } from '../core/errors';\n\n/**\n * Composable to list memories with optional filtering\n *\n * @example\n * ```vue\n * <script setup>\n * import { useMemories } from '@lanonasis/memory-client/vue';\n *\n * const { memories, loading, error, refresh } = useMemories({\n * memory_type: 'project',\n * limit: 20\n * });\n * </script>\n *\n * <template>\n * <div v-if=\"loading\">Loading...</div>\n * <div v-else-if=\"error\">Error: {{ error.message }}</div>\n * <div v-else>\n * <div v-for=\"memory in memories\" :key=\"memory.id\">\n * {{ memory.title }}\n * </div>\n * <button @click=\"refresh\">Refresh</button>\n * </div>\n * </template>\n * ```\n */\nexport function useMemories(options?: {\n page?: number;\n limit?: number;\n memory_type?: string;\n topic_id?: string;\n project_ref?: string;\n status?: string;\n tags?: string[];\n sort?: string;\n order?: 'asc' | 'desc';\n}) {\n const client = useMemoryClient();\n const memories = ref<MemoryEntry[]>([]);\n const loading = ref(true);\n const error = ref<ApiErrorResponse | null>(null);\n\n async function loadMemories() {\n loading.value = true;\n error.value = null;\n\n const result = await client.listMemories(options);\n\n if (result.error) {\n error.value = result.error;\n memories.value = [];\n } else if (result.data) {\n memories.value = result.data.data;\n }\n\n loading.value = false;\n }\n\n onMounted(loadMemories);\n\n return {\n memories: computed(() => memories.value),\n loading: computed(() => loading.value),\n error: computed(() => error.value),\n refresh: loadMemories\n };\n}\n\n/**\n * Composable to fetch and manage a single memory by ID\n *\n * @example\n * ```vue\n * <script setup>\n * import { useMemory } from '@lanonasis/memory-client/vue';\n *\n * const props = defineProps<{ id: string }>();\n * const { memory, loading, error, update, deleteMemory } = useMemory(() => props.id);\n * </script>\n *\n * <template>\n * <div v-if=\"loading\">Loading...</div>\n * <div v-else-if=\"error\">Error: {{ error.message }}</div>\n * <div v-else-if=\"memory\">\n * <h1>{{ memory.title }}</h1>\n * <p>{{ memory.content }}</p>\n * <button @click=\"update({ title: 'Updated Title' })\">Update</button>\n * <button @click=\"deleteMemory\">Delete</button>\n * </div>\n * </template>\n * ```\n */\nexport function useMemory(id: Ref<string> | (() => string) | string) {\n const client = useMemoryClient();\n const memory = ref<MemoryEntry | null>(null);\n const loading = ref(true);\n const error = ref<ApiErrorResponse | null>(null);\n\n const memoryId = computed(() => {\n if (typeof id === 'function') {\n return id();\n } else if (typeof id === 'string') {\n return id;\n } else {\n return id.value;\n }\n });\n\n async function loadMemory() {\n if (!memoryId.value) {\n memory.value = null;\n loading.value = false;\n return;\n }\n\n loading.value = true;\n error.value = null;\n\n const result = await client.getMemory(memoryId.value);\n\n if (result.error) {\n error.value = result.error;\n memory.value = null;\n } else if (result.data) {\n memory.value = result.data;\n }\n\n loading.value = false;\n }\n\n async function update(updates: UpdateMemoryRequest) {\n if (!memoryId.value) return;\n\n const result = await client.updateMemory(memoryId.value, updates);\n\n if (result.error) {\n error.value = result.error;\n } else if (result.data) {\n memory.value = result.data;\n }\n }\n\n async function deleteMemory() {\n if (!memoryId.value) return;\n\n const result = await client.deleteMemory(memoryId.value);\n\n if (result.error) {\n error.value = result.error;\n } else {\n memory.value = null;\n }\n }\n\n onMounted(loadMemory);\n\n // Watch for ID changes and reload\n watch(memoryId, loadMemory);\n\n return {\n memory: computed(() => memory.value),\n loading: computed(() => loading.value),\n error: computed(() => error.value),\n refresh: loadMemory,\n update,\n deleteMemory\n };\n}\n\n/**\n * Composable to create new memories\n *\n * @example\n * ```vue\n * <script setup>\n * import { ref } from 'vue';\n * import { useCreateMemory } from '@lanonasis/memory-client/vue';\n *\n * const title = ref('');\n * const content = ref('');\n * const { createMemory, loading, error } = useCreateMemory();\n *\n * async function handleSubmit() {\n * const memory = await createMemory({\n * title: title.value,\n * content: content.value\n * });\n * if (memory) {\n * console.log('Created:', memory.id);\n * title.value = '';\n * content.value = '';\n * }\n * }\n * </script>\n *\n * <template>\n * <form @submit.prevent=\"handleSubmit\">\n * <input v-model=\"title\" placeholder=\"Title\" />\n * <textarea v-model=\"content\" placeholder=\"Content\" />\n * <button type=\"submit\" :disabled=\"loading\">Create</button>\n * <div v-if=\"error\">Error: {{ error.message }}</div>\n * </form>\n * </template>\n * ```\n */\nexport function useCreateMemory() {\n const client = useMemoryClient();\n const loading = ref(false);\n const error = ref<ApiErrorResponse | null>(null);\n\n async function createMemory(memory: CreateMemoryRequest): Promise<MemoryEntry | null> {\n loading.value = true;\n error.value = null;\n\n const result = await client.createMemory(memory);\n\n if (result.error) {\n error.value = result.error;\n loading.value = false;\n return null;\n }\n\n loading.value = false;\n return result.data || null;\n }\n\n return {\n createMemory,\n loading: computed(() => loading.value),\n error: computed(() => error.value)\n };\n}\n\n/**\n * Composable to search memories\n *\n * @example\n * ```vue\n * <script setup>\n * import { ref, watch } from 'vue';\n * import { useSearchMemories } from '@lanonasis/memory-client/vue';\n *\n * const query = ref('');\n * const { results, loading, error, search, totalResults, searchTime } = useSearchMemories();\n *\n * watch(query, (newQuery) => {\n * if (newQuery.length > 2) {\n * search(newQuery, { limit: 10 });\n * }\n * });\n * </script>\n *\n * <template>\n * <div>\n * <input v-model=\"query\" placeholder=\"Search memories...\" />\n * <div v-if=\"loading\">Searching...</div>\n * <div v-if=\"error\">Error: {{ error.message }}</div>\n * <div v-for=\"result in results\" :key=\"result.id\">\n * <h3>{{ result.title }}</h3>\n * <span>Score: {{ result.similarity_score.toFixed(2) }}</span>\n * </div>\n * <div v-if=\"totalResults > 0\">\n * Found {{ totalResults }} results in {{ searchTime }}ms\n * </div>\n * </div>\n * </template>\n * ```\n */\nexport function useSearchMemories(debounceMs: number = 300) {\n const client = useMemoryClient();\n const results = ref<MemorySearchResult[]>([]);\n const loading = ref(false);\n const error = ref<ApiErrorResponse | null>(null);\n const totalResults = ref(0);\n const searchTime = ref(0);\n let debounceTimer: ReturnType<typeof setTimeout> | null = null;\n\n async function search(query: string, options?: Omit<SearchMemoryRequest, 'query'>) {\n // Clear existing timer\n if (debounceTimer) {\n clearTimeout(debounceTimer);\n }\n\n // Set new timer\n debounceTimer = setTimeout(async () => {\n loading.value = true;\n error.value = null;\n\n const result = await client.searchMemories({\n query,\n status: options?.status ?? 'active',\n limit: options?.limit ?? 20,\n threshold: options?.threshold ?? 0.7,\n ...options\n });\n\n if (result.error) {\n error.value = result.error;\n results.value = [];\n totalResults.value = 0;\n searchTime.value = 0;\n } else if (result.data) {\n results.value = result.data.results;\n totalResults.value = result.data.total_results;\n searchTime.value = result.data.search_time_ms;\n }\n\n loading.value = false;\n }, debounceMs);\n }\n\n return {\n results: computed(() => results.value),\n loading: computed(() => loading.value),\n error: computed(() => error.value),\n search,\n totalResults: computed(() => totalResults.value),\n searchTime: computed(() => searchTime.value)\n };\n}\n"],"names":[],"mappings":";;;AAAA;;;;AAIG;MAKU,iBAAiB,GAAmC,MAAM,CAAC,cAAc;AAOtF;;;;;;;;;;;;;;;;;;AAkBG;AACG,SAAU,kBAAkB,CAAC,OAA4B,EAAA;IAC7D,OAAO;AACL,QAAA,OAAO,CAAC,GAAQ,EAAA;AACd,YAAA,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,CAAC;AAC1C,YAAA,GAAG,CAAC,OAAO,CAAC,iBAAiB,EAAE,MAAM,CAAC;QACxC;KACD;AACH;AAEA;;;;AAIG;SACa,eAAe,GAAA;AAC7B,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,iBAAiB,CAAC;IAExC,IAAI,CAAC,MAAM,EAAE;AACX,QAAA,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC;IACxF;AAEA,IAAA,OAAO,MAAM;AACf;;ACzDA;;;;AAIG;AAaH;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACG,SAAU,WAAW,CAAC,OAU3B,EAAA;AACC,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAChC,IAAA,MAAM,QAAQ,GAAG,GAAG,CAAgB,EAAE,CAAC;AACvC,IAAA,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC;AACzB,IAAA,MAAM,KAAK,GAAG,GAAG,CAA0B,IAAI,CAAC;AAEhD,IAAA,eAAe,YAAY,GAAA;AACzB,QAAA,OAAO,CAAC,KAAK,GAAG,IAAI;AACpB,QAAA,KAAK,CAAC,KAAK,GAAG,IAAI;QAElB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,YAAY,CAAC,OAAO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