@lanonasis/memory-client 2.0.0 → 2.2.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.
@@ -1,7 +1,8 @@
1
+ import * as vue from 'vue';
1
2
  import { App, InjectionKey, Ref } from 'vue';
2
3
  import { CoreMemoryClientConfig, CoreMemoryClient } from '../core/client';
3
- export { ApiError, ApiResponse, CoreMemoryClient, CoreMemoryClientConfig, PaginatedResponse } from '../core/client';
4
- import { UpdateMemoryRequest, CreateMemoryRequest, MemoryEntry, SearchMemoryRequest } from '../core/types';
4
+ export { ApiResponse, CoreMemoryClient, CoreMemoryClientConfig, PaginatedResponse } from '../core/client';
5
+ import { MemoryType, MemoryStatus, UpdateMemoryRequest, CreateMemoryRequest, MemoryEntry, SearchMemoryRequest } from '../core/types';
5
6
  export { CreateMemoryRequest, MemoryEntry, MemorySearchResult, MemoryStatus, MemoryTopic, MemoryType, SearchMemoryRequest, UpdateMemoryRequest, UserMemoryStats } from '../core/types';
6
7
 
7
8
  /**
@@ -12,6 +13,8 @@ export { CreateMemoryRequest, MemoryEntry, MemorySearchResult, MemoryStatus, Mem
12
13
 
13
14
  declare const MEMORY_CLIENT_KEY: InjectionKey<CoreMemoryClient>;
14
15
  interface MemoryPluginOptions extends CoreMemoryClientConfig {
16
+ /** Automatically authenticate on plugin installation */
17
+ autoAuth?: boolean;
15
18
  }
16
19
  /**
17
20
  * Vue plugin for Memory Client
@@ -42,12 +45,6 @@ declare function createMemoryPlugin(options: MemoryPluginOptions): {
42
45
  */
43
46
  declare function useMemoryClient(): CoreMemoryClient;
44
47
 
45
- /**
46
- * Vue Composables for Memory Client
47
- *
48
- * Provides convenient Vue composables for working with memories
49
- */
50
-
51
48
  /**
52
49
  * Composable to list memories with optional filtering
53
50
  *
@@ -85,9 +82,33 @@ declare function useMemories(options?: {
85
82
  sort?: string;
86
83
  order?: 'asc' | 'desc';
87
84
  }): {
88
- memories: any;
89
- loading: any;
90
- error: any;
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>;
91
112
  refresh: () => Promise<void>;
92
113
  };
93
114
  /**
@@ -115,9 +136,33 @@ declare function useMemories(options?: {
115
136
  * ```
116
137
  */
117
138
  declare function useMemory(id: Ref<string> | (() => string) | string): {
118
- memory: any;
119
- loading: any;
120
- error: any;
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>;
121
166
  refresh: () => Promise<void>;
122
167
  update: (updates: UpdateMemoryRequest) => Promise<void>;
123
168
  deleteMemory: () => Promise<void>;
@@ -160,8 +205,15 @@ declare function useMemory(id: Ref<string> | (() => string) | string): {
160
205
  */
161
206
  declare function useCreateMemory(): {
162
207
  createMemory: (memory: CreateMemoryRequest) => Promise<MemoryEntry | null>;
163
- loading: any;
164
- error: any;
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>;
165
217
  };
166
218
  /**
167
219
  * Composable to search memories
@@ -199,13 +251,66 @@ declare function useCreateMemory(): {
199
251
  * ```
200
252
  */
201
253
  declare function useSearchMemories(debounceMs?: number): {
202
- results: any;
203
- loading: any;
204
- error: any;
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>;
205
282
  search: (query: string, options?: Omit<SearchMemoryRequest, "query">) => Promise<void>;
206
- totalResults: any;
207
- searchTime: any;
283
+ totalResults: vue.ComputedRef<number>;
284
+ searchTime: vue.ComputedRef<number>;
208
285
  };
209
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
+
210
315
  export { MEMORY_CLIENT_KEY, createMemoryPlugin, useCreateMemory, useMemories, useMemory, useMemoryClient, useSearchMemories };
211
- export type { MemoryPluginOptions };
316
+ export type { ApiErrorResponse, ErrorCode, MemoryPluginOptions };
package/dist/vue/index.js CHANGED
@@ -88,10 +88,7 @@ function useMemories(options) {
88
88
  error.value = null;
89
89
  const result = await client.listMemories(options);
90
90
  if (result.error) {
91
- error.value = {
92
- message: result.error,
93
- code: 'API_ERROR'
94
- };
91
+ error.value = result.error;
95
92
  memories.value = [];
96
93
  }
97
94
  else if (result.data) {
@@ -157,10 +154,7 @@ function useMemory(id) {
157
154
  error.value = null;
158
155
  const result = await client.getMemory(memoryId.value);
159
156
  if (result.error) {
160
- error.value = {
161
- message: result.error,
162
- code: 'API_ERROR'
163
- };
157
+ error.value = result.error;
164
158
  memory.value = null;
165
159
  }
166
160
  else if (result.data) {
@@ -173,10 +167,7 @@ function useMemory(id) {
173
167
  return;
174
168
  const result = await client.updateMemory(memoryId.value, updates);
175
169
  if (result.error) {
176
- error.value = {
177
- message: result.error,
178
- code: 'API_ERROR'
179
- };
170
+ error.value = result.error;
180
171
  }
181
172
  else if (result.data) {
182
173
  memory.value = result.data;
@@ -187,10 +178,7 @@ function useMemory(id) {
187
178
  return;
188
179
  const result = await client.deleteMemory(memoryId.value);
189
180
  if (result.error) {
190
- error.value = {
191
- message: result.error,
192
- code: 'API_ERROR'
193
- };
181
+ error.value = result.error;
194
182
  }
195
183
  else {
196
184
  memory.value = null;
@@ -253,10 +241,7 @@ function useCreateMemory() {
253
241
  error.value = null;
254
242
  const result = await client.createMemory(memory);
255
243
  if (result.error) {
256
- error.value = {
257
- message: result.error,
258
- code: 'API_ERROR'
259
- };
244
+ error.value = result.error;
260
245
  loading.value = false;
261
246
  return null;
262
247
  }
@@ -323,13 +308,13 @@ function useSearchMemories(debounceMs = 300) {
323
308
  error.value = null;
324
309
  const result = await client.searchMemories({
325
310
  query,
311
+ status: options?.status ?? 'active',
312
+ limit: options?.limit ?? 20,
313
+ threshold: options?.threshold ?? 0.7,
326
314
  ...options
327
315
  });
328
316
  if (result.error) {
329
- error.value = {
330
- message: result.error,
331
- code: 'API_ERROR'
332
- };
317
+ error.value = result.error;
333
318
  results.value = [];
334
319
  totalResults.value = 0;
335
320
  searchTime.value = 0;
@@ -1 +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 // Plugin-specific options can be added here\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 { ApiError } from '../core/client';\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<ApiError | 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 = {\n message: result.error,\n code: 'API_ERROR'\n };\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<ApiError | 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 = {\n message: result.error,\n code: 'API_ERROR'\n };\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 = {\n message: result.error,\n code: 'API_ERROR'\n };\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 = {\n message: result.error,\n code: 'API_ERROR'\n };\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<ApiError | 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 = {\n message: result.error,\n code: 'API_ERROR'\n };\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<ApiError | 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 ...options\n });\n\n if (result.error) {\n error.value = {\n message: result.error,\n code: 'API_ERROR'\n };\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;AAMtF;;;;;;;;;;;;;;;;;;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;QAC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QAAQ,CAAC,MAAM,YAAY,CAAC,KAAK,CAAC;QAChD,UAAU,EAAE,QAAQ,CAAC,MAAM,UAAU,CAAC,KAAK;KAC5C;AACH;;;;"}
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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