@staff0rd/assist 0.836.0 → 0.838.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 CHANGED
@@ -572,6 +572,8 @@ 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
@@ -1 +1 @@
1
- "use strict";(()=>{function o(){return globalThis.browser?.storage?.local}function i(s){let e;try{e=new URL(s.trim())}catch{return}if(!(e.protocol!=="http:"&&e.protocol!=="https:"))return e.origin}var p="http://localhost:3100",a="serverUrl";async function u(){let e=(await o()?.get(a).catch(()=>{}))?.[a];return typeof e=="string"&&i(e)||p}function g(s){let{type:e,url:n}=s??{};return e==="assist-send"&&typeof n=="string"}function d(){return globalThis.browser?.runtime}async function l(s,{url:e,instructions:n}){let t;try{t=await fetch(`${s}/api/sessions/from-github`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e,instructions:n})})}catch{return{ok:!1,message:`assist web server unreachable at ${s}`}}let r=await t.json().catch(()=>({}));return t.ok?{ok:!0,message:`assist session started in ${r.cwd}`}:{ok:!1,message:r.error??`assist web server returned ${t.status}`}}function c(){d()?.onMessage.addListener(s=>{if(g(s))return u().then(e=>l(e,s))})}c();})();
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();})();