@hasna/assistants 0.6.42 → 0.6.43

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/index.js CHANGED
@@ -12218,233 +12218,6 @@ var require_stack_utils = __commonJS((exports, module) => {
12218
12218
  var methodRe = /^(.*?) \[as (.*?)\]$/;
12219
12219
  module.exports = StackUtils;
12220
12220
  });
12221
-
12222
- // node_modules/.bun/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js
12223
- var require_react_jsx_runtime_development = __commonJS((exports) => {
12224
- var React10 = __toESM(require_react());
12225
- (function() {
12226
- function getComponentNameFromType(type) {
12227
- if (type == null)
12228
- return null;
12229
- if (typeof type === "function")
12230
- return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
12231
- if (typeof type === "string")
12232
- return type;
12233
- switch (type) {
12234
- case REACT_FRAGMENT_TYPE:
12235
- return "Fragment";
12236
- case REACT_PROFILER_TYPE:
12237
- return "Profiler";
12238
- case REACT_STRICT_MODE_TYPE:
12239
- return "StrictMode";
12240
- case REACT_SUSPENSE_TYPE:
12241
- return "Suspense";
12242
- case REACT_SUSPENSE_LIST_TYPE:
12243
- return "SuspenseList";
12244
- case REACT_ACTIVITY_TYPE:
12245
- return "Activity";
12246
- }
12247
- if (typeof type === "object")
12248
- switch (typeof type.tag === "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
12249
- case REACT_PORTAL_TYPE:
12250
- return "Portal";
12251
- case REACT_CONTEXT_TYPE:
12252
- return type.displayName || "Context";
12253
- case REACT_CONSUMER_TYPE:
12254
- return (type._context.displayName || "Context") + ".Consumer";
12255
- case REACT_FORWARD_REF_TYPE:
12256
- var innerType = type.render;
12257
- type = type.displayName;
12258
- type || (type = innerType.displayName || innerType.name || "", type = type !== "" ? "ForwardRef(" + type + ")" : "ForwardRef");
12259
- return type;
12260
- case REACT_MEMO_TYPE:
12261
- return innerType = type.displayName || null, innerType !== null ? innerType : getComponentNameFromType(type.type) || "Memo";
12262
- case REACT_LAZY_TYPE:
12263
- innerType = type._payload;
12264
- type = type._init;
12265
- try {
12266
- return getComponentNameFromType(type(innerType));
12267
- } catch (x) {}
12268
- }
12269
- return null;
12270
- }
12271
- function testStringCoercion(value) {
12272
- return "" + value;
12273
- }
12274
- function checkKeyStringCoercion(value) {
12275
- try {
12276
- testStringCoercion(value);
12277
- var JSCompiler_inline_result = false;
12278
- } catch (e) {
12279
- JSCompiler_inline_result = true;
12280
- }
12281
- if (JSCompiler_inline_result) {
12282
- JSCompiler_inline_result = console;
12283
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
12284
- var JSCompiler_inline_result$jscomp$0 = typeof Symbol === "function" && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
12285
- JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
12286
- return testStringCoercion(value);
12287
- }
12288
- }
12289
- function getTaskName(type) {
12290
- if (type === REACT_FRAGMENT_TYPE)
12291
- return "<>";
12292
- if (typeof type === "object" && type !== null && type.$$typeof === REACT_LAZY_TYPE)
12293
- return "<...>";
12294
- try {
12295
- var name = getComponentNameFromType(type);
12296
- return name ? "<" + name + ">" : "<...>";
12297
- } catch (x) {
12298
- return "<...>";
12299
- }
12300
- }
12301
- function getOwner() {
12302
- var dispatcher = ReactSharedInternals.A;
12303
- return dispatcher === null ? null : dispatcher.getOwner();
12304
- }
12305
- function UnknownOwner() {
12306
- return Error("react-stack-top-frame");
12307
- }
12308
- function hasValidKey(config) {
12309
- if (hasOwnProperty.call(config, "key")) {
12310
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
12311
- if (getter && getter.isReactWarning)
12312
- return false;
12313
- }
12314
- return config.key !== undefined;
12315
- }
12316
- function defineKeyPropWarningGetter(props, displayName) {
12317
- function warnAboutAccessingKey() {
12318
- specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
12319
- }
12320
- warnAboutAccessingKey.isReactWarning = true;
12321
- Object.defineProperty(props, "key", {
12322
- get: warnAboutAccessingKey,
12323
- configurable: true
12324
- });
12325
- }
12326
- function elementRefGetterWithDeprecationWarning() {
12327
- var componentName = getComponentNameFromType(this.type);
12328
- didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
12329
- componentName = this.props.ref;
12330
- return componentName !== undefined ? componentName : null;
12331
- }
12332
- function ReactElement(type, key, props, owner, debugStack, debugTask) {
12333
- var refProp = props.ref;
12334
- type = {
12335
- $$typeof: REACT_ELEMENT_TYPE,
12336
- type,
12337
- key,
12338
- props,
12339
- _owner: owner
12340
- };
12341
- (refProp !== undefined ? refProp : null) !== null ? Object.defineProperty(type, "ref", {
12342
- enumerable: false,
12343
- get: elementRefGetterWithDeprecationWarning
12344
- }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
12345
- type._store = {};
12346
- Object.defineProperty(type._store, "validated", {
12347
- configurable: false,
12348
- enumerable: false,
12349
- writable: true,
12350
- value: 0
12351
- });
12352
- Object.defineProperty(type, "_debugInfo", {
12353
- configurable: false,
12354
- enumerable: false,
12355
- writable: true,
12356
- value: null
12357
- });
12358
- Object.defineProperty(type, "_debugStack", {
12359
- configurable: false,
12360
- enumerable: false,
12361
- writable: true,
12362
- value: debugStack
12363
- });
12364
- Object.defineProperty(type, "_debugTask", {
12365
- configurable: false,
12366
- enumerable: false,
12367
- writable: true,
12368
- value: debugTask
12369
- });
12370
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
12371
- return type;
12372
- }
12373
- function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
12374
- var children = config.children;
12375
- if (children !== undefined)
12376
- if (isStaticChildren)
12377
- if (isArrayImpl(children)) {
12378
- for (isStaticChildren = 0;isStaticChildren < children.length; isStaticChildren++)
12379
- validateChildKeys(children[isStaticChildren]);
12380
- Object.freeze && Object.freeze(children);
12381
- } else
12382
- console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
12383
- else
12384
- validateChildKeys(children);
12385
- if (hasOwnProperty.call(config, "key")) {
12386
- children = getComponentNameFromType(type);
12387
- var keys = Object.keys(config).filter(function(k) {
12388
- return k !== "key";
12389
- });
12390
- isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
12391
- didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(`A props object containing a "key" prop is being spread into JSX:
12392
- let props = %s;
12393
- <%s {...props} />
12394
- React keys must be passed directly to JSX without using spread:
12395
- let props = %s;
12396
- <%s key={someKey} {...props} />`, isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = true);
12397
- }
12398
- children = null;
12399
- maybeKey !== undefined && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
12400
- hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
12401
- if ("key" in config) {
12402
- maybeKey = {};
12403
- for (var propName in config)
12404
- propName !== "key" && (maybeKey[propName] = config[propName]);
12405
- } else
12406
- maybeKey = config;
12407
- children && defineKeyPropWarningGetter(maybeKey, typeof type === "function" ? type.displayName || type.name || "Unknown" : type);
12408
- return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
12409
- }
12410
- function validateChildKeys(node) {
12411
- isValidElement(node) ? node._store && (node._store.validated = 1) : typeof node === "object" && node !== null && node.$$typeof === REACT_LAZY_TYPE && (node._payload.status === "fulfilled" ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
12412
- }
12413
- function isValidElement(object) {
12414
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
12415
- }
12416
- var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React10.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
12417
- return null;
12418
- };
12419
- React10 = {
12420
- react_stack_bottom_frame: function(callStackForError) {
12421
- return callStackForError();
12422
- }
12423
- };
12424
- var specialPropKeyWarningShown;
12425
- var didWarnAboutElementRef = {};
12426
- var unknownOwnerDebugStack = React10.react_stack_bottom_frame.bind(React10, UnknownOwner)();
12427
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
12428
- var didWarnAboutKeySpread = {};
12429
- exports.Fragment = REACT_FRAGMENT_TYPE;
12430
- exports.jsx = function(type, config, maybeKey) {
12431
- var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
12432
- return jsxDEVImpl(type, config, maybeKey, false, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
12433
- };
12434
- exports.jsxs = function(type, config, maybeKey) {
12435
- var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
12436
- return jsxDEVImpl(type, config, maybeKey, true, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
12437
- };
12438
- })();
12439
- });
12440
-
12441
- // node_modules/.bun/react@19.2.4/node_modules/react/jsx-runtime.js
12442
- var require_jsx_runtime = __commonJS((exports, module) => {
12443
- var react_jsx_runtime_development = __toESM(require_react_jsx_runtime_development());
12444
- if (false) {} else {
12445
- module.exports = react_jsx_runtime_development;
12446
- }
12447
- });
12448
12221
  // packages/shared/src/utils.ts
12449
12222
  import { randomUUID } from "crypto";
12450
12223
  function generateId() {
@@ -58510,8 +58283,8 @@ var init_BetaMessageStream = __esm(() => {
58510
58283
  runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } }));
58511
58284
  return runner;
58512
58285
  }
58513
- _run(executor) {
58514
- executor().then(() => {
58286
+ _run(executor2) {
58287
+ executor2().then(() => {
58515
58288
  this._emitFinal();
58516
58289
  this._emit("end");
58517
58290
  }, __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f"));
@@ -59774,8 +59547,8 @@ var init_MessageStream = __esm(() => {
59774
59547
  runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } }));
59775
59548
  return runner;
59776
59549
  }
59777
- _run(executor) {
59778
- executor().then(() => {
59550
+ _run(executor2) {
59551
+ executor2().then(() => {
59779
59552
  this._emitFinal();
59780
59553
  this._emit("end");
59781
59554
  }, __classPrivateFieldGet(this, _MessageStream_handleError, "f"));
@@ -87161,7 +86934,7 @@ var require_react_development2 = __commonJS((exports, module) => {
87161
86934
  }
87162
86935
  return ReactElement(element.type, key, ref, self2, source, owner, props);
87163
86936
  }
87164
- function isValidElement2(object) {
86937
+ function isValidElement(object) {
87165
86938
  return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
87166
86939
  }
87167
86940
  var SEPARATOR = ".";
@@ -87226,7 +86999,7 @@ var require_react_development2 = __commonJS((exports, module) => {
87226
86999
  return c5;
87227
87000
  });
87228
87001
  } else if (mappedChild != null) {
87229
- if (isValidElement2(mappedChild)) {
87002
+ if (isValidElement(mappedChild)) {
87230
87003
  {
87231
87004
  if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
87232
87005
  checkKeyStringCoercion(mappedChild.key);
@@ -87304,7 +87077,7 @@ var require_react_development2 = __commonJS((exports, module) => {
87304
87077
  }) || [];
87305
87078
  }
87306
87079
  function onlyChild(children) {
87307
- if (!isValidElement2(children)) {
87080
+ if (!isValidElement(children)) {
87308
87081
  throw new Error("React.Children.only expected to receive a single React element child.");
87309
87082
  }
87310
87083
  return children;
@@ -87494,7 +87267,7 @@ Your code should look like:
87494
87267
  }
87495
87268
  return lazyType;
87496
87269
  }
87497
- function forwardRef4(render3) {
87270
+ function forwardRef2(render3) {
87498
87271
  {
87499
87272
  if (render3 != null && render3.$$typeof === REACT_MEMO_TYPE) {
87500
87273
  error2("forwardRef requires a render function but received a `memo` " + "component. Instead of forwardRef(memo(...)), use " + "memo(forwardRef(...)).");
@@ -87607,7 +87380,7 @@ Your code should look like:
87607
87380
  }
87608
87381
  return dispatcher.useContext(Context);
87609
87382
  }
87610
- function useState4(initialState) {
87383
+ function useState2(initialState) {
87611
87384
  var dispatcher = resolveDispatcher();
87612
87385
  return dispatcher.useState(initialState);
87613
87386
  }
@@ -87615,7 +87388,7 @@ Your code should look like:
87615
87388
  var dispatcher = resolveDispatcher();
87616
87389
  return dispatcher.useReducer(reducer, initialArg, init);
87617
87390
  }
87618
- function useRef3(initialValue) {
87391
+ function useRef(initialValue) {
87619
87392
  var dispatcher = resolveDispatcher();
87620
87393
  return dispatcher.useRef(initialValue);
87621
87394
  }
@@ -87627,11 +87400,11 @@ Your code should look like:
87627
87400
  var dispatcher = resolveDispatcher();
87628
87401
  return dispatcher.useInsertionEffect(create2, deps);
87629
87402
  }
87630
- function useLayoutEffect3(create2, deps) {
87403
+ function useLayoutEffect2(create2, deps) {
87631
87404
  var dispatcher = resolveDispatcher();
87632
87405
  return dispatcher.useLayoutEffect(create2, deps);
87633
87406
  }
87634
- function useCallback3(callback, deps) {
87407
+ function useCallback(callback, deps) {
87635
87408
  var dispatcher = resolveDispatcher();
87636
87409
  return dispatcher.useCallback(callback, deps);
87637
87410
  }
@@ -87639,7 +87412,7 @@ Your code should look like:
87639
87412
  var dispatcher = resolveDispatcher();
87640
87413
  return dispatcher.useMemo(create2, deps);
87641
87414
  }
87642
- function useImperativeHandle3(ref, create2, deps) {
87415
+ function useImperativeHandle(ref, create2, deps) {
87643
87416
  var dispatcher = resolveDispatcher();
87644
87417
  return dispatcher.useImperativeHandle(ref, create2, deps);
87645
87418
  }
@@ -88041,11 +87814,11 @@ Check the top-level render call using <` + parentName + ">.";
88041
87814
  if (isArray2(node2)) {
88042
87815
  for (var i4 = 0;i4 < node2.length; i4++) {
88043
87816
  var child = node2[i4];
88044
- if (isValidElement2(child)) {
87817
+ if (isValidElement(child)) {
88045
87818
  validateExplicitKey(child, parentType);
88046
87819
  }
88047
87820
  }
88048
- } else if (isValidElement2(node2)) {
87821
+ } else if (isValidElement(node2)) {
88049
87822
  if (node2._store) {
88050
87823
  node2._store.validated = true;
88051
87824
  }
@@ -88056,7 +87829,7 @@ Check the top-level render call using <` + parentName + ">.";
88056
87829
  var iterator = iteratorFn.call(node2);
88057
87830
  var step;
88058
87831
  while (!(step = iterator.next()).done) {
88059
- if (isValidElement2(step.value)) {
87832
+ if (isValidElement(step.value)) {
88060
87833
  validateExplicitKey(step.value, parentType);
88061
87834
  }
88062
87835
  }
@@ -88376,14 +88149,14 @@ Check the top-level render call using <` + parentName + ">.";
88376
88149
  var createElement$1 = createElementWithValidation;
88377
88150
  var cloneElement$1 = cloneElementWithValidation;
88378
88151
  var createFactory = createFactoryWithValidation;
88379
- var Children2 = {
88152
+ var Children = {
88380
88153
  map: mapChildren,
88381
88154
  forEach: forEachChildren,
88382
88155
  count: countChildren,
88383
88156
  toArray,
88384
88157
  only: onlyChild
88385
88158
  };
88386
- exports.Children = Children2;
88159
+ exports.Children = Children;
88387
88160
  exports.Component = Component;
88388
88161
  exports.Fragment = REACT_FRAGMENT_TYPE;
88389
88162
  exports.Profiler = REACT_PROFILER_TYPE;
@@ -88397,25 +88170,25 @@ Check the top-level render call using <` + parentName + ">.";
88397
88170
  exports.createElement = createElement$1;
88398
88171
  exports.createFactory = createFactory;
88399
88172
  exports.createRef = createRef;
88400
- exports.forwardRef = forwardRef4;
88401
- exports.isValidElement = isValidElement2;
88173
+ exports.forwardRef = forwardRef2;
88174
+ exports.isValidElement = isValidElement;
88402
88175
  exports.lazy = lazy;
88403
88176
  exports.memo = memo;
88404
88177
  exports.startTransition = startTransition;
88405
88178
  exports.unstable_act = act;
88406
- exports.useCallback = useCallback3;
88179
+ exports.useCallback = useCallback;
88407
88180
  exports.useContext = useContext11;
88408
88181
  exports.useDebugValue = useDebugValue;
88409
88182
  exports.useDeferredValue = useDeferredValue;
88410
88183
  exports.useEffect = useEffect3;
88411
88184
  exports.useId = useId;
88412
- exports.useImperativeHandle = useImperativeHandle3;
88185
+ exports.useImperativeHandle = useImperativeHandle;
88413
88186
  exports.useInsertionEffect = useInsertionEffect;
88414
- exports.useLayoutEffect = useLayoutEffect3;
88187
+ exports.useLayoutEffect = useLayoutEffect2;
88415
88188
  exports.useMemo = useMemo3;
88416
88189
  exports.useReducer = useReducer;
88417
- exports.useRef = useRef3;
88418
- exports.useState = useState4;
88190
+ exports.useRef = useRef;
88191
+ exports.useState = useState2;
88419
88192
  exports.useSyncExternalStore = useSyncExternalStore;
88420
88193
  exports.useTransition = useTransition;
88421
88194
  exports.version = ReactVersion;
@@ -94288,7 +94061,7 @@ The range will extend backwards to the start of the first line containing the se
94288
94061
  });
94289
94062
 
94290
94063
  // node_modules/.bun/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js
94291
- var require_react_jsx_runtime_development2 = __commonJS((exports) => {
94064
+ var require_react_jsx_runtime_development = __commonJS((exports) => {
94292
94065
  var React10 = __toESM(require_react2());
94293
94066
  if (true) {
94294
94067
  (function() {
@@ -94940,7 +94713,7 @@ var require_react_jsx_runtime_development2 = __commonJS((exports) => {
94940
94713
  {
94941
94714
  propTypesMisspellWarningShown = false;
94942
94715
  }
94943
- function isValidElement2(object) {
94716
+ function isValidElement(object) {
94944
94717
  {
94945
94718
  return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
94946
94719
  }
@@ -95013,11 +94786,11 @@ Check the top-level render call using <` + parentName + ">.";
95013
94786
  if (isArray2(node2)) {
95014
94787
  for (var i4 = 0;i4 < node2.length; i4++) {
95015
94788
  var child = node2[i4];
95016
- if (isValidElement2(child)) {
94789
+ if (isValidElement(child)) {
95017
94790
  validateExplicitKey(child, parentType);
95018
94791
  }
95019
94792
  }
95020
- } else if (isValidElement2(node2)) {
94793
+ } else if (isValidElement(node2)) {
95021
94794
  if (node2._store) {
95022
94795
  node2._store.validated = true;
95023
94796
  }
@@ -95028,7 +94801,7 @@ Check the top-level render call using <` + parentName + ">.";
95028
94801
  var iterator = iteratorFn.call(node2);
95029
94802
  var step;
95030
94803
  while (!(step = iterator.next()).done) {
95031
- if (isValidElement2(step.value)) {
94804
+ if (isValidElement(step.value)) {
95032
94805
  validateExplicitKey(step.value, parentType);
95033
94806
  }
95034
94807
  }
@@ -95171,18 +94944,18 @@ Check the top-level render call using <` + parentName + ">.";
95171
94944
  return jsxWithValidation(type, props, key, false);
95172
94945
  }
95173
94946
  }
95174
- var jsx3 = jsxWithValidationDynamic;
94947
+ var jsx = jsxWithValidationDynamic;
95175
94948
  var jsxs = jsxWithValidationStatic;
95176
94949
  exports.Fragment = REACT_FRAGMENT_TYPE;
95177
- exports.jsx = jsx3;
94950
+ exports.jsx = jsx;
95178
94951
  exports.jsxs = jsxs;
95179
94952
  })();
95180
94953
  }
95181
94954
  });
95182
94955
 
95183
94956
  // node_modules/.bun/react@18.3.1/node_modules/react/jsx-runtime.js
95184
- var require_jsx_runtime2 = __commonJS((exports, module) => {
95185
- var react_jsx_runtime_development = __toESM(require_react_jsx_runtime_development2());
94957
+ var require_jsx_runtime = __commonJS((exports, module) => {
94958
+ var react_jsx_runtime_development = __toESM(require_react_jsx_runtime_development());
95186
94959
  if (false) {} else {
95187
94960
  module.exports = react_jsx_runtime_development;
95188
94961
  }
@@ -98879,7 +98652,7 @@ Please update the following components: %s`, componentName);
98879
98652
  function basicStateReducer(state, action) {
98880
98653
  return typeof action === "function" ? action(state) : action;
98881
98654
  }
98882
- function useState4(initialState) {
98655
+ function useState2(initialState) {
98883
98656
  {
98884
98657
  currentHookNameInDev = "useState";
98885
98658
  }
@@ -98965,7 +98738,7 @@ Please update the following components: %s`, componentName);
98965
98738
  workInProgressHook.memoizedState = [nextValue, nextDeps];
98966
98739
  return nextValue;
98967
98740
  }
98968
- function useRef3(initialValue) {
98741
+ function useRef(initialValue) {
98969
98742
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
98970
98743
  workInProgressHook = createWorkInProgressHook();
98971
98744
  var previousRef = workInProgressHook.memoizedState;
@@ -98982,7 +98755,7 @@ Please update the following components: %s`, componentName);
98982
98755
  return previousRef;
98983
98756
  }
98984
98757
  }
98985
- function useLayoutEffect3(create2, inputs) {
98758
+ function useLayoutEffect2(create2, inputs) {
98986
98759
  {
98987
98760
  currentHookNameInDev = "useLayoutEffect";
98988
98761
  error2("useLayoutEffect does nothing on the server, because its effect cannot " + "be encoded into the server renderer's output format. This will lead " + "to a mismatch between the initial, non-hydrated UI and the intended " + "UI. To avoid this, useLayoutEffect should only be used in " + "components that render exclusively on the client. " + "See https://reactjs.org/link/uselayouteffect-ssr for common fixes.");
@@ -99013,7 +98786,7 @@ Please update the following components: %s`, componentName);
99013
98786
  }
99014
98787
  }
99015
98788
  }
99016
- function useCallback3(callback, deps) {
98789
+ function useCallback(callback, deps) {
99017
98790
  return useMemo3(function() {
99018
98791
  return callback;
99019
98792
  }, deps);
@@ -99055,11 +98828,11 @@ Please update the following components: %s`, componentName);
99055
98828
  useContext: useContext11,
99056
98829
  useMemo: useMemo3,
99057
98830
  useReducer,
99058
- useRef: useRef3,
99059
- useState: useState4,
98831
+ useRef,
98832
+ useState: useState2,
99060
98833
  useInsertionEffect: noop3,
99061
- useLayoutEffect: useLayoutEffect3,
99062
- useCallback: useCallback3,
98834
+ useLayoutEffect: useLayoutEffect2,
98835
+ useCallback,
99063
98836
  useImperativeHandle: noop3,
99064
98837
  useEffect: noop3,
99065
98838
  useDebugValue: noop3,
@@ -104066,7 +103839,7 @@ Please update the following components: %s`, componentName);
104066
103839
  function basicStateReducer(state, action) {
104067
103840
  return typeof action === "function" ? action(state) : action;
104068
103841
  }
104069
- function useState4(initialState) {
103842
+ function useState2(initialState) {
104070
103843
  {
104071
103844
  currentHookNameInDev = "useState";
104072
103845
  }
@@ -104152,7 +103925,7 @@ Please update the following components: %s`, componentName);
104152
103925
  workInProgressHook.memoizedState = [nextValue, nextDeps];
104153
103926
  return nextValue;
104154
103927
  }
104155
- function useRef3(initialValue) {
103928
+ function useRef(initialValue) {
104156
103929
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
104157
103930
  workInProgressHook = createWorkInProgressHook();
104158
103931
  var previousRef = workInProgressHook.memoizedState;
@@ -104169,7 +103942,7 @@ Please update the following components: %s`, componentName);
104169
103942
  return previousRef;
104170
103943
  }
104171
103944
  }
104172
- function useLayoutEffect3(create2, inputs) {
103945
+ function useLayoutEffect2(create2, inputs) {
104173
103946
  {
104174
103947
  currentHookNameInDev = "useLayoutEffect";
104175
103948
  error2("useLayoutEffect does nothing on the server, because its effect cannot " + "be encoded into the server renderer's output format. This will lead " + "to a mismatch between the initial, non-hydrated UI and the intended " + "UI. To avoid this, useLayoutEffect should only be used in " + "components that render exclusively on the client. " + "See https://reactjs.org/link/uselayouteffect-ssr for common fixes.");
@@ -104200,7 +103973,7 @@ Please update the following components: %s`, componentName);
104200
103973
  }
104201
103974
  }
104202
103975
  }
104203
- function useCallback3(callback, deps) {
103976
+ function useCallback(callback, deps) {
104204
103977
  return useMemo3(function() {
104205
103978
  return callback;
104206
103979
  }, deps);
@@ -104242,11 +104015,11 @@ Please update the following components: %s`, componentName);
104242
104015
  useContext: useContext11,
104243
104016
  useMemo: useMemo3,
104244
104017
  useReducer,
104245
- useRef: useRef3,
104246
- useState: useState4,
104018
+ useRef,
104019
+ useState: useState2,
104247
104020
  useInsertionEffect: noop3,
104248
- useLayoutEffect: useLayoutEffect3,
104249
- useCallback: useCallback3,
104021
+ useLayoutEffect: useLayoutEffect2,
104022
+ useCallback,
104250
104023
  useImperativeHandle: noop3,
104251
104024
  useEffect: noop3,
104252
104025
  useDebugValue: noop3,
@@ -105534,7 +105307,7 @@ function recursivelyMapDoc(doc, callback) {
105534
105307
  }
105535
105308
  return callback(doc);
105536
105309
  }
105537
- var import_react28, import_jsx_runtime3, __defProp2, __defProps, __getOwnPropDescs, __getOwnPropSymbols, __hasOwnProp2, __propIsEnum, __defNormalProp = (obj, key, value) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value, __spreadValues = (a4, b6) => {
105310
+ var import_react26, import_jsx_runtime, __defProp2, __defProps, __getOwnPropDescs, __getOwnPropSymbols, __hasOwnProp2, __propIsEnum, __defNormalProp = (obj, key, value) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value, __spreadValues = (a4, b6) => {
105538
105311
  for (var prop in b6 || (b6 = {}))
105539
105312
  if (__hasOwnProp2.call(b6, prop))
105540
105313
  __defNormalProp(a4, prop, b6[prop]);
@@ -105591,7 +105364,7 @@ var import_react28, import_jsx_runtime3, __defProp2, __defProps, __getOwnPropDes
105591
105364
  }
105592
105365
  return result;
105593
105366
  }), render3 = (node2, options) => __async(undefined, null, function* () {
105594
- const suspendedElement = /* @__PURE__ */ import_jsx_runtime3.jsx(import_react28.Suspense, { children: node2 });
105367
+ const suspendedElement = /* @__PURE__ */ import_jsx_runtime.jsx(import_react26.Suspense, { children: node2 });
105595
105368
  const reactDOMServer = yield Promise.resolve().then(() => (init_server_node(), exports_server_node)).then((m4) => m4.default);
105596
105369
  let html2;
105597
105370
  if (Object.hasOwn(reactDOMServer, "renderToReadableStream")) {
@@ -105629,8 +105402,8 @@ var init_node2 = __esm(() => {
105629
105402
  init_html_to_text();
105630
105403
  init_html();
105631
105404
  init_standalone();
105632
- import_react28 = __toESM(require_react2(), 1);
105633
- import_jsx_runtime3 = __toESM(require_jsx_runtime2(), 1);
105405
+ import_react26 = __toESM(require_react2(), 1);
105406
+ import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
105634
105407
  __defProp2 = Object.defineProperty;
105635
105408
  __defProps = Object.defineProperties;
105636
105409
  __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -105862,9 +105635,9 @@ React keys must be passed directly to JSX without using spread:
105862
105635
  return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
105863
105636
  }
105864
105637
  function validateChildKeys(node2) {
105865
- isValidElement2(node2) ? node2._store && (node2._store.validated = 1) : typeof node2 === "object" && node2 !== null && node2.$$typeof === REACT_LAZY_TYPE && (node2._payload.status === "fulfilled" ? isValidElement2(node2._payload.value) && node2._payload.value._store && (node2._payload.value._store.validated = 1) : node2._store && (node2._store.validated = 1));
105638
+ isValidElement(node2) ? node2._store && (node2._store.validated = 1) : typeof node2 === "object" && node2 !== null && node2.$$typeof === REACT_LAZY_TYPE && (node2._payload.status === "fulfilled" ? isValidElement(node2._payload.value) && node2._payload.value._store && (node2._payload.value._store.validated = 1) : node2._store && (node2._store.validated = 1));
105866
105639
  }
105867
- function isValidElement2(object) {
105640
+ function isValidElement(object) {
105868
105641
  return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
105869
105642
  }
105870
105643
  var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React11.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
@@ -113094,6 +112867,25 @@ var getInstance = (stdout, createInstance) => {
113094
112867
  };
113095
112868
  // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/components/Static.js
113096
112869
  var import_react14 = __toESM(require_react(), 1);
112870
+ function Static(props) {
112871
+ const { items, children: render2, style: customStyle } = props;
112872
+ const [index, setIndex] = import_react14.useState(0);
112873
+ const itemsToRender = import_react14.useMemo(() => {
112874
+ return items.slice(index);
112875
+ }, [items, index]);
112876
+ import_react14.useLayoutEffect(() => {
112877
+ setIndex(items.length);
112878
+ }, [items.length]);
112879
+ const children = itemsToRender.map((item, itemIndex) => {
112880
+ return render2(item, index + itemIndex);
112881
+ });
112882
+ const style = import_react14.useMemo(() => ({
112883
+ position: "absolute",
112884
+ flexDirection: "column",
112885
+ ...customStyle
112886
+ }), [customStyle]);
112887
+ return import_react14.default.createElement("ink-box", { internal_static: true, style }, children);
112888
+ }
113097
112889
  // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/components/Transform.js
113098
112890
  var import_react15 = __toESM(require_react(), 1);
113099
112891
  // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/components/Newline.js
@@ -113365,287 +113157,8 @@ var import_react23 = __toESM(require_react(), 1);
113365
113157
  var import_react24 = __toESM(require_react(), 1);
113366
113158
  // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js
113367
113159
  var import_react25 = __toESM(require_react(), 1);
113368
- // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/measure-element.js
113369
- var measureElement = (node) => ({
113370
- width: node.yogaNode?.getComputedWidth() ?? 0,
113371
- height: node.yogaNode?.getComputedHeight() ?? 0
113372
- });
113373
- var measure_element_default = measureElement;
113374
113160
  // packages/terminal/src/components/App.tsx
113375
- var import_react36 = __toESM(require_react(), 1);
113376
-
113377
- // node_modules/.bun/ink-scroll-view@0.3.5+43e67b6d697aa20c/node_modules/ink-scroll-view/dist/index.js
113378
- var import_react26 = __toESM(require_react(), 1);
113379
- var import_react27 = __toESM(require_react(), 1);
113380
- var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
113381
- var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
113382
- var MeasurableItem = ({
113383
- children,
113384
- onMeasure,
113385
- index,
113386
- width,
113387
- measureKey
113388
- }) => {
113389
- const ref = import_react27.useRef(null);
113390
- import_react27.useLayoutEffect(() => {
113391
- if (ref.current) {
113392
- const { height } = measure_element_default(ref.current);
113393
- onMeasure(index, height);
113394
- }
113395
- }, [index, onMeasure, width, measureKey, children]);
113396
- return /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, { ref, flexShrink: 0, width: "100%", flexDirection: "column", children });
113397
- };
113398
- function useStateRef(initialValue) {
113399
- const [state, setStateInternal] = import_react27.useState(initialValue);
113400
- const ref = import_react27.useRef(initialValue);
113401
- const setState = import_react27.useCallback((update) => {
113402
- const nextValue = typeof update === "function" ? update(ref.current) : update;
113403
- ref.current = nextValue;
113404
- setStateInternal(nextValue);
113405
- }, []);
113406
- const getState = import_react27.useCallback(() => ref.current, []);
113407
- return [state, setState, getState];
113408
- }
113409
- var ControlledScrollView = import_react27.forwardRef(({
113410
- scrollOffset,
113411
- onViewportSizeChange,
113412
- onContentHeightChange,
113413
- onItemHeightChange,
113414
- debug = false,
113415
- children,
113416
- ...boxProps
113417
- }, ref) => {
113418
- const [viewportSize, setViewportSize, getViewportSize] = useStateRef({
113419
- height: 0,
113420
- width: 0
113421
- });
113422
- const [contentHeight, setContentHeight, getContentHeight] = useStateRef(0);
113423
- const [itemMeasureKeys, setItemMeasureKeys] = import_react27.useState({});
113424
- const viewportRef = import_react27.useRef(null);
113425
- const contentRef = import_react27.useRef(null);
113426
- const prevContentHeightRef = import_react27.useRef(0);
113427
- import_react27.useLayoutEffect(() => {
113428
- if (contentHeight !== prevContentHeightRef.current) {
113429
- onContentHeightChange?.(contentHeight, prevContentHeightRef.current);
113430
- prevContentHeightRef.current = contentHeight;
113431
- }
113432
- }, [contentHeight, onContentHeightChange]);
113433
- const itemHeightsRef = import_react27.useRef({});
113434
- const itemKeysRef = import_react27.useRef([]);
113435
- const itemOffsetsRef = import_react27.useRef([]);
113436
- const firstInvalidOffsetIndexRef = import_react27.useRef(0);
113437
- const handleItemMeasure = import_react27.useCallback((index, height) => {
113438
- const key = itemKeysRef.current[index] || index;
113439
- if (itemHeightsRef.current[key] !== height) {
113440
- const previousHeight = itemHeightsRef.current[key] || 0;
113441
- itemHeightsRef.current = {
113442
- ...itemHeightsRef.current,
113443
- [key]: height
113444
- };
113445
- let newTotalHeight = 0;
113446
- for (const itemKey of itemKeysRef.current) {
113447
- newTotalHeight += itemHeightsRef.current[itemKey] || 0;
113448
- }
113449
- const currentHeight = getContentHeight();
113450
- if (newTotalHeight !== currentHeight) {
113451
- setContentHeight(newTotalHeight);
113452
- }
113453
- onItemHeightChange?.(index, height, previousHeight);
113454
- firstInvalidOffsetIndexRef.current = Math.min(firstInvalidOffsetIndexRef.current, index + 1);
113455
- }
113456
- }, [
113457
- onItemHeightChange,
113458
- onContentHeightChange,
113459
- getContentHeight,
113460
- setContentHeight
113461
- ]);
113462
- const measureViewport = import_react27.useCallback(() => {
113463
- if (viewportRef.current) {
113464
- const { width, height } = measure_element_default(viewportRef.current);
113465
- const currentSize = getViewportSize();
113466
- if (width !== currentSize.width || height !== currentSize.height) {
113467
- onViewportSizeChange?.({ width, height }, currentSize);
113468
- setViewportSize({ width, height });
113469
- }
113470
- }
113471
- }, [viewportRef, onViewportSizeChange, getViewportSize, setViewportSize]);
113472
- import_react27.useLayoutEffect(() => {
113473
- measureViewport();
113474
- });
113475
- const prevChildrenRef = import_react27.useRef(null);
113476
- if (prevChildrenRef.current !== children) {
113477
- prevChildrenRef.current = children;
113478
- const newItemKeys = [];
113479
- const newItemHeights = {};
113480
- import_react27.Children.forEach(children, (child, index) => {
113481
- if (!child)
113482
- return;
113483
- const key = import_react27.isValidElement(child) ? child.key : null;
113484
- const effectiveKey = key !== null ? key : index;
113485
- newItemKeys[index] = effectiveKey;
113486
- const itemHeight = itemHeightsRef.current[effectiveKey] || 0;
113487
- newItemHeights[effectiveKey] = itemHeight;
113488
- });
113489
- itemHeightsRef.current = newItemHeights;
113490
- itemKeysRef.current = newItemKeys;
113491
- itemOffsetsRef.current = new Array(newItemKeys.length).fill(0);
113492
- firstInvalidOffsetIndexRef.current = 0;
113493
- let newTotalHeight = 0;
113494
- newItemKeys.forEach((itemKey) => {
113495
- newTotalHeight += newItemHeights[itemKey] || 0;
113496
- });
113497
- const currentHeight = getContentHeight();
113498
- if (newTotalHeight !== currentHeight) {
113499
- setContentHeight(newTotalHeight);
113500
- }
113501
- }
113502
- import_react27.useImperativeHandle(ref, () => ({
113503
- getContentHeight,
113504
- getViewportHeight: () => getViewportSize().height,
113505
- getBottomOffset: () => Math.max(0, getContentHeight() - getViewportSize().height),
113506
- getItemHeight: (index) => {
113507
- const key = itemKeysRef.current[index] || index;
113508
- return itemHeightsRef.current[key] || 0;
113509
- },
113510
- remeasure: measureViewport,
113511
- remeasureItem: (index) => setItemMeasureKeys((prev) => ({
113512
- ...prev,
113513
- [index]: (prev[index] || 0) + 1
113514
- })),
113515
- getItemPosition: (index) => {
113516
- if (index < 0 || index >= itemKeysRef.current.length) {
113517
- return null;
113518
- }
113519
- if (index >= firstInvalidOffsetIndexRef.current) {
113520
- let currentOffset = 0;
113521
- let startIndex = 0;
113522
- if (firstInvalidOffsetIndexRef.current > 0) {
113523
- startIndex = firstInvalidOffsetIndexRef.current;
113524
- const prevIndex = startIndex - 1;
113525
- const prevKey = itemKeysRef.current[prevIndex] || prevIndex;
113526
- const prevHeight = itemHeightsRef.current[prevKey] || 0;
113527
- currentOffset = (itemOffsetsRef.current[prevIndex] ?? 0) + prevHeight;
113528
- }
113529
- for (let i = startIndex;i <= index; i++) {
113530
- itemOffsetsRef.current[i] = currentOffset;
113531
- const key2 = itemKeysRef.current[i] || i;
113532
- const height2 = itemHeightsRef.current[key2] || 0;
113533
- currentOffset += height2;
113534
- }
113535
- firstInvalidOffsetIndexRef.current = index + 1;
113536
- }
113537
- const top = itemOffsetsRef.current[index] ?? 0;
113538
- const key = itemKeysRef.current[index] || index;
113539
- const height = itemHeightsRef.current[key] || 0;
113540
- return { top, height };
113541
- }
113542
- }), []);
113543
- return /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, { ...boxProps, children: /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, { ref: viewportRef, width: "100%", children: /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, { overflow: debug ? undefined : "hidden", width: "100%", children: /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, {
113544
- ref: contentRef,
113545
- width: "100%",
113546
- flexDirection: "column",
113547
- marginTop: -scrollOffset,
113548
- children: import_react27.Children.map(children, (child, index) => {
113549
- if (!child)
113550
- return null;
113551
- return /* @__PURE__ */ import_jsx_runtime.jsx(MeasurableItem, {
113552
- index,
113553
- width: viewportSize.width,
113554
- onMeasure: handleItemMeasure,
113555
- measureKey: itemMeasureKeys[index],
113556
- children: child
113557
- }, import_react27.isValidElement(child) ? child.key || index : index);
113558
- })
113559
- }) }) }) });
113560
- });
113561
- function useStateRef2(initialValue) {
113562
- const [state, setStateInternal] = import_react26.useState(initialValue);
113563
- const ref = import_react26.useRef(initialValue);
113564
- const setState = import_react26.useCallback((update) => {
113565
- const nextValue = typeof update === "function" ? update(ref.current) : update;
113566
- ref.current = nextValue;
113567
- setStateInternal(nextValue);
113568
- }, []);
113569
- const getState = import_react26.useCallback(() => ref.current, []);
113570
- return [state, setState, getState];
113571
- }
113572
- var ScrollView = import_react26.forwardRef(({
113573
- onScroll,
113574
- onViewportSizeChange,
113575
- onContentHeightChange,
113576
- onItemHeightChange,
113577
- debug = false,
113578
- children,
113579
- ...boxProps
113580
- }, ref) => {
113581
- const [scrollOffset, setScrollOffset, getScrollOffset] = useStateRef2(0);
113582
- const innerRef = import_react26.useRef(null);
113583
- const contentHeightRef = import_react26.useRef(0);
113584
- const handleContentHeightChange = import_react26.useCallback((height, previousHeight) => {
113585
- contentHeightRef.current = height;
113586
- onContentHeightChange?.(height, previousHeight);
113587
- if (getScrollOffset() > height) {
113588
- setScrollOffset(height);
113589
- onScroll?.(height);
113590
- }
113591
- }, [onContentHeightChange, onScroll, getScrollOffset, setScrollOffset]);
113592
- const getBottomOffset = import_react26.useCallback(() => Math.max(0, contentHeightRef.current - (innerRef.current?.getViewportHeight() || 0)), []);
113593
- import_react26.useImperativeHandle(ref, () => ({
113594
- scrollTo: (offset) => {
113595
- if (typeof offset !== "number" || isNaN(offset)) {
113596
- return;
113597
- }
113598
- const currentContentHeight = contentHeightRef.current;
113599
- const newScrollTop = Math.max(0, Math.min(offset, currentContentHeight));
113600
- if (newScrollTop !== getScrollOffset()) {
113601
- setScrollOffset(newScrollTop);
113602
- onScroll?.(newScrollTop);
113603
- }
113604
- },
113605
- scrollBy: (delta) => {
113606
- if (typeof delta !== "number" || isNaN(delta)) {
113607
- return;
113608
- }
113609
- const currentContentHeight = contentHeightRef.current;
113610
- const newScrollTop = Math.max(0, Math.min(getScrollOffset() + delta, currentContentHeight));
113611
- if (newScrollTop !== getScrollOffset()) {
113612
- setScrollOffset(newScrollTop);
113613
- onScroll?.(newScrollTop);
113614
- }
113615
- },
113616
- scrollToTop: () => {
113617
- if (getScrollOffset() !== 0) {
113618
- setScrollOffset(0);
113619
- onScroll?.(0);
113620
- }
113621
- },
113622
- scrollToBottom: () => {
113623
- const bottomOffset = getBottomOffset();
113624
- if (getScrollOffset() !== bottomOffset) {
113625
- setScrollOffset(bottomOffset);
113626
- onScroll?.(bottomOffset);
113627
- }
113628
- },
113629
- getScrollOffset,
113630
- getContentHeight: () => contentHeightRef.current,
113631
- getViewportHeight: () => innerRef.current?.getViewportHeight() || 0,
113632
- getBottomOffset,
113633
- getItemHeight: (index) => innerRef.current?.getItemHeight(index) || 0,
113634
- getItemPosition: (index) => innerRef.current?.getItemPosition(index) || null,
113635
- remeasure: () => innerRef.current?.remeasure(),
113636
- remeasureItem: (index) => innerRef.current?.remeasureItem(index)
113637
- }), [onScroll, getBottomOffset, getScrollOffset, setScrollOffset]);
113638
- return /* @__PURE__ */ import_jsx_runtime2.jsx(ControlledScrollView, {
113639
- ref: innerRef,
113640
- scrollOffset,
113641
- onViewportSizeChange,
113642
- onContentHeightChange: handleContentHeightChange,
113643
- onItemHeightChange,
113644
- debug,
113645
- children,
113646
- ...boxProps
113647
- });
113648
- });
113161
+ var import_react34 = __toESM(require_react(), 1);
113649
113162
 
113650
113163
  // packages/core/src/agent/loop.ts
113651
113164
  init_src();
@@ -114806,7 +114319,11 @@ class ToolRegistry {
114806
114319
  }
114807
114320
  const timeoutMsRaw = input?.timeoutMs ?? input?.timeout;
114808
114321
  const timeoutMsParsed = typeof timeoutMsRaw === "string" ? Number(timeoutMsRaw) : timeoutMsRaw;
114809
- const timeoutMs = typeof timeoutMsParsed === "number" && timeoutMsParsed > 0 ? timeoutMsParsed : 60000;
114322
+ let timeoutMs = typeof timeoutMsParsed === "number" && timeoutMsParsed > 0 ? timeoutMsParsed : 60000;
114323
+ const derivedWaitTimeout = deriveWaitTimeoutMs(toolCall.name, input);
114324
+ if (derivedWaitTimeout !== null && derivedWaitTimeout > timeoutMs) {
114325
+ timeoutMs = derivedWaitTimeout;
114326
+ }
114810
114327
  const result = await Promise.race([
114811
114328
  registered.executor(input),
114812
114329
  sleep(timeoutMs).then(() => {
@@ -114870,6 +114387,50 @@ class ToolRegistry {
114870
114387
  function resolveMode(defaultMode, override) {
114871
114388
  return override ?? defaultMode ?? "strict";
114872
114389
  }
114390
+ function toNumber(value) {
114391
+ if (value === undefined || value === null)
114392
+ return null;
114393
+ const num = typeof value === "string" ? Number(value) : value;
114394
+ if (!Number.isFinite(num))
114395
+ return null;
114396
+ return num;
114397
+ }
114398
+ function deriveWaitTimeoutMs(toolName, input) {
114399
+ if (!input)
114400
+ return null;
114401
+ if (toolName !== "wait" && toolName !== "sleep")
114402
+ return null;
114403
+ const durationMs = toNumber(input.durationMs);
114404
+ if (durationMs !== null) {
114405
+ return clampWaitTimeout(durationMs);
114406
+ }
114407
+ const seconds = toNumber(input.seconds);
114408
+ if (seconds !== null) {
114409
+ return clampWaitTimeout(seconds * 1000);
114410
+ }
114411
+ const minutes = toNumber(input.minutes);
114412
+ if (minutes !== null) {
114413
+ return clampWaitTimeout(minutes * 60 * 1000);
114414
+ }
114415
+ const minSeconds = toNumber(input.minSeconds);
114416
+ const maxSeconds = toNumber(input.maxSeconds);
114417
+ if (minSeconds !== null && maxSeconds !== null) {
114418
+ return clampWaitTimeout(Math.max(minSeconds, maxSeconds) * 1000);
114419
+ }
114420
+ const minMinutes = toNumber(input.minMinutes);
114421
+ const maxMinutes = toNumber(input.maxMinutes);
114422
+ if (minMinutes !== null && maxMinutes !== null) {
114423
+ return clampWaitTimeout(Math.max(minMinutes, maxMinutes) * 60 * 1000);
114424
+ }
114425
+ return null;
114426
+ }
114427
+ function clampWaitTimeout(durationMs) {
114428
+ const bufferMs = 5000;
114429
+ const maxMs = 7 * 24 * 60 * 60 * 1000;
114430
+ const safeDuration = Math.max(0, durationMs);
114431
+ const timeoutMs = safeDuration + bufferMs;
114432
+ return Math.min(timeoutMs, maxMs);
114433
+ }
114873
114434
  function normalizeToolError(error, toolCall) {
114874
114435
  if (error instanceof AssistantError)
114875
114436
  return error;
@@ -118168,6 +117729,170 @@ function createAskUserTool(getHandler) {
118168
117729
  return { tool, executor };
118169
117730
  }
118170
117731
 
117732
+ // packages/core/src/tools/wait.ts
117733
+ init_src();
117734
+ init_errors();
117735
+ var MAX_WAIT_MS = 7 * 24 * 60 * 60 * 1000;
117736
+ function toNumber2(value) {
117737
+ if (value === undefined || value === null)
117738
+ return;
117739
+ const num = typeof value === "string" ? Number(value) : value;
117740
+ if (!Number.isFinite(num))
117741
+ return;
117742
+ return num;
117743
+ }
117744
+ function formatDuration(ms) {
117745
+ const totalSeconds = Math.max(0, Math.round(ms / 1000));
117746
+ if (totalSeconds < 60)
117747
+ return `${totalSeconds}s`;
117748
+ const mins = Math.floor(totalSeconds / 60);
117749
+ const secs = totalSeconds % 60;
117750
+ return `${mins}m ${secs}s`;
117751
+ }
117752
+ function pickRandom(min, max) {
117753
+ if (max < min)
117754
+ return min;
117755
+ return Math.floor(Math.random() * (max - min + 1)) + min;
117756
+ }
117757
+ function resolveWaitMs(input) {
117758
+ const durationMs = toNumber2(input.durationMs);
117759
+ if (durationMs !== undefined) {
117760
+ return { ms: durationMs };
117761
+ }
117762
+ const seconds = toNumber2(input.seconds);
117763
+ if (seconds !== undefined) {
117764
+ return { ms: seconds * 1000 };
117765
+ }
117766
+ const minutes = toNumber2(input.minutes);
117767
+ if (minutes !== undefined) {
117768
+ return { ms: minutes * 60 * 1000 };
117769
+ }
117770
+ const minSeconds = toNumber2(input.minSeconds);
117771
+ const maxSeconds = toNumber2(input.maxSeconds);
117772
+ if (minSeconds !== undefined || maxSeconds !== undefined) {
117773
+ if (minSeconds === undefined || maxSeconds === undefined) {
117774
+ throw new Error("Both minSeconds and maxSeconds are required for a range.");
117775
+ }
117776
+ const chosen = pickRandom(Math.round(minSeconds), Math.round(maxSeconds));
117777
+ return {
117778
+ ms: chosen * 1000,
117779
+ note: `range ${Math.round(minSeconds)}-${Math.round(maxSeconds)}s`
117780
+ };
117781
+ }
117782
+ const minMinutes = toNumber2(input.minMinutes);
117783
+ const maxMinutes = toNumber2(input.maxMinutes);
117784
+ if (minMinutes !== undefined || maxMinutes !== undefined) {
117785
+ if (minMinutes === undefined || maxMinutes === undefined) {
117786
+ throw new Error("Both minMinutes and maxMinutes are required for a range.");
117787
+ }
117788
+ const chosen = pickRandom(Math.round(minMinutes * 60), Math.round(maxMinutes * 60));
117789
+ return {
117790
+ ms: chosen * 1000,
117791
+ note: `range ${Math.round(minMinutes)}-${Math.round(maxMinutes)}m`
117792
+ };
117793
+ }
117794
+ return { ms: 0 };
117795
+ }
117796
+ function buildWaitTool(name) {
117797
+ return {
117798
+ name,
117799
+ description: "Pause execution for a duration. Use seconds/minutes or a range. Add timeoutMs if waiting longer than 60s.",
117800
+ parameters: {
117801
+ type: "object",
117802
+ properties: {
117803
+ durationMs: {
117804
+ type: "number",
117805
+ description: "Exact duration in milliseconds."
117806
+ },
117807
+ seconds: {
117808
+ type: "number",
117809
+ description: "Exact duration in seconds."
117810
+ },
117811
+ minutes: {
117812
+ type: "number",
117813
+ description: "Exact duration in minutes."
117814
+ },
117815
+ minSeconds: {
117816
+ type: "number",
117817
+ description: "Minimum seconds for random range."
117818
+ },
117819
+ maxSeconds: {
117820
+ type: "number",
117821
+ description: "Maximum seconds for random range."
117822
+ },
117823
+ minMinutes: {
117824
+ type: "number",
117825
+ description: "Minimum minutes for random range."
117826
+ },
117827
+ maxMinutes: {
117828
+ type: "number",
117829
+ description: "Maximum minutes for random range."
117830
+ },
117831
+ reason: {
117832
+ type: "string",
117833
+ description: "Optional reason for the wait."
117834
+ },
117835
+ timeoutMs: {
117836
+ type: "number",
117837
+ description: "Override tool timeout (should be >= wait duration)."
117838
+ }
117839
+ }
117840
+ }
117841
+ };
117842
+ }
117843
+ var executor = async (input) => {
117844
+ let waitMs = 0;
117845
+ let note;
117846
+ try {
117847
+ const resolved = resolveWaitMs(input);
117848
+ waitMs = resolved.ms;
117849
+ note = resolved.note;
117850
+ } catch (error) {
117851
+ throw new ToolExecutionError(error instanceof Error ? error.message : String(error), {
117852
+ toolName: "wait",
117853
+ toolInput: input,
117854
+ code: ErrorCodes.VALIDATION_OUT_OF_RANGE,
117855
+ recoverable: false,
117856
+ retryable: false,
117857
+ suggestion: "Provide an exact duration or a valid min/max range."
117858
+ });
117859
+ }
117860
+ if (!Number.isFinite(waitMs) || waitMs < 0) {
117861
+ throw new ToolExecutionError("Wait duration must be a non-negative number.", {
117862
+ toolName: "wait",
117863
+ toolInput: input,
117864
+ code: ErrorCodes.VALIDATION_OUT_OF_RANGE,
117865
+ recoverable: false,
117866
+ retryable: false
117867
+ });
117868
+ }
117869
+ if (waitMs > MAX_WAIT_MS) {
117870
+ throw new ToolExecutionError(`Wait duration exceeds max (${Math.round(MAX_WAIT_MS / 1000)}s).`, {
117871
+ toolName: "wait",
117872
+ toolInput: input,
117873
+ code: ErrorCodes.VALIDATION_OUT_OF_RANGE,
117874
+ recoverable: false,
117875
+ retryable: false,
117876
+ suggestion: "Use a shorter wait or schedule the action instead."
117877
+ });
117878
+ }
117879
+ await sleep(waitMs);
117880
+ const label = formatDuration(waitMs);
117881
+ const reason = typeof input.reason === "string" && input.reason?.trim() ? ` (${input.reason?.trim()})` : "";
117882
+ const rangeNote = note ? `, ${note}` : "";
117883
+ return `Waited ${label}${rangeNote}${reason}.`;
117884
+ };
117885
+
117886
+ class WaitTool {
117887
+ static tool = buildWaitTool("wait");
117888
+ static executor = executor;
117889
+ }
117890
+
117891
+ class SleepTool {
117892
+ static tool = buildWaitTool("sleep");
117893
+ static executor = executor;
117894
+ }
117895
+
118171
117896
  // packages/core/src/agent/subagent.ts
118172
117897
  init_src();
118173
117898
  var DEFAULT_HOOK_TOOLS = ["read", "glob", "grep"];
@@ -120268,7 +119993,7 @@ function formatAge(ms) {
120268
119993
  return `${days}d`;
120269
119994
  }
120270
119995
  // packages/core/src/commands/builtin.ts
120271
- var VERSION = "0.6.42";
119996
+ var VERSION = "0.6.43";
120272
119997
  function resolveAuthTimeout(resolve5) {
120273
119998
  resolve5({ exitCode: 1, stdout: { toString: () => "{}" } });
120274
119999
  }
@@ -138914,6 +138639,8 @@ class AgentLoop {
138914
138639
  this.toolRegistry.register(askUserTool.tool, askUserTool.executor);
138915
138640
  this.toolRegistry.register(FeedbackTool.tool, FeedbackTool.executor);
138916
138641
  this.toolRegistry.register(SchedulerTool.tool, SchedulerTool.executor);
138642
+ this.toolRegistry.register(WaitTool.tool, WaitTool.executor);
138643
+ this.toolRegistry.register(SleepTool.tool, SleepTool.executor);
138917
138644
  if (this.config?.inbox?.enabled) {
138918
138645
  const assistant = this.assistantManager?.getActive();
138919
138646
  const agentId = assistant?.id || this.sessionId;
@@ -138937,8 +138664,8 @@ class AgentLoop {
138937
138664
  this.emit({ type: "text", content: message });
138938
138665
  });
138939
138666
  const jobTools = createJobTools(() => this.jobManager);
138940
- for (const { tool, executor } of jobTools) {
138941
- this.toolRegistry.register(tool, executor);
138667
+ for (const { tool, executor: executor2 } of jobTools) {
138668
+ this.toolRegistry.register(tool, executor2);
138942
138669
  }
138943
138670
  this.connectorBridge.setJobManagerGetter(() => this.jobManager);
138944
138671
  this.jobManager.cleanup().catch(() => {});
@@ -140629,17 +140356,17 @@ init_retry();
140629
140356
  init_src();
140630
140357
 
140631
140358
  // packages/terminal/src/components/Input.tsx
140632
- var import_react30 = __toESM(require_react(), 1);
140359
+ var import_react28 = __toESM(require_react(), 1);
140633
140360
 
140634
140361
  // node_modules/.bun/ink-text-input@6.0.0+43e67b6d697aa20c/node_modules/ink-text-input/build/index.js
140635
- var import_react29 = __toESM(require_react(), 1);
140362
+ var import_react27 = __toESM(require_react(), 1);
140636
140363
  function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
140637
- const [state, setState] = import_react29.useState({
140364
+ const [state, setState] = import_react27.useState({
140638
140365
  cursorOffset: (originalValue || "").length,
140639
140366
  cursorWidth: 0
140640
140367
  });
140641
140368
  const { cursorOffset, cursorWidth } = state;
140642
- import_react29.useEffect(() => {
140369
+ import_react27.useEffect(() => {
140643
140370
  setState((previousState) => {
140644
140371
  if (!focus || !showCursor) {
140645
140372
  return previousState;
@@ -140717,7 +140444,7 @@ function TextInput({ value: originalValue, placeholder = "", focus = true, mask,
140717
140444
  onChange(nextValue);
140718
140445
  }
140719
140446
  }, { isActive: focus });
140720
- return import_react29.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
140447
+ return import_react27.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
140721
140448
  }
140722
140449
  var build_default = TextInput;
140723
140450
 
@@ -140759,9 +140486,9 @@ function Input({
140759
140486
  isAskingUser = false,
140760
140487
  askPlaceholder
140761
140488
  }) {
140762
- const [value, setValue] = import_react30.useState("");
140763
- const [selectedIndex, setSelectedIndex] = import_react30.useState(0);
140764
- const allCommands = import_react30.useMemo(() => {
140489
+ const [value, setValue] = import_react28.useState("");
140490
+ const [selectedIndex, setSelectedIndex] = import_react28.useState(0);
140491
+ const allCommands = import_react28.useMemo(() => {
140765
140492
  const merged = [...COMMANDS];
140766
140493
  if (commands3) {
140767
140494
  for (const cmd of commands3) {
@@ -140772,7 +140499,7 @@ function Input({
140772
140499
  }
140773
140500
  return merged.sort((a5, b7) => a5.name.localeCompare(b7.name));
140774
140501
  }, [commands3]);
140775
- const autocompleteMode = import_react30.useMemo(() => {
140502
+ const autocompleteMode = import_react28.useMemo(() => {
140776
140503
  if (isAskingUser)
140777
140504
  return null;
140778
140505
  if (value.startsWith("$") && !value.includes(" ")) {
@@ -140783,20 +140510,20 @@ function Input({
140783
140510
  }
140784
140511
  return null;
140785
140512
  }, [value]);
140786
- const filteredCommands = import_react30.useMemo(() => {
140513
+ const filteredCommands = import_react28.useMemo(() => {
140787
140514
  if (autocompleteMode !== "command")
140788
140515
  return [];
140789
140516
  const search = value.toLowerCase();
140790
140517
  return allCommands.filter((cmd) => cmd.name.toLowerCase().startsWith(search));
140791
140518
  }, [value, autocompleteMode, allCommands]);
140792
- const filteredSkills = import_react30.useMemo(() => {
140519
+ const filteredSkills = import_react28.useMemo(() => {
140793
140520
  if (autocompleteMode !== "skill")
140794
140521
  return [];
140795
140522
  const search = value.slice(1).toLowerCase();
140796
140523
  return skills.filter((skill) => skill.name.toLowerCase().startsWith(search));
140797
140524
  }, [value, autocompleteMode, skills]);
140798
140525
  const autocompleteItems = autocompleteMode === "skill" ? filteredSkills : filteredCommands;
140799
- import_react30.useEffect(() => {
140526
+ import_react28.useEffect(() => {
140800
140527
  if (autocompleteItems.length === 0) {
140801
140528
  setSelectedIndex(0);
140802
140529
  return;
@@ -141040,7 +140767,7 @@ function Input({
141040
140767
  }
141041
140768
 
141042
140769
  // packages/terminal/src/components/Messages.tsx
141043
- var import_react31 = __toESM(require_react(), 1);
140770
+ var import_react29 = __toESM(require_react(), 1);
141044
140771
 
141045
140772
  // packages/terminal/src/components/Markdown.tsx
141046
140773
  var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
@@ -142014,9 +141741,9 @@ function Messages3({
142014
141741
  queuedMessageIds,
142015
141742
  verboseTools = false
142016
141743
  }) {
142017
- const [now2, setNow] = import_react31.useState(Date.now());
142018
- const messageGroups = import_react31.useMemo(() => groupConsecutiveToolMessages(messages), [messages]);
142019
- const messageItems = import_react31.useMemo(() => {
141744
+ const [now2, setNow] = import_react29.useState(Date.now());
141745
+ const messageGroups = import_react29.useMemo(() => groupConsecutiveToolMessages(messages), [messages]);
141746
+ const messageItems = import_react29.useMemo(() => {
142020
141747
  return messageGroups.map((group) => group.type === "single" ? { kind: "message", message: group.message } : { kind: "grouped", messages: group.messages });
142021
141748
  }, [messageGroups]);
142022
141749
  const visibleMessageItems = messageItems;
@@ -142029,7 +141756,7 @@ function Messages3({
142029
141756
  }
142030
141757
  return { id: item.messages[0].id, item };
142031
141758
  });
142032
- const toolResultMap = import_react31.useMemo(() => {
141759
+ const toolResultMap = import_react29.useMemo(() => {
142033
141760
  const map2 = new Map;
142034
141761
  for (const entry of activityLog) {
142035
141762
  if (entry.type === "tool_result" && entry.toolResult) {
@@ -142038,7 +141765,7 @@ function Messages3({
142038
141765
  }
142039
141766
  return map2;
142040
141767
  }, [activityLog]);
142041
- const hasPendingTools = import_react31.useMemo(() => {
141768
+ const hasPendingTools = import_react29.useMemo(() => {
142042
141769
  for (const entry of activityLog) {
142043
141770
  if (entry.type === "tool_call" && entry.toolCall) {
142044
141771
  if (!toolResultMap.has(entry.toolCall.id)) {
@@ -142048,7 +141775,7 @@ function Messages3({
142048
141775
  }
142049
141776
  return false;
142050
141777
  }, [activityLog, toolResultMap]);
142051
- import_react31.useEffect(() => {
141778
+ import_react29.useEffect(() => {
142052
141779
  if (!hasPendingTools)
142053
141780
  return;
142054
141781
  const interval = setInterval(() => {
@@ -142094,7 +141821,7 @@ function Messages3({
142094
141821
  if (entry.type === "tool_call" && entry.toolCall) {
142095
141822
  const resultEntry = toolResultMap.get(entry.toolCall.id);
142096
141823
  const elapsedMs = (resultEntry ? resultEntry.timestamp : now2) - entry.timestamp;
142097
- const elapsedText = formatDuration(elapsedMs);
141824
+ const elapsedText = formatDuration2(elapsedMs);
142098
141825
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
142099
141826
  marginY: 1,
142100
141827
  flexDirection: "column",
@@ -142168,7 +141895,7 @@ function Messages3({
142168
141895
  ]
142169
141896
  }, undefined, true, undefined, this);
142170
141897
  }
142171
- function formatDuration(ms2) {
141898
+ function formatDuration2(ms2) {
142172
141899
  const totalSeconds = Math.max(0, Math.floor(ms2 / 1000));
142173
141900
  if (totalSeconds < 60)
142174
141901
  return `${totalSeconds}s`;
@@ -142698,7 +142425,7 @@ function buildDisplayMessages(messages, chunkLines, wrapChars, options) {
142698
142425
  }
142699
142426
 
142700
142427
  // packages/terminal/src/components/Status.tsx
142701
- var import_react32 = __toESM(require_react(), 1);
142428
+ var import_react30 = __toESM(require_react(), 1);
142702
142429
  var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
142703
142430
  function Status({
142704
142431
  isProcessing,
@@ -142715,8 +142442,8 @@ function Status({
142715
142442
  processingStartTime,
142716
142443
  verboseTools = false
142717
142444
  }) {
142718
- const [elapsed, setElapsed] = import_react32.useState(0);
142719
- import_react32.useEffect(() => {
142445
+ const [elapsed, setElapsed] = import_react30.useState(0);
142446
+ import_react30.useEffect(() => {
142720
142447
  if (!isProcessing || !processingStartTime) {
142721
142448
  setElapsed(0);
142722
142449
  return;
@@ -142728,7 +142455,7 @@ function Status({
142728
142455
  const interval = setInterval(update, 1000);
142729
142456
  return () => clearInterval(interval);
142730
142457
  }, [isProcessing, processingStartTime]);
142731
- const formatDuration2 = (seconds) => {
142458
+ const formatDuration3 = (seconds) => {
142732
142459
  if (seconds < 60)
142733
142460
  return `${seconds}s`;
142734
142461
  const mins = Math.floor(seconds / 60);
@@ -142787,7 +142514,7 @@ function Status({
142787
142514
  dimColor: true,
142788
142515
  children: [
142789
142516
  " \xB7 ",
142790
- formatDuration2(elapsed)
142517
+ formatDuration3(elapsed)
142791
142518
  ]
142792
142519
  }, undefined, true, undefined, this),
142793
142520
  verboseLabel && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
@@ -142818,12 +142545,12 @@ function Status({
142818
142545
  }
142819
142546
 
142820
142547
  // node_modules/.bun/ink-spinner@5.0.0+43e67b6d697aa20c/node_modules/ink-spinner/build/index.js
142821
- var import_react33 = __toESM(require_react(), 1);
142548
+ var import_react31 = __toESM(require_react(), 1);
142822
142549
  var import_cli_spinners = __toESM(require_cli_spinners(), 1);
142823
142550
  function Spinner({ type = "dots" }) {
142824
- const [frame, setFrame] = import_react33.useState(0);
142551
+ const [frame, setFrame] = import_react31.useState(0);
142825
142552
  const spinner = import_cli_spinners.default[type];
142826
- import_react33.useEffect(() => {
142553
+ import_react31.useEffect(() => {
142827
142554
  const timer = setInterval(() => {
142828
142555
  setFrame((previousFrame) => {
142829
142556
  const isLastFrame = previousFrame === spinner.frames.length - 1;
@@ -142834,7 +142561,7 @@ function Spinner({ type = "dots" }) {
142834
142561
  clearInterval(timer);
142835
142562
  };
142836
142563
  }, [spinner]);
142837
- return import_react33.default.createElement(Text, null, spinner.frames[frame]);
142564
+ return import_react31.default.createElement(Text, null, spinner.frames[frame]);
142838
142565
  }
142839
142566
  var build_default2 = Spinner;
142840
142567
 
@@ -142861,7 +142588,7 @@ function Spinner2({ label }) {
142861
142588
  }
142862
142589
 
142863
142590
  // packages/terminal/src/components/ProcessingIndicator.tsx
142864
- var import_react34 = __toESM(require_react(), 1);
142591
+ var import_react32 = __toESM(require_react(), 1);
142865
142592
  var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
142866
142593
  function ProcessingIndicator({
142867
142594
  isProcessing,
@@ -142869,8 +142596,8 @@ function ProcessingIndicator({
142869
142596
  tokenCount = 0,
142870
142597
  isThinking = false
142871
142598
  }) {
142872
- const [elapsed, setElapsed] = import_react34.useState(0);
142873
- import_react34.useEffect(() => {
142599
+ const [elapsed, setElapsed] = import_react32.useState(0);
142600
+ import_react32.useEffect(() => {
142874
142601
  if (!isProcessing || !startTime) {
142875
142602
  setElapsed(0);
142876
142603
  return;
@@ -143000,7 +142727,7 @@ function WelcomeBanner({ version: version2, model, directory }) {
143000
142727
  }
143001
142728
 
143002
142729
  // packages/terminal/src/components/SessionSelector.tsx
143003
- var import_react35 = __toESM(require_react(), 1);
142730
+ var import_react33 = __toESM(require_react(), 1);
143004
142731
  var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
143005
142732
  function formatSessionTime(timestamp) {
143006
142733
  const date = new Date(timestamp);
@@ -143035,8 +142762,8 @@ function SessionSelector({
143035
142762
  onNew,
143036
142763
  onCancel
143037
142764
  }) {
143038
- const [selectedIndex, setSelectedIndex] = import_react35.useState(0);
143039
- import_react35.useEffect(() => {
142765
+ const [selectedIndex, setSelectedIndex] = import_react33.useState(0);
142766
+ import_react33.useEffect(() => {
143040
142767
  setSelectedIndex((prev) => Math.min(prev, sessions.length));
143041
142768
  }, [sessions.length]);
143042
142769
  use_input_default((input, key) => {
@@ -143329,49 +143056,40 @@ function App2({ cwd: cwd2, version: version2 }) {
143329
143056
  const { stdout } = use_stdout_default();
143330
143057
  const rows = stdout?.rows ?? 24;
143331
143058
  const columns = stdout?.columns ?? 80;
143332
- const [registry] = import_react36.useState(() => new SessionRegistry);
143333
- const registryRef = import_react36.useRef(registry);
143334
- const [activeSessionId, setActiveSessionId] = import_react36.useState(null);
143335
- const [isInitializing, setIsInitializing] = import_react36.useState(true);
143336
- const [showSessionSelector, setShowSessionSelector] = import_react36.useState(false);
143337
- const sessionUIStates = import_react36.useRef(new Map);
143338
- const [messages, setMessages] = import_react36.useState([]);
143339
- const [currentResponse, setCurrentResponse] = import_react36.useState("");
143340
- const [currentToolCall, setCurrentToolCall] = import_react36.useState();
143341
- const [isProcessing, setIsProcessing] = import_react36.useState(false);
143342
- const [error2, setError] = import_react36.useState(null);
143343
- const [messageQueue, setMessageQueue] = import_react36.useState([]);
143344
- const [inlinePending, setInlinePending] = import_react36.useState([]);
143345
- const [activityLog, setActivityLog] = import_react36.useState([]);
143346
- const [tokenUsage, setTokenUsage] = import_react36.useState();
143347
- const [energyState, setEnergyState] = import_react36.useState();
143348
- const [voiceState, setVoiceState] = import_react36.useState();
143349
- const [identityInfo, setIdentityInfo] = import_react36.useState();
143350
- const [verboseTools, setVerboseTools] = import_react36.useState(false);
143351
- const [askUserState, setAskUserState] = import_react36.useState(null);
143352
- const [processingStartTime, setProcessingStartTime] = import_react36.useState();
143353
- const [currentTurnTokens, setCurrentTurnTokens] = import_react36.useState(0);
143354
- const [scrollOffset, setScrollOffset] = import_react36.useState(0);
143355
- const [autoScroll, setAutoScroll] = import_react36.useState(true);
143356
- const scrollRef = import_react36.useRef(null);
143357
- const [skills, setSkills] = import_react36.useState([]);
143358
- const [commands3, setCommands] = import_react36.useState([]);
143359
- const responseRef = import_react36.useRef("");
143360
- const toolCallsRef = import_react36.useRef([]);
143361
- const toolResultsRef = import_react36.useRef([]);
143362
- const activityLogRef = import_react36.useRef([]);
143363
- const skipNextDoneRef = import_react36.useRef(false);
143364
- const isProcessingRef = import_react36.useRef(isProcessing);
143365
- const processingStartTimeRef = import_react36.useRef(processingStartTime);
143366
- const pendingSendsRef = import_react36.useRef([]);
143367
- const askUserStateRef = import_react36.useRef(null);
143368
- const updateScrollMetrics = import_react36.useCallback((offset) => {
143369
- const currentOffset = typeof offset === "number" ? offset : scrollRef.current?.getScrollOffset() ?? 0;
143370
- const bottomOffset = scrollRef.current?.getBottomOffset() ?? 0;
143371
- setScrollOffset(currentOffset);
143372
- setAutoScroll(currentOffset >= Math.max(0, bottomOffset - 1));
143373
- }, []);
143374
- const beginAskUser = import_react36.useCallback((sessionId, request2) => {
143059
+ const [registry] = import_react34.useState(() => new SessionRegistry);
143060
+ const registryRef = import_react34.useRef(registry);
143061
+ const [activeSessionId, setActiveSessionId] = import_react34.useState(null);
143062
+ const [isInitializing, setIsInitializing] = import_react34.useState(true);
143063
+ const [showSessionSelector, setShowSessionSelector] = import_react34.useState(false);
143064
+ const sessionUIStates = import_react34.useRef(new Map);
143065
+ const [messages, setMessages] = import_react34.useState([]);
143066
+ const [currentResponse, setCurrentResponse] = import_react34.useState("");
143067
+ const [currentToolCall, setCurrentToolCall] = import_react34.useState();
143068
+ const [isProcessing, setIsProcessing] = import_react34.useState(false);
143069
+ const [error2, setError] = import_react34.useState(null);
143070
+ const [messageQueue, setMessageQueue] = import_react34.useState([]);
143071
+ const [inlinePending, setInlinePending] = import_react34.useState([]);
143072
+ const [activityLog, setActivityLog] = import_react34.useState([]);
143073
+ const [tokenUsage, setTokenUsage] = import_react34.useState();
143074
+ const [energyState, setEnergyState] = import_react34.useState();
143075
+ const [voiceState, setVoiceState] = import_react34.useState();
143076
+ const [identityInfo, setIdentityInfo] = import_react34.useState();
143077
+ const [verboseTools, setVerboseTools] = import_react34.useState(false);
143078
+ const [askUserState, setAskUserState] = import_react34.useState(null);
143079
+ const [processingStartTime, setProcessingStartTime] = import_react34.useState();
143080
+ const [currentTurnTokens, setCurrentTurnTokens] = import_react34.useState(0);
143081
+ const [skills, setSkills] = import_react34.useState([]);
143082
+ const [commands3, setCommands] = import_react34.useState([]);
143083
+ const responseRef = import_react34.useRef("");
143084
+ const toolCallsRef = import_react34.useRef([]);
143085
+ const toolResultsRef = import_react34.useRef([]);
143086
+ const activityLogRef = import_react34.useRef([]);
143087
+ const skipNextDoneRef = import_react34.useRef(false);
143088
+ const isProcessingRef = import_react34.useRef(isProcessing);
143089
+ const processingStartTimeRef = import_react34.useRef(processingStartTime);
143090
+ const pendingSendsRef = import_react34.useRef([]);
143091
+ const askUserStateRef = import_react34.useRef(null);
143092
+ const beginAskUser = import_react34.useCallback((sessionId, request2) => {
143375
143093
  return new Promise((resolve5, reject) => {
143376
143094
  if (askUserStateRef.current) {
143377
143095
  reject(new Error("Another interview is already in progress."));
@@ -143389,7 +143107,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143389
143107
  setAskUserState(state);
143390
143108
  });
143391
143109
  }, []);
143392
- const cancelAskUser = import_react36.useCallback((reason) => {
143110
+ const cancelAskUser = import_react34.useCallback((reason) => {
143393
143111
  const current = askUserStateRef.current;
143394
143112
  if (!current)
143395
143113
  return;
@@ -143397,7 +143115,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143397
143115
  setAskUserState(null);
143398
143116
  current.reject(new Error(reason));
143399
143117
  }, []);
143400
- const submitAskAnswer = import_react36.useCallback((answer) => {
143118
+ const submitAskAnswer = import_react34.useCallback((answer) => {
143401
143119
  setAskUserState((prev) => {
143402
143120
  if (!prev)
143403
143121
  return prev;
@@ -143418,31 +143136,19 @@ function App2({ cwd: cwd2, version: version2 }) {
143418
143136
  return nextState;
143419
143137
  });
143420
143138
  }, []);
143421
- import_react36.useEffect(() => {
143422
- if (!stdout)
143423
- return;
143424
- const handleResize = () => {
143425
- scrollRef.current?.remeasure();
143426
- updateScrollMetrics();
143427
- };
143428
- stdout.on("resize", handleResize);
143429
- return () => {
143430
- stdout.off("resize", handleResize);
143431
- };
143432
- }, [stdout, updateScrollMetrics]);
143433
- const turnIdRef = import_react36.useRef(0);
143434
- import_react36.useEffect(() => {
143139
+ const turnIdRef = import_react34.useRef(0);
143140
+ import_react34.useEffect(() => {
143435
143141
  isProcessingRef.current = isProcessing;
143436
143142
  }, [isProcessing]);
143437
- import_react36.useEffect(() => {
143143
+ import_react34.useEffect(() => {
143438
143144
  processingStartTimeRef.current = processingStartTime;
143439
143145
  }, [processingStartTime]);
143440
- import_react36.useEffect(() => {
143146
+ import_react34.useEffect(() => {
143441
143147
  if (isProcessing && !processingStartTime) {
143442
143148
  setProcessingStartTime(Date.now());
143443
143149
  }
143444
143150
  }, [isProcessing, processingStartTime]);
143445
- const buildFullResponse = import_react36.useCallback(() => {
143151
+ const buildFullResponse = import_react34.useCallback(() => {
143446
143152
  const parts = activityLogRef.current.filter((entry) => entry.type === "text" && entry.content).map((entry) => entry.content);
143447
143153
  if (responseRef.current.trim()) {
143448
143154
  parts.push(responseRef.current);
@@ -143450,7 +143156,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143450
143156
  return parts.join(`
143451
143157
  `).trim();
143452
143158
  }, []);
143453
- const loadSessionMetadata = import_react36.useCallback(async (session) => {
143159
+ const loadSessionMetadata = import_react34.useCallback(async (session) => {
143454
143160
  try {
143455
143161
  const [loadedSkills, loadedCommands] = await Promise.all([
143456
143162
  session.client.getSkills(),
@@ -143469,7 +143175,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143469
143175
  setError(err instanceof Error ? err.message : String(err));
143470
143176
  }
143471
143177
  }, []);
143472
- const finalizeResponse = import_react36.useCallback((status) => {
143178
+ const finalizeResponse = import_react34.useCallback((status) => {
143473
143179
  const baseContent = buildFullResponse();
143474
143180
  const hasContent = baseContent.length > 0;
143475
143181
  const activityToolCalls = activityLogRef.current.filter((entry) => entry.type === "tool_call" && entry.toolCall).map((entry) => entry.toolCall);
@@ -143527,7 +143233,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143527
143233
  ]);
143528
143234
  return true;
143529
143235
  }, [buildFullResponse]);
143530
- const resetTurnState = import_react36.useCallback(() => {
143236
+ const resetTurnState = import_react34.useCallback(() => {
143531
143237
  setCurrentResponse("");
143532
143238
  responseRef.current = "";
143533
143239
  toolCallsRef.current = [];
@@ -143538,7 +143244,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143538
143244
  setProcessingStartTime(undefined);
143539
143245
  setCurrentTurnTokens(0);
143540
143246
  }, []);
143541
- const saveCurrentSessionState = import_react36.useCallback(() => {
143247
+ const saveCurrentSessionState = import_react34.useCallback(() => {
143542
143248
  if (activeSessionId) {
143543
143249
  sessionUIStates.current.set(activeSessionId, {
143544
143250
  messages,
@@ -143556,7 +143262,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143556
143262
  });
143557
143263
  }
143558
143264
  }, [activeSessionId, messages, tokenUsage, energyState, voiceState, identityInfo, processingStartTime, currentTurnTokens, error2]);
143559
- const loadSessionState = import_react36.useCallback((sessionId) => {
143265
+ const loadSessionState = import_react34.useCallback((sessionId) => {
143560
143266
  const state = sessionUIStates.current.get(sessionId);
143561
143267
  if (state) {
143562
143268
  setMessages(state.messages);
@@ -143591,10 +143297,8 @@ function App2({ cwd: cwd2, version: version2 }) {
143591
143297
  setCurrentTurnTokens(0);
143592
143298
  setError(null);
143593
143299
  }
143594
- setScrollOffset(0);
143595
- setAutoScroll(true);
143596
143300
  }, []);
143597
- const handleChunk = import_react36.useCallback((chunk) => {
143301
+ const handleChunk = import_react34.useCallback((chunk) => {
143598
143302
  const isStartChunk = chunk.type === "text" || chunk.type === "tool_use";
143599
143303
  const isTerminalChunk = chunk.type === "error" || chunk.type === "done";
143600
143304
  if (!isProcessingRef.current && (isStartChunk || isTerminalChunk)) {
@@ -143718,7 +143422,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143718
143422
  }
143719
143423
  }
143720
143424
  }, [registry, exit, finalizeResponse, resetTurnState]);
143721
- import_react36.useEffect(() => {
143425
+ import_react34.useEffect(() => {
143722
143426
  const initSession = async () => {
143723
143427
  try {
143724
143428
  registry.onChunk(handleChunk);
@@ -143754,7 +143458,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143754
143458
  registry.closeAll();
143755
143459
  };
143756
143460
  }, [cwd2, registry, handleChunk, finalizeResponse, resetTurnState, loadSessionMetadata, beginAskUser]);
143757
- const processQueue = import_react36.useCallback(async () => {
143461
+ const processQueue = import_react34.useCallback(async () => {
143758
143462
  const activeSession2 = registryRef.current.getActiveSession();
143759
143463
  if (!activeSession2 || !activeSessionId)
143760
143464
  return;
@@ -143804,7 +143508,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143804
143508
  }, [activeSessionId]);
143805
143509
  const activeQueue = activeSessionId ? messageQueue.filter((msg) => msg.sessionId === activeSessionId) : [];
143806
143510
  const activeInline = activeSessionId ? inlinePending.filter((msg) => msg.sessionId === activeSessionId) : [];
143807
- const queuedMessageIds = import_react36.useMemo(() => new Set(activeQueue.filter((msg) => msg.mode === "queued").map((msg) => msg.id)), [activeQueue]);
143511
+ const queuedMessageIds = import_react34.useMemo(() => new Set(activeQueue.filter((msg) => msg.mode === "queued").map((msg) => msg.id)), [activeQueue]);
143808
143512
  const sessions = registry.listSessions();
143809
143513
  const activeSession = registry.getActiveSession();
143810
143514
  const sessionIndex = activeSessionId ? registry.getSessionIndex(activeSessionId) : 0;
@@ -143814,11 +143518,28 @@ function App2({ cwd: cwd2, version: version2 }) {
143814
143518
  const inlineCount = activeInline.length;
143815
143519
  const activeAskQuestion = askUserState?.request.questions[askUserState.index];
143816
143520
  const askPlaceholder = activeAskQuestion?.placeholder || activeAskQuestion?.question || "Answer the question...";
143521
+ const hasPendingTools = import_react34.useMemo(() => {
143522
+ const toolResultIds = new Set;
143523
+ for (const entry of activityLog) {
143524
+ if (entry.type === "tool_result" && entry.toolResult) {
143525
+ toolResultIds.add(entry.toolResult.toolCallId);
143526
+ }
143527
+ }
143528
+ for (const entry of activityLog) {
143529
+ if (entry.type === "tool_call" && entry.toolCall) {
143530
+ if (!toolResultIds.has(entry.toolCall.id)) {
143531
+ return true;
143532
+ }
143533
+ }
143534
+ }
143535
+ return false;
143536
+ }, [activityLog]);
143537
+ const isBusy = isProcessing || hasPendingTools;
143817
143538
  const showWelcome = messages.length === 0 && !isProcessing;
143818
143539
  const renderWidth = columns ? Math.max(1, columns - 2) : undefined;
143819
143540
  const wrapChars = renderWidth ?? MESSAGE_WRAP_CHARS;
143820
- const displayMessages = import_react36.useMemo(() => buildDisplayMessages(messages, MESSAGE_CHUNK_LINES, wrapChars, { maxWidth: renderWidth }), [messages, wrapChars, renderWidth]);
143821
- const streamingMessages = import_react36.useMemo(() => {
143541
+ const displayMessages = import_react34.useMemo(() => buildDisplayMessages(messages, MESSAGE_CHUNK_LINES, wrapChars, { maxWidth: renderWidth }), [messages, wrapChars, renderWidth]);
143542
+ const streamingMessages = import_react34.useMemo(() => {
143822
143543
  if (!isProcessing || !currentResponse.trim())
143823
143544
  return [];
143824
143545
  const streamingMessage = {
@@ -143829,20 +143550,12 @@ function App2({ cwd: cwd2, version: version2 }) {
143829
143550
  };
143830
143551
  return buildDisplayMessages([streamingMessage], MESSAGE_CHUNK_LINES, wrapChars, { maxWidth: renderWidth });
143831
143552
  }, [currentResponse, isProcessing, wrapChars, renderWidth]);
143832
- import_react36.useEffect(() => {
143553
+ import_react34.useEffect(() => {
143833
143554
  if (!isProcessing && activeQueue.length > 0 && activeInline.length === 0) {
143834
143555
  processQueue();
143835
143556
  }
143836
143557
  }, [isProcessing, activeQueue.length, activeInline.length, processQueue]);
143837
- import_react36.useEffect(() => {
143838
- if (!autoScroll)
143839
- return;
143840
- scrollRef.current?.scrollToBottom();
143841
- }, [displayMessages, activityLog, streamingMessages, autoScroll]);
143842
- import_react36.useEffect(() => {
143843
- updateScrollMetrics();
143844
- }, [displayMessages, activityLog, streamingMessages, updateScrollMetrics]);
143845
- const handleSessionSwitch = import_react36.useCallback(async (sessionId) => {
143558
+ const handleSessionSwitch = import_react34.useCallback(async (sessionId) => {
143846
143559
  setShowSessionSelector(false);
143847
143560
  if (sessionId === activeSessionId) {
143848
143561
  return;
@@ -143861,7 +143574,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143861
143574
  await registry.switchSession(sessionId);
143862
143575
  setActiveSessionId(sessionId);
143863
143576
  }, [activeSessionId, registry, saveCurrentSessionState, loadSessionState]);
143864
- const handleNewSession = import_react36.useCallback(async () => {
143577
+ const handleNewSession = import_react34.useCallback(async () => {
143865
143578
  setShowSessionSelector(false);
143866
143579
  try {
143867
143580
  saveCurrentSessionState();
@@ -143880,12 +143593,6 @@ function App2({ cwd: cwd2, version: version2 }) {
143880
143593
  setError(err instanceof Error ? err.message : "Failed to create session");
143881
143594
  }
143882
143595
  }, [cwd2, registry, saveCurrentSessionState, loadSessionState, beginAskUser]);
143883
- const getScrollStep = import_react36.useCallback(() => {
143884
- const viewport = scrollRef.current?.getViewportHeight();
143885
- const fallback = Math.max(3, rows - 6);
143886
- const height = viewport ?? fallback;
143887
- return Math.max(3, Math.floor(height / 2));
143888
- }, [rows]);
143889
143596
  use_input_default((input, key) => {
143890
143597
  if (key.ctrl && input === "s") {
143891
143598
  if (sessions.length > 0) {
@@ -143897,7 +143604,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143897
143604
  if (askUserStateRef.current) {
143898
143605
  cancelAskUser("Cancelled by user");
143899
143606
  }
143900
- if (isProcessing && activeSession) {
143607
+ if ((isProcessing || hasPendingTools) && activeSession) {
143901
143608
  activeSession.client.stop();
143902
143609
  const finalized = finalizeResponse("stopped");
143903
143610
  if (finalized) {
@@ -143920,7 +143627,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143920
143627
  if (askUserStateRef.current) {
143921
143628
  cancelAskUser("Cancelled by user");
143922
143629
  }
143923
- if (isProcessing && activeSession) {
143630
+ if ((isProcessing || hasPendingTools) && activeSession) {
143924
143631
  activeSession.client.stop();
143925
143632
  const finalized = finalizeResponse("stopped");
143926
143633
  if (finalized) {
@@ -143932,31 +143639,8 @@ function App2({ cwd: cwd2, version: version2 }) {
143932
143639
  isProcessingRef.current = false;
143933
143640
  }
143934
143641
  }
143935
- if (key.pageUp || key.shift && key.upArrow) {
143936
- const step = getScrollStep();
143937
- scrollRef.current?.scrollBy(-step);
143938
- setAutoScroll(false);
143939
- }
143940
- if (key.pageDown || key.shift && key.downArrow) {
143941
- const step = getScrollStep();
143942
- scrollRef.current?.scrollBy(step);
143943
- }
143944
- if (key.ctrl && input === "u") {
143945
- scrollRef.current?.scrollToTop();
143946
- setAutoScroll(false);
143947
- }
143948
- if (key.ctrl && input === "d") {
143949
- scrollRef.current?.scrollToBottom();
143950
- setAutoScroll(true);
143951
- }
143952
143642
  }, { isActive: !showSessionSelector });
143953
- import_react36.useEffect(() => {
143954
- if (!activeSessionId)
143955
- return;
143956
- scrollRef.current?.scrollToBottom();
143957
- setAutoScroll(true);
143958
- }, [activeSessionId]);
143959
- const handleSubmit = import_react36.useCallback(async (input, mode = "normal") => {
143643
+ const handleSubmit = import_react34.useCallback(async (input, mode = "normal") => {
143960
143644
  if (askUserStateRef.current) {
143961
143645
  submitAskAnswer(input.trim());
143962
143646
  return;
@@ -144117,7 +143801,6 @@ function App2({ cwd: cwd2, version: version2 }) {
144117
143801
  return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
144118
143802
  flexDirection: "column",
144119
143803
  padding: 1,
144120
- height: rows,
144121
143804
  children: [
144122
143805
  showWelcome && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(WelcomeBanner, {
144123
143806
  version: version2 ?? "unknown",
@@ -144136,37 +143819,29 @@ function App2({ cwd: cwd2, version: version2 }) {
144136
143819
  ]
144137
143820
  }, undefined, true, undefined, this)
144138
143821
  }, undefined, false, undefined, this),
144139
- scrollOffset > 0 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
144140
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
144141
- dimColor: true,
144142
- children: [
144143
- "\u2191 ",
144144
- Math.round(scrollOffset),
144145
- " more lines above (Shift+\u2193 or Page Down to scroll down)"
144146
- ]
144147
- }, undefined, true, undefined, this)
144148
- }, undefined, false, undefined, this),
144149
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
144150
- flexGrow: 1,
144151
- flexShrink: 1,
144152
- minHeight: 1,
144153
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ScrollView, {
144154
- ref: scrollRef,
144155
- onScroll: (offset) => updateScrollMetrics(offset),
144156
- onContentHeightChange: () => updateScrollMetrics(),
144157
- onViewportSizeChange: () => updateScrollMetrics(),
144158
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Messages3, {
144159
- messages: displayMessages,
144160
- currentResponse: undefined,
144161
- streamingMessages,
144162
- currentToolCall: undefined,
144163
- lastToolResult: undefined,
144164
- activityLog: isProcessing ? activityLog : [],
144165
- queuedMessageIds,
144166
- verboseTools
144167
- }, activeSessionId || "default", false, undefined, this)
144168
- }, undefined, false, undefined, this)
143822
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Static, {
143823
+ items: displayMessages,
143824
+ children: (message) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Messages3, {
143825
+ messages: [message],
143826
+ currentResponse: undefined,
143827
+ streamingMessages: [],
143828
+ currentToolCall: undefined,
143829
+ lastToolResult: undefined,
143830
+ activityLog: [],
143831
+ queuedMessageIds,
143832
+ verboseTools
143833
+ }, message.id, false, undefined, this)
144169
143834
  }, undefined, false, undefined, this),
143835
+ isProcessing && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Messages3, {
143836
+ messages: [],
143837
+ currentResponse: undefined,
143838
+ streamingMessages,
143839
+ currentToolCall: undefined,
143840
+ lastToolResult: undefined,
143841
+ activityLog,
143842
+ queuedMessageIds,
143843
+ verboseTools
143844
+ }, "streaming", false, undefined, this),
144170
143845
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(QueueIndicator, {
144171
143846
  messages: [...activeInline, ...activeQueue],
144172
143847
  maxPreview: MAX_QUEUED_PREVIEW
@@ -144190,7 +143865,7 @@ function App2({ cwd: cwd2, version: version2 }) {
144190
143865
  }, undefined, false, undefined, this),
144191
143866
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Input, {
144192
143867
  onSubmit: handleSubmit,
144193
- isProcessing,
143868
+ isProcessing: isBusy,
144194
143869
  queueLength: activeQueue.length + inlineCount,
144195
143870
  commands: commands3,
144196
143871
  skills,
@@ -144198,7 +143873,7 @@ function App2({ cwd: cwd2, version: version2 }) {
144198
143873
  askPlaceholder
144199
143874
  }, undefined, false, undefined, this),
144200
143875
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Status, {
144201
- isProcessing,
143876
+ isProcessing: isBusy,
144202
143877
  cwd: activeSession?.cwd || cwd2,
144203
143878
  queueLength: activeQueue.length + inlineCount,
144204
143879
  tokenUsage,
@@ -144391,7 +144066,7 @@ function formatStreamEvent(chunk) {
144391
144066
 
144392
144067
  // packages/terminal/src/index.tsx
144393
144068
  var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
144394
- var VERSION3 = "0.6.42";
144069
+ var VERSION3 = "0.6.43";
144395
144070
  function parseArgs(argv) {
144396
144071
  const args = argv.slice(2);
144397
144072
  const options = {
@@ -144546,4 +144221,4 @@ if (options.print !== null) {
144546
144221
  });
144547
144222
  }
144548
144223
 
144549
- //# debugId=D518576C49ADB4E664756E2164756E21
144224
+ //# debugId=91A8E7F4880D78B064756E2164756E21