Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
75f6e15
fix(docs): pin the generator's sort locale to en-US
waleedlatif1 Aug 28, 2026
c647676
fix(vanta): remove the MIME Type field whose value was always discarded
waleedlatif1 Aug 28, 2026
3604c23
fix(github): resolve the PR head SHA for file comments
waleedlatif1 Aug 28, 2026
77cece9
fix(google-drive): expose the page token so pagination is reachable
waleedlatif1 Aug 28, 2026
a9b476e
fix(confluence): stop documenting a cloudId users cannot supply
waleedlatif1 Aug 28, 2026
83f5cd9
fix(docs): teach the source scanner about regex literals
waleedlatif1 Aug 28, 2026
a4d9a73
Merge remote-tracking branch 'origin/staging' into fix/pre-existing-i…
waleedlatif1 Aug 28, 2026
83b16ae
fix(github): gate the commit lookup on path, coerce line, name the fa…
waleedlatif1 Aug 28, 2026
5d74dcb
test(github): cover the comment routing cases the gate changed
waleedlatif1 Aug 28, 2026
0e790bf
fix(google-drive): let an agent feed the page token back in
waleedlatif1 Aug 28, 2026
539e1ab
docs(generator): name the load-bearing newline rule and report an uns…
waleedlatif1 Aug 28, 2026
00ff23b
fix(vanta): declare the removed uploadMimeType subblock as dropped
waleedlatif1 Aug 28, 2026
a181906
fix(github): run the two-phase PR comment on the secure transport
waleedlatif1 Aug 28, 2026
06bf99f
fix(vanta): keep mimeType an ordinary upload parameter
waleedlatif1 Aug 28, 2026
cc5a264
fix(generator): lex regex-in-keyword-position and template interpolation
waleedlatif1 Aug 28, 2026
1403919
fix(github): stop forwarding the GitHub token across a redirect origin
waleedlatif1 Aug 28, 2026
68035f6
fix(github): reject a fractional comment line instead of truncating it
waleedlatif1 Aug 28, 2026
ae542d9
fix(github): select the comment endpoint by comment type, not by path
waleedlatif1 Aug 28, 2026
e2b4eae
test(confluence): drop the cloudId visibility invariant test
waleedlatif1 Aug 28, 2026
1f06127
fix(github): send an explicit User-Agent and stop downgrading a redir…
waleedlatif1 Aug 28, 2026
ec43e24
fix(vanta): drop the dead whenOperation from the removed-subblock entry
waleedlatif1 Aug 28, 2026
36d0488
fix(docs-gen): close a regex-vs-division gap and make three guards te…
waleedlatif1 Aug 28, 2026
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
46 changes: 0 additions & 46 deletions apps/docs/content/docs/en/integrations/confluence.mdx

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions apps/docs/content/docs/en/integrations/google_drive.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ List files and folders in Google Drive with complete metadata
| `folderId` | string | No | The ID of the folder to list files from \(internal use\) |
| `query` | string | No | Search term to filter files by name \(e.g. "budget" finds files with "budget" in the name\). Do NOT use Google Drive query syntax here - just provide a plain search term. |
| `pageSize` | number | No | The maximum number of files to return \(default: 100\) |
| `pageToken` | string | No | The page token to use for pagination |

#### Output

Expand Down Expand Up @@ -484,6 +485,7 @@ Search for files in Google Drive using advanced query syntax (e.g., fullText con
| --------- | ---- | -------- | ----------- |
| `query` | string | Yes | Google Drive query string using advanced search syntax \(e.g., "fullText contains 'budget'", "mimeType = 'application/pdf'", "modifiedTime > '2024-01-01'"\) |
| `pageSize` | number | No | Maximum number of files to return \(default: 100\) |
| `pageToken` | string | No | Token for fetching the next page of results |

#### Output

Expand Down Expand Up @@ -671,6 +673,7 @@ List all permissions (who has access) for a file in Google Drive
| Parameter | Type | Required | Description |
| --------- | ---- | -------- | ----------- |
| `fileId` | string | Yes | The ID of the file to list permissions for |
| `pageToken` | string | No | The page token to use for pagination |

#### Output

Expand Down Expand Up @@ -720,6 +723,7 @@ List the revision history of a file in Google Drive
| --------- | ---- | -------- | ----------- |
| `fileId` | string | Yes | The ID of the file to list revisions for |
| `pageSize` | number | No | Maximum number of revisions to return \(1-1000, default 200\) |
| `pageToken` | string | No | The page token to use for pagination |

#### Output

Expand Down Expand Up @@ -779,6 +783,7 @@ List comments on a file in Google Drive
| `includeDeleted` | boolean | No | Whether to include deleted comments \(their content is stripped\) |
| `pageSize` | number | No | Maximum number of comments to return \(1-100, default 20\) |
| `startModifiedTime` | string | No | Only return comments modified after this RFC 3339 timestamp |
| `pageToken` | string | No | The page token to use for pagination |

#### Output

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/content/docs/en/integrations/vanta.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ Upload an evidence file to a Vanta document. Requires credentials with the vanta
| `documentId` | string | Yes | Unique ID of the document to attach the file to |
| `file` | file | No | The evidence file to upload |
| `fileName` | string | No | Optional file name override |
| `mimeType` | string | No | MIME type of the file \(e.g., application/pdf\). Used only for base64 uploads; ignored for a file from the File input, whose content type is always resolved from storage. |
| `mimeType` | string | No | MIME type of the file \(e.g., application/pdf\). Applies only to the base64 upload path; a file from the File input always sends the content type resolved from storage. |
| `description` | string | No | Description of the uploaded evidence \(e.g., "Q3 access review evidence"\) |
| `effectiveAtDate` | string | No | ISO 8601 date indicating when the document is effective from |

Expand Down
97 changes: 97 additions & 0 deletions apps/sim/blocks/blocks/google_drive.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
/**
* @vitest-environment node
*/
import { describe, expect, it, vi } from 'vitest'

vi.mock('@/triggers', () => ({
getTrigger: () => ({ subBlocks: [] }),
}))

import { GoogleDriveBlock } from '@/blocks/blocks/google_drive'
import { listTool } from '@/tools/google_drive/list'
import { listCommentsTool } from '@/tools/google_drive/list_comments'
import { listPermissionsTool } from '@/tools/google_drive/list_permissions'
import { listRevisionsTool } from '@/tools/google_drive/list_revisions'
import { searchTool } from '@/tools/google_drive/search'

const paginationCases = [
{ operation: 'list', subBlockId: 'pageToken', tool: listTool },
{ operation: 'search', subBlockId: 'searchPageToken', tool: searchTool },
{ operation: 'list_permissions', subBlockId: 'permissionsPageToken', tool: listPermissionsTool },
{ operation: 'list_revisions', subBlockId: 'revisionsPageToken', tool: listRevisionsTool },
{ operation: 'list_comments', subBlockId: 'commentsPageToken', tool: listCommentsTool },
] as const

describe('GoogleDriveBlock pagination', () => {
const buildParams = GoogleDriveBlock.tools.config.params!

describe.each(paginationCases)('$operation', ({ operation, subBlockId, tool }) => {
it('exposes a page token field scoped to the operation', () => {
expect(GoogleDriveBlock.subBlocks.find(({ id }) => id === subBlockId)).toMatchObject({
type: 'short-input',
mode: 'advanced',
condition: { field: 'operation', value: operation },
})
})

/**
* `pageToken` is the canonical tool param, so the `list` case would forward
* through `...rest` even without the mapper. The per-operation ids are the
* ones the mapper has to translate, and none of them may survive as-is.
*/
it('forwards the page token to the tool under its own id', () => {
const params = buildParams({ operation, [subBlockId]: 'token-abc' }, undefined as never)

expect(params).toMatchObject({ pageToken: 'token-abc' })
if (subBlockId !== 'pageToken') expect(params[subBlockId]).toBeUndefined()
})

it('lets an agent feed a nextPageToken back in', () => {
expect(tool.params.pageToken?.visibility).toBe('user-or-llm')
})
})

it('does not leak a page token into operations that do not paginate', () => {
expect(
buildParams({ operation: 'get_file', pageToken: 'token-abc' }, undefined as never).pageToken
).toBeUndefined()
})

/**
* `shouldSerializeSubBlock` short-circuits for `advanced` fields in basic display
* mode without evaluating `condition`, so a page token typed under one operation
* genuinely reaches `inputs` after the user switches to another. The mapper must
* pick the token belonging to the operation being run and drop the rest.
*/
describe.each(paginationCases.filter(({ subBlockId }) => subBlockId !== 'pageToken'))(
'$subBlockId left over from a previous operation',
({ subBlockId }) => {
it.each(['upload', 'get_file', 'list'])('is dropped under %s', (operation) => {
const params = buildParams({ operation, [subBlockId]: 'stale' }, undefined as never)

expect(params.pageToken).toBeUndefined()
expect(params[subBlockId]).toBeUndefined()
})
}
)

it('prefers the operation-owned token when a stale sibling is also present', () => {
const params = buildParams(
{
operation: 'search',
searchPageToken: 'search-token',
commentsPageToken: 'stale',
pageToken: 'stale-canonical',
},
undefined as never
)

expect(params.pageToken).toBe('search-token')
expect(params.commentsPageToken).toBeUndefined()
expect(params.searchPageToken).toBeUndefined()
})

it('declares pageToken as a block input', () => {
expect(GoogleDriveBlock.inputs.pageToken).toBeDefined()
})
})
54 changes: 54 additions & 0 deletions apps/sim/blocks/blocks/google_drive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,14 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
placeholder: 'Number of results (default: 100, max: 100)',
condition: { field: 'operation', value: 'list' },
},
{
id: 'pageToken',
title: 'Page Token',
type: 'short-input',
placeholder: 'Token from a previous nextPageToken',
mode: 'advanced',
condition: { field: 'operation', value: 'list' },
},
// Download File Fields - File Selector (basic mode)
{
id: 'downloadFileSelector',
Expand Down Expand Up @@ -905,6 +913,14 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr
condition: { field: 'operation', value: 'list_permissions' },
required: true,
},
{
id: 'permissionsPageToken',
title: 'Page Token',
type: 'short-input',
placeholder: 'Token from a previous nextPageToken',
mode: 'advanced',
condition: { field: 'operation', value: 'list_permissions' },
},
// Get File Content Fields
{
id: 'getContentFileSelector',
Expand Down Expand Up @@ -1073,6 +1089,14 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
mode: 'advanced',
condition: { field: 'operation', value: 'search' },
},
{
id: 'searchPageToken',
title: 'Page Token',
type: 'short-input',
placeholder: 'Token from a previous nextPageToken',
mode: 'advanced',
condition: { field: 'operation', value: 'search' },
},
// Untrash File Fields
{
id: 'untrashFileSelector',
Expand Down Expand Up @@ -1191,6 +1215,14 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
mode: 'advanced',
condition: { field: 'operation', value: 'list_revisions' },
},
{
id: 'revisionsPageToken',
title: 'Page Token',
type: 'short-input',
placeholder: 'Token from a previous nextPageToken',
mode: 'advanced',
condition: { field: 'operation', value: 'list_revisions' },
},
{
id: 'getRevisionFileSelector',
title: 'Select File',
Expand Down Expand Up @@ -1255,6 +1287,14 @@ Return ONLY the query string - no explanations, no quotes around the whole thing
mode: 'advanced',
condition: { field: 'operation', value: 'list_comments' },
},
{
id: 'commentsPageToken',
title: 'Page Token',
type: 'short-input',
placeholder: 'Token from a previous nextPageToken',
mode: 'advanced',
condition: { field: 'operation', value: 'list_comments' },
},
{
id: 'includeDeleted',
title: 'Include Deleted Comments',
Expand Down Expand Up @@ -1473,6 +1513,11 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
searchPageSize,
revisionsPageSize,
commentsPageSize,
pageToken,
searchPageToken,
permissionsPageToken,
revisionsPageToken,
commentsPageToken,
getContentExportMimeType,
exportMimeType,
...rest
Expand Down Expand Up @@ -1586,6 +1631,13 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
else if (params.operation === 'list_revisions') effectivePageSize = revisionsPageSize
else if (params.operation === 'list_comments') effectivePageSize = commentsPageSize

let effectivePageToken: string | undefined = pageToken
if (params.operation === 'search') effectivePageToken = searchPageToken
else if (params.operation === 'list_permissions') effectivePageToken = permissionsPageToken
else if (params.operation === 'list_revisions') effectivePageToken = revisionsPageToken
else if (params.operation === 'list_comments') effectivePageToken = commentsPageToken
else if (params.operation !== 'list') effectivePageToken = undefined

const effectiveQuery = params.operation === 'search' ? searchQuery : query
const effectiveMimeType =
params.operation === 'get_content'
Expand All @@ -1603,6 +1655,7 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
pageSize: effectivePageSize
? Number.parseInt(effectivePageSize as string, 10)
: undefined,
pageToken: effectivePageToken?.trim() || undefined,
query: effectiveQuery,
mimeType: effectiveMimeType === 'auto' ? undefined : effectiveMimeType,
type: shareType, // Map shareType to type for share tool
Expand Down Expand Up @@ -1660,6 +1713,7 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.`
// List operation inputs
query: { type: 'string', description: 'Search query' },
pageSize: { type: 'number', description: 'Results per page' },
pageToken: { type: 'string', description: 'Pagination token from a previous nextPageToken' },
// Copy operation inputs
newName: { type: 'string', description: 'New name for copied file' },
// Update operation inputs
Expand Down
13 changes: 0 additions & 13 deletions apps/sim/blocks/blocks/vanta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,14 +286,6 @@ export const VantaBlock: BlockConfig<ToolResponse> = {
condition: { field: 'operation', value: 'upload_document_file' },
mode: 'advanced',
},
{
id: 'uploadMimeType',
title: 'MIME Type',
type: 'short-input',
placeholder: 'e.g., application/pdf (used when the file has no type of its own)',
condition: { field: 'operation', value: 'upload_document_file' },
mode: 'advanced',
},
{
id: 'uploadDescription',
title: 'Description',
Expand Down Expand Up @@ -930,7 +922,6 @@ export const VantaBlock: BlockConfig<ToolResponse> = {
const normalizedFile = normalizeFileInput(rest.file, { single: true })
if (normalizedFile) result.file = normalizedFile
result.fileName = optionalString(rest.uploadFileName)
result.mimeType = optionalString(rest.uploadMimeType)
result.description = optionalString(rest.uploadDescription)
result.effectiveAtDate = optionalString(rest.effectiveAtDate)
break
Expand Down Expand Up @@ -993,10 +984,6 @@ export const VantaBlock: BlockConfig<ToolResponse> = {
uploadedFileId: { type: 'string', description: 'Uploaded file ID' },
file: { type: 'json', description: 'Evidence file to upload' },
uploadFileName: { type: 'string', description: 'Optional file name override' },
uploadMimeType: {
type: 'string',
description: 'MIME type override used when the uploaded content has no type of its own',
},
uploadDescription: { type: 'string', description: 'Description of the uploaded evidence' },
effectiveAtDate: { type: 'string', description: 'Effective date of the document (ISO 8601)' },
frameworkMatchesAny: { type: 'string', description: 'Comma-separated framework ID filters' },
Expand Down
5 changes: 5 additions & 0 deletions apps/sim/lib/internal/vanta/file-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export async function resolveVantaUploadFile(
signal: context.signal,
})
context.signal?.throwIfAborted()
/**
* Every return path of `downloadServableFileFromStorage` yields a non-empty content
* type, so `resolved.contentType` always wins. The remaining operands are defensive
* fallbacks kept in place in case that guarantee is ever relaxed.
*/
return {
buffer: resolved.buffer,
fileName: input.fileName || userFile.name,
Expand Down
7 changes: 7 additions & 0 deletions apps/sim/lib/workflows/migrations/subblock-migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,13 @@ export const SUBBLOCK_ID_MIGRATIONS: Record<string, readonly SubblockIdMigration
* dropped outright.
*/
sap_concur: [{ from: 'forwardId', to: '_removed_forwardId' }],
/**
* `uploadMimeType` was an advanced MIME Type input on Upload Document File whose
* value the upload path never read: the content type is resolved from storage and
* that resolution is never empty, so the field's value lost the `||` chain every
* time. Dropped rather than renamed — there is no field for the value to move to.
*/
vanta: [{ from: 'uploadMimeType', to: '_removed_uploadMimeType' }],
}

/** Reads the value out of a stored subblock entry, tolerating a bare value. */
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/confluence/add_label.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export const confluenceAddLabelTool: InternalToolConfig<
cloudId: {
type: 'string',
required: false,
visibility: 'user-only',
visibility: 'hidden',
description:
'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/confluence/create_blogpost.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const confluenceCreateBlogPostTool: InternalToolConfig<
cloudId: {
type: 'string',
required: false,
visibility: 'user-only',
visibility: 'hidden',
description:
'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/confluence/create_comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const confluenceCreateCommentTool: InternalToolConfig<
cloudId: {
type: 'string',
required: false,
visibility: 'user-only',
visibility: 'hidden',
description:
'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/confluence/create_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const confluenceCreatePageTool: InternalToolConfig<
cloudId: {
type: 'string',
required: false,
visibility: 'user-only',
visibility: 'hidden',
description:
'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/confluence/create_page_property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const confluenceCreatePagePropertyTool: InternalToolConfig<
cloudId: {
type: 'string',
required: false,
visibility: 'user-only',
visibility: 'hidden',
description:
'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/confluence/create_space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const confluenceCreateSpaceTool: InternalToolConfig<
cloudId: {
type: 'string',
required: false,
visibility: 'user-only',
visibility: 'hidden',
description:
'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/confluence/create_space_property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const confluenceCreateSpacePropertyTool: InternalToolConfig<
cloudId: {
type: 'string',
required: false,
visibility: 'user-only',
visibility: 'hidden',
description:
'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.',
},
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/confluence/delete_attachment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const confluenceDeleteAttachmentTool: InternalToolConfig<
cloudId: {
type: 'string',
required: false,
visibility: 'user-only',
visibility: 'hidden',
description:
'Confluence Cloud ID for the instance. If not provided, it will be fetched using the domain.',
},
Expand Down
Loading
Loading