@activepieces/piece-ai 0.4.3 → 0.4.5
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/package.json +7 -30
- package/src/index.js +271 -28
- package/src/index.d.ts +0 -4
- package/src/index.d.ts.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/actions/agents/agent-output-builder.d.ts +0 -32
- package/src/lib/actions/agents/agent-output-builder.d.ts.map +0 -1
- package/src/lib/actions/agents/agent-output-builder.js +0 -112
- package/src/lib/actions/agents/agent-output-builder.js.map +0 -1
- package/src/lib/actions/agents/run-agent.d.ts +0 -10
- package/src/lib/actions/agents/run-agent.d.ts.map +0 -1
- package/src/lib/actions/agents/run-agent.js +0 -324
- package/src/lib/actions/agents/run-agent.js.map +0 -1
- package/src/lib/actions/agents/tools.d.ts +0 -30
- package/src/lib/actions/agents/tools.d.ts.map +0 -1
- package/src/lib/actions/agents/tools.js +0 -307
- package/src/lib/actions/agents/tools.js.map +0 -1
- package/src/lib/actions/agents/utils.d.ts +0 -24
- package/src/lib/actions/agents/utils.d.ts.map +0 -1
- package/src/lib/actions/agents/utils.js +0 -190
- package/src/lib/actions/agents/utils.js.map +0 -1
- package/src/lib/actions/image/generate-image.d.ts +0 -8
- package/src/lib/actions/image/generate-image.d.ts.map +0 -1
- package/src/lib/actions/image/generate-image.js +0 -285
- package/src/lib/actions/image/generate-image.js.map +0 -1
- package/src/lib/actions/text/ask-ai.d.ts +0 -11
- package/src/lib/actions/text/ask-ai.d.ts.map +0 -1
- package/src/lib/actions/text/ask-ai.js +0 -114
- package/src/lib/actions/text/ask-ai.js.map +0 -1
- package/src/lib/actions/text/summarize-text.d.ts +0 -8
- package/src/lib/actions/text/summarize-text.d.ts.map +0 -1
- package/src/lib/actions/text/summarize-text.js +0 -64
- package/src/lib/actions/text/summarize-text.js.map +0 -1
- package/src/lib/actions/utility/classify-text.d.ts +0 -7
- package/src/lib/actions/utility/classify-text.d.ts.map +0 -1
- package/src/lib/actions/utility/classify-text.js +0 -54
- package/src/lib/actions/utility/classify-text.js.map +0 -1
- package/src/lib/actions/utility/extract-structured-data.d.ts +0 -11
- package/src/lib/actions/utility/extract-structured-data.d.ts.map +0 -1
- package/src/lib/actions/utility/extract-structured-data.js +0 -259
- package/src/lib/actions/utility/extract-structured-data.js.map +0 -1
- package/src/lib/common/ai-sdk.d.ts +0 -90
- package/src/lib/common/ai-sdk.d.ts.map +0 -1
- package/src/lib/common/ai-sdk.js +0 -242
- package/src/lib/common/ai-sdk.js.map +0 -1
- package/src/lib/common/props.d.ts +0 -12
- package/src/lib/common/props.d.ts.map +0 -1
- package/src/lib/common/props.js +0 -69
- package/src/lib/common/props.js.map +0 -1
- package/src/lib/common/web-search.d.ts +0 -41
- package/src/lib/common/web-search.d.ts.map +0 -1
- package/src/lib/common/web-search.js +0 -191
- package/src/lib/common/web-search.js.map +0 -1
|
@@ -1,307 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.constructAgentTools = constructAgentTools;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const ai_1 = require("ai");
|
|
6
|
-
const zod_1 = tslib_1.__importDefault(require("zod"));
|
|
7
|
-
const utils_1 = require("./utils");
|
|
8
|
-
const shared_1 = require("@activepieces/shared");
|
|
9
|
-
const streamableHttp_js_1 = require("@modelcontextprotocol/sdk/client/streamableHttp.js");
|
|
10
|
-
const mcp_1 = require("@ai-sdk/mcp");
|
|
11
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
12
|
-
function createTransportConfig(protocol, serverUrl, headers = {}) {
|
|
13
|
-
const url = new URL(serverUrl);
|
|
14
|
-
switch (protocol) {
|
|
15
|
-
case shared_1.McpProtocol.SIMPLE_HTTP: {
|
|
16
|
-
return {
|
|
17
|
-
type: 'http',
|
|
18
|
-
url: serverUrl,
|
|
19
|
-
headers,
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
case shared_1.McpProtocol.STREAMABLE_HTTP: {
|
|
23
|
-
return new streamableHttp_js_1.StreamableHTTPClientTransport(url, {
|
|
24
|
-
requestInit: {
|
|
25
|
-
headers,
|
|
26
|
-
},
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
case shared_1.McpProtocol.SSE: {
|
|
30
|
-
return {
|
|
31
|
-
type: 'sse',
|
|
32
|
-
url: serverUrl,
|
|
33
|
-
headers,
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
default:
|
|
37
|
-
throw new Error(`Unsupported MCP protocol type: ${protocol}`);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
const SEARCH_KNOWLEDGE_BASE_TOOL_NAME = 'search_knowledge_base';
|
|
41
|
-
function flattenMcpServers(servers, agentMcpTools) {
|
|
42
|
-
const mcpClients = [];
|
|
43
|
-
const tools = {};
|
|
44
|
-
const keyToAgentTool = {};
|
|
45
|
-
for (const server of servers) {
|
|
46
|
-
mcpClients.push(server.mcpClient);
|
|
47
|
-
const agentTool = agentMcpTools.find((t) => t.toolName === server.mcpName);
|
|
48
|
-
for (const [toolName, fn] of Object.entries(server.tools)) {
|
|
49
|
-
const key = shared_1.mcpToolNameUtils.createToolName(`${toolName}`);
|
|
50
|
-
tools[key] = fn;
|
|
51
|
-
if (agentTool) {
|
|
52
|
-
keyToAgentTool[key] = agentTool;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return { mcpClients, tools, keyToAgentTool };
|
|
57
|
-
}
|
|
58
|
-
function constructMcpServersTools(tools) {
|
|
59
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const collected = [];
|
|
61
|
-
for (const tool of tools) {
|
|
62
|
-
try {
|
|
63
|
-
const mcpClient = yield (0, mcp_1.experimental_createMCPClient)({
|
|
64
|
-
transport: createTransportConfig(tool.protocol, tool.serverUrl, (0, shared_1.buildAuthHeaders)(tool.auth)),
|
|
65
|
-
});
|
|
66
|
-
const mcpTools = yield mcpClient.tools();
|
|
67
|
-
collected.push({
|
|
68
|
-
mcpName: tool.toolName,
|
|
69
|
-
mcpClient,
|
|
70
|
-
tools: mcpTools,
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
catch (error) {
|
|
74
|
-
console.error(`Failed to connect to MCP server ${tool.serverUrl}:`, error);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
return collected;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function createServerApiClient(context) {
|
|
81
|
-
return {
|
|
82
|
-
get(path, queryParams) {
|
|
83
|
-
return pieces_common_1.httpClient.sendRequest(Object.assign(Object.assign({ method: pieces_common_1.HttpMethod.GET, url: `${context.server.apiUrl}${path}` }, (queryParams ? { queryParams } : {})), { authentication: {
|
|
84
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
85
|
-
token: context.server.token,
|
|
86
|
-
} }));
|
|
87
|
-
},
|
|
88
|
-
post(path, body) {
|
|
89
|
-
return pieces_common_1.httpClient.sendRequest({
|
|
90
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
91
|
-
url: `${context.server.apiUrl}${path}`,
|
|
92
|
-
authentication: {
|
|
93
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
94
|
-
token: context.server.token,
|
|
95
|
-
},
|
|
96
|
-
body,
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
function constructKnowledgeBaseTools(kbTools, context, embeddingConfig) {
|
|
102
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
const tools = {};
|
|
104
|
-
const keyToAgentTool = {};
|
|
105
|
-
const api = createServerApiClient(context);
|
|
106
|
-
const fileTools = kbTools.filter(t => t.sourceType === shared_1.KnowledgeBaseSourceType.FILE);
|
|
107
|
-
const tableTools = kbTools.filter(t => t.sourceType === shared_1.KnowledgeBaseSourceType.TABLE);
|
|
108
|
-
if (fileTools.length > 0 && embeddingConfig) {
|
|
109
|
-
const fileIds = fileTools.map(t => t.sourceId);
|
|
110
|
-
const sourceNames = fileTools.map(t => t.sourceName).join(', ');
|
|
111
|
-
for (const fileTool of fileTools) {
|
|
112
|
-
try {
|
|
113
|
-
const unembeddedRes = yield api.get(`v1/knowledge-base/files/${fileTool.sourceId}/chunks?embedded=false`);
|
|
114
|
-
const unembedded = unembeddedRes.body;
|
|
115
|
-
if (unembedded.length > 0) {
|
|
116
|
-
const EMBED_BATCH_SIZE = 50;
|
|
117
|
-
for (let i = 0; i < unembedded.length; i += EMBED_BATCH_SIZE) {
|
|
118
|
-
const batch = unembedded.slice(i, i + EMBED_BATCH_SIZE);
|
|
119
|
-
const { embeddings } = yield (0, ai_1.embedMany)({
|
|
120
|
-
model: embeddingConfig.model,
|
|
121
|
-
values: batch.map(c => c.content),
|
|
122
|
-
providerOptions: embeddingConfig.providerOptions,
|
|
123
|
-
});
|
|
124
|
-
yield api.post(`v1/knowledge-base/files/${fileTool.sourceId}/store-chunks`, {
|
|
125
|
-
chunks: batch.map((c, j) => ({
|
|
126
|
-
id: c.id,
|
|
127
|
-
embedding: Array.from(embeddings[j]),
|
|
128
|
-
})),
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
catch (error) {
|
|
134
|
-
console.error(`Failed to embed KB file '${fileTool.sourceName}':`, error);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
tools[SEARCH_KNOWLEDGE_BASE_TOOL_NAME] = (0, ai_1.dynamicTool)({
|
|
138
|
-
description: `Search uploaded documents for relevant information. Available documents: ${sourceNames}. Use when you need facts, policies, or content from these knowledge base files.`,
|
|
139
|
-
inputSchema: zod_1.default.object({
|
|
140
|
-
query: zod_1.default.string().describe('Search query to find relevant information'),
|
|
141
|
-
}),
|
|
142
|
-
execute: (input) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
143
|
-
const { query } = input;
|
|
144
|
-
const { embedding } = yield (0, ai_1.embed)({
|
|
145
|
-
model: embeddingConfig.model,
|
|
146
|
-
value: query,
|
|
147
|
-
providerOptions: embeddingConfig.providerOptions,
|
|
148
|
-
});
|
|
149
|
-
const response = yield api.post('v1/knowledge-base/files/search', {
|
|
150
|
-
knowledgeBaseFileIds: fileIds,
|
|
151
|
-
queryEmbedding: Array.from(embedding),
|
|
152
|
-
limit: 5,
|
|
153
|
-
similarityThreshold: 0.5,
|
|
154
|
-
});
|
|
155
|
-
const results = response.body;
|
|
156
|
-
if (!results || results.length === 0) {
|
|
157
|
-
return { results: 'No relevant information found.' };
|
|
158
|
-
}
|
|
159
|
-
return {
|
|
160
|
-
results: results.map((r, i) => {
|
|
161
|
-
var _a, _b;
|
|
162
|
-
return ({
|
|
163
|
-
rank: i + 1,
|
|
164
|
-
content: r.content,
|
|
165
|
-
source: (_b = (_a = r.metadata) === null || _a === void 0 ? void 0 : _a['fileName']) !== null && _b !== void 0 ? _b : 'unknown',
|
|
166
|
-
relevanceScore: r.score,
|
|
167
|
-
});
|
|
168
|
-
}),
|
|
169
|
-
};
|
|
170
|
-
}),
|
|
171
|
-
});
|
|
172
|
-
keyToAgentTool[SEARCH_KNOWLEDGE_BASE_TOOL_NAME] = fileTools[0];
|
|
173
|
-
}
|
|
174
|
-
const tableToolEntries = yield Promise.all(tableTools.map((tableTool) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
175
|
-
const toolName = shared_1.mcpToolNameUtils.createToolName(`query_table_${tableTool.toolName}`);
|
|
176
|
-
// Resolve table ID and fields once at construction time, cache for execution
|
|
177
|
-
let cachedTableId;
|
|
178
|
-
let cachedFields = [];
|
|
179
|
-
let fieldDescriptions = '';
|
|
180
|
-
try {
|
|
181
|
-
const tableResponse = yield api.get(`v1/tables/${encodeURIComponent(tableTool.sourceId)}`);
|
|
182
|
-
if (tableResponse.body.id) {
|
|
183
|
-
cachedTableId = tableResponse.body.id;
|
|
184
|
-
const fieldsResponse = yield api.get(`v1/fields?tableId=${cachedTableId}`);
|
|
185
|
-
cachedFields = fieldsResponse.body;
|
|
186
|
-
fieldDescriptions = cachedFields.map(f => `${f.name} (${f.type})`).join(', ');
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
catch (error) {
|
|
190
|
-
console.error(`Failed to fetch table metadata for '${tableTool.sourceName}':`, error);
|
|
191
|
-
}
|
|
192
|
-
const tool = (0, ai_1.dynamicTool)({
|
|
193
|
-
description: `Query the '${tableTool.sourceName}' data table.${fieldDescriptions ? ` Columns: ${fieldDescriptions}.` : ''} Use to look up records or find specific entries.`,
|
|
194
|
-
inputSchema: zod_1.default.object({
|
|
195
|
-
filters: zod_1.default.array(zod_1.default.object({
|
|
196
|
-
fieldName: zod_1.default.string().describe('The name of the field to filter on'),
|
|
197
|
-
operator: zod_1.default.enum(['eq', 'neq', 'gt', 'gte', 'lt', 'lte', 'co', 'exists', 'not_exists']).describe('Filter operator'),
|
|
198
|
-
value: zod_1.default.string().optional().describe('The value to filter by'),
|
|
199
|
-
})).optional().describe('Optional filters to narrow results'),
|
|
200
|
-
limit: zod_1.default.number().optional().default(10).describe('Maximum number of records to return'),
|
|
201
|
-
}),
|
|
202
|
-
execute: (input) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
203
|
-
const { filters, limit } = input;
|
|
204
|
-
if (!cachedTableId) {
|
|
205
|
-
return { error: `Table '${tableTool.sourceName}' not found` };
|
|
206
|
-
}
|
|
207
|
-
// Use cached fields to resolve field names to IDs
|
|
208
|
-
let resolvedFilters;
|
|
209
|
-
if (filters && filters.length > 0) {
|
|
210
|
-
const fieldMap = new Map(cachedFields.map(f => [f.name.toLowerCase(), f.id]));
|
|
211
|
-
resolvedFilters = filters.flatMap(f => {
|
|
212
|
-
const fieldId = fieldMap.get(f.fieldName.toLowerCase());
|
|
213
|
-
if (!fieldId)
|
|
214
|
-
return [];
|
|
215
|
-
return [{ fieldId, operator: f.operator, value: f.value }];
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
const queryParams = Object.assign({ tableId: cachedTableId, limit: String(limit !== null && limit !== void 0 ? limit : 10) }, serializeArrayQuery('filters', resolvedFilters !== null && resolvedFilters !== void 0 ? resolvedFilters : []));
|
|
219
|
-
const response = yield api.get('v1/records', queryParams);
|
|
220
|
-
const records = response.body.data;
|
|
221
|
-
return { records, count: records.length };
|
|
222
|
-
}),
|
|
223
|
-
});
|
|
224
|
-
return { toolName, tool, agentTool: tableTool };
|
|
225
|
-
})));
|
|
226
|
-
for (const { toolName, tool, agentTool } of tableToolEntries) {
|
|
227
|
-
tools[toolName] = tool;
|
|
228
|
-
keyToAgentTool[toolName] = agentTool;
|
|
229
|
-
}
|
|
230
|
-
return { tools, keyToAgentTool };
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
function constructAgentTools(params) {
|
|
234
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
235
|
-
var _a, _b;
|
|
236
|
-
const { outputBuilder, structuredOutput, agentTools, context, model, embeddingConfig } = params;
|
|
237
|
-
const agentPieceTools = yield context.agent.tools({
|
|
238
|
-
tools: agentTools.filter(tool => tool.type === shared_1.AgentToolType.PIECE),
|
|
239
|
-
model: model,
|
|
240
|
-
});
|
|
241
|
-
const flowsTools = yield utils_1.agentUtils.constructFlowsTools({
|
|
242
|
-
tools: agentTools.filter(tool => tool.type === shared_1.AgentToolType.FLOW),
|
|
243
|
-
fetchFlows: context.flows.list,
|
|
244
|
-
publicUrl: context.server.publicUrl,
|
|
245
|
-
token: context.server.token
|
|
246
|
-
});
|
|
247
|
-
const agentMcpTools = agentTools.filter((tool) => tool.type === shared_1.AgentToolType.MCP);
|
|
248
|
-
const mcpServerTools = yield constructMcpServersTools(agentMcpTools);
|
|
249
|
-
const { mcpClients, tools: mcpTools, keyToAgentTool: mcpKeyToAgentTool } = flattenMcpServers(mcpServerTools, agentMcpTools);
|
|
250
|
-
const agentKbTools = agentTools.filter((tool) => tool.type === shared_1.AgentToolType.KNOWLEDGE_BASE);
|
|
251
|
-
const { tools: kbTools, keyToAgentTool: kbKeyToAgentTool } = yield constructKnowledgeBaseTools(agentKbTools, context, embeddingConfig);
|
|
252
|
-
const combinedTools = Object.assign(Object.assign(Object.assign(Object.assign({}, agentPieceTools), flowsTools), mcpTools), kbTools);
|
|
253
|
-
const toolKeyToAgentTool = {};
|
|
254
|
-
for (const agentTool of agentTools.filter(t => t.type !== shared_1.AgentToolType.MCP && t.type !== shared_1.AgentToolType.KNOWLEDGE_BASE)) {
|
|
255
|
-
const key = agentTool.type === shared_1.AgentToolType.FLOW ? shared_1.mcpToolNameUtils.createToolName(agentTool.toolName) : agentTool.toolName;
|
|
256
|
-
toolKeyToAgentTool[key] = agentTool;
|
|
257
|
-
}
|
|
258
|
-
Object.assign(toolKeyToAgentTool, mcpKeyToAgentTool);
|
|
259
|
-
Object.assign(toolKeyToAgentTool, kbKeyToAgentTool);
|
|
260
|
-
const completionTool = {
|
|
261
|
-
[shared_1.TASK_COMPLETION_TOOL_NAME]: (0, ai_1.dynamicTool)({
|
|
262
|
-
description: "This tool must be called as your FINAL ACTION to indicate whether the assigned goal was accomplished. Call it only when you have completed the user's task, or if you are unable to continue. Once you call this tool, you should not take any further actions.",
|
|
263
|
-
inputSchema: zod_1.default.object(Object.assign({ success: zod_1.default
|
|
264
|
-
.boolean()
|
|
265
|
-
.describe('Set to true if the assigned goal was achieved, or false if the task was abandoned or failed.') }, (!(0, shared_1.isNil)(structuredOutput)
|
|
266
|
-
? {
|
|
267
|
-
output: zod_1.default
|
|
268
|
-
.object((_b = (_a = utils_1.agentUtils.structuredOutputSchema(structuredOutput)) === null || _a === void 0 ? void 0 : _a.shape) !== null && _b !== void 0 ? _b : {})
|
|
269
|
-
.nullable()
|
|
270
|
-
.describe('The structured output of your task. This is optional and can be omitted if you have not achieved the goal.'),
|
|
271
|
-
}
|
|
272
|
-
: {
|
|
273
|
-
output: zod_1.default
|
|
274
|
-
.string()
|
|
275
|
-
.describe('Your complete response to the user. Always populate this with the full answer, result, or explanation — even if you already wrote text above. This is the final message that will be shown to the user.'),
|
|
276
|
-
}))),
|
|
277
|
-
execute: (params) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
278
|
-
const { success, output } = params;
|
|
279
|
-
outputBuilder.setStatus(success ? shared_1.AgentTaskStatus.COMPLETED : shared_1.AgentTaskStatus.FAILED);
|
|
280
|
-
if (!(0, shared_1.isNil)(structuredOutput) && !(0, shared_1.isNil)(output) && !(0, shared_1.isString)(output)) {
|
|
281
|
-
outputBuilder.setStructuredOutput(output);
|
|
282
|
-
}
|
|
283
|
-
else if ((0, shared_1.isNil)(structuredOutput) && !(0, shared_1.isNil)(output) && !outputBuilder.hasTextContent()) {
|
|
284
|
-
outputBuilder.addMarkdown(output);
|
|
285
|
-
}
|
|
286
|
-
return {};
|
|
287
|
-
}),
|
|
288
|
-
}),
|
|
289
|
-
};
|
|
290
|
-
return {
|
|
291
|
-
mcpClients,
|
|
292
|
-
toolKeyToAgentTool,
|
|
293
|
-
tools: Object.assign(Object.assign({}, combinedTools), completionTool),
|
|
294
|
-
};
|
|
295
|
-
});
|
|
296
|
-
}
|
|
297
|
-
function serializeArrayQuery(key, items) {
|
|
298
|
-
const params = {};
|
|
299
|
-
items.forEach((item, i) => {
|
|
300
|
-
for (const [field, value] of Object.entries(item)) {
|
|
301
|
-
if (value !== undefined)
|
|
302
|
-
params[`${key}[${i}][${field}]`] = value;
|
|
303
|
-
}
|
|
304
|
-
});
|
|
305
|
-
return params;
|
|
306
|
-
}
|
|
307
|
-
//# sourceMappingURL=tools.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../../../src/lib/actions/agents/tools.ts"],"names":[],"mappings":";;AA4RA,kDA4FC;;AAxXD,2BAAwF;AACxF,sDAAoB;AACpB,mCAAqC;AAErC,iDAA+P;AAC/P,0FAAkG;AAGlG,qCAAuG;AACvG,+DAAyF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AA;AAiBD,SAAS,mBAAmB,CAAC,GAAW,EAAE,KAA2C;IACjF,MAAM,MAAM,GAA2B,EAAE,CAAA;IACzC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE;QACtB,KAAK,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAChD,IAAI,KAAK,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,GAAG,IAAI,CAAC,KAAK,KAAK,GAAG,CAAC,GAAG,KAAK,CAAA;QACrE,CAAC;IACL,CAAC,CAAC,CAAA;IACF,OAAO,MAAM,CAAA;AACjB,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { AgentOutputField, SeekPage, PopulatedFlow, AgentFlowTool } from '@activepieces/shared';
|
|
2
|
-
import { ZodObject } from 'zod';
|
|
3
|
-
import { Tool } from 'ai';
|
|
4
|
-
export declare const agentUtils: {
|
|
5
|
-
isTaskCompletionToolCall: (toolName: string) => toolName is "updateTaskStatus";
|
|
6
|
-
structuredOutputSchema(outputFields: AgentOutputField[]): ZodObject | undefined;
|
|
7
|
-
getPrompts(userPrompt: string, options?: {
|
|
8
|
-
hasKnowledgeBaseTools?: boolean;
|
|
9
|
-
}): {
|
|
10
|
-
prompt: string;
|
|
11
|
-
system: string;
|
|
12
|
-
};
|
|
13
|
-
constructFlowsTools(params: ConstructFlowsToolsParams): Promise<Record<string, Tool>>;
|
|
14
|
-
};
|
|
15
|
-
type ConstructFlowsToolsParams = {
|
|
16
|
-
tools: AgentFlowTool[];
|
|
17
|
-
fetchFlows: (params: {
|
|
18
|
-
externalIds: string[];
|
|
19
|
-
}) => Promise<SeekPage<PopulatedFlow>>;
|
|
20
|
-
publicUrl: string;
|
|
21
|
-
token: string;
|
|
22
|
-
};
|
|
23
|
-
export {};
|
|
24
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/lib/actions/agents/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAIhB,QAAQ,EACR,aAAa,EAMb,aAAa,EAGd,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAK,SAAS,EAAE,MAAM,KAAK,CAAC;AAEnC,OAAO,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC;AAE1B,eAAO,MAAM,UAAU;yCACgB,MAAM;yCACN,gBAAgB,EAAE,GAAG,SAAS,GAAG,SAAS;2BAoBxD,MAAM,YAAY;QAAE,qBAAqB,CAAC,EAAE,OAAO,CAAA;KAAE;;;;gCAuD1C,yBAAyB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;CA4C5F,CAAA;AA4ED,KAAK,yBAAyB,GAAG;IAC/B,KAAK,EAAE,aAAa,EAAE,CAAA;IACtB,UAAU,EAAE,CAAC,MAAM,EAAE;QAAE,WAAW,EAAE,MAAM,EAAE,CAAA;KAAE,KAAK,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAA;IACnF,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.agentUtils = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const shared_1 = require("@activepieces/shared");
|
|
6
|
-
const zod_1 = require("zod");
|
|
7
|
-
const pieces_common_1 = require("@activepieces/pieces-common");
|
|
8
|
-
exports.agentUtils = {
|
|
9
|
-
isTaskCompletionToolCall: (toolName) => toolName === shared_1.TASK_COMPLETION_TOOL_NAME,
|
|
10
|
-
structuredOutputSchema(outputFields) {
|
|
11
|
-
const shape = {};
|
|
12
|
-
for (const field of outputFields) {
|
|
13
|
-
switch (field.type) {
|
|
14
|
-
case shared_1.AgentOutputFieldType.TEXT:
|
|
15
|
-
shape[field.displayName] = zod_1.z.string();
|
|
16
|
-
break;
|
|
17
|
-
case shared_1.AgentOutputFieldType.NUMBER:
|
|
18
|
-
shape[field.displayName] = zod_1.z.number();
|
|
19
|
-
break;
|
|
20
|
-
case shared_1.AgentOutputFieldType.BOOLEAN:
|
|
21
|
-
shape[field.displayName] = zod_1.z.boolean();
|
|
22
|
-
break;
|
|
23
|
-
default:
|
|
24
|
-
shape[field.displayName] = zod_1.z.any();
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
return Object.keys(shape).length > 0 ? zod_1.z.object(shape) : undefined;
|
|
28
|
-
},
|
|
29
|
-
getPrompts(userPrompt, options) {
|
|
30
|
-
return {
|
|
31
|
-
prompt: `
|
|
32
|
-
${userPrompt}
|
|
33
|
-
<important_note>
|
|
34
|
-
As your FINAL ACTION, you must call the \`${shared_1.TASK_COMPLETION_TOOL_NAME}\` tool to indicate if the task is complete or not.
|
|
35
|
-
Call this tool only once you have done everything you can to achieve the user's goal, or if you are unable to continue (e.g., after handling errors appropriately and exhausting alternatives).
|
|
36
|
-
If you do not make this final call, your work will be considered unsuccessful.
|
|
37
|
-
</important_note>
|
|
38
|
-
`,
|
|
39
|
-
system: `
|
|
40
|
-
You are a helpful, proactive AI assistant designed to assist users efficiently and accurately.
|
|
41
|
-
Today's date is ${new Date().toISOString().split('T')[0]}.
|
|
42
|
-
|
|
43
|
-
**Core Objective**:
|
|
44
|
-
- Help the user achieve their goal as quickly, accurately, and thoroughly as possible.
|
|
45
|
-
- Always prioritize user satisfaction by providing clear, concise, and relevant responses.
|
|
46
|
-
- Always make sure when you are asked a direct simple question you reply to it in simple clear and concise text response.
|
|
47
|
-
|
|
48
|
-
**Reasoning and Thinking Guidelines**:
|
|
49
|
-
- Think step-by-step before taking any action. Use chain-of-thought reasoning: First, understand the user's query fully. Then, break it down into sub-tasks. Evaluate what information or actions are needed. Finally, decide on the next steps.
|
|
50
|
-
- Be analytical: Consider potential edge cases, ambiguities in the query, and how to clarify if needed (but prefer acting proactively if possible).
|
|
51
|
-
- Avoid assumptions: Base decisions on available information, tools, and prior responses. If something is unclear, use tools to gather more data rather than guessing.
|
|
52
|
-
|
|
53
|
-
**Tool Execution Guidelines**:
|
|
54
|
-
- Use tools meaningfully: Only call a tool if it directly advances the task. Assess if the tool's output will provide necessary information or perform a required action.
|
|
55
|
-
- Sequential vs. Parallel Calls:
|
|
56
|
-
- Use sequential calls when outputs depend on each other (e.g., search for data first, then use code_execution to analyze it).
|
|
57
|
-
- Use parallel calls when tasks are independent and can be done simultaneously to save time (e.g., multiple independent web searches or X searches).
|
|
58
|
-
- Be careful: Limit parallel calls to 3-5 at most to avoid overwhelming the system or generating redundant data. Always justify in your reasoning why parallel is appropriate.
|
|
59
|
-
- Tool Selection: Choose the most specific and efficient tool for the job. For example, use x_semantic_search for conceptual X post relevance, but x_keyword_search for precise filters.
|
|
60
|
-
- Formatting: Always follow the exact XML-inspired format for function calls, including tags. Do not escape arguments.
|
|
61
|
-
|
|
62
|
-
**Error Handling Guidelines**:
|
|
63
|
-
- Tolerate minor errors: If a tool call fails (e.g., no results from a search, invalid URL in browse_page), analyze the error, then:
|
|
64
|
-
- Retry with adjusted parameters (e.g., refine query, try alternative URL) up to 2-3 times if it seems recoverable.
|
|
65
|
-
- Switch to an alternative tool or approach (e.g., if browse_page fails, try web_search).
|
|
66
|
-
- Use reasoning to infer or approximate if partial data is available.
|
|
67
|
-
- Know when to stop: If errors persist after retries/alternatives (e.g., critical failure like invalid tool arguments or unrecoverable data absence), or if further attempts won't help the goal, conclude the task and call the completion tool.
|
|
68
|
-
- Examples of stopping: Persistent network issues, query inherently unanswerable, or all avenues exhausted.
|
|
69
|
-
- In the completion tool, explain any unresolved issues clearly.
|
|
70
|
-
|
|
71
|
-
**Final Response and Completion**:
|
|
72
|
-
- Once the goal is achieved or unachievable, summarize findings clearly in a final response if needed, then call the \`${shared_1.TASK_COMPLETION_TOOL_NAME}\` tool as your last action.
|
|
73
|
-
- Do not call the completion tool prematurely—ensure all reasonable steps are taken.
|
|
74
|
-
${(options === null || options === void 0 ? void 0 : options.hasKnowledgeBaseTools) ? `
|
|
75
|
-
**Knowledge Base Guidelines**:
|
|
76
|
-
- ALWAYS search the knowledge base before answering any question. Do not answer from your own knowledge — use the search tool first.
|
|
77
|
-
- You may refine your search query ONCE if initial results aren't relevant. If the second search returns similar results, stop searching — the information is not in the knowledge base. Do not keep retrying with different phrasings.
|
|
78
|
-
- If the knowledge base does not contain the answer, say so clearly and move on.
|
|
79
|
-
- Cite the source document or table when presenting information from the knowledge base.
|
|
80
|
-
` : ''}
|
|
81
|
-
`.trim(),
|
|
82
|
-
};
|
|
83
|
-
},
|
|
84
|
-
constructFlowsTools(params) {
|
|
85
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
const flowTools = params.tools;
|
|
87
|
-
const flowExternalIds = flowTools.map((tool) => tool.externalFlowId);
|
|
88
|
-
const flows = yield params.fetchFlows({ externalIds: flowExternalIds });
|
|
89
|
-
const flowsByExternalId = new Map(flows.data.map(f => [f.externalId, f]));
|
|
90
|
-
const flowToolsWithPopulatedFlows = flowTools.map((tool) => {
|
|
91
|
-
const populatedFlow = flowsByExternalId.get(tool.externalFlowId);
|
|
92
|
-
return !(0, shared_1.isNil)(populatedFlow) ? Object.assign(Object.assign({}, tool), { flow: populatedFlow }) : undefined;
|
|
93
|
-
}).filter(tool => !(0, shared_1.isNil)(tool));
|
|
94
|
-
const flowsToolsList = yield Promise.all(flowToolsWithPopulatedFlows.map((tool) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
var _a, _b, _c;
|
|
96
|
-
const triggerSettings = tool.flow.version.trigger.settings;
|
|
97
|
-
const toolDescription = (_a = triggerSettings.input) === null || _a === void 0 ? void 0 : _a.toolDescription;
|
|
98
|
-
const returnsResponse = (_b = triggerSettings.input) === null || _b === void 0 ? void 0 : _b.returnsResponse;
|
|
99
|
-
const inputSchema = Object.fromEntries((_c = triggerSettings.input) === null || _c === void 0 ? void 0 : _c.inputSchema.map(prop => [
|
|
100
|
-
fixProperty(prop.name),
|
|
101
|
-
mcpPropertyToSchema(prop),
|
|
102
|
-
]));
|
|
103
|
-
const sanitizedName = shared_1.mcpToolNameUtils.createToolName(tool.toolName);
|
|
104
|
-
return {
|
|
105
|
-
name: sanitizedName,
|
|
106
|
-
description: toolDescription,
|
|
107
|
-
inputSchema: zod_1.z.object(inputSchema),
|
|
108
|
-
execute: (inputs) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
109
|
-
return callMcpFlowTool({
|
|
110
|
-
flowId: tool.flow.id,
|
|
111
|
-
publicUrl: params.publicUrl,
|
|
112
|
-
token: params.token,
|
|
113
|
-
async: !returnsResponse,
|
|
114
|
-
inputs,
|
|
115
|
-
});
|
|
116
|
-
})
|
|
117
|
-
};
|
|
118
|
-
})));
|
|
119
|
-
return Object.assign({}, Object.fromEntries(flowsToolsList.map((tool) => [tool.name, tool])));
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
function isOkSuccess(status) {
|
|
124
|
-
return Math.floor(status / 100) === 2;
|
|
125
|
-
}
|
|
126
|
-
function callMcpFlowTool(params) {
|
|
127
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
128
|
-
const syncSuffix = params.async ? '' : '/sync';
|
|
129
|
-
const url = `${params.publicUrl}v1/webhooks/${params.flowId}${syncSuffix}`;
|
|
130
|
-
try {
|
|
131
|
-
const response = yield pieces_common_1.httpClient.sendRequest({
|
|
132
|
-
method: pieces_common_1.HttpMethod.POST,
|
|
133
|
-
url,
|
|
134
|
-
headers: {
|
|
135
|
-
[shared_1.RAW_PAYLOAD_HEADER]: 'true',
|
|
136
|
-
},
|
|
137
|
-
authentication: {
|
|
138
|
-
type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
|
|
139
|
-
token: params.token,
|
|
140
|
-
},
|
|
141
|
-
body: params.inputs,
|
|
142
|
-
});
|
|
143
|
-
return {
|
|
144
|
-
status: isOkSuccess(response.status) ? shared_1.ExecutionToolStatus.SUCCESS : shared_1.ExecutionToolStatus.FAILED,
|
|
145
|
-
output: response.body,
|
|
146
|
-
resolvedInput: {},
|
|
147
|
-
errorMessage: !isOkSuccess(response.status) ? 'Error' : undefined,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
catch (error) {
|
|
151
|
-
return {
|
|
152
|
-
status: shared_1.ExecutionToolStatus.FAILED,
|
|
153
|
-
output: undefined,
|
|
154
|
-
resolvedInput: {},
|
|
155
|
-
errorMessage: error instanceof Error ? error.message : 'Error executing flow tool',
|
|
156
|
-
};
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
function fixProperty(schemaName) {
|
|
161
|
-
return schemaName.replace(/[\s/@-]+/g, '_');
|
|
162
|
-
}
|
|
163
|
-
function mcpPropertyToSchema(property) {
|
|
164
|
-
let schema;
|
|
165
|
-
switch (property.type) {
|
|
166
|
-
case shared_1.McpPropertyType.TEXT:
|
|
167
|
-
case shared_1.McpPropertyType.DATE:
|
|
168
|
-
schema = zod_1.z.string();
|
|
169
|
-
break;
|
|
170
|
-
case shared_1.McpPropertyType.NUMBER:
|
|
171
|
-
schema = zod_1.z.number();
|
|
172
|
-
break;
|
|
173
|
-
case shared_1.McpPropertyType.BOOLEAN:
|
|
174
|
-
schema = zod_1.z.boolean();
|
|
175
|
-
break;
|
|
176
|
-
case shared_1.McpPropertyType.ARRAY:
|
|
177
|
-
schema = zod_1.z.array(zod_1.z.string());
|
|
178
|
-
break;
|
|
179
|
-
case shared_1.McpPropertyType.OBJECT:
|
|
180
|
-
schema = zod_1.z.record(zod_1.z.string(), zod_1.z.string());
|
|
181
|
-
break;
|
|
182
|
-
default:
|
|
183
|
-
schema = zod_1.z.unknown();
|
|
184
|
-
}
|
|
185
|
-
if (property.description) {
|
|
186
|
-
schema = schema.describe(property.description);
|
|
187
|
-
}
|
|
188
|
-
return property.required ? schema : schema.nullish();
|
|
189
|
-
}
|
|
190
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../src/lib/actions/agents/utils.ts"],"names":[],"mappings":";;;;AAAA,iDAe8B;AAC9B,6BAAmC;AACnC,+DAAyF;AAG5E,QAAA,UAAU,GAAG;IACxB,wBAAwB,EAAE,CAAC,QAAgB,EAAE,EAAE,CAAC,QAAQ,KAAK,kCAAyB;IACtF,sBAAsB,CAAC,YAAgC;QACrD,MAAM,KAAK,GAA8B,EAAE,CAAC;QAE5C,KAAK,MAAM,KAAK,IAAI,YAAY,EAAE,CAAC;YACjC,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;gBACnB,KAAK,6BAAoB,CAAC,IAAI;oBAC5B,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC;oBACtC,MAAM;gBACR,KAAK,6BAAoB,CAAC,MAAM;oBAC9B,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,OAAC,CAAC,MAAM,EAAE,CAAC;oBACtC,MAAM;gBACR,KAAK,6BAAoB,CAAC,OAAO;oBAC/B,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,OAAC,CAAC,OAAO,EAAE,CAAC;oBACvC,MAAM;gBACR;oBACE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,OAAC,CAAC,GAAG,EAAE,CAAC;YACvC,CAAC;QACH,CAAC;QACD,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACrE,CAAC;IACD,UAAU,CAAC,UAAkB,EAAE,OAA6C;QAC1E,OA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@
|
|
|
1
|
-
export declare const generateImageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
|
-
provider: import("@activepieces/pieces-framework").DropdownProperty<string, true, undefined>;
|
|
3
|
-
model: import("@activepieces/pieces-framework").DropdownProperty<string, true, undefined>;
|
|
4
|
-
prompt: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
5
|
-
inputImages: import("@activepieces/pieces-framework").ArrayProperty<true> | import("@activepieces/pieces-framework").ArrayProperty<false>;
|
|
6
|
-
advancedOptions: import("@activepieces/pieces-framework").DynamicProperties<false, undefined>;
|
|
7
|
-
}>;
|
|
8
|
-
//# sourceMappingURL=generate-image.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate-image.d.ts","sourceRoot":"","sources":["../../../../../src/lib/actions/image/generate-image.ts"],"names":[],"mappings":"AAuBA,eAAO,MAAM,mBAAmB;;;;;;EAmJ9B,CAAC"}
|