mirror of
https://github.com/simstudioai/sim.git
synced 2026-11-23 13:48:29 +08:00
staging
184
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
695ca9420a |
improvement(workflows): a clean errorMessage on Function errors and table writes report ignored columns (#10328)
Function blocks that fail now also output errorMessage, the thrown message without the line/code prefix, alongside the unchanged .error; it is declared as a typed error-only output that compile, lint, codegen and the executor read wherever .error is. Table writes return ignoredColumns, the keys they dropped because no column matched, with runtime write behaviour unchanged. |
||
|
|
2e40feb0fe |
refactor(workflow-code): final-state audit cleanup (#10318)
Final-state audit of workflows/workspace as code: super-linear regexes and lookups on user input made linear (each with a failing-before test), staged blob uploads run 4 at a time, duplicated helpers consolidated onto shared ones, dead exports removed, hand-written refusal/strict-code/subflow-default data derived from their sources, and docs/guides/SYNTAX.md/exit-code tables brought back in line with the code under new drift tests. |
||
|
|
f86f3ab90a |
improvement(workflow-code): v7 benchmark residuals (column-name hints, retry docs, workspace-less errors) (#10306)
Column-name hints when table data uses a renamed column's key; primer/INDEX say table rows are keyed by column name; API retries documented as HTTP 429/5xx and timeouts only; workspace-scoped 404s name the workspace searched and how to change it; condition id help corrected. |
||
|
|
bf6bc31a0b |
improvement(workflow-code): agent DX and check/server parity from the v6 benchmark (#10305)
Agent DX fixes from the A/B v6 benchmark: --stop-after output, destructive counting, status/dry-run parity, dry-run exit 15, canonical param names on ops, ops/run help and cookbook docs; check and lint parity for child result paths, lock caps and loop conditions; clearer undeployed-child and unknown-type errors. |
||
|
|
cdac23d582 |
fix(workflow-code): release review follow-ups for the knowledge download cap, regex hardening and skill docs (#10304)
Knowledge original downloads accept documents up to the 100 MiB stored-document limit instead of the 25 MiB extraction cap. Three regexes that ran in polynomial time on long inputs (source-status trailing slashes, compile hint builder prefix, codegen layout reference chains) are linear, and the codegen reference pattern escapes its input. Skill and rule docs name the right path and valueType(). |
||
|
|
976e3c398c |
fix(sim-cli): take over a stale source lock whose owner file was left empty or cut short (#10300)
isStaleLock now treats a malformed or empty owner.json as an unrecorded owner, so the 60-second age rule decides: a stale lock left by a command that died while writing its owner is taken over, and a fresh lock read mid-write is refused as busy instead of crashing with a SyntaxError. |
||
|
|
71d7db57a8 |
fix(cli): read @file arguments saved as UTF-16LE or with a byte-order mark (#10298)
readArgumentDescriptor decodes @file / @- input as UTF-16LE when it starts with that byte-order mark, and drops a leading mark in UTF-8, so files written by Windows PowerShell 5.1 redirects (UTF-16LE) or Out-File -Encoding utf8 (UTF-8 with a mark) parse. Input without a mark decodes exactly as before. |
||
|
|
293ec1b7e1 |
improvement(workflow-code): server hardening, flaky test root causes, and agent DX across the source loop (#10287)
Server: dry runs charged to the plan budget and slot, create-from-source answers 429 when slots are full, the Code tab has its own slot lane, staged blobs count against the payer's storage quota (consumed on apply, never renewed by reads), file deletes carry a revision precondition, row limits refuse only growth, joined table transactions keep their timeouts, and blocks/edges/subflows load in a stable created_at,ctid order. DX: group help for the source loop, a primer covering renames, failures and test runs, JSON-only output, run errors mapped back to source file and line, --stop-after/--from-block by name, webhook URLs after deploy, GitHub Actions annotations and step summary, exit 15 for a partial write, table names on every table route, status that agrees with the dry run, and quieter output. Flaky tests fixed at the root (keep-alive races, sleep-based waits). Migration 0469 adds a nullable staged_blob.consumed_at. |
||
|
|
93555ff909 |
fix(workflow-code): bound lock parsing and rename inference, and close check/server parity gaps (#10285)
Lock parsing checks parent cycles in linear time and caps blocks and variables (one SOURCE_LIMITS source, counted before any entry is read, in the parser and the contract). Rename inference uses indexed candidates instead of every pair (200 renamed blocks: 103 s to 5 ms). Did-you-mean hints are computed lazily. Offline check now refuses dangling refs, unknown block types and non-addable types the way the server does. Managed table rows read under a streaming byte cap, and a committed table edit over capped rows still reports success. Deployment plans read only declared or recorded workflows. One shared canonicalJson in @sim/utils/object. |
||
|
|
8bc0ce281e |
fix(sim-cli): publish when bundled packages change, complete third-party licenses, and fix docs drift (#10279)
The CLI republishes when any package it bundles changes (trigger paths derived from the bundle's real dependency graph and guarded by a new check:sim-cli-bundle audit), THIRD_PARTY_LICENSES lists every bundled package, and sim-cli is released as 2.3.0. Workspace apply keeps a tool code file the server reprinted as stored() and warns, outline prints block ids as sent, and the scripting exit tables, SDK README, code page and git provenance docs match the CLI. |
||
|
|
dfff8c3451 |
refactor(workflow-code): simplify the source dir lock release and drop casts from the QA fixes (#10276)
Removes the source directory lock and uninstalls its interrupt release in one synchronous step (replacing three layered fixes), types the block rename rewrite by its input, writes the column strip without a cast, builds the loop fixture from a parameter, and folds a few single-use helpers. Behaviour is unchanged apart from the lock never being left half removed. |
||
|
|
6787693efb |
fix(workflow-code): staging QA fixes for runtime, promote, workspace and CLI source (#10262)
* fix(workflows): match child selected outputs by normalized block name in sync runs findChildSpanOutput compared the normalized span name with the caller's raw block ref, so a capitalised or spaced child block name was silently omitted while the parent and streaming paths matched it. * fix(executor): a join condition inside a loop reads the branch that ran this iteration resolveSourceBlockId took the first incoming block whose state said executed, and a block state keeps that flag across loop iterations, so the edge drawn first won. It now reads executedBlocks, which the loop clears between iterations. * fix(workflows): an operations-batch block rename rewrites references to the block The ops path (Copilot, API, sim workflows operations apply) only set block.name, leaving <oldname.field> references dangling, so runs emitted the raw template. The reference rewrite moves to lib/workflows/references/block-rename.ts and the editor rename, workflow import, and ops rename all use it; the editor store's inline copy (unescaped regex, stateful global test) is gone. * fix(workflows): coerce a numeric-string loop iterations or parallel count on the ops path An operations batch stored iterations: "3" or count: "2" as a string, which the loader then reset to its default (1 iterations, 5 branches) with no error. A numeric string is now stored as its number, as slider inputs coerce; any other value is an input validation error that keeps the current count, so --atomic refuses it. * test(executor): use the central tools mock in the loop join test; shrink the explicit-any baseline * fix(workspace-source): a promotion deletes what the directory deleted since the last one A resource the promotion record holds that the directory no longer declares stays in the base, so the apply plans its delete and refuses it without --allow-delete, as an apply to the directory's own workspace does. Only resources no promotion left in the target are named W_PROMOTE_DELETES_TARGET_ONLY. * fix(sim-cli): the promotion stale hint no longer suggests deleting the record Deleting .sim/targets/<id>.json made the next promotion overwrite every change made in the target since, rows its workflows wrote included, while the hint read as keeping the target's version. The hint now offers only the flows that keep the target's data and says what deleting the record does. * fix(table): a source reshape strips a dropped column's cells in its own transaction The strip ran after commit in the background and moved the managed rows' version after the apply recorded it, so the next status reported server row drift and a delete of the table was refused as stale. For a managed table the strip now commits with the reshape, so the recorded version holds it. * fix(workspace-source): name-taken, table-folder and credential findings say what to do A workflow create refused for a taken name gets its file and a hint, without the use case's 'or in another folder', which a directory cannot express; the workspace guide's exit table names E_NAME_TAKEN. E_TABLE_FOLDER and E_KB_FOLDER name the folders create command, and the credential finding no longer reads 'has no a slack credential'. * fix(sim-cli): a stale resource is not printed as kept, and promotion drift hints the target The plan line of a resource refused as stale said 'kept as the server has it'; it now says the edit is refused as stale. A promotion's W_SERVER_CHANGED pointed at a get of the directory's own workspace; it now names a get of the target. * fix(workspace-source): a real apply lists each finding of a written workflow once A workflow's commit runs its pipeline again and re-reported every finding its plan had found, so a real apply listed each warning twice. A write's finding now replaces the plan's (matched without the block id the commit gave it). * fix(sim-cli): a workspace get says why it skipped a resource A table over 10,000 rows (or any resource the get cannot read as source) was only counted in the result, with the reason in .sim/skipped.json. The get now prints each skipped resource with its reason. * fix(workspace-source): a stale workflow folder gets the hint every other kind's stale finding has The workflow pipeline's E_APPLY_STALE carried its single-directory advice in the message and no hint; a workspace plan now reports it as staleFinding does for every other kind, naming the folder and the get to run. * fix(sim-cli): a delete refused for want of --allow-delete is not printed as unchanged * test(workspace-source): wait for the column strip with sleep * fix(workflow-code): tie a falsy-valued variable rename by its moved references * fix(sim-cli): prune only function files the CLI recorded writing * fix(sim-cli): status leaves out function files no codeFile() names and drops the stale plan line * fix(workflow-code): lay out a block moved into or out of a loop or parallel * fix(workflows): word the variable rename hint so its first step can work * fix(workflow-code): refuse an unknown dropdown option on an edited block in check and apply alike * fix(sim-cli): release the directory lock when Ctrl-C ends a deferred write * fix(sim-cli): leave a codeFile() path with a NUL byte to the compile's E_CODE_FILE_PATH * fix(sim-cli): say the truncation marker leaves out the info findings a result hides * fix(sim-cli): count every compile finding a check fails on, past the per-code cap * chore(rules): load the workflow-code rule for the folders wave 2 moved its code into * fix(workflow-code): reword the renamed-block hint, which an apply that keeps the id already follows * fix(sim-cli): pin the deploy an apply names as its next step to the draft it saved * fix(sim-cli): deploy nothing after a no-op apply whose draft the live version already matches * fix(workflows): say what a block bound to when its claimed lock id is ignored * fix(workflow-code): report the code-file total-size cap once, on the file that crosses it * docs(cli): regenerate the CLI reference * fix(workspace-code): keep target-only resources on promote --allow-delete; delete them only with --delete-target-only Plain --allow-delete on a promotion now deletes only what the promotion record proves the directory deleted. Resources only the target holds stay out of the base, so the server keeps them and names each (W_UNDECLARED, with a promotion hint). --delete-target-only, which needs --to and --allow-delete, opts into deleting them. A target-only delete the apply held back is no longer written into the promotion record, where it read as a directory delete on the next promotion. * fix(table): strip a source apply's dropped managed columns once, under a row-scaled timeout The in-transaction strip ran once per dropped column under withLockedTable's 10 s default statement timeout. reshape now collects the dropped column ids and strips them in one pass with stripDroppedColumnData, which scales the statement and idle timeouts per row as the sibling column rewrites do. The carried-over non-null assertion on the row filter is gone. * fix(sim-cli): workspace status and apply leave out function files no codeFile() names readWorkspaceDir drops each file under a workflow folder's functions/ that neither its workflow.ts nor its lock names, through the same codeFilePaths rule the workflow directory status uses. A workspace status no longer reports such a file as a local change (exit 11 forever), names it on the 'Not named by any codeFile()' line, and an apply no longer sends that folder whole for it. * fix(workflow-code): refuse an unknown dropdown option only on a field the edit sets, and not on deployment-shaped options offline The server now passes the fields its value gate judges (changedSubBlockFields) into the shared refusal rule, so a stored out-of-options value written bare again on an edited block is no longer refused. The catalog marks options a registry function derives from deployment settings (optionsVary); the CLI's offline check keeps a value outside them a warning, since its cached catalog may have been built under other settings, and leaves the verdict to the server. * fix(workspace-source): match a re-reported finding by block key, keeping the block id when it names no key The write-time finding dedup dropped blockId from the key outright, so two findings that differed only in the block they named by id merged into one. * fix(workflows): accept only a whole loop iterations or parallel count of at least 1 on the ops path containerCount took whatever Number() accepted, so "1e3", "0x10", "2.5", "-1" and "0" (and the numbers -1 and 2.5) were stored silently. They are now refused as input validation errors, the bound source compile holds a count to. * fix(workflow-code): keep omitted compile findings as one counted entry per code and block Reporter.omitted kept one object per warning past the caps. It now counts them per code and block, so what a compile keeps stays bounded by the blocks it reads; the CLI check sums the counts. * test(workspace-source): scope the racing authorize spy to its own workspace and tool The spy edited its tool on any delete authorize call, so a test that timed out with the spy still installed could edit the tool of whichever test ran next. * fix(workspace-source): charge a workspace dry run to the plan budget, not the write budget A workspace apply with ?dryRun=true writes nothing and runs what a plan runs, yet drew one write unit per workflow folder from the 40-token bucket real applies share, so the preview of a 61-workflow apply left the apply waiting about two minutes. The route's new sourceApply policy charges a dry run to the source-plan bucket the status plan route uses and a real apply to the write bucket, each still per folder sent with its files and capped at the smaller bucket. * fix(workspace-source): type the block fields findingIdentity reads off a workflow finding * chore(audits): shrink the non-null assertion baseline after the column strip lost its `!` * fix(sim-cli): keep a deployment-shaped option warning unraised under the default strict mode The optionsVary exemption skipped the edit refusal but the strict raise still turned W_UNKNOWN_OPTION into an error on a new block. Listed, withheld and omitted findings now all skip the strict raise when the option varies by deployment. * fix(workflows): refuse a falsy loop iterations or parallel count on add and nested edit The add and nested-edit paths guarded on a truthy value, so 0, false, null and '' skipped containerCount and saved the default. They now check presence, as the top-level edit does. * fix(workflow-code): find a falsy-valued variable's readers by resolved block, so a reader renamed in the same edit still ties the rename * fix(sim-cli): status leaves a recorded function file no codeFile() names out of deletions while it is on disk * fix(workflows): write a renamed block's new name into references literally, not as a replace pattern * fix(workspace-source): scope a taken workflow name to its folder, and hint a taken file name be renamed locally * test(workflows,workspace-source): assert the stored out-of-options value after apply, and the strip without polling * test(workflows): match the added loop by shape, which the loose state type allows * fix(sim-cli): count an omitted refusable finding as an error where the apply would refuse it A check listed the first 20 refused findings of one code as errors but counted the rest the caps left out as warnings, so an edited code file with 25 missing references reported 20 errors. The compile now keeps a refusable omitted finding's file and field, and the check judges it with the same refusal rule as a listed one. * fix(workspace-source): hint a file path's folder that a Sim folder holds be renamed as a folder * test(workspace-source): fail the dropped-column strip test when the seeded column is missing * fix(sim-cli): an interrupt after a command released its directory lock leaves the next command's lock The lock's interrupt release stayed installed while the command removed the folders it created, and it removed the lock path by name. A second command could take the lock in that window, and an interrupt then deleted the second command's lock. The release targets the lock only until this command removes it. * fix(workflows): an operations-batch block rename rewrites a loop's or parallel's collection and conditions renameBlock rewrote references only in sub-blocks, so a loop iterating <fetch.items> kept the old name after Fetch was renamed and failed at run time. It now also rewrites the collection, while and do-while conditions a loop or parallel holds in data, which the loop and parallel records are rebuilt from. * test(workflows): set the loop fixture's collection and conditions without a type cast * fix(sim-cli): an interrupt removes the directory lock only while it still names this command Clearing a flag after the async rm left a window: once the folder was gone, another command could create the lock before the flag was set, and an interrupt then deleted it. The interrupt release now reads the lock's owner record and removes the lock only when it names this process and host (before the record is written, the lock is this command's by construction). * fix(sim-cli): uninstall the lock's interrupt release even when removing the lock fails |
||
|
|
26caf900ca |
refactor(workflow-code): source pipeline plan/commit split, one findings bound, CLI source-dir split (#10238)
Wave 2 of the workflows and workspace as code cleanup: plan/preview/commit stages bound to the planning principal, one diagnostics module and answer bound, CLI source-dir split with typed refusals and a command lock, @sim/table-cells, plus review fixes (plan writes nothing, functions/ pruning limited to lock-named code files, local refusals never read as unreachable). |
||
|
|
02fb744393 |
fix(workflow-code): correctness, safety and speed for workflows and workspace as code (#10237)
Wave 1 from the staging evaluation of workflows/workspace as code, audited by 5 lenses and re-audited. Deploy/drift safety (no out-of-band draft publishes; expected-draft fingerprints on deploy and chat writes; drift warnings by default), adopt/promote/partial-apply safety, one shared refusal decision for server and offline check, compiler and CLI correctness, feature gate after authorization, read-cost plan routes, realtime flush lost-update fixes, deterministic edge/block load order, and diff-based normalized saves with restored workflow_edges block FK indexes (migration 0467). |
||
|
|
5929764d10 |
fix(workflow-code): DX fixes from the staging A/B runs (#10229)
Dangling $ref in an edited function file is an error (E_APPLY_UNRESOLVED_REF); no W_JSON_REF_UNTYPED for a rename's reference rewrite; source status prints the findings it counts; operations edit params.parentId moves blocks (with cycle, same-batch id and nested-offset handling); deploy accepts -y; condition branch handles documented; renames rewrite restored values in one pass. |
||
|
|
6856efa50c |
fix(workflow-code): staging QA fixes for workflows and workspace as code (#10220)
Fixes from the staging end-to-end QA of workflows and workspace as code: check and catalog fixes, visibility gate on source apply, CLI exit and interrupt handling, apply DX (binding, findings, created ids, deploy), workspace batching under the body ceiling, params reference and slim primer, diagnostics and rename identity, plus the review fixes. |
||
|
|
bc8f09ccb1 |
feat(workflow-code): workflows and workspace as code (#10129)
* 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 <workflowId> --dir ./<workflow-name-slug>, 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/<key>/ 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/<key>.ts without tools/<key>.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/<key>.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('<key>') 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: <message> } 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<O> 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 <folders> --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": <score.value>), 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
|
||
|
|
994babde13 | fix(cli): preserve permission CSV compatibility and diagnostics (#10208) | ||
|
|
8ea9ffc07b |
feat(mcp): add code mode to the Sim MCP server (#10204)
* feat(mcp): add code mode to the Sim MCP server * fix(mcp): stop queued code-mode calls at run end, bound error output, and type union bodies * fix(mcp): render closed empty objects as Record<string, never> * fix(mcp): render tuples and open objects in generated contract types |
||
|
|
ad8ff86014 |
feat(search): manage sources and permission uploads through the CLI (#10197)
* feat(search): manage sources and permission uploads through the CLI * fix(search): align source operations and complete CLI imports * fix(cli): preserve upload errors and support early Node 20 * fix(cli): retain structured upload errors and retry guidance |
||
|
|
708e4b2b22 |
feat(search): import large permission snapshots in bounded parts (#10191)
* feat(search): import large permission snapshots in bounded parts * fix(search): validate permission upload manifests and file inputs * fix(search): reject exhausted permission import revisions |
||
|
|
f7d1210b80 |
perf(sse): split only the newly decoded text in stream line readers (#10118)
The SSE and NDJSON line readers appended each decoded chunk to the pending line and re-split the whole buffer, so one large event (a block output of a few MB in the run stream) was rescanned and re-flattened on every chunk: quadratic in the event size. The pending remainder never holds a newline, so splitting just the new text and prefixing the first piece gives the same lines. |
||
|
|
17a38b3d24 |
improvement(credentials): hold unsaved keyless subjects so trust policies applied later still match (#10011)
* improvement(credentials): hold unsaved keyless subjects so trust policies applied later still match * fix(credentials): verify Databricks through the organization's egress, keep keyless reconnects on their mode, and harden held-subject renewal * test(credentials): save on the proof a renewal returns, and record the keyless-subject usage fence |
||
|
|
d8d7c8cc77 |
improvement(credentials): resolve agent fallback credentials once, Vanta 401 grace, true refusal codes, headless client-credential modes, and registry cleanups (#9977)
* improvement(credentials): resolve agent fallback credentials once, Vanta 401 grace, true refusal codes, headless client-credential modes, and registry cleanups * fix(credentials): name refused hosts in token responses and drop the S3 saved-credential setup flag |
||
|
|
55bacfcced |
feat(credentials): configurable audience for keyless AWS, Databricks, Snowflake, Microsoft, and Google credentials (#9962)
* feat(credentials): configurable audience for keyless AWS, Databricks, Snowflake, Microsoft, and Google credentials * fix(credentials): check the audience in the connect dialog before showing setup commands * fix(credentials): name Google's default audience in the keyless catalog hint |
||
|
|
15b2a42795 |
feat(computer-use): enable computer use by default, governed by a permission-group restriction (#9944)
* feat(computer-use): enable computer use by default, governed by a permission-group restriction Removes the mothership-computer-use feature flag. Each device still opts in under Settings > Desktop > Computer Use; enterprise admins can withhold it with the new Computer Use permission-group restriction (computer_use.use, which also follows Chat). * fix(computer-use): hide device settings until the permission group is known Also gives the local-files e2e settings fixture a QueryClient now that the Desktop page reads the permission config. * fix(computer-use): read the permission group with the lightweight query hook usePermissionConfig pulls the block and provider registries into the Desktop settings bundle; the settings gate only needs the user's resolved config. * fix(computer-use): mount the device controls only once the permission group allows them Their effects no longer call the native helper for loading or restricted members. |
||
|
|
f4dcf73b62 |
fix(credentials): Splunk password sign-in, Snowflake key pair in the CLI, Apollo OAuth people search, and one short SailPoint throttle wait (#9943)
* fix(credentials): Splunk password sign-in, Snowflake key pair in the CLI, Apollo OAuth people search, and one short SailPoint throttle wait * fix(credentials): keep a Splunk password's surrounding spaces, and report page 1 when Apollo is asked for page 0 |
||
|
|
e5af3243af |
feat(knowledge): let the S3 connector sync with a saved AWS credential (#9934)
* feat(connectors): sign S3 connector requests with a seeded AWS session The S3 knowledge connector can now sign with keys a saved AWS credential resolved to, read from the run's syncContext. STS session tokens are sent as x-amz-security-token and included in the SigV4 signed headers. A saved credential signs only for Amazon S3 in an AWS region: a custom endpoint is refused so an AWS session never reaches an S3-compatible host. Inline keys sign exactly as before. * feat(knowledge): let a key connector sync with its declared saved credential A key-based connector may now declare a saved-credential alternative (auth.savedCredential); Amazon S3 declares a saved AWS credential. A row that names a credential resolves it for the knowledge base's own scope through the same owner check and STS exchange AWS tools use, and the resolved session is seeded into syncContext. Rows that store a key keep using it, and key-only connectors are unchanged. - connectorUsesCredential/connectorHasAuthSource decide the auth source in one place for the resolver, sync engine, validation and setup. - resolveConnectorAccessToken takes the knowledge base scope. - A run token reuses an STS session until shortly before it expires and re-seeds syncContext when it is replaced. - Setup with a saved credential is gated by the global knowledge-connector-saved-credentials flag: workers from an earlier release read a key connector without a key as credential-removed and unschedule it, so the flag stays off until the release is live on the app and Trigger.dev. - The connector catalog and v2 contract gain optional savedCredential and apiKeyOnly fields; generated OpenAPI, CLI API and CLI docs updated. - Adds a central mock for @/lib/internal/aws/credentials. * feat(knowledge): offer a saved AWS credential when setting up an S3 connector When knowledge-connector-saved-credentials is on, the add-connector modal lets Amazon S3 authenticate with a saved AWS credential instead of its access keys, hides the key-only Access Key ID and custom endpoint fields, and never sends values typed into them. The edit modal keeps the credential replaceable for a connector that syncs with one, including after its credential was removed. Inline keys stay the default. * docs(knowledge): describe the S3 connector's saved AWS credential option * fix(knowledge): refuse moving a stored-key connector onto its saved credential The access update accepted a credentialId for a key connector that still stored its key. The key stayed on the row and took over again, silently, once the credential was deleted. Switching auth source now means creating the connector anew, as it did before saved credentials. * fix(knowledge): classify saved AWS credential failures and labels consistently - Share the AWS failure message and transient check with the AWS tools, so STS throttling or an IdP outage during setup is no longer a 400. - Refuse another service's credential on S3 creation, as access updates do. - Return an empty access token for a saved AWS credential, not its id. - Record saved-credential connectors as authMode savedCredential in audit. - Narrow savedCredential.provider to aws, the only provider that resolves. - Derive create's key-vs-credential choice from connectorUsesCredential and rename the run-token refresh. * fix(connectors): sign saved AWS credentials only for commercial and GovCloud S3 China regions serve S3 under amazonaws.com.cn and the isolated partitions under their own domains, so a saved credential for them failed with an opaque DNS error. Refuse them with a clear message instead. * docs(knowledge): state saved-credential availability and rollback limits Catalog and connector credentialId descriptions say saved credentials work once the deployment enables them, the connector credentialId field covers saved credentials, and the flag notes that a release rollback is unsafe once any connector uses one. Regenerates OpenAPI, CLI API and CLI docs. * fix(knowledge): redact saved AWS session secrets and share the credential service check A saved AWS credential resolves to an empty bearer with its secret key and session token in awsSession, so redacting accessToken alone left them in provider validation text. Both validation sites now redact every secret the resolved token carries (connectorTokenSecrets). Setup and access updates now share requireConnectorCredentialService, so a key connector's saved-credential setup refuses a missing service config instead of skipping the provider check. * fix(knowledge): keep long-lived saved AWS keys per run and gate saved-credential edits on rollout - Reuse a saved AWS credential without a session token for the whole run instead of reloading it on every page and hydration - Hide the edit form's saved-credential replacement while saved-credential setup is disabled, matching the server gate - Classify a connector whose credential service has no config as internal, not caller-fixable - State in the v2 catalog that apiKey connectors with savedCredential accept credentialId * docs(knowledge): describe the saved-credential provider as a service, not an OAuth service * test(llm): mock AWS credentials through the central @sim/testing mock |
||
|
|
d5e98fac3c |
feat(credentials): regional and instance hosts for saved LaunchDarkly, LangSmith, New Relic, Square, SendGrid, Hex, and Sentry credentials (#9926)
* feat(credentials): add defaulted region fields to token credentials and LaunchDarkly EU and federal instances A token credential's connection field can now declare a fixed option set (rendered as a dropdown) and a default value. The default is what a create that omits the field gets, and what a credential saved before the field existed resolves to, so existing credentials and API callers keep the host they always used. A reconnect that leaves the field blank keeps the stored value instead of falling back to the default. LaunchDarkly is the first provider to use it: the access token is checked at, and every LaunchDarkly tool sends it to, the commercial, EU (app.eu.launchdarkly.com), or federal (app.launchdarkly.us) instance it was created in. Runs without a saved credential keep the commercial host. * feat(langsmith): verify and run saved LangSmith keys in their region A LangSmith API key only authenticates in the region its organization lives in. The saved credential now carries that region (GCP US by default, or GCP EU, GCP APAC, AWS US, or Azure US), and the key check and every LangSmith tool use its documented API host. Credentials saved before, and runs without a saved credential, stay on api.smith.langchain.com. * feat(new-relic): add the JP data center to saved keys, tools, and the legacy block New Relic now documents a Japan region whose NerdGraph endpoint is api.jp.newrelic.com. Saved User API keys can be verified and run there, the tools route jp to it, and the legacy block's region dropdown offers it. The saved key's region field is now a dropdown. Unknown region values still fall back to the US endpoint, as workflows saved before regions expect. * feat(square): verify and run saved Square tokens in the sandbox Square credentials and resources of one environment cannot be used in the other. The saved credential now carries its environment (production by default, or sandbox), and the token check, every Square tool, and the catalog image upload operation call connect.squareup.com or connect.squareupsandbox.com accordingly. Credentials saved before, and runs without a saved credential, stay on production. * feat(sendgrid): verify and run saved keys of EU regional subusers on the EU host SendGrid serves regional subusers in the EU from api.eu.sendgrid.com. The saved credential now carries its region (global by default, or eu), and the key check, every SendGrid tool, and the mail send operation use that host. Credentials saved before, and runs without a saved credential, stay on api.sendgrid.com. The connect modal notes that Marketing Campaigns actions are not available to EU subusers. * feat(hex): verify and run saved Hex tokens on the workspace's hex.tech host Hex serves EU multi-tenant, HIPAA multi-tenant, and single-tenant workspaces from their own hex.tech host instead of app.hex.tech. The saved credential now carries that host (app.hex.tech by default), accepting only a single label under hex.tech so a token is only ever sent to Hex, and the token check and every Hex tool use it. Credentials saved before, and runs without a saved credential, stay on app.hex.tech. * test(credentials): type the regional host tests and keep region option types module-private * feat(sentry): verify and run saved Sentry tokens in their data storage region Sentry serves organizations whose data is stored in the EU from de.sentry.io, and its organization list is per region. The saved credential now carries its region (us by default, or de), and the token check and every Sentry tool call sentry.io or de.sentry.io accordingly. Credentials saved before, and runs without a saved credential, stay on sentry.io. * feat(credentials): report a defaulted region field's default in the provider catalog The v2 provider catalog marked a defaulted region, instance, or host field optional without saying what it defaults to. Each field now carries an additive optional defaultValue, and the OpenAPI document and CLI client are regenerated. * docs(square): say a saved credential can hold a sandbox access token * fix(credentials): keep default-region token credentials as they were and share region definitions - A credential on its provider's default region or host keeps the bare service display name, and a vendor region host that fails to resolve is reported as the vendor being unavailable, not a typed host that was not found. - defaultValue is honored on the domain field only; providerWorkspaceId keeps its required, non-defaulted handling everywhere, so a blank reconnect can never reset it. - One defineCredentialRegions factory now holds each vendor's region ids, hosts, labels, default, API base, and hidden tool param (LaunchDarkly, LangSmith, New Relic, SendGrid, Sentry, Square); the internal SendGrid and Square schemas validate against it, and the New Relic descriptor and block take their options from it. - One isTokenServiceAccountFieldRequired predicate replaces the inline defaulted-is-optional checks. - Hex refuses its known non-workspace hex.tech labels (status, learn, docs, www, help, community, blog), and the pattern's comment no longer claims more than it guarantees. - Drops a mock-only and two pass-through tests; adds Sentry to the default-region tables. * test(credentials): guard a named reconnect region against the stored one Fold the named-region reconnect case into the blank-reconnect table as a contrast row on a credential stored in eu, so it fails if a reconnect always keeps the stored region. * test(credentials): drop the repeated mock reset in the legacy region tests |
||
|
|
3e5200f93f |
feat(apollo): add optional OAuth connections (#9922)
* feat(apollo): add optional OAuth connections * fix(apollo): gate OAuth setup on client availability * fix(apollo): respect workspace policy for OAuth setup |
||
|
|
d87daa7103 |
fix(api): report a finished run's real status once its pauses have settled; show the request id in the CLI (#9924)
* fix(cli): show the server's request id on API errors * fix(api): report a finished run's status once none of its pauses can be resumed * fix(cli): keep the request id on every error built from a response * fix(cli): read an internal route's request id beside the error |
||
|
|
f947d95a8f |
feat(credentials): audit fixes and non-OAuth auth for CrowdStrike, Datadog, Gong, PlanetScale, SailPoint, ServiceNow, Zendesk, ZoomInfo, Shopify, Atlassian, Linear and Twilio (#9911)
* fix(credentials): accept permission-scoped AgentMail keys at connect
A valid AgentMail key that lacks inbox_read or is scoped to a pod or inbox
gets a 403 coded missing_permission or forbidden on the inbox listing, and
was refused as invalid. Accept a coded 403 as proof of the key, and keep
rejecting the gateway's bare Forbidden and the key-naming 401 codes.
* fix(credentials): offer Atlassian API tokens for the Bitbucket saved credential
Bitbucket takes an Atlassian API token created for Bitbucket as a Bearer
token, so the existing repository read already verifies one. Say so in the
connect copy and setup guide, and note that app passwords no longer work.
* fix(credentials): ask for a reconnect when a Microsoft app certificate can no longer sign
An expired or unreadable stored certificate failed before any request reached
Entra, carried no status, and was reported at run time as the provider being
temporarily unavailable (502). Local configuration failures now classify as
invalid_credentials, and only an unreachable Entra keeps provider_unavailable.
Saving also refuses a certificate that is not valid yet.
* fix(credentials): warn that saved Infisical access tokens expire
Sim stores the machine identity access token as pasted and never renews
it, so it stops at its Access Token TTL (30 days by default). Tell users
to set a long TTL and Max TTL, and not an Access Token Period, which needs
renewal each period.
* fix(credentials): retry keyless Microsoft token requests while a federated credential propagates
Entra can refuse a new federated identity credential with AADSTS70021 for
several minutes after it is added, even after a token was issued, and
Microsoft asks callers to retry. A run now retries that refusal (and
AADSTS700213) twice with jittered backoff before reporting it; the save-time
subject-pin probe, which expects the refusal, is unchanged.
* fix(infisical): keep the instance URL out of the model's reach and normalize it like a saved credential
The legacy Infisical tools let the model set baseUrl, so a prompt-injected
agent call could send the inline Infisical token to any public host. baseUrl
is now user-only (matching Grafana and Upstash), and inline instance URLs go
through the same normalizer the saved-credential validator stores, which moves
from the validator module into input-validation so tools can share it.
* feat(credentials): accept HubSpot service keys for the saved HubSpot credential
HubSpot stopped new legacy private apps on October 26, 2026 and points
direct integrations at service keys, which are Bearer tokens for the same
REST APIs. The connect copy now asks for a service key or an existing
private app token. The token-info route covers only private apps, so a
non-transient refusal there defers to the Account Information API, and that
fallback accepts a 403 only with a JSON body, so a firewall page never
passes as a live token. Both checks refuse redirects.
* feat(credentials): accept Microsoft app credentials for Intune
Every Intune operation the block offers (managed devices, detected apps,
compliance policies and their device statuses, device configurations, and the
sync, restart, remote lock, and retire actions) documents application
permissions in Microsoft Graph v1.0, so the Intune picker now lists Microsoft
app credentials and the resolver mints a Graph token for them. OAuth Intune
connections are unchanged. The setup docs name the application permissions
each operation needs.
* fix(credentials): refuse rotating Slack tokens for custom bot credentials
A Slack app with token rotation on issues xoxe.-prefixed tokens that expire
in 12 hours and can only be refreshed with the app's client ID and secret,
which Sim never holds. Such a token passed auth.test at connect and failed
every run after. Refuse xoxe tokens up front with a message that asks for
the xoxb- token of an app with rotation off.
* docs(credentials): correct the Devin key check comment to match Devin's docs
Devin documents 401 for an invalid key and one 403 for both a key outside
the organization and a key without ViewOrgSessions. Behavior is unchanged:
nothing documented separates the two 403s, so a 403 still rejects.
* fix(credentials): refuse redirects in every per-vendor saved-key check
The shared token-check engine already refuses redirects, but the per-vendor
validators followed them. Fetch keeps custom headers such as x-api-key and
X-Shopify-Access-Token on a cross-origin redirect, so a redirected check
would hand the key to another host. Every per-vendor check now refuses a
redirect, which surfaces as the provider being unavailable.
* fix(credentials): treat a Webflow token that reaches no site as the user's error
GET /v2/sites lists every site the token can access, so an empty list is a
token the user must replace, not a retryable outage. A token that reaches
several sites is no longer pinned to whichever site the list returns first.
* feat(credentials): pick and connect Google service accounts for Vertex AI
The Vertex AI runtime already resolves Google service account credentials,
keyless or JSON key, but the Google Cloud Account picker on model blocks only
listed OAuth accounts, so a saved service account could be used only by
pasting its ID in advanced mode. Vertex AI now names google-service-account
as its service-account provider, and its picker lists both kinds with a
connect action for each, so the keyless option is offered for Vertex.
Existing OAuth selections and the advanced credential ID field are unchanged.
* fix(copilot): let Copilot pass a saved credential to hybrid tools
Copilot's integration schema only offered credentialId for tools that require
OAuth, so a tool that takes an inline key or an optional saved credential always
demanded the inline secret and the gateway never forwarded a saved credential.
On the copilot surface those tools now declare an optional credentialId and stop
requiring the params a saved credential supplies; the workflow surface and
OAuth-required tools are unchanged. The executor now rejects a Copilot call to
such a tool that sends neither, instead of calling the provider without a key.
* fix(credentials): report a NerdGraph error answer as New Relic being unavailable
New Relic refuses an unknown or wrong-region User key with a 401, so a 200
whose errors array left the fixed actor query unanswered is NerdGraph
failing, not a verdict on the key. Report it as provider_unavailable
instead of telling the user their key is wrong. A 200 with no user and no
errors still rejects.
* fix(aws): refuse S3 presigned URLs that outlive the saved role session signing them
A presigned URL signed with STS credentials stops working when the role session
ends, whatever expiry it asks for, but the S3 tool reported the requested expiry.
Resolved sessions now carry the STS expiration, and presigning with a saved
assume_role or oidc_role credential refuses an expiry past the session's end
with a 400 that names the remaining time and the session duration. Long-lived
access keys and inline keys are unchanged.
* fix(guardrails): resolve the hallucination check's Vertex credential like every other model call
The hallucination check looked the Vertex credential up as a raw account ID,
so a saved credential (whose ID is a credential row, OAuth or Google service
account) resolved no token and the scoring call ran without one. It now uses
the shared Vertex resolver, which handles credential rows, Google service
accounts, and the legacy account IDs the old lookup accepted, and fails the
check instead of calling the model when the credential cannot be resolved.
* fix(aws): report transient STS failures on a saved credential as 503, not a denial
Every failure to resolve a saved AWS credential came back as a 403, so an STS
outage, throttling, or STS failing to reach Sim's OIDC issuer (IDPCommunicationError)
read as a permission problem and was never retried. Failures STS models as
retryable, throttling, STS 5xx, and network errors now return 503; real denials
(AccessDenied, invalid or expired identity tokens, rejected claims) stay 403.
No extra retry loop is added: the pinned STS client already retries
IDPCommunicationError and throttling up to three times with backoff.
* fix(databricks): report an unreachable workspace at token mint as provider_unavailable
A connection failure, timeout, or refused redirect while minting a run's
Databricks token escaped as a raw fetch error, which the executor reported as a
generic 401 and whose cause can carry connection details. It is now a 502
DatabricksCredentialError, which resolves to provider_unavailable; a cancelled
run still rethrows its abort, and personal access tokens are unaffected.
* feat(credentials): connect Shopify Dev Dashboard apps with client credentials
Shopify Dev Dashboard apps never reveal an Admin API token, so the Shopify
saved credential gains a client-credentials mode beside the pasted shpat_
token. A credential saved with authMethod client_credentials stores the
client ID, secret, and store domain; execution mints the 24-hour token at
the store's /admin/oauth/access_token endpoint.
Shopify does not document whether a new token retires earlier ones, so
every saved credential for one app and store shares a single token kept
under an advisory lock in client_credential_token, instead of minting per
worker. shop_not_permitted surfaces as grant_not_permitted with copy that
names the same-organization requirement.
Pasted-token credentials, their blob, and their resolution are unchanged;
the minted-token cache in the credential service is factored out so the
client-credential providers and this mode share it.
* fix(credentials): keep keyless off when a pinned workload identity issuer has an unserved path
Sim serves workload identity discovery and keys only under /oidc/workload, and
clouds fetch <issuer>/.well-known/openid-configuration, so a WORKLOAD_IDENTITY_ISSUER
with any other path advertised keyless credentials that no cloud could verify. A
pinned issuer must now have the /oidc/workload path (its host may differ), or
keyless stays off with a log line naming the requirement. The default issuer
derived from the app URL is unchanged, and the self-hosting and AWS credential
docs state the requirement.
* feat(credentials): saved CrowdStrike API client credential and credential-only block
A CrowdStrike credential holds a Falcon API client id and secret, the cloud
(from the existing Falcon cloud allowlist), and an optional MSSP member CID.
The minter posts them to the cloud's /oauth2/token with redirects refused and
returns the token with its expires_in lifetime (30 minutes when unusable)
and the cloud, which the credential cache keys by credential id and secret
fingerprint, so changing the cloud or secret re-mints.
- clientCredentialOAuth: a policy for tools that mint their own token from
inline client credentials. The credential fills the hidden accessToken and
the region param; tokenReplacesParams names the inline secrets the token
replaces, and the saved-credential contract check accepts exactly those.
- crowdstrike_v2 is the credential-only successor; the legacy block keeps
its inline client id, secret, and cloud and is hidden from the toolbar.
- The operation uses a credential's token as is. Inline credentials now
reuse a cached token (keyed by cloud, client id, and secret hash) until a
minute before it expires, and a 401 drops it so the next run re-mints.
- Client-credential mints can bind a domain (the cloud), carried through
the token cache to tools.
* fix(credentials): accept only documented scoped-key answers from AgentMail and New Relic
AgentMail now proves a key only on the two 403 codes its docs give for a
valid key with the wrong scope (missing_permission, forbidden); a suspended
account, a gateway deny, and any other refusal reject the key.
New Relic reports an outage only for NerdGraph errors in the server classes
its own client retries; BAD_API_KEY and unclassified errors reject the key.
* fix(credentials): settle HubSpot service keys on the account-info route
A token-info 200 without a portal now falls back to account-info instead of
failing as an outage, and a token-info 401 falls back only for pat- keys, so
other tokens keep being rejected there as before. The vendor-JSON 403 check
moves to one shared helper.
* docs(credentials): align HubSpot, Infisical, and Bitbucket saved-key copy with vendor docs
* feat(credentials): saved Zendesk credentials with client credentials or an API token
Zendesk gets a zendesk-service-account credential with two sign-ins: a
confidential OAuth client exchanged through the client-credentials grant
(POST /oauth/tokens, JSON, an explicit read or read write scope, a one-hour
expires_in), or an agent email and API token sent as the documented
email/token Basic credential. The subdomain is normalized and must match
^[a-z0-9][a-z0-9-]*$ before any request, and connecting requires
users/me to answer with a real (non-anonymous) agent or admin.
The credential resolves to its token, its subdomain as domain, and
authStyle basic for the API-token sign-in. zendesk_v2 is the
credential-only successor; every Zendesk tool reads the token through one
header helper and takes its subdomain from the credential. The legacy
zendesk block and its inline email, API token, and subdomain keep signing
in exactly as before.
* feat(credentials): PlanetScale saved service token credential
A PlanetScale credential holds a service token and its ID, verified by
listing the organizations the token reaches with the same ID:token
Authorization the tools send; a JSON 403 is a valid token without that
read. Every PlanetScale tool accepts it, the selectors gain saved-credential
twins that read the pair from the credential, and planetscale_v2 is the
credential-only successor. The legacy block keeps its inline inputs.
* feat(credentials): Gong saved access key credential
A Gong credential holds an access key and its secret, verified by listing
workspaces on api.gong.io with the Basic key:secret the tools send. Gong
documents its 403 for this read without telling a bad key from a missing
permission, so any refusal rejects. Every Gong tool accepts the credential
and gong_v2 is the credential-only successor; the legacy block keeps its
inline inputs.
* feat(credentials): ServiceNow saved username and password credential
A ServiceNow credential holds an instance, a username, and its password,
verified by reading one user id from the Table API with the Basic auth the
tools send. The instance is reduced to the https origin of a
ServiceNow-owned host before anything is sent, and the check goes through
the guarded egress; 401 rejects, a JSON 403 is a login its ACLs limit, and
only a Table API result list proves the login. Every ServiceNow tool
accepts the credential, servicenow_v3 is the credential-only successor, and
servicenow and servicenow_v2 keep their inline inputs as legacy blocks.
* feat(credentials): Twilio API key mode for the saved Twilio credential
The Twilio credential and every Twilio tool now also take an API key, as
the key SID and secret joined by a colon (SKxxx:secret), the exact Basic
username and password Twilio documents for a key, while the URL keeps the
Account SID. A key is verified by listing one of the account's phone
numbers, a read a Standard key may make, since only Main keys and auth
tokens may read the Accounts resource. Stored auth-token credentials and
inline auth tokens keep their shape and their account-resource check; a
value with a colon that is not a key pair is refused before any request.
* fix(credentials): retry only the documented Entra propagation refusal, within the shared mint deadline
AADSTS700213 is Microsoft's documented case-sensitive federated credential
mismatch, not a propagation refusal, so a mismatched keyless credential no
longer makes three token requests per run. The AADSTS70021 retries now stop
when a slow answer would push the run past the 30 s deadline that concurrent
runs sharing the mint wait for. The Microsoft app service list is declared
once for both its type and the resolver's check, and the Intune and Vertex
copy names the app credential and the Google service account.
* feat(credentials): Atlassian service-account OAuth 2.0 credentials
An Atlassian service account can now connect with its OAuth 2.0
credential (client ID and secret) as well as a scoped API token. Saved
with authMethod client_credentials, the credential stores the client
credentials, the site, its cloudId from tenant_info, and the product;
execution mints a 60-minute token at auth.atlassian.com with the client
credentials grant and calls api.atlassian.com/ex/{product}/{cloudId}
exactly as a scoped token does. Connecting proves the minted token
against the product's current-user endpoint.
Atlassian documents these credentials for Jira and Confluence only, so
other products are refused. It does not say whether a new token retires
earlier ones, so every saved credential for one OAuth client shares one
coordinated token. Scoped-token credentials, their blob, and their
resolution are unchanged; the identity request now refuses redirects.
* feat(credentials): saved Datadog API and application key credential and credential-only block
A Datadog credential holds the site (from the DATADOG_SITES allowlist), the
API key, and the application key. Datadog authenticates every request with
the two static headers, so the "mint" resolves the API key as the token, the
application key beside it, and the site as the credential's domain.
- Save verifies the API key with GET https://api.{site}/api/v1/validate,
sending DD-API-KEY alone, redirects refused: 403 is invalid_credentials,
and a 200 must report valid: true. The application key is not probed:
Datadog publishes no reference for an application-key check, and any other
read would reject a correctly scoped key with a permission 403. Keys with
control characters or whitespace are refused before any request.
- Credential resolution carries a new applicationKey field (credential
cache, token payload contract, executor credentialParams source), and the
Assistant registers it as a resolved secret beside the token.
- Every Datadog tool takes the saved credential: the credential fills apiKey,
applicationKey (where the tool sends it), and site, overriding caller values.
- datadog_v2 is the credential-only successor; the legacy block keeps its
inline keys and site and is hidden from the toolbar. withSavedCredential
accepts condition: null for a picker shown in every operation when the
replaced fields show differently.
* fix(aws): bound S3 presigned URLs by the role session's duration, not its time left
The presign guard compared the requested expiry with the seconds left before the
STS session ended, floored. A session is minted for each call, so by the time the
guard runs the STS round trip has used part of it and a default 3600s session
reports 3599s left, which refused the default 3600s expiry for every saved
assume_role or oidc_role credential on default settings.
Resolved sessions now carry the duration Sim requested from STS, and the guard
refuses only an expiry longer than that duration. The reported expiresAt is
clamped to the session's end, so it is never later than the time the URL stops
working. The session lookup that the signer and the guard share is one helper.
* fix(aws): classify wrapped STS socket failures as transient with the shared network-error helper
isTransientAwsFailure kept its own list of socket codes and checked only the top-level code, so a socket failure the SDK request handler wrapped in a cause, or an undici code, was reported as a 403 denial instead of a 503. It now uses isRetryableNetworkError, which walks the cause chain and errno.
* feat(credentials): connect Linear OAuth apps with client credentials
The Linear saved credential gains a client-credentials mode beside the
personal API key. Saved with authMethod client_credentials, it stores the
app's client ID and secret and mints an app-actor token at
api.linear.app/oauth/token with the fixed scope read,write, so two
credentials for one app never request different scopes (which Linear
treats as replacing the app's tokens). Linear documents that tokens with
the same scopes coexist, so each worker caches its own, and a token is
reused for at most an hour so one revoked early is replaced quickly.
A client-credentials token acts as the app, so connecting falls back to
the workspace (organization.id) as the principal when Linear returns no
viewer. The connect copy warns that requesting a token replaces an
existing authorization-code installation of the app and that rotating
the secret invalidates its tokens. Personal API keys and Linear OAuth
credentials are unchanged.
* fix(credentials): warn instead of turning keyless off for a pinned issuer on another path
Refusing a pinned WORKLOAD_IDENTITY_ISSUER whose path was not exactly
/oidc/workload turned keyless off on upgrade for a deployment that routes a
different issuer path to Sim through a proxy, and it also refused pinning the
default issuer of a path-prefixed app URL, which the default itself accepts.
Trust policies name the issuer, so those operators could only recover by
recreating the identity provider and every trust policy.
A pinned issuer whose path ends in /oidc/workload is now accepted the same way
the default is. Any other path logs a warning that clouds can verify its tokens
only if a proxy routes it to /oidc/workload; saving a keyless credential still
proves the route end to end. The https, port, query, and fragment refusals are
unchanged, and the docs describe the rule.
* fix(copilot): exempt a hybrid tool's key only when the hosted key applies to the call
The Copilot credential check waived a hybrid tool's hosted key param whenever the deployment was hosted, but injectHostedKeyIfNeeded skips the hosted key when the tool's hosting.enabled predicate rejects the params, so such a call could reach the provider with neither a key nor a saved credential. Both now use one hostedKeyMayFill predicate. No hybrid tool declares hosting today, so this is latent.
* fix(databricks): stop repeating 'Try again' when the save-time probe cannot reach the workspace
The unreachable-workspace error ended in 'Try again.', and the federation-policy check that wraps it adds its own, so a save showed 'Try again. Try again.'. The low-level message now only names the failure.
* fix(credentials): refuse redirects by default in fetchProvider
Every fetchProvider caller sends a secret, and fetch replays custom headers
and 307/308 bodies to whatever host a redirect names. Default the helper to
redirect: 'error' so validators and client-credential mints inherit it, and
drop the per-call copies this branch had added.
* fix(credentials): settle a HubSpot key account-info refuses with a contacts read
HubSpot documents service keys only against its CRM REST routes, not the
token-info or account-info routes. When account-info answers 401, confirm
on a one-contact read, where a 200 or JSON 403 proves the key is live and a
401 rejects it.
* test(security): move the typed base URL normalizer test next to input-validation
normalizeHttpBaseUrl and refuseUnsafeTypedUrl moved from the token validator module into input-validation; their test now lives with them.
* feat(credentials): saved SailPoint API client credential and credential-only block
A SailPoint credential holds a tenant plus an API client or personal access
token client id and secret. The minter shares the legacy block's token
exchange (now requestSailPointToken in lib/internal/sailpoint/client: the
client_credentials grant at the tenant's /oauth/token, redirects refused,
bounded 429 retries, and a SailPointAuthError carrying the status), so 4xx
maps to invalid_credentials and 5xx, throttling, or network failures to
provider_unavailable. The token lifetime comes from expires_in.
- The tenant is normalized to {tenant}.api.identitynow.com, the host
SailPoint documents for API and token calls, from a tenant name, the API
host, or the tenant's UI URL. Anything else (other domains, credentials,
ports, more than one tenant label) is refused before the secret is sent.
The legacy block's inline tenants, including identitynowgov.com hosts,
are unchanged.
- The credential fills the hidden accessToken and the tenant (its API host);
the operation sends that token as is and never re-mints it on a 401.
Inline credentials keep their cached token and single 401 refresh.
- sailpoint_v2 is the credential-only successor; the legacy block keeps its
inline tenant, client id, and secret and is hidden from the toolbar.
* feat(credentials): saved ZoomInfo client credentials and credential-only block
A ZoomInfo credential holds a client credentials app's client id and secret.
The tools already authenticate with that grant (Basic auth at
api.zoominfo.com/gtm/oauth/v1/token), so the minter shares the legacy
block's exchange, now requestZoomInfoToken: a refusal throws
ZoomInfoTokenError, which the operation answers exactly as before (HTTP 500
naming the provider status) and the minter maps to invalid_credentials for a
4xx or provider_unavailable for throttling, 5xx, or network failures.
- Save verifies by minting a token only; the token endpoint uses no credits
and no data endpoint is called. Granted scopes are recorded as metadata.
- A client id with a colon or control characters is refused before any
request, since it would corrupt the Basic credential.
- The token exchange and API calls refuse redirects (maxRedirects: 0); both
go only to the fixed api.zoominfo.com host.
- The credential fills the tools' hidden accessToken, which replaces the
inline client id and secret; zoominfo_v2 is the credential-only successor,
and the legacy block keeps its inline credentials and is hidden from the
toolbar. Search filters named like hosts are recorded as request data in
the saved-credential contract check.
* refactor(gong): share one Basic auth header builder between the tools and the credential check
* fix(credentials): stop accepting an undocumented PlanetScale 403 as proof of a service token
PlanetScale documents 401 for a bad token and 404 for missing access, but gives no meaning to a 403 from listing organizations, so a JSON 403 now rejects like any other refusal. The token ID is checked in the account-id normalizer with the same printable, colon-free rule the tools' header builder applies.
* test(credentials): prove refused saved-credential hosts never reach the guarded egress fetch
The steer cases asserted only on the global fetch stub, but ServiceNow sends through the guarded egress transport, so its 'before sending the key' half never ran. Both transports now answer, so only the refusal can keep the key unsent.
* fix(credentials): tell ServiceNow and Gong users which hosts the saved credential supports
ServiceNow custom URLs are aliases of the instance's original service-now.com address, so the help text points custom-URL tenants there; on-premises instances are named as unsupported. Gong's help text names the fixed api.gong.io host the tools call.
* docs(credentials): document the in-band Twilio API key form and hint a half-entered key pair
The saved Twilio credential keeps an API key in the auth-token field as SKxxx:secret, Twilio's documented Basic username and password for a key. The provider id now records that choice and warns that a consumer needing the account auth token itself, such as webhook signature validation, must refuse a key pair. The connect form shows a hint while an SK value is not a complete SID:secret pair.
* fix(credentials): share the CrowdStrike token exchange and report a wrong Falcon cloud
- Legacy inline tokens are also dropped on a 403, so a scope granted after a
failed run applies on the next one, as it did before tokens were cached.
- The saved-credential minter and the legacy path call one exchange,
requestCrowdStrikeToken; the legacy path keeps following redirects.
- The minter never follows a redirect and reports one as invalid_credentials
naming the API client's cloud from X-Cs-Region, instead of a provider outage.
- Drop the unused instanceUrl param and cap a saved-credential accessToken.
* fix(credentials): expire shared client-credentials tokens the provider rejects
A token served from the shared client_credential_token row was never expired
early, so a Shopify or Atlassian token revoked before its stated expiry kept
being served, and reconnecting with the same secret got the same dead token.
- invalidateCoordinatedClientToken expires exactly the rejected token
- saving or reconnecting re-mints once when the provider rejects the served token
- a 401 from a tool call on a service-account credential expires the token
- expired failure memos are swept by the shared coordinator, which Vanta now reuses
- drop the Atlassian product check that could never refuse anything
* fix(credentials): report a mistyped SailPoint tenant as not found and share site lists
- A SailPoint tenant host that does not resolve (ENOTFOUND) is site_not_found,
not a provider outage; a transient resolver failure stays provider_unavailable.
- The tenant normalizer refuses `api`, SailPoint's own API domain, in every
input form instead of minting at api.api.identitynow.com.
- Datadog site labels and the isDatadogSite guard live once in tools/datadog and
serve the block, the connect modal, and the minter; CrowdStrike cloud labels
derive from the cloud ids.
* fix(credentials): drop the unverified ZoomInfo token-credits claim and cap saved tokens
ZoomInfo's client-credentials docs do not say whether a token request uses
credits, so the docs and comments describe only what Sim does: connecting
requests a token and calls no data endpoint. A saved-credential accessToken is
capped at 16 KiB like SailPoint's.
* fix(credentials): share one Linear client-credentials token per app
Linear asks clients to reuse a token until shortly before it expires and to
request a new one after a 401, and caps an app at 1,000 tokens per workspace
through cleanup. Each worker minted a new 30-day token every hour instead.
Linear now goes through the coordinated token for its full lifetime, and the
401 path replaces it early; every token grant now coordinates, so the grant
registry maps providers straight to minters.
* fix(credentials): keep a credential's client-credentials mode on reconnect
A reconnect that sent only a new client secret for a Shopify, Linear, or
Atlassian client-credentials credential was routed to the pasted-token
builder and failed. The stored mode now carries forward unless the reconnect
sends a token. The connect modals no longer preselect a mode on reconnect, so
the admin restates it instead of silently switching modes.
* docs(credentials): align Zendesk, Linear, and Shopify copy with vendor docs
- mark Zendesk API tokens as deprecated by Zendesk in the picker, hint, and docs
- warn that a Linear client-credentials request with other scopes revokes tokens
- say where Shopify's 24-hour token is kept instead of claiming it is never stored
- reword comments that stated undocumented Linear and Zendesk behavior as fact
* fix(credentials): drop exports that only their own module uses
* fix(credentials): keep shared tokens on scope 401s and rate-limit tool-call expiry
A 401 whose body reports a scope mismatch (Atlassian's 'Unauthorized; scope
does not match', RFC 6750 insufficient_scope) comes with a valid token, so it
no longer expires the application's shared token. A tool-call rejection also
leaves a token minted within the last minute in service, so a call that keeps
failing re-mints at most once a minute. Connect-time identity proofs still
expire a rejected token unconditionally.
* fix(credentials): replace the shared Linear client-credentials token daily
Linear tokens live 30 days, but a revocation that does not surface as a 401
would otherwise keep a dead token in service until then. Same-scope tokens
coexist, so a daily replacement leaves in-flight calls valid.
* chore(credentials): regenerate block successors, tool metadata, deployment config, integration docs, OpenAPI and CLI API for credential auth wave 2
* test(credentials): drive the slow Entra answer from the propagation suite's fake clock
* fix(credentials): declare the Zendesk email and API token as replaced by the saved credential's token
* test(credentials): wait for the slow Entra answer with the shared sleep helper
* fix(crowdstrike): mint a new token for each legacy inline request again
The inline token cache held a Falcon token for up to 29 minutes, so a token
Falcon had since revoked or rescoped failed the next run. Legacy blocks mint
per request as they did before the saved credential.
* fix(credentials): drop a saved client-credential token a provider refuses
Internal operations such as CrowdStrike and SailPoint answer 401 or 403
when the provider refuses a saved credential's token. The executor now
drops that token from the per-instance cache so the next call mints a
replacement instead of reusing it until it nears expiry.
* test(credentials): serve the stored coordinated token until it is invalidated
The coordinated-token mock minted on every call, so the revoked Atlassian
token test passed with the invalidation removed. The mock now keeps one
token per application until invalidated.
* refactor(credentials): share one client-credentials token exchange
Atlassian, Linear, and Shopify each carried the same form POST, refusal
mapping, payload check, and lifetime cap. They now call one
exchangeClientCredentialsGrant, tested once, and keep only their URL,
extra fields, lifetime cap, and Shopify's refusal classifier.
* fix(credentials): read and decrypt a client-credentials secret once per resolution
Token providers and Atlassian read and decrypted the stored secret to pick
its mode, then read and decrypted it again to mint. The mode read now
carries into the mint, and both blob parsers share one mode check.
* refactor(credentials): share the credential-text check across minters
Fivetran, ZoomInfo, and Datadog each carried the same empty, control
character, and size check. They now call one assertCredentialText, with
Datadog also refusing spaces.
* refactor(zendesk): encode the API-token Basic credential in one place
The saved-credential minter and the tools each built the
{email}/token:{apiToken} Basic value. Both now call
zendeskApiTokenCredential, so the saved and inline sign-ins cannot differ.
* refactor(tools): declare the saved-credential token param once
CrowdStrike, ZoomInfo, and SailPoint tools each repeated the hidden
accessToken param a saved credential fills. They now use
savedCredentialTokenParam, with the same descriptions.
* fix(tools): name a missing credential field without naming Datadog
The generic credential-field labels named Datadog for applicationKey, so
any other tool mapping it would blame a Datadog key. Labels now carry
their article and stay provider-neutral.
* fix(security): redact Datadog application keys in logged inputs
No key-name pattern matched applicationKey, so a key typed into the
legacy Datadog block showed in plaintext in execution input logs.
* fix(credentials): match the Atlassian OAuth 2.0 hints to what Atlassian supports
In client-credentials mode the Jira client ID hint said one credential
covers Jira Service Management, which Atlassian does not list for OAuth
2.0 credentials. It now points Service Management at a scoped API token.
Also corrects the reconnect note on clientCredentials.preferred.
* refactor(credentials): share the client ID and secret fields across connect forms
The Atlassian and token-provider forms each built the client-credentials
fields, and only one labelled its secret input for assistive tech. Both
now render ClientCredentialsFields.
* docs(credentials): describe the saved credentials on their setup-guide pages
The PlanetScale, ServiceNow, Gong, and Twilio pages are the connect
modal's setup guides but still described only the legacy inline inputs.
Each now says how to add the credential, the hosts it accepts, and that
earlier blocks keep their inline values. SailPoint v2 names both the PAT
and the client-credentials API client.
* test(credentials): mock credential-service through the central @sim/testing mock
* fix(sailpoint): accept government tenant hosts on the saved credential, as the earlier block does
* fix(servicenow): accept custom and self-hosted https instance URLs on the saved credential, as the earlier block does
* fix(credentials): type the new test fixtures, unexport file-local types, and regenerate CLI docs
* fix(credentials): drop refused local tokens, keep exact ServiceNow passwords, and refuse non-http URL forms
- Forget a client-credential token cached on this instance when an external
request answers 401, alongside expiring the coordinated token.
- Add preserveWhitespace to token descriptor fields; ServiceNow passwords keep
their surrounding spaces through the connect form, contracts, and builder.
Contracts no longer trim apiToken; Atlassian and GitLab builders trim it.
- Refuse any scheme other than http(s), and protocol-relative or backslash
authorities, in the shared typed-URL helpers while bare host:port still works.
- Refuse client-credentials extra fields that would replace grant_type,
client_id, or client_secret.
- Report a Datadog validate answer without a boolean valid field as a provider
fault rather than invalid credentials.
* fix(credentials): report an aborted grant refusal as the abort, and keep the CrowdStrike cloud required
* fix(credentials): name a dropped connection separately from a malformed token response
|
||
|
|
5bbf4e748b |
feat(api): failing block on polled runs, deployed input schema, paused-runs list, and applied limits (#9906)
* feat(api): attribute polled run failures, deployed input schema, paused-run list, and applied run limits
- GET /v2/workflows/{id}/runs/{runId} reads the failing block back from the run's
recorded trace, withheld when the viewer's permission group hides execution data
- GET /v2/workflows/{id} adds inputSchema for the active deployment's API run input
- GET /v2/workflows/runs/paused lists a workspace's runs waiting on human input,
projecting pause points exactly as the run detail does
- Execute responses report executionTimeoutSeconds; GET /v2/billing/status adds plan limits
* fix(api): respect the paused-run page cap in the CLI and keep waiting pause points under the cap
- CLI generator carries a numeric field's contract maximum; the pager never requests
a page above it while still paging to the caller's total --limit
- Pause point cap keeps points not yet resumed before resumed history, so a run that
paused again is never listed without its waiting point (run detail and paused list)
* improvement(api): reuse FailedTraceBlock and sort pause points once when capping
* fix(api): custom-block trace boundary, legacy pause point arrays, and list point selection
- A custom block is an opaque trace boundary for failing-block attribution
- The paused-run list reads object and legacy array pause_points
- The list selects waiting human points before the per-run cap, reads points in
waves that stop once the page budget is spent, and shares one waiting predicate
- Resume response schemas omit executionTimeoutSeconds
- Drop a non-null assertion from the CLI page cap test
* fix(api): attribute concurrent failures to the stored error's block and never fail a workflow read on its deployment
- Failing-block attribution prefers the span the stored error names, else the
failure that ended first, else none; the block error prefix has one owner
- The workflow read degrades inputSchema to null when the deployment cannot be
read or its schema has an unexpected shape
- Integration cases for time-only, archived, and cross-workspace exclusion
* fix(api): consistent trace walk, block-named error attribution, required applied timeout, and ungated input schema
- Failing-block attribution walks spans as hasUnhandledError does, through
successful blocks, with one shared successful-boundary rule
- An error message headed by the failing block's name is attributed to it even
when the name reads as a run-level failure
- executionTimeoutSeconds is required (nullable) on Execute workflow responses
- The workflow read takes inputSchema from the active version row, not isDeployed
- Pause cap wording: unresolved points are kept in preference, listed earliest first
- Regenerate the CLI API the previous contract wording left stale
* fix(api): parse resume responses with the resume schema in e2e scripts and regenerate the CLI API on staging
- Stop-after and pinned-execute e2e scripts parse resume responses with
v2ResumeWorkflowDataSchema, which omits executionTimeoutSeconds
- Regenerate the CLI API against the merged staging contracts
* fix(api): parse the stop-after e2e resume helper's response with the resume schema
|
||
|
|
9b58238790 |
fix(api): release-audit follow-ups for the agent API work (#9910)
* fix(api): name the failing field once in v2 validation errors A message that already leads with its field label no longer repeats it after the location prefix, and the CLI restates the prefix as the flag the caller typed instead of rewriting it to query.--flag. * fix(api): call the v2 error id requestId The id in error bodies is the request id that x-request-id carries and logs store as requestId; traceId already means the OTel trace id in logs, so a search by the published value found nothing. * fix(api): describe what the workflow outline actually omits Only null values are dropped, every sub-block hidden from agents is dropped (some are real configuration), and blocks whose parent container is gone are left out, so point readers at Get workflow state for the full configuration. * fix(api): prove the workspace schedules list against Postgres Adds an integration suite for listWorkspaceLiveSchedulesPage: it returns the rows the per-workflow live list reports, leaves out archived, undeployed and other-workspace workflows, and pages through createdAt ties without repeats or gaps. sortBy=createdAt now says that each deploy creates new schedule rows. * chore(skills): include the optional requestId in the v2 error shape * fix(cli): pick the handoff for --expires-in and name a refused key sim login --expires-in without --method failed on servers that offer OAuth, because OAuth was chosen and then refused the flag; a lifetime now selects the API-key handoff. A refused handoff key no longer says nothing was stored: it already exists on the account, so the CLI points at how to revoke it. * fix(api): publish the workspace logoUrl pattern without a lookahead RE2-based validators (Go, Rust, many gateways) reject lookaheads, so the OpenAPI pattern for logoUrl could not be compiled there. The rewrite accepts and refuses exactly the same values. * chore(cli-auth): drop the poll-body half of a test that could not fail The poll contract strips unknown keys and the route never reads them, so sending access and expiresInDays in the body proved nothing. The test keeps checking that the approval's access and lifetime reach the mint. * fix(workflows): refuse withheld blocks before the operations lock applyWorkflowOperations now hands the persistence primitive a reader, which skipped its pre-lock withheld-block check, so a refused batch took the row lock and re-read the graph first. The use case checks the graph it composed before writing. A failed re-read under the lock is now an internal error instead of a 400 saying the workflow has no state. * chore(api): document the CONFLICT 409 from Apply workflow operations * improvement(workflows): prove the operations conflict guard against Postgres Holds the workflow row lock to force each interleaving: an unchanged workflow with containers and a migrated legacy block commits, a write that lands after the base read is refused as a conflict, and of two concurrent applies one commits and the other is refused with nothing lost. * chore(api): tighten comments and the field-label check from review * fix(cli): name a refused handoff key exactly The poll response now carries the minted key's name (an additive, optional field), so the CLI tells the caller exactly which key in Settings → API keys to revoke, falling back to the key id for an older server. Restores the route context argument the trimmed poll test dropped. * fix(workflows): run the conflict-guard races on their own connections The applies and the lock-wait poll started inside the lock holder's transaction callback, so the transaction tripwire refused them. They now leave that context, the applies run in a permission-group scope as routes do, and an apply that settles early is reported without awaiting the ones queued on the held lock. * chore(cli-auth): declare the poll key name the server always sends * fix(workflows): count lock waiters queued behind another waiter A second FOR UPDATE waiter queues on the first waiter's tuple lock, so pg_blocking_pids names that waiter rather than the holder; the barrier now walks the chain. * fix(cli): probe the endpoint before an --expires-in handoff --expires-in without --method chose the handoff before the reachability probe, so a mistyped endpoint printed a pairing code and polled instead of failing fast. The probe now runs first. A refused key from a server that does not report its name is described by the name pattern and time it was made. |
||
|
|
3d8996f0e6 |
feat(api): workflow outline, workspace schedules list, clearer v2 errors, and catalog value types (#9905)
* feat(api): add traceId and field paths to v2 errors, name the read-only key remedy * feat(api): publish declared value types on block catalog fields * feat(api): add workflow outline and workspace schedules reads to v2 * fix(api): type declared catalog inputs as block params and regenerate the docs manifest * fix(api): compare member responses without their per-request traceId * improvement(api): tidy catalog field projection default and integration test comment * docs(api): say the outline's derived fields come from values state already returns |
||
|
|
ba66dfd6b7 |
feat(api): agent identity on v2 meta, scoped CLI pairing keys, and v2 workspace rename (#9904)
* feat(api): agent identity on v2 meta, scoped CLI pairing keys, and v2 workspace rename
- GET /api/v2/meta adds keyId, userId, workspaceId and links {openapi, docs, mcp};
existing fields unchanged. The API catalog shares the same link source.
- CLI pairing login accepts --read-only and --expires-in <days>. The request rides
the approval URL, is shown on the approval card, is recorded with the approval
and applied at mint; the unauthenticated poll cannot set either. The poll echoes
access and expiresAt, and the CLI refuses to store a key that does not match
what was asked (an older server mints full access). The signed-out login bounce
now keeps scope, workspace, access and expiry instead of dropping them.
sim whoami shows the key's expiry and bound workspace.
- POST /api/v2/credentials/connections returns draftId. Opening a connection link
that is unknown, expired or another account's now explains to sign in as the
creating account, without saying which case applied.
- PATCH /api/v2/workspaces/{workspaceId} renames a workspace or changes its logo
through the existing workspaces.identity.update operation, widened to personal
API keys and OAuth tokens (api:write); Admin still required, workspace keys
still denied. Workspace update operations move into the operations registry.
- Regenerated OpenAPI, MCP catalog, CLI client and CLI docs.
* fix(cli-auth): pass route context in the new approve and poll tests
* test(mcp): expect the identity fields getMeta now returns
* fix(workspaces): count members before the rename so a failed count never hides a committed update
* improvement(cli-auth): reuse the api-key access schema and tidy handoff validation
* fix(api): publish the workspace PATCH body rules and check CLI-minted keys exactly
- PATCH /v2/workspaces/{id}: the body schema publishes minProperties 1, and
logoUrl is a pattern (root-relative path or https URL, protocol-relative
refused) instead of an unpublished refine.
- sim login refuses a minted key whose access or expiry differs from the
request in either direction, with the expiry checked against the requested
days within a clock tolerance.
- sim workspaces update --logo-url documents that clearing the logo goes
through the API or MCP.
|
||
|
|
a4bbaf737c |
fix(credentials): correct keyless setup instructions and enforce the saved-credential contract on every credential block (#9878)
* fix(credentials): enforce the saved-credential contract on every credential block, reopen key-based reconnects on their mode, and tighten fixtures and skills - check-block-registry runs the saved-credential contract for every block with a saved-credential picker, not only successors; the per-block contract moves to saved-credential-contract.ts with tests. The host probe gains a path-shaped id and a per-param shape so mixed-validation builders (Jama, Higgsfield) are probed, not guessed. - Blocks the widened check caught: Coda, Harmonic, and Oracle Database tools declare credentialKind 'service-account'; NetSuite pins instanceUrl in authoritativeParams; Vanta's assetExternalAccountId is a filter, not a host. - prepareWorkloadIdentity covers every keyless provider (AWS, Databricks added) and reuses audiences.ts for the provider-id mapping; the AWS and Databricks dialogs reopen a reconnect on the stored mode. - Snowflake keyless verification maps an egress refusal to host_not_allowed. - Neutral token fixtures in new credential tests; subject uniqueness TSDoc; skills describe native token blocks, the picker shape, keyless setup, and the successor naming exception. * docs(credentials): fix keyless setup instructions and copy - AWS: enter the Role ARN before setting the trust policy, so it never carries the <AWS_ACCOUNT_ID> placeholder IAM rejects (dialog hint and docs). - Databricks: the federation-policy command needs an account-level CLI login. - Google: a valid sample pool ID, ID format hints, user-managed service accounts only, skip the pool command when the pool exists, and the API list from Google's guide (adds Resource Manager). - Bitbucket: workspace and project access tokens need Premium; repository tokens do not. - Snowflake: rename SIM_WORKFLOWS if it exists; USERADMIN runs the statement. - Microsoft keyless dialog says where the federated credential goes. - Server errors name the trust values for API and CLI callers too; Google Workspace and Account ID wording; AWS catalog hint mentions stsRegion; the CLI keyless example uses aws-service-account throughout. - Self-hosting env vars list every keyless provider. * fix(credentials): reopen every keyless-capable reconnect on its stored auth mode and reject native credential tools without a policy - prepareWorkloadIdentity reports the reconnected credential's stored authType (reconnectAuthType), for an admin of a credential in the same workspace, whether or not this deployment can sign. reconnectsKeyless is removed from the contract and hook. The AWS, Databricks, Snowflake, Microsoft and Google dialogs reopen on that mode, so an assume_role, personal_access_token or certificate credential keeps its auth. - The saved-credential contract fails a native credential block whose tool has no oauth policy: the executor would never fill its token. - The Snowflake hint and docs say where to change SIM_WORKFLOWS; the DocuSign account_not_found message covers a credential with no Account ID; the docs baseline's reviewed CLI example entries carry their new byte length; the contract test fixtures use a real OAuth service id. |
||
|
|
cac01482b6 |
feat(credentials): set up keyless credentials from the v2 API, CLI and Sim MCP (#9875)
Keyless (workload identity) credentials could only be set up in the web connect dialog. Platform teams scripting their cloud trust now get the same two steps as an API: 1. POST /api/v2/credentials/workload-identity/subjects (`sim credentials keyless-subject <providerId>`) issues a random, per-credential subject and a 24-hour proof bound to the caller, plus the keylessConfig to fill in and the provider's required fields. 2. The existing create (`sim credentials create … --credentials @keyless.json`) submits the completed config; Sim verifies the trust before saving. - The existing prepare use case now also admits personal API keys and OAuth tokens with api:write. Workspace keys and delegated callers stay refused, because the subject must belong to a person. - Every keyless refusal carries one stable `error.details.code` (WORKLOAD_IDENTITY_NOT_CONFIGURED, _PROOF_EXPIRED, _PROOF_INVALID, _SUBJECT_REQUIRED, _SUBJECT_IN_USE, _SUBJECT_UNVERIFIABLE) on a single refusal error, from create, reconnect and the subjects route alike. - The provider catalog advertises a `keyless` object (authType and required/optional config fields) only when the deployment can sign, and the CLI reads it instead of keeping its own provider table. Snowflake's keyless config is now accepted by the CLI. - Provider hints, OpenAPI, MCP tool descriptions, CLI help and the five credential docs pages describe the flow the same way. - AWS and Databricks keyless create and reconnect also refuse with WORKLOAD_IDENTITY_NOT_CONFIGURED when the deployment cannot sign, and their verification steps pass keyless refusals through unchanged. Each provider's refusal names a fallback credential type. - The Google Cloud keyless hint says it covers Cloud services (BigQuery, Vertex AI), not Google Workspace. |
||
|
|
1b1639c9b0 |
fix(release): host_not_allowed for refused hosts, internal-JWT-only secret release, and final release-audit cleanups (#9870)
* fix(api): tell a missing key owner from an owner whose ban state is null user.banned is nullable, so a real owner with banned = NULL had every personal key refused as orphaned. Select the joined user id and test that instead; the ban and suspension checks are unchanged. * fix(credentials): report a refused connection host as host_not_allowed - egress validation names its refusal (dns or policy) instead of callers inferring it from a missing cause; an empty DNS answer is ENOTFOUND - the token check judges every DNS record when an environment proxy will carry the request, so a mixed public/private host is refused up front rather than failing in the transport as a retryable 502; the transport's own refusal is a typed EgressRefusedError and maps the same way - new host_not_allowed code (400) with its own connect-modal message - Flow and GitLab personal-token verification classify a refused or missing host the same way - the typed-URL scheme guard is shared and ignores the tabs and newlines the URL parser drops * fix(credentials): report an oversized Databricks token success as a 502 An oversized 2xx token reply carried status 200 into provider_unavailable and its logs. A refusal keeps its own status. * docs(api): say v2 execute options need a full-access key or api:write run.version, async and waitTimeoutSeconds refuse read-only keys; the meta example lists search:read with the full-access scopes. * chore(scripts): scope the payload-param allowlist to internal operations Every listed tool is an internal operation, so the probed-request fallback no longer builds or consults it. * fix(redaction): keep Infisical secret names visible; redact only deployKey * docs(networking): the SSRF guard matches NO_PROXY like curl, not like Bun * fix(api-keys): never echo an internal key-creation failure to the caller The unauthenticated CLI poll route and the settings routes returned the raw error message for an internal failure. Return a fixed message and keep the cause in the server log; a conflict still names the existing key. The CLI's comment now says a 400 can also be a refused key creation. * chore: log a failed route-cache clear and spell out the read-only key rollback The route-cache clear stays non-fatal but warns when it fails for any reason other than a missing build id or cache. The api-key-read-only flag says to revoke or replace read-only keys before rolling back. * fix(credentials): release saved secrets only to internal-JWT callers The token route refused only session callers; any other auth type would have been handed a saved secret. Allow internal JWT and refuse the rest. Tools never execute in the browser (the registry boundary keeps the tool registry out of every workspace client graph, and nothing else imports the executor), so the browser-only token fetch through the route is deleted. * fix(firecrawl): treat a blank maxDiscoveryDepth as unset A cleared field arrived as '' and was sent as 0, a crawl of the start page only. It now follows the blank maxDepth handling. * chore(credentials): log a broken JWKS and keep the successor map out of credential display The JWKS route still answers 404 when the signing key is broken, but warns with the error. The GitLab personal-token display reads its block type from the catalog entry instead of importing the generated successor map into a client-imported module. * test: drop or tighten assertions that could not fail - delegation: the read-only replacement case decided its filter by scanning bound params in a fake DB; no real-boundary check exists, so it is dropped with the fake's filter - Twilio: assert how many recordings requests were sent, so an empty loop cannot pass - Pi: the removed-model case restated the absent-from-catalog case * fix(security): ignore a malformed CIDR NO_PROXY entry 10.0.0.0/8/junk parsed as /8. An entry with extra segments is dropped like any other unparseable entry, and the TSDoc says IP entries match within their address family. * chore(workflows): scope the paused-row read to its workflow and reuse the mutability guard - the execution-status paused-row read filters by workflowId as well - delete-workflow uses requireMutableWorkflow instead of an inline copy - polling webhook logs carry the webhook id in metadata * fix(credentials): never name a sibling credential in a trust-setup refusal The caller may not be able to see the credential that holds or blocks the subject, so both refusals name only the workspace or organization. The uniqueness check documents its limits. * docs: correct the Helm readOnlyRootFilesystem note and the deployed-run variables TSDoc * test(credentials): rely on the shared env reset in the proxy validator tests * chore(helm): bump the chart version for the README correction * fix(redaction): keep prefixed secret keys masked while leaving Infisical's bare secretKey visible * fix(release): keep bare secretKey redacted, leave the proxy every-address rule to the transport, and report unknown GitLab hosts as input errors |
||
|
|
24aab3f280 | feat(api): run a pinned deployment version and expose paused run points in v2 (#9854) | ||
|
|
02293a9372 | feat(api-keys): read-only API keys and expiry at creation (#9855) | ||
|
|
4711852316 | feat(api): workflow trigger health and enablement through the v2 API (#9853) | ||
|
|
117409226f | feat(api): manage workspace members through the v2 API (#9852) | ||
|
|
5836fce6e9 |
feat(search): manage source permissions through a shared API and CLI (#9845)
* feat(search): manage source permissions through a shared API and CLI * chore(search): document the shared permission grant format |
||
|
|
5bffff69cb |
feat(search): update GitLab permission CSVs through the API (#9841)
* feat(search): update GitLab permission CSVs through the API * fix(search): align GitLab CSV updates with CLI and API policies * test(cli): cover confirmation for GitLab permission replacement |
||
|
|
bf575fe3fa |
feat(credentials): saved credentials and credential-only block versions, with keyless AWS/Databricks OIDC (#9763)
* feat(credentials): saved AWS and Databricks credentials with keyless OIDC Adds an optional saved credential to every AWS block and the Databricks block, alongside the existing inline key fields, plus Sim's own workload-identity (OIDC) issuer so a credential can assume a customer's AWS role or federate into a Databricks service principal without any stored secret. Existing workflows are unchanged: the inline fields stay, show, and validate exactly as before until someone selects a saved credential. - Issuer at /oidc/workload (discovery + JWKS), signing key from WORKLOAD_IDENTITY_SIGNING_KEY; 404 and keyless option off when unset - Credential-scoped subjects, HMAC-bound to the preparing user and workspace, so a member cannot reuse another credential's subject - aws-service-account: access keys, keys + AssumeRole (external ID), or keyless AssumeRoleWithWebIdentity; resolved server-side per call - databricks-service-account: PAT, service principal M2M secret, or keyless RFC 8693 token federation - AWS families accept the executor-authorized credential through trusted operation context; clients add the session token only for that pair - S3 get_object signs x-amz-security-token for temporary credentials; inline signatures are byte-identical to before - Tool credential binding honors optional (required: false) policies * fix(credentials): close review findings on saved AWS/Databricks credentials - Models can no longer inject a credential selector (or the token, session token, or host derived from one) into a hybrid tool call, which would have swapped an agent tool's inline keys for another workspace credential - Databricks connections own the workspace host (authoritative `domain`) - Drop the advanced credential-ID input: with a single picker, "is a credential selected" can no longer disagree with the active canonical mode - OIDC subject proofs are bound to their provider - Databricks token and identity fetches refuse redirects - Correct the AWS module doc on presigned URLs carrying a session token * chore(credentials): satisfy test-pattern, unused-export, and test-type audits * fix(credentials): keyless reconnect, availability, and shared credential plumbing - Reconnecting a keyless AWS role or Databricks principal keeps its trusted subject by default instead of issuing a new one that breaks the customer's trust policy - The connect dialogs offer the keyless mode only where the deployment can sign tokens; the prepare endpoint reports availability instead of failing - Register AWS (all 19 block types) and Databricks as stored-credential integrations, so org settings, the v2 credentials API, and Copilot can create and see them - Optional STS region for GovCloud and China access keys - One subject binder and config parser shared by both providers (neutral copy), one modal core for submit/errors/trust display - Generic `authorizedServiceAccountCredential` operation context instead of an AWS-specific field; Databricks resolver checks credential type and honors cancellation - Model-blocked params derive from each tool's authoritative params * test(credentials): type the handler mock in the AWS credential seam test * feat(credentials): credential-only block versions instead of hybrid inline keys Existing AWS and Databricks blocks are left exactly as on staging, only marked legacy and hidden from the toolbar; placed instances keep running and show an upgrade badge. Each gets a credential-only successor (s3_v2 ... databricks_v2, textract_v3) built by spreading the legacy block and swapping its secret fields for a required saved-credential picker. - withSavedCredential derives the successor's fields, inputs, and params builder; S3 and Textract split their builders so legacy key checks stay - tools declare credentialSuppliedParams so serializer validation and the canonical-id check stop asking credential-only blocks for inline keys - CloudWatch gets saved-credential log group/stream selectors that sign inside the credential's STS session - docs generator resolves multi-level spreads and same-file param builders - the AWS/Databricks providers are derived from the catalog again, so the hand-maintained token-credential mapping is reverted * docs(credentials): document credential-only blocks by their credential, not inline keys The generator omits a tool's credential-supplied params on pages for blocks that sign in with a saved credential, as it already omits accessToken. Intros now point at the AWS/Databricks credential guides. Regenerates OpenAPI, CLI API, and CLI docs for the new selector keys. * fix(blocks): never replace trigger fields that share a secret's id A webhook trigger can register with a field named like the block's secret (PagerDuty, Fathom, EmailBison, GitLab). withSavedCredential now leaves trigger-mode fields, and their dependencies, exactly as they are. * feat(credentials): generic saved-token plumbing for credential-only blocks Wave 0 of moving inline-secret blocks onto saved credentials. - tokenCredentialOAuth(provider, credentialParams) declares which tool params a saved token fills; credentialSuppliedParams is derived from it - the executor fills those params after authorization, overriding any caller value, and fails closed when the credential lacks a field - hosted keys are never injected when a saved credential supplies the key - v2 tool execute no longer demands credential-supplied params when a credentialId is passed (fixes AWS/Databricks direct calls) - withSavedCredential accepts an optional/conditional requirement - check-block-registry verifies every credential-only successor's tools authorize the picker's provider and actually fill what they declare - redact secretAccessKey/awsSecretAccessKey keys in logs - serializer contract test covers every operation of each successor * feat(credentials): Tavily saved credential and credential-only tavily_v2 Reference migration for wave 1. A generic tokenCheckValidator verifies a token with one documented authenticated request (no redirects); Tavily uses GET /usage. Legacy tavily is unchanged apart from its legacy marker. * fix(credentials): close wave-0 audit findings - agent tool-input no longer synthesizes inline secret fields a block's saved-credential picker supplies; one shared rule (credentialSuppliedParamsFor) now drives tool-input, serializer validation, and the canonical-id check - the picker inherits the replaced secret's condition and requirement, so sts_v2's unsigned calls (web identity, SAML) need no credential - withSavedCredential replaces both halves of a canonical secret pair and refuses options that would silently do nothing - Databricks fills its inline apiKey/host through credentialParams, so its tools are byte-identical to staging apart from the policy line - AWS operation families record their tool ids; a test and an executor guard ensure every AWS-credential tool resolves the credential - the registry contract check fails on unpinned host params, optional credentials over required params, malformed pickers, and kind mismatch - hosted-key admission (v2) and pre-resolution validation honor a selected saved credential; credential errors name fields in plain words * feat(credentials): wave 1 — saved token credentials for 48 single-token blocks Each block keeps its legacy definition (only hideFromToolbar + sunset) and gains a credential-only <type>_v2. Every service gets a token-paste provider with a one-request validator against a documented, read-only, credit-free endpoint, and its tools fill the inline key from the saved credential via tokenCredentialOAuth. Blocks: affinity, agentmail, agentphone, ahrefs, apify, apollo, brex, brightdata, browser_use, buffer, circleback, clerk, cloudflare, crunchbase, daytona, elevenlabs, enrich, gamma, hex, huggingface, incidentio, instantly, langsmith, launchdarkly, linq, loops, luma, mailchimp, otter, persona, pinecone, profound, quartr, rb2b, rippling, rocketlane, semrush, sendgrid, similarweb, sixtyfour, smartlead, sportmonks, square, tailscale, trigger_dev, uptimerobot, youcom, youtube. The registry contract check now probes each request tool's real URL builder to find params that steer the host, and requires the saved credential to fill them. * fix(credentials): close wave-1 audit findings - Pinecone and Semrush leave wave 1: Pinecone's per-call indexHost would let a shared key reach any host, and Semrush has no credit-free check that rejects a wrong key. Both are back to staging exactly. - tokenCheckValidator: forbiddenMeansScoped accepts a valid key that lacks the check endpoint's scope (Apollo, Brex, Bright Data, Apify, Rippling, Persona); acceptsBody proves keys whose rejection arrives in a 200 body (Buffer GraphQL) - the host-steering probe lives in scripts/saved-credential-contract.ts: typed placeholders for required params only, id/host shapes, bare and scheme probes, and a broad destination-name fallback where the URL cannot be built; covered by a fixture test - S3 refuses a bucket or region that would move the signed request's host - spread-inheriting docs keep their base block's outputs (restores the Smartlead, Trigger.dev, and Instantly output tables) - incident.io's credential is optional for alert events, which use their own alert source token - withSavedCredential refuses replaced secrets that show or require differently; copy, intro, and hint fixes from the audit * fix(credentials): close wave-1 re-audit findings - host probe also defeats unparsed suffix checks and finds hosts behind optional switches, probing every placeholder shape; broader destination names where a URL cannot be built; the contract check fails when a successor's tool is missing from the executable registry - the optional-credential rule evaluates a conditional picker per operation; incident.io hides its picker on alert events instead - withSavedCredential takes an explicit picker condition and refuses one that depends on a replaced secret at any nesting depth - a scoped 403 counts only when it is the vendor's JSON response, never a firewall or CDN page - S3 names a bad bucket or region in its error - pinecone/semrush catalog dates restored to staging * feat(credentials): wave 1b — Mem0, Zep, and Discord saved credentials Their legacy params builders throw without an inline secret, so each is extracted into a module function with a requireKey flag: the legacy block keeps identical validation and messages, the credential-only v2 skips only the key check. discord_v2 hides its picker for webhook posts, which never use the bot token. BlockToolParams is now a shared type for extracted builders (S3, Textract, Discord). * feat(credentials): wave 1b — v3 credential-only versions and Flint Blocks that already had a v2 get a credential-only v3 that spreads it: cursor, dub, extend, fireflies, intercom, pulse, quiver, reducto. The v2 becomes legacy and every older version's replacedBy points at v3. Extend, Pulse, and Reducto's v2 builders trimmed the key inline, so each is extracted into a builder that takes the key as an argument; the legacy v2 passes the trimmed key exactly as before. Flint gets flint_v2 with a dedicated validator: its API has no read endpoint, so an unknown task id answering 404 proves the key. tokenCheckValidator gains rejectsKey for vendors that answer a bad key with a server error (Fireflies returns 500 auth_failed), so the user is told the key is wrong rather than the vendor down. * fix(credentials): close wave-1b audit findings and CI boundary failures - token checks for the 59 new providers live in one module (validators/token-checks.ts) and their tool policies in tools/shared/saved-credentials.ts, so the tool-registry boundary stays within its baselines instead of adding ~60 modules to every graph - the host-steering probe builds URLs through the shared transport (new prepareToolRequestUrl) and also flags a host validated against a vendor allowlist when two accepted values reach different tenants - the AWS routing test reads typed metadata through getToolMetadata - Flint accepts only its documented JSON 'Task not found' 404; Intercom no longer treats a 403 (suspended workspace, plan without API) as valid; Fireflies keeps its error text in logs when a 5xx isn't auth_failed - Cursor help text, placeholder wording, Pulse intro, sorted secret fields * fix(credentials): address pre-ship verification findings - Refuse a keyless AWS role whose trust policy doesn't pin the credential's subject, so no other workspace can assume it - Treat a malformed workload-identity signing key as not configured - Brex: reject an unknown token's scope-style 403; the token-check factory now runs rejectsKey before accepting a scoped 403 - Flint: probe with a docs-shaped task id and a size-capped body read - Drop the versioned BlockMeta entries that doubled templates; alias bare block types in the app icon map so template icon clusters resolve - Widen the host-probe fallback names and rotate digits in alternates - Copy: picker placeholder casing, Databricks v2 description, Pulse and Tailscale skills, AWS/Persona/Rippling intros, AWS credential docs - Tests: AWS executor signing, AWS/Databricks credential setup, legacy params builders, serializer coverage for blocks without operations * refactor(credentials): one saved-credential table and shared helpers - withSavedCredential reads the replaced fields from SAVED_CREDENTIAL_OAUTH, so blocks and tools share one table instead of two hand-kept copies - Reuse isTriggerModeSubBlock, getDependsOnFields, and a shared isSavedCredentialPicker; build the replacedBy map once in the registry check - newWorkloadIdentitySubject owns the subject format; the AWS trust-pin probe runs alongside verification - The issuer parses a bad signing key once instead of per request - Token checks share the accepted result and the capped JSON reader * chore(credentials): cleanup pass - Keyless setup query gets its own key root, so broad credential invalidations can't refetch an open setup and mint a new subject - Named staleTime constant for the setup query - Correct stale comments (relying parties, Databricks param names) - Tighten tests: assert the refusal reason, make the BYOK guard reachable, drop a duplicate and a test that could not fail * fix(credentials): address review round 1 - A scoped 403 whose body can't be read is provider_unavailable, never accepted - Provider error snippets read through the bounded reader - Props interfaces for KeylessTrustFields and useWorkloadIdentitySetup; TSDoc on issuer responses * fix(credentials): never cache the issuer's not-configured 404 |
||
|
|
09742f1f5c |
feat(gauge): add Gauge Chat integration (#9733)
Add all 27 Gauge Chat operations with saved organization API-key credentials, six resource pickers, the Gauge icon, setup documentation, and generated catalog metadata. Keep operation-specific inputs scoped across workflows, agent tools, and notification tools using optional mapper context. Preserve model arguments, clear incompatible topic selections on operation changes, and reject blank identifier entries. Validate provider contracts and live requests, including mutation readbacks, report datasets, permission denials, selectors, and real executor/agent calls. All local gates passed with 43,187 tests passing and eight existing skips. |
||
|
|
7ee2814366 |
feat(integrations): add Jama and Flow workflows and live Search (#9723)
Add Jama Connect and Flow Engineering actions, selectors, and live Search using existing credential and permission boundaries. Preserve account limits, identity checks, and bounded provider reads. |
||
|
|
35ab8fe4fb |
fix(cli): match a dash-led id in linear time (#9668)
looksLikeAnId's single regex backtracked quadratically on a long dash token that ends in a non-id character (CodeQL js/polynomial-redos on the v0.9.43 release). Two linear checks with the same meaning replace it. |
||
|
|
d3ce97015b |
improvement(cleanup): tighten the agent-harness changes from the latest audit (#9650)
- CLI parse-error guidance branches on commander's error codes, reads hidden siblings through Help.visibleCommands, and names a misplaced positional only when unambiguous (no unknown option, one missing required flag, one extra operand); the hint uses the option's long flag, not '-w,' - body-variant shape errors use isRecordLike, compute the shape once, and show a generic example - workflow lint builds sections eagerly, derives hasWorkflowLintIssues from them, and phrases Run-button advice from the issue's fields - shared quotedBlockLabel; formatQuotedNameList takes a quote formatter - grep marks skipped non-text files instead of threading a callback - drop dead run-from-block loop branch and unreachable run-hook guard - shared empty lint report test factory; tighter assertions |