@integrity-labs/agt-cli 0.28.84 → 0.28.86

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.
@@ -3,7 +3,7 @@ import {
3
3
  formatMissingVar,
4
4
  isClaudeFastMode,
5
5
  probeMcpEnvSubstitution
6
- } from "./chunk-3KLQA3SC.js";
6
+ } from "./chunk-E5TGFEDQ.js";
7
7
  import {
8
8
  reapOrphanChannelMcps
9
9
  } from "./chunk-XWVM4KPK.js";
@@ -1395,4 +1395,4 @@ export {
1395
1395
  stopAllSessionsAndWait,
1396
1396
  getProjectDir
1397
1397
  };
1398
- //# sourceMappingURL=chunk-XDZFMTY5.js.map
1398
+ //# sourceMappingURL=chunk-OZWBVM7M.js.map
@@ -100,7 +100,7 @@ async function spawnPairSession(session) {
100
100
  return { ok: true };
101
101
  } catch {
102
102
  }
103
- const { resolveClaudeBinary } = await import("./persistent-session-U6P5I6TT.js");
103
+ const { resolveClaudeBinary } = await import("./persistent-session-ZAKXWRX7.js");
104
104
  const claudeBin = resolveClaudeBinary();
105
105
  const pairEnv = {
106
106
  ...process.env,
@@ -373,4 +373,4 @@ export {
373
373
  startClaudePair,
374
374
  submitClaudePairCode
375
375
  };
376
- //# sourceMappingURL=claude-pair-runtime-6XYMSC6B.js.map
376
+ //# sourceMappingURL=claude-pair-runtime-O5PHMHMF.js.map
@@ -28,7 +28,7 @@ import {
28
28
  requireHost,
29
29
  safeWriteJsonAtomic,
30
30
  setConfigHash
31
- } from "../chunk-EIXW7L6A.js";
31
+ } from "../chunk-3EZHAJGB.js";
32
32
  import {
33
33
  getProjectDir as getProjectDir2,
34
34
  getReadyTasks,
@@ -66,7 +66,7 @@ import {
66
66
  takeWatchdogGiveUpCount,
67
67
  takeZombieDetection,
68
68
  transcriptActivityAgeSeconds
69
- } from "../chunk-XDZFMTY5.js";
69
+ } from "../chunk-OZWBVM7M.js";
70
70
  import {
71
71
  FLAGS_SCHEMA_VERSION,
72
72
  FLAG_REGISTRY,
@@ -100,7 +100,7 @@ import {
100
100
  resolveDmTarget,
101
101
  sumTranscriptUsageInWindow,
102
102
  wrapScheduledTaskPrompt
103
- } from "../chunk-3KLQA3SC.js";
103
+ } from "../chunk-E5TGFEDQ.js";
104
104
  import {
105
105
  parsePsRows,
106
106
  reapOrphanChannelMcps
@@ -2263,6 +2263,8 @@ var WINDOW_PAD_MS = 5 * 6e4;
2263
2263
  var MAX_TURN_CHARS = 1500;
2264
2264
  var MAX_TRANSCRIPT_CHARS = 6e3;
2265
2265
  var DEFAULT_CLAUDE_EVAL_MODEL = "claude-haiku-4-5-20251001";
2266
+ var DEFAULT_ANTHROPIC_MESSAGES_URL = "https://api.anthropic.com/v1/messages";
2267
+ var ANTHROPIC_API_VERSION = "2023-06-01";
2266
2268
  var DEFAULT_LOCAL_EVAL_URL = "http://localhost:11434/v1/chat/completions";
2267
2269
  var DEFAULT_LOCAL_EVAL_MODEL = "gemma4:12b";
2268
2270
  var EVAL_TIMEOUT_MS = 12e4;
@@ -2299,6 +2301,87 @@ async function runLocalEvalChat(prompt, opts) {
2299
2301
  }
2300
2302
  return text;
2301
2303
  }
2304
+ async function runAnthropicMessages(prompt, opts) {
2305
+ if (!opts.apiKey) {
2306
+ throw new Error("anthropic-api eval requires an API key");
2307
+ }
2308
+ const doFetch = opts.fetchImpl ?? fetch;
2309
+ const res = await doFetch(opts.url ?? DEFAULT_ANTHROPIC_MESSAGES_URL, {
2310
+ method: "POST",
2311
+ headers: {
2312
+ "Content-Type": "application/json",
2313
+ "x-api-key": opts.apiKey,
2314
+ "anthropic-version": ANTHROPIC_API_VERSION
2315
+ },
2316
+ body: JSON.stringify({
2317
+ model: opts.model,
2318
+ max_tokens: opts.maxTokens ?? 512,
2319
+ temperature: 0,
2320
+ messages: [{ role: "user", content: prompt }]
2321
+ }),
2322
+ signal: AbortSignal.timeout(opts.timeoutMs ?? EVAL_TIMEOUT_MS)
2323
+ });
2324
+ if (!res.ok) {
2325
+ throw new Error(`anthropic messages api returned ${res.status}`);
2326
+ }
2327
+ const data = await res.json();
2328
+ const text = (data.content ?? []).filter((b) => b?.type === "text" && typeof b.text === "string").map((b) => b.text).join("").trim();
2329
+ if (!text) {
2330
+ throw new Error("anthropic messages api returned no text content");
2331
+ }
2332
+ return text;
2333
+ }
2334
+ function selectEvalBackend(opts) {
2335
+ const kind = (opts.kind ?? "").trim().toLowerCase();
2336
+ const log2 = opts.log ?? (() => {
2337
+ });
2338
+ if (kind === "local") {
2339
+ const { url, model, apiKey } = opts.local;
2340
+ const safeUrl = (() => {
2341
+ try {
2342
+ const parsed = new URL(url);
2343
+ return `${parsed.origin}${parsed.pathname}`;
2344
+ } catch {
2345
+ return "[invalid-url]";
2346
+ }
2347
+ })();
2348
+ log2(`[conversation-eval] backend=local url=${safeUrl} model=${model}`);
2349
+ return { model, run: (prompt) => runLocalEvalChat(prompt, { url, model, apiKey }) };
2350
+ }
2351
+ if (kind === "" || kind === "claude-p") {
2352
+ log2(`[conversation-eval] backend=claude-p model=${opts.claudeModel}`);
2353
+ return { model: opts.claudeModel, run: (prompt) => opts.claudePRunner(prompt, opts.claudeModel) };
2354
+ }
2355
+ if (kind === "anthropic-api") {
2356
+ if (!opts.anthropicApiKey) {
2357
+ log2(
2358
+ "[conversation-eval] backend=anthropic-api but no API key (AGT_CONV_EVAL_ANTHROPIC_API_KEY / ANTHROPIC_API_KEY); evaluation disabled"
2359
+ );
2360
+ return {
2361
+ model: "anthropic-api-missing-key",
2362
+ run: async () => {
2363
+ throw new Error(
2364
+ "anthropic-api eval requires AGT_CONV_EVAL_ANTHROPIC_API_KEY or ANTHROPIC_API_KEY"
2365
+ );
2366
+ }
2367
+ };
2368
+ }
2369
+ log2(`[conversation-eval] backend=anthropic-api model=${opts.claudeModel}`);
2370
+ return {
2371
+ model: opts.claudeModel,
2372
+ run: (prompt) => runAnthropicMessages(prompt, { apiKey: opts.anthropicApiKey, model: opts.claudeModel })
2373
+ };
2374
+ }
2375
+ log2(
2376
+ `[conversation-eval] invalid AGT_CONV_EVAL_BACKEND='${kind}' - expected 'anthropic-api', 'claude-p', or 'local'; evaluation disabled`
2377
+ );
2378
+ return {
2379
+ model: "invalid-conversation-eval-backend",
2380
+ run: async () => {
2381
+ throw new Error(`Unsupported AGT_CONV_EVAL_BACKEND='${kind}'. Expected 'anthropic-api', 'claude-p', or 'local'.`);
2382
+ }
2383
+ };
2384
+ }
2302
2385
  var state3 = /* @__PURE__ */ new Map();
2303
2386
  function channelRefTokens(channelRef) {
2304
2387
  return channelRef.split(":").slice(1).filter((p) => p && p !== "dm");
@@ -6803,7 +6886,7 @@ var cachedMaintenanceWindow = null;
6803
6886
  var lastVersionCheckAt = 0;
6804
6887
  var VERSION_CHECK_INTERVAL_MS = 5 * 60 * 1e3;
6805
6888
  var lastResponsivenessProbeAt = 0;
6806
- var agtCliVersion = true ? "0.28.84" : "dev";
6889
+ var agtCliVersion = true ? "0.28.86" : "dev";
6807
6890
  function resolveBrewPath(execFileSync4) {
6808
6891
  try {
6809
6892
  const out = execFileSync4("which", ["brew"], { timeout: 5e3 }).toString().trim();
@@ -7423,37 +7506,40 @@ function memoryExtractionEnabled() {
7423
7506
  return hostFlagStore().getBoolean("memory-extraction");
7424
7507
  }
7425
7508
  var conversationEvalBackend = null;
7509
+ var conversationEvalBackendSig = null;
7426
7510
  function resolveConversationEvalBackend() {
7427
- if (conversationEvalBackend) return conversationEvalBackend;
7428
- const kind = (process.env["AGT_CONV_EVAL_BACKEND"] ?? "claude-p").trim().toLowerCase();
7429
- if (kind === "local") {
7430
- const url = process.env["AGT_CONV_EVAL_LOCAL_URL"]?.trim() || DEFAULT_LOCAL_EVAL_URL;
7431
- const model = process.env["AGT_CONV_EVAL_LOCAL_MODEL"]?.trim() || DEFAULT_LOCAL_EVAL_MODEL;
7432
- const apiKey = process.env["AGT_CONV_EVAL_LOCAL_API_KEY"]?.trim() || void 0;
7433
- const safeUrl = (() => {
7434
- try {
7435
- const parsed = new URL(url);
7436
- return `${parsed.origin}${parsed.pathname}`;
7437
- } catch {
7438
- return "[invalid-url]";
7511
+ const kind = hostFlagStore().getString("conversation-eval-backend");
7512
+ const claudeModel = process.env["AGT_CONV_EVAL_CLAUDE_MODEL"]?.trim() || DEFAULT_CLAUDE_EVAL_MODEL;
7513
+ const anthropicApiKey = process.env["AGT_CONV_EVAL_ANTHROPIC_API_KEY"]?.trim() || process.env["ANTHROPIC_API_KEY"]?.trim() || "";
7514
+ const local = {
7515
+ url: process.env["AGT_CONV_EVAL_LOCAL_URL"]?.trim() || DEFAULT_LOCAL_EVAL_URL,
7516
+ model: process.env["AGT_CONV_EVAL_LOCAL_MODEL"]?.trim() || DEFAULT_LOCAL_EVAL_MODEL,
7517
+ // feature-gate-allow: model tunable, not a gate (matches the _MODE substring of _MODEL)
7518
+ apiKey: process.env["AGT_CONV_EVAL_LOCAL_API_KEY"]?.trim() || void 0
7519
+ };
7520
+ const sig = `${kind}|${claudeModel}|${anthropicApiKey ? "key" : "nokey"}|${local.url}|${local.model}|${local.apiKey ? "lkey" : "nolkey"}`;
7521
+ if (conversationEvalBackend && conversationEvalBackendSig === sig) return conversationEvalBackend;
7522
+ try {
7523
+ conversationEvalBackend = selectEvalBackend({
7524
+ kind,
7525
+ claudeModel,
7526
+ anthropicApiKey,
7527
+ local,
7528
+ // The manager owns the spawn helpers; selectEvalBackend stays transport-free.
7529
+ claudePRunner: runEvalClaude,
7530
+ log
7531
+ });
7532
+ } catch (err) {
7533
+ const message = err.message;
7534
+ log(`[conversation-eval] backend unavailable, eval disabled: ${message}`);
7535
+ conversationEvalBackend = {
7536
+ model: `${kind || "default"}:unavailable`,
7537
+ run: async () => {
7538
+ throw new Error(message);
7439
7539
  }
7440
- })();
7441
- log(`[conversation-eval] backend=local url=${safeUrl} model=${model}`);
7442
- conversationEvalBackend = { model, run: (prompt) => runLocalEvalChat(prompt, { url, model, apiKey }) };
7443
- return conversationEvalBackend;
7444
- }
7445
- if (kind === "" || kind === "claude-p") {
7446
- const model = process.env["AGT_CONV_EVAL_CLAUDE_MODEL"]?.trim() || DEFAULT_CLAUDE_EVAL_MODEL;
7447
- conversationEvalBackend = { model, run: (prompt) => runEvalClaude(prompt, model) };
7448
- return conversationEvalBackend;
7540
+ };
7449
7541
  }
7450
- log(`[conversation-eval] invalid AGT_CONV_EVAL_BACKEND='${kind}' \u2014 expected 'claude-p' or 'local'; evaluation disabled`);
7451
- conversationEvalBackend = {
7452
- model: "invalid-conversation-eval-backend",
7453
- run: async () => {
7454
- throw new Error(`Unsupported AGT_CONV_EVAL_BACKEND='${kind}'. Expected 'claude-p' or 'local'.`);
7455
- }
7456
- };
7542
+ conversationEvalBackendSig = sig;
7457
7543
  return conversationEvalBackend;
7458
7544
  }
7459
7545
  function loadGatewayPorts() {
@@ -7911,7 +7997,7 @@ async function pollCycle() {
7911
7997
  }
7912
7998
  try {
7913
7999
  const { detectHostSecurity } = await import("../host-security-6PDFG7F5.js");
7914
- const { collectDiagnostics } = await import("../persistent-session-U6P5I6TT.js");
8000
+ const { collectDiagnostics } = await import("../persistent-session-ZAKXWRX7.js");
7915
8001
  const diagCodeNames = [...agentState.persistentSessionAgents];
7916
8002
  const agentDiagnostics = diagCodeNames.length > 0 ? collectDiagnostics(diagCodeNames) : void 0;
7917
8003
  let tailscaleHostname;
@@ -8012,7 +8098,7 @@ async function pollCycle() {
8012
8098
  const {
8013
8099
  collectResponsivenessProbes,
8014
8100
  getResponsivenessIntervalMs
8015
- } = await import("../responsiveness-probe-VKIJY4IC.js");
8101
+ } = await import("../responsiveness-probe-NKH4VYGR.js");
8016
8102
  const probeIntervalMs = getResponsivenessIntervalMs();
8017
8103
  if (now - lastResponsivenessProbeAt > probeIntervalMs) {
8018
8104
  const probeCodeNames = [...agentState.persistentSessionAgents];
@@ -8044,7 +8130,7 @@ async function pollCycle() {
8044
8130
  collectResponsivenessProbes,
8045
8131
  livePendingInboundOldestAgeSeconds,
8046
8132
  parkPendingInbound
8047
- } = await import("../responsiveness-probe-VKIJY4IC.js");
8133
+ } = await import("../responsiveness-probe-NKH4VYGR.js");
8048
8134
  const { getProjectDir: wedgeProjectDir } = await import("../claude-scheduler-FATCLHDM.js");
8049
8135
  const wedgeNow = /* @__PURE__ */ new Date();
8050
8136
  const liveAgents = agentState.persistentSessionAgents;
@@ -11513,7 +11599,7 @@ async function processClaudePairSessions(agents) {
11513
11599
  killPairSession,
11514
11600
  pairTmuxSession,
11515
11601
  finalizeClaudePairOnboarding
11516
- } = await import("../claude-pair-runtime-6XYMSC6B.js");
11602
+ } = await import("../claude-pair-runtime-O5PHMHMF.js");
11517
11603
  for (const pairId of pendingResp.cancelled_pair_ids ?? []) {
11518
11604
  log(`[claude-pair] sweeping orphan tmux session for pair ${pairId.slice(0, 8)}`);
11519
11605
  const killed = await killPairSession(pairTmuxSession(pairId));