@robosystems/client 0.1.15 → 0.1.16

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 (66) hide show
  1. package/package.json +48 -6
  2. package/sdk/client/client.gen.d.ts +2 -0
  3. package/sdk/client/client.gen.js +153 -0
  4. package/sdk/client/client.gen.ts +200 -0
  5. package/sdk/client/index.d.ts +7 -0
  6. package/sdk/client/index.js +15 -0
  7. package/sdk/client/index.ts +25 -0
  8. package/sdk/client/types.gen.d.ts +122 -0
  9. package/sdk/client/types.gen.js +4 -0
  10. package/sdk/client/types.gen.ts +233 -0
  11. package/sdk/client/utils.gen.d.ts +45 -0
  12. package/sdk/client/utils.gen.js +296 -0
  13. package/sdk/client/utils.gen.ts +419 -0
  14. package/sdk/client.gen.d.ts +12 -0
  15. package/sdk/client.gen.js +8 -0
  16. package/sdk/client.gen.ts +18 -0
  17. package/sdk/core/auth.gen.d.ts +18 -0
  18. package/sdk/core/auth.gen.js +18 -0
  19. package/sdk/core/auth.gen.ts +42 -0
  20. package/sdk/core/bodySerializer.gen.d.ts +17 -0
  21. package/sdk/core/bodySerializer.gen.js +57 -0
  22. package/sdk/core/bodySerializer.gen.ts +90 -0
  23. package/sdk/core/params.gen.d.ts +33 -0
  24. package/sdk/core/params.gen.js +92 -0
  25. package/sdk/core/params.gen.ts +153 -0
  26. package/sdk/core/pathSerializer.gen.d.ts +33 -0
  27. package/sdk/core/pathSerializer.gen.js +123 -0
  28. package/sdk/core/pathSerializer.gen.ts +181 -0
  29. package/sdk/core/types.gen.d.ts +78 -0
  30. package/sdk/core/types.gen.js +4 -0
  31. package/sdk/core/types.gen.ts +121 -0
  32. package/sdk/index.d.ts +2 -0
  33. package/sdk/index.js +19 -0
  34. package/sdk/index.ts +3 -0
  35. package/sdk/sdk.gen.d.ts +1269 -0
  36. package/sdk/sdk.gen.js +2664 -0
  37. package/sdk/sdk.gen.ts +2677 -0
  38. package/sdk/types.gen.d.ts +6265 -0
  39. package/sdk/types.gen.js +3 -0
  40. package/sdk/types.gen.ts +6784 -0
  41. package/sdk-extensions/OperationClient.d.ts +64 -0
  42. package/sdk-extensions/OperationClient.js +251 -0
  43. package/sdk-extensions/OperationClient.ts +322 -0
  44. package/sdk-extensions/QueryClient.d.ts +50 -0
  45. package/sdk-extensions/QueryClient.js +190 -0
  46. package/sdk-extensions/QueryClient.ts +283 -0
  47. package/sdk-extensions/README.md +672 -0
  48. package/sdk-extensions/SSEClient.d.ts +48 -0
  49. package/sdk-extensions/SSEClient.js +148 -0
  50. package/sdk-extensions/SSEClient.ts +189 -0
  51. package/sdk-extensions/config.d.ts +32 -0
  52. package/sdk-extensions/config.js +74 -0
  53. package/sdk-extensions/config.ts +91 -0
  54. package/sdk-extensions/hooks.d.ts +110 -0
  55. package/sdk-extensions/hooks.js +371 -0
  56. package/sdk-extensions/hooks.ts +438 -0
  57. package/sdk-extensions/index.d.ts +46 -0
  58. package/sdk-extensions/index.js +110 -0
  59. package/sdk-extensions/index.ts +123 -0
  60. package/sdk.gen.d.ts +128 -2
  61. package/sdk.gen.js +216 -2
  62. package/sdk.gen.ts +216 -2
  63. package/types.gen.d.ts +573 -4
  64. package/types.gen.ts +606 -4
  65. package/openapi-ts.config.js +0 -9
  66. package/prepare.js +0 -220
@@ -0,0 +1,438 @@
1
+ 'use client'
2
+
3
+ /**
4
+ * React hooks for SDK extensions
5
+ * Provides easy-to-use hooks for Next.js/React applications
6
+ */
7
+
8
+ import { useCallback, useEffect, useRef, useState } from 'react'
9
+ import { client } from '../sdk/client.gen'
10
+ import { getSDKExtensionsConfig } from './config'
11
+ import type { OperationProgress, OperationResult } from './OperationClient'
12
+ import { OperationClient } from './OperationClient'
13
+ import type { QueryOptions, QueryResult } from './QueryClient'
14
+ import { QueryClient } from './QueryClient'
15
+
16
+ /**
17
+ * Hook for executing Cypher queries with loading states and error handling
18
+ *
19
+ * @example
20
+ * ```tsx
21
+ * const { execute, loading, error, data } = useQuery('graph_123')
22
+ *
23
+ * const handleSearch = async () => {
24
+ * const result = await execute('MATCH (n:Company) RETURN n LIMIT 10')
25
+ * console.log(result.data)
26
+ * }
27
+ * ```
28
+ */
29
+ export function useQuery(graphId: string) {
30
+ const [loading, setLoading] = useState(false)
31
+ const [error, setError] = useState<Error | null>(null)
32
+ const [data, setData] = useState<QueryResult | null>(null)
33
+ const [queuePosition, setQueuePosition] = useState<number | null>(null)
34
+ const clientRef = useRef<QueryClient>(null)
35
+
36
+ // Initialize client
37
+ useEffect(() => {
38
+ const sdkConfig = getSDKExtensionsConfig()
39
+ const clientConfig = client.getConfig()
40
+ clientRef.current = new QueryClient({
41
+ baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
42
+ credentials: sdkConfig.credentials,
43
+ headers: sdkConfig.headers,
44
+ })
45
+
46
+ return () => {
47
+ clientRef.current?.close()
48
+ }
49
+ }, [])
50
+
51
+ const execute = useCallback(
52
+ async (
53
+ query: string,
54
+ parameters?: Record<string, any>,
55
+ options?: QueryOptions
56
+ ): Promise<QueryResult | null> => {
57
+ if (!clientRef.current) return null
58
+
59
+ setLoading(true)
60
+ setError(null)
61
+ setData(null)
62
+ setQueuePosition(null)
63
+
64
+ try {
65
+ const result = (await clientRef.current.executeQuery(
66
+ graphId,
67
+ { query, parameters },
68
+ {
69
+ ...options,
70
+ onQueueUpdate: (position) => {
71
+ setQueuePosition(position)
72
+ },
73
+ onProgress: () => {
74
+ setQueuePosition(null) // Clear queue position when executing
75
+ },
76
+ }
77
+ )) as QueryResult
78
+
79
+ setData(result)
80
+ return result
81
+ } catch (err) {
82
+ const error = err as Error
83
+ setError(error)
84
+ return null
85
+ } finally {
86
+ setLoading(false)
87
+ setQueuePosition(null)
88
+ }
89
+ },
90
+ [graphId]
91
+ )
92
+
93
+ // Simple query method that returns just the data
94
+ const query = useCallback(
95
+ async (cypher: string, parameters?: Record<string, any>) => {
96
+ const result = await execute(cypher, parameters)
97
+ return result?.data || []
98
+ },
99
+ [execute]
100
+ )
101
+
102
+ return {
103
+ execute,
104
+ query,
105
+ loading,
106
+ error,
107
+ data,
108
+ queuePosition,
109
+ }
110
+ }
111
+
112
+ /**
113
+ * Hook for streaming large query results
114
+ *
115
+ * @example
116
+ * ```tsx
117
+ * const { stream, isStreaming, error, cancel } = useStreamingQuery('graph_123')
118
+ *
119
+ * const handleStream = async () => {
120
+ * const iterator = stream('MATCH (n) RETURN n')
121
+ * for await (const batch of iterator) {
122
+ * console.log('Received batch:', batch)
123
+ * }
124
+ * }
125
+ * ```
126
+ */
127
+ export function useStreamingQuery(graphId: string) {
128
+ const [isStreaming, setIsStreaming] = useState(false)
129
+ const [error, setError] = useState<Error | null>(null)
130
+ const [rowsReceived, setRowsReceived] = useState(0)
131
+ const clientRef = useRef<QueryClient>(null)
132
+
133
+ useEffect(() => {
134
+ const sdkConfig = getSDKExtensionsConfig()
135
+ const clientConfig = client.getConfig()
136
+ clientRef.current = new QueryClient({
137
+ baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
138
+ credentials: sdkConfig.credentials,
139
+ headers: sdkConfig.headers,
140
+ })
141
+
142
+ return () => {
143
+ clientRef.current?.close()
144
+ }
145
+ }, [])
146
+
147
+ const stream = useCallback(
148
+ async function* (
149
+ query: string,
150
+ parameters?: Record<string, any>,
151
+ chunkSize: number = 100
152
+ ): AsyncIterableIterator<any[]> {
153
+ if (!clientRef.current) return
154
+
155
+ setIsStreaming(true)
156
+ setError(null)
157
+ setRowsReceived(0)
158
+
159
+ try {
160
+ const iterator = clientRef.current.streamQuery(graphId, query, parameters, chunkSize)
161
+
162
+ let buffer: any[] = []
163
+ let count = 0
164
+
165
+ for await (const row of iterator) {
166
+ buffer.push(row)
167
+ count++
168
+
169
+ if (buffer.length >= chunkSize) {
170
+ setRowsReceived(count)
171
+ yield buffer
172
+ buffer = []
173
+ }
174
+ }
175
+
176
+ // Yield any remaining items
177
+ if (buffer.length > 0) {
178
+ setRowsReceived(count)
179
+ yield buffer
180
+ }
181
+ } catch (err) {
182
+ setError(err as Error)
183
+ throw err
184
+ } finally {
185
+ setIsStreaming(false)
186
+ }
187
+ },
188
+ [graphId]
189
+ )
190
+
191
+ const cancel = useCallback(() => {
192
+ clientRef.current?.close()
193
+ setIsStreaming(false)
194
+ }, [])
195
+
196
+ return {
197
+ stream,
198
+ isStreaming,
199
+ error,
200
+ rowsReceived,
201
+ cancel,
202
+ }
203
+ }
204
+
205
+ /**
206
+ * Hook for monitoring long-running operations
207
+ *
208
+ * @example
209
+ * ```tsx
210
+ * const { monitor, status, progress, error, result } = useOperation<BackupResult>()
211
+ *
212
+ * const handleBackup = async () => {
213
+ * const { operation_id } = await createBackup({ ... })
214
+ * const result = await monitor(operation_id)
215
+ * console.log('Backup completed:', result)
216
+ * }
217
+ * ```
218
+ */
219
+ export function useOperation<T = any>(operationId?: string) {
220
+ const [status, setStatus] = useState<'idle' | 'running' | 'completed' | 'error'>('idle')
221
+ const [progress, setProgress] = useState<OperationProgress | null>(null)
222
+ const [error, setError] = useState<Error | null>(null)
223
+ const [result, setResult] = useState<OperationResult<T> | null>(null)
224
+ const clientRef = useRef<OperationClient>(null)
225
+
226
+ useEffect(() => {
227
+ const sdkConfig = getSDKExtensionsConfig()
228
+ const clientConfig = client.getConfig()
229
+ clientRef.current = new OperationClient({
230
+ baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
231
+ credentials: sdkConfig.credentials,
232
+ maxRetries: sdkConfig.maxRetries,
233
+ retryDelay: sdkConfig.retryDelay,
234
+ })
235
+
236
+ return () => {
237
+ clientRef.current?.closeAll()
238
+ }
239
+ }, [])
240
+
241
+ const monitor = useCallback(
242
+ async (id: string, timeout?: number): Promise<OperationResult<T> | null> => {
243
+ if (!clientRef.current) return null
244
+
245
+ setStatus('running')
246
+ setError(null)
247
+ setResult(null)
248
+ setProgress(null)
249
+
250
+ try {
251
+ const opResult = await clientRef.current.monitorOperation<T>(id, {
252
+ onProgress: (p) => {
253
+ setProgress(p)
254
+ },
255
+ onQueueUpdate: (position, estimatedWait) => {
256
+ setProgress({
257
+ message: `Queue position: ${position}`,
258
+ progressPercent: 0,
259
+ details: { position, estimatedWait },
260
+ })
261
+ },
262
+ timeout,
263
+ })
264
+
265
+ setResult(opResult)
266
+ setStatus(opResult.success ? 'completed' : 'error')
267
+
268
+ if (!opResult.success && opResult.error) {
269
+ setError(new Error(opResult.error))
270
+ }
271
+
272
+ return opResult
273
+ } catch (err) {
274
+ const error = err as Error
275
+ setError(error)
276
+ setStatus('error')
277
+ return null
278
+ }
279
+ },
280
+ []
281
+ )
282
+
283
+ const cancel = useCallback(async (id: string) => {
284
+ if (!clientRef.current) return
285
+
286
+ try {
287
+ await clientRef.current.cancelOperation(id)
288
+ setStatus('idle')
289
+ } catch (err) {
290
+ setError(err as Error)
291
+ }
292
+ }, [])
293
+
294
+ // Auto-monitor if operationId is provided
295
+ useEffect(() => {
296
+ if (operationId && status === 'idle') {
297
+ monitor(operationId)
298
+ }
299
+ }, [operationId, monitor, status])
300
+
301
+ return {
302
+ monitor,
303
+ cancel,
304
+ status,
305
+ progress,
306
+ error,
307
+ result,
308
+ }
309
+ }
310
+
311
+ /**
312
+ * Hook for monitoring multiple operations concurrently
313
+ *
314
+ * @example
315
+ * ```tsx
316
+ * const { monitorAll, results, allCompleted, hasErrors } = useMultipleOperations()
317
+ *
318
+ * const handleMultiple = async () => {
319
+ * const operations = await Promise.all([
320
+ * createBackup(...),
321
+ * createExport(...),
322
+ * ])
323
+ *
324
+ * const results = await monitorAll(operations.map(op => op.operation_id))
325
+ * }
326
+ * ```
327
+ */
328
+ export function useMultipleOperations<T = any>() {
329
+ const [results, setResults] = useState<Map<string, OperationResult<T>>>(new Map())
330
+ const [loading, setLoading] = useState(false)
331
+ const [errors, setErrors] = useState<Map<string, Error>>(new Map())
332
+ const clientRef = useRef<OperationClient>(null)
333
+
334
+ useEffect(() => {
335
+ const sdkConfig = getSDKExtensionsConfig()
336
+ const clientConfig = client.getConfig()
337
+ clientRef.current = new OperationClient({
338
+ baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
339
+ credentials: sdkConfig.credentials,
340
+ maxRetries: sdkConfig.maxRetries,
341
+ retryDelay: sdkConfig.retryDelay,
342
+ })
343
+
344
+ return () => {
345
+ clientRef.current?.closeAll()
346
+ }
347
+ }, [])
348
+
349
+ const monitorAll = useCallback(
350
+ async (operationIds: string[]): Promise<Map<string, OperationResult<T>>> => {
351
+ if (!clientRef.current) return new Map()
352
+
353
+ setLoading(true)
354
+ setResults(new Map())
355
+ setErrors(new Map())
356
+
357
+ try {
358
+ const allResults = await clientRef.current.monitorMultiple<T>(operationIds)
359
+ setResults(allResults)
360
+
361
+ // Extract any errors
362
+ const newErrors = new Map<string, Error>()
363
+ allResults.forEach((result, id) => {
364
+ if (!result.success && result.error) {
365
+ newErrors.set(id, new Error(result.error))
366
+ }
367
+ })
368
+ setErrors(newErrors)
369
+
370
+ return allResults
371
+ } finally {
372
+ setLoading(false)
373
+ }
374
+ },
375
+ []
376
+ )
377
+
378
+ const allCompleted =
379
+ results.size > 0 && Array.from(results.values()).every((r) => r.success || r.error)
380
+
381
+ const hasErrors = errors.size > 0
382
+
383
+ return {
384
+ monitorAll,
385
+ results,
386
+ errors,
387
+ loading,
388
+ allCompleted,
389
+ hasErrors,
390
+ }
391
+ }
392
+
393
+ /**
394
+ * Hook that provides access to all SDK extension clients
395
+ * Useful when you need direct access to the underlying clients
396
+ *
397
+ * @example
398
+ * ```tsx
399
+ * const clients = useSDKClients()
400
+ *
401
+ * // Direct access to clients
402
+ * const result = await clients.query.query('graph_123', 'MATCH (n) RETURN n')
403
+ * ```
404
+ */
405
+ export function useSDKClients() {
406
+ const [clients, setClients] = useState<{
407
+ query: QueryClient | null
408
+ operations: OperationClient | null
409
+ }>({
410
+ query: null,
411
+ operations: null,
412
+ })
413
+
414
+ useEffect(() => {
415
+ const sdkConfig = getSDKExtensionsConfig()
416
+ const clientConfig = client.getConfig()
417
+ const baseConfig = {
418
+ baseUrl: sdkConfig.baseUrl || clientConfig.baseUrl || 'http://localhost:8000',
419
+ credentials: sdkConfig.credentials,
420
+ headers: sdkConfig.headers,
421
+ }
422
+
423
+ const queryClient = new QueryClient(baseConfig)
424
+ const operationsClient = new OperationClient(baseConfig)
425
+
426
+ setClients({
427
+ query: queryClient,
428
+ operations: operationsClient,
429
+ })
430
+
431
+ return () => {
432
+ queryClient.close()
433
+ operationsClient.closeAll()
434
+ }
435
+ }, [])
436
+
437
+ return clients
438
+ }
@@ -0,0 +1,46 @@
1
+ /**
2
+ * RoboSystems SDK Extensions
3
+ * Enhanced clients with SSE support for the RoboSystems API
4
+ */
5
+ import { OperationClient } from './OperationClient';
6
+ import { QueryClient } from './QueryClient';
7
+ import { SSEClient } from './SSEClient';
8
+ export interface RoboSystemsExtensionConfig {
9
+ baseUrl?: string;
10
+ credentials?: 'include' | 'same-origin' | 'omit';
11
+ maxRetries?: number;
12
+ retryDelay?: number;
13
+ }
14
+ export declare class RoboSystemsExtensions {
15
+ readonly query: QueryClient;
16
+ readonly operations: OperationClient;
17
+ private config;
18
+ constructor(config?: RoboSystemsExtensionConfig);
19
+ /**
20
+ * Convenience method to monitor any operation
21
+ */
22
+ monitorOperation(operationId: string, onProgress?: (progress: any) => void): Promise<any>;
23
+ /**
24
+ * Create custom SSE client for advanced use cases
25
+ */
26
+ createSSEClient(): SSEClient;
27
+ /**
28
+ * Clean up all active connections
29
+ */
30
+ close(): void;
31
+ }
32
+ export * from './OperationClient';
33
+ export * from './QueryClient';
34
+ export * from './SSEClient';
35
+ export { OperationClient, QueryClient, SSEClient };
36
+ export { useMultipleOperations, useOperation, useQuery, useSDKClients, useStreamingQuery, } from './hooks';
37
+ export declare const extensions: {
38
+ readonly query: QueryClient;
39
+ readonly operations: OperationClient;
40
+ monitorOperation: (operationId: string, onProgress?: (progress: any) => void) => Promise<any>;
41
+ createSSEClient: () => SSEClient;
42
+ close: () => void;
43
+ };
44
+ export declare const monitorOperation: (operationId: string, onProgress?: (progress: any) => void) => Promise<any>;
45
+ export declare const executeQuery: (graphId: string, query: string, parameters?: Record<string, any>) => Promise<import("./QueryClient").QueryResult>;
46
+ export declare const streamQuery: (graphId: string, query: string, parameters?: Record<string, any>, chunkSize?: number) => AsyncIterableIterator<any>;
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ /**
3
+ * RoboSystems SDK Extensions
4
+ * Enhanced clients with SSE support for the RoboSystems API
5
+ */
6
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
7
+ if (k2 === undefined) k2 = k;
8
+ var desc = Object.getOwnPropertyDescriptor(m, k);
9
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
10
+ desc = { enumerable: true, get: function() { return m[k]; } };
11
+ }
12
+ Object.defineProperty(o, k2, desc);
13
+ }) : (function(o, m, k, k2) {
14
+ if (k2 === undefined) k2 = k;
15
+ o[k2] = m[k];
16
+ }));
17
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
18
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.streamQuery = exports.executeQuery = exports.monitorOperation = exports.extensions = exports.useStreamingQuery = exports.useSDKClients = exports.useQuery = exports.useOperation = exports.useMultipleOperations = exports.SSEClient = exports.QueryClient = exports.OperationClient = exports.RoboSystemsExtensions = void 0;
22
+ const client_gen_1 = require("../sdk/client.gen");
23
+ const OperationClient_1 = require("./OperationClient");
24
+ Object.defineProperty(exports, "OperationClient", { enumerable: true, get: function () { return OperationClient_1.OperationClient; } });
25
+ const QueryClient_1 = require("./QueryClient");
26
+ Object.defineProperty(exports, "QueryClient", { enumerable: true, get: function () { return QueryClient_1.QueryClient; } });
27
+ const SSEClient_1 = require("./SSEClient");
28
+ Object.defineProperty(exports, "SSEClient", { enumerable: true, get: function () { return SSEClient_1.SSEClient; } });
29
+ class RoboSystemsExtensions {
30
+ constructor(config = {}) {
31
+ // Get base URL from SDK client config or use provided/default
32
+ const sdkConfig = client_gen_1.client.getConfig();
33
+ this.config = {
34
+ baseUrl: config.baseUrl || sdkConfig.baseUrl || 'http://localhost:8000',
35
+ credentials: config.credentials || 'include',
36
+ maxRetries: config.maxRetries || 5,
37
+ retryDelay: config.retryDelay || 1000,
38
+ };
39
+ this.query = new QueryClient_1.QueryClient({
40
+ baseUrl: this.config.baseUrl,
41
+ credentials: this.config.credentials,
42
+ });
43
+ this.operations = new OperationClient_1.OperationClient({
44
+ baseUrl: this.config.baseUrl,
45
+ credentials: this.config.credentials,
46
+ });
47
+ }
48
+ /**
49
+ * Convenience method to monitor any operation
50
+ */
51
+ async monitorOperation(operationId, onProgress) {
52
+ return this.operations.monitorOperation(operationId, { onProgress });
53
+ }
54
+ /**
55
+ * Create custom SSE client for advanced use cases
56
+ */
57
+ createSSEClient() {
58
+ return new SSEClient_1.SSEClient({
59
+ baseUrl: this.config.baseUrl,
60
+ credentials: this.config.credentials,
61
+ maxRetries: this.config.maxRetries,
62
+ retryDelay: this.config.retryDelay,
63
+ });
64
+ }
65
+ /**
66
+ * Clean up all active connections
67
+ */
68
+ close() {
69
+ this.query.close();
70
+ this.operations.closeAll();
71
+ }
72
+ }
73
+ exports.RoboSystemsExtensions = RoboSystemsExtensions;
74
+ // Export all types and classes
75
+ __exportStar(require("./OperationClient"), exports);
76
+ __exportStar(require("./QueryClient"), exports);
77
+ __exportStar(require("./SSEClient"), exports);
78
+ // Export React hooks
79
+ var hooks_1 = require("./hooks");
80
+ Object.defineProperty(exports, "useMultipleOperations", { enumerable: true, get: function () { return hooks_1.useMultipleOperations; } });
81
+ Object.defineProperty(exports, "useOperation", { enumerable: true, get: function () { return hooks_1.useOperation; } });
82
+ Object.defineProperty(exports, "useQuery", { enumerable: true, get: function () { return hooks_1.useQuery; } });
83
+ Object.defineProperty(exports, "useSDKClients", { enumerable: true, get: function () { return hooks_1.useSDKClients; } });
84
+ Object.defineProperty(exports, "useStreamingQuery", { enumerable: true, get: function () { return hooks_1.useStreamingQuery; } });
85
+ // Lazy initialization of default instance
86
+ let _extensions = null;
87
+ function getExtensions() {
88
+ if (!_extensions) {
89
+ _extensions = new RoboSystemsExtensions();
90
+ }
91
+ return _extensions;
92
+ }
93
+ exports.extensions = {
94
+ get query() {
95
+ return getExtensions().query;
96
+ },
97
+ get operations() {
98
+ return getExtensions().operations;
99
+ },
100
+ monitorOperation: (operationId, onProgress) => getExtensions().monitorOperation(operationId, onProgress),
101
+ createSSEClient: () => getExtensions().createSSEClient(),
102
+ close: () => getExtensions().close(),
103
+ };
104
+ // Export convenience functions that use the default instance
105
+ const monitorOperation = (operationId, onProgress) => getExtensions().monitorOperation(operationId, onProgress);
106
+ exports.monitorOperation = monitorOperation;
107
+ const executeQuery = (graphId, query, parameters) => getExtensions().query.query(graphId, query, parameters);
108
+ exports.executeQuery = executeQuery;
109
+ const streamQuery = (graphId, query, parameters, chunkSize) => getExtensions().query.streamQuery(graphId, query, parameters, chunkSize);
110
+ exports.streamQuery = streamQuery;