@staff0rd/assist 0.1214.1 → 0.1215.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/agent/commands/add-rule.md +4 -4
- package/dist/.build-files +13 -13
- package/dist/built-version +1 -1
- package/dist/{chunk-VGS5ZEQT.js → chunk-2TMQUTOS.js} +1 -1
- package/dist/{chunk-VW44HB3H.js → chunk-3SKC4DB5.js} +1 -1
- package/dist/{chunk-5P7K4AQE.js → chunk-CHMEFETN.js} +1 -1
- package/dist/{chunk-PIU2MX64.js → chunk-N7V4II5E.js} +1 -1
- package/dist/{chunk-5Y7KNNE5.js → chunk-Y4O3JLDR.js} +1 -1
- package/dist/{chunk-TP4K7PB2.js → chunk-ZPDJIRSL.js} +2 -2
- package/dist/commands/extension/extension/background.js +2 -2
- package/dist/commands/extension/extension/manifest.json +5 -8
- package/dist/commands/sessions/web/bundle.js +311 -311
- package/dist/{doctorNodes-P656ZODQ.js → doctorNodes-GHO3YJ6K.js} +3 -3
- package/dist/index.js +11 -11
- package/dist/{restartNode-2WN74YK4.js → restartNode-CY77NQE3.js} +5 -5
- package/dist/{runDaemon-NR2PQHIW.js → runDaemon-SRZBXMEW.js} +2 -2
- package/dist/{signExtension-BONJRXE2.js → signExtension-NVRO7V75.js} +1 -1
- package/dist/{updateNode-MEBAXSIE.js → updateNode-BXG5MAE4.js} +5 -5
- package/dist/{web-G5QTYYKL.js → web-CCHTHGGC.js} +5 -5
- package/dist/{web-P4RNCC5F.js → web-Y22422LO.js} +5 -5
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Capture a new CLAUDE.md rule from a review comment
|
|
3
|
-
allowed_args: "[quoted text, file and note from the comment pane] [--repo [name] | --user | --node]"
|
|
3
|
+
allowed_args: "[quoted text, file and note from the comment pane] [--repo [name] | --user | --node | --scope <path>]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
You are turning a review comment into a written rule in a `CLAUDE.md` file, so the same mistake is caught next time. `$ARGUMENTS` carries what the comment pane sent: an optional `File:` line, the quoted text in a fenced block, and the reviewer's note. A request from the Rules page's Add rule box carries only a scope flag and a note, with no quote.
|
|
@@ -12,7 +12,7 @@ Pull these out of `$ARGUMENTS`:
|
|
|
12
12
|
- **File** — the path the selection came from, if a `File:` line is present. The document preview pane has no path, so it may be missing.
|
|
13
13
|
- **Quote** — the selected text, the concrete example of the rule being broken. Absent when only a note was sent.
|
|
14
14
|
- **Note** — the reviewer's words, the substance of the rule.
|
|
15
|
-
- **Scope flag** — a `--repo` (optionally followed by a repo name), `--user` or `--
|
|
15
|
+
- **Scope flag** — a `--repo` (optionally followed by a repo name), `--user`, `--node` or `--scope <path>` (a repo-relative `CLAUDE.md` path) in the arguments. It is an instruction about where the rule goes, not part of the note: strip it from the note before wording the rule.
|
|
16
16
|
|
|
17
17
|
If `$ARGUMENTS` is empty, ask the user what rule they want to add and skip to Step 3.
|
|
18
18
|
|
|
@@ -28,7 +28,7 @@ Ask the user a clarifying question only when the note is genuinely too vague to
|
|
|
28
28
|
|
|
29
29
|
The scope is the directory whose `CLAUDE.md` gets the rule, or `advice.rules` in `repo (db)`, `user (db)` or `user (node)`.
|
|
30
30
|
|
|
31
|
-
If Step 1 found a scope flag, it fixes the scope: `--repo [name]` is `repo (db)` (for the named repo when one follows), `--user` is `user (db)`, `--node` is `user (node)
|
|
31
|
+
If Step 1 found a scope flag, it fixes the scope: `--repo [name]` is `repo (db)` (for the named repo when one follows), `--user` is `user (db)`, `--node` is `user (node)`, `--scope <path>` is that `CLAUDE.md`, with the path relative to the repo root. Use it as given — do not infer a different scope or second-guess it — and go to Step 4.
|
|
32
32
|
|
|
33
33
|
Otherwise infer it — do not ask by default:
|
|
34
34
|
|
|
@@ -47,7 +47,7 @@ Ask the user only when two scopes are genuinely defensible and the choice change
|
|
|
47
47
|
assist rules add '<rule text>' --title '<title>' --scope <path> 2>&1
|
|
48
48
|
```
|
|
49
49
|
|
|
50
|
-
`--scope` takes a file, a directory, or a `CLAUDE.md` path directly. A file or directory resolves to the nearest existing `CLAUDE.md` at or above it; a `CLAUDE.md` path is written to as given, created if absent. The command allocates the next repo-wide code, creates the `## Rules` section when the file has none, and records the directories that carry their own `## Rules` in the root `CLAUDE.md`.
|
|
50
|
+
`--scope` takes a file, a directory, or a `CLAUDE.md` path directly. A file or directory resolves to the nearest existing `CLAUDE.md` at or above it; a `CLAUDE.md` path is written to as given, created if absent. When the scope came from a `--scope <path>` flag, pass that path to `--scope` unchanged (run from the repo root, or prefix it with the repo root). The command allocates the next repo-wide code, creates the `## Rules` section when the file has none, and records the directories that carry their own `## Rules` in the root `CLAUDE.md`.
|
|
51
51
|
|
|
52
52
|
For a `user (db)` rule, pass `--user` instead of `--scope` (the two can't be combined); `--title` is required:
|
|
53
53
|
|
package/dist/.build-files
CHANGED
|
@@ -40,6 +40,7 @@ chunk-2MG2THMQ.js
|
|
|
40
40
|
chunk-2OKJ7YCH.js
|
|
41
41
|
chunk-2R4VODAU.js
|
|
42
42
|
chunk-2T5HRFWP.js
|
|
43
|
+
chunk-2TMQUTOS.js
|
|
43
44
|
chunk-2YZ3UJTQ.js
|
|
44
45
|
chunk-33H52QZU.js
|
|
45
46
|
chunk-3DNFNT2L.js
|
|
@@ -51,6 +52,7 @@ chunk-3MMYXKEQ.js
|
|
|
51
52
|
chunk-3NK55YVZ.js
|
|
52
53
|
chunk-3OYU2N5M.js
|
|
53
54
|
chunk-3PM5JCHE.js
|
|
55
|
+
chunk-3SKC4DB5.js
|
|
54
56
|
chunk-3VDV7VHX.js
|
|
55
57
|
chunk-3WJYRKC3.js
|
|
56
58
|
chunk-4AZGXA6X.js
|
|
@@ -69,11 +71,9 @@ chunk-556BOFTS.js
|
|
|
69
71
|
chunk-5AAHWTRQ.js
|
|
70
72
|
chunk-5H7EHZ3J.js
|
|
71
73
|
chunk-5JOVEUBS.js
|
|
72
|
-
chunk-5P7K4AQE.js
|
|
73
74
|
chunk-5PQE2NIS.js
|
|
74
75
|
chunk-5Q7MUHCK.js
|
|
75
76
|
chunk-5RFKHBSM.js
|
|
76
|
-
chunk-5Y7KNNE5.js
|
|
77
77
|
chunk-64HHCDHS.js
|
|
78
78
|
chunk-66TQS45B.js
|
|
79
79
|
chunk-67DONCGH.js
|
|
@@ -120,6 +120,7 @@ chunk-CDD4ZTG7.js
|
|
|
120
120
|
chunk-CDDJAXEJ.js
|
|
121
121
|
chunk-CDU6M5IX.js
|
|
122
122
|
chunk-CGYVYHMM.js
|
|
123
|
+
chunk-CHMEFETN.js
|
|
123
124
|
chunk-CIDPTAUE.js
|
|
124
125
|
chunk-CQDPHLI3.js
|
|
125
126
|
chunk-CS3E3ARZ.js
|
|
@@ -239,6 +240,7 @@ chunk-N3S5RZYX.js
|
|
|
239
240
|
chunk-N5M746ZC.js
|
|
240
241
|
chunk-N65VOEFI.js
|
|
241
242
|
chunk-N755UYFK.js
|
|
243
|
+
chunk-N7V4II5E.js
|
|
242
244
|
chunk-NBADZOXB.js
|
|
243
245
|
chunk-NDQSDS4F.js
|
|
244
246
|
chunk-NE5XRT62.js
|
|
@@ -267,7 +269,6 @@ chunk-P5LQVJWN.js
|
|
|
267
269
|
chunk-P7FVAGFQ.js
|
|
268
270
|
chunk-PF6E5TS6.js
|
|
269
271
|
chunk-PIDKNOD6.js
|
|
270
|
-
chunk-PIU2MX64.js
|
|
271
272
|
chunk-PQPK7WO2.js
|
|
272
273
|
chunk-PTWD34JK.js
|
|
273
274
|
chunk-PURNABFX.js
|
|
@@ -317,7 +318,6 @@ chunk-T56YZ5YH.js
|
|
|
317
318
|
chunk-T7ZPGAB5.js
|
|
318
319
|
chunk-TH42OUCW.js
|
|
319
320
|
chunk-TJGF3Z72.js
|
|
320
|
-
chunk-TP4K7PB2.js
|
|
321
321
|
chunk-TS4DZXFR.js
|
|
322
322
|
chunk-TU3ITOTX.js
|
|
323
323
|
chunk-TUAXUEF3.js
|
|
@@ -342,13 +342,11 @@ chunk-VDE2QVT4.js
|
|
|
342
342
|
chunk-VDXS55BC.js
|
|
343
343
|
chunk-VEZ3FL5H.js
|
|
344
344
|
chunk-VFJK5XMC.js
|
|
345
|
-
chunk-VGS5ZEQT.js
|
|
346
345
|
chunk-VHRROHRC.js
|
|
347
346
|
chunk-VPMI4LV2.js
|
|
348
347
|
chunk-VRPFTMP6.js
|
|
349
348
|
chunk-VTXNOOK4.js
|
|
350
349
|
chunk-VVUYBY6D.js
|
|
351
|
-
chunk-VW44HB3H.js
|
|
352
350
|
chunk-W5FPQALS.js
|
|
353
351
|
chunk-W6UBSIJA.js
|
|
354
352
|
chunk-W7TRZLEM.js
|
|
@@ -382,6 +380,7 @@ chunk-XYZPWUS6.js
|
|
|
382
380
|
chunk-XZSATLYY.js
|
|
383
381
|
chunk-Y3R4C2P7.js
|
|
384
382
|
chunk-Y4C5PXGS.js
|
|
383
|
+
chunk-Y4O3JLDR.js
|
|
385
384
|
chunk-YBW444MI.js
|
|
386
385
|
chunk-YDA62L6J.js
|
|
387
386
|
chunk-YIBSK5OC.js
|
|
@@ -409,6 +408,7 @@ chunk-ZLRZR64W.js
|
|
|
409
408
|
chunk-ZMH7UZNP.js
|
|
410
409
|
chunk-ZN3Q7UFD.js
|
|
411
410
|
chunk-ZN4PSZSA.js
|
|
411
|
+
chunk-ZPDJIRSL.js
|
|
412
412
|
chunk-ZSHH4XS6.js
|
|
413
413
|
chunk-ZSTBHQV2.js
|
|
414
414
|
chunk-ZYK7V4PG.js
|
|
@@ -475,7 +475,7 @@ deps-RSUOIZPE.js
|
|
|
475
475
|
docsConfirm-5JSC4BVS.js
|
|
476
476
|
docsScreenshots-3L3QEB5C.js
|
|
477
477
|
docsUnlock-Y7YBDC7H.js
|
|
478
|
-
doctorNodes-
|
|
478
|
+
doctorNodes-GHO3YJ6K.js
|
|
479
479
|
done-MRMZFNXS.js
|
|
480
480
|
drainDaemon-AJVBJMP2.js
|
|
481
481
|
dropRetiredTables-JBLALSG5.js
|
|
@@ -582,7 +582,7 @@ repos-PPGMWO4B.js
|
|
|
582
582
|
resolveHarness-Q53GCTJE.js
|
|
583
583
|
resolveModel-G7GJGUAY.js
|
|
584
584
|
restartDaemon-SGNXXO6H.js
|
|
585
|
-
restartNode-
|
|
585
|
+
restartNode-CY77NQE3.js
|
|
586
586
|
restructure-NBVT3EZS.js
|
|
587
587
|
review-2D36TUAO.js
|
|
588
588
|
reviewPrComments-JILBLWMX.js
|
|
@@ -590,7 +590,7 @@ rewindPhase-QHHZFRUA.js
|
|
|
590
590
|
rulesAdd-XYXGF5SQ.js
|
|
591
591
|
run-CBSRAMXF.js
|
|
592
592
|
run-PNWUU4NU.js
|
|
593
|
-
runDaemon-
|
|
593
|
+
runDaemon-SRZBXMEW.js
|
|
594
594
|
runExtract-PTONY7UJ.js
|
|
595
595
|
runParallelPhase-XX5MRTOA.js
|
|
596
596
|
runRefine-2RFOSI5R.js
|
|
@@ -612,7 +612,7 @@ show-HWHCYCPM.js
|
|
|
612
612
|
show-U3FTUMWL.js
|
|
613
613
|
showClaudeCodeIcon-E4SAM3GN.js
|
|
614
614
|
showCodexIcon-YUAKV4NI.js
|
|
615
|
-
signExtension-
|
|
615
|
+
signExtension-NVRO7V75.js
|
|
616
616
|
simulateDivergence-VB4UL4UR.js
|
|
617
617
|
skip-XAOPATAT.js
|
|
618
618
|
slack-Y7LJCVZX.js
|
|
@@ -640,7 +640,7 @@ unlinkNode-GKFA7U4W.js
|
|
|
640
640
|
unstar-TTWHIOYO.js
|
|
641
641
|
update-5G42A5LW.js
|
|
642
642
|
update-KD2UWY63.js
|
|
643
|
-
updateNode-
|
|
643
|
+
updateNode-BXG5MAE4.js
|
|
644
644
|
updatePhase-FN4ZV2ER.js
|
|
645
645
|
updatePlan-U6FVT54O.js
|
|
646
646
|
version-SD3HTBJ2.js
|
|
@@ -648,8 +648,8 @@ viewIssue-N6W53LSK.js
|
|
|
648
648
|
watchLoop-MV7DVGC6.js
|
|
649
649
|
watchReport-A4W7UOAJ.js
|
|
650
650
|
watchWait-YYMDQTOI.js
|
|
651
|
-
web-
|
|
652
|
-
web-
|
|
651
|
+
web-CCHTHGGC.js
|
|
652
|
+
web-Y22422LO.js
|
|
653
653
|
withPool-OXM4WN4L.js
|
|
654
654
|
wontdo-BVSLYH3M.js
|
|
655
655
|
wontfix-IW6I53QK.js
|
package/dist/built-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
0.
|
|
1
|
+
0.1215.1
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-JM57BCD6.js";
|
|
11
11
|
import {
|
|
12
12
|
firstBrokenHop
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Y4O3JLDR.js";
|
|
14
14
|
import {
|
|
15
15
|
describePeerError,
|
|
16
16
|
fetchPeerJson
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
import {
|
|
49
49
|
ASSIST_VERSION,
|
|
50
50
|
PROTOCOL_VERSION
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-N7V4II5E.js";
|
|
52
52
|
import {
|
|
53
53
|
findLinkSpec
|
|
54
54
|
} from "./chunk-JWMBBFAS.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{function g(){return globalThis.browser?.storage?.local}function M(e){let r;try{r=new URL(e.trim())}catch{return}if(!(r.protocol!=="http:"&&r.protocol!=="https:"))return r.origin}var pe="http://localhost:3100",y="serverUrl";async function a(){let r=(await g()?.get(y).catch(()=>{}))?.[y];return typeof r=="string"&&M(r)||pe}function u(){let e=globalThis.browser;return e?.runtime&&e.tabs?e:void 0}var
|
|
1
|
+
"use strict";(()=>{function g(){return globalThis.browser?.storage?.local}function M(e){let r;try{r=new URL(e.trim())}catch{return}if(!(r.protocol!=="http:"&&r.protocol!=="https:"))return r.origin}var pe="http://localhost:3100",y="serverUrl";async function a(){let r=(await g()?.get(y).catch(()=>{}))?.[y];return typeof r=="string"&&M(r)||pe}function u(){let e=globalThis.browser;return e?.runtime&&e.tabs?e:void 0}var T="assist-browser-probe";var O="/ws/browser",l="assist-browser-link";function b(e,r){e.readyState===WebSocket.OPEN&&e.send(JSON.stringify(r))}var P="assist-console-entries",S="recordConsole";async function w(){return(await g()?.get(S).catch(()=>{}))?.[S]===!0}var ce="assist-console",C="entries";function de(){return new Promise((e,r)=>{let s=indexedDB.open(ce,1);s.onupgradeneeded=()=>s.result.createObjectStore(C,{keyPath:"id",autoIncrement:!0}).createIndex("time","time"),s.onsuccess=()=>e(s.result),s.onerror=()=>r(s.error)})}async function p(e,r){let s=await de();try{return await new Promise((t,n)=>{let o=s.transaction(C,e),i=r(o.objectStore(C));o.oncomplete=()=>t(i),o.onerror=()=>n(o.error),o.onabort=()=>n(o.error)})}finally{s.close()}}function le(e,{tabId:r,since:s},t){return r!==void 0&&e.tabId!==r||s!==void 0&&e.time<s?!1:t?[e.message,e.stack,e.url].some(n=>n?.toLowerCase().includes(t)):!0}async function B(e){let r=e.grep?.toLowerCase();return(await p("readonly",t=>{let n=[],o=t.openCursor(null,"prev");return o.onsuccess=()=>{let i=o.result;if(!i||n.length>=e.limit)return;let{id:A,...f}=i.value;le(f,e,r)&&n.push(f),i.continue()},n})).reverse()}async function E(e,r){let s=await w(),t=s?await B({tabId:r?.id,since:e.sinceMs===void 0?void 0:Date.now()-e.sinceMs,grep:e.grep,limit:e.limit??200}):[];return{ok:!0,result:{tabUrl:r?.url??"",recording:s,entries:t}}}function R(e,r,s){let t=s?.running===!0;return e==="status"?{ok:!0,result:{tabUrl:r,contentScript:t}}:t?s.error||!s.result?{ok:!1,tabUrl:r,error:s.error??"empty probe reply"}:{ok:!0,result:{tabUrl:r,...s.result}}:{ok:!1,tabUrl:r,error:"the assist content script is not running on the target tab (reload the tab, or update the extension)"}}function _(e){if(!e)return!1;let r;try{r=new URL(e)}catch{return!1}let{protocol:s,hostname:t}=r;return s==="http:"?!0:s!=="https:"?!1:t==="github.com"||t==="dev.azure.com"||t.endsWith(".visualstudio.com")}function I(e){return e.reduce((r,s)=>!r||(s.lastAccessed??0)>(r.lastAccessed??0)?s:r,void 0)}function N(e,r,s){if(s)return I(e.filter(n=>n.url?.includes(s)));let t=e.filter(n=>n.active);return t.find(n=>n.windowId===r)??I(t)}var fe="github.com, dev.azure.com, *.visualstudio.com, any http:// host";async function H(e,r){let[s,t]=await Promise.all([e.tabs.query({}),e.windows?.getLastFocused().catch(()=>{})]),n=N(s,t?.id,r);return!n||n.id===void 0?{ok:!1,error:r?`no open tab has a URL containing "${r}"`:"no active tab found"}:!n.url||!_(n.url)?{ok:!1,tabUrl:n.url,error:`the target tab is not on an assist host (${fe})`}:{id:n.id,url:n.url}}async function D(e){if(!await e.permissions?.contains({permissions:["userScripts"]}).catch(()=>!1))return await e.runtime.openOptionsPage?.().catch(()=>{}),"the assist extension lacks the optional userScripts permission; click Allow scripts on the extension's options page (opened in Firefox now) and run again";let s=e.userScripts?.execute;return s?{execute:s.bind(e.userScripts)}:"this Firefox has no userScripts.execute (needs Firefox 153 or later)"}function U(e){return`(async () => {
|
|
2
2
|
const describe = (value) => {
|
|
3
3
|
if (value === undefined) return "undefined";
|
|
4
4
|
if (typeof value === "string") return value;
|
|
@@ -17,4 +17,4 @@ ${e}
|
|
|
17
17
|
return { error: error instanceof Error && error.stack ? \`\${error}\\n\${error.stack}\` : String(error) };
|
|
18
18
|
}
|
|
19
19
|
})();
|
|
20
|
-
`}async function K(e,r,s){let t;try{t=await e.execute({js:[{code:U(s)}],target:{tabId:r},injectImmediately:!0})}catch(i){return{outcome:"error",error:i instanceof Error?i.message:String(i)}}let[n]=t;if(n?.error)return{outcome:"error",error:n.error};let o=n?.result??{};return typeof o.error=="string"?{outcome:"error",error:o.error}:typeof o.value=="string"?{outcome:"ran",value:o.value}:{outcome:"error",error:"the script returned no result"}}async function F(e,r,s,t,n){let o=await D(e);if(typeof o=="string")return{ok:!1,tabUrl:s,error:o};let i=R("run",s,await t());if(!i.ok)return i;let{decision:
|
|
20
|
+
`}async function K(e,r,s){let t;try{t=await e.execute({js:[{code:U(s)}],target:{tabId:r},injectImmediately:!0})}catch(i){return{outcome:"error",error:i instanceof Error?i.message:String(i)}}let[n]=t;if(n?.error)return{outcome:"error",error:n.error};let o=n?.result??{};return typeof o.error=="string"?{outcome:"error",error:o.error}:typeof o.value=="string"?{outcome:"ran",value:o.value}:{outcome:"error",error:"the script returned no result"}}async function F(e,r,s,t,n){let o=await D(e);if(typeof o=="string")return{ok:!1,tabUrl:s,error:o};let i=R("run",s,await t());if(!i.ok)return i;let{decision:A}=i.result;if(A!=="run")return{ok:!0,result:{tabUrl:s,outcome:A}};let f=await K(o,r,n);return{ok:!0,result:{tabUrl:s,...f}}}async function j(e){let r=u();if(!r)return{ok:!1,error:"browser tabs API unavailable"};if(e.op==="console"&&e.all)return E(e);let s=await H(r,e.url);if("ok"in s)return s;if(e.op==="console")return E(e,s);let t=()=>r.tabs.sendMessage(s.id,{...e,type:T}).then(n=>n).catch(()=>{});return e.op==="run"?F(r,s.id,s.url,t,e.code):R(e.op,s.url,await t())}async function $(e,r){let s;try{s=JSON.parse(String(r))}catch{return}if(s.type!=="request")return;let t=await j(s).catch(n=>({ok:!1,error:n instanceof Error?n.message:String(n)}));b(e,{...t,type:"response",id:s.id})}var ge=5e3,c,h;function G(){let e=u();e&&(e.alarms?.create(l,{periodInMinutes:.5}),e.alarms?.onAlarm.addListener(r=>{r.name===l&&L()}),e.runtime.onUpdateAvailable?.addListener(()=>e.runtime.reload?.()),e.storage?.onChanged.addListener(r=>{y in r&&c?.close()}),L())}function L(){h||c&&c.readyState<=WebSocket.OPEN||(h=ye().finally(()=>{h=void 0}))}async function ye(){let e=await a(),r=new WebSocket(`${e.replace(/^http/,"ws")}${O}`);c=r,r.addEventListener("open",()=>b(r,{type:"hello",version:u()?.runtime.getManifest().version??"unknown"})),r.addEventListener("message",s=>{$(r,s.data)}),r.addEventListener("close",()=>{c===r&&(c=void 0,setTimeout(L,ge))})}function m(){return globalThis.browser?.runtime}var Re={maxAgeMs:6048e5,maxEntries:2e4};function ke(e,r){let s=e.count();s.onsuccess=()=>{let t=s.result-r;if(t<=0)return;let n=e.openCursor(),o=t===1;n.onsuccess=()=>{let i=n.result;if(i){if(!o){o=!0,i.advance(t-1);return}e.delete(IDBKeyRange.upperBound(i.primaryKey))}}}}function k(e,r,{maxAgeMs:s,maxEntries:t}=Re){let n=e.index("time").openCursor(IDBKeyRange.upperBound(r-s,!0));n.onsuccess=()=>{let o=n.result;if(!o){ke(e,t);return}o.delete(),o.continue()}}function W(e,r,s){return p("readwrite",t=>{for(let n of e)t.add(n);k(t,r,s)})}function q(e){return p("readwrite",r=>k(r,e))}function x(e){return e.length<=2048?e:`${e.slice(0,2047)}\u2026`}var xe=new Set(["warn","error","uncaught","rejection"]);function Y(e){let{time:r,level:s,message:t,stack:n,url:o}=e??{};if(!(typeof r!="number"||!xe.has(s)||typeof t!="string"||typeof o!="string"))return{time:r,level:s,message:x(t),url:x(o),...typeof n=="string"&&n?{stack:x(n)}:{}}}function Ae(e){let{type:r,entries:s}=e??{};return r===P&&Array.isArray(s)}async function Se(e,r){if(!await w())return;let s=e.flatMap(t=>{let n=Y(t);return n?[{...n,tabId:r}]:[]});s.length&&await W(s,Date.now())}function X(){m()?.onMessage.addListener((e,r)=>{let s=r?.tab?.id;!Ae(e)||s===void 0||Se(e.entries,s).catch(()=>{})}),u()?.alarms?.onAlarm.addListener(e=>{e.name===l&&q(Date.now()).catch(()=>{})})}function V(e){let{type:r,pageId:s,prompt:t}=e??{};return r==="assist-docs-feedback"&&typeof s=="string"&&typeof t=="string"}async function d(e,r,s){let t;try{t=await fetch(`${e}${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)})}catch{return{ok:!1,message:`assist web server unreachable at ${e}`}}let n=await t.json().catch(()=>({}));return t.ok?{ok:!0,data:n}:{ok:!1,message:n.error??`assist web server returned ${t.status}`}}async function Q(e,{type:r,...s}){let t=await d(e,"/api/sessions/docs-feedback",s);return t.ok?{ok:!0,message:t.data.message??"Sent to the docs session"}:t}async function z(e,{refs:r}){let s=await d(e,"/api/link-status",{refs:r});if(!s.ok)return s;let{states:t}=s.data;return!t||typeof t!="object"?{ok:!1,message:"assist web server returned no states"}:{ok:!0,states:t}}function Z(e){let{type:r,refs:s}=e??{};return r==="assist-link-status"&&Array.isArray(s)}async function ee(e){let r;try{r=await fetch(`${e}/api/clones`)}catch{return{ok:!1,message:`assist web server unreachable at ${e}`}}let s=await r.json().catch(()=>({}));return!r.ok||!Array.isArray(s.clones)?{ok:!1,message:s.error??`assist web server returned ${r.status}`}:{ok:!0,clones:s.clones.filter(t=>typeof t=="string")}}var v="claude";function re(e){let r=e??{};return{exposeCodexActions:!!r.exposeCodexActions,exposePiActions:!!r.exposePiActions,engine:r.engine??v,runHarness:r.runHarness??r.engine??v,features:r.features??{}}}async function se(e){try{let r=await fetch(`${e}/api/harness`);return r.ok?{ok:!0,capabilities:re(await r.json())}:{ok:!1,message:`assist web server returned ${r.status}`}}catch{return{ok:!1,message:`assist web server unreachable at ${e}`}}}function te(e){return e?.type==="assist-clones"}function ne(e){return e?.type==="assist-harness"}var Ce={draft:["draft","--once"],bug:["bug","--once"]};function oe(e){return typeof e=="string"&&Object.hasOwn(Ce,e)}function ie(e){let{type:r,url:s,args:t,mode:n,repo:o}=e??{};return r==="assist-send"&&typeof s=="string"&&(t===void 0||Array.isArray(t)&&t.every(i=>typeof i=="string"))&&(n===void 0||oe(n))&&(o===void 0||typeof o=="string")}function ae(){return globalThis.browser?.action}function Ee({url:e,instructions:r,args:s,mode:t,repo:n}){return s?["review-from-github",{url:e,args:s}]:n!==void 0?["from-link",{url:e,repo:n,instructions:r,mode:t}]:["from-github",{url:e,instructions:r,mode:t}]}async function ue(e,r){let[s,t]=Ee(r),n=await d(e,`/api/sessions/${s}`,t);return n.ok?{ok:!0,message:`assist session started in ${n.data.cwd}`}:n}function he(){m()?.onMessage.addListener(e=>{if(ie(e))return a().then(r=>ue(r,e));if(te(e))return a().then(ee);if(ne(e))return a().then(se);if(V(e))return a().then(r=>Q(r,e));if(Z(e))return a().then(r=>z(r,e))}),ae()?.onClicked.addListener(()=>{m()?.openOptionsPage?.()})}he();G();X();})();
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
"https://dev.azure.com/*",
|
|
24
24
|
"https://*.visualstudio.com/*",
|
|
25
25
|
"https://mail.google.com/*",
|
|
26
|
-
"http
|
|
27
|
-
"http://127.0.0.1/*"
|
|
26
|
+
"http://*/*"
|
|
28
27
|
]
|
|
29
28
|
}
|
|
30
29
|
],
|
|
@@ -33,7 +32,7 @@
|
|
|
33
32
|
},
|
|
34
33
|
"permissions": ["storage", "alarms"],
|
|
35
34
|
"optional_permissions": ["userScripts"],
|
|
36
|
-
"host_permissions": ["http
|
|
35
|
+
"host_permissions": ["http://*/*"],
|
|
37
36
|
"action": {
|
|
38
37
|
"default_icon": {
|
|
39
38
|
"16": "icons/assist-16.png",
|
|
@@ -61,7 +60,7 @@
|
|
|
61
60
|
"run_at": "document_idle"
|
|
62
61
|
},
|
|
63
62
|
{
|
|
64
|
-
"matches": ["http
|
|
63
|
+
"matches": ["http://*/*"],
|
|
65
64
|
"js": ["docs.js"],
|
|
66
65
|
"run_at": "document_idle"
|
|
67
66
|
},
|
|
@@ -70,8 +69,7 @@
|
|
|
70
69
|
"https://github.com/*",
|
|
71
70
|
"https://dev.azure.com/*",
|
|
72
71
|
"https://*.visualstudio.com/*",
|
|
73
|
-
"http
|
|
74
|
-
"http://127.0.0.1/*"
|
|
72
|
+
"http://*/*"
|
|
75
73
|
],
|
|
76
74
|
"js": ["consoleMain.js"],
|
|
77
75
|
"run_at": "document_start",
|
|
@@ -82,8 +80,7 @@
|
|
|
82
80
|
"https://github.com/*",
|
|
83
81
|
"https://dev.azure.com/*",
|
|
84
82
|
"https://*.visualstudio.com/*",
|
|
85
|
-
"http
|
|
86
|
-
"http://127.0.0.1/*"
|
|
83
|
+
"http://*/*"
|
|
87
84
|
],
|
|
88
85
|
"js": ["console.js"],
|
|
89
86
|
"run_at": "document_start"
|