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
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
chore: release 0.92.0 (#15588)
Abdul918c0447c58d
diff --git a/docker-compose.yml b/docker-compose.ymlindex fa843bf63bf..00738abb5b2 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -1,6 +1,6 @@services:app:- image: ghcr.io/activepieces/activepieces:0.91.0+ image: ghcr.io/activepieces/activepieces:0.92.0container_name: activepieces-apprestart: unless-stoppedports:@@ -16,7 +16,7 @@ services:networks:- activepiecesworker:- image: ghcr.io/activepieces/activepieces:0.91.0+ image: ghcr.io/activepieces/activepieces:0.92.0restart: unless-stoppeddepends_on:- appdiff --git a/package.json b/package.jsonindex 9ef51e304c8..ab5d140e8c5 100644--- a/package.json+++ b/package.json@@ -1,6 +1,6 @@{"name": "activepieces",- "version": "0.91.0",+ "version": "0.92.0","packageManager": "[email protected]","trustedDependencies": ["sqlite3",diff --git a/packages/server/api/src/app/ee/agent/agent-conversation-controller.ts b/packages/server/api/src/app/ee/agent/agent-conversation-controller.tsindex e53fd125812..8e667e5024b 100644--- a/packages/server/api/src/app/ee/agent/agent-conversation-controller.ts+++ b/packages/server/api/src/app/ee/agent/agent-conversation-controller.ts@@ -16,7 +16,6 @@ import { agentHelpers } from './agent-helpers'import { agentMemoryAi } from './agent-memory-ai'import { agentService } from './agent-service'import { chatAnalyticsTelemetry } from './chat-analytics-sync'-import { chatPlanGrant } from './chat-plan-grant'import { chatRolloutService } from './chat-rollout-service'import { agentPrompt } from './prompt/agent-prompt'import { findConnectionsForPiece } from './tools/agent-tools'@@ -136,15 +135,9 @@ export const agentConversationController: FastifyPluginAsyncZod = async (app) =>await assertAgentMessageRateLimitNotExceeded({ platformId, userId, log })// Cloud rollout: count this user as a distinct chatter (no-op off cloud, deduped).- const { needsCreditDecision } = await chatRolloutService.recordChatted({ userId, platformId })+ await chatRolloutService.recordChatted({ userId, platformId })// Refresh the console rollout funnel snapshot (chatted count just changed).chatAnalyticsTelemetry(log).sendRolloutFunnelUpdate()- if (needsCreditDecision) {- const { error } = await tryCatch(() => chatPlanGrant.grant({ userId, platformId, log }))- if (!isNil(error)) {- log.warn({ error, platform: { id: platformId }, user: { id: userId } }, '[agentConversationController] Chat plan grant failed; continuing to the credit gate')- }- }const runId = typeof clientRunId === 'string' ? clientRunId : apId()const runLog = log.child({ run: { id: runId } })diff --git a/packages/server/api/src/app/ee/agent/chat-plan-grant.ts b/packages/server/api/src/app/ee/agent/chat-plan-grant.tsdeleted file mode 100644index 8bfde60f3a7..00000000000--- a/packages/server/api/src/app/ee/agent/chat-plan-grant.ts+++ /dev/null@@ -1,49 +0,0 @@-import { isEmpty, isNil, tryCatch } from '@activepieces/core-utils'-import { ApEdition } from '@activepieces/shared'-import { FastifyBaseLogger } from 'fastify'-import { isNotOneOfTheseEditions } from '../../database/database-common'-import { billingProvider } from '../../platform/billing-provider'-import { autumnConsole, autumnUtils } from '../platform/platform-plan/billing-providers/autumn-utils'-import { platformPlanService } from '../platform/platform-plan/platform-plan.service'-import { chatRolloutService } from './chat-rollout-service'--async function grant({ userId, platformId, log }: GrantChatPlanParams): Promise<void> {- if (isNotOneOfTheseEditions([ApEdition.CLOUD])) {- return- }-- const claimed = await chatRolloutService.claimFreeCreditGrant({ userId })- if (!claimed) {- return- }-- const platformPlan = await platformPlanService(log).getOrCreateForPlatform(platformId)- if (!isNil(platformPlan.licenseKey) && !isEmpty(platformPlan.licenseKey)) {- log.info({ platform: { id: platformId } }, 'Skipping chat plan grant; the platform already has a license key')- return- }-- const { error } = await tryCatch(async () => {- const email = await autumnUtils.getPlatformOwnerEmail(log, platformId)- const licenseKey = await autumnConsole.grantChatPlan({ email })- await billingProvider.get(log).activateLicense({ platformId, licenseKey })- })-- if (!isNil(error)) {- await chatRolloutService.releaseFreeCreditGrant({ userId })- log.warn({ error, platform: { id: platformId }, user: { id: userId } }, 'Chat plan grant failed; released the claim so a later message retries')- return- }-- log.info({ platform: { id: platformId }, user: { id: userId } }, 'Granted the chat plan for a first-time chatter')-}--export const chatPlanGrant = {- grant,-}--type GrantChatPlanParams = {- userId: string- platformId: string- log: FastifyBaseLogger-}diff --git a/packages/server/api/src/app/ee/agent/chat-rollout-service.ts b/packages/server/api/src/app/ee/agent/chat-rollout-service.tsindex 57f48760099..0fbbe9c9214 100644--- a/packages/server/api/src/app/ee/agent/chat-rollout-service.ts+++ b/packages/server/api/src/app/ee/agent/chat-rollout-service.ts@@ -86,13 +86,11 @@ export const chatRolloutService = {return { landed, chatted, cap, closed: chatted >= cap }},- async recordChatted({ userId, platformId }: { userId: string, platformId: string }): Promise<{ firstChat: boolean, needsCreditDecision: boolean }> {+ async recordChatted({ userId, platformId }: { userId: string, platformId: string }): Promise<void> {if (!isCloud()) {- return { firstChat: false, needsCreditDecision: false }+ return}// Rows only ever exist once a user has chatted, so an INSERT (xmax = 0) is the first message.- // needsCreditDecision stays true until the one-time free-credit decision is settled, so the- // grant is retried on later messages if it failed (not gated on the one-shot firstChat).const rows = await rolloutRepo().query(`INSERT INTO "chat_rollout_user" ("id", "userId", "platformId", "landedAt", "chattedAt")VALUES ($1, $2, $3, now(), now())@@ -100,45 +98,13 @@ export const chatRolloutService = {SET "chattedAt" = COALESCE("chat_rollout_user"."chattedAt", now()),"landedAt" = COALESCE("chat_rollout_user"."landedAt", now()),"updated" = now()- RETURNING (xmax = 0) AS inserted, ("grantedFreeCreditAt" IS NULL) AS needs_credit_decision`,+ RETURNING (xmax = 0) AS inserted`,[apId(), userId, platformId],)const firstChat = rows[0]?.inserted === true- const needsCreditDecision = rows[0]?.needs_credit_decision === true// Close the rollout the moment the cap is reached, not lazily on the next gate check.if (firstChat && (await countChatted()) >= getCap()) {await distributedStore.putBoolean(ROLLOUT_CLOSED_KEY, true)}- return { firstChat, needsCreditDecision }- },-- // Atomically settle the one-time free-credit decision for a user. Returns true only for the- // caller that flips grantedFreeCreditAt from NULL, so the decision (grant for free-tier, or a- // no-op skip for paid) is processed exactly once even under concurrent messages.- async claimFreeCreditGrant({ userId }: { userId: string }): Promise<boolean> {- if (!isCloud()) {- return false- }- const rows = await rolloutRepo().query(- `UPDATE "chat_rollout_user"- SET "grantedFreeCreditAt" = now(), "updated" = now()- WHERE "userId" = $1 AND "grantedFreeCreditAt" IS NULL- RETURNING "id"`,- [userId],- )- return rows.length > 0- },-- // Release a claim so a later message can retry when the credit top-up itself failed.- async releaseFreeCreditGrant({ userId }: { userId: string }): Promise<void> {- if (!isCloud()) {- return- }- await rolloutRepo().query(- `UPDATE "chat_rollout_user"- SET "grantedFreeCreditAt" = NULL, "updated" = now()- WHERE "userId" = $1`,- [userId],- )},}diff --git a/packages/server/api/src/app/ee/platform/platform-plan/billing-providers/autumn-utils.ts b/packages/server/api/src/app/ee/platform/platform-plan/billing-providers/autumn-utils.tsindex d9717d008f7..6dc59a97d44 100644--- a/packages/server/api/src/app/ee/platform/platform-plan/billing-providers/autumn-utils.ts+++ b/packages/server/api/src/app/ee/platform/platform-plan/billing-providers/autumn-utils.ts@@ -337,18 +337,6 @@ export const autumnConsole = {async compFreeLegacy({ autumnCustomerId }: { autumnCustomerId: string }): Promise<void> {await consoleRequest({ path: '/api/v1/billing/free-legacy', token: consoleSecretOrThrow(), body: { autumnCustomerId } })},- async grantChatPlan({ email }: { email: string }): Promise<string> {- const grant = await consoleRequest<{ licenseKey: string | null } | null>({- path: '/api/external/grant-chat-plan',- token: consoleSecretOrThrow(),- body: { email },- })- const licenseKey = grant?.licenseKey- if (isNil(licenseKey) || isEmpty(licenseKey)) {- throw new Error('Console returned no license key for the chat plan grant')- }- return licenseKey- },async getCreds(log: FastifyBaseLogger, platformId: string): Promise<ConsoleCustomerCall | null> {return autumnUtils.loadAutumnCreds(log, platformId)},