@pushary/agent-hooks 1.9.23 → 1.9.25
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 +15 -0
- package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
- package/data/cursor-plugin/CHANGELOG.md +4 -0
- package/data/cursor-plugin/scripts/pushary-gate.mjs +4 -2
- package/data/cursor-plugin/scripts/pushary-gate.test.mjs +14 -1
- package/dist/bin/pushary-bell-hook.js +25 -25
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +27 -26
- package/dist/bin/pushary-clean.js +41 -93
- package/dist/bin/pushary-codex-bridge.js +17 -17
- package/dist/bin/pushary-codex-hook.js +30 -30
- package/dist/bin/pushary-codex.js +12 -12
- package/dist/bin/pushary-connect.js +24 -24
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +31 -31
- package/dist/bin/pushary-disconnect.js +24 -24
- package/dist/bin/pushary-doctor.js +33 -33
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +27 -27
- package/dist/bin/pushary-hook.js +29 -29
- package/dist/bin/pushary-login.js +16 -16
- package/dist/bin/pushary-logout.js +77 -26
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +12 -12
- package/dist/bin/pushary-notification-hook.js +24 -24
- package/dist/bin/pushary-opencode-hook.js +26 -26
- package/dist/bin/pushary-permission-denied-hook.js +29 -29
- package/dist/bin/pushary-permission-hook.js +28 -28
- package/dist/bin/pushary-post-hook.js +24 -24
- package/dist/bin/pushary-prompt-hook.js +24 -24
- package/dist/bin/pushary-session-end-hook.js +24 -24
- package/dist/bin/pushary-session-start-hook.js +28 -28
- package/dist/bin/pushary-setup.js +41 -38
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +26 -26
- package/dist/bin/pushary-stop-hook.js +24 -24
- package/dist/bin/pushary-stopfailure-hook.js +24 -24
- package/dist/bin/pushary-suggestions.js +12 -12
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +30 -30
- package/dist/bin/pushary-wait.js +12 -12
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-GN6BJXC7.js → chunk-2CUE3XXS.js} +1 -1
- package/dist/{chunk-OH6OGEOY.js → chunk-2J2WFX7X.js} +4 -4
- package/dist/{chunk-QIODXPTP.js → chunk-2VQZC6DW.js} +4 -4
- package/dist/{chunk-SWQLZQE3.js → chunk-2XHBYMVN.js} +14 -13
- package/dist/{chunk-HXZG5WHU.js → chunk-3UYMOWX6.js} +2 -2
- package/dist/{chunk-R5C3QCVT.js → chunk-4KZP4YMV.js} +1 -1
- package/dist/{chunk-73HGV4R6.js → chunk-5ETE7F45.js} +2 -2
- package/dist/{chunk-OQPEHKH2.js → chunk-5Q2QJ2AL.js} +1 -1
- package/dist/{chunk-K2EYK5RL.js → chunk-5WTEKIAS.js} +4 -4
- package/dist/{chunk-AV5VX7OK.js → chunk-7UZD2F4Y.js} +8 -8
- package/dist/{chunk-E2LGKG75.js → chunk-7V6PJFDF.js} +3 -3
- package/dist/{chunk-KJA6IGOZ.js → chunk-A3QQWXIE.js} +1 -1
- package/dist/{chunk-GYP6DLA4.js → chunk-AXB4ABUD.js} +8 -8
- package/dist/{chunk-I46QTKYI.js → chunk-BGJDOHNF.js} +5 -5
- package/dist/{chunk-FBV2KS3Z.js → chunk-BHRMHDOO.js} +2 -2
- package/dist/{chunk-RN5NRRHX.js → chunk-EJJNZYDS.js} +2 -2
- package/dist/{chunk-6HT2TUZD.js → chunk-EJMXZH5E.js} +2 -2
- package/dist/{chunk-N4DMADJM.js → chunk-FCXYDR62.js} +1 -1
- package/dist/{chunk-ZGYO6OQE.js → chunk-FJKV64M7.js} +5 -5
- package/dist/{chunk-QFNY4KUQ.js → chunk-FLC4TVXH.js} +1 -1
- package/dist/{chunk-NHBPW6C4.js → chunk-G446AVR5.js} +2 -2
- package/dist/{chunk-AQ3TSQA2.js → chunk-GC5HJE3T.js} +21 -8
- package/dist/{chunk-CJTQNUUT.js → chunk-HEJMZVJI.js} +2 -2
- package/dist/{chunk-OH647UT3.js → chunk-KGSN2SOL.js} +793 -18
- package/dist/{chunk-7RGEJOQS.js → chunk-KM7AEGKF.js} +3 -3
- package/dist/{chunk-FIYCICHC.js → chunk-KP4BIZLP.js} +2 -2
- package/dist/{chunk-YXHVMZPR.js → chunk-KZLOVLA6.js} +4 -4
- package/dist/{chunk-AXSHPFU3.js → chunk-LDNKGG5G.js} +3 -3
- package/dist/{chunk-DKBPNHAI.js → chunk-N3ACK3YA.js} +4 -4
- package/dist/{chunk-4GKQDFH6.js → chunk-NFH2H7PD.js} +5 -5
- package/dist/{chunk-BY5EKA6W.js → chunk-OFHSTCXK.js} +3 -3
- package/dist/{chunk-LEQRIJ4H.js → chunk-OOKIWOMK.js} +3 -3
- package/dist/{chunk-7J2AX5T6.js → chunk-OWOSNGEQ.js} +2 -2
- package/dist/{chunk-SSWK2WYX.js → chunk-PAMW5M53.js} +5 -5
- package/dist/{chunk-JNKHCGHR.js → chunk-PM2WJSUH.js} +1 -1
- package/dist/{chunk-JCEUDLGW.js → chunk-PPGLIWOR.js} +1 -1
- package/dist/{chunk-PFB7P4F3.js → chunk-PSNF27BC.js} +6 -6
- package/dist/{chunk-2AUKCSLQ.js → chunk-Q37XFSPO.js} +4 -4
- package/dist/{chunk-S2R2U5W5.js → chunk-RSENVGBQ.js} +4 -4
- package/dist/{chunk-M7DCI44L.js → chunk-SGGR5MN2.js} +1 -1
- package/dist/{chunk-NSCETODW.js → chunk-TLUSUDRU.js} +1 -1
- package/dist/chunk-UJB6HHP4.js +166 -0
- package/dist/{chunk-YZPFJCFE.js → chunk-UK7OY3EJ.js} +1 -1
- package/dist/{chunk-ISAKLEKE.js → chunk-UUOC7A7M.js} +7 -7
- package/dist/{chunk-Z4UDB7EC.js → chunk-VEGS4NYF.js} +3 -3
- package/dist/{chunk-USUI4P63.js → chunk-VFF7ZBIS.js} +2 -2
- package/dist/{chunk-RHIKMNWJ.js → chunk-VN5Q4KOD.js} +2 -2
- package/dist/{chunk-6GHZAS7S.js → chunk-WEKXYS2F.js} +4 -4
- package/dist/{chunk-SLBO7PHS.js → chunk-WKEP4JAW.js} +2 -2
- package/dist/{chunk-M6R3SZZS.js → chunk-YD3DIFIU.js} +1 -1
- package/dist/{chunk-EDN4F6GX.js → chunk-ZLGCNHJG.js} +1 -1
- package/dist/{chunk-A5U62Q6K.js → chunk-ZLY7BHN4.js} +5 -5
- package/dist/{chunk-AFP3HZVK.js → chunk-ZNT4ZZXJ.js} +1 -1
- package/dist/{chunk-XBETSM5T.js → chunk-ZV3262AA.js} +3 -3
- package/dist/{global-upgrade-SKY7A3SI.js → global-upgrade-4M4TJKQR.js} +6 -6
- package/dist/{paths-XUUEK7OU.js → paths-6JY6J56N.js} +2 -2
- package/dist/{reapply-WQDP26EA.js → reapply-LFEQ5GF6.js} +20 -20
- package/dist/src/index.js +19 -19
- package/dist/{upgrade-lock-AYW3TB7X.js → upgrade-lock-CZRCHYVU.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-OYIN77HO.js +0 -72
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
NOTIFICATION_MATCHED_TYPES,
|
|
7
7
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-A3QQWXIE.js";
|
|
9
9
|
import {
|
|
10
10
|
isProtectedByScope,
|
|
11
11
|
registerHookEntry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-2VQZC6DW.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
15
15
|
HOOK_BUDGETS,
|
|
16
16
|
HOOK_LOCATOR_BINARY
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KGSN2SOL.js";
|
|
18
18
|
|
|
19
19
|
// src/gemini-config.ts
|
|
20
20
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-KZERVKTD.js";
|
|
4
4
|
import {
|
|
5
5
|
renderCommandHelp
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OOKIWOMK.js";
|
|
7
7
|
import {
|
|
8
8
|
getPackageVersion
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KGSN2SOL.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/usage.ts
|
|
12
12
|
var exitOnHelpFlag = (command) => {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_BRIDGE_BINARY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EJJNZYDS.js";
|
|
4
4
|
import {
|
|
5
5
|
KEY_FILE_MODE
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GC5HJE3T.js";
|
|
7
7
|
import {
|
|
8
8
|
NpmMissingError,
|
|
9
9
|
NpmPermissionError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2VQZC6DW.js";
|
|
11
11
|
import {
|
|
12
12
|
readJsonSafe,
|
|
13
13
|
writeFileAtomic,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
} from "./chunk-AQFEP65J.js";
|
|
16
16
|
import {
|
|
17
17
|
NPX_LATEST_COMMAND
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-OOKIWOMK.js";
|
|
19
19
|
|
|
20
20
|
// src/instruction-file.ts
|
|
21
21
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, rmSync } from "fs";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openCodeConfigDirFrom
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FJKV64M7.js";
|
|
4
4
|
import {
|
|
5
5
|
codexHomeFrom,
|
|
6
6
|
resolvePathBinary
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2VQZC6DW.js";
|
|
8
8
|
import {
|
|
9
9
|
HOOK_COMPATIBLE_PROFILES
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-KGSN2SOL.js";
|
|
11
11
|
|
|
12
12
|
// src/hermes-config.ts
|
|
13
13
|
import { execFileSync } from "child_process";
|
|
@@ -14,19 +14,19 @@ import {
|
|
|
14
14
|
} from "./chunk-FO3MDD26.js";
|
|
15
15
|
import {
|
|
16
16
|
callMcpTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7V6PJFDF.js";
|
|
18
18
|
import {
|
|
19
19
|
reportedInstallSource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-EJMXZH5E.js";
|
|
21
21
|
import {
|
|
22
22
|
NPX_LATEST_COMMAND
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-OOKIWOMK.js";
|
|
24
24
|
import {
|
|
25
25
|
NO_PAIRING_COMPUTER,
|
|
26
26
|
PAIR_TTL_SECONDS,
|
|
27
27
|
classifyConfirmResponse,
|
|
28
28
|
isAnswerSource
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-KGSN2SOL.js";
|
|
30
30
|
|
|
31
31
|
// src/reach.ts
|
|
32
32
|
var reachVerdict = (channels) => {
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
SubscriptionRequiredError,
|
|
7
7
|
callMcpTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-7V6PJFDF.js";
|
|
9
9
|
import {
|
|
10
10
|
installNetworkDefaults,
|
|
11
11
|
isNetworkFailure
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZV3262AA.js";
|
|
13
13
|
import {
|
|
14
14
|
clientReportClaims
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-2VQZC6DW.js";
|
|
16
16
|
import {
|
|
17
17
|
getApiKey,
|
|
18
18
|
getBaseUrl
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-5Q2QJ2AL.js";
|
|
20
20
|
import {
|
|
21
21
|
ASK_AGENT_NAME_MAX,
|
|
22
22
|
ASK_QUESTION_MAX,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
GATE_PERMISSION_MODE_MAX_LENGTH,
|
|
26
26
|
degradedLine,
|
|
27
27
|
truncateLine
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-KGSN2SOL.js";
|
|
29
29
|
|
|
30
30
|
// src/client-report-claim.ts
|
|
31
31
|
import { createHash } from "crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETUP_FLAGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4KZP4YMV.js";
|
|
4
4
|
import {
|
|
5
5
|
parseFlags
|
|
6
6
|
} from "./chunk-GMXKITVA.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-7QLSKOSU.js";
|
|
10
10
|
import {
|
|
11
11
|
NPX_LATEST_COMMAND
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-OOKIWOMK.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_CONNECTOR_GUIDE,
|
|
15
15
|
CLAUDE_CONNECTOR_STEPS,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
CLAUDE_CONNECTOR_URL,
|
|
18
18
|
COWORK_CONNECTOR_LIMIT,
|
|
19
19
|
COWORK_STANDING_INSTRUCTIONS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KGSN2SOL.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/cowork.ts
|
|
23
23
|
import { readFileSync } from "fs";
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DISCONNECT_AGENT_IDS,
|
|
3
3
|
SETUP_AGENT_CHOICES,
|
|
4
4
|
isApprovalMode
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-KGSN2SOL.js";
|
|
6
6
|
|
|
7
7
|
// src/cli/mode-request.ts
|
|
8
8
|
var parseDuration = (value) => {
|
|
@@ -142,7 +142,7 @@ var COMMAND_OPTIONS = {
|
|
|
142
142
|
],
|
|
143
143
|
clean: [
|
|
144
144
|
["--dry-run", "List everything it would remove and change nothing"],
|
|
145
|
-
["--everything", "Also revoke the
|
|
145
|
+
["--everything", "Also revoke the key this CLI created (any other key is only removed) and remove what the Mac app set up: quits it, then its keychain items, local state and editor extension"],
|
|
146
146
|
["--yes", "Remove everything without asking"]
|
|
147
147
|
],
|
|
148
148
|
transcripts: [
|
|
@@ -165,7 +165,7 @@ var COMMAND_OPTIONS = {
|
|
|
165
165
|
["--devices", "Also list the machines registered to this site"]
|
|
166
166
|
],
|
|
167
167
|
"sign-out": [
|
|
168
|
-
["--revoke", "Also
|
|
168
|
+
["--revoke", "Also revoke the key server-side if this CLI created it; any other key is only removed"],
|
|
169
169
|
["--json", "Emit the result as one object instead of the screen"]
|
|
170
170
|
],
|
|
171
171
|
doctor: [
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
resolvePackageVersionFromBinary,
|
|
11
11
|
resolvePathBinary,
|
|
12
12
|
resolvePathBinaryAsync
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2VQZC6DW.js";
|
|
14
14
|
import {
|
|
15
15
|
MANAGED_PROVIDERS
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KGSN2SOL.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/codex-install.ts
|
|
19
19
|
var NATIVE_BINARY_MIN_BYTES = 20 * 1024 * 1024;
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
readControlMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-GC5HJE3T.js";
|
|
8
8
|
import {
|
|
9
9
|
getMachineId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-ZLGCNHJG.js";
|
|
11
11
|
import {
|
|
12
12
|
pusharyDir,
|
|
13
13
|
resolveGlobalBinary
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-2VQZC6DW.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
} from "./chunk-AQFEP65J.js";
|
|
21
21
|
import {
|
|
22
22
|
getApiKey
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5Q2QJ2AL.js";
|
|
24
24
|
import {
|
|
25
25
|
CLI_PACKAGE_NAMES,
|
|
26
26
|
cmdShimTarget,
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
globalPackageFolder,
|
|
29
29
|
globalRootFor,
|
|
30
30
|
isRecord
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-KGSN2SOL.js";
|
|
32
32
|
|
|
33
33
|
// src/daemon-lifecycle.ts
|
|
34
34
|
import { dirname, join, win32 as win32Path } from "path";
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-OWOSNGEQ.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-PAMW5M53.js";
|
|
14
14
|
import {
|
|
15
15
|
readControlMode,
|
|
16
16
|
readKeySource
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-GC5HJE3T.js";
|
|
18
18
|
import {
|
|
19
19
|
getMachineId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ZLGCNHJG.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5Q2QJ2AL.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-KGSN2SOL.js";
|
|
27
27
|
|
|
28
28
|
// src/machines.ts
|
|
29
29
|
import { hostname } from "os";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile,
|
|
3
3
|
hasCompatibleHooks
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5WTEKIAS.js";
|
|
5
5
|
import {
|
|
6
6
|
pusharyHookExecutable
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZLY7BHN4.js";
|
|
8
8
|
import {
|
|
9
9
|
isProtectedByScope,
|
|
10
10
|
registerHookEntry
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2VQZC6DW.js";
|
|
12
12
|
import {
|
|
13
13
|
isRecord
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KGSN2SOL.js";
|
|
15
15
|
|
|
16
16
|
// src/cursor-config.ts
|
|
17
17
|
var hookCommandOf = (entry) => {
|
|
@@ -2,25 +2,25 @@ import {
|
|
|
2
2
|
SIGNED_OUT_ON_MAC_MESSAGE,
|
|
3
3
|
describeSignedOutKey,
|
|
4
4
|
readSignedOutDiagnosis
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-WKEP4JAW.js";
|
|
6
6
|
import {
|
|
7
7
|
createIo
|
|
8
8
|
} from "./chunk-FO3MDD26.js";
|
|
9
9
|
import {
|
|
10
10
|
readKeySource
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-GC5HJE3T.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl,
|
|
14
14
|
checkApiKey,
|
|
15
15
|
describeKeyCheck,
|
|
16
16
|
keyCheckFromResponse
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VEGS4NYF.js";
|
|
18
18
|
import {
|
|
19
19
|
EXIT
|
|
20
20
|
} from "./chunk-KZERVKTD.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-5Q2QJ2AL.js";
|
|
24
24
|
|
|
25
25
|
// src/cli/report-key.ts
|
|
26
26
|
var { dim, yellow } = createIo();
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {
|
|
2
|
+
APPROVAL_SETTINGS_PATH
|
|
3
|
+
} from "./chunk-RSENVGBQ.js";
|
|
4
|
+
import {
|
|
5
|
+
readMacAppAgentKey
|
|
6
|
+
} from "./chunk-WEKXYS2F.js";
|
|
7
|
+
import {
|
|
8
|
+
findExportedKeyLines,
|
|
9
|
+
isAdoptedMacAppKey,
|
|
10
|
+
isCliCreatedKey,
|
|
11
|
+
keyPrefix,
|
|
12
|
+
readCliCreatedKeyPrefix,
|
|
13
|
+
readConfigFileKey,
|
|
14
|
+
readKeySource,
|
|
15
|
+
readMacAppKeyPrefix
|
|
16
|
+
} from "./chunk-GC5HJE3T.js";
|
|
17
|
+
import {
|
|
18
|
+
absoluteUrl
|
|
19
|
+
} from "./chunk-VEGS4NYF.js";
|
|
20
|
+
import {
|
|
21
|
+
isValidApiKey
|
|
22
|
+
} from "./chunk-KGSN2SOL.js";
|
|
23
|
+
|
|
24
|
+
// src/key-revocation.ts
|
|
25
|
+
var SELF_REVOKE_PATH = "/api/v1/server/keys/self/revoke";
|
|
26
|
+
var DEVICE_KEY_PATH = "/api/agent/device-key";
|
|
27
|
+
var FULL_ACCESS_ONLY_STATUS = 403;
|
|
28
|
+
var REVOKE_TIMEOUT_MS = 1e4;
|
|
29
|
+
var readRevokedCount = async (response) => {
|
|
30
|
+
try {
|
|
31
|
+
const body = await response.json();
|
|
32
|
+
const revoked = typeof body === "object" && body !== null && "revoked" in body ? body.revoked : void 0;
|
|
33
|
+
return typeof revoked === "number" && Number.isInteger(revoked) && revoked >= 0 ? revoked : null;
|
|
34
|
+
} catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var revokeAgentKey = async (apiKey, baseUrl, fetchImpl) => {
|
|
39
|
+
const response = await fetchImpl(`${baseUrl}${DEVICE_KEY_PATH}`, {
|
|
40
|
+
method: "DELETE",
|
|
41
|
+
headers: { Authorization: `Bearer ${apiKey}` },
|
|
42
|
+
signal: AbortSignal.timeout(REVOKE_TIMEOUT_MS)
|
|
43
|
+
});
|
|
44
|
+
if (!response.ok) return { kind: "refused", status: response.status };
|
|
45
|
+
const revoked = await readRevokedCount(response);
|
|
46
|
+
if (revoked === null) return { kind: "unconfirmed", status: response.status };
|
|
47
|
+
return revoked > 0 ? { kind: "revoked" } : { kind: "not_accepted" };
|
|
48
|
+
};
|
|
49
|
+
var revokeOwnKey = async (apiKey, baseUrl, fetchImpl = fetch) => {
|
|
50
|
+
try {
|
|
51
|
+
const response = await fetchImpl(`${baseUrl}${SELF_REVOKE_PATH}`, {
|
|
52
|
+
method: "POST",
|
|
53
|
+
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
|
|
54
|
+
signal: AbortSignal.timeout(REVOKE_TIMEOUT_MS)
|
|
55
|
+
});
|
|
56
|
+
if (response.status === 401) return { kind: "not_accepted" };
|
|
57
|
+
if (response.status === FULL_ACCESS_ONLY_STATUS) return await revokeAgentKey(apiKey, baseUrl, fetchImpl);
|
|
58
|
+
if (!response.ok) return { kind: "refused", status: response.status };
|
|
59
|
+
return { kind: "revoked" };
|
|
60
|
+
} catch (err) {
|
|
61
|
+
return { kind: "unreachable", detail: err instanceof Error ? err.message : "network error" };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var REVOKE_DETAIL = {
|
|
65
|
+
revoked: "Revoked the key on pushary.com.",
|
|
66
|
+
not_accepted: "pushary.com had already stopped accepting the key.",
|
|
67
|
+
refused: "pushary.com refused to revoke the key",
|
|
68
|
+
unconfirmed: "pushary.com did not confirm the key was revoked",
|
|
69
|
+
unreachable: "Could not reach pushary.com to revoke the key"
|
|
70
|
+
};
|
|
71
|
+
var describeRevokeAttempt = (attempt) => {
|
|
72
|
+
if (attempt.kind === "refused" || attempt.kind === "unconfirmed") return `${REVOKE_DETAIL[attempt.kind]} (HTTP ${attempt.status}).`;
|
|
73
|
+
if (attempt.kind === "unreachable") return `${REVOKE_DETAIL.unreachable}: ${attempt.detail}`;
|
|
74
|
+
return REVOKE_DETAIL[attempt.kind];
|
|
75
|
+
};
|
|
76
|
+
var keyNoLongerAccepted = (attempt) => attempt.kind === "revoked" || attempt.kind === "not_accepted";
|
|
77
|
+
var keyValidityOf = (check) => {
|
|
78
|
+
switch (check.kind) {
|
|
79
|
+
case "ok":
|
|
80
|
+
case "locked":
|
|
81
|
+
return "valid";
|
|
82
|
+
case "rejected":
|
|
83
|
+
case "malformed":
|
|
84
|
+
return "invalid";
|
|
85
|
+
case "unreachable":
|
|
86
|
+
return "unknown";
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
// src/cli/held-key-revocation.ts
|
|
91
|
+
var readCliHeldKeys = (profiles) => {
|
|
92
|
+
const source = readKeySource();
|
|
93
|
+
return {
|
|
94
|
+
configKey: readConfigFileKey(),
|
|
95
|
+
profileKeys: findExportedKeyLines(profiles).map((line) => line.key),
|
|
96
|
+
envKey: source.kind === "env" ? source.key : null,
|
|
97
|
+
macAppKey: readMacAppAgentKey(),
|
|
98
|
+
macAppKeyPrefix: readMacAppKeyPrefix(),
|
|
99
|
+
cliCreatedKeyPrefix: readCliCreatedKeyPrefix()
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
var isMacAppCurrentOrAdoptedKey = (key, keys) => key === keys.macAppKey || isAdoptedMacAppKey(key, keys.macAppKeyPrefix);
|
|
103
|
+
var revocationOfStoredKey = (key, keys) => {
|
|
104
|
+
if (isMacAppCurrentOrAdoptedKey(key, keys)) return { kind: "mac_app_key", keyPrefix: keyPrefix(key) };
|
|
105
|
+
if (!isCliCreatedKey(key, keys.cliCreatedKeyPrefix)) return { kind: "no_creation_record", keyPrefix: keyPrefix(key) };
|
|
106
|
+
return { kind: "revoke", key };
|
|
107
|
+
};
|
|
108
|
+
var validKeys = (keys) => [...new Set(keys)].filter((key) => key !== null && isValidApiKey(key));
|
|
109
|
+
var environmentOnlyKey = (keys, stored) => validKeys([keys.envKey]).filter((key) => !stored.includes(key)).map((key) => ({ kind: "environment_only", keyPrefix: keyPrefix(key) }));
|
|
110
|
+
var planCliKeyRevocations = (keys) => {
|
|
111
|
+
const stored = validKeys([keys.configKey, ...keys.profileKeys]);
|
|
112
|
+
return [...stored.map((key) => revocationOfStoredKey(key, keys)), ...environmentOnlyKey(keys, stored)];
|
|
113
|
+
};
|
|
114
|
+
var keysToRevoke = (revocations) => revocations.flatMap((revocation) => revocation.kind === "revoke" ? [revocation.key] : []);
|
|
115
|
+
var sparedKeys = (revocations) => revocations.flatMap((revocation) => revocation.kind === "revoke" ? [] : [revocation]);
|
|
116
|
+
var runRevocation = async (revocation, run) => {
|
|
117
|
+
if (revocation.kind !== "revoke") return revocation;
|
|
118
|
+
if (run.dryRun) return { kind: "would_revoke", keyPrefix: keyPrefix(revocation.key) };
|
|
119
|
+
return { kind: "attempted", keyPrefix: keyPrefix(revocation.key), attempt: await revokeOwnKey(revocation.key, run.baseUrl) };
|
|
120
|
+
};
|
|
121
|
+
var revokeCliKeys = async (revocations, run) => {
|
|
122
|
+
const outcomes = [];
|
|
123
|
+
for (const revocation of revocations) outcomes.push(await runRevocation(revocation, run));
|
|
124
|
+
return outcomes;
|
|
125
|
+
};
|
|
126
|
+
var SPARED_KEY_WHY = {
|
|
127
|
+
mac_app_key: "It is the Pushary Mac app's key, and the app may still be using it.",
|
|
128
|
+
no_creation_record: "This CLI has no record of creating it, so it may be in use by the Mac app or on another machine."
|
|
129
|
+
};
|
|
130
|
+
var localRemovalOf = (dryRun) => dryRun ? "would be removed here" : "removed here";
|
|
131
|
+
var settingsUrlOf = (baseUrl) => absoluteUrl(baseUrl, APPROVAL_SETTINGS_PATH);
|
|
132
|
+
var revokeYourselfHint = (reason, baseUrl) => reason === "no_creation_record" ? `Revoke it at ${settingsUrlOf(baseUrl)} if nothing else uses it.` : null;
|
|
133
|
+
var describeCliKeyRevocation = (outcome, run) => {
|
|
134
|
+
const label = `API key ${outcome.keyPrefix}`;
|
|
135
|
+
switch (outcome.kind) {
|
|
136
|
+
case "would_revoke":
|
|
137
|
+
return { tone: "skipped", line: `${label} (would revoke it on pushary.com)`, next: null };
|
|
138
|
+
case "mac_app_key":
|
|
139
|
+
case "no_creation_record":
|
|
140
|
+
return {
|
|
141
|
+
tone: "skipped",
|
|
142
|
+
line: `${label}: ${localRemovalOf(run.dryRun)}, not revoked. ${SPARED_KEY_WHY[outcome.kind]}`,
|
|
143
|
+
next: revokeYourselfHint(outcome.kind, run.baseUrl)
|
|
144
|
+
};
|
|
145
|
+
case "environment_only":
|
|
146
|
+
return { tone: "skipped", line: `${label} in PUSHARY_API_KEY (left alone: Pushary did not write it)`, next: null };
|
|
147
|
+
case "attempted":
|
|
148
|
+
return keyNoLongerAccepted(outcome.attempt) ? { tone: "done", line: `${label}: ${describeRevokeAttempt(outcome.attempt)}`, next: null } : {
|
|
149
|
+
tone: "warning",
|
|
150
|
+
line: `${label}: ${describeRevokeAttempt(outcome.attempt)}`,
|
|
151
|
+
next: `It may still be valid. Revoke it at ${settingsUrlOf(run.baseUrl)}`
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export {
|
|
157
|
+
revokeOwnKey,
|
|
158
|
+
keyNoLongerAccepted,
|
|
159
|
+
keyValidityOf,
|
|
160
|
+
readCliHeldKeys,
|
|
161
|
+
planCliKeyRevocations,
|
|
162
|
+
keysToRevoke,
|
|
163
|
+
sparedKeys,
|
|
164
|
+
revokeCliKeys,
|
|
165
|
+
describeCliKeyRevocation
|
|
166
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VN5Q4KOD.js";
|
|
4
4
|
import {
|
|
5
5
|
detectClaudeVersion
|
|
6
6
|
} from "./chunk-RIVNNBEK.js";
|
|
@@ -12,12 +12,12 @@ import {
|
|
|
12
12
|
openCodeHookArgv,
|
|
13
13
|
openCodePluginDir,
|
|
14
14
|
openCodeWired
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-FJKV64M7.js";
|
|
16
16
|
import {
|
|
17
17
|
addClaudeMcpServer,
|
|
18
18
|
addPusharyHooks,
|
|
19
19
|
addPusharyToolPermissions
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5WTEKIAS.js";
|
|
21
21
|
import {
|
|
22
22
|
claudeUnprovenHolds,
|
|
23
23
|
claudeWired,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
codexWired,
|
|
26
26
|
geminiWired,
|
|
27
27
|
planHooks
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-ZLY7BHN4.js";
|
|
29
29
|
import {
|
|
30
30
|
CLAUDE_HOOK_BINARY,
|
|
31
31
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -36,7 +36,7 @@ import {
|
|
|
36
36
|
needsReregistration,
|
|
37
37
|
registrationSignatures,
|
|
38
38
|
supportedClaudeEvents
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-KM7AEGKF.js";
|
|
40
40
|
import {
|
|
41
41
|
formatVersion
|
|
42
42
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
registrationHolderOf,
|
|
60
60
|
resolveGlobalBinary,
|
|
61
61
|
vscodePluginMcp
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-2VQZC6DW.js";
|
|
63
63
|
import {
|
|
64
64
|
readJsonSafe,
|
|
65
65
|
writeFileAtomic,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
} from "./chunk-AQFEP65J.js";
|
|
68
68
|
import {
|
|
69
69
|
isRecord
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-KGSN2SOL.js";
|
|
71
71
|
|
|
72
72
|
// src/reapply.ts
|
|
73
73
|
import { dirname, join } from "path";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZV3262AA.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-KZERVKTD.js";
|
|
10
10
|
import {
|
|
11
11
|
getBaseUrl
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5Q2QJ2AL.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-KGSN2SOL.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-POFBE6ZY.js";
|
|
4
4
|
import {
|
|
5
5
|
autoUpdateState
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2VQZC6DW.js";
|
|
7
7
|
import {
|
|
8
8
|
readJsonSafe,
|
|
9
9
|
writeJsonAtomic
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
cliPackagePathSegments,
|
|
15
15
|
globalUpgradeEntry,
|
|
16
16
|
ownPackageRoot
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KGSN2SOL.js";
|
|
18
18
|
|
|
19
19
|
// src/auto-update.ts
|
|
20
20
|
import { spawn } from "child_process";
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand,
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2VQZC6DW.js";
|
|
12
12
|
import {
|
|
13
13
|
getPackageVersion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-KGSN2SOL.js";
|
|
15
15
|
|
|
16
16
|
// src/codex-app-server.ts
|
|
17
17
|
import { existsSync, realpathSync } from "fs";
|