@robosystems/client 0.2.23 → 0.2.25
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/extensions/AgentClient.js +2 -2
- package/extensions/AgentClient.ts +2 -2
- package/extensions/GraphClient.d.ts +21 -1
- package/extensions/GraphClient.js +100 -32
- package/extensions/GraphClient.test.ts +176 -6
- package/extensions/GraphClient.ts +124 -34
- package/extensions/MaterializationClient.d.ts +13 -3
- package/extensions/MaterializationClient.js +68 -18
- package/extensions/MaterializationClient.ts +78 -18
- package/package.json +3 -3
- package/sdk/sdk.gen.d.ts +3 -3
- package/sdk/sdk.gen.js +3 -3
- package/sdk/sdk.gen.ts +3 -3
- package/sdk/types.gen.d.ts +6 -25
- package/sdk/types.gen.ts +6 -25
- package/sdk-extensions/AgentClient.js +2 -2
- package/sdk-extensions/AgentClient.ts +2 -2
- package/sdk-extensions/GraphClient.d.ts +21 -1
- package/sdk-extensions/GraphClient.js +100 -32
- package/sdk-extensions/GraphClient.test.ts +176 -6
- package/sdk-extensions/GraphClient.ts +124 -34
- package/sdk-extensions/MaterializationClient.d.ts +13 -3
- package/sdk-extensions/MaterializationClient.js +68 -18
- package/sdk-extensions/MaterializationClient.ts +78 -18
- package/sdk-extensions/README.md +19 -21
- package/sdk.gen.d.ts +3 -3
- package/sdk.gen.js +3 -3
- package/sdk.gen.ts +3 -3
- package/types.gen.d.ts +6 -25
- package/types.gen.ts +6 -25
package/sdk-extensions/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# RoboSystems Typescript Client Extensions
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Enhanced SSE and Real-time Features** for the RoboSystems Typescript Client
|
|
4
4
|
|
|
5
5
|
[](https://www.typescriptlang.org/)
|
|
6
6
|
[](https://opensource.org/licenses/MIT)
|
|
@@ -17,7 +17,7 @@ The RoboSystems Typescript Client Extensions provide production-ready enhancemen
|
|
|
17
17
|
- **React Hooks** for seamless UI integration
|
|
18
18
|
- **Full TypeScript Support** with comprehensive type definitions
|
|
19
19
|
|
|
20
|
-
##
|
|
20
|
+
## Quick Start
|
|
21
21
|
|
|
22
22
|
### Installation
|
|
23
23
|
|
|
@@ -137,7 +137,7 @@ if (result.success) {
|
|
|
137
137
|
}
|
|
138
138
|
```
|
|
139
139
|
|
|
140
|
-
##
|
|
140
|
+
## SSE Event Types
|
|
141
141
|
|
|
142
142
|
The SDK supports all RoboSystems SSE event types:
|
|
143
143
|
|
|
@@ -162,7 +162,7 @@ enum EventType {
|
|
|
162
162
|
}
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
##
|
|
165
|
+
## Advanced SSE Features
|
|
166
166
|
|
|
167
167
|
### Automatic Reconnection
|
|
168
168
|
|
|
@@ -227,7 +227,7 @@ try {
|
|
|
227
227
|
}
|
|
228
228
|
```
|
|
229
229
|
|
|
230
|
-
##
|
|
230
|
+
## Table Ingestion
|
|
231
231
|
|
|
232
232
|
### TableIngestClient for Parquet File Uploads
|
|
233
233
|
|
|
@@ -250,9 +250,9 @@ const result = await tableClient.uploadParquetFile('graph-id', 'Entity', Buffer.
|
|
|
250
250
|
})
|
|
251
251
|
|
|
252
252
|
if (result.success) {
|
|
253
|
-
console.log(
|
|
253
|
+
console.log(`Uploaded ${result.rowCount} rows to ${result.tableName}`)
|
|
254
254
|
} else {
|
|
255
|
-
console.error(
|
|
255
|
+
console.error(`Upload failed: ${result.error}`)
|
|
256
256
|
}
|
|
257
257
|
```
|
|
258
258
|
|
|
@@ -331,7 +331,7 @@ if (result.success) {
|
|
|
331
331
|
}
|
|
332
332
|
```
|
|
333
333
|
|
|
334
|
-
##
|
|
334
|
+
## Operation Monitoring
|
|
335
335
|
|
|
336
336
|
### OperationClient for Long-Running Tasks
|
|
337
337
|
|
|
@@ -420,7 +420,7 @@ await operationClient.monitor('operation-id', {
|
|
|
420
420
|
})
|
|
421
421
|
```
|
|
422
422
|
|
|
423
|
-
##
|
|
423
|
+
## React Integration
|
|
424
424
|
|
|
425
425
|
### useSSE Hook
|
|
426
426
|
|
|
@@ -569,7 +569,7 @@ function DataImporter({ graphId }: { graphId: string }) {
|
|
|
569
569
|
|
|
570
570
|
{result && result.status === 'completed' && (
|
|
571
571
|
<div style={{ color: 'green' }}>
|
|
572
|
-
<p
|
|
572
|
+
<p>Successfully imported {result.rowsImported} rows</p>
|
|
573
573
|
<p>Execution time: {(result.executionTimeMs / 1000).toFixed(2)}s</p>
|
|
574
574
|
</div>
|
|
575
575
|
)}
|
|
@@ -578,7 +578,7 @@ function DataImporter({ graphId }: { graphId: string }) {
|
|
|
578
578
|
}
|
|
579
579
|
```
|
|
580
580
|
|
|
581
|
-
##
|
|
581
|
+
## Error Handling & Resilience
|
|
582
582
|
|
|
583
583
|
### Circuit Breaker Pattern
|
|
584
584
|
|
|
@@ -649,7 +649,7 @@ sseClient.on('connection_recycled', ({ old, new }) => {
|
|
|
649
649
|
})
|
|
650
650
|
```
|
|
651
651
|
|
|
652
|
-
##
|
|
652
|
+
## Configuration
|
|
653
653
|
|
|
654
654
|
### Environment Variables
|
|
655
655
|
|
|
@@ -713,7 +713,7 @@ const result = await extensions.files.upload('graph-id', 'TableName', fileBuffer
|
|
|
713
713
|
})
|
|
714
714
|
```
|
|
715
715
|
|
|
716
|
-
##
|
|
716
|
+
## Performance Optimization
|
|
717
717
|
|
|
718
718
|
### Stream Processing for Large Datasets
|
|
719
719
|
|
|
@@ -761,7 +761,7 @@ cachedClient.on('cache_invalidated', (query) => {
|
|
|
761
761
|
})
|
|
762
762
|
```
|
|
763
763
|
|
|
764
|
-
##
|
|
764
|
+
## Testing
|
|
765
765
|
|
|
766
766
|
### Mock SSE for Testing
|
|
767
767
|
|
|
@@ -796,7 +796,7 @@ describe('SSE Integration', () => {
|
|
|
796
796
|
})
|
|
797
797
|
```
|
|
798
798
|
|
|
799
|
-
##
|
|
799
|
+
## API Reference
|
|
800
800
|
|
|
801
801
|
### Core Classes
|
|
802
802
|
|
|
@@ -826,7 +826,7 @@ describe('SSE Integration', () => {
|
|
|
826
826
|
- **`formatDuration`** - Human-readable duration formatting
|
|
827
827
|
- **`parseSSEEvent`** - SSE event parsing utility
|
|
828
828
|
|
|
829
|
-
##
|
|
829
|
+
## Troubleshooting
|
|
830
830
|
|
|
831
831
|
### Common Issues
|
|
832
832
|
|
|
@@ -882,15 +882,15 @@ sseClient.on('*', (event, data) => {
|
|
|
882
882
|
})
|
|
883
883
|
```
|
|
884
884
|
|
|
885
|
-
##
|
|
885
|
+
## License
|
|
886
886
|
|
|
887
887
|
MIT License - see [LICENSE](../../LICENSE) file for details.
|
|
888
888
|
|
|
889
|
-
##
|
|
889
|
+
## Contributing
|
|
890
890
|
|
|
891
891
|
See the [Contributing Guide](../../CONTRIBUTING.md) for development setup and guidelines.
|
|
892
892
|
|
|
893
|
-
##
|
|
893
|
+
## Support
|
|
894
894
|
|
|
895
895
|
- **API Reference**: [api.robosystems.ai/docs](https://api.robosystems.ai/docs)
|
|
896
896
|
- **Discord**: [Join our community](https://discord.gg/V9vjcqstxX)
|
|
@@ -899,5 +899,3 @@ See the [Contributing Guide](../../CONTRIBUTING.md) for development setup and gu
|
|
|
899
899
|
---
|
|
900
900
|
|
|
901
901
|
**RoboSystems Typescript Client Extensions** - Production-ready SSE streaming and real-time monitoring for financial knowledge graphs.
|
|
902
|
-
|
|
903
|
-
_Built with ❤️ by the RoboSystems team_
|
package/sdk.gen.d.ts
CHANGED
|
@@ -433,7 +433,7 @@ export declare const listAgents: <ThrowOnError extends boolean = false>(options:
|
|
|
433
433
|
* **Execution Strategies (automatic):**
|
|
434
434
|
* - Fast operations (<5s): Immediate synchronous response
|
|
435
435
|
* - Medium operations (5-30s): SSE streaming with progress updates
|
|
436
|
-
* - Long operations (>30s):
|
|
436
|
+
* - Long operations (>30s): Background queue with operation tracking
|
|
437
437
|
*
|
|
438
438
|
* **Response Mode Override:**
|
|
439
439
|
* Use query parameter `?mode=sync|async` to override automatic strategy selection.
|
|
@@ -494,7 +494,7 @@ export declare const getAgentMetadata: <ThrowOnError extends boolean = false>(op
|
|
|
494
494
|
* **Execution Strategies (automatic):**
|
|
495
495
|
* - Fast operations (<5s): Immediate synchronous response
|
|
496
496
|
* - Medium operations (5-30s): SSE streaming with progress updates
|
|
497
|
-
* - Long operations (>30s):
|
|
497
|
+
* - Long operations (>30s): Background queue with operation tracking
|
|
498
498
|
*
|
|
499
499
|
* **Response Mode Override:**
|
|
500
500
|
* Use query parameter `?mode=sync|async` to override automatic strategy selection.
|
|
@@ -1708,7 +1708,7 @@ export declare const getFile: <ThrowOnError extends boolean = false>(options: Op
|
|
|
1708
1708
|
* **What Happens (status='uploaded'):**
|
|
1709
1709
|
* 1. File validated in S3
|
|
1710
1710
|
* 2. Row count calculated
|
|
1711
|
-
* 3. DuckDB staging triggered immediately (
|
|
1711
|
+
* 3. DuckDB staging triggered immediately (background task)
|
|
1712
1712
|
* 4. If ingest_to_graph=true, graph ingestion queued
|
|
1713
1713
|
* 5. File queryable in DuckDB within seconds
|
|
1714
1714
|
*
|
package/sdk.gen.js
CHANGED
|
@@ -1079,7 +1079,7 @@ exports.listAgents = listAgents;
|
|
|
1079
1079
|
* **Execution Strategies (automatic):**
|
|
1080
1080
|
* - Fast operations (<5s): Immediate synchronous response
|
|
1081
1081
|
* - Medium operations (5-30s): SSE streaming with progress updates
|
|
1082
|
-
* - Long operations (>30s):
|
|
1082
|
+
* - Long operations (>30s): Background queue with operation tracking
|
|
1083
1083
|
*
|
|
1084
1084
|
* **Response Mode Override:**
|
|
1085
1085
|
* Use query parameter `?mode=sync|async` to override automatic strategy selection.
|
|
@@ -1176,7 +1176,7 @@ exports.getAgentMetadata = getAgentMetadata;
|
|
|
1176
1176
|
* **Execution Strategies (automatic):**
|
|
1177
1177
|
* - Fast operations (<5s): Immediate synchronous response
|
|
1178
1178
|
* - Medium operations (5-30s): SSE streaming with progress updates
|
|
1179
|
-
* - Long operations (>30s):
|
|
1179
|
+
* - Long operations (>30s): Background queue with operation tracking
|
|
1180
1180
|
*
|
|
1181
1181
|
* **Response Mode Override:**
|
|
1182
1182
|
* Use query parameter `?mode=sync|async` to override automatic strategy selection.
|
|
@@ -3130,7 +3130,7 @@ exports.getFile = getFile;
|
|
|
3130
3130
|
* **What Happens (status='uploaded'):**
|
|
3131
3131
|
* 1. File validated in S3
|
|
3132
3132
|
* 2. Row count calculated
|
|
3133
|
-
* 3. DuckDB staging triggered immediately (
|
|
3133
|
+
* 3. DuckDB staging triggered immediately (background task)
|
|
3134
3134
|
* 4. If ingest_to_graph=true, graph ingestion queued
|
|
3135
3135
|
* 5. File queryable in DuckDB within seconds
|
|
3136
3136
|
*
|
package/sdk.gen.ts
CHANGED
|
@@ -1092,7 +1092,7 @@ export const listAgents = <ThrowOnError extends boolean = false>(options: Option
|
|
|
1092
1092
|
* **Execution Strategies (automatic):**
|
|
1093
1093
|
* - Fast operations (<5s): Immediate synchronous response
|
|
1094
1094
|
* - Medium operations (5-30s): SSE streaming with progress updates
|
|
1095
|
-
* - Long operations (>30s):
|
|
1095
|
+
* - Long operations (>30s): Background queue with operation tracking
|
|
1096
1096
|
*
|
|
1097
1097
|
* **Response Mode Override:**
|
|
1098
1098
|
* Use query parameter `?mode=sync|async` to override automatic strategy selection.
|
|
@@ -1189,7 +1189,7 @@ export const getAgentMetadata = <ThrowOnError extends boolean = false>(options:
|
|
|
1189
1189
|
* **Execution Strategies (automatic):**
|
|
1190
1190
|
* - Fast operations (<5s): Immediate synchronous response
|
|
1191
1191
|
* - Medium operations (5-30s): SSE streaming with progress updates
|
|
1192
|
-
* - Long operations (>30s):
|
|
1192
|
+
* - Long operations (>30s): Background queue with operation tracking
|
|
1193
1193
|
*
|
|
1194
1194
|
* **Response Mode Override:**
|
|
1195
1195
|
* Use query parameter `?mode=sync|async` to override automatic strategy selection.
|
|
@@ -3143,7 +3143,7 @@ export const getFile = <ThrowOnError extends boolean = false>(options: Options<G
|
|
|
3143
3143
|
* **What Happens (status='uploaded'):**
|
|
3144
3144
|
* 1. File validated in S3
|
|
3145
3145
|
* 2. Row count calculated
|
|
3146
|
-
* 3. DuckDB staging triggered immediately (
|
|
3146
|
+
* 3. DuckDB staging triggered immediately (background task)
|
|
3147
3147
|
* 4. If ingest_to_graph=true, graph ingestion queued
|
|
3148
3148
|
* 5. File queryable in DuckDB within seconds
|
|
3149
3149
|
*
|
package/types.gen.d.ts
CHANGED
|
@@ -3018,43 +3018,24 @@ export type MaterializeRequest = {
|
|
|
3018
3018
|
};
|
|
3019
3019
|
/**
|
|
3020
3020
|
* MaterializeResponse
|
|
3021
|
+
* Response for queued materialization operation.
|
|
3021
3022
|
*/
|
|
3022
3023
|
export type MaterializeResponse = {
|
|
3023
3024
|
/**
|
|
3024
3025
|
* Status
|
|
3025
|
-
*
|
|
3026
|
+
* Operation status
|
|
3026
3027
|
*/
|
|
3027
|
-
status
|
|
3028
|
+
status?: string;
|
|
3028
3029
|
/**
|
|
3029
3030
|
* Graph Id
|
|
3030
3031
|
* Graph database identifier
|
|
3031
3032
|
*/
|
|
3032
3033
|
graph_id: string;
|
|
3033
3034
|
/**
|
|
3034
|
-
*
|
|
3035
|
-
*
|
|
3036
|
-
*/
|
|
3037
|
-
was_stale: boolean;
|
|
3038
|
-
/**
|
|
3039
|
-
* Stale Reason
|
|
3040
|
-
* Reason graph was stale
|
|
3041
|
-
*/
|
|
3042
|
-
stale_reason?: string | null;
|
|
3043
|
-
/**
|
|
3044
|
-
* Tables Materialized
|
|
3045
|
-
* List of tables successfully materialized
|
|
3046
|
-
*/
|
|
3047
|
-
tables_materialized: Array<string>;
|
|
3048
|
-
/**
|
|
3049
|
-
* Total Rows
|
|
3050
|
-
* Total rows materialized across all tables
|
|
3051
|
-
*/
|
|
3052
|
-
total_rows: number;
|
|
3053
|
-
/**
|
|
3054
|
-
* Execution Time Ms
|
|
3055
|
-
* Total materialization time
|
|
3035
|
+
* Operation Id
|
|
3036
|
+
* SSE operation ID for progress tracking
|
|
3056
3037
|
*/
|
|
3057
|
-
|
|
3038
|
+
operation_id: string;
|
|
3058
3039
|
/**
|
|
3059
3040
|
* Message
|
|
3060
3041
|
* Human-readable status message
|
package/types.gen.ts
CHANGED
|
@@ -3112,43 +3112,24 @@ export type MaterializeRequest = {
|
|
|
3112
3112
|
|
|
3113
3113
|
/**
|
|
3114
3114
|
* MaterializeResponse
|
|
3115
|
+
* Response for queued materialization operation.
|
|
3115
3116
|
*/
|
|
3116
3117
|
export type MaterializeResponse = {
|
|
3117
3118
|
/**
|
|
3118
3119
|
* Status
|
|
3119
|
-
*
|
|
3120
|
+
* Operation status
|
|
3120
3121
|
*/
|
|
3121
|
-
status
|
|
3122
|
+
status?: string;
|
|
3122
3123
|
/**
|
|
3123
3124
|
* Graph Id
|
|
3124
3125
|
* Graph database identifier
|
|
3125
3126
|
*/
|
|
3126
3127
|
graph_id: string;
|
|
3127
3128
|
/**
|
|
3128
|
-
*
|
|
3129
|
-
*
|
|
3130
|
-
*/
|
|
3131
|
-
was_stale: boolean;
|
|
3132
|
-
/**
|
|
3133
|
-
* Stale Reason
|
|
3134
|
-
* Reason graph was stale
|
|
3135
|
-
*/
|
|
3136
|
-
stale_reason?: string | null;
|
|
3137
|
-
/**
|
|
3138
|
-
* Tables Materialized
|
|
3139
|
-
* List of tables successfully materialized
|
|
3140
|
-
*/
|
|
3141
|
-
tables_materialized: Array<string>;
|
|
3142
|
-
/**
|
|
3143
|
-
* Total Rows
|
|
3144
|
-
* Total rows materialized across all tables
|
|
3145
|
-
*/
|
|
3146
|
-
total_rows: number;
|
|
3147
|
-
/**
|
|
3148
|
-
* Execution Time Ms
|
|
3149
|
-
* Total materialization time
|
|
3129
|
+
* Operation Id
|
|
3130
|
+
* SSE operation ID for progress tracking
|
|
3150
3131
|
*/
|
|
3151
|
-
|
|
3132
|
+
operation_id: string;
|
|
3152
3133
|
/**
|
|
3153
3134
|
* Message
|
|
3154
3135
|
* Human-readable status message
|