happy-imou-cloud 2.1.15 → 2.1.17

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 (27) hide show
  1. package/dist/{BaseReasoningProcessor-CVlTn4bz.mjs → BaseReasoningProcessor-BAv0_85s.mjs} +2 -2
  2. package/dist/{BaseReasoningProcessor-CM_72G79.cjs → BaseReasoningProcessor-D_cBN7IM.cjs} +2 -2
  3. package/dist/{ProviderSelectionHandler-8KqyCR1t.cjs → ProviderSelectionHandler-Cyinzbk-.cjs} +2 -2
  4. package/dist/{ProviderSelectionHandler-CRMANxaw.mjs → ProviderSelectionHandler-D3qMOxaQ.mjs} +2 -2
  5. package/dist/{api-Cgyrs44K.mjs → api-CrGI5ANv.mjs} +34 -2
  6. package/dist/{api-BPXrSITF.cjs → api-ykburCIA.cjs} +34 -2
  7. package/dist/{command-BlMDPyNv.cjs → command-3_48b_TM.cjs} +3 -3
  8. package/dist/{command-ykLmhw9O.mjs → command-BGK4qQ-4.mjs} +3 -3
  9. package/dist/{index-BKd56kbE.mjs → index-CVp6QcCz.mjs} +119 -23
  10. package/dist/{index-BHLqfbDm.cjs → index-CX3AYEyM.cjs} +121 -25
  11. package/dist/index.cjs +3 -3
  12. package/dist/index.mjs +3 -3
  13. package/dist/lib.cjs +1 -1
  14. package/dist/lib.d.cts +53 -0
  15. package/dist/lib.d.mts +53 -0
  16. package/dist/lib.mjs +1 -1
  17. package/dist/{persistence-DgaStaev.cjs → persistence-DFC6LL-_.cjs} +1 -1
  18. package/dist/{persistence-D1rI_096.mjs → persistence-vDMpMN8U.mjs} +1 -1
  19. package/dist/{registerKillSessionHandler-BqFm3Yvi.mjs → registerKillSessionHandler-CefmiOrp.mjs} +347 -5
  20. package/dist/{registerKillSessionHandler-Bc-f3xFV.cjs → registerKillSessionHandler-Dztdudkl.cjs} +347 -5
  21. package/dist/{runClaude-Da0YUY3E.cjs → runClaude-Ca_A2OHq.cjs} +13 -7
  22. package/dist/{runClaude-BYVqYLc6.mjs → runClaude-DuzlOk3Z.mjs} +13 -7
  23. package/dist/{runCodex-x0k9hJyI.mjs → runCodex-CayUbEDE.mjs} +14 -8
  24. package/dist/{runCodex-CZZNiXT5.cjs → runCodex-Cyfj_rOx.cjs} +14 -8
  25. package/dist/{runGemini-C6_EpYe9.cjs → runGemini-CUpbNLsb.cjs} +13 -7
  26. package/dist/{runGemini-B_bJyd4j.mjs → runGemini-EB-Mh7Ua.mjs} +13 -7
  27. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { a as createSessionMetadata, p as publishSessionRegistration } from './index-BKd56kbE.mjs';
2
- import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-Cgyrs44K.mjs';
1
+ import { a as createSessionMetadata, p as publishSessionRegistration } from './index-CVp6QcCz.mjs';
2
+ import { s as startOfflineReconnection, c as configuration, i as isAuthenticationRequiredError, l as logger } from './api-CrGI5ANv.mjs';
3
3
  import { EventEmitter } from 'node:events';
4
4
  import { randomUUID } from 'node:crypto';
5
5
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BHLqfbDm.cjs');
4
- var api = require('./api-BPXrSITF.cjs');
3
+ var index = require('./index-CX3AYEyM.cjs');
4
+ var api = require('./api-ykburCIA.cjs');
5
5
  var node_events = require('node:events');
6
6
  var node_crypto = require('node:crypto');
7
7
 
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var api = require('./api-BPXrSITF.cjs');
4
- var registerKillSessionHandler = require('./registerKillSessionHandler-Bc-f3xFV.cjs');
3
+ var api = require('./api-ykburCIA.cjs');
4
+ var registerKillSessionHandler = require('./registerKillSessionHandler-Dztdudkl.cjs');
5
5
 
6
6
  async function runModeLoop(opts) {
7
7
  let currentMode = opts.startingMode;
@@ -1,5 +1,5 @@
1
- import { l as logger } from './api-Cgyrs44K.mjs';
2
- import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-BqFm3Yvi.mjs';
1
+ import { l as logger } from './api-CrGI5ANv.mjs';
2
+ import { g as getPendingInteractionTimeoutMs, I as INTERACTION_SUPERSEDED_ERROR, a as INTERACTION_TIMED_OUT_ERROR } from './registerKillSessionHandler-CefmiOrp.mjs';
3
3
 
4
4
  async function runModeLoop(opts) {
5
5
  let currentMode = opts.startingMode;
@@ -16,7 +16,7 @@ import { spawn } from 'node:child_process';
16
16
  import { Expo } from 'expo-server-sdk';
17
17
 
18
18
  var name = "happy-imou-cloud";
19
- var version = "2.1.15";
19
+ var version = "2.1.17";
20
20
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
21
21
  var author = "long.zhu";
22
22
  var license = "MIT";
@@ -431,7 +431,7 @@ async function listDaemonLogFiles(limit = 50) {
431
431
  return { file, path: fullPath, modified: stats.mtime };
432
432
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
433
433
  try {
434
- const { readDaemonState } = await import('./persistence-D1rI_096.mjs');
434
+ const { readDaemonState } = await import('./persistence-vDMpMN8U.mjs');
435
435
  const state = await readDaemonState();
436
436
  if (!state) {
437
437
  return logs;
@@ -597,6 +597,20 @@ const HappyOrgReplyContextSchema = z.object({
597
597
  scope: z.string().min(1),
598
598
  replyTo: z.string().min(1)
599
599
  });
600
+ const HappyOrgDispatchBusinessAckStatusSchema = z.enum([
601
+ "accepted",
602
+ "standby",
603
+ "blocked"
604
+ ]);
605
+ const HappyOrgDispatchAckLedgerEntrySchema = z.object({
606
+ dispatchId: z.string().min(1),
607
+ scope: z.string().min(1),
608
+ taskAck: z.string().min(1),
609
+ readAck: z.literal("yes"),
610
+ status: HappyOrgDispatchBusinessAckStatusSchema,
611
+ note: z.string().nullable(),
612
+ acknowledgedAt: z.number().int().nonnegative()
613
+ });
600
614
  const HappyOrgSpecialistHomeIdentitySchema = z.object({
601
615
  homeSlug: z.string().min(1),
602
616
  path: z.string().min(1).nullish(),
@@ -655,6 +669,7 @@ z.object({
655
669
  runtime: HappyOrgRuntimeStateSchema.optional(),
656
670
  activeOwner: HappyOrgTaskOwnershipSchema.nullish(),
657
671
  replyContext: HappyOrgReplyContextSchema.nullish(),
672
+ dispatchAcks: z.record(z.string(), HappyOrgDispatchAckLedgerEntrySchema).optional(),
658
673
  specialistHome: HappyOrgSpecialistHomeIdentitySchema.nullish(),
659
674
  repeat: z.object({
660
675
  threshold: z.number().int().positive(),
@@ -3677,6 +3692,23 @@ class ApiClient {
3677
3692
  });
3678
3693
  return response.data.receipt;
3679
3694
  }
3695
+ async submitOrganizationDispatchBusinessAck(opts) {
3696
+ const response = await this.request({
3697
+ method: "POST",
3698
+ url: `${configuration.serverUrl}/control/v1/dispatches/${encodeURIComponent(opts.dispatchId)}/ack`,
3699
+ data: {
3700
+ memberAgentId: opts.memberAgentId,
3701
+ scope: opts.scope,
3702
+ read_ack: opts.readAck,
3703
+ task_ack: opts.taskAck,
3704
+ status: opts.status,
3705
+ note: opts.note ?? null
3706
+ },
3707
+ headers: { "x-happy-organization-id": opts.organizationId },
3708
+ timeout: 1e4
3709
+ });
3710
+ return response.data.receipt;
3711
+ }
3680
3712
  async getProtocolV3Descriptor() {
3681
3713
  const url = `${configuration.serverUrl}/v3/capabilities`;
3682
3714
  const payload = await this.requestProtocolV3Resource({
@@ -18,7 +18,7 @@ var node_child_process = require('node:child_process');
18
18
  var expoServerSdk = require('expo-server-sdk');
19
19
 
20
20
  var name = "happy-imou-cloud";
21
- var version = "2.1.15";
21
+ var version = "2.1.17";
22
22
  var description = "hicloud - Imou 企业定制版。关键是 happy!移动端远程 AI 编程工具,支持 Claude Code、Codex 和 Gemini CLI";
23
23
  var author = "long.zhu";
24
24
  var license = "MIT";
@@ -433,7 +433,7 @@ async function listDaemonLogFiles(limit = 50) {
433
433
  return { file, path: fullPath, modified: stats.mtime };
434
434
  }).sort((a, b) => b.modified.getTime() - a.modified.getTime());
435
435
  try {
436
- const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-DgaStaev.cjs'); });
436
+ const { readDaemonState } = await Promise.resolve().then(function () { return require('./persistence-DFC6LL-_.cjs'); });
437
437
  const state = await readDaemonState();
438
438
  if (!state) {
439
439
  return logs;
@@ -599,6 +599,20 @@ const HappyOrgReplyContextSchema = z.z.object({
599
599
  scope: z.z.string().min(1),
600
600
  replyTo: z.z.string().min(1)
601
601
  });
602
+ const HappyOrgDispatchBusinessAckStatusSchema = z.z.enum([
603
+ "accepted",
604
+ "standby",
605
+ "blocked"
606
+ ]);
607
+ const HappyOrgDispatchAckLedgerEntrySchema = z.z.object({
608
+ dispatchId: z.z.string().min(1),
609
+ scope: z.z.string().min(1),
610
+ taskAck: z.z.string().min(1),
611
+ readAck: z.z.literal("yes"),
612
+ status: HappyOrgDispatchBusinessAckStatusSchema,
613
+ note: z.z.string().nullable(),
614
+ acknowledgedAt: z.z.number().int().nonnegative()
615
+ });
602
616
  const HappyOrgSpecialistHomeIdentitySchema = z.z.object({
603
617
  homeSlug: z.z.string().min(1),
604
618
  path: z.z.string().min(1).nullish(),
@@ -657,6 +671,7 @@ z.z.object({
657
671
  runtime: HappyOrgRuntimeStateSchema.optional(),
658
672
  activeOwner: HappyOrgTaskOwnershipSchema.nullish(),
659
673
  replyContext: HappyOrgReplyContextSchema.nullish(),
674
+ dispatchAcks: z.z.record(z.z.string(), HappyOrgDispatchAckLedgerEntrySchema).optional(),
660
675
  specialistHome: HappyOrgSpecialistHomeIdentitySchema.nullish(),
661
676
  repeat: z.z.object({
662
677
  threshold: z.z.number().int().positive(),
@@ -3679,6 +3694,23 @@ class ApiClient {
3679
3694
  });
3680
3695
  return response.data.receipt;
3681
3696
  }
3697
+ async submitOrganizationDispatchBusinessAck(opts) {
3698
+ const response = await this.request({
3699
+ method: "POST",
3700
+ url: `${configuration.serverUrl}/control/v1/dispatches/${encodeURIComponent(opts.dispatchId)}/ack`,
3701
+ data: {
3702
+ memberAgentId: opts.memberAgentId,
3703
+ scope: opts.scope,
3704
+ read_ack: opts.readAck,
3705
+ task_ack: opts.taskAck,
3706
+ status: opts.status,
3707
+ note: opts.note ?? null
3708
+ },
3709
+ headers: { "x-happy-organization-id": opts.organizationId },
3710
+ timeout: 1e4
3711
+ });
3712
+ return response.data.receipt;
3713
+ }
3682
3714
  async getProtocolV3Descriptor() {
3683
3715
  const url = `${configuration.serverUrl}/v3/capabilities`;
3684
3716
  const payload = await this.requestProtocolV3Resource({
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-BHLqfbDm.cjs');
3
+ var index = require('./index-CX3AYEyM.cjs');
4
4
  require('chalk');
5
- require('./api-BPXrSITF.cjs');
5
+ require('./api-ykburCIA.cjs');
6
6
  require('axios');
7
7
  require('fs');
8
8
  require('node:fs');
@@ -18,7 +18,7 @@ require('crypto');
18
18
  require('path');
19
19
  require('node:child_process');
20
20
  require('expo-server-sdk');
21
- require('./persistence-DgaStaev.cjs');
21
+ require('./persistence-DFC6LL-_.cjs');
22
22
  require('node:fs/promises');
23
23
  require('os');
24
24
  require('tmp');
@@ -1,6 +1,6 @@
1
- import { c as createDefaultRuntimeShell } from './index-BKd56kbE.mjs';
1
+ import { c as createDefaultRuntimeShell } from './index-CVp6QcCz.mjs';
2
2
  import 'chalk';
3
- import './api-Cgyrs44K.mjs';
3
+ import './api-CrGI5ANv.mjs';
4
4
  import 'axios';
5
5
  import 'fs';
6
6
  import 'node:fs';
@@ -16,7 +16,7 @@ import 'crypto';
16
16
  import 'path';
17
17
  import 'node:child_process';
18
18
  import 'expo-server-sdk';
19
- import './persistence-D1rI_096.mjs';
19
+ import './persistence-vDMpMN8U.mjs';
20
20
  import 'node:fs/promises';
21
21
  import 'os';
22
22
  import 'tmp';
@@ -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, k as buildAuthenticatedHeaders, S as SigningBootstrapRequiredError, m as SIGNING_BOOTSTRAP_REQUIRED_MESSAGE, n as encodeBase64Url, h as delay, o as buildClientHeaders, q as decodeBase64, r as HAPPY_CLOUD_DAEMON_PORT, t as packageJson, A as ApiClient, u as HeadTailPreviewBuffer, v as getLatestDaemonLog } from './api-Cgyrs44K.mjs';
3
- import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-D1rI_096.mjs';
2
+ import { l as logger, e as encodeBase64, c as configuration, k as buildAuthenticatedHeaders, S as SigningBootstrapRequiredError, m as SIGNING_BOOTSTRAP_REQUIRED_MESSAGE, n as encodeBase64Url, h as delay, o as buildClientHeaders, q as decodeBase64, r as HAPPY_CLOUD_DAEMON_PORT, t as packageJson, A as ApiClient, u as HeadTailPreviewBuffer, v as getLatestDaemonLog } from './api-CrGI5ANv.mjs';
3
+ import { writeCredentialsLegacy, writeCredentialsDataKey, readCredentials, readSettings, updateSettings, readDaemonState, clearDaemonState, acquireDaemonLock, writeDaemonState, releaseDaemonLock, validateProfileForAgent, getProfileEnvironmentVariables, clearCredentials, clearMachineId } from './persistence-vDMpMN8U.mjs';
4
4
  import { z } from 'zod';
5
5
  import fs, { writeFile as writeFile$1, rename, unlink as unlink$1 } from 'fs/promises';
6
6
  import os$1, { homedir } from 'os';
@@ -12,7 +12,7 @@ import qrcode from 'qrcode-terminal';
12
12
  import { writeFile, unlink, readdir, readFile, mkdir } from 'node:fs/promises';
13
13
  import { createRequire } from 'node:module';
14
14
  import os, { tmpdir, homedir as homedir$1 } from 'node:os';
15
- import path, { join, resolve as resolve$1, isAbsolute, delimiter, normalize, dirname as dirname$1 } from 'node:path';
15
+ import path, { join, resolve as resolve$1, isAbsolute, delimiter, normalize, dirname as dirname$1, basename } from 'node:path';
16
16
  import open from 'open';
17
17
  import React, { useState } from 'react';
18
18
  import { useInput, Box, Text, render } from 'ink';
@@ -6155,14 +6155,32 @@ function getToolOutputDelta(previous, next) {
6155
6155
  const overlap = findToolOutputOverlap(previous, next);
6156
6156
  return overlap > 0 ? next.slice(overlap) : next;
6157
6157
  }
6158
+ function shouldReplaceToolOutput(previous, next) {
6159
+ if (!previous || previous.length === 0) {
6160
+ return false;
6161
+ }
6162
+ if (next.startsWith(previous)) {
6163
+ return false;
6164
+ }
6165
+ const previousWithoutTrailingNewlines = previous.replace(/[\r\n]+$/g, "");
6166
+ if (previousWithoutTrailingNewlines.length === previous.length) {
6167
+ return false;
6168
+ }
6169
+ return next.startsWith(previousWithoutTrailingNewlines);
6170
+ }
6158
6171
  function appendToolOutput(existing, next) {
6159
- const preview = existing?.preview ?? new HeadTailPreviewBuffer(
6172
+ const shouldReplace = shouldReplaceToolOutput(existing?.lastRawText, next);
6173
+ const preview = shouldReplace || !existing?.preview ? new HeadTailPreviewBuffer(
6160
6174
  DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_HEAD_BYTES,
6161
6175
  DEFAULT_TOOL_CALL_OUTPUT_PREVIEW_TAIL_BYTES
6162
- );
6163
- const textToAppend = getToolOutputDelta(existing?.lastRawText, next);
6164
- if (textToAppend.length > 0) {
6165
- preview.append(textToAppend);
6176
+ ) : existing.preview;
6177
+ if (shouldReplace) {
6178
+ preview.append(next);
6179
+ } else {
6180
+ const textToAppend = getToolOutputDelta(existing?.lastRawText, next);
6181
+ if (textToAppend.length > 0) {
6182
+ preview.append(textToAppend);
6183
+ }
6166
6184
  }
6167
6185
  return {
6168
6186
  preview,
@@ -8656,6 +8674,7 @@ const CODEX_HOME_SEED_FILES = [
8656
8674
  const CODEX_HOME_SEED_DIRS = [
8657
8675
  "rules"
8658
8676
  ];
8677
+ const MAX_CODEX_SKILL_DESCRIPTION_LENGTH = 1024;
8659
8678
  function getCodexPlatformTarget(platform, arch) {
8660
8679
  if (platform === "win32" && arch === "x64") {
8661
8680
  return {
@@ -8827,6 +8846,60 @@ function copyCodexHomeEntry(sourcePath, destPath) {
8827
8846
  verbatimSymlinks: true
8828
8847
  });
8829
8848
  }
8849
+ function extractSkillDescriptionFromFrontmatter(frontmatter) {
8850
+ const lines = frontmatter.split(/\r?\n/);
8851
+ for (let index = 0; index < lines.length; index++) {
8852
+ const line = lines[index];
8853
+ const match = /^description:\s*(.*)$/.exec(line);
8854
+ if (!match) {
8855
+ continue;
8856
+ }
8857
+ const remainder = match[1]?.trim() ?? "";
8858
+ if (!remainder || remainder === "|" || remainder === ">") {
8859
+ const descriptionLines = [];
8860
+ for (let offset = index + 1; offset < lines.length; offset++) {
8861
+ const descriptionLine = lines[offset] ?? "";
8862
+ if (descriptionLine.length > 0 && !/^\s/.test(descriptionLine)) {
8863
+ break;
8864
+ }
8865
+ descriptionLines.push(descriptionLine.replace(/^\s{2}/, ""));
8866
+ }
8867
+ return descriptionLines.join("\n").trim();
8868
+ }
8869
+ return remainder.replace(/^['"]|['"]$/g, "").trim();
8870
+ }
8871
+ return null;
8872
+ }
8873
+ function extractSkillDescription(skillManifestPath) {
8874
+ const manifest = readFileSync(skillManifestPath, "utf8");
8875
+ const frontmatterMatch = /^---\r?\n([\s\S]*?)\r?\n---(?:\r?\n|$)/.exec(manifest);
8876
+ const frontmatter = frontmatterMatch?.[1];
8877
+ if (!frontmatter) {
8878
+ return null;
8879
+ }
8880
+ return extractSkillDescriptionFromFrontmatter(frontmatter);
8881
+ }
8882
+ function shouldSeedCodexSkillEntry(sourcePath) {
8883
+ if (basename(sourcePath) === ".system") {
8884
+ return true;
8885
+ }
8886
+ const manifestPath = join(sourcePath, "SKILL.md");
8887
+ if (!existsSync(manifestPath)) {
8888
+ return true;
8889
+ }
8890
+ try {
8891
+ const description = extractSkillDescription(manifestPath);
8892
+ if (description && description.length > MAX_CODEX_SKILL_DESCRIPTION_LENGTH) {
8893
+ logger.debug(
8894
+ `[codex] Skipping CODEX_HOME skill entry ${sourcePath} because its description exceeds ${MAX_CODEX_SKILL_DESCRIPTION_LENGTH} characters`
8895
+ );
8896
+ return false;
8897
+ }
8898
+ } catch (error) {
8899
+ logger.debug(`[codex] Failed to inspect CODEX_HOME skill entry ${sourcePath}`, error);
8900
+ }
8901
+ return true;
8902
+ }
8830
8903
  function seedIsolatedCodexHome(sourceHomeDir, isolatedHomeDir) {
8831
8904
  if (!existsSync(sourceHomeDir)) {
8832
8905
  return;
@@ -8852,9 +8925,13 @@ function seedIsolatedCodexHome(sourceHomeDir, isolatedHomeDir) {
8852
8925
  const destSkillsDir = join(isolatedHomeDir, "skills");
8853
8926
  mkdirSync$1(destSkillsDir, { recursive: true });
8854
8927
  for (const entryName of readdirSync(sourceSkillsDir)) {
8928
+ const sourceEntryPath = join(sourceSkillsDir, entryName);
8929
+ if (!shouldSeedCodexSkillEntry(sourceEntryPath)) {
8930
+ continue;
8931
+ }
8855
8932
  try {
8856
8933
  copyCodexHomeEntry(
8857
- join(sourceSkillsDir, entryName),
8934
+ sourceEntryPath,
8858
8935
  join(destSkillsDir, entryName)
8859
8936
  );
8860
8937
  } catch (error) {
@@ -9676,6 +9753,7 @@ function normalizeClaudeToolResultContent(value) {
9676
9753
  function createTimeoutError(timeoutMs) {
9677
9754
  return new Error(`Claude response did not complete within ${timeoutMs}ms`);
9678
9755
  }
9756
+ const CLAUDE_RESPONSE_PROGRESS_POLL_MS = 1e3;
9679
9757
  function normalizePermissionResult(input, decision) {
9680
9758
  if (decision === "approved" || decision === "approved_for_session") {
9681
9759
  return {
@@ -9707,6 +9785,7 @@ class ClaudeCodeBackend {
9707
9785
  consumeTask = null;
9708
9786
  activeResponse = null;
9709
9787
  responseCompletionOutcome = null;
9788
+ responseLastProgressAt = null;
9710
9789
  disposed = false;
9711
9790
  lastStatus = null;
9712
9791
  onMessage(handler) {
@@ -9731,6 +9810,7 @@ class ClaudeCodeBackend {
9731
9810
  await this.ensureQueryStarted();
9732
9811
  this.responseCompletionOutcome = null;
9733
9812
  this.activeResponse = new Future();
9813
+ this.responseLastProgressAt = Date.now();
9734
9814
  void this.activeResponse.promise.catch(() => {
9735
9815
  });
9736
9816
  this.emitStatus("running");
@@ -9763,18 +9843,25 @@ class ClaudeCodeBackend {
9763
9843
  if (!this.activeResponse) {
9764
9844
  return;
9765
9845
  }
9766
- let timeoutHandle;
9767
- try {
9846
+ while (this.activeResponse) {
9847
+ const elapsedSinceProgress = Date.now() - (this.responseLastProgressAt ?? Date.now());
9848
+ const remainingMs = timeoutMs - elapsedSinceProgress;
9849
+ if (remainingMs <= 0) {
9850
+ const timeoutError = createTimeoutError(timeoutMs);
9851
+ this.rejectActiveResponse(timeoutError);
9852
+ throw timeoutError;
9853
+ }
9768
9854
  await Promise.race([
9769
9855
  this.activeResponse.promise,
9770
- new Promise((_, reject) => {
9771
- timeoutHandle = setTimeout(() => reject(createTimeoutError(timeoutMs)), timeoutMs);
9856
+ new Promise((resolve2) => {
9857
+ setTimeout(resolve2, Math.min(CLAUDE_RESPONSE_PROGRESS_POLL_MS, remainingMs));
9772
9858
  })
9773
9859
  ]);
9774
- } finally {
9775
- if (timeoutHandle) {
9776
- clearTimeout(timeoutHandle);
9777
- }
9860
+ }
9861
+ const completionOutcome = this.responseCompletionOutcome;
9862
+ const rejectedError = completionOutcome && typeof completionOutcome === "object" && "error" in completionOutcome ? completionOutcome.error : null;
9863
+ if (rejectedError) {
9864
+ throw rejectedError;
9778
9865
  }
9779
9866
  }
9780
9867
  async dispose() {
@@ -9898,6 +9985,7 @@ class ClaudeCodeBackend {
9898
9985
  }
9899
9986
  }
9900
9987
  handleMessage(message) {
9988
+ this.markResponseProgress();
9901
9989
  switch (message.type) {
9902
9990
  case "system":
9903
9991
  this.handleSystemMessage(message);
@@ -10011,6 +10099,7 @@ class ClaudeCodeBackend {
10011
10099
  }
10012
10100
  resolveActiveResponse() {
10013
10101
  this.responseCompletionOutcome = { kind: "resolved" };
10102
+ this.responseLastProgressAt = null;
10014
10103
  if (!this.activeResponse) {
10015
10104
  return;
10016
10105
  }
@@ -10020,6 +10109,7 @@ class ClaudeCodeBackend {
10020
10109
  }
10021
10110
  rejectActiveResponse(error) {
10022
10111
  this.responseCompletionOutcome = { kind: "rejected", error };
10112
+ this.responseLastProgressAt = null;
10023
10113
  if (!this.activeResponse) {
10024
10114
  return;
10025
10115
  }
@@ -10027,6 +10117,12 @@ class ClaudeCodeBackend {
10027
10117
  this.activeResponse = null;
10028
10118
  active.reject(error);
10029
10119
  }
10120
+ markResponseProgress() {
10121
+ if (!this.activeResponse) {
10122
+ return;
10123
+ }
10124
+ this.responseLastProgressAt = Date.now();
10125
+ }
10030
10126
  }
10031
10127
 
10032
10128
  function mapToClaudeMode(mode) {
@@ -10332,11 +10428,11 @@ var launch = /*#__PURE__*/Object.freeze({
10332
10428
 
10333
10429
  const unifiedProviderExecutors = {
10334
10430
  claude: async (opts) => {
10335
- const { runClaude } = await import('./runClaude-BYVqYLc6.mjs');
10431
+ const { runClaude } = await import('./runClaude-DuzlOk3Z.mjs');
10336
10432
  await runClaude(opts.credentials, opts.claudeOptions ?? {});
10337
10433
  },
10338
10434
  codex: async (opts) => {
10339
- const { runCodex } = await import('./runCodex-x0k9hJyI.mjs');
10435
+ const { runCodex } = await import('./runCodex-CayUbEDE.mjs');
10340
10436
  await runCodex({
10341
10437
  credentials: opts.credentials,
10342
10438
  startedBy: opts.startedBy,
@@ -10345,7 +10441,7 @@ const unifiedProviderExecutors = {
10345
10441
  });
10346
10442
  },
10347
10443
  gemini: async (opts) => {
10348
- const { runGemini } = await import('./runGemini-B_bJyd4j.mjs');
10444
+ const { runGemini } = await import('./runGemini-EB-Mh7Ua.mjs');
10349
10445
  await runGemini({
10350
10446
  credentials: opts.credentials,
10351
10447
  startedBy: opts.startedBy
@@ -10428,7 +10524,7 @@ function shouldRunMainClaudeFlow(opts) {
10428
10524
  return;
10429
10525
  } else if (subcommand === "runtime") {
10430
10526
  if (args[1] === "providers") {
10431
- const { renderRuntimeProviders } = await import('./command-ykLmhw9O.mjs');
10527
+ const { renderRuntimeProviders } = await import('./command-BGK4qQ-4.mjs');
10432
10528
  console.log(renderRuntimeProviders());
10433
10529
  return;
10434
10530
  }
@@ -10617,8 +10713,8 @@ function shouldRunMainClaudeFlow(opts) {
10617
10713
  const projectId = args[3];
10618
10714
  try {
10619
10715
  const { saveGoogleCloudProjectToConfig } = await Promise.resolve().then(function () { return config; });
10620
- const { readCredentials: readCredentials2 } = await import('./persistence-D1rI_096.mjs');
10621
- const { ApiClient: ApiClient2 } = await import('./api-Cgyrs44K.mjs').then(function (n) { return n.w; });
10716
+ const { readCredentials: readCredentials2 } = await import('./persistence-vDMpMN8U.mjs');
10717
+ const { ApiClient: ApiClient2 } = await import('./api-CrGI5ANv.mjs').then(function (n) { return n.w; });
10622
10718
  let userEmail = void 0;
10623
10719
  try {
10624
10720
  const credentials = await readCredentials2();