@pushary/agent-hooks 1.9.163 → 1.9.165
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/data/openclaw-plugin/README.md +2 -2
- package/data/openclaw-plugin/dist/file-change-preview.js +76 -30
- package/data/openclaw-plugin/dist/openclaw-write-guard.js +2 -1
- package/data/openclaw-plugin/dist/patch-hunks.js +110 -0
- package/data/openclaw-plugin/dist/protected-writes.js +51 -20
- package/data/openclaw-plugin/package.json +1 -1
- package/dist/{api-3W4XWXCZ.js → api-D4SZ2E5J.js} +11 -11
- package/dist/bin/pushary-audit.js +3 -3
- package/dist/bin/pushary-bell-hook.js +28 -28
- package/dist/bin/pushary-bell.js +11 -11
- package/dist/bin/pushary-calls.js +15 -15
- package/dist/bin/pushary-claude.js +27 -27
- package/dist/bin/pushary-clean.js +38 -38
- package/dist/bin/pushary-codex-bridge.js +23 -23
- package/dist/bin/pushary-codex-hook.js +36 -36
- package/dist/bin/pushary-codex-session.js +8 -8
- package/dist/bin/pushary-codex.js +16 -16
- package/dist/bin/pushary-connect.js +34 -34
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +45 -45
- package/dist/bin/pushary-disconnect.js +29 -29
- package/dist/bin/pushary-display-hook.js +6 -1
- package/dist/bin/pushary-doctor.js +46 -46
- package/dist/bin/pushary-elicitation-hook.js +28 -28
- package/dist/bin/pushary-gemini-bridge.js +17 -17
- package/dist/bin/pushary-gemini-hook.js +32 -32
- package/dist/bin/pushary-hook.js +36 -36
- package/dist/bin/pushary-login.js +22 -22
- package/dist/bin/pushary-logout.js +29 -29
- package/dist/bin/pushary-mcp.js +12 -12
- package/dist/bin/pushary-mode.js +16 -16
- package/dist/bin/pushary-notification-hook.js +27 -27
- package/dist/bin/pushary-opencode-hook.js +33 -33
- package/dist/bin/pushary-permission-denied-hook.js +36 -36
- package/dist/bin/pushary-permission-hook.js +36 -36
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +27 -27
- package/dist/bin/pushary-session-end-hook.js +27 -27
- package/dist/bin/pushary-session-start-hook.js +38 -38
- package/dist/bin/pushary-setup.js +54 -54
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +35 -35
- package/dist/bin/pushary-stop-hook.js +27 -27
- package/dist/bin/pushary-stopfailure-hook.js +27 -27
- package/dist/bin/pushary-suggestions.js +16 -16
- package/dist/bin/pushary-transcript-register.js +17 -17
- package/dist/bin/pushary-transcripts.js +25 -25
- package/dist/bin/pushary-upgrade.js +43 -43
- package/dist/bin/pushary-wait.js +16 -16
- package/dist/bin/pushary.js +7 -7
- package/dist/{chunk-NE23W6RX.js → chunk-2FLJZICI.js} +2 -2
- package/dist/{chunk-TG252BD4.js → chunk-2J3IIFS3.js} +2 -2
- package/dist/{chunk-BS5YSLXS.js → chunk-2KZZZ4JK.js} +3 -3
- package/dist/{chunk-KU7DUO5E.js → chunk-3CLLJJJ2.js} +5 -5
- package/dist/{chunk-FIQFGSXB.js → chunk-3GWMSKFY.js} +18 -18
- package/dist/{chunk-KG5UNSTJ.js → chunk-3I5IFXHF.js} +1 -1
- package/dist/{chunk-7DHVYOOP.js → chunk-5I34FSSW.js} +6 -6
- package/dist/{chunk-DJOAYJYR.js → chunk-635I27L4.js} +3 -3
- package/dist/{chunk-LYPTFNMM.js → chunk-67CGCPI4.js} +2 -2
- package/dist/{chunk-3TN7WHEF.js → chunk-6OBGKICP.js} +3 -3
- package/dist/{chunk-JQ2KBN4B.js → chunk-6QLOTNO2.js} +2 -2
- package/dist/{chunk-LKF2C5SP.js → chunk-6ZGXNEBA.js} +5 -5
- package/dist/{chunk-F2EPFT5W.js → chunk-7HXO72HS.js} +1 -1
- package/dist/{chunk-LNZQBK3Z.js → chunk-7JO3NNIQ.js} +2 -2
- package/dist/{chunk-YQJX2SJ3.js → chunk-7PMCRTPW.js} +3 -3
- package/dist/{chunk-P6D5R2GR.js → chunk-7TQXWAOZ.js} +1 -1
- package/dist/{chunk-4ZV734EY.js → chunk-7WHUMPWM.js} +1 -1
- package/dist/{chunk-KJY4KNSE.js → chunk-7X7ZTLIN.js} +11 -11
- package/dist/{chunk-2P3E6CXY.js → chunk-7YUKURRZ.js} +1 -1
- package/dist/{chunk-B6SP4ZLB.js → chunk-A4IK6JTC.js} +4 -4
- package/dist/{chunk-OQSSPA5U.js → chunk-ANMVHKNK.js} +3 -3
- package/dist/{chunk-7FMXDLNO.js → chunk-BFMILGSX.js} +3 -3
- package/dist/{chunk-N7VOAIFG.js → chunk-BOJWXETW.js} +1 -1
- package/dist/{chunk-WOAHDWWF.js → chunk-C2PGBMTH.js} +1 -1
- package/dist/{chunk-MBAWDULS.js → chunk-D3KD7K3N.js} +4 -4
- package/dist/{chunk-QLBY4O7Q.js → chunk-DFGHHYS5.js} +4 -4
- package/dist/{chunk-U2XD5U2Z.js → chunk-EANTIGY7.js} +1 -1
- package/dist/{chunk-VXSAB3ZE.js → chunk-GNCFKXQS.js} +2 -2
- package/dist/{chunk-7U3GZ5ZV.js → chunk-I2FH4E6H.js} +2 -2
- package/dist/{chunk-3HUPWSLJ.js → chunk-I4BIOADS.js} +4 -4
- package/dist/{chunk-JDY2FFC3.js → chunk-IEENAYGT.js} +1 -1
- package/dist/{chunk-W2EOPCHG.js → chunk-IGBKHRCZ.js} +1 -1
- package/dist/{chunk-7RGPAEEL.js → chunk-ILBNQX44.js} +5 -5
- package/dist/{chunk-Q5CWVFV2.js → chunk-ILGAR7DW.js} +134 -8
- package/dist/{chunk-5ZL7QBVM.js → chunk-ITGM5QW4.js} +6 -6
- package/dist/{chunk-3ZJLASF2.js → chunk-JAE5ULC6.js} +5 -5
- package/dist/{chunk-RQWKMBDO.js → chunk-JARCCL3M.js} +2 -2
- package/dist/{chunk-IHZ7MUYB.js → chunk-JLGZGITL.js} +2 -2
- package/dist/{chunk-YLV5J6QF.js → chunk-KYBVLSMT.js} +3 -3
- package/dist/{chunk-LEWUIP5P.js → chunk-L2NGVERQ.js} +1 -1
- package/dist/{chunk-ZZ44PWXB.js → chunk-L4HJSUP7.js} +1 -1
- package/dist/{chunk-ZLWAN47L.js → chunk-L54D5IIR.js} +5 -5
- package/dist/{chunk-MUGQUNPY.js → chunk-LDEZYH7Y.js} +10 -10
- package/dist/{chunk-SYAAPPNF.js → chunk-LFS3PX7S.js} +4 -4
- package/dist/{chunk-7WBIMPZQ.js → chunk-LJSRMA5C.js} +5 -5
- package/dist/{chunk-TF46WWVU.js → chunk-MN2FFBYE.js} +2 -2
- package/dist/{chunk-TAD24RFF.js → chunk-MTB52RSH.js} +2 -2
- package/dist/{chunk-ILPCJRLG.js → chunk-MYN6FNBS.js} +3 -3
- package/dist/{chunk-MLOOPTC7.js → chunk-NCZ7MLNW.js} +9 -9
- package/dist/{chunk-AZ7X2FBB.js → chunk-NEGPZ3DO.js} +2 -2
- package/dist/{chunk-GVPOVNRT.js → chunk-NN2RZ2UB.js} +3 -3
- package/dist/{chunk-COFH3FQT.js → chunk-NUHIGW7H.js} +1 -1
- package/dist/{chunk-3J6NPY5E.js → chunk-NXTAXFQS.js} +8 -8
- package/dist/{chunk-QOKW2NVQ.js → chunk-NYCN3CCK.js} +1 -1
- package/dist/{chunk-XO62UOR7.js → chunk-OJRX6UVD.js} +7 -7
- package/dist/{chunk-QCTLGNMD.js → chunk-OPN6FWMG.js} +1 -1
- package/dist/{chunk-QRPW7KDH.js → chunk-QV5HMBT4.js} +12 -12
- package/dist/{chunk-5TQERWVE.js → chunk-R23ZNBJU.js} +6 -6
- package/dist/{chunk-FRT6CTUK.js → chunk-RN4Z5BQJ.js} +3 -3
- package/dist/{chunk-6XKJVF2A.js → chunk-RZRBXDGN.js} +6 -6
- package/dist/{chunk-SKUDNFAZ.js → chunk-SIZBYHXW.js} +4 -4
- package/dist/{chunk-UFTT6RO6.js → chunk-TBDSTEO3.js} +3 -3
- package/dist/{chunk-3HDZQKAK.js → chunk-TVXGBUOL.js} +1 -1
- package/dist/{chunk-5HSPZGN6.js → chunk-U6NNLBWJ.js} +5 -5
- package/dist/{chunk-GY3BDYVF.js → chunk-UM4RAZPH.js} +1 -1
- package/dist/{chunk-G3YVXFRI.js → chunk-VDNKX5OF.js} +5 -5
- package/dist/{chunk-KU55VZ2I.js → chunk-WIVLMIJ6.js} +4 -4
- package/dist/{chunk-RXEBODH6.js → chunk-WTUQEQ54.js} +27 -13
- package/dist/{chunk-3WW4TQT2.js → chunk-X4YQCI5T.js} +1 -1
- package/dist/{chunk-EXVUFDLL.js → chunk-X6YYQZW7.js} +1 -1
- package/dist/{chunk-YKR52UPQ.js → chunk-X7IIWYAG.js} +1 -1
- package/dist/{chunk-WHRLUSI3.js → chunk-XRAUQWLP.js} +5 -5
- package/dist/{chunk-XOTBVRIH.js → chunk-Y3QV3VYX.js} +1 -1
- package/dist/{chunk-3SGXZHV5.js → chunk-YENSTBQI.js} +1 -1
- package/dist/{chunk-LS6MIVVS.js → chunk-YLR6QHCH.js} +6 -6
- package/dist/{chunk-K2QDEWH3.js → chunk-YORHQJ5M.js} +4 -4
- package/dist/{chunk-QNHUMOCQ.js → chunk-YQ67XWMM.js} +4 -4
- package/dist/{chunk-IZFVQLKO.js → chunk-ZB5O3LKY.js} +1 -1
- package/dist/{chunk-AYQNGBZC.js → chunk-ZEPOIQ4H.js} +4 -0
- package/dist/{chunk-FXV6MD35.js → chunk-ZPFENH7C.js} +39 -9
- package/dist/{codex-app-cards-switch-TXT3ZJIA.js → codex-app-cards-switch-BOIE5IZL.js} +11 -11
- package/dist/{codex-card-routing-LHZ4GOC5.js → codex-card-routing-B2ZI4WRI.js} +2 -2
- package/dist/{codex-desktop-launch-7GSAOUBA.js → codex-desktop-launch-LBL2LPS7.js} +1 -1
- package/dist/{codex-session-launch-NPEFPDVM.js → codex-session-launch-7WVCWASC.js} +20 -20
- package/dist/{config-JEWWH3CO.js → config-S53I5YNR.js} +3 -3
- package/dist/{global-upgrade-SJVITKA6.js → global-upgrade-ND726NHJ.js} +9 -9
- package/dist/{identity-JX2NVJQ3.js → identity-3G66JTAR.js} +4 -4
- package/dist/{live-capabilities-YYINM2NK.js → live-capabilities-76C2DKTY.js} +4 -4
- package/dist/{paths-2QDA4DUP.js → paths-O3CZR2BV.js} +3 -3
- package/dist/{reapply-23723QEC.js → reapply-TEATBGFG.js} +31 -31
- package/dist/src/index.js +35 -35
- package/dist/{upgrade-lock-6AHHM2WU.js → upgrade-lock-PDCUHFRW.js} +6 -4
- package/dist/{usage-ESU3WTVK.js → usage-DFCL7TQU.js} +3 -3
- package/package.json +1 -1
|
@@ -1,21 +1,105 @@
|
|
|
1
1
|
import {
|
|
2
2
|
autoUpdateLock
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MN2FFBYE.js";
|
|
4
4
|
import {
|
|
5
5
|
installPackageGlobally,
|
|
6
6
|
npmErrorMessage,
|
|
7
|
-
|
|
8
|
-
} from "./chunk-
|
|
7
|
+
throwIfNpmRefusesInstall
|
|
8
|
+
} from "./chunk-ZPFENH7C.js";
|
|
9
9
|
import {
|
|
10
10
|
writeJsonAtomic
|
|
11
11
|
} from "./chunk-TODDEIYG.js";
|
|
12
|
+
import {
|
|
13
|
+
CLI_PACKAGE_NAMES
|
|
14
|
+
} from "./chunk-UQTQ6HPO.js";
|
|
12
15
|
|
|
13
16
|
// src/upgrade-lock.ts
|
|
14
17
|
import { fork } from "child_process";
|
|
15
18
|
import { createHash } from "crypto";
|
|
16
|
-
import { existsSync, mkdirSync, readFileSync, realpathSync, unlinkSync } from "fs";
|
|
19
|
+
import { existsSync, mkdirSync, readFileSync, realpathSync, statSync, unlinkSync } from "fs";
|
|
17
20
|
import { createServer, Server } from "net";
|
|
18
21
|
import { basename, dirname, join } from "path";
|
|
22
|
+
|
|
23
|
+
// src/cli-installer-processes.ts
|
|
24
|
+
import { execFileSync } from "child_process";
|
|
25
|
+
var PS_EXECUTABLE = process.platform === "darwin" ? "/bin/ps" : "ps";
|
|
26
|
+
var PROCESS_TABLE_TIMEOUT_MS = 5e3;
|
|
27
|
+
var PROCESS_TABLE_MAX_BYTES = 16 * 1024 * 1024;
|
|
28
|
+
var PROCESS_LINE = /^\s*(\d+)\s+(\d+)(?:\s+(.*))?$/;
|
|
29
|
+
var UNREADABLE_TABLE = { kind: "unreadable" };
|
|
30
|
+
var NPM_EXECUTABLES = /* @__PURE__ */ new Set(["npm", "npm-cli.js"]);
|
|
31
|
+
var NPM_INSTALL_COMMANDS = /* @__PURE__ */ new Set([
|
|
32
|
+
"install",
|
|
33
|
+
"i",
|
|
34
|
+
"add",
|
|
35
|
+
"in",
|
|
36
|
+
"ins",
|
|
37
|
+
"inst",
|
|
38
|
+
"insta",
|
|
39
|
+
"instal",
|
|
40
|
+
"isnt",
|
|
41
|
+
"isnta",
|
|
42
|
+
"isntal",
|
|
43
|
+
"isntall",
|
|
44
|
+
"update",
|
|
45
|
+
"up",
|
|
46
|
+
"upgrade",
|
|
47
|
+
"udpate"
|
|
48
|
+
]);
|
|
49
|
+
var SURROUNDING_QUOTES = /^['"]+|['"]+$/g;
|
|
50
|
+
var CLI_DEPENDENCY_FOLDERS = CLI_PACKAGE_NAMES.map((name) => `/node_modules/${name}/node_modules/`);
|
|
51
|
+
var readProcessTable = () => execFileSync(PS_EXECUTABLE, ["-A", "-ww", "-o", "pid=,ppid=,args="], {
|
|
52
|
+
encoding: "utf8",
|
|
53
|
+
env: { ...process.env },
|
|
54
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
55
|
+
timeout: PROCESS_TABLE_TIMEOUT_MS,
|
|
56
|
+
maxBuffer: PROCESS_TABLE_MAX_BYTES,
|
|
57
|
+
windowsHide: true
|
|
58
|
+
});
|
|
59
|
+
var listedProcessOf = (line) => {
|
|
60
|
+
const match = PROCESS_LINE.exec(line);
|
|
61
|
+
return match === null ? void 0 : { pid: Number(match[1]), parentPid: Number(match[2]), command: match[3] ?? "" };
|
|
62
|
+
};
|
|
63
|
+
var isListedProcess = (value) => value !== void 0;
|
|
64
|
+
var processTableIn = (output) => {
|
|
65
|
+
const lines = output.split("\n").filter((line) => line.trim().length > 0);
|
|
66
|
+
const processes = lines.map(listedProcessOf);
|
|
67
|
+
if (processes.length === 0 || !processes.every(isListedProcess)) return UNREADABLE_TABLE;
|
|
68
|
+
return { kind: "listed", processes: processes.filter(isListedProcess) };
|
|
69
|
+
};
|
|
70
|
+
var listProcesses = (read = readProcessTable) => {
|
|
71
|
+
try {
|
|
72
|
+
return processTableIn(read());
|
|
73
|
+
} catch {
|
|
74
|
+
return UNREADABLE_TABLE;
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
var unquoted = (token) => token.replace(SURROUNDING_QUOTES, "");
|
|
78
|
+
var executableNameOf = (token) => token.slice(token.lastIndexOf("/") + 1);
|
|
79
|
+
var namesCliPackage = (token) => CLI_PACKAGE_NAMES.some((name) => token === name || token.startsWith(`${name}@`));
|
|
80
|
+
var isNpmInstallOfCli = (command) => {
|
|
81
|
+
const tokens = command.split(/\s+/).map(unquoted);
|
|
82
|
+
const npmAt = tokens.findIndex((token) => NPM_EXECUTABLES.has(executableNameOf(token)));
|
|
83
|
+
if (npmAt < 0) return false;
|
|
84
|
+
const npmArguments = tokens.slice(npmAt + 1);
|
|
85
|
+
return npmArguments.some((token) => NPM_INSTALL_COMMANDS.has(token)) && npmArguments.some(namesCliPackage);
|
|
86
|
+
};
|
|
87
|
+
var runsFromCliDependencyFolder = (command) => CLI_DEPENDENCY_FOLDERS.some((folder) => command.includes(folder));
|
|
88
|
+
var mayWriteCliInstall = (command) => isNpmInstallOfCli(command) || runsFromCliDependencyFolder(command);
|
|
89
|
+
var selfAndAncestorsOf = (processes, ownPid) => {
|
|
90
|
+
const parentOf = new Map(processes.map((listed) => [listed.pid, listed.parentPid]));
|
|
91
|
+
const lineage = /* @__PURE__ */ new Set([ownPid]);
|
|
92
|
+
for (let parent = parentOf.get(ownPid); parent !== void 0 && parent > 0 && !lineage.has(parent); parent = parentOf.get(parent)) {
|
|
93
|
+
lineage.add(parent);
|
|
94
|
+
}
|
|
95
|
+
return lineage;
|
|
96
|
+
};
|
|
97
|
+
var runningCliInstallerIn = (processes, ownPid) => {
|
|
98
|
+
const lineage = selfAndAncestorsOf(processes, ownPid);
|
|
99
|
+
return processes.find((listed) => !lineage.has(listed.pid) && mayWriteCliInstall(listed.command));
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
// src/upgrade-lock.ts
|
|
19
103
|
var LOCK_HOST = "127.0.0.1";
|
|
20
104
|
var LOCK_PORT_START = 49152;
|
|
21
105
|
var LOCK_PORT_COUNT = 16384;
|
|
@@ -26,6 +110,8 @@ var HANDOFF_TIMEOUT_MS = 1e4;
|
|
|
26
110
|
var FINISH_TIMEOUT_MS = 5 * 60 * 1e3;
|
|
27
111
|
var KERNEL_LOCK_FORMAT = "kernel-v1";
|
|
28
112
|
var heldLocks = /* @__PURE__ */ new Map();
|
|
113
|
+
var PENDING_INSTALL_STALE_AFTER_MS = 60 * 6e4;
|
|
114
|
+
var PLATFORMS_WITH_PROCESS_TABLE = /* @__PURE__ */ new Set(["darwin", "linux"]);
|
|
29
115
|
var canonicalLockPath = (path) => {
|
|
30
116
|
mkdirSync(dirname(path), { recursive: true });
|
|
31
117
|
return join(realpathSync(dirname(path)), basename(path));
|
|
@@ -52,6 +138,43 @@ var isProcessAlive = (pid) => {
|
|
|
52
138
|
return !(error instanceof Error && "code" in error && error.code === "ESRCH");
|
|
53
139
|
}
|
|
54
140
|
};
|
|
141
|
+
var lockRecordAgeMs = (path, nowMs) => {
|
|
142
|
+
try {
|
|
143
|
+
return nowMs - statSync(path).mtimeMs;
|
|
144
|
+
} catch {
|
|
145
|
+
return void 0;
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
var ENDED = { kind: "ended" };
|
|
149
|
+
var MAY_STILL_RUN = { kind: "may_still_run" };
|
|
150
|
+
var PROCESS_TABLE_UNREADABLE = { kind: "process_table_unreadable" };
|
|
151
|
+
var OPERATOR_MUST_CLEAR = { kind: "operator_must_clear" };
|
|
152
|
+
var UNFINISHED_INSTALLATION = "An earlier installation did not finish safely";
|
|
153
|
+
var markerIsOldAndItsProcessExited = (holderPid, ageMs, isAlive) => ageMs !== void 0 && ageMs > PENDING_INSTALL_STALE_AFTER_MS && !isAlive(holderPid);
|
|
154
|
+
var cliInstallerInProcessTable = (read) => {
|
|
155
|
+
const table = listProcesses(read);
|
|
156
|
+
if (table.kind === "unreadable") return PROCESS_TABLE_UNREADABLE;
|
|
157
|
+
const installer = runningCliInstallerIn(table.processes, process.pid);
|
|
158
|
+
return installer === void 0 ? ENDED : { kind: "installer_running", pid: installer.pid };
|
|
159
|
+
};
|
|
160
|
+
var judgePendingInstall = (path, record, request, isAlive) => {
|
|
161
|
+
if (record.pid === void 0 || !PLATFORMS_WITH_PROCESS_TABLE.has(request.platform ?? process.platform)) return OPERATOR_MUST_CLEAR;
|
|
162
|
+
if (!markerIsOldAndItsProcessExited(record.pid, lockRecordAgeMs(path, (request.now ?? Date.now)()), isAlive)) return MAY_STILL_RUN;
|
|
163
|
+
return cliInstallerInProcessTable(request.readProcessTable ?? readProcessTable);
|
|
164
|
+
};
|
|
165
|
+
var clearingSteps = (path) => `stop its npm processes (or restart the computer), then remove ${path} and retry the upgrade.`;
|
|
166
|
+
var pendingInstallReason = (pending, path) => {
|
|
167
|
+
switch (pending.kind) {
|
|
168
|
+
case "may_still_run":
|
|
169
|
+
return `${UNFINISHED_INSTALLATION}. Pushary clears this by itself once the process that started it has exited, an hour has passed since it started, and no npm install of Pushary is running. To retry sooner, ${clearingSteps(path)}`;
|
|
170
|
+
case "installer_running":
|
|
171
|
+
return `${UNFINISHED_INSTALLATION}, and an npm install of Pushary is still running (pid ${pending.pid}). Pushary clears this by itself once that install has ended. To retry sooner, ${clearingSteps(path)}`;
|
|
172
|
+
case "process_table_unreadable":
|
|
173
|
+
return `${UNFINISHED_INSTALLATION}, and Pushary could not read the process list to check that no npm install of Pushary is still running. To clear it, ${clearingSteps(path)}`;
|
|
174
|
+
case "operator_must_clear":
|
|
175
|
+
return `${UNFINISHED_INSTALLATION}. To clear it, ${clearingSteps(path)}`;
|
|
176
|
+
}
|
|
177
|
+
};
|
|
55
178
|
var rejectConnection = (socket) => {
|
|
56
179
|
socket.destroy();
|
|
57
180
|
};
|
|
@@ -98,11 +221,13 @@ var claimUpgradeLock = async (request = {}) => {
|
|
|
98
221
|
listener.listen({ host: LOCK_HOST, port: lockPort(path), exclusive: true }, resolve);
|
|
99
222
|
});
|
|
100
223
|
const record = readLockRecord(path);
|
|
101
|
-
|
|
224
|
+
const isAlive = request.isAlive ?? isProcessAlive;
|
|
225
|
+
const pending = record.installationPending ? judgePendingInstall(path, record, request, isAlive) : ENDED;
|
|
226
|
+
if (pending.kind !== "ended") {
|
|
102
227
|
server.close();
|
|
103
|
-
return { kind: "unavailable", reason:
|
|
228
|
+
return { kind: "unavailable", reason: pendingInstallReason(pending, path) };
|
|
104
229
|
}
|
|
105
|
-
if (existsSync(path) && !record.usesKernelLock && (record.pid === void 0 ||
|
|
230
|
+
if (existsSync(path) && !record.usesKernelLock && (record.pid === void 0 || isAlive(record.pid))) {
|
|
106
231
|
server.close();
|
|
107
232
|
return { kind: "held", holderPid: record.pid };
|
|
108
233
|
}
|
|
@@ -166,13 +291,14 @@ var writeSettledLockRecord = (path) => writeJsonAtomic(path, { pid: process.pid,
|
|
|
166
291
|
var installWithUpgradeLock = (request, lockPath = autoUpdateLock(), runNpm) => {
|
|
167
292
|
const path = canonicalLockPath(lockPath);
|
|
168
293
|
if (!heldLocks.has(path)) throw new Error("Cannot install an upgrade without its lock");
|
|
169
|
-
|
|
294
|
+
throwIfNpmRefusesInstall(request, runNpm);
|
|
170
295
|
writeJsonAtomic(path, { pid: process.pid, format: KERNEL_LOCK_FORMAT, installationPending: true }, 384);
|
|
171
296
|
installPackageGlobally(request, runNpm);
|
|
172
297
|
writeSettledLockRecord(path);
|
|
173
298
|
};
|
|
174
299
|
|
|
175
300
|
export {
|
|
301
|
+
PENDING_INSTALL_STALE_AFTER_MS,
|
|
176
302
|
claimUpgradeLock,
|
|
177
303
|
ownsUpgradeLock,
|
|
178
304
|
releaseAutoUpdateLock,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
APPROVAL_RULES_PATH,
|
|
3
3
|
canChangeApprovalSettings
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2J3IIFS3.js";
|
|
5
5
|
import {
|
|
6
6
|
callMcpTool
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ILBNQX44.js";
|
|
8
8
|
import {
|
|
9
9
|
absoluteUrl
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-635I27L4.js";
|
|
11
11
|
import {
|
|
12
12
|
getBaseUrl
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Y3QV3VYX.js";
|
|
14
14
|
import {
|
|
15
15
|
NPX_LATEST_COMMAND
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-BOJWXETW.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-ZEPOIQ4H.js";
|
|
25
25
|
|
|
26
26
|
// src/reach.ts
|
|
27
27
|
var PUSHARY_APP_DOWNLOAD_URL = "https://pushary.com/download";
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openClawLauncherCandidates
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ANMVHKNK.js";
|
|
4
4
|
import {
|
|
5
5
|
openCodeConfigDirFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5I34FSSW.js";
|
|
7
7
|
import {
|
|
8
8
|
nativeClaudeInstallPath
|
|
9
9
|
} from "./chunk-CYTPQDQY.js";
|
|
10
10
|
import {
|
|
11
11
|
grokHome
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-XRAUQWLP.js";
|
|
13
13
|
import {
|
|
14
14
|
claudeConfigDir,
|
|
15
15
|
clineDataDirectory,
|
|
16
16
|
codexHomeFrom,
|
|
17
17
|
openClawEnvironmentOf,
|
|
18
18
|
openClawPathsFrom
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-MN2FFBYE.js";
|
|
20
20
|
import {
|
|
21
21
|
HOOK_COMPATIBLE_PROFILES
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
23
23
|
|
|
24
24
|
// src/vscode-config.ts
|
|
25
25
|
import { homedir } from "os";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyDir
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MN2FFBYE.js";
|
|
4
4
|
import {
|
|
5
5
|
readRegularJsonFile,
|
|
6
6
|
writeFileAtomic
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
serializeDeclinedAgents,
|
|
14
14
|
withDeclinedAgent,
|
|
15
15
|
withoutDeclinedAgent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
17
17
|
|
|
18
18
|
// src/declined-agents-file.ts
|
|
19
19
|
import { join } from "path";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
callDecisionStore,
|
|
3
3
|
identifyingToolInput
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-QV5HMBT4.js";
|
|
5
5
|
import {
|
|
6
6
|
canonicalJson
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MN2FFBYE.js";
|
|
8
8
|
|
|
9
9
|
// src/phone-approval.ts
|
|
10
10
|
import { createHash } from "crypto";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveInstallSourceFor
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MTB52RSH.js";
|
|
4
4
|
import {
|
|
5
5
|
configFilePath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y3QV3VYX.js";
|
|
7
7
|
import {
|
|
8
8
|
backupFile,
|
|
9
9
|
readJsonSafe,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
API_KEY_PREFIX_PATTERN,
|
|
15
15
|
isRecord,
|
|
16
16
|
isValidApiKey
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
18
18
|
|
|
19
19
|
// src/shell-alias.ts
|
|
20
20
|
import { homedir } from "os";
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
uploadTranscriptRecords,
|
|
11
11
|
verifyAnchoredRecipients,
|
|
12
12
|
wrapSessionKey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-2KZZZ4JK.js";
|
|
14
14
|
|
|
15
15
|
// src/live-session.ts
|
|
16
16
|
var LIVE_TRANSCRIPT_LIMITS = { queuedRecords: 100, recordCharacters: 32 * 1024 };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
announceSubscriptionRequired,
|
|
3
3
|
isDeferAnswer
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-IEENAYGT.js";
|
|
5
5
|
import {
|
|
6
6
|
askUser,
|
|
7
7
|
isDecisionStopped,
|
|
@@ -9,13 +9,13 @@ import {
|
|
|
9
9
|
isThePersonsStop,
|
|
10
10
|
waitForOpenQuestion,
|
|
11
11
|
waitForQuestion
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RZRBXDGN.js";
|
|
13
13
|
import {
|
|
14
14
|
SubscriptionRequiredError
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ILBNQX44.js";
|
|
16
16
|
import {
|
|
17
17
|
getMachineId
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-IGBKHRCZ.js";
|
|
19
19
|
import {
|
|
20
20
|
ASK_CONTEXT_MAX,
|
|
21
21
|
agentQuestionContext,
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
parseAgentQuestionAnswers,
|
|
27
27
|
plainAskOf,
|
|
28
28
|
questionsShownAsASet
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
30
30
|
|
|
31
31
|
// src/agent-question-ask.ts
|
|
32
32
|
var ONLY_QUESTION = { index: 0, total: 1 };
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-WHB622LP.js";
|
|
4
4
|
import {
|
|
5
5
|
ensureDaemonRunning
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-YLR6QHCH.js";
|
|
7
7
|
import {
|
|
8
8
|
hookOwnerOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-D3KD7K3N.js";
|
|
10
10
|
import {
|
|
11
11
|
hookMeaning
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-X6YYQZW7.js";
|
|
13
13
|
import {
|
|
14
14
|
buildTranscriptRecords,
|
|
15
15
|
changedRecipientsMessage,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
uploadTranscriptRecords,
|
|
25
25
|
verifyAnchoredRecipients,
|
|
26
26
|
wrapSessionKey
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-2KZZZ4JK.js";
|
|
28
28
|
import {
|
|
29
29
|
external_exports,
|
|
30
30
|
ownedOnlyByThisUser,
|
|
@@ -33,22 +33,22 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
transcriptEnvironmentPreference,
|
|
35
35
|
transcriptsEnabled
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-NYCN3CCK.js";
|
|
37
37
|
import {
|
|
38
38
|
fetchAsCredential
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-YENSTBQI.js";
|
|
40
40
|
import {
|
|
41
41
|
readTranscriptPreference
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-KYBVLSMT.js";
|
|
43
43
|
import {
|
|
44
44
|
claudeConfigDir,
|
|
45
45
|
codexHome,
|
|
46
46
|
pusharyDir
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-MN2FFBYE.js";
|
|
48
48
|
import {
|
|
49
49
|
getApiKey,
|
|
50
50
|
getBaseUrl
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-Y3QV3VYX.js";
|
|
52
52
|
import {
|
|
53
53
|
writeJsonAtomic,
|
|
54
54
|
writeJsonAtomicDurable
|
|
@@ -60,7 +60,7 @@ import {
|
|
|
60
60
|
isHookSource,
|
|
61
61
|
isRecord,
|
|
62
62
|
redactSecretsFromContent
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
64
64
|
|
|
65
65
|
// src/transcript-registration.ts
|
|
66
66
|
import { createHash as createHash4 } from "crypto";
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CODEX_HOOK_STATUS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-I2FH4E6H.js";
|
|
4
4
|
import {
|
|
5
5
|
HERMES_ALWAYS_ALLOWED_SHELL_RULE,
|
|
6
6
|
HERMES_COMMAND_ALLOWLIST_KEY,
|
|
7
7
|
HERMES_GATE_TOOLS_KEY,
|
|
8
8
|
HERMES_SHELL_TOOL
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-I4BIOADS.js";
|
|
10
10
|
import {
|
|
11
11
|
retryAgentCommand
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-6OBGKICP.js";
|
|
13
13
|
import {
|
|
14
14
|
NPX_LATEST_COMMAND
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BOJWXETW.js";
|
|
16
16
|
|
|
17
17
|
// src/setup/codex-trust.ts
|
|
18
18
|
var CODEX_TRUST_TELEMETRY = {
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
} from "./chunk-OYIN77HO.js";
|
|
6
6
|
import {
|
|
7
7
|
readMacAppAgentKey
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-YORHQJ5M.js";
|
|
9
9
|
import {
|
|
10
10
|
API_KEYS_PATH
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2J3IIFS3.js";
|
|
12
12
|
import {
|
|
13
13
|
absoluteUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-635I27L4.js";
|
|
15
15
|
import {
|
|
16
16
|
findExportedKeyLines,
|
|
17
17
|
isAdoptedMacAppKey,
|
|
@@ -21,10 +21,10 @@ import {
|
|
|
21
21
|
readConfigFileKey,
|
|
22
22
|
readKeySource,
|
|
23
23
|
readMacAppKeyPrefix
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-KYBVLSMT.js";
|
|
25
25
|
import {
|
|
26
26
|
isValidApiKey
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
28
28
|
|
|
29
29
|
// src/cli/held-key-revocation.ts
|
|
30
30
|
var readCliHeldKeys = (profiles) => {
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
formatVersion,
|
|
4
4
|
quoteIfNeeded,
|
|
5
5
|
shellDoubleQuoted
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZPFENH7C.js";
|
|
7
7
|
import {
|
|
8
8
|
writeFileAtomic
|
|
9
9
|
} from "./chunk-TODDEIYG.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
PUSHARY_HOSTS,
|
|
23
23
|
PUSHARY_TOOL_PREFIX,
|
|
24
24
|
withHookHoldBudget
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
26
26
|
|
|
27
27
|
// src/setup/paths.ts
|
|
28
28
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SETUP_FLAGS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NUHIGW7H.js";
|
|
4
4
|
import {
|
|
5
5
|
parseFlags
|
|
6
6
|
} from "./chunk-YPY4YCIZ.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-YU2EUD7O.js";
|
|
10
10
|
import {
|
|
11
11
|
NPX_LATEST_COMMAND
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-BOJWXETW.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_CONNECTOR_GUIDE,
|
|
15
15
|
CLAUDE_CONNECTOR_STEPS,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
CLAUDE_CONNECTOR_URL,
|
|
18
18
|
COWORK_CONNECTOR_LIMIT,
|
|
19
19
|
COWORK_STANDING_INSTRUCTIONS
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
21
21
|
|
|
22
22
|
// src/cli/cowork.ts
|
|
23
23
|
import { readFileSync } from "fs";
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MANAGED_CLAUDE_SETTINGS_BY_PLATFORM
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GNCFKXQS.js";
|
|
4
4
|
import {
|
|
5
5
|
declinedAgentsFile,
|
|
6
6
|
readDeclinedAgents
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-JARCCL3M.js";
|
|
8
8
|
import {
|
|
9
9
|
OPENCODE_HOOK_BINARY,
|
|
10
10
|
openCodeConfigDir,
|
|
11
11
|
openCodePluginFile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5I34FSSW.js";
|
|
13
13
|
import {
|
|
14
14
|
openCodePluginArgv
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3I5IFXHF.js";
|
|
16
16
|
import {
|
|
17
17
|
liveCursorGateCoverage
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-YQ67XWMM.js";
|
|
19
19
|
import {
|
|
20
20
|
compatibleConfigFile,
|
|
21
21
|
compatibleHookEvents,
|
|
22
22
|
grokHome,
|
|
23
23
|
parseConfigDocument
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-XRAUQWLP.js";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_HOOKS_KEY_PATH,
|
|
27
27
|
GEMINI_HOOK_BINARY,
|
|
28
28
|
GEMINI_HOOK_EVENTS,
|
|
29
29
|
hooksAt
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-D3KD7K3N.js";
|
|
31
31
|
import {
|
|
32
32
|
CODEX_EARLIER_APPROVAL_MATCHERS,
|
|
33
33
|
CODEX_HOOK_BINARY,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
parseHookArgv,
|
|
56
56
|
parseHookCommand,
|
|
57
57
|
supportedClaudeEvents
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-MN2FFBYE.js";
|
|
59
59
|
import {
|
|
60
60
|
readRegularJsonFile,
|
|
61
61
|
readRegularTextFile
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
OPENCODE_APPROVAL_EVENT,
|
|
70
70
|
isRecord,
|
|
71
71
|
matcherMatchesEveryCall
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
73
73
|
|
|
74
74
|
// src/hook-wiring.ts
|
|
75
75
|
import { createHash } from "crypto";
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-CYTPQDQY.js";
|
|
4
4
|
import {
|
|
5
5
|
parseVersion
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ZPFENH7C.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
10
10
|
|
|
11
11
|
// src/setup/agent-probe.ts
|
|
12
12
|
import { execSync } from "child_process";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readExistingMachineId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IGBKHRCZ.js";
|
|
4
4
|
import {
|
|
5
5
|
getBaseUrl
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-Y3QV3VYX.js";
|
|
7
7
|
import {
|
|
8
8
|
NetworkError
|
|
9
9
|
} from "./chunk-YU2EUD7O.js";
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import {
|
|
14
14
|
clientContextHeaders,
|
|
15
15
|
redactSecretsFromContent
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ZEPOIQ4H.js";
|
|
17
17
|
|
|
18
18
|
// src/cli/net.ts
|
|
19
19
|
import { createRequire } from "module";
|