very-happy-cli 0.2.129 → 0.2.131

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.
Files changed (45) hide show
  1. package/dist/{AcpBackend-MAU4POiE.mjs → AcpBackend-DSRZM4lo.mjs} +2 -2
  2. package/dist/{AcpBackend-kU2VqiYx.cjs → AcpBackend-Dv_EKDIQ.cjs} +2 -2
  3. package/dist/{AcpSessionManager-uSGDDRqF.mjs → AcpSessionManager-DtXOAeQ0.mjs} +1 -1
  4. package/dist/{AcpSessionManager-BWasT5jq.cjs → AcpSessionManager-r8SLweP4.cjs} +1 -1
  5. package/dist/{agentGuidance-B1PsijGg.cjs → agentGuidance-B4bH8Nuz.cjs} +1 -1
  6. package/dist/{agentGuidance-DlZ5s0Om.mjs → agentGuidance-CeuhVA2K.mjs} +1 -1
  7. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  8. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  9. package/dist/{config-_DKtp9qs.mjs → config-Ur8QEJ0U.mjs} +4 -4
  10. package/dist/{config-DswZvA8V.cjs → config-onxMcdX3.cjs} +4 -4
  11. package/dist/{index-dqKLs4dZ.cjs → index-B1hbB5R7.cjs} +14 -7
  12. package/dist/{index-BdZ7Dlg0.cjs → index-B5Vv72dN.cjs} +80 -24
  13. package/dist/{index-tr2Fqhby.mjs → index-BPYVCjjs.mjs} +76 -20
  14. package/dist/{index-1QwKRLYG.mjs → index-BXB-84P_.mjs} +4 -4
  15. package/dist/{index-lwOIU7K9.cjs → index-BjctcFpG.cjs} +4 -4
  16. package/dist/{index-FMMrmSa2.mjs → index-CsfUI8Bw.mjs} +15 -8
  17. package/dist/index.cjs +4 -4
  18. package/dist/index.mjs +4 -4
  19. package/dist/{installTerminalHooks-B3a0ugvz.mjs → installTerminalHooks-DLwx6m7I.mjs} +4 -4
  20. package/dist/{installTerminalHooks-CV2LAKXO.cjs → installTerminalHooks-IaEGKZDR.cjs} +4 -4
  21. package/dist/lib.cjs +2 -2
  22. package/dist/lib.d.cts +34 -22
  23. package/dist/lib.d.mts +34 -22
  24. package/dist/lib.mjs +2 -2
  25. package/dist/{limits-C41sn_OJ.mjs → limits-BusZ5sPV.mjs} +7 -7
  26. package/dist/{limits-B5wJ5Slz.cjs → limits-C9bJJEyR.cjs} +7 -7
  27. package/dist/{mcp-BHNVwrwS.mjs → mcp-CZJM3obK.mjs} +4 -4
  28. package/dist/{mcp-B7lwVQT8.cjs → mcp-D4_4kl0R.cjs} +4 -4
  29. package/dist/{runGemini-gbflWQ3_.cjs → runGemini-CRoqO5Mf.cjs} +6 -6
  30. package/dist/{runGemini-FNZrH8yX.mjs → runGemini-DGHhBbmk.mjs} +6 -6
  31. package/dist/{runOpenClaw-CmhYI7OB.cjs → runOpenClaw-BzY__v8T.cjs} +5 -5
  32. package/dist/{runOpenClaw-3EF_Rqv_.mjs → runOpenClaw-Ca9ygi8M.mjs} +5 -5
  33. package/dist/{send-DV7IeBAv.mjs → send-B1lln_bW.mjs} +4 -4
  34. package/dist/{send-DqedYZtc.cjs → send-CkfdImmJ.cjs} +4 -4
  35. package/dist/{sessions-ieB0bLb5.mjs → sessions-Cyzh822v.mjs} +4 -4
  36. package/dist/{sessions-Bz243hZ9.cjs → sessions-D4cvTe7G.cjs} +4 -4
  37. package/dist/{spawn-CcqzmjhT.mjs → spawn-CdOt7Cv_.mjs} +4 -4
  38. package/dist/{spawn-BXwwueEs.cjs → spawn-ID9-RfTN.cjs} +4 -4
  39. package/dist/{teams-Bx79Wr9-.mjs → teams-Bf2D8dwL.mjs} +4 -4
  40. package/dist/{teams-BtI6h4Dw.cjs → teams-CZ9xg-Rv.cjs} +4 -4
  41. package/dist/{todo-CGRuBaiH.mjs → todo-9iv7_n7i.mjs} +3 -3
  42. package/dist/{todo-B-Kj9lXl.cjs → todo-DK3L93BC.cjs} +3 -3
  43. package/dist/{types-Ba9u0uZL.cjs → types-B20MYc5R.cjs} +11 -2
  44. package/dist/{types-BvYEAHds.mjs → types-lFZhC_6M.mjs} +10 -2
  45. package/package.json +7 -7
@@ -1,13 +1,13 @@
1
1
  import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
2
2
  import os, { homedir, userInfo, tmpdir } from 'node:os';
3
3
  import { randomUUID, randomBytes, createHash as createHash$1, timingSafeEqual } from 'node:crypto';
4
- import { j as getProjectPath, g as BUILTIN_TODO_DISCOVERY, p as projectPath, k as initializeSandbox, w as wrapCommand, d as contentLogMetadata, I as InvalidateSync, R as RawJSONLinesSchema, h as delay, l as AsyncLock, S as STREAM_DELTA_MAX_CHARS, M as MAX_CHAT_ATTACHMENT_SOURCE_BYTES, m as commandOnPath, n as deriveLocalCliUpdateSummary, o as isClaudeSessionId, q as getLocalHappyAgentCredentialPath, r as readLocalHappyAgentCredentials, t as parseExactVersion, u as compareExactVersions, v as extractCompleteLines, x as decideBackfill, y as parseTerminalHookPayload, z as tmuxArgs, C as scrubTmuxClientEnv, D as decideMirrorBinding, E as MIRROR_BACKFILL_LINES_DEFAULT, F as mirrorLineKey, G as mirrorLocalId, H as detectCLIAvailability, J as detectResumeSupport, K as summarizeSpawnSessionForLog, L as shellescape, A as ApiClient, N as fetchCliUpdateState, O as resolveCliUpdateCheckInterval, P as DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS, i as isValidSessionId, Q as listVhTerminals, T as isValidTerminalId, U as readVhTerminal, V as sendToVhTerminal, W as TITLE_PROMPT_PREFIX, X as BOARD_ANALYZER_PROMPT_PREFIX, f as connectionState, Y as startOfflineReconnection, c as createEnvelope, Z as CodexAppServerClient } from './types-BvYEAHds.mjs';
5
- import { z as readDaemonState, l as logger, c as configuration, A as clearDaemonState, B as ensurePrivateDirectory, D as hardenPrivateFile, p as packageJson, g as readSettings, E as readCredentials, s as credentialRelayProblem, i as encodeBase64, F as readSettingsOutcome, G as updateSettings, H as encodeBase64Url, m as decodeBase64, I as writeCredentialsLegacy, J as writeCredentialsDataKey, d as readCredentialsForConfiguredRelay, j as encrypt, r as readPersistedSessions, w as writePrivateFileSync, K as decryptWithDataKey, L as decryptLegacy, M as persistSession, k as decrypt, f as ensurePrivateDirectorySync, N as acquireDaemonLock, O as deletePersistedSessions, P as writeDaemonState, Q as writeSettings, R as releaseDaemonLock, C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION, e as CLIPBOARD_MAX_BYTES, S as clearCredentials, T as clearMachineId, U as SandboxConfigSchema, V as getLatestDaemonLog } from './limits-C41sn_OJ.mjs';
4
+ import { j as getProjectPath, g as BUILTIN_TODO_DISCOVERY, p as projectPath, k as initializeSandbox, w as wrapCommand, d as contentLogMetadata, I as InvalidateSync, R as RawJSONLinesSchema, h as delay, l as AsyncLock, S as STREAM_DELTA_MAX_CHARS, M as MAX_CHAT_ATTACHMENT_SOURCE_BYTES, m as commandOnPath, n as deriveLocalCliUpdateSummary, o as isClaudeSessionId, q as getLocalHappyAgentCredentialPath, r as readLocalHappyAgentCredentials, t as parseExactVersion, u as compareExactVersions, v as extractCompleteLines, x as decideBackfill, y as parseTerminalHookPayload, z as tmuxArgs, C as scrubTmuxClientEnv, D as decideMirrorBinding, E as MIRROR_BACKFILL_LINES_DEFAULT, F as mirrorLineKey, G as mirrorLocalId, H as detectCLIAvailability, J as detectResumeSupport, K as summarizeSpawnSessionForLog, L as shellescape, A as ApiClient, N as fetchCliUpdateState, O as resolveCliUpdateCheckInterval, P as DEFAULT_CLI_UPDATE_CHECK_INTERVAL_MS, i as isValidSessionId, Q as listVhTerminals, T as isValidTerminalId, U as readVhTerminal, V as sendToVhTerminal, W as ContextUsageSchema, X as TITLE_PROMPT_PREFIX, Y as BOARD_ANALYZER_PROMPT_PREFIX, f as connectionState, Z as startOfflineReconnection, c as createEnvelope, _ as CodexAppServerClient } from './types-lFZhC_6M.mjs';
5
+ import { z as readDaemonState, l as logger, c as configuration, A as clearDaemonState, B as ensurePrivateDirectory, D as hardenPrivateFile, p as packageJson, g as readSettings, E as readCredentials, s as credentialRelayProblem, i as encodeBase64, F as readSettingsOutcome, G as updateSettings, H as encodeBase64Url, m as decodeBase64, I as writeCredentialsLegacy, J as writeCredentialsDataKey, d as readCredentialsForConfiguredRelay, j as encrypt, r as readPersistedSessions, w as writePrivateFileSync, K as decryptWithDataKey, L as decryptLegacy, M as persistSession, k as decrypt, f as ensurePrivateDirectorySync, N as acquireDaemonLock, O as deletePersistedSessions, P as writeDaemonState, Q as writeSettings, R as releaseDaemonLock, C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION, e as CLIPBOARD_MAX_BYTES, S as clearCredentials, T as clearMachineId, U as SandboxConfigSchema, V as getLatestDaemonLog } from './limits-BusZ5sPV.mjs';
6
6
  import spawn$1, { spawn } from 'cross-spawn';
7
7
  import path, { join, resolve, basename, isAbsolute, dirname, sep, delimiter, normalize } from 'node:path';
8
8
  import { createInterface } from 'node:readline';
9
9
  import { existsSync, readFileSync, readdirSync, statSync, mkdirSync, unlinkSync, renameSync, writeFileSync, accessSync, constants, openSync, fsyncSync, closeSync, rmSync as rmSync$1, chmodSync as chmodSync$1 } from 'node:fs';
10
- import { f as trimIdent, A as AGENT_GUIDANCE, t as teamScopePath, T as TeamConnectionPreflightError, e as createTeamsClient, P as PREVIEW_TOOL_NAME, R as REPORT_PROGRESS_TOOL_NAME, g as TEAM_TOOL_NAMES, r as registerTeamsTools, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, h as REPORT_PROGRESS_TOOL_TITLE, i as REPORT_PROGRESS_TOOL_DESCRIPTION } from './agentGuidance-DlZ5s0Om.mjs';
10
+ import { f as trimIdent, A as AGENT_GUIDANCE, t as teamScopePath, T as TeamConnectionPreflightError, e as createTeamsClient, P as PREVIEW_TOOL_NAME, R as REPORT_PROGRESS_TOOL_NAME, g as TEAM_TOOL_NAMES, r as registerTeamsTools, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, h as REPORT_PROGRESS_TOOL_TITLE, i as REPORT_PROGRESS_TOOL_DESCRIPTION } from './agentGuidance-CeuhVA2K.mjs';
11
11
  import { readFile, writeFile, rename, unlink, mkdir, symlink, rm, readlink, lstat, stat, open as open$1, appendFile } from 'node:fs/promises';
12
12
  import fs, { watch, access } from 'fs/promises';
13
13
  import { useStdout, useInput, Box, Text, render } from 'ink';
@@ -3395,6 +3395,16 @@ class StreamRelay {
3395
3395
  this.flushPending();
3396
3396
  this.closeOpenBlocks();
3397
3397
  this.currentMid = typeof mid === "string" && mid.length > 0 ? mid : null;
3398
+ const usage = e.message?.usage;
3399
+ if (usage || ["inputTokens", "cacheTokens", "outputTokens", "thinkingTokens"].some((key) => key in this.progress)) {
3400
+ const count = (value) => typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : 0;
3401
+ this.setProgress({
3402
+ inputTokens: count(usage?.input_tokens),
3403
+ cacheTokens: count(usage?.cache_creation_input_tokens) + count(usage?.cache_read_input_tokens),
3404
+ outputTokens: count(usage?.output_tokens),
3405
+ thinkingTokens: 0
3406
+ });
3407
+ }
3398
3408
  return;
3399
3409
  }
3400
3410
  if (e.type === "content_block_start") {
@@ -8863,6 +8873,24 @@ export default async function(pi) {
8863
8873
  const {readFile} = await import('node:fs/promises');
8864
8874
  const {join} = await import('node:path');
8865
8875
  const {homedir} = await import('node:os');
8876
+ const contextEndpoint = process.env.HAPPY_CONTEXT_USAGE_URL;
8877
+ if (contextEndpoint) {
8878
+ const target = new URL(contextEndpoint);
8879
+ if (target.origin !== url.origin || !target.pathname.startsWith('/runtime-context/')) throw new Error('Very Happy context must be local');
8880
+ let reporting = Promise.resolve();
8881
+ for (const name of ['session_start', 'session_switch', 'session_compact', 'model_select', 'turn_end', 'agent_end']) {
8882
+ pi.on(name, async (_event, ctx) => {
8883
+ const usage = ctx.getContextUsage?.();
8884
+ const contextWindow = usage?.contextWindow ?? ctx.model?.contextWindow;
8885
+ if (!(contextWindow > 0)) return;
8886
+ const snapshot = {source:'pi', tokens:usage?.tokens ?? null, contextWindow};
8887
+ reporting = reporting.catch(() => {}).then(async () => {
8888
+ try { await fetch(contextEndpoint, {method:'POST', redirect:'error', headers:{'content-type':'application/json'}, body:JSON.stringify(snapshot), signal:AbortSignal.timeout(2000)}); } catch {}
8889
+ });
8890
+ await reporting;
8891
+ });
8892
+ }
8893
+ }
8866
8894
  pi.on('tool_call', async (event, ctx) => {
8867
8895
  let mode = process.env.HAPPY_PERMISSION_MODE || 'default';
8868
8896
  const sid = process.env.HAPPY_SESSION_ID;
@@ -9586,6 +9614,10 @@ function createTeamWorker(deps) {
9586
9614
  await deps.stopAndWait(op.sessionId);
9587
9615
  await archiveSession(op.sessionId);
9588
9616
  }
9617
+ if (team.archivedAt !== void 0) {
9618
+ await complete(op, receipt);
9619
+ return;
9620
+ }
9589
9621
  const origins = team.operations.filter((candidate) => candidate.type === "spawn" && candidate.botId === op.botId && candidate.generation === op.generation && candidate.sessionId === op.sessionId);
9590
9622
  if (origins.length !== 1) throw new Error("Original worktree ownership is unknown; manual reconciliation required");
9591
9623
  const resource = readReceipt(home, origins[0].id);
@@ -9670,7 +9702,7 @@ Use the teams tools to inspect current task state before acting. This message is
9670
9702
  const status = axios.isAxiosError(error) ? error.response?.status : void 0;
9671
9703
  if (status !== 404) deps.log("Teams schedule advancement unavailable; regular reconciliation continues");
9672
9704
  }
9673
- const { data } = await http.get("/v1/teams/operations", { params: { machineId: deps.machineId, schedulesVersion: 1, teamLaunchVersion: 1 } });
9705
+ const { data } = await http.get("/v1/teams/operations", { params: { machineId: deps.machineId, schedulesVersion: 1, teamLaunchVersion: 1, teamArchiveVersion: 1 } });
9674
9706
  knownSessionIds = new Set((data.teams ?? []).flatMap((team) => team.bots.flatMap((bot) => bot.sessionId ? [bot.sessionId] : [])));
9675
9707
  for (const op of data.operations) {
9676
9708
  if (closed) break;
@@ -11752,7 +11784,30 @@ async function startHappyServer(client, options) {
11752
11784
  }
11753
11785
  }
11754
11786
  };
11787
+ const contextPath = "/runtime-context/" + randomUUID();
11755
11788
  const server = createServer(async (req, res) => {
11789
+ if (req.url?.startsWith("/runtime-context/")) {
11790
+ if (!options?.onContextUsage || req.url !== contextPath || req.method !== "POST" || req.headers.origin) {
11791
+ res.writeHead(403).end();
11792
+ return;
11793
+ }
11794
+ try {
11795
+ let body = "";
11796
+ for await (const chunk of req) {
11797
+ body += chunk.toString();
11798
+ if (Buffer.byteLength(body) > 2048) {
11799
+ res.writeHead(413).end();
11800
+ return;
11801
+ }
11802
+ }
11803
+ const usage = ContextUsageSchema.parse({ ...JSON.parse(body), updatedAt: Date.now() });
11804
+ options.onContextUsage(usage);
11805
+ res.writeHead(204).end();
11806
+ } catch {
11807
+ if (!res.headersSent) res.writeHead(400).end();
11808
+ }
11809
+ return;
11810
+ }
11756
11811
  const mcp = createMcpServer(handlers, options, client.sessionId);
11757
11812
  try {
11758
11813
  const transport = new StreamableHTTPServerTransport({
@@ -11786,6 +11841,7 @@ async function startHappyServer(client, options) {
11786
11841
  logger.debug(`[happyMCP] server:ready sessionId=${client.sessionId} url=${baseUrl.toString()}`);
11787
11842
  return {
11788
11843
  url: baseUrl.toString(),
11844
+ contextUsageUrl: options?.onContextUsage ? new URL(contextPath, baseUrl).toString() : void 0,
11789
11845
  toolNames: [
11790
11846
  "change_title",
11791
11847
  CLIPBOARD_TOOL_NAME,
@@ -12053,7 +12109,7 @@ function registerSideQuestionHandler(rpc, deps) {
12053
12109
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
12054
12110
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
12055
12111
  const run = deps.run ?? (async (input) => {
12056
- const { query } = await import('./index-1QwKRLYG.mjs');
12112
+ const { query } = await import('./index-BXB-84P_.mjs');
12057
12113
  return runSideQuestion(query, input);
12058
12114
  });
12059
12115
  const slots = /* @__PURE__ */ new Map();
@@ -17070,7 +17126,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17070
17126
  process.exit(0);
17071
17127
  } else if (subcommand === "install-terminal-hooks") {
17072
17128
  try {
17073
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await import('./installTerminalHooks-B3a0ugvz.mjs');
17129
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await import('./installTerminalHooks-DLwx6m7I.mjs');
17074
17130
  const command = parseTerminalHooksArgs(args.slice(1));
17075
17131
  if (command.action === "help") {
17076
17132
  console.log(TERMINAL_HOOKS_HELP);
@@ -17087,7 +17143,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17087
17143
  }
17088
17144
  } else if (subcommand === "spawn") {
17089
17145
  try {
17090
- const { handleSpawnCommand } = await import('./spawn-CcqzmjhT.mjs');
17146
+ const { handleSpawnCommand } = await import('./spawn-CdOt7Cv_.mjs');
17091
17147
  await handleSpawnCommand(args.slice(1));
17092
17148
  } catch (error) {
17093
17149
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17099,7 +17155,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17099
17155
  return;
17100
17156
  } else if (subcommand === "sessions") {
17101
17157
  try {
17102
- const { handleSessionsCommand } = await import('./sessions-ieB0bLb5.mjs');
17158
+ const { handleSessionsCommand } = await import('./sessions-Cyzh822v.mjs');
17103
17159
  await handleSessionsCommand(args.slice(1));
17104
17160
  } catch (error) {
17105
17161
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17111,7 +17167,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17111
17167
  return;
17112
17168
  } else if (subcommand === "send") {
17113
17169
  try {
17114
- const { handleSendCommand } = await import('./send-DV7IeBAv.mjs');
17170
+ const { handleSendCommand } = await import('./send-B1lln_bW.mjs');
17115
17171
  await handleSendCommand(args.slice(1));
17116
17172
  } catch (error) {
17117
17173
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17217,9 +17273,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17217
17273
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
17218
17274
  const projectId = args[3];
17219
17275
  try {
17220
- const { saveGoogleCloudProjectToConfig } = await import('./config-_DKtp9qs.mjs');
17221
- const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await import('./limits-C41sn_OJ.mjs').then(function (n) { return n.W; });
17222
- const { ApiClient: ApiClient2 } = await import('./types-BvYEAHds.mjs').then(function (n) { return n._; });
17276
+ const { saveGoogleCloudProjectToConfig } = await import('./config-Ur8QEJ0U.mjs');
17277
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await import('./limits-BusZ5sPV.mjs').then(function (n) { return n.W; });
17278
+ const { ApiClient: ApiClient2 } = await import('./types-lFZhC_6M.mjs').then(function (n) { return n.$; });
17223
17279
  let userEmail = void 0;
17224
17280
  try {
17225
17281
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -17250,7 +17306,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17250
17306
  }
17251
17307
  if (geminiSubcommand === "project" && args[2] === "get") {
17252
17308
  try {
17253
- const { readGeminiLocalConfig } = await import('./config-_DKtp9qs.mjs');
17309
+ const { readGeminiLocalConfig } = await import('./config-Ur8QEJ0U.mjs');
17254
17310
  const config = readGeminiLocalConfig();
17255
17311
  if (config.googleCloudProject) {
17256
17312
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -17290,7 +17346,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17290
17346
  process.exit(0);
17291
17347
  }
17292
17348
  try {
17293
- const { runGemini } = await import('./runGemini-FNZrH8yX.mjs');
17349
+ const { runGemini } = await import('./runGemini-DGHhBbmk.mjs');
17294
17350
  let startedBy = void 0;
17295
17351
  for (let i = 1; i < args.length; i++) {
17296
17352
  if (args[i] === "--started-by") {
@@ -17320,7 +17376,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17320
17376
  }
17321
17377
  };
17322
17378
  try {
17323
- const { runAcp, resolveAcpAgentConfig } = await import('./index-FMMrmSa2.mjs');
17379
+ const { runAcp, resolveAcpAgentConfig } = await import('./index-CsfUI8Bw.mjs');
17324
17380
  const parsed = parsePiRunnerArgs(args.slice(1));
17325
17381
  const resolved = resolveAcpAgentConfig(["pi", ...parsed.passthrough]);
17326
17382
  const { credentials } = await authAndSetupMachineIfNeeded();
@@ -17348,7 +17404,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17348
17404
  return;
17349
17405
  } else if (subcommand === "acp") {
17350
17406
  try {
17351
- const { runAcp, resolveAcpAgentConfig } = await import('./index-FMMrmSa2.mjs');
17407
+ const { runAcp, resolveAcpAgentConfig } = await import('./index-CsfUI8Bw.mjs');
17352
17408
  let startedBy = void 0;
17353
17409
  let verbose = false;
17354
17410
  const acpArgs = [];
@@ -17388,7 +17444,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17388
17444
  return;
17389
17445
  } else if (subcommand === "openclaw") {
17390
17446
  try {
17391
- const { runOpenClaw } = await import('./runOpenClaw-3EF_Rqv_.mjs');
17447
+ const { runOpenClaw } = await import('./runOpenClaw-Ca9ygi8M.mjs');
17392
17448
  let startedBy = void 0;
17393
17449
  let verbose = false;
17394
17450
  let gatewayUrl;
@@ -17439,7 +17495,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17439
17495
  return;
17440
17496
  } else if (subcommand === "todo") {
17441
17497
  try {
17442
- const { handleTodoCommand } = await import('./todo-CGRuBaiH.mjs');
17498
+ const { handleTodoCommand } = await import('./todo-9iv7_n7i.mjs');
17443
17499
  await handleTodoCommand(args.slice(1));
17444
17500
  } catch (error) {
17445
17501
  console.error(JSON.stringify({ error: error instanceof Error ? error.message : "Todo command failed" }));
@@ -17448,7 +17504,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17448
17504
  return;
17449
17505
  } else if (subcommand === "teams") {
17450
17506
  try {
17451
- const { handleTeamsCommand } = await import('./teams-Bx79Wr9-.mjs');
17507
+ const { handleTeamsCommand } = await import('./teams-Bf2D8dwL.mjs');
17452
17508
  await handleTeamsCommand(args.slice(1));
17453
17509
  } catch (error) {
17454
17510
  console.error(error instanceof Error ? error.message : "Teams command failed");
@@ -17457,7 +17513,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17457
17513
  return;
17458
17514
  } else if (subcommand === "mcp" && args.length === 1) {
17459
17515
  try {
17460
- const { handleMcpCommand } = await import('./mcp-BHNVwrwS.mjs');
17516
+ const { handleMcpCommand } = await import('./mcp-CZJM3obK.mjs');
17461
17517
  await handleMcpCommand();
17462
17518
  } catch (error) {
17463
17519
  process.stderr.write(`[very-happy mcp] Fatal: ${error instanceof Error ? error.message : String(error)}
@@ -1,11 +1,11 @@
1
- import { q as query } from './index-tr2Fqhby.mjs';
1
+ import { q as query } from './index-BPYVCjjs.mjs';
2
2
  export { AbortError } from '@anthropic-ai/claude-agent-sdk';
3
3
  import 'chalk';
4
4
  import 'node:os';
5
5
  import 'node:crypto';
6
- import './types-BvYEAHds.mjs';
6
+ import './types-lFZhC_6M.mjs';
7
7
  import 'axios';
8
- import './limits-C41sn_OJ.mjs';
8
+ import './limits-BusZ5sPV.mjs';
9
9
  import 'node:fs/promises';
10
10
  import 'node:fs';
11
11
  import 'node:path';
@@ -29,7 +29,7 @@ import 'fs';
29
29
  import 'node:readline';
30
30
  import '@anthropic-ai/sandbox-runtime';
31
31
  import 'expo-server-sdk';
32
- import './agentGuidance-DlZ5s0Om.mjs';
32
+ import './agentGuidance-CeuhVA2K.mjs';
33
33
  import 'ink';
34
34
  import 'react';
35
35
  import 'ps-list';
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BdZ7Dlg0.cjs');
3
+ var index = require('./index-B5Vv72dN.cjs');
4
4
  var claudeAgentSdk = require('@anthropic-ai/claude-agent-sdk');
5
5
  require('chalk');
6
6
  require('node:os');
7
7
  require('node:crypto');
8
- require('./types-Ba9u0uZL.cjs');
8
+ require('./types-B20MYc5R.cjs');
9
9
  require('axios');
10
- require('./limits-B5wJ5Slz.cjs');
10
+ require('./limits-C9bJJEyR.cjs');
11
11
  require('node:fs/promises');
12
12
  require('node:fs');
13
13
  require('node:path');
@@ -31,7 +31,7 @@ require('fs');
31
31
  require('node:readline');
32
32
  require('@anthropic-ai/sandbox-runtime');
33
33
  require('expo-server-sdk');
34
- require('./agentGuidance-B1PsijGg.cjs');
34
+ require('./agentGuidance-B4bH8Nuz.cjs');
35
35
  require('ink');
36
36
  require('react');
37
37
  require('ps-list');
@@ -1,9 +1,9 @@
1
- import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-MAU4POiE.mjs';
2
- export { a as DEFAULT_IDLE_TIMEOUT_MS, b as DEFAULT_TOOL_CALL_TIMEOUT_MS, e as extractErrorDetail, f as formatDuration, c as formatDurationMinutes, h as handleAgentMessageChunk, d as handleAgentThoughtChunk, g as handleLegacyMessageChunk, i as handlePlanUpdate, j as handleThinkingUpdate, k as handleToolCall, l as handleToolCallUpdate, p as parseArgsFromContent } from './AcpBackend-MAU4POiE.mjs';
3
- import { c as configuration, g as readSettings, i as encodeBase64, l as logger } from './limits-C41sn_OJ.mjs';
4
- import { A as AcpSessionManager } from './AcpSessionManager-uSGDDRqF.mjs';
5
- import { f as connectionState, A as ApiClient, p as projectPath, g as BUILTIN_TODO_DISCOVERY } from './types-BvYEAHds.mjs';
6
- import { P as PI_TEAMS_EXTENSION, n as initialMachineMetadata, o as createSessionMetadata, u as setupOfflineReconnection, v as notifyDaemonSessionStarted, z as StreamRelay, x as MessageQueue2, B as hashObject, C as startHappyServer, E as registerAgentAttachmentDownloads, F as TitleGenerator, y as registerKillSessionHandler, H as CLAUDE_ATTACHMENT_KINDS, I as stageClaudeAttachments, J as appendStagedAttachmentsToPrompt, K as BasePermissionHandler, L as writeSessionModeFile, N as normalizeAcpPermissionMode, O as removeSessionModeFile } from './index-tr2Fqhby.mjs';
1
+ import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-DSRZM4lo.mjs';
2
+ export { a as DEFAULT_IDLE_TIMEOUT_MS, b as DEFAULT_TOOL_CALL_TIMEOUT_MS, e as extractErrorDetail, f as formatDuration, c as formatDurationMinutes, h as handleAgentMessageChunk, d as handleAgentThoughtChunk, g as handleLegacyMessageChunk, i as handlePlanUpdate, j as handleThinkingUpdate, k as handleToolCall, l as handleToolCallUpdate, p as parseArgsFromContent } from './AcpBackend-DSRZM4lo.mjs';
3
+ import { c as configuration, g as readSettings, i as encodeBase64, l as logger } from './limits-BusZ5sPV.mjs';
4
+ import { A as AcpSessionManager } from './AcpSessionManager-DtXOAeQ0.mjs';
5
+ import { f as connectionState, A as ApiClient, p as projectPath, g as BUILTIN_TODO_DISCOVERY } from './types-lFZhC_6M.mjs';
6
+ import { P as PI_TEAMS_EXTENSION, n as initialMachineMetadata, o as createSessionMetadata, u as setupOfflineReconnection, v as notifyDaemonSessionStarted, z as StreamRelay, x as MessageQueue2, B as hashObject, C as startHappyServer, E as registerAgentAttachmentDownloads, F as TitleGenerator, y as registerKillSessionHandler, H as CLAUDE_ATTACHMENT_KINDS, I as stageClaudeAttachments, J as appendStagedAttachmentsToPrompt, K as BasePermissionHandler, L as writeSessionModeFile, N as normalizeAcpPermissionMode, O as removeSessionModeFile } from './index-BPYVCjjs.mjs';
7
7
  import { mkdir, chmod, writeFile, rename } from 'node:fs/promises';
8
8
  import { randomUUID } from 'node:crypto';
9
9
  import { join } from 'node:path';
@@ -32,7 +32,7 @@ import 'fs';
32
32
  import 'node:readline';
33
33
  import '@anthropic-ai/sandbox-runtime';
34
34
  import 'expo-server-sdk';
35
- import './agentGuidance-DlZ5s0Om.mjs';
35
+ import './agentGuidance-CeuhVA2K.mjs';
36
36
  import 'ink';
37
37
  import 'react';
38
38
  import '@anthropic-ai/claude-agent-sdk';
@@ -706,7 +706,13 @@ async function runAcp(opts) {
706
706
  return true;
707
707
  };
708
708
  const isAssistantVariant = process.env.HAPPY_SESSION_VARIANT === "assistant";
709
- const happyServer = await startHappyServer(session, { assistant: isAssistantVariant });
709
+ const happyServer = await startHappyServer(session, {
710
+ assistant: isAssistantVariant,
711
+ ...opts.agentName === "pi" ? { onContextUsage: (contextUsage) => {
712
+ session.updateAgentState((state2) => ({ ...state2, contextUsage }));
713
+ } } : {}
714
+ });
715
+ if (opts.agentName === "pi") session.updateAgentState((state2) => ({ ...state2, contextUsage: null }));
710
716
  const mcpServers = {
711
717
  happy: {
712
718
  command: join(projectPath(), "bin", "very-happy-mcp.mjs"),
@@ -722,6 +728,7 @@ async function runAcp(opts) {
722
728
  env: {
723
729
  ...teamsPiEnv,
724
730
  HAPPY_MCP_URL: happyServer.url,
731
+ ...happyServer.contextUsageUrl ? { HAPPY_CONTEXT_USAGE_URL: happyServer.contextUsageUrl } : {},
725
732
  HAPPY_SESSION_ID: session.sessionId,
726
733
  HAPPY_PERMISSION_MODE: initialPermissionMode
727
734
  },
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./index-BdZ7Dlg0.cjs');
5
- require('./limits-B5wJ5Slz.cjs');
4
+ require('./index-B5Vv72dN.cjs');
5
+ require('./limits-C9bJJEyR.cjs');
6
6
  require('zod');
7
- require('./types-Ba9u0uZL.cjs');
7
+ require('./types-B20MYc5R.cjs');
8
8
  require('node:child_process');
9
9
  require('node:os');
10
10
  require('node:crypto');
@@ -12,7 +12,7 @@ require('cross-spawn');
12
12
  require('node:path');
13
13
  require('node:readline');
14
14
  require('node:fs');
15
- require('./agentGuidance-B1PsijGg.cjs');
15
+ require('./agentGuidance-B4bH8Nuz.cjs');
16
16
  require('node:fs/promises');
17
17
  require('fs/promises');
18
18
  require('ink');
package/dist/index.mjs CHANGED
@@ -1,8 +1,8 @@
1
1
  import 'chalk';
2
- import './index-tr2Fqhby.mjs';
3
- import './limits-C41sn_OJ.mjs';
2
+ import './index-BPYVCjjs.mjs';
3
+ import './limits-BusZ5sPV.mjs';
4
4
  import 'zod';
5
- import './types-BvYEAHds.mjs';
5
+ import './types-lFZhC_6M.mjs';
6
6
  import 'node:child_process';
7
7
  import 'node:os';
8
8
  import 'node:crypto';
@@ -10,7 +10,7 @@ import 'cross-spawn';
10
10
  import 'node:path';
11
11
  import 'node:readline';
12
12
  import 'node:fs';
13
- import './agentGuidance-DlZ5s0Om.mjs';
13
+ import './agentGuidance-CeuhVA2K.mjs';
14
14
  import 'node:fs/promises';
15
15
  import 'fs/promises';
16
16
  import 'ink';
@@ -3,10 +3,10 @@ import { join, resolve } from 'node:path';
3
3
  import { homedir } from 'node:os';
4
4
  import { spawnSync } from 'node:child_process';
5
5
  import chalk from 'chalk';
6
- import { p as projectPath } from './types-BvYEAHds.mjs';
7
- import { t as tmuxSupportsSessionEnv } from './index-tr2Fqhby.mjs';
6
+ import { p as projectPath } from './types-lFZhC_6M.mjs';
7
+ import { t as tmuxSupportsSessionEnv } from './index-BPYVCjjs.mjs';
8
8
  import 'axios';
9
- import './limits-C41sn_OJ.mjs';
9
+ import './limits-BusZ5sPV.mjs';
10
10
  import 'node:fs/promises';
11
11
  import 'zod';
12
12
  import 'node:crypto';
@@ -28,7 +28,7 @@ import 'fs';
28
28
  import 'node:readline';
29
29
  import '@anthropic-ai/sandbox-runtime';
30
30
  import 'expo-server-sdk';
31
- import './agentGuidance-DlZ5s0Om.mjs';
31
+ import './agentGuidance-CeuhVA2K.mjs';
32
32
  import 'ink';
33
33
  import 'react';
34
34
  import '@anthropic-ai/claude-agent-sdk';
@@ -5,10 +5,10 @@ var path = require('node:path');
5
5
  var os = require('node:os');
6
6
  var node_child_process = require('node:child_process');
7
7
  var chalk = require('chalk');
8
- var api = require('./types-Ba9u0uZL.cjs');
9
- var index = require('./index-BdZ7Dlg0.cjs');
8
+ var api = require('./types-B20MYc5R.cjs');
9
+ var index = require('./index-B5Vv72dN.cjs');
10
10
  require('axios');
11
- require('./limits-B5wJ5Slz.cjs');
11
+ require('./limits-C9bJJEyR.cjs');
12
12
  require('node:fs/promises');
13
13
  require('zod');
14
14
  require('node:crypto');
@@ -30,7 +30,7 @@ require('fs');
30
30
  require('node:readline');
31
31
  require('@anthropic-ai/sandbox-runtime');
32
32
  require('expo-server-sdk');
33
- require('./agentGuidance-B1PsijGg.cjs');
33
+ require('./agentGuidance-B4bH8Nuz.cjs');
34
34
  require('ink');
35
35
  require('react');
36
36
  require('@anthropic-ai/claude-agent-sdk');
package/dist/lib.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./types-Ba9u0uZL.cjs');
4
- var persistence = require('./limits-B5wJ5Slz.cjs');
3
+ var api = require('./types-B20MYc5R.cjs');
4
+ var persistence = require('./limits-C9bJJEyR.cjs');
5
5
  require('axios');
6
6
  require('node:events');
7
7
  require('socket.io-client');
package/dist/lib.d.cts CHANGED
@@ -5,28 +5,6 @@ import { EventEmitter } from 'node:events';
5
5
  import { Socket } from 'socket.io-client';
6
6
  import { ExpoPushMessage } from 'expo-server-sdk';
7
7
 
8
- declare const CLAUDE_AUTH_PROBE_VERSION: 1;
9
- type ClaudeAuthStatus = 'ok' | 'not-logged-in' | 'unknown' | 'error' | 'claude-missing';
10
- type ClaudeAuthDiagnosis = 'keychain-empty-item' | 'store-divergence' | 'no-credentials' | 'credentials-rejected' | 'sdk-binary-missing' | 'probe-timeout' | 'probe-crash';
11
- type ClaudeAuthLineage = 'launchd' | 'inherited-env' | 'other';
12
- type ClaudeCredentialStore = 'auto' | 'file';
13
- interface ClaudeAuthState$1 {
14
- probeVersion: typeof CLAUDE_AUTH_PROBE_VERSION;
15
- daemonPid: number;
16
- status: ClaudeAuthStatus;
17
- authMethod?: string;
18
- subscriptionType?: string;
19
- diagnosis?: ClaudeAuthDiagnosis;
20
- detail?: string;
21
- repairable?: 'delete-empty-keychain-item';
22
- context: {
23
- platform: string;
24
- lineage: ClaudeAuthLineage;
25
- credentialStore: ClaudeCredentialStore;
26
- };
27
- checkedAt: number;
28
- }
29
-
30
8
  declare const sessionTurnEndStatusSchema: z.ZodEnum<{
31
9
  completed: "completed";
32
10
  failed: "failed";
@@ -163,6 +141,8 @@ declare const sessionStreamFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
163
141
  idx: z.ZodNumber;
164
142
  }, z.core.$strip>, z.ZodObject<{
165
143
  t: z.ZodLiteral<"progress">;
144
+ inputTokens: z.ZodOptional<z.ZodNumber>;
145
+ cacheTokens: z.ZodOptional<z.ZodNumber>;
166
146
  thinkingTokens: z.ZodOptional<z.ZodNumber>;
167
147
  outputTokens: z.ZodOptional<z.ZodNumber>;
168
148
  status: z.ZodOptional<z.ZodEnum<{
@@ -174,6 +154,37 @@ declare const sessionStreamFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
174
154
  }, z.core.$strip>], "t">;
175
155
  type SessionStreamFrame = z.infer<typeof sessionStreamFrameSchema>;
176
156
 
157
+ /** Runtime context occupancy, never cumulative billing. null after compaction is unknown. */
158
+ declare const ContextUsageSchema: z$1.ZodObject<{
159
+ source: z$1.ZodLiteral<"pi">;
160
+ tokens: z$1.ZodNullable<z$1.ZodNumber>;
161
+ contextWindow: z$1.ZodNumber;
162
+ updatedAt: z$1.ZodNumber;
163
+ }, z$1.core.$strip>;
164
+ type ContextUsage = z$1.infer<typeof ContextUsageSchema>;
165
+
166
+ declare const CLAUDE_AUTH_PROBE_VERSION: 1;
167
+ type ClaudeAuthStatus = 'ok' | 'not-logged-in' | 'unknown' | 'error' | 'claude-missing';
168
+ type ClaudeAuthDiagnosis = 'keychain-empty-item' | 'store-divergence' | 'no-credentials' | 'credentials-rejected' | 'sdk-binary-missing' | 'probe-timeout' | 'probe-crash';
169
+ type ClaudeAuthLineage = 'launchd' | 'inherited-env' | 'other';
170
+ type ClaudeCredentialStore = 'auto' | 'file';
171
+ interface ClaudeAuthState$1 {
172
+ probeVersion: typeof CLAUDE_AUTH_PROBE_VERSION;
173
+ daemonPid: number;
174
+ status: ClaudeAuthStatus;
175
+ authMethod?: string;
176
+ subscriptionType?: string;
177
+ diagnosis?: ClaudeAuthDiagnosis;
178
+ detail?: string;
179
+ repairable?: 'delete-empty-keychain-item';
180
+ context: {
181
+ platform: string;
182
+ lineage: ClaudeAuthLineage;
183
+ credentialStore: ClaudeCredentialStore;
184
+ };
185
+ checkedAt: number;
186
+ }
187
+
177
188
  /**
178
189
  * Simplified schema that only validates fields actually used in the codebase
179
190
  * while preserving all other fields through passthrough()
@@ -673,6 +684,7 @@ type Metadata = {
673
684
  };
674
685
  };
675
686
  type AgentState$1 = {
687
+ contextUsage?: ContextUsage | null;
676
688
  controlledByUser?: boolean | null | undefined;
677
689
  requests?: {
678
690
  [id: string]: {
package/dist/lib.d.mts CHANGED
@@ -5,28 +5,6 @@ import { EventEmitter } from 'node:events';
5
5
  import { Socket } from 'socket.io-client';
6
6
  import { ExpoPushMessage } from 'expo-server-sdk';
7
7
 
8
- declare const CLAUDE_AUTH_PROBE_VERSION: 1;
9
- type ClaudeAuthStatus = 'ok' | 'not-logged-in' | 'unknown' | 'error' | 'claude-missing';
10
- type ClaudeAuthDiagnosis = 'keychain-empty-item' | 'store-divergence' | 'no-credentials' | 'credentials-rejected' | 'sdk-binary-missing' | 'probe-timeout' | 'probe-crash';
11
- type ClaudeAuthLineage = 'launchd' | 'inherited-env' | 'other';
12
- type ClaudeCredentialStore = 'auto' | 'file';
13
- interface ClaudeAuthState$1 {
14
- probeVersion: typeof CLAUDE_AUTH_PROBE_VERSION;
15
- daemonPid: number;
16
- status: ClaudeAuthStatus;
17
- authMethod?: string;
18
- subscriptionType?: string;
19
- diagnosis?: ClaudeAuthDiagnosis;
20
- detail?: string;
21
- repairable?: 'delete-empty-keychain-item';
22
- context: {
23
- platform: string;
24
- lineage: ClaudeAuthLineage;
25
- credentialStore: ClaudeCredentialStore;
26
- };
27
- checkedAt: number;
28
- }
29
-
30
8
  declare const sessionTurnEndStatusSchema: z.ZodEnum<{
31
9
  completed: "completed";
32
10
  failed: "failed";
@@ -163,6 +141,8 @@ declare const sessionStreamFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
163
141
  idx: z.ZodNumber;
164
142
  }, z.core.$strip>, z.ZodObject<{
165
143
  t: z.ZodLiteral<"progress">;
144
+ inputTokens: z.ZodOptional<z.ZodNumber>;
145
+ cacheTokens: z.ZodOptional<z.ZodNumber>;
166
146
  thinkingTokens: z.ZodOptional<z.ZodNumber>;
167
147
  outputTokens: z.ZodOptional<z.ZodNumber>;
168
148
  status: z.ZodOptional<z.ZodEnum<{
@@ -174,6 +154,37 @@ declare const sessionStreamFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
174
154
  }, z.core.$strip>], "t">;
175
155
  type SessionStreamFrame = z.infer<typeof sessionStreamFrameSchema>;
176
156
 
157
+ /** Runtime context occupancy, never cumulative billing. null after compaction is unknown. */
158
+ declare const ContextUsageSchema: z$1.ZodObject<{
159
+ source: z$1.ZodLiteral<"pi">;
160
+ tokens: z$1.ZodNullable<z$1.ZodNumber>;
161
+ contextWindow: z$1.ZodNumber;
162
+ updatedAt: z$1.ZodNumber;
163
+ }, z$1.core.$strip>;
164
+ type ContextUsage = z$1.infer<typeof ContextUsageSchema>;
165
+
166
+ declare const CLAUDE_AUTH_PROBE_VERSION: 1;
167
+ type ClaudeAuthStatus = 'ok' | 'not-logged-in' | 'unknown' | 'error' | 'claude-missing';
168
+ type ClaudeAuthDiagnosis = 'keychain-empty-item' | 'store-divergence' | 'no-credentials' | 'credentials-rejected' | 'sdk-binary-missing' | 'probe-timeout' | 'probe-crash';
169
+ type ClaudeAuthLineage = 'launchd' | 'inherited-env' | 'other';
170
+ type ClaudeCredentialStore = 'auto' | 'file';
171
+ interface ClaudeAuthState$1 {
172
+ probeVersion: typeof CLAUDE_AUTH_PROBE_VERSION;
173
+ daemonPid: number;
174
+ status: ClaudeAuthStatus;
175
+ authMethod?: string;
176
+ subscriptionType?: string;
177
+ diagnosis?: ClaudeAuthDiagnosis;
178
+ detail?: string;
179
+ repairable?: 'delete-empty-keychain-item';
180
+ context: {
181
+ platform: string;
182
+ lineage: ClaudeAuthLineage;
183
+ credentialStore: ClaudeCredentialStore;
184
+ };
185
+ checkedAt: number;
186
+ }
187
+
177
188
  /**
178
189
  * Simplified schema that only validates fields actually used in the codebase
179
190
  * while preserving all other fields through passthrough()
@@ -673,6 +684,7 @@ type Metadata = {
673
684
  };
674
685
  };
675
686
  type AgentState$1 = {
687
+ contextUsage?: ContextUsage | null;
676
688
  controlledByUser?: boolean | null | undefined;
677
689
  requests?: {
678
690
  [id: string]: {
package/dist/lib.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema } from './types-BvYEAHds.mjs';
2
- export { c as configuration, l as logger } from './limits-C41sn_OJ.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema } from './types-lFZhC_6M.mjs';
2
+ export { c as configuration, l as logger } from './limits-BusZ5sPV.mjs';
3
3
  import 'axios';
4
4
  import 'node:events';
5
5
  import 'socket.io-client';