replicas-engine 0.1.1030 → 0.1.1032

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.
package/dist/src/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  reportCommandProtectionBlock,
33
33
  resolveDiffBase,
34
34
  runGitCommand
35
- } from "./chunk-ADUHQPYR.js";
35
+ } from "./chunk-FMLTSHIC.js";
36
36
  import {
37
37
  ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
38
38
  AGENT_MESSAGE_DELTA_METHOD,
@@ -57,7 +57,7 @@ import {
57
57
  } from "./chunk-P73LGPQO.js";
58
58
  import {
59
59
  publishedPullRequestUrls
60
- } from "./chunk-ABUMJRPU.js";
60
+ } from "./chunk-ERFW4IL4.js";
61
61
  import {
62
62
  BaseRefreshManager,
63
63
  CodexAspAuthMethodChangedError,
@@ -71,7 +71,7 @@ import {
71
71
  refreshDelayMs,
72
72
  restartCodexAspHost,
73
73
  routineRefreshRequest
74
- } from "./chunk-27OEXGGC.js";
74
+ } from "./chunk-4LOZTMKD.js";
75
75
  import {
76
76
  ENGINE_ENV,
77
77
  monolithRequest,
@@ -79,16 +79,16 @@ import {
79
79
  readRuntimeEnvFile,
80
80
  reloadEngineEnv,
81
81
  setAgentCredentialSnapshot
82
- } from "./chunk-RVXD24D4.js";
82
+ } from "./chunk-EWPMMKGJ.js";
83
83
  import {
84
84
  AspClient,
85
85
  getCodexModelProvider
86
- } from "./chunk-NGZ6IR76.js";
86
+ } from "./chunk-7HXLO5LH.js";
87
87
  import {
88
88
  SUBPROCESS_MAX_BUFFER,
89
89
  execAsync,
90
90
  execFileAsync
91
- } from "./chunk-7PXLG7IJ.js";
91
+ } from "./chunk-JOX732WB.js";
92
92
  import {
93
93
  isRecord as isRecord2
94
94
  } from "./chunk-UZSNFLDQ.js";
@@ -214,6 +214,7 @@ import {
214
214
  decodePathSegments,
215
215
  defaultForkChatTitle,
216
216
  describeCredential,
217
+ describeMessageSteps,
217
218
  describeQuotaLimit,
218
219
  detectAgentQuotaLimit,
219
220
  detectEnvironmentAuthMethod,
@@ -233,7 +234,6 @@ import {
233
234
  getClaudeModelContextWindow,
234
235
  getDefaultAgentModel,
235
236
  getDefaultOllamaModel,
236
- getDisplayMessageActivity,
237
237
  getEventStreamId,
238
238
  getEventTimestampMs,
239
239
  getGitHubAccessToken,
@@ -258,6 +258,7 @@ import {
258
258
  isClaudeResultError,
259
259
  isClientMessageSource,
260
260
  isCodexAuthError,
261
+ isCompaction,
261
262
  isDefaultChat,
262
263
  isExcludedRepoFilePath,
263
264
  isGitHubUrl,
@@ -321,7 +322,7 @@ import {
321
322
  workspaceTokenRequestSchema,
322
323
  workspaceTokenResponseSchema,
323
324
  wrapInTag
324
- } from "./chunk-5HLMUJTJ.js";
325
+ } from "./chunk-AXT547FH.js";
325
326
  import {
326
327
  cloneMcpConfig,
327
328
  ensureCompatibilityImports,
@@ -908,9 +909,9 @@ var require_code2 = __commonJS({
908
909
  };
909
910
  exports.Name = Name;
910
911
  var _Code = class extends _CodeOrName {
911
- constructor(code) {
912
+ constructor(code2) {
912
913
  super();
913
- this._items = typeof code === "string" ? [code] : code;
914
+ this._items = typeof code2 === "string" ? [code2] : code2;
914
915
  }
915
916
  toString() {
916
917
  return this.str;
@@ -937,13 +938,13 @@ var require_code2 = __commonJS({
937
938
  exports._Code = _Code;
938
939
  exports.nil = new _Code("");
939
940
  function _(strs, ...args) {
940
- const code = [strs[0]];
941
+ const code2 = [strs[0]];
941
942
  let i = 0;
942
943
  while (i < args.length) {
943
- addCodeArg(code, args[i]);
944
- code.push(strs[++i]);
944
+ addCodeArg(code2, args[i]);
945
+ code2.push(strs[++i]);
945
946
  }
946
- return new _Code(code);
947
+ return new _Code(code2);
947
948
  }
948
949
  exports._ = _;
949
950
  var plus = new _Code("+");
@@ -959,13 +960,13 @@ var require_code2 = __commonJS({
959
960
  return new _Code(expr);
960
961
  }
961
962
  exports.str = str;
962
- function addCodeArg(code, arg) {
963
+ function addCodeArg(code2, arg) {
963
964
  if (arg instanceof _Code)
964
- code.push(...arg._items);
965
+ code2.push(...arg._items);
965
966
  else if (arg instanceof Name)
966
- code.push(arg);
967
+ code2.push(arg);
967
968
  else
968
- code.push(interpolate(arg));
969
+ code2.push(interpolate(arg));
969
970
  }
970
971
  exports.addCodeArg = addCodeArg;
971
972
  function optimize(expr) {
@@ -1149,7 +1150,7 @@ var require_scope2 = __commonJS({
1149
1150
  }, usedValues, getCode);
1150
1151
  }
1151
1152
  _reduceValues(values, valueCode, usedValues = {}, getCode) {
1152
- let code = code_1.nil;
1153
+ let code2 = code_1.nil;
1153
1154
  for (const prefix in values) {
1154
1155
  const vs = values[prefix];
1155
1156
  if (!vs)
@@ -1162,16 +1163,16 @@ var require_scope2 = __commonJS({
1162
1163
  let c = valueCode(name);
1163
1164
  if (c) {
1164
1165
  const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
1165
- code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`;
1166
+ code2 = (0, code_1._)`${code2}${def} ${name} = ${c};${this.opts._n}`;
1166
1167
  } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) {
1167
- code = (0, code_1._)`${code}${c}${this.opts._n}`;
1168
+ code2 = (0, code_1._)`${code2}${c}${this.opts._n}`;
1168
1169
  } else {
1169
1170
  throw new ValueError(name);
1170
1171
  }
1171
1172
  nameSet.set(name, UsedValueState.Completed);
1172
1173
  });
1173
1174
  }
1174
- return code;
1175
+ return code2;
1175
1176
  }
1176
1177
  };
1177
1178
  exports.ValueScope = ValueScope;
@@ -1331,9 +1332,9 @@ var require_codegen2 = __commonJS({
1331
1332
  }
1332
1333
  };
1333
1334
  var AnyCode = class extends Node {
1334
- constructor(code) {
1335
+ constructor(code2) {
1335
1336
  super();
1336
- this.code = code;
1337
+ this.code = code2;
1337
1338
  }
1338
1339
  render({ _n }) {
1339
1340
  return `${this.code};` + _n;
@@ -1355,7 +1356,7 @@ var require_codegen2 = __commonJS({
1355
1356
  this.nodes = nodes;
1356
1357
  }
1357
1358
  render(opts) {
1358
- return this.nodes.reduce((code, n) => code + n.render(opts), "");
1359
+ return this.nodes.reduce((code2, n) => code2 + n.render(opts), "");
1359
1360
  }
1360
1361
  optimizeNodes() {
1361
1362
  const { nodes } = this;
@@ -1403,10 +1404,10 @@ var require_codegen2 = __commonJS({
1403
1404
  this.condition = condition;
1404
1405
  }
1405
1406
  render(opts) {
1406
- let code = `if(${this.condition})` + super.render(opts);
1407
+ let code2 = `if(${this.condition})` + super.render(opts);
1407
1408
  if (this.else)
1408
- code += "else " + this.else.render(opts);
1409
- return code;
1409
+ code2 += "else " + this.else.render(opts);
1410
+ return code2;
1410
1411
  }
1411
1412
  optimizeNodes() {
1412
1413
  super.optimizeNodes();
@@ -1527,12 +1528,12 @@ var require_codegen2 = __commonJS({
1527
1528
  Return.kind = "return";
1528
1529
  var Try = class extends BlockNode {
1529
1530
  render(opts) {
1530
- let code = "try" + super.render(opts);
1531
+ let code2 = "try" + super.render(opts);
1531
1532
  if (this.catch)
1532
- code += this.catch.render(opts);
1533
+ code2 += this.catch.render(opts);
1533
1534
  if (this.finally)
1534
- code += this.finally.render(opts);
1535
- return code;
1535
+ code2 += this.finally.render(opts);
1536
+ return code2;
1536
1537
  }
1537
1538
  optimizeNodes() {
1538
1539
  var _a, _b;
@@ -1649,18 +1650,18 @@ var require_codegen2 = __commonJS({
1649
1650
  }
1650
1651
  // returns code for object literal for the passed argument list of key-value pairs
1651
1652
  object(...keyValues) {
1652
- const code = ["{"];
1653
+ const code2 = ["{"];
1653
1654
  for (const [key, value] of keyValues) {
1654
- if (code.length > 1)
1655
- code.push(",");
1656
- code.push(key);
1655
+ if (code2.length > 1)
1656
+ code2.push(",");
1657
+ code2.push(key);
1657
1658
  if (key !== value || this.opts.es5) {
1658
- code.push(":");
1659
- (0, code_1.addCodeArg)(code, value);
1659
+ code2.push(":");
1660
+ (0, code_1.addCodeArg)(code2, value);
1660
1661
  }
1661
1662
  }
1662
- code.push("}");
1663
- return new code_1._Code(code);
1663
+ code2.push("}");
1664
+ return new code_1._Code(code2);
1664
1665
  }
1665
1666
  // `if` clause (or statement if `thenBody` and, optionally, `elseBody` are passed)
1666
1667
  if(condition, thenBody, elseBody) {
@@ -3960,22 +3961,22 @@ var require_utils2 = __commonJS({
3960
3961
  var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
3961
3962
  function stringArrayToHexStripped(input) {
3962
3963
  let acc = "";
3963
- let code = 0;
3964
+ let code2 = 0;
3964
3965
  let i = 0;
3965
3966
  for (i = 0; i < input.length; i++) {
3966
- code = input[i].charCodeAt(0);
3967
- if (code === 48) {
3967
+ code2 = input[i].charCodeAt(0);
3968
+ if (code2 === 48) {
3968
3969
  continue;
3969
3970
  }
3970
- if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
3971
+ if (!(code2 >= 48 && code2 <= 57 || code2 >= 65 && code2 <= 70 || code2 >= 97 && code2 <= 102)) {
3971
3972
  return "";
3972
3973
  }
3973
3974
  acc += input[i];
3974
3975
  break;
3975
3976
  }
3976
3977
  for (i += 1; i < input.length; i++) {
3977
- code = input[i].charCodeAt(0);
3978
- if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
3978
+ code2 = input[i].charCodeAt(0);
3979
+ if (!(code2 >= 48 && code2 <= 57 || code2 >= 65 && code2 <= 70 || code2 >= 97 && code2 <= 102)) {
3979
3980
  return "";
3980
3981
  }
3981
3982
  acc += input[i];
@@ -6994,8 +6995,8 @@ var require_format2 = __commonJS({
6994
6995
  }
6995
6996
  }
6996
6997
  function getFormat(fmtDef) {
6997
- const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
6998
- const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code });
6998
+ const code2 = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
6999
+ const fmt = gen.scopeValue("formats", { key: schema, ref: fmtDef, code: code2 });
6999
7000
  if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) {
7000
7001
  return [fmtDef.type || "string", fmtDef.validate, (0, codegen_1._)`${fmt}.validate`];
7001
7002
  }
@@ -9067,8 +9068,8 @@ Binary files /dev/null and ${quote(`b/${path7}`)} differ
9067
9068
  child.stderr.on("data", () => {
9068
9069
  });
9069
9070
  child.on("error", () => resolve7(""));
9070
- child.on("close", (code) => {
9071
- if (code === 0 || code === 1 || truncated) {
9071
+ child.on("close", (code2) => {
9072
+ if (code2 === 0 || code2 === 1 || truncated) {
9072
9073
  resolve7(Buffer.concat(chunks).toString("utf-8"));
9073
9074
  } else {
9074
9075
  resolve7("");
@@ -10659,9 +10660,9 @@ var ReplicasConfigService = class {
10659
10660
  };
10660
10661
  proc.stdout.on("data", (data) => handleData(data, "stdout"));
10661
10662
  proc.stderr.on("data", (data) => handleData(data, "stderr"));
10662
- proc.on("close", (code) => {
10663
+ proc.on("close", (code2) => {
10663
10664
  clearTimeout(timer);
10664
- const exitCode = bufferExceeded ? 1 : code ?? 1;
10665
+ const exitCode = bufferExceeded ? 1 : code2 ?? 1;
10665
10666
  if (exitCode !== 0) {
10666
10667
  const reason = timedOut ? "timed out" : `exited with code ${exitCode}`;
10667
10668
  const message = `[ERROR] ${params.label} failed: ${reason}
@@ -16566,8 +16567,8 @@ var CURSOR_AUTH_ERROR_CODES = [
16566
16567
  "bad_user_api_key"
16567
16568
  ];
16568
16569
  var CURSOR_AUTH_ERROR_TEXT_PATTERN = new RegExp(`\\berror_(${CURSOR_AUTH_ERROR_CODES.join("|")})\\b`);
16569
- function isCursorAuthenticationError(code, text) {
16570
- return CURSOR_AUTH_ERROR_CODES.includes(code?.toLowerCase().replace(/^error_/, "") ?? "") || CURSOR_AUTH_ERROR_TEXT_PATTERN.test(text.toLowerCase());
16570
+ function isCursorAuthenticationError(code2, text) {
16571
+ return CURSOR_AUTH_ERROR_CODES.includes(code2?.toLowerCase().replace(/^error_/, "") ?? "") || CURSOR_AUTH_ERROR_TEXT_PATTERN.test(text.toLowerCase());
16571
16572
  }
16572
16573
  function finiteNumber(value) {
16573
16574
  return typeof value === "number" && Number.isFinite(value) ? value : 0;
@@ -16837,14 +16838,14 @@ var CursorManager = class extends CodingAgentManager {
16837
16838
  } catch (error) {
16838
16839
  await this.cancelRun(run);
16839
16840
  const text = extractErrorText(error) || "Cursor run failed";
16840
- const code = error instanceof CursorSdkError ? error.code : void 0;
16841
+ const code2 = error instanceof CursorSdkError ? error.code : void 0;
16841
16842
  failure = {
16842
16843
  text,
16843
- ...code ? { code } : {},
16844
+ ...code2 ? { code: code2 } : {},
16844
16845
  ...run ? { runId: run.id } : {},
16845
16846
  ...run?.requestId ? { requestId: run.requestId } : {},
16846
16847
  transport: isCursorTransportError(text),
16847
- authentication: error instanceof AuthenticationError || isCursorAuthenticationError(code, text)
16848
+ authentication: error instanceof AuthenticationError || isCursorAuthenticationError(code2, text)
16848
16849
  };
16849
16850
  }
16850
16851
  if (agent && sawCursorActivity) await this.retainThread(agent.agentId);
@@ -17055,9 +17056,9 @@ var MuseManager = class extends CodingAgentManager {
17055
17056
  });
17056
17057
  child.stderr.on("data", (chunk) => console.error("[muse MSP]", chunk.toString().trimEnd()));
17057
17058
  child.on("error", (error) => this.handleProcessExit(child, error));
17058
- child.on("exit", (code, signal) => this.handleProcessExit(
17059
+ child.on("exit", (code2, signal) => this.handleProcessExit(
17059
17060
  child,
17060
- new Error(`Muse MSP exited with code ${code ?? signal}`)
17061
+ new Error(`Muse MSP exited with code ${code2 ?? signal}`)
17061
17062
  ));
17062
17063
  await this.request("initialize", { clientInfo: { name: "replicas", version: "1" } });
17063
17064
  this.notify("initialized");
@@ -17703,12 +17704,12 @@ function opencodeErrorMessage(error) {
17703
17704
  }
17704
17705
  function opencodeErrorPayload(error) {
17705
17706
  const message = opencodeErrorMessage(error) ?? String(error);
17706
- const code = typeof error === "object" && error !== null && "code" in error && typeof error.code === "string" ? error.code : void 0;
17707
+ const code2 = typeof error === "object" && error !== null && "code" in error && typeof error.code === "string" ? error.code : void 0;
17707
17708
  const cause = error instanceof Error && isRecord2(error.cause) ? error.cause : null;
17708
17709
  const status = typeof cause?.status === "number" ? cause.status : void 0;
17709
17710
  return {
17710
- message: code === "ENOENT" ? `Failed to start Opencode server binary (${message}).` : message,
17711
- ...code ? { code } : {},
17711
+ message: code2 === "ENOENT" ? `Failed to start Opencode server binary (${message}).` : message,
17712
+ ...code2 ? { code: code2 } : {},
17712
17713
  ...status !== void 0 ? { status } : {}
17713
17714
  };
17714
17715
  }
@@ -24203,9 +24204,9 @@ var OAuthError = class OAuthError2 extends Error {
24203
24204
  if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
24204
24205
  return brandedHasInstance(this, value);
24205
24206
  }
24206
- constructor(code, message, errorUri) {
24207
+ constructor(code2, message, errorUri) {
24207
24208
  super(message);
24208
- this.code = code;
24209
+ this.code = code2;
24209
24210
  this.errorUri = errorUri;
24210
24211
  this.name = "OAuthError";
24211
24212
  stampErrorBrands(this, new.target);
@@ -24270,9 +24271,9 @@ var SdkError = class extends Error {
24270
24271
  if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
24271
24272
  return brandedHasInstance(this, value);
24272
24273
  }
24273
- constructor(code, message, data) {
24274
+ constructor(code2, message, data) {
24274
24275
  super(message);
24275
- this.code = code;
24276
+ this.code = code2;
24276
24277
  this.data = data;
24277
24278
  this.name = "SdkError";
24278
24279
  stampErrorBrands(this, new.target);
@@ -24282,8 +24283,8 @@ var SdkHttpError = class extends SdkError {
24282
24283
  static {
24283
24284
  Object.defineProperty(this, "mcpBrand", { value: "mcp.SdkHttpError" });
24284
24285
  }
24285
- constructor(code, message, data) {
24286
- super(code, message, data);
24286
+ constructor(code2, message, data) {
24287
+ super(code2, message, data);
24287
24288
  this.name = "SdkHttpError";
24288
24289
  }
24289
24290
  get status() {
@@ -25489,7 +25490,7 @@ var rev2025Codec = {
25489
25490
  } : t)
25490
25491
  };
25491
25492
  },
25492
- encodeErrorCode: (code) => code === -32002 ? -32602 : code,
25493
+ encodeErrorCode: (code2) => code2 === -32002 ? -32602 : code2,
25493
25494
  checkInboundEnvelope: (_material) => void 0
25494
25495
  };
25495
25496
  function build() {
@@ -26421,9 +26422,9 @@ var ProtocolError = class ProtocolError2 extends Error {
26421
26422
  if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
26422
26423
  return brandedHasInstance(this, value);
26423
26424
  }
26424
- constructor(code, message, data) {
26425
+ constructor(code2, message, data) {
26425
26426
  super(message);
26426
- this.code = code;
26427
+ this.code = code2;
26427
26428
  this.data = data;
26428
26429
  this.name = "ProtocolError";
26429
26430
  stampErrorBrands(this, new.target);
@@ -26431,27 +26432,27 @@ var ProtocolError = class ProtocolError2 extends Error {
26431
26432
  /**
26432
26433
  * Factory method to create the appropriate error type based on the error code and data
26433
26434
  */
26434
- static fromError(code, message, data) {
26435
- if (code === ProtocolErrorCode.UrlElicitationRequired && data) {
26435
+ static fromError(code2, message, data) {
26436
+ if (code2 === ProtocolErrorCode.UrlElicitationRequired && data) {
26436
26437
  const errorData = data;
26437
26438
  if (errorData.elicitations) return new UrlElicitationRequiredError(errorData.elicitations, message);
26438
26439
  }
26439
- if (code === ProtocolErrorCode.UnsupportedProtocolVersion && data) {
26440
+ if (code2 === ProtocolErrorCode.UnsupportedProtocolVersion && data) {
26440
26441
  const errorData = data;
26441
26442
  if (Array.isArray(errorData.supported) && typeof errorData.requested === "string") return new UnsupportedProtocolVersionError({
26442
26443
  supported: errorData.supported,
26443
26444
  requested: errorData.requested
26444
26445
  }, message);
26445
26446
  }
26446
- if (code === ProtocolErrorCode.InvalidParams || code === ProtocolErrorCode.ResourceNotFound) {
26447
+ if (code2 === ProtocolErrorCode.InvalidParams || code2 === ProtocolErrorCode.ResourceNotFound) {
26447
26448
  const errorData = data;
26448
- if (typeof errorData?.uri === "string" && (code === ProtocolErrorCode.ResourceNotFound || Object.keys(errorData).length === 1)) return new ResourceNotFoundError(errorData.uri, message);
26449
+ if (typeof errorData?.uri === "string" && (code2 === ProtocolErrorCode.ResourceNotFound || Object.keys(errorData).length === 1)) return new ResourceNotFoundError(errorData.uri, message);
26449
26450
  }
26450
- if (code === ProtocolErrorCode.MissingRequiredClientCapability && data) {
26451
+ if (code2 === ProtocolErrorCode.MissingRequiredClientCapability && data) {
26451
26452
  const errorData = data;
26452
26453
  if (errorData.requiredCapabilities !== null && typeof errorData.requiredCapabilities === "object" && !Array.isArray(errorData.requiredCapabilities)) return new MissingRequiredClientCapabilityError({ requiredCapabilities: errorData.requiredCapabilities }, message);
26453
26454
  }
26454
- return new ProtocolError2(code, message, data);
26455
+ return new ProtocolError2(code2, message, data);
26455
26456
  }
26456
26457
  };
26457
26458
  var ResourceNotFoundError = class extends ProtocolError {
@@ -26807,7 +26808,7 @@ var rev2026Codec = {
26807
26808
  encodeResult(method, result, serverInfo) {
26808
26809
  return stampServerInfoMeta(fillCacheFields(method, stampResultType(method, enforceDeletedFields(method, result))), serverInfo);
26809
26810
  },
26810
- encodeErrorCode: (code) => code === -32002 ? -32602 : code,
26811
+ encodeErrorCode: (code2) => code2 === -32002 ? -32602 : code2,
26811
26812
  checkInboundEnvelope(material) {
26812
26813
  if (material.envelope === void 0) return "Request is missing the required _meta envelope for protocol revision 2026-07-28 (io.modelcontextprotocol/protocolVersion, io.modelcontextprotocol/clientCapabilities)";
26813
26814
  const parsed = buildSchemas2026().RequestMetaEnvelopeSchema.safeParse(material.envelope);
@@ -28122,12 +28123,12 @@ var Protocol = class {
28122
28123
  return;
28123
28124
  }
28124
28125
  const capturedTransport = this._transport;
28125
- const sendErrorResponse = (code, message, data) => {
28126
+ const sendErrorResponse = (code2, message, data) => {
28126
28127
  const errorResponse = {
28127
28128
  jsonrpc: "2.0",
28128
28129
  id: request.id,
28129
28130
  error: {
28130
- code,
28131
+ code: code2,
28131
28132
  message,
28132
28133
  ...data !== void 0 && { data }
28133
28134
  }
@@ -28846,9 +28847,9 @@ var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
28846
28847
  };
28847
28848
  exports.Name = Name;
28848
28849
  var _Code = class extends _CodeOrName {
28849
- constructor(code) {
28850
+ constructor(code2) {
28850
28851
  super();
28851
- this._items = typeof code === "string" ? [code] : code;
28852
+ this._items = typeof code2 === "string" ? [code2] : code2;
28852
28853
  }
28853
28854
  toString() {
28854
28855
  return this.str;
@@ -28873,13 +28874,13 @@ var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
28873
28874
  exports._Code = _Code;
28874
28875
  exports.nil = new _Code("");
28875
28876
  function _(strs, ...args) {
28876
- const code = [strs[0]];
28877
+ const code2 = [strs[0]];
28877
28878
  let i = 0;
28878
28879
  while (i < args.length) {
28879
- addCodeArg(code, args[i]);
28880
- code.push(strs[++i]);
28880
+ addCodeArg(code2, args[i]);
28881
+ code2.push(strs[++i]);
28881
28882
  }
28882
- return new _Code(code);
28883
+ return new _Code(code2);
28883
28884
  }
28884
28885
  exports._ = _;
28885
28886
  const plus = new _Code("+");
@@ -28895,10 +28896,10 @@ var require_code$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
28895
28896
  return new _Code(expr);
28896
28897
  }
28897
28898
  exports.str = str;
28898
- function addCodeArg(code, arg) {
28899
- if (arg instanceof _Code) code.push(...arg._items);
28900
- else if (arg instanceof Name) code.push(arg);
28901
- else code.push(interpolate(arg));
28899
+ function addCodeArg(code2, arg) {
28900
+ if (arg instanceof _Code) code2.push(...arg._items);
28901
+ else if (arg instanceof Name) code2.push(arg);
28902
+ else code2.push(interpolate(arg));
28902
28903
  }
28903
28904
  exports.addCodeArg = addCodeArg;
28904
28905
  function optimize(expr) {
@@ -29068,7 +29069,7 @@ var require_scope = /* @__PURE__ */ __commonJSMin(((exports) => {
29068
29069
  }, usedValues, getCode);
29069
29070
  }
29070
29071
  _reduceValues(values, valueCode, usedValues = {}, getCode) {
29071
- let code = code_1.nil;
29072
+ let code2 = code_1.nil;
29072
29073
  for (const prefix in values) {
29073
29074
  const vs = values[prefix];
29074
29075
  if (!vs) continue;
@@ -29079,13 +29080,13 @@ var require_scope = /* @__PURE__ */ __commonJSMin(((exports) => {
29079
29080
  let c = valueCode(name);
29080
29081
  if (c) {
29081
29082
  const def = this.opts.es5 ? exports.varKinds.var : exports.varKinds.const;
29082
- code = (0, code_1._)`${code}${def} ${name} = ${c};${this.opts._n}`;
29083
- } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) code = (0, code_1._)`${code}${c}${this.opts._n}`;
29083
+ code2 = (0, code_1._)`${code2}${def} ${name} = ${c};${this.opts._n}`;
29084
+ } else if (c = getCode === null || getCode === void 0 ? void 0 : getCode(name)) code2 = (0, code_1._)`${code2}${c}${this.opts._n}`;
29084
29085
  else throw new ValueError(name);
29085
29086
  nameSet.set(name, UsedValueState.Completed);
29086
29087
  });
29087
29088
  }
29088
- return code;
29089
+ return code2;
29089
29090
  }
29090
29091
  };
29091
29092
  exports.ValueScope = ValueScope;
@@ -29271,9 +29272,9 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
29271
29272
  }
29272
29273
  };
29273
29274
  var AnyCode = class extends Node {
29274
- constructor(code) {
29275
+ constructor(code2) {
29275
29276
  super();
29276
- this.code = code;
29277
+ this.code = code2;
29277
29278
  }
29278
29279
  render({ _n }) {
29279
29280
  return `${this.code};` + _n;
@@ -29295,7 +29296,7 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
29295
29296
  this.nodes = nodes;
29296
29297
  }
29297
29298
  render(opts) {
29298
- return this.nodes.reduce((code, n) => code + n.render(opts), "");
29299
+ return this.nodes.reduce((code2, n) => code2 + n.render(opts), "");
29299
29300
  }
29300
29301
  optimizeNodes() {
29301
29302
  const { nodes } = this;
@@ -29339,9 +29340,9 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
29339
29340
  this.condition = condition;
29340
29341
  }
29341
29342
  render(opts) {
29342
- let code = `if(${this.condition})` + super.render(opts);
29343
- if (this.else) code += "else " + this.else.render(opts);
29344
- return code;
29343
+ let code2 = `if(${this.condition})` + super.render(opts);
29344
+ if (this.else) code2 += "else " + this.else.render(opts);
29345
+ return code2;
29345
29346
  }
29346
29347
  optimizeNodes() {
29347
29348
  super.optimizeNodes();
@@ -29452,10 +29453,10 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
29452
29453
  Return.kind = "return";
29453
29454
  var Try = class extends BlockNode {
29454
29455
  render(opts) {
29455
- let code = "try" + super.render(opts);
29456
- if (this.catch) code += this.catch.render(opts);
29457
- if (this.finally) code += this.finally.render(opts);
29458
- return code;
29456
+ let code2 = "try" + super.render(opts);
29457
+ if (this.catch) code2 += this.catch.render(opts);
29458
+ if (this.finally) code2 += this.finally.render(opts);
29459
+ return code2;
29459
29460
  }
29460
29461
  optimizeNodes() {
29461
29462
  var _a, _b;
@@ -29557,17 +29558,17 @@ var require_codegen = /* @__PURE__ */ __commonJSMin(((exports) => {
29557
29558
  return this;
29558
29559
  }
29559
29560
  object(...keyValues) {
29560
- const code = ["{"];
29561
+ const code2 = ["{"];
29561
29562
  for (const [key, value] of keyValues) {
29562
- if (code.length > 1) code.push(",");
29563
- code.push(key);
29563
+ if (code2.length > 1) code2.push(",");
29564
+ code2.push(key);
29564
29565
  if (key !== value || this.opts.es5) {
29565
- code.push(":");
29566
- (0, code_1.addCodeArg)(code, value);
29566
+ code2.push(":");
29567
+ (0, code_1.addCodeArg)(code2, value);
29567
29568
  }
29568
29569
  }
29569
- code.push("}");
29570
- return new code_1._Code(code);
29570
+ code2.push("}");
29571
+ return new code_1._Code(code2);
29571
29572
  }
29572
29573
  if(condition, thenBody, elseBody) {
29573
29574
  this._blockNode(new If2(condition));
@@ -31504,18 +31505,18 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports, module) => {
31504
31505
  const isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
31505
31506
  function stringArrayToHexStripped(input) {
31506
31507
  let acc = "";
31507
- let code = 0;
31508
+ let code2 = 0;
31508
31509
  let i = 0;
31509
31510
  for (i = 0; i < input.length; i++) {
31510
- code = input[i].charCodeAt(0);
31511
- if (code === 48) continue;
31512
- if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) return "";
31511
+ code2 = input[i].charCodeAt(0);
31512
+ if (code2 === 48) continue;
31513
+ if (!(code2 >= 48 && code2 <= 57 || code2 >= 65 && code2 <= 70 || code2 >= 97 && code2 <= 102)) return "";
31513
31514
  acc += input[i];
31514
31515
  break;
31515
31516
  }
31516
31517
  for (i += 1; i < input.length; i++) {
31517
- code = input[i].charCodeAt(0);
31518
- if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) return "";
31518
+ code2 = input[i].charCodeAt(0);
31519
+ if (!(code2 >= 48 && code2 <= 57 || code2 >= 65 && code2 <= 70 || code2 >= 97 && code2 <= 102)) return "";
31519
31520
  acc += input[i];
31520
31521
  }
31521
31522
  return acc;
@@ -33960,11 +33961,11 @@ var require_format$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
33960
33961
  }
33961
33962
  }
33962
33963
  function getFormat(fmtDef) {
33963
- const code = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
33964
+ const code2 = fmtDef instanceof RegExp ? (0, codegen_1.regexpCode)(fmtDef) : opts.code.formats ? (0, codegen_1._)`${opts.code.formats}${(0, codegen_1.getProperty)(schema)}` : void 0;
33964
33965
  const fmt = gen.scopeValue("formats", {
33965
33966
  key: schema,
33966
33967
  ref: fmtDef,
33967
- code
33968
+ code: code2
33968
33969
  });
33969
33970
  if (typeof fmtDef == "object" && !(fmtDef instanceof RegExp)) return [
33970
33971
  fmtDef.type || "string",
@@ -36309,10 +36310,10 @@ getRequestOptions_fn = function() {
36309
36310
  * @param code - The HTTP status code, if available
36310
36311
  * @internal
36311
36312
  */
36312
- failConnection_fn = function(message, code) {
36313
+ failConnection_fn = function(message, code2) {
36313
36314
  var _a;
36314
36315
  __privateGet(this, _readyState) !== this.CLOSED && __privateSet(this, _readyState, this.CLOSED);
36315
- const errorEvent = new ErrorEvent("error", { code, message });
36316
+ const errorEvent = new ErrorEvent("error", { code: code2, message });
36316
36317
  (_a = __privateGet(this, _onError)) == null || _a.call(this, errorEvent), this.dispatchEvent(errorEvent);
36317
36318
  }, /**
36318
36319
  * Schedules a reconnection attempt against the EventSource endpoint.
@@ -36321,12 +36322,12 @@ failConnection_fn = function(message, code) {
36321
36322
  * @param code - The HTTP status code, if available
36322
36323
  * @internal
36323
36324
  */
36324
- scheduleReconnect_fn = function(message, code) {
36325
+ scheduleReconnect_fn = function(message, code2) {
36325
36326
  var _a;
36326
36327
  if (__privateGet(this, _readyState) === this.CLOSED)
36327
36328
  return;
36328
36329
  __privateSet(this, _readyState, this.CONNECTING);
36329
- const errorEvent = new ErrorEvent("error", { code, message });
36330
+ const errorEvent = new ErrorEvent("error", { code: code2, message });
36330
36331
  (_a = __privateGet(this, _onError)) == null || _a.call(this, errorEvent), this.dispatchEvent(errorEvent), __privateSet(this, _reconnectTimer, setTimeout(__privateGet(this, _reconnect), __privateGet(this, _reconnectInterval)));
36331
36332
  }, _reconnect = /* @__PURE__ */ new WeakMap(), /**
36332
36333
  * ReadyState representing an EventSource currently trying to connect
@@ -36564,9 +36565,9 @@ async function resolveAuthorizationCallbackParams(codeOrParams, iss, provider, s
36564
36565
  iss
36565
36566
  };
36566
36567
  const issParam = codeOrParams.get("iss") ?? void 0;
36567
- const code = codeOrParams.get("code");
36568
- if (code) return {
36569
- authorizationCode: code,
36568
+ const code2 = codeOrParams.get("code");
36569
+ if (code2) return {
36570
+ authorizationCode: code2,
36570
36571
  iss: issParam
36571
36572
  };
36572
36573
  let metadata = (await provider.discoveryState?.())?.authorizationServerMetadata;
@@ -37678,8 +37679,8 @@ function classifyResult(result, context) {
37678
37679
  };
37679
37680
  }
37680
37681
  function classifyRpcError(outcome, context) {
37681
- const { code, message, data } = outcome;
37682
- if (code === UNSUPPORTED_PROTOCOL_VERSION) {
37682
+ const { code: code2, message, data } = outcome;
37683
+ if (code2 === UNSUPPORTED_PROTOCOL_VERSION) {
37683
37684
  const supported = parseSupportedList(data);
37684
37685
  if (supported === void 0) return { kind: "legacy" };
37685
37686
  const error = new UnsupportedProtocolVersionError({
@@ -37702,7 +37703,7 @@ function classifyRpcError(outcome, context) {
37702
37703
  error
37703
37704
  };
37704
37705
  }
37705
- if (NOT_PROBE_RECOGNIZED.has(code)) return { kind: "legacy" };
37706
+ if (NOT_PROBE_RECOGNIZED.has(code2)) return { kind: "legacy" };
37706
37707
  return { kind: "legacy" };
37707
37708
  }
37708
37709
  function classifyHttpError(outcome, context) {
@@ -37764,10 +37765,10 @@ function parseJsonRpcErrorBody(body) {
37764
37765
  if (typeof parsed !== "object" || parsed === null) return void 0;
37765
37766
  const error = parsed.error;
37766
37767
  if (typeof error !== "object" || error === null) return void 0;
37767
- const { code, message, data } = error;
37768
- if (typeof code !== "number") return void 0;
37768
+ const { code: code2, message, data } = error;
37769
+ if (typeof code2 !== "number") return void 0;
37769
37770
  return {
37770
- code,
37771
+ code: code2,
37771
37772
  message: typeof message === "string" ? message : "",
37772
37773
  data
37773
37774
  };
@@ -39497,9 +39498,9 @@ var SseError = class extends Error {
39497
39498
  if (typeof this !== "function") throw new TypeError("isInstance must be called on the class (e.g. `SdkError.isInstance(value)`); for callbacks use `v => SdkError.isInstance(v)`");
39498
39499
  return brandedHasInstance(this, value);
39499
39500
  }
39500
- constructor(code, message, event) {
39501
+ constructor(code2, message, event) {
39501
39502
  super(`SSE error: ${message}`);
39502
- this.code = code;
39503
+ this.code = code2;
39503
39504
  this.event = event;
39504
39505
  stampErrorBrands(this, new.target);
39505
39506
  }
@@ -43080,7 +43081,7 @@ function handleRequest(req, res) {
43080
43081
  res.end("Not found");
43081
43082
  return;
43082
43083
  }
43083
- const code = url3.searchParams.get("code");
43084
+ const code2 = url3.searchParams.get("code");
43084
43085
  const iss = url3.searchParams.get("iss");
43085
43086
  const state = url3.searchParams.get("state");
43086
43087
  const error = url3.searchParams.get("error");
@@ -43117,7 +43118,7 @@ function handleRequest(req, res) {
43117
43118
  res.end(htmlError(errorMsg));
43118
43119
  return;
43119
43120
  }
43120
- if (!code) {
43121
+ if (!code2) {
43121
43122
  res.writeHead(400, { "Content-Type": "text/html" });
43122
43123
  res.end(htmlError("No authorization code provided"));
43123
43124
  return;
@@ -43129,7 +43130,7 @@ function handleRequest(req, res) {
43129
43130
  }
43130
43131
  clearTimeout(pending.timeout);
43131
43132
  pendingAuths.delete(state);
43132
- pending.resolve({ code, ...iss !== null ? { iss } : {} });
43133
+ pending.resolve({ code: code2, ...iss !== null ? { iss } : {} });
43133
43134
  res.writeHead(200, { "Content-Type": "text/html" });
43134
43135
  res.end(htmlSuccess());
43135
43136
  }
@@ -43857,10 +43858,10 @@ function parseAuthorizationRedirectInput(input, expectedState) {
43857
43858
  if (expectedState && state !== expectedState) {
43858
43859
  throw new Error("OAuth state mismatch - potential CSRF attack");
43859
43860
  }
43860
- const code = params.get("code");
43861
- if (code) {
43861
+ const code2 = params.get("code");
43862
+ if (code2) {
43862
43863
  const iss = params.get("iss");
43863
- return { code, ...iss !== null ? { iss } : {} };
43864
+ return { code: code2, ...iss !== null ? { iss } : {} };
43864
43865
  }
43865
43866
  }
43866
43867
  if (/^[A-Za-z0-9._~+/=-]+$/.test(trimmed)) {
@@ -43928,7 +43929,7 @@ async function completeAuthFromInput(serverName, input, options = {}) {
43928
43929
  async function completeAuth(serverName, authorizationCode, options = {}) {
43929
43930
  const runtime = getRuntime(options);
43930
43931
  const runtimeState = getRuntimeState(runtime);
43931
- const { code, iss } = typeof authorizationCode === "string" ? { code: authorizationCode, iss: void 0 } : authorizationCode;
43932
+ const { code: code2, iss } = typeof authorizationCode === "string" ? { code: authorizationCode, iss: void 0 } : authorizationCode;
43932
43933
  const fallbackAuthStorageOptions = options.authStorageOptions ?? {};
43933
43934
  const signal = combineAbortSignals(runtime.signal, options.signal);
43934
43935
  throwIfAborted(signal);
@@ -43958,7 +43959,7 @@ async function completeAuth(serverName, authorizationCode, options = {}) {
43958
43959
  }
43959
43960
  const result = await abortable(auth(pendingAuth.authProvider, {
43960
43961
  serverUrl: pendingAuth.serverUrl,
43961
- authorizationCode: code,
43962
+ authorizationCode: code2,
43962
43963
  ...iss !== void 0 ? { iss } : {},
43963
43964
  ...pendingAuth.discovery
43964
43965
  }), signal);
@@ -45238,14 +45239,14 @@ async function invokeRequestHeadersCommand(config, envelope, signal) {
45238
45239
  failAfterKill("HTTP request headers command output exceeded 64 KiB");
45239
45240
  }
45240
45241
  });
45241
- child.on("close", (code) => {
45242
+ child.on("close", (code2) => {
45242
45243
  if (settled) return;
45243
45244
  if (trackingError) {
45244
45245
  failAfterKill(trackingError.message);
45245
45246
  return;
45246
45247
  }
45247
- if (code !== 0) {
45248
- failAfterKill(`HTTP request headers command exited with code ${code ?? "unknown"}`);
45248
+ if (code2 !== 0) {
45249
+ failAfterKill(`HTTP request headers command exited with code ${code2 ?? "unknown"}`);
45249
45250
  return;
45250
45251
  }
45251
45252
  let parsed;
@@ -57200,8 +57201,8 @@ function createMcpToolResultRenderer(renderOptions) {
57200
57201
  // ../node_modules/.bun/pi-mcp-adapter@2.32.1+04b0d7b0bc944965/node_modules/pi-mcp-adapter/error-signal.ts
57201
57202
  function toolErrorOverride(details) {
57202
57203
  if (details && typeof details === "object" && "error" in details) {
57203
- const code = details.error;
57204
- if (code === "tool_error" || code === "call_failed" || code === INPUT_REQUIRED_NEEDS_UI) {
57204
+ const code2 = details.error;
57205
+ if (code2 === "tool_error" || code2 === "call_failed" || code2 === INPUT_REQUIRED_NEEDS_UI) {
57205
57206
  return { isError: true };
57206
57207
  }
57207
57208
  }
@@ -57284,7 +57285,7 @@ function parseWorkerMessage(value) {
57284
57285
  }
57285
57286
  return null;
57286
57287
  }
57287
- async function runMcpScript(state, code, timeoutMs = DEFAULT_MCP_SCRIPT_TIMEOUT_MS, getPiTools, signal) {
57288
+ async function runMcpScript(state, code2, timeoutMs = DEFAULT_MCP_SCRIPT_TIMEOUT_MS, getPiTools, signal) {
57288
57289
  const resolvedTimeoutMs = Number.isFinite(timeoutMs) && timeoutMs > 0 ? Math.floor(timeoutMs) : DEFAULT_MCP_SCRIPT_TIMEOUT_MS;
57289
57290
  const output = [];
57290
57291
  const externalSignal = combineAbortSignals(state.owner?.signal, signal);
@@ -57392,7 +57393,7 @@ async function runMcpScript(state, code, timeoutMs = DEFAULT_MCP_SCRIPT_TIMEOUT_
57392
57393
  throw abortReasonError(externalSignal.reason);
57393
57394
  }
57394
57395
  worker = new Worker(new URL("./mcp-script-worker.mjs", import.meta.url), {
57395
- workerData: { code },
57396
+ workerData: { code: code2 },
57396
57397
  env: {},
57397
57398
  // The sandbox cannot open files, and the host always terminates this worker.
57398
57399
  // Disable Node's unmanaged FD bookkeeping, which emits false warnings when
@@ -57434,8 +57435,8 @@ async function runMcpScript(state, code, timeoutMs = DEFAULT_MCP_SCRIPT_TIMEOUT_
57434
57435
  })().catch(reject);
57435
57436
  });
57436
57437
  activeWorker.once("error", reject);
57437
- activeWorker.once("exit", (code2) => {
57438
- if (!completed && code2 !== 0) reject(new Error(`mcpScript worker exited with code ${code2}`));
57438
+ activeWorker.once("exit", (code3) => {
57439
+ if (!completed && code3 !== 0) reject(new Error(`mcpScript worker exited with code ${code3}`));
57439
57440
  });
57440
57441
  });
57441
57442
  const timeoutError = new McpScriptTimeoutError(resolvedTimeoutMs);
@@ -60636,24 +60637,31 @@ async function buildForkHandoff(input) {
60636
60637
 
60637
60638
  // src/services/chat/slack-activity-stream.ts
60638
60639
  var FLUSH_INTERVAL_MS = 3e3;
60639
- var MAX_ACTIVITY_LENGTH = 300;
60640
+ var MAX_ACTIVITY_LENGTH = 100;
60640
60641
  var MAX_DONE_ATTEMPTS = 3;
60641
60642
  var sendQueue = Promise.resolve();
60642
- var truncate = (text, max) => text.length > max ? `${text.slice(0, max - 1)}\u2026` : text;
60643
- var clean = (text) => truncate(text.replace(/\s+/g, " ").trim(), MAX_ACTIVITY_LENGTH);
60644
- function describeStep(message) {
60645
- const plan = planItemsFromMessage(message);
60646
- if (plan) {
60647
- const current = plan.find((item) => item.status === "in_progress");
60648
- return plan.length ? `Plan ${plan.filter((item) => item.status === "completed").length}/${plan.length}${current ? ` \xB7 ${current.text}` : ""}` : null;
60649
- }
60650
- if (message.type === "tool_call") {
60651
- const input = summarizeInput(message.input);
60652
- return input ? `${toolAction(message.tool)}: ${input}` : toolAction(message.tool);
60653
- }
60654
- const activity = getDisplayMessageActivity(message);
60655
- if (!activity || activity.kind === "error") return null;
60656
- return (activity.summary ? `${activity.title}: ${activity.summary}` : activity.title).trim().split("\n")[0];
60643
+ var clean = (text) => {
60644
+ const line = text.replace(/\s+/g, " ").trim();
60645
+ return line.length > MAX_ACTIVITY_LENGTH ? `${line.slice(0, MAX_ACTIVITY_LENGTH - 1)}\u2026` : line;
60646
+ };
60647
+ var code = (text) => `\`${clean(text).replace(/`/g, "'")}\``;
60648
+ function describeActivity(message) {
60649
+ if (message.type === "agent" || message.type === "reasoning" && !isCompaction(message)) {
60650
+ const heading = message.type === "reasoning" ? [...message.content.matchAll(/^\*\*(.+?)\*\*$/gm)].at(-1)?.[1] : void 0;
60651
+ const thought = clean((heading ?? message.content).replace(/\*\*/g, ""));
60652
+ return thought ? { thought } : null;
60653
+ }
60654
+ if (planItemsFromMessage(message) || message.type === "tool_call" && message.inputRequest) return null;
60655
+ const step = describeMessageSteps(message).at(-1);
60656
+ if (!step) return null;
60657
+ const target = step.target && (step.target.path?.split("/").pop() || step.target.text);
60658
+ return {
60659
+ step: [
60660
+ step.running ? step.live : step.done,
60661
+ target && (step.target?.plain ? clean(target) : code(target)),
60662
+ step.scope && `in ${code(step.scope)}`
60663
+ ].filter(Boolean).join(" ")
60664
+ };
60657
60665
  }
60658
60666
  var SlackActivityStream = class {
60659
60667
  constructor(turnId, provider) {
@@ -60701,18 +60709,12 @@ var SlackActivityStream = class {
60701
60709
  this.stopped = true;
60702
60710
  return true;
60703
60711
  }
60704
- let activity = {};
60712
+ let activity = null;
60705
60713
  if (!done) {
60706
60714
  if (!this.dirty) return true;
60707
60715
  this.dirty = false;
60708
- const messages = parseDisplayMessages(this.events, this.provider);
60709
- const thought = messages.map((message) => message.type === "agent" || message.type === "reasoning" ? message.content : "").findLast((text) => text.trim());
60710
- const step = messages.map(describeStep).findLast(Boolean);
60711
- activity = {
60712
- ...thought ? { thought: clean(thought) } : {},
60713
- ...step ? { step: clean(step) } : {}
60714
- };
60715
- if (!activity.thought && !activity.step || JSON.stringify(activity) === this.sent) return true;
60716
+ activity = parseDisplayMessages(this.events, this.provider).map(describeActivity).findLast(Boolean) ?? null;
60717
+ if (!activity || JSON.stringify(activity) === this.sent) return true;
60716
60718
  }
60717
60719
  this.attempted = true;
60718
60720
  const event = {
@@ -62952,11 +62954,11 @@ async function executeHookScriptStreaming(params) {
62952
62954
  };
62953
62955
  proc.stdout.on("data", handleData);
62954
62956
  proc.stderr.on("data", handleData);
62955
- proc.on("close", (code) => {
62957
+ proc.on("close", (code2) => {
62956
62958
  clearTimeout(timer);
62957
62959
  const output = [`$ ${params.label}`, ...outputParts].join("");
62958
62960
  resolve7({
62959
- exitCode: bufferExceeded ? 1 : code ?? 1,
62961
+ exitCode: bufferExceeded ? 1 : code2 ?? 1,
62960
62962
  output,
62961
62963
  timedOut: killed && !bufferExceeded
62962
62964
  });