Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

feat(ai): worker execution path for the simple AI steps (#15488)

Abdul5fe8d1630816
diff --git a/brain/knowledge/execution-runtime/workers.md b/brain/knowledge/execution-runtime/workers.md
index db1203bb24f..ba2ededb071 100644
--- a/brain/knowledge/execution-runtime/workers.md
+++ b/brain/knowledge/execution-runtime/workers.md
@@ -43,7 +43,9 @@ The deep `Resolver`/`Runtime` concurrency and bundle-caching model lives on the
- **Self-contained piece bundles remove cross-piece dedup, so the per-run spike now scales with how many *fat* pieces one flow touches.** A CDN bundle inlines everything: its `package.json` declares **no dependencies** and every `require()` in `src/bundle.cjs` is a Node built-in. Good for install size and it is what finally kills the multi-copy `@activepieces/shared` problem — but two pieces that both use `axios`/`googleapis` no longer share one hoisted copy, they each carry their own. Measured on staging Aug 2026 (`AP_USE_CDN_FOR_BUNDLES=true`, isolate mode): 9 fat bundled pieces in one flow = ~15 MB of uncompressed JS, engine at **926 MB RSS / 788 MB heapUsed** against a V8 `heap_size_limit` of **1216 MB** (`--max-old-space-size=1024` from the default `SANDBOX_MEMORY_LIMIT`) inside a **1 GiB** container already holding a 247 MB worker + 74 MB pm2 → `MEMORY_LIMIT_EXCEEDED`, reproducibly, in ~8 s. The identical flow succeeds with the container raised to 3 GiB. This is the deterministic reproducer for the standing over-commit above: a per-run spike, not accumulation. Sizing rule: budget the engine ceiling against *container minus worker minus pm2*, and treat "many fat pieces in one flow" as the spike driver now that bundles don't share.
- **The cost of a resident `@activepieces/shared` copy is zod schema construction, not data — ~40 MB per copy, and reused engines collect one per piece version.** Heap-snapshotted a dedicated-worker engine at 596 MB RSS / 402 MB heap (0.88.1 beta, pre-CDN-bundles, `AP_REUSE_SANDBOX`), Aug 2026: after a double forced GC, 393 MB survived, and the histogram was **2.05 M anonymous closures (109 MB) + 143 MB of `(object properties)` arrays + 359 k `system/Context` scopes (18 MB)** — instantiated module graphs, not retained run data (only 16 k distinct functions back those 2 M closures). Every sampled retainer path ended `require.cache → @activepieces+shared@<version>/…/<dto>.js → exports → <ZodSchema>._def → get shape → refine/pipe/optional/brand closures`: `shared` eagerly builds ~500 top-level zod DTO trees at import, and zod v4 attaches per-instance accessor/method closures (120 k `get`, 67 k `set`, 31 k `validate` in that one heap). The engine held **9 shared versions at once** (0.37 → 0.96.2) because each piece bundle pins its own, and reuse + `import()` pins them forever — including **3 versions of `piece-hubspot` and 2 of `piece-slack` simultaneously**, one per flow-pinned piece version, so republish/upgrade churn multiplies copies of the *same* piece. Budget ≈ 60–70 MB engine baseline + ~40 MB per distinct resident shared copy. Two independent fixes attack it: CDN self-contained bundles (no shared inside pieces at all, see above) and require()-based piece LRU eviction; snapshot mechanics for redoing this measurement are in the `profile-worker-memory` skill. Follow-up exact measurement (same process at 542 MB heap, 9 shared copies, graph-cut retained sizes): one cleanly-severable copy weighs **41.3 MB / 445 k nodes**, but the other 8 each show <1 MB *exclusive* retained because copies are **co-retained as clusters, and the pin is the ESM module map, not `require.cache`**: deleting every `require.cache` entry under both `.bun` store roots frees only ~65 MB of 553 MB, while blocking the ESM `ModuleWrap`/`SyntheticModule` entries too frees **406 MB** (engine-only floor: 147 MB, which includes main.js's own bundled shared). Retainer chain: `Global handles → SyntheticModule (piece import()) → Piece object → action run closures → context:pieces_framework_1 / shared_1 (whole exports)` — every action closure captures its module scope, so a piece and its framework+shared copies live and die together. Consequence: any eviction scheme must make the *piece entry itself* collectable (hence require()-based loading in the LRU fix — an import()ed entry can never be dropped); purging shared's cache entries alone reclaims ~nothing.
- **~1.3 GB is the idle floor before a single flow runs.** Same box, freshly booted, zero runs: container 1.325 GiB, of which the API process alone is ~1.18 GB and the worker ~213 MB. Sizing a container off "what a flow needs" is wrong by more than a gigabyte — budget the floor first, then add the sandbox ceiling above.
-- **Adding any `WorkerJobType` means six edits, and the compiler only catches four.** In `core/execution/.../job-data.ts`: the enum, `NON_SCHEDULED_JOB_TYPES` if it is not scheduled, the `getDefaultJobPriority` switch (exhaustive with no `default`, so this one is a hard compile error), and the `JobData` union. Then `OneTimeJobAddParams` in `job-queue.ts`, or `jobQueue.add` rejects the payload. Then the lazy handler entry in `worker/.../execute/job-registry.ts` — **that last one is the silent miss**: everything compiles and the job enqueues, it just never runs. Also give the job data a `projectId`, `null` if it has none, because `job-broker.ts` reads `migratedData.projectId as string` for every dequeued job and a member without the property breaks that file and `job-data-migrations.ts` rather than your own. `ExecuteAgentRunJobData` is the shape to copy: nullable `projectId`, and it already flows through that cast.
+- **A job-data schema is a transport contract, not a validator — a constraint the piece never had turns a working saved flow into an enqueue-time failure.** Job payloads that carry piece input are shaped by props that were only ever checked in the builder, and often not even there: `Property.Number` accepts `0` and `-1`, a `DynamicProperties` block can hold a value from an older props shape, and `Property.Array` yields whatever was typed. Writing the natural-looking `z.number().int().positive()` or a bare `z.enum([...])` in the job data rejects those payloads at `jobQueue.add` — before the work is attempted, with a validation message no user can act on, on a flow that ran yesterday. Mirror the props' looseness (`z.number()`), and where a value must be one of a set, `z.enum([...]).optional().catch(undefined)` degrades an unknown value to unset instead of failing the job. Validate in the piece if anywhere; the queue is the wrong place to discover bad input.
+
+- **Adding any `WorkerJobType` means five edits, and the compiler only catches three.** In `core/execution/.../job-data.ts`: the enum, the `getDefaultJobPriority` switch (exhaustive with no `default`, so this one is a hard compile error), and the `JobData` union. Then `OneTimeJobAddParams` in `job-queue.ts`, or `jobQueue.add` rejects the payload. Then the lazy handler entry in `worker/.../execute/job-registry.ts` — **that last one is the silent miss**: everything compiles and the job enqueues, it just never runs. Also give the job data a `projectId`, `null` if it has none, because `job-broker.ts` reads `migratedData.projectId as string` for every dequeued job and a member without the property breaks that file and `job-data-migrations.ts` rather than your own. `ExecuteAgentRunJobData` is the shape to copy: nullable `projectId`, and it already flows through that cast.
- **A new user-interaction `WorkerJobType` must be added to `USER_INTERACTION_JOB_TYPES`** in `packages/server/api/src/app/workers/job-queue/job-queue.ts`. `jobBroker.completeJob` only publishes the engine response back to the waiting webserver for job types in that set — miss it and the caller hangs to `WATCHER_SAFETY_TIMEOUT_MS` (5 min) with no error. `submitAndWaitForResponse` has only that backstop, so any *best-effort* caller must additionally cap itself (`Promise.race` with a short timeout); the losing engine job still runs to completion, so the cap buys back user latency, not fleet capacity.
- **System-job `No handler` = the worker runs the wrong edition.** The single shared `system-job-queue` is consumed by whichever app instance runs `startWorker()`, and EE handlers only register in the CLOUD/ENTERPRISE branches of the edition switch. A worker on a different edition than the instance that *scheduled* the job throws `No handler for job <name>` every tick. Seen July 2026: ~14.6k failures, ~99% `chat-stale-sweep`, because the worker defaulted to community (`AP_EDITION` unset) inside a cloud deployment — CE jobs like `file-cleanup-trigger` ran fine on the same worker, every EE-scheduled job failed identically. Fix on the deployment (`AP_EDITION=cloud`), not by registering EE handlers in CE. The count looks huge because `removeOnComplete: true` hides successes and `removeOnFail` has an age cap but no count cap.
- **When debugging a `MEMORY_LIMIT_EXCEEDED` run in the logs, the worker's `job.execute` line lies — read the app's `completeJob` line instead.** An OOM-killed `EXECUTE_FLOW` still logs `outcome:"success"` in the worker `job.execute` event, because that field is the *worker's* verdict on handling the job, not the flow-run status (the memory path returns `FIRE_AND_FORGET` with `MEMORY_ISSUE`, which the worker treats as handled). The authoritative signal is the app-side line `[workerRpc#completeJob] Job completed by worker job.id=<runId> status:"MEMORY_ISSUE"`. A fast OOM (sandbox dies ~4 s in, deterministic across `FROM_FAILED_STEP` retries) is a per-run heap spike from the flow's own workload — a large file/CSV read into memory or a fat piece output — not infra flakiness; on Cloud the ceiling is fixed so the fix is flow-side. The raw `JavaScript heap out of memory` stderr is captured into the `ActivepiecesError`, **not** shipped to ClickHouse as its own log line, and the per-step run-log body is ZSTD in S3 — to pin the failing step use `debug-failed-job.js --run <id>` on the DevOps box, not the log store. **Localize the death by how many steps the run log actually contains:** a `MEMORY_LIMIT_EXCEEDED` run whose decompressed log holds only the `trigger` step (and `stepsCount: 0`, `failedStep: null`) OOM'd inside the *first action*, before its output could be flushed — the failing step is step_1/step_2, not whatever the flow does later. Classic offender: a `file-helper read_file (text)` → `csv convert_csv_to_json` → grouping-Code chain on a large CSV, which holds the full text, the full JSON row array, and the group as **three coexisting copies** — and because every step output is retained and serialized for the run log, splitting or slimming those intermediates (ideally collapsing read+parse+group into one Code step that returns only the grouped result) is the flow-side fix, since the Cloud sandbox cap can't be raised.
diff --git a/bun.lock b/bun.lock
index 4d71d889995..1747f33905c 100644
--- a/bun.lock
+++ b/bun.lock
@@ -110,6 +110,7 @@
"@ai-sdk/openai-compatible": "3.0.18",
"@openrouter/ai-sdk-provider": "3.0.0",
"ai": "7.0.44",
+ "ai-gateway-provider": "4.0.0",
},
"devDependencies": {
"tslib": "2.6.2",
@@ -12725,17 +12726,17 @@
"@ai-sdk/azure": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/deepseek": "3.0.17", "@ai-sdk/openai": "4.0.25", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-/tIX9dWWAacbAIGHhMjT5zqpkcjucPfT8WPWTtWkJsUMP8cy108MXLFIZLvo5UczNILRWt+vUm/nIF3x1xmOjA=="],
- "@ai-sdk/cerebras": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "2.0.42", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-MK8uzm5k+G0HM/pjHfrQGvPsIUy1zSqat716UNpuGo33GQGsABf3jorXyuKmmsGhQpyoKB03DqKZs821FID3Iw=="],
+ "@ai-sdk/cerebras": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "3.0.18", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-CiQ6oO7nwdgVn9uUXwUQoJZgGB68dGZID1AA+JCcdRX6zKKRBQJvHtZVfUZTxW77O2hRaaOy/am/ggTwXm8Feg=="],
- "@ai-sdk/cohere": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-PvVW9PVXjDjR8lCLLe1N7gdT5LZGNKbJJ1PiHED22++R8qnlDd42l2cSfJeOmf1UtbQFnMTCVAh9s1de3mCv8A=="],
+ "@ai-sdk/cohere": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-qc1uGesoSnN4YiR8/XPgEPMQ1B4N2M+icJhfAELeKW9pNNhqFb2LN22lGuDlOzY9+LXWz+fsRp//iui/c2sXiQ=="],
- "@ai-sdk/deepgram": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-sXE+iQLj4dV9B9IXwLf55YdsuofeheKTbS/0XQfvjn5MCoEq+baQu+eENHrBYF0IXciooislm4pmNGRmwJ2ijw=="],
+ "@ai-sdk/deepgram": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-G4Qfb11lwv28axKB1BTVG+vfPB3qGdy9zwSkAVOeJXCurHG7853udsAZPy71sYxVrHcvB9/hK6mX/rbIav5/3w=="],
"@ai-sdk/deepseek": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-7A4vfmJ5P8Vn+EEPaZFU8uoRnDh/+skTwhCLR/FPw+7AZ7FIPoqn2GtPSdRECTCRxp1fCjfBuvTgOh4PkKQAGg=="],
- "@ai-sdk/elevenlabs": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-lLA1LATQfMxa9EhNWizs1Ykqq4NG+XqjYQlO3a8wk5qsSTT8fn1GbHEbVuOBS+/Wzdt7lno6FSuU36zkgBNH3A=="],
+ "@ai-sdk/elevenlabs": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-wCH/sTsbJRheDB7Ip+ITN3g94/M6or0WLE1rUKE/ftdfnEYVfmNpzCoPqJ1zELZExW+x1lRF5LwN/BQ1lbSjqw=="],
- "@ai-sdk/fireworks": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "2.0.42", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-a3USW0vPUgoZCTVkAt9aU+vIPqrZuuSm7eYRv9grcuOCM4KD00QEaBC4ipAXfU9I8bqO5+RdiZE9e1Uh/nuBKw=="],
+ "@ai-sdk/fireworks": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "3.0.18", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-2EP7xBkX4Iz9WqOcgfSJGIJNKvQzmWZkYcrWz6VtFsjRgobv2qIzeorJfSRb2upCOJYhftxtjOYJh4Lg7cxNqw=="],
"@ai-sdk/gateway": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-YFkZhWH1ksIoSO2b0S/nAboiYBYRhkrmbC/6vOBsKZz6Y0FfBBaIjWBu3lW2n2x7cXEH776RUKGOiEzJYmu+Pw=="],
@@ -12743,17 +12744,17 @@
"@ai-sdk/google-vertex": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/anthropic": "4.0.25", "@ai-sdk/google": "4.0.29", "@ai-sdk/openai-compatible": "3.0.18", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16", "google-auth-library": "^10.6.2" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-WuBIpqfq13M30CO4V6nKIVL30oMni22liZU120H1kar2zuSkJn/QaU5c4ENCbyJ7O8fs0+zk6GE2sHyL7bTPFA=="],
- "@ai-sdk/groq": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-77onMo3RZg6wG9qZQuekqS18YDS1znRZNN6PuBOsSm/TjryttUq4VOhk1HXogc3QWoEaTYGFxjZgZGp3wTJuSg=="],
+ "@ai-sdk/groq": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-dQQSwdMZLUeGI4UKuXflIb3kMxuuMbW4G2xmmvkd7G+fi8GoBBFe7OzmmIp0QZPCshOQV//4KjbMwvI1Hs1RSA=="],
"@ai-sdk/mcp": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.4", "@ai-sdk/provider-utils": "4.0.8", "pkce-challenge": "^5.0.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-TD+7qL7l43hx/XRlRSIzxyRQtxUZxgknJ4FJtytK9Tv/Lw/eVRQnsq4u2TumzYJNOYFsm6NAYTcto248qqMCTg=="],
- "@ai-sdk/mistral": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-dwb+D7xlLNqxn2PSHe6jCgY0vrrJXdYfTShXjNQLr7o15XgtCuQ76ezXHFHdmkb8I2jdVGiuOe+68hwqMw7ZsA=="],
+ "@ai-sdk/mistral": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-4zHnuQbstR5CGN3DFl7U6ks3dEEZFGya+/ajG0YD9ti8k9puxZJQBlYZdSXvd7DJKPIXavhHJ/vJNSzDEibocw=="],
"@ai-sdk/openai": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-iUQSY1EfAyyA8nFAm1UyiHjVyt93i29CVo+8gjT8oxaVjqZIZOlP2Ni4pIHrQTQFrTUD//B83r9NTw0u90/6RQ=="],
"@ai-sdk/openai-compatible": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-IKoElyW52LakNTmqiwM2yXZYTvOnA8XCzP+yUoV5Pf+pudqOL8rsXToXiuLlJapMcWpTpXH0EoWK42zNJd9Dew=="],
- "@ai-sdk/perplexity": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-BlQSjRg3Pqt4pbCHsXTGcWZOjKWifVsF3HVKumKnuOge2FV6nJUjL8k2yUWYZzyuyD5BDhCPAkT3l1cA/JoPnw=="],
+ "@ai-sdk/perplexity": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-qbMw0HKErM+hbLkvNsOPs4ToHHFnk3k8DxR4zqMjQs0OdA0od6je5tEVJlD2EKuHqGR0aGgDkFBZ0DjASRvR/Q=="],
"@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-tbHKNLirllUNF3ZlkCsXnwab2ZV1Sl4b1H/Cp9ruCce15IBmskE8Gwkk0yo9xDWY+jho2of7lVXtwSsyrq7cwQ=="],
@@ -12761,7 +12762,7 @@
"@ai-sdk/replicate": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-GXLqkqQSRR7R279UCHeFnyGdN2s8Nq4C0hFBZztP4M/o0vHajBKq+0GS9D5R3lLra1Hqax6F8IKuF4jAZiQ99Q=="],
- "@ai-sdk/xai": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "2.0.42", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-L9NIlV7iUpx+dLFAtHEeAexugr3zb6Y28zW8WLwaiDcs546VQCgY12toyGn9vJgFleL40J4JUU4J8Ev0XFZnxw=="],
+ "@ai-sdk/xai": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "3.0.18", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-gvWU9t1efRQWDbspy90BTyzo+VQcdQeEkhaBiMj3qH+wZfwnR6XwM1/9U/Dy3Prd1kN4RLewIF5ita49uJkf7w=="],
"@alloc/quick-lru": ["@alloc/[email protected]", "", {}, "sha512-UrcABB+4bUrFABwbluTIBErXwvbsU/V7TZWfmbgJfbkwiBuziS9gxdODUyuiecfdGQ85jglMW6juS3+z5TsKLw=="],
@@ -14717,7 +14718,7 @@
"ai": ["[email protected]", "", { "dependencies": { "@ai-sdk/gateway": "4.0.33", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-OMJ8v3ZzMIt90wIZRluD8c/VgvmX8SvAajGNYEbCeCAiCbr62yhCgXC7MvZRrQ0pOTfLZRohztUVrt5A08gKNg=="],
- "ai-gateway-provider": ["[email protected]", "", { "optionalDependencies": { "@ai-sdk/amazon-bedrock": "^4.0.37", "@ai-sdk/anthropic": "^3.0.29", "@ai-sdk/azure": "^3.0.21", "@ai-sdk/cerebras": "^2.0.23", "@ai-sdk/cohere": "^3.0.12", "@ai-sdk/deepgram": "^2.0.12", "@ai-sdk/deepseek": "^2.0.12", "@ai-sdk/elevenlabs": "^2.0.12", "@ai-sdk/fireworks": "^2.0.22", "@ai-sdk/google": "^3.0.16", "@ai-sdk/google-vertex": "^4.0.35", "@ai-sdk/groq": "^3.0.16", "@ai-sdk/mistral": "^3.0.13", "@ai-sdk/openai": "^3.0.21", "@ai-sdk/perplexity": "^3.0.12", "@ai-sdk/xai": "^3.0.40", "@openrouter/ai-sdk-provider": "^2.1.1" }, "peerDependencies": { "@ai-sdk/openai-compatible": "^2.0.0", "@ai-sdk/provider": "^3.0.0", "@ai-sdk/provider-utils": "^4.0.0", "ai": "^6.0.0" } }, "sha512-RTHkboNz9JocplBSKdDLSMEiN3OkfS1UeZqM93zuQ3BVDR5BmTisThoQR/3pkAVACIYL/8OEQ3kuSuDo820gVw=="],
+ "ai-gateway-provider": ["[email protected]", "", { "optionalDependencies": { "@ai-sdk/amazon-bedrock": "^5.0.8", "@ai-sdk/anthropic": "^4.0.5", "@ai-sdk/azure": "^4.0.5", "@ai-sdk/cerebras": "^3.0.3", "@ai-sdk/cohere": "^4.0.3", "@ai-sdk/deepgram": "^3.0.3", "@ai-sdk/deepseek": "^3.0.3", "@ai-sdk/elevenlabs": "^3.0.4", "@ai-sdk/fireworks": "^3.0.4", "@ai-sdk/google": "^4.0.6", "@ai-sdk/google-vertex": "^5.0.8", "@ai-sdk/groq": "^4.0.3", "@ai-sdk/mistral": "^4.0.3", "@ai-sdk/openai": "^4.0.5", "@ai-sdk/perplexity": "^4.0.4", "@ai-sdk/xai": "^4.0.4", "@openrouter/ai-sdk-provider": "^2.10.0" }, "peerDependencies": { "@ai-sdk/openai-compatible": "^3.0.3", "@ai-sdk/provider": "^4.0.1", "@ai-sdk/provider-utils": "^5.0.3", "ai": "^7.0.11" } }, "sha512-EK8f06Bma1d7kHyrQl05iAfxcG1uRIwUYZj8x8JM11YqFXyWGrC65T+QykccG/J9swI4LeUBuXkwCs7lrwJ0RQ=="],
"airtable": ["[email protected]", "", { "dependencies": { "@types/node": ">=8.0.0 <15", "abort-controller": "^3.0.0", "abortcontroller-polyfill": "^1.4.0", "lodash": "^4.17.21", "node-fetch": "^2.6.7" } }, "sha512-Na67L2TO1DflIJ1yOGhQG5ilMfL2beHpsR+NW/jhaYOa4QcoxZOtDFs08cpSd1tBMsLpz5/rrz/VMX/pGL/now=="],
@@ -18071,6 +18072,8 @@
"@activepieces/piece-ai/ai": ["[email protected]", "", { "dependencies": { "@ai-sdk/gateway": "3.0.105", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@opentelemetry/api": "1.9.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-FWTKeGGDRcYJtPWIrdZDSuvOW5LCjI2NZUJmaml8OTOaPEsXnFdFvmawCXbT+wTGxyWKJTgZ9sZtCjbJsmjM2Q=="],
+ "@activepieces/piece-ai/ai-gateway-provider": ["[email protected]", "", { "optionalDependencies": { "@ai-sdk/amazon-bedrock": "^4.0.37", "@ai-sdk/anthropic": "^3.0.29", "@ai-sdk/azure": "^3.0.21", "@ai-sdk/cerebras": "^2.0.23", "@ai-sdk/cohere": "^3.0.12", "@ai-sdk/deepgram": "^2.0.12", "@ai-sdk/deepseek": "^2.0.12", "@ai-sdk/elevenlabs": "^2.0.12", "@ai-sdk/fireworks": "^2.0.22", "@ai-sdk/google": "^3.0.16", "@ai-sdk/google-vertex": "^4.0.35", "@ai-sdk/groq": "^3.0.16", "@ai-sdk/mistral": "^3.0.13", "@ai-sdk/openai": "^3.0.21", "@ai-sdk/perplexity": "^3.0.12", "@ai-sdk/xai": "^3.0.40", "@openrouter/ai-sdk-provider": "^2.1.1" }, "peerDependencies": { "@ai-sdk/openai-compatible": "^2.0.0", "@ai-sdk/provider": "^3.0.0", "@ai-sdk/provider-utils": "^4.0.0", "ai": "^6.0.0" } }, "sha512-RTHkboNz9JocplBSKdDLSMEiN3OkfS1UeZqM93zuQ3BVDR5BmTisThoQR/3pkAVACIYL/8OEQ3kuSuDo820gVw=="],
+
"@activepieces/piece-aidbase/tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
"@activepieces/piece-aiprise/tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
@@ -18697,21 +18700,17 @@
"@ai-sdk/azure/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "@ai-sdk/cerebras/@ai-sdk/openai-compatible": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-hjq485U/dpi6Hvjzw5+F1vohCrB1kibGHlUFknYGa4nOoCnSvFM1lTXEIyTAkjK1uXgTbNk8vw66lbEyWT12jg=="],
+ "@ai-sdk/cerebras/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "@ai-sdk/cerebras/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+ "@ai-sdk/cohere/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "@ai-sdk/cohere/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
-
- "@ai-sdk/deepgram/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+ "@ai-sdk/deepgram/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
"@ai-sdk/deepseek/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "@ai-sdk/elevenlabs/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
-
- "@ai-sdk/fireworks/@ai-sdk/openai-compatible": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-hjq485U/dpi6Hvjzw5+F1vohCrB1kibGHlUFknYGa4nOoCnSvFM1lTXEIyTAkjK1uXgTbNk8vw66lbEyWT12jg=="],
+ "@ai-sdk/elevenlabs/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "@ai-sdk/fireworks/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+ "@ai-sdk/fireworks/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
"@ai-sdk/gateway/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
@@ -18721,27 +18720,25 @@
"@ai-sdk/google-vertex/google-auth-library": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "gaxios": "^7.1.4", "gcp-metadata": "8.1.2", "google-logging-utils": "1.1.3", "jws": "^4.0.0" } }, "sha512-i1ydyHrqcIxXkWh/uBmVkzCvIuq5yiK2ATndIe5XxKholrG/MTYP9xGYka4sQhrbIAgGjL2B6NOE7rFaiF3fXw=="],
- "@ai-sdk/groq/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+ "@ai-sdk/groq/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
"@ai-sdk/mcp/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-5KXyBOSEX+l67elrEa+wqo/LSsSTtrPj9Uoh3zMbe/ceQX4ucHI3b9nUEfNkGF3Ry1svv90widAt+aiKdIJasQ=="],
"@ai-sdk/mcp/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.4", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.6" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-ns9gN7MmpI8vTRandzgz+KK/zNMLzhrriiKECMt4euLtQFSBgNfydtagPOX4j4pS1/3KvHF6RivhT3gNQgBZsg=="],
- "@ai-sdk/mistral/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+ "@ai-sdk/mistral/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
"@ai-sdk/openai/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
"@ai-sdk/openai-compatible/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "@ai-sdk/perplexity/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+ "@ai-sdk/perplexity/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
"@ai-sdk/provider-utils/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
"@ai-sdk/replicate/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "@ai-sdk/xai/@ai-sdk/openai-compatible": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-hjq485U/dpi6Hvjzw5+F1vohCrB1kibGHlUFknYGa4nOoCnSvFM1lTXEIyTAkjK1uXgTbNk8vw66lbEyWT12jg=="],
-
- "@ai-sdk/xai/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+ "@ai-sdk/xai/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
"@anthropic-ai/sdk/@types/node": ["@types/[email protected]", "", { "dependencies": { "undici-types": "~5.26.4" } }, "sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg=="],
@@ -19783,27 +19780,9 @@
"ai/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "ai-gateway-provider/@ai-sdk/amazon-bedrock": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/anthropic": "3.0.72", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@smithy/eventstream-codec": "^4.0.1", "@smithy/util-utf8": "^4.0.0", "aws4fetch": "^1.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-T0uI1FeZ3IHM6n8x9Taylh1wOY1BYQ86AlLxcVs+oONLHTetSpev9JxJa/QID/3a5L6ve8p1+oXxtyVRrv7N7A=="],
-
- "ai-gateway-provider/@ai-sdk/anthropic": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-t0j9mggxylA9uP0hi12NlRk2npYh4QkE7JIpws2MdV/18QzHcsT6+TNGIjbOPayLQDjrmRKx78Ym7iZkg9qRxQ=="],
-
- "ai-gateway-provider/@ai-sdk/azure": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai": "3.0.54", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-60a9dmRz3s1mgcJeUTrrS/dr2vRXZaypipfLjEW41gdw6Za//Pa2BMEpG+5QSBYDWIZrOdtvvy7yjbBMVqG7wg=="],
-
- "ai-gateway-provider/@ai-sdk/deepseek": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-ATqXxA0u2h201mrtr8KYp6hJGKbnorby9gti/Jgk5m9A3HzWpnw2AjO0uFHTRkhHonhoZD6QH/WyIEQGKDtmIg=="],
+ "ai-gateway-provider/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
- "ai-gateway-provider/@ai-sdk/google": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-SwdaJ6IqguyiVuDRgiRM4sHj7uUO4AETlQFFLF3jcEvu/3yrgIHfw2aM6bBNKSdalw0j25Pedx6qyHc2DWJwrg=="],
-
- "ai-gateway-provider/@ai-sdk/google-vertex": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/anthropic": "3.0.72", "@ai-sdk/google": "3.0.65", "@ai-sdk/openai-compatible": "2.0.42", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "google-auth-library": "^10.5.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-eG7dOZEt3umUWxHHlseYTXLDXdbsVkQ//99liHB38+vLat8SDYcp6+skvguev7OKbl66/8JHdgqRk5Wg7lcd3A=="],
-
- "ai-gateway-provider/@ai-sdk/openai": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-j1qrNe/ebUKuE+fETzS+CVnczs11jQBR9y9M6aoKtJZAosg6SZnPC1Bb92e2u6yaSK+88TZoFhiY67uYphPitw=="],
-
- "ai-gateway-provider/@ai-sdk/openai-compatible": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-hjq485U/dpi6Hvjzw5+F1vohCrB1kibGHlUFknYGa4nOoCnSvFM1lTXEIyTAkjK1uXgTbNk8vw66lbEyWT12jg=="],
-
- "ai-gateway-provider/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
-
- "ai-gateway-provider/@openrouter/ai-sdk-provider": ["@openrouter/[email protected]", "", { "peerDependencies": { "ai": "^6.0.0", "zod": "^3.25.0 || ^4.0.0" } }, "sha512-UypPbVnSExxmG/4Zg0usRiit3auvQVrjUXSyEhm0sZ9GQnW/d8p/bKgCk2neh1W5YyRSo7PNQvCrAEBHZnqQkQ=="],
-
- "ai-gateway-provider/ai": ["[email protected]", "", { "dependencies": { "@ai-sdk/gateway": "3.0.105", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@opentelemetry/api": "1.9.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-FWTKeGGDRcYJtPWIrdZDSuvOW5LCjI2NZUJmaml8OTOaPEsXnFdFvmawCXbT+wTGxyWKJTgZ9sZtCjbJsmjM2Q=="],
+ "ai-gateway-provider/@openrouter/ai-sdk-provider": ["@openrouter/[email protected]", "", { "peerDependencies": { "ai": "^6.0.0", "zod": "^3.25.0 || ^4.0.0" } }, "sha512-FMsAEjLUt5pWuRE2LDC/LCvVrFjLlrEzUITH5+5SZtfq7KZ2wrOHjQVxzz92sju8S9ltpzW87CLW8/b0oBXVCw=="],
"airtable/@types/node": ["@types/[email protected]", "", {}, "sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ=="],
@@ -19821,8 +19800,6 @@
"api/@types/qs": ["@types/[email protected]", "", {}, "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw=="],
- "api/ai-gateway-provider": ["[email protected]", "", { "optionalDependencies": { "@ai-sdk/amazon-bedrock": "^5.0.8", "@ai-sdk/anthropic": "^4.0.5", "@ai-sdk/azure": "^4.0.5", "@ai-sdk/cerebras": "^3.0.3", "@ai-sdk/cohere": "^4.0.3", "@ai-sdk/deepgram": "^3.0.3", "@ai-sdk/deepseek": "^3.0.3", "@ai-sdk/elevenlabs": "^3.0.4", "@ai-sdk/fireworks": "^3.0.4", "@ai-sdk/google": "^4.0.6", "@ai-sdk/google-vertex": "^5.0.8", "@ai-sdk/groq": "^4.0.3", "@ai-sdk/mistral": "^4.0.3", "@ai-sdk/openai": "^4.0.5", "@ai-sdk/perplexity": "^4.0.4", "@ai-sdk/xai": "^4.0.4", "@openrouter/ai-sdk-provider": "^2.10.0" }, "peerDependencies": { "@ai-sdk/openai-compatible": "^3.0.3", "@ai-sdk/provider": "^4.0.1", "@ai-sdk/provider-utils": "^5.0.3", "ai": "^7.0.11" } }, "sha512-EK8f06Bma1d7kHyrQl05iAfxcG1uRIwUYZj8x8JM11YqFXyWGrC65T+QykccG/J9swI4LeUBuXkwCs7lrwJ0RQ=="],
-
"api/fast-xml-parser": ["[email protected]", "", { "dependencies": { "@nodable/entities": "^2.1.0", "fast-xml-builder": "^1.1.5", "path-expression-matcher": "^1.5.0", "strnum": "^2.2.3" }, "bin": { "fxparser": "src/cli/cli.js" } }, "sha512-P7oW7tLbYnhOLQk/Gv7cZgzgMPP/XN03K02/Jy6Y/NHzyIAIpxuZIM/YqAkfiXFPxA2CTm7NtCijK9EDu09u2w=="],
"api/google-auth-library": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "gaxios": "7.1.3", "gcp-metadata": "8.1.2", "google-logging-utils": "1.1.3", "jws": "^4.0.0" } }, "sha512-5awwuLrzNol+pFDmKJd0dKtZ0fPLAtoA5p7YO4ODsDu6ONJUVqbYwvv8y2ZBO5MBNp9TJXigB19710kYpBPdtA=="],
@@ -20837,6 +20814,30 @@
"@activepieces/piece-ai/ai/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/amazon-bedrock": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/anthropic": "3.0.72", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@smithy/eventstream-codec": "^4.0.1", "@smithy/util-utf8": "^4.0.0", "aws4fetch": "^1.0.20" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-T0uI1FeZ3IHM6n8x9Taylh1wOY1BYQ86AlLxcVs+oONLHTetSpev9JxJa/QID/3a5L6ve8p1+oXxtyVRrv7N7A=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/cerebras": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "2.0.42", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-MK8uzm5k+G0HM/pjHfrQGvPsIUy1zSqat716UNpuGo33GQGsABf3jorXyuKmmsGhQpyoKB03DqKZs821FID3Iw=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/cohere": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-PvVW9PVXjDjR8lCLLe1N7gdT5LZGNKbJJ1PiHED22++R8qnlDd42l2cSfJeOmf1UtbQFnMTCVAh9s1de3mCv8A=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/deepgram": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-sXE+iQLj4dV9B9IXwLf55YdsuofeheKTbS/0XQfvjn5MCoEq+baQu+eENHrBYF0IXciooislm4pmNGRmwJ2ijw=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/deepseek": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-ATqXxA0u2h201mrtr8KYp6hJGKbnorby9gti/Jgk5m9A3HzWpnw2AjO0uFHTRkhHonhoZD6QH/WyIEQGKDtmIg=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/elevenlabs": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-lLA1LATQfMxa9EhNWizs1Ykqq4NG+XqjYQlO3a8wk5qsSTT8fn1GbHEbVuOBS+/Wzdt7lno6FSuU36zkgBNH3A=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/fireworks": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "2.0.42", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-a3USW0vPUgoZCTVkAt9aU+vIPqrZuuSm7eYRv9grcuOCM4KD00QEaBC4ipAXfU9I8bqO5+RdiZE9e1Uh/nuBKw=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/groq": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-77onMo3RZg6wG9qZQuekqS18YDS1znRZNN6PuBOsSm/TjryttUq4VOhk1HXogc3QWoEaTYGFxjZgZGp3wTJuSg=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/mistral": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-dwb+D7xlLNqxn2PSHe6jCgY0vrrJXdYfTShXjNQLr7o15XgtCuQ76ezXHFHdmkb8I2jdVGiuOe+68hwqMw7ZsA=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/perplexity": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-BlQSjRg3Pqt4pbCHsXTGcWZOjKWifVsF3HVKumKnuOge2FV6nJUjL8k2yUWYZzyuyD5BDhCPAkT3l1cA/JoPnw=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/xai": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "2.0.42", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-L9NIlV7iUpx+dLFAtHEeAexugr3zb6Y28zW8WLwaiDcs546VQCgY12toyGn9vJgFleL40J4JUU4J8Ev0XFZnxw=="],
+
"@activepieces/piece-amazon-secrets-manager/@aws-sdk/client-secrets-manager/@aws-sdk/util-endpoints": ["@aws-sdk/[email protected]", "", { "dependencies": { "@aws-sdk/types": "^3.973.1", "@smithy/types": "^4.12.0", "@smithy/url-parser": "^4.2.8", "@smithy/util-endpoints": "^3.2.8", "tslib": "^2.6.2" } }, "sha512-eKmAOeQM4Qusq0jtcbZPiNWky8XaojByKC/n+THbJ8vJf7t4ys8LlcZ4PrBSHZISe9cC484mQsPVOQh6iySjqw=="],
"@activepieces/piece-amazon-secrets-manager/@aws-sdk/client-secrets-manager/@smithy/node-http-handler": ["@smithy/[email protected]", "", { "dependencies": { "@smithy/protocol-http": "^5.3.14", "@smithy/querystring-builder": "^4.2.14", "@smithy/types": "^4.14.1", "tslib": "^2.6.2" } }, "sha512-iB+orM4x3xrr57X3YaXazfKnntl0LHlZB1kcXSGzMV1Tt0+YwEjGlbjk/44qEGtBzXAz6yFDzkYTKSV6Pj2HUg=="],
@@ -20995,8 +20996,18 @@
"@ai-sdk/azure/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+ "@ai-sdk/cerebras/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
+ "@ai-sdk/cohere/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
+ "@ai-sdk/deepgram/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
"@ai-sdk/deepseek/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+ "@ai-sdk/elevenlabs/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
+ "@ai-sdk/fireworks/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
"@ai-sdk/gateway/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
"@ai-sdk/google-vertex/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
@@ -21009,12 +21020,20 @@
"@ai-sdk/google/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+ "@ai-sdk/groq/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
+ "@ai-sdk/mistral/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
"@ai-sdk/openai-compatible/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
"@ai-sdk/openai/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+ "@ai-sdk/perplexity/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
"@ai-sdk/replicate/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+ "@ai-sdk/xai/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
+
"@anthropic-ai/sdk/@types/node/undici-types": ["[email protected]", "", {}, "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="],
"@atlaskit/adf-schema/linkify-it/uc.micro": ["[email protected]", "", {}, "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA=="],
@@ -21259,13 +21278,9 @@
"@typescript-eslint/typescript-estree/minimatch/brace-expansion": ["[email protected]", "", { "dependencies": { "balanced-match": "^1.0.0" } }, "sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w=="],
- "ai-gateway-provider/@ai-sdk/amazon-bedrock/@smithy/eventstream-codec": ["@smithy/[email protected]", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.14.1", "@smithy/util-hex-encoding": "^4.2.2", "tslib": "^2.6.2" } }, "sha512-erZq0nOIpzfeZdCyzZjdJb4nVSKLUmSkaQUVkRGQTXs30gyUGeKnrYEg+Xe1W5gE3aReS7IgsvANwVPxSzY6Pw=="],
-
- "ai-gateway-provider/@ai-sdk/amazon-bedrock/@smithy/util-utf8": ["@smithy/[email protected]", "", { "dependencies": { "@smithy/util-buffer-from": "^4.2.2", "tslib": "^2.6.2" } }, "sha512-75MeYpjdWRe8M5E3AW0O4Cx3UadweS+cwdXjwYGBW5h/gxxnbeZ877sLPX/ZJA9GVTlL/qG0dXP29JWFCD1Ayw=="],
+ "ai-gateway-provider/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
- "ai-gateway-provider/@ai-sdk/google-vertex/google-auth-library": ["[email protected]", "", { "dependencies": { "base64-js": "^1.3.0", "ecdsa-sig-formatter": "^1.0.11", "gaxios": "7.1.3", "gcp-metadata": "8.1.2", "google-logging-utils": "1.1.3", "jws": "^4.0.0" } }, "sha512-5awwuLrzNol+pFDmKJd0dKtZ0fPLAtoA5p7YO4ODsDu6ONJUVqbYwvv8y2ZBO5MBNp9TJXigB19710kYpBPdtA=="],
-
- "ai-gateway-provider/ai/@ai-sdk/gateway": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-XpERadvLMHkYGJO4hz1Sw7Y9J705Iex48TmdZLdZdaPiFFtVgiA9qhXugLUWGAxdlXU/2N6ipoPSOwfnULZbXw=="],
+ "ai-gateway-provider/@openrouter/ai-sdk-provider/ai": ["[email protected]", "", { "dependencies": { "@ai-sdk/gateway": "3.0.105", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@opentelemetry/api": "1.9.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-FWTKeGGDRcYJtPWIrdZDSuvOW5LCjI2NZUJmaml8OTOaPEsXnFdFvmawCXbT+wTGxyWKJTgZ9sZtCjbJsmjM2Q=="],
"ai/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
@@ -21273,28 +21288,6 @@
"api/@modelcontextprotocol/sdk/eventsource-parser": ["[email protected]", "", {}, "sha512-6RxOBZ/cYgd8usLwsEl+EC09Au/9BcmCKYF2/xbml6DNczf7nv0MQb+7BA2F+li6//I+28VNlQR37XfQtcAJuA=="],
- "api/ai-gateway-provider/@ai-sdk/cerebras": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "3.0.18", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-CiQ6oO7nwdgVn9uUXwUQoJZgGB68dGZID1AA+JCcdRX6zKKRBQJvHtZVfUZTxW77O2hRaaOy/am/ggTwXm8Feg=="],
-
- "api/ai-gateway-provider/@ai-sdk/cohere": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-qc1uGesoSnN4YiR8/XPgEPMQ1B4N2M+icJhfAELeKW9pNNhqFb2LN22lGuDlOzY9+LXWz+fsRp//iui/c2sXiQ=="],
-
- "api/ai-gateway-provider/@ai-sdk/deepgram": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-G4Qfb11lwv28axKB1BTVG+vfPB3qGdy9zwSkAVOeJXCurHG7853udsAZPy71sYxVrHcvB9/hK6mX/rbIav5/3w=="],
-
- "api/ai-gateway-provider/@ai-sdk/elevenlabs": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-wCH/sTsbJRheDB7Ip+ITN3g94/M6or0WLE1rUKE/ftdfnEYVfmNpzCoPqJ1zELZExW+x1lRF5LwN/BQ1lbSjqw=="],
-
- "api/ai-gateway-provider/@ai-sdk/fireworks": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "3.0.18", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-2EP7xBkX4Iz9WqOcgfSJGIJNKvQzmWZkYcrWz6VtFsjRgobv2qIzeorJfSRb2upCOJYhftxtjOYJh4Lg7cxNqw=="],
-
- "api/ai-gateway-provider/@ai-sdk/groq": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-dQQSwdMZLUeGI4UKuXflIb3kMxuuMbW4G2xmmvkd7G+fi8GoBBFe7OzmmIp0QZPCshOQV//4KjbMwvI1Hs1RSA=="],
-
- "api/ai-gateway-provider/@ai-sdk/mistral": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-4zHnuQbstR5CGN3DFl7U6ks3dEEZFGya+/ajG0YD9ti8k9puxZJQBlYZdSXvd7DJKPIXavhHJ/vJNSzDEibocw=="],
-
- "api/ai-gateway-provider/@ai-sdk/perplexity": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-qbMw0HKErM+hbLkvNsOPs4ToHHFnk3k8DxR4zqMjQs0OdA0od6je5tEVJlD2EKuHqGR0aGgDkFBZ0DjASRvR/Q=="],
-
- "api/ai-gateway-provider/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "4.0.4", "@standard-schema/spec": "^1.1.0", "@workflow/serde": "4.1.0", "eventsource-parser": "^3.0.8", "undici": "^7.28.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-LWDrmYWkZoAJwMbToUglpR6AmgvtnNtCCGeU9MKlXiSV3Yiu4u73/pVA18sQAAe3kZtCRBY9P31lAfnPekWWyg=="],
-
- "api/ai-gateway-provider/@ai-sdk/xai": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/openai-compatible": "3.0.18", "@ai-sdk/provider": "4.0.4", "@ai-sdk/provider-utils": "5.0.16" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-gvWU9t1efRQWDbspy90BTyzo+VQcdQeEkhaBiMj3qH+wZfwnR6XwM1/9U/Dy3Prd1kN4RLewIF5ita49uJkf7w=="],
-
- "api/ai-gateway-provider/@openrouter/ai-sdk-provider": ["@openrouter/[email protected]", "", { "peerDependencies": { "ai": "^6.0.0", "zod": "^3.25.0 || ^4.0.0" } }, "sha512-FMsAEjLUt5pWuRE2LDC/LCvVrFjLlrEzUITH5+5SZtfq7KZ2wrOHjQVxzz92sju8S9ltpzW87CLW8/b0oBXVCw=="],
-
"api/google-auth-library/gaxios": ["[email protected]", "", { "dependencies": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", "node-fetch": "^3.3.2", "rimraf": "^5.0.1" } }, "sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ=="],
"api/google-auth-library/gcp-metadata": ["[email protected]", "", { "dependencies": { "gaxios": "^7.0.0", "google-logging-utils": "^1.0.0", "json-bigint": "^1.0.0" } }, "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg=="],
@@ -22087,6 +22080,10 @@
"@activepieces/piece-ai/@ai-sdk/google-vertex/google-auth-library/jws": ["[email protected]", "", { "dependencies": { "jwa": "^2.0.1", "safe-buffer": "^5.0.1" } }, "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA=="],
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/amazon-bedrock/@smithy/eventstream-codec": ["@smithy/[email protected]", "", { "dependencies": { "@aws-crypto/crc32": "5.2.0", "@smithy/types": "^4.14.1", "@smithy/util-hex-encoding": "^4.2.2", "tslib": "^2.6.2" } }, "sha512-erZq0nOIpzfeZdCyzZjdJb4nVSKLUmSkaQUVkRGQTXs30gyUGeKnrYEg+Xe1W5gE3aReS7IgsvANwVPxSzY6Pw=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/amazon-bedrock/@smithy/util-utf8": ["@smithy/[email protected]", "", { "dependencies": { "@smithy/util-buffer-from": "^4.2.2", "tslib": "^2.6.2" } }, "sha512-75MeYpjdWRe8M5E3AW0O4Cx3UadweS+cwdXjwYGBW5h/gxxnbeZ877sLPX/ZJA9GVTlL/qG0dXP29JWFCD1Ayw=="],
+
"@activepieces/piece-gmail/google-auth-library/gaxios/node-fetch": ["[email protected]", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],
"@activepieces/piece-gmail/google-auth-library/jws/jwa": ["[email protected]", "", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg=="],
@@ -22301,22 +22298,14 @@
"@tryfabric/martian/remark-gfm/micromark-extension-gfm/micromark-extension-gfm-task-list-item": ["[email protected]", "", { "dependencies": { "micromark": "~2.11.0" } }, "sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ=="],
- "ai-gateway-provider/@ai-sdk/amazon-bedrock/@smithy/eventstream-codec/tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+ "ai-gateway-provider/@openrouter/ai-sdk-provider/ai/@ai-sdk/gateway": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-XpERadvLMHkYGJO4hz1Sw7Y9J705Iex48TmdZLdZdaPiFFtVgiA9qhXugLUWGAxdlXU/2N6ipoPSOwfnULZbXw=="],
- "ai-gateway-provider/@ai-sdk/amazon-bedrock/@smithy/util-utf8/tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+ "ai-gateway-provider/@openrouter/ai-sdk-provider/ai/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
- "ai-gateway-provider/@ai-sdk/google-vertex/google-auth-library/gaxios": ["[email protected]", "", { "dependencies": { "extend": "^3.0.2", "https-proxy-agent": "^7.0.1", "node-fetch": "^3.3.2", "rimraf": "^5.0.1" } }, "sha512-YGGyuEdVIjqxkxVH1pUTMY/XtmmsApXrCVv5EU25iX6inEPbV+VakJfLealkBtJN69AQmh1eGOdCl9Sm1UP6XQ=="],
-
- "ai-gateway-provider/@ai-sdk/google-vertex/google-auth-library/gcp-metadata": ["[email protected]", "", { "dependencies": { "gaxios": "^7.0.0", "google-logging-utils": "^1.0.0", "json-bigint": "^1.0.0" } }, "sha512-zV/5HKTfCeKWnxG0Dmrw51hEWFGfcF2xiXqcA3+J90WDuP0SvoiSO5ORvcBsifmx/FoIjgQN3oNOGaQ5PhLFkg=="],
-
- "ai-gateway-provider/@ai-sdk/google-vertex/google-auth-library/jws": ["[email protected]", "", { "dependencies": { "jwa": "^2.0.1", "safe-buffer": "^5.0.1" } }, "sha512-EKI/M/yqPncGUUh44xz0PxSidXFr/+r0pA70+gIYhjv+et7yxM+s29Y+VGDkovRofQem0fs7Uvf4+YmAdyRduA=="],
+ "ai-gateway-provider/@openrouter/ai-sdk-provider/ai/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.8" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-oXIw1oLmuBILuvHgSj6w5LOV8oSnFRouPSv0MGkG9sRMeukZ9JnMF17kldaRQaRq8lSJIxo6aS3NzWlVmSb+4Q=="],
"api/@ai-sdk/mcp/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
- "api/ai-gateway-provider/@ai-sdk/provider-utils/undici": ["[email protected]", "", {}, "sha512-cRZYrTDwWznlnRiPjggAGxZXanty6M8RV1ff8Wm4LWXBp7/IG8v5DnOm74DtUBp9OONpK75YlPnIjQqX0dBDtA=="],
-
- "api/ai-gateway-provider/@openrouter/ai-sdk-provider/ai": ["[email protected]", "", { "dependencies": { "@ai-sdk/gateway": "3.0.105", "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@opentelemetry/api": "1.9.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-FWTKeGGDRcYJtPWIrdZDSuvOW5LCjI2NZUJmaml8OTOaPEsXnFdFvmawCXbT+wTGxyWKJTgZ9sZtCjbJsmjM2Q=="],
-
"api/google-auth-library/gaxios/node-fetch": ["[email protected]", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],
"api/google-auth-library/jws/jwa": ["[email protected]", "", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg=="],
@@ -22531,6 +22520,10 @@
"@activepieces/piece-ai/@ai-sdk/google-vertex/google-auth-library/jws/jwa": ["[email protected]", "", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg=="],
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/amazon-bedrock/@smithy/eventstream-codec/tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
+ "@activepieces/piece-ai/ai-gateway-provider/@ai-sdk/amazon-bedrock/@smithy/util-utf8/tslib": ["[email protected]", "", {}, "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w=="],
+
"@ai-sdk/google-vertex/google-auth-library/gcp-metadata/gaxios/node-fetch": ["[email protected]", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],
"@atlaskit/editor-json-transformer/@atlaskit/editor-prosemirror/prosemirror-commands/prosemirror-state/prosemirror-view": ["[email protected]", "", { "dependencies": { "prosemirror-model": "^1.20.0", "prosemirror-state": "^1.0.0", "prosemirror-transform": "^1.1.0" } }, "sha512-TnKDdohEatgyZNGCDWIdccOHXhYloJwbwU+phw/a23KBvJIR9lWQWW7WHHK3vBdOLDNuF7TaX98GObUZOWkOnA=="],
@@ -22607,16 +22600,6 @@
"@tryfabric/martian/remark-gfm/mdast-util-gfm/mdast-util-gfm-autolink-literal/mdast-util-find-and-replace": ["[email protected]", "", { "dependencies": { "escape-string-regexp": "^4.0.0", "unist-util-is": "^4.0.0", "unist-util-visit-parents": "^3.0.0" } }, "sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA=="],
- "ai-gateway-provider/@ai-sdk/google-vertex/google-auth-library/gaxios/node-fetch": ["[email protected]", "", { "dependencies": { "data-uri-to-buffer": "^4.0.0", "fetch-blob": "^3.1.4", "formdata-polyfill": "^4.0.10" } }, "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA=="],
-
- "ai-gateway-provider/@ai-sdk/google-vertex/google-auth-library/jws/jwa": ["[email protected]", "", { "dependencies": { "buffer-equal-constant-time": "^1.0.1", "ecdsa-sig-formatter": "1.0.11", "safe-buffer": "^5.0.1" } }, "sha512-hRF04fqJIP8Abbkq5NKGN0Bbr3JxlQ+qhZufXVr0DvujKy93ZCbXZMHDL4EOtodSbCWxOqR8MS1tXA5hwqCXDg=="],
-
- "api/ai-gateway-provider/@openrouter/ai-sdk-provider/ai/@ai-sdk/gateway": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@ai-sdk/provider-utils": "4.0.24", "@vercel/oidc": "3.2.0" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-XpERadvLMHkYGJO4hz1Sw7Y9J705Iex48TmdZLdZdaPiFFtVgiA9qhXugLUWGAxdlXU/2N6ipoPSOwfnULZbXw=="],
-
- "api/ai-gateway-provider/@openrouter/ai-sdk-provider/ai/@ai-sdk/provider": ["@ai-sdk/[email protected]", "", { "dependencies": { "json-schema": "^0.4.0" } }, "sha512-/ngMKqKdL9dSlY/eQ3NFDzzFyw0Hix+cbFFlyuKEKcOgpHdBt/spKUvX/i0wGrDLFPYJeVvv3N0j92LxWRL7yQ=="],
-
- "api/ai-gateway-provider/@openrouter/ai-sdk-provider/ai/@ai-sdk/provider-utils": ["@ai-sdk/[email protected]", "", { "dependencies": { "@ai-sdk/provider": "3.0.9", "@standard-schema/spec": "^1.1.0", "eventsource-parser": "^3.0.8" }, "peerDependencies": { "zod": "^3.25.76 || ^4.1.8" } }, "sha512-oXIw1oLmuBILuvHgSj6w5LOV8oSnFRouPSv0MGkG9sRMeukZ9JnMF17kldaRQaRq8lSJIxo6aS3NzWlVmSb+4Q=="],
-
"checkly/@typescript-eslint/typescript-estree/minimatch/brace-expansion/balanced-match": ["[email protected]", "", {}, "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA=="],
"qrcode/yargs/find-up/locate-path/p-locate": ["[email protected]", "", { "dependencies": { "p-limit": "^2.2.0" } }, "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A=="],
diff --git a/packages/core/ai-providers/package.json b/packages/core/ai-providers/package.json
index 299b00757ee..720780e5f39 100644
--- a/packages/core/ai-providers/package.json
+++ b/packages/core/ai-providers/package.json
@@ -21,7 +21,8 @@
"@ai-sdk/openai": "4.0.25",
"@ai-sdk/openai-compatible": "3.0.18",
"@openrouter/ai-sdk-provider": "3.0.0",
- "ai": "7.0.44"
+ "ai": "7.0.44",
+ "ai-gateway-provider": "4.0.0"
},
"devDependencies": {
"tslib": "2.6.2",
diff --git a/packages/core/ai-providers/src/index.ts b/packages/core/ai-providers/src/index.ts
index 6db6681f6ce..18c864b6e89 100644
--- a/packages/core/ai-providers/src/index.ts
+++ b/packages/core/ai-providers/src/index.ts
@@ -1,2 +1,4 @@
export { createLanguageModel, buildOpenAICompatibleHeaders } from './lib/create-language-model'
export type { CreateLanguageModelParams, LanguageModelOptions } from './lib/create-language-model'
+export { createCloudflareGatewayModel } from './lib/create-cloudflare-gateway-model'
+export type { CreateCloudflareGatewayModelParams, CloudflareGatewayMetadata, CloudflareGatewayRouting } from './lib/create-cloudflare-gateway-model'
diff --git a/packages/core/ai-providers/src/lib/create-cloudflare-gateway-model.test.ts b/packages/core/ai-providers/src/lib/create-cloudflare-gateway-model.test.ts
new file mode 100644
index 00000000000..a6bb82cc832
--- /dev/null
+++ b/packages/core/ai-providers/src/lib/create-cloudflare-gateway-model.test.ts
@@ -0,0 +1,88 @@
+import { describe, expect, it } from 'vitest'
+import { createCloudflareGatewayModel } from './create-cloudflare-gateway-model'
+
+type ModelIdentity = { provider: string, modelId: string, config?: { headers?: () => Record<string, string>, baseURL?: string | (() => string), url?: (options: { path: string }) => string } }
+
+function identify(model: unknown): ModelIdentity {
+ return model as ModelIdentity
+}
+
+const auth = { apiKey: 'cf-key' }
+const config = { accountId: 'acct', gatewayId: 'gw' }
+
+describe('createCloudflareGatewayModel', () => {
+ describe('compat routing', () => {
+ it('strips the submodel prefix from the model id', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'openai/gpt-4o' }))
+ expect(model.modelId).toBe('gpt-4o')
+ })
+
+ it('sends the gateway authorization header and no metadata header', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'openai/gpt-4o' }))
+ const headers = model.config?.headers?.() ?? {}
+ expect(headers['cf-aig-authorization']).toBe('Bearer cf-key')
+ expect(headers['cf-aig-metadata']).toBeUndefined()
+ })
+
+ it('ignores the submodel prefix and stays on the compat endpoint', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'anthropic/claude-sonnet-4' }))
+ expect(model.modelId).toBe('claude-sonnet-4')
+ expect(model.provider).toContain('cloudflare')
+ })
+ })
+
+ describe('submodel routing', () => {
+ it('routes an openai submodel to the gateway openai endpoint with the stripped id', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'openai/gpt-4o', routing: 'submodel' }))
+ expect(model.modelId).toBe('gpt-4o')
+ expect(model.provider).toContain('openai')
+ })
+
+ it('falls back to the compat endpoint with the full model id for an unmapped prefix', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'mystery/some-model', routing: 'submodel' }))
+ expect(model.modelId).toBe('mystery/some-model')
+ expect(model.provider).toContain('cloudflare')
+ })
+
+ it('falls back to compat when a vertex submodel has no vertex project configured', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'google-vertex-ai/publishers/google/models/gemini-2.0', routing: 'submodel' }))
+ expect(model.provider).toContain('cloudflare')
+ })
+
+ it('routes an anthropic submodel through the gateway wrapper', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'anthropic/claude-sonnet-4', routing: 'submodel' }))
+ expect(model.modelId).toBe('claude-sonnet-4')
+ })
+
+ it('routes a google-ai-studio submodel through the gateway wrapper', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'google-ai-studio/gemini-2.0-flash', routing: 'submodel' }))
+ expect(model.modelId).toBe('gemini-2.0-flash')
+ })
+
+ it('serialises step metadata into the gateway metadata header', () => {
+ const model = identify(createCloudflareGatewayModel({
+ auth,
+ config,
+ modelId: 'mystery/some-model',
+ routing: 'submodel',
+ metadata: { projectId: 'p1', flowId: 'f1', runId: 'r1' },
+ }))
+ const headers = model.config?.headers?.() ?? {}
+ expect(JSON.parse(headers['cf-aig-metadata'])).toEqual({ projectId: 'p1', flowId: 'f1', runId: 'r1' })
+ })
+ })
+
+ describe('image models', () => {
+ it('builds an image model for an openai submodel', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'openai/dall-e-3', routing: 'submodel', isImage: true }))
+ expect(model.modelId).toBe('dall-e-3')
+ expect(model.provider).toContain('openai')
+ })
+
+ it('builds a compat image model for an unmapped prefix', () => {
+ const model = identify(createCloudflareGatewayModel({ auth, config, modelId: 'mystery/some-image-model', routing: 'submodel', isImage: true }))
+ expect(model.modelId).toBe('mystery/some-image-model')
+ expect(model.provider).toContain('cloudflare')
+ })
+ })
+})
diff --git a/packages/core/ai-providers/src/lib/create-cloudflare-gateway-model.ts b/packages/core/ai-providers/src/lib/create-cloudflare-gateway-model.ts
new file mode 100644
index 00000000000..ab30fad8f12
--- /dev/null
+++ b/packages/core/ai-providers/src/lib/create-cloudflare-gateway-model.ts
@@ -0,0 +1,101 @@
+import { isNil, observedProviderFetch, ProviderOutcomeReporter, spreadIfDefined } from '@activepieces/core-utils'
+import { BaseAIProviderAuthConfig, CloudflareGatewayProviderConfig, splitCloudflareGatewayModelId } from '@activepieces/core-piece-types'
+import { createAnthropic } from '@ai-sdk/anthropic'
+import { createGoogleGenerativeAI } from '@ai-sdk/google'
+import { createOpenAI } from '@ai-sdk/openai'
+import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
+import { ImageModel, LanguageModel } from 'ai'
+import { createAiGateway } from 'ai-gateway-provider'
+
+export function createCloudflareGatewayModel(params: CreateCloudflareGatewayModelParams & { isImage: true }): ImageModel
+export function createCloudflareGatewayModel(params: CreateCloudflareGatewayModelParams & { isImage?: false }): LanguageModel
+export function createCloudflareGatewayModel({ auth, config, modelId, isImage = false, openaiResponsesModel = false, routing = 'compat', metadata, onOutcome }: CreateCloudflareGatewayModelParams): ImageModel | LanguageModel {
+ const { apiKey } = auth as BaseAIProviderAuthConfig
+ const { accountId, gatewayId, vertexProject, vertexRegion } = config as CloudflareGatewayProviderConfig
+ const { provider: providerPrefix, model: actualModelId, publisher } = splitCloudflareGatewayModelId(modelId)
+ const headers = {
+ 'cf-aig-authorization': `Bearer ${apiKey}`,
+ ...(isNil(metadata) ? {} : { 'cf-aig-metadata': JSON.stringify(metadata) }),
+ }
+
+ if (routing === 'compat') {
+ return compatGatewayModel({ accountId, gatewayId, headers, isImage, modelId: actualModelId, onOutcome })
+ }
+
+ const aigateway = createAiGateway({ accountId, gateway: gatewayId, apiKey })
+ switch (providerPrefix) {
+ case 'anthropic':
+ return aigateway(createAnthropic({ apiKey: CF_TEMP_TOKEN, headers })(actualModelId))
+ case 'google-ai-studio':
+ return aigateway(createGoogleGenerativeAI({ apiKey: CF_TEMP_TOKEN, headers })(actualModelId))
+ case 'google-vertex-ai': {
+ if (isNil(vertexProject) || isNil(vertexRegion) || isNil(publisher)) {
+ return compatGatewayModel({ accountId, gatewayId, headers, isImage, modelId })
+ }
+ return createGoogleGenerativeAI({
+ apiKey,
+ baseURL: `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/google-vertex-ai/v1/projects/${vertexProject}/locations/${vertexRegion}/publishers/${publisher}/`,
+ headers,
+ })(actualModelId)
+ }
+ case 'openai': {
+ const openaiProvider = createOpenAI({
+ apiKey: NO_KEY_PLACEHOLDER,
+ baseURL: `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/openai`,
+ headers,
+ fetch: stripAuthorizationHeader,
+ })
+ if (isImage) {
+ return openaiProvider.imageModel(actualModelId)
+ }
+ return openaiResponsesModel ? openaiProvider.responses(actualModelId) : openaiProvider.chat(actualModelId)
+ }
+ default:
+ return compatGatewayModel({ accountId, gatewayId, headers, isImage, modelId })
+ }
+}
+
+function compatGatewayModel({ accountId, gatewayId, headers, isImage, modelId, onOutcome }: {
+ accountId: string
+ gatewayId: string
+ headers: Record<string, string>
+ isImage: boolean
+ modelId: string
+ onOutcome?: ProviderOutcomeReporter
+}): ImageModel | LanguageModel {
+ const provider = createOpenAICompatible({
+ name: 'cloudflare',
+ baseURL: `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/compat`,
+ headers,
+ ...spreadIfDefined('fetch', observedProviderFetch(onOutcome)),
+ })
+ return isImage ? provider.imageModel(modelId) : provider.chatModel(modelId)
+}
+
+const stripAuthorizationHeader: typeof globalThis.fetch = (input, init) => {
+ const headers = new Headers(init?.headers)
+ headers.delete('Authorization')
+ return fetch(input, { ...init, headers })
+}
+
+const NO_KEY_PLACEHOLDER = 'no-key'
+const CF_TEMP_TOKEN = 'CF_TEMP_TOKEN'
+
+export type CloudflareGatewayRouting = 'compat' | 'submodel'
+
+export type CloudflareGatewayMetadata = {
+ projectId: string
+ flowId: string
+ runId: string
+}
+
+export type CreateCloudflareGatewayModelParams = {
+ auth: Record<string, unknown>
+ config: Record<string, unknown>
+ modelId: string
+ isImage?: boolean
+ openaiResponsesModel?: boolean
+ routing?: CloudflareGatewayRouting
+ metadata?: CloudflareGatewayMetadata
+ onOutcome?: ProviderOutcomeReporter
+}
diff --git a/packages/core/execution/src/lib/workers/job-data.ts b/packages/core/execution/src/lib/workers/job-data.ts
index c47e9159be2..88555d77bfb 100644
--- a/packages/core/execution/src/lib/workers/job-data.ts
+++ b/packages/core/execution/src/lib/workers/job-data.ts
@@ -67,6 +67,7 @@ export function getDefaultJobPriority(job: JobData): keyof typeof JOB_PRIORITY {
case WorkerJobType.EXECUTE_TOKEN_REFRESH:
return 'critical'
case WorkerJobType.EXECUTE_AGENT_RUN:
+ case WorkerJobType.EXECUTE_AI:
case WorkerJobType.EXECUTE_ACTION:
return 'high'
}
@@ -84,6 +85,7 @@ export enum WorkerJobType {
EXECUTE_EXTRACT_PIECE_INFORMATION = 'EXECUTE_EXTRACT_PIECE_INFORMATION',
EVENT_DESTINATION = 'EVENT_DESTINATION',
EXECUTE_AGENT_RUN = 'EXECUTE_AGENT_RUN',
+ EXECUTE_AI = 'EXECUTE_AI',
EXECUTE_TOKEN_REFRESH = 'EXECUTE_TOKEN_REFRESH',
EXECUTE_ACTION = 'EXECUTE_ACTION',
EXECUTE_PERSONALIZATION_RESEARCH = 'EXECUTE_PERSONALIZATION_RESEARCH',
@@ -368,6 +370,75 @@ export const EventDestinationJobData = z.object({
export type EventDestinationJobData = z.infer<typeof EventDestinationJobData>
+export enum AiStepAction {
+ ASK_AI = 'ASK_AI',
+ SUMMARIZE_TEXT = 'SUMMARIZE_TEXT',
+ CLASSIFY_TEXT = 'CLASSIFY_TEXT',
+}
+
+export const AiStepWebSearchOptions = z.object({
+ maxUses: z.number().optional(),
+ includeSources: z.boolean().optional(),
+ userLocationCity: z.string().optional(),
+ userLocationRegion: z.string().optional(),
+ userLocationCountry: z.string().optional(),
+ userLocationTimezone: z.string().optional(),
+ allowedDomains: z.array(z.object({ domain: z.string() })).optional(),
+ blockedDomains: z.array(z.object({ domain: z.string() })).optional(),
+ searchContextSize: z.enum(['low', 'medium', 'high']).optional().catch(undefined),
+})
+export type AiStepWebSearchOptions = z.infer<typeof AiStepWebSearchOptions>
+
+export const AiStepWebSearch = z.object({
+ enabled: z.boolean(),
+ options: AiStepWebSearchOptions.optional(),
+})
+export type AiStepWebSearch = z.infer<typeof AiStepWebSearch>
+
+const AiStepJobBase = z.object({
+ schemaVersion: z.number(),
+ jobType: z.literal(WorkerJobType.EXECUTE_AI),
+ requestId: z.string(),
+ projectId: z.string(),
+ platformId: z.string(),
+ flowId: z.string(),
+ flowRunId: z.string(),
+ waitpointId: z.string(),
+ provider: z.enum(AIProviderName),
+ providerConfigId: z.string().optional(),
+ modelId: z.string(),
+ prompt: z.string(),
+ maxOutputTokens: z.number().optional(),
+ temperature: z.number().optional(),
+ webSearch: AiStepWebSearch.optional(),
+})
+
+export const AskAiJobData = AiStepJobBase.extend({
+ action: z.literal(AiStepAction.ASK_AI),
+ conversation: z.array(z.record(z.string(), z.unknown())).optional(),
+})
+export type AskAiJobData = z.infer<typeof AskAiJobData>
+
+export const SummarizeTextJobData = AiStepJobBase.extend({
+ action: z.literal(AiStepAction.SUMMARIZE_TEXT),
+ text: z.string().optional(),
+})
+export type SummarizeTextJobData = z.infer<typeof SummarizeTextJobData>
+
+export const ClassifyTextJobData = AiStepJobBase.extend({
+ action: z.literal(AiStepAction.CLASSIFY_TEXT),
+ text: z.string().optional(),
+ categories: z.array(z.string()).optional(),
+})
+export type ClassifyTextJobData = z.infer<typeof ClassifyTextJobData>
+
+export const ExecuteAiJobData = z.discriminatedUnion('action', [
+ AskAiJobData,
+ SummarizeTextJobData,
+ ClassifyTextJobData,
+])
+export type ExecuteAiJobData = z.infer<typeof ExecuteAiJobData>
+
export const JobData = z.union([
PollingJobData,
RenewWebhookJobData,
@@ -376,6 +447,7 @@ export const JobData = z.union([
UserInteractionJobData,
EventDestinationJobData,
ExecuteAgentRunJobData,
+ ExecuteAiJobData,
ExecutePersonalizationResearchJobData,
])
export type JobData = z.infer<typeof JobData>
diff --git a/packages/core/execution/src/lib/workers/worker-contract.ts b/packages/core/execution/src/lib/workers/worker-contract.ts
index 435918b55ad..b3a04950f7f 100644
--- a/packages/core/execution/src/lib/workers/worker-contract.ts
+++ b/packages/core/execution/src/lib/workers/worker-contract.ts
@@ -95,6 +95,9 @@ export type WorkerToApiContract = {
updateProjectContext(input: UpdateProjectContextRequest): Promise<void>
executeAgentTool(input: ExecuteAgentToolRequest): Promise<ExecuteAgentToolResponse>
resumeFlowStep(input: ResumeFlowStepRequest): Promise<void>
+ resolveAiProvider(input: ResolveAiProviderRequest): Promise<ResolveAiProviderResponse>
+ saveFlowStepFile(input: SaveFlowStepFileRequest): Promise<SaveFlowStepFileResponse>
+ resumeAiStep(input: ResumeAiStepRequest): Promise<void>
updateFlowStepProgress(input: UpdateFlowStepProgressRequest): Promise<void>
executePieceTool(input: ExecutePieceToolRequest): Promise<ExecutePieceToolResponse>
executeKnowledgeBaseTool(input: ExecuteKnowledgeBaseToolRequest): Promise<ExecuteKnowledgeBaseToolResponse>
@@ -411,6 +414,41 @@ export type SendPersonalizationProgressRequest = {
message: string
}
+export type ResolveAiProviderRequest = {
+ projectId: string
+ platformId: string
+ provider: AIProviderName
+ providerConfigId?: string
+}
+
+export type ResolveAiProviderResponse = {
+ provider: AIProviderName
+ providerConfigId: string
+ auth: Record<string, unknown>
+ config: Record<string, unknown>
+}
+
+export type SaveFlowStepFileRequest = {
+ projectId: string
+ platformId: string
+ flowRunId: string
+ data: Buffer
+ mediaType: string
+ fileName?: string
+}
+
+export type SaveFlowStepFileResponse = {
+ fileId: string
+ url: string
+}
+
+export type ResumeAiStepRequest = {
+ projectId: string
+ flowRunId: string
+ waitpointId: string
+ output: unknown
+}
+
export const LONG_RUNNING_RPC_METHODS: readonly string[] = [
'executePieceTool',
'executeFlowTool',
diff --git a/packages/core/execution/test/workers/ai-job-data.test.ts b/packages/core/execution/test/workers/ai-job-data.test.ts
new file mode 100644
index 00000000000..45c7762ab5a
--- /dev/null
+++ b/packages/core/execution/test/workers/ai-job-data.test.ts
@@ -0,0 +1,46 @@
+import { describe, expect, it } from 'vitest'
+import { AiStepAction, ExecuteAiJobData, WorkerJobType } from '../../src/index'
+
+const base = {
+ schemaVersion: 1,
+ jobType: WorkerJobType.EXECUTE_AI,
+ requestId: 'request-1',
+ projectId: 'project-1',
+ platformId: 'platform-1',
+ flowId: 'flow-1',
+ flowRunId: 'run-1',
+ waitpointId: 'waitpoint-1',
+ provider: 'openai',
+ modelId: 'gpt-4o',
+ prompt: 'hello',
+}
+
+describe('what an AI step job accepts', () => {
+ it('takes each action with only the fields that action needs', () => {
+ expect(ExecuteAiJobData.safeParse({ ...base, action: AiStepAction.ASK_AI }).success).toBe(true)
+ expect(ExecuteAiJobData.safeParse({ ...base, action: AiStepAction.SUMMARIZE_TEXT, text: 'a long text' }).success).toBe(true)
+ expect(ExecuteAiJobData.safeParse({ ...base, action: AiStepAction.CLASSIFY_TEXT, text: 'warm', categories: ['sunny'] }).success).toBe(true)
+ })
+
+ it('still accepts a step whose optional fields were never filled in', () => {
+ expect(ExecuteAiJobData.safeParse({ ...base, action: AiStepAction.CLASSIFY_TEXT }).success).toBe(true)
+ expect(ExecuteAiJobData.safeParse({ ...base, action: AiStepAction.SUMMARIZE_TEXT }).success).toBe(true)
+ })
+
+ it('accepts a saved flow that carries fields belonging to another action, rather than failing it at enqueue time', () => {
+ const parsed = ExecuteAiJobData.safeParse({ ...base, action: AiStepAction.ASK_AI, text: 'stale', categories: ['stale'] })
+
+ expect(parsed.success).toBe(true)
+ })
+
+ it('keeps the fields the action does use', () => {
+ const parsed = ExecuteAiJobData.parse({ ...base, action: AiStepAction.CLASSIFY_TEXT, text: 'warm', categories: ['sunny', 'rainy'] })
+
+ expect(parsed).toMatchObject({ action: AiStepAction.CLASSIFY_TEXT, text: 'warm', categories: ['sunny', 'rainy'] })
+ })
+
+ it('rejects what it rejected before: no prompt, or an action nobody ships', () => {
+ expect(ExecuteAiJobData.safeParse({ ...base, action: AiStepAction.ASK_AI, prompt: undefined }).success).toBe(false)
+ expect(ExecuteAiJobData.safeParse({ ...base, action: 'TRANSLATE' }).success).toBe(false)
+ })
+})
diff --git a/packages/server/api/src/app/ai/ai-execute-controller.ts b/packages/server/api/src/app/ai/ai-execute-controller.ts
new file mode 100644
index 00000000000..4d08f9a02d7
--- /dev/null
+++ b/packages/server/api/src/app/ai/ai-execute-controller.ts
@@ -0,0 +1,107 @@
+import { ActivepiecesError, AIProviderName, apId, ErrorCode } from '@activepieces/core-utils'
+import { AiStepAction, AiStepWebSearch, ExecuteAiJobData, LATEST_JOB_DATA_SCHEMA_VERSION, PrincipalType, spreadIfDefined, WorkerJobType } from '@activepieces/shared'
+import { FastifyPluginAsyncZod } from 'fastify-type-provider-zod'
+import { StatusCodes } from 'http-status-codes'
+import { z } from 'zod'
+import { securityAccess } from '../core/security/authorization/fastify-security'
+import { assertCreditsAndAppSumoNotExceeded } from '../platform/billing-provider'
+import { jobQueue, JobType } from '../workers/job-queue/job-queue'
+
+export const aiExecuteController: FastifyPluginAsyncZod = async (app) => {
+ app.post('/execute', ExecuteAiRoute, async (request, reply) => {
+ if (request.principal.type !== PrincipalType.ENGINE) {
+ throw new ActivepiecesError({
+ code: ErrorCode.AUTHORIZATION,
+ params: { message: 'Only a running flow can start an AI step' },
+ })
+ }
+ const { projectId, platform } = request.principal
+ const body = request.body
+ await assertCreditsAndAppSumoNotExceeded({ platformId: platform.id, log: request.log })
+
+ const requestId = apId()
+ const log = request.log.child({ flowRun: { id: body.flowRunId }, requestId })
+
+ await jobQueue(log).add({
+ id: apId(),
+ type: JobType.ONE_TIME,
+ data: aiJobFor({ body, requestId, projectId, platformId: platform.id }),
+ })
+
+ log.info({ project: { id: projectId } }, '[aiExecuteController] Enqueued AI step')
+ return reply.status(StatusCodes.OK).send({ requestId })
+ })
+}
+
+function aiJobFor({ body, requestId, projectId, platformId }: {
+ body: z.infer<typeof ExecuteAiRequest>
+ requestId: string
+ projectId: string
+ platformId: string
+}): ExecuteAiJobData {
+ const shared = {
+ schemaVersion: LATEST_JOB_DATA_SCHEMA_VERSION,
+ jobType: WorkerJobType.EXECUTE_AI,
+ requestId,
+ projectId,
+ platformId,
+ flowId: body.flowId,
+ flowRunId: body.flowRunId,
+ waitpointId: body.waitpointId,
+ provider: body.provider,
+ modelId: body.modelId,
+ prompt: body.prompt,
+ ...spreadIfDefined('providerConfigId', body.providerConfigId),
+ ...spreadIfDefined('maxOutputTokens', body.maxOutputTokens),
+ ...spreadIfDefined('temperature', body.temperature),
+ ...spreadIfDefined('webSearch', body.webSearch),
+ } as const
+
+ switch (body.action) {
+ case AiStepAction.ASK_AI:
+ return { ...shared, action: AiStepAction.ASK_AI, ...spreadIfDefined('conversation', body.conversation) }
+ case AiStepAction.SUMMARIZE_TEXT:
+ return { ...shared, action: AiStepAction.SUMMARIZE_TEXT, ...spreadIfDefined('text', body.text) }
+ case AiStepAction.CLASSIFY_TEXT:
+ return {
+ ...shared,
+ action: AiStepAction.CLASSIFY_TEXT,
+ ...spreadIfDefined('text', body.text),
+ ...spreadIfDefined('categories', body.categories),
+ }
+ }
+}
+
+const RUN_PRINCIPALS = [PrincipalType.ENGINE] as const
+
+const ExecuteAiRequest = z.object({
+ action: z.enum(AiStepAction),
+ flowId: z.string(),
+ flowRunId: z.string(),
+ waitpointId: z.string(),
+ provider: z.enum(AIProviderName),
+ providerConfigId: z.string().optional(),
+ modelId: z.string(),
+ prompt: z.string(),
+ text: z.string().optional(),
+ categories: z.array(z.string()).optional(),
+ conversation: z.array(z.record(z.string(), z.unknown())).optional(),
+ maxOutputTokens: z.number().optional(),
+ temperature: z.number().optional(),
+ webSearch: AiStepWebSearch.optional(),
+})
+
+const ExecuteAiResponse = z.object({
+ requestId: z.string(),
+})
+
+const ExecuteAiRoute = {
+ config: {
+ security: securityAccess.publicPlatform(RUN_PRINCIPALS),
+ },
+ schema: {
+ tags: ['ai'],
+ body: ExecuteAiRequest,
+ response: { [StatusCodes.OK]: ExecuteAiResponse },
+ },
+}
diff --git a/packages/server/api/src/app/ai/ai-provider.module.ts b/packages/server/api/src/app/ai/ai-provider.module.ts
index 568dbdd0aca..30f149f2ce8 100644
--- a/packages/server/api/src/app/ai/ai-provider.module.ts
+++ b/packages/server/api/src/app/ai/ai-provider.module.ts
@@ -1,6 +1,8 @@
import { FastifyPluginAsyncZod } from 'fastify-type-provider-zod'
+import { aiExecuteController } from './ai-execute-controller'
import { aiProviderController } from './ai-provider-controller'
export const aiProviderModule: FastifyPluginAsyncZod = async (app) => {
await app.register(aiProviderController, { prefix: '/v1/ai-providers' })
+ await app.register(aiExecuteController, { prefix: '/v1/ai' })
}
diff --git a/packages/server/api/src/app/ai/ai-rpc-handlers.ts b/packages/server/api/src/app/ai/ai-rpc-handlers.ts
new file mode 100644
index 00000000000..e2ecb42f0a0
--- /dev/null
+++ b/packages/server/api/src/app/ai/ai-rpc-handlers.ts
@@ -0,0 +1,100 @@
+import { ActivepiecesError, ErrorCode, isNil, sanitizeObjectForPostgresql, tryCatch } from '@activepieces/core-utils'
+import { FileCompression, FileType, ResolveAiProviderRequest, ResolveAiProviderResponse, ResumeAiStepRequest, SaveFlowStepFileRequest, SaveFlowStepFileResponse, spreadIfDefined } from '@activepieces/shared'
+import { FastifyBaseLogger } from 'fastify'
+import { fileService } from '../file/file.service'
+import { filesService } from '../file/files-service'
+import { flowRunService } from '../flows/flow-run/flow-run-service'
+import { system } from '../helper/system/system'
+import { AppSystemProp } from '../helper/system/system-props'
+import { projectService } from '../project/project-service'
+import { resumeService } from '../waitpoints/resume-service'
+import { aiProviderService } from './ai-provider-service'
+
+export const aiRpcHandlers = (log: FastifyBaseLogger) => ({
+ async resolveAiProvider(input: ResolveAiProviderRequest): Promise<ResolveAiProviderResponse> {
+ await assertProjectBelongsToPlatform({ ...input, log })
+ const config = await aiProviderService(log).getConfigOrThrow({
+ platformId: input.platformId,
+ provider: input.provider,
+ scope: { type: 'project', projectId: input.projectId },
+ ...spreadIfDefined('configId', input.providerConfigId),
+ })
+ return {
+ provider: config.provider,
+ providerConfigId: config.configId,
+ auth: config.auth as Record<string, unknown>,
+ config: config.config as Record<string, unknown>,
+ }
+ },
+
+ async saveFlowStepFile(input: SaveFlowStepFileRequest): Promise<SaveFlowStepFileResponse> {
+ await assertProjectBelongsToPlatform({ ...input, log })
+ const maxFileSizeInBytes = system.getNumberOrThrow(AppSystemProp.MAX_FILE_SIZE_MB) * 1024 * 1024
+ if (input.data.length > maxFileSizeInBytes) {
+ throw new ActivepiecesError({
+ code: ErrorCode.VALIDATION,
+ params: { message: `This AI step produced a ${Math.ceil(input.data.length / 1024 / 1024)}MB file, over the ${maxFileSizeInBytes / 1024 / 1024}MB limit` },
+ })
+ }
+ const file = await fileService(log).save({
+ projectId: input.projectId,
+ platformId: input.platformId,
+ data: input.data,
+ size: input.data.length,
+ type: FileType.FLOW_STEP_FILE,
+ fileName: input.fileName,
+ compression: FileCompression.NONE,
+ metadata: { mimetype: input.mediaType },
+ })
+ const url = await filesService.constructReadUrl({
+ fileId: file.id,
+ fileType: file.type,
+ platformId: input.platformId,
+ })
+ return { fileId: file.id, url }
+ },
+
+ async resumeAiStep(input: ResumeAiStepRequest): Promise<void> {
+ const resumeFields = { flowRun: { id: input.flowRunId }, waitpoint: { id: input.waitpointId } }
+ const flowRun = await flowRunService(log).getOne({ id: input.flowRunId, projectId: input.projectId })
+ if (isNil(flowRun)) {
+ log.warn(resumeFields, '[aiRpc#resumeAiStep] That flow run is gone from this project, so there is nothing left to resume')
+ return
+ }
+ const { data: resumed, error } = await tryCatch(() => resumeService(log).resumeFromWaitpoint({
+ flowRunId: flowRun.id,
+ waitpointId: input.waitpointId,
+ resumePayload: { body: sanitizeObjectForPostgresql(input.output), headers: {}, queryParams: {} },
+ }))
+ if (!isNil(error)) {
+ if (!isFlowRunGone(error)) {
+ throw error
+ }
+ log.warn(resumeFields, '[aiRpc#resumeAiStep] That flow run went away while resuming, so there is nothing left to resume')
+ return
+ }
+ if (isNil(resumed) || resumed.stale) {
+ log.warn(resumeFields, '[aiRpc#resumeAiStep] Nothing to resume, so the flow keeps waiting unless another attempt already released it')
+ return
+ }
+ log.info(resumeFields, '[aiRpc#resumeAiStep] Handed the result back to the flow')
+ },
+})
+
+async function assertProjectBelongsToPlatform({ projectId, platformId, log }: { projectId: string, platformId: string, log: FastifyBaseLogger }): Promise<void> {
+ const project = await projectService(log).getOneOrThrow(projectId)
+ if (project.platformId !== platformId) {
+ throw new ActivepiecesError({
+ code: ErrorCode.AUTHORIZATION,
+ params: { message: 'That project does not belong to this platform' },
+ })
+ }
+}
+
+function isFlowRunGone(error: unknown): boolean {
+ return error instanceof ActivepiecesError
+ && error.error.code === ErrorCode.ENTITY_NOT_FOUND
+ && error.error.params.entityType === FLOW_RUN_ENTITY_TYPE
+}
+
+const FLOW_RUN_ENTITY_TYPE = 'flow_run'
diff --git a/packages/server/api/src/app/workers/job-queue/job-queue.ts b/packages/server/api/src/app/workers/job-queue/job-queue.ts
index 388854451d8..e7a4021fe31 100644
--- a/packages/server/api/src/app/workers/job-queue/job-queue.ts
+++ b/packages/server/api/src/app/workers/job-queue/job-queue.ts
@@ -1,6 +1,6 @@
import { ApId, isNil, tryCatch } from '@activepieces/core-utils'
import { apDayjsDuration, memoryLock } from '@activepieces/server-utils'
-import { EventDestinationJobData, ExecuteAgentRunJobData, ExecuteFlowJobData, ExecutePersonalizationResearchJobData, getDefaultJobPriority, JOB_PRIORITY, JobData, PollingJobData, RenewWebhookJobData, ScheduleOptions, TriggerSourceScheduleType, UserInteractionJobData, WebhookJobData, WorkerJobType } from '@activepieces/shared'
+import { EventDestinationJobData, ExecuteAgentRunJobData, ExecuteAiJobData, ExecuteFlowJobData, ExecutePersonalizationResearchJobData, getDefaultJobPriority, JOB_PRIORITY, JobData, PollingJobData, RenewWebhookJobData, ScheduleOptions, TriggerSourceScheduleType, UserInteractionJobData, WebhookJobData, WorkerJobType } from '@activepieces/shared'
import { Job, Queue } from 'bullmq'
import { FastifyBaseLogger } from 'fastify'
import { redisConnections } from '../../database/redis-connections'
@@ -53,7 +53,7 @@ export const jobQueue = (log: FastifyBaseLogger) => ({
delay: params.delay,
jobId: params.id,
...(data.jobType === WorkerJobType.EVENT_DESTINATION ? { removeOnFail: true } : {}),
- ...(data.jobType === WorkerJobType.EXECUTE_AGENT_RUN ? { attempts: 1 } : {}),
+ ...([WorkerJobType.EXECUTE_AGENT_RUN, WorkerJobType.EXECUTE_AI].includes(data.jobType) ? { attempts: 1 } : {}),
...isUserInteractionJob(data.jobType) ? {
attempts: 1,
removeOnComplete: { age: 300 },
@@ -265,6 +265,6 @@ type BaseAddParams<JD extends Omit<JobData, 'engineToken'>, JT extends JobType>
type RepeatingJobAddParams = BaseAddParams<PollingJobData | RenewWebhookJobData, JobType.REPEATING> & {
scheduleOptions: ScheduleOptions
}
-type OneTimeJobAddParams = BaseAddParams<ExecuteFlowJobData | WebhookJobData | UserInteractionJobData | EventDestinationJobData | ExecuteAgentRunJobData | ExecutePersonalizationResearchJobData, JobType.ONE_TIME>
+type OneTimeJobAddParams = BaseAddParams<ExecuteFlowJobData | WebhookJobData | UserInteractionJobData | EventDestinationJobData | ExecuteAgentRunJobData | ExecuteAiJobData | ExecutePersonalizationResearchJobData, JobType.ONE_TIME>
export type AddJobParams<type extends JobType> = type extends JobType.REPEATING ? RepeatingJobAddParams : OneTimeJobAddParams
diff --git a/packages/server/api/src/app/workers/rpc/worker-rpc-service.ts b/packages/server/api/src/app/workers/rpc/worker-rpc-service.ts
index 7faccb0f8de..7e1cff0270d 100644
--- a/packages/server/api/src/app/workers/rpc/worker-rpc-service.ts
+++ b/packages/server/api/src/app/workers/rpc/worker-rpc-service.ts
@@ -2,6 +2,7 @@ import { assertNotNullOrUndefined, isNil, spreadIfDefined } from '@activepieces/
import { apVersionUtil, onCallService, UNKNOWN_VERSION } from '@activepieces/server-utils'
import { ExecutionType, FileCompression, FileLocation, FileType, FlowOperationType, FlowStatus, WebsocketClientEvent, WorkerGroupScope, WorkerToApiContract } from '@activepieces/shared'
import { FastifyBaseLogger } from 'fastify'
+import { aiRpcHandlers } from '../../ai/ai-rpc-handlers'
import { websocketService } from '../../core/websockets.service'
import { distributedStore, redisConnections } from '../../database/redis-connections'
import { agentRpcHandlers } from '../../ee/agent/agent-rpc-handlers'
@@ -393,6 +394,15 @@ export function createHandlers(log: FastifyBaseLogger, assignment: WorkerGroupAs
return agentRpcHandlers(agentRpcLog(log, { conversationId: input.conversationId })).updateFlowStepProgress(input)
},
+ async resolveAiProvider(input) {
+ return aiRpcHandlers(log).resolveAiProvider(input)
+ },
+ async saveFlowStepFile(input) {
+ return aiRpcHandlers(log).saveFlowStepFile(input)
+ },
+ async resumeAiStep(input) {
+ return aiRpcHandlers(log).resumeAiStep(input)
+ },
async resumeFlowStep(input) {
return agentRpcHandlers(agentRpcLog(log, { conversationId: input.conversationId })).resumeFlowStep(input)
},
diff --git a/packages/server/utils/src/ai-utils.ts b/packages/server/utils/src/ai-utils.ts
index 02e2a2927aa..cad9f908006 100644
--- a/packages/server/utils/src/ai-utils.ts
+++ b/packages/server/utils/src/ai-utils.ts
@@ -1,11 +1,10 @@
import { AIProviderName, isNil, observedProviderFetch, ProviderOutcomeReporter, spreadIfDefined } from '@activepieces/core-utils';
-import { createLanguageModel } from '@activepieces/ai-providers';
-import { AI_PROVIDER_CAPABILITIES, AIWebSearchMode, BaseAIProviderAuthConfig, CloudflareGatewayProviderConfig, getEffectiveProviderAndModel, splitCloudflareGatewayModelId } from '@activepieces/shared';
+import { CloudflareGatewayMetadata, createCloudflareGatewayModel, createLanguageModel } from '@activepieces/ai-providers';
+import { AI_PROVIDER_CAPABILITIES, AIWebSearchMode, BaseAIProviderAuthConfig, getEffectiveProviderAndModel } from '@activepieces/shared';
import { createAnthropic } from '@ai-sdk/anthropic'
import { createAzure } from '@ai-sdk/azure'
import { createGoogleGenerativeAI } from '@ai-sdk/google'
import { createOpenAI } from '@ai-sdk/openai'
-import { createOpenAICompatible } from '@ai-sdk/openai-compatible'
import { SharedV3ProviderOptions } from '@ai-sdk/provider'
import { createOpenRouter, OpenRouterChatSettings } from '@openrouter/ai-sdk-provider'
import { EmbeddingModel, LanguageModel, ToolSet } from 'ai'
@@ -14,13 +13,6 @@ const DEFAULT_WEB_SEARCH_RESULTS = 5
const MIN_OPENROUTER_WEB_SEARCH_RESULTS = 1
const MAX_OPENROUTER_WEB_SEARCH_RESULTS = 10
-// Which providers support web search (and how) is declared in AI_PROVIDER_CAPABILITIES; the native
-// tool builders stay here because they need the provider SDKs. AI_PROVIDER_CAPABILITIES lists no
-// web-search mode for OPENAI, so supportsWebSearch gates it off for callers that ask; a caller that
-// names OPENAI outright still gets the Responses-API tool below. Keyed on the provider that serves
-// the model, which is why buildWebSearchTools resolves through getEffectiveProviderAndModel first:
-// a Cloudflare Gateway model is served by whichever submodel its id names, and there is no
-// CLOUDFLARE_GATEWAY entry here to fall back to.
const NATIVE_WEB_SEARCH_TOOLS: Record<string, (params: NativeWebSearchToolParams) => ToolSet> = {
[AIProviderName.ANTHROPIC]: ({ auth: { apiKey }, options }) => ({
web_search: createAnthropic({ apiKey }).tools.webSearch_20250305({
@@ -116,26 +108,28 @@ function openRouterModelSettings({ provider, webSearchEnabled, options }: {
return { plugins: [{ id: 'web', max_results: maxResults }] }
}
-function createModel({ provider, auth, config, modelId, metadata, webSearchEnabled = false, webSearchOptions, onOutcome }: {
+function createModel({ provider, auth, config, modelId, metadata, flowStep, openaiResponsesModel = false, webSearchEnabled = false, webSearchOptions, onOutcome }: {
provider: AIProviderName
auth: Record<string, unknown>
config: Record<string, unknown>
modelId: string
metadata?: ChatModelMetadata
+ flowStep?: FlowStepMetadata
+ openaiResponsesModel?: boolean
webSearchEnabled?: boolean
webSearchOptions?: WebSearchOptions
onOutcome?: ProviderOutcomeReporter
}): LanguageModel {
if (provider === AIProviderName.CLOUDFLARE_GATEWAY) {
- const { apiKey } = auth as BaseAIProviderAuthConfig
- const { accountId, gatewayId } = config as CloudflareGatewayProviderConfig
- const { model: actualModelId } = splitCloudflareGatewayModelId(modelId)
- return createOpenAICompatible({
- name: 'cloudflare',
- baseURL: `https://gateway.ai.cloudflare.com/v1/${accountId}/${gatewayId}/compat`,
- headers: { 'cf-aig-authorization': `Bearer ${apiKey}` },
- ...spreadIfDefined('fetch', observedProviderFetch(onOutcome)),
- }).chatModel(actualModelId)
+ return createCloudflareGatewayModel({
+ auth,
+ config,
+ modelId,
+ openaiResponsesModel,
+ routing: isNil(flowStep) ? 'compat' : 'submodel',
+ ...spreadIfDefined('metadata', cloudflareGatewayMetadata(flowStep)),
+ ...spreadIfDefined('onOutcome', onOutcome),
+ })
}
return createLanguageModel({
provider,
@@ -144,13 +138,33 @@ function createModel({ provider, auth, config, modelId, metadata, webSearchEnabl
modelId,
options: {
openRouterSettings: openRouterModelSettings({ provider, webSearchEnabled, options: webSearchOptions }),
- mistralViaOpenRouter: true,
- ...spreadIfDefined('extraHeaders', managedProviderMetadataHeaders({ provider, metadata })),
+ mistralViaOpenRouter: isNil(flowStep),
+ openaiResponsesModel,
+ ...spreadIfDefined('extraHeaders', flowStepMetadataHeaders(flowStep) ?? managedProviderMetadataHeaders({ provider, metadata })),
...spreadIfDefined('onOutcome', onOutcome),
},
})
}
+function cloudflareGatewayMetadata(flowStep?: FlowStepMetadata): CloudflareGatewayMetadata | undefined {
+ if (isNil(flowStep)) {
+ return undefined
+ }
+ return { projectId: flowStep.projectId, flowId: flowStep.flowId, runId: flowStep.runId }
+}
+
+function flowStepMetadataHeaders(flowStep?: FlowStepMetadata): Record<string, string> | undefined {
+ if (isNil(flowStep)) {
+ return undefined
+ }
+ return {
+ 'x-ap-project-id': flowStep.projectId,
+ 'x-ap-platform-id': flowStep.platformId,
+ 'x-ap-flow-id': flowStep.flowId,
+ 'x-ap-run-id': flowStep.runId,
+ }
+}
+
function readStringField(source: Record<string, unknown>, key: string): string {
const value = source[key]
return typeof value === 'string' ? value : ''
@@ -257,10 +271,17 @@ type WebSearchOptions = {
searchContextSize?: 'low' | 'medium' | 'high'
}
+type FlowStepMetadata = {
+ projectId: string
+ platformId: string
+ flowId: string
+ runId: string
+}
+
type ChatModelMetadata = {
platformId: string
conversationId: string
runId?: string
}
-export type { ChatModelMetadata, WebSearchOptions }
+export type { ChatModelMetadata, FlowStepMetadata, WebSearchOptions }
diff --git a/packages/server/utils/src/index.ts b/packages/server/utils/src/index.ts
index 0a970a14f93..1dcd855e7f2 100644
--- a/packages/server/utils/src/index.ts
+++ b/packages/server/utils/src/index.ts
@@ -30,4 +30,4 @@ export { systemUsage } from './system-usage'
export { agentAiUtils } from './agent-ai-utils'
export type { ContentPartLike } from './agent-ai-utils'
export { aiUtils, EMBEDDING_DIMENSIONS } from './ai-utils'
-export type { WebSearchOptions } from './ai-utils'
+export type { FlowStepMetadata, WebSearchOptions } from './ai-utils'
diff --git a/packages/server/worker/src/lib/execute/job-registry.ts b/packages/server/worker/src/lib/execute/job-registry.ts
index e73baefbc37..10493039f2e 100644
--- a/packages/server/worker/src/lib/execute/job-registry.ts
+++ b/packages/server/worker/src/lib/execute/job-registry.ts
@@ -51,6 +51,7 @@ const registry: Partial<Record<WorkerJobType, JobHandler>> = {
// far the largest weight — so deferring its evaluation keeps a flow-only worker's idle RSS small.
const lazyLoaders: Partial<Record<WorkerJobType, () => Promise<JobHandler>>> = {
[WorkerJobType.EXECUTE_AGENT_RUN]: async () => (await import('./jobs/ee/agent/execute-agent-run')).executeAgentRunJob,
+ [WorkerJobType.EXECUTE_AI]: async () => (await import('./jobs/ai/execute-ai')).executeAiJob,
[WorkerJobType.EXECUTE_PERSONALIZATION_RESEARCH]: async () => (await import('./jobs/ee/agent/execute-personalization-research')).executePersonalizationResearchJob,
}
diff --git a/packages/server/worker/src/lib/execute/jobs/ai/execute-ai.ts b/packages/server/worker/src/lib/execute/jobs/ai/execute-ai.ts
new file mode 100644
index 00000000000..5667f62f04b
--- /dev/null
+++ b/packages/server/worker/src/lib/execute/jobs/ai/execute-ai.ts
@@ -0,0 +1,139 @@
+import { AIProviderName, isNil, spreadIfDefined, tryCatch } from '@activepieces/core-utils'
+import { aiUtils, FlowStepMetadata } from '@activepieces/server-utils'
+import { AiStepAction, ClassifyTextJobData, EngineResponseStatus, ExecuteAiJobData, getEffectiveProviderAndModel, WorkerJobType } from '@activepieces/shared'
+import { generateText, ModelMessage, stepCountIs } from 'ai'
+import { FireAndForgetJobResult, JobContext, JobHandler, JobResultKind } from '../../types'
+
+export const executeAiJob: JobHandler<ExecuteAiJobData, FireAndForgetJobResult> = {
+ jobType: WorkerJobType.EXECUTE_AI,
+ async execute(ctx: JobContext, data: ExecuteAiJobData): Promise<FireAndForgetJobResult> {
+ const { data: output, error } = await tryCatch(() => runAiStep(ctx, data))
+ const stepOutput = isNil(error) ? { output } : { failure: toFailureMessage(error) }
+ const handedBack = await handBackToTheFlow({ ctx, data, waitpointId: data.waitpointId, output: stepOutput })
+ if (!isNil(error)) {
+ ctx.log.warn({ flowRun: { id: data.flowRunId }, requestId: data.requestId, error }, '[executeAiJob] Handed the failure back to the flow')
+ }
+ return { kind: JobResultKind.FIRE_AND_FORGET, status: handedBack ? EngineResponseStatus.OK : EngineResponseStatus.INTERNAL_ERROR }
+ },
+}
+
+async function handBackToTheFlow({ ctx, data, waitpointId, output }: {
+ ctx: JobContext
+ data: ExecuteAiJobData
+ waitpointId: string
+ output: unknown
+}): Promise<boolean> {
+ for (let attempt = 1; attempt <= RESUME_ATTEMPTS; attempt++) {
+ const { error } = await tryCatch(() => ctx.apiClient.resumeAiStep({
+ projectId: data.projectId,
+ flowRunId: data.flowRunId,
+ waitpointId,
+ output,
+ }))
+ if (isNil(error)) {
+ return true
+ }
+ ctx.log.warn({ flowRun: { id: data.flowRunId }, requestId: data.requestId, attempt, error }, '[executeAiJob] Could not hand the answer back to the flow')
+ await waitBeforeRetry(attempt)
+ }
+ ctx.log.error({ flowRun: { id: data.flowRunId }, requestId: data.requestId }, '[executeAiJob] Gave up handing the answer back, so the step stays paused until its backstop fires')
+ return false
+}
+
+async function waitBeforeRetry(attempt: number): Promise<void> {
+ return new Promise((resolve) => setTimeout(resolve, attempt * RETRY_DELAY_MS))
+}
+
+async function runAiStep(ctx: JobContext, data: ExecuteAiJobData): Promise<unknown> {
+ const { provider, auth, config } = await ctx.apiClient.resolveAiProvider({
+ projectId: data.projectId,
+ platformId: data.platformId,
+ provider: data.provider,
+ ...spreadIfDefined('providerConfigId', data.providerConfigId),
+ })
+ const webSearchEnabled = data.webSearch?.enabled ?? false
+ const webSearchOptions = data.webSearch?.options
+ const { provider: effectiveProvider } = getEffectiveProviderAndModel({ provider, model: data.modelId })
+ const tools = aiUtils.buildWebSearchToolsOrThrow({ provider, model: data.modelId, auth, webSearchEnabled, options: webSearchOptions })
+ const model = aiUtils.createModel({
+ provider,
+ auth,
+ config,
+ modelId: data.modelId,
+ flowStep: flowStepMetadata(data),
+ openaiResponsesModel: webSearchEnabled && (effectiveProvider ?? provider) === AIProviderName.OPENAI,
+ webSearchEnabled,
+ webSearchOptions,
+ })
+
+ const response = await generateText({
+ model,
+ messages: buildMessages(data),
+ tools,
+ ...spreadIfDefined('maxOutputTokens', data.maxOutputTokens),
+ ...spreadIfDefined('temperature', data.temperature),
+ ...spreadIfDefined('stopWhen', Object.keys(tools).length === 0 ? undefined : stepCountIs(webSearchOptions?.maxUses ?? DEFAULT_WEB_SEARCH_STEPS)),
+ })
+
+ return toStepOutput({ data, text: response.text ?? '', sources: response.sources })
+}
+
+function flowStepMetadata(data: ExecuteAiJobData): FlowStepMetadata {
+ return {
+ projectId: data.projectId,
+ platformId: data.platformId,
+ flowId: data.flowId,
+ runId: data.flowRunId,
+ }
+}
+
+function buildMessages(data: ExecuteAiJobData): ModelMessage[] {
+ switch (data.action) {
+ case AiStepAction.ASK_AI: {
+ const history = (data.conversation ?? []) as ModelMessage[]
+ return [...history, { role: 'user', content: data.prompt }]
+ }
+ case AiStepAction.SUMMARIZE_TEXT:
+ return [{ role: 'user', content: `${data.prompt} Summarize the following text : ${data.text ?? ''}` }]
+ case AiStepAction.CLASSIFY_TEXT:
+ return [{ role: 'user', content: classificationPrompt(data) }]
+ }
+}
+
+function classificationPrompt(data: ClassifyTextJobData): string {
+ return `As a text classifier, your task is to assign one of the following categories to the provided text: ${(data.categories ?? []).join(', ')}. Please respond with only the selected category as a single word, and nothing else.
+ Text to classify: "${data.text ?? ''}"`
+}
+
+function toStepOutput({ data, text, sources }: { data: ExecuteAiJobData, text: string, sources: unknown }): unknown {
+ switch (data.action) {
+ case AiStepAction.ASK_AI: {
+ const conversation = isNil(data.conversation) ? undefined : [
+ ...(data.conversation as ModelMessage[]),
+ { role: 'user' as const, content: data.prompt },
+ { role: 'assistant' as const, content: text },
+ ]
+ const answer = data.webSearch?.enabled === true && data.webSearch.options?.includeSources === true
+ ? { text, sources }
+ : text
+ return { answer, ...spreadIfDefined('conversation', conversation) }
+ }
+ case AiStepAction.SUMMARIZE_TEXT:
+ return { answer: text }
+ case AiStepAction.CLASSIFY_TEXT: {
+ const label = text.trim()
+ if (!(data.categories ?? []).includes(label)) {
+ throw new Error('Unable to classify the text into the provided categories.')
+ }
+ return { answer: label }
+ }
+ }
+}
+
+function toFailureMessage(error: unknown): string {
+ return error instanceof Error ? error.message : String(error)
+}
+
+const DEFAULT_WEB_SEARCH_STEPS = 5
+const RESUME_ATTEMPTS = 3
+const RETRY_DELAY_MS = 1_000