@chanl-ai/sdk 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/adapters/openai.d.ts +106 -0
- package/dist/adapters/openai.d.ts.map +1 -0
- package/dist/adapters/openai.js +185 -0
- package/dist/adapters/openai.js.map +1 -0
- package/dist/client.d.ts +74 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +293 -0
- package/dist/client.js.map +1 -0
- package/dist/errors/index.d.ts +179 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +319 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +38 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +76 -0
- package/dist/index.js.map +1 -0
- package/dist/live/index.d.ts +9 -0
- package/dist/live/index.d.ts.map +1 -0
- package/dist/live/index.js +16 -0
- package/dist/live/index.js.map +1 -0
- package/dist/live/live-call.d.ts +48 -0
- package/dist/live/live-call.d.ts.map +1 -0
- package/dist/live/live-call.js +148 -0
- package/dist/live/live-call.js.map +1 -0
- package/dist/live/live-chat.d.ts +71 -0
- package/dist/live/live-chat.d.ts.map +1 -0
- package/dist/live/live-chat.js +95 -0
- package/dist/live/live-chat.js.map +1 -0
- package/dist/live/live-execution.d.ts +55 -0
- package/dist/live/live-execution.d.ts.map +1 -0
- package/dist/live/live-execution.js +170 -0
- package/dist/live/live-execution.js.map +1 -0
- package/dist/live/typed-emitter.d.ts +15 -0
- package/dist/live/typed-emitter.d.ts.map +1 -0
- package/dist/live/typed-emitter.js +40 -0
- package/dist/live/typed-emitter.js.map +1 -0
- package/dist/live/types.d.ts +24 -0
- package/dist/live/types.d.ts.map +1 -0
- package/dist/live/types.js +6 -0
- package/dist/live/types.js.map +1 -0
- package/dist/modules/agents.d.ts +378 -0
- package/dist/modules/agents.d.ts.map +1 -0
- package/dist/modules/agents.js +259 -0
- package/dist/modules/agents.js.map +1 -0
- package/dist/modules/alerts.d.ts +43 -0
- package/dist/modules/alerts.d.ts.map +1 -0
- package/dist/modules/alerts.js +56 -0
- package/dist/modules/alerts.js.map +1 -0
- package/dist/modules/audio.d.ts +47 -0
- package/dist/modules/audio.d.ts.map +1 -0
- package/dist/modules/audio.js +75 -0
- package/dist/modules/audio.js.map +1 -0
- package/dist/modules/auth.d.ts +76 -0
- package/dist/modules/auth.d.ts.map +1 -0
- package/dist/modules/auth.js +59 -0
- package/dist/modules/auth.js.map +1 -0
- package/dist/modules/calls.d.ts +825 -0
- package/dist/modules/calls.d.ts.map +1 -0
- package/dist/modules/calls.js +398 -0
- package/dist/modules/calls.js.map +1 -0
- package/dist/modules/chat.d.ts +165 -0
- package/dist/modules/chat.d.ts.map +1 -0
- package/dist/modules/chat.js +169 -0
- package/dist/modules/chat.js.map +1 -0
- package/dist/modules/health.d.ts +45 -0
- package/dist/modules/health.d.ts.map +1 -0
- package/dist/modules/health.js +22 -0
- package/dist/modules/health.js.map +1 -0
- package/dist/modules/knowledge.d.ts +202 -0
- package/dist/modules/knowledge.d.ts.map +1 -0
- package/dist/modules/knowledge.js +147 -0
- package/dist/modules/knowledge.js.map +1 -0
- package/dist/modules/mcp.d.ts +140 -0
- package/dist/modules/mcp.d.ts.map +1 -0
- package/dist/modules/mcp.js +110 -0
- package/dist/modules/mcp.js.map +1 -0
- package/dist/modules/memory.d.ts +163 -0
- package/dist/modules/memory.d.ts.map +1 -0
- package/dist/modules/memory.js +208 -0
- package/dist/modules/memory.js.map +1 -0
- package/dist/modules/personas.d.ts +168 -0
- package/dist/modules/personas.d.ts.map +1 -0
- package/dist/modules/personas.js +106 -0
- package/dist/modules/personas.js.map +1 -0
- package/dist/modules/prompts.d.ts +128 -0
- package/dist/modules/prompts.d.ts.map +1 -0
- package/dist/modules/prompts.js +93 -0
- package/dist/modules/prompts.js.map +1 -0
- package/dist/modules/scenarios.d.ts +294 -0
- package/dist/modules/scenarios.d.ts.map +1 -0
- package/dist/modules/scenarios.js +349 -0
- package/dist/modules/scenarios.js.map +1 -0
- package/dist/modules/scorecard.d.ts +642 -0
- package/dist/modules/scorecard.d.ts.map +1 -0
- package/dist/modules/scorecard.js +327 -0
- package/dist/modules/scorecard.js.map +1 -0
- package/dist/modules/tools.d.ts +222 -0
- package/dist/modules/tools.d.ts.map +1 -0
- package/dist/modules/tools.js +302 -0
- package/dist/modules/tools.js.map +1 -0
- package/dist/modules/toolsets.d.ts +173 -0
- package/dist/modules/toolsets.d.ts.map +1 -0
- package/dist/modules/toolsets.js +216 -0
- package/dist/modules/toolsets.js.map +1 -0
- package/dist/modules/transcript.d.ts +60 -0
- package/dist/modules/transcript.d.ts.map +1 -0
- package/dist/modules/transcript.js +69 -0
- package/dist/modules/transcript.js.map +1 -0
- package/dist/modules/workspace.d.ts +48 -0
- package/dist/modules/workspace.d.ts.map +1 -0
- package/dist/modules/workspace.js +49 -0
- package/dist/modules/workspace.js.map +1 -0
- package/dist/types/api.d.ts +8 -0
- package/dist/types/api.d.ts.map +1 -0
- package/dist/types/api.js +25 -0
- package/dist/types/api.js.map +1 -0
- package/dist/types/config.d.ts +70 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +3 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/memory.d.ts +243 -0
- package/dist/types/memory.d.ts.map +1 -0
- package/dist/types/memory.js +9 -0
- package/dist/types/memory.js.map +1 -0
- package/dist/types/tool-calls.d.ts +61 -0
- package/dist/types/tool-calls.d.ts.map +1 -0
- package/dist/types/tool-calls.js +9 -0
- package/dist/types/tool-calls.js.map +1 -0
- package/dist/types/tools.d.ts +321 -0
- package/dist/types/tools.d.ts.map +1 -0
- package/dist/types/tools.js +9 -0
- package/dist/types/tools.js.map +1 -0
- package/dist/types/toolsets.d.ts +149 -0
- package/dist/types/toolsets.d.ts.map +1 -0
- package/dist/types/toolsets.js +8 -0
- package/dist/types/toolsets.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Call Types for @chanl-ai/sdk
|
|
3
|
+
*
|
|
4
|
+
* Normalized tool call data returned by Chat, Scenarios, and Calls APIs.
|
|
5
|
+
* Mirrors the backend NormalizedToolCallDto from agent-service.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Tool call execution status
|
|
9
|
+
*/
|
|
10
|
+
export type ToolCallStatus = 'success' | 'error' | 'pending' | 'timeout';
|
|
11
|
+
/**
|
|
12
|
+
* Structured error from a tool execution
|
|
13
|
+
*/
|
|
14
|
+
export interface ToolCallError {
|
|
15
|
+
/** Error code (e.g., 'TIMEOUT', 'NETWORK_ERROR') */
|
|
16
|
+
code?: string;
|
|
17
|
+
/** Human-readable error message */
|
|
18
|
+
message: string;
|
|
19
|
+
/** Additional error details (provider-specific) */
|
|
20
|
+
details?: unknown;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Normalized tool call record
|
|
24
|
+
*
|
|
25
|
+
* Consistent format returned by Chat, Scenarios, and Call transcript APIs.
|
|
26
|
+
* Contains the tool name, input parameters, execution result, timing, and status.
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const response = await sdk.chat.sendMessage(wsId, sessionId, 'What is the weather?');
|
|
31
|
+
* for (const tc of response.data.toolCalls ?? []) {
|
|
32
|
+
* console.log(`${tc.name}(${JSON.stringify(tc.parameters)}) → ${tc.status}`);
|
|
33
|
+
* if (tc.durationMs) console.log(` took ${tc.durationMs}ms`);
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export interface ToolCall {
|
|
38
|
+
/** Unique identifier for this tool call */
|
|
39
|
+
id: string;
|
|
40
|
+
/** Tool name (e.g., 'get_weather', 'kb_search') */
|
|
41
|
+
name: string;
|
|
42
|
+
/** Tool description (from tool definition) */
|
|
43
|
+
description?: string;
|
|
44
|
+
/** Input parameters passed to the tool */
|
|
45
|
+
parameters: Record<string, unknown>;
|
|
46
|
+
/** Tool execution result */
|
|
47
|
+
result?: unknown;
|
|
48
|
+
/** Execution status */
|
|
49
|
+
status: ToolCallStatus;
|
|
50
|
+
/** Execution duration in milliseconds */
|
|
51
|
+
durationMs?: number;
|
|
52
|
+
/** When the tool execution started (ISO timestamp) */
|
|
53
|
+
startedAt: string;
|
|
54
|
+
/** When the tool execution completed (ISO timestamp) */
|
|
55
|
+
completedAt?: string;
|
|
56
|
+
/** Seconds from call/session start (for timeline positioning) */
|
|
57
|
+
secondsFromStart?: number;
|
|
58
|
+
/** Structured error information (when status is 'error') */
|
|
59
|
+
error?: ToolCallError;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=tool-calls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-calls.d.ts","sourceRoot":"","sources":["../../src/types/tool-calls.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzE;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,oDAAoD;IACpD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,mDAAmD;IACnD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0CAA0C;IAC1C,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,4BAA4B;IAC5B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,uBAAuB;IACvB,MAAM,EAAE,cAAc,CAAC;IACvB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tool Call Types for @chanl-ai/sdk
|
|
4
|
+
*
|
|
5
|
+
* Normalized tool call data returned by Chat, Scenarios, and Calls APIs.
|
|
6
|
+
* Mirrors the backend NormalizedToolCallDto from agent-service.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=tool-calls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool-calls.js","sourceRoot":"","sources":["../../src/types/tool-calls.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Types for @chanl-ai/sdk
|
|
3
|
+
*
|
|
4
|
+
* TDD Phase: RED - These types define the contract for ToolsModule
|
|
5
|
+
* Based on chanl-api/src/tools/ schemas and DTOs
|
|
6
|
+
*/
|
|
7
|
+
export type ToolType = 'http' | 'javascript' | 'code';
|
|
8
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
9
|
+
export type ExecutionStatus = 'pending' | 'running' | 'completed' | 'failed' | 'corrected';
|
|
10
|
+
export type ExecutionSource = 'mcp' | 'api' | 'playground' | 'scheduled' | 'workflow';
|
|
11
|
+
/**
|
|
12
|
+
* HTTP tool configuration for external API calls
|
|
13
|
+
*/
|
|
14
|
+
export interface HttpToolConfig {
|
|
15
|
+
/** HTTP method for the request */
|
|
16
|
+
method: HttpMethod;
|
|
17
|
+
/** URL template with {{variable}} placeholders */
|
|
18
|
+
url: string;
|
|
19
|
+
/** HTTP headers for the request */
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
/** JSON body template with {{variable}} placeholders */
|
|
22
|
+
bodyTemplate?: string;
|
|
23
|
+
/** Request timeout in milliseconds (default: 30000) */
|
|
24
|
+
timeout?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* JavaScript tool configuration for sandboxed code execution
|
|
28
|
+
*/
|
|
29
|
+
export interface JavaScriptToolConfig {
|
|
30
|
+
/** JavaScript code to execute (sandboxed) */
|
|
31
|
+
code: string;
|
|
32
|
+
/** Allowed modules for execution */
|
|
33
|
+
allowedModules?: string[];
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Code execution configuration for Python/JavaScript workers
|
|
37
|
+
*/
|
|
38
|
+
export interface CodeToolConfig {
|
|
39
|
+
/** Programming language */
|
|
40
|
+
language: 'python' | 'javascript';
|
|
41
|
+
/** Entry point function name */
|
|
42
|
+
entryPoint: string;
|
|
43
|
+
/** Cloudflare Worker name for execution */
|
|
44
|
+
workerName?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Tool configuration - contains type-specific settings
|
|
48
|
+
*/
|
|
49
|
+
export interface ToolConfiguration {
|
|
50
|
+
http?: HttpToolConfig;
|
|
51
|
+
javascript?: JavaScriptToolConfig;
|
|
52
|
+
code?: CodeToolConfig;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Tool execution statistics
|
|
56
|
+
*/
|
|
57
|
+
export interface ToolStats {
|
|
58
|
+
totalCalls: number;
|
|
59
|
+
successfulCalls: number;
|
|
60
|
+
failedCalls: number;
|
|
61
|
+
averageLatencyMs: number;
|
|
62
|
+
lastCalledAt?: string;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Tool entity representing an MCP-compatible tool
|
|
66
|
+
*/
|
|
67
|
+
export interface Tool {
|
|
68
|
+
/** Tool ID */
|
|
69
|
+
id: string;
|
|
70
|
+
/** Workspace ID this tool belongs to */
|
|
71
|
+
workspaceId: string;
|
|
72
|
+
/** Unique name for the tool (MCP tool name) */
|
|
73
|
+
name: string;
|
|
74
|
+
/** Description of what the tool does */
|
|
75
|
+
description: string;
|
|
76
|
+
/** Type of tool execution */
|
|
77
|
+
type: ToolType;
|
|
78
|
+
/** JSON Schema defining the tool input parameters */
|
|
79
|
+
inputSchema: Record<string, unknown>;
|
|
80
|
+
/** Tool configuration based on type */
|
|
81
|
+
configuration: ToolConfiguration;
|
|
82
|
+
/** Whether the tool is enabled */
|
|
83
|
+
isEnabled: boolean;
|
|
84
|
+
/** Tags for categorizing tools */
|
|
85
|
+
tags: string[];
|
|
86
|
+
/** User ID who created the tool */
|
|
87
|
+
createdBy: string;
|
|
88
|
+
/** User ID who last modified the tool */
|
|
89
|
+
lastModifiedBy?: string;
|
|
90
|
+
/** Execution statistics */
|
|
91
|
+
stats: ToolStats;
|
|
92
|
+
/** Creation timestamp */
|
|
93
|
+
createdAt: string;
|
|
94
|
+
/** Last update timestamp */
|
|
95
|
+
updatedAt: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Input for creating a new tool
|
|
99
|
+
*/
|
|
100
|
+
export interface CreateToolInput {
|
|
101
|
+
/** Unique name for the tool (MCP tool name) */
|
|
102
|
+
name: string;
|
|
103
|
+
/** Description of what the tool does */
|
|
104
|
+
description: string;
|
|
105
|
+
/** Type of tool execution */
|
|
106
|
+
type: ToolType;
|
|
107
|
+
/** JSON Schema defining the tool input parameters */
|
|
108
|
+
inputSchema: Record<string, unknown>;
|
|
109
|
+
/** Tool configuration based on type */
|
|
110
|
+
configuration: ToolConfiguration;
|
|
111
|
+
/** Whether the tool is enabled (default: true) */
|
|
112
|
+
isEnabled?: boolean;
|
|
113
|
+
/** Tags for categorizing tools */
|
|
114
|
+
tags?: string[];
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Input for updating an existing tool
|
|
118
|
+
*/
|
|
119
|
+
export interface UpdateToolInput {
|
|
120
|
+
/** Updated name */
|
|
121
|
+
name?: string;
|
|
122
|
+
/** Updated description */
|
|
123
|
+
description?: string;
|
|
124
|
+
/** Updated type */
|
|
125
|
+
type?: ToolType;
|
|
126
|
+
/** Updated input schema */
|
|
127
|
+
inputSchema?: Record<string, unknown>;
|
|
128
|
+
/** Updated configuration */
|
|
129
|
+
configuration?: ToolConfiguration;
|
|
130
|
+
/** Updated enabled status */
|
|
131
|
+
isEnabled?: boolean;
|
|
132
|
+
/** Updated tags */
|
|
133
|
+
tags?: string[];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Filters for listing tools
|
|
137
|
+
*/
|
|
138
|
+
export interface ToolFilters {
|
|
139
|
+
/** Filter by tool type */
|
|
140
|
+
type?: ToolType;
|
|
141
|
+
/** Filter by enabled status */
|
|
142
|
+
isEnabled?: boolean;
|
|
143
|
+
/** Search by name or description */
|
|
144
|
+
search?: string;
|
|
145
|
+
/** Filter by tag */
|
|
146
|
+
tag?: string;
|
|
147
|
+
/** Include system tools in results (default: true) */
|
|
148
|
+
includeSystem?: boolean;
|
|
149
|
+
/** Page number (1-indexed) */
|
|
150
|
+
page?: number;
|
|
151
|
+
/** Number of items per page (default: 20) */
|
|
152
|
+
limit?: number;
|
|
153
|
+
/** Sort field */
|
|
154
|
+
sortBy?: 'name' | 'createdAt' | 'updatedAt' | 'type';
|
|
155
|
+
/** Sort order */
|
|
156
|
+
sortOrder?: 'asc' | 'desc';
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Correction record for input normalization
|
|
160
|
+
*/
|
|
161
|
+
export interface CorrectionRecord {
|
|
162
|
+
field: string;
|
|
163
|
+
original: unknown;
|
|
164
|
+
corrected: unknown;
|
|
165
|
+
rule: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Tool execution record
|
|
169
|
+
*/
|
|
170
|
+
export interface ToolExecution {
|
|
171
|
+
/** Execution ID */
|
|
172
|
+
id: string;
|
|
173
|
+
/** Tool ID that was executed */
|
|
174
|
+
toolId: string;
|
|
175
|
+
/** Workspace ID */
|
|
176
|
+
workspaceId: string;
|
|
177
|
+
/** User ID who triggered the execution */
|
|
178
|
+
userId?: string;
|
|
179
|
+
/** Source of the execution */
|
|
180
|
+
source: ExecutionSource;
|
|
181
|
+
/** Input arguments passed to the tool */
|
|
182
|
+
input: Record<string, unknown>;
|
|
183
|
+
/** Output from the tool execution */
|
|
184
|
+
output?: Record<string, unknown>;
|
|
185
|
+
/** Execution status */
|
|
186
|
+
status: ExecutionStatus;
|
|
187
|
+
/** Execution time in milliseconds */
|
|
188
|
+
executionTimeMs?: number;
|
|
189
|
+
/** Error message if execution failed */
|
|
190
|
+
errorMessage?: string;
|
|
191
|
+
/** Input corrections applied during normalization */
|
|
192
|
+
correctionsApplied?: CorrectionRecord[];
|
|
193
|
+
/** OpenTelemetry trace ID */
|
|
194
|
+
traceId?: string;
|
|
195
|
+
/** OpenTelemetry span ID */
|
|
196
|
+
spanId?: string;
|
|
197
|
+
/** When execution started */
|
|
198
|
+
startedAt?: string;
|
|
199
|
+
/** When execution completed */
|
|
200
|
+
completedAt?: string;
|
|
201
|
+
/** Additional metadata */
|
|
202
|
+
metadata?: Record<string, unknown>;
|
|
203
|
+
/** Creation timestamp */
|
|
204
|
+
createdAt: string;
|
|
205
|
+
/** Last update timestamp */
|
|
206
|
+
updatedAt: string;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Filters for listing executions
|
|
210
|
+
*/
|
|
211
|
+
export interface ExecutionFilters {
|
|
212
|
+
/** Filter by execution status */
|
|
213
|
+
status?: ExecutionStatus;
|
|
214
|
+
/** Filter by execution source */
|
|
215
|
+
source?: ExecutionSource;
|
|
216
|
+
/** Filter by start date */
|
|
217
|
+
fromDate?: string;
|
|
218
|
+
/** Filter by end date */
|
|
219
|
+
toDate?: string;
|
|
220
|
+
/** Page number (1-indexed) */
|
|
221
|
+
page?: number;
|
|
222
|
+
/** Number of items per page (default: 20) */
|
|
223
|
+
limit?: number;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Response for listing tools
|
|
227
|
+
*/
|
|
228
|
+
export interface ToolListResponse {
|
|
229
|
+
tools: Tool[];
|
|
230
|
+
total: number;
|
|
231
|
+
pagination: {
|
|
232
|
+
page: number;
|
|
233
|
+
limit: number;
|
|
234
|
+
totalPages: number;
|
|
235
|
+
hasNext: boolean;
|
|
236
|
+
hasPrev: boolean;
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* Response for single tool operations
|
|
241
|
+
*/
|
|
242
|
+
export interface ToolResponse {
|
|
243
|
+
tool: Tool;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Response for tool deletion
|
|
247
|
+
*/
|
|
248
|
+
export interface ToolDeleteResponse {
|
|
249
|
+
deleted: boolean;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Real-time execution result (returned by execute/test endpoints)
|
|
253
|
+
* Different from ToolExecution which is a stored history record
|
|
254
|
+
*/
|
|
255
|
+
export interface ExecuteResult {
|
|
256
|
+
/** Whether the execution succeeded */
|
|
257
|
+
success: boolean;
|
|
258
|
+
/** The tool's output data */
|
|
259
|
+
data: unknown;
|
|
260
|
+
/** Execution time in milliseconds */
|
|
261
|
+
latencyMs: number;
|
|
262
|
+
/** OpenTelemetry trace ID */
|
|
263
|
+
traceId: string;
|
|
264
|
+
/** Execution record ID */
|
|
265
|
+
executionId: string;
|
|
266
|
+
/** Error message if execution failed */
|
|
267
|
+
error?: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Response for tool execution
|
|
271
|
+
* @deprecated Use ExecuteResult for real-time execution
|
|
272
|
+
*/
|
|
273
|
+
export interface ToolExecutionResponse {
|
|
274
|
+
execution: ToolExecution;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Response for listing executions
|
|
278
|
+
*/
|
|
279
|
+
export interface ExecutionListResponse {
|
|
280
|
+
data: ToolExecution[];
|
|
281
|
+
total: number;
|
|
282
|
+
page: number;
|
|
283
|
+
limit: number;
|
|
284
|
+
pagination: {
|
|
285
|
+
page: number;
|
|
286
|
+
limit: number;
|
|
287
|
+
totalPages: number;
|
|
288
|
+
hasNext: boolean;
|
|
289
|
+
hasPrev: boolean;
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Tool category (tag) with counts
|
|
294
|
+
*/
|
|
295
|
+
export interface ToolCategory {
|
|
296
|
+
/** Tag name */
|
|
297
|
+
tag: string;
|
|
298
|
+
/** Total count of tools with this tag */
|
|
299
|
+
count: number;
|
|
300
|
+
/** Count of enabled tools with this tag */
|
|
301
|
+
enabled: number;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Uncategorized tools count
|
|
305
|
+
*/
|
|
306
|
+
export interface UncategorizedCount {
|
|
307
|
+
/** Total count of tools without tags */
|
|
308
|
+
count: number;
|
|
309
|
+
/** Count of enabled tools without tags */
|
|
310
|
+
enabled: number;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Response for tool categories
|
|
314
|
+
*/
|
|
315
|
+
export interface ToolCategoriesResponse {
|
|
316
|
+
/** List of categories (tags) with counts */
|
|
317
|
+
categories: ToolCategory[];
|
|
318
|
+
/** Count of uncategorized tools */
|
|
319
|
+
uncategorized: UncategorizedCount;
|
|
320
|
+
}
|
|
321
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAA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CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,4CAA4C;IAC5C,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,mCAAmC;IACnC,aAAa,EAAE,kBAAkB,CAAC;CACnC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Tool Types for @chanl-ai/sdk
|
|
4
|
+
*
|
|
5
|
+
* TDD Phase: RED - These types define the contract for ToolsModule
|
|
6
|
+
* Based on chanl-api/src/tools/ schemas and DTOs
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/types/tools.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Toolset Types for @chanl-ai/sdk
|
|
3
|
+
*
|
|
4
|
+
* Based on chanl-api/src/tools/dto/toolset-*.dto.ts and schemas/toolset.schema.ts
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Toolset entity representing a collection of MCP tools
|
|
8
|
+
*/
|
|
9
|
+
export interface Toolset {
|
|
10
|
+
/** Toolset ID */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Workspace ID this toolset belongs to */
|
|
13
|
+
workspaceId: string;
|
|
14
|
+
/** Unique name for the toolset */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Description of the toolset purpose */
|
|
17
|
+
description: string;
|
|
18
|
+
/** Array of tool IDs in this toolset */
|
|
19
|
+
tools: string[];
|
|
20
|
+
/** Tool count in this toolset */
|
|
21
|
+
toolCount: number;
|
|
22
|
+
/** Custom tool name/description overrides */
|
|
23
|
+
toolOverrides?: Record<string, {
|
|
24
|
+
name?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
}>;
|
|
27
|
+
/** Whether the toolset is enabled */
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
/** Whether the toolset is publicly visible */
|
|
30
|
+
isPublic: boolean;
|
|
31
|
+
/** Registry ID for MCP registry publishing */
|
|
32
|
+
registryId?: string;
|
|
33
|
+
/** Version string */
|
|
34
|
+
version: string;
|
|
35
|
+
/** Tags for categorizing toolsets */
|
|
36
|
+
tags?: string[];
|
|
37
|
+
/** User ID who created the toolset */
|
|
38
|
+
createdBy: string;
|
|
39
|
+
/** User ID who last modified the toolset */
|
|
40
|
+
updatedBy?: string;
|
|
41
|
+
/** Creation timestamp */
|
|
42
|
+
createdAt: string;
|
|
43
|
+
/** Last update timestamp */
|
|
44
|
+
updatedAt: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Input for creating a new toolset
|
|
48
|
+
*/
|
|
49
|
+
export interface CreateToolsetInput {
|
|
50
|
+
/** Unique name for the toolset within the workspace */
|
|
51
|
+
name: string;
|
|
52
|
+
/** Description of the toolset purpose */
|
|
53
|
+
description: string;
|
|
54
|
+
/** Array of tool IDs to include in this toolset */
|
|
55
|
+
tools?: string[];
|
|
56
|
+
/** Whether the toolset is enabled (default: true) */
|
|
57
|
+
enabled?: boolean;
|
|
58
|
+
/** Whether the toolset is publicly visible (default: false) */
|
|
59
|
+
isPublic?: boolean;
|
|
60
|
+
/** Registry ID for MCP registry publishing */
|
|
61
|
+
registryId?: string;
|
|
62
|
+
/** Version string for the toolset (default: '1.0.0') */
|
|
63
|
+
version?: string;
|
|
64
|
+
/** Tags for categorizing toolsets */
|
|
65
|
+
tags?: string[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Input for updating an existing toolset
|
|
69
|
+
*/
|
|
70
|
+
export interface UpdateToolsetInput {
|
|
71
|
+
/** Updated name */
|
|
72
|
+
name?: string;
|
|
73
|
+
/** Updated description */
|
|
74
|
+
description?: string;
|
|
75
|
+
/** Updated tool IDs */
|
|
76
|
+
tools?: string[];
|
|
77
|
+
/** Updated enabled status */
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
/** Updated public visibility */
|
|
80
|
+
isPublic?: boolean;
|
|
81
|
+
/** Updated registry ID */
|
|
82
|
+
registryId?: string;
|
|
83
|
+
/** Updated version */
|
|
84
|
+
version?: string;
|
|
85
|
+
/** Updated tags */
|
|
86
|
+
tags?: string[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Filters for listing toolsets
|
|
90
|
+
*/
|
|
91
|
+
export interface ToolsetFilters {
|
|
92
|
+
/** Search by toolset name or description */
|
|
93
|
+
search?: string;
|
|
94
|
+
/** Filter by enabled status */
|
|
95
|
+
enabled?: boolean;
|
|
96
|
+
/** Filter by public visibility */
|
|
97
|
+
isPublic?: boolean;
|
|
98
|
+
/** Filter by tag */
|
|
99
|
+
tag?: string;
|
|
100
|
+
/** Page number (1-indexed) */
|
|
101
|
+
page?: number;
|
|
102
|
+
/** Number of items per page (default: 20) */
|
|
103
|
+
limit?: number;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Input for managing tools in a toolset
|
|
107
|
+
*/
|
|
108
|
+
export interface ManageToolsInput {
|
|
109
|
+
/** Tool IDs to add */
|
|
110
|
+
add?: string[];
|
|
111
|
+
/** Tool IDs to remove */
|
|
112
|
+
remove?: string[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Tool override configuration
|
|
116
|
+
*/
|
|
117
|
+
export interface ToolOverride {
|
|
118
|
+
/** Custom tool name */
|
|
119
|
+
name?: string;
|
|
120
|
+
/** Custom tool description */
|
|
121
|
+
description?: string;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Response for listing toolsets
|
|
125
|
+
*/
|
|
126
|
+
export interface ToolsetListResponse {
|
|
127
|
+
/** Array of toolsets (API returns this as 'data') */
|
|
128
|
+
data: Toolset[];
|
|
129
|
+
total: number;
|
|
130
|
+
pagination?: {
|
|
131
|
+
page: number;
|
|
132
|
+
limit: number;
|
|
133
|
+
totalPages: number;
|
|
134
|
+
hasNext: boolean;
|
|
135
|
+
hasPrev: boolean;
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Response for single toolset operations
|
|
140
|
+
* Note: API returns toolset directly in data, not nested as { toolset: ... }
|
|
141
|
+
*/
|
|
142
|
+
export type ToolsetResponse = Toolset;
|
|
143
|
+
/**
|
|
144
|
+
* Response for toolset deletion
|
|
145
|
+
*/
|
|
146
|
+
export interface ToolsetDeleteResponse {
|
|
147
|
+
deleted: boolean;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=toolsets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolsets.d.ts","sourceRoot":"","sources":["../../src/types/toolsets.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,iBAAiB;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,2CAA2C;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,wCAAwC;IACxC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxE,qCAAqC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,8CAA8C;IAC9C,QAAQ,EAAE,OAAO,CAAC;IAClB,8CAA8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AE,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,+BAA+B;IAC/B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kCAAkC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB;IACtB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACf,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,uBAAuB;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,qDAAqD;IACrD,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,OAAO,CAAC;QACjB,OAAO,EAAE,OAAO,CAAC;KAClB,CAAC;CACH;AAED;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,OAAO,CAAC;AAEtC;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,EAAE,OAAO,CAAC;CAClB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolsets.js","sourceRoot":"","sources":["../../src/types/toolsets.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
package/package.json
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@chanl-ai/sdk",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "TypeScript SDK for Chanl AI platform — agents, tools, scenarios, knowledge, memory, and more",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "tsc",
|
|
9
|
+
"dev": "tsc --watch",
|
|
10
|
+
"clean": "rimraf dist",
|
|
11
|
+
"prebuild": "npm run clean",
|
|
12
|
+
"test": "vitest run",
|
|
13
|
+
"test:watch": "vitest",
|
|
14
|
+
"typecheck": "tsc --noEmit",
|
|
15
|
+
"lint": "eslint src/**/*.ts",
|
|
16
|
+
"format": "prettier --write src/**/*.ts"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"chanl",
|
|
20
|
+
"ai-agents",
|
|
21
|
+
"api",
|
|
22
|
+
"sdk",
|
|
23
|
+
"typescript",
|
|
24
|
+
"call-analytics",
|
|
25
|
+
"mcp",
|
|
26
|
+
"scenarios",
|
|
27
|
+
"knowledge-base"
|
|
28
|
+
],
|
|
29
|
+
"author": "Chanl AI",
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"form-data": "^4.0.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^20.3.1",
|
|
36
|
+
"@typescript-eslint/eslint-plugin": "^6.0.0",
|
|
37
|
+
"@typescript-eslint/parser": "^6.0.0",
|
|
38
|
+
"eslint": "^8.42.0",
|
|
39
|
+
"prettier": "^3.0.0",
|
|
40
|
+
"rimraf": "^5.0.0",
|
|
41
|
+
"typescript": "^5.1.3",
|
|
42
|
+
"vitest": "^2.1.8"
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist/**/*",
|
|
46
|
+
"README.md"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/chanl-ai/chanl-sdk.git"
|
|
51
|
+
},
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/chanl-ai/chanl-sdk/issues"
|
|
54
|
+
},
|
|
55
|
+
"homepage": "https://github.com/chanl-ai/chanl-sdk#readme",
|
|
56
|
+
"publishConfig": {
|
|
57
|
+
"registry": "https://registry.npmjs.org",
|
|
58
|
+
"access": "public"
|
|
59
|
+
}
|
|
60
|
+
}
|