mirror of
https://github.com/simstudioai/sim.git
synced 2026-11-23 13:48:29 +08:00
staging
7
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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
|
||
|
|
57cc81e751 |
improvement(sim-cli): publish each command's path aliases and renamed paths in the command inventory (#9251)
The worker builds its agent grammar from this inventory and did not know that sim runs files mv, workflows folders ls or kb as their commands, or still runs retired paths such as tables count create and workflows deployment list as the commands they were renamed to, so it refused or misread them. Each command now carries the commander aliases of its path segments (pathAliases, aligned with path) and the paths it was renamed from (renamedFrom). |
||
|
|
99ed5fb59c |
feat(project-files): let Chat read and write Project files (#9034)
* feat(files): restore Project file browser and Mothership integration * fix(files): resolve CI audits and test types after restacking on staging - Keep prepareProjectsForAccountDeletion returning the Project IDs to delete. The object return added an unused storageCleanupEventIds field; the durable cleanup outbox already processes those events, so restore the staging contract and its stronger integration assertions. - Exempt lib/mothership/generated from the relative-import convention. contracts:sync copies those wire contracts verbatim and byte-checks them, so their sibling imports must stay relative; drop their baseline rows. - Re-record the files page module-count baseline for the Project browser. - Type the test fixtures that regressed, including a queue-recovery fixture that persisted the invalid completion status 'success'. * fix(files): gate Project sandbox callbacks like workspace callbacks Staging now holds resource-delegated Chat principals to content admission, so a Project callback read with no gate was refused and the sandbox got a 503. Run Project callbacks under the same workbench session gate as workspace callbacks (the gate's workspace is optional, since Projects have none) and share the withheld-result handling. The Project CLI read suite now runs reads under the tool executor's registry gate, as Chat does. * fix(projects): keep Project chat tabs behind the rollout flag The chat resources API stored a Project-owned tab without checking the projects flag. Refuse new Project tabs while Projects are off; removing or reordering stored tabs stays possible so they can be cleaned up. Also drop the projects flag check in list_user_projects that could never run (listProjects already refuses while the flag is off) and the content delivery barrel export left unused by the shared sandbox delivery helper. * refactor(files): drop the Project files UI from the Chat transport PR The Project files UI will be built for the project-first redesign, so this PR keeps only the backend and Chat transport behind the projects flag. Restore the workspace Files page, file viewer, Chat resource panel, add-resource and mention entries, and their client query hooks and owner adapters to staging. The previous tip is tagged project-files-ui-seed for that UI work. Kept: the shared ChatContext wire type (Project contexts and file owners reach the Chat server) and its exhaustive kind registry entry. Also drop the UI-only browser constants and response types nothing uses now, restore the files page module-count baseline, and type the use-chat fixtures that returned with the staging test. * fix(files): redact Project file text like workspace file text Project grep and text reads admitted every Project artifact as opaque bytes, so any file carrying a secret was refused to Chat instead of having the secret masked, unlike the same file in a workspace. Share one text extraction core between workspace text reads and private file observation: parse, redact before a line window can cut a secret, then slice. Project text reads now go through readProjectFileText, which admits the source and every rendered input as complete text and returns text only. The complete artifact read stays private to that use case, so bytes never leave under a complete label; readProjectFileArtifact keeps admitting opaque bytes, and visual reads of a secret still refuse. * fix(sim-cli): keep unpublished groups in the Mothership command inventory #9057 hid the projects group from --help and `sim cli` search until launch, and the inventory printer dropped every hidden command, so the Mothership worker lost the Project file commands it routes --project to. List a hidden top-level group that is only unpublished, marked `unpublished`, so the worker can route to it once Sim enables Projects for a turn; other hidden commands stay out, and --help is unchanged. * fix(files): address Cubic and Greptile review findings Workspace regressions while Projects are off: - Sandbox file copies between workspaces keep the workspace route when the lease has not negotiated the file-owner protocol; only pairs that name a Project owner need it. - Chat upload contexts keep their uploads/ path in the workspace owner adapter. Project transport: - Project CLI requests refuse mutations during benchmark reference generation, as workspace requests do. - Project grep defaults an omitted scope to files. - Project files with unrecorded or empty exact provenance are readable when the caller holds a registry; a missing registry is still refused. Mothership inventory: - Unpublished Project commands carry response shapes from the launch-ready Project OpenAPI definitions. - An operation whose delegated services exclude Chat no longer mints a Chat principal, so the refused-route list now matches runtime for Project file version history. * fix(files): address the second review round - Project `files read` returns binary metadata for undecodable files: the text route checked `workspaceFileTextFormat` against null, but it returns undefined. - Workspace file resources keep `workspaceId` beside their new workspace owner, so current browsers can open and close those tabs in organization chats; the resource key is unchanged. - The Project tab flag gate is covered against the database instead of through mocked collaborators. * fix(files): choose a generated Project document's read by its rendered type A generated PDF is stored under its source type (text/x-python-pdf), so the Project text route treated `files read report.pdf` as text instead of the default visual representation. Share the workspace reader's type selection as observedMediaType: a generated document is read as the type its name promises, otherwise as its effective stored type. * fix(mothership): close review gaps in Project file transport - Dispatch CLI services before file-owner adapters, so a service that carries a file owner gets the services validation instead of a bridge error. The unreachable Project-side service check is removed. - Check caller-chosen names on Project file renames and folder create and update with the same secret-provenance gate as create and upload, including workbench history for sandbox callbacks. - Move first-message file panel resolution into resolveFileAttachment and replace the mock-only post test with a database-backed check of the saved tab. * fix(mothership): match chat tabs within the chat's workspace - The chat resource store now keys tabs with the chat's workspace as the fallback scope, so an unscoped tab and the same tab addressed by that workspace merge instead of duplicating. Upsert, remove and reorder all use the same identity. - Project file renames and folder writes recheck cancellation after the name check and never forward a cancelled write. - Leave the .claude and .cursor import rules to staging, whose source conventions check now exempts generated contract copies itself. * fix(mothership): bound Project name checks and keep equal owners - Parse Project file renames and folder writes with their route contracts under the inline body limit before the name check, so an oversized body is refused instead of buffered. Only those routes copy the request. - Treat an equal file owner as unchanged when merging chat tabs, so a repeated upsert stays a no-op. * fix(project-files): harden owner hints, grep provenance, and tab identity - Restore info/warn levels for stale or forbidden tab attachments and skip an unresolvable target instead of throwing - Make Project owner hints best-effort so a failed lookup never fails the turn; document that a worker rollback needs projects off first - Cache the worker file-owner protocol probe per base URL (lru-cache, 30s, success only) - Answer an invalid copy body on an unnegotiated lease from the workspace route (v2 400) instead of a 403 - One tab-key function on server and client, keyed with the chat workspace on both sides - Project grep withholds a file without provenance instead of failing the search or latching the registry, and stops listing once the file budget is full - Bound copy effects: one copied file opens a tab, bulk and folder copies refresh the destination owner; org copies carry the destination workspace - Bound list_user_projects capability fan-out - Refuse unextractable or oversized Project text reads before download, with the text-extraction size message - Share the create-file input mapper, the resource authoring version, and isProjectsEnabled * fix(project-files): refuse secret-bearing raw Project downloads without a workbench tracker * test(project-files): pin refusals and cover live owner-hint, tab-key and log-level paths * refactor(project-files): move owner routing and admission behind the file-owner adapter - copilot-request carries one opaque resource grant per request; the Project file and file-copy grants are minted next to their adapters, so the shared route layer no longer imports Project or copy policy - One projectFileDelegationScope for the verifier, the Copilot adapter and the request grant; admitsCopilotResourceDelegation shared by the adapter and the grant - Private v2 transports derive route patterns from their contracts (v2RoutePattern / isV2ContractRoute / tryMatchV2Route), including the name-write lookup, so a renamed route can no longer skip interception silently - Project upload and write transports share their route prologue, cancellation check and failure envelope - One forwarded-header strip list and one callback context for sandbox callbacks; SandboxResourceScope is exported instead of re-derived - isOwnerScopedFile replaces adapter field comparisons; the adapter field is renamed invocationScope so it no longer reads like Principal.resourceScope - authoringInvocation picks a turn's chat-or-workspace invocation in one place * refactor(mothership): share chat tab keys, CLI session setup, and file read helpers - chatResourceKeyFor binds the tab key to one chat's workspace for the store, reorder, stream handler and use-chat; resource removal looks keys up in a Set - isFileResourceType names the file/filefolder check; shared owner refinement in the resource contracts - prepareCliSession gives every CLI invocation its endpoint, workbench session, file provenance and effect sink - Text-extraction refusals, the default-visual media check and MIME normalization are shared rather than copied - Grep page cap and listing note are shared; a corpus states its own scope refusal instead of the engine naming Projects - resource-effects builds an owned file path once and shares the owner refresh * perf(project-files): skip the folder tree for grep reads and check hint gates before the flag - Project grep reads ask the artifact read not to load the owner's whole folder tree per file; grep never reads file.folderPath - File-owner hints run the route, mode and admission checks before awaiting the projects flag - Project text reads reuse the workspace text-extraction refusals; Project grep uses the shared page cap and states its own scope refusal * test(mothership): drive stale-tab and owner-hint failures through the real boundary * test(project-files): pin upload cancellation during provenance and new-chat tab order * fix(project-files): recheck cancellation before completing a workbench upload Provenance resolution can outlast the invocation; completion now rechecks both signals before it registers the file, as the create path does. * fix(mothership): persist new-chat tabs in attachment order Attachments resolve concurrently, so tabs were persisted in completion order. Each authorized tab now keeps its attachment index. * fix(mothership): store the recovery authoring marker only while Projects are on Earlier builds parse recovery config strictly and skip recovery on an unknown key. Only Project authoring reads the marker, so flag-off turns no longer write it and stay recoverable across a rollback. * fix(mothership): tag an unlabeled file selection as a bare mention * test(project-files): give new suites their own reports and drop an unreachable adapter case * refactor(files): return readSourceBuffer's TSDoc to its function --------- Co-authored-by: Waleed Latif <waleed@sim.ai> Co-authored-by: Waleed Latif <walif6@gmail.com> |
||
|
|
842c5ac6a1 |
improvement(sim-cli): commands reach the API only through the operations they declare (#8877)
* improvement(sim-cli): commands reach the API only through the operations they declare Hand-written commands called SimClient by path and declared nothing, so the command inventory could not mark one Mothership-unavailable when it calls a refused route. Every command now gets its client from callsOperations: calls name an operation, route and method come from the operation table, and the client is typed to the declared operations. * test(sim-cli): assert declared-operation routing at the transport * test(sim-cli): assert directory requests at the transport |
||
|
|
722510e61c |
fix(sim-cli): the command inventory describes the operation each command runs (#8874)
The inventory mapped paths back to operations by re-deriving every route, so an operation whose derived path equals a sibling's (undeployWorkflow derives `workflows deploy`) overwrote it. Generated commands now record the operation they run and the inventory reads it. |
||
|
|
0c5dbfb91d |
feat(sim-cli): publish which CLI commands Mothership is refused, from the route admission rule (#8838)
* feat(sim-cli): publish which CLI commands Mothership is refused, from the route admission rule * fix(sim-cli): inventory raw-route admission so chat is flagged too |
||
|
|
f734ba5be2 |
feat(mothership): v1.0.0 (#8208)
* mothership agent cli: grep --in accepts the world/resource path a match line prints
* workflow lint, block catalog, tables, files, sandbox tools: fixes from exploration run 5
Lint: trigger-category blocks are entry blocks (schedule was an orphan); references inside Function code are checked with the runtime tokenizer; the agent-cli lint and grep read the draft state instead of the sanitized export. Catalog: operation inputs publish sub-block ids only (no canonical-param aliases); trigger-category blocks expose their trigger-mode fields. Tables: dispatch processedCount counts unlimited dispatches; json-language code fields accept objects. Files: restore keeps the folder when it still exists. Sandbox tools: outputTable failures report the files already written and the per-language result shape; the file writer keeps the computed result.
* sim-cli: --output json prints the API data verbatim; the single-key unwrap stays a table-only convenience
* route and connection validation, trigger defaults on add, table folder restore, dispatch listing, group column attach, import block summary; logs query and deps engines; run-tool errors and payload compaction; stale tests aligned
Editing: router routes validated as {id?, title, value} with unknown keys named; malformed connections reported instead of dropped; sub-block value() defaults evaluated on add so a webhook gets its token. Tables: folder restore no longer 500s (lock inside the row transaction), completed dispatches are listed, groups attach to existing output columns. Workflows: import answers with its blocks. Mothership engines: logs query resolves bare paths under output, marks missing paths, drops non-executed runs under --where; deps lists graph predecessors and child return shapes; run-from-block validation errors reach the agent; run payloads compact input.code. CLI generated types regenerated.
* sim-cli: the operations apply confirmation describes the batch as written, not a delete
* sandbox export keeps the code's result; --trigger implies --manual; deps mock skeleton; run tools lift the terminal output and take select; lint all-clear names what it checked; docs chunker keeps code spans
* sim-cli: runs get --select-output takes block names; groups delete says it removes the output columns and their data; a publish that lands on public auth prints a note
* null-safe block.error, strict start-trigger coercion, lint checks reference paths against output schemas; logs stats segments; requiredWhen and model ids in the agent catalog; live tag usage; one row-filter grammar; minted service-account credential ids; webhook delivery URLs on deployment status; mv semantics for folder moves
Executor: <block.error> resolves empty on a block that succeeded so a shared error collector is writable; a number input given a non-numeric string fails the run at start naming the field; a regression test pins that failure traces carry child spans. Lint: a reference whose first path segment is not on the block's effective outputs (or its responseFormat schema) is an unknown-field finding. API: logs stats honours segmentCount and omits empty buckets unless includeEmpty; block detail publishes requiredWhen instead of flattening conditional requirements and always lists model options with hosted marks; knowledge tag usage counts through the document slot; every table rows filter accepts a bare condition; service-account credentials mint their id; deployment status lists each webhook's delivery URL; a folder move into an existing folder moves it inside. OpenAPI and CLI generated types regenerated.
* same-workspace import keeps or warns about workspace bindings; generic required-field lint; folder moves to the root; empty-graph and no-entry lint notes; span durationMs; MCP tools reported on undeploy and listed inactive; paged connector types and workspaces; grep --in refuses unknown selectors; run_function names exported files; run tools surface the failing block's error
Export takes includeWorkspaceBindings for same-workspace round trips and import answers with warnings naming every block whose required binding was stripped. Lint reports a missing required field for every block type (the knowledge base id was skipped), notes an empty graph and a graph with no entry block, and the trace spans carry durationMs. Undeploy answers with the MCP tools it archived and the tools list shows them inactive. connector-types list is paged (25, summary projection, detail=full) and workspaces list defaults to 25. The agent CLI's grep refuses a prefix or unknown --in selector with the accepted forms; a run_function that exported files and wrote a table says both; a run tool whose executor result carries no message uses the failing block's own error.
* table groups default to the deployed version and refuse a dispatch without one; column rename reports unmigrated Table-block filters; lint checks table fields against the live schema; runCount counts every settled run; runs cancel is honest about no-ops; dry-run apply answers with previewBlockIds; conditionResult is the chosen test's boolean with selectedTitle; workflows run --select-output keys blockOutputs by the selector and rejects unknown heads; knowledge search exposes rankScore and rank; the multi-trigger error names workflows state get; the Knowledge block declares cost, tokens, model; media writes refuse to fork a moved folder; grep --in knowledge points at knowledge search
* agent cli grep: the searchable text leads with the resource's name and description
* Catalog hides sunset blocks unless includeSunset; enrichment get returns the group's run state and outputs; knowledge upload prints the document fields; docs chunks titled by page not nav link; logs carry hasHandledErrors and opt-in handledErrorRuns; outputTable receipt keeps stdout
* Sandbox exports decode by the path rule the reader used: a .jpg declared without a format is written as image/jpeg bytes, not as its base64 text under the json format (thumbnails opened as raw text)
* Chat uploads resolve by uploads/<name> for reads, sandbox mounts, and image references (never listings or writes); an unresolved reference image fails the call instead of rendering without it; copilot session-sandbox calls are priced like Function-block sandboxes and report the raw cost beside the billed one; CLI docs regenerated
* grep: resolve --in against listings, fetch only the named resources
A bare --in selector (e.g. --in agent, --in file_v5) materialized every searched
world to find one block: 65 block details plus every workflow state per call. On
dev that took 18-34s per grep and tripped the per-user rate limit. Each world now
has a cheap index (its listing) and a per-resource fetch; a --in search reads the
indexes and fetches only the matches. Whole-world searches are unchanged.
* mothership: model-facing strings name only what exists on the CLI surface
The copilot back-derives fixes from the strings sim hands it, so a retired name
becomes a wrong instruction to the user (dev 2026-09-03: a save_upload mention
became "drag the photo into the files panel"). Every model-facing string audited
today now names the current surface:
- upload notice: a chat upload lives at uploads/<name> and is not a workspace
file; workflows import takes --workflow (there is no --file); a .zip is mounted
and unzipped in the sandbox rather than a files unzip path that does not resolve
- table import resolves uploads/<name> directly (includeChatUploads) instead of
pointing at the retired save_upload tool
- function-execute / generate-image: outputs get, files ls, files restore and
tables list replace read/grep/glob/restore_resource and Go VFS meta.json paths
- process-contents: browser/terminal pointers no longer name browser_* or a
terminal tool this surface does not have; docs fallback names docs search
- lint/deps usage strings use the plural workflows group
- integration credential error names credentials list
* docs: every model-searchable page states the current surface
The copilot answers users from these pages (docs search), so a wrong sentence
becomes a wrong instruction. Audit fixes:
- chat: uploads live under uploads/, not the Files panel; on-demand workspace
reach instead of a per-message snapshot; Chat runs Opus 4.8; connectors and
deletes/restores as they actually behave; login pages via the shared browser
- cli: --select-output works on sync runs (only --async conflicts); runs get
takes the same block selectors; secrets set needs --scope; workflows run runs
the deployment or --manual; sim profiles honours --output; which groups have
no singular alias; the embedded CLI has no profile, login, or config; @path
reads the chat sandbox
- model defaults are claude-sonnet-5 (guardrails has none); API examples use
https://www.sim.ai/api/v2 (apex 301s POSTs into GETs)
- quick reference / shortcuts: only affordances that exist (no Deploy tab, no
workspace duplicate/export, Mod+B not Mod+E, variables under the ⋯ menu,
<variable.name> syntax)
- editor read-only rules match round-trip-safety.ts; card links fixed
- sim-cli: runs-get selector error and the Settings label match the product;
batch delete describes its ids as deleted, not updated; docs/api regenerated
* mothership: prepare_file_edit create + new_file pass input validation
The workspace-file handler has always supported operation=create with a
new_file target, but the generated tool schema (from the copilot catalog)
forbade both, so the watched write could never create a file: a "save this
report as a workspace file" turn died on `/operation must be equal to one of
the allowed values` (dev 2026-09-03). Regenerated from the catalog that now
declares create, new_file, and fileName; regression test on the validator.
* mothership: the embedded CLI answers v2 in-process; grep memoizes both platform catalogs
The embedded CLI and the agent-cli engines were typed v2 clients pointed at the
server's own URL: every tool call was a network round trip through the proxy,
API-key auth, the abuse rate limits, and the proxy body ceiling. A grep over one
block definition cost 8-34s and tripped the per-key limit (dev 2026-09-03).
- sim-cli: ResolvedProfile / EmbeddedCliIdentity take an optional transport; the
client sends through it instead of fetch. The installed CLI never sets it.
- sim: an in-process transport resolves a v2 path against a generated route table
(scripts/generate-v2-route-table.ts, check:v2-route-table in check:audits) and
invokes the route handler directly. The request is marked internal through a
WeakSet — not a header — so admission still authenticates it but skips the
pre-auth IP bucket and the per-key rate limits, which exist for callers on the
wire. Contracts, use cases, presenters, and error envelopes are the ones the
network path runs. Anything outside the v2 table falls through to fetch.
- grep engine: blocks and tools (5,000 built-ins at 100 a page) are memoized per
workspace; an exact block or tool id (--in file_v5) resolves from that corpus
without listing any workspace world; name fragments still index every world
and fetch only the matches.
* mothership: take the embedded CLI off the in-process transport until the dev hang is understood
Every cli_grep on dev timed out at 60s from the first deploy of 99aad281a7. The
transport, marker, route table, and grep memo stay; the embedded identity goes
back to the HTTP path while the hang is diagnosed from sim's logs.
* grep: share in-flight builds, bound nested requests process-wide, cache file text by version
The first dev turn on the in-process transport fired eight world-wide greps at
once. Each rebuilt every world concurrently on the one process serving the chat
— 24 block-catalog listings, 150 tool-catalog pages, 130 file reads in sixty
seconds — until all eight timed out. Over the wire the same fan-out had been
spread across tasks and throttled by the network.
- concurrent greps now await the build already in flight for a (world, workspace)
- nested requests are bounded to eight for the whole process, not per world
- platform corpora (blocks, tools) are kept an hour, not ten minutes
- a file's text is cached by id + updatedAt + size, so repeat greps re-read only
files that changed
* grep: an exact block id answers before the tool catalog is built
* grep: honour -A and -B context flags
The engine read only -C; -A and -B were ignored silently, so `-A 40` returned
the bare match line and the model concluded context flags were unreliable
(dev 2026-09-03). A bad value is refused like -C's.
* sandbox pricing: normalize COST_MULTIPLIER at the boundary
Under skipValidation the value arrives as the raw string it was deployed with;
the sandbox lease's finite check rejected it, so on dev every run_code failed
as "Boot sandbox" (Sandbox pricing multiplier must be a finite nonnegative
number). getCostMultiplier now goes through envNumber, as the env module's own
rule says numeric overrides must.
* sandbox pricing: cost-multiplier imports env relatively — next.config.ts loads env-flags outside alias resolution
* mothership: pack a workspace inventory with every chat request
The agent spent nine tool rounds and ~20K tokens learning what exists in the
workspace before an orientation task could start. The chat request now carries
a compact inventory (contracts ChatRequest.inventory): workflows, tables,
knowledge bases, files, skills, custom tools, MCP servers, credentials, and
secret names — names and ids, one page per world, capped worlds named in
`truncated`. It is read through the same use cases the v2 listings run, under
the caller's session principal, so authorization is unchanged; a world that
fails to list is left empty and logged rather than failing the turn. The worker
renders it once per turn as a request-local message.
* grep: the tool catalog is one use-case call when the engine has the caller's principal
The tools world paged 5,000 built-in tools through the route stack at 100 a
page — fifty round trips, each re-resolving the gate and walking the registry —
which was the whole cold cost of a world-wide grep. The embedded bridge now
resolves the delegation key to its principal exactly as the v2 surface does and
hands it to the engines; with it, the tools world reads the catalog through
listCatalogTools in one call — same authorization, same projection. Without a
principal the client path stays.
* mothership: background tasks — subscriptions, wake turn, task pill (21 §6)
Sim side of copilot background tasks. copilot_task_subscriptions
(migration 0315) records a worker task's watch on a workflow execution;
the logging session's completion attempt posts every subscribed run's
outcome to the worker. POST /api/mothership/tasks/subscribe and
POST /api/mothership/wake (internal key): the wake runs the inbox's
headless lifecycle under the task id as message id, announces itself on
the chat status channel so an open chat reconnects, persists the user
message with origin 'task', and resolves the pill in the arming turn.
Client: a 'task' content block end to end (run handler, turn-model node,
both serializer directions, persisted normalizer — which also flattened
plan blocks to text on reload —, display block, segment, TaskPill) and a
muted TaskNotificationRow for task-origin messages. The stream
validator's run kinds now derive from the generated contract; the
generated mothership-stream-v1 gains task_armed / task_delivered.
* mothership tasks: resolve the pill by task id (jsonb text spacing broke the exact-key match)
* task pill: icons from @sim/emcn (lucide-react is not an app dependency; the Docker build failed)
* mothership: checkpoint Sim interaction and workbench boundary repairs
Capture the accumulated Mothership control, recovery, sandbox session, embedded CLI, and standalone diagnostic repairs. Companion worker checkpoint: c8245400. Validation and limitations are recorded in the Mothership revamp ledger through iteration 38; the latest expanded Sim diagnostic selection passed 1231 tests. The new table-mount audit is excluded and will follow separately.
* mothership: authorize table snapshot mounts and honor folder references
Move Mothership table snapshot resolution, provenance checks, and bounded storage reads into a registered application operation. Reuse the table VFS resolver for folder paths, recheck current actor access before materialization, and project safe mount errors. Preserve CSV transport, budgets, default paths, and workflow/public API behavior. Validation: 517 related tests, app/auth type checks, API and agent-CLI boundary checks.
* mothership: stream workbench downloads with atomic publication
* mothership: stream uploads and imports from workbench snapshots
* mothership: bind upload requests to the snapshot lifetime
* fix(mothership): preserve and bound embedded CLI output
* fix(mothership): preserve file provenance through host CLI reads
* test(mothership): guard current CLI catalog entry points
* fix(mothership): make search current, isolated, and explicit about coverage
* fix(mothership): bind file mounts to one canonical version
* feat(mothership): persist private upload source classification
* fix(mothership): preserve classification across workbench file copies
Record encrypted source evidence against host-streamed bytes and physical workbench identity. Bind completed upload streams through the authorized application operation, sealing pending provenance with the completion lease so recovery preserves the first result.
* fix(mothership): retain source evidence for saved CLI output
Classify settled stdout through the existing workspace-file helper and persist evidence against the streamed workbench bytes. Preserve completed command outcomes on publication failure and verify copied output across fresh invocations and pending sibling tools.
* test(mothership): exercise CSV composition through the Sim runtime
* test(mothership): connect CLI workflow runs to report publication
* fix(mothership): preserve raw CLI data with scoped presentation
* fix(mothership): expose canonical workflow identity for watches
* fix(mothership): preserve watches across transcript replay
* fix(mothership): convert code execution timeouts once
* fix(mothership): preserve child failures across transcript recovery
* test(mothership): distinguish replay from executable handoff
* test(mothership): verify persisted run diagnostics through CLI
* test(mothership): verify workflow execution log readback
* test(mothership): verify controller execution and resume recovery
* fix(mothership): acknowledge text received before stream retries
* fix(mothership): reconcile response text across reconnects
* test(mothership): verify automatic relay interruption recovery
* fix(mothership): unify replayable child lifecycle handling
* test(mothership): verify child recovery after worker exit
* fix(mothership): distinguish tool history from executable handoffs
* fix(mothership): acknowledge received activity between stream legs
* test(mothership): recover missing initial relay frames
* test(mothership): cover overlapping relay attachments
* fix(mothership): observe results owned by overlapping controllers
* fix(mothership): preserve long CLI command budgets
* test(mothership): verify table pipeline against real execution
* fix(mothership): recover one-shot response delivery
* fix(mothership): align one-shot MCP discovery guidance
* fix(mothership): make inbox attachments readable
* fix(mothership): scope upload names to the requesting chat
* fix(mothership): preserve worker history when forking chats
* fix(mothership): cancel only response-owned workflow executions
* fix(mothership): serialize workflow pickup with run Stop
* fix(mothership): track browser workflow execution through Stop
* fix(mothership): require settlement for Stop before chat attachment
* fix(mothership): preserve canonical history when stopping a response
* fix(mothership): handle abort failures while Stop history persists
* fix(mothership): retain queued Stop dependencies through retries
* fix(mothership): recover outgoing handoffs through the durable queue
* fix(mothership): bind queued retries to the active Stop operation
* test(mothership): exercise physical workflow edits and oracle execution
* test(mothership): verify extracted workflow invocation through saved logs
* test(mothership): verify build-only consent through physical run history
* fix(mothership): retain terminal failures in saved chats
* fix(mothership): retain active runs through worker connection loss
* fix(mothership): persist Stop before worker delivery
* fix(mothership): recover interactive streams after Sim process loss
* fix(mothership): durably admit chat turns before worker dispatch
* fix(mothership): recover lost tool handlers with fenced execution leases
* fix(mothership): finalize steered answers by turn identity
* fix(mothership): separate committed tool outcomes from stream publication
* fix(mothership): serialize saved resource panel changes
* fix(mothership): persist resource effects once before publication
* fix(mothership): preserve complete saved resource addresses
* fix(mothership): preserve saved table views in chat context
* fix(mothership): follow the current embedded table view
* fix(mothership): preserve exact table selection identities
* fix(mothership): attach usable file folder references
* fix(mothership): render saved file folder resources
* Revert "fix(mothership): render saved file folder resources"
This reverts commit d7854344686e06314ad7db3856347e472fda7b32.
* fix(mothership): align attachment context with available tools
* fix(mothership): authorize MCP calls as the chat subject
* fix(mothership): keep workbench policy out of the public CLI
* fix(mothership): preserve composed code export outcomes
* fix(mothership): retain completed files after export failure
* test(mothership): verify hosted workbenches and task compositions
* ci: restore staging jobs and keep Mothership acceptance local
* feat(mothership): receive private Sim controls over outbound transport
* fix(mothership): bound stream reconnection attempts
* fix(mothership): export chat sandbox files through workspace storage
* fix(cli): isolate embedded output from host process logging
* fix(mothership): preserve file intents and workflow result contracts
* perf(mothership): trace CLI and tool persistence boundaries
* fix(mothership): preserve resource effects and execution recovery
* fix(mothership): reconcile staging contracts and consolidate migrations
* fix(mothership): share and verify billing callback contracts
* fix(mothership): preserve catalog curation and embedded CLI access
* fix(mothership): mount code secrets explicitly
* fix(mothership): own sandbox profile at the code tool boundary
* fix(workflows): validate field values before full-state writes
* fix(chat): collapse main tool groups into action summaries
* fix(mothership): restore workspace API key dispatch
* fix(chat): label workflow dry runs as validation
* feat(chat): expose model, reasoning effort and Astra Fast controls
* fix(chat): align composer model and effort controls
* Group Mothership tools by activity and show scoped resource names
* Report requested Mothership model without legacy telemetry defaults
* Restore Mothership Slack bot connection from stored secrets
* Preserve execution events for deployed Copilot workflow runs
* Expose active workflow API details to Mothership
* Restore desktop parity and preserve interrupted chat progress
* Keep Mothership resource panels and activity groups in sync
* Show active tools before completed activity summaries
* Fix shared agent tool execution and discovery boundaries
* Port Assistant to shared Mothership runtime and repair resource recovery
* Refresh CLI docs and desktop validation after staging rebase
* Restore staging image inventory commands
* Fail migrations correctly and resolve empty direct database URLs
* Match chat attachment guidance to supported file capabilities
* fix(ci): retain the latest published desktop prereleases
* fix(mothership): read file contents through one adaptive command
* fix(chat): simplify pending tool activity label
* feat(chat): inspect scratch files and preserve inline images
Resolve workspace, upload, and sandbox references through authorized file readers. Preserve explicit Markdown images privately with each chat turn without creating workspace files, and keep visual bytes out of bounded UI tool-status events.
Keep sandbox CLI credentials scoped to the active callback so file provenance checks cover data entering the workbench.
* fix(chat): keep tool failures in expanded history
* fix(db): avoid repeated dev index builds and search backfills
* fix(chat): preview inline images with shared lightbox
* feat(mothership): operate across organization workspaces
* feat(mothership): manage settings and workflow file inputs
* fix(mothership): preserve stopped chat admission and queued corrections
* fix(mothership): show sequential activity intent and concrete tools
* fix(mothership): expose canonical model hints in internal discovery
* fix(mothership): unify scoped CLI and organization resource panels
* feat(assistant): connect and use personal organization integrations
* feat(chat): unify Home modes and search resource tabs
* feat(chat): tailor Home controls and starters to the selected mode
* fix(mothership): preserve file upload and preview resource context
* fix(mothership): stabilize Home search panels and add optional Fast Search
* fix(mothership): preserve staging authorization and resumed billing
* fix(db): make development schema pushes noninteractive (#7906)
* fix(db): resolve dev schema push column ambiguity
* refactor(db): generalize push rename handling
* docs(db): describe schema push reconciliation steps
* feat(search): unify Home search levels and composer
* fix(db): retire file size bridge before forced schema push
* fix(ci): restore test isolation and memory file scope checks
* fix(ci): keep metadata imports pure and narrow component graphs
* fix(mothership): refresh client settings after scoped mutations
* fix(db): repair partial member sync status on existing databases
* fix(home): reuse the shared loading fallback
* fix(mothership): remove eager catalogs and bulky admission saves
* fix(mothership): keep reads out of resource panels
* test(search): assert lazy integration catalog in headless chat
* fix(search): label balanced search level Auto
* fix(mothership): provide authorized context for chat titles
* fix(search): restore standalone search and refine chat mode controls
* fix(search): align mode selector with the standard search icon
* fix(mothership): resolve integration discovery service identities
* fix(desktop): reuse Sim login for authenticated browser previews
* fix(chat): preserve configured origin in deployment URLs
* fix(search): recover GitHub installation setup and verify ownership
* fix(search): retain sync failures and resume reconnected accounts
* fix(chat): restore thinking indicator after tools finish
* fix(mothership): expose and validate tool attachment identities
* feat(mothership): inspect configured workflow tool bindings
* feat(mothership): support dynamic Sim Chat tool modes
* fix(mothership): continue Sim Chat block conversations
* feat(mothership): create organization workspaces through CLI
* perf(desktop): observe browser state in action calls
* fix(mothership): repair background wakes and simplify watch activity
* fix(mothership): clarify tool permissions and folder context
* fix: reconcile staging rebase contracts and migrations
* fix(db): reconcile staging search migrations in dev
* fix(chat): preserve live turns and recover interrupted streams
* fix(workflows): scope custom block schemas during authoring
* fix: reconcile staging search and file contracts after rebase
* style(db): format rebased migration snapshots
* fix(slack): deliver Sim Chat text and tool progress reliably
* test(slack): verify Agent and Sim Chat thinking parity
* fix(slack): bound each long-answer append request
* fix(slack): continue long streams across message limits
* fix(slack): recover explicitly rejected size overflows
* fix(mothership): simplify saved results display label
* fix(slack): clean up long-response continuations
* feat(mothership): simplify Build picker to Astra effort levels
* fix(mothership): hide mode selection after the first message
* feat(search): add feature-flagged live provider retrieval
* fix(search): scope repository retrieval and add Coda MCP OAuth
* fix(search): restore account hooks client directive
* Fix GitHub connected-account tools in Search Assistant
* Add organization-scoped live search and admin-managed GitLab
* Add date-aware live enterprise search and bounded listings
* Polish live Search results, citations, and effort controls
* fix(mothership): preserve hosted service billing through cutover
Record hosted integration, sandbox and media spend through a trusted durable
service outbox independent of tool output, cancellation and worker delivery.
Preserve service billing under model BYOK and restore title admission.
Use workspace BYOK settings and fresh credentials, retain execute transport,
and restore the locked actor-authority check for billing-sensitive membership
removal. Add migrations and local HTTP/PostgreSQL billing acceptance coverage.
Validation: 1,453 billing tests passed with 30 environment-gated skips, app
and dev infrastructure types passed, and local SQL charge proofs passed.
* fix(search): restore live citations and streamed source panel
* fix(search): replace live results tab with cited sources
* feat(search): simplify federated sources and add scoped secrets
* fix(search): make service account setup directly accessible
* feat(mothership): add dev-gated Plan mode across chat surfaces
* fix(search): preserve account connection links in Slack
* fix(search): remove indexing language from live search
* fix(search): keep admin setup out of member integrations
* fix(search): route Search MCP through live retrieval
* fix(plan): normalize the runtime feature flag to a boolean
* ci(dev): deploy Trigger tasks independently of app images
* feat(mothership): set organization Generic Secrets in chat
* fix(search): verify federated connectors and align setup docs
* fix(search): remove stale Slack indexing copy
* docs(search): document Generic Secrets and clarify source setup
* fix(mothership): allow authorized organization code secrets in Build and Plan
* fix(search): restore live integration connection chips
* fix(search): include Gmail in live connection inventory
* fix(search): expand composer around image attachments
* fix(mothership): restore saved Plan chat history
* fix(mothership): address review findings and CI regressions
* test(deploy): align promotion expectation with Trigger CLI
* improvement(desktop): make saved password autofill field-aware
* fix(mothership): preserve trace filters and shared app workers
* fix(desktop): dismiss credential picker when browser hides
* feat(mothership): simplify model controls and add native desktop files
* fix(desktop): preserve password picker focus and lifetime
* chore(mothership): align model and deployment test expectations
* fix(mothership): resolve model and Plan controls from AppConfig
* fix(desktop): contain native imports and preserve UTF-8 pages
* fix(credentials): preserve unrelated setup controls
* feat(browser): file transfer, popups, PDFs, click gestures, and dialog answers for the browser agent
- Upload workspace, chat-upload, or granted local files into a page's
file input (DOM.setFileInputFiles on the input a ref, label, or drop
zone resolves to), staged privately and bound to the claimed tool
call; save completed downloads into workspace files. New
/api/desktop/tool/file route with application use cases.
- Same-session popups adopt Chromium's WebContents so window.opener
works (sign-in and connect flows); a page that closes itself leaves
cleanly and agent work returns to its opener.
- PDFs render: enable Electron's internal PDF plugin and let its
packaged viewer resources past the network guard.
- Clicks take button, clickCount, and modifiers; agent right-clicks
never open the native menu. Actions answer confirm/alert dialogs via
dialog: {accept}. press_key gains F1-F12, Insert, and repeat; scroll
and hover accept post-action observation.
* chore(chat): provide runtime flags in composer tests
* fix(browser): isolate actions and bound file transfers
* fix(browser): retain upload input identity through dispatch
* fix(mothership): validate complete billing protocol headers
* fix(browser): preserve upload dispatch before acknowledgement
* fix(browser): distinguish unconfirmed upload outcomes
---------
Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
Co-authored-by: Vikhyath Mondreti <vikhyath@simstudio.ai>
Co-authored-by: Waleed Latif <walif6@gmail.com>
|