Skip to content

Commit 5553c44

Browse files
authored
improvement(brex): fill validate-integration gaps against live API docs (#5362)
- add wandConfig AI-autofill to expense/spend-limit filter subBlocks - surface is_ppro_enabled on get/list transfer tools - surface start_date/end_date/authorization_settings on list_spend_limits to match get_spend_limit
1 parent 220da44 commit 5553c44

5 files changed

Lines changed: 48 additions & 0 deletions

File tree

apps/sim/blocks/blocks/brex.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ export const BrexBlock: BlockConfig<BrexResponse> = {
215215
placeholder: 'Comma-separated user IDs to filter by',
216216
mode: 'advanced',
217217
condition: { field: 'operation', value: ['list_expenses', 'list_card_transactions'] },
218+
wandConfig: {
219+
enabled: true,
220+
prompt:
221+
'Generate a comma-separated list of Brex user IDs to filter by based on the description.\n\nReturn ONLY the comma-separated user IDs - no explanations, no extra text.',
222+
placeholder: 'Describe which users to include...',
223+
},
218224
},
219225
{
220226
id: 'statuses',
@@ -223,6 +229,12 @@ export const BrexBlock: BlockConfig<BrexResponse> = {
223229
placeholder: 'e.g., APPROVED, SETTLED (comma-separated)',
224230
mode: 'advanced',
225231
condition: { field: 'operation', value: 'list_expenses' },
232+
wandConfig: {
233+
enabled: true,
234+
prompt:
235+
'Generate a comma-separated list of Brex expense statuses to filter by.\n\nValid statuses: DRAFT, SUBMITTED, APPROVED, OUT_OF_POLICY, VOID, CANCELED, SPLIT, SETTLED\n\nExamples:\n- "only settled expenses" -> SETTLED\n- "approved or settled" -> APPROVED,SETTLED\n- "expenses awaiting review" -> DRAFT,SUBMITTED\n\nReturn ONLY the comma-separated status values - no explanations, no extra text.',
236+
placeholder: 'Describe which expense statuses to include...',
237+
},
226238
},
227239
{
228240
id: 'paymentStatuses',
@@ -231,6 +243,12 @@ export const BrexBlock: BlockConfig<BrexResponse> = {
231243
placeholder: 'e.g., CLEARED, REFUNDED (comma-separated)',
232244
mode: 'advanced',
233245
condition: { field: 'operation', value: 'list_expenses' },
246+
wandConfig: {
247+
enabled: true,
248+
prompt:
249+
'Generate a comma-separated list of Brex expense payment statuses to filter by.\n\nValid statuses: NOT_STARTED, PROCESSING, CANCELED, DECLINED, CLEARED, REFUNDING, REFUNDED, CASH_ADVANCE, CREDITED, AWAITING_PAYMENT, SCHEDULED\n\nExamples:\n- "only cleared payments" -> CLEARED\n- "refunded or refunding" -> REFUNDED,REFUNDING\n\nReturn ONLY the comma-separated status values - no explanations, no extra text.',
250+
placeholder: 'Describe which payment statuses to include...',
251+
},
234252
},
235253
{
236254
id: 'purchasedAtStart',
@@ -284,6 +302,12 @@ export const BrexBlock: BlockConfig<BrexResponse> = {
284302
placeholder: 'Comma-separated user IDs to filter spend limits by member',
285303
mode: 'advanced',
286304
condition: { field: 'operation', value: 'list_spend_limits' },
305+
wandConfig: {
306+
enabled: true,
307+
prompt:
308+
'Generate a comma-separated list of Brex user IDs to filter spend limits by member based on the description.\n\nReturn ONLY the comma-separated user IDs - no explanations, no extra text.',
309+
placeholder: 'Describe which spend limit members to include...',
310+
},
287311
},
288312
{
289313
id: 'cursor',

apps/sim/tools/brex/get_transfer.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ export const brexGetTransferTool: ToolConfig<BrexGetTransferParams, BrexGetTrans
5050
createdAt: data.created_at ?? null,
5151
displayName: data.display_name ?? null,
5252
externalMemo: data.external_memo ?? null,
53+
isPproEnabled: data.is_ppro_enabled ?? null,
5354
},
5455
}
5556
},
@@ -97,5 +98,10 @@ export const brexGetTransferTool: ToolConfig<BrexGetTransferParams, BrexGetTrans
9798
createdAt: { type: 'string', description: 'Creation timestamp', optional: true },
9899
displayName: { type: 'string', description: 'Transfer display name', optional: true },
99100
externalMemo: { type: 'string', description: 'External memo', optional: true },
101+
isPproEnabled: {
102+
type: 'boolean',
103+
description: 'Whether Principal Protection (PPRO) is enabled',
104+
optional: true,
105+
},
100106
},
101107
}

apps/sim/tools/brex/list_spend_limits.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ export const brexListSpendLimitsTool: ToolConfig<
8888
description: 'Period recurrence (PER_WEEK, PER_MONTH, PER_QUARTER, PER_YEAR, ONE_TIME)',
8989
},
9090
spend_type: { type: 'string', description: 'Spend type of the limit' },
91+
start_date: { type: 'string', description: 'Spend limit start date', optional: true },
92+
end_date: { type: 'string', description: 'Spend limit end date', optional: true },
9193
owner_user_ids: { type: 'array', description: 'User IDs of the spend limit owners' },
9294
member_user_ids: { type: 'array', description: 'User IDs of the spend limit members' },
9395
current_period_balance: {
@@ -96,6 +98,12 @@ export const brexListSpendLimitsTool: ToolConfig<
9698
optional: true,
9799
properties: BREX_SPEND_LIMIT_PERIOD_BALANCE_PROPERTIES,
98100
},
101+
authorization_settings: {
102+
type: 'json',
103+
description:
104+
'Authorization settings (base limit, authorization type, rollover refresh)',
105+
optional: true,
106+
},
99107
},
100108
},
101109
},

apps/sim/tools/brex/list_transfers.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ export const brexListTransfersTool: ToolConfig<BrexPaginationParams, BrexListTra
115115
created_at: { type: 'string', description: 'Creation timestamp', optional: true },
116116
display_name: { type: 'string', description: 'Transfer display name', optional: true },
117117
external_memo: { type: 'string', description: 'External memo', optional: true },
118+
is_ppro_enabled: {
119+
type: 'boolean',
120+
description: 'Whether Principal Protection (PPRO) is enabled',
121+
optional: true,
122+
},
118123
},
119124
},
120125
},

apps/sim/tools/brex/types.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,12 @@ export interface BrexSpendLimit {
143143
status: string
144144
period_recurrence_type: string
145145
spend_type: string
146+
start_date: string | null
147+
end_date: string | null
146148
owner_user_ids: string[]
147149
member_user_ids: string[]
148150
current_period_balance: BrexSpendLimitPeriodBalance | null
151+
authorization_settings: Record<string, unknown> | null
149152
}
150153

151154
export interface BrexVendor {
@@ -171,6 +174,7 @@ export interface BrexTransfer {
171174
created_at: string | null
172175
display_name: string | null
173176
external_memo: string | null
177+
is_ppro_enabled: boolean | null
174178
}
175179

176180
export interface BrexCard {
@@ -551,6 +555,7 @@ export interface BrexGetTransferResponse extends ToolResponse {
551555
createdAt: string | null
552556
displayName: string | null
553557
externalMemo: string | null
558+
isPproEnabled: boolean | null
554559
}
555560
}
556561

0 commit comments

Comments
 (0)