Skip to content

Commit f3be21a

Browse files
committed
chore: regenerate tool metadata, docs and ratchet baselines
1 parent 908b240 commit f3be21a

4 files changed

Lines changed: 19 additions & 29 deletions

File tree

‎apps/sim/blocks/blocks/ashby.test.ts‎

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { describe, expect, it } from 'vitest'
22
import { AshbyBlock } from './ashby'
33

4+
const blockParams = AshbyBlock.tools.config?.params
5+
if (!blockParams) throw new Error('AshbyBlock has no params mapper')
6+
47
describe('AshbyBlock', () => {
58
const buildParams = (operation: string, extra: Record<string, unknown>) => ({
69
operation,
@@ -9,7 +12,7 @@ describe('AshbyBlock', () => {
912

1013
describe('alternateEmailAddresses parsing (create_candidate)', () => {
1114
it('parses a comma-separated string into an array', () => {
12-
const result = AshbyBlock.tools.config.params!(
15+
const result = blockParams(
1316
buildParams('create_candidate', {
1417
alternateEmailAddresses: 'a@x.com, b@x.com',
1518
})
@@ -20,34 +23,28 @@ describe('AshbyBlock', () => {
2023

2124
describe('socialLinks parsing (update_candidate)', () => {
2225
it('preserves an empty JSON array so users can clear all social links', () => {
23-
const result = AshbyBlock.tools.config.params!(
24-
buildParams('update_candidate', { socialLinks: '[]' })
25-
)
26+
const result = blockParams(buildParams('update_candidate', { socialLinks: '[]' }))
2627
expect(result.socialLinks).toEqual([])
2728
})
2829

2930
it('throws instead of silently dropping the field when the JSON is malformed', () => {
3031
// A silent [] here would let the Ashby update proceed without applying
3132
// the requested links and with no error shown to the workflow author.
3233
expect(() =>
33-
AshbyBlock.tools.config.params!(
34-
buildParams('update_candidate', { socialLinks: 'not json' })
35-
)
34+
blockParams(buildParams('update_candidate', { socialLinks: 'not json' }))
3635
).toThrow(/Invalid JSON in Ashby social links/)
3736
})
3837

3938
it('throws when the parsed JSON is not an array', () => {
4039
expect(() =>
41-
AshbyBlock.tools.config.params!(
42-
buildParams('update_candidate', { socialLinks: '{"type":"Twitter"}' })
43-
)
40+
blockParams(buildParams('update_candidate', { socialLinks: '{"type":"Twitter"}' }))
4441
).toThrow(/expected a JSON array/)
4542
})
4643
})
4744

4845
describe('nullable candidate updates', () => {
4946
it('preserves nulls from dynamic references for aliased update fields', () => {
50-
const result = AshbyBlock.tools.config.params!(
47+
const result = blockParams(
5148
buildParams('update_candidate', {
5249
updateName: null,
5350
candidateLocation: null,
@@ -63,17 +60,14 @@ describe('AshbyBlock', () => {
6360
describe('archiveEmail parsing (change_application_stage)', () => {
6461
it('rejects non-object archive email input', () => {
6562
expect(() =>
66-
AshbyBlock.tools.config.params!(
67-
buildParams('change_application_stage', { archiveEmail: 'true' })
68-
)
63+
blockParams(buildParams('change_application_stage', { archiveEmail: 'true' }))
6964
).toThrow(/expected a JSON object/)
7065
})
7166
})
7267

7368
describe('fieldValue parsing (set_custom_field_value)', () => {
7469
const parse = (fieldValue: unknown) =>
75-
AshbyBlock.tools.config.params!(buildParams('set_custom_field_value', { fieldValue }))
76-
.fieldValue
70+
blockParams(buildParams('set_custom_field_value', { fieldValue })).fieldValue
7771

7872
it('decodes null so the annotation can be cleared', () => {
7973
// Ashby clears a custom field when it receives an explicit null, which is
@@ -106,17 +100,13 @@ describe('AshbyBlock', () => {
106100
describe('fieldValues parsing (set_custom_field_values)', () => {
107101
it('throws instead of silently dropping the writes when the JSON is malformed', () => {
108102
expect(() =>
109-
AshbyBlock.tools.config.params!(
110-
buildParams('set_custom_field_values', { fieldValues: 'not json' })
111-
)
103+
blockParams(buildParams('set_custom_field_values', { fieldValues: 'not json' }))
112104
).toThrow(/Invalid JSON in Ashby custom field values/)
113105
})
114106

115107
it('throws when the parsed JSON is not an array', () => {
116108
expect(() =>
117-
AshbyBlock.tools.config.params!(
118-
buildParams('set_custom_field_values', { fieldValues: '{"fieldId":"abc"}' })
119-
)
109+
blockParams(buildParams('set_custom_field_values', { fieldValues: '{"fieldId":"abc"}' }))
120110
).toThrow(/expected a JSON array/)
121111
})
122112
})
@@ -126,7 +116,7 @@ describe('AshbyBlock', () => {
126116
// The Source ID field is hidden once the clear switch is on, but a value
127117
// typed beforehand is still stored. Sending both would trip the tool's
128118
// exclusivity guard and surface as an error the user cannot see the cause of.
129-
const result = AshbyBlock.tools.config.params!(
119+
const result = blockParams(
130120
buildParams('change_application_source', {
131121
changeSourceId: 'src-left-over',
132122
unsetSource: 'true',
@@ -146,7 +136,7 @@ describe('AshbyBlock', () => {
146136
// result, not just the mapping, since that gap is where the bug lived.
147137
const merge = (inputs: Record<string, unknown>) => ({
148138
...inputs,
149-
...AshbyBlock.tools.config.params!(inputs),
139+
...blockParams(inputs),
150140
})
151141

152142
const cleared = merge(
@@ -182,7 +172,7 @@ describe('AshbyBlock', () => {
182172
describe('agent tool calls (operation only in context)', () => {
183173
const toolCall = (operation: string, args: Record<string, unknown>) => ({
184174
...args,
185-
...AshbyBlock.tools.config.params!(args, { operation }),
175+
...blockParams(args, { operation }),
186176
})
187177

188178
it('maps block-only fields saved on the tool row to the tool params', () => {

‎apps/sim/blocks/blocks/latex.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { describe, expect, it } from 'vitest'
22
import { LatexBlock } from '@/blocks/blocks/latex'
33

4-
const mapParams = LatexBlock.tools.config!.params!
4+
const mapParams = LatexBlock.tools.config?.params
5+
if (!mapParams) throw new Error('LatexBlock has no params mapper')
56

67
describe('LatexBlock agent tool calls', () => {
78
it('forwards a search query typed into the tool row, which carries no operation in its params', () => {

‎apps/sim/blocks/blocks/logs.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ describe('LogsV2Block backwards compatibility', () => {
7979
})
8080

8181
describe('LogsBlock agent tool calls', () => {
82-
const mapParams = LogsBlock.tools.config!.params!
82+
const mapParams = LogsBlock.tools.config?.params
83+
if (!mapParams) throw new Error('LogsBlock has no params mapper')
8384

8485
it('sends the log id typed into the tool row instead of query filters', () => {
8586
expect(mapParams({ logId: 'log-1' }, { operation: 'get_log' })).toEqual({ id: 'log-1' })

‎scripts/check-explicit-any.baseline.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
"apps/sim/blocks/blocks/agent.ts": 6,
7979
"apps/sim/blocks/blocks/apify.ts": 2,
8080
"apps/sim/blocks/blocks/browser_use.ts": 2,
81-
"apps/sim/blocks/blocks/context_dev.ts": 1,
8281
"apps/sim/blocks/blocks/deployments.ts": 2,
8382
"apps/sim/blocks/blocks/enrich.ts": 2,
8483
"apps/sim/blocks/blocks/evaluator.ts": 4,
@@ -1207,7 +1206,6 @@
12071206
"apps/sim/background/workflow-execution.ts": 2,
12081207
"apps/sim/blocks/blocks.test.ts": 7,
12091208
"apps/sim/blocks/blocks/airtable.test.ts": 1,
1210-
"apps/sim/blocks/blocks/ashby.test.ts": 11,
12111209
"apps/sim/blocks/blocks/cbinsights.test.ts": 2,
12121210
"apps/sim/blocks/blocks/crunchbase.test.ts": 2,
12131211
"apps/sim/blocks/blocks/google_slides.ts": 3,

0 commit comments

Comments
 (0)