@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.
- package/README.md +356 -2
- package/dist/agent.d.ts +84 -73
- package/dist/agent.js +42 -4
- package/dist/agentFullClient.d.ts +8 -8
- package/dist/agentFullClient.js +4 -4
- package/dist/artifact-component.d.ts +8 -8
- package/dist/artifact-component.js +2 -2
- package/dist/builderFunctions.d.ts +337 -248
- package/dist/builderFunctions.js +131 -2
- package/dist/builderFunctionsExperimental.d.ts +17 -17
- package/dist/builders.d.ts +48 -48
- package/dist/credential-provider.d.ts +93 -93
- package/dist/credential-provider.js +1 -1
- package/dist/credential-ref.d.ts +37 -37
- package/dist/data-component.d.ts +9 -9
- package/dist/data-component.js +2 -2
- package/dist/environment-settings.d.ts +4 -4
- package/dist/evaluationClient.d.ts +78 -0
- package/dist/evaluationClient.js +1202 -0
- package/dist/external-agent.d.ts +17 -17
- package/dist/external-agent.js +2 -2
- package/dist/index.d.ts +5 -3
- package/dist/index.js +4 -2
- package/dist/module-hosted-tool-manager.d.ts +1 -1
- package/dist/module-hosted-tool-manager.js +1 -1
- package/dist/project.d.ts +83 -83
- package/dist/project.js +23 -4
- package/dist/projectFullClient.d.ts +8 -8
- package/dist/projectFullClient.js +4 -4
- package/dist/runner.d.ts +15 -15
- package/dist/status-component.d.ts +3 -3
- package/dist/subAgent.d.ts +2 -2
- package/dist/subAgent.js +7 -7
- package/dist/telemetry-provider.d.ts +76 -76
- package/dist/tool.d.ts +16 -16
- package/dist/tool.js +23 -3
- package/dist/trigger.d.ts +46 -0
- package/dist/trigger.js +65 -0
- package/dist/types.d.ts +31 -22
- package/dist/utils/generateIdFromName.d.ts +4 -4
- package/dist/utils/tool-normalization.d.ts +10 -10
- package/dist/utils/validateFunction.d.ts +5 -5
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Trigger } from "./trigger.js";
|
|
1
2
|
import { ArtifactComponent } from "./artifact-component.js";
|
|
2
3
|
import { Tool } from "./tool.js";
|
|
3
4
|
import { SubAgent } from "./subAgent.js";
|
|
@@ -8,276 +9,364 @@ import { AgentConfig, FunctionToolConfig, SubAgentConfig } from "./types.js";
|
|
|
8
9
|
import { Agent } from "./agent.js";
|
|
9
10
|
import { Project, ProjectConfig } from "./project.js";
|
|
10
11
|
import { StatusComponent as StatusComponent$1 } from "./status-component.js";
|
|
11
|
-
import { CredentialReferenceApiInsert, MCPToolConfig } from "@inkeep/agents-core";
|
|
12
|
+
import { CredentialReferenceApiInsert, MCPToolConfig, TriggerApiInsert } from "@inkeep/agents-core";
|
|
12
13
|
|
|
13
14
|
//#region src/builderFunctions.d.ts
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
* Helper function to create agent - OpenAI style
|
|
18
|
+
*/
|
|
18
19
|
declare function agent(config: AgentConfig): Agent;
|
|
19
20
|
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
21
|
+
* Helper function to create projects - OpenAI style
|
|
22
|
+
*
|
|
23
|
+
* Projects are the top-level organizational unit that contains Agents, Sub Agents, and shared configurations.
|
|
24
|
+
* They provide model inheritance and execution limits that cascade down to Agents and Sub Agents.
|
|
25
|
+
*
|
|
26
|
+
* @param config - Project configuration
|
|
27
|
+
* @returns A new Project instance
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```typescript
|
|
31
|
+
* const customerSupport = project({
|
|
32
|
+
* id: 'customer-support-project',
|
|
33
|
+
* name: 'Customer Support System',
|
|
34
|
+
* description: 'Multi-agent customer support system',
|
|
35
|
+
* models: {
|
|
36
|
+
* base: { model: 'gpt-4.1-mini' },
|
|
37
|
+
* structuredOutput: { model: 'gpt-4.1' }
|
|
38
|
+
* },
|
|
39
|
+
* stopWhen: {
|
|
40
|
+
* transferCountIs: 10,
|
|
41
|
+
* stepCountIs: 50
|
|
42
|
+
* },
|
|
43
|
+
* agent: () => [
|
|
44
|
+
* agent({
|
|
45
|
+
* id: 'support-agent',
|
|
46
|
+
* name: 'Support Agent',
|
|
47
|
+
* // ... agent config
|
|
48
|
+
* })
|
|
49
|
+
* ]
|
|
50
|
+
* });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
52
53
|
declare function project(config: ProjectConfig): Project;
|
|
53
54
|
/**
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
55
|
+
* Creates a new agent with stable ID enforcement.
|
|
56
|
+
*
|
|
57
|
+
* Agents require explicit stable IDs to ensure consistency across deployments.
|
|
58
|
+
* This is different from tools which auto-generate IDs from their names.
|
|
59
|
+
*
|
|
60
|
+
* @param config - Agent configuration including required stable ID
|
|
61
|
+
* @returns A new SubAgent instance
|
|
62
|
+
* @throws {Error} If config.id is not provided
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const myAgent = agent({
|
|
67
|
+
* id: 'customer-support-agent',
|
|
68
|
+
* name: 'Customer Support',
|
|
69
|
+
* prompt: 'Help customers with their questions'
|
|
70
|
+
* });
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
72
73
|
declare function subAgent(config: SubAgentConfig): SubAgent;
|
|
73
74
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
declare function credential(config: CredentialReferenceApiInsert):
|
|
93
|
-
id: string;
|
|
94
|
-
name: string;
|
|
95
|
-
credentialStoreId: string;
|
|
96
|
-
type: "memory" | "keychain" | "nango";
|
|
97
|
-
createdAt?: string | undefined;
|
|
98
|
-
updatedAt?: string | undefined;
|
|
99
|
-
retrievalParams?: Record<string, unknown> | null | undefined;
|
|
100
|
-
userId?: string | null | undefined;
|
|
101
|
-
toolId?: string | null | undefined;
|
|
102
|
-
createdBy?: string | null | undefined;
|
|
103
|
-
};
|
|
75
|
+
* Creates a credential reference for authentication.
|
|
76
|
+
*
|
|
77
|
+
* Credentials are used to authenticate with external services.
|
|
78
|
+
* They should be stored securely and referenced by ID.
|
|
79
|
+
*
|
|
80
|
+
* @param config - Credential configuration
|
|
81
|
+
* @returns A validated credential reference
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* const apiCredential = credential({
|
|
86
|
+
* id: 'github-token',
|
|
87
|
+
* name: 'GitHub Token',
|
|
88
|
+
* type: 'bearer',
|
|
89
|
+
* value: process.env.GITHUB_TOKEN
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
declare function credential(config: CredentialReferenceApiInsert): CredentialReferenceApiInsert;
|
|
104
94
|
/**
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
95
|
+
* Creates an MCP (Model Context Protocol) server for tool functionality.
|
|
96
|
+
*
|
|
97
|
+
* MCP servers provide tool functionality through a standardized protocol.
|
|
98
|
+
* They can be remote services accessed via HTTP/WebSocket.
|
|
99
|
+
*
|
|
100
|
+
* @param config - MCP server configuration
|
|
101
|
+
* @returns A Tool instance configured as an MCP server
|
|
102
|
+
* @throws {Error} If serverUrl is not provided
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```typescript
|
|
106
|
+
* // Remote MCP server
|
|
107
|
+
* const apiServer = mcpServer({
|
|
108
|
+
* name: 'external_api',
|
|
109
|
+
* description: 'External API service',
|
|
110
|
+
* serverUrl: 'https://api.example.com/mcp'
|
|
111
|
+
* });
|
|
112
|
+
*
|
|
113
|
+
* // With authentication
|
|
114
|
+
* const secureServer = mcpServer({
|
|
115
|
+
* name: 'secure_api',
|
|
116
|
+
* description: 'Secure API service',
|
|
117
|
+
* serverUrl: 'https://secure.example.com/mcp',
|
|
118
|
+
* credential: credential({
|
|
119
|
+
* id: 'api-key',
|
|
120
|
+
* name: 'API Key',
|
|
121
|
+
* type: 'bearer',
|
|
122
|
+
* value: process.env.API_KEY
|
|
123
|
+
* })
|
|
124
|
+
* });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
137
127
|
declare function mcpServer(config: MCPServerConfig): Tool;
|
|
138
128
|
/**
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
129
|
+
* Creates an MCP tool from a raw configuration object.
|
|
130
|
+
*
|
|
131
|
+
* This is a low-level builder for advanced use cases where you need
|
|
132
|
+
* full control over the MCPToolConfig. For most cases, use `mcpServer()`.
|
|
133
|
+
*
|
|
134
|
+
* @param config - Complete MCP tool configuration
|
|
135
|
+
* @returns A Tool instance
|
|
136
|
+
*
|
|
137
|
+
* @example
|
|
138
|
+
* ```typescript
|
|
139
|
+
* const customTool = mcpTool({
|
|
140
|
+
* id: 'custom-tool',
|
|
141
|
+
* name: 'Custom Tool',
|
|
142
|
+
* serverUrl: 'https://example.com/mcp',
|
|
143
|
+
* transport: { type: 'stdio' }
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
157
147
|
declare function mcpTool(config: MCPToolConfig): Tool;
|
|
158
148
|
/**
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
149
|
+
* Creates an artifact component with automatic ID generation.
|
|
150
|
+
*
|
|
151
|
+
* Artifact components represent structured UI components that can
|
|
152
|
+
* be rendered with different levels of detail (summary vs full).
|
|
153
|
+
*
|
|
154
|
+
* @param config - Artifact component configuration
|
|
155
|
+
* @returns An ArtifactComponent instance
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```typescript
|
|
159
|
+
* const productCard = artifactComponent({
|
|
160
|
+
* name: 'Product Card',
|
|
161
|
+
* description: 'Display product information',
|
|
162
|
+
* props: {
|
|
163
|
+
* type: 'object',
|
|
164
|
+
* properties: {
|
|
165
|
+
* title: { type: 'string', inPreview: true },
|
|
166
|
+
* price: { type: 'string', inPreview: true },
|
|
167
|
+
* description: { type: 'string' },
|
|
168
|
+
* image: { type: 'string' }
|
|
169
|
+
* }
|
|
170
|
+
* }
|
|
171
|
+
* });
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
184
174
|
declare function artifactComponent(config: ArtifactComponentConfig): ArtifactComponent;
|
|
185
175
|
/**
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
176
|
+
* Creates a data component with automatic ID generation.
|
|
177
|
+
*
|
|
178
|
+
* Data components represent structured data that can be
|
|
179
|
+
* passed between agents or used in processing.
|
|
180
|
+
*
|
|
181
|
+
* @param config - Data component configuration
|
|
182
|
+
* @returns A DataComponent instance
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```typescript
|
|
186
|
+
* const userProfile = dataComponent({
|
|
187
|
+
* name: 'User Profile',
|
|
188
|
+
* description: 'User profile data',
|
|
189
|
+
* props: {
|
|
190
|
+
* userId: '123',
|
|
191
|
+
* name: 'John Doe',
|
|
192
|
+
* email: 'john@example.com'
|
|
193
|
+
* }
|
|
194
|
+
* });
|
|
195
|
+
* ```
|
|
196
|
+
*/
|
|
207
197
|
declare function dataComponent(config: DataComponentConfig): DataComponent;
|
|
208
198
|
/**
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
199
|
+
* Creates a status component for structured status updates.
|
|
200
|
+
*
|
|
201
|
+
* Status components define the structure of status updates
|
|
202
|
+
* that agents can generate during long-running operations.
|
|
203
|
+
*
|
|
204
|
+
* @param config - Status component configuration
|
|
205
|
+
* @returns A StatusComponent instance
|
|
206
|
+
*
|
|
207
|
+
* @example
|
|
208
|
+
* ```typescript
|
|
209
|
+
* import { z } from 'zod';
|
|
210
|
+
*
|
|
211
|
+
* const toolCallStatus = statusComponent({
|
|
212
|
+
* type: 'tool_call_summary',
|
|
213
|
+
* description: 'Summary of a tool execution',
|
|
214
|
+
* detailsSchema: z.object({
|
|
215
|
+
* tool_name: z.string(),
|
|
216
|
+
* summary: z.string(),
|
|
217
|
+
* status: z.enum(['success', 'error', 'in_progress'])
|
|
218
|
+
* })
|
|
219
|
+
* });
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
232
222
|
declare function statusComponent(config: StatusComponentConfig): StatusComponent$1;
|
|
233
223
|
/**
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
224
|
+
* (deprecated in favor of mcpTool.with()) Creates an agent MCP configuration.
|
|
225
|
+
*
|
|
226
|
+
* Agent MCP configurations are used to configure the MCP server for an agent.
|
|
227
|
+
*
|
|
228
|
+
* @param config - Agent MCP configuration
|
|
229
|
+
* @returns An AgentMcpConfig instance
|
|
230
|
+
*/
|
|
241
231
|
declare function agentMcp(config: AgentMcpConfig): AgentMcpConfig;
|
|
242
232
|
/**
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
233
|
+
* Creates a function tool that executes user-defined code in a sandboxed environment.
|
|
234
|
+
*
|
|
235
|
+
* Function tools allow users to define custom logic that runs securely in isolated
|
|
236
|
+
* environments. Dependencies are installed automatically in the sandbox.
|
|
237
|
+
*
|
|
238
|
+
* @param config - Function tool configuration
|
|
239
|
+
* @returns A FunctionTool instance
|
|
240
|
+
*
|
|
241
|
+
* @example
|
|
242
|
+
* ```typescript
|
|
243
|
+
* const calculatorTool = functionTool({
|
|
244
|
+
* name: 'calculator',
|
|
245
|
+
* description: 'Performs basic math operations',
|
|
246
|
+
* inputSchema: {
|
|
247
|
+
* type: 'object',
|
|
248
|
+
* properties: {
|
|
249
|
+
* operation: { type: 'string', enum: ['add', 'subtract', 'multiply', 'divide'] },
|
|
250
|
+
* a: { type: 'number' },
|
|
251
|
+
* b: { type: 'number' }
|
|
252
|
+
* },
|
|
253
|
+
* required: ['operation', 'a', 'b']
|
|
254
|
+
* },
|
|
255
|
+
* dependencies: {
|
|
256
|
+
* 'lodash': '^4.17.21'
|
|
257
|
+
* },
|
|
258
|
+
* execute: async (params) => {
|
|
259
|
+
* const { operation, a, b } = params;
|
|
260
|
+
* switch (operation) {
|
|
261
|
+
* case 'add': return { result: a + b };
|
|
262
|
+
* case 'subtract': return { result: a - b };
|
|
263
|
+
* case 'multiply': return { result: a * b };
|
|
264
|
+
* case 'divide': return { result: a / b };
|
|
265
|
+
* default: throw new Error(`Unknown operation: ${operation}`);
|
|
266
|
+
* }
|
|
267
|
+
* }
|
|
268
|
+
* });
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
281
271
|
declare function functionTool(config: FunctionToolConfig): FunctionTool;
|
|
272
|
+
/**
|
|
273
|
+
* Creates a webhook trigger for external service integration.
|
|
274
|
+
*
|
|
275
|
+
* Triggers allow external services to invoke agents via webhooks.
|
|
276
|
+
* They support authentication via arbitrary header key-value pairs,
|
|
277
|
+
* payload transformation, input validation, and signature verification.
|
|
278
|
+
*
|
|
279
|
+
* @param config - Trigger configuration
|
|
280
|
+
* @returns A Trigger instance
|
|
281
|
+
* @throws {Error} If signatureVerification config validation fails
|
|
282
|
+
*
|
|
283
|
+
* @example
|
|
284
|
+
* ```typescript
|
|
285
|
+
* import { z } from 'zod';
|
|
286
|
+
*
|
|
287
|
+
* // GitHub webhook trigger with signature verification
|
|
288
|
+
* const githubWebhookSecret = credential({
|
|
289
|
+
* id: 'github-webhook-secret',
|
|
290
|
+
* name: 'GitHub Webhook Secret',
|
|
291
|
+
* type: 'bearer',
|
|
292
|
+
* value: process.env.GITHUB_WEBHOOK_SECRET
|
|
293
|
+
* });
|
|
294
|
+
*
|
|
295
|
+
* const githubTrigger = trigger({
|
|
296
|
+
* name: 'GitHub Events',
|
|
297
|
+
* description: 'Handle GitHub webhook events',
|
|
298
|
+
* enabled: true,
|
|
299
|
+
* inputSchema: z.object({
|
|
300
|
+
* action: z.string(),
|
|
301
|
+
* repository: z.object({
|
|
302
|
+
* name: z.string(),
|
|
303
|
+
* url: z.string()
|
|
304
|
+
* })
|
|
305
|
+
* }),
|
|
306
|
+
* outputTransform: {
|
|
307
|
+
* jmespath: '{action: action, repo: repository.name, url: repository.url}'
|
|
308
|
+
* },
|
|
309
|
+
* messageTemplate: 'GitHub {{action}} on repository {{repo}}: {{url}}',
|
|
310
|
+
* authentication: {
|
|
311
|
+
* headers: [
|
|
312
|
+
* { name: 'X-GitHub-Token', value: process.env.GITHUB_TOKEN }
|
|
313
|
+
* ]
|
|
314
|
+
* },
|
|
315
|
+
* signingSecretCredentialReference: githubWebhookSecret,
|
|
316
|
+
* signatureVerification: {
|
|
317
|
+
* algorithm: 'sha256',
|
|
318
|
+
* encoding: 'hex',
|
|
319
|
+
* signature: {
|
|
320
|
+
* source: 'header',
|
|
321
|
+
* key: 'x-hub-signature-256',
|
|
322
|
+
* prefix: 'sha256='
|
|
323
|
+
* },
|
|
324
|
+
* signedComponents: [
|
|
325
|
+
* { source: 'body', required: true }
|
|
326
|
+
* ],
|
|
327
|
+
* componentJoin: {
|
|
328
|
+
* strategy: 'concatenate',
|
|
329
|
+
* separator: ''
|
|
330
|
+
* }
|
|
331
|
+
* }
|
|
332
|
+
* });
|
|
333
|
+
*
|
|
334
|
+
* // Slack webhook trigger with complex signature
|
|
335
|
+
* const slackTrigger = trigger({
|
|
336
|
+
* name: 'Slack Events',
|
|
337
|
+
* description: 'Handle Slack webhook events',
|
|
338
|
+
* messageTemplate: 'Slack event: {{type}}',
|
|
339
|
+
* signingSecretCredentialReference: slackSecret,
|
|
340
|
+
* signatureVerification: {
|
|
341
|
+
* algorithm: 'sha256',
|
|
342
|
+
* encoding: 'hex',
|
|
343
|
+
* signature: {
|
|
344
|
+
* source: 'header',
|
|
345
|
+
* key: 'x-slack-signature',
|
|
346
|
+
* prefix: 'v0='
|
|
347
|
+
* },
|
|
348
|
+
* signedComponents: [
|
|
349
|
+
* { source: 'literal', value: 'v0', required: true },
|
|
350
|
+
* { source: 'header', key: 'x-slack-request-timestamp', required: true },
|
|
351
|
+
* { source: 'body', required: true }
|
|
352
|
+
* ],
|
|
353
|
+
* componentJoin: {
|
|
354
|
+
* strategy: 'concatenate',
|
|
355
|
+
* separator: ':'
|
|
356
|
+
* }
|
|
357
|
+
* }
|
|
358
|
+
* });
|
|
359
|
+
*
|
|
360
|
+
* // Simple webhook trigger with no signature verification
|
|
361
|
+
* const simpleTrigger = trigger({
|
|
362
|
+
* name: 'Internal Webhook',
|
|
363
|
+
* description: 'Internal webhook with no signature',
|
|
364
|
+
* messageTemplate: 'New message: {{text}}'
|
|
365
|
+
* });
|
|
366
|
+
* ```
|
|
367
|
+
*/
|
|
368
|
+
declare function trigger(config: Omit<TriggerApiInsert, "id"> & {
|
|
369
|
+
id?: string;
|
|
370
|
+
}): Trigger;
|
|
282
371
|
//#endregion
|
|
283
|
-
export { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, statusComponent, subAgent };
|
|
372
|
+
export { agent, agentMcp, artifactComponent, credential, dataComponent, functionTool, mcpServer, mcpTool, project, statusComponent, subAgent, trigger };
|