From bc8f09ccb1aeea753c383d1a7e875bf489c48d39 Mon Sep 17 00:00:00 2001 From: Waleed Date: Thu, 19 Nov 2026 12:51:01 -0800 Subject: [PATCH 01/81] feat(workflow-code): workflows and workspace as code (#10129) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * test: type the MCP base address the concealment check compares * fix(workspace-code): check file path collisions on a segment tree, not a map of every prefix Keeping every folder prefix of every path still held about a million prefix strings for 20,000 deep paths. A tree of folded segments costs one fold per segment and holds each segment once, so the depth cap is no longer needed. * refactor: drop the exports of isSuspiciousCharacter and readFolderWritten, used only in their files * docs(workflow-code): CI needs a personal key; document workspace-key E_APPLY_FORBIDDEN and --only workflows.source.apply and create deny workspace API keys, so the CI guidance now asks for a personal API key or an OAuth login. Workspace as code names the kinds a workspace key cannot write (workflows, skills, secrets, deployments), the E_APPLY_FORBIDDEN refusal, and narrowing an apply with --only. * docs(workflow-code): link the code pages from workflows, CLI, getting started, API and MCP Adds a For coding agents section to Workflows as code (get, edit, check, status, apply, starting from .sim/AGENTS.md), a prefer-source note on the API build guide, and an MCP section on editing a whole workflow with getWorkflowSource and applyWorkflowSource. * docs(self-hosting): document the WORKFLOW_CODE preview flag Adds a Preview features section with WORKFLOW_CODE and links it from the in-preview callouts on the workflows and workspace as code pages. * feat(workflow-code): Code tab header with Preview label, CLI copy and docs; Download as code The Code tab gets a title row: a Preview badge, a button copying sim workflows source get --dir ./, and a link to the docs. The workflow menu gains Download as code beside Export workflow, saving the draft as the single TypeScript file the Code tab shows (function code inline). The download revalidates the cached source by ETag first, so an edit since the tab last read is never missed. * chore(rules): load the workflow-code rule for the v2 source routes, contracts and staging cleanup * feat(llms): list workflows as code in llms.txt * docs(cli): workflows and workspaces as code in the README, help epilogue and source group descriptions Adds a README section (get, check, status, diff, apply and the coding-agent loop), a source get example to the root help, and describes both source groups as read and apply, marked (preview) while the server flag gates them. Regenerating the CLI docs changes nothing: the pages list each command, not group descriptions or the root epilogue. * test(workspace-source): a re-run adopting a stopped MCP replace with stored() headers still needs an admin A workspace key re-running an interrupted replace is refused with E_APPLY_FORBIDDEN, the owner's re-run finishes it, and a read-only member's get prints the adopted server's literal headers as stored(). * feat(workflow-code): roll the workflow-code flag out by organization, workspace or user Every source use case, the Code tab layout and useFeatureFlag now evaluate workflow-code against the workspace, its organization and the acting user, so AppConfig orgIds/workspaceIds/userIds allowlists take effect. Adds the rollout plan to the workflow-code design doc. * feat(mothership): grant the workflow-code entitlement where the source commands run computeEntitlements now sends workflow-code to the worker for a workspace or organization chat whose rollout has the flag on, ahead of the worker's ENTITLEMENTS enum (the wire accepts any name). The CLI inventory marks every workflows source and workspaces source command with entitlement: workflow-code so the worker can hide them once it reads the field. * docs(api): say how workspace source blobs are staged, and that dryRun previews The applyWorkspaceSource description pointed MCP readers at Stage Workspace Source Blobs, a multipart route MCP does not expose; it now names the CLI and the blob upload route. The MCP write tool no longer claims no write can be previewed: the source applies take dryRun. * feat(analytics): record workflow source reads and dry runs, and workspace source applies Adds workflow_source_read, workflow_source_dry_run and workspace_source_applied beside workflow_source_applied: same attribution, kinds and counts only. A refused dry run is now a dry-run event, never an apply. * docs(workflows): commit written.json and point workspace CI to its own section * test: read the MCP server URL as nullable in the stopped-replace check * test(workflow-code): resolve the workspace before the flag in the HEAD 403 check The flag now needs the workspace's organization, so the read routes resolve the workspace first; the test gives them one to resolve. * test(analytics): one workspace_source_applied per apply, refused, partial or committed Busy, rejected and partial applies each record exactly one event with their outcome, the committed retry one more, and a dry run none. * fix(cli): resend a rate-limited GET even when its response body is lost Cancelling an errored body rejects, so a 429 whose body was lost threw the raw stream error instead of resending. * fix(tests): order the workspace source "nothing was written" snapshots by id The snapshots compared before and after a refused apply selected rows with no ORDER BY, so their order was whichever index the planner chose: on the workflow table the sort, unique-name and workspace_id indexes each return a workspace's rows in a different order. Once autovacuum analyzed the table between the two reads the plan could change, and the cross-kind test failed with equal rows in a different order. Forcing the second read off index scans reproduced the exact failure; ordering by id makes the comparison plan-independent. * refactor(source): one vocabulary for the fingerprint of what the server stores PlannedChange.serverFingerprint is storedFingerprint and KindAdapter.fingerprintNow is storedFingerprintNow; the workflow adapter's currentFingerprint() is readStoredFingerprint; the sf1: helper in print-stored is storedSourceFingerprint, beside the kinds' rf1: storedFingerprint; the workflow apply's local and EvaluatedSource field are storedFingerprint, as source-commit already named it. The 409 wire field currentFingerprint is unchanged. * fix(workflow-sdk): the workspace runtime exports defineSecrets and defineCredentials secrets.d.ts and credentials.d.ts declare them and the cookbook imports them, but the runtime entry did not export them, so running such a file failed with 'export not found' instead of SimSdkNotExecutable. codeFile now re-exports core's stub, as tool.d.ts declares. A test keeps the runtime's exports equal to every value the declarations declare. * fix(workspace-source): re-scan deletes for new users under the apply lease The plan's in-use scan ran before the lease, so an apply that saved a workflow using a resource another apply was about to delete went unseen: the deleting apply took the lease and deleted anyway. The apply now scans its deletes again once it holds the lease and refuses (E_APPLY_STALE, nothing written) a delete that a workflow the plan did not find now uses; a scan timeout still fails closed. * fix(cli): take a stale source-directory lock over safely, never through a link Two commands that found one lock stale could both remove it: the later one's removal deleted the live lock the first had taken, admitting two writers. A takeover now claims the stale lock folder it removes (only one command can) and checks it is still stale first, so a lock that replaced it is left alone. The lock path also bypassed the source directory's symlink checks: a .sim or command.lock that is a link was followed. Both are now refused (SOURCE_SYMLINK) before the lock is created, read or removed. * fix(cli): workflow commands in a workspace folder hold the workspace directory lock A single-workflow apply, create or get inside workflows// of a workspace directory rewrites the workspace's written record and base, but took no lock, so it could interleave with a workspace command (or another folder's) and lose a record. These commands now hold the workspace directory's command lock for the whole command, refused like a workspace command (SOURCE_DIR_BUSY, exit 10) with nothing read or written. * fix(cli): status recommends commands in its own scope, with --allow-delete for dropped data The command workspaces source status recommended dropped the scope it was asked for: status --only tables suggested an apply of every kind, and a status pointed at a workspace with --workspace suggested one at the profile's. Every recommended command now carries --only and, when the target is not the profile's default, --workspace. It also asked for --allow-delete only for whole-resource deletes, so an update that drops a column was suggested without it and refused. It now uses the same destructive count the apply prints. * fix(cli): an apply that reprints a tool as stored() removes its old code file When the server keeps a tool's code as stored() (it holds a credential), the apply reprints tools/.ts without tools/.js, but saving the answer left the old .js and its digest behind, so the next apply failed with E_TOOL_CODE. Saving an apply now removes, from disk and the written record, every text file the directory sent for a reprinted resource that the reprint no longer holds (workflow folders keep pruning by lock). * refactor(table): move cell value rules into @sim/workspace-code/table-cells The per-type coerce/validate/salvage/equality rules, the row loops (required cells, coercion policy, batch unique scan) and the pure date, currency, ttl and select helpers move from apps/sim/lib/table into the workspace-code package (timezone helpers into @sim/utils/timezone). The column-type registry spreads CELL_RULES into each definition and validation.ts delegates, so there is one implementation. The workspace source table adapter refuses declared rows with refusedTableRows, which the CLI can now run offline. * feat(sim-cli): workspaces source check validates table rows files offline Each tables/.rows.jsonl (managed or seed) is read against its declaration and checked with the write's own rules (refusedTableRows): a malformed line, an undeclared column, a managed key two lines share, an empty required cell, a unique value two rows share, a value its column's type or options cannot hold. Each is an E_TABLE_ROWS error at its line. * fix(workspace-source): credential adoption never takes a credential from a key bound outside source * test(workspace-code): assert linear growth, not a wall-clock budget, for hostile inputs The file-grouping test asserted 20,000 deep paths group within 6 s and took 7.2 s on a CI runner. It now counts the characters case folding reads at depth 100 and 400 (about 4x linear, 15x for the per-prefix fold it guards against), which no machine load changes. The two compile tests with a 3 s budget (JWT pattern, numeric precision) now compare the fastest of three runs at n and 4n: reverting either fix gives about 15x against a bound of 9. * fix(table): a seed reshape refuses a table that gained rows since the plan saw it empty * fix(table): a keyed row write inside a reshape runs at the bulk-write statement timeout * fix(workspace-source): hold the apply lease from before the plan, not only the writes An apply planned before taking the lease, so another apply could write between its plan and its writes: the first then wrote half of itself and failed (E_NAME_TAKEN, E_APPLY_STALE), or deleted a resource a workflow had just started using, because its in-use check had run before the other apply's save. A non-dry-run apply now takes the lease first and plans and writes under it, so a second apply is refused SOURCE_BUSY before it reads anything. This replaces the post-lease in-use re-scan, which covered only deletes. Dry runs still take no lease; the per-write lease confirm and stored-fingerprint re-checks stay for UI edits, which the lease does not order. * fix(workspace-code): literal-secret findings carry a span but no code frame E_MCP_LITERAL_SECRET, E_DEPLOY_SECRET, W_TOOL_LITERAL_SECRET and the workflow W_LITERAL_SECRET framed the line holding the secret, echoing it over v2 and MCP. They keep their span; the finding cap and the server locator drop the frame too. * fix(workspace-source): a secret declared without a description records no base entry, so it is never falsely stale * test(workflow-code): time hostile inputs with Date.now, repeated past the clock's resolution The package has no Node or DOM types, so performance is not declared. Each growth timing now repeats the work until it spans 25 ms, so millisecond steps do not swing the ratio. * fix(workspace-code): an env reference or helper call is never read as an object headers: env.TOKEN parsed with no finding into a header named $env, and defineTable(column.string()) reported the encoding's $call/args fields. Both now get one finding that names the value and how to write the object. * feat(workflow-code): mixed-script block names, workflow inputs, env hint target - E_LOOKALIKE_NAME also refuses a block name with a word mixing Latin with Cyrillic, Greek, Armenian or Cherokee letters (Unicode script property, no confusables table), naming the code point; W_ when the block is stored. - startInputs and INPUT_TRIGGER_TYPES (shared with apps/sim) read a workflow's Start trigger inputs; W_CHILD_INPUT_UNKNOWN and W_CHILD_NO_START join the vocabulary for the CLI's offline child-call check. - CompileInput.envDeclaredIn points a W_ENV_UNKNOWN hint at secrets.ts. * feat(sim-cli): workspaces source check covers skills, child inputs and workspace.d.ts - skill('') is checked against skills/ like every other kind; a key with a non-ASCII letter names its code point and script. - A child workflow call is checked against the child's Start trigger in the same directory (W_CHILD_INPUT_UNKNOWN, raised on new blocks; W_CHILD_NO_START). - A get keeps the server's resource manifest beside workspace.d.ts, and check regenerates workspace.d.ts from it and the directory's declarations, typing new keys and each workflow's inputs without a request. - Did-you-mean hints on E_MAT_UNKNOWN_RESOURCE, W_TABLE_UNKNOWN_COLUMN and W_ENV_UNKNOWN (which points at secrets.ts); a warning raised to an error no longer says it is kept as written. - check --help lists every kind it checks. * fix(workspace-code): check the option cap before a linear duplicate scan; pin a duplicate column to itself A select's repeated-option scan was quadratic and ran before the maxOptions cap: 80k options took 7 s per parse (now ~0.1 s). E_TABLE_DUPLICATE_COLUMN spanned the whole defineTable argument instead of the second column. * perf(workspace-code): group a status's changed files in linear time; key server findings by code localResourceChanges copied the kind's array per file: 40k files took 3.3 s. SERVER_FINDINGS is now checked against WorkspaceDiagnosticCode. * perf(workflow-code): print a fill in linear time by advancing an offset printFill re-spread the remaining parts for every content/separator pair, so a number-only array printed in quadratic time (40k numbers took 17.5 s). The rest of the fill is now queued as the same parts from a later offset. * fix(workflow-code): refuse a tool param or operation option the builder pins A tool builder's fixed params and the operation option overwrote the method's pin silently, so the tool stored an operation the method contradicts and printed back as raw(). Report E_FIXED_PARAM, as the block path does. * refactor(workflow-code): look a tool's builder up once toolBuilderPath found the builder, returned its path, and compileToolCall looked it up again behind an early return that could not fire. * fix(workspace-code): cap knowledge document findings apart from knowledge.ts's own Document findings were uncapped and counted against the field reporter's 100-finding budget, so the declaration's own findings became E_LIMIT_EXCEEDED. The field reporter now counts only what it appends. * fix(workspace-source): a workflow delete is fingerprinted only once its live triggers are counted * fix(workflow-code): exclude a retyped block from rename inference by its own id A retype matched by lock ident (or against a prev block the canvas renamed) excluded the prev block under the new key, not the one it retyped, so another new block of the old type could inherit the old id, its run history and its webhook. Record the retyped prev id and exclude that. * fix(workspaces): a key claim that loses a concurrent race refuses with 409 or retries, never a raw 23505 claimResourceKey read the key with select-for-update, but an unheld key has no row to lock, so a concurrent get (allocation) or claim could insert first and the plain insert failed with a unique violation on either index, surfacing as a 500. The insert now skips on conflict and the claim re-reads the committed winner: kept, ResourceKeyTakenError, or a retry that replaces a key the resource was allocated meanwhile. Rebinding deletes and re-inserts so it shares the same path. * perf(workflow-code): push identity group keys instead of re-spreading the group Each push copied the whole group, quadratic when many unmatched blocks share a type and parent. * fix(workflow-sdk): new on a runtime export throws SimSdkNotExecutable; one stub for both entries The Proxy target was an arrow function, which has no [[Construct]], so the construct trap never ran and new t() threw a TypeError. The workspace runtime re-declared notExecutable and seven identical functions; both entries now share the stub in not-executable.ts. * feat(workflow-code): x.error compiles in the handler of an onError edge The executor returns { error: } as a failed block's output when an error edge leaves it (BlockExecutor errorOutput, block-executor.ts:738-740, returned at :868-877). Compile accepted no such path, so the INDEX promise of ${x.error} failed with W_UNKNOWN_OUTPUT_PATH. Now x.error checks once the edges are known: accepted with an error edge, refused with a hint to wire onError without one. Block types error in the SDK, INDEX says how the handler reads it, and the integrations cookbook shows it. * fix(workflow-code): compile stored() in a loop or parallel's meta.extra The printer writes a container param holding a detected credential as stored() under meta.extra, but compileContainer passed no keep callback, so the print failed to compile. Keep the stored value as a regular block's extra does. * fix(workflow-sdk): never embed a dotfile from the cookbook WORKSPACE_COOKBOOK embedded every file on disk under cookbook/workspace, so a .DS_Store or editor swap file would be written into every user's example directory. The listing now lives in embedded-files.ts, shared with the drift test. * docs(knowledge): say why an upload's processing relay is safe on every surface * perf(workflow-code): read each node's successors once in the cycle check stronglyConnected called successors on every step of a frame, and the caller maps the node's whole outgoing list each time, so a block wired to many targets cost O(deg^2). Read them once when the frame is pushed. * perf(workflow-code): test a restored inactive value with withStoredValue staysInactiveWithPrev rebuilt the block's whole activity inputs (every param, the modes, the ids deploy reads) for each inactive id on each pass. Build them once per pass and swap the one value in, tracking the pass's restores. * fix(workflow-code): keep collapsed on inputFormat fields whose id stays inline Canonicalize drops the editor's collapsed flag from every field, but materialize restored it only for fields whose id moved to the lock, so a field with a shared or missing name lost it whenever the list changed. * feat(sim-cli): no login exits 13 with AUTH_REQUIRED Not logged in, an OAuth login that expired and cannot refresh, and a 401 from the server exited 1 with CLI_ERROR, the same as a source with errors. They now exit 13 (AUTH_REQUIRED_EXIT_CODE) with the code AUTH_REQUIRED (a 401 keeps the server's code when it sends one). A status still falls back to the local view without a login, and its note now reads as sentences. * fix(workflow-code): write a subflow collection holding a $sim object back unwrapped Canonicalize and compile wrap an object with its own $sim key as a literal node, but materialize wrote forEachItems and distribution raw into block.data and the loops and parallels maps, so after any config change the executor iterated the wrappers. Unwrap literal nodes there, and say so in jsonField's TSDoc. * fix(sim-cli): source diff filters resolve against --dir; cancellation and 413 keep their exit - diff ./, an absolute path or a path from the current directory selected nothing and printed "No local changes."; filters now resolve against --dir and one that selects no file is refused (SOURCE_PATH_UNMATCHED). - A cancelled request carries REQUEST_CANCELLED, so status no longer reports it as an unreachable server; noAnswer() is the one copy of that predicate. - workflows/workspaces source status and diff map a 413 to exit 7, as get does. * fix(workspace-source): holding a change for one credential key keeps another key's unreachable refusal * fix(sim-cli): an apply drops the written.json entries of the resources it deleted The record kept every deleted resource's files, so status reported the delete forever (exit 11) and recreating the key made get refuse with SOURCE_LOCAL_EDITS. An entry is dropped only when its file is gone and the returned base no longer holds the resource or blob, so a held or failed delete stays retryable. * fix(workspace-source): a chat auth type source cannot name leaves the deployment out instead of reading as public * perf(workflow-code): bucket wiring and order dependencies by scope once per print Each scope's wiring rescanned the members of every enclosing scope and refiltered their edges by edgeScope, and each scope's declaration order was handed every dependency in the workflow: O(scopes x blocks). Bucket edges by the scope they print in, and dependencies by the scope they order, in one pass. * fix(workspace-source): file creates of one name check every key they may take, and a lost key claim refuses the create * perf(workflow-code): memoize buildFieldIndex and group pair members in one pass The index was rebuilt for every block in print and compile and for every tool, and each canonical pair rescanned every subBlock for its members: O(pairs x subBlocks) per call. Group the members once, and memoize the read-only index by block, trigger mode and pinned ids. * refactor(workflow-code): sort compiled edges with canonicalize's compareEdges Compile kept its own copy of the comparator, and the CWM edge order is hashed (canonicalHash), so two copies could drift. * chore(workspace-source): unexport WorkspaceSourceChange, used only in its own file * docs(workflow-code): move compileRegularBlock's TSDoc onto it It sat above BlockShape's own TSDoc, documenting nothing. * fix(workspace-source): the staging sweep removes objects before their rows, keeping a row whose object survived * docs(workflow-code): describe LoopSpec as canonicalize reads it The TSDoc said the spec is the loops map's config and that canonicalize never fills defaults; loopSpec reads block.data first, never takes the map's count, and falls back to a for loop of 5. * refactor(workflow-code): stop exporting ConfigItem Nothing imports it; it is only printedConfig's item type. * refactor(workflow-code): read pinned values and the catalog block once compileMetaParams rebuilt the map of every stored value once per pinned id, and needsTodo looked the catalog block up twice though collectParams already holds it. * fix(table): a reshape resolves each column update to its id, so a by-name swap renames both * fix(workspace-source): a get leaves out a secret named __proto__ instead of printing an unapplyable secrets.ts secrets.ts printed every stored secret, but the declaration reader refuses a __proto__ key, so after a get the whole file stopped applying. The secret is now listed in skipped.json with the reason; MCP header names the reader refuses already round-trip-fail into skipped. * perf(sim-cli): a status past one dry run prunes its whole read instead of walking the directory again When the workflow folders exceed one dry run, status read the directory a second time: a second walk, read and hash of every file. It now prunes the unchanged folders from the read it already made. * perf(sim-cli): workspaces source apply walks the directory once, inside its lock assertWorkspaceDir walked every kind folder outside the lock before readWorkspaceDir walked it again; the apply now checks the read it made and runs the full check only to refuse. orphanedWorkflowFiles groups the answer's paths by folder once instead of per lock, assertBaseWorkspace reuses baseWorkspaceOf, and printPlan no longer shadows counts. * fix(sim-cli): --only reads past an empty segment instead of refusing an unnamed kind * refactor(workspace-code): un-export four unused types, name the skill locator apart from a line's offset, fix two TSDocs * feat(workspace-source): an existing column becomes required in the same apply as the managed rows that fill it * perf(workspace-source): list MCP servers' tools concurrently while planning tool references * perf(workflows): a batched source read prints its workflows concurrently * fix(workflow-types): hold a container's edges to the handle they leave from A loop or parallel's start handle connects only into the container, and any other handle never does. The shared scope rule ignored the handle, so the editing engine kept a start edge to a block extracted from the loop (and an end edge to a block moved into it): edges the canvas never draws and workflow source refuses (E_EDGE_SCOPE), so such a workflow could not be applied back from its own source. * fix(editing): refuse an error edge from a block with no error output The engine accepted an 'error' handle on any block, so a trigger or a loop or parallel container could store an error edge the canvas has no port for and source cannot write (E_ERROR_PORT_UNSUPPORTED). It now follows the source catalog's errorPort rule. * fix(editing): normalize row ids only on fields declared as row lists Row-id normalization keyed on the subblock id alone, so any field that shares an id with a table field (supabase's JSON code 'params', 'metrics', 'headers', 'variables') was coerced to a row list: a JSON object or code text was replaced by [] and the value lost. It now applies only where the block declares the id as a row-list type. * fix(workflow-code): keep the pair member a trigger-mode pair's mode does not select Deploy reads every member of a trigger-mode pair, so the inactive-param restore never brought back the member the mode does not select. An unchanged apply of a block toggled into trigger mode dropped that member's stored value, and editing the selected member dropped the other one. The pair's value is now its mode-selected member's, and the other members keep their stored values, as on the canvas. * fix(workflow-code): write only the subflow config fields an edit changes Canonicalize fills a loop's count (5) and the collection and conditions the subflow map holds when block.data omits them; a changed config wrote all of them back, so renaming the block a loop condition reads also stored count, collection and condition fields nobody edited. Fields equal to the stored config keep their stored spelling, absence included. * fix(workflow-source): compile a block renamed in source against the block it continues Compile matched the stored block by key, while materialize keeps a renamed block's id through its ident (lock-ident). Renaming a block in source therefore refused its stored() secret (E_STORED_VALUE_MISSING), turned a stored cycle into E_EDGE_CYCLE, and reset fields source never writes (a note's color) to their defaults. compileSource re-keys the stored model to the source's renames and compiles again. * refactor(sim-cli): name what source helpers do and fix their docs - mergedGitattributes merges .gitignore too: withMissingLines. - isMissing reads the code through errorCode, not a cast. - workflows source check calls workspaceFolderOf directly. - Exit codes 5, 6 and 7 document workspaces source as well. - workflows source resources lists MCP servers; any source get writes it. - Two TSDocs a reflow mangled. * perf(workflow-persistence): read only live in-workspace graph rows in a batch load loadWorkflowsFromNormalizedTablesRaw read every block, edge and subflow row of every requested id, then dropped the ones outside the workspace, and kept archived workflows the read snapshot discarded afterwards. Each graph query now filters by the live in-workspace ids as a subquery. Measured on 100 live + 300 archived workflows of 30 blocks: loadWorkflowReadSnapshots median 579ms -> 151ms. * perf(workflows): one credential lookup for a batch load's block migrations loadWorkflowsFromNormalizedTables ran each workflow's block migrations serially inside the REPEATABLE READ snapshot, and the credential-id migration queried once per workflow holding a legacy account id. The batch now prefetches the credential ids for every workflow's legacy ids in one query, and only queries again for an id a migration surfaces that the prefetch did not ask about, so the result is unchanged: N serial round trips become one. * fix(api): one ETag revalidation path; tagged v2 bodies are revalidated, and cached per request - ifNoneMatchSatisfied was copied in the internal and v2 JSON builders; definition.ts now owns entityTagMatches and notModifiedResponse. - The v2 builder answered a tagged 200 and its 304 with private, no-store, which forbids keeping the body the ETag exists to revalidate. Both now say private, no-cache, as the internal one did. - The v2 validated-body LRU was keyed by the tag alone and served across principals and inputs, though present() reads the parsed request. It is keyed by tag and parsed request now, and entityTag documents that it must be a strong validator of the result for every caller. - The internal builder's HEAD branch re-checked a missing authorize() that definition-time validation already refuses; it captures the authorize phase once instead. * fix(workflow-sdk): codegen uses its layout helpers; INDEX.md lists legacy builders only when there are some - generate.ts builds block, models and index paths from layout.ts; blockTypesFile leaves the barrel; layout.ts reads TOOL_NAMESPACE. - @when names both fields of an and clause. - typecheckSdkDirectory spreads SOURCE_COMPILER_OPTIONS. - The cookbook declares ORDERS_API_KEY, which its tool reads, and says a new query string updates an MCP server in place; column.ttl() says one per table. - Doc fixes: arrayOf, declaredBlockTypes order, core.d.ts names tsc. * fix(schedules): a written zero is an invalid schedule field, not a missing one The reason classifier read fields through getSubBlockValue (value || ''), so a numeric 0 counted as empty. It now checks undefined, null and '' explicitly. * docs(environment): state the non-empty invariant both env paths share * chore(scripts): name the pure package an offender is in, not always workflow-code * refactor(chat-deployments): one identifier-ownership check, and one live-chat read per replace pre-check * refactor(workflows): the code tab names its directory with the shared slugify * refactor: keep types no other module imports private * refactor(workflows): drop the field-by-field source apply presenter The response schema already strips the result's internal fields, so both routes present the result as it is. * refactor(workspace): the workflow-code flag is required of every flags producer * refactor(utils): one mapWithConcurrency, with documented failure semantics apps/sim had its own mapWithConcurrency next to @sim/utils/concurrency's, with different failure semantics: it rejected through Promise.all as soon as one item failed while its other workers kept starting items nobody awaited. Every caller now uses the @sim/utils one: after a failure no item starts, and the first failure is thrown once the running items settle, so nothing the batch began is still running when the caller handles it. mapSettledWithConcurrency (attempt every item, keep each outcome) moves alongside it. createConcurrencyLimit, MATERIALIZE_CONCURRENCY and waitWithAbort stay in apps/sim. * perf(workspace-source): a knowledge plan never downloads a document named in neither the base nor the directory * docs(workspace-code): CI commits back what apply rewrote, tsc step, Gmail provider - The scripting.mdx CI job runs tsc after check (which regenerates workspace.d.ts), and on merge commits back the files the apply rewrote, with [skip ci] and contents: write; a protected branch opens a pull request instead. - workspace-code.mdx says what check now covers (skills, child inputs, rows, workspace.d.ts). - The cookbook credentials.ts shows Gmail's provider id, google-email (the id apps/sim/lib/oauth/oauth.ts registers for Gmail). - The docs baseline records the changed CI fence. * docs(cli): regenerate the CLI reference for the check help and exit 13 * test(api): the source catalog's tagged 200 is private, no-cache * fix(workspace-source): a renamed or name-taken stored() tool reports only that, not a missing stored tool * fix(workspace-source): a deleted chat's base no longer records its password variable * fix(table): reshape audit entries name columns, never their ids * refactor(workflows): drop the never-filled SourcePlan.notes, share the stale message, and read a rename's folder from the loaded workflow * refactor(source): one managed-row key, one tool-input field list, and no unreachable fallbacks * docs(source): gated manifest sections, the required-column 400, carried tags and the manifest limit * chore(source): regenerate the v2 OpenAPI and MCP operations for the documentation changes * test(workspace-code): bound the option-cap and status-grouping fixes by n vs 4n growth, not wall clock The ratio helper is exported from @sim/workflow-code/scaling.test-helpers so other packages' scaling tests share it. * fix(workflow-code): x.error is a string in a JSON field The executor's error output is the failure message, so a reference to it in a JSON body (response, API body) is stored quoted, as compile and print decide through refValueKind; bare, a message would break the JSON. * refactor(workspace-code): rowKeyText reads any cell value, so the table row writer shares it * chore: drop the apply wire type no module reads, and shrink the non-null baseline the batch load cleared * test(workspace-source): the cookbook apply test holds the Gmail credential the cookbook declares * fix(workflow-code): keep a stored field the printer left out as inactive Compile fills an omitted param with its default, then keeps the stored value only when the field is inactive, judged with the default in place. A standalone advanced field runs once non-empty, so a stored '' choice (cloudflare's 'Active only' certificate filter) read as active under the default and every apply replaced it with 'all'. Inactivity is now judged with the stored value. * refactor(utils): point the merged mapWithConcurrency callers at @sim/utils * test(workflow-source): prove canvas, JSON API and source stay in lockstep A seeded fuzz applies random sequences of real editing-engine operations (add, delete, move, edit fields, connect, disconnect, insert into and extract from loops and parallels, rename, enable, retype, trigger and advanced mode, loop config, variables) to corpus workflows, then asserts the source of the result applies back as a no-op and one random source edit changes exactly that field. Failures shrink to a one-minimal edit list. Every registry block type is added (or, for legacy and single-instance types, edited) with non-default values in each subblock kind it has. Each divergence fixed on this branch keeps a minimal regression. The integration suite runs the full stack on Postgres: JSON write, editing operations, source get and apply, JSON read, and a canvas-built workflow against the one created from its source. * chore: drop exports the cell-rule move left unused; move the timezone baseline entry * chore(audits): count staging's new integration double-cast in the merged ratchet * test(workflow-source): satisfy the audits in the fidelity suites * test(workspaces): wait with the shared sleep helper * fix(cli): recover a command lock abandoned before its owner was recorded The takeover claim inside the lock refreshed the lock folder's mtime before the staleness re-check, so a lock with no owner.json never read as stale and every command returned SOURCE_DIR_BUSY. Judge an unrecorded lock's age from the sighting taken before the claim, and guard against a replacement lock by checking the folder is still the one seen (dev/ino) and still stale. * chore(helm): bump chart to 1.11.22 for the source-staging cleanup cron * fix(workspace-source): match managed row keys after their column's coercion planRows compared declared key cells with stored ones before coercing them, so a number key written as "007" counted the stored row 7 as removed and the apply refused without --allow-delete, though the keyed write coerces "007" to 7 and matches it. Coerce the declared key with the key column's cell rule (the reject policy a keyed write uses) before matching. * fix(workflow-code): print a JSON code field in meta.extra as its stored text An advanced JSON code field the serializer still forwards under an operation that hides it prints under meta.extra, which compile reads verbatim. It printed as an object literal, so compile stored a native object and an unchanged apply rewrote the stored text (minified, or not at all equal when it held references). It now prints as text there; only a builder param takes the literal form. * fix(workflow-source): keep a block keyed __proto__ in the lock and hints buildLockFromState, hintsFromSourceMeta and printStoredSource assigned by bracket, so a block whose name normalizes to __proto__ set the prototype instead of an entry: it vanished from the lock, and renaming it in source lost its identity (compile treated it as new and reset its unwritten fields). * test(workflow-source): regressions from the long fidelity run A JSON field forwarded under a hiding operation, a block keyed __proto__, and the by-design collision-key refusal the fuzz now leaves out. * fix(cli): workspaces source status and diff refuse a directory holding no workspace source A mistyped --dir, an empty directory, the wrong working directory (--dir defaults to .) or a workflow folder read as clean: status exited 0 after a dry run of no kinds, and diff printed "No local changes.". They now refuse it with the reason and the get to run, as apply and check do. * fix(cli): status recommends the get that restores a removed kind folder, not an apply Removing a managed kind's folder or root file (tables/, secrets.ts) stops managing the kind: an apply leaves its resources alone. status reported its recorded files as deleted and recommended apply --yes, which wrote nothing, so the next status said the same thing again (exit 11 forever) while get refused to write the files back. When every local change is in such a kind, status now recommends get --only --force, which restores them, and says how to delete the resources instead. * fix(utils): mapWithConcurrency throws the first failure in time The shared helper threw the failure of the lowest-numbered slot, so a slow slot-0 error masked an earlier one from another slot. The apps/sim helper it replaced (Promise.all) threw the first failure, and the TSDoc still promises that. * fix(cli): workspace source commands handle a directory no one may write Every workspace source command takes the directory's lock by creating .sim/command.lock, so in a read-only checkout status, diff and apply --dry-run crashed with a raw EACCES stack trace. Commands that only read (status, diff, a dry run) now run without the lock there, since nothing can rewrite the directory; get, check and apply are refused as SOURCE_DIR_UNWRITABLE with the reason. * fix(cli): status refuses a broken .sim/written.json instead of calling every file created A merge conflict that leaves markers in .sim/written.json (two branches that each applied) made status read every file as created and recommend an apply. It now refuses with SOURCE_WRITTEN_INVALID and names the get that rewrites the record. A broken .sim/base.json names its way out too (SOURCE_BASE_INVALID). * docs(cli): status and diff help name exit 7, and the workflow guide exit 13 status and diff exit 7 when the server refuses the source as too large (413), as exit-codes.ts documents, but their help listed only 0, 11, 12 and 1. The workflow directory's .sim/AGENTS.md now names exit 13 (not logged in) as the workspace guide does. CLI docs regenerated. * fix(executor): splice already-escaped values into JSON strings as written Escaping every reference landing inside a JSON string literal fixed values that broke the JSON (quotes, newlines, stray backslashes), but it also re-escaped values that were already valid string content. A deployed workflow whose env var holds a key with literal \n escapes, or that escaped a value in a Function block to work around the old bug, now sent backslash-n instead of a newline. Only a value that would break the literal is escaped now; one that is already valid string content splices raw, exactly as before. * fix(table): write every row's cancellation when one write fails cancelWorkflowGroupRuns cancels every row's queued jobs, then writes each row's cancelled status. The shared mapWithConcurrency starts nothing after a failure, so one failed write left the later rows of the page 'running' with no job behind them; the apps/sim helper it replaced still wrote them. The writes now all settle before the first failure is thrown. * fix(cli): count a workflow changed only on the server as unchanged in workspace status The status dry run sends every workflow folder whole to detect drift, so the server plans an update for a folder edited only in Sim. An apply sends that folder by its base and leaves it unchanged, so the status plan line said 'Applying would: 1 update' for an apply that changes nothing. * fix(cli): an interrupted source command releases the directory lock Ctrl-C during a workspace source command left .sim/command.lock behind. A later command takes a lock over only when its owner ran on the same host, so one left in a folder shared with a dev container or another machine stayed until removed by hand (exit 10 every time). The lock is now removed on SIGINT/SIGTERM before the signal ends the process, as a staged write's folder already is. * test(workspace-source): a key-claim failure trigger left by a killed run no longer breaks the next one * fix(e2e): expire the workflow source e2e session in UTC session.expires_at is a timestamp without a zone that the app reads as UTC. now() writes the database's local time, so on a Postgres west of UTC the one-hour session was already expired and the canvas-route check got 401. * fix(cli): get keeps a directory bound to its workspace when its base does not parse get decided which workspace a directory belongs to only from a base that parsed cleanly, so one this CLI refuses (a field a later CLI added, a bad fingerprint) read as no base: get then used the profile's workspace, and --workspace naming another one was not refused (SOURCE_OTHER_WORKSPACE). It now reads workspaceId as leniently as apply and status do. * fix(cli): print nested source apply results as JSON in text output `sim workflows source apply --output text` printed the modified blocks as `modified [object Object]`. * test(workflow-code): alternate small and large runs in the growth check so machine load slows both sides * fix(workspace-source): in-use scan reads the live deployment version A delete of a resource that a deployed workflow's live version still uses, while its draft no longer does, now warns W_RESOURCE_IN_USE naming the live version, unless the same apply publishes the draft or undeploys it. * fix(workspace-source): class a refused apply by the errors that refuse it The rejected error counted and classed every error, including those of changes the plan holds back, which refuse nothing. The plan now returns the refusing errors (plan-level plus non-held changes) and the error classes from those. * fix(workspace-source): a key taken after a committed write reports the write A key claim that found the key held by another live resource after the write committed threw, dropping the written resource from applied. write() now returns it with E_NAME_TAKEN; the apply records it as applied, keeps the base entry unchanged, and stops so no later write resolves the key to the other resource. * test(workspace-source): per-process source slot refuses past its cap with 429 * fix(cli): check table row columns when the row holds a non-string reference Compiled row data stores a non-string reference bare ("n": ), which JSON.parse refuses, so check skipped the whole row: an unknown column or select option in any row writing a number, boolean or object output went unreported. Parse it as a JSON field instead. * feat(workflow-code): hint api for http.request and fn for javascript.* builders An agent guessing the HTTP request block as http.request got E_UNKNOWN_BUILDER with no hint: no edit distance reaches api. * docs(workflow-code): correct workspace-key, rows, written.json and create claims; fill agent-guide gaps - credentials bind with a workspace API key; secrets and deployments do not (guide, CI docs, API description) - table rows are source when a table opts in; list rows.jsonl and the limits - .sim/written.json is committed, not gitignored; drop stale tsc sizes; exit 9 - a created-not-yet directory has no base: create --dry-run, not status - guide: api is the HTTP block, W_* print as error in check, self-hosted apiKey, promote setup * test(workspace-source): a key-claim failure trigger left by a killed run no longer breaks the next one * test(workflow-code): alternate small and large runs in the growth check so machine load slows both sides * test(workflow-code): time the block-cap round trip by thread CPU, so machine load cannot fail it * fix(workflow-code): never print a credential through the response body form The response(name, { body, status, headers }) form printed its fields' stored values verbatim, so a response block holding a detected credential (an Authorization header, a token in the body) printed the secret into the file while W_LITERAL_SECRET claimed it printed as stored(). Such a block now keeps its own params, where the field prints as stored(), and compile warns W_LITERAL_SECRET when source writes one in the form. * fix(workflow-code): check agent tool calls the way blocks are checked compileToolCall accepted any builder as a tool (api.tool, condition.tool, trigger.gmail.tool.poller), stored any param key unchecked, and never warned about a literal secret, though print writes these tools as raw(tool) and warns W_LITERAL_SECRET. A tool call now needs a builder with a tool form (E_UNKNOWN_BUILDER), each param must be one its tool type declares (E_UNKNOWN_PARAM with a did-you-mean, W_FIELD_NOT_APPLICABLE for another operation's), and a literal secret warns as on a block. SYNTAX.md and core.d.ts no longer document agent.tool() or runWorkflow.tool(): neither is typed, and print writes such tools as raw(tool). * fix(workflow-code): refuse stored() and codeFile() in a loop or parallel config compileConfig dropped any config value that was not a plain value, so loop.forEach('L', { collection: stored() }) or a codeFile() condition compiled silently to a loop with no collection or condition. Both are now E_UNSUPPORTED_SYNTAX with the form to write instead. * fix(workflow-code): give every compile finding a hint that names its fix E_TARGET_TRIGGER, E_ERROR_PORT_UNSUPPORTED (a loop or parallel has none: wire onError from its children), E_UNKNOWN_BRANCH in meta.branches (lists the branches), W_VALUE_KIND (the literal form the field takes) and E_UNKNOWN_IDENTIFIER for undefined, NaN and Infinity had no hint. The test catalog's loop and parallel now have no error port, like the real catalog. * fix(table): keep batch rows that keep a unique value in the DB check batchUpdateRows excluded every batch row from each unique column's DB check and compared the rest by the values it read before taking the value locks. A row the batch leaves alone could take the value from a concurrent edit after that read, so both it and the batch's writer stored the same unique value. Each column's DB check now skips only the batch rows that rewrite that column. * docs(tables): say add-column refuses a required column rows leave empty * fix(cli): Ctrl-C during an apply write names what it may have done An interrupt while the apply request was in flight exited 130 silently, so nobody learned the write may have landed. The lock's interrupt handler (which already releases the lock) now prints the same next step a lost answer gets, then ends with the signal. * fix(cli): a status without a login recommends sim login With no login on the profile, status shows the local view (the server is treated as unreachable) and its note says to log in, but next was apply --dry-run, which only exits 13. next is now the login, then status again, for workflows and workspaces alike. * fix(cli): check offline with no cached catalog names the get that caches it A fresh clone checked while the server could not be reached failed with the raw "Could not reach …" and no next step. It is now CATALOG_NOT_CACHED (exit 1) naming sim workspaces source get, as a check with no credentials already is; no login keeps its AUTH_REQUIRED refusal (exit 13, naming sim login). * fix(workflow-code): keep meta.retry within the bounds the loader pins it to Persistence saves a retry policy verbatim but loads it clamped (2-5 tries, 0-5000 ms, whole numbers), and canonicalize kept a well-formed policy raw. A file writing maxTries: 10 stored 10, read back as 5, and every re-apply of the unchanged file showed a retry change. Compile now refuses an out-of-range policy with a hint naming the bounds, and canonicalize pins the numbers as the loader does, so a printed policy always compiles back unchanged. * Revert "fix(workflow-types): hold a container's edges to the handle they leave from" This reverts commit 62872bd29b290f713c26f4021d4ebb3191aa83ac. * chore: regenerate the OpenAPI spec and MCP operations for the workspace-key description * docs(cli): document exit 13 (AUTH_REQUIRED), exit 9 and the 429 resend policy Both exited 1 before this branch. State which requests are resent (every GET and the all-or-nothing source writes), the 6-retry count and the one-minute wait cap, in the scripting exit-code section, troubleshooting, the CLI reference preamble, the README and the source agent guides. * fix(workspace-source): managed table rows guard a delete and a column renamed on the server An --allow-delete of an undeclared managed table whose rows were written since the base deleted those unseen edits; it is now E_APPLY_STALE. A rows edit on a table whose declaration is unchanged while the server renamed or removed one of its columns wrote the cells by names the table no longer has, silently dropping them; it is now E_APPLY_STALE. * fix(workspace-source): a stored() tool or MCP server deleted on the server stays deleted An unchanged directory whose tool code or MCP header is stored() was refused (E_APPLY_STALE / E_TOOL_STORED_MISSING / E_MCP_STORED_MISSING) once the resource was deleted on the server, blocking every other kind. It now reads as I_SERVER_DELETED like any other deleted resource. * docs(workflow-sdk): document a child workflow's output shape runWorkflow's result is the child's first response block output ({ data, status, headers }), else its last block's output, so a response body field is result.data.field; a deployed parent runs the child's deployed version. Stated in INDEX.md's How it runs, the runWorkflow TSDoc, the agents example and the agent guide. * fix(workflow-code): round-trip stored container edges source cannot draw Stored workflows hold container edges the canvas never draws: a loop or parallel start edge to a block outside it (the editing engine keeps one when it extracts a block, and the executor runs it as the container's exit), an end edge into the container's own child, and an error edge from a container. Source printed the first two through p.to()/x.to() and every one through onError, and compile refused them (E_EDGE_SCOPE, E_ERROR_PORT_UNSUPPORTED), so such a workflow could not apply its own source back. The printer now writes a mismatched container edge as edge() with its stored handle, compiled with W_SUBFLOW_HANDLE_SCOPE (the warning names the exit form), and compile keeps an error edge from a block with no error port when the stored workflow holds it (W_ERROR_PORT_STORED). The corpus gains both edge shapes. * fix(editing): keep a stored error edge the engine no longer adds Since the engine refuses new error edges from loops and parallels, an edit that re-sends a container's connections dropped the error edge it already stored. Error edges the graph held before the batch are kept; only new ones are refused. * test(workflow-source): stored mismatched container edges survive every write path The extract and move-into-loop regressions now assert the engine keeps the edge and source round-trips it; a stored container error edge survives an engine edit that re-sends its connections; and an integration check writes a loop start edge to an outside block through PUT /state, edits through the engine, and applies the source back unchanged. * fix(workspace-source): type the in-use scan rows for the query builder * fix(tables): accept a required column on a table with rows again outside workspace source facb1c4f4d made every surface refuse adding a required column that existing rows leave empty, which turned a call third-party integrations make on the v1 and v2 table APIs into a 400. The refusal is now an addTableColumn option only workspace-source apply sets, so its plan and apply agree while the table APIs, Copilot and undo keep staging's behaviour. Restores staging's undo hook, OpenAPI description and contract comment. * fix: attempt every independent side effect of a fan-out after one fails The shared mapWithConcurrency starts nothing after a failure, where the apps/sim helper it replaced kept starting the rest. For fan-outs of independent side effects that left Slack targets undispatched, tombstones and cancellation writes unwritten, stale-dispatch cancel events unsent, project file retirements and chat image sweeps unrun. mapEachWithConcurrency attempts every item, then throws the first failure; those callers use it. * chore(e2e): name the workspace source e2e report variable like its siblings WORKSPACE_SOURCE_REPORT_PATH becomes WORKSPACE_SOURCE_E2E_REPORT_PATH, matching every other source e2e's _E2E_* variables; the CI http-e2e script passes the new name. * feat(workflow-code): warn on a condition or router branch no edge leaves W_BRANCH_UNWIRED names the branch and the wiring that fixes it. A branch the stored workflow already leaves unwired is not reported, and check fails on it only for a block the lock does not bind, so existing workflows keep checking clean. * fix(workflow-code): read a Start block's untouched blank input row as no fields Every new workflow's Start block is seeded with one unnamed string field, which execution skips, so `get` on a fresh workflow printed `inputFormat: { '': 'string' }`. A list holding only that starter field now canonicalizes as empty and prints `inputFormat: {}`; an unchanged apply keeps the stored field byte for byte, and a blank field beside named ones still prints as stored. * fix(workflow-source): fingerprint a stored workflow the same for every reader The sf1 fingerprint hashed the reader's canonical model, which names a credential the reader may see by key and one they may not see by id, so a member applying source a teammate read got a false 409. It now hashes every credential by its stored id. A credential key the reader cannot resolve, standing where the stored workflow holds a credential they cannot see, keeps the stored credential whatever the key (W_APPLY_CREDENTIAL_KEPT), so an unchanged or edited teammate source applies without confirming any key. * fix(workflow-source): refuse workflow names and descriptions v2 refuses Source could set an empty or whitespace name, a name over 255 characters or a description over 50,000, which v2 create and update refuse. The plan now refuses the fields a write sets with E_WORKFLOW_META_INVALID at the header, reading the limits from the v2 workflow contract. * fix(workspace-source): keep unkeyed managed rows out of source, and check required fills at plan A row the table grid's "add row" makes has an empty key cell, so a get printed it as a line the apply refuses (E_TABLE_ROWS): get -> apply of an unchanged directory failed. Such a row has nothing a line can match it by, so it is no longer managed: a get leaves it out of the rows file with I_TABLE_ROWS_UNKEYED, neither rows fingerprint counts it, and the keyed write never removes it. Making a column required trusted the declared rows to fill it even when no rows write was planned, so a row added in the UI made the apply fail mid-reshape. The declared rows now stand for the table only when a managed rows write is planned, and the rows that write keeps (unkeyed ones) are checked too. * fix(workspace-source): compare managed rows with the base under the key it recorded Changing a managed table's rows key and editing a row in one apply was a false E_APPLY_STALE: the server's rows were fingerprinted under the new key and compared with a base fingerprinted under the old one. The staleness check now reads the server under the key the table is still marked by. * fix(workspace-source): a reader's concealed MCP get applies back unchanged A get by a member who may not rewrite headers prints every literal header value as stored(); the plan resolved each stored() to a keyed hash, while a value that is not a credential prints (and fingerprints) as its text, so a writer applying that directory unchanged always planned a header update. stored() now resolves to the value as a get prints it. * fix(workflow-source): answer a racing source rename with SOURCE_NAME_TAKEN Two source renames onto one name in one folder both passed the name SELECT; the second hit the unique index and answered 500. The commit now maps that unique violation to WorkflowSourceNameTakenError, and the apply route answers it, like the create route, with 409 SOURCE_NAME_TAKEN. * fix(workspace-source): an unchanged file the server can no longer hand to source is a no-op A declared file edited past the blob cap in the Files tab, or one an older file moved beside it now takes the path of by letter case, refused the whole apply of an unchanged directory (E_FILE_TOO_LARGE / E_FILE_PATH_COLLISION). Unchanged since the get that read it, the declaration now leaves the file as the server has it (I_SERVER_CHANGED); a directory that changes it is still refused. * fix(workflow-source): report a dry run's needsRedeployment for the draft it would write A dry run answered needsRedeployment for the draft as stored, so an edit of a draft in step with its deployment said false and a revert said true. A dry run that would change the draft now compares the draft it would write with the active deployment; a no-op or refused dry run still reports the stored draft. * fix(workflow-source): record no refused apply for a plan-only evaluation A workspace plan or dry run evaluates each workflow planOnly, so planning a locked workflow recorded workflow_source_applied ok:false although nothing was applied. A planOnly run records nothing; the commit that follows records its own outcome. * fix(workspace-source): a knowledge document replace that stops partway resumes without losing tags A replace uploaded the replacement under the document's own name, then carried the old one's tags and deleted it. Stopped after the upload, the next apply deleted the old document without carrying its tags; stopped and then edited again, the two same-named documents read as a server change (E_APPLY_STALE) until deduplicated by hand, since nothing told the replacement from a document uploaded twice in the UI. The replacement is now uploaded under a name that names the old document, takes its tags, the old one is deleted, and the replacement is renamed. The next apply finishes a stopped replace whose replacement holds the declared bytes (tags carried, old deleted, renamed), or removes the replacement and replaces again; a replacement left before its rename stands for its name. The duplicate-by-hash rule this replaces is gone: an unmarked duplicate is ambiguous, as any other. * test(workflow-code): compare n with 8n in the growth check, so allocation noise on a slow runner stays far from the quadratic bound * fix(workflow-source): never keep a hidden credential over a key the apply binds A credential key the enclosing workspace apply binds in the same run is not an unknown key, so it resolves to that credential rather than keeping the stored one. * test(workflow-code): read and write input-format rows through their real shape in the API-built round trip * fix(workflow-code): keep a hidden credential on a block the source renames compileSource now returns the stored model it compiled against, re-keyed by the source's renames, and keptCredentials pairs compiled blocks with it, so a member who cannot see a credential can rename the block holding it. * fix(sim-cli): offline check passes stored container error edges, cycles and branches on bound blocks The offline check compiles without the stored workflow, so it refused an onError on a loop or parallel and a cycle that a get printed and the server keeps, and told the agent to delete them. compileWorkflow takes storedUnread: an edge between two lock-bound blocks may be stored, so it reports W_ERROR_PORT_STORED / W_EDGE_CYCLE saying an apply keeps it only if the stored workflow holds it, and the error stays for a new block. E_ERROR_PORT_UNSUPPORTED hints no longer say to remove the edge. W_BRANCH_UNWIRED never fails the check on a bound block, --strict included, matching its stored exemption. * fix(serializer): never evaluate a viewer-scoped default on the server * fix(sim-cli): keep a downloaded workflow's stored inputs typed in workspace.d.ts * fix(sim-cli): exit 13 when the server refuses a stored login's refresh token * fix(workflow-code): offline check binds a block renamed in source through its lock ident storedUnread now takes the lock, and compile counts a source block whose ident is one vacated lock entry's as bound (lockIdentRenames, materialize's lock-ident rule, shared with compileSource), so a renamed block's stored container error edge or stored cycle warns offline as the server accepts it. * fix(sim-cli): regenerate workspace.d.ts from local workflow inputs on a workflows check A per-folder `sim workflows source check` in a workspace directory already compiled every workflow's Start inputs for its child-call findings but left workspace.d.ts on the stored inputs, so a parent mapping an input added to the child since the get failed tsc with an excess-property error. It now refreshes workspace.d.ts the way `sim workspaces source check` does. * fix(workflows): refuse new edge cycles in the editing engine as edge_cycle skips The edit engine (Copilot edits, v2 operations) could create an edge that closes a cycle, which the canvas and realtime refuse and the executor cannot run. createValidatedEdge now runs the shared wouldCreateCycle check and reports a refused edge as an edge_cycle skipped item. Edges the workflow already stored are exempt, so a stored cycle survives unrelated edits and restated connections. Publishes edge_cycle in the v2 skipped-item enum and regenerates the OpenAPI document and CLI types. * fix(workflow-code): declare lock and base as type aliases so they fit the open generated API types * feat(mothership): sync the workflow-code entitlement into the generated protocol * test(workflow-source): stamp updatedAt on direct block writes so a migrate-on-read save cannot undo them --- .agents/skills/add-block/SKILL.md | 2 + .agents/skills/add-column-type/SKILL.md | 9 + .agents/skills/add-integration/SKILL.md | 2 + .agents/skills/v2-api-conventions/SKILL.md | 2 +- .claude/rules/sim-workflow-code.md | 211 + .cursor/rules/sim-workflow-code.mdc | 201 + .github/ci-suites.json | 4 + .github/scripts/ci-plan.gql | 2 +- .github/scripts/http-e2e.sh | 71 +- .github/workflows/checks.yml | 4 + .../(generated)/workflows/meta.json | 8 + .../api-reference/build-and-run-workflows.mdx | 4 + .../docs/api-reference/getting-started.mdx | 2 +- apps/docs/content/docs/cli/index.mdx | 5 + apps/docs/content/docs/cli/reference.mdx | 362 + apps/docs/content/docs/cli/scripting.mdx | 118 +- .../docs/content/docs/cli/troubleshooting.mdx | 2 +- apps/docs/content/docs/cli/workflows.mdx | 195 + apps/docs/content/docs/cli/workspaces.mdx | 140 + .../content/docs/getting-started/index.mdx | 1 + apps/docs/content/docs/mcp/tools.mdx | 4 + .../docs/platform/enterprise/self-hosted.mdx | 1 + .../platform/self-hosting/background-jobs.mdx | 1 + .../self-hosting/environment-variables.mdx | 6 + apps/docs/content/docs/workflows/code.mdx | 225 + apps/docs/content/docs/workflows/index.mdx | 1 + apps/docs/content/docs/workflows/meta.json | 2 + .../content/docs/workflows/workspace-code.mdx | 110 + apps/docs/openapi-v2-knowledge.json | 111 + apps/docs/openapi-v2-resources.json | 3087 ++ apps/docs/openapi-v2-workflows.json | 10220 ++++- .../scripts/fixtures/content-baseline.json | 1751 +- apps/realtime/src/database/operations.ts | 11 + .../database/source-meta-prune.integration.ts | 163 + apps/sim/AGENTS.md | 1 + apps/sim/app/account/settings/layout.tsx | 1 + .../api/cron/cleanup-source-staging/route.ts | 32 + apps/sim/app/api/files/export/[id]/route.ts | 3 +- apps/sim/app/api/invitations/route.ts | 2 +- .../connectors/directory-sync/route.ts | 2 +- .../knowledge/connectors/member-sync/route.ts | 2 +- .../api/knowledge/connectors/sync/route.ts | 2 +- apps/sim/app/api/logs/export/route.test.ts | 3 + apps/sim/app/api/logs/export/route.ts | 3 +- apps/sim/app/api/resume/poll/route.ts | 2 +- apps/sim/app/api/v1/logs/route.ts | 3 +- .../[documentId]/content/route.test.ts | 109 + .../documents/[documentId]/content/route.ts | 49 + .../[organizationId]/usage/summary/route.ts | 2 +- .../[workflowId]/source/feature-flag.test.ts | 85 + .../[workflowId]/source/route.test.ts | 380 + .../v2/workflows/[workflowId]/source/route.ts | 64 + .../source/blobs/missing/route.ts | 24 + .../[workspaceId]/source/blobs/route.ts | 74 + .../workspaces/[workspaceId]/source/route.ts | 69 + .../workflows/source/catalog/route.test.ts | 120 + .../workflows/source/catalog/route.ts | 27 + .../workflows/source/resources/route.test.ts | 121 + .../workflows/source/resources/route.ts | 28 + .../workflows/source/route.test.ts | 165 + .../[workspaceId]/workflows/source/route.ts | 36 + .../app/api/workflows/[id]/source/route.ts | 55 + apps/sim/app/extension/providers.tsx | 1 + apps/sim/app/layout.tsx | 5 + apps/sim/app/llms.txt/route.ts | 5 + .../components/composer/composer.test.tsx | 2 + apps/sim/app/o/[organizationId]/layout.tsx | 1 + .../components/file-viewer/monaco-editor.tsx | 260 + .../components/file-viewer/text-editor.tsx | 252 +- .../mothership-chat/rollout-controls.test.tsx | 1 + .../app/workspace/[workspaceId]/layout.tsx | 8 + .../providers/feature-flags-provider.tsx | 1 + .../components/desktop/desktop.test.tsx | 1 + .../settings/components/general/general.tsx | 2 +- .../components/general/timezone-picker.ts | 2 +- .../column-config-sidebar.tsx | 6 +- .../components/row-modal/row-modal.tsx | 8 +- .../table-grid/cells/inline-editors.test.ts | 2 +- .../table-grid/cells/inline-editors.tsx | 8 +- .../[tableId]/components/timezone-editing.ts | 2 +- .../[workspaceId]/tables/[tableId]/utils.ts | 7 +- .../panel/components/code/code.test.tsx | 264 + .../components/panel/components/code/code.tsx | 237 + .../components/panel/components/code/index.ts | 1 + .../panel/components/code/source-language.ts | 28 + .../panel/components/code/text-edit.test.ts | 59 + .../panel/components/code/text-edit.ts | 35 + .../deploy/hooks/use-draft-workflow-state.ts | 104 + .../condition-input/condition-input.tsx | 5 + .../components/tools/usage-control.tsx | 2 +- .../components/tool-input/tool-input.tsx | 14 +- .../hooks/use-canonical-sub-block-value.ts | 6 +- .../sub-block/hooks/use-depends-on-gate.ts | 2 +- .../sub-block/hooks/use-mcp-block-config.ts | 2 +- .../editor/components/sub-block/sub-block.tsx | 19 +- .../panel/components/editor/editor.tsx | 10 +- .../hooks/use-editor-subblock-layout.ts | 2 +- .../components/panel/components/index.ts | 1 + .../w/[workflowId]/components/panel/panel.tsx | 98 +- .../workflow-block/workflow-block.tsx | 2 +- .../preview-editor/preview-editor.tsx | 2 +- .../components/block/block.tsx | 2 +- .../cleanup-table-row-ttl.integration.ts | 5 +- apps/sim/background/cleanup-table-row-ttl.ts | 2 +- apps/sim/blocks/blocks.test.ts | 2 +- apps/sim/blocks/blocks/clickhouse.ts | 2 +- apps/sim/blocks/blocks/crowdstrike.ts | 2 +- apps/sim/blocks/blocks/datadog.ts | 2 +- apps/sim/blocks/blocks/file.ts | 2 +- apps/sim/blocks/blocks/huggingface.ts | 2 +- apps/sim/blocks/blocks/incidentio.ts | 8 +- apps/sim/blocks/blocks/okta.ts | 6 +- apps/sim/blocks/blocks/perplexity.ts | 2 +- apps/sim/blocks/blocks/posthog.test.ts | 82 + apps/sim/blocks/blocks/posthog.ts | 98 +- apps/sim/blocks/blocks/schedule.ts | 4 +- .../sim/blocks/blocks/slack-resources.test.ts | 2 +- apps/sim/blocks/blocks/slack.test.ts | 2 +- apps/sim/blocks/blocks/tailscale.ts | 16 +- apps/sim/blocks/blocks/tinybird.ts | 4 +- apps/sim/blocks/blocks/tts.test.ts | 24 + apps/sim/blocks/blocks/tts.ts | 23 +- .../sim/blocks/blocks/video_generator.test.ts | 2 +- apps/sim/blocks/blocks/video_generator.ts | 10 +- apps/sim/blocks/custom/build-config.ts | 16 +- apps/sim/blocks/pi-api-key-condition.test.ts | 2 +- apps/sim/blocks/sdk-names.generated.ts | 527 + apps/sim/blocks/sdk-names/a2a.json | 9 + apps/sim/blocks/sdk-names/affinity.json | 75 + apps/sim/blocks/sdk-names/affinity_v2.json | 80 + apps/sim/blocks/sdk-names/agent.json | 3 + apps/sim/blocks/sdk-names/agentmail.json | 26 + apps/sim/blocks/sdk-names/agentmail_v2.json | 31 + apps/sim/blocks/sdk-names/agentphone.json | 27 + apps/sim/blocks/sdk-names/agentphone_v2.json | 32 + apps/sim/blocks/sdk-names/agiloft.json | 23 + apps/sim/blocks/sdk-names/ahrefs.json | 28 + apps/sim/blocks/sdk-names/ahrefs_v2.json | 33 + apps/sim/blocks/sdk-names/airtable.json | 26 + apps/sim/blocks/sdk-names/algolia.json | 21 + apps/sim/blocks/sdk-names/algolia_v2.json | 26 + apps/sim/blocks/sdk-names/amplitude.json | 18 + apps/sim/blocks/sdk-names/amplitude_v2.json | 23 + apps/sim/blocks/sdk-names/api.json | 3 + apps/sim/blocks/sdk-names/api_trigger.json | 3 + apps/sim/blocks/sdk-names/apify.json | 10 + apps/sim/blocks/sdk-names/apify_v2.json | 15 + apps/sim/blocks/sdk-names/apollo.json | 30 + apps/sim/blocks/sdk-names/apollo_v2.json | 35 + apps/sim/blocks/sdk-names/appconfig.json | 30 + apps/sim/blocks/sdk-names/appconfig_v2.json | 35 + apps/sim/blocks/sdk-names/arxiv.json | 8 + apps/sim/blocks/sdk-names/asana.json | 24 + apps/sim/blocks/sdk-names/ashby.json | 68 + apps/sim/blocks/sdk-names/ashby_v2.json | 73 + apps/sim/blocks/sdk-names/athena.json | 32 + apps/sim/blocks/sdk-names/athena_v2.json | 37 + apps/sim/blocks/sdk-names/attio.json | 82 + .../blocks/sdk-names/azure_data_explorer.json | 19 + .../sdk-names/azure_data_explorer_v2.json | 24 + apps/sim/blocks/sdk-names/azure_devops.json | 26 + .../sim/blocks/sdk-names/azure_devops_v2.json | 31 + apps/sim/blocks/sdk-names/bitbucket.json | 64 + apps/sim/blocks/sdk-names/box.json | 20 + apps/sim/blocks/sdk-names/box_v2.json | 20 + apps/sim/blocks/sdk-names/brandfetch.json | 7 + apps/sim/blocks/sdk-names/brex.json | 39 + apps/sim/blocks/sdk-names/brex_v2.json | 44 + apps/sim/blocks/sdk-names/brightdata.json | 13 + apps/sim/blocks/sdk-names/brightdata_v2.json | 18 + apps/sim/blocks/sdk-names/browser_use.json | 3 + apps/sim/blocks/sdk-names/browser_use_v2.json | 8 + apps/sim/blocks/sdk-names/buffer.json | 18 + apps/sim/blocks/sdk-names/buffer_v2.json | 23 + apps/sim/blocks/sdk-names/calcom.json | 40 + apps/sim/blocks/sdk-names/calendly.json | 30 + apps/sim/blocks/sdk-names/calendly_v2.json | 35 + apps/sim/blocks/sdk-names/cbinsights.json | 30 + apps/sim/blocks/sdk-names/cbinsights_v2.json | 35 + apps/sim/blocks/sdk-names/chat_trigger.json | 3 + apps/sim/blocks/sdk-names/checkr.json | 94 + apps/sim/blocks/sdk-names/checkr_v2.json | 99 + apps/sim/blocks/sdk-names/circleback.json | 30 + apps/sim/blocks/sdk-names/circleback_v2.json | 35 + apps/sim/blocks/sdk-names/clay.json | 3 + apps/sim/blocks/sdk-names/clerk.json | 55 + apps/sim/blocks/sdk-names/clerk_v2.json | 60 + apps/sim/blocks/sdk-names/clickhouse.json | 31 + apps/sim/blocks/sdk-names/clickup.json | 82 + apps/sim/blocks/sdk-names/cloudflare.json | 81 + apps/sim/blocks/sdk-names/cloudflare_v2.json | 86 + apps/sim/blocks/sdk-names/cloudformation.json | 20 + .../blocks/sdk-names/cloudformation_v2.json | 25 + apps/sim/blocks/sdk-names/cloudtrail.json | 19 + apps/sim/blocks/sdk-names/cloudtrail_v2.json | 24 + apps/sim/blocks/sdk-names/cloudwatch.json | 18 + apps/sim/blocks/sdk-names/cloudwatch_v2.json | 23 + apps/sim/blocks/sdk-names/coda.json | 70 + apps/sim/blocks/sdk-names/codepipeline.json | 17 + .../sim/blocks/sdk-names/codepipeline_v2.json | 22 + apps/sim/blocks/sdk-names/condition.json | 3 + apps/sim/blocks/sdk-names/confluence.json | 25 + apps/sim/blocks/sdk-names/confluence_v2.json | 81 + apps/sim/blocks/sdk-names/context_dev.json | 24 + apps/sim/blocks/sdk-names/convex.json | 12 + apps/sim/blocks/sdk-names/convex_v2.json | 17 + apps/sim/blocks/sdk-names/credential.json | 14 + .../blocks/sdk-names/credential_group.json | 13 + apps/sim/blocks/sdk-names/crowdstrike.json | 28 + apps/sim/blocks/sdk-names/crowdstrike_v2.json | 33 + apps/sim/blocks/sdk-names/crunchbase.json | 19 + apps/sim/blocks/sdk-names/crunchbase_v2.json | 24 + apps/sim/blocks/sdk-names/cursor.json | 17 + apps/sim/blocks/sdk-names/cursor_v2.json | 17 + apps/sim/blocks/sdk-names/cursor_v3.json | 22 + apps/sim/blocks/sdk-names/dagster.json | 24 + apps/sim/blocks/sdk-names/databricks.json | 58 + apps/sim/blocks/sdk-names/databricks_v2.json | 63 + apps/sim/blocks/sdk-names/datadog.json | 46 + apps/sim/blocks/sdk-names/datadog_v2.json | 51 + apps/sim/blocks/sdk-names/datagma.json | 10 + apps/sim/blocks/sdk-names/daytona.json | 17 + apps/sim/blocks/sdk-names/daytona_v2.json | 22 + apps/sim/blocks/sdk-names/deployments.json | 10 + apps/sim/blocks/sdk-names/devin.json | 16 + apps/sim/blocks/sdk-names/devin_v2.json | 21 + apps/sim/blocks/sdk-names/discord.json | 44 + apps/sim/blocks/sdk-names/discord_v2.json | 49 + apps/sim/blocks/sdk-names/docusign.json | 18 + apps/sim/blocks/sdk-names/downdetector.json | 20 + apps/sim/blocks/sdk-names/dropbox.json | 23 + apps/sim/blocks/sdk-names/dropbox_v2.json | 23 + apps/sim/blocks/sdk-names/dropcontact.json | 6 + apps/sim/blocks/sdk-names/dspy.json | 8 + apps/sim/blocks/sdk-names/dub.json | 22 + apps/sim/blocks/sdk-names/dub_v2.json | 22 + apps/sim/blocks/sdk-names/dub_v3.json | 27 + apps/sim/blocks/sdk-names/duckduckgo.json | 3 + apps/sim/blocks/sdk-names/dynamodb.json | 12 + apps/sim/blocks/sdk-names/dynamodb_v2.json | 17 + apps/sim/blocks/sdk-names/dynatrace.json | 52 + apps/sim/blocks/sdk-names/dynatrace_v2.json | 57 + apps/sim/blocks/sdk-names/ec2.json | 39 + apps/sim/blocks/sdk-names/ec2_v2.json | 44 + apps/sim/blocks/sdk-names/elasticsearch.json | 18 + apps/sim/blocks/sdk-names/elevenlabs.json | 15 + apps/sim/blocks/sdk-names/elevenlabs_v2.json | 20 + apps/sim/blocks/sdk-names/emailbison.json | 37 + apps/sim/blocks/sdk-names/emailbison_v2.json | 42 + apps/sim/blocks/sdk-names/embeddings.json | 3 + apps/sim/blocks/sdk-names/enrich.json | 37 + apps/sim/blocks/sdk-names/enrich_v2.json | 42 + apps/sim/blocks/sdk-names/enrichment.json | 11 + apps/sim/blocks/sdk-names/enrow.json | 7 + apps/sim/blocks/sdk-names/evaluator.json | 3 + apps/sim/blocks/sdk-names/exa.json | 10 + apps/sim/blocks/sdk-names/extend.json | 3 + apps/sim/blocks/sdk-names/extend_v2.json | 3 + apps/sim/blocks/sdk-names/extend_v3.json | 8 + apps/sim/blocks/sdk-names/fathom.json | 15 + apps/sim/blocks/sdk-names/fathom_v2.json | 20 + apps/sim/blocks/sdk-names/file.json | 3 + apps/sim/blocks/sdk-names/file_v2.json | 3 + apps/sim/blocks/sdk-names/file_v3.json | 9 + apps/sim/blocks/sdk-names/file_v4.json | 9 + apps/sim/blocks/sdk-names/file_v5.json | 21 + apps/sim/blocks/sdk-names/findymail.json | 16 + apps/sim/blocks/sdk-names/firecrawl.json | 19 + apps/sim/blocks/sdk-names/fireflies.json | 18 + apps/sim/blocks/sdk-names/fireflies_v2.json | 18 + apps/sim/blocks/sdk-names/fireflies_v3.json | 23 + apps/sim/blocks/sdk-names/fivetran.json | 62 + apps/sim/blocks/sdk-names/flint.json | 8 + apps/sim/blocks/sdk-names/flint_v2.json | 13 + apps/sim/blocks/sdk-names/flow.json | 33 + apps/sim/blocks/sdk-names/function.json | 3 + apps/sim/blocks/sdk-names/gamma.json | 10 + apps/sim/blocks/sdk-names/gamma_v2.json | 15 + apps/sim/blocks/sdk-names/gauge.json | 37 + .../sim/blocks/sdk-names/generic_webhook.json | 3 + apps/sim/blocks/sdk-names/github.json | 105 + apps/sim/blocks/sdk-names/github_v2.json | 105 + apps/sim/blocks/sdk-names/github_v3.json | 110 + apps/sim/blocks/sdk-names/gitlab.json | 78 + apps/sim/blocks/sdk-names/gitlab_v2.json | 83 + apps/sim/blocks/sdk-names/gmail.json | 29 + apps/sim/blocks/sdk-names/gmail_v2.json | 40 + apps/sim/blocks/sdk-names/gong.json | 38 + apps/sim/blocks/sdk-names/gong_v2.json | 43 + apps/sim/blocks/sdk-names/google_ads.json | 16 + .../sim/blocks/sdk-names/google_appsheet.json | 9 + .../sim/blocks/sdk-names/google_bigquery.json | 21 + apps/sim/blocks/sdk-names/google_books.json | 7 + .../sim/blocks/sdk-names/google_calendar.json | 35 + .../blocks/sdk-names/google_calendar_v2.json | 35 + .../sim/blocks/sdk-names/google_contacts.json | 16 + apps/sim/blocks/sdk-names/google_docs.json | 25 + apps/sim/blocks/sdk-names/google_drive.json | 40 + apps/sim/blocks/sdk-names/google_forms.json | 22 + apps/sim/blocks/sdk-names/google_groups.json | 26 + apps/sim/blocks/sdk-names/google_maps.json | 21 + apps/sim/blocks/sdk-names/google_meet.json | 16 + .../blocks/sdk-names/google_pagespeed.json | 3 + apps/sim/blocks/sdk-names/google_search.json | 3 + apps/sim/blocks/sdk-names/google_sheets.json | 14 + .../blocks/sdk-names/google_sheets_v2.json | 30 + apps/sim/blocks/sdk-names/google_slides.json | 62 + .../blocks/sdk-names/google_slides_v2.json | 62 + apps/sim/blocks/sdk-names/google_tasks.json | 16 + .../blocks/sdk-names/google_translate.json | 7 + apps/sim/blocks/sdk-names/google_vault.json | 32 + apps/sim/blocks/sdk-names/grafana.json | 35 + apps/sim/blocks/sdk-names/grafana_v2.json | 40 + apps/sim/blocks/sdk-names/grain.json | 24 + apps/sim/blocks/sdk-names/grain_v2.json | 26 + apps/sim/blocks/sdk-names/grain_v3.json | 31 + apps/sim/blocks/sdk-names/granola.json | 20 + apps/sim/blocks/sdk-names/granola_v2.json | 25 + apps/sim/blocks/sdk-names/greenhouse.json | 26 + apps/sim/blocks/sdk-names/greenhouse_v2.json | 70 + apps/sim/blocks/sdk-names/greptile.json | 8 + apps/sim/blocks/sdk-names/guardrails.json | 3 + apps/sim/blocks/sdk-names/harmonic.json | 23 + apps/sim/blocks/sdk-names/helpscout.json | 65 + apps/sim/blocks/sdk-names/hex.json | 26 + apps/sim/blocks/sdk-names/hex_v2.json | 31 + apps/sim/blocks/sdk-names/higgsfield.json | 19 + apps/sim/blocks/sdk-names/hubspot.json | 66 + apps/sim/blocks/sdk-names/huggingface.json | 3 + apps/sim/blocks/sdk-names/huggingface_v2.json | 8 + .../blocks/sdk-names/human_in_the_loop.json | 3 + .../sdk-names/human_in_the_loop_v2.json | 3 + apps/sim/blocks/sdk-names/hunter.json | 11 + apps/sim/blocks/sdk-names/iam.json | 29 + apps/sim/blocks/sdk-names/iam_v2.json | 34 + apps/sim/blocks/sdk-names/icypeas.json | 7 + .../sim/blocks/sdk-names/identity_center.json | 21 + .../blocks/sdk-names/identity_center_v2.json | 26 + .../sim/blocks/sdk-names/image_generator.json | 3 + .../blocks/sdk-names/image_generator_v2.json | 3 + apps/sim/blocks/sdk-names/imap.json | 3 + apps/sim/blocks/sdk-names/incidentio.json | 76 + apps/sim/blocks/sdk-names/incidentio_v2.json | 81 + apps/sim/blocks/sdk-names/infisical.json | 10 + apps/sim/blocks/sdk-names/infisical_v2.json | 15 + apps/sim/blocks/sdk-names/input_trigger.json | 3 + apps/sim/blocks/sdk-names/instagram.json | 34 + apps/sim/blocks/sdk-names/instantly.json | 43 + apps/sim/blocks/sdk-names/instantly_v2.json | 48 + apps/sim/blocks/sdk-names/intercom.json | 36 + apps/sim/blocks/sdk-names/intercom_v2.json | 44 + apps/sim/blocks/sdk-names/intercom_v3.json | 49 + apps/sim/blocks/sdk-names/intune.json | 24 + apps/sim/blocks/sdk-names/jama.json | 50 + apps/sim/blocks/sdk-names/jina.json | 7 + apps/sim/blocks/sdk-names/jira.json | 58 + .../sdk-names/jira_service_management.json | 60 + apps/sim/blocks/sdk-names/jotform.json | 51 + apps/sim/blocks/sdk-names/jotform_v2.json | 56 + apps/sim/blocks/sdk-names/jupyter.json | 21 + apps/sim/blocks/sdk-names/jupyter_v2.json | 21 + apps/sim/blocks/sdk-names/jupyter_v3.json | 26 + apps/sim/blocks/sdk-names/kalshi.json | 27 + apps/sim/blocks/sdk-names/kalshi_v2.json | 27 + apps/sim/blocks/sdk-names/kalshi_v3.json | 32 + apps/sim/blocks/sdk-names/ketch.json | 10 + apps/sim/blocks/sdk-names/knowledge.json | 19 + apps/sim/blocks/sdk-names/lambda.json | 55 + apps/sim/blocks/sdk-names/lambda_v2.json | 60 + apps/sim/blocks/sdk-names/langsmith.json | 10 + apps/sim/blocks/sdk-names/langsmith_v2.json | 15 + apps/sim/blocks/sdk-names/latex.json | 9 + apps/sim/blocks/sdk-names/launchdarkly.json | 17 + .../sim/blocks/sdk-names/launchdarkly_v2.json | 22 + apps/sim/blocks/sdk-names/leadmagic.json | 14 + apps/sim/blocks/sdk-names/lemlist.json | 19 + apps/sim/blocks/sdk-names/lemlist_v2.json | 24 + apps/sim/blocks/sdk-names/linear.json | 105 + apps/sim/blocks/sdk-names/linear_v2.json | 105 + apps/sim/blocks/sdk-names/linkedin.json | 12 + apps/sim/blocks/sdk-names/linkup.json | 3 + apps/sim/blocks/sdk-names/linq.json | 47 + apps/sim/blocks/sdk-names/linq_v2.json | 52 + apps/sim/blocks/sdk-names/logfire.json | 9 + apps/sim/blocks/sdk-names/logfire_v2.json | 14 + apps/sim/blocks/sdk-names/logrocket.json | 11 + apps/sim/blocks/sdk-names/logs.json | 8 + apps/sim/blocks/sdk-names/logs_v2.json | 7 + apps/sim/blocks/sdk-names/loops.json | 28 + apps/sim/blocks/sdk-names/loops_v2.json | 33 + apps/sim/blocks/sdk-names/luma.json | 16 + apps/sim/blocks/sdk-names/luma_v2.json | 21 + apps/sim/blocks/sdk-names/mailchimp.json | 79 + apps/sim/blocks/sdk-names/mailchimp_v2.json | 84 + apps/sim/blocks/sdk-names/mailgun.json | 13 + apps/sim/blocks/sdk-names/mailgun_v2.json | 18 + apps/sim/blocks/sdk-names/managed_agent.json | 16 + .../blocks/sdk-names/manageengine_sdp.json | 41 + apps/sim/blocks/sdk-names/manual_trigger.json | 3 + apps/sim/blocks/sdk-names/mcp.json | 7 + apps/sim/blocks/sdk-names/mem0.json | 8 + apps/sim/blocks/sdk-names/mem0_v2.json | 13 + apps/sim/blocks/sdk-names/memory.json | 9 + apps/sim/blocks/sdk-names/microsoft_ad.json | 42 + .../blocks/sdk-names/microsoft_dataverse.json | 23 + .../sdk-names/microsoft_dataverse_v2.json | 23 + .../sdk-names/microsoft_dynamics_365.json | 15 + .../sim/blocks/sdk-names/microsoft_excel.json | 19 + .../blocks/sdk-names/microsoft_excel_v2.json | 34 + .../blocks/sdk-names/microsoft_planner.json | 28 + .../sim/blocks/sdk-names/microsoft_teams.json | 35 + apps/sim/blocks/sdk-names/microsoft_word.json | 18 + .../sim/blocks/sdk-names/millionverifier.json | 7 + apps/sim/blocks/sdk-names/mintlify.json | 23 + apps/sim/blocks/sdk-names/mistral_parse.json | 3 + .../blocks/sdk-names/mistral_parse_v2.json | 3 + .../blocks/sdk-names/mistral_parse_v3.json | 3 + apps/sim/blocks/sdk-names/modal.json | 8 + apps/sim/blocks/sdk-names/monaco.json | 56 + apps/sim/blocks/sdk-names/monday.json | 42 + apps/sim/blocks/sdk-names/mongodb.json | 11 + apps/sim/blocks/sdk-names/mothership.json | 3 + apps/sim/blocks/sdk-names/mssql.json | 11 + apps/sim/blocks/sdk-names/mssql_v2.json | 16 + apps/sim/blocks/sdk-names/mysql.json | 11 + apps/sim/blocks/sdk-names/mysql_v2.json | 16 + apps/sim/blocks/sdk-names/neo4j.json | 12 + apps/sim/blocks/sdk-names/netsuite.json | 37 + apps/sim/blocks/sdk-names/neverbounce.json | 7 + apps/sim/blocks/sdk-names/new_relic.json | 9 + apps/sim/blocks/sdk-names/new_relic_v2.json | 14 + apps/sim/blocks/sdk-names/note.json | 3 + apps/sim/blocks/sdk-names/notion.json | 28 + apps/sim/blocks/sdk-names/notion_v2.json | 39 + apps/sim/blocks/sdk-names/obsidian.json | 20 + apps/sim/blocks/sdk-names/okta.json | 51 + apps/sim/blocks/sdk-names/okta_v2.json | 56 + apps/sim/blocks/sdk-names/onedrive.json | 22 + apps/sim/blocks/sdk-names/onepassword.json | 15 + apps/sim/blocks/sdk-names/openai.json | 3 + .../sdk-names/oracle_fusion_financials.json | 46 + apps/sim/blocks/sdk-names/oracledb.json | 16 + apps/sim/blocks/sdk-names/otter.json | 18 + apps/sim/blocks/sdk-names/otter_v2.json | 23 + apps/sim/blocks/sdk-names/outlook.json | 39 + apps/sim/blocks/sdk-names/pagerduty.json | 28 + apps/sim/blocks/sdk-names/pagerduty_v2.json | 33 + apps/sim/blocks/sdk-names/parallel_ai.json | 8 + apps/sim/blocks/sdk-names/peopledatalabs.json | 16 + apps/sim/blocks/sdk-names/perplexity.json | 7 + apps/sim/blocks/sdk-names/persona.json | 31 + apps/sim/blocks/sdk-names/persona_v2.json | 36 + apps/sim/blocks/sdk-names/pi.json | 3 + apps/sim/blocks/sdk-names/pinecone.json | 16 + apps/sim/blocks/sdk-names/pipedrive.json | 28 + apps/sim/blocks/sdk-names/pitchbook.json | 96 + apps/sim/blocks/sdk-names/plane.json | 118 + apps/sim/blocks/sdk-names/plane_v2.json | 123 + apps/sim/blocks/sdk-names/planetscale.json | 20 + apps/sim/blocks/sdk-names/planetscale_v2.json | 25 + apps/sim/blocks/sdk-names/polymarket.json | 25 + apps/sim/blocks/sdk-names/postgresql.json | 11 + apps/sim/blocks/sdk-names/postgresql_v2.json | 16 + apps/sim/blocks/sdk-names/posthog.json | 53 + apps/sim/blocks/sdk-names/powerbi.json | 18 + apps/sim/blocks/sdk-names/profound.json | 29 + apps/sim/blocks/sdk-names/profound_v2.json | 34 + apps/sim/blocks/sdk-names/prospeo.json | 13 + apps/sim/blocks/sdk-names/pulse.json | 3 + apps/sim/blocks/sdk-names/pulse_v2.json | 3 + apps/sim/blocks/sdk-names/pulse_v3.json | 8 + apps/sim/blocks/sdk-names/qdrant.json | 8 + apps/sim/blocks/sdk-names/qdrant_v2.json | 13 + apps/sim/blocks/sdk-names/quartr.json | 22 + apps/sim/blocks/sdk-names/quartr_v2.json | 27 + apps/sim/blocks/sdk-names/quickbooks.json | 93 + apps/sim/blocks/sdk-names/quiver.json | 8 + apps/sim/blocks/sdk-names/quiver_v2.json | 8 + apps/sim/blocks/sdk-names/quiver_v3.json | 13 + apps/sim/blocks/sdk-names/rabbitmq.json | 30 + apps/sim/blocks/sdk-names/railway.json | 25 + apps/sim/blocks/sdk-names/railway_v2.json | 30 + apps/sim/blocks/sdk-names/ramp.json | 28 + apps/sim/blocks/sdk-names/rb2b.json | 20 + apps/sim/blocks/sdk-names/rb2b_v2.json | 25 + apps/sim/blocks/sdk-names/rds.json | 11 + apps/sim/blocks/sdk-names/rds_v2.json | 16 + apps/sim/blocks/sdk-names/reddit.json | 47 + apps/sim/blocks/sdk-names/redis.json | 27 + apps/sim/blocks/sdk-names/reducto.json | 3 + apps/sim/blocks/sdk-names/reducto_v2.json | 3 + apps/sim/blocks/sdk-names/reducto_v3.json | 8 + apps/sim/blocks/sdk-names/resend.json | 31 + apps/sim/blocks/sdk-names/resend_v2.json | 36 + apps/sim/blocks/sdk-names/response.json | 3 + apps/sim/blocks/sdk-names/revenuecat.json | 23 + apps/sim/blocks/sdk-names/rippling.json | 91 + apps/sim/blocks/sdk-names/rippling_v2.json | 96 + apps/sim/blocks/sdk-names/rocketlane.json | 69 + apps/sim/blocks/sdk-names/rocketlane_v2.json | 74 + apps/sim/blocks/sdk-names/rootly.json | 52 + apps/sim/blocks/sdk-names/rootly_v2.json | 57 + apps/sim/blocks/sdk-names/router.json | 3 + apps/sim/blocks/sdk-names/router_v2.json | 3 + apps/sim/blocks/sdk-names/rss.json | 3 + apps/sim/blocks/sdk-names/s3.json | 16 + apps/sim/blocks/sdk-names/s3_v2.json | 21 + apps/sim/blocks/sdk-names/sailpoint.json | 45 + apps/sim/blocks/sdk-names/sailpoint_v2.json | 50 + apps/sim/blocks/sdk-names/salesforce.json | 58 + apps/sim/blocks/sdk-names/sap_concur.json | 75 + apps/sim/blocks/sdk-names/sap_s4hana.json | 43 + apps/sim/blocks/sdk-names/schedule.json | 3 + apps/sim/blocks/sdk-names/search.json | 3 + .../sim/blocks/sdk-names/secrets_manager.json | 15 + .../blocks/sdk-names/secrets_manager_v2.json | 20 + apps/sim/blocks/sdk-names/semrush.json | 49 + apps/sim/blocks/sdk-names/sendblue.json | 14 + apps/sim/blocks/sdk-names/sendgrid.json | 21 + apps/sim/blocks/sdk-names/sendgrid_v2.json | 26 + apps/sim/blocks/sdk-names/sentry.json | 25 + apps/sim/blocks/sdk-names/sentry_v2.json | 30 + apps/sim/blocks/sdk-names/serper.json | 3 + apps/sim/blocks/sdk-names/servicenow.json | 47 + apps/sim/blocks/sdk-names/servicenow_v2.json | 47 + apps/sim/blocks/sdk-names/servicenow_v3.json | 52 + apps/sim/blocks/sdk-names/ses.json | 24 + apps/sim/blocks/sdk-names/ses_v2.json | 29 + apps/sim/blocks/sdk-names/sftp.json | 11 + apps/sim/blocks/sdk-names/sftp_v2.json | 11 + apps/sim/blocks/sdk-names/sharepoint.json | 26 + apps/sim/blocks/sdk-names/sharepoint_v2.json | 26 + apps/sim/blocks/sdk-names/shopify.json | 38 + .../blocks/sdk-names/sim_workspace_event.json | 3 + apps/sim/blocks/sdk-names/similarweb.json | 11 + apps/sim/blocks/sdk-names/similarweb_v2.json | 16 + apps/sim/blocks/sdk-names/sixtyfour.json | 9 + apps/sim/blocks/sdk-names/sixtyfour_v2.json | 14 + apps/sim/blocks/sdk-names/slack.json | 55 + apps/sim/blocks/sdk-names/slack_v2.json | 108 + apps/sim/blocks/sdk-names/smartlead.json | 52 + apps/sim/blocks/sdk-names/smartlead_v2.json | 57 + apps/sim/blocks/sdk-names/smtp.json | 3 + apps/sim/blocks/sdk-names/snowflake.json | 42 + apps/sim/blocks/sdk-names/splunk.json | 17 + apps/sim/blocks/sdk-names/splunk_v2.json | 22 + apps/sim/blocks/sdk-names/sportmonks.json | 226 + apps/sim/blocks/sdk-names/sportmonks_v2.json | 231 + apps/sim/blocks/sdk-names/spotify.json | 88 + apps/sim/blocks/sdk-names/sqs.json | 26 + apps/sim/blocks/sdk-names/sqs_v2.json | 31 + apps/sim/blocks/sdk-names/square.json | 39 + apps/sim/blocks/sdk-names/square_v2.json | 44 + apps/sim/blocks/sdk-names/ssh.json | 18 + apps/sim/blocks/sdk-names/ssh_v2.json | 18 + apps/sim/blocks/sdk-names/ssm.json | 27 + apps/sim/blocks/sdk-names/ssm_v2.json | 32 + apps/sim/blocks/sdk-names/stagehand.json | 7 + apps/sim/blocks/sdk-names/start_trigger.json | 3 + apps/sim/blocks/sdk-names/starter.json | 3 + apps/sim/blocks/sdk-names/stripe.json | 58 + apps/sim/blocks/sdk-names/stripe_v2.json | 63 + apps/sim/blocks/sdk-names/sts.json | 11 + apps/sim/blocks/sdk-names/sts_v2.json | 16 + apps/sim/blocks/sdk-names/stt.json | 3 + apps/sim/blocks/sdk-names/stt_v2.json | 3 + apps/sim/blocks/sdk-names/supabase.json | 31 + apps/sim/blocks/sdk-names/supabase_v2.json | 36 + apps/sim/blocks/sdk-names/table.json | 18 + apps/sim/blocks/sdk-names/table_v2.json | 18 + apps/sim/blocks/sdk-names/tailscale.json | 45 + apps/sim/blocks/sdk-names/tailscale_v2.json | 50 + apps/sim/blocks/sdk-names/tavily.json | 9 + apps/sim/blocks/sdk-names/tavily_v2.json | 14 + apps/sim/blocks/sdk-names/telegram.json | 27 + apps/sim/blocks/sdk-names/telegram_v2.json | 32 + apps/sim/blocks/sdk-names/temporal.json | 25 + apps/sim/blocks/sdk-names/textract.json | 3 + apps/sim/blocks/sdk-names/textract_v2.json | 8 + apps/sim/blocks/sdk-names/textract_v3.json | 13 + apps/sim/blocks/sdk-names/thinking.json | 3 + apps/sim/blocks/sdk-names/thrive.json | 52 + apps/sim/blocks/sdk-names/thrive_v2.json | 57 + apps/sim/blocks/sdk-names/tiktok.json | 26 + apps/sim/blocks/sdk-names/tinybird.json | 12 + apps/sim/blocks/sdk-names/tinybird_v2.json | 17 + apps/sim/blocks/sdk-names/tinyfish.json | 14 + apps/sim/blocks/sdk-names/translate.json | 3 + apps/sim/blocks/sdk-names/trello.json | 31 + apps/sim/blocks/sdk-names/trigger_dev.json | 49 + apps/sim/blocks/sdk-names/trigger_dev_v2.json | 54 + apps/sim/blocks/sdk-names/tts.json | 3 + apps/sim/blocks/sdk-names/twilio_sms.json | 7 + apps/sim/blocks/sdk-names/twilio_sms_v2.json | 12 + apps/sim/blocks/sdk-names/twilio_voice.json | 11 + .../sim/blocks/sdk-names/twilio_voice_v2.json | 16 + apps/sim/blocks/sdk-names/typeform.json | 16 + apps/sim/blocks/sdk-names/typeform_v2.json | 21 + apps/sim/blocks/sdk-names/upstash.json | 21 + apps/sim/blocks/sdk-names/upstash_v2.json | 26 + apps/sim/blocks/sdk-names/uptimerobot.json | 29 + apps/sim/blocks/sdk-names/uptimerobot_v2.json | 34 + apps/sim/blocks/sdk-names/vanta.json | 39 + apps/sim/blocks/sdk-names/variables.json | 3 + apps/sim/blocks/sdk-names/vercel.json | 71 + apps/sim/blocks/sdk-names/vercel_v2.json | 76 + .../sim/blocks/sdk-names/video_generator.json | 3 + .../blocks/sdk-names/video_generator_v2.json | 3 + .../blocks/sdk-names/video_generator_v3.json | 3 + apps/sim/blocks/sdk-names/vision.json | 3 + apps/sim/blocks/sdk-names/vision_v2.json | 3 + apps/sim/blocks/sdk-names/wait.json | 3 + apps/sim/blocks/sdk-names/wealthbox.json | 16 + apps/sim/blocks/sdk-names/webflow.json | 24 + .../sim/blocks/sdk-names/webhook_request.json | 3 + apps/sim/blocks/sdk-names/whatsapp.json | 16 + apps/sim/blocks/sdk-names/whatsapp_v2.json | 21 + apps/sim/blocks/sdk-names/wikipedia.json | 9 + apps/sim/blocks/sdk-names/windchill.json | 32 + apps/sim/blocks/sdk-names/wiza.json | 9 + apps/sim/blocks/sdk-names/wordpress.json | 42 + apps/sim/blocks/sdk-names/workday.json | 15 + apps/sim/blocks/sdk-names/workflow.json | 3 + apps/sim/blocks/sdk-names/workflow_input.json | 3 + apps/sim/blocks/sdk-names/x.json | 38 + apps/sim/blocks/sdk-names/youcom.json | 13 + apps/sim/blocks/sdk-names/youcom_v2.json | 18 + apps/sim/blocks/sdk-names/youtube.json | 14 + apps/sim/blocks/sdk-names/youtube_v2.json | 19 + apps/sim/blocks/sdk-names/zendesk.json | 38 + apps/sim/blocks/sdk-names/zendesk_v2.json | 43 + apps/sim/blocks/sdk-names/zep.json | 14 + apps/sim/blocks/sdk-names/zep_v2.json | 19 + apps/sim/blocks/sdk-names/zerobounce.json | 7 + apps/sim/blocks/sdk-names/zoho_desk.json | 46 + apps/sim/blocks/sdk-names/zoom.json | 28 + apps/sim/blocks/sdk-names/zoominfo.json | 11 + apps/sim/blocks/sdk-names/zoominfo_v2.json | 16 + apps/sim/blocks/types.ts | 11 +- apps/sim/blocks/utils.test.ts | 2 +- .../dashboards/dashboard-controls.tsx | 2 +- .../dashboards/use-dashboard-time.ts | 2 +- apps/sim/connectors/confluence/confluence.ts | 2 +- apps/sim/connectors/gmail/gmail.ts | 2 +- .../connectors/google-drive/company-crawl.ts | 2 +- .../connectors/google-drive/google-drive.ts | 2 +- .../google-workspace/company-crawl.ts | 2 +- .../project-issue-restrictions.test.tsx | 1 + .../hooks/use-usage-window.ts | 2 +- .../lib/copy/copy-resources.ts | 2 +- .../lib/copy/copy-workflows.ts | 23 +- .../ee/workspace-forking/lib/create-fork.ts | 1 + .../lib/promote/cleared-refs.ts | 6 +- .../workspace-forking/lib/promote/promote.ts | 1 + apps/sim/executor/execution/block-executor.ts | 2 +- .../handlers/condition/handler.test.ts | 19 + .../handlers/human-in-the-loop/handler.ts | 4 +- .../variables/code-context-parity.test.ts | 68 + apps/sim/executor/variables/resolver.test.ts | 167 + apps/sim/executor/variables/resolver.ts | 89 +- .../general-settings-timezone.test.tsx | 2 +- apps/sim/hooks/queries/general-settings.ts | 2 +- .../sim/hooks/queries/workflow-source.test.ts | 61 + apps/sim/hooks/queries/workflow-source.ts | 75 + apps/sim/hooks/queries/workflows.ts | 3 + apps/sim/hooks/use-reactive-conditions.ts | 2 +- .../hooks/use-trigger-config-aggregation.ts | 2 +- apps/sim/lib/api/client/request.ts | 57 +- .../lib/api/contracts/organization-usage.ts | 2 +- apps/sim/lib/api/contracts/v2/knowledge.ts | 14 + .../lib/api/contracts/v2/openapi/knowledge.ts | 30 + .../lib/api/contracts/v2/openapi/resources.ts | 7 +- .../contracts/v2/openapi/source-catalog.ts | 100 + .../contracts/v2/openapi/source-resources.ts | 79 + .../contracts/v2/openapi/workflow-source.ts | 205 + .../lib/api/contracts/v2/openapi/workflows.ts | 13 +- .../contracts/v2/openapi/workspace-source.ts | 231 + .../lib/api/contracts/v2/source-catalog.ts | 476 + .../lib/api/contracts/v2/source-resources.ts | 133 + .../lib/api/contracts/v2/workflow-source.ts | 259 + apps/sim/lib/api/contracts/v2/workflows.ts | 14 +- .../lib/api/contracts/v2/workspace-source.ts | 414 + .../lib/api/contracts/workflow-references.ts | 2 +- apps/sim/lib/api/contracts/workflow-source.ts | 179 + apps/sim/lib/api/contracts/workspace-fork.ts | 2 +- .../lib/api/mcp/generated/v2-operations.ts | 86 + apps/sim/lib/api/mcp/server.ts | 2 +- apps/sim/lib/api/openapi/types.ts | 6 + .../server/routes/copilot-content-routes.json | 5 + .../server/routes/copilot-refused-routes.json | 20 + apps/sim/lib/api/server/routes/definition.ts | 50 +- .../server/routes/internal-json-route.test.ts | 104 + .../api/server/routes/internal-json-route.ts | 38 +- .../lib/api/server/routes/v2-binary-route.ts | 2 +- .../api/server/routes/v2-json-route.test.ts | 78 + .../lib/api/server/routes/v2-json-route.ts | 258 +- .../server/routes/v2-route-table.generated.ts | 33 + apps/sim/lib/billing/cleanup-dispatcher.ts | 2 +- .../core/organization-activity-queries.ts | 2 +- .../organization-activity-rollup-queries.ts | 2 +- .../billing/core/usage-analytics-queries.ts | 2 +- apps/sim/lib/billing/core/usage-analytics.ts | 2 +- apps/sim/lib/billing/cycle-close.ts | 2 +- .../lib/catalog/projection/block-detail.ts | 2 +- .../application/workflow-chat-deployment.ts | 61 +- .../cleanup/chat-backend-cleanup-outbox.ts | 4 +- .../core/config/deployment-shape.dom.test.tsx | 2 +- apps/sim/lib/core/config/env.ts | 1 + apps/sim/lib/core/config/feature-flags.ts | 5 + apps/sim/lib/core/utils/concurrency.ts | 58 - .../application/credential-keys.ts | 172 + .../application/list-workspace-credentials.ts | 115 +- .../lib/credentials/application/operations.ts | 27 + apps/sim/lib/credentials/queries.ts | 54 +- apps/sim/lib/dashboards/time.ts | 2 +- apps/sim/lib/data-drains/sources/job-logs.ts | 2 +- .../lib/data-drains/sources/workflow-logs.ts | 2 +- apps/sim/lib/embeddings/client.ts | 2 +- .../embeddings/ollama-model-catalog.server.ts | 2 +- apps/sim/lib/environment/utils.test.ts | 99 - apps/sim/lib/environment/utils.ts | 258 +- .../environment/variable-names.integration.ts | 189 + .../lib/execution/remote-sandbox/session.ts | 2 +- .../sim/lib/execution/removal-stop-records.ts | 2 +- apps/sim/lib/global-work/summary.ts | 2 +- apps/sim/lib/guardrails/mask-client.ts | 2 +- apps/sim/lib/guardrails/validate-pii.ts | 2 +- .../knowledge/application/documents.test.ts | 3 + .../lib/knowledge/application/documents.ts | 86 +- .../application/read-original-document.ts | 15 +- .../documents/processing-outbox-event.ts | 47 +- apps/sim/lib/knowledge/documents/service.ts | 190 +- apps/sim/lib/knowledge/mcp/server.ts | 2 +- apps/sim/lib/knowledge/search/candidates.ts | 2 +- .../lib/knowledge/transfer/import-runner.ts | 2 +- .../lib/logs/application/list-public-logs.ts | 3 +- .../lib/logs/execution/pii-large-values.ts | 2 +- .../lib/mcp/application/operation-access.ts | 2 +- apps/sim/lib/mcp/workflow-config.ts | 6 +- .../content-delivery.integration.ts | 34 + .../lib/mothership/agent-cli/engines/deps.ts | 2 +- .../lib/mothership/agent-cli/engines/query.ts | 2 +- .../lib/mothership/chat/application/fork.ts | 2 +- .../lib/mothership/chat/fork-chat-files.ts | 2 +- apps/sim/lib/mothership/chat/payload.test.ts | 3 + .../lib/mothership/chat/process-contents.ts | 2 +- .../mothership/chat/resource-attachments.ts | 2 +- apps/sim/lib/mothership/entitlements.ts | 14 +- .../lib/mothership/generated/docs-manifest.ts | 2 + apps/sim/lib/mothership/generated/protocol.ts | 7 +- apps/sim/lib/mothership/mcp-tools.ts | 2 +- .../mothership/tools/server/project-list.ts | 2 +- .../sim/lib/organizations/resource-cleanup.ts | 2 +- apps/sim/lib/posthog/events.ts | 83 + .../projects/files/application/artifacts.ts | 3 +- .../projects/files/application/lifecycle.ts | 4 +- apps/sim/lib/secrets/references/scan.ts | 2 +- apps/sim/lib/selectors/context.ts | 8 +- .../sim/lib/selectors/server/internal.test.ts | 4 +- apps/sim/lib/selectors/server/internal.ts | 4 +- .../selectors/server/providers/microsoft.ts | 2 +- apps/sim/lib/sim-search/live/application.ts | 7 +- .../sim/lib/sim-search/live/google-service.ts | 2 +- apps/sim/lib/sim-search/live/google.ts | 4 +- apps/sim/lib/sim-search/live/hex-mcp.ts | 2 +- apps/sim/lib/sim-search/live/lucid-mcp.ts | 2 +- apps/sim/lib/sim-search/live/zoom-mcp.ts | 2 +- apps/sim/lib/skills/application/use-cases.ts | 10 +- apps/sim/lib/skills/orchestration/index.ts | 2 + .../sim/lib/skills/orchestration/lifecycle.ts | 31 +- apps/sim/lib/table/application/columns.ts | 76 +- apps/sim/lib/table/application/errors.ts | 8 + apps/sim/lib/table/application/operations.ts | 2 + apps/sim/lib/table/application/reshape.ts | 464 + apps/sim/lib/table/application/tables.ts | 199 +- apps/sim/lib/table/backfill-runner.ts | 3 +- apps/sim/lib/table/column-conversion.test.ts | 3 +- apps/sim/lib/table/column-keys.ts | 3 +- apps/sim/lib/table/column-types/boolean.ts | 15 +- apps/sim/lib/table/column-types/currency.ts | 22 +- apps/sim/lib/table/column-types/date.ts | 48 +- apps/sim/lib/table/column-types/index.ts | 1 - apps/sim/lib/table/column-types/json.ts | 15 +- apps/sim/lib/table/column-types/number.ts | 18 +- apps/sim/lib/table/column-types/registry.ts | 5 - apps/sim/lib/table/column-types/select.ts | 54 +- apps/sim/lib/table/column-types/string.ts | 13 +- apps/sim/lib/table/column-types/ttl.test.ts | 10 +- apps/sim/lib/table/column-types/ttl.ts | 19 +- apps/sim/lib/table/column-types/types.ts | 25 +- apps/sim/lib/table/columns/service.ts | 236 +- apps/sim/lib/table/dispatcher.ts | 4 +- apps/sim/lib/table/import.ts | 9 +- apps/sim/lib/table/index.ts | 4 +- apps/sim/lib/table/orchestration/columns.ts | 38 +- apps/sim/lib/table/row-changes.ts | 9 +- apps/sim/lib/table/rows/keyed-write.ts | 185 + apps/sim/lib/table/rows/ordering.ts | 80 +- apps/sim/lib/table/rows/service.ts | 254 +- apps/sim/lib/table/rows/writes.integration.ts | 261 +- apps/sim/lib/table/select-options.ts | 88 +- apps/sim/lib/table/select-values.ts | 2 +- apps/sim/lib/table/service.ts | 55 +- apps/sim/lib/table/sql.ts | 2 +- apps/sim/lib/table/tx.ts | 10 + apps/sim/lib/table/types.ts | 12 + apps/sim/lib/table/validation.ts | 146 +- apps/sim/lib/table/workflow-columns.test.ts | 29 + apps/sim/lib/table/workflow-columns.ts | 9 +- .../contexts/workspace/file-manager.ts | 9 + .../sim/lib/uploads/server/markdown-export.ts | 3 +- apps/sim/lib/webhooks/deploy.ts | 5 +- apps/sim/lib/webhooks/slack-dispatch.test.ts | 27 + apps/sim/lib/webhooks/slack-dispatch.ts | 4 +- apps/sim/lib/workflows/api/route-policies.ts | 57 +- .../application/apply-workflow-operations.ts | 141 +- ...ply-workflow-source.catalog.integration.ts | 348 + ...workflow-source.credentials.integration.ts | 361 + ...ly-workflow-source.fidelity.integration.ts | 587 + ...-workflow-source.governance.integration.ts | 346 + .../apply-workflow-source.integration.ts | 2201 + ...pply-workflow-source.parity.integration.ts | 376 + ...ply-workflow-source.runtime.integration.ts | 272 + ...pply-workflow-source.skills.integration.ts | 346 + .../application/apply-workflow-source.ts | 760 + .../application/code-availability.ts | 34 + .../lib/workflows/application/graph-write.ts | 145 + .../lib/workflows/application/mutability.ts | 27 +- .../lib/workflows/application/operations.ts | 76 + .../read-source-catalog.integration.ts | 143 + .../application/read-source-catalog.ts | 83 + .../read-source-resources.integration.ts | 505 + .../application/read-source-resources.ts | 394 + .../application/read-workflow-graph.ts | 48 +- .../application/read-workflow-source.ts | 327 + .../application/replace-workflow-state.ts | 6 +- .../application/source-analytics.test.ts | 224 + .../workflows/application/source-analytics.ts | 182 + .../workflows/application/source-commit.ts | 409 + .../lib/workflows/application/source-diff.ts | 82 + .../lib/workflows/application/source-error.ts | 76 + .../workflows/application/source-evaluate.ts | 783 + .../application/source-locate.test.ts | 45 + .../workflows/application/source-locate.ts | 296 + apps/sim/lib/workflows/autolayout/utils.ts | 6 +- .../blocks/canvas-card-fields.test.ts | 8 +- .../workflows/blocks/canvas-card-fields.ts | 4 +- .../blocks/canvas-sentence-validation.ts | 8 +- apps/sim/lib/workflows/blocks/outputs.ts | 9 +- .../sim/lib/workflows/blocks/start-outputs.ts | 12 + .../sim/lib/workflows/canonical/block-spec.ts | 2 +- .../provider-config-round-trip.test.ts | 2 +- .../workflows/code/api-built-source.test.ts | 128 + .../lib/workflows/code/apply/gates.test.ts | 1019 + apps/sim/lib/workflows/code/apply/gates.ts | 456 + .../lib/workflows/code/apply/graph-diff.ts | 140 + .../lib/workflows/code/apply/live-triggers.ts | 124 + .../lib/workflows/code/apply/locked.test.ts | 272 + apps/sim/lib/workflows/code/apply/locked.ts | 175 + .../workflows/code/apply/schedules.test.ts | 64 + .../sim/lib/workflows/code/apply/schedules.ts | 36 + .../lib/workflows/code/catalog/build.test.ts | 328 + apps/sim/lib/workflows/code/catalog/build.ts | 247 + .../lib/workflows/code/catalog/probe.test.ts | 18 + apps/sim/lib/workflows/code/catalog/probe.ts | 70 + .../sim/lib/workflows/code/catalog/project.ts | 697 + .../catalog/registry-catalog.test-helpers.ts | 15 + .../code/catalog/registry-sources.ts | 28 + .../workflows/code/catalog/sdk-names.test.ts | 218 + .../lib/workflows/code/catalog/sdk-names.ts | 423 + .../lib/workflows/code/catalog/value-kind.ts | 120 + .../workflows/code/catalog/workspace.test.ts | 119 + .../lib/workflows/code/catalog/workspace.ts | 183 + apps/sim/lib/workflows/code/compile-source.ts | 60 + apps/sim/lib/workflows/code/corpus/blocks.ts | 170 + .../code/corpus/canvas-ops.test-helpers.ts | 590 + .../code/corpus/editing.corpus.test.ts | 969 + .../code/corpus/fixtures.test-helpers.ts | 386 + .../workflows/code/corpus/generate.test.ts | 175 + .../sim/lib/workflows/code/corpus/generate.ts | 1131 + .../code/corpus/inactive.corpus.test.ts | 131 + apps/sim/lib/workflows/code/corpus/index.ts | 8 + .../code/corpus/outputs.corpus.test.ts | 123 + .../code/corpus/proof/arbitraries.ts | 364 + .../lib/workflows/code/corpus/proof/diff.ts | 128 + .../lib/workflows/code/corpus/proof/index.ts | 17 + .../workflows/code/corpus/proof/oracles.ts | 354 + .../lib/workflows/code/corpus/proof/report.ts | 128 + apps/sim/lib/workflows/code/corpus/random.ts | 48 + .../code/corpus/roundtrip.corpus.test.ts | 398 + .../code/corpus/secrets.corpus.test.ts | 108 + .../corpus/source-harness.test-helpers.ts | 124 + .../code/corpus/typecheck.corpus.test.ts | 120 + apps/sim/lib/workflows/code/corpus/values.ts | 301 + .../lib/workflows/code/credential-nodes.ts | 116 + .../lib/workflows/code/default-parity.test.ts | 142 + .../code/feature-flag.integration.ts | 187 + apps/sim/lib/workflows/code/feature-flag.ts | 57 + .../code/golden-cases.test-helpers.ts | 1094 + apps/sim/lib/workflows/code/goldens.test.ts | 256 + .../lib/workflows/code/hand-written.test.ts | 283 + .../workflows/code/json-field-refs.test.ts | 111 + .../workflows/code/materialize-hooks.test.ts | 72 + .../lib/workflows/code/materialize-hooks.ts | 39 + apps/sim/lib/workflows/code/print-stored.ts | 153 + .../lib/workflows/code/real-catalog.test.ts | 537 + apps/sim/lib/workflows/code/ref-paths.test.ts | 58 + apps/sim/lib/workflows/code/resources.ts | 257 + .../lib/workflows/code/scale-budget.test.ts | 229 + .../lib/workflows/code/sdk-examples.test.ts | 135 + .../code/sdk-typecheck.test-helpers.ts | 55 + .../workflows/code/seeded-defaults.test.ts | 204 + .../lib/workflows/code/source-lock.test.ts | 239 + apps/sim/lib/workflows/code/source-lock.ts | 196 + .../workflows/code/source-mistakes.test.ts | 149 + .../workflows/code/stored-canonical.test.ts | 290 + .../lib/workflows/code/stored-canonical.ts | 152 + .../comparison/format-description.test.ts | 5 - .../sim/lib/workflows/comparison/normalize.ts | 5 +- .../lib/workflows/credentials/extractor.ts | 5 +- .../lib/workflows/custom-blocks/operations.ts | 2 +- apps/sim/lib/workflows/deployment-status.ts | 101 +- .../lib/workflows/editing/builders.test.ts | 44 + apps/sim/lib/workflows/editing/builders.ts | 359 +- apps/sim/lib/workflows/editing/engine.ts | 16 +- apps/sim/lib/workflows/editing/gates.ts | 452 + .../lib/workflows/editing/lint-report.test.ts | 63 + apps/sim/lib/workflows/editing/lint-report.ts | 17 +- apps/sim/lib/workflows/editing/lint.ts | 100 +- .../lib/workflows/editing/operations.test.ts | 375 + apps/sim/lib/workflows/editing/operations.ts | 298 +- apps/sim/lib/workflows/editing/types.ts | 6 + .../lib/workflows/editing/validation.test.ts | 27 + apps/sim/lib/workflows/editing/validation.ts | 34 +- .../workflows/executor/execution-run-files.ts | 2 +- .../migrations/subblock-migrations.ts | 12 +- .../create-workflow-with-state.integration.ts | 2 + apps/sim/lib/workflows/orchestration/index.ts | 2 + .../orchestration/workflow-lifecycle.test.ts | 1 + .../orchestration/workflow-lifecycle.ts | 58 +- .../lib/workflows/persistence/duplicate.ts | 23 +- .../persistence/prepare-state.test.ts | 28 + .../persistence/remap-internal-ids.ts | 9 +- .../replace-normalized-state.test.ts | 21 + .../persistence/replace-normalized-state.ts | 67 +- .../persistence/source-meta.integration.ts | 368 + apps/sim/lib/workflows/persistence/utils.ts | 145 +- apps/sim/lib/workflows/queries.ts | 37 +- .../workflows/references/binding-targets.ts | 2 +- .../references/dependent-reconfigs.ts | 16 +- .../references/finalize-tool-positions.ts | 2 +- .../references/import-configuration.ts | 8 +- .../lib/workflows/references/import-plan.ts | 2 +- apps/sim/lib/workflows/references/manifest.ts | 2 +- .../workflows/references/remap-references.ts | 30 +- apps/sim/lib/workflows/references/scan.ts | 2 +- apps/sim/lib/workflows/references/types.ts | 19 +- .../sanitization/json-sanitizer.test.ts | 36 + .../workflows/sanitization/json-sanitizer.ts | 29 +- .../lib/workflows/sanitization/validation.ts | 2 + .../workflows/schedules/validation.test.ts | 16 + .../sim/lib/workflows/schedules/validation.ts | 27 + .../lib/workflows/search-replace/indexer.ts | 10 +- .../lib/workflows/subblocks/context.test.ts | 3 +- apps/sim/lib/workflows/subblocks/context.ts | 6 +- .../lib/workflows/subblocks/dependencies.ts | 2 +- .../workflows/subblocks/visibility.test.ts | 10 +- .../sim/lib/workflows/subblocks/visibility.ts | 263 +- .../lib/workflows/tool-input/hidden-params.ts | 2 +- .../workflows/tool-input/param-visibility.ts | 2 +- .../lib/workflows/tool-input/usage-control.ts | 5 +- .../triggers/input-definition-triggers.ts | 13 +- .../application/create-workspace-file.ts | 4 + .../export-workspace-file-snapshot.ts | 3 +- .../application/list-workspace-files.ts | 68 + .../write-workspace-file-by-path.ts | 8 +- .../api/route-policies.test.ts | 63 + .../workspace-source/api/route-policies.ts | 131 + .../application/analytics.test.ts | 111 + .../workspace-source/application/analytics.ts | 59 + .../application/apply-workspace-source.ts | 370 + .../application/apply.integration.ts | 2270 + .../workspace-source/application/context.ts | 41 + .../application/cross-kind.integration.ts | 1434 + .../application/deployments.integration.ts | 1063 + .../application/errors.test.ts | 42 + .../workspace-source/application/errors.ts | 137 + .../application/files.integration.ts | 1061 + .../workspace-source/application/findings.ts | 434 + .../application/hash-budget.ts | 49 + .../workspace-source/application/in-use.ts | 234 + .../lib/workspace-source/application/keys.ts | 125 + .../application/kinds/credentials/adapter.ts | 385 + .../application/kinds/deployment/adapter.ts | 895 + .../application/kinds/deployment/stored.ts | 212 + .../application/kinds/deployment/triggers.ts | 44 + .../application/kinds/files/adapter.ts | 690 + .../application/kinds/knowledge/adapter.ts | 840 + .../application/kinds/knowledge/diff.ts | 360 + .../application/kinds/knowledge/stored.ts | 423 + .../application/kinds/mcp/adapter.ts | 653 + .../application/kinds/mcp/stored.ts | 189 + .../application/kinds/named.ts | 272 + .../application/kinds/secrets/adapter.ts | 236 + .../application/kinds/skills/adapter.ts | 161 + .../application/kinds/table/adapter.ts | 840 + .../application/kinds/table/codec.test.ts | 51 + .../application/kinds/table/codec.ts | 39 + .../application/kinds/table/diff.ts | 467 + .../application/kinds/table/rows.ts | 117 + .../application/kinds/table/stored.test.ts | 49 + .../application/kinds/table/stored.ts | 165 + .../application/kinds/tools/adapter.ts | 286 + .../application/kinds/workflow/adapter.ts | 927 + .../application/knowledge.integration.ts | 1629 + .../application/lease.integration.ts | 293 + .../application/mcp.integration.ts | 773 + .../application/mirrors.test.ts | 53 + .../application/operations.ts | 53 + .../lib/workspace-source/application/plan.ts | 556 + .../application/promote.integration.ts | 238 + .../application/read-workspace-source.ts | 204 + .../application/references.integration.ts | 797 + .../workspace-source/application/registry.ts | 31 + .../application/rows.integration.ts | 890 + .../application/stage-blobs.ts | 163 + .../application/staging.integration.ts | 305 + .../application/status.integration.ts | 313 + .../workspace-source/application/three-way.ts | 182 + .../application/tools-skills.integration.ts | 942 + .../lib/workspace-source/application/types.ts | 303 + .../workspace-source.test-helpers.ts | 245 + apps/sim/lib/workspace-source/lease/store.ts | 144 + .../sim/lib/workspace-source/staging/store.ts | 286 + .../list-organization-workspaces.ts | 2 +- .../application/list-public-workspaces.ts | 2 +- apps/sim/lib/workspaces/lifecycle.ts | 2 +- .../workspaces/resource-keys.integration.ts | 420 + apps/sim/lib/workspaces/resource-keys.test.ts | 45 + apps/sim/lib/workspaces/resource-keys.ts | 614 + apps/sim/package.json | 9 + apps/sim/providers/utils.ts | 20 +- apps/sim/scripts/canvas-sentence-spec.ts | 2 +- .../scripts/dump-change-detection-states.ts | 2 +- .../scripts/export-redacted-workflows.test.ts | 122 + apps/sim/scripts/export-redacted-workflows.ts | 428 + apps/sim/scripts/generate-sdk-names.ts | 146 + apps/sim/scripts/saved-credential-contract.ts | 2 +- apps/sim/scripts/test-landing-seo-e2e.ts | 2 +- apps/sim/scripts/test-workflow-code-ui-e2e.ts | 488 + .../scripts/test-workflow-source-apply-e2e.ts | 551 + apps/sim/scripts/test-workflow-source-e2e.ts | 393 + apps/sim/scripts/test-workspace-source-e2e.ts | 401 + apps/sim/scripts/validate-fal-image-models.ts | 2 +- apps/sim/scripts/validate-fal-video-models.ts | 2 +- .../scripts/validate-runway-video-models.ts | 2 +- apps/sim/serializer/index.ts | 26 +- .../serializer/viewer-scoped-defaults.test.ts | 24 + apps/sim/stores/panel/types.ts | 2 +- apps/sim/tools/generated/tool-outputs.ts | 2 +- apps/sim/tools/params.ts | 15 +- apps/sim/tools/table/query_rows_v2.ts | 1 + apps/sim/tools/twilio_voice/list_calls.ts | 2 +- apps/sim/triggers/constants.ts | 15 - apps/sim/triggers/webhook-url.ts | 6 +- apps/sim/turbo.json | 13 +- .../types/monaco-typescript-definition.d.ts | 11 + biome.json | 5 + bun.lock | 114 +- docker/crontab | 3 + helm/sim/Chart.yaml | 2 +- helm/sim/values.yaml | 10 + knip.jsonc | 21 + package.json | 4 + packages/audit/src/index.ts | 2 +- packages/audit/src/log.ts | 26 +- packages/audit/src/rollup.ts | 24 +- packages/audit/src/types.ts | 2 + .../db/migrations/0466_workspace_source.sql | 49 + .../db/migrations/meta/0466_snapshot.json | 34311 +++++++++++++++ packages/db/migrations/meta/_journal.json | 7 + packages/db/schema.ts | 137 + .../db/scripts/apply-dev-table-triggers.ts | 62 +- packages/db/scripts/push.ts | 1 + packages/sim-cli/README.md | 39 + packages/sim-cli/THIRD_PARTY_LICENSES | 31 + packages/sim-cli/package.json | 4 + .../scripts/print-command-inventory.ts | 50 +- packages/sim-cli/src/auth/refresh.test.ts | 31 + packages/sim-cli/src/auth/refresh.ts | 9 +- .../sim-cli/src/commands/protocol/index.ts | 32 +- .../sim-cli/src/commands/protocol/result.ts | 12 +- .../src/commands/protocol/source-dir.test.ts | 208 + .../src/commands/protocol/source-dir.ts | 926 + .../src/commands/protocol/source-status.ts | 432 + .../src/commands/protocol/source-tree.ts | 577 + .../src/commands/protocol/source-ui.ts | 243 + .../protocol/workflow-source-apply.test.ts | 768 + .../protocol/workflow-source-apply.ts | 419 + .../protocol/workflow-source-check.test.ts | 489 + .../protocol/workflow-source-check.ts | 577 + .../protocol/workflow-source-get.test.ts | 303 + .../commands/protocol/workflow-source-get.ts | 360 + .../workflow-source-roundtrip.test.ts | 855 + .../protocol/workflow-source-status.test.ts | 395 + .../protocol/workflow-source-status.ts | 301 + .../protocol/workspace-source-apply.test.ts | 1068 + .../protocol/workspace-source-apply.ts | 610 + .../protocol/workspace-source-blobs.ts | 526 + .../protocol/workspace-source-check.test.ts | 489 + .../protocol/workspace-source-check.ts | 157 + .../commands/protocol/workspace-source-dir.ts | 639 + .../protocol/workspace-source-get.test.ts | 899 + .../commands/protocol/workspace-source-get.ts | 409 + .../protocol/workspace-source-status.test.ts | 696 + .../protocol/workspace-source-status.ts | 608 + packages/sim-cli/src/contract/commands.ts | 29 + .../sim-cli/src/contract/reference.test.ts | 27 + packages/sim-cli/src/exit-codes.ts | 68 + packages/sim-cli/src/generated/v2-api.ts | 2803 ++ packages/sim-cli/src/http/client.test.ts | 180 +- packages/sim-cli/src/http/client.ts | 111 +- packages/sim-cli/src/program.ts | 1 + packages/sim-cli/src/runtime/build.test.ts | 7 +- packages/sim-cli/src/terminal.test.ts | 54 +- packages/sim-cli/src/test/context-mock.ts | 11 +- .../src/test/workspace-source-command.ts | 31 + packages/testing/src/mocks/audit.mock.ts | 2 + .../src/mocks/environment-utils.mock.ts | 8 +- .../src/mocks/schema-tables.generated.ts | 38 + packages/utils/package.json | 8 + packages/utils/src/concurrency.test.ts | 120 + packages/utils/src/concurrency.ts | 82 + .../utils/src}/timezone.test.ts | 4 +- .../utils => packages/utils/src}/timezone.ts | 0 .../utils/src/workflow-references.test.ts | 66 + packages/utils/src/workflow-references.ts | 16 +- packages/workflow-code/DESIGN.md | 609 + packages/workflow-code/package.json | 93 + packages/workflow-code/src/agent-tools.ts | 172 + packages/workflow-code/src/anchors.test.ts | 78 + packages/workflow-code/src/anchors.ts | 111 + packages/workflow-code/src/babel.ts | 77 + .../src/canonicalize/branches.ts | 256 + .../workflow-code/src/canonicalize/context.ts | 26 + .../workflow-code/src/canonicalize/edges.ts | 105 + .../src/canonicalize/hostile.test.ts | 267 + .../src/canonicalize/index.test.ts | 1605 + .../workflow-code/src/canonicalize/index.ts | 307 + .../workflow-code/src/canonicalize/keys.ts | 106 + .../workflow-code/src/canonicalize/modes.ts | 95 + .../workflow-code/src/canonicalize/params.ts | 219 + .../src/canonicalize/subflows.ts | 196 + .../workflow-code/src/canonicalize/tools.ts | 167 + .../workflow-code/src/canonicalize/values.ts | 152 + .../workflow-code/src/catalog/activity.ts | 283 + .../src/catalog/canonical-index/index.ts | 236 + .../workflow-code/src/catalog/compact.test.ts | 167 + packages/workflow-code/src/catalog/compact.ts | 399 + .../workflow-code/src/catalog/conditions.ts | 97 + .../workflow-code/src/catalog/defaults.ts | 69 + .../workflow-code/src/catalog/scaling.test.ts | 38 + packages/workflow-code/src/catalog/surface.ts | 443 + packages/workflow-code/src/catalog/types.ts | 450 + packages/workflow-code/src/catalog/view.ts | 294 + .../src/code-files/bijection.test.ts | 264 + .../workflow-code/src/code-files/bijection.ts | 30 + .../workflow-code/src/code-files/from-file.ts | 203 + .../workflow-code/src/code-files/index.ts | 5 + .../workflow-code/src/code-files/lexer.ts | 237 + .../workflow-code/src/code-files/ref-path.ts | 117 + .../src/code-files/references.ts | 61 + .../workflow-code/src/code-files/to-file.ts | 63 + packages/workflow-code/src/compile/SYNTAX.md | 518 + packages/workflow-code/src/compile/blocks.ts | 1839 + .../src/compile/catalog.test-helpers.ts | 295 + .../workflow-code/src/compile/characters.ts | 186 + .../workflow-code/src/compile/checks.test.ts | 605 + .../workflow-code/src/compile/comments.ts | 172 + packages/workflow-code/src/compile/context.ts | 317 + packages/workflow-code/src/compile/edges.ts | 665 + .../src/compile/ergonomics.test.ts | 653 + .../workflow-code/src/compile/grammar.test.ts | 1591 + packages/workflow-code/src/compile/hints.ts | 269 + .../workflow-code/src/compile/hostile.test.ts | 478 + packages/workflow-code/src/compile/index.ts | 671 + packages/workflow-code/src/compile/parse.ts | 218 + packages/workflow-code/src/compile/report.ts | 202 + .../workflow-code/src/compile/scaling.test.ts | 17 + packages/workflow-code/src/compile/scope.ts | 551 + packages/workflow-code/src/compile/tools.ts | 951 + .../src/compile/validate-catalog.ts | 99 + packages/workflow-code/src/compile/values.ts | 1246 + .../workflow-code/src/diagnostics/codes.ts | 507 + .../src/diagnostics/frame.test.ts | 107 + .../workflow-code/src/diagnostics/frame.ts | 130 + packages/workflow-code/src/diff/index.test.ts | 172 + packages/workflow-code/src/diff/index.ts | 208 + .../src/equivalence/executable.ts | 155 + .../src/equivalence/index.test.ts | 170 + .../workflow-code/src/equivalence/index.ts | 65 + .../src/equivalence/pinned.test.ts | 102 + packages/workflow-code/src/forms/condition.ts | 47 + packages/workflow-code/src/forms/response.ts | 155 + packages/workflow-code/src/forms/subflow.ts | 158 + packages/workflow-code/src/hash.test.ts | 46 + packages/workflow-code/src/hash.ts | 70 + packages/workflow-code/src/index.ts | 122 + .../workflow-code/src/json-fields.test.ts | 144 + packages/workflow-code/src/json-fields.ts | 411 + packages/workflow-code/src/layout.ts | 27 + packages/workflow-code/src/limits.test.ts | 20 + packages/workflow-code/src/limits.ts | 114 + packages/workflow-code/src/lock.test.ts | 243 + packages/workflow-code/src/lock.ts | 656 + .../workflow-code/src/materialize/block.ts | 319 + .../workflow-code/src/materialize/branches.ts | 49 + .../workflow-code/src/materialize/context.ts | 25 + .../workflow-code/src/materialize/edges.ts | 153 + .../src/materialize/fixtures.test-helpers.ts | 319 + .../workflow-code/src/materialize/identity.ts | 416 + .../src/materialize/index.test.ts | 1149 + .../workflow-code/src/materialize/index.ts | 391 + .../workflow-code/src/materialize/modes.ts | 69 + .../workflow-code/src/materialize/params.ts | 163 + .../workflow-code/src/materialize/preserve.ts | 251 + .../src/materialize/quirks.test-helpers.ts | 341 + .../workflow-code/src/materialize/subflows.ts | 172 + .../workflow-code/src/materialize/values.ts | 200 + packages/workflow-code/src/model.ts | 490 + .../src/print/__golden__/agent-tools.txt | 57 + .../src/print/__golden__/block-meta.txt | 22 + .../__golden__/branch-titles-and-extra.txt | 17 + .../print/__golden__/branches-null-rows.txt | 13 + .../print/__golden__/comments-at-anchors.txt | 32 + .../src/print/__golden__/diagnostics.json | 57 + .../src/print/__golden__/fan-out-wrapping.txt | 25 + .../src/print/__golden__/function-files.txt | 13 + .../print/__golden__/function-languages.txt | 22 + .../generic-block-legacy-operation.txt | 10 + .../__golden__/generic-block-unknown-type.txt | 12 + .../__golden__/identifier-collisions.txt | 16 + .../src/print/__golden__/inactive-values.txt | 9 + .../print/__golden__/input-format-sugar.txt | 18 + .../src/print/__golden__/json-code-fields.txt | 27 + .../src/print/__golden__/layout-widths.txt | 27 + .../__golden__/legacy-dropdown-and-todo.txt | 8 + .../src/print/__golden__/lock-order.txt | 11 + .../src/print/__golden__/loop-foreach.txt | 23 + .../src/print/__golden__/minimal-trigger.txt | 6 + .../src/print/__golden__/nested-subflows.txt | 34 + .../src/print/__golden__/note-markdown.txt | 10 + .../src/print/__golden__/pair-modes.txt | 43 + .../src/print/__golden__/parallel-untyped.txt | 13 + .../print/__golden__/raw-and-odd-edges.txt | 14 + .../__golden__/ref-cycle-literalized.txt | 21 + .../src/print/__golden__/resource-nodes.txt | 34 + .../src/print/__golden__/response-body.txt | 17 + .../src/print/__golden__/router-routes.txt | 17 + .../src/print/__golden__/stored-secrets.txt | 10 + .../src/print/__golden__/string-escapes.txt | 19 + .../src/print/__golden__/support-triage.txt | 70 + .../print/__golden__/templates-and-paths.txt | 29 + .../__golden__/trigger-mode-builders.txt | 24 + .../print/__golden__/unresolved-tokens.txt | 17 + .../src/print/__golden__/vars-by-field.txt | 24 + packages/workflow-code/src/print/comments.ts | 132 + packages/workflow-code/src/print/context.ts | 141 + .../workflow-code/src/print/depth.test.ts | 109 + packages/workflow-code/src/print/doc.ts | 414 + packages/workflow-code/src/print/edges.ts | 241 + packages/workflow-code/src/print/idents.ts | 59 + packages/workflow-code/src/print/index.ts | 2 + packages/workflow-code/src/print/order.ts | 73 + packages/workflow-code/src/print/params.ts | 456 + packages/workflow-code/src/print/printer.ts | 406 + packages/workflow-code/src/print/refs.ts | 131 + .../src/print/round-trip.test.ts | 110 + .../workflow-code/src/print/scaling.test.ts | 75 + packages/workflow-code/src/print/scope.ts | 175 + packages/workflow-code/src/print/strings.ts | 136 + packages/workflow-code/src/print/syntax.ts | 233 + packages/workflow-code/src/print/tools.ts | 354 + packages/workflow-code/src/print/values.ts | 218 + packages/workflow-code/src/records.ts | 92 + .../workflow-code/src/scaling.test-helpers.ts | 49 + packages/workflow-code/src/sdk.ts | 250 + packages/workflow-code/src/secrets.ts | 227 + .../workflow-code/src/source-meta.test.ts | 296 + packages/workflow-code/src/source-meta.ts | 342 + packages/workflow-code/src/start-inputs.ts | 41 + .../workflow-code/src/structured/codec.ts | 87 + .../workflow-code/src/structured/index.ts | 52 + .../src/structured/input-format.ts | 278 + .../workflow-code/src/structured/skills.ts | 99 + .../src/structured/table-rows.ts | 76 + .../workflow-code/src/structured/variables.ts | 63 + packages/workflow-code/tsconfig.json | 8 + packages/workflow-code/vitest.config.ts | 11 + packages/workflow-persistence/package.json | 5 + .../workflow-persistence/src/load.test.ts | 1 + packages/workflow-persistence/src/load.ts | 330 +- packages/workflow-persistence/src/save.ts | 4 + .../workflow-persistence/src/source-meta.ts | 125 + packages/workflow-sdk/README.md | 163 + .../workflow-sdk/cookbook/examples/agents.ts | 90 + .../cookbook/examples/cookbook.ts | 149 + .../cookbook/examples/integrations.ts | 89 + .../cookbook/workspace/credentials.ts | 12 + .../cookbook/workspace/deployments/support.ts | 16 + .../workspace/files/templates/reply.md | 3 + .../knowledge/policies/docs/refunds.md | 3 + .../workspace/knowledge/policies/knowledge.ts | 10 + .../cookbook/workspace/mcp/docs.ts | 14 + .../cookbook/workspace/secrets.ts | 11 + .../cookbook/workspace/skills/tone.md | 5 + .../cookbook/workspace/tables/orders.ts | 14 + .../workspace/tables/plans.rows.jsonl | 2 + .../cookbook/workspace/tables/plans.ts | 17 + .../cookbook/workspace/tools/lookup-order.js | 6 + .../cookbook/workspace/tools/lookup-order.ts | 21 + .../workspace/workflows/support/workflow.ts | 43 + packages/workflow-sdk/package.json | 47 + .../scripts/generate-embedded-text.ts | 81 + .../scripts/typecheck-fixtures.ts | 32 + .../src/codegen/cookbook-text.generated.ts | 4 + .../src/codegen/cookbook-text.test.ts | 14 + .../src/codegen/core-text.generated.ts | 4 + .../src/codegen/core-text.test.ts | 11 + .../src/codegen/embedded-files.ts | 29 + packages/workflow-sdk/src/codegen/emit.ts | 50 + .../workflow-sdk/src/codegen/generate.test.ts | 170 + packages/workflow-sdk/src/codegen/generate.ts | 722 + packages/workflow-sdk/src/codegen/index.ts | 27 + packages/workflow-sdk/src/codegen/layout.ts | 110 + packages/workflow-sdk/src/codegen/major.ts | 6 + .../workflow-sdk/src/codegen/map-subblock.ts | 197 + packages/workflow-sdk/src/codegen/names.ts | 86 + packages/workflow-sdk/src/codegen/outputs.ts | 175 + .../workflow-sdk/src/codegen/semantics.ts | 32 + packages/workflow-sdk/src/codegen/tsconfig.ts | 27 + .../src/codegen/visibility.test.ts | 199 + .../workflow-sdk/src/codegen/visibility.ts | 360 + .../workspace-cookbook-text.generated.ts | 4 + .../codegen/workspace-declarations.test.ts | 152 + .../src/codegen/workspace-text.generated.ts | 25 + .../src/codegen/workspace-text.test.ts | 44 + .../workflow-sdk/src/codegen/workspace.ts | 278 + packages/workflow-sdk/src/core.d.ts | 987 + packages/workflow-sdk/src/core.test.ts | 102 + packages/workflow-sdk/src/not-executable.ts | 38 + .../workflow-sdk/src/resource-kinds.test.ts | 21 + packages/workflow-sdk/src/runtime.test.ts | 70 + packages/workflow-sdk/src/runtime.ts | 50 + .../src/workspace/credentials.d.ts | 44 + .../src/workspace/deployment.d.ts | 80 + packages/workflow-sdk/src/workspace/file.d.ts | 10 + .../workflow-sdk/src/workspace/index.d.ts | 14 + .../workflow-sdk/src/workspace/knowledge.d.ts | 59 + packages/workflow-sdk/src/workspace/mcp.d.ts | 58 + .../src/workspace/runtime.test.ts | 40 + .../workflow-sdk/src/workspace/runtime.ts | 23 + .../workflow-sdk/src/workspace/secrets.d.ts | 34 + .../workflow-sdk/src/workspace/skill.d.ts | 19 + .../workflow-sdk/src/workspace/table.d.ts | 145 + packages/workflow-sdk/src/workspace/tool.d.ts | 67 + .../workflow-sdk/src/workspace/tool.test.ts | 35 + .../workflow-sdk/test/core/every-builder.ts | 148 + .../test/examples/approval-flow.ts | 47 + .../test/examples/lead-enrichment.ts | 57 + .../workflow-sdk/test/examples/rag-doc-qa.ts | 20 + .../test/examples/scheduled-report.ts | 38 + .../test/examples/support-triage.ts | 71 + .../workflow-sdk/test/fixtures/catalog.json | 35347 ++++++++++++++++ .../workflow-sdk/test/fixtures/workspace.ts | 28 + .../workflow-sdk/test/negative/rejected.ts | 272 + .../workflow-sdk/test/negative/workspace.ts | 41 + .../workflow-sdk/test/typecheck-project.ts | 123 + packages/workflow-sdk/tsconfig.json | 8 + packages/workflow-sdk/vitest.config.ts | 11 + packages/workflow-types/package.json | 4 + packages/workflow-types/src/blocks.ts | 36 + packages/workflow-types/src/resources.ts | 23 + packages/workflow-types/src/workflow.ts | 71 +- packages/workspace-code/DESIGN.md | 371 + packages/workspace-code/package.json | 74 + packages/workspace-code/src/base.test.ts | 98 + packages/workspace-code/src/base.ts | 311 + .../src/declaration/field-table.ts | 147 + .../workspace-code/src/declaration/fields.ts | 212 + .../src/declaration/hostile.test.ts | 102 + .../workspace-code/src/declaration/print.ts | 124 + .../src/declaration/read.test.ts | 111 + .../workspace-code/src/declaration/read.ts | 507 + .../workspace-code/src/diagnostics/codes.ts | 324 + .../workspace-code/src/diagnostics/finding.ts | 156 + .../workspace-code/src/diagnostics/index.ts | 18 + .../workspace-code/src/fingerprint.test.ts | 136 + packages/workspace-code/src/fingerprint.ts | 14 + packages/workspace-code/src/index.ts | 33 + packages/workspace-code/src/kind.ts | 162 + .../src/kinds/canonical.test.ts | 300 + .../src/kinds/credentials.test.ts | 56 + .../workspace-code/src/kinds/credentials.ts | 71 + .../src/kinds/deployment.test.ts | 171 + .../workspace-code/src/kinds/deployment.ts | 340 + packages/workspace-code/src/kinds/entries.ts | 130 + .../workspace-code/src/kinds/files.test.ts | 177 + packages/workspace-code/src/kinds/files.ts | 262 + packages/workspace-code/src/kinds/group.ts | 74 + .../src/kinds/knowledge.test.ts | 278 + .../workspace-code/src/kinds/knowledge.ts | 435 + .../src/kinds/literal-secrets.test.ts | 45 + packages/workspace-code/src/kinds/mcp.test.ts | 184 + packages/workspace-code/src/kinds/mcp.ts | 367 + .../workspace-code/src/kinds/registry.test.ts | 11 + packages/workspace-code/src/kinds/registry.ts | 73 + .../workspace-code/src/kinds/secrets.test.ts | 53 + packages/workspace-code/src/kinds/secrets.ts | 78 + .../workspace-code/src/kinds/skills.test.ts | 120 + packages/workspace-code/src/kinds/skills.ts | 253 + .../src/kinds/suspicious-names.test.ts | 90 + .../workspace-code/src/kinds/table-rows.ts | 212 + .../src/kinds/table.test-helpers.ts | 22 + .../workspace-code/src/kinds/table.test.ts | 405 + packages/workspace-code/src/kinds/table.ts | 635 + .../workspace-code/src/kinds/tools.test.ts | 217 + packages/workspace-code/src/kinds/tools.ts | 323 + .../workspace-code/src/kinds/workflow.test.ts | 49 + packages/workspace-code/src/kinds/workflow.ts | 115 + packages/workspace-code/src/layout.ts | 102 + packages/workspace-code/src/limits.ts | 90 + packages/workspace-code/src/promote.ts | 102 + packages/workspace-code/src/specs.ts | 132 + packages/workspace-code/src/status.test.ts | 21 + packages/workspace-code/src/status.ts | 198 + .../src/table-cells}/currency.test.ts | 6 +- .../src/table-cells}/currency.ts | 2 +- .../src/table-cells}/dates.test.ts | 2 +- .../workspace-code/src/table-cells}/dates.ts | 11 +- .../workspace-code/src/table-cells/rows.ts | 168 + .../workspace-code/src/table-cells/rules.ts | 246 + .../workspace-code/src/table-cells/select.ts | 79 + .../workspace-code/src/table-cells/ttl.ts | 0 .../workspace-code/src/table-cells/types.ts | 39 + packages/workspace-code/tsconfig.json | 8 + packages/workspace-code/vitest.config.ts | 11 + scripts/check-api-validation-contracts.ts | 7 +- scripts/check-explicit-any.baseline.json | 9 +- scripts/check-monorepo-boundaries.test.ts | 78 + scripts/check-monorepo-boundaries.ts | 126 +- scripts/check-openapi-specs.ts | 13 +- scripts/check-sdk-names-frozen.test.ts | 84 + scripts/check-sdk-names-frozen.ts | 188 + .../check-source-conventions.baseline.json | 3 +- scripts/check-unused-exports.baseline.json | 15 +- scripts/check-workflow-code-golden.ts | 59 + scripts/ci-changes.test.ts | 3 + scripts/generate-cli-docs.ts | 6 + scripts/openapi/documents.test.ts | 11 + scripts/openapi/generator.test.ts | 39 + scripts/openapi/generator.ts | 17 +- scripts/run-audits.ts | 1 + 1463 files changed, 232133 insertions(+), 6011 deletions(-) create mode 100644 .claude/rules/sim-workflow-code.md create mode 100644 .cursor/rules/sim-workflow-code.mdc create mode 100644 apps/docs/content/docs/workflows/code.mdx create mode 100644 apps/docs/content/docs/workflows/workspace-code.mdx create mode 100644 apps/realtime/src/database/source-meta-prune.integration.ts create mode 100644 apps/sim/app/api/cron/cleanup-source-staging/route.ts create mode 100644 apps/sim/app/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]/content/route.test.ts create mode 100644 apps/sim/app/api/v2/knowledge/[knowledgeBaseId]/documents/[documentId]/content/route.ts create mode 100644 apps/sim/app/api/v2/workflows/[workflowId]/source/feature-flag.test.ts create mode 100644 apps/sim/app/api/v2/workflows/[workflowId]/source/route.test.ts create mode 100644 apps/sim/app/api/v2/workflows/[workflowId]/source/route.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/source/blobs/missing/route.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/source/blobs/route.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/source/route.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/catalog/route.test.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/catalog/route.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/resources/route.test.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/resources/route.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/route.test.ts create mode 100644 apps/sim/app/api/v2/workspaces/[workspaceId]/workflows/source/route.ts create mode 100644 apps/sim/app/api/workflows/[id]/source/route.ts create mode 100644 apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/monaco-editor.tsx create mode 100644 apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/code.test.tsx create mode 100644 apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/code.tsx create mode 100644 apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/index.ts create mode 100644 apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/source-language.ts create mode 100644 apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/text-edit.test.ts create mode 100644 apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/panel/components/code/text-edit.ts create mode 100644 apps/sim/blocks/blocks/posthog.test.ts create mode 100644 apps/sim/blocks/blocks/tts.test.ts create mode 100644 apps/sim/blocks/sdk-names.generated.ts create mode 100644 apps/sim/blocks/sdk-names/a2a.json create mode 100644 apps/sim/blocks/sdk-names/affinity.json create mode 100644 apps/sim/blocks/sdk-names/affinity_v2.json create mode 100644 apps/sim/blocks/sdk-names/agent.json create mode 100644 apps/sim/blocks/sdk-names/agentmail.json create mode 100644 apps/sim/blocks/sdk-names/agentmail_v2.json create mode 100644 apps/sim/blocks/sdk-names/agentphone.json create mode 100644 apps/sim/blocks/sdk-names/agentphone_v2.json create mode 100644 apps/sim/blocks/sdk-names/agiloft.json create mode 100644 apps/sim/blocks/sdk-names/ahrefs.json create mode 100644 apps/sim/blocks/sdk-names/ahrefs_v2.json create mode 100644 apps/sim/blocks/sdk-names/airtable.json create mode 100644 apps/sim/blocks/sdk-names/algolia.json create mode 100644 apps/sim/blocks/sdk-names/algolia_v2.json create mode 100644 apps/sim/blocks/sdk-names/amplitude.json create mode 100644 apps/sim/blocks/sdk-names/amplitude_v2.json create mode 100644 apps/sim/blocks/sdk-names/api.json create mode 100644 apps/sim/blocks/sdk-names/api_trigger.json create mode 100644 apps/sim/blocks/sdk-names/apify.json create mode 100644 apps/sim/blocks/sdk-names/apify_v2.json create mode 100644 apps/sim/blocks/sdk-names/apollo.json create mode 100644 apps/sim/blocks/sdk-names/apollo_v2.json create mode 100644 apps/sim/blocks/sdk-names/appconfig.json create mode 100644 apps/sim/blocks/sdk-names/appconfig_v2.json create mode 100644 apps/sim/blocks/sdk-names/arxiv.json create mode 100644 apps/sim/blocks/sdk-names/asana.json create mode 100644 apps/sim/blocks/sdk-names/ashby.json create mode 100644 apps/sim/blocks/sdk-names/ashby_v2.json create mode 100644 apps/sim/blocks/sdk-names/athena.json create mode 100644 apps/sim/blocks/sdk-names/athena_v2.json create mode 100644 apps/sim/blocks/sdk-names/attio.json create mode 100644 apps/sim/blocks/sdk-names/azure_data_explorer.json create mode 100644 apps/sim/blocks/sdk-names/azure_data_explorer_v2.json create mode 100644 apps/sim/blocks/sdk-names/azure_devops.json create mode 100644 apps/sim/blocks/sdk-names/azure_devops_v2.json create mode 100644 apps/sim/blocks/sdk-names/bitbucket.json create mode 100644 apps/sim/blocks/sdk-names/box.json create mode 100644 apps/sim/blocks/sdk-names/box_v2.json create mode 100644 apps/sim/blocks/sdk-names/brandfetch.json create mode 100644 apps/sim/blocks/sdk-names/brex.json create mode 100644 apps/sim/blocks/sdk-names/brex_v2.json create mode 100644 apps/sim/blocks/sdk-names/brightdata.json create mode 100644 apps/sim/blocks/sdk-names/brightdata_v2.json create mode 100644 apps/sim/blocks/sdk-names/browser_use.json create mode 100644 apps/sim/blocks/sdk-names/browser_use_v2.json create mode 100644 apps/sim/blocks/sdk-names/buffer.json create mode 100644 apps/sim/blocks/sdk-names/buffer_v2.json create mode 100644 apps/sim/blocks/sdk-names/calcom.json create mode 100644 apps/sim/blocks/sdk-names/calendly.json create mode 100644 apps/sim/blocks/sdk-names/calendly_v2.json create mode 100644 apps/sim/blocks/sdk-names/cbinsights.json create mode 100644 apps/sim/blocks/sdk-names/cbinsights_v2.json create mode 100644 apps/sim/blocks/sdk-names/chat_trigger.json create mode 100644 apps/sim/blocks/sdk-names/checkr.json create mode 100644 apps/sim/blocks/sdk-names/checkr_v2.json create mode 100644 apps/sim/blocks/sdk-names/circleback.json create mode 100644 apps/sim/blocks/sdk-names/circleback_v2.json create mode 100644 apps/sim/blocks/sdk-names/clay.json create mode 100644 apps/sim/blocks/sdk-names/clerk.json create mode 100644 apps/sim/blocks/sdk-names/clerk_v2.json create mode 100644 apps/sim/blocks/sdk-names/clickhouse.json create mode 100644 apps/sim/blocks/sdk-names/clickup.json create mode 100644 apps/sim/blocks/sdk-names/cloudflare.json create mode 100644 apps/sim/blocks/sdk-names/cloudflare_v2.json create mode 100644 apps/sim/blocks/sdk-names/cloudformation.json create mode 100644 apps/sim/blocks/sdk-names/cloudformation_v2.json create mode 100644 apps/sim/blocks/sdk-names/cloudtrail.json create mode 100644 apps/sim/blocks/sdk-names/cloudtrail_v2.json create mode 100644 apps/sim/blocks/sdk-names/cloudwatch.json create mode 100644 apps/sim/blocks/sdk-names/cloudwatch_v2.json create mode 100644 apps/sim/blocks/sdk-names/coda.json create mode 100644 apps/sim/blocks/sdk-names/codepipeline.json create mode 100644 apps/sim/blocks/sdk-names/codepipeline_v2.json create mode 100644 apps/sim/blocks/sdk-names/condition.json create mode 100644 apps/sim/blocks/sdk-names/confluence.json create mode 100644 apps/sim/blocks/sdk-names/confluence_v2.json create mode 100644 apps/sim/blocks/sdk-names/context_dev.json create mode 100644 apps/sim/blocks/sdk-names/convex.json create mode 100644 apps/sim/blocks/sdk-names/convex_v2.json create mode 100644 apps/sim/blocks/sdk-names/credential.json create mode 100644 apps/sim/blocks/sdk-names/credential_group.json create mode 100644 apps/sim/blocks/sdk-names/crowdstrike.json create mode 100644 apps/sim/blocks/sdk-names/crowdstrike_v2.json create mode 100644 apps/sim/blocks/sdk-names/crunchbase.json create mode 100644 apps/sim/blocks/sdk-names/crunchbase_v2.json create mode 100644 apps/sim/blocks/sdk-names/cursor.json create mode 100644 apps/sim/blocks/sdk-names/cursor_v2.json create mode 100644 apps/sim/blocks/sdk-names/cursor_v3.json create mode 100644 apps/sim/blocks/sdk-names/dagster.json create mode 100644 apps/sim/blocks/sdk-names/databricks.json create mode 100644 apps/sim/blocks/sdk-names/databricks_v2.json create mode 100644 apps/sim/blocks/sdk-names/datadog.json create mode 100644 apps/sim/blocks/sdk-names/datadog_v2.json create mode 100644 apps/sim/blocks/sdk-names/datagma.json create mode 100644 apps/sim/blocks/sdk-names/daytona.json create mode 100644 apps/sim/blocks/sdk-names/daytona_v2.json create mode 100644 apps/sim/blocks/sdk-names/deployments.json create mode 100644 apps/sim/blocks/sdk-names/devin.json create mode 100644 apps/sim/blocks/sdk-names/devin_v2.json create mode 100644 apps/sim/blocks/sdk-names/discord.json create mode 100644 apps/sim/blocks/sdk-names/discord_v2.json create mode 100644 apps/sim/blocks/sdk-names/docusign.json create mode 100644 apps/sim/blocks/sdk-names/downdetector.json create mode 100644 apps/sim/blocks/sdk-names/dropbox.json create mode 100644 apps/sim/blocks/sdk-names/dropbox_v2.json create mode 100644 apps/sim/blocks/sdk-names/dropcontact.json create mode 100644 apps/sim/blocks/sdk-names/dspy.json create mode 100644 apps/sim/blocks/sdk-names/dub.json create mode 100644 apps/sim/blocks/sdk-names/dub_v2.json create mode 100644 apps/sim/blocks/sdk-names/dub_v3.json create mode 100644 apps/sim/blocks/sdk-names/duckduckgo.json create mode 100644 apps/sim/blocks/sdk-names/dynamodb.json create mode 100644 apps/sim/blocks/sdk-names/dynamodb_v2.json create mode 100644 apps/sim/blocks/sdk-names/dynatrace.json create mode 100644 apps/sim/blocks/sdk-names/dynatrace_v2.json create mode 100644 apps/sim/blocks/sdk-names/ec2.json create mode 100644 apps/sim/blocks/sdk-names/ec2_v2.json create mode 100644 apps/sim/blocks/sdk-names/elasticsearch.json create mode 100644 apps/sim/blocks/sdk-names/elevenlabs.json create mode 100644 apps/sim/blocks/sdk-names/elevenlabs_v2.json create mode 100644 apps/sim/blocks/sdk-names/emailbison.json create mode 100644 apps/sim/blocks/sdk-names/emailbison_v2.json create mode 100644 apps/sim/blocks/sdk-names/embeddings.json create mode 100644 apps/sim/blocks/sdk-names/enrich.json create mode 100644 apps/sim/blocks/sdk-names/enrich_v2.json create mode 100644 apps/sim/blocks/sdk-names/enrichment.json create mode 100644 apps/sim/blocks/sdk-names/enrow.json create mode 100644 apps/sim/blocks/sdk-names/evaluator.json create mode 100644 apps/sim/blocks/sdk-names/exa.json create mode 100644 apps/sim/blocks/sdk-names/extend.json create mode 100644 apps/sim/blocks/sdk-names/extend_v2.json create mode 100644 apps/sim/blocks/sdk-names/extend_v3.json create mode 100644 apps/sim/blocks/sdk-names/fathom.json create mode 100644 apps/sim/blocks/sdk-names/fathom_v2.json create mode 100644 apps/sim/blocks/sdk-names/file.json create mode 100644 apps/sim/blocks/sdk-names/file_v2.json create mode 100644 apps/sim/blocks/sdk-names/file_v3.json create mode 100644 apps/sim/blocks/sdk-names/file_v4.json create mode 100644 apps/sim/blocks/sdk-names/file_v5.json create mode 100644 apps/sim/blocks/sdk-names/findymail.json create mode 100644 apps/sim/blocks/sdk-names/firecrawl.json create mode 100644 apps/sim/blocks/sdk-names/fireflies.json create mode 100644 apps/sim/blocks/sdk-names/fireflies_v2.json create mode 100644 apps/sim/blocks/sdk-names/fireflies_v3.json create mode 100644 apps/sim/blocks/sdk-names/fivetran.json create mode 100644 apps/sim/blocks/sdk-names/flint.json create mode 100644 apps/sim/blocks/sdk-names/flint_v2.json create mode 100644 apps/sim/blocks/sdk-names/flow.json create mode 100644 apps/sim/blocks/sdk-names/function.json create mode 100644 apps/sim/blocks/sdk-names/gamma.json create mode 100644 apps/sim/blocks/sdk-names/gamma_v2.json create mode 100644 apps/sim/blocks/sdk-names/gauge.json create mode 100644 apps/sim/blocks/sdk-names/generic_webhook.json create mode 100644 apps/sim/blocks/sdk-names/github.json create mode 100644 apps/sim/blocks/sdk-names/github_v2.json create mode 100644 apps/sim/blocks/sdk-names/github_v3.json create mode 100644 apps/sim/blocks/sdk-names/gitlab.json create mode 100644 apps/sim/blocks/sdk-names/gitlab_v2.json create mode 100644 apps/sim/blocks/sdk-names/gmail.json create mode 100644 apps/sim/blocks/sdk-names/gmail_v2.json create mode 100644 apps/sim/blocks/sdk-names/gong.json create mode 100644 apps/sim/blocks/sdk-names/gong_v2.json create mode 100644 apps/sim/blocks/sdk-names/google_ads.json create mode 100644 apps/sim/blocks/sdk-names/google_appsheet.json create mode 100644 apps/sim/blocks/sdk-names/google_bigquery.json create mode 100644 apps/sim/blocks/sdk-names/google_books.json create mode 100644 apps/sim/blocks/sdk-names/google_calendar.json create mode 100644 apps/sim/blocks/sdk-names/google_calendar_v2.json create mode 100644 apps/sim/blocks/sdk-names/google_contacts.json create mode 100644 apps/sim/blocks/sdk-names/google_docs.json create mode 100644 apps/sim/blocks/sdk-names/google_drive.json create mode 100644 apps/sim/blocks/sdk-names/google_forms.json create mode 100644 apps/sim/blocks/sdk-names/google_groups.json create mode 100644 apps/sim/blocks/sdk-names/google_maps.json create mode 100644 apps/sim/blocks/sdk-names/google_meet.json create mode 100644 apps/sim/blocks/sdk-names/google_pagespeed.json create mode 100644 apps/sim/blocks/sdk-names/google_search.json create mode 100644 apps/sim/blocks/sdk-names/google_sheets.json create mode 100644 apps/sim/blocks/sdk-names/google_sheets_v2.json create mode 100644 apps/sim/blocks/sdk-names/google_slides.json create mode 100644 apps/sim/blocks/sdk-names/google_slides_v2.json create mode 100644 apps/sim/blocks/sdk-names/google_tasks.json create mode 100644 apps/sim/blocks/sdk-names/google_translate.json create mode 100644 apps/sim/blocks/sdk-names/google_vault.json create mode 100644 apps/sim/blocks/sdk-names/grafana.json create mode 100644 apps/sim/blocks/sdk-names/grafana_v2.json create mode 100644 apps/sim/blocks/sdk-names/grain.json create mode 100644 apps/sim/blocks/sdk-names/grain_v2.json create mode 100644 apps/sim/blocks/sdk-names/grain_v3.json create mode 100644 apps/sim/blocks/sdk-names/granola.json create mode 100644 apps/sim/blocks/sdk-names/granola_v2.json create mode 100644 apps/sim/blocks/sdk-names/greenhouse.json create mode 100644 apps/sim/blocks/sdk-names/greenhouse_v2.json create mode 100644 apps/sim/blocks/sdk-names/greptile.json create mode 100644 apps/sim/blocks/sdk-names/guardrails.json create mode 100644 apps/sim/blocks/sdk-names/harmonic.json create mode 100644 apps/sim/blocks/sdk-names/helpscout.json create mode 100644 apps/sim/blocks/sdk-names/hex.json create mode 100644 apps/sim/blocks/sdk-names/hex_v2.json create mode 100644 apps/sim/blocks/sdk-names/higgsfield.json create mode 100644 apps/sim/blocks/sdk-names/hubspot.json create mode 100644 apps/sim/blocks/sdk-names/huggingface.json create mode 100644 apps/sim/blocks/sdk-names/huggingface_v2.json create mode 100644 apps/sim/blocks/sdk-names/human_in_the_loop.json create mode 100644 apps/sim/blocks/sdk-names/human_in_the_loop_v2.json create mode 100644 apps/sim/blocks/sdk-names/hunter.json create mode 100644 apps/sim/blocks/sdk-names/iam.json create mode 100644 apps/sim/blocks/sdk-names/iam_v2.json create mode 100644 apps/sim/blocks/sdk-names/icypeas.json create mode 100644 apps/sim/blocks/sdk-names/identity_center.json create mode 100644 apps/sim/blocks/sdk-names/identity_center_v2.json create mode 100644 apps/sim/blocks/sdk-names/image_generator.json create mode 100644 apps/sim/blocks/sdk-names/image_generator_v2.json create mode 100644 apps/sim/blocks/sdk-names/imap.json create mode 100644 apps/sim/blocks/sdk-names/incidentio.json create mode 100644 apps/sim/blocks/sdk-names/incidentio_v2.json create mode 100644 apps/sim/blocks/sdk-names/infisical.json create mode 100644 apps/sim/blocks/sdk-names/infisical_v2.json create mode 100644 apps/sim/blocks/sdk-names/input_trigger.json create mode 100644 apps/sim/blocks/sdk-names/instagram.json create mode 100644 apps/sim/blocks/sdk-names/instantly.json create mode 100644 apps/sim/blocks/sdk-names/instantly_v2.json create mode 100644 apps/sim/blocks/sdk-names/intercom.json create mode 100644 apps/sim/blocks/sdk-names/intercom_v2.json create mode 100644 apps/sim/blocks/sdk-names/intercom_v3.json create mode 100644 apps/sim/blocks/sdk-names/intune.json create mode 100644 apps/sim/blocks/sdk-names/jama.json create mode 100644 apps/sim/blocks/sdk-names/jina.json create mode 100644 apps/sim/blocks/sdk-names/jira.json create mode 100644 apps/sim/blocks/sdk-names/jira_service_management.json create mode 100644 apps/sim/blocks/sdk-names/jotform.json create mode 100644 apps/sim/blocks/sdk-names/jotform_v2.json create mode 100644 apps/sim/blocks/sdk-names/jupyter.json create mode 100644 apps/sim/blocks/sdk-names/jupyter_v2.json create mode 100644 apps/sim/blocks/sdk-names/jupyter_v3.json create mode 100644 apps/sim/blocks/sdk-names/kalshi.json create mode 100644 apps/sim/blocks/sdk-names/kalshi_v2.json create mode 100644 apps/sim/blocks/sdk-names/kalshi_v3.json create mode 100644 apps/sim/blocks/sdk-names/ketch.json create mode 100644 apps/sim/blocks/sdk-names/knowledge.json create mode 100644 apps/sim/blocks/sdk-names/lambda.json create mode 100644 apps/sim/blocks/sdk-names/lambda_v2.json create mode 100644 apps/sim/blocks/sdk-names/langsmith.json create mode 100644 apps/sim/blocks/sdk-names/langsmith_v2.json create mode 100644 apps/sim/blocks/sdk-names/latex.json create mode 100644 apps/sim/blocks/sdk-names/launchdarkly.json create mode 100644 apps/sim/blocks/sdk-names/launchdarkly_v2.json create mode 100644 apps/sim/blocks/sdk-names/leadmagic.json create mode 100644 apps/sim/blocks/sdk-names/lemlist.json create mode 100644 apps/sim/blocks/sdk-names/lemlist_v2.json create mode 100644 apps/sim/blocks/sdk-names/linear.json create mode 100644 apps/sim/blocks/sdk-names/linear_v2.json create mode 100644 apps/sim/blocks/sdk-names/linkedin.json create mode 100644 apps/sim/blocks/sdk-names/linkup.json create mode 100644 apps/sim/blocks/sdk-names/linq.json create mode 100644 apps/sim/blocks/sdk-names/linq_v2.json create mode 100644 apps/sim/blocks/sdk-names/logfire.json create mode 100644 apps/sim/blocks/sdk-names/logfire_v2.json create mode 100644 apps/sim/blocks/sdk-names/logrocket.json create mode 100644 apps/sim/blocks/sdk-names/logs.json create mode 100644 apps/sim/blocks/sdk-names/logs_v2.json create mode 100644 apps/sim/blocks/sdk-names/loops.json create mode 100644 apps/sim/blocks/sdk-names/loops_v2.json create mode 100644 apps/sim/blocks/sdk-names/luma.json create mode 100644 apps/sim/blocks/sdk-names/luma_v2.json create mode 100644 apps/sim/blocks/sdk-names/mailchimp.json create mode 100644 apps/sim/blocks/sdk-names/mailchimp_v2.json create mode 100644 apps/sim/blocks/sdk-names/mailgun.json create mode 100644 apps/sim/blocks/sdk-names/mailgun_v2.json create mode 100644 apps/sim/blocks/sdk-names/managed_agent.json create mode 100644 apps/sim/blocks/sdk-names/manageengine_sdp.json create mode 100644 apps/sim/blocks/sdk-names/manual_trigger.json create mode 100644 apps/sim/blocks/sdk-names/mcp.json create mode 100644 apps/sim/blocks/sdk-names/mem0.json create mode 100644 apps/sim/blocks/sdk-names/mem0_v2.json create mode 100644 apps/sim/blocks/sdk-names/memory.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_ad.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_dataverse.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_dataverse_v2.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_dynamics_365.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_excel.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_excel_v2.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_planner.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_teams.json create mode 100644 apps/sim/blocks/sdk-names/microsoft_word.json create mode 100644 apps/sim/blocks/sdk-names/millionverifier.json create mode 100644 apps/sim/blocks/sdk-names/mintlify.json create mode 100644 apps/sim/blocks/sdk-names/mistral_parse.json create mode 100644 apps/sim/blocks/sdk-names/mistral_parse_v2.json create mode 100644 apps/sim/blocks/sdk-names/mistral_parse_v3.json create mode 100644 apps/sim/blocks/sdk-names/modal.json create mode 100644 apps/sim/blocks/sdk-names/monaco.json create mode 100644 apps/sim/blocks/sdk-names/monday.json create mode 100644 apps/sim/blocks/sdk-names/mongodb.json create mode 100644 apps/sim/blocks/sdk-names/mothership.json create mode 100644 apps/sim/blocks/sdk-names/mssql.json create mode 100644 apps/sim/blocks/sdk-names/mssql_v2.json create mode 100644 apps/sim/blocks/sdk-names/mysql.json create mode 100644 apps/sim/blocks/sdk-names/mysql_v2.json create mode 100644 apps/sim/blocks/sdk-names/neo4j.json create mode 100644 apps/sim/blocks/sdk-names/netsuite.json create mode 100644 apps/sim/blocks/sdk-names/neverbounce.json create mode 100644 apps/sim/blocks/sdk-names/new_relic.json create mode 100644 apps/sim/blocks/sdk-names/new_relic_v2.json create mode 100644 apps/sim/blocks/sdk-names/note.json create mode 100644 apps/sim/blocks/sdk-names/notion.json create mode 100644 apps/sim/blocks/sdk-names/notion_v2.json create mode 100644 apps/sim/blocks/sdk-names/obsidian.json create mode 100644 apps/sim/blocks/sdk-names/okta.json create mode 100644 apps/sim/blocks/sdk-names/okta_v2.json create mode 100644 apps/sim/blocks/sdk-names/onedrive.json create mode 100644 apps/sim/blocks/sdk-names/onepassword.json create mode 100644 apps/sim/blocks/sdk-names/openai.json create mode 100644 apps/sim/blocks/sdk-names/oracle_fusion_financials.json create mode 100644 apps/sim/blocks/sdk-names/oracledb.json create mode 100644 apps/sim/blocks/sdk-names/otter.json create mode 100644 apps/sim/blocks/sdk-names/otter_v2.json create mode 100644 apps/sim/blocks/sdk-names/outlook.json create mode 100644 apps/sim/blocks/sdk-names/pagerduty.json create mode 100644 apps/sim/blocks/sdk-names/pagerduty_v2.json create mode 100644 apps/sim/blocks/sdk-names/parallel_ai.json create mode 100644 apps/sim/blocks/sdk-names/peopledatalabs.json create mode 100644 apps/sim/blocks/sdk-names/perplexity.json create mode 100644 apps/sim/blocks/sdk-names/persona.json create mode 100644 apps/sim/blocks/sdk-names/persona_v2.json create mode 100644 apps/sim/blocks/sdk-names/pi.json create mode 100644 apps/sim/blocks/sdk-names/pinecone.json create mode 100644 apps/sim/blocks/sdk-names/pipedrive.json create mode 100644 apps/sim/blocks/sdk-names/pitchbook.json create mode 100644 apps/sim/blocks/sdk-names/plane.json create mode 100644 apps/sim/blocks/sdk-names/plane_v2.json create mode 100644 apps/sim/blocks/sdk-names/planetscale.json create mode 100644 apps/sim/blocks/sdk-names/planetscale_v2.json create mode 100644 apps/sim/blocks/sdk-names/polymarket.json create mode 100644 apps/sim/blocks/sdk-names/postgresql.json create mode 100644 apps/sim/blocks/sdk-names/postgresql_v2.json create mode 100644 apps/sim/blocks/sdk-names/posthog.json create mode 100644 apps/sim/blocks/sdk-names/powerbi.json create mode 100644 apps/sim/blocks/sdk-names/profound.json create mode 100644 apps/sim/blocks/sdk-names/profound_v2.json create mode 100644 apps/sim/blocks/sdk-names/prospeo.json create mode 100644 apps/sim/blocks/sdk-names/pulse.json create mode 100644 apps/sim/blocks/sdk-names/pulse_v2.json create mode 100644 apps/sim/blocks/sdk-names/pulse_v3.json create mode 100644 apps/sim/blocks/sdk-names/qdrant.json create mode 100644 apps/sim/blocks/sdk-names/qdrant_v2.json create mode 100644 apps/sim/blocks/sdk-names/quartr.json create mode 100644 apps/sim/blocks/sdk-names/quartr_v2.json create mode 100644 apps/sim/blocks/sdk-names/quickbooks.json create mode 100644 apps/sim/blocks/sdk-names/quiver.json create mode 100644 apps/sim/blocks/sdk-names/quiver_v2.json create mode 100644 apps/sim/blocks/sdk-names/quiver_v3.json create mode 100644 apps/sim/blocks/sdk-names/rabbitmq.json create mode 100644 apps/sim/blocks/sdk-names/railway.json create mode 100644 apps/sim/blocks/sdk-names/railway_v2.json create mode 100644 apps/sim/blocks/sdk-names/ramp.json create mode 100644 apps/sim/blocks/sdk-names/rb2b.json create mode 100644 apps/sim/blocks/sdk-names/rb2b_v2.json create mode 100644 apps/sim/blocks/sdk-names/rds.json create mode 100644 apps/sim/blocks/sdk-names/rds_v2.json create mode 100644 apps/sim/blocks/sdk-names/reddit.json create mode 100644 apps/sim/blocks/sdk-names/redis.json create mode 100644 apps/sim/blocks/sdk-names/reducto.json create mode 100644 apps/sim/blocks/sdk-names/reducto_v2.json create mode 100644 apps/sim/blocks/sdk-names/reducto_v3.json create mode 100644 apps/sim/blocks/sdk-names/resend.json create mode 100644 apps/sim/blocks/sdk-names/resend_v2.json create mode 100644 apps/sim/blocks/sdk-names/response.json create mode 100644 apps/sim/blocks/sdk-names/revenuecat.json create mode 100644 apps/sim/blocks/sdk-names/rippling.json create mode 100644 apps/sim/blocks/sdk-names/rippling_v2.json create mode 100644 apps/sim/blocks/sdk-names/rocketlane.json create mode 100644 apps/sim/blocks/sdk-names/rocketlane_v2.json create mode 100644 apps/sim/blocks/sdk-names/rootly.json create mode 100644 apps/sim/blocks/sdk-names/rootly_v2.json create mode 100644 apps/sim/blocks/sdk-names/router.json create mode 100644 apps/sim/blocks/sdk-names/router_v2.json create mode 100644 apps/sim/blocks/sdk-names/rss.json create mode 100644 apps/sim/blocks/sdk-names/s3.json create mode 100644 apps/sim/blocks/sdk-names/s3_v2.json create mode 100644 apps/sim/blocks/sdk-names/sailpoint.json create mode 100644 apps/sim/blocks/sdk-names/sailpoint_v2.json create mode 100644 apps/sim/blocks/sdk-names/salesforce.json create mode 100644 apps/sim/blocks/sdk-names/sap_concur.json create mode 100644 apps/sim/blocks/sdk-names/sap_s4hana.json create mode 100644 apps/sim/blocks/sdk-names/schedule.json create mode 100644 apps/sim/blocks/sdk-names/search.json create mode 100644 apps/sim/blocks/sdk-names/secrets_manager.json create mode 100644 apps/sim/blocks/sdk-names/secrets_manager_v2.json create mode 100644 apps/sim/blocks/sdk-names/semrush.json create mode 100644 apps/sim/blocks/sdk-names/sendblue.json create mode 100644 apps/sim/blocks/sdk-names/sendgrid.json create mode 100644 apps/sim/blocks/sdk-names/sendgrid_v2.json create mode 100644 apps/sim/blocks/sdk-names/sentry.json create mode 100644 apps/sim/blocks/sdk-names/sentry_v2.json create mode 100644 apps/sim/blocks/sdk-names/serper.json create mode 100644 apps/sim/blocks/sdk-names/servicenow.json create mode 100644 apps/sim/blocks/sdk-names/servicenow_v2.json create mode 100644 apps/sim/blocks/sdk-names/servicenow_v3.json create mode 100644 apps/sim/blocks/sdk-names/ses.json create mode 100644 apps/sim/blocks/sdk-names/ses_v2.json create mode 100644 apps/sim/blocks/sdk-names/sftp.json create mode 100644 apps/sim/blocks/sdk-names/sftp_v2.json create mode 100644 apps/sim/blocks/sdk-names/sharepoint.json create mode 100644 apps/sim/blocks/sdk-names/sharepoint_v2.json create mode 100644 apps/sim/blocks/sdk-names/shopify.json create mode 100644 apps/sim/blocks/sdk-names/sim_workspace_event.json create mode 100644 apps/sim/blocks/sdk-names/similarweb.json create mode 100644 apps/sim/blocks/sdk-names/similarweb_v2.json create mode 100644 apps/sim/blocks/sdk-names/sixtyfour.json create mode 100644 apps/sim/blocks/sdk-names/sixtyfour_v2.json create mode 100644 apps/sim/blocks/sdk-names/slack.json create mode 100644 apps/sim/blocks/sdk-names/slack_v2.json create mode 100644 apps/sim/blocks/sdk-names/smartlead.json create mode 100644 apps/sim/blocks/sdk-names/smartlead_v2.json create mode 100644 apps/sim/blocks/sdk-names/smtp.json create mode 100644 apps/sim/blocks/sdk-names/snowflake.json create mode 100644 apps/sim/blocks/sdk-names/splunk.json create mode 100644 apps/sim/blocks/sdk-names/splunk_v2.json create mode 100644 apps/sim/blocks/sdk-names/sportmonks.json create mode 100644 apps/sim/blocks/sdk-names/sportmonks_v2.json create mode 100644 apps/sim/blocks/sdk-names/spotify.json create mode 100644 apps/sim/blocks/sdk-names/sqs.json create mode 100644 apps/sim/blocks/sdk-names/sqs_v2.json create mode 100644 apps/sim/blocks/sdk-names/square.json create mode 100644 apps/sim/blocks/sdk-names/square_v2.json create mode 100644 apps/sim/blocks/sdk-names/ssh.json create mode 100644 apps/sim/blocks/sdk-names/ssh_v2.json create mode 100644 apps/sim/blocks/sdk-names/ssm.json create mode 100644 apps/sim/blocks/sdk-names/ssm_v2.json create mode 100644 apps/sim/blocks/sdk-names/stagehand.json create mode 100644 apps/sim/blocks/sdk-names/start_trigger.json create mode 100644 apps/sim/blocks/sdk-names/starter.json create mode 100644 apps/sim/blocks/sdk-names/stripe.json create mode 100644 apps/sim/blocks/sdk-names/stripe_v2.json create mode 100644 apps/sim/blocks/sdk-names/sts.json create mode 100644 apps/sim/blocks/sdk-names/sts_v2.json create mode 100644 apps/sim/blocks/sdk-names/stt.json create mode 100644 apps/sim/blocks/sdk-names/stt_v2.json create mode 100644 apps/sim/blocks/sdk-names/supabase.json create mode 100644 apps/sim/blocks/sdk-names/supabase_v2.json create mode 100644 apps/sim/blocks/sdk-names/table.json create mode 100644 apps/sim/blocks/sdk-names/table_v2.json create mode 100644 apps/sim/blocks/sdk-names/tailscale.json create mode 100644 apps/sim/blocks/sdk-names/tailscale_v2.json create mode 100644 apps/sim/blocks/sdk-names/tavily.json create mode 100644 apps/sim/blocks/sdk-names/tavily_v2.json create mode 100644 apps/sim/blocks/sdk-names/telegram.json create mode 100644 apps/sim/blocks/sdk-names/telegram_v2.json create mode 100644 apps/sim/blocks/sdk-names/temporal.json create mode 100644 apps/sim/blocks/sdk-names/textract.json create mode 100644 apps/sim/blocks/sdk-names/textract_v2.json create mode 100644 apps/sim/blocks/sdk-names/textract_v3.json create mode 100644 apps/sim/blocks/sdk-names/thinking.json create mode 100644 apps/sim/blocks/sdk-names/thrive.json create mode 100644 apps/sim/blocks/sdk-names/thrive_v2.json create mode 100644 apps/sim/blocks/sdk-names/tiktok.json create mode 100644 apps/sim/blocks/sdk-names/tinybird.json create mode 100644 apps/sim/blocks/sdk-names/tinybird_v2.json create mode 100644 apps/sim/blocks/sdk-names/tinyfish.json create mode 100644 apps/sim/blocks/sdk-names/translate.json create mode 100644 apps/sim/blocks/sdk-names/trello.json create mode 100644 apps/sim/blocks/sdk-names/trigger_dev.json create mode 100644 apps/sim/blocks/sdk-names/trigger_dev_v2.json create mode 100644 apps/sim/blocks/sdk-names/tts.json create mode 100644 apps/sim/blocks/sdk-names/twilio_sms.json create mode 100644 apps/sim/blocks/sdk-names/twilio_sms_v2.json create mode 100644 apps/sim/blocks/sdk-names/twilio_voice.json create mode 100644 apps/sim/blocks/sdk-names/twilio_voice_v2.json create mode 100644 apps/sim/blocks/sdk-names/typeform.json create mode 100644 apps/sim/blocks/sdk-names/typeform_v2.json create mode 100644 apps/sim/blocks/sdk-names/upstash.json create mode 100644 apps/sim/blocks/sdk-names/upstash_v2.json create mode 100644 apps/sim/blocks/sdk-names/uptimerobot.json create mode 100644 apps/sim/blocks/sdk-names/uptimerobot_v2.json create mode 100644 apps/sim/blocks/sdk-names/vanta.json create mode 100644 apps/sim/blocks/sdk-names/variables.json create mode 100644 apps/sim/blocks/sdk-names/vercel.json create mode 100644 apps/sim/blocks/sdk-names/vercel_v2.json create mode 100644 apps/sim/blocks/sdk-names/video_generator.json create mode 100644 apps/sim/blocks/sdk-names/video_generator_v2.json create mode 100644 apps/sim/blocks/sdk-names/video_generator_v3.json create mode 100644 apps/sim/blocks/sdk-names/vision.json create mode 100644 apps/sim/blocks/sdk-names/vision_v2.json create mode 100644 apps/sim/blocks/sdk-names/wait.json create mode 100644 apps/sim/blocks/sdk-names/wealthbox.json create mode 100644 apps/sim/blocks/sdk-names/webflow.json create mode 100644 apps/sim/blocks/sdk-names/webhook_request.json create mode 100644 apps/sim/blocks/sdk-names/whatsapp.json create mode 100644 apps/sim/blocks/sdk-names/whatsapp_v2.json create mode 100644 apps/sim/blocks/sdk-names/wikipedia.json create mode 100644 apps/sim/blocks/sdk-names/windchill.json create mode 100644 apps/sim/blocks/sdk-names/wiza.json create mode 100644 apps/sim/blocks/sdk-names/wordpress.json create mode 100644 apps/sim/blocks/sdk-names/workday.json create mode 100644 apps/sim/blocks/sdk-names/workflow.json create mode 100644 apps/sim/blocks/sdk-names/workflow_input.json create mode 100644 apps/sim/blocks/sdk-names/x.json create mode 100644 apps/sim/blocks/sdk-names/youcom.json create mode 100644 apps/sim/blocks/sdk-names/youcom_v2.json create mode 100644 apps/sim/blocks/sdk-names/youtube.json create mode 100644 apps/sim/blocks/sdk-names/youtube_v2.json create mode 100644 apps/sim/blocks/sdk-names/zendesk.json create mode 100644 apps/sim/blocks/sdk-names/zendesk_v2.json create mode 100644 apps/sim/blocks/sdk-names/zep.json create mode 100644 apps/sim/blocks/sdk-names/zep_v2.json create mode 100644 apps/sim/blocks/sdk-names/zerobounce.json create mode 100644 apps/sim/blocks/sdk-names/zoho_desk.json create mode 100644 apps/sim/blocks/sdk-names/zoom.json create mode 100644 apps/sim/blocks/sdk-names/zoominfo.json create mode 100644 apps/sim/blocks/sdk-names/zoominfo_v2.json create mode 100644 apps/sim/executor/variables/code-context-parity.test.ts create mode 100644 apps/sim/hooks/queries/workflow-source.test.ts create mode 100644 apps/sim/hooks/queries/workflow-source.ts create mode 100644 apps/sim/lib/api/contracts/v2/openapi/source-catalog.ts create mode 100644 apps/sim/lib/api/contracts/v2/openapi/source-resources.ts create mode 100644 apps/sim/lib/api/contracts/v2/openapi/workflow-source.ts create mode 100644 apps/sim/lib/api/contracts/v2/openapi/workspace-source.ts create mode 100644 apps/sim/lib/api/contracts/v2/source-catalog.ts create mode 100644 apps/sim/lib/api/contracts/v2/source-resources.ts create mode 100644 apps/sim/lib/api/contracts/v2/workflow-source.ts create mode 100644 apps/sim/lib/api/contracts/v2/workspace-source.ts create mode 100644 apps/sim/lib/api/contracts/workflow-source.ts create mode 100644 apps/sim/lib/credentials/application/credential-keys.ts create mode 100644 apps/sim/lib/environment/variable-names.integration.ts create mode 100644 apps/sim/lib/table/application/reshape.ts create mode 100644 apps/sim/lib/table/rows/keyed-write.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.catalog.integration.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.credentials.integration.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.fidelity.integration.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.governance.integration.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.integration.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.parity.integration.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.runtime.integration.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.skills.integration.ts create mode 100644 apps/sim/lib/workflows/application/apply-workflow-source.ts create mode 100644 apps/sim/lib/workflows/application/code-availability.ts create mode 100644 apps/sim/lib/workflows/application/graph-write.ts create mode 100644 apps/sim/lib/workflows/application/read-source-catalog.integration.ts create mode 100644 apps/sim/lib/workflows/application/read-source-catalog.ts create mode 100644 apps/sim/lib/workflows/application/read-source-resources.integration.ts create mode 100644 apps/sim/lib/workflows/application/read-source-resources.ts create mode 100644 apps/sim/lib/workflows/application/read-workflow-source.ts create mode 100644 apps/sim/lib/workflows/application/source-analytics.test.ts create mode 100644 apps/sim/lib/workflows/application/source-analytics.ts create mode 100644 apps/sim/lib/workflows/application/source-commit.ts create mode 100644 apps/sim/lib/workflows/application/source-diff.ts create mode 100644 apps/sim/lib/workflows/application/source-error.ts create mode 100644 apps/sim/lib/workflows/application/source-evaluate.ts create mode 100644 apps/sim/lib/workflows/application/source-locate.test.ts create mode 100644 apps/sim/lib/workflows/application/source-locate.ts create mode 100644 apps/sim/lib/workflows/blocks/start-outputs.ts create mode 100644 apps/sim/lib/workflows/code/api-built-source.test.ts create mode 100644 apps/sim/lib/workflows/code/apply/gates.test.ts create mode 100644 apps/sim/lib/workflows/code/apply/gates.ts create mode 100644 apps/sim/lib/workflows/code/apply/graph-diff.ts create mode 100644 apps/sim/lib/workflows/code/apply/live-triggers.ts create mode 100644 apps/sim/lib/workflows/code/apply/locked.test.ts create mode 100644 apps/sim/lib/workflows/code/apply/locked.ts create mode 100644 apps/sim/lib/workflows/code/apply/schedules.test.ts create mode 100644 apps/sim/lib/workflows/code/apply/schedules.ts create mode 100644 apps/sim/lib/workflows/code/catalog/build.test.ts create mode 100644 apps/sim/lib/workflows/code/catalog/build.ts create mode 100644 apps/sim/lib/workflows/code/catalog/probe.test.ts create mode 100644 apps/sim/lib/workflows/code/catalog/probe.ts create mode 100644 apps/sim/lib/workflows/code/catalog/project.ts create mode 100644 apps/sim/lib/workflows/code/catalog/registry-catalog.test-helpers.ts create mode 100644 apps/sim/lib/workflows/code/catalog/registry-sources.ts create mode 100644 apps/sim/lib/workflows/code/catalog/sdk-names.test.ts create mode 100644 apps/sim/lib/workflows/code/catalog/sdk-names.ts create mode 100644 apps/sim/lib/workflows/code/catalog/value-kind.ts create mode 100644 apps/sim/lib/workflows/code/catalog/workspace.test.ts create mode 100644 apps/sim/lib/workflows/code/catalog/workspace.ts create mode 100644 apps/sim/lib/workflows/code/compile-source.ts create mode 100644 apps/sim/lib/workflows/code/corpus/blocks.ts create mode 100644 apps/sim/lib/workflows/code/corpus/canvas-ops.test-helpers.ts create mode 100644 apps/sim/lib/workflows/code/corpus/editing.corpus.test.ts create mode 100644 apps/sim/lib/workflows/code/corpus/fixtures.test-helpers.ts create mode 100644 apps/sim/lib/workflows/code/corpus/generate.test.ts create mode 100644 apps/sim/lib/workflows/code/corpus/generate.ts create mode 100644 apps/sim/lib/workflows/code/corpus/inactive.corpus.test.ts create mode 100644 apps/sim/lib/workflows/code/corpus/index.ts create mode 100644 apps/sim/lib/workflows/code/corpus/outputs.corpus.test.ts create mode 100644 apps/sim/lib/workflows/code/corpus/proof/arbitraries.ts create mode 100644 apps/sim/lib/workflows/code/corpus/proof/diff.ts create mode 100644 apps/sim/lib/workflows/code/corpus/proof/index.ts create mode 100644 apps/sim/lib/workflows/code/corpus/proof/oracles.ts create mode 100644 apps/sim/lib/workflows/code/corpus/proof/report.ts create mode 100644 apps/sim/lib/workflows/code/corpus/random.ts create mode 100644 apps/sim/lib/workflows/code/corpus/roundtrip.corpus.test.ts create mode 100644 apps/sim/lib/workflows/code/corpus/secrets.corpus.test.ts create mode 100644 apps/sim/lib/workflows/code/corpus/source-harness.test-helpers.ts create mode 100644 apps/sim/lib/workflows/code/corpus/typecheck.corpus.test.ts create mode 100644 apps/sim/lib/workflows/code/corpus/values.ts create mode 100644 apps/sim/lib/workflows/code/credential-nodes.ts create mode 100644 apps/sim/lib/workflows/code/default-parity.test.ts create mode 100644 apps/sim/lib/workflows/code/feature-flag.integration.ts create mode 100644 apps/sim/lib/workflows/code/feature-flag.ts create mode 100644 apps/sim/lib/workflows/code/golden-cases.test-helpers.ts create mode 100644 apps/sim/lib/workflows/code/goldens.test.ts create mode 100644 apps/sim/lib/workflows/code/hand-written.test.ts create mode 100644 apps/sim/lib/workflows/code/json-field-refs.test.ts create mode 100644 apps/sim/lib/workflows/code/materialize-hooks.test.ts create mode 100644 apps/sim/lib/workflows/code/materialize-hooks.ts create mode 100644 apps/sim/lib/workflows/code/print-stored.ts create mode 100644 apps/sim/lib/workflows/code/real-catalog.test.ts create mode 100644 apps/sim/lib/workflows/code/ref-paths.test.ts create mode 100644 apps/sim/lib/workflows/code/resources.ts create mode 100644 apps/sim/lib/workflows/code/scale-budget.test.ts create mode 100644 apps/sim/lib/workflows/code/sdk-examples.test.ts create mode 100644 apps/sim/lib/workflows/code/sdk-typecheck.test-helpers.ts create mode 100644 apps/sim/lib/workflows/code/seeded-defaults.test.ts create mode 100644 apps/sim/lib/workflows/code/source-lock.test.ts create mode 100644 apps/sim/lib/workflows/code/source-lock.ts create mode 100644 apps/sim/lib/workflows/code/source-mistakes.test.ts create mode 100644 apps/sim/lib/workflows/code/stored-canonical.test.ts create mode 100644 apps/sim/lib/workflows/code/stored-canonical.ts create mode 100644 apps/sim/lib/workflows/editing/gates.ts create mode 100644 apps/sim/lib/workflows/persistence/source-meta.integration.ts create mode 100644 apps/sim/lib/workflows/schedules/validation.test.ts create mode 100644 apps/sim/lib/workspace-source/api/route-policies.test.ts create mode 100644 apps/sim/lib/workspace-source/api/route-policies.ts create mode 100644 apps/sim/lib/workspace-source/application/analytics.test.ts create mode 100644 apps/sim/lib/workspace-source/application/analytics.ts create mode 100644 apps/sim/lib/workspace-source/application/apply-workspace-source.ts create mode 100644 apps/sim/lib/workspace-source/application/apply.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/context.ts create mode 100644 apps/sim/lib/workspace-source/application/cross-kind.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/deployments.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/errors.test.ts create mode 100644 apps/sim/lib/workspace-source/application/errors.ts create mode 100644 apps/sim/lib/workspace-source/application/files.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/findings.ts create mode 100644 apps/sim/lib/workspace-source/application/hash-budget.ts create mode 100644 apps/sim/lib/workspace-source/application/in-use.ts create mode 100644 apps/sim/lib/workspace-source/application/keys.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/credentials/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/deployment/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/deployment/stored.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/deployment/triggers.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/files/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/knowledge/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/knowledge/diff.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/knowledge/stored.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/mcp/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/mcp/stored.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/named.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/secrets/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/skills/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/table/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/table/codec.test.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/table/codec.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/table/diff.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/table/rows.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/table/stored.test.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/table/stored.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/tools/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/kinds/workflow/adapter.ts create mode 100644 apps/sim/lib/workspace-source/application/knowledge.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/lease.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/mcp.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/mirrors.test.ts create mode 100644 apps/sim/lib/workspace-source/application/operations.ts create mode 100644 apps/sim/lib/workspace-source/application/plan.ts create mode 100644 apps/sim/lib/workspace-source/application/promote.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/read-workspace-source.ts create mode 100644 apps/sim/lib/workspace-source/application/references.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/registry.ts create mode 100644 apps/sim/lib/workspace-source/application/rows.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/stage-blobs.ts create mode 100644 apps/sim/lib/workspace-source/application/staging.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/status.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/three-way.ts create mode 100644 apps/sim/lib/workspace-source/application/tools-skills.integration.ts create mode 100644 apps/sim/lib/workspace-source/application/types.ts create mode 100644 apps/sim/lib/workspace-source/application/workspace-source.test-helpers.ts create mode 100644 apps/sim/lib/workspace-source/lease/store.ts create mode 100644 apps/sim/lib/workspace-source/staging/store.ts create mode 100644 apps/sim/lib/workspaces/resource-keys.integration.ts create mode 100644 apps/sim/lib/workspaces/resource-keys.test.ts create mode 100644 apps/sim/lib/workspaces/resource-keys.ts create mode 100644 apps/sim/scripts/export-redacted-workflows.test.ts create mode 100644 apps/sim/scripts/export-redacted-workflows.ts create mode 100644 apps/sim/scripts/generate-sdk-names.ts create mode 100644 apps/sim/scripts/test-workflow-code-ui-e2e.ts create mode 100644 apps/sim/scripts/test-workflow-source-apply-e2e.ts create mode 100644 apps/sim/scripts/test-workflow-source-e2e.ts create mode 100644 apps/sim/scripts/test-workspace-source-e2e.ts create mode 100644 apps/sim/serializer/viewer-scoped-defaults.test.ts create mode 100644 apps/sim/types/monaco-typescript-definition.d.ts create mode 100644 packages/db/migrations/0466_workspace_source.sql create mode 100644 packages/db/migrations/meta/0466_snapshot.json create mode 100644 packages/sim-cli/src/commands/protocol/source-dir.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/source-dir.ts create mode 100644 packages/sim-cli/src/commands/protocol/source-status.ts create mode 100644 packages/sim-cli/src/commands/protocol/source-tree.ts create mode 100644 packages/sim-cli/src/commands/protocol/source-ui.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-apply.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-apply.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-check.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-check.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-get.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-get.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-roundtrip.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-status.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workflow-source-status.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-apply.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-apply.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-blobs.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-check.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-check.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-dir.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-get.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-get.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-status.test.ts create mode 100644 packages/sim-cli/src/commands/protocol/workspace-source-status.ts create mode 100644 packages/sim-cli/src/test/workspace-source-command.ts create mode 100644 packages/utils/src/concurrency.test.ts create mode 100644 packages/utils/src/concurrency.ts rename {apps/sim/lib/core/utils => packages/utils/src}/timezone.test.ts (99%) rename {apps/sim/lib/core/utils => packages/utils/src}/timezone.ts (100%) create mode 100644 packages/workflow-code/DESIGN.md create mode 100644 packages/workflow-code/package.json create mode 100644 packages/workflow-code/src/agent-tools.ts create mode 100644 packages/workflow-code/src/anchors.test.ts create mode 100644 packages/workflow-code/src/anchors.ts create mode 100644 packages/workflow-code/src/babel.ts create mode 100644 packages/workflow-code/src/canonicalize/branches.ts create mode 100644 packages/workflow-code/src/canonicalize/context.ts create mode 100644 packages/workflow-code/src/canonicalize/edges.ts create mode 100644 packages/workflow-code/src/canonicalize/hostile.test.ts create mode 100644 packages/workflow-code/src/canonicalize/index.test.ts create mode 100644 packages/workflow-code/src/canonicalize/index.ts create mode 100644 packages/workflow-code/src/canonicalize/keys.ts create mode 100644 packages/workflow-code/src/canonicalize/modes.ts create mode 100644 packages/workflow-code/src/canonicalize/params.ts create mode 100644 packages/workflow-code/src/canonicalize/subflows.ts create mode 100644 packages/workflow-code/src/canonicalize/tools.ts create mode 100644 packages/workflow-code/src/canonicalize/values.ts create mode 100644 packages/workflow-code/src/catalog/activity.ts create mode 100644 packages/workflow-code/src/catalog/canonical-index/index.ts create mode 100644 packages/workflow-code/src/catalog/compact.test.ts create mode 100644 packages/workflow-code/src/catalog/compact.ts create mode 100644 packages/workflow-code/src/catalog/conditions.ts create mode 100644 packages/workflow-code/src/catalog/defaults.ts create mode 100644 packages/workflow-code/src/catalog/scaling.test.ts create mode 100644 packages/workflow-code/src/catalog/surface.ts create mode 100644 packages/workflow-code/src/catalog/types.ts create mode 100644 packages/workflow-code/src/catalog/view.ts create mode 100644 packages/workflow-code/src/code-files/bijection.test.ts create mode 100644 packages/workflow-code/src/code-files/bijection.ts create mode 100644 packages/workflow-code/src/code-files/from-file.ts create mode 100644 packages/workflow-code/src/code-files/index.ts create mode 100644 packages/workflow-code/src/code-files/lexer.ts create mode 100644 packages/workflow-code/src/code-files/ref-path.ts create mode 100644 packages/workflow-code/src/code-files/references.ts create mode 100644 packages/workflow-code/src/code-files/to-file.ts create mode 100644 packages/workflow-code/src/compile/SYNTAX.md create mode 100644 packages/workflow-code/src/compile/blocks.ts create mode 100644 packages/workflow-code/src/compile/catalog.test-helpers.ts create mode 100644 packages/workflow-code/src/compile/characters.ts create mode 100644 packages/workflow-code/src/compile/checks.test.ts create mode 100644 packages/workflow-code/src/compile/comments.ts create mode 100644 packages/workflow-code/src/compile/context.ts create mode 100644 packages/workflow-code/src/compile/edges.ts create mode 100644 packages/workflow-code/src/compile/ergonomics.test.ts create mode 100644 packages/workflow-code/src/compile/grammar.test.ts create mode 100644 packages/workflow-code/src/compile/hints.ts create mode 100644 packages/workflow-code/src/compile/hostile.test.ts create mode 100644 packages/workflow-code/src/compile/index.ts create mode 100644 packages/workflow-code/src/compile/parse.ts create mode 100644 packages/workflow-code/src/compile/report.ts create mode 100644 packages/workflow-code/src/compile/scaling.test.ts create mode 100644 packages/workflow-code/src/compile/scope.ts create mode 100644 packages/workflow-code/src/compile/tools.ts create mode 100644 packages/workflow-code/src/compile/validate-catalog.ts create mode 100644 packages/workflow-code/src/compile/values.ts create mode 100644 packages/workflow-code/src/diagnostics/codes.ts create mode 100644 packages/workflow-code/src/diagnostics/frame.test.ts create mode 100644 packages/workflow-code/src/diagnostics/frame.ts create mode 100644 packages/workflow-code/src/diff/index.test.ts create mode 100644 packages/workflow-code/src/diff/index.ts create mode 100644 packages/workflow-code/src/equivalence/executable.ts create mode 100644 packages/workflow-code/src/equivalence/index.test.ts create mode 100644 packages/workflow-code/src/equivalence/index.ts create mode 100644 packages/workflow-code/src/equivalence/pinned.test.ts create mode 100644 packages/workflow-code/src/forms/condition.ts create mode 100644 packages/workflow-code/src/forms/response.ts create mode 100644 packages/workflow-code/src/forms/subflow.ts create mode 100644 packages/workflow-code/src/hash.test.ts create mode 100644 packages/workflow-code/src/hash.ts create mode 100644 packages/workflow-code/src/index.ts create mode 100644 packages/workflow-code/src/json-fields.test.ts create mode 100644 packages/workflow-code/src/json-fields.ts create mode 100644 packages/workflow-code/src/layout.ts create mode 100644 packages/workflow-code/src/limits.test.ts create mode 100644 packages/workflow-code/src/limits.ts create mode 100644 packages/workflow-code/src/lock.test.ts create mode 100644 packages/workflow-code/src/lock.ts create mode 100644 packages/workflow-code/src/materialize/block.ts create mode 100644 packages/workflow-code/src/materialize/branches.ts create mode 100644 packages/workflow-code/src/materialize/context.ts create mode 100644 packages/workflow-code/src/materialize/edges.ts create mode 100644 packages/workflow-code/src/materialize/fixtures.test-helpers.ts create mode 100644 packages/workflow-code/src/materialize/identity.ts create mode 100644 packages/workflow-code/src/materialize/index.test.ts create mode 100644 packages/workflow-code/src/materialize/index.ts create mode 100644 packages/workflow-code/src/materialize/modes.ts create mode 100644 packages/workflow-code/src/materialize/params.ts create mode 100644 packages/workflow-code/src/materialize/preserve.ts create mode 100644 packages/workflow-code/src/materialize/quirks.test-helpers.ts create mode 100644 packages/workflow-code/src/materialize/subflows.ts create mode 100644 packages/workflow-code/src/materialize/values.ts create mode 100644 packages/workflow-code/src/model.ts create mode 100644 packages/workflow-code/src/print/__golden__/agent-tools.txt create mode 100644 packages/workflow-code/src/print/__golden__/block-meta.txt create mode 100644 packages/workflow-code/src/print/__golden__/branch-titles-and-extra.txt create mode 100644 packages/workflow-code/src/print/__golden__/branches-null-rows.txt create mode 100644 packages/workflow-code/src/print/__golden__/comments-at-anchors.txt create mode 100644 packages/workflow-code/src/print/__golden__/diagnostics.json create mode 100644 packages/workflow-code/src/print/__golden__/fan-out-wrapping.txt create mode 100644 packages/workflow-code/src/print/__golden__/function-files.txt create mode 100644 packages/workflow-code/src/print/__golden__/function-languages.txt create mode 100644 packages/workflow-code/src/print/__golden__/generic-block-legacy-operation.txt create mode 100644 packages/workflow-code/src/print/__golden__/generic-block-unknown-type.txt create mode 100644 packages/workflow-code/src/print/__golden__/identifier-collisions.txt create mode 100644 packages/workflow-code/src/print/__golden__/inactive-values.txt create mode 100644 packages/workflow-code/src/print/__golden__/input-format-sugar.txt create mode 100644 packages/workflow-code/src/print/__golden__/json-code-fields.txt create mode 100644 packages/workflow-code/src/print/__golden__/layout-widths.txt create mode 100644 packages/workflow-code/src/print/__golden__/legacy-dropdown-and-todo.txt create mode 100644 packages/workflow-code/src/print/__golden__/lock-order.txt create mode 100644 packages/workflow-code/src/print/__golden__/loop-foreach.txt create mode 100644 packages/workflow-code/src/print/__golden__/minimal-trigger.txt create mode 100644 packages/workflow-code/src/print/__golden__/nested-subflows.txt create mode 100644 packages/workflow-code/src/print/__golden__/note-markdown.txt create mode 100644 packages/workflow-code/src/print/__golden__/pair-modes.txt create mode 100644 packages/workflow-code/src/print/__golden__/parallel-untyped.txt create mode 100644 packages/workflow-code/src/print/__golden__/raw-and-odd-edges.txt create mode 100644 packages/workflow-code/src/print/__golden__/ref-cycle-literalized.txt create mode 100644 packages/workflow-code/src/print/__golden__/resource-nodes.txt create mode 100644 packages/workflow-code/src/print/__golden__/response-body.txt create mode 100644 packages/workflow-code/src/print/__golden__/router-routes.txt create mode 100644 packages/workflow-code/src/print/__golden__/stored-secrets.txt create mode 100644 packages/workflow-code/src/print/__golden__/string-escapes.txt create mode 100644 packages/workflow-code/src/print/__golden__/support-triage.txt create mode 100644 packages/workflow-code/src/print/__golden__/templates-and-paths.txt create mode 100644 packages/workflow-code/src/print/__golden__/trigger-mode-builders.txt create mode 100644 packages/workflow-code/src/print/__golden__/unresolved-tokens.txt create mode 100644 packages/workflow-code/src/print/__golden__/vars-by-field.txt create mode 100644 packages/workflow-code/src/print/comments.ts create mode 100644 packages/workflow-code/src/print/context.ts create mode 100644 packages/workflow-code/src/print/depth.test.ts create mode 100644 packages/workflow-code/src/print/doc.ts create mode 100644 packages/workflow-code/src/print/edges.ts create mode 100644 packages/workflow-code/src/print/idents.ts create mode 100644 packages/workflow-code/src/print/index.ts create mode 100644 packages/workflow-code/src/print/order.ts create mode 100644 packages/workflow-code/src/print/params.ts create mode 100644 packages/workflow-code/src/print/printer.ts create mode 100644 packages/workflow-code/src/print/refs.ts create mode 100644 packages/workflow-code/src/print/round-trip.test.ts create mode 100644 packages/workflow-code/src/print/scaling.test.ts create mode 100644 packages/workflow-code/src/print/scope.ts create mode 100644 packages/workflow-code/src/print/strings.ts create mode 100644 packages/workflow-code/src/print/syntax.ts create mode 100644 packages/workflow-code/src/print/tools.ts create mode 100644 packages/workflow-code/src/print/values.ts create mode 100644 packages/workflow-code/src/records.ts create mode 100644 packages/workflow-code/src/scaling.test-helpers.ts create mode 100644 packages/workflow-code/src/sdk.ts create mode 100644 packages/workflow-code/src/secrets.ts create mode 100644 packages/workflow-code/src/source-meta.test.ts create mode 100644 packages/workflow-code/src/source-meta.ts create mode 100644 packages/workflow-code/src/start-inputs.ts create mode 100644 packages/workflow-code/src/structured/codec.ts create mode 100644 packages/workflow-code/src/structured/index.ts create mode 100644 packages/workflow-code/src/structured/input-format.ts create mode 100644 packages/workflow-code/src/structured/skills.ts create mode 100644 packages/workflow-code/src/structured/table-rows.ts create mode 100644 packages/workflow-code/src/structured/variables.ts create mode 100644 packages/workflow-code/tsconfig.json create mode 100644 packages/workflow-code/vitest.config.ts create mode 100644 packages/workflow-persistence/src/source-meta.ts create mode 100644 packages/workflow-sdk/README.md create mode 100644 packages/workflow-sdk/cookbook/examples/agents.ts create mode 100644 packages/workflow-sdk/cookbook/examples/cookbook.ts create mode 100644 packages/workflow-sdk/cookbook/examples/integrations.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/credentials.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/deployments/support.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/files/templates/reply.md create mode 100644 packages/workflow-sdk/cookbook/workspace/knowledge/policies/docs/refunds.md create mode 100644 packages/workflow-sdk/cookbook/workspace/knowledge/policies/knowledge.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/mcp/docs.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/secrets.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/skills/tone.md create mode 100644 packages/workflow-sdk/cookbook/workspace/tables/orders.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/tables/plans.rows.jsonl create mode 100644 packages/workflow-sdk/cookbook/workspace/tables/plans.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/tools/lookup-order.js create mode 100644 packages/workflow-sdk/cookbook/workspace/tools/lookup-order.ts create mode 100644 packages/workflow-sdk/cookbook/workspace/workflows/support/workflow.ts create mode 100644 packages/workflow-sdk/package.json create mode 100644 packages/workflow-sdk/scripts/generate-embedded-text.ts create mode 100644 packages/workflow-sdk/scripts/typecheck-fixtures.ts create mode 100644 packages/workflow-sdk/src/codegen/cookbook-text.generated.ts create mode 100644 packages/workflow-sdk/src/codegen/cookbook-text.test.ts create mode 100644 packages/workflow-sdk/src/codegen/core-text.generated.ts create mode 100644 packages/workflow-sdk/src/codegen/core-text.test.ts create mode 100644 packages/workflow-sdk/src/codegen/embedded-files.ts create mode 100644 packages/workflow-sdk/src/codegen/emit.ts create mode 100644 packages/workflow-sdk/src/codegen/generate.test.ts create mode 100644 packages/workflow-sdk/src/codegen/generate.ts create mode 100644 packages/workflow-sdk/src/codegen/index.ts create mode 100644 packages/workflow-sdk/src/codegen/layout.ts create mode 100644 packages/workflow-sdk/src/codegen/major.ts create mode 100644 packages/workflow-sdk/src/codegen/map-subblock.ts create mode 100644 packages/workflow-sdk/src/codegen/names.ts create mode 100644 packages/workflow-sdk/src/codegen/outputs.ts create mode 100644 packages/workflow-sdk/src/codegen/semantics.ts create mode 100644 packages/workflow-sdk/src/codegen/tsconfig.ts create mode 100644 packages/workflow-sdk/src/codegen/visibility.test.ts create mode 100644 packages/workflow-sdk/src/codegen/visibility.ts create mode 100644 packages/workflow-sdk/src/codegen/workspace-cookbook-text.generated.ts create mode 100644 packages/workflow-sdk/src/codegen/workspace-declarations.test.ts create mode 100644 packages/workflow-sdk/src/codegen/workspace-text.generated.ts create mode 100644 packages/workflow-sdk/src/codegen/workspace-text.test.ts create mode 100644 packages/workflow-sdk/src/codegen/workspace.ts create mode 100644 packages/workflow-sdk/src/core.d.ts create mode 100644 packages/workflow-sdk/src/core.test.ts create mode 100644 packages/workflow-sdk/src/not-executable.ts create mode 100644 packages/workflow-sdk/src/resource-kinds.test.ts create mode 100644 packages/workflow-sdk/src/runtime.test.ts create mode 100644 packages/workflow-sdk/src/runtime.ts create mode 100644 packages/workflow-sdk/src/workspace/credentials.d.ts create mode 100644 packages/workflow-sdk/src/workspace/deployment.d.ts create mode 100644 packages/workflow-sdk/src/workspace/file.d.ts create mode 100644 packages/workflow-sdk/src/workspace/index.d.ts create mode 100644 packages/workflow-sdk/src/workspace/knowledge.d.ts create mode 100644 packages/workflow-sdk/src/workspace/mcp.d.ts create mode 100644 packages/workflow-sdk/src/workspace/runtime.test.ts create mode 100644 packages/workflow-sdk/src/workspace/runtime.ts create mode 100644 packages/workflow-sdk/src/workspace/secrets.d.ts create mode 100644 packages/workflow-sdk/src/workspace/skill.d.ts create mode 100644 packages/workflow-sdk/src/workspace/table.d.ts create mode 100644 packages/workflow-sdk/src/workspace/tool.d.ts create mode 100644 packages/workflow-sdk/src/workspace/tool.test.ts create mode 100644 packages/workflow-sdk/test/core/every-builder.ts create mode 100644 packages/workflow-sdk/test/examples/approval-flow.ts create mode 100644 packages/workflow-sdk/test/examples/lead-enrichment.ts create mode 100644 packages/workflow-sdk/test/examples/rag-doc-qa.ts create mode 100644 packages/workflow-sdk/test/examples/scheduled-report.ts create mode 100644 packages/workflow-sdk/test/examples/support-triage.ts create mode 100644 packages/workflow-sdk/test/fixtures/catalog.json create mode 100644 packages/workflow-sdk/test/fixtures/workspace.ts create mode 100644 packages/workflow-sdk/test/negative/rejected.ts create mode 100644 packages/workflow-sdk/test/negative/workspace.ts create mode 100644 packages/workflow-sdk/test/typecheck-project.ts create mode 100644 packages/workflow-sdk/tsconfig.json create mode 100644 packages/workflow-sdk/vitest.config.ts create mode 100644 packages/workflow-types/src/resources.ts create mode 100644 packages/workspace-code/DESIGN.md create mode 100644 packages/workspace-code/package.json create mode 100644 packages/workspace-code/src/base.test.ts create mode 100644 packages/workspace-code/src/base.ts create mode 100644 packages/workspace-code/src/declaration/field-table.ts create mode 100644 packages/workspace-code/src/declaration/fields.ts create mode 100644 packages/workspace-code/src/declaration/hostile.test.ts create mode 100644 packages/workspace-code/src/declaration/print.ts create mode 100644 packages/workspace-code/src/declaration/read.test.ts create mode 100644 packages/workspace-code/src/declaration/read.ts create mode 100644 packages/workspace-code/src/diagnostics/codes.ts create mode 100644 packages/workspace-code/src/diagnostics/finding.ts create mode 100644 packages/workspace-code/src/diagnostics/index.ts create mode 100644 packages/workspace-code/src/fingerprint.test.ts create mode 100644 packages/workspace-code/src/fingerprint.ts create mode 100644 packages/workspace-code/src/index.ts create mode 100644 packages/workspace-code/src/kind.ts create mode 100644 packages/workspace-code/src/kinds/canonical.test.ts create mode 100644 packages/workspace-code/src/kinds/credentials.test.ts create mode 100644 packages/workspace-code/src/kinds/credentials.ts create mode 100644 packages/workspace-code/src/kinds/deployment.test.ts create mode 100644 packages/workspace-code/src/kinds/deployment.ts create mode 100644 packages/workspace-code/src/kinds/entries.ts create mode 100644 packages/workspace-code/src/kinds/files.test.ts create mode 100644 packages/workspace-code/src/kinds/files.ts create mode 100644 packages/workspace-code/src/kinds/group.ts create mode 100644 packages/workspace-code/src/kinds/knowledge.test.ts create mode 100644 packages/workspace-code/src/kinds/knowledge.ts create mode 100644 packages/workspace-code/src/kinds/literal-secrets.test.ts create mode 100644 packages/workspace-code/src/kinds/mcp.test.ts create mode 100644 packages/workspace-code/src/kinds/mcp.ts create mode 100644 packages/workspace-code/src/kinds/registry.test.ts create mode 100644 packages/workspace-code/src/kinds/registry.ts create mode 100644 packages/workspace-code/src/kinds/secrets.test.ts create mode 100644 packages/workspace-code/src/kinds/secrets.ts create mode 100644 packages/workspace-code/src/kinds/skills.test.ts create mode 100644 packages/workspace-code/src/kinds/skills.ts create mode 100644 packages/workspace-code/src/kinds/suspicious-names.test.ts create mode 100644 packages/workspace-code/src/kinds/table-rows.ts create mode 100644 packages/workspace-code/src/kinds/table.test-helpers.ts create mode 100644 packages/workspace-code/src/kinds/table.test.ts create mode 100644 packages/workspace-code/src/kinds/table.ts create mode 100644 packages/workspace-code/src/kinds/tools.test.ts create mode 100644 packages/workspace-code/src/kinds/tools.ts create mode 100644 packages/workspace-code/src/kinds/workflow.test.ts create mode 100644 packages/workspace-code/src/kinds/workflow.ts create mode 100644 packages/workspace-code/src/layout.ts create mode 100644 packages/workspace-code/src/limits.ts create mode 100644 packages/workspace-code/src/promote.ts create mode 100644 packages/workspace-code/src/specs.ts create mode 100644 packages/workspace-code/src/status.test.ts create mode 100644 packages/workspace-code/src/status.ts rename {apps/sim/lib/table => packages/workspace-code/src/table-cells}/currency.test.ts (99%) rename {apps/sim/lib/table => packages/workspace-code/src/table-cells}/currency.ts (99%) rename {apps/sim/lib/table => packages/workspace-code/src/table-cells}/dates.test.ts (99%) rename {apps/sim/lib/table => packages/workspace-code/src/table-cells}/dates.ts (97%) create mode 100644 packages/workspace-code/src/table-cells/rows.ts create mode 100644 packages/workspace-code/src/table-cells/rules.ts create mode 100644 packages/workspace-code/src/table-cells/select.ts rename apps/sim/lib/table/ttl-values.ts => packages/workspace-code/src/table-cells/ttl.ts (100%) create mode 100644 packages/workspace-code/src/table-cells/types.ts create mode 100644 packages/workspace-code/tsconfig.json create mode 100644 packages/workspace-code/vitest.config.ts create mode 100644 scripts/check-sdk-names-frozen.test.ts create mode 100644 scripts/check-sdk-names-frozen.ts create mode 100644 scripts/check-workflow-code-golden.ts diff --git a/.agents/skills/add-block/SKILL.md b/.agents/skills/add-block/SKILL.md index d063e16b485..091fff7ab20 100644 --- a/.agents/skills/add-block/SKILL.md +++ b/.agents/skills/add-block/SKILL.md @@ -1018,6 +1018,8 @@ When adding or changing `sunset.replacedBy`, run `bun run generate:block-success map to resolve legacy and current block IDs consistently without importing the executable registry. Verify it with `bun run check:block-successors`. +A new block type also needs `bun run generate:sdk-names` (commit the new `apps/sim/blocks/sdk-names/.json` and the regenerated `apps/sim/blocks/sdk-names.generated.ts`; names are add-only, and a merge conflict in the generated module is resolved by rerunning the generator) so workflow source gets a typed builder for it; `check:sdk-names` fails CI until it runs. + Adding a block on its own needs no **tool metadata** regeneration — a block references existing tool IDs through `tools.access` and does not change any tool's shape. diff --git a/.agents/skills/add-column-type/SKILL.md b/.agents/skills/add-column-type/SKILL.md index d46f1d0ec7d..0f5065d8dab 100644 --- a/.agents/skills/add-column-type/SKILL.md +++ b/.agents/skills/add-column-type/SKILL.md @@ -141,6 +141,15 @@ Registering the *type* is compiler-enforced. Registering its *metadata* is not, Copy `currency`'s service function and orchestration branch. +## Workspace source and the workflow SDK + +The workspace source table codec reads the registry, but the SDK restates each type: add the +`column.()` helper to `packages/workflow-sdk/src/workspace/table.d.ts` (the drift test in +`lib/workspace-source/application/kinds/table/codec.test.ts` fails until you do), map the type's row +value in `columnType()` (`packages/workflow-sdk/src/codegen/workspace.ts`, which defaults to +`string`), and regenerate the embedded text (`bun packages/workflow-sdk/scripts/generate-embedded-text.ts`). +See `.claude/rules/sim-workflow-code.md`. + ## Checklist Before Finishing - [ ] Id appended to `COLUMN_TYPES` in `column-types/types.ts` diff --git a/.agents/skills/add-integration/SKILL.md b/.agents/skills/add-integration/SKILL.md index ec33d091e2e..e6e6a8ba2ae 100644 --- a/.agents/skills/add-integration/SKILL.md +++ b/.agents/skills/add-integration/SKILL.md @@ -371,6 +371,8 @@ export const BLOCK_META_REGISTRY: Record = { } ``` +Then run `bun run generate:sdk-names` and commit the new `apps/sim/blocks/sdk-names/.json` and the regenerated `apps/sim/blocks/sdk-names.generated.ts` (names are add-only: never edit or delete an existing entry; on a merge conflict in the generated module, rerun the generator), so workflow source gets a typed builder for the new block (`check:sdk-names` fails CI until it runs). + ### Trigger Registry (`apps/sim/triggers/registry.ts`) - If triggers exist ```typescript diff --git a/.agents/skills/v2-api-conventions/SKILL.md b/.agents/skills/v2-api-conventions/SKILL.md index 9438c8434cd..68bee751466 100644 --- a/.agents/skills/v2-api-conventions/SKILL.md +++ b/.agents/skills/v2-api-conventions/SKILL.md @@ -182,7 +182,7 @@ Audited against the primary specs and against Stripe, GitHub, and Google's AIPs. | **`X-RateLimit-Reset` as delta-seconds** | No | It is an absolute ISO 8601 timestamp, so it is clock-skew sensitive — but the response where timing actually decides behaviour (429) also carries `Retry-After`, which is skew-free. The absolute value stays useful for scheduling. | | **422 for semantic validation** | No | RFC 9110 §15.5.21 defines 422, but Appendix B.3 records that 9110 **deleted** RFC 4918's clause saying 400 was inappropriate. 400 covers "cannot or will not process… perceived to be a client error". The split is convention, not requirement — GitHub splits, Stripe and Google do not. Our machine-readable `error.code` already carries the distinction, and restatusing now breaks clients. | | **`Location` on 201** | No | §9.3.3 makes this a `SHOULD` **for POST**; the status code itself (§15.3.2) requires nothing and defines the fallback — absent `Location`, the target URI identifies the resource. Declined knowingly: several 201 responses (signed upload sessions, table exports, knowledge folders) have no canonical single-resource GET, so a `Location` would 404, and adopting it on some of the 19 is worse for a client than on none. Every 201 returns the full representation including its `id`. Revisit per-route if one gains a canonical GET. | -| **ETag / `If-None-Match` / `If-Match`** | No | Every v2 response is `Cache-Control: private, no-store` per-caller data, so `If-None-Match` buys nothing. For writes, `If-Match` needs a **strong** validator: §8.8.3.2's strong comparison fails if *either* tag is weak, so a weak ETag silently makes every `If-Match` fail. None of the three surveyed APIs does HTTP optimistic concurrency — Google does the semantics via a resource `etag` **field** (AIP-154), deliberately not the header. If Sim needs optimistic concurrency, do it that way. | +| **ETag / `If-None-Match` / `If-Match`** | No | Every v2 response is `Cache-Control: private, no-store` per-caller data, so `If-None-Match` buys nothing. The exception is a content-addressed read (the source catalog) that sets the route builder's `entityTag`: its 200 and 304 say `private, no-cache`, so the client keeps the body and revalidates it. For writes, `If-Match` needs a **strong** validator: §8.8.3.2's strong comparison fails if *either* tag is weak, so a weak ETag silently makes every `If-Match` fail. None of the three surveyed APIs does HTTP optimistic concurrency — Google does the semantics via a resource `etag` **field** (AIP-154), deliberately not the header. If Sim needs optimistic concurrency, do it that way. | | **`Deprecation` / `Sunset` on v1** | Not yet | RFC 9745 (Standards Track) and RFC 8594 (Informational) both apply, and GitHub emits both. But `Sunset` is a timestamp and 9745 §4 makes `Sunset >= Deprecation` a `MUST`, so emitting either commits Sim to a v1 retirement date — a product decision, not an engineering one. When that date exists: `Deprecation` is an RFC 9651 Structured Field **Date** (`@1688169599`); `Sunset` is an **HTTP-date** (`Sat, 31 Dec 2033 23:59:59 GMT`). Two encodings in one response — the most common implementation error here. | | **`application/merge-patch+json`** | No | v2 PATCH bodies are merge-patch *shaped* — absent means unchanged, `null` clears — but they are `.strict()`, so unknown members are rejected where RFC 7396 §2 would merge them, and nested objects are replaced wholesale rather than merged. Advertising the media type would over-claim. Document the semantics per contract instead. | diff --git a/.claude/rules/sim-workflow-code.md b/.claude/rules/sim-workflow-code.md new file mode 100644 index 00000000000..361534c96ec --- /dev/null +++ b/.claude/rules/sim-workflow-code.md @@ -0,0 +1,211 @@ +--- +description: Workflows and workspaces as code (workflow source, workspace source, the workflow SDK, the Code tab) +paths: + - "packages/workflow-code/**" + - "packages/workspace-code/**" + - "packages/workflow-sdk/**" + - "packages/sim-cli/src/commands/protocol/*source*" + - "apps/sim/lib/workflows/code/**" + - "apps/sim/lib/workflows/application/*source*" + - "apps/sim/lib/workspace-source/**" + - "apps/sim/blocks/sdk-names/**" + - "apps/sim/app/workspace/**/panel/components/code/**" + - "apps/sim/app/api/v2/**/source/**" + - "apps/sim/lib/api/contracts/v2/*source*" + - "apps/sim/app/api/cron/cleanup-source-staging/**" +--- + +# Workflows and Workspaces as Code + +A workflow prints to TypeScript and compiles back; a workspace prints to a directory of +declarations and applies back. Read the design docs before changing an engine or a format: +`packages/workflow-code/DESIGN.md` (one workflow) and `packages/workspace-code/DESIGN.md` (the +workspace directory). + +## Where things live + +| Where | What | +|---|---| +| `packages/workflow-types` | Shared workflow, block and resource-kind types (`WORKFLOW_RESOURCE_KINDS`) | +| `packages/workflow-code` | Pure engines for one workflow: catalog types, canonicalize, print, compile, materialize, lock, diagnostics | +| `packages/workspace-code` | Pure workspace half: `KIND_DIRS`, `APPLY_ORDER`, one codec per kind (`src/kinds/`), `.sim/base.json`, `rf1:` fingerprints, limits | +| `packages/workflow-sdk` | Authoring declarations (`src/core.d.ts`, `src/workspace/*.d.ts`), type codegen from the catalog (`src/codegen/`), the cookbook | +| `packages/sim-cli/src/commands/protocol/` | `workflow-source-*` and `workspace-source-*` commands; `source-dir.ts`, `source-tree.ts`, `source-ui.ts` are shared | +| `apps/sim/lib/workflows/code/` | Server glue: catalog projection from the registry (`catalog/`), source-apply gates (`apply/`), stored canonical form, the feature flag, the proof corpus (`corpus/`) | +| `apps/sim/lib/workflows/application/*source*` | Workflow source use cases: read, apply, create, catalog, resources | +| `apps/sim/lib/workspace-source/` | Workspace source use cases (`application/`), one adapter per kind (`application/kinds//`), route policies (`api/`) | +| `apps/sim/blocks/sdk-names/.json` | Frozen SDK builder names, one file per block type | +| `apps/sim/app/workspace/**/panel/components/code/` | The read-only Code tab | + +Dependencies point one way: `packages/workflow-types` → `packages/workflow-code` → +`packages/workspace-code` and `packages/workflow-sdk` → the CLI and `apps/sim`. `check:boundaries` keeps both engines pure (no +Node built-ins, `eval`, `globalThis`, dynamic import): they run in the browser, the CLI and the +server unchanged. + +## Naming: "code" and "source" + +Both words name the same feature, split by role; follow the split rather than rename: + +- **code** names the feature and its engines: the packages (`workflow-code`, `workspace-code`), the + server glue folder `lib/workflows/code/`, the `workflow-code` flag, the Code tab. +- **source** names the artifact and the operations on it: the files themselves, the use cases + (`readWorkflowSource`, `applyWorkspaceSource`), the routes (`/source`), the CLI + (`sim workflows source get`), `lib/workspace-source/`. + +A fingerprint of what the server stores now is a **stored fingerprint**: `storedFingerprint` +(`rf1:`, a resource) and `storedSourceFingerprint` (`sf1:`, a workflow); a plan records it as +`PlannedChange.storedFingerprint` and the apply re-reads it with `storedFingerprintNow`. The base +records the fingerprint the directory last read (`base.fingerprint`). + +A new module goes where its neighbours are: an engine or engine glue under a `code` folder, a use +case or surface under a `source` name. + +## The canonical model + +Every engine meets at the canonical workflow model (CWM): id-free, keyed by normalized block name, +with the executable view separated from preserved state. Print and compile are inverses over it; +canonicalize and materialize convert between it and stored state, with identity carried by the +lock. The catalog (built from the block registry, `lib/workflows/code/catalog/`) is the only way an +engine learns about blocks; engines never import the registry. See DESIGN.md "The canonical model" +and "The catalog". + +## Feature flag + +One global flag, `workflow-code` (`lib/core/config/feature-flags.ts`, env fallback +`WORKFLOW_CODE`), gates workflow source, workspace source, the source catalog and resources, and +the Code tab. Every use case calls `requireWorkflowCodeEnabled()` +(`lib/workflows/code/feature-flag.ts`); the UI reads it from the workspace layout's flags. A new +surface gates through the same function, never its own check. + +## Adding things + +### A block type + +Normal integration work, then `bun run generate:sdk-names`, which adds +`apps/sim/blocks/sdk-names/.json` and regenerates `sdk-names.generated.ts`. Nothing else: the +catalog projection, SDK codegen, the corpus and default parity derive from the registry. +`check:sdk-names` fails until the generator runs. Names are add-only (`check:sdk-names-frozen`): +never edit or delete an existing entry; a collision gets a hand-picked name for the new entry. +Goldens (`packages/workflow-code/src/print/__golden__`) print real blocks, so an edit to one of +those blocks can change a golden: refresh with +`bun run --cwd apps/sim test lib/workflows/code/goldens.test.ts -u`, never by hand. + +A block whose `value()` or condition the probe cannot evaluate (`catalog/probe.ts`) degrades to an +opaque type: it works, with weaker SDK typing. + +### A subBlock type + +1. `SubBlockType` (`apps/sim/blocks/types.ts` and `@sim/workflow-types/blocks`). +2. `TYPE_RULES` in `lib/workflows/code/catalog/value-kind.ts` (a total `Record`, so type-checked). +3. `mapSubBlock` in `packages/workflow-sdk/src/codegen/map-subblock.ts` (a `never` arm). +4. `getSubBlockValueShape` in `apps/sim/tools/param-shape.ts`, which defaults to `string`. +5. `packages/workflow-code/src/compile/catalog.test-helpers.ts` restates the rule flags for package tests. +6. A **structured** value (`CatalogStructuredKind`): add an entry to `STRUCTURED_CODECS` + (`packages/workflow-code/src/structured/index.ts`); the record is total over the kinds, so tsc + fails until the kind has a codec, and `StructuredCodec` (`structured/codec.ts`) lists the hook + each stage calls. Add corpus coverage. Only a kind lifted out of the param value into its own + model shape (`tools`, `branches`, the `LIFTED_STRUCTURED_KINDS`) skips the record and has its + own stage modules. +7. A **selector to a workspace resource**: the resource kind (`WORKFLOW_RESOURCE_KINDS`), its live + loader in `lib/workspaces/resource-keys.ts`, the SDK `*Ref` type in `core.d.ts`, and the + manifest (`lib/workflows/application/read-source-resources.ts`, + `packages/workflow-sdk/src/codegen/workspace.ts`). + +### A table column type + +Follow `/add-column-type`. The workspace codec reads the column registry +(`lib/workspace-source/application/kinds/table/codec.ts`), but three places restate it: + +- the `column.()` helper in `packages/workflow-sdk/src/workspace/table.d.ts` + (`kinds/table/codec.test.ts` fails until it exists), then regenerate the embedded text + (`bun packages/workflow-sdk/scripts/generate-embedded-text.ts`); +- `columnType()` in `packages/workflow-sdk/src/codegen/workspace.ts`, the row type `table('k')` + gives, which defaults to `string`; +- a type that owns metadata: `TABLE_COLUMN_METADATA_KEYS` in + `packages/workspace-code/src/kinds/table.ts` plus the reader and printer there. + +### A workspace resource kind + +The kinds: secrets (`secrets.ts`), credentials (`credentials.ts`), custom tools, skills, MCP servers +(`mcp/.ts`), tables (with opt-in rows in `tables/.rows.jsonl`, see DESIGN.md "Table +rows"), knowledge bases, files, workflows and deployments +(`deployments/.ts`, applied after workflows; see DESIGN.md "The deployment kind"). +Secrets and credentials are reference kinds declared whole in one root file (`FILE_KINDS`): see +DESIGN.md "Reference kinds" for holding back the workflows that use an entry the workspace cannot +satisfy. + +1. `APPLY_ORDER` and `KIND_DIRS` (`packages/workspace-code/src/kind.ts`) and its + `WORKSPACE_KIND_SPECS` entry (`src/specs.ts`: `resourceKind` is the key-table kind a workflow + names it by and a write claims, `null` for a kind with no key row of its own: a secret, a file + keyed by path, a deployment keyed by its workflow's key); every `Record` then + fails to type-check until it has the kind. +2. A codec `packages/workspace-code/src/kinds/.ts` with tests; `KIND_LAYOUTS`, and + `BLOB_KIND_CODECS` if it holds blobs (`src/kinds/registry.ts`); its diagnostic codes. +3. An adapter `apps/sim/lib/workspace-source/application/kinds//adapter.ts` calling the + kind's own use cases; `KIND_ADAPTERS` (`application/registry.ts`) and `NOUNS` + (`application/findings.ts`); an integration test. +4. If workflows name it by key: `WORKFLOW_RESOURCE_KINDS`, the live loader in + `lib/workspaces/resource-keys.ts`, the manifest in `read-source-resources.ts` and + `codegen/workspace.ts`, and `PENDABLE_REFERENCES` in + `lib/workflows/application/source-evaluate.ts`. +5. SDK: `packages/workflow-sdk/src/workspace/.d.ts` plus `index.d.ts`, a cookbook example + under `cookbook/workspace/`, then regenerate the embedded text. +6. CLI (`workspace-source-dir.ts`): `workspaceTsconfig` includes, the `AGENTS_GUIDE` section and + `localDeclarations`. +7. Contracts: regenerate the OpenAPI specs and `packages/sim-cli/src/generated/v2-api.ts`. + +Steps 4 to 6 have no compile-time guard: a miss ships a kind that the CLI never type-checks or +that a workflow cannot reference. + +A kind whose resources workflows name a member of (an MCP server's +tools) carries the member on the workflow change's `refs` and checks it in its adapter's +`checkRefs`, which runs once every kind is planned. A secret-bearing field prints `stored()` or an +env reference, never a value, and a literal secret in source is refused (`E_MCP_LITERAL_SECRET`). + +### A field on an existing kind + +Add it to the declaration type and to the kind's field table (`DeclFields`, +`declaration/field-table.ts`: `KNOWLEDGE_FIELDS`, `MCP_FIELDS`, `SECRET_FIELDS`, …). The table is +typed over every field of the declaration, so tsc fails until the field has an entry, and that one +entry is how the kind reads, prints and fingerprints it. Then the server's stored → declaration +mapping and diff, and the SDK `.d.ts`. Custom tools (`TOOL_FIELDS`) and skills +(`FRONTMATTER_FIELDS`) use the same tables; only a tool's `code` and a skill's `content` are read, +printed and fingerprinted by hand. A field left out of the fingerprint +makes an edit fingerprint as unchanged and silently drops it; the kind's test fixture must set the +field so the "reads back every declaration it prints" test covers it. A default mirrored from +`apps/sim` (`DEFAULT_CHUNKING`) must match the server's, or every undeclared resource reads as +changed. + +## Formats and versions + +| Artifact | Marker | Rule | +|---|---|---| +| `.sim/lock.json` (workflow) | `version: 1` | Add optional fields without a bump; validators learn a field before writers emit it; unknown data goes under `x-` keys | +| `.sim/base.json` (workspace) | `version: 1` | Same policy | +| `workflow_source_meta` | `version: 1` | Same policy; a bump needs a data migration | +| Fingerprints | `sf1:` (workflow), `rf1:` (resource) | Any change to canonicalize or a kind's `canonical()` output changes every stored fingerprint and makes every checkout stale; treat it as a format change | +| SDK surface | `// @sim-sdk 1`, `SDK_MAJOR`, `OLDEST_SDK_MAJOR` | Compile refuses a newer major and reads down to the floor | +| `apps/sim/blocks/sdk-names/` | append-only | Never rename or remove a name | + +Nothing upgrades an old version: a bump is a hard refusal until a migration exists. A lock or base +field also appears in the zod contracts (`workflowLockSchema`, `sourceBaseSchema` in +`lib/api/contracts/workflow-source.ts`), so keep both in step. + +## Proof + +Behaviour is proven by properties over the real registry, not restated unit tests: + +- `bun run --cwd apps/sim test lib/workflows/code` runs the default corpus (sampled per block type, + under 60 s): round trip (`corpus/roundtrip.corpus.test.ts`, properties P0–P7 and O1–O3 in + DESIGN.md "Proof"), inactive params, stale outputs, secrets, default parity, goldens and SDK + examples. +- `ROUNDTRIP_CORPUS_FULL=1` runs every case; `ROUNDTRIP_CORPUS_EXTRA_DIR` adds redacted production + states; `ROUNDTRIP_CORPUS_REPORT_PATH` writes a report. `corpus/typecheck.corpus.test.ts` with + `ROUNDTRIP_CORPUS_FULL=1` type-checks every printed case against the generated SDK. +- Apply behaviour is proven against Postgres: `apps/sim/lib/workflows/application/*.integration.ts` + and `apps/sim/lib/workspace-source/application/*.integration.ts`. +- The Code tab and the CLI have HTTP e2e scripts (`apps/sim/scripts/test-workflow-code-ui-e2e.ts`, + `test-workflow-source-e2e.ts`, `test-workspace-source-e2e.ts`). +- Generated artifacts and their checks: `generate:sdk-names` (`check:sdk-names`, + `check:sdk-names-frozen`), the SDK embedded text (its `*-text.test.ts`), goldens + (`check:workflow-code-golden`). diff --git a/.cursor/rules/sim-workflow-code.mdc b/.cursor/rules/sim-workflow-code.mdc new file mode 100644 index 00000000000..bb37474bbe5 --- /dev/null +++ b/.cursor/rules/sim-workflow-code.mdc @@ -0,0 +1,201 @@ +--- +description: "Workflows and workspaces as code (workflow source, workspace source, the workflow SDK, the Code tab)" +globs: ["packages/workflow-code/**","packages/workspace-code/**","packages/workflow-sdk/**","packages/sim-cli/src/commands/protocol/*source*","apps/sim/lib/workflows/code/**","apps/sim/lib/workflows/application/*source*","apps/sim/lib/workspace-source/**","apps/sim/blocks/sdk-names/**","apps/sim/app/workspace/**/panel/components/code/**","apps/sim/app/api/v2/**/source/**","apps/sim/lib/api/contracts/v2/*source*","apps/sim/app/api/cron/cleanup-source-staging/**"] +--- + + + +# Workflows and Workspaces as Code + +A workflow prints to TypeScript and compiles back; a workspace prints to a directory of +declarations and applies back. Read the design docs before changing an engine or a format: +`packages/workflow-code/DESIGN.md` (one workflow) and `packages/workspace-code/DESIGN.md` (the +workspace directory). + +## Where things live + +| Where | What | +|---|---| +| `packages/workflow-types` | Shared workflow, block and resource-kind types (`WORKFLOW_RESOURCE_KINDS`) | +| `packages/workflow-code` | Pure engines for one workflow: catalog types, canonicalize, print, compile, materialize, lock, diagnostics | +| `packages/workspace-code` | Pure workspace half: `KIND_DIRS`, `APPLY_ORDER`, one codec per kind (`src/kinds/`), `.sim/base.json`, `rf1:` fingerprints, limits | +| `packages/workflow-sdk` | Authoring declarations (`src/core.d.ts`, `src/workspace/*.d.ts`), type codegen from the catalog (`src/codegen/`), the cookbook | +| `packages/sim-cli/src/commands/protocol/` | `workflow-source-*` and `workspace-source-*` commands; `source-dir.ts`, `source-tree.ts`, `source-ui.ts` are shared | +| `apps/sim/lib/workflows/code/` | Server glue: catalog projection from the registry (`catalog/`), source-apply gates (`apply/`), stored canonical form, the feature flag, the proof corpus (`corpus/`) | +| `apps/sim/lib/workflows/application/*source*` | Workflow source use cases: read, apply, create, catalog, resources | +| `apps/sim/lib/workspace-source/` | Workspace source use cases (`application/`), one adapter per kind (`application/kinds//`), route policies (`api/`) | +| `apps/sim/blocks/sdk-names/.json` | Frozen SDK builder names, one file per block type | +| `apps/sim/app/workspace/**/panel/components/code/` | The read-only Code tab | + +Dependencies point one way: `packages/workflow-types` → `packages/workflow-code` → +`packages/workspace-code` and `packages/workflow-sdk` → the CLI and `apps/sim`. `check:boundaries` keeps both engines pure (no +Node built-ins, `eval`, `globalThis`, dynamic import): they run in the browser, the CLI and the +server unchanged. + +## Naming: "code" and "source" + +Both words name the same feature, split by role; follow the split rather than rename: + +- **code** names the feature and its engines: the packages (`workflow-code`, `workspace-code`), the + server glue folder `lib/workflows/code/`, the `workflow-code` flag, the Code tab. +- **source** names the artifact and the operations on it: the files themselves, the use cases + (`readWorkflowSource`, `applyWorkspaceSource`), the routes (`/source`), the CLI + (`sim workflows source get`), `lib/workspace-source/`. + +A fingerprint of what the server stores now is a **stored fingerprint**: `storedFingerprint` +(`rf1:`, a resource) and `storedSourceFingerprint` (`sf1:`, a workflow); a plan records it as +`PlannedChange.storedFingerprint` and the apply re-reads it with `storedFingerprintNow`. The base +records the fingerprint the directory last read (`base.fingerprint`). + +A new module goes where its neighbours are: an engine or engine glue under a `code` folder, a use +case or surface under a `source` name. + +## The canonical model + +Every engine meets at the canonical workflow model (CWM): id-free, keyed by normalized block name, +with the executable view separated from preserved state. Print and compile are inverses over it; +canonicalize and materialize convert between it and stored state, with identity carried by the +lock. The catalog (built from the block registry, `lib/workflows/code/catalog/`) is the only way an +engine learns about blocks; engines never import the registry. See DESIGN.md "The canonical model" +and "The catalog". + +## Feature flag + +One global flag, `workflow-code` (`lib/core/config/feature-flags.ts`, env fallback +`WORKFLOW_CODE`), gates workflow source, workspace source, the source catalog and resources, and +the Code tab. Every use case calls `requireWorkflowCodeEnabled()` +(`lib/workflows/code/feature-flag.ts`); the UI reads it from the workspace layout's flags. A new +surface gates through the same function, never its own check. + +## Adding things + +### A block type + +Normal integration work, then `bun run generate:sdk-names`, which adds +`apps/sim/blocks/sdk-names/.json` and regenerates `sdk-names.generated.ts`. Nothing else: the +catalog projection, SDK codegen, the corpus and default parity derive from the registry. +`check:sdk-names` fails until the generator runs. Names are add-only (`check:sdk-names-frozen`): +never edit or delete an existing entry; a collision gets a hand-picked name for the new entry. +Goldens (`packages/workflow-code/src/print/__golden__`) print real blocks, so an edit to one of +those blocks can change a golden: refresh with +`bun run --cwd apps/sim test lib/workflows/code/goldens.test.ts -u`, never by hand. + +A block whose `value()` or condition the probe cannot evaluate (`catalog/probe.ts`) degrades to an +opaque type: it works, with weaker SDK typing. + +### A subBlock type + +1. `SubBlockType` (`apps/sim/blocks/types.ts` and `@sim/workflow-types/blocks`). +2. `TYPE_RULES` in `lib/workflows/code/catalog/value-kind.ts` (a total `Record`, so type-checked). +3. `mapSubBlock` in `packages/workflow-sdk/src/codegen/map-subblock.ts` (a `never` arm). +4. `getSubBlockValueShape` in `apps/sim/tools/param-shape.ts`, which defaults to `string`. +5. `packages/workflow-code/src/compile/catalog.test-helpers.ts` restates the rule flags for package tests. +6. A **structured** value (`CatalogStructuredKind`): add an entry to `STRUCTURED_CODECS` + (`packages/workflow-code/src/structured/index.ts`); the record is total over the kinds, so tsc + fails until the kind has a codec, and `StructuredCodec` (`structured/codec.ts`) lists the hook + each stage calls. Add corpus coverage. Only a kind lifted out of the param value into its own + model shape (`tools`, `branches`, the `LIFTED_STRUCTURED_KINDS`) skips the record and has its + own stage modules. +7. A **selector to a workspace resource**: the resource kind (`WORKFLOW_RESOURCE_KINDS`), its live + loader in `lib/workspaces/resource-keys.ts`, the SDK `*Ref` type in `core.d.ts`, and the + manifest (`lib/workflows/application/read-source-resources.ts`, + `packages/workflow-sdk/src/codegen/workspace.ts`). + +### A table column type + +Follow `/add-column-type`. The workspace codec reads the column registry +(`lib/workspace-source/application/kinds/table/codec.ts`), but three places restate it: + +- the `column.()` helper in `packages/workflow-sdk/src/workspace/table.d.ts` + (`kinds/table/codec.test.ts` fails until it exists), then regenerate the embedded text + (`bun packages/workflow-sdk/scripts/generate-embedded-text.ts`); +- `columnType()` in `packages/workflow-sdk/src/codegen/workspace.ts`, the row type `table('k')` + gives, which defaults to `string`; +- a type that owns metadata: `TABLE_COLUMN_METADATA_KEYS` in + `packages/workspace-code/src/kinds/table.ts` plus the reader and printer there. + +### A workspace resource kind + +The kinds: secrets (`secrets.ts`), credentials (`credentials.ts`), custom tools, skills, MCP servers +(`mcp/.ts`), tables (with opt-in rows in `tables/.rows.jsonl`, see DESIGN.md "Table +rows"), knowledge bases, files, workflows and deployments +(`deployments/.ts`, applied after workflows; see DESIGN.md "The deployment kind"). +Secrets and credentials are reference kinds declared whole in one root file (`FILE_KINDS`): see +DESIGN.md "Reference kinds" for holding back the workflows that use an entry the workspace cannot +satisfy. + +1. `APPLY_ORDER` and `KIND_DIRS` (`packages/workspace-code/src/kind.ts`) and its + `WORKSPACE_KIND_SPECS` entry (`src/specs.ts`: `resourceKind` is the key-table kind a workflow + names it by and a write claims, `null` for a kind with no key row of its own: a secret, a file + keyed by path, a deployment keyed by its workflow's key); every `Record` then + fails to type-check until it has the kind. +2. A codec `packages/workspace-code/src/kinds/.ts` with tests; `KIND_LAYOUTS`, and + `BLOB_KIND_CODECS` if it holds blobs (`src/kinds/registry.ts`); its diagnostic codes. +3. An adapter `apps/sim/lib/workspace-source/application/kinds//adapter.ts` calling the + kind's own use cases; `KIND_ADAPTERS` (`application/registry.ts`) and `NOUNS` + (`application/findings.ts`); an integration test. +4. If workflows name it by key: `WORKFLOW_RESOURCE_KINDS`, the live loader in + `lib/workspaces/resource-keys.ts`, the manifest in `read-source-resources.ts` and + `codegen/workspace.ts`, and `PENDABLE_REFERENCES` in + `lib/workflows/application/source-evaluate.ts`. +5. SDK: `packages/workflow-sdk/src/workspace/.d.ts` plus `index.d.ts`, a cookbook example + under `cookbook/workspace/`, then regenerate the embedded text. +6. CLI (`workspace-source-dir.ts`): `workspaceTsconfig` includes, the `AGENTS_GUIDE` section and + `localDeclarations`. +7. Contracts: regenerate the OpenAPI specs and `packages/sim-cli/src/generated/v2-api.ts`. + +Steps 4 to 6 have no compile-time guard: a miss ships a kind that the CLI never type-checks or +that a workflow cannot reference. + +A kind whose resources workflows name a member of (an MCP server's +tools) carries the member on the workflow change's `refs` and checks it in its adapter's +`checkRefs`, which runs once every kind is planned. A secret-bearing field prints `stored()` or an +env reference, never a value, and a literal secret in source is refused (`E_MCP_LITERAL_SECRET`). + +### A field on an existing kind + +Add it to the declaration type and to the kind's field table (`DeclFields`, +`declaration/field-table.ts`: `KNOWLEDGE_FIELDS`, `MCP_FIELDS`, `SECRET_FIELDS`, …). The table is +typed over every field of the declaration, so tsc fails until the field has an entry, and that one +entry is how the kind reads, prints and fingerprints it. Then the server's stored → declaration +mapping and diff, and the SDK `.d.ts`. Custom tools (`TOOL_FIELDS`) and skills +(`FRONTMATTER_FIELDS`) use the same tables; only a tool's `code` and a skill's `content` are read, +printed and fingerprinted by hand. A field left out of the fingerprint +makes an edit fingerprint as unchanged and silently drops it; the kind's test fixture must set the +field so the "reads back every declaration it prints" test covers it. A default mirrored from +`apps/sim` (`DEFAULT_CHUNKING`) must match the server's, or every undeclared resource reads as +changed. + +## Formats and versions + +| Artifact | Marker | Rule | +|---|---|---| +| `.sim/lock.json` (workflow) | `version: 1` | Add optional fields without a bump; validators learn a field before writers emit it; unknown data goes under `x-` keys | +| `.sim/base.json` (workspace) | `version: 1` | Same policy | +| `workflow_source_meta` | `version: 1` | Same policy; a bump needs a data migration | +| Fingerprints | `sf1:` (workflow), `rf1:` (resource) | Any change to canonicalize or a kind's `canonical()` output changes every stored fingerprint and makes every checkout stale; treat it as a format change | +| SDK surface | `// @sim-sdk 1`, `SDK_MAJOR`, `OLDEST_SDK_MAJOR` | Compile refuses a newer major and reads down to the floor | +| `apps/sim/blocks/sdk-names/` | append-only | Never rename or remove a name | + +Nothing upgrades an old version: a bump is a hard refusal until a migration exists. A lock or base +field also appears in the zod contracts (`workflowLockSchema`, `sourceBaseSchema` in +`lib/api/contracts/workflow-source.ts`), so keep both in step. + +## Proof + +Behaviour is proven by properties over the real registry, not restated unit tests: + +- `bun run --cwd apps/sim test lib/workflows/code` runs the default corpus (sampled per block type, + under 60 s): round trip (`corpus/roundtrip.corpus.test.ts`, properties P0–P7 and O1–O3 in + DESIGN.md "Proof"), inactive params, stale outputs, secrets, default parity, goldens and SDK + examples. +- `ROUNDTRIP_CORPUS_FULL=1` runs every case; `ROUNDTRIP_CORPUS_EXTRA_DIR` adds redacted production + states; `ROUNDTRIP_CORPUS_REPORT_PATH` writes a report. `corpus/typecheck.corpus.test.ts` with + `ROUNDTRIP_CORPUS_FULL=1` type-checks every printed case against the generated SDK. +- Apply behaviour is proven against Postgres: `apps/sim/lib/workflows/application/*.integration.ts` + and `apps/sim/lib/workspace-source/application/*.integration.ts`. +- The Code tab and the CLI have HTTP e2e scripts (`apps/sim/scripts/test-workflow-code-ui-e2e.ts`, + `test-workflow-source-e2e.ts`, `test-workspace-source-e2e.ts`). +- Generated artifacts and their checks: `generate:sdk-names` (`check:sdk-names`, + `check:sdk-names-frozen`), the SDK embedded text (its `*-text.test.ts`), goldens + (`check:workflow-code-golden`). diff --git a/.github/ci-suites.json b/.github/ci-suites.json index d8f1e3953fd..787003ff190 100644 --- a/.github/ci-suites.json +++ b/.github/ci-suites.json @@ -47,6 +47,10 @@ { "group": "markdown-viewer", "task": "ci:e2e-markdown-viewer" + }, + { + "group": "workflow-code-ui", + "task": "ci:e2e-workflow-code-ui" } ], "production": [ diff --git a/.github/scripts/ci-plan.gql b/.github/scripts/ci-plan.gql index f393f1a0aed..0198e02d1a0 100644 --- a/.github/scripts/ci-plan.gql +++ b/.github/scripts/ci-plan.gql @@ -6,7 +6,7 @@ query($base: String!, $head: String!) { "ci:e2e-assistant-actions", "ci:e2e-organization-search", "ci:e2e-docs-platform", "ci:e2e-browser-extension", "ci:e2e-project-files", "ci:e2e-mobile", "ci:e2e-seo", - "ci:e2e-markdown-viewer" + "ci:e2e-markdown-viewer", "ci:e2e-workflow-code-ui" ]) { items { name diff --git a/.github/scripts/http-e2e.sh b/.github/scripts/http-e2e.sh index 61b7a752793..3b492bea3ca 100755 --- a/.github/scripts/http-e2e.sh +++ b/.github/scripts/http-e2e.sh @@ -3,7 +3,7 @@ # CI groups, which reuse the production build from `e2e-build`. # The job extracts it into apps/sim/.next before running these suites. # -# Usage: http-e2e.sh (run from apps/sim) +# Usage: http-e2e.sh (run from apps/sim) # # The job provides DATABASE_URL, BETTER_AUTH_SECRET and ENCRYPTION_KEY; each group sets the rest of # its app's environment here. Reports and server logs land in $RUNNER_TEMP/e2e. @@ -20,7 +20,7 @@ # telemetry flush runs detached and still writes .next/dev). set -euo pipefail -group=${1:?usage: http-e2e.sh } +group=${1:?usage: http-e2e.sh } report_dir="$RUNNER_TEMP/e2e" ready_timeout_seconds=600 mkdir -p "$report_dir" @@ -34,6 +34,9 @@ realtime_tag='' realtime_log='' browsers_pid='' local_app_url='' +extra_pids=() +extra_tags=() +extra_logs=() # `dev` or `start`; a group sets it before start_app. app_server=${E2E_APP_SERVER:-dev} @@ -56,6 +59,13 @@ finish() { tail -n 200 "$server_log" fi fi + for i in "${!extra_pids[@]}"; do + bash "$GITHUB_WORKSPACE/.github/scripts/stop-session.sh" "${extra_pids[$i]}" "${extra_tags[$i]}" || status=1 + wait "${extra_pids[$i]}" 2>/dev/null || true + if [ "$status" -ne 0 ]; then + tail -n 100 "${extra_logs[$i]}" + fi + done if [ -n "$realtime_pid" ]; then bash "$GITHUB_WORKSPACE/.github/scripts/stop-session.sh" "$realtime_pid" "$realtime_tag" || status=1 wait "$realtime_pid" 2>/dev/null || true @@ -119,6 +129,27 @@ start_app() { wait_ready "$server_pid" "$local_app_url/api/health" "$label app" } +# start_extra_app