@hasna/assistants 0.6.42 → 0.6.45

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.45";
120272
119997
  function resolveAuthTimeout(resolve5) {
120273
119998
  resolve5({ exitCode: 1, stdout: { toString: () => "{}" } });
120274
119999
  }
@@ -120905,6 +120630,8 @@ Identities:
120905
120630
  message += ` - Global commands go in ~/.assistants/commands/*.md
120906
120631
  `;
120907
120632
  message += ` - Use /init to create a starter command
120633
+ `;
120634
+ message += ` - The agent can use the wait/sleep tool to pause between actions
120908
120635
  `;
120909
120636
  context.emit("text", message);
120910
120637
  context.emit("done");
@@ -136481,9 +136208,10 @@ function createEmailProvider(config) {
136481
136208
  });
136482
136209
  }
136483
136210
  const region = config.ses?.region || config.storage?.region || "us-east-1";
136211
+ const credentialsProfile = config.ses?.credentialsProfile || config.storage?.credentialsProfile;
136484
136212
  return new SESProvider({
136485
136213
  region,
136486
- credentialsProfile: config.storage?.credentialsProfile
136214
+ credentialsProfile
136487
136215
  });
136488
136216
  }
136489
136217
 
@@ -138914,6 +138642,8 @@ class AgentLoop {
138914
138642
  this.toolRegistry.register(askUserTool.tool, askUserTool.executor);
138915
138643
  this.toolRegistry.register(FeedbackTool.tool, FeedbackTool.executor);
138916
138644
  this.toolRegistry.register(SchedulerTool.tool, SchedulerTool.executor);
138645
+ this.toolRegistry.register(WaitTool.tool, WaitTool.executor);
138646
+ this.toolRegistry.register(SleepTool.tool, SleepTool.executor);
138917
138647
  if (this.config?.inbox?.enabled) {
138918
138648
  const assistant = this.assistantManager?.getActive();
138919
138649
  const agentId = assistant?.id || this.sessionId;
@@ -138937,8 +138667,8 @@ class AgentLoop {
138937
138667
  this.emit({ type: "text", content: message });
138938
138668
  });
138939
138669
  const jobTools = createJobTools(() => this.jobManager);
138940
- for (const { tool, executor } of jobTools) {
138941
- this.toolRegistry.register(tool, executor);
138670
+ for (const { tool, executor: executor2 } of jobTools) {
138671
+ this.toolRegistry.register(tool, executor2);
138942
138672
  }
138943
138673
  this.connectorBridge.setJobManagerGetter(() => this.jobManager);
138944
138674
  this.jobManager.cleanup().catch(() => {});
@@ -140629,17 +140359,17 @@ init_retry();
140629
140359
  init_src();
140630
140360
 
140631
140361
  // packages/terminal/src/components/Input.tsx
140632
- var import_react30 = __toESM(require_react(), 1);
140362
+ var import_react28 = __toESM(require_react(), 1);
140633
140363
 
140634
140364
  // 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);
140365
+ var import_react27 = __toESM(require_react(), 1);
140636
140366
  function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
140637
- const [state, setState] = import_react29.useState({
140367
+ const [state, setState] = import_react27.useState({
140638
140368
  cursorOffset: (originalValue || "").length,
140639
140369
  cursorWidth: 0
140640
140370
  });
140641
140371
  const { cursorOffset, cursorWidth } = state;
140642
- import_react29.useEffect(() => {
140372
+ import_react27.useEffect(() => {
140643
140373
  setState((previousState) => {
140644
140374
  if (!focus || !showCursor) {
140645
140375
  return previousState;
@@ -140717,7 +140447,7 @@ function TextInput({ value: originalValue, placeholder = "", focus = true, mask,
140717
140447
  onChange(nextValue);
140718
140448
  }
140719
140449
  }, { isActive: focus });
140720
- return import_react29.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
140450
+ return import_react27.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
140721
140451
  }
140722
140452
  var build_default = TextInput;
140723
140453
 
@@ -140759,9 +140489,9 @@ function Input({
140759
140489
  isAskingUser = false,
140760
140490
  askPlaceholder
140761
140491
  }) {
140762
- const [value, setValue] = import_react30.useState("");
140763
- const [selectedIndex, setSelectedIndex] = import_react30.useState(0);
140764
- const allCommands = import_react30.useMemo(() => {
140492
+ const [value, setValue] = import_react28.useState("");
140493
+ const [selectedIndex, setSelectedIndex] = import_react28.useState(0);
140494
+ const allCommands = import_react28.useMemo(() => {
140765
140495
  const merged = [...COMMANDS];
140766
140496
  if (commands3) {
140767
140497
  for (const cmd of commands3) {
@@ -140772,7 +140502,7 @@ function Input({
140772
140502
  }
140773
140503
  return merged.sort((a5, b7) => a5.name.localeCompare(b7.name));
140774
140504
  }, [commands3]);
140775
- const autocompleteMode = import_react30.useMemo(() => {
140505
+ const autocompleteMode = import_react28.useMemo(() => {
140776
140506
  if (isAskingUser)
140777
140507
  return null;
140778
140508
  if (value.startsWith("$") && !value.includes(" ")) {
@@ -140783,20 +140513,20 @@ function Input({
140783
140513
  }
140784
140514
  return null;
140785
140515
  }, [value]);
140786
- const filteredCommands = import_react30.useMemo(() => {
140516
+ const filteredCommands = import_react28.useMemo(() => {
140787
140517
  if (autocompleteMode !== "command")
140788
140518
  return [];
140789
140519
  const search = value.toLowerCase();
140790
140520
  return allCommands.filter((cmd) => cmd.name.toLowerCase().startsWith(search));
140791
140521
  }, [value, autocompleteMode, allCommands]);
140792
- const filteredSkills = import_react30.useMemo(() => {
140522
+ const filteredSkills = import_react28.useMemo(() => {
140793
140523
  if (autocompleteMode !== "skill")
140794
140524
  return [];
140795
140525
  const search = value.slice(1).toLowerCase();
140796
140526
  return skills.filter((skill) => skill.name.toLowerCase().startsWith(search));
140797
140527
  }, [value, autocompleteMode, skills]);
140798
140528
  const autocompleteItems = autocompleteMode === "skill" ? filteredSkills : filteredCommands;
140799
- import_react30.useEffect(() => {
140529
+ import_react28.useEffect(() => {
140800
140530
  if (autocompleteItems.length === 0) {
140801
140531
  setSelectedIndex(0);
140802
140532
  return;
@@ -141040,7 +140770,7 @@ function Input({
141040
140770
  }
141041
140771
 
141042
140772
  // packages/terminal/src/components/Messages.tsx
141043
- var import_react31 = __toESM(require_react(), 1);
140773
+ var import_react29 = __toESM(require_react(), 1);
141044
140774
 
141045
140775
  // packages/terminal/src/components/Markdown.tsx
141046
140776
  var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
@@ -142014,9 +141744,9 @@ function Messages3({
142014
141744
  queuedMessageIds,
142015
141745
  verboseTools = false
142016
141746
  }) {
142017
- const [now2, setNow] = import_react31.useState(Date.now());
142018
- const messageGroups = import_react31.useMemo(() => groupConsecutiveToolMessages(messages), [messages]);
142019
- const messageItems = import_react31.useMemo(() => {
141747
+ const [now2, setNow] = import_react29.useState(Date.now());
141748
+ const messageGroups = import_react29.useMemo(() => groupConsecutiveToolMessages(messages), [messages]);
141749
+ const messageItems = import_react29.useMemo(() => {
142020
141750
  return messageGroups.map((group) => group.type === "single" ? { kind: "message", message: group.message } : { kind: "grouped", messages: group.messages });
142021
141751
  }, [messageGroups]);
142022
141752
  const visibleMessageItems = messageItems;
@@ -142029,7 +141759,7 @@ function Messages3({
142029
141759
  }
142030
141760
  return { id: item.messages[0].id, item };
142031
141761
  });
142032
- const toolResultMap = import_react31.useMemo(() => {
141762
+ const toolResultMap = import_react29.useMemo(() => {
142033
141763
  const map2 = new Map;
142034
141764
  for (const entry of activityLog) {
142035
141765
  if (entry.type === "tool_result" && entry.toolResult) {
@@ -142038,7 +141768,7 @@ function Messages3({
142038
141768
  }
142039
141769
  return map2;
142040
141770
  }, [activityLog]);
142041
- const hasPendingTools = import_react31.useMemo(() => {
141771
+ const hasPendingTools = import_react29.useMemo(() => {
142042
141772
  for (const entry of activityLog) {
142043
141773
  if (entry.type === "tool_call" && entry.toolCall) {
142044
141774
  if (!toolResultMap.has(entry.toolCall.id)) {
@@ -142048,7 +141778,7 @@ function Messages3({
142048
141778
  }
142049
141779
  return false;
142050
141780
  }, [activityLog, toolResultMap]);
142051
- import_react31.useEffect(() => {
141781
+ import_react29.useEffect(() => {
142052
141782
  if (!hasPendingTools)
142053
141783
  return;
142054
141784
  const interval = setInterval(() => {
@@ -142094,7 +141824,7 @@ function Messages3({
142094
141824
  if (entry.type === "tool_call" && entry.toolCall) {
142095
141825
  const resultEntry = toolResultMap.get(entry.toolCall.id);
142096
141826
  const elapsedMs = (resultEntry ? resultEntry.timestamp : now2) - entry.timestamp;
142097
- const elapsedText = formatDuration(elapsedMs);
141827
+ const elapsedText = formatDuration2(elapsedMs);
142098
141828
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
142099
141829
  marginY: 1,
142100
141830
  flexDirection: "column",
@@ -142168,7 +141898,7 @@ function Messages3({
142168
141898
  ]
142169
141899
  }, undefined, true, undefined, this);
142170
141900
  }
142171
- function formatDuration(ms2) {
141901
+ function formatDuration2(ms2) {
142172
141902
  const totalSeconds = Math.max(0, Math.floor(ms2 / 1000));
142173
141903
  if (totalSeconds < 60)
142174
141904
  return `${totalSeconds}s`;
@@ -142698,7 +142428,7 @@ function buildDisplayMessages(messages, chunkLines, wrapChars, options) {
142698
142428
  }
142699
142429
 
142700
142430
  // packages/terminal/src/components/Status.tsx
142701
- var import_react32 = __toESM(require_react(), 1);
142431
+ var import_react30 = __toESM(require_react(), 1);
142702
142432
  var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
142703
142433
  function Status({
142704
142434
  isProcessing,
@@ -142715,8 +142445,8 @@ function Status({
142715
142445
  processingStartTime,
142716
142446
  verboseTools = false
142717
142447
  }) {
142718
- const [elapsed, setElapsed] = import_react32.useState(0);
142719
- import_react32.useEffect(() => {
142448
+ const [elapsed, setElapsed] = import_react30.useState(0);
142449
+ import_react30.useEffect(() => {
142720
142450
  if (!isProcessing || !processingStartTime) {
142721
142451
  setElapsed(0);
142722
142452
  return;
@@ -142728,7 +142458,7 @@ function Status({
142728
142458
  const interval = setInterval(update, 1000);
142729
142459
  return () => clearInterval(interval);
142730
142460
  }, [isProcessing, processingStartTime]);
142731
- const formatDuration2 = (seconds) => {
142461
+ const formatDuration3 = (seconds) => {
142732
142462
  if (seconds < 60)
142733
142463
  return `${seconds}s`;
142734
142464
  const mins = Math.floor(seconds / 60);
@@ -142787,7 +142517,7 @@ function Status({
142787
142517
  dimColor: true,
142788
142518
  children: [
142789
142519
  " \xB7 ",
142790
- formatDuration2(elapsed)
142520
+ formatDuration3(elapsed)
142791
142521
  ]
142792
142522
  }, undefined, true, undefined, this),
142793
142523
  verboseLabel && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
@@ -142818,12 +142548,12 @@ function Status({
142818
142548
  }
142819
142549
 
142820
142550
  // node_modules/.bun/ink-spinner@5.0.0+43e67b6d697aa20c/node_modules/ink-spinner/build/index.js
142821
- var import_react33 = __toESM(require_react(), 1);
142551
+ var import_react31 = __toESM(require_react(), 1);
142822
142552
  var import_cli_spinners = __toESM(require_cli_spinners(), 1);
142823
142553
  function Spinner({ type = "dots" }) {
142824
- const [frame, setFrame] = import_react33.useState(0);
142554
+ const [frame, setFrame] = import_react31.useState(0);
142825
142555
  const spinner = import_cli_spinners.default[type];
142826
- import_react33.useEffect(() => {
142556
+ import_react31.useEffect(() => {
142827
142557
  const timer = setInterval(() => {
142828
142558
  setFrame((previousFrame) => {
142829
142559
  const isLastFrame = previousFrame === spinner.frames.length - 1;
@@ -142834,7 +142564,7 @@ function Spinner({ type = "dots" }) {
142834
142564
  clearInterval(timer);
142835
142565
  };
142836
142566
  }, [spinner]);
142837
- return import_react33.default.createElement(Text, null, spinner.frames[frame]);
142567
+ return import_react31.default.createElement(Text, null, spinner.frames[frame]);
142838
142568
  }
142839
142569
  var build_default2 = Spinner;
142840
142570
 
@@ -142861,7 +142591,7 @@ function Spinner2({ label }) {
142861
142591
  }
142862
142592
 
142863
142593
  // packages/terminal/src/components/ProcessingIndicator.tsx
142864
- var import_react34 = __toESM(require_react(), 1);
142594
+ var import_react32 = __toESM(require_react(), 1);
142865
142595
  var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
142866
142596
  function ProcessingIndicator({
142867
142597
  isProcessing,
@@ -142869,8 +142599,8 @@ function ProcessingIndicator({
142869
142599
  tokenCount = 0,
142870
142600
  isThinking = false
142871
142601
  }) {
142872
- const [elapsed, setElapsed] = import_react34.useState(0);
142873
- import_react34.useEffect(() => {
142602
+ const [elapsed, setElapsed] = import_react32.useState(0);
142603
+ import_react32.useEffect(() => {
142874
142604
  if (!isProcessing || !startTime) {
142875
142605
  setElapsed(0);
142876
142606
  return;
@@ -143000,7 +142730,7 @@ function WelcomeBanner({ version: version2, model, directory }) {
143000
142730
  }
143001
142731
 
143002
142732
  // packages/terminal/src/components/SessionSelector.tsx
143003
- var import_react35 = __toESM(require_react(), 1);
142733
+ var import_react33 = __toESM(require_react(), 1);
143004
142734
  var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
143005
142735
  function formatSessionTime(timestamp) {
143006
142736
  const date = new Date(timestamp);
@@ -143035,8 +142765,8 @@ function SessionSelector({
143035
142765
  onNew,
143036
142766
  onCancel
143037
142767
  }) {
143038
- const [selectedIndex, setSelectedIndex] = import_react35.useState(0);
143039
- import_react35.useEffect(() => {
142768
+ const [selectedIndex, setSelectedIndex] = import_react33.useState(0);
142769
+ import_react33.useEffect(() => {
143040
142770
  setSelectedIndex((prev) => Math.min(prev, sessions.length));
143041
142771
  }, [sessions.length]);
143042
142772
  use_input_default((input, key) => {
@@ -143329,49 +143059,40 @@ function App2({ cwd: cwd2, version: version2 }) {
143329
143059
  const { stdout } = use_stdout_default();
143330
143060
  const rows = stdout?.rows ?? 24;
143331
143061
  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) => {
143062
+ const [registry] = import_react34.useState(() => new SessionRegistry);
143063
+ const registryRef = import_react34.useRef(registry);
143064
+ const [activeSessionId, setActiveSessionId] = import_react34.useState(null);
143065
+ const [isInitializing, setIsInitializing] = import_react34.useState(true);
143066
+ const [showSessionSelector, setShowSessionSelector] = import_react34.useState(false);
143067
+ const sessionUIStates = import_react34.useRef(new Map);
143068
+ const [messages, setMessages] = import_react34.useState([]);
143069
+ const [currentResponse, setCurrentResponse] = import_react34.useState("");
143070
+ const [currentToolCall, setCurrentToolCall] = import_react34.useState();
143071
+ const [isProcessing, setIsProcessing] = import_react34.useState(false);
143072
+ const [error2, setError] = import_react34.useState(null);
143073
+ const [messageQueue, setMessageQueue] = import_react34.useState([]);
143074
+ const [inlinePending, setInlinePending] = import_react34.useState([]);
143075
+ const [activityLog, setActivityLog] = import_react34.useState([]);
143076
+ const [tokenUsage, setTokenUsage] = import_react34.useState();
143077
+ const [energyState, setEnergyState] = import_react34.useState();
143078
+ const [voiceState, setVoiceState] = import_react34.useState();
143079
+ const [identityInfo, setIdentityInfo] = import_react34.useState();
143080
+ const [verboseTools, setVerboseTools] = import_react34.useState(false);
143081
+ const [askUserState, setAskUserState] = import_react34.useState(null);
143082
+ const [processingStartTime, setProcessingStartTime] = import_react34.useState();
143083
+ const [currentTurnTokens, setCurrentTurnTokens] = import_react34.useState(0);
143084
+ const [skills, setSkills] = import_react34.useState([]);
143085
+ const [commands3, setCommands] = import_react34.useState([]);
143086
+ const responseRef = import_react34.useRef("");
143087
+ const toolCallsRef = import_react34.useRef([]);
143088
+ const toolResultsRef = import_react34.useRef([]);
143089
+ const activityLogRef = import_react34.useRef([]);
143090
+ const skipNextDoneRef = import_react34.useRef(false);
143091
+ const isProcessingRef = import_react34.useRef(isProcessing);
143092
+ const processingStartTimeRef = import_react34.useRef(processingStartTime);
143093
+ const pendingSendsRef = import_react34.useRef([]);
143094
+ const askUserStateRef = import_react34.useRef(null);
143095
+ const beginAskUser = import_react34.useCallback((sessionId, request2) => {
143375
143096
  return new Promise((resolve5, reject) => {
143376
143097
  if (askUserStateRef.current) {
143377
143098
  reject(new Error("Another interview is already in progress."));
@@ -143389,7 +143110,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143389
143110
  setAskUserState(state);
143390
143111
  });
143391
143112
  }, []);
143392
- const cancelAskUser = import_react36.useCallback((reason) => {
143113
+ const cancelAskUser = import_react34.useCallback((reason) => {
143393
143114
  const current = askUserStateRef.current;
143394
143115
  if (!current)
143395
143116
  return;
@@ -143397,7 +143118,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143397
143118
  setAskUserState(null);
143398
143119
  current.reject(new Error(reason));
143399
143120
  }, []);
143400
- const submitAskAnswer = import_react36.useCallback((answer) => {
143121
+ const submitAskAnswer = import_react34.useCallback((answer) => {
143401
143122
  setAskUserState((prev) => {
143402
143123
  if (!prev)
143403
143124
  return prev;
@@ -143418,31 +143139,19 @@ function App2({ cwd: cwd2, version: version2 }) {
143418
143139
  return nextState;
143419
143140
  });
143420
143141
  }, []);
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(() => {
143142
+ const turnIdRef = import_react34.useRef(0);
143143
+ import_react34.useEffect(() => {
143435
143144
  isProcessingRef.current = isProcessing;
143436
143145
  }, [isProcessing]);
143437
- import_react36.useEffect(() => {
143146
+ import_react34.useEffect(() => {
143438
143147
  processingStartTimeRef.current = processingStartTime;
143439
143148
  }, [processingStartTime]);
143440
- import_react36.useEffect(() => {
143149
+ import_react34.useEffect(() => {
143441
143150
  if (isProcessing && !processingStartTime) {
143442
143151
  setProcessingStartTime(Date.now());
143443
143152
  }
143444
143153
  }, [isProcessing, processingStartTime]);
143445
- const buildFullResponse = import_react36.useCallback(() => {
143154
+ const buildFullResponse = import_react34.useCallback(() => {
143446
143155
  const parts = activityLogRef.current.filter((entry) => entry.type === "text" && entry.content).map((entry) => entry.content);
143447
143156
  if (responseRef.current.trim()) {
143448
143157
  parts.push(responseRef.current);
@@ -143450,7 +143159,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143450
143159
  return parts.join(`
143451
143160
  `).trim();
143452
143161
  }, []);
143453
- const loadSessionMetadata = import_react36.useCallback(async (session) => {
143162
+ const loadSessionMetadata = import_react34.useCallback(async (session) => {
143454
143163
  try {
143455
143164
  const [loadedSkills, loadedCommands] = await Promise.all([
143456
143165
  session.client.getSkills(),
@@ -143469,7 +143178,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143469
143178
  setError(err instanceof Error ? err.message : String(err));
143470
143179
  }
143471
143180
  }, []);
143472
- const finalizeResponse = import_react36.useCallback((status) => {
143181
+ const finalizeResponse = import_react34.useCallback((status) => {
143473
143182
  const baseContent = buildFullResponse();
143474
143183
  const hasContent = baseContent.length > 0;
143475
143184
  const activityToolCalls = activityLogRef.current.filter((entry) => entry.type === "tool_call" && entry.toolCall).map((entry) => entry.toolCall);
@@ -143527,7 +143236,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143527
143236
  ]);
143528
143237
  return true;
143529
143238
  }, [buildFullResponse]);
143530
- const resetTurnState = import_react36.useCallback(() => {
143239
+ const resetTurnState = import_react34.useCallback(() => {
143531
143240
  setCurrentResponse("");
143532
143241
  responseRef.current = "";
143533
143242
  toolCallsRef.current = [];
@@ -143538,7 +143247,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143538
143247
  setProcessingStartTime(undefined);
143539
143248
  setCurrentTurnTokens(0);
143540
143249
  }, []);
143541
- const saveCurrentSessionState = import_react36.useCallback(() => {
143250
+ const saveCurrentSessionState = import_react34.useCallback(() => {
143542
143251
  if (activeSessionId) {
143543
143252
  sessionUIStates.current.set(activeSessionId, {
143544
143253
  messages,
@@ -143556,7 +143265,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143556
143265
  });
143557
143266
  }
143558
143267
  }, [activeSessionId, messages, tokenUsage, energyState, voiceState, identityInfo, processingStartTime, currentTurnTokens, error2]);
143559
- const loadSessionState = import_react36.useCallback((sessionId) => {
143268
+ const loadSessionState = import_react34.useCallback((sessionId) => {
143560
143269
  const state = sessionUIStates.current.get(sessionId);
143561
143270
  if (state) {
143562
143271
  setMessages(state.messages);
@@ -143591,10 +143300,8 @@ function App2({ cwd: cwd2, version: version2 }) {
143591
143300
  setCurrentTurnTokens(0);
143592
143301
  setError(null);
143593
143302
  }
143594
- setScrollOffset(0);
143595
- setAutoScroll(true);
143596
143303
  }, []);
143597
- const handleChunk = import_react36.useCallback((chunk) => {
143304
+ const handleChunk = import_react34.useCallback((chunk) => {
143598
143305
  const isStartChunk = chunk.type === "text" || chunk.type === "tool_use";
143599
143306
  const isTerminalChunk = chunk.type === "error" || chunk.type === "done";
143600
143307
  if (!isProcessingRef.current && (isStartChunk || isTerminalChunk)) {
@@ -143718,7 +143425,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143718
143425
  }
143719
143426
  }
143720
143427
  }, [registry, exit, finalizeResponse, resetTurnState]);
143721
- import_react36.useEffect(() => {
143428
+ import_react34.useEffect(() => {
143722
143429
  const initSession = async () => {
143723
143430
  try {
143724
143431
  registry.onChunk(handleChunk);
@@ -143754,7 +143461,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143754
143461
  registry.closeAll();
143755
143462
  };
143756
143463
  }, [cwd2, registry, handleChunk, finalizeResponse, resetTurnState, loadSessionMetadata, beginAskUser]);
143757
- const processQueue = import_react36.useCallback(async () => {
143464
+ const processQueue = import_react34.useCallback(async () => {
143758
143465
  const activeSession2 = registryRef.current.getActiveSession();
143759
143466
  if (!activeSession2 || !activeSessionId)
143760
143467
  return;
@@ -143804,7 +143511,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143804
143511
  }, [activeSessionId]);
143805
143512
  const activeQueue = activeSessionId ? messageQueue.filter((msg) => msg.sessionId === activeSessionId) : [];
143806
143513
  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]);
143514
+ const queuedMessageIds = import_react34.useMemo(() => new Set(activeQueue.filter((msg) => msg.mode === "queued").map((msg) => msg.id)), [activeQueue]);
143808
143515
  const sessions = registry.listSessions();
143809
143516
  const activeSession = registry.getActiveSession();
143810
143517
  const sessionIndex = activeSessionId ? registry.getSessionIndex(activeSessionId) : 0;
@@ -143814,11 +143521,28 @@ function App2({ cwd: cwd2, version: version2 }) {
143814
143521
  const inlineCount = activeInline.length;
143815
143522
  const activeAskQuestion = askUserState?.request.questions[askUserState.index];
143816
143523
  const askPlaceholder = activeAskQuestion?.placeholder || activeAskQuestion?.question || "Answer the question...";
143524
+ const hasPendingTools = import_react34.useMemo(() => {
143525
+ const toolResultIds = new Set;
143526
+ for (const entry of activityLog) {
143527
+ if (entry.type === "tool_result" && entry.toolResult) {
143528
+ toolResultIds.add(entry.toolResult.toolCallId);
143529
+ }
143530
+ }
143531
+ for (const entry of activityLog) {
143532
+ if (entry.type === "tool_call" && entry.toolCall) {
143533
+ if (!toolResultIds.has(entry.toolCall.id)) {
143534
+ return true;
143535
+ }
143536
+ }
143537
+ }
143538
+ return false;
143539
+ }, [activityLog]);
143540
+ const isBusy = isProcessing || hasPendingTools;
143817
143541
  const showWelcome = messages.length === 0 && !isProcessing;
143818
143542
  const renderWidth = columns ? Math.max(1, columns - 2) : undefined;
143819
143543
  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(() => {
143544
+ const displayMessages = import_react34.useMemo(() => buildDisplayMessages(messages, MESSAGE_CHUNK_LINES, wrapChars, { maxWidth: renderWidth }), [messages, wrapChars, renderWidth]);
143545
+ const streamingMessages = import_react34.useMemo(() => {
143822
143546
  if (!isProcessing || !currentResponse.trim())
143823
143547
  return [];
143824
143548
  const streamingMessage = {
@@ -143829,20 +143553,12 @@ function App2({ cwd: cwd2, version: version2 }) {
143829
143553
  };
143830
143554
  return buildDisplayMessages([streamingMessage], MESSAGE_CHUNK_LINES, wrapChars, { maxWidth: renderWidth });
143831
143555
  }, [currentResponse, isProcessing, wrapChars, renderWidth]);
143832
- import_react36.useEffect(() => {
143556
+ import_react34.useEffect(() => {
143833
143557
  if (!isProcessing && activeQueue.length > 0 && activeInline.length === 0) {
143834
143558
  processQueue();
143835
143559
  }
143836
143560
  }, [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) => {
143561
+ const handleSessionSwitch = import_react34.useCallback(async (sessionId) => {
143846
143562
  setShowSessionSelector(false);
143847
143563
  if (sessionId === activeSessionId) {
143848
143564
  return;
@@ -143861,7 +143577,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143861
143577
  await registry.switchSession(sessionId);
143862
143578
  setActiveSessionId(sessionId);
143863
143579
  }, [activeSessionId, registry, saveCurrentSessionState, loadSessionState]);
143864
- const handleNewSession = import_react36.useCallback(async () => {
143580
+ const handleNewSession = import_react34.useCallback(async () => {
143865
143581
  setShowSessionSelector(false);
143866
143582
  try {
143867
143583
  saveCurrentSessionState();
@@ -143880,12 +143596,6 @@ function App2({ cwd: cwd2, version: version2 }) {
143880
143596
  setError(err instanceof Error ? err.message : "Failed to create session");
143881
143597
  }
143882
143598
  }, [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
143599
  use_input_default((input, key) => {
143890
143600
  if (key.ctrl && input === "s") {
143891
143601
  if (sessions.length > 0) {
@@ -143897,7 +143607,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143897
143607
  if (askUserStateRef.current) {
143898
143608
  cancelAskUser("Cancelled by user");
143899
143609
  }
143900
- if (isProcessing && activeSession) {
143610
+ if ((isProcessing || hasPendingTools) && activeSession) {
143901
143611
  activeSession.client.stop();
143902
143612
  const finalized = finalizeResponse("stopped");
143903
143613
  if (finalized) {
@@ -143920,7 +143630,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143920
143630
  if (askUserStateRef.current) {
143921
143631
  cancelAskUser("Cancelled by user");
143922
143632
  }
143923
- if (isProcessing && activeSession) {
143633
+ if ((isProcessing || hasPendingTools) && activeSession) {
143924
143634
  activeSession.client.stop();
143925
143635
  const finalized = finalizeResponse("stopped");
143926
143636
  if (finalized) {
@@ -143932,31 +143642,8 @@ function App2({ cwd: cwd2, version: version2 }) {
143932
143642
  isProcessingRef.current = false;
143933
143643
  }
143934
143644
  }
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
143645
  }, { 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") => {
143646
+ const handleSubmit = import_react34.useCallback(async (input, mode = "normal") => {
143960
143647
  if (askUserStateRef.current) {
143961
143648
  submitAskAnswer(input.trim());
143962
143649
  return;
@@ -144117,7 +143804,6 @@ function App2({ cwd: cwd2, version: version2 }) {
144117
143804
  return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
144118
143805
  flexDirection: "column",
144119
143806
  padding: 1,
144120
- height: rows,
144121
143807
  children: [
144122
143808
  showWelcome && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(WelcomeBanner, {
144123
143809
  version: version2 ?? "unknown",
@@ -144136,37 +143822,29 @@ function App2({ cwd: cwd2, version: version2 }) {
144136
143822
  ]
144137
143823
  }, undefined, true, undefined, this)
144138
143824
  }, 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)
143825
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Static, {
143826
+ items: displayMessages,
143827
+ children: (message) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Messages3, {
143828
+ messages: [message],
143829
+ currentResponse: undefined,
143830
+ streamingMessages: [],
143831
+ currentToolCall: undefined,
143832
+ lastToolResult: undefined,
143833
+ activityLog: [],
143834
+ queuedMessageIds,
143835
+ verboseTools
143836
+ }, message.id, false, undefined, this)
144169
143837
  }, undefined, false, undefined, this),
143838
+ isProcessing && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Messages3, {
143839
+ messages: [],
143840
+ currentResponse: undefined,
143841
+ streamingMessages,
143842
+ currentToolCall: undefined,
143843
+ lastToolResult: undefined,
143844
+ activityLog,
143845
+ queuedMessageIds,
143846
+ verboseTools
143847
+ }, "streaming", false, undefined, this),
144170
143848
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(QueueIndicator, {
144171
143849
  messages: [...activeInline, ...activeQueue],
144172
143850
  maxPreview: MAX_QUEUED_PREVIEW
@@ -144190,7 +143868,7 @@ function App2({ cwd: cwd2, version: version2 }) {
144190
143868
  }, undefined, false, undefined, this),
144191
143869
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Input, {
144192
143870
  onSubmit: handleSubmit,
144193
- isProcessing,
143871
+ isProcessing: isBusy,
144194
143872
  queueLength: activeQueue.length + inlineCount,
144195
143873
  commands: commands3,
144196
143874
  skills,
@@ -144198,7 +143876,7 @@ function App2({ cwd: cwd2, version: version2 }) {
144198
143876
  askPlaceholder
144199
143877
  }, undefined, false, undefined, this),
144200
143878
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Status, {
144201
- isProcessing,
143879
+ isProcessing: isBusy,
144202
143880
  cwd: activeSession?.cwd || cwd2,
144203
143881
  queueLength: activeQueue.length + inlineCount,
144204
143882
  tokenUsage,
@@ -144391,7 +144069,7 @@ function formatStreamEvent(chunk) {
144391
144069
 
144392
144070
  // packages/terminal/src/index.tsx
144393
144071
  var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
144394
- var VERSION3 = "0.6.42";
144072
+ var VERSION3 = "0.6.45";
144395
144073
  function parseArgs(argv) {
144396
144074
  const args = argv.slice(2);
144397
144075
  const options = {
@@ -144546,4 +144224,4 @@ if (options.print !== null) {
144546
144224
  });
144547
144225
  }
144548
144226
 
144549
- //# debugId=D518576C49ADB4E664756E2164756E21
144227
+ //# debugId=EF9C493CF424916B64756E2164756E21