Skip to content

Commit cba1939

Browse files
Merge branch 'simstudioai:main' into main
2 parents 377cb52 + 97a609a commit cba1939

1,290 files changed

Lines changed: 99616 additions & 12210 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/rules/global.md

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,22 +36,31 @@ const tiny = generateShortId(8)
3636
## Common Utilities
3737
Use shared helpers from `@sim/utils` instead of writing inline implementations:
3838

39-
- `sleep(ms)` — async delay. Never write `new Promise(resolve => setTimeout(resolve, ms))`
40-
- `toError(value)` — normalize unknown caught values to `Error`. Never write `e instanceof Error ? e : new Error(String(e))`
41-
- `toError(value).message` — get error message safely. Never write `e instanceof Error ? e.message : String(e)`
39+
- `sleep(ms)` from `@sim/utils/helpers` — async delay. Never write `new Promise(resolve => setTimeout(resolve, ms))`
40+
- `toError(value)` from `@sim/utils/errors` — normalize unknown caught values to `Error`. Never write `e instanceof Error ? e : new Error(String(e))`
41+
- `getErrorMessage(value, fallback?)` from `@sim/utils/errors` — extract error message string. Never write `e instanceof Error ? e.message : 'fallback'`
42+
- `structuredClone(value)` — built-in deep clone, no import needed. Never write `JSON.parse(JSON.stringify(obj))`
43+
- `omit(obj, keys)` from `@sim/utils/object` — remove keys from object
44+
- `filterUndefined(obj)` from `@sim/utils/object` — strip undefined-valued keys. Never write `Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined))`
45+
- `truncate(str, maxLength, suffix?)` from `@sim/utils/string` — safe string truncation with ellipsis
46+
- `backoffWithJitter(attempt, retryAfterMs, options?)` from `@sim/utils/retry` — exponential backoff with jitter
47+
- `parseRetryAfter(header)` from `@sim/utils/retry` — parse HTTP `Retry-After` header to milliseconds
4248

4349
```typescript
4450
// ✗ Bad
4551
await new Promise(resolve => setTimeout(resolve, 1000))
46-
const msg = error instanceof Error ? error.message : String(error)
47-
const err = error instanceof Error ? error : new Error(String(error))
52+
const msg = error instanceof Error ? error.message : 'Unknown error'
53+
const clone = JSON.parse(JSON.stringify(obj))
54+
const filtered = Object.fromEntries(Object.entries(obj).filter(([, v]) => v !== undefined))
4855

4956
// ✓ Good
5057
import { sleep } from '@sim/utils/helpers'
51-
import { toError } from '@sim/utils/errors'
58+
import { getErrorMessage, toError } from '@sim/utils/errors'
59+
import { filterUndefined } from '@sim/utils/object'
5260
await sleep(1000)
53-
const msg = toError(error).message
54-
const err = toError(error)
61+
const msg = getErrorMessage(error, 'Unknown error')
62+
const clone = structuredClone(obj)
63+
const filtered = filterUndefined(obj)
5564
```
5665

5766
## Package Manager

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,3 +84,4 @@ i18n.cache
8484
.claude/launch.json
8585
.claude/worktrees/
8686
.claude/scheduled_tasks.lock
87+
.deepsec/

CLAUDE.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@ You are a professional software engineer. All code must follow best practices: a
1010
- **Comments**: Use TSDoc for documentation. No `====` separators. No non-TSDoc comments
1111
- **Styling**: Never update global styles. Keep all styling local to components
1212
- **ID Generation**: Never use `crypto.randomUUID()`, `nanoid`, or `uuid` package. Use `generateId()` (UUID v4) or `generateShortId()` (compact) from `@sim/utils/id`
13-
- **Common Utilities**: Use shared helpers from `@sim/utils` instead of inline implementations. `sleep(ms)` from `@sim/utils/helpers` for delays, `toError(e)` from `@sim/utils/errors` to normalize caught values.
13+
- **Common Utilities**: Use shared helpers from `@sim/utils` instead of inline implementations:
14+
- `sleep(ms)` from `@sim/utils/helpers` — never `new Promise(resolve => setTimeout(resolve, ms))`
15+
- `toError(e)` from `@sim/utils/errors` — normalize caught values to `Error`
16+
- `getErrorMessage(e, fallback?)` from `@sim/utils/errors` — extract message string from unknown caught value; never write `e instanceof Error ? e.message : 'fallback'`
17+
- `structuredClone(value)` — built-in deep clone; never `JSON.parse(JSON.stringify(...))`
18+
- `omit(obj, keys)` / `filterUndefined(obj)` from `@sim/utils/object` — object trimming; never `Object.fromEntries(Object.entries(...).filter(...))`
19+
- `truncate(str, maxLength, suffix?)` from `@sim/utils/string` — never inline slice + ellipsis
20+
- `backoffWithJitter(attempt, retryAfterMs, options?)` / `parseRetryAfter(header)` from `@sim/utils/retry` — shared retry pacing; never reimplement exponential backoff inline
1421
- **Package Manager**: Use `bun` and `bunx`, not `npm` and `npx`
1522

1623
## Architecture

apps/docs/components/icons.tsx

Lines changed: 165 additions & 0 deletions
Large diffs are not rendered by default.

apps/docs/components/ui/icon-mapping.ts

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import {
2020
AshbyIcon,
2121
AthenaIcon,
2222
AttioIcon,
23+
AzureDevOpsIcon,
2324
AzureIcon,
2425
BoxCompanyIcon,
2526
BrainIcon,
@@ -58,6 +59,7 @@ import {
5859
ExtendIcon,
5960
EyeIcon,
6061
FathomIcon,
62+
FindymailIcon,
6163
FirecrawlIcon,
6264
FirefliesIcon,
6365
GammaIcon,
@@ -126,6 +128,7 @@ import {
126128
MongoDBIcon,
127129
MySQLIcon,
128130
Neo4jIcon,
131+
NewRelicIcon,
129132
NotionIcon,
130133
ObsidianIcon,
131134
OktaIcon,
@@ -143,9 +146,11 @@ import {
143146
PostgresIcon,
144147
PosthogIcon,
145148
ProfoundIcon,
149+
ProspeoIcon,
146150
PulseIcon,
147151
QdrantIcon,
148152
QuiverIcon,
153+
RailwayIcon,
149154
RDSIcon,
150155
RedditIcon,
151156
RedisIcon,
@@ -195,6 +200,7 @@ import {
195200
WebflowIcon,
196201
WhatsAppIcon,
197202
WikipediaIcon,
203+
WizaIcon,
198204
WordpressIcon,
199205
WorkdayIcon,
200206
xIcon,
@@ -223,6 +229,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
223229
ashby: AshbyIcon,
224230
athena: AthenaIcon,
225231
attio: AttioIcon,
232+
azure_devops: AzureDevOpsIcon,
226233
box: BoxCompanyIcon,
227234
brandfetch: BrandfetchIcon,
228235
brightdata: BrightDataIcon,
@@ -261,7 +268,10 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
261268
extend_v2: ExtendIcon,
262269
fathom: FathomIcon,
263270
file: DocumentIcon,
271+
file_v2: DocumentIcon,
264272
file_v3: DocumentIcon,
273+
file_v4: DocumentIcon,
274+
findymail: FindymailIcon,
265275
firecrawl: FirecrawlIcon,
266276
fireflies: FirefliesIcon,
267277
fireflies_v2: FirefliesIcon,
@@ -305,6 +315,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
305315
iam: IAMIcon,
306316
identity_center: IdentityCenterIcon,
307317
image_generator: ImageIcon,
318+
image_generator_v2: ImageIcon,
308319
imap: MailServerIcon,
309320
incidentio: IncidentioIcon,
310321
infisical: InfisicalIcon,
@@ -337,11 +348,13 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
337348
microsoft_planner: MicrosoftPlannerIcon,
338349
microsoft_teams: MicrosoftTeamsIcon,
339350
mistral_parse: MistralIcon,
351+
mistral_parse_v2: MistralIcon,
340352
mistral_parse_v3: MistralIcon,
341353
monday: MondayIcon,
342354
mongodb: MongoDBIcon,
343355
mysql: MySQLIcon,
344356
neo4j: Neo4jIcon,
357+
new_relic: NewRelicIcon,
345358
notion: NotionIcon,
346359
notion_v2: NotionIcon,
347360
obsidian: ObsidianIcon,
@@ -360,10 +373,12 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
360373
postgresql: PostgresIcon,
361374
posthog: PosthogIcon,
362375
profound: ProfoundIcon,
376+
prospeo: ProspeoIcon,
363377
pulse: PulseIcon,
364378
pulse_v2: PulseIcon,
365379
qdrant: QdrantIcon,
366380
quiver: QuiverIcon,
381+
railway: RailwayIcon,
367382
rds: RDSIcon,
368383
reddit: RedditIcon,
369384
redis: RedisIcon,
@@ -416,12 +431,14 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
416431
vercel: VercelIcon,
417432
video_generator: VideoIcon,
418433
video_generator_v2: VideoIcon,
434+
video_generator_v3: VideoIcon,
419435
vision: EyeIcon,
420436
vision_v2: EyeIcon,
421437
wealthbox: WealthboxIcon,
422438
webflow: WebflowIcon,
423439
whatsapp: WhatsAppIcon,
424440
wikipedia: WikipediaIcon,
441+
wiza: WizaIcon,
425442
wordpress: WordpressIcon,
426443
workday: WorkdayIcon,
427444
x: xIcon,

apps/docs/content/docs/de/tools/file.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: Mehrere Dateien lesen und parsen
66
import { BlockInfoCard } from "@/components/ui/block-info-card"
77

88
<BlockInfoCard
9-
type="file_v3"
9+
type="file_v4"
1010
color="#40916C"
1111
/>
1212

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
{
2-
"pages": ["executeWorkflow", "cancelExecution", "listWorkflows", "getWorkflow", "getJobStatus"]
2+
"pages": [
3+
"executeWorkflow",
4+
"getWorkflowExecution",
5+
"cancelExecution",
6+
"listWorkflows",
7+
"getWorkflow",
8+
"getJobStatus"
9+
]
310
}

apps/docs/content/docs/en/blocks/function.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ const file = <readfile.file>;
198198
const base64 = await sim.files.readBase64(file);
199199
```
200200

201-
`sim.files.readBase64(file)`, `sim.files.readText(file)`, `sim.files.readBase64Chunk(file, { offset, length })`, and `sim.files.readTextChunk(file, { offset, length })` read from server-side execution storage under memory caps. `sim.values.read(ref)` can explicitly read a large execution value reference. These helpers are available only in JavaScript functions without imports. JavaScript with imports, Python, and shell do not support these lazy helpers yet.
201+
`sim.files.readBase64(file)`, `sim.files.readText(file)`, `sim.files.readBase64Chunk(file, { offset, length })`, and `sim.files.readTextChunk(file, { offset, length })` read from server-side execution storage under memory caps. `sim.values.read(ref)` explicitly reads a large execution value reference, and `sim.values.readArray(ref)` reads a manifest-backed large array. These helpers are available only in JavaScript functions without imports. JavaScript with imports, Python, and shell do not support these lazy helpers yet.
202202

203203
Very large full reads can still fail by design; use chunk helpers or return a file when you need to handle more data.
204204

@@ -228,7 +228,7 @@ return { name: file.name, chunk: firstMegabyteBase64 };
228228

229229
Chunk `offset` and `length` are byte-based. For Unicode text, a chunk can split a multi-byte character at the boundary; use text chunks for approximate text processing and prefer smaller structured references when exact parsing matters.
230230

231-
Avoid passing a full large object into a Function block when you only need one field. For example, prefer `<api.data.customerId>` over `<api.data>` when the API response is large. If a JavaScript Function without imports references a large execution value, Sim automatically reads it through `sim.values.read(...)` at runtime under memory caps.
231+
Avoid passing a full large object into a Function block when you only need one field. For example, prefer `<api.data.customerId>` over `<api.data>` when the API response is large. If a JavaScript Function without imports references a whole large execution value, Sim automatically rewrites it to `sim.values.read(...)` at runtime under memory caps. If the value is a manifest-backed array, Sim rewrites it to `sim.values.readArray(...)` so array variables can stay compact between blocks.
232232

233233
For large generated data, write the result to a file or table with `outputPath`, `outputSandboxPath`, or `outputTable` instead of returning the entire payload inline.
234234

apps/docs/content/docs/en/execution/api-deployment.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ Workflow execution responses are capped by platform request and response limits.
232232
}
233233
```
234234

235-
The `version` field is part of the external API contract. Treat the reference as an opaque placeholder for a value that could not be safely embedded in the response. `id`, `key`, and `executionId` are not fetch URLs; `key` points to execution-scoped server storage. Use `selectedOutputs` to request a smaller nested field, reduce the data passed between blocks, or return the data from a Response block when your workflow intentionally owns the HTTP response body. File outputs are metadata-first; request `.base64` only when you need inline file content. JavaScript Function blocks can explicitly read large files or value refs with the `sim.files` and `sim.values` helpers under memory caps.
235+
The `version` field is part of the external API contract. Treat the reference as an opaque placeholder for a value that could not be safely embedded in the response. `id`, `key`, and `executionId` are not fetch URLs; `key` points to execution-scoped server storage. Use `selectedOutputs` to request a smaller nested field, reduce the data passed between blocks, or return the data from a Response block when your workflow intentionally owns the HTTP response body. File outputs are metadata-first; request `.base64` only when you need inline file content. JavaScript Function blocks can explicitly read large files, value refs, and manifest-backed arrays with the `sim.files` and `sim.values` helpers under memory caps.
236236

237237
### Asynchronous
238238

0 commit comments

Comments
 (0)