pushary 1.9.5 → 1.9.7
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/data/cowork/SKILL.md +11 -10
- package/dist/bin/pushary-bell-hook.js +23 -23
- package/dist/bin/pushary-bell.js +9 -9
- package/dist/bin/pushary-claude.js +26 -26
- package/dist/bin/pushary-clean.js +35 -35
- package/dist/bin/pushary-codex-bridge.js +18 -18
- package/dist/bin/pushary-codex-hook.js +31 -31
- package/dist/bin/pushary-codex.js +13 -13
- package/dist/bin/pushary-connect.js +13 -13
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +27 -26
- package/dist/bin/pushary-disconnect.js +24 -24
- package/dist/bin/pushary-doctor.js +42 -39
- package/dist/bin/pushary-elicitation-hook.js +25 -25
- package/dist/bin/pushary-gemini-bridge.js +13 -13
- package/dist/bin/pushary-gemini-hook.js +28 -28
- package/dist/bin/pushary-hook.js +32 -32
- package/dist/bin/pushary-login.js +12 -12
- package/dist/bin/pushary-logout.js +7 -7
- package/dist/bin/pushary-mcp.js +9 -9
- package/dist/bin/pushary-mode.js +9 -9
- package/dist/bin/pushary-notification-hook.js +28 -28
- package/dist/bin/pushary-opencode-hook.js +27 -27
- package/dist/bin/pushary-permission-denied-hook.js +32 -32
- package/dist/bin/pushary-permission-hook.js +31 -31
- package/dist/bin/pushary-post-hook.js +28 -28
- package/dist/bin/pushary-prompt-hook.js +28 -28
- package/dist/bin/pushary-session-end-hook.js +28 -28
- package/dist/bin/pushary-session-start-hook.js +32 -31
- package/dist/bin/pushary-setup.js +57 -55
- package/dist/bin/pushary-stats.js +5 -5
- package/dist/bin/pushary-status.js +15 -15
- package/dist/bin/pushary-stop-hook.js +28 -28
- package/dist/bin/pushary-stopfailure-hook.js +28 -28
- package/dist/bin/pushary-suggestions.js +4 -4
- package/dist/bin/pushary-transcript-register.js +19 -19
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +34 -28
- package/dist/bin/pushary-wait.js +9 -9
- package/dist/bin/pushary.js +6 -6
- package/dist/{chunk-VZGCXECP.js → chunk-3GNUXXDZ.js} +2 -2
- package/dist/{chunk-LBTOB7Z7.js → chunk-3PVDOCFI.js} +61 -17
- package/dist/{chunk-FQKFONAS.js → chunk-4D2AYNSE.js} +2 -2
- package/dist/{chunk-7AV2KBZC.js → chunk-4FK6RZVJ.js} +1 -1
- package/dist/{chunk-RKEVFUBN.js → chunk-4YO4T5FV.js} +3 -3
- package/dist/{chunk-KSJCYP4I.js → chunk-6DJTDHBI.js} +1 -1
- package/dist/{chunk-23R4BMUP.js → chunk-7264S5HZ.js} +1 -1
- package/dist/{chunk-UQBJTGLX.js → chunk-7OIWWZAD.js} +3 -3
- package/dist/{chunk-5DU7LJ7L.js → chunk-ADSQDYYG.js} +2 -2
- package/dist/{chunk-V3TD72QA.js → chunk-ANEAA37E.js} +3 -3
- package/dist/{chunk-FYEQSB6N.js → chunk-AQ55ZSSS.js} +1 -1
- package/dist/{chunk-IX5EFNCI.js → chunk-AUUXS44H.js} +1 -1
- package/dist/{chunk-CPMVKL6H.js → chunk-AVNKVF7N.js} +4 -4
- package/dist/{chunk-V3ASMZLF.js → chunk-BTQGAXZ3.js} +8 -8
- package/dist/{chunk-M7MMZURA.js → chunk-CBQACHKY.js} +1 -1
- package/dist/{chunk-UM7DXK6V.js → chunk-D6S5EKXA.js} +5 -5
- package/dist/{chunk-2JOP4D2G.js → chunk-EB4XGVBG.js} +2 -2
- package/dist/{chunk-4LVFBQJ3.js → chunk-GKI6LFAV.js} +2 -2
- package/dist/{chunk-NUYECJ57.js → chunk-H37L7TT3.js} +1 -1
- package/dist/{chunk-FNOY2K4N.js → chunk-H7MMU64M.js} +3 -2
- package/dist/{chunk-XXBOA4ZL.js → chunk-HPRZJKRO.js} +1 -1
- package/dist/{chunk-NI2BRIHL.js → chunk-JCWZ23MJ.js} +3 -3
- package/dist/chunk-JWKBDSPF.js +69 -0
- package/dist/{chunk-XEZWDDR5.js → chunk-JWQZSYCK.js} +1 -1
- package/dist/{chunk-ELQAQZNO.js → chunk-JXISQ7DT.js} +3 -3
- package/dist/{chunk-L5XJZKF2.js → chunk-KFKL3FHS.js} +3 -3
- package/dist/{chunk-QEY4SCXT.js → chunk-KT5E2RLS.js} +1 -1
- package/dist/{chunk-K2J6OGGN.js → chunk-KYO45G5L.js} +1 -1
- package/dist/{chunk-CV2IAVD5.js → chunk-L76HTPU6.js} +3 -3
- package/dist/{chunk-GBKM4ULB.js → chunk-MBK7N46B.js} +6 -6
- package/dist/{chunk-5T65DZBH.js → chunk-MNWRUGMH.js} +1 -1
- package/dist/{chunk-NH63BTRO.js → chunk-MZPXVH4A.js} +5 -5
- package/dist/{chunk-EYKHHCLA.js → chunk-N4EUSDKX.js} +4 -4
- package/dist/{chunk-G3W5GP6O.js → chunk-NIBFSARF.js} +25 -6
- package/dist/{chunk-JSVBVV2Q.js → chunk-QFEM7R6T.js} +9 -9
- package/dist/{chunk-TNCINDSF.js → chunk-QQ4HBXZC.js} +6 -6
- package/dist/{chunk-SBR2UKUO.js → chunk-QR6VE5ME.js} +35 -3
- package/dist/{chunk-Q6KNNFGG.js → chunk-QTO6HEZD.js} +27 -8
- package/dist/{chunk-ZJSII7OP.js → chunk-R3YW55MY.js} +10 -10
- package/dist/{chunk-LSYSKKWW.js → chunk-RQGODFQN.js} +8 -4
- package/dist/{chunk-ORBTANP2.js → chunk-RQSOEB4S.js} +1 -1
- package/dist/{chunk-ZW7KE2GP.js → chunk-SBLPHUEB.js} +1 -1
- package/dist/{chunk-3Z7NUGXO.js → chunk-SD3272LS.js} +4 -4
- package/dist/{chunk-HOTK2D2S.js → chunk-STQRUH3S.js} +1 -1
- package/dist/{chunk-6OUATBSK.js → chunk-T7Y5EADL.js} +2 -2
- package/dist/{chunk-6WKOOF2H.js → chunk-UFVGSEWH.js} +2 -2
- package/dist/{chunk-KTIY7ZIA.js → chunk-VXRXFU6Q.js} +9 -7
- package/dist/{chunk-2KH5NTKR.js → chunk-W2KI5KPD.js} +2 -2
- package/dist/{chunk-GRFV6GPY.js → chunk-X5NXPCIC.js} +7 -1
- package/dist/{chunk-2PFD44YK.js → chunk-XWAYAO3V.js} +2 -2
- package/dist/{chunk-2DSUVY6R.js → chunk-Z6HPS67T.js} +1 -1
- package/dist/{chunk-ZBF5WAP7.js → chunk-ZUTU43FT.js} +4 -4
- package/dist/{global-upgrade-GWD4OADP.js → global-upgrade-E2HUEB4B.js} +6 -6
- package/dist/{paths-MJGE4UFY.js → paths-QVTEGNZV.js} +2 -2
- package/dist/{reapply-U6BMGCAB.js → reapply-5QVKM6LA.js} +11 -8
- package/dist/src/index.js +20 -20
- package/dist/{upgrade-lock-HQP6XCER.js → upgrade-lock-JCIDZMHF.js} +5 -3
- package/package.json +1 -1
- package/dist/chunk-G7CZUI4G.js +0 -38
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import {
|
|
2
2
|
clientErrorKindOf,
|
|
3
3
|
reportClientError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AVNKVF7N.js";
|
|
5
5
|
import {
|
|
6
6
|
SubscriptionRequiredError,
|
|
7
7
|
callMcpTool
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-L76HTPU6.js";
|
|
9
9
|
import {
|
|
10
10
|
installNetworkDefaults
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JXISQ7DT.js";
|
|
12
12
|
import {
|
|
13
13
|
getBaseUrl
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-Z6HPS67T.js";
|
|
15
15
|
import {
|
|
16
16
|
ASK_AGENT_NAME_MAX,
|
|
17
17
|
ASK_QUESTION_MAX,
|
|
18
18
|
DECISION_LINE_MAX,
|
|
19
19
|
truncateLine
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-QR6VE5ME.js";
|
|
21
21
|
|
|
22
22
|
// src/api.ts
|
|
23
23
|
import { randomUUID } from "crypto";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyHookExecutable
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4YO4T5FV.js";
|
|
4
4
|
import {
|
|
5
5
|
isProtectedByScope,
|
|
6
6
|
registerHookEntry
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZUTU43FT.js";
|
|
8
8
|
|
|
9
9
|
// src/skills-cli.ts
|
|
10
10
|
import { execSync } from "child_process";
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
decodePublicKey,
|
|
4
4
|
generateSessionKey,
|
|
5
5
|
wrapSessionKey
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-AUUXS44H.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchTranscriptRecipients,
|
|
9
9
|
uploadTranscriptRecords
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-4FK6RZVJ.js";
|
|
11
11
|
|
|
12
12
|
// src/live-session.ts
|
|
13
13
|
var MAX_TRANSCRIPT_QUEUE = 100;
|
|
@@ -8,10 +8,10 @@ import {
|
|
|
8
8
|
codexHooksJsonIn,
|
|
9
9
|
isPusharyCodexCommand,
|
|
10
10
|
resolvePathBinary
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ZUTU43FT.js";
|
|
12
12
|
import {
|
|
13
13
|
getPackageVersion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QR6VE5ME.js";
|
|
15
15
|
|
|
16
16
|
// src/codex-app-server.ts
|
|
17
17
|
import { existsSync, realpathSync } from "fs";
|
|
@@ -327,6 +327,7 @@ var readCodexTrustForPusharyHooks = async (options = {}) => {
|
|
|
327
327
|
};
|
|
328
328
|
|
|
329
329
|
export {
|
|
330
|
+
CODEX_HOOK_STATUS,
|
|
330
331
|
assessCodexHookTrust,
|
|
331
332
|
ensureCodexTrustsPusharyHooks,
|
|
332
333
|
readCodexTrustForPusharyHooks
|
|
@@ -5,16 +5,16 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
NOTIFICATION_MATCHED_TYPES,
|
|
7
7
|
POSTTOOLUSE_MIRRORED_TOOLS
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-6DJTDHBI.js";
|
|
9
9
|
import {
|
|
10
10
|
isProtectedByScope,
|
|
11
11
|
registerHookEntry
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZUTU43FT.js";
|
|
13
13
|
import {
|
|
14
14
|
CLAUDE_PRETOOLUSE_MATCHER,
|
|
15
15
|
HOOK_BUDGETS,
|
|
16
16
|
HOOK_LOCATOR_BINARY
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-QR6VE5ME.js";
|
|
18
18
|
|
|
19
19
|
// src/gemini-config.ts
|
|
20
20
|
var GEMINI_HOOK_BINARY = "pushary-gemini-hook";
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CODEX_HOOK_STATUS
|
|
3
|
+
} from "./chunk-H7MMU64M.js";
|
|
4
|
+
import {
|
|
5
|
+
NPX_LATEST_COMMAND
|
|
6
|
+
} from "./chunk-STQRUH3S.js";
|
|
7
|
+
|
|
8
|
+
// src/setup/codex-trust.ts
|
|
9
|
+
var CODEX_TRUST_TELEMETRY = {
|
|
10
|
+
verified: "verified",
|
|
11
|
+
refused: "manual",
|
|
12
|
+
unlisted: "manual",
|
|
13
|
+
skipped: "unverified",
|
|
14
|
+
unavailable: "unverified"
|
|
15
|
+
};
|
|
16
|
+
var isUnanswered = (confirmation) => confirmation.kind === "skipped" || confirmation.kind === "unavailable";
|
|
17
|
+
var codexTrustOutcome = (confirmation, portedTrustWritten) => isUnanswered(confirmation) && !portedTrustWritten ? "manual" : CODEX_TRUST_TELEMETRY[confirmation.kind];
|
|
18
|
+
var CODEX_TRUST_REFUSED = "Codex did not accept the trust Pushary asked for, so its hooks are not trusted yet. Open Codex, run /hooks, and choose Trust for the Pushary hooks.";
|
|
19
|
+
var CODEX_HOOK_REMEDY = {
|
|
20
|
+
asynchronous: "re-run setup to restore blocking permission hooks",
|
|
21
|
+
missing: "re-run setup to register the permission hooks",
|
|
22
|
+
disabled: "type /hooks in Codex to enable the permission hooks",
|
|
23
|
+
untrusted: "type /hooks in Codex and trust them, once"
|
|
24
|
+
};
|
|
25
|
+
var CODEX_HOOK_REPAIRS = [
|
|
26
|
+
["asynchronous", CODEX_HOOK_STATUS.asynchronous],
|
|
27
|
+
["missing", CODEX_HOOK_STATUS.notListed],
|
|
28
|
+
["disabled", CODEX_HOOK_STATUS.disabled]
|
|
29
|
+
];
|
|
30
|
+
var eventsReporting = (readings, status) => readings.filter((reading) => reading.status === status).map((reading) => reading.event);
|
|
31
|
+
var codexHookRemedy = (readings) => {
|
|
32
|
+
for (const [kind, status] of CODEX_HOOK_REPAIRS) {
|
|
33
|
+
const events = eventsReporting(readings, status);
|
|
34
|
+
if (events.length > 0) return { kind, events };
|
|
35
|
+
}
|
|
36
|
+
return { kind: "trust" };
|
|
37
|
+
};
|
|
38
|
+
var needsCodexTrustStep = (confirmation) => confirmation.kind !== "refused" || codexHookRemedy(confirmation.hooks).kind === "trust";
|
|
39
|
+
var describeCodexHookRepair = (kind, events) => `Codex reports the Pushary hooks ${kind} (${events.join(", ")}). To fix it, ${CODEX_HOOK_REMEDY[kind]}.`;
|
|
40
|
+
var describeRefusedCodexTrust = (readings, writeError) => {
|
|
41
|
+
const remedy = codexHookRemedy(readings);
|
|
42
|
+
if (remedy.kind !== "trust") return describeCodexHookRepair(remedy.kind, remedy.events);
|
|
43
|
+
return writeError ? `${CODEX_TRUST_REFUSED} Codex said: ${writeError}` : CODEX_TRUST_REFUSED;
|
|
44
|
+
};
|
|
45
|
+
var describeUnlistedCodexHooks = (warnings) => {
|
|
46
|
+
const said = warnings[0] ? ` Codex said: ${warnings[0]}` : "";
|
|
47
|
+
return `Codex does not list the Pushary hooks, so it will not run them.${said} Run ${NPX_LATEST_COMMAND} doctor for details.`;
|
|
48
|
+
};
|
|
49
|
+
var describeCodexTrustConfirmation = (confirmation) => {
|
|
50
|
+
switch (confirmation.kind) {
|
|
51
|
+
case "verified":
|
|
52
|
+
return confirmation.wrote ? "Codex trusted the Pushary hooks when asked, and confirmed it." : "Codex confirms the Pushary hooks are trusted.";
|
|
53
|
+
case "refused":
|
|
54
|
+
return describeRefusedCodexTrust(confirmation.hooks, confirmation.writeError);
|
|
55
|
+
case "unlisted":
|
|
56
|
+
return describeUnlistedCodexHooks(confirmation.warnings);
|
|
57
|
+
case "skipped":
|
|
58
|
+
return `Pushary did not ask Codex to confirm the trust: ${confirmation.reason}.`;
|
|
59
|
+
case "unavailable":
|
|
60
|
+
return `Codex could not be asked to confirm the Pushary hooks are trusted (${confirmation.reason}).`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
codexTrustOutcome,
|
|
66
|
+
CODEX_HOOK_REMEDY,
|
|
67
|
+
needsCodexTrustStep,
|
|
68
|
+
describeCodexTrustConfirmation
|
|
69
|
+
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readExistingMachineId
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KYO45G5L.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Z6HPS67T.js";
|
|
10
10
|
import {
|
|
11
11
|
clientContextHeaders,
|
|
12
12
|
getPackageVersion
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-QR6VE5ME.js";
|
|
14
14
|
|
|
15
15
|
// src/cli/net.ts
|
|
16
16
|
import { createRequire } from "module";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
pusharyFetch
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JXISQ7DT.js";
|
|
4
4
|
import {
|
|
5
5
|
NetworkError
|
|
6
6
|
} from "./chunk-7QLSKOSU.js";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
} from "./chunk-KZERVKTD.js";
|
|
10
10
|
import {
|
|
11
11
|
getBaseUrl
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-Z6HPS67T.js";
|
|
13
13
|
import {
|
|
14
14
|
isValidApiKey,
|
|
15
15
|
normalizeKeyScope
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-QR6VE5ME.js";
|
|
17
17
|
|
|
18
18
|
// src/session.ts
|
|
19
19
|
var samePusharyAccount = (left, right) => left.kind === "ok" && right.kind === "ok" && left.identity.workspaceId !== "" && left.identity.workspaceId === right.identity.workspaceId && left.identity.siteId === right.identity.siteId;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
keyCheckFromResponse
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-KFKL3FHS.js";
|
|
4
4
|
import {
|
|
5
5
|
installNetworkDefaults
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JXISQ7DT.js";
|
|
7
7
|
import {
|
|
8
8
|
getBaseUrl
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-Z6HPS67T.js";
|
|
10
10
|
|
|
11
11
|
// src/retry.ts
|
|
12
12
|
var isRetryable = (err) => {
|
|
@@ -3,27 +3,27 @@ import {
|
|
|
3
3
|
expectedLaunchCapabilities,
|
|
4
4
|
hasSpawnProvider,
|
|
5
5
|
resolveControlPolicy
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-T7Y5EADL.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-VXRXFU6Q.js";
|
|
14
14
|
import {
|
|
15
15
|
readControlMode,
|
|
16
16
|
readKeySource
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-ADSQDYYG.js";
|
|
18
18
|
import {
|
|
19
19
|
getMachineId
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-KYO45G5L.js";
|
|
21
21
|
import {
|
|
22
22
|
getBaseUrl
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-Z6HPS67T.js";
|
|
24
24
|
import {
|
|
25
25
|
getPackageVersion
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QR6VE5ME.js";
|
|
27
27
|
|
|
28
28
|
// src/machines.ts
|
|
29
29
|
import { hostname } from "os";
|
|
@@ -3,28 +3,28 @@ import {
|
|
|
3
3
|
addPusharyToolPermissions,
|
|
4
4
|
isPusharyHook,
|
|
5
5
|
removeClaudeMcpServers
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-ANEAA37E.js";
|
|
7
7
|
import {
|
|
8
8
|
CLAUDE_HOOK_EVENTS,
|
|
9
9
|
addGeminiMcpServer,
|
|
10
10
|
removeGeminiMcpServer
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JCWZ23MJ.js";
|
|
12
12
|
import {
|
|
13
13
|
CLAUDE_CODE_AGENT,
|
|
14
14
|
parseApplyPatchFiles
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-QFEM7R6T.js";
|
|
16
16
|
import {
|
|
17
17
|
guardBinary,
|
|
18
18
|
holdBudgetOf,
|
|
19
19
|
registerHookEntry
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ZUTU43FT.js";
|
|
21
21
|
import {
|
|
22
22
|
PHONE_ANSWERED_TOOLS,
|
|
23
23
|
hookCompatibleProfile,
|
|
24
24
|
hookCompatibleProfileBySource,
|
|
25
25
|
toToolLookup,
|
|
26
26
|
withHookHoldBudget
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-QR6VE5ME.js";
|
|
28
28
|
|
|
29
29
|
// src/compatible-config.ts
|
|
30
30
|
import { homedir } from "os";
|
|
@@ -14,19 +14,19 @@ import {
|
|
|
14
14
|
} from "./chunk-U4TMAANR.js";
|
|
15
15
|
import {
|
|
16
16
|
callMcpTool
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-L76HTPU6.js";
|
|
18
18
|
import {
|
|
19
19
|
reportedInstallSource
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-4D2AYNSE.js";
|
|
21
21
|
import {
|
|
22
22
|
NPX_LATEST_COMMAND
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-STQRUH3S.js";
|
|
24
24
|
import {
|
|
25
25
|
NO_PAIRING_COMPUTER,
|
|
26
26
|
PAIR_TTL_SECONDS,
|
|
27
27
|
classifyConfirmResponse,
|
|
28
28
|
isAnswerSource
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-QR6VE5ME.js";
|
|
30
30
|
|
|
31
31
|
// src/reach.ts
|
|
32
32
|
var reachVerdict = (channels) => {
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCodexTrustsPusharyHooks
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-H7MMU64M.js";
|
|
4
|
+
import {
|
|
5
|
+
OPENCODE_HOOK_BINARY,
|
|
6
|
+
installOpenCodePlugin,
|
|
7
|
+
openCodeHookArgv,
|
|
8
|
+
openCodePluginDir,
|
|
9
|
+
openCodeWired
|
|
10
|
+
} from "./chunk-X5NXPCIC.js";
|
|
4
11
|
import {
|
|
5
12
|
addClaudeMcpServer,
|
|
6
13
|
addPusharyHooks,
|
|
7
14
|
addPusharyToolPermissions
|
|
8
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-ANEAA37E.js";
|
|
9
16
|
import {
|
|
10
17
|
detectClaudeVersion
|
|
11
18
|
} from "./chunk-RIVNNBEK.js";
|
|
@@ -15,7 +22,7 @@ import {
|
|
|
15
22
|
codexUnprovenHolds,
|
|
16
23
|
codexWired,
|
|
17
24
|
geminiWired
|
|
18
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-4YO4T5FV.js";
|
|
19
26
|
import {
|
|
20
27
|
CLAUDE_HOOK_BINARY,
|
|
21
28
|
CLAUDE_HOOK_EVENTS,
|
|
@@ -26,7 +33,7 @@ import {
|
|
|
26
33
|
needsReregistration,
|
|
27
34
|
registrationSignatures,
|
|
28
35
|
supportedClaudeEvents
|
|
29
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-JCWZ23MJ.js";
|
|
30
37
|
import {
|
|
31
38
|
formatVersion
|
|
32
39
|
} from "./chunk-6ICPEJY5.js";
|
|
@@ -49,7 +56,7 @@ import {
|
|
|
49
56
|
registrationHolderOf,
|
|
50
57
|
resolveGlobalBinary,
|
|
51
58
|
vscodePluginMcp
|
|
52
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-ZUTU43FT.js";
|
|
53
60
|
import {
|
|
54
61
|
readJsonSafe,
|
|
55
62
|
writeFileAtomic,
|
|
@@ -305,13 +312,24 @@ var reapplyCursorPlugin = (apiKey, paths = {}) => reapplyPluginMcp(
|
|
|
305
312
|
apiKey
|
|
306
313
|
);
|
|
307
314
|
var reapplyVsCodePlugin = (apiKey, paths = {}) => reapplyPluginMcp(paths.pluginMcpPath ?? vscodePluginMcp(), apiKey);
|
|
315
|
+
var reapplyOpenCodePlugin = (paths = {}) => {
|
|
316
|
+
const pluginDir = paths.pluginDir ?? openCodePluginDir();
|
|
317
|
+
if (!openCodeWired(pluginDir)) return { configured: false, reapplied: false, hooks: false, mcp: false };
|
|
318
|
+
try {
|
|
319
|
+
installOpenCodePlugin(openCodeHookArgv((paths.resolveBinary ?? resolveGlobalBinary)(OPENCODE_HOOK_BINARY)), pluginDir);
|
|
320
|
+
return { configured: true, reapplied: true, hooks: true, mcp: false };
|
|
321
|
+
} catch {
|
|
322
|
+
return { configured: true, reapplied: false, hooks: false, mcp: false, failed: true };
|
|
323
|
+
}
|
|
324
|
+
};
|
|
308
325
|
var reapplyAllAgents = (apiKey) => {
|
|
309
326
|
const runners = [
|
|
310
327
|
{ id: "claude", label: "Claude Code", run: () => reapplyClaudeSettings(apiKey) },
|
|
311
328
|
{ id: "codex", label: "Codex", run: () => reapplyCodexSettings(apiKey) },
|
|
312
329
|
{ id: "gemini", label: "Gemini CLI", run: () => reapplyGeminiSettings(apiKey) },
|
|
313
330
|
{ id: "cursor", label: "Cursor", run: () => reapplyCursorPlugin(apiKey) },
|
|
314
|
-
{ id: "vscode", label: "VS Code", run: () => reapplyVsCodePlugin(apiKey) }
|
|
331
|
+
{ id: "vscode", label: "VS Code", run: () => reapplyVsCodePlugin(apiKey) },
|
|
332
|
+
{ id: "opencode", label: "OpenCode", run: () => reapplyOpenCodePlugin() }
|
|
315
333
|
];
|
|
316
334
|
const done = [];
|
|
317
335
|
for (const runner of runners) {
|
|
@@ -336,6 +354,7 @@ export {
|
|
|
336
354
|
reapplyGeminiSettings,
|
|
337
355
|
reapplyCursorPlugin,
|
|
338
356
|
reapplyVsCodePlugin,
|
|
357
|
+
reapplyOpenCodePlugin,
|
|
339
358
|
reapplyAllAgents,
|
|
340
359
|
ensureCodexTrustAfterReapply
|
|
341
360
|
};
|
|
@@ -14,36 +14,36 @@ import {
|
|
|
14
14
|
IDLE_PROMPT_NOTIFICATION,
|
|
15
15
|
NOTIFICATION_PUSH_TYPES,
|
|
16
16
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6DJTDHBI.js";
|
|
18
18
|
import {
|
|
19
19
|
cancelQuestion,
|
|
20
20
|
isPolicyConfig,
|
|
21
21
|
sendNotification,
|
|
22
22
|
waitForAnswer
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-D6S5EKXA.js";
|
|
24
24
|
import {
|
|
25
25
|
clientErrorKindOf,
|
|
26
26
|
reportClientError
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-AVNKVF7N.js";
|
|
28
28
|
import {
|
|
29
29
|
withRetry
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-L76HTPU6.js";
|
|
31
31
|
import {
|
|
32
32
|
getMachineId
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-KYO45G5L.js";
|
|
34
34
|
import {
|
|
35
35
|
reportedInstallSource
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-4D2AYNSE.js";
|
|
37
37
|
import {
|
|
38
38
|
canonicalJson
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-ZUTU43FT.js";
|
|
40
40
|
import {
|
|
41
41
|
writeFileAtomic
|
|
42
42
|
} from "./chunk-T7E75EKA.js";
|
|
43
43
|
import {
|
|
44
44
|
getApiKey,
|
|
45
45
|
getBaseUrl
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-Z6HPS67T.js";
|
|
47
47
|
import {
|
|
48
48
|
ACTION_BODY_MAX,
|
|
49
49
|
AGENT_LABELS_BY_TYPE,
|
|
@@ -70,7 +70,7 @@ import {
|
|
|
70
70
|
resolvePolicy,
|
|
71
71
|
toToolLookup,
|
|
72
72
|
truncateLine
|
|
73
|
-
} from "./chunk-
|
|
73
|
+
} from "./chunk-QR6VE5ME.js";
|
|
74
74
|
|
|
75
75
|
// src/policy.ts
|
|
76
76
|
import { createHash } from "crypto";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MCP_BRIDGE_BINARY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-W2KI5KPD.js";
|
|
4
4
|
import {
|
|
5
5
|
openCodeConfigDirFrom
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-X5NXPCIC.js";
|
|
7
7
|
import {
|
|
8
8
|
KEY_FILE_MODE
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ADSQDYYG.js";
|
|
10
10
|
import {
|
|
11
11
|
NpmMissingError,
|
|
12
12
|
codexHomeFrom,
|
|
13
13
|
resolvePathBinary
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-ZUTU43FT.js";
|
|
15
15
|
import {
|
|
16
16
|
readJsonSafe,
|
|
17
17
|
writeFileAtomic,
|
|
@@ -19,10 +19,10 @@ import {
|
|
|
19
19
|
} from "./chunk-T7E75EKA.js";
|
|
20
20
|
import {
|
|
21
21
|
NPX_LATEST_COMMAND
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-STQRUH3S.js";
|
|
23
23
|
import {
|
|
24
24
|
HOOK_COMPATIBLE_PROFILES
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-QR6VE5ME.js";
|
|
26
26
|
|
|
27
27
|
// src/hermes-config.ts
|
|
28
28
|
import { execFileSync } from "child_process";
|
|
@@ -520,6 +520,8 @@ var redactSecretsDeep = (text) => redactSecrets(text).replace(HIGH_ENTROPY_RULE.
|
|
|
520
520
|
|
|
521
521
|
// ../contracts/src/shell-analysis.ts
|
|
522
522
|
var SHELL_WORD_SEPARATOR = /[ \t\n]/;
|
|
523
|
+
var ARITHMETIC_EVALUATING_EXPANSION = /\$[#+=~^]*(?:[A-Za-z_][A-Za-z0-9_]*|[0-9]+|[-?$!@*#])?\[/;
|
|
524
|
+
var VISIBLE_ESCAPE = /\\[\s\S]/g;
|
|
523
525
|
var trimShellWhitespace = (command) => command.replace(/^[ \t\n]+|[ \t\n]+$/g, "");
|
|
524
526
|
var DOUBLE_QUOTE_ESCAPABLE = /* @__PURE__ */ new Set(['"', "\\", "$", "`"]);
|
|
525
527
|
var SEGMENT_SEPARATORS = /* @__PURE__ */ new Set([";", "\n", "&", "|"]);
|
|
@@ -576,6 +578,14 @@ var shellVisibleText = (command) => {
|
|
|
576
578
|
}
|
|
577
579
|
return visible;
|
|
578
580
|
};
|
|
581
|
+
var isInertOutsideExpansion = ({ quote, kind }) => kind === "escape" || kind === "text" && quote === "'";
|
|
582
|
+
var opensArithmeticEvaluation = (command) => {
|
|
583
|
+
const lexemes = scanShell(command);
|
|
584
|
+
if (lexemes === null) return true;
|
|
585
|
+
const expandableText = lexemes.map((lexeme) => isInertOutsideExpansion(lexeme) ? "_".repeat(lexeme.text.length) : lexeme.text).join("");
|
|
586
|
+
return ARITHMETIC_EVALUATING_EXPANSION.test(expandableText);
|
|
587
|
+
};
|
|
588
|
+
var withoutShellEscapes = (visible) => visible.replace(VISIBLE_ESCAPE, (escape) => "_".repeat(escape.length));
|
|
579
589
|
var shellWordsOf = (command) => {
|
|
580
590
|
const lexemes = scanShell(command);
|
|
581
591
|
if (lexemes === null) return null;
|
|
@@ -687,6 +697,26 @@ var clientContextHeaders = (source) => {
|
|
|
687
697
|
if (isClientPlatform(source.platform)) headers[CLIENT_CONTEXT_HEADERS.platform] = source.platform;
|
|
688
698
|
return headers;
|
|
689
699
|
};
|
|
700
|
+
var AGENT_SITE_REJECTION_REASONS = [
|
|
701
|
+
"pairing_user_blank",
|
|
702
|
+
"pairing_user_mismatch",
|
|
703
|
+
"site_header_blank",
|
|
704
|
+
"device_token_blank",
|
|
705
|
+
"device_token_too_long",
|
|
706
|
+
"device_not_found",
|
|
707
|
+
"not_site_member",
|
|
708
|
+
"sandbox_site",
|
|
709
|
+
"no_current_site"
|
|
710
|
+
];
|
|
711
|
+
var AUTH_REJECTION_REASONS = [
|
|
712
|
+
"malformed_key",
|
|
713
|
+
"unknown_key",
|
|
714
|
+
"expired_key",
|
|
715
|
+
"scope_denied",
|
|
716
|
+
"oauth_rejected",
|
|
717
|
+
"site_not_found",
|
|
718
|
+
...AGENT_SITE_REJECTION_REASONS
|
|
719
|
+
];
|
|
690
720
|
|
|
691
721
|
// ../contracts/src/index.ts
|
|
692
722
|
var KEY_SCOPES = ["full_access", "agent", "connector", "bound"];
|
|
@@ -1047,7 +1077,6 @@ var SAFE_SHELL_COMMANDS = /* @__PURE__ */ new Set([
|
|
|
1047
1077
|
"tail",
|
|
1048
1078
|
"wc",
|
|
1049
1079
|
"echo",
|
|
1050
|
-
"printf",
|
|
1051
1080
|
"which",
|
|
1052
1081
|
"type",
|
|
1053
1082
|
"whoami",
|
|
@@ -1220,6 +1249,7 @@ var isSafeSimpleCommand = (segment) => {
|
|
|
1220
1249
|
}
|
|
1221
1250
|
if (exe === "sed") return isPrintOnlySed(tokens.slice(1));
|
|
1222
1251
|
if (exe === "date") return isReadOnlyDate(tokens.slice(1));
|
|
1252
|
+
if (exe === "printf") return isOutputOnlyPrintf(tokens.slice(1));
|
|
1223
1253
|
return SAFE_SHELL_COMMANDS.has(exe);
|
|
1224
1254
|
};
|
|
1225
1255
|
var SED_PRINT_ONLY_SCRIPT = /^(?:\d+|\$)(?:,(?:\d+|\$))?p$/;
|
|
@@ -1229,11 +1259,12 @@ var DATE_UTC_FLAG = "-u";
|
|
|
1229
1259
|
var isFlagToken = (token) => token.startsWith("-");
|
|
1230
1260
|
var isPrintOnlySed = (args) => args[0] === SED_QUIET_FLAG && SED_PRINT_ONLY_SCRIPT.test(args[1] ?? "") && !args.slice(2).some(isFlagToken);
|
|
1231
1261
|
var isReadOnlyDate = (args) => args.every((arg) => arg.startsWith(DATE_FORMAT_PREFIX) || arg === DATE_UTC_FLAG);
|
|
1262
|
+
var isOutputOnlyPrintf = (args) => args[0] === END_OF_OPTIONS || !isFlagToken(args[0] ?? "");
|
|
1232
1263
|
var READ_ONLY_SEGMENT_SEPARATOR = /&&|\|\||[;|]/g;
|
|
1233
1264
|
var PIPELINE_CHAIN_SEPARATOR = /&&|\|\||;/g;
|
|
1234
1265
|
var EXPANSION_THAT_CAN_BECOME_A_FLAG = /\$|(?:^|\s)[*?[]/;
|
|
1235
1266
|
var SHELL_QUOTE_CHARACTERS = /['"]/g;
|
|
1236
|
-
var INSPECTED_ARGUMENT_COMMANDS = /* @__PURE__ */ new Set(["git", "find", "sed", "date"]);
|
|
1267
|
+
var INSPECTED_ARGUMENT_COMMANDS = /* @__PURE__ */ new Set(["git", "find", "sed", "date", "printf"]);
|
|
1237
1268
|
var argumentsMayExpand = (segment) => {
|
|
1238
1269
|
const visible = shellVisibleText(segment);
|
|
1239
1270
|
return visible === null || EXPANSION_THAT_CAN_BECOME_A_FLAG.test(visible.replace(SHELL_QUOTE_CHARACTERS, ""));
|
|
@@ -1242,7 +1273,7 @@ var blankedSafeRedirections = (text) => text.replace(SAFE_REDIRECTION, (redirect
|
|
|
1242
1273
|
var segmentsSplitWhereVisible = (command, visible, separators) => {
|
|
1243
1274
|
const segments = [];
|
|
1244
1275
|
let start = 0;
|
|
1245
|
-
for (const separator of visible.matchAll(separators)) {
|
|
1276
|
+
for (const separator of withoutShellEscapes(visible).matchAll(separators)) {
|
|
1246
1277
|
segments.push(command.slice(start, separator.index));
|
|
1247
1278
|
start = separator.index + separator[0].length;
|
|
1248
1279
|
}
|
|
@@ -1257,6 +1288,7 @@ var isSafeReadOnlyCommand = (command) => {
|
|
|
1257
1288
|
if (visible === null || /[`{}]|\$'/.test(visible)) return false;
|
|
1258
1289
|
if (/\\(?![()!])/.test(visible)) return false;
|
|
1259
1290
|
if (/(?<!\\)[()]/.test(visible)) return false;
|
|
1291
|
+
if (opensArithmeticEvaluation(trimmed)) return false;
|
|
1260
1292
|
const visibleWithoutRedirection = blankedSafeRedirections(visible);
|
|
1261
1293
|
if (/[<>]/.test(visibleWithoutRedirection)) return false;
|
|
1262
1294
|
if (visibleWithoutRedirection.replace(/&&/g, " ").includes("&")) return false;
|