@powerhousedao/pieces-framework 6.2.3-dev.24 → 6.2.3-dev.26
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/UPSTREAM.md +5 -5
- package/dist/{action--RmO83_Y.d.ts → action-BOq8m66H.d.ts} +6116 -6119
- package/dist/{action--RmO83_Y.d.ts.map → action-BOq8m66H.d.ts.map} +1 -1
- package/dist/{authentication-B7brX_It.js → authentication-o-4CdAPR.js} +20 -20
- package/dist/{authentication-B7brX_It.js.map → authentication-o-4CdAPR.js.map} +1 -1
- package/dist/common.d.ts +41 -77
- package/dist/common.d.ts.map +1 -1
- package/dist/common.js +64 -66
- package/dist/common.js.map +1 -1
- package/dist/host.d.ts +20 -23
- package/dist/host.d.ts.map +1 -1
- package/dist/host.js +32 -27
- package/dist/host.js.map +1 -1
- package/dist/{index-BW6GxXEN.d.ts → index-Ceki0QqC.d.ts} +957 -968
- package/dist/index-Ceki0QqC.d.ts.map +1 -0
- package/dist/index.d.ts +176 -175
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +181 -155
- package/dist/index.js.map +1 -1
- package/dist/{input-COuhC1I-.js → input-BHkj_oP5.js} +45 -32
- package/dist/{input-COuhC1I-.js.map → input-BHkj_oP5.js.map} +1 -1
- package/dist/{markdown-property-Df2l6_y_.js → markdown-property-DMfHjEiL.js} +13 -10
- package/dist/{markdown-property-Df2l6_y_.js.map → markdown-property-DMfHjEiL.js.map} +1 -1
- package/package.json +3 -7
- package/dist/index-BW6GxXEN.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { _ as ErrorHandlingOptionsParam, a as ObjectProperty, c as DynamicProp, d as ArrayProperty, f as ArraySubProps, g as MultiSelectDropdownProperty, h as DropdownProperty, i as RichTextProperty, l as DynamicProperties, m as JsonProperty, n as Property, o as assertNotNullOrUndefined, p as DateTimeProperty, r as CustomProperty, s as isNotUndefined, t as InputProperty, u as DynamicPropsValue, v as IAction, y as createAction } from "./input-
|
|
2
|
-
import { A as PropertyType, C as CheckboxProperty, D as DropdownState, E as DropdownOption, O as LongTextProperty, S as NumberProperty, T as StaticMultiSelectDropdownProperty, _ as DateRangeProperty, a as chunk, b as ApFile, c as isNil, f as pickBy, g as DateRangePreset, h as MarkdownVariant, i as camelCase, j as BasePropertySchema, k as ShortTextProperty, l as isString, m as unique, n as tryCatch, p as startCase, s as isEmpty, u as kebabCase, v as DateRangeValue, w as StaticDropdownProperty, x as FileProperty, y as dateRangeUtils } from "./markdown-property-
|
|
3
|
-
import { _ as TriggerStrategy, a as OAuth2AuthorizationMethod, b as AppConnectionType, c as OAuth2Props, d as SecretTextProperty, f as BasicAuthProperty, g as AUTHENTICATION_PROPERTY_NAME, h as spreadIfDefined, i as getAuthPropertyForValue, l as OIDCProperty, n as PieceAuth, o as OAuth2Property, p as BasicAuthPropertyValue, r as PieceAuthProperty, s as OAuth2PropertyValue, t as DEFAULT_CONNECTION_DISPLAY_NAME, u as CustomAuthProperty, v as TriggerTestStrategy, x as OAuth2GrantType, y as WebhookHandshakeStrategy } from "./authentication-
|
|
1
|
+
import { _ as ErrorHandlingOptionsParam, a as ObjectProperty, c as DynamicProp, d as ArrayProperty, f as ArraySubProps, g as MultiSelectDropdownProperty, h as DropdownProperty, i as RichTextProperty, l as DynamicProperties, m as JsonProperty, n as Property, o as assertNotNullOrUndefined, p as DateTimeProperty, r as CustomProperty, s as isNotUndefined, t as InputProperty, u as DynamicPropsValue, v as IAction, y as createAction } from "./input-BHkj_oP5.js";
|
|
2
|
+
import { A as PropertyType, C as CheckboxProperty, D as DropdownState, E as DropdownOption, O as LongTextProperty, S as NumberProperty, T as StaticMultiSelectDropdownProperty, _ as DateRangeProperty, a as chunk, b as ApFile, c as isNil, f as pickBy, g as DateRangePreset, h as MarkdownVariant, i as camelCase, j as BasePropertySchema, k as ShortTextProperty, l as isString, m as unique, n as tryCatch, p as startCase, s as isEmpty, u as kebabCase, v as DateRangeValue, w as StaticDropdownProperty, x as FileProperty, y as dateRangeUtils } from "./markdown-property-DMfHjEiL.js";
|
|
3
|
+
import { _ as TriggerStrategy, a as OAuth2AuthorizationMethod, b as AppConnectionType, c as OAuth2Props, d as SecretTextProperty, f as BasicAuthProperty, g as AUTHENTICATION_PROPERTY_NAME, h as spreadIfDefined, i as getAuthPropertyForValue, l as OIDCProperty, n as PieceAuth, o as OAuth2Property, p as BasicAuthPropertyValue, r as PieceAuthProperty, s as OAuth2PropertyValue, t as DEFAULT_CONNECTION_DISPLAY_NAME, u as CustomAuthProperty, v as TriggerTestStrategy, x as OAuth2GrantType, y as WebhookHandshakeStrategy } from "./authentication-o-4CdAPR.js";
|
|
4
4
|
import * as z from "zod/mini";
|
|
5
5
|
import { customAlphabet } from "nanoid";
|
|
6
6
|
import path from "node:path";
|
|
@@ -45,11 +45,6 @@ let ExecutionType = /* @__PURE__ */ function(ExecutionType) {
|
|
|
45
45
|
ExecutionType["RESUME"] = "RESUME";
|
|
46
46
|
return ExecutionType;
|
|
47
47
|
}({});
|
|
48
|
-
let PauseType = /* @__PURE__ */ function(PauseType) {
|
|
49
|
-
PauseType["DELAY"] = "DELAY";
|
|
50
|
-
PauseType["WEBHOOK"] = "WEBHOOK";
|
|
51
|
-
return PauseType;
|
|
52
|
-
}({});
|
|
53
48
|
let StreamStepProgress = /* @__PURE__ */ function(StreamStepProgress) {
|
|
54
49
|
StreamStepProgress["WEBSOCKET"] = "WEBSOCKET";
|
|
55
50
|
StreamStepProgress["NONE"] = "NONE";
|
|
@@ -61,14 +56,14 @@ const RespondResponse = z.object({
|
|
|
61
56
|
headers: z.optional(z.record(z.string(), z.string()))
|
|
62
57
|
});
|
|
63
58
|
const DelayPauseMetadata = z.object({
|
|
64
|
-
type: z.literal(
|
|
59
|
+
type: z.literal("DELAY"),
|
|
65
60
|
resumeDateTime: z.string(),
|
|
66
61
|
requestIdToReply: z.optional(z.string()),
|
|
67
62
|
handlerId: z.optional(z.string()),
|
|
68
63
|
streamStepProgress: z.optional(z.enum(StreamStepProgress))
|
|
69
64
|
});
|
|
70
65
|
const WebhookPauseMetadata = z.object({
|
|
71
|
-
type: z.literal(
|
|
66
|
+
type: z.literal("WEBHOOK"),
|
|
72
67
|
requestId: z.string(),
|
|
73
68
|
requestIdToReply: z.optional(z.string()),
|
|
74
69
|
response: RespondResponse,
|
|
@@ -241,22 +236,22 @@ const AgentPieceToolMetadata = z.object({
|
|
|
241
236
|
predefinedInput: z.optional(PredefinedInputsStructure)
|
|
242
237
|
});
|
|
243
238
|
const AgentPieceTool = z.object({
|
|
244
|
-
type: z.literal(
|
|
239
|
+
type: z.literal("PIECE"),
|
|
245
240
|
toolName: z.string().check(z.minLength(1)),
|
|
246
241
|
pieceMetadata: AgentPieceToolMetadata
|
|
247
242
|
});
|
|
248
|
-
const McpAuthNone = z.object({ type: z.literal(
|
|
243
|
+
const McpAuthNone = z.object({ type: z.literal("none") });
|
|
249
244
|
const McpAuthAccessToken = z.object({
|
|
250
|
-
type: z.literal(
|
|
245
|
+
type: z.literal("access_token"),
|
|
251
246
|
accessToken: z.string()
|
|
252
247
|
});
|
|
253
248
|
const McpAuthApiKey = z.object({
|
|
254
|
-
type: z.literal(
|
|
249
|
+
type: z.literal("api_key"),
|
|
255
250
|
apiKey: z.string(),
|
|
256
251
|
apiKeyHeader: z.string()
|
|
257
252
|
});
|
|
258
253
|
const McpAuthHeaders = z.object({
|
|
259
|
-
type: z.literal(
|
|
254
|
+
type: z.literal("headers"),
|
|
260
255
|
headers: z.record(z.string(), z.string())
|
|
261
256
|
});
|
|
262
257
|
const McpAuthConfig = z.discriminatedUnion("type", [
|
|
@@ -266,20 +261,20 @@ const McpAuthConfig = z.discriminatedUnion("type", [
|
|
|
266
261
|
McpAuthHeaders
|
|
267
262
|
]);
|
|
268
263
|
const AgentFlowTool = z.object({
|
|
269
|
-
type: z.literal(
|
|
264
|
+
type: z.literal("FLOW"),
|
|
270
265
|
toolName: z.string().check(z.minLength(1)),
|
|
271
266
|
externalFlowId: z.string(),
|
|
272
267
|
flowDisplayName: z.optional(z.string())
|
|
273
268
|
});
|
|
274
269
|
const AgentMcpTool = z.object({
|
|
275
|
-
type: z.literal(
|
|
270
|
+
type: z.literal("MCP"),
|
|
276
271
|
toolName: z.string().check(z.minLength(1)),
|
|
277
272
|
serverUrl: z.url(),
|
|
278
273
|
protocol: z.enum(McpProtocol),
|
|
279
274
|
auth: McpAuthConfig
|
|
280
275
|
});
|
|
281
276
|
const AgentKnowledgeBaseTool = z.object({
|
|
282
|
-
type: z.literal(
|
|
277
|
+
type: z.literal("KNOWLEDGE_BASE"),
|
|
283
278
|
toolName: z.string().check(z.minLength(1)),
|
|
284
279
|
sourceType: z.enum(KnowledgeBaseSourceType),
|
|
285
280
|
sourceId: z.string(),
|
|
@@ -297,11 +292,11 @@ const AgentOutputField = z.object({
|
|
|
297
292
|
type: z.enum(AgentOutputFieldType)
|
|
298
293
|
});
|
|
299
294
|
const MarkdownContentBlock = z.object({
|
|
300
|
-
type: z.literal(
|
|
295
|
+
type: z.literal("MARKDOWN"),
|
|
301
296
|
markdown: z.string()
|
|
302
297
|
});
|
|
303
298
|
const toolCallBaseShape = {
|
|
304
|
-
type: z.literal(
|
|
299
|
+
type: z.literal("TOOL_CALL"),
|
|
305
300
|
input: Nullable(z.record(z.string(), z.unknown())),
|
|
306
301
|
output: z.optional(z.unknown()),
|
|
307
302
|
toolName: z.string(),
|
|
@@ -314,32 +309,32 @@ z.object(toolCallBaseShape);
|
|
|
314
309
|
const ToolCallContentBlock = z.discriminatedUnion("toolCallType", [
|
|
315
310
|
z.object({
|
|
316
311
|
...toolCallBaseShape,
|
|
317
|
-
toolCallType: z.literal(
|
|
312
|
+
toolCallType: z.literal("PIECE"),
|
|
318
313
|
pieceName: z.string(),
|
|
319
314
|
pieceVersion: z.string(),
|
|
320
315
|
actionName: z.string()
|
|
321
316
|
}),
|
|
322
317
|
z.object({
|
|
323
318
|
...toolCallBaseShape,
|
|
324
|
-
toolCallType: z.literal(
|
|
319
|
+
toolCallType: z.literal("FLOW"),
|
|
325
320
|
displayName: z.string(),
|
|
326
321
|
externalFlowId: z.string()
|
|
327
322
|
}),
|
|
328
323
|
z.object({
|
|
329
324
|
...toolCallBaseShape,
|
|
330
|
-
toolCallType: z.literal(
|
|
325
|
+
toolCallType: z.literal("MCP"),
|
|
331
326
|
displayName: z.string(),
|
|
332
327
|
serverUrl: z.string()
|
|
333
328
|
}),
|
|
334
329
|
z.object({
|
|
335
330
|
...toolCallBaseShape,
|
|
336
|
-
toolCallType: z.literal(
|
|
331
|
+
toolCallType: z.literal("KNOWLEDGE_BASE"),
|
|
337
332
|
displayName: z.string(),
|
|
338
333
|
sourceType: z.string()
|
|
339
334
|
}),
|
|
340
335
|
z.object({
|
|
341
336
|
...toolCallBaseShape,
|
|
342
|
-
toolCallType: z.literal(
|
|
337
|
+
toolCallType: z.literal("UNKNOWN"),
|
|
343
338
|
displayName: z.string()
|
|
344
339
|
})
|
|
345
340
|
]);
|
|
@@ -347,14 +342,14 @@ const AgentStepBlock = z.union([MarkdownContentBlock, ToolCallContentBlock]);
|
|
|
347
342
|
function buildAuthHeaders(authConfig) {
|
|
348
343
|
let headers = {};
|
|
349
344
|
switch (authConfig.type) {
|
|
350
|
-
case
|
|
351
|
-
case
|
|
345
|
+
case "none": break;
|
|
346
|
+
case "headers":
|
|
352
347
|
headers = authConfig.headers;
|
|
353
348
|
break;
|
|
354
|
-
case
|
|
349
|
+
case "access_token":
|
|
355
350
|
headers["Authorization"] = `Bearer ${authConfig.accessToken}`;
|
|
356
351
|
break;
|
|
357
|
-
case
|
|
352
|
+
case "api_key": {
|
|
358
353
|
const headerName = authConfig.apiKeyHeader;
|
|
359
354
|
headers[headerName] = authConfig.apiKey;
|
|
360
355
|
break;
|
|
@@ -407,8 +402,8 @@ const mcpToolNameUtils = {
|
|
|
407
402
|
isProviderSafeIdentifier,
|
|
408
403
|
toProviderSafeIdentifier
|
|
409
404
|
};
|
|
410
|
-
const AGENT_STEP_TIMEOUT_MS =
|
|
411
|
-
const AGENT_STEP_TEST_TIMEOUT_MS =
|
|
405
|
+
const AGENT_STEP_TIMEOUT_MS = 108e5;
|
|
406
|
+
const AGENT_STEP_TEST_TIMEOUT_MS = 9e5;
|
|
412
407
|
|
|
413
408
|
//#endregion
|
|
414
409
|
//#region upstream/core-piece-types/lib/ai-providers.ts
|
|
@@ -555,12 +550,13 @@ function splitCloudflareGatewayModelId(modelId) {
|
|
|
555
550
|
};
|
|
556
551
|
}
|
|
557
552
|
function getEffectiveProviderAndModel({ provider, model }) {
|
|
558
|
-
if (provider !==
|
|
553
|
+
if (provider !== "cloudflare-gateway" || !model) return {
|
|
559
554
|
provider,
|
|
560
555
|
model
|
|
561
556
|
};
|
|
562
557
|
const split = splitCloudflareGatewayModelId(model);
|
|
563
|
-
const
|
|
558
|
+
const gatewaySubmodelPrefix = (split.provider ?? "").trim().toLowerCase();
|
|
559
|
+
const mapped = CF_GATEWAY_SUBMODEL_TO_PROVIDER[gatewaySubmodelPrefix];
|
|
564
560
|
if (!mapped) return {
|
|
565
561
|
provider,
|
|
566
562
|
model
|
|
@@ -571,10 +567,10 @@ function getEffectiveProviderAndModel({ provider, model }) {
|
|
|
571
567
|
};
|
|
572
568
|
}
|
|
573
569
|
const CF_GATEWAY_SUBMODEL_TO_PROVIDER = {
|
|
574
|
-
openai:
|
|
575
|
-
anthropic:
|
|
576
|
-
"google-ai-studio":
|
|
577
|
-
"google-vertex-ai":
|
|
570
|
+
openai: "openai",
|
|
571
|
+
anthropic: "anthropic",
|
|
572
|
+
"google-ai-studio": "google",
|
|
573
|
+
"google-vertex-ai": "google"
|
|
578
574
|
};
|
|
579
575
|
const OPENAI_CHAT_MODELS = [
|
|
580
576
|
"gpt-5.5",
|
|
@@ -602,65 +598,65 @@ const GOOGLE_CHAT_MODELS = [
|
|
|
602
598
|
"gemini-3-flash-preview"
|
|
603
599
|
];
|
|
604
600
|
const X_AI_OPENROUTER_CHAT_MODELS = ["grok-4.20"];
|
|
605
|
-
const REASONING_OPTIONAL_CHAT_MODELS = ANTHROPIC_OPENROUTER_CHAT_MODELS.map((model) => `${
|
|
601
|
+
const REASONING_OPTIONAL_CHAT_MODELS = ANTHROPIC_OPENROUTER_CHAT_MODELS.map((model) => `${"anthropic"}/${model}`);
|
|
606
602
|
const ALLOWED_CHAT_MODELS_BY_PROVIDER = {
|
|
607
|
-
[
|
|
608
|
-
[
|
|
609
|
-
[
|
|
610
|
-
[
|
|
611
|
-
[
|
|
612
|
-
...ANTHROPIC_OPENROUTER_CHAT_MODELS.map((m) => `${
|
|
613
|
-
...OPENAI_CHAT_MODELS.map((m) => `${
|
|
614
|
-
...GOOGLE_CHAT_MODELS.map((m) => `${
|
|
603
|
+
["openai"]: OPENAI_CHAT_MODELS,
|
|
604
|
+
["anthropic"]: ANTHROPIC_CHAT_MODELS,
|
|
605
|
+
["google"]: GOOGLE_CHAT_MODELS,
|
|
606
|
+
["vertex"]: GOOGLE_CHAT_MODELS,
|
|
607
|
+
["activepieces"]: [
|
|
608
|
+
...ANTHROPIC_OPENROUTER_CHAT_MODELS.map((m) => `${"anthropic"}/${m}`),
|
|
609
|
+
...OPENAI_CHAT_MODELS.map((m) => `${"openai"}/${m}`),
|
|
610
|
+
...GOOGLE_CHAT_MODELS.map((m) => `${"google"}/${m}`),
|
|
615
611
|
...X_AI_OPENROUTER_CHAT_MODELS.map((m) => `x-ai/${m}`)
|
|
616
612
|
]
|
|
617
613
|
};
|
|
618
614
|
const DEFAULT_MAX_CONTEXT_TOKENS = 128e3;
|
|
619
615
|
const PROVIDER_MAX_CONTEXT_TOKENS = {
|
|
620
|
-
[
|
|
621
|
-
[
|
|
622
|
-
[
|
|
623
|
-
[
|
|
624
|
-
[
|
|
625
|
-
[
|
|
626
|
-
[
|
|
627
|
-
[
|
|
628
|
-
[
|
|
616
|
+
["openai"]: 128e3,
|
|
617
|
+
["anthropic"]: 2e5,
|
|
618
|
+
["google"]: 1048576,
|
|
619
|
+
["bedrock"]: 2e5,
|
|
620
|
+
["vertex"]: 1048576,
|
|
621
|
+
["azure"]: 128e3,
|
|
622
|
+
["openrouter"]: 128e3,
|
|
623
|
+
["activepieces"]: 2e5,
|
|
624
|
+
["mistral"]: 128e3
|
|
629
625
|
};
|
|
630
626
|
function getMaxContextTokens({ provider }) {
|
|
631
627
|
if (!provider) return DEFAULT_MAX_CONTEXT_TOKENS;
|
|
632
628
|
return PROVIDER_MAX_CONTEXT_TOKENS[provider] ?? DEFAULT_MAX_CONTEXT_TOKENS;
|
|
633
629
|
}
|
|
634
630
|
const DEFAULT_EMBEDDING_MODELS = {
|
|
635
|
-
[
|
|
636
|
-
[
|
|
637
|
-
[
|
|
638
|
-
[
|
|
639
|
-
[
|
|
631
|
+
["openai"]: "text-embedding-3-small",
|
|
632
|
+
["google"]: "text-embedding-004",
|
|
633
|
+
["azure"]: "text-embedding-3-small",
|
|
634
|
+
["activepieces"]: "text-embedding-3-small",
|
|
635
|
+
["openrouter"]: "openai/text-embedding-3-small"
|
|
640
636
|
};
|
|
641
637
|
const WEB_SEARCH_MODE_BY_PROVIDER = {
|
|
642
|
-
[
|
|
643
|
-
[
|
|
644
|
-
[
|
|
645
|
-
[
|
|
638
|
+
["anthropic"]: "native",
|
|
639
|
+
["google"]: "native",
|
|
640
|
+
["openrouter"]: "plugin",
|
|
641
|
+
["activepieces"]: "plugin"
|
|
646
642
|
};
|
|
647
|
-
const NO_IMAGE_GENERATION_PROVIDERS = new Set([
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
643
|
+
const NO_IMAGE_GENERATION_PROVIDERS = /* @__PURE__ */ new Set([
|
|
644
|
+
"anthropic",
|
|
645
|
+
"mistral",
|
|
646
|
+
"xai",
|
|
647
|
+
"deepseek",
|
|
648
|
+
"zai",
|
|
649
|
+
"qwen",
|
|
650
|
+
"minimax",
|
|
651
|
+
"moonshot"
|
|
656
652
|
]);
|
|
657
653
|
const OPENAI_COMPATIBLE_VENDOR_BASE_URLS = {
|
|
658
|
-
[
|
|
659
|
-
[
|
|
660
|
-
[
|
|
661
|
-
[
|
|
662
|
-
[
|
|
663
|
-
[
|
|
654
|
+
["xai"]: "https://api.x.ai/v1",
|
|
655
|
+
["deepseek"]: "https://api.deepseek.com/v1",
|
|
656
|
+
["zai"]: "https://api.z.ai/api/paas/v4",
|
|
657
|
+
["qwen"]: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
|
|
658
|
+
["minimax"]: "https://api.minimax.io/v1",
|
|
659
|
+
["moonshot"]: "https://api.moonshot.ai/v1"
|
|
664
660
|
};
|
|
665
661
|
function buildProviderCapabilities(provider) {
|
|
666
662
|
return {
|
|
@@ -700,23 +696,23 @@ const ACTIVEPIECES_CHAT_TIERS = [
|
|
|
700
696
|
];
|
|
701
697
|
const DEFAULT_CHAT_TIER_ID = "smart";
|
|
702
698
|
const AI_PROVIDER_CAPABILITIES = {
|
|
703
|
-
[
|
|
704
|
-
[
|
|
705
|
-
[
|
|
706
|
-
[
|
|
707
|
-
[
|
|
708
|
-
[
|
|
709
|
-
[
|
|
710
|
-
[
|
|
711
|
-
[
|
|
712
|
-
[
|
|
713
|
-
[
|
|
714
|
-
[
|
|
715
|
-
[
|
|
716
|
-
[
|
|
717
|
-
[
|
|
718
|
-
[
|
|
719
|
-
[
|
|
699
|
+
["openai"]: buildProviderCapabilities("openai"),
|
|
700
|
+
["anthropic"]: buildProviderCapabilities("anthropic"),
|
|
701
|
+
["openrouter"]: buildProviderCapabilities("openrouter"),
|
|
702
|
+
["azure"]: buildProviderCapabilities("azure"),
|
|
703
|
+
["google"]: buildProviderCapabilities("google"),
|
|
704
|
+
["cloudflare-gateway"]: buildProviderCapabilities("cloudflare-gateway"),
|
|
705
|
+
["custom"]: buildProviderCapabilities("custom"),
|
|
706
|
+
["bedrock"]: buildProviderCapabilities("bedrock"),
|
|
707
|
+
["vertex"]: buildProviderCapabilities("vertex"),
|
|
708
|
+
["mistral"]: buildProviderCapabilities("mistral"),
|
|
709
|
+
["activepieces"]: buildProviderCapabilities("activepieces"),
|
|
710
|
+
["xai"]: buildProviderCapabilities("xai"),
|
|
711
|
+
["deepseek"]: buildProviderCapabilities("deepseek"),
|
|
712
|
+
["zai"]: buildProviderCapabilities("zai"),
|
|
713
|
+
["qwen"]: buildProviderCapabilities("qwen"),
|
|
714
|
+
["minimax"]: buildProviderCapabilities("minimax"),
|
|
715
|
+
["moonshot"]: buildProviderCapabilities("moonshot")
|
|
720
716
|
};
|
|
721
717
|
|
|
722
718
|
//#endregion
|
|
@@ -742,10 +738,10 @@ function createKeyForFormInput(displayName) {
|
|
|
742
738
|
return displayName.toLowerCase().replace(/\s+(\w)/g, (_, letter) => letter.toUpperCase()).replace(/^(.)/, (letter) => letter.toLowerCase()).replaceAll(/[\\"''\n\r\t]/g, "");
|
|
743
739
|
}
|
|
744
740
|
const HumanInputFormResult = z.union([z.object({
|
|
745
|
-
type: z.literal(
|
|
741
|
+
type: z.literal("file"),
|
|
746
742
|
value: FileResponseInterface
|
|
747
743
|
}), z.object({
|
|
748
|
-
type: z.literal(
|
|
744
|
+
type: z.literal("markdown"),
|
|
749
745
|
value: z.string(),
|
|
750
746
|
files: z.optional(z.array(FileResponseInterface))
|
|
751
747
|
})]);
|
|
@@ -797,7 +793,7 @@ const Field = z.union([z.object({
|
|
|
797
793
|
...BaseModelSchema,
|
|
798
794
|
name: z.string(),
|
|
799
795
|
externalId: z.string(),
|
|
800
|
-
type: z.literal(
|
|
796
|
+
type: z.literal("STATIC_DROPDOWN"),
|
|
801
797
|
tableId: z.string(),
|
|
802
798
|
projectId: z.string(),
|
|
803
799
|
data: z.object({ options: z.array(z.object({ value: z.string() })) })
|
|
@@ -806,10 +802,10 @@ const Field = z.union([z.object({
|
|
|
806
802
|
name: z.string(),
|
|
807
803
|
externalId: z.string(),
|
|
808
804
|
type: z.union([
|
|
809
|
-
z.literal(
|
|
810
|
-
z.literal(
|
|
811
|
-
z.literal(
|
|
812
|
-
z.literal(
|
|
805
|
+
z.literal("TEXT"),
|
|
806
|
+
z.literal("NUMBER"),
|
|
807
|
+
z.literal("DATE"),
|
|
808
|
+
z.literal("DATETIME")
|
|
813
809
|
]),
|
|
814
810
|
tableId: z.string(),
|
|
815
811
|
projectId: z.string()
|
|
@@ -872,15 +868,15 @@ const UpdateRecordRequest = z.object({
|
|
|
872
868
|
agentUpdate: z.optional(z.boolean())
|
|
873
869
|
});
|
|
874
870
|
const Filter = z.discriminatedUnion("operator", [
|
|
875
|
-
valueFilter(
|
|
876
|
-
valueFilter(
|
|
877
|
-
valueFilter(
|
|
878
|
-
valueFilter(
|
|
879
|
-
valueFilter(
|
|
880
|
-
valueFilter(
|
|
881
|
-
valueFilter(
|
|
882
|
-
existenceFilter(
|
|
883
|
-
existenceFilter(
|
|
871
|
+
valueFilter("eq"),
|
|
872
|
+
valueFilter("neq"),
|
|
873
|
+
valueFilter("gt"),
|
|
874
|
+
valueFilter("gte"),
|
|
875
|
+
valueFilter("lt"),
|
|
876
|
+
valueFilter("lte"),
|
|
877
|
+
valueFilter("co"),
|
|
878
|
+
existenceFilter("exists"),
|
|
879
|
+
existenceFilter("not_exists")
|
|
884
880
|
]);
|
|
885
881
|
const ListRecordsRequest = z.object({
|
|
886
882
|
tableId: z.string(),
|
|
@@ -971,13 +967,13 @@ const McpTrigger = z.object({
|
|
|
971
967
|
//#region upstream/core-piece-types/lib/engine-tools.ts
|
|
972
968
|
function normalizeToolOutputToExecuteResponse(raw) {
|
|
973
969
|
if (raw === null || typeof raw !== "object") return {
|
|
974
|
-
status:
|
|
970
|
+
status: "FAILED",
|
|
975
971
|
output: raw,
|
|
976
972
|
resolvedInput: {},
|
|
977
973
|
errorMessage: "Invalid tool output"
|
|
978
974
|
};
|
|
979
975
|
const o = raw;
|
|
980
|
-
if (o["status"] ===
|
|
976
|
+
if (o["status"] === "SUCCESS" || o["status"] === "FAILED") return {
|
|
981
977
|
status: o["status"],
|
|
982
978
|
output: o["output"],
|
|
983
979
|
resolvedInput: o["resolvedInput"] ?? {},
|
|
@@ -991,7 +987,7 @@ function normalizeToolOutputToExecuteResponse(raw) {
|
|
|
991
987
|
}
|
|
992
988
|
if (output === void 0) output = o;
|
|
993
989
|
return {
|
|
994
|
-
status: isError ?
|
|
990
|
+
status: isError ? "FAILED" : "SUCCESS",
|
|
995
991
|
output,
|
|
996
992
|
resolvedInput: {},
|
|
997
993
|
errorMessage: isError ? o["content"]?.[0]?.text ?? o["message"] ?? "Tool failed" : void 0
|
|
@@ -1005,7 +1001,7 @@ function buildSchema(props, auth, requireAuth = true) {
|
|
|
1005
1001
|
const propsSchema = {};
|
|
1006
1002
|
for (const [name, property] of entries) {
|
|
1007
1003
|
switch (property.type) {
|
|
1008
|
-
case
|
|
1004
|
+
case "MARKDOWN":
|
|
1009
1005
|
propsSchema[name] = z.optional(z.union([
|
|
1010
1006
|
z.null(),
|
|
1011
1007
|
z.undefined(),
|
|
@@ -1013,31 +1009,31 @@ function buildSchema(props, auth, requireAuth = true) {
|
|
|
1013
1009
|
z.unknown()
|
|
1014
1010
|
]));
|
|
1015
1011
|
break;
|
|
1016
|
-
case
|
|
1017
|
-
case
|
|
1018
|
-
case
|
|
1019
|
-
case
|
|
1020
|
-
case
|
|
1021
|
-
case
|
|
1012
|
+
case "DATE_TIME":
|
|
1013
|
+
case "SHORT_TEXT":
|
|
1014
|
+
case "LONG_TEXT":
|
|
1015
|
+
case "RICH_TEXT":
|
|
1016
|
+
case "COLOR":
|
|
1017
|
+
case "FILE":
|
|
1022
1018
|
propsSchema[name] = property.required ? z.string().check(z.minLength(1)) : z.string();
|
|
1023
1019
|
break;
|
|
1024
|
-
case
|
|
1020
|
+
case "CHECKBOX":
|
|
1025
1021
|
propsSchema[name] = z.union([z.boolean(), z.string()]);
|
|
1026
1022
|
break;
|
|
1027
|
-
case
|
|
1023
|
+
case "NUMBER":
|
|
1028
1024
|
propsSchema[name] = z.union([property.required ? z.string().check(z.minLength(1)) : z.string(), z.number()]);
|
|
1029
1025
|
break;
|
|
1030
|
-
case
|
|
1031
|
-
case
|
|
1026
|
+
case "STATIC_DROPDOWN":
|
|
1027
|
+
case "DROPDOWN":
|
|
1032
1028
|
propsSchema[name] = z.unknown().check(z.refine((val) => val !== null && val !== void 0, { error: "Value must not be null or undefined" }));
|
|
1033
1029
|
break;
|
|
1034
|
-
case
|
|
1030
|
+
case "SECRET_TEXT":
|
|
1035
1031
|
propsSchema[name] = property.required ? z.string().check(z.minLength(1)) : z.string();
|
|
1036
1032
|
break;
|
|
1037
|
-
case
|
|
1038
|
-
case
|
|
1039
|
-
case
|
|
1040
|
-
case
|
|
1033
|
+
case "BASIC_AUTH":
|
|
1034
|
+
case "CUSTOM_AUTH":
|
|
1035
|
+
case "OAUTH2": break;
|
|
1036
|
+
case "ARRAY": {
|
|
1041
1037
|
const arrayItemSchema = isNil(property.properties) ? property.required ? z.string().check(z.minLength(1)) : z.string() : buildSchema(property.properties, void 0);
|
|
1042
1038
|
propsSchema[name] = z.union([
|
|
1043
1039
|
property.required ? z.array(arrayItemSchema).check(z.minLength(1)) : z.array(arrayItemSchema),
|
|
@@ -1046,31 +1042,29 @@ function buildSchema(props, auth, requireAuth = true) {
|
|
|
1046
1042
|
]);
|
|
1047
1043
|
break;
|
|
1048
1044
|
}
|
|
1049
|
-
case
|
|
1045
|
+
case "OBJECT":
|
|
1050
1046
|
propsSchema[name] = z.union([z.record(z.string(), z.any()), property.required ? z.string().check(z.minLength(1)) : z.string()]);
|
|
1051
1047
|
break;
|
|
1052
|
-
case
|
|
1048
|
+
case "DATE_RANGE":
|
|
1053
1049
|
propsSchema[name] = z.union([z.record(z.string(), z.any()), z.string()]);
|
|
1054
1050
|
break;
|
|
1055
|
-
case
|
|
1051
|
+
case "JSON":
|
|
1056
1052
|
propsSchema[name] = z.union([
|
|
1057
1053
|
z.record(z.string(), z.any()),
|
|
1058
1054
|
z.array(z.any()),
|
|
1059
1055
|
property.required ? z.string().check(z.minLength(1)) : z.string()
|
|
1060
1056
|
]);
|
|
1061
1057
|
break;
|
|
1062
|
-
case
|
|
1063
|
-
case
|
|
1058
|
+
case "MULTI_SELECT_DROPDOWN":
|
|
1059
|
+
case "STATIC_MULTI_SELECT_DROPDOWN":
|
|
1064
1060
|
propsSchema[name] = z.union([property.required ? z.array(z.any()).check(z.minLength(1)) : z.array(z.any()), property.required ? z.string().check(z.minLength(1)) : z.string()]);
|
|
1065
1061
|
break;
|
|
1066
|
-
case
|
|
1062
|
+
case "DYNAMIC":
|
|
1067
1063
|
propsSchema[name] = z.record(z.string(), z.any());
|
|
1068
1064
|
break;
|
|
1069
|
-
case
|
|
1070
|
-
propsSchema[name] = z.unknown();
|
|
1071
|
-
break;
|
|
1065
|
+
case "CUSTOM": propsSchema[name] = z.unknown();
|
|
1072
1066
|
}
|
|
1073
|
-
if (!property.required && property.type !==
|
|
1067
|
+
if (!property.required && property.type !== "ARRAY") propsSchema[name] = z.optional(z.union(isEmpty(propsSchema[name]) ? [
|
|
1074
1068
|
z.any(),
|
|
1075
1069
|
z.null(),
|
|
1076
1070
|
z.undefined()
|
|
@@ -1100,10 +1094,31 @@ let WebhookRenewStrategy = /* @__PURE__ */ function(WebhookRenewStrategy) {
|
|
|
1100
1094
|
return WebhookRenewStrategy;
|
|
1101
1095
|
}({});
|
|
1102
1096
|
const WebhookRenewConfiguration = z.union([z.object({
|
|
1103
|
-
strategy: z.literal(
|
|
1097
|
+
strategy: z.literal("CRON"),
|
|
1104
1098
|
cronExpression: z.string()
|
|
1105
|
-
}), z.object({ strategy: z.literal(
|
|
1099
|
+
}), z.object({ strategy: z.literal("NONE") })]);
|
|
1106
1100
|
var ITrigger = class {
|
|
1101
|
+
name;
|
|
1102
|
+
displayName;
|
|
1103
|
+
description;
|
|
1104
|
+
requireAuth;
|
|
1105
|
+
props;
|
|
1106
|
+
type;
|
|
1107
|
+
handshakeConfiguration;
|
|
1108
|
+
onHandshake;
|
|
1109
|
+
renewConfiguration;
|
|
1110
|
+
onRenew;
|
|
1111
|
+
onEnable;
|
|
1112
|
+
onDisable;
|
|
1113
|
+
onStart;
|
|
1114
|
+
run;
|
|
1115
|
+
test;
|
|
1116
|
+
sampleData;
|
|
1117
|
+
testStrategy;
|
|
1118
|
+
outputSchema;
|
|
1119
|
+
aiMetadata;
|
|
1120
|
+
classification;
|
|
1121
|
+
propertyGroups;
|
|
1107
1122
|
constructor(name, displayName, description, requireAuth, props, type, handshakeConfiguration, onHandshake, renewConfiguration, onRenew, onEnable, onDisable, onStart, run, test, sampleData, testStrategy, outputSchema, aiMetadata, classification, propertyGroups) {
|
|
1108
1123
|
this.name = name;
|
|
1109
1124
|
this.displayName = displayName;
|
|
@@ -1130,10 +1145,10 @@ var ITrigger = class {
|
|
|
1130
1145
|
};
|
|
1131
1146
|
const createTrigger = (params) => {
|
|
1132
1147
|
switch (params.type) {
|
|
1133
|
-
case
|
|
1134
|
-
case
|
|
1135
|
-
case
|
|
1136
|
-
case
|
|
1148
|
+
case "WEBHOOK": return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, params.handshakeConfiguration ?? { strategy: "NONE" }, params.onHandshake ?? (async () => ({ status: 200 })), params.renewConfiguration ?? { strategy: "NONE" }, params.onRenew ?? (async () => Promise.resolve()), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, params.test ? "TEST_FUNCTION" : "SIMULATION", params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);
|
|
1149
|
+
case "POLLING": return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: "NONE" }, async () => ({ status: 200 }), { strategy: "NONE" }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, "TEST_FUNCTION", params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);
|
|
1150
|
+
case "MANUAL": return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: "NONE" }, async () => ({ status: 200 }), { strategy: "NONE" }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, "TEST_FUNCTION", params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);
|
|
1151
|
+
case "APP_WEBHOOK": return new ITrigger(params.name, params.displayName, params.description, params.requireAuth ?? true, params.props, params.type, { strategy: "NONE" }, async () => ({ status: 200 }), { strategy: "NONE" }, async () => Promise.resolve(), params.onEnable, params.onDisable, params.onStart ?? (async () => Promise.resolve()), params.run, params.test ?? (() => Promise.resolve([params.sampleData])), params.sampleData, isNil(params.sampleData) && isNil(params.test) ? "SIMULATION" : "TEST_FUNCTION", params.outputSchema, params.aiMetadata, params.classification, params.propertyGroups);
|
|
1137
1152
|
default: {
|
|
1138
1153
|
const { name, type, strategy } = params;
|
|
1139
1154
|
throw new Error(type === void 0 && strategy !== void 0 ? `createTrigger: trigger ${JSON.stringify(name)} sets \`strategy\`; the field is \`type\`, e.g. type: TriggerStrategy.POLLING` : `createTrigger: trigger ${JSON.stringify(name)} has \`type\` ${JSON.stringify(type)}; set type: TriggerStrategy.POLLING or TriggerStrategy.WEBHOOK`);
|
|
@@ -1165,12 +1180,12 @@ let ContextVersion = /* @__PURE__ */ function(ContextVersion) {
|
|
|
1165
1180
|
ContextVersion["V2"] = "2";
|
|
1166
1181
|
return ContextVersion;
|
|
1167
1182
|
}({});
|
|
1168
|
-
const LATEST_CONTEXT_VERSION =
|
|
1183
|
+
const LATEST_CONTEXT_VERSION = "2";
|
|
1169
1184
|
const MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION = "0.82.0";
|
|
1170
1185
|
const backwardCompatabilityContextUtils = { makeActionContextBackwardCompatible({ context, contextVersion }) {
|
|
1171
1186
|
switch (contextVersion) {
|
|
1172
|
-
case
|
|
1173
|
-
case
|
|
1187
|
+
case "2": return context;
|
|
1188
|
+
case "1": return addLegacyMethods({ context });
|
|
1174
1189
|
case void 0: return addLegacyMethodsAndServerUrl({ context });
|
|
1175
1190
|
}
|
|
1176
1191
|
} };
|
|
@@ -1195,9 +1210,9 @@ function addLegacyMethodsAndServerUrl({ context }) {
|
|
|
1195
1210
|
*/
|
|
1196
1211
|
function buildLegacyPauseHook({ context }) {
|
|
1197
1212
|
return (req) => {
|
|
1198
|
-
const type = req.pauseMetadata.type ===
|
|
1199
|
-
const responseToSend = req.pauseMetadata.type ===
|
|
1200
|
-
const resumeDateTime = req.pauseMetadata.type ===
|
|
1213
|
+
const type = req.pauseMetadata.type === "DELAY" ? "DELAY" : "WEBHOOK";
|
|
1214
|
+
const responseToSend = req.pauseMetadata.type === "WEBHOOK" ? req.pauseMetadata.response : void 0;
|
|
1215
|
+
const resumeDateTime = req.pauseMetadata.type === "DELAY" ? req.pauseMetadata.resumeDateTime : void 0;
|
|
1201
1216
|
context.run.createWaitpoint({
|
|
1202
1217
|
type,
|
|
1203
1218
|
version: "V0",
|
|
@@ -1225,9 +1240,19 @@ function buildLegacyGenerateResumeUrl({ context }) {
|
|
|
1225
1240
|
//#endregion
|
|
1226
1241
|
//#region upstream/framework/lib/piece.ts
|
|
1227
1242
|
var Piece = class {
|
|
1243
|
+
displayName;
|
|
1244
|
+
logoUrl;
|
|
1245
|
+
authors;
|
|
1246
|
+
events;
|
|
1247
|
+
categories;
|
|
1248
|
+
auth;
|
|
1249
|
+
minimumSupportedRelease;
|
|
1250
|
+
maximumSupportedRelease;
|
|
1251
|
+
description;
|
|
1252
|
+
deprecated;
|
|
1228
1253
|
_actions = {};
|
|
1229
1254
|
_triggers = {};
|
|
1230
|
-
getContextInfo = () => ({ version:
|
|
1255
|
+
getContextInfo = () => ({ version: "2" });
|
|
1231
1256
|
constructor(displayName, logoUrl, authors, events, actions, triggers, categories, auth, minimumSupportedRelease = MINIMUM_SUPPORTED_RELEASE_AFTER_LATEST_CONTEXT_VERSION, maximumSupportedRelease, description = "", deprecated) {
|
|
1232
1257
|
this.displayName = displayName;
|
|
1233
1258
|
this.logoUrl = logoUrl;
|
|
@@ -1431,6 +1456,7 @@ const pieceTranslation = {
|
|
|
1431
1456
|
return piece;
|
|
1432
1457
|
}
|
|
1433
1458
|
},
|
|
1459
|
+
/**Gets the piece metadata regardles of piece location (node_modules or dist), wasn't included inside piece.metadata() for backwards compatibility issues (if an old ap version installs a new piece it would fail)*/
|
|
1434
1460
|
initializeI18n: async (pieceOutputPath) => {
|
|
1435
1461
|
try {
|
|
1436
1462
|
const locales = Object.values(LocalesEnum);
|
|
@@ -1508,7 +1534,7 @@ const readLocaleFile = async (locale, pieceOutputPath) => {
|
|
|
1508
1534
|
//#region upstream/framework/lib/test/index.ts
|
|
1509
1535
|
function createMockActionContext(params) {
|
|
1510
1536
|
return {
|
|
1511
|
-
executionType:
|
|
1537
|
+
executionType: "BEGIN",
|
|
1512
1538
|
auth: void 0,
|
|
1513
1539
|
propsValue: params.propsValue,
|
|
1514
1540
|
store: {
|