happy-imou-cloud 2.0.5 → 2.0.7

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 (24) hide show
  1. package/dist/{BaseReasoningProcessor-bFVTvf3Q.mjs → BaseReasoningProcessor-ClrT-x-H.mjs} +2 -2
  2. package/dist/{BaseReasoningProcessor-DPVZIJ4n.cjs → BaseReasoningProcessor-DphULXS-.cjs} +2 -2
  3. package/dist/{api-DaqnNHfl.cjs → api-Dwkm7s_E.cjs} +3 -3
  4. package/dist/{api-DoHt-HyL.mjs → api-dwwHBzLc.mjs} +3 -3
  5. package/dist/{command-Dl9SrMnv.mjs → command-Cfq3Uc0S.mjs} +3 -3
  6. package/dist/{command-D9-hmqVq.cjs → command-DiAVIsxX.cjs} +3 -3
  7. package/dist/{index-Dc92gnxM.cjs → index-CfqxEoyl.cjs} +235 -93
  8. package/dist/{index-C5wR2qKT.mjs → index-HyqLXzw-.mjs} +233 -91
  9. package/dist/index.cjs +5 -5
  10. package/dist/index.mjs +5 -5
  11. package/dist/lib.cjs +1 -1
  12. package/dist/lib.mjs +1 -1
  13. package/dist/{persistence-QqeBvUxX.mjs → persistence-Dg-rxY2a.mjs} +1 -1
  14. package/dist/{persistence-D6Y0604_.cjs → persistence-hbhwAYIV.cjs} +1 -1
  15. package/dist/{registerKillSessionHandler-CC9zGBPE.mjs → registerKillSessionHandler-BAvk4GYO.mjs} +26 -2
  16. package/dist/{registerKillSessionHandler-C6yXr8ky.cjs → registerKillSessionHandler-D1ouN10n.cjs} +26 -2
  17. package/dist/{runClaude-gHKFB1UG.cjs → runClaude-CZmJ7qEP.cjs} +5 -5
  18. package/dist/{runClaude-CZ8gxaJL.mjs → runClaude-OxYbt3ZQ.mjs} +4 -4
  19. package/dist/{runCodex-DT7g4MPm.mjs → runCodex-ByVTEbSY.mjs} +35 -62
  20. package/dist/{runCodex-CdjzG1N7.cjs → runCodex-CtncAgso.cjs} +34 -62
  21. package/dist/{runGemini-CmY5386l.mjs → runGemini-BRO6A2jm.mjs} +5 -5
  22. package/dist/{runGemini-DxjvRmOc.cjs → runGemini-ChwjLmhI.cjs} +5 -5
  23. package/package.json +2 -2
  24. package/scripts/release-smoke.mjs +4 -0
@@ -1,6 +1,6 @@
1
1
  import{createRequire as _pkgrollCR}from"node:module";const require=_pkgrollCR(import.meta.url);import chalk from 'chalk';
2
- import { l as logger, e as encodeBase64, c as configuration, h as buildAuthenticatedHeaders, S as SigningBootstrapRequiredError, j as SIGNING_BOOTSTRAP_REQUIRED_MESSAGE, k as encodeBase64Url, f as delay, m as buildClientHeaders, n as decodeBase64, H as HAPPY_CLOUD_DAEMON_PORT, p as packageJson, A as ApiClient, o as getLatestDaemonLog } from './api-DoHt-HyL.mjs';
3
- import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-QqeBvUxX.mjs';
2
+ import { l as logger, e as encodeBase64, c as configuration, h as buildAuthenticatedHeaders, S as SigningBootstrapRequiredError, j as SIGNING_BOOTSTRAP_REQUIRED_MESSAGE, k as encodeBase64Url, f as delay, m as buildClientHeaders, n as decodeBase64, H as HAPPY_CLOUD_DAEMON_PORT, p as packageJson, A as ApiClient, o as getLatestDaemonLog } from './api-dwwHBzLc.mjs';
3
+ import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-Dg-rxY2a.mjs';
4
4
  import { z } from 'zod';
5
5
  import fs from 'fs/promises';
6
6
  import os, { homedir } from 'os';
@@ -4906,6 +4906,205 @@ function handleThinkingUpdate(update, ctx) {
4906
4906
  return { handled: true };
4907
4907
  }
4908
4908
 
4909
+ function buildAcpSpawnSpec(params) {
4910
+ return {
4911
+ command: params.command,
4912
+ args: (params.args ?? []).map((arg) => String(arg)),
4913
+ options: {
4914
+ cwd: params.cwd,
4915
+ env: params.env,
4916
+ stdio: ["pipe", "pipe", "pipe"],
4917
+ windowsHide: process.platform === "win32"
4918
+ }
4919
+ };
4920
+ }
4921
+
4922
+ function createAcpFilteredStdoutReadable(params) {
4923
+ const maxMultilineBytes = typeof params.maxMultilineBytes === "number" && Number.isFinite(params.maxMultilineBytes) && params.maxMultilineBytes > 0 ? Math.trunc(params.maxMultilineBytes) : 1e6;
4924
+ const decoder = new TextDecoder();
4925
+ const encoder = new TextEncoder();
4926
+ return new ReadableStream({
4927
+ async start(controller) {
4928
+ const reader = params.readable.getReader();
4929
+ let buffer = "";
4930
+ let multiline = null;
4931
+ let controllerErrored = false;
4932
+ const drop = (reason, line) => {
4933
+ params.onDroppedLine?.({ reason, line });
4934
+ };
4935
+ const enqueueLine = (line) => {
4936
+ if (!line.trim()) {
4937
+ return;
4938
+ }
4939
+ const filtered = params.transport.filterStdoutLine?.(line);
4940
+ if (filtered === void 0) {
4941
+ controller.enqueue(encoder.encode(line + "\n"));
4942
+ return;
4943
+ }
4944
+ if (filtered === null) {
4945
+ drop("transport_filter_null", line);
4946
+ return;
4947
+ }
4948
+ controller.enqueue(encoder.encode(filtered + "\n"));
4949
+ };
4950
+ const tryFlushMultiline = (candidate) => {
4951
+ const trimmed = candidate.trim();
4952
+ if (!trimmed) {
4953
+ return false;
4954
+ }
4955
+ if (!trimmed.startsWith("{") && !trimmed.startsWith("[")) {
4956
+ return false;
4957
+ }
4958
+ try {
4959
+ const parsed = JSON.parse(trimmed);
4960
+ if (typeof parsed !== "object" || parsed === null) {
4961
+ return false;
4962
+ }
4963
+ enqueueLine(JSON.stringify(parsed));
4964
+ return true;
4965
+ } catch {
4966
+ return false;
4967
+ }
4968
+ };
4969
+ try {
4970
+ while (true) {
4971
+ const { value, done } = await reader.read();
4972
+ if (done) {
4973
+ break;
4974
+ }
4975
+ if (!value) {
4976
+ continue;
4977
+ }
4978
+ buffer += decoder.decode(value, { stream: true });
4979
+ const lines = buffer.split("\n");
4980
+ buffer = lines.pop() || "";
4981
+ for (const line of lines) {
4982
+ if (multiline) {
4983
+ const nextBuf = multiline.buf.length > 0 ? `${multiline.buf}
4984
+ ${line}` : line;
4985
+ const nextBytes = multiline.bytes + line.length + 1;
4986
+ if (nextBytes > maxMultilineBytes) {
4987
+ drop("multiline_overflow", multiline.buf);
4988
+ multiline = null;
4989
+ enqueueLine(line);
4990
+ continue;
4991
+ }
4992
+ multiline = { buf: nextBuf, bytes: nextBytes };
4993
+ if (tryFlushMultiline(multiline.buf)) {
4994
+ multiline = null;
4995
+ }
4996
+ continue;
4997
+ }
4998
+ const trimmed = line.trim();
4999
+ if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
5000
+ try {
5001
+ const parsed = JSON.parse(trimmed);
5002
+ if (typeof parsed === "object" && parsed !== null) {
5003
+ enqueueLine(line);
5004
+ continue;
5005
+ }
5006
+ } catch {
5007
+ multiline = { buf: line, bytes: line.length };
5008
+ continue;
5009
+ }
5010
+ }
5011
+ enqueueLine(line);
5012
+ }
5013
+ }
5014
+ if (multiline) {
5015
+ if (!tryFlushMultiline(multiline.buf)) {
5016
+ drop("multiline_incomplete", multiline.buf);
5017
+ }
5018
+ multiline = null;
5019
+ }
5020
+ const trailing = buffer.trim();
5021
+ if (trailing) {
5022
+ drop("multiline_incomplete", buffer);
5023
+ }
5024
+ } catch (error) {
5025
+ controllerErrored = true;
5026
+ controller.error(error);
5027
+ } finally {
5028
+ reader.releaseLock();
5029
+ if (!controllerErrored) {
5030
+ controller.close();
5031
+ }
5032
+ }
5033
+ }
5034
+ });
5035
+ }
5036
+
5037
+ function isAlive(pid) {
5038
+ try {
5039
+ process.kill(pid, 0);
5040
+ return true;
5041
+ } catch {
5042
+ return false;
5043
+ }
5044
+ }
5045
+ async function resolveDescendantPids(rootPid) {
5046
+ const processes = await psList();
5047
+ const childrenByParent = /* @__PURE__ */ new Map();
5048
+ for (const proc of processes) {
5049
+ if (typeof proc.pid !== "number" || typeof proc.ppid !== "number") {
5050
+ continue;
5051
+ }
5052
+ const children = childrenByParent.get(proc.ppid) ?? [];
5053
+ children.push(proc.pid);
5054
+ childrenByParent.set(proc.ppid, children);
5055
+ }
5056
+ const descendants = [];
5057
+ const seen = /* @__PURE__ */ new Set();
5058
+ const visit = (pid) => {
5059
+ for (const childPid of childrenByParent.get(pid) ?? []) {
5060
+ if (seen.has(childPid)) {
5061
+ continue;
5062
+ }
5063
+ seen.add(childPid);
5064
+ visit(childPid);
5065
+ descendants.push(childPid);
5066
+ }
5067
+ };
5068
+ visit(rootPid);
5069
+ return descendants;
5070
+ }
5071
+ function bestEffortKillPid(pid, signal) {
5072
+ try {
5073
+ process.kill(pid, signal);
5074
+ } catch {
5075
+ }
5076
+ }
5077
+ async function waitForAllGone(pids, timeoutMs) {
5078
+ const start = Date.now();
5079
+ while (Date.now() - start < timeoutMs) {
5080
+ if (pids.every((pid) => !isAlive(pid))) {
5081
+ return;
5082
+ }
5083
+ await new Promise((resolve) => setTimeout(resolve, 25));
5084
+ }
5085
+ }
5086
+ async function killProcessTree(proc, options) {
5087
+ const pid = proc.pid;
5088
+ if (!pid) {
5089
+ return;
5090
+ }
5091
+ const graceMs = Math.max(1, options?.graceMs);
5092
+ const descendants = await resolveDescendantPids(pid).catch(() => []);
5093
+ const allPids = [...descendants, pid];
5094
+ for (const targetPid of allPids) {
5095
+ bestEffortKillPid(targetPid, "SIGTERM");
5096
+ }
5097
+ await waitForAllGone(allPids, graceMs);
5098
+ const remaining = allPids.filter((targetPid) => isAlive(targetPid));
5099
+ if (remaining.length === 0) {
5100
+ return;
5101
+ }
5102
+ for (const targetPid of remaining) {
5103
+ bestEffortKillPid(targetPid, "SIGKILL");
5104
+ }
5105
+ await waitForAllGone(remaining, Math.min(250, graceMs));
5106
+ }
5107
+
4909
5108
  const RETRY_CONFIG = {
4910
5109
  /** Maximum number of retry attempts for init/newSession */
4911
5110
  maxAttempts: 3,
@@ -5294,24 +5493,13 @@ class AcpBackend {
5294
5493
  try {
5295
5494
  logger.debug(`[AcpBackend] Starting session: ${sessionId}`);
5296
5495
  this.recentStderrLines = [];
5297
- const args = this.options.args || [];
5298
- if (process.platform === "win32") {
5299
- const fullCommand = [this.options.command, ...args].join(" ");
5300
- this.process = spawn$2("cmd.exe", ["/c", fullCommand], {
5301
- cwd: this.options.cwd,
5302
- env: { ...process.env, ...this.options.env },
5303
- stdio: ["pipe", "pipe", "pipe"],
5304
- windowsHide: true
5305
- });
5306
- } else {
5307
- this.process = spawn$2(this.options.command, args, {
5308
- cwd: this.options.cwd,
5309
- env: { ...process.env, ...this.options.env },
5310
- // Use 'pipe' for all stdio to capture output without printing to console
5311
- // stdout and stderr will be handled by our event listeners
5312
- stdio: ["pipe", "pipe", "pipe"]
5313
- });
5314
- }
5496
+ const spawnSpec = buildAcpSpawnSpec({
5497
+ command: this.options.command,
5498
+ args: this.options.args ?? [],
5499
+ cwd: this.options.cwd,
5500
+ env: { ...process.env, ...this.options.env }
5501
+ });
5502
+ this.process = spawn$1(spawnSpec.command, spawnSpec.args, spawnSpec.options);
5315
5503
  if (this.process.stderr) {
5316
5504
  }
5317
5505
  if (!this.process.stdin || !this.process.stdout || !this.process.stderr) {
@@ -5359,57 +5547,20 @@ class AcpBackend {
5359
5547
  );
5360
5548
  const writable = streams.writable;
5361
5549
  const readable = streams.readable;
5362
- const transport = this.transport;
5363
- const filteredReadable = new ReadableStream({
5364
- async start(controller) {
5365
- const reader = readable.getReader();
5366
- const decoder = new TextDecoder();
5367
- const encoder = new TextEncoder();
5368
- let buffer = "";
5369
- let filteredCount = 0;
5370
- try {
5371
- while (true) {
5372
- const { done, value } = await reader.read();
5373
- if (done) {
5374
- if (buffer.trim()) {
5375
- const filtered = transport.filterStdoutLine?.(buffer);
5376
- if (filtered === void 0) {
5377
- controller.enqueue(encoder.encode(buffer));
5378
- } else if (filtered !== null) {
5379
- controller.enqueue(encoder.encode(filtered));
5380
- } else {
5381
- filteredCount++;
5382
- }
5383
- }
5384
- if (filteredCount > 0) {
5385
- logger.debug(`[AcpBackend] Filtered out ${filteredCount} non-JSON lines from ${transport.agentName} stdout`);
5386
- }
5387
- controller.close();
5388
- break;
5389
- }
5390
- buffer += decoder.decode(value, { stream: true });
5391
- const lines = buffer.split("\n");
5392
- buffer = lines.pop() || "";
5393
- for (const line of lines) {
5394
- if (!line.trim()) continue;
5395
- const filtered = transport.filterStdoutLine?.(line);
5396
- if (filtered === void 0) {
5397
- controller.enqueue(encoder.encode(line + "\n"));
5398
- } else if (filtered !== null) {
5399
- controller.enqueue(encoder.encode(filtered + "\n"));
5400
- } else {
5401
- filteredCount++;
5402
- }
5403
- }
5404
- }
5405
- } catch (error) {
5406
- logger.debug(`[AcpBackend] Error filtering stdout stream:`, error);
5407
- controller.error(error);
5408
- } finally {
5409
- reader.releaseLock();
5410
- }
5550
+ const droppedStdoutLines = [];
5551
+ const filteredReadable = createAcpFilteredStdoutReadable({
5552
+ readable,
5553
+ transport: this.transport,
5554
+ onDroppedLine: (entry) => {
5555
+ droppedStdoutLines.push(entry);
5411
5556
  }
5412
5557
  });
5558
+ if (droppedStdoutLines.length > 0) {
5559
+ logger.debug(
5560
+ `[AcpBackend] Filtered out ${droppedStdoutLines.length} stdout lines from ${this.transport.agentName}`,
5561
+ droppedStdoutLines.slice(0, 5)
5562
+ );
5563
+ }
5413
5564
  const stream = ndJsonStream(writable, filteredReadable);
5414
5565
  const client = {
5415
5566
  sessionUpdate: async (params) => {
@@ -5937,21 +6088,13 @@ class AcpBackend {
5937
6088
  }
5938
6089
  }
5939
6090
  if (this.process) {
5940
- this.process.kill("SIGTERM");
5941
- await new Promise((resolve) => {
5942
- const timeout = setTimeout(() => {
5943
- if (this.process) {
5944
- logger.debug("[AcpBackend] Force killing process");
5945
- this.process.kill("SIGKILL");
5946
- }
5947
- resolve();
5948
- }, 1e3);
5949
- this.process?.once("exit", () => {
5950
- clearTimeout(timeout);
5951
- resolve();
5952
- });
5953
- });
5954
- this.process = null;
6091
+ try {
6092
+ await killProcessTree(this.process, { graceMs: 1e3 });
6093
+ } catch (error) {
6094
+ logger.debug("[AcpBackend] Failed to kill ACP process tree:", error);
6095
+ } finally {
6096
+ this.process = null;
6097
+ }
5955
6098
  }
5956
6099
  this.clearIdleTimeoutState();
5957
6100
  this.listeners = [];
@@ -6395,7 +6538,6 @@ function createCodexBackend(options) {
6395
6538
  ...options.env,
6396
6539
  NODE_ENV: "production"
6397
6540
  },
6398
- mcpServers: options.mcpServers,
6399
6541
  permissionHandler: options.permissionHandler,
6400
6542
  selectionHandler: options.selectionHandler,
6401
6543
  transportHandler: resolveCodexTransport(spawn.command)
@@ -6603,12 +6745,12 @@ async function ensureUnifiedDaemonStarted() {
6603
6745
  async function executeUnifiedProvider(opts) {
6604
6746
  const credentials = await ensureUnifiedRuntimePrerequisites(opts.credentials);
6605
6747
  if (opts.provider === "claude") {
6606
- const { runClaude } = await import('./runClaude-CZ8gxaJL.mjs');
6748
+ const { runClaude } = await import('./runClaude-OxYbt3ZQ.mjs');
6607
6749
  await runClaude(credentials, opts.claudeOptions ?? {});
6608
6750
  return;
6609
6751
  }
6610
6752
  if (opts.provider === "codex") {
6611
- const { runCodex } = await import('./runCodex-DT7g4MPm.mjs');
6753
+ const { runCodex } = await import('./runCodex-ByVTEbSY.mjs');
6612
6754
  await runCodex({
6613
6755
  credentials,
6614
6756
  startedBy: opts.startedBy,
@@ -6618,7 +6760,7 @@ async function executeUnifiedProvider(opts) {
6618
6760
  return;
6619
6761
  }
6620
6762
  if (opts.provider === "gemini") {
6621
- const { runGemini } = await import('./runGemini-CmY5386l.mjs');
6763
+ const { runGemini } = await import('./runGemini-BRO6A2jm.mjs');
6622
6764
  await runGemini({
6623
6765
  credentials,
6624
6766
  startedBy: opts.startedBy
@@ -6660,7 +6802,7 @@ function shouldRunMainClaudeFlow(opts) {
6660
6802
  return;
6661
6803
  } else if (subcommand === "runtime") {
6662
6804
  if (args[1] === "providers") {
6663
- const { renderRuntimeProviders } = await import('./command-Dl9SrMnv.mjs');
6805
+ const { renderRuntimeProviders } = await import('./command-Cfq3Uc0S.mjs');
6664
6806
  console.log(renderRuntimeProviders());
6665
6807
  return;
6666
6808
  }
@@ -6838,8 +6980,8 @@ function shouldRunMainClaudeFlow(opts) {
6838
6980
  const projectId = args[3];
6839
6981
  try {
6840
6982
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
6841
- const { readCredentials: readCredentials2 } = await import('./persistence-QqeBvUxX.mjs');
6842
- const { ApiClient: ApiClient2 } = await import('./api-DoHt-HyL.mjs').then(function (n) { return n.q; });
6983
+ const { readCredentials: readCredentials2 } = await import('./persistence-Dg-rxY2a.mjs');
6984
+ const { ApiClient: ApiClient2 } = await import('./api-dwwHBzLc.mjs').then(function (n) { return n.q; });
6843
6985
  let userEmail = void 0;
6844
6986
  try {
6845
6987
  const credentials = await readCredentials2();
package/dist/index.cjs CHANGED
@@ -1,14 +1,16 @@
1
1
  'use strict';
2
2
 
3
3
  require('chalk');
4
- require('./api-DaqnNHfl.cjs');
5
- require('./persistence-D6Y0604_.cjs');
4
+ require('./api-Dwkm7s_E.cjs');
5
+ require('./persistence-hbhwAYIV.cjs');
6
6
  require('zod');
7
- require('./index-Dc92gnxM.cjs');
7
+ require('./index-CfqxEoyl.cjs');
8
8
  require('node:child_process');
9
9
  require('node:fs');
10
+ require('cross-spawn');
10
11
  require('@agentclientprotocol/sdk');
11
12
  require('node:crypto');
13
+ require('ps-list');
12
14
  require('fs');
13
15
  require('path');
14
16
  require('os');
@@ -31,8 +33,6 @@ require('open');
31
33
  require('react');
32
34
  require('ink');
33
35
  require('url');
34
- require('ps-list');
35
- require('cross-spawn');
36
36
  require('fastify');
37
37
  require('fastify-type-provider-zod');
38
38
  require('node:readline');
package/dist/index.mjs CHANGED
@@ -1,12 +1,14 @@
1
1
  import 'chalk';
2
- import './api-DoHt-HyL.mjs';
3
- import './persistence-QqeBvUxX.mjs';
2
+ import './api-dwwHBzLc.mjs';
3
+ import './persistence-Dg-rxY2a.mjs';
4
4
  import 'zod';
5
- import './index-C5wR2qKT.mjs';
5
+ import './index-HyqLXzw-.mjs';
6
6
  import 'node:child_process';
7
7
  import 'node:fs';
8
+ import 'cross-spawn';
8
9
  import '@agentclientprotocol/sdk';
9
10
  import 'node:crypto';
11
+ import 'ps-list';
10
12
  import 'fs';
11
13
  import 'path';
12
14
  import 'os';
@@ -29,8 +31,6 @@ import 'open';
29
31
  import 'react';
30
32
  import 'ink';
31
33
  import 'url';
32
- import 'ps-list';
33
- import 'cross-spawn';
34
34
  import 'fastify';
35
35
  import 'fastify-type-provider-zod';
36
36
  import 'node:readline';
package/dist/lib.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-DaqnNHfl.cjs');
3
+ var api = require('./api-Dwkm7s_E.cjs');
4
4
  var types = require('./types-DVk3crez.cjs');
5
5
  require('axios');
6
6
  require('chalk');
package/dist/lib.mjs CHANGED
@@ -1,4 +1,4 @@
1
- export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-DoHt-HyL.mjs';
1
+ export { A as ApiClient, a as ApiSessionClient, c as configuration, l as logger } from './api-dwwHBzLc.mjs';
2
2
  export { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
3
3
  import 'axios';
4
4
  import 'chalk';
@@ -1,7 +1,7 @@
1
1
  import { readFile, unlink, mkdir, open, stat, writeFile, rename } from 'node:fs/promises';
2
2
  import { existsSync, unlinkSync, writeFileSync, readdirSync, readFileSync, constants } from 'node:fs';
3
3
  import { join, dirname } from 'node:path';
4
- import { c as configuration, l as logger, e as encodeBase64 } from './api-DoHt-HyL.mjs';
4
+ import { c as configuration, l as logger, e as encodeBase64 } from './api-dwwHBzLc.mjs';
5
5
  import * as z from 'zod';
6
6
  import 'axios';
7
7
  import 'chalk';
@@ -3,7 +3,7 @@
3
3
  var promises = require('node:fs/promises');
4
4
  var node_fs = require('node:fs');
5
5
  var node_path = require('node:path');
6
- var api = require('./api-DaqnNHfl.cjs');
6
+ var api = require('./api-Dwkm7s_E.cjs');
7
7
  var z = require('zod');
8
8
  require('axios');
9
9
  require('chalk');
@@ -1,5 +1,5 @@
1
- import { f as formatDisplayMessage } from './index-C5wR2qKT.mjs';
2
- import { l as logger } from './api-DoHt-HyL.mjs';
1
+ import { f as formatDisplayMessage } from './index-HyqLXzw-.mjs';
2
+ import { l as logger } from './api-dwwHBzLc.mjs';
3
3
  import { createHash } from 'crypto';
4
4
  import 'axios';
5
5
  import 'node:events';
@@ -23,6 +23,30 @@ class MessageBuffer {
23
23
  };
24
24
  this.messages.push(message);
25
25
  this.notifyListeners();
26
+ return message.id;
27
+ }
28
+ updateMessage(id, content, options = {}) {
29
+ const index = this.messages.findIndex((message) => message.id === id);
30
+ if (index === -1) {
31
+ return false;
32
+ }
33
+ const normalizedContent = formatDisplayMessage(content);
34
+ const previous = this.messages[index];
35
+ this.messages[index] = {
36
+ ...previous,
37
+ content: options.mode === "replace" ? normalizedContent : previous.content + normalizedContent
38
+ };
39
+ this.notifyListeners();
40
+ return true;
41
+ }
42
+ removeMessage(id) {
43
+ const index = this.messages.findIndex((message) => message.id === id);
44
+ if (index === -1) {
45
+ return false;
46
+ }
47
+ this.messages.splice(index, 1);
48
+ this.notifyListeners();
49
+ return true;
26
50
  }
27
51
  /**
28
52
  * Update the last message of a specific type by appending content to it
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-Dc92gnxM.cjs');
4
- var api = require('./api-DaqnNHfl.cjs');
3
+ var index = require('./index-CfqxEoyl.cjs');
4
+ var api = require('./api-Dwkm7s_E.cjs');
5
5
  var crypto = require('crypto');
6
6
  require('axios');
7
7
  require('node:events');
@@ -25,6 +25,30 @@ class MessageBuffer {
25
25
  };
26
26
  this.messages.push(message);
27
27
  this.notifyListeners();
28
+ return message.id;
29
+ }
30
+ updateMessage(id, content, options = {}) {
31
+ const index$1 = this.messages.findIndex((message) => message.id === id);
32
+ if (index$1 === -1) {
33
+ return false;
34
+ }
35
+ const normalizedContent = index.formatDisplayMessage(content);
36
+ const previous = this.messages[index$1];
37
+ this.messages[index$1] = {
38
+ ...previous,
39
+ content: options.mode === "replace" ? normalizedContent : previous.content + normalizedContent
40
+ };
41
+ this.notifyListeners();
42
+ return true;
43
+ }
44
+ removeMessage(id) {
45
+ const index = this.messages.findIndex((message) => message.id === id);
46
+ if (index === -1) {
47
+ return false;
48
+ }
49
+ this.messages.splice(index, 1);
50
+ this.notifyListeners();
51
+ return true;
28
52
  }
29
53
  /**
30
54
  * Update the last message of a specific type by appending content to it
@@ -2,14 +2,14 @@
2
2
 
3
3
  var os = require('node:os');
4
4
  var node_crypto = require('node:crypto');
5
- var api = require('./api-DaqnNHfl.cjs');
6
- var index = require('./index-Dc92gnxM.cjs');
5
+ var api = require('./api-Dwkm7s_E.cjs');
6
+ var index = require('./index-CfqxEoyl.cjs');
7
7
  var types = require('./types-DVk3crez.cjs');
8
8
  var node_path = require('node:path');
9
9
  var promises = require('node:fs/promises');
10
10
  var fs = require('fs/promises');
11
11
  var ink = require('ink');
12
- var registerKillSessionHandler = require('./registerKillSessionHandler-C6yXr8ky.cjs');
12
+ var registerKillSessionHandler = require('./registerKillSessionHandler-D1ouN10n.cjs');
13
13
  var React = require('react');
14
14
  var node_child_process = require('node:child_process');
15
15
  var node_readline = require('node:readline');
@@ -22,7 +22,7 @@ require('tweetnacl');
22
22
  require('expo-server-sdk');
23
23
  require('chalk');
24
24
  var node_util = require('node:util');
25
- var persistence = require('./persistence-D6Y0604_.cjs');
25
+ var persistence = require('./persistence-hbhwAYIV.cjs');
26
26
  var node_http = require('node:http');
27
27
  require('fs');
28
28
  require('zod');
@@ -937,7 +937,7 @@ class AbortError extends Error {
937
937
  }
938
938
  }
939
939
 
940
- const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('runClaude-gHKFB1UG.cjs', document.baseURI).href)));
940
+ const __filename$1 = node_url.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('runClaude-CZmJ7qEP.cjs', document.baseURI).href)));
941
941
  const __dirname$1 = node_path.join(__filename$1, "..");
942
942
  function getGlobalClaudeVersion() {
943
943
  try {
@@ -1,13 +1,13 @@
1
1
  import os, { homedir } from 'node:os';
2
2
  import { randomUUID } from 'node:crypto';
3
- import { l as logger, d as backoff, f as delay, g as AsyncLock, c as configuration, b as connectionState, A as ApiClient, p as packageJson, i as isAuthenticationRequiredError, s as startOfflineReconnection } from './api-DoHt-HyL.mjs';
4
- import { e as getProjectPath, h as claudeLocal, E as ExitCodeError, j as isBun, k as trimIdent, l as claudeCheckSession, p as projectPath, m as getEnvironmentInfo, i as initialMachineMetadata, b as stopCaffeinate, n as notifyDaemonSessionStarted, o as startCaffeinate } from './index-C5wR2qKT.mjs';
3
+ import { l as logger, d as backoff, f as delay, g as AsyncLock, c as configuration, b as connectionState, A as ApiClient, p as packageJson, i as isAuthenticationRequiredError, s as startOfflineReconnection } from './api-dwwHBzLc.mjs';
4
+ import { e as getProjectPath, h as claudeLocal, E as ExitCodeError, j as isBun, k as trimIdent, l as claudeCheckSession, p as projectPath, m as getEnvironmentInfo, i as initialMachineMetadata, b as stopCaffeinate, n as notifyDaemonSessionStarted, o as startCaffeinate } from './index-HyqLXzw-.mjs';
5
5
  import { R as RawJSONLinesSchema } from './types-CiliQpqS.mjs';
6
6
  import { dirname, basename, join, resolve } from 'node:path';
7
7
  import { readFile } from 'node:fs/promises';
8
8
  import { stat, watch, access } from 'fs/promises';
9
9
  import { useStdout, useInput, Box, Text, render } from 'ink';
10
- import { a as MessageBuffer, M as MessageQueue2, h as hashObject, r as registerKillSessionHandler } from './registerKillSessionHandler-CC9zGBPE.mjs';
10
+ import { a as MessageBuffer, M as MessageQueue2, h as hashObject, r as registerKillSessionHandler } from './registerKillSessionHandler-BAvk4GYO.mjs';
11
11
  import React, { useState, useRef, useEffect, useCallback } from 'react';
12
12
  import { execSync, spawn } from 'node:child_process';
13
13
  import { createInterface } from 'node:readline';
@@ -20,7 +20,7 @@ import 'tweetnacl';
20
20
  import 'expo-server-sdk';
21
21
  import 'chalk';
22
22
  import { isDeepStrictEqual } from 'node:util';
23
- import { readSettings } from './persistence-QqeBvUxX.mjs';
23
+ import { readSettings } from './persistence-Dg-rxY2a.mjs';
24
24
  import { createServer } from 'node:http';
25
25
  import 'fs';
26
26
  import 'zod';