@pushary/agent-hooks 0.87.4 → 0.88.1
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 +20 -0
- package/data/cursor-plugin/scripts/pushary-gate.mjs +63 -7
- package/data/vscode-plugin/scripts/pushary-gate.mjs +56 -18
- package/dist/bin/pushary-bell-hook.js +4 -4
- package/dist/bin/pushary-bell.js +7 -7
- package/dist/bin/pushary-claude.js +9 -9
- package/dist/bin/pushary-clean.js +13 -14
- package/dist/bin/pushary-codex-bridge.js +6 -6
- package/dist/bin/pushary-codex-hook.js +15 -9
- package/dist/bin/pushary-codex.js +4 -4
- package/dist/bin/pushary-connect.js +6 -6
- package/dist/bin/pushary-daemon.js +5 -5
- package/dist/bin/pushary-disconnect.js +9 -11
- package/dist/bin/pushary-doctor.js +17 -16
- package/dist/bin/pushary-elicitation-hook.js +7 -120
- package/dist/bin/pushary-gemini-bridge.js +6 -6
- package/dist/bin/pushary-gemini-hook.js +15 -9
- package/dist/bin/pushary-hook.js +6 -6
- package/dist/bin/pushary-login.js +4 -4
- package/dist/bin/pushary-logout.js +4 -4
- package/dist/bin/pushary-mode.js +3 -3
- package/dist/bin/pushary-notification-hook.js +4 -4
- package/dist/bin/pushary-opencode-hook.js +5 -5
- package/dist/bin/pushary-permission-denied-hook.js +6 -6
- package/dist/bin/pushary-permission-hook.js +6 -6
- package/dist/bin/pushary-post-hook.js +4 -4
- package/dist/bin/pushary-prompt-hook.js +4 -4
- package/dist/bin/pushary-session-end-hook.js +4 -4
- package/dist/bin/pushary-session-start-hook.js +4 -4
- package/dist/bin/pushary-setup.js +26 -25
- package/dist/bin/pushary-stats.js +2 -2
- package/dist/bin/pushary-status.js +5 -5
- package/dist/bin/pushary-stop-hook.js +4 -4
- package/dist/bin/pushary-stopfailure-hook.js +4 -4
- package/dist/bin/pushary-upgrade.js +9 -11
- package/dist/bin/pushary-wait.js +3 -3
- package/dist/{chunk-H5PIPIKQ.js → chunk-4FANZF2L.js} +2 -2
- package/dist/{chunk-ZGC3W23N.js → chunk-4KMWTOBK.js} +4 -1
- package/dist/{chunk-QLMX5LLV.js → chunk-6GBQDZ7K.js} +1 -1
- package/dist/{chunk-B7ZBHWOW.js → chunk-AIGDBRIJ.js} +1 -1
- package/dist/{chunk-KBS53WOE.js → chunk-AJ4EMW5D.js} +1 -1
- package/dist/{chunk-ICERLAE2.js → chunk-DLI5IXSD.js} +1 -1
- package/dist/{chunk-YX6ZKCC5.js → chunk-EKNFTIKO.js} +1 -1
- package/dist/{chunk-K42RXJPG.js → chunk-F3ZDPL6O.js} +187 -60
- package/dist/{chunk-NAPRGHZ3.js → chunk-FRH2QIMY.js} +1 -1
- package/dist/{chunk-TV3UFGT7.js → chunk-LNAQWWBP.js} +1 -1
- package/dist/{chunk-7J67NYK4.js → chunk-LXTX5CT7.js} +2 -1
- package/dist/{chunk-KULUNLRO.js → chunk-O7P7O4VY.js} +3 -7
- package/dist/{chunk-VOE4SYPR.js → chunk-OSE7X44J.js} +23 -7
- package/dist/{chunk-VIHRP25S.js → chunk-PXEFENML.js} +1 -1
- package/dist/{chunk-DMW54VWK.js → chunk-Q6MK2YKV.js} +213 -4
- package/dist/{chunk-EJL3PJU7.js → chunk-SHVW5KFR.js} +1 -1
- package/dist/{chunk-QXZ2CKRK.js → chunk-SUZF64M4.js} +2 -2
- package/dist/{chunk-BFBAHOGR.js → chunk-U44C3ULB.js} +1 -1
- package/dist/{chunk-OMA2OZRE.js → chunk-U65EIMUJ.js} +27 -62
- package/dist/{chunk-KFAH6KRE.js → chunk-WFFPWJN6.js} +1 -1
- package/dist/{chunk-YYTLTEGU.js → chunk-WPDMGNQR.js} +1 -1
- package/dist/{chunk-TD3M232T.js → chunk-ZPRF4YLA.js} +1 -1
- package/dist/src/index.js +6 -6
- package/package.json +1 -1
- package/dist/chunk-2JYQAW4B.js +0 -137
- /package/dist/{chunk-VT4IVERX.js → chunk-PZA7G4CN.js} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
acquireDaemonLease,
|
|
9
9
|
readDaemonStatus,
|
|
10
10
|
requestDaemonHandoff
|
|
11
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-4FANZF2L.js";
|
|
12
12
|
import {
|
|
13
13
|
CODEX_BRIDGE_CAPABILITY,
|
|
14
14
|
CODEX_RESUME_CAPABILITY,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import {
|
|
18
18
|
findLiveProcessBySpawnId,
|
|
19
19
|
ownsLiveProcess
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-U44C3ULB.js";
|
|
21
21
|
import {
|
|
22
22
|
spawnClaude
|
|
23
23
|
} from "../chunk-XHKBHWLX.js";
|
|
@@ -25,8 +25,8 @@ import {
|
|
|
25
25
|
resolveBinary,
|
|
26
26
|
resolveGlobalPackageVersion,
|
|
27
27
|
resolvePackageVersionFromBinary
|
|
28
|
-
} from "../chunk-
|
|
29
|
-
import "../chunk-
|
|
28
|
+
} from "../chunk-PZA7G4CN.js";
|
|
29
|
+
import "../chunk-FRH2QIMY.js";
|
|
30
30
|
import "../chunk-GIRT7677.js";
|
|
31
31
|
import {
|
|
32
32
|
getMachineId
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
getApiKey,
|
|
45
45
|
getBaseUrl
|
|
46
46
|
} from "../chunk-2UMNXADU.js";
|
|
47
|
-
import "../chunk-
|
|
47
|
+
import "../chunk-Q6MK2YKV.js";
|
|
48
48
|
|
|
49
49
|
// src/spawn-daemon.ts
|
|
50
50
|
import { execFileSync, spawn } from "child_process";
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
removeClaudeMcpServers,
|
|
4
|
-
removePusharySettings
|
|
5
|
-
} from "../chunk-2JYQAW4B.js";
|
|
6
2
|
import {
|
|
7
3
|
OPENCODE_PLUGIN_SIBLING,
|
|
8
4
|
OPENCODE_PLUGIN_SIBLING_CONTENTS,
|
|
@@ -12,13 +8,15 @@ import {
|
|
|
12
8
|
openCodePluginDir,
|
|
13
9
|
openCodePluginFile,
|
|
14
10
|
removeOpenCodeMcpServer
|
|
15
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-4KMWTOBK.js";
|
|
16
12
|
import {
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
removeClaudeMcpServers,
|
|
14
|
+
removeGeminiSettings,
|
|
15
|
+
removePusharySettings
|
|
16
|
+
} from "../chunk-F3ZDPL6O.js";
|
|
19
17
|
import "../chunk-ATBKJNWS.js";
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
18
|
+
import "../chunk-AIGDBRIJ.js";
|
|
19
|
+
import "../chunk-PZA7G4CN.js";
|
|
22
20
|
import {
|
|
23
21
|
claudeJson,
|
|
24
22
|
claudeSettings,
|
|
@@ -31,7 +29,7 @@ import {
|
|
|
31
29
|
geminiSettings,
|
|
32
30
|
removeCodexHooks,
|
|
33
31
|
removeCodexSettings
|
|
34
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-FRH2QIMY.js";
|
|
35
33
|
import "../chunk-GIRT7677.js";
|
|
36
34
|
import {
|
|
37
35
|
exitOnHelpFlag
|
|
@@ -39,7 +37,7 @@ import {
|
|
|
39
37
|
import "../chunk-GOEXZ5QJ.js";
|
|
40
38
|
import "../chunk-DINDL2CF.js";
|
|
41
39
|
import "../chunk-KZERVKTD.js";
|
|
42
|
-
import "../chunk-
|
|
40
|
+
import "../chunk-Q6MK2YKV.js";
|
|
43
41
|
|
|
44
42
|
// bin/pushary-disconnect.ts
|
|
45
43
|
import { readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
@@ -6,12 +6,11 @@ import {
|
|
|
6
6
|
claudeWired,
|
|
7
7
|
codexWired,
|
|
8
8
|
geminiWired
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-SUZF64M4.js";
|
|
10
10
|
import {
|
|
11
11
|
readDaemonStatus
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-4FANZF2L.js";
|
|
13
13
|
import {
|
|
14
|
-
CURSOR_GATE_EVENTS,
|
|
15
14
|
agentProbes,
|
|
16
15
|
detectAgent,
|
|
17
16
|
detectAllAgents,
|
|
@@ -19,24 +18,24 @@ import {
|
|
|
19
18
|
isDetected,
|
|
20
19
|
isPluginRegistered,
|
|
21
20
|
vscodeSettingsTargets
|
|
22
|
-
} from "../chunk-
|
|
21
|
+
} from "../chunk-O7P7O4VY.js";
|
|
23
22
|
import {
|
|
24
23
|
OPENCODE_PLUGIN_PLACEHOLDER,
|
|
25
24
|
openCodePluginDir,
|
|
26
25
|
openCodePluginFile,
|
|
27
26
|
openCodeWired
|
|
28
|
-
} from "../chunk-
|
|
27
|
+
} from "../chunk-4KMWTOBK.js";
|
|
29
28
|
import {
|
|
30
29
|
GEMINI_HOOK_BINARY,
|
|
31
30
|
hasGeminiHooks,
|
|
32
31
|
missingGeminiHookEvents
|
|
33
|
-
} from "../chunk-
|
|
32
|
+
} from "../chunk-F3ZDPL6O.js";
|
|
34
33
|
import "../chunk-ATBKJNWS.js";
|
|
35
|
-
import "../chunk-
|
|
34
|
+
import "../chunk-AIGDBRIJ.js";
|
|
36
35
|
import "../chunk-XHKBHWLX.js";
|
|
37
36
|
import {
|
|
38
37
|
execNpm
|
|
39
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-PZA7G4CN.js";
|
|
40
39
|
import {
|
|
41
40
|
claudeJson,
|
|
42
41
|
claudeSettings,
|
|
@@ -56,12 +55,12 @@ import {
|
|
|
56
55
|
readCodexMcpAuth,
|
|
57
56
|
untrustedCodexHookEvents,
|
|
58
57
|
vscodePluginDir
|
|
59
|
-
} from "../chunk-
|
|
58
|
+
} from "../chunk-FRH2QIMY.js";
|
|
60
59
|
import {
|
|
61
60
|
readLedgerSummary
|
|
62
|
-
} from "../chunk-
|
|
61
|
+
} from "../chunk-PXEFENML.js";
|
|
63
62
|
import "../chunk-GIRT7677.js";
|
|
64
|
-
import "../chunk-
|
|
63
|
+
import "../chunk-LXTX5CT7.js";
|
|
65
64
|
import {
|
|
66
65
|
getMachineId
|
|
67
66
|
} from "../chunk-RN3NOEJF.js";
|
|
@@ -71,19 +70,19 @@ import {
|
|
|
71
70
|
fetchChannels,
|
|
72
71
|
reachVerdict,
|
|
73
72
|
verifyRoundTrip
|
|
74
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-SHVW5KFR.js";
|
|
75
74
|
import "../chunk-3EGEA4KH.js";
|
|
76
75
|
import {
|
|
77
76
|
checkApiKey,
|
|
78
77
|
describeKeyCheck
|
|
79
|
-
} from "../chunk-
|
|
78
|
+
} from "../chunk-WFFPWJN6.js";
|
|
80
79
|
import {
|
|
81
80
|
createIo
|
|
82
81
|
} from "../chunk-5RUIFDTP.js";
|
|
83
82
|
import {
|
|
84
83
|
keyPrefix,
|
|
85
84
|
readKeySource
|
|
86
|
-
} from "../chunk-
|
|
85
|
+
} from "../chunk-EKNFTIKO.js";
|
|
87
86
|
import {
|
|
88
87
|
parseFlags
|
|
89
88
|
} from "../chunk-GMXKITVA.js";
|
|
@@ -101,7 +100,7 @@ import {
|
|
|
101
100
|
sendMcpRequest
|
|
102
101
|
} from "../chunk-BSZYIAZL.js";
|
|
103
102
|
import "../chunk-SAF6HGAA.js";
|
|
104
|
-
import "../chunk-
|
|
103
|
+
import "../chunk-AJ4EMW5D.js";
|
|
105
104
|
import {
|
|
106
105
|
UsageError
|
|
107
106
|
} from "../chunk-7QLSKOSU.js";
|
|
@@ -111,7 +110,9 @@ import {
|
|
|
111
110
|
import {
|
|
112
111
|
getBaseUrl
|
|
113
112
|
} from "../chunk-2UMNXADU.js";
|
|
114
|
-
import
|
|
113
|
+
import {
|
|
114
|
+
CURSOR_GATE_EVENTS
|
|
115
|
+
} from "../chunk-Q6MK2YKV.js";
|
|
115
116
|
|
|
116
117
|
// bin/pushary-doctor.ts
|
|
117
118
|
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -23,132 +23,19 @@ import {
|
|
|
23
23
|
getApiKey
|
|
24
24
|
} from "../chunk-2UMNXADU.js";
|
|
25
25
|
import {
|
|
26
|
+
ELICITATION_ANSWERABLE_MODE,
|
|
26
27
|
effectiveWaitSeconds,
|
|
28
|
+
elicitationContent,
|
|
29
|
+
elicitationContentFromAnswers,
|
|
27
30
|
hookWaitDeadline,
|
|
28
31
|
parseAgentQuestionAnswers,
|
|
32
|
+
planElicitationAsk,
|
|
33
|
+
readElicitationFields,
|
|
29
34
|
renderElicitationOutput
|
|
30
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-Q6MK2YKV.js";
|
|
31
36
|
|
|
32
37
|
// bin/pushary-elicitation-hook.ts
|
|
33
38
|
import { basename } from "path";
|
|
34
|
-
|
|
35
|
-
// src/elicitation.ts
|
|
36
|
-
var ANSWERABLE_MODE = "form";
|
|
37
|
-
var MIN_OPTIONS = 2;
|
|
38
|
-
var MAX_MULTI_QUESTIONS = 4;
|
|
39
|
-
var MAX_MULTI_OPTIONS = 4;
|
|
40
|
-
var asRecord = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
41
|
-
var labelFor = (name, property) => typeof property.title === "string" && property.title.trim() ? property.title.trim() : name;
|
|
42
|
-
var stringEnum = (property) => {
|
|
43
|
-
if (!Array.isArray(property.enum)) return null;
|
|
44
|
-
const members = property.enum.filter((member) => typeof member === "string");
|
|
45
|
-
return members.length === property.enum.length && members.length >= MIN_OPTIONS ? members : null;
|
|
46
|
-
};
|
|
47
|
-
var readElicitationFields = (schema) => {
|
|
48
|
-
const record = asRecord(schema);
|
|
49
|
-
const properties = asRecord(record?.properties);
|
|
50
|
-
if (!properties) return null;
|
|
51
|
-
const entries = Object.entries(properties);
|
|
52
|
-
if (entries.length === 0) return null;
|
|
53
|
-
const fields = [];
|
|
54
|
-
for (const [name, raw] of entries) {
|
|
55
|
-
const property = asRecord(raw);
|
|
56
|
-
if (!property) return null;
|
|
57
|
-
const label = labelFor(name, property);
|
|
58
|
-
if ("enum" in property) {
|
|
59
|
-
const options = stringEnum(property);
|
|
60
|
-
if (!options) return null;
|
|
61
|
-
fields.push({ kind: "choice", name, label, options });
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
switch (property.type) {
|
|
65
|
-
case "string":
|
|
66
|
-
fields.push({ kind: "text", name, label });
|
|
67
|
-
break;
|
|
68
|
-
case "number":
|
|
69
|
-
fields.push({ kind: "number", name, label, integer: false });
|
|
70
|
-
break;
|
|
71
|
-
case "integer":
|
|
72
|
-
fields.push({ kind: "number", name, label, integer: true });
|
|
73
|
-
break;
|
|
74
|
-
case "boolean":
|
|
75
|
-
fields.push({ kind: "boolean", name, label });
|
|
76
|
-
break;
|
|
77
|
-
// An enum with one member, a nested object, an array, an absent type: all
|
|
78
|
-
// shapes whose value we would be inventing rather than collecting.
|
|
79
|
-
default:
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return fields;
|
|
84
|
-
};
|
|
85
|
-
var questionText = (message, field, alone) => alone ? message : `${message} \u2014 ${field.label}`;
|
|
86
|
-
var planElicitationAsk = (message, fields) => {
|
|
87
|
-
if (fields.length === 1) {
|
|
88
|
-
const field = fields[0];
|
|
89
|
-
const question = questionText(message, field, true);
|
|
90
|
-
switch (field.kind) {
|
|
91
|
-
case "choice":
|
|
92
|
-
return { kind: "select", field, question, options: field.options };
|
|
93
|
-
case "boolean":
|
|
94
|
-
return { kind: "confirm", field, question };
|
|
95
|
-
case "text":
|
|
96
|
-
case "number":
|
|
97
|
-
return { kind: "input", field, question };
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (fields.length > MAX_MULTI_QUESTIONS) return null;
|
|
101
|
-
if (!fields.every((field) => field.kind === "choice" && field.options.length <= MAX_MULTI_OPTIONS)) return null;
|
|
102
|
-
const questions = fields.map((field) => ({
|
|
103
|
-
question: questionText(message, field, false),
|
|
104
|
-
header: field.label.slice(0, 12),
|
|
105
|
-
multiSelect: false,
|
|
106
|
-
options: field.options.map((label) => ({ label }))
|
|
107
|
-
}));
|
|
108
|
-
return new Set(questions.map((question) => question.question)).size === questions.length ? { kind: "questions", fields, questions } : null;
|
|
109
|
-
};
|
|
110
|
-
var CONFIRMED = /* @__PURE__ */ new Set(["yes", "true", "approve", "approved", "allow"]);
|
|
111
|
-
var REFUSED = /* @__PURE__ */ new Set(["no", "false", "deny", "denied", "reject"]);
|
|
112
|
-
var numberFrom = (raw, integer) => {
|
|
113
|
-
const trimmed = raw.trim();
|
|
114
|
-
if (!/^-?\d+(\.\d+)?$/.test(trimmed)) return null;
|
|
115
|
-
const value = Number(trimmed);
|
|
116
|
-
if (!Number.isFinite(value)) return null;
|
|
117
|
-
return integer && !Number.isInteger(value) ? null : value;
|
|
118
|
-
};
|
|
119
|
-
var elicitationContent = (ask, answer) => {
|
|
120
|
-
const value = answer.trim();
|
|
121
|
-
if (!value) return null;
|
|
122
|
-
if (ask.kind === "input") {
|
|
123
|
-
if (ask.field.kind === "number") {
|
|
124
|
-
const parsed = numberFrom(value, ask.field.integer);
|
|
125
|
-
return parsed === null ? null : { [ask.field.name]: parsed };
|
|
126
|
-
}
|
|
127
|
-
return { [ask.field.name]: value };
|
|
128
|
-
}
|
|
129
|
-
if (ask.kind === "confirm") {
|
|
130
|
-
const lowered = value.toLowerCase();
|
|
131
|
-
if (CONFIRMED.has(lowered)) return { [ask.field.name]: true };
|
|
132
|
-
if (REFUSED.has(lowered)) return { [ask.field.name]: false };
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
if (ask.kind === "select") {
|
|
136
|
-
return ask.options.includes(value) ? { [ask.field.name]: value } : null;
|
|
137
|
-
}
|
|
138
|
-
return null;
|
|
139
|
-
};
|
|
140
|
-
var elicitationContentFromAnswers = (ask, answers) => {
|
|
141
|
-
const content = {};
|
|
142
|
-
for (const [index, field] of ask.fields.entries()) {
|
|
143
|
-
if (field.kind !== "choice") return null;
|
|
144
|
-
const chosen = answers[ask.questions[index].question];
|
|
145
|
-
if (typeof chosen !== "string" || !field.options.includes(chosen)) return null;
|
|
146
|
-
content[field.name] = chosen;
|
|
147
|
-
}
|
|
148
|
-
return content;
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
// bin/pushary-elicitation-hook.ts
|
|
152
39
|
var START_MS = Date.now();
|
|
153
40
|
var answered = (ask, answer) => {
|
|
154
41
|
if (!answer.answered || isDeferAnswer(answer.value)) return null;
|
|
@@ -161,7 +48,7 @@ var answered = (ask, answer) => {
|
|
|
161
48
|
var main = async () => {
|
|
162
49
|
const input = await readHookInput("claude", "Elicitation");
|
|
163
50
|
if (!input || input.hook_event_name !== "Elicitation") return;
|
|
164
|
-
if (input.mode !==
|
|
51
|
+
if (input.mode !== ELICITATION_ANSWERABLE_MODE) return;
|
|
165
52
|
const message = (input.message ?? "").trim();
|
|
166
53
|
if (!message) return;
|
|
167
54
|
const fields = readElicitationFields(input.requested_schema);
|
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
postLiveSession,
|
|
6
6
|
postLiveSessionUntilAccepted,
|
|
7
7
|
startLiveSessionHeartbeat
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-LNAQWWBP.js";
|
|
9
|
+
import "../chunk-6GBQDZ7K.js";
|
|
10
10
|
import {
|
|
11
11
|
startProcessOwnership,
|
|
12
12
|
withSpawnProcessOwnership
|
|
13
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-U44C3ULB.js";
|
|
14
14
|
import {
|
|
15
15
|
spawnClaude
|
|
16
16
|
} from "../chunk-XHKBHWLX.js";
|
|
17
17
|
import {
|
|
18
18
|
resolveBinary
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-PZA7G4CN.js";
|
|
20
|
+
import "../chunk-FRH2QIMY.js";
|
|
21
21
|
import "../chunk-GIRT7677.js";
|
|
22
22
|
import {
|
|
23
23
|
getMachineId
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
getApiKey,
|
|
28
28
|
getBaseUrl
|
|
29
29
|
} from "../chunk-2UMNXADU.js";
|
|
30
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-Q6MK2YKV.js";
|
|
31
31
|
|
|
32
32
|
// bin/pushary-gemini-bridge.ts
|
|
33
33
|
import { existsSync } from "fs";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isGatingMoment,
|
|
4
4
|
recordKeylessMoment
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-PXEFENML.js";
|
|
6
6
|
import {
|
|
7
7
|
readHookInput
|
|
8
8
|
} from "../chunk-6CUUA7HO.js";
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
readLastUserPrompt,
|
|
22
22
|
repoKeyFor,
|
|
23
23
|
reportEvent
|
|
24
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-OSE7X44J.js";
|
|
25
25
|
import {
|
|
26
26
|
DEFAULT_SESSION,
|
|
27
27
|
askUser,
|
|
@@ -36,13 +36,13 @@ import {
|
|
|
36
36
|
deriveToolTarget,
|
|
37
37
|
describeToolCall,
|
|
38
38
|
scopePathFor
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-LXTX5CT7.js";
|
|
40
40
|
import {
|
|
41
41
|
getMachineId
|
|
42
42
|
} from "../chunk-RN3NOEJF.js";
|
|
43
43
|
import "../chunk-BSZYIAZL.js";
|
|
44
44
|
import "../chunk-SAF6HGAA.js";
|
|
45
|
-
import "../chunk-
|
|
45
|
+
import "../chunk-AJ4EMW5D.js";
|
|
46
46
|
import "../chunk-7QLSKOSU.js";
|
|
47
47
|
import "../chunk-KZERVKTD.js";
|
|
48
48
|
import {
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
hookWaitClamped,
|
|
57
57
|
hookWaitDeadline,
|
|
58
58
|
resolveGate
|
|
59
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-Q6MK2YKV.js";
|
|
60
60
|
|
|
61
61
|
// bin/pushary-gemini-hook.ts
|
|
62
62
|
import { basename } from "path";
|
|
@@ -286,6 +286,12 @@ var toCanonicalResult = (toolResponse) => {
|
|
|
286
286
|
const error = toolResponse.error;
|
|
287
287
|
return error ? { error } : {};
|
|
288
288
|
};
|
|
289
|
+
var emitContext = (event, additionalContext) => {
|
|
290
|
+
if (!additionalContext) return;
|
|
291
|
+
process.stdout.write(JSON.stringify({
|
|
292
|
+
hookSpecificOutput: { hookEventName: event, additionalContext }
|
|
293
|
+
}));
|
|
294
|
+
};
|
|
289
295
|
var emit = (wire) => {
|
|
290
296
|
if (wire) process.stdout.write(JSON.stringify(wire));
|
|
291
297
|
};
|
|
@@ -301,22 +307,22 @@ var main = async () => {
|
|
|
301
307
|
break;
|
|
302
308
|
case "AfterTool": {
|
|
303
309
|
const lookup = toGeminiPolicyLookup(input.tool_name ?? "", input.tool_input ?? {});
|
|
304
|
-
await handlePostToolUse({
|
|
310
|
+
emitContext("AfterTool", await handlePostToolUse({
|
|
305
311
|
tool_name: lookup.tool,
|
|
306
312
|
tool_input: lookup.input,
|
|
307
313
|
tool_result: toCanonicalResult(input.tool_response),
|
|
308
314
|
cwd: input.cwd,
|
|
309
315
|
session_id: input.session_id,
|
|
310
316
|
transcript_path: input.transcript_path
|
|
311
|
-
}, GEMINI_AGENT);
|
|
317
|
+
}, GEMINI_AGENT));
|
|
312
318
|
break;
|
|
313
319
|
}
|
|
314
320
|
case "BeforeAgent":
|
|
315
|
-
await handleUserPrompt({
|
|
321
|
+
emitContext("BeforeAgent", await handleUserPrompt({
|
|
316
322
|
prompt: input.prompt,
|
|
317
323
|
cwd: input.cwd,
|
|
318
324
|
session_id: input.session_id
|
|
319
|
-
}, GEMINI_AGENT);
|
|
325
|
+
}, GEMINI_AGENT));
|
|
320
326
|
break;
|
|
321
327
|
case "SessionEnd":
|
|
322
328
|
if (geminiOwnsLifecycle(process.env.PUSHARY_GEMINI_BRIDGE)) {
|
package/dist/bin/pushary-hook.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePreToolUse
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-U65EIMUJ.js";
|
|
5
5
|
import "../chunk-ATBKJNWS.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-PXEFENML.js";
|
|
7
7
|
import {
|
|
8
8
|
readHookInput
|
|
9
9
|
} from "../chunk-6CUUA7HO.js";
|
|
10
10
|
import "../chunk-YHG74UFF.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-OSE7X44J.js";
|
|
12
12
|
import "../chunk-J3YDT4HM.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-LXTX5CT7.js";
|
|
14
14
|
import "../chunk-RN3NOEJF.js";
|
|
15
15
|
import {
|
|
16
16
|
exitOnHelpFlag
|
|
@@ -19,11 +19,11 @@ import "../chunk-GOEXZ5QJ.js";
|
|
|
19
19
|
import "../chunk-DINDL2CF.js";
|
|
20
20
|
import "../chunk-BSZYIAZL.js";
|
|
21
21
|
import "../chunk-SAF6HGAA.js";
|
|
22
|
-
import "../chunk-
|
|
22
|
+
import "../chunk-AJ4EMW5D.js";
|
|
23
23
|
import "../chunk-7QLSKOSU.js";
|
|
24
24
|
import "../chunk-KZERVKTD.js";
|
|
25
25
|
import "../chunk-2UMNXADU.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-Q6MK2YKV.js";
|
|
27
27
|
|
|
28
28
|
// bin/pushary-hook.ts
|
|
29
29
|
exitOnHelpFlag("hook");
|
|
@@ -6,14 +6,14 @@ import "../chunk-3EGEA4KH.js";
|
|
|
6
6
|
import {
|
|
7
7
|
checkApiKey,
|
|
8
8
|
describeKeyCheck
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-WFFPWJN6.js";
|
|
10
10
|
import {
|
|
11
11
|
createIo
|
|
12
12
|
} from "../chunk-5RUIFDTP.js";
|
|
13
13
|
import {
|
|
14
14
|
readKeySource,
|
|
15
15
|
writeKey
|
|
16
|
-
} from "../chunk-
|
|
16
|
+
} from "../chunk-EKNFTIKO.js";
|
|
17
17
|
import {
|
|
18
18
|
parseFlags
|
|
19
19
|
} from "../chunk-GMXKITVA.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
} from "../chunk-DINDL2CF.js";
|
|
28
28
|
import "../chunk-6MTNS63X.js";
|
|
29
29
|
import "../chunk-SAF6HGAA.js";
|
|
30
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-AJ4EMW5D.js";
|
|
31
31
|
import {
|
|
32
32
|
UsageError
|
|
33
33
|
} from "../chunk-7QLSKOSU.js";
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
import "../chunk-2UMNXADU.js";
|
|
38
38
|
import {
|
|
39
39
|
isValidApiKey
|
|
40
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-Q6MK2YKV.js";
|
|
41
41
|
|
|
42
42
|
// bin/pushary-login.ts
|
|
43
43
|
exitOnHelpFlag("login");
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
codexConfigToml,
|
|
5
5
|
cursorUserMcp,
|
|
6
6
|
geminiSettings
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-FRH2QIMY.js";
|
|
8
8
|
import "../chunk-GIRT7677.js";
|
|
9
9
|
import {
|
|
10
10
|
createIo
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
clearKey,
|
|
14
14
|
readKeySource
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-EKNFTIKO.js";
|
|
16
16
|
import {
|
|
17
17
|
parseFlags
|
|
18
18
|
} from "../chunk-GMXKITVA.js";
|
|
@@ -23,7 +23,7 @@ import "../chunk-GOEXZ5QJ.js";
|
|
|
23
23
|
import "../chunk-BC3VCZ3E.js";
|
|
24
24
|
import "../chunk-DINDL2CF.js";
|
|
25
25
|
import "../chunk-6MTNS63X.js";
|
|
26
|
-
import "../chunk-
|
|
26
|
+
import "../chunk-AJ4EMW5D.js";
|
|
27
27
|
import {
|
|
28
28
|
UsageError
|
|
29
29
|
} from "../chunk-7QLSKOSU.js";
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
import {
|
|
34
34
|
getBaseUrl
|
|
35
35
|
} from "../chunk-2UMNXADU.js";
|
|
36
|
-
import "../chunk-
|
|
36
|
+
import "../chunk-Q6MK2YKV.js";
|
|
37
37
|
|
|
38
38
|
// bin/pushary-logout.ts
|
|
39
39
|
import { existsSync } from "fs";
|
package/dist/bin/pushary-mode.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
exitOnFailedResponse
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-ZPRF4YLA.js";
|
|
5
|
+
import "../chunk-WFFPWJN6.js";
|
|
6
6
|
import {
|
|
7
7
|
createIo
|
|
8
8
|
} from "../chunk-5RUIFDTP.js";
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
getApiKey,
|
|
26
26
|
getBaseUrl
|
|
27
27
|
} from "../chunk-2UMNXADU.js";
|
|
28
|
-
import "../chunk-
|
|
28
|
+
import "../chunk-Q6MK2YKV.js";
|
|
29
29
|
|
|
30
30
|
// bin/pushary-mode.ts
|
|
31
31
|
exitOnHelpFlag("mode");
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
} from "../chunk-6CUUA7HO.js";
|
|
5
5
|
import {
|
|
6
6
|
handleNotification
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-OSE7X44J.js";
|
|
8
8
|
import "../chunk-J3YDT4HM.js";
|
|
9
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-LXTX5CT7.js";
|
|
10
10
|
import "../chunk-RN3NOEJF.js";
|
|
11
11
|
import "../chunk-BSZYIAZL.js";
|
|
12
12
|
import "../chunk-SAF6HGAA.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-AJ4EMW5D.js";
|
|
14
14
|
import "../chunk-7QLSKOSU.js";
|
|
15
15
|
import "../chunk-KZERVKTD.js";
|
|
16
16
|
import "../chunk-2UMNXADU.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-Q6MK2YKV.js";
|
|
18
18
|
|
|
19
19
|
// bin/pushary-notification-hook.ts
|
|
20
20
|
var main = async () => {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
isGatingMoment,
|
|
4
4
|
recordKeylessMoment
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-PXEFENML.js";
|
|
6
6
|
import {
|
|
7
7
|
readHookInput
|
|
8
8
|
} from "../chunk-6CUUA7HO.js";
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
policyRequestFor,
|
|
20
20
|
readLastPrompt,
|
|
21
21
|
repoKeyFor
|
|
22
|
-
} from "../chunk-
|
|
22
|
+
} from "../chunk-OSE7X44J.js";
|
|
23
23
|
import {
|
|
24
24
|
DEFAULT_SESSION,
|
|
25
25
|
askUser,
|
|
@@ -35,13 +35,13 @@ import {
|
|
|
35
35
|
deriveToolTarget,
|
|
36
36
|
describeToolCall,
|
|
37
37
|
scopePathFor
|
|
38
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-LXTX5CT7.js";
|
|
39
39
|
import {
|
|
40
40
|
getMachineId
|
|
41
41
|
} from "../chunk-RN3NOEJF.js";
|
|
42
42
|
import "../chunk-BSZYIAZL.js";
|
|
43
43
|
import "../chunk-SAF6HGAA.js";
|
|
44
|
-
import "../chunk-
|
|
44
|
+
import "../chunk-AJ4EMW5D.js";
|
|
45
45
|
import "../chunk-7QLSKOSU.js";
|
|
46
46
|
import "../chunk-KZERVKTD.js";
|
|
47
47
|
import {
|
|
@@ -56,7 +56,7 @@ import {
|
|
|
56
56
|
hookWaitClamped,
|
|
57
57
|
hookWaitDeadline,
|
|
58
58
|
resolveGate
|
|
59
|
-
} from "../chunk-
|
|
59
|
+
} from "../chunk-Q6MK2YKV.js";
|
|
60
60
|
|
|
61
61
|
// bin/pushary-opencode-hook.ts
|
|
62
62
|
import { basename } from "path";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
handlePermissionDenied
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-U65EIMUJ.js";
|
|
5
5
|
import "../chunk-ATBKJNWS.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-PXEFENML.js";
|
|
7
7
|
import {
|
|
8
8
|
readHookInput
|
|
9
9
|
} from "../chunk-6CUUA7HO.js";
|
|
10
10
|
import "../chunk-YHG74UFF.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-OSE7X44J.js";
|
|
12
12
|
import "../chunk-J3YDT4HM.js";
|
|
13
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-LXTX5CT7.js";
|
|
14
14
|
import "../chunk-RN3NOEJF.js";
|
|
15
15
|
import "../chunk-BSZYIAZL.js";
|
|
16
16
|
import "../chunk-SAF6HGAA.js";
|
|
17
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-AJ4EMW5D.js";
|
|
18
18
|
import "../chunk-7QLSKOSU.js";
|
|
19
19
|
import "../chunk-KZERVKTD.js";
|
|
20
20
|
import "../chunk-2UMNXADU.js";
|
|
21
|
-
import "../chunk-
|
|
21
|
+
import "../chunk-Q6MK2YKV.js";
|
|
22
22
|
|
|
23
23
|
// bin/pushary-permission-denied-hook.ts
|
|
24
24
|
var main = async () => {
|