From 0d69dc4a966daf7e618e8fa383388543acc1d7b7 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 1 Oct 2026 17:18:57 -0700 Subject: [PATCH 1/4] chore(lint): delete commented-out code Removes dead sub-block configs from the Human in the Loop and Greptile blocks and an unused commented-out DisplayMode type. The docs generator read the commented-out greptile_search entry in tools.access, so the generated Greptile docs advertised a disabled operation; regenerated. --- .../content/docs/integrations/greptile.mdx | 29 ------- apps/sim/blocks/blocks/greptile.ts | 33 +------ apps/sim/blocks/blocks/human_in_the_loop.ts | 87 ------------------- apps/sim/stores/terminal/types.ts | 8 -- .../deployment-config/src/integrations.json | 8 +- 5 files changed, 3 insertions(+), 162 deletions(-) diff --git a/apps/docs/content/docs/integrations/greptile.mdx b/apps/docs/content/docs/integrations/greptile.mdx index 5df5d794748..43438c7019a 100644 --- a/apps/docs/content/docs/integrations/greptile.mdx +++ b/apps/docs/content/docs/integrations/greptile.mdx @@ -53,35 +53,6 @@ Query repositories in natural language and get answers with relevant code refere | ↳ `summary` | string | Summary of the code section | | ↳ `distance` | number | Similarity score \(lower = more relevant\) | -### Greptile Search - -Search repositories in natural language and get relevant code references without generating an answer. Useful for finding specific code locations. - -#### Input - -| Parameter | Type | Required | Description | -| --------- | ---- | -------- | ----------- | -| `query` | string | Yes | Natural language search query to find relevant code. Example: "authentication middleware" or "database connection handling" | -| `repositories` | string | Yes | Comma-separated list of repositories. Format: "github:branch:owner/repo" or just "owner/repo" \(defaults to github:main\). Example: "facebook/react" or "github:main:facebook/react,github:main:facebook/relay" | -| `sessionId` | string | No | Session ID for conversation continuity. Use the same sessionId across multiple searches to maintain context. Example: "session-abc123" | -| `genius` | boolean | No | Enable genius mode for more thorough search \(slower but more accurate\) | -| `apiKey` | string | Yes | Greptile API key | -| `githubToken` | string | Yes | GitHub Personal Access Token with repo read access | - -#### Output - -| Parameter | Type | Description | -| --------- | ---- | ----------- | -| `sources` | array | Relevant code references matching the search query | -| ↳ `repository` | string | Repository name \(owner/repo\) | -| ↳ `remote` | string | Git remote \(github/gitlab\) | -| ↳ `branch` | string | Branch name | -| ↳ `filepath` | string | Path to the file | -| ↳ `linestart` | number | Starting line number | -| ↳ `lineend` | number | Ending line number | -| ↳ `summary` | string | Summary of the code section | -| ↳ `distance` | number | Similarity score \(lower = more relevant\) | - ### Greptile Index Repository Submit a repository to be indexed by Greptile. Indexing must complete before the repository can be queried. Small repos take 3-5 minutes, larger ones can take over an hour. diff --git a/apps/sim/blocks/blocks/greptile.ts b/apps/sim/blocks/blocks/greptile.ts index 90e1fbe91f9..e374023ba6a 100644 --- a/apps/sim/blocks/blocks/greptile.ts +++ b/apps/sim/blocks/blocks/greptile.ts @@ -42,7 +42,6 @@ export const GreptileBlock: BlockConfig = { type: 'dropdown', options: [ { label: 'Query', id: 'greptile_query' }, - // { label: 'Search', id: 'greptile_search' }, // Disabled: Greptile search endpoint returning v1 deprecation error { label: 'Index Repository', id: 'greptile_index_repo' }, { label: 'Check Status', id: 'greptile_status' }, ], @@ -78,36 +77,6 @@ export const GreptileBlock: BlockConfig = { type: 'switch', condition: { field: 'operation', value: 'greptile_query' }, }, - // Search operation inputs - Disabled: Greptile search endpoint returning v1 deprecation error - // { - // id: 'query', - // title: 'Search Query', - // type: 'long-input', - // placeholder: 'Search for code patterns, functions, or concepts...', - // condition: { field: 'operation', value: 'greptile_search' }, - // required: true, - // }, - // { - // id: 'repositories', - // title: 'Repositories', - // type: 'long-input', - // placeholder: 'owner/repo, github:main:owner/repo (comma-separated)', - // condition: { field: 'operation', value: 'greptile_search' }, - // required: true, - // }, - // { - // id: 'sessionId', - // title: 'Session ID', - // type: 'short-input', - // placeholder: 'Optional session ID for conversation continuity', - // condition: { field: 'operation', value: 'greptile_search' }, - // }, - // { - // id: 'genius', - // title: 'Genius Mode', - // type: 'switch', - // condition: { field: 'operation', value: 'greptile_search' }, - // }, // Index & Status shared inputs { id: 'remote', @@ -168,7 +137,7 @@ export const GreptileBlock: BlockConfig = { }, ], tools: { - access: ['greptile_query', /* 'greptile_search', */ 'greptile_index_repo', 'greptile_status'], + access: ['greptile_query', 'greptile_index_repo', 'greptile_status'], config: { tool: (params) => params.operation, }, diff --git a/apps/sim/blocks/blocks/human_in_the_loop.ts b/apps/sim/blocks/blocks/human_in_the_loop.ts index 14cd5b62850..ade47e74a11 100644 --- a/apps/sim/blocks/blocks/human_in_the_loop.ts +++ b/apps/sim/blocks/blocks/human_in_the_loop.ts @@ -22,24 +22,10 @@ export const HumanInTheLoopBlock: BlockConfig = { }, }, subBlocks: [ - // Operation dropdown hidden - block defaults to human approval mode - // { - // id: 'operation', - // title: 'Operation', - // type: 'dropdown', - // layout: 'full', - // options: [ - // { label: 'Human Approval', id: 'human' }, - // { label: 'API Response', id: 'api' }, - // ], - // value: () => 'human', - // description: 'Choose whether to wait for human approval or send an API response', - // }, { id: 'builderData', title: 'Display Data', type: 'response-format', - // condition: { field: 'operation', value: 'human' }, // Always shown since we only support human mode description: 'Define the structure of your response data. Use in field names to reference workflow variables.', }, @@ -47,88 +33,15 @@ export const HumanInTheLoopBlock: BlockConfig = { id: 'notification', title: 'Notification (Send URL)', type: 'tool-input', - // condition: { field: 'operation', value: 'human' }, // Always shown since we only support human mode description: 'Configure notification tools to alert approvers (e.g., Slack, Email)', defaultValue: [], }, - // API mode subBlocks commented out - only human approval mode is supported - // { - // id: 'dataMode', - // title: 'Response Data Mode', - // type: 'dropdown', - // layout: 'full', - // options: [ - // { label: 'Builder', id: 'structured' }, - // { label: 'Editor', id: 'json' }, - // ], - // value: () => 'structured', - // condition: { field: 'operation', value: 'api' }, - // description: 'Choose how to define your response data structure', - // }, { id: 'inputFormat', title: 'Resume Form', type: 'input-format', - // condition: { field: 'operation', value: 'human' }, // Always shown since we only support human mode description: 'Define the fields the approver can fill in when resuming', }, - // { - // id: 'data', - // title: 'Response Data', - // type: 'code', - // layout: 'full', - // placeholder: '{\n "message": "Hello world",\n "userId": ""\n}', - // language: 'json', - // condition: { - // field: 'operation', - // value: 'api', - // and: { field: 'dataMode', value: 'json' }, - // }, - // description: - // 'Data that will be sent as the response body on API calls. Use to reference workflow variables.', - // wandConfig: { - // enabled: true, - // maintainHistory: true, - // prompt: `You are an expert JSON programmer. - // Generate ONLY the raw JSON object based on the user's request. - // The output MUST be a single, valid JSON object, starting with { and ending with }. - // - // Current response: {context} - // - // Do not include any explanations, markdown formatting, or other text outside the JSON object. - // - // You have access to the following variables you can use to generate the JSON body: - // - 'params' (object): Contains input parameters derived from the JSON schema. Access these directly using the parameter name wrapped in angle brackets, e.g., ''. Do NOT use 'params.paramName'. - // - 'environmentVariables' (object): Contains environment variables. Reference these using the double curly brace syntax: '{{ENV_VAR_NAME}}'. Do NOT use 'environmentVariables.VAR_NAME' or env. - // - // Example: - // { - // "name": "", - // "age": , - // "success": true - // }`, - // placeholder: 'Describe the API response structure you need...', - // generationType: 'json-object', - // }, - // }, - // { - // id: 'status', - // title: 'Status Code', - // type: 'short-input', - // layout: 'half', - // placeholder: '200', - // condition: { field: 'operation', value: 'api' }, - // description: 'HTTP status code (default: 200)', - // }, - // { - // id: 'headers', - // title: 'Response Headers', - // type: 'table', - // layout: 'full', - // columns: ['Key', 'Value'], - // condition: { field: 'operation', value: 'api' }, - // description: 'Additional HTTP headers to include in the response', - // }, ], tools: { access: [] }, inputs: { diff --git a/apps/sim/stores/terminal/types.ts b/apps/sim/stores/terminal/types.ts index b8eba62e6e1..ac6ef97af55 100644 --- a/apps/sim/stores/terminal/types.ts +++ b/apps/sim/stores/terminal/types.ts @@ -1,11 +1,3 @@ -/** - * Display mode type for terminal output. - * - * @remarks - * Currently unused but kept for future customization of terminal rendering. - */ -// export type DisplayMode = 'raw' | 'prettier' - /** * Terminal state persisted across workspace sessions. */ diff --git a/packages/deployment-config/src/integrations.json b/packages/deployment-config/src/integrations.json index b3d946d81cc..d2596f05c62 100644 --- a/packages/deployment-config/src/integrations.json +++ b/packages/deployment-config/src/integrations.json @@ -1,5 +1,5 @@ { - "updatedAt": "2026-09-29", + "updatedAt": "2026-10-02", "integrations": [ { "type": "onepassword", @@ -11409,10 +11409,6 @@ "name": "Query", "description": "Query repositories in natural language and get answers with relevant code references. Greptile uses AI to understand your codebase and answer questions." }, - { - "name": "Search", - "description": "Search repositories in natural language and get relevant code references without generating an answer. Useful for finding specific code locations." - }, { "name": "Index Repository", "description": "Submit a repository to be indexed by Greptile. Indexing must complete before the repository can be queried. Small repos take 3-5 minutes, larger ones can take over an hour." @@ -11422,7 +11418,7 @@ "description": "Check the indexing status of a repository. Use this to verify if a repository is ready to be queried or to monitor indexing progress." } ], - "operationCount": 4, + "operationCount": 3, "triggers": [], "triggerCount": 0, "authType": "api-key", From 95bb5b748669506d51b83d45c6b6a42db75f92bd Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 1 Oct 2026 17:18:59 -0700 Subject: [PATCH 2/4] improvement(audits): add check:comment-hygiene Fails on banner separator comments and on line comments whose text parses as TypeScript (commented-out code). Comments come from the Babel token stream so strings are never inspected; prose lines split comment groups, and labels, literals and one-off glosses are rejected, giving zero false positives across the tree. Change-history phrasing was measured and left out because most hits describe live state. --- package.json | 1 + scripts/check-comment-hygiene.test.ts | 100 ++++++++++ scripts/check-comment-hygiene.ts | 258 ++++++++++++++++++++++++++ 3 files changed, 359 insertions(+) create mode 100644 scripts/check-comment-hygiene.test.ts create mode 100644 scripts/check-comment-hygiene.ts diff --git a/package.json b/package.json index aeaefe9f360..239c17ea62a 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "check:migrations": "bun run scripts/check-migrations-safety.ts", "check:native-typecheck": "bun run scripts/check-native-typecheck.ts", "check:source-text": "bun run scripts/check-source-text.ts", + "check:comment-hygiene": "bun run scripts/check-comment-hygiene.ts", "check:site-urls": "bun run scripts/check-site-urls.ts", "check:library-content": "bun run scripts/check-library-content.ts", "check:spec-example-ids": "bun run scripts/check-spec-example-ids.ts", diff --git a/scripts/check-comment-hygiene.test.ts b/scripts/check-comment-hygiene.test.ts new file mode 100644 index 00000000000..906bbb0d985 --- /dev/null +++ b/scripts/check-comment-hygiene.test.ts @@ -0,0 +1,100 @@ +import { describe, expect, it } from 'vitest' +import { findViolations } from './check-comment-hygiene' + +function rules(source: string, file = 'example.ts') { + return findViolations(file, source).map(({ rule, line }) => `${rule}@${line}`) +} + +describe('banner', () => { + it('flags decorated separators in line and single-line block comments', () => { + const source = [ + '// ==========', + '// --- Helpers ---', + ' // ─── Runs ───', + '/* ------ v2 grammar ------ */', + 'const a = 1', + ].join('\n') + expect(rules(source)).toEqual(['banner@1', 'banner@2', 'banner@3', 'banner@4']) + }) + + it('ignores separators inside strings and multi-line TSDoc', () => { + const source = [ + 'const frontmatter = `', + '// ---', + '`', + '/**', + ' * ---', + ' * name: skill', + ' * ---', + ' */', + 'export const b = frontmatter', + ].join('\n') + expect(rules(source)).toEqual([]) + }) +}) + +describe('commented-out-code', () => { + it('flags a commented-out object under a prose heading', () => { + const source = [ + 'const blocks = [', + ' // Disabled until the endpoint is back', + ' // {', + " // id: 'query',", + " // condition: { field: 'operation', value: 'search' },", + ' // },', + ']', + ].join('\n') + expect(rules(source)).toEqual(['commented-out-code@3']) + }) + + it('flags snippets that only parse separately', () => { + const source = [ + '// {', + "// id: 'x',", + '// },', + "// export type Mode = 'raw' | 'pretty'", + ].join('\n') + expect(rules(source)).toEqual(['commented-out-code@1']) + }) + + it('flags single commented-out statements', () => { + expect(rules("// export type Mode = 'raw' | 'pretty'")).toEqual(['commented-out-code@1']) + expect(rules('// await flushQueue(queue);')).toEqual(['commented-out-code@1']) + }) + + it('ignores prose that happens to look like code', () => { + const source = [ + '// firstRow: text=bg1, bold, fill=accent', + '// Total = 22', + '// limit=3 → [3,3,1]', + '// Shows (Podcasts)', + '// Title (for issue creation)', + '// Example: [{ fields: { "Field 1": "Value1" } }]', + '// return early when nothing changed.', + '', + '// cos(wd2, 2160000)', + '', + '// settings.get(key).value', + '', + '// Total: { count: 1 }', + '// Shape: { id: 2 }', + 'const c = 1', + ].join('\n') + expect(rules(source)).toEqual([]) + }) + + it('ignores trailing comments, tool directives and allowed samples', () => { + const source = [ + 'run() // await retry(run);', + '// biome-ignore lint/suspicious/noExplicitAny: external payload', + 'const d: any = 1', + '// comment-hygiene-allow: documents the call shape the worker expects', + '// await worker.run({ id });', + ].join('\n') + expect(rules(source)).toEqual([]) + }) + + it('parses JSX in tsx files', () => { + expect(rules('// return ;', 'view.tsx')).toEqual(['commented-out-code@1']) + }) +}) diff --git a/scripts/check-comment-hygiene.ts b/scripts/check-comment-hygiene.ts new file mode 100644 index 00000000000..bfafa4de67e --- /dev/null +++ b/scripts/check-comment-hygiene.ts @@ -0,0 +1,258 @@ +#!/usr/bin/env bun +/** + * Fails on the two comment patterns that are never documentation: + * + * - `banner`: a separator comment — `// ====`, `// --- Section ---`, `// ─── Title ───`, + * `/* ------ v2 ------ *\/`. The repo convention is "no separators": structure lives in the + * code (modules, functions, TSDoc), and a banner only restates the next declaration's name. + * - `commented-out-code`: a run of `//` lines whose text parses as TypeScript. Git is the + * history; dead code left in a comment rots, misleads readers and agents into thinking it + * is a live option, and survives every refactor of the code around it. + * + * Both are detected conservatively so a hit is almost always real. Comments are read from the + * Babel token stream, so `//` inside strings and template literals is never inspected. A + * commented-out run only counts when it parses with no recovery errors, contains code + * punctuation, and is not a lone label (`firstRow: bold`), literal, or `a = b` gloss; prose + * lines inside a comment group split it into separate runs. Change-history phrasing + * ("previously", "no longer", "used to") was measured and left out: most hits describe live + * runtime state or a regression a test guards, so it cannot be enforced without false alarms. + * + * A legitimate exception (a code sample that must stay a line comment) takes + * `// comment-hygiene-allow: ` anywhere in the same comment group. + * + * The tree was swept clean when this landed (236 banners, 9 commented-out blocks), so there is + * no baseline: every hit fails. + * + * Run: `bun run check:comment-hygiene` + */ +import { execFileSync } from 'node:child_process' +import { readFileSync } from 'node:fs' +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import { parse } from '@babel/parser' + +const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') +const ALLOW = 'comment-hygiene-allow:' + +/** Vendored or generated sources whose comments are not ours to edit. */ +const EXCLUDED = [/\.d\.ts$/, /(^|\/)bundles\//, /(^|\/)node_modules\//] + +export type Rule = 'banner' | 'commented-out-code' + +export interface Violation { + rule: Rule + line: number + text: string +} + +/** Comment text that opens with a run of separator characters. */ +const BANNER = /^(?:={3,}|-{3,}|─{3,}|━{3,}|\*{3,}|~{3,})/ + +/** At least one token that ordinary prose does not contain. */ +const CODE_PUNCTUATION = /[;{}]|=>|\b(?:const|let|return|await|import|export)\s|\w\.\w+\(/ + +/** Single-line runs must start like a statement or end like a call to count as code. */ +const SINGLE_LINE_CODE = /^(?:export|import|const|let|var|return|await|if|for|function)\b|\);?$/ + +/** + * A line that reads as prose: a capitalized word followed by more words, without a trailing + * code delimiter. These split a comment group, so a prose heading above commented-out code + * does not stop the code from parsing. + */ +const PROSE_LINE = /^[A-Z][\w'-]*(?:\s+[\w'(),./&:—-]+)+\s*$/ +const CODE_TAIL = /[;{}]\s*$|[,([]$/ + +/** Expression kinds that a one-off gloss like `Total = 22` or a bare word would parse as. */ +const TRIVIAL_EXPRESSIONS = new Set([ + 'TemplateLiteral', + 'StringLiteral', + 'Identifier', + 'NumericLiteral', + 'BinaryExpression', + 'AssignmentExpression', +]) + +function parsesAsCode(text: string, jsx: boolean): boolean { + const plugins = jsx ? (['typescript', 'jsx'] as const) : (['typescript'] as const) + for (const candidate of [text, `[${text}]`, `({${text}})`]) { + let program + try { + program = parse(candidate, { + sourceType: 'module', + plugins: [...plugins], + allowReturnOutsideFunction: true, + allowAwaitOutsideFunction: true, + }).program + } catch { + continue + } + if (candidate !== text) return true + const trivial = program.body.every( + (node) => + node.type === 'LabeledStatement' || + node.type === 'EmptyStatement' || + (node.type === 'ExpressionStatement' && TRIVIAL_EXPRESSIONS.has(node.expression.type)) + ) + return !trivial + } + return false +} + +interface LineComment { + line: number + value: string + ownLine: boolean +} + +/** Splits a group of adjacent own-line `//` comments into runs of non-prose lines. */ +function codeRuns(group: LineComment[]): LineComment[][] { + const runs: LineComment[][] = [] + let current: LineComment[] | null = null + for (const comment of group) { + const text = comment.value.trim() + const prose = text.startsWith('//') || (PROSE_LINE.test(text) && !CODE_TAIL.test(text)) + if (!text || prose) { + current = null + continue + } + if (!current) { + current = [] + runs.push(current) + } + current.push(comment) + } + return runs +} + +/** Longest run a span search considers; the search is quadratic in run length. */ +const MAX_RUN_LINES = 80 + +function isCode(span: LineComment[], jsx: boolean): boolean { + const text = span + .map((comment) => comment.value.replace(/^ /, '')) + .join('\n') + .trim() + if (!CODE_PUNCTUATION.test(text)) return false + if (span.length === 1 && !SINGLE_LINE_CODE.test(text)) return false + return parsesAsCode(text, jsx) +} + +/** + * The first contiguous span of a run that parses as code. A run can hold two unrelated + * snippets back to back (an object, then a type), which only parse separately, so every start + * line is tried against every end line, longest first. + */ +function firstCodeSpan(run: LineComment[], jsx: boolean): LineComment | undefined { + const lines = run.slice(0, MAX_RUN_LINES) + for (let start = 0; start < lines.length; start++) { + for (let end = lines.length; end > start; end--) { + if (isCode(lines.slice(start, end), jsx)) return lines[start] + } + } + return undefined +} + +/** Every banner and commented-out-code hit in one source file. */ +export function findViolations(file: string, source: string): Violation[] { + const jsx = /\.[jt]sx$/.test(file) + let comments + try { + comments = + parse(source, { + sourceType: 'module', + plugins: ['typescript', ...(jsx ? (['jsx'] as const) : []), 'decorators'], + errorRecovery: true, + }).comments ?? [] + } catch { + return [] + } + + const lines = source.split('\n') + const violations: Violation[] = [] + const groups: LineComment[][] = [] + let previous: LineComment | undefined + + for (const comment of comments) { + const line = comment.loc?.start.line ?? 0 + if (comment.type === 'CommentBlock') { + const singleLine = comment.loc?.start.line === comment.loc?.end.line + const text = comment.value.replace(/^\*+/, '').trim() + if (singleLine && BANNER.test(text)) violations.push({ rule: 'banner', line, text }) + previous = undefined + continue + } + + const text = comment.value.trim() + if (BANNER.test(text)) { + violations.push({ rule: 'banner', line, text }) + previous = undefined + continue + } + + const ownLine = /^\s*$/.test(lines[line - 1]?.slice(0, comment.loc?.start.column ?? 0) ?? '') + const entry = { line, value: comment.value, ownLine } + if (ownLine && previous?.ownLine && previous.line === line - 1) { + groups[groups.length - 1].push(entry) + } else if (ownLine) { + groups.push([entry]) + } + previous = entry + } + + for (const group of groups) { + if (group.some((comment) => comment.value.includes(ALLOW))) continue + for (const run of codeRuns(group)) { + const hit = firstCodeSpan(run, jsx) + if (hit) + violations.push({ rule: 'commented-out-code', line: hit.line, text: hit.value.trim() }) + } + } + + return violations.sort((a, b) => a.line - b.line) +} + +function sourceFiles(): string[] { + return execFileSync('git', ['ls-files', '*.ts', '*.tsx', '*.mts', '*.cts', '*.mjs', '*.cjs'], { + cwd: ROOT, + encoding: 'utf8', + }) + .split('\n') + .filter((file) => file && !EXCLUDED.some((pattern) => pattern.test(file))) +} + +const FIX: Record = { + banner: + 'delete the separator; if the title says something the code does not, keep it as a plain ' + + '`// ...` line or move it into TSDoc on the declaration below', + 'commented-out-code': + 'delete the commented-out code — git keeps the history. If it is a deliberate code sample, ' + + 'put it in a TSDoc `@example` or add `// comment-hygiene-allow: ` to the group', +} + +function main(): void { + const hits: string[] = [] + for (const file of sourceFiles()) { + let source: string + try { + source = readFileSync(path.join(ROOT, file), 'utf8') + } catch { + continue + } + for (const { rule, line, text } of findViolations(file, source)) { + hits.push(`✗ ${rule}: ${file}:${line} // ${text}\n fix: ${FIX[rule]}`) + } + } + + if (hits.length === 0) { + console.log('✓ comment hygiene (no banners or commented-out code)') + return + } + console.error(hits.join('\n')) + console.error( + `\n${hits.length} comment-hygiene violation(s). Comments are TSDoc or a terse inline why — ` + + 'see "Comments" in CLAUDE.md.' + ) + process.exit(1) +} + +if (import.meta.main) main() From f55150f122fb399e90427008c255f36bde79198b Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 1 Oct 2026 17:19:00 -0700 Subject: [PATCH 3/4] chore(lint): remove banner separators and narrating comments Converts decorated section banners to plain comments or drops them, and sweeps the noisiest files for comments that restate the code or name what follows. Field-level notes that carry units, enums or invariants move to TSDoc. Comment-only: the non-comment token stream of every changed file is identical. --- apps/docs/components/icons.tsx | 2 +- apps/realtime/src/database/operations.ts | 58 +--- .../hooks/use-workflow-execution.ts | 50 ---- .../[workspaceId]/w/[workflowId]/workflow.tsx | 103 +------ apps/sim/blocks/blocks/ahrefs.ts | 47 --- apps/sim/blocks/blocks/amplitude.ts | 22 +- apps/sim/blocks/blocks/calcom.ts | 14 +- apps/sim/blocks/blocks/confluence.ts | 58 ---- apps/sim/blocks/blocks/dagster.ts | 40 --- apps/sim/blocks/blocks/datadog.ts | 42 --- apps/sim/blocks/blocks/dropbox.ts | 31 -- apps/sim/blocks/blocks/elasticsearch.ts | 38 --- apps/sim/blocks/blocks/enrow.ts | 6 +- apps/sim/blocks/blocks/github.ts | 81 +---- apps/sim/blocks/blocks/gitlab.ts | 97 ------ apps/sim/blocks/blocks/gong.ts | 20 -- apps/sim/blocks/blocks/google_drive.ts | 86 +----- apps/sim/blocks/blocks/google_sheets.ts | 49 --- apps/sim/blocks/blocks/google_slides.ts | 89 ------ apps/sim/blocks/blocks/incidentio.ts | 75 ----- apps/sim/blocks/blocks/intercom.ts | 45 --- apps/sim/blocks/blocks/jira.ts | 53 ---- apps/sim/blocks/blocks/kalshi.ts | 35 --- apps/sim/blocks/blocks/knowledge.ts | 12 +- apps/sim/blocks/blocks/leadmagic.ts | 33 --- apps/sim/blocks/blocks/linear.ts | 118 +------- apps/sim/blocks/blocks/logrocket.ts | 12 +- apps/sim/blocks/blocks/microsoft_planner.ts | 41 +-- apps/sim/blocks/blocks/outlook.ts | 60 +--- apps/sim/blocks/blocks/pagerduty.ts | 30 +- apps/sim/blocks/blocks/polymarket.ts | 38 --- apps/sim/blocks/blocks/posthog.ts | 50 ---- apps/sim/blocks/blocks/rippling.ts | 82 ------ apps/sim/blocks/blocks/rocketlane.ts | 44 --- apps/sim/blocks/blocks/shopify.ts | 64 +--- apps/sim/blocks/blocks/slack.ts | 91 +----- apps/sim/blocks/blocks/spotify.ts | 57 ---- apps/sim/blocks/blocks/stripe.ts | 55 ---- apps/sim/blocks/blocks/temporal.ts | 41 --- apps/sim/blocks/blocks/trigger_dev.ts | 34 --- apps/sim/blocks/blocks/tts.ts | 31 -- apps/sim/blocks/blocks/wordpress.ts | 53 ---- apps/sim/blocks/blocks/x.ts | 47 +-- apps/sim/components/icons.tsx | 2 +- apps/sim/hooks/use-undo-redo.ts | 44 +-- apps/sim/lib/api/contracts/tables.ts | 2 +- apps/sim/lib/core/telemetry.ts | 37 +-- apps/sim/lib/oauth/utils.ts | 3 - apps/sim/lib/pptx-renderer/model/layout.ts | 10 +- apps/sim/lib/pptx-renderer/model/master.ts | 12 +- .../pptx-renderer/model/nodes/base-node.ts | 6 +- .../pptx-renderer/model/nodes/group-node.ts | 4 +- .../lib/pptx-renderer/model/nodes/pic-node.ts | 8 +- .../pptx-renderer/model/nodes/shape-node.ts | 14 +- .../pptx-renderer/model/nodes/table-node.ts | 6 +- .../lib/pptx-renderer/model/presentation.ts | 22 +- apps/sim/lib/pptx-renderer/model/slide.ts | 8 +- apps/sim/lib/pptx-renderer/model/theme.ts | 6 +- .../lib/pptx-renderer/parser/zip-parser.ts | 32 +- .../pptx-renderer/renderer/chart-renderer.ts | 52 ---- .../pptx-renderer/renderer/image-renderer.ts | 27 -- .../renderer/predefined-table-styles.ts | 49 +-- .../pptx-renderer/renderer/shape-renderer.ts | 41 +-- .../pptx-renderer/renderer/slide-renderer.ts | 6 +- .../pptx-renderer/renderer/style-resolver.ts | 26 -- .../pptx-renderer/renderer/text-renderer.ts | 28 +- apps/sim/lib/pptx-renderer/shapes/presets.ts | 76 ++--- .../sim/lib/table/query-builder/converters.ts | 2 +- apps/sim/lib/uploads/utils/file-utils.ts | 23 +- apps/sim/lib/workflows/editing/operations.ts | 55 +--- apps/sim/tools/ahrefs/types.ts | 71 ++--- apps/sim/tools/clerk/types.ts | 36 +-- apps/sim/tools/datadog/types.ts | 93 +++--- apps/sim/tools/github/types.ts | 42 --- apps/sim/tools/index.ts | 49 +-- apps/sim/tools/kalshi/types.ts | 59 ++-- apps/sim/tools/okta/types.ts | 45 --- apps/sim/tools/profound/types.ts | 14 +- apps/sim/tools/thrive/types.ts | 16 +- apps/sim/tools/wordpress/types.ts | 77 +---- apps/sim/tools/x/types.ts | 2 +- packages/audit/src/types.ts | 31 -- packages/db/schema.ts | 278 ++++++++---------- packages/sim-cli/src/contract/commands.ts | 22 +- packages/testing/src/mocks/index.ts | 19 +- scripts/generate-docs.ts | 2 - 86 files changed, 439 insertions(+), 3152 deletions(-) diff --git a/apps/docs/components/icons.tsx b/apps/docs/components/icons.tsx index ef5cc9b3895..ff3d66b7c84 100644 --- a/apps/docs/components/icons.tsx +++ b/apps/docs/components/icons.tsx @@ -9613,7 +9613,7 @@ export function EnrowIcon(props: SVGProps) { ) } -// ---- Competitor brand logos (sourced via Context.dev brand-intelligence API, 2026-07-02) ---- +// Competitor brand logos (sourced via Context.dev brand-intelligence API, 2026-07-02) export function N8nIcon(props: SVGProps) { return ( diff --git a/apps/realtime/src/database/operations.ts b/apps/realtime/src/database/operations.ts index cd4316448bf..7d6f444eb85 100644 --- a/apps/realtime/src/database/operations.ts +++ b/apps/realtime/src/database/operations.ts @@ -291,7 +291,6 @@ function isSubflowBlockType(blockType: string): blockType is SubflowType { export async function updateSubflowNodeList(dbOrTx: any, workflowId: string, parentId: string) { try { - // Get all child blocks of this parent const childBlocks = await dbOrTx .select({ id: workflowBlocks.id }) .from(workflowBlocks) @@ -304,7 +303,6 @@ export async function updateSubflowNodeList(dbOrTx: any, workflowId: string, par const childNodeIds = childBlocks.map((block: any) => block.id) - // Get current subflow config const subflowData = await dbOrTx .select({ config: workflowSubflows.config }) .from(workflowSubflows) @@ -437,7 +435,6 @@ export async function persistWorkflowOperation(workflowId: string, operation: an } }) - // Audit workflow-level lock/unlock operations if ( target === OPERATION_TARGETS.BLOCKS && op === BLOCKS_OPERATIONS.BATCH_TOGGLE_LOCKED && @@ -541,7 +538,6 @@ async function handleBlockOperationTx( throw new Error('Missing required fields for update name operation') } - // Check if block is protected (locked or inside locked parent) const blockToRename = await tx .select({ id: workflowBlocks.id, @@ -612,7 +608,6 @@ async function handleBlockOperationTx( throw new Error('Missing block ID for toggle enabled operation') } - // Get current enabled state const currentBlock = await tx .select({ enabled: workflowBlocks.enabled }) .from(workflowBlocks) @@ -654,7 +649,6 @@ async function handleBlockOperationTx( const isRemovingFromParent = !payload.parentId - // Get current data to update const [currentBlock] = await tx .select({ data: workflowBlocks.data }) .from(workflowBlocks) @@ -663,7 +657,6 @@ async function handleBlockOperationTx( const currentData = currentBlock?.data || {} - // Update data with parentId and extent const { parentId: _removedParentId, extent: _removedExtent, ...restData } = currentData const updatedData = isRemovingFromParent ? restData @@ -686,11 +679,9 @@ async function handleBlockOperationTx( throw new Error(`Block ${payload.id} not found in workflow ${workflowId}`) } - // If the block now has a parent, update the new parent's subflow node list if (payload.parentId) { await updateSubflowNodeList(tx, workflowId, payload.parentId) } - // If the block had a previous parent, update that parent's node list as well if (existing?.parentId && existing.parentId !== payload.parentId) { await updateSubflowNodeList(tx, workflowId, existing.parentId) } @@ -918,7 +909,6 @@ async function handleBlocksOperationTx( }) if (blocks && blocks.length > 0) { - // Fetch existing blocks to check for locked parents const existingBlocks = await tx .select({ id: workflowBlocks.id, locked: workflowBlocks.locked }) .from(workflowBlocks) @@ -931,7 +921,6 @@ async function handleBlocksOperationTx( .map((b: ExistingBlockRecord) => b.id) ) - // Filter out blocks being added to locked parents const allowedBlocks = (blocks as Array>).filter((block) => { const parentId = (block.data as Record | null)?.parentId as | string @@ -1050,7 +1039,6 @@ async function handleBlocksOperationTx( } } - // Update parent subflow node lists const parentIds = new Set() for (const block of allowedBlocks) { const parentId = (block.data as Record)?.parentId as string | undefined @@ -1166,7 +1154,6 @@ async function handleBlocksOperationTx( logger.info(`Batch removing ${ids.length} blocks from workflow ${workflowId}`) - // Fetch all blocks to check lock status and filter out protected blocks const allBlocks = await tx .select({ id: workflowBlocks.id, @@ -1182,7 +1169,6 @@ async function handleBlocksOperationTx( allBlocks.map((b: BlockRecord) => [b.id, b]) ) - // Filter out protected blocks from deletion request const deletableIds = ids.filter((id) => !isWorkflowBlockProtected(id, blocksById)) if (deletableIds.length === 0) { logger.info('All requested blocks are protected, skipping deletion') @@ -1195,7 +1181,6 @@ async function handleBlocksOperationTx( ) } - // Collect all block IDs including all descendants of subflows const allBlocksToDelete = new Set(deletableIds) for (const id of deletableIds) { @@ -1226,7 +1211,6 @@ async function handleBlocksOperationTx( // lifecycle is managed by deploy.ts, lifecycle.ts, and the /api/webhooks/[id] route. // Removing a trigger block from the draft canvas does not touch any webhook rows. - // Delete edges connected to any of the blocks await tx .delete(workflowEdges) .where( @@ -1239,7 +1223,6 @@ async function handleBlocksOperationTx( ) ) - // Delete subflow entries await tx .delete(workflowSubflows) .where( @@ -1249,14 +1232,12 @@ async function handleBlocksOperationTx( ) ) - // Delete all blocks await tx .delete(workflowBlocks) .where( and(eq(workflowBlocks.workflowId, workflowId), inArray(workflowBlocks.id, blockIdsArray)) ) - // Update parent subflow node lists using pre-collected parent IDs for (const parentId of parentIds) { await updateSubflowNodeList(tx, workflowId, parentId) } @@ -1277,7 +1258,6 @@ async function handleBlocksOperationTx( `Batch toggling enabled state for ${blockIds.length} blocks in workflow ${workflowId}` ) - // Get all blocks in workflow to find children and check locked state const allBlocks = await tx .select({ id: workflowBlocks.id, @@ -1295,14 +1275,12 @@ async function handleBlocksOperationTx( ) const blocksToToggle = new Set() - // Collect all blocks to toggle including descendants of containers for (const id of blockIds) { const block = blocksById[id] if (!block || isWorkflowBlockProtected(id, blocksById)) continue blocksToToggle.add(id) - // If it's a loop or parallel, also include all non-locked descendants if (block.type === 'loop' || block.type === 'parallel') { for (const descId of findDbDescendants(id, allBlocks)) { if (!isWorkflowBlockProtected(descId, blocksById)) { @@ -1319,7 +1297,6 @@ async function handleBlocksOperationTx( if (!firstBlock) break const targetEnabled = !firstBlock.enabled - // Update all affected blocks for (const blockId of blocksToToggle) { await tx .update(workflowBlocks) @@ -1342,7 +1319,6 @@ async function handleBlocksOperationTx( logger.info(`Batch toggling handles for ${blockIds.length} blocks in workflow ${workflowId}`) - // Fetch all blocks to check lock status and filter out protected blocks const allBlocks = await tx .select({ id: workflowBlocks.id, @@ -1358,7 +1334,6 @@ async function handleBlocksOperationTx( allBlocks.map((b: HandleBlockRecord) => [b.id, b]) ) - // Filter to only toggle handles on unprotected blocks const blocksToToggle = blockIds.filter( (id) => blocksById[id] && !isWorkflowBlockProtected(id, blocksById) ) @@ -1390,7 +1365,6 @@ async function handleBlocksOperationTx( logger.info(`Batch toggling locked for ${blockIds.length} blocks in workflow ${workflowId}`) - // Get all blocks in workflow to find children const allBlocks = await tx .select({ id: workflowBlocks.id, @@ -1407,14 +1381,12 @@ async function handleBlocksOperationTx( ) const blocksToToggle = new Set() - // Collect all blocks to toggle including descendants of containers for (const id of blockIds) { const block = blocksById[id] if (!block) continue blocksToToggle.add(id) - // If it's a loop or parallel, also include all descendants if (block.type === 'loop' || block.type === 'parallel') { for (const descId of findDbDescendants(id, allBlocks)) { blocksToToggle.add(descId) @@ -1429,7 +1401,6 @@ async function handleBlocksOperationTx( if (!firstBlock) break const targetLocked = !firstBlock.locked - // Update all affected blocks for (const blockId of blocksToToggle) { await tx .update(workflowBlocks) @@ -1452,7 +1423,6 @@ async function handleBlocksOperationTx( logger.info(`Batch updating parent for ${updates.length} blocks in workflow ${workflowId}`) - // Fetch all blocks to check lock status const allBlocks = await tx .select({ id: workflowBlocks.id, @@ -1471,7 +1441,6 @@ async function handleBlocksOperationTx( const { id, parentId, position } = update if (!id) continue - // Skip protected blocks (locked or inside locked container) if (isWorkflowBlockProtected(id, blocksById)) { logger.info(`Skipping block ${id} parent update - block is protected`) continue @@ -1496,7 +1465,6 @@ async function handleBlocksOperationTx( const isRemovingFromParent = !parentId - // Get current data and position const [currentBlock] = await tx .select({ data: workflowBlocks.data, @@ -1527,11 +1495,9 @@ async function handleBlocksOperationTx( }) .where(and(eq(workflowBlocks.id, id), eq(workflowBlocks.workflowId, workflowId))) - // If the block now has a parent, update the new parent's subflow node list if (parentId) { await updateSubflowNodeList(tx, workflowId, parentId) } - // If the block had a previous parent, update that parent's node list as well if (existingParentId && existingParentId !== parentId) { await updateSubflowNodeList(tx, workflowId, existingParentId) } @@ -1596,7 +1562,6 @@ async function handleEdgeOperationTx(tx: any, workflowId: string, operation: str throw new Error('Missing edge ID for remove operation') } - // Get the edge to check if target block is protected const [edgeToRemove] = await tx .select({ sourceBlockId: workflowEdges.sourceBlockId, @@ -1610,7 +1575,6 @@ async function handleEdgeOperationTx(tx: any, workflowId: string, operation: str throw new Error(`Edge ${payload.id} not found in workflow ${workflowId}`) } - // Check if target block is protected const connectedBlocks = await tx .select({ id: workflowBlocks.id, @@ -1630,7 +1594,6 @@ async function handleEdgeOperationTx(tx: any, workflowId: string, operation: str connectedBlocks.map((b: RemoveEdgeBlockRecord) => [b.id, b]) ) - // Collect parent IDs that need to be fetched const parentIds = new Set() for (const block of connectedBlocks) { const parentId = (block.data as Record | null)?.parentId as @@ -1641,7 +1604,6 @@ async function handleEdgeOperationTx(tx: any, workflowId: string, operation: str } } - // Fetch parent blocks if needed if (parentIds.size > 0) { const parentBlocks = await tx .select({ @@ -1696,7 +1658,6 @@ async function handleEdgesOperationTx( logger.info(`Batch removing ${ids.length} edges from workflow ${workflowId}`) - // Get edges to check connected blocks const edgesToRemove = await tx .select({ id: workflowEdges.id, @@ -1713,14 +1674,12 @@ async function handleEdgesOperationTx( type EdgeToRemove = (typeof edgesToRemove)[number] - // Get all connected block IDs const connectedBlockIds = new Set() edgesToRemove.forEach((e: EdgeToRemove) => { connectedBlockIds.add(e.sourceBlockId) connectedBlockIds.add(e.targetBlockId) }) - // Fetch blocks to check lock status const connectedBlocks = await tx .select({ id: workflowBlocks.id, @@ -1740,7 +1699,6 @@ async function handleEdgesOperationTx( connectedBlocks.map((b: EdgeBlockRecord) => [b.id, b]) ) - // Collect parent IDs that need to be fetched const parentIds = new Set() for (const block of connectedBlocks) { const parentId = (block.data as Record | null)?.parentId as @@ -1751,7 +1709,6 @@ async function handleEdgesOperationTx( } } - // Fetch parent blocks if needed if (parentIds.size > 0) { const parentBlocks = await tx .select({ @@ -1983,7 +1940,6 @@ async function handleSubflowOperationTx( break } - // Add other subflow operations as needed default: logger.warn(`Unknown subflow operation: ${operation}`) throw new Error(`Unsupported subflow operation: ${operation}`) @@ -2022,7 +1978,7 @@ function getWritableSubblockUpdateBlock( return block } -// Subblock operations - targeted value updates without replacing workflow state +/** Applies targeted subblock value updates without replacing the workflow state. */ async function handleSubblockOperationTx( tx: any, workflowId: string, @@ -2109,14 +2065,13 @@ async function handleSubblockOperationTx( } } -// Variable operations - updates workflow.variables JSON field +/** Applies variable operations to the `workflow.variables` JSON field. */ async function handleVariableOperationTx( tx: any, workflowId: string, operation: string, payload: any ) { - // Get current workflow variables const workflowData = await tx .select({ variables: workflow.variables }) .from(workflow) @@ -2135,7 +2090,6 @@ async function handleVariableOperationTx( throw new Error('Missing required fields for add variable operation') } - // Add the new variable const updatedVariables = { ...currentVariables, [payload.id]: { @@ -2164,7 +2118,6 @@ async function handleVariableOperationTx( throw new Error('Missing variable ID for remove operation') } - // Remove the variable const { [payload.variableId]: _, ...updatedVariables } = currentVariables await tx @@ -2185,7 +2138,7 @@ async function handleVariableOperationTx( } } -// Workflow operations - handles complete state replacement +/** Replaces the complete workflow state. */ async function handleWorkflowOperationTx( tx: any, workflowId: string, @@ -2209,10 +2162,8 @@ async function handleWorkflowOperationTx( await tx.delete(workflowBlocks).where(eq(workflowBlocks.workflowId, workflowId)) - // Delete all existing subflows await tx.delete(workflowSubflows).where(eq(workflowSubflows.workflowId, workflowId)) - // Insert all blocks from the new state if (blocks && Object.keys(blocks).length > 0) { const blockValues = Object.values(blocks).map((block: any) => ({ id: block.id, @@ -2237,7 +2188,6 @@ async function handleWorkflowOperationTx( await tx.insert(workflowBlocks).values(blockValues) } - // Insert all edges from the new state if (edges && edges.length > 0) { const canonicalEdges = (edges as Array>).map((edge) => canonicalizeEdgeAddCandidate({ @@ -2269,7 +2219,6 @@ async function handleWorkflowOperationTx( } } - // Insert all loops from the new state if (loops && Object.keys(loops).length > 0) { const loopValues = Object.entries(loops).map(([id, loop]: [string, any]) => ({ id, @@ -2281,7 +2230,6 @@ async function handleWorkflowOperationTx( await tx.insert(workflowSubflows).values(loopValues) } - // Insert all parallels from the new state if (parallels && Object.keys(parallels).length > 0) { const parallelValues = Object.entries(parallels).map(([id, parallel]: [string, any]) => ({ id, diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts index da463a54254..295234abd86 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-workflow-execution.ts @@ -621,10 +621,8 @@ export function useWorkflowExecution() { logger.info('Debug session complete') setExecutionResult(result) - // Persist logs await persistLogs(workflowId, generateId(), result) - // Reset debug state resetOwnedDebugState(workflowId, persistenceExecution) }, [resetOwnedDebugState] @@ -644,7 +642,6 @@ export function useWorkflowExecution() { nextPendingBlocks: result.metadata?.pendingBlocks?.length || 0, }) - // Update debug context and pending blocks if (result.metadata?.context) { setDebugContext(workflowId, result.metadata.context) } @@ -678,10 +675,8 @@ export function useWorkflowExecution() { setExecutionResult(errorResult) - // Persist logs await persistLogs(workflowId, generateId(), errorResult) - // Reset debug state resetOwnedDebugState(workflowId, persistenceExecution) }, [debugContext, resetOwnedDebugState] @@ -694,28 +689,21 @@ export function useWorkflowExecution() { streamContent?: string ) => { try { - // Build trace spans from execution logs const { traceSpans, totalDuration } = buildTraceSpans(result) - // Add trace spans to the execution result const enrichedResult = { ...result, traceSpans, totalDuration, } - // If this was a streaming response and we have the final content, update it if (streamContent && result.output && typeof streamContent === 'string') { - // Update the content with the final streaming content enrichedResult.output.content = streamContent - // Also update any block logs to include the content where appropriate if (enrichedResult.logs) { - // Get the streaming block ID from metadata if available const streamingBlockId = (result.metadata as any)?.streamingBlockId || null for (const log of enrichedResult.logs) { - // Only update the specific LLM block (agent/router) that was streamed const isStreamingBlock = streamingBlockId && log.blockId === streamingBlockId if ( isStreamingBlock && @@ -760,18 +748,14 @@ export function useWorkflowExecution() { const persistenceExecution = tryStartExecution(activeWorkflowId) if (!persistenceExecution) return - // Reset execution result and set execution state setExecutionResult(null) - // Set debug mode only if explicitly requested if (enableDebug) { setIsDebugging(activeWorkflowId, true) } - // Determine if this is a chat execution const isChatExecution = isChatWorkflowInput(workflowInput) - // For chat executions, we'll use a streaming approach if (isChatExecution) { let isCancelled = false const executionId = generateId() @@ -884,7 +868,6 @@ export function useWorkflowExecution() { return } - // Get selected outputs from chat store const chatStore = await import('@/stores/chat/store').then((mod) => mod.useChatStore) const selectedOutputs = chatStore .getState() @@ -895,14 +878,12 @@ export function useWorkflowExecution() { const { extractBlockIdFromOutputId, extractPathFromOutputId, traverseObjectPath } = await import('@/lib/core/utils/response-format') - // Check if this block's output is selected const matchingOutputs = selectedOutputs.filter( (outputId) => extractBlockIdFromOutputId(outputId) === blockId ) if (!matchingOutputs.length) return - // Process each selected output from this block for (const outputId of matchingOutputs) { const path = extractPathFromOutputId(outputId, blockId) const outputValue = traverseObjectPath(output, path) @@ -913,13 +894,10 @@ export function useWorkflowExecution() { ? outputValue : JSON.stringify(outputValue, null, 2) - // Add separator if this isn't the first output const separator = streamedChunks.size > 0 ? '\n\n' : '' - // Send the non-streaming block output as a chunk safeEnqueue(encodeSSE({ blockId, chunk: separator + formattedOutput })) - // Track that we've sent output for this block streamedChunks.set(blockId, [formattedOutput]) } } @@ -937,7 +915,6 @@ export function useWorkflowExecution() { persistenceExecution ) - // Check if execution was cancelled if (result && 'status' in result && result.status === 'cancelled') { safeEnqueue(encodeSSE({ event: 'cancelled', data: result })) return @@ -958,14 +935,12 @@ export function useWorkflowExecution() { const completionTime = streamCompletionTimes.get(log.blockId)! const startTime = new Date(log.startedAt).getTime() - // Update the log with actual stream completion time log.endedAt = new Date(completionTime).toISOString() log.durationMs = completionTime - startTime } }) } - // Resolve chunks to final strings for consumption const streamedContent = new Map() for (const [id, chunks] of streamedChunks) { streamedContent.set(id, chunks.join('')) @@ -976,7 +951,6 @@ export function useWorkflowExecution() { logger.info(`Processed ${processedCount} blocks for streaming tokenization`) } - // Invalidate subscription queries to update usage scheduleUsageRefresh(queryClient) safeEnqueue(encodeSSE({ event: 'final', data: result })) @@ -992,7 +966,6 @@ export function useWorkflowExecution() { }) return } - // Create a proper error result for logging const errorResult = { success: false, error: error.message || 'Workflow execution failed', @@ -1128,7 +1101,6 @@ export function useWorkflowExecution() { edgesCount: workflowEdges.length, }) - // Debug: Check for blocks with undefined types before merging Object.entries(workflowBlocks).forEach(([blockId, block]) => { if (!block || !block.type) { logger.error('Found block with undefined type before merging:', { blockId, block }) @@ -1138,7 +1110,6 @@ export function useWorkflowExecution() { // Merge subblock states from the appropriate store (scoped to active workflow) const mergedStates = mergeSubblockState(validBlocks, activeWorkflowId ?? undefined) - // Debug: Check for blocks with undefined types after merging Object.entries(mergedStates).forEach(([blockId, block]) => { if (!block || !block.type) { logger.error('Found block with undefined type after merging:', { blockId, block }) @@ -1168,20 +1139,16 @@ export function useWorkflowExecution() { {} as typeof filteredStates ) - // If this is a chat execution, get the selected outputs let selectedOutputs: string[] | undefined if (isExecutingFromChat && activeWorkflowId) { - // Get selected outputs from chat store const chatStore = await import('@/stores/chat/store').then((mod) => mod.useChatStore) selectedOutputs = chatStore.getState().getSelectedWorkflowOutput(activeWorkflowId) } - // Determine start block and workflow input based on execution type let startBlockId: string | undefined let finalWorkflowInput = workflowInput if (isExecutingFromChat) { - // For chat execution, find the appropriate chat trigger const startBlock = TriggerUtils.findStartBlock(enabledStates, 'chat') if (!startBlock) { @@ -1195,7 +1162,6 @@ export function useWorkflowExecution() { startBlockId = startBlock.blockId } else { - // Manual execution: detect and group triggers by paths const candidates = resolveStartCandidates(enabledStates, { execution: 'manual', }) @@ -1230,16 +1196,13 @@ export function useWorkflowExecution() { throw error } - // Select the best trigger // Priority: Start Block > Schedules > External Triggers > Legacy const selectedTriggers = selectBestTrigger(candidates, workflowEdges) - // Execute the first/highest priority trigger const selectedCandidate = selectedTriggers[0] startBlockId = selectedCandidate.blockId const selectedTrigger = selectedCandidate.block - // Validate outgoing connections for non-legacy triggers if (selectedCandidate.path !== StartBlockPath.LEGACY_STARTER) { const outgoingConnections = workflowEdges.filter((edge) => edge.source === startBlockId) if (outgoingConnections.length === 0) { @@ -1256,7 +1219,6 @@ export function useWorkflowExecution() { } } - // Prepare input based on trigger type if (triggerNeedsMockPayload(selectedCandidate)) { const mockPayload = extractTriggerMockPayload(selectedCandidate) finalWorkflowInput = mockPayload @@ -1272,7 +1234,6 @@ export function useWorkflowExecution() { } } - // If we don't have a valid startBlockId at this point, throw an error if (!startBlockId) { const error = new WorkflowValidationError( 'No valid trigger block found to start execution', @@ -1285,14 +1246,12 @@ export function useWorkflowExecution() { throw error } - // Log the final startBlockId logger.info('Final execution setup:', { startBlockId, isExecutingFromChat, hasWorkflowInput: !!workflowInput, }) - // SERVER-SIDE EXECUTION (always) if (activeWorkflowId) { logger.info('Using server-side executor') @@ -1313,7 +1272,6 @@ export function useWorkflowExecution() { const accumulatedBlockStates = new Map() const executedBlockIds = new Set() - // Execute the workflow try { const blockHandlers = buildBlockEventHandlers({ workflowId: activeWorkflowId, @@ -1789,7 +1747,6 @@ export function useWorkflowExecution() { pendingBlockCount: pendingBlocks.length, }) - // Validate debug state const validation = validateDebugState() if (!validation.isValid) { resetDebugState() @@ -1834,7 +1791,6 @@ export function useWorkflowExecution() { pendingBlockCount: pendingBlocks.length, }) - // Validate debug state const validation = validateDebugState() if (!validation.isValid) { resetDebugState() @@ -1858,7 +1814,6 @@ export function useWorkflowExecution() { logger.info('Starting resume execution with blocks:', currentPendingBlocks) - // Continue execution until there are no more pending blocks let iterationCount = 0 const maxIterations = 500 // Safety to prevent infinite loops @@ -1876,7 +1831,6 @@ export function useWorkflowExecution() { pendingBlockCount: currentResult.metadata?.pendingBlocks?.length || 0, }) - // Update context for next iteration if (currentResult.metadata?.context) { currentContext = currentResult.metadata.context } else { @@ -1884,7 +1838,6 @@ export function useWorkflowExecution() { break } - // Update pending blocks for next iteration if (currentResult.metadata?.pendingBlocks) { currentPendingBlocks = currentResult.metadata.pendingBlocks } else { @@ -1892,7 +1845,6 @@ export function useWorkflowExecution() { break } - // If we don't have a debug session anymore, we're done if (!currentResult.metadata?.isDebugSession) { logger.info('Debug session ended, ending resume') break @@ -1910,7 +1862,6 @@ export function useWorkflowExecution() { success: currentResult.success, }) - // Handle completion await handleDebugSessionComplete(currentResult, activeWorkflowId, persistenceExecution) } catch (error: any) { await handleDebugExecutionError(error, 'resume', activeWorkflowId, persistenceExecution) @@ -2053,7 +2004,6 @@ export function useWorkflowExecution() { parallels: latestWorkflowState.parallels, }) - // Extract mock payload for trigger blocks let workflowInput: any if (isTriggerBlock) { const enabledStates = Object.entries(filteredStates).reduce( diff --git a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx index ac508e892e2..96593cb5d44 100644 --- a/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx +++ b/apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx @@ -803,10 +803,8 @@ const WorkflowContent = React.memo( */ const executeBatchParentUpdate = useCallback( (nodesToProcess: Node[], targetParentId: string | null, logMessage: string) => { - // Build set of node IDs for efficient lookup const nodeIds = new Set(nodesToProcess.map((n) => n.id)) - // Filter to nodes whose parent is actually changing const nodesNeedingUpdate = nodesToProcess.filter((n) => { const block = blocks[n.id] if (!block) return false @@ -818,7 +816,6 @@ const WorkflowContent = React.memo( if (nodesNeedingUpdate.length === 0) return - // Filter out nodes that cannot enter containers (when target is a container) let validNodes = targetParentId ? nodesNeedingUpdate.filter(canNodeEnterContainer) : nodesNeedingUpdate @@ -839,7 +836,6 @@ const WorkflowContent = React.memo( }) const boundaryEdgesByNode = mapEdgesByNode(boundaryEdges, movingNodeIds) - // Build position updates const rawUpdates = validNodes.map((n) => { const edgesForThisNode = boundaryEdgesByNode.get(n.id) ?? [] const newPosition = targetParentId @@ -853,12 +849,10 @@ const WorkflowContent = React.memo( } }) - // Shift to container bounds if moving into a container const updates = targetParentId ? shiftUpdatesToContainerBounds(rawUpdates) : rawUpdates collaborativeBatchUpdateParent(updates) - // Update display nodes setDisplayNodes((nodes) => nodes.map((node) => { const update = updates.find((u) => u.blockId === node.id) @@ -873,7 +867,6 @@ const WorkflowContent = React.memo( }) ) - // Resize container if moving into one if (targetParentId) { resizeLoopNodesWrapper() } @@ -1210,7 +1203,6 @@ const WorkflowContent = React.memo( let pastedBlocksArray = Object.values(pasteData.blocks) - // If pasting into a subflow, adjust blocks to be children of that subflow if (targetContainer) { // Check if any pasted block is a trigger - triggers cannot be in subflows const hasTrigger = pastedBlocksArray.some((b) => TriggerUtils.isTriggerBlock(b)) @@ -1236,7 +1228,6 @@ const WorkflowContent = React.memo( return } - // Adjust each block's position to be relative to the container and set parentId pastedBlocksArray = pastedBlocksArray.map((block) => { // For blocks already nested (have parentId), positions are already relative - use as-is // For top-level blocks, convert absolute position to relative by subtracting container position @@ -1281,7 +1272,6 @@ const WorkflowContent = React.memo( } }) - // Update pasteData.blocks with the modified blocks pasteData.blocks = pastedBlocksArray.reduce( (acc, block) => { acc[block.id] = block @@ -1308,7 +1298,6 @@ const WorkflowContent = React.memo( pasteData.subBlockValues ) - // Resize container if we pasted into a subflow if (targetContainer) { resizeLoopNodesWrapper() } @@ -1326,7 +1315,6 @@ const WorkflowContent = React.memo( const handleContextPaste = useCallback(() => { if (!hasClipboard()) return - // Convert context menu position to flow coordinates and check if inside a subflow const flowPosition = screenToFlowPosition(contextMenuPosition) const targetContainer = isPointInLoopNode(flowPosition) @@ -1461,7 +1449,6 @@ const WorkflowContent = React.memo( clearLockNotification, ]) - // Clean up notification on unmount useEffect(() => clearLockNotification, [clearLockNotification]) /** @@ -2228,7 +2215,6 @@ const WorkflowContent = React.memo( return } - // Validate block config for regular blocks const blockConfig = getBlock(data.type) if (!blockConfig) { logger.error('Invalid block type:', { data }) @@ -2254,7 +2240,6 @@ const WorkflowContent = React.memo( return } - // Calculate raw position relative to container origin const rawPosition = { x: placement.x - containerInfo.loopPosition.x, y: placement.y - containerInfo.loopPosition.y, @@ -2297,11 +2282,8 @@ const WorkflowContent = React.memo( operationConfig ) - // Resize the container node to fit the new block - // Immediate resize without delay resizeLoopNodesWrapper() } else { - // Centralized trigger constraints if (checkTriggerConstraints(data.type)) return const autoConnectEdge = resolveEdge(id, null, () => @@ -2344,7 +2326,6 @@ const WorkflowContent = React.memo( /** Handles toolbar block click events to add blocks to the canvas. */ useEffect(() => { const handleAddBlockFromToolbar = (event: CustomEvent) => { - // Check if user has permission to interact with blocks if (!effectivePermissions.canEdit) { return } @@ -2634,7 +2615,6 @@ const WorkflowContent = React.memo( (event: React.DragEvent) => { event.preventDefault() - // Only handle toolbar items if (!event.dataTransfer?.types.includes('application/json')) return try { @@ -2644,11 +2624,8 @@ const WorkflowContent = React.memo( y: event.clientY - reactFlowBounds.top, }) - // Check if hovering over a container node const containerInfo = isPointInLoopNode(position) - // Highlight container if hovering over it - if (containerInfo) { const containerNode = getNodes().find((n) => n.id === containerInfo.loopId) if (containerNode?.type === 'subflowNode') { @@ -2678,7 +2655,6 @@ const WorkflowContent = React.memo( useEffect(() => { const currentId = workflowIdParam - // Wait for workflow data to be available before attempting to load if ( isWorkflowMapLoading || isWorkflowMapPlaceholderData || @@ -2699,7 +2675,6 @@ const WorkflowContent = React.memo( return } - // If already loading (state-loading phase), skip if (hydration.phase === 'state-loading' && hydration.workflowId === currentId) { return } @@ -2722,7 +2697,6 @@ const WorkflowContent = React.memo( const { clearDiff } = useWorkflowDiffStore.getState() clearDiff() - // Reset canvas ready state when loading a new workflow setIsCanvasReady(false) setActiveWorkflow(currentId) @@ -2730,7 +2704,6 @@ const WorkflowContent = React.memo( logger.error(`Failed to set active workflow ${currentId}:`, error) }) .finally(() => { - // Clear the loading ref when done (success or error) if (loadingWorkflowRef.current === currentId) { loadingWorkflowRef.current = null } @@ -2770,20 +2743,17 @@ const WorkflowContent = React.memo( return } - // If no workflows exist after loading, redirect to workspace root if (workflowCount === 0) { logger.info('No workflows found, redirecting to workspace root') router.replace(`/workspace/${workspaceId}/w`) return } - // Navigate to existing workflow or first available if (!currentWorkflowExists) { logger.info( `Workflow ${workflowIdParam} not found, redirecting to first available workflow` ) - // Validate that workflows belong to the current workspace before redirecting const workspaceWorkflows = Object.entries(workflows) .filter(([, workflow]) => workflow.workspaceId === workspaceId) .map(([id]) => id) @@ -2791,19 +2761,16 @@ const WorkflowContent = React.memo( if (workspaceWorkflows.length > 0) { router.replace(`/workspace/${workspaceId}/w/${workspaceWorkflows[0]}`) } else { - // No valid workflows for this workspace, redirect to workspace root router.replace(`/workspace/${workspaceId}/w`) } return } - // Validate that the current workflow belongs to the current workspace const workflowData = workflows[workflowIdParam] if (workflowData && workflowData.workspaceId !== workspaceId) { logger.warn( `Workflow ${workflowIdParam} belongs to workspace ${workflowData.workspaceId}, not ${workspaceId}` ) - // Redirect to the correct workspace for this workflow router.replace(`/workspace/${workflowData.workspaceId}/w/${workflowIdParam}`) } }, [ @@ -2843,7 +2810,6 @@ const WorkflowContent = React.memo( /** Stable hash of block STRUCTURAL properties - excludes position to prevent node recreation during drag. */ const blocksStructureHash = useMemo(() => { - // Only recalculate hash if blocks reference actually changed if (prevBlocksRef.current === blocks) { return prevBlocksHashRef.current } @@ -2854,7 +2820,6 @@ const WorkflowContent = React.memo( .map((b) => { const width = typeof b.data?.width === 'number' ? b.data.width : '' const height = typeof b.data?.height === 'number' ? b.data.height : '' - // Exclude position from hash - drag should not recreate nodes return `${b.id}:${b.type}:${b.name}:${b.height}:${b.data?.parentId || ''}:${width}:${height}` }) .join('|') @@ -2867,13 +2832,11 @@ const WorkflowContent = React.memo( const derivedNodes = useMemo(() => { const nodeArray: Node[] = [] - // Add block nodes Object.entries(blocks).forEach(([, block]) => { if (!block || !block.type || !block.name) { return } - // Handle container nodes differently if (block.type === 'loop' || block.type === 'parallel') { // Compute nesting depth so children always render above parents let depth = 0 @@ -2944,10 +2907,9 @@ const WorkflowContent = React.memo( if (!parentId) return block.data?.extent || undefined // Constrain the top and left to the container's own gutter, the same - // floor `clampPositionToContainer` applies everywhere else — a drag - // that stopped somewhere different from a drop was the whole reason - // these numbers were written out by hand and drifted. Right and - // bottom stay free so a block can move anywhere in the body. + // floor `clampPositionToContainer` applies everywhere else, so a drag + // stops where a drop would. Right and bottom stay free so a block can + // move anywhere in the body. const minX = CONTAINER_DIMENSIONS.LEFT_PADDING const minY = CONTAINER_DIMENSIONS.HEADER_HEIGHT + CONTAINER_DIMENSIONS.TOP_PADDING const maxX = Number.POSITIVE_INFINITY @@ -3024,7 +2986,6 @@ const WorkflowContent = React.memo( const pendingSet = new Set(pendingSelection) clearPendingSelection() - // Apply pending selection and resolve parent-child conflicts setDisplayNodes((currentNodes) => resolveSelectionConflicts( reconcileCanvasNodes(currentNodes, derivedNodes, pendingSet), @@ -3127,7 +3088,6 @@ const WorkflowContent = React.memo( absolutePositions.set(blockId, getNodeAbsolutePosition(blockId)) } - // Build batch update with all blocks and their affected edges const updates = validBlockIds.map((blockId) => { const absolutePosition = absolutePositions.get(blockId)! const edgesForThisNode = boundaryEdgesByNode.get(blockId) ?? [] @@ -3362,10 +3322,8 @@ const WorkflowContent = React.memo( * Skips during loading. */ useEffect(() => { - // Skip during initial render when nodes aren't loaded yet or workflow not ready if (derivedNodes.length === 0 || !isWorkflowReady) return - // Resize all loops to fit their children resizeLoopNodesWrapper() }, [derivedNodes, resizeLoopNodesWrapper, isWorkflowReady]) @@ -3373,10 +3331,8 @@ const WorkflowContent = React.memo( useEffect(() => { if (!isWorkflowReady) return - // Create a mapping of node IDs to check for missing parent references const nodeIds = new Set(Object.keys(blocks)) - // Check for nodes with invalid parent references and collect updates const orphanedUpdates: Array<{ id: string position: { x: number; y: number } @@ -3385,7 +3341,6 @@ const WorkflowContent = React.memo( Object.entries(blocks).forEach(([id, block]) => { const parentId = block.data?.parentId - // If block has a parent reference but parent no longer exists if (parentId && !nodeIds.has(parentId)) { logger.warn('Found orphaned node with invalid parent reference', { nodeId: id, @@ -3397,7 +3352,6 @@ const WorkflowContent = React.memo( } }) - // Batch update all orphaned nodes at once if (orphanedUpdates.length > 0) { batchUpdateBlocksWithParent(orphanedUpdates) } @@ -3410,7 +3364,6 @@ const WorkflowContent = React.memo( .filter((change: any) => change.type === 'remove') .map((change: any) => change.id) .filter((edgeId: string) => { - // Prevent removing edges targeting protected blocks const edge = edges.find((e) => e.id === edgeId) if (!edge) return true return !isEdgeProtected(edge, blocks) @@ -3512,7 +3465,6 @@ const WorkflowContent = React.memo( ), targetHandle: connection.targetHandle, } - // Check if connecting nodes across container boundaries const sourceNode = getNodes().find((n) => n.id === connection.source) const targetNode = getNodes().find((n) => n.id === connection.target) @@ -3526,7 +3478,6 @@ const WorkflowContent = React.memo( return } - // Get parent information (handle container start node case) const sourceParentId = blocks[sourceNode.id]?.data?.parentId || (normalizedConnection.sourceHandle === 'loop-start-source' || @@ -3535,7 +3486,6 @@ const WorkflowContent = React.memo( : undefined) const targetParentId = blocks[targetNode.id]?.data?.parentId - // Generate a unique edge ID const edgeId = generateId() // Special case for container start source: Always allow connections to nodes within the same container @@ -3544,13 +3494,10 @@ const WorkflowContent = React.memo( normalizedConnection.sourceHandle === 'parallel-start-source') && blocks[targetNode.id]?.data?.parentId === sourceNode.id ) { - // This is a connection from container start to a node inside the container - always allow - addEdge({ ...normalizedConnection, id: edgeId, type: 'workflowEdge', - // Add metadata about the container context data: { parentId: sourceNode.id, isInsideContainer: true, @@ -3560,7 +3507,6 @@ const WorkflowContent = React.memo( return } - // Prevent connections across container boundaries if ( (sourceParentId && !targetParentId) || (!sourceParentId && targetParentId) || @@ -3569,11 +3515,9 @@ const WorkflowContent = React.memo( return } - // Track if this connection is inside a container const isInsideContainer = Boolean(sourceParentId) || Boolean(targetParentId) const parentId = sourceParentId || targetParentId - // Add appropriate metadata for container context addEdge({ ...normalizedConnection, id: edgeId, @@ -3700,10 +3644,8 @@ const WorkflowContent = React.memo( // Note: We don't emit position updates during drag to avoid flooding socket events. // The final position is sent in onNodeDragStop for collaborative updates. - // Get the current parent ID of the node being dragged const currentParentId = blocks[node.id]?.data?.parentId || null - // If the node is inside a container, update container dimensions during drag if (currentParentId) { updateContainerDimensionsDuringMove(node.id, node.position) } @@ -3719,7 +3661,6 @@ const WorkflowContent = React.memo( // Check if this is a starter block - starter blocks should never be in containers const isStarterBlock = node.data?.type === 'starter' if (isStarterBlock) { - // If it's a starter block, remove any highlighting and don't allow it to be dragged into containers if (potentialParentId) { clearDragHighlights() setPotentialParentId(null) @@ -3730,16 +3671,12 @@ const WorkflowContent = React.memo( // Get the node's absolute position to properly calculate intersections const nodeAbsolutePos = getNodeAbsolutePosition(node.id) - // Find intersections with container nodes using absolute coordinates const intersectingNodes = getNodes() .filter((n) => { - // Only consider container nodes that aren't the dragged node if (n.type !== 'subflowNode' || n.id === node.id) return false - // Don't allow dropping into locked containers if (blocks[n.id]?.locked) return false - // Get the container's absolute position const containerAbsolutePos = getNodeAbsolutePosition(n.id) // Get dimensions based on node type (must match actual rendered dimensions) @@ -3758,7 +3695,6 @@ const WorkflowContent = React.memo( BLOCK_DIMENSIONS.MIN_HEIGHT ) - // Check intersection using absolute coordinates const nodeRect = { left: nodeAbsolutePos.x, right: nodeAbsolutePos.x + nodeWidth, @@ -3777,7 +3713,6 @@ const WorkflowContent = React.memo( getNodeDataDimension(n, 'height', CONTAINER_DIMENSIONS.DEFAULT_HEIGHT), } - // Check intersection with absolute coordinates for accurate detection return ( nodeRect.left < containerRect.right && nodeRect.right > containerRect.left && @@ -3785,25 +3720,20 @@ const WorkflowContent = React.memo( nodeRect.bottom > containerRect.top ) }) - // Add more information for sorting .map((n) => ({ container: n, depth: getNodeDepth(n.id), - // Calculate size for secondary sorting size: getNodeDataDimension(n, 'width', CONTAINER_DIMENSIONS.DEFAULT_WIDTH) * getNodeDataDimension(n, 'height', CONTAINER_DIMENSIONS.DEFAULT_HEIGHT), })) - // Update potential parent if there's at least one intersecting container node if (intersectingNodes.length > 0) { // Sort by depth first (deepest/most nested containers first), then by size if same depth const sortedContainers = intersectingNodes.sort((a, b) => { - // First try to compare by hierarchy depth if (a.depth !== b.depth) { return b.depth - a.depth // Higher depth (more nested) comes first } - // If same depth, use size as secondary criterion return a.size - b.size // Smaller container takes precedence }) @@ -3812,7 +3742,6 @@ const WorkflowContent = React.memo( ({ container }) => !isDescendantOf(node.id, container.id) ) - // Use the most appropriate container (deepest or smallest at same depth) const bestContainerMatch = validContainers[0] if (bestContainerMatch) { @@ -3833,7 +3762,6 @@ const WorkflowContent = React.memo( setPotentialParentId(null) } } else { - // Remove highlighting if no longer over a container if (potentialParentId) { clearDragHighlights() setPotentialParentId(null) @@ -3860,12 +3788,10 @@ const WorkflowContent = React.memo( // Note: Protected blocks are already non-draggable via the `draggable` node property - // Store the original parent ID when starting to drag const currentParentId = blocks[node.id]?.data?.parentId || null setDragStartParentId(currentParentId) // Initialize potentialParentId to the current parent so a click without movement doesn't remove from subflow setPotentialParentId(currentParentId) - // Store starting position for undo/redo move entry setDragStartPosition({ id: node.id, x: node.position.x, @@ -3928,11 +3854,9 @@ const WorkflowContent = React.memo( clearDragHighlights() - // Get all selected nodes to update their positions too const allNodes = getNodes() const selectedNodes = allNodes.filter((n) => n.selected) - // If multiple nodes are selected, update all their positions if (selectedNodes.length > 1) { const positionUpdates = computeClampedPositionUpdates(selectedNodes, blocks, allNodes) collaborativeBatchUpdatePositions(positionUpdates, { @@ -3951,14 +3875,12 @@ const WorkflowContent = React.memo( ) } - // Clear drag start state setDragStartPosition(null) setPotentialParentId(null) multiNodeDragStartRef.current.clear() return } - // Single node drag - original logic const finalPosition = getClampedPositionForNode(node.id, node.position, blocks, allNodes) updateBlockPosition(node.id, finalPosition) @@ -3984,7 +3906,6 @@ const WorkflowContent = React.memo( setDragStartPosition(null) } - // Don't process parent changes if the node hasn't actually changed parent or is being moved within same parent if (potentialParentId === dragStartParentId) return // Prevent moving locked blocks out of locked containers @@ -4030,9 +3951,7 @@ const WorkflowContent = React.memo( return } - // Update the node's parent relationship if (potentialParentId) { - // Remove existing edges before moving into container const edgesToRemove = edgesForDisplay.filter( (e) => e.source === node.id || e.target === node.id ) @@ -4059,7 +3978,6 @@ const WorkflowContent = React.memo( y: nodeAbsPosBefore.y - containerAbsPosBefore.y, } - // Auto-connect when moving an existing block into a container const existingChildBlocks = Object.values(blocks) .filter((b) => b.data?.parentId === potentialParentId && b.id !== node.id) .map((b) => ({ id: b.id, type: b.type, position: b.position })) @@ -4114,7 +4032,6 @@ const WorkflowContent = React.memo( }) } - // Clear the parent relationship updateNodeParent(node.id, null, edgesToRemove) // Immediately update displayNodes to prevent React Flow from using stale parent data @@ -4138,7 +4055,6 @@ const WorkflowContent = React.memo( }) } - // Reset state setPotentialParentId(null) }, [ @@ -4189,7 +4105,6 @@ const WorkflowContent = React.memo( } }) - // Apply visual deselection of children setDisplayNodes((allNodes) => resolveSelectionConflicts(allNodes, blocks)) }, [blocks] @@ -4200,7 +4115,6 @@ const WorkflowContent = React.memo( (_event: React.MouseEvent, nodes: Node[]) => { if (nodes.length === 0) return - // Filter out nodes that can't be placed in containers const eligibleNodes = nodes.filter(canNodeEnterContainer) const currentParentIds = new Set( eligibleNodes.map((node) => blocks[node.id]?.data?.parentId ?? null) @@ -4208,7 +4122,6 @@ const WorkflowContent = React.memo( const sharedCurrentParentId = currentParentIds.size === 1 ? currentParentIds.values().next().value : null - // If no eligible nodes, clear any potential parent if (eligibleNodes.length === 0) { if (potentialParentId) { clearDragHighlights() @@ -4240,15 +4153,12 @@ const WorkflowContent = React.memo( maxY = Math.max(maxY, absolutePos.y + height) }) - // Use bounding box for intersection detection const selectionRect = { left: minX, right: maxX, top: minY, bottom: maxY } - // Find containers that intersect with the selection bounding box const allNodes = getNodes() const intersectingContainers = allNodes .filter((containerNode) => { if (containerNode.type !== 'subflowNode') return false - // Skip if any dragged node is this container if (nodes.some((n) => n.id === containerNode.id)) return false const containerAbsolutePos = getNodeAbsolutePosition(containerNode.id) @@ -4263,7 +4173,6 @@ const WorkflowContent = React.memo( getNodeDataDimension(containerNode, 'height', CONTAINER_DIMENSIONS.DEFAULT_HEIGHT), } - // Check intersection return ( selectionRect.left < containerRect.right && selectionRect.right > containerRect.left && @@ -4331,10 +4240,8 @@ const WorkflowContent = React.memo( previousPositions: multiNodeDragStartRef.current, }) - // Process parent updates using shared helper executeBatchParentUpdate(nodes, potentialParentId, 'Batch moved selection to new parent') - // Clear drag state setDragStartPosition(null) setPotentialParentId(null) multiNodeDragStartRef.current.clear() @@ -4815,14 +4722,12 @@ const WorkflowContent = React.memo( /** Stable delete handler to avoid creating new function references per edge. */ const handleEdgeDelete = useCallback( (edgeId: string) => { - // Prevent removing edges targeting protected blocks const edge = latestEdgesRef.current.find((candidate) => candidate.id === edgeId) if (edge && isEdgeProtected(edge, latestBlocksRef.current)) { toast({ message: 'Cannot remove connections to locked blocks' }) return } removeEdge(edgeId) - // Remove this edge from selection (find by edge ID value) setSelectedEdges((prev) => { const next = new Map(prev) for (const [contextId, id] of next) { @@ -5028,7 +4933,6 @@ const WorkflowContent = React.memo( // Handle edge deletion first (edges take priority if selected) if (selectedEdges.size > 0) { - // Get all selected edge IDs and filter out edges targeting protected blocks const edgeIds = Array.from(selectedEdges.values()).filter((edgeId) => { const edge = edges.find((e) => e.id === edgeId) if (!edge) return true @@ -5041,7 +4945,6 @@ const WorkflowContent = React.memo( return } - // Handle block deletion if (!effectivePermissions.canEdit) { return } diff --git a/apps/sim/blocks/blocks/ahrefs.ts b/apps/sim/blocks/blocks/ahrefs.ts index 9405ffd2041..0586a8801e9 100644 --- a/apps/sim/blocks/blocks/ahrefs.ts +++ b/apps/sim/blocks/blocks/ahrefs.ts @@ -264,7 +264,6 @@ export const AhrefsBlock: BlockConfig = { ], value: () => 'ahrefs_domain_rating', }, - // Domain Rating operation inputs { id: 'target', title: 'Target Domain', @@ -282,7 +281,6 @@ export const AhrefsBlock: BlockConfig = { mode: 'advanced', wandConfig: DATE_WAND_CONFIG, }, - // Metrics operation inputs { id: 'target', title: 'Target Domain/URL', @@ -318,7 +316,6 @@ export const AhrefsBlock: BlockConfig = { mode: 'advanced', wandConfig: DATE_WAND_CONFIG, }, - // Backlinks operation inputs { id: 'target', title: 'Target Domain/URL', @@ -356,7 +353,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_backlinks' }, mode: 'advanced', }, - // Backlinks Stats operation inputs { id: 'target', title: 'Target Domain/URL', @@ -383,7 +379,6 @@ export const AhrefsBlock: BlockConfig = { mode: 'advanced', wandConfig: DATE_WAND_CONFIG, }, - // Referring Domains operation inputs { id: 'target', title: 'Target Domain/URL', @@ -421,7 +416,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_referring_domains' }, mode: 'advanced', }, - // Broken Backlinks operation inputs { id: 'target', title: 'Target Domain/URL', @@ -447,7 +441,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_broken_backlinks' }, mode: 'advanced', }, - // Organic Keywords operation inputs { id: 'target', title: 'Target Domain/URL', @@ -491,7 +484,6 @@ export const AhrefsBlock: BlockConfig = { mode: 'advanced', wandConfig: DATE_WAND_CONFIG, }, - // Organic Competitors operation inputs { id: 'target', title: 'Target Domain/URL', @@ -535,7 +527,6 @@ export const AhrefsBlock: BlockConfig = { mode: 'advanced', wandConfig: DATE_WAND_CONFIG, }, - // Top Pages operation inputs { id: 'target', title: 'Target Domain', @@ -579,7 +570,6 @@ export const AhrefsBlock: BlockConfig = { mode: 'advanced', wandConfig: DATE_WAND_CONFIG, }, - // Keyword Overview operation inputs { id: 'keyword', title: 'Keyword', @@ -597,7 +587,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_keyword_overview' }, mode: 'advanced', }, - // Paid Pages operation inputs { id: 'target', title: 'Target Domain', @@ -641,7 +630,6 @@ export const AhrefsBlock: BlockConfig = { mode: 'advanced', wandConfig: DATE_WAND_CONFIG, }, - // Anchors operation inputs { id: 'target', title: 'Target Domain/URL', @@ -679,7 +667,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_anchors' }, mode: 'advanced', }, - // Related Terms operation inputs { id: 'keyword', title: 'Keyword', @@ -723,7 +710,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_related_terms' }, mode: 'advanced', }, - // Domain Rating History operation inputs { id: 'target', title: 'Target Domain', @@ -759,7 +745,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_domain_rating_history' }, mode: 'advanced', }, - // Metrics History operation inputs { id: 'target', title: 'Target Domain/URL', @@ -822,7 +807,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_metrics_history' }, mode: 'advanced', }, - // Referring Domains History operation inputs { id: 'target', title: 'Target Domain/URL', @@ -867,7 +851,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_refdomains_history' }, mode: 'advanced', }, - // Keywords History operation inputs { id: 'target', title: 'Target Domain/URL', @@ -921,7 +904,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_keywords_history' }, mode: 'advanced', }, - // Batch Analysis operation inputs { id: 'targets', title: 'Targets', @@ -966,7 +948,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_batch_analysis' }, mode: 'advanced', }, - // Site Audit Page Explorer operation inputs { id: 'projectId', title: 'Site Audit Project ID', @@ -1008,7 +989,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_site_audit_page_explorer' }, mode: 'advanced', }, - // Rank Tracker Overview operation inputs { id: 'projectId', title: 'Rank Tracker Project ID', @@ -1061,7 +1041,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_rank_tracker_overview' }, mode: 'advanced', }, - // Rank Tracker SERP Overview operation inputs { id: 'projectId', title: 'Rank Tracker Project ID', @@ -1129,7 +1108,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_rank_tracker_serp_overview' }, mode: 'advanced', }, - // Rank Tracker Competitors Overview operation inputs { id: 'projectId', title: 'Rank Tracker Project ID', @@ -1182,7 +1160,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_rank_tracker_competitors_overview' }, mode: 'advanced', }, - // Rank Tracker Competitors Stats operation inputs { id: 'projectId', title: 'Rank Tracker Project ID', @@ -1218,7 +1195,6 @@ export const AhrefsBlock: BlockConfig = { condition: { field: 'operation', value: 'ahrefs_rank_tracker_competitors_stats' }, mode: 'advanced', }, - // API Key (common to all operations) { id: 'apiKey', title: 'API Key', @@ -1374,88 +1350,65 @@ export const AhrefsBlock: BlockConfig = { }, }, outputs: { - // Domain Rating output domainRating: { type: 'number', description: 'Domain Rating score (0-100)' }, ahrefsRank: { type: 'number', description: 'Ahrefs Rank (global ranking)' }, - // Metrics output metrics: { type: 'json', description: 'Organic and paid search overview (organicTraffic, organicKeywords, organicKeywordsTop3, organicCost, paidTraffic, paidKeywords, paidPages, paidCost)', }, - // Backlinks output backlinks: { type: 'json', description: 'List of backlinks' }, - // Backlinks Stats output stats: { type: 'json', description: 'Backlink and referring domain totals (liveBacklinks, liveReferringDomains, allTimeBacklinks, allTimeReferringDomains)', }, - // Referring Domains output referringDomains: { type: 'json', description: 'List of referring domains' }, - // Broken Backlinks output brokenBacklinks: { type: 'json', description: 'List of broken backlinks' }, - // Organic Keywords output keywords: { type: 'json', description: 'List of organic keywords' }, - // Organic Competitors output competitors: { type: 'json', description: 'List of organic search competitors' }, - // Top Pages output pages: { type: 'json', description: 'List of top pages' }, - // Keyword Overview output overview: { type: 'json', description: 'Keyword metrics overview, including search intent flags (informational, navigational, commercial, transactional, branded, local)', }, - // Paid Pages output paidPages: { type: 'json', description: 'List of pages receiving paid search traffic' }, - // Anchors output anchors: { type: 'json', description: 'Anchor text distribution for the backlink profile' }, - // Related Terms output relatedTerms: { type: 'json', description: 'Related keyword ideas for the seed keyword' }, - // Domain Rating History output domainRatings: { type: 'json', description: 'Historical Domain Rating data points' }, - // Metrics History output metricsHistory: { type: 'json', description: 'Historical organic and paid traffic data points', }, - // Referring Domains History output referringDomainsHistory: { type: 'json', description: 'Historical referring domains count data points', }, - // Keywords History output keywordsHistory: { type: 'json', description: 'Historical organic keyword ranking distribution', }, - // Batch Analysis output results: { type: 'json', description: 'Bulk SEO metrics for each analyzed target, in submission order', }, - // Site Audit Page Explorer output auditPages: { type: 'json', description: 'Crawled pages with health and SEO metrics from a Site Audit project', }, - // Rank Tracker Overview output overviews: { type: 'json', description: 'Ranking overview for each keyword tracked in a Rank Tracker project', }, - // Rank Tracker SERP Overview output positions: { type: 'json', description: 'Every ranking result on the SERP for a tracked keyword', }, - // Rank Tracker Competitors Overview output competitorKeywords: { type: 'json', description: 'Tracked keywords with competitor ranking, traffic, and traffic value data', }, - // Rank Tracker Competitors Stats output competitorsStats: { type: 'json', description: 'Aggregate stats for each tracked Rank Tracker competitor', diff --git a/apps/sim/blocks/blocks/amplitude.ts b/apps/sim/blocks/blocks/amplitude.ts index 05b446b78bf..87ced2efd9f 100644 --- a/apps/sim/blocks/blocks/amplitude.ts +++ b/apps/sim/blocks/blocks/amplitude.ts @@ -170,7 +170,7 @@ export const AmplitudeBlock: BlockConfig = { mode: 'advanced', }, - // --- Send Event fields --- + // Send Event fields { id: 'eventType', title: 'Event Type', @@ -347,7 +347,7 @@ export const AmplitudeBlock: BlockConfig = { mode: 'advanced', }, - // --- Identify User fields --- + // Identify User fields { id: 'identifyUserProperties', title: 'User Properties', @@ -363,7 +363,7 @@ export const AmplitudeBlock: BlockConfig = { }, }, - // --- Group Identify fields --- + // Group Identify fields { id: 'groupType', title: 'Group Type', @@ -395,7 +395,7 @@ export const AmplitudeBlock: BlockConfig = { }, }, - // --- User Search fields --- + // User Search fields { id: 'searchUser', title: 'User', @@ -405,7 +405,7 @@ export const AmplitudeBlock: BlockConfig = { condition: { field: 'operation', value: 'user_search' }, }, - // --- User Activity fields --- + // User Activity fields { id: 'amplitudeId', title: 'Amplitude ID', @@ -443,7 +443,7 @@ export const AmplitudeBlock: BlockConfig = { mode: 'advanced', }, - // --- User Profile fields --- + // User Profile fields { id: 'getAmpProps', title: 'Include User Properties', @@ -481,7 +481,7 @@ export const AmplitudeBlock: BlockConfig = { mode: 'advanced', }, - // --- Event Segmentation fields --- + // Event Segmentation fields { id: 'segmentationEventType', title: 'Event Type', @@ -616,7 +616,7 @@ export const AmplitudeBlock: BlockConfig = { mode: 'advanced', }, - // --- Get Active Users fields --- + // Get Active Users fields { id: 'activeUsersStart', title: 'Start Date', @@ -687,7 +687,7 @@ export const AmplitudeBlock: BlockConfig = { mode: 'advanced', }, - // --- Get Revenue fields --- + // Get Revenue fields { id: 'revenueStart', title: 'Start Date', @@ -760,7 +760,7 @@ export const AmplitudeBlock: BlockConfig = { mode: 'advanced', }, - // --- Funnels fields --- + // Funnels fields { id: 'funnelEvents', title: 'Funnel Steps', @@ -876,7 +876,7 @@ export const AmplitudeBlock: BlockConfig = { mode: 'advanced', }, - // --- Retention fields --- + // Retention fields { id: 'retentionStartEvent', title: 'Starting Event', diff --git a/apps/sim/blocks/blocks/calcom.ts b/apps/sim/blocks/blocks/calcom.ts index 7ec70b32f86..b0d2658479d 100644 --- a/apps/sim/blocks/blocks/calcom.ts +++ b/apps/sim/blocks/blocks/calcom.ts @@ -138,7 +138,7 @@ export const CalComBlock: BlockConfig = { required: true, }, - // === Create Booking fields === + // Create Booking fields { id: 'eventTypeSelector', title: 'Event Type', @@ -291,7 +291,7 @@ Return ONLY the IANA timezone string - no explanations or quotes.`, mode: 'advanced', }, - // === Get/Cancel/Reschedule/Confirm/Decline Booking fields === + // Get/Cancel/Reschedule/Confirm/Decline Booking fields { id: 'bookingUid', title: 'Booking UID', @@ -336,7 +336,7 @@ Return ONLY the IANA timezone string - no explanations or quotes.`, mode: 'advanced', }, - // === List Bookings filters === + // List Bookings filters { id: 'bookingStatus', title: 'Status', @@ -352,7 +352,7 @@ Return ONLY the IANA timezone string - no explanations or quotes.`, condition: { field: 'operation', value: 'calcom_list_bookings' }, }, - // === Event Type fields === + // Event Type fields { id: 'eventTypeParamSelector', title: 'Event Type', @@ -516,7 +516,7 @@ Return ONLY the IANA timezone string - no explanations or quotes.`, mode: 'advanced', }, - // === Schedule fields === + // Schedule fields { id: 'scheduleSelector', title: 'Schedule', @@ -639,7 +639,7 @@ Return ONLY valid JSON - no explanations.`, }, }, - // === Slots fields === + // Slots fields { id: 'eventTypeSlug', title: 'Event Type Slug', @@ -665,7 +665,7 @@ Return ONLY valid JSON - no explanations.`, mode: 'advanced', }, - // === List Event Types sorting === + // List Event Types sorting { id: 'sortCreatedAt', title: 'Sort by Created', diff --git a/apps/sim/blocks/blocks/confluence.ts b/apps/sim/blocks/blocks/confluence.ts index c01e4fa717d..1da1f491976 100644 --- a/apps/sim/blocks/blocks/confluence.ts +++ b/apps/sim/blocks/blocks/confluence.ts @@ -605,7 +605,6 @@ export const ConfluenceV2Block: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Page Operations { label: 'Read Page', id: 'read' }, { label: 'Create Page', id: 'create' }, { label: 'Update Page', id: 'update' }, @@ -613,57 +612,44 @@ export const ConfluenceV2Block: BlockConfig = { { label: 'List Pages in Space', id: 'list_pages_in_space' }, { label: 'Get Page Children', id: 'get_page_children' }, { label: 'Get Page Ancestors', id: 'get_page_ancestors' }, - // Version Operations { label: 'List Page Versions', id: 'list_page_versions' }, { label: 'Get Page Version', id: 'get_page_version' }, - // Page Property Operations { label: 'List Page Properties', id: 'list_page_properties' }, { label: 'Create Page Property', id: 'create_page_property' }, { label: 'Delete Page Property', id: 'delete_page_property' }, - // Search Operations { label: 'Search Content', id: 'search' }, { label: 'Search in Space', id: 'search_in_space' }, - // Blog Post Operations { label: 'List Blog Posts', id: 'list_blogposts' }, { label: 'Get Blog Post', id: 'get_blogpost' }, { label: 'Create Blog Post', id: 'create_blogpost' }, { label: 'Update Blog Post', id: 'update_blogpost' }, { label: 'Delete Blog Post', id: 'delete_blogpost' }, { label: 'List Blog Posts in Space', id: 'list_blogposts_in_space' }, - // Comment Operations { label: 'Create Comment', id: 'create_comment' }, { label: 'List Comments', id: 'list_comments' }, { label: 'Update Comment', id: 'update_comment' }, { label: 'Delete Comment', id: 'delete_comment' }, - // Attachment Operations { label: 'Upload Attachment', id: 'upload_attachment' }, { label: 'List Attachments', id: 'list_attachments' }, { label: 'Delete Attachment', id: 'delete_attachment' }, - // Label Operations { label: 'List Labels', id: 'list_labels' }, { label: 'Add Label', id: 'add_label' }, { label: 'Delete Label', id: 'delete_label' }, { label: 'Get Pages by Label', id: 'get_pages_by_label' }, { label: 'List Space Labels', id: 'list_space_labels' }, - // Space Operations { label: 'Get Space', id: 'get_space' }, { label: 'Create Space', id: 'create_space' }, { label: 'Update Space', id: 'update_space' }, { label: 'Delete Space', id: 'delete_space' }, { label: 'List Spaces', id: 'list_spaces' }, - // Space Property Operations { label: 'List Space Properties', id: 'list_space_properties' }, { label: 'Create Space Property', id: 'create_space_property' }, { label: 'Delete Space Property', id: 'delete_space_property' }, - // Space Permission Operations { label: 'List Space Permissions', id: 'list_space_permissions' }, - // Page Descendant Operations { label: 'Get Page Descendants', id: 'get_page_descendants' }, - // Task Operations { label: 'List Tasks', id: 'list_tasks' }, { label: 'Get Task', id: 'get_task' }, { label: 'Update Task', id: 'update_task' }, - // User Operations { label: 'Get User', id: 'get_user' }, ], value: () => 'read', @@ -1230,7 +1216,6 @@ export const ConfluenceV2Block: BlockConfig = { }, }, - // Trigger subBlocks ...getTrigger('confluence_page_created').subBlocks, ...getTrigger('confluence_page_updated').subBlocks, ...getTrigger('confluence_page_removed').subBlocks, @@ -1285,7 +1270,6 @@ export const ConfluenceV2Block: BlockConfig = { }, tools: { access: [ - // Page Tools 'confluence_retrieve', 'confluence_update', 'confluence_create_page', @@ -1293,64 +1277,49 @@ export const ConfluenceV2Block: BlockConfig = { 'confluence_list_pages_in_space', 'confluence_get_page_children', 'confluence_get_page_ancestors', - // Version Tools 'confluence_list_page_versions', 'confluence_get_page_version', - // Property Tools 'confluence_list_page_properties', 'confluence_create_page_property', 'confluence_delete_page_property', - // Search Tools 'confluence_search', 'confluence_search_in_space', - // Blog Post Tools 'confluence_list_blogposts', 'confluence_get_blogpost', 'confluence_create_blogpost', 'confluence_list_blogposts_in_space', - // Comment Tools 'confluence_create_comment', 'confluence_list_comments', 'confluence_update_comment', 'confluence_delete_comment', - // Attachment Tools 'confluence_upload_attachment', 'confluence_list_attachments', 'confluence_delete_attachment', - // Label Tools 'confluence_list_labels', 'confluence_add_label', 'confluence_delete_label', 'confluence_get_pages_by_label', 'confluence_list_space_labels', - // Space Tools 'confluence_get_space', 'confluence_create_space', 'confluence_update_space', 'confluence_delete_space', 'confluence_list_spaces', - // Space Property Tools 'confluence_list_space_properties', 'confluence_create_space_property', 'confluence_delete_space_property', - // Space Permission Tools 'confluence_list_space_permissions', - // Page Descendant Tools 'confluence_get_page_descendants', - // Task Tools 'confluence_list_tasks', 'confluence_get_task', 'confluence_update_task', - // Blog Post Update/Delete 'confluence_update_blogpost', 'confluence_delete_blogpost', - // User Tools 'confluence_get_user', ], config: { tool: (params) => { switch (params.operation) { - // Page Operations case 'read': return 'confluence_retrieve' case 'create': @@ -1365,24 +1334,20 @@ export const ConfluenceV2Block: BlockConfig = { return 'confluence_get_page_children' case 'get_page_ancestors': return 'confluence_get_page_ancestors' - // Version Operations case 'list_page_versions': return 'confluence_list_page_versions' case 'get_page_version': return 'confluence_get_page_version' - // Property Operations case 'list_page_properties': return 'confluence_list_page_properties' case 'create_page_property': return 'confluence_create_page_property' case 'delete_page_property': return 'confluence_delete_page_property' - // Search Operations case 'search': return 'confluence_search' case 'search_in_space': return 'confluence_search_in_space' - // Blog Post Operations case 'list_blogposts': return 'confluence_list_blogposts' case 'get_blogpost': @@ -1395,7 +1360,6 @@ export const ConfluenceV2Block: BlockConfig = { return 'confluence_delete_blogpost' case 'list_blogposts_in_space': return 'confluence_list_blogposts_in_space' - // Comment Operations case 'create_comment': return 'confluence_create_comment' case 'list_comments': @@ -1404,14 +1368,12 @@ export const ConfluenceV2Block: BlockConfig = { return 'confluence_update_comment' case 'delete_comment': return 'confluence_delete_comment' - // Attachment Operations case 'upload_attachment': return 'confluence_upload_attachment' case 'list_attachments': return 'confluence_list_attachments' case 'delete_attachment': return 'confluence_delete_attachment' - // Label Operations case 'list_labels': return 'confluence_list_labels' case 'add_label': @@ -1422,7 +1384,6 @@ export const ConfluenceV2Block: BlockConfig = { return 'confluence_get_pages_by_label' case 'list_space_labels': return 'confluence_list_space_labels' - // Space Operations case 'get_space': return 'confluence_get_space' case 'create_space': @@ -1433,27 +1394,22 @@ export const ConfluenceV2Block: BlockConfig = { return 'confluence_delete_space' case 'list_spaces': return 'confluence_list_spaces' - // Space Property Operations case 'list_space_properties': return 'confluence_list_space_properties' case 'create_space_property': return 'confluence_create_space_property' case 'delete_space_property': return 'confluence_delete_space_property' - // Space Permission Operations case 'list_space_permissions': return 'confluence_list_space_permissions' - // Page Descendant Operations case 'get_page_descendants': return 'confluence_get_page_descendants' - // Task Operations case 'list_tasks': return 'confluence_list_tasks' case 'get_task': return 'confluence_get_task' case 'update_task': return 'confluence_update_task' - // User Operations case 'get_user': return 'confluence_get_user' default: @@ -1811,61 +1767,47 @@ export const ConfluenceV2Block: BlockConfig = { added: { type: 'boolean', description: 'Addition status' }, removed: { type: 'boolean', description: 'Removal status' }, updated: { type: 'boolean', description: 'Update status' }, - // Search & List Results results: { type: 'array', description: 'Search results' }, pages: { type: 'array', description: 'List of pages' }, children: { type: 'array', description: 'List of child pages' }, ancestors: { type: 'array', description: 'List of ancestor pages' }, - // Comment Results comments: { type: 'array', description: 'List of comments' }, commentId: { type: 'string', description: 'Comment identifier' }, - // Attachment Results attachments: { type: 'array', description: 'List of attachments' }, attachmentId: { type: 'string', description: 'Attachment identifier' }, fileSize: { type: 'number', description: 'Attachment file size in bytes' }, mediaType: { type: 'string', description: 'Attachment MIME type' }, downloadUrl: { type: 'string', description: 'Attachment download URL' }, - // Label Results labels: { type: 'array', description: 'List of labels' }, labelName: { type: 'string', description: 'Label name' }, labelId: { type: 'string', description: 'Label identifier' }, - // Space Results spaces: { type: 'array', description: 'List of spaces' }, spaceId: { type: 'string', description: 'Space identifier' }, name: { type: 'string', description: 'Space name' }, key: { type: 'string', description: 'Space key' }, type: { type: 'string', description: 'Space or content type' }, status: { type: 'string', description: 'Space status' }, - // Blog Post Results blogPosts: { type: 'array', description: 'List of blog posts' }, blogPostId: { type: 'string', description: 'Blog post identifier' }, - // Version Results versions: { type: 'array', description: 'List of page versions' }, version: { type: 'json', description: 'Version information' }, versionNumber: { type: 'number', description: 'Version number' }, - // Property Results properties: { type: 'array', description: 'List of page properties' }, propertyId: { type: 'string', description: 'Property identifier' }, propertyKey: { type: 'string', description: 'Property key' }, propertyValue: { type: 'json', description: 'Property value' }, - // User Results accountId: { type: 'string', description: 'Atlassian account ID' }, displayName: { type: 'string', description: 'User display name' }, email: { type: 'string', description: 'User email address' }, accountType: { type: 'string', description: 'Account type (atlassian, app, customer)' }, profilePicture: { type: 'string', description: 'Path to user profile picture' }, publicName: { type: 'string', description: 'User public name' }, - // Task Results tasks: { type: 'array', description: 'List of tasks' }, taskId: { type: 'string', description: 'Task identifier' }, - // Descendant Results descendants: { type: 'array', description: 'List of descendant pages' }, - // Permission Results permissions: { type: 'array', description: 'List of space permissions' }, - // Space Property Results homepageId: { type: 'string', description: 'Space homepage ID' }, description: { type: 'json', description: 'Space description' }, - // Pagination nextCursor: { type: 'string', description: 'Cursor for fetching next page of results' }, }, } diff --git a/apps/sim/blocks/blocks/dagster.ts b/apps/sim/blocks/blocks/dagster.ts index e88047d26be..7d1cd12e824 100644 --- a/apps/sim/blocks/blocks/dagster.ts +++ b/apps/sim/blocks/blocks/dagster.ts @@ -108,7 +108,6 @@ export const DagsterBlock: BlockConfig = { }, subBlocks: [ - // ── Operation selector ───────────────────────────────────────────────────── { id: 'operation', title: 'Operation', @@ -137,7 +136,6 @@ export const DagsterBlock: BlockConfig = { value: () => 'launch_run', }, - // ── Repository selectors (launch_run + schedule/sensor operations) ───────── { id: 'repositoryLocationName', title: 'Repository Location', @@ -195,7 +193,6 @@ export const DagsterBlock: BlockConfig = { }, }, - // ── Launch Run ───────────────────────────────────────────────────────────── { id: 'jobName', title: 'Job Name', @@ -247,7 +244,6 @@ Return ONLY a valid JSON array - no explanations, no extra text.`, }, }, - // ── Run ID (shared: get_run, get_run_logs, terminate_run, delete_run, reexecute_run) ── { id: 'runId', title: 'Run ID', @@ -263,7 +259,6 @@ Return ONLY a valid JSON array - no explanations, no extra text.`, }, }, - // ── Reexecute Run ────────────────────────────────────────────────────────── { id: 'strategy', title: 'Reexecution Strategy', @@ -278,7 +273,6 @@ Return ONLY a valid JSON array - no explanations, no extra text.`, required: { field: 'operation', value: 'reexecute_run' }, }, - // ── Get Run Logs ─────────────────────────────────────────────────────────── { id: 'afterCursor', title: 'After Cursor', @@ -296,7 +290,6 @@ Return ONLY a valid JSON array - no explanations, no extra text.`, mode: 'advanced', }, - // ── List Runs ────────────────────────────────────────────────────────────── { id: 'listRunsJobName', title: 'Job Name Filter', @@ -375,7 +368,6 @@ Return ONLY the integer Unix timestamp in seconds - no explanations, no extra te mode: 'advanced', }, - // ── Schedule operations ──────────────────────────────────────────────────── { id: 'scheduleName', title: 'Schedule Name', @@ -398,7 +390,6 @@ Return ONLY the integer Unix timestamp in seconds - no explanations, no extra te mode: 'advanced', }, - // ── Sensor operations ────────────────────────────────────────────────────── { id: 'sensorName', title: 'Sensor Name', @@ -421,7 +412,6 @@ Return ONLY the integer Unix timestamp in seconds - no explanations, no extra te mode: 'advanced', }, - // ── Stop schedule / sensor (shared) ──────────────────────────────────────── { id: 'instigationStateId', title: 'Instigator State ID', @@ -431,7 +421,6 @@ Return ONLY the integer Unix timestamp in seconds - no explanations, no extra te required: { field: 'operation', value: ['stop_schedule', 'stop_sensor'] }, }, - // ── Asset operations ─────────────────────────────────────────────────────── { id: 'assetKey', title: 'Asset Key', @@ -520,7 +509,6 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, mode: 'advanced', }, - // ── Connection (common to all operations) ────────────────────────────────── { id: 'host', title: 'Host', @@ -564,7 +552,6 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, params: (params) => { const result: Record = {} - // list_runs: type-coerce limit + time filters, remap job name filter and cursor if (params.operation === 'list_runs') { result.limit = toFiniteNumber(params.limit) result.jobName = params.listRunsJobName || undefined @@ -573,17 +560,14 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, result.cursor = params.runsCursor || undefined } - // get_run_logs: remap logsLimit → limit if (params.operation === 'get_run_logs') { result.limit = toFiniteNumber(params.logsLimit) } - // reexecute_run: remap runId → parentRunId if (params.operation === 'reexecute_run') { if (params.runId) result.parentRunId = params.runId } - // list_schedules / list_sensors: drop empty status filter if (params.operation === 'list_schedules' && !params.scheduleStatus) { result.scheduleStatus = undefined } @@ -591,19 +575,16 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, result.sensorStatus = undefined } - // list_assets: type-coerce limit and remap prefix/cursor if (params.operation === 'list_assets') { result.prefix = params.assetPrefix || undefined result.limit = toFiniteNumber(params.assetsLimit) result.cursor = params.assetsCursor || undefined } - // materialize_assets: remap asset job name → jobName if (params.operation === 'materialize_assets') { result.jobName = params.assetJobName } - // report_asset_materialization: remap report-prefixed fields to tool params if (params.operation === 'report_asset_materialization') { result.eventType = params.reportEventType || 'ASSET_MATERIALIZATION' result.partitionKeys = params.reportPartitionKeys || undefined @@ -622,23 +603,18 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, type: 'string', description: 'Dagster Cloud API token (optional for self-hosted instances)', }, - // Launch Run repositoryLocationName: { type: 'string', description: 'Repository location name' }, repositoryName: { type: 'string', description: 'Repository name' }, jobName: { type: 'string', description: 'Job name to launch' }, runConfigJson: { type: 'string', description: 'Run configuration as JSON' }, tags: { type: 'string', description: 'Tags as JSON array of {key, value} objects' }, - // Run ID operations runId: { type: 'string', description: 'Run ID' }, - // Reexecute Run strategy: { type: 'string', description: 'Reexecution strategy (ALL_STEPS, FROM_FAILURE, FROM_ASSET_FAILURE)', }, - // Get Run Logs afterCursor: { type: 'string', description: 'Pagination cursor for run logs' }, logsLimit: { type: 'number', description: 'Maximum log events to return' }, - // List Runs listRunsJobName: { type: 'string', description: 'Filter list_runs by job name' }, statuses: { type: 'string', description: 'Comma-separated run statuses to filter by' }, createdAfter: { @@ -651,18 +627,14 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, }, runsCursor: { type: 'string', description: 'Run ID cursor for list_runs pagination' }, limit: { type: 'number', description: 'Maximum results to return' }, - // Schedules scheduleName: { type: 'string', description: 'Schedule name' }, scheduleStatus: { type: 'string', description: 'Filter schedules by status (RUNNING or STOPPED)', }, - // Sensors sensorName: { type: 'string', description: 'Sensor name' }, sensorStatus: { type: 'string', description: 'Filter sensors by status (RUNNING or STOPPED)' }, - // Stop schedule / sensor instigationStateId: { type: 'string', description: 'InstigationState ID for stop operations' }, - // Assets assetKey: { type: 'string', description: 'Slash-delimited asset key' }, assetJobName: { type: 'string', description: 'Asset job to launch for materialization' }, assetSelection: { @@ -684,9 +656,7 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, }, outputs: { - // Launch Run / Reexecute Run / Delete Run / Get Run runId: { type: 'string', description: 'Run ID' }, - // Get Run jobName: { type: 'string', description: 'Job name the run belongs to' }, status: { type: 'string', description: 'Run or schedule/sensor status' }, mode: { type: 'string', description: 'Execution mode of the run' }, @@ -699,17 +669,13 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, canTerminate: { type: 'boolean', description: 'Whether the run can be terminated' }, runConfigYaml: { type: 'string', description: 'Run configuration as YAML' }, tags: { type: 'json', description: 'Run tags as array of {key, value} objects' }, - // List Runs runs: { type: 'json', description: 'List of runs (runId, jobName, status, tags, startTime, endTime)', }, - // List Jobs jobs: { type: 'json', description: 'List of jobs (name, repositoryName)' }, - // Terminate Run success: { type: 'boolean', description: 'Whether termination succeeded' }, message: { type: 'string', description: 'Termination status or error message' }, - // Get Run Logs events: { type: 'json', description: 'Log events (type, message, timestamp, level, stepKey, eventType)', @@ -722,24 +688,18 @@ Return ONLY the comma-separated asset keys - no explanations, no extra text.`, type: 'boolean', description: 'Whether more items are available beyond this page', }, - // List Schedules schedules: { type: 'json', description: 'List of schedules (name, cronSchedule, jobName, status, id, description, executionTimezone)', }, - // List Sensors sensors: { type: 'json', description: 'List of sensors (name, sensorType, status, id, description)', }, - // Start/Stop schedule or sensor id: { type: 'string', description: 'Instigator state ID of the schedule or sensor' }, - // Get Run / Get Asset (asset key selection) assetSelection: { type: 'json', description: 'Asset keys targeted by the run' }, - // List Assets assets: { type: 'json', description: 'List of assets (assetKey, path)' }, - // Get Asset assetKey: { type: 'string', description: 'Slash-joined asset key' }, path: { type: 'json', description: 'Asset key path segments' }, groupName: { type: 'string', description: 'Asset group name' }, diff --git a/apps/sim/blocks/blocks/datadog.ts b/apps/sim/blocks/blocks/datadog.ts index dee922cad4e..54500fd9160 100644 --- a/apps/sim/blocks/blocks/datadog.ts +++ b/apps/sim/blocks/blocks/datadog.ts @@ -173,7 +173,6 @@ export const DatadogBlock: BlockConfig = { }, }, subBlocks: [ - // Operation selector { id: 'operation', title: 'Operation', @@ -227,7 +226,6 @@ export const DatadogBlock: BlockConfig = { value: () => 'datadog_submit_metrics', }, - // Submit Metrics inputs { id: 'series', title: 'Metrics Data (JSON)', @@ -257,7 +255,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Query Timeseries inputs { id: 'query', title: 'Query', @@ -321,7 +318,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, }, }, - // Create Event inputs { id: 'title', title: 'Event Title', @@ -391,7 +387,6 @@ Return the event description text directly - no extra formatting needed.`, mode: 'advanced', }, - // Create Monitor inputs { id: 'name', title: 'Monitor Name', @@ -504,7 +499,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Get Monitor inputs { id: 'monitorId', title: 'Monitor ID', @@ -514,7 +508,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, required: true, }, - // List Monitors inputs { id: 'listMonitorName', title: 'Filter by Name', @@ -552,7 +545,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, mode: 'advanced', }, - // Mute / Unmute Monitor inputs { id: 'muteMonitorId', title: 'Monitor ID', @@ -591,7 +583,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, mode: 'advanced', }, - // Query Logs inputs { id: 'logQuery', title: 'Search Query', @@ -672,7 +663,6 @@ Return ONLY the relative time string - no explanations, no quotes, no extra text mode: 'advanced', }, - // Send Logs inputs { id: 'logs', title: 'Logs (JSON)', @@ -703,7 +693,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Create Downtime inputs { id: 'downtimeScope', title: 'Scope', @@ -812,7 +801,6 @@ Return ONLY the comma-separated tag list - no explanations, no extra text.`, mode: 'advanced', }, - // List Downtimes inputs { id: 'currentOnly', title: 'Current Only', @@ -837,7 +825,6 @@ Return ONLY the comma-separated tag list - no explanations, no extra text.`, mode: 'advanced', }, - // Cancel Downtime inputs { id: 'downtimeId', title: 'Downtime ID', @@ -847,7 +834,6 @@ Return ONLY the comma-separated tag list - no explanations, no extra text.`, required: true, }, - // Incidents inputs { id: 'incidentId', title: 'Incident ID', @@ -1065,7 +1051,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // SLO inputs { id: 'sloId', title: 'SLO ID', @@ -1329,7 +1314,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, mode: 'advanced', }, - // Dashboard inputs { id: 'dashboardId', title: 'Dashboard ID', @@ -1466,7 +1450,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, mode: 'advanced', }, - // Synthetics inputs { id: 'syntheticsPublicId', title: 'Test Public ID', @@ -1575,7 +1558,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, mode: 'advanced', }, - // Security monitoring inputs { id: 'signalId', title: 'Signal ID', @@ -1758,7 +1740,6 @@ Return ONLY the search query string - no explanations.`, mode: 'advanced', }, - // APM inputs { id: 'spanQuery', title: 'Span Query', @@ -1862,7 +1843,6 @@ Return ONLY the search query string - no explanations.`, mode: 'advanced', }, - // Authentication (common) { id: 'apiKey', title: 'API Key', @@ -2347,18 +2327,15 @@ Return ONLY the search query string - no explanations.`, apiKey: { type: 'string', description: 'Datadog API key' }, applicationKey: { type: 'string', description: 'Datadog Application key' }, site: { type: 'string', description: 'Datadog site/region' }, - // Metrics series: { type: 'json', description: 'Metrics data to submit' }, query: { type: 'string', description: 'Query string' }, from: { type: 'number', description: 'Start time (Unix timestamp)' }, to: { type: 'number', description: 'End time (Unix timestamp)' }, - // Events title: { type: 'string', description: 'Event title' }, text: { type: 'string', description: 'Event text/body' }, alertType: { type: 'string', description: 'Alert type' }, priority: { type: 'string', description: 'Priority level' }, tags: { type: 'string', description: 'Comma-separated tags' }, - // Monitors name: { type: 'string', description: 'Monitor name' }, type: { type: 'string', description: 'Monitor type' }, monitorQuery: { type: 'string', description: 'Monitor query' }, @@ -2367,7 +2344,6 @@ Return ONLY the search query string - no explanations.`, monitorPriority: { type: 'number', description: 'Monitor priority (1-5)' }, options: { type: 'json', description: 'Monitor options' }, monitorId: { type: 'string', description: 'Monitor ID' }, - // Logs muteMonitorId: { type: 'string', description: 'Monitor ID to mute or unmute' }, scope: { type: 'string', description: 'Scope to mute or unmute' }, end: { type: 'number', description: 'Unix timestamp when the mute ends' }, @@ -2377,7 +2353,6 @@ Return ONLY the search query string - no explanations.`, logTo: { type: 'string', description: 'Log end time' }, logLimit: { type: 'number', description: 'Max logs to return' }, logs: { type: 'json', description: 'Logs to send' }, - // Downtimes downtimeScope: { type: 'string', description: 'Downtime scope' }, downtimeMessage: { type: 'string', description: 'Downtime message' }, downtimeStart: { type: 'number', description: 'Downtime start time' }, @@ -2408,7 +2383,6 @@ Return ONLY the search query string - no explanations.`, description: 'Monitor page number (0-indexed). With neither this nor the page size set, Datadog returns every monitor in the org without pagination.', }, - // Incidents incidentId: { type: 'string', description: 'Incident UUID' }, incidentTitle: { type: 'string', description: 'Incident title' }, incidentCustomerImpacted: { type: 'boolean', description: 'Whether customers were impacted' }, @@ -2427,7 +2401,6 @@ Return ONLY the search query string - no explanations.`, todoContent: { type: 'string', description: 'Follow-up task content' }, todoAssignees: { type: 'string', description: 'Follow-up task assignees' }, todoDueDate: { type: 'string', description: 'Follow-up task due date' }, - // SLOs sloId: { type: 'string', description: 'SLO ID' }, sloName: { type: 'string', description: 'SLO name' }, sloType: { type: 'string', description: 'SLO type' }, @@ -2456,7 +2429,6 @@ Return ONLY the search query string - no explanations.`, sloToTs: { type: 'number', description: 'SLO history window end (Unix seconds)' }, sloTarget: { type: 'number', description: 'SLO target for history queries' }, sloApplyCorrection: { type: 'boolean', description: 'Apply SLO corrections' }, - // Dashboards dashboardId: { type: 'string', description: 'Dashboard ID' }, dashboardTitle: { type: 'string', description: 'Dashboard title' }, dashboardLayoutType: { type: 'string', description: 'Dashboard layout type' }, @@ -2470,7 +2442,6 @@ Return ONLY the search query string - no explanations.`, dashboardFilterDeleted: { type: 'boolean', description: 'Return only deleted dashboards' }, dashboardCount: { type: 'number', description: 'Max dashboards to return' }, dashboardStart: { type: 'number', description: 'Dashboard list offset' }, - // Synthetics syntheticsPublicId: { type: 'string', description: 'Synthetic test public ID' }, syntheticsPublicIds: { type: 'string', description: 'Synthetic test public IDs to trigger' }, syntheticsNewStatus: { type: 'string', description: 'New Synthetic test status' }, @@ -2479,7 +2450,6 @@ Return ONLY the search query string - no explanations.`, syntheticsProbeDc: { type: 'string', description: 'Locations to query results for' }, syntheticsPageSize: { type: 'number', description: 'Synthetic tests per page' }, syntheticsPageNumber: { type: 'number', description: 'Synthetic tests page number' }, - // Security monitoring signalId: { type: 'string', description: 'Security signal ID' }, signalState: { type: 'string', description: 'Security signal triage state' }, signalArchiveReason: { type: 'string', description: 'Archive reason' }, @@ -2495,7 +2465,6 @@ Return ONLY the search query string - no explanations.`, ruleSort: { type: 'string', description: 'Detection rule sort order' }, rulePageSize: { type: 'number', description: 'Detection rules per page' }, rulePageNumber: { type: 'number', description: 'Detection rules page number' }, - // APM spanQuery: { type: 'string', description: 'Span search query' }, spanFrom: { type: 'string', description: 'Span search window start' }, spanTo: { type: 'string', description: 'Span search window end' }, @@ -2509,41 +2478,32 @@ Return ONLY the search query string - no explanations.`, }, outputs: { success: { type: 'boolean', description: 'Whether the operation succeeded' }, - // Metrics series: { type: 'json', description: 'Timeseries data' }, status: { type: 'string', description: 'Query status' }, errors: { type: 'json', description: 'Metric series rejected during submission' }, - // Events event: { type: 'json', description: 'Event data' }, - // Monitors monitor: { type: 'json', description: 'Monitor data' }, monitors: { type: 'json', description: 'List of monitors' }, monitorId: { type: 'number', description: 'ID of the muted or unmuted monitor' }, name: { type: 'string', description: 'Name of the muted or unmuted monitor' }, overallState: { type: 'string', description: 'Monitor state after muting or unmuting' }, - // Logs logs: { type: 'json', description: 'Log entries' }, nextLogId: { type: 'string', description: 'Pagination cursor for logs' }, - // Downtimes downtime: { type: 'json', description: 'Downtime data' }, downtimes: { type: 'json', description: 'List of downtimes' }, totalCount: { type: 'number', description: 'Total downtimes matching the filter' }, - // Incidents incident: { type: 'json', description: 'Incident data' }, incidents: { type: 'json', description: 'List of incidents' }, nextOffset: { type: 'number', description: 'Offset for the next page of incidents' }, todo: { type: 'json', description: 'Incident follow-up task' }, - // SLOs slo: { type: 'json', description: 'Service level objective' }, slos: { type: 'json', description: 'List of service level objectives' }, history: { type: 'json', description: 'SLO history for the requested window' }, sliValue: { type: 'number', description: 'Overall SLI value over the window' }, deletedIds: { type: 'json', description: 'IDs of deleted service level objectives' }, - // Dashboards dashboard: { type: 'json', description: 'Dashboard definition' }, dashboards: { type: 'json', description: 'List of dashboard summaries' }, deletedDashboardId: { type: 'string', description: 'ID of the deleted dashboard' }, - // Synthetics test: { type: 'json', description: 'Synthetic test configuration' }, tests: { type: 'json', description: 'List of Synthetic tests' }, results: { type: 'json', description: 'Synthetic test run results' }, @@ -2551,12 +2511,10 @@ Return ONLY the search query string - no explanations.`, batchId: { type: 'string', description: 'Public ID of the triggered batch' }, triggeredCheckIds: { type: 'json', description: 'Public IDs of triggered tests' }, locations: { type: 'json', description: 'Locations the tests ran from' }, - // Security monitoring signal: { type: 'json', description: 'Security signal' }, signals: { type: 'json', description: 'List of security signals' }, rules: { type: 'json', description: 'List of detection rules' }, nextCursor: { type: 'string', description: 'Cursor for the next page of results' }, - // APM spans: { type: 'json', description: 'List of APM spans' }, elapsed: { type: 'number', description: 'Query time in milliseconds' }, services: { type: 'json', description: 'List of service definitions' }, diff --git a/apps/sim/blocks/blocks/dropbox.ts b/apps/sim/blocks/blocks/dropbox.ts index 572c47047d0..6f85ed4ea4f 100644 --- a/apps/sim/blocks/blocks/dropbox.ts +++ b/apps/sim/blocks/blocks/dropbox.ts @@ -116,7 +116,6 @@ export const DropboxBlock = { placeholder: 'Enter credential ID', required: true, }, - // Upload operation inputs { id: 'path', title: 'Destination Path', @@ -163,7 +162,6 @@ export const DropboxBlock = { type: 'switch', condition: { field: 'operation', value: 'dropbox_upload' }, }, - // Download operation inputs { id: 'path', title: 'File Path', @@ -172,7 +170,6 @@ export const DropboxBlock = { condition: { field: 'operation', value: 'dropbox_download' }, required: true, }, - // List folder operation inputs { id: 'path', title: 'Folder Path', @@ -194,7 +191,6 @@ export const DropboxBlock = { placeholder: '500', condition: { field: 'operation', value: 'dropbox_list_folder' }, }, - // Create folder operation inputs { id: 'path', title: 'Folder Path', @@ -209,7 +205,6 @@ export const DropboxBlock = { type: 'switch', condition: { field: 'operation', value: 'dropbox_create_folder' }, }, - // Delete operation inputs { id: 'path', title: 'Path to Delete', @@ -218,7 +213,6 @@ export const DropboxBlock = { condition: { field: 'operation', value: 'dropbox_delete' }, required: true, }, - // Copy operation inputs { id: 'fromPath', title: 'Source Path', @@ -241,7 +235,6 @@ export const DropboxBlock = { type: 'switch', condition: { field: 'operation', value: 'dropbox_copy' }, }, - // Move operation inputs { id: 'fromPath', title: 'Source Path', @@ -264,7 +257,6 @@ export const DropboxBlock = { type: 'switch', condition: { field: 'operation', value: 'dropbox_move' }, }, - // Get metadata operation inputs { id: 'path', title: 'File/Folder Path', @@ -279,7 +271,6 @@ export const DropboxBlock = { type: 'switch', condition: { field: 'operation', value: 'dropbox_get_metadata' }, }, - // Create shared link operation inputs { id: 'path', title: 'File/Folder Path', @@ -328,7 +319,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Search operation inputs { id: 'query', title: 'Search Query', @@ -358,7 +348,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, placeholder: '100', condition: { field: 'operation', value: 'dropbox_search' }, }, - // List shared links operation inputs { id: 'path', title: 'Path', @@ -381,7 +370,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'dropbox_list_shared_links' }, mode: 'advanced', }, - // List revisions operation inputs { id: 'path', title: 'File Path', @@ -406,7 +394,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'dropbox_list_revisions' }, mode: 'advanced', }, - // Restore operation inputs { id: 'path', title: 'File Path', @@ -488,63 +475,45 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, oauthCredential: { type: 'string', description: 'Dropbox OAuth credential' }, - // Common inputs path: { type: 'string', description: 'Path in Dropbox' }, autorename: { type: 'boolean', description: 'Auto-rename on conflict' }, - // Upload inputs file: { type: 'json', description: 'File to upload (canonical param)' }, fileName: { type: 'string', description: 'Optional filename' }, mode: { type: 'string', description: 'Write mode: add or overwrite' }, mute: { type: 'boolean', description: 'Mute notifications' }, - // List folder inputs recursive: { type: 'boolean', description: 'List recursively' }, includeDeleted: { type: 'boolean', description: 'Include deleted files' }, includeMediaInfo: { type: 'boolean', description: 'Include media info' }, limit: { type: 'number', description: 'Maximum results' }, - // Copy/Move inputs fromPath: { type: 'string', description: 'Source path' }, toPath: { type: 'string', description: 'Destination path' }, - // Shared link inputs requestedVisibility: { type: 'string', description: 'Link visibility' }, linkPassword: { type: 'string', description: 'Password for the link' }, expires: { type: 'string', description: 'Expiration date (ISO 8601)' }, - // Search inputs query: { type: 'string', description: 'Search query' }, fileExtensions: { type: 'string', description: 'File extensions filter' }, maxResults: { type: 'number', description: 'Maximum search results' }, - // List shared links inputs directOnly: { type: 'boolean', description: 'Only return direct links, not parent folders' }, cursor: { type: 'string', description: 'Fetch the next page of shared links (pagination)' }, - // List revisions input beforeRev: { type: 'string', description: 'Fetch revisions before this one (pagination)' }, - // Restore input rev: { type: 'string', description: 'Revision identifier to restore' }, }, outputs: { - // Upload/Download outputs file: { type: 'file', description: 'Downloaded file stored in execution files' }, content: { type: 'string', description: 'File content (base64)' }, temporaryLink: { type: 'string', description: 'Temporary download link' }, - // List folder / List revisions outputs entries: { type: 'json', description: 'List of files and folders (List Folder), or file revisions (List Revisions)', }, cursor: { type: 'string', description: 'Pagination cursor' }, hasMore: { type: 'boolean', description: 'Whether more results exist' }, - // Create folder output folder: { type: 'json', description: 'Created folder metadata' }, - // Delete output deleted: { type: 'boolean', description: 'Whether deletion was successful' }, - // Copy/Move/Get metadata output metadata: { type: 'json', description: 'Item metadata' }, - // Shared link output sharedLink: { type: 'json', description: 'Shared link details' }, - // Search outputs matches: { type: 'json', description: 'Search results' }, - // List shared links outputs links: { type: 'json', description: 'List of shared links (url, name, path_lower, expires)' }, - // List revisions output isDeleted: { type: 'boolean', description: 'Whether the latest revision is deleted or moved' }, }, } satisfies BlockConfig diff --git a/apps/sim/blocks/blocks/elasticsearch.ts b/apps/sim/blocks/blocks/elasticsearch.ts index 5777db503b2..bee72218d50 100644 --- a/apps/sim/blocks/blocks/elasticsearch.ts +++ b/apps/sim/blocks/blocks/elasticsearch.ts @@ -73,13 +73,11 @@ export const ElasticsearchBlock: BlockConfig = { }, }, subBlocks: [ - // Operation selector { id: 'operation', title: 'Operation', type: 'dropdown', options: [ - // Document Operations { label: 'Search', id: 'elasticsearch_search' }, { label: 'Index Document', id: 'elasticsearch_index_document' }, { label: 'Get Document', id: 'elasticsearch_get_document' }, @@ -87,19 +85,16 @@ export const ElasticsearchBlock: BlockConfig = { { label: 'Delete Document', id: 'elasticsearch_delete_document' }, { label: 'Bulk Operations', id: 'elasticsearch_bulk' }, { label: 'Count Documents', id: 'elasticsearch_count' }, - // Index Management { label: 'Create Index', id: 'elasticsearch_create_index' }, { label: 'Delete Index', id: 'elasticsearch_delete_index' }, { label: 'Get Index Info', id: 'elasticsearch_get_index' }, { label: 'List Indices', id: 'elasticsearch_list_indices' }, - // Cluster Operations { label: 'Cluster Health', id: 'elasticsearch_cluster_health' }, { label: 'Cluster Stats', id: 'elasticsearch_cluster_stats' }, ], value: () => 'elasticsearch_search', }, - // Deployment type { id: 'deploymentType', title: 'Deployment Type', @@ -111,7 +106,6 @@ export const ElasticsearchBlock: BlockConfig = { value: () => 'self_hosted', }, - // Self-hosted host { id: 'host', title: 'Elasticsearch Host', @@ -122,7 +116,6 @@ export const ElasticsearchBlock: BlockConfig = { dependsOn: ['deploymentType'], }, - // Cloud ID { id: 'cloudId', title: 'Cloud ID', @@ -133,7 +126,6 @@ export const ElasticsearchBlock: BlockConfig = { dependsOn: ['deploymentType'], }, - // Authentication method { id: 'authMethod', title: 'Authentication Method', @@ -145,7 +137,6 @@ export const ElasticsearchBlock: BlockConfig = { value: () => 'api_key', }, - // API Key { id: 'apiKey', title: 'API Key', @@ -157,7 +148,6 @@ export const ElasticsearchBlock: BlockConfig = { dependsOn: ['authMethod'], }, - // Username { id: 'username', title: 'Username', @@ -168,7 +158,6 @@ export const ElasticsearchBlock: BlockConfig = { dependsOn: ['authMethod'], }, - // Password { id: 'password', title: 'Password', @@ -180,7 +169,6 @@ export const ElasticsearchBlock: BlockConfig = { dependsOn: ['authMethod'], }, - // Index name - for most operations { id: 'index', title: 'Index Name', @@ -204,7 +192,6 @@ export const ElasticsearchBlock: BlockConfig = { }, }, - // Document ID - for get/update/delete { id: 'documentId', title: 'Document ID', @@ -221,7 +208,6 @@ export const ElasticsearchBlock: BlockConfig = { }, }, - // Optional Document ID - for index document { id: 'documentId', title: 'Document ID', @@ -230,7 +216,6 @@ export const ElasticsearchBlock: BlockConfig = { condition: { field: 'operation', value: 'elasticsearch_index_document' }, }, - // Document body - for index { id: 'document', title: 'Document', @@ -250,7 +235,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Document body - for update (partial) { id: 'document', title: 'Partial Document', @@ -269,7 +253,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Search query { id: 'query', title: 'Search Query', @@ -291,7 +274,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Count query { id: 'query', title: 'Query', @@ -312,7 +294,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Search size { id: 'size', title: 'Number of Results', @@ -321,7 +302,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, condition: { field: 'operation', value: 'elasticsearch_search' }, }, - // Search from (offset) { id: 'from', title: 'Offset', @@ -330,7 +310,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, condition: { field: 'operation', value: 'elasticsearch_search' }, }, - // Sort { id: 'sort', title: 'Sort', @@ -351,7 +330,6 @@ Return ONLY valid JSON array - no explanations, no markdown code blocks.`, }, }, - // Source includes { id: 'sourceIncludes', title: 'Fields to Include', @@ -363,7 +341,6 @@ Return ONLY valid JSON array - no explanations, no markdown code blocks.`, }, }, - // Source excludes { id: 'sourceExcludes', title: 'Fields to Exclude', @@ -375,7 +352,6 @@ Return ONLY valid JSON array - no explanations, no markdown code blocks.`, }, }, - // Bulk operations { id: 'operations', title: 'Bulk Operations', @@ -400,7 +376,6 @@ Return ONLY the NDJSON content - no explanations, no markdown code blocks.`, }, }, - // Index settings { id: 'settings', title: 'Index Settings', @@ -422,7 +397,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Index mappings { id: 'mappings', title: 'Index Mappings', @@ -446,7 +420,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Refresh option { id: 'refresh', title: 'Refresh', @@ -468,7 +441,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, }, - // Cluster health wait for status { id: 'waitForStatus', title: 'Wait for Status', @@ -495,7 +467,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, condition: { field: 'operation', value: 'elasticsearch_cluster_health' }, }, - // Include system indices { id: 'includeSystemIndices', title: 'Include System Indices', @@ -509,7 +480,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, condition: { field: 'operation', value: 'elasticsearch_list_indices' }, }, - // Retry on conflict { id: 'retryOnConflict', title: 'Retry on Conflict', @@ -537,7 +507,6 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, ], config: { tool: (params) => { - // Return the operation as the tool ID return params.operation || 'elasticsearch_search' }, params: (params) => { @@ -594,32 +563,25 @@ Return ONLY valid JSON - no explanations, no markdown code blocks.`, }, outputs: { - // Search outputs hits: { type: 'json', description: 'Search results' }, took: { type: 'number', description: 'Time taken in milliseconds' }, timed_out: { type: 'boolean', description: 'Whether the operation timed out' }, aggregations: { type: 'json', description: 'Aggregation results' }, - // Document outputs _index: { type: 'string', description: 'Index name' }, _id: { type: 'string', description: 'Document ID' }, _version: { type: 'number', description: 'Document version' }, _source: { type: 'json', description: 'Document content' }, result: { type: 'string', description: 'Operation result' }, found: { type: 'boolean', description: 'Whether document was found' }, - // Bulk outputs errors: { type: 'boolean', description: 'Whether any errors occurred' }, items: { type: 'json', description: 'Bulk operation results' }, - // Count outputs count: { type: 'number', description: 'Document count' }, _shards: { type: 'json', description: 'Shard statistics (total, successful, skipped, failed)', }, - // Index outputs acknowledged: { type: 'boolean', description: 'Whether operation was acknowledged' }, - // List indices outputs message: { type: 'string', description: 'Summary message about the indices listed' }, - // Cluster outputs cluster_name: { type: 'string', description: 'Cluster name' }, status: { type: 'string', description: 'Cluster health status' }, number_of_nodes: { type: 'number', description: 'Number of nodes' }, diff --git a/apps/sim/blocks/blocks/enrow.ts b/apps/sim/blocks/blocks/enrow.ts index d55d362bffe..0918c8c6378 100644 --- a/apps/sim/blocks/blocks/enrow.ts +++ b/apps/sim/blocks/blocks/enrow.ts @@ -38,7 +38,7 @@ export const EnrowBlock: BlockConfig = { value: () => 'enrow_find_email', }, - // --- Find Email --- + // Find Email { id: 'fullname', title: 'Full Name', @@ -64,7 +64,7 @@ export const EnrowBlock: BlockConfig = { mode: 'advanced', }, - // --- Verify Email --- + // Verify Email { id: 've_email', title: 'Email Address', @@ -74,7 +74,7 @@ export const EnrowBlock: BlockConfig = { condition: { field: 'operation', value: 'enrow_verify_email' }, }, - // --- API Key (hidden on hosted Sim for operations with hosted-key support) --- + // API Key (hidden on hosted Sim for operations with hosted-key support) { id: 'apiKey', title: 'API Key', diff --git a/apps/sim/blocks/blocks/github.ts b/apps/sim/blocks/blocks/github.ts index ba9294c3e71..a3eca3978b2 100644 --- a/apps/sim/blocks/blocks/github.ts +++ b/apps/sim/blocks/blocks/github.ts @@ -381,13 +381,11 @@ export const GitHubBlock: BlockConfig = { { label: 'Create PR comment', id: 'github_comment' }, { label: 'Get repository info', id: 'github_repo_info' }, { label: 'Get latest commit', id: 'github_latest_commit' }, - // Comment Operations { label: 'Create issue comment', id: 'github_issue_comment' }, { label: 'List issue comments', id: 'github_list_issue_comments' }, { label: 'Update comment', id: 'github_update_comment' }, { label: 'Delete comment', id: 'github_delete_comment' }, { label: 'List PR comments', id: 'github_list_pr_comments' }, - // Pull Request Operations { label: 'Create pull request', id: 'github_create_pr' }, { label: 'Update pull request', id: 'github_update_pr' }, { label: 'Merge pull request', id: 'github_merge_pr' }, @@ -396,7 +394,6 @@ export const GitHubBlock: BlockConfig = { { label: 'Close pull request', id: 'github_close_pr' }, { label: 'Request PR reviewers', id: 'github_request_reviewers' }, { label: 'Create PR review', id: 'github_create_pr_review' }, - // File Operations { label: 'Get file content', id: 'github_get_file_content' }, { label: 'Create file', id: 'github_create_file' }, { label: 'Update file', id: 'github_update_file' }, @@ -404,14 +401,12 @@ export const GitHubBlock: BlockConfig = { { label: 'Get directory tree', id: 'github_get_tree' }, { label: 'Get README', id: 'github_get_readme' }, { label: 'List tags', id: 'github_list_tags' }, - // Branch Operations { label: 'List branches', id: 'github_list_branches' }, { label: 'Get branch', id: 'github_get_branch' }, { label: 'Create branch', id: 'github_create_branch' }, { label: 'Delete branch', id: 'github_delete_branch' }, { label: 'Get branch protection', id: 'github_get_branch_protection' }, { label: 'Update branch protection', id: 'github_update_branch_protection' }, - // Issue Operations { label: 'Create issue', id: 'github_create_issue' }, { label: 'Update issue', id: 'github_update_issue' }, { label: 'List issues', id: 'github_list_issues' }, @@ -420,14 +415,12 @@ export const GitHubBlock: BlockConfig = { { label: 'Add issue labels', id: 'github_add_labels' }, { label: 'Remove issue label', id: 'github_remove_label' }, { label: 'Add issue assignees', id: 'github_add_assignees' }, - // Release Operations { label: 'Create release', id: 'github_create_release' }, { label: 'Update release', id: 'github_update_release' }, { label: 'List releases', id: 'github_list_releases' }, { label: 'Get release', id: 'github_get_release' }, { label: 'Get latest release', id: 'github_get_latest_release' }, { label: 'Delete release', id: 'github_delete_release' }, - // Workflow Operations { label: 'List workflows', id: 'github_list_workflows' }, { label: 'Get workflow', id: 'github_get_workflow' }, { label: 'Trigger workflow', id: 'github_trigger_workflow' }, @@ -435,23 +428,19 @@ export const GitHubBlock: BlockConfig = { { label: 'Get workflow run', id: 'github_get_workflow_run' }, { label: 'Cancel workflow run', id: 'github_cancel_workflow_run' }, { label: 'Rerun workflow', id: 'github_rerun_workflow' }, - // Project Operations { label: 'List projects', id: 'github_list_projects' }, { label: 'Get project', id: 'github_get_project' }, { label: 'Create project', id: 'github_create_project' }, { label: 'Update project', id: 'github_update_project' }, { label: 'Delete project', id: 'github_delete_project' }, - // Search Operations { label: 'Search code', id: 'github_search_code' }, { label: 'Search commits', id: 'github_search_commits' }, { label: 'Search issues', id: 'github_search_issues' }, { label: 'Search repositories', id: 'github_search_repos' }, { label: 'Search users', id: 'github_search_users' }, - // Commit Operations { label: 'List commits', id: 'github_list_commits' }, { label: 'Get commit', id: 'github_get_commit' }, { label: 'Compare commits', id: 'github_compare_commits' }, - // Gist Operations { label: 'Create gist', id: 'github_create_gist' }, { label: 'Get gist', id: 'github_get_gist' }, { label: 'List gists', id: 'github_list_gists' }, @@ -460,21 +449,17 @@ export const GitHubBlock: BlockConfig = { { label: 'Fork gist', id: 'github_fork_gist' }, { label: 'Star gist', id: 'github_star_gist' }, { label: 'Unstar gist', id: 'github_unstar_gist' }, - // Fork Operations { label: 'Fork repository', id: 'github_fork_repo' }, { label: 'List forks', id: 'github_list_forks' }, - // Milestone Operations { label: 'Create milestone', id: 'github_create_milestone' }, { label: 'Get milestone', id: 'github_get_milestone' }, { label: 'List milestones', id: 'github_list_milestones' }, { label: 'Update milestone', id: 'github_update_milestone' }, { label: 'Delete milestone', id: 'github_delete_milestone' }, - // Reaction Operations { label: 'Add issue reaction', id: 'github_create_issue_reaction' }, { label: 'Remove issue reaction', id: 'github_delete_issue_reaction' }, { label: 'Add comment reaction', id: 'github_create_comment_reaction' }, { label: 'Remove comment reaction', id: 'github_delete_comment_reaction' }, - // Star Operations { label: 'Star repository', id: 'github_star_repo' }, { label: 'Unstar repository', id: 'github_unstar_repo' }, { label: 'Check if starred', id: 'github_check_star' }, @@ -528,7 +513,6 @@ export const GitHubBlock: BlockConfig = { condition: { field: 'operation', value: 'github_latest_commit' }, mode: 'advanced', }, - // Comment operations parameters { id: 'issue_number', title: 'Issue Number', @@ -601,7 +585,6 @@ export const GitHubBlock: BlockConfig = { condition: { field: 'operation', value: 'github_list_pr_comments' }, mode: 'advanced', }, - // Pull request operations parameters { id: 'title', title: 'PR Title', @@ -768,7 +751,6 @@ export const GitHubBlock: BlockConfig = { condition: { field: 'operation', value: 'github_request_reviewers' }, mode: 'advanced', }, - // File operations parameters { id: 'path', title: 'File Path', @@ -905,7 +887,6 @@ export const GitHubBlock: BlockConfig = { condition: { field: 'operation', value: 'github_get_tree' }, mode: 'advanced', }, - // Branch operations parameters { id: 'protected', title: 'Filter by Protection', @@ -1001,7 +982,6 @@ export const GitHubBlock: BlockConfig = { condition: { field: 'operation', value: 'github_update_branch_protection' }, mode: 'advanced', }, - // Issue operations parameters { id: 'title', title: 'Issue Title', @@ -1153,7 +1133,6 @@ export const GitHubBlock: BlockConfig = { required: true, condition: { field: 'operation', value: 'github_add_assignees' }, }, - // Release operations parameters { id: 'tag_name', title: 'Tag Name', @@ -1256,7 +1235,6 @@ export const GitHubBlock: BlockConfig = { required: true, condition: { field: 'operation', value: 'github_delete_release' }, }, - // Workflow operations parameters { id: 'per_page', title: 'Results Per Page', @@ -1350,7 +1328,6 @@ export const GitHubBlock: BlockConfig = { required: true, condition: { field: 'operation', value: 'github_rerun_workflow' }, }, - // Project operations parameters { id: 'owner_login', title: 'Owner Login', @@ -1448,7 +1425,6 @@ export const GitHubBlock: BlockConfig = { required: true, condition: { field: 'operation', value: 'github_delete_project' }, }, - // Search operations parameters { id: 'q', title: 'Search Query', @@ -1517,7 +1493,6 @@ Return ONLY the search query - no explanations.`, }, mode: 'advanced', }, - // Commit operations parameters { id: 'sha', title: 'SHA or Branch', @@ -1603,7 +1578,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, required: true, condition: { field: 'operation', value: 'github_compare_commits' }, }, - // Gist operations parameters { id: 'gist_id', title: 'Gist ID', @@ -1695,7 +1669,6 @@ Return ONLY valid JSON - no explanations, no markdown formatting.`, condition: { field: 'operation', value: 'github_list_gists' }, mode: 'advanced', }, - // Fork operations parameters { id: 'organization', title: 'Organization', @@ -1736,7 +1709,6 @@ Return ONLY valid JSON - no explanations, no markdown formatting.`, condition: { field: 'operation', value: 'github_list_forks' }, mode: 'advanced', }, - // Milestone operations parameters { id: 'milestone_title', title: 'Milestone Title', @@ -1824,7 +1796,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'github_list_milestones' }, mode: 'advanced', }, - // Reaction operations parameters { id: 'reaction_content', title: 'Reaction', @@ -1878,7 +1849,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, value: ['github_create_comment_reaction', 'github_delete_comment_reaction'], }, }, - // Star operations parameters - owner/repo already covered by existing subBlocks + // Star operations reuse the existing owner/repo subBlocks { id: 'per_page', title: 'Results Per Page', @@ -1961,7 +1932,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // Create PR review parameters { id: 'pullNumber', title: 'Pull Request Number', @@ -1997,7 +1967,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'github_create_pr_review' }, mode: 'advanced', }, - // Get README parameters { id: 'ref', title: 'Git Reference', @@ -2006,7 +1975,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'github_get_readme' }, mode: 'advanced', }, - // List tags parameters { id: 'per_page', title: 'Results Per Page', @@ -2030,13 +1998,11 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'github_comment', 'github_repo_info', 'github_latest_commit', - // Comment tools 'github_issue_comment', 'github_list_issue_comments', 'github_update_comment', 'github_delete_comment', 'github_list_pr_comments', - // Pull request tools 'github_create_pr', 'github_update_pr', 'github_merge_pr', @@ -2045,7 +2011,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'github_close_pr', 'github_request_reviewers', 'github_create_pr_review', - // File tools 'github_get_file_content', 'github_create_file', 'github_update_file', @@ -2053,14 +2018,12 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'github_get_tree', 'github_get_readme', 'github_list_tags', - // Branch tools 'github_list_branches', 'github_get_branch', 'github_create_branch', 'github_delete_branch', 'github_get_branch_protection', 'github_update_branch_protection', - // Issue tools 'github_create_issue', 'github_update_issue', 'github_list_issues', @@ -2069,14 +2032,12 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'github_add_labels', 'github_remove_label', 'github_add_assignees', - // Release tools 'github_create_release', 'github_update_release', 'github_list_releases', 'github_get_release', 'github_get_latest_release', 'github_delete_release', - // Workflow tools 'github_list_workflows', 'github_get_workflow', 'github_trigger_workflow', @@ -2084,23 +2045,19 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'github_get_workflow_run', 'github_cancel_workflow_run', 'github_rerun_workflow', - // Project tools 'github_list_projects', 'github_get_project', 'github_create_project', 'github_update_project', 'github_delete_project', - // Search tools 'github_search_code', 'github_search_commits', 'github_search_issues', 'github_search_repos', 'github_search_users', - // Commit tools 'github_list_commits', 'github_get_commit', 'github_compare_commits', - // Gist tools 'github_create_gist', 'github_get_gist', 'github_list_gists', @@ -2109,21 +2066,17 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'github_fork_gist', 'github_star_gist', 'github_unstar_gist', - // Fork tools 'github_fork_repo', 'github_list_forks', - // Milestone tools 'github_create_milestone', 'github_get_milestone', 'github_list_milestones', 'github_update_milestone', 'github_delete_milestone', - // Reaction tools 'github_create_issue_reaction', 'github_delete_issue_reaction', 'github_create_comment_reaction', 'github_delete_comment_reaction', - // Star tools 'github_star_repo', 'github_unstar_repo', 'github_check_star', @@ -2140,7 +2093,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_repo_info' case 'github_latest_commit': return 'github_latest_commit' - // Comment operations case 'github_issue_comment': return 'github_issue_comment' case 'github_list_issue_comments': @@ -2151,7 +2103,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_delete_comment' case 'github_list_pr_comments': return 'github_list_pr_comments' - // Pull request operations case 'github_create_pr': return 'github_create_pr' case 'github_update_pr': @@ -2168,7 +2119,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_request_reviewers' case 'github_create_pr_review': return 'github_create_pr_review' - // File operations case 'github_get_file_content': return 'github_get_file_content' case 'github_create_file': @@ -2183,7 +2133,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_get_readme' case 'github_list_tags': return 'github_list_tags' - // Branch operations case 'github_list_branches': return 'github_list_branches' case 'github_get_branch': @@ -2196,7 +2145,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_get_branch_protection' case 'github_update_branch_protection': return 'github_update_branch_protection' - // Issue operations case 'github_create_issue': return 'github_create_issue' case 'github_update_issue': @@ -2213,7 +2161,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_remove_label' case 'github_add_assignees': return 'github_add_assignees' - // Release operations case 'github_create_release': return 'github_create_release' case 'github_update_release': @@ -2226,7 +2173,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_get_latest_release' case 'github_delete_release': return 'github_delete_release' - // Workflow operations case 'github_list_workflows': return 'github_list_workflows' case 'github_get_workflow': @@ -2241,7 +2187,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_cancel_workflow_run' case 'github_rerun_workflow': return 'github_rerun_workflow' - // Project operations case 'github_list_projects': return 'github_list_projects' case 'github_get_project': @@ -2252,7 +2197,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_update_project' case 'github_delete_project': return 'github_delete_project' - // Search operations case 'github_search_code': return 'github_search_code' case 'github_search_commits': @@ -2263,14 +2207,12 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_search_repos' case 'github_search_users': return 'github_search_users' - // Commit operations case 'github_list_commits': return 'github_list_commits' case 'github_get_commit': return 'github_get_commit' case 'github_compare_commits': return 'github_compare_commits' - // Gist operations case 'github_create_gist': return 'github_create_gist' case 'github_get_gist': @@ -2287,12 +2229,10 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_star_gist' case 'github_unstar_gist': return 'github_unstar_gist' - // Fork operations case 'github_fork_repo': return 'github_fork_repo' case 'github_list_forks': return 'github_list_forks' - // Milestone operations case 'github_create_milestone': return 'github_create_milestone' case 'github_get_milestone': @@ -2303,7 +2243,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_update_milestone' case 'github_delete_milestone': return 'github_delete_milestone' - // Reaction operations case 'github_create_issue_reaction': return 'github_create_issue_reaction' case 'github_delete_issue_reaction': @@ -2312,7 +2251,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, return 'github_create_comment_reaction' case 'github_delete_comment_reaction': return 'github_delete_comment_reaction' - // Star operations case 'github_star_repo': return 'github_star_repo' case 'github_unstar_repo': @@ -2392,11 +2330,9 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, side: { type: 'string', description: 'Comment side' }, commitId: { type: 'string', description: 'Commit identifier' }, branch: { type: 'string', description: 'Branch name' }, - // Comment parameters issue_number: { type: 'number', description: 'Issue number' }, comment_id: { type: 'number', description: 'Comment ID' }, per_page: { type: 'number', description: 'Results per page' }, - // Pull request parameters title: { type: 'string', description: 'Title' }, head: { type: 'string', description: 'Head branch' }, base: { type: 'string', description: 'Base branch' }, @@ -2408,68 +2344,55 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, team_reviewers: { type: 'string', description: 'Team reviewer slugs' }, event: { type: 'string', description: 'PR review action' }, commit_id: { type: 'string', description: 'Commit SHA' }, - // File parameters content: { type: 'string', description: 'File content' }, message: { type: 'string', description: 'Commit message' }, sha: { type: 'string', description: 'File or commit SHA' }, ref: { type: 'string', description: 'Branch, tag, or commit reference' }, - // Branch parameters protected: { type: 'string', description: 'Protection status filter' }, required_status_checks: { type: 'json', description: 'Required status checks JSON' }, enforce_admins: { type: 'boolean', description: 'Enforce for admins' }, required_pull_request_reviews: { type: 'json', description: 'Required PR reviews JSON' }, restrictions: { type: 'json', description: 'Push restrictions JSON' }, - // Issue parameters labels: { type: 'string', description: 'Comma-separated labels' }, assignees: { type: 'string', description: 'Comma-separated assignees' }, name: { type: 'string', description: 'Label or release name' }, - // Release parameters tag_name: { type: 'string', description: 'Release tag name' }, release_id: { type: 'number', description: 'Release ID' }, prerelease: { type: 'boolean', description: 'Prerelease status' }, - // Workflow parameters workflow_id: { type: 'string', description: 'Workflow ID or filename' }, run_id: { type: 'number', description: 'Workflow run ID' }, status: { type: 'string', description: 'Status filter' }, inputs: { type: 'string', description: 'Workflow inputs JSON' }, - // Project parameters owner_login: { type: 'string', description: 'Owner login' }, owner_type: { type: 'string', description: 'Owner type (user or org)' }, owner_id: { type: 'string', description: 'Owner node ID' }, project_number: { type: 'number', description: 'Project number' }, project_id: { type: 'string', description: 'Project node ID' }, project_public: { type: 'boolean', description: 'Project public status' }, - // Search parameters q: { type: 'string', description: 'Search query with qualifiers' }, sort: { type: 'string', description: 'Sort field' }, order: { type: 'string', description: 'Sort order (asc or desc)' }, - // Commit parameters author: { type: 'string', description: 'Author filter' }, committer: { type: 'string', description: 'Committer filter' }, since: { type: 'string', description: 'Date filter (since)' }, until: { type: 'string', description: 'Date filter (until)' }, - // Gist parameters gist_id: { type: 'string', description: 'Gist ID' }, description: { type: 'string', description: 'Description' }, files: { type: 'string', description: 'Files JSON object' }, gist_public: { type: 'boolean', description: 'Public gist status' }, username: { type: 'string', description: 'GitHub username' }, - // Fork parameters organization: { type: 'string', description: 'Target organization for fork' }, fork_name: { type: 'string', description: 'Custom name for fork' }, default_branch_only: { type: 'boolean', description: 'Fork only default branch' }, fork_sort: { type: 'string', description: 'Fork list sort field' }, - // Milestone parameters milestone_title: { type: 'string', description: 'Milestone title' }, milestone_description: { type: 'string', description: 'Milestone description' }, due_on: { type: 'string', description: 'Milestone due date' }, milestone_number: { type: 'number', description: 'Milestone number' }, milestone_state: { type: 'string', description: 'Milestone state filter' }, milestone_sort: { type: 'string', description: 'Milestone sort field' }, - // Reaction parameters reaction_content: { type: 'string', description: 'Reaction type' }, reaction_id: { type: 'number', description: 'Reaction ID' }, - // Pagination parameters page: { type: 'number', description: 'Page number for pagination' }, }, outputs: { @@ -2535,7 +2458,7 @@ export const GitHubV2Block: BlockConfig = { outputs: { data: { type: 'json', description: 'Operation result data (API-aligned)' }, - // Trigger outputs (unchanged) + // Trigger outputs action: { type: 'string', description: 'The action that was performed' }, event_type: { type: 'string', description: 'Type of GitHub event' }, repository: { type: 'string', description: 'Repository full name' }, diff --git a/apps/sim/blocks/blocks/gitlab.ts b/apps/sim/blocks/blocks/gitlab.ts index 99632479cbc..bcb108281d7 100644 --- a/apps/sim/blocks/blocks/gitlab.ts +++ b/apps/sim/blocks/blocks/gitlab.ts @@ -401,33 +401,27 @@ export const GitLabBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Project Operations { label: 'List Projects', id: 'gitlab_list_projects' }, { label: 'Get Project', id: 'gitlab_get_project' }, - // Group Operations { label: 'List Groups', id: 'gitlab_list_groups' }, { label: 'Get Group', id: 'gitlab_get_group' }, - // Issue Operations { label: 'List Issues', id: 'gitlab_list_issues' }, { label: 'Get Issue', id: 'gitlab_get_issue' }, { label: 'Create Issue', id: 'gitlab_create_issue' }, { label: 'Update Issue', id: 'gitlab_update_issue' }, { label: 'Delete Issue', id: 'gitlab_delete_issue' }, { label: 'Add Issue Comment', id: 'gitlab_create_issue_note' }, - // Merge Request Operations { label: 'List Merge Requests', id: 'gitlab_list_merge_requests' }, { label: 'Get Merge Request', id: 'gitlab_get_merge_request' }, { label: 'Create Merge Request', id: 'gitlab_create_merge_request' }, { label: 'Update Merge Request', id: 'gitlab_update_merge_request' }, { label: 'Merge Merge Request', id: 'gitlab_merge_merge_request' }, { label: 'Add MR Comment', id: 'gitlab_create_merge_request_note' }, - // Pipeline Operations { label: 'List Pipelines', id: 'gitlab_list_pipelines' }, { label: 'Get Pipeline', id: 'gitlab_get_pipeline' }, { label: 'Create Pipeline', id: 'gitlab_create_pipeline' }, { label: 'Retry Pipeline', id: 'gitlab_retry_pipeline' }, { label: 'Cancel Pipeline', id: 'gitlab_cancel_pipeline' }, - // Repository Operations { label: 'List Repository Tree', id: 'gitlab_list_repository_tree' }, { label: 'Get File', id: 'gitlab_get_file' }, { label: 'Create File', id: 'gitlab_create_file' }, @@ -437,17 +431,13 @@ export const GitLabBlock: BlockConfig = { { label: 'Create Branch', id: 'gitlab_create_branch' }, { label: 'Delete Branch', id: 'gitlab_delete_branch' }, { label: 'Compare Branches', id: 'gitlab_compare_branches' }, - // Additional Merge Request Operations { label: 'Get MR Changes', id: 'gitlab_get_merge_request_changes' }, { label: 'Approve Merge Request', id: 'gitlab_approve_merge_request' }, - // Job Operations { label: 'List Pipeline Jobs', id: 'gitlab_list_pipeline_jobs' }, { label: 'Get Job Log', id: 'gitlab_get_job_log' }, { label: 'Play Job', id: 'gitlab_play_job' }, - // Release Operations { label: 'List Releases', id: 'gitlab_list_releases' }, { label: 'Create Release', id: 'gitlab_create_release' }, - // Access / Membership Operations { label: 'List Members', id: 'gitlab_list_members' }, { label: 'Add Member', id: 'gitlab_add_member' }, { label: 'Update Member', id: 'gitlab_update_member' }, @@ -488,7 +478,6 @@ export const GitLabBlock: BlockConfig = { password: true, required: true, }, - // Self-managed GitLab host (defaults to gitlab.com) { id: 'host', title: 'GitLab Host', @@ -497,7 +486,6 @@ export const GitLabBlock: BlockConfig = { mode: 'advanced', description: 'Self-managed GitLab host. Leave blank for gitlab.com.', }, - // Project ID (required for most operations) { id: 'projectId', title: 'Project ID', @@ -580,7 +568,6 @@ export const GitLabBlock: BlockConfig = { ], }, }, - // Pipeline ID { id: 'pipelineId', title: 'Pipeline ID', @@ -597,7 +584,6 @@ export const GitLabBlock: BlockConfig = { ], }, }, - // Title (for issue/MR creation) { id: 'title', title: 'Title', @@ -617,7 +603,6 @@ Return ONLY the title - no explanations, no extra text.`, placeholder: 'Describe the issue or merge request...', }, }, - // Description { id: 'description', title: 'Description', @@ -649,7 +634,6 @@ Return ONLY the description - no explanations outside the content.`, placeholder: 'Describe the content in detail...', }, }, - // Comment body { id: 'body', title: 'Comment', @@ -670,7 +654,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, placeholder: 'Describe the comment you want to write...', }, }, - // Source branch (for MR creation) { id: 'sourceBranch', title: 'Source Branch', @@ -682,7 +665,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, value: ['gitlab_create_merge_request'], }, }, - // Target branch (for MR creation) { id: 'targetBranch', title: 'Target Branch', @@ -694,7 +676,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, value: ['gitlab_create_merge_request'], }, }, - // Ref (for pipeline creation) { id: 'ref', title: 'Branch/Tag', @@ -716,7 +697,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, ], }, }, - // File Path { id: 'filePath', title: 'File Path', @@ -728,7 +708,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, value: ['gitlab_get_file', 'gitlab_create_file', 'gitlab_update_file'], }, }, - // Branch { id: 'branch', title: 'Branch', @@ -745,7 +724,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, ], }, }, - // Compare from ref { id: 'compareFrom', title: 'From', @@ -758,7 +736,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, value: ['gitlab_compare_branches'], }, }, - // Compare to ref { id: 'compareTo', title: 'To', @@ -770,7 +747,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, value: ['gitlab_compare_branches'], }, }, - // Compare directly instead of using merge base { id: 'straight', title: 'Compare Directly', @@ -781,7 +757,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, value: ['gitlab_compare_branches'], }, }, - // Release tag name { id: 'tagName', title: 'Tag Name', @@ -793,7 +768,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, value: ['gitlab_create_release'], }, }, - // Release name { id: 'releaseName', title: 'Release Name', @@ -804,7 +778,6 @@ Return ONLY the comment text - no explanations, no extra formatting.`, value: ['gitlab_create_release'], }, }, - // Release date { id: 'releasedAt', title: 'Released At', @@ -824,7 +797,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, placeholder: 'Describe when the release happened...', }, }, - // Release milestones { id: 'releaseMilestones', title: 'Milestones', @@ -836,7 +808,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_create_release'], }, }, - // File Content { id: 'content', title: 'File Content', @@ -848,7 +819,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_create_file', 'gitlab_update_file'], }, }, - // Commit Message { id: 'commitMessage', title: 'Commit Message', @@ -860,7 +830,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_create_file', 'gitlab_update_file'], }, }, - // Job ID { id: 'jobId', title: 'Job ID', @@ -872,7 +841,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_get_job_log', 'gitlab_play_job'], }, }, - // Subdirectory path (for repository tree) { id: 'path', title: 'Path', @@ -884,7 +852,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_repository_tree', 'gitlab_list_commits'], }, }, - // Recursive tree listing { id: 'recursive', title: 'Recursive', @@ -895,7 +862,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_repository_tree'], }, }, - // Ref name filter (for list commits) { id: 'refName', title: 'Ref (branch/tag)', @@ -907,7 +873,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_commits'], }, }, - // Commit time range filters { id: 'since', title: 'Since', @@ -946,7 +911,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, placeholder: 'Describe the end of the time range...', }, }, - // Commit author filter { id: 'author', title: 'Author', @@ -958,7 +922,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_commits'], }, }, - // Optimistic-locking guard (update file) { id: 'lastCommitId', title: 'Last Commit ID', @@ -970,7 +933,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_update_file'], }, }, - // Include retried jobs (list pipeline jobs) { id: 'includeRetried', title: 'Include Retried Jobs', @@ -981,7 +943,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_pipeline_jobs'], }, }, - // Job scope filter (for list pipeline jobs) { id: 'scope', title: 'Job Scope', @@ -1008,7 +969,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_pipeline_jobs'], }, }, - // Commit SHA (for approve merge request) { id: 'sha', title: 'Commit SHA', @@ -1020,7 +980,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_approve_merge_request'], }, }, - // Labels { id: 'labels', title: 'Labels', @@ -1039,7 +998,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, ], }, }, - // Assignee IDs { id: 'assigneeIds', title: 'Assignee IDs', @@ -1056,7 +1014,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, ], }, }, - // Milestone ID { id: 'milestoneId', title: 'Milestone ID', @@ -1073,7 +1030,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, ], }, }, - // State filter for issues { id: 'issueState', title: 'State', @@ -1090,7 +1046,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_issues'], }, }, - // State filter for merge requests { id: 'mrState', title: 'State', @@ -1108,7 +1063,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_merge_requests'], }, }, - // State event (for updates) { id: 'stateEvent', title: 'State Event', @@ -1125,7 +1079,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_update_issue', 'gitlab_update_merge_request'], }, }, - // Pipeline status filter { id: 'pipelineStatus', title: 'Pipeline Status', @@ -1152,7 +1105,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_list_pipelines'], }, }, - // Remove source branch after merge { id: 'removeSourceBranch', title: 'Remove Source Branch', @@ -1197,7 +1149,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_update_merge_request'], }, }, - // Squash commits { id: 'squash', title: 'Squash Commits', @@ -1208,7 +1159,6 @@ Return ONLY the timestamp string - no explanations, no extra text.`, value: ['gitlab_create_merge_request', 'gitlab_merge_merge_request'], }, }, - // Merge commit message { id: 'mergeCommitMessage', title: 'Merge Commit Message', @@ -1228,7 +1178,6 @@ Return ONLY the commit message - no explanations, no extra text.`, placeholder: 'Describe the merge...', }, }, - // Search filter (projects and issues listings) { id: 'searchQuery', title: 'Search', @@ -1240,7 +1189,6 @@ Return ONLY the commit message - no explanations, no extra text.`, value: ['gitlab_list_projects', 'gitlab_list_groups', 'gitlab_list_issues'], }, }, - // List-projects / list-groups filters { id: 'owned', title: 'Owned Only', @@ -1319,7 +1267,6 @@ Return ONLY the commit message - no explanations, no extra text.`, value: ['gitlab_list_projects', 'gitlab_list_groups'], }, }, - // List-issues filters { id: 'assigneeId', title: 'Assignee ID', @@ -1342,7 +1289,6 @@ Return ONLY the commit message - no explanations, no extra text.`, value: ['gitlab_list_issues'], }, }, - // List-MRs branch filters { id: 'sourceBranchFilter', title: 'Source Branch', @@ -1365,7 +1311,6 @@ Return ONLY the commit message - no explanations, no extra text.`, value: ['gitlab_list_merge_requests'], }, }, - // Per-domain sort fields { id: 'projectOrderBy', title: 'Order By', @@ -1507,7 +1452,6 @@ Return ONLY the commit message - no explanations, no extra text.`, ], }, }, - // Pipeline variables and inputs (create pipeline) { id: 'pipelineVariables', title: 'Pipeline Variables', @@ -1544,7 +1488,6 @@ Return ONLY the JSON - no explanations, no extra text.`, placeholder: 'Describe the pipeline inputs...', }, }, - // Manual job variables (play job) { id: 'jobVariables', title: 'Job Variables', @@ -1563,7 +1506,6 @@ Return ONLY the JSON - no explanations, no extra text.`, placeholder: 'Describe the job variables...', }, }, - // Release extras { id: 'tagMessage', title: 'Tag Message', @@ -1593,7 +1535,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, placeholder: 'Describe the release assets...', }, }, - // Commit authoring options (create/update file) { id: 'startBranch', title: 'Start Branch', @@ -1643,7 +1584,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_create_file', 'gitlab_update_file'], }, }, - // Cross-fork compare options { id: 'fromProjectId', title: 'From Project ID', @@ -1666,7 +1606,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_compare_branches'], }, }, - // Internal note toggle (comments) { id: 'internalNote', title: 'Internal Note', @@ -1678,7 +1617,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_create_issue_note', 'gitlab_create_merge_request_note'], }, }, - // Per page (pagination) { id: 'perPage', title: 'Results Per Page', @@ -1706,7 +1644,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, ], }, }, - // Page number { id: 'page', title: 'Page Number', @@ -1734,7 +1671,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, ], }, }, - // Resource type (project or group) for access/membership operations { id: 'resourceType', title: 'Resource Type', @@ -1750,7 +1686,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: RESOURCE_SCOPED_OPS, }, }, - // Project / group ID for access/membership operations { id: 'resourceId', title: 'Project / Group ID', @@ -1762,7 +1697,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: RESOURCE_SCOPED_OPS, }, }, - // Group ID for SAML group link operations (group-scoped only) { id: 'groupId', title: 'Group ID', @@ -1774,7 +1708,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: GROUP_ID_OPS, }, }, - // User ID (member target or admin user target) { id: 'userId', title: 'User ID', @@ -1801,7 +1734,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_add_member'], }, }, - // Membership source filter for List User Memberships { id: 'membershipType', title: 'Membership Type', @@ -1864,7 +1796,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_update_invitation'], }, }, - // Access expiration date (first-class time-boxed grants) { id: 'expiresAt', title: 'Expires At', @@ -1888,7 +1819,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_update_member', 'gitlab_update_invitation'], }, }, - // Custom member role ID (GitLab Ultimate) { id: 'memberRoleId', title: 'Member Role ID', @@ -1900,7 +1830,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: MEMBER_ROLE_OPS, }, }, - // Email address (invitations) { id: 'email', title: 'Email', @@ -1912,7 +1841,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: EMAIL_OPS, }, }, - // Filter for member / invitation listings { id: 'query', title: 'Filter', @@ -1925,7 +1853,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_list_members', 'gitlab_list_invitations', 'gitlab_list_branches'], }, }, - // Invitation source attribution (invite member) { id: 'inviteSource', title: 'Invite Source', @@ -1937,7 +1864,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_invite_member'], }, }, - // Direct members only toggle (list members) { id: 'directMembersOnly', title: 'Direct Members Only', @@ -1949,7 +1875,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_list_members'], }, }, - // Remove-member cleanup options { id: 'skipSubresources', title: 'Skip Subresources', @@ -1972,7 +1897,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_remove_member'], }, }, - // List-members filters { id: 'memberUserIds', title: 'User IDs', @@ -2013,7 +1937,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_list_members'], }, }, - // User search query { id: 'userSearch', title: 'Search', @@ -2025,7 +1948,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_search_users'], }, }, - // SAML group name { id: 'samlGroupName', title: 'SAML Group Name', @@ -2037,7 +1959,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: SAML_NAME_OPS, }, }, - // SAML provider name (add/delete SAML group link) { id: 'samlProvider', title: 'SAML Provider', @@ -2049,7 +1970,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: SAML_NAME_OPS, }, }, - // Provider (delete user identity) { id: 'provider', title: 'Identity Provider', @@ -2061,7 +1981,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_delete_user_identity'], }, }, - // Hard delete toggle (delete user) { id: 'hardDelete', title: 'Hard Delete', @@ -2074,7 +1993,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, value: ['gitlab_delete_user'], }, }, - // User attributes (create/update user) { id: 'userAdminEmail', title: 'Email', @@ -3286,26 +3204,19 @@ Return ONLY the JSON array - no explanations, no extra text.`, userAdminIsAdmin: { type: 'boolean', description: 'Whether the user is an administrator' }, }, outputs: { - // Project outputs projects: { type: 'json', description: 'List of projects' }, project: { type: 'json', description: 'Project details' }, - // Group outputs groups: { type: 'json', description: 'List of groups' }, group: { type: 'json', description: 'Group details' }, memberships: { type: 'json', description: "A user's project and group memberships" }, - // Issue outputs issues: { type: 'json', description: 'List of issues' }, issue: { type: 'json', description: 'Issue details' }, - // Merge request outputs mergeRequests: { type: 'json', description: 'List of merge requests' }, mergeRequest: { type: 'json', description: 'Merge request details' }, mergeRequestIid: { type: 'number', description: 'Merge request internal ID (IID)' }, - // Pipeline outputs pipelines: { type: 'json', description: 'List of pipelines' }, pipeline: { type: 'json', description: 'Pipeline details' }, - // Note outputs note: { type: 'json', description: 'Comment/note details' }, - // Repository outputs tree: { type: 'json', description: 'Repository tree entries' }, content: { type: 'string', description: 'File contents (decoded)' }, fileName: { type: 'string', description: 'File name' }, @@ -3321,7 +3232,6 @@ Return ONLY the JSON array - no explanations, no extra text.`, blobId: { type: 'string', description: 'The blob ID' }, lastCommitId: { type: 'string', description: 'The last commit ID that modified the file' }, webUrl: { type: 'string', description: 'Web URL' }, - // Merge request change outputs changes: { type: 'json', description: 'Merge request file changes/diffs' }, changesCount: { type: 'number', description: 'Number of changed files returned (first 100)' }, hasMore: { @@ -3331,19 +3241,15 @@ Return ONLY the JSON array - no explanations, no extra text.`, approvalsRequired: { type: 'number', description: 'Approvals required' }, approvalsLeft: { type: 'number', description: 'Approvals remaining' }, approvedBy: { type: 'json', description: 'List of approvers' }, - // Job outputs jobs: { type: 'json', description: 'Pipeline jobs' }, log: { type: 'string', description: 'Job log output' }, id: { type: 'number', description: 'Job ID' }, status: { type: 'string', description: 'Job status' }, - // Compare outputs diffs: { type: 'json', description: 'File diffs between two compared references' }, compareTimeout: { type: 'boolean', description: 'Whether the comparison timed out' }, compareSameRef: { type: 'boolean', description: 'Whether both compared references match' }, - // Release outputs releases: { type: 'json', description: 'List of releases' }, release: { type: 'json', description: 'Release details' }, - // Access / membership outputs members: { type: 'json', description: 'List of project or group members' }, member: { type: 'json', description: 'A single member' }, alreadyMember: { type: 'boolean', description: 'Whether the user was already a member' }, @@ -3354,16 +3260,13 @@ Return ONLY the JSON array - no explanations, no extra text.`, samlGroupLinks: { type: 'json', description: 'List of SAML group links' }, samlGroupLink: { type: 'json', description: 'A single SAML group link' }, message: { type: 'json', description: 'Per-email invitation result detail' }, - // User outputs users: { type: 'json', description: 'List of matching users' }, user: { type: 'json', description: 'User details' }, - // Pagination total: { type: 'number', description: 'Total number of items available across all pages' }, truncated: { type: 'boolean', description: 'Whether returned content (file content or job log) was truncated', }, - // Success indicator success: { type: 'boolean', description: 'Operation success status' }, }, diff --git a/apps/sim/blocks/blocks/gong.ts b/apps/sim/blocks/blocks/gong.ts index 0be2072866b..f57f91fc592 100644 --- a/apps/sim/blocks/blocks/gong.ts +++ b/apps/sim/blocks/blocks/gong.ts @@ -194,7 +194,6 @@ export const GongBlock: BlockConfig = { value: () => 'list_calls', }, - // Create Call inputs { id: 'clientUniqueId', title: 'Client Unique ID', @@ -314,7 +313,6 @@ Return ONLY the JSON array - no explanations, no quotes, no extra text.`, mode: 'advanced', }, - // List Calls inputs { id: 'fromDateTime', title: 'From Date/Time', @@ -365,7 +363,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes }, }, - // Get Call inputs { id: 'callId', title: 'Call ID', @@ -375,7 +372,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes required: { field: 'operation', value: 'get_call' }, }, - // Get Call Transcript / Get Extensive Calls inputs { id: 'callIds', title: 'Call IDs', @@ -446,7 +442,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, }, }, - // List Users inputs { id: 'includeAvatars', title: 'Include Avatars', @@ -460,7 +455,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, mode: 'advanced', }, - // Get User inputs { id: 'userId', title: 'User ID', @@ -470,7 +464,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, required: { field: 'operation', value: 'get_user' }, }, - // Aggregate Activity & Interaction Stats inputs { id: 'statsFromDate', title: 'From Date', @@ -568,7 +561,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, }, }, - // Aggregate by Period inputs { id: 'aggregationPeriod', title: 'Aggregation Period', @@ -585,7 +577,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, required: { field: 'operation', value: 'aggregate_by_period' }, }, - // Answered Scorecards inputs { id: 'callFromDate', title: 'Call From Date', @@ -682,7 +673,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, }, }, - // Get Folder Content inputs { id: 'folderId', title: 'Folder ID', @@ -691,7 +681,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, condition: { field: 'operation', value: 'get_folder_content' }, }, - // Workspace ID (shared by multiple operations) { id: 'workspaceId', title: 'Workspace ID', @@ -712,7 +701,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, mode: 'advanced', }, - // List Flows inputs { id: 'flowOwnerEmail', title: 'Flow Owner Email', @@ -722,7 +710,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, required: { field: 'operation', value: 'list_flows' }, }, - // Assign Flow Prospects / Get Prospect Flows inputs { id: 'flowId', title: 'Flow ID', @@ -777,7 +764,6 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, required: { field: 'operation', value: 'assign_flow_prospects' }, }, - // Get Coaching inputs { id: 'managerId', title: 'Manager ID', @@ -837,7 +823,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes }, }, - // Ask Anything / Get Brief inputs { id: 'entityWorkspaceId', title: 'Workspace ID', @@ -957,7 +942,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes }, }, - // Get Logs inputs { id: 'logType', title: 'Log Type', @@ -1008,7 +992,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes }, }, - // Lookup Email / Purge Email Address inputs { id: 'emailAddress', title: 'Email Address', @@ -1018,7 +1001,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes required: { field: 'operation', value: ['lookup_email', 'purge_email_address'] }, }, - // Lookup Phone / Purge Phone Number inputs { id: 'phoneNumber', title: 'Phone Number', @@ -1028,7 +1010,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes required: { field: 'operation', value: ['lookup_phone', 'purge_phone_number'] }, }, - // Pagination cursor (shared) { id: 'cursor', title: 'Cursor', @@ -1053,7 +1034,6 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes mode: 'advanced', }, - // API credentials { id: 'accessKey', title: 'Access Key', diff --git a/apps/sim/blocks/blocks/google_drive.ts b/apps/sim/blocks/blocks/google_drive.ts index 3658b9be3c8..9d165ef73f9 100644 --- a/apps/sim/blocks/blocks/google_drive.ts +++ b/apps/sim/blocks/blocks/google_drive.ts @@ -189,7 +189,6 @@ export const GoogleDriveBlock: BlockConfig = { }, }, subBlocks: [ - // Operation selector { id: 'operation', title: 'Operation', @@ -222,7 +221,6 @@ export const GoogleDriveBlock: BlockConfig = { ], value: () => 'list', }, - // Google Drive Credentials { id: 'credential', title: 'Google Drive Account', @@ -244,7 +242,6 @@ export const GoogleDriveBlock: BlockConfig = { required: true, }, ...SERVICE_ACCOUNT_SUBBLOCKS, - // Create/Upload File Fields { id: 'fileName', title: 'File Name', @@ -253,7 +250,6 @@ export const GoogleDriveBlock: BlockConfig = { condition: { field: 'operation', value: ['create_file', 'upload'] }, required: true, }, - // File upload (basic mode) - binary files { id: 'fileUpload', title: 'Upload File', @@ -265,7 +261,6 @@ export const GoogleDriveBlock: BlockConfig = { multiple: false, required: false, }, - // Variable reference (advanced mode) - for referencing files from previous blocks { id: 'file', title: 'File Reference', @@ -335,45 +330,6 @@ Return ONLY the file content - no explanations, no markdown code blocks, no extr mode: 'advanced', condition: { field: 'operation', value: ['create_file', 'upload'] }, }, - // Get Content Fields - // { - // id: 'fileId', - // title: 'Select File', - // type: 'file-selector', - // provider: 'google-drive', - // serviceId: 'google-drive', - // requiredScopes: [], - // placeholder: 'Select a file', - // condition: { field: 'operation', value: 'get_content' }, - // }, - // // Manual File ID input (shown only when no file is selected) - // { - // id: 'fileId', - // title: 'Or Enter File ID Manually', - // type: 'short-input', - // placeholder: 'ID of the file to get content from', - // condition: { - // field: 'operation', - // value: 'get_content', - // and: { - // field: 'fileId', - // value: '', - // }, - // }, - // }, - // Export format for Google Workspace files - // { - // id: 'mimeType', - // title: 'Export Format', - // type: 'dropdown', - // options: [ - // { label: 'Plain Text', id: 'text/plain' }, - // { label: 'HTML', id: 'text/html' }, - // ], - // placeholder: 'Optional: Choose export format for Google Workspace files', - // condition: { field: 'operation', value: 'get_content' }, - // }, - // Create Folder Fields { id: 'fileName', title: 'Folder Name', @@ -396,7 +352,6 @@ Return ONLY the file content - no explanations, no markdown code blocks, no extr dependsOn: ['credential'], condition: { field: 'operation', value: 'create_folder' }, }, - // Manual Folder ID input (advanced mode) { id: 'createFolderManualParentId', title: 'Parent Folder ID', @@ -406,7 +361,6 @@ Return ONLY the file content - no explanations, no markdown code blocks, no extr mode: 'advanced', condition: { field: 'operation', value: 'create_folder' }, }, - // List Fields - Folder Selector (basic mode) { id: 'listFolderSelector', title: 'Select Folder', @@ -421,7 +375,6 @@ Return ONLY the file content - no explanations, no markdown code blocks, no extr dependsOn: ['credential'], condition: { field: 'operation', value: 'list' }, }, - // Manual Folder ID input (advanced mode) { id: 'listManualFolderId', title: 'Folder ID', @@ -471,7 +424,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing mode: 'advanced', condition: { field: 'operation', value: 'list' }, }, - // Download File Fields - File Selector (basic mode) { id: 'downloadFileSelector', title: 'Select File', @@ -486,7 +438,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing condition: { field: 'operation', value: 'download' }, required: true, }, - // Manual File ID input (advanced mode) { id: 'downloadManualFileId', title: 'File ID', @@ -497,7 +448,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing condition: { field: 'operation', value: 'download' }, required: true, }, - // Export format for Google Workspace files (download operation) { id: 'mimeType', title: 'Export Format', @@ -532,7 +482,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing placeholder: 'Optional: Override the filename', condition: { field: 'operation', value: 'download' }, }, - // Get File Info Fields { id: 'getFileSelector', title: 'Select File', @@ -557,7 +506,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing condition: { field: 'operation', value: 'get_file' }, required: true, }, - // Copy File Fields { id: 'copyFileSelector', title: 'Select File to Copy', @@ -613,7 +561,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing mode: 'advanced', condition: { field: 'operation', value: 'copy' }, }, - // Update File Fields { id: 'updateFileSelector', title: 'Select File to Update', @@ -690,7 +637,6 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: 'update' }, }, - // Trash File Fields { id: 'trashFileSelector', title: 'Select File to Trash', @@ -716,7 +662,6 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'trash' }, required: true, }, - // Delete File Fields { id: 'deleteFileSelector', title: 'Select File to Delete', @@ -742,7 +687,6 @@ Return ONLY the description text - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'delete' }, required: true, }, - // Share File Fields { id: 'shareFileSelector', title: 'Select File to Share', @@ -855,7 +799,6 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr placeholder: 'Describe why you are sharing this file...', }, }, - // Unshare (Remove Permission) Fields { id: 'unshareFileSelector', title: 'Select File', @@ -888,7 +831,6 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr condition: { field: 'operation', value: 'unshare' }, required: true, }, - // List Permissions Fields { id: 'listPermissionsFileSelector', title: 'Select File', @@ -921,7 +863,6 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr mode: 'advanced', condition: { field: 'operation', value: 'list_permissions' }, }, - // Get File Content Fields { id: 'getContentFileSelector', title: 'Select File', @@ -987,7 +928,6 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr mode: 'advanced', condition: { field: 'operation', value: 'get_content' }, }, - // Move File Fields { id: 'moveFileSelector', title: 'Select File to Move', @@ -1051,7 +991,6 @@ Return ONLY the message text - no subject line, no greetings/signatures, no extr mode: 'advanced', condition: { field: 'operation', value: 'move' }, }, - // Search Files Fields { id: 'searchQuery', title: 'Search Query', @@ -1097,7 +1036,6 @@ Return ONLY the query string - no explanations, no quotes around the whole thing mode: 'advanced', condition: { field: 'operation', value: 'search' }, }, - // Untrash File Fields { id: 'untrashFileSelector', title: 'Select File to Restore', @@ -1387,7 +1325,6 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` condition: { field: 'operation', value: 'delete_comment' }, required: true, }, - // Get Drive Info has no additional fields (just needs credential) ...getTrigger('google_drive_poller').subBlocks, ], tools: { @@ -1473,13 +1410,11 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` params: (params) => { const { oauthCredential, - // Folder canonical params (per-operation) uploadFolderId, createFolderParentId, listFolderId, copyDestFolderId, moveDestFolderId, - // File canonical params (per-operation) downloadFileId, getFileId, getContentFileId, @@ -1498,7 +1433,6 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` listCommentsFileId, createCommentFileId, deleteCommentFileId, - // File upload file, mimeType, shareType, @@ -1523,10 +1457,8 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` ...rest } = params - // Normalize file input - handles both basic (file-upload) and advanced (short-input) modes const normalizedFile = normalizeFileInput(file, { single: true }) - // Resolve folderId based on operation let effectiveFolderId: string | undefined switch (params.operation) { case 'create_file': @@ -1541,7 +1473,6 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` break } - // Resolve fileId based on operation let effectiveFileId: string | undefined switch (params.operation) { case 'download': @@ -1600,7 +1531,6 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` break } - // Resolve destinationFolderId for copy/move operations let effectiveDestinationFolderId: string | undefined if (params.operation === 'copy') { effectiveDestinationFolderId = copyDestFolderId?.trim() || undefined @@ -1608,18 +1538,14 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` effectiveDestinationFolderId = moveDestFolderId?.trim() || undefined } - // Convert starred dropdown to boolean const starredValue = starred === 'true' ? true : starred === 'false' ? false : undefined - // Convert sendNotification dropdown to boolean const sendNotificationValue = sendNotification === 'true' ? true : sendNotification === 'false' ? false : undefined - // Convert removeFromCurrent dropdown to boolean const removeFromCurrentValue = removeFromCurrent === 'true' ? true : removeFromCurrent === 'false' ? false : undefined - // Convert includeRevisions dropdown to boolean const includeRevisionsValue = includeRevisions === 'true' ? true : includeRevisions === 'false' ? false : undefined @@ -1658,7 +1584,7 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` pageToken: effectivePageToken?.trim() || undefined, query: effectiveQuery, mimeType: effectiveMimeType === 'auto' ? undefined : effectiveMimeType, - type: shareType, // Map shareType to type for share tool + type: shareType, starred: starredValue, sendNotification: sendNotificationValue, removeFromCurrent: removeFromCurrentValue, @@ -1673,13 +1599,11 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` inputs: { operation: { type: 'string', description: 'Operation to perform' }, oauthCredential: { type: 'string', description: 'Google Drive access token' }, - // Folder canonical params (per-operation) uploadFolderId: { type: 'string', description: 'Parent folder for upload/create' }, createFolderParentId: { type: 'string', description: 'Parent folder for create folder' }, listFolderId: { type: 'string', description: 'Folder to list files from' }, copyDestFolderId: { type: 'string', description: 'Destination folder for copy' }, moveDestFolderId: { type: 'string', description: 'Destination folder for move' }, - // File canonical params (per-operation) downloadFileId: { type: 'string', description: 'File to download' }, getFileId: { type: 'string', description: 'File to get info for' }, getContentFileId: { type: 'string', description: 'File to get content from' }, @@ -1698,38 +1622,30 @@ Return ONLY the comment text - no explanations, no quotes, no extra formatting.` listCommentsFileId: { type: 'string', description: 'File to list comments for' }, createCommentFileId: { type: 'string', description: 'File to comment on' }, deleteCommentFileId: { type: 'string', description: 'File the comment belongs to' }, - // Move operation inputs removeFromCurrent: { type: 'string', description: 'Whether to remove from current folder when moving', }, - // Get content operation inputs includeRevisions: { type: 'string', description: 'Whether to include revision history' }, - // Upload and Create inputs fileName: { type: 'string', description: 'File or folder name' }, file: { type: 'json', description: 'File to upload (UserFile object)' }, content: { type: 'string', description: 'Text content to upload' }, mimeType: { type: 'string', description: 'File MIME type or export format' }, - // 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 name: { type: 'string', description: 'New name for file' }, description: { type: 'string', description: 'New description for file' }, starred: { type: 'string', description: 'Star or unstar the file' }, addParents: { type: 'string', description: 'Folder IDs to add file to' }, removeParents: { type: 'string', description: 'Folder IDs to remove file from' }, - // Share operation inputs shareType: { type: 'string', description: 'Type of sharing (user, group, domain, anyone)' }, role: { type: 'string', description: 'Permission role' }, email: { type: 'string', description: 'Email address to share with' }, domain: { type: 'string', description: 'Domain to share with' }, sendNotification: { type: 'string', description: 'Send notification email' }, emailMessage: { type: 'string', description: 'Custom notification message' }, - // Unshare operation inputs permissionId: { type: 'string', description: 'Permission ID to remove' }, exportMimeType: { type: 'string', description: 'Target MIME type to export to' }, revisionId: { type: 'string', description: 'Revision ID to retrieve' }, diff --git a/apps/sim/blocks/blocks/google_sheets.ts b/apps/sim/blocks/blocks/google_sheets.ts index ab380381080..494828e61d0 100644 --- a/apps/sim/blocks/blocks/google_sheets.ts +++ b/apps/sim/blocks/blocks/google_sheets.ts @@ -16,7 +16,6 @@ const SPREADSHEET_FIELD = ['spreadsheetId', 'manualSpreadsheetId'] as const /** Canonical basic/advanced pair for the sheet tab, on the v2 block only. */ const SHEET_FIELD = ['sheetName', 'manualSheetName'] as const -// Legacy block - hidden from toolbar export const GoogleSheetsBlock: BlockConfig = { type: 'google_sheets', name: 'Google Sheets (Legacy)', @@ -55,7 +54,6 @@ export const GoogleSheetsBlock: BlockConfig = { }, }, subBlocks: [ - // Operation selector { id: 'operation', title: 'Operation', @@ -68,7 +66,6 @@ export const GoogleSheetsBlock: BlockConfig = { ], value: () => 'read', }, - // Google Sheets Credentials { id: 'credential', title: 'Google Account', @@ -90,7 +87,6 @@ export const GoogleSheetsBlock: BlockConfig = { required: true, }, ...SERVICE_ACCOUNT_SUBBLOCKS, - // Spreadsheet Selector { id: 'spreadsheetId', title: 'Select Sheet', @@ -104,7 +100,6 @@ export const GoogleSheetsBlock: BlockConfig = { dependsOn: ['credential'], mode: 'basic', }, - // Manual Spreadsheet ID (advanced mode) { id: 'manualSpreadsheetId', title: 'Spreadsheet ID', @@ -114,7 +109,6 @@ export const GoogleSheetsBlock: BlockConfig = { dependsOn: ['credential'], mode: 'advanced', }, - // Range { id: 'range', title: 'Range', @@ -148,7 +142,6 @@ Return ONLY the range string - no explanations, no quotes around the entire outp placeholder: 'Describe the range (e.g., "all data from Sheet1" or "A1 to D50")...', }, }, - // Write-specific Fields { id: 'values', title: 'Values', @@ -184,7 +177,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, ], condition: { field: 'operation', value: 'write' }, }, - // Update-specific Fields { id: 'values', title: 'Values', @@ -220,7 +212,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, ], condition: { field: 'operation', value: 'update' }, }, - // Append-specific Fields { id: 'values', title: 'Values', @@ -403,7 +394,6 @@ export const GoogleSheetsV2Block: BlockConfig = { }, }, subBlocks: [ - // Operation selector { id: 'operation', title: 'Operation', @@ -426,7 +416,6 @@ export const GoogleSheetsV2Block: BlockConfig = { ], value: () => 'read', }, - // Google Sheets Credentials { id: 'credential', title: 'Google Account', @@ -448,7 +437,6 @@ export const GoogleSheetsV2Block: BlockConfig = { required: true, }, ...SERVICE_ACCOUNT_SUBBLOCKS, - // Spreadsheet Selector (basic mode) - not for create operation { id: 'spreadsheetId', title: 'Select Spreadsheet', @@ -463,7 +451,6 @@ export const GoogleSheetsV2Block: BlockConfig = { mode: 'basic', condition: { field: 'operation', value: 'create', not: true }, }, - // Manual Spreadsheet ID (advanced mode) - not for create operation { id: 'manualSpreadsheetId', title: 'Spreadsheet ID', @@ -474,7 +461,6 @@ export const GoogleSheetsV2Block: BlockConfig = { mode: 'advanced', condition: { field: 'operation', value: 'create', not: true }, }, - // Sheet Name Selector (basic mode) - for operations that need sheet name { id: 'sheetName', title: 'Sheet (Tab)', @@ -488,7 +474,6 @@ export const GoogleSheetsV2Block: BlockConfig = { mode: 'basic', condition: { field: 'operation', value: ['read', 'write', 'update', 'append', 'clear'] }, }, - // Manual Sheet Name (advanced mode) - for operations that need sheet name { id: 'manualSheetName', title: 'Sheet Name', @@ -500,7 +485,6 @@ export const GoogleSheetsV2Block: BlockConfig = { mode: 'advanced', condition: { field: 'operation', value: ['read', 'write', 'update', 'append', 'clear'] }, }, - // Cell Range (optional for read/write/update/clear) { id: 'cellRange', title: 'Cell Range', @@ -534,7 +518,6 @@ Return ONLY the range string - no sheet name, no explanations, no quotes.`, placeholder: 'Describe the range (e.g., "first 50 rows" or "column A")...', }, }, - // Read Filter Fields (advanced mode only) { id: 'filterColumn', title: 'Filter Column', @@ -570,7 +553,6 @@ Return ONLY the range string - no sheet name, no explanations, no quotes.`, condition: { field: 'operation', value: 'read' }, mode: 'advanced', }, - // Write-specific Fields { id: 'values', title: 'Values', @@ -606,7 +588,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, ], condition: { field: 'operation', value: ['write', 'update', 'batch_update'] }, }, - // Update-specific Fields { id: 'values', title: 'Values', @@ -632,7 +613,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, generationType: 'json-object', }, }, - // Append-specific Fields { id: 'values', title: 'Values', @@ -668,7 +648,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, ], condition: { field: 'operation', value: 'append' }, }, - // Create Spreadsheet Fields { id: 'title', title: 'Spreadsheet Title', @@ -684,7 +663,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, placeholder: 'Comma-separated sheet names (e.g., Sheet1, Data, Summary)', condition: { field: 'operation', value: 'create' }, }, - // Batch Get Fields { id: 'ranges', title: 'Ranges', @@ -721,7 +699,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, generationType: 'json-object', }, }, - // Batch Update Fields { id: 'batchData', title: 'Data', @@ -762,7 +739,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, generationType: 'json-object', }, }, - // Batch Clear Fields { id: 'ranges', title: 'Ranges to Clear', @@ -800,7 +776,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, generationType: 'json-object', }, }, - // Copy Sheet Fields { id: 'sheetId', title: 'Sheet ID', @@ -817,7 +792,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, condition: { field: 'operation', value: 'copy_sheet' }, required: true, }, - // Delete Rows / Delete Sheet Fields { id: 'deleteSheetId', title: 'Sheet ID', @@ -826,7 +800,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, condition: { field: 'operation', value: ['delete_rows', 'delete_sheet'] }, required: true, }, - // Delete Rows Fields { id: 'startIndex', title: 'Start Row Index', @@ -925,7 +898,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, const operation = params.operation as string - // Handle create operation if (operation === 'create') { const sheetTitlesArray = sheetTitles ? (sheetTitles as string).split(',').map((s: string) => s.trim()) @@ -943,7 +915,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, throw new Error('Spreadsheet ID is required.') } - // Handle get_info operation if (operation === 'get_info') { return { spreadsheetId: effectiveSpreadsheetId, @@ -951,7 +922,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } } - // Handle batch_get operation if (operation === 'batch_get') { const parsedRanges = ranges ? JSON.parse(ranges as string) : [] return { @@ -961,7 +931,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } } - // Handle batch_update operation if (operation === 'batch_update') { const parsedData = batchData ? JSON.parse(batchData as string) : [] return { @@ -972,7 +941,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } } - // Handle batch_clear operation if (operation === 'batch_clear') { const parsedRanges = ranges ? JSON.parse(ranges as string) : [] return { @@ -982,7 +950,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } } - // Handle copy_sheet operation if (operation === 'copy_sheet') { return { sourceSpreadsheetId: effectiveSpreadsheetId, @@ -992,7 +959,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } } - // Handle delete_spreadsheet operation if (operation === 'delete_spreadsheet') { return { spreadsheetId: effectiveSpreadsheetId, @@ -1000,7 +966,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } } - // Handle delete_sheet operation if (operation === 'delete_sheet') { const parsedSheetId = Number.parseInt(deleteSheetId as string, 10) if (Number.isNaN(parsedSheetId)) { @@ -1013,7 +978,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } } - // Handle delete_rows operation if (operation === 'delete_rows') { const parsedSheetId = Number.parseInt(deleteSheetId as string, 10) const parsedStartIndex = Number.parseInt(startIndex as string, 10) @@ -1034,7 +998,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, } } - // Handle read/write/update/append/clear operations (require sheet name) const effectiveSheetName = sheetName ? String(sheetName).trim() : '' if (!effectiveSheetName) { @@ -1101,7 +1064,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, }, }, outputs: { - // Read outputs sheetName: { type: 'string', description: 'Name of the sheet', @@ -1123,7 +1085,6 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, 'Filter summary (present only when a filter was requested): applied, column, matchType, columnFound, matchedRows, totalRows', condition: { field: 'operation', value: 'read' }, }, - // Write/Update/Append outputs updatedRange: { type: 'string', description: 'Updated range', @@ -1149,13 +1110,11 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, description: 'Table range', condition: { field: 'operation', value: 'append' }, }, - // Clear outputs clearedRange: { type: 'string', description: 'Range that was cleared', condition: { field: 'operation', value: 'clear' }, }, - // Get Info / Create / Batch outputs spreadsheetId: { type: 'string', description: 'Spreadsheet ID', @@ -1198,13 +1157,11 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, description: 'Spreadsheet URL', condition: { field: 'operation', value: ['get_info', 'create'] }, }, - // Batch Get outputs valueRanges: { type: 'json', description: 'Array of value ranges read from the spreadsheet', condition: { field: 'operation', value: 'batch_get' }, }, - // Batch Update outputs totalUpdatedRows: { type: 'number', description: 'Total rows updated', @@ -1230,13 +1187,11 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, description: 'Array of update responses for each range', condition: { field: 'operation', value: 'batch_update' }, }, - // Batch Clear outputs clearedRanges: { type: 'json', description: 'Array of ranges that were cleared', condition: { field: 'operation', value: 'batch_clear' }, }, - // Copy Sheet / Delete Rows outputs sheetId: { type: 'number', description: @@ -1263,25 +1218,21 @@ Return ONLY the JSON array - no explanations, no markdown, no extra text.`, description: 'URL of the destination spreadsheet', condition: { field: 'operation', value: 'copy_sheet' }, }, - // Delete Rows outputs deletedRowRange: { type: 'string', description: 'Description of the deleted row range', condition: { field: 'operation', value: 'delete_rows' }, }, - // Delete Sheet outputs deletedSheetId: { type: 'number', description: 'The numeric ID of the deleted sheet', condition: { field: 'operation', value: 'delete_sheet' }, }, - // Delete Spreadsheet outputs deleted: { type: 'boolean', description: 'Whether the spreadsheet was successfully deleted', condition: { field: 'operation', value: 'delete_spreadsheet' }, }, - // Common metadata metadata: { type: 'json', description: 'Spreadsheet metadata including ID and URL', diff --git a/apps/sim/blocks/blocks/google_slides.ts b/apps/sim/blocks/blocks/google_slides.ts index 32b8299893c..cae504e7f18 100644 --- a/apps/sim/blocks/blocks/google_slides.ts +++ b/apps/sim/blocks/blocks/google_slides.ts @@ -259,7 +259,6 @@ export const GoogleSlidesBlock: BlockConfig = { }, }, subBlocks: [ - // Operation selector { id: 'operation', title: 'Operation', @@ -323,7 +322,6 @@ export const GoogleSlidesBlock: BlockConfig = { ], value: () => 'read', }, - // Google Slides Credentials { id: 'credential', title: 'Google Account', @@ -345,7 +343,6 @@ export const GoogleSlidesBlock: BlockConfig = { required: true, }, ...SERVICE_ACCOUNT_SUBBLOCKS, - // Presentation selector (basic mode) - for operations that need an existing presentation { id: 'presentationId', title: 'Select Presentation', @@ -414,7 +411,6 @@ export const GoogleSlidesBlock: BlockConfig = { ], }, }, - // Manual presentation ID input (advanced mode) { id: 'manualPresentationId', title: 'Presentation ID', @@ -531,7 +527,6 @@ Return ONLY the title - no explanations, no quotes, no extra text.`, placeholder: 'Describe your presentation topic...', }, }, - // Folder selector (basic mode) { id: 'folderSelector', title: 'Select Parent Folder', @@ -546,7 +541,6 @@ Return ONLY the title - no explanations, no quotes, no extra text.`, mode: 'basic', condition: { field: 'operation', value: 'create' }, }, - // Manual folder ID input (advanced mode) { id: 'folderId', title: 'Parent Folder ID', @@ -557,7 +551,6 @@ Return ONLY the title - no explanations, no quotes, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: 'create' }, }, - // Content Field for create operation { id: 'createContent', title: 'Initial Content', @@ -1311,7 +1304,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, mode: 'advanced', }, - // update_text_style specific { id: 'textBold', title: 'Bold', @@ -1410,7 +1402,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, mode: 'advanced', }, - // update_paragraph_style specific { id: 'paragraphAlignment', title: 'Alignment', @@ -1504,7 +1495,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, mode: 'advanced', }, - // create_paragraph_bullets specific { id: 'bulletPreset', title: 'Bullet Preset', @@ -2722,7 +2712,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, oauthCredential, } - // Handle operation-specific params if (params.operation === 'write' && slideIndex) { result.slideIndex = Number.parseInt(slideIndex as string, 10) } @@ -2757,17 +2746,14 @@ Return ONLY the text content - no explanations, no markdown formatting markers, result.pageObjectId = thumbnailPageId } - // Get Page operation if (params.operation === 'get_page') { result.pageObjectId = params.getPageObjectId } - // Delete Object operation if (params.operation === 'delete_object') { result.objectId = params.deleteObjectId } - // Duplicate Object operation if (params.operation === 'duplicate_object') { result.objectId = params.duplicateObjectId if (params.duplicateObjectIds) { @@ -2775,7 +2761,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, } } - // Reorder Slides operation if (params.operation === 'reorder_slides') { result.slideObjectIds = params.reorderSlideIds if (params.reorderInsertionIndex) { @@ -2783,7 +2768,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, } } - // Create Table operation if (params.operation === 'create_table') { result.pageObjectId = params.tablePageObjectId if (params.tableRows) { @@ -2806,7 +2790,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, } } - // Create Shape operation if (params.operation === 'create_shape') { result.pageObjectId = params.shapePageObjectId result.shapeType = params.shapeType @@ -2824,7 +2807,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, } } - // Insert Text operation if (params.operation === 'insert_text') { result.objectId = params.insertTextObjectId result.text = params.insertTextContent @@ -3217,14 +3199,11 @@ Return ONLY the text content - no explanations, no markdown formatting markers, operation: { type: 'string', description: 'Operation to perform' }, oauthCredential: { type: 'string', description: 'Google Slides access token' }, presentationId: { type: 'string', description: 'Presentation identifier (canonical param)' }, - // Write operation slideIndex: { type: 'number', description: 'Slide index to write to' }, content: { type: 'string', description: 'Slide content' }, - // Create operation title: { type: 'string', description: 'Presentation title' }, folderId: { type: 'string', description: 'Parent folder identifier (canonical param)' }, createContent: { type: 'string', description: 'Initial slide content' }, - // Replace all text operation findText: { type: 'string', description: 'Text to find' }, replaceText: { type: 'string', description: 'Text to replace with' }, matchCase: { type: 'boolean', description: 'Whether to match case' }, @@ -3232,32 +3211,24 @@ Return ONLY the text content - no explanations, no markdown formatting markers, type: 'string', description: 'Comma-separated slide IDs to limit replacements', }, - // Add slide operation layout: { type: 'string', description: 'Slide layout' }, insertionIndex: { type: 'number', description: 'Position to insert slide' }, placeholderIdMappings: { type: 'string', description: 'JSON array of placeholder ID mappings' }, - // Add image operation pageObjectId: { type: 'string', description: 'Slide object ID for image' }, imageSource: { type: 'json', description: 'Image source (file or URL)' }, imageWidth: { type: 'number', description: 'Image width in points' }, imageHeight: { type: 'number', description: 'Image height in points' }, positionX: { type: 'number', description: 'X position in points' }, positionY: { type: 'number', description: 'Y position in points' }, - // Get thumbnail operation thumbnailPageId: { type: 'string', description: 'Slide object ID for thumbnail' }, thumbnailSize: { type: 'string', description: 'Thumbnail size' }, mimeType: { type: 'string', description: 'Image format (PNG)' }, - // Get page operation getPageObjectId: { type: 'string', description: 'Page/slide object ID to retrieve' }, - // Delete object operation deleteObjectId: { type: 'string', description: 'Object ID to delete' }, - // Duplicate object operation duplicateObjectId: { type: 'string', description: 'Object ID to duplicate' }, duplicateObjectIds: { type: 'string', description: 'JSON object ID mappings' }, - // Reorder slides operation reorderSlideIds: { type: 'string', description: 'Comma-separated slide IDs to move' }, reorderInsertionIndex: { type: 'number', description: 'New position for slides' }, - // Create table operation tablePageObjectId: { type: 'string', description: 'Slide ID for table' }, tableRows: { type: 'number', description: 'Number of rows' }, tableColumns: { type: 'number', description: 'Number of columns' }, @@ -3265,43 +3236,35 @@ Return ONLY the text content - no explanations, no markdown formatting markers, tableHeight: { type: 'number', description: 'Table height in points' }, tablePositionX: { type: 'number', description: 'Table X position in points' }, tablePositionY: { type: 'number', description: 'Table Y position in points' }, - // Create shape operation shapePageObjectId: { type: 'string', description: 'Slide ID for shape' }, shapeType: { type: 'string', description: 'Shape type' }, shapeWidth: { type: 'number', description: 'Shape width in points' }, shapeHeight: { type: 'number', description: 'Shape height in points' }, shapePositionX: { type: 'number', description: 'Shape X position in points' }, shapePositionY: { type: 'number', description: 'Shape Y position in points' }, - // Insert text operation insertTextObjectId: { type: 'string', description: 'Object ID for text insertion' }, insertTextContent: { type: 'string', description: 'Text to insert' }, insertTextIndex: { type: 'number', description: 'Insertion index' }, - // Copy presentation operation sourcePresentationId: { type: 'string', description: 'Source/template presentation ID' }, copyTitle: { type: 'string', description: 'Title for the copy' }, copyFolderId: { type: 'string', description: 'Destination folder ID for the copy' }, - // Export presentation operation exportFormat: { type: 'string', description: 'Export format (PDF, PPTX, ODP, etc.)' }, - // Batch update (raw) requestsJson: { type: 'string', description: 'JSON array of raw Slides API Request objects' }, writeControlJson: { type: 'string', description: 'WriteControl JSON object' }, - // Replace all shapes with image replaceShapesImageUrl: { type: 'string', description: 'Image URL to insert' }, replaceShapesFindText: { type: 'string', description: 'Text token of shapes to replace' }, replaceShapesMatchCase: { type: 'boolean', description: 'Match case' }, replaceShapesImageMethod: { type: 'string', description: 'Image fit method' }, replaceShapesPageObjectIds: { type: 'string', description: 'Slide IDs to limit to' }, - // Replace image replaceImageObjectId: { type: 'string', description: 'Image object ID to replace' }, replaceImageUrl: { type: 'string', description: 'New image URL' }, replaceImageMethod: { type: 'string', description: 'Image fit method' }, - // Update image properties imagePropsObjectId: { type: 'string', description: 'Image object ID' }, imageBrightness: { type: 'number', description: 'Brightness -1.0 to 1.0' }, imageContrast: { type: 'number', description: 'Contrast -1.0 to 1.0' }, @@ -3313,7 +3276,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, imagePropertiesJson: { type: 'string', description: 'Raw ImageProperties JSON' }, imagePropertiesFields: { type: 'string', description: 'FieldMask' }, - // Shared text range targeting textObjectId: { type: 'string', description: 'Object ID for text styling target' }, textRowIndex: { type: 'number', description: 'Table cell row index' }, textColumnIndex: { type: 'number', description: 'Table cell column index' }, @@ -3321,7 +3283,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, textStartIndex: { type: 'number', description: 'Range start index' }, textEndIndex: { type: 'number', description: 'Range end index' }, - // Update text style textBold: { type: 'boolean', description: 'Bold' }, textItalic: { type: 'boolean', description: 'Italic' }, textUnderline: { type: 'boolean', description: 'Underline' }, @@ -3336,7 +3297,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, textStyleJson: { type: 'string', description: 'Raw TextStyle JSON' }, textStyleFields: { type: 'string', description: 'FieldMask' }, - // Update paragraph style paragraphAlignment: { type: 'string', description: 'Paragraph alignment' }, paragraphLineSpacing: { type: 'number', description: 'Line spacing percent' }, paragraphIndentStart: { type: 'number', description: 'Indent start (pt)' }, @@ -3349,10 +3309,8 @@ Return ONLY the text content - no explanations, no markdown formatting markers, paragraphStyleJson: { type: 'string', description: 'Raw ParagraphStyle JSON' }, paragraphStyleFields: { type: 'string', description: 'FieldMask' }, - // Bullets bulletPreset: { type: 'string', description: 'Bullet preset' }, - // Update shape properties shapePropsObjectId: { type: 'string', description: 'Shape object ID' }, shapeFillColor: { type: 'string', description: 'Shape fill color (hex)' }, shapeFillAlpha: { type: 'number', description: 'Shape fill opacity' }, @@ -3367,7 +3325,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, shapePropertiesJson: { type: 'string', description: 'Raw ShapeProperties JSON' }, shapePropertiesFields: { type: 'string', description: 'FieldMask' }, - // Update page properties pagePropsObjectId: { type: 'string', description: 'Slide object ID' }, pageBackgroundColor: { type: 'string', description: 'Slide background color (hex)' }, pageBackgroundAlpha: { type: 'number', description: 'Slide background opacity' }, @@ -3376,18 +3333,15 @@ Return ONLY the text content - no explanations, no markdown formatting markers, pagePropertiesJson: { type: 'string', description: 'Raw PageProperties JSON' }, pagePropertiesFields: { type: 'string', description: 'FieldMask' }, - // Update slide properties slidePropsObjectId: { type: 'string', description: 'Slide object ID' }, slideIsSkipped: { type: 'boolean', description: 'Whether the slide is skipped' }, slidePropertiesJson: { type: 'string', description: 'Raw SlideProperties JSON' }, slidePropertiesFields: { type: 'string', description: 'FieldMask' }, - // Alt text altTextObjectId: { type: 'string', description: 'Element object ID' }, altTextTitle: { type: 'string', description: 'Accessibility title' }, altTextDescription: { type: 'string', description: 'Accessibility description' }, - // Transform transformObjectId: { type: 'string', description: 'Element object ID' }, transformScaleX: { type: 'number', description: 'Scale X' }, transformScaleY: { type: 'number', description: 'Scale Y' }, @@ -3397,16 +3351,13 @@ Return ONLY the text content - no explanations, no markdown formatting markers, transformTranslateY: { type: 'number', description: 'Y position (pt)' }, transformApplyMode: { type: 'string', description: 'Apply mode' }, - // Z-order zOrderObjectIds: { type: 'string', description: 'Comma-separated element IDs' }, zOrderOperation: { type: 'string', description: 'Z-order operation' }, - // Group / ungroup groupChildrenObjectIds: { type: 'string', description: 'Children object IDs' }, groupObjectIdInput: { type: 'string', description: 'Group object ID' }, ungroupObjectIds: { type: 'string', description: 'Group object IDs to ungroup' }, - // Create line linePageObjectId: { type: 'string', description: 'Slide object ID' }, lineCategory: { type: 'string', description: 'Line category' }, lineWidth: { type: 'number', description: 'Line width (pt)' }, @@ -3414,7 +3365,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, linePositionX: { type: 'number', description: 'Line X position (pt)' }, linePositionY: { type: 'number', description: 'Line Y position (pt)' }, - // Update line properties linePropsObjectId: { type: 'string', description: 'Line object ID' }, lineColor: { type: 'string', description: 'Line color (hex)' }, lineWeight: { type: 'number', description: 'Line weight (pt)' }, @@ -3425,14 +3375,11 @@ Return ONLY the text content - no explanations, no markdown formatting markers, linePropertiesJson: { type: 'string', description: 'Raw LineProperties JSON' }, linePropertiesFields: { type: 'string', description: 'FieldMask' }, - // Update line category lineCategoryObjectId: { type: 'string', description: 'Line object ID' }, newLineCategory: { type: 'string', description: 'New line category' }, - // Reroute line rerouteLineObjectId: { type: 'string', description: 'Line object ID' }, - // Table cell-reference ops tableTargetObjectId: { type: 'string', description: 'Table object ID' }, tableCellRowIndex: { type: 'number', description: 'Cell row index' }, tableCellColumnIndex: { type: 'number', description: 'Cell column index' }, @@ -3440,21 +3387,18 @@ Return ONLY the text content - no explanations, no markdown formatting markers, tableInsertBelow: { type: 'boolean', description: 'Insert below reference cell' }, tableInsertRight: { type: 'boolean', description: 'Insert to the right of reference cell' }, - // Table range ops tableRangeObjectId: { type: 'string', description: 'Table object ID' }, tableRangeRowIndex: { type: 'number', description: 'Range start row' }, tableRangeColumnIndex: { type: 'number', description: 'Range start column' }, tableRangeRowSpan: { type: 'number', description: 'Row span' }, tableRangeColumnSpan: { type: 'number', description: 'Column span' }, - // Update table cell properties tableCellBackgroundColor: { type: 'string', description: 'Cell background color (hex)' }, tableCellBackgroundAlpha: { type: 'number', description: 'Cell background opacity' }, tableCellContentAlignment: { type: 'string', description: 'Cell content alignment' }, tableCellPropertiesJson: { type: 'string', description: 'Raw TableCellProperties JSON' }, tableCellPropertiesFields: { type: 'string', description: 'FieldMask' }, - // Update table border properties tableBorderPosition: { type: 'string', description: 'Border position' }, tableBorderColor: { type: 'string', description: 'Border color (hex)' }, tableBorderWeight: { type: 'number', description: 'Border weight (pt)' }, @@ -3462,21 +3406,18 @@ Return ONLY the text content - no explanations, no markdown formatting markers, tableBorderPropertiesJson: { type: 'string', description: 'Raw TableBorderProperties JSON' }, tableBorderPropertiesFields: { type: 'string', description: 'FieldMask' }, - // Update table column properties tableColumnPropsObjectId: { type: 'string', description: 'Table object ID' }, tableColumnIndices: { type: 'string', description: 'Comma-separated column indices' }, tableColumnWidth: { type: 'number', description: 'Column width (pt)' }, tableColumnPropertiesJson: { type: 'string', description: 'Raw TableColumnProperties JSON' }, tableColumnPropertiesFields: { type: 'string', description: 'FieldMask' }, - // Update table row properties tableRowPropsObjectId: { type: 'string', description: 'Table object ID' }, tableRowIndices: { type: 'string', description: 'Comma-separated row indices' }, tableMinRowHeight: { type: 'number', description: 'Minimum row height (pt)' }, tableRowPropertiesJson: { type: 'string', description: 'Raw TableRowProperties JSON' }, tableRowPropertiesFields: { type: 'string', description: 'FieldMask' }, - // Sheets chart chartPageObjectId: { type: 'string', description: 'Slide object ID' }, chartSpreadsheetId: { type: 'string', description: 'Spreadsheet ID' }, chartId: { type: 'number', description: 'Chart ID' }, @@ -3486,15 +3427,12 @@ Return ONLY the text content - no explanations, no markdown formatting markers, chartPositionX: { type: 'number', description: 'Chart X position (pt)' }, chartPositionY: { type: 'number', description: 'Chart Y position (pt)' }, - // Refresh sheets chart refreshChartObjectId: { type: 'string', description: 'Chart object ID' }, - // Replace all shapes with sheets chart replaceShapesChartFindText: { type: 'string', description: 'Text token to replace' }, replaceShapesChartMatchCase: { type: 'boolean', description: 'Match case' }, replaceShapesChartPageObjectIds: { type: 'string', description: 'Slide IDs to limit to' }, - // Create video videoPageObjectId: { type: 'string', description: 'Slide object ID' }, videoSource: { type: 'string', description: 'Video source (YOUTUBE or DRIVE)' }, videoId: { type: 'string', description: 'Video ID' }, @@ -3503,7 +3441,6 @@ Return ONLY the text content - no explanations, no markdown formatting markers, videoPositionX: { type: 'number', description: 'Video X position (pt)' }, videoPositionY: { type: 'number', description: 'Video Y position (pt)' }, - // Update video properties videoPropsObjectId: { type: 'string', description: 'Video object ID' }, videoAutoPlay: { type: 'boolean', description: 'Auto play' }, videoMute: { type: 'boolean', description: 'Mute' }, @@ -3516,97 +3453,71 @@ Return ONLY the text content - no explanations, no markdown formatting markers, videoPropertiesFields: { type: 'string', description: 'FieldMask' }, }, outputs: { - // Read operation slides: { type: 'json', description: 'Presentation slides' }, metadata: { type: 'json', description: 'Presentation metadata' }, - // Write operation updatedContent: { type: 'boolean', description: 'Content update status' }, - // Replace all text operation occurrencesChanged: { type: 'number', description: 'Number of text occurrences replaced' }, - // Add slide operation slideId: { type: 'string', description: 'Object ID of newly created slide' }, - // Add image operation imageId: { type: 'string', description: 'Object ID of newly created image' }, - // Get thumbnail operation contentUrl: { type: 'string', description: 'URL to the thumbnail image' }, width: { type: 'number', description: 'Thumbnail width in pixels' }, height: { type: 'number', description: 'Thumbnail height in pixels' }, - // Get page operation objectId: { type: 'string', description: 'Page object ID' }, pageType: { type: 'string', description: 'Page type (SLIDE, MASTER, etc.)' }, pageElements: { type: 'json', description: 'Page elements array' }, slideProperties: { type: 'json', description: 'Slide-specific properties' }, - // Delete object operation deleted: { type: 'boolean', description: 'Whether object was deleted' }, - // Duplicate object operation duplicatedObjectId: { type: 'string', description: 'Object ID of the duplicate' }, - // Reorder slides operation moved: { type: 'boolean', description: 'Whether slides were moved' }, slideObjectIds: { type: 'json', description: 'Slide IDs that were moved' }, - // Create table operation tableId: { type: 'string', description: 'Object ID of newly created table' }, rows: { type: 'number', description: 'Number of rows created' }, columns: { type: 'number', description: 'Number of columns created' }, - // Create shape operation shapeId: { type: 'string', description: 'Object ID of newly created shape' }, - // Insert text operation inserted: { type: 'boolean', description: 'Whether text was inserted' }, text: { type: 'string', description: 'Text that was inserted' }, - // Generic update outputs (text style, paragraph style, shape/page/slide props, image/line/video props, table props) updated: { type: 'boolean', description: 'Whether the operation updated the target' }, fields: { type: 'string', description: 'FieldMask that was applied' }, - // Copy presentation presentationId: { type: 'string', description: 'New presentation ID (copy)' }, title: { type: 'string', description: 'Presentation title' }, - // Export presentation file: { type: 'file', description: 'Stored exported presentation file' }, contentBase64: { type: 'string', description: 'Base64-encoded exported content' }, mimeType: { type: 'string', description: 'MIME type of the exported content' }, sizeBytes: { type: 'number', description: 'Size of the exported content in bytes' }, - // Batch update (raw) replies: { type: 'json', description: 'Array of reply objects from batchUpdate' }, writeControl: { type: 'json', description: 'WriteControl from batchUpdate response' }, - // Image / line / video object IDs imageObjectId: { type: 'string', description: 'Image object ID' }, lineId: { type: 'string', description: 'Line object ID' }, videoObjectId: { type: 'string', description: 'Video object ID' }, chartObjectId: { type: 'string', description: 'Sheets chart object ID' }, - // Replace image replaced: { type: 'boolean', description: 'Whether the image was replaced' }, - // Group / ungroup grouped: { type: 'boolean', description: 'Whether objects were grouped' }, ungrouped: { type: 'boolean', description: 'Whether objects were ungrouped' }, groupObjectId: { type: 'string', description: 'Object ID of the resulting group' }, childrenObjectIds: { type: 'json', description: 'Children IDs of the group' }, - // Z-order reordered: { type: 'boolean', description: 'Whether the z-order was changed' }, objectIds: { type: 'json', description: 'Object IDs affected by the operation' }, operation: { type: 'string', description: 'Z-order operation applied' }, - // Table extension tableObjectId: { type: 'string', description: 'Table object ID affected' }, number: { type: 'number', description: 'Number of rows/columns inserted' }, merged: { type: 'boolean', description: 'Whether cells were merged' }, unmerged: { type: 'boolean', description: 'Whether cells were unmerged' }, - // Sheets chart refreshed: { type: 'boolean', description: 'Whether the chart was refreshed' }, - // Line reroute rerouted: { type: 'boolean', description: 'Whether the line was rerouted' }, - // Paragraph bullets created: { type: 'boolean', description: 'Whether bullets were created' }, - // Bullets / shape / line categories returned lineCategory: { type: 'string', description: 'Line category created or updated' }, shapeType: { type: 'string', description: 'Shape type created' }, }, diff --git a/apps/sim/blocks/blocks/incidentio.ts b/apps/sim/blocks/blocks/incidentio.ts index 224cc5ed528..bdb8e2baf84 100644 --- a/apps/sim/blocks/blocks/incidentio.ts +++ b/apps/sim/blocks/blocks/incidentio.ts @@ -229,98 +229,74 @@ export const IncidentioBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Incidents { label: 'List Incidents', id: 'incidentio_incidents_list' }, { label: 'Create Incident', id: 'incidentio_incidents_create' }, { label: 'Show Incident', id: 'incidentio_incidents_show' }, { label: 'Update Incident', id: 'incidentio_incidents_update' }, - // Actions { label: 'List Actions', id: 'incidentio_actions_list' }, { label: 'Show Action', id: 'incidentio_actions_show' }, - // Follow-ups { label: 'List Follow-ups', id: 'incidentio_follow_ups_list' }, { label: 'Show Follow-up', id: 'incidentio_follow_ups_show' }, - // Users { label: 'List Users', id: 'incidentio_users_list' }, { label: 'Show User', id: 'incidentio_users_show' }, - // Workflows { label: 'List Workflows', id: 'incidentio_workflows_list' }, { label: 'Create Workflow', id: 'incidentio_workflows_create' }, { label: 'Show Workflow', id: 'incidentio_workflows_show' }, { label: 'Update Workflow', id: 'incidentio_workflows_update' }, { label: 'Delete Workflow', id: 'incidentio_workflows_delete' }, - // Schedules { label: 'List Schedules', id: 'incidentio_schedules_list' }, { label: 'Create Schedule', id: 'incidentio_schedules_create' }, { label: 'Show Schedule', id: 'incidentio_schedules_show' }, { label: 'Update Schedule', id: 'incidentio_schedules_update' }, { label: 'Delete Schedule', id: 'incidentio_schedules_delete' }, - // Escalations { label: 'List Escalations', id: 'incidentio_escalations_list' }, { label: 'Create Escalation', id: 'incidentio_escalations_create' }, { label: 'Show Escalation', id: 'incidentio_escalations_show' }, - // Custom Fields { label: 'List Custom Fields', id: 'incidentio_custom_fields_list' }, { label: 'Create Custom Field', id: 'incidentio_custom_fields_create' }, { label: 'Show Custom Field', id: 'incidentio_custom_fields_show' }, { label: 'Update Custom Field', id: 'incidentio_custom_fields_update' }, { label: 'Delete Custom Field', id: 'incidentio_custom_fields_delete' }, - // Reference Data { label: 'List Severities', id: 'incidentio_severities_list' }, { label: 'List Incident Statuses', id: 'incidentio_incident_statuses_list' }, { label: 'List Incident Types', id: 'incidentio_incident_types_list' }, - // Incident Roles { label: 'List Incident Roles', id: 'incidentio_incident_roles_list' }, { label: 'Create Incident Role', id: 'incidentio_incident_roles_create' }, { label: 'Show Incident Role', id: 'incidentio_incident_roles_show' }, { label: 'Update Incident Role', id: 'incidentio_incident_roles_update' }, { label: 'Delete Incident Role', id: 'incidentio_incident_roles_delete' }, - // Incident Timestamps { label: 'List Incident Timestamps', id: 'incidentio_incident_timestamps_list' }, { label: 'Show Incident Timestamp', id: 'incidentio_incident_timestamps_show' }, - // Incident Updates { label: 'List Incident Updates', id: 'incidentio_incident_updates_list' }, - // Schedule Entries { label: 'List Schedule Entries', id: 'incidentio_schedule_entries_list' }, - // Schedule Overrides { label: 'Create Schedule Override', id: 'incidentio_schedule_overrides_create' }, - // Escalation Paths { label: 'List Escalation Paths', id: 'incidentio_escalation_paths_list' }, { label: 'Create Escalation Path', id: 'incidentio_escalation_paths_create' }, { label: 'Show Escalation Path', id: 'incidentio_escalation_paths_show' }, { label: 'Update Escalation Path', id: 'incidentio_escalation_paths_update' }, { label: 'Delete Escalation Path', id: 'incidentio_escalation_paths_delete' }, - // On-call { label: 'Get Who Is On Call', id: 'incidentio_on_call_now' }, { label: 'List Schedule Overrides', id: 'incidentio_schedule_overrides_list' }, - // Alerts { label: 'List Alerts', id: 'incidentio_alerts_list' }, { label: 'Show Alert', id: 'incidentio_alerts_show' }, { label: 'Resolve Alert', id: 'incidentio_alerts_resolve' }, { label: 'Create Alert Event', id: 'incidentio_alert_events_create' }, { label: 'List Incident Alerts', id: 'incidentio_incident_alerts_list' }, - // Escalations { label: 'Cancel Escalation', id: 'incidentio_escalations_cancel' }, - // Catalog { label: 'List Catalog Types', id: 'incidentio_catalog_types_list' }, { label: 'List Catalog Entries', id: 'incidentio_catalog_entries_list' }, - // Teams { label: 'List Teams', id: 'incidentio_teams_list' }, { label: 'Show Team', id: 'incidentio_teams_show' }, - // Follow-ups { label: 'Create Follow-up', id: 'incidentio_follow_ups_create' }, { label: 'Update Follow-up', id: 'incidentio_follow_ups_update' }, - // Actions { label: 'Create Action', id: 'incidentio_actions_create' }, { label: 'Update Action', id: 'incidentio_actions_update' }, - // Incident people { label: 'List Incident Participants', id: 'incidentio_incident_participants_list' }, { label: 'Grant Incident Membership', id: 'incidentio_incident_memberships_create' }, { label: 'Revoke Incident Membership', id: 'incidentio_incident_memberships_revoke' }, ], value: () => 'incidentio_incidents_list', }, - // Common pagination field { id: 'page_size', title: 'Page Size', @@ -345,7 +321,6 @@ export const IncidentioBlock: BlockConfig = { }, mode: 'advanced', }, - // Pagination 'after' field for list operations { id: 'after', title: 'After (Pagination)', @@ -394,7 +369,6 @@ export const IncidentioBlock: BlockConfig = { condition: { field: 'operation', value: 'incidentio_incidents_list' }, mode: 'advanced', }, - // Incidents Create operation inputs { id: 'summary', title: 'Summary', @@ -467,7 +441,6 @@ Return ONLY the summary text - no explanations.`, condition: { field: 'operation', value: 'incidentio_incidents_create' }, required: true, }, - // Show/Update Incident inputs { id: 'id', title: 'ID', @@ -555,7 +528,6 @@ Return ONLY the name - no explanations.`, placeholder: 'Describe the name you want to use...', }, }, - // Escalations inputs { id: 'idempotency_key', title: 'Idempotency Key', @@ -604,7 +576,6 @@ Return ONLY the title - no explanations.`, placeholder: 'Enter user IDs, comma-separated (required if no path ID)...', condition: { field: 'operation', value: 'incidentio_escalations_create' }, }, - // Actions List inputs { id: 'incident_id', title: 'Incident ID', @@ -652,7 +623,6 @@ Return ONLY the title - no explanations.`, }, mode: 'advanced', }, - // Workflows inputs { id: 'folder', title: 'Folder', @@ -846,7 +816,6 @@ Return ONLY the title - no explanations.`, mode: 'advanced', required: { field: 'operation', value: 'incidentio_workflows_update' }, }, - // Schedules inputs { id: 'timezone', title: 'Timezone', @@ -912,7 +881,6 @@ Return ONLY the JSON object - no explanations or markdown formatting.`, generationType: 'json-object', }, }, - // Custom Fields inputs { id: 'description', title: 'Description', @@ -956,7 +924,6 @@ Return ONLY the description text - no explanations.`, condition: { field: 'operation', value: 'incidentio_custom_fields_create' }, required: true, }, - // Incident Roles inputs { id: 'instructions', title: 'Instructions', @@ -991,8 +958,6 @@ Return ONLY the instructions text - no explanations.`, }, required: true, }, - // Incident Updates inputs - // Schedule Entries inputs { id: 'schedule_id', title: 'Schedule ID', @@ -1056,7 +1021,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Schedule Overrides inputs { id: 'rotation_id', title: 'Rotation ID', @@ -1161,7 +1125,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Escalation Paths inputs { id: 'path', title: 'Path Configuration', @@ -1215,7 +1178,6 @@ Return ONLY the JSON array - no explanations or markdown formatting.`, generationType: 'json-object', }, }, - // Alerts inputs { id: 'alert_status', title: 'Alert Status', @@ -1406,7 +1368,6 @@ Return ONLY the JSON object - no explanations, no markdown fences.`, generationType: 'json-object', }, }, - // Catalog inputs { id: 'catalog_type_id', title: 'Catalog Type ID', @@ -1423,7 +1384,6 @@ Return ONLY the JSON object - no explanations, no markdown fences.`, condition: { field: 'operation', value: 'incidentio_catalog_entries_list' }, mode: 'advanced', }, - // Follow-up and Action inputs { id: 'follow_up_title', title: 'Follow-up Title', @@ -1560,7 +1520,6 @@ Return ONLY the description - no explanations.`, }, mode: 'advanced', }, - // API Key (common) { id: 'apiKey', title: 'API Key', @@ -1569,7 +1528,6 @@ Return ONLY the description - no explanations.`, password: true, required: true, }, - // Trigger subBlocks (webhook configuration) ...getTrigger('incidentio_incident_created').subBlocks, ...getTrigger('incidentio_incident_updated').subBlocks, ...getTrigger('incidentio_incident_status_updated').subBlocks, @@ -1836,14 +1794,12 @@ Return ONLY the description - no explanations.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'incident.io API key' }, - // Common fields id: { type: 'string', description: 'Resource ID' }, name: { type: 'string', description: 'Resource name' }, page_size: { type: 'number', description: 'Number of results per page' }, after: { type: 'string', description: 'Pagination cursor' }, sort_by: { type: 'string', description: 'Incident sort order' }, filter_mode: { type: 'string', description: 'Incident filter combination mode' }, - // Incident fields summary: { type: 'string', description: 'Incident summary' }, severity_id: { type: 'string', description: 'Severity ID' }, incident_type_id: { type: 'string', description: 'Incident type ID' }, @@ -1855,7 +1811,6 @@ Return ONLY the description - no explanations.`, type: 'boolean', description: 'Whether to notify the incident channel', }, - // Workflow fields folder: { type: 'string', description: 'Workflow folder' }, state: { type: 'string', description: 'Workflow state' }, trigger: { type: 'string', description: 'Workflow trigger type' }, @@ -1881,16 +1836,12 @@ Return ONLY the description - no explanations.`, once_for: { type: 'string', description: 'Workflow run-once fields JSON' }, expressions: { type: 'string', description: 'Workflow expressions JSON' }, delay: { type: 'string', description: 'Workflow delay JSON' }, - // Schedule fields timezone: { type: 'string', description: 'Schedule timezone' }, - // Custom field fields description: { type: 'string', description: 'Custom field description' }, field_type: { type: 'string', description: 'Custom field type' }, idempotency_key: { type: 'string', description: 'Unique key to prevent duplicate creation' }, - // Incident Roles fields role_type: { type: 'string', description: 'Type of incident role' }, required: { type: 'boolean', description: 'Whether the role is required' }, - // Schedule Entries/Overrides fields schedule_id: { type: 'string', description: 'Schedule ID' }, entry_window_start: { type: 'string', description: 'Schedule entry window start' }, entry_window_end: { type: 'string', description: 'Schedule entry window end' }, @@ -1901,10 +1852,8 @@ Return ONLY the description - no explanations.`, start_at: { type: 'string', description: 'Start date/time' }, end_at: { type: 'string', description: 'End date/time' }, layer_id: { type: 'string', description: 'Schedule layer ID' }, - // Escalation Paths fields path: { type: 'json', description: 'Escalation path configuration' }, working_hours: { type: 'json', description: 'Working hours configuration' }, - // Alert fields alert_id: { type: 'string', description: 'Alert ID' }, alert_status: { type: 'string', description: 'Alert status (firing, resolved)' }, status_operator: { type: 'string', description: 'How to match the alert status filter' }, @@ -1927,10 +1876,8 @@ Return ONLY the description - no explanations.`, alert_description: { type: 'string', description: 'Alert description' }, source_url: { type: 'string', description: 'Link to the alert in the upstream system' }, metadata: { type: 'string', description: 'Alert metadata JSON' }, - // Catalog fields catalog_type_id: { type: 'string', description: 'Catalog type ID' }, identifier: { type: 'string', description: 'Catalog entry identifier to match' }, - // Follow-up and Action fields follow_up_title: { type: 'string', description: 'Follow-up title' }, follow_up_description: { type: 'string', description: 'Follow-up description' }, action_description: { type: 'string', description: 'Action description' }, @@ -1943,73 +1890,51 @@ Return ONLY the description - no explanations.`, labels: { type: 'string', description: 'Comma-separated follow-up labels' }, }, outputs: { - // Incidents incidents: { type: 'json', description: 'List of incidents' }, incident: { type: 'json', description: 'Incident details' }, - // Actions actions: { type: 'json', description: 'List of actions' }, action: { type: 'json', description: 'Action details' }, - // Follow-ups follow_ups: { type: 'json', description: 'List of follow-ups' }, follow_up: { type: 'json', description: 'Follow-up details' }, - // Users users: { type: 'json', description: 'List of users' }, user: { type: 'json', description: 'User details' }, - // Workflows workflows: { type: 'json', description: 'List of workflows' }, workflow: { type: 'json', description: 'Workflow details' }, management_meta: { type: 'json', description: 'Workflow management metadata' }, - // Schedules schedules: { type: 'json', description: 'List of schedules' }, schedule: { type: 'json', description: 'Schedule details' }, - // Escalations escalations: { type: 'json', description: 'List of escalations' }, escalation: { type: 'json', description: 'Escalation details' }, - // Custom Fields custom_fields: { type: 'json', description: 'List of custom fields' }, custom_field: { type: 'json', description: 'Custom field details' }, - // Reference Data severities: { type: 'json', description: 'List of severities' }, incident_statuses: { type: 'json', description: 'List of incident statuses' }, incident_types: { type: 'json', description: 'List of incident types' }, - // Incident Roles incident_roles: { type: 'json', description: 'List of incident roles' }, incident_role: { type: 'json', description: 'Incident role details' }, - // Incident Timestamps incident_timestamps: { type: 'json', description: 'List of incident timestamps' }, incident_timestamp: { type: 'json', description: 'Incident timestamp details' }, - // Incident Updates incident_updates: { type: 'json', description: 'List of incident updates' }, - // Schedule Entries schedule_entries: { type: 'json', description: 'List of schedule entries' }, - // Schedule Overrides override: { type: 'json', description: 'Schedule override details' }, - // Escalation Paths escalation_paths: { type: 'json', description: 'List of escalation paths' }, escalation_path: { type: 'json', description: 'Escalation path details' }, - // On-call on_call: { type: 'json', description: 'Shifts that are ongoing right now' }, next_on_call: { type: 'json', description: 'Shifts that take over at the next changeover' }, - // Schedule Overrides overrides: { type: 'json', description: 'List of schedule overrides' }, - // Alerts alerts: { type: 'json', description: 'List of alerts' }, alert: { type: 'json', description: 'Alert details' }, incident_alerts: { type: 'json', description: 'List of incident-to-alert connections' }, deduplication_key: { type: 'string', description: 'Deduplication key of the alert event' }, status: { type: 'string', description: 'Status of the alert event' }, - // Catalog catalog_types: { type: 'json', description: 'List of catalog types' }, catalog_entries: { type: 'json', description: 'List of catalog entries' }, catalog_type: { type: 'json', description: 'The catalog type the entries belong to' }, - // Teams teams: { type: 'json', description: 'List of teams' }, team: { type: 'json', description: 'Team details' }, - // Incident people active: { type: 'json', description: 'Participants actively helping with the incident' }, passive: { type: 'json', description: 'Participants observing the incident' }, incident_membership: { type: 'json', description: 'Incident membership details' }, - // General message: { type: 'string', description: 'Operation result message' }, pagination_meta: { type: 'json', description: 'Pagination metadata' }, }, diff --git a/apps/sim/blocks/blocks/intercom.ts b/apps/sim/blocks/blocks/intercom.ts index efd4fbdd8a0..fa071f0cf10 100644 --- a/apps/sim/blocks/blocks/intercom.ts +++ b/apps/sim/blocks/blocks/intercom.ts @@ -175,7 +175,6 @@ export const IntercomBlock: BlockConfig = { placeholder: 'Enter your Intercom access token', required: true, }, - // Contact fields { id: 'role', title: 'Role', @@ -395,7 +394,6 @@ Return ONLY the query - no explanations.`, value: ['search_contacts', 'search_conversations'], }, }, - // Company fields { id: 'companyId', title: 'Company ID', @@ -502,7 +500,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Conversation fields { id: 'conversationId', title: 'Conversation ID', @@ -661,7 +658,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Ticket fields { id: 'ticketId', title: 'Ticket ID', @@ -782,7 +778,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, value: ['create_ticket'], }, }, - // Message fields { id: 'message_type_msg', title: 'Message Type', @@ -901,7 +896,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Pagination fields { id: 'per_page', title: 'Per Page', @@ -944,7 +938,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, value: ['list_companies'], }, }, - // Close/Open conversation body { id: 'close_body', title: 'Closing Message', @@ -955,7 +948,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, value: ['close_conversation'], }, }, - // Snooze conversation { id: 'snoozed_until', title: 'Snooze Until', @@ -980,7 +972,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Assign conversation { id: 'assignee_id', title: 'Assignee ID', @@ -1002,7 +993,6 @@ Return ONLY the numeric timestamp - no explanations, no quotes, no extra text.`, value: ['assign_conversation'], }, }, - // Update ticket fields { id: 'update_ticket_attributes', title: 'Ticket Attributes', @@ -1079,7 +1069,6 @@ Return ONLY the numeric timestamp.`, value: ['update_ticket'], }, }, - // Tag fields { id: 'tagId', title: 'Tag ID', @@ -1112,7 +1101,6 @@ Return ONLY the numeric timestamp.`, value: ['create_tag'], }, }, - // Contact ID for tag/untag/note operations { id: 'tag_contact_id', title: 'Contact ID', @@ -1130,7 +1118,6 @@ Return ONLY the numeric timestamp.`, ], }, }, - // Note fields { id: 'note_body', title: 'Note Content', @@ -1150,7 +1137,6 @@ Return ONLY the note text - no explanations.`, placeholder: 'Describe the note content (e.g., "customer requested callback")...', }, }, - // Event fields { id: 'event_name', title: 'Event Name', @@ -1233,7 +1219,6 @@ Return ONLY the numeric timestamp.`, generationType: 'timestamp', }, }, - // Company attachment fields { id: 'attach_company_id', title: 'Company ID', @@ -1382,17 +1367,14 @@ Return ONLY the numeric timestamp.`, } = params const cleanParams: Record = {} - // Special mapping for message_type in create_message if (operation === 'create_message' && message_type_msg) { cleanParams.message_type = message_type_msg } - // Special mapping for company name if (operation === 'create_company' && company_name) { cleanParams.name = company_name } - // Map contact_company_id to company_id for contact operations if ( (operation === 'create_contact' || operation === 'update_contact') && contact_company_id @@ -1400,12 +1382,10 @@ Return ONLY the numeric timestamp.`, cleanParams.company_id = contact_company_id } - // Map reply_created_at to created_at for reply_conversation if (operation === 'reply_conversation' && reply_created_at) { cleanParams.created_at = Number(reply_created_at) } - // Map ticket fields for create_ticket if (operation === 'create_ticket') { if (ticket_company_id) cleanParams.company_id = ticket_company_id if (ticket_created_at) cleanParams.created_at = Number(ticket_created_at) @@ -1414,12 +1394,10 @@ Return ONLY the numeric timestamp.`, } } - // Map message_created_at to created_at for create_message if (operation === 'create_message' && message_created_at) { cleanParams.created_at = Number(message_created_at) } - // Convert include_translations string to boolean for get_conversation if ( operation === 'get_conversation' && include_translations !== undefined && @@ -1428,17 +1406,14 @@ Return ONLY the numeric timestamp.`, cleanParams.include_translations = include_translations === 'true' } - // Map close_body to body for close_conversation if (operation === 'close_conversation' && close_body) { cleanParams.body = close_body } - // Map assign_body to body for assign_conversation if (operation === 'assign_conversation' && assign_body) { cleanParams.body = assign_body } - // Map tag_contact_id to contactId for tag/note/company attachment operations if ( [ 'tag_contact', @@ -1452,7 +1427,6 @@ Return ONLY the numeric timestamp.`, cleanParams.contactId = tag_contact_id } - // Map attach_company_id to companyId for company attachment operations if ( ['attach_contact_to_company', 'detach_contact_from_company'].includes(operation) && attach_company_id @@ -1460,7 +1434,6 @@ Return ONLY the numeric timestamp.`, cleanParams.companyId = attach_company_id } - // Map update_ticket fields if (operation === 'update_ticket') { if (update_ticket_attributes) cleanParams.ticket_attributes = update_ticket_attributes if (ticket_open !== undefined && ticket_open !== '') { @@ -1473,18 +1446,15 @@ Return ONLY the numeric timestamp.`, if (ticket_assignee_id) cleanParams.assignee_id = ticket_assignee_id } - // Map tag fields for create_tag if (operation === 'create_tag') { if (tag_name) cleanParams.name = tag_name if (tag_id_update) cleanParams.id = tag_id_update } - // Map note_body to body for create_note if (operation === 'create_note' && note_body) { cleanParams.body = note_body } - // Map event fields for create_event if (operation === 'create_event') { if (event_user_id) cleanParams.user_id = event_user_id if (event_email) cleanParams.email = event_email @@ -1681,17 +1651,14 @@ export const IntercomV2Block: BlockConfig = { } = params const cleanParams: Record = {} - // Special mapping for message_type in create_message if (operation === 'create_message' && message_type_msg) { cleanParams.message_type = message_type_msg } - // Special mapping for company name if (operation === 'create_company' && company_name) { cleanParams.name = company_name } - // Map contact_company_id to company_id for contact operations if ( (operation === 'create_contact' || operation === 'update_contact') && contact_company_id @@ -1699,12 +1666,10 @@ export const IntercomV2Block: BlockConfig = { cleanParams.company_id = contact_company_id } - // Map reply_created_at to created_at for reply_conversation if (operation === 'reply_conversation' && reply_created_at) { cleanParams.created_at = Number(reply_created_at) } - // Map ticket fields for create_ticket if (operation === 'create_ticket') { if (ticket_company_id) cleanParams.company_id = ticket_company_id if (ticket_created_at) cleanParams.created_at = Number(ticket_created_at) @@ -1713,12 +1678,10 @@ export const IntercomV2Block: BlockConfig = { } } - // Map message_created_at to created_at for create_message if (operation === 'create_message' && message_created_at) { cleanParams.created_at = Number(message_created_at) } - // Convert include_translations string to boolean for get_conversation if ( operation === 'get_conversation' && include_translations !== undefined && @@ -1727,17 +1690,14 @@ export const IntercomV2Block: BlockConfig = { cleanParams.include_translations = include_translations === 'true' } - // Map close_body to body for close_conversation if (operation === 'close_conversation' && close_body) { cleanParams.body = close_body } - // Map assign_body to body for assign_conversation if (operation === 'assign_conversation' && assign_body) { cleanParams.body = assign_body } - // Map tag_contact_id to contactId for tag/note/company attachment operations if ( [ 'tag_contact', @@ -1751,7 +1711,6 @@ export const IntercomV2Block: BlockConfig = { cleanParams.contactId = tag_contact_id } - // Map attach_company_id to companyId for company attachment operations if ( ['attach_contact_to_company', 'detach_contact_from_company'].includes(operation) && attach_company_id @@ -1759,7 +1718,6 @@ export const IntercomV2Block: BlockConfig = { cleanParams.companyId = attach_company_id } - // Map update_ticket fields if (operation === 'update_ticket') { if (update_ticket_attributes) cleanParams.ticket_attributes = update_ticket_attributes if (ticket_open !== undefined && ticket_open !== '') { @@ -1772,18 +1730,15 @@ export const IntercomV2Block: BlockConfig = { if (ticket_assignee_id) cleanParams.assignee_id = ticket_assignee_id } - // Map tag fields for create_tag if (operation === 'create_tag') { if (tag_name) cleanParams.name = tag_name if (tag_id_update) cleanParams.id = tag_id_update } - // Map note_body to body for create_note if (operation === 'create_note' && note_body) { cleanParams.body = note_body } - // Map event fields for create_event if (operation === 'create_event') { if (event_user_id) cleanParams.user_id = event_user_id if (event_email) cleanParams.email = event_email diff --git a/apps/sim/blocks/blocks/jira.ts b/apps/sim/blocks/blocks/jira.ts index 44127da9104..96047c4ac28 100644 --- a/apps/sim/blocks/blocks/jira.ts +++ b/apps/sim/blocks/blocks/jira.ts @@ -200,7 +200,6 @@ export const JiraBlock: BlockConfig = { placeholder: 'Enter credential ID', required: true, }, - // Project selector (basic mode) { id: 'projectId', title: 'Select Project', @@ -213,7 +212,6 @@ export const JiraBlock: BlockConfig = { mode: 'basic', required: { field: 'operation', value: ['write', 'read-bulk', 'get_project'] }, }, - // Manual project ID input (advanced mode) { id: 'manualProjectId', title: 'Project ID', @@ -224,7 +222,6 @@ export const JiraBlock: BlockConfig = { mode: 'advanced', required: { field: 'operation', value: ['write', 'read-bulk', 'get_project'] }, }, - // Issue selector (basic mode) { id: 'issueKey', title: 'Select Issue', @@ -282,7 +279,6 @@ export const JiraBlock: BlockConfig = { }, mode: 'basic', }, - // Manual issue key input (advanced mode) { id: 'manualIssueKey', title: 'Issue Key', @@ -377,7 +373,6 @@ Return ONLY the description text - no explanations.`, 'Describe the issue details (e.g., "users seeing 500 error when clicking submit")...', }, }, - // Write Issue type and parent { id: 'issueType', title: 'Issue Type', @@ -396,7 +391,6 @@ Return ONLY the description text - no explanations.`, condition: { field: 'operation', value: 'write' }, mode: 'advanced', }, - // Write/Update Issue additional fields { id: 'assignee', title: 'Assignee Account ID', @@ -499,7 +493,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n condition: { field: 'operation', value: 'update' }, mode: 'advanced', }, - // Delete Issue fields { id: 'deleteSubtasks', title: 'Delete Subtasks', @@ -512,7 +505,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n condition: { field: 'operation', value: 'delete' }, mode: 'advanced', }, - // Assign Issue fields { id: 'accountId', title: 'Account ID', @@ -521,7 +513,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n placeholder: 'Enter user account ID to assign', condition: { field: 'operation', value: ['assign', 'add_watcher', 'remove_watcher'] }, }, - // Transition Issue fields { id: 'transitionId', title: 'Transition ID', @@ -556,7 +547,6 @@ Return ONLY the comment text - no explanations.`, condition: { field: 'operation', value: 'transition' }, mode: 'advanced', }, - // Search Issues fields { id: 'jql', title: 'JQL Query', @@ -613,7 +603,6 @@ Return ONLY the JQL query - no explanations or markdown formatting.`, condition: { field: 'operation', value: 'search' }, mode: 'advanced', }, - // Comment fields { id: 'commentBody', title: 'Comment Text', @@ -642,7 +631,6 @@ Return ONLY the comment text - no explanations.`, placeholder: 'Enter comment ID', condition: { field: 'operation', value: ['update_comment', 'delete_comment'] }, }, - // Attachment fields { id: 'attachmentFiles', title: 'Attachments', @@ -672,7 +660,6 @@ Return ONLY the comment text - no explanations.`, placeholder: 'Enter attachment ID', condition: { field: 'operation', value: 'delete_attachment' }, }, - // Worklog fields { id: 'timeSpentSeconds', title: 'Time Spent (seconds)', @@ -736,7 +723,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, placeholder: 'Enter worklog ID', condition: { field: 'operation', value: ['update_worklog', 'delete_worklog'] }, }, - // Issue Link fields { id: 'inwardIssueKey', title: 'Inward Issue Key', @@ -789,7 +775,6 @@ Return ONLY the comment text - no explanations.`, placeholder: 'Enter link ID to delete', condition: { field: 'operation', value: 'delete_link' }, }, - // Get Users fields { id: 'userAccountId', title: 'Account ID', @@ -814,7 +799,6 @@ Return ONLY the comment text - no explanations.`, condition: { field: 'operation', value: 'get_users' }, mode: 'advanced', }, - // Search Users fields { id: 'searchUsersQuery', title: 'Search Query', @@ -839,7 +823,6 @@ Return ONLY the comment text - no explanations.`, condition: { field: 'operation', value: 'search_users' }, mode: 'advanced', }, - // List Projects fields { id: 'projectSearchQuery', title: 'Project Filter', @@ -863,7 +846,6 @@ Return ONLY the comment text - no explanations.`, condition: { field: 'operation', value: 'list_projects' }, mode: 'advanced', }, - // Trigger SubBlocks ...getTrigger('jira_issue_created').subBlocks, ...getTrigger('jira_issue_updated').subBlocks, ...getTrigger('jira_issue_deleted').subBlocks, @@ -994,7 +976,6 @@ Return ONLY the comment text - no explanations.`, switch (params.operation) { case 'write': { - // Parse comma-separated strings into arrays const parseCommaSeparated = (value: string | undefined): string[] | undefined => { if (!value || value.trim() === '') return undefined return value @@ -1066,7 +1047,6 @@ Return ONLY the comment text - no explanations.`, return { ...baseParams, issueKey: effectiveIssueKey, - // Include projectId if available for context ...(effectiveProjectId && { projectId: effectiveProjectId }), } } @@ -1317,11 +1297,9 @@ Return ONLY the comment text - no explanations.`, oauthCredential: { type: 'string', description: 'Jira access token' }, issueKey: { type: 'string', description: 'Issue key identifier (canonical param)' }, projectId: { type: 'string', description: 'Project identifier (canonical param)' }, - // Update/Write operation inputs summary: { type: 'string', description: 'Issue summary' }, description: { type: 'string', description: 'Issue description' }, issueType: { type: 'string', description: 'Issue type' }, - // Write/Update operation additional inputs parentIssue: { type: 'string', description: 'Parent issue key for subtasks' }, assignee: { type: 'string', description: 'Assignee account ID' }, priority: { type: 'string', description: 'Priority ID or name' }, @@ -1334,18 +1312,14 @@ Return ONLY the comment text - no explanations.`, customFieldId: { type: 'string', description: 'Custom field ID (e.g., customfield_10001)' }, customFieldValue: { type: 'string', description: 'Value for the custom field' }, notifyUsers: { type: 'string', description: 'Whether to send notifications on update' }, - // Delete operation inputs deleteSubtasks: { type: 'string', description: 'Whether to delete subtasks (true/false)' }, - // Assign/Watcher operation inputs accountId: { type: 'string', description: 'User account ID for assignment or watcher operations', }, - // Transition operation inputs transitionId: { type: 'string', description: 'Transition ID for workflow status changes' }, transitionComment: { type: 'string', description: 'Optional comment for transition' }, resolution: { type: 'string', description: 'Resolution name for transition (e.g., "Fixed")' }, - // Search operation inputs nextPageToken: { type: 'string', description: 'Cursor token for the next page of search results', @@ -1357,13 +1331,10 @@ Return ONLY the comment text - no explanations.`, type: 'string', description: 'Comma-separated field names to return (e.g., key,summary,status)', }, - // Comment operation inputs commentBody: { type: 'string', description: 'Text content for comment operations' }, commentId: { type: 'string', description: 'Comment ID for update/delete operations' }, - // Attachment operation inputs files: { type: 'array', description: 'Files to attach (canonical param)' }, attachmentId: { type: 'string', description: 'Attachment ID for delete operation' }, - // Worklog operation inputs timeSpentSeconds: { type: 'string', description: 'Time spent in seconds for add worklog (required)', @@ -1375,27 +1346,23 @@ Return ONLY the comment text - no explanations.`, worklogComment: { type: 'string', description: 'Optional comment for worklog' }, started: { type: 'string', description: 'ISO timestamp when work started (optional)' }, worklogId: { type: 'string', description: 'Worklog ID for update/delete operations' }, - // Issue Link operation inputs inwardIssueKey: { type: 'string', description: 'Inward issue key for creating link' }, outwardIssueKey: { type: 'string', description: 'Outward issue key for creating link' }, linkType: { type: 'string', description: 'Type of link (e.g., "Blocks", "Relates")' }, linkComment: { type: 'string', description: 'Optional comment for issue link' }, linkId: { type: 'string', description: 'Link ID for delete operation' }, - // Get Users operation inputs userAccountId: { type: 'string', description: 'Account ID for specific user lookup (optional)', }, usersStartAt: { type: 'string', description: 'Pagination start index for users' }, usersMaxResults: { type: 'string', description: 'Maximum users to return' }, - // Search Users operation inputs searchUsersQuery: { type: 'string', description: 'Search query (email address or display name)', }, searchUsersMaxResults: { type: 'string', description: 'Maximum users to return from search' }, searchUsersStartAt: { type: 'string', description: 'Pagination start index for user search' }, - // List Projects operation inputs projectSearchQuery: { type: 'string', description: 'Filter projects by partial name or key match', @@ -1410,10 +1377,8 @@ Return ONLY the comment text - no explanations.`, }, }, outputs: { - // Common outputs across all Jira operations ts: { type: 'string', description: 'Timestamp of the operation' }, - // jira_retrieve (read) outputs issueKey: { type: 'string', description: 'Issue key (e.g., PROJ-123)' }, summary: { type: 'string', description: 'Issue summary/title' }, description: { type: 'string', description: 'Issue description content' }, @@ -1422,12 +1387,10 @@ Return ONLY the comment text - no explanations.`, status: { type: 'string', description: 'Issue status name' }, assignee: { type: 'string', description: 'Issue assignee display name or account ID' }, - // jira_write (create) outputs url: { type: 'string', description: 'URL to the created/accessed issue' }, id: { type: 'string', description: 'Jira issue ID' }, key: { type: 'string', description: 'Jira issue key' }, - // jira_search_issues / jira_bulk_read outputs total: { type: 'number', description: 'Total number of matching issues' }, nextPageToken: { type: 'string', description: 'Cursor token for the next page of results' }, isLast: { type: 'boolean', description: 'Whether this is the last page of results' }, @@ -1439,18 +1402,15 @@ Return ONLY the comment text - no explanations.`, description: 'Array of matching issues with key, summary, status, assignee, dates', }, - // jira_get_comments outputs comments: { type: 'json', description: 'Array of comments with id, author, body, created, updated', }, - // jira_add_comment, jira_update_comment outputs commentId: { type: 'string', description: 'Comment ID' }, commentBody: { type: 'string', description: 'Comment text content' }, author: { type: 'string', description: 'Comment author display name' }, - // jira_get_attachments outputs attachments: { type: 'json', description: 'Array of attachments with id, filename, size, mimeType, created, author', @@ -1461,70 +1421,57 @@ Return ONLY the comment text - no explanations.`, // jira_delete_attachment, jira_delete_comment, jira_delete_issue, jira_delete_worklog, jira_delete_issue_link outputs attachmentId: { type: 'string', description: 'Deleted attachment ID' }, - // jira_get_worklogs outputs worklogs: { type: 'json', description: 'Array of worklogs with id, author, timeSpentSeconds, timeSpent, comment, created, updated, started', }, - // jira_add_worklog, jira_update_worklog outputs worklogId: { type: 'string', description: 'Worklog ID' }, timeSpentSeconds: { type: 'number', description: 'Time spent in seconds' }, timeSpent: { type: 'string', description: 'Formatted time spent string' }, - // jira_assign_issue outputs assigneeId: { type: 'string', description: 'Assigned user account ID' }, - // jira_transition_issue outputs transitionId: { type: 'string', description: 'Applied transition ID' }, newStatus: { type: 'string', description: 'New status after transition' }, - // jira_create_issue_link outputs linkId: { type: 'string', description: 'Created link ID' }, inwardIssue: { type: 'string', description: 'Inward issue key' }, outwardIssue: { type: 'string', description: 'Outward issue key' }, linkType: { type: 'string', description: 'Type of issue link' }, - // jira_add_watcher, jira_remove_watcher outputs watcherAccountId: { type: 'string', description: 'Watcher account ID' }, - // jira_get_users outputs users: { type: 'json', description: 'Array of users with accountId, displayName, emailAddress, active status', }, - // jira_list_projects outputs projects: { type: 'json', description: 'Array of projects with id, key, name, projectTypeKey, and lead', }, - // jira_get_project / jira_list_issue_types outputs projectTypeKey: { type: 'string', description: 'Project type key (e.g., software, business)' }, issueTypes: { type: 'json', description: 'Array of issue types with id, name, description, subtask, hierarchyLevel', }, - // jira_get_transitions outputs transitions: { type: 'json', description: 'Array of available workflow transitions with id, name, and target status', }, - // jira_get_fields outputs fields: { type: 'json', description: 'Array of Jira fields with id, key, name, custom flag, and schema type', }, - // jira_bulk_read outputs // Note: bulk_read returns an array in the output field, each item contains: // ts, issueKey, summary, description, status, assignee, created, updated - // Trigger outputs (from webhook events) event_type: { type: 'string', description: 'Webhook event type' }, issue_id: { type: 'string', description: 'Issue ID from webhook' }, issue_key: { type: 'string', description: 'Issue key from webhook' }, diff --git a/apps/sim/blocks/blocks/kalshi.ts b/apps/sim/blocks/blocks/kalshi.ts index 75f2d53c2cb..187631e81c7 100644 --- a/apps/sim/blocks/blocks/kalshi.ts +++ b/apps/sim/blocks/blocks/kalshi.ts @@ -140,7 +140,6 @@ export const KalshiBlock: BlockConfig = { ], value: () => 'get_markets', }, - // Auth fields (for authenticated operations) { id: 'keyId', title: 'API Key ID', @@ -184,7 +183,6 @@ export const KalshiBlock: BlockConfig = { }, required: true, }, - // Get Markets fields { id: 'status', title: 'Status', @@ -228,7 +226,6 @@ export const KalshiBlock: BlockConfig = { ], }, }, - // Get Market fields - ticker is REQUIRED for get_market (path param) { id: 'ticker', title: 'Market Ticker', @@ -237,7 +234,6 @@ export const KalshiBlock: BlockConfig = { required: true, condition: { field: 'operation', value: ['get_market', 'get_orderbook'] }, }, - // Ticker filter for get_orders and get_positions - OPTIONAL { id: 'tickerFilter', title: 'Market Ticker', @@ -246,7 +242,6 @@ export const KalshiBlock: BlockConfig = { condition: { field: 'operation', value: ['get_orders', 'get_positions', 'get_settlements'] }, mode: 'advanced', }, - // Nested markets option { id: 'withNestedMarkets', title: 'Include Markets', @@ -258,7 +253,6 @@ export const KalshiBlock: BlockConfig = { condition: { field: 'operation', value: ['get_events', 'get_event'] }, mode: 'advanced', }, - // Get Orders fields { id: 'orderStatus', title: 'Order Status', @@ -272,7 +266,6 @@ export const KalshiBlock: BlockConfig = { condition: { field: 'operation', value: ['get_orders'] }, mode: 'advanced', }, - // Get Fills timestamp filters { id: 'minTs', title: 'Min Timestamp', @@ -315,7 +308,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, generationType: 'timestamp', }, }, - // Get Candlesticks fields { id: 'seriesTickerCandlesticks', title: 'Series Ticker', @@ -386,7 +378,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, required: true, condition: { field: 'operation', value: ['get_candlesticks', 'get_event_candlesticks'] }, }, - // Get Fills fields { id: 'tickerFills', title: 'Market Ticker', @@ -403,7 +394,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, condition: { field: 'operation', value: ['get_fills'] }, mode: 'advanced', }, - // Get Series by Ticker fields { id: 'seriesTickerGet', title: 'Series Ticker', @@ -412,7 +402,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, required: true, condition: { field: 'operation', value: ['get_series_by_ticker'] }, }, - // Get Series List fields { id: 'category', title: 'Category', @@ -429,7 +418,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, condition: { field: 'operation', value: ['get_series_list'] }, mode: 'advanced', }, - // Order ID for get_order, cancel_order, amend_order { id: 'orderIdParam', title: 'Order ID', @@ -438,7 +426,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, required: true, condition: { field: 'operation', value: ['get_order', 'cancel_order', 'amend_order'] }, }, - // Create Order fields { id: 'tickerOrder', title: 'Market Ticker', @@ -593,7 +580,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, condition: { field: 'operation', value: ['create_order'] }, mode: 'advanced', }, - // Pagination fields { id: 'limit', title: 'Limit', @@ -727,12 +713,10 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, } = params const cleanParams: Record = {} - // Map orderStatus to status for get_orders if (operation === 'get_orders' && orderStatus) { cleanParams.status = orderStatus } - // Map tickerFilter to ticker for get_orders, get_positions, and get_settlements if ( (operation === 'get_orders' || operation === 'get_positions' || @@ -742,12 +726,10 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, cleanParams.ticker = tickerFilter } - // Map tickerFills to ticker for get_fills if (operation === 'get_fills' && tickerFills) { cleanParams.ticker = tickerFills } - // Map fields for get_candlesticks if (operation === 'get_candlesticks') { if (seriesTickerCandlesticks) cleanParams.seriesTicker = seriesTickerCandlesticks if (tickerCandlesticks) cleanParams.ticker = tickerCandlesticks @@ -758,12 +740,10 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, cleanParams.seriesTicker = seriesTickerCandlesticks } - // Map seriesTickerGet to seriesTicker for get_series_by_ticker if (operation === 'get_series_by_ticker' && seriesTickerGet) { cleanParams.seriesTicker = seriesTickerGet } - // Map orderIdParam to orderId for get_order, cancel_order, amend_order if ( (operation === 'get_order' || operation === 'cancel_order' || @@ -773,22 +753,18 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, cleanParams.orderId = orderIdParam } - // Map tickerOrder to ticker for create_order, amend_order if ((operation === 'create_order' || operation === 'amend_order') && tickerOrder) { cleanParams.ticker = tickerOrder } - // Map orderType to type for create_order if (operation === 'create_order' && orderType) { cleanParams.type = orderType } - // Map countAmend to count for amend_order if (operation === 'amend_order' && countAmend) { cleanParams.count = countAmend } - // Map clientOrderIdAmend to clientOrderId for amend_order if (operation === 'amend_order' && clientOrderIdAmend) { cleanParams.clientOrderId = clientOrderIdAmend } @@ -812,7 +788,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, status: { type: 'string', description: 'Filter by status' }, }, outputs: { - // List operations markets: { type: 'json', description: 'Array of market objects (get_markets)' }, events: { type: 'json', description: 'Array of event objects (get_events)' }, orders: { type: 'json', description: 'Array of order objects (get_orders)' }, @@ -825,7 +800,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, description: 'Event-level aggregated candlestick data (get_event_candlesticks)', }, settlements: { type: 'json', description: 'Array of settlement objects (get_settlements)' }, - // Single item operations market: { type: 'json', description: 'Single market object (get_market)' }, event: { type: 'json', description: 'Single event object (get_event)' }, order: { @@ -833,11 +807,8 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, description: 'Single order object (get_order, create_order, amend_order, cancel_order)', }, series: { type: 'json', description: 'Series object (get_series_by_ticker)' }, - // Account operations balance: { type: 'number', description: 'Account balance in cents (get_balance)' }, - // Orderbook orderbook: { type: 'json', description: 'Orderbook data with bids/asks (get_orderbook)' }, - // Exchange status status: { type: 'json', description: 'Exchange status (get_exchange_status)' }, schedule: { type: 'json', @@ -847,7 +818,6 @@ Return ONLY the numeric timestamp (seconds since Unix epoch) - no explanations, type: 'json', description: 'Array of exchange announcements (get_exchange_announcements)', }, - // Pagination paging: { type: 'json', description: 'Pagination cursor for fetching more results' }, }, } @@ -982,7 +952,6 @@ export const KalshiV2Block: BlockConfig = { type: 'json', description: 'Array of milestone objects (get_events with milestones)', }, - // Single item operations market: { type: 'json', description: 'Single market object (get_market)' }, event: { type: 'json', description: 'Single event object (get_event)' }, order: { @@ -990,7 +959,6 @@ export const KalshiV2Block: BlockConfig = { description: 'Order object with _dollars and _fp fields (get_order, create_order, etc.)', }, series: { type: 'json', description: 'Series object (get_series_by_ticker)' }, - // Account operations balance: { type: 'number', description: 'Account balance in cents (get_balance)' }, portfolio_value: { type: 'number', description: 'Portfolio value in cents (get_balance)' }, updated_ts: { type: 'number', description: 'Unix timestamp of last update (get_balance)' }, @@ -1003,7 +971,6 @@ export const KalshiV2Block: BlockConfig = { type: 'json', description: 'Fixed-point orderbook with yes_dollars/no_dollars tuple arrays', }, - // Exchange status exchange_active: { type: 'boolean', description: 'Exchange active flag (get_exchange_status)' }, trading_active: { type: 'boolean', description: 'Trading active flag (get_exchange_status)' }, exchange_estimated_resume_time: { @@ -1018,13 +985,11 @@ export const KalshiV2Block: BlockConfig = { type: 'json', description: 'Array of exchange announcements (get_exchange_announcements)', }, - // Cancel order specific reduced_by: { type: 'number', description: 'Number of contracts reduced (cancel_order)' }, reduced_by_fp: { type: 'string', description: 'Contracts reduced in fixed-point (cancel_order)', }, - // Candlesticks ticker ticker: { type: 'string', description: 'Market ticker (get_candlesticks)' }, // Pagination (flat cursor instead of nested paging object) cursor: { type: 'string', description: 'Pagination cursor for fetching more results' }, diff --git a/apps/sim/blocks/blocks/knowledge.ts b/apps/sim/blocks/blocks/knowledge.ts index cdc6767f973..99b18d453c9 100644 --- a/apps/sim/blocks/blocks/knowledge.ts +++ b/apps/sim/blocks/blocks/knowledge.ts @@ -213,7 +213,7 @@ export const KnowledgeBlock: BlockConfig = { condition: getCohereRerankerApiKeyCondition(), }, - // --- List Documents --- + // List Documents { id: 'search', title: 'Search', @@ -294,7 +294,7 @@ export const KnowledgeBlock: BlockConfig = { }, }, - // --- Upload Chunk --- + // Upload Chunk { id: 'content', title: 'Chunk Content', @@ -305,7 +305,7 @@ export const KnowledgeBlock: BlockConfig = { condition: { field: 'operation', value: 'upload_chunk' }, }, - // --- Create Document / Upsert Document --- + // Create Document / Upsert Document { id: 'name', title: 'Document Name', @@ -338,7 +338,7 @@ export const KnowledgeBlock: BlockConfig = { condition: { field: 'operation', value: ['create_document', 'upsert_document'] }, }, - // --- Update Chunk / Delete Chunk --- + // Update Chunk / Delete Chunk { id: 'chunkId', title: 'Chunk ID', @@ -366,7 +366,7 @@ export const KnowledgeBlock: BlockConfig = { condition: { field: 'operation', value: 'update_chunk' }, }, - // --- Connector operations --- + // Connector operations { id: 'connectorId', title: 'Connector ID', @@ -376,7 +376,7 @@ export const KnowledgeBlock: BlockConfig = { condition: { field: 'operation', value: ['get_connector', 'trigger_sync'] }, }, - // --- List Chunks --- + // List Chunks { id: 'chunkSearch', title: 'Search', diff --git a/apps/sim/blocks/blocks/leadmagic.ts b/apps/sim/blocks/blocks/leadmagic.ts index 24af8201d70..7189774d305 100644 --- a/apps/sim/blocks/blocks/leadmagic.ts +++ b/apps/sim/blocks/blocks/leadmagic.ts @@ -84,7 +84,6 @@ export const LeadMagicBlock: BlockConfig = { value: () => 'leadmagic_find_email', }, - // --- Find Email --- { id: 'fe_full_name', title: 'Full Name', @@ -108,7 +107,6 @@ export const LeadMagicBlock: BlockConfig = { mode: 'advanced', }, - // --- Validate Email --- { id: 've_email', title: 'Email Address', @@ -118,7 +116,6 @@ export const LeadMagicBlock: BlockConfig = { condition: { field: 'operation', value: 'leadmagic_validate_email' }, }, - // --- Find Mobile --- { id: 'fm_profile_url', title: 'LinkedIn Profile URL', @@ -135,7 +132,6 @@ export const LeadMagicBlock: BlockConfig = { mode: 'advanced', }, - // --- Profile Search --- { id: 'ps_profile_url', title: 'LinkedIn Profile URL', @@ -157,7 +153,6 @@ export const LeadMagicBlock: BlockConfig = { mode: 'advanced', }, - // --- Profile to Email --- { id: 'pte_profile_url', title: 'LinkedIn Profile URL', @@ -167,7 +162,6 @@ export const LeadMagicBlock: BlockConfig = { condition: { field: 'operation', value: 'leadmagic_profile_to_email' }, }, - // --- Email to Profile --- { id: 'etp_work_email', title: 'Work Email', @@ -184,7 +178,6 @@ export const LeadMagicBlock: BlockConfig = { mode: 'advanced', }, - // --- Company Search --- { id: 'cs_company_domain', title: 'Company Domain', @@ -209,7 +202,6 @@ export const LeadMagicBlock: BlockConfig = { mode: 'advanced', }, - // --- Role Finder --- { id: 'rf_job_title', title: 'Job Title', @@ -296,27 +288,19 @@ export const LeadMagicBlock: BlockConfig = { const { operation: _operation, ...rest } = params const idToParam: Record = { - // Find Email fe_full_name: 'full_name', fe_domain: 'domain', fe_company_name: 'company_name', - // Validate Email ve_email: 'email', - // Find Mobile fm_profile_url: 'profile_url', fm_work_email: 'work_email', - // Profile Search ps_profile_url: 'profile_url', - // Profile to Email pte_profile_url: 'profile_url', - // Email to Profile etp_work_email: 'work_email', etp_personal_email: 'personal_email', - // Company Search cs_company_domain: 'company_domain', cs_profile_url: 'profile_url', cs_company_name: 'company_name', - // Role Finder rf_job_title: 'job_title', rf_company_domain: 'company_domain', rf_company_name: 'company_name', @@ -340,38 +324,28 @@ export const LeadMagicBlock: BlockConfig = { inputs: { operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'LeadMagic API key' }, - // Find Email fe_full_name: { type: 'string', description: 'Full name (find email)' }, fe_domain: { type: 'string', description: 'Company domain (find email)' }, fe_company_name: { type: 'string', description: 'Company name (find email)' }, - // Validate Email ve_email: { type: 'string', description: 'Email address to validate' }, - // Find Mobile fm_profile_url: { type: 'string', description: 'LinkedIn profile URL (find mobile)' }, fm_work_email: { type: 'string', description: 'Work email (find mobile)' }, - // Profile Search ps_profile_url: { type: 'string', description: 'LinkedIn profile URL (profile search)' }, extended_response: { type: 'boolean', description: 'Include profile image URL' }, - // Profile to Email pte_profile_url: { type: 'string', description: 'LinkedIn profile URL (profile to email)' }, - // Email to Profile etp_work_email: { type: 'string', description: 'Work email (email to profile)' }, etp_personal_email: { type: 'string', description: 'Personal email (email to profile)' }, - // Company Search cs_company_domain: { type: 'string', description: 'Company domain (company search)' }, cs_profile_url: { type: 'string', description: 'LinkedIn company URL (company search)' }, cs_company_name: { type: 'string', description: 'Company name (company search)' }, - // Role Finder rf_job_title: { type: 'string', description: 'Job title to find (role finder)' }, rf_company_domain: { type: 'string', description: 'Company domain (role finder)' }, rf_company_name: { type: 'string', description: 'Company name (role finder)' }, }, outputs: { - // Shared credits_consumed: { type: 'number', description: 'Credits charged for this request' }, message: { type: 'string', description: 'Human-readable status message' }, - // Validate Email email_status: { type: 'string', description: 'Validation result: valid, invalid, or unknown', @@ -384,14 +358,11 @@ export const LeadMagicBlock: BlockConfig = { type: 'boolean', description: 'Whether the domain uses a security gateway', }, - // Find Email / Profile To Email / Validate email: { type: 'string', description: 'Email address' }, employment_verified: { type: 'boolean', description: 'Whether employment was verified' }, has_mx: { type: 'boolean', description: 'Whether the domain has a valid MX record' }, company_profile_url: { type: 'string', description: 'Company B2B profile URL' }, - // Find Mobile mobile_number: { type: 'string', description: 'Direct mobile phone number' }, - // Profile Search first_name: { type: 'string', description: 'First name' }, last_name: { type: 'string', description: 'Last name' }, full_name: { type: 'string', description: 'Full name' }, @@ -408,9 +379,7 @@ export const LeadMagicBlock: BlockConfig = { work_experience: { type: 'array', description: 'Work history entries' }, education: { type: 'array', description: 'Education history entries' }, certifications: { type: 'array', description: 'Professional certifications' }, - // Email to Profile profile_url: { type: 'string', description: 'LinkedIn profile URL' }, - // Company Search companyName: { type: 'string', description: 'Company name' }, companyId: { type: 'number', description: 'Internal company ID' }, industry: { type: 'string', description: 'Industry classification' }, @@ -428,9 +397,7 @@ export const LeadMagicBlock: BlockConfig = { facebook_url: { type: 'string', description: 'Facebook page URL' }, b2b_profile_url: { type: 'string', description: 'LinkedIn company profile URL' }, logo_url: { type: 'string', description: 'Company logo URL' }, - // Role Finder job_title: { type: 'string', description: 'Verified job title at the company' }, - // Get Credits credits: { type: 'number', description: 'Remaining credit balance' }, }, } diff --git a/apps/sim/blocks/blocks/linear.ts b/apps/sim/blocks/blocks/linear.ts index 803e41bd579..b1d2eb2e8e3 100644 --- a/apps/sim/blocks/blocks/linear.ts +++ b/apps/sim/blocks/blocks/linear.ts @@ -334,7 +334,6 @@ export const LinearBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Issue Operations { label: 'Read Issues', id: 'linear_read_issues' }, { label: 'Get Issue', id: 'linear_get_issue' }, { label: 'Create Issue', id: 'linear_create_issue' }, @@ -345,90 +344,70 @@ export const LinearBlock: BlockConfig = { { label: 'Search Issues', id: 'linear_search_issues' }, { label: 'Add Label to Issue', id: 'linear_add_label_to_issue' }, { label: 'Remove Label from Issue', id: 'linear_remove_label_from_issue' }, - // Comment Operations { label: 'Create Comment', id: 'linear_create_comment' }, { label: 'Update Comment', id: 'linear_update_comment' }, { label: 'Delete Comment', id: 'linear_delete_comment' }, { label: 'List Comments', id: 'linear_list_comments' }, - // Project Operations { label: 'List Projects', id: 'linear_list_projects' }, { label: 'Get Project', id: 'linear_get_project' }, { label: 'Create Project', id: 'linear_create_project' }, { label: 'Update Project', id: 'linear_update_project' }, { label: 'Archive Project', id: 'linear_archive_project' }, - // User & Team Operations { label: 'List Users', id: 'linear_list_users' }, { label: 'List Teams', id: 'linear_list_teams' }, { label: 'Get Viewer', id: 'linear_get_viewer' }, - // Label Operations { label: 'List Labels', id: 'linear_list_labels' }, { label: 'Create Label', id: 'linear_create_label' }, { label: 'Update Label', id: 'linear_update_label' }, { label: 'Archive Label', id: 'linear_archive_label' }, - // Workflow State Operations { label: 'List Workflow States', id: 'linear_list_workflow_states' }, { label: 'Create Workflow State', id: 'linear_create_workflow_state' }, { label: 'Update Workflow State', id: 'linear_update_workflow_state' }, - // Cycle Operations { label: 'List Cycles', id: 'linear_list_cycles' }, { label: 'Get Cycle', id: 'linear_get_cycle' }, { label: 'Create Cycle', id: 'linear_create_cycle' }, { label: 'Get Active Cycle', id: 'linear_get_active_cycle' }, - // Attachment Operations { label: 'Create Attachment', id: 'linear_create_attachment' }, { label: 'List Attachments', id: 'linear_list_attachments' }, { label: 'Update Attachment', id: 'linear_update_attachment' }, { label: 'Delete Attachment', id: 'linear_delete_attachment' }, - // Issue Relation Operations { label: 'Create Issue Relation', id: 'linear_create_issue_relation' }, { label: 'List Issue Relations', id: 'linear_list_issue_relations' }, { label: 'Delete Issue Relation', id: 'linear_delete_issue_relation' }, - // Favorite Operations { label: 'Create Favorite', id: 'linear_create_favorite' }, { label: 'List Favorites', id: 'linear_list_favorites' }, - // Project Update Operations { label: 'Create Project Update', id: 'linear_create_project_update' }, { label: 'List Project Updates', id: 'linear_list_project_updates' }, - // Notification Operations { label: 'List Notifications', id: 'linear_list_notifications' }, { label: 'Update Notification', id: 'linear_update_notification' }, - // Customer Operations { label: 'Create Customer', id: 'linear_create_customer' }, { label: 'List Customers', id: 'linear_list_customers' }, - // Customer Request Operations { label: 'Create Customer Request', id: 'linear_create_customer_request' }, { label: 'Update Customer Request', id: 'linear_update_customer_request' }, { label: 'List Customer Requests', id: 'linear_list_customer_requests' }, - // Customer Management Operations { label: 'Get Customer', id: 'linear_get_customer' }, { label: 'Update Customer', id: 'linear_update_customer' }, { label: 'Delete Customer', id: 'linear_delete_customer' }, { label: 'Merge Customers', id: 'linear_merge_customers' }, - // Customer Status Operations { label: 'Create Customer Status', id: 'linear_create_customer_status' }, { label: 'Update Customer Status', id: 'linear_update_customer_status' }, { label: 'Delete Customer Status', id: 'linear_delete_customer_status' }, { label: 'List Customer Statuses', id: 'linear_list_customer_statuses' }, - // Customer Tier Operations { label: 'Create Customer Tier', id: 'linear_create_customer_tier' }, { label: 'Update Customer Tier', id: 'linear_update_customer_tier' }, { label: 'Delete Customer Tier', id: 'linear_delete_customer_tier' }, { label: 'List Customer Tiers', id: 'linear_list_customer_tiers' }, - // Project Management Operations { label: 'Delete Project', id: 'linear_delete_project' }, - // Project Label Operations { label: 'Create Project Label', id: 'linear_create_project_label' }, { label: 'Update Project Label', id: 'linear_update_project_label' }, { label: 'Delete Project Label', id: 'linear_delete_project_label' }, { label: 'List Project Labels', id: 'linear_list_project_labels' }, { label: 'Add Label to Project', id: 'linear_add_label_to_project' }, { label: 'Remove Label from Project', id: 'linear_remove_label_from_project' }, - // Project Milestone Operations { label: 'Create Project Milestone', id: 'linear_create_project_milestone' }, { label: 'Update Project Milestone', id: 'linear_update_project_milestone' }, { label: 'Delete Project Milestone', id: 'linear_delete_project_milestone' }, { label: 'List Project Milestones', id: 'linear_list_project_milestones' }, - // Project Status Operations { label: 'Create Project Status', id: 'linear_create_project_status' }, { label: 'Update Project Status', id: 'linear_update_project_status' }, { label: 'Delete Project Status', id: 'linear_delete_project_status' }, @@ -456,7 +435,6 @@ export const LinearBlock: BlockConfig = { placeholder: 'Enter credential ID', required: true, }, - // Team selector (for most operations) { id: 'teamId', title: 'Team', @@ -496,7 +474,6 @@ export const LinearBlock: BlockConfig = { ], }, }, - // Manual team ID input (advanced mode) { id: 'manualTeamId', title: 'Team ID', @@ -534,7 +511,6 @@ export const LinearBlock: BlockConfig = { ], }, }, - // Project selector (for issue creation) { id: 'projectId', title: 'Project', @@ -571,7 +547,6 @@ export const LinearBlock: BlockConfig = { ], }, }, - // Manual project ID input (advanced mode) { id: 'manualProjectId', title: 'Project ID', @@ -606,7 +581,6 @@ export const LinearBlock: BlockConfig = { ], }, }, - // Issue ID input (for operations requiring issue ID) { id: 'issueId', title: 'Issue ID', @@ -632,7 +606,6 @@ export const LinearBlock: BlockConfig = { ], }, }, - // Title (for issue creation/update) { id: 'title', title: 'Title', @@ -655,7 +628,6 @@ Return ONLY the title text - no explanations.`, placeholder: 'Describe the issue (e.g., "login not working", "add export feature")...', }, }, - // Description (for issue creation/update, comments, projects) { id: 'description', title: 'Description', @@ -682,7 +654,6 @@ Return ONLY the description text - no explanations.`, placeholder: 'Describe the details (e.g., "users report errors when logging in")...', }, }, - // Comment body { id: 'body', title: 'Comment', @@ -709,7 +680,6 @@ Return ONLY the comment text - no explanations.`, 'Describe what you want to communicate (e.g., "progress update", "request for review")...', }, }, - // Comment ID { id: 'commentId', title: 'Comment ID', @@ -721,7 +691,6 @@ Return ONLY the comment text - no explanations.`, value: ['linear_update_comment', 'linear_delete_comment'], }, }, - // Label ID { id: 'labelId', title: 'Label ID', @@ -738,7 +707,6 @@ Return ONLY the comment text - no explanations.`, ], }, }, - // Label name (for creating labels) { id: 'name', title: 'Name', @@ -761,7 +729,6 @@ Return ONLY the comment text - no explanations.`, ], }, }, - // Label color { id: 'color', title: 'Color (hex)', @@ -777,7 +744,6 @@ Return ONLY the comment text - no explanations.`, ], }, }, - // State ID (for issue updates) { id: 'stateId', title: 'State ID', @@ -788,7 +754,6 @@ Return ONLY the comment text - no explanations.`, value: ['linear_update_issue', 'linear_update_workflow_state'], }, }, - // Assignee ID (for issue operations) { id: 'assigneeId', title: 'Assignee ID', @@ -799,7 +764,6 @@ Return ONLY the comment text - no explanations.`, value: ['linear_create_issue', 'linear_update_issue'], }, }, - // Priority (for issues and projects) { id: 'priority', title: 'Priority', @@ -817,7 +781,6 @@ Return ONLY the comment text - no explanations.`, value: ['linear_create_issue', 'linear_update_issue', 'linear_create_project'], }, }, - // Estimate (for issues) { id: 'estimate', title: 'Estimate', @@ -828,7 +791,6 @@ Return ONLY the comment text - no explanations.`, value: ['linear_create_issue', 'linear_update_issue'], }, }, - // Search query { id: 'query', title: 'Search Query', @@ -852,7 +814,6 @@ Return ONLY the search query - no explanations.`, 'Describe what you want to search for (e.g., "open bugs", "my assigned tasks")...', }, }, - // Include archived (for list operations) { id: 'includeArchived', title: 'Include Archived', @@ -862,7 +823,6 @@ Return ONLY the search query - no explanations.`, value: ['linear_read_issues', 'linear_search_issues', 'linear_list_projects'], }, }, - // Issue filtering options for read_issues (advanced) { id: 'labelIds', title: 'Label IDs', @@ -907,7 +867,6 @@ Return ONLY the search query - no explanations.`, value: 'linear_read_issues', }, }, - // Cycle ID { id: 'cycleId', title: 'Cycle ID', @@ -919,7 +878,6 @@ Return ONLY the search query - no explanations.`, value: ['linear_get_cycle'], }, }, - // Cycle start/end dates { id: 'startDate', title: 'Start Date', @@ -971,7 +929,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n generationType: 'timestamp', }, }, - // Target date (for projects) { id: 'targetDate', title: 'Target Date', @@ -995,7 +952,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n generationType: 'timestamp', }, }, - // Attachment file { id: 'attachmentFileUpload', title: 'Attachment', @@ -1021,7 +977,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n }, mode: 'advanced', }, - // Attachment URL { id: 'url', title: 'URL', @@ -1034,7 +989,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n }, mode: 'advanced', }, - // Attachment title { id: 'attachmentTitle', title: 'Title', @@ -1046,7 +1000,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_attachment', 'linear_update_attachment'], }, }, - // Attachment ID { id: 'attachmentId', title: 'Attachment ID', @@ -1058,7 +1011,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_update_attachment', 'linear_delete_attachment'], }, }, - // Issue relation type { id: 'relationType', title: 'Relation Type', @@ -1075,7 +1027,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_issue_relation'], }, }, - // Related issue ID { id: 'relatedIssueId', title: 'Related Issue ID', @@ -1087,7 +1038,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_issue_relation'], }, }, - // Relation ID { id: 'relationId', title: 'Relation ID', @@ -1099,7 +1049,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_delete_issue_relation'], }, }, - // Favorite type { id: 'favoriteType', title: 'Favorite Type', @@ -1116,7 +1065,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_favorite'], }, }, - // Favorite target ID { id: 'favoriteTargetId', title: 'Target ID', @@ -1128,7 +1076,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_favorite'], }, }, - // Pagination - First (for list operations) { id: 'first', title: 'Limit', @@ -1161,7 +1108,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n ], }, }, - // Pagination - After (for list operations) { id: 'after', title: 'After Cursor', @@ -1194,7 +1140,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n ], }, }, - // Project health (for project updates) { id: 'health', title: 'Project Health', @@ -1210,7 +1155,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_project_update'], }, }, - // Notification ID { id: 'notificationId', title: 'Notification ID', @@ -1222,7 +1166,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_update_notification'], }, }, - // Mark as read { id: 'markAsRead', title: 'Mark as Read', @@ -1232,7 +1175,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_update_notification'], }, }, - // Workflow state type { id: 'workflowType', title: 'Workflow Type', @@ -1250,7 +1192,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_workflow_state'], }, }, - // Lead ID (for projects) { id: 'leadId', title: 'Lead ID', @@ -1261,7 +1202,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_project', 'linear_update_project'], }, }, - // Project state { id: 'projectState', title: 'Project State', @@ -1272,7 +1212,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_update_project'], }, }, - // Customer name (for creating/updating customer) { id: 'customerName', title: 'Customer Name', @@ -1284,7 +1223,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_customer', 'linear_update_customer'], }, }, - // Customer domains { id: 'customerDomains', title: 'Domains', @@ -1295,7 +1233,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_customer', 'linear_update_customer'], }, }, - // Customer external IDs { id: 'customerExternalIds', title: 'External IDs', @@ -1306,7 +1243,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_customer', 'linear_update_customer'], }, }, - // Customer logo URL { id: 'customerLogoUrl', title: 'Logo URL', @@ -1317,7 +1253,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_customer', 'linear_update_customer'], }, }, - // Customer owner ID { id: 'customerOwnerId', title: 'Owner User ID', @@ -1328,7 +1263,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_customer', 'linear_update_customer'], }, }, - // Customer revenue { id: 'customerRevenue', title: 'Annual Revenue', @@ -1339,7 +1273,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_customer', 'linear_update_customer'], }, }, - // Customer size { id: 'customerSize', title: 'Organization Size', @@ -1350,7 +1283,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_customer', 'linear_update_customer'], }, }, - // Customer ID (for customer request operations) { id: 'customerId', title: 'Customer ID', @@ -1362,7 +1294,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_customer_request', 'linear_update_customer_request'], }, }, - // Customer request ID (for updating) { id: 'customerNeedId', title: 'Customer Request ID', @@ -1374,7 +1305,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_update_customer_request'], }, }, - // Customer request body/description { id: 'requestBody', title: 'Request Description', @@ -1397,7 +1327,6 @@ Return ONLY the description text - no explanations.`, 'Describe the customer request (e.g., "need bulk export feature", "integration with Slack")...', }, }, - // Customer request priority/urgency { id: 'customerRequestPriority', title: 'Urgency', @@ -1412,7 +1341,6 @@ Return ONLY the description text - no explanations.`, value: ['linear_create_customer_request', 'linear_update_customer_request'], }, }, - // Link customer request to issue { id: 'linkedIssueId', title: 'Link to Issue', @@ -1423,7 +1351,6 @@ Return ONLY the description text - no explanations.`, value: ['linear_create_customer_request', 'linear_update_customer_request'], }, }, - // Customer ID for get/update/delete/merge operations { id: 'customerIdTarget', title: 'Customer ID', @@ -1435,7 +1362,6 @@ Return ONLY the description text - no explanations.`, value: ['linear_get_customer', 'linear_update_customer', 'linear_delete_customer'], }, }, - // Source and target customer IDs for merge { id: 'sourceCustomerId', title: 'Source Customer ID (to merge from)', @@ -1458,7 +1384,6 @@ Return ONLY the description text - no explanations.`, value: ['linear_merge_customers'], }, }, - // Customer status/tier fields { id: 'statusName', title: 'Status Name', @@ -1519,7 +1444,6 @@ Return ONLY the description text - no explanations.`, value: ['linear_update_customer_tier', 'linear_delete_customer_tier'], }, }, - // Project label fields { id: 'projectLabelName', title: 'Label Name', @@ -1581,7 +1505,6 @@ Return ONLY the description text - no explanations.`, ], }, }, - // Project milestone fields { id: 'milestoneName', title: 'Milestone Name', @@ -1637,7 +1560,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n generationType: 'timestamp', }, }, - // Project status fields { id: 'projectStatusName', title: 'Status Name', @@ -1704,7 +1626,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n value: ['linear_create_project_status', 'linear_update_project_status'], }, }, - // Project ID for milestone/label operations { id: 'projectIdForMilestone', title: 'Project ID', @@ -1721,7 +1642,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n ], }, }, - // Trigger SubBlocks ...getTrigger('linear_issue_created').subBlocks, ...getTrigger('linear_issue_updated').subBlocks, ...getTrigger('linear_issue_removed').subBlocks, @@ -1828,12 +1748,10 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n const effectiveTeamId = params.teamId ? String(params.teamId).trim() : '' const effectiveProjectId = params.projectId ? String(params.projectId).trim() : '' - // Base params that most operations need const baseParams: Record = { oauthCredential: params.oauthCredential, } - // Operation-specific param mapping switch (params.operation) { case 'linear_read_issues': return { @@ -2142,7 +2060,7 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n if (!params.issueId?.trim()) { throw new Error('Issue ID is required.') } - // Normalize file input - use canonical param 'file' (raw subBlock IDs are deleted after serialization) + // Canonical param 'file': raw subBlock IDs are deleted after serialization const attachmentFile = normalizeFileInput(params.file, { single: true, errorMessage: 'Attachment file must be a single file.', @@ -2343,7 +2261,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n includeArchived: false, } - // Customer Management Operations case 'linear_get_customer': if (!params.customerIdTarget?.trim()) { throw new Error('Customer ID is required.') @@ -2394,7 +2311,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n targetCustomerId: params.targetCustomerId.trim(), } - // Customer Status Operations case 'linear_create_customer_status': if (!params.statusName?.trim() || !params.statusColor?.trim()) { throw new Error('Status name and color are required.') @@ -2436,7 +2352,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n after: params.after?.trim() || undefined, } - // Customer Tier Operations case 'linear_create_customer_tier': if (!params.tierName?.trim() || !params.statusColor?.trim()) { throw new Error('Tier name and color are required.') @@ -2478,7 +2393,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n after: params.after?.trim() || undefined, } - // Project Management Operations case 'linear_delete_project': if (!effectiveProjectId) { throw new Error('Project ID is required.') @@ -2488,7 +2402,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n projectId: effectiveProjectId, } - // Project Label Operations case 'linear_create_project_label': if (!params.projectLabelName?.trim()) { throw new Error('Project label name is required.') @@ -2551,7 +2464,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n labelId: params.projectLabelId.trim(), } - // Project Milestone Operations case 'linear_create_project_milestone': if (!params.projectIdForMilestone?.trim() || !params.milestoneName?.trim()) { throw new Error('Project ID and milestone name are required.') @@ -2596,7 +2508,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n after: params.after?.trim() || undefined, } - // Project Status Operations case 'linear_create_project_status': if ( !params.projectStatusName?.trim() || @@ -2710,7 +2621,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n customerNeedId: { type: 'string', description: 'Customer request identifier' }, requestBody: { type: 'string', description: 'Customer request description' }, linkedIssueId: { type: 'string', description: 'Issue ID to link to customer request' }, - // New customer management inputs customerIdTarget: { type: 'string', description: 'Customer ID for operations' }, sourceCustomerId: { type: 'string', description: 'Source customer ID for merge' }, targetCustomerId: { type: 'string', description: 'Target customer ID for merge' }, @@ -2719,7 +2629,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n customerOwnerId: { type: 'string', description: 'Customer owner user ID' }, customerRevenue: { type: 'number', description: 'Customer annual revenue' }, customerSize: { type: 'number', description: 'Customer organization size' }, - // Customer status and tier inputs statusId: { type: 'string', description: 'Status identifier' }, statusName: { type: 'string', description: 'Status name' }, statusColor: { type: 'string', description: 'Status color in hex format' }, @@ -2729,7 +2638,6 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n tierName: { type: 'string', description: 'Tier name' }, tierDisplayName: { type: 'string', description: 'Tier display name' }, tierDescription: { type: 'string', description: 'Tier description' }, - // Project label inputs projectLabelId: { type: 'string', description: 'Project label identifier' }, projectLabelName: { type: 'string', description: 'Project label name' }, projectLabelDescription: { type: 'string', description: 'Project label description' }, @@ -2738,13 +2646,11 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n type: 'string', description: 'Parent label ID for hierarchical labels', }, - // Project milestone inputs projectIdForMilestone: { type: 'string', description: 'Project ID for milestone operations' }, milestoneId: { type: 'string', description: 'Milestone identifier' }, milestoneName: { type: 'string', description: 'Milestone name' }, milestoneDescription: { type: 'string', description: 'Milestone description' }, milestoneTargetDate: { type: 'string', description: 'Milestone target date (YYYY-MM-DD)' }, - // Project status inputs projectStatusId: { type: 'string', description: 'Project status identifier' }, projectStatusName: { type: 'string', description: 'Project status name' }, projectStatusDescription: { type: 'string', description: 'Project status description' }, @@ -2754,75 +2660,54 @@ Return ONLY the date string in YYYY-MM-DD format - no explanations, no quotes, n }, }, outputs: { - // Issue outputs issues: { type: 'json', description: 'Issues list' }, issue: { type: 'json', description: 'Single issue data' }, issueId: { type: 'string', description: 'Issue ID for operations' }, - // Comment outputs comment: { type: 'json', description: 'Comment data' }, comments: { type: 'json', description: 'Comments list' }, - // Project outputs project: { type: 'json', description: 'Project data' }, projects: { type: 'json', description: 'Projects list' }, projectId: { type: 'string', description: 'Project ID for operations' }, - // User/Team outputs users: { type: 'json', description: 'Users list' }, teams: { type: 'json', description: 'Teams list' }, user: { type: 'json', description: 'User data' }, viewer: { type: 'json', description: 'Current user data' }, - // Label outputs label: { type: 'json', description: 'Label data' }, labels: { type: 'json', description: 'Labels list' }, labelId: { type: 'string', description: 'Label ID for operations' }, - // Workflow state outputs state: { type: 'json', description: 'Workflow state data' }, states: { type: 'json', description: 'Workflow states list' }, - // Cycle outputs cycle: { type: 'json', description: 'Cycle data' }, cycles: { type: 'json', description: 'Cycles list' }, - // Attachment outputs attachment: { type: 'json', description: 'Attachment data' }, attachments: { type: 'json', description: 'Attachments list' }, - // Relation outputs relation: { type: 'json', description: 'Issue relation data' }, relations: { type: 'json', description: 'Issue relations list' }, - // Favorite outputs favorite: { type: 'json', description: 'Favorite data' }, favorites: { type: 'json', description: 'Favorites list' }, - // Project update outputs update: { type: 'json', description: 'Project update data' }, updates: { type: 'json', description: 'Project updates list' }, - // Notification outputs notification: { type: 'json', description: 'Notification data' }, notifications: { type: 'json', description: 'Notifications list' }, - // Customer outputs customer: { type: 'json', description: 'Customer data' }, customers: { type: 'json', description: 'Customers list' }, - // Customer request outputs customerNeed: { type: 'json', description: 'Customer request data' }, customerNeeds: { type: 'json', description: 'Customer requests list' }, - // Customer status and tier outputs customerStatus: { type: 'json', description: 'Customer status data' }, customerStatuses: { type: 'json', description: 'Customer statuses list' }, customerTier: { type: 'json', description: 'Customer tier data' }, customerTiers: { type: 'json', description: 'Customer tiers list' }, - // Project label outputs projectLabel: { type: 'json', description: 'Project label data' }, projectLabels: { type: 'json', description: 'Project labels list' }, - // Project milestone outputs projectMilestone: { type: 'json', description: 'Project milestone data' }, projectMilestones: { type: 'json', description: 'Project milestones list' }, - // Project status outputs projectStatus: { type: 'json', description: 'Project status data' }, projectStatuses: { type: 'json', description: 'Project statuses list' }, - // Pagination pageInfo: { type: 'json', description: 'Pagination information (hasNextPage, endCursor) for list operations', }, - // Success indicators success: { type: 'boolean', description: 'Operation success status' }, - // Trigger outputs action: { type: 'string', description: 'Webhook action (create, update, remove)' }, type: { type: 'string', @@ -2892,7 +2777,6 @@ export const LinearV2Block: BlockConfig = { !sb.id?.startsWith('triggerInstructions') && !sb.id?.startsWith('selectedTriggerId') ), - // V2 Trigger SubBlocks ...getTrigger('linear_issue_created_v2').subBlocks, ...getTrigger('linear_issue_updated_v2').subBlocks, ...getTrigger('linear_issue_removed_v2').subBlocks, diff --git a/apps/sim/blocks/blocks/logrocket.ts b/apps/sim/blocks/blocks/logrocket.ts index 10d4c09a8fc..e42d31f59bc 100644 --- a/apps/sim/blocks/blocks/logrocket.ts +++ b/apps/sim/blocks/blocks/logrocket.ts @@ -94,7 +94,7 @@ export const LogRocketBlock: BlockConfig = { mode: 'advanced', }, - // --- Request Highlights fields --- + // Request Highlights fields { id: 'highlightsUserEmail', title: 'User Email', @@ -153,7 +153,7 @@ export const LogRocketBlock: BlockConfig = { mode: 'advanced', }, - // --- Get Highlights fields --- + // Get Highlights fields { id: 'highlightsRequestId', title: 'Request ID', @@ -163,7 +163,7 @@ export const LogRocketBlock: BlockConfig = { condition: { field: 'operation', value: 'get_highlights' }, }, - // --- List Exported Sessions fields --- + // List Exported Sessions fields { id: 'exportLimit', title: 'Limit', @@ -195,7 +195,7 @@ export const LogRocketBlock: BlockConfig = { }, }, - // --- Get Audit Logs fields --- + // Get Audit Logs fields { id: 'auditLimit', title: 'Limit', @@ -213,7 +213,7 @@ export const LogRocketBlock: BlockConfig = { mode: 'advanced', }, - // --- Identify User fields --- + // Identify User fields { id: 'profileUserId', title: 'User ID', @@ -264,7 +264,7 @@ export const LogRocketBlock: BlockConfig = { }, }, - // --- Create Release fields --- + // Create Release fields { id: 'version', title: 'Version', diff --git a/apps/sim/blocks/blocks/microsoft_planner.ts b/apps/sim/blocks/blocks/microsoft_planner.ts index 7edf172f0e4..bfe0eb5bec4 100644 --- a/apps/sim/blocks/blocks/microsoft_planner.ts +++ b/apps/sim/blocks/blocks/microsoft_planner.ts @@ -164,7 +164,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { placeholder: 'Enter credential ID', }, - // Plan selector - basic mode { id: 'planSelector', title: 'Plan', @@ -204,7 +203,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { }, }, - // Plan ID - advanced mode { id: 'planId', title: 'Plan ID', @@ -242,7 +240,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { dependsOn: ['credential'], }, - // Task ID selector - for read_task (basic mode) { id: 'taskSelector', title: 'Task ID', @@ -256,7 +253,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { canonicalParamId: 'readTaskId', }, - // Manual Task ID - for read_task (advanced mode) { id: 'manualReadTaskId', title: 'Manual Task ID', @@ -282,7 +278,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { dependsOn: ['credential'], }, - // Bucket ID for bucket operations { id: 'bucketIdForRead', title: 'Bucket ID', @@ -293,7 +288,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { dependsOn: ['credential'], }, - // ETag for update/delete operations { id: 'etag', title: 'ETag', @@ -316,7 +310,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { dependsOn: ['credential'], }, - // Task fields for create/update { id: 'title', title: 'Task Title', @@ -326,7 +319,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { required: { field: 'operation', value: 'create_task' }, }, - // Name for bucket operations { id: 'name', title: 'Bucket Name', @@ -346,7 +338,6 @@ export const MicrosoftPlannerBlock: BlockConfig = { condition: { field: 'operation', value: ['update_task_details'] }, }, - // Due Date { id: 'dueDateTime', title: 'Due Date', @@ -369,7 +360,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, }, - // Start Date { id: 'startDateTime', title: 'Start Date', @@ -393,7 +383,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, }, - // Assignee { id: 'assigneeUserId', title: 'Assignee User ID', @@ -402,7 +391,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: ['create_task', 'update_task'] }, }, - // Bucket ID for task { id: 'bucketId', title: 'Bucket ID', @@ -411,7 +399,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: ['create_task', 'update_task'] }, }, - // Priority { id: 'priority', title: 'Priority', @@ -421,7 +408,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: ['create_task', 'update_task'] }, }, - // Percent Complete { id: 'percentComplete', title: 'Percent Complete', @@ -431,7 +417,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: ['create_task', 'update_task'] }, }, - // Checklist for task details { id: 'checklist', title: 'Checklist (JSON)', @@ -442,7 +427,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: ['update_task_details'] }, }, - // References for task details { id: 'references', title: 'References (JSON)', @@ -453,7 +437,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: ['update_task_details'] }, }, - // Preview Type { id: 'previewType', title: 'Preview Type', @@ -463,7 +446,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: ['update_task_details'] }, }, - // Group ID for create plan { id: 'groupId', title: 'Microsoft 365 Group ID', @@ -474,7 +456,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, dependsOn: ['credential'], }, - // Plan title for create/update plan { id: 'planTitle', title: 'Plan Title', @@ -518,7 +499,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` condition: { field: 'operation', value: ['update_plan_details'] }, }, - // Shared with for plan details { id: 'sharedWith', title: 'Shared With (JSON)', @@ -599,7 +579,7 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` groupId, planId, readTaskId, // Canonical param from taskSelector (basic) or manualReadTaskId (advanced) for read_task - updateTaskId, // Task ID for update/delete operations + updateTaskId, bucketId, bucketIdForRead, title, @@ -626,17 +606,14 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` oauthCredential, } - // Handle different task ID fields based on operation const effectiveReadTaskId = readTaskId ? String(readTaskId).trim() : '' const effectiveUpdateTaskId = updateTaskId ? String(updateTaskId).trim() : '' const effectiveBucketId = (bucketIdForRead || bucketId || '').trim() - // List Plans if (operation === 'list_plans') { return baseParams } - // Read Plan if (operation === 'read_plan') { return { ...baseParams, @@ -644,7 +621,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Create Plan if (operation === 'create_plan') { return { ...baseParams, @@ -653,7 +629,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Update Plan if (operation === 'update_plan') { return { ...baseParams, @@ -663,7 +638,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Get Plan Details if (operation === 'get_plan_details') { return { ...baseParams, @@ -671,7 +645,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Update Plan Details if (operation === 'update_plan_details') { const updatePlanDetailsParams: MicrosoftPlannerBlockParams = { ...baseParams, @@ -687,7 +660,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` return updatePlanDetailsParams } - // Delete Plan if (operation === 'delete_plan') { return { ...baseParams, @@ -696,7 +668,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // List Buckets if (operation === 'list_buckets') { return { ...baseParams, @@ -704,7 +675,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Read Bucket if (operation === 'read_bucket') { return { ...baseParams, @@ -712,7 +682,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Create Bucket if (operation === 'create_bucket') { return { ...baseParams, @@ -721,7 +690,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Update Bucket if (operation === 'update_bucket') { const updateBucketParams: MicrosoftPlannerBlockParams = { ...baseParams, @@ -734,7 +702,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` return updateBucketParams } - // Delete Bucket if (operation === 'delete_bucket') { return { ...baseParams, @@ -743,7 +710,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Read Task if (operation === 'read_task') { const readParams: MicrosoftPlannerBlockParams = { ...baseParams } @@ -756,7 +722,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` return readParams } - // Create Task if (operation === 'create_task') { const createParams: MicrosoftPlannerBlockParams = { ...baseParams, @@ -789,7 +754,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` return createParams } - // Update Task if (operation === 'update_task') { const updateParams: MicrosoftPlannerBlockParams = { ...baseParams, @@ -825,7 +789,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` return updateParams } - // Delete Task if (operation === 'delete_task') { return { ...baseParams, @@ -834,7 +797,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Get Task Details if (operation === 'get_task_details') { return { ...baseParams, @@ -842,7 +804,6 @@ Return ONLY the comma-separated category keys - no explanations, no extra text.` } } - // Update Task Details if (operation === 'update_task_details') { const updateDetailsParams: MicrosoftPlannerBlockParams = { ...baseParams, diff --git a/apps/sim/blocks/blocks/outlook.ts b/apps/sim/blocks/blocks/outlook.ts index d0d157f9749..929b51e993f 100644 --- a/apps/sim/blocks/blocks/outlook.ts +++ b/apps/sim/blocks/blocks/outlook.ts @@ -244,7 +244,6 @@ export const OutlookBlock: BlockConfig = { value: () => 'text', required: false, }, - // File upload (basic mode) { id: 'attachmentFiles', title: 'Attachments', @@ -256,7 +255,6 @@ export const OutlookBlock: BlockConfig = { multiple: true, required: false, }, - // Variable reference (advanced mode) { id: 'attachmentReference', title: 'Attachments', @@ -267,7 +265,6 @@ export const OutlookBlock: BlockConfig = { mode: 'advanced', required: false, }, - // Advanced Settings - Threading { id: 'replyToMessageId', title: 'Reply to Message ID', @@ -277,7 +274,6 @@ export const OutlookBlock: BlockConfig = { mode: 'advanced', required: false, }, - // Advanced Settings - Additional Recipients { id: 'cc', title: 'CC', @@ -296,7 +292,6 @@ export const OutlookBlock: BlockConfig = { mode: 'advanced', required: false, }, - // Read Email Fields - Add folder selector (basic mode) { id: 'folderSelector', title: 'Folder', @@ -310,7 +305,6 @@ export const OutlookBlock: BlockConfig = { mode: 'basic', condition: { field: 'operation', value: 'read_outlook' }, }, - // Manual folder input (advanced mode) { id: 'manualFolder', title: 'Folder', @@ -337,7 +331,6 @@ export const OutlookBlock: BlockConfig = { type: 'switch', condition: { field: 'operation', value: 'read_outlook' }, }, - // Move Email Fields { id: 'moveMessageId', title: 'Message ID', @@ -346,7 +339,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'move_outlook' }, required: true, }, - // Destination folder selector (basic mode) { id: 'destinationFolder', title: 'Move To Folder', @@ -361,7 +353,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'move_outlook' }, required: true, }, - // Manual destination folder input (advanced mode) { id: 'manualDestinationFolder', title: 'Move To Folder', @@ -373,7 +364,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'move_outlook' }, required: true, }, - // Single-message operations - Message ID field { id: 'actionMessageId', title: 'Message ID', @@ -394,7 +384,6 @@ export const OutlookBlock: BlockConfig = { }, required: true, }, - // Copy Email - Message ID field { id: 'copyMessageId', title: 'Message ID', @@ -403,7 +392,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'copy_outlook' }, required: true, }, - // Copy Email - Destination folder selector (basic mode) { id: 'copyDestinationFolder', title: 'Copy To Folder', @@ -418,7 +406,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'copy_outlook' }, required: true, }, - // Copy Email - Manual destination folder input (advanced mode) { id: 'manualCopyDestinationFolder', title: 'Copy To Folder', @@ -430,7 +417,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'copy_outlook' }, required: true, }, - // Search Email - Query field { id: 'searchQuery', title: 'Search Query', @@ -439,7 +425,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'search_outlook' }, required: true, }, - // List Folders - Include hidden folders toggle { id: 'includeHiddenFolders', title: 'Include Hidden Folders', @@ -447,7 +432,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'list_folders_outlook' }, mode: 'advanced', }, - // Create Folder - Folder name field { id: 'folderName', title: 'Folder Name', @@ -456,7 +440,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'create_folder_outlook' }, required: true, }, - // Create Folder - Hidden toggle { id: 'folderIsHidden', title: 'Hidden Folder', @@ -464,7 +447,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'create_folder_outlook' }, mode: 'advanced', }, - // Get Attachment - Attachment ID field { id: 'attachmentId', title: 'Attachment ID', @@ -473,7 +455,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'get_attachment_outlook' }, required: true, }, - // Set Categories & Flag - Categories field { id: 'categories', title: 'Categories', @@ -482,7 +463,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'update_message_outlook' }, required: false, }, - // Set Categories & Flag - Flag status { id: 'flagStatus', title: 'Flag Status', @@ -495,7 +475,6 @@ export const OutlookBlock: BlockConfig = { condition: { field: 'operation', value: 'update_message_outlook' }, required: false, }, - // Set Categories & Flag - Importance { id: 'importance', title: 'Importance', @@ -509,8 +488,8 @@ export const OutlookBlock: BlockConfig = { mode: 'advanced', required: false, }, - // Calendar - Calendar picker (basic). Only list/create are calendar-scoped: event IDs are - // unique per mailbox, so get/update/delete/respond address /me/events/{id} directly. + // Only list/create are calendar-scoped: event IDs are unique per mailbox, so + // get/update/delete/respond address /me/events/{id} directly. { id: 'calendarSelector', title: 'Calendar', @@ -527,7 +506,6 @@ export const OutlookBlock: BlockConfig = { value: ['list_events_calendar', 'create_event_calendar'], }, }, - // Calendar - Manual calendar ID (advanced) { id: 'manualCalendarId', title: 'Calendar', @@ -541,7 +519,6 @@ export const OutlookBlock: BlockConfig = { value: ['list_events_calendar', 'create_event_calendar'], }, }, - // Calendar - Event ID (get / update / delete / respond) { id: 'calEventId', title: 'Event ID', @@ -558,7 +535,7 @@ export const OutlookBlock: BlockConfig = { }, required: true, }, - // Calendar - Window start/end (list events). Required: calendarView needs both bounds. + // Required: calendarView needs both bounds. { id: 'calWindowStart', title: 'Start of Window', @@ -601,7 +578,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Calendar - List events options { id: 'calMaxResults', title: 'Number of Results', @@ -625,7 +601,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'list_events_calendar' }, mode: 'advanced', }, - // Calendar - Create event (required start/end) { id: 'calSubject', title: 'Subject', @@ -675,7 +650,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Calendar - Update event (optional start/end/subject) { id: 'calSubject', title: 'New Subject', @@ -724,7 +698,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Calendar - Shared create/update fields { id: 'calBody', title: 'Body', @@ -763,7 +736,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: false, }, - // Calendar - Attendees (create / update) { id: 'calAttendees', title: 'Attendees', @@ -816,7 +788,6 @@ Return ONLY the comma-separated email list - no explanations, no extra text.`, }, mode: 'advanced', }, - // Calendar - Respond to invite { id: 'calResponseType', title: 'Response', @@ -976,10 +947,8 @@ Return ONLY the comma-separated email list - no explanations, no extra text.`, // Agent calls may deliver booleans as the strings "true"/"false" const toBool = (value: unknown): boolean => value === true || value === 'true' - // folder is already the canonical param - use it directly const effectiveFolder = folder ? String(folder).trim() : '' - // Normalize file attachments from the canonical attachments param const normalizedAttachments = normalizeFileInput(attachments) if (normalizedAttachments) { rest.attachments = normalizedAttachments @@ -1008,12 +977,10 @@ Return ONLY the comma-separated email list - no explanations, no extra text.`, rest.isHidden = toBool(folderIsHidden) } - // Handle move operation if (rest.operation === 'move_outlook') { if (moveMessageId) { rest.messageId = moveMessageId } - // destinationId is already the canonical param const effectiveDestinationId = destinationId ? String(destinationId).trim() : '' if (effectiveDestinationId) { rest.destinationId = effectiveDestinationId @@ -1061,8 +1028,7 @@ Return ONLY the comma-separated email list - no explanations, no extra text.`, const isSet = (value: unknown): boolean => value !== undefined && value !== null && value !== '' - // calendarId is already the canonical param. Blank means the default calendar, so - // only forward it when the user actually picked one. + // Blank means the default calendar, so only forward it when the user actually picked one. if (['list_events_calendar', 'create_event_calendar'].includes(rest.operation)) { const effectiveCalendarId = calendarId ? String(calendarId).trim() : '' if (effectiveCalendarId) { @@ -1132,42 +1098,32 @@ Return ONLY the comma-separated email list - no explanations, no extra text.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, oauthCredential: { type: 'string', description: 'Outlook access token' }, - // Send operation inputs to: { type: 'string', description: 'Recipient email address' }, subject: { type: 'string', description: 'Email subject' }, body: { type: 'string', description: 'Email content' }, contentType: { type: 'string', description: 'Content type (Text or HTML)' }, attachments: { type: 'array', description: 'Files to attach (canonical param)' }, - // Forward operation inputs messageId: { type: 'string', description: 'Message ID to forward' }, comment: { type: 'string', description: 'Optional comment for forwarding' }, - // Read operation inputs folder: { type: 'string', description: 'Email folder (canonical param)' }, maxResults: { type: 'number', description: 'Maximum emails' }, includeAttachments: { type: 'boolean', description: 'Include email attachments' }, - // Move operation inputs moveMessageId: { type: 'string', description: 'Message ID to move' }, destinationId: { type: 'string', description: 'Destination folder ID (canonical param)' }, - // Action operation inputs actionMessageId: { type: 'string', description: 'Message ID for actions' }, copyMessageId: { type: 'string', description: 'Message ID to copy' }, copyDestinationId: { type: 'string', description: 'Destination folder ID for copy (canonical param)', }, - // Search operation inputs searchQuery: { type: 'string', description: 'Free-text search query' }, - // Folder operation inputs folderName: { type: 'string', description: 'Name of the new folder' }, folderIsHidden: { type: 'boolean', description: 'Whether the new folder is hidden' }, includeHiddenFolders: { type: 'boolean', description: 'Include hidden folders when listing' }, - // Attachment operation inputs attachmentId: { type: 'string', description: 'ID of the attachment to retrieve' }, - // Update message operation inputs categories: { type: 'string', description: 'Comma-separated category names' }, flagStatus: { type: 'string', description: 'Follow-up flag status' }, importance: { type: 'string', description: 'Message importance level' }, - // Calendar operation inputs calendarId: { type: 'string', description: 'Calendar to read from or write to (canonical param); blank = default calendar', @@ -1205,20 +1161,16 @@ Return ONLY the comma-separated email list - no explanations, no extra text.`, }, }, outputs: { - // Common outputs message: { type: 'string', description: 'Response message' }, results: { type: 'json', description: 'Operation results. Calendar operations return the event(s): {id, subject, start, end, isAllDay, location, organizer, attendees, onlineMeeting, webLink, bodyPreview}', }, - // Send operation specific outputs status: { type: 'string', description: 'Email send status (sent)' }, timestamp: { type: 'string', description: 'Operation timestamp' }, - // Draft operation specific outputs messageId: { type: 'string', description: 'Draft message ID' }, subject: { type: 'string', description: 'Draft email subject' }, - // Read operation specific outputs emailCount: { type: 'number', description: 'Number of emails retrieved' }, emails: { type: 'json', description: 'Array of email objects' }, emailId: { type: 'string', description: 'Individual email ID' }, @@ -1237,14 +1189,10 @@ Return ONLY the comma-separated email list - no explanations, no extra text.`, }, isRead: { type: 'boolean', description: 'Whether email is read' }, importance: { type: 'string', description: 'Email importance level' }, - // Folder operation outputs folders: { type: 'json', description: 'Array of mail folder objects' }, - // Update message operation outputs categories: { type: 'json', description: 'Categories assigned to the message' }, flagStatus: { type: 'string', description: 'Follow-up flag status of the message' }, - // Calendar operation outputs nextLink: { type: 'string', description: 'URL for the next page of calendar events, if any' }, - // Trigger outputs email: { type: 'json', description: 'Email data from trigger' }, rawEmail: { type: 'json', description: 'Complete raw email data from Microsoft Graph API' }, }, diff --git a/apps/sim/blocks/blocks/pagerduty.ts b/apps/sim/blocks/blocks/pagerduty.ts index 009aa7703ec..5f82b21439a 100644 --- a/apps/sim/blocks/blocks/pagerduty.ts +++ b/apps/sim/blocks/blocks/pagerduty.ts @@ -146,7 +146,7 @@ export const PagerDutyBlock: BlockConfig = { }, }, - // --- List Incidents fields --- + // List Incidents fields { id: 'statuses', title: 'Statuses', @@ -238,7 +238,7 @@ export const PagerDutyBlock: BlockConfig = { mode: 'advanced', }, - // --- Get Incident fields --- + // Get Incident fields { id: 'getIncidentId', title: 'Incident ID', @@ -248,7 +248,7 @@ export const PagerDutyBlock: BlockConfig = { condition: { field: 'operation', value: 'get_incident' }, }, - // --- Create Incident fields --- + // Create Incident fields { id: 'title', title: 'Title', @@ -308,7 +308,7 @@ export const PagerDutyBlock: BlockConfig = { mode: 'advanced', }, - // --- Update Incident fields --- + // Update Incident fields { id: 'updateIncidentId', title: 'Incident ID', @@ -367,7 +367,7 @@ export const PagerDutyBlock: BlockConfig = { condition: { field: 'operation', value: 'update_incident' }, mode: 'advanced', }, - // --- Snooze Incident fields --- + // Snooze Incident fields { id: 'snoozeIncidentId', title: 'Incident ID', @@ -385,7 +385,7 @@ export const PagerDutyBlock: BlockConfig = { condition: { field: 'operation', value: 'snooze_incident' }, }, - // --- Merge Incidents fields --- + // Merge Incidents fields { id: 'mergeTargetIncidentId', title: 'Target Incident ID', @@ -403,7 +403,7 @@ export const PagerDutyBlock: BlockConfig = { condition: { field: 'operation', value: 'merge_incidents' }, }, - // --- Add Note fields --- + // Add Note fields { id: 'noteIncidentId', title: 'Incident ID', @@ -421,7 +421,7 @@ export const PagerDutyBlock: BlockConfig = { condition: { field: 'operation', value: 'add_note' }, }, - // --- List Incident Alerts fields --- + // List Incident Alerts fields { id: 'alertsIncidentId', title: 'Incident ID', @@ -460,7 +460,7 @@ export const PagerDutyBlock: BlockConfig = { mode: 'advanced', }, - // --- List Services fields --- + // List Services fields { id: 'serviceQuery', title: 'Search Query', @@ -485,7 +485,7 @@ export const PagerDutyBlock: BlockConfig = { mode: 'advanced', }, - // --- Get Service fields --- + // Get Service fields { id: 'getServiceId', title: 'Service ID', @@ -495,7 +495,7 @@ export const PagerDutyBlock: BlockConfig = { condition: { field: 'operation', value: 'get_service' }, }, - // --- List On-Calls fields --- + // List On-Calls fields { id: 'oncallEscalationPolicyIds', title: 'Escalation Policy IDs', @@ -556,7 +556,7 @@ export const PagerDutyBlock: BlockConfig = { mode: 'advanced', }, - // --- List Escalation Policies fields --- + // List Escalation Policies fields { id: 'escalationPolicyQuery', title: 'Search Query', @@ -581,7 +581,7 @@ export const PagerDutyBlock: BlockConfig = { mode: 'advanced', }, - // --- List Schedules fields --- + // List Schedules fields { id: 'scheduleQuery', title: 'Search Query', @@ -606,7 +606,7 @@ export const PagerDutyBlock: BlockConfig = { mode: 'advanced', }, - // --- List Users fields --- + // List Users fields { id: 'userQuery', title: 'Search Query', @@ -631,7 +631,7 @@ export const PagerDutyBlock: BlockConfig = { mode: 'advanced', }, - // --- Send Event fields --- + // Send Event fields { id: 'eventAction', title: 'Event Action', diff --git a/apps/sim/blocks/blocks/polymarket.ts b/apps/sim/blocks/blocks/polymarket.ts index 7e4ad6e4444..fa0f490176b 100644 --- a/apps/sim/blocks/blocks/polymarket.ts +++ b/apps/sim/blocks/blocks/polymarket.ts @@ -151,7 +151,6 @@ export const PolymarketBlock: BlockConfig = { placeholder: 'Event slug (required if no ID)', condition: { field: 'operation', value: ['get_event'] }, }, - // Series ID for get_series_by_id { id: 'seriesId', title: 'Series ID', @@ -160,7 +159,6 @@ export const PolymarketBlock: BlockConfig = { required: true, condition: { field: 'operation', value: ['get_series_by_id'] }, }, - // Search query { id: 'query', title: 'Search Query', @@ -169,7 +167,6 @@ export const PolymarketBlock: BlockConfig = { required: true, condition: { field: 'operation', value: ['search'] }, }, - // User wallet address for Data API operations { id: 'user', title: 'User Wallet Address', @@ -186,7 +183,6 @@ export const PolymarketBlock: BlockConfig = { condition: { field: 'operation', value: ['get_trades'] }, mode: 'advanced', }, - // Market/Event filter for positions and trades { id: 'market', title: 'Condition ID', @@ -203,7 +199,6 @@ export const PolymarketBlock: BlockConfig = { condition: { field: 'operation', value: ['get_positions', 'get_trades'] }, mode: 'advanced', }, - // Positions-specific filters { id: 'sizeThreshold', title: 'Size Threshold', @@ -273,7 +268,6 @@ export const PolymarketBlock: BlockConfig = { condition: { field: 'operation', value: ['get_positions'] }, mode: 'advanced', }, - // Trades-specific filters { id: 'tradeSide', title: 'Trade Side', @@ -317,7 +311,6 @@ export const PolymarketBlock: BlockConfig = { condition: { field: 'operation', value: ['get_trades'] }, mode: 'advanced', }, - // Activity-specific fields { id: 'activityUser', title: 'User Wallet Address', @@ -411,7 +404,6 @@ export const PolymarketBlock: BlockConfig = { condition: { field: 'operation', value: ['get_activity'] }, mode: 'advanced', }, - // Leaderboard-specific fields { id: 'leaderboardCategory', title: 'Category', @@ -471,7 +463,6 @@ export const PolymarketBlock: BlockConfig = { condition: { field: 'operation', value: ['get_leaderboard'] }, mode: 'advanced', }, - // Market Holders-specific fields { id: 'holdersMarket', title: 'Condition ID', @@ -488,7 +479,6 @@ export const PolymarketBlock: BlockConfig = { condition: { field: 'operation', value: ['get_holders'] }, mode: 'advanced', }, - // Token ID for CLOB operations { id: 'tokenId', title: 'Token ID', @@ -508,7 +498,6 @@ export const PolymarketBlock: BlockConfig = { ], }, }, - // Side for price query { id: 'side', title: 'Side', @@ -520,7 +509,6 @@ export const PolymarketBlock: BlockConfig = { condition: { field: 'operation', value: ['get_price'] }, required: true, }, - // Price history specific fields { id: 'interval', title: 'Interval', @@ -585,7 +573,6 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr generationType: 'timestamp', }, }, - // Filters for list operations { id: 'closed', title: 'Closed Status', @@ -649,7 +636,6 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr condition: { field: 'operation', value: ['get_markets', 'get_events'] }, mode: 'advanced', }, - // Pagination fields { id: 'limit', title: 'Limit', @@ -783,7 +769,6 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr positionSortBy, positionSortDirection, positionTitle, - // Activity params activityUser, activityType, activityMarket, @@ -793,25 +778,21 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr activitySortDirection, activityStart, activityEnd, - // Leaderboard params leaderboardCategory, leaderboardTimePeriod, leaderboardOrderBy, leaderboardUser, leaderboardUserName, - // Holders params holdersMarket, holdersMinBalance, ...rest } = params const cleanParams: Record = {} - // Map marketSlug to slug for get_market if (operation === 'get_market' && marketSlug) { cleanParams.slug = marketSlug } - // Map eventSlug to slug for get_event if (operation === 'get_event' && eventSlug) { cleanParams.slug = eventSlug } @@ -823,24 +804,20 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr cleanParams.order = orderEvents } - // Map positionEventId to eventId for positions and trades if ((operation === 'get_positions' || operation === 'get_trades') && positionEventId) { cleanParams.eventId = positionEventId } - // Map tradeSide to side for trades if (operation === 'get_trades' && tradeSide) { cleanParams.side = tradeSide } - // Map position-specific fields if (operation === 'get_positions') { if (positionSortBy) cleanParams.sortBy = positionSortBy if (positionSortDirection) cleanParams.sortDirection = positionSortDirection if (positionTitle) cleanParams.title = positionTitle } - // Map activity-specific fields if (operation === 'get_activity') { if (activityUser) cleanParams.user = activityUser if (activityType) cleanParams.type = activityType @@ -853,7 +830,6 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr if (activityEnd) cleanParams.end = Number(activityEnd) } - // Map leaderboard-specific fields if (operation === 'get_leaderboard') { if (leaderboardCategory) cleanParams.category = leaderboardCategory if (leaderboardTimePeriod) cleanParams.timePeriod = leaderboardTimePeriod @@ -862,13 +838,11 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr if (leaderboardUserName) cleanParams.userName = leaderboardUserName } - // Map holders-specific fields if (operation === 'get_holders') { if (holdersMarket) cleanParams.market = holdersMarket if (holdersMinBalance) cleanParams.minBalance = holdersMinBalance } - // Convert numeric fields from string to number for get_price_history if (operation === 'get_price_history') { if (rest.fidelity) cleanParams.fidelity = Number(rest.fidelity) if (rest.startTs) cleanParams.startTs = Number(rest.startTs) @@ -905,29 +879,24 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr fidelity: { type: 'number', description: 'Data resolution in minutes' }, startTs: { type: 'number', description: 'Start timestamp (Unix)' }, endTs: { type: 'number', description: 'End timestamp (Unix)' }, - // Positions-specific inputs sizeThreshold: { type: 'string', description: 'Minimum position size threshold' }, redeemable: { type: 'string', description: 'Filter by redeemable status' }, mergeable: { type: 'string', description: 'Filter by mergeable status' }, positionSortBy: { type: 'string', description: 'Sort positions by field' }, positionSortDirection: { type: 'string', description: 'Sort direction (ASC/DESC)' }, positionTitle: { type: 'string', description: 'Filter positions by title' }, - // Trades-specific inputs tradeSide: { type: 'string', description: 'Filter trades by side (BUY/SELL)' }, takerOnly: { type: 'string', description: 'Filter to taker trades only' }, filterType: { type: 'string', description: 'Trade filter type (CASH/TOKENS)' }, filterAmount: { type: 'string', description: 'Minimum trade amount threshold' }, - // List operation filters closed: { type: 'string', description: 'Filter by closed status' }, order: { type: 'string', description: 'Sort field for markets' }, orderEvents: { type: 'string', description: 'Sort field for events' }, ascending: { type: 'string', description: 'Sort order (true/false)' }, tagId: { type: 'string', description: 'Filter by tag ID' }, - // Pagination limit: { type: 'string', description: 'Number of results per page' }, offset: { type: 'string', description: 'Pagination offset' }, page: { type: 'string', description: 'Page number for search' }, - // Activity-specific inputs activityUser: { type: 'string', description: 'User wallet address for activity' }, activityType: { type: 'string', description: 'Activity type filter' }, activityMarket: { type: 'string', description: 'Condition ID filter for activity' }, @@ -937,18 +906,15 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr activitySortDirection: { type: 'string', description: 'Sort direction for activity' }, activityStart: { type: 'string', description: 'Start timestamp for activity' }, activityEnd: { type: 'string', description: 'End timestamp for activity' }, - // Leaderboard-specific inputs leaderboardCategory: { type: 'string', description: 'Leaderboard category' }, leaderboardTimePeriod: { type: 'string', description: 'Leaderboard time period' }, leaderboardOrderBy: { type: 'string', description: 'Leaderboard order by field' }, leaderboardUser: { type: 'string', description: 'Filter leaderboard by user' }, leaderboardUserName: { type: 'string', description: 'Filter leaderboard by username' }, - // Holders-specific inputs holdersMarket: { type: 'string', description: 'Condition ID for holders lookup' }, holdersMinBalance: { type: 'string', description: 'Minimum balance threshold' }, }, outputs: { - // List operations markets: { type: 'json', description: 'Array of market objects (get_markets)' }, events: { type: 'json', description: 'Array of event objects (get_events)' }, tags: { type: 'json', description: 'Array of tag objects (get_tags)' }, @@ -958,15 +924,12 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr }, positions: { type: 'json', description: 'Array of position objects (get_positions)' }, trades: { type: 'json', description: 'Array of trade objects (get_trades)' }, - // Single item operations market: { type: 'json', description: 'Single market object (get_market)' }, event: { type: 'json', description: 'Single event object (get_event)' }, - // Search results: { type: 'json', description: 'Search results with events, tags, profiles (search)', }, - // CLOB operations orderbook: { type: 'json', description: 'Order book with bids and asks (get_orderbook)', @@ -977,7 +940,6 @@ Return ONLY the Unix timestamp as a number - no explanations, no quotes, no extr history: { type: 'json', description: 'Price history entries (get_price_history)' }, spread: { type: 'json', description: 'Spread value object (get_spread)' }, tickSize: { type: 'string', description: 'Minimum tick size (get_tick_size)' }, - // Data API operations activity: { type: 'json', description: 'Array of user activity entries (get_activity)' }, leaderboard: { type: 'json', description: 'Array of leaderboard entries (get_leaderboard)' }, holders: { type: 'json', description: 'Array of market holder groups (get_holders)' }, diff --git a/apps/sim/blocks/blocks/posthog.ts b/apps/sim/blocks/blocks/posthog.ts index 9da5a89d54e..67b4a0cc2a0 100644 --- a/apps/sim/blocks/blocks/posthog.ts +++ b/apps/sim/blocks/blocks/posthog.ts @@ -212,14 +212,12 @@ export const PostHogBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Core Data Operations { label: 'Capture Event', id: 'posthog_capture_event' }, { label: 'Batch Events', id: 'posthog_batch_events' }, { label: 'List Persons', id: 'posthog_list_persons' }, { label: 'Get Person', id: 'posthog_get_person' }, { label: 'Delete Person', id: 'posthog_delete_person' }, { label: 'Run Query (HogQL)', id: 'posthog_query' }, - // Analytics { label: 'List Insights', id: 'posthog_list_insights' }, { label: 'Get Insight', id: 'posthog_get_insight' }, { label: 'Create Insight', id: 'posthog_create_insight' }, @@ -234,7 +232,6 @@ export const PostHogBlock: BlockConfig = { { label: 'Update Cohort', id: 'posthog_update_cohort' }, { label: 'List Annotations', id: 'posthog_list_annotations' }, { label: 'Create Annotation', id: 'posthog_create_annotation' }, - // Feature Management { label: 'List Feature Flags', id: 'posthog_list_feature_flags' }, { label: 'Get Feature Flag', id: 'posthog_get_feature_flag' }, { label: 'Create Feature Flag', id: 'posthog_create_feature_flag' }, @@ -245,7 +242,6 @@ export const PostHogBlock: BlockConfig = { { label: 'Get Experiment', id: 'posthog_get_experiment' }, { label: 'Create Experiment', id: 'posthog_create_experiment' }, { label: 'Update Experiment', id: 'posthog_update_experiment' }, - // User Engagement { label: 'List Surveys', id: 'posthog_list_surveys' }, { label: 'Get Survey', id: 'posthog_get_survey' }, { label: 'Create Survey', id: 'posthog_create_survey' }, @@ -254,14 +250,12 @@ export const PostHogBlock: BlockConfig = { { label: 'List Session Recordings', id: 'posthog_list_session_recordings' }, { label: 'Get Session Recording', id: 'posthog_get_session_recording' }, { label: 'List Recording Playlists', id: 'posthog_list_recording_playlists' }, - // Data Management { label: 'List Event Definitions', id: 'posthog_list_event_definitions' }, { label: 'Get Event Definition', id: 'posthog_get_event_definition' }, { label: 'Update Event Definition', id: 'posthog_update_event_definition' }, { label: 'List Property Definitions', id: 'posthog_list_property_definitions' }, { label: 'Get Property Definition', id: 'posthog_get_property_definition' }, { label: 'Update Property Definition', id: 'posthog_update_property_definition' }, - // Configuration { label: 'List Projects', id: 'posthog_list_projects' }, { label: 'Get Project', id: 'posthog_get_project' }, { label: 'List Organizations', id: 'posthog_list_organizations' }, @@ -270,7 +264,6 @@ export const PostHogBlock: BlockConfig = { value: () => 'posthog_capture_event', }, - // Common fields { id: 'region', title: 'Region', @@ -283,30 +276,25 @@ export const PostHogBlock: BlockConfig = { required: { field: 'operation', value: [ - // Feature Flags 'posthog_create_feature_flag', 'posthog_update_feature_flag', 'posthog_delete_feature_flag', 'posthog_get_feature_flag', 'posthog_list_feature_flags', - // Experiments 'posthog_create_experiment', 'posthog_update_experiment', 'posthog_get_experiment', 'posthog_list_experiments', - // Data Management 'posthog_list_property_definitions', 'posthog_get_property_definition', 'posthog_update_property_definition', 'posthog_list_event_definitions', 'posthog_get_event_definition', 'posthog_update_event_definition', - // Core Operations (with personalApiKey) 'posthog_list_persons', 'posthog_get_person', 'posthog_delete_person', 'posthog_query', - // Analytics 'posthog_list_insights', 'posthog_get_insight', 'posthog_create_insight', @@ -321,7 +309,6 @@ export const PostHogBlock: BlockConfig = { 'posthog_update_cohort', 'posthog_list_annotations', 'posthog_create_annotation', - // Surveys & Recordings 'posthog_list_surveys', 'posthog_get_survey', 'posthog_create_survey', @@ -330,7 +317,6 @@ export const PostHogBlock: BlockConfig = { 'posthog_list_session_recordings', 'posthog_get_session_recording', 'posthog_list_recording_playlists', - // Configuration 'posthog_list_projects', 'posthog_get_project', 'posthog_list_organizations', @@ -346,25 +332,21 @@ export const PostHogBlock: BlockConfig = { condition: { field: 'operation', value: [ - // Feature Flags 'posthog_create_feature_flag', 'posthog_update_feature_flag', 'posthog_delete_feature_flag', 'posthog_get_feature_flag', 'posthog_list_feature_flags', - // Experiments 'posthog_create_experiment', 'posthog_update_experiment', 'posthog_get_experiment', 'posthog_list_experiments', - // Data Management 'posthog_list_property_definitions', 'posthog_get_property_definition', 'posthog_update_property_definition', 'posthog_list_event_definitions', 'posthog_get_event_definition', 'posthog_update_event_definition', - // Core Operations 'posthog_capture_event', 'posthog_batch_events', 'posthog_list_persons', @@ -372,7 +354,6 @@ export const PostHogBlock: BlockConfig = { 'posthog_delete_person', 'posthog_query', 'posthog_evaluate_flags', - // Analytics 'posthog_list_insights', 'posthog_get_insight', 'posthog_create_insight', @@ -387,7 +368,6 @@ export const PostHogBlock: BlockConfig = { 'posthog_update_cohort', 'posthog_list_annotations', 'posthog_create_annotation', - // Surveys & Recordings 'posthog_list_surveys', 'posthog_get_survey', 'posthog_create_survey', @@ -396,7 +376,6 @@ export const PostHogBlock: BlockConfig = { 'posthog_list_session_recordings', 'posthog_get_session_recording', 'posthog_list_recording_playlists', - // Configuration 'posthog_list_projects', 'posthog_get_project', 'posthog_list_organizations', @@ -405,7 +384,6 @@ export const PostHogBlock: BlockConfig = { }, }, - // API Keys (conditional based on operation) { id: 'projectApiKey', title: 'Project API Key', @@ -453,7 +431,6 @@ export const PostHogBlock: BlockConfig = { required: true, }, - // Capture Event fields { id: 'event', title: 'Event Name', @@ -529,7 +506,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, }, - // Evaluate Flags fields { id: 'groups', title: 'Groups (JSON)', @@ -604,7 +580,6 @@ Return ONLY the JSON object.`, condition: { field: 'operation', value: 'posthog_evaluate_flags' }, }, - // Batch Events fields { id: 'batch', title: 'Batch Events (JSON Array)', @@ -640,7 +615,6 @@ Return ONLY the JSON array.`, }, }, - // Query fields { id: 'query', title: 'Query', @@ -681,7 +655,6 @@ Return ONLY the JSON array.`, }, }, - // ID fields for get/update/delete operations { id: 'personId', title: 'Person ID', @@ -804,7 +777,6 @@ Return ONLY the JSON array.`, required: true, }, - // Create/Update fields (name, description, etc.) { id: 'name', title: 'Name', @@ -869,7 +841,6 @@ Return ONLY the description text.`, }, }, - // Feature Flag specific fields { id: 'key', title: 'Flag Key', @@ -940,7 +911,6 @@ Return ONLY the JSON object.`, }, }, - // Insight specific fields { id: 'insightQuery', title: 'Query (JSON)', @@ -978,7 +948,6 @@ Return ONLY the JSON object.`, condition: { field: 'operation', value: 'posthog_update_insight' }, }, - // Feature Flag fields { id: 'active', title: 'Active', @@ -1010,7 +979,6 @@ Return ONLY the JSON object.`, }, }, - // Cohort fields { id: 'groups', title: 'Groups (JSON Array)', @@ -1032,7 +1000,6 @@ Return ONLY the JSON object.`, condition: { field: 'operation', value: 'posthog_update_cohort' }, }, - // Annotation fields { id: 'content', title: 'Content', @@ -1094,7 +1061,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'posthog_create_annotation' }, }, - // Experiment fields { id: 'featureFlagKey', title: 'Feature Flag Key', @@ -1169,7 +1135,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, }, - // Survey fields { id: 'questions', title: 'Questions (JSON Array)', @@ -1352,7 +1317,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, }, - // List operations - pagination fields { id: 'limit', title: 'Limit', @@ -1402,7 +1366,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, }, - // Search/Filter fields { id: 'search', title: 'Search', @@ -1418,7 +1381,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, }, - // Tags field { id: 'tags', title: 'Tags (comma-separated)', @@ -1434,7 +1396,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, }, - // Property type field { id: 'propertyType', title: 'Property Type', @@ -1448,7 +1409,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'posthog_update_property_definition' }, }, - // Organization/Project ID fields { id: 'organizationId', title: 'Organization ID', @@ -1469,14 +1429,12 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, tools: { access: [ - // Core Data 'posthog_capture_event', 'posthog_batch_events', 'posthog_list_persons', 'posthog_get_person', 'posthog_delete_person', 'posthog_query', - // Analytics 'posthog_list_insights', 'posthog_get_insight', 'posthog_create_insight', @@ -1491,7 +1449,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'posthog_update_cohort', 'posthog_list_annotations', 'posthog_create_annotation', - // Feature Management 'posthog_list_feature_flags', 'posthog_get_feature_flag', 'posthog_create_feature_flag', @@ -1502,7 +1459,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'posthog_get_experiment', 'posthog_create_experiment', 'posthog_update_experiment', - // Engagement 'posthog_list_surveys', 'posthog_get_survey', 'posthog_create_survey', @@ -1511,14 +1467,12 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, 'posthog_list_session_recordings', 'posthog_get_session_recording', 'posthog_list_recording_playlists', - // Data Management 'posthog_list_event_definitions', 'posthog_get_event_definition', 'posthog_update_event_definition', 'posthog_list_property_definitions', 'posthog_get_property_definition', 'posthog_update_property_definition', - // Configuration 'posthog_list_projects', 'posthog_get_project', 'posthog_list_organizations', @@ -1626,7 +1580,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, projectApiKey: { type: 'string', description: 'Project API key for public endpoints' }, apiKey: { type: 'string', description: 'Personal API key for private endpoints' }, projectId: { type: 'string', description: 'PostHog project ID' }, - // Core Data event: { type: 'string', description: 'Event name' }, distinctId: { type: 'string', description: 'Unique user identifier' }, properties: { type: 'string', description: 'Event properties as JSON' }, @@ -1634,7 +1587,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, batch: { type: 'string', description: 'Batch events as JSON array' }, query: { type: 'string', description: 'HogQL query or JSON object' }, values: { type: 'string', description: 'Query parameters' }, - // IDs personId: { type: 'string', description: 'Person ID' }, insightId: { type: 'string', description: 'Insight ID' }, dashboardId: { type: 'string', description: 'Dashboard ID' }, @@ -1647,7 +1599,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, propertyDefinitionId: { type: 'string', description: 'Property Definition ID' }, organizationId: { type: 'string', description: 'Organization ID' }, projectIdParam: { type: 'string', description: 'Project ID parameter' }, - // Common fields name: { type: 'string', description: 'Name' }, description: { type: 'string', description: 'Description' }, key: { type: 'string', description: 'Feature flag key' }, @@ -1671,7 +1622,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, favorited: { type: 'boolean', description: 'Whether the insight is favorited' }, pinned: { type: 'boolean', description: 'Whether the dashboard is pinned' }, useTemplate: { type: 'string', description: 'Dashboard template name to seed from' }, - // List parameters limit: { type: 'number', description: 'Number of results to return' }, offset: { type: 'number', description: 'Number of results to skip' }, search: { type: 'string', description: 'Search query' }, diff --git a/apps/sim/blocks/blocks/rippling.ts b/apps/sim/blocks/blocks/rippling.ts index 2e2284fd55e..dd995f242d8 100644 --- a/apps/sim/blocks/blocks/rippling.ts +++ b/apps/sim/blocks/blocks/rippling.ts @@ -431,57 +431,42 @@ export const RipplingBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Workers { label: 'List Workers', id: 'list_workers' }, { label: 'Get Worker', id: 'get_worker' }, - // Users { label: 'List Users', id: 'list_users' }, { label: 'Get User', id: 'get_user' }, - // Companies { label: 'List Companies', id: 'list_companies' }, - // Current User { label: 'Get Current User', id: 'get_current_user' }, - // Entitlements { label: 'List Entitlements', id: 'list_entitlements' }, - // Departments { label: 'List Departments', id: 'list_departments' }, { label: 'Get Department', id: 'get_department' }, { label: 'Create Department', id: 'create_department' }, { label: 'Update Department', id: 'update_department' }, - // Teams { label: 'List Teams', id: 'list_teams' }, { label: 'Get Team', id: 'get_team' }, - // Employment Types { label: 'List Employment Types', id: 'list_employment_types' }, { label: 'Get Employment Type', id: 'get_employment_type' }, - // Titles { label: 'List Titles', id: 'list_titles' }, { label: 'Get Title', id: 'get_title' }, { label: 'Create Title', id: 'create_title' }, { label: 'Update Title', id: 'update_title' }, { label: 'Delete Title', id: 'delete_title' }, - // Custom Fields { label: 'List Custom Fields', id: 'list_custom_fields' }, - // Job Functions { label: 'List Job Functions', id: 'list_job_functions' }, { label: 'Get Job Function', id: 'get_job_function' }, - // Work Locations { label: 'List Work Locations', id: 'list_work_locations' }, { label: 'Get Work Location', id: 'get_work_location' }, { label: 'Create Work Location', id: 'create_work_location' }, { label: 'Update Work Location', id: 'update_work_location' }, { label: 'Delete Work Location', id: 'delete_work_location' }, - // Business Partners { label: 'List Business Partners', id: 'list_business_partners' }, { label: 'Get Business Partner', id: 'get_business_partner' }, { label: 'Create Business Partner', id: 'create_business_partner' }, { label: 'Delete Business Partner', id: 'delete_business_partner' }, - // Business Partner Groups { label: 'List Business Partner Groups', id: 'list_business_partner_groups' }, { label: 'Get Business Partner Group', id: 'get_business_partner_group' }, { label: 'Create Business Partner Group', id: 'create_business_partner_group' }, { label: 'Delete Business Partner Group', id: 'delete_business_partner_group' }, - // Supergroups { label: 'List Supergroups', id: 'list_supergroups' }, { label: 'Get Supergroup', id: 'get_supergroup' }, { label: 'List Supergroup Members', id: 'list_supergroup_members' }, @@ -495,19 +480,16 @@ export const RipplingBlock: BlockConfig = { label: 'Update Supergroup Exclusion Members', id: 'update_supergroup_exclusion_members', }, - // Custom Objects { label: 'List Custom Objects', id: 'list_custom_objects' }, { label: 'Get Custom Object', id: 'get_custom_object' }, { label: 'Create Custom Object', id: 'create_custom_object' }, { label: 'Update Custom Object', id: 'update_custom_object' }, { label: 'Delete Custom Object', id: 'delete_custom_object' }, - // Custom Object Fields { label: 'List Custom Object Fields', id: 'list_custom_object_fields' }, { label: 'Get Custom Object Field', id: 'get_custom_object_field' }, { label: 'Create Custom Object Field', id: 'create_custom_object_field' }, { label: 'Update Custom Object Field', id: 'update_custom_object_field' }, { label: 'Delete Custom Object Field', id: 'delete_custom_object_field' }, - // Custom Object Records { label: 'List Custom Object Records', id: 'list_custom_object_records' }, { label: 'Get Custom Object Record', id: 'get_custom_object_record' }, { @@ -530,34 +512,28 @@ export const RipplingBlock: BlockConfig = { label: 'Bulk Delete Custom Object Records', id: 'bulk_delete_custom_object_records', }, - // Custom Apps { label: 'List Custom Apps', id: 'list_custom_apps' }, { label: 'Get Custom App', id: 'get_custom_app' }, { label: 'Create Custom App', id: 'create_custom_app' }, { label: 'Update Custom App', id: 'update_custom_app' }, { label: 'Delete Custom App', id: 'delete_custom_app' }, - // Custom Pages { label: 'List Custom Pages', id: 'list_custom_pages' }, { label: 'Get Custom Page', id: 'get_custom_page' }, { label: 'Create Custom Page', id: 'create_custom_page' }, { label: 'Update Custom Page', id: 'update_custom_page' }, { label: 'Delete Custom Page', id: 'delete_custom_page' }, - // Custom Settings { label: 'List Custom Settings', id: 'list_custom_settings' }, { label: 'Get Custom Setting', id: 'get_custom_setting' }, { label: 'Create Custom Setting', id: 'create_custom_setting' }, { label: 'Update Custom Setting', id: 'update_custom_setting' }, { label: 'Delete Custom Setting', id: 'delete_custom_setting' }, - // Object Categories { label: 'List Object Categories', id: 'list_object_categories' }, { label: 'Get Object Category', id: 'get_object_category' }, { label: 'Create Object Category', id: 'create_object_category' }, { label: 'Update Object Category', id: 'update_object_category' }, { label: 'Delete Object Category', id: 'delete_object_category' }, - // Report Runs { label: 'Get Report Run', id: 'get_report_run' }, { label: 'Trigger Report Run', id: 'trigger_report_run' }, - // Draft Hires { label: 'Create Draft Hires', id: 'create_draft_hires' }, ], value: () => 'list_workers', @@ -614,7 +590,6 @@ export const RipplingBlock: BlockConfig = { ], }, }, - // Department fields { id: 'parentId', title: 'Parent ID', @@ -637,7 +612,6 @@ export const RipplingBlock: BlockConfig = { value: ['create_department', 'update_department'], }, }, - // Description (shared across many create/update operations) { id: 'description', title: 'Description', @@ -646,7 +620,6 @@ export const RipplingBlock: BlockConfig = { mode: 'advanced', condition: { field: 'operation', value: [...DESCRIPTION_OPS] }, }, - // Custom App fields { id: 'apiName', title: 'API Name', @@ -655,7 +628,6 @@ export const RipplingBlock: BlockConfig = { condition: { field: 'operation', value: ['create_custom_app', 'update_custom_app'] }, required: { field: 'operation', value: 'create_custom_app' }, }, - // Business Partner fields { id: 'businessPartnerGroupId', title: 'Business Partner Group ID', @@ -672,7 +644,6 @@ export const RipplingBlock: BlockConfig = { condition: { field: 'operation', value: 'create_business_partner' }, required: { field: 'operation', value: 'create_business_partner' }, }, - // Business Partner Group fields { id: 'domain', title: 'Domain', @@ -695,7 +666,6 @@ export const RipplingBlock: BlockConfig = { mode: 'advanced', condition: { field: 'operation', value: 'create_business_partner_group' }, }, - // Work Location address fields { id: 'streetAddress', title: 'Street Address', @@ -748,7 +718,6 @@ export const RipplingBlock: BlockConfig = { mode: 'advanced', condition: { field: 'operation', value: [...WORK_LOCATION_WRITE_OPS] }, }, - // Custom Object fields { id: 'category', title: 'Category', @@ -773,7 +742,6 @@ export const RipplingBlock: BlockConfig = { mode: 'advanced', condition: { field: 'operation', value: 'update_custom_object' }, }, - // Custom Object Field configuration { id: 'dataType', title: 'Data Type', @@ -875,7 +843,6 @@ Return ONLY the JSON - no explanations, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: 'update_custom_object_field' }, }, - // Custom Setting fields { id: 'displayName', title: 'Display Name', @@ -934,7 +901,6 @@ Return ONLY the JSON - no explanations, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: [...CUSTOM_SETTING_WRITE_OPS] }, }, - // Report Run fields { id: 'includeObjectIds', title: 'Include Object IDs', @@ -984,7 +950,6 @@ Return ONLY the JSON - no explanations, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: 'trigger_report_run' }, }, - // Data JSON - only for passthrough operations (custom object records, draft hires, supergroup ops) { id: 'data', title: 'Data', @@ -1011,7 +976,6 @@ Return ONLY the JSON - no explanations, no extra text.`, ], }, }, - // Records JSON for bulk operations { id: 'records', title: 'Records', @@ -1053,7 +1017,6 @@ Return ONLY the JSON - no explanations, no extra text.`, ], }, }, - // Query fields for custom object record queries { id: 'query', title: 'Query', @@ -1076,7 +1039,6 @@ Return ONLY the query expression - no explanations, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: 'query_custom_object_records' }, }, - // Common query parameters { id: 'filter', title: 'Filter', @@ -1137,7 +1099,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: [...CURSOR_OPS] }, }, - // API Key { id: 'apiKey', title: 'API Key', @@ -1150,57 +1111,42 @@ Return ONLY the sort expression - no explanations, no extra text.`, tools: { access: [ - // Workers 'rippling_list_workers', 'rippling_get_worker', - // Users 'rippling_list_users', 'rippling_get_user', - // Companies 'rippling_list_companies', - // Current User 'rippling_get_current_user', - // Entitlements 'rippling_list_entitlements', - // Departments 'rippling_list_departments', 'rippling_get_department', 'rippling_create_department', 'rippling_update_department', - // Teams 'rippling_list_teams', 'rippling_get_team', - // Employment Types 'rippling_list_employment_types', 'rippling_get_employment_type', - // Titles 'rippling_list_titles', 'rippling_get_title', 'rippling_create_title', 'rippling_update_title', 'rippling_delete_title', - // Custom Fields 'rippling_list_custom_fields', - // Job Functions 'rippling_list_job_functions', 'rippling_get_job_function', - // Work Locations 'rippling_list_work_locations', 'rippling_get_work_location', 'rippling_create_work_location', 'rippling_update_work_location', 'rippling_delete_work_location', - // Business Partners 'rippling_list_business_partners', 'rippling_get_business_partner', 'rippling_create_business_partner', 'rippling_delete_business_partner', - // Business Partner Groups 'rippling_list_business_partner_groups', 'rippling_get_business_partner_group', 'rippling_create_business_partner_group', 'rippling_delete_business_partner_group', - // Supergroups 'rippling_list_supergroups', 'rippling_get_supergroup', 'rippling_list_supergroup_members', @@ -1208,19 +1154,16 @@ Return ONLY the sort expression - no explanations, no extra text.`, 'rippling_list_supergroup_exclusion_members', 'rippling_update_supergroup_inclusion_members', 'rippling_update_supergroup_exclusion_members', - // Custom Objects 'rippling_list_custom_objects', 'rippling_get_custom_object', 'rippling_create_custom_object', 'rippling_update_custom_object', 'rippling_delete_custom_object', - // Custom Object Fields 'rippling_list_custom_object_fields', 'rippling_get_custom_object_field', 'rippling_create_custom_object_field', 'rippling_update_custom_object_field', 'rippling_delete_custom_object_field', - // Custom Object Records 'rippling_list_custom_object_records', 'rippling_get_custom_object_record', 'rippling_get_custom_object_record_by_external_id', @@ -1231,34 +1174,28 @@ Return ONLY the sort expression - no explanations, no extra text.`, 'rippling_bulk_create_custom_object_records', 'rippling_bulk_update_custom_object_records', 'rippling_bulk_delete_custom_object_records', - // Custom Apps 'rippling_list_custom_apps', 'rippling_get_custom_app', 'rippling_create_custom_app', 'rippling_update_custom_app', 'rippling_delete_custom_app', - // Custom Pages 'rippling_list_custom_pages', 'rippling_get_custom_page', 'rippling_create_custom_page', 'rippling_update_custom_page', 'rippling_delete_custom_page', - // Custom Settings 'rippling_list_custom_settings', 'rippling_get_custom_setting', 'rippling_create_custom_setting', 'rippling_update_custom_setting', 'rippling_delete_custom_setting', - // Object Categories 'rippling_list_object_categories', 'rippling_get_object_category', 'rippling_create_object_category', 'rippling_update_object_category', 'rippling_delete_object_category', - // Report Runs 'rippling_get_report_run', 'rippling_trigger_report_run', - // Draft Hires 'rippling_create_draft_hires', ], config: { @@ -1269,7 +1206,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, } const op = params.operation as string - // Common fields if (params.id != null && params.id !== '') mapped.id = params.id if (params.customObjectId != null && params.customObjectId !== '') mapped.customObjectId = params.customObjectId @@ -1283,17 +1219,14 @@ Return ONLY the sort expression - no explanations, no extra text.`, mapped.description = params.description if (params.apiName != null && params.apiName !== '') mapped.apiName = params.apiName - // Business Partner fields if (params.businessPartnerGroupId != null && params.businessPartnerGroupId !== '') mapped.businessPartnerGroupId = params.businessPartnerGroupId if (params.workerId != null && params.workerId !== '') mapped.workerId = params.workerId - // Business Partner Group fields if (params.domain != null && params.domain !== '') mapped.domain = params.domain if (params.defaultBusinessPartnerId != null && params.defaultBusinessPartnerId !== '') mapped.defaultBusinessPartnerId = params.defaultBusinessPartnerId - // Work Location address fields if (params.streetAddress != null && params.streetAddress !== '') mapped.streetAddress = params.streetAddress if (params.locality != null && params.locality !== '') mapped.locality = params.locality @@ -1305,13 +1238,11 @@ Return ONLY the sort expression - no explanations, no extra text.`, if (params.addressType != null && params.addressType !== '') mapped.addressType = params.addressType - // Custom Object fields if (params.category != null && params.category !== '') mapped.category = params.category if (params.pluralLabel != null && params.pluralLabel !== '') mapped.pluralLabel = params.pluralLabel if (params.ownerRole != null && params.ownerRole !== '') mapped.ownerRole = params.ownerRole - // Custom Object Field configuration if (params.dataType != null && params.dataType !== '') { try { mapped.dataType = @@ -1389,7 +1320,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, } } - // Custom Setting fields if (params.displayName != null && params.displayName !== '') mapped.displayName = params.displayName if (params.settingApiName != null && params.settingApiName !== '') @@ -1405,7 +1335,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, if (params.settingBooleanValue != null && params.settingBooleanValue !== '') mapped.booleanValue = params.settingBooleanValue === 'true' - // Report Run fields if ( params.includeObjectIds != null && params.includeObjectIds !== '' && @@ -1441,7 +1370,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, if (params.outputType != null && params.outputType !== '') mapped.outputType = params.outputType - // All Or Nothing for bulk operations if ( params.allOrNothing != null && params.allOrNothing !== '' && @@ -1449,17 +1377,14 @@ Return ONLY the sort expression - no explanations, no extra text.`, ) mapped.allOrNothing = params.allOrNothing === 'true' - // Common query parameters if (params.filter != null && params.filter !== '') mapped.filter = params.filter if (params.expand != null && params.expand !== '') mapped.expand = params.expand if (params.orderBy != null && params.orderBy !== '') mapped.orderBy = params.orderBy if (params.cursor != null && params.cursor !== '') mapped.cursor = params.cursor - // Query and limit for custom object record queries if (params.query != null && params.query !== '') mapped.query = params.query if (params.limit != null && params.limit !== '') mapped.limit = Number(params.limit) - // Data JSON - only for passthrough operations if (params.data != null && params.data !== '') { try { mapped.data = typeof params.data === 'string' ? JSON.parse(params.data) : params.data @@ -1468,7 +1393,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, } } - // Records JSON for bulk operations if (params.records != null && params.records !== '') { try { mapped.records = @@ -1478,8 +1402,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, } } - // --- ID remapping --- - // Custom object tools expect customObjectApiName, not customObjectId if (mapped.customObjectId != null) { mapped.customObjectApiName = mapped.customObjectId @@ -1538,7 +1460,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, } } - // Report run tools if (op === 'get_report_run') { if (mapped.id != null) { mapped.runId = mapped.id @@ -1552,7 +1473,6 @@ Return ONLY the sort expression - no explanations, no extra text.`, } } - // Bulk operations: map records to specific param names if (op === 'bulk_create_custom_object_records' && mapped.records != null) { mapped.rowsToWrite = mapped.records mapped.records = undefined @@ -1566,13 +1486,11 @@ Return ONLY the sort expression - no explanations, no extra text.`, mapped.records = undefined } - // Draft hires: map data to draftHires if (op === 'create_draft_hires' && mapped.data != null) { mapped.draftHires = mapped.data mapped.data = undefined } - // Supergroup member updates: map data to operations if ( ['update_supergroup_inclusion_members', 'update_supergroup_exclusion_members'].includes( op diff --git a/apps/sim/blocks/blocks/rocketlane.ts b/apps/sim/blocks/blocks/rocketlane.ts index fb34a489f81..e55df2af67a 100644 --- a/apps/sim/blocks/blocks/rocketlane.ts +++ b/apps/sim/blocks/blocks/rocketlane.ts @@ -304,7 +304,6 @@ function includeList(params: BlockParams) { /** Builds the exact param set declared by the selected operation's tool. */ function buildOperationParams(params: BlockParams): Record { switch (params.operation) { - // Projects case 'create_project': return { projectName: toStr(params.projectName), @@ -419,7 +418,6 @@ function buildOperationParams(params: BlockParams): Record { placeholderId: toNumber(params.placeholderId), } - // Tasks case 'create_task': return { taskName: toStr(params.taskName), @@ -499,7 +497,6 @@ function buildOperationParams(params: BlockParams): Record { dependencyTaskIds: toNumberList(params.dependencyTaskIds), } - // Phases case 'create_phase': return { phaseName: toStr(params.phaseName), @@ -533,7 +530,6 @@ function buildOperationParams(params: BlockParams): Record { case 'delete_phase': return { phaseId: toNumber(params.phaseId) } - // Fields case 'create_field': return { fieldLabel: toStr(params.fieldLabel), @@ -583,7 +579,6 @@ function buildOperationParams(params: BlockParams): Record { optionColor: toStr(params.optionColor), } - // Time entries case 'create_time_entry': { const source = params.timeEntrySource ?? 'task' return { @@ -664,7 +659,6 @@ function buildOperationParams(params: BlockParams): Record { case 'list_time_entry_categories': return pageParams(params) - // Time-offs case 'create_time_off': return { userId: toNumber(params.userId), @@ -697,7 +691,6 @@ function buildOperationParams(params: BlockParams): Record { case 'delete_time_off': return { timeOffId: toNumber(params.timeOffId) } - // Users case 'get_user': return { userId: toNumber(params.userId), ...includeCsv(params) } case 'list_users': @@ -713,7 +706,6 @@ function buildOperationParams(params: BlockParams): Record { typeEq: toStr(params.userTypeEq), } - // Spaces case 'create_space': return { projectId: toNumber(params.projectId), @@ -739,7 +731,6 @@ function buildOperationParams(params: BlockParams): Record { case 'delete_space': return { spaceId: toNumber(params.spaceId) } - // Space documents case 'create_space_document': return { spaceId: toNumber(params.spaceId), @@ -772,7 +763,6 @@ function buildOperationParams(params: BlockParams): Record { case 'delete_space_document': return { spaceDocumentId: toNumber(params.spaceDocumentId) } - // Resource allocations case 'list_resource_allocations': return { startDate: toStr(params.startDate), @@ -785,7 +775,6 @@ function buildOperationParams(params: BlockParams): Record { placeholderIdEq: toStr(params.placeholderIdEq), } - // Invoices case 'get_invoice': return { invoiceId: toNumber(params.invoiceId), ...includeList(params) } case 'list_invoices': @@ -1059,7 +1048,6 @@ export const RocketlaneBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Projects { label: 'Create Project', id: 'create_project' }, { label: 'Get Project', id: 'get_project' }, { label: 'List Projects', id: 'list_projects' }, @@ -1072,7 +1060,6 @@ export const RocketlaneBlock: BlockConfig = { { label: 'List Placeholders', id: 'list_placeholders' }, { label: 'Assign Placeholder', id: 'assign_placeholders' }, { label: 'Unassign Placeholder', id: 'unassign_placeholders' }, - // Tasks { label: 'Create Task', id: 'create_task' }, { label: 'Get Task', id: 'get_task' }, { label: 'List Tasks', id: 'list_tasks' }, @@ -1085,13 +1072,11 @@ export const RocketlaneBlock: BlockConfig = { { label: 'Remove Task Followers', id: 'remove_task_followers' }, { label: 'Add Task Dependencies', id: 'add_task_dependencies' }, { label: 'Remove Task Dependencies', id: 'remove_task_dependencies' }, - // Phases { label: 'Create Phase', id: 'create_phase' }, { label: 'Get Phase', id: 'get_phase' }, { label: 'List Phases', id: 'list_phases' }, { label: 'Update Phase', id: 'update_phase' }, { label: 'Delete Phase', id: 'delete_phase' }, - // Fields { label: 'Create Field', id: 'create_field' }, { label: 'Get Field', id: 'get_field' }, { label: 'List Fields', id: 'list_fields' }, @@ -1099,7 +1084,6 @@ export const RocketlaneBlock: BlockConfig = { { label: 'Delete Field', id: 'delete_field' }, { label: 'Add Field Option', id: 'add_field_option' }, { label: 'Update Field Option', id: 'update_field_option' }, - // Time entries { label: 'Create Time Entry', id: 'create_time_entry' }, { label: 'Get Time Entry', id: 'get_time_entry' }, { label: 'List Time Entries', id: 'list_time_entries' }, @@ -1107,29 +1091,23 @@ export const RocketlaneBlock: BlockConfig = { { label: 'Update Time Entry', id: 'update_time_entry' }, { label: 'Delete Time Entry', id: 'delete_time_entry' }, { label: 'List Time Entry Categories', id: 'list_time_entry_categories' }, - // Time-offs { label: 'Create Time-Off', id: 'create_time_off' }, { label: 'Get Time-Off', id: 'get_time_off' }, { label: 'List Time-Offs', id: 'list_time_offs' }, { label: 'Delete Time-Off', id: 'delete_time_off' }, - // Users { label: 'Get User', id: 'get_user' }, { label: 'List Users', id: 'list_users' }, - // Spaces { label: 'Create Space', id: 'create_space' }, { label: 'Get Space', id: 'get_space' }, { label: 'List Spaces', id: 'list_spaces' }, { label: 'Update Space', id: 'update_space' }, { label: 'Delete Space', id: 'delete_space' }, - // Space documents { label: 'Create Space Document', id: 'create_space_document' }, { label: 'Get Space Document', id: 'get_space_document' }, { label: 'List Space Documents', id: 'list_space_documents' }, { label: 'Update Space Document', id: 'update_space_document' }, { label: 'Delete Space Document', id: 'delete_space_document' }, - // Resource allocations { label: 'List Resource Allocations', id: 'list_resource_allocations' }, - // Invoices { label: 'Get Invoice', id: 'get_invoice' }, { label: 'List Invoices', id: 'list_invoices' }, { label: 'Get Invoice Line Items', id: 'get_invoice_line_items' }, @@ -1138,7 +1116,6 @@ export const RocketlaneBlock: BlockConfig = { value: () => 'list_projects', }, - // Shared identifiers { id: 'projectId', title: 'Project ID', @@ -1241,7 +1218,6 @@ export const RocketlaneBlock: BlockConfig = { }, }, - // Project fields { id: 'projectName', title: 'Project Name', @@ -1527,7 +1503,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'create_project' }, }, - // Members / assignees / followers / dependencies { id: 'memberUserIds', title: 'Member User IDs', @@ -1558,7 +1533,6 @@ export const RocketlaneBlock: BlockConfig = { }, }, - // Task fields { id: 'taskName', title: 'Task Name', @@ -1666,7 +1640,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: EXTERNAL_REFERENCE_OPS }, }, - // Phase fields { id: 'phaseName', title: 'Phase Name', @@ -1676,7 +1649,6 @@ export const RocketlaneBlock: BlockConfig = { required: { field: 'operation', value: 'create_phase' }, }, - // Field (custom field) configuration { id: 'fieldLabel', title: 'Field Label', @@ -1818,7 +1790,6 @@ export const RocketlaneBlock: BlockConfig = { required: { field: 'operation', value: 'update_field_option' }, }, - // Template import { id: 'templateId', title: 'Template ID', @@ -1836,7 +1807,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'import_template' }, }, - // Dates { id: 'startDate', title: 'Start Date', @@ -1870,7 +1840,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: STATUS_VALUE_OPS }, }, - // Time entry fields { id: 'date', title: 'Date', @@ -1995,7 +1964,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: ['create_time_entry', 'update_time_entry'] }, }, - // Time-off fields { id: 'timeOffType', title: 'Time-Off Type', @@ -2056,7 +2024,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'create_time_off' }, }, - // Space fields { id: 'spaceName', title: 'Space Name', @@ -2066,7 +2033,6 @@ export const RocketlaneBlock: BlockConfig = { required: { field: 'operation', value: 'create_space' }, }, - // Space document fields { id: 'spaceDocumentType', title: 'Document Type', @@ -2102,7 +2068,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'create_space_document' }, }, - // List filters — projects { id: 'projectNameContains', title: 'Project Name Contains', @@ -2218,7 +2183,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'list_projects' }, }, - // List filters — tasks { id: 'taskNameContains', title: 'Task Name Contains', @@ -2274,7 +2238,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'list_tasks' }, }, - // List filters — time entries (shared with search) { id: 'dateEq', title: 'Date Equals', @@ -2450,7 +2413,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: CREATED_UPDATED_AT_OPS }, }, - // List filters — time-offs { id: 'startDateGe', title: 'Start Date On or After', @@ -2498,7 +2460,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'list_time_offs' }, }, - // List filters — users { id: 'firstNameCn', title: 'First Name Contains', @@ -2559,7 +2520,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'list_users' }, }, - // List filters — spaces / space documents { id: 'spaceNameEq', title: 'Space Name Equals', @@ -2597,7 +2557,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'list_space_documents' }, }, - // List filters — resource allocations { id: 'memberIdEq', title: 'Member ID Filter', @@ -2615,7 +2574,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'list_resource_allocations' }, }, - // List filters — invoices { id: 'invoiceStatusEq', title: 'Invoice Status', @@ -2718,7 +2676,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: 'list_invoices' }, }, - // Shared list controls { id: 'sortBy', title: 'Sort By', @@ -2785,7 +2742,6 @@ export const RocketlaneBlock: BlockConfig = { condition: { field: 'operation', value: PAGINATED_OPS }, }, - // Credential { id: 'apiKey', title: 'API Key', diff --git a/apps/sim/blocks/blocks/shopify.ts b/apps/sim/blocks/blocks/shopify.ts index f5c5f9b6ade..a4575984d9a 100644 --- a/apps/sim/blocks/blocks/shopify.ts +++ b/apps/sim/blocks/blocks/shopify.ts @@ -130,32 +130,25 @@ export const ShopifyBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Product Operations { label: 'Create Product', id: 'shopify_create_product' }, { label: 'Get Product', id: 'shopify_get_product' }, { label: 'List Products', id: 'shopify_list_products' }, { label: 'Update Product', id: 'shopify_update_product' }, { label: 'Delete Product', id: 'shopify_delete_product' }, - // Order Operations { label: 'Get Order', id: 'shopify_get_order' }, { label: 'List Orders', id: 'shopify_list_orders' }, { label: 'Update Order', id: 'shopify_update_order' }, { label: 'Cancel Order', id: 'shopify_cancel_order' }, - // Customer Operations { label: 'Create Customer', id: 'shopify_create_customer' }, { label: 'Get Customer', id: 'shopify_get_customer' }, { label: 'List Customers', id: 'shopify_list_customers' }, { label: 'Update Customer', id: 'shopify_update_customer' }, { label: 'Delete Customer', id: 'shopify_delete_customer' }, - // Inventory Operations { label: 'List Inventory Items', id: 'shopify_list_inventory_items' }, { label: 'Get Inventory Level', id: 'shopify_get_inventory_level' }, { label: 'Adjust Inventory', id: 'shopify_adjust_inventory' }, - // Location Operations { label: 'List Locations', id: 'shopify_list_locations' }, - // Fulfillment Operations { label: 'Create Fulfillment', id: 'shopify_create_fulfillment' }, - // Collection Operations { label: 'List Collections', id: 'shopify_list_collections' }, { label: 'Get Collection', id: 'shopify_get_collection' }, ], @@ -188,7 +181,6 @@ export const ShopifyBlock: BlockConfig = { placeholder: 'Auto-detected from OAuth or enter manually', hidden: true, }, - // Product ID (for get/update/delete operations) { id: 'productId', title: 'Product ID', @@ -200,7 +192,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_get_product', 'shopify_update_product', 'shopify_delete_product'], }, }, - // Product Title (for create/update) { id: 'title', title: 'Product Title', @@ -215,7 +206,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_product', 'shopify_update_product'], }, }, - // Product Description { id: 'descriptionHtml', title: 'Description (HTML)', @@ -226,7 +216,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_product', 'shopify_update_product'], }, }, - // Product Type { id: 'productType', title: 'Product Type', @@ -237,7 +226,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_product', 'shopify_update_product'], }, }, - // Vendor { id: 'vendor', title: 'Vendor', @@ -248,7 +236,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_product', 'shopify_update_product'], }, }, - // Tags { id: 'tags', title: 'Tags', @@ -259,7 +246,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_product', 'shopify_update_product'], }, }, - // Status { id: 'status', title: 'Status', @@ -275,7 +261,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_product', 'shopify_update_product'], }, }, - // Query for listing products { id: 'productQuery', title: 'Search Query', @@ -287,7 +272,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_list_products'], }, }, - // Query for listing customers { id: 'customerQuery', title: 'Search Query', @@ -299,7 +283,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_list_customers'], }, }, - // Query for listing inventory items { id: 'inventoryQuery', title: 'Search Query', @@ -322,7 +305,6 @@ export const ShopifyBlock: BlockConfig = { value: [...LIST_OPERATIONS], }, }, - // Order ID { id: 'orderId', title: 'Order ID', @@ -334,7 +316,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_get_order', 'shopify_update_order', 'shopify_cancel_order'], }, }, - // Order Status (for listing) { id: 'orderStatus', title: 'Order Status', @@ -362,7 +343,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_list_orders'], }, }, - // Order Note (for update) { id: 'orderNote', title: 'Order Note', @@ -373,7 +353,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_update_order'], }, }, - // Order Email (for update) { id: 'orderEmail', title: 'Customer Email', @@ -384,7 +363,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_update_order'], }, }, - // Order Tags (for update) { id: 'orderTags', title: 'Order Tags', @@ -395,7 +373,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_update_order'], }, }, - // Cancel Order Reason { id: 'cancelReason', title: 'Cancel Reason', @@ -415,7 +392,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_cancel_order'], }, }, - // Staff Note (for cancel order) { id: 'staffNote', title: 'Staff Note', @@ -472,7 +448,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_cancel_order'], }, }, - // Customer ID { id: 'customerId', title: 'Customer ID', @@ -484,7 +459,7 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_get_customer', 'shopify_update_customer', 'shopify_delete_customer'], }, }, - // Customer Email (at least one of email/phone/firstName/lastName required for create) + // At least one of email/phone/firstName/lastName is required for create { id: 'customerEmail', title: 'Email', @@ -495,7 +470,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_customer', 'shopify_update_customer'], }, }, - // Customer First Name { id: 'firstName', title: 'First Name', @@ -506,7 +480,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_customer', 'shopify_update_customer'], }, }, - // Customer Last Name { id: 'lastName', title: 'Last Name', @@ -517,7 +490,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_customer', 'shopify_update_customer'], }, }, - // Customer Phone { id: 'phone', title: 'Phone', @@ -528,7 +500,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_customer', 'shopify_update_customer'], }, }, - // Customer Note { id: 'customerNote', title: 'Customer Note', @@ -539,7 +510,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_customer', 'shopify_update_customer'], }, }, - // Customer Tags { id: 'customerTags', title: 'Customer Tags', @@ -550,7 +520,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_customer', 'shopify_update_customer'], }, }, - // Inventory Item ID { id: 'inventoryItemId', title: 'Inventory Item ID', @@ -562,7 +531,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_get_inventory_level', 'shopify_adjust_inventory'], }, }, - // Location ID { id: 'locationId', title: 'Location ID', @@ -577,7 +545,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_get_inventory_level', 'shopify_adjust_inventory'], }, }, - // Delta (for inventory adjustment) { id: 'delta', title: 'Quantity Change', @@ -589,7 +556,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_adjust_inventory'], }, }, - // Fulfillment Order ID { id: 'fulfillmentOrderId', title: 'Fulfillment Order ID', @@ -601,7 +567,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_fulfillment'], }, }, - // Tracking Number { id: 'trackingNumber', title: 'Tracking Number', @@ -612,7 +577,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_fulfillment'], }, }, - // Tracking Company { id: 'trackingCompany', title: 'Shipping Carrier', @@ -623,7 +587,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_fulfillment'], }, }, - // Tracking URL { id: 'trackingUrl', title: 'Tracking URL', @@ -634,7 +597,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_create_fulfillment'], }, }, - // Notify Customer (for fulfillment) { id: 'notifyCustomer', title: 'Notify Customer', @@ -665,7 +627,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_list_locations'], }, }, - // Collection ID { id: 'collectionId', title: 'Collection ID', @@ -677,7 +638,6 @@ export const ShopifyBlock: BlockConfig = { value: ['shopify_get_collection'], }, }, - // Collection Query { id: 'collectionQuery', title: 'Search Query', @@ -737,7 +697,6 @@ export const ShopifyBlock: BlockConfig = { } switch (params.operation) { - // Product Operations case 'shopify_create_product': if (!params.title?.trim()) { throw new Error('Product title is required.') @@ -798,7 +757,6 @@ export const ShopifyBlock: BlockConfig = { productId: params.productId.trim(), } - // Order Operations case 'shopify_get_order': if (!params.orderId?.trim()) { throw new Error('Order ID is required.') @@ -851,7 +809,6 @@ export const ShopifyBlock: BlockConfig = { staffNote: params.staffNote?.trim(), } - // Customer Operations case 'shopify_create_customer': // At least one of email/phone/firstName/lastName required (validated in tool) return { @@ -910,7 +867,6 @@ export const ShopifyBlock: BlockConfig = { customerId: params.customerId.trim(), } - // Inventory Operations case 'shopify_list_inventory_items': return { ...baseParams, @@ -945,7 +901,6 @@ export const ShopifyBlock: BlockConfig = { delta: Number(params.delta), } - // Location Operations case 'shopify_list_locations': return { ...baseParams, @@ -953,7 +908,6 @@ export const ShopifyBlock: BlockConfig = { includeInactive: parseOptionalBooleanInput(params.includeInactive), } - // Fulfillment Operations case 'shopify_create_fulfillment': if (!params.fulfillmentOrderId?.trim()) { throw new Error('Fulfillment Order ID is required.') @@ -967,7 +921,6 @@ export const ShopifyBlock: BlockConfig = { notifyCustomer: parseOptionalBooleanInput(params.notifyCustomer), } - // Collection Operations case 'shopify_list_collections': return { ...baseParams, @@ -995,7 +948,6 @@ export const ShopifyBlock: BlockConfig = { operation: { type: 'string', description: 'Operation to perform' }, oauthCredential: { type: 'string', description: 'Shopify access token' }, shopDomain: { type: 'string', description: 'Shopify store domain' }, - // Product inputs productId: { type: 'string', description: 'Product ID' }, title: { type: 'string', description: 'Product title' }, descriptionHtml: { type: 'string', description: 'Product description (HTML)' }, @@ -1005,7 +957,6 @@ export const ShopifyBlock: BlockConfig = { status: { type: 'string', description: 'Product status' }, productQuery: { type: 'string', description: 'Product search query' }, first: { type: 'number', description: 'Maximum number of results to return' }, - // Order inputs orderId: { type: 'string', description: 'Order ID' }, orderStatus: { type: 'string', description: 'Order status filter' }, orderQuery: { type: 'string', description: 'Order search query' }, @@ -1020,7 +971,6 @@ export const ShopifyBlock: BlockConfig = { description: 'Whether to refund to the original payment method', }, staffNote: { type: 'string', description: 'Staff note for order cancellation' }, - // Customer inputs customerId: { type: 'string', description: 'Customer ID' }, customerEmail: { type: 'string', description: 'Customer email' }, firstName: { type: 'string', description: 'Customer first name' }, @@ -1029,25 +979,21 @@ export const ShopifyBlock: BlockConfig = { customerNote: { type: 'string', description: 'Customer note' }, customerTags: { type: 'string', description: 'Customer tags' }, customerQuery: { type: 'string', description: 'Customer search query' }, - // Inventory inputs inventoryQuery: { type: 'string', description: 'Inventory search query' }, inventoryItemId: { type: 'string', description: 'Inventory item ID' }, locationId: { type: 'string', description: 'Location ID' }, delta: { type: 'number', description: 'Quantity change' }, - // Fulfillment inputs fulfillmentOrderId: { type: 'string', description: 'Fulfillment order ID' }, trackingNumber: { type: 'string', description: 'Shipment tracking number' }, trackingCompany: { type: 'string', description: 'Shipping carrier name' }, trackingUrl: { type: 'string', description: 'Tracking URL' }, notifyCustomer: { type: 'boolean', description: 'Send shipping notification email' }, includeInactive: { type: 'boolean', description: 'Include inactive locations in results' }, - // Collection inputs collectionId: { type: 'string', description: 'Collection ID' }, collectionQuery: { type: 'string', description: 'Collection search query' }, productsFirst: { type: 'number', description: 'Maximum number of products to return' }, }, outputs: { - // Product outputs product: { type: 'json', description: @@ -1057,7 +1003,6 @@ export const ShopifyBlock: BlockConfig = { type: 'json', description: 'List of products with core product fields and media summaries', }, - // Order outputs order: { type: 'json', description: @@ -1067,7 +1012,6 @@ export const ShopifyBlock: BlockConfig = { type: 'json', description: 'List of orders with status, totals, customer, and shipping summary fields', }, - // Customer outputs customer: { type: 'json', description: @@ -1077,7 +1021,6 @@ export const ShopifyBlock: BlockConfig = { type: 'json', description: 'List of customers with contact details, tags, spend, and default address', }, - // Inventory outputs inventoryItems: { type: 'json', description: @@ -1088,19 +1031,16 @@ export const ShopifyBlock: BlockConfig = { description: 'Inventory levels for an item or an inventory adjustment result (levels by location, or adjustmentGroup and changes)', }, - // Location outputs locations: { type: 'json', description: 'Store locations with id, name, active status, fulfillment capability, and address', }, - // Fulfillment outputs fulfillment: { type: 'json', description: 'Fulfillment result (id, status, trackingInfo, createdAt, updatedAt, fulfillmentLineItems)', }, - // Collection outputs collection: { type: 'json', description: @@ -1115,9 +1055,7 @@ export const ShopifyBlock: BlockConfig = { type: 'json', description: 'Pagination info for list operations (hasNextPage, hasPreviousPage)', }, - // Delete outputs deletedId: { type: 'string', description: 'ID of deleted resource' }, - // Success indicator success: { type: 'boolean', description: 'Operation success status' }, }, } diff --git a/apps/sim/blocks/blocks/slack.ts b/apps/sim/blocks/blocks/slack.ts index 328db1a7ca9..5df2aa2c0d2 100644 --- a/apps/sim/blocks/blocks/slack.ts +++ b/apps/sim/blocks/blocks/slack.ts @@ -741,7 +741,6 @@ Do not include any explanations, markdown formatting, or other text outside the mode: 'advanced', required: false, }, - // Canvas specific fields { id: 'title', title: 'Canvas Title', @@ -764,7 +763,6 @@ Do not include any explanations, markdown formatting, or other text outside the }, required: true, }, - // Message Reader specific fields { id: 'limit', title: 'Message Limit', @@ -775,7 +773,6 @@ Do not include any explanations, markdown formatting, or other text outside the value: 'read', }, }, - // List Channels specific fields { id: 'includePrivate', title: 'Include Private Channels', @@ -801,7 +798,6 @@ Do not include any explanations, markdown formatting, or other text outside the }, mode: 'advanced', }, - // List Members specific fields { id: 'memberLimit', title: 'Member Limit', @@ -812,7 +808,6 @@ Do not include any explanations, markdown formatting, or other text outside the value: 'list_members', }, }, - // List Users specific fields { id: 'includeDeleted', title: 'Include Deactivated Users', @@ -837,7 +832,6 @@ Do not include any explanations, markdown formatting, or other text outside the value: 'list_users', }, }, - // Pagination cursor (shared across list_channels, list_members, list_users) { id: 'paginationCursor', title: 'Pagination Cursor', @@ -849,7 +843,6 @@ Do not include any explanations, markdown formatting, or other text outside the }, mode: 'advanced', }, - // Get User specific fields { id: 'userId', title: 'User', @@ -880,7 +873,6 @@ Do not include any explanations, markdown formatting, or other text outside the }, required: true, }, - // Get Message specific fields { id: 'getMessageTimestamp', title: 'Message Timestamp', @@ -906,7 +898,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Get Thread specific fields { id: 'getThreadTimestamp', title: 'Thread Timestamp', @@ -948,7 +939,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, value: 'get_thread', }, }, - // Set Assistant Status specific fields { id: 'status', title: 'Status Text', @@ -971,7 +961,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: false, }, - // Set Assistant Title specific fields { id: 'assistantTitle', title: 'Thread Title', @@ -983,7 +972,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // Set Suggested Prompts specific fields { id: 'suggestedPrompts', title: 'Suggested Prompts', @@ -1021,7 +1009,6 @@ Return ONLY the JSON array - no explanations, no quotes around the array, no ext mode: 'advanced', required: false, }, - // Get Channel History / Get Thread Replies shared pagination fields { id: 'historyOldest', title: 'Oldest Timestamp', @@ -1120,7 +1107,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // Download File specific fields { id: 'fileId', title: 'File ID', @@ -1143,7 +1129,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, value: 'download', }, }, - // Update Message specific fields { id: 'updateTimestamp', title: 'Message Timestamp', @@ -1171,7 +1156,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, and: { field: 'messageFormat', value: 'blocks', not: true }, }, }, - // Delete Message specific fields { id: 'deleteTimestamp', title: 'Message Timestamp', @@ -1183,7 +1167,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // Add Reaction specific fields { id: 'reactionTimestamp', title: 'Message Timestamp', @@ -1206,7 +1189,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // Get Channel Info specific fields { id: 'includeNumMembers', title: 'Include Member Count', @@ -1221,7 +1203,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, value: 'get_channel_info', }, }, - // Get User Presence specific fields { id: 'presenceUserId', title: 'User', @@ -1252,7 +1233,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // Edit Canvas specific fields { id: 'editCanvasId', title: 'Canvas ID', @@ -1326,7 +1306,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // Create Channel Canvas specific fields { id: 'channelCanvasTitle', title: 'Canvas Title', @@ -1347,7 +1326,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, value: 'create_channel_canvas', }, }, - // Get Canvas specific fields { id: 'getCanvasId', title: 'Canvas ID', @@ -1359,7 +1337,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // List Canvases specific fields { id: 'canvasListCount', title: 'Canvas Limit', @@ -1426,7 +1403,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // Lookup Canvas Sections specific fields { id: 'lookupCanvasId', title: 'Canvas ID', @@ -1450,7 +1426,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // Delete Canvas specific fields { id: 'deleteCanvasId', title: 'Canvas ID', @@ -1462,7 +1437,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // Create Conversation specific fields { id: 'conversationName', title: 'Channel Name', @@ -1499,7 +1473,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // Invite to Conversation specific fields { id: 'inviteUsers', title: 'User IDs', @@ -1526,7 +1499,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // Open View / Push View specific fields { id: 'viewTriggerId', title: 'Trigger ID', @@ -1549,7 +1521,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // Update View specific fields { id: 'viewId', title: 'View ID', @@ -1570,7 +1541,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, value: 'update_view', }, }, - // Update View / Publish View hash field { id: 'viewHash', title: 'View Hash', @@ -1582,7 +1552,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // Publish View specific fields { id: 'publishUserId', title: 'User', @@ -1613,7 +1582,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, required: true, }, - // View payload (shared across all view operations) { id: 'viewPayload', title: 'View Payload', @@ -1678,7 +1646,6 @@ Do not include any explanations, markdown formatting, or other text outside the placeholder: 'Describe the view/modal you want to create...', }, }, - // Schedule Message specific fields { id: 'scheduleAt', title: 'Send At', @@ -1704,7 +1671,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te generationType: 'timestamp', }, }, - // List Scheduled Messages specific fields { id: 'scheduledLimit', title: 'Message Limit', @@ -1729,7 +1695,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te mode: 'advanced', required: false, }, - // Delete Scheduled Message specific fields { id: 'scheduledMessageId', title: 'Scheduled Message ID', @@ -1741,7 +1706,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te }, required: true, }, - // Rename Conversation specific fields { id: 'renameChannelName', title: 'New Channel Name', @@ -1753,7 +1717,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te }, required: true, }, - // Set Conversation Topic specific fields { id: 'conversationTopic', title: 'Topic', @@ -1765,7 +1728,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te }, required: true, }, - // Set Conversation Purpose specific fields { id: 'conversationPurpose', title: 'Purpose', @@ -2021,9 +1983,8 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te baseParams.channel = effectiveChannel } - // Handle authentication based on method. Custom Bot resolves to a token - // server-side: v2 selects a reusable bot credential; v1 pastes a raw - // token (kept for back-compat). + // Custom Bot resolves to a token server-side: v2 selects a reusable bot + // credential; v1 pastes a raw token (kept for back-compat). if (authMethod === 'bot_token') { if (botCredential) { baseParams.credential = botCredential @@ -2031,7 +1992,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te baseParams.accessToken = botToken } } else { - // Default to OAuth baseParams.credential = oauthCredential } @@ -2416,7 +2376,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te oldest: { type: 'string', description: 'Oldest timestamp' }, fileId: { type: 'string', description: 'File ID to download' }, fileName: { type: 'string', description: 'File name override for download (canonical param)' }, - // Update/Delete/React operation inputs updateTimestamp: { type: 'string', description: 'Message timestamp for update' }, updateText: { type: 'string', description: 'New text for update' }, deleteTimestamp: { type: 'string', description: 'Message timestamp for delete' }, @@ -2426,47 +2385,35 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te name: { type: 'string', description: 'Emoji name' }, threadTs: { type: 'string', description: 'Thread timestamp' }, thread_ts: { type: 'string', description: 'Thread timestamp for reply' }, - // List Channels inputs includePrivate: { type: 'string', description: 'Include private channels (true/false)' }, channelLimit: { type: 'string', description: 'Conversations to request per Slack page' }, - // List Members inputs memberLimit: { type: 'string', description: 'Maximum number of members to return' }, - // List Users inputs includeDeleted: { type: 'string', description: 'Include deactivated users (true/false)' }, userLimit: { type: 'string', description: 'Maximum number of users to return' }, - // Shared pagination input paginationCursor: { type: 'string', description: 'Pagination cursor (nextCursor) for list_channels/list_members/list_users', }, - // Ephemeral message inputs ephemeralUser: { type: 'string', description: 'User ID who will see the ephemeral message' }, blocks: { type: 'json', description: 'Block Kit layout blocks as a JSON array' }, - // Get User inputs userId: { type: 'string', description: 'User ID to look up' }, - // Get Message inputs getMessageTimestamp: { type: 'string', description: 'Message timestamp to retrieve' }, - // Get Thread inputs getThreadTimestamp: { type: 'string', description: 'Thread timestamp to retrieve' }, threadLimit: { type: 'string', description: 'Maximum number of messages to return from thread', }, - // Set Assistant Status inputs status: { type: 'string', description: 'Status text to display (empty clears the status)' }, loadingMessages: { type: 'json', description: 'Optional array of phrases to animate as a loading indicator (max 10)', }, - // Set Assistant Title inputs assistantTitle: { type: 'string', description: 'Title to display for the assistant thread' }, - // Set Suggested Prompts inputs suggestedPrompts: { type: 'json', description: 'Array of { title, message } prompt objects (max 4)', }, promptsTitle: { type: 'string', description: 'Optional heading for the prompt list' }, - // Get Channel History / Get Thread Replies inputs historyOldest: { type: 'string', description: 'Only include messages after this Unix timestamp', @@ -2482,20 +2429,15 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te type: 'string', description: 'Include messages matching oldest/latest (true/false)', }, - // Get Channel Info inputs includeNumMembers: { type: 'string', description: 'Include member count (true/false)' }, - // Get User Presence inputs presenceUserId: { type: 'string', description: 'User ID to check presence for' }, - // Edit Canvas inputs editCanvasId: { type: 'string', description: 'Canvas ID to edit' }, canvasOperation: { type: 'string', description: 'Canvas edit operation' }, canvasContent: { type: 'string', description: 'Markdown content for canvas edit' }, sectionId: { type: 'string', description: 'Canvas section ID to target' }, canvasTitle: { type: 'string', description: 'New canvas title for rename' }, - // Create Channel Canvas inputs channelCanvasTitle: { type: 'string', description: 'Title for channel canvas' }, channelCanvasContent: { type: 'string', description: 'Content for channel canvas' }, - // Canvas management inputs getCanvasId: { type: 'string', description: 'Canvas ID to retrieve' }, canvasListCount: { type: 'string', description: 'Maximum number of canvases to return' }, canvasListPage: { type: 'string', description: 'Canvas list page number' }, @@ -2512,14 +2454,11 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te lookupCanvasId: { type: 'string', description: 'Canvas ID to search for sections' }, sectionCriteria: { type: 'json', description: 'Canvas section lookup criteria' }, deleteCanvasId: { type: 'string', description: 'Canvas ID to delete' }, - // Create Conversation inputs conversationName: { type: 'string', description: 'Name for the new channel' }, isPrivate: { type: 'string', description: 'Create as private channel (true/false)' }, teamId: { type: 'string', description: 'Encoded team ID for org tokens' }, - // Invite to Conversation inputs inviteUsers: { type: 'string', description: 'Comma-separated user IDs to invite' }, inviteForce: { type: 'string', description: 'Skip invalid users (true/false)' }, - // View operation inputs viewTriggerId: { type: 'string', description: 'Trigger ID from interaction payload' }, viewInteractivityPointer: { type: 'string', @@ -2536,31 +2475,24 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te description: 'User ID to publish Home tab view to', }, viewPayload: { type: 'json', description: 'View payload object with type, title, and blocks' }, - // Schedule Message inputs scheduleAt: { type: 'string', description: 'Unix timestamp (seconds) for when the scheduled message should post', }, - // List Scheduled Messages inputs scheduledLimit: { type: 'string', description: 'Maximum number of scheduled messages to return', }, scheduledCursor: { type: 'string', description: 'Pagination cursor for scheduled messages' }, - // Delete Scheduled Message inputs scheduledMessageId: { type: 'string', description: 'Scheduled message ID to delete' }, - // Rename Conversation inputs renameChannelName: { type: 'string', description: 'New name for the channel' }, - // Set Conversation Topic inputs conversationTopic: { type: 'string', description: 'New channel topic (max 250 characters)' }, - // Set Conversation Purpose inputs conversationPurpose: { type: 'string', description: 'New channel purpose/description (max 250 characters)', }, }, outputs: { - // slack_message outputs (send operation) message: { type: 'json', description: @@ -2575,13 +2507,11 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te }, files: { type: 'file[]', description: 'Files attached to the message' }, - // slack_ephemeral_message outputs (ephemeral operation) messageTs: { type: 'string', description: 'Timestamp of the ephemeral message (cannot be used to update or delete)', }, - // slack_canvas outputs canvas_id: { type: 'string', description: 'Canvas identifier for created canvases' }, title: { type: 'string', description: 'Canvas title' }, canvas: { @@ -2613,14 +2543,12 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te description: 'Agent session status recorded by Slack', }, - // slack_message_reader outputs (read operation) messages: { type: 'json', description: 'Array of message objects with comprehensive properties: text, user, timestamp, reactions, threads, files, attachments, blocks, stars, pins, and edit history', }, - // slack_get_thread outputs (get_thread operation) parentMessage: { type: 'json', description: 'The thread parent message with all properties', @@ -2639,7 +2567,6 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te 'Whether more thread messages or provider pages remain beyond the fetched window', }, - // slack_get_channel_history / slack_get_thread_replies pagination outputs pages: { type: 'number', description: 'Number of provider pages fetched during a paginated read', @@ -2649,13 +2576,11 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te description: 'Thread timestamp an assistant status/title/prompts op was set on', }, - // slack_get_permalink outputs (get_permalink operation) permalink: { type: 'string', description: 'Permalink URL to the message', }, - // slack_list_channels outputs (list_channels operation) channels: { type: 'json', description: @@ -2670,47 +2595,40 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te description: 'Cursor for the next page (null when there are no more pages)', }, - // slack_list_members outputs (list_members operation) members: { type: 'json', description: 'Array of user IDs who are members of the channel', }, - // slack_list_users outputs (list_users operation) users: { type: 'json', description: 'Array of user objects with properties: id, name, real_name, display_name, is_bot, is_admin, deleted, timezone, avatar, status_text, status_emoji', }, - // slack_get_user outputs (get_user operation) user: { type: 'json', description: 'Detailed user object with properties: id, name, real_name, display_name, first_name, last_name, title, is_bot, is_admin, deleted, timezone, avatars, status', }, - // slack_download outputs file: { type: 'file', description: 'Downloaded file stored in execution files', }, - // slack_update_message outputs (update operation) content: { type: 'string', description: 'Success message for update operation' }, metadata: { type: 'json', description: 'Updated message metadata (legacy, use message object instead)', }, - // slack_get_channel_info outputs (get_channel_info operation) channelInfo: { type: 'json', description: 'Detailed channel object with properties: id, name, is_private, is_archived, is_member, num_members, topic, purpose, created, creator', }, - // slack_get_user_presence outputs (get_user_presence operation) presence: { type: 'string', description: 'User presence status: "active" or "away"', @@ -2740,21 +2658,18 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te 'Unix timestamp of last detected activity (only available when checking own presence)', }, - // View operation outputs (open_view, update_view, push_view, publish_view) view: { type: 'json', description: 'View object with properties: id, team_id, type, title, submit, close, blocks, private_metadata, callback_id, external_id, state, hash, clear_on_close, notify_on_close, root_view_id, previous_view_id, app_id, bot_id', }, - // slack_invite_to_conversation outputs (invite_to_conversation operation) errors: { type: 'json', description: 'Array of per-user error objects when force is true and some invitations failed (user, ok, error)', }, - // slack_schedule_message outputs (schedule_message operation) scheduledMessageId: { type: 'string', description: 'Identifier of the scheduled message (used to delete it before it posts)', @@ -2764,14 +2679,12 @@ Return ONLY the integer Unix timestamp - no explanations, no quotes, no extra te description: 'Unix timestamp when a scheduled message will post', }, - // slack_list_scheduled_messages outputs (list_scheduled_messages operation) scheduledMessages: { type: 'json', description: 'Array of pending scheduled message objects with properties: id, channel_id, post_at, date_created, text', }, - // slack_set_conversation_purpose outputs (set_conversation_purpose operation) purpose: { type: 'string', description: 'The purpose/description that was set on the channel', diff --git a/apps/sim/blocks/blocks/spotify.ts b/apps/sim/blocks/blocks/spotify.ts index afd641e6744..06d51b19750 100644 --- a/apps/sim/blocks/blocks/spotify.ts +++ b/apps/sim/blocks/blocks/spotify.ts @@ -293,12 +293,9 @@ export const SpotifyBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Search & Discovery { label: 'Search', id: 'spotify_search', group: 'Search & Discovery' }, - // Tracks { label: 'Get Track', id: 'spotify_get_track', group: 'Tracks' }, { label: 'Get Multiple Tracks', id: 'spotify_get_tracks', group: 'Tracks' }, - // Albums { label: 'Get Album', id: 'spotify_get_album', group: 'Albums' }, { label: 'Get Multiple Albums', id: 'spotify_get_albums', group: 'Albums' }, { label: 'Get Album Tracks', id: 'spotify_get_album_tracks', group: 'Albums' }, @@ -306,7 +303,6 @@ export const SpotifyBlock: BlockConfig = { { label: 'Save Albums', id: 'spotify_save_albums', group: 'Albums' }, { label: 'Remove Saved Albums', id: 'spotify_remove_saved_albums', group: 'Albums' }, { label: 'Check Saved Albums', id: 'spotify_check_saved_albums', group: 'Albums' }, - // Artists { label: 'Get Artist', id: 'spotify_get_artist', group: 'Artists' }, { label: 'Get Multiple Artists', id: 'spotify_get_artists', group: 'Artists' }, { label: 'Get Artist Albums', id: 'spotify_get_artist_albums', group: 'Artists' }, @@ -315,7 +311,6 @@ export const SpotifyBlock: BlockConfig = { { label: 'Unfollow Artists', id: 'spotify_unfollow_artists', group: 'Artists' }, { label: 'Get Followed Artists', id: 'spotify_get_followed_artists', group: 'Artists' }, { label: 'Check Following', id: 'spotify_check_following', group: 'Artists' }, - // Shows (Podcasts) { label: 'Get Show', id: 'spotify_get_show', group: 'Podcasts' }, { label: 'Get Multiple Shows', id: 'spotify_get_shows', group: 'Podcasts' }, { label: 'Get Show Episodes', id: 'spotify_get_show_episodes', group: 'Podcasts' }, @@ -323,14 +318,12 @@ export const SpotifyBlock: BlockConfig = { { label: 'Save Shows', id: 'spotify_save_shows', group: 'Podcasts' }, { label: 'Remove Saved Shows', id: 'spotify_remove_saved_shows', group: 'Podcasts' }, { label: 'Check Saved Shows', id: 'spotify_check_saved_shows', group: 'Podcasts' }, - // Episodes { label: 'Get Episode', id: 'spotify_get_episode', group: 'Episodes' }, { label: 'Get Multiple Episodes', id: 'spotify_get_episodes', group: 'Episodes' }, { label: 'Get Saved Episodes', id: 'spotify_get_saved_episodes', group: 'Episodes' }, { label: 'Save Episodes', id: 'spotify_save_episodes', group: 'Episodes' }, { label: 'Remove Saved Episodes', id: 'spotify_remove_saved_episodes', group: 'Episodes' }, { label: 'Check Saved Episodes', id: 'spotify_check_saved_episodes', group: 'Episodes' }, - // Audiobooks { label: 'Get Audiobook', id: 'spotify_get_audiobook', group: 'Audiobooks' }, { label: 'Get Multiple Audiobooks', id: 'spotify_get_audiobooks', group: 'Audiobooks' }, { @@ -350,7 +343,6 @@ export const SpotifyBlock: BlockConfig = { id: 'spotify_check_saved_audiobooks', group: 'Audiobooks', }, - // Playlists { label: 'Get Playlist', id: 'spotify_get_playlist', group: 'Playlists' }, { label: 'Get Playlist Tracks', id: 'spotify_get_playlist_tracks', group: 'Playlists' }, { label: 'Get Playlist Cover', id: 'spotify_get_playlist_cover', group: 'Playlists' }, @@ -385,7 +377,6 @@ export const SpotifyBlock: BlockConfig = { id: 'spotify_check_playlist_followers', group: 'Playlists', }, - // User Profile & Library { label: 'Get My Profile', id: 'spotify_get_current_user', group: 'User & Library' }, { label: 'Get User Profile', id: 'spotify_get_user_profile', group: 'User & Library' }, { label: 'Get My Top Tracks', id: 'spotify_get_top_tracks', group: 'User & Library' }, @@ -403,11 +394,9 @@ export const SpotifyBlock: BlockConfig = { id: 'spotify_get_recently_played', group: 'User & Library', }, - // Browse { label: 'Get New Releases', id: 'spotify_get_new_releases', group: 'Browse' }, { label: 'Get Categories', id: 'spotify_get_categories', group: 'Browse' }, { label: 'Get Available Markets', id: 'spotify_get_markets', group: 'Browse' }, - // Player Controls { label: 'Get Playback State', id: 'spotify_get_playback_state', group: 'Player' }, { label: 'Get Currently Playing', id: 'spotify_get_currently_playing', group: 'Player' }, { label: 'Get Devices', id: 'spotify_get_devices', group: 'Player' }, @@ -445,7 +434,6 @@ export const SpotifyBlock: BlockConfig = { required: true, }, - // === SEARCH === { id: 'query', title: 'Search Query', @@ -472,7 +460,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_search' }, }, - // === TRACK IDs === { id: 'trackId', title: 'Track ID', @@ -498,7 +485,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === ALBUM ID === { id: 'albumId', title: 'Album ID', @@ -524,7 +510,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === ARTIST ID === { id: 'artistId', title: 'Artist ID', @@ -548,7 +533,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === SHOW IDs === { id: 'showId', title: 'Show ID', @@ -574,7 +558,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === EPISODE IDs === { id: 'episodeId', title: 'Episode ID', @@ -600,7 +583,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === AUDIOBOOK IDs === { id: 'audiobookId', title: 'Audiobook ID', @@ -629,7 +611,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === CHECK FOLLOWING === { id: 'followType', title: 'Type', @@ -650,7 +631,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_check_following' }, }, - // === USER ID === { id: 'userId', title: 'User ID', @@ -660,7 +640,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_get_user_profile' }, }, - // === PLAYLIST OPERATIONS === { id: 'playlistId', title: 'Playlist ID', @@ -721,7 +700,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === CHECK PLAYLIST FOLLOWERS === { id: 'userIds', title: 'User IDs', @@ -731,7 +709,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_check_playlist_followers' }, }, - // === PLAYLIST COVER === { id: 'coverImageFile', title: 'Cover Image', @@ -755,7 +732,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_add_playlist_cover' }, }, - // === REORDER PLAYLIST === { id: 'range_start', title: 'Range Start', @@ -780,7 +756,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_reorder_playlist_items' }, }, - // === ADD/REMOVE/REPLACE TRACKS FROM PLAYLIST === { id: 'uris', title: 'Track URIs', @@ -797,7 +772,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === COUNTRY/LOCALE === { id: 'country', title: 'Country', @@ -809,7 +783,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === TOP ITEMS TIME RANGE === { id: 'time_range', title: 'Time Range', @@ -826,7 +799,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === PLAYER CONTROLS === { id: 'device_id', title: 'Device ID', @@ -880,7 +852,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_set_volume' }, }, - // === SEEK === { id: 'position_ms', title: 'Position (ms)', @@ -890,7 +861,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_seek' }, }, - // === REPEAT === { id: 'state', title: 'Repeat Mode', @@ -904,7 +874,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_set_repeat' }, }, - // === SHUFFLE === { id: 'shuffle_state', title: 'Shuffle', @@ -914,7 +883,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_set_shuffle' }, }, - // === TRANSFER PLAYBACK === { id: 'target_device_id', title: 'Target Device ID', @@ -924,7 +892,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_transfer_playback' }, }, - // === COMMON: LIMIT === { id: 'limit', title: 'Limit', @@ -1061,10 +1028,8 @@ export const SpotifyBlock: BlockConfig = { inputs: { operation: { type: 'string', description: 'Operation to perform' }, oauthCredential: { type: 'string', description: 'Spotify OAuth credential' }, - // Search query: { type: 'string', description: 'Search query' }, type: { type: 'string', description: 'Search type' }, - // IDs trackId: { type: 'string', description: 'Spotify track ID' }, trackIds: { type: 'string', description: 'Comma-separated track IDs' }, albumId: { type: 'string', description: 'Spotify album ID' }, @@ -1082,7 +1047,6 @@ export const SpotifyBlock: BlockConfig = { userIds: { type: 'string', description: 'Comma-separated user IDs' }, ids: { type: 'string', description: 'Comma-separated IDs' }, followType: { type: 'string', description: 'Type to check (artist or user)' }, - // Playlist name: { type: 'string', description: 'Playlist name' }, newName: { type: 'string', description: 'New playlist name' }, description: { type: 'string', description: 'Playlist description' }, @@ -1091,15 +1055,11 @@ export const SpotifyBlock: BlockConfig = { range_start: { type: 'number', description: 'Start index for reorder' }, insert_before: { type: 'number', description: 'Insert before index' }, range_length: { type: 'number', description: 'Number of items to move' }, - // Track URIs uris: { type: 'string', description: 'Comma-separated Spotify URIs' }, playUris: { type: 'string', description: 'Track URIs to play' }, uri: { type: 'string', description: 'Spotify URI' }, - // Time range time_range: { type: 'string', description: 'Time range for top items' }, - // Browse country: { type: 'string', description: 'ISO country code' }, - // Player device_id: { type: 'string', description: 'Device ID for playback' }, context_uri: { type: 'string', description: 'Context URI (album, playlist, artist)' }, volume_percent: { type: 'number', description: 'Volume level (0-100)' }, @@ -1107,11 +1067,9 @@ export const SpotifyBlock: BlockConfig = { state: { type: 'string', description: 'Repeat mode (off, track, context)' }, shuffle_state: { type: 'boolean', description: 'Shuffle on/off' }, target_device_id: { type: 'string', description: 'Target device ID for transfer' }, - // Common limit: { type: 'number', description: 'Maximum number of results' }, }, outputs: { - // === SEARCH OUTPUTS === tracks: { type: 'json', description: 'List of tracks', @@ -1161,7 +1119,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: ['spotify_search', 'spotify_get_user_playlists'] }, }, - // === SINGLE ITEM OUTPUTS === id: { type: 'string', description: 'Spotify ID', @@ -1250,7 +1207,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === TRACK OUTPUTS === album: { type: 'json', description: 'Album information', @@ -1275,7 +1231,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_get_track' }, }, - // === ALBUM OUTPUTS === album_type: { type: 'string', description: 'Album type (album, single, compilation)', @@ -1302,7 +1257,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: ['spotify_get_album', 'spotify_get_artist'] }, }, - // === ARTIST OUTPUTS === followers: { type: 'number', description: 'Number of followers', @@ -1312,7 +1266,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === PLAYLIST OUTPUTS === description: { type: 'string', description: 'Description', @@ -1358,7 +1311,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === SHOW/PODCAST OUTPUTS === publisher: { type: 'string', description: 'Publisher name', @@ -1380,7 +1332,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: ['spotify_get_show', 'spotify_get_audiobook'] }, }, - // === EPISODE OUTPUTS === show: { type: 'json', description: 'Parent show information', @@ -1395,7 +1346,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === AUDIOBOOK OUTPUTS === authors: { type: 'json', description: 'List of authors', @@ -1425,7 +1375,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_get_audiobook_chapters' }, }, - // === USER PROFILE OUTPUTS === display_name: { type: 'string', description: 'User display name', @@ -1450,7 +1399,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_get_current_user' }, }, - // === PLAYER STATE OUTPUTS === is_playing: { type: 'boolean', description: 'Whether playback is active', @@ -1511,14 +1459,12 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_get_queue' }, }, - // === RECENTLY PLAYED OUTPUTS === items: { type: 'json', description: 'List of recently played items', condition: { field: 'operation', value: 'spotify_get_recently_played' }, }, - // === BROWSE OUTPUTS === categories: { type: 'json', description: 'List of browse categories', @@ -1530,7 +1476,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_get_markets' }, }, - // === CHECK SAVED OUTPUTS === results: { type: 'json', description: 'Check operation results (id and saved boolean)', @@ -1558,7 +1503,6 @@ export const SpotifyBlock: BlockConfig = { condition: { field: 'operation', value: 'spotify_check_saved_tracks' }, }, - // === PAGINATION OUTPUTS === total: { type: 'number', description: 'Total number of items', @@ -1598,7 +1542,6 @@ export const SpotifyBlock: BlockConfig = { }, }, - // === OPERATION RESULT OUTPUTS === success: { type: 'boolean', description: 'Whether operation succeeded', diff --git a/apps/sim/blocks/blocks/stripe.ts b/apps/sim/blocks/blocks/stripe.ts index c306b1288e2..8e926a3d3fb 100644 --- a/apps/sim/blocks/blocks/stripe.ts +++ b/apps/sim/blocks/blocks/stripe.ts @@ -195,7 +195,6 @@ export const StripeBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Payment Intents { label: 'Create Payment Intent', id: 'create_payment_intent' }, { label: 'Retrieve Payment Intent', id: 'retrieve_payment_intent' }, { label: 'Update Payment Intent', id: 'update_payment_intent' }, @@ -204,14 +203,12 @@ export const StripeBlock: BlockConfig = { { label: 'Cancel Payment Intent', id: 'cancel_payment_intent' }, { label: 'List Payment Intents', id: 'list_payment_intents' }, { label: 'Search Payment Intents', id: 'search_payment_intents' }, - // Customers { label: 'Create Customer', id: 'create_customer' }, { label: 'Retrieve Customer', id: 'retrieve_customer' }, { label: 'Update Customer', id: 'update_customer' }, { label: 'Delete Customer', id: 'delete_customer' }, { label: 'List Customers', id: 'list_customers' }, { label: 'Search Customers', id: 'search_customers' }, - // Subscriptions { label: 'Create Subscription', id: 'create_subscription' }, { label: 'Retrieve Subscription', id: 'retrieve_subscription' }, { label: 'Update Subscription', id: 'update_subscription' }, @@ -219,7 +216,6 @@ export const StripeBlock: BlockConfig = { { label: 'Resume Subscription', id: 'resume_subscription' }, { label: 'List Subscriptions', id: 'list_subscriptions' }, { label: 'Search Subscriptions', id: 'search_subscriptions' }, - // Invoices { label: 'Create Invoice', id: 'create_invoice' }, { label: 'Retrieve Invoice', id: 'retrieve_invoice' }, { label: 'Update Invoice', id: 'update_invoice' }, @@ -230,27 +226,23 @@ export const StripeBlock: BlockConfig = { { label: 'Send Invoice', id: 'send_invoice' }, { label: 'List Invoices', id: 'list_invoices' }, { label: 'Search Invoices', id: 'search_invoices' }, - // Charges { label: 'Create Charge', id: 'create_charge' }, { label: 'Retrieve Charge', id: 'retrieve_charge' }, { label: 'Update Charge', id: 'update_charge' }, { label: 'Capture Charge', id: 'capture_charge' }, { label: 'List Charges', id: 'list_charges' }, { label: 'Search Charges', id: 'search_charges' }, - // Products { label: 'Create Product', id: 'create_product' }, { label: 'Retrieve Product', id: 'retrieve_product' }, { label: 'Update Product', id: 'update_product' }, { label: 'Delete Product', id: 'delete_product' }, { label: 'List Products', id: 'list_products' }, { label: 'Search Products', id: 'search_products' }, - // Prices { label: 'Create Price', id: 'create_price' }, { label: 'Retrieve Price', id: 'retrieve_price' }, { label: 'Update Price', id: 'update_price' }, { label: 'List Prices', id: 'list_prices' }, { label: 'Search Prices', id: 'search_prices' }, - // Events { label: 'Retrieve Event', id: 'retrieve_event' }, { label: 'List Events', id: 'list_events' }, ], @@ -264,7 +256,6 @@ export const StripeBlock: BlockConfig = { placeholder: 'Enter your Stripe secret key (sk_test_... or sk_live_...)', required: true, }, - // Common ID field for retrieve/update/delete/confirm/capture/cancel operations { id: 'id', title: 'ID', @@ -305,7 +296,6 @@ export const StripeBlock: BlockConfig = { }, required: true, }, - // Payment Intent specific fields - CREATE (amount required) { id: 'amount', title: 'Amount (in cents)', @@ -317,7 +307,6 @@ export const StripeBlock: BlockConfig = { }, required: true, }, - // Payment Intent specific fields - UPDATE/CAPTURE (amount optional) { id: 'amount', title: 'Amount (in cents)', @@ -328,7 +317,6 @@ export const StripeBlock: BlockConfig = { value: ['update_payment_intent', 'capture_payment_intent', 'capture_charge'], }, }, - // Currency - REQUIRED for create operations { id: 'currency', title: 'Currency', @@ -340,7 +328,6 @@ export const StripeBlock: BlockConfig = { }, required: true, }, - // Currency - OPTIONAL for update operations { id: 'currency', title: 'Currency', @@ -362,7 +349,6 @@ export const StripeBlock: BlockConfig = { value: ['create_payment_intent', 'confirm_payment_intent', 'create_customer'], }, }, - // Customer specific fields - REQUIRED for create_subscription and create_invoice { id: 'customer', title: 'Customer ID', @@ -374,7 +360,6 @@ export const StripeBlock: BlockConfig = { }, required: true, }, - // Customer specific fields - OPTIONAL for other operations { id: 'customer', title: 'Customer ID', @@ -395,7 +380,6 @@ export const StripeBlock: BlockConfig = { value: ['create_customer', 'update_customer'], }, }, - // Name - REQUIRED for create_product { id: 'name', title: 'Name', @@ -407,7 +391,6 @@ export const StripeBlock: BlockConfig = { }, required: true, }, - // Name - OPTIONAL for customers and update_product { id: 'name', title: 'Name', @@ -440,7 +423,6 @@ export const StripeBlock: BlockConfig = { }, mode: 'advanced', }, - // Subscription specific fields - REQUIRED for create_subscription { id: 'items', title: 'Items (JSON Array)', @@ -452,7 +434,6 @@ export const StripeBlock: BlockConfig = { }, required: true, }, - // Items - OPTIONAL for update_subscription { id: 'items', title: 'Items (JSON Array)', @@ -499,7 +480,6 @@ export const StripeBlock: BlockConfig = { }, mode: 'advanced', }, - // Invoice specific fields { id: 'collection_method', title: 'Collection Method', @@ -528,7 +508,6 @@ export const StripeBlock: BlockConfig = { }, mode: 'advanced', }, - // Charge specific fields { id: 'source', title: 'Payment Source', @@ -553,7 +532,6 @@ export const StripeBlock: BlockConfig = { }, mode: 'advanced', }, - // Product specific fields { id: 'active', title: 'Active', @@ -579,7 +557,6 @@ export const StripeBlock: BlockConfig = { }, mode: 'advanced', }, - // Price specific fields { id: 'product', title: 'Product ID', @@ -611,7 +588,6 @@ export const StripeBlock: BlockConfig = { value: 'create_price', }, }, - // Common description field { id: 'description', title: 'Description', @@ -634,7 +610,6 @@ export const StripeBlock: BlockConfig = { }, mode: 'advanced', }, - // Common metadata field { id: 'metadata', title: 'Metadata (JSON)', @@ -661,7 +636,6 @@ export const StripeBlock: BlockConfig = { }, mode: 'advanced', }, - // List/Search common fields { id: 'limit', title: 'Limit', @@ -732,7 +706,6 @@ export const StripeBlock: BlockConfig = { condition: { field: 'operation', value: 'search_subscriptions' }, mode: 'advanced', }, - // Additional filters for specific list operations { id: 'status', title: 'Status', @@ -834,7 +807,6 @@ export const StripeBlock: BlockConfig = { ], tools: { access: [ - // Payment Intents 'stripe_create_payment_intent', 'stripe_retrieve_payment_intent', 'stripe_update_payment_intent', @@ -843,14 +815,12 @@ export const StripeBlock: BlockConfig = { 'stripe_cancel_payment_intent', 'stripe_list_payment_intents', 'stripe_search_payment_intents', - // Customers 'stripe_create_customer', 'stripe_retrieve_customer', 'stripe_update_customer', 'stripe_delete_customer', 'stripe_list_customers', 'stripe_search_customers', - // Subscriptions 'stripe_create_subscription', 'stripe_retrieve_subscription', 'stripe_update_subscription', @@ -858,7 +828,6 @@ export const StripeBlock: BlockConfig = { 'stripe_resume_subscription', 'stripe_list_subscriptions', 'stripe_search_subscriptions', - // Invoices 'stripe_create_invoice', 'stripe_retrieve_invoice', 'stripe_update_invoice', @@ -869,27 +838,23 @@ export const StripeBlock: BlockConfig = { 'stripe_send_invoice', 'stripe_list_invoices', 'stripe_search_invoices', - // Charges 'stripe_create_charge', 'stripe_retrieve_charge', 'stripe_update_charge', 'stripe_capture_charge', 'stripe_list_charges', 'stripe_search_charges', - // Products 'stripe_create_product', 'stripe_retrieve_product', 'stripe_update_product', 'stripe_delete_product', 'stripe_list_products', 'stripe_search_products', - // Prices 'stripe_create_price', 'stripe_retrieve_price', 'stripe_update_price', 'stripe_list_prices', 'stripe_search_prices', - // Events 'stripe_retrieve_event', 'stripe_list_events', ], @@ -916,7 +881,6 @@ export const StripeBlock: BlockConfig = { ...rest } = params - // Parse JSON fields let parsedAddress: any | undefined let parsedMetadata: any | undefined let parsedItems: any | undefined @@ -933,7 +897,6 @@ export const StripeBlock: BlockConfig = { throw new Error(`Invalid JSON input: ${error.message}`) } - // Convert string booleans to actual booleans const parsedBooleans: Record = {} if (cancel_at_period_end !== undefined) parsedBooleans.cancel_at_period_end = cancel_at_period_end === 'true' @@ -961,44 +924,35 @@ export const StripeBlock: BlockConfig = { inputs: { operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'Stripe secret API key' }, - // Common inputs id: { type: 'string', description: 'Resource ID' }, amount: { type: 'number', description: 'Amount in cents' }, currency: { type: 'string', description: 'Three-letter ISO currency code' }, description: { type: 'string', description: 'Description of the resource' }, metadata: { type: 'json', description: 'Set of key-value pairs' }, - // Customer inputs customer: { type: 'string', description: 'Customer ID' }, email: { type: 'string', description: 'Customer email address' }, name: { type: 'string', description: 'Customer or product name' }, phone: { type: 'string', description: 'Customer phone number' }, address: { type: 'json', description: 'Customer address object' }, - // Payment inputs payment_method: { type: 'string', description: 'Payment method ID' }, source: { type: 'string', description: 'Payment source' }, receipt_email: { type: 'string', description: 'Email for receipt' }, - // Subscription inputs items: { type: 'json', description: 'Subscription items array' }, trial_period_days: { type: 'number', description: 'Trial period in days' }, cancel_at_period_end: { type: 'boolean', description: 'Cancel at period end' }, prorate: { type: 'boolean', description: 'Prorate cancellation' }, invoice_now: { type: 'boolean', description: 'Invoice immediately' }, - // Invoice inputs collection_method: { type: 'string', description: 'Collection method' }, auto_advance: { type: 'boolean', description: 'Auto-finalize invoice' }, paid_out_of_band: { type: 'boolean', description: 'Paid outside Stripe' }, - // Charge inputs capture: { type: 'boolean', description: 'Capture immediately' }, amount_to_capture: { type: 'number', description: 'Amount to capture in cents' }, cancellation_reason: { type: 'string', description: 'Cancellation reason' }, - // Product inputs active: { type: 'boolean', description: 'Whether resource is active' }, images: { type: 'json', description: 'Product images array' }, - // Price inputs product: { type: 'string', description: 'Product ID' }, unit_amount: { type: 'number', description: 'Unit amount in cents' }, recurring: { type: 'json', description: 'Recurring billing configuration' }, - // List/Search inputs limit: { type: 'number', description: 'Maximum results to return' }, starting_after: { type: 'string', description: 'Next-page subscription ID cursor' }, ending_before: { type: 'string', description: 'Previous-page subscription ID cursor' }, @@ -1008,31 +962,22 @@ export const StripeBlock: BlockConfig = { type: { type: 'string', description: 'Event type filter' }, }, outputs: { - // Payment Intent outputs payment_intent: { type: 'json', description: 'Payment intent object' }, payment_intents: { type: 'json', description: 'Array of payment intents' }, - // Customer outputs customer: { type: 'json', description: 'Customer object' }, customers: { type: 'json', description: 'Array of customers' }, - // Subscription outputs subscription: { type: 'json', description: 'Subscription object' }, subscriptions: { type: 'json', description: 'Array of subscriptions' }, - // Invoice outputs invoice: { type: 'json', description: 'Invoice object' }, invoices: { type: 'json', description: 'Array of invoices' }, - // Charge outputs charge: { type: 'json', description: 'Charge object' }, charges: { type: 'json', description: 'Array of charges' }, - // Product outputs product: { type: 'json', description: 'Product object' }, products: { type: 'json', description: 'Array of products' }, - // Price outputs price: { type: 'json', description: 'Price object' }, prices: { type: 'json', description: 'Array of prices' }, - // Event outputs event: { type: 'json', description: 'Event object' }, events: { type: 'json', description: 'Array of events' }, - // Common outputs metadata: { type: 'json', description: 'Operation metadata' }, deleted: { type: 'boolean', description: 'Whether resource was deleted' }, }, diff --git a/apps/sim/blocks/blocks/temporal.ts b/apps/sim/blocks/blocks/temporal.ts index d142a707163..d2f7c22d706 100644 --- a/apps/sim/blocks/blocks/temporal.ts +++ b/apps/sim/blocks/blocks/temporal.ts @@ -173,7 +173,6 @@ export const TemporalBlock: BlockConfig = { }, subBlocks: [ - // ── Operation selector ───────────────────────────────────────────────────── { id: 'operation', title: 'Operation', @@ -203,7 +202,6 @@ export const TemporalBlock: BlockConfig = { value: () => 'start_workflow', }, - // ── Workflow ID (all operations except list) ─────────────────────────────── { id: 'workflowId', title: 'Workflow ID', @@ -213,7 +211,6 @@ export const TemporalBlock: BlockConfig = { required: { field: 'operation', value: WORKFLOW_ID_OPERATIONS }, }, - // ── Start Workflow / Signal With Start / Create Schedule ─────────────────── { id: 'workflowType', title: 'Workflow Type', @@ -244,7 +241,6 @@ export const TemporalBlock: BlockConfig = { }, }, - // ── Signal Workflow / Signal With Start ──────────────────────────────────── { id: 'signalName', title: 'Signal Name', @@ -267,7 +263,6 @@ export const TemporalBlock: BlockConfig = { }, }, - // ── Query Workflow ───────────────────────────────────────────────────────── { id: 'queryType', title: 'Query Type', @@ -290,7 +285,6 @@ export const TemporalBlock: BlockConfig = { }, }, - // ── Update Workflow ──────────────────────────────────────────────────────── { id: 'updateName', title: 'Update Name', @@ -313,7 +307,6 @@ export const TemporalBlock: BlockConfig = { }, }, - // ── List / Count Workflows ───────────────────────────────────────────────── { id: 'listQuery', title: 'Query Filter', @@ -352,7 +345,6 @@ Return ONLY the filter expression - no explanations, no extra text.`, mode: 'advanced', }, - // ── Get Workflow History ─────────────────────────────────────────────────── { id: 'historyEventFilterType', title: 'Event Filter', @@ -382,7 +374,6 @@ Return ONLY the filter expression - no explanations, no extra text.`, mode: 'advanced', }, - // ── Reset Workflow ───────────────────────────────────────────────────────── { id: 'workflowTaskFinishEventId', title: 'Reset Event ID', @@ -392,7 +383,6 @@ Return ONLY the filter expression - no explanations, no extra text.`, required: { field: 'operation', value: 'reset_workflow' }, }, - // ── Schedule operations ──────────────────────────────────────────────────── { id: 'scheduleId', title: 'Schedule ID', @@ -497,7 +487,6 @@ Return ONLY the cron expression(s) - no explanations, no extra text.`, mode: 'advanced', }, - // ── Describe Task Queue ──────────────────────────────────────────────────── { id: 'taskQueueType', title: 'Task Queue Type', @@ -511,7 +500,6 @@ Return ONLY the cron expression(s) - no explanations, no extra text.`, mode: 'advanced', }, - // ── Reason (cancel / terminate / reset / pause / unpause) ────────────────── { id: 'reason', title: 'Reason', @@ -529,7 +517,6 @@ Return ONLY the cron expression(s) - no explanations, no extra text.`, }, }, - // ── Shared advanced options ──────────────────────────────────────────────── { id: 'runId', title: 'Run ID', @@ -631,7 +618,6 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, }, }, - // ── Connection (common to all operations) ────────────────────────────────── { id: 'serverUrl', title: 'Server URL', @@ -683,7 +669,6 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, params: (params) => { const result: Record = {} - // start_workflow / signal_with_start: coerce timeouts, drop empty policies if (params.operation === 'start_workflow' || params.operation === 'signal_with_start') { result.executionTimeoutSeconds = toFiniteNumber(params.executionTimeoutSeconds) result.runTimeoutSeconds = toFiniteNumber(params.runTimeoutSeconds) @@ -691,29 +676,24 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, if (!params.workflowIdConflictPolicy) result.workflowIdConflictPolicy = undefined } - // list_workflows / count_workflows: remap listQuery → query if (params.operation === 'list_workflows' || params.operation === 'count_workflows') { result.query = params.listQuery || undefined } - // list_workflows: coerce page size if (params.operation === 'list_workflows') { result.pageSize = toFiniteNumber(params.pageSize) } - // get_workflow_history: remap history-prefixed fields, drop empty filter if (params.operation === 'get_workflow_history') { result.maximumPageSize = toFiniteNumber(params.historyPageSize) result.nextPageToken = params.historyNextPageToken || undefined if (!params.historyEventFilterType) result.historyEventFilterType = undefined } - // reset_workflow: coerce the reset point event ID if (params.operation === 'reset_workflow') { result.workflowTaskFinishEventId = toFiniteNumber(params.workflowTaskFinishEventId) } - // create_schedule: remap schedule-prefixed fields, coerce interval and paused state if (params.operation === 'create_schedule') { result.cronExpressions = params.scheduleCronExpressions || undefined result.intervalSeconds = toFiniteNumber(params.scheduleIntervalSeconds) @@ -722,14 +702,12 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, result.paused = params.schedulePaused === 'true' ? true : undefined } - // list_schedules: remap schedule-prefixed fields if (params.operation === 'list_schedules') { result.query = params.scheduleQuery || undefined result.maximumPageSize = toFiniteNumber(params.schedulePageSize) result.nextPageToken = params.scheduleNextPageToken || undefined } - // trigger_schedule / create_schedule: drop empty overlap policy if ( (params.operation === 'trigger_schedule' || params.operation === 'create_schedule') && !params.overlapPolicy @@ -737,7 +715,6 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, result.overlapPolicy = undefined } - // describe_task_queue: drop empty task queue type if (params.operation === 'describe_task_queue' && !params.taskQueueType) { result.taskQueueType = undefined } @@ -757,7 +734,6 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, }, workflowId: { type: 'string', description: 'Workflow ID of the execution' }, runId: { type: 'string', description: 'Run ID targeting a specific run' }, - // Start Workflow / Signal With Start workflowType: { type: 'string', description: 'Workflow type name to run' }, taskQueue: { type: 'string', description: 'Task queue the workflow worker polls' }, input: { type: 'string', description: 'Workflow input as JSON' }, @@ -777,32 +753,25 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, runTimeoutSeconds: { type: 'number', description: 'Single-run timeout in seconds' }, memo: { type: 'string', description: 'JSON object of memo fields' }, searchAttributes: { type: 'string', description: 'JSON object of search attribute values' }, - // Signal signalName: { type: 'string', description: 'Name of the signal handler to invoke' }, signalInput: { type: 'string', description: 'Signal input as JSON' }, - // Query queryType: { type: 'string', description: 'Name of the query handler to invoke' }, queryArgs: { type: 'string', description: 'Query arguments as JSON' }, - // Update updateName: { type: 'string', description: 'Name of the update handler to invoke' }, updateArgs: { type: 'string', description: 'Update arguments as JSON' }, - // List / Count Workflows listQuery: { type: 'string', description: 'Visibility filter expression' }, pageSize: { type: 'number', description: 'Maximum executions to return per page' }, nextPageToken: { type: 'string', description: 'Page token for list pagination' }, - // Get Workflow History historyEventFilterType: { type: 'string', description: 'History event filter (all events or close event only)', }, historyPageSize: { type: 'number', description: 'Maximum history events to return per page' }, historyNextPageToken: { type: 'string', description: 'Page token for history pagination' }, - // Reset workflowTaskFinishEventId: { type: 'number', description: 'WORKFLOW_TASK_COMPLETED event ID to reset to', }, - // Schedules scheduleId: { type: 'string', description: 'Schedule ID' }, scheduleCronExpressions: { type: 'string', @@ -825,12 +794,10 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, type: 'string', description: 'Overlap policy for triggered or scheduled actions', }, - // Task queues taskQueueType: { type: 'string', description: 'Type of pollers to list (workflow or activity)', }, - // Cancel / Terminate / Reset / Pause / Unpause reason: { type: 'string', description: 'Reason recorded in the workflow history or schedule notes', @@ -838,17 +805,13 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, }, outputs: { - // Start / Signal With Start workflowId: { type: 'string', description: 'Workflow ID of the execution' }, runId: { type: 'string', description: 'Run ID of the execution' }, started: { type: 'boolean', description: 'Whether a new execution was started' }, - // Signal signalName: { type: 'string', description: 'Name of the signal that was sent' }, - // Query / Update queryType: { type: 'string', description: 'Name of the query that was run' }, updateName: { type: 'string', description: 'Name of the update that was invoked' }, result: { type: 'json', description: 'Decoded query or update result' }, - // Describe / List workflowType: { type: 'string', description: 'Workflow type name' }, status: { type: 'string', @@ -872,13 +835,11 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, description: 'Workflow executions matching the list filter (workflowId, runId, workflowType, status, startTime, closeTime, executionTime, historyLength, taskQueue)', }, - // Count Workflows count: { type: 'number', description: 'Number of workflow executions matching the query' }, groups: { type: 'json', description: 'Per-group counts when the count query uses GROUP BY', }, - // Get Workflow History events: { type: 'json', description: 'History events (eventId, eventTime, eventType, attributes)', @@ -887,7 +848,6 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, type: 'string', description: 'Token for the next page of results (list and history operations)', }, - // Schedules scheduleId: { type: 'string', description: 'Schedule ID' }, schedules: { type: 'json', @@ -904,7 +864,6 @@ Return ONLY a valid JSON object - no explanations, no extra text.`, description: 'Recent schedule actions (scheduleTime, actualTime, workflowId, runId)', }, futureActionTimes: { type: 'json', description: 'Upcoming schedule action times (RFC 3339)' }, - // Describe Task Queue pollers: { type: 'json', description: 'Workers polling the task queue (identity, lastAccessTime, ratePerSecond)', diff --git a/apps/sim/blocks/blocks/trigger_dev.ts b/apps/sim/blocks/blocks/trigger_dev.ts index 159cb96da05..874e8824cd5 100644 --- a/apps/sim/blocks/blocks/trigger_dev.ts +++ b/apps/sim/blocks/blocks/trigger_dev.ts @@ -284,7 +284,6 @@ export const TriggerDevBlock: BlockConfig = { placeholder: 'Enter your Trigger.dev secret API key (tr_...)', required: true, }, - // Trigger Task fields { id: 'taskIdentifier', title: 'Task Identifier', @@ -385,7 +384,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, mode: 'advanced', condition: { field: 'operation', value: TAGS_OPERATIONS }, }, - // Batch Trigger Task fields { id: 'items', title: 'Batch Items', @@ -414,7 +412,6 @@ Return ONLY the valid JSON array - no explanations, no markdown.`, generationType: 'json-object', }, }, - // Batch fields { id: 'batchId', title: 'Batch ID', @@ -423,7 +420,6 @@ Return ONLY the valid JSON array - no explanations, no markdown.`, condition: { field: 'operation', value: BATCH_ID_OPERATIONS }, required: { field: 'operation', value: BATCH_ID_OPERATIONS }, }, - // Run fields { id: 'runId', title: 'Run ID', @@ -472,7 +468,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, generationType: 'json-object', }, }, - // List Runs filters { id: 'status', title: 'Status Filter', @@ -594,7 +589,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: PAGE_BEFORE_OPERATIONS }, }, - // Schedule fields { id: 'scheduleId', title: 'Schedule ID', @@ -643,7 +637,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'trigger_dev_create_schedule' }, required: { field: 'operation', value: 'trigger_dev_create_schedule' }, }, - // List Schedules / List Queues pagination { id: 'page', title: 'Page', @@ -660,7 +653,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: NUMBERED_PAGE_OPERATIONS }, }, - // Environment variable fields { id: 'projectRef', title: 'Project Ref', @@ -720,7 +712,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: 'trigger_dev_import_env_vars' }, }, - // Queue fields { id: 'queueName', title: 'Queue', @@ -749,7 +740,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'trigger_dev_override_queue_concurrency' }, required: { field: 'operation', value: 'trigger_dev_override_queue_concurrency' }, }, - // Deployment fields { id: 'deploymentId', title: 'Deployment ID', @@ -784,7 +774,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, mode: 'advanced', condition: { field: 'operation', value: 'trigger_dev_list_deployments' }, }, - // Query fields { id: 'query', title: 'TRQL Query', @@ -836,7 +825,6 @@ Return ONLY the TRQL query - no explanations, no markdown.`, mode: 'advanced', condition: { field: 'operation', value: 'trigger_dev_execute_query' }, }, - // Waitpoint fields { id: 'waitpointId', title: 'Waitpoint ID', @@ -912,7 +900,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, mode: 'advanced', condition: { field: 'operation', value: 'trigger_dev_list_waitpoint_tokens' }, }, - // Timezone fields { id: 'excludeUtc', title: 'Exclude UTC', @@ -1031,7 +1018,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, apiKey: { type: 'string', description: 'Trigger.dev secret API key' }, - // Trigger Task taskIdentifier: { type: 'string', description: 'Identifier of the task to trigger' }, payload: { type: 'json', description: 'JSON payload passed to the task run' }, idempotencyKey: { type: 'string', description: 'Idempotency key to deduplicate triggers' }, @@ -1041,13 +1027,11 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, ttl: { type: 'string', description: 'Time-to-live before an unstarted run expires' }, machine: { type: 'string', description: 'Machine preset for the run' }, tags: { type: 'string', description: 'Comma-separated tags to attach to the run' }, - // Batch Trigger Task items: { type: 'json', description: 'JSON array of batch items, each with a payload and optional options', }, batchId: { type: 'string', description: 'Batch ID (starts with batch_)' }, - // Runs runId: { type: 'string', description: 'Run ID (starts with run_)' }, rescheduleDelay: { type: 'string', description: 'New delay for a delayed run' }, runTags: { type: 'string', description: 'Comma-separated tags to add to a run' }, @@ -1067,7 +1051,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, pageSize: { type: 'number', description: 'Number of runs per page (max 100)' }, pageAfter: { type: 'string', description: 'Run ID to start the page after' }, pageBefore: { type: 'string', description: 'Run ID to start the page before' }, - // Schedules scheduleId: { type: 'string', description: 'Schedule ID (starts with sched_)' }, task: { type: 'string', description: 'Identifier of the task the schedule triggers' }, cron: { type: 'string', description: 'Cron expression defining when the task runs' }, @@ -1076,7 +1059,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, deduplicationKey: { type: 'string', description: 'Key to prevent duplicate schedules' }, page: { type: 'number', description: 'Page number for listing schedules' }, perPage: { type: 'number', description: 'Number of schedules per page' }, - // Environment variables projectRef: { type: 'string', description: 'Project ref (starts with proj_)' }, environment: { type: 'string', description: 'Project environment (dev, staging, or prod)' }, name: { type: 'string', description: 'Name of the environment variable' }, @@ -1089,7 +1071,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, type: 'string', description: 'Whether to override existing variables on import ("true" or "false")', }, - // Queues queueName: { type: 'string', description: 'Queue ID, task identifier, or custom queue name', @@ -1102,18 +1083,15 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, type: 'number', description: 'New concurrency limit for the queue (0 to 100000)', }, - // Deployments deploymentId: { type: 'string', description: 'ID of the deployment to retrieve' }, deploymentVersion: { type: 'string', description: 'Deployment version to promote' }, deploymentStatus: { type: 'string', description: 'Deployment status to filter by' }, - // Query query: { type: 'string', description: 'TRQL query to execute' }, scope: { type: 'string', description: 'Scope of data to query (environment, project, or organization)', }, format: { type: 'string', description: 'Query response format (json or csv)' }, - // Waitpoints waitpointId: { type: 'string', description: 'Waitpoint token ID (starts with waitpoint_)' }, waitpointData: { type: 'json', @@ -1136,7 +1114,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, type: 'string', description: 'Comma-separated tags to filter waitpoint tokens by', }, - // Timezones excludeUtc: { type: 'string', description: 'Whether to exclude UTC from the timezones ("true" or "false")', @@ -1144,9 +1121,7 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, }, outputs: { - // Trigger Task / Cancel Run / Replay Run / schedule operations id: { type: 'string', description: 'Run, schedule, or queue ID' }, - // Batches batchId: { type: 'string', description: 'Batch ID (Batch Trigger Task)' }, runIds: { type: 'json', description: 'Run IDs in the batch (batch operations)' }, runCount: { type: 'number', description: 'Total number of runs in the batch (Get Batch)' }, @@ -1163,7 +1138,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, type: 'json', description: 'Execution results for each run in the batch (Get Batch Results)', }, - // Get Run status: { type: 'string', description: 'Run status (Get Run)' }, taskIdentifier: { type: 'string', description: 'Task identifier of the run (Get Run)' }, createdAt: { type: 'string', description: 'When the run was created (Get Run)' }, @@ -1187,11 +1161,9 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, events: { type: 'json', description: 'Log and span events of the run (Get Run Events)' }, traceId: { type: 'string', description: 'OpenTelemetry trace ID (Get Run Trace)' }, rootSpan: { type: 'json', description: 'Root span of the run trace (Get Run Trace)' }, - // List Runs / List Schedules runs: { type: 'json', description: 'Runs matching the filters (List Runs)' }, schedules: { type: 'json', description: 'Schedules in the project (List Schedules)' }, pagination: { type: 'json', description: 'Pagination details (list operations)' }, - // Schedules task: { type: 'string', description: 'Task the schedule triggers (schedule operations)' }, active: { type: 'boolean', @@ -1209,7 +1181,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, description: 'Environments the schedule runs in (schedule operations)', }, deleted: { type: 'boolean', description: 'Whether the schedule was deleted (Delete Schedule)' }, - // Environment variables variables: { type: 'json', description: 'Environment variables in the project environment (List Env Vars)', @@ -1227,7 +1198,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, type: 'number', description: 'Number of environment variables submitted (Import Env Vars)', }, - // Queues queues: { type: 'json', description: 'Queues in the environment (List Queues)' }, running: { type: 'number', description: 'Runs currently executing (queue operations)' }, queued: { type: 'number', description: 'Runs waiting in the queue (queue operations)' }, @@ -1240,7 +1210,6 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, type: 'json', description: 'Concurrency details of the queue (queue operations)', }, - // Deployments deployments: { type: 'json', description: 'Deployments matching the filters (List Deployments)', @@ -1251,18 +1220,15 @@ Return ONLY the valid JSON object - no explanations, no markdown.`, type: 'json', description: 'Tasks registered by the deployed worker (deployment operations)', }, - // Query format: { type: 'string', description: 'Format of the query results (Execute Query)' }, results: { type: 'json', description: 'Query results (Execute Query)' }, tables: { type: 'json', description: 'Queryable TRQL tables and columns (Get Query Schema)' }, - // Waitpoints tokens: { type: 'json', description: 'Waitpoint tokens (List Waitpoint Tokens)' }, url: { type: 'string', description: 'Waitpoint callback URL (waitpoint operations)' }, isCached: { type: 'boolean', description: 'Whether an existing token was returned (Create Waitpoint Token)', }, - // Timezones timezones: { type: 'json', description: 'Supported IANA timezones (List Timezones)' }, }, } diff --git a/apps/sim/blocks/blocks/tts.ts b/apps/sim/blocks/blocks/tts.ts index 3ff4a2948ab..64625bb3a78 100644 --- a/apps/sim/blocks/blocks/tts.ts +++ b/apps/sim/blocks/blocks/tts.ts @@ -28,7 +28,6 @@ export const TtsBlock: BlockConfig = { }, subBlocks: [ - // Provider selection { id: 'provider', title: 'Provider', @@ -46,7 +45,6 @@ export const TtsBlock: BlockConfig = { required: true, }, - // Text input (common to all providers) { id: 'text', title: 'Text', @@ -55,7 +53,6 @@ export const TtsBlock: BlockConfig = { required: true, }, - // OpenAI Model Selection { id: 'model', title: 'Model', @@ -71,7 +68,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // OpenAI Voice Selection { id: 'voice', title: 'Voice', @@ -94,7 +90,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // OpenAI Response Format { id: 'responseFormat', title: 'Audio Format', @@ -112,7 +107,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // OpenAI Speed { id: 'speed', title: 'Speed', @@ -126,7 +120,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Deepgram Voice Selection { id: 'voice', title: 'Voice', @@ -151,7 +144,6 @@ export const TtsBlock: BlockConfig = { required: true, }, - // Deepgram Encoding { id: 'encoding', title: 'Audio Format', @@ -169,7 +161,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Deepgram Sample Rate (only for linear16 format) { id: 'sampleRate', title: 'Sample Rate', @@ -190,7 +181,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // ElevenLabs Voice ID { id: 'voiceId', title: 'Voice ID', @@ -201,7 +191,6 @@ export const TtsBlock: BlockConfig = { required: true, }, - // ElevenLabs Model Selection { id: 'modelId', title: 'Model', @@ -220,7 +209,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // ElevenLabs Stability { id: 'stability', title: 'Stability', @@ -234,7 +222,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // ElevenLabs Similarity Boost { id: 'similarityBoost', title: 'Similarity Boost', @@ -248,7 +235,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // ElevenLabs Style { id: 'style', title: 'Style', @@ -262,7 +248,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Cartesia Model Selection { id: 'modelId', title: 'Model', @@ -280,7 +265,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Cartesia Voice { id: 'voice', title: 'Voice ID', @@ -291,7 +275,6 @@ export const TtsBlock: BlockConfig = { required: true, }, - // Cartesia Speed { id: 'speed', title: 'Speed', @@ -305,7 +288,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Google Voice ID { id: 'voiceId', title: 'Voice ID', @@ -316,7 +298,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Google Language Code { id: 'languageCode', title: 'Language Code', @@ -328,7 +309,6 @@ export const TtsBlock: BlockConfig = { required: true, }, - // Google Speaking Rate { id: 'speakingRate', title: 'Speaking Rate', @@ -342,7 +322,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Google Pitch { id: 'pitch', title: 'Pitch', @@ -356,7 +335,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Azure Voice ID { id: 'voiceId', title: 'Voice ID', @@ -367,7 +345,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Azure Region { id: 'region', title: 'Region', @@ -378,7 +355,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Azure Output Format { id: 'outputFormat', title: 'Output Format', @@ -394,7 +370,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // Azure Style { id: 'style', title: 'Speaking Style', @@ -405,7 +380,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // PlayHT User ID { id: 'userId', title: 'User ID', @@ -417,7 +391,6 @@ export const TtsBlock: BlockConfig = { required: true, }, - // PlayHT Voice { id: 'voice', title: 'Voice', @@ -428,7 +401,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // PlayHT Quality { id: 'quality', title: 'Quality', @@ -444,7 +416,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // PlayHT Speed { id: 'speed', title: 'Speed', @@ -458,7 +429,6 @@ export const TtsBlock: BlockConfig = { required: false, }, - // API Key (common to all providers) { id: 'apiKey', title: 'API Key', @@ -481,7 +451,6 @@ export const TtsBlock: BlockConfig = { ], config: { tool: (params) => { - // Select tool based on provider switch (params.provider) { case 'openai': return 'tts_openai' diff --git a/apps/sim/blocks/blocks/wordpress.ts b/apps/sim/blocks/blocks/wordpress.ts index 934aab89ff9..cbc8efb4c32 100644 --- a/apps/sim/blocks/blocks/wordpress.ts +++ b/apps/sim/blocks/blocks/wordpress.ts @@ -139,57 +139,47 @@ export const WordPressBlock: BlockConfig = { }, }, subBlocks: [ - // Operation Selection { id: 'operation', title: 'Operation', type: 'dropdown', options: [ - // Posts { label: 'Create Post', id: 'wordpress_create_post' }, { label: 'Update Post', id: 'wordpress_update_post' }, { label: 'Delete Post', id: 'wordpress_delete_post' }, { label: 'Get Post', id: 'wordpress_get_post' }, { label: 'List Posts', id: 'wordpress_list_posts' }, - // Pages { label: 'Create Page', id: 'wordpress_create_page' }, { label: 'Update Page', id: 'wordpress_update_page' }, { label: 'Delete Page', id: 'wordpress_delete_page' }, { label: 'Get Page', id: 'wordpress_get_page' }, { label: 'List Pages', id: 'wordpress_list_pages' }, - // Media { label: 'Upload Media', id: 'wordpress_upload_media' }, { label: 'Get Media', id: 'wordpress_get_media' }, { label: 'List Media', id: 'wordpress_list_media' }, { label: 'Delete Media', id: 'wordpress_delete_media' }, - // Comments { label: 'Create Comment', id: 'wordpress_create_comment' }, { label: 'List Comments', id: 'wordpress_list_comments' }, { label: 'Update Comment', id: 'wordpress_update_comment' }, { label: 'Delete Comment', id: 'wordpress_delete_comment' }, - // Categories { label: 'Create Category', id: 'wordpress_create_category' }, { label: 'Update Category', id: 'wordpress_update_category' }, { label: 'Delete Category', id: 'wordpress_delete_category' }, { label: 'Get Category', id: 'wordpress_get_category' }, { label: 'List Categories', id: 'wordpress_list_categories' }, - // Tags { label: 'Create Tag', id: 'wordpress_create_tag' }, { label: 'Update Tag', id: 'wordpress_update_tag' }, { label: 'Delete Tag', id: 'wordpress_delete_tag' }, { label: 'Get Tag', id: 'wordpress_get_tag' }, { label: 'List Tags', id: 'wordpress_list_tags' }, - // Users { label: 'Get Current User', id: 'wordpress_get_current_user' }, { label: 'List Users', id: 'wordpress_list_users' }, { label: 'Get User', id: 'wordpress_get_user' }, - // Search { label: 'Search Content', id: 'wordpress_search_content' }, ], value: () => 'wordpress_create_post', }, - // Credential selector for OAuth { id: 'credential', title: 'WordPress Account', @@ -211,7 +201,6 @@ export const WordPressBlock: BlockConfig = { required: true, }, - // Site ID for WordPress.com (required for OAuth) { id: 'siteId', title: 'Site ID or Domain', @@ -221,7 +210,6 @@ export const WordPressBlock: BlockConfig = { required: true, }, - // Post Operations - Post ID { id: 'postId', title: 'Post ID', @@ -237,7 +225,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Post/Page Title { id: 'title', title: 'Title', @@ -258,7 +245,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Post/Page Content { id: 'content', title: 'Content', @@ -275,7 +261,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Post/Page Status { id: 'status', title: 'Status', @@ -298,7 +283,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Excerpt (for posts and pages) { id: 'excerpt', title: 'Excerpt', @@ -316,7 +300,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Slug (for posts and pages) { id: 'slug', title: 'Slug', @@ -334,7 +317,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Categories (for posts) { id: 'categories', title: 'Categories', @@ -347,7 +329,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Tags (for posts) { id: 'tags', title: 'Tags', @@ -360,7 +341,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // List Posts: Author filter { id: 'listAuthor', title: 'Author ID', @@ -370,7 +350,6 @@ export const WordPressBlock: BlockConfig = { condition: { field: 'operation', value: 'wordpress_list_posts' }, }, - // Featured Media ID { id: 'featuredMedia', title: 'Featured Image ID', @@ -388,7 +367,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Page-specific: Page ID { id: 'pageId', title: 'Page ID', @@ -404,7 +382,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Page-specific: Parent Page { id: 'parent', title: 'Parent Page ID', @@ -417,7 +394,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Page-specific: Menu Order { id: 'menuOrder', title: 'Menu Order', @@ -430,7 +406,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Media Operations - File upload (basic mode) { id: 'fileUpload', title: 'Upload File', @@ -442,7 +417,6 @@ export const WordPressBlock: BlockConfig = { multiple: false, required: false, }, - // Variable reference (advanced mode) - for referencing files from previous blocks { id: 'file', title: 'File Reference', @@ -523,7 +497,6 @@ export const WordPressBlock: BlockConfig = { condition: { field: 'operation', value: 'wordpress_list_media' }, }, - // Comment Operations { id: 'commentPostId', title: 'Post ID', @@ -607,7 +580,6 @@ export const WordPressBlock: BlockConfig = { condition: { field: 'operation', value: 'wordpress_update_comment' }, }, - // Category Operations { id: 'categoryId', title: 'Category ID', @@ -667,7 +639,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Tag Operations { id: 'tagId', title: 'Tag ID', @@ -716,7 +687,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // User Operations { id: 'userId', title: 'User ID', @@ -734,7 +704,6 @@ export const WordPressBlock: BlockConfig = { condition: { field: 'operation', value: 'wordpress_list_users' }, }, - // Search Operations { id: 'query', title: 'Search Query', @@ -757,7 +726,6 @@ export const WordPressBlock: BlockConfig = { condition: { field: 'operation', value: 'wordpress_search_content' }, }, - // List Operations - Common Parameters { id: 'perPage', title: 'Results Per Page', @@ -864,7 +832,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // List Posts - Status filter { id: 'listStatus', title: 'Status Filter', @@ -884,7 +851,6 @@ export const WordPressBlock: BlockConfig = { }, }, - // Delete Operations - Force delete { id: 'force', title: 'Force Delete', @@ -934,7 +900,6 @@ export const WordPressBlock: BlockConfig = { config: { tool: (params) => params.operation || 'wordpress_create_post', params: (params) => { - // OAuth authentication for WordPress.com const baseParams: Record = { credential: params.oauthCredential, siteId: params.siteId, @@ -1242,7 +1207,6 @@ export const WordPressBlock: BlockConfig = { operation: { type: 'string', description: 'Operation to perform' }, oauthCredential: { type: 'string', description: 'WordPress OAuth credential' }, siteId: { type: 'string', description: 'WordPress.com site ID or domain' }, - // Post inputs postId: { type: 'number', description: 'Post ID' }, title: { type: 'string', description: 'Post or page title' }, content: { type: 'string', description: 'Post or page content' }, @@ -1253,11 +1217,9 @@ export const WordPressBlock: BlockConfig = { tags: { type: 'string', description: 'Tag IDs (comma-separated)' }, listAuthor: { type: 'number', description: 'Filter posts by author ID' }, featuredMedia: { type: 'number', description: 'Featured media ID' }, - // Page inputs pageId: { type: 'number', description: 'Page ID' }, parent: { type: 'number', description: 'Parent page ID' }, menuOrder: { type: 'number', description: 'Menu order' }, - // Media inputs file: { type: 'json', description: 'File to upload (UserFile)' }, filename: { type: 'string', description: 'Optional filename override' }, mediaTitle: { type: 'string', description: 'Media title' }, @@ -1266,7 +1228,6 @@ export const WordPressBlock: BlockConfig = { mediaDescription: { type: 'string', description: 'Media description' }, mediaId: { type: 'number', description: 'Media ID' }, mediaType: { type: 'string', description: 'Media type filter' }, - // Comment inputs commentPostId: { type: 'number', description: 'Post ID for comment' }, commentContent: { type: 'string', description: 'Comment content' }, commentParent: { type: 'number', description: 'Parent comment ID for replies' }, @@ -1275,27 +1236,22 @@ export const WordPressBlock: BlockConfig = { commentAuthorUrl: { type: 'string', description: 'Comment author URL' }, commentId: { type: 'number', description: 'Comment ID' }, commentStatus: { type: 'string', description: 'Comment status' }, - // Category inputs categoryId: { type: 'number', description: 'Category ID' }, categoryName: { type: 'string', description: 'Category name' }, categoryDescription: { type: 'string', description: 'Category description' }, categoryParent: { type: 'number', description: 'Parent category ID' }, categorySlug: { type: 'string', description: 'Category slug' }, - // Tag inputs tagId: { type: 'number', description: 'Tag ID' }, tagName: { type: 'string', description: 'Tag name' }, tagDescription: { type: 'string', description: 'Tag description' }, tagSlug: { type: 'string', description: 'Tag slug' }, - // User inputs userId: { type: 'number', description: 'User ID' }, roles: { type: 'string', description: 'User roles filter' }, - // Search inputs query: { type: 'string', description: 'Search query' }, searchType: { type: 'string', description: 'Content subtype filter (post, page) — maps to the API subtype param', }, - // List inputs perPage: { type: 'number', description: 'Results per page' }, page: { type: 'number', description: 'Page number' }, search: { type: 'string', description: 'Search filter' }, @@ -1305,29 +1261,20 @@ export const WordPressBlock: BlockConfig = { force: { type: 'boolean', description: 'Force delete' }, }, outputs: { - // Post outputs post: { type: 'json', description: 'Post data' }, posts: { type: 'json', description: 'List of posts' }, - // Page outputs page: { type: 'json', description: 'Page data' }, pages: { type: 'json', description: 'List of pages' }, - // Media outputs media: { type: 'json', description: 'Media data' }, - // Comment outputs comment: { type: 'json', description: 'Comment data' }, comments: { type: 'json', description: 'List of comments' }, - // Category outputs category: { type: 'json', description: 'Category data' }, categories: { type: 'json', description: 'List of categories' }, - // Tag outputs tag: { type: 'json', description: 'Tag data' }, tags: { type: 'json', description: 'List of tags' }, - // User outputs user: { type: 'json', description: 'User data' }, users: { type: 'json', description: 'List of users' }, - // Search outputs results: { type: 'json', description: 'Search results' }, - // Common outputs deleted: { type: 'boolean', description: 'Deletion status' }, total: { type: 'number', description: 'Total count' }, totalPages: { type: 'number', description: 'Total pages' }, diff --git a/apps/sim/blocks/blocks/x.ts b/apps/sim/blocks/blocks/x.ts index 5f1a4ad633c..350fa94681a 100644 --- a/apps/sim/blocks/blocks/x.ts +++ b/apps/sim/blocks/blocks/x.ts @@ -127,46 +127,37 @@ export const XBlock: BlockConfig = { title: 'Operation', type: 'dropdown', options: [ - // Tweet Operations { label: 'Create Tweet', id: 'x_create_tweet' }, { label: 'Delete Tweet', id: 'x_delete_tweet' }, { label: 'Search Tweets', id: 'x_search_tweets' }, { label: 'Get Tweets by IDs', id: 'x_get_tweets_by_ids' }, { label: 'Get Quote Tweets', id: 'x_get_quote_tweets' }, { label: 'Hide Reply', id: 'x_hide_reply' }, - // User Tweet Operations { label: 'Get User Tweets', id: 'x_get_user_tweets' }, { label: 'Get User Mentions', id: 'x_get_user_mentions' }, { label: 'Get User Timeline', id: 'x_get_user_timeline' }, - // Engagement Operations { label: 'Like / Unlike', id: 'x_manage_like' }, { label: 'Retweet / Unretweet', id: 'x_manage_retweet' }, { label: 'Get Liked Tweets', id: 'x_get_liked_tweets' }, { label: 'Get Liking Users', id: 'x_get_liking_users' }, { label: 'Get Retweeted By', id: 'x_get_retweeted_by' }, - // Bookmark Operations { label: 'Get Bookmarks', id: 'x_get_bookmarks' }, { label: 'Create Bookmark', id: 'x_create_bookmark' }, { label: 'Delete Bookmark', id: 'x_delete_bookmark' }, - // User Operations { label: 'Get My Profile', id: 'x_get_me' }, { label: 'Search Users', id: 'x_search_users' }, { label: 'Get Followers', id: 'x_get_followers' }, { label: 'Get Following', id: 'x_get_following' }, - // User Relationship Operations { label: 'Follow / Unfollow', id: 'x_manage_follow' }, { label: 'Block / Unblock', id: 'x_manage_block' }, { label: 'Get Blocked Users', id: 'x_get_blocking' }, { label: 'Mute / Unmute', id: 'x_manage_mute' }, - // Trends Operations { label: 'Get Trends by Location', id: 'x_get_trends_by_woeid' }, { label: 'Get Personalized Trends', id: 'x_get_personalized_trends' }, - // Usage Operations { label: 'Get API Usage', id: 'x_get_usage' }, ], value: () => 'x_create_tweet', }, - // --- OAuth Credential --- { id: 'credential', title: 'X Account', @@ -185,7 +176,6 @@ export const XBlock: BlockConfig = { mode: 'advanced', placeholder: 'Enter credential ID', }, - // --- Create Tweet fields --- { id: 'text', title: 'Tweet Text', @@ -233,7 +223,6 @@ export const XBlock: BlockConfig = { condition: { field: 'operation', value: 'x_create_tweet' }, mode: 'advanced', }, - // --- Tweet ID field (shared by multiple operations) --- { id: 'tweetId', title: 'Tweet ID', @@ -268,7 +257,6 @@ export const XBlock: BlockConfig = { ], }, }, - // --- Hide Reply toggle --- { id: 'hidden', title: 'Hidden', @@ -280,7 +268,6 @@ export const XBlock: BlockConfig = { value: () => 'true', condition: { field: 'operation', value: 'x_hide_reply' }, }, - // --- Tweet IDs (batch lookup) --- { id: 'ids', title: 'Tweet IDs', @@ -289,7 +276,6 @@ export const XBlock: BlockConfig = { condition: { field: 'operation', value: 'x_get_tweets_by_ids' }, required: true, }, - // --- Search query fields --- { id: 'query', title: 'Search Query', @@ -310,7 +296,6 @@ export const XBlock: BlockConfig = { condition: { field: 'operation', value: 'x_search_tweets' }, mode: 'advanced', }, - // --- User ID field (shared by many operations) --- { id: 'userId', title: 'User ID', @@ -357,7 +342,6 @@ export const XBlock: BlockConfig = { ], }, }, - // --- Target User ID (for follow/block/mute) --- { id: 'targetUserId', title: 'Target User ID', @@ -372,7 +356,6 @@ export const XBlock: BlockConfig = { value: ['x_manage_follow', 'x_manage_block', 'x_manage_mute'], }, }, - // --- Action dropdowns for manage operations --- { id: 'action', title: 'Action', @@ -428,7 +411,6 @@ export const XBlock: BlockConfig = { value: () => 'mute', condition: { field: 'operation', value: 'x_manage_mute' }, }, - // --- Exclude filter (for user tweets/timeline) --- { id: 'exclude', title: 'Exclude', @@ -440,7 +422,6 @@ export const XBlock: BlockConfig = { }, mode: 'advanced', }, - // --- Time range fields (shared by tweet search and user tweet operations) --- { id: 'startTime', title: 'Start Time', @@ -501,7 +482,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, generationType: 'timestamp', }, }, - // --- Max Results (shared by many operations) --- { id: 'maxResults', title: 'Max Results', @@ -527,7 +507,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // --- Pagination Token (shared by many operations) --- { id: 'paginationToken', title: 'Pagination Token', @@ -551,7 +530,7 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // --- Next Token (for search operations that use nextToken instead of paginationToken) --- + // Next Token (for search operations that use nextToken instead of paginationToken) { id: 'nextToken', title: 'Pagination Token', @@ -563,7 +542,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, }, mode: 'advanced', }, - // --- Trends fields --- { id: 'woeid', title: 'WOEID', @@ -580,7 +558,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, condition: { field: 'operation', value: 'x_get_trends_by_woeid' }, mode: 'advanced', }, - // --- Usage fields --- { id: 'days', title: 'Days', @@ -657,7 +634,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, inputs: { operation: { type: 'string', description: 'Operation to perform' }, oauthCredential: { type: 'string', description: 'X account credential' }, - // Tweet fields text: { type: 'string', description: 'Tweet text content' }, replyToTweetId: { type: 'string', description: 'Tweet ID to reply to' }, quoteTweetId: { type: 'string', description: 'Tweet ID to quote' }, @@ -666,33 +642,26 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, tweetId: { type: 'string', description: 'Tweet identifier' }, ids: { type: 'string', description: 'Comma-separated tweet IDs' }, hidden: { type: 'string', description: 'Hide or unhide reply' }, - // User fields userId: { type: 'string', description: 'User identifier' }, targetUserId: { type: 'string', description: 'Target user identifier' }, - // Action fields action: { type: 'string', description: 'Action to perform (like/unlike, etc.)' }, retweetAction: { type: 'string', description: 'Retweet action' }, followAction: { type: 'string', description: 'Follow action' }, blockAction: { type: 'string', description: 'Block action' }, muteAction: { type: 'string', description: 'Mute action' }, - // Search/filter fields query: { type: 'string', description: 'Search query' }, sortOrder: { type: 'string', description: 'Sort order' }, exclude: { type: 'string', description: 'Exclusion filter' }, - // Time/pagination fields startTime: { type: 'string', description: 'Start time filter' }, endTime: { type: 'string', description: 'End time filter' }, maxResults: { type: 'number', description: 'Maximum results' }, paginationToken: { type: 'string', description: 'Pagination token' }, nextToken: { type: 'string', description: 'Next page token' }, - // Trends fields woeid: { type: 'string', description: 'Where On Earth ID' }, maxTrends: { type: 'number', description: 'Maximum trends to return' }, - // Usage fields days: { type: 'number', description: 'Days of usage data' }, }, outputs: { - // Create Tweet outputs id: { type: 'string', description: 'Created tweet ID', @@ -703,37 +672,31 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, description: 'Text of the created tweet', condition: { field: 'operation', value: 'x_create_tweet' }, }, - // Delete Tweet output deleted: { type: 'boolean', description: 'Whether the tweet was deleted', condition: { field: 'operation', value: 'x_delete_tweet' }, }, - // Bookmark outputs bookmarked: { type: 'boolean', description: 'Whether the tweet is bookmarked', condition: { field: 'operation', value: ['x_create_bookmark', 'x_delete_bookmark'] }, }, - // Hide Reply output hidden: { type: 'boolean', description: 'Whether the reply is hidden', condition: { field: 'operation', value: 'x_hide_reply' }, }, - // Like output liked: { type: 'boolean', description: 'Whether the tweet is liked', condition: { field: 'operation', value: 'x_manage_like' }, }, - // Retweet output retweeted: { type: 'boolean', description: 'Whether the tweet is retweeted', condition: { field: 'operation', value: 'x_manage_retweet' }, }, - // Follow output following: { type: 'boolean', description: 'Whether following the user', @@ -744,19 +707,16 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, description: 'Whether a follow request is pending', condition: { field: 'operation', value: 'x_manage_follow' }, }, - // Block output blocking: { type: 'boolean', description: 'Whether blocking the user', condition: { field: 'operation', value: 'x_manage_block' }, }, - // Mute output muting: { type: 'boolean', description: 'Whether muting the user', condition: { field: 'operation', value: 'x_manage_mute' }, }, - // Tweet list outputs (shared by many operations) tweets: { type: 'json', description: 'Array of tweets', @@ -774,7 +734,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, ], }, }, - // User list outputs users: { type: 'json', description: 'Array of users', @@ -790,13 +749,11 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, ], }, }, - // Single user output user: { type: 'json', description: 'User profile data', condition: { field: 'operation', value: 'x_get_me' }, }, - // Pagination metadata meta: { type: 'json', description: 'Pagination metadata (resultCount, nextToken)', @@ -819,7 +776,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, ], }, }, - // Trends outputs trends: { type: 'json', description: 'Array of trending topics', @@ -828,7 +784,6 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`, value: ['x_get_trends_by_woeid', 'x_get_personalized_trends'], }, }, - // Usage outputs capResetDay: { type: 'number', description: 'Day of month when usage cap resets', diff --git a/apps/sim/components/icons.tsx b/apps/sim/components/icons.tsx index ef5cc9b3895..ff3d66b7c84 100644 --- a/apps/sim/components/icons.tsx +++ b/apps/sim/components/icons.tsx @@ -9613,7 +9613,7 @@ export function EnrowIcon(props: SVGProps) { ) } -// ---- Competitor brand logos (sourced via Context.dev brand-intelligence API, 2026-07-02) ---- +// Competitor brand logos (sourced via Context.dev brand-intelligence API, 2026-07-02) export function N8nIcon(props: SVGProps) { return ( diff --git a/apps/sim/hooks/use-undo-redo.ts b/apps/sim/hooks/use-undo-redo.ts index 892b0482800..1fe1a03cb5f 100644 --- a/apps/sim/hooks/use-undo-redo.ts +++ b/apps/sim/hooks/use-undo-redo.ts @@ -891,7 +891,6 @@ export function useUndoRedo() { userId, }) - // Send parent update to server addToQueue({ id: opId, operation: { @@ -909,7 +908,6 @@ export function useUndoRedo() { userId, }) - // Update position and parent locally using batch method useWorkflowStore.getState().batchUpdateBlocksWithParent([ { id: blockId, @@ -957,7 +955,6 @@ export function useUndoRedo() { break } - // Collect all edge operations first const allEdgesToAdd: Edge[] = [] const allEdgeIdsToRemove: string[] = [] const existingEdgeIds = new Set(useWorkflowStore.getState().edges.map((edge) => edge.id)) @@ -980,7 +977,6 @@ export function useUndoRedo() { } } - // Apply edge operations in batch if (allEdgesToAdd.length > 0) { addToQueue({ id: generateId(), @@ -1009,7 +1005,6 @@ export function useUndoRedo() { }) } - // Update positions and parents locally in batch const blockUpdates = validUpdates.map((update) => ({ id: update.blockId, position: update.newPosition, @@ -1017,7 +1012,6 @@ export function useUndoRedo() { })) useWorkflowStore.getState().batchUpdateBlocksWithParent(blockUpdates) - // Send batch update to server addToQueue({ id: opId, operation: { @@ -1061,8 +1055,6 @@ export function useUndoRedo() { userId, }) - // Use setBlockEnabled to directly restore to previous state - // This restores all affected blocks including children of containers validBlockIds.forEach((blockId) => { useWorkflowStore.getState().setBlockEnabled(blockId, previousStates[blockId]) }) @@ -1089,8 +1081,7 @@ export function useUndoRedo() { userId, }) - // Use setBlockHandles to directly restore to previous state - // This is more robust than conditional toggle in collaborative scenarios + // Set directly rather than toggling: more robust in collaborative scenarios validBlockIds.forEach((blockId) => { useWorkflowStore.getState().setBlockHandles(blockId, previousStates[blockId]) }) @@ -1119,8 +1110,6 @@ export function useUndoRedo() { userId, }) - // Use setBlockLocked to directly restore to previous state - // This restores all affected blocks including children of containers validBlockIds.forEach((blockId) => { useWorkflowStore.getState().setBlockLocked(blockId, previousStates[blockId]) }) @@ -1145,11 +1134,8 @@ export function useUndoRedo() { const { useWorkflowStore } = await import('@/stores/workflows/workflow/store') const { useSubBlockStore } = await import('@/stores/workflows/subblock/store') - // Set flag to skip recording during this operation - window.__skipDiffRecording = true try { - // Restore baseline state and broadcast to everyone if (baselineSnapshot && activeWorkflowId) { logger.info('Restoring baseline state', { blockCount: Object.keys(baselineSnapshot.blocks || {}).length, @@ -1157,7 +1143,6 @@ export function useUndoRedo() { useWorkflowStore.getState().replaceWorkflowState(baselineSnapshot) - // Extract and set subblock values const subBlockValues: Record> = {} Object.entries(baselineSnapshot.blocks || {}).forEach( ([blockId, block]: [string, any]) => { @@ -1171,7 +1156,6 @@ export function useUndoRedo() { ) useSubBlockStore.getState().setWorkflowValues(activeWorkflowId, subBlockValues) - // Broadcast state change to other users logger.info('Broadcasting baseline state to other users') await enqueueReplaceWorkflowState({ workflowId: activeWorkflowId, @@ -1180,7 +1164,6 @@ export function useUndoRedo() { }) } - // Clear diff state (local UI only) logger.info('Clearing diff UI state') useWorkflowDiffStore.getState().clearDiff({ restoreBaseline: false }) } finally { @@ -1198,18 +1181,14 @@ export function useUndoRedo() { const { useWorkflowDiffStore } = await import('@/stores/workflow-diff/store') const diffStore = useWorkflowDiffStore.getState() - // Restore the workflow state with diff markers const { useWorkflowStore } = await import('@/stores/workflows/workflow/store') const { useSubBlockStore } = await import('@/stores/workflows/subblock/store') - // Set flag to skip recording during this operation - window.__skipDiffRecording = true try { // Apply the before-accept state (with markers for this user) useWorkflowStore.getState().replaceWorkflowState(beforeAccept) - // Extract and set subblock values const subBlockValues: Record> = {} Object.entries(beforeAccept.blocks || {}).forEach(([blockId, block]: [string, any]) => { subBlockValues[blockId] = {} @@ -1230,7 +1209,6 @@ export function useUndoRedo() { operationId: opId, }) - // Get baseline from the original apply-diff operation const { baselineSnapshot: originalBaseline } = acceptDiffOp.data // Restore diff state with baseline (local UI only) @@ -1260,7 +1238,6 @@ export function useUndoRedo() { // Apply the before-reject state (with markers for this user) useWorkflowStore.getState().replaceWorkflowState(beforeReject) - // Extract and set subblock values const subBlockValues: Record> = {} Object.entries(beforeReject.blocks || {}).forEach(([blockId, block]: [string, any]) => { subBlockValues[blockId] = {} @@ -1389,7 +1366,6 @@ export function useUndoRedo() { break } case UNDO_REDO_OPERATIONS.BATCH_REMOVE_EDGES: { - // Redo batch-remove-edges: remove all edges again const batchRemoveOp = entry.operation as BatchRemoveEdgesOperation const { edgeSnapshots } = batchRemoveOp.data @@ -1416,7 +1392,6 @@ export function useUndoRedo() { break } case UNDO_REDO_OPERATIONS.BATCH_ADD_EDGES: { - // Redo batch-add-edges: add all edges again const batchAddOp = entry.operation as BatchAddEdgesOperation const { edgeSnapshots } = batchAddOp.data @@ -1470,7 +1445,6 @@ export function useUndoRedo() { break } case UNDO_REDO_OPERATIONS.UPDATE_PARENT: { - // Redo parent update means applying the new parent and position const updateOp = entry.operation as UpdateParentOperation const { blockId, newParentId, newPosition, affectedEdges } = updateOp.data @@ -1500,7 +1474,6 @@ export function useUndoRedo() { } } - // Send position update to server addToQueue({ id: generateId(), operation: { @@ -1518,7 +1491,6 @@ export function useUndoRedo() { userId, }) - // Send parent update to server addToQueue({ id: opId, operation: { @@ -1536,7 +1508,6 @@ export function useUndoRedo() { userId, }) - // Update position and parent locally using batch method useWorkflowStore.getState().batchUpdateBlocksWithParent([ { id: blockId, @@ -1580,7 +1551,6 @@ export function useUndoRedo() { break } - // Collect all edge operations first const allEdgesToAdd: Edge[] = [] const allEdgeIdsToRemove: string[] = [] const existingEdgeIds = new Set(useWorkflowStore.getState().edges.map((edge) => edge.id)) @@ -1618,7 +1588,6 @@ export function useUndoRedo() { }) } - // Update positions and parents locally in batch const blockUpdates = validUpdates.map((update) => ({ id: update.blockId, position: update.newPosition, @@ -1641,7 +1610,6 @@ export function useUndoRedo() { useWorkflowStore.getState().batchAddEdges(allEdgesToAdd) } - // Send batch update to server addToQueue({ id: opId, operation: { @@ -1715,7 +1683,6 @@ export function useUndoRedo() { userId, }) - // Use setBlockHandles to directly set to toggled state // Redo sets to !previousStates (the state after the original toggle) validBlockIds.forEach((blockId) => { useWorkflowStore.getState().setBlockHandles(blockId, !previousStates[blockId]) @@ -1767,8 +1734,6 @@ export function useUndoRedo() { const { useWorkflowStore } = await import('@/stores/workflows/workflow/store') const { useSubBlockStore } = await import('@/stores/workflows/subblock/store') - // Set flag to skip recording during this operation - window.__skipDiffRecording = true try { // Manually apply the proposed state and set up diff store (similar to setProposedChanges but with original baseline) @@ -1777,7 +1742,6 @@ export function useUndoRedo() { // Apply proposed state WITH markers locally (for this user's diff UI) useWorkflowStore.getState().replaceWorkflowState(proposedState) - // Extract and set subblock values const subBlockValues: Record> = {} Object.entries(proposedState.blocks || {}).forEach( ([blockId, block]: [string, any]) => { @@ -1822,8 +1786,6 @@ export function useUndoRedo() { const { useWorkflowStore } = await import('@/stores/workflows/workflow/store') const { useSubBlockStore } = await import('@/stores/workflows/subblock/store') - // Set flag to skip recording during this operation - window.__skipDiffRecording = true try { // Clear diff state FIRST to prevent flash of colors (local UI only) @@ -1841,7 +1803,6 @@ export function useUndoRedo() { // Apply the after-accept state (without markers) and broadcast useWorkflowStore.getState().replaceWorkflowState(afterAccept) - // Extract and set subblock values const subBlockValues: Record> = {} Object.entries(afterAccept.blocks || {}).forEach(([blockId, block]: [string, any]) => { subBlockValues[blockId] = {} @@ -1853,7 +1814,6 @@ export function useUndoRedo() { }) useSubBlockStore.getState().setWorkflowValues(activeWorkflowId, subBlockValues) - // Broadcast state change to other users await enqueueReplaceWorkflowState({ workflowId: activeWorkflowId, state: afterAccept, @@ -1891,7 +1851,6 @@ export function useUndoRedo() { // Apply the after-reject state (baseline) and broadcast useWorkflowStore.getState().replaceWorkflowState(afterReject) - // Extract and set subblock values const subBlockValues: Record> = {} Object.entries(afterReject.blocks || {}).forEach(([blockId, block]: [string, any]) => { subBlockValues[blockId] = {} @@ -1903,7 +1862,6 @@ export function useUndoRedo() { }) useSubBlockStore.getState().setWorkflowValues(activeWorkflowId, subBlockValues) - // Broadcast state change to other users await enqueueReplaceWorkflowState({ workflowId: activeWorkflowId, state: afterReject, diff --git a/apps/sim/lib/api/contracts/tables.ts b/apps/sim/lib/api/contracts/tables.ts index cd6be879c5c..b79e5eff4c6 100644 --- a/apps/sim/lib/api/contracts/tables.ts +++ b/apps/sim/lib/api/contracts/tables.ts @@ -482,7 +482,7 @@ const nonEmptyFilterSchema = domainObjectSchema().refine( const filterSchema = domainObjectSchema() -/* --------------------------- v2 predicate grammar --------------------------- */ +// v2 predicate grammar /** * Body cap for the row-query routes. A query body is a predicate tree plus a diff --git a/apps/sim/lib/core/telemetry.ts b/apps/sim/lib/core/telemetry.ts index 161a862234f..e763fbdc7e8 100644 --- a/apps/sim/lib/core/telemetry.ts +++ b/apps/sim/lib/core/telemetry.ts @@ -26,38 +26,31 @@ import { TraceAttr } from '@/lib/mothership/generated/trace-attributes-v1' * GenAI Semantic Convention Attributes */ const GenAIAttributes = { - // System attributes SYSTEM: 'gen_ai.system', REQUEST_MODEL: 'gen_ai.request.model', RESPONSE_MODEL: 'gen_ai.response.model', - // Token usage USAGE_INPUT_TOKENS: 'gen_ai.usage.input_tokens', USAGE_OUTPUT_TOKENS: 'gen_ai.usage.output_tokens', USAGE_TOTAL_TOKENS: 'gen_ai.usage.total_tokens', - // Request/Response REQUEST_TEMPERATURE: 'gen_ai.request.temperature', REQUEST_TOP_P: 'gen_ai.request.top_p', REQUEST_MAX_TOKENS: 'gen_ai.request.max_tokens', RESPONSE_FINISH_REASON: 'gen_ai.response.finish_reason', - // Agent-specific AGENT_ID: 'gen_ai.agent.id', AGENT_NAME: 'gen_ai.agent.name', AGENT_TASK: 'gen_ai.agent.task', - // Workflow-specific WORKFLOW_ID: 'gen_ai.workflow.id', WORKFLOW_NAME: 'gen_ai.workflow.name', WORKFLOW_VERSION: 'gen_ai.workflow.version', WORKFLOW_EXECUTION_ID: 'gen_ai.workflow.execution_id', - // Tool-specific TOOL_NAME: 'gen_ai.tool.name', TOOL_DESCRIPTION: 'gen_ai.tool.description', - // Cost tracking COST_TOTAL: 'gen_ai.cost.total', COST_INPUT: 'gen_ai.cost.input', COST_OUTPUT: 'gen_ai.cost.output', @@ -65,7 +58,6 @@ const GenAIAttributes = { const logger = createLogger('OTelIntegration') -// Lazy-load tracer let _tracer: ReturnType | null = null function getTracer() { @@ -405,31 +397,12 @@ export function trackPlatformEvent( } } -// PLATFORM TELEMETRY EVENTS -// -// Naming Convention: -// Event: platform.{resource}.{past_tense_action} -// Attribute: {resource}.{attribute_name} -// -// Examples: -// Event: platform.user.signed_up -// Attribute: user.id, user.auth_method, workspace.id -// -// Categories: -// - User/Auth: platform.user.* -// - Workspace: platform.workspace.* -// - Workflow: platform.workflow.* -// - Knowledge Base: platform.knowledge_base.* -// - MCP: platform.mcp.* -// - API Keys: platform.api_key.* -// - OAuth: platform.oauth.* -// - Webhook: platform.webhook.* -// - Billing: platform.billing.* -// - Template: platform.template.* - /** - * Platform Events - Typed event tracking helpers - * These provide type-safe, consistent telemetry across the platform + * Typed platform event tracking helpers. + * + * Naming convention: events are `platform.{resource}.{past_tense_action}` + * (e.g. `platform.user.signed_up`); attributes are `{resource}.{attribute_name}` + * (e.g. `user.id`, `workspace.id`). */ export const PlatformEvents = { /** diff --git a/apps/sim/lib/oauth/utils.ts b/apps/sim/lib/oauth/utils.ts index 0fe9d6d10fc..7a1c22011a3 100644 --- a/apps/sim/lib/oauth/utils.ts +++ b/apps/sim/lib/oauth/utils.ts @@ -625,7 +625,6 @@ export function getProviderIdFromServiceId(serviceId: string): string { } } - // Default fallback return serviceId } @@ -887,7 +886,6 @@ for (const [baseProviderId, providerConfig] of Object.entries(OAUTH_PROVIDERS)) * Uses the pre-computed mapping from OAUTH_PROVIDERS for accuracy. */ export function parseProvider(provider: OAuthProvider): ProviderConfig { - // First, check if this is a known providerId from our config const mapping = PROVIDER_ID_TO_BASE_PROVIDER[provider] if (mapping) { return { @@ -906,7 +904,6 @@ export function parseProvider(provider: OAuthProvider): ProviderConfig { } } - // For simple providers, use 'default' as feature type return { baseProvider: provider, featureType: 'default', diff --git a/apps/sim/lib/pptx-renderer/model/layout.ts b/apps/sim/lib/pptx-renderer/model/layout.ts index 5e06aa4838b..69f1060d669 100644 --- a/apps/sim/lib/pptx-renderer/model/layout.ts +++ b/apps/sim/lib/pptx-renderer/model/layout.ts @@ -151,14 +151,14 @@ function extractPlaceholdersRecursive( export function parseLayout(root: SafeXmlNode): LayoutData { const cSld = root.child('cSld') - // --- Background --- + // Background const bg = cSld.child('bg') const background = bg.exists() ? bg : undefined - // --- Shape tree --- + // Shape tree const spTree = cSld.child('spTree') - // --- Color map override --- + // Color map override let colorMapOverride: Map | undefined const clrMapOvr = root.child('clrMapOvr') if (clrMapOvr.exists()) { @@ -168,10 +168,10 @@ export function parseLayout(root: SafeXmlNode): LayoutData { } } - // --- Placeholders (recursive so we find title/body inside grpSp; resolve position in slide space) --- + // Placeholders (recursive so we find title/body inside grpSp; resolve position in slide space) const placeholders = extractPlaceholdersRecursive(spTree, null) - // --- showMasterSp: if "0", master shapes should not be rendered for this layout --- + // showMasterSp: if "0", master shapes should not be rendered for this layout const showMasterSpAttr = root.attr('showMasterSp') const showMasterSp = showMasterSpAttr !== '0' diff --git a/apps/sim/lib/pptx-renderer/model/master.ts b/apps/sim/lib/pptx-renderer/model/master.ts index 70648c41e78..95ec7381043 100644 --- a/apps/sim/lib/pptx-renderer/model/master.ts +++ b/apps/sim/lib/pptx-renderer/model/master.ts @@ -41,27 +41,27 @@ function extractPlaceholders(spTree: SafeXmlNode): SafeXmlNode[] { export function parseMaster(root: SafeXmlNode): MasterData { const cSld = root.child('cSld') - // --- Background --- + // Background const bg = cSld.child('bg') const background = bg.exists() ? bg : undefined - // --- Shape tree --- + // Shape tree const spTree = cSld.child('spTree') - // --- Color map --- + // Color map const clrMap = root.child('clrMap') const colorMap = parseAllAttributes(clrMap) - // --- Text styles --- + // Text styles const txStyles = root.child('txStyles') const titleStyle = txStyles.child('titleStyle') const bodyStyle = txStyles.child('bodyStyle') const otherStyle = txStyles.child('otherStyle') - // --- Default text style --- + // Default text style const defaultTextStyle = root.child('defaultTextStyle') - // --- Placeholders --- + // Placeholders const placeholders = extractPlaceholders(spTree) return { diff --git a/apps/sim/lib/pptx-renderer/model/nodes/base-node.ts b/apps/sim/lib/pptx-renderer/model/nodes/base-node.ts index 2720ba8ad48..45277158347 100644 --- a/apps/sim/lib/pptx-renderer/model/nodes/base-node.ts +++ b/apps/sim/lib/pptx-renderer/model/nodes/base-node.ts @@ -121,7 +121,7 @@ export function parseBaseProps(spNode: SafeXmlNode): Omit a:hlinkClick) --- + // Shape-level hyperlink action (cNvPr > a:hlinkClick) let hlinkClick: HlinkAction | undefined const hlinkNode = cNvPr.child('hlinkClick') if (hlinkNode.exists()) { diff --git a/apps/sim/lib/pptx-renderer/model/nodes/group-node.ts b/apps/sim/lib/pptx-renderer/model/nodes/group-node.ts index b357df57e35..25c91f727b5 100644 --- a/apps/sim/lib/pptx-renderer/model/nodes/group-node.ts +++ b/apps/sim/lib/pptx-renderer/model/nodes/group-node.ts @@ -23,7 +23,7 @@ const GROUP_CHILD_TAGS = new Set(['sp', 'pic', 'grpSp', 'graphicFrame', 'cxnSp'] export function parseGroupNode(grpNode: SafeXmlNode): GroupNodeData { const base = parseBaseProps(grpNode) - // --- Child coordinate space from grpSpPr > a:xfrm --- + // Child coordinate space from grpSpPr > a:xfrm // OOXML: when chOff/chExt omitted, child box equals group box (chOff=0,0, chExt=ext). const grpSpPr = grpNode.child('grpSpPr') const xfrm = grpSpPr.child('xfrm') @@ -44,7 +44,7 @@ export function parseGroupNode(grpNode: SafeXmlNode): GroupNodeData { } })() - // --- Collect direct child shape nodes --- + // Collect direct child shape nodes const children: SafeXmlNode[] = [] for (const child of grpNode.allChildren()) { if (GROUP_CHILD_TAGS.has(child.localName)) { diff --git a/apps/sim/lib/pptx-renderer/model/nodes/pic-node.ts b/apps/sim/lib/pptx-renderer/model/nodes/pic-node.ts index f60102c9249..fdf6d34b5f2 100644 --- a/apps/sim/lib/pptx-renderer/model/nodes/pic-node.ts +++ b/apps/sim/lib/pptx-renderer/model/nodes/pic-node.ts @@ -35,7 +35,7 @@ const CROP_DIVISOR = 100000 export function parsePicNode(picNode: SafeXmlNode): PicNodeData { const base = parseBaseProps(picNode) - // --- Blip fill --- + // Blip fill const blipFill = picNode.child('blipFill') const blip = blipFill.child('blip') @@ -43,7 +43,7 @@ export function parsePicNode(picNode: SafeXmlNode): PicNodeData { const blipEmbed = blip.attr('embed') ?? blip.attr('r:embed') const blipLink = blip.attr('link') ?? blip.attr('r:link') - // --- Crop (srcRect) --- + // Crop (srcRect) const srcRect = blipFill.child('srcRect') let crop: CropRect | undefined if (srcRect.exists()) { @@ -61,7 +61,7 @@ export function parsePicNode(picNode: SafeXmlNode): PicNodeData { } } - // --- Shape properties (fill + line) --- + // Shape properties (fill + line) const spPr = picNode.child('spPr') const solidFill = spPr.child('solidFill') const gradFill = spPr.child('gradFill') @@ -70,7 +70,7 @@ export function parsePicNode(picNode: SafeXmlNode): PicNodeData { const ln = spPr.child('ln') const line = ln.exists() ? ln : undefined - // --- Video / Audio detection --- + // Video / Audio detection const nvPicPr = picNode.child('nvPicPr') const nvPr = nvPicPr.child('nvPr') diff --git a/apps/sim/lib/pptx-renderer/model/nodes/shape-node.ts b/apps/sim/lib/pptx-renderer/model/nodes/shape-node.ts index e2af3f2b145..a305841b75c 100644 --- a/apps/sim/lib/pptx-renderer/model/nodes/shape-node.ts +++ b/apps/sim/lib/pptx-renderer/model/nodes/shape-node.ts @@ -174,24 +174,24 @@ export function parseShapeNode(spNode: SafeXmlNode): ShapeNodeData { const base = parseBaseProps(spNode) const spPr = spNode.child('spPr') - // --- Preset geometry --- + // Preset geometry const prstGeom = spPr.child('prstGeom') const presetGeometry = prstGeom.attr('prst') const avLst = prstGeom.child('avLst') const adjustments = parseAdjustments(avLst) - // --- Custom geometry --- + // Custom geometry const custGeom = spPr.child('custGeom') const customGeometry = custGeom.exists() ? custGeom : undefined - // --- Fill --- + // Fill const fill = findFill(spPr) - // --- Line --- + // Line const ln = spPr.child('ln') const line = ln.exists() ? ln : undefined - // --- Line end markers (arrowheads) --- + // Line end markers (arrowheads) let headEnd: LineEndInfo | undefined let tailEnd: LineEndInfo | undefined if (ln.exists()) { @@ -211,11 +211,11 @@ export function parseShapeNode(spNode: SafeXmlNode): ShapeNodeData { } } - // --- Text body --- + // Text body const txBody = spNode.child('txBody') const textBody = parseTextBody(txBody) - // --- Text transform (diagram shapes: dsp:txXfrm gives text box position/size in same space as xfrm) + // Text transform (diagram shapes: dsp:txXfrm gives text box position/size in same space as xfrm) let textBoxBounds: TextBoxBounds | undefined const txXfrm = spNode.child('txXfrm') if (txXfrm.exists()) { diff --git a/apps/sim/lib/pptx-renderer/model/nodes/table-node.ts b/apps/sim/lib/pptx-renderer/model/nodes/table-node.ts index 9433e8a763d..9a982ee4ad4 100644 --- a/apps/sim/lib/pptx-renderer/model/nodes/table-node.ts +++ b/apps/sim/lib/pptx-renderer/model/nodes/table-node.ts @@ -107,20 +107,20 @@ export function parseTableNode(frameNode: SafeXmlNode): TableNodeData { const base = parseBaseProps(frameNode) const tbl = findTable(frameNode) - // --- Column widths --- + // Column widths const tblGrid = tbl.child('tblGrid') const columns: number[] = [] for (const gridCol of tblGrid.children('gridCol')) { columns.push(emuToPx(gridCol.numAttr('w') ?? 0)) } - // --- Rows --- + // Rows const rows: TableRow[] = [] for (const trNode of tbl.children('tr')) { rows.push(parseRow(trNode)) } - // --- Table properties --- + // Table properties const tblPr = tbl.child('tblPr') const tableStyleId = extractTableStyleId(tblPr) diff --git a/apps/sim/lib/pptx-renderer/model/presentation.ts b/apps/sim/lib/pptx-renderer/model/presentation.ts index 2c7dcd8e150..57047807f09 100644 --- a/apps/sim/lib/pptx-renderer/model/presentation.ts +++ b/apps/sim/lib/pptx-renderer/model/presentation.ts @@ -94,26 +94,26 @@ function findRelsByType(rels: Map, typeSubstring: string): [st * 3. Parses each component and assembles the final structure */ export function buildPresentation(files: PptxFiles): PresentationData { - // --- Parse presentation root --- + // Parse presentation root const presRoot = parseXml(files.presentation) const presRels = parseRels(files.presentationRels) - // --- Slide size --- + // Slide size const sldSz = presRoot.child('sldSz') const width = emuToPx(sldSz.numAttr('cx') ?? 9144000) // default 10 inches const height = emuToPx(sldSz.numAttr('cy') ?? 6858000) // default 7.5 inches - // --- WPS detection --- + // WPS detection const isWps = detectWps(files.presentation) - // --- Parse themes --- + // Parse themes const themes = new Map() for (const [themePath, themeXml] of files.themes) { const themeRoot = parseXml(themeXml) themes.set(themePath, parseTheme(themeRoot)) } - // --- Parse slide masters and build master→theme mapping --- + // Parse slide masters and build master→theme mapping const masters = new Map() const masterToTheme = new Map() @@ -136,7 +136,7 @@ export function buildPresentation(files: PptxFiles): PresentationData { masters.set(masterPath, masterData) } - // --- Parse slide layouts and build layout→master mapping --- + // Parse slide layouts and build layout→master mapping const layouts = new Map() const layoutToMaster = new Map() @@ -159,7 +159,7 @@ export function buildPresentation(files: PptxFiles): PresentationData { layouts.set(layoutPath, layoutData) } - // --- Parse charts --- + // Parse charts const charts = new Map() for (const [chartPath, chartXml] of files.charts) { const chartRoot = parseXml(chartXml) @@ -168,7 +168,7 @@ export function buildPresentation(files: PptxFiles): PresentationData { } } - // --- Determine slide ordering --- + // Determine slide ordering // The sldIdLst contains sldId elements with r:id attributes that reference // presentation.xml.rels. We need to handle the fact that the attr might be // stored as 'r:id' in the original XML but SafeXmlNode.attr() uses localName. @@ -209,7 +209,7 @@ export function buildPresentation(files: PptxFiles): PresentationData { } } - // --- Parse slides --- + // Parse slides const slides: SlideData[] = [] const slideToLayout = new Map() @@ -237,7 +237,7 @@ export function buildPresentation(files: PptxFiles): PresentationData { slides.push(slideData) } - // --- Table styles --- + // Table styles let tableStyles: SafeXmlNode | undefined if (files.tableStyles) { const tsRoot = parseXml(files.tableStyles) @@ -262,7 +262,7 @@ export function buildPresentation(files: PptxFiles): PresentationData { isWps, } - // --- Resolve placeholder position inheritance --- + // Resolve placeholder position inheritance resolvePlaceholderInheritance(result) return result diff --git a/apps/sim/lib/pptx-renderer/model/slide.ts b/apps/sim/lib/pptx-renderer/model/slide.ts index fe5dacecb44..54c4abe6883 100644 --- a/apps/sim/lib/pptx-renderer/model/slide.ts +++ b/apps/sim/lib/pptx-renderer/model/slide.ts @@ -295,11 +295,11 @@ export function parseSlide( ): SlideData { const cSld = root.child('cSld') - // --- Background --- + // Background const bg = cSld.child('bg') const background = bg.exists() ? bg : undefined - // --- Parse shape tree children --- + // Parse shape tree children const spTree = cSld.child('spTree') const nodes: SlideNode[] = [] @@ -310,10 +310,10 @@ export function parseSlide( } } - // --- Layout relationship --- + // Layout relationship const layoutIndex = findLayoutRel(rels) - // --- showMasterSp: if "0", layout/master shapes should not be rendered on this slide --- + // showMasterSp: if "0", layout/master shapes should not be rendered on this slide const showMasterSpAttr = root.attr('showMasterSp') const showMasterSp = showMasterSpAttr !== '0' diff --git a/apps/sim/lib/pptx-renderer/model/theme.ts b/apps/sim/lib/pptx-renderer/model/theme.ts index 2fde21c779d..3d131ae391b 100644 --- a/apps/sim/lib/pptx-renderer/model/theme.ts +++ b/apps/sim/lib/pptx-renderer/model/theme.ts @@ -63,7 +63,7 @@ function parseFontInfo(fontNode: SafeXmlNode): { latin: string; ea: string; cs: export function parseTheme(root: SafeXmlNode): ThemeData { const themeElements = root.child('themeElements') - // --- Color scheme --- + // Color scheme const clrScheme = themeElements.child('clrScheme') const colorScheme = new Map() @@ -77,12 +77,12 @@ export function parseTheme(root: SafeXmlNode): ThemeData { } } - // --- Font scheme --- + // Font scheme const fontScheme = themeElements.child('fontScheme') const majorFont = parseFontInfo(fontScheme.child('majorFont')) const minorFont = parseFontInfo(fontScheme.child('minorFont')) - // --- Format scheme --- + // Format scheme const fmtScheme = themeElements.child('fmtScheme') const fillStyleLst = fmtScheme.child('fillStyleLst') const fillStyles: SafeXmlNode[] = fillStyleLst.allChildren() diff --git a/apps/sim/lib/pptx-renderer/parser/zip-parser.ts b/apps/sim/lib/pptx-renderer/parser/zip-parser.ts index 50e5fca9d16..9a344ddd5e9 100644 --- a/apps/sim/lib/pptx-renderer/parser/zip-parser.ts +++ b/apps/sim/lib/pptx-renderer/parser/zip-parser.ts @@ -149,31 +149,31 @@ export async function parseZip( await mapWithConcurrency(entries, maxConcurrency, async ([path, file]) => { const normalizedPath = path.replace(/\\/g, '/') - // --- Content Types --- + // Content Types if (normalizedPath === '[Content_Types].xml') { result.contentTypes = await file.async('string') return } - // --- Presentation --- + // Presentation if (normalizedPath === 'ppt/presentation.xml') { result.presentation = await file.async('string') return } - // --- Presentation Rels --- + // Presentation Rels if (normalizedPath === 'ppt/_rels/presentation.xml.rels') { result.presentationRels = await file.async('string') return } - // --- Table Styles --- + // Table Styles if (normalizedPath === 'ppt/tableStyles.xml') { result.tableStyles = await file.async('string') return } - // --- Media (binary) --- + // Media (binary) if (normalizedPath.startsWith('ppt/media/')) { const bytes = await file.async('uint8array') if (!knownSizeByPath.has(normalizedPath)) { @@ -200,67 +200,67 @@ export async function parseZip( return } - // --- Slide Rels (must check before slides to avoid false match) --- + // Slide Rels (must check before slides to avoid false match) if (/^ppt\/slides\/_rels\/slide\d+\.xml\.rels$/.test(normalizedPath)) { result.slideRels.set(normalizedPath, await file.async('string')) return } - // --- Slides --- + // Slides if (/^ppt\/slides\/slide\d+\.xml$/.test(normalizedPath)) { result.slides.set(normalizedPath, await file.async('string')) return } - // --- Slide Layout Rels --- + // Slide Layout Rels if (/^ppt\/slideLayouts\/_rels\/slideLayout\d+\.xml\.rels$/.test(normalizedPath)) { result.slideLayoutRels.set(normalizedPath, await file.async('string')) return } - // --- Slide Layouts --- + // Slide Layouts if (/^ppt\/slideLayouts\/slideLayout\d+\.xml$/.test(normalizedPath)) { result.slideLayouts.set(normalizedPath, await file.async('string')) return } - // --- Slide Master Rels --- + // Slide Master Rels if (/^ppt\/slideMasters\/_rels\/slideMaster\d+\.xml\.rels$/.test(normalizedPath)) { result.slideMasterRels.set(normalizedPath, await file.async('string')) return } - // --- Slide Masters --- + // Slide Masters if (/^ppt\/slideMasters\/slideMaster\d+\.xml$/.test(normalizedPath)) { result.slideMasters.set(normalizedPath, await file.async('string')) return } - // --- Themes --- + // Themes if (/^ppt\/theme\/theme\d+\.xml$/.test(normalizedPath)) { result.themes.set(normalizedPath, await file.async('string')) return } - // --- Charts --- + // Charts if (/^ppt\/charts\/chart\d+\.xml$/.test(normalizedPath)) { result.charts.set(normalizedPath, await file.async('string')) return } - // --- Chart Styles --- + // Chart Styles if (/^ppt\/charts\/style\d+\.xml$/.test(normalizedPath)) { result.chartStyles.set(normalizedPath, await file.async('string')) return } - // --- Chart Colors --- + // Chart Colors if (/^ppt\/charts\/colors\d+\.xml$/.test(normalizedPath)) { result.chartColors.set(normalizedPath, await file.async('string')) return } - // --- Diagram Drawings (SmartArt fallback) --- + // Diagram Drawings (SmartArt fallback) if (/^ppt\/diagrams\/drawing\d+\.xml$/.test(normalizedPath)) { result.diagramDrawings.set(normalizedPath, await file.async('string')) return diff --git a/apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts b/apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts index c59a8fdaefa..2a21203dc9d 100644 --- a/apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts +++ b/apps/sim/lib/pptx-renderer/renderer/chart-renderer.ts @@ -14,8 +14,6 @@ import { cssFontStack } from '../utils/font-stack' import type { RenderContext } from './render-context' import { resolveColor } from './style-resolver' -// Types - interface SeriesData { name: string order: number // c:order val — used to sort series into correct sequence @@ -73,8 +71,6 @@ type OoxmlChartType = | 'stockChart' | 'surface3DChart' -// Chart Type Mapping - const CHART_TYPE_ELEMENTS: OoxmlChartType[] = [ 'barChart', 'bar3DChart', @@ -92,8 +88,6 @@ const CHART_TYPE_ELEMENTS: OoxmlChartType[] = [ 'surface3DChart', ] -// Data Extraction Helpers - /** * Extract text values from a strRef or strCache structure. * Path: strRef > strCache > pt (with idx attr) > v @@ -160,7 +154,6 @@ function formatValue(value: number, formatCode: string | undefined): string { // Percentage format: the raw value is a fraction (e.g., 0.213 means 21.3%) if (formatCode.includes('%')) { - // Determine decimal places from the format code const match = formatCode.match(/0\.(0+)%/) const decimals = match ? match[1].length : 0 const pctValue = value * 100 @@ -264,7 +257,6 @@ function extractSeriesName(txNode: SafeXmlNode): string { return pts[0].child('v').text() } } - // Try direct v element const v = txNode.child('v') if (v.exists()) return v.text() return '' @@ -326,7 +318,6 @@ function extractSeriesColor(ser: SafeXmlNode, ctx: RenderContext): string | obje const spPr = ser.child('spPr') if (!spPr.exists()) return undefined - // Primary: solid fill const solidFill = spPr.child('solidFill') if (solidFill.exists()) { const hex = resolveColorToHex(solidFill, ctx) @@ -372,7 +363,6 @@ function buildEChartsGradient(gradFill: SafeXmlNode, ctx: RenderContext): object for (const gs of gsLst.children('gs')) { const stop = resolveGradientStop(gs, ctx) if (stop) { - // Convert color + alpha to rgba string const hex = stop.color.replace('#', '') const r = Number.parseInt(hex.substring(0, 2), 16) const g = Number.parseInt(hex.substring(2, 4), 16) @@ -386,7 +376,6 @@ function buildEChartsGradient(gradFill: SafeXmlNode, ctx: RenderContext): object if (stops.length < 2) return undefined - // Sort stops by offset stops.sort((a, b) => a.offset - b.offset) // Determine gradient direction from a:lin angle. Default: top-to-bottom (ang=5400000 = 90°) @@ -484,7 +473,6 @@ function parseDataLabels(node: SafeXmlNode, ctx: RenderContext): DataLabelConfig const fontSize = txStyle?.fontSize const bold = txStyle?.bold - // If nothing is shown, return undefined if (!showVal && !showCatName && !showSerName && !showPercent) return undefined return { showVal, showCatName, showSerName, showPercent, position, color, fontSize, bold } @@ -540,7 +528,6 @@ function parseExplosion(ser: SafeXmlNode, pointCount: number): number[] | undefi const explosions: number[] = new Array(pointCount).fill(0) let hasAny = false - // Series-level explosion const serExplosion = ser.child('explosion').numAttr('val') ?? 0 if (serExplosion > 0) { explosions.fill(serExplosion) @@ -639,8 +626,6 @@ function parseSeries(chartTypeNode: SafeXmlNode, ctx: RenderContext): SeriesData return seriesArr } -// Chart Title - /** * Extract chart title from chartSpace > chart > title. * Returns undefined when autoTitleDeleted val="1" (title was intentionally removed). @@ -679,7 +664,6 @@ function extractChartTitle(chartNode: SafeXmlNode, seriesArr?: SeriesData[]): st if (parts.length > 0) return parts.join('') } - // Try strRef const strRef = tx.child('strRef') if (strRef.exists()) { const strCache = strRef.child('strCache') @@ -762,8 +746,6 @@ function getChartThemeFontFamily(ctx: RenderContext): string | undefined { return family ? cssFontStack(family) : undefined } -// Legend - /** Parsed legend info including overlay flag. */ interface LegendInfo { option: echarts.EChartsOption['legend'] @@ -1097,8 +1079,6 @@ function hasManualGrid( ) } -// Axis Parsing - const DEFAULT_AXIS_INFO: AxisInfo = { deleted: false, tickLblPos: 'nextTo', @@ -1237,7 +1217,6 @@ function applyAxisInfo( axisDef.axisLabel = { ...((axisDef.axisLabel as object) || {}), show: false } } - // Scaling min/max if (kind === 'value') { if (info.min !== undefined) axisDef.min = info.min if (info.max !== undefined) axisDef.max = info.max @@ -1285,8 +1264,6 @@ function applyAxisInfo( } } -// ECharts Option Builders - /** * Convert OOXML data label position to ECharts bar label position. */ @@ -1316,11 +1293,9 @@ function buildBarChartOption( const grouping = groupingNode.exists() ? groupingNode.attr('val') || 'clustered' : 'clustered' const isHorizontal = barDir === 'bar' - // Layout parameters const gapWidth = chartTypeNode.child('gapWidth').numAttr('val') const overlap = chartTypeNode.child('overlap').numAttr('val') - // Use categories from the first series that has them const categories = seriesArr.find((s) => s.categories.length > 0)?.categories || [] const title = extractChartTitle(chartNode, seriesArr) @@ -1640,7 +1615,6 @@ function buildPieChartOption( chartTypeNode.child('dLbls').exists() const dLblsExplicitlyOff = hasDLblsNode && !sharedLabels - // Parse explosion from the first c:ser element const explosions = firstSer ? parseExplosion(firstSer, firstSeries.categories.length) : undefined const pieData = firstSeries.categories.map((cat, i) => { @@ -1649,7 +1623,6 @@ function buildPieChartOption( name: cat || `Item ${i + 1}`, value: firstSeries.values[i] ?? 0, } - // Per-point color if (firstSeries.dataPointColors?.[i]) { item.itemStyle = { color: firstSeries.dataPointColors[i] } } @@ -1772,10 +1745,8 @@ function buildRadarChartOption( const legendOpt = legendInfo?.option const legendTextStyle = { fontSize: 10, ...(legendInfo?.textStyle ?? {}) } - // Categories come from the first series that has them const categories = seriesArr.find((s) => s.categories.length > 0)?.categories || [] - // Read valAx scaling for explicit min/max on radar const plotArea = chartNode.child('plotArea') const { valueAxis } = parseAxes(plotArea, ctx) @@ -1988,8 +1959,6 @@ function buildScatterChartOption( } } -// Bubble Chart - function buildBubbleChartOption( chartTypeNode: SafeXmlNode, chartNode: SafeXmlNode, @@ -2091,8 +2060,6 @@ function buildBubbleChartOption( } } -// Stock Chart (Candlestick) - function buildStockChartOption( _chartTypeNode: SafeXmlNode, chartNode: SafeXmlNode, @@ -2296,8 +2263,6 @@ function buildStockChartOption( } } -// Data Table (c:dTable) - /** Parsed c:dTable info for building the chart data table. */ interface DataTableInfo { seriesArr: SeriesData[] @@ -2388,8 +2353,6 @@ function buildDataTableElement(info: DataTableInfo, seriesColors?: string[]): HT return table } -// Main Chart XML Parser - /** * Extract background colors from chartSpace and plotArea. * Returns { chartBg, plotAreaBg } hex color strings or undefined. @@ -2538,8 +2501,6 @@ function buildChartPalette(chartXml: SafeXmlNode, ctx: RenderContext): string[] return accents } -// Chart-Space Default Font Size + Legend Grid Adjustment - /** * Apply chart-space default font size to all text elements in the ECharts option * that still use hardcoded small defaults. Only overrides when no explicit OOXML @@ -2557,7 +2518,6 @@ function applyDefaultFontSizes(option: echarts.EChartsOption, defaultFs: number) } } - // Radar indicator font size if (opt.radar) { const radar = Array.isArray(opt.radar) ? opt.radar[0] : opt.radar if (radar?.name?.textStyle) { @@ -2666,7 +2626,6 @@ function applyLegendGridMargins( } if (w > maxTextPx) maxTextPx = w } - // icon + gap + text + left/right padding const estimatedLegendPx = iconWidth + 8 + maxTextPx + 14 const gridMarginPx = Math.max(84, Math.round(estimatedLegendPx + 18)) @@ -2785,13 +2744,11 @@ function applyNiceAxisRange(option: echarts.EChartsOption): void { const axes = Array.isArray(axis) ? axis : [axis] for (const ax of axes) { if (!ax || ax.type !== 'value') continue - // Skip if explicit min/max already set if (ax.min !== undefined && ax.max !== undefined) continue const dataMin = Math.min(...allValues) const dataMax = Math.max(...allValues) - // Only set max when not already specified if (ax.max === undefined) { ax.max = niceAxisMax(dataMax, dataMin) } @@ -3175,7 +3132,6 @@ export function parseChartXml(chartXml: SafeXmlNode, ctx: RenderContext): ParseC return { option: { title: { text: 'Unsupported chart', left: 'center' } } } } - // Extract background colors const { chartBg, plotAreaBg } = extractBackgroundColors(chartXml, chart, chartCtx) const chartTypeEntries = CHART_TYPE_ELEMENTS.map((typeName) => { @@ -3226,13 +3182,11 @@ export function parseChartXml(chartXml: SafeXmlNode, ctx: RenderContext): ParseC applyDefaultFontFamily(option, defaultFontFamily) } - // Adjust grid margins for legend placement (non-overlay) applyLegendGridMargins(option, chart, defaultFs) // Apply PowerPoint-like nice axis range (adds headroom beyond data max) applyNiceAxisRange(option) - // Apply background colors if (chartBg) { option.backgroundColor = chartBg } @@ -3255,7 +3209,6 @@ export function parseChartXml(chartXml: SafeXmlNode, ctx: RenderContext): ParseC .sort((a, b) => a.order - b.order) : entry.seriesArr - // Build data table info when c:dTable exists const dTableMeta = parseDataTable(plotArea) const dataTable: DataTableInfo | undefined = dTableMeta ? { @@ -3275,8 +3228,6 @@ export function parseChartXml(chartXml: SafeXmlNode, ctx: RenderContext): ParseC } } -// Public Render Function - /** * Render a chart node into an HTML element with an ECharts instance. */ @@ -3312,7 +3263,6 @@ export function renderChart(node: ChartNodeData, ctx: RenderContext): HTMLElemen chartDiv.style.overflow = 'hidden' wrapper.appendChild(chartDiv) - // Parse chart data and create ECharts option const { option, dataTable } = parseChartXml(chartXml, ctx) const customLegend = buildCustomLegendOverlay(option, node.size) const legendOption = getLegendOptionObject(option.legend) @@ -3321,7 +3271,6 @@ export function renderChart(node: ChartNodeData, ctx: RenderContext): HTMLElemen wrapper.appendChild(customLegend) } - // Append data table below chart when c:dTable exists if (dataTable) { const seriesColors = dataTable.seriesArr.map((s) => s.colorHex).filter(Boolean) as string[] const tableEl = buildDataTableElement( @@ -3365,7 +3314,6 @@ function initChart( chart.setOption(option) chartInstances?.add(chart) - // Handle container resize const ro = new ResizeObserver(() => { if (container.isConnected) { chart.resize() diff --git a/apps/sim/lib/pptx-renderer/renderer/image-renderer.ts b/apps/sim/lib/pptx-renderer/renderer/image-renderer.ts index b77ea8d4aae..a48a405e1fe 100644 --- a/apps/sim/lib/pptx-renderer/renderer/image-renderer.ts +++ b/apps/sim/lib/pptx-renderer/renderer/image-renderer.ts @@ -26,8 +26,6 @@ function isEmfFormat(path: string): boolean { return ext === 'emf' } -// Image Rendering - /** * Render a picture node into an absolutely-positioned HTML element. * @@ -48,7 +46,6 @@ export function renderImage(node: PicNodeData, ctx: RenderContext): HTMLElement wrapper.style.height = `${node.size.h}px` wrapper.style.overflow = 'hidden' - // Apply transforms const transforms: string[] = [] if (node.rotation !== 0) { transforms.push(`rotate(${node.rotation}deg)`) @@ -63,19 +60,16 @@ export function renderImage(node: PicNodeData, ctx: RenderContext): HTMLElement wrapper.style.transform = transforms.join(' ') } - // ---- Handle video ---- if (node.isVideo) { renderVideo(node, ctx, wrapper) return wrapper } - // ---- Handle audio ---- if (node.isAudio) { renderAudio(node, ctx, wrapper) return wrapper } - // ---- Resolve image data ---- const embedId = node.blipEmbed if (!embedId) { renderPlaceholder(wrapper, 'No image data') @@ -102,17 +96,14 @@ export function renderImage(node: PicNodeData, ctx: RenderContext): HTMLElement return wrapper } - // Handle EMF images — extract embedded PDF/bitmap content if (isEmfFormat(mediaPath)) { const emfData = data instanceof Uint8Array ? data : new Uint8Array(data) renderEmf(emfData, node, ctx, wrapper, mediaPath) return wrapper } - // Create blob URL (with caching) const url = getOrCreateBlobUrl(mediaPath, data, ctx.mediaUrlCache) - // Create image element const img = document.createElement('img') img.src = url img.style.width = '100%' @@ -121,7 +112,6 @@ export function renderImage(node: PicNodeData, ctx: RenderContext): HTMLElement img.style.display = 'block' img.draggable = false - // Apply crop if present. // OOXML srcRect defines what portion of the source image is cropped away. // The REMAINING visible region must stretch to fill the entire shape bounding box. // We achieve this by scaling the larger than the wrapper and offsetting it, @@ -148,7 +138,6 @@ export function renderImage(node: PicNodeData, ctx: RenderContext): HTMLElement } } - // --- Blip effects --- const blip = node.source.child('blipFill').child('blip') const blipOpacity = resolveBlipOpacity(blip) if (blipOpacity < 1) { @@ -161,13 +150,11 @@ export function renderImage(node: PicNodeData, ctx: RenderContext): HTMLElement applyDuotoneFilter(duotone, ctx, img, wrapper) } - // Luminance: brightness/contrast adjustment const lum = blip.child('lum') if (lum.exists()) { applyLumEffect(lum, img) } - // BiLevel: threshold to black/white const biLevel = blip.child('biLevel') if (biLevel.exists()) { applyBiLevelEffect(biLevel, img) @@ -210,10 +197,8 @@ function resolveBlipOpacity(blip: SafeXmlNode): number { * Render a video element inside the wrapper. */ function renderVideo(node: PicNodeData, ctx: RenderContext, wrapper: HTMLElement): void { - // Try to get video URL from mediaRId const videoUrl = resolveMediaUrl(node.mediaRId, ctx) - // Also try to show poster image from blipEmbed let posterUrl: string | undefined if (node.blipEmbed) { const rel = ctx.slide.rels.get(node.blipEmbed) @@ -270,7 +255,6 @@ function renderAudio(node: PicNodeData, ctx: RenderContext, wrapper: HTMLElement const audioUrl = resolveMediaUrl(node.mediaRId, ctx) if (audioUrl) { - // Show poster image if available if (node.blipEmbed) { const rel = ctx.slide.rels.get(node.blipEmbed) if (rel) { @@ -310,12 +294,10 @@ function resolveMediaUrl(rId: string | undefined, ctx: RenderContext): string | const rel = ctx.slide.rels.get(rId) if (!rel) return undefined - // Check if target is an external URL if (rel.target.startsWith('http://') || rel.target.startsWith('https://')) { return rel.target } - // Resolve from embedded media const mediaPath = resolveMediaPath(rel.target) const data = ctx.presentation.media.get(mediaPath) if (!data) return undefined @@ -371,8 +353,6 @@ function renderUnsupportedPlaceholder(wrapper: HTMLElement, path: string): void wrapper.appendChild(placeholder) } -// EMF Rendering - /** * Render EMF content by extracting embedded PDF or bitmap data. */ @@ -476,8 +456,6 @@ function createFillImage(url: string): HTMLImageElement { return img } -// Duotone Effect - import type { SafeXmlNode } from '../parser/xml-parser' /** @@ -542,8 +520,6 @@ function applyDuotoneFilter( } } -// Luminance Effect - /** * Apply a luminance (brightness/contrast) effect to an image. * @@ -574,7 +550,6 @@ function applyLumEffect(lum: SafeXmlNode, img: HTMLImageElement): void { for (let i = 0; i < data.length; i += 4) { for (let ch = 0; ch < 3; ch++) { - // Normalize to 0–1 let v = data[i + ch] / 255 // Apply contrast (expand/compress around 0.5) if (contrast !== 0) { @@ -598,8 +573,6 @@ function applyLumEffect(lum: SafeXmlNode, img: HTMLImageElement): void { } } -// BiLevel Effect - /** * Apply a bi-level (threshold) effect to an image. * diff --git a/apps/sim/lib/pptx-renderer/renderer/predefined-table-styles.ts b/apps/sim/lib/pptx-renderer/renderer/predefined-table-styles.ts index a338323b9ca..f04eb3dcf21 100644 --- a/apps/sim/lib/pptx-renderer/renderer/predefined-table-styles.ts +++ b/apps/sim/lib/pptx-renderer/renderer/predefined-table-styles.ts @@ -12,10 +12,8 @@ import { parseXml, type SafeXmlNode } from '../parser/xml-parser' -// UUID → (styleName, accent) map — 74 entries across 11 style groups - +/** Style UUID → `[styleName, accent]` for all 74 predefined styles across 11 groups. */ const styleIdMap = new Map([ - // Themed-Style-1 ['{2D5ABB26-0587-4C30-8999-92F81FD0307C}', ['Themed-Style-1', '']], ['{3C2FFA5D-87B4-456A-9821-1D502468CF0F}', ['Themed-Style-1', 'accent1']], ['{284E427A-3D55-4303-BF80-6455036E1DE7}', ['Themed-Style-1', 'accent2']], @@ -24,7 +22,6 @@ const styleIdMap = new Map([ ['{35758FB7-9AC5-4552-8A53-C91805E547FA}', ['Themed-Style-1', 'accent5']], ['{08FB837D-C827-4EFA-A057-4D05807E0F7C}', ['Themed-Style-1', 'accent6']], - // Themed-Style-2 ['{5940675A-B579-460E-94D1-54222C63F5DA}', ['Themed-Style-2', '']], ['{D113A9D2-9D6B-4929-AA2D-F23B5EE8CBE7}', ['Themed-Style-2', 'accent1']], ['{18603FDC-E32A-4AB5-989C-0864C3EAD2B8}', ['Themed-Style-2', 'accent2']], @@ -33,7 +30,6 @@ const styleIdMap = new Map([ ['{327F97BB-C833-4FB7-BDE5-3F7075034690}', ['Themed-Style-2', 'accent5']], ['{638B1855-1B75-4FBE-930C-398BA8C253C6}', ['Themed-Style-2', 'accent6']], - // Light-Style-1 ['{9D7B26C5-4107-4FEC-AEDC-1716B250A1EF}', ['Light-Style-1', '']], ['{3B4B98B0-60AC-42C2-AFA5-B58CD77FA1E5}', ['Light-Style-1', 'accent1']], ['{0E3FDE45-AF77-4B5C-9715-49D594BDF05E}', ['Light-Style-1', 'accent2']], @@ -42,7 +38,6 @@ const styleIdMap = new Map([ ['{5FD0F851-EC5A-4D38-B0AD-8093EC10F338}', ['Light-Style-1', 'accent5']], ['{68D230F3-CF80-4859-8CE7-A43EE81993B5}', ['Light-Style-1', 'accent6']], - // Light-Style-2 ['{7E9639D4-E3E2-4D34-9284-5A2195B3D0D7}', ['Light-Style-2', '']], ['{69012ECD-51FC-41F1-AA8D-1B2483CD663E}', ['Light-Style-2', 'accent1']], ['{72833802-FEF1-4C79-8D5D-14CF1EAF98D9}', ['Light-Style-2', 'accent2']], @@ -51,7 +46,6 @@ const styleIdMap = new Map([ ['{5A111915-BE36-4E01-A7E5-04B1672EAD32}', ['Light-Style-2', 'accent5']], ['{912C8C85-51F0-491E-9774-3900AFEF0FD7}', ['Light-Style-2', 'accent6']], - // Light-Style-3 ['{616DA210-FB5B-4158-B5E0-FEB733F419BA}', ['Light-Style-3', '']], ['{BC89EF96-8CEA-46FF-86C4-4CE0E7609802}', ['Light-Style-3', 'accent1']], ['{5DA37D80-6434-44D0-A028-1B22A696006F}', ['Light-Style-3', 'accent2']], @@ -60,7 +54,6 @@ const styleIdMap = new Map([ ['{BDBED569-4797-4DF1-A0F4-6AAB3CD982D8}', ['Light-Style-3', 'accent5']], ['{E8B1032C-EA38-4F05-BA0D-38AFFFC7BED3}', ['Light-Style-3', 'accent6']], - // Medium-Style-1 ['{793D81CF-94F2-401A-BA57-92F5A7B2D0C5}', ['Medium-Style-1', '']], ['{B301B821-A1FF-4177-AEE7-76D212191A09}', ['Medium-Style-1', 'accent1']], ['{9DCAF9ED-07DC-4A11-8D7F-57B35C25682E}', ['Medium-Style-1', 'accent2']], @@ -69,7 +62,6 @@ const styleIdMap = new Map([ ['{FABFCF23-3B69-468F-B69F-88F6DE6A72F2}', ['Medium-Style-1', 'accent5']], ['{10A1B5D5-9B99-4C35-A422-299274C87663}', ['Medium-Style-1', 'accent6']], - // Medium-Style-2 ['{073A0DAA-6AF3-43AB-8588-CEC1D06C72B9}', ['Medium-Style-2', '']], ['{5C22544A-7EE6-4342-B048-85BDC9FD1C3A}', ['Medium-Style-2', 'accent1']], ['{21E4AEA4-8DFA-4A89-87EB-49C32662AFE0}', ['Medium-Style-2', 'accent2']], @@ -78,7 +70,6 @@ const styleIdMap = new Map([ ['{7DF18680-E054-41AD-8BC1-D1AEF772440D}', ['Medium-Style-2', 'accent5']], ['{93296810-A885-4BE3-A3E7-6D5BEEA58F35}', ['Medium-Style-2', 'accent6']], - // Medium-Style-3 ['{8EC20E35-A176-4012-BC5E-935CFFF8708E}', ['Medium-Style-3', '']], ['{6E25E649-3F16-4E02-A733-19D2CDBF48F0}', ['Medium-Style-3', 'accent1']], ['{85BE263C-DBD7-4A20-BB59-AAB30ACAA65A}', ['Medium-Style-3', 'accent2']], @@ -87,7 +78,6 @@ const styleIdMap = new Map([ ['{74C1A8A3-306A-4EB7-A6B1-4F7E0EB9C5D6}', ['Medium-Style-3', 'accent5']], ['{2A488322-F2BA-4B5B-9748-0D474271808F}', ['Medium-Style-3', 'accent6']], - // Medium-Style-4 ['{D7AC3CCA-C797-4891-BE02-D94E43425B78}', ['Medium-Style-4', '']], ['{69CF1AB2-1976-4502-BF36-3FF5EA218861}', ['Medium-Style-4', 'accent1']], ['{8A107856-5554-42FB-B03E-39F5DBC370BA}', ['Medium-Style-4', 'accent2']], @@ -96,7 +86,6 @@ const styleIdMap = new Map([ ['{22838BEF-8BB2-4498-84A7-C5851F593DF1}', ['Medium-Style-4', 'accent5']], ['{16D9F66E-5EB9-4882-86FB-DCBF35E3C3E4}', ['Medium-Style-4', 'accent6']], - // Dark-Style-1 ['{E8034E78-7F5D-4C2E-B375-FC64B27BC917}', ['Dark-Style-1', '']], ['{125E5076-3810-47DD-B79F-674D7AD40C01}', ['Dark-Style-1', 'accent1']], ['{37CE84F3-28C3-443E-9E96-99CF82512B78}', ['Dark-Style-1', 'accent2']], @@ -105,15 +94,12 @@ const styleIdMap = new Map([ ['{8FD4443E-F989-4FC4-A0C8-D5A2AF1F390B}', ['Dark-Style-1', 'accent5']], ['{AF606853-7671-496A-8E4F-DF71F8EC918B}', ['Dark-Style-1', 'accent6']], - // Dark-Style-2 (only 4 variants) ['{5202B0CA-FC54-4496-8BCA-5EF66A818D29}', ['Dark-Style-2', '']], ['{0660B408-B3CF-4A94-85FC-2B1E0A45F4A2}', ['Dark-Style-2', 'accent1']], ['{91EBBBCC-DAD2-459C-BE2E-F6DE35CF9A28}', ['Dark-Style-2', 'accent3']], ['{46F890A9-2807-4EBB-B81D-B2AA78EC7F39}', ['Dark-Style-2', 'accent5']], ]) -// XML helpers — reduce boilerplate in style generators - const NS = 'xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main"' /** Solid fill with a scheme color and optional transform */ @@ -162,8 +148,6 @@ function stylePart( return parts.join('') } -// Style group XML generators - function themedStyle1(accent: string, styleId: string): string { const hasAccent = accent !== '' const accentVal = hasAccent ? accent : 'tx1' @@ -241,7 +225,6 @@ function themedStyle2(accent: string, styleId: string): string { if (hasAccent) { const accentVal = accent - // tblBg: accent fill const tblBg = `` // wholeTbl: text=lt1, outer borders=accent+tint(50000) @@ -262,11 +245,8 @@ function themedStyle2(accent: string, styleId: string): string { parts.push( stylePart('firstRow', { textColor: 'lt1', bold: true, borders: { bottom: borderLn('lt1') } }) ) - // lastRow: bold, top border=lt1 parts.push(stylePart('lastRow', { bold: true, borders: { top: borderLn('lt1') } })) - // firstCol: bold, right border=lt1 parts.push(stylePart('firstCol', { bold: true, borders: { right: borderLn('lt1') } })) - // lastCol: bold, left border=lt1 parts.push(stylePart('lastCol', { bold: true, borders: { left: borderLn('lt1') } })) return wrapTblStyle(styleId, 'Themed-Style-2', tblBg + parts.join('')) @@ -318,12 +298,9 @@ function lightStyle1(accent: string, styleId: string): string { }) ) - // lastRow: bold, top border parts.push(stylePart('lastRow', { bold: true, borders: { top: borderLn(accentVal) } })) - // firstCol: bold text parts.push(stylePart('firstCol', { textColor: 'tx1', bold: true })) - // lastCol: bold text parts.push(stylePart('lastCol', { textColor: 'tx1', bold: true })) return wrapTblStyle(styleId, 'Light-Style-1', parts.join('')) @@ -368,15 +345,11 @@ function lightStyle2(accent: string, styleId: string): string { }) ) - // firstRow: text=bg1, bold, fill=accent parts.push(stylePart('firstRow', { textColor: 'bg1', bold: true, fill: fillSolid(accentVal) })) - // lastRow: bold, top border parts.push(stylePart('lastRow', { bold: true, borders: { top: borderLn(accentVal) } })) - // firstCol: bold parts.push(stylePart('firstCol', { bold: true })) - // lastCol: bold parts.push(stylePart('lastCol', { bold: true })) return wrapTblStyle(styleId, 'Light-Style-2', parts.join('')) @@ -415,12 +388,9 @@ function lightStyle3(accent: string, styleId: string): string { }) ) - // lastRow: bold, top border parts.push(stylePart('lastRow', { bold: true, borders: { top: borderLn(accentVal) } })) - // firstCol: bold parts.push(stylePart('firstCol', { bold: true })) - // lastCol: bold parts.push(stylePart('lastCol', { bold: true })) return wrapTblStyle(styleId, 'Light-Style-3', parts.join('')) @@ -450,7 +420,6 @@ function mediumStyle1(accent: string, styleId: string): string { parts.push(stylePart('band1H', { fill: bandFill })) parts.push(stylePart('band1V', { fill: bandFill })) - // firstRow: text=lt1, bold, fill=accent parts.push(stylePart('firstRow', { textColor: 'lt1', bold: true, fill: fillSolid(accentVal) })) // lastRow: bold, fill=lt1, top border @@ -462,9 +431,7 @@ function mediumStyle1(accent: string, styleId: string): string { }) ) - // firstCol: bold parts.push(stylePart('firstCol', { bold: true })) - // lastCol: bold parts.push(stylePart('lastCol', { bold: true })) return wrapTblStyle(styleId, 'Medium-Style-1', parts.join('')) @@ -515,10 +482,8 @@ function mediumStyle2(accent: string, styleId: string): string { }) ) - // firstCol: text=lt1, bold, fill=accent parts.push(stylePart('firstCol', { textColor: 'lt1', bold: true, fill: fillSolid(accentVal) })) - // lastCol: text=lt1, bold, fill=accent parts.push(stylePart('lastCol', { textColor: 'lt1', bold: true, fill: fillSolid(accentVal) })) return wrapTblStyle(styleId, 'Medium-Style-2', parts.join('')) @@ -564,10 +529,8 @@ function mediumStyle3(accent: string, styleId: string): string { }) ) - // firstCol: text=lt1, bold, fill=accent parts.push(stylePart('firstCol', { textColor: 'lt1', bold: true, fill: fillSolid(accentVal) })) - // lastCol: text=lt1, bold, fill=accent parts.push(stylePart('lastCol', { textColor: 'lt1', bold: true, fill: fillSolid(accentVal) })) return wrapTblStyle(styleId, 'Medium-Style-3', parts.join('')) @@ -616,9 +579,7 @@ function mediumStyle4(accent: string, styleId: string): string { }) ) - // firstCol: bold parts.push(stylePart('firstCol', { bold: true })) - // lastCol: bold parts.push(stylePart('lastCol', { bold: true })) return wrapTblStyle(styleId, 'Medium-Style-4', parts.join('')) @@ -726,22 +687,16 @@ function darkStyle2(accent: string, styleId: string): string { }) ) - // firstCol: bold parts.push(stylePart('firstCol', { bold: true })) - // lastCol: bold parts.push(stylePart('lastCol', { bold: true })) return wrapTblStyle(styleId, 'Dark-Style-2', parts.join('')) } -// XML wrapper - function wrapTblStyle(styleId: string, styleName: string, innerXml: string): string { return `${innerXml}` } -// Style generator dispatch - const styleGenerators: Record string> = { 'Themed-Style-1': themedStyle1, 'Themed-Style-2': themedStyle2, @@ -756,8 +711,6 @@ const styleGenerators: Record strin 'Dark-Style-2': darkStyle2, } -// Module-level cache & public API - const cache = new Map() /** diff --git a/apps/sim/lib/pptx-renderer/renderer/shape-renderer.ts b/apps/sim/lib/pptx-renderer/renderer/shape-renderer.ts index 4219971011f..9bc86dbc35e 100644 --- a/apps/sim/lib/pptx-renderer/renderer/shape-renderer.ts +++ b/apps/sim/lib/pptx-renderer/renderer/shape-renderer.ts @@ -38,8 +38,6 @@ import { } from './style-resolver' import { renderTextBody } from './text-renderer' -// Shape blipFill (image fill) — resolve to blob URL for reuse (e.g. SVG/PNG in process diagrams) - /** Resolve shape blipFill to a blob URL so we can render it (e.g. slide 23 process graphic). */ function resolveShapeBlipUrl(blipFill: SafeXmlNode, ctx: RenderContext): string | null { const blip = blipFill.child('blip') @@ -53,8 +51,6 @@ function resolveShapeBlipUrl(blipFill: SafeXmlNode, ctx: RenderContext): string return getOrCreateBlobUrl(mediaPath, data, ctx.mediaUrlCache) } -// Line End Marker (Arrowhead) Helpers - let markerIdCounter = 0 let gradientIdCounter = 0 @@ -123,9 +119,7 @@ function angleToSvgGradientCoords(angleDeg: number): { y2: string } { // OOXML: 0° = left-to-right, 90° = top-to-bottom (clockwise) - // Convert to radians for trig const rad = (angleDeg * Math.PI) / 180 - // Calculate direction vector const x2 = Math.round(50 + 50 * Math.cos(rad)) const y2 = Math.round(50 + 50 * Math.sin(rad)) const x1 = Math.round(50 - 50 * Math.cos(rad)) @@ -274,8 +268,6 @@ function getLineEndsFromLn(ln: SafeXmlNode): { headEnd?: LineEndInfo; tailEnd?: return out } -// Shape Rendering - /** * Render a shape node into an absolutely-positioned HTML element with SVG geometry. */ @@ -311,7 +303,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen wrapper.style.height = `${minH}px` if (node.size.w === 0) wrapper.style.width = `${minW}px` wrapper.style.overflow = 'visible' - // Apply transforms (rotation + flip) const transforms: string[] = [] if (node.rotation !== 0) { transforms.push(`rotate(${node.rotation}deg)`) @@ -334,12 +325,10 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen const pathW = w const pathH = h - // Style references (needed for path fallback and line resolution) const styleNode = node.source.child('style') const lnRef = styleNode.exists() ? styleNode.child('lnRef') : undefined const fillRef = styleNode.exists() ? styleNode.child('fillRef') : undefined - // ---- Generate SVG path ---- let pathD = '' let multiPaths: PresetSubPath[] | null = null if (node.presetGeometry) { @@ -383,7 +372,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen ) } - // ---- Resolve fill and line styles ---- const spPr = node.source.child('spPr') let fillCss = '' // Resolve structured gradient fill data (for SVG gradient elements) @@ -465,13 +453,11 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen strokeDashKind = lineStyle.dashKind } - // Line cap: a:ln@cap → SVG stroke-linecap const capAttr = effectiveLine.attr('cap') if (capAttr === 'rnd') strokeLinecap = 'round' else if (capAttr === 'sq') strokeLinecap = 'square' else if (capAttr === 'flat') strokeLinecap = 'butt' - // Line join: from child elements if (effectiveLine.child('round').exists()) strokeLinejoin = 'round' else if (effectiveLine.child('bevel').exists()) strokeLinejoin = 'bevel' else if (effectiveLine.child('miter').exists()) strokeLinejoin = 'miter' @@ -504,7 +490,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen } } - // ---- Create SVG element ---- if (pathD) { const svgNs = 'http://www.w3.org/2000/svg' const svg = document.createElementNS(svgNs, 'svg') @@ -544,7 +529,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen wrapper.appendChild(svg) // Skip path fill/stroke/markers — image replaces fill } else { - // Create for gradients and markers const defs = document.createElementNS(svgNs, 'defs') const path = document.createElementNS(svgNs, 'path') @@ -560,7 +544,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen path.setAttribute('fill-rule', 'evenodd') } - // Fill if (fillCss) { if (gradientFillData && gradientFillData.stops.length > 0) { // Create SVG gradient definition for proper shape-clipped gradient fills @@ -631,7 +614,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen } defs.appendChild(vGrad) - // Use clipPath to constrain the blend group to the shape const clipId = `${fillGradId}-clip` const clipPath = document.createElementNS(svgNs, 'clipPath') clipPath.setAttribute('id', clipId) @@ -695,7 +677,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen } defs.appendChild(radialGrad) } else { - // Linear gradient const linearGrad = document.createElementNS(svgNs, 'linearGradient') linearGrad.setAttribute('id', fillGradId) linearGrad.setAttribute( @@ -725,7 +706,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen path.setAttribute('fill', 'none') } else if (fillCss.includes('gradient')) { // Fallback for gradients without structured data (shouldn't normally happen) - // Apply to wrapper as before wrapper.style.background = fillCss path.setAttribute('fill', 'transparent') } else { @@ -809,11 +789,9 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen ) linearGrad.setAttribute('gradientUnits', 'userSpaceOnUse') - // Convert gradient angle to absolute coordinates in SVG user space const rad = (gradientStroke.angle * Math.PI) / 180 const cos = Math.cos(rad) const sin = Math.sin(rad) - // Centre of the SVG viewBox const cx = svgW / 2 const cy = svgH / 2 // Half-extent along each axis (use max of both dimensions so the gradient covers the path) @@ -865,7 +843,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen path.setAttribute('stroke', 'none') } - // Line end markers (arrowheads) // Use gradient start colour for head (marker-start) and end colour for tail (marker-end) if (effectiveStrokeWidth > 0 && (effectiveHeadEnd || effectiveTailEnd)) { if (effectiveHeadEnd) { @@ -911,7 +888,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen svg.appendChild(path) - // --- Multi-path preset rendering --- // For complex shapes (scrolls, etc.) that have multiple sub-paths with different // fill modifiers (darkenLess for shadow areas, none for stroke-only detail lines). if (multiPaths && multiPaths.length > 1) { @@ -1127,7 +1103,7 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen path.removeAttribute('marker-end') } - // --- Action button icon overlay (legacy fallback) --- + // Action button icon overlay (legacy fallback) // Only used for action buttons that don't have multiPathPresets entries. // Shapes with multiPathPresets already include the icon in their darken sub-paths. if (node.presetGeometry && !multiPaths) { @@ -1153,12 +1129,9 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen } } - // (Can top ellipse overlay removed — now handled by multiPathPresets 'can' lighten sub-path) - wrapper.appendChild(svg) } } else if (fillCss && fillCss !== 'transparent') { - // No geometry but has fill — apply as background color if (fillCss.includes('gradient')) { wrapper.style.background = fillCss } else { @@ -1166,7 +1139,7 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen } } - // ---- Render text overlay (only when there is visible text; skip for decorative shapes with empty txBody) ---- + // Render text overlay (only when there is visible text; skip for decorative shapes with empty txBody) if (node.textBody && node.textBody.paragraphs.length > 0 && hasVisibleText(node.textBody)) { const textContainer = document.createElement('div') textContainer.style.position = 'absolute' @@ -1230,7 +1203,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen needsDynamicAutofit = true } - // Apply bodyPr (text body properties) // Use layout/master bodyPr as fallback for missing attributes { const bodyPr = node.textBody.bodyProperties @@ -1281,7 +1253,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen textContainer.style.paddingRight = `${rightPad}px` textContainer.style.paddingBottom = `${bottomPad}px` - // Vertical text support (bodyPr@vert) const vert = (bodyPr ? bodyPr.attr('vert') : null) || (fallbackBp ? fallbackBp.attr('vert') : null) if (vert === 'eaVert') { @@ -1356,7 +1327,7 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen } } - // ---- Effects (explicit effectLst or theme effectRef fallback) ---- + // Effects (explicit effectLst or theme effectRef fallback) let effectiveEffectLst = spPr.child('effectLst') if (!effectiveEffectLst.exists()) { const effectRef = node.source.child('style').child('effectRef') @@ -1386,7 +1357,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen const offsetX = distPx * Math.cos((dirDeg * Math.PI) / 180) const offsetY = distPx * Math.sin((dirDeg * Math.PI) / 180) - // Resolve shadow color let shadowColor = 'rgba(0,0,0,0.4)' const { color: shdColor, alpha: shdAlpha } = resolveColor(outerShdw, ctx) if (shdColor) { @@ -1444,11 +1414,9 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen effectiveAlpha = shdAlpha * (spread / blurPx) } - // Skip shadow entirely if effective alpha is negligible if (effectiveAlpha >= 0.01) { const bsX = (offsetX + alignOffX).toFixed(1) const bsY = (offsetY + alignOffY).toFixed(1) - // Recompute shadow color with attenuated alpha let attenuatedColor = shadowColor if (shdColor) { const hex2 = shdColor.startsWith('#') ? shdColor : `#${shdColor}` @@ -1479,11 +1447,9 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen } } - // ---- Shape-level hyperlink / action button navigation ---- if (node.hlinkClick && ctx.onNavigate) { const { action, rId } = node.hlinkClick if (action === 'ppaction://hlinksldjump' && rId) { - // Resolve slide target from relationship const rel = ctx.slide.rels.get(rId) if (rel) { // Target is like "slide28.xml" → slide index 27 (0-based) @@ -1499,7 +1465,6 @@ export function renderShape(node: ShapeNodeData, ctx: RenderContext): HTMLElemen } } } else if (rId) { - // External URL link const rel = ctx.slide.rels.get(rId) if (rel && rel.targetMode === 'External' && isAllowedExternalUrl(rel.target)) { wrapper.style.cursor = 'pointer' diff --git a/apps/sim/lib/pptx-renderer/renderer/slide-renderer.ts b/apps/sim/lib/pptx-renderer/renderer/slide-renderer.ts index ba3e021e584..73fe6210939 100644 --- a/apps/sim/lib/pptx-renderer/renderer/slide-renderer.ts +++ b/apps/sim/lib/pptx-renderer/renderer/slide-renderer.ts @@ -219,7 +219,7 @@ export function renderSlide( options?.onNodeError?.('__background__', e) } - // --- Render master template shapes (behind layout and slide) --- + // Render master template shapes (behind layout and slide) // Respect showMasterSp flags: // - layout.showMasterSp === false → skip master shapes // - slide.showMasterSp === false → skip both master AND layout shapes @@ -239,7 +239,7 @@ export function renderSlide( } } - // --- Render layout template shapes --- + // Render layout template shapes if (slide.showMasterSp) { const layoutCtx: RenderContext = { ...ctx, @@ -256,7 +256,7 @@ export function renderSlide( } } - // --- Render slide shapes (on top) --- + // Render slide shapes (on top) for (const node of slide.nodes) { try { const el = renderNode(node, ctx) diff --git a/apps/sim/lib/pptx-renderer/renderer/style-resolver.ts b/apps/sim/lib/pptx-renderer/renderer/style-resolver.ts index 11e78995b98..b59453e7e66 100644 --- a/apps/sim/lib/pptx-renderer/renderer/style-resolver.ts +++ b/apps/sim/lib/pptx-renderer/renderer/style-resolver.ts @@ -9,8 +9,6 @@ import type { ColorModifier } from '../utils/color' import { applyColorModifiers, hslToRgb, presetColorToHex, rgbToHex } from '../utils/color' import type { RenderContext } from './render-context' -// Color Resolution - /** * Build a cache key for a color node based on its tag, value, and modifiers. */ @@ -65,7 +63,6 @@ function resolveSchemeColor(schemeName: string, ctx: RenderContext): string { if (mapped) mappedName = mapped } - // Look up in theme color scheme const hex = ctx.theme.colorScheme.get(mappedName) if (hex) return hex @@ -82,7 +79,6 @@ export function resolveColor( colorNode: SafeXmlNode, ctx: RenderContext ): { color: string; alpha: number } { - // Check cache const cacheKey = buildColorCacheKey(colorNode) const cached = ctx.colorCache.get(cacheKey) if (cached) return cached @@ -203,8 +199,6 @@ function resolveColorWithPlaceholder( return resolveColorUncached(colorNode, ctx, placeholderColorNode) } -// Fill Resolution - /** * Resolve a fill from shape properties (spPr) into a CSS background value. * @@ -214,14 +208,12 @@ function resolveColorWithPlaceholder( * - '' for blipFill (handled by ImageRenderer) or no fill found (inherit) */ export function resolveFill(spPr: SafeXmlNode, ctx: RenderContext): string { - // solidFill const solidFill = spPr.child('solidFill') if (solidFill.exists()) { const { color, alpha } = resolveColor(solidFill, ctx) return toCssColor(color, alpha) } - // gradFill const gradFill = spPr.child('gradFill') if (gradFill.exists()) { return resolveGradient(gradFill, ctx) @@ -249,7 +241,6 @@ export function resolveFill(spPr: SafeXmlNode, ctx: RenderContext): string { return '' } - // noFill const noFill = spPr.child('noFill') if (noFill.exists()) { return 'transparent' @@ -259,8 +250,6 @@ export function resolveFill(spPr: SafeXmlNode, ctx: RenderContext): string { return '' } -// Pattern Fill Resolution - /** * Resolve `` into a CSS background value using repeating gradients. * @@ -270,7 +259,6 @@ export function resolveFill(spPr: SafeXmlNode, ctx: RenderContext): string { function resolvePatternFill(pattFill: SafeXmlNode, ctx: RenderContext): string { const preset = pattFill.attr('prst') ?? 'solid' - // Foreground and background colors let fg = '#000000' let bg = '#ffffff' @@ -297,7 +285,6 @@ function resolvePatternFill(pattFill: SafeXmlNode, ctx: RenderContext): string { `${g1} 0 0/${s}px ${s}px, ${g2} 0 0/${s}px ${s}px, ${bg}` switch (preset) { - // Solid fills case 'solid': case 'solidDmnd': return fg @@ -319,7 +306,6 @@ function resolvePatternFill(pattFill: SafeXmlNode, ctx: RenderContext): string { case 'pct90': return pat(`radial-gradient(${fg} 2.5px, transparent 2.5px)`) - // Horizontal lines case 'horz': case 'ltHorz': case 'narHorz': @@ -328,7 +314,6 @@ function resolvePatternFill(pattFill: SafeXmlNode, ctx: RenderContext): string { `repeating-linear-gradient(0deg, ${fg} 0px, ${fg} 1px, transparent 1px, transparent ${s}px)` ) - // Vertical lines case 'vert': case 'ltVert': case 'narVert': @@ -427,7 +412,6 @@ function resolveGradient( ctx: RenderContext, placeholderColorNode?: SafeXmlNode ): string { - // Parse gradient stops const gsLst = gradFill.child('gsLst') const stops: { position: number; color: string }[] = [] @@ -442,12 +426,10 @@ function resolveGradient( return '' } - // Sort stops by position stops.sort((a, b) => a.position - b.position) const stopsStr = stops.map((s) => `${s.color} ${s.position.toFixed(1)}%`).join(', ') - // Determine gradient type const lin = gradFill.child('lin') if (lin.exists()) { const angle = angleToDeg(lin.numAttr('ang') ?? 0) @@ -494,8 +476,6 @@ function resolveGradient( return `linear-gradient(180deg, ${stopsStr})` } -// Line Style Resolution - /** * Resolve a line (outline) node into CSS-compatible properties. * @@ -513,7 +493,6 @@ export function resolveLineStyle( const widthEmu = ln.numAttr('w') ?? 0 let width = emuToPx(widthEmu) - // Color from solidFill child let color = 'transparent' const solidFill = ln.child('solidFill') if (solidFill.exists()) { @@ -564,7 +543,6 @@ export function resolveLineStyle( } } - // Dash pattern let dash = 'solid' let dashKind = 'solid' const prstDash = ln.child('prstDash') @@ -615,8 +593,6 @@ function ooxmlDashToCss(val: string): string { } } -// Gradient Fill Resolution (structured data for SVG use) - export interface GradientFillData { type: 'linear' | 'radial' stops: Array<{ position: number; color: string }> @@ -743,8 +719,6 @@ export function resolveThemeFillReference( return { fillCss: resolveColorToCss(fillRef, ctx), gradientFillData: null } } -// Gradient Stroke Resolution - export interface GradientStrokeData { stops: Array<{ position: number; color: string }> angle: number diff --git a/apps/sim/lib/pptx-renderer/renderer/text-renderer.ts b/apps/sim/lib/pptx-renderer/renderer/text-renderer.ts index c211d0e478f..84f60b30292 100644 --- a/apps/sim/lib/pptx-renderer/renderer/text-renderer.ts +++ b/apps/sim/lib/pptx-renderer/renderer/text-renderer.ts @@ -13,8 +13,6 @@ import { cssFontStack } from '../utils/font-stack' import type { RenderContext } from './render-context' import { resolveColor, resolveColorToCss } from './style-resolver' -// Style Inheritance Helpers - /** * Find paragraph properties at a specific indent level from a list style node. * Tries lvl{n}pPr (where n = level + 1), then falls back to defPPr. @@ -26,7 +24,6 @@ function findStyleAtLevel(styleNode: SafeXmlNode | undefined, level: number): Sa // Try level-specific style (lvl1pPr, lvl2pPr, etc.) const lvlNode = styleNode.child(`lvl${level + 1}pPr`) if (lvlNode.exists()) return lvlNode - // Fall back to default return styleNode.child('defPPr') } @@ -61,7 +58,6 @@ function findPlaceholderNode( info: PlaceholderInfo ): SafeXmlNode | undefined { for (const ph of placeholders) { - // Navigate to the ph element to read its attributes let phEl: SafeXmlNode | undefined const nvSpPr = ph.child('nvSpPr') if (nvSpPr.exists()) { @@ -133,7 +129,6 @@ function mergeParagraphProps(target: MergedParagraphStyle, pPr: SafeXmlNode): vo const indent = pPr.numAttr('indent') if (indent !== undefined) target.textIndent = emuToPx(indent) - // Line spacing // OOXML spcPct: 100000 = "single spacing" = 1.0× the font's line height. // IMPORTANT: We must use UNITLESS CSS line-height values (e.g., 1.0, 1.2) // instead of percentages (e.g., 100%, 120%). CSS percentage line-height is @@ -162,7 +157,6 @@ function mergeParagraphProps(target: MergedParagraphStyle, pPr: SafeXmlNode): vo } } - // Space before const spcBef = pPr.child('spcBef') if (spcBef.exists()) { const spcPts = spcBef.child('spcPts') @@ -177,7 +171,6 @@ function mergeParagraphProps(target: MergedParagraphStyle, pPr: SafeXmlNode): vo } } - // Space after const spcAft = pPr.child('spcAft') if (spcAft.exists()) { const spcPts = spcAft.child('spcPts') @@ -192,7 +185,6 @@ function mergeParagraphProps(target: MergedParagraphStyle, pPr: SafeXmlNode): vo } } - // Bullets const buChar = pPr.child('buChar') if (buChar.exists()) { target.bulletChar = buChar.attr('char') || '' @@ -226,8 +218,6 @@ function mergeParagraphProps(target: MergedParagraphStyle, pPr: SafeXmlNode): vo } } -// Run Style Resolution - interface MergedRunStyle { fontSize?: number bold?: boolean @@ -277,7 +267,6 @@ function mergeRunProps(target: MergedRunStyle, rPr: SafeXmlNode, ctx: RenderCont if (strike !== undefined && strike !== 'noStrike') target.strikethrough = true if (strike === 'noStrike') target.strikethrough = false - // Color from solidFill or gradFill child const solidFill = rPr.child('solidFill') if (solidFill.exists()) { const { color, alpha } = resolveColor(solidFill, ctx) @@ -295,7 +284,6 @@ function mergeRunProps(target: MergedRunStyle, rPr: SafeXmlNode, ctx: RenderCont if (css) target.textGradientCss = css } - // Font family const latin = rPr.child('latin') if (latin.exists()) { const typeface = latin.attr('typeface') @@ -322,7 +310,6 @@ function mergeRunProps(target: MergedRunStyle, rPr: SafeXmlNode, ctx: RenderCont } } - // Hyperlink const hlinkClick = rPr.child('hlinkClick') if (hlinkClick.exists()) { // The actual URL is in the slide rels, referenced by r:id @@ -417,8 +404,6 @@ function resolveGradientForText(gradFill: SafeXmlNode, ctx: RenderContext): stri return `linear-gradient(180deg, ${stopsStr})` } -// Bullet Generation - function generateAutoNumber(type: string, index: number): string { const num = index + 1 switch (type) { @@ -461,8 +446,6 @@ function toRoman(num: number): string { return result } -// Main Render Function - /** * Render a text body into the provided container element. * @@ -516,7 +499,7 @@ export function renderTextBody( const paraDiv = document.createElement('div') const level = paragraph.level - // ---- Build merged paragraph style (7-level inheritance) ---- + // Build merged paragraph style (7-level inheritance) const merged: MergedParagraphStyle = {} // Level 1: master defaultTextStyle @@ -560,7 +543,6 @@ export function renderTextBody( mergeParagraphProps(merged, paragraph.properties) } - // ---- Apply paragraph styles ---- if (merged.align) { const alignMap: Record = { l: 'left', @@ -615,7 +597,6 @@ export function renderTextBody( paraDiv.style.marginBottom = `${merged.spaceAfterPct * effectiveFontSize}pt` } - // ---- Bullets ---- // Suppress bullets for metadata placeholders (slide number, date, footer) // Also suppress for empty paragraphs (no visible runs) — PowerPoint never shows bullets for them const hasVisibleRuns = paragraph.runs.some((r) => r.text != null && r.text.length > 0) @@ -678,7 +659,6 @@ export function renderTextBody( paraDiv.appendChild(bulletSpan) } - // ---- Render runs ---- if (paragraph.runs.length === 0) { // Empty paragraph — still need to maintain spacing paraDiv.appendChild(document.createElement('br')) @@ -707,7 +687,6 @@ export function renderTextBody( for (const run of paragraph.runs) { if (run.text === '\n') { if (useLineWrappers) { - // Close current line div and start a new one currentLineDiv = document.createElement('div') currentLineDiv.style.height = effectiveLineHeight! currentLineDiv.style.overflow = 'visible' @@ -718,7 +697,6 @@ export function renderTextBody( continue } - // Build merged run style const runStyle: MergedRunStyle = {} // Apply default run properties from merged paragraph defRPr @@ -748,7 +726,6 @@ export function renderTextBody( } } - // Determine if this should be a link let element: HTMLElement if (runStyle.hlinkClick) { const a = document.createElement('a') @@ -894,7 +871,6 @@ export function renderTextBody( if (effectiveFont) { element.style.fontFamily = cssFontStack(effectiveFont) } else { - // Fallback to theme minor font const fallback = ctx.theme.minorFont.latin || ctx.theme.minorFont.ea if (fallback) { element.style.fontFamily = cssFontStack(fallback) @@ -918,12 +894,10 @@ export function renderTextBody( element.style.fontVariant = 'small-caps' } - // Baseline shift (superscript/subscript) if (runStyle.baseline !== undefined && runStyle.baseline !== 0) { // OOXML baseline is in 1000ths of percent; positive = superscript, negative = subscript const shiftPct = runStyle.baseline / 1000 element.style.verticalAlign = `${shiftPct}%` - // Reduce font size for super/subscript if (Math.abs(shiftPct) >= 20) { element.style.fontSize = `${fontSize * fontScale * 0.65}pt` } diff --git a/apps/sim/lib/pptx-renderer/shapes/presets.ts b/apps/sim/lib/pptx-renderer/shapes/presets.ts index 250bc0b155c..cb0889ccbb2 100644 --- a/apps/sim/lib/pptx-renderer/shapes/presets.ts +++ b/apps/sim/lib/pptx-renderer/shapes/presets.ts @@ -128,8 +128,6 @@ function mirrorAbsolutePathVertically(path: string, height: number): string { return out.join(' ') } -// Preset shape registry - export const presetShapes: Map = new Map() presetShapes.set('rect', (w, h) => `M0,0 L${w},0 L${w},${h} L0,${h} Z`) @@ -3573,7 +3571,6 @@ presetShapes.set('sun', (w, h, adjustments) => { const g16 = 100000 - g12 const g17 = 100000 - g13 const g18 = 100000 - g14 - // Pixel coordinates const hc = w / 2 const vc = h / 2 const ox1 = (w * 18436) / 21600 @@ -3654,9 +3651,8 @@ presetShapes.set('moon', (w, h, adjustments) => { }) presetShapes.set('lightningBolt', (w, h) => { - // Calibrated against OOXML preset rendering (PowerPoint PDF export): - // the old simplified 7-point bolt was too wide and lacked the inner notches. - // This normalized 11-point contour follows the default lightningBolt geometry. + // Calibrated against PowerPoint PDF export of the OOXML preset: this normalized + // 11-point contour follows the default lightningBolt geometry, inner notches included. return [ `M${w * 0.3895},${h * 0.0}`, `L${w * 0.0},${h * 0.1821}`, @@ -3881,17 +3877,12 @@ presetShapes.set('rightBrace', (w, h, adjustments) => { presetShapes.set('actionButtonBlank', (w, h) => `M0,0 L${w},0 L${w},${h} L0,${h} Z`) -// Fallback rectangle for action buttons without multiPathPresets entry yet -// actionButtonSound fallback removed — uses multiPathPresets entry below - // Multi-path action button presets are registered after the multiPathPresets Map // declaration (see below in the multiPathPresets section). // Action button icon paths (rendered as a second with contrasting fill) const actionButtonIcons = new Map string>() -// actionButtonHome icon removed — uses multiPathPresets entry below - actionButtonIcons.set('actionButtonForwardNext', (w, h) => { // Right-pointing triangle (▶) const cx = w / 2 @@ -3966,8 +3957,6 @@ actionButtonIcons.set('actionButtonEnd', (w, h) => { ].join(' ') }) -// actionButtonHelp icon removed — uses multiPathPresets entry below - actionButtonIcons.set('actionButtonInformation', (w, h) => { // Info icon (i) const cx = w / 2 @@ -3997,10 +3986,6 @@ actionButtonIcons.set('actionButtonDocument', (w, h) => { ].join(' ') }) -// actionButtonSound icon removed — uses multiPathPresets entry below - -// actionButtonMovie icon is now rendered via multiPathPresets (see below). - /** * Get the SVG path for the icon overlay of an action button. * Returns undefined if the shape is not an action button or is actionButtonBlank. @@ -4015,7 +4000,6 @@ export function getActionButtonIconPath( return generator?.(w, h) } -// Some shapes are known by multiple names in different OOXML versions // flowChartOfflineStorage: registered as multiPathPreset (see below) // ribbon is implemented as multiPathPreset (see multiPathPresets below) @@ -4368,10 +4352,6 @@ presetShapes.set('funnel', (w, h) => { return `${body} ${inset}` }) -/** - * Get the SVG path for a preset shape, falling back to a simple rectangle - * if the shape type is not implemented. - */ // Preset shape overlays — additional paths for 3D-like shapes (lighter top face, etc.) interface PresetOverlay { @@ -4575,23 +4555,8 @@ multiPathPresets.set('actionButtonReturn', (w, h) => { // Outline path (path 2 in OOXML spec — traces shape with different arc winding) // Starts from right outer edge, traces clockwise: outer right → outer bottom → outer left → inner left → inner bottom → inner right → arrow // Arc A: from (g22, g20), wR=g17 hR=g17 stAng=0° swAng=90° - // center = (g22-g17, g20) = (g22-g17, g20), endpoint = (g22-g17, g20+g17) - // g22-g17 = g11+g14-g17 = g11 + g13*7/8 - g13*3/8 = g11 + g13/2 = g25 + g13/8 = hc? No. - // Actually: g22 = g11+g14, g14 = g13*7/8, g17 = g13*3/8 - // g22 - g17 = g11 + g13*7/8 - g13*3/8 = g11 + g13*4/8 = g11 + g13/2 = hc (since hc = g11 + dx2 = g11 + g13/2) - // Hmm wait, dx2 = ss*3/8 and g13 = ss*3/4. So g13/2 = ss*3/8 = dx2. So hc = g11 + dx2 = g11 + g13/2. Yes! - // endpoint = (hc, g20+g17) = (hc, g10)? g20+g17 = (g9+g16)+g17 = g9+g13*5/8+g13*3/8 = g9+g13 = g9+ss*3/4 - // g10 = vc+dx2. g9+g13 = (vc-dx2) + 2*dx2 = vc+dx2 = g10. Yes! endpoint = (hc, g10) ✓ but wait... - // Actually stAng=0° means start angle is 0°. center = (g22 - g17*cos(0), g20 - g17*sin(0)) = (g22-g17, g20). - // endAng = 0+90 = 90°. endX = center.x + g17*cos(90°) = g22-g17. endY = center.y + g17*sin(90°) = g20+g17. - // So endpoint = (g22-g17, g20+g17). Let's verify: g22-g17 = g11+g14-g17 = g11+g13*(7/8-3/8) = g11+g13/2 = g25+g13/8 - // Hmm, g25 = g11+g17 = g11+g13*3/8. g11+g13/2 = g11+g13*4/8. That's not g25, it's g25 + g13/8. - // Actually let me just compute: g11+g13/2. g13/2 is not one of the named guides. - // OK, the spec says after this arc: lnTo (g25, g10). So endpoint.x must be something, then line to g25. - // endpoint.x = g22-g17 = g11+g14-g17 = g11+g13*7/8-g13*3/8 = g11+g13*4/8 = g11+g13/2. - // Then lnTo (g25, g10) where g25 = g11+g13*3/8. - // endpointY = g20+g17 = g10. So endpoint = (g11+g13/2, g10). - // Line from there to (g25, g10) is horizontal. Makes sense. + // center = (g22-g17, g20), endpoint = (g22-g17, g20+g17) = (g11+g13/2, g10), + // then a horizontal lnTo (g25, g10). // Arc B: from (g25, g10), wR=g17 hR=g17 stAng=90° swAng=90° // center = (g25, g10-g17), endAng=180° // endX = g25+g17*cos(180°) = g25-g17 = g11+g17-g17 = g11 @@ -4600,15 +4565,11 @@ multiPathPresets.set('actionButtonReturn', (w, h) => { // Arc C: from (g26, g20), wR=g27 hR=g27 stAng=180° swAng=-90° // center = (g26+g27, g20) = (g26+g27, g20). g26+g27 = g11+g18+g13/8 = g11+g13/4+g13/8 = g11+g13*3/8 = g25 // endAng = 180-90 = 90°. endX = g25+g27*cos(90°) = g25. endY = g20+g27*sin(90°) = g20+g27 = g19. - // endpoint = (g25, g19). Hmm, but spec says lnTo(hc, g19) after this arc. - // Wait: lnTo before spec says ``. So endpoint is (g25, g19), then line to (hc, g19). - // Hmm actually spec says: ``. - // Wait no: `L(hc, g19)` in the spec. + // endpoint = (g25, g19), then lnTo (hc, g19). // Arc D: from (hc, g19), wR=g27 hR=g27 stAng=90° swAng=-90° // center = (hc, g19-g27), endAng = 0°. // endX = hc+g27*cos(0°) = hc+g27. g19-g27 = g20. endY = g20+g27*sin(0°) = g20. - // endpoint = (hc+g27, g20). Hmm, but g24 = g11+g16 = g11+g13*5/8. - // hc+g27 = g11+g13/2+g13/8 = g11+g13*5/8 = g24. So endpoint = (g24, g20). + // hc+g27 = g11+g13*5/8 = g24, so endpoint = (g24, g20). // Then lnTo (g24, g21). Then lnTo (hc, g21). Then lnTo (g23, g9). Close. const outline = [ @@ -5576,7 +5537,7 @@ multiPathPresets.set('accentcallout3', (w, h, adjustments) => { ] }) -// --- callout1/2/3: filled rect (no stroke) + callout line segments --- +// callout1/2/3: filled rect (no stroke) + callout line segments multiPathPresets.set('callout1', (w, h, adjustments) => { const y1 = (h * (adjustments?.get('adj1') ?? 18750)) / 100000 const x1 = (w * (adjustments?.get('adj2') ?? -8333)) / 100000 @@ -5616,7 +5577,7 @@ multiPathPresets.set('callout3', (w, h, adjustments) => { ] }) -// --- borderCallout2/3: filled+stroked rect + callout line segments --- +// borderCallout2/3: filled+stroked rect + callout line segments multiPathPresets.set('bordercallout2', (w, h, adjustments) => { const y1 = (h * (adjustments?.get('adj1') ?? 18750)) / 100000 const x1 = (w * (adjustments?.get('adj2') ?? -8333)) / 100000 @@ -5645,7 +5606,7 @@ multiPathPresets.set('bordercallout3', (w, h, adjustments) => { ] }) -// --- accentBorderCallout1/2/3: filled+stroked rect + accent bar + callout line --- +// accentBorderCallout1/2/3: filled+stroked rect + accent bar + callout line multiPathPresets.set('accentbordercallout1', (w, h, adjustments) => { const y1 = (h * (adjustments?.get('adj1') ?? 18750)) / 100000 const x1 = (w * (adjustments?.get('adj2') ?? -8333)) / 100000 @@ -5744,7 +5705,7 @@ function ooArcTo( return { svg: `A${wR},${hR} 0 ${largeArc},${sweepFlag} ${ex},${ey}`, x: ex, y: ey } } -// --- ribbon (OOXML spec: 3 paths with arcTo, adj1=16667, adj2=50000) --- +// ribbon (OOXML spec: 3 paths with arcTo, adj1=16667, adj2=50000) // Ribbon with tails at top, front panel at bottom. Three paths: body, darkenLess folds, outline. multiPathPresets.set('ribbon', (w, h, adjustments) => { const adj1Raw = adjustments?.get('adj1') ?? 16667 @@ -5938,7 +5899,7 @@ multiPathPresets.set('ribbon', (w, h, adjustments) => { ] }) -// --- ribbon2 (OOXML spec: 3 paths, inverted ribbon with tails at bottom) --- +// ribbon2 (OOXML spec: 3 paths, inverted ribbon with tails at bottom) multiPathPresets.set('ribbon2', (w, h, adjustments) => { const adj1Raw = adjustments?.get('adj1') ?? 16667 const adj2Raw = adjustments?.get('adj2') ?? 50000 @@ -6129,7 +6090,7 @@ multiPathPresets.set('ribbon2', (w, h, adjustments) => { ] }) -// --- horizontalScroll (OOXML spec: 3 paths with arcTo) --- +// horizontalScroll (OOXML spec: 3 paths with arcTo) multiPathPresets.set('horizontalscroll', (w, h, adjustments) => { const adjVal = adjustments?.get('adj') ?? 12500 const a = Math.min(Math.max(adjVal, 0), 25000) @@ -6159,11 +6120,7 @@ multiPathPresets.set('horizontalscroll', (w, h, adjustments) => { p1.push(arc.svg) cx = arc.x cy = arc.y - // lnTo (x4, ch2) — but after the arc we should be at (x4, 0)… wait - // Actually: arcTo from (w, ch2) with stAng=0 swAng=90° → center=(w-ch2, ch2), end=(w-ch2, 0)=x4,0 - // Then lnTo (x4, ch2)... hmm, this goes from top-right curl area - // Let me re-read: lnTo pt x="x4" y="ch2"... that doesn't match. Wait, the lnTo goes DOWN. - // After arc: we're at (x4, 0). lnTo (x4, ch2): + // arcTo from (w, ch2) with stAng=0 swAng=90° ends at (x4, 0); then lnTo (x4, ch2) p1.push(`L${x4},${ch2}`) // arcTo wR=ch4 hR=ch4 stAng=0 swAng=cd2(180°) arc = ooArcTo(x4, ch2, ch4, ch4, 0, 180) @@ -6314,7 +6271,7 @@ multiPathPresets.set('horizontalscroll', (w, h, adjustments) => { ] }) -// --- verticalScroll (OOXML spec: 3 paths with arcTo) --- +// verticalScroll (OOXML spec: 3 paths with arcTo) multiPathPresets.set('verticalscroll', (w, h, adjustments) => { const adjVal = adjustments?.get('adj') ?? 12500 const a = Math.min(Math.max(adjVal, 0), 25000) @@ -6502,6 +6459,10 @@ export function getMultiPathPreset( return gen ? gen(w, h, adjustments) : null } +/** + * Get the SVG path for a preset shape, falling back to a simple rectangle + * if the shape type is not implemented. + */ export function getPresetShapePath( shapeType: string, w: number, @@ -6516,7 +6477,6 @@ export function getPresetShapePath( if (generator) { return generator(w, h, adjustments) } - // Fallback: simple rectangle logger.warn('Unknown preset shape, falling back to rectangle', { shapeType }) return `M0,0 L${w},0 L${w},${h} L0,${h} Z` } diff --git a/apps/sim/lib/table/query-builder/converters.ts b/apps/sim/lib/table/query-builder/converters.ts index 9a226c287f9..dc6afdc913f 100644 --- a/apps/sim/lib/table/query-builder/converters.ts +++ b/apps/sim/lib/table/query-builder/converters.ts @@ -306,7 +306,7 @@ function formatValueForBuilder(value: JsonValue): string { return String(value) } -/* ----------------------------- v2 grammar ----------------------------- */ +// v2 grammar /** Operators that carry no value — the full v2 set, a superset of the legacy * `VALUELESS_OPERATORS` in constants.ts (which the `$`-grammar serializer diff --git a/apps/sim/lib/uploads/utils/file-utils.ts b/apps/sim/lib/uploads/utils/file-utils.ts index 2e7382d267a..aea919345c3 100644 --- a/apps/sim/lib/uploads/utils/file-utils.ts +++ b/apps/sim/lib/uploads/utils/file-utils.ts @@ -32,7 +32,6 @@ export interface MessageContent { * Mapping of MIME types to content types */ export const MIME_TYPE_MAPPING: Record = { - // Images 'image/jpeg': 'image', 'image/jpg': 'image', 'image/png': 'image', @@ -47,7 +46,6 @@ export const MIME_TYPE_MAPPING: Record = { - // Images jpg: 'image/jpeg', jpeg: 'image/jpeg', png: 'image/png', @@ -316,7 +311,6 @@ const EXTENSION_TO_MIME: Record = { avif: 'image/avif', ico: 'image/x-icon', - // Documents pdf: 'application/pdf', txt: 'text/plain', csv: 'text/csv', @@ -335,11 +329,9 @@ const EXTENSION_TO_MIME: Record = { yml: 'application/x-yaml', rtf: 'application/rtf', - // Archives zip: 'application/zip', gz: 'application/gzip', - // Code / plain-text source py: 'text/x-python', js: 'text/javascript', mjs: 'text/javascript', @@ -382,7 +374,6 @@ const EXTENSION_TO_MIME: Record = { gql: 'text/x-graphql', proto: 'text/x-protobuf', - // Audio mp3: 'audio/mpeg', m4a: 'audio/mp4', wav: 'audio/wav', @@ -392,7 +383,6 @@ const EXTENSION_TO_MIME: Record = { aac: 'audio/aac', opus: 'audio/opus', - // Video mp4: 'video/mp4', mov: 'video/quicktime', avi: 'video/x-msvideo', @@ -525,7 +515,6 @@ export function isAbortError(error: unknown): boolean { } const MIME_TO_EXTENSION: Record = { - // Images 'image/jpeg': 'jpg', 'image/jpg': 'jpg', 'image/png': 'png', @@ -540,7 +529,6 @@ const MIME_TO_EXTENSION: Record = { 'image/x-icon': 'ico', 'image/vnd.microsoft.icon': 'ico', - // Documents 'application/pdf': 'pdf', 'text/plain': 'txt', 'text/csv': 'csv', @@ -557,7 +545,6 @@ const MIME_TO_EXTENSION: Record = { 'text/markdown': 'md', 'application/rtf': 'rtf', - // Audio 'audio/mpeg': 'mp3', 'audio/mp3': 'mp3', 'audio/mp4': 'm4a', @@ -575,7 +562,6 @@ const MIME_TO_EXTENSION: Record = { 'audio/x-aac': 'aac', 'audio/opus': 'opus', - // Video 'video/mp4': 'mp4', 'video/mpeg': 'mpg', 'video/quicktime': 'mov', @@ -585,7 +571,6 @@ const MIME_TO_EXTENSION: Record = { 'video/x-matroska': 'mkv', 'video/webm': 'webm', - // Archives 'application/zip': 'zip', 'application/x-zip-compressed': 'zip', 'application/gzip': 'gz', @@ -657,7 +642,6 @@ export function validateKnowledgeBaseFile( return `File "${file.name}" is too large. Maximum size is ${maxSizeMB}MB.` } - // Check MIME type first if (ACCEPTED_FILE_TYPES.includes(file.type)) { return null } @@ -1052,16 +1036,11 @@ export function processFilesToUserFiles( export function sanitizeFilenameForMetadata(filename: string): string { return ( filename - // Remove non-ASCII characters (keep only printable ASCII 0x20-0x7E) .replace(/[^\x20-\x7E]/g, '') // Remove characters that are problematic in HTTP headers .replace(/["\\]/g, '') - // Replace multiple spaces with single space .replace(/\s+/g, ' ') - // Trim whitespace - .trim() || - // Provide fallback if completely sanitized - 'file' + .trim() || 'file' ) } diff --git a/apps/sim/lib/workflows/editing/operations.ts b/apps/sim/lib/workflows/editing/operations.ts index c4602eed304..da03e6e4d21 100644 --- a/apps/sim/lib/workflows/editing/operations.ts +++ b/apps/sim/lib/workflows/editing/operations.ts @@ -354,7 +354,6 @@ export function handleDeleteOperation(op: EditWorkflowOperation, ctx: OperationC return } - // Check if block is locked or inside a locked container const deleteBlock = modifiedState.blocks[block_id] const deleteParentId = deleteBlock.data?.parentId as string | undefined const deleteParentLocked = deleteParentId ? modifiedState.blocks[deleteParentId]?.locked : false @@ -370,7 +369,6 @@ export function handleDeleteOperation(op: EditWorkflowOperation, ctx: OperationC return } - // Find all child blocks to remove const blocksToRemove = new Set([block_id]) const findChildren = (parentId: string) => { Object.entries(modifiedState.blocks).forEach(([childId, child]: [string, any]) => { @@ -382,10 +380,8 @@ export function handleDeleteOperation(op: EditWorkflowOperation, ctx: OperationC } findChildren(block_id) - // Remove blocks blocksToRemove.forEach((id) => delete modifiedState.blocks[id]) - // Remove edges connected to deleted blocks modifiedState.edges = modifiedState.edges.filter( (edge: any) => !blocksToRemove.has(edge.source) && !blocksToRemove.has(edge.target) ) @@ -408,7 +404,6 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon const block = modifiedState.blocks[block_id] - // Check if block is locked or inside a locked container const editParentId = block.data?.parentId as string | undefined const editParentLocked = editParentId ? modifiedState.blocks[editParentId]?.locked : false if (block.locked || editParentLocked) { @@ -423,7 +418,6 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon return } - // Ensure block has essential properties if (!block.type) { logger.warn(`Block ${block_id} missing type property, skipping edit`, { blockKeys: Object.keys(block), @@ -438,7 +432,6 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon return } - // Update inputs (convert to subBlocks format) if (params?.inputs) { if (!block.subBlocks) block.subBlocks = {} @@ -450,7 +443,6 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon ) const explicitInputKeys = new Set() - // Validate inputs against block configuration const validationResult = validateInputsForBlock( block.type, params.inputs, @@ -488,7 +480,6 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon sanitizedValue = normalizeConditionRouterIds(block_id, key, sanitizedValue) - // Special handling for tools - normalize and filter disallowed if (key === 'tools' && Array.isArray(value)) { sanitizedValue = filterDisallowedTools( normalizeTools(value), @@ -498,7 +489,6 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon ) } - // Special handling for responseFormat - normalize to ensure consistent format if (key === 'responseFormat' && value) { sanitizedValue = normalizeResponseFormat(value) } @@ -529,10 +519,8 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon } } - // Update loop/parallel configuration in block.data (strict validation) if (block.type === 'loop') { block.data = block.data || {} - // loopType is always valid if (params.inputs.loopType !== undefined) { const validLoopTypes = ['for', 'forEach', 'while', 'doWhile'] if (validLoopTypes.includes(params.inputs.loopType)) { @@ -540,15 +528,12 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon } } const effectiveLoopType = params.inputs.loopType ?? block.data.loopType ?? 'for' - // iterations only valid for 'for' loopType if (params.inputs.iterations !== undefined && effectiveLoopType === 'for') { block.data.count = params.inputs.iterations } - // collection only valid for 'forEach' loopType if (params.inputs.collection !== undefined && effectiveLoopType === 'forEach') { block.data.collection = params.inputs.collection } - // condition only valid for 'while' or 'doWhile' loopType if ( params.inputs.condition !== undefined && (effectiveLoopType === 'while' || effectiveLoopType === 'doWhile') @@ -561,7 +546,6 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon } } else if (block.type === 'parallel') { block.data = block.data || {} - // parallelType is always valid if (params.inputs.parallelType !== undefined) { const validParallelTypes = ['count', 'collection'] if (validParallelTypes.includes(params.inputs.parallelType)) { @@ -569,11 +553,9 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon } } const effectiveParallelType = params.inputs.parallelType ?? block.data.parallelType ?? 'count' - // count only valid for 'count' parallelType if (params.inputs.count !== undefined && effectiveParallelType === 'count') { block.data.count = params.inputs.count } - // collection only valid for 'collection' parallelType if (params.inputs.collection !== undefined && effectiveParallelType === 'collection') { block.data.collection = params.inputs.collection } @@ -604,12 +586,10 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon } } - // Update basic properties if (params?.type !== undefined) { // Special container types (loop, parallel) are not in the block registry but are valid const isContainerType = params.type === 'loop' || params.type === 'parallel' - // Validate type before setting (skip validation for container types) const blockConfig = getBlock(params.type) if (!blockConfig && !isContainerType) { logSkippedItem(skippedItems, { @@ -674,24 +654,21 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon } } - // Handle trigger mode toggle if (typeof params?.triggerMode === 'boolean') { block.triggerMode = params.triggerMode if (params.triggerMode === true) { - // Remove all incoming edges when enabling trigger mode modifiedState.edges = modifiedState.edges.filter((edge: any) => edge.target !== block_id) } } - // Handle advanced mode toggle if (typeof params?.advancedMode === 'boolean') { block.advancedMode = params.advancedMode } - // Handle retry policy. Runs after the trigger-mode branch above so eligibility - // sees the block's post-update mode: turning a block into a trigger in the - // same operation makes it ineligible, exactly as the editor treats it. + // Runs after the trigger-mode branch above so retry eligibility sees the + // block's post-update mode: turning a block into a trigger in the same + // operation makes it ineligible, exactly as the editor treats it. if (params?.retry !== undefined) { applyBlockRetry(block, params.retry, { operationType: 'edit', @@ -700,14 +677,12 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon }) } - // Handle nested nodes update (for loops/parallels) using merge strategy. - // Existing children that match an incoming node by name are updated in place + // Merge strategy: existing children that match an incoming node by name are updated in place // (preserving their block ID). New children are created. Children not present // in the incoming set are removed. if (params?.nestedNodes) { mergeNestedNodesForParent(block_id, params.nestedNodes, ctx) - // Update loop/parallel configuration based on type (strict validation) updateLoopOrParallelContainerData(block, params) } @@ -727,7 +702,6 @@ export function handleEditOperation(op: EditWorkflowOperation, ctx: OperationCon }) } - // Handle edge removal if (params?.removeEdges && Array.isArray(params.removeEdges)) { params.removeEdges.forEach(({ targetBlockId, sourceHandle = 'source' }) => { modifiedState.edges = modifiedState.edges.filter( @@ -794,7 +768,6 @@ export function handleAddOperation(op: EditWorkflowOperation, ctx: OperationCont // Special container types (loop, parallel) are not in the block registry but are valid const isContainerType = params.type === 'loop' || params.type === 'parallel' - // Validate block type before adding (skip validation for container types) const addBlockConfig = getBlock(params.type) if (!addBlockConfig && !isContainerType) { logSkippedItem(skippedItems, { @@ -807,7 +780,6 @@ export function handleAddOperation(op: EditWorkflowOperation, ctx: OperationCont return } - // Check if block type is allowed by permission group if (!isContainerType && !isBlockTypeAllowed(params.type, permissionConfig)) { logSkippedItem(skippedItems, { type: 'block_not_allowed', @@ -831,7 +803,6 @@ export function handleAddOperation(op: EditWorkflowOperation, ctx: OperationCont return } - // Check single-instance block constraints (e.g., Response block) const singleInstanceIssue = TriggerUtils.getSingleInstanceBlockIssue( modifiedState.blocks, params.type @@ -847,7 +818,6 @@ export function handleAddOperation(op: EditWorkflowOperation, ctx: OperationCont return } - // Create new block with proper structure const newBlock = createBlockFromParams( block_id, params, @@ -866,7 +836,6 @@ export function handleAddOperation(op: EditWorkflowOperation, ctx: OperationCont // This ensures children can reference valid parentId modifiedState.blocks[block_id] = newBlock - // Handle nested nodes (for loops/parallels created from scratch) if (params.nestedNodes) { processNestedNodesForParent(block_id, params.nestedNodes, ctx) } @@ -916,7 +885,6 @@ export function handleInsertIntoSubflowOperation( return } - // Check if subflow is locked if (subflowBlock.locked) { logSkippedItem(skippedItems, { type: 'block_locked', @@ -939,11 +907,9 @@ export function handleInsertIntoSubflowOperation( return } - // Check if block already exists (moving into subflow) or is new const existingBlock = modifiedState.blocks[block_id] if (existingBlock) { - // Check if existing block is locked if (existingBlock.locked) { logSkippedItem(skippedItems, { type: 'block_locked', @@ -965,9 +931,7 @@ export function handleInsertIntoSubflowOperation( } existingBlock.position = { x: 0, y: 0 } - // Update inputs if provided (with validation) if (params.inputs) { - // Validate inputs against block configuration const validationResult = validateInputsForBlock( existingBlock.type, params.inputs, @@ -985,7 +949,6 @@ export function handleInsertIntoSubflowOperation( skippedItems, }) Object.entries(validationResult.validInputs).forEach(([key, value]) => { - // Skip runtime subblock IDs (webhookId, triggerPath) if (TRIGGER_RUNTIME_SUBBLOCK_IDS.includes(key)) { return } @@ -998,7 +961,6 @@ export function handleInsertIntoSubflowOperation( sanitizedValue = normalizeConditionRouterIds(block_id, key, sanitizedValue) - // Special handling for tools - normalize and filter disallowed if (key === 'tools' && Array.isArray(value)) { sanitizedValue = filterDisallowedTools( normalizeTools(value), @@ -1008,7 +970,6 @@ export function handleInsertIntoSubflowOperation( ) } - // Special handling for responseFormat - normalize to ensure consistent format if (key === 'responseFormat' && value) { sanitizedValue = normalizeResponseFormat(value) } @@ -1038,7 +999,6 @@ export function handleInsertIntoSubflowOperation( // Special container types (loop, parallel) are not in the block registry but are valid const isContainerType = params.type === 'loop' || params.type === 'parallel' - // Validate block type before creating (skip validation for container types) const insertBlockConfig = getBlock(params.type) if (!insertBlockConfig && !isContainerType) { logSkippedItem(skippedItems, { @@ -1051,7 +1011,6 @@ export function handleInsertIntoSubflowOperation( return } - // Check if block type is allowed by permission group if (!isContainerType && !isBlockTypeAllowed(params.type, permissionConfig)) { logSkippedItem(skippedItems, { type: 'block_not_allowed', @@ -1063,7 +1022,6 @@ export function handleInsertIntoSubflowOperation( return } - // Create new block as child of subflow const newBlock = createBlockFromParams( block_id, params, @@ -1086,7 +1044,6 @@ export function handleInsertIntoSubflowOperation( // This is particularly important when multiple blocks are being inserted // and they have connections to each other if (params.connections) { - // Remove existing edges from this block first modifiedState.edges = modifiedState.edges.filter((edge: any) => edge.source !== block_id) // Re-specifying connections fully replaces this block's outgoing edges, so @@ -1096,7 +1053,6 @@ export function handleInsertIntoSubflowOperation( connBlock.data.pendingConnections = undefined } - // Add to deferred connections list deferredConnections.push({ blockId: block_id, connections: params.connections, @@ -1133,7 +1089,6 @@ export function handleExtractFromSubflowOperation( return } - // Check if block is locked if (block.locked) { logSkippedItem(skippedItems, { type: 'block_locked', @@ -1144,7 +1099,6 @@ export function handleExtractFromSubflowOperation( return } - // Check if parent subflow is locked const parentSubflow = modifiedState.blocks[subflowId] if (parentSubflow?.locked) { logSkippedItem(skippedItems, { @@ -1157,7 +1111,6 @@ export function handleExtractFromSubflowOperation( return } - // Verify it's actually a child of this subflow if (block.data?.parentId !== subflowId) { logger.warn('Block is not a child of specified subflow', { block_id, diff --git a/apps/sim/tools/ahrefs/types.ts b/apps/sim/tools/ahrefs/types.ts index 69e0ed567f1..79b27125c02 100644 --- a/apps/sim/tools/ahrefs/types.ts +++ b/apps/sim/tools/ahrefs/types.ts @@ -1,21 +1,21 @@ -// Common types for Ahrefs API tools import type { ToolResponse } from '@/tools/types' -// Common parameters for all Ahrefs tools interface AhrefsBaseParams { apiKey: string } -// Target mode for analysis export type AhrefsTargetMode = 'domain' | 'prefix' | 'subdomains' | 'exact' -// Historical scope for backlink-profile endpoints (no `date` param on these endpoints) -export type AhrefsHistory = 'live' | 'all_time' | string // `since:YYYY-MM-DD` is also valid +/** + * Historical scope for backlink-profile endpoints (no `date` param on these endpoints). + * `since:YYYY-MM-DD` is also valid. + */ +export type AhrefsHistory = 'live' | 'all_time' | string -// Domain Rating tool types export interface AhrefsDomainRatingParams extends AhrefsBaseParams { target: string - date?: string // Date in YYYY-MM-DD format, defaults to today + /** Date in YYYY-MM-DD format, defaults to today */ + date?: string } export interface AhrefsDomainRatingResponse extends ToolResponse { @@ -25,7 +25,6 @@ export interface AhrefsDomainRatingResponse extends ToolResponse { } } -// Backlinks tool types export interface AhrefsBacklinksParams extends AhrefsBaseParams { target: string mode?: AhrefsTargetMode @@ -49,11 +48,11 @@ export interface AhrefsBacklinksResponse extends ToolResponse { } } -// Backlinks Stats tool types export interface AhrefsBacklinksStatsParams extends AhrefsBaseParams { target: string mode?: AhrefsTargetMode - date?: string // Date in YYYY-MM-DD format, defaults to today + /** Date in YYYY-MM-DD format, defaults to today */ + date?: string } interface AhrefsBacklinksStatsResult { @@ -69,7 +68,6 @@ export interface AhrefsBacklinksStatsResponse extends ToolResponse { } } -// Referring Domains tool types export interface AhrefsReferringDomainsParams extends AhrefsBaseParams { target: string mode?: AhrefsTargetMode @@ -92,12 +90,12 @@ export interface AhrefsReferringDomainsResponse extends ToolResponse { } } -// Organic Keywords tool types export interface AhrefsOrganicKeywordsParams extends AhrefsBaseParams { target: string country?: string mode?: AhrefsTargetMode - date?: string // Date in YYYY-MM-DD format, defaults to today + /** Date in YYYY-MM-DD format, defaults to today */ + date?: string limit?: number } @@ -116,12 +114,12 @@ export interface AhrefsOrganicKeywordsResponse extends ToolResponse { } } -// Top Pages tool types export interface AhrefsTopPagesParams extends AhrefsBaseParams { target: string country?: string mode?: AhrefsTargetMode - date?: string // Date in YYYY-MM-DD format, defaults to today + /** Date in YYYY-MM-DD format, defaults to today */ + date?: string limit?: number } @@ -139,7 +137,6 @@ export interface AhrefsTopPagesResponse extends ToolResponse { } } -// Keyword Overview tool types export interface AhrefsKeywordOverviewParams extends AhrefsBaseParams { keyword: string country?: string @@ -172,7 +169,6 @@ export interface AhrefsKeywordOverviewResponse extends ToolResponse { } } -// Broken Backlinks tool types export interface AhrefsBrokenBacklinksParams extends AhrefsBaseParams { target: string mode?: AhrefsTargetMode @@ -193,12 +189,13 @@ export interface AhrefsBrokenBacklinksResponse extends ToolResponse { } } -// Metrics tool types (single-call organic + paid search overview) +/** Metrics tool types (single-call organic + paid search overview) */ export interface AhrefsMetricsParams extends AhrefsBaseParams { target: string country?: string mode?: AhrefsTargetMode - date?: string // Date in YYYY-MM-DD format, defaults to today + /** Date in YYYY-MM-DD format, defaults to today */ + date?: string } interface AhrefsMetricsResult { @@ -218,12 +215,12 @@ export interface AhrefsMetricsResponse extends ToolResponse { } } -// Organic Competitors tool types export interface AhrefsOrganicCompetitorsParams extends AhrefsBaseParams { target: string country?: string mode?: AhrefsTargetMode - date?: string // Date in YYYY-MM-DD format, defaults to today + /** Date in YYYY-MM-DD format, defaults to today */ + date?: string limit?: number } @@ -242,16 +239,15 @@ export interface AhrefsOrganicCompetitorsResponse extends ToolResponse { } } -// Rank Tracker device type export type AhrefsRankTrackerDevice = 'desktop' | 'mobile' -// Rank Tracker search volume calculation mode +/** Rank Tracker search volume calculation mode */ export type AhrefsVolumeMode = 'monthly' | 'average' -// Rank Tracker Overview tool types export interface AhrefsRankTrackerOverviewParams extends AhrefsBaseParams { projectId: number - date: string // Date in YYYY-MM-DD format (required by the API) + /** Date in YYYY-MM-DD format (required by the API) */ + date: string device: AhrefsRankTrackerDevice dateCompared?: string volumeMode?: AhrefsVolumeMode @@ -275,14 +271,14 @@ export interface AhrefsRankTrackerOverviewResponse extends ToolResponse { } } -// Rank Tracker SERP Overview tool types export interface AhrefsRankTrackerSerpOverviewParams extends AhrefsBaseParams { projectId: number keyword: string country: string device: AhrefsRankTrackerDevice topPositions?: number - date?: string // ISO date-time (YYYY-MM-DDThh:mm:ss) + /** ISO date-time (YYYY-MM-DDThh:mm:ss) */ + date?: string locationId?: number languageCode?: string } @@ -309,7 +305,6 @@ export interface AhrefsRankTrackerSerpOverviewResponse extends ToolResponse { } } -// Rank Tracker Competitors Overview tool types export interface AhrefsRankTrackerCompetitorsOverviewParams extends AhrefsBaseParams { projectId: number date: string @@ -341,7 +336,6 @@ export interface AhrefsRankTrackerCompetitorsOverviewResponse extends ToolRespon } } -// Rank Tracker Competitors Stats tool types export interface AhrefsRankTrackerCompetitorsStatsParams extends AhrefsBaseParams { projectId: number date: string @@ -366,9 +360,9 @@ export interface AhrefsRankTrackerCompetitorsStatsResponse extends ToolResponse } } -// Batch Analysis tool types export interface AhrefsBatchAnalysisParams extends AhrefsBaseParams { - targets: string // Comma-separated list of domains/URLs + /** Comma-separated list of domains/URLs */ + targets: string mode?: AhrefsTargetMode protocol?: 'both' | 'http' | 'https' country?: string @@ -394,10 +388,10 @@ export interface AhrefsBatchAnalysisResponse extends ToolResponse { } } -// Site Audit Page Explorer tool types export interface AhrefsSiteAuditPageExplorerParams extends AhrefsBaseParams { projectId: number - date?: string // ISO date-time (YYYY-MM-DDThh:mm:ss), defaults to most recent crawl + /** ISO date-time (YYYY-MM-DDThh:mm:ss), defaults to most recent crawl */ + date?: string limit?: number offset?: number issueId?: string @@ -420,7 +414,6 @@ export interface AhrefsSiteAuditPageExplorerResponse extends ToolResponse { } } -// Domain Rating History tool types export interface AhrefsDomainRatingHistoryParams extends AhrefsBaseParams { target: string dateFrom: string @@ -439,7 +432,6 @@ export interface AhrefsDomainRatingHistoryResponse extends ToolResponse { } } -// Metrics History tool types export interface AhrefsMetricsHistoryParams extends AhrefsBaseParams { target: string dateFrom: string @@ -464,7 +456,6 @@ export interface AhrefsMetricsHistoryResponse extends ToolResponse { } } -// Referring Domains History tool types export interface AhrefsRefdomainsHistoryParams extends AhrefsBaseParams { target: string dateFrom: string @@ -484,7 +475,6 @@ export interface AhrefsRefdomainsHistoryResponse extends ToolResponse { } } -// Keywords History tool types export interface AhrefsKeywordsHistoryParams extends AhrefsBaseParams { target: string dateFrom: string @@ -509,7 +499,6 @@ export interface AhrefsKeywordsHistoryResponse extends ToolResponse { } } -// Related Terms tool types export interface AhrefsRelatedTermsParams extends AhrefsBaseParams { keyword: string country?: string @@ -535,7 +524,6 @@ export interface AhrefsRelatedTermsResponse extends ToolResponse { } } -// Anchors tool types export interface AhrefsAnchorsParams extends AhrefsBaseParams { target: string mode?: AhrefsTargetMode @@ -558,12 +546,12 @@ export interface AhrefsAnchorsResponse extends ToolResponse { } } -// Paid Pages tool types export interface AhrefsPaidPagesParams extends AhrefsBaseParams { target: string country?: string mode?: AhrefsTargetMode - date?: string // Date in YYYY-MM-DD format, defaults to today + /** Date in YYYY-MM-DD format, defaults to today */ + date?: string limit?: number } @@ -582,7 +570,6 @@ export interface AhrefsPaidPagesResponse extends ToolResponse { } } -// Union type for all possible responses export type AhrefsResponse = | AhrefsDomainRatingResponse | AhrefsBacklinksResponse diff --git a/apps/sim/tools/clerk/types.ts b/apps/sim/tools/clerk/types.ts index 72ea1e8a23d..1f6d04abe5d 100644 --- a/apps/sim/tools/clerk/types.ts +++ b/apps/sim/tools/clerk/types.ts @@ -244,7 +244,6 @@ interface ClerkSessionOutput { updatedAt: number } -// List Users export interface ClerkListUsersParams { secretKey: string limit?: number @@ -266,7 +265,6 @@ export interface ClerkListUsersResponse extends ToolResponse { } } -// Get User export interface ClerkGetUserParams { secretKey: string userId: string @@ -305,7 +303,6 @@ export interface ClerkGetUserResponse extends ToolResponse { } } -// Create User export interface ClerkCreateUserParams { secretKey: string emailAddress?: string | string[] @@ -341,7 +338,6 @@ export interface ClerkCreateUserResponse extends ToolResponse { } } -// Update User export interface ClerkUpdateUserParams { secretKey: string userId: string @@ -379,7 +375,6 @@ export interface ClerkUpdateUserResponse extends ToolResponse { } } -// Delete User export interface ClerkDeleteUserParams { secretKey: string userId: string @@ -394,7 +389,6 @@ export interface ClerkDeleteUserResponse extends ToolResponse { } } -// List Organizations export interface ClerkListOrganizationsParams { secretKey: string limit?: number @@ -412,7 +406,6 @@ export interface ClerkListOrganizationsResponse extends ToolResponse { } } -// Get Organization export interface ClerkGetOrganizationParams { secretKey: string organizationId: string @@ -437,7 +430,6 @@ export interface ClerkGetOrganizationResponse extends ToolResponse { } } -// Create Organization export interface ClerkCreateOrganizationParams { secretKey: string name: string @@ -467,7 +459,6 @@ export interface ClerkCreateOrganizationResponse extends ToolResponse { } } -// List Sessions export interface ClerkListSessionsParams { secretKey: string userId?: string @@ -493,7 +484,6 @@ export interface ClerkListSessionsResponse extends ToolResponse { } } -// Get Session export interface ClerkGetSessionParams { secretKey: string sessionId: string @@ -515,7 +505,6 @@ export interface ClerkGetSessionResponse extends ToolResponse { } } -// Revoke Session export interface ClerkRevokeSessionParams { secretKey: string sessionId: string @@ -537,7 +526,6 @@ export interface ClerkRevokeSessionResponse extends ToolResponse { } } -// Update Organization export interface ClerkUpdateOrganizationParams { secretKey: string organizationId: string @@ -566,7 +554,6 @@ export interface ClerkUpdateOrganizationResponse extends ToolResponse { } } -// Delete Organization export interface ClerkDeleteOrganizationParams { secretKey: string organizationId: string @@ -629,7 +616,6 @@ interface ClerkOrganizationMembershipOutput { updatedAt: number } -// List Organization Memberships export interface ClerkListOrganizationMembershipsParams { secretKey: string organizationId: string @@ -647,7 +633,6 @@ export interface ClerkListOrganizationMembershipsResponse extends ToolResponse { } } -// Add Organization Member (create membership) export interface ClerkAddOrganizationMemberParams { secretKey: string organizationId: string @@ -659,7 +644,6 @@ export interface ClerkAddOrganizationMemberResponse extends ToolResponse { output: ClerkOrganizationMembershipOutput & { success: boolean } } -// Update Organization Membership (change role) export interface ClerkUpdateOrganizationMembershipParams { secretKey: string organizationId: string @@ -671,7 +655,6 @@ export interface ClerkUpdateOrganizationMembershipResponse extends ToolResponse output: ClerkOrganizationMembershipOutput & { success: boolean } } -// Remove Organization Member (delete membership) export interface ClerkRemoveOrganizationMemberParams { secretKey: string organizationId: string @@ -730,7 +713,6 @@ interface ClerkOrganizationInvitationOutput { updatedAt: number } -// Create Organization Invitation export interface ClerkCreateOrganizationInvitationParams { secretKey: string organizationId: string @@ -748,7 +730,6 @@ export interface ClerkCreateOrganizationInvitationResponse extends ToolResponse output: ClerkOrganizationInvitationOutput & { success: boolean } } -// List Organization Invitations export interface ClerkListOrganizationInvitationsParams { secretKey: string organizationId: string @@ -778,7 +759,6 @@ interface ClerkUserModerationOutput { updatedAt: number } -// Ban User export interface ClerkBanUserParams { secretKey: string userId: string @@ -788,7 +768,6 @@ export interface ClerkBanUserResponse extends ToolResponse { output: ClerkUserModerationOutput & { success: boolean } } -// Unban User export interface ClerkUnbanUserParams { secretKey: string userId: string @@ -798,7 +777,6 @@ export interface ClerkUnbanUserResponse extends ToolResponse { output: ClerkUserModerationOutput & { success: boolean } } -// Lock User export interface ClerkLockUserParams { secretKey: string userId: string @@ -808,7 +786,6 @@ export interface ClerkLockUserResponse extends ToolResponse { output: ClerkUserModerationOutput & { success: boolean } } -// Unlock User export interface ClerkUnlockUserParams { secretKey: string userId: string @@ -832,7 +809,6 @@ export interface ClerkOAuthAccessToken { scopes?: string[] } -// Get User OAuth Access Token export interface ClerkGetUserOauthTokenParams { secretKey: string userId: string @@ -895,7 +871,6 @@ interface ClerkBlocklistIdentifierOutput { updatedAt: number } -// List Allowlist Identifiers export interface ClerkListAllowlistIdentifiersParams { secretKey: string limit?: number @@ -910,7 +885,6 @@ export interface ClerkListAllowlistIdentifiersResponse extends ToolResponse { } } -// Create Allowlist Identifier export interface ClerkCreateAllowlistIdentifierParams { secretKey: string identifier: string @@ -921,7 +895,6 @@ export interface ClerkCreateAllowlistIdentifierResponse extends ToolResponse { output: ClerkAllowlistIdentifierOutput & { success: boolean } } -// Delete Allowlist Identifier export interface ClerkDeleteAllowlistIdentifierParams { secretKey: string identifierId: string @@ -936,7 +909,6 @@ export interface ClerkDeleteAllowlistIdentifierResponse extends ToolResponse { } } -// List Blocklist Identifiers export interface ClerkListBlocklistIdentifiersParams { secretKey: string } @@ -949,7 +921,6 @@ export interface ClerkListBlocklistIdentifiersResponse extends ToolResponse { } } -// Create Blocklist Identifier export interface ClerkCreateBlocklistIdentifierParams { secretKey: string identifier: string @@ -959,7 +930,6 @@ export interface ClerkCreateBlocklistIdentifierResponse extends ToolResponse { output: ClerkBlocklistIdentifierOutput & { success: boolean } } -// Delete Blocklist Identifier export interface ClerkDeleteBlocklistIdentifierParams { secretKey: string identifierId: string @@ -1002,7 +972,6 @@ interface ClerkJwtTemplateOutput { updatedAt: number } -// List JWT Templates export interface ClerkListJwtTemplatesParams { secretKey: string } @@ -1015,7 +984,6 @@ export interface ClerkListJwtTemplatesResponse extends ToolResponse { } } -// Get JWT Template export interface ClerkGetJwtTemplateParams { secretKey: string templateId: string @@ -1052,7 +1020,6 @@ interface ClerkActorTokenOutput { updatedAt: number } -// Create Actor Token export interface ClerkCreateActorTokenParams { secretKey: string userId: string @@ -1065,7 +1032,6 @@ export interface ClerkCreateActorTokenResponse extends ToolResponse { output: ClerkActorTokenOutput & { success: boolean } } -// Revoke Actor Token export interface ClerkRevokeActorTokenParams { secretKey: string actorTokenId: string @@ -1075,7 +1041,7 @@ export interface ClerkRevokeActorTokenResponse extends ToolResponse { output: ClerkActorTokenOutput & { success: boolean } } -// Generic response type for the block +/** Union of every Clerk tool response, used by the block. */ export type ClerkResponse = | ClerkListUsersResponse | ClerkGetUserResponse diff --git a/apps/sim/tools/datadog/types.ts b/apps/sim/tools/datadog/types.ts index ee9699be1fa..97883919bd5 100644 --- a/apps/sim/tools/datadog/types.ts +++ b/apps/sim/tools/datadog/types.ts @@ -1,7 +1,5 @@ -// Common types for Datadog tools import type { ToolResponse } from '@/tools/types' -// Datadog Site/Region options /** * Regional sites Datadog serves the API from, per the `site` server variable enum. * @@ -24,13 +22,13 @@ export const DATADOG_SITES = [ export type DatadogSite = (typeof DATADOG_SITES)[number] -// Base parameters for write-only operations (only need API key) +/** Base parameters for write-only operations (only need API key) */ interface DatadogWriteOnlyParams { apiKey: string site?: DatadogSite } -// Base parameters for read/manage operations (need both API key and Application key) +/** Base parameters for read/manage operations (need both API key and Application key) */ interface DatadogBaseParams extends DatadogWriteOnlyParams { applicationKey: string } @@ -45,8 +43,6 @@ export interface DatadogV2Resource { attributes?: TAttributes } -// METRICS TYPES - export type MetricType = 'gauge' | 'rate' | 'count' | 'distribution' export interface MetricPoint { @@ -67,7 +63,8 @@ export interface MetricSeries { } export interface SubmitMetricsParams extends DatadogWriteOnlyParams { - series: string // JSON string of MetricSeries[] + /** JSON string of MetricSeries[] */ + series: string } interface SubmitMetricsOutput { @@ -81,8 +78,10 @@ export interface SubmitMetricsResponse extends ToolResponse { export interface QueryTimeseriesParams extends DatadogBaseParams { query: string - from: number // Unix timestamp in seconds - to: number // Unix timestamp in seconds + /** Unix timestamp in seconds */ + from: number + /** Unix timestamp in seconds */ + to: number } interface TimeseriesPoint { @@ -117,8 +116,6 @@ export interface QueryTimeseriesResponse extends ToolResponse { output: QueryTimeseriesOutput } -// EVENTS TYPES - export type EventAlertType = | 'error' | 'warning' @@ -135,10 +132,12 @@ export interface CreateEventParams extends DatadogWriteOnlyParams { alertType?: EventAlertType priority?: EventPriority host?: string - tags?: string // Comma-separated tags + /** Comma-separated tags */ + tags?: string aggregationKey?: string sourceTypeName?: string - dateHappened?: number // Unix timestamp + /** Unix timestamp */ + dateHappened?: number } export interface EventData { @@ -161,8 +160,6 @@ export interface CreateEventResponse extends ToolResponse { output: CreateEventOutput } -// MONITORS TYPES - export type MonitorType = | 'metric alert' | 'service check' @@ -203,9 +200,12 @@ export interface CreateMonitorParams extends DatadogBaseParams { type: MonitorType query: string message?: string - tags?: string // Comma-separated tags - priority?: number // 1-5 - options?: string // JSON string of MonitorOptions + /** Comma-separated tags */ + tags?: string + /** 1-5 */ + priority?: number + /** JSON string of MonitorOptions */ + options?: string } export interface MonitorData { @@ -233,7 +233,8 @@ export interface CreateMonitorResponse extends ToolResponse { export interface GetMonitorParams extends DatadogBaseParams { monitorId: string - groupStates?: string // Comma-separated states: alert, warn, no data + /** Comma-separated states: alert, warn, no data */ + groupStates?: string withDowntimes?: boolean } @@ -246,10 +247,13 @@ export interface GetMonitorResponse extends ToolResponse { } export interface ListMonitorsParams extends DatadogBaseParams { - groupStates?: string // Comma-separated states - name?: string // Filter by name - tags?: string // Filter by tags (comma-separated) - monitorTags?: string // Filter by monitor tags + /** Comma-separated states */ + groupStates?: string + name?: string + /** Filter by tags (comma-separated) */ + tags?: string + /** Filter by monitor tags */ + monitorTags?: string withDowntimes?: boolean idOffset?: number page?: number @@ -297,8 +301,6 @@ export interface UnmuteMonitorResponse extends ToolResponse { output: MonitorMuteOutput } -// LOGS TYPES - /** * One entry for the Datadog log intake. Datadog treats any key beyond the reserved * ones as a structured log attribute, so extra properties are carried through. @@ -313,7 +315,8 @@ export interface LogEntry { } export interface SendLogsParams extends DatadogWriteOnlyParams { - logs: string // JSON string of LogEntry[] + /** JSON string of LogEntry[] */ + logs: string } interface SendLogsOutput { @@ -326,12 +329,15 @@ export interface SendLogsResponse extends ToolResponse { export interface QueryLogsParams extends DatadogBaseParams { query: string - from: string // ISO-8601 or relative (now-1h) - to: string // ISO-8601 or relative (now) + /** ISO-8601 or relative (now-1h) */ + from: string + /** ISO-8601 or relative (now) */ + to: string limit?: number cursor?: string sort?: 'timestamp' | '-timestamp' - indexes?: string // Comma-separated index names + /** Comma-separated index names */ + indexes?: string } /** Attributes of a v2 log event (`LogAttributes` in the Datadog v2 schema). */ @@ -359,16 +365,19 @@ export interface QueryLogsResponse extends ToolResponse { output: QueryLogsOutput } -// DOWNTIME TYPES - export interface CreateDowntimeParams extends DatadogBaseParams { - scope: string // Scope to apply downtime (e.g., "host:myhost" or "*") + /** Scope to apply downtime (e.g., "host:myhost" or "*") */ + scope: string message?: string - start?: number // Unix timestamp, defaults to now - end?: number // Unix timestamp + /** Unix timestamp, defaults to now */ + start?: number + /** Unix timestamp */ + end?: number timezone?: string - monitorId?: string // Monitor ID to mute - monitorTags?: string // Comma-separated tags to match monitors + /** Monitor ID to mute */ + monitorId?: string + /** Comma-separated tags to match monitors */ + monitorTags?: string muteFirstRecoveryNotification?: boolean } @@ -433,7 +442,6 @@ interface CancelDowntimeOutput { export interface CancelDowntimeResponse extends ToolResponse { output: CancelDowntimeOutput } -// SLO TYPES export type SloType = 'metric' | 'monitor' | 'time_slice' @@ -596,8 +604,6 @@ export interface GetSloHistoryResponse extends ToolResponse { output: GetSloHistoryOutput } -// DASHBOARD TYPES - export type DashboardLayoutType = 'ordered' | 'free' interface DashboardData { @@ -690,8 +696,6 @@ export interface DeleteDashboardResponse extends ToolResponse { output: DeleteDashboardOutput } -// SYNTHETICS TYPES - export type SyntheticsTestPauseStatus = 'live' | 'paused' export interface SyntheticsTestData { @@ -826,8 +830,6 @@ export interface UpdateSyntheticsStatusResponse extends ToolResponse { output: UpdateSyntheticsStatusOutput } -// SECURITY MONITORING TYPES - export type SecuritySignalState = 'open' | 'archived' | 'under_review' export type SecuritySignalArchiveReason = @@ -950,8 +952,6 @@ export interface ListSecurityRulesResponse extends ToolResponse { output: ListSecurityRulesOutput } -// APM / SPANS TYPES - export interface SearchSpansParams extends DatadogBaseParams { query?: string from?: string @@ -1027,8 +1027,6 @@ export interface ListServicesResponse extends ToolResponse { output: ListServicesOutput } -// INCIDENTS TYPES - export type IncidentSeverity = 'UNKNOWN' | 'SEV-0' | 'SEV-1' | 'SEV-2' | 'SEV-3' | 'SEV-4' | 'SEV-5' interface IncidentFieldValue { @@ -1166,7 +1164,6 @@ export interface AddIncidentTodoResponse extends ToolResponse { output: AddIncidentTodoOutput } -// Union type for all Datadog responses export type DatadogResponse = | SubmitMetricsResponse | QueryTimeseriesResponse diff --git a/apps/sim/tools/github/types.ts b/apps/sim/tools/github/types.ts index 96267acd12e..df90bbec62c 100644 --- a/apps/sim/tools/github/types.ts +++ b/apps/sim/tools/github/types.ts @@ -844,14 +844,12 @@ export const PR_SUMMARY_OUTPUT_PROPERTIES = { merged_at: { type: 'string', description: 'Merge timestamp', optional: true }, } as const satisfies Record -// Base parameters shared by all GitHub operations export interface BaseGitHubParams { owner: string repo: string apiKey: string } -// PR operation parameters export interface PROperationParams extends BaseGitHubParams { pullNumber: number } @@ -862,7 +860,6 @@ export interface PRV2OperationParams extends PROperationParams { includeFiles?: boolean } -// Comment operation parameters export interface CreateCommentParams extends PROperationParams { body: string path?: string @@ -872,12 +869,10 @@ export interface CreateCommentParams extends PROperationParams { commentType?: 'pr_comment' | 'file_comment' } -// Latest commit parameters export interface LatestCommitParams extends BaseGitHubParams { branch?: string } -// Create PR parameters export interface CreatePRParams extends BaseGitHubParams { title: string head: string @@ -886,7 +881,6 @@ export interface CreatePRParams extends BaseGitHubParams { draft?: boolean } -// Update PR parameters export interface UpdatePRParams extends BaseGitHubParams { pullNumber: number title?: string @@ -895,7 +889,6 @@ export interface UpdatePRParams extends BaseGitHubParams { base?: string } -// Merge PR parameters export interface MergePRParams extends BaseGitHubParams { pullNumber: number commit_title?: string @@ -903,7 +896,6 @@ export interface MergePRParams extends BaseGitHubParams { merge_method?: 'merge' | 'squash' | 'rebase' } -// List PRs parameters export interface ListPRsParams extends BaseGitHubParams { state?: 'open' | 'closed' | 'all' head?: string @@ -914,19 +906,16 @@ export interface ListPRsParams extends BaseGitHubParams { page?: number } -// Get PR files parameters export interface GetPRFilesParams extends BaseGitHubParams { pullNumber: number per_page?: number page?: number } -// Close PR parameters export interface ClosePRParams extends BaseGitHubParams { pullNumber: number } -// Request reviewers parameters export interface RequestReviewersParams extends BaseGitHubParams { pullNumber: number reviewers?: string @@ -936,7 +925,6 @@ export interface RequestReviewersParams extends BaseGitHubParams { /** Inline review comment attached to a submitted PR review. */ export type CreatePRReviewComment = ReviewComment -// Create PR review parameters export interface CreatePRReviewParams extends BaseGitHubParams { pullNumber: number event: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT' @@ -946,7 +934,6 @@ export interface CreatePRReviewParams extends BaseGitHubParams { comments?: CreatePRReviewComment[] } -// Response metadata interfaces interface BasePRMetadata { number: number title: string @@ -1103,7 +1090,6 @@ interface RepoMetadata { language: string } -// PR operation response metadata interface PRMetadata { number: number title: string @@ -1161,7 +1147,6 @@ interface ReviewersMetadata { }> } -// Response types export interface PullRequestResponse extends ToolResponse { output: { content: string @@ -1195,7 +1180,6 @@ export interface RepoInfoResponse extends ToolResponse { } } -// Issue comment operation parameters export interface CreateIssueCommentParams extends BaseGitHubParams { issue_number: number body: string @@ -1226,7 +1210,6 @@ export interface ListPRCommentsParams extends BaseGitHubParams { page?: number } -// Branch operation parameters export interface ListBranchesParams extends BaseGitHubParams { protected?: boolean per_page?: number @@ -1278,7 +1261,6 @@ export interface UpdateBranchProtectionParams extends BaseGitHubParams { | null } -// Issue comment response metadata interface IssueCommentMetadata { id: number html_url: string @@ -1302,7 +1284,6 @@ interface CommentsListMetadata { total_count: number } -// Response types for new tools export interface IssueCommentResponse extends ToolResponse { output: { content: string @@ -1327,7 +1308,6 @@ export interface DeleteCommentResponse extends ToolResponse { } } -// New PR operation response types export interface PRResponse extends ToolResponse { output: { content: string @@ -1363,7 +1343,6 @@ export interface ReviewersResponse extends ToolResponse { } } -// Branch response metadata interface BranchMetadata { name: string commit: { @@ -1415,7 +1394,6 @@ interface DeleteBranchMetadata { branch: string } -// Branch response types export interface BranchResponse extends ToolResponse { output: { content: string @@ -1451,7 +1429,6 @@ export interface DeleteBranchResponse extends ToolResponse { } } -// GitHub Projects V2 parameters export interface ListProjectsParams { owner_type: 'org' | 'user' owner_login: string @@ -1485,7 +1462,6 @@ export interface DeleteProjectParams { apiKey: string } -// GitHub Projects V2 response metadata interface ProjectMetadata { id: string title: string @@ -1496,7 +1472,6 @@ interface ProjectMetadata { shortDescription?: string } -// GitHub Projects V2 response types export interface ListProjectsResponse extends ToolResponse { output: { content: string @@ -1514,7 +1489,6 @@ export interface ProjectResponse extends ToolResponse { } } -// Workflow operation parameters export interface ListWorkflowsParams extends BaseGitHubParams { per_page?: number page?: number @@ -1553,7 +1527,6 @@ export interface RerunWorkflowParams extends BaseGitHubParams { enable_debug_logging?: boolean } -// Workflow response metadata interfaces interface WorkflowMetadata { id: number name: string @@ -1594,7 +1567,6 @@ interface ListWorkflowRunsMetadata { }> } -// Workflow response types export interface WorkflowResponse extends ToolResponse { output: { content: string @@ -1650,21 +1622,17 @@ export interface RerunWorkflowResponse extends ToolResponse { } } -// Get latest release parameters export type GetLatestReleaseParams = BaseGitHubParams -// List tags parameters export interface ListTagsParams extends BaseGitHubParams { per_page?: number page?: number } -// Get README parameters export interface GetReadmeParams extends BaseGitHubParams { ref?: string } -// Create PR review response export interface PRReviewResponse extends ToolResponse { output: { content: string @@ -1678,7 +1646,6 @@ export interface PRReviewResponse extends ToolResponse { } } -// List tags response export interface TagsListResponse extends ToolResponse { output: { content: string @@ -1694,7 +1661,6 @@ export interface TagsListResponse extends ToolResponse { } } -// Get README response export interface ReadmeResponse extends ToolResponse { output: { content: string @@ -1745,7 +1711,6 @@ export type GitHubResponse = | IssuesListResponse | LabelsResponse -// Release operation parameters export interface CreateReleaseParams extends BaseGitHubParams { tag_name: string target_commitish?: string @@ -1778,7 +1743,6 @@ export interface DeleteReleaseParams extends BaseGitHubParams { release_id: number } -// Release metadata interface interface ReleaseMetadata { id: number tag_name: string @@ -1792,7 +1756,6 @@ interface ReleaseMetadata { published_at: string } -// Response types for releases export interface ReleaseResponse extends ToolResponse { output: { content: string @@ -1820,7 +1783,6 @@ export interface DeleteReleaseResponse extends ToolResponse { } } -// Issue operation parameters export interface CreateIssueParams extends BaseGitHubParams { title: string body?: string @@ -1873,7 +1835,6 @@ export interface AddAssigneesParams extends BaseGitHubParams { assignees: string } -// Issue response metadata interface IssueMetadata { number: number title: string @@ -1908,7 +1869,6 @@ interface LabelsMetadata { html_url: string } -// Issue response types export interface IssueResponse extends ToolResponse { output: { content: string @@ -1962,7 +1922,6 @@ export interface GetTreeParams extends BaseGitHubParams { ref?: string } -// File/Content metadata interfaces interface FileContentMetadata { name: string path: string @@ -1999,7 +1958,6 @@ interface TreeItemMetadata { html_url?: string } -// Response types export interface FileContentResponse extends ToolResponse { output: { content: string diff --git a/apps/sim/tools/index.ts b/apps/sim/tools/index.ts index d7fa5f42bce..45d94efbf52 100644 --- a/apps/sim/tools/index.ts +++ b/apps/sim/tools/index.ts @@ -399,8 +399,8 @@ async function resolveToolEnvReferences( // what lets a caller pass a real secret in the same field. // // Models improvise reference syntax: after `{{NAME}}`, the bare variable name - // is the common fallback — it previously went upstream as the literal - // credential and failed with an undiagnosable 401. So under + // is the common fallback, and sent upstream as the literal credential it + // fails with an undiagnosable 401. So under // `explicit-and-bare` a bare name is a reference too, but only when a variable // by that exact name exists (`soft`), since plenty of real API keys match the // identifier pattern. `$NAME` is deliberately NOT a reference — real @@ -565,7 +565,6 @@ async function injectHostedKeyIfNeeded( const { workspaceId, userId, workflowId } = resolveToolScope(params, executionContext) - // Check BYOK workspace key first if (byokProviderId && workspaceId) { try { const byokResult = await getBYOKKey(workspaceId, byokProviderId as BYOKProviderId) @@ -619,7 +618,6 @@ async function injectHostedKeyIfNeeded( ) } - // Handle no keys configured (503) if (!acquireResult.success) { logger.error(`[${requestId}] No hosted keys configured for ${tool.id}: ${acquireResult.error}`) throw new HostedKeyUnavailableError( @@ -799,7 +797,6 @@ async function executeWithRetry( const delayMs = backoffWithJitter(attempt + 1, null, { baseMs: baseDelayMs }) - // Track throttling event via telemetry PlatformEvents.hostedKeyRateLimited({ toolId, envVarName, @@ -1706,7 +1703,6 @@ async function executeToolImplementation( resolvedSecretTraceRegistry: nestedOptions.resolvedSecretTraceRegistry ?? resolvedSecretTraceRegistry, }) - // Capture start time for precise timing const startTime = new Date() const startTimeISO = startTime.toISOString() const requestId = generateRequestId() @@ -1821,7 +1817,6 @@ async function executeToolImplementation( effectiveSignal ) } else { - // For built-in tools, use the synchronous version tool = getTool(normalizedToolId) if (!tool) { logger.error(`[${requestId}] Built-in tool not found: ${normalizedToolId}`) @@ -1832,7 +1827,6 @@ async function executeToolImplementation( tool = projectAssistantConnectedAccountTool(tool) } - // Ensure context is preserved if it exists const contextParams = { ...params } for (const paramId of tool?.oauth?.authoritativeParams ?? []) { contextParams[paramId] = undefined @@ -1844,10 +1838,8 @@ async function executeToolImplementation( } } - // Validate the tool and its parameters validateRequiredParametersAfterMerge(toolId, tool, contextParams) - // After validation, we know tool exists if (!tool) { throw new Error(`Tool not found: ${toolId}`) } @@ -1857,7 +1849,6 @@ async function executeToolImplementation( enforceCopilotCredentialSelection(toolId, tool, contextParams, scope) await resolveToolEnvReferences(tool, contextParams, scope, resolvedSecretTraceRegistry) - // Inject hosted API key if tool supports it and user didn't provide one const hostedKeyInfo = await injectHostedKeyIfNeeded( tool, contextParams, @@ -1873,7 +1864,6 @@ async function executeToolImplementation( } } - // If we have a credential parameter, fetch the access token if (contextParams.oauthCredential) { contextParams.credential = contextParams.oauthCredential } @@ -2025,7 +2015,6 @@ async function executeToolImplementation( if (workflowId) { ;(contextParams as any)._workflowId = workflowId } - // Clean up params we don't need to pass to the actual tool contextParams.credential = undefined contextParams.impersonateUserEmail = undefined if (contextParams.workflowId) contextParams.workflowId = undefined @@ -2043,10 +2032,9 @@ async function executeToolImplementation( // dynamic executor import in the tool descriptor itself would break the client // build — and with it `getTool('workflow_executor')`). // Workflow-as-agent-tool runs in-process through WorkflowBlockHandler — - // the same invocation boundary canvas child workflows use. Replaces the - // historical HTTP hop to /api/workflows/{id}/execute (double admission - // slot + duplicate top-level log row); billing/observability now match the - // canvas workflow block. + // the same invocation boundary canvas child workflows use — so it takes one + // admission slot and one top-level log row, and billing/observability match + // the canvas workflow block. if (normalizedToolId === 'workflow_executor') { logger.info(`[${requestId}] Running workflow tool ${toolId} in-process`) const { runWorkflowTool } = await import('@/executor/handlers/workflow/workflow-tool-runner') @@ -2195,7 +2183,6 @@ async function executeToolImplementation( } } - // Wrap external requests with hosted-key retry and reacquisition. const result = hostedKeyInfo.isUsingHostedKey ? await executeWithRetry( () => @@ -2245,7 +2232,6 @@ async function executeToolImplementation( resolvedSecretTraceRegistry ) - // Apply post-processing if available and not skipped let finalResult = result if (tool.postProcess && result.success && !skipPostProcess) { try { @@ -2276,7 +2262,6 @@ async function executeToolImplementation( effectiveSignal ) - // Add timing data to the result const endTime = new Date() const endTimeISO = endTime.toISOString() const duration = endTime.getTime() - startTime.getTime() @@ -2337,7 +2322,6 @@ async function executeToolImplementation( }) } - // Default error handling let errorMessage = 'Unknown error occurred' let errorDetails = {} @@ -2360,7 +2344,6 @@ async function executeToolImplementation( } else if (typeof error === 'string') { errorMessage = error } else if (error && typeof error === 'object') { - // Handle HTTP response errors if (error.status) { errorMessage = `HTTP ${error.status}: ${error.statusText || 'Request failed'}` @@ -2383,13 +2366,10 @@ async function executeToolImplementation( statusText: error.statusText, data: error.data, } - } - // Handle other errors with messages - else if (error.message) { + } else if (error.message) { // Don't pass along "undefined (undefined)" messages if (error.message === 'undefined (undefined)') { errorMessage = `Error executing tool ${toolId}` - // Add status if available if (error.status) { errorMessage += ` (Status: ${error.status})` } @@ -2403,7 +2383,6 @@ async function executeToolImplementation( } } - // Add timing data even for errors const endTime = new Date() const endTimeISO = endTime.toISOString() const duration = endTime.getTime() - startTime.getTime() @@ -2442,7 +2421,6 @@ function isErrorResponse( response: Response | any, data?: any ): { isError: boolean; errorInfo?: { status?: number; statusText?: string; data?: any } } { - // HTTP Response object if (response && typeof response === 'object' && 'ok' in response) { if (!response.ok) { return { @@ -2457,7 +2435,6 @@ function isErrorResponse( return { isError: false } } - // ToolResponse object if (response && typeof response === 'object' && 'success' in response) { return { isError: !response.success, @@ -2465,7 +2442,6 @@ function isErrorResponse( } } - // Check for error indicators in data if (data && typeof data === 'object') { if (data.error || data.success === false) { return { @@ -2836,10 +2812,8 @@ async function executeToolRequest( } } - // Check request body size before sending to detect potential size limit issues validateRequestBodySize(requestParams.body, requestId, toolId) - // Convert Headers to plain object for secureFetchWithPinnedIP const headersRecord: Record = {} headers.forEach((value, key) => { headersRecord[key] = value @@ -3071,11 +3045,9 @@ async function executeToolRequest( } } - // Check for error conditions const { isError, errorInfo } = isErrorResponse(response, responseData) if (isError) { - // Handle error case const errorToTransform = createTransformedErrorFromErrorInfo(errorInfo, tool.errorExtractor) logger.error( @@ -3097,7 +3069,6 @@ async function executeToolRequest( throw errorToTransform } - // Success case: use transformResponse if available if (tool.transformResponse) { try { // Forward the real body stream. Some transformResponse helpers (e.g. TikTok) @@ -3159,7 +3130,6 @@ async function executeToolRequest( } } - // Default success response handling return { success: true, output: responseData.output || responseData, @@ -3168,7 +3138,6 @@ async function executeToolRequest( } catch (error: any) { handleResponseSizeLimitError(error, requestId, toolId) - // Check if this is a body size limit error and throw user-friendly message handleBodySizeLimitError( error, requestId, @@ -3190,7 +3159,6 @@ async function executeToolRequest( ) ) - // Let the error bubble up to be handled in the main executeTool function throw error } } @@ -3210,7 +3178,6 @@ function validateClientSideParams( throw new Error('Invalid schema format') } - // Internal parameters that should be excluded from validation const internalParamSet = new Set([ '_context', '_toolSchema', @@ -3221,7 +3188,6 @@ function validateClientSideParams( 'blockNameMapping', ]) - // Check required parameters if (schema.required) { for (const requiredParam of schema.required) { if (!(requiredParam in params)) { @@ -3230,9 +3196,7 @@ function validateClientSideParams( } } - // Check parameter types (basic validation) for (const [paramName, paramValue] of Object.entries(params)) { - // Skip validation for internal parameters if (internalParamSet.has(paramName)) { continue } @@ -3242,7 +3206,6 @@ function validateClientSideParams( throw new Error(`Unknown parameter: ${paramName}`) } - // Basic type checking const type = paramSchema.type if (type === 'string' && typeof paramValue !== 'string') { throw new Error(`Parameter ${paramName} should be a string`) diff --git a/apps/sim/tools/kalshi/types.ts b/apps/sim/tools/kalshi/types.ts index 0c60cacbad9..729d9c5e7d2 100644 --- a/apps/sim/tools/kalshi/types.ts +++ b/apps/sim/tools/kalshi/types.ts @@ -1,7 +1,6 @@ import crypto from 'crypto' import type { OutputProperty } from '@/tools/types' -// Base URL for Kalshi API export const KALSHI_BASE_URL = 'https://api.elections.kalshi.com/trade-api/v2' /** @@ -235,24 +234,22 @@ export const KALSHI_PAGING_OUTPUT_PROPERTIES = { cursor: { type: 'string', description: 'Cursor for fetching next page', optional: true }, } as const satisfies Record -// Base params for authenticated endpoints export interface KalshiAuthParams { - keyId: string // API Key ID - privateKey: string // RSA Private Key (PEM format) + keyId: string + /** RSA private key (PEM format) */ + privateKey: string } -// Pagination params export interface KalshiPaginationParams { - limit?: string // 1-1000, default 100 - cursor?: string // Pagination cursor + /** 1-1000, default 100 */ + limit?: string + cursor?: string } -// Pagination info in response export interface KalshiPagingInfo { cursor?: string | null } -// Generic response type interface KalshiResponse { success: boolean output: T & { @@ -265,7 +262,6 @@ interface KalshiResponse { } } -// Market type export interface KalshiMarket { ticker: string event_ticker: string @@ -295,7 +291,6 @@ export interface KalshiMarket { floor_strike?: number } -// Event type export interface KalshiEvent { event_ticker: string series_ticker: string @@ -308,13 +303,13 @@ export interface KalshiEvent { status?: string } -// Balance type interface KalshiBalance { - balance: number // In cents - portfolio_value: number // In cents + /** In cents */ + balance: number + /** In cents */ + portfolio_value: number } -// Position type export interface KalshiPosition { ticker: string event_ticker: string @@ -327,7 +322,6 @@ export interface KalshiPosition { resting_orders_count?: number } -// Order type export interface KalshiOrder { order_id: string ticker: string @@ -349,7 +343,6 @@ export interface KalshiOrder { taker_fees?: number } -// Orderbook type interface KalshiOrderbookLevel { price: number quantity: number @@ -360,7 +353,6 @@ export interface KalshiOrderbook { no: KalshiOrderbookLevel[] } -// Trade type export interface KalshiTrade { ticker: string yes_price: number @@ -370,7 +362,6 @@ export interface KalshiTrade { taker_side: string } -// Candlestick type export interface KalshiCandlestick { open_time: string close_time: string @@ -381,7 +372,6 @@ export interface KalshiCandlestick { volume: number } -// Fill type export interface KalshiFill { created_time: string ticker: string @@ -394,13 +384,11 @@ export interface KalshiFill { trade_id: string } -// Settlement source type interface KalshiSettlementSource { name: string url: string } -// Series type export interface KalshiSeries { ticker: string title: string @@ -410,48 +398,41 @@ export interface KalshiSeries { settlement_sources?: KalshiSettlementSource[] contract_url?: string contract_terms_url?: string - fee_type?: string // 'quadratic' | 'quadratic_with_maker_fees' | 'flat' + /** 'quadratic' | 'quadratic_with_maker_fees' | 'flat' */ + fee_type?: string fee_multiplier?: number additional_prohibitions?: string[] product_metadata?: Record } -// Exchange status type export interface KalshiExchangeStatus { trading_active: boolean exchange_active: boolean } -// Helper function to build Kalshi API URLs export function buildKalshiUrl(path: string): string { return `${KALSHI_BASE_URL}${path}` } -// Helper to normalize PEM key format -// Handles: literal \n strings, missing line breaks, various PEM formats +/** Normalizes a PEM key: literal `\n` strings, missing line breaks, and headerless base64. */ function normalizePemKey(privateKey: string): string { let key = privateKey.trim() - // Convert literal \n strings to actual newlines key = key.replace(/\\n/g, '\n') - // Extract the key type and base64 content const beginMatch = key.match(/-----BEGIN ([A-Z\s]+)-----/) const endMatch = key.match(/-----END ([A-Z\s]+)-----/) if (beginMatch && endMatch) { - // Extract the key type (e.g., "RSA PRIVATE KEY" or "PRIVATE KEY") const keyType = beginMatch[1] - // Extract base64 content between headers const startIdx = key.indexOf('-----', key.indexOf('-----') + 5) + 5 const endIdx = key.lastIndexOf('-----END') let base64Content = key.substring(startIdx, endIdx) - // Remove all whitespace from base64 content base64Content = base64Content.replace(/\s/g, '') - // Reconstruct PEM with proper 64-character line breaks + // PEM bodies wrap at 64 characters const lines: string[] = [] for (let i = 0; i < base64Content.length; i += 64) { lines.push(base64Content.substring(i, i + 64)) @@ -470,23 +451,21 @@ function normalizePemKey(privateKey: string): string { return `-----BEGIN PRIVATE KEY-----\n${lines.join('\n')}\n-----END PRIVATE KEY-----` } -// RSA-PSS signature generation for authenticated requests -// Kalshi requires RSA-PSS with SHA256, not plain PKCS#1 v1.5 +/** + * Signs `timestamp + METHOD + path` (query string excluded). Kalshi requires + * RSA-PSS with SHA-256, not plain PKCS#1 v1.5. + */ export function generateKalshiSignature( privateKey: string, timestamp: string, method: string, path: string ): string { - // Sign: timestamp + method + path (without query params) - // Strip query params from path for signing const pathWithoutQuery = path.split('?')[0] const message = timestamp + method.toUpperCase() + pathWithoutQuery - // Normalize PEM key format (handles literal \n, missing line breaks, etc.) const pemKey = normalizePemKey(privateKey) - // Use RSA-PSS padding with SHA256 (required by Kalshi API) const signature = crypto.sign('sha256', Buffer.from(message, 'utf-8'), { key: pemKey, padding: crypto.constants.RSA_PKCS1_PSS_PADDING, @@ -496,7 +475,6 @@ export function generateKalshiSignature( return signature.toString('base64') } -// Build auth headers for authenticated requests export function buildKalshiAuthHeaders( keyId: string, privateKey: string, @@ -514,7 +492,6 @@ export function buildKalshiAuthHeaders( } } -// Helper function for consistent error handling export function handleKalshiError(data: any, status: number, operation: string): never { const errorMessage = data.error?.message || data.error || data.message || data.detail || 'Unknown error' diff --git a/apps/sim/tools/okta/types.ts b/apps/sim/tools/okta/types.ts index 2a23689ac5d..f572459936a 100644 --- a/apps/sim/tools/okta/types.ts +++ b/apps/sim/tools/okta/types.ts @@ -114,7 +114,6 @@ interface OktaGroupOutput { lastMembershipUpdated: string | null } -// List Users export interface OktaListUsersParams extends OktaBaseParams { search?: string filter?: string @@ -132,7 +131,6 @@ export interface OktaListUsersResponse extends ToolResponse { } } -// Get User export interface OktaGetUserParams extends OktaBaseParams { userId: string } @@ -166,7 +164,6 @@ export interface OktaGetUserResponse extends ToolResponse { } } -// Create User export interface OktaCreateUserParams extends OktaBaseParams { firstName: string lastName: string @@ -193,7 +190,6 @@ export interface OktaCreateUserResponse extends ToolResponse { } } -// Update User export interface OktaUpdateUserParams extends OktaBaseParams { userId: string firstName?: string @@ -219,7 +215,6 @@ export interface OktaUpdateUserResponse extends ToolResponse { } } -// Deactivate User export interface OktaDeactivateUserParams extends OktaBaseParams { userId: string sendEmail?: boolean @@ -233,7 +228,6 @@ export interface OktaDeactivateUserResponse extends ToolResponse { } } -// List Groups export interface OktaListGroupsParams extends OktaBaseParams { search?: string filter?: string @@ -251,7 +245,6 @@ export interface OktaListGroupsResponse extends ToolResponse { } } -// Get Group export interface OktaGetGroupParams extends OktaBaseParams { groupId: string } @@ -269,7 +262,6 @@ export interface OktaGetGroupResponse extends ToolResponse { } } -// Add User to Group export interface OktaAddUserToGroupParams extends OktaBaseParams { groupId: string userId: string @@ -284,7 +276,6 @@ export interface OktaAddUserToGroupResponse extends ToolResponse { } } -// Remove User from Group export interface OktaRemoveUserFromGroupParams extends OktaBaseParams { groupId: string userId: string @@ -299,7 +290,6 @@ export interface OktaRemoveUserFromGroupResponse extends ToolResponse { } } -// List Group Members export interface OktaListGroupMembersParams extends OktaBaseParams { groupId: string after?: string @@ -316,7 +306,6 @@ export interface OktaListGroupMembersResponse extends ToolResponse { } } -// Suspend User export interface OktaSuspendUserParams extends OktaBaseParams { userId: string } @@ -329,7 +318,6 @@ export interface OktaSuspendUserResponse extends ToolResponse { } } -// Unsuspend User export interface OktaUnsuspendUserParams extends OktaBaseParams { userId: string } @@ -342,7 +330,6 @@ export interface OktaUnsuspendUserResponse extends ToolResponse { } } -// Activate User export interface OktaActivateUserParams extends OktaBaseParams { userId: string sendEmail?: boolean @@ -358,7 +345,6 @@ export interface OktaActivateUserResponse extends ToolResponse { } } -// Reset Password export interface OktaResetPasswordParams extends OktaBaseParams { userId: string sendEmail?: boolean @@ -372,7 +358,6 @@ export interface OktaResetPasswordResponse extends ToolResponse { } } -// Delete User export interface OktaDeleteUserParams extends OktaBaseParams { userId: string sendEmail?: boolean @@ -386,7 +371,6 @@ export interface OktaDeleteUserResponse extends ToolResponse { } } -// Create Group export interface OktaCreateGroupParams extends OktaBaseParams { name: string description?: string @@ -405,7 +389,6 @@ export interface OktaCreateGroupResponse extends ToolResponse { } } -// Update Group export interface OktaUpdateGroupParams extends OktaBaseParams { groupId: string name?: string @@ -425,7 +408,6 @@ export interface OktaUpdateGroupResponse extends ToolResponse { } } -// Delete Group export interface OktaDeleteGroupParams extends OktaBaseParams { groupId: string } @@ -744,7 +726,6 @@ interface OktaFactorOutput { profile: Record | null } -// List Factors export interface OktaListFactorsParams extends OktaBaseParams { userId: string } @@ -757,7 +738,6 @@ export interface OktaListFactorsResponse extends ToolResponse { } } -// Get Factor export interface OktaGetFactorParams extends OktaBaseParams { userId: string factorId: string @@ -767,7 +747,6 @@ export interface OktaGetFactorResponse extends ToolResponse { output: OktaFactorOutput & { success: boolean } } -// Reset Factor export interface OktaResetFactorParams extends OktaBaseParams { userId: string factorId: string @@ -783,7 +762,6 @@ export interface OktaResetFactorResponse extends ToolResponse { } } -// Reset All Factors export interface OktaResetAllFactorsParams extends OktaBaseParams { userId: string } @@ -796,7 +774,6 @@ export interface OktaResetAllFactorsResponse extends ToolResponse { } } -// Enroll Factor export interface OktaEnrollFactorParams extends OktaBaseParams { userId: string factorType: string @@ -812,7 +789,6 @@ export interface OktaEnrollFactorResponse extends ToolResponse { output: OktaFactorOutput & { enrolled: boolean; success: boolean } } -// Get Logs export interface OktaGetLogsParams extends OktaBaseParams { since?: string until?: string @@ -833,7 +809,6 @@ export interface OktaGetLogsResponse extends ToolResponse { } } -// Clear User Sessions export interface OktaClearUserSessionsParams extends OktaBaseParams { userId: string oauthTokens?: boolean @@ -848,7 +823,6 @@ export interface OktaClearUserSessionsResponse extends ToolResponse { } } -// Get Session export interface OktaGetSessionParams extends OktaBaseParams { sessionId: string } @@ -870,7 +844,6 @@ export interface OktaGetSessionResponse extends ToolResponse { } } -// Revoke Session export interface OktaRevokeSessionParams extends OktaBaseParams { sessionId: string } @@ -883,7 +856,6 @@ export interface OktaRevokeSessionResponse extends ToolResponse { } } -// List Applications export interface OktaListAppsParams extends OktaBaseParams { q?: string filter?: string @@ -902,7 +874,6 @@ export interface OktaListAppsResponse extends ToolResponse { } } -// Get Application export interface OktaGetAppParams extends OktaBaseParams { appId: string } @@ -925,7 +896,6 @@ export interface OktaGetAppResponse extends ToolResponse { } } -// List Application Users export interface OktaListAppUsersParams extends OktaBaseParams { appId: string q?: string @@ -943,7 +913,6 @@ export interface OktaListAppUsersResponse extends ToolResponse { } } -// Assign User to Application export interface OktaAssignUserToAppParams extends OktaBaseParams { appId: string userId: string @@ -955,7 +924,6 @@ export interface OktaAssignUserToAppResponse extends ToolResponse { output: OktaAppUserOutput & { assigned: boolean; success: boolean } } -// Remove User from Application export interface OktaRemoveUserFromAppParams extends OktaBaseParams { appId: string userId: string @@ -971,7 +939,6 @@ export interface OktaRemoveUserFromAppResponse extends ToolResponse { } } -// List Application Groups export interface OktaListAppGroupsParams extends OktaBaseParams { appId: string q?: string @@ -989,7 +956,6 @@ export interface OktaListAppGroupsResponse extends ToolResponse { } } -// Assign Group to Application export interface OktaAssignGroupToAppParams extends OktaBaseParams { appId: string groupId: string @@ -1007,7 +973,6 @@ export interface OktaAssignGroupToAppResponse extends ToolResponse { } } -// Remove Group from Application export interface OktaRemoveGroupFromAppParams extends OktaBaseParams { appId: string groupId: string @@ -1022,7 +987,6 @@ export interface OktaRemoveGroupFromAppResponse extends ToolResponse { } } -// List User Roles export interface OktaListUserRolesParams extends OktaBaseParams { userId: string } @@ -1035,7 +999,6 @@ export interface OktaListUserRolesResponse extends ToolResponse { } } -// Assign User Role export interface OktaAssignUserRoleParams extends OktaBaseParams { userId: string roleType: string @@ -1048,7 +1011,6 @@ export interface OktaAssignUserRoleResponse extends ToolResponse { output: OktaRoleAssignmentOutput & { assigned: boolean; success: boolean } } -// Remove User Role export interface OktaRemoveUserRoleParams extends OktaBaseParams { userId: string roleAssignmentId: string @@ -1063,7 +1025,6 @@ export interface OktaRemoveUserRoleResponse extends ToolResponse { } } -// List Group Rules export interface OktaListGroupRulesParams extends OktaBaseParams { search?: string after?: string @@ -1080,7 +1041,6 @@ export interface OktaListGroupRulesResponse extends ToolResponse { } } -// Get Group Rule export interface OktaGetGroupRuleParams extends OktaBaseParams { groupRuleId: string } @@ -1089,7 +1049,6 @@ export interface OktaGetGroupRuleResponse extends ToolResponse { output: OktaGroupRuleOutput & { success: boolean } } -// Create Group Rule export interface OktaCreateGroupRuleParams extends OktaBaseParams { ruleName: string expression: string @@ -1101,7 +1060,6 @@ export interface OktaCreateGroupRuleResponse extends ToolResponse { output: OktaGroupRuleOutput & { success: boolean } } -// Activate Group Rule export interface OktaActivateGroupRuleParams extends OktaBaseParams { groupRuleId: string } @@ -1114,7 +1072,6 @@ export interface OktaActivateGroupRuleResponse extends ToolResponse { } } -// Deactivate Group Rule export interface OktaDeactivateGroupRuleParams extends OktaBaseParams { groupRuleId: string } @@ -1127,7 +1084,6 @@ export interface OktaDeactivateGroupRuleResponse extends ToolResponse { } } -// Delete Group Rule export interface OktaDeleteGroupRuleParams extends OktaBaseParams { groupRuleId: string removeUsers?: boolean @@ -1141,7 +1097,6 @@ export interface OktaDeleteGroupRuleResponse extends ToolResponse { } } -// Generic response type for the block export type OktaResponse = | OktaListUsersResponse | OktaGetUserResponse diff --git a/apps/sim/tools/profound/types.ts b/apps/sim/tools/profound/types.ts index 3e60e8d89a5..0c75618ce0c 100644 --- a/apps/sim/tools/profound/types.ts +++ b/apps/sim/tools/profound/types.ts @@ -37,7 +37,7 @@ interface ProfoundDomainReportParams { limit?: number } -// --- Organization endpoints --- +// Organization endpoints export interface ProfoundListCategoriesParams { apiKey: string @@ -137,7 +137,7 @@ export interface ProfoundListPersonasResponse extends ToolResponse { } } -// --- Category-specific endpoints --- +// Category-specific endpoints export interface ProfoundCategoryTopicsParams { apiKey: string @@ -241,7 +241,7 @@ export interface ProfoundCategoryPersonasResponse extends ToolResponse { } } -// --- Reports --- +// Reports export type ProfoundVisibilityReportParams = ProfoundCategoryReportParams export type ProfoundVisibilityReportResponse = ProfoundReportResponse @@ -261,7 +261,7 @@ export type ProfoundBotsReportResponse = ProfoundReportResponse export type ProfoundReferralsReportParams = ProfoundDomainReportParams export type ProfoundReferralsReportResponse = ProfoundReportResponse -// --- Prompts --- +// Prompts export interface ProfoundPromptAnswersParams { apiKey: string @@ -290,7 +290,7 @@ export interface ProfoundPromptAnswersResponse extends ToolResponse { } } -// --- Agent Analytics --- +// Agent Analytics export interface ProfoundRawLogsParams { apiKey: string @@ -332,7 +332,7 @@ export interface ProfoundBotLogsResponse extends ToolResponse { } } -// --- Content --- +// Content export interface ProfoundListOptimizationsParams { apiKey: string @@ -387,7 +387,7 @@ export interface ProfoundOptimizationAnalysisResponse extends ToolResponse { } } -// --- Prompt Volumes --- +// Prompt Volumes export interface ProfoundPromptVolumeParams { apiKey: string diff --git a/apps/sim/tools/thrive/types.ts b/apps/sim/tools/thrive/types.ts index aa576d67e84..0ae43ce097e 100644 --- a/apps/sim/tools/thrive/types.ts +++ b/apps/sim/tools/thrive/types.ts @@ -449,7 +449,7 @@ export const THRIVE_SKILL_LEVEL_OUTPUT_PROPERTIES: Record[] } } -// ─── Completions ─────────────────────────────────────────────────────────── +// Completions export interface ThriveListCompletionsParams extends ThriveBaseParams { contentId?: string @@ -710,7 +710,7 @@ export interface ThriveCreateCompletionResponse extends ToolResponse { output: { statementId: string | null } } -// ─── Content ─────────────────────────────────────────────────────────────── +// Content export interface ThriveGetContentParams extends ThriveBaseParams { id: string @@ -732,7 +732,7 @@ export interface ThriveQueryContentResponse extends ToolResponse { output: { results: Record[]; pagination: ThrivePagination | null } } -// ─── Activities ──────────────────────────────────────────────────────────── +// Activities export interface ThriveGetActivityParams extends ThriveBaseParams { id: string @@ -757,7 +757,7 @@ export interface ThriveQueryActivitiesResponse extends ToolResponse { output: { results: Record[]; pagination: ThrivePagination | null } } -// ─── CPD ─────────────────────────────────────────────────────────────────── +// Cpd export interface ThriveGetCpdCategoryParams extends ThriveBaseParams { categoryId: string @@ -814,7 +814,7 @@ export interface ThriveCpdPaginatedResponse extends ToolResponse { output: { results: Record[]; pagination: ThrivePagination | null } } -// ─── Tags & Skills ───────────────────────────────────────────────────────── +// Tags & Skills export interface ThriveListTagsParams extends ThriveBaseParams { page?: number diff --git a/apps/sim/tools/wordpress/types.ts b/apps/sim/tools/wordpress/types.ts index 9936ab70980..9b87b1a62eb 100644 --- a/apps/sim/tools/wordpress/types.ts +++ b/apps/sim/tools/wordpress/types.ts @@ -1,33 +1,32 @@ -// Common types for WordPress REST API tools import type { UserFile } from '@/executor/types' import type { ToolResponse } from '@/tools/types' -// Common parameters for all WordPress tools (WordPress.com OAuth) -// Note: accessToken is injected by the OAuth system at runtime, not defined in tool params +/** + * Common parameters for all WordPress.com OAuth tools. `accessToken` is injected by the + * OAuth system at runtime, not defined in tool params. + */ interface WordPressBaseParams { - siteId: string // WordPress.com site ID or domain (e.g., 12345678 or mysite.wordpress.com) - accessToken: string // OAuth access token (injected by OAuth system) + /** WordPress.com site ID or domain (e.g., 12345678 or mysite.wordpress.com) */ + siteId: string + /** OAuth access token (injected by OAuth system) */ + accessToken: string } -// WordPress.com API base URL export const WORDPRESS_COM_API_BASE = 'https://public-api.wordpress.com/wp/v2/sites' -// Post status types export type PostStatus = 'publish' | 'draft' | 'pending' | 'private' | 'future' -// Comment status types export type CommentStatus = 'approved' | 'hold' | 'spam' | 'trash' -// POST OPERATIONS - -// Create Post export interface WordPressCreatePostParams extends WordPressBaseParams { title: string content?: string status?: PostStatus excerpt?: string - categories?: string // Comma-separated category IDs - tags?: string // Comma-separated tag IDs + /** Comma-separated category IDs */ + categories?: string + /** Comma-separated tag IDs */ + tags?: string featuredMedia?: number slug?: string } @@ -61,7 +60,6 @@ export interface WordPressCreatePostResponse extends ToolResponse { } } -// Update Post export interface WordPressUpdatePostParams extends WordPressBaseParams { postId: number title?: string @@ -80,10 +78,10 @@ export interface WordPressUpdatePostResponse extends ToolResponse { } } -// Delete Post export interface WordPressDeletePostParams extends WordPressBaseParams { postId: number - force?: boolean // Bypass trash and force delete + /** Bypass trash and force delete */ + force?: boolean } export interface WordPressDeletePostResponse extends ToolResponse { @@ -93,7 +91,6 @@ export interface WordPressDeletePostResponse extends ToolResponse { } } -// Get Post export interface WordPressGetPostParams extends WordPressBaseParams { postId: number } @@ -104,7 +101,6 @@ export interface WordPressGetPostResponse extends ToolResponse { } } -// List Posts export interface WordPressListPostsParams extends WordPressBaseParams { perPage?: number page?: number @@ -125,7 +121,6 @@ export interface WordPressListPostsResponse extends ToolResponse { } } -// Search Posts interface WordPressSearchPostsParams extends WordPressBaseParams { query: string perPage?: number @@ -140,9 +135,6 @@ interface WordPressSearchPostsResponse extends ToolResponse { } } -// PAGE OPERATIONS - -// Create Page export interface WordPressCreatePageParams extends WordPressBaseParams { title: string content?: string @@ -183,7 +175,6 @@ export interface WordPressCreatePageResponse extends ToolResponse { } } -// Update Page export interface WordPressUpdatePageParams extends WordPressBaseParams { pageId: number title?: string @@ -202,7 +193,6 @@ export interface WordPressUpdatePageResponse extends ToolResponse { } } -// Delete Page export interface WordPressDeletePageParams extends WordPressBaseParams { pageId: number force?: boolean @@ -215,7 +205,6 @@ export interface WordPressDeletePageResponse extends ToolResponse { } } -// Get Page export interface WordPressGetPageParams extends WordPressBaseParams { pageId: number } @@ -226,7 +215,6 @@ export interface WordPressGetPageResponse extends ToolResponse { } } -// List Pages export interface WordPressListPagesParams extends WordPressBaseParams { perPage?: number page?: number @@ -245,12 +233,10 @@ export interface WordPressListPagesResponse extends ToolResponse { } } -// MEDIA OPERATIONS - -// Upload Media export interface WordPressUploadMediaParams extends WordPressBaseParams { file: UserFile - filename?: string // Optional filename override + /** Optional filename override */ + filename?: string title?: string caption?: string altText?: string @@ -286,7 +272,6 @@ export interface WordPressUploadMediaResponse extends ToolResponse { } } -// Get Media export interface WordPressGetMediaParams extends WordPressBaseParams { mediaId: number } @@ -297,7 +282,6 @@ export interface WordPressGetMediaResponse extends ToolResponse { } } -// List Media export interface WordPressListMediaParams extends WordPressBaseParams { perPage?: number page?: number @@ -316,7 +300,6 @@ export interface WordPressListMediaResponse extends ToolResponse { } } -// Delete Media export interface WordPressDeleteMediaParams extends WordPressBaseParams { mediaId: number } @@ -328,9 +311,6 @@ export interface WordPressDeleteMediaResponse extends ToolResponse { } } -// COMMENT OPERATIONS - -// Create Comment export interface WordPressCreateCommentParams extends WordPressBaseParams { postId: number content: string @@ -362,7 +342,6 @@ export interface WordPressCreateCommentResponse extends ToolResponse { } } -// Get Comment interface WordPressGetCommentParams extends WordPressBaseParams { commentId: number } @@ -373,7 +352,6 @@ interface WordPressGetCommentResponse extends ToolResponse { } } -// List Comments export interface WordPressListCommentsParams extends WordPressBaseParams { perPage?: number page?: number @@ -392,7 +370,6 @@ export interface WordPressListCommentsResponse extends ToolResponse { } } -// Update Comment export interface WordPressUpdateCommentParams extends WordPressBaseParams { commentId: number content?: string @@ -405,7 +382,6 @@ export interface WordPressUpdateCommentResponse extends ToolResponse { } } -// Delete Comment export interface WordPressDeleteCommentParams extends WordPressBaseParams { commentId: number force?: boolean @@ -418,9 +394,6 @@ export interface WordPressDeleteCommentResponse extends ToolResponse { } } -// TAXONOMY OPERATIONS (Categories & Tags) - -// Create Category export interface WordPressCreateCategoryParams extends WordPressBaseParams { name: string description?: string @@ -445,7 +418,6 @@ export interface WordPressCreateCategoryResponse extends ToolResponse { } } -// List Categories export interface WordPressListCategoriesParams extends WordPressBaseParams { perPage?: number page?: number @@ -461,7 +433,6 @@ export interface WordPressListCategoriesResponse extends ToolResponse { } } -// Get Category export interface WordPressGetCategoryParams extends WordPressBaseParams { categoryId: number } @@ -472,7 +443,6 @@ export interface WordPressGetCategoryResponse extends ToolResponse { } } -// Update Category export interface WordPressUpdateCategoryParams extends WordPressBaseParams { categoryId: number name?: string @@ -487,7 +457,6 @@ export interface WordPressUpdateCategoryResponse extends ToolResponse { } } -// Delete Category export interface WordPressDeleteCategoryParams extends WordPressBaseParams { categoryId: number } @@ -499,7 +468,6 @@ export interface WordPressDeleteCategoryResponse extends ToolResponse { } } -// Create Tag export interface WordPressCreateTagParams extends WordPressBaseParams { name: string description?: string @@ -522,7 +490,6 @@ export interface WordPressCreateTagResponse extends ToolResponse { } } -// List Tags export interface WordPressListTagsParams extends WordPressBaseParams { perPage?: number page?: number @@ -538,7 +505,6 @@ export interface WordPressListTagsResponse extends ToolResponse { } } -// Get Tag export interface WordPressGetTagParams extends WordPressBaseParams { tagId: number } @@ -549,7 +515,6 @@ export interface WordPressGetTagResponse extends ToolResponse { } } -// Update Tag export interface WordPressUpdateTagParams extends WordPressBaseParams { tagId: number name?: string @@ -563,7 +528,6 @@ export interface WordPressUpdateTagResponse extends ToolResponse { } } -// Delete Tag export interface WordPressDeleteTagParams extends WordPressBaseParams { tagId: number } @@ -575,9 +539,6 @@ export interface WordPressDeleteTagResponse extends ToolResponse { } } -// USER OPERATIONS - -// Get Current User export interface WordPressGetCurrentUserParams extends WordPressBaseParams {} interface WordPressUser { @@ -601,7 +562,6 @@ export interface WordPressGetCurrentUserResponse extends ToolResponse { } } -// List Users export interface WordPressListUsersParams extends WordPressBaseParams { perPage?: number page?: number @@ -618,7 +578,6 @@ export interface WordPressListUsersResponse extends ToolResponse { } } -// Get User export interface WordPressGetUserParams extends WordPressBaseParams { userId: number } @@ -629,9 +588,6 @@ export interface WordPressGetUserResponse extends ToolResponse { } } -// SEARCH OPERATIONS - -// Search Content export interface WordPressSearchContentParams extends WordPressBaseParams { query: string perPage?: number @@ -656,7 +612,6 @@ export interface WordPressSearchContentResponse extends ToolResponse { } } -// Union type for all WordPress responses export type WordPressResponse = | WordPressCreatePostResponse | WordPressUpdatePostResponse diff --git a/apps/sim/tools/x/types.ts b/apps/sim/tools/x/types.ts index 2180de4da75..51c6a94ca91 100644 --- a/apps/sim/tools/x/types.ts +++ b/apps/sim/tools/x/types.ts @@ -221,7 +221,7 @@ export const transformPersonalizedTrend = (trend: any): XPersonalizedTrend => ({ trendingSince: trend.trending_since ?? null, }) -// --- New Tool Parameter Interfaces --- +// New Tool Parameter Interfaces export interface XSearchTweetsParams extends XBaseParams { query: string diff --git a/packages/audit/src/types.ts b/packages/audit/src/types.ts index e2b542646f5..7cd5acb84d4 100644 --- a/packages/audit/src/types.ts +++ b/packages/audit/src/types.ts @@ -2,10 +2,8 @@ * All auditable actions in the platform, grouped by resource type. */ export const AuditAction = { - // Accounts ACCOUNT_DELETED: 'account.deleted', - // API Keys API_KEY_CREATED: 'api_key.created', API_KEY_UPDATED: 'api_key.updated', API_KEY_REVOKED: 'api_key.revoked', @@ -15,12 +13,10 @@ export const AuditAction = { // OAuth apps (Sim as the authorization server) OAUTH_APP_REVOKED: 'oauth_app.revoked', - // BYOK Keys BYOK_KEY_CREATED: 'byok_key.created', BYOK_KEY_UPDATED: 'byok_key.updated', BYOK_KEY_DELETED: 'byok_key.deleted', - // Chat CHAT_DEPLOYED: 'chat.deployed', CHAT_UPDATED: 'chat.updated', CHAT_DELETED: 'chat.deleted', @@ -31,23 +27,19 @@ export const AuditAction = { CUSTOM_BLOCK_UPDATED: 'custom_block.updated', CUSTOM_BLOCK_DELETED: 'custom_block.deleted', - // Dashboards DASHBOARD_CREATED: 'dashboard.created', DASHBOARD_UPDATED: 'dashboard.updated', - // Custom Tools CUSTOM_TOOL_CREATED: 'custom_tool.created', CUSTOM_TOOL_UPDATED: 'custom_tool.updated', CUSTOM_TOOL_DELETED: 'custom_tool.deleted', - // Data Drains DATA_DRAIN_CREATED: 'data_drain.created', DATA_DRAIN_UPDATED: 'data_drain.updated', DATA_DRAIN_DELETED: 'data_drain.deleted', DATA_DRAIN_RAN: 'data_drain.ran', DATA_DRAIN_TESTED: 'data_drain.tested', - // Billing CREDIT_PURCHASED: 'credit.purchased', CREDIT_ISSUED: 'credit.issued', INVOICE_PAYMENT_SUCCEEDED: 'invoice.payment_succeeded', @@ -56,23 +48,19 @@ export const AuditAction = { CHARGE_DISPUTE_OPENED: 'charge.dispute_opened', CHARGE_DISPUTE_CLOSED: 'charge.dispute_closed', - // Subscriptions SUBSCRIPTION_CREATED: 'subscription.created', SUBSCRIPTION_CANCELLED: 'subscription.cancelled', SUBSCRIPTION_REFUNDED: 'subscription.refunded', SUBSCRIPTION_TRANSFERRED: 'subscription.transferred', ENTERPRISE_SUBSCRIPTION_PROVISIONED: 'subscription.enterprise_provisioned', - // Connector Documents CONNECTOR_DOCUMENT_RESTORED: 'connector_document.restored', CONNECTOR_DOCUMENT_EXCLUDED: 'connector_document.excluded', - // Documents DOCUMENT_UPLOADED: 'document.uploaded', DOCUMENT_UPDATED: 'document.updated', DOCUMENT_DELETED: 'document.deleted', - // Environment ENVIRONMENT_UPDATED: 'environment.updated', ENVIRONMENT_DELETED: 'environment.deleted', @@ -87,7 +75,6 @@ export const AuditAction = { */ SECRET_PROVENANCE_UNRECORDED: 'secret_provenance.unrecorded', - // Files FILE_UPLOADED: 'file.uploaded', FILE_UPDATED: 'file.updated', FILE_DELETED: 'file.deleted', @@ -105,7 +92,6 @@ export const AuditAction = { /** A superseded version of a file's content was permanently deleted. */ FILE_VERSION_DELETED: 'file.version_deleted', - // Folders FOLDER_CREATED: 'folder.created', FOLDER_UPDATED: 'folder.updated', FOLDER_DELETED: 'folder.deleted', @@ -113,38 +99,32 @@ export const AuditAction = { FOLDER_DUPLICATED: 'folder.duplicated', FOLDER_RESTORED: 'folder.restored', - // Invitations INVITATION_ACCEPTED: 'invitation.accepted', INVITATION_REJECTED: 'invitation.rejected', INVITATION_RESENT: 'invitation.resent', INVITATION_REVOKED: 'invitation.revoked', INVITATION_UPDATED: 'invitation.updated', - // Knowledge Base Connectors CONNECTOR_CREATED: 'connector.created', CONNECTOR_UPDATED: 'connector.updated', CONNECTOR_DELETED: 'connector.deleted', CONNECTOR_SYNCED: 'connector.synced', - // Knowledge Bases KNOWLEDGE_BASE_CREATED: 'knowledge_base.created', KNOWLEDGE_BASE_UPDATED: 'knowledge_base.updated', KNOWLEDGE_BASE_DELETED: 'knowledge_base.deleted', KNOWLEDGE_BASE_RESTORED: 'knowledge_base.restored', KNOWLEDGE_BASE_EXPORTED: 'knowledge_base.exported', - // MCP Servers MCP_SERVER_ADDED: 'mcp_server.added', MCP_SERVER_UPDATED: 'mcp_server.updated', MCP_SERVER_REMOVED: 'mcp_server.removed', - // Members MEMBER_INVITED: 'member.invited', MEMBER_ADDED: 'member.added', MEMBER_REMOVED: 'member.removed', MEMBER_ROLE_CHANGED: 'member.role_changed', - // OAuth / Credentials OAUTH_DISCONNECTED: 'oauth.disconnected', CREDENTIAL_CREATED: 'credential.created', CREDENTIAL_UPDATED: 'credential.updated', @@ -157,11 +137,9 @@ export const AuditAction = { CREDENTIAL_MEMBER_ROLE_CHANGED: 'credential_member.role_changed', CREDENTIAL_GROUP_UPDATED: 'credential_group.updated', - // Password PASSWORD_RESET_REQUESTED: 'password.reset_requested', PASSWORD_RESET: 'password.reset', - // Organizations ORGANIZATION_CREATED: 'organization.created', ORGANIZATION_UPDATED: 'organization.updated', ORGANIZATION_DELETED: 'organization.deleted', @@ -187,7 +165,6 @@ export const AuditAction = { ORG_SEAT_DEPROVISIONED: 'org_seat.deprovisioned', ORG_PLAN_CONVERTED: 'org_plan.converted', - // Permission Groups PERMISSION_GROUP_CREATED: 'permission_group.created', PERMISSION_GROUP_UPDATED: 'permission_group.updated', PERMISSION_GROUP_DELETED: 'permission_group.deleted', @@ -200,35 +177,29 @@ export const AuditAction = { PERMISSION_ACCESS_REQUEST_CLOSED: 'permission_access_request.closed', PERMISSION_ACCESS_REQUEST_SETTINGS_CHANGED: 'permission_access_request.settings_changed', - // Sandboxes SANDBOX_CREATED: 'sandbox.created', SANDBOX_UPDATED: 'sandbox.updated', SANDBOX_DELETED: 'sandbox.deleted', - // Skills SKILL_CREATED: 'skill.created', SKILL_UPDATED: 'skill.updated', SKILL_DELETED: 'skill.deleted', SKILL_MEMBER_ADDED: 'skill_member.added', SKILL_MEMBER_REMOVED: 'skill_member.removed', - // Schedules SCHEDULE_CREATED: 'schedule.created', SCHEDULE_UPDATED: 'schedule.updated', SCHEDULE_DELETED: 'schedule.deleted', - // Tables TABLE_CREATED: 'table.created', TABLE_UPDATED: 'table.updated', TABLE_DELETED: 'table.deleted', TABLE_RESTORED: 'table.restored', TABLE_EXPORTED: 'table.exported', - // Webhooks WEBHOOK_CREATED: 'webhook.created', WEBHOOK_DELETED: 'webhook.deleted', - // Workflows WORKFLOW_CREATED: 'workflow.created', WORKFLOW_UPDATED: 'workflow.updated', WORKFLOW_DELETED: 'workflow.deleted', @@ -246,7 +217,6 @@ export const AuditAction = { WORKFLOW_PUBLIC_API_TOGGLED: 'workflow.public_api_toggled', WORKFLOW_EXPORTED: 'workflow.exported', - // Workspaces WORKSPACE_CREATED: 'workspace.created', WORKSPACE_UPDATED: 'workspace.updated', WORKSPACE_DELETED: 'workspace.deleted', @@ -257,7 +227,6 @@ export const AuditAction = { WORKSPACE_FORK_UNLINKED: 'workspace.fork_unlinked', WORKSPACE_FORK_SYNC_DEFAULT_CHANGED: 'workspace.fork_sync_default_changed', WORKSPACE_EXPORTED: 'workspace.exported', - // SCIM directory provisioning SCIM_CONNECTION_ENABLED: 'scim_connection.enabled', SCIM_CONNECTION_DISABLED: 'scim_connection.disabled', SCIM_CONNECTION_SETTINGS_UPDATED: 'scim_connection.settings_updated', diff --git a/packages/db/schema.ts b/packages/db/schema.ts index 523c8f7e970..23283468902 100644 --- a/packages/db/schema.ts +++ b/packages/db/schema.ts @@ -38,7 +38,7 @@ function hnswIndexOptions() { : { m: 16, ef_construction: 64 } } -// Custom tsvector type for full-text search +/** Custom tsvector type for full-text search */ export const tsvector = customType<{ data: string }>({ @@ -292,7 +292,8 @@ export const pinnedItem = pgTable( workspaceId: text('workspace_id') .notNull() .references(() => workspace.id, { onDelete: 'cascade' }), - resourceType: text('resource_type').notNull(), // 'workflow' | 'file' | 'knowledge_base' | 'table' | 'folder' | 'workspace' + /** 'workflow' | 'file' | 'knowledge_base' | 'table' | 'folder' | 'workspace' */ + resourceType: text('resource_type').notNull(), resourceId: text('resource_id').notNull(), pinnedAt: timestamp('pinned_at').notNull().defaultNow(), }, @@ -401,7 +402,8 @@ export const workflowBlocks = pgTable( .notNull() .references(() => workflow.id, { onDelete: 'cascade' }), - type: text('type').notNull(), // 'starter', 'agent', 'api', 'function' + /** 'starter', 'agent', 'api', 'function' */ + type: text('type').notNull(), name: text('name').notNull(), positionX: decimal('position_x').notNull(), @@ -471,7 +473,8 @@ export const workflowSubflows = pgTable( .notNull() .references(() => workflow.id, { onDelete: 'cascade' }), - type: text('type').notNull(), // 'loop' or 'parallel' + /** 'loop' or 'parallel' */ + type: text('type').notNull(), config: jsonb('config').notNull().default('{}'), createdAt: timestamp('created_at').notNull().defaultNow(), @@ -486,7 +489,8 @@ export const workflowSubflows = pgTable( export const waitlist = pgTable('waitlist', { id: text('id').primaryKey(), email: text('email').notNull().unique(), - status: text('status').notNull().default('pending'), // pending, approved, rejected + /** pending, approved, rejected */ + status: text('status').notNull().default('pending'), createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }) @@ -528,10 +532,12 @@ export const workflowExecutionLogs = pgTable( { onDelete: 'set null' } ), - level: text('level').notNull(), // 'info' | 'error' + /** 'info' | 'error' */ + level: text('level').notNull(), /** See `PERSISTED_WORKFLOW_EXECUTION_STATUSES` in `apps/sim/lib/logs/types.ts`. */ status: text('status').notNull().default('running'), - trigger: text('trigger').notNull(), // 'api' | 'webhook' | 'schedule' | 'manual' | 'chat' + /** 'api' | 'webhook' | 'schedule' | 'manual' | 'chat' */ + trigger: text('trigger').notNull(), startedAt: timestamp('started_at').notNull(), /** Absolute deadline for the current active attempt; cleared while paused or terminal. */ @@ -557,13 +563,16 @@ export const workflowExecutionLogs = pgTable( * `materializeExecutionData`, which resolves the pointer. */ executionData: jsonb('execution_data').notNull().default('{}'), - // Faithful, write-once projection of the run's usage_log ledger sum (dollars). - // Backs list cost display/filter/sort without live aggregation; never an - // independently-computed value (cost_total == SUM(usage_log) for the run). + /** + * Faithful, write-once projection of the run's usage_log ledger sum (dollars). Backs list cost + * display/filter/sort without live aggregation; never an independently-computed value + * (cost_total == SUM(usage_log) for the run). + */ costTotal: decimal('cost_total'), - // Model names used by the run (incl. zero-cost/BYOK), for the v1 model filter. + /** Model names used by the run (incl. zero-cost/BYOK), for the v1 model filter. */ modelsUsed: text('models_used').array(), - files: jsonb('files'), // File metadata for execution files + /** File metadata for execution files */ + files: jsonb('files'), createdAt: timestamp('created_at').notNull().defaultNow(), }, (table) => ({ @@ -773,11 +782,12 @@ export const resumeQueue = pgTable( ) export const environment = pgTable('environment', { - id: text('id').primaryKey(), // Use the user id as the key + /** Use the user id as the key */ + id: text('id').primaryKey(), userId: text('user_id') .notNull() .references(() => user.id, { onDelete: 'cascade' }) - .unique(), // One environment per user + .unique(), variables: json('variables').notNull(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }) @@ -987,49 +997,45 @@ export const organizationBYOKKeys = pgTable( ) export const settings = pgTable('settings', { - id: text('id').primaryKey(), // Use the user id as the key + /** Use the user id as the key */ + id: text('id').primaryKey(), userId: text('user_id') .notNull() .references(() => user.id, { onDelete: 'cascade' }) - .unique(), // One settings record per user + .unique(), - // General settings theme: text('theme').notNull().default('system'), autoConnect: boolean('auto_connect').notNull().default(true), - // Privacy settings telemetryEnabled: boolean('telemetry_enabled').notNull().default(true), - // Email preferences emailPreferences: json('email_preferences').notNull().default('{}'), - // Billing usage notifications preference billingUsageNotificationsEnabled: boolean('billing_usage_notifications_enabled') .notNull() .default(true), - // UI preferences showTrainingControls: boolean('show_training_controls').notNull().default(false), superUserModeEnabled: boolean('super_user_mode_enabled').notNull().default(true), mothershipEnvironment: text('mothership_environment').notNull().default('default'), - // Notification preferences errorNotificationsEnabled: boolean('error_notifications_enabled').notNull().default(true), - // Canvas preferences - snapToGridSize: integer('snap_to_grid_size').notNull().default(0), // 0 = off, 10-50 = grid size + /** 0 = off, 10-50 = grid size */ + snapToGridSize: integer('snap_to_grid_size').notNull().default(0), showActionBar: boolean('show_action_bar').notNull().default(true), autoFocusOnClick: boolean('auto_focus_on_click').notNull().default(true), timezone: text('timezone'), - // Copilot preferences - maps model_id to enabled/disabled boolean + /** Copilot preferences - maps model_id to enabled/disabled boolean */ copilotEnabledModels: jsonb('copilot_enabled_models').notNull().default('{}'), - // Copilot auto-allowed integration tools - array of tool IDs that can run without confirmation + /** + * Copilot auto-allowed integration tools - array of tool IDs that can run without confirmation + */ copilotAutoAllowedTools: jsonb('copilot_auto_allowed_tools').notNull().default('[]'), - // Workspace navigation lastActiveWorkspaceId: text('last_active_workspace_id'), updatedAt: timestamp('updated_at').notNull().defaultNow(), @@ -1053,16 +1059,20 @@ export const workflowSchedule = pgTable( nextRunAt: timestamp('next_run_at'), lastRanAt: timestamp('last_ran_at'), lastQueuedAt: timestamp('last_queued_at'), - triggerType: text('trigger_type').notNull(), // "manual", "webhook", "schedule" + /** "manual", "webhook", "schedule" */ + triggerType: text('trigger_type').notNull(), timezone: text('timezone').notNull().default('UTC'), failedCount: integer('failed_count').notNull().default(0), infraRetryCount: integer('infra_retry_count').notNull().default(0), - status: text('status').notNull().default('active'), // 'active', 'disabled', or 'completed' + /** 'active', 'disabled', or 'completed' */ + status: text('status').notNull().default('active'), lastFailedAt: timestamp('last_failed_at'), - sourceType: text('source_type').notNull().default('workflow'), // 'workflow' or 'job' + /** 'workflow' or 'job' */ + sourceType: text('source_type').notNull().default('workflow'), jobTitle: text('job_title'), prompt: text('prompt'), - lifecycle: text('lifecycle').notNull().default('persistent'), // 'persistent' or 'until_complete' + /** 'persistent' or 'until_complete' */ + lifecycle: text('lifecycle').notNull().default('persistent'), successCondition: text('success_condition'), maxRuns: integer('max_runs'), runCount: integer('run_count').notNull().default(0), @@ -1178,18 +1188,19 @@ export const webhook = pgTable( * verification. */ routingKey: text('routing_key'), - provider: text('provider'), // e.g., "whatsapp", "github", etc. - providerConfig: json('provider_config'), // Store provider-specific configuration + /** e.g., "whatsapp", "github", etc. */ + provider: text('provider'), + providerConfig: json('provider_config'), isActive: boolean('is_active').notNull().default(true), - failedCount: integer('failed_count').default(0), // Track consecutive failures - lastFailedAt: timestamp('last_failed_at'), // When the webhook last failed + /** Track consecutive failures */ + failedCount: integer('failed_count').default(0), + lastFailedAt: timestamp('last_failed_at'), archivedAt: timestamp('archived_at'), createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }, (table) => { return { - // Ensure webhook paths are unique per deployment version pathIdx: uniqueIndex('path_deployment_unique') .on(table.path, table.deploymentVersionId) .where(sql`${table.archivedAt} IS NULL`), @@ -1288,7 +1299,8 @@ export const apiKey = pgTable( userId: text('user_id') .notNull() .references(() => user.id, { onDelete: 'cascade' }), - workspaceId: text('workspace_id').references(() => workspace.id, { onDelete: 'cascade' }), // Only set for workspace keys + /** Only set for workspace keys */ + workspaceId: text('workspace_id').references(() => workspace.id, { onDelete: 'cascade' }), createdBy: text('created_by').references(() => user.id, { onDelete: 'set null' }), name: text('name').notNull(), key: text('key').notNull().unique(), @@ -1322,8 +1334,9 @@ export const userStats = pgTable('user_stats', { userId: text('user_id') .notNull() .references(() => user.id, { onDelete: 'cascade' }) - .unique(), // One record per user - currentUsageLimit: decimal('current_usage_limit').default(DEFAULT_FREE_CREDITS.toString()), // Default $5 (1,000 credits) for free plan, null for team/enterprise + .unique(), + /** Default $5 (1,000 credits) for free plan, null for team/enterprise */ + currentUsageLimit: decimal('current_usage_limit').default(DEFAULT_FREE_CREDITS.toString()), usageLimitUpdatedAt: timestamp('usage_limit_updated_at').defaultNow(), /** Previous-period usage; written by the cycle-close sweep from ledger sums. */ lastPeriodCost: decimal('last_period_cost').default('0'), @@ -1334,7 +1347,8 @@ export const userStats = pgTable('user_stats', { * zero by the cycle-close sweep at period rollover. It is not incremented * by the ordinary per-usage ledger write path. */ - billedOverageThisPeriod: decimal('billed_overage_this_period').notNull().default('0'), // Amount of overage already billed via threshold billing + /** Amount of overage already billed via threshold billing */ + billedOverageThisPeriod: decimal('billed_overage_this_period').notNull().default('0'), /** * Credit balance tracker. * @@ -1535,15 +1549,17 @@ export const chat = pgTable( title: text('title').notNull(), description: text('description'), isActive: boolean('is_active').notNull().default(true), - customizations: json('customizations').default('{}'), // For UI customization options + customizations: json('customizations').default('{}'), - // Authentication options - authType: text('auth_type').notNull().default('public'), // 'public', 'password', 'email', 'sso' - password: text('password'), // Stored hashed, populated when authType is 'password' - allowedEmails: json('allowed_emails').default('[]'), // Array of allowed emails or domains when authType is 'email' or 'sso' + /** 'public', 'password', 'email', 'sso' */ + authType: text('auth_type').notNull().default('public'), + /** Stored hashed, populated when authType is 'password' */ + password: text('password'), + /** Array of allowed emails or domains when authType is 'email' or 'sso' */ + allowedEmails: json('allowed_emails').default('[]'), - // Output configuration - outputConfigs: json('output_configs').default('[]'), // Array of {blockId, path} objects + /** Array of {blockId, path} objects */ + outputConfigs: json('output_configs').default('[]'), /** * When true, public chat SSE exposes provider thinking events. Independent @@ -1568,7 +1584,6 @@ export const chat = pgTable( }, (table) => { return { - // Ensure identifiers are unique identifierIdx: uniqueIndex('identifier_idx') .on(table.identifier) .where(sql`${table.archivedAt} IS NULL`), @@ -1787,7 +1802,8 @@ export const member = pgTable( organizationId: text('organization_id') .notNull() .references(() => organization.id, { onDelete: 'cascade' }), - role: text('role').notNull(), // 'admin' or 'member' - team-level permissions only + /** 'admin' or 'member' - team-level permissions only */ + role: text('role').notNull(), createdAt: timestamp('created_at').defaultNow().notNull(), }, (table) => ({ @@ -2077,8 +2093,10 @@ export const workspaceForkResourceMap = pgTable( resourceType: workspaceForkResourceTypeEnum('resource_type').notNull(), parentResourceId: text('parent_resource_id').notNull(), childResourceId: text('child_resource_id'), - // SET NULL (not CASCADE): deleting the creating user must not delete the fork's - // identity mappings, which the edge depends on for every future promote. + /** + * SET NULL (not CASCADE): deleting the creating user must not delete the fork's identity + * mappings, which the edge depends on for every future promote. + */ createdBy: text('created_by').references(() => user.id, { onDelete: 'set null' }), createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), @@ -2206,8 +2224,10 @@ export const workspaceForkPromoteRun = pgTable( targetWorkspaceId: text('target_workspace_id').notNull(), direction: workspaceForkPromoteDirectionEnum('direction').notNull(), snapshot: jsonb('snapshot').notNull(), - // SET NULL (not CASCADE): deleting the creating user must not delete a pending - // undo point for a target workspace. + /** + * SET NULL (not CASCADE): deleting the creating user must not delete a pending undo point for a + * target workspace. + */ createdBy: text('created_by').references(() => user.id, { onDelete: 'set null' }), createdAt: timestamp('created_at').notNull().defaultNow(), }, @@ -2372,7 +2392,11 @@ export const workspaceFiles = pgTable( onDelete: 'cascade', }), folderId: text('folder_id').references(() => folder.id, { onDelete: 'set null' }), - context: text('context').notNull(), // 'workspace', 'mothership', 'copilot', 'chat', 'knowledge-base', 'profile-pictures', 'general', 'execution' + /** + * 'workspace', 'mothership', 'copilot', 'chat', 'knowledge-base', 'profile-pictures', + * 'general', 'execution' + */ + context: text('context').notNull(), chatId: uuid('chat_id').references(() => copilotChats.id, { onDelete: 'cascade' }), /** * Logical id of the copilot message this file was born in (the user message the @@ -2961,21 +2985,24 @@ export const publicShare = pgTable( 'public_share', { id: text('id').primaryKey(), - resourceType: text('resource_type').notNull(), // 'file' | 'folder' (folder reserved for future) + /** 'file' | 'folder' (folder reserved for future) */ + resourceType: text('resource_type').notNull(), resourceId: text('resource_id').notNull(), workspaceId: text('workspace_id') .notNull() .references(() => workspace.id, { onDelete: 'cascade' }), - // SET NULL (not CASCADE) so a share — and its public link — outlives the user - // who created it; the file still belongs to the workspace. + /** + * SET NULL (not CASCADE) so a share — and its public link — outlives the user who created it; + * the file still belongs to the workspace. + */ createdBy: text('created_by').references(() => user.id, { onDelete: 'set null' }), token: text('token').notNull(), isActive: boolean('is_active').notNull().default(true), - // 'public' (anyone with the link) | 'password' | 'email' (OTP) | 'sso'. + /** 'public' (anyone with the link) | 'password' | 'email' (OTP) | 'sso'. */ authType: text('auth_type').notNull().default('public'), - // AES-256-GCM encrypted share password; null unless authType is 'password'. + /** AES-256-GCM encrypted share password; null unless authType is 'password'. */ password: text('password'), - // Allowed emails/domains (e.g. '@acme.com') when authType is 'email' or 'sso'. + /** Allowed emails/domains (e.g. '@acme.com') when authType is 'email' or 'sso'. */ allowedEmails: json('allowed_emails').default('[]'), createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), @@ -3034,30 +3061,26 @@ export const permissions = pgTable( userId: text('user_id') .notNull() .references(() => user.id, { onDelete: 'cascade' }), - entityType: text('entity_type').notNull(), // 'workspace', 'workflow', 'organization', etc. - entityId: text('entity_id').notNull(), // ID of the workspace, workflow, etc. - permissionType: permissionTypeEnum('permission_type').notNull(), // Use enum instead of text + /** 'workspace', 'workflow', 'organization', etc. */ + entityType: text('entity_type').notNull(), + entityId: text('entity_id').notNull(), + permissionType: permissionTypeEnum('permission_type').notNull(), createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }, (table) => ({ - // Primary access pattern - get all permissions for a user userIdIdx: index('permissions_user_id_idx').on(table.userId), - // Entity-based queries - get all users with permissions on an entity entityIdx: index('permissions_entity_idx').on(table.entityType, table.entityId), - // User + entity type queries - get user's permissions for all workspaces userEntityTypeIdx: index('permissions_user_entity_type_idx').on(table.userId, table.entityType), - // Specific permission checks - does user have specific permission on entity userEntityPermissionIdx: index('permissions_user_entity_permission_idx').on( table.userId, table.entityType, table.permissionType ), - // Uniqueness constraint - prevent duplicate permission rows (one permission per user/entity) uniquePermissionConstraint: uniqueIndex('permissions_unique_constraint').on( table.userId, table.entityType, @@ -3233,22 +3256,17 @@ export const knowledgeBase = pgTable( /** Search indexes retain their identity independently of their display name. */ isSearchIndex: boolean('is_search_index').notNull().default(false), - // Token tracking for usage tokenCount: integer('token_count').notNull().default(0), - // Embedding configuration embeddingModel: text('embedding_model').notNull().default('text-embedding-3-small'), embeddingDimension: integer('embedding_dimension').notNull().default(1536), - // Chunking configuration stored as JSON for flexibility chunkingConfig: json('chunking_config') .notNull() .default('{"maxSize": 1024, "minSize": 1, "overlap": 200}'), - // Soft delete support deletedAt: timestamp('deleted_at'), - // Metadata and timestamps createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }, @@ -3272,13 +3290,10 @@ export const knowledgeBase = pgTable( organizationNameActiveUnique: uniqueIndex('kb_organization_name_active_unique') .on(table.organizationId, table.name) .where(sql`${table.deletedAt} IS NULL`), - // Primary access patterns userIdIdx: index('kb_user_id_idx').on(table.userId), workspaceIdIdx: index('kb_workspace_id_idx').on(table.workspaceId), - // Composite index for user's workspaces userWorkspaceIdx: index('kb_user_workspace_idx').on(table.userId, table.workspaceId), folderIdIdx: index('kb_folder_id_idx').on(table.folderId), - // Index for soft delete filtering deletedAtIdx: index('kb_deleted_at_idx').on(table.deletedAt), workspaceDeletedAtPartialIdx: index('kb_workspace_deleted_partial_idx') .on(table.workspaceId, table.deletedAt) @@ -3301,23 +3316,25 @@ export const document = pgTable( .notNull() .references(() => knowledgeBase.id, { onDelete: 'cascade' }), - // File information filename: text('filename').notNull(), fileUrl: text('file_url').notNull(), - // Canonical storage key derived from fileUrl at write time (e.g. 'kb/<...>'), - // or null for external/data: ingestion URLs. KB file authorization matches on - // this exact key rather than re-parsing the URL at read time. + /** + * Canonical storage key derived from fileUrl at write time (e.g. 'kb/<...>'), or null for + * external/data: ingestion URLs. KB file authorization matches on this exact key rather than + * re-parsing the URL at read time. + */ storageKey: text('storage_key'), - fileSize: integer('file_size').notNull(), // Size in bytes - mimeType: text('mime_type').notNull(), // e.g., 'application/pdf', 'text/plain' + /** Size in bytes */ + fileSize: integer('file_size').notNull(), + /** e.g., 'application/pdf', 'text/plain' */ + mimeType: text('mime_type').notNull(), - // Content statistics chunkCount: integer('chunk_count').notNull().default(0), tokenCount: integer('token_count').notNull().default(0), characterCount: integer('character_count').notNull().default(0), - // Processing status - processingStatus: text('processing_status').notNull().default('pending'), // 'pending', 'processing', 'completed', 'failed' + /** 'pending', 'processing', 'completed', 'failed' */ + processingStatus: text('processing_status').notNull().default('pending'), /** * Dispatches spent on this document since its last successful pass. * @@ -3347,11 +3364,12 @@ export const document = pgTable( /** Retry admission backoff, separate from an accepted worker continuation. */ processingRecoveryAfter: timestamp('processing_recovery_after'), - // Document state - enabled: boolean('enabled').notNull().default(true), // Enable/disable from knowledge base - archivedAt: timestamp('archived_at'), // Parent KB/workspace archive marker - deletedAt: timestamp('deleted_at'), // Soft delete - userExcluded: boolean('user_excluded').notNull().default(false), // User explicitly excluded — skip on sync + enabled: boolean('enabled').notNull().default(true), + /** Parent KB/workspace archive marker */ + archivedAt: timestamp('archived_at'), + deletedAt: timestamp('deleted_at'), + /** User explicitly excluded — skip on sync */ + userExcluded: boolean('user_excluded').notNull().default(false), // Document tags for filtering (inherited by all chunks) // Text tags (7 slots) @@ -3376,7 +3394,6 @@ export const document = pgTable( boolean2: boolean('boolean2'), boolean3: boolean('boolean3'), - // Connector-sourced document fields connectorId: text('connector_id').references(() => knowledgeConnector.id, { onDelete: 'set null', }), @@ -3408,11 +3425,9 @@ export const document = pgTable( /** Start of the durable source-listing cycle that last observed this document. */ sourceSeenAt: timestamp('source_seen_at'), - // Timestamps uploadedAt: timestamp('uploaded_at').notNull().defaultNow(), }, (table) => ({ - // Primary access pattern - filter by knowledge base knowledgeBaseIdIdx: index('doc_kb_id_idx').on(table.knowledgeBaseId), /** Search's updated-after filter: the documents of a base changed since a time, without a base scan. */ sourceModifiedLookupIdx: index('doc_kb_source_modified_idx') @@ -3438,9 +3453,7 @@ export const document = pgTable( 'doc_acl_token_shape_check', sql`array_position(${table.acl}, NULL) IS NULL AND (cardinality(${table.acl}) = 0 OR (cardinality(${table.acl}) = array_length(string_to_array(array_to_string(${table.acl}, E'\\n'), E'\\n'), 1) AND array_to_string(${table.acl}, E'\\n') ~ '^((ws|pub|link|u:[^\\nA-Z]+@[^\\nA-Z]+|[gs]:[^\\n:]+:[^\\n:]+:[^\\n]+)(\\n(ws|pub|link|u:[^\\nA-Z]+@[^\\nA-Z]+|[gs]:[^\\n:]+:[^\\n:]+:[^\\n]+))*)$'))` ), - // Search by filename filenameIdx: index('doc_filename_idx').on(table.filename), - // Processing status filtering processingStatusIdx: index('doc_processing_status_idx').on( table.knowledgeBaseId, table.processingStatus @@ -3532,7 +3545,6 @@ export const document = pgTable( .where( sql`${table.userExcluded} = false AND ${table.archivedAt} IS NULL AND ${table.deletedAt} IS NULL` ), - // Text tag indexes tag1Idx: index('doc_kb_tag1_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag1})`), tag2Idx: index('doc_kb_tag2_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag2})`), tag3Idx: index('doc_kb_tag3_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag3})`), @@ -3540,7 +3552,6 @@ export const document = pgTable( tag5Idx: index('doc_kb_tag5_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag5})`), tag6Idx: index('doc_kb_tag6_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag6})`), tag7Idx: index('doc_kb_tag7_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag7})`), - // Number tag indexes (5 slots) number1Idx: index('doc_number1_idx').on(table.number1), number2Idx: index('doc_number2_idx').on(table.number2), number3Idx: index('doc_number3_idx').on(table.number3), @@ -3549,7 +3560,6 @@ export const document = pgTable( /** Date tag filters compile to half-open ranges on the raw column, which these serve. */ date1Idx: index('doc_date1_idx').on(table.date1).concurrently(), date2Idx: index('doc_date2_idx').on(table.date2).concurrently(), - // Boolean tag indexes (3 slots) boolean1Idx: index('doc_boolean1_idx').on(table.boolean1), boolean2Idx: index('doc_boolean2_idx').on(table.boolean2), boolean3Idx: index('doc_boolean3_idx').on(table.boolean3), @@ -3587,22 +3597,20 @@ export const knowledgeBaseTagDefinitions = pgTable( enum: TAG_SLOTS, }).notNull(), displayName: text('display_name').notNull(), - fieldType: text('field_type').notNull().default('text'), // 'text', future: 'date', 'number', 'range' + /** 'text', future: 'date', 'number', 'range' */ + fieldType: text('field_type').notNull().default('text'), createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }, (table) => ({ - // Ensure unique tag slot per knowledge base kbTagSlotIdx: uniqueIndex('kb_tag_definitions_kb_slot_idx').on( table.knowledgeBaseId, table.tagSlot ), - // Ensure unique display name per knowledge base kbDisplayNameIdx: uniqueIndex('kb_tag_definitions_kb_display_name_idx').on( table.knowledgeBaseId, table.displayName ), - // Index for querying by knowledge base kbIdIdx: index('kb_tag_definitions_kb_id_idx').on(table.knowledgeBaseId), }) ) @@ -3618,7 +3626,6 @@ export const embedding = pgTable( .notNull() .references(() => document.id, { onDelete: 'cascade' }), - // Chunk information chunkIndex: integer('chunk_index').notNull(), chunkHash: text('chunk_hash').notNull(), content: text('content').notNull(), @@ -3646,7 +3653,6 @@ export const embedding = pgTable( embedding3072: vector('embedding_3072', { dimensions: 3072 }), embeddingModel: text('embedding_model').notNull().default('text-embedding-3-small'), - // Chunk boundaries and overlap startOffset: integer('start_offset').notNull(), endOffset: integer('end_offset').notNull(), @@ -3673,26 +3679,21 @@ export const embedding = pgTable( boolean2: boolean('boolean2'), boolean3: boolean('boolean3'), - // Chunk state - enable/disable from knowledge base enabled: boolean('enabled').notNull().default(true), - // Full-text search support - generated tsvector column contentTsv: tsvector('content_tsv').generatedAlwaysAs( (): SQL => sql`to_tsvector('english', ${embedding.content})` ), - // Timestamps createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }, (table) => ({ - // Chunk ordering within documents docChunkIdx: uniqueIndex('emb_doc_chunk_idx').on(table.documentId, table.chunkIndex), // Model-specific queries for A/B testing or migrations kbModelIdx: index('emb_kb_model_idx').on(table.knowledgeBaseId, table.embeddingModel), - // Enabled state filtering indexes (for chunk enable/disable functionality) kbEnabledIdx: index('emb_kb_enabled_idx').on(table.knowledgeBaseId, table.enabled), docEnabledIdx: index('emb_doc_enabled_idx').on(table.documentId, table.enabled), @@ -3711,7 +3712,6 @@ export const embedding = pgTable( * version that ordered by a bare distance had drained. */ - // Text tag indexes tag1Idx: index('emb_kb_tag1_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag1})`), tag2Idx: index('emb_kb_tag2_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag2})`), tag3Idx: index('emb_kb_tag3_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag3})`), @@ -3719,7 +3719,6 @@ export const embedding = pgTable( tag5Idx: index('emb_kb_tag5_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag5})`), tag6Idx: index('emb_kb_tag6_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag6})`), tag7Idx: index('emb_kb_tag7_lower_idx').on(table.knowledgeBaseId, sql`lower(${table.tag7})`), - // Number tag indexes (5 slots) number1Idx: index('emb_number1_idx').on(table.number1), number2Idx: index('emb_number2_idx').on(table.number2), number3Idx: index('emb_number3_idx').on(table.number3), @@ -3728,12 +3727,10 @@ export const embedding = pgTable( /** Date tag filters compile to half-open ranges on the raw column, which these serve. */ date1Idx: index('emb_date1_idx').on(table.date1).concurrently(), date2Idx: index('emb_date2_idx').on(table.date2).concurrently(), - // Boolean tag indexes (3 slots) boolean1Idx: index('emb_boolean1_idx').on(table.boolean1), boolean2Idx: index('emb_boolean2_idx').on(table.boolean2), boolean3Idx: index('emb_boolean3_idx').on(table.boolean3), - // Full-text search index contentFtsIdx: index('emb_content_fts_idx').using('gin', table.contentTsv), /** @@ -3935,53 +3932,41 @@ export const docsEmbeddings = pgTable( headerLevel: integer('header_level').notNull(), tokenCount: integer('token_count').notNull(), - // Vector embedding - optimized for text-embedding-3-small with HNSW support + /** Vector embedding - optimized for text-embedding-3-small with HNSW support */ embedding: vector('embedding', { dimensions: 1536 }).notNull(), embeddingModel: text('embedding_model').notNull().default('text-embedding-3-small'), - // Metadata for flexible filtering metadata: jsonb('metadata').notNull().default('{}'), - // Full-text search support - generated tsvector column chunkTextTsv: tsvector('chunk_text_tsv').generatedAlwaysAs( (): SQL => sql`to_tsvector('english', ${docsEmbeddings.chunkText})` ), - // Timestamps createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }, (table) => ({ - // Source document queries sourceDocumentIdx: index('docs_emb_source_document_idx').on(table.sourceDocument), - // Header level filtering headerLevelIdx: index('docs_emb_header_level_idx').on(table.headerLevel), - // Combined source and header queries sourceHeaderIdx: index('docs_emb_source_header_idx').on( table.sourceDocument, table.headerLevel ), - // Model-specific queries modelIdx: index('docs_emb_model_idx').on(table.embeddingModel), - // Timestamp queries createdAtIdx: index('docs_emb_created_at_idx').on(table.createdAt), - // Vector similarity search indexes (HNSW) - optimized for documentation embeddings embeddingVectorHnswIdx: index('docs_embedding_vector_hnsw_idx') .using('hnsw', table.embedding.op('vector_cosine_ops')) .with(hnswIndexOptions()), - // GIN index for JSONB metadata queries metadataGinIdx: index('docs_emb_metadata_gin_idx').using('gin', table.metadata), - // Full-text search index chunkTextFtsIdx: index('docs_emb_chunk_text_fts_idx').using('gin', table.chunkTextTsv), - // Constraints embeddingNotNullCheck: check('docs_embedding_not_null_check', sql`"embedding" IS NOT NULL`), headerLevelCheck: check( 'docs_header_level_check', @@ -4021,8 +4006,10 @@ export const copilotChats = pgTable( planArtifact: text('plan_artifact'), config: jsonb('config'), resources: jsonb('resources').notNull().default('[]'), - // Copilot tool ids the user allowed for the rest of this chat only, as - // opposed to the account-wide list on `settings.copilotAutoAllowedTools`. + /** + * Copilot tool ids the user allowed for the rest of this chat only, as opposed to the + * account-wide list on `settings.copilotAutoAllowedTools`. + */ autoAllowedTools: jsonb('auto_allowed_tools').notNull().default('[]'), lastSeenAt: timestamp('last_seen_at'), pinned: boolean('pinned').notNull().default(false), @@ -4049,18 +4036,15 @@ export const copilotChats = pgTable( table.createdAt, table.id ), - // Primary access patterns userIdIdx: index('copilot_chats_user_id_idx').on(table.userId), workflowIdIdx: index('copilot_chats_workflow_id_idx').on(table.workflowId), userWorkflowIdx: index('copilot_chats_user_workflow_idx').on(table.userId, table.workflowId), - // Workspace access pattern userWorkspaceIdx2: index('copilot_chats_user_workspace_idx').on( table.userId, table.workspaceId ), - // Ordering indexes createdAtIdx: index('copilot_chats_created_at_idx').on(table.createdAt), updatedAtIdx: index('copilot_chats_updated_at_idx').on(table.updatedAt), workspaceCreatedAtIdIdx: index('copilot_chats_workspace_created_at_id_idx').on( @@ -4166,19 +4150,18 @@ export const workflowCheckpoints = pgTable( chatId: uuid('chat_id') .notNull() .references(() => copilotChats.id, { onDelete: 'cascade' }), - messageId: text('message_id'), // ID of the user message that triggered this checkpoint - workflowState: json('workflow_state').notNull(), // JSON workflow state + /** ID of the user message that triggered this checkpoint */ + messageId: text('message_id'), + workflowState: json('workflow_state').notNull(), createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }, (table) => ({ - // Primary access patterns userIdIdx: index('workflow_checkpoints_user_id_idx').on(table.userId), workflowIdIdx: index('workflow_checkpoints_workflow_id_idx').on(table.workflowId), chatIdIdx: index('workflow_checkpoints_chat_id_idx').on(table.chatId), messageIdIdx: index('workflow_checkpoints_message_id_idx').on(table.messageId), - // Combined indexes for common queries userWorkflowIdx: index('workflow_checkpoints_user_workflow_idx').on( table.userId, table.workflowId @@ -4188,7 +4171,6 @@ export const workflowCheckpoints = pgTable( table.chatId ), - // Ordering indexes createdAtIdx: index('workflow_checkpoints_created_at_idx').on(table.createdAt), chatCreatedAtIdx: index('workflow_checkpoints_chat_created_at_idx').on( table.chatId, @@ -4355,9 +4337,10 @@ export const copilotAsyncToolCalls = pgTable( status: copilotAsyncToolStatusEnum('status').notNull().default('pending'), result: jsonb('result'), error: text('error'), - // Set only for tools declaring requiresApproval in the mothership tool - // catalog. A null decision on such a tool means the prompt is still - // outstanding, which is what lets it survive a reload. + /** + * Set only for tools declaring requiresApproval in the mothership tool catalog. A null decision + * on such a tool means the prompt is still outstanding, which is what lets it survive a reload. + */ permissionDecision: copilotToolPermissionDecisionEnum('permission_decision'), permissionDecidedAt: timestamp('permission_decided_at'), claimedAt: timestamp('claimed_at'), @@ -4405,26 +4388,24 @@ export const copilotFeedback = pgTable( userQuery: text('user_query').notNull(), agentResponse: text('agent_response').notNull(), isPositive: boolean('is_positive').notNull(), - feedback: text('feedback'), // Optional feedback text - workflowYaml: text('workflow_yaml'), // Optional workflow YAML if edit/build workflow was triggered + feedback: text('feedback'), + /** Optional workflow YAML if edit/build workflow was triggered */ + workflowYaml: text('workflow_yaml'), createdAt: timestamp('created_at').notNull().defaultNow(), updatedAt: timestamp('updated_at').notNull().defaultNow(), }, (table) => ({ - // Access patterns userIdIdx: index('copilot_feedback_user_id_idx').on(table.userId), chatIdIdx: index('copilot_feedback_chat_id_idx').on(table.chatId), userChatIdx: index('copilot_feedback_user_chat_idx').on(table.userId, table.chatId), - // Query patterns isPositiveIdx: index('copilot_feedback_is_positive_idx').on(table.isPositive), - // Ordering indexes createdAtIdx: index('copilot_feedback_created_at_idx').on(table.createdAt), }) ) -// Tracks immutable deployment versions for each workflow +/** Tracks immutable deployment versions for each workflow */ export const workflowDeploymentVersion = pgTable( 'workflow_deployment_version', { @@ -4529,7 +4510,7 @@ export const workflowDeploymentOperation = pgTable( }) ) -// Idempotency keys for preventing duplicate processing across all webhooks and triggers +/** Idempotency keys for preventing duplicate processing across all webhooks and triggers */ export const idempotencyKey = pgTable( 'idempotency_key', { @@ -4538,7 +4519,6 @@ export const idempotencyKey = pgTable( createdAt: timestamp('created_at').notNull().defaultNow(), }, (table) => ({ - // Index for cleanup operations by creation time createdAtIdx: index('idempotency_key_created_at_idx').on(table.createdAt), }) ) @@ -4589,7 +4569,7 @@ export const mcpServers = pgTable( managedConnectorId: text('managed_connector_id'), oauthConfigVersion: integer('oauth_config_version').notNull().default(1), - // Track who created the server, but workspace owns it + /** Track who created the server, but workspace owns it */ createdBy: text('created_by').references(() => user.id, { onDelete: 'set null' }), name: text('name').notNull(), @@ -4637,7 +4617,6 @@ export const mcpServers = pgTable( sql`${table.organizationId} IS NULL OR ${table.credentialGroupId} IS NOT NULL` ), organizationIdx: index('mcp_servers_organization_id_idx').on(table.organizationId), - // Primary access pattern - active servers by workspace workspaceEnabledIdx: index('mcp_servers_workspace_enabled_idx').on( table.workspaceId, table.enabled @@ -4725,7 +4704,6 @@ export const mcpServerOauth = pgTable( }) ) -// SSO Provider table export const ssoProvider = pgTable( 'sso_provider', { diff --git a/packages/sim-cli/src/contract/commands.ts b/packages/sim-cli/src/contract/commands.ts index 9c1d3aa204e..f2e4cfd88ff 100644 --- a/packages/sim-cli/src/contract/commands.ts +++ b/packages/sim-cli/src/contract/commands.ts @@ -200,7 +200,7 @@ export const CLI_CONTRACT: CliContract = { ], }, - // ─── Name collisions: REST overloads one path for single and bulk ───────── + // Name collisions: REST overloads one path for single and bulk // The derived name is identical for both, so the bulk form is renamed. AWS's // `batch-` prefix rather than a `--all` flag: the plural is a different and // more dangerous operation, and it should be a different word. @@ -314,7 +314,6 @@ export const CLI_CONTRACT: CliContract = { }, setSecret: { hidden: true }, - // ─── Destructive single-resource operations ─────────────────────────────── // Soft deletes, all three: `tables restore`, `knowledge restore` and // `workflows restore` bring the resource back with its contents intact. The // messages promised an irreversible loss, which is the one thing a confirm @@ -374,7 +373,7 @@ export const CLI_CONTRACT: CliContract = { { header: 'remaining columns', path: 'columns', format: 'count' }, ], }, - // ─── Fields whose type misdescribes their meaning ───────────────────────── + // Fields whose type misdescribes their meaning // `z.string()` that the route splits on commas. No generator can infer this. listLogs: { describe: 'List run logs, such as failed or errored runs, by workflow, trigger or time', @@ -656,7 +655,6 @@ export const CLI_CONTRACT: CliContract = { ], }, - // ─── Friendlier flag names ──────────────────────────────────────────────── upsertTableRow: { describe: 'Insert a row, or update the one that conflicts on a unique column', flags: { @@ -800,7 +798,6 @@ export const CLI_CONTRACT: CliContract = { }, }, - // ─── Output columns for list commands ───────────────────────────────────── listTables: { flags: { folderPath: FOLDER_PATH_FLAG }, columns: [ @@ -837,7 +834,7 @@ export const CLI_CONTRACT: CliContract = { columns: [ { header: 'id' }, { header: 'name' }, - // Now that files live in folders, which one is the difference between two + // Files live in folders, so the folder is the difference between two // identically-named rows. FOLDER_COLUMN, { header: 'size', format: 'bytes' }, @@ -1321,7 +1318,6 @@ export const CLI_CONTRACT: CliContract = { }, }, - // ─── The expanded files surface ─────────────────────────────────────────── // Every one of these derives badly. `/files/move`, `/files/bulk-delete` and // `/files/[fileId]/restore` are verbs sitting where the deriver expects a // sub-resource, so it made them groups holding a lone `create`. @@ -1583,7 +1579,6 @@ export const CLI_CONTRACT: CliContract = { ], }, - // ─── Resource-scoped, path-addressed folders ────────────────────────────── /** * None of the four folder lists paginates: the route declares no `cursor` and * answers with the whole set. That is deliberate — a folder tree is bounded @@ -1704,7 +1699,6 @@ export const CLI_CONTRACT: CliContract = { confirm: 'This archives the workflow folder and, when recursive, everything inside it.', }, - // ─── The expanded tables surface ────────────────────────────────────────── // `/cancel-runs`, `/rows/search`, `/query/count` and the // enrichment path all put a verb where the deriver expects a sub-resource, so // each became a group holding a lone `create`. @@ -1847,7 +1841,7 @@ export const CLI_CONTRACT: CliContract = { describe: 'Get the download URL for a finished export', }, - // ─── Documents, not records ─────────────────────────────────────────────── + // Documents, not records // The payload is the artifact: `sim workflows export > wf.json` has to // produce something `sim workflows import` accepts back. exportWorkflow: { @@ -1861,7 +1855,6 @@ export const CLI_CONTRACT: CliContract = { document: true, }, - // ─── Catalog ────────────────────────────────────────────────────────────── // `tools get` and `tools list` derive cleanly; only the verb needs naming, for // the same reason `workflows run` does — `/execute` is not in the action list, // so POST would derive `tools execute create`. @@ -1894,7 +1887,6 @@ export const CLI_CONTRACT: CliContract = { ], }, - // ─── Runs ───────────────────────────────────────────────────────────────── // The derived names land badly here: `/execute` and `/cancel` are verbs in // the path, but neither is in the action list, so POST would derive // `workflows execute create` and `workflows cancel create`. @@ -2030,7 +2022,7 @@ export const CLI_CONTRACT: CliContract = { ], }, - // ─── Not a terminal-shaped operation ────────────────────────────────────── + // Not a terminal-shaped operation // Multipart upload; `sim knowledge documents upload ` needs its // own file-reading command rather than a generated flag surface. uploadKnowledgeDocument: { hidden: true }, @@ -2039,8 +2031,8 @@ export const CLI_CONTRACT: CliContract = { completeKnowledgeDocumentUpload: { hidden: true }, abortKnowledgeDocumentUpload: { hidden: true }, - // ─── Steps of a transfer, not commands ──────────────────────────────────── - // Uploading is now a presigned multipart handshake: create the upload, ask for + // Steps of a transfer, not commands + // Uploading is a presigned multipart handshake: create the upload, ask for // part URLs in batches, PUT each part to storage, then complete with the // ETags — and abort if any of it fails. Exposing the steps individually would // advertise a protocol whose halfway states leak storage, so `sim files diff --git a/packages/testing/src/mocks/index.ts b/packages/testing/src/mocks/index.ts index fc4cc9a55f2..1f8cee67fec 100644 --- a/packages/testing/src/mocks/index.ts +++ b/packages/testing/src/mocks/index.ts @@ -45,12 +45,10 @@ export { asyncJobsRegionMock, asyncJobsRegionMockFns, } from './async-jobs-region.mock' -// Audit mocks export { auditMock, auditMockFns, } from './audit.mock' -// Auth mocks export { authMock, authMockFns, @@ -166,7 +164,6 @@ export { blockVisibilityMockFns, type MockBlockVisibilityState, } from './block-visibility.mock' -// Blocks mocks export { blocksMock, createMockGetBlock, @@ -228,7 +225,6 @@ export { customBlockOperationsMockFns, MockCustomBlockValidationError, } from './custom-block-operations.mock' -// Database mocks export { createMockSql, databaseMock, @@ -273,12 +269,10 @@ export { emcnIconsMock, getEmcnIconStub, } from './emcn-icons.mock' -// Encryption mocks export { encryptionMock, encryptionMockFns, } from './encryption.mock' -// Env mocks export { createEnvMock, defaultMockEnv, @@ -287,7 +281,6 @@ export { resetEnvMock, setEnv, } from './env.mock' -// Env flag mocks export { envFlagsMock, envFlagsMockFns, @@ -328,7 +321,7 @@ export { featureFlagsMockFns, } from './feature-flags.mock' // Executor mocks - use side-effect import: import '@sim/testing/mocks/executor' -// Fetch mocks + export { createMockFetch, createMockResponse, @@ -369,7 +362,6 @@ export { humanInTheLoopManagerMock, humanInTheLoopManagerMockFns, } from './human-in-the-loop-manager.mock' -// Hybrid auth mocks export { hybridAuthMock, hybridAuthMockFns, @@ -379,7 +371,6 @@ export { idMockFns, resetIdMock, } from './id.mock' -// Input validation mocks export { inputValidationMock, inputValidationMockFns, @@ -482,7 +473,6 @@ export { libDesktopMock, libDesktopMockFns, } from './lib-desktop.mock' -// Logger mocks export { createMockLogger, getAllMockLoggers, @@ -624,7 +614,6 @@ export { permissionGroupLocksMock, permissionGroupLocksMockFns, } from './permission-group-locks.mock' -// Permission mocks export { permissionGroupScopeMock, permissionGroupScopeMockFns, @@ -709,7 +698,6 @@ export { remoteSandboxProviderMock, remoteSandboxProviderMockFns, } from './remote-sandbox-provider.mock' -// Request mocks export { createMockRequest, type MockRequestOptions, @@ -722,7 +710,6 @@ export { resourcePolicyRepositoryMock, resourcePolicyRepositoryMockFns, } from './resource-policy-repository.mock' -// Schema mocks export { type MockSchemaTable, schemaMock } from './schema.mock' export { searchReplaceIndexerMock, @@ -754,7 +741,6 @@ export { storageServiceMock, storageServiceMockFns, } from './storage-service.mock' -// Stripe mocks export { createMockStripeEvent, stripeClientMock, @@ -842,7 +828,6 @@ export { tableWorkflowColumnsMock, tableWorkflowColumnsMockFns, } from './table-workflow-columns.mock' -// Telemetry mocks export { getMockPlatformEvent, telemetryMock, telemetryMockFns } from './telemetry.mock' // Terminal console mocks (for @/stores/terminal and @/stores/terminal/console/store) export { @@ -911,7 +896,6 @@ export { setUploadDirServer, uploadsSetupMock, } from './uploads-setup.mock' -// URL mocks export { resetUrlsMock, urlsMock, @@ -990,7 +974,6 @@ export { workflowsQueriesMock, workflowsQueriesMockFns, } from './workflows-queries.mock' -// Workflows-utils mocks export { workflowsUtilsMock, workflowsUtilsMockFns, diff --git a/scripts/generate-docs.ts b/scripts/generate-docs.ts index e71fd3aa401..3df041056fc 100755 --- a/scripts/generate-docs.ts +++ b/scripts/generate-docs.ts @@ -4868,9 +4868,7 @@ function cleanupStaleToolDocs(validToolDocs: Set): void { } } -// ============================================================================ // Trigger Documentation Generation -// ============================================================================ /** * Format a trigger provider name for display, falling back to Title Case. From e145b10cef031adfb661ad548a88c9b109116b05 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Thu, 1 Oct 2026 17:33:29 -0700 Subject: [PATCH 4/4] fix(audits): fail comment-hygiene on unparsable files, raise listing buffer, correct ribbon arc note --- apps/sim/lib/pptx-renderer/shapes/presets.ts | 2 +- scripts/check-comment-hygiene.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/sim/lib/pptx-renderer/shapes/presets.ts b/apps/sim/lib/pptx-renderer/shapes/presets.ts index cb0889ccbb2..c9334c78d36 100644 --- a/apps/sim/lib/pptx-renderer/shapes/presets.ts +++ b/apps/sim/lib/pptx-renderer/shapes/presets.ts @@ -6120,7 +6120,7 @@ multiPathPresets.set('horizontalscroll', (w, h, adjustments) => { p1.push(arc.svg) cx = arc.x cy = arc.y - // arcTo from (w, ch2) with stAng=0 swAng=90° ends at (x4, 0); then lnTo (x4, ch2) + // The arc ends at (x4, ch): center (x4, ch2), swept 90° from stAng=0. lnTo back up to (x4, ch2). p1.push(`L${x4},${ch2}`) // arcTo wR=ch4 hR=ch4 stAng=0 swAng=cd2(180°) arc = ooArcTo(x4, ch2, ch4, ch4, 0, 180) diff --git a/scripts/check-comment-hygiene.ts b/scripts/check-comment-hygiene.ts index bfafa4de67e..a747f9fc799 100644 --- a/scripts/check-comment-hygiene.ts +++ b/scripts/check-comment-hygiene.ts @@ -30,6 +30,7 @@ import { readFileSync } from 'node:fs' import path from 'node:path' import { fileURLToPath } from 'node:url' import { parse } from '@babel/parser' +import { getErrorMessage } from '@sim/utils/errors' const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') const ALLOW = 'comment-hygiene-allow:' @@ -163,8 +164,8 @@ export function findViolations(file: string, source: string): Violation[] { plugins: ['typescript', ...(jsx ? (['jsx'] as const) : []), 'decorators'], errorRecovery: true, }).comments ?? [] - } catch { - return [] + } catch (error) { + throw new Error(`Cannot parse ${file} to check its comments: ${getErrorMessage(error)}`) } const lines = source.split('\n') @@ -215,6 +216,8 @@ function sourceFiles(): string[] { return execFileSync('git', ['ls-files', '*.ts', '*.tsx', '*.mts', '*.cts', '*.mjs', '*.cjs'], { cwd: ROOT, encoding: 'utf8', + // The listing is already ~1 MB, the default execFileSync ceiling. + maxBuffer: 64 * 1024 * 1024, }) .split('\n') .filter((file) => file && !EXCLUDED.some((pattern) => pattern.test(file)))