@dainprotocol/service-sdk 1.0.44 → 1.0.45
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/__tests__/api-sdk.test.d.ts +1 -0
- package/dist/__tests__/api-sdk.test.js +235 -0
- package/dist/__tests__/api-sdk.test.js.map +1 -0
- package/dist/client/api-sdk.d.ts +50 -0
- package/dist/client/api-sdk.js +188 -0
- package/dist/client/api-sdk.js.map +1 -0
- package/dist/client/index.d.ts +1 -0
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const api_sdk_1 = require("../client/api-sdk");
|
|
5
|
+
const client_auth_1 = require("../client/client-auth");
|
|
6
|
+
const ed25519_1 = require("@noble/curves/ed25519");
|
|
7
|
+
const bs58_1 = tslib_1.__importDefault(require("bs58"));
|
|
8
|
+
const nodeService_1 = require("../service/nodeService");
|
|
9
|
+
const zod_1 = require("zod");
|
|
10
|
+
describe("DainSDK", () => {
|
|
11
|
+
const privateKey = ed25519_1.ed25519.utils.randomPrivateKey();
|
|
12
|
+
const publicKey = ed25519_1.ed25519.getPublicKey(privateKey);
|
|
13
|
+
const clientPrivateKey = ed25519_1.ed25519.utils.randomPrivateKey();
|
|
14
|
+
const agentAuth = new client_auth_1.DainClientAuth({
|
|
15
|
+
privateKeyBase58: bs58_1.default.encode(clientPrivateKey),
|
|
16
|
+
agentId: "agent-12",
|
|
17
|
+
orgId: "org-12",
|
|
18
|
+
});
|
|
19
|
+
// Create test tools with different schema types
|
|
20
|
+
const simpleTestTool = (0, nodeService_1.createTool)({
|
|
21
|
+
id: "simple-test-tool",
|
|
22
|
+
name: "my-test-tool-name",
|
|
23
|
+
description: "Test tool with simple types",
|
|
24
|
+
input: zod_1.z.object({
|
|
25
|
+
stringParam: zod_1.z.string().describe("A string parameter"),
|
|
26
|
+
numberParam: zod_1.z.number().describe("A number parameter"),
|
|
27
|
+
booleanParam: zod_1.z.boolean().describe("A boolean parameter"),
|
|
28
|
+
optionalParam: zod_1.z.string().optional().describe("An optional parameter"),
|
|
29
|
+
enumParam: zod_1.z.enum(["option1", "option2", "option3"]).describe("An enum parameter"),
|
|
30
|
+
}),
|
|
31
|
+
output: zod_1.z.object({ result: zod_1.z.string() }),
|
|
32
|
+
pricing: { pricePerUse: 0.01, currency: "USD" },
|
|
33
|
+
handler: async ({ stringParam }) => ({
|
|
34
|
+
text: `Processed: ${stringParam}`,
|
|
35
|
+
data: { result: `Processed: ${stringParam}` },
|
|
36
|
+
ui: null,
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
const complexTestTool = (0, nodeService_1.createTool)({
|
|
40
|
+
id: "complex-test-tool",
|
|
41
|
+
name: "complex-tool-name",
|
|
42
|
+
description: "Test tool with complex types",
|
|
43
|
+
input: zod_1.z.object({
|
|
44
|
+
arrayParam: zod_1.z.array(zod_1.z.string()).describe("Array of strings"),
|
|
45
|
+
objectParam: zod_1.z.object({
|
|
46
|
+
nested: zod_1.z.number(),
|
|
47
|
+
deeplyNested: zod_1.z.object({
|
|
48
|
+
value: zod_1.z.boolean(),
|
|
49
|
+
}),
|
|
50
|
+
}).describe("Nested object"),
|
|
51
|
+
unionParam: zod_1.z.union([
|
|
52
|
+
zod_1.z.string(),
|
|
53
|
+
zod_1.z.number(),
|
|
54
|
+
]).describe("String or number"),
|
|
55
|
+
recordParam: zod_1.z.record(zod_1.z.string(), zod_1.z.number()).describe("Record of numbers"),
|
|
56
|
+
defaultParam: zod_1.z.string().default("default value"),
|
|
57
|
+
}),
|
|
58
|
+
output: zod_1.z.object({ result: zod_1.z.string() }),
|
|
59
|
+
pricing: { pricePerUse: 0.01, currency: "USD" },
|
|
60
|
+
handler: async () => ({
|
|
61
|
+
text: "Processed complex input",
|
|
62
|
+
data: { result: "Processed complex input" },
|
|
63
|
+
ui: null,
|
|
64
|
+
}),
|
|
65
|
+
});
|
|
66
|
+
// Create test service with both tools
|
|
67
|
+
const dainService = (0, nodeService_1.defineDAINService)({
|
|
68
|
+
metadata: {
|
|
69
|
+
title: "Test DAIN Service",
|
|
70
|
+
description: "A test DAIN service",
|
|
71
|
+
version: "1.0.0",
|
|
72
|
+
author: "Test Author",
|
|
73
|
+
tags: ["test"],
|
|
74
|
+
},
|
|
75
|
+
identity: {
|
|
76
|
+
publicKey: bs58_1.default.encode(publicKey),
|
|
77
|
+
agentId: "test-agent",
|
|
78
|
+
orgId: "test-org",
|
|
79
|
+
privateKey: bs58_1.default.encode(privateKey),
|
|
80
|
+
},
|
|
81
|
+
tools: [simpleTestTool, complexTestTool],
|
|
82
|
+
});
|
|
83
|
+
let server;
|
|
84
|
+
let sdk;
|
|
85
|
+
beforeAll(async () => {
|
|
86
|
+
server = await dainService.startNode({ port: 3003 });
|
|
87
|
+
sdk = new api_sdk_1.DainSDK("http://localhost:3003", agentAuth);
|
|
88
|
+
await sdk.initialize();
|
|
89
|
+
});
|
|
90
|
+
afterAll(async () => {
|
|
91
|
+
if (server) {
|
|
92
|
+
await server.shutdown();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
describe("Method Name Sanitization", () => {
|
|
96
|
+
it("should convert hyphenated names to camelCase", () => {
|
|
97
|
+
// @ts-ignore - Accessing private method for testing
|
|
98
|
+
const sanitizedName = sdk["sanitizeMethodName"]("my-test-tool-name");
|
|
99
|
+
expect(sanitizedName).toBe("myTestToolName");
|
|
100
|
+
});
|
|
101
|
+
it("should convert underscored names to camelCase", () => {
|
|
102
|
+
// @ts-ignore - Accessing private method for testing
|
|
103
|
+
const sanitizedName = sdk["sanitizeMethodName"]("my_test_tool_name");
|
|
104
|
+
expect(sanitizedName).toBe("myTestToolName");
|
|
105
|
+
});
|
|
106
|
+
it("should handle spaces in names", () => {
|
|
107
|
+
// @ts-ignore - Accessing private method for testing
|
|
108
|
+
const sanitizedName = sdk["sanitizeMethodName"]("my test tool name");
|
|
109
|
+
expect(sanitizedName).toBe("myTestToolName");
|
|
110
|
+
});
|
|
111
|
+
it("should handle mixed separators", () => {
|
|
112
|
+
// @ts-ignore - Accessing private method for testing
|
|
113
|
+
const sanitizedName = sdk["sanitizeMethodName"]("my-test_tool name");
|
|
114
|
+
expect(sanitizedName).toBe("myTestToolName");
|
|
115
|
+
});
|
|
116
|
+
it("should preserve case for acronyms", () => {
|
|
117
|
+
// @ts-ignore - Accessing private method for testing
|
|
118
|
+
const sanitizedName = sdk["sanitizeMethodName"]("get-JSON-data");
|
|
119
|
+
expect(sanitizedName).toBe("getJsonData");
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
describe("SDK Integration", () => {
|
|
123
|
+
it("should initialize and create methods for tools", () => {
|
|
124
|
+
// @ts-ignore - Accessing generated method
|
|
125
|
+
expect(typeof sdk.myTestToolName).toBe("function");
|
|
126
|
+
});
|
|
127
|
+
it("should be able to call the tool with sanitized name", async () => {
|
|
128
|
+
// @ts-ignore - Accessing generated method
|
|
129
|
+
const result = await sdk.myTestToolName({
|
|
130
|
+
stringParam: "test",
|
|
131
|
+
numberParam: 42,
|
|
132
|
+
booleanParam: true,
|
|
133
|
+
enumParam: "option1"
|
|
134
|
+
});
|
|
135
|
+
expect(result.data.result).toBe("Processed: test");
|
|
136
|
+
});
|
|
137
|
+
it("should fail gracefully with invalid parameters", async () => {
|
|
138
|
+
// @ts-ignore - Accessing generated method
|
|
139
|
+
await expect(sdk.myTestToolName({ invalid: "param" }))
|
|
140
|
+
.rejects
|
|
141
|
+
.toThrow(/Invalid parameters/);
|
|
142
|
+
});
|
|
143
|
+
it("should generate documentation with both original and sanitized names", async () => {
|
|
144
|
+
const docs = await sdk.getDocumentation();
|
|
145
|
+
expect(docs).toContain("my-test-tool-name");
|
|
146
|
+
expect(docs).toContain("myTestToolName");
|
|
147
|
+
expect(docs).toContain("Test tool with simple types");
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
describe("SDK Schema Validation", () => {
|
|
151
|
+
describe("Simple Types", () => {
|
|
152
|
+
it("should validate simple types correctly", async () => {
|
|
153
|
+
// @ts-ignore - Accessing generated method
|
|
154
|
+
const result = await sdk.myTestToolName({
|
|
155
|
+
stringParam: "test",
|
|
156
|
+
numberParam: 42,
|
|
157
|
+
booleanParam: true,
|
|
158
|
+
enumParam: "option1",
|
|
159
|
+
});
|
|
160
|
+
expect(result.data.result).toBe("Processed: test");
|
|
161
|
+
});
|
|
162
|
+
it("should handle optional parameters", async () => {
|
|
163
|
+
// @ts-ignore - Accessing generated method
|
|
164
|
+
const result = await sdk.myTestToolName({
|
|
165
|
+
stringParam: "test",
|
|
166
|
+
numberParam: 42,
|
|
167
|
+
booleanParam: true,
|
|
168
|
+
enumParam: "option1",
|
|
169
|
+
// optionalParam omitted
|
|
170
|
+
});
|
|
171
|
+
expect(result.data.result).toBe("Processed: test");
|
|
172
|
+
});
|
|
173
|
+
it("should reject invalid enum values", async () => {
|
|
174
|
+
// @ts-ignore - Accessing generated method
|
|
175
|
+
await expect(sdk.myTestToolName({
|
|
176
|
+
stringParam: "test",
|
|
177
|
+
numberParam: 42,
|
|
178
|
+
booleanParam: true,
|
|
179
|
+
enumParam: "invalid-option",
|
|
180
|
+
})).rejects.toThrow(/Invalid/);
|
|
181
|
+
});
|
|
182
|
+
});
|
|
183
|
+
describe("Complex Types", () => {
|
|
184
|
+
it("should validate complex types correctly", async () => {
|
|
185
|
+
// @ts-ignore - Accessing generated method
|
|
186
|
+
const result = await sdk.complexToolName({
|
|
187
|
+
arrayParam: ["one", "two"],
|
|
188
|
+
objectParam: {
|
|
189
|
+
nested: 42,
|
|
190
|
+
deeplyNested: {
|
|
191
|
+
value: true,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
unionParam: "string-or-number",
|
|
195
|
+
recordParam: {
|
|
196
|
+
key1: 1,
|
|
197
|
+
key2: 2,
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
expect(result.data.result).toBe("Processed complex input");
|
|
201
|
+
});
|
|
202
|
+
it("should apply default values", async () => {
|
|
203
|
+
// @ts-ignore - Accessing generated method
|
|
204
|
+
const result = await sdk.complexToolName({
|
|
205
|
+
arrayParam: ["one"],
|
|
206
|
+
objectParam: {
|
|
207
|
+
nested: 42,
|
|
208
|
+
deeplyNested: {
|
|
209
|
+
value: true,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
unionParam: 123,
|
|
213
|
+
recordParam: {},
|
|
214
|
+
// defaultParam will use default value
|
|
215
|
+
});
|
|
216
|
+
expect(result.data.result).toBe("Processed complex input");
|
|
217
|
+
});
|
|
218
|
+
it("should reject invalid nested types", async () => {
|
|
219
|
+
// @ts-ignore - Accessing generated method
|
|
220
|
+
await expect(sdk.complexToolName({
|
|
221
|
+
arrayParam: ["one"],
|
|
222
|
+
objectParam: {
|
|
223
|
+
nested: "not-a-number", // Should be number
|
|
224
|
+
deeplyNested: {
|
|
225
|
+
value: true,
|
|
226
|
+
},
|
|
227
|
+
},
|
|
228
|
+
unionParam: true, // Should be string or number
|
|
229
|
+
recordParam: {},
|
|
230
|
+
})).rejects.toThrow(/Invalid/);
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
});
|
|
235
|
+
//# sourceMappingURL=api-sdk.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-sdk.test.js","sourceRoot":"","sources":["../../src/__tests__/api-sdk.test.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,uDAAuD;AACvD,mDAAgD;AAChD,wDAAwB;AACxB,wDAAuE;AACvE,6BAAwB;AAExB,QAAQ,CAAC,SAAS,EAAE,GAAG,EAAE;IACvB,MAAM,UAAU,GAAG,iBAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,CAAC;IACpD,MA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ig } from './types';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
type ToolMethod<T extends z.ZodType, U extends z.ZodType> = (params: z.infer<T>) => Promise<{
|
|
5
|
+
data: z.infer<U>;
|
|
6
|
+
text: string;
|
|
7
|
+
ui: any;
|
|
8
|
+
}>;
|
|
9
|
+
type ToolMethods<T extends Record<string, ToolConfig>> = {
|
|
10
|
+
[K in keyof T]: ToolMethod<z.ZodType<any>, z.ZodType<any>>;
|
|
11
|
+
};
|
|
12
|
+
export declare class DainSDK {
|
|
13
|
+
private connection;
|
|
14
|
+
private toolsCache;
|
|
15
|
+
private metadata?;
|
|
16
|
+
constructor(baseUrl: string, auth: DainClientAuth);
|
|
17
|
+
/**
|
|
18
|
+
* Initializes the SDK by loading all tools and metadata.
|
|
19
|
+
* This must be called before using any tool methods.
|
|
20
|
+
* @throws {Error} If the connection fails or service is unavailable
|
|
21
|
+
*/
|
|
22
|
+
initialize(): Promise<this & ToolMethods<Record<string, ToolConfig>>>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns comprehensive documentation for all available tools and services
|
|
25
|
+
* @returns {Promise<string>} Markdown formatted documentation
|
|
26
|
+
*/
|
|
27
|
+
getDocumentation(): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Returns the raw schema documentation for a specific tool
|
|
30
|
+
* @param toolId The ID of the tool
|
|
31
|
+
*/
|
|
32
|
+
getToolSchema(toolId: string): Promise<{
|
|
33
|
+
input: z.ZodType;
|
|
34
|
+
output: z.ZodType;
|
|
35
|
+
description: string;
|
|
36
|
+
}>;
|
|
37
|
+
private generateSchemaDocumentation;
|
|
38
|
+
private generateExampleParams;
|
|
39
|
+
private sanitizeMethodName;
|
|
40
|
+
private generateToolMethods;
|
|
41
|
+
/**
|
|
42
|
+
* Returns the metadata about the connected service
|
|
43
|
+
*/
|
|
44
|
+
getServiceInfo(): ServiceMetadata | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Returns all available tool configurations
|
|
47
|
+
*/
|
|
48
|
+
getAvailableTools(): ToolConfig[];
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DainSDK = void 0;
|
|
4
|
+
const client_1 = require("./client");
|
|
5
|
+
const convertToVercelTool_1 = require("../lib/convertToVercelTool");
|
|
6
|
+
class DainSDK {
|
|
7
|
+
connection;
|
|
8
|
+
toolsCache = new Map();
|
|
9
|
+
metadata;
|
|
10
|
+
constructor(baseUrl, auth) {
|
|
11
|
+
this.connection = new client_1.DainServiceConnection(baseUrl, auth);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Initializes the SDK by loading all tools and metadata.
|
|
15
|
+
* This must be called before using any tool methods.
|
|
16
|
+
* @throws {Error} If the connection fails or service is unavailable
|
|
17
|
+
*/
|
|
18
|
+
async initialize() {
|
|
19
|
+
// Load metadata and cache it
|
|
20
|
+
this.metadata = await this.connection.getMetadata();
|
|
21
|
+
// Cache all tools
|
|
22
|
+
const tools = await this.connection.getTools();
|
|
23
|
+
tools.forEach(tool => this.toolsCache.set(tool.id, tool));
|
|
24
|
+
// Dynamically add methods for each tool
|
|
25
|
+
await this.generateToolMethods();
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns comprehensive documentation for all available tools and services
|
|
30
|
+
* @returns {Promise<string>} Markdown formatted documentation
|
|
31
|
+
*/
|
|
32
|
+
async getDocumentation() {
|
|
33
|
+
if (!this.metadata) {
|
|
34
|
+
throw new Error('SDK not initialized. Call initialize() first.');
|
|
35
|
+
}
|
|
36
|
+
let docs = `# ${this.metadata.title} API Documentation\n\n`;
|
|
37
|
+
docs += `${this.metadata.description}\n\n`;
|
|
38
|
+
docs += `Version: ${this.metadata.version}\n`;
|
|
39
|
+
docs += `Author: ${this.metadata.author}\n\n`;
|
|
40
|
+
// Add service capabilities
|
|
41
|
+
docs += `## Service Capabilities\n\n`;
|
|
42
|
+
docs += `- ${this.metadata.tags.join('\n- ')}\n\n`;
|
|
43
|
+
// Document all available tools
|
|
44
|
+
docs += `## Available Tools\n\n`;
|
|
45
|
+
for (const [_, tool] of this.toolsCache) {
|
|
46
|
+
docs += `### ${tool.name}\n\n`;
|
|
47
|
+
docs += `**Method Name:** \`${this.sanitizeMethodName(tool.name)}\`\n\n`;
|
|
48
|
+
docs += `${tool.description}\n\n`;
|
|
49
|
+
// Document input schema
|
|
50
|
+
docs += `**Input Schema:**\n\`\`\`typescript\n`;
|
|
51
|
+
docs += this.generateSchemaDocumentation(tool.inputSchema);
|
|
52
|
+
docs += `\n\`\`\`\n\n`;
|
|
53
|
+
// Add example usage
|
|
54
|
+
docs += `**Example Usage:**\n\`\`\`typescript\n`;
|
|
55
|
+
docs += `const result = await sdk.${this.sanitizeMethodName(tool.name)}({\n`;
|
|
56
|
+
docs += this.generateExampleParams(tool.inputSchema);
|
|
57
|
+
docs += `});\n`;
|
|
58
|
+
docs += `\`\`\`\n(Example Parameters are just placeholders for the type, they are not real values)\n\n`;
|
|
59
|
+
}
|
|
60
|
+
return docs;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Returns the raw schema documentation for a specific tool
|
|
64
|
+
* @param toolId The ID of the tool
|
|
65
|
+
*/
|
|
66
|
+
async getToolSchema(toolId) {
|
|
67
|
+
const tool = this.toolsCache.get(toolId);
|
|
68
|
+
if (!tool) {
|
|
69
|
+
throw new Error(`Tool ${toolId} not found`);
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
input: tool.inputSchema,
|
|
73
|
+
output: tool.outputSchema,
|
|
74
|
+
description: tool.description
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
generateSchemaDocumentation(schema, indent = ' ') {
|
|
78
|
+
let docs = '';
|
|
79
|
+
if (schema.description) {
|
|
80
|
+
docs += `${indent}// ${schema.description}\n`;
|
|
81
|
+
}
|
|
82
|
+
switch (schema.type) {
|
|
83
|
+
case 'ZodObject':
|
|
84
|
+
docs += `${indent}{\n`;
|
|
85
|
+
for (const [key, value] of Object.entries(schema.shape)) {
|
|
86
|
+
docs += `${indent} ${key}: ${this.generateSchemaDocumentation(value, indent + ' ')}\n`;
|
|
87
|
+
}
|
|
88
|
+
docs += `${indent}}`;
|
|
89
|
+
break;
|
|
90
|
+
case 'ZodString':
|
|
91
|
+
docs += `string`;
|
|
92
|
+
break;
|
|
93
|
+
case 'ZodNumber':
|
|
94
|
+
docs += `number`;
|
|
95
|
+
break;
|
|
96
|
+
case 'ZodBoolean':
|
|
97
|
+
docs += `boolean`;
|
|
98
|
+
break;
|
|
99
|
+
case 'ZodArray':
|
|
100
|
+
docs += `Array<${this.generateSchemaDocumentation(schema.element, indent)}>`;
|
|
101
|
+
break;
|
|
102
|
+
case 'ZodEnum':
|
|
103
|
+
docs += `${schema.values.map((v) => `"${v}"`).join(' | ')}`;
|
|
104
|
+
break;
|
|
105
|
+
default:
|
|
106
|
+
docs += `any`;
|
|
107
|
+
}
|
|
108
|
+
return docs;
|
|
109
|
+
}
|
|
110
|
+
generateExampleParams(schema, indent = ' ') {
|
|
111
|
+
let example = '';
|
|
112
|
+
if (schema.type === 'ZodObject') {
|
|
113
|
+
for (const [key, value] of Object.entries(schema.shape)) {
|
|
114
|
+
example += `${indent}${key}: `;
|
|
115
|
+
switch (value.type) {
|
|
116
|
+
case 'ZodString':
|
|
117
|
+
example += `"example_string"`;
|
|
118
|
+
break;
|
|
119
|
+
case 'ZodNumber':
|
|
120
|
+
example += `123`;
|
|
121
|
+
break;
|
|
122
|
+
case 'ZodBoolean':
|
|
123
|
+
example += `true`;
|
|
124
|
+
break;
|
|
125
|
+
case 'ZodArray':
|
|
126
|
+
example += `[]`;
|
|
127
|
+
break;
|
|
128
|
+
case 'ZodEnum':
|
|
129
|
+
example += `"${value.values[0]}"`;
|
|
130
|
+
break;
|
|
131
|
+
default:
|
|
132
|
+
example += `{}`;
|
|
133
|
+
}
|
|
134
|
+
example += `,\n`;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return example;
|
|
138
|
+
}
|
|
139
|
+
sanitizeMethodName(name) {
|
|
140
|
+
// First, convert to camelCase
|
|
141
|
+
const camelCase = name
|
|
142
|
+
.toLowerCase()
|
|
143
|
+
.replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : '')
|
|
144
|
+
.replace(/[^a-zA-Z0-9]/g, '');
|
|
145
|
+
// Ensure first character is lowercase
|
|
146
|
+
return camelCase.charAt(0).toLowerCase() + camelCase.slice(1);
|
|
147
|
+
}
|
|
148
|
+
async generateToolMethods() {
|
|
149
|
+
for (const [toolId, toolConfig] of this.toolsCache) {
|
|
150
|
+
const methodName = this.sanitizeMethodName(toolConfig.name);
|
|
151
|
+
this[methodName] = async (params) => {
|
|
152
|
+
try {
|
|
153
|
+
const inputSchema = (0, convertToVercelTool_1.convertHttpToolToVercelAITool)(toolConfig).parameters;
|
|
154
|
+
inputSchema.parse(params);
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
throw new Error(`Invalid parameters for ${toolConfig.name}: ${error.message}`);
|
|
158
|
+
}
|
|
159
|
+
return this.connection.callTool(toolId, params);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Returns the metadata about the connected service
|
|
165
|
+
*/
|
|
166
|
+
getServiceInfo() {
|
|
167
|
+
return this.metadata;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Returns all available tool configurations
|
|
171
|
+
*/
|
|
172
|
+
getAvailableTools() {
|
|
173
|
+
return Array.from(this.toolsCache.values());
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.DainSDK = DainSDK;
|
|
177
|
+
// Example usage with type safety:
|
|
178
|
+
/*
|
|
179
|
+
const auth = new DainClientAuth({ apiKey: 'your_api_key_here' });
|
|
180
|
+
const sdk = await new DainSDK('https://api.example.com', auth).initialize();
|
|
181
|
+
|
|
182
|
+
// TypeScript now knows about all available methods and their types
|
|
183
|
+
const result = await sdk.getWeather({
|
|
184
|
+
latitude: 40.7128,
|
|
185
|
+
longitude: -74.0060
|
|
186
|
+
});
|
|
187
|
+
*/
|
|
188
|
+
//# sourceMappingURL=api-sdk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-sdk.js","sourceRoot":"","sources":["../../src/client/api-sdk.ts"],"names":[],"mappings":";;;AAAA,qCAAiD;AAIjD,oEAA2E;AAmB3E,MAAa,OAAO;IACV,UAAU,CAAwB;IAClC,UAAU,GAA4B,IAAI,GAAG,EAAE,CAAC;IAChD,QAAQ,CAAmB;IAEnC,YAAY,OAAe,EAAE,IAAoB;QAC/C,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAqB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,UAAU;QACd,6BAA6B;QAC7B,IAAI,CAAC,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,WAAW,EAAE,CAAC;QAEpD,kBAAkB;QAClB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;QAC/C,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC,CAAC;QAE1D,wCAAwC;QACxC,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAEjC,OAAO,IAAsD,CAAC;IAChE,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,gBAAgB;QACpB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAC;QACnE,CAAC;QAED,IAAI,IAAI,GAAG,KAAK,IAAI,CAAC,QAAQ,CAA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AwMC;AAED,kCAAkC;AAClC;;;;;;;;;EASE"}
|
package/dist/client/index.d.ts
CHANGED
package/dist/client/index.js
CHANGED
|
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./client"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./client-auth"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./api-sdk"), exports);
|
|
6
7
|
//# sourceMappingURL=index.js.map
|
package/dist/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,wDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":";;;AAAA,mDAAyB;AACzB,wDAA8B;AAC9B,oDAA0B"}
|