feat(hooks): add telemetry handlers for codex/copilot/gemini

This commit is contained in:
William Valentin
2026-03-20 11:17:26 -07:00
parent c88746693a
commit d235e3c873
23 changed files with 4506 additions and 0 deletions
+271
View File
@@ -0,0 +1,271 @@
#!/usr/bin/env node
import { randomUUID } from "node:crypto";
import { hostname } from "node:os";
const INGEST_URL = process.env.AGENTMON_INGEST_URL || "http://localhost:8080";
const FRAMEWORK = process.env.AGENTMON_FRAMEWORK || "codex";
const HOST = process.env.AGENTMON_HOST || hostname();
const BATCH_SIZE = 10;
const FLUSH_MS = 2e3;
const FETCH_TIMEOUT_MS = 500;
let buffer = [];
let flushTimer = null;
let isFlushing = false;
const activeRuns = /* @__PURE__ */ new Map();
function isRecord(value) {
return value !== null && typeof value === "object" && !Array.isArray(value);
}
function pickString(...values) {
for (const value of values) {
if (typeof value === "string" && value.trim() !== "") {
return value;
}
}
return void 0;
}
function pickNumber(...values) {
for (const value of values) {
if (typeof value === "number" && Number.isFinite(value)) {
return value;
}
}
return void 0;
}
function truncate(value, limit) {
if (value === void 0 || value === null) {
return void 0;
}
const text = typeof value === "string" ? value : safeJSONStringify(value);
if (!text) {
return void 0;
}
if (text.length <= limit) {
return text;
}
return text.slice(0, limit) + "...";
}
function safeJSONStringify(value) {
try {
return JSON.stringify(value);
} catch {
return String(value);
}
}
function getSessionKey(input) {
return pickString(
input.sessionId,
input.session_id,
input.conversationId,
input.conversation_id
);
}
function getUsage(input) {
const usage = isRecord(input.usage) ? input.usage : isRecord(input.llm) ? input.llm : isRecord(input.tokens) ? input.tokens : void 0;
if (!usage)
return void 0;
const result = {};
if (usage.input !== void 0)
result.input_tokens = usage.input;
if (usage.output !== void 0)
result.output_tokens = usage.output;
if (usage.total !== void 0)
result.total_tokens = usage.total;
if (usage.cost !== void 0)
result.total_cost = usage.cost;
return Object.keys(result).length > 0 ? result : void 0;
}
function buildEnvelope(type, sessionKey, opts = {}) {
const correlation = {};
if (sessionKey) {
correlation.session_id = sessionKey;
}
if (opts.runId) {
correlation.run_id = opts.runId;
}
if (opts.spanId) {
correlation.span_id = opts.spanId;
}
if (opts.parentSpanId) {
correlation.parent_span_id = opts.parentSpanId;
}
const envelope = {
schema: { name: "agentmon.event", version: 1 },
event: {
id: randomUUID(),
type,
ts: (/* @__PURE__ */ new Date()).toISOString(),
source: {
framework: FRAMEWORK,
client_id: HOST,
host: HOST
}
}
};
if (Object.keys(correlation).length > 0) {
envelope.correlation = correlation;
}
if (opts.attributes && Object.keys(opts.attributes).length > 0) {
envelope.attributes = opts.attributes;
}
if (opts.payload && Object.keys(opts.payload).length > 0) {
envelope.payload = opts.payload;
}
return envelope;
}
function scheduleFlush() {
if (!flushTimer) {
flushTimer = setTimeout(() => {
void flush();
}, FLUSH_MS);
}
}
function enqueue(event) {
buffer.push(event);
if (buffer.length >= BATCH_SIZE) {
void flush();
} else {
scheduleFlush();
}
}
async function postBatch(batch) {
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
try {
await fetch(`${INGEST_URL}/v1/events`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(batch),
signal: controller.signal
});
} finally {
clearTimeout(timeout);
}
}
async function flush() {
if (flushTimer) {
clearTimeout(flushTimer);
flushTimer = null;
}
if (isFlushing || buffer.length === 0) {
return;
}
isFlushing = true;
const batch = buffer.splice(0, BATCH_SIZE);
try {
await postBatch(batch);
} catch {
console.debug(`[agentmon] failed to flush ${batch.length} events`);
} finally {
isFlushing = false;
if (buffer.length > 0) {
if (buffer.length >= BATCH_SIZE) {
void flush();
} else {
scheduleFlush();
}
}
}
}
async function handleSessionStart(input) {
const sessionKey = getSessionKey(input) || randomUUID();
const runId = randomUUID();
activeRuns.set(sessionKey, runId);
enqueue(buildEnvelope("session.start", sessionKey));
enqueue(buildEnvelope("run.start", sessionKey, {
runId,
attributes: {
trigger: pickString(input.trigger_type, input.trigger)
},
payload: {
prompt_preview: truncate(input.prompt, 200)
}
}));
await flush();
}
async function handleSessionEnd(input) {
const sessionKey = getSessionKey(input);
const runId = sessionKey ? activeRuns.get(sessionKey) : void 0;
const usage = getUsage(input);
const duration = pickNumber(input.duration_ms, input.elapsed_ms, input.duration);
if (runId) {
enqueue(buildEnvelope("run.end", sessionKey, {
runId,
payload: {
status: "success",
duration_ms: duration,
...usage && { usage }
}
}));
}
enqueue(buildEnvelope("session.end", sessionKey, {
payload: usage ? { usage } : void 0
}));
activeRuns.delete(sessionKey || "");
await flush();
}
async function handleNotification(input) {
const sessionKey = getSessionKey(input);
const notificationType = pickString(input.type, input.notification_type);
const usage = getUsage(input);
const duration = pickNumber(input.duration_ms, input.elapsed_ms);
if (notificationType === "agent-turn-complete" || notificationType === "Done") {
const runId = sessionKey ? activeRuns.get(sessionKey) : void 0;
if (runId) {
enqueue(buildEnvelope("run.end", sessionKey, {
runId,
payload: {
status: "success",
duration_ms: duration,
...usage && { usage }
}
}));
}
const newRunId = randomUUID();
if (sessionKey) {
activeRuns.set(sessionKey, newRunId);
}
enqueue(buildEnvelope("run.start", sessionKey, {
runId: newRunId
}));
}
await flush();
}
const handler = async () => {
const args = process.argv.slice(2);
const hookType = args[0] || "unknown";
let input = {};
try {
const stdin = await readStdin();
if (stdin) {
input = JSON.parse(stdin);
}
} catch {
input = {};
}
try {
switch (hookType) {
case "start":
await handleSessionStart(input);
break;
case "stop":
await handleSessionEnd(input);
break;
case "notification":
await handleNotification(input);
break;
default:
console.debug(`[agentmon] unknown hook type: ${hookType}`);
}
} catch (err) {
console.debug("[agentmon] handler error:", err);
}
};
async function readStdin() {
return new Promise((resolve) => {
let data = "";
process.stdin.on("data", (chunk) => data += chunk);
process.stdin.on("end", () => resolve(data));
process.stdin.on("error", () => resolve(""));
setTimeout(() => resolve(data), 100);
});
}
handler();
+324
View File
@@ -0,0 +1,324 @@
#!/usr/bin/env node
import { randomUUID } from 'node:crypto';
import { hostname } from 'node:os';
const INGEST_URL = process.env.AGENTMON_INGEST_URL || 'http://localhost:8080';
const FRAMEWORK = process.env.AGENTMON_FRAMEWORK || 'codex';
const HOST = process.env.AGENTMON_HOST || hostname();
const BATCH_SIZE = 10;
const FLUSH_MS = 2000;
const FETCH_TIMEOUT_MS = 500;
interface Dict { [key: string]: any }
let buffer: Dict[] = [];
let flushTimer: ReturnType<typeof setTimeout> | null = null;
let isFlushing = false;
const activeRuns = new Map<string, string>();
function isRecord(value: unknown): value is Dict {
return value !== null && typeof value === 'object' && !Array.isArray(value);
}
function pickString(...values: unknown[]): string | undefined {
for (const value of values) {
if (typeof value === 'string' && value.trim() !== '') {
return value;
}
}
return undefined;
}
function pickNumber(...values: unknown[]): number | undefined {
for (const value of values) {
if (typeof value === 'number' && Number.isFinite(value)) {
return value;
}
}
return undefined;
}
function truncate(value: unknown, limit: number): string | undefined {
if (value === undefined || value === null) {
return undefined;
}
const text = typeof value === 'string' ? value : safeJSONStringify(value);
if (!text) {
return undefined;
}
if (text.length <= limit) {
return text;
}
return text.slice(0, limit) + '...';
}
function safeJSONStringify(value: unknown): string {
try {
return JSON.stringify(value);
} catch {
return String(value);
}
}
function getSessionKey(input: Dict): string | undefined {
return pickString(
input.sessionId,
input.session_id,
input.conversationId,
input.conversation_id,
);
}
function getUsage(input: Dict): Dict | undefined {
const usage = isRecord(input.usage) ? input.usage :
isRecord(input.llm) ? input.llm :
isRecord(input.tokens) ? input.tokens : undefined;
if (!usage) return undefined;
const result: Dict = {};
if (usage.input !== undefined) result.input_tokens = usage.input;
if (usage.output !== undefined) result.output_tokens = usage.output;
if (usage.total !== undefined) result.total_tokens = usage.total;
if (usage.cost !== undefined) result.total_cost = usage.cost;
return Object.keys(result).length > 0 ? result : undefined;
}
function buildEnvelope(
type: string,
sessionKey?: string,
opts: {
runId?: string;
spanId?: string;
parentSpanId?: string;
attributes?: Dict;
payload?: Dict;
} = {},
): Dict {
const correlation: Dict = {};
if (sessionKey) {
correlation.session_id = sessionKey;
}
if (opts.runId) {
correlation.run_id = opts.runId;
}
if (opts.spanId) {
correlation.span_id = opts.spanId;
}
if (opts.parentSpanId) {
correlation.parent_span_id = opts.parentSpanId;
}
const envelope: Dict = {
schema: { name: 'agentmon.event', version: 1 },
event: {
id: randomUUID(),
type,
ts: new Date().toISOString(),
source: {
framework: FRAMEWORK,
client_id: HOST,
host: HOST,
},
},
};
if (Object.keys(correlation).length > 0) {
envelope.correlation = correlation;
}
if (opts.attributes && Object.keys(opts.attributes).length > 0) {
envelope.attributes = opts.attributes;
}
if (opts.payload && Object.keys(opts.payload).length > 0) {
envelope.payload = opts.payload;
}
return envelope;
}
function scheduleFlush() {
if (!flushTimer) {
flushTimer = setTimeout(() => {
void flush();
}, FLUSH_MS);
}
}
function enqueue(event: Dict) {
buffer.push(event);
if (buffer.length >= BATCH_SIZE) {
void flush();
} else {
scheduleFlush();
}
}
async function postBatch(batch: Dict[]) {
const controller = new AbortController();
const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT_MS);
try {
await fetch(`${INGEST_URL}/v1/events`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(batch),
signal: controller.signal,
});
} finally {
clearTimeout(timeout);
}
}
async function flush() {
if (flushTimer) {
clearTimeout(flushTimer);
flushTimer = null;
}
if (isFlushing || buffer.length === 0) {
return;
}
isFlushing = true;
const batch = buffer.splice(0, BATCH_SIZE);
try {
await postBatch(batch);
} catch {
console.debug(`[agentmon] failed to flush ${batch.length} events`);
} finally {
isFlushing = false;
if (buffer.length > 0) {
if (buffer.length >= BATCH_SIZE) {
void flush();
} else {
scheduleFlush();
}
}
}
}
async function handleSessionStart(input: Dict) {
const sessionKey = getSessionKey(input) || randomUUID();
const runId = randomUUID();
activeRuns.set(sessionKey, runId);
enqueue(buildEnvelope('session.start', sessionKey));
enqueue(buildEnvelope('run.start', sessionKey, {
runId,
attributes: {
trigger: pickString(input.trigger_type, input.trigger),
},
payload: {
prompt_preview: truncate(input.prompt, 200),
},
}));
await flush();
}
async function handleSessionEnd(input: Dict) {
const sessionKey = getSessionKey(input);
const runId = sessionKey ? activeRuns.get(sessionKey) : undefined;
const usage = getUsage(input);
const duration = pickNumber(input.duration_ms, input.elapsed_ms, input.duration);
if (runId) {
enqueue(buildEnvelope('run.end', sessionKey, {
runId,
payload: {
status: 'success',
duration_ms: duration,
...(usage && { usage }),
},
}));
}
enqueue(buildEnvelope('session.end', sessionKey, {
payload: usage ? { usage } : undefined,
}));
activeRuns.delete(sessionKey || '');
await flush();
}
async function handleNotification(input: Dict) {
const sessionKey = getSessionKey(input);
const notificationType = pickString(input.type, input.notification_type);
const usage = getUsage(input);
const duration = pickNumber(input.duration_ms, input.elapsed_ms);
if (notificationType === 'agent-turn-complete' || notificationType === 'Done') {
const runId = sessionKey ? activeRuns.get(sessionKey) : undefined;
if (runId) {
enqueue(buildEnvelope('run.end', sessionKey, {
runId,
payload: {
status: 'success',
duration_ms: duration,
...(usage && { usage }),
},
}));
}
const newRunId = randomUUID();
if (sessionKey) {
activeRuns.set(sessionKey, newRunId);
}
enqueue(buildEnvelope('run.start', sessionKey, {
runId: newRunId,
}));
}
await flush();
}
const handler = async () => {
const args = process.argv.slice(2);
const hookType = args[0] || 'unknown';
let input: Dict = {};
try {
const stdin = await readStdin();
if (stdin) {
input = JSON.parse(stdin);
}
} catch {
input = {};
}
try {
switch (hookType) {
case 'start':
await handleSessionStart(input);
break;
case 'stop':
await handleSessionEnd(input);
break;
case 'notification':
await handleNotification(input);
break;
default:
console.debug(`[agentmon] unknown hook type: ${hookType}`);
}
} catch (err) {
console.debug('[agentmon] handler error:', err);
}
};
async function readStdin(): Promise<string> {
return new Promise((resolve) => {
let data = '';
process.stdin.on('data', (chunk) => data += chunk);
process.stdin.on('end', () => resolve(data));
process.stdin.on('error', () => resolve(''));
setTimeout(() => resolve(data), 100);
});
}
handler();
+22
View File
@@ -0,0 +1,22 @@
{
"hooks": {
"sessionStart": [
{
"type": "command",
"command": "~/.local/bin/agentmon-codex-handler start"
}
],
"sessionEnd": [
{
"type": "command",
"command": "~/.local/bin/agentmon-codex-handler stop"
}
],
"notify": [
{
"type": "command",
"command": "~/.local/bin/agentmon-codex-handler notification"
}
]
}
}
+463
View File
@@ -0,0 +1,463 @@
{
"name": "@anthropic-ai/agentmon-codex",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "@anthropic-ai/agentmon-codex",
"version": "1.0.0",
"bin": {
"agentmon-handler": "handler.js"
},
"devDependencies": {
"esbuild": "^0.20.0",
"typescript": "^5.3.0"
}
},
"node_modules/@esbuild/aix-ppc64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.20.2.tgz",
"integrity": "sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"aix"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.20.2.tgz",
"integrity": "sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.20.2.tgz",
"integrity": "sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.20.2.tgz",
"integrity": "sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"android"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.20.2.tgz",
"integrity": "sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.20.2.tgz",
"integrity": "sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"darwin"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.20.2.tgz",
"integrity": "sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.20.2.tgz",
"integrity": "sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"freebsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.20.2.tgz",
"integrity": "sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==",
"cpu": [
"arm"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.20.2.tgz",
"integrity": "sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.20.2.tgz",
"integrity": "sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.20.2.tgz",
"integrity": "sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==",
"cpu": [
"loong64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.20.2.tgz",
"integrity": "sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==",
"cpu": [
"mips64el"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.20.2.tgz",
"integrity": "sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==",
"cpu": [
"ppc64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.20.2.tgz",
"integrity": "sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==",
"cpu": [
"riscv64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.20.2.tgz",
"integrity": "sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==",
"cpu": [
"s390x"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.20.2.tgz",
"integrity": "sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"linux"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.20.2.tgz",
"integrity": "sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"netbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.20.2.tgz",
"integrity": "sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"openbsd"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.20.2.tgz",
"integrity": "sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"sunos"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.20.2.tgz",
"integrity": "sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==",
"cpu": [
"arm64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.20.2.tgz",
"integrity": "sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==",
"cpu": [
"ia32"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.20.2.tgz",
"integrity": "sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==",
"cpu": [
"x64"
],
"dev": true,
"license": "MIT",
"optional": true,
"os": [
"win32"
],
"engines": {
"node": ">=12"
}
},
"node_modules/esbuild": {
"version": "0.20.2",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.20.2.tgz",
"integrity": "sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==",
"dev": true,
"hasInstallScript": true,
"license": "MIT",
"bin": {
"esbuild": "bin/esbuild"
},
"engines": {
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/aix-ppc64": "0.20.2",
"@esbuild/android-arm": "0.20.2",
"@esbuild/android-arm64": "0.20.2",
"@esbuild/android-x64": "0.20.2",
"@esbuild/darwin-arm64": "0.20.2",
"@esbuild/darwin-x64": "0.20.2",
"@esbuild/freebsd-arm64": "0.20.2",
"@esbuild/freebsd-x64": "0.20.2",
"@esbuild/linux-arm": "0.20.2",
"@esbuild/linux-arm64": "0.20.2",
"@esbuild/linux-ia32": "0.20.2",
"@esbuild/linux-loong64": "0.20.2",
"@esbuild/linux-mips64el": "0.20.2",
"@esbuild/linux-ppc64": "0.20.2",
"@esbuild/linux-riscv64": "0.20.2",
"@esbuild/linux-s390x": "0.20.2",
"@esbuild/linux-x64": "0.20.2",
"@esbuild/netbsd-x64": "0.20.2",
"@esbuild/openbsd-x64": "0.20.2",
"@esbuild/sunos-x64": "0.20.2",
"@esbuild/win32-arm64": "0.20.2",
"@esbuild/win32-ia32": "0.20.2",
"@esbuild/win32-x64": "0.20.2"
}
},
"node_modules/typescript": {
"version": "5.9.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz",
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
"dev": true,
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
}
}
}
+18
View File
@@ -0,0 +1,18 @@
{
"name": "@anthropic-ai/agentmon-codex",
"version": "1.0.0",
"description": "agentmon hook handler for Codex CLI",
"main": "handler.js",
"type": "module",
"bin": {
"agentmon-handler": "./handler.js"
},
"scripts": {
"build": "npx esbuild handler.ts --platform=node --format=esm --outfile=handler.js"
},
"dependencies": {},
"devDependencies": {
"esbuild": "^0.20.0",
"typescript": "^5.3.0"
}
}