10xgraph-client 0.0.0-stage → 0.6.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/CHANGELOG.md +276 -0
- package/LICENSE +21 -0
- package/README.md +400 -2
- package/dist/agent.d.ts +22 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/client.d.ts +479 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/compat.d.ts +28 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/endpoints/addThreadMessages.d.ts +22 -0
- package/dist/endpoints/addThreadMessages.d.ts.map +1 -0
- package/dist/endpoints/clearThreadState.d.ts +15 -0
- package/dist/endpoints/clearThreadState.d.ts.map +1 -0
- package/dist/endpoints/deleteMemory.d.ts +19 -0
- package/dist/endpoints/deleteMemory.d.ts.map +1 -0
- package/dist/endpoints/deleteThread.d.ts +19 -0
- package/dist/endpoints/deleteThread.d.ts.map +1 -0
- package/dist/endpoints/deleteThreadMessage.d.ts +20 -0
- package/dist/endpoints/deleteThreadMessage.d.ts.map +1 -0
- package/dist/endpoints/files.d.ts +83 -0
- package/dist/endpoints/files.d.ts.map +1 -0
- package/dist/endpoints/fixGraph.d.ts +29 -0
- package/dist/endpoints/fixGraph.d.ts.map +1 -0
- package/dist/endpoints/forgetMemories.d.ts +22 -0
- package/dist/endpoints/forgetMemories.d.ts.map +1 -0
- package/dist/endpoints/getMemory.d.ts +19 -0
- package/dist/endpoints/getMemory.d.ts.map +1 -0
- package/dist/endpoints/graph.d.ts +39 -0
- package/dist/endpoints/graph.d.ts.map +1 -0
- package/dist/endpoints/graphTools.d.ts +32 -0
- package/dist/endpoints/graphTools.d.ts.map +1 -0
- package/dist/endpoints/invoke.d.ts +59 -0
- package/dist/endpoints/invoke.d.ts.map +1 -0
- package/dist/endpoints/listMemories.d.ts +19 -0
- package/dist/endpoints/listMemories.d.ts.map +1 -0
- package/dist/endpoints/metadata.d.ts +6 -0
- package/dist/endpoints/metadata.d.ts.map +1 -0
- package/dist/endpoints/observability.d.ts +58 -0
- package/dist/endpoints/observability.d.ts.map +1 -0
- package/dist/endpoints/ping.d.ts +10 -0
- package/dist/endpoints/ping.d.ts.map +1 -0
- package/dist/endpoints/realtime.d.ts +134 -0
- package/dist/endpoints/realtime.d.ts.map +1 -0
- package/dist/endpoints/searchMemory.d.ts +57 -0
- package/dist/endpoints/searchMemory.d.ts.map +1 -0
- package/dist/endpoints/stateSchema.d.ts +50 -0
- package/dist/endpoints/stateSchema.d.ts.map +1 -0
- package/dist/endpoints/stopGraph.d.ts +26 -0
- package/dist/endpoints/stopGraph.d.ts.map +1 -0
- package/dist/endpoints/storeMemory.d.ts +33 -0
- package/dist/endpoints/storeMemory.d.ts.map +1 -0
- package/dist/endpoints/stream.d.ts +60 -0
- package/dist/endpoints/stream.d.ts.map +1 -0
- package/dist/endpoints/threadDetails.d.ts +19 -0
- package/dist/endpoints/threadDetails.d.ts.map +1 -0
- package/dist/endpoints/threadMessage.d.ts +17 -0
- package/dist/endpoints/threadMessage.d.ts.map +1 -0
- package/dist/endpoints/threadMessages.d.ts +23 -0
- package/dist/endpoints/threadMessages.d.ts.map +1 -0
- package/dist/endpoints/threadState.d.ts +14 -0
- package/dist/endpoints/threadState.d.ts.map +1 -0
- package/dist/endpoints/threads.d.ts +30 -0
- package/dist/endpoints/threads.d.ts.map +1 -0
- package/dist/endpoints/updateMemory.d.ts +21 -0
- package/dist/endpoints/updateMemory.d.ts.map +1 -0
- package/dist/endpoints/updateThreadState.d.ts +18 -0
- package/dist/endpoints/updateThreadState.d.ts.map +1 -0
- package/dist/endpoints/wsStream.d.ts +33 -0
- package/dist/endpoints/wsStream.d.ts.map +1 -0
- package/dist/errors.d.ts +155 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2664 -0
- package/dist/index.js.map +1 -0
- package/dist/message.d.ts +174 -0
- package/dist/message.d.ts.map +1 -0
- package/dist/request.d.ts +33 -0
- package/dist/request.d.ts.map +1 -0
- package/dist/tools.d.ts +67 -0
- package/dist/tools.d.ts.map +1 -0
- package/dist/ws.d.ts +48 -0
- package/dist/ws.d.ts.map +1 -0
- package/package.json +99 -4
- package/src/agent.ts +43 -0
- package/src/client.ts +1044 -0
- package/src/compat.ts +35 -0
- package/src/endpoints/addThreadMessages.ts +83 -0
- package/src/endpoints/clearThreadState.ts +75 -0
- package/src/endpoints/deleteMemory.ts +91 -0
- package/src/endpoints/deleteThread.ts +78 -0
- package/src/endpoints/deleteThreadMessage.ts +83 -0
- package/src/endpoints/files.ts +274 -0
- package/src/endpoints/fixGraph.ts +91 -0
- package/src/endpoints/forgetMemories.ts +95 -0
- package/src/endpoints/getMemory.ts +82 -0
- package/src/endpoints/graph.ts +97 -0
- package/src/endpoints/graphTools.ts +90 -0
- package/src/endpoints/invoke.ts +318 -0
- package/src/endpoints/listMemories.ts +97 -0
- package/src/endpoints/metadata.ts +6 -0
- package/src/endpoints/observability.ts +107 -0
- package/src/endpoints/ping.ts +58 -0
- package/src/endpoints/realtime.ts +326 -0
- package/src/endpoints/searchMemory.ts +132 -0
- package/src/endpoints/stateSchema.ts +106 -0
- package/src/endpoints/stopGraph.ts +85 -0
- package/src/endpoints/storeMemory.ts +98 -0
- package/src/endpoints/stream.ts +440 -0
- package/src/endpoints/threadDetails.ts +78 -0
- package/src/endpoints/threadMessage.ts +76 -0
- package/src/endpoints/threadMessages.ts +97 -0
- package/src/endpoints/threadState.ts +74 -0
- package/src/endpoints/threads.ts +112 -0
- package/src/endpoints/updateMemory.ts +90 -0
- package/src/endpoints/updateThreadState.ts +82 -0
- package/src/endpoints/wsStream.ts +251 -0
- package/src/errors.ts +553 -0
- package/src/index.ts +108 -0
- package/src/message.ts +436 -0
- package/src/request.ts +168 -0
- package/src/tools.ts +225 -0
- package/src/ws.ts +100 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { RequestContext } from '../request.js';
|
|
3
|
+
export interface StateSchemaContext extends RequestContext {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* JSON Schema definition for a field in AgentState
|
|
7
|
+
* Contains type information, description, validation rules, and default values
|
|
8
|
+
*/
|
|
9
|
+
export interface FieldSchema {
|
|
10
|
+
type?: string | string[];
|
|
11
|
+
description?: string;
|
|
12
|
+
default?: any;
|
|
13
|
+
items?: any;
|
|
14
|
+
properties?: Record<string, FieldSchema>;
|
|
15
|
+
required?: string[];
|
|
16
|
+
enum?: any[];
|
|
17
|
+
$ref?: string;
|
|
18
|
+
$defs?: Record<string, any>;
|
|
19
|
+
anyOf?: any[];
|
|
20
|
+
allOf?: any[];
|
|
21
|
+
oneOf?: any[];
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Complete JSON Schema for AgentState
|
|
26
|
+
* Describes all available fields, their types, constraints, and meanings
|
|
27
|
+
*/
|
|
28
|
+
export interface AgentStateSchema {
|
|
29
|
+
title?: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
type?: string;
|
|
32
|
+
properties: Record<string, FieldSchema>;
|
|
33
|
+
required?: string[];
|
|
34
|
+
$defs?: Record<string, any>;
|
|
35
|
+
[key: string]: any;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Response containing the complete AgentState schema
|
|
39
|
+
* Users can use this to:
|
|
40
|
+
* - Understand field types and structure
|
|
41
|
+
* - Build dynamic forms or validation
|
|
42
|
+
* - Know what fields are available and required
|
|
43
|
+
* - See field descriptions and constraints
|
|
44
|
+
*/
|
|
45
|
+
export interface StateSchemaResponse {
|
|
46
|
+
data: AgentStateSchema;
|
|
47
|
+
metadata: ResponseMetadata;
|
|
48
|
+
}
|
|
49
|
+
export declare function stateSchema(context: StateSchemaContext): Promise<StateSchemaResponse>;
|
|
50
|
+
//# sourceMappingURL=state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,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAoD3F"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { RequestContext } from '../request.js';
|
|
3
|
+
export interface StopGraphContext extends RequestContext {
|
|
4
|
+
}
|
|
5
|
+
export interface StopGraphRequest {
|
|
6
|
+
thread_id: string;
|
|
7
|
+
config?: Record<string, any>;
|
|
8
|
+
}
|
|
9
|
+
export interface StopGraphResponse {
|
|
10
|
+
data: {
|
|
11
|
+
success: boolean;
|
|
12
|
+
message: string;
|
|
13
|
+
thread_id: string;
|
|
14
|
+
stopped_at?: string;
|
|
15
|
+
};
|
|
16
|
+
metadata: ResponseMetadata;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Stop a running graph execution for a specific thread
|
|
20
|
+
*
|
|
21
|
+
* @param context - Request context with baseUrl, auth, timeout
|
|
22
|
+
* @param request - Stop request with thread_id and optional config
|
|
23
|
+
* @returns Promise<StopGraphResponse> with stop operation result
|
|
24
|
+
*/
|
|
25
|
+
export declare function stopGraph(context: StopGraphContext, request: StopGraphRequest): Promise<StopGraphResponse>;
|
|
26
|
+
//# sourceMappingURL=stopGraph.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stopGraph.d.ts","sourceRoot":"","sources":["../../src/endpoints/stopGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,gBAAiB,SAAQ,cAAc;CAAG;AAE3D,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE;QACJ,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,wBAAsB,SAAS,CAC7B,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,iBAAiB,CAAC,CAqD5B"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { RequestContext } from '../request.js';
|
|
3
|
+
export interface StoreMemoryContext extends RequestContext {
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Types of memories that can be stored
|
|
7
|
+
*/
|
|
8
|
+
export declare enum MemoryType {
|
|
9
|
+
EPISODIC = "episodic",// Conversation memories
|
|
10
|
+
SEMANTIC = "semantic",// Facts and knowledge
|
|
11
|
+
PROCEDURAL = "procedural",// How-to knowledge
|
|
12
|
+
ENTITY = "entity",// Entity-based memories
|
|
13
|
+
RELATIONSHIP = "relationship",// Entity relationships
|
|
14
|
+
CUSTOM = "custom",// Custom memory types
|
|
15
|
+
DECLARATIVE = "declarative"
|
|
16
|
+
}
|
|
17
|
+
export interface StoreMemoryRequest {
|
|
18
|
+
config?: Record<string, any>;
|
|
19
|
+
options?: Record<string, any>;
|
|
20
|
+
content: string;
|
|
21
|
+
memory_type: MemoryType;
|
|
22
|
+
category: string;
|
|
23
|
+
metadata?: Record<string, any>;
|
|
24
|
+
}
|
|
25
|
+
export interface StoreMemoryData {
|
|
26
|
+
memory_id: string;
|
|
27
|
+
}
|
|
28
|
+
export interface StoreMemoryResponse {
|
|
29
|
+
data: StoreMemoryData;
|
|
30
|
+
metadata: ResponseMetadata;
|
|
31
|
+
}
|
|
32
|
+
export declare function storeMemory(context: StoreMemoryContext, request: StoreMemoryRequest): Promise<StoreMemoryResponse>;
|
|
33
|
+
//# sourceMappingURL=storeMemory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storeMemory.d.ts","sourceRoot":"","sources":["../../src/endpoints/storeMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,kBAAmB,SAAQ,cAAc;CAAG;AAE7D;;GAEG;AACH,oBAAY,UAAU;IACpB,QAAQ,aAAa,CAAE,wBAAwB;IAC/C,QAAQ,aAAa,CAAE,sBAAsB;IAC7C,UAAU,eAAe,CAAE,mBAAmB;IAC9C,MAAM,WAAW,CAAE,wBAAwB;IAC3C,YAAY,iBAAiB,CAAE,uBAAuB;IACtD,MAAM,WAAW,CAAE,sBAAsB;IACzC,WAAW,gBAAgB;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,UAAU,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,OAAO,EAAE,kBAAkB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CAyD9B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { Message } from '../message.js';
|
|
2
|
+
import { AgentState } from '../agent.js';
|
|
3
|
+
import { ToolExecutor } from '../tools.js';
|
|
4
|
+
import { RequestContext } from '../request.js';
|
|
5
|
+
export interface StreamContext extends RequestContext {
|
|
6
|
+
toolExecutor?: ToolExecutor;
|
|
7
|
+
}
|
|
8
|
+
export interface StreamRequest {
|
|
9
|
+
messages: any[];
|
|
10
|
+
initial_state?: Record<string, any>;
|
|
11
|
+
config?: Record<string, any>;
|
|
12
|
+
recursion_limit?: number;
|
|
13
|
+
response_granularity?: 'full' | 'partial' | 'low';
|
|
14
|
+
}
|
|
15
|
+
export declare enum StreamEventType {
|
|
16
|
+
MESSAGE = "message",
|
|
17
|
+
UPDATES = "updates",
|
|
18
|
+
STATE = "state",
|
|
19
|
+
ERROR = "error"
|
|
20
|
+
}
|
|
21
|
+
export interface StreamMetadata {
|
|
22
|
+
is_new_thread: boolean;
|
|
23
|
+
thread_id: string;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
26
|
+
export interface StreamChunk {
|
|
27
|
+
event: StreamEventType | string;
|
|
28
|
+
message?: Message | null;
|
|
29
|
+
state?: AgentState | null;
|
|
30
|
+
data?: any;
|
|
31
|
+
thread_id?: string;
|
|
32
|
+
run_id?: string;
|
|
33
|
+
metadata?: StreamMetadata | Record<string, any>;
|
|
34
|
+
timestamp?: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Stream invoke to the graph with automatic tool execution loop
|
|
38
|
+
* Returns an async iterable that yields stream chunks as they arrive
|
|
39
|
+
*
|
|
40
|
+
* This implements the same tool execution loop as invoke(), but uses
|
|
41
|
+
* HTTP streaming instead of REST API calls.
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const stream = streamInvoke(context, request);
|
|
46
|
+
* for await (const chunk of stream) {
|
|
47
|
+
* if (chunk.event === 'message') {
|
|
48
|
+
* console.log('Message:', chunk.message);
|
|
49
|
+
* } else if (chunk.event === 'updates') {
|
|
50
|
+
* console.log('State:', chunk.state);
|
|
51
|
+
* }
|
|
52
|
+
* }
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function streamInvoke(context: StreamContext, request: StreamRequest): AsyncGenerator<StreamChunk, void, unknown>;
|
|
56
|
+
/**
|
|
57
|
+
* Serialize a Message object for API transmission
|
|
58
|
+
*/
|
|
59
|
+
export declare function serializeMessage(message: Message): any;
|
|
60
|
+
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["../../src/endpoints/stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,aAAc,SAAQ,cAAc;IACnD,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAGD,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,CAAC;CACnD;AAGD,oBAAY,eAAe;IACzB,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,KAAK,UAAU;CAChB;AAGD,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAGD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,eAAe,GAAG,MAAM,CAAC;IAChC,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,UAAU,GAAG,IAAI,CAAC;IAC1B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAqLD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAuB,YAAY,CACjC,OAAO,EAAE,aAAa,EACtB,OAAO,EAAE,aAAa,GACrB,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,CA4I5C;AA2BD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,GAAG,CAsBtD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { RequestContext } from '../request.js';
|
|
3
|
+
export interface ThreadDetailsContext extends RequestContext {
|
|
4
|
+
}
|
|
5
|
+
export interface ThreadDetailsData {
|
|
6
|
+
thread_data: {
|
|
7
|
+
thread: Record<string, any>;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
export interface ThreadDetailsResponse {
|
|
11
|
+
data: ThreadDetailsData;
|
|
12
|
+
metadata: ResponseMetadata;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Fetch details for a specific thread.
|
|
16
|
+
* GET /v1/threads/{threadId}
|
|
17
|
+
*/
|
|
18
|
+
export declare function threadDetails(context: ThreadDetailsContext, threadId: string | number): Promise<ThreadDetailsResponse>;
|
|
19
|
+
//# sourceMappingURL=threadDetails.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadDetails.d.ts","sourceRoot":"","sources":["../../src/endpoints/threadDetails.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,oBAAqB,SAAQ,cAAc;CAAG;AAE/D,MAAM,WAAW,iBAAiB;IAChC,WAAW,EAAE;QACX,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC7B,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,QAAQ,EAAE,MAAM,GAAG,MAAM,GACxB,OAAO,CAAC,qBAAqB,CAAC,CAqDhC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { Message } from '../message.js';
|
|
3
|
+
import { RequestContext } from '../request.js';
|
|
4
|
+
export interface ThreadMessageContext extends RequestContext {
|
|
5
|
+
}
|
|
6
|
+
export interface ThreadMessageRequest {
|
|
7
|
+
threadId: string | number;
|
|
8
|
+
messageId: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ThreadMessageData extends Message {
|
|
11
|
+
}
|
|
12
|
+
export interface ThreadMessageResponse {
|
|
13
|
+
data: ThreadMessageData;
|
|
14
|
+
metadata: ResponseMetadata;
|
|
15
|
+
}
|
|
16
|
+
export declare function threadMessage(context: ThreadMessageContext, request: ThreadMessageRequest): Promise<ThreadMessageResponse>;
|
|
17
|
+
//# sourceMappingURL=threadMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadMessage.d.ts","sourceRoot":"","sources":["../../src/endpoints/threadMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,oBAAqB,SAAQ,cAAc;CAAG;AAE/D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,OAAO;CAGjD;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAkDhC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { Message } from '../message.js';
|
|
3
|
+
import { RequestContext } from '../request.js';
|
|
4
|
+
export interface ThreadMessagesContext extends RequestContext {
|
|
5
|
+
}
|
|
6
|
+
export interface ThreadMessagesRequest {
|
|
7
|
+
threadId: string | number;
|
|
8
|
+
search?: string;
|
|
9
|
+
offset?: number;
|
|
10
|
+
limit?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface ThreadMessagesData {
|
|
13
|
+
messages: Message[];
|
|
14
|
+
}
|
|
15
|
+
export type CheckpointMessagesData = ThreadMessagesData;
|
|
16
|
+
export interface ThreadMessagesResponse {
|
|
17
|
+
data: ThreadMessagesData;
|
|
18
|
+
metadata: ResponseMetadata;
|
|
19
|
+
}
|
|
20
|
+
export type CheckpointMessagesResponse = ThreadMessagesResponse;
|
|
21
|
+
export declare function threadMessages(context: ThreadMessagesContext, request: ThreadMessagesRequest): Promise<ThreadMessagesResponse>;
|
|
22
|
+
export declare const checkpointMessages: typeof threadMessages;
|
|
23
|
+
//# sourceMappingURL=threadMessages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadMessages.d.ts","sourceRoot":"","sources":["../../src/endpoints/threadMessages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,qBAAsB,SAAQ,cAAc;CAAG;AAEhE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,OAAO,EAAE,CAAC;CACrB;AAGD,MAAM,MAAM,sBAAsB,GAAG,kBAAkB,CAAC;AAExD,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAGD,MAAM,MAAM,0BAA0B,GAAG,sBAAsB,CAAC;AAEhE,wBAAsB,cAAc,CAClC,OAAO,EAAE,qBAAqB,EAC9B,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CA6DjC;AAGD,eAAO,MAAM,kBAAkB,uBAAiB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { AgentState } from '../agent.js';
|
|
3
|
+
import { RequestContext } from '../request.js';
|
|
4
|
+
export interface ThreadStateContext extends RequestContext {
|
|
5
|
+
}
|
|
6
|
+
export interface ThreadStateData {
|
|
7
|
+
state: AgentState;
|
|
8
|
+
}
|
|
9
|
+
export interface ThreadStateResponse {
|
|
10
|
+
data: ThreadStateData;
|
|
11
|
+
metadata: ResponseMetadata;
|
|
12
|
+
}
|
|
13
|
+
export declare function threadState(context: ThreadStateContext, threadId: string | number): Promise<ThreadStateResponse>;
|
|
14
|
+
//# sourceMappingURL=threadState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threadState.d.ts","sourceRoot":"","sources":["../../src/endpoints/threadState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,kBAAmB,SAAQ,cAAc;CAAG;AAE7D,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,eAAe,CAAC;IACtB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,kBAAkB,EAC3B,QAAQ,EAAE,MAAM,GAAG,MAAM,GACxB,OAAO,CAAC,mBAAmB,CAAC,CAsD9B"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { RequestContext } from '../request.js';
|
|
3
|
+
export interface ThreadsContext extends RequestContext {
|
|
4
|
+
}
|
|
5
|
+
export interface ThreadsRequest {
|
|
6
|
+
search?: string;
|
|
7
|
+
offset?: number;
|
|
8
|
+
limit?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ThreadItem {
|
|
11
|
+
thread_id: string;
|
|
12
|
+
thread_name: string | null;
|
|
13
|
+
user_id: string | null;
|
|
14
|
+
metadata: Record<string, any> | null;
|
|
15
|
+
updated_at: string | null;
|
|
16
|
+
run_id: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface ThreadsData {
|
|
19
|
+
threads: ThreadItem[];
|
|
20
|
+
}
|
|
21
|
+
export interface ThreadsResponse {
|
|
22
|
+
data: ThreadsData;
|
|
23
|
+
metadata: ResponseMetadata;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Fetch list of threads with optional search and pagination
|
|
27
|
+
* GET /v1/threads
|
|
28
|
+
*/
|
|
29
|
+
export declare function threads(context: ThreadsContext, request?: ThreadsRequest): Promise<ThreadsResponse>;
|
|
30
|
+
//# sourceMappingURL=threads.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"threads.d.ts","sourceRoot":"","sources":["../../src/endpoints/threads.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,cAAe,SAAQ,cAAc;CAAG;AAEzD,MAAM,WAAW,cAAc;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACrC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;GAGG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,eAAe,CAAC,CA0E1B"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { RequestContext } from '../request.js';
|
|
3
|
+
export interface UpdateMemoryContext extends RequestContext {
|
|
4
|
+
}
|
|
5
|
+
export interface UpdateMemoryRequest {
|
|
6
|
+
memoryId: string;
|
|
7
|
+
config?: Record<string, any>;
|
|
8
|
+
options?: Record<string, any>;
|
|
9
|
+
content: string;
|
|
10
|
+
metadata?: Record<string, any>;
|
|
11
|
+
}
|
|
12
|
+
export interface UpdateMemoryData {
|
|
13
|
+
success: boolean;
|
|
14
|
+
data: Record<string, any>;
|
|
15
|
+
}
|
|
16
|
+
export interface UpdateMemoryResponse {
|
|
17
|
+
data: UpdateMemoryData;
|
|
18
|
+
metadata: ResponseMetadata;
|
|
19
|
+
}
|
|
20
|
+
export declare function updateMemory(context: UpdateMemoryContext, request: UpdateMemoryRequest): Promise<UpdateMemoryResponse>;
|
|
21
|
+
//# sourceMappingURL=updateMemory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateMemory.d.ts","sourceRoot":"","sources":["../../src/endpoints/updateMemory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,mBAAoB,SAAQ,cAAc;CAAG;AAE9D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAC;IACvB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CA8D/B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ResponseMetadata } from './metadata.js';
|
|
2
|
+
import { AgentState } from '../agent.js';
|
|
3
|
+
import { RequestContext } from '../request.js';
|
|
4
|
+
export interface UpdateThreadStateContext extends RequestContext {
|
|
5
|
+
}
|
|
6
|
+
export interface UpdateThreadStateRequest {
|
|
7
|
+
config: Record<string, any>;
|
|
8
|
+
state: AgentState;
|
|
9
|
+
}
|
|
10
|
+
export interface UpdateThreadStateData {
|
|
11
|
+
state: AgentState;
|
|
12
|
+
}
|
|
13
|
+
export interface UpdateThreadStateResponse {
|
|
14
|
+
data: UpdateThreadStateData;
|
|
15
|
+
metadata: ResponseMetadata;
|
|
16
|
+
}
|
|
17
|
+
export declare function updateThreadState(context: UpdateThreadStateContext, threadId: string | number, request: UpdateThreadStateRequest): Promise<UpdateThreadStateResponse>;
|
|
18
|
+
//# sourceMappingURL=updateThreadState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updateThreadState.d.ts","sourceRoot":"","sources":["../../src/endpoints/updateThreadState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAuC,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpF,MAAM,WAAW,wBAAyB,SAAQ,cAAc;CAAG;AAEnE,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,wBAAwB,EACjC,QAAQ,EAAE,MAAM,GAAG,MAAM,EACzB,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,yBAAyB,CAAC,CAwDpC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ToolExecutor } from '../tools.js';
|
|
2
|
+
import { RequestContext } from '../request.js';
|
|
3
|
+
import { StreamChunk, StreamRequest } from './stream.js';
|
|
4
|
+
export interface WsStreamContext extends RequestContext {
|
|
5
|
+
toolExecutor?: ToolExecutor;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Stream invoke via a persistent WebSocket connection.
|
|
9
|
+
*
|
|
10
|
+
* The protocol is:
|
|
11
|
+
*
|
|
12
|
+
* 1. Connect to ``/v1/graph/ws`` (auth via the ``10xgraph-bearer`` subprotocol or Authorization header).
|
|
13
|
+
* 2. Send ``{ invoke_type:"fresh", messages:[…], config:{…}, … }``.
|
|
14
|
+
* 3. Receive ``StreamChunk`` JSON messages; yield each to the caller.
|
|
15
|
+
* 4. Server sends ``{ event:"updates", data:{ status:"done" } }`` after each run.
|
|
16
|
+
* 5. If the run contained remote tool calls, execute them and send:
|
|
17
|
+
* ``{ invoke_type:"resume", tool_result:[…], config:{ thread_id } }``.
|
|
18
|
+
* 6. Repeat from step 3 until no more tool calls.
|
|
19
|
+
* 7. Close the WebSocket.
|
|
20
|
+
*
|
|
21
|
+
* This replaces the HTTP loop in ``streamInvoke`` — the round-trip cost of
|
|
22
|
+
* re-opening a new HTTP connection for each tool call is eliminated.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const stream = wsStreamInvoke(context, request);
|
|
27
|
+
* for await (const chunk of stream) {
|
|
28
|
+
* if (chunk.event === 'message') console.log(chunk.message);
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare function wsStreamInvoke(context: WsStreamContext, request: StreamRequest): AsyncGenerator<StreamChunk, void, unknown>;
|
|
33
|
+
//# sourceMappingURL=wsStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wsStream.d.ts","sourceRoot":"","sources":["../../src/endpoints/wsStream.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAmB,aAAa,EAAoB,MAAM,aAAa,CAAC;AAM5F,MAAM,WAAW,eAAgB,SAAQ,cAAc;IACrD,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AA+BD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAuB,cAAc,CACnC,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,aAAa,GACrB,cAAc,CAAC,WAAW,EAAE,IAAI,EAAE,OAAO,CAAC,CAmL5C"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error handling for 10xGraph API
|
|
3
|
+
* Provides structured error types for all HTTP status codes
|
|
4
|
+
*/
|
|
5
|
+
export interface ErrorDetail {
|
|
6
|
+
loc?: string[];
|
|
7
|
+
msg?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface ApiErrorResponse {
|
|
11
|
+
metadata: {
|
|
12
|
+
message: string;
|
|
13
|
+
request_id: string;
|
|
14
|
+
timestamp: string;
|
|
15
|
+
};
|
|
16
|
+
error: {
|
|
17
|
+
code: string;
|
|
18
|
+
message: string;
|
|
19
|
+
details: ErrorDetail[];
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Base error class for all 10xGraph API errors
|
|
24
|
+
*/
|
|
25
|
+
export declare class TenxGraphError extends Error {
|
|
26
|
+
readonly statusCode: number;
|
|
27
|
+
readonly errorCode: string;
|
|
28
|
+
readonly requestId: string;
|
|
29
|
+
readonly timestamp: string;
|
|
30
|
+
readonly details: ErrorDetail[];
|
|
31
|
+
readonly context?: Record<string, any>;
|
|
32
|
+
readonly endpoint?: string;
|
|
33
|
+
readonly method?: string;
|
|
34
|
+
readonly recoverySuggestion?: string;
|
|
35
|
+
constructor(message: string, statusCode: number, errorCode: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>, endpoint?: string, method?: string, recoverySuggestion?: string);
|
|
36
|
+
/**
|
|
37
|
+
* Get a user-friendly error message with recovery suggestion
|
|
38
|
+
*/
|
|
39
|
+
getUserMessage(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Get full error details for debugging
|
|
42
|
+
*/
|
|
43
|
+
toJSON(): Record<string, any>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* 400 Bad Request Error
|
|
47
|
+
* Thrown when the request is malformed or contains invalid data
|
|
48
|
+
*/
|
|
49
|
+
export declare class BadRequestError extends TenxGraphError {
|
|
50
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[]);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 401 Unauthorized Error
|
|
54
|
+
* Thrown when authentication credentials are missing or invalid
|
|
55
|
+
*/
|
|
56
|
+
export declare class AuthenticationError extends TenxGraphError {
|
|
57
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[]);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 403 Forbidden Error
|
|
61
|
+
* Thrown when the user doesn't have permission to access the resource
|
|
62
|
+
*/
|
|
63
|
+
export declare class PermissionError extends TenxGraphError {
|
|
64
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[]);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 404 Not Found Error
|
|
68
|
+
* Thrown when the requested resource doesn't exist
|
|
69
|
+
*/
|
|
70
|
+
export declare class NotFoundError extends TenxGraphError {
|
|
71
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[]);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* 422 Validation Error
|
|
75
|
+
* Thrown when the request data fails validation
|
|
76
|
+
*/
|
|
77
|
+
export declare class ValidationError extends TenxGraphError {
|
|
78
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[]);
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* 500 Server Error
|
|
82
|
+
* Thrown when the server encounters an internal error
|
|
83
|
+
*/
|
|
84
|
+
export declare class ServerError extends TenxGraphError {
|
|
85
|
+
constructor(message: string, requestId: string, timestamp: string, errorCode?: string, details?: ErrorDetail[], statusCode?: number);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Graph Error
|
|
89
|
+
* Thrown when there's an error in graph execution
|
|
90
|
+
*/
|
|
91
|
+
export declare class GraphError extends TenxGraphError {
|
|
92
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>);
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Node Error
|
|
96
|
+
* Thrown when there's an error executing a specific node
|
|
97
|
+
*/
|
|
98
|
+
export declare class NodeError extends TenxGraphError {
|
|
99
|
+
readonly nodeName?: string;
|
|
100
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>, nodeName?: string);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Graph Recursion Error
|
|
104
|
+
* Thrown when graph execution exceeds the recursion limit
|
|
105
|
+
*/
|
|
106
|
+
export declare class GraphRecursionError extends TenxGraphError {
|
|
107
|
+
readonly recursionLimit?: number;
|
|
108
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>, recursionLimit?: number);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Storage Error
|
|
112
|
+
* Thrown when there's an error accessing storage
|
|
113
|
+
*/
|
|
114
|
+
export declare class StorageError extends TenxGraphError {
|
|
115
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>);
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Transient Storage Error
|
|
119
|
+
* Thrown when there's a temporary storage issue (503 Service Unavailable)
|
|
120
|
+
*/
|
|
121
|
+
export declare class TransientStorageError extends TenxGraphError {
|
|
122
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>);
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Metrics Error
|
|
126
|
+
* Thrown when there's an error collecting or reporting metrics
|
|
127
|
+
*/
|
|
128
|
+
export declare class MetricsError extends TenxGraphError {
|
|
129
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Schema Version Error
|
|
133
|
+
* Thrown when there's a version mismatch in data schemas
|
|
134
|
+
*/
|
|
135
|
+
export declare class SchemaVersionError extends TenxGraphError {
|
|
136
|
+
readonly expectedVersion?: string;
|
|
137
|
+
readonly actualVersion?: string;
|
|
138
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>, expectedVersion?: string, actualVersion?: string);
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Serialization Error
|
|
142
|
+
* Thrown when there's an error serializing or deserializing data
|
|
143
|
+
*/
|
|
144
|
+
export declare class SerializationError extends TenxGraphError {
|
|
145
|
+
constructor(message: string, requestId: string, timestamp: string, details?: ErrorDetail[], context?: Record<string, any>);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Parse error response from API
|
|
149
|
+
*/
|
|
150
|
+
export declare function parseErrorResponse(response: Response): Promise<ApiErrorResponse | null>;
|
|
151
|
+
/**
|
|
152
|
+
* Create appropriate error instance based on HTTP status code and error code
|
|
153
|
+
*/
|
|
154
|
+
export declare function createErrorFromResponse(response: Response, fallbackMessage?: string, endpoint?: string, method?: string): Promise<TenxGraphError>;
|
|
155
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,MAAM,WAAW,WAAW;IAC1B,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,WAAW,EAAE,CAAC;KACxB,CAAC;CACH;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,SAAgB,UAAU,EAAE,MAAM,CAAC;IACnC,SAAgB,SAAS,EAAE,MAAM,CAAC;IAClC,SAAgB,SAAS,EAAE,MAAM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