very-happy-cli 0.2.130 → 0.2.132

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-5slez7vM.cjs → AcpBackend--EnHZRC4.cjs} +2 -2
  2. package/dist/{AcpBackend-Co3atHW2.mjs → AcpBackend-BNMLGtST.mjs} +2 -2
  3. package/dist/{AcpSessionManager-B0sD6Zi7.mjs → AcpSessionManager-BF5JZYCC.mjs} +1 -1
  4. package/dist/{AcpSessionManager-CxvVg8ec.cjs → AcpSessionManager-RoOyx5KI.cjs} +1 -1
  5. package/dist/{agentGuidance-7pJxf_3b.mjs → agentGuidance-DeOIgOhh.mjs} +1 -1
  6. package/dist/{agentGuidance-TjPzDO7d.cjs → agentGuidance-R9MH5Cd5.cjs} +1 -1
  7. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  8. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  9. package/dist/{config-B4Md4FvK.cjs → config-CkmssSRu.cjs} +4 -4
  10. package/dist/{config-BWu8j7bO.mjs → config-ClCkJ1a_.mjs} +4 -4
  11. package/dist/{index-Ds0aHXiU.cjs → index-Bqg6yo5s.cjs} +4 -4
  12. package/dist/{index-DksoP9b2.cjs → index-CjopZZg3.cjs} +14 -7
  13. package/dist/{index-BUhcXX8R.mjs → index-D1gHXtkw.mjs} +68 -20
  14. package/dist/{index-C13U8MkT.mjs → index-DK0qz1y7.mjs} +4 -4
  15. package/dist/{index-CdOVizh_.mjs → index-DdbU8FmA.mjs} +15 -8
  16. package/dist/{index-C7TA3haC.cjs → index-Dn7s2iaT.cjs} +72 -24
  17. package/dist/index.cjs +4 -4
  18. package/dist/index.mjs +4 -4
  19. package/dist/{installTerminalHooks-cNXov61F.cjs → installTerminalHooks-CPZ3vVn8.cjs} +4 -4
  20. package/dist/{installTerminalHooks-kUC6I6Rn.mjs → installTerminalHooks-CRWWmonO.mjs} +4 -4
  21. package/dist/lib.cjs +2 -2
  22. package/dist/lib.d.cts +32 -22
  23. package/dist/lib.d.mts +32 -22
  24. package/dist/lib.mjs +2 -2
  25. package/dist/{limits-CIcZA0Bn.mjs → limits-C9aXkP7U.mjs} +7 -7
  26. package/dist/{limits-BhK6ovLz.cjs → limits-DLlsV71c.cjs} +7 -7
  27. package/dist/{mcp-CNX1qErQ.cjs → mcp-DHkYfENQ.cjs} +4 -4
  28. package/dist/{mcp-D5uyhbfB.mjs → mcp-DkoXvc07.mjs} +4 -4
  29. package/dist/{runGemini-BQd3qlVY.mjs → runGemini-BjEl7syj.mjs} +6 -6
  30. package/dist/{runGemini-DvV6X_GE.cjs → runGemini-Cx1YcK2o.cjs} +6 -6
  31. package/dist/{runOpenClaw-BgtE2jKF.mjs → runOpenClaw-ByHu69K5.mjs} +5 -5
  32. package/dist/{runOpenClaw-jxvPz3bo.cjs → runOpenClaw-I4sGAQf1.cjs} +5 -5
  33. package/dist/{send-BdhUFGTm.mjs → send-CSOeUlQC.mjs} +4 -4
  34. package/dist/{send-Di8Q32Ds.cjs → send-gH1vJ0iv.cjs} +4 -4
  35. package/dist/{sessions-eaAew6IP.cjs → sessions-BBc8L8qf.cjs} +4 -4
  36. package/dist/{sessions-Bo2THj4y.mjs → sessions-CP9FlcJ6.mjs} +4 -4
  37. package/dist/{spawn-6GfCYB5i.cjs → spawn-Dmfbot5k.cjs} +4 -4
  38. package/dist/{spawn-CJxg1JUO.mjs → spawn-DrQo81MW.mjs} +4 -4
  39. package/dist/{teams-CHGj90rR.mjs → teams-Bbvo1G6y.mjs} +4 -4
  40. package/dist/{teams-WdwFtptw.cjs → teams-DtXQYmEK.cjs} +4 -4
  41. package/dist/{todo-C8hDSNBP.mjs → todo-BAwevRyb.mjs} +3 -3
  42. package/dist/{todo-C-wktj2K.cjs → todo-DOi6svw9.cjs} +3 -3
  43. package/dist/{types-QB33ckXt.cjs → types-B15E2OVy.cjs} +9 -2
  44. package/dist/{types-B-ySoSY9.mjs → types-CA-c2NH7.mjs} +8 -2
  45. package/package.json +7 -7
@@ -3,13 +3,13 @@
3
3
  var chalk = require('chalk');
4
4
  var os = require('node:os');
5
5
  var node_crypto = require('node:crypto');
6
- var api = require('./types-QB33ckXt.cjs');
7
- var persistence = require('./limits-BhK6ovLz.cjs');
6
+ var api = require('./types-B15E2OVy.cjs');
7
+ var persistence = require('./limits-DLlsV71c.cjs');
8
8
  var spawn = require('cross-spawn');
9
9
  var path = require('node:path');
10
10
  var node_readline = require('node:readline');
11
11
  var node_fs = require('node:fs');
12
- var agentGuidance = require('./agentGuidance-TjPzDO7d.cjs');
12
+ var agentGuidance = require('./agentGuidance-R9MH5Cd5.cjs');
13
13
  var promises = require('node:fs/promises');
14
14
  var fs = require('fs/promises');
15
15
  var ink = require('ink');
@@ -7714,7 +7714,7 @@ function parseJsonObject(text) {
7714
7714
  return null;
7715
7715
  }
7716
7716
  }
7717
- function resolveSdkClaudeBinary(platform = process.platform, arch = process.arch, resolver = (s) => node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C7TA3haC.cjs', document.baseURI).href))).resolve(s)) {
7717
+ function resolveSdkClaudeBinary(platform = process.platform, arch = process.arch, resolver = (s) => node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Dn7s2iaT.cjs', document.baseURI).href))).resolve(s)) {
7718
7718
  const platformArch = `${platform}-${arch}`;
7719
7719
  const candidates = [
7720
7720
  `@anthropic-ai/claude-agent-sdk-${platformArch}/claude`,
@@ -8895,6 +8895,24 @@ export default async function(pi) {
8895
8895
  const {readFile} = await import('node:fs/promises');
8896
8896
  const {join} = await import('node:path');
8897
8897
  const {homedir} = await import('node:os');
8898
+ const contextEndpoint = process.env.HAPPY_CONTEXT_USAGE_URL;
8899
+ if (contextEndpoint) {
8900
+ const target = new URL(contextEndpoint);
8901
+ if (target.origin !== url.origin || !target.pathname.startsWith('/runtime-context/')) throw new Error('Very Happy context must be local');
8902
+ let reporting = Promise.resolve();
8903
+ for (const name of ['session_start', 'session_switch', 'session_compact', 'model_select', 'turn_end', 'agent_end']) {
8904
+ pi.on(name, async (_event, ctx) => {
8905
+ const usage = ctx.getContextUsage?.();
8906
+ const contextWindow = usage?.contextWindow ?? ctx.model?.contextWindow;
8907
+ if (!(contextWindow > 0)) return;
8908
+ const snapshot = {source:'pi', tokens:usage?.tokens ?? null, contextWindow};
8909
+ reporting = reporting.catch(() => {}).then(async () => {
8910
+ try { await fetch(contextEndpoint, {method:'POST', redirect:'error', headers:{'content-type':'application/json'}, body:JSON.stringify(snapshot), signal:AbortSignal.timeout(2000)}); } catch {}
8911
+ });
8912
+ await reporting;
8913
+ });
8914
+ }
8915
+ }
8898
8916
  pi.on('tool_call', async (event, ctx) => {
8899
8917
  let mode = process.env.HAPPY_PERMISSION_MODE || 'default';
8900
8918
  const sid = process.env.HAPPY_SESSION_ID;
@@ -9487,6 +9505,8 @@ function writeReceipt(home, receipt) {
9487
9505
  const exec = node_util.promisify(node_child_process.execFile);
9488
9506
  const git = async (directory, args) => (await exec("git", ["-C", directory, ...args], { timeout: 3e4, maxBuffer: 2 * 1024 * 1024 })).stdout.trim();
9489
9507
  async function prepareTeamWorktree(home, repository, id) {
9508
+ if (repository === "~") repository = os.homedir();
9509
+ else if (repository.startsWith("~/") || process.platform === "win32" && repository.startsWith("~\\")) repository = path.join(os.homedir(), repository.slice(2));
9490
9510
  if (!path.isAbsolute(repository) || !/^[a-zA-Z0-9_-]{1,128}$/.test(id)) throw new Error("A team task requires an absolute repository path and valid operation id");
9491
9511
  await git(repository, ["rev-parse", "--show-toplevel"]);
9492
9512
  const root = path.join(home, "teams", "worktrees");
@@ -9618,6 +9638,10 @@ function createTeamWorker(deps) {
9618
9638
  await deps.stopAndWait(op.sessionId);
9619
9639
  await archiveSession(op.sessionId);
9620
9640
  }
9641
+ if (team.archivedAt !== void 0) {
9642
+ await complete(op, receipt);
9643
+ return;
9644
+ }
9621
9645
  const origins = team.operations.filter((candidate) => candidate.type === "spawn" && candidate.botId === op.botId && candidate.generation === op.generation && candidate.sessionId === op.sessionId);
9622
9646
  if (origins.length !== 1) throw new Error("Original worktree ownership is unknown; manual reconciliation required");
9623
9647
  const resource = readReceipt(home, origins[0].id);
@@ -9702,7 +9726,7 @@ Use the teams tools to inspect current task state before acting. This message is
9702
9726
  const status = axios.isAxiosError(error) ? error.response?.status : void 0;
9703
9727
  if (status !== 404) deps.log("Teams schedule advancement unavailable; regular reconciliation continues");
9704
9728
  }
9705
- const { data } = await http.get("/v1/teams/operations", { params: { machineId: deps.machineId, schedulesVersion: 1, teamLaunchVersion: 1 } });
9729
+ const { data } = await http.get("/v1/teams/operations", { params: { machineId: deps.machineId, schedulesVersion: 1, teamLaunchVersion: 1, teamArchiveVersion: 1 } });
9706
9730
  knownSessionIds = new Set((data.teams ?? []).flatMap((team) => team.bots.flatMap((bot) => bot.sessionId ? [bot.sessionId] : [])));
9707
9731
  for (const op of data.operations) {
9708
9732
  if (closed) break;
@@ -11784,7 +11808,30 @@ async function startHappyServer(client, options) {
11784
11808
  }
11785
11809
  }
11786
11810
  };
11811
+ const contextPath = "/runtime-context/" + node_crypto.randomUUID();
11787
11812
  const server = node_http.createServer(async (req, res) => {
11813
+ if (req.url?.startsWith("/runtime-context/")) {
11814
+ if (!options?.onContextUsage || req.url !== contextPath || req.method !== "POST" || req.headers.origin) {
11815
+ res.writeHead(403).end();
11816
+ return;
11817
+ }
11818
+ try {
11819
+ let body = "";
11820
+ for await (const chunk of req) {
11821
+ body += chunk.toString();
11822
+ if (Buffer.byteLength(body) > 2048) {
11823
+ res.writeHead(413).end();
11824
+ return;
11825
+ }
11826
+ }
11827
+ const usage = api.ContextUsageSchema.parse({ ...JSON.parse(body), updatedAt: Date.now() });
11828
+ options.onContextUsage(usage);
11829
+ res.writeHead(204).end();
11830
+ } catch {
11831
+ if (!res.headersSent) res.writeHead(400).end();
11832
+ }
11833
+ return;
11834
+ }
11788
11835
  const mcp = createMcpServer(handlers, options, client.sessionId);
11789
11836
  try {
11790
11837
  const transport = new streamableHttp_js.StreamableHTTPServerTransport({
@@ -11818,6 +11865,7 @@ async function startHappyServer(client, options) {
11818
11865
  persistence.logger.debug(`[happyMCP] server:ready sessionId=${client.sessionId} url=${baseUrl.toString()}`);
11819
11866
  return {
11820
11867
  url: baseUrl.toString(),
11868
+ contextUsageUrl: options?.onContextUsage ? new URL(contextPath, baseUrl).toString() : void 0,
11821
11869
  toolNames: [
11822
11870
  "change_title",
11823
11871
  persistence.CLIPBOARD_TOOL_NAME,
@@ -12085,7 +12133,7 @@ function registerSideQuestionHandler(rpc, deps) {
12085
12133
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
12086
12134
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
12087
12135
  const run = deps.run ?? (async (input) => {
12088
- const { query } = await Promise.resolve().then(function () { return require('./index-Ds0aHXiU.cjs'); });
12136
+ const { query } = await Promise.resolve().then(function () { return require('./index-Bqg6yo5s.cjs'); });
12089
12137
  return runSideQuestion(query, input);
12090
12138
  });
12091
12139
  const slots = /* @__PURE__ */ new Map();
@@ -12187,7 +12235,7 @@ const MAX_TITLE_CHARS = 60;
12187
12235
  const GENERATION_TIMEOUT_MS = 3e4;
12188
12236
  function resolveClaudeBinary() {
12189
12237
  try {
12190
- const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C7TA3haC.cjs', document.baseURI).href)));
12238
+ const require$1 = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Dn7s2iaT.cjs', document.baseURI).href)));
12191
12239
  const utilsPath = path.resolve(path.join(api.projectPath(), "scripts", "claude_version_utils.cjs"));
12192
12240
  const { getClaudeCliPath } = require$1(utilsPath);
12193
12241
  const path$1 = getClaudeCliPath();
@@ -14405,9 +14453,9 @@ function resolveLocalSignupBootstrap(configuredMode, configuredInviteCodes, gene
14405
14453
  };
14406
14454
  }
14407
14455
 
14408
- const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C7TA3haC.cjs', document.baseURI).href)));
14456
+ const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Dn7s2iaT.cjs', document.baseURI).href)));
14409
14457
  const __dirname$1 = path.dirname(__filename$1);
14410
- const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-C7TA3haC.cjs', document.baseURI).href)));
14458
+ const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Dn7s2iaT.cjs', document.baseURI).href)));
14411
14459
  const PRISMA_QUERY_ENGINE_FILES = {
14412
14460
  "arm64-darwin": "libquery_engine-darwin-arm64.dylib.node",
14413
14461
  "x64-darwin": "libquery_engine-darwin.dylib.node",
@@ -17102,7 +17150,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17102
17150
  process.exit(0);
17103
17151
  } else if (subcommand === "install-terminal-hooks") {
17104
17152
  try {
17105
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-cNXov61F.cjs'); });
17153
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-CPZ3vVn8.cjs'); });
17106
17154
  const command = parseTerminalHooksArgs(args.slice(1));
17107
17155
  if (command.action === "help") {
17108
17156
  console.log(TERMINAL_HOOKS_HELP);
@@ -17119,7 +17167,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17119
17167
  }
17120
17168
  } else if (subcommand === "spawn") {
17121
17169
  try {
17122
- const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-6GfCYB5i.cjs'); });
17170
+ const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-Dmfbot5k.cjs'); });
17123
17171
  await handleSpawnCommand(args.slice(1));
17124
17172
  } catch (error) {
17125
17173
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17131,7 +17179,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17131
17179
  return;
17132
17180
  } else if (subcommand === "sessions") {
17133
17181
  try {
17134
- const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-eaAew6IP.cjs'); });
17182
+ const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-BBc8L8qf.cjs'); });
17135
17183
  await handleSessionsCommand(args.slice(1));
17136
17184
  } catch (error) {
17137
17185
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17143,7 +17191,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17143
17191
  return;
17144
17192
  } else if (subcommand === "send") {
17145
17193
  try {
17146
- const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-Di8Q32Ds.cjs'); });
17194
+ const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-gH1vJ0iv.cjs'); });
17147
17195
  await handleSendCommand(args.slice(1));
17148
17196
  } catch (error) {
17149
17197
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17249,9 +17297,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17249
17297
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
17250
17298
  const projectId = args[3];
17251
17299
  try {
17252
- const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-B4Md4FvK.cjs'); });
17253
- const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-BhK6ovLz.cjs'); }).then(function (n) { return n.persistence; });
17254
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-QB33ckXt.cjs'); }).then(function (n) { return n.api; });
17300
+ const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-CkmssSRu.cjs'); });
17301
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-DLlsV71c.cjs'); }).then(function (n) { return n.persistence; });
17302
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-B15E2OVy.cjs'); }).then(function (n) { return n.api; });
17255
17303
  let userEmail = void 0;
17256
17304
  try {
17257
17305
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -17282,7 +17330,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17282
17330
  }
17283
17331
  if (geminiSubcommand === "project" && args[2] === "get") {
17284
17332
  try {
17285
- const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-B4Md4FvK.cjs'); });
17333
+ const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-CkmssSRu.cjs'); });
17286
17334
  const config = readGeminiLocalConfig();
17287
17335
  if (config.googleCloudProject) {
17288
17336
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -17322,7 +17370,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17322
17370
  process.exit(0);
17323
17371
  }
17324
17372
  try {
17325
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-DvV6X_GE.cjs'); });
17373
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-Cx1YcK2o.cjs'); });
17326
17374
  let startedBy = void 0;
17327
17375
  for (let i = 1; i < args.length; i++) {
17328
17376
  if (args[i] === "--started-by") {
@@ -17352,7 +17400,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17352
17400
  }
17353
17401
  };
17354
17402
  try {
17355
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-DksoP9b2.cjs'); });
17403
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-CjopZZg3.cjs'); });
17356
17404
  const parsed = parsePiRunnerArgs(args.slice(1));
17357
17405
  const resolved = resolveAcpAgentConfig(["pi", ...parsed.passthrough]);
17358
17406
  const { credentials } = await authAndSetupMachineIfNeeded();
@@ -17380,7 +17428,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17380
17428
  return;
17381
17429
  } else if (subcommand === "acp") {
17382
17430
  try {
17383
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-DksoP9b2.cjs'); });
17431
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-CjopZZg3.cjs'); });
17384
17432
  let startedBy = void 0;
17385
17433
  let verbose = false;
17386
17434
  const acpArgs = [];
@@ -17420,7 +17468,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17420
17468
  return;
17421
17469
  } else if (subcommand === "openclaw") {
17422
17470
  try {
17423
- const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-jxvPz3bo.cjs'); });
17471
+ const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-I4sGAQf1.cjs'); });
17424
17472
  let startedBy = void 0;
17425
17473
  let verbose = false;
17426
17474
  let gatewayUrl;
@@ -17471,7 +17519,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17471
17519
  return;
17472
17520
  } else if (subcommand === "todo") {
17473
17521
  try {
17474
- const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-C-wktj2K.cjs'); });
17522
+ const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-DOi6svw9.cjs'); });
17475
17523
  await handleTodoCommand(args.slice(1));
17476
17524
  } catch (error) {
17477
17525
  console.error(JSON.stringify({ error: error instanceof Error ? error.message : "Todo command failed" }));
@@ -17480,7 +17528,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17480
17528
  return;
17481
17529
  } else if (subcommand === "teams") {
17482
17530
  try {
17483
- const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-WdwFtptw.cjs'); });
17531
+ const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-DtXQYmEK.cjs'); });
17484
17532
  await handleTeamsCommand(args.slice(1));
17485
17533
  } catch (error) {
17486
17534
  console.error(error instanceof Error ? error.message : "Teams command failed");
@@ -17489,7 +17537,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17489
17537
  return;
17490
17538
  } else if (subcommand === "mcp" && args.length === 1) {
17491
17539
  try {
17492
- const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-CNX1qErQ.cjs'); });
17540
+ const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-DHkYfENQ.cjs'); });
17493
17541
  await handleMcpCommand();
17494
17542
  } catch (error) {
17495
17543
  process.stderr.write(`[very-happy mcp] Fatal: ${error instanceof Error ? error.message : String(error)}
package/dist/index.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./index-C7TA3haC.cjs');
5
- require('./limits-BhK6ovLz.cjs');
4
+ require('./index-Dn7s2iaT.cjs');
5
+ require('./limits-DLlsV71c.cjs');
6
6
  require('zod');
7
- require('./types-QB33ckXt.cjs');
7
+ require('./types-B15E2OVy.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-TjPzDO7d.cjs');
15
+ require('./agentGuidance-R9MH5Cd5.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-BUhcXX8R.mjs';
3
- import './limits-CIcZA0Bn.mjs';
2
+ import './index-D1gHXtkw.mjs';
3
+ import './limits-C9aXkP7U.mjs';
4
4
  import 'zod';
5
- import './types-B-ySoSY9.mjs';
5
+ import './types-CA-c2NH7.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-7pJxf_3b.mjs';
13
+ import './agentGuidance-DeOIgOhh.mjs';
14
14
  import 'node:fs/promises';
15
15
  import 'fs/promises';
16
16
  import 'ink';
@@ -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-QB33ckXt.cjs');
9
- var index = require('./index-C7TA3haC.cjs');
8
+ var api = require('./types-B15E2OVy.cjs');
9
+ var index = require('./index-Dn7s2iaT.cjs');
10
10
  require('axios');
11
- require('./limits-BhK6ovLz.cjs');
11
+ require('./limits-DLlsV71c.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-TjPzDO7d.cjs');
33
+ require('./agentGuidance-R9MH5Cd5.cjs');
34
34
  require('ink');
35
35
  require('react');
36
36
  require('@anthropic-ai/claude-agent-sdk');
@@ -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-B-ySoSY9.mjs';
7
- import { t as tmuxSupportsSessionEnv } from './index-BUhcXX8R.mjs';
6
+ import { p as projectPath } from './types-CA-c2NH7.mjs';
7
+ import { t as tmuxSupportsSessionEnv } from './index-D1gHXtkw.mjs';
8
8
  import 'axios';
9
- import './limits-CIcZA0Bn.mjs';
9
+ import './limits-C9aXkP7U.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-7pJxf_3b.mjs';
31
+ import './agentGuidance-DeOIgOhh.mjs';
32
32
  import 'ink';
33
33
  import 'react';
34
34
  import '@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-QB33ckXt.cjs');
4
- var persistence = require('./limits-BhK6ovLz.cjs');
3
+ var api = require('./types-B15E2OVy.cjs');
4
+ var persistence = require('./limits-DLlsV71c.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";
@@ -176,6 +154,37 @@ declare const sessionStreamFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
176
154
  }, z.core.$strip>], "t">;
177
155
  type SessionStreamFrame = z.infer<typeof sessionStreamFrameSchema>;
178
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
+
179
188
  /**
180
189
  * Simplified schema that only validates fields actually used in the codebase
181
190
  * while preserving all other fields through passthrough()
@@ -675,6 +684,7 @@ type Metadata = {
675
684
  };
676
685
  };
677
686
  type AgentState$1 = {
687
+ contextUsage?: ContextUsage | null;
678
688
  controlledByUser?: boolean | null | undefined;
679
689
  requests?: {
680
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";
@@ -176,6 +154,37 @@ declare const sessionStreamFrameSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
176
154
  }, z.core.$strip>], "t">;
177
155
  type SessionStreamFrame = z.infer<typeof sessionStreamFrameSchema>;
178
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
+
179
188
  /**
180
189
  * Simplified schema that only validates fields actually used in the codebase
181
190
  * while preserving all other fields through passthrough()
@@ -675,6 +684,7 @@ type Metadata = {
675
684
  };
676
685
  };
677
686
  type AgentState$1 = {
687
+ contextUsage?: ContextUsage | null;
678
688
  controlledByUser?: boolean | null | undefined;
679
689
  requests?: {
680
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-B-ySoSY9.mjs';
2
- export { c as configuration, l as logger } from './limits-CIcZA0Bn.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, R as RawJSONLinesSchema } from './types-CA-c2NH7.mjs';
2
+ export { c as configuration, l as logger } from './limits-C9aXkP7U.mjs';
3
3
  import 'axios';
4
4
  import 'node:events';
5
5
  import 'socket.io-client';
@@ -9,7 +9,7 @@ import chalk from 'chalk';
9
9
  import { inspect } from 'node:util';
10
10
 
11
11
  var name = "very-happy-cli";
12
- var version = "0.2.130";
12
+ var version = "0.2.132";
13
13
  var description = "Remote multi-agent workspace CLI with deep Claude integration, native terminal streaming, and self-hosting.";
14
14
  var author = "Kirill Dubovitskiy";
15
15
  var contributors = [
@@ -122,12 +122,12 @@ var dependencies = {
122
122
  zod: "^4.0.0"
123
123
  };
124
124
  var optionalDependencies = {
125
- "very-happy-tools-arm64-darwin": "0.2.130",
126
- "very-happy-tools-x64-darwin": "0.2.130",
127
- "very-happy-tools-arm64-linux": "0.2.130",
128
- "very-happy-tools-x64-linux": "0.2.130",
129
- "very-happy-tools-arm64-win32": "0.2.130",
130
- "very-happy-tools-x64-win32": "0.2.130"
125
+ "very-happy-tools-arm64-darwin": "0.2.132",
126
+ "very-happy-tools-x64-darwin": "0.2.132",
127
+ "very-happy-tools-arm64-linux": "0.2.132",
128
+ "very-happy-tools-x64-linux": "0.2.132",
129
+ "very-happy-tools-arm64-win32": "0.2.132",
130
+ "very-happy-tools-x64-win32": "0.2.132"
131
131
  };
132
132
  var devDependencies = {
133
133
  "@slopus/happy-wire": "workspace:*",
@@ -30,7 +30,7 @@ function _interopNamespaceDefault(e) {
30
30
  var z__namespace = /*#__PURE__*/_interopNamespaceDefault(z);
31
31
 
32
32
  var name = "very-happy-cli";
33
- var version = "0.2.130";
33
+ var version = "0.2.132";
34
34
  var description = "Remote multi-agent workspace CLI with deep Claude integration, native terminal streaming, and self-hosting.";
35
35
  var author = "Kirill Dubovitskiy";
36
36
  var contributors = [
@@ -143,12 +143,12 @@ var dependencies = {
143
143
  zod: "^4.0.0"
144
144
  };
145
145
  var optionalDependencies = {
146
- "very-happy-tools-arm64-darwin": "0.2.130",
147
- "very-happy-tools-x64-darwin": "0.2.130",
148
- "very-happy-tools-arm64-linux": "0.2.130",
149
- "very-happy-tools-x64-linux": "0.2.130",
150
- "very-happy-tools-arm64-win32": "0.2.130",
151
- "very-happy-tools-x64-win32": "0.2.130"
146
+ "very-happy-tools-arm64-darwin": "0.2.132",
147
+ "very-happy-tools-x64-darwin": "0.2.132",
148
+ "very-happy-tools-arm64-linux": "0.2.132",
149
+ "very-happy-tools-x64-linux": "0.2.132",
150
+ "very-happy-tools-arm64-win32": "0.2.132",
151
+ "very-happy-tools-x64-win32": "0.2.132"
152
152
  };
153
153
  var devDependencies = {
154
154
  "@slopus/happy-wire": "workspace:*",
@@ -1,11 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var agentGuidance = require('./agentGuidance-TjPzDO7d.cjs');
3
+ var agentGuidance = require('./agentGuidance-R9MH5Cd5.cjs');
4
4
  var mcp_js = require('@modelcontextprotocol/sdk/server/mcp.js');
5
5
  var stdio_js = require('@modelcontextprotocol/sdk/server/stdio.js');
6
6
  var z = require('zod');
7
- var index = require('./index-C7TA3haC.cjs');
8
- var persistence = require('./limits-BhK6ovLz.cjs');
7
+ var index = require('./index-Dn7s2iaT.cjs');
8
+ var persistence = require('./limits-DLlsV71c.cjs');
9
9
  require('node:fs/promises');
10
10
  require('node:os');
11
11
  require('node:crypto');
@@ -13,7 +13,7 @@ require('axios');
13
13
  require('tweetnacl');
14
14
  require('socket.io-client');
15
15
  require('node:child_process');
16
- require('./types-QB33ckXt.cjs');
16
+ require('./types-B15E2OVy.cjs');
17
17
  require('node:fs');
18
18
  require('node:path');
19
19
  require('chalk');
@@ -1,9 +1,9 @@
1
- import { r as registerTeamsTools } from './agentGuidance-7pJxf_3b.mjs';
1
+ import { r as registerTeamsTools } from './agentGuidance-DeOIgOhh.mjs';
2
2
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { z } from 'zod';
5
- import { p as pushClipboardViaDaemon, k as setTerminalTitleViaDaemon, m as registerAssistantSessionTools } from './index-BUhcXX8R.mjs';
6
- import { l as logger, C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION, e as CLIPBOARD_MAX_BYTES } from './limits-CIcZA0Bn.mjs';
5
+ import { p as pushClipboardViaDaemon, k as setTerminalTitleViaDaemon, m as registerAssistantSessionTools } from './index-D1gHXtkw.mjs';
6
+ import { l as logger, C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION, e as CLIPBOARD_MAX_BYTES } from './limits-C9aXkP7U.mjs';
7
7
  import 'node:fs/promises';
8
8
  import 'node:os';
9
9
  import 'node:crypto';
@@ -11,7 +11,7 @@ import 'axios';
11
11
  import 'tweetnacl';
12
12
  import 'socket.io-client';
13
13
  import 'node:child_process';
14
- import './types-B-ySoSY9.mjs';
14
+ import './types-CA-c2NH7.mjs';
15
15
  import 'node:fs';
16
16
  import 'node:path';
17
17
  import 'chalk';