@wildix/wim-tools-client 0.0.8 → 0.0.10

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 (31) hide show
  1. package/dist-cjs/Tools.js +4 -2
  2. package/dist-cjs/ToolsClient.js +14 -13
  3. package/dist-cjs/commands/{AddToolCommand.js → CreateToolCommand.js} +7 -7
  4. package/dist-cjs/commands/DescribeToolsCommand.js +21 -0
  5. package/dist-cjs/commands/index.js +2 -1
  6. package/dist-cjs/models/models_0.js +85 -22
  7. package/dist-cjs/protocols/Aws_restJson1.js +70 -84
  8. package/dist-es/Tools.js +4 -2
  9. package/dist-es/ToolsClient.js +14 -13
  10. package/dist-es/commands/{AddToolCommand.js → CreateToolCommand.js} +6 -6
  11. package/dist-es/commands/DescribeToolsCommand.js +17 -0
  12. package/dist-es/commands/index.js +2 -1
  13. package/dist-es/models/models_0.js +82 -19
  14. package/dist-es/protocols/Aws_restJson1.js +67 -83
  15. package/dist-types/Tools.d.ts +12 -5
  16. package/dist-types/ToolsClient.d.ts +10 -7
  17. package/dist-types/commands/CreateToolCommand.d.ts +303 -0
  18. package/dist-types/commands/DeleteToolCommand.d.ts +5 -5
  19. package/dist-types/commands/DescribeToolsCommand.d.ts +97 -0
  20. package/dist-types/commands/ExecuteToolCommand.d.ts +13 -16
  21. package/dist-types/commands/GetToolCommand.d.ts +114 -11
  22. package/dist-types/commands/ListToolsCommand.d.ts +114 -22
  23. package/dist-types/commands/UpdateToolCommand.d.ts +222 -13
  24. package/dist-types/commands/index.d.ts +2 -1
  25. package/dist-types/models/models_0.d.ts +380 -273
  26. package/dist-types/protocols/Aws_restJson1.d.ts +14 -5
  27. package/dist-types/runtimeConfig.browser.d.ts +3 -5
  28. package/dist-types/runtimeConfig.d.ts +3 -5
  29. package/dist-types/runtimeConfig.native.d.ts +3 -5
  30. package/package.json +1 -1
  31. package/dist-types/commands/AddToolCommand.d.ts +0 -98
@@ -1,6 +1,17 @@
1
1
  import { ToolsServiceException as __BaseException } from "./ToolsServiceException";
2
2
  import { ExceptionOptionType as __ExceptionOptionType } from "@smithy/smithy-client";
3
3
  import { DocumentType as __DocumentType } from "@smithy/types";
4
+ /**
5
+ * @public
6
+ */
7
+ export declare class NotFoundException extends __BaseException {
8
+ readonly name: "NotFoundException";
9
+ readonly $fault: "client";
10
+ /**
11
+ * @internal
12
+ */
13
+ constructor(opts: __ExceptionOptionType<NotFoundException, __BaseException>);
14
+ }
4
15
  /**
5
16
  * @public
6
17
  */
@@ -14,137 +25,375 @@ export declare class ValidationException extends __BaseException {
14
25
  }
15
26
  /**
16
27
  * @public
17
- * @enum
18
28
  */
19
- export declare const ToolType: {
29
+ export declare class AlreadyExistException extends __BaseException {
30
+ readonly name: "AlreadyExistException";
31
+ readonly $fault: "client";
20
32
  /**
21
- * Send email via WNS Email service
33
+ * @internal
22
34
  */
23
- readonly EMAIL: "EMAIL";
35
+ constructor(opts: __ExceptionOptionType<AlreadyExistException, __BaseException>);
36
+ }
37
+ /**
38
+ * @public
39
+ */
40
+ export type ToolStringValue = ToolStringValue.StaticMember | ToolStringValue.TemplateMember | ToolStringValue.VariableMember | ToolStringValue.$UnknownMember;
41
+ /**
42
+ * @public
43
+ */
44
+ export declare namespace ToolStringValue {
45
+ interface StaticMember {
46
+ static: string;
47
+ variable?: never;
48
+ template?: never;
49
+ $unknown?: never;
50
+ }
51
+ interface VariableMember {
52
+ static?: never;
53
+ variable: string;
54
+ template?: never;
55
+ $unknown?: never;
56
+ }
57
+ interface TemplateMember {
58
+ static?: never;
59
+ variable?: never;
60
+ template: string;
61
+ $unknown?: never;
62
+ }
63
+ /**
64
+ * @public
65
+ */
66
+ interface $UnknownMember {
67
+ static?: never;
68
+ variable?: never;
69
+ template?: never;
70
+ $unknown: [string, any];
71
+ }
72
+ interface Visitor<T> {
73
+ static: (value: string) => T;
74
+ variable: (value: string) => T;
75
+ template: (value: string) => T;
76
+ _: (name: string, value: any) => T;
77
+ }
78
+ const visit: <T>(value: ToolStringValue, visitor: Visitor<T>) => T;
79
+ }
80
+ /**
81
+ * @public
82
+ */
83
+ export interface ToolChannelMessageConfig {
84
+ channelId: ToolStringValue;
85
+ text: ToolStringValue;
86
+ }
87
+ /**
88
+ * @public
89
+ */
90
+ export interface ToolDirectMessageConfig {
91
+ memberEmail?: ToolStringValue | undefined;
92
+ memberPhone?: ToolStringValue | undefined;
93
+ memberId?: ToolStringValue | undefined;
94
+ text: ToolStringValue;
95
+ }
96
+ /**
97
+ * @public
98
+ */
99
+ export type ToolChatHandler = ToolChatHandler.ChannelMember | ToolChatHandler.DirectMember | ToolChatHandler.$UnknownMember;
100
+ /**
101
+ * @public
102
+ */
103
+ export declare namespace ToolChatHandler {
104
+ interface DirectMember {
105
+ direct: ToolDirectMessageConfig;
106
+ channel?: never;
107
+ $unknown?: never;
108
+ }
109
+ interface ChannelMember {
110
+ direct?: never;
111
+ channel: ToolChannelMessageConfig;
112
+ $unknown?: never;
113
+ }
114
+ /**
115
+ * @public
116
+ */
117
+ interface $UnknownMember {
118
+ direct?: never;
119
+ channel?: never;
120
+ $unknown: [string, any];
121
+ }
122
+ interface Visitor<T> {
123
+ direct: (value: ToolDirectMessageConfig) => T;
124
+ channel: (value: ToolChannelMessageConfig) => T;
125
+ _: (name: string, value: any) => T;
126
+ }
127
+ const visit: <T>(value: ToolChatHandler, visitor: Visitor<T>) => T;
128
+ }
129
+ /**
130
+ * @public
131
+ */
132
+ export interface ToolSmtpConfig {
133
+ host: string;
134
+ port: number;
135
+ username?: string | undefined;
136
+ password?: string | undefined;
137
+ secure?: boolean | undefined;
138
+ }
139
+ /**
140
+ * @public
141
+ */
142
+ export interface ToolCustomEmailConfig {
143
+ smtp: ToolSmtpConfig;
144
+ from: ToolStringValue;
145
+ to: ToolStringValue;
146
+ subject: ToolStringValue;
147
+ text: ToolStringValue;
148
+ html?: ToolStringValue | undefined;
149
+ cc?: ToolStringValue | undefined;
150
+ bcc?: ToolStringValue | undefined;
151
+ replyTo?: ToolStringValue | undefined;
152
+ }
153
+ /**
154
+ * @public
155
+ */
156
+ export interface ToolWnsEmailConfig {
157
+ to: ToolStringValue;
158
+ subject: ToolStringValue;
159
+ text: ToolStringValue;
160
+ }
161
+ /**
162
+ * @public
163
+ */
164
+ export type ToolEmailHandler = ToolEmailHandler.CustomMember | ToolEmailHandler.WnsMember | ToolEmailHandler.$UnknownMember;
165
+ /**
166
+ * @public
167
+ */
168
+ export declare namespace ToolEmailHandler {
169
+ interface WnsMember {
170
+ wns: ToolWnsEmailConfig;
171
+ custom?: never;
172
+ $unknown?: never;
173
+ }
174
+ interface CustomMember {
175
+ wns?: never;
176
+ custom: ToolCustomEmailConfig;
177
+ $unknown?: never;
178
+ }
179
+ /**
180
+ * @public
181
+ */
182
+ interface $UnknownMember {
183
+ wns?: never;
184
+ custom?: never;
185
+ $unknown: [string, any];
186
+ }
187
+ interface Visitor<T> {
188
+ wns: (value: ToolWnsEmailConfig) => T;
189
+ custom: (value: ToolCustomEmailConfig) => T;
190
+ _: (name: string, value: any) => T;
191
+ }
192
+ const visit: <T>(value: ToolEmailHandler, visitor: Visitor<T>) => T;
193
+ }
194
+ /**
195
+ * @public
196
+ * @enum
197
+ */
198
+ export declare const ToolAuthorizationType: {
199
+ readonly API_KEY: "ApiKey";
200
+ readonly BASIC: "Basic";
201
+ readonly BEARER: "Bearer";
24
202
  };
25
203
  /**
26
204
  * @public
27
205
  */
28
- export type ToolType = typeof ToolType[keyof typeof ToolType];
206
+ export type ToolAuthorizationType = typeof ToolAuthorizationType[keyof typeof ToolAuthorizationType];
29
207
  /**
30
208
  * @public
31
209
  */
32
- export interface AddToolInput {
33
- /**
34
- * Company that owns the tool (optional, derived from auth context)
35
- * @public
36
- */
37
- company?: string | undefined;
38
- /**
39
- * Tool name for LLM
40
- * @public
41
- */
210
+ export interface ToolAuthentication {
211
+ type: ToolAuthorizationType;
212
+ token: string;
213
+ }
214
+ /**
215
+ * @public
216
+ * @enum
217
+ */
218
+ export declare const ToolVariableType: {
219
+ readonly BOOLEAN: "boolean";
220
+ readonly NUMBER: "number";
221
+ readonly NUMBER_ARRAY: "number_array";
222
+ readonly OBJECT: "object";
223
+ readonly STRING: "string";
224
+ readonly STRING_ARRAY: "string_array";
225
+ };
226
+ /**
227
+ * @public
228
+ */
229
+ export type ToolVariableType = typeof ToolVariableType[keyof typeof ToolVariableType];
230
+ /**
231
+ * @public
232
+ */
233
+ export interface ToolVariable {
42
234
  name: string;
43
- /**
44
- * Tool description
45
- * @public
46
- */
235
+ type: ToolVariableType;
47
236
  description: string;
48
- /**
49
- * Tool type
50
- * @public
51
- */
52
- type: ToolType;
53
- /**
54
- * Tool-specific configuration
55
- * @public
56
- */
57
- config: __DocumentType;
58
- /**
59
- * JSON Schema for parameters
60
- * @public
61
- */
62
- jsonSchema: __DocumentType;
237
+ required?: boolean | undefined;
63
238
  }
64
239
  /**
65
- * Tool configuration and metadata
66
240
  * @public
67
241
  */
68
- export interface Tool {
69
- /**
70
- * Unique tool identifier
71
- * @public
72
- */
73
- id: string;
74
- /**
75
- * Company that owns this tool
76
- * @public
77
- */
78
- company: string;
79
- /**
80
- * Tool name for LLM (e.g., "send_email")
81
- * @public
82
- */
242
+ export interface ToolInput {
243
+ variables: (ToolVariable)[];
244
+ }
245
+ /**
246
+ * @public
247
+ */
248
+ export interface ToolMcpTool {
249
+ name: string;
250
+ input: ToolInput;
251
+ params: Record<string, ToolStringValue>;
252
+ }
253
+ /**
254
+ * @public
255
+ * @enum
256
+ */
257
+ export declare const ToolMcpTransport: {
258
+ readonly HTTP: "http";
259
+ readonly SSE: "sse";
260
+ readonly STDIO: "stdio";
261
+ };
262
+ /**
263
+ * @public
264
+ */
265
+ export type ToolMcpTransport = typeof ToolMcpTransport[keyof typeof ToolMcpTransport];
266
+ /**
267
+ * @public
268
+ */
269
+ export interface ToolMcpHandler {
270
+ serverUrl: string;
271
+ transport: ToolMcpTransport;
272
+ authentication?: ToolAuthentication | undefined;
273
+ timeout?: number | undefined;
274
+ tools: (ToolMcpTool)[];
275
+ }
276
+ /**
277
+ * @public
278
+ */
279
+ export interface ToolSmsHandler {
280
+ serviceUri: ToolStringValue;
281
+ recipientId?: ToolStringValue | undefined;
282
+ recipientNumber: ToolStringValue;
283
+ message: ToolStringValue;
284
+ }
285
+ /**
286
+ * @public
287
+ */
288
+ export interface ToolWebhookHandler {
289
+ url: ToolStringValue;
290
+ body: ToolStringValue;
291
+ key?: ToolStringValue | undefined;
292
+ secret: ToolStringValue;
293
+ timeout?: number | undefined;
294
+ }
295
+ /**
296
+ * @public
297
+ */
298
+ export type ToolHandler = ToolHandler.ChatMember | ToolHandler.EmailMember | ToolHandler.McpMember | ToolHandler.SmsMember | ToolHandler.WebhookMember | ToolHandler.$UnknownMember;
299
+ /**
300
+ * @public
301
+ */
302
+ export declare namespace ToolHandler {
303
+ interface EmailMember {
304
+ email: ToolEmailHandler;
305
+ sms?: never;
306
+ chat?: never;
307
+ webhook?: never;
308
+ mcp?: never;
309
+ $unknown?: never;
310
+ }
311
+ interface SmsMember {
312
+ email?: never;
313
+ sms: ToolSmsHandler;
314
+ chat?: never;
315
+ webhook?: never;
316
+ mcp?: never;
317
+ $unknown?: never;
318
+ }
319
+ interface ChatMember {
320
+ email?: never;
321
+ sms?: never;
322
+ chat: ToolChatHandler;
323
+ webhook?: never;
324
+ mcp?: never;
325
+ $unknown?: never;
326
+ }
327
+ interface WebhookMember {
328
+ email?: never;
329
+ sms?: never;
330
+ chat?: never;
331
+ webhook: ToolWebhookHandler;
332
+ mcp?: never;
333
+ $unknown?: never;
334
+ }
335
+ interface McpMember {
336
+ email?: never;
337
+ sms?: never;
338
+ chat?: never;
339
+ webhook?: never;
340
+ mcp: ToolMcpHandler;
341
+ $unknown?: never;
342
+ }
343
+ /**
344
+ * @public
345
+ */
346
+ interface $UnknownMember {
347
+ email?: never;
348
+ sms?: never;
349
+ chat?: never;
350
+ webhook?: never;
351
+ mcp?: never;
352
+ $unknown: [string, any];
353
+ }
354
+ interface Visitor<T> {
355
+ email: (value: ToolEmailHandler) => T;
356
+ sms: (value: ToolSmsHandler) => T;
357
+ chat: (value: ToolChatHandler) => T;
358
+ webhook: (value: ToolWebhookHandler) => T;
359
+ mcp: (value: ToolMcpHandler) => T;
360
+ _: (name: string, value: any) => T;
361
+ }
362
+ const visit: <T>(value: ToolHandler, visitor: Visitor<T>) => T;
363
+ }
364
+ /**
365
+ * @public
366
+ */
367
+ export interface CreateToolInput {
368
+ company?: string | undefined;
83
369
  name: string;
84
- /**
85
- * Human-readable description for LLM
86
- * @public
87
- */
88
370
  description: string;
89
- /**
90
- * Type of tool
91
- * @public
92
- */
93
- type: ToolType;
94
- /**
95
- * Tool-specific configuration (JSON)
96
- * @public
97
- */
98
- config: __DocumentType;
99
- /**
100
- * JSON Schema for LLM parameters
101
- * @public
102
- */
103
- jsonSchema: __DocumentType;
104
- /**
105
- * When the tool was created
106
- * @public
107
- */
108
- createdAt: Date;
109
- /**
110
- * When the tool was last updated
111
- * @public
112
- */
113
- updatedAt?: Date | undefined;
371
+ input: ToolInput;
372
+ handler: ToolHandler;
114
373
  }
115
374
  /**
116
375
  * @public
117
376
  */
118
- export interface AddToolOutput {
119
- /**
120
- * Created tool
121
- * @public
122
- */
123
- tool: Tool;
377
+ export interface Tool {
378
+ id: string;
379
+ company: string;
380
+ name: string;
381
+ description?: string | undefined;
382
+ input: ToolInput;
383
+ handler: ToolHandler;
124
384
  }
125
385
  /**
126
- * Tool already exists error
127
386
  * @public
128
387
  */
129
- export declare class ToolAlreadyExistsException extends __BaseException {
130
- readonly name: "ToolAlreadyExistsException";
131
- readonly $fault: "client";
132
- /**
133
- * @internal
134
- */
135
- constructor(opts: __ExceptionOptionType<ToolAlreadyExistsException, __BaseException>);
388
+ export interface CreateToolOutput {
389
+ tool: Tool;
136
390
  }
137
391
  /**
138
- * Tool execution failed error
139
392
  * @public
140
393
  */
141
394
  export declare class ToolExecutionException extends __BaseException {
142
395
  readonly name: "ToolExecutionException";
143
396
  readonly $fault: "server";
144
- /**
145
- * Detailed error information
146
- * @public
147
- */
148
397
  details?: __DocumentType | undefined;
149
398
  /**
150
399
  * @internal
@@ -152,248 +401,106 @@ export declare class ToolExecutionException extends __BaseException {
152
401
  constructor(opts: __ExceptionOptionType<ToolExecutionException, __BaseException>);
153
402
  }
154
403
  /**
155
- * Tool not found error
156
404
  * @public
157
405
  */
158
- export declare class ToolNotFoundException extends __BaseException {
159
- readonly name: "ToolNotFoundException";
160
- readonly $fault: "client";
161
- /**
162
- * @internal
163
- */
164
- constructor(opts: __ExceptionOptionType<ToolNotFoundException, __BaseException>);
406
+ export interface DeleteToolInput {
407
+ company?: string | undefined;
408
+ toolId: string;
165
409
  }
166
410
  /**
167
411
  * @public
168
412
  */
169
- export interface DeleteToolInput {
170
- /**
171
- * Company that owns the tool (optional, derived from auth context)
172
- * @public
173
- */
413
+ export interface DeleteToolOutput {
414
+ }
415
+ /**
416
+ * @public
417
+ */
418
+ export interface DescribeToolsInput {
174
419
  company?: string | undefined;
175
- /**
176
- * Tool identifier
177
- * @public
178
- */
179
- toolId: string;
420
+ ids: (string)[];
180
421
  }
181
422
  /**
182
423
  * @public
183
424
  */
184
- export interface DeleteToolOutput {
425
+ export interface ToolDescription {
426
+ id: string;
427
+ name: string;
428
+ description: string;
429
+ variables: (ToolVariable)[];
185
430
  }
186
431
  /**
187
- * Tool execution context
188
432
  * @public
189
433
  */
190
- export interface ExecutionContext {
191
- /**
192
- * Company executing the tool
193
- * @public
194
- */
195
- company: string;
196
- /**
197
- * Session identifier for tracing
198
- * @public
199
- */
200
- sessionId?: string | undefined;
434
+ export interface DescribeToolsOutput {
435
+ descriptions: (ToolDescription)[];
201
436
  }
202
437
  /**
203
438
  * @public
204
439
  */
205
440
  export interface ExecuteToolInput {
206
- /**
207
- * Company executing the tool (optional, derived from auth context)
208
- * @public
209
- */
210
441
  company?: string | undefined;
211
- /**
212
- * Tool identifier
213
- * @public
214
- */
215
- toolId: string;
216
- /**
217
- * Parameters from LLM (JSON)
218
- * @public
219
- */
220
- parameters: __DocumentType;
221
- /**
222
- * Execution context for tracing
223
- * @public
224
- */
225
- context?: ExecutionContext | undefined;
442
+ id: string;
443
+ input: __DocumentType;
226
444
  }
227
445
  /**
228
- * Tool execution result
229
446
  * @public
230
447
  */
231
- export interface ExecutionResult {
232
- /**
233
- * Whether execution was successful
234
- * @public
235
- */
236
- success: boolean;
237
- /**
238
- * Result data (JSON)
239
- * @public
240
- */
241
- result?: __DocumentType | undefined;
242
- /**
243
- * Error message if failed
244
- * @public
245
- */
246
- error?: string | undefined;
247
- /**
248
- * Execution trace identifier
249
- * @public
250
- */
251
- traceId?: string | undefined;
448
+ export interface ToolExecutionError {
449
+ message: string;
450
+ }
451
+ /**
452
+ * @public
453
+ */
454
+ export interface ToolExecutionResult {
455
+ statusCode: number;
456
+ output: __DocumentType;
457
+ error?: ToolExecutionError | undefined;
252
458
  }
253
459
  /**
254
460
  * @public
255
461
  */
256
462
  export interface ExecuteToolOutput {
257
- /**
258
- * Execution result
259
- * @public
260
- */
261
- result: ExecutionResult;
463
+ result: ToolExecutionResult;
262
464
  }
263
465
  /**
264
466
  * @public
265
467
  */
266
468
  export interface GetToolInput {
267
- /**
268
- * Company identifier (optional, derived from auth context)
269
- * @public
270
- */
271
469
  company?: string | undefined;
272
- /**
273
- * Tool identifier
274
- * @public
275
- */
276
470
  toolId: string;
277
471
  }
278
472
  /**
279
473
  * @public
280
474
  */
281
475
  export interface GetToolOutput {
282
- /**
283
- * Tool details
284
- * @public
285
- */
286
476
  tool: Tool;
287
477
  }
288
478
  /**
289
479
  * @public
290
480
  */
291
481
  export interface ListToolsInput {
292
- /**
293
- * Company identifier (optional, derived from auth context)
294
- * @public
295
- */
296
482
  company?: string | undefined;
297
- /**
298
- * Return in LLM-compatible format
299
- * @public
300
- */
301
- format?: string | undefined;
302
- }
303
- /**
304
- * Function definition for LLM
305
- * @public
306
- */
307
- export interface LlmFunctionDefinition {
308
- /**
309
- * Function name
310
- * @public
311
- */
312
- name: string;
313
- /**
314
- * Function description
315
- * @public
316
- */
317
- description: string;
318
- /**
319
- * JSON Schema for parameters
320
- * @public
321
- */
322
- parameters: __DocumentType;
323
- }
324
- /**
325
- * Tool definition in OpenAI-compatible format for LLM
326
- * @public
327
- */
328
- export interface LlmToolDefinition {
329
- /**
330
- * Tool type (always "function" for OpenAI compatibility)
331
- * @public
332
- */
333
- type: string;
334
- /**
335
- * Function definition
336
- * @public
337
- */
338
- function: LlmFunctionDefinition;
339
483
  }
340
484
  /**
341
485
  * @public
342
486
  */
343
487
  export interface ListToolsOutput {
344
- /**
345
- * List of tools (raw format)
346
- * @public
347
- */
348
- tools?: (Tool)[] | undefined;
349
- /**
350
- * List of tools in LLM format (if format=llm)
351
- * @public
352
- */
353
- llmTools?: (LlmToolDefinition)[] | undefined;
488
+ tools: (Tool)[];
354
489
  }
355
490
  /**
356
491
  * @public
357
492
  */
358
493
  export interface UpdateToolInput {
359
- /**
360
- * Company that owns the tool (optional, derived from auth context)
361
- * @public
362
- */
363
494
  company?: string | undefined;
364
- /**
365
- * Tool identifier
366
- * @public
367
- */
368
495
  toolId: string;
369
- /**
370
- * Updated tool name
371
- * @public
372
- */
373
496
  name: string;
374
- /**
375
- * Updated description
376
- * @public
377
- */
378
497
  description: string;
379
- /**
380
- * Updated configuration
381
- * @public
382
- */
383
- config: __DocumentType;
384
- /**
385
- * Updated JSON Schema
386
- * @public
387
- */
388
- jsonSchema: __DocumentType;
498
+ input: ToolInput;
499
+ handler: ToolHandler;
389
500
  }
390
501
  /**
391
502
  * @public
392
503
  */
393
504
  export interface UpdateToolOutput {
394
- /**
395
- * Updated tool
396
- * @public
397
- */
398
505
  tool: Tool;
399
506
  }