pushary 1.9.42 → 1.9.44
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 +9 -0
- package/README.md +1 -0
- package/data/SKILL.md +7 -1
- package/data/cowork/SKILL.md +3 -1
- package/data/cursor-plugin/.cursor-plugin/plugin.json +1 -1
- package/data/cursor-plugin/skills/pushary/SKILL.md +6 -0
- package/data/vscode-plugin/skills/pushary/SKILL.md +6 -0
- package/dist/bin/pushary-bell-hook.js +27 -26
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-claude.js +30 -28
- package/dist/bin/pushary-clean.js +39 -38
- package/dist/bin/pushary-codex-bridge.js +38 -28
- package/dist/bin/pushary-codex-hook.js +35 -33
- package/dist/bin/pushary-codex-session.d.ts +1 -0
- package/dist/bin/pushary-codex-session.js +253 -0
- package/dist/bin/pushary-codex.js +13 -12
- package/dist/bin/pushary-connect.js +28 -27
- package/dist/bin/pushary-cowork.js +6 -6
- package/dist/bin/pushary-daemon.js +48 -47
- package/dist/bin/pushary-disconnect.js +27 -26
- package/dist/bin/pushary-doctor.js +85 -82
- package/dist/bin/pushary-elicitation-hook.js +27 -26
- package/dist/bin/pushary-gemini-bridge.js +22 -22
- package/dist/bin/pushary-gemini-hook.js +32 -30
- package/dist/bin/pushary-hook.js +33 -32
- package/dist/bin/pushary-login.js +16 -16
- package/dist/bin/pushary-logout.js +28 -27
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +14 -14
- package/dist/bin/pushary-notification-hook.js +26 -25
- package/dist/bin/pushary-opencode-hook.js +31 -29
- package/dist/bin/pushary-permission-denied-hook.js +31 -30
- package/dist/bin/pushary-permission-hook.js +30 -29
- package/dist/bin/pushary-post-hook.js +26 -25
- package/dist/bin/pushary-prompt-hook.js +26 -25
- package/dist/bin/pushary-session-end-hook.js +26 -25
- package/dist/bin/pushary-session-start-hook.js +31 -30
- package/dist/bin/pushary-setup.js +165 -112
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +35 -34
- package/dist/bin/pushary-stop-hook.js +26 -25
- package/dist/bin/pushary-stopfailure-hook.js +26 -25
- package/dist/bin/pushary-suggestions.js +14 -14
- package/dist/bin/pushary-transcript-register.js +18 -18
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +41 -40
- package/dist/bin/pushary-wait.js +14 -14
- package/dist/bin/pushary.js +7 -6
- package/dist/{chunk-ZX3PFROQ.js → chunk-2NVXFWQY.js} +1 -1
- package/dist/{chunk-7L6YSHZO.js → chunk-3IRC3XFG.js} +2 -2
- package/dist/{chunk-IXNVIWNN.js → chunk-42CVAOC5.js} +2 -2
- package/dist/{chunk-EBZK2SJ2.js → chunk-4JHEZ2PV.js} +12 -5
- package/dist/{chunk-JBK47Y2M.js → chunk-4WBAHVBK.js} +11 -11
- package/dist/{chunk-AW4TDBUJ.js → chunk-53UZN7JW.js} +3 -3
- package/dist/{chunk-I7EZMNKI.js → chunk-5ZSBQHCM.js} +12 -173
- package/dist/{chunk-KYFWYPHN.js → chunk-6EV3B5CD.js} +1 -1
- package/dist/{chunk-X7TNLYNZ.js → chunk-75M7NFFC.js} +1 -1
- package/dist/{chunk-AUDM6HU6.js → chunk-7UM4NCUI.js} +2 -2
- package/dist/{chunk-5INZFKHL.js → chunk-ALY7ZBNB.js} +1 -1
- package/dist/{chunk-CGRVIUKE.js → chunk-BKK3JCTD.js} +80 -164
- package/dist/{chunk-K2SSNAUW.js → chunk-CAJCCQ7N.js} +1 -1
- package/dist/{chunk-B7PZBWBU.js → chunk-CESLE4UN.js} +10 -10
- package/dist/{chunk-MI67QQEQ.js → chunk-CEZTYTBN.js} +13 -11
- package/dist/{chunk-6PABNQVH.js → chunk-DD6IBKEJ.js} +4 -4
- package/dist/{chunk-Z4RM54LU.js → chunk-E76QCZIA.js} +2 -2
- package/dist/{chunk-RBUCXUT7.js → chunk-FI2F5KZJ.js} +4 -4
- package/dist/{chunk-IVUP2EE4.js → chunk-FKDZU6YX.js} +4 -4
- package/dist/{chunk-EA5NWDK7.js → chunk-FYNMFSIZ.js} +29 -0
- package/dist/{chunk-M2YE3OEC.js → chunk-GBCR2FH2.js} +3 -3
- package/dist/chunk-GOEIW2VH.js +266 -0
- package/dist/{chunk-JQX2L3ES.js → chunk-GRAPJKDK.js} +1 -1
- package/dist/{chunk-DPISXMLL.js → chunk-HV4TEKNP.js} +4 -4
- package/dist/{chunk-FMYXPJYS.js → chunk-IWHDNMM3.js} +5 -5
- package/dist/{chunk-ORLTWJ2O.js → chunk-JNU3LV47.js} +355 -138
- package/dist/{chunk-ZJY4KON3.js → chunk-KILK6SWZ.js} +7 -7
- package/dist/{chunk-J7OBJZ5S.js → chunk-KYLY6UMN.js} +1 -1
- package/dist/{chunk-T3Q4B6WV.js → chunk-L2ZM7LXN.js} +2 -2
- package/dist/{chunk-PJ3C6IID.js → chunk-LEHBWBCG.js} +4 -4
- package/dist/{chunk-ODPULZZG.js → chunk-M2L7625S.js} +2 -2
- package/dist/{chunk-BDSIE2MT.js → chunk-MIBCRQWK.js} +2 -2
- package/dist/{chunk-MAB6CGL5.js → chunk-MRQJCIFO.js} +1 -1
- package/dist/{chunk-F43LAKAK.js → chunk-OR6KJOHE.js} +2 -2
- package/dist/{chunk-Y3HTWB5S.js → chunk-OSMNLNPF.js} +1 -1
- package/dist/{chunk-CHD6IUNM.js → chunk-OWQOMGBF.js} +1 -1
- package/dist/{chunk-RTM5GVRZ.js → chunk-OZ7MLVDM.js} +15 -15
- package/dist/{chunk-4WM7IVVQ.js → chunk-PGHN5D4N.js} +2 -2
- package/dist/{chunk-OLLWYLQX.js → chunk-PQAFH4DF.js} +3 -11
- package/dist/{chunk-E47JEBUR.js → chunk-RGBTKOCC.js} +45 -8
- package/dist/{chunk-4UCTKLHY.js → chunk-S2ALW446.js} +3 -3
- package/dist/{chunk-3U3FU6ZX.js → chunk-SI2NC6UU.js} +3 -3
- package/dist/chunk-SVCT5D7K.js +196 -0
- package/dist/{chunk-ZVMFRUBD.js → chunk-SWDPCDLT.js} +4 -4
- package/dist/{chunk-DIJ532S7.js → chunk-T3KMJI4W.js} +2 -1
- package/dist/{chunk-NRSTNZYJ.js → chunk-T4CKP47U.js} +5 -5
- package/dist/{chunk-M7VKFAAK.js → chunk-TJZUQRMH.js} +3 -3
- package/dist/{chunk-ZV56INA6.js → chunk-TKTS3SIM.js} +3 -3
- package/dist/{chunk-RETRVO47.js → chunk-TWATOPHK.js} +2 -2
- package/dist/{chunk-WZNRDDC4.js → chunk-UC4PNLMK.js} +6 -6
- package/dist/{chunk-ASXBYX2N.js → chunk-UJXLVH66.js} +1 -1
- package/dist/{chunk-Q3QRD67J.js → chunk-UY5E2UUW.js} +5 -5
- package/dist/{chunk-FP2ZJK3T.js → chunk-UZVF6MP2.js} +5 -5
- package/dist/{chunk-STETTN4K.js → chunk-W2TA4EVZ.js} +5 -5
- package/dist/{chunk-QRNNIDGY.js → chunk-WBD7HZEZ.js} +1 -1
- package/dist/{chunk-QPT4PTUG.js → chunk-WMO2XVG4.js} +1 -1
- package/dist/{chunk-BZIXDIIT.js → chunk-XPQDBTW4.js} +1 -1
- package/dist/{global-upgrade-YEAGJG4G.js → global-upgrade-QSSDYZCZ.js} +6 -6
- package/dist/{paths-HQAICWAF.js → paths-55DDFLY4.js} +2 -2
- package/dist/{reapply-XBEB2B5A.js → reapply-MEU66ALO.js} +23 -22
- package/dist/src/index.js +20 -19
- package/dist/{upgrade-lock-GIO5QZ7E.js → upgrade-lock-YLXAU4AD.js} +3 -3
- package/package.json +5 -2
|
@@ -2,34 +2,37 @@ import {
|
|
|
2
2
|
IDLE_PROMPT_NOTIFICATION,
|
|
3
3
|
NOTIFICATION_PUSH_TYPES,
|
|
4
4
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CAJCCQ7N.js";
|
|
6
6
|
import {
|
|
7
7
|
cancelQuestion,
|
|
8
|
-
clientErrorKindOf,
|
|
9
|
-
isPolicyConfig,
|
|
10
|
-
reportClientError,
|
|
11
8
|
sendNotification,
|
|
12
9
|
waitForAnswer
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-5ZSBQHCM.js";
|
|
11
|
+
import {
|
|
12
|
+
reportedInstallSource
|
|
13
|
+
} from "./chunk-M2L7625S.js";
|
|
14
|
+
import {
|
|
15
|
+
clientErrorKindOf,
|
|
16
|
+
isPolicyConfig,
|
|
17
|
+
repoKeyFor,
|
|
18
|
+
reportClientError
|
|
19
|
+
} from "./chunk-GOEIW2VH.js";
|
|
14
20
|
import {
|
|
15
21
|
withRetry
|
|
16
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-53UZN7JW.js";
|
|
17
23
|
import {
|
|
18
24
|
getMachineId
|
|
19
|
-
} from "./chunk-
|
|
20
|
-
import {
|
|
21
|
-
reportedInstallSource
|
|
22
|
-
} from "./chunk-ODPULZZG.js";
|
|
25
|
+
} from "./chunk-WMO2XVG4.js";
|
|
23
26
|
import {
|
|
24
27
|
canonicalJson
|
|
25
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-4JHEZ2PV.js";
|
|
26
29
|
import {
|
|
27
30
|
writeFileAtomic
|
|
28
31
|
} from "./chunk-AQFEP65J.js";
|
|
29
32
|
import {
|
|
30
33
|
getApiKey,
|
|
31
34
|
getBaseUrl
|
|
32
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-OWQOMGBF.js";
|
|
33
36
|
import {
|
|
34
37
|
ACTION_BODY_MAX,
|
|
35
38
|
AGENTS,
|
|
@@ -51,9 +54,7 @@ import {
|
|
|
51
54
|
hookCompatibleProfileBySource,
|
|
52
55
|
isAutoApprove,
|
|
53
56
|
isTokenCount,
|
|
54
|
-
localRepoKey,
|
|
55
57
|
modeStateFromResponse,
|
|
56
|
-
normalizeRepoRemote,
|
|
57
58
|
parseMcpToolName,
|
|
58
59
|
pendingCommandEvents,
|
|
59
60
|
redactSecrets,
|
|
@@ -64,7 +65,7 @@ import {
|
|
|
64
65
|
toToolLookup,
|
|
65
66
|
truncateLine,
|
|
66
67
|
unansweredRefusalReason
|
|
67
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-JNU3LV47.js";
|
|
68
69
|
|
|
69
70
|
// ../hook-mapping/src/describe.ts
|
|
70
71
|
import { isAbsolute, relative, resolve } from "path";
|
|
@@ -1008,94 +1009,10 @@ var removePendingSession = (sessionId) => {
|
|
|
1008
1009
|
}
|
|
1009
1010
|
};
|
|
1010
1011
|
|
|
1011
|
-
// src/repo.ts
|
|
1012
|
-
import { existsSync as existsSync2, readFileSync as readFileSync2, statSync as statSync2 } from "fs";
|
|
1013
|
-
import { basename as basename2, dirname, isAbsolute as isAbsolute2, join as join2, resolve as resolve2 } from "path";
|
|
1014
|
-
var MAX_PARENT_WALK = 64;
|
|
1015
|
-
var GIT_FILE_PREFIX = "gitdir:";
|
|
1016
|
-
var findGitDir = (startDir) => {
|
|
1017
|
-
let current = resolve2(startDir);
|
|
1018
|
-
for (let depth = 0; depth < MAX_PARENT_WALK; depth += 1) {
|
|
1019
|
-
const candidate = join2(current, ".git");
|
|
1020
|
-
try {
|
|
1021
|
-
if (existsSync2(candidate)) {
|
|
1022
|
-
if (statSync2(candidate).isDirectory()) return candidate;
|
|
1023
|
-
const pointer = readFileSync2(candidate, "utf-8").trim();
|
|
1024
|
-
if (pointer.startsWith(GIT_FILE_PREFIX)) {
|
|
1025
|
-
const target = pointer.slice(GIT_FILE_PREFIX.length).trim();
|
|
1026
|
-
return isAbsolute2(target) ? target : resolve2(current, target);
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
} catch {
|
|
1030
|
-
}
|
|
1031
|
-
const parent = dirname(current);
|
|
1032
|
-
if (parent === current) return void 0;
|
|
1033
|
-
current = parent;
|
|
1034
|
-
}
|
|
1035
|
-
return void 0;
|
|
1036
|
-
};
|
|
1037
|
-
var configPathFor = (gitDir) => {
|
|
1038
|
-
const index = gitDir.replace(/\\/g, "/").indexOf("/worktrees/");
|
|
1039
|
-
return index === -1 ? join2(gitDir, "config") : join2(gitDir.slice(0, index), "config");
|
|
1040
|
-
};
|
|
1041
|
-
var ORIGIN_SECTION = /^\[remote "origin"\]/;
|
|
1042
|
-
var SECTION_HEADER = /^\[/;
|
|
1043
|
-
var URL_LINE = /^url\s*=\s*(.+)$/;
|
|
1044
|
-
var readOriginRemote = (gitDir) => {
|
|
1045
|
-
try {
|
|
1046
|
-
const configPath = configPathFor(gitDir);
|
|
1047
|
-
if (!existsSync2(configPath)) return void 0;
|
|
1048
|
-
let inOrigin = false;
|
|
1049
|
-
for (const rawLine of readFileSync2(configPath, "utf-8").split("\n")) {
|
|
1050
|
-
const line = rawLine.trim();
|
|
1051
|
-
if (SECTION_HEADER.test(line)) {
|
|
1052
|
-
inOrigin = ORIGIN_SECTION.test(line);
|
|
1053
|
-
continue;
|
|
1054
|
-
}
|
|
1055
|
-
if (!inOrigin) continue;
|
|
1056
|
-
const url = URL_LINE.exec(line);
|
|
1057
|
-
if (url) return url[1]?.trim();
|
|
1058
|
-
}
|
|
1059
|
-
} catch {
|
|
1060
|
-
}
|
|
1061
|
-
return void 0;
|
|
1062
|
-
};
|
|
1063
|
-
var deriveRepoKey = (cwd) => {
|
|
1064
|
-
const dir = cwd && cwd.length > 0 ? cwd : process.cwd();
|
|
1065
|
-
try {
|
|
1066
|
-
const gitDir = findGitDir(dir);
|
|
1067
|
-
if (gitDir) {
|
|
1068
|
-
const remote = readOriginRemote(gitDir);
|
|
1069
|
-
const normalized = remote ? normalizeRepoRemote(remote) : void 0;
|
|
1070
|
-
if (normalized) return normalized;
|
|
1071
|
-
const root = gitDir.endsWith(".git") ? dirname(gitDir) : dir;
|
|
1072
|
-
return localRepoKey(basename2(root));
|
|
1073
|
-
}
|
|
1074
|
-
return localRepoKey(basename2(resolve2(dir)));
|
|
1075
|
-
} catch {
|
|
1076
|
-
return void 0;
|
|
1077
|
-
}
|
|
1078
|
-
};
|
|
1079
|
-
var repoKeyCache = /* @__PURE__ */ new Map();
|
|
1080
|
-
var REPO_KEY_ENV = "PUSHARY_REPO_KEY";
|
|
1081
|
-
var repoKeyFor = (cwd) => {
|
|
1082
|
-
const override = process.env[REPO_KEY_ENV];
|
|
1083
|
-
if (typeof override === "string") {
|
|
1084
|
-
const trimmed = override.trim();
|
|
1085
|
-
if (trimmed.toLowerCase() === "off") return void 0;
|
|
1086
|
-
if (trimmed.length > 0) return trimmed.toLowerCase();
|
|
1087
|
-
}
|
|
1088
|
-
const dir = cwd && cwd.length > 0 ? cwd : process.cwd();
|
|
1089
|
-
if (repoKeyCache.has(dir)) return repoKeyCache.get(dir);
|
|
1090
|
-
const derived = deriveRepoKey(dir);
|
|
1091
|
-
repoKeyCache.set(dir, derived);
|
|
1092
|
-
return derived;
|
|
1093
|
-
};
|
|
1094
|
-
|
|
1095
1012
|
// src/policy.ts
|
|
1096
1013
|
import { createHash as createHash2 } from "crypto";
|
|
1097
|
-
import { existsSync as
|
|
1098
|
-
import { join as
|
|
1014
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
1015
|
+
import { join as join2 } from "path";
|
|
1099
1016
|
import { tmpdir as tmpdir2 } from "os";
|
|
1100
1017
|
var CACHE_TTL_MS = 60 * 1e3;
|
|
1101
1018
|
var STALE_CACHE_MAX_MS = 12 * 60 * 60 * 1e3;
|
|
@@ -1106,7 +1023,7 @@ var policyRequestFor = (agentType) => ({
|
|
|
1106
1023
|
var policyCacheFile = (apiKey, agent, repoAware = false) => {
|
|
1107
1024
|
const parts = [apiKey, agent, repoAware ? "repoAware" : void 0, "sessionToolAware"].filter(Boolean);
|
|
1108
1025
|
const hash = createHash2("sha256").update(parts.join(":")).digest("hex").slice(0, 12);
|
|
1109
|
-
return
|
|
1026
|
+
return join2(tmpdir2(), `pushary-policy-${hash}.json`);
|
|
1110
1027
|
};
|
|
1111
1028
|
var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId) => {
|
|
1112
1029
|
return withRetry(async () => {
|
|
@@ -1134,9 +1051,9 @@ var fetchPolicy = async (apiKey, agent, repoAware = false, sessionId) => {
|
|
|
1134
1051
|
var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessionId) => {
|
|
1135
1052
|
const path = policyCacheFile(apiKey, agent, repoAware);
|
|
1136
1053
|
let staleCache = null;
|
|
1137
|
-
if (
|
|
1054
|
+
if (existsSync2(path)) {
|
|
1138
1055
|
try {
|
|
1139
|
-
const stat =
|
|
1056
|
+
const stat = readFileSync2(path, "utf-8");
|
|
1140
1057
|
const cached = JSON.parse(stat);
|
|
1141
1058
|
if (!isPolicyConfig(cached)) throw new Error("Corrupted cache");
|
|
1142
1059
|
const versionStale = expectedVersion != null && (cached._policyVersion ?? null) !== expectedVersion;
|
|
@@ -1165,13 +1082,13 @@ var getPolicy = async (apiKey, expectedVersion, agent, repoAware = false, sessio
|
|
|
1165
1082
|
var MODE_GRACE_MS = 60 * 1e3;
|
|
1166
1083
|
var modeStateCacheFile = (apiKey) => {
|
|
1167
1084
|
const hash = createHash2("sha256").update(`mode:${apiKey}`).digest("hex").slice(0, 12);
|
|
1168
|
-
return
|
|
1085
|
+
return join2(tmpdir2(), `pushary-mode-${hash}.json`);
|
|
1169
1086
|
};
|
|
1170
1087
|
var readLastGoodMode = (apiKey) => {
|
|
1171
1088
|
try {
|
|
1172
1089
|
const path = modeStateCacheFile(apiKey);
|
|
1173
|
-
if (!
|
|
1174
|
-
const parsed = JSON.parse(
|
|
1090
|
+
if (!existsSync2(path)) return null;
|
|
1091
|
+
const parsed = JSON.parse(readFileSync2(path, "utf-8"));
|
|
1175
1092
|
if (!parsed || typeof parsed.at !== "number" || !parsed.state) return null;
|
|
1176
1093
|
return parsed;
|
|
1177
1094
|
} catch {
|
|
@@ -1236,9 +1153,9 @@ var fetchModeState = async (apiKey, sessionId, reuseWithinMs = 0, signal) => {
|
|
|
1236
1153
|
var fetchModeOverride = async (apiKey) => (await fetchModeState(apiKey)).mode;
|
|
1237
1154
|
|
|
1238
1155
|
// src/usage.ts
|
|
1239
|
-
import { closeSync, mkdirSync as mkdirSync2, openSync, readFileSync as
|
|
1156
|
+
import { closeSync, mkdirSync as mkdirSync2, openSync, readFileSync as readFileSync3, readSync, statSync as statSync2, writeFileSync as writeFileSync3 } from "fs";
|
|
1240
1157
|
import { createHash as createHash3 } from "crypto";
|
|
1241
|
-
import { join as
|
|
1158
|
+
import { join as join3 } from "path";
|
|
1242
1159
|
import { tmpdir as tmpdir3 } from "os";
|
|
1243
1160
|
var READ_CHUNK_BYTES = 1024 * 1024;
|
|
1244
1161
|
var priceTable = () => {
|
|
@@ -1252,12 +1169,12 @@ var priceTable = () => {
|
|
|
1252
1169
|
return DEFAULT_MODEL_PRICES;
|
|
1253
1170
|
};
|
|
1254
1171
|
var estimateCostUsd = (usage, model) => estimateMessageCostUsd(usage, model, priceTable());
|
|
1255
|
-
var stateDir = () => process.env.PUSHARY_USAGE_DIR?.trim() ||
|
|
1256
|
-
var stateFile = (sessionId) =>
|
|
1172
|
+
var stateDir = () => process.env.PUSHARY_USAGE_DIR?.trim() || join3(tmpdir3(), "pushary-usage");
|
|
1173
|
+
var stateFile = (sessionId) => join3(stateDir(), sessionId.replace(/[^a-zA-Z0-9_-]/g, "_"));
|
|
1257
1174
|
var emptyState = () => ({ offset: 0, tokensIn: 0, tokensOut: 0, costUsd: 0, recentIds: [] });
|
|
1258
1175
|
var readState = (path) => {
|
|
1259
1176
|
try {
|
|
1260
|
-
const parsed = JSON.parse(
|
|
1177
|
+
const parsed = JSON.parse(readFileSync3(path, "utf-8"));
|
|
1261
1178
|
if (typeof parsed.offset === "number" && parsed.offset >= 0 && typeof parsed.tokensIn === "number" && typeof parsed.tokensOut === "number" && typeof parsed.costUsd === "number" && Array.isArray(parsed.recentIds)) {
|
|
1262
1179
|
return {
|
|
1263
1180
|
offset: parsed.offset,
|
|
@@ -1313,7 +1230,7 @@ var extractUserText = (content) => {
|
|
|
1313
1230
|
};
|
|
1314
1231
|
var readLastUserPrompt = (transcriptPath) => {
|
|
1315
1232
|
try {
|
|
1316
|
-
const size =
|
|
1233
|
+
const size = statSync2(transcriptPath).size;
|
|
1317
1234
|
const start = Math.max(0, size - USER_PROMPT_TAIL_BYTES);
|
|
1318
1235
|
const lines = readRange(transcriptPath, start, size).toString("utf-8").split("\n");
|
|
1319
1236
|
for (let i = lines.length - 1; i >= 0; i -= 1) {
|
|
@@ -1336,7 +1253,7 @@ var readLastUserPrompt = (transcriptPath) => {
|
|
|
1336
1253
|
};
|
|
1337
1254
|
var readNewUsage = (transcriptPath, sessionId) => {
|
|
1338
1255
|
try {
|
|
1339
|
-
const file =
|
|
1256
|
+
const file = statSync2(transcriptPath);
|
|
1340
1257
|
const size = file.size;
|
|
1341
1258
|
const path = stateFile(sessionId);
|
|
1342
1259
|
let state = readState(path);
|
|
@@ -1381,7 +1298,7 @@ var readNewUsage = (transcriptPath, sessionId) => {
|
|
|
1381
1298
|
};
|
|
1382
1299
|
|
|
1383
1300
|
// src/codex-adapter.ts
|
|
1384
|
-
import { resolve as
|
|
1301
|
+
import { resolve as resolve2 } from "path";
|
|
1385
1302
|
var CODEX_AGENT = { type: "codex", label: "Codex" };
|
|
1386
1303
|
var codexAllow = () => ({ kind: "allow" });
|
|
1387
1304
|
var codexDeny = (reason) => ({ kind: "deny", reason });
|
|
@@ -1410,7 +1327,7 @@ var toPolicyLookup = (toolName, toolInput, cwd) => {
|
|
|
1410
1327
|
const command = toolInput.command;
|
|
1411
1328
|
const files = parseApplyPatchFiles(command);
|
|
1412
1329
|
if (files.length === 1) {
|
|
1413
|
-
return { tool: "Edit", input: { file_path: cwd ?
|
|
1330
|
+
return { tool: "Edit", input: { file_path: cwd ? resolve2(cwd, files[0]) : files[0] } };
|
|
1414
1331
|
}
|
|
1415
1332
|
return { tool: "Edit", input: typeof command === "string" ? { file_path: command } : {} };
|
|
1416
1333
|
};
|
|
@@ -1426,7 +1343,7 @@ var toPolicyLookups = (toolName, toolInput, cwd) => {
|
|
|
1426
1343
|
}
|
|
1427
1344
|
return {
|
|
1428
1345
|
tool: "Edit",
|
|
1429
|
-
inputs: files.map((file) => ({ file_path: cwd ?
|
|
1346
|
+
inputs: files.map((file) => ({ file_path: cwd ? resolve2(cwd, file) : file }))
|
|
1430
1347
|
};
|
|
1431
1348
|
};
|
|
1432
1349
|
var permissionTimeoutDecision = (timeoutAction, paused) => {
|
|
@@ -1437,9 +1354,9 @@ var permissionTimeoutDecision = (timeoutAction, paused) => {
|
|
|
1437
1354
|
|
|
1438
1355
|
// src/codex-call-decision.ts
|
|
1439
1356
|
import { createHash as createHash4 } from "crypto";
|
|
1440
|
-
import { existsSync as
|
|
1357
|
+
import { existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync4, readdirSync as readdirSync2, rmSync as rmSync2, statSync as statSync3, writeFileSync as writeFileSync4 } from "fs";
|
|
1441
1358
|
import { tmpdir as tmpdir4, userInfo } from "os";
|
|
1442
|
-
import { join as
|
|
1359
|
+
import { join as join4 } from "path";
|
|
1443
1360
|
var CODEX_DECISION_TTL_MS = 60 * 1e3;
|
|
1444
1361
|
var userScope = () => {
|
|
1445
1362
|
try {
|
|
@@ -1450,8 +1367,8 @@ var userScope = () => {
|
|
|
1450
1367
|
return "default";
|
|
1451
1368
|
}
|
|
1452
1369
|
};
|
|
1453
|
-
var decisionDir = () =>
|
|
1454
|
-
var decisionFile = (key) =>
|
|
1370
|
+
var decisionDir = () => join4(tmpdir4(), `pushary-codex-decisions-${userScope()}`);
|
|
1371
|
+
var decisionFile = (key) => join4(decisionDir(), key);
|
|
1455
1372
|
var PRESENTATION_ONLY_INPUT_KEYS = ["description"];
|
|
1456
1373
|
var identifyingToolInput = (toolInput) => {
|
|
1457
1374
|
if (!toolInput) return {};
|
|
@@ -1490,9 +1407,9 @@ var parseDecision = (raw) => {
|
|
|
1490
1407
|
var sweepExpired = (dir, nowMs) => {
|
|
1491
1408
|
try {
|
|
1492
1409
|
for (const name of readdirSync2(dir)) {
|
|
1493
|
-
const path =
|
|
1410
|
+
const path = join4(dir, name);
|
|
1494
1411
|
try {
|
|
1495
|
-
if (nowMs -
|
|
1412
|
+
if (nowMs - statSync3(path).mtimeMs >= CODEX_DECISION_TTL_MS) rmSync2(path, { force: true });
|
|
1496
1413
|
} catch {
|
|
1497
1414
|
continue;
|
|
1498
1415
|
}
|
|
@@ -1505,7 +1422,7 @@ var recordCodexCallDecision = (key, decision) => {
|
|
|
1505
1422
|
if (!key) return;
|
|
1506
1423
|
try {
|
|
1507
1424
|
const dir = decisionDir();
|
|
1508
|
-
if (!
|
|
1425
|
+
if (!existsSync3(dir)) mkdirSync3(dir, { recursive: true, mode: 448 });
|
|
1509
1426
|
else sweepExpired(dir, Date.now());
|
|
1510
1427
|
writeFileSync4(decisionFile(key), JSON.stringify(decision), { encoding: "utf-8", mode: 384 });
|
|
1511
1428
|
} catch {
|
|
@@ -1516,8 +1433,8 @@ var consumeCodexCallDecision = (key) => {
|
|
|
1516
1433
|
if (!key) return null;
|
|
1517
1434
|
const path = decisionFile(key);
|
|
1518
1435
|
try {
|
|
1519
|
-
const fresh = Date.now() -
|
|
1520
|
-
const raw =
|
|
1436
|
+
const fresh = Date.now() - statSync3(path).mtimeMs < CODEX_DECISION_TTL_MS;
|
|
1437
|
+
const raw = readFileSync4(path, "utf-8");
|
|
1521
1438
|
rmSync2(path, { force: true });
|
|
1522
1439
|
return fresh ? parseDecision(raw) : null;
|
|
1523
1440
|
} catch {
|
|
@@ -1535,16 +1452,16 @@ var phoneDrivenEnv = (base) => ({
|
|
|
1535
1452
|
});
|
|
1536
1453
|
|
|
1537
1454
|
// src/throttle.ts
|
|
1538
|
-
import { join as
|
|
1455
|
+
import { join as join5 } from "path";
|
|
1539
1456
|
import { tmpdir as tmpdir5 } from "os";
|
|
1540
1457
|
import { createHash as createHash5 } from "crypto";
|
|
1541
|
-
import { existsSync as
|
|
1542
|
-
var THROTTLE_DIR =
|
|
1543
|
-
var markerPath = (key) =>
|
|
1458
|
+
import { existsSync as existsSync4, mkdirSync as mkdirSync4, statSync as statSync4, writeFileSync as writeFileSync5, rmSync as rmSync3 } from "fs";
|
|
1459
|
+
var THROTTLE_DIR = join5(tmpdir5(), "pushary-throttle");
|
|
1460
|
+
var markerPath = (key) => join5(THROTTLE_DIR, createHash5("sha256").update(key).digest("hex").slice(0, 16));
|
|
1544
1461
|
var claimThrottle = (key, windowMs) => {
|
|
1545
1462
|
try {
|
|
1546
1463
|
const path = markerPath(key);
|
|
1547
|
-
if (
|
|
1464
|
+
if (existsSync4(path) && Date.now() - statSync4(path).mtimeMs < windowMs) return "throttled";
|
|
1548
1465
|
mkdirSync4(THROTTLE_DIR, { recursive: true });
|
|
1549
1466
|
writeFileSync5(path, "", "utf-8");
|
|
1550
1467
|
return "passed";
|
|
@@ -1558,9 +1475,9 @@ var releaseThrottle = (key) => {
|
|
|
1558
1475
|
|
|
1559
1476
|
// src/blocked-action-hint.ts
|
|
1560
1477
|
import { createHash as createHash6 } from "crypto";
|
|
1561
|
-
import { existsSync as
|
|
1478
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync5, readFileSync as readFileSync5, readdirSync as readdirSync3, rmSync as rmSync4, statSync as statSync5, utimesSync } from "fs";
|
|
1562
1479
|
import { tmpdir as tmpdir6 } from "os";
|
|
1563
|
-
import { join as
|
|
1480
|
+
import { join as join6 } from "path";
|
|
1564
1481
|
var BLOCKED_ACTION_HINT_TTL_MS = BLOCKED_ACTION_GRANT_TTL_SECONDS * 1e3;
|
|
1565
1482
|
var FINGERPRINT = /^[0-9a-f]{64}$/;
|
|
1566
1483
|
var isFingerprint = (value) => typeof value === "string" && FINGERPRINT.test(value);
|
|
@@ -1577,15 +1494,15 @@ var blockedActionFingerprint = ({ source = "claude", sessionId, toolName, toolIn
|
|
|
1577
1494
|
const subject = blockedActionSubject(source, sessionId, canonical.toolName, canonicalInput, cwd);
|
|
1578
1495
|
return subject ? createHash6("sha256").update(blockedActionIdentity(subject), "utf8").digest("hex") : null;
|
|
1579
1496
|
};
|
|
1580
|
-
var hintDir = () =>
|
|
1581
|
-
var hintFile = (fingerprint) =>
|
|
1497
|
+
var hintDir = () => join6(tmpdir6(), `pushary-blocked-action-hints-${userScope()}`);
|
|
1498
|
+
var hintFile = (fingerprint) => join6(hintDir(), fingerprint);
|
|
1582
1499
|
var isExpired = (mtimeMs, nowMs) => nowMs - mtimeMs >= BLOCKED_ACTION_HINT_TTL_MS;
|
|
1583
1500
|
var sweepExpired2 = (dir, nowMs) => {
|
|
1584
1501
|
try {
|
|
1585
1502
|
for (const name of readdirSync3(dir)) {
|
|
1586
|
-
const path =
|
|
1503
|
+
const path = join6(dir, name);
|
|
1587
1504
|
try {
|
|
1588
|
-
if (isExpired(
|
|
1505
|
+
if (isExpired(statSync5(path).mtimeMs, nowMs)) rmSync4(path, { force: true });
|
|
1589
1506
|
} catch {
|
|
1590
1507
|
continue;
|
|
1591
1508
|
}
|
|
@@ -1598,7 +1515,7 @@ var recordBlockedActionHint = (fingerprint, approved) => {
|
|
|
1598
1515
|
if (!isFingerprint(fingerprint)) return false;
|
|
1599
1516
|
try {
|
|
1600
1517
|
const dir = hintDir();
|
|
1601
|
-
if (!
|
|
1518
|
+
if (!existsSync5(dir)) mkdirSync5(dir, { recursive: true, mode: 448 });
|
|
1602
1519
|
else sweepExpired2(dir, Date.now());
|
|
1603
1520
|
writeFileAtomic(hintFile(fingerprint), JSON.stringify({ fingerprint, ...approved }), 384);
|
|
1604
1521
|
return true;
|
|
@@ -1609,13 +1526,13 @@ var recordBlockedActionHint = (fingerprint, approved) => {
|
|
|
1609
1526
|
var readLiveHint = (fingerprint) => {
|
|
1610
1527
|
const path = hintFile(fingerprint);
|
|
1611
1528
|
try {
|
|
1612
|
-
const stat =
|
|
1529
|
+
const stat = statSync5(path);
|
|
1613
1530
|
if (!stat.isFile()) return null;
|
|
1614
1531
|
if (isExpired(stat.mtimeMs, Date.now())) {
|
|
1615
1532
|
rmSync4(path, { force: true });
|
|
1616
1533
|
return null;
|
|
1617
1534
|
}
|
|
1618
|
-
const parsed = JSON.parse(
|
|
1535
|
+
const parsed = JSON.parse(readFileSync5(path, "utf-8"));
|
|
1619
1536
|
return parsed?.fingerprint === fingerprint ? parsed : null;
|
|
1620
1537
|
} catch {
|
|
1621
1538
|
return null;
|
|
@@ -1642,7 +1559,7 @@ var approvalAwaitingRetry = (sessionId) => {
|
|
|
1642
1559
|
var markApprovalReminded = (approval) => {
|
|
1643
1560
|
const path = hintFile(approval.fingerprint);
|
|
1644
1561
|
try {
|
|
1645
|
-
const { atime, mtime } =
|
|
1562
|
+
const { atime, mtime } = statSync5(path);
|
|
1646
1563
|
const { fingerprint, sessionId, toolName } = approval;
|
|
1647
1564
|
writeFileAtomic(path, JSON.stringify({ fingerprint, sessionId, toolName, reminded: true }), 384);
|
|
1648
1565
|
utimesSync(path, atime, mtime);
|
|
@@ -1661,12 +1578,12 @@ var forgetBlockedActionHint = (fingerprint) => {
|
|
|
1661
1578
|
|
|
1662
1579
|
// src/background-work.ts
|
|
1663
1580
|
import { createHash as createHash7 } from "crypto";
|
|
1664
|
-
import { mkdirSync as mkdirSync6, rmSync as rmSync5, statSync as
|
|
1581
|
+
import { mkdirSync as mkdirSync6, rmSync as rmSync5, statSync as statSync6, writeFileSync as writeFileSync6 } from "fs";
|
|
1665
1582
|
import { tmpdir as tmpdir7 } from "os";
|
|
1666
|
-
import { join as
|
|
1583
|
+
import { join as join7 } from "path";
|
|
1667
1584
|
var BACKGROUND_WORK_TTL_MS = 60 * 60 * 1e3;
|
|
1668
|
-
var backgroundWorkDir = () =>
|
|
1669
|
-
var markerFor = (sessionKey) =>
|
|
1585
|
+
var backgroundWorkDir = () => join7(tmpdir7(), "pushary-background-work");
|
|
1586
|
+
var markerFor = (sessionKey) => join7(backgroundWorkDir(), createHash7("sha256").update(sessionKey).digest("hex"));
|
|
1670
1587
|
var hasRunningBackgroundTasks = (backgroundTasks) => Array.isArray(backgroundTasks) && backgroundTasks.length > 0;
|
|
1671
1588
|
var noteBackgroundWork = (sessionKey, running) => {
|
|
1672
1589
|
try {
|
|
@@ -1682,21 +1599,21 @@ var noteBackgroundWork = (sessionKey, running) => {
|
|
|
1682
1599
|
};
|
|
1683
1600
|
var isWaitingOnBackgroundWork = (sessionKey, nowMs = Date.now()) => {
|
|
1684
1601
|
try {
|
|
1685
|
-
return nowMs -
|
|
1602
|
+
return nowMs - statSync6(markerFor(sessionKey)).mtimeMs < BACKGROUND_WORK_TTL_MS;
|
|
1686
1603
|
} catch {
|
|
1687
1604
|
return false;
|
|
1688
1605
|
}
|
|
1689
1606
|
};
|
|
1690
1607
|
|
|
1691
1608
|
// src/events.ts
|
|
1692
|
-
import { basename as
|
|
1693
|
-
import { existsSync as
|
|
1609
|
+
import { basename as basename2, join as join8 } from "path";
|
|
1610
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync7, readFileSync as readFileSync6, statSync as statSync7, writeFileSync as writeFileSync7 } from "fs";
|
|
1694
1611
|
import { tmpdir as tmpdir8 } from "os";
|
|
1695
|
-
var INTENT_DIR =
|
|
1612
|
+
var INTENT_DIR = join8(tmpdir8(), "pushary-intent");
|
|
1696
1613
|
var INTENT_MAX_BYTES = 2048;
|
|
1697
1614
|
var INTENT_GRACE_MS = 10 * 60 * 1e3;
|
|
1698
1615
|
var sanitizeSession = (sessionId) => sessionId.replace(/[^A-Za-z0-9_-]/g, "_").slice(0, 128) || DEFAULT_SESSION;
|
|
1699
|
-
var intentFile = (sessionId) =>
|
|
1616
|
+
var intentFile = (sessionId) => join8(INTENT_DIR, sanitizeSession(sessionId));
|
|
1700
1617
|
var saveLastPrompt = (sessionId, prompt) => {
|
|
1701
1618
|
try {
|
|
1702
1619
|
const trimmed = prompt.replace(/\s+/g, " ").trim().slice(0, INTENT_MAX_BYTES);
|
|
@@ -1709,8 +1626,8 @@ var saveLastPrompt = (sessionId, prompt) => {
|
|
|
1709
1626
|
var readLastPrompt = (sessionId) => {
|
|
1710
1627
|
try {
|
|
1711
1628
|
const path = intentFile(sessionId);
|
|
1712
|
-
if (isDefaultSession(sessionId) &&
|
|
1713
|
-
const value =
|
|
1629
|
+
if (isDefaultSession(sessionId) && statSync7(path).mtimeMs < Date.now() - INTENT_GRACE_MS) return void 0;
|
|
1630
|
+
const value = readFileSync6(path, "utf-8").trim();
|
|
1714
1631
|
return value.length > 0 ? value : void 0;
|
|
1715
1632
|
} catch {
|
|
1716
1633
|
return void 0;
|
|
@@ -1774,8 +1691,8 @@ var POLICY_CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
|
1774
1691
|
var readFreshCachedPolicy = (apiKey, agentType, sessionId) => {
|
|
1775
1692
|
const request = policyRequestFor(agentType);
|
|
1776
1693
|
const path = policyCacheFile(apiKey, request.agent, request.repoAware);
|
|
1777
|
-
if (!
|
|
1778
|
-
const cached = JSON.parse(
|
|
1694
|
+
if (!existsSync6(path)) return null;
|
|
1695
|
+
const cached = JSON.parse(readFileSync6(path, "utf-8"));
|
|
1779
1696
|
if (!isPolicyConfig(cached)) return null;
|
|
1780
1697
|
if ((cached._sessionId ?? null) !== (sessionId ?? null)) return null;
|
|
1781
1698
|
if (!cached._cachedAt || Date.now() - cached._cachedAt >= POLICY_CACHE_TTL_MS) return null;
|
|
@@ -1979,7 +1896,7 @@ var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1979
1896
|
const deadline = Date.now() + HOOK_BUDGET_MS;
|
|
1980
1897
|
const signal = AbortSignal.timeout(HOOK_BUDGET_MS);
|
|
1981
1898
|
try {
|
|
1982
|
-
const projectName =
|
|
1899
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
1983
1900
|
const action = describeToolCall(input.tool_name, input.tool_input, "event");
|
|
1984
1901
|
const lookup = toPolicyLookup(input.tool_name, input.tool_input);
|
|
1985
1902
|
const toolResult = input.tool_response ?? input.tool_result;
|
|
@@ -2046,7 +1963,7 @@ var handleUserPrompt = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
2046
1963
|
const deadline = Date.now() + HOOK_BUDGET_MS;
|
|
2047
1964
|
const signal = AbortSignal.timeout(HOOK_BUDGET_MS);
|
|
2048
1965
|
try {
|
|
2049
|
-
const projectName =
|
|
1966
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
2050
1967
|
const sessionKey = input.session_id || DEFAULT_SESSION;
|
|
2051
1968
|
const titlesEnabled = process.env.PUSHARY_TASK_TITLES !== "off";
|
|
2052
1969
|
const taskTitle = titlesEnabled ? taskTitleFrom(input.prompt) : void 0;
|
|
@@ -2080,7 +1997,7 @@ var handleStop = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
2080
1997
|
const deadline = Date.now() + HOOK_BUDGET_MS;
|
|
2081
1998
|
const signal = AbortSignal.timeout(HOOK_BUDGET_MS);
|
|
2082
1999
|
try {
|
|
2083
|
-
const projectName =
|
|
2000
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
2084
2001
|
const sessionKey = input.session_id || DEFAULT_SESSION;
|
|
2085
2002
|
noteBackgroundWork(sessionKey, hasRunningBackgroundTasks(input.background_tasks));
|
|
2086
2003
|
const late = await reconcilePendingQuestions(sessionKey, void 0, signal);
|
|
@@ -2112,7 +2029,7 @@ var isSubagentStop = (input) => input.hook_event_name === "SubagentStop" || type
|
|
|
2112
2029
|
var SUBAGENT_STOP_REPORT_TIMEOUT_MS = 4e3;
|
|
2113
2030
|
var handleSubagentStop = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
2114
2031
|
try {
|
|
2115
|
-
const projectName =
|
|
2032
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
2116
2033
|
await reportEvent({
|
|
2117
2034
|
event: "session_end",
|
|
2118
2035
|
agentType: agent.type,
|
|
@@ -2130,7 +2047,7 @@ var isCompactionEvent = (hookEventName) => hookEventName === "PreCompact" || hoo
|
|
|
2130
2047
|
var COMPACTION_REPORT_TIMEOUT_MS = 4e3;
|
|
2131
2048
|
var handleCompaction = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
2132
2049
|
try {
|
|
2133
|
-
const projectName =
|
|
2050
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
2134
2051
|
await reportEvent({
|
|
2135
2052
|
event: "compaction",
|
|
2136
2053
|
agentType: agent.type,
|
|
@@ -2143,7 +2060,7 @@ var handleCompaction = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
2143
2060
|
};
|
|
2144
2061
|
var handleSessionStart = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
2145
2062
|
try {
|
|
2146
|
-
const projectName =
|
|
2063
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
2147
2064
|
const action = input.agent_id ? "Subagent started" : sessionStartAction(input.source);
|
|
2148
2065
|
await reportEvent({
|
|
2149
2066
|
event: "session_start",
|
|
@@ -2157,7 +2074,7 @@ var handleSessionStart = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
2157
2074
|
};
|
|
2158
2075
|
var handleSessionEnd = async (input, agent = CLAUDE_CODE_AGENT, options = {}) => {
|
|
2159
2076
|
try {
|
|
2160
|
-
const projectName =
|
|
2077
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
2161
2078
|
const action = sessionEndAction(input.reason);
|
|
2162
2079
|
const sessionKey = input.session_id || DEFAULT_SESSION;
|
|
2163
2080
|
if (options.reconcile ?? true) {
|
|
@@ -2185,7 +2102,7 @@ var pushesNotification = (notifType, sessionKey) => NOTIFICATION_PUSH_TYPES.has(
|
|
|
2185
2102
|
var handleNotification = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
2186
2103
|
const signal = AbortSignal.timeout(HOOK_BUDGET_MS);
|
|
2187
2104
|
try {
|
|
2188
|
-
const projectName =
|
|
2105
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
2189
2106
|
const notifType = notificationTypeOf(input) ?? "";
|
|
2190
2107
|
const sessionKey = input.session_id || DEFAULT_SESSION;
|
|
2191
2108
|
const teammateIdle = input.hook_event_name === "TeammateIdle";
|
|
@@ -2246,7 +2163,7 @@ var handleStopFailure = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
2246
2163
|
} catch {
|
|
2247
2164
|
return;
|
|
2248
2165
|
}
|
|
2249
|
-
const projectName =
|
|
2166
|
+
const projectName = basename2(input.cwd ?? process.cwd());
|
|
2250
2167
|
const reason = describeStopFailure(input.error);
|
|
2251
2168
|
await reportEvent({
|
|
2252
2169
|
event: "turn_error",
|
|
@@ -2302,7 +2219,6 @@ export {
|
|
|
2302
2219
|
markPendingCommandDelivered,
|
|
2303
2220
|
markPendingCommandFailed,
|
|
2304
2221
|
removePendingCommand,
|
|
2305
|
-
repoKeyFor,
|
|
2306
2222
|
claimThrottle,
|
|
2307
2223
|
releaseThrottle,
|
|
2308
2224
|
policyRequestFor,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
detectClaudeVersion
|
|
6
|
-
} from "./chunk-RIVNNBEK.js";
|
|
3
|
+
} from "./chunk-E76QCZIA.js";
|
|
7
4
|
import {
|
|
8
5
|
OPENCODE_HOOK_BINARY,
|
|
9
6
|
agentHookOwner,
|
|
@@ -12,7 +9,7 @@ import {
|
|
|
12
9
|
openCodeHookArgv,
|
|
13
10
|
openCodePluginDir,
|
|
14
11
|
openCodeWired
|
|
15
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UZVF6MP2.js";
|
|
16
13
|
import {
|
|
17
14
|
addClaudeMcpServer,
|
|
18
15
|
addCompatibleHooks,
|
|
@@ -20,7 +17,7 @@ import {
|
|
|
20
17
|
addPusharyToolPermissions,
|
|
21
18
|
compatibleConfigFile,
|
|
22
19
|
hasCompatibleHooks
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-FKDZU6YX.js";
|
|
24
21
|
import {
|
|
25
22
|
claudeUnprovenHolds,
|
|
26
23
|
claudeWired,
|
|
@@ -28,7 +25,7 @@ import {
|
|
|
28
25
|
codexWired,
|
|
29
26
|
geminiWired,
|
|
30
27
|
planHooks
|
|
31
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-T4CKP47U.js";
|
|
32
29
|
import {
|
|
33
30
|
CLAUDE_HOOK_BINARY,
|
|
34
31
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -39,7 +36,10 @@ import {
|
|
|
39
36
|
needsReregistration,
|
|
40
37
|
registrationSignatures,
|
|
41
38
|
supportedClaudeEvents
|
|
42
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-SI2NC6UU.js";
|
|
40
|
+
import {
|
|
41
|
+
detectClaudeVersion
|
|
42
|
+
} from "./chunk-RIVNNBEK.js";
|
|
43
43
|
import {
|
|
44
44
|
formatVersion
|
|
45
45
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
resolveGlobalBinDir,
|
|
64
64
|
resolveGlobalBinary,
|
|
65
65
|
vscodePluginMcp
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-4JHEZ2PV.js";
|
|
67
67
|
import {
|
|
68
68
|
readJsonSafe,
|
|
69
69
|
writeFileAtomic,
|
|
@@ -73,7 +73,7 @@ import {
|
|
|
73
73
|
HOOK_COMPATIBLE_PROFILES,
|
|
74
74
|
isCompatibleAgentType,
|
|
75
75
|
isRecord
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-JNU3LV47.js";
|
|
77
77
|
|
|
78
78
|
// src/reapply.ts
|
|
79
79
|
import { dirname, join } from "path";
|