@inkeep/agents-sdk 0.41.2 → 0.43.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 (43) hide show
  1. package/README.md +356 -2
  2. package/dist/agent.d.ts +84 -73
  3. package/dist/agent.js +42 -4
  4. package/dist/agentFullClient.d.ts +8 -8
  5. package/dist/agentFullClient.js +4 -4
  6. package/dist/artifact-component.d.ts +8 -8
  7. package/dist/artifact-component.js +2 -2
  8. package/dist/builderFunctions.d.ts +337 -248
  9. package/dist/builderFunctions.js +131 -2
  10. package/dist/builderFunctionsExperimental.d.ts +17 -17
  11. package/dist/builders.d.ts +48 -48
  12. package/dist/credential-provider.d.ts +93 -93
  13. package/dist/credential-provider.js +1 -1
  14. package/dist/credential-ref.d.ts +37 -37
  15. package/dist/data-component.d.ts +9 -9
  16. package/dist/data-component.js +2 -2
  17. package/dist/environment-settings.d.ts +4 -4
  18. package/dist/evaluationClient.d.ts +78 -0
  19. package/dist/evaluationClient.js +1202 -0
  20. package/dist/external-agent.d.ts +17 -17
  21. package/dist/external-agent.js +2 -2
  22. package/dist/index.d.ts +5 -3
  23. package/dist/index.js +4 -2
  24. package/dist/module-hosted-tool-manager.d.ts +1 -1
  25. package/dist/module-hosted-tool-manager.js +1 -1
  26. package/dist/project.d.ts +83 -83
  27. package/dist/project.js +23 -4
  28. package/dist/projectFullClient.d.ts +8 -8
  29. package/dist/projectFullClient.js +4 -4
  30. package/dist/runner.d.ts +15 -15
  31. package/dist/status-component.d.ts +3 -3
  32. package/dist/subAgent.d.ts +2 -2
  33. package/dist/subAgent.js +7 -7
  34. package/dist/telemetry-provider.d.ts +76 -76
  35. package/dist/tool.d.ts +16 -16
  36. package/dist/tool.js +23 -3
  37. package/dist/trigger.d.ts +46 -0
  38. package/dist/trigger.js +65 -0
  39. package/dist/types.d.ts +31 -22
  40. package/dist/utils/generateIdFromName.d.ts +4 -4
  41. package/dist/utils/tool-normalization.d.ts +10 -10
  42. package/dist/utils/validateFunction.d.ts +5 -5
  43. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ import { TriggerInterface } from "./trigger.js";
1
2
  import { ArtifactComponentInterface } from "./artifact-component.js";
2
3
  import { Tool } from "./tool.js";
3
4
  import { AgentMcpConfig } from "./builders.js";
@@ -21,8 +22,8 @@ interface DataComponentWithZodProps {
21
22
  props?: z.ZodObject<any>;
22
23
  }
23
24
  /**
24
- * Tool instance that may have additional metadata attached during agent processing
25
- */
25
+ * Tool instance that may have additional metadata attached during agent processing
26
+ */
26
27
  type AgentTool = (Tool & {
27
28
  selectedTools?: string[];
28
29
  headers?: Record<string, string>;
@@ -33,28 +34,28 @@ type AgentTool = (Tool & {
33
34
  toolPolicies?: Record<string, ToolPolicy>;
34
35
  });
35
36
  interface UserMessage {
36
- role: 'user';
37
+ role: "user";
37
38
  content: string;
38
39
  }
39
40
  interface AssistantMessage {
40
- role: 'assistant';
41
+ role: "assistant";
41
42
  content: string;
42
43
  toolCalls?: ToolCall[];
43
44
  }
44
45
  interface ToolMessage {
45
- role: 'tool';
46
+ role: "tool";
46
47
  content: string;
47
48
  toolCallId: string;
48
49
  }
49
50
  interface SystemMessage {
50
- role: 'system';
51
+ role: "system";
51
52
  content: string;
52
53
  }
53
54
  type Message = UserMessage | AssistantMessage | ToolMessage | SystemMessage;
54
55
  type MessageInput = string | string[] | Message | Message[];
55
56
  interface ToolCall {
56
57
  id: string;
57
- type: 'function';
58
+ type: "function";
58
59
  function: {
59
60
  name: string;
60
61
  arguments: string;
@@ -68,8 +69,8 @@ interface ToolResult {
68
69
  type AllDelegateInputInterface = SubAgentInterface | subAgentExternalAgentInterface | ExternalAgentInterface | AgentInterface | subAgentTeamAgentInterface;
69
70
  type AllDelegateOutputInterface = SubAgentInterface | subAgentExternalAgentInterface | subAgentTeamAgentInterface;
70
71
  type SubAgentCanUseType = Tool | AgentMcpConfig | FunctionTool;
71
- interface SubAgentConfig extends Omit<SubAgentApiInsert, 'projectId'> {
72
- type?: 'internal';
72
+ interface SubAgentConfig extends Omit<SubAgentApiInsert, "projectId"> {
73
+ type?: "internal";
73
74
  canUse?: () => SubAgentCanUseType[];
74
75
  canTransferTo?: () => SubAgentInterface[];
75
76
  canDelegateTo?: () => AllDelegateInputInterface[];
@@ -97,14 +98,21 @@ interface MCPToolConfig {
97
98
  toolName?: string;
98
99
  activeTools?: string[];
99
100
  headers?: Record<string, string>;
100
- mcpType?: 'nango' | 'generic';
101
+ mcpType?: "nango" | "generic";
101
102
  transport?: McpTransportConfig;
102
103
  imageUrl?: string;
104
+ toolOverrides?: Record<string, {
105
+ displayName?: string;
106
+ description?: string;
107
+ schema?: any;
108
+ transformation?: string | Record<string, string>;
109
+ }>;
110
+ prompt?: string;
103
111
  }
104
112
  interface FetchDefinitionConfig {
105
113
  id: string;
106
114
  name?: string;
107
- trigger: 'initialization' | 'invocation';
115
+ trigger: "initialization" | "invocation";
108
116
  url: string;
109
117
  method?: string;
110
118
  headers?: Record<string, string>;
@@ -123,7 +131,7 @@ interface RequestSchemaDefinition {
123
131
  }
124
132
  interface RequestSchemaConfig {
125
133
  schemas: RequestSchemaDefinition;
126
- optional?: ('body' | 'headers' | 'query' | 'params')[];
134
+ optional?: ("body" | "headers" | "query" | "params")[];
127
135
  }
128
136
  interface TransferConfig {
129
137
  agent: SubAgentInterface;
@@ -134,7 +142,7 @@ interface GenerateOptions {
134
142
  maxTurns?: number;
135
143
  maxSteps?: number;
136
144
  temperature?: number;
137
- toolChoice?: 'auto' | 'none' | string;
145
+ toolChoice?: "auto" | "none" | string;
138
146
  resourceId?: string;
139
147
  conversationId?: string;
140
148
  stream?: boolean;
@@ -145,7 +153,7 @@ interface AgentResponse {
145
153
  text: string;
146
154
  toolCalls?: ToolCall[];
147
155
  transfer?: TransferConfig;
148
- finishReason: 'completed' | 'tool_calls' | 'transfer' | 'max_turns' | 'error';
156
+ finishReason: "completed" | "tool_calls" | "transfer" | "max_turns" | "error";
149
157
  usage?: {
150
158
  inputTokens: number;
151
159
  outputTokens: number;
@@ -158,7 +166,7 @@ interface StreamResponse {
158
166
  eventStream?: AsyncGenerator<StreamEvent>;
159
167
  }
160
168
  interface StreamEvent {
161
- type: 'text' | 'tool_call' | 'transfer' | 'error' | 'done';
169
+ type: "text" | "tool_call" | "transfer" | "error" | "done";
162
170
  data: any;
163
171
  timestamp: Date;
164
172
  }
@@ -192,11 +200,12 @@ interface AgentConfig {
192
200
  summarizer?: ModelSettings;
193
201
  };
194
202
  statusUpdates?: StatusUpdateSettings;
203
+ triggers?: () => TriggerInterface[];
195
204
  }
196
205
  declare class AgentError extends Error {
197
206
  code?: string | undefined;
198
- details?: any | undefined;
199
- constructor(message: string, code?: string | undefined, details?: any | undefined);
207
+ details?: any;
208
+ constructor(message: string, code?: string | undefined, details?: any);
200
209
  }
201
210
  declare class MaxTurnsExceededError extends AgentError {
202
211
  constructor(maxTurns: number);
@@ -209,7 +218,7 @@ declare class TransferError extends AgentError {
209
218
  }
210
219
  interface SubAgentInterface {
211
220
  config: SubAgentConfig;
212
- type: 'internal';
221
+ type: "internal";
213
222
  init(): Promise<void>;
214
223
  getId(): string;
215
224
  getName(): string;
@@ -229,7 +238,7 @@ interface SubAgentInterface {
229
238
  }
230
239
  interface ExternalAgentInterface {
231
240
  config: ExternalAgentConfig;
232
- type: 'external';
241
+ type: "external";
233
242
  init(): Promise<void>;
234
243
  getId(): string;
235
244
  getName(): string;
@@ -272,7 +281,7 @@ interface BuilderToolConfig {
272
281
  name: string;
273
282
  description: string;
274
283
  config: {
275
- type: 'mcp';
284
+ type: "mcp";
276
285
  mcp: {
277
286
  server: {
278
287
  url: string;
@@ -283,7 +292,7 @@ interface BuilderToolConfig {
283
292
  }
284
293
  interface BuilderRelationConfig {
285
294
  targetAgent: string;
286
- relationType: 'transfer' | 'delegate';
295
+ relationType: "transfer" | "delegate";
287
296
  }
288
297
  interface BuilderAgentConfig {
289
298
  name: string;
@@ -293,4 +302,4 @@ interface BuilderAgentConfig {
293
302
  relations?: BuilderRelationConfig[];
294
303
  }
295
304
  //#endregion
296
- export { AgentConfig, AgentError, AgentInterface, AgentResponse, AgentTool, AllDelegateInputInterface, AllDelegateOutputInterface, ArtifactComponentWithZodProps, AssistantMessage, BuilderAgentConfig, BuilderRelationConfig, BuilderToolConfig, DataComponentWithZodProps, ExternalAgentInterface, FetchDefinitionConfig, type FunctionToolConfig, GenerateOptions, MCPToolConfig, MaxTurnsExceededError, Message, MessageInput, type ModelSettings, RequestSchemaConfig, RequestSchemaDefinition, RunResult, ServerConfig, StreamEvent, StreamResponse, SubAgentCanUseType, SubAgentConfig, SubAgentInterface, SystemMessage, ToolCall, ToolConfig, ToolExecutionError, ToolMessage, ToolResult, TransferConfig, TransferError, UserMessage, subAgentExternalAgentInterface, subAgentTeamAgentInterface };
305
+ export { AgentConfig, AgentError, AgentInterface, AgentResponse, AgentTool, AllDelegateInputInterface, AllDelegateOutputInterface, ArtifactComponentWithZodProps, AssistantMessage, BuilderAgentConfig, BuilderRelationConfig, BuilderToolConfig, DataComponentWithZodProps, ExternalAgentInterface, FetchDefinitionConfig, type FunctionToolConfig, GenerateOptions, MCPToolConfig, MaxTurnsExceededError, Message, MessageInput, type ModelSettings, RequestSchemaConfig, RequestSchemaDefinition, RunResult, ServerConfig, StreamEvent, StreamResponse, SubAgentCanUseType, SubAgentConfig, SubAgentInterface, SystemMessage, ToolCall, ToolConfig, ToolExecutionError, ToolMessage, ToolResult, TransferConfig, TransferError, type TriggerInterface, UserMessage, subAgentExternalAgentInterface, subAgentTeamAgentInterface };
@@ -1,9 +1,9 @@
1
1
  //#region src/utils/generateIdFromName.d.ts
2
2
  /**
3
- * Generates a kebab-case ID from a name string
4
- * @param name - The name to convert
5
- * @returns A kebab-case ID
6
- */
3
+ * Generates a kebab-case ID from a name string
4
+ * @param name - The name to convert
5
+ * @returns A kebab-case ID
6
+ */
7
7
  declare function generateIdFromName(name: string): string;
8
8
  //#endregion
9
9
  export { generateIdFromName };
@@ -6,20 +6,20 @@ import { ToolPolicy } from "@inkeep/agents-core";
6
6
  //#region src/utils/tool-normalization.d.ts
7
7
 
8
8
  /**
9
- * Type guard to check if a value is an AgentMcpConfig
10
- */
9
+ * Type guard to check if a value is an AgentMcpConfig
10
+ */
11
11
  declare function isAgentMcpConfig(value: unknown): value is AgentMcpConfig;
12
12
  /**
13
- * Type guard to check if a value is a Tool instance
14
- */
13
+ * Type guard to check if a value is a Tool instance
14
+ */
15
15
  declare function isTool(value: unknown): value is Tool;
16
16
  /**
17
- * Type guard to narrow down AgentCanUseType
18
- */
17
+ * Type guard to narrow down AgentCanUseType
18
+ */
19
19
  declare function isAgentCanUseType(value: unknown): value is SubAgentCanUseType;
20
20
  /**
21
- * Normalized tool representation with proper typing
22
- */
21
+ * Normalized tool representation with proper typing
22
+ */
23
23
  interface NormalizedToolInfo {
24
24
  /** The underlying Tool instance */
25
25
  tool: Tool;
@@ -35,8 +35,8 @@ interface NormalizedToolInfo {
35
35
  isWrapped: boolean;
36
36
  }
37
37
  /**
38
- * Safely extracts tool information from AgentCanUseType with proper typing
39
- */
38
+ * Safely extracts tool information from AgentCanUseType with proper typing
39
+ */
40
40
  declare function normalizeAgentCanUseType(value: SubAgentCanUseType, fallbackName?: string): NormalizedToolInfo;
41
41
  //#endregion
42
42
  export { NormalizedToolInfo, isAgentCanUseType, isAgentMcpConfig, isTool, normalizeAgentCanUseType };
@@ -1,10 +1,10 @@
1
1
  //#region src/utils/validateFunction.d.ts
2
2
  /**
3
- * Validates that a value is a function
4
- * @param value - The value to check
5
- * @param name - The name of the parameter (for error messages)
6
- * @throws {Error} If the value is not a function
7
- */
3
+ * Validates that a value is a function
4
+ * @param value - The value to check
5
+ * @param name - The name of the parameter (for error messages)
6
+ * @throws {Error} If the value is not a function
7
+ */
8
8
  declare function validateFunction(value: unknown, name: string): void;
9
9
  //#endregion
10
10
  export { validateFunction };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inkeep/agents-sdk",
3
- "version": "0.41.2",
3
+ "version": "0.43.0",
4
4
  "description": "Agents SDK for building and managing agents in the Inkeep Agent Framework",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -16,7 +16,7 @@
16
16
  "js-yaml": "^4.1.0",
17
17
  "typescript": "^5.3.3",
18
18
  "zod": "^4.1.11",
19
- "@inkeep/agents-core": "^0.41.2"
19
+ "@inkeep/agents-core": "^0.43.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "@types/js-yaml": "^4.0.9",