very-happy-cli 0.2.136 → 0.2.138

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 (43) hide show
  1. package/dist/{AcpBackend-CRzu0_1Z.cjs → AcpBackend-BUoDXZnv.cjs} +2 -2
  2. package/dist/{AcpBackend-C142vP3p.mjs → AcpBackend-bqVGMkPh.mjs} +2 -2
  3. package/dist/{AcpSessionManager-CosTbAlR.mjs → AcpSessionManager-BBAQ8EQf.mjs} +1 -1
  4. package/dist/{AcpSessionManager-Ba6WMLXc.cjs → AcpSessionManager-DmmA52Ep.cjs} +1 -1
  5. package/dist/{agentGuidance-6yh_wPwD.cjs → agentGuidance-4HV-BOge.cjs} +1 -1
  6. package/dist/{agentGuidance-ASxKHxBP.mjs → agentGuidance-WHZsBKpm.mjs} +1 -1
  7. package/dist/codex/happyMcpStdioBridge.cjs +2 -2
  8. package/dist/codex/happyMcpStdioBridge.mjs +2 -2
  9. package/dist/{config-VqHQ67d8.mjs → config-BRXqgJJj.mjs} +4 -4
  10. package/dist/{config--cxxmkOd.cjs → config-DpuZN2Rs.cjs} +4 -4
  11. package/dist/{index-BPVQFcKW.cjs → index-3N-qu-RG.cjs} +6 -6
  12. package/dist/{index-BqbtKX0T.cjs → index-CHP265gs.cjs} +4 -4
  13. package/dist/{index-8bwU9d-4.cjs → index-CRRK5P1r.cjs} +115 -23
  14. package/dist/{index-vN4Xf0zB.mjs → index-D8Q3OhdR.mjs} +4 -4
  15. package/dist/{index-D3vlFjXy.mjs → index-DQe7ljLR.mjs} +7 -7
  16. package/dist/{index-CHI7iTa0.mjs → index-Dbl5U_N0.mjs} +111 -19
  17. package/dist/index.cjs +4 -4
  18. package/dist/index.mjs +4 -4
  19. package/dist/{installTerminalHooks-2POBqVlu.cjs → installTerminalHooks-CWGkoWDD.cjs} +4 -4
  20. package/dist/{installTerminalHooks-D0YRu_p-.mjs → installTerminalHooks-DfUGgeyb.mjs} +4 -4
  21. package/dist/lib.cjs +2 -2
  22. package/dist/lib.mjs +2 -2
  23. package/dist/{limits-DRrdJ7gr.cjs → limits-CfzVummd.cjs} +7 -7
  24. package/dist/{limits-kjHZUlSp.mjs → limits-DEsg_gHi.mjs} +7 -7
  25. package/dist/{mcp-C1JQsM1s.cjs → mcp-CN2UVfut.cjs} +4 -4
  26. package/dist/{mcp-CgjEHlky.mjs → mcp-UnjB3I8_.mjs} +4 -4
  27. package/dist/{runGemini-B9Rc-H0G.cjs → runGemini-BUVjTJKn.cjs} +6 -6
  28. package/dist/{runGemini-DufGnnl2.mjs → runGemini-BZ0xXRj-.mjs} +6 -6
  29. package/dist/{runOpenClaw-DAl2nnjB.mjs → runOpenClaw-BcUmnBpW.mjs} +5 -5
  30. package/dist/{runOpenClaw-BsRRKDvF.cjs → runOpenClaw-Bj2EgRHB.cjs} +5 -5
  31. package/dist/{send-DP6n2J9x.cjs → send-BkypdBpK.cjs} +4 -4
  32. package/dist/{send-BHquPaeG.mjs → send-snK_NGAA.mjs} +4 -4
  33. package/dist/{sessions-Q4BR02dG.cjs → sessions-9A-uoJL_.cjs} +4 -4
  34. package/dist/{sessions-BtrLzv5U.mjs → sessions-DxlC4C4g.mjs} +4 -4
  35. package/dist/{spawn-CMjhlwlD.cjs → spawn-BORLpj60.cjs} +4 -4
  36. package/dist/{spawn-DuQXydqI.mjs → spawn-DFfHCafP.mjs} +4 -4
  37. package/dist/{teams-CkdUH10-.cjs → teams-9x2FO9RW.cjs} +4 -4
  38. package/dist/{teams-D5HxnyaW.mjs → teams-Cfr-2Yd-.mjs} +4 -4
  39. package/dist/{todo-BiLIZH4t.mjs → todo-CU5cjQZU.mjs} +3 -3
  40. package/dist/{todo-CaYedmtq.cjs → todo-DydKcknX.cjs} +3 -3
  41. package/dist/{types-DbBPNIwf.cjs → types-CRxf_3n8.cjs} +78 -6
  42. package/dist/{types-BKrZubg8.mjs → types-D5EsIAOe.mjs} +77 -5
  43. package/package.json +7 -7
@@ -3,8 +3,8 @@
3
3
  var node_child_process = require('node:child_process');
4
4
  var sdk = require('@agentclientprotocol/sdk');
5
5
  var node_crypto = require('node:crypto');
6
- var persistence = require('./limits-DRrdJ7gr.cjs');
7
- var api = require('./types-DbBPNIwf.cjs');
6
+ var persistence = require('./limits-CfzVummd.cjs');
7
+ var api = require('./types-CRxf_3n8.cjs');
8
8
 
9
9
  function acpImageBlocks(attachments, supportsImages) {
10
10
  return attachments.filter((file) => ["image/jpeg", "image/png", "image/gif", "image/webp"].includes(file.mimeType)).map((file) => {
@@ -1,8 +1,8 @@
1
1
  import { spawn } from 'node:child_process';
2
2
  import { ndJsonStream, ClientSideConnection } from '@agentclientprotocol/sdk';
3
3
  import { randomUUID } from 'node:crypto';
4
- import { l as logger, p as packageJson } from './limits-kjHZUlSp.mjs';
5
- import { d as contentLogMetadata, e as errorLogMetadata, h as delay } from './types-BKrZubg8.mjs';
4
+ import { l as logger, p as packageJson } from './limits-DEsg_gHi.mjs';
5
+ import { d as contentLogMetadata, e as errorLogMetadata, h as delay } from './types-D5EsIAOe.mjs';
6
6
 
7
7
  function acpImageBlocks(attachments, supportsImages) {
8
8
  return attachments.filter((file) => ["image/jpeg", "image/png", "image/gif", "image/webp"].includes(file.mimeType)).map((file) => {
@@ -1,5 +1,5 @@
1
1
  import { createId } from '@paralleldrive/cuid2';
2
- import { s as streamKeyOf, c as createEnvelope } from './types-BKrZubg8.mjs';
2
+ import { s as streamKeyOf, c as createEnvelope } from './types-D5EsIAOe.mjs';
3
3
 
4
4
  function turnOptions(turnId, time) {
5
5
  return turnId ? { turn: turnId, time } : { time };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var cuid2 = require('@paralleldrive/cuid2');
4
- var api = require('./types-DbBPNIwf.cjs');
4
+ var api = require('./types-CRxf_3n8.cjs');
5
5
 
6
6
  function turnOptions(turnId, time) {
7
7
  return turnId ? { turn: turnId, time } : { time };
@@ -2,7 +2,7 @@
2
2
 
3
3
  var z = require('zod');
4
4
  var node_crypto = require('node:crypto');
5
- var persistence = require('./limits-DRrdJ7gr.cjs');
5
+ var persistence = require('./limits-CfzVummd.cjs');
6
6
  var promises = require('node:fs/promises');
7
7
  var node_fs = require('node:fs');
8
8
  var path = require('node:path');
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  import { randomUUID } from 'node:crypto';
3
- import { n as normalizeHttpEndpoint, c as configuration, g as readSettings, r as readPersistedSessions, d as readCredentialsForConfiguredRelay } from './limits-kjHZUlSp.mjs';
3
+ import { n as normalizeHttpEndpoint, c as configuration, g as readSettings, r as readPersistedSessions, d as readCredentialsForConfiguredRelay } from './limits-DEsg_gHi.mjs';
4
4
  import { open, mkdir, rename, unlink } from 'node:fs/promises';
5
5
  import { constants } from 'node:fs';
6
6
  import { isAbsolute, join, dirname } from 'node:path';
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
- var agentGuidance = require('../agentGuidance-6yh_wPwD.cjs');
3
+ var agentGuidance = require('../agentGuidance-4HV-BOge.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 index_js = require('@modelcontextprotocol/sdk/client/index.js');
7
7
  var streamableHttp_js = require('@modelcontextprotocol/sdk/client/streamableHttp.js');
8
8
  var z = require('zod');
9
- var persistence = require('../limits-DRrdJ7gr.cjs');
9
+ var persistence = require('../limits-CfzVummd.cjs');
10
10
  require('node:crypto');
11
11
  require('node:fs/promises');
12
12
  require('node:fs');
@@ -1,10 +1,10 @@
1
- import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, r as registerTeamsTools } from '../agentGuidance-ASxKHxBP.mjs';
1
+ import { P as PREVIEW_TOOL_NAME, a as PREVIEW_TOOL_TITLE, b as PREVIEW_TOOL_DESCRIPTION, r as registerTeamsTools } from '../agentGuidance-WHZsBKpm.mjs';
2
2
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
3
3
  import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
4
4
  import { Client } from '@modelcontextprotocol/sdk/client/index.js';
5
5
  import { StreamableHTTPClientTransport } from '@modelcontextprotocol/sdk/client/streamableHttp.js';
6
6
  import { z } from 'zod';
7
- import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-kjHZUlSp.mjs';
7
+ import { C as CLIPBOARD_TOOL_NAME, a as CLIPBOARD_TOOL_TITLE, b as CLIPBOARD_TOOL_DESCRIPTION } from '../limits-DEsg_gHi.mjs';
8
8
  import 'node:crypto';
9
9
  import 'node:fs/promises';
10
10
  import 'node:fs';
@@ -2,8 +2,8 @@ import { existsSync, readFileSync, mkdirSync, writeFileSync } from 'fs';
2
2
  import { join } from 'path';
3
3
  import { homedir } from 'os';
4
4
  import { execSync } from 'child_process';
5
- import { l as logger } from './limits-kjHZUlSp.mjs';
6
- import { j as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-CHI7iTa0.mjs';
5
+ import { l as logger } from './limits-DEsg_gHi.mjs';
6
+ import { j as DEFAULT_GEMINI_MODEL, G as GEMINI_MODEL_ENV } from './index-Dbl5U_N0.mjs';
7
7
  import 'node:fs/promises';
8
8
  import 'node:fs';
9
9
  import 'node:os';
@@ -13,7 +13,7 @@ import 'node:crypto';
13
13
  import 'tweetnacl';
14
14
  import 'chalk';
15
15
  import 'node:util';
16
- import './types-BKrZubg8.mjs';
16
+ import './types-D5EsIAOe.mjs';
17
17
  import 'axios';
18
18
  import 'node:events';
19
19
  import 'socket.io-client';
@@ -28,7 +28,7 @@ import 'node-pty';
28
28
  import 'node:readline';
29
29
  import '@anthropic-ai/sandbox-runtime';
30
30
  import 'expo-server-sdk';
31
- import './agentGuidance-ASxKHxBP.mjs';
31
+ import './agentGuidance-WHZsBKpm.mjs';
32
32
  import 'ink';
33
33
  import 'react';
34
34
  import '@anthropic-ai/claude-agent-sdk';
@@ -4,8 +4,8 @@ var fs = require('fs');
4
4
  var path = require('path');
5
5
  var os = require('os');
6
6
  var child_process = require('child_process');
7
- var persistence = require('./limits-DRrdJ7gr.cjs');
8
- var index = require('./index-8bwU9d-4.cjs');
7
+ var persistence = require('./limits-CfzVummd.cjs');
8
+ var index = require('./index-CRRK5P1r.cjs');
9
9
  require('node:fs/promises');
10
10
  require('node:fs');
11
11
  require('node:os');
@@ -15,7 +15,7 @@ require('node:crypto');
15
15
  require('tweetnacl');
16
16
  require('chalk');
17
17
  require('node:util');
18
- require('./types-DbBPNIwf.cjs');
18
+ require('./types-CRxf_3n8.cjs');
19
19
  require('axios');
20
20
  require('node:events');
21
21
  require('socket.io-client');
@@ -30,7 +30,7 @@ require('node-pty');
30
30
  require('node:readline');
31
31
  require('@anthropic-ai/sandbox-runtime');
32
32
  require('expo-server-sdk');
33
- require('./agentGuidance-6yh_wPwD.cjs');
33
+ require('./agentGuidance-4HV-BOge.cjs');
34
34
  require('ink');
35
35
  require('react');
36
36
  require('@anthropic-ai/claude-agent-sdk');
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var AcpBackend = require('./AcpBackend-CRzu0_1Z.cjs');
4
- var persistence = require('./limits-DRrdJ7gr.cjs');
5
- var AcpSessionManager = require('./AcpSessionManager-Ba6WMLXc.cjs');
6
- var api = require('./types-DbBPNIwf.cjs');
7
- var index = require('./index-8bwU9d-4.cjs');
3
+ var AcpBackend = require('./AcpBackend-BUoDXZnv.cjs');
4
+ var persistence = require('./limits-CfzVummd.cjs');
5
+ var AcpSessionManager = require('./AcpSessionManager-DmmA52Ep.cjs');
6
+ var api = require('./types-CRxf_3n8.cjs');
7
+ var index = require('./index-CRRK5P1r.cjs');
8
8
  var promises = require('node:fs/promises');
9
9
  var node_crypto = require('node:crypto');
10
10
  var path = require('node:path');
@@ -33,7 +33,7 @@ require('fs');
33
33
  require('node:readline');
34
34
  require('@anthropic-ai/sandbox-runtime');
35
35
  require('expo-server-sdk');
36
- require('./agentGuidance-6yh_wPwD.cjs');
36
+ require('./agentGuidance-4HV-BOge.cjs');
37
37
  require('ink');
38
38
  require('react');
39
39
  require('@anthropic-ai/claude-agent-sdk');
@@ -1,13 +1,13 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-8bwU9d-4.cjs');
3
+ var index = require('./index-CRRK5P1r.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-DbBPNIwf.cjs');
8
+ require('./types-CRxf_3n8.cjs');
9
9
  require('axios');
10
- require('./limits-DRrdJ7gr.cjs');
10
+ require('./limits-CfzVummd.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-6yh_wPwD.cjs');
34
+ require('./agentGuidance-4HV-BOge.cjs');
35
35
  require('ink');
36
36
  require('react');
37
37
  require('ps-list');
@@ -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-DbBPNIwf.cjs');
7
- var persistence = require('./limits-DRrdJ7gr.cjs');
6
+ var api = require('./types-CRxf_3n8.cjs');
7
+ var persistence = require('./limits-CfzVummd.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-6yh_wPwD.cjs');
12
+ var agentGuidance = require('./agentGuidance-4HV-BOge.cjs');
13
13
  var promises = require('node:fs/promises');
14
14
  var fs = require('fs/promises');
15
15
  var ink = require('ink');
@@ -8055,7 +8055,7 @@ function parseJsonObject(text) {
8055
8055
  return null;
8056
8056
  }
8057
8057
  }
8058
- 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-8bwU9d-4.cjs', document.baseURI).href))).resolve(s)) {
8058
+ 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-CRRK5P1r.cjs', document.baseURI).href))).resolve(s)) {
8059
8059
  const platformArch = `${platform}-${arch}`;
8060
8060
  const candidates = [
8061
8061
  `@anthropic-ai/claude-agent-sdk-${platformArch}/claude`,
@@ -12498,7 +12498,7 @@ function registerSideQuestionHandler(rpc, deps) {
12498
12498
  const retainMs = deps.retainMs ?? SIDE_QUESTION_RETAIN_MS;
12499
12499
  const maxRunMs = deps.maxRunMs ?? SIDE_QUESTION_MAX_RUN_MS;
12500
12500
  const run = deps.run ?? (async (input) => {
12501
- const { query } = await Promise.resolve().then(function () { return require('./index-BqbtKX0T.cjs'); });
12501
+ const { query } = await Promise.resolve().then(function () { return require('./index-CHP265gs.cjs'); });
12502
12502
  return runSideQuestion(query, input);
12503
12503
  });
12504
12504
  const slots = /* @__PURE__ */ new Map();
@@ -12600,7 +12600,7 @@ const MAX_TITLE_CHARS = 60;
12600
12600
  const GENERATION_TIMEOUT_MS = 3e4;
12601
12601
  function resolveClaudeBinary() {
12602
12602
  try {
12603
- 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-8bwU9d-4.cjs', document.baseURI).href)));
12603
+ 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-CRRK5P1r.cjs', document.baseURI).href)));
12604
12604
  const utilsPath = path.resolve(path.join(api.projectPath(), "scripts", "claude_version_utils.cjs"));
12605
12605
  const { getClaudeCliPath } = require$1(utilsPath);
12606
12606
  const path$1 = getClaudeCliPath();
@@ -14826,9 +14826,9 @@ function resolveLocalSignupBootstrap(configuredMode, configuredInviteCodes, gene
14826
14826
  };
14827
14827
  }
14828
14828
 
14829
- 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-8bwU9d-4.cjs', document.baseURI).href)));
14829
+ 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-CRRK5P1r.cjs', document.baseURI).href)));
14830
14830
  const __dirname$1 = path.dirname(__filename$1);
14831
- const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-8bwU9d-4.cjs', document.baseURI).href)));
14831
+ const require_ = node_module.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-CRRK5P1r.cjs', document.baseURI).href)));
14832
14832
  const PRISMA_QUERY_ENGINE_FILES = {
14833
14833
  "arm64-darwin": "libquery_engine-darwin-arm64.dylib.node",
14834
14834
  "x64-darwin": "libquery_engine-darwin.dylib.node",
@@ -16609,6 +16609,72 @@ function emitReadyIfIdle({ pending, queueSize, shouldExit, sendReady, notify })
16609
16609
  return true;
16610
16610
  }
16611
16611
 
16612
+ const DEFAULT_CODEX_IDLE_RELEASE_MS = 5 * 60 * 1e3;
16613
+ const CODEX_IDLE_RELEASE_ENV = "HAPPY_CODEX_IDLE_RELEASE_MS";
16614
+ function resolveCodexIdleReleaseMs(raw) {
16615
+ if (raw === void 0 || raw.trim() === "") return DEFAULT_CODEX_IDLE_RELEASE_MS;
16616
+ const parsed = Number(raw);
16617
+ if (!Number.isFinite(parsed) || parsed < 0) return DEFAULT_CODEX_IDLE_RELEASE_MS;
16618
+ return Math.floor(parsed);
16619
+ }
16620
+ function shouldReleaseIdleCodex(state) {
16621
+ if (state.shouldExit) return false;
16622
+ if (state.turnActive) return false;
16623
+ if (state.abortInProgress) return false;
16624
+ if (state.queueSize > 0) return false;
16625
+ return true;
16626
+ }
16627
+ class CodexIdleReleaseTimer {
16628
+ constructor(opts) {
16629
+ this.opts = opts;
16630
+ }
16631
+ timer = null;
16632
+ releasing = null;
16633
+ get enabled() {
16634
+ return this.opts.delayMs > 0;
16635
+ }
16636
+ get armed() {
16637
+ return this.timer !== null;
16638
+ }
16639
+ arm() {
16640
+ this.cancel();
16641
+ if (!this.enabled) return;
16642
+ const timer = setTimeout(() => {
16643
+ if (this.timer !== timer) return;
16644
+ this.timer = null;
16645
+ void this.fire();
16646
+ }, this.opts.delayMs);
16647
+ timer.unref?.();
16648
+ this.timer = timer;
16649
+ }
16650
+ cancel() {
16651
+ if (this.timer) {
16652
+ clearTimeout(this.timer);
16653
+ this.timer = null;
16654
+ }
16655
+ }
16656
+ /** Resolves once an in-flight release (if any) has finished. Test hook. */
16657
+ async settle() {
16658
+ await this.releasing;
16659
+ }
16660
+ async fire() {
16661
+ if (!this.opts.isIdle()) return;
16662
+ const run = (async () => {
16663
+ try {
16664
+ await this.opts.release();
16665
+ } catch (error) {
16666
+ this.opts.onError?.(error);
16667
+ }
16668
+ })();
16669
+ this.releasing = run;
16670
+ try {
16671
+ await run;
16672
+ } finally {
16673
+ if (this.releasing === run) this.releasing = null;
16674
+ }
16675
+ }
16676
+ }
16677
+
16612
16678
  function isCodexClearText(text) {
16613
16679
  return parseSpecialCommand(text).type === "clear";
16614
16680
  }
@@ -16787,6 +16853,7 @@ async function runCodex(opts) {
16787
16853
  let client;
16788
16854
  let reasoningProcessor;
16789
16855
  let abortInProgress = null;
16856
+ let turnActive = false;
16790
16857
  const { session: initialSession, reconnectionHandle } = setupOfflineReconnection({
16791
16858
  api: api$1,
16792
16859
  sessionTag,
@@ -17075,6 +17142,22 @@ async function runCodex(opts) {
17075
17142
  process.stdin.setEncoding("utf8");
17076
17143
  }
17077
17144
  client = new api.CodexAppServerClient(sandboxConfig);
17145
+ const idleRelease = new CodexIdleReleaseTimer({
17146
+ delayMs: resolveCodexIdleReleaseMs(process.env[CODEX_IDLE_RELEASE_ENV]),
17147
+ isIdle: () => shouldReleaseIdleCodex({
17148
+ turnActive,
17149
+ queueSize: messageQueue.size(),
17150
+ shouldExit,
17151
+ abortInProgress: abortInProgress !== null
17152
+ }),
17153
+ release: async () => {
17154
+ const released = await client.releaseIdleProcess();
17155
+ if (released) {
17156
+ persistence.logger.debug("[Codex] Released idle app-server; thread kept for resume on next message");
17157
+ }
17158
+ },
17159
+ onError: (error) => persistence.logger.debug("[Codex] Idle app-server release failed", safeCodexErrorMetadata(error))
17160
+ });
17078
17161
  permissionHandler = new CodexPermissionHandler(session);
17079
17162
  permissionHandler.reset("Previous CLI process exited before responding");
17080
17163
  reasoningProcessor = new ReasoningProcessor((message) => {
@@ -17264,6 +17347,7 @@ async function runCodex(opts) {
17264
17347
  }
17265
17348
  }
17266
17349
  let pending = null;
17350
+ idleRelease.arm();
17267
17351
  while (!shouldExit) {
17268
17352
  logActiveHandles("loop-top");
17269
17353
  let message = pending;
@@ -17284,6 +17368,8 @@ async function runCodex(opts) {
17284
17368
  if (!message) {
17285
17369
  break;
17286
17370
  }
17371
+ idleRelease.cancel();
17372
+ turnActive = true;
17287
17373
  if (isCodexClearText(message.message)) {
17288
17374
  persistence.logger.debug("[Codex] Handling /clear command - resetting Codex thread state");
17289
17375
  client.clearThreadState();
@@ -17310,10 +17396,13 @@ async function runCodex(opts) {
17310
17396
  shouldExit,
17311
17397
  sendReady
17312
17398
  });
17399
+ turnActive = false;
17400
+ idleRelease.arm();
17313
17401
  continue;
17314
17402
  }
17315
17403
  messageBuffer.addMessage(message.message, "user");
17316
17404
  try {
17405
+ await client.ensureConnected();
17317
17406
  const sandboxManagedByHappy = client.sandboxEnabled;
17318
17407
  const executionPolicy = resolveCodexExecutionPolicy(
17319
17408
  message.mode.permissionMode,
@@ -17380,6 +17469,8 @@ async function runCodex(opts) {
17380
17469
  shouldExit,
17381
17470
  sendReady
17382
17471
  });
17472
+ turnActive = false;
17473
+ idleRelease.arm();
17383
17474
  logActiveHandles("after-turn");
17384
17475
  }
17385
17476
  }
@@ -17403,6 +17494,7 @@ async function runCodex(opts) {
17403
17494
  } catch (e) {
17404
17495
  persistence.logger.debug("[codex]: Error while closing session", safeCodexErrorMetadata(e));
17405
17496
  }
17497
+ idleRelease.cancel();
17406
17498
  persistence.logger.debug("[codex]: client.disconnect begin");
17407
17499
  await client.disconnect();
17408
17500
  persistence.logger.debug("[codex]: client.disconnect done");
@@ -17587,7 +17679,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17587
17679
  process.exit(0);
17588
17680
  } else if (subcommand === "install-terminal-hooks") {
17589
17681
  try {
17590
- const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-2POBqVlu.cjs'); });
17682
+ const { installTerminalHooks, parseTerminalHooksArgs, TERMINAL_HOOKS_HELP } = await Promise.resolve().then(function () { return require('./installTerminalHooks-CWGkoWDD.cjs'); });
17591
17683
  const command = parseTerminalHooksArgs(args.slice(1));
17592
17684
  if (command.action === "help") {
17593
17685
  console.log(TERMINAL_HOOKS_HELP);
@@ -17604,7 +17696,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17604
17696
  }
17605
17697
  } else if (subcommand === "spawn") {
17606
17698
  try {
17607
- const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-CMjhlwlD.cjs'); });
17699
+ const { handleSpawnCommand } = await Promise.resolve().then(function () { return require('./spawn-BORLpj60.cjs'); });
17608
17700
  await handleSpawnCommand(args.slice(1));
17609
17701
  } catch (error) {
17610
17702
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17616,7 +17708,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17616
17708
  return;
17617
17709
  } else if (subcommand === "sessions") {
17618
17710
  try {
17619
- const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-Q4BR02dG.cjs'); });
17711
+ const { handleSessionsCommand } = await Promise.resolve().then(function () { return require('./sessions-9A-uoJL_.cjs'); });
17620
17712
  await handleSessionsCommand(args.slice(1));
17621
17713
  } catch (error) {
17622
17714
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17628,7 +17720,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17628
17720
  return;
17629
17721
  } else if (subcommand === "send") {
17630
17722
  try {
17631
- const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-DP6n2J9x.cjs'); });
17723
+ const { handleSendCommand } = await Promise.resolve().then(function () { return require('./send-BkypdBpK.cjs'); });
17632
17724
  await handleSendCommand(args.slice(1));
17633
17725
  } catch (error) {
17634
17726
  console.error(chalk.red("Error:"), error instanceof Error ? error.message : "Unknown error");
@@ -17734,9 +17826,9 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17734
17826
  if (geminiSubcommand === "project" && args[2] === "set" && args[3]) {
17735
17827
  const projectId = args[3];
17736
17828
  try {
17737
- const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config--cxxmkOd.cjs'); });
17738
- const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-DRrdJ7gr.cjs'); }).then(function (n) { return n.persistence; });
17739
- const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-DbBPNIwf.cjs'); }).then(function (n) { return n.api; });
17829
+ const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return require('./config-DpuZN2Rs.cjs'); });
17830
+ const { readCredentialsForConfiguredRelay: readCredentialsForConfiguredRelay2 } = await Promise.resolve().then(function () { return require('./limits-CfzVummd.cjs'); }).then(function (n) { return n.persistence; });
17831
+ const { ApiClient: ApiClient2 } = await Promise.resolve().then(function () { return require('./types-CRxf_3n8.cjs'); }).then(function (n) { return n.api; });
17740
17832
  let userEmail = void 0;
17741
17833
  try {
17742
17834
  const credentials = await readCredentialsForConfiguredRelay2();
@@ -17767,7 +17859,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17767
17859
  }
17768
17860
  if (geminiSubcommand === "project" && args[2] === "get") {
17769
17861
  try {
17770
- const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config--cxxmkOd.cjs'); });
17862
+ const { readGeminiLocalConfig } = await Promise.resolve().then(function () { return require('./config-DpuZN2Rs.cjs'); });
17771
17863
  const config = readGeminiLocalConfig();
17772
17864
  if (config.googleCloudProject) {
17773
17865
  console.log(`Current Google Cloud Project: ${config.googleCloudProject}`);
@@ -17807,7 +17899,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17807
17899
  process.exit(0);
17808
17900
  }
17809
17901
  try {
17810
- const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-B9Rc-H0G.cjs'); });
17902
+ const { runGemini } = await Promise.resolve().then(function () { return require('./runGemini-BUVjTJKn.cjs'); });
17811
17903
  let startedBy = void 0;
17812
17904
  for (let i = 1; i < args.length; i++) {
17813
17905
  if (args[i] === "--started-by") {
@@ -17837,7 +17929,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17837
17929
  }
17838
17930
  };
17839
17931
  try {
17840
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BPVQFcKW.cjs'); });
17932
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-3N-qu-RG.cjs'); });
17841
17933
  const parsed = parsePiRunnerArgs(args.slice(1));
17842
17934
  const resolved = resolveAcpAgentConfig(["pi", ...parsed.passthrough]);
17843
17935
  const { credentials } = await authAndSetupMachineIfNeeded();
@@ -17865,7 +17957,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17865
17957
  return;
17866
17958
  } else if (subcommand === "acp") {
17867
17959
  try {
17868
- const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-BPVQFcKW.cjs'); });
17960
+ const { runAcp, resolveAcpAgentConfig } = await Promise.resolve().then(function () { return require('./index-3N-qu-RG.cjs'); });
17869
17961
  let startedBy = void 0;
17870
17962
  let verbose = false;
17871
17963
  const acpArgs = [];
@@ -17905,7 +17997,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17905
17997
  return;
17906
17998
  } else if (subcommand === "openclaw") {
17907
17999
  try {
17908
- const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-BsRRKDvF.cjs'); });
18000
+ const { runOpenClaw } = await Promise.resolve().then(function () { return require('./runOpenClaw-Bj2EgRHB.cjs'); });
17909
18001
  let startedBy = void 0;
17910
18002
  let verbose = false;
17911
18003
  let gatewayUrl;
@@ -17956,7 +18048,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17956
18048
  return;
17957
18049
  } else if (subcommand === "todo") {
17958
18050
  try {
17959
- const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-CaYedmtq.cjs'); });
18051
+ const { handleTodoCommand } = await Promise.resolve().then(function () { return require('./todo-DydKcknX.cjs'); });
17960
18052
  await handleTodoCommand(args.slice(1));
17961
18053
  } catch (error) {
17962
18054
  console.error(JSON.stringify({ error: error instanceof Error ? error.message : "Todo command failed" }));
@@ -17965,7 +18057,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17965
18057
  return;
17966
18058
  } else if (subcommand === "teams") {
17967
18059
  try {
17968
- const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-CkdUH10-.cjs'); });
18060
+ const { handleTeamsCommand } = await Promise.resolve().then(function () { return require('./teams-9x2FO9RW.cjs'); });
17969
18061
  await handleTeamsCommand(args.slice(1));
17970
18062
  } catch (error) {
17971
18063
  console.error(error instanceof Error ? error.message : "Teams command failed");
@@ -17974,7 +18066,7 @@ Conversation history is preserved on the server, but in-flight tool calls are in
17974
18066
  return;
17975
18067
  } else if (subcommand === "mcp" && args.length === 1) {
17976
18068
  try {
17977
- const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-C1JQsM1s.cjs'); });
18069
+ const { handleMcpCommand } = await Promise.resolve().then(function () { return require('./mcp-CN2UVfut.cjs'); });
17978
18070
  await handleMcpCommand();
17979
18071
  } catch (error) {
17980
18072
  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-CHI7iTa0.mjs';
1
+ import { q as query } from './index-Dbl5U_N0.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-BKrZubg8.mjs';
6
+ import './types-D5EsIAOe.mjs';
7
7
  import 'axios';
8
- import './limits-kjHZUlSp.mjs';
8
+ import './limits-DEsg_gHi.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-ASxKHxBP.mjs';
32
+ import './agentGuidance-WHZsBKpm.mjs';
33
33
  import 'ink';
34
34
  import 'react';
35
35
  import 'ps-list';
@@ -1,9 +1,9 @@
1
- import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-C142vP3p.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-C142vP3p.mjs';
3
- import { c as configuration, g as readSettings, i as encodeBase64, l as logger } from './limits-kjHZUlSp.mjs';
4
- import { A as AcpSessionManager } from './AcpSessionManager-CosTbAlR.mjs';
5
- import { f as connectionState, A as ApiClient, p as projectPath, g as BUILTIN_TODO_DISCOVERY } from './types-BKrZubg8.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-CHI7iTa0.mjs';
1
+ import { D as DefaultTransport, A as AcpBackend } from './AcpBackend-bqVGMkPh.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-bqVGMkPh.mjs';
3
+ import { c as configuration, g as readSettings, i as encodeBase64, l as logger } from './limits-DEsg_gHi.mjs';
4
+ import { A as AcpSessionManager } from './AcpSessionManager-BBAQ8EQf.mjs';
5
+ import { f as connectionState, A as ApiClient, p as projectPath, g as BUILTIN_TODO_DISCOVERY } from './types-D5EsIAOe.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-Dbl5U_N0.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-ASxKHxBP.mjs';
35
+ import './agentGuidance-WHZsBKpm.mjs';
36
36
  import 'ink';
37
37
  import 'react';
38
38
  import '@anthropic-ai/claude-agent-sdk';