@staff0rd/assist 0.1145.2 → 0.1146.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/dist/{addActivity-I7GIFLOG.js → addActivity-O4WZ2Y6N.js} +3 -3
- package/dist/{addPhase-GP6MKXBN.js → addPhase-5EL742QZ.js} +4 -4
- package/dist/{advise-XTXF7CRD.js → advise-ITKXQNG2.js} +4 -4
- package/dist/{askCheck-RF2R5NDL.js → askCheck-MEBLFUIH.js} +8 -8
- package/dist/{askDesign-CWDKITEU.js → askDesign-HJ3HND5Y.js} +2 -2
- package/dist/{askQuestion-EQV37YPA.js → askQuestion-BCPZSSJ4.js} +1 -1
- package/dist/{branch-BSRUVE6O.js → branch-XUEEV52W.js} +4 -4
- package/dist/built-version +1 -1
- package/dist/{chunk-64LIWSXE.js → chunk-2CHARFOG.js} +4 -4
- package/dist/{chunk-3ZKZ5EGT.js → chunk-2NF4R65R.js} +1 -1
- package/dist/{chunk-SMOEJN6Q.js → chunk-2WWQW32T.js} +1 -1
- package/dist/{chunk-4VYZIWCE.js → chunk-4XFFBFZK.js} +1 -1
- package/dist/{chunk-6JDTHFNG.js → chunk-62LYHPCE.js} +2 -2
- package/dist/{chunk-MJ4U4ZO5.js → chunk-6KSDKV3M.js} +1 -1
- package/dist/{chunk-56PNBMBF.js → chunk-AW5T2LHQ.js} +2 -2
- package/dist/{chunk-WMNOK5D7.js → chunk-B5VWAQPR.js} +2 -2
- package/dist/{chunk-KMO2Y4KT.js → chunk-BMGUKZEX.js} +1 -1
- package/dist/{chunk-HFIYMKDD.js → chunk-CS3UY7F3.js} +1 -1
- package/dist/{chunk-75CTEDPY.js → chunk-D6KW2IQE.js} +1 -1
- package/dist/{chunk-ZSFTLDVQ.js → chunk-EDLAVWFQ.js} +1 -1
- package/dist/{chunk-P56ZEVAK.js → chunk-EE53ZRZO.js} +1 -1
- package/dist/{chunk-QVKRYXUV.js → chunk-EWXRS2UG.js} +8 -8
- package/dist/{chunk-X42ZPYFO.js → chunk-EX6BAQGW.js} +1 -1
- package/dist/{chunk-67B7TFAR.js → chunk-FCXY2UFD.js} +3 -3
- package/dist/{chunk-6ETLOAOY.js → chunk-FDYDD4XZ.js} +1 -1
- package/dist/{chunk-CRLEUURN.js → chunk-FPKW4V32.js} +2 -2
- package/dist/{chunk-3A7RM7ZE.js → chunk-I45ETRYQ.js} +1 -1
- package/dist/{chunk-QRAZBFDX.js → chunk-IKZIKUAS.js} +6 -6
- package/dist/{chunk-JH6U6MSA.js → chunk-J5YSKL7Z.js} +2 -2
- package/dist/{chunk-27QYXLBO.js → chunk-JXI7VLGP.js} +2 -2
- package/dist/{chunk-6XGLEWE4.js → chunk-KFEK4LEJ.js} +1 -1
- package/dist/{chunk-MYBNV4GH.js → chunk-LHEHFRSO.js} +1 -1
- package/dist/{chunk-VM36UNH3.js → chunk-OX4OCPYA.js} +1 -1
- package/dist/{chunk-HWAB2RV6.js → chunk-PC6OPAXH.js} +1 -1
- package/dist/{chunk-AKF654AT.js → chunk-PDOQVVZA.js} +1 -1
- package/dist/{chunk-2RVFQMCT.js → chunk-PPQLVNZD.js} +1 -1
- package/dist/{chunk-67KU5YDY.js → chunk-QCAPQQNV.js} +1 -1
- package/dist/{chunk-6PF5BEEE.js → chunk-SJBV4BIG.js} +1 -1
- package/dist/{chunk-ROBNJX4W.js → chunk-SNSOHVAN.js} +1 -1
- package/dist/{chunk-S4S2DD5Z.js → chunk-SOLU75ED.js} +1 -1
- package/dist/{chunk-B5IBWXPS.js → chunk-TS2PPTOT.js} +15 -6
- package/dist/{chunk-G4KTQ3BM.js → chunk-VHXOKHWH.js} +1 -1
- package/dist/{chunk-72H6JXNZ.js → chunk-Y7AWEHGZ.js} +2 -2
- package/dist/{chunk-R5JL5IV5.js → chunk-YAHAE44P.js} +1 -1
- package/dist/{chunk-XGKRZDFC.js → chunk-YF7AJD57.js} +1 -1
- package/dist/{chunk-KLEL6TMJ.js → chunk-YYXDBRET.js} +1 -1
- package/dist/{chunk-3DR7FGAL.js → chunk-ZL4VXCMV.js} +2 -2
- package/dist/{cliHook-EOOXUGBR.js → cliHook-ZQXSQTXK.js} +7 -7
- package/dist/{cliHookCheck-X5TCXO6W.js → cliHookCheck-PBWW4A7E.js} +3 -3
- package/dist/{codeCommentSet-2YWQJXI2.js → codeCommentSet-AI2N5ZT6.js} +3 -3
- package/dist/{codexHook-I62GDJUK.js → codexHook-UILTAEHP.js} +9 -9
- package/dist/commands/extension/extension/background.js +2 -2
- package/dist/commands/extension/extension/content.js +2 -2
- package/dist/commands/extension/extension/docs.js +1 -1
- package/dist/commands/extension/extension/updates.json +2 -2
- package/dist/commands/sessions/web/bundle.js +395 -395
- package/dist/{commit-QIBKZOFC.js → commit-LKOWWH22.js} +5 -5
- package/dist/{docsConfirm-2LAEAX3R.js → docsConfirm-FWDAMRZW.js} +2 -2
- package/dist/{docsUnlock-SCPIWHT5.js → docsUnlock-FYMKS55Z.js} +4 -4
- package/dist/{doctorNodes-2PTWWGBU.js → doctorNodes-B7KLRFR6.js} +3 -3
- package/dist/{done-YRYUU3NC.js → done-XLLRTNUS.js} +5 -5
- package/dist/{editHook-7I2OJPWT.js → editHook-Z7V63BQD.js} +7 -7
- package/dist/{fixConflict-AEEBWBWC.js → fixConflict-DCZ3TO4G.js} +3 -3
- package/dist/index.js +52 -52
- package/dist/{launchMode-A745H5WI.js → launchMode-UOJC7I7N.js} +14 -14
- package/dist/{list-KMUEPWIX.js → list-RXBOVALY.js} +6 -6
- package/dist/{next-FMKPU3RP.js → next-5U7MIKMS.js} +13 -13
- package/dist/{notify-NRLRUDFI.js → notify-ZC3LKAWF.js} +2 -2
- package/dist/{piHook-K4KQQES3.js → piHook-VAIJEHOR.js} +7 -7
- package/dist/{propose-UEOA2URJ.js → propose-EQTGU3JU.js} +5 -5
- package/dist/{refine-3BKZV7WL.js → refine-LUVEU7DX.js} +15 -15
- package/dist/{restartNode-SNJXV44K.js → restartNode-O7YHI2JV.js} +5 -5
- package/dist/{review-QRWNEL36.js → review-3A3566GH.js} +3 -3
- package/dist/{reviewPrComments-T4BB75Q5.js → reviewPrComments-HEWIHO3O.js} +3 -3
- package/dist/{rewindPhase-GCXULF2L.js → rewindPhase-UBXVL22Y.js} +9 -9
- package/dist/{run-FOMNDLIE.js → run-7M5KYTU7.js} +11 -11
- package/dist/{run-S3QVJV6F.js → run-AII7E6CH.js} +11 -11
- package/dist/{runDaemon-OGBP3OXU.js → runDaemon-OD2FB3W7.js} +15 -15
- package/dist/{runRefine-A7R2BRLS.js → runRefine-P3WGRV3Y.js} +15 -15
- package/dist/{scan-ZBIMTQVA.js → scan-ZTUDODQD.js} +3 -3
- package/dist/{schemaConfirm-OP4CP3ZH.js → schemaConfirm-TLJ7LV52.js} +5 -5
- package/dist/{schemaUnlock-XYFV4DAQ.js → schemaUnlock-SCRI5AZQ.js} +7 -7
- package/dist/{search-APR5DBRZ.js → search-R22L6U5K.js} +6 -6
- package/dist/{show-6HKO23WP.js → show-BOATDY3V.js} +4 -4
- package/dist/{show-S7GB6IH2.js → show-SUWHGBMI.js} +4 -4
- package/dist/{signExtension-NZ24AV3M.js → signExtension-NF4AHKTF.js} +1 -1
- package/dist/{statusLine-TK2QPCQO.js → statusLine-Z74KVADW.js} +1 -1
- package/dist/{updateNode-5UTLZ56Z.js → updateNode-G6L3W3CX.js} +5 -5
- package/dist/{updatePlan-SMFHMXGN.js → updatePlan-A3CQ56TY.js} +5 -5
- package/dist/{web-GI4J6LLI.js → web-KQK7R257.js} +17 -17
- package/dist/{web-N5XARCRS.js → web-UY6KMJ47.js} +17 -17
- package/package.json +1 -1
- /package/dist/{chunk-K6NKWRK4.js → chunk-AWIOBY7Q.js} +0 -0
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
harnessLabel,
|
|
25
25
|
resolveHarness
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-AWIOBY7Q.js";
|
|
27
27
|
import {
|
|
28
28
|
checkCliAvailable,
|
|
29
29
|
harnesses,
|
|
@@ -3685,15 +3685,23 @@ function logSdkMessage(label, message2) {
|
|
|
3685
3685
|
daemonLog(`${label} sdk turn ended: ${message2.subtype}`);
|
|
3686
3686
|
}
|
|
3687
3687
|
|
|
3688
|
+
// src/commands/sessions/daemon/sdk/activityLine.ts
|
|
3689
|
+
var MAX_LINE = 80;
|
|
3690
|
+
function activityLine(text) {
|
|
3691
|
+
const line = text.trim().split("\n")[0].trim();
|
|
3692
|
+
return line.length > MAX_LINE ? `${line.slice(0, MAX_LINE - 1)}\u2026` : line;
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3688
3695
|
// src/commands/sessions/daemon/sdk/sdkBackgroundTasks.ts
|
|
3689
3696
|
function sdkBackgroundTasks(message2) {
|
|
3690
3697
|
if (message2.type !== "system" || message2.subtype !== "background_tasks_changed")
|
|
3691
3698
|
return void 0;
|
|
3692
|
-
return message2.tasks.filter((task) => !task.ambient).map((task) => task.description);
|
|
3699
|
+
return message2.tasks.filter((task) => !task.ambient).map((task) => activityLine(task.description));
|
|
3693
3700
|
}
|
|
3694
3701
|
|
|
3695
3702
|
// src/commands/sessions/daemon/sdk/sdkActivityText.ts
|
|
3696
3703
|
var TARGET_KEYS = [
|
|
3704
|
+
"description",
|
|
3697
3705
|
"command",
|
|
3698
3706
|
"file_path",
|
|
3699
3707
|
"notebook_path",
|
|
@@ -3701,17 +3709,18 @@ var TARGET_KEYS = [
|
|
|
3701
3709
|
"pattern",
|
|
3702
3710
|
"url",
|
|
3703
3711
|
"query",
|
|
3704
|
-
"description",
|
|
3705
3712
|
"skill"
|
|
3706
3713
|
];
|
|
3707
|
-
var
|
|
3714
|
+
var LEADING_CD = /^cd\s+(?:"[^"]*"|'[^']*'|\S+)\s*(?:;|&&)\s*/;
|
|
3708
3715
|
function toolTarget2(input) {
|
|
3709
3716
|
if (!input || typeof input !== "object") return "";
|
|
3710
3717
|
const record3 = input;
|
|
3711
3718
|
const key = TARGET_KEYS.find((k) => typeof record3[k] === "string");
|
|
3712
3719
|
if (!key) return "";
|
|
3713
|
-
const
|
|
3714
|
-
return
|
|
3720
|
+
const value = record3[key];
|
|
3721
|
+
return activityLine(
|
|
3722
|
+
key === "command" ? value.trim().replace(LEADING_CD, "") : value
|
|
3723
|
+
);
|
|
3715
3724
|
}
|
|
3716
3725
|
function sdkActivityText(content) {
|
|
3717
3726
|
const tool = [...content].reverse().find((block) => block.type === "tool_use");
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
isApprovedRead,
|
|
14
14
|
resolvePermission,
|
|
15
15
|
splitCompound
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QCAPQQNV.js";
|
|
17
17
|
import {
|
|
18
18
|
DOCS_LOCK_REASON,
|
|
19
19
|
SCHEMA_LOCK_REASON,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
isSchemaPath,
|
|
24
24
|
isSchemaRelativePath,
|
|
25
25
|
mentionsDocsPath
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-J5YSKL7Z.js";
|
|
27
27
|
import {
|
|
28
28
|
isLiveDaemonSession
|
|
29
29
|
} from "./chunk-ZO7NYS25.js";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-N65VOEFI.js";
|
|
4
4
|
import {
|
|
5
5
|
previewAnswerWaitBlocker
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-D6KW2IQE.js";
|
|
7
7
|
import {
|
|
8
8
|
askQuestionEnabled
|
|
9
9
|
} from "./chunk-IBPSXDUB.js";
|
|
10
10
|
import {
|
|
11
11
|
resolveHarness
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AWIOBY7Q.js";
|
|
13
13
|
import {
|
|
14
14
|
loadConfig
|
|
15
15
|
} from "./chunk-KGFZYUE2.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decideToolOperations,
|
|
3
3
|
logPolicyDeny
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y7AWEHGZ.js";
|
|
5
5
|
import "./chunk-CDU6M5IX.js";
|
|
6
6
|
import "./chunk-HKGCLAZ7.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-QCAPQQNV.js";
|
|
8
8
|
import "./chunk-VDXS55BC.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-J5YSKL7Z.js";
|
|
10
|
+
import "./chunk-SOLU75ED.js";
|
|
11
11
|
import {
|
|
12
12
|
currentExecutionIdentity
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AW5T2LHQ.js";
|
|
14
14
|
import "./chunk-ZMH7UZNP.js";
|
|
15
15
|
import "./chunk-FPWL4VRC.js";
|
|
16
16
|
import "./chunk-ZO7NYS25.js";
|
|
@@ -26,7 +26,7 @@ import "./chunk-LMUTL44M.js";
|
|
|
26
26
|
import "./chunk-6NDXAN45.js";
|
|
27
27
|
import {
|
|
28
28
|
claudeAdapter
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-TS2PPTOT.js";
|
|
30
30
|
import "./chunk-MRUIXQXS.js";
|
|
31
31
|
import "./chunk-HO7RNI6V.js";
|
|
32
32
|
import "./chunk-DIAC4XYA.js";
|
|
@@ -34,7 +34,7 @@ import "./chunk-UU77KEL6.js";
|
|
|
34
34
|
import "./chunk-W7TRZLEM.js";
|
|
35
35
|
import "./chunk-P26XSDFU.js";
|
|
36
36
|
import "./chunk-IBPSXDUB.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-AWIOBY7Q.js";
|
|
38
38
|
import {
|
|
39
39
|
markActiveHarness
|
|
40
40
|
} from "./chunk-BFQSGIN6.js";
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
findTruncatedReadDenyRaw,
|
|
6
6
|
isApprovedRead,
|
|
7
7
|
splitCompound
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QCAPQQNV.js";
|
|
9
9
|
import "./chunk-VDXS55BC.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-TS2PPTOT.js";
|
|
11
11
|
import "./chunk-MRUIXQXS.js";
|
|
12
12
|
import "./chunk-HO7RNI6V.js";
|
|
13
13
|
import "./chunk-DIAC4XYA.js";
|
|
14
14
|
import "./chunk-UU77KEL6.js";
|
|
15
15
|
import "./chunk-W7TRZLEM.js";
|
|
16
16
|
import "./chunk-P26XSDFU.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-AWIOBY7Q.js";
|
|
18
18
|
import "./chunk-BFQSGIN6.js";
|
|
19
19
|
import "./chunk-D7UZLH36.js";
|
|
20
20
|
import "./chunk-XDIVXGPQ.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
deliverPinNotification
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-PDOQVVZA.js";
|
|
4
|
+
import "./chunk-SNSOHVAN.js";
|
|
5
5
|
import {
|
|
6
6
|
isHashCommentFile
|
|
7
7
|
} from "./chunk-LMHILP5H.js";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-ZMH7UZNP.js";
|
|
15
15
|
import "./chunk-E36L7ASL.js";
|
|
16
16
|
import "./chunk-Q7RUUXND.js";
|
|
17
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-AWIOBY7Q.js";
|
|
18
18
|
import "./chunk-BFQSGIN6.js";
|
|
19
19
|
import "./chunk-D7UZLH36.js";
|
|
20
20
|
import "./chunk-XDIVXGPQ.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
decideToolOperations,
|
|
3
3
|
logPolicyDeny
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Y7AWEHGZ.js";
|
|
5
5
|
import "./chunk-CDU6M5IX.js";
|
|
6
6
|
import "./chunk-HKGCLAZ7.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-QCAPQQNV.js";
|
|
8
8
|
import "./chunk-VDXS55BC.js";
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-J5YSKL7Z.js";
|
|
10
|
+
import "./chunk-SOLU75ED.js";
|
|
11
11
|
import {
|
|
12
12
|
currentExecutionIdentity
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AW5T2LHQ.js";
|
|
14
14
|
import "./chunk-ZMH7UZNP.js";
|
|
15
15
|
import {
|
|
16
16
|
setSessionStatus
|
|
@@ -19,7 +19,7 @@ import "./chunk-FPWL4VRC.js";
|
|
|
19
19
|
import "./chunk-ZO7NYS25.js";
|
|
20
20
|
import {
|
|
21
21
|
adviceHookPayload
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-I45ETRYQ.js";
|
|
23
23
|
import "./chunk-P7FVAGFQ.js";
|
|
24
24
|
import {
|
|
25
25
|
readStdin
|
|
@@ -38,12 +38,12 @@ import "./chunk-3QKE2ONF.js";
|
|
|
38
38
|
import "./chunk-O5JIFWMQ.js";
|
|
39
39
|
import "./chunk-LMUTL44M.js";
|
|
40
40
|
import "./chunk-6NDXAN45.js";
|
|
41
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-D6KW2IQE.js";
|
|
42
42
|
import "./chunk-MELBVXKL.js";
|
|
43
43
|
import "./chunk-OGJ6AZK4.js";
|
|
44
44
|
import {
|
|
45
45
|
codexAdapter
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-TS2PPTOT.js";
|
|
47
47
|
import "./chunk-MRUIXQXS.js";
|
|
48
48
|
import "./chunk-HO7RNI6V.js";
|
|
49
49
|
import "./chunk-DIAC4XYA.js";
|
|
@@ -51,7 +51,7 @@ import "./chunk-UU77KEL6.js";
|
|
|
51
51
|
import "./chunk-W7TRZLEM.js";
|
|
52
52
|
import "./chunk-P26XSDFU.js";
|
|
53
53
|
import "./chunk-IBPSXDUB.js";
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-AWIOBY7Q.js";
|
|
55
55
|
import "./chunk-G44QYJ57.js";
|
|
56
56
|
import "./chunk-APZ6ZTDA.js";
|
|
57
57
|
import {
|
|
@@ -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 O="assist-browser-probe";var T="/ws/browser",d="assist-browser-link";function b(e,r){e.readyState===WebSocket.OPEN&&e.send(JSON.stringify(r))}var P="assist-console-entries",x="recordConsole";async function w(){return(await g()?.get(x).catch(()=>{}))?.[x]===!0}var ce="assist-console",
|
|
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 O="assist-browser-probe";var T="/ws/browser",d="assist-browser-link";function b(e,r){e.readyState===WebSocket.OPEN&&e.send(JSON.stringify(r))}var P="assist-console-entries",x="recordConsole";async function w(){return(await g()?.get(x).catch(()=>{}))?.[x]===!0}var ce="assist-console",C="entries";function le(){return new Promise((e,r)=>{let t=indexedDB.open(ce,1);t.onupgradeneeded=()=>t.result.createObjectStore(C,{keyPath:"id",autoIncrement:!0}).createIndex("time","time"),t.onsuccess=()=>e(t.result),t.onerror=()=>r(t.error)})}async function p(e,r){let t=await le();try{return await new Promise((s,n)=>{let o=t.transaction(C,e),i=r(o.objectStore(C));o.oncomplete=()=>s(i),o.onerror=()=>n(o.error),o.onabort=()=>n(o.error)})}finally{t.close()}}function de(e,{tabId:r,since:t},s){return r!==void 0&&e.tabId!==r||t!==void 0&&e.time<t?!1:s?[e.message,e.stack,e.url].some(n=>n?.toLowerCase().includes(s)):!0}async function B(e){let r=e.grep?.toLowerCase();return(await p("readonly",s=>{let n=[],o=s.openCursor(null,"prev");return o.onsuccess=()=>{let i=o.result;if(!i||n.length>=e.limit)return;let{id:A,...f}=i.value;de(f,e,r)&&n.push(f),i.continue()},n})).reverse()}async function E(e,r){let t=await w(),s=t?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:t,entries:s}}}function R(e,r,t){let s=t?.running===!0;return e==="status"?{ok:!0,result:{tabUrl:r,contentScript:s}}:s?t.error||!t.result?{ok:!1,tabUrl:r,error:t.error??"empty probe reply"}:{ok:!0,result:{tabUrl:r,...t.result}}:{ok:!1,tabUrl:r,error:"the assist content script is not running on the target tab (reload the tab, or update the extension)"}}var fe=new Set(["localhost","127.0.0.1"]);function _(e){if(!e)return!1;let r;try{r=new URL(e)}catch{return!1}let{protocol:t,hostname:s}=r;return t==="http:"?fe.has(s):t!=="https:"?!1:s==="github.com"||s==="dev.azure.com"||s.endsWith(".visualstudio.com")}function I(e){return e.reduce((r,t)=>!r||(t.lastAccessed??0)>(r.lastAccessed??0)?t:r,void 0)}function H(e,r,t){if(t)return I(e.filter(n=>n.url?.includes(t)));let s=e.filter(n=>n.active);return s.find(n=>n.windowId===r)??I(s)}var ge="github.com, dev.azure.com, *.visualstudio.com, localhost, 127.0.0.1";async function N(e,r){let[t,s]=await Promise.all([e.tabs.query({}),e.windows?.getLastFocused().catch(()=>{})]),n=H(t,s?.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 (${ge})`}:{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 t=e.userScripts?.execute;return t?{execute:t.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
|
|
20
|
+
`}async function F(e,r,t){let s;try{s=await e.execute({js:[{code:U(t)}],target:{tabId:r},injectImmediately:!0})}catch(i){return{outcome:"error",error:i instanceof Error?i.message:String(i)}}let[n]=s;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 K(e,r,t,s,n){let o=await D(e);if(typeof o=="string")return{ok:!1,tabUrl:t,error:o};let i=R("run",t,await s());if(!i.ok)return i;let{decision:A}=i.result;if(A!=="run")return{ok:!0,result:{tabUrl:t,outcome:A}};let f=await F(o,r,n);return{ok:!0,result:{tabUrl:t,...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 t=await N(r,e.url);if("ok"in t)return t;if(e.op==="console")return E(e,t);let s=()=>r.tabs.sendMessage(t.id,{...e,type:O}).then(n=>n).catch(()=>{});return e.op==="run"?K(r,t.id,t.url,s,e.code):R(e.op,t.url,await s())}async function $(e,r){let t;try{t=JSON.parse(String(r))}catch{return}if(t.type!=="request")return;let s=await j(t).catch(n=>({ok:!1,error:n instanceof Error?n.message:String(n)}));b(e,{...s,type:"response",id:t.id})}var ye=5e3,c,h;function W(){let e=u();e&&(e.alarms?.create(d,{periodInMinutes:.5}),e.alarms?.onAlarm.addListener(r=>{r.name===d&&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=be().finally(()=>{h=void 0}))}async function be(){let e=await a(),r=new WebSocket(`${e.replace(/^http/,"ws")}${T}`);c=r,r.addEventListener("open",()=>b(r,{type:"hello",version:u()?.runtime.getManifest().version??"unknown"})),r.addEventListener("message",t=>{$(r,t.data)}),r.addEventListener("close",()=>{c===r&&(c=void 0,setTimeout(L,ye))})}function m(){return globalThis.browser?.runtime}var ke={maxAgeMs:6048e5,maxEntries:2e4};function Se(e,r){let t=e.count();t.onsuccess=()=>{let s=t.result-r;if(s<=0)return;let n=e.openCursor(),o=s===1;n.onsuccess=()=>{let i=n.result;if(i){if(!o){o=!0,i.advance(s-1);return}e.delete(IDBKeyRange.upperBound(i.primaryKey))}}}}function k(e,r,{maxAgeMs:t,maxEntries:s}=ke){let n=e.index("time").openCursor(IDBKeyRange.upperBound(r-t,!0));n.onsuccess=()=>{let o=n.result;if(!o){Se(e,s);return}o.delete(),o.continue()}}function q(e,r,t){return p("readwrite",s=>{for(let n of e)s.add(n);k(s,r,t)})}function G(e){return p("readwrite",r=>k(r,e))}function S(e){return e.length<=2048?e:`${e.slice(0,2047)}\u2026`}var Ae=new Set(["warn","error","uncaught","rejection"]);function Y(e){let{time:r,level:t,message:s,stack:n,url:o}=e??{};if(!(typeof r!="number"||!Ae.has(t)||typeof s!="string"||typeof o!="string"))return{time:r,level:t,message:S(s),url:S(o),...typeof n=="string"&&n?{stack:S(n)}:{}}}function xe(e){let{type:r,entries:t}=e??{};return r===P&&Array.isArray(t)}async function Ce(e,r){if(!await w())return;let t=e.flatMap(s=>{let n=Y(s);return n?[{...n,tabId:r}]:[]});t.length&&await q(t,Date.now())}function X(){m()?.onMessage.addListener((e,r)=>{let t=r?.tab?.id;!xe(e)||t===void 0||Ce(e.entries,t).catch(()=>{})}),u()?.alarms?.onAlarm.addListener(e=>{e.name===d&&G(Date.now()).catch(()=>{})})}function V(e){let{type:r,pageId:t,prompt:s}=e??{};return r==="assist-docs-feedback"&&typeof t=="string"&&typeof s=="string"}async function l(e,r,t){let s;try{s=await fetch(`${e}${r}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})}catch{return{ok:!1,message:`assist web server unreachable at ${e}`}}let n=await s.json().catch(()=>({}));return s.ok?{ok:!0,data:n}:{ok:!1,message:n.error??`assist web server returned ${s.status}`}}async function Q(e,{type:r,...t}){let s=await l(e,"/api/sessions/docs-feedback",t);return s.ok?{ok:!0,message:s.data.message??"Sent to the docs session"}:s}async function z(e,{refs:r}){let t=await l(e,"/api/link-status",{refs:r});if(!t.ok)return t;let{states:s}=t.data;return!s||typeof s!="object"?{ok:!1,message:"assist web server returned no states"}:{ok:!0,states:s}}function Z(e){let{type:r,refs:t}=e??{};return r==="assist-link-status"&&Array.isArray(t)}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 t=await r.json().catch(()=>({}));return!r.ok||!Array.isArray(t.clones)?{ok:!1,message:t.error??`assist web server returned ${r.status}`}:{ok:!0,clones:t.clones.filter(s=>typeof s=="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 te(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 se(e){return e?.type==="assist-clones"}function ne(e){return e?.type==="assist-harness"}var Ee={draft:["draft","--once"],bug:["bug","--once"]};function oe(e){return typeof e=="string"&&Object.hasOwn(Ee,e)}function ie(e){let{type:r,url:t,args:s,mode:n,repo:o}=e??{};return r==="assist-send"&&typeof t=="string"&&(s===void 0||Array.isArray(s)&&s.every(i=>typeof i=="string"))&&(n===void 0||oe(n))&&(o===void 0||typeof o=="string")}function ae(){return globalThis.browser?.action}function he({url:e,instructions:r,args:t,mode:s,repo:n}){return t?["review-from-github",{url:e,args:t}]:n!==void 0?["from-link",{url:e,repo:n,instructions:r,mode:s}]:["from-github",{url:e,instructions:r,mode:s}]}async function ue(e,r){let[t,s]=he(r),n=await l(e,`/api/sessions/${t}`,s);return n.ok?{ok:!0,message:`assist session started in ${n.data.cwd}`}:n}function Le(){m()?.onMessage.addListener(e=>{if(ie(e))return a().then(r=>ue(r,e));if(se(e))return a().then(ee);if(ne(e))return a().then(te);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?.()})}Le();W();X();})();
|