@staff0rd/assist 0.931.0 → 0.932.1
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 +2 -0
- package/allowed.cli-reads +2 -0
- package/dist/allowed.cli-reads +2 -0
- package/dist/commands/extension/extension/background.js +1 -1
- package/dist/commands/extension/extension/content.js +29 -29
- package/dist/commands/extension/extension/docs.js +21 -21
- package/dist/commands/extension/extension/manifest.json +1 -1
- package/dist/commands/sessions/web/bundle.js +1 -1
- package/dist/index.js +865 -778
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -346,6 +346,8 @@ Rules are `- **<code>** — **<title>** — <text>` bullets, the title optional,
|
|
|
346
346
|
- `assist netcap extract-linkedin-posts [file]` - Parse a netcap capture into structured LinkedIn posts
|
|
347
347
|
- `assist extension [--sign] [--url]` - Locate the [assist browser extension](#assist-browser-extension) to load unpacked; `--sign` signs it for a permanent Firefox install; `--url` prints the latest signed build's download URL
|
|
348
348
|
- `assist browser status [--url <substring>] [--server <url>]` - Through the [browser link](#browser-link), print the connected extension's version, the target tab's URL and whether the assist content script runs there; `--url` targets the most recently active tab whose URL contains the substring instead of the focused window's active tab; `--server` is the web server the extension connects to (default `http://localhost:3100`)
|
|
349
|
+
- `assist browser snapshot [--url <substring>] [--server <url>]` - Write the target tab's DOM (`outerHTML`) to `~/.assist/browser/<host>-<timestamp>.html` and print the tab's URL and the file's path
|
|
350
|
+
- `assist browser inspect [selector] [--text <text>] [--url <substring>] [--server <url>]` - For each element matching the CSS selector, or whose own text contains `--text` (skipping `script`/`style`), print its rendered size, text (first 80 characters) and ancestor chain from `html` down, one `tag#id.class.class` per line; prints the first 20 matches with the total, or that nothing matched
|
|
349
351
|
- `assist screenshot <process>` - Capture a screenshot of a running application window (`screenshot.outputDir`, default `./screenshots`)
|
|
350
352
|
- `assist mermaid export [file.md]` - Render each fenced mermaid block to SVG via [Kroki](https://kroki.io) (`--out`, `--index`, `mermaid.krokiUrl`)
|
|
351
353
|
- `assist prompts` - Show the most frequently denied tool calls
|
package/allowed.cli-reads
CHANGED
package/dist/allowed.cli-reads
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{function m(){return globalThis.browser?.storage?.local}function w(s){let e;try{e=new URL(s.trim())}catch{return}if(!(e.protocol!=="http:"&&e.protocol!=="https:"))return e.origin}var _="http://localhost:3100",
|
|
1
|
+
"use strict";(()=>{function m(){return globalThis.browser?.storage?.local}function w(s){let e;try{e=new URL(s.trim())}catch{return}if(!(e.protocol!=="http:"&&e.protocol!=="https:"))return e.origin}var _="http://localhost:3100",d="serverUrl";async function u(){let e=(await m()?.get(d).catch(()=>{}))?.[d];return typeof e=="string"&&w(e)||_}function p(){let s=globalThis.browser;return s?.runtime&&s.tabs?s:void 0}var I=new Set(["localhost","127.0.0.1"]);function b(s){if(!s)return!1;let e;try{e=new URL(s)}catch{return!1}let{protocol:t,hostname:r}=e;return t==="http:"?I.has(r):t!=="https:"?!1:r==="github.com"||r==="dev.azure.com"||r.endsWith(".visualstudio.com")}function y(s){return s.reduce((e,t)=>!e||(t.lastAccessed??0)>(e.lastAccessed??0)?t:e,void 0)}function R(s,e,t){if(t)return y(s.filter(n=>n.url?.includes(t)));let r=s.filter(n=>n.active);return r.find(n=>n.windowId===e)??y(r)}function k(s,e,t){let r=t?.running===!0;return s==="status"?{ok:!0,result:{tabUrl:e,contentScript:r}}:r?t.error||!t.result?{ok:!1,tabUrl:e,error:t.error??"empty probe reply"}:{ok:!0,result:{tabUrl:e,...t.result}}:{ok:!1,tabUrl:e,error:"the assist content script is not running on the target tab (reload the tab, or update the extension)"}}var h="assist-browser-probe",A="/ws/browser";var F="github.com, dev.azure.com, *.visualstudio.com, localhost, 127.0.0.1";async function S(s){let e=p();if(!e)return{ok:!1,error:"browser tabs API unavailable"};let[t,r]=await Promise.all([e.tabs.query({}),e.windows?.getLastFocused().catch(()=>{})]),n=R(t,r?.id,s.url);if(!n||n.id===void 0)return{ok:!1,error:s.url?`no open tab has a URL containing "${s.url}"`:"no active tab found"};let o=n.url;if(!o||!b(o))return{ok:!1,tabUrl:o,error:`the target tab is not on an assist host (${F})`};let l=await e.tabs.sendMessage(n.id,{...s,type:h}).then(a=>a).catch(()=>{});return k(s.op,o,l)}var x="assist-browser-link",U=5e3,i,f;function B(){let s=p();s&&(s.alarms?.create(x,{periodInMinutes:.5}),s.alarms?.onAlarm.addListener(e=>{e.name===x&&g()}),s.storage?.onChanged.addListener(e=>{d in e&&i?.close()}),g())}function g(){f||i&&i.readyState<=WebSocket.OPEN||(f=D().finally(()=>{f=void 0}))}async function D(){let s=await u(),e=new WebSocket(`${s.replace(/^http/,"ws")}${A}`);i=e,e.addEventListener("open",()=>v(e,{type:"hello",version:p()?.runtime.getManifest().version??"unknown"})),e.addEventListener("message",t=>{q(e,t.data)}),e.addEventListener("close",()=>{i===e&&(i=void 0,setTimeout(g,U))})}async function q(s,e){let t;try{t=JSON.parse(String(e))}catch{return}if(t.type!=="request")return;let r=await S(t).catch(n=>({ok:!1,error:n instanceof Error?n.message:String(n)}));v(s,{...r,type:"response",id:t.id})}function v(s,e){s.readyState===WebSocket.OPEN&&s.send(JSON.stringify(e))}function M(s){let{type:e,pageId:t,prompt:r}=s??{};return e==="assist-docs-feedback"&&typeof t=="string"&&typeof r=="string"}async function c(s,e,t){let r;try{r=await fetch(`${s}${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch{return{ok:!1,message:`assist web server unreachable at ${s}`}}let n=await r.json().catch(()=>({}));return r.ok?{ok:!0,data:n}:{ok:!1,message:n.error??`assist web server returned ${r.status}`}}async function P(s,{type:e,...t}){let r=await c(s,"/api/sessions/docs-feedback",t);return r.ok?{ok:!0,message:r.data.message??"Sent to the docs session"}:r}var W={draft:["draft","--once"],bug:["bug","--once"]};function T(s){return typeof s=="string"&&Object.hasOwn(W,s)}function E(s){let{type:e,url:t,args:r,mode:n}=s??{};return e==="assist-send"&&typeof t=="string"&&(r===void 0||Array.isArray(r)&&r.every(o=>typeof o=="string"))&&(n===void 0||T(n))}function L(){return globalThis.browser?.runtime}async function O(s,{url:e,instructions:t,args:r,mode:n}){let[o,l]=r?["review-from-github",{url:e,args:r}]:["from-github",{url:e,instructions:t,mode:n}],a=await c(s,`/api/sessions/${o}`,l);return a.ok?{ok:!0,message:`assist session started in ${a.data.cwd}`}:a}function G(){L()?.onMessage.addListener(s=>{if(E(s))return u().then(e=>O(e,s));if(M(s))return u().then(e=>P(e,s))})}G();B();})();
|