Skip to content

Commit b56abfb

Browse files
committed
updated docs gen script
1 parent 4c4f708 commit b56abfb

File tree

7 files changed

+242
-73
lines changed

7 files changed

+242
-73
lines changed

apps/docs/content/docs/en/tools/a2a.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,9 @@ Fetch the Agent Card (discovery document) for an A2A agent.
122122
| `provider` | object | Creator organization details |
123123
| `capabilities` | object | Feature support matrix |
124124
| `skills` | array | Available operations |
125-
| `protocolVersions` | array | Supported A2A protocol versions |
125+
| `version` | string | A2A protocol version supported by the agent |
126+
| `defaultInputModes` | array | Default input content types accepted by the agent |
127+
| `defaultOutputModes` | array | Default output content types produced by the agent |
126128

127129
### `a2a_resubscribe`
128130

apps/docs/content/docs/en/tools/github.mdx

Lines changed: 197 additions & 59 deletions
Large diffs are not rendered by default.

apps/sim/tools/a2a/get_agent_card.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ export const a2aGetAgentCardTool: ToolConfig<A2AGetAgentCardParams, A2AGetAgentC
4949
provider: A2A_OUTPUT_PROPERTIES.agentProvider,
5050
capabilities: A2A_OUTPUT_PROPERTIES.agentCapabilities,
5151
skills: A2A_OUTPUT_PROPERTIES.agentSkills,
52-
protocolVersions: A2A_OUTPUT_PROPERTIES.protocolVersions,
52+
version: A2A_OUTPUT_PROPERTIES.version,
53+
defaultInputModes: A2A_OUTPUT_PROPERTIES.defaultInputModes,
54+
defaultOutputModes: A2A_OUTPUT_PROPERTIES.defaultOutputModes,
5355
},
5456
}

apps/sim/tools/a2a/types.ts

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,11 +171,23 @@ export const A2A_OUTPUT_PROPERTIES = {
171171
optional: true,
172172
},
173173

174-
/** Protocol versions */
175-
protocolVersions: {
174+
/** Protocol version (single string from protocolVersion field) */
175+
version: { type: 'string', description: 'A2A protocol version supported by the agent' },
176+
177+
/** Default input modes */
178+
defaultInputModes: {
176179
type: 'array',
177-
description: 'Supported A2A protocol versions',
180+
description: 'Default input content types accepted by the agent',
178181
items: { type: 'string' },
182+
optional: true,
183+
},
184+
185+
/** Default output modes */
186+
defaultOutputModes: {
187+
type: 'array',
188+
description: 'Default output content types produced by the agent',
189+
items: { type: 'string' },
190+
optional: true,
179191
},
180192

181193
/** Push notification webhook URL */
@@ -225,6 +237,8 @@ export interface A2AGetAgentCardResponse extends ToolResponse {
225237
name: string
226238
description?: string
227239
}>
240+
defaultInputModes?: string[]
241+
defaultOutputModes?: string[]
228242
}
229243
}
230244

apps/sim/triggers/circleback/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,5 @@ export function buildMeetingOutputs(): Record<string, TriggerOutput> {
133133
recordingUrl: { type: 'string', description: 'Recording URL' },
134134
},
135135
},
136-
} as Record<string, TriggerOutput>
136+
} as any
137137
}

apps/sim/triggers/typeform/webhook.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ export const typeformWebhookTrigger: TriggerConfig = {
133133
type: 'object',
134134
properties: {
135135
key: { type: 'string', description: 'Variable key' },
136-
type: { type: 'string', description: 'Variable type (number, text)' },
137136
number: { type: 'number', description: 'Numeric value (if type is number)' },
138137
text: { type: 'string', description: 'Text value (if type is text)' },
139138
},
@@ -149,11 +148,6 @@ export const typeformWebhookTrigger: TriggerConfig = {
149148
items: {
150149
type: 'object',
151150
properties: {
152-
type: {
153-
type: 'string',
154-
description:
155-
'Answer type (text, choice, choices, email, number, boolean, date, file_url, payment, url)',
156-
},
157151
text: { type: 'string', description: 'Text answer value' },
158152
email: { type: 'string', description: 'Email answer value' },
159153
number: { type: 'number', description: 'Number answer value' },
@@ -185,7 +179,6 @@ export const typeformWebhookTrigger: TriggerConfig = {
185179
properties: {
186180
id: { type: 'string', description: 'Field ID' },
187181
ref: { type: 'string', description: 'Field reference' },
188-
type: { type: 'string', description: 'Field type' },
189182
},
190183
},
191184
},
@@ -211,7 +204,6 @@ export const typeformWebhookTrigger: TriggerConfig = {
211204
properties: {
212205
id: { type: 'string', description: 'Field ID' },
213206
ref: { type: 'string', description: 'Field reference' },
214-
type: { type: 'string', description: 'Field type' },
215207
title: { type: 'string', description: 'Field title' },
216208
},
217209
},

scripts/generate-docs.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,6 +1419,27 @@ function parseToolOutputsField(outputsContent: string, toolPrefix?: string): Rec
14191419
outputs[propName] = resolvedConst[accessedProp]
14201420
}
14211421
}
1422+
1423+
// Pattern 3: Spread operator (e.g., "...COMMENT_OUTPUT_PROPERTIES,")
1424+
const spreadRegex = /\.\.\.([A-Z][A-Z_0-9]+)\s*(?:,|$)/g
1425+
let spreadMatch
1426+
while ((spreadMatch = spreadRegex.exec(outputsContent)) !== null) {
1427+
const constName = spreadMatch[1]
1428+
1429+
// Check if at depth 0 (not inside nested braces)
1430+
const beforeMatch = outputsContent.substring(0, spreadMatch.index)
1431+
const openBraces = (beforeMatch.match(/\{/g) || []).length
1432+
const closeBraces = (beforeMatch.match(/\}/g) || []).length
1433+
if (openBraces !== closeBraces) {
1434+
continue
1435+
}
1436+
1437+
const resolvedConst = resolveConstReference(constName, toolPrefix)
1438+
if (resolvedConst && typeof resolvedConst === 'object') {
1439+
// Spread all properties from the resolved const
1440+
Object.assign(outputs, resolvedConst)
1441+
}
1442+
}
14221443
}
14231444

14241445
const braces: Array<{ type: 'open' | 'close'; pos: number; level: number }> = []

0 commit comments

Comments
 (0)