@pushary/agent-hooks 1.9.19 → 1.9.21
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/dist/bin/pushary-bell-hook.js +27 -27
- package/dist/bin/pushary-bell.js +14 -12
- package/dist/bin/pushary-claude.js +26 -26
- package/dist/bin/pushary-clean.js +36 -33
- package/dist/bin/pushary-codex-bridge.js +18 -18
- package/dist/bin/pushary-codex-hook.js +32 -32
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +25 -25
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +33 -33
- package/dist/bin/pushary-disconnect.js +25 -25
- package/dist/bin/pushary-doctor.js +34 -34
- package/dist/bin/pushary-elicitation-hook.js +27 -27
- package/dist/bin/pushary-gemini-bridge.js +14 -14
- package/dist/bin/pushary-gemini-hook.js +29 -29
- package/dist/bin/pushary-hook.js +31 -31
- package/dist/bin/pushary-login.js +13 -13
- package/dist/bin/pushary-logout.js +36 -20
- package/dist/bin/pushary-mcp.js +10 -10
- package/dist/bin/pushary-mode.js +13 -13
- package/dist/bin/pushary-notification-hook.js +26 -26
- package/dist/bin/pushary-opencode-hook.js +28 -28
- package/dist/bin/pushary-permission-denied-hook.js +31 -31
- package/dist/bin/pushary-permission-hook.js +30 -30
- package/dist/bin/pushary-post-hook.js +26 -26
- package/dist/bin/pushary-prompt-hook.js +26 -26
- package/dist/bin/pushary-session-end-hook.js +26 -26
- package/dist/bin/pushary-session-start-hook.js +30 -30
- package/dist/bin/pushary-setup.js +76 -51
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +34 -29
- package/dist/bin/pushary-stop-hook.js +26 -26
- package/dist/bin/pushary-stopfailure-hook.js +26 -26
- package/dist/bin/pushary-suggestions.js +13 -13
- package/dist/bin/pushary-transcript-register.js +19 -19
- package/dist/bin/pushary-transcripts.js +9 -9
- package/dist/bin/pushary-upgrade.js +31 -31
- package/dist/bin/pushary-wait.js +13 -13
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-YONHM5BQ.js → chunk-247PAUW6.js} +1 -1
- package/dist/{chunk-QLG6UKIB.js → chunk-2V55RBUR.js} +5 -5
- package/dist/{chunk-5RMD75P2.js → chunk-4BKAZ4JN.js} +10 -6
- package/dist/{chunk-HYPSYXP4.js → chunk-4RJQPI36.js} +5 -5
- package/dist/{chunk-XQ4HTTBB.js → chunk-4WHNRAOK.js} +1 -1
- package/dist/{chunk-VCLDXVR3.js → chunk-5PW6GMQO.js} +3 -3
- package/dist/{chunk-2V2CCTGQ.js → chunk-6WBIQQHO.js} +1 -1
- package/dist/{chunk-XGHXQUDG.js → chunk-6WINXCXY.js} +1 -1
- package/dist/{chunk-KT36OCRW.js → chunk-7AFLHL2R.js} +6 -3
- package/dist/{chunk-FT7UNIS3.js → chunk-AQFEP65J.js} +2 -1
- package/dist/{chunk-7TSL3JCX.js → chunk-AXBFNQG6.js} +1 -1
- package/dist/{chunk-LHGB64O2.js → chunk-B6KZME5D.js} +1 -1
- package/dist/{chunk-E2RXTRM2.js → chunk-BDL6GJOQ.js} +4 -4
- package/dist/{chunk-DKFAJHLI.js → chunk-BERMVODT.js} +9 -8
- package/dist/{chunk-LXYNKZFP.js → chunk-BV5JPACQ.js} +2 -2
- package/dist/{chunk-FEKP3NJR.js → chunk-CEF4UQ3X.js} +21 -8
- package/dist/{chunk-MGW26CW7.js → chunk-ESHO7OC3.js} +1 -1
- package/dist/{chunk-4ABHSCFJ.js → chunk-FH4O3QGQ.js} +29 -26
- package/dist/{chunk-3FG2VCH3.js → chunk-FUXCWF4Y.js} +11 -8
- package/dist/{chunk-23QKUOEV.js → chunk-G4TV5GYU.js} +2 -2
- package/dist/{chunk-TBTCBAQC.js → chunk-GMJOSAAP.js} +11 -11
- package/dist/{chunk-2YAHQ763.js → chunk-I52ALHOM.js} +5 -5
- package/dist/{chunk-6TQLZP7F.js → chunk-IEYFFMTU.js} +3 -3
- package/dist/{chunk-T27NT7LJ.js → chunk-II6OFDB3.js} +4 -4
- package/dist/{chunk-TNZYTGAJ.js → chunk-IIQ77WUJ.js} +6 -6
- package/dist/{chunk-ATDOYZXC.js → chunk-IM7EGZVH.js} +1 -1
- package/dist/{chunk-CRW4P7JU.js → chunk-JHAPJRAN.js} +1 -1
- package/dist/{chunk-6GQDOO5P.js → chunk-L5NPRGVE.js} +10 -9
- package/dist/{chunk-A6U4RRFM.js → chunk-LUDGBOLV.js} +2 -2
- package/dist/{chunk-KRDQQL2X.js → chunk-NBGJ3EOE.js} +2 -2
- package/dist/{chunk-MID7BURF.js → chunk-NVXC6ZBR.js} +2 -2
- package/dist/{chunk-SB2GN6OP.js → chunk-OYIN77HO.js} +3 -2
- package/dist/{chunk-Z4YQ7ZMO.js → chunk-PCF7JUTP.js} +3 -3
- package/dist/{chunk-5LQRUBFB.js → chunk-PCVAK67W.js} +1 -1
- package/dist/{chunk-SEZUF33H.js → chunk-PYWZYM74.js} +5 -14
- package/dist/{chunk-AXG5QMRM.js → chunk-QHY3UDYC.js} +3 -3
- package/dist/{chunk-SIOYJRL4.js → chunk-RVP6COOQ.js} +2 -2
- package/dist/{chunk-QDRDDVLH.js → chunk-SVQOEVAT.js} +4 -4
- package/dist/{chunk-B4OS2OVD.js → chunk-TBCXMW2C.js} +3 -3
- package/dist/{chunk-XUUE6MYM.js → chunk-TJ4KMPYO.js} +10 -10
- package/dist/{chunk-5C2GFTWE.js → chunk-TQIPIFL7.js} +1 -1
- package/dist/{chunk-5PYLU6OS.js → chunk-TVBEHME2.js} +7 -6
- package/dist/{chunk-FRZS7XQF.js → chunk-U6GYFWT4.js} +8 -5
- package/dist/{chunk-736I6CBY.js → chunk-UKCRTTKF.js} +1 -1
- package/dist/{chunk-UAA4BEYM.js → chunk-UZ2YEGIT.js} +3 -3
- package/dist/{chunk-6HMCOGKJ.js → chunk-VBPASZU7.js} +13 -8
- package/dist/{chunk-YXYSPMD3.js → chunk-VD2AWSER.js} +2 -2
- package/dist/{chunk-MHYXM43K.js → chunk-VRXX2AY2.js} +2 -2
- package/dist/{chunk-6WEC3KZP.js → chunk-VTR4VRL2.js} +1 -1
- package/dist/{chunk-BIQF3C4H.js → chunk-XNO3CSVW.js} +1 -1
- package/dist/{chunk-DVLQ4TVD.js → chunk-Y2BOLNJV.js} +5 -5
- package/dist/{chunk-W4TZAKOD.js → chunk-Y6PZ3B5U.js} +2 -2
- package/dist/{chunk-NILVJ7HV.js → chunk-YCL2V5FD.js} +9 -9
- package/dist/{chunk-YAU4JCYI.js → chunk-YLLGKY7K.js} +3 -3
- package/dist/{chunk-OWUDBHXW.js → chunk-Z5EYCMJH.js} +2 -2
- package/dist/{chunk-SXVXANPI.js → chunk-ZNAGS7O7.js} +3 -3
- package/dist/{global-upgrade-XEMENBZA.js → global-upgrade-AHRKGQ7M.js} +7 -7
- package/dist/{paths-VW5CI5KS.js → paths-AGUCNYQ5.js} +2 -2
- package/dist/{reapply-7KPSIO4L.js → reapply-BUCDXIIM.js} +21 -21
- package/dist/src/index.js +20 -20
- package/dist/{upgrade-lock-VT6XMQMB.js → upgrade-lock-7Z5WBZVH.js} +4 -4
- package/package.json +1 -1
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compatibleConfigFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BDL6GJOQ.js";
|
|
4
4
|
import {
|
|
5
5
|
hookOwnerOf,
|
|
6
6
|
hookOwnerOfCommands,
|
|
7
7
|
liveBridgeProbe,
|
|
8
8
|
resolveBridgeStub
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-PYWZYM74.js";
|
|
10
10
|
import {
|
|
11
11
|
AGENT_CHOICES
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-247PAUW6.js";
|
|
13
13
|
import {
|
|
14
14
|
claudeSettings,
|
|
15
15
|
codexHooksJson,
|
|
@@ -18,17 +18,18 @@ import {
|
|
|
18
18
|
guardedArgv,
|
|
19
19
|
pusharyDir,
|
|
20
20
|
vscodePluginDir
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-CEF4UQ3X.js";
|
|
22
22
|
import {
|
|
23
23
|
readJsonSafe
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-AQFEP65J.js";
|
|
25
25
|
import {
|
|
26
26
|
HOOK_BUDGETS,
|
|
27
27
|
HOOK_COMPATIBLE_PROFILES,
|
|
28
28
|
HOOK_LOCATOR_BINARY,
|
|
29
29
|
OPENCODE_APPROVAL_EVENT,
|
|
30
|
-
hookCompatibleProfile
|
|
31
|
-
|
|
30
|
+
hookCompatibleProfile,
|
|
31
|
+
isRecord
|
|
32
|
+
} from "./chunk-VBPASZU7.js";
|
|
32
33
|
|
|
33
34
|
// src/opencode-plugin.ts
|
|
34
35
|
var OPENCODE_PLUGIN_MARKER = "pushary-opencode-plugin w1";
|
|
@@ -436,7 +437,7 @@ var agentHookOwner = (agent, appAvailable) => {
|
|
|
436
437
|
const file = agentHookFile(agent);
|
|
437
438
|
if (!file) return "none";
|
|
438
439
|
const document = readJsonSafe(file);
|
|
439
|
-
return hookOwnerOf(document.kind === "ok" ? document.value : null, appAvailable, agentHooksKeyPath(agent));
|
|
440
|
+
return hookOwnerOf(document.kind === "ok" && isRecord(document.value) ? document.value : null, appAvailable, agentHooksKeyPath(agent));
|
|
440
441
|
};
|
|
441
442
|
var cliOwnsAnyAgentHooks = (appAvailable) => AGENT_CHOICES.some((agent) => agentHookOwner(agent, appAvailable) === "cli");
|
|
442
443
|
var macAppBridgeAvailable = () => resolveBridgeStub(join2(pusharyDir(), "bin", HOOK_LOCATOR_BINARY), liveBridgeProbe()).kind === "bundle";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-KZERVKTD.js";
|
|
4
4
|
import {
|
|
5
5
|
renderCommandHelp
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-B6KZME5D.js";
|
|
7
7
|
import {
|
|
8
8
|
getPackageVersion
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VBPASZU7.js";
|
|
10
10
|
|
|
11
11
|
// src/cli/usage.ts
|
|
12
12
|
var exitOnHelpFlag = (command) => {
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
isReleaseVersion,
|
|
14
14
|
ownPackageName,
|
|
15
15
|
withHookHoldBudget
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VBPASZU7.js";
|
|
17
17
|
|
|
18
18
|
// src/setup/paths.ts
|
|
19
19
|
import { homedir as homedir2 } from "os";
|
|
@@ -168,13 +168,16 @@ var NpmMissingError = class extends Error {
|
|
|
168
168
|
this.name = "NpmMissingError";
|
|
169
169
|
}
|
|
170
170
|
};
|
|
171
|
+
var npmPermissionFailureKind = (code, platform) => code === "EPERM" && platform === "win32" ? "file-in-use" : "global-prefix";
|
|
171
172
|
var NpmPermissionError = class extends Error {
|
|
172
|
-
|
|
173
|
+
kind;
|
|
174
|
+
constructor(detail, kind) {
|
|
173
175
|
super(detail);
|
|
174
176
|
this.name = "NpmPermissionError";
|
|
177
|
+
this.kind = kind;
|
|
175
178
|
}
|
|
176
179
|
};
|
|
177
|
-
var NPM_PERMISSION_CODE = /\
|
|
180
|
+
var NPM_PERMISSION_CODE = /\b(EACCES|EPERM)\b/;
|
|
178
181
|
var ERROR_TEXT_FIELDS = ["code", "stderr", "stdout", "message"];
|
|
179
182
|
var errorTextOf = (err) => {
|
|
180
183
|
if (typeof err !== "object" || err === null) return [String(err)];
|
|
@@ -183,8 +186,18 @@ var errorTextOf = (err) => {
|
|
|
183
186
|
return typeof value === "string" || Buffer.isBuffer(value) ? [value.toString()] : [];
|
|
184
187
|
});
|
|
185
188
|
};
|
|
186
|
-
var
|
|
187
|
-
var
|
|
189
|
+
var isNpmPermissionCode = (value) => value === "EACCES" || value === "EPERM";
|
|
190
|
+
var npmPermissionCodeOf = (err) => {
|
|
191
|
+
for (const text of errorTextOf(err)) {
|
|
192
|
+
const code = NPM_PERMISSION_CODE.exec(text)?.[1];
|
|
193
|
+
if (isNpmPermissionCode(code)) return code;
|
|
194
|
+
}
|
|
195
|
+
return null;
|
|
196
|
+
};
|
|
197
|
+
var npmInstallFailure = (err, platform = process.platform) => {
|
|
198
|
+
const code = npmPermissionCodeOf(err);
|
|
199
|
+
return code === null ? new Error(npmErrorMessage(err)) : new NpmPermissionError(npmErrorMessage(err), npmPermissionFailureKind(code, platform));
|
|
200
|
+
};
|
|
188
201
|
var resolveBinary = (name) => resolveGlobalBinary(name) ?? resolvePathBinary(name);
|
|
189
202
|
var resolvePackageVersionFromBinary = (binary, packageName) => {
|
|
190
203
|
try {
|
|
@@ -382,9 +395,9 @@ var installGlobally = (options) => {
|
|
|
382
395
|
}
|
|
383
396
|
const started = (async () => {
|
|
384
397
|
if (!npmIsOnPath()) throw new NpmMissingError();
|
|
385
|
-
const { withUpgradeLock } = await import("./global-upgrade-
|
|
386
|
-
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-
|
|
387
|
-
const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-
|
|
398
|
+
const { withUpgradeLock } = await import("./global-upgrade-AHRKGQ7M.js");
|
|
399
|
+
const { installWithUpgradeLock, ownsUpgradeLock } = await import("./upgrade-lock-7Z5WBZVH.js");
|
|
400
|
+
const { autoUpdateLock: autoUpdateLock2 } = await import("./paths-AGUCNYQ5.js");
|
|
388
401
|
let result = "skipped";
|
|
389
402
|
const install = async () => {
|
|
390
403
|
const platform = process.platform;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NVXC6ZBR.js";
|
|
4
4
|
import {
|
|
5
5
|
backupFile,
|
|
6
6
|
readJsonSafe,
|
|
7
7
|
writeFileAtomic,
|
|
8
8
|
writeJsonAtomic
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-AQFEP65J.js";
|
|
10
10
|
import {
|
|
11
11
|
configFilePath
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4WHNRAOK.js";
|
|
13
|
+
import {
|
|
14
|
+
API_KEY_PREFIX_PATTERN,
|
|
15
|
+
isRecord
|
|
16
|
+
} from "./chunk-VBPASZU7.js";
|
|
13
17
|
|
|
14
18
|
// src/shell-alias.ts
|
|
15
19
|
import { homedir } from "os";
|
|
@@ -111,7 +115,6 @@ var isDisabledExport = (line) => {
|
|
|
111
115
|
};
|
|
112
116
|
var keyPrefix = (key) => key.split(".")[0] ?? key;
|
|
113
117
|
var MAC_APP_KEY_PREFIX_FIELD = "macAppKeyPrefix";
|
|
114
|
-
var KEY_PREFIX_SHAPE = /^pk_[a-f0-9]+$/;
|
|
115
118
|
var findKeyExport = (contents) => {
|
|
116
119
|
const lines = contents.split("\n");
|
|
117
120
|
for (const [index, line] of lines.entries()) {
|
|
@@ -120,6 +123,10 @@ var findKeyExport = (contents) => {
|
|
|
120
123
|
}
|
|
121
124
|
return null;
|
|
122
125
|
};
|
|
126
|
+
var readConfigRecord = (configPath) => {
|
|
127
|
+
const result = readJsonSafe(configPath);
|
|
128
|
+
return result.kind === "ok" && isRecord(result.value) ? result.value : null;
|
|
129
|
+
};
|
|
123
130
|
var keepMacAppKeyPrefix = (current, apiKey) => {
|
|
124
131
|
const { [MAC_APP_KEY_PREFIX_FIELD]: recorded, ...rest } = current;
|
|
125
132
|
return recorded === keyPrefix(apiKey) ? { ...rest, [MAC_APP_KEY_PREFIX_FIELD]: recorded } : rest;
|
|
@@ -214,9 +221,9 @@ var writeKey = (apiKey, options = {}) => {
|
|
|
214
221
|
`${configPath} exists but could not be read (${existing.error.message}). Fix its permissions or remove it, then re-run setup. Nothing was changed.`
|
|
215
222
|
);
|
|
216
223
|
}
|
|
217
|
-
if (existing.kind === "ok") {
|
|
224
|
+
if (existing.kind === "ok" && isRecord(existing.value)) {
|
|
218
225
|
current = existing.value;
|
|
219
|
-
} else if (existing.kind === "unparseable") {
|
|
226
|
+
} else if (existing.kind === "ok" || existing.kind === "unparseable") {
|
|
220
227
|
configBackupPath = backupFile(configPath);
|
|
221
228
|
}
|
|
222
229
|
writeJsonAtomic(
|
|
@@ -238,10 +245,10 @@ var writeKey = (apiKey, options = {}) => {
|
|
|
238
245
|
};
|
|
239
246
|
var clearKey = (options = {}) => {
|
|
240
247
|
const configPath = configFilePath();
|
|
241
|
-
const existing =
|
|
248
|
+
const existing = readConfigRecord(configPath);
|
|
242
249
|
let removedFromConfig = false;
|
|
243
|
-
if (existing
|
|
244
|
-
const { apiKey: _dropped, [MAC_APP_KEY_PREFIX_FIELD]: _adopted, ...rest } = existing
|
|
250
|
+
if (existing !== null && typeof existing.apiKey === "string") {
|
|
251
|
+
const { apiKey: _dropped, [MAC_APP_KEY_PREFIX_FIELD]: _adopted, ...rest } = existing;
|
|
245
252
|
writeJsonAtomic(configPath, rest, KEY_FILE_MODE);
|
|
246
253
|
restrictFile(configPath);
|
|
247
254
|
removedFromConfig = true;
|
|
@@ -277,22 +284,18 @@ var restrictFile = (filePath) => {
|
|
|
277
284
|
}
|
|
278
285
|
};
|
|
279
286
|
var readConfigKey = (configPath) => {
|
|
280
|
-
const
|
|
281
|
-
|
|
282
|
-
const key = typeof result.value.apiKey === "string" ? result.value.apiKey.trim() : "";
|
|
287
|
+
const apiKey = readConfigRecord(configPath)?.apiKey;
|
|
288
|
+
const key = typeof apiKey === "string" ? apiKey.trim() : "";
|
|
283
289
|
return key || null;
|
|
284
290
|
};
|
|
285
291
|
var readConfigFileKey = () => readConfigKey(configFilePath());
|
|
286
292
|
var readControlMode = (configPath = configFilePath()) => {
|
|
287
|
-
const
|
|
288
|
-
if (result.kind !== "ok") return null;
|
|
289
|
-
const value = result.value.controlMode;
|
|
293
|
+
const value = readConfigRecord(configPath)?.controlMode;
|
|
290
294
|
return value === "auto" || value === "on" || value === "off" ? value : null;
|
|
291
295
|
};
|
|
292
296
|
var readTranscriptPreference = () => {
|
|
293
|
-
const
|
|
294
|
-
|
|
295
|
-
return typeof result.value.transcriptsEnabled === "boolean" ? result.value.transcriptsEnabled : null;
|
|
297
|
+
const value = readConfigRecord(configFilePath())?.transcriptsEnabled;
|
|
298
|
+
return typeof value === "boolean" ? value : null;
|
|
296
299
|
};
|
|
297
300
|
var readKeySource = () => {
|
|
298
301
|
const configPath = configFilePath();
|
|
@@ -304,16 +307,15 @@ var readKeySource = () => {
|
|
|
304
307
|
return { kind: "none", key: null, origin: null, drift: null };
|
|
305
308
|
};
|
|
306
309
|
var readMacAppKeyPrefix = (configPath = configFilePath()) => {
|
|
307
|
-
const
|
|
308
|
-
|
|
309
|
-
const recorded = result.value[MAC_APP_KEY_PREFIX_FIELD];
|
|
310
|
-
return typeof recorded === "string" && KEY_PREFIX_SHAPE.test(recorded) ? recorded : null;
|
|
310
|
+
const recorded = readConfigRecord(configPath)?.[MAC_APP_KEY_PREFIX_FIELD];
|
|
311
|
+
return typeof recorded === "string" && API_KEY_PREFIX_PATTERN.test(recorded) ? recorded : null;
|
|
311
312
|
};
|
|
313
|
+
var isAdoptedMacAppKey = (key, adoptedPrefix) => keyPrefix(key) === adoptedPrefix;
|
|
312
314
|
var recordMacAppKeyPrefix = (apiKey, configPath = configFilePath()) => {
|
|
313
|
-
const
|
|
314
|
-
if (
|
|
315
|
-
if (
|
|
316
|
-
writeJsonAtomic(configPath, { ...
|
|
315
|
+
const config = readConfigRecord(configPath);
|
|
316
|
+
if (config === null || config.apiKey !== apiKey) return false;
|
|
317
|
+
if (config[MAC_APP_KEY_PREFIX_FIELD] === keyPrefix(apiKey)) return false;
|
|
318
|
+
writeJsonAtomic(configPath, { ...config, [MAC_APP_KEY_PREFIX_FIELD]: keyPrefix(apiKey) }, KEY_FILE_MODE);
|
|
317
319
|
restrictFile(configPath);
|
|
318
320
|
return true;
|
|
319
321
|
};
|
|
@@ -354,6 +356,7 @@ export {
|
|
|
354
356
|
readTranscriptPreference,
|
|
355
357
|
readKeySource,
|
|
356
358
|
readMacAppKeyPrefix,
|
|
359
|
+
isAdoptedMacAppKey,
|
|
357
360
|
recordMacAppKeyPrefix,
|
|
358
361
|
findExportedKeyLines,
|
|
359
362
|
findExportedKeyLine
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y6PZ3B5U.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-BERMVODT.js";
|
|
16
16
|
import {
|
|
17
17
|
addClaudeMcpServer,
|
|
18
18
|
addPusharyHooks,
|
|
19
19
|
addPusharyToolPermissions
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-BDL6GJOQ.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-PYWZYM74.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-YLLGKY7K.js";
|
|
40
40
|
import {
|
|
41
41
|
formatVersion
|
|
42
42
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -59,12 +59,15 @@ import {
|
|
|
59
59
|
registrationHolderOf,
|
|
60
60
|
resolveGlobalBinary,
|
|
61
61
|
vscodePluginMcp
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-CEF4UQ3X.js";
|
|
63
63
|
import {
|
|
64
64
|
readJsonSafe,
|
|
65
65
|
writeFileAtomic,
|
|
66
66
|
writeJsonAtomic
|
|
67
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-AQFEP65J.js";
|
|
68
|
+
import {
|
|
69
|
+
isRecord
|
|
70
|
+
} from "./chunk-VBPASZU7.js";
|
|
68
71
|
|
|
69
72
|
// src/reapply.ts
|
|
70
73
|
import { dirname, join } from "path";
|
|
@@ -111,7 +114,7 @@ var CLAUDE_SETTINGS = join(homedir(), ".claude", "settings.json");
|
|
|
111
114
|
var CLAUDE_JSON = join(homedir(), ".claude.json");
|
|
112
115
|
var readJson = (filePath) => {
|
|
113
116
|
const result = readJsonSafe(filePath);
|
|
114
|
-
if (result.kind === "ok") return result.value;
|
|
117
|
+
if (result.kind === "ok") return isRecord(result.value) ? result.value : null;
|
|
115
118
|
if (result.kind === "missing") return {};
|
|
116
119
|
return null;
|
|
117
120
|
};
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
permissionDeniedAction,
|
|
7
7
|
releaseThrottle,
|
|
8
8
|
reportEvent
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YCL2V5FD.js";
|
|
10
10
|
import {
|
|
11
11
|
machineDecisionFor,
|
|
12
12
|
shouldDeferToNativeMode,
|
|
13
13
|
wireVerdictFor
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-VBPASZU7.js";
|
|
15
15
|
|
|
16
16
|
// src/machine-decision-audit.ts
|
|
17
17
|
import { basename } from "path";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
defersToNativeMode,
|
|
3
3
|
reportMachineDenial
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-G4TV5GYU.js";
|
|
5
5
|
import {
|
|
6
6
|
isGatingMoment,
|
|
7
7
|
recordKeylessMoment
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-UKCRTTKF.js";
|
|
9
9
|
import {
|
|
10
10
|
announceSubscriptionRequired,
|
|
11
11
|
denyReasonFrom,
|
|
12
12
|
isDeferAnswer,
|
|
13
13
|
oncePerSession
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-PCVAK67W.js";
|
|
15
15
|
import {
|
|
16
16
|
activeHookSource,
|
|
17
17
|
activeIdentity
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-BDL6GJOQ.js";
|
|
19
19
|
import {
|
|
20
20
|
DEFAULT_SESSION,
|
|
21
21
|
UNNAMED_ACTION,
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
reportEvent,
|
|
41
41
|
scopePathFor,
|
|
42
42
|
settleQuestionsForToolUse
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-YCL2V5FD.js";
|
|
44
44
|
import {
|
|
45
45
|
askUser,
|
|
46
46
|
cancelQuestion,
|
|
@@ -52,20 +52,20 @@ import {
|
|
|
52
52
|
sendNotification,
|
|
53
53
|
waitForQuestion,
|
|
54
54
|
waitsForThePhone
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-Y2BOLNJV.js";
|
|
56
56
|
import {
|
|
57
57
|
SubscriptionRequiredError
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-ZNAGS7O7.js";
|
|
59
59
|
import {
|
|
60
60
|
getMachineId
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-NBGJ3EOE.js";
|
|
62
62
|
import {
|
|
63
63
|
getApiKey,
|
|
64
64
|
getBaseUrl
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-4WHNRAOK.js";
|
|
66
66
|
import {
|
|
67
67
|
NPX_LATEST_COMMAND
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-B6KZME5D.js";
|
|
69
69
|
import {
|
|
70
70
|
AGENT_QUESTION_STRATEGY,
|
|
71
71
|
DECISION_STOP_REASON,
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
parseAgentQuestions,
|
|
105
105
|
questionHandedToTheTerminal,
|
|
106
106
|
resolveGate
|
|
107
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-VBPASZU7.js";
|
|
108
108
|
|
|
109
109
|
// src/claude-permission-rules.ts
|
|
110
110
|
import { readFileSync, statSync } from "fs";
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
findExportedKeyLine,
|
|
3
|
+
isAdoptedMacAppKey,
|
|
3
4
|
keyPrefix,
|
|
4
5
|
readConfigFileKey,
|
|
5
6
|
readMacAppKeyPrefix
|
|
6
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FH4O3QGQ.js";
|
|
7
8
|
import {
|
|
8
9
|
NPX_LATEST_COMMAND
|
|
9
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-B6KZME5D.js";
|
|
10
11
|
|
|
11
12
|
// src/key-signed-out.ts
|
|
12
13
|
var VERDICT_BY_CHECK = {
|
|
@@ -18,15 +19,14 @@ var VERDICT_BY_CHECK = {
|
|
|
18
19
|
};
|
|
19
20
|
var activeKeyVerdictOf = (check) => check === null ? "unchecked" : VERDICT_BY_CHECK[check.kind];
|
|
20
21
|
var NOT_SIGNED_OUT = { kind: "none" };
|
|
21
|
-
var isMacAppKey = (key, macAppKeyPrefix) => keyPrefix(key) === macAppKeyPrefix;
|
|
22
22
|
var diagnoseSignedOutKey = (evidence) => {
|
|
23
23
|
const adopted = evidence.macAppKeyPrefix;
|
|
24
24
|
if (evidence.configKey !== null || adopted === null) return NOT_SIGNED_OUT;
|
|
25
25
|
if (evidence.activeKey !== null) {
|
|
26
|
-
if (!
|
|
26
|
+
if (!isAdoptedMacAppKey(evidence.activeKey, adopted) || evidence.activeKeyVerdict === "accepted") return NOT_SIGNED_OUT;
|
|
27
27
|
}
|
|
28
28
|
const exported = evidence.exportedKey;
|
|
29
|
-
return { kind: "signed_out_on_mac", deadExport: exported &&
|
|
29
|
+
return { kind: "signed_out_on_mac", deadExport: exported && isAdoptedMacAppKey(exported.key, adopted) ? exported : null };
|
|
30
30
|
};
|
|
31
31
|
var SIGNED_OUT_ON_MAC_MESSAGE = "This computer used the key the Pushary Mac app signed in with, and it was signed out on this Mac, so it no longer works here.";
|
|
32
32
|
var describeSignedOutKey = (diagnosis) => [
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-CEF4UQ3X.js";
|
|
4
4
|
import {
|
|
5
5
|
readJsonSafe,
|
|
6
6
|
writeFileAtomic
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-AQFEP65J.js";
|
|
8
8
|
import {
|
|
9
9
|
DECLINED_AGENTS_FILE,
|
|
10
10
|
DISCONNECT_AGENT_IDS,
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
serializeDeclinedAgents,
|
|
14
14
|
withDeclinedAgent,
|
|
15
15
|
withoutDeclinedAgent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-VBPASZU7.js";
|
|
17
17
|
|
|
18
18
|
// src/declined-agents-file.ts
|
|
19
19
|
import { join } from "path";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
registerTranscript
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-TJ4KMPYO.js";
|
|
4
4
|
import {
|
|
5
5
|
namedEvent
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BDL6GJOQ.js";
|
|
7
7
|
import {
|
|
8
8
|
writeDegraded
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Y2BOLNJV.js";
|
|
10
10
|
import {
|
|
11
11
|
claudeShapedHookInput,
|
|
12
12
|
hookCompatibleProfileBySource
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-VBPASZU7.js";
|
|
14
14
|
|
|
15
15
|
// src/tool-hook-input.ts
|
|
16
16
|
var OPTIONAL_TEXT_FIELDS = ["hook_event_name", "session_id", "cwd", "transcript_path", "tool_use_id", "permission_mode"];
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Z5EYCMJH.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-L5NPRGVE.js";
|
|
14
14
|
import {
|
|
15
15
|
readControlMode,
|
|
16
16
|
readKeySource
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-FH4O3QGQ.js";
|
|
18
18
|
import {
|
|
19
19
|
getMachineId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-NBGJ3EOE.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4WHNRAOK.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-VBPASZU7.js";
|
|
27
27
|
|
|
28
28
|
// src/machines.ts
|
|
29
29
|
import { hostname } from "os";
|
|
@@ -4,30 +4,31 @@ import {
|
|
|
4
4
|
} from "./chunk-XHKBHWLX.js";
|
|
5
5
|
import {
|
|
6
6
|
readControlMode
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-FH4O3QGQ.js";
|
|
8
8
|
import {
|
|
9
9
|
getMachineId
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NBGJ3EOE.js";
|
|
11
11
|
import {
|
|
12
12
|
pusharyDir,
|
|
13
13
|
resolveGlobalBinary
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-CEF4UQ3X.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
18
18
|
writeJsonAtomic,
|
|
19
19
|
writeJsonAtomicDurable
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-AQFEP65J.js";
|
|
21
21
|
import {
|
|
22
22
|
getApiKey
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-4WHNRAOK.js";
|
|
24
24
|
import {
|
|
25
25
|
CLI_PACKAGE_NAMES,
|
|
26
26
|
cmdShimTarget,
|
|
27
27
|
getPackageVersion,
|
|
28
28
|
globalPackageFolder,
|
|
29
|
-
globalRootFor
|
|
30
|
-
|
|
29
|
+
globalRootFor,
|
|
30
|
+
isRecord
|
|
31
|
+
} from "./chunk-VBPASZU7.js";
|
|
31
32
|
|
|
32
33
|
// src/daemon-lifecycle.ts
|
|
33
34
|
import { dirname, join, win32 as win32Path } from "path";
|
|
@@ -615,7 +616,7 @@ var acquireDaemonLease = (options = {}) => {
|
|
|
615
616
|
let currentState = state;
|
|
616
617
|
const isOwner = () => {
|
|
617
618
|
const owner = readJsonSafe(lockPath(dir));
|
|
618
|
-
return owner.kind === "ok" && owner.value.instanceId === instanceId;
|
|
619
|
+
return owner.kind === "ok" && isRecord(owner.value) && owner.value.instanceId === instanceId;
|
|
619
620
|
};
|
|
620
621
|
const updateState = (next) => {
|
|
621
622
|
if (!isOwner()) return;
|
|
@@ -659,7 +660,7 @@ var acquireDaemonLease = (options = {}) => {
|
|
|
659
660
|
shouldYield: () => {
|
|
660
661
|
if (!isOwner()) return true;
|
|
661
662
|
const target = readJsonSafe(targetPath(dir));
|
|
662
|
-
return target.kind === "ok" && (typeof target.value.version === "string" && target.value.version !== installedVersion || isTimestamp(target.value.requestedAt) && Date.parse(target.value.requestedAt) > Date.parse(startedAt));
|
|
663
|
+
return target.kind === "ok" && isRecord(target.value) && (typeof target.value.version === "string" && target.value.version !== installedVersion || isTimestamp(target.value.requestedAt) && Date.parse(target.value.requestedAt) > Date.parse(startedAt));
|
|
663
664
|
},
|
|
664
665
|
release: () => {
|
|
665
666
|
if (!isOwner()) return;
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
decodePublicKey,
|
|
4
4
|
generateSessionKey,
|
|
5
5
|
wrapSessionKey
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6WINXCXY.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchTranscriptRecipients,
|
|
9
9
|
uploadTranscriptRecords
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-IM7EGZVH.js";
|
|
11
11
|
|
|
12
12
|
// src/live-session.ts
|
|
13
13
|
var MAX_TRANSCRIPT_QUEUE = 100;
|
|
@@ -20,7 +20,7 @@ var revokeAgentKey = async (apiKey, baseUrl, fetchImpl) => {
|
|
|
20
20
|
});
|
|
21
21
|
if (!response.ok) return { kind: "refused", status: response.status };
|
|
22
22
|
const revoked = await readRevokedCount(response);
|
|
23
|
-
if (revoked === null) return { kind: "
|
|
23
|
+
if (revoked === null) return { kind: "unconfirmed", status: response.status };
|
|
24
24
|
return revoked > 0 ? { kind: "revoked" } : { kind: "not_accepted" };
|
|
25
25
|
};
|
|
26
26
|
var revokeOwnKey = async (apiKey, baseUrl, fetchImpl = fetch) => {
|
|
@@ -42,10 +42,11 @@ var REVOKE_DETAIL = {
|
|
|
42
42
|
revoked: "Revoked the key on pushary.com.",
|
|
43
43
|
not_accepted: "pushary.com had already stopped accepting the key.",
|
|
44
44
|
refused: "pushary.com refused to revoke the key",
|
|
45
|
+
unconfirmed: "pushary.com did not confirm the key was revoked",
|
|
45
46
|
unreachable: "Could not reach pushary.com to revoke the key"
|
|
46
47
|
};
|
|
47
48
|
var describeRevokeAttempt = (attempt) => {
|
|
48
|
-
if (attempt.kind === "refused") return `${REVOKE_DETAIL.
|
|
49
|
+
if (attempt.kind === "refused" || attempt.kind === "unconfirmed") return `${REVOKE_DETAIL[attempt.kind]} (HTTP ${attempt.status}).`;
|
|
49
50
|
if (attempt.kind === "unreachable") return `${REVOKE_DETAIL.unreachable}: ${attempt.detail}`;
|
|
50
51
|
return REVOKE_DETAIL[attempt.kind];
|
|
51
52
|
};
|