@blindmarket/sdk 0.1.8 → 0.5.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.
Files changed (89) hide show
  1. package/dist/executor/WorkerRuntime.d.ts +21 -0
  2. package/dist/executor/WorkerRuntime.js +56 -27
  3. package/dist/index.d.ts +75 -9
  4. package/dist/index.js +54 -5
  5. package/dist/tools/helpers.js +14 -5
  6. package/dist/types.d.ts +7 -2
  7. package/package.json +8 -1
  8. package/biome.json +0 -19
  9. package/examples/agent-demo.ts +0 -121
  10. package/scripts/gen-crypto-fixtures.mjs +0 -72
  11. package/src/agent/Agent.ts +0 -122
  12. package/src/agent/index.ts +0 -1
  13. package/src/api/index.ts +0 -1
  14. package/src/chain/BlindEscrowClient.ts +0 -196
  15. package/src/chain/BlindReputationClient.ts +0 -60
  16. package/src/chain/ChainClient.ts +0 -65
  17. package/src/chain/IBlindMarketChain.ts +0 -109
  18. package/src/chain/TaskRegistryClient.ts +0 -91
  19. package/src/chain/abi/BlindEscrow.json +0 -1113
  20. package/src/chain/abi/BlindReputation.json +0 -447
  21. package/src/chain/abi/TaskRegistry.json +0 -586
  22. package/src/chain/abi/index.ts +0 -5
  23. package/src/chain/createChainAdapter.ts +0 -40
  24. package/src/chain/domain-types.ts +0 -92
  25. package/src/chain/errors.ts +0 -43
  26. package/src/chain/evm/EVMChainAdapter.ts +0 -212
  27. package/src/chain/evm/index.ts +0 -1
  28. package/src/chain/index.ts +0 -12
  29. package/src/compute/index.ts +0 -1
  30. package/src/crypto/aes.ts +0 -104
  31. package/src/crypto/constants.ts +0 -7
  32. package/src/crypto/ecies.ts +0 -60
  33. package/src/crypto/envelope.ts +0 -131
  34. package/src/crypto/hkdf.ts +0 -45
  35. package/src/crypto/index.ts +0 -6
  36. package/src/crypto/keys.ts +0 -56
  37. package/src/errors/BlindMarketError.ts +0 -38
  38. package/src/errors/codes.ts +0 -67
  39. package/src/errors/index.ts +0 -3
  40. package/src/errors/subclasses.ts +0 -59
  41. package/src/events/EventBus.ts +0 -45
  42. package/src/events/index.ts +0 -2
  43. package/src/events/types.ts +0 -13
  44. package/src/executor/WorkerRuntime.ts +0 -338
  45. package/src/executor/index.ts +0 -8
  46. package/src/index.ts +0 -636
  47. package/src/keystore/InMemoryKeyStore.ts +0 -146
  48. package/src/keystore/KeyStore.ts +0 -19
  49. package/src/keystore/index.ts +0 -2
  50. package/src/network/index.ts +0 -3
  51. package/src/network/presets.ts +0 -66
  52. package/src/network/resolve.ts +0 -31
  53. package/src/network/types.ts +0 -20
  54. package/src/signer/EthersSigner.ts +0 -82
  55. package/src/signer/PrivateKeySigner.ts +0 -19
  56. package/src/signer/Signer.ts +0 -40
  57. package/src/signer/index.ts +0 -3
  58. package/src/storage/MemoryStorage.ts +0 -49
  59. package/src/storage/Storage.ts +0 -15
  60. package/src/storage/ZgStorage.ts +0 -124
  61. package/src/storage/index.ts +0 -3
  62. package/src/testing/index.ts +0 -1
  63. package/src/tools/adapters.ts +0 -177
  64. package/src/tools/helpers.ts +0 -199
  65. package/src/tools/index.ts +0 -59
  66. package/src/tools/types.ts +0 -47
  67. package/src/types.ts +0 -297
  68. package/src/verifier/index.ts +0 -1
  69. package/src/worker/Worker.ts +0 -98
  70. package/src/worker/index.ts +0 -1
  71. package/test/agent.test.ts +0 -193
  72. package/test/chain.test.ts +0 -145
  73. package/test/crypto.aes.test.ts +0 -81
  74. package/test/crypto.compat.test.ts +0 -33
  75. package/test/crypto.ecies.test.ts +0 -64
  76. package/test/envelope.test.ts +0 -82
  77. package/test/errors.test.ts +0 -64
  78. package/test/events.test.ts +0 -59
  79. package/test/fixtures/crypto.json +0 -16
  80. package/test/keystore.test.ts +0 -103
  81. package/test/network.test.ts +0 -53
  82. package/test/signer.test.ts +0 -66
  83. package/test/smoke.test.ts +0 -7
  84. package/test/storage.test.ts +0 -55
  85. package/test/worker.test.ts +0 -181
  86. package/tsconfig.build.json +0 -1
  87. package/tsconfig.json +0 -14
  88. package/tsup.config.ts +0 -32
  89. package/vitest.config.ts +0 -17
@@ -1,177 +0,0 @@
1
- /**
2
- * Framework adapters — convert BlindMarket tools into ready-to-use tool arrays
3
- * for each major agent SDK. No manual schema conversion needed.
4
- *
5
- * @example
6
- * ```ts
7
- * // LangChain
8
- * import { toLangChainTools } from '@blindmarket/sdk/tools';
9
- * const tools = toLangChainTools(bb);
10
- *
11
- * // Vercel AI SDK
12
- * import { toVercelTools } from '@blindmarket/sdk/tools';
13
- * const tools = toVercelTools(bb);
14
- * ```
15
- */
16
-
17
- import type { BlindMarket } from '../index.js';
18
- import { createBlindMarketTools } from './helpers.js';
19
- import type { Tool } from './types.js';
20
-
21
- export type { Tool, ToolKit, ToolDefinition } from './types.js';
22
-
23
- // ── LangChain adapter ───────────────────────────────────────────────────────
24
-
25
- export interface LangChainStructuredTool {
26
- name: string;
27
- description: string;
28
- schema: { shape: Record<string, unknown>; parse: (raw: unknown) => Record<string, unknown> };
29
- func: (args: Record<string, unknown>) => Promise<string>;
30
- }
31
-
32
- /**
33
- * Convert BlindMarket tools to LangChain `DynamicStructuredTool`-compatible objects.
34
- * Pass them directly into `createReactAgent`, `initializeAgentExecutorWithOptions`, etc.
35
- *
36
- * ```ts
37
- * import { ChatOpenAI } from '@langchain/openai';
38
- * import { createReactAgent } from '@langchain/langgraph/prebuilt';
39
- *
40
- * const tools = toLangChainTools(bb);
41
- * const agent = createReactAgent({ llm: new ChatOpenAI({ model: 'gpt-4' }), tools });
42
- * ```
43
- */
44
- export function toLangChainTools(bb: BlindMarket): LangChainStructuredTool[] {
45
- return createBlindMarketTools(bb).map(mapToLangChain);
46
- }
47
-
48
- function mapToLangChain(t: Tool): LangChainStructuredTool {
49
- const shape: Record<string, unknown> = {};
50
- const props = t.definition.function.parameters.properties;
51
- const required = t.definition.function.parameters.required ?? [];
52
-
53
- for (const [key, prop] of Object.entries(props)) {
54
- const p = prop as any;
55
- const type = p.type === 'number' ? 'number'
56
- : p.type === 'array' ? 'array'
57
- : 'string';
58
- shape[key] = { type, enum: p.enum, required: required.includes(key) };
59
- }
60
-
61
- return {
62
- name: t.definition.function.name,
63
- description: t.definition.function.description,
64
- schema: {
65
- shape,
66
- parse: (raw: unknown) => raw as Record<string, unknown>,
67
- },
68
- func: async (args) => JSON.stringify(await t.execute(args)),
69
- };
70
- }
71
-
72
- // ── Vercel AI SDK adapter ──────────────────────────────────────────────────
73
-
74
- export interface VercelTool {
75
- description: string;
76
- parameters: {
77
- type: 'object';
78
- properties: Record<string, { type: string; description?: string; enum?: string[] }>;
79
- required?: string[];
80
- };
81
- execute: (args: Record<string, unknown>) => Promise<unknown>;
82
- }
83
-
84
- /**
85
- * Convert BlindMarket tools to Vercel AI SDK `tool()` compatible objects.
86
- *
87
- * ```ts
88
- * import { generateText } from 'ai';
89
- * import { openai } from '@ai-sdk/openai';
90
- *
91
- * const tools = toVercelTools(bb);
92
- * const { text } = await generateText({ model: openai('gpt-4'), tools });
93
- * ```
94
- */
95
- export function toVercelTools(bb: BlindMarket): Record<string, VercelTool> {
96
- const result: Record<string, VercelTool> = {};
97
- for (const t of createBlindMarketTools(bb)) {
98
- const props = t.definition.function.parameters.properties;
99
- const required = t.definition.function.parameters.required;
100
-
101
- const converted: Record<string, { type: string; description?: string; enum?: string[] }> = {};
102
- for (const [key, prop] of Object.entries(props)) {
103
- const p = prop as any;
104
- converted[key] = {
105
- type: p.type === 'number' ? 'number' : p.type === 'array' ? 'array' : 'string',
106
- description: p.description,
107
- ...(p.enum ? { enum: p.enum } : {}),
108
- };
109
- }
110
-
111
- result[t.definition.function.name] = {
112
- description: t.definition.function.description,
113
- parameters: { type: 'object', properties: converted, required },
114
- execute: (args) => t.execute(args),
115
- };
116
- }
117
- return result;
118
- }
119
-
120
- // ── OpenAI adapter ──────────────────────────────────────────────────────────
121
-
122
- /**
123
- * Get raw OpenAI-compatible tool definitions.
124
- *
125
- * ```ts
126
- * const tools = toOpenAITools(bb);
127
- * const response = await openai.chat.completions.create({ model: 'gpt-4', tools });
128
- * ```
129
- */
130
- export function toOpenAITools(bb: BlindMarket) {
131
- return createBlindMarketTools(bb).map(t => t.definition);
132
- }
133
-
134
- // ── Claude (Anthropic SDK) adapter ─────────────────────────────────────────
135
-
136
- export interface ClaudeTool {
137
- name: string;
138
- description: string;
139
- input_schema: {
140
- type: 'object';
141
- properties: Record<string, { type: string; description?: string; enum?: string[] }>;
142
- required?: string[];
143
- };
144
- }
145
-
146
- /**
147
- * Convert BlindMarket tools to Claude SDK tool format.
148
- *
149
- * ```ts
150
- * const tools = toClaudeTools(bb);
151
- * const response = await anthropic.messages.create({
152
- * model: 'claude-sonnet-4-20250514',
153
- * tools,
154
- * messages: [{ role: 'user', content: 'Find tasks' }],
155
- * });
156
- * ```
157
- */
158
- export function toClaudeTools(bb: BlindMarket): ClaudeTool[] {
159
- return createBlindMarketTools(bb).map(t => {
160
- const props = t.definition.function.parameters.properties;
161
- const required = t.definition.function.parameters.required;
162
- const converted: Record<string, { type: string; description?: string; enum?: string[] }> = {};
163
- for (const [key, prop] of Object.entries(props)) {
164
- const p = prop as any;
165
- converted[key] = {
166
- type: p.type === 'number' ? 'number' : p.type === 'array' ? 'array' : 'string',
167
- description: p.description,
168
- ...(p.enum ? { enum: p.enum } : {}),
169
- };
170
- }
171
- return {
172
- name: t.definition.function.name,
173
- description: t.definition.function.description,
174
- input_schema: { type: 'object', properties: converted, required },
175
- };
176
- });
177
- }
@@ -1,199 +0,0 @@
1
- import { BlindMarket } from '../index.js';
2
- import type { Tool, ToolKit, ToolDefinition } from './types.js';
3
- import { AgentCap } from '../types.js';
4
-
5
- const CAP_ENUM = Object.values(AgentCap);
6
-
7
- function def(
8
- name: string,
9
- description: string,
10
- properties: Record<string, unknown>,
11
- required?: string[],
12
- ): ToolDefinition {
13
- return {
14
- type: 'function',
15
- function: { name, description, parameters: { type: 'object', properties: properties as any, required } },
16
- };
17
- }
18
-
19
- function str(desc: string, e?: string[]): unknown {
20
- return e ? { type: 'string', description: desc, enum: e } : { type: 'string', description: desc };
21
- }
22
- function num(desc: string): unknown {
23
- return { type: 'number', description: desc };
24
- }
25
- function arr(desc: string, items?: unknown): unknown {
26
- return items ? { type: 'array', description: desc, items } : { type: 'array', description: desc };
27
- }
28
-
29
- export function tool<T>(
30
- _bb: BlindMarket,
31
- name: string,
32
- description: string,
33
- properties: Record<string, unknown>,
34
- execute: (args: Record<string, any>) => Promise<T>,
35
- required?: string[],
36
- ): Tool<Record<string, any>, T> {
37
- return { definition: def(name, description, properties, required), execute };
38
- }
39
-
40
- export function kit(name: string, description: string, all: Tool[], names: string[]): ToolKit {
41
- const namesSet = new Set(names);
42
- return { name, description, tools: all.filter((t) => namesSet.has(t.definition.function.name)) };
43
- }
44
-
45
- export function createBlindMarketTools(bb: BlindMarket): Tool[] {
46
- return [
47
- tool(bb, 'list_open_tasks', 'List open tasks available for assignment', {}, async () => {
48
- return bb.listTasks();
49
- }),
50
- tool(bb, 'get_task', 'Get full task details by ID', { taskId: str('Numeric or 0x task ID') }, async (a) => {
51
- return bb.getTask(a.taskId);
52
- }, ['taskId']),
53
- tool(bb, 'search_agents', 'Search registered agents by capability or rating', {
54
- capability: str('Agent capability filter'),
55
- minRating: num('Minimum rating (1-5)'),
56
- }, async (a) => {
57
- return bb.searchAgents(a as any);
58
- }),
59
- tool(bb, 'create_agent', 'One-shot agent creation: generates wallet + registers as A2A executor', {
60
- displayName: str('Display name for the agent'),
61
- capabilities: arr('List of capabilities', str('Capability', CAP_ENUM)),
62
- minReward: str('Minimum reward per task in wei (optional)'),
63
- preferredCapabilities: arr('Preferred subset of capabilities (optional)', str('Capability', CAP_ENUM)),
64
- agentCardUrl: str('Agent card URL for marketplace display (optional)'),
65
- mcpEndpointUrl: str('MCP endpoint URL (optional)'),
66
- }, async (a) => {
67
- return bb.createAgent(a as any);
68
- }, ['displayName', 'capabilities']),
69
-
70
- tool(bb, 'register_as_executor', 'Register as an A2A executor to receive task offers', {
71
- address: str('Your wallet address (0x...)'),
72
- displayName: str('Human-readable display name'),
73
- capabilities: arr('List of capabilities', str('Capability', CAP_ENUM)),
74
- publicKey: str('Your uncompressed secp256k1 public key'),
75
- minReward: str('Minimum reward in wei (optional)'),
76
- preferredCapabilities: arr('Preferred subset of capabilities (optional)', str('Capability', CAP_ENUM)),
77
- }, async (a) => {
78
- return bb.registerExecutor(a as any);
79
- }, ['address', 'displayName', 'capabilities', 'publicKey']),
80
- tool(bb, 'browse_a2a_tasks', 'Browse tasks available for A2A execution', {
81
- capabilities: arr('Required capabilities filter'),
82
- minReputation: num('Minimum reputation filter'),
83
- }, async (a) => {
84
- return bb.browseA2ATasks(a as any);
85
- }),
86
- tool(bb, 'bid_on_task', 'Register bid intent on an A2A task', {
87
- taskId: str('Task ID'),
88
- }, async (a) => {
89
- await bb.bidOnTask(a.taskId);
90
- return { success: true };
91
- }, ['taskId']),
92
- tool(bb, 'accept_task', 'Accept a task and get the wrapped AES key', {
93
- taskId: str('Task ID'),
94
- }, async (a) => {
95
- return bb.acceptTask(a.taskId);
96
- }, ['taskId']),
97
- tool(bb, 'submit_result', 'Submit execution result for an accepted task', {
98
- taskId: str('Task ID'),
99
- output: str('Result output text'),
100
- }, async (a) => {
101
- return bb.submitResult(a.taskId, { output: a.output });
102
- }, ['taskId', 'output']),
103
-
104
- tool(bb, 'deploy_agent', 'Deploy a new AI agent on BlindMarket', {
105
- name: str('Agent name'),
106
- instructions: str('System prompt / instructions'),
107
- provider: str('LLM provider', ['openai', 'anthropic', 'groq', 'gemini']),
108
- model: str('Model name (e.g. gpt-4, claude-sonnet-4-5)'),
109
- apiKey: str('Provider API key'),
110
- ownerAddress: str('Owner wallet address (0x...)'),
111
- ownerPublicKey: str('Owner public key'),
112
- }, async (a) => {
113
- return bb.deployAgent(a as any);
114
- }, ['name', 'instructions', 'provider', 'model', 'apiKey', 'ownerAddress', 'ownerPublicKey']),
115
- tool(bb, 'list_agents', 'List deployed agents', {
116
- ownerAddress: str('Filter by owner address'),
117
- }, async (a) => {
118
- return bb.listAgents(a.ownerAddress);
119
- }),
120
- tool(bb, 'get_agent', 'Get single deployed agent details', {
121
- agentId: str('Agent ID'),
122
- }, async (a) => {
123
- return bb.getAgent(a.agentId);
124
- }, ['agentId']),
125
- tool(bb, 'start_agent', 'Start a deployed agent', {
126
- agentId: str('Agent ID'),
127
- }, async (a) => {
128
- return bb.startAgent(a.agentId);
129
- }, ['agentId']),
130
- tool(bb, 'stop_agent', 'Stop a deployed agent', {
131
- agentId: str('Agent ID'),
132
- }, async (a) => {
133
- return bb.stopAgent(a.agentId);
134
- }, ['agentId']),
135
- tool(bb, 'restart_agent', 'Restart a deployed agent', {
136
- agentId: str('Agent ID'),
137
- }, async (a) => {
138
- return bb.restartAgent(a.agentId);
139
- }, ['agentId']),
140
- tool(bb, 'update_agent', "Update a deployed agent's config", {
141
- agentId: str('Agent ID'),
142
- instructions: str('New instructions'),
143
- model: str('New model name'),
144
- capabilities: arr('New capabilities list', str('Capability')),
145
- }, async (a) => {
146
- return bb.updateAgent(a.agentId, a as any);
147
- }, ['agentId']),
148
-
149
- tool(bb, 'verify_task', 'Trigger AI/TEE verification for a submitted task result', {
150
- taskId: num('Numeric task ID'),
151
- taskCategory: str('Task category (e.g. photography, research)'),
152
- taskRequirements: str('What the task required'),
153
- evidenceSummary: str('Summary of submitted evidence'),
154
- }, async (a) => {
155
- return bb.verify(a as any);
156
- }, ['taskId', 'taskCategory', 'taskRequirements', 'evidenceSummary']),
157
-
158
- tool(bb, 'get_reputation', "Get an address's on-chain + off-chain reputation", {
159
- address: str('Wallet address (0x...)'),
160
- }, async (a) => {
161
- return bb.getReputation(a.address as any);
162
- }, ['address']),
163
-
164
- tool(bb, 'send_message', 'Send a message to a task participant', {
165
- taskId: str('Task ID'),
166
- to: str('Recipient address or "poster"/"agent" shortcut'),
167
- content: str('Message content'),
168
- }, async (a) => {
169
- return bb.sendMessage(a as any);
170
- }, ['taskId', 'to', 'content']),
171
- tool(bb, 'get_inbox', 'Read inbox messages', {}, async () => {
172
- return bb.getInbox();
173
- }),
174
- tool(bb, 'get_unread_count', 'Get unread message count', {}, async () => {
175
- return bb.getUnreadCount();
176
- }),
177
- ];
178
- }
179
-
180
- export function createTaskTools(bb: BlindMarket): ToolKit {
181
- return kit('tasks', 'Browse and manage tasks', createBlindMarketTools(bb), [
182
- 'list_open_tasks', 'get_task', 'bid_on_task', 'accept_task', 'submit_result',
183
- ]);
184
- }
185
-
186
- export function createAgentManagementTools(bb: BlindMarket): ToolKit {
187
- return kit('agents', 'Deploy and manage agents', createBlindMarketTools(bb), [
188
- 'deploy_agent', 'list_agents', 'get_agent', 'start_agent', 'stop_agent',
189
- 'restart_agent', 'update_agent', 'create_agent', 'register_as_executor',
190
- ]);
191
- }
192
-
193
- export function createA2ATools(bb: BlindMarket): ToolKit {
194
- return kit('a2a', 'Agent-to-agent task execution', createBlindMarketTools(bb), [
195
- 'create_agent', 'register_as_executor', 'browse_a2a_tasks', 'bid_on_task', 'accept_task', 'submit_result',
196
- ]);
197
- }
198
-
199
- export type { Tool, ToolKit, ToolDefinition } from './types.js';
@@ -1,59 +0,0 @@
1
- import { BlindMarket } from '../index.js';
2
- import {
3
- createBlindMarketTools, createTaskTools, createAgentManagementTools, createA2ATools,
4
- } from './helpers.js';
5
- import {
6
- toLangChainTools, toVercelTools, toClaudeTools,
7
- } from './adapters.js';
8
- import type { Tool, ToolKit, ToolDefinition } from './types.js';
9
-
10
- // ── Single entry-point ───────────────────────────────────────────────────────
11
-
12
- /**
13
- * Returns all framework tool formats from one call. No need to remember
14
- * `toLangChainTools`, `toVercelTools`, etc. — just pick a property.
15
- *
16
- * @example
17
- * ```ts
18
- * import { BlindMarket, tools } from '@blindmarket/sdk';
19
- * const bb = new BlindMarket({ apiKey });
20
- *
21
- * // OpenAI / Vercel
22
- * openai.chat.completions.create({ model: 'gpt-4', tools: tools(bb).definitions });
23
- *
24
- * // LangChain
25
- * createReactAgent({ llm, tools: tools(bb).langchain });
26
- *
27
- * // Claude
28
- * anthropic.messages.create({ model, tools: tools(bb).claude });
29
- * ```
30
- */
31
- export function tools(bb: BlindMarket): BlindMarketTools {
32
- const all = createBlindMarketTools(bb);
33
- const definitions = all.map(t => t.definition);
34
- const langchain = toLangChainTools(bb);
35
- const vercel = toVercelTools(bb);
36
- const claude = toClaudeTools(bb);
37
- return { definitions, langchain, vercel, claude };
38
- }
39
-
40
- export interface BlindMarketTools {
41
- /** OpenAI-compatible tool definitions (array of `{type, function}`). */
42
- definitions: ToolDefinition[];
43
- /** LangChain `StructuredTool` instances. */
44
- langchain: ReturnType<typeof toLangChainTools>;
45
- /** Vercel AI SDK tool map (`Record<string, VercelTool>`). */
46
- vercel: ReturnType<typeof toVercelTools>;
47
- /** Claude tool shapes (`{name, description, input_schema}[]`). */
48
- claude: ReturnType<typeof toClaudeTools>;
49
- }
50
-
51
- // ── Re-exports ───────────────────────────────────────────────────────────────
52
-
53
- export type { Tool, ToolKit, ToolDefinition } from './types.js';
54
- export {
55
- createBlindMarketTools, createTaskTools, createAgentManagementTools, createA2ATools,
56
- } from './helpers.js';
57
- export {
58
- toLangChainTools, toVercelTools, toOpenAITools, toClaudeTools,
59
- } from './adapters.js';
@@ -1,47 +0,0 @@
1
- /**
2
- * OpenAI-compatible function tool definition.
3
- * Every major agent SDK can consume this format:
4
- * - **OpenAI** — native function calling
5
- * - **Claude** — tool_use format (convert name → tool name)
6
- * - **Vercel AI SDK** — pass into `toolset` helper
7
- * - **LangChain** — convert via `DynamicStructuredTool`
8
- * - **OpenAI Agents SDK** — pass as `FunctionTool`
9
- */
10
- export interface ToolDefinition {
11
- type: 'function';
12
- function: {
13
- name: string;
14
- description: string;
15
- parameters: {
16
- type: 'object';
17
- properties: Record<string, JSONSchemaProperty>;
18
- required?: string[];
19
- };
20
- };
21
- }
22
-
23
- export type JSONSchemaProperty = {
24
- type: 'string' | 'number' | 'boolean' | 'array' | 'object';
25
- description?: string;
26
- enum?: string[];
27
- items?: JSONSchemaProperty;
28
- properties?: Record<string, JSONSchemaProperty>;
29
- required?: string[];
30
- };
31
-
32
- /**
33
- * A bound tool — ready to invoke with parsed args.
34
- */
35
- export interface Tool<TArgs = Record<string, unknown>, TResult = unknown> {
36
- definition: ToolDefinition;
37
- execute: (args: TArgs) => Promise<TResult>;
38
- }
39
-
40
- /**
41
- * Collection of tools grouped by domain.
42
- */
43
- export interface ToolKit {
44
- name: string;
45
- description: string;
46
- tools: Tool[];
47
- }