@inkeep/agents-sdk 0.0.0-dev-20260117173149 → 0.0.0-dev-20260117201141

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.
@@ -13,271 +13,260 @@ import { CredentialReferenceApiInsert, MCPToolConfig } from "@inkeep/agents-core
13
13
  //#region src/builderFunctions.d.ts
14
14
 
15
15
  /**
16
- * Helper function to create agent - OpenAI style
17
- */
16
+ * Helper function to create agent - OpenAI style
17
+ */
18
18
  declare function agent(config: AgentConfig): Agent;
19
19
  /**
20
- * Helper function to create projects - OpenAI style
21
- *
22
- * Projects are the top-level organizational unit that contains Agents, Sub Agents, and shared configurations.
23
- * They provide model inheritance and execution limits that cascade down to Agents and Sub Agents.
24
- *
25
- * @param config - Project configuration
26
- * @returns A new Project instance
27
- *
28
- * @example
29
- * ```typescript
30
- * const customerSupport = project({
31
- * id: 'customer-support-project',
32
- * name: 'Customer Support System',
33
- * description: 'Multi-agent customer support system',
34
- * models: {
35
- * base: { model: 'gpt-4.1-mini' },
36
- * structuredOutput: { model: 'gpt-4.1' }
37
- * },
38
- * stopWhen: {
39
- * transferCountIs: 10,
40
- * stepCountIs: 50
41
- * },
42
- * agent: () => [
43
- * agent({
44
- * id: 'support-agent',
45
- * name: 'Support Agent',
46
- * // ... agent config
47
- * })
48
- * ]
49
- * });
50
- * ```
51
- */
20
+ * Helper function to create projects - OpenAI style
21
+ *
22
+ * Projects are the top-level organizational unit that contains Agents, Sub Agents, and shared configurations.
23
+ * They provide model inheritance and execution limits that cascade down to Agents and Sub Agents.
24
+ *
25
+ * @param config - Project configuration
26
+ * @returns A new Project instance
27
+ *
28
+ * @example
29
+ * ```typescript
30
+ * const customerSupport = project({
31
+ * id: 'customer-support-project',
32
+ * name: 'Customer Support System',
33
+ * description: 'Multi-agent customer support system',
34
+ * models: {
35
+ * base: { model: 'gpt-4.1-mini' },
36
+ * structuredOutput: { model: 'gpt-4.1' }
37
+ * },
38
+ * stopWhen: {
39
+ * transferCountIs: 10,
40
+ * stepCountIs: 50
41
+ * },
42
+ * agent: () => [
43
+ * agent({
44
+ * id: 'support-agent',
45
+ * name: 'Support Agent',
46
+ * // ... agent config
47
+ * })
48
+ * ]
49
+ * });
50
+ * ```
51
+ */
52
52
  declare function project(config: ProjectConfig): Project;
53
53
  /**
54
- * Creates a new agent with stable ID enforcement.
55
- *
56
- * Agents require explicit stable IDs to ensure consistency across deployments.
57
- * This is different from tools which auto-generate IDs from their names.
58
- *
59
- * @param config - Agent configuration including required stable ID
60
- * @returns A new SubAgent instance
61
- * @throws {Error} If config.id is not provided
62
- *
63
- * @example
64
- * ```typescript
65
- * const myAgent = agent({
66
- * id: 'customer-support-agent',
67
- * name: 'Customer Support',
68
- * prompt: 'Help customers with their questions'
69
- * });
70
- * ```
71
- */
54
+ * Creates a new agent with stable ID enforcement.
55
+ *
56
+ * Agents require explicit stable IDs to ensure consistency across deployments.
57
+ * This is different from tools which auto-generate IDs from their names.
58
+ *
59
+ * @param config - Agent configuration including required stable ID
60
+ * @returns A new SubAgent instance
61
+ * @throws {Error} If config.id is not provided
62
+ *
63
+ * @example
64
+ * ```typescript
65
+ * const myAgent = agent({
66
+ * id: 'customer-support-agent',
67
+ * name: 'Customer Support',
68
+ * prompt: 'Help customers with their questions'
69
+ * });
70
+ * ```
71
+ */
72
72
  declare function subAgent(config: SubAgentConfig): SubAgent;
73
73
  /**
74
- * Creates a credential reference for authentication.
75
- *
76
- * Credentials are used to authenticate with external services.
77
- * They should be stored securely and referenced by ID.
78
- *
79
- * @param config - Credential configuration
80
- * @returns A validated credential reference
81
- *
82
- * @example
83
- * ```typescript
84
- * const apiCredential = credential({
85
- * id: 'github-token',
86
- * name: 'GitHub Token',
87
- * type: 'bearer',
88
- * value: process.env.GITHUB_TOKEN
89
- * });
90
- * ```
91
- */
92
- declare function credential(config: CredentialReferenceApiInsert): {
93
- name: string;
94
- id: string;
95
- credentialStoreId: string;
96
- type: "memory" | "keychain" | "nango";
97
- createdAt?: string | undefined;
98
- updatedAt?: string | undefined;
99
- userId?: string | null | undefined;
100
- toolId?: string | null | undefined;
101
- retrievalParams?: Record<string, unknown> | null | undefined;
102
- createdBy?: string | null | undefined;
103
- };
74
+ * Creates a credential reference for authentication.
75
+ *
76
+ * Credentials are used to authenticate with external services.
77
+ * They should be stored securely and referenced by ID.
78
+ *
79
+ * @param config - Credential configuration
80
+ * @returns A validated credential reference
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * const apiCredential = credential({
85
+ * id: 'github-token',
86
+ * name: 'GitHub Token',
87
+ * type: 'bearer',
88
+ * value: process.env.GITHUB_TOKEN
89
+ * });
90
+ * ```
91
+ */
92
+ declare function credential(config: CredentialReferenceApiInsert): CredentialReferenceApiInsert;
104
93
  /**
105
- * Creates an MCP (Model Context Protocol) server for tool functionality.
106
- *
107
- * MCP servers provide tool functionality through a standardized protocol.
108
- * They can be remote services accessed via HTTP/WebSocket.
109
- *
110
- * @param config - MCP server configuration
111
- * @returns A Tool instance configured as an MCP server
112
- * @throws {Error} If serverUrl is not provided
113
- *
114
- * @example
115
- * ```typescript
116
- * // Remote MCP server
117
- * const apiServer = mcpServer({
118
- * name: 'external_api',
119
- * description: 'External API service',
120
- * serverUrl: 'https://api.example.com/mcp'
121
- * });
122
- *
123
- * // With authentication
124
- * const secureServer = mcpServer({
125
- * name: 'secure_api',
126
- * description: 'Secure API service',
127
- * serverUrl: 'https://secure.example.com/mcp',
128
- * credential: credential({
129
- * id: 'api-key',
130
- * name: 'API Key',
131
- * type: 'bearer',
132
- * value: process.env.API_KEY
133
- * })
134
- * });
135
- * ```
136
- */
94
+ * Creates an MCP (Model Context Protocol) server for tool functionality.
95
+ *
96
+ * MCP servers provide tool functionality through a standardized protocol.
97
+ * They can be remote services accessed via HTTP/WebSocket.
98
+ *
99
+ * @param config - MCP server configuration
100
+ * @returns A Tool instance configured as an MCP server
101
+ * @throws {Error} If serverUrl is not provided
102
+ *
103
+ * @example
104
+ * ```typescript
105
+ * // Remote MCP server
106
+ * const apiServer = mcpServer({
107
+ * name: 'external_api',
108
+ * description: 'External API service',
109
+ * serverUrl: 'https://api.example.com/mcp'
110
+ * });
111
+ *
112
+ * // With authentication
113
+ * const secureServer = mcpServer({
114
+ * name: 'secure_api',
115
+ * description: 'Secure API service',
116
+ * serverUrl: 'https://secure.example.com/mcp',
117
+ * credential: credential({
118
+ * id: 'api-key',
119
+ * name: 'API Key',
120
+ * type: 'bearer',
121
+ * value: process.env.API_KEY
122
+ * })
123
+ * });
124
+ * ```
125
+ */
137
126
  declare function mcpServer(config: MCPServerConfig): Tool;
138
127
  /**
139
- * Creates an MCP tool from a raw configuration object.
140
- *
141
- * This is a low-level builder for advanced use cases where you need
142
- * full control over the MCPToolConfig. For most cases, use `mcpServer()`.
143
- *
144
- * @param config - Complete MCP tool configuration
145
- * @returns A Tool instance
146
- *
147
- * @example
148
- * ```typescript
149
- * const customTool = mcpTool({
150
- * id: 'custom-tool',
151
- * name: 'Custom Tool',
152
- * serverUrl: 'https://example.com/mcp',
153
- * transport: { type: 'stdio' }
154
- * });
155
- * ```
156
- */
128
+ * Creates an MCP tool from a raw configuration object.
129
+ *
130
+ * This is a low-level builder for advanced use cases where you need
131
+ * full control over the MCPToolConfig. For most cases, use `mcpServer()`.
132
+ *
133
+ * @param config - Complete MCP tool configuration
134
+ * @returns A Tool instance
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * const customTool = mcpTool({
139
+ * id: 'custom-tool',
140
+ * name: 'Custom Tool',
141
+ * serverUrl: 'https://example.com/mcp',
142
+ * transport: { type: 'stdio' }
143
+ * });
144
+ * ```
145
+ */
157
146
  declare function mcpTool(config: MCPToolConfig): Tool;
158
147
  /**
159
- * Creates an artifact component with automatic ID generation.
160
- *
161
- * Artifact components represent structured UI components that can
162
- * be rendered with different levels of detail (summary vs full).
163
- *
164
- * @param config - Artifact component configuration
165
- * @returns An ArtifactComponent instance
166
- *
167
- * @example
168
- * ```typescript
169
- * const productCard = artifactComponent({
170
- * name: 'Product Card',
171
- * description: 'Display product information',
172
- * props: {
173
- * type: 'object',
174
- * properties: {
175
- * title: { type: 'string', inPreview: true },
176
- * price: { type: 'string', inPreview: true },
177
- * description: { type: 'string' },
178
- * image: { type: 'string' }
179
- * }
180
- * }
181
- * });
182
- * ```
183
- */
148
+ * Creates an artifact component with automatic ID generation.
149
+ *
150
+ * Artifact components represent structured UI components that can
151
+ * be rendered with different levels of detail (summary vs full).
152
+ *
153
+ * @param config - Artifact component configuration
154
+ * @returns An ArtifactComponent instance
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * const productCard = artifactComponent({
159
+ * name: 'Product Card',
160
+ * description: 'Display product information',
161
+ * props: {
162
+ * type: 'object',
163
+ * properties: {
164
+ * title: { type: 'string', inPreview: true },
165
+ * price: { type: 'string', inPreview: true },
166
+ * description: { type: 'string' },
167
+ * image: { type: 'string' }
168
+ * }
169
+ * }
170
+ * });
171
+ * ```
172
+ */
184
173
  declare function artifactComponent(config: ArtifactComponentConfig): ArtifactComponent;
185
174
  /**
186
- * Creates a data component with automatic ID generation.
187
- *
188
- * Data components represent structured data that can be
189
- * passed between agents or used in processing.
190
- *
191
- * @param config - Data component configuration
192
- * @returns A DataComponent instance
193
- *
194
- * @example
195
- * ```typescript
196
- * const userProfile = dataComponent({
197
- * name: 'User Profile',
198
- * description: 'User profile data',
199
- * props: {
200
- * userId: '123',
201
- * name: 'John Doe',
202
- * email: 'john@example.com'
203
- * }
204
- * });
205
- * ```
206
- */
175
+ * Creates a data component with automatic ID generation.
176
+ *
177
+ * Data components represent structured data that can be
178
+ * passed between agents or used in processing.
179
+ *
180
+ * @param config - Data component configuration
181
+ * @returns A DataComponent instance
182
+ *
183
+ * @example
184
+ * ```typescript
185
+ * const userProfile = dataComponent({
186
+ * name: 'User Profile',
187
+ * description: 'User profile data',
188
+ * props: {
189
+ * userId: '123',
190
+ * name: 'John Doe',
191
+ * email: 'john@example.com'
192
+ * }
193
+ * });
194
+ * ```
195
+ */
207
196
  declare function dataComponent(config: DataComponentConfig): DataComponent;
208
197
  /**
209
- * Creates a status component for structured status updates.
210
- *
211
- * Status components define the structure of status updates
212
- * that agents can generate during long-running operations.
213
- *
214
- * @param config - Status component configuration
215
- * @returns A StatusComponent instance
216
- *
217
- * @example
218
- * ```typescript
219
- * import { z } from 'zod';
220
- *
221
- * const toolCallStatus = statusComponent({
222
- * type: 'tool_call_summary',
223
- * description: 'Summary of a tool execution',
224
- * detailsSchema: z.object({
225
- * tool_name: z.string(),
226
- * summary: z.string(),
227
- * status: z.enum(['success', 'error', 'in_progress'])
228
- * })
229
- * });
230
- * ```
231
- */
198
+ * Creates a status component for structured status updates.
199
+ *
200
+ * Status components define the structure of status updates
201
+ * that agents can generate during long-running operations.
202
+ *
203
+ * @param config - Status component configuration
204
+ * @returns A StatusComponent instance
205
+ *
206
+ * @example
207
+ * ```typescript
208
+ * import { z } from 'zod';
209
+ *
210
+ * const toolCallStatus = statusComponent({
211
+ * type: 'tool_call_summary',
212
+ * description: 'Summary of a tool execution',
213
+ * detailsSchema: z.object({
214
+ * tool_name: z.string(),
215
+ * summary: z.string(),
216
+ * status: z.enum(['success', 'error', 'in_progress'])
217
+ * })
218
+ * });
219
+ * ```
220
+ */
232
221
  declare function statusComponent(config: StatusComponentConfig): StatusComponent$1;
233
222
  /**
234
- * (deprecated in favor of mcpTool.with()) Creates an agent MCP configuration.
235
- *
236
- * Agent MCP configurations are used to configure the MCP server for an agent.
237
- *
238
- * @param config - Agent MCP configuration
239
- * @returns An AgentMcpConfig instance
240
- */
223
+ * (deprecated in favor of mcpTool.with()) Creates an agent MCP configuration.
224
+ *
225
+ * Agent MCP configurations are used to configure the MCP server for an agent.
226
+ *
227
+ * @param config - Agent MCP configuration
228
+ * @returns An AgentMcpConfig instance
229
+ */
241
230
  declare function agentMcp(config: AgentMcpConfig): AgentMcpConfig;
242
231
  /**
243
- * Creates a function tool that executes user-defined code in a sandboxed environment.
244
- *
245
- * Function tools allow users to define custom logic that runs securely in isolated
246
- * environments. Dependencies are installed automatically in the sandbox.
247
- *
248
- * @param config - Function tool configuration
249
- * @returns A FunctionTool instance
250
- *
251
- * @example
252
- * ```typescript
253
- * const calculatorTool = functionTool({
254
- * name: 'calculator',
255
- * description: 'Performs basic math operations',
256
- * inputSchema: {
257
- * type: 'object',
258
- * properties: {
259
- * operation: { type: 'string', enum: ['add', 'subtract', 'multiply', 'divide'] },
260
- * a: { type: 'number' },
261
- * b: { type: 'number' }
262
- * },
263
- * required: ['operation', 'a', 'b']
264
- * },
265
- * dependencies: {
266
- * 'lodash': '^4.17.21'
267
- * },
268
- * execute: async (params) => {
269
- * const { operation, a, b } = params;
270
- * switch (operation) {
271
- * case 'add': return { result: a + b };
272
- * case 'subtract': return { result: a - b };
273
- * case 'multiply': return { result: a * b };
274
- * case 'divide': return { result: a / b };
275
- * default: throw new Error(`Unknown operation: ${operation}`);
276
- * }
277
- * }
278
- * });
279
- * ```
280
- */
232
+ * Creates a function tool that executes user-defined code in a sandboxed environment.
233
+ *
234
+ * Function tools allow users to define custom logic that runs securely in isolated
235
+ * environments. Dependencies are installed automatically in the sandbox.
236
+ *
237
+ * @param config - Function tool configuration
238
+ * @returns A FunctionTool instance
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * const calculatorTool = functionTool({
243
+ * name: 'calculator',
244
+ * description: 'Performs basic math operations',
245
+ * inputSchema: {
246
+ * type: 'object',
247
+ * properties: {
248
+ * operation: { type: 'string', enum: ['add', 'subtract', 'multiply', 'divide'] },
249
+ * a: { type: 'number' },
250
+ * b: { type: 'number' }
251
+ * },
252
+ * required: ['operation', 'a', 'b']
253
+ * },
254
+ * dependencies: {
255
+ * 'lodash': '^4.17.21'
256
+ * },
257
+ * execute: async (params) => {
258
+ * const { operation, a, b } = params;
259
+ * switch (operation) {
260
+ * case 'add': return { result: a + b };
261
+ * case 'subtract': return { result: a - b };
262
+ * case 'multiply': return { result: a * b };
263
+ * case 'divide': return { result: a / b };
264
+ * default: throw new Error(`Unknown operation: ${operation}`);
265
+ * }
266
+ * }
267
+ * });
268
+ * ```
269
+ */
281
270
  declare function functionTool(config: FunctionToolConfig): FunctionTool;
282
271
  //#endregion
283
272
  export { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, statusComponent, subAgent };
@@ -1,22 +1,22 @@
1
1
  //#region src/builderFunctionsExperimental.d.ts
2
2
  /**
3
- * Creates an agent relation configuration.
4
- *
5
- * Relations define how agents can interact with each other.
6
- * Transfer relations allow transfers, while delegate relations
7
- * allow temporary task delegation.
8
- *
9
- * @param targetAgent - The ID of the target agent
10
- * @param relationType - The type of relation (transfer or delegate)
11
- * @returns An agent relation configuration
12
- *
13
- * @example
14
- * ```typescript
15
- * const transferRelation = agentRelation('support-agent', 'transfer');
16
- * const delegateRelation = agentRelation('specialist-agent', 'delegate');
17
- * ```
18
- */
19
- declare function agentRelation(targetAgent: string, relationType?: 'transfer' | 'delegate'): {
3
+ * Creates an agent relation configuration.
4
+ *
5
+ * Relations define how agents can interact with each other.
6
+ * Transfer relations allow transfers, while delegate relations
7
+ * allow temporary task delegation.
8
+ *
9
+ * @param targetAgent - The ID of the target agent
10
+ * @param relationType - The type of relation (transfer or delegate)
11
+ * @returns An agent relation configuration
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * const transferRelation = agentRelation('support-agent', 'transfer');
16
+ * const delegateRelation = agentRelation('specialist-agent', 'delegate');
17
+ * ```
18
+ */
19
+ declare function agentRelation(targetAgent: string, relationType?: "transfer" | "delegate"): {
20
20
  targetAgent: string;
21
21
  relationType: "transfer" | "delegate";
22
22
  };