pushary 1.9.267 → 1.9.268
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/CHANGELOG.md +8 -0
- package/dist/{api-L2Z47RNK.js → api-2PD4GLZO.js} +12 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +28 -29
- package/dist/bin/pushary-bell.js +11 -12
- package/dist/bin/pushary-calls.js +14 -15
- package/dist/bin/pushary-claude.js +25 -26
- package/dist/bin/pushary-clean.js +39 -40
- package/dist/bin/pushary-codex-bridge.js +22 -23
- package/dist/bin/pushary-codex-hook.js +34 -35
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +16 -16
- package/dist/bin/pushary-connect.js +35 -36
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +46 -47
- package/dist/bin/pushary-disconnect.js +30 -31
- package/dist/bin/pushary-display-hook.js +18 -0
- package/dist/bin/pushary-doctor.js +50 -51
- package/dist/bin/pushary-elicitation-hook.js +27 -28
- package/dist/bin/pushary-gemini-bridge.js +17 -18
- package/dist/bin/pushary-gemini-hook.js +31 -32
- package/dist/bin/pushary-hook.js +35 -36
- package/dist/bin/pushary-login.js +101 -25
- package/dist/bin/pushary-logout.js +31 -32
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +15 -16
- package/dist/bin/pushary-notification-hook.js +27 -28
- package/dist/bin/pushary-opencode-bridge.js +21 -22
- package/dist/bin/pushary-opencode-hook.js +32 -33
- package/dist/bin/pushary-permission-denied-hook.js +34 -35
- package/dist/bin/pushary-permission-hook.js +35 -36
- package/dist/bin/pushary-post-hook.js +28 -29
- package/dist/bin/pushary-prompt-hook.js +27 -28
- package/dist/bin/pushary-session-end-hook.js +27 -28
- package/dist/bin/pushary-session-start-hook.js +39 -40
- package/dist/bin/pushary-sessions.js +12 -12
- package/dist/bin/pushary-setup.js +65 -73
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +36 -37
- package/dist/bin/pushary-stop-hook.js +27 -28
- package/dist/bin/pushary-stopfailure-hook.js +27 -28
- package/dist/bin/pushary-suggestions.js +15 -16
- package/dist/bin/pushary-transcript-register.js +16 -17
- package/dist/bin/pushary-transcripts.js +25 -26
- package/dist/bin/pushary-upgrade.js +47 -48
- package/dist/bin/pushary-wait.js +16 -17
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-OEKXK3YR.js → chunk-26K5VC53.js} +1 -1
- package/dist/{chunk-OTCNXBIY.js → chunk-2EHLFIVK.js} +4 -4
- package/dist/{chunk-XUN2NSYF.js → chunk-2FI62SKT.js} +1 -1
- package/dist/{chunk-Y2CO2RMJ.js → chunk-47NWTV5K.js} +45 -13
- package/dist/{chunk-SLWLFMMB.js → chunk-4LRWEHQT.js} +65 -6
- package/dist/{chunk-RQ5DKUF4.js → chunk-4ZSC56SL.js} +1 -1
- package/dist/{chunk-KCQP7ZDP.js → chunk-5LE7C6Q2.js} +2 -2
- package/dist/{chunk-TFI7UZ4N.js → chunk-5WSFZXR6.js} +2 -2
- package/dist/{chunk-BO5TJWAN.js → chunk-AOCTHK4E.js} +3 -3
- package/dist/{chunk-573LGFOV.js → chunk-AQP5SMAF.js} +2 -2
- package/dist/{chunk-4R7RMJIP.js → chunk-AQPA4YIB.js} +1 -1
- package/dist/{chunk-J26QBILB.js → chunk-AT3C3Z3M.js} +7 -7
- package/dist/{chunk-275RFVSO.js → chunk-AXVLRYIK.js} +1 -1
- package/dist/{chunk-KK57NC2O.js → chunk-BQ23UZJY.js} +5 -5
- package/dist/{chunk-UVRUK52J.js → chunk-CIO6FAIU.js} +1 -1
- package/dist/{chunk-KPH6GX74.js → chunk-DC35GPRY.js} +8 -8
- package/dist/{chunk-EVT7LZ7E.js → chunk-DJYBACUW.js} +1 -1
- package/dist/{chunk-GXHOOPOY.js → chunk-DPOLLK6I.js} +3 -3
- package/dist/{chunk-7KAMTVC2.js → chunk-DVAXZOTR.js} +1 -1
- package/dist/{chunk-XPLUSOU5.js → chunk-EKU4KLON.js} +1 -1
- package/dist/{chunk-MQO4F37H.js → chunk-ERE3R6SS.js} +4 -4
- package/dist/{chunk-ZJLVASQZ.js → chunk-FF2LDPB2.js} +4 -4
- package/dist/{chunk-HZG7IUDL.js → chunk-FFWESSEY.js} +4 -4
- package/dist/{chunk-EVX63B2G.js → chunk-FHCXJ2HZ.js} +5 -5
- package/dist/{chunk-PDANBIJA.js → chunk-FK4BFIFR.js} +5 -5
- package/dist/{chunk-WH5M67RN.js → chunk-GCDVD242.js} +6 -6
- package/dist/{chunk-WNMTWBV4.js → chunk-GEBRKBLB.js} +5 -5
- package/dist/{chunk-S44D2HDB.js → chunk-GMQ73QWC.js} +16 -16
- package/dist/{chunk-I2EZVCOY.js → chunk-GP5UGODT.js} +5 -5
- package/dist/{chunk-GF75PDAQ.js → chunk-GPEGT2EP.js} +1 -1
- package/dist/{chunk-4YOLB6H7.js → chunk-GYLIVREZ.js} +18 -0
- package/dist/{chunk-JSPW2FFO.js → chunk-HEAJBTIG.js} +1 -1
- package/dist/{chunk-WAVZTVYL.js → chunk-HPLG5D6Y.js} +5 -5
- package/dist/{chunk-A2YOC25E.js → chunk-HSX5EVPH.js} +2 -2
- package/dist/{chunk-KQ5S2ZUP.js → chunk-IEQDAZDB.js} +2 -2
- package/dist/{chunk-QW7LM6BG.js → chunk-IQBJD5ZB.js} +4 -4
- package/dist/{chunk-YJ2T5AKE.js → chunk-IR342JX3.js} +6 -6
- package/dist/{chunk-TXPDNOKT.js → chunk-JQCF2IYA.js} +1 -1
- package/dist/{chunk-IRS2FE32.js → chunk-JSE7T4JL.js} +1 -1
- package/dist/{chunk-NDOHMHU7.js → chunk-JXWWWVGR.js} +10 -10
- package/dist/{chunk-WUKZEENF.js → chunk-KQZQ55CO.js} +4 -4
- package/dist/{chunk-MGFCPJHQ.js → chunk-KVCWPOF6.js} +8 -5
- package/dist/{chunk-6QFYQYLV.js → chunk-L6CWEU5C.js} +2 -2
- package/dist/{chunk-JYKM47DL.js → chunk-LF5OEQNP.js} +2 -2
- package/dist/{chunk-QTWLOFBV.js → chunk-LYBX463S.js} +2 -2
- package/dist/{chunk-VSOUII7B.js → chunk-M2ETE6JQ.js} +1 -1
- package/dist/{chunk-XHKGTKM6.js → chunk-N6ARPVSQ.js} +86 -79
- package/dist/{chunk-BWPDGMKS.js → chunk-NA5EQTCV.js} +1 -1
- package/dist/{chunk-UX7YU7EM.js → chunk-NAVHNIM4.js} +1 -1
- package/dist/{chunk-AXIIY75S.js → chunk-NOWWUX5V.js} +3 -3
- package/dist/{chunk-OF7LT6JD.js → chunk-NRTSHLZQ.js} +6 -6
- package/dist/{chunk-3DY5G7JW.js → chunk-NYP2NRV3.js} +1 -1
- package/dist/{chunk-RB4QNUFM.js → chunk-O2X6KT7P.js} +4 -4
- package/dist/{chunk-DW7YF5GB.js → chunk-P6AKOYLZ.js} +4 -4
- package/dist/{chunk-LXH5JLD7.js → chunk-QJHOS33W.js} +5 -5
- package/dist/{chunk-MDG6IDIJ.js → chunk-S2DKGGEL.js} +5 -5
- package/dist/{chunk-OOSDN4AF.js → chunk-S4AQUVX3.js} +3 -3
- package/dist/{chunk-NBU7Y6JX.js → chunk-S55XHTYZ.js} +1 -1
- package/dist/{chunk-HWIXP7UY.js → chunk-SYCNMJ3Z.js} +1 -1
- package/dist/{chunk-FSTX5SRV.js → chunk-SYEUQH6Z.js} +3 -3
- package/dist/{chunk-SSQWDL6Q.js → chunk-TEFLCQO4.js} +1 -1
- package/dist/{chunk-MY3ZY6B2.js → chunk-TKMOPFZS.js} +3 -3
- package/dist/{chunk-IV7POIBI.js → chunk-TOELRIWR.js} +59 -13
- package/dist/{chunk-XF3R4ZPV.js → chunk-TZO67S4V.js} +10 -10
- package/dist/{chunk-V6673KO7.js → chunk-U2OB44U5.js} +5 -5
- package/dist/{chunk-KPQ7QKS4.js → chunk-UNF23P35.js} +1 -1
- package/dist/{chunk-7YCRU3HC.js → chunk-UQB4MAA6.js} +3 -3
- package/dist/{chunk-WX6YWZFM.js → chunk-UVO56TVL.js} +7 -7
- package/dist/{chunk-2IXNXTLA.js → chunk-V2UGSM45.js} +6 -6
- package/dist/{chunk-U6X2XWRP.js → chunk-WCEP3U7C.js} +1 -1
- package/dist/{chunk-4TRRDGM5.js → chunk-WHFXXV2A.js} +25 -2
- package/dist/{chunk-FF7JYSH5.js → chunk-WYYZ2UFX.js} +2 -2
- package/dist/{chunk-7SSL355C.js → chunk-WZM7Y5HM.js} +1 -1
- package/dist/{chunk-YFJ4ANFO.js → chunk-X5R55HMM.js} +6 -6
- package/dist/{chunk-CSI5V5NO.js → chunk-XIEYX4TJ.js} +1 -1
- package/dist/{chunk-LOSHKUR2.js → chunk-XPS36L6H.js} +3 -3
- package/dist/{chunk-TDDX5PAP.js → chunk-XUJBTEUC.js} +4 -4
- package/dist/{chunk-5K6MB557.js → chunk-YBAU5TAV.js} +2 -2
- package/dist/{chunk-KBQBO3KA.js → chunk-YGCU6KMO.js} +3 -3
- package/dist/{chunk-FV2YDUH5.js → chunk-YZRUE46K.js} +1 -1
- package/dist/{chunk-2C7L3B3T.js → chunk-Z5KP6GBC.js} +4 -4
- package/dist/{chunk-LB474DMC.js → chunk-ZYQHIMZU.js} +5 -5
- package/dist/{codex-app-cards-switch-MZBLPDC5.js → codex-app-cards-switch-TSHQTVOY.js} +11 -12
- package/dist/{codex-card-routing-QMXQ3RRX.js → codex-card-routing-EZFQRLL5.js} +2 -2
- package/dist/{codex-desktop-launch-7H4COE7H.js → codex-desktop-launch-RBW6N6HI.js} +3 -3
- package/dist/{codex-session-launch-ZSY7FTS3.js → codex-session-launch-TERIKZPR.js} +21 -20
- package/dist/{config-PPMFPV2E.js → config-2AGEPXWU.js} +3 -3
- package/dist/{global-upgrade-RFXS76KH.js → global-upgrade-67DCWAOQ.js} +9 -9
- package/dist/{identity-SLRS7XIR.js → identity-QETOMF2L.js} +4 -4
- package/dist/{live-capabilities-4G46QNGE.js → live-capabilities-5UIO6P52.js} +4 -4
- package/dist/{paths-55IJMRJW.js → paths-IRWDFERG.js} +3 -3
- package/dist/reapply-BBNONPII.js +81 -0
- package/dist/src/index.js +33 -34
- package/dist/{upgrade-lock-UGPXSPSU.js → upgrade-lock-LICESK4W.js} +4 -4
- package/dist/{usage-YC6BB7BX.js → usage-CNCT5BGJ.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-B3FN4XL2.js +0 -44
- package/dist/reapply-HA6RLYRS.js +0 -76
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-B3FN4XL2.js";
|
|
4
1
|
import {
|
|
5
2
|
apiKeyInForce,
|
|
6
3
|
configFilePath,
|
|
7
4
|
keyPrefixToShow
|
|
8
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5LE7C6Q2.js";
|
|
9
6
|
import {
|
|
10
7
|
backupFile,
|
|
11
8
|
backupFileInto,
|
|
@@ -16,12 +13,46 @@ import {
|
|
|
16
13
|
import {
|
|
17
14
|
API_KEY_PREFIX_PATTERN,
|
|
18
15
|
isRecord,
|
|
19
|
-
isValidApiKey
|
|
20
|
-
|
|
16
|
+
isValidApiKey,
|
|
17
|
+
normalizeInstallSource
|
|
18
|
+
} from "./chunk-GYLIVREZ.js";
|
|
19
|
+
|
|
20
|
+
// src/install-source.ts
|
|
21
|
+
import { readFileSync } from "fs";
|
|
22
|
+
var ENV_OVERRIDE = "PUSHARY_INSTALL_SOURCE";
|
|
23
|
+
var PLUGIN_ROOT = "CLAUDE_PLUGIN_ROOT";
|
|
24
|
+
var EDITOR_PLUGIN_MARKERS = ["cursor-plugin", "vscode-plugin"];
|
|
25
|
+
var detectInstallSource = (env = process.env, argv = process.argv) => {
|
|
26
|
+
const declared = env[ENV_OVERRIDE]?.trim();
|
|
27
|
+
if (declared) return normalizeInstallSource(declared);
|
|
28
|
+
const pluginRoot = env[PLUGIN_ROOT]?.trim();
|
|
29
|
+
if (pluginRoot) {
|
|
30
|
+
return EDITOR_PLUGIN_MARKERS.some((marker) => pluginRoot.includes(marker)) ? "editor_plugin" : "claude_plugin";
|
|
31
|
+
}
|
|
32
|
+
const entry = argv[1] ?? "";
|
|
33
|
+
if (entry.includes("_npx")) return "npx";
|
|
34
|
+
if (entry) return "npm";
|
|
35
|
+
return "unknown";
|
|
36
|
+
};
|
|
37
|
+
var storedInstallSource = () => {
|
|
38
|
+
try {
|
|
39
|
+
const parsed = JSON.parse(readFileSync(configFilePath(), "utf-8"));
|
|
40
|
+
const stored = parsed.installSource;
|
|
41
|
+
return typeof stored === "string" && stored ? normalizeInstallSource(stored) : void 0;
|
|
42
|
+
} catch {
|
|
43
|
+
return void 0;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var resolveInstallSourceFor = (config) => {
|
|
47
|
+
const stored = config.installSource;
|
|
48
|
+
if (typeof stored === "string" && stored) return normalizeInstallSource(stored);
|
|
49
|
+
return detectInstallSource();
|
|
50
|
+
};
|
|
51
|
+
var reportedInstallSource = () => storedInstallSource() ?? detectInstallSource();
|
|
21
52
|
|
|
22
53
|
// src/shell-alias.ts
|
|
23
54
|
import { homedir } from "os";
|
|
24
|
-
import { existsSync, readFileSync, appendFileSync, writeFileSync } from "fs";
|
|
55
|
+
import { existsSync, readFileSync as readFileSync2, appendFileSync, writeFileSync } from "fs";
|
|
25
56
|
import { join } from "path";
|
|
26
57
|
var MARKER_START = "# >>> pushary >>>";
|
|
27
58
|
var MARKER_END = "# <<< pushary <<<";
|
|
@@ -64,7 +95,7 @@ var removeClaudeAlias = () => {
|
|
|
64
95
|
if (!existsSync(path)) continue;
|
|
65
96
|
let content;
|
|
66
97
|
try {
|
|
67
|
-
content =
|
|
98
|
+
content = readFileSync2(path, "utf-8");
|
|
68
99
|
} catch {
|
|
69
100
|
continue;
|
|
70
101
|
}
|
|
@@ -81,7 +112,7 @@ var removeClaudeAlias = () => {
|
|
|
81
112
|
};
|
|
82
113
|
|
|
83
114
|
// src/keystore.ts
|
|
84
|
-
import { chmodSync, constants as fsConstants, copyFileSync, existsSync as existsSync2, lstatSync, mkdirSync, readdirSync, readFileSync as
|
|
115
|
+
import { chmodSync, constants as fsConstants, copyFileSync, existsSync as existsSync2, lstatSync, mkdirSync, readdirSync, readFileSync as readFileSync3, realpathSync, rmSync, statSync, writeFileSync as writeFileSync2 } from "fs";
|
|
85
116
|
import { homedir as homedir2 } from "os";
|
|
86
117
|
import { basename, dirname, isAbsolute, join as join2, relative } from "path";
|
|
87
118
|
var KEY_FILE_MODE = 384;
|
|
@@ -191,7 +222,7 @@ var isRegularFile = (path) => {
|
|
|
191
222
|
};
|
|
192
223
|
var holdsAPusharyKey = (file) => {
|
|
193
224
|
try {
|
|
194
|
-
return
|
|
225
|
+
return readFileSync3(file, "utf8").split(/\r?\n/).some(isPusharyKeyLine);
|
|
195
226
|
} catch {
|
|
196
227
|
return false;
|
|
197
228
|
}
|
|
@@ -316,7 +347,7 @@ var realPathOf = (filePath) => {
|
|
|
316
347
|
var isMissingFileError = (err) => err instanceof Error && "code" in err && err.code === "ENOENT";
|
|
317
348
|
var readRcContents = (path) => {
|
|
318
349
|
try {
|
|
319
|
-
return { kind: "read", content:
|
|
350
|
+
return { kind: "read", content: readFileSync3(path, "utf-8") };
|
|
320
351
|
} catch (err) {
|
|
321
352
|
return isMissingFileError(err) ? { kind: "read", content: "" } : { kind: "unavailable", detail: errorMessageOf(err) };
|
|
322
353
|
}
|
|
@@ -411,7 +442,7 @@ var writeKey = (apiKey, origin, options = {}) => {
|
|
|
411
442
|
var disableKeyLinesIn = (rcPath, loader, isReplacedLine) => {
|
|
412
443
|
try {
|
|
413
444
|
const real = realpathSync(rcPath);
|
|
414
|
-
const lines =
|
|
445
|
+
const lines = readFileSync3(real, "utf8").split("\n");
|
|
415
446
|
const edit = replaceKeyLinesWithLoader(lines, loader, isReplacedLine);
|
|
416
447
|
if (keyLinesWereReplaced(lines, edit)) writeFileSync2(real, edit.lines.join("\n"));
|
|
417
448
|
return edit.replacedLineCount;
|
|
@@ -522,7 +553,7 @@ var shellProfileCandidates = () => {
|
|
|
522
553
|
};
|
|
523
554
|
var readProfileOrNull = (path) => {
|
|
524
555
|
try {
|
|
525
|
-
return
|
|
556
|
+
return readFileSync3(path, "utf8");
|
|
526
557
|
} catch {
|
|
527
558
|
return null;
|
|
528
559
|
}
|
|
@@ -537,6 +568,7 @@ var findExportedKeyLines = (profiles = exportedKeyFiles()) => profiles.flatMap(e
|
|
|
537
568
|
var findExportedKeyLine = (profiles = exportedKeyFiles()) => findExportedKeyLines(profiles)[0] ?? null;
|
|
538
569
|
|
|
539
570
|
export {
|
|
571
|
+
reportedInstallSource,
|
|
540
572
|
CANDIDATE_RCS,
|
|
541
573
|
resolveShellRc,
|
|
542
574
|
removeClaudeAlias,
|
|
@@ -8,41 +8,54 @@ import {
|
|
|
8
8
|
SubscriptionRequiredError,
|
|
9
9
|
callMcpTool,
|
|
10
10
|
isRetryable
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZYQHIMZU.js";
|
|
12
12
|
import {
|
|
13
13
|
fetchAsCredential
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-SYCNMJ3Z.js";
|
|
15
15
|
import {
|
|
16
16
|
installNetworkDefaults,
|
|
17
17
|
isNetworkFailure
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-S4AQUVX3.js";
|
|
19
|
+
import {
|
|
20
|
+
keyPrefix
|
|
21
|
+
} from "./chunk-47NWTV5K.js";
|
|
19
22
|
import {
|
|
20
23
|
clientReportClaims
|
|
21
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-WHFXXV2A.js";
|
|
22
25
|
import {
|
|
23
26
|
getApiKey,
|
|
24
27
|
getBaseUrl
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-5LE7C6Q2.js";
|
|
29
|
+
import {
|
|
30
|
+
getPackageVersion
|
|
31
|
+
} from "./chunk-CXQWDQCJ.js";
|
|
26
32
|
import {
|
|
27
33
|
ASK_AGENT_NAME_MAX,
|
|
28
34
|
CANCEL_QUESTION_REASON_FIELD,
|
|
29
35
|
CLIENT_REPORT_PATH,
|
|
30
36
|
DECISION_LINE_MAX,
|
|
31
37
|
GATE_PERMISSION_MODE_MAX_LENGTH,
|
|
38
|
+
KEY_REJECTED_PHASE,
|
|
32
39
|
QUESTION_WITHDRAWAL_REASON,
|
|
40
|
+
SETUP_STOPPED_PATH,
|
|
41
|
+
TEST_TRAFFIC_ENV,
|
|
42
|
+
TEST_TRAFFIC_HEADER,
|
|
43
|
+
TEST_TRAFFIC_HEADER_VALUE,
|
|
33
44
|
TOOL_FAILURE_CODES,
|
|
34
45
|
WAIT_END_CLOSED,
|
|
35
46
|
WAIT_END_OPEN,
|
|
36
47
|
WAIT_END_PATH,
|
|
48
|
+
computerOsOfPlatform,
|
|
37
49
|
degradedLine,
|
|
38
50
|
isAskUserReply,
|
|
39
51
|
isAwayPaused,
|
|
40
52
|
isDecisionStoppedReply,
|
|
41
53
|
isLocalQuestionHandoff,
|
|
42
54
|
isRecord,
|
|
55
|
+
responseRejectsCredential,
|
|
43
56
|
truncateLine,
|
|
44
57
|
waitEndAnswered
|
|
45
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-GYLIVREZ.js";
|
|
46
59
|
|
|
47
60
|
// src/api.ts
|
|
48
61
|
import { randomUUID } from "crypto";
|
|
@@ -166,6 +179,30 @@ var claimReportWindow = (claimsDir, key, now) => {
|
|
|
166
179
|
return "claimed";
|
|
167
180
|
};
|
|
168
181
|
|
|
182
|
+
// src/test-traffic.ts
|
|
183
|
+
var TEST_TRAFFIC_ON_VALUES = /* @__PURE__ */ new Set(["1", "true"]);
|
|
184
|
+
var runsAsTestTraffic = (env) => TEST_TRAFFIC_ON_VALUES.has((env[TEST_TRAFFIC_ENV] ?? "").trim().toLowerCase());
|
|
185
|
+
var testTrafficHeaders = (env = process.env) => runsAsTestTraffic(env) ? { [TEST_TRAFFIC_HEADER]: TEST_TRAFFIC_HEADER_VALUE } : {};
|
|
186
|
+
|
|
187
|
+
// src/keyless-beacon.ts
|
|
188
|
+
var defaultKeylessBeaconDeps = () => ({ fetchImpl: fetch, baseUrl: getBaseUrl, env: process.env });
|
|
189
|
+
var postKeylessBeaconUntil = async (beacon, signal, deps = defaultKeylessBeaconDeps()) => {
|
|
190
|
+
const response = await deps.fetchImpl(`${deps.baseUrl()}${SETUP_STOPPED_PATH}`, {
|
|
191
|
+
method: "POST",
|
|
192
|
+
headers: { "content-type": "application/json", ...testTrafficHeaders(deps.env) },
|
|
193
|
+
body: JSON.stringify(beacon),
|
|
194
|
+
signal
|
|
195
|
+
});
|
|
196
|
+
await response.body?.cancel();
|
|
197
|
+
};
|
|
198
|
+
var postKeylessBeacon = (beacon, timeoutMs, deps = defaultKeylessBeaconDeps()) => postKeylessBeaconUntil(beacon, AbortSignal.timeout(timeoutMs), deps);
|
|
199
|
+
|
|
200
|
+
// src/telemetry-opt-out.ts
|
|
201
|
+
var TELEMETRY_OPT_OUT_VARIABLES = ["DO_NOT_TRACK", "PUSHARY_TELEMETRY_DISABLED"];
|
|
202
|
+
var OPT_IN_SPELLINGS = ["", "0", "false"];
|
|
203
|
+
var variableOptsOut = (value) => value !== void 0 && !OPT_IN_SPELLINGS.includes(value.trim().toLowerCase());
|
|
204
|
+
var telemetryOptedOut = (env) => TELEMETRY_OPT_OUT_VARIABLES.some((name) => variableOptsOut(env[name]));
|
|
205
|
+
|
|
169
206
|
// src/client-report.ts
|
|
170
207
|
var CLIENT_REPORT_TIMEOUT_MS = 1e3;
|
|
171
208
|
var CLIENT_REPORT_MAX_ATTEMPTS = 2;
|
|
@@ -185,6 +222,14 @@ var defaultDeps = () => ({
|
|
|
185
222
|
claimsDir: clientReportClaims()
|
|
186
223
|
});
|
|
187
224
|
var reportKey = (event) => `${event.kind}:${event.code}`;
|
|
225
|
+
var REJECTED_KEY_CLAIM = "key-rejected";
|
|
226
|
+
var keyRejectedBeaconOf = (apiKey, event, cliVersion, platform) => ({
|
|
227
|
+
phase: KEY_REJECTED_PHASE,
|
|
228
|
+
keyPrefix: keyPrefix(apiKey),
|
|
229
|
+
code: event.code,
|
|
230
|
+
cliVersion,
|
|
231
|
+
os: computerOsOfPlatform(platform)
|
|
232
|
+
});
|
|
188
233
|
var createClientErrorReporter = (deps) => {
|
|
189
234
|
const windowClaimedInProcess = /* @__PURE__ */ new Map();
|
|
190
235
|
const claimInProcess = (key, now) => {
|
|
@@ -196,6 +241,16 @@ var createClientErrorReporter = (deps) => {
|
|
|
196
241
|
const claim = claimReportWindow(deps.claimsDir, key, now);
|
|
197
242
|
return claim === "unavailable" ? claimInProcess(key, now) : claim === "claimed";
|
|
198
243
|
};
|
|
244
|
+
const claimRejectedKeyBeacon = (now) => claimReportWindow(deps.claimsDir, REJECTED_KEY_CLAIM, now) === "claimed";
|
|
245
|
+
const reportRejectedKeyOnce = async (apiKey, event, now, signal) => {
|
|
246
|
+
if (telemetryOptedOut(process.env) || signal.aborted || !claimRejectedKeyBeacon(now)) return;
|
|
247
|
+
try {
|
|
248
|
+
const beacon = keyRejectedBeaconOf(apiKey, event, getPackageVersion(), process.platform);
|
|
249
|
+
await postKeylessBeaconUntil(beacon, signal, { fetchImpl: deps.fetchImpl, baseUrl: deps.baseUrl, env: process.env });
|
|
250
|
+
} catch {
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
199
254
|
return async (event) => {
|
|
200
255
|
try {
|
|
201
256
|
if (deps.disabled()) return;
|
|
@@ -212,6 +267,7 @@ var createClientErrorReporter = (deps) => {
|
|
|
212
267
|
signal
|
|
213
268
|
}, deps.fetchImpl);
|
|
214
269
|
await response.body?.cancel();
|
|
270
|
+
if (responseRejectsCredential(response.status, response.headers)) return await reportRejectedKeyOnce(apiKey, event, now, signal);
|
|
215
271
|
if (response.ok || response.status < 500 && response.status !== 429) return;
|
|
216
272
|
} catch {
|
|
217
273
|
if (signal.aborted) return;
|
|
@@ -500,6 +556,9 @@ var claimBlockedAction = async (apiKey, request, timeoutMs) => {
|
|
|
500
556
|
};
|
|
501
557
|
|
|
502
558
|
export {
|
|
559
|
+
testTrafficHeaders,
|
|
560
|
+
postKeylessBeacon,
|
|
561
|
+
telemetryOptedOut,
|
|
503
562
|
CLIENT_REPORT_TIMEOUT_MS,
|
|
504
563
|
reportClientError,
|
|
505
564
|
exitAfterClientReports,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
projectNameFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-S55XHTYZ.js";
|
|
4
4
|
import {
|
|
5
5
|
readConfigFileKey
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-47NWTV5K.js";
|
|
7
7
|
|
|
8
8
|
// src/bell/fleet.ts
|
|
9
9
|
import { closeSync, constants, futimesSync, lstatSync, mkdirSync, openSync, readdirSync, unlinkSync } from "fs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyHookExecutable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2EHLFIVK.js";
|
|
4
4
|
import {
|
|
5
5
|
bridgeResolvesToApp,
|
|
6
6
|
cursorUserHooks,
|
|
7
7
|
executableFileName,
|
|
8
8
|
isBridgeLocator,
|
|
9
9
|
liveBridgeProbe
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-WHFXXV2A.js";
|
|
11
11
|
import {
|
|
12
12
|
atLeast,
|
|
13
13
|
parseVersion
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
isCursorHookPayload,
|
|
22
22
|
isRecord,
|
|
23
23
|
toolsCoveredByGateEntry
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-GYLIVREZ.js";
|
|
25
25
|
|
|
26
26
|
// src/cursor-gate-registration.ts
|
|
27
27
|
import { dirname, isAbsolute, join, resolve } from "path";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-WHFXXV2A.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage,
|
|
7
7
|
throwIfNpmRefusesInstall
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-IQBJD5ZB.js";
|
|
9
9
|
import {
|
|
10
10
|
writeJsonAtomic
|
|
11
11
|
} from "./chunk-PM2NRK6Y.js";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
uploadTranscriptRecords,
|
|
11
11
|
verifyAnchoredRecipients,
|
|
12
12
|
wrapSessionKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DPOLLK6I.js";
|
|
14
14
|
|
|
15
15
|
// src/live-session.ts
|
|
16
16
|
var LIVE_TRANSCRIPT_LIMITS = { queuedRecords: 100, recordCharacters: 32 * 1024 };
|
|
@@ -2,31 +2,31 @@ import {
|
|
|
2
2
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
3
3
|
describeSignedOutKey,
|
|
4
4
|
readSignedOutDiagnosis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-YBAU5TAV.js";
|
|
6
6
|
import {
|
|
7
7
|
APPROVAL_RULES_PATH
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WYYZ2UFX.js";
|
|
9
9
|
import {
|
|
10
10
|
createIo
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-TEFLCQO4.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl,
|
|
14
14
|
checkApiKey,
|
|
15
15
|
describeKeyCheck,
|
|
16
16
|
keyCheckFromResponse
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-NOWWUX5V.js";
|
|
18
18
|
import {
|
|
19
19
|
readKeySource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-47NWTV5K.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5LE7C6Q2.js";
|
|
24
24
|
import {
|
|
25
25
|
EXIT
|
|
26
26
|
} from "./chunk-BG4HHB7E.js";
|
|
27
27
|
import {
|
|
28
28
|
KEY_SCOPE
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-GYLIVREZ.js";
|
|
30
30
|
|
|
31
31
|
// src/cli/report-key.ts
|
|
32
32
|
var { dim, yellow } = createIo();
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
questionWindowOf
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-N6ARPVSQ.js";
|
|
4
4
|
import {
|
|
5
5
|
UNNAMED_ACTION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YZRUE46K.js";
|
|
7
7
|
import {
|
|
8
8
|
ASK_USER_TIMEOUT_MS,
|
|
9
9
|
WAIT_END_TIMEOUT_MS,
|
|
@@ -11,10 +11,10 @@ import {
|
|
|
11
11
|
askUser,
|
|
12
12
|
unavailableQuestionUnlessRefused,
|
|
13
13
|
waitForQuestion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-4LRWEHQT.js";
|
|
15
15
|
import {
|
|
16
16
|
getMachineId
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-4ZSC56SL.js";
|
|
18
18
|
import {
|
|
19
19
|
hookMaxWaitSeconds,
|
|
20
20
|
hookWaitClamped,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
refusesWhenUnanswered,
|
|
25
25
|
ruleApprovesAfterItsFullWindow,
|
|
26
26
|
scopeBreachReasonOf
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-GYLIVREZ.js";
|
|
28
28
|
|
|
29
29
|
// src/pushed-question.ts
|
|
30
30
|
var scopeQuestionOf = (verdict) => {
|
|
@@ -6,17 +6,17 @@ import {
|
|
|
6
6
|
postLiveSession,
|
|
7
7
|
postLiveSessionUntilAccepted,
|
|
8
8
|
startLiveSessionHeartbeat
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AQPA4YIB.js";
|
|
10
10
|
import {
|
|
11
11
|
CommandReceipts,
|
|
12
12
|
controllerCommandSchema
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-JQCF2IYA.js";
|
|
14
14
|
import {
|
|
15
15
|
SESSION_IDLE_TIMEOUT_MS,
|
|
16
16
|
describeIdleWindow,
|
|
17
17
|
idleDeadlinePassed,
|
|
18
18
|
startProcessOwnership
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LF5OEQNP.js";
|
|
20
20
|
import {
|
|
21
21
|
spawnClaude
|
|
22
22
|
} from "./chunk-3PSNUHC5.js";
|
|
@@ -25,18 +25,18 @@ import {
|
|
|
25
25
|
isWaitForAnswerResponse,
|
|
26
26
|
withdrawQuestion,
|
|
27
27
|
writeDegraded
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4LRWEHQT.js";
|
|
29
29
|
import {
|
|
30
30
|
readCommandAck
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NYP2NRV3.js";
|
|
32
32
|
import {
|
|
33
33
|
callMcpTool,
|
|
34
34
|
isRetryable
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-ZYQHIMZU.js";
|
|
36
36
|
import {
|
|
37
37
|
projectNameFor,
|
|
38
38
|
repositoryScopeFor
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-S55XHTYZ.js";
|
|
40
40
|
import {
|
|
41
41
|
AGENT_QUESTION_DESCRIPTION_MAX,
|
|
42
42
|
AGENT_QUESTION_HEADER_MAX,
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
parseCodexQuestions,
|
|
59
59
|
planElicitationAsk,
|
|
60
60
|
readElicitationFields
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-GYLIVREZ.js";
|
|
62
62
|
|
|
63
63
|
// src/codex-question-owner.ts
|
|
64
64
|
import { createHash } from "crypto";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-P6DUWKAO.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchAsCredential
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-SYCNMJ3Z.js";
|
|
8
8
|
import {
|
|
9
9
|
getBaseUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5LE7C6Q2.js";
|
|
11
11
|
import {
|
|
12
12
|
writeJsonAtomicDurable
|
|
13
13
|
} from "./chunk-PM2NRK6Y.js";
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
compressTranscriptRecord,
|
|
16
16
|
redactSecretsFromContent,
|
|
17
17
|
transcriptRecordPlaintext
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-GYLIVREZ.js";
|
|
19
19
|
|
|
20
20
|
// src/transcript-recipient-pin.ts
|
|
21
21
|
import { createHash } from "crypto";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
OPENCODE_PLUGIN_PLACEHOLDER,
|
|
7
7
|
OPENCODE_PLUGIN_SIBLING,
|
|
8
8
|
OPENCODE_PLUGIN_SIBLING_CONTENTS
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-XIEYX4TJ.js";
|
|
10
10
|
|
|
11
11
|
// src/opencode-runtime-bundle.ts
|
|
12
12
|
var openCodeRuntimeSource = `import { spawn } from 'child_process';
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
} from "./chunk-WHB622LP.js";
|
|
5
5
|
import {
|
|
6
6
|
keyPrefix
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-47NWTV5K.js";
|
|
8
8
|
import {
|
|
9
9
|
keyPrefixToShow
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5LE7C6Q2.js";
|
|
11
11
|
import {
|
|
12
12
|
NPX_LATEST_COMMAND
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-WZM7Y5HM.js";
|
|
14
14
|
import {
|
|
15
15
|
isValidApiKey
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-GYLIVREZ.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/key-account.ts
|
|
19
19
|
var isKeyHeldByMacApp = (key, holder) => holder.macAppInstalled && holder.macAppKey === key;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-X5R55HMM.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2EHLFIVK.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-WHFXXV2A.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-GYLIVREZ.js";
|
|
15
15
|
|
|
16
16
|
// src/cursor-config.ts
|
|
17
17
|
var hookCommandOf = (entry) => {
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CODEX_HOOK_STATUS,
|
|
3
3
|
HERMES_HISTORY_HELPER_COMMAND
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XPS36L6H.js";
|
|
5
5
|
import {
|
|
6
6
|
HERMES_ALWAYS_ALLOWED_SHELL_RULE,
|
|
7
7
|
HERMES_COMMAND_ALLOWLIST_KEY,
|
|
8
8
|
HERMES_GATE_TOOLS_KEY,
|
|
9
9
|
HERMES_SHELL_TOOL
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-XUJBTEUC.js";
|
|
11
11
|
import {
|
|
12
12
|
retryAgentCommand
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SYEUQH6Z.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WZM7Y5HM.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/codex-trust.ts
|
|
19
19
|
var CODEX_TRUST_TELEMETRY = {
|
|
@@ -3,24 +3,24 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YGCU6KMO.js";
|
|
7
7
|
import {
|
|
8
8
|
daemonHasRemoteProof,
|
|
9
9
|
daemonServiceManagerAvailable,
|
|
10
10
|
hasDaemonServiceDefinition,
|
|
11
11
|
readDaemonNeedsLogin,
|
|
12
12
|
readDaemonStatus
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-IR342JX3.js";
|
|
14
14
|
import {
|
|
15
15
|
getMachineId
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-4ZSC56SL.js";
|
|
17
17
|
import {
|
|
18
18
|
readControlMode,
|
|
19
19
|
readKeyInForce
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-47NWTV5K.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5LE7C6Q2.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
26
|
} from "./chunk-CXQWDQCJ.js";
|