pushary 1.9.103 → 1.9.105
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/README.md +1 -0
- package/dist/{api-3O3GJV3V.js → api-RL5CPDTH.js} +13 -12
- package/dist/bin/pushary-audit.d.ts +1 -0
- package/dist/bin/pushary-audit.js +263 -0
- package/dist/bin/pushary-bell-hook.js +32 -30
- package/dist/bin/pushary-bell.js +14 -13
- package/dist/bin/pushary-claude.js +42 -41
- package/dist/bin/pushary-clean.js +42 -41
- package/dist/bin/pushary-codex-bridge.js +25 -24
- package/dist/bin/pushary-codex-hook.js +40 -38
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +17 -16
- package/dist/bin/pushary-connect.js +33 -32
- package/dist/bin/pushary-cowork.js +8 -8
- package/dist/bin/pushary-daemon.js +501 -72
- package/dist/bin/pushary-disconnect.js +32 -31
- package/dist/bin/pushary-display-hook.js +21 -20
- package/dist/bin/pushary-doctor.js +63 -61
- package/dist/bin/pushary-elicitation-hook.js +32 -30
- package/dist/bin/pushary-gemini-bridge.js +16 -15
- package/dist/bin/pushary-gemini-hook.js +35 -33
- package/dist/bin/pushary-hook.js +38 -35
- package/dist/bin/pushary-login.js +27 -26
- package/dist/bin/pushary-logout.js +33 -32
- package/dist/bin/pushary-mcp.js +14 -13
- package/dist/bin/pushary-mode.js +19 -18
- package/dist/bin/pushary-notification-hook.js +32 -30
- package/dist/bin/pushary-opencode-hook.js +34 -32
- package/dist/bin/pushary-permission-denied-hook.js +37 -34
- package/dist/bin/pushary-permission-hook.js +38 -35
- package/dist/bin/pushary-post-hook.js +32 -30
- package/dist/bin/pushary-prompt-hook.js +32 -30
- package/dist/bin/pushary-session-end-hook.js +34 -32
- package/dist/bin/pushary-session-start-hook.js +42 -40
- package/dist/bin/pushary-setup.js +71 -69
- package/dist/bin/pushary-stats.js +6 -6
- package/dist/bin/pushary-status.js +39 -38
- package/dist/bin/pushary-stop-hook.js +32 -30
- package/dist/bin/pushary-stopfailure-hook.js +32 -30
- package/dist/bin/pushary-suggestions.js +19 -18
- package/dist/bin/pushary-transcript-register.js +22 -21
- package/dist/bin/pushary-transcripts.js +30 -29
- package/dist/bin/pushary-upgrade.js +48 -46
- package/dist/bin/pushary-wait.js +19 -18
- package/dist/bin/pushary.js +11 -9
- package/dist/{chunk-WYJ6QM7K.js → chunk-2HC5ISDW.js} +2 -2
- package/dist/{chunk-FF7L4B3W.js → chunk-43PNDDB3.js} +9 -9
- package/dist/{chunk-2PR5EP7N.js → chunk-4EMPELDR.js} +4 -4
- package/dist/{chunk-3OIUMHHO.js → chunk-4XE3DVF7.js} +2 -2
- package/dist/{chunk-EOD3DBIN.js → chunk-5IAW6G3K.js} +3 -3
- package/dist/{chunk-QD57EL3I.js → chunk-6DKMZBRK.js} +3 -3
- package/dist/{chunk-MP3SEXXJ.js → chunk-76JOLPST.js} +1 -1
- package/dist/{chunk-ZXK46QT4.js → chunk-772NHSQB.js} +2 -2
- package/dist/{chunk-JUA7MX2V.js → chunk-A37RKFI3.js} +4 -4
- package/dist/{chunk-TLERJKSE.js → chunk-ASCQXNCL.js} +1 -1
- package/dist/{chunk-WZNLWDSL.js → chunk-ATVZAEM5.js} +7 -7
- package/dist/{chunk-WPK2UWDU.js → chunk-B5Q44HKN.js} +2 -2
- package/dist/{chunk-HYAQIKYB.js → chunk-B7O4CXFX.js} +6 -6
- package/dist/{chunk-KZERVKTD.js → chunk-BG4HHB7E.js} +2 -1
- package/dist/{chunk-3Q2X3T3U.js → chunk-CJTJ55DR.js} +1 -1
- package/dist/{chunk-SRE6XJ3K.js → chunk-CKWV3T7O.js} +7 -7
- package/dist/{chunk-AZSOH2SF.js → chunk-DA57ZI62.js} +2 -2
- package/dist/{chunk-WVAJSBI2.js → chunk-DH22FQAS.js} +3 -3
- package/dist/{chunk-JPKJBKZE.js → chunk-DIVVLBZZ.js} +9 -9
- package/dist/{chunk-KTM2X3XQ.js → chunk-DS672F57.js} +16 -16
- package/dist/{chunk-7BIVBOD5.js → chunk-EMSRB2KH.js} +5 -5
- package/dist/{chunk-T7G6IIV4.js → chunk-FE5JENEJ.js} +3 -3
- package/dist/{chunk-JECH4NJL.js → chunk-FJYUB3ZK.js} +6 -4
- package/dist/{chunk-4TVLPGJV.js → chunk-FUTFQSRA.js} +1 -1
- package/dist/{chunk-UQWEH7CK.js → chunk-G5HGV6D4.js} +5 -5
- package/dist/{chunk-MK2XE66G.js → chunk-GBHP3LML.js} +7 -5
- package/dist/{chunk-J6SSLXSU.js → chunk-GESW4OSZ.js} +4 -4
- package/dist/{chunk-KOUB4ZLX.js → chunk-GKCDMAUM.js} +1 -1
- package/dist/{chunk-VJOMBYY5.js → chunk-GUIS6ASL.js} +1 -1
- package/dist/{chunk-KACD6W6J.js → chunk-HH5NNPB5.js} +1 -1
- package/dist/{chunk-3ITURBPE.js → chunk-HLYZEZOI.js} +5 -5
- package/dist/{chunk-NZQEABRO.js → chunk-HONSMBF2.js} +13 -11
- package/dist/{chunk-G7RMOSRX.js → chunk-HXBQTPKC.js} +1 -1
- package/dist/{chunk-6N5DQG5F.js → chunk-I3IUS4SR.js} +2 -2
- package/dist/{chunk-ZCYLCD6L.js → chunk-IAASPG5B.js} +5 -5
- package/dist/{chunk-YETNUPV5.js → chunk-IGO5NDQY.js} +3 -3
- package/dist/{chunk-PM34Z5WX.js → chunk-IHQRLJEP.js} +12 -12
- package/dist/{chunk-X3HBR57D.js → chunk-J2HIFUAT.js} +7 -7
- package/dist/{chunk-7OZOFTTB.js → chunk-J5PUKKCT.js} +10 -9
- package/dist/{chunk-O7ITTNDD.js → chunk-JCSJEMTA.js} +210 -60
- package/dist/{chunk-AWF5WICI.js → chunk-JDGLNYDZ.js} +2 -2
- package/dist/{chunk-UOE26LPT.js → chunk-JLJJRBTD.js} +8 -7
- package/dist/{chunk-Z2TX7DVU.js → chunk-KHZCJP7P.js} +15 -13
- package/dist/{chunk-5PW25NHB.js → chunk-LK3WA6MK.js} +5 -5
- package/dist/{chunk-KLJ2CTT7.js → chunk-LL7SW4RL.js} +4 -4
- package/dist/{chunk-4QO267OY.js → chunk-LMDXQIYT.js} +1 -1
- package/dist/{chunk-VD6CAELE.js → chunk-MFJHLVIZ.js} +11 -95
- package/dist/{chunk-E7WJQBK3.js → chunk-MLLL2ET6.js} +17 -61
- package/dist/{chunk-COBOR3ST.js → chunk-NM44KCO6.js} +6 -4
- package/dist/{chunk-4FAJQPFY.js → chunk-O5TB2LMQ.js} +338 -0
- package/dist/{chunk-AVXG5QB2.js → chunk-OBZQPBUI.js} +5 -5
- package/dist/chunk-OINGJICB.js +108 -0
- package/dist/{chunk-RMFL62HR.js → chunk-P3H6I656.js} +14 -12
- package/dist/{chunk-Y7KRX7U4.js → chunk-P3VVRBBI.js} +1 -1
- package/dist/{chunk-V5DV7XZN.js → chunk-PFZCLG55.js} +4 -4
- package/dist/{chunk-2S5J5YI2.js → chunk-QCFWJZGT.js} +5 -5
- package/dist/{chunk-SA4PCB6N.js → chunk-RKQVMFHN.js} +11 -93
- package/dist/{chunk-LURFSDCL.js → chunk-ROVLRXBI.js} +1 -1
- package/dist/{chunk-JKOAAIJD.js → chunk-S2TTGX6F.js} +5 -5
- package/dist/{chunk-Y3SZVZF6.js → chunk-S75UO75C.js} +2 -2
- package/dist/chunk-T5I4PKOQ.js +122 -0
- package/dist/{chunk-3K7PB5LI.js → chunk-TXMYET7E.js} +3 -3
- package/dist/{chunk-CQ7QE4W2.js → chunk-UUJQK7DJ.js} +1 -1
- package/dist/{chunk-SXAZPWL7.js → chunk-UXIUCMFO.js} +8 -6
- package/dist/{chunk-JVE4P54I.js → chunk-VCWLGM77.js} +5 -3
- package/dist/{chunk-RVSRPDRF.js → chunk-VKTW5WVB.js} +2 -2
- package/dist/{chunk-T6TQETDN.js → chunk-WTREXZGS.js} +4 -4
- package/dist/chunk-WUIWHGKF.js +56 -0
- package/dist/{chunk-IOQ3ZCAE.js → chunk-X3QG5RT5.js} +1 -1
- package/dist/{chunk-O5ZKMUTP.js → chunk-X4TZN52V.js} +6 -6
- package/dist/{chunk-AHIAB7JQ.js → chunk-XN527J4W.js} +1 -1
- package/dist/{chunk-PWGD5EP6.js → chunk-YDQ6OJMF.js} +7 -1
- package/dist/{chunk-NMUI3ZWG.js → chunk-YPY4YCIZ.js} +1 -1
- package/dist/{chunk-PPY5N2E6.js → chunk-YU2EUD7O.js} +1 -1
- package/dist/{chunk-AFGMZZEB.js → chunk-Z5FV7LTD.js} +2 -2
- package/dist/{chunk-BQHZRH6S.js → chunk-ZCBTCW3T.js} +26 -110
- package/dist/{codex-app-cards-switch-D475JLP5.js → codex-app-cards-switch-FD2ZWLYL.js} +13 -12
- package/dist/{codex-desktop-launch-WOPEZMO6.js → codex-desktop-launch-BN5OABPN.js} +1 -1
- package/dist/{codex-session-launch-AWWECV2L.js → codex-session-launch-O3PHQWTS.js} +22 -21
- package/dist/{config-A5EC37VZ.js → config-KWP7UXYG.js} +3 -3
- package/dist/{global-upgrade-V6FA6MUF.js → global-upgrade-NBSY5436.js} +12 -11
- package/dist/{identity-BEPQQHNR.js → identity-RP5I7KTV.js} +5 -4
- package/dist/{live-capabilities-EAM2QN73.js → live-capabilities-XC6C47ZH.js} +6 -5
- package/dist/{paths-2IEEYSHM.js → paths-OE5APZ4Q.js} +8 -3
- package/dist/reapply-DRZ32BIB.js +65 -0
- package/dist/src/index.js +39 -36
- package/dist/{upgrade-lock-DLGVC34L.js → upgrade-lock-LWTVHYAJ.js} +5 -4
- package/dist/usage-5YESCANM.js +11 -0
- package/package.json +2 -1
- package/dist/reapply-LDCMRN6Q.js +0 -64
- package/dist/usage-U6H5UFS2.js +0 -11
|
@@ -1,39 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cursorGateOwnsClaudeCall,
|
|
3
|
+
readCursorGateRegistration
|
|
4
|
+
} from "./chunk-OINGJICB.js";
|
|
1
5
|
import {
|
|
2
6
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DS672F57.js";
|
|
4
8
|
import {
|
|
5
9
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import {
|
|
8
|
-
isBridgeLocator,
|
|
9
|
-
liveBridgeProbe,
|
|
10
|
-
pusharyHookExecutable,
|
|
11
|
-
resolveBridgeStub
|
|
12
|
-
} from "./chunk-VD6CAELE.js";
|
|
10
|
+
} from "./chunk-JLJJRBTD.js";
|
|
13
11
|
import {
|
|
14
12
|
writeDegraded
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import {
|
|
17
|
-
cursorUserHooks
|
|
18
|
-
} from "./chunk-O7ITTNDD.js";
|
|
13
|
+
} from "./chunk-IAASPG5B.js";
|
|
19
14
|
import {
|
|
20
|
-
atLeast,
|
|
21
|
-
parseVersion
|
|
22
|
-
} from "./chunk-BQHZRH6S.js";
|
|
23
|
-
import {
|
|
24
|
-
CURSOR_GATE_COVERAGE,
|
|
25
|
-
CURSOR_GATE_SCRIPT,
|
|
26
|
-
HOOK_VERSION_PATTERN,
|
|
27
|
-
NO_CURSOR_GATE,
|
|
28
15
|
claudeShapedHookInput,
|
|
29
|
-
cursorGateOwnsToolCall,
|
|
30
16
|
hookCompatibleProfileBySource,
|
|
31
|
-
isCursorHookPayload,
|
|
32
17
|
isGrokHookPayload,
|
|
33
|
-
isGrokSessionEndStop
|
|
34
|
-
|
|
35
|
-
toolsCoveredByGateEntry
|
|
36
|
-
} from "./chunk-4FAJQPFY.js";
|
|
18
|
+
isGrokSessionEndStop
|
|
19
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
37
20
|
|
|
38
21
|
// src/tool-hook-input.ts
|
|
39
22
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode", "cursor_version"];
|
|
@@ -58,72 +41,7 @@ function parseToolHookInput(value) {
|
|
|
58
41
|
// src/admission.ts
|
|
59
42
|
import { readFileSync } from "fs";
|
|
60
43
|
import { homedir } from "os";
|
|
61
|
-
import { join
|
|
62
|
-
|
|
63
|
-
// src/cursor-gate-registration.ts
|
|
64
|
-
import { dirname, isAbsolute, join, resolve } from "path";
|
|
65
|
-
var FIRST_PLUGIN_VERSION_HANDLING = {
|
|
66
|
-
beforeShellExecution: [0, 1, 0],
|
|
67
|
-
beforeMCPExecution: [0, 2, 1],
|
|
68
|
-
preToolUse: [0, 2, 2]
|
|
69
|
-
};
|
|
70
|
-
var COMMAND_HOOK_TYPE = "command";
|
|
71
|
-
var PLUGIN_MANIFEST = join(".cursor-plugin", "plugin.json");
|
|
72
|
-
var NO_SPOTLIGHT = () => [];
|
|
73
|
-
var executableName = (executable) => executable.split(/[/\\]/).pop() ?? "";
|
|
74
|
-
var isCursorGateScript = (executable) => executableName(executable) === CURSOR_GATE_SCRIPT;
|
|
75
|
-
var fromHooksDirectory = (path, environment) => isAbsolute(path) ? path : resolve(dirname(environment.hooksFile), path);
|
|
76
|
-
var pluginManifestBeside = (script) => join(dirname(dirname(script)), PLUGIN_MANIFEST);
|
|
77
|
-
var versionIn = (manifest) => {
|
|
78
|
-
try {
|
|
79
|
-
const parsed = JSON.parse(manifest);
|
|
80
|
-
return isRecord(parsed) && typeof parsed.version === "string" && HOOK_VERSION_PATTERN.test(parsed.version) ? parseVersion(parsed.version) : null;
|
|
81
|
-
} catch {
|
|
82
|
-
return null;
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
var pluginVersionOf = (script, probe) => {
|
|
86
|
-
const manifest = probe.readFile(pluginManifestBeside(script));
|
|
87
|
-
return manifest === null ? null : versionIn(manifest);
|
|
88
|
-
};
|
|
89
|
-
var gateScriptHandles = (script, event, probe) => {
|
|
90
|
-
if (!probe.exists(script)) return false;
|
|
91
|
-
const version = pluginVersionOf(script, probe);
|
|
92
|
-
return version !== null && atLeast(version, FIRST_PLUGIN_VERSION_HANDLING[event]);
|
|
93
|
-
};
|
|
94
|
-
var appBundleResolves = (locator, probe) => resolveBridgeStub(locator, { ...probe, mdfind: NO_SPOTLIGHT }).kind === "bundle";
|
|
95
|
-
var isLiveCursorGateCommand = (command, event, environment) => {
|
|
96
|
-
const executable = pusharyHookExecutable(command);
|
|
97
|
-
if (executable === null) return false;
|
|
98
|
-
const target = fromHooksDirectory(executable, environment);
|
|
99
|
-
if (isCursorGateScript(executable)) return gateScriptHandles(target, event, environment.probe);
|
|
100
|
-
return isBridgeLocator(executable) && appBundleResolves(target, environment.probe);
|
|
101
|
-
};
|
|
102
|
-
var isCommandHook = (entry) => entry.type === void 0 || entry.type === COMMAND_HOOK_TYPE;
|
|
103
|
-
var entriesOn = (hooks, event) => {
|
|
104
|
-
const entries = Object.hasOwn(hooks, event) ? hooks[event] : void 0;
|
|
105
|
-
return Array.isArray(entries) ? entries.filter(isRecord) : [];
|
|
106
|
-
};
|
|
107
|
-
var runsALiveGate = (entry, event, isLiveGate) => isCommandHook(entry) && typeof entry.command === "string" && isLiveGate(entry.command, event);
|
|
108
|
-
var toolsCoveredOn = (hooks, coverage, isLiveGate) => entriesOn(hooks, coverage.event).filter((entry) => runsALiveGate(entry, coverage.event, isLiveGate)).flatMap((entry) => toolsCoveredByGateEntry(coverage, entry.matcher) ?? []);
|
|
109
|
-
var cursorGateRegistrationOf = (document, isLiveGate) => {
|
|
110
|
-
if (!isRecord(document) || !isRecord(document.hooks)) return NO_CURSOR_GATE;
|
|
111
|
-
const hooks = document.hooks;
|
|
112
|
-
return CURSOR_GATE_COVERAGE.flatMap((coverage) => toolsCoveredOn(hooks, coverage, isLiveGate));
|
|
113
|
-
};
|
|
114
|
-
var userCursorGateEnvironment = () => ({ hooksFile: cursorUserHooks(), probe: liveBridgeProbe() });
|
|
115
|
-
var readCursorGateRegistration = (environment = userCursorGateEnvironment()) => {
|
|
116
|
-
try {
|
|
117
|
-
const raw = environment.probe.readFile(environment.hooksFile);
|
|
118
|
-
if (raw === null) return NO_CURSOR_GATE;
|
|
119
|
-
return cursorGateRegistrationOf(JSON.parse(raw), (command, event) => isLiveCursorGateCommand(command, event, environment));
|
|
120
|
-
} catch {
|
|
121
|
-
return NO_CURSOR_GATE;
|
|
122
|
-
}
|
|
123
|
-
};
|
|
124
|
-
var cursorGateOwnsClaudeCall = (payload, readRegistration) => isCursorHookPayload(payload) && cursorGateOwnsToolCall(readRegistration(), payload.tool_name);
|
|
125
|
-
|
|
126
|
-
// src/admission.ts
|
|
44
|
+
import { join } from "path";
|
|
127
45
|
var NO_RULES = { version: 1, disabled: [] };
|
|
128
46
|
var SUPPORTED_VERSION = 1;
|
|
129
47
|
var parseAdmissionRules = (raw) => {
|
|
@@ -140,7 +58,7 @@ var parseAdmissionRules = (raw) => {
|
|
|
140
58
|
return NO_RULES;
|
|
141
59
|
}
|
|
142
60
|
};
|
|
143
|
-
var admissionRulesFile = () => process.env.PUSHARY_ADMISSION_FILE?.trim() ||
|
|
61
|
+
var admissionRulesFile = () => process.env.PUSHARY_ADMISSION_FILE?.trim() || join(homedir(), ".pushary", "admission-rules.json");
|
|
144
62
|
var readAdmissionRules = () => {
|
|
145
63
|
try {
|
|
146
64
|
return parseAdmissionRules(readFileSync(admissionRulesFile(), "utf-8"));
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
macAppBridgeAvailable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IHQRLJEP.js";
|
|
4
4
|
import {
|
|
5
5
|
keyPrefix
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B7O4CXFX.js";
|
|
7
7
|
import {
|
|
8
8
|
bridgeAgentKey
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JCSJEMTA.js";
|
|
10
10
|
import {
|
|
11
11
|
readJsonSafe
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-T5I4PKOQ.js";
|
|
13
13
|
import {
|
|
14
14
|
isRecord,
|
|
15
15
|
isValidApiKey
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
17
17
|
|
|
18
18
|
// src/shared-mcp-key.ts
|
|
19
19
|
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : void 0;
|
|
@@ -521,7 +521,7 @@ var loadedOnce = (load) => {
|
|
|
521
521
|
};
|
|
522
522
|
|
|
523
523
|
// src/codex-desktop-proxy.ts
|
|
524
|
-
var loadThePhone = () => import("./api-
|
|
524
|
+
var loadThePhone = () => import("./api-RL5CPDTH.js");
|
|
525
525
|
var theFirstCardLoadsAgain = () => {
|
|
526
526
|
};
|
|
527
527
|
var APP_SERVER_COMMAND = "app-server";
|
|
@@ -1062,7 +1062,7 @@ var codexDesktopCommand = async (args, entry, readAccount) => {
|
|
|
1062
1062
|
return runCodexDesktopProxy(engine2, args.slice(3), readAccount, { watchesForCards: layoutIsKnown });
|
|
1063
1063
|
}
|
|
1064
1064
|
if (args[0] === APP_CARDS_FLAG) {
|
|
1065
|
-
const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-
|
|
1065
|
+
const { codexAppCardsCommandOnThisMac } = await import("./codex-app-cards-switch-FD2ZWLYL.js");
|
|
1066
1066
|
return codexAppCardsCommandOnThisMac(args.slice(1), entry, readAccount);
|
|
1067
1067
|
}
|
|
1068
1068
|
if (args.length > 2) throw new Error("Usage: pushary codex --desktop [path/to/Codex.app]");
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// src/cli/fsx.ts
|
|
2
|
+
import { constants as fsConstants, copyFileSync, fstatSync, lstatSync, realpathSync, existsSync, fchmodSync, fsyncSync, mkdirSync, openSync, closeSync, readFileSync, renameSync, statSync, unlinkSync, writeFileSync } from "fs";
|
|
3
|
+
import { dirname, join } from "path";
|
|
4
|
+
var readJsonSafe = (filePath) => {
|
|
5
|
+
let raw;
|
|
6
|
+
try {
|
|
7
|
+
raw = readFileSync(filePath, "utf-8");
|
|
8
|
+
} catch (err) {
|
|
9
|
+
const error = err;
|
|
10
|
+
if (error.code === "ENOENT") return { kind: "missing" };
|
|
11
|
+
return { kind: "unreadable", error };
|
|
12
|
+
}
|
|
13
|
+
if (raw.trim() === "") return { kind: "ok", value: {} };
|
|
14
|
+
try {
|
|
15
|
+
const value = JSON.parse(raw);
|
|
16
|
+
return { kind: "ok", value };
|
|
17
|
+
} catch (err) {
|
|
18
|
+
return { kind: "unparseable", error: err, raw };
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var MISSING_FILE_CODES = /* @__PURE__ */ new Set(["ENOENT", "ENOTDIR"]);
|
|
22
|
+
var isMissingFileError = (error) => error instanceof Error && "code" in error && typeof error.code === "string" && MISSING_FILE_CODES.has(error.code);
|
|
23
|
+
var READ_WITHOUT_WAITING = fsConstants.O_RDONLY | (fsConstants.O_NONBLOCK ?? 0);
|
|
24
|
+
var notARegularFile = (filePath, maxBytes) => new Error(`${filePath} is not a regular file of at most ${maxBytes} bytes`);
|
|
25
|
+
var regularFileTextOf = (fd, filePath, maxBytes) => {
|
|
26
|
+
const stats = fstatSync(fd);
|
|
27
|
+
if (!stats.isFile() || stats.size > maxBytes) return { kind: "unreadable", error: notARegularFile(filePath, maxBytes) };
|
|
28
|
+
return { kind: "ok", value: readFileSync(fd, "utf-8") };
|
|
29
|
+
};
|
|
30
|
+
var readRegularTextFile = (filePath, maxBytes) => {
|
|
31
|
+
let fd;
|
|
32
|
+
try {
|
|
33
|
+
fd = openSync(filePath, READ_WITHOUT_WAITING);
|
|
34
|
+
} catch (error) {
|
|
35
|
+
return isMissingFileError(error) ? { kind: "missing" } : { kind: "unreadable", error: error instanceof Error ? error : new Error(String(error)) };
|
|
36
|
+
}
|
|
37
|
+
try {
|
|
38
|
+
return regularFileTextOf(fd, filePath, maxBytes);
|
|
39
|
+
} catch (error) {
|
|
40
|
+
return { kind: "unreadable", error: error instanceof Error ? error : new Error(String(error)) };
|
|
41
|
+
} finally {
|
|
42
|
+
closeSync(fd);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var readRegularJsonFile = (filePath, maxBytes) => {
|
|
46
|
+
const text = readRegularTextFile(filePath, maxBytes);
|
|
47
|
+
if (text.kind !== "ok") return text;
|
|
48
|
+
if (text.value.trim() === "") return { kind: "ok", value: {} };
|
|
49
|
+
try {
|
|
50
|
+
return { kind: "ok", value: JSON.parse(text.value) };
|
|
51
|
+
} catch (error) {
|
|
52
|
+
return { kind: "unparseable", error: error instanceof Error ? error : new Error(String(error)), raw: text.value };
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var isFile = (path) => {
|
|
56
|
+
try {
|
|
57
|
+
return statSync(path).isFile();
|
|
58
|
+
} catch {
|
|
59
|
+
return false;
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var readFileOrMissing = (path) => {
|
|
63
|
+
try {
|
|
64
|
+
return readFileSync(path, "utf-8");
|
|
65
|
+
} catch (error) {
|
|
66
|
+
if (error instanceof Error && "code" in error && error.code === "ENOENT") return null;
|
|
67
|
+
throw error;
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
var stamp = () => (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
71
|
+
var backupFile = (filePath) => {
|
|
72
|
+
const target = `${filePath}.pushary-backup-${stamp()}`;
|
|
73
|
+
copyFileSync(filePath, target);
|
|
74
|
+
return target;
|
|
75
|
+
};
|
|
76
|
+
var writeFileAtomic = (filePath, contents, mode, encoding = "utf-8") => {
|
|
77
|
+
const target = lstatSync(filePath, { throwIfNoEntry: false })?.isSymbolicLink() ? realpathSync(filePath) : filePath;
|
|
78
|
+
const dir = dirname(target);
|
|
79
|
+
if (!existsSync(dir)) mkdirSync(dir, { recursive: true });
|
|
80
|
+
const temp = join(dir, `.${process.pid}-${stamp()}.pushary-tmp`);
|
|
81
|
+
try {
|
|
82
|
+
writeFileSync(temp, contents, mode === void 0 ? encoding : { encoding, mode });
|
|
83
|
+
const handle = openSync(temp, "r+");
|
|
84
|
+
try {
|
|
85
|
+
if (mode !== void 0) fchmodSync(handle, mode);
|
|
86
|
+
fsyncSync(handle);
|
|
87
|
+
} finally {
|
|
88
|
+
closeSync(handle);
|
|
89
|
+
}
|
|
90
|
+
renameSync(temp, target);
|
|
91
|
+
} catch (err) {
|
|
92
|
+
try {
|
|
93
|
+
if (existsSync(temp)) unlinkSync(temp);
|
|
94
|
+
} catch {
|
|
95
|
+
}
|
|
96
|
+
throw err;
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var writeJsonAtomic = (filePath, data, mode) => writeFileAtomic(filePath, `${JSON.stringify(data, null, 2)}
|
|
100
|
+
`, mode);
|
|
101
|
+
var writeJsonAtomicDurable = (filePath, data, mode) => {
|
|
102
|
+
writeJsonAtomic(filePath, data, mode);
|
|
103
|
+
if (process.platform === "win32") return;
|
|
104
|
+
const directory = openSync(dirname(filePath), "r");
|
|
105
|
+
try {
|
|
106
|
+
fsyncSync(directory);
|
|
107
|
+
} finally {
|
|
108
|
+
closeSync(directory);
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
export {
|
|
113
|
+
readJsonSafe,
|
|
114
|
+
readRegularTextFile,
|
|
115
|
+
readRegularJsonFile,
|
|
116
|
+
isFile,
|
|
117
|
+
readFileOrMissing,
|
|
118
|
+
backupFile,
|
|
119
|
+
writeFileAtomic,
|
|
120
|
+
writeJsonAtomic,
|
|
121
|
+
writeJsonAtomicDurable
|
|
122
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CODEX_HOOK_STATUS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VKTW5WVB.js";
|
|
4
4
|
import {
|
|
5
5
|
retryAgentCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-FJYUB3ZK.js";
|
|
7
7
|
import {
|
|
8
8
|
NPX_LATEST_COMMAND
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YDQ6OJMF.js";
|
|
10
10
|
|
|
11
11
|
// src/setup/codex-trust.ts
|
|
12
12
|
var CODEX_TRUST_TELEMETRY = {
|
|
@@ -4,13 +4,13 @@ import {
|
|
|
4
4
|
configFailureKind,
|
|
5
5
|
retryAgentCommand,
|
|
6
6
|
writeSetupConfigFile
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FJYUB3ZK.js";
|
|
8
8
|
import {
|
|
9
9
|
MCP_BRIDGE_BINARY
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-DA57ZI62.js";
|
|
11
11
|
import {
|
|
12
12
|
KEY_FILE_MODE
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-B7O4CXFX.js";
|
|
14
14
|
import {
|
|
15
15
|
CLINE_SERVER_NAME_TAKEN,
|
|
16
16
|
CLINE_SETTINGS_REFUSALS,
|
|
@@ -32,13 +32,15 @@ import {
|
|
|
32
32
|
withClinePusharyServer,
|
|
33
33
|
withRefreshedClineKey,
|
|
34
34
|
withoutClinePusharyServer
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-JCSJEMTA.js";
|
|
36
|
+
import {
|
|
37
|
+
resolveGlobalBinary
|
|
38
|
+
} from "./chunk-ZCBTCW3T.js";
|
|
36
39
|
import {
|
|
37
40
|
readJsonSafe,
|
|
38
|
-
resolveGlobalBinary,
|
|
39
41
|
writeFileAtomic,
|
|
40
42
|
writeJsonAtomic
|
|
41
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-T5I4PKOQ.js";
|
|
42
44
|
|
|
43
45
|
// src/fx-config.ts
|
|
44
46
|
var FX_SERVER_NAME = "pushary";
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JCSJEMTA.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage,
|
|
7
|
-
npmExitedOnPermissionDenied
|
|
7
|
+
npmExitedOnPermissionDenied
|
|
8
|
+
} from "./chunk-ZCBTCW3T.js";
|
|
9
|
+
import {
|
|
8
10
|
writeJsonAtomic
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-T5I4PKOQ.js";
|
|
10
12
|
|
|
11
13
|
// src/upgrade-lock.ts
|
|
12
14
|
import { fork } from "child_process";
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
codexHome,
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JCSJEMTA.js";
|
|
11
11
|
import {
|
|
12
12
|
resolvePathBinary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ZCBTCW3T.js";
|
|
14
14
|
import {
|
|
15
15
|
getPackageVersion
|
|
16
16
|
} from "./chunk-ZVU6WMMU.js";
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
reachVerdict,
|
|
13
13
|
reachesYou,
|
|
14
14
|
verifyDelivery
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-X4TZN52V.js";
|
|
16
16
|
import {
|
|
17
17
|
humanIsTty,
|
|
18
18
|
writeHuman
|
|
@@ -24,14 +24,14 @@ import {
|
|
|
24
24
|
} from "./chunk-FO3MDD26.js";
|
|
25
25
|
import {
|
|
26
26
|
reportedInstallSource
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-Z5FV7LTD.js";
|
|
28
28
|
import {
|
|
29
29
|
NPX_LATEST_COMMAND
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-YDQ6OJMF.js";
|
|
31
31
|
import {
|
|
32
32
|
NO_PAIRING_COMPUTER,
|
|
33
33
|
PAIR_TTL_SECONDS
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
35
35
|
|
|
36
36
|
// src/onboarding.ts
|
|
37
37
|
import qrcodeTerminal from "qrcode-terminal";
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import {
|
|
2
|
+
claudeConfigDir
|
|
3
|
+
} from "./chunk-JCSJEMTA.js";
|
|
4
|
+
import {
|
|
5
|
+
claudePermissionRulesFromSettings
|
|
6
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
7
|
+
|
|
8
|
+
// src/claude-permission-rules.ts
|
|
9
|
+
import { readFileSync, statSync } from "fs";
|
|
10
|
+
import { homedir } from "os";
|
|
11
|
+
import { join } from "path";
|
|
12
|
+
var MANAGED_CLAUDE_SETTINGS_BY_PLATFORM = {
|
|
13
|
+
darwin: "/Library/Application Support/ClaudeCode/managed-settings.json",
|
|
14
|
+
linux: "/etc/claude-code/managed-settings.json",
|
|
15
|
+
win32: "C:\\ProgramData\\ClaudeCode\\managed-settings.json"
|
|
16
|
+
};
|
|
17
|
+
var MAX_CLAUDE_SETTINGS_BYTES = 1048576;
|
|
18
|
+
var claudeSettingsLocationFor = (cwd, environment = process.env, home = homedir(), platform = process.platform) => ({
|
|
19
|
+
configDir: claudeConfigDir(home, environment),
|
|
20
|
+
projectDir: environment.CLAUDE_PROJECT_DIR || cwd || void 0,
|
|
21
|
+
managedSettingsPath: MANAGED_CLAUDE_SETTINGS_BY_PLATFORM[platform]
|
|
22
|
+
});
|
|
23
|
+
var claudeSettingsSources = (location) => [
|
|
24
|
+
...location.managedSettingsPath ? [{ path: location.managedSettingsPath, trust: "grants" }] : [],
|
|
25
|
+
{ path: join(location.configDir, "settings.json"), trust: "grants" },
|
|
26
|
+
...location.projectDir ? [
|
|
27
|
+
{ path: join(location.projectDir, ".claude", "settings.json"), trust: "restricts_only" },
|
|
28
|
+
{ path: join(location.projectDir, ".claude", "settings.local.json"), trust: "grants" }
|
|
29
|
+
] : []
|
|
30
|
+
];
|
|
31
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
32
|
+
var restrictionsOnly = (document) => {
|
|
33
|
+
if (!isRecord(document) || !isRecord(document.permissions)) return null;
|
|
34
|
+
const { ask, deny } = document.permissions;
|
|
35
|
+
return { permissions: { ask, deny } };
|
|
36
|
+
};
|
|
37
|
+
var readSettingsDocument = (path) => {
|
|
38
|
+
try {
|
|
39
|
+
const stats = statSync(path);
|
|
40
|
+
if (!stats.isFile() || stats.size > MAX_CLAUDE_SETTINGS_BYTES) return null;
|
|
41
|
+
return JSON.parse(readFileSync(path, "utf8"));
|
|
42
|
+
} catch {
|
|
43
|
+
return null;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var trustedDocument = ({ path, trust }) => {
|
|
47
|
+
const document = readSettingsDocument(path);
|
|
48
|
+
return trust === "grants" ? document : restrictionsOnly(document);
|
|
49
|
+
};
|
|
50
|
+
var readClaudePermissionRules = (location) => claudePermissionRulesFromSettings(claudeSettingsSources(location).map(trustedDocument));
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
MANAGED_CLAUDE_SETTINGS_BY_PLATFORM,
|
|
54
|
+
claudeSettingsLocationFor,
|
|
55
|
+
readClaudePermissionRules
|
|
56
|
+
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_RULES_PATH,
|
|
3
3
|
canChangeApprovalSettings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2HC5ISDW.js";
|
|
5
5
|
import {
|
|
6
6
|
callMcpTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PFZCLG55.js";
|
|
8
8
|
import {
|
|
9
9
|
absoluteUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-EMSRB2KH.js";
|
|
11
11
|
import {
|
|
12
12
|
getBaseUrl
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-GKCDMAUM.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-YDQ6OJMF.js";
|
|
17
17
|
import {
|
|
18
18
|
AGENT_STOP_DEFAULT_SECONDS,
|
|
19
19
|
APPROVAL_MODE_META,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
classifyConfirmResponse,
|
|
22
22
|
isAnswerSource,
|
|
23
23
|
roundTripAsk
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
25
25
|
|
|
26
26
|
// src/reach.ts
|
|
27
27
|
var reachVerdict = (channels) => {
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
DISCONNECT_AGENT_IDS,
|
|
3
3
|
SETUP_AGENT_CHOICES,
|
|
4
4
|
isApprovalMode
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-O5TB2LMQ.js";
|
|
6
6
|
|
|
7
7
|
// src/cli/mode-request.ts
|
|
8
8
|
var parseDuration = (value) => {
|
|
@@ -112,6 +112,12 @@ var COMMAND_LIST = [
|
|
|
112
112
|
{ name: "mode", module: "pushary-mode", summary: "Choose where approval requests appear" },
|
|
113
113
|
{ name: "wait", module: "pushary-wait", summary: 'Show or set the "wait for your phone" ladder (pushary wait 45)' },
|
|
114
114
|
{ name: "stats", module: "pushary-stats", summary: "Show the approval moments your agents hit while not connected" },
|
|
115
|
+
{
|
|
116
|
+
name: "audit",
|
|
117
|
+
module: "pushary-audit",
|
|
118
|
+
summary: "Check a verifiable audit export: every hash, every signature, and the checkpoints you verified before",
|
|
119
|
+
detail: ["Download the file from Dashboard > Agent > Activity > Verifiable, then run: pushary audit verify <file>"]
|
|
120
|
+
},
|
|
115
121
|
{
|
|
116
122
|
name: "suggestions",
|
|
117
123
|
module: "pushary-suggestions",
|