@pushary/agent-hooks 0.95.5 → 0.95.6
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 +7 -0
- package/dist/bin/pushary-bell-hook.js +18 -18
- package/dist/bin/pushary-bell.js +7 -7
- package/dist/bin/pushary-claude.js +19 -19
- package/dist/bin/pushary-clean.js +18 -18
- package/dist/bin/pushary-codex-bridge.js +10 -10
- package/dist/bin/pushary-codex-hook.js +21 -21
- package/dist/bin/pushary-codex.js +7 -7
- package/dist/bin/pushary-connect.js +8 -8
- package/dist/bin/pushary-cowork.js +5 -5
- package/dist/bin/pushary-daemon.js +24 -24
- package/dist/bin/pushary-disconnect.js +8 -8
- package/dist/bin/pushary-doctor.js +88 -34
- package/dist/bin/pushary-elicitation-hook.js +17 -17
- package/dist/bin/pushary-gemini-bridge.js +9 -9
- package/dist/bin/pushary-gemini-hook.js +20 -20
- package/dist/bin/pushary-hook.js +24 -24
- package/dist/bin/pushary-login.js +9 -9
- package/dist/bin/pushary-logout.js +6 -6
- package/dist/bin/pushary-mode.js +5 -5
- package/dist/bin/pushary-notification-hook.js +19 -19
- package/dist/bin/pushary-opencode-hook.js +20 -20
- package/dist/bin/pushary-permission-denied-hook.js +22 -22
- package/dist/bin/pushary-permission-hook.js +22 -22
- package/dist/bin/pushary-post-hook.js +19 -19
- package/dist/bin/pushary-prompt-hook.js +19 -19
- package/dist/bin/pushary-session-end-hook.js +19 -19
- package/dist/bin/pushary-session-start-hook.js +22 -22
- package/dist/bin/pushary-setup.js +45 -38
- package/dist/bin/pushary-stats.js +4 -4
- package/dist/bin/pushary-status.js +14 -10
- package/dist/bin/pushary-stop-hook.js +19 -19
- package/dist/bin/pushary-stopfailure-hook.js +19 -19
- package/dist/bin/pushary-suggestions.js +2 -2
- package/dist/bin/pushary-transcript-register.js +16 -16
- package/dist/bin/pushary-transcripts.js +7 -7
- package/dist/bin/pushary-upgrade.js +16 -16
- package/dist/bin/pushary-wait.js +5 -5
- package/dist/bin/pushary.js +1 -1
- package/dist/{chunk-UCS65VVR.js → chunk-32WFHA77.js} +1 -1
- package/dist/{chunk-IVQMNLSA.js → chunk-32WWVRXN.js} +1 -1
- package/dist/{chunk-HQIVR7MM.js → chunk-43TFQOAT.js} +1 -1
- package/dist/{chunk-2ZTL3PGN.js → chunk-4XFBO3GW.js} +1 -1
- package/dist/{chunk-I6GZX3FT.js → chunk-6II5RBAS.js} +1 -1
- package/dist/{chunk-S5CMLR35.js → chunk-6MRPTYYH.js} +1 -1
- package/dist/{chunk-XLOELLAS.js → chunk-7N3D4GN7.js} +4 -4
- package/dist/{chunk-HBHEX3JQ.js → chunk-A2M6FGUF.js} +3 -3
- package/dist/{chunk-WRDLHR2F.js → chunk-AXECWTTZ.js} +2 -2
- package/dist/{chunk-VOSGZ6PH.js → chunk-BS5XR4J7.js} +3 -3
- package/dist/{chunk-N4VNLISN.js → chunk-C7BFOC35.js} +2 -2
- package/dist/{chunk-2D7BAOMY.js → chunk-CDBTCEKE.js} +3 -3
- package/dist/{chunk-4PX4QK2Z.js → chunk-DH4INZW3.js} +1 -1
- package/dist/{chunk-QQGNFHIK.js → chunk-DSCGKZO5.js} +2 -2
- package/dist/{chunk-OW6AZDY2.js → chunk-FBO5WS3D.js} +1 -1
- package/dist/{chunk-67YNQ3QA.js → chunk-FHIVWF4B.js} +10 -6
- package/dist/{chunk-CUEZMPLJ.js → chunk-FVTFSYKB.js} +1 -1
- package/dist/{chunk-DLLAWCQB.js → chunk-GOQHN2UH.js} +1 -1
- package/dist/{chunk-BDI2MXTT.js → chunk-HBBQO77U.js} +1 -1
- package/dist/{chunk-HGUZOUB2.js → chunk-HHODMHTH.js} +3 -3
- package/dist/{chunk-IM2A5H33.js → chunk-HKQ6CD32.js} +1 -1
- package/dist/{chunk-OI3DJA7N.js → chunk-JZSWA3VT.js} +1 -1
- package/dist/{chunk-KAVDAZ7A.js → chunk-KAWLZTRJ.js} +1 -1
- package/dist/{chunk-QHWXUNMN.js → chunk-KNIVXEW4.js} +1 -1
- package/dist/{chunk-D6PRC3YQ.js → chunk-LZQVAEWP.js} +2 -1
- package/dist/{chunk-KI4PA7MQ.js → chunk-O5RQ7RYJ.js} +90 -18
- package/dist/{chunk-6AEM5RCS.js → chunk-OIZVYUED.js} +1 -1
- package/dist/{chunk-OEKFD5BC.js → chunk-R4MBUCPQ.js} +1 -1
- package/dist/{chunk-6VANQN5Q.js → chunk-RPHXG4HI.js} +2 -2
- package/dist/{chunk-VTO3TNIB.js → chunk-SLVXQOYU.js} +1 -1
- package/dist/{chunk-D62EONG3.js → chunk-SRFA5BOO.js} +1 -1
- package/dist/{chunk-WDKHZRAS.js → chunk-VZADMT7R.js} +41 -0
- package/dist/{chunk-32RMQO5Z.js → chunk-WRK6RAA5.js} +47 -4
- package/dist/{chunk-BMANRGJQ.js → chunk-WZ63WTAZ.js} +1 -1
- package/dist/{chunk-Z2UWFEJW.js → chunk-XJ6CXTSB.js} +7 -7
- package/dist/{chunk-4RF52LSU.js → chunk-XKIB2FQY.js} +8 -8
- package/dist/{chunk-HCMM3BOW.js → chunk-ZJ6QXXBC.js} +8 -5
- package/dist/{chunk-RLXVW4AM.js → chunk-ZQREURP6.js} +1 -1
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.js +10 -10
- package/package.json +1 -1
|
@@ -34,6 +34,7 @@ var defaults = {
|
|
|
34
34
|
setupCommand: null,
|
|
35
35
|
setupChoice: null,
|
|
36
36
|
setupGuide: "",
|
|
37
|
+
activationGuide: null,
|
|
37
38
|
enforcementDetail: "Cooperative. The agent chooses when to ask; no native permission interception.",
|
|
38
39
|
capabilityNote: "",
|
|
39
40
|
documented: true
|
|
@@ -42,6 +43,7 @@ var AGENTS = {
|
|
|
42
43
|
claude_code: {
|
|
43
44
|
...defaults,
|
|
44
45
|
label: "Claude Code",
|
|
46
|
+
activationGuide: "/docs/agents/guides/claude-code#verify-a-real-approval",
|
|
45
47
|
hookSource: "claude",
|
|
46
48
|
policyAgent: "claude_code",
|
|
47
49
|
repoAware: true,
|
|
@@ -958,6 +960,23 @@ p:12:small=n:1e-7`
|
|
|
958
960
|
}
|
|
959
961
|
];
|
|
960
962
|
var AUTHORIZATION_PERMIT_TTL_SECONDS = 60 * 60;
|
|
963
|
+
var ANSWER_SOURCES = [
|
|
964
|
+
"dashboard",
|
|
965
|
+
"mobile_app",
|
|
966
|
+
"mobile_background",
|
|
967
|
+
"decide_page",
|
|
968
|
+
"live_page",
|
|
969
|
+
"answer_link",
|
|
970
|
+
"inbox",
|
|
971
|
+
"slack",
|
|
972
|
+
"mac_app",
|
|
973
|
+
// Nobody. A decision opened on a workspace's sandbox site is settled by the
|
|
974
|
+
// simulator instead of being delivered, and the ledger has to say so: a
|
|
975
|
+
// sandbox row that looked like a human answer would be indistinguishable
|
|
976
|
+
// evidence of a person who was never asked.
|
|
977
|
+
"sandbox"
|
|
978
|
+
];
|
|
979
|
+
var isAnswerSource = (value) => typeof value === "string" && ANSWER_SOURCES.includes(value);
|
|
961
980
|
var classifyDecisionRisk = (toolName, toolTarget) => {
|
|
962
981
|
const parts = [toolName, toolTarget ?? ""];
|
|
963
982
|
const matchesAny = (patterns) => parts.some((part) => patterns.some((re) => re.test(part)));
|
|
@@ -1524,6 +1543,23 @@ var elicitationContentFromAnswers = (ask, answers) => {
|
|
|
1524
1543
|
return content;
|
|
1525
1544
|
};
|
|
1526
1545
|
|
|
1546
|
+
// ../contracts/src/hook-activation.ts
|
|
1547
|
+
var hookWritePath = (toolName, input) => toolName === "Write" && typeof input.file_path === "string" && input.file_path.startsWith("/") && input.file_path.length <= 4096 ? input.file_path : void 0;
|
|
1548
|
+
var HOOK_ACTIVATION_RESULTS = ["unverified", "approved_executed", "denied_observed", "unexpected_execution", "tool_failed"];
|
|
1549
|
+
var isHookActivationReport = (value) => {
|
|
1550
|
+
if (!value || typeof value !== "object") return false;
|
|
1551
|
+
const report = value;
|
|
1552
|
+
return typeof report.agentType === "string" && typeof report.machineId === "string" && typeof report.target === "string" && report.target.length > 0 && report.target.length <= 4096 && typeof report.truncated === "boolean" && Array.isArray(report.evidence) && report.evidence.length <= 20 && (!report.truncated || report.evidence.length === 0) && report.evidence.every((item) => {
|
|
1553
|
+
if (!item || typeof item !== "object") return false;
|
|
1554
|
+
const row = item;
|
|
1555
|
+
return ["correlationId", "sessionId", "toolUseId", "toolName", "createdAt"].every((key) => typeof row[key] === "string" && row[key].length > 0 && row[key].length <= 256) && (row.answerSource === null || isAnswerSource(row.answerSource)) && HOOK_ACTIVATION_RESULTS.includes(row.result) && Number.isFinite(Date.parse(row.createdAt)) && (row.occurredAt === null || typeof row.occurredAt === "string" && Number.isFinite(Date.parse(row.occurredAt))) && (row.observedAt === null || typeof row.observedAt === "string" && Number.isFinite(Date.parse(row.observedAt))) && (row.result === "unverified" || row.occurredAt !== null && row.observedAt !== null && row.producer !== null && isAnswerSource(row.answerSource) && row.answerSource !== "sandbox") && (row.producer === null || row.producer === "hook" || row.producer === "uplink");
|
|
1556
|
+
});
|
|
1557
|
+
};
|
|
1558
|
+
var hookActivationResult = (report) => {
|
|
1559
|
+
if (report?.evidence.some((row) => row.result === "unexpected_execution")) return "unexpected_execution";
|
|
1560
|
+
return report && !report.truncated && report.evidence.length === 1 ? report.evidence[0].result : "unverified";
|
|
1561
|
+
};
|
|
1562
|
+
|
|
1527
1563
|
export {
|
|
1528
1564
|
CLAUDE_CONNECTOR_URL,
|
|
1529
1565
|
CLAUDE_CONNECTOR_GUIDE,
|
|
@@ -1531,11 +1567,15 @@ export {
|
|
|
1531
1567
|
CLAUDE_CONNECTOR_STEPS,
|
|
1532
1568
|
CLAUDE_CONNECTOR_TEST,
|
|
1533
1569
|
COWORK_STANDING_INSTRUCTIONS,
|
|
1570
|
+
AGENTS,
|
|
1534
1571
|
HOOK_SOURCES,
|
|
1535
1572
|
AGENT_LABELS_BY_TYPE,
|
|
1536
1573
|
DISCONNECTABLE_AGENTS,
|
|
1537
1574
|
REPO_AWARE_AGENTS,
|
|
1538
1575
|
MANAGED_PROVIDERS,
|
|
1576
|
+
hookWritePath,
|
|
1577
|
+
isHookActivationReport,
|
|
1578
|
+
hookActivationResult,
|
|
1539
1579
|
normalizeKeyScope,
|
|
1540
1580
|
parseAgentQuestion,
|
|
1541
1581
|
parseAgentQuestions,
|
|
@@ -1558,6 +1598,7 @@ export {
|
|
|
1558
1598
|
DECISION_LINE_MAX,
|
|
1559
1599
|
redactSecrets,
|
|
1560
1600
|
redactSecretsDeep,
|
|
1601
|
+
isAnswerSource,
|
|
1561
1602
|
buildDecisionEpisodeFeatures,
|
|
1562
1603
|
resolveAutoResolveOrigin,
|
|
1563
1604
|
resolvePolicy,
|
|
@@ -1,9 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
detectProviderLiveCapabilities,
|
|
3
|
+
hasSpawnProvider,
|
|
4
|
+
resolveControlPolicy
|
|
5
|
+
} from "./chunk-HKQ6CD32.js";
|
|
6
|
+
import {
|
|
7
|
+
daemonHasRemoteProof,
|
|
8
|
+
daemonServiceManagerAvailable,
|
|
9
|
+
hasDaemonServiceDefinition,
|
|
10
|
+
readDaemonNeedsLogin,
|
|
11
|
+
readDaemonStatus
|
|
12
|
+
} from "./chunk-7N3D4GN7.js";
|
|
1
13
|
import {
|
|
2
14
|
getMachineId
|
|
3
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-C7BFOC35.js";
|
|
4
16
|
import {
|
|
5
17
|
getPackageVersion
|
|
6
18
|
} from "./chunk-DINDL2CF.js";
|
|
19
|
+
import {
|
|
20
|
+
readControlMode,
|
|
21
|
+
readKeySource
|
|
22
|
+
} from "./chunk-6MRPTYYH.js";
|
|
7
23
|
import {
|
|
8
24
|
getBaseUrl
|
|
9
25
|
} from "./chunk-2UMNXADU.js";
|
|
@@ -50,7 +66,7 @@ var parseMachine = (value) => {
|
|
|
50
66
|
online: raw.online === true
|
|
51
67
|
};
|
|
52
68
|
};
|
|
53
|
-
var machineReadiness = (machines, machineId, expectedCapabilities) => {
|
|
69
|
+
var machineReadiness = (machines, machineId, expectedCapabilities, now = Date.now()) => {
|
|
54
70
|
const machine = machines.find((item) => item.machineId === machineId);
|
|
55
71
|
if (!machine) return { kind: "not-ready", detail: "this machine has not heartbeated to the server" };
|
|
56
72
|
if (!machine.online) return { kind: "not-ready", detail: "the server reports this machine offline" };
|
|
@@ -60,12 +76,15 @@ var machineReadiness = (machines, machineId, expectedCapabilities) => {
|
|
|
60
76
|
if (machine.lastControlAt === null || !Number.isFinite(Date.parse(machine.lastControlAt))) {
|
|
61
77
|
return { kind: "not-ready", detail: "the server has not observed this machine polling the control queue" };
|
|
62
78
|
}
|
|
79
|
+
if (!daemonHasRemoteProof({ kind: "running", lastSuccessfulHeartbeatAt: machine.lastSeenAt, lastSuccessfulControlAt: machine.lastControlAt }, now)) {
|
|
80
|
+
return { kind: "not-ready", detail: "the heartbeat or control-queue proof is stale; wake this machine and retry pushary doctor" };
|
|
81
|
+
}
|
|
63
82
|
const missing = expectedCapabilities.filter((capability) => !machine.capabilities.includes(capability));
|
|
64
83
|
return missing.length === 0 ? { kind: "ready", machine } : { kind: "not-ready", detail: `the server is missing capabilities: ${missing.join(", ")}` };
|
|
65
84
|
};
|
|
66
85
|
var readMachineReadiness = async (apiKey, expectedCapabilities, deps = {}) => {
|
|
67
86
|
const listed = await listMachines(apiKey, deps);
|
|
68
|
-
return listed.kind === "ok" ? machineReadiness(listed.machines, deps.machineId ?? getMachineId(), expectedCapabilities) : listed.kind === "unsupported" ? { kind: "unsupported", detail: "the server does not report machine readiness yet" } : listed;
|
|
87
|
+
return listed.kind === "ok" ? machineReadiness(listed.machines, deps.machineId ?? getMachineId(), expectedCapabilities, deps.now?.()) : listed.kind === "unsupported" ? { kind: "unsupported", detail: "the server does not report machine readiness yet" } : listed;
|
|
69
88
|
};
|
|
70
89
|
var waitForMachineReadiness = async (apiKey, expectedCapabilities, deps = {}) => {
|
|
71
90
|
const attempts = deps.attempts ?? 21;
|
|
@@ -106,6 +125,29 @@ var describeLastSeen = (iso, now = Date.now()) => {
|
|
|
106
125
|
if (hours < 48) return `${hours}h ago`;
|
|
107
126
|
return `${Math.round(hours / 24)}d ago`;
|
|
108
127
|
};
|
|
128
|
+
var readManagedControlEvidence = (apiKey, providers, serverProof) => {
|
|
129
|
+
const now = Date.now();
|
|
130
|
+
const daemon = readDaemonStatus();
|
|
131
|
+
const capabilities = detectProviderLiveCapabilities(providers);
|
|
132
|
+
const providerAvailable = hasSpawnProvider(capabilities);
|
|
133
|
+
const managerAvailable = daemonServiceManagerAvailable();
|
|
134
|
+
const serviceInstalled = hasDaemonServiceDefinition();
|
|
135
|
+
const keyCurrent = Boolean(apiKey) && readKeySource().key === apiKey && readDaemonNeedsLogin().kind !== "blocked";
|
|
136
|
+
const policy = resolveControlPolicy({ mode: readControlMode(), providerAvailable, managerAvailable, servicePresent: serviceInstalled || daemon.kind !== "absent" });
|
|
137
|
+
const localProof = daemonHasRemoteProof(daemon, now);
|
|
138
|
+
const remote = serverProof?.kind === "ready" ? machineReadiness([serverProof.machine], daemon.machineId ?? "", ["spawn", ...capabilities], now) : serverProof;
|
|
139
|
+
return {
|
|
140
|
+
ready: keyCurrent && policy === "enabled" && providerAvailable && managerAvailable && serviceInstalled && localProof && remote?.kind === "ready",
|
|
141
|
+
keyCurrent,
|
|
142
|
+
providerAvailable,
|
|
143
|
+
managerAvailable,
|
|
144
|
+
serviceInstalled,
|
|
145
|
+
policy,
|
|
146
|
+
localProof,
|
|
147
|
+
serverProof: remote?.kind ?? "unchecked",
|
|
148
|
+
checkedAt: new Date(now).toISOString()
|
|
149
|
+
};
|
|
150
|
+
};
|
|
109
151
|
|
|
110
152
|
export {
|
|
111
153
|
HEARTBEAT_INTERVAL_MS,
|
|
@@ -113,5 +155,6 @@ export {
|
|
|
113
155
|
readMachineReadiness,
|
|
114
156
|
waitForMachineReadiness,
|
|
115
157
|
listMachines,
|
|
116
|
-
describeLastSeen
|
|
158
|
+
describeLastSeen,
|
|
159
|
+
readManagedControlEvidence
|
|
117
160
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
detectClaudeVersion
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OIZVYUED.js";
|
|
4
4
|
import {
|
|
5
5
|
addClaudeMcpServer,
|
|
6
6
|
addPusharyHooks,
|
|
7
7
|
addPusharyToolPermissions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-HHODMHTH.js";
|
|
9
9
|
import {
|
|
10
10
|
claudeWired,
|
|
11
11
|
codexWired,
|
|
12
12
|
geminiWired
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-A2M6FGUF.js";
|
|
14
14
|
import {
|
|
15
15
|
CLAUDE_HOOK_EVENTS,
|
|
16
16
|
GEMINI_HOOK_BINARY,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
needsReregistration,
|
|
22
22
|
registrationSignatures,
|
|
23
23
|
supportedClaudeEvents
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-CDBTCEKE.js";
|
|
25
25
|
import {
|
|
26
26
|
guardBinary
|
|
27
27
|
} from "./chunk-3AJIK5AO.js";
|
|
@@ -40,14 +40,14 @@ import {
|
|
|
40
40
|
codexHooksJson,
|
|
41
41
|
hasCodexHooks,
|
|
42
42
|
vscodePluginMcp
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-FBO5WS3D.js";
|
|
44
44
|
import {
|
|
45
45
|
readJsonSafe,
|
|
46
46
|
writeJsonAtomic
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-KAWLZTRJ.js";
|
|
48
48
|
import {
|
|
49
49
|
HOOK_LOCATOR_BINARY
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-VZADMT7R.js";
|
|
51
51
|
|
|
52
52
|
// src/reapply.ts
|
|
53
53
|
import { join } from "path";
|
|
@@ -3,19 +3,19 @@ import {
|
|
|
3
3
|
loadPin,
|
|
4
4
|
savePin,
|
|
5
5
|
verifyRecipients
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WZ63WTAZ.js";
|
|
7
7
|
import {
|
|
8
8
|
hookOwnerOf
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BS5XR4J7.js";
|
|
10
10
|
import {
|
|
11
11
|
ensureDaemonRunning
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7N3D4GN7.js";
|
|
13
13
|
import {
|
|
14
14
|
buildTranscriptRecords,
|
|
15
15
|
decodePublicKey,
|
|
16
16
|
generateSessionKey,
|
|
17
17
|
wrapSessionKey
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-DH4INZW3.js";
|
|
19
19
|
import {
|
|
20
20
|
fetchTranscriptRecipients,
|
|
21
21
|
uploadTranscriptRecords
|
|
@@ -23,17 +23,17 @@ import {
|
|
|
23
23
|
import {
|
|
24
24
|
transcriptEnvironmentPreference,
|
|
25
25
|
transcriptsEnabled
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JZSWA3VT.js";
|
|
27
27
|
import {
|
|
28
28
|
codexHome,
|
|
29
29
|
pusharyDir
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-FBO5WS3D.js";
|
|
31
31
|
import {
|
|
32
32
|
readTranscriptPreference
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-6MRPTYYH.js";
|
|
34
34
|
import {
|
|
35
35
|
writeJsonAtomic
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-KAWLZTRJ.js";
|
|
37
37
|
import {
|
|
38
38
|
getApiKey,
|
|
39
39
|
getBaseUrl
|
|
@@ -24,20 +24,20 @@ import {
|
|
|
24
24
|
summarizeStop,
|
|
25
25
|
taskTitleFrom,
|
|
26
26
|
toolResultErrorText
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-HBBQO77U.js";
|
|
28
28
|
import {
|
|
29
29
|
NOTIFICATION_PUSH_TYPES,
|
|
30
30
|
POSTTOOLUSE_MIRROR_ONLY_TOOLS
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-32WWVRXN.js";
|
|
32
32
|
import {
|
|
33
33
|
getMachineId
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-C7BFOC35.js";
|
|
35
35
|
import {
|
|
36
36
|
withRetry
|
|
37
37
|
} from "./chunk-EYRGBYZG.js";
|
|
38
38
|
import {
|
|
39
39
|
reportedInstallSource
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-KAWLZTRJ.js";
|
|
41
41
|
import {
|
|
42
42
|
getApiKey,
|
|
43
43
|
getBaseUrl
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
pendingCommandEvents,
|
|
55
55
|
resolveAutoResolveOrigin,
|
|
56
56
|
resolvePolicy
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-VZADMT7R.js";
|
|
58
58
|
|
|
59
59
|
// src/policy.ts
|
|
60
60
|
import { createHash } from "crypto";
|
|
@@ -1004,6 +1004,7 @@ var settleQuestionsForToolUse = async (sessionId, toolUseId) => {
|
|
|
1004
1004
|
for (const answer of late) removePendingQuestion(sessionId, answer.correlationId);
|
|
1005
1005
|
};
|
|
1006
1006
|
var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
1007
|
+
const occurredAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1007
1008
|
const deadline = Date.now() + HOOK_BUDGET_MS;
|
|
1008
1009
|
const signal = AbortSignal.timeout(HOOK_BUDGET_MS);
|
|
1009
1010
|
try {
|
|
@@ -1028,6 +1029,8 @@ var handlePostToolUse = async (input, agent = CLAUDE_CODE_AGENT) => {
|
|
|
1028
1029
|
const beacon = !isMirrorOnly && decisionSource === "policy_auto" && throttlePass(`autodecision:${sessionKey}:${lookup.tool}`, AUTO_DECISION_WINDOW_MS) ? deriveAutoDecisionBeacon(lookup.tool, lookup.input, liveMode, agent.type, input.cwd, input.session_id) : void 0;
|
|
1029
1030
|
const toolReport = reportEvent({
|
|
1030
1031
|
event: isError ? "tool_error" : "tool_complete",
|
|
1032
|
+
occurredAt,
|
|
1033
|
+
toolUseId: input.tool_use_id,
|
|
1031
1034
|
agentType: agent.type,
|
|
1032
1035
|
agentName: `${agent.label} - ${projectName}`,
|
|
1033
1036
|
action,
|
package/dist/src/index.d.ts
CHANGED
|
@@ -34,6 +34,8 @@ interface AgentIdentity {
|
|
|
34
34
|
readonly label: string;
|
|
35
35
|
}
|
|
36
36
|
interface AgentEvent {
|
|
37
|
+
occurredAt?: string;
|
|
38
|
+
toolUseId?: string;
|
|
37
39
|
event: string;
|
|
38
40
|
agentType: string;
|
|
39
41
|
agentName?: string;
|
|
@@ -147,6 +149,7 @@ interface AskUserParams {
|
|
|
147
149
|
machineId?: string;
|
|
148
150
|
toolName?: string;
|
|
149
151
|
toolTarget?: string;
|
|
152
|
+
toolPath?: string;
|
|
150
153
|
repoKey?: string;
|
|
151
154
|
intent?: string;
|
|
152
155
|
action?: string;
|
package/dist/src/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
handlePreToolUse
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-FHIVWF4B.js";
|
|
4
|
+
import "../chunk-SRFA5BOO.js";
|
|
5
|
+
import "../chunk-32WFHA77.js";
|
|
6
6
|
import "../chunk-YHG74UFF.js";
|
|
7
7
|
import {
|
|
8
8
|
fetchAccountPublicKey
|
|
@@ -15,28 +15,28 @@ import {
|
|
|
15
15
|
handlePostToolUse,
|
|
16
16
|
handleStop,
|
|
17
17
|
reportEvent
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-ZJ6QXXBC.js";
|
|
19
19
|
import {
|
|
20
20
|
askUser,
|
|
21
21
|
cancelQuestion,
|
|
22
22
|
waitForAnswer
|
|
23
23
|
} from "../chunk-XS33QBJA.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-HBBQO77U.js";
|
|
25
|
+
import "../chunk-32WWVRXN.js";
|
|
26
|
+
import "../chunk-C7BFOC35.js";
|
|
27
|
+
import "../chunk-FBO5WS3D.js";
|
|
28
28
|
import "../chunk-EYRGBYZG.js";
|
|
29
29
|
import "../chunk-SAF6HGAA.js";
|
|
30
30
|
import "../chunk-7QLSKOSU.js";
|
|
31
31
|
import "../chunk-KZERVKTD.js";
|
|
32
|
-
import "../chunk-
|
|
32
|
+
import "../chunk-KAWLZTRJ.js";
|
|
33
33
|
import {
|
|
34
34
|
getApiKey,
|
|
35
35
|
getBaseUrl
|
|
36
36
|
} from "../chunk-2UMNXADU.js";
|
|
37
37
|
import {
|
|
38
38
|
resolvePolicy
|
|
39
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-VZADMT7R.js";
|
|
40
40
|
export {
|
|
41
41
|
askUser,
|
|
42
42
|
cancelQuestion,
|