You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17Lines changed: 17 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -336,6 +336,10 @@ WebBrain accepts slash commands as the first thing on a line in the input box. T
336
336
|`/memory`| Show saved user memory |
337
337
|`/memory --add <text>`| Save a user preference to memory |
338
338
|`/memory --forget <id>`| Forget a saved memory by ID |
339
+
|`/workflow`| List saved workflows and their IDs |
340
+
|`/workflow --save <name>`| Compile the latest successful traced run into a reusable, value-free workflow |
341
+
|`/workflow --run <id>`| Run a saved workflow in Act mode, collecting any runtime parameters locally |
342
+
|`/workflow --delete <id>`| Delete a saved workflow |
339
343
|`/allow-api`|**Per-conversation API mutation override.** Lifts the UI-first restriction so the agent may use POST/PUT/PATCH/DELETE via `fetch_url` when UI is failing. Badge appears while active; clears on `/reset`. |
340
344
|`/dangerously-skip-permissions`|**Global permission-prompt bypass.** Turns off `Ask before consequential actions` without opening Settings. WebBrain will act without per-site prompts until you re-enable the setting. |
341
345
|`/compact`| Force context compaction for the current conversation |
@@ -373,6 +377,19 @@ the originating run tab before saving the after screenshot. If the recording
373
377
or initial screenshot cannot be started and saved, the run is not sent.
374
378
Standalone `/record` and `/screenshot` keep their existing behavior.
375
379
380
+
Saved workflows use a separate `webbrain-workflow/1` schema; they are not raw
query strings, fragments, and typed field values are excluded. Typed values become runtime
383
+
parameters, and each action is bound to the recorded origin and URL family.
384
+
At run time WebBrain resolves a fresh accessibility-tree target and executes
385
+
through the normal Act permission, submit-confirmation, and verification gates.
386
+
Ambiguous targets fail closed. If an action may already have happened but its
387
+
result is unknown, replay stops instead of retrying it. Runtime parameter values
388
+
are not saved to the workflow, conversation, user memory, replay trace, or Agent
389
+
fallback prompt; they are still delivered to the target page by the requested
390
+
browser action. The original opt-in source trace remains separate and can
391
+
contain raw tool arguments until the user deletes that trace.
392
+
376
393
The default UI-first rule exists because API actions are invisible (you don't see what's being sent), often require separate auth tokens you may not have configured, and can have a much larger blast radius than a visible mis-click. Only use `/allow-api` when you've decided you want that tradeoff for a specific job.
Copy file name to clipboardExpand all lines: docs/architecture.md
+29Lines changed: 29 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -470,6 +470,35 @@ job. A short queue drains best-effort through the active provider using the
470
470
existing cost allowance guard; cost exhaustion skips extraction silently, and
471
471
other failures retry once.
472
472
473
+
### Saved workflows (`agent/workflows.js`)
474
+
475
+
Saved workflows are compiled artifacts, not serialized trace events. The
476
+
background reads the newest successful trace in the active conversation and
477
+
normalizes its replayable actions into `webbrain-workflow/1`, stored under
478
+
`wb_saved_workflows_v1`. Compilation removes historical element references,
479
+
action CSS selectors, coordinates, query strings, fragments, and typed values. Every typed field
480
+
value becomes a declared runtime parameter; unsupported or failed actions are
481
+
skipped and reported to the user as save warnings.
482
+
483
+
Each compiled step contains semantic target metadata (role, accessible name,
484
+
label, field identity, link, or placeholder), an expected postcondition, and
485
+
the origin/path family observed before that action. `/workflow --run <id>`
486
+
collects parameters in an ephemeral side-panel form. The replay executor then:
487
+
488
+
1. checks the current origin/path family before every step;
489
+
2. reads a fresh accessibility tree and resolves exactly one semantic match;
490
+
3. calls `_executeToolBatch()` so the existing permission, form-submit,
491
+
verification, abort, and action-normalization gates remain authoritative;
492
+
4. validates the saved postcondition; and
493
+
5. either continues deterministically, delegates a known-safe mismatch to the
494
+
normal Agent, or stops when a state-changing action has an unknown outcome.
495
+
496
+
Replay does not set `currentRunId`, because ordinary tool tracing would retain
497
+
runtime values. It creates a separate run containing sanitized notes and
498
+
redacted UI tool events. Runtime parameter values are also omitted from the
499
+
fallback prompt and user-memory extraction. Chrome and Firefox ship identical
500
+
workflow schema/compiler code and the same replay policy.
501
+
473
502
### Scheduled Tasks (`scheduler.js`)
474
503
475
504
The scheduler lets the agent defer work to a future browser session using the browser's `alarms` API. It lives in `src/chrome/src/agent/scheduler.js` (and the Firefox mirror) and is instantiated as `ScheduledJobManager` in the background script.
Copy file name to clipboardExpand all lines: docs/privacy-and-data-flow.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -117,6 +117,30 @@ When enabled (Settings → Display → "Record traces"), every agent run is writ
117
117
118
118
The Traces page (`ui/traces.html`) reads from local IndexedDB only. Export produces a JSON blob saved to the user's Downloads folder. **No trace data ever leaves the browser.**
119
119
120
+
### Saved Workflows
121
+
122
+
`/workflow --save <name>` locally compiles the latest successful trace into a
123
+
separate `webbrain-workflow/1` record in browser local storage
124
+
(`wb_saved_workflows_v1`). The saved record contains action names, sanitized
postconditions, and parameter descriptors. It does not contain typed field
127
+
values, raw historical `ref_id` values, action CSS selectors, coordinates, URL query strings, or URL
128
+
fragments.
129
+
130
+
`/workflow --run <id>` collects declared values in a temporary side-panel form
131
+
and sends them directly to the background replay executor. The values are not
132
+
written to the workflow, chat text, retry payload, user memory, replay trace,
133
+
or Agent fallback prompt. They necessarily reach the active page when the
134
+
requested field action runs. A source trace is a separate opt-in record and may
135
+
still contain the original raw tool arguments; saving a workflow does not
136
+
delete or redact that source trace.
137
+
138
+
Replay traces contain workflow/step IDs, semantic match status and score,
139
+
postcondition status, fallback status, and estimated model calls saved. They do
140
+
not contain runtime parameter values or freshly resolved element references.
141
+
If deterministic replay cannot safely continue, a fallback Agent receives only
142
+
saved metadata and must ask the user again for any still-needed value.
143
+
120
144
### Settings
121
145
122
146
Provider configs (API keys, base URLs, model selections) are stored in `chrome.storage.local`. API keys are in plaintext — this is a personal-computer tool and the storage is sandboxed by the browser. The extension has no mechanism to exfiltrate these keys.
0 commit comments