Skip to content

Commit 976177f

Browse files
committed
Merge remote-tracking branch 'origin/staging' into fix/computer-use-final-review
2 parents c1e821e + 5929764 commit 976177f

38 files changed

Lines changed: 1087 additions & 148 deletions

‎.husky/pre-push‎

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
#!/bin/sh
2+
# Checks only what this push changes against its merge base with origin/staging (the PR base):
3+
# biome format + lint on the changed files, then type-check for the affected workspaces.
4+
# CI runs the full lint, type-check and audit gate on every PR, so it stays the backstop.
25
set -e
36

4-
bun run lint:check
5-
bun run type-check
7+
# git passes one "<local ref> <local sha> <remote ref> <remote sha>" line per pushed ref.
8+
zero=0000000000000000000000000000000000000000
9+
head=$(git rev-parse HEAD)
10+
pushes_head=false
11+
while read -r _local_ref local_sha _remote_ref _remote_sha; do
12+
[ "$local_sha" = "$zero" ] && continue
13+
if [ "$local_sha" != "$head" ]; then
14+
# These checks read the working tree, which holds HEAD, not this commit.
15+
echo "pre-push: $local_sha is not the checked-out commit; leaving it to CI"
16+
continue
17+
fi
18+
pushes_head=true
19+
done
20+
[ "$pushes_head" = true ] || exit 0
21+
22+
base=$(git merge-base HEAD origin/staging 2>/dev/null || true)
23+
if [ -z "$base" ]; then
24+
echo "pre-push: origin/staging not found, running the full lint and type-check"
25+
bun run lint:check
26+
bun run type-check
27+
exit 0
28+
fi
29+
30+
# Deletions still decide the type-check (an import of a deleted module breaks); biome only
31+
# reads files that exist.
32+
changed=$(git diff --name-only "$base" HEAD)
33+
[ -z "$changed" ] && exit 0
34+
existing=$(git diff --name-only --diff-filter=ACMR "$base" HEAD)
35+
36+
if [ -n "$existing" ]; then
37+
# Word-splitting the list is deliberate; no path biome checks contains a space.
38+
bunx biome check --no-errors-on-unmatched --files-ignore-unknown=true $existing
39+
fi
40+
41+
if printf '%s\n' "$changed" | grep -qE '^scripts/'; then
42+
bun run type-check:scripts:esm
43+
fi
44+
TURBO_SCM_BASE="$base" bunx turbo run type-check --affected --output-logs=errors-only

‎apps/desktop/e2e/browser-page-dialogs.spec.ts‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,15 @@ createRoot(document.getElementById('root')).render(createElement(Fixture));`,
215215
expect(result.ok, result.error).toBe(true)
216216
return result.ok ? result.result : undefined
217217
}
218+
const pageDialog = () => shell.evaluate(() => (globalThis as Bridge).pageDialog ?? null)
218219
/** Browser-chrome actions are user gestures, so each follows a real click in Sim. */
219220
const panelAction = async (action: Record<string, unknown>) => {
220-
if (action.action === 'respond-dialog' && (await shell.getByRole('dialog').count())) {
221+
// The store holds a dialog before its modal finishes the native-surface handshake and
222+
// renders, so a live dialog is answered through the modal once it appears.
223+
if (
224+
action.action === 'respond-dialog' &&
225+
(await pageDialog())?.requestId === action.requestId
226+
) {
221227
await shell
222228
.getByRole('button', {
223229
name: action.allowed ? 'Leave' : 'Stay',
@@ -236,7 +242,6 @@ createRoot(document.getElementById('root')).render(createElement(Fixture));`,
236242
{ action, scope: SCOPE }
237243
)
238244
}
239-
const pageDialog = () => shell.evaluate(() => (globalThis as Bridge).pageDialog ?? null)
240245
const inPage = <T>(script: string) =>
241246
shellApp.evaluate(
242247
async ({ webContents }, { script, url }) =>

‎apps/desktop/e2e/chat-panel.spec.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ test('chat panel sizes survive navigation, chat switches, collapse, and layout c
379379
})
380380
await check('assigning a permanent chat ID lets an active drag finish', async () => {
381381
await page.getByRole('button', { name: 'pending:chat', exact: true }).click()
382+
await expectWidth(720)
382383
await dragTo(620)
383384
const rect = await beginDrag()
384385
await page.mouse.move(rect.x + 100, rect.y + 100, { steps: 12 })
@@ -402,6 +403,7 @@ test('chat panel sizes survive navigation, chat switches, collapse, and layout c
402403
'cancelling before the first animation frame restores native browser bounds',
403404
async () => {
404405
await page.getByRole('button', { name: 'pending:native', exact: true }).click()
406+
await expectWidth(720)
405407
await dragTo(698)
406408
await shell.evaluate(({ app, BrowserWindow }) => {
407409
app.focus({ steal: true })

‎apps/desktop/playwright.config.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@ export default defineConfig({
44
testDir: './e2e',
55
timeout: 90_000,
66
workers: 1,
7-
retries: process.env.CI ? 1 : 0,
87
reporter: process.env.CI ? [['github'], ['list']] : [['list']],
98
})

‎apps/desktop/src/main/browser-agent/session.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2058,6 +2058,11 @@ function userOwnsPageDialogs(tab: AgentTab): boolean {
20582058
function holdPageDialogForUser(tab: AgentTab, respond: (accept: boolean) => void): void {
20592059
if (tab.pageDialog) answerPageDialog(tab, false)
20602060
tab.pageDialog = { request: { requestId: generateId(), kind: 'beforeunload' }, respond }
2061+
// The renderer's modal now holds the decision. A reload pressed from the page keeps keyboard
2062+
// focus in the native view the modal hides, where Escape and Enter would never reach it;
2063+
// answering returns focus to the page (focusAfterPageDialog).
2064+
const win = panelWindow()
2065+
if (win && !win.isDestroyed()) win.webContents.focus()
20612066
events?.onPageStateChanged(tab.view.webContents)
20622067
}
20632068

‎apps/docs/content/docs/cli/reference.mdx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7746,7 +7746,7 @@ sim workflows operations apply <workflowId> [options]
77467746
| --- | --- | --- |
77477747
| `--dry-run` | No | Validate and lint without writing, auditing, or notifying collaborators. Returns the same validation, preparation warnings, lint findings, and ID-ownership conflicts (`409`) as a committed write. `needsRedeployment` describes the pre-write state. For semantic operations, `mintedBlockIds` is empty; `previewBlockIds` contains provisional IDs with a warning, since committing mints new IDs. |
77487748
| `--no-dry-run` | No | Send --dry-run as false. |
7749-
| `--operations <json\|@file>` | Yes | Edits to apply, in a single batch, keyed by operation_type: [&#123;"operation_type":"add","block_id":"my-fn","params":&#123;"type":"function","name":"My Fn","inputs":&#123;"code":"return &#123;ok:true&#125;"&#125;&#125;&#125;,&#123;"operation_type":"edit","block_id":"&lt;uuid&gt;","params":&#123;"name":"Renamed","connections":&#123;"success":"my-fn"&#125;&#125;&#125;,&#123;"operation_type":"delete","block_id":"&lt;uuid&gt;"&#125;]. Also extract_from_subflow, whose params carry &#123;"subflowId":"&lt;loop-id&gt;"&#125;, and insert_into_subflow, which creates a block and so takes an add’s params plus that subflowId (JSON, or @path / @- to read a file or stdin). |
7749+
| `--operations <json\|@file>` | Yes | Edits to apply, in a single batch, keyed by operation_type: [&#123;"operation_type":"add","block_id":"my-fn","params":&#123;"type":"function","name":"My Fn","inputs":&#123;"code":"return &#123;ok:true&#125;"&#125;&#125;&#125;,&#123;"operation_type":"edit","block_id":"&lt;uuid&gt;","params":&#123;"name":"Renamed","connections":&#123;"success":"my-fn"&#125;&#125;&#125;,&#123;"operation_type":"delete","block_id":"&lt;uuid&gt;"&#125;]. Also extract_from_subflow, whose params carry &#123;"subflowId":"&lt;loop-id&gt;"&#125;, and insert_into_subflow, which creates a block and so takes an add’s params plus that subflowId. To move an existing block into a loop or parallel (keeping its id), edit it with params &#123;"parentId":"&lt;loop-id&gt;"&#125;; &#123;"parentId":null&#125; moves it out (JSON, or @path / @- to read a file or stdin). |
77507750
| `--atomic` | No | Fail the whole batch when any operation is declined or any block input would be dropped. The default applies what it can and reports the rest in `skipped` and `inputValidationErrors`; `true` writes nothing and answers `409` instead. |
77517751
| `--no-atomic` | No | Send --atomic as false. |
77527752
| `--layout <value>` | No | Whether to reposition blocks the batch touched. `targeted` (default) nudges only the affected subgraph; `none` leaves every position exactly as supplied. Accepted values: `targeted`, `none`. |
@@ -8368,6 +8368,7 @@ sim workflows deploy <workflowId> [options]
83688368
| --- | --- | --- |
83698369
| `--name <value>` | No | Optional label for the deployment version. |
83708370
| `--description <value>` | No | Optional release note for the deployment version. |
8371+
| `-y, --yes` | No | Accepted and ignored: this command needs no confirmation. |
83718372

83728373
</CommandTable>
83738374

@@ -8639,7 +8640,7 @@ Compiles workflow.ts (and the function files it names) with the compiler the ser
86398640

86408641
Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics.
86418642

8642-
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict never fails on a warning. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
8643+
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
86438644

86448645
### sim workflows source status
86458646

@@ -10017,7 +10018,7 @@ Compiles every workflows/&lt;key&gt;/workflow.ts (and the function files each na
1001710018

1001810019
Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics.
1001910020

10020-
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict never fails on a warning. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
10021+
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
1002110022

1002210023
Exit 10 (busy, retry): another sim workspaces source command is using this directory (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.
1002310024

‎apps/docs/content/docs/cli/workflows.mdx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ sim workflows operations apply <workflowId> [options]
326326
| --- | --- | --- |
327327
| `--dry-run` | No | Validate and lint without writing, auditing, or notifying collaborators. Returns the same validation, preparation warnings, lint findings, and ID-ownership conflicts (`409`) as a committed write. `needsRedeployment` describes the pre-write state. For semantic operations, `mintedBlockIds` is empty; `previewBlockIds` contains provisional IDs with a warning, since committing mints new IDs. |
328328
| `--no-dry-run` | No | Send --dry-run as false. |
329-
| `--operations <json\|@file>` | Yes | Edits to apply, in a single batch, keyed by operation_type: [&#123;"operation_type":"add","block_id":"my-fn","params":&#123;"type":"function","name":"My Fn","inputs":&#123;"code":"return &#123;ok:true&#125;"&#125;&#125;&#125;,&#123;"operation_type":"edit","block_id":"&lt;uuid&gt;","params":&#123;"name":"Renamed","connections":&#123;"success":"my-fn"&#125;&#125;&#125;,&#123;"operation_type":"delete","block_id":"&lt;uuid&gt;"&#125;]. Also extract_from_subflow, whose params carry &#123;"subflowId":"&lt;loop-id&gt;"&#125;, and insert_into_subflow, which creates a block and so takes an add’s params plus that subflowId (JSON, or @path / @- to read a file or stdin). |
329+
| `--operations <json\|@file>` | Yes | Edits to apply, in a single batch, keyed by operation_type: [&#123;"operation_type":"add","block_id":"my-fn","params":&#123;"type":"function","name":"My Fn","inputs":&#123;"code":"return &#123;ok:true&#125;"&#125;&#125;&#125;,&#123;"operation_type":"edit","block_id":"&lt;uuid&gt;","params":&#123;"name":"Renamed","connections":&#123;"success":"my-fn"&#125;&#125;&#125;,&#123;"operation_type":"delete","block_id":"&lt;uuid&gt;"&#125;]. Also extract_from_subflow, whose params carry &#123;"subflowId":"&lt;loop-id&gt;"&#125;, and insert_into_subflow, which creates a block and so takes an add’s params plus that subflowId. To move an existing block into a loop or parallel (keeping its id), edit it with params &#123;"parentId":"&lt;loop-id&gt;"&#125;; &#123;"parentId":null&#125; moves it out (JSON, or @path / @- to read a file or stdin). |
330330
| `--atomic` | No | Fail the whole batch when any operation is declined or any block input would be dropped. The default applies what it can and reports the rest in `skipped` and `inputValidationErrors`; `true` writes nothing and answers `409` instead. |
331331
| `--no-atomic` | No | Send --atomic as false. |
332332
| `--layout <value>` | No | Whether to reposition blocks the batch touched. `targeted` (default) nudges only the affected subgraph; `none` leaves every position exactly as supplied. Accepted values: `targeted`, `none`. |
@@ -396,6 +396,7 @@ sim workflows deploy <workflowId> [options]
396396
| --- | --- | --- |
397397
| `--name <value>` | No | Optional label for the deployment version. |
398398
| `--description <value>` | No | Optional release note for the deployment version. |
399+
| `-y, --yes` | No | Accepted and ignored: this command needs no confirmation. |
399400

400401
</CommandTable>
401402

@@ -1443,7 +1444,7 @@ Compiles workflow.ts (and the function files it names) with the compiler the ser
14431444

14441445
Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics.
14451446

1446-
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict never fails on a warning. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
1447+
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
14471448

14481449
### Show the content of the changes in a workflow source directory
14491450

‎apps/docs/content/docs/cli/workspaces.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ Compiles every workflows/&lt;key&gt;/workflow.ts (and the function files each na
788788

789789
Exit codes: 0 no errors; 1 errors (each printed as file:line:column with its frame and hint), or no cached catalog (run the get once). With --output json, stdout is one document that also lists every finding under diagnostics.
790790

791-
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict never fails on a warning. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
791+
These warnings, which an apply saves as written, fail the check as errors on every block the lock does not bind (a block added since the get, or every block of a new workflow): W_REQUIRED_MISSING, W_UNKNOWN_OPTION, W_UNKNOWN_OUTPUT_PATH, W_VALUE_KIND, W_OUT_OF_RANGE, W_LITERAL_SECRET, W_TABLE_UNKNOWN_COLUMN, W_CHILD_INPUT_UNKNOWN, W_BRANCH_UNWIRED, W_UNRESOLVED_REF. --strict fails on them in every block, except W_BRANCH_UNWIRED on a block the lock binds (the stored workflow may hold it, and the server then stays quiet); --no-strict fails on none of them. In a function file changed since the get, W_UNRESOLVED_REF is the error E_APPLY_UNRESOLVED_REF in every mode, as the server refuses it. W_JSON_REF_UNTYPED is reported only on blocks the lock does not bind, and with --strict on every block.
792792

793793
Exit 10 (busy, retry): another sim workspaces source command is using this directory (SOURCE_DIR_BUSY); nothing was read or written. Run this one again once it finished.
794794

0 commit comments

Comments
 (0)