Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/docs/content/docs/integrations/agentphone.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ Retrieve current usage statistics for the AgentPhone account

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `plan` | json | Plan name and limits \(name, limits: numbers/messagesPerMonth/voiceMinutesPerMonth/maxCallDurationMinutes/concurrentCalls\) |
| `plan` | json | Plan name and limits \(name, limits: numbers/messagesPerMonth/voiceMinutesPerMonth/maxCallDurationMinutes/concurrentCalls\). The current AgentPhone usage API no longer returns a plan, so these values are empty. |
| `numbers` | json | Phone number usage \(used, limit, remaining\) |
| `stats` | json | Usage stats: totalMessages, messagesLast24h/7d/30d, totalCalls, callsLast24h/7d/30d, totalWebhookDeliveries, successfulWebhookDeliveries, failedWebhookDeliveries |
| `periodStart` | string | Billing period start |
Expand Down
4 changes: 2 additions & 2 deletions apps/docs/content/docs/integrations/profound.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ Query human referral traffic report with hourly granularity for a domain in Prof

### Profound Raw Logs

Get raw traffic logs with filters for a domain in Profound
Get raw traffic logs with filters for a domain in Profound. Profound retired this endpoint on 2026-06-10; use the Referrals Report instead.

<ReferenceDetails>

Expand Down Expand Up @@ -536,7 +536,7 @@ Get raw traffic logs with filters for a domain in Profound

### Profound Bot Logs

Get identified bot visit logs with filters for a domain in Profound
Get identified bot visit logs with filters for a domain in Profound. Profound retired this endpoint on 2026-06-10; use the Bots Report instead.

<ReferenceDetails>

Expand Down
20 changes: 10 additions & 10 deletions apps/docs/content/docs/integrations/quiver.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ Generate SVG images from text prompts using QuiverAI
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `prompt` | string | Yes | A text description of the desired SVG |
| `model` | string | Yes | The model to use for SVG generation \(e.g., "arrow-preview"\) |
| `model` | string | Yes | The model to use for SVG generation \(e.g., "arrow-2"\) |
| `instructions` | string | No | Style or formatting guidance for the SVG output |
| `references` | file | No | Reference images to guide SVG generation \(up to 4\) |
| `n` | number | No | Number of SVGs to generate \(1-16, default 1\) |
| `temperature` | number | No | Sampling temperature \(0-2, default 1\) |
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\) |
| `max_output_tokens` | number | No | Maximum output tokens \(1-131072\) |
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\) |
| `temperature` | number | No | Sampling temperature \(0-2, default 1\). Not sent for Arrow 2 Telos, which rejects it |
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\). Not sent for Arrow 2 Telos, which rejects it |
| `max_output_tokens` | number | No | Maximum output tokens \(1-65536\) |
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\). Not sent for Arrow 2 Telos, which rejects it |

#### Output

Expand All @@ -64,12 +64,12 @@ Convert raster images into vector SVG format using QuiverAI

| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `model` | string | Yes | The model to use for vectorization \(e.g., "arrow-preview"\) |
| `model` | string | Yes | The model to use for vectorization \(e.g., "arrow-2"\) |
| `image` | file | Yes | The raster image to vectorize into SVG |
| `temperature` | number | No | Sampling temperature \(0-2, default 1\) |
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\) |
| `max_output_tokens` | number | No | Maximum output tokens \(1-131072\) |
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\) |
| `temperature` | number | No | Sampling temperature \(0-2, default 1\). Not sent for Arrow 2 Telos, which rejects it |
| `top_p` | number | No | Nucleus sampling probability \(0-1, default 1\). Not sent for Arrow 2 Telos, which rejects it |
| `max_output_tokens` | number | No | Maximum output tokens \(1-65536\) |
| `presence_penalty` | number | No | Token penalty for prior output \(-2 to 2, default 0\). Not sent for Arrow 2 Telos, which rejects it |
| `auto_crop` | boolean | No | Automatically crop the image before vectorizing |
| `target_size` | number | No | Square resize target in pixels \(128-4096\) |

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/integrations/sendblue.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Display a typing indicator to a recipient (not supported in group chats).

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| `status` | string | Delivery status of the typing indicator \(e.g., QUEUED\) |
| `status` | string | Status of the typing indicator: SENT or ERROR |
| `status_code` | number | Numeric status code returned by Sendblue |
| `number` | string | The recipient phone number |
| `error_message` | string | Error details, null on success |
Expand Down
4 changes: 2 additions & 2 deletions apps/sim/blocks/blocks/profound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ export const ProfoundBlock: BlockConfig = {
{ label: 'Prompt Answers', id: 'prompt_answers' },
{ label: 'Bots Report', id: 'bots_report' },
{ label: 'Referrals Report', id: 'referrals_report' },
{ label: 'Raw Logs', id: 'raw_logs' },
{ label: 'Bot Logs', id: 'bot_logs' },
{ label: 'Raw Logs (Retired)', id: 'raw_logs' },
{ label: 'Bot Logs (Retired)', id: 'bot_logs' },
{ label: 'List Optimizations', id: 'list_optimizations' },
{ label: 'Optimization Analysis', id: 'optimization_analysis' },
{ label: 'Prompt Volume', id: 'prompt_volume' },
Expand Down
18 changes: 18 additions & 0 deletions apps/sim/blocks/blocks/quiver.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { describe, expect, it } from 'vitest'
import { validateValueForSubBlockType } from '@/lib/workflows/editing/validation'
import { QuiverBlock, QuiverV2Block, QuiverV3Block } from '@/blocks/blocks/quiver'

describe('Quiver model dropdown', () => {
it.each([QuiverBlock, QuiverV2Block, QuiverV3Block])(
'accepts retired Arrow 1.x ids that saved $type blocks still store',
(block) => {
const modelConfig = block.subBlocks.find((subBlock) => subBlock.id === 'model')
if (!modelConfig) throw new Error('Quiver model subBlock missing')
for (const model of ['arrow-preview', 'arrow-1', 'arrow-1.0', 'arrow-1.1', 'arrow-1.1-max']) {
expect(
validateValueForSubBlockType(modelConfig, model, 'model', block.type, 'quiver-1').valid
).toBe(true)
}
}
)
})
11 changes: 8 additions & 3 deletions apps/sim/blocks/blocks/quiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
normalizeFileInput,
withSavedCredential,
} from '@/blocks/utils'
import { RETIRED_QUIVER_MODELS } from '@/tools/quiver/models'

const REFERENCE_IMAGES_FIELD = ['referenceFiles', 'referenceInput'] as const
const IMAGE_FIELD = ['imageFile', 'imageInput'] as const
Expand Down Expand Up @@ -58,8 +59,12 @@ export const QuiverBlock = {
id: 'model',
title: 'Model',
type: 'dropdown',
options: [{ label: 'Arrow Preview', id: 'arrow-preview' }],
value: () => 'arrow-preview',
options: [
{ label: 'Arrow 2', id: 'arrow-2' },
{ label: 'Arrow 2 Telos', id: 'arrow-2-telos' },
...RETIRED_QUIVER_MODELS.map((id) => ({ label: 'Arrow 2', id, hidden: true })),
],
value: () => 'arrow-2',
condition: { field: 'operation', value: ['text_to_svg', 'image_to_svg'] },
},
{
Expand Down Expand Up @@ -172,7 +177,7 @@ export const QuiverBlock = {
id: 'maxOutputTokens',
title: 'Max Output Tokens',
type: 'short-input',
placeholder: '131072',
placeholder: '65536',
mode: 'advanced',
required: false,
condition: { field: 'operation', value: ['text_to_svg', 'image_to_svg'] },
Expand Down
37 changes: 36 additions & 1 deletion apps/sim/lib/internal/quiver/operations.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ describe('Quiver operations', () => {
'generations',
'secret',
{
model: 'arrow-preview',
model: 'arrow-2',
prompt: 'A compass',
instructions: 'Minimal',
references: [{ base64: 'AQID' }, { base64: 'BAU=' }],
Expand All @@ -140,6 +140,41 @@ describe('Quiver operations', () => {
expect(presented.output).not.toHaveProperty('svgContent')
})

it('sends retired Arrow 1.x model ids as arrow-2', async () => {
await executeQuiverImageToSvg(
{ apiKey: 'secret', model: 'arrow-preview', image: rawFile },
context
)
await executeQuiverImageToSvg(
{ apiKey: 'secret', model: 'arrow-2-telos', image: rawFile },
context
)

expect(mocks.requestQuiverSvg.mock.calls.map(([, , body]) => body.model)).toEqual([
'arrow-2',
'arrow-2-telos',
])
})

it('omits the sampling fields Arrow 2 Telos rejects', async () => {
const sampling = { temperature: 0.4, top_p: 0.9, presence_penalty: 0.2, max_output_tokens: 10 }
await executeQuiverImageToSvg(
{ apiKey: 'secret', model: 'arrow-2-telos', image: rawFile, ...sampling },
context
)
await executeQuiverImageToSvg(
{ apiKey: 'secret', model: 'arrow-2', image: rawFile, ...sampling },
context
)

const [telosBody, arrowBody] = mocks.requestQuiverSvg.mock.calls.map(([, , body]) => body)
expect(telosBody).not.toHaveProperty('temperature')
expect(telosBody).not.toHaveProperty('top_p')
expect(telosBody).not.toHaveProperty('presence_penalty')
expect(telosBody).toMatchObject({ max_output_tokens: 10 })
expect(arrowBody).toMatchObject(sampling)
})

it('fails closed on incomplete private model-input provenance', async () => {
const headers = new Headers({
[PRIVATE_MODEL_INPUT_PROVENANCE_HEADER]: RESOLVED_SECRET_PROVENANCE_METADATA_V1,
Expand Down
28 changes: 20 additions & 8 deletions apps/sim/lib/internal/quiver/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { processFilesToUserFiles } from '@/lib/uploads/utils/file'
import { downloadFileFromStorage } from '@/lib/uploads/utils/file.server'
import type { RawFileInput } from '@/lib/uploads/utils/file-schemas'
import { assertToolFileAccess } from '@/app/api/files/authorization'
import { RETIRED_QUIVER_MODELS } from '@/tools/quiver/models'
import type { QuiverSvgResponse } from '@/tools/quiver/types'

const logger = createLogger('QuiverOperations')
Expand All @@ -32,6 +33,21 @@ type ApiImage = { url: string } | { base64: string }

export type QuiverSvgOutput = QuiverSvgResponse & { success: true }

function resolveModel(model: string): string {
return (RETIRED_QUIVER_MODELS as readonly string[]).includes(model) ? 'arrow-2' : model
}

/** Arrow 2 Telos rejects these sampling fields with a 400 even when they hold the default. */
function addSamplingParams(
body: Record<string, unknown>,
input: Pick<QuiverTextToSvgInput, 'temperature' | 'top_p' | 'presence_penalty'>
): void {
if (body.model === 'arrow-2-telos') return
if (input.temperature != null) body.temperature = input.temperature
if (input.top_p != null) body.top_p = input.top_p
if (input.presence_penalty != null) body.presence_penalty = input.presence_penalty
}

function fail(message: string, status: number, body?: Record<string, unknown>): never {
throw new QuiverOperationError(message, status, body)
}
Expand Down Expand Up @@ -222,14 +238,12 @@ export async function executeQuiverTextToSvg(
}
}

const body: Record<string, unknown> = { model: input.model, prompt: input.prompt }
const body: Record<string, unknown> = { model: resolveModel(input.model), prompt: input.prompt }
if (input.instructions) body.instructions = input.instructions
if (references.length > 0) body.references = references.slice(0, 4)
if (input.n != null) body.n = input.n
if (input.temperature != null) body.temperature = input.temperature
if (input.top_p != null) body.top_p = input.top_p
addSamplingParams(body, input)
if (input.max_output_tokens != null) body.max_output_tokens = input.max_output_tokens
if (input.presence_penalty != null) body.presence_penalty = input.presence_penalty

const result = await requestQuiverSvg('generations', input.apiKey, body, context.signal)
context.signal?.throwIfAborted()
Expand Down Expand Up @@ -257,11 +271,9 @@ export async function executeQuiverImageToSvg(
context.signal?.throwIfAborted()
validateProvenance(input, context)
const image = await resolveImage(input.image, context)
const body: Record<string, unknown> = { model: input.model, image }
if (input.temperature != null) body.temperature = input.temperature
if (input.top_p != null) body.top_p = input.top_p
const body: Record<string, unknown> = { model: resolveModel(input.model), image }
addSamplingParams(body, input)
if (input.max_output_tokens != null) body.max_output_tokens = input.max_output_tokens
if (input.presence_penalty != null) body.presence_penalty = input.presence_penalty
if (input.auto_crop != null) body.auto_crop = input.auto_crop
if (input.target_size != null) body.target_size = input.target_size

Expand Down
2 changes: 1 addition & 1 deletion apps/sim/lib/internal/quiver/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const quiverCommonInputSchema = z.object({
model: z.string().min(1),
temperature: z.number().min(0).max(2).optional().nullable(),
top_p: z.number().min(0).max(1).optional().nullable(),
max_output_tokens: z.number().int().min(1).max(131072).optional().nullable(),
max_output_tokens: z.number().int().min(1).max(65536).optional().nullable(),
presence_penalty: z.number().min(-2).max(2).optional().nullable(),
[RESOLVED_SECRET_PROVENANCE_FIELD]: resolvedSecretTraceProvenanceSchema.optional(),
})
Expand Down
6 changes: 4 additions & 2 deletions apps/sim/tools/agentphone/delete_contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
} from '@/tools/agentphone/types'
import { AGENTPHONE_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
import { safeUrlPathSegment } from '@/tools/url-path'

export const agentphoneDeleteContactTool: ToolConfig<
AgentPhoneDeleteContactParams,
Expand Down Expand Up @@ -31,15 +32,16 @@ export const agentphoneDeleteContactTool: ToolConfig<
},

request: {
url: (params) => `https://api.agentphone.to/v1/contacts/${params.contactId.trim()}`,
url: (params) =>
`https://api.agentphone.to/v1/contacts/${safeUrlPathSegment(params.contactId, 'contactId')}`,
Comment thread
waleedlatif1 marked this conversation as resolved.
Resolved
method: 'DELETE',
headers: (params) => ({
Authorization: `Bearer ${params.apiKey}`,
}),
},

transformResponse: async (response, params): Promise<AgentPhoneDeleteContactResult> => {
const contactId = params?.contactId?.trim() ?? ''
const contactId = String(params?.contactId ?? '').trim()

if (!response.ok) {
let errorMessage = 'Failed to delete contact'
Expand Down
4 changes: 3 additions & 1 deletion apps/sim/tools/agentphone/get_call.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
} from '@/tools/agentphone/types'
import { AGENTPHONE_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
import { safeUrlPathSegment } from '@/tools/url-path'

export const agentphoneGetCallTool: ToolConfig<AgentPhoneGetCallParams, AgentPhoneGetCallResult> = {
id: 'agentphone_get_call',
Expand All @@ -29,7 +30,8 @@ export const agentphoneGetCallTool: ToolConfig<AgentPhoneGetCallParams, AgentPho
},

request: {
url: (params) => `https://api.agentphone.to/v1/calls/${params.callId.trim()}`,
url: (params) =>
`https://api.agentphone.to/v1/calls/${safeUrlPathSegment(params.callId, 'callId')}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.apiKey}`,
Expand Down
6 changes: 4 additions & 2 deletions apps/sim/tools/agentphone/get_call_transcript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
} from '@/tools/agentphone/types'
import { AGENTPHONE_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
import { safeUrlPathSegment } from '@/tools/url-path'

export const agentphoneGetCallTranscriptTool: ToolConfig<
AgentPhoneGetCallTranscriptParams,
Expand Down Expand Up @@ -32,7 +33,8 @@ export const agentphoneGetCallTranscriptTool: ToolConfig<
},

request: {
url: (params) => `https://api.agentphone.to/v1/calls/${params.callId.trim()}/transcript`,
url: (params) =>
`https://api.agentphone.to/v1/calls/${safeUrlPathSegment(params.callId, 'callId')}/transcript`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.apiKey}`,
Expand All @@ -41,7 +43,7 @@ export const agentphoneGetCallTranscriptTool: ToolConfig<

transformResponse: async (response, params): Promise<AgentPhoneGetCallTranscriptResult> => {
const data = await response.json()
const callId = params?.callId?.trim() ?? ''
const callId = String(params?.callId ?? '').trim()

if (!response.ok) {
return {
Expand Down
4 changes: 3 additions & 1 deletion apps/sim/tools/agentphone/get_contact.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
} from '@/tools/agentphone/types'
import { AGENTPHONE_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
import { safeUrlPathSegment } from '@/tools/url-path'

export const agentphoneGetContactTool: ToolConfig<
AgentPhoneGetContactParams,
Expand Down Expand Up @@ -31,7 +32,8 @@ export const agentphoneGetContactTool: ToolConfig<
},

request: {
url: (params) => `https://api.agentphone.to/v1/contacts/${params.contactId.trim()}`,
url: (params) =>
`https://api.agentphone.to/v1/contacts/${safeUrlPathSegment(params.contactId, 'contactId')}`,
method: 'GET',
headers: (params) => ({
Authorization: `Bearer ${params.apiKey}`,
Expand Down
3 changes: 2 additions & 1 deletion apps/sim/tools/agentphone/get_conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
} from '@/tools/agentphone/types'
import { AGENTPHONE_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
import { safeUrlPathSegment } from '@/tools/url-path'

export const agentphoneGetConversationTool: ToolConfig<
AgentPhoneGetConversationParams,
Expand Down Expand Up @@ -44,7 +45,7 @@ export const agentphoneGetConversationTool: ToolConfig<
query.set('message_limit', String(params.messageLimit))
}
const qs = query.toString()
return `https://api.agentphone.to/v1/conversations/${params.conversationId.trim()}${qs ? `?${qs}` : ''}`
return `https://api.agentphone.to/v1/conversations/${safeUrlPathSegment(params.conversationId, 'conversationId')}${qs ? `?${qs}` : ''}`
},
method: 'GET',
headers: (params) => ({
Expand Down
3 changes: 2 additions & 1 deletion apps/sim/tools/agentphone/get_conversation_messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type {
} from '@/tools/agentphone/types'
import { AGENTPHONE_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
import { safeUrlPathSegment } from '@/tools/url-path'

export const agentphoneGetConversationMessagesTool: ToolConfig<
AgentPhoneGetConversationMessagesParams,
Expand Down Expand Up @@ -56,7 +57,7 @@ export const agentphoneGetConversationMessagesTool: ToolConfig<
if (params.before) query.set('before', params.before)
if (params.after) query.set('after', params.after)
const qs = query.toString()
return `https://api.agentphone.to/v1/conversations/${params.conversationId.trim()}/messages${qs ? `?${qs}` : ''}`
return `https://api.agentphone.to/v1/conversations/${safeUrlPathSegment(params.conversationId, 'conversationId')}/messages${qs ? `?${qs}` : ''}`
},
method: 'GET',
headers: (params) => ({
Expand Down
3 changes: 2 additions & 1 deletion apps/sim/tools/agentphone/get_number_messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type {
} from '@/tools/agentphone/types'
import { AGENTPHONE_CREDENTIAL_OAUTH } from '@/tools/shared/saved-credentials'
import type { ToolConfig } from '@/tools/types'
import { safeUrlPathSegment } from '@/tools/url-path'

export const agentphoneGetNumberMessagesTool: ToolConfig<
AgentPhoneGetNumberMessagesParams,
Expand Down Expand Up @@ -55,7 +56,7 @@ export const agentphoneGetNumberMessagesTool: ToolConfig<
if (params.before) query.set('before', params.before)
if (params.after) query.set('after', params.after)
const qs = query.toString()
return `https://api.agentphone.to/v1/numbers/${params.numberId.trim()}/messages${qs ? `?${qs}` : ''}`
return `https://api.agentphone.to/v1/numbers/${safeUrlPathSegment(params.numberId, 'numberId')}/messages${qs ? `?${qs}` : ''}`
},
method: 'GET',
headers: (params) => ({
Expand Down
Loading
Loading