very-happy-cli 0.2.75 → 0.2.77

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 (31) hide show
  1. package/dist/{AcpBackend-5CPQMP3H.mjs → AcpBackend-BFFC77vV.mjs} +5 -2
  2. package/dist/{AcpBackend-B0qCm-bY.cjs → AcpBackend-CsLnh1So.cjs} +5 -2
  3. package/dist/{AcpSessionManager-B4M0y5fI.cjs → AcpSessionManager--CixPN-p.cjs} +1 -1
  4. package/dist/{AcpSessionManager-BTmJyKDO.mjs → AcpSessionManager-CU5vsxgF.mjs} +1 -1
  5. package/dist/{config-DbY2R-H7.mjs → config-CRFTYuTN.mjs} +2 -2
  6. package/dist/{config-DBIfKaNJ.cjs → config-pv17N6Kg.cjs} +2 -2
  7. package/dist/{index-CJaqyq4z.mjs → index-BkvUwyIU.mjs} +8 -5
  8. package/dist/{index-CqxywXyf.cjs → index-C1OnwMx0.cjs} +7 -4
  9. package/dist/{index-Cq30c63l.mjs → index-DOb57EGb.mjs} +16 -12
  10. package/dist/{index-edEH95Mf.cjs → index-Dcv1RKe8.cjs} +19 -15
  11. package/dist/index.cjs +2 -2
  12. package/dist/index.mjs +2 -2
  13. package/dist/{installTerminalHooks-8TUdSFCY.mjs → installTerminalHooks-IXvZMGJq.mjs} +2 -2
  14. package/dist/{installTerminalHooks-BvQbDFcE.cjs → installTerminalHooks-YyT3fv6w.cjs} +2 -2
  15. package/dist/lib.cjs +1 -1
  16. package/dist/lib.d.cts +23 -1
  17. package/dist/lib.d.mts +23 -1
  18. package/dist/lib.mjs +1 -1
  19. package/dist/{mcp-B4UxtBKQ.mjs → mcp-B-GdhlKD.mjs} +2 -2
  20. package/dist/{mcp-D12X7XKG.cjs → mcp-CsKnmeE5.cjs} +2 -2
  21. package/dist/{runGemini-BD8OGMQr.mjs → runGemini-D0lddF43.mjs} +5 -4
  22. package/dist/{runGemini-LIck5ard.cjs → runGemini-DuUdmlVZ.cjs} +5 -4
  23. package/dist/{runOpenClaw-ENAgQy1E.mjs → runOpenClaw-BiwwYnYf.mjs} +15 -3
  24. package/dist/{runOpenClaw-B5XNV1zZ.cjs → runOpenClaw-DEMCYSoD.cjs} +15 -3
  25. package/dist/{send-BVbiwtrQ.mjs → send-DM8oqJFp.mjs} +2 -2
  26. package/dist/{send-o4xljyoV.cjs → send-DijSXAMp.cjs} +2 -2
  27. package/dist/{spawn-DTA6f9TE.cjs → spawn-De3b5Hsu.cjs} +2 -2
  28. package/dist/{spawn-BmqqHUYI.mjs → spawn-nISXbZD5.mjs} +2 -2
  29. package/dist/{types-Dj9JEGDh.mjs → types-D2qSKjsO.mjs} +400 -79
  30. package/dist/{types-DEre2zxO.cjs → types-NwtcBgfS.cjs} +401 -80
  31. package/package.json +7 -7
@@ -4,10 +4,10 @@ var ink = require('ink');
4
4
  var React = require('react');
5
5
  var node_crypto = require('node:crypto');
6
6
  var path = require('node:path');
7
- var persistence = require('./types-DEre2zxO.cjs');
8
- var index = require('./index-edEH95Mf.cjs');
9
- var AcpBackend = require('./AcpBackend-B0qCm-bY.cjs');
10
- var config = require('./config-DBIfKaNJ.cjs');
7
+ var persistence = require('./types-NwtcBgfS.cjs');
8
+ var index = require('./index-Dcv1RKe8.cjs');
9
+ var AcpBackend = require('./AcpBackend-CsLnh1So.cjs');
10
+ var config = require('./config-pv17N6Kg.cjs');
11
11
  require('axios');
12
12
  require('chalk');
13
13
  require('node:util');
@@ -1316,6 +1316,7 @@ Guide: https://goo.gle/gemini-cli-auth-docs#workspace-gca`;
1316
1316
  break;
1317
1317
  default:
1318
1318
  if (msg.type === "token-count") {
1319
+ session.sendAgentUsageSnapshot("gemini", msg);
1319
1320
  session.sendAgentMessage("gemini", {
1320
1321
  type: "token_count",
1321
1322
  ...msg,
@@ -3,9 +3,9 @@ import { execFileSync } from 'node:child_process';
3
3
  import os from 'node:os';
4
4
  import { existsSync, readFileSync } from 'node:fs';
5
5
  import { join } from 'node:path';
6
- import { k as ensurePrivateDirectorySync, m as hardenPrivateFileSync, w as writePrivateFileSync, e as errorLogMetadata, d as contentLogMetadata, h as connectionState, A as ApiClient, i as readSettings, j as encodeBase64, l as logger, c as configuration } from './types-Dj9JEGDh.mjs';
7
- import { A as AcpSessionManager } from './AcpSessionManager-BTmJyKDO.mjs';
8
- import { i as initialMachineMetadata, d as createSessionMetadata, e as setupOfflineReconnection, n as notifyDaemonSessionStarted, M as MessageQueue2, r as registerKillSessionHandler } from './index-Cq30c63l.mjs';
6
+ import { k as ensurePrivateDirectorySync, m as hardenPrivateFileSync, w as writePrivateFileSync, e as errorLogMetadata, d as contentLogMetadata, h as connectionState, A as ApiClient, i as readSettings, j as encodeBase64, l as logger, c as configuration } from './types-D2qSKjsO.mjs';
7
+ import { A as AcpSessionManager } from './AcpSessionManager-CU5vsxgF.mjs';
8
+ import { i as initialMachineMetadata, d as createSessionMetadata, e as setupOfflineReconnection, n as notifyDaemonSessionStarted, M as MessageQueue2, r as registerKillSessionHandler } from './index-DOb57EGb.mjs';
9
9
  import WebSocket from 'ws';
10
10
  import * as ed from '@noble/ed25519';
11
11
  import { sha512 } from '@noble/hashes/sha2.js';
@@ -651,6 +651,12 @@ class OpenClawBackend {
651
651
  retryConnect() {
652
652
  this.socket.retryConnect();
653
653
  }
654
+ /** Return the gateway's cumulative usage for this backend session. */
655
+ async getUsageSnapshot() {
656
+ if (!this.sessionKey || !this.socket.isConnected()) return null;
657
+ const sessions = await this.socket.listSessions(100);
658
+ return sessions.find((session) => session.key === this.sessionKey || session.sessionId === this.sessionKey) ?? null;
659
+ }
654
660
  emit(msg) {
655
661
  for (const handler of this.handlers) {
656
662
  handler(msg);
@@ -968,6 +974,12 @@ async function runOpenClaw(opts) {
968
974
  log(`Turn ended: ${JSON.stringify(errorLogMetadata(error))}`);
969
975
  sendEnvelopes(sessionManager.endTurn("failed"));
970
976
  }
977
+ try {
978
+ const usage = await backend.getUsageSnapshot();
979
+ if (usage) session.sendAgentUsageSnapshot("openclaw", usage);
980
+ } catch (error) {
981
+ logger.debug("[openclaw] Failed to report usage:", errorLogMetadata(error));
982
+ }
971
983
  inTurn = false;
972
984
  thinking = false;
973
985
  session.keepAlive(false, "remote");
@@ -5,9 +5,9 @@ var node_child_process = require('node:child_process');
5
5
  var os = require('node:os');
6
6
  var node_fs = require('node:fs');
7
7
  var path = require('node:path');
8
- var persistence = require('./types-DEre2zxO.cjs');
9
- var AcpSessionManager = require('./AcpSessionManager-B4M0y5fI.cjs');
10
- var index = require('./index-edEH95Mf.cjs');
8
+ var persistence = require('./types-NwtcBgfS.cjs');
9
+ var AcpSessionManager = require('./AcpSessionManager--CixPN-p.cjs');
10
+ var index = require('./index-Dcv1RKe8.cjs');
11
11
  var WebSocket = require('ws');
12
12
  var ed = require('@noble/ed25519');
13
13
  var sha2_js = require('@noble/hashes/sha2.js');
@@ -672,6 +672,12 @@ class OpenClawBackend {
672
672
  retryConnect() {
673
673
  this.socket.retryConnect();
674
674
  }
675
+ /** Return the gateway's cumulative usage for this backend session. */
676
+ async getUsageSnapshot() {
677
+ if (!this.sessionKey || !this.socket.isConnected()) return null;
678
+ const sessions = await this.socket.listSessions(100);
679
+ return sessions.find((session) => session.key === this.sessionKey || session.sessionId === this.sessionKey) ?? null;
680
+ }
675
681
  emit(msg) {
676
682
  for (const handler of this.handlers) {
677
683
  handler(msg);
@@ -989,6 +995,12 @@ async function runOpenClaw(opts) {
989
995
  log(`Turn ended: ${JSON.stringify(persistence.errorLogMetadata(error))}`);
990
996
  sendEnvelopes(sessionManager.endTurn("failed"));
991
997
  }
998
+ try {
999
+ const usage = await backend.getUsageSnapshot();
1000
+ if (usage) session.sendAgentUsageSnapshot("openclaw", usage);
1001
+ } catch (error) {
1002
+ persistence.logger.debug("[openclaw] Failed to report usage:", persistence.errorLogMetadata(error));
1003
+ }
992
1004
  inTurn = false;
993
1005
  thinking = false;
994
1006
  session.keepAlive(false, "remote");
@@ -1,8 +1,8 @@
1
1
  import chalk from 'chalk';
2
2
  import { readFileSync } from 'node:fs';
3
3
  import { resolve } from 'node:path';
4
- import { r as readPersistedSessions, c as configuration } from './types-Dj9JEGDh.mjs';
5
- import { b as sendUserMessage, a as sessionWebUrl } from './index-Cq30c63l.mjs';
4
+ import { r as readPersistedSessions, c as configuration } from './types-D2qSKjsO.mjs';
5
+ import { b as sendUserMessage, a as sessionWebUrl } from './index-DOb57EGb.mjs';
6
6
  import 'axios';
7
7
  import 'node:util';
8
8
  import 'node:os';
@@ -3,8 +3,8 @@
3
3
  var chalk = require('chalk');
4
4
  var node_fs = require('node:fs');
5
5
  var path = require('node:path');
6
- var persistence = require('./types-DEre2zxO.cjs');
7
- var index = require('./index-edEH95Mf.cjs');
6
+ var persistence = require('./types-NwtcBgfS.cjs');
7
+ var index = require('./index-Dcv1RKe8.cjs');
8
8
  require('axios');
9
9
  require('node:util');
10
10
  require('node:os');
@@ -3,8 +3,8 @@
3
3
  var chalk = require('chalk');
4
4
  var node_fs = require('node:fs');
5
5
  var path = require('node:path');
6
- var index = require('./index-edEH95Mf.cjs');
7
- var persistence = require('./types-DEre2zxO.cjs');
6
+ var index = require('./index-Dcv1RKe8.cjs');
7
+ var persistence = require('./types-NwtcBgfS.cjs');
8
8
  require('node:os');
9
9
  require('node:crypto');
10
10
  require('cross-spawn');
@@ -1,8 +1,8 @@
1
1
  import chalk from 'chalk';
2
2
  import { readFileSync, statSync } from 'node:fs';
3
3
  import { resolve } from 'node:path';
4
- import { c as checkIfDaemonRunningAndCleanupStaleState, s as spawnDaemonSession, a as sessionWebUrl, w as waitForSessionKey, b as sendUserMessage } from './index-Cq30c63l.mjs';
5
- import { l as logger } from './types-Dj9JEGDh.mjs';
4
+ import { c as checkIfDaemonRunningAndCleanupStaleState, s as spawnDaemonSession, a as sessionWebUrl, w as waitForSessionKey, b as sendUserMessage } from './index-DOb57EGb.mjs';
5
+ import { l as logger } from './types-D2qSKjsO.mjs';
6
6
  import 'node:os';
7
7
  import 'node:crypto';
8
8
  import 'cross-spawn';