pushary 1.9.59 → 1.9.61
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 +13 -0
- package/README.md +6 -0
- package/data/cursor-plugin/.cursor-plugin/plugin.json +5 -1
- package/data/cursor-plugin/CHANGELOG.md +4 -0
- package/dist/{api-UVJGNZIF.js → api-LW3PJQYY.js} +12 -11
- package/dist/bin/pushary-bell-hook.js +30 -29
- package/dist/bin/pushary-bell.js +13 -12
- package/dist/bin/pushary-claude.js +32 -30
- package/dist/bin/pushary-clean.js +61 -54
- package/dist/bin/pushary-codex-bridge.js +23 -22
- package/dist/bin/pushary-codex-hook.js +35 -34
- package/dist/bin/pushary-codex-session.js +9 -8
- package/dist/bin/pushary-codex.js +16 -15
- package/dist/bin/pushary-connect.js +30 -29
- package/dist/bin/pushary-cowork.js +8 -7
- package/dist/bin/pushary-daemon.js +40 -39
- package/dist/bin/pushary-disconnect.js +43 -29
- package/dist/bin/pushary-doctor.js +52 -47
- package/dist/bin/pushary-elicitation-hook.js +30 -29
- package/dist/bin/pushary-gemini-bridge.js +16 -15
- package/dist/bin/pushary-gemini-hook.js +32 -31
- package/dist/bin/pushary-hook.js +34 -33
- package/dist/bin/pushary-login.js +23 -19
- package/dist/bin/pushary-logout.js +37 -31
- package/dist/bin/pushary-mcp.js +13 -12
- package/dist/bin/pushary-mode.js +42 -55
- package/dist/bin/pushary-notification-hook.js +29 -28
- package/dist/bin/pushary-opencode-hook.js +31 -30
- package/dist/bin/pushary-permission-denied-hook.js +34 -33
- package/dist/bin/pushary-permission-hook.js +33 -32
- package/dist/bin/pushary-post-hook.js +29 -28
- package/dist/bin/pushary-prompt-hook.js +29 -28
- package/dist/bin/pushary-session-end-hook.js +29 -28
- package/dist/bin/pushary-session-start-hook.js +36 -35
- package/dist/bin/pushary-setup.js +4397 -292
- package/dist/bin/pushary-stats.js +6 -5
- package/dist/bin/pushary-status.js +42 -36
- package/dist/bin/pushary-stop-hook.js +29 -28
- package/dist/bin/pushary-stopfailure-hook.js +29 -28
- package/dist/bin/pushary-suggestions.js +34 -39
- package/dist/bin/pushary-transcript-register.js +21 -20
- package/dist/bin/pushary-transcripts.js +34 -20
- package/dist/bin/pushary-upgrade.js +77 -50
- package/dist/bin/pushary-wait.js +37 -42
- package/dist/bin/pushary.js +9 -8
- package/dist/{chunk-PVANKDWM.js → chunk-2AELPDMT.js} +1 -1
- package/dist/{chunk-W47WL6JY.js → chunk-33OOEVPG.js} +1 -1
- package/dist/{chunk-BRUHVTFB.js → chunk-4N5E4JNF.js} +2 -2
- package/dist/{chunk-6ONSTCDJ.js → chunk-4VRTSDGP.js} +5 -5
- package/dist/{chunk-DS7X36Z3.js → chunk-64S5PQBQ.js} +4 -4
- package/dist/{chunk-KQHY6L3X.js → chunk-6FJ6CK32.js} +4 -4
- package/dist/{chunk-EBQTWH5O.js → chunk-6T5Z64KS.js} +39 -31
- package/dist/{chunk-JAKBCKEB.js → chunk-7BAO42UV.js} +8 -7
- package/dist/chunk-7BHI3PZN.js +41 -0
- package/dist/{chunk-5BNXJTOZ.js → chunk-7HDGH3Z2.js} +3 -12
- package/dist/{chunk-D6CXQIXO.js → chunk-7JXJJNQ5.js} +1 -1
- package/dist/{chunk-KHDD74MK.js → chunk-7MCCXE5Y.js} +5 -5
- package/dist/{chunk-AY32RSUC.js → chunk-ADR3KHOC.js} +2 -2
- package/dist/{chunk-MMLIQDTG.js → chunk-ATKN4BJT.js} +1 -1
- package/dist/{chunk-762CDAJJ.js → chunk-AXJLJJ3M.js} +7 -0
- package/dist/{chunk-4XXZUFWN.js → chunk-BG4Y64FW.js} +1 -1
- package/dist/{chunk-X4ES7QBT.js → chunk-BJTSKOH3.js} +9 -7
- package/dist/{chunk-TCH5UCPR.js → chunk-BQ2VV7LY.js} +2 -2
- package/dist/{chunk-IBXHVYN2.js → chunk-BUZIEL7Y.js} +2 -2
- package/dist/{chunk-UFJS4RR7.js → chunk-CICLXLQN.js} +3 -3
- package/dist/{chunk-US3IT6ZC.js → chunk-CJ5TCFD4.js} +11 -4
- package/dist/{chunk-5JWCWALO.js → chunk-DQLCFGHK.js} +12 -10
- package/dist/{chunk-V3PDUDPB.js → chunk-ELLJPP6O.js} +2 -2
- package/dist/{chunk-BMPZ5HVJ.js → chunk-ERK24P76.js} +11 -1
- package/dist/{chunk-2WMZDKPM.js → chunk-EUIPTDLX.js} +13 -13
- package/dist/{chunk-RQDP2SJY.js → chunk-FUZ5VYWD.js} +1 -1
- package/dist/{chunk-5PP4455M.js → chunk-G36T5LAP.js} +3 -3
- package/dist/{chunk-3N2ZTHZZ.js → chunk-GAMVAORR.js} +1 -1
- package/dist/{chunk-YQVKG5MC.js → chunk-GDKQUB52.js} +7 -6
- package/dist/{chunk-KQWN7C5C.js → chunk-GKFO5JLN.js} +4 -4
- package/dist/{chunk-MYU5D5VH.js → chunk-GZCSWDAS.js} +4 -4
- package/dist/{chunk-2FVP7WRP.js → chunk-HUI4OE43.js} +3 -3
- package/dist/{chunk-AS4Z6KS4.js → chunk-IFPOHFDJ.js} +1 -1
- package/dist/{chunk-L3NVHPBU.js → chunk-JGQV4MDQ.js} +6 -6
- package/dist/{chunk-UVZK5LIK.js → chunk-K4MBKXAE.js} +1 -1
- package/dist/{chunk-EHCIQA5D.js → chunk-KPNZ7JUL.js} +4 -4
- package/dist/{chunk-4QF2YLYK.js → chunk-LBHJJEKT.js} +6 -6
- package/dist/{chunk-5O6D4J2K.js → chunk-LN7DE5LY.js} +2 -2
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/{chunk-KZCYHWDF.js → chunk-MWLTTLPK.js} +107 -50
- package/dist/{chunk-WWAVHLGS.js → chunk-NKLNU577.js} +5 -5
- package/dist/{chunk-GMXKITVA.js → chunk-NMUI3ZWG.js} +1 -1
- package/dist/{chunk-SIU6OWA6.js → chunk-O65F2IIN.js} +6 -6
- package/dist/{chunk-T65RIQK2.js → chunk-ORX5BTV4.js} +6 -6
- package/dist/{chunk-VAJHDTJX.js → chunk-P3VQH65N.js} +28 -17
- package/dist/{chunk-CPRA7IEK.js → chunk-PITQ5ZIQ.js} +2 -2
- package/dist/chunk-PPY5N2E6.js +58 -0
- package/dist/{chunk-UTJ5465F.js → chunk-QER5R7Z6.js} +2 -2
- package/dist/{chunk-TDOKDCFH.js → chunk-RGSW36XH.js} +3 -3
- package/dist/{chunk-WW24SG27.js → chunk-RJHX66EY.js} +21 -11
- package/dist/{chunk-M46WDK64.js → chunk-SFAP4AJY.js} +1 -1
- package/dist/{chunk-MSU3VKGJ.js → chunk-SHJVFW22.js} +2 -2
- package/dist/{chunk-RAMQBSVZ.js → chunk-SVQWHV65.js} +1 -1
- package/dist/{chunk-3NROUNIS.js → chunk-UADSXJZ4.js} +2 -2
- package/dist/{chunk-M6MOQBR5.js → chunk-USE5IEEW.js} +1 -1
- package/dist/{chunk-KW3DED2A.js → chunk-VX2MJ4X7.js} +4 -4
- package/dist/{chunk-OZIXBN3O.js → chunk-WFSGCFXQ.js} +2 -2
- package/dist/{chunk-KAJDKYUM.js → chunk-WN3RACVD.js} +3 -3
- package/dist/chunk-X3YKQJCZ.js +36 -0
- package/dist/{chunk-5EFNBL6V.js → chunk-XAO6EYGM.js} +3 -3
- package/dist/{chunk-BKVX53QR.js → chunk-XEJOPVCG.js} +1 -1
- package/dist/{chunk-75UYYIFJ.js → chunk-XV6S5PWW.js} +3 -3
- package/dist/{chunk-3RKIJM26.js → chunk-Y5VKZNFN.js} +2 -2
- package/dist/{chunk-DK35M4TH.js → chunk-Y6Z7DA5Y.js} +5 -5
- package/dist/{chunk-MA37WNVS.js → chunk-YDR4BQ7R.js} +4 -4
- package/dist/{chunk-XGP5VSQG.js → chunk-YPD3MTFU.js} +1 -1
- package/dist/{chunk-LAEW5QQD.js → chunk-ZEWIMY63.js} +1 -1
- package/dist/{chunk-JBCMXSBO.js → chunk-ZGU3NXL2.js} +77 -18
- package/dist/{codex-app-cards-switch-N77RWKCO.js → codex-app-cards-switch-BD7LCI2I.js} +12 -11
- package/dist/{codex-desktop-launch-KIX7OMTL.js → codex-desktop-launch-V5CASSBB.js} +2 -1
- package/dist/{codex-session-launch-XV7SIIWP.js → codex-session-launch-5PKFKUFD.js} +20 -19
- package/dist/{config-HH4DYYNX.js → config-AEKH7HGC.js} +4 -3
- package/dist/{global-upgrade-YWIVJIUR.js → global-upgrade-IUXJJDWF.js} +10 -9
- package/dist/{identity-4J7Y2MW3.js → identity-YJIV2XTY.js} +5 -4
- package/dist/{live-capabilities-LHZBCI5U.js → live-capabilities-QYFW5QAW.js} +5 -4
- package/dist/{paths-ES3V7BWQ.js → paths-A5GAR5PL.js} +4 -3
- package/dist/reapply-BKJGICRJ.js +63 -0
- package/dist/src/index.js +23 -22
- package/dist/{upgrade-lock-TJPKU5HL.js → upgrade-lock-DDB7WEWC.js} +5 -4
- package/dist/usage-HBDNFZ3O.js +11 -0
- package/package.json +1 -1
- package/dist/chunk-7QLSKOSU.js +0 -19
- package/dist/chunk-EO23EUOK.js +0 -14
- package/dist/reapply-KA5SIYWX.js +0 -62
- package/dist/usage-7ALXBJVJ.js +0 -10
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETUP_FLAGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XV6S5PWW.js";
|
|
4
4
|
import {
|
|
5
5
|
parseFlags
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NMUI3ZWG.js";
|
|
7
7
|
import {
|
|
8
8
|
UsageError
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PPY5N2E6.js";
|
|
10
10
|
import {
|
|
11
11
|
NPX_LATEST_COMMAND
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ERK24P76.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-AXJLJJ3M.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/cowork.ts
|
|
23
23
|
import { readFileSync } from "fs";
|
|
@@ -4,30 +4,30 @@ import {
|
|
|
4
4
|
postLiveSession,
|
|
5
5
|
postLiveSessionUntilAccepted,
|
|
6
6
|
startLiveSessionHeartbeat
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ELLJPP6O.js";
|
|
8
8
|
import {
|
|
9
9
|
SESSION_IDLE_TIMEOUT_MS,
|
|
10
10
|
describeIdleWindow,
|
|
11
11
|
idleDeadlinePassed,
|
|
12
12
|
startProcessOwnership
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-SHJVFW22.js";
|
|
14
14
|
import {
|
|
15
15
|
spawnClaude
|
|
16
16
|
} from "./chunk-XHKBHWLX.js";
|
|
17
17
|
import {
|
|
18
18
|
repoKeyFor
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-YPD3MTFU.js";
|
|
20
20
|
import {
|
|
21
21
|
isAskUserResponse,
|
|
22
22
|
isDecisionStopped,
|
|
23
23
|
isWaitForAnswerResponse,
|
|
24
24
|
withdrawQuestion,
|
|
25
25
|
writeDegraded
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RJHX66EY.js";
|
|
27
27
|
import {
|
|
28
28
|
callMcpTool,
|
|
29
29
|
isRetryable
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-XAO6EYGM.js";
|
|
31
31
|
import {
|
|
32
32
|
AGENT_QUESTION_DESCRIPTION_MAX,
|
|
33
33
|
AGENT_QUESTION_HEADER_MAX,
|
|
@@ -48,7 +48,7 @@ import {
|
|
|
48
48
|
parseCodexQuestions,
|
|
49
49
|
planElicitationAsk,
|
|
50
50
|
readElicitationFields
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
52
52
|
|
|
53
53
|
// src/codex-question-owner.ts
|
|
54
54
|
import { createHash } from "crypto";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
announceSubscriptionRequired,
|
|
3
3
|
isDeferAnswer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZEWIMY63.js";
|
|
5
5
|
import {
|
|
6
6
|
AUTO_DECISION_WINDOW_MS,
|
|
7
7
|
DEFAULT_SESSION,
|
|
@@ -10,18 +10,18 @@ import {
|
|
|
10
10
|
permissionDeniedAction,
|
|
11
11
|
releaseThrottle,
|
|
12
12
|
reportEvent
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-DQLCFGHK.js";
|
|
14
14
|
import {
|
|
15
15
|
askUser,
|
|
16
16
|
isDecisionStopped,
|
|
17
17
|
waitForQuestion
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RJHX66EY.js";
|
|
19
19
|
import {
|
|
20
20
|
SubscriptionRequiredError
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-XAO6EYGM.js";
|
|
22
22
|
import {
|
|
23
23
|
getMachineId
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-SFAP4AJY.js";
|
|
25
25
|
import {
|
|
26
26
|
ASK_CONTEXT_MAX,
|
|
27
27
|
agentQuestionContext,
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
questionsShownAsASet,
|
|
34
34
|
shouldDeferToNativeMode,
|
|
35
35
|
wireVerdictFor
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
37
37
|
|
|
38
38
|
// src/machine-decision-audit.ts
|
|
39
39
|
import { basename } from "path";
|
|
@@ -4,19 +4,19 @@ import {
|
|
|
4
4
|
outcomeOfFailedAsk,
|
|
5
5
|
reportMachineDenial,
|
|
6
6
|
storedWaitDeadline
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ORX5BTV4.js";
|
|
8
8
|
import {
|
|
9
9
|
isGatingMoment,
|
|
10
10
|
recordKeylessMoment
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-SVQWHV65.js";
|
|
12
12
|
import {
|
|
13
13
|
isDeferAnswer,
|
|
14
14
|
oncePerSession
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ZEWIMY63.js";
|
|
16
16
|
import {
|
|
17
17
|
activeHookSource,
|
|
18
18
|
activeIdentity
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-GKFO5JLN.js";
|
|
20
20
|
import {
|
|
21
21
|
DEFAULT_SESSION,
|
|
22
22
|
UNNAMED_ACTION,
|
|
@@ -40,33 +40,38 @@ import {
|
|
|
40
40
|
reportEvent,
|
|
41
41
|
scopePathFor,
|
|
42
42
|
settleQuestionsForToolUse
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-DQLCFGHK.js";
|
|
44
44
|
import {
|
|
45
45
|
repoKeyFor
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-YPD3MTFU.js";
|
|
47
47
|
import {
|
|
48
48
|
askUser,
|
|
49
49
|
cancelQuestion,
|
|
50
50
|
claimBlockedAction,
|
|
51
|
+
clientErrorKindOf,
|
|
51
52
|
isAwayPaused,
|
|
52
53
|
isDecisionStopped,
|
|
53
54
|
isLocalQuestionHandoff,
|
|
54
55
|
pollForAnswer,
|
|
56
|
+
reportClientError,
|
|
55
57
|
requestGate,
|
|
56
58
|
sendNotification,
|
|
57
59
|
waitForQuestion,
|
|
58
60
|
waitsForThePhone
|
|
59
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-RJHX66EY.js";
|
|
60
62
|
import {
|
|
61
63
|
getMachineId
|
|
62
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-SFAP4AJY.js";
|
|
65
|
+
import {
|
|
66
|
+
claudeConfigDir
|
|
67
|
+
} from "./chunk-MWLTTLPK.js";
|
|
63
68
|
import {
|
|
64
69
|
getApiKey,
|
|
65
70
|
getBaseUrl
|
|
66
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-BG4Y64FW.js";
|
|
67
72
|
import {
|
|
68
73
|
NPX_LATEST_COMMAND
|
|
69
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-ERK24P76.js";
|
|
70
75
|
import {
|
|
71
76
|
AGENT_QUESTION_STRATEGY,
|
|
72
77
|
AGENT_QUESTION_TOOL,
|
|
@@ -111,7 +116,7 @@ import {
|
|
|
111
116
|
resolveGate,
|
|
112
117
|
timeoutActionWithoutLocalPrompt,
|
|
113
118
|
unansweredRefusalReason
|
|
114
|
-
} from "./chunk-
|
|
119
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
115
120
|
|
|
116
121
|
// src/claude-permission-rules.ts
|
|
117
122
|
import { readFileSync, statSync } from "fs";
|
|
@@ -124,7 +129,7 @@ var MANAGED_CLAUDE_SETTINGS_BY_PLATFORM = {
|
|
|
124
129
|
};
|
|
125
130
|
var MAX_CLAUDE_SETTINGS_BYTES = 1048576;
|
|
126
131
|
var claudeSettingsLocationFor = (cwd, environment = process.env, home = homedir(), platform = process.platform) => ({
|
|
127
|
-
configDir:
|
|
132
|
+
configDir: claudeConfigDir(home, environment),
|
|
128
133
|
projectDir: environment.CLAUDE_PROJECT_DIR || cwd || void 0,
|
|
129
134
|
managedSettingsPath: MANAGED_CLAUDE_SETTINGS_BY_PLATFORM[platform]
|
|
130
135
|
});
|
|
@@ -528,6 +533,10 @@ var remindedOfApprovedRetry = (input) => {
|
|
|
528
533
|
markApprovalReminded(approval);
|
|
529
534
|
return true;
|
|
530
535
|
};
|
|
536
|
+
var reportHookFailure = async (code, error) => {
|
|
537
|
+
console.error(`[Pushary] ${code}: could not complete the approval check; keeping the agent's existing fallback.`);
|
|
538
|
+
await reportClientError({ kind: clientErrorKindOf(error), code });
|
|
539
|
+
};
|
|
531
540
|
var handlePreToolUse = async (input, canonical) => {
|
|
532
541
|
if (isPusharyOwnTool(input.tool_name)) return void 0;
|
|
533
542
|
let apiKey;
|
|
@@ -554,10 +563,10 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
554
563
|
if (verdict.kind === "gate" && verdict.scopeReason && (canonical?.toolInputs.length ?? 0) > 1) return deny(SCOPE_BATCH_REASON);
|
|
555
564
|
if (agentQuestionStrategy(ACTIVE_SOURCE, "PreToolUse", input.tool_name) === AGENT_QUESTION_STRATEGY.native) return void 0;
|
|
556
565
|
if (input.tool_name === "AskUserQuestion") {
|
|
557
|
-
return handleAskUserQuestion(apiKey, input, modeState);
|
|
566
|
+
return await handleAskUserQuestion(apiKey, input, modeState);
|
|
558
567
|
}
|
|
559
568
|
if (input.tool_name === "ExitPlanMode") {
|
|
560
|
-
return handleExitPlanMode(apiKey, input);
|
|
569
|
+
return await handleExitPlanMode(apiKey, input);
|
|
561
570
|
}
|
|
562
571
|
if (await claimedBlockedActionRetry(apiKey, input)) return allow(BLOCKED_ACTION_ALLOW_REASON);
|
|
563
572
|
if (remindedOfApprovedRetry(input)) return deny(BLOCKED_ACTION_CHANGED_RETRY_REASON);
|
|
@@ -577,9 +586,10 @@ var handlePreToolUse = async (input, canonical) => {
|
|
|
577
586
|
case "defer":
|
|
578
587
|
return undecidedCall(SOLE_GATE_UNDECIDED_REASON);
|
|
579
588
|
default:
|
|
580
|
-
return dispatchModeHandler(apiKey, input, verdict.policy, getMachineId(), modeState.trainingConsent, verdict.scopeReason, verdict.scopePath);
|
|
589
|
+
return await dispatchModeHandler(apiKey, input, verdict.policy, getMachineId(), modeState.trainingConsent, verdict.scopeReason, verdict.scopePath);
|
|
581
590
|
}
|
|
582
|
-
} catch {
|
|
591
|
+
} catch (error) {
|
|
592
|
+
await reportHookFailure("pre_tool_use_failed", error);
|
|
583
593
|
return undecidedCall(SOLE_GATE_UNDECIDED_REASON);
|
|
584
594
|
}
|
|
585
595
|
};
|
|
@@ -631,7 +641,8 @@ var handlePermissionRequest = async (input, canonical) => {
|
|
|
631
641
|
await dispatchModeHandler(apiKey, input, verdict.policy, getMachineId(), modeState.trainingConsent, verdict.scopeReason, verdict.scopePath)
|
|
632
642
|
);
|
|
633
643
|
}
|
|
634
|
-
} catch {
|
|
644
|
+
} catch (error) {
|
|
645
|
+
await reportHookFailure("permission_request_failed", error);
|
|
635
646
|
return void 0;
|
|
636
647
|
}
|
|
637
648
|
};
|
|
@@ -294,7 +294,7 @@ var loadedOnce = (load) => {
|
|
|
294
294
|
};
|
|
295
295
|
|
|
296
296
|
// src/codex-desktop-proxy.ts
|
|
297
|
-
var loadThePhone = () => import("./api-
|
|
297
|
+
var loadThePhone = () => import("./api-LW3PJQYY.js");
|
|
298
298
|
var theFirstCardLoadsAgain = () => {
|
|
299
299
|
};
|
|
300
300
|
var APP_SERVER_COMMAND = "app-server";
|
|
@@ -827,7 +827,7 @@ var codexDesktopCommand = async (args, entry, readAccount) => {
|
|
|
827
827
|
return runCodexDesktopProxy(engine2, args.slice(3), readAccount, { watchesForCards: layoutIsKnown });
|
|
828
828
|
}
|
|
829
829
|
if (args[0] === APP_CARDS_FLAG) {
|
|
830
|
-
const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-
|
|
830
|
+
const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-BD7LCI2I.js");
|
|
831
831
|
return codexAppCardsCommandOnThisMac(args.slice(1), entry, readAccount);
|
|
832
832
|
}
|
|
833
833
|
if (args.length > 2) throw new Error("Usage: pushary codex --desktop [path/to/Codex.app]");
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EXIT
|
|
3
|
+
} from "./chunk-KZERVKTD.js";
|
|
4
|
+
|
|
5
|
+
// src/cli/errors.ts
|
|
6
|
+
var UsageError = class extends Error {
|
|
7
|
+
constructor(hint) {
|
|
8
|
+
super(hint);
|
|
9
|
+
this.hint = hint;
|
|
10
|
+
this.name = "UsageError";
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
var UserError = class extends Error {
|
|
14
|
+
constructor(message, next = [], code = EXIT.FAILED) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.next = next;
|
|
17
|
+
this.code = code;
|
|
18
|
+
this.name = "UserError";
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var NetworkError = class extends Error {
|
|
22
|
+
constructor(message) {
|
|
23
|
+
super(message);
|
|
24
|
+
this.name = "NetworkError";
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var AuthError = class extends Error {
|
|
28
|
+
constructor(message) {
|
|
29
|
+
super(message);
|
|
30
|
+
this.name = "AuthError";
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var InputRequiredError = class extends Error {
|
|
34
|
+
constructor(message, flag) {
|
|
35
|
+
super(message);
|
|
36
|
+
this.flag = flag;
|
|
37
|
+
this.name = "InputRequiredError";
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var exitCodeFor = (err) => {
|
|
41
|
+
if (err instanceof UsageError) return EXIT.USAGE;
|
|
42
|
+
if (err instanceof InputRequiredError) return EXIT.INPUT_REQUIRED;
|
|
43
|
+
if (err instanceof AuthError) return EXIT.UNAUTHENTICATED;
|
|
44
|
+
if (err instanceof NetworkError) return EXIT.UNREACHABLE;
|
|
45
|
+
if (err instanceof UserError) return err.code;
|
|
46
|
+
return EXIT.FAILED;
|
|
47
|
+
};
|
|
48
|
+
var messageFor = (err) => {
|
|
49
|
+
if (err instanceof Error) return err.message;
|
|
50
|
+
return String(err);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export {
|
|
54
|
+
UsageError,
|
|
55
|
+
NetworkError,
|
|
56
|
+
exitCodeFor,
|
|
57
|
+
messageFor
|
|
58
|
+
};
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
NOTIFICATION_MATCHED_TYPES,
|
|
7
7
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-33OOEVPG.js";
|
|
9
9
|
import {
|
|
10
10
|
isProtectedByScope,
|
|
11
11
|
registerHookEntry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-MWLTTLPK.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
15
15
|
HOOK_BUDGETS,
|
|
16
16
|
HOOK_LOCATOR_BINARY
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
18
18
|
|
|
19
19
|
// src/gemini-config.ts
|
|
20
20
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SubscriptionRequiredError,
|
|
3
3
|
callMcpTool
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-XAO6EYGM.js";
|
|
5
5
|
import {
|
|
6
6
|
CLIENT_REPORT_DISABLE_ENV,
|
|
7
7
|
isDisabledByEnv
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
import {
|
|
10
10
|
installNetworkDefaults,
|
|
11
11
|
isNetworkFailure
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7BAO42UV.js";
|
|
13
13
|
import {
|
|
14
14
|
clientReportClaims
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-MWLTTLPK.js";
|
|
16
16
|
import {
|
|
17
17
|
getApiKey,
|
|
18
18
|
getBaseUrl
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BG4Y64FW.js";
|
|
20
20
|
import {
|
|
21
21
|
ASK_AGENT_NAME_MAX,
|
|
22
22
|
CLIENT_REPORT_PATH,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
GATE_PERMISSION_MODE_MAX_LENGTH,
|
|
25
25
|
degradedLine,
|
|
26
26
|
truncateLine
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
28
28
|
|
|
29
29
|
// src/api.ts
|
|
30
30
|
import { randomUUID } from "crypto";
|
|
@@ -114,6 +114,7 @@ var claimReportWindow = (claimsDir, key, now) => {
|
|
|
114
114
|
|
|
115
115
|
// src/client-report.ts
|
|
116
116
|
var CLIENT_REPORT_TIMEOUT_MS = 1e3;
|
|
117
|
+
var CLIENT_REPORT_MAX_ATTEMPTS = 2;
|
|
117
118
|
var readApiKey = () => {
|
|
118
119
|
try {
|
|
119
120
|
return getApiKey();
|
|
@@ -147,12 +148,21 @@ var createClientErrorReporter = (deps) => {
|
|
|
147
148
|
const apiKey = deps.apiKey();
|
|
148
149
|
const now = deps.now();
|
|
149
150
|
if (!apiKey || !claimReport(reportKey(event), now)) return;
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
151
|
+
const signal = AbortSignal.timeout(CLIENT_REPORT_TIMEOUT_MS);
|
|
152
|
+
for (let attempt = 0; attempt < CLIENT_REPORT_MAX_ATTEMPTS && !signal.aborted; attempt++) {
|
|
153
|
+
try {
|
|
154
|
+
const response = await deps.fetchImpl(`${deps.baseUrl()}${CLIENT_REPORT_PATH}`, {
|
|
155
|
+
method: "POST",
|
|
156
|
+
headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json" },
|
|
157
|
+
body: JSON.stringify({ ...event, occurredAt: new Date(now).toISOString() }),
|
|
158
|
+
signal
|
|
159
|
+
});
|
|
160
|
+
await response.body?.cancel();
|
|
161
|
+
if (response.ok || response.status < 500 && response.status !== 429) return;
|
|
162
|
+
} catch {
|
|
163
|
+
if (signal.aborted) return;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
156
166
|
} catch {
|
|
157
167
|
return;
|
|
158
168
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MWLTTLPK.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe
|
|
6
6
|
} from "./chunk-QENTGE75.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
10
10
|
|
|
11
11
|
// src/process-ownership.ts
|
|
12
12
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
reachVerdict,
|
|
8
8
|
reachesYou,
|
|
9
9
|
verifyDelivery
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-HUI4OE43.js";
|
|
11
11
|
import {
|
|
12
12
|
generateKeypair,
|
|
13
13
|
openSealedKey,
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
} from "./chunk-FO3MDD26.js";
|
|
25
25
|
import {
|
|
26
26
|
reportedInstallSource
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Y5VKZNFN.js";
|
|
28
28
|
import {
|
|
29
29
|
NPX_LATEST_COMMAND
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ERK24P76.js";
|
|
31
31
|
import {
|
|
32
32
|
NO_PAIRING_COMPUTER,
|
|
33
33
|
PAIR_TTL_SECONDS
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
35
35
|
|
|
36
36
|
// src/onboarding.ts
|
|
37
37
|
import qrcodeTerminal from "qrcode-terminal";
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
} from "./chunk-QENTGE75.js";
|
|
5
5
|
import {
|
|
6
6
|
configFilePath
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-BG4Y64FW.js";
|
|
8
8
|
import {
|
|
9
9
|
readSetupOutcomeProperties
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
11
11
|
|
|
12
12
|
// src/hooks-spec.ts
|
|
13
13
|
var CURSOR_GATE_SCRIPT = "pushary-gate.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y5VKZNFN.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-QENTGE75.js";
|
|
10
10
|
import {
|
|
11
11
|
configFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BG4Y64FW.js";
|
|
13
13
|
import {
|
|
14
14
|
API_KEY_PREFIX_PATTERN,
|
|
15
15
|
isRecord
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
17
17
|
|
|
18
18
|
// src/shell-alias.ts
|
|
19
19
|
import { homedir } from "os";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isApprovalMode,
|
|
3
|
+
isRecord,
|
|
4
|
+
isTimeoutAction
|
|
5
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
6
|
+
|
|
7
|
+
// src/cli/settings-response.ts
|
|
8
|
+
var isFiniteNumber = (value) => typeof value === "number" && Number.isFinite(value);
|
|
9
|
+
var isWaitSeconds = (value) => isFiniteNumber(value) && value >= 0;
|
|
10
|
+
var isModeOverride = (value) => isRecord(value) && isApprovalMode(value.mode) && (value.expiresAt === null || typeof value.expiresAt === "string" && Number.isFinite(Date.parse(value.expiresAt)));
|
|
11
|
+
var modeResponse = (value) => {
|
|
12
|
+
if (!isRecord(value) || value.override !== null && !isModeOverride(value.override) || value.permanent !== void 0 && typeof value.permanent !== "boolean") throw new Error("Invalid mode response");
|
|
13
|
+
return { override: value.override, ...typeof value.permanent === "boolean" ? { permanent: value.permanent } : {} };
|
|
14
|
+
};
|
|
15
|
+
var isWaitPolicy = (value) => isRecord(value) && typeof value.tool === "string" && isApprovalMode(value.mode) && isTimeoutAction(value.timeoutAction) && isWaitSeconds(value.timeoutSeconds) && isWaitSeconds(value.pushFirstSeconds);
|
|
16
|
+
var waitWindowResponse = (value) => {
|
|
17
|
+
if (!isRecord(value) || !isWaitSeconds(value.defaultPushFirstSeconds)) throw new Error("Invalid wait response");
|
|
18
|
+
return value.defaultPushFirstSeconds;
|
|
19
|
+
};
|
|
20
|
+
var waitResponse = (value) => {
|
|
21
|
+
const defaultPushFirstSeconds = waitWindowResponse(value);
|
|
22
|
+
if (!isRecord(value) || !Array.isArray(value.policies) || !value.policies.every(isWaitPolicy) || value.modeOverride !== null && !isApprovalMode(value.modeOverride)) throw new Error("Invalid wait response");
|
|
23
|
+
return { policies: value.policies, defaultPushFirstSeconds, modeOverride: value.modeOverride };
|
|
24
|
+
};
|
|
25
|
+
var isSuggestion = (value) => isRecord(value) && typeof value.id === "string" && typeof value.toolPattern === "string" && (value.kind === "auto_approve" || value.kind === "always_deny") && isFiniteNumber(value.evidenceApproved) && isFiniteNumber(value.evidenceDenied) && isFiniteNumber(value.windowDays);
|
|
26
|
+
var suggestionsResponse = (value) => {
|
|
27
|
+
if (!isRecord(value) || !Array.isArray(value.suggestions) || !value.suggestions.every(isSuggestion)) throw new Error("Invalid suggestions response");
|
|
28
|
+
return value.suggestions;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export {
|
|
32
|
+
modeResponse,
|
|
33
|
+
waitWindowResponse,
|
|
34
|
+
waitResponse,
|
|
35
|
+
suggestionsResponse
|
|
36
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keyCheckFromResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-YDR4BQ7R.js";
|
|
4
4
|
import {
|
|
5
5
|
installNetworkDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7BAO42UV.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BG4Y64FW.js";
|
|
10
10
|
|
|
11
11
|
// src/retry.ts
|
|
12
12
|
var isRetryable = (err) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseFlags
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NMUI3ZWG.js";
|
|
4
4
|
import {
|
|
5
5
|
UsageError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PPY5N2E6.js";
|
|
7
7
|
import {
|
|
8
8
|
SETUP_AGENT_CHOICES,
|
|
9
9
|
SETUP_CONNECT_MODES,
|
|
10
10
|
isSetupConnectMode,
|
|
11
11
|
isValidApiKey,
|
|
12
12
|
normalizeAgentId
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-AXJLJJ3M.js";
|
|
14
14
|
|
|
15
15
|
// src/setup/options.ts
|
|
16
16
|
var AGENT_CHOICES = SETUP_AGENT_CHOICES;
|