@staff0rd/assist 0.835.0 → 0.837.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -9
- package/allowed.cli-reads +1 -1
- package/claude/commands/extension.md +1 -1
- package/dist/allowed.cli-reads +1 -1
- package/dist/commands/extension/extension/background.js +1 -0
- package/dist/commands/extension/extension/content.js +332 -0
- package/dist/commands/{criteriaExtension/criteria-extension → extension/extension}/manifest.json +4 -4
- package/dist/commands/extension/extension/updates.json +7 -0
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/index.js +162 -97
- package/package.json +1 -1
- package/dist/commands/criteriaExtension/criteria-extension/background.js +0 -1
- package/dist/commands/criteriaExtension/criteria-extension/content.js +0 -332
- package/dist/commands/criteriaExtension/criteria-extension/updates.json +0 -12
- /package/dist/commands/{criteriaExtension/criteria-extension → extension/extension}/icons/assist-128.png +0 -0
- /package/dist/commands/{criteriaExtension/criteria-extension → extension/extension}/icons/assist-16.png +0 -0
- /package/dist/commands/{criteriaExtension/criteria-extension → extension/extension}/icons/assist-32.png +0 -0
- /package/dist/commands/{criteriaExtension/criteria-extension → extension/extension}/icons/assist-master.png +0 -0
- /package/dist/commands/{criteriaExtension/criteria-extension → extension/extension}/options.html +0 -0
- /package/dist/commands/{criteriaExtension/criteria-extension → extension/extension}/options.js +0 -0
package/README.md
CHANGED
|
@@ -332,7 +332,7 @@ Rules are `- **<code>** — **<title>** — <text>` bullets, the title optional,
|
|
|
332
332
|
|
|
333
333
|
- `assist netcap [-p, --port <port>] [-o, --out <dir>] [-f, --filter <pattern>]` - Capture browser network traffic under `--out` (default `~/.assist/netcap`), paired with the [netcap browser extension](#netcap-browser-extension)
|
|
334
334
|
- `assist netcap extract-linkedin-posts [file]` - Parse a netcap capture into structured LinkedIn posts
|
|
335
|
-
- `assist
|
|
335
|
+
- `assist extension [--sign] [--url]` - Locate the [acceptance criteria outliner extension](#acceptance-criteria-outliner-extension) to load unpacked; `--sign` signs it for a permanent Firefox install; `--url` prints the latest signed build's download URL
|
|
336
336
|
- `assist screenshot <process>` - Capture a screenshot of a running application window (`screenshot.outputDir`, default `./screenshots`)
|
|
337
337
|
- `assist mermaid export [file.md]` - Render each fenced mermaid block to SVG via [Kroki](https://kroki.io) (`--out`, `--index`, `mermaid.krokiUrl`)
|
|
338
338
|
- `assist prompts` - Show the most frequently denied tool calls
|
|
@@ -560,9 +560,9 @@ A restart kills every managed session's pty, which also kills any background tas
|
|
|
560
560
|
|
|
561
561
|
## Acceptance criteria outliner extension
|
|
562
562
|
|
|
563
|
-
`assist
|
|
563
|
+
`assist extension` prints the directory to load unpacked. The extension is a Manifest V3 content script scoped to `https://github.com/*`, plus a background script and an options page, built by `npm run build` from `src/commands/extension/` into `extension/content.js`, `background.js` and `options.js` (gitignored). It adds an **Outline criteria** toggle to the markdown toolbar of an issue's body editor and the new-issue form, re-attaching after client-side navigation; pressing it hides the textarea and mounts the same `AcceptanceCriteriaOutline` control the web preview panel uses, in a shadow root with its own emotion cache and MUI theme. A body whose acceptance criteria are bullets, checkboxes or prose gets a **Convert to outline** button instead, and a body with no acceptance criteria heading gets **Add acceptance criteria**. Each edit is written back through `writeAcceptanceCriteria` into the textarea and dispatched as an `input` event, so GitHub's own Save pushes it.
|
|
564
564
|
|
|
565
|
-
1. Run `assist
|
|
565
|
+
1. Run `assist extension` — it prints the extension directory. Under WSL it copies the extension to `C:\tools\extension` and prints that Windows path instead; re-run and reload the extension after a rebuild.
|
|
566
566
|
2. Load the unpacked extension:
|
|
567
567
|
- **Chrome**: open `chrome://extensions`, enable **Developer mode**, click **Load unpacked**, and select the extension directory.
|
|
568
568
|
- **Firefox**: open `about:debugging#/runtime/this-firefox` → **Load Temporary Add-on…** → pick `manifest.json` inside the printed extension directory. Firefox drops a temporary add-on on every restart; see [permanent Firefox install](#permanent-firefox-install) to avoid that.
|
|
@@ -572,25 +572,29 @@ A restart kills every managed session's pty, which also kills any background tas
|
|
|
572
572
|
|
|
573
573
|
The extension also adds an **assist** button beside each PR review comment, review and issue comment timestamp, and to the PR/issue header. Pressing it opens a popover with an optional instructions field; **Enter** sends (even when empty), **Shift+Enter** adds a newline and **Escape** closes. The background script POSTs the link and instructions to the assist web server's `POST /api/sessions/from-github` (`{ url, instructions? }`), which parses `owner/repo` from the GitHub URL, finds its clone under `clone.baseDir` and starts a Claude session there whose prompt is the link followed by the instructions, answering `{ sessionId, cwd }`. A toast reports the result: a URL that isn't a GitHub repo link gets a 400, a repo that isn't cloned gets a 404 saying so (nothing is cloned), and an unreachable server names the URL the extension tried. The endpoint has no auth and answers CORS only for `moz-extension://` and `chrome-extension://` origins.
|
|
574
574
|
|
|
575
|
+
On a PR page the header button opens a menu of the same review modes as the web app's PR dialog instead (Review, Review & refine, Review & apply, Review & post, High-level review). Picking one POSTs `{ url, args }` to `POST /api/sessions/review-from-github`, which resolves the clone the same way and starts an assist session running the mode's args plus the PR number. Args that aren't one of the shared review modes get a 400.
|
|
576
|
+
|
|
575
577
|
Sending is Firefox-only (it relies on the `browser.*` promise APIs). The web server URL is set on the extension's options page (**about:addons** → the extension → **Options**) and defaults to `http://localhost:3100`. `host_permissions` covers any port on `localhost` and `127.0.0.1`; another host relies on the endpoint's CORS.
|
|
576
578
|
|
|
577
579
|
### Permanent Firefox install
|
|
578
580
|
|
|
579
581
|
Firefox release and beta only install signed add-ons, so a permanent install means having Mozilla sign the package. Signing uses AMO's **unlisted** (self-distribution) channel: Mozilla signs the `.xpi` and hands it back, with no public store listing and no human review queue.
|
|
580
582
|
|
|
581
|
-
Signing runs in CI, so the AMO key lives only as repo secrets and never on a developer machine. One-time setup: create an AMO API key at [addons.mozilla.org/developers/addon/api/key](https://addons.mozilla.org/en-US/developers/addon/api/key/) and add its two halves as the repo secrets `AMO_JWT_ISSUER` (the `user:12345678:123` issuer) and `AMO_JWT_SECRET`. The **
|
|
583
|
+
Signing runs in CI, so the AMO key lives only as repo secrets and never on a developer machine. One-time setup: create an AMO API key at [addons.mozilla.org/developers/addon/api/key](https://addons.mozilla.org/en-US/developers/addon/api/key/) and add its two halves as the repo secrets `AMO_JWT_ISSUER` (the `user:12345678:123` issuer) and `AMO_JWT_SECRET`. The **Extension** workflow maps them onto the `WEB_EXT_API_KEY` / `WEB_EXT_API_SECRET` that `web-ext` reads.
|
|
582
584
|
|
|
583
|
-
1. Each release signs a new add-on version on its own when it changed the extension (see below). To sign by hand, run the **
|
|
584
|
-
2. Download `
|
|
585
|
+
1. Each release signs a new add-on version on its own when it changed the extension (see below). To sign by hand, run the **Extension** workflow from the Actions tab (`gh workflow run extension.yml`). It checks out `main`, builds, signs the extension at assist's current version, and uploads the signed add-on to that version's GitHub release as `assist-extension.xpi`. A failed AMO submission fails the job and attaches nothing.
|
|
586
|
+
2. Download `assist-extension.xpi` from the release — the URL follows from the version, `https://github.com/staff0rd/assist/releases/download/v<version>/assist-extension.xpi`. `assist extension --url` (or `/extension`) prints the latest signed build's URL, read from the update manifest on `main`.
|
|
585
587
|
3. Open the `.xpi` in Firefox (drag it onto a window, or `about:addons` → gear → **Install Add-on From File…**). It survives restarts.
|
|
586
588
|
|
|
587
589
|
AMO refuses a version it has already signed, which is why the staged manifest carries assist's version instead of the manifest's `1.0.0` placeholder — sign once per release, not twice at the same version.
|
|
588
590
|
|
|
589
|
-
After each release, the **Release** workflow dispatches **
|
|
591
|
+
After each release, the **Release** workflow dispatches **Extension** for the new tag with `only-if-changed`, which runs `extensionChanged.ts`. A release signs a new add-on version only when, since the last signed version (read from `updates.json` on `main`), it changed `extension/`, `src/commands/extension/`, or any file under `src/commands/sessions/web/ui` that `content.js` bundles, so a change to a criterion row ships. Every other release skips signing and publishes nothing. Dependency bumps alone do not sign; dispatch by hand to ship one. The release workflow dispatches rather than the signing workflow listening for `release: published`, because a release published with `GITHUB_TOKEN` starts no other workflows.
|
|
592
|
+
|
|
593
|
+
Unlisted add-ons get no updates from AMO, so the manifest's `gecko.update_url` points at `extension/updates.json` on `main` instead. `--sign` writes that update manifest next to the `.xpi`, pointing at the signed version's release asset, and the workflow commits it back to `main` with `[skip ci]`, then dispatches **Release** so commits that a release run in flight skipped (seeing `main` move under it) still get released; an installed add-on then upgrades itself on Firefox's next update check (or **Check for Updates** in `about:addons`).
|
|
590
594
|
|
|
591
|
-
|
|
595
|
+
`assist extension --sign` still signs locally for someone who holds an AMO key: export `WEB_EXT_API_KEY` and `WEB_EXT_API_SECRET`, run `npm run build` (to refresh `content.js`), then the command. It stages a copy of the extension with assist's version stamped into `manifest.json`, shells out to `npx web-ext sign`, and writes the signed add-on to `~/.assist/extension/assist-extension.xpi`. Under WSL it copies that to `C:\tools\assist-extension.xpi` and prints the Windows path.
|
|
592
596
|
|
|
593
|
-
|
|
597
|
+
The add-on was previously called `assist criteria outliner` with the id `criteria-outliner@staff0rd.github.io`. It is now `assist` with the id `assist@staff0rd.github.io`, which Firefox treats as a different add-on, so an existing `assist criteria outliner` install no longer updates: remove it in `about:addons` and reinstall via `/extension`.
|
|
594
598
|
|
|
595
599
|
Two alternatives need no signing: **Firefox Developer Edition** or **Nightly** honour `xpinstall.signatures.required = false` in `about:config` and will then install an unsigned local `.xpi` permanently, and Chrome's **Load unpacked** already survives restarts, so the unpacked directory is one-time setup there.
|
|
596
600
|
|
package/allowed.cli-reads
CHANGED
package/dist/allowed.cli-reads
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";(()=>{function a(){return globalThis.browser?.storage?.local}function u(s){let e;try{e=new URL(s.trim())}catch{return}if(!(e.protocol!=="http:"&&e.protocol!=="https:"))return e.origin}var f="http://localhost:3100",g="serverUrl";async function d(){let e=(await a()?.get(g).catch(()=>{}))?.[g];return typeof e=="string"&&u(e)||f}function p(s){let{type:e,url:r,args:t}=s??{};return e==="assist-send"&&typeof r=="string"&&(t===void 0||Array.isArray(t)&&t.every(o=>typeof o=="string"))}function l(){return globalThis.browser?.runtime}async function c(s,{url:e,instructions:r,args:t}){let[o,m]=t?["review-from-github",{url:e,args:t}]:["from-github",{url:e,instructions:r}],n;try{n=await fetch(`${s}/api/sessions/${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(m)})}catch{return{ok:!1,message:`assist web server unreachable at ${s}`}}let i=await n.json().catch(()=>({}));return n.ok?{ok:!0,message:`assist session started in ${i.cwd}`}:{ok:!1,message:i.error??`assist web server returned ${n.status}`}}function S(){l()?.onMessage.addListener(s=>{if(p(s))return d().then(e=>c(e,s))})}S();})();
|