Files
ar9av__obsidian-wiki/extensions/brain/manifest.json
ar9av d3e545b012 feat(extensions): fill web forms from the vault; rename to Brain
The brain-capture extension only went one way: browser -> vault. This adds
the return path — read the form on the current page, answer what the vault
supports, and leave the rest blank — and folds both directions into a single
two-tab extension renamed from "Brain Vault Capture" to "Brain".

Retrieval never calls a model. `obsidian-wiki context-pack --json` ranks the
vault deterministically and the model does one narrow job: map retrieved facts
onto fields. One `claude -p` / `codex exec` invocation per fill, billed to the
subscription the user already has. Nothing is ever submitted.

A native messaging host bridges the two, staged into ~/.obsidian-wiki/ rather
than run from the checkout. Chrome's children do not inherit your shell, and
all three consequences bite:

- macOS TCC: ~/Documents is mode 700 with an ACL, and a native host inherits
  Chrome's TCC context, so a checkout there cannot be exec'd at all. Chrome
  reports this as "Native host has exited", identical to a crash.
- PATH: Chrome passes a minimal PATH, hiding claude/codex in ~/.local/bin.
- USER/LOGNAME: Claude Code reads OAuth credentials from the macOS login
  Keychain and needs these to find them, else "Not logged in" despite a valid
  session.

The host bookends every run in its log so those failures stay distinguishable,
re-validates every returned fill against the real form schema (an injected
value cannot reach a field the page never advertised), and forwards the pack's
instruction_policy so vault excerpts stay data rather than instruction.

Form-schema extraction resolves labels via aria-labelledby before aria-label:
Google Forms puts aria-label="Your answer" on every paragraph field while the
real question sits behind aria-labelledby, so checking aria-label first
silently mislabelled exactly the textarea fields. Values are written through
the native setter with input/change dispatched, so React-controlled forms see
a genuine edit.

Docs: docs/browser-extension.md, linked from both READMEs and the docs index.
Also backfills the untranslated tagline from #159 into README_TW.md.
2026-08-14 23:43:19 -07:00

32 lines
1.1 KiB
JSON

{
"manifest_version": 3,
"name": "Brain",
"description": "Capture pages into your Obsidian brain vault, and fill web forms from it using your existing Claude Code / Codex subscription.",
"version": "0.2.0",
"action": {
"default_title": "Brain",
"default_popup": "popup.html",
"default_icon": {
"16": "assets/icon-16.png",
"48": "assets/icon-48.png",
"128": "assets/icon-128.png"
}
},
"icons": {
"16": "assets/icon-16.png",
"48": "assets/icon-48.png",
"128": "assets/icon-128.png"
},
"background": {
"service_worker": "background.js"
},
"permissions": [
"activeTab",
"contextMenus",
"scripting",
"nativeMessaging",
"storage"
],
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAviIifjDNa+37CVfNLRGcS6n4IBFKvSRRBfhJSn+8Z/NvR+jt3WU/22KlNqb+KuuhUKSnfPYxPQrlMfGe7KfWqNFdm4jx4AR99+zgEeasAAN6e//EWQU4iRlN44FnSn/jLn8wpgzFJH7Qo2oS0A9BOlyJHtIB++ZUi808YcLe2x8uDGTWP/MsYl8I+3f5kYhyZBFwf6mAAy5glTgnaOlhpWY7HE4e29TG9EAwhNeyjv/HPDmFWdX3LLgvXkVoDjZM3W+x/bpqG88w+XTVbEX7P7lV+j028gXDZBJOhvnn3VbU9IKfVGKOkUmhL+zYDDsBX5ObdtlNSvuYqaRqBgKIGQIDAQAB"
}