Skip to content

Record a Skill from the bot's browser (reusing user-takeover CDP listener, redacting Secrets) - #384

Merged
d41sys merged 1 commit into
mainfrom
issue-377-record-skill
Dec 4, 2026
Merged

d41sys merged 1 commit into
mainfrom
issue-377-record-skill

Conversation

@d41sys

@d41sys d41sys commented Dec 4, 2026

Copy link
Copy Markdown
Owner

Summary

Closes #377.

Lets a person teach a bot a repeatable browser workflow once by performing it in the bot's Chrome window, producing a plain, editable SKILL.md reviewed in a sheet before saving:

  • Isolated-world CDP recording (appd/src/browser.rs):
    • Reuses the existing isolated-world bateUser binding (WORLD = "bate", invisible to page scripts) while a recording session is active to capture navigated URLs (open), clicked element roles/accessible labels/selectors (click), dropdown picks (select), and typed fields (type) up to 100 steps.
    • Double-layer Secret safety:
      1. In the isolated-world listener, type="password" and autocomplete="one-time-code" fields never have their .value read or transmitted.
      2. In browser::draft_skill, password inputs are rendered with Secret: <name> (matching the bot's saved Secret for that host, or Secret: <secret-name>), and any non-password value matching or containing any saved Secret of the bot (plain, form-encoded, or URL-encoded) is replaced with Secret: <name>.
  • Service commands & atomic skill install (appd/src/skills.rs, appd/src/core.rs):
    • Added start_recording (runs Chrome launch/attach off Core::run, sets recording: true on Bot), stop_recording (drains steps, redacts against secrets_of(bot), drafts SKILL.md), and save_recorded_skill (validates SKILL.md via proto::skills::parse and installs atomically through skills::install_texts).
  • UI in both window/ui and native (window/ui/src/Skills.tsx, native/src/skills.rs):
    • Adds Record from browser… / Stop recording () in the Add-ons → Skills header, a Record a skill sheet (bot browser + optional starting URL), and a Review recorded skill sheet with an editable SKILL.md text area and bot picker to save or discard.

Evidence

  • cd window/ui && npm ci && npm run build && npm test: 142/142 passed.
  • cargo fmt --all --check: clean.
  • cargo clippy --workspace --all-targets --locked -- -D warnings: clean.
  • cargo test --workspace --locked: all crates passed, including:
    • appd unit test: browser::tests::recorded_steps_draft_a_skill_with_passwords_and_secrets_redacted.
    • appd --test service: record_skill_from_browser_redacts_passwords_and_secrets_and_refuses_devices (fake CDP pipe verifying start_recording, stop_recording, password + saved Secret redaction, save_recorded_skill, and LAN Device forbidden refusal).
    • native --test addons: record_skill_from_browser_and_review_sheet_saves_skill plus visually verified light/dark Skills snapshots.

Merge Danger

Low. Existing user-takeover detection on bateUser is preserved unchanged; recording is inert unless explicitly started by the local window.

Device decision

  • start_recording, stop_recording, and save_recorded_skill are all listed in REFUSED_OVER_LAN (appd/src/lan.rs) and refused forbidden to paired Devices, matching preview_skill, install_skill, and discover_skills. Documented in PROTOCOL.md.

@d41sys
d41sys merged commit a46ed89 into main Dec 4, 2026
5 checks passed
@d41sys
d41sys deleted the issue-377-record-skill branch December 4, 2026 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record a Skill from the bot's browser (reusing user-takeover CDP listener, redacting Secrets)

1 participant