@hasna/assistants 0.6.41 → 0.6.43

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -12218,233 +12218,6 @@ var require_stack_utils = __commonJS((exports, module) => {
12218
12218
  var methodRe = /^(.*?) \[as (.*?)\]$/;
12219
12219
  module.exports = StackUtils;
12220
12220
  });
12221
-
12222
- // node_modules/.bun/react@19.2.4/node_modules/react/cjs/react-jsx-runtime.development.js
12223
- var require_react_jsx_runtime_development = __commonJS((exports) => {
12224
- var React10 = __toESM(require_react());
12225
- (function() {
12226
- function getComponentNameFromType(type) {
12227
- if (type == null)
12228
- return null;
12229
- if (typeof type === "function")
12230
- return type.$$typeof === REACT_CLIENT_REFERENCE ? null : type.displayName || type.name || null;
12231
- if (typeof type === "string")
12232
- return type;
12233
- switch (type) {
12234
- case REACT_FRAGMENT_TYPE:
12235
- return "Fragment";
12236
- case REACT_PROFILER_TYPE:
12237
- return "Profiler";
12238
- case REACT_STRICT_MODE_TYPE:
12239
- return "StrictMode";
12240
- case REACT_SUSPENSE_TYPE:
12241
- return "Suspense";
12242
- case REACT_SUSPENSE_LIST_TYPE:
12243
- return "SuspenseList";
12244
- case REACT_ACTIVITY_TYPE:
12245
- return "Activity";
12246
- }
12247
- if (typeof type === "object")
12248
- switch (typeof type.tag === "number" && console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), type.$$typeof) {
12249
- case REACT_PORTAL_TYPE:
12250
- return "Portal";
12251
- case REACT_CONTEXT_TYPE:
12252
- return type.displayName || "Context";
12253
- case REACT_CONSUMER_TYPE:
12254
- return (type._context.displayName || "Context") + ".Consumer";
12255
- case REACT_FORWARD_REF_TYPE:
12256
- var innerType = type.render;
12257
- type = type.displayName;
12258
- type || (type = innerType.displayName || innerType.name || "", type = type !== "" ? "ForwardRef(" + type + ")" : "ForwardRef");
12259
- return type;
12260
- case REACT_MEMO_TYPE:
12261
- return innerType = type.displayName || null, innerType !== null ? innerType : getComponentNameFromType(type.type) || "Memo";
12262
- case REACT_LAZY_TYPE:
12263
- innerType = type._payload;
12264
- type = type._init;
12265
- try {
12266
- return getComponentNameFromType(type(innerType));
12267
- } catch (x) {}
12268
- }
12269
- return null;
12270
- }
12271
- function testStringCoercion(value) {
12272
- return "" + value;
12273
- }
12274
- function checkKeyStringCoercion(value) {
12275
- try {
12276
- testStringCoercion(value);
12277
- var JSCompiler_inline_result = false;
12278
- } catch (e) {
12279
- JSCompiler_inline_result = true;
12280
- }
12281
- if (JSCompiler_inline_result) {
12282
- JSCompiler_inline_result = console;
12283
- var JSCompiler_temp_const = JSCompiler_inline_result.error;
12284
- var JSCompiler_inline_result$jscomp$0 = typeof Symbol === "function" && Symbol.toStringTag && value[Symbol.toStringTag] || value.constructor.name || "Object";
12285
- JSCompiler_temp_const.call(JSCompiler_inline_result, "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", JSCompiler_inline_result$jscomp$0);
12286
- return testStringCoercion(value);
12287
- }
12288
- }
12289
- function getTaskName(type) {
12290
- if (type === REACT_FRAGMENT_TYPE)
12291
- return "<>";
12292
- if (typeof type === "object" && type !== null && type.$$typeof === REACT_LAZY_TYPE)
12293
- return "<...>";
12294
- try {
12295
- var name = getComponentNameFromType(type);
12296
- return name ? "<" + name + ">" : "<...>";
12297
- } catch (x) {
12298
- return "<...>";
12299
- }
12300
- }
12301
- function getOwner() {
12302
- var dispatcher = ReactSharedInternals.A;
12303
- return dispatcher === null ? null : dispatcher.getOwner();
12304
- }
12305
- function UnknownOwner() {
12306
- return Error("react-stack-top-frame");
12307
- }
12308
- function hasValidKey(config) {
12309
- if (hasOwnProperty.call(config, "key")) {
12310
- var getter = Object.getOwnPropertyDescriptor(config, "key").get;
12311
- if (getter && getter.isReactWarning)
12312
- return false;
12313
- }
12314
- return config.key !== undefined;
12315
- }
12316
- function defineKeyPropWarningGetter(props, displayName) {
12317
- function warnAboutAccessingKey() {
12318
- specialPropKeyWarningShown || (specialPropKeyWarningShown = true, console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)", displayName));
12319
- }
12320
- warnAboutAccessingKey.isReactWarning = true;
12321
- Object.defineProperty(props, "key", {
12322
- get: warnAboutAccessingKey,
12323
- configurable: true
12324
- });
12325
- }
12326
- function elementRefGetterWithDeprecationWarning() {
12327
- var componentName = getComponentNameFromType(this.type);
12328
- didWarnAboutElementRef[componentName] || (didWarnAboutElementRef[componentName] = true, console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."));
12329
- componentName = this.props.ref;
12330
- return componentName !== undefined ? componentName : null;
12331
- }
12332
- function ReactElement(type, key, props, owner, debugStack, debugTask) {
12333
- var refProp = props.ref;
12334
- type = {
12335
- $$typeof: REACT_ELEMENT_TYPE,
12336
- type,
12337
- key,
12338
- props,
12339
- _owner: owner
12340
- };
12341
- (refProp !== undefined ? refProp : null) !== null ? Object.defineProperty(type, "ref", {
12342
- enumerable: false,
12343
- get: elementRefGetterWithDeprecationWarning
12344
- }) : Object.defineProperty(type, "ref", { enumerable: false, value: null });
12345
- type._store = {};
12346
- Object.defineProperty(type._store, "validated", {
12347
- configurable: false,
12348
- enumerable: false,
12349
- writable: true,
12350
- value: 0
12351
- });
12352
- Object.defineProperty(type, "_debugInfo", {
12353
- configurable: false,
12354
- enumerable: false,
12355
- writable: true,
12356
- value: null
12357
- });
12358
- Object.defineProperty(type, "_debugStack", {
12359
- configurable: false,
12360
- enumerable: false,
12361
- writable: true,
12362
- value: debugStack
12363
- });
12364
- Object.defineProperty(type, "_debugTask", {
12365
- configurable: false,
12366
- enumerable: false,
12367
- writable: true,
12368
- value: debugTask
12369
- });
12370
- Object.freeze && (Object.freeze(type.props), Object.freeze(type));
12371
- return type;
12372
- }
12373
- function jsxDEVImpl(type, config, maybeKey, isStaticChildren, debugStack, debugTask) {
12374
- var children = config.children;
12375
- if (children !== undefined)
12376
- if (isStaticChildren)
12377
- if (isArrayImpl(children)) {
12378
- for (isStaticChildren = 0;isStaticChildren < children.length; isStaticChildren++)
12379
- validateChildKeys(children[isStaticChildren]);
12380
- Object.freeze && Object.freeze(children);
12381
- } else
12382
- console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
12383
- else
12384
- validateChildKeys(children);
12385
- if (hasOwnProperty.call(config, "key")) {
12386
- children = getComponentNameFromType(type);
12387
- var keys = Object.keys(config).filter(function(k) {
12388
- return k !== "key";
12389
- });
12390
- isStaticChildren = 0 < keys.length ? "{key: someKey, " + keys.join(": ..., ") + ": ...}" : "{key: someKey}";
12391
- didWarnAboutKeySpread[children + isStaticChildren] || (keys = 0 < keys.length ? "{" + keys.join(": ..., ") + ": ...}" : "{}", console.error(`A props object containing a "key" prop is being spread into JSX:
12392
- let props = %s;
12393
- <%s {...props} />
12394
- React keys must be passed directly to JSX without using spread:
12395
- let props = %s;
12396
- <%s key={someKey} {...props} />`, isStaticChildren, children, keys, children), didWarnAboutKeySpread[children + isStaticChildren] = true);
12397
- }
12398
- children = null;
12399
- maybeKey !== undefined && (checkKeyStringCoercion(maybeKey), children = "" + maybeKey);
12400
- hasValidKey(config) && (checkKeyStringCoercion(config.key), children = "" + config.key);
12401
- if ("key" in config) {
12402
- maybeKey = {};
12403
- for (var propName in config)
12404
- propName !== "key" && (maybeKey[propName] = config[propName]);
12405
- } else
12406
- maybeKey = config;
12407
- children && defineKeyPropWarningGetter(maybeKey, typeof type === "function" ? type.displayName || type.name || "Unknown" : type);
12408
- return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
12409
- }
12410
- function validateChildKeys(node) {
12411
- isValidElement(node) ? node._store && (node._store.validated = 1) : typeof node === "object" && node !== null && node.$$typeof === REACT_LAZY_TYPE && (node._payload.status === "fulfilled" ? isValidElement(node._payload.value) && node._payload.value._store && (node._payload.value._store.validated = 1) : node._store && (node._store.validated = 1));
12412
- }
12413
- function isValidElement(object) {
12414
- return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
12415
- }
12416
- var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React10.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
12417
- return null;
12418
- };
12419
- React10 = {
12420
- react_stack_bottom_frame: function(callStackForError) {
12421
- return callStackForError();
12422
- }
12423
- };
12424
- var specialPropKeyWarningShown;
12425
- var didWarnAboutElementRef = {};
12426
- var unknownOwnerDebugStack = React10.react_stack_bottom_frame.bind(React10, UnknownOwner)();
12427
- var unknownOwnerDebugTask = createTask(getTaskName(UnknownOwner));
12428
- var didWarnAboutKeySpread = {};
12429
- exports.Fragment = REACT_FRAGMENT_TYPE;
12430
- exports.jsx = function(type, config, maybeKey) {
12431
- var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
12432
- return jsxDEVImpl(type, config, maybeKey, false, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
12433
- };
12434
- exports.jsxs = function(type, config, maybeKey) {
12435
- var trackActualOwner = 1e4 > ReactSharedInternals.recentlyCreatedOwnerStacks++;
12436
- return jsxDEVImpl(type, config, maybeKey, true, trackActualOwner ? Error("react-stack-top-frame") : unknownOwnerDebugStack, trackActualOwner ? createTask(getTaskName(type)) : unknownOwnerDebugTask);
12437
- };
12438
- })();
12439
- });
12440
-
12441
- // node_modules/.bun/react@19.2.4/node_modules/react/jsx-runtime.js
12442
- var require_jsx_runtime = __commonJS((exports, module) => {
12443
- var react_jsx_runtime_development = __toESM(require_react_jsx_runtime_development());
12444
- if (false) {} else {
12445
- module.exports = react_jsx_runtime_development;
12446
- }
12447
- });
12448
12221
  // packages/shared/src/utils.ts
12449
12222
  import { randomUUID } from "crypto";
12450
12223
  function generateId() {
@@ -58510,8 +58283,8 @@ var init_BetaMessageStream = __esm(() => {
58510
58283
  runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } }));
58511
58284
  return runner;
58512
58285
  }
58513
- _run(executor) {
58514
- executor().then(() => {
58286
+ _run(executor2) {
58287
+ executor2().then(() => {
58515
58288
  this._emitFinal();
58516
58289
  this._emit("end");
58517
58290
  }, __classPrivateFieldGet(this, _BetaMessageStream_handleError, "f"));
@@ -59774,8 +59547,8 @@ var init_MessageStream = __esm(() => {
59774
59547
  runner._run(() => runner._createMessage(messages, { ...params, stream: true }, { ...options, headers: { ...options?.headers, "X-Stainless-Helper-Method": "stream" } }));
59775
59548
  return runner;
59776
59549
  }
59777
- _run(executor) {
59778
- executor().then(() => {
59550
+ _run(executor2) {
59551
+ executor2().then(() => {
59779
59552
  this._emitFinal();
59780
59553
  this._emit("end");
59781
59554
  }, __classPrivateFieldGet(this, _MessageStream_handleError, "f"));
@@ -87161,7 +86934,7 @@ var require_react_development2 = __commonJS((exports, module) => {
87161
86934
  }
87162
86935
  return ReactElement(element.type, key, ref, self2, source, owner, props);
87163
86936
  }
87164
- function isValidElement2(object) {
86937
+ function isValidElement(object) {
87165
86938
  return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
87166
86939
  }
87167
86940
  var SEPARATOR = ".";
@@ -87226,7 +86999,7 @@ var require_react_development2 = __commonJS((exports, module) => {
87226
86999
  return c5;
87227
87000
  });
87228
87001
  } else if (mappedChild != null) {
87229
- if (isValidElement2(mappedChild)) {
87002
+ if (isValidElement(mappedChild)) {
87230
87003
  {
87231
87004
  if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
87232
87005
  checkKeyStringCoercion(mappedChild.key);
@@ -87304,7 +87077,7 @@ var require_react_development2 = __commonJS((exports, module) => {
87304
87077
  }) || [];
87305
87078
  }
87306
87079
  function onlyChild(children) {
87307
- if (!isValidElement2(children)) {
87080
+ if (!isValidElement(children)) {
87308
87081
  throw new Error("React.Children.only expected to receive a single React element child.");
87309
87082
  }
87310
87083
  return children;
@@ -87494,7 +87267,7 @@ Your code should look like:
87494
87267
  }
87495
87268
  return lazyType;
87496
87269
  }
87497
- function forwardRef4(render3) {
87270
+ function forwardRef2(render3) {
87498
87271
  {
87499
87272
  if (render3 != null && render3.$$typeof === REACT_MEMO_TYPE) {
87500
87273
  error2("forwardRef requires a render function but received a `memo` " + "component. Instead of forwardRef(memo(...)), use " + "memo(forwardRef(...)).");
@@ -87607,7 +87380,7 @@ Your code should look like:
87607
87380
  }
87608
87381
  return dispatcher.useContext(Context);
87609
87382
  }
87610
- function useState4(initialState) {
87383
+ function useState2(initialState) {
87611
87384
  var dispatcher = resolveDispatcher();
87612
87385
  return dispatcher.useState(initialState);
87613
87386
  }
@@ -87615,7 +87388,7 @@ Your code should look like:
87615
87388
  var dispatcher = resolveDispatcher();
87616
87389
  return dispatcher.useReducer(reducer, initialArg, init);
87617
87390
  }
87618
- function useRef3(initialValue) {
87391
+ function useRef(initialValue) {
87619
87392
  var dispatcher = resolveDispatcher();
87620
87393
  return dispatcher.useRef(initialValue);
87621
87394
  }
@@ -87627,11 +87400,11 @@ Your code should look like:
87627
87400
  var dispatcher = resolveDispatcher();
87628
87401
  return dispatcher.useInsertionEffect(create2, deps);
87629
87402
  }
87630
- function useLayoutEffect3(create2, deps) {
87403
+ function useLayoutEffect2(create2, deps) {
87631
87404
  var dispatcher = resolveDispatcher();
87632
87405
  return dispatcher.useLayoutEffect(create2, deps);
87633
87406
  }
87634
- function useCallback3(callback, deps) {
87407
+ function useCallback(callback, deps) {
87635
87408
  var dispatcher = resolveDispatcher();
87636
87409
  return dispatcher.useCallback(callback, deps);
87637
87410
  }
@@ -87639,7 +87412,7 @@ Your code should look like:
87639
87412
  var dispatcher = resolveDispatcher();
87640
87413
  return dispatcher.useMemo(create2, deps);
87641
87414
  }
87642
- function useImperativeHandle3(ref, create2, deps) {
87415
+ function useImperativeHandle(ref, create2, deps) {
87643
87416
  var dispatcher = resolveDispatcher();
87644
87417
  return dispatcher.useImperativeHandle(ref, create2, deps);
87645
87418
  }
@@ -88041,11 +87814,11 @@ Check the top-level render call using <` + parentName + ">.";
88041
87814
  if (isArray2(node2)) {
88042
87815
  for (var i4 = 0;i4 < node2.length; i4++) {
88043
87816
  var child = node2[i4];
88044
- if (isValidElement2(child)) {
87817
+ if (isValidElement(child)) {
88045
87818
  validateExplicitKey(child, parentType);
88046
87819
  }
88047
87820
  }
88048
- } else if (isValidElement2(node2)) {
87821
+ } else if (isValidElement(node2)) {
88049
87822
  if (node2._store) {
88050
87823
  node2._store.validated = true;
88051
87824
  }
@@ -88056,7 +87829,7 @@ Check the top-level render call using <` + parentName + ">.";
88056
87829
  var iterator = iteratorFn.call(node2);
88057
87830
  var step;
88058
87831
  while (!(step = iterator.next()).done) {
88059
- if (isValidElement2(step.value)) {
87832
+ if (isValidElement(step.value)) {
88060
87833
  validateExplicitKey(step.value, parentType);
88061
87834
  }
88062
87835
  }
@@ -88376,14 +88149,14 @@ Check the top-level render call using <` + parentName + ">.";
88376
88149
  var createElement$1 = createElementWithValidation;
88377
88150
  var cloneElement$1 = cloneElementWithValidation;
88378
88151
  var createFactory = createFactoryWithValidation;
88379
- var Children2 = {
88152
+ var Children = {
88380
88153
  map: mapChildren,
88381
88154
  forEach: forEachChildren,
88382
88155
  count: countChildren,
88383
88156
  toArray,
88384
88157
  only: onlyChild
88385
88158
  };
88386
- exports.Children = Children2;
88159
+ exports.Children = Children;
88387
88160
  exports.Component = Component;
88388
88161
  exports.Fragment = REACT_FRAGMENT_TYPE;
88389
88162
  exports.Profiler = REACT_PROFILER_TYPE;
@@ -88397,25 +88170,25 @@ Check the top-level render call using <` + parentName + ">.";
88397
88170
  exports.createElement = createElement$1;
88398
88171
  exports.createFactory = createFactory;
88399
88172
  exports.createRef = createRef;
88400
- exports.forwardRef = forwardRef4;
88401
- exports.isValidElement = isValidElement2;
88173
+ exports.forwardRef = forwardRef2;
88174
+ exports.isValidElement = isValidElement;
88402
88175
  exports.lazy = lazy;
88403
88176
  exports.memo = memo;
88404
88177
  exports.startTransition = startTransition;
88405
88178
  exports.unstable_act = act;
88406
- exports.useCallback = useCallback3;
88179
+ exports.useCallback = useCallback;
88407
88180
  exports.useContext = useContext11;
88408
88181
  exports.useDebugValue = useDebugValue;
88409
88182
  exports.useDeferredValue = useDeferredValue;
88410
88183
  exports.useEffect = useEffect3;
88411
88184
  exports.useId = useId;
88412
- exports.useImperativeHandle = useImperativeHandle3;
88185
+ exports.useImperativeHandle = useImperativeHandle;
88413
88186
  exports.useInsertionEffect = useInsertionEffect;
88414
- exports.useLayoutEffect = useLayoutEffect3;
88187
+ exports.useLayoutEffect = useLayoutEffect2;
88415
88188
  exports.useMemo = useMemo3;
88416
88189
  exports.useReducer = useReducer;
88417
- exports.useRef = useRef3;
88418
- exports.useState = useState4;
88190
+ exports.useRef = useRef;
88191
+ exports.useState = useState2;
88419
88192
  exports.useSyncExternalStore = useSyncExternalStore;
88420
88193
  exports.useTransition = useTransition;
88421
88194
  exports.version = ReactVersion;
@@ -94288,7 +94061,7 @@ The range will extend backwards to the start of the first line containing the se
94288
94061
  });
94289
94062
 
94290
94063
  // node_modules/.bun/react@18.3.1/node_modules/react/cjs/react-jsx-runtime.development.js
94291
- var require_react_jsx_runtime_development2 = __commonJS((exports) => {
94064
+ var require_react_jsx_runtime_development = __commonJS((exports) => {
94292
94065
  var React10 = __toESM(require_react2());
94293
94066
  if (true) {
94294
94067
  (function() {
@@ -94940,7 +94713,7 @@ var require_react_jsx_runtime_development2 = __commonJS((exports) => {
94940
94713
  {
94941
94714
  propTypesMisspellWarningShown = false;
94942
94715
  }
94943
- function isValidElement2(object) {
94716
+ function isValidElement(object) {
94944
94717
  {
94945
94718
  return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
94946
94719
  }
@@ -95013,11 +94786,11 @@ Check the top-level render call using <` + parentName + ">.";
95013
94786
  if (isArray2(node2)) {
95014
94787
  for (var i4 = 0;i4 < node2.length; i4++) {
95015
94788
  var child = node2[i4];
95016
- if (isValidElement2(child)) {
94789
+ if (isValidElement(child)) {
95017
94790
  validateExplicitKey(child, parentType);
95018
94791
  }
95019
94792
  }
95020
- } else if (isValidElement2(node2)) {
94793
+ } else if (isValidElement(node2)) {
95021
94794
  if (node2._store) {
95022
94795
  node2._store.validated = true;
95023
94796
  }
@@ -95028,7 +94801,7 @@ Check the top-level render call using <` + parentName + ">.";
95028
94801
  var iterator = iteratorFn.call(node2);
95029
94802
  var step;
95030
94803
  while (!(step = iterator.next()).done) {
95031
- if (isValidElement2(step.value)) {
94804
+ if (isValidElement(step.value)) {
95032
94805
  validateExplicitKey(step.value, parentType);
95033
94806
  }
95034
94807
  }
@@ -95171,18 +94944,18 @@ Check the top-level render call using <` + parentName + ">.";
95171
94944
  return jsxWithValidation(type, props, key, false);
95172
94945
  }
95173
94946
  }
95174
- var jsx3 = jsxWithValidationDynamic;
94947
+ var jsx = jsxWithValidationDynamic;
95175
94948
  var jsxs = jsxWithValidationStatic;
95176
94949
  exports.Fragment = REACT_FRAGMENT_TYPE;
95177
- exports.jsx = jsx3;
94950
+ exports.jsx = jsx;
95178
94951
  exports.jsxs = jsxs;
95179
94952
  })();
95180
94953
  }
95181
94954
  });
95182
94955
 
95183
94956
  // node_modules/.bun/react@18.3.1/node_modules/react/jsx-runtime.js
95184
- var require_jsx_runtime2 = __commonJS((exports, module) => {
95185
- var react_jsx_runtime_development = __toESM(require_react_jsx_runtime_development2());
94957
+ var require_jsx_runtime = __commonJS((exports, module) => {
94958
+ var react_jsx_runtime_development = __toESM(require_react_jsx_runtime_development());
95186
94959
  if (false) {} else {
95187
94960
  module.exports = react_jsx_runtime_development;
95188
94961
  }
@@ -98879,7 +98652,7 @@ Please update the following components: %s`, componentName);
98879
98652
  function basicStateReducer(state, action) {
98880
98653
  return typeof action === "function" ? action(state) : action;
98881
98654
  }
98882
- function useState4(initialState) {
98655
+ function useState2(initialState) {
98883
98656
  {
98884
98657
  currentHookNameInDev = "useState";
98885
98658
  }
@@ -98965,7 +98738,7 @@ Please update the following components: %s`, componentName);
98965
98738
  workInProgressHook.memoizedState = [nextValue, nextDeps];
98966
98739
  return nextValue;
98967
98740
  }
98968
- function useRef3(initialValue) {
98741
+ function useRef(initialValue) {
98969
98742
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
98970
98743
  workInProgressHook = createWorkInProgressHook();
98971
98744
  var previousRef = workInProgressHook.memoizedState;
@@ -98982,7 +98755,7 @@ Please update the following components: %s`, componentName);
98982
98755
  return previousRef;
98983
98756
  }
98984
98757
  }
98985
- function useLayoutEffect3(create2, inputs) {
98758
+ function useLayoutEffect2(create2, inputs) {
98986
98759
  {
98987
98760
  currentHookNameInDev = "useLayoutEffect";
98988
98761
  error2("useLayoutEffect does nothing on the server, because its effect cannot " + "be encoded into the server renderer's output format. This will lead " + "to a mismatch between the initial, non-hydrated UI and the intended " + "UI. To avoid this, useLayoutEffect should only be used in " + "components that render exclusively on the client. " + "See https://reactjs.org/link/uselayouteffect-ssr for common fixes.");
@@ -99013,7 +98786,7 @@ Please update the following components: %s`, componentName);
99013
98786
  }
99014
98787
  }
99015
98788
  }
99016
- function useCallback3(callback, deps) {
98789
+ function useCallback(callback, deps) {
99017
98790
  return useMemo3(function() {
99018
98791
  return callback;
99019
98792
  }, deps);
@@ -99055,11 +98828,11 @@ Please update the following components: %s`, componentName);
99055
98828
  useContext: useContext11,
99056
98829
  useMemo: useMemo3,
99057
98830
  useReducer,
99058
- useRef: useRef3,
99059
- useState: useState4,
98831
+ useRef,
98832
+ useState: useState2,
99060
98833
  useInsertionEffect: noop3,
99061
- useLayoutEffect: useLayoutEffect3,
99062
- useCallback: useCallback3,
98834
+ useLayoutEffect: useLayoutEffect2,
98835
+ useCallback,
99063
98836
  useImperativeHandle: noop3,
99064
98837
  useEffect: noop3,
99065
98838
  useDebugValue: noop3,
@@ -104066,7 +103839,7 @@ Please update the following components: %s`, componentName);
104066
103839
  function basicStateReducer(state, action) {
104067
103840
  return typeof action === "function" ? action(state) : action;
104068
103841
  }
104069
- function useState4(initialState) {
103842
+ function useState2(initialState) {
104070
103843
  {
104071
103844
  currentHookNameInDev = "useState";
104072
103845
  }
@@ -104152,7 +103925,7 @@ Please update the following components: %s`, componentName);
104152
103925
  workInProgressHook.memoizedState = [nextValue, nextDeps];
104153
103926
  return nextValue;
104154
103927
  }
104155
- function useRef3(initialValue) {
103928
+ function useRef(initialValue) {
104156
103929
  currentlyRenderingComponent = resolveCurrentlyRenderingComponent();
104157
103930
  workInProgressHook = createWorkInProgressHook();
104158
103931
  var previousRef = workInProgressHook.memoizedState;
@@ -104169,7 +103942,7 @@ Please update the following components: %s`, componentName);
104169
103942
  return previousRef;
104170
103943
  }
104171
103944
  }
104172
- function useLayoutEffect3(create2, inputs) {
103945
+ function useLayoutEffect2(create2, inputs) {
104173
103946
  {
104174
103947
  currentHookNameInDev = "useLayoutEffect";
104175
103948
  error2("useLayoutEffect does nothing on the server, because its effect cannot " + "be encoded into the server renderer's output format. This will lead " + "to a mismatch between the initial, non-hydrated UI and the intended " + "UI. To avoid this, useLayoutEffect should only be used in " + "components that render exclusively on the client. " + "See https://reactjs.org/link/uselayouteffect-ssr for common fixes.");
@@ -104200,7 +103973,7 @@ Please update the following components: %s`, componentName);
104200
103973
  }
104201
103974
  }
104202
103975
  }
104203
- function useCallback3(callback, deps) {
103976
+ function useCallback(callback, deps) {
104204
103977
  return useMemo3(function() {
104205
103978
  return callback;
104206
103979
  }, deps);
@@ -104242,11 +104015,11 @@ Please update the following components: %s`, componentName);
104242
104015
  useContext: useContext11,
104243
104016
  useMemo: useMemo3,
104244
104017
  useReducer,
104245
- useRef: useRef3,
104246
- useState: useState4,
104018
+ useRef,
104019
+ useState: useState2,
104247
104020
  useInsertionEffect: noop3,
104248
- useLayoutEffect: useLayoutEffect3,
104249
- useCallback: useCallback3,
104021
+ useLayoutEffect: useLayoutEffect2,
104022
+ useCallback,
104250
104023
  useImperativeHandle: noop3,
104251
104024
  useEffect: noop3,
104252
104025
  useDebugValue: noop3,
@@ -105534,7 +105307,7 @@ function recursivelyMapDoc(doc, callback) {
105534
105307
  }
105535
105308
  return callback(doc);
105536
105309
  }
105537
- var import_react28, import_jsx_runtime3, __defProp2, __defProps, __getOwnPropDescs, __getOwnPropSymbols, __hasOwnProp2, __propIsEnum, __defNormalProp = (obj, key, value) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value, __spreadValues = (a4, b6) => {
105310
+ var import_react26, import_jsx_runtime, __defProp2, __defProps, __getOwnPropDescs, __getOwnPropSymbols, __hasOwnProp2, __propIsEnum, __defNormalProp = (obj, key, value) => (key in obj) ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value, __spreadValues = (a4, b6) => {
105538
105311
  for (var prop in b6 || (b6 = {}))
105539
105312
  if (__hasOwnProp2.call(b6, prop))
105540
105313
  __defNormalProp(a4, prop, b6[prop]);
@@ -105591,7 +105364,7 @@ var import_react28, import_jsx_runtime3, __defProp2, __defProps, __getOwnPropDes
105591
105364
  }
105592
105365
  return result;
105593
105366
  }), render3 = (node2, options) => __async(undefined, null, function* () {
105594
- const suspendedElement = /* @__PURE__ */ import_jsx_runtime3.jsx(import_react28.Suspense, { children: node2 });
105367
+ const suspendedElement = /* @__PURE__ */ import_jsx_runtime.jsx(import_react26.Suspense, { children: node2 });
105595
105368
  const reactDOMServer = yield Promise.resolve().then(() => (init_server_node(), exports_server_node)).then((m4) => m4.default);
105596
105369
  let html2;
105597
105370
  if (Object.hasOwn(reactDOMServer, "renderToReadableStream")) {
@@ -105629,8 +105402,8 @@ var init_node2 = __esm(() => {
105629
105402
  init_html_to_text();
105630
105403
  init_html();
105631
105404
  init_standalone();
105632
- import_react28 = __toESM(require_react2(), 1);
105633
- import_jsx_runtime3 = __toESM(require_jsx_runtime2(), 1);
105405
+ import_react26 = __toESM(require_react2(), 1);
105406
+ import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
105634
105407
  __defProp2 = Object.defineProperty;
105635
105408
  __defProps = Object.defineProperties;
105636
105409
  __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -105862,9 +105635,9 @@ React keys must be passed directly to JSX without using spread:
105862
105635
  return ReactElement(type, children, maybeKey, getOwner(), debugStack, debugTask);
105863
105636
  }
105864
105637
  function validateChildKeys(node2) {
105865
- isValidElement2(node2) ? node2._store && (node2._store.validated = 1) : typeof node2 === "object" && node2 !== null && node2.$$typeof === REACT_LAZY_TYPE && (node2._payload.status === "fulfilled" ? isValidElement2(node2._payload.value) && node2._payload.value._store && (node2._payload.value._store.validated = 1) : node2._store && (node2._store.validated = 1));
105638
+ isValidElement(node2) ? node2._store && (node2._store.validated = 1) : typeof node2 === "object" && node2 !== null && node2.$$typeof === REACT_LAZY_TYPE && (node2._payload.status === "fulfilled" ? isValidElement(node2._payload.value) && node2._payload.value._store && (node2._payload.value._store.validated = 1) : node2._store && (node2._store.validated = 1));
105866
105639
  }
105867
- function isValidElement2(object) {
105640
+ function isValidElement(object) {
105868
105641
  return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
105869
105642
  }
105870
105643
  var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_ACTIVITY_TYPE = Symbol.for("react.activity"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference"), ReactSharedInternals = React11.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, hasOwnProperty = Object.prototype.hasOwnProperty, isArrayImpl = Array.isArray, createTask = console.createTask ? console.createTask : function() {
@@ -113094,6 +112867,25 @@ var getInstance = (stdout, createInstance) => {
113094
112867
  };
113095
112868
  // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/components/Static.js
113096
112869
  var import_react14 = __toESM(require_react(), 1);
112870
+ function Static(props) {
112871
+ const { items, children: render2, style: customStyle } = props;
112872
+ const [index, setIndex] = import_react14.useState(0);
112873
+ const itemsToRender = import_react14.useMemo(() => {
112874
+ return items.slice(index);
112875
+ }, [items, index]);
112876
+ import_react14.useLayoutEffect(() => {
112877
+ setIndex(items.length);
112878
+ }, [items.length]);
112879
+ const children = itemsToRender.map((item, itemIndex) => {
112880
+ return render2(item, index + itemIndex);
112881
+ });
112882
+ const style = import_react14.useMemo(() => ({
112883
+ position: "absolute",
112884
+ flexDirection: "column",
112885
+ ...customStyle
112886
+ }), [customStyle]);
112887
+ return import_react14.default.createElement("ink-box", { internal_static: true, style }, children);
112888
+ }
113097
112889
  // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/components/Transform.js
113098
112890
  var import_react15 = __toESM(require_react(), 1);
113099
112891
  // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/components/Newline.js
@@ -113365,287 +113157,8 @@ var import_react23 = __toESM(require_react(), 1);
113365
113157
  var import_react24 = __toESM(require_react(), 1);
113366
113158
  // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/hooks/use-is-screen-reader-enabled.js
113367
113159
  var import_react25 = __toESM(require_react(), 1);
113368
- // node_modules/.bun/ink@6.6.0+72334a9139930758/node_modules/ink/build/measure-element.js
113369
- var measureElement = (node) => ({
113370
- width: node.yogaNode?.getComputedWidth() ?? 0,
113371
- height: node.yogaNode?.getComputedHeight() ?? 0
113372
- });
113373
- var measure_element_default = measureElement;
113374
113160
  // packages/terminal/src/components/App.tsx
113375
- var import_react36 = __toESM(require_react(), 1);
113376
-
113377
- // node_modules/.bun/ink-scroll-view@0.3.5+43e67b6d697aa20c/node_modules/ink-scroll-view/dist/index.js
113378
- var import_react26 = __toESM(require_react(), 1);
113379
- var import_react27 = __toESM(require_react(), 1);
113380
- var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
113381
- var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
113382
- var MeasurableItem = ({
113383
- children,
113384
- onMeasure,
113385
- index,
113386
- width,
113387
- measureKey
113388
- }) => {
113389
- const ref = import_react27.useRef(null);
113390
- import_react27.useLayoutEffect(() => {
113391
- if (ref.current) {
113392
- const { height } = measure_element_default(ref.current);
113393
- onMeasure(index, height);
113394
- }
113395
- }, [index, onMeasure, width, measureKey, children]);
113396
- return /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, { ref, flexShrink: 0, width: "100%", flexDirection: "column", children });
113397
- };
113398
- function useStateRef(initialValue) {
113399
- const [state, setStateInternal] = import_react27.useState(initialValue);
113400
- const ref = import_react27.useRef(initialValue);
113401
- const setState = import_react27.useCallback((update) => {
113402
- const nextValue = typeof update === "function" ? update(ref.current) : update;
113403
- ref.current = nextValue;
113404
- setStateInternal(nextValue);
113405
- }, []);
113406
- const getState = import_react27.useCallback(() => ref.current, []);
113407
- return [state, setState, getState];
113408
- }
113409
- var ControlledScrollView = import_react27.forwardRef(({
113410
- scrollOffset,
113411
- onViewportSizeChange,
113412
- onContentHeightChange,
113413
- onItemHeightChange,
113414
- debug = false,
113415
- children,
113416
- ...boxProps
113417
- }, ref) => {
113418
- const [viewportSize, setViewportSize, getViewportSize] = useStateRef({
113419
- height: 0,
113420
- width: 0
113421
- });
113422
- const [contentHeight, setContentHeight, getContentHeight] = useStateRef(0);
113423
- const [itemMeasureKeys, setItemMeasureKeys] = import_react27.useState({});
113424
- const viewportRef = import_react27.useRef(null);
113425
- const contentRef = import_react27.useRef(null);
113426
- const prevContentHeightRef = import_react27.useRef(0);
113427
- import_react27.useLayoutEffect(() => {
113428
- if (contentHeight !== prevContentHeightRef.current) {
113429
- onContentHeightChange?.(contentHeight, prevContentHeightRef.current);
113430
- prevContentHeightRef.current = contentHeight;
113431
- }
113432
- }, [contentHeight, onContentHeightChange]);
113433
- const itemHeightsRef = import_react27.useRef({});
113434
- const itemKeysRef = import_react27.useRef([]);
113435
- const itemOffsetsRef = import_react27.useRef([]);
113436
- const firstInvalidOffsetIndexRef = import_react27.useRef(0);
113437
- const handleItemMeasure = import_react27.useCallback((index, height) => {
113438
- const key = itemKeysRef.current[index] || index;
113439
- if (itemHeightsRef.current[key] !== height) {
113440
- const previousHeight = itemHeightsRef.current[key] || 0;
113441
- itemHeightsRef.current = {
113442
- ...itemHeightsRef.current,
113443
- [key]: height
113444
- };
113445
- let newTotalHeight = 0;
113446
- for (const itemKey of itemKeysRef.current) {
113447
- newTotalHeight += itemHeightsRef.current[itemKey] || 0;
113448
- }
113449
- const currentHeight = getContentHeight();
113450
- if (newTotalHeight !== currentHeight) {
113451
- setContentHeight(newTotalHeight);
113452
- }
113453
- onItemHeightChange?.(index, height, previousHeight);
113454
- firstInvalidOffsetIndexRef.current = Math.min(firstInvalidOffsetIndexRef.current, index + 1);
113455
- }
113456
- }, [
113457
- onItemHeightChange,
113458
- onContentHeightChange,
113459
- getContentHeight,
113460
- setContentHeight
113461
- ]);
113462
- const measureViewport = import_react27.useCallback(() => {
113463
- if (viewportRef.current) {
113464
- const { width, height } = measure_element_default(viewportRef.current);
113465
- const currentSize = getViewportSize();
113466
- if (width !== currentSize.width || height !== currentSize.height) {
113467
- onViewportSizeChange?.({ width, height }, currentSize);
113468
- setViewportSize({ width, height });
113469
- }
113470
- }
113471
- }, [viewportRef, onViewportSizeChange, getViewportSize, setViewportSize]);
113472
- import_react27.useLayoutEffect(() => {
113473
- measureViewport();
113474
- });
113475
- const prevChildrenRef = import_react27.useRef(null);
113476
- if (prevChildrenRef.current !== children) {
113477
- prevChildrenRef.current = children;
113478
- const newItemKeys = [];
113479
- const newItemHeights = {};
113480
- import_react27.Children.forEach(children, (child, index) => {
113481
- if (!child)
113482
- return;
113483
- const key = import_react27.isValidElement(child) ? child.key : null;
113484
- const effectiveKey = key !== null ? key : index;
113485
- newItemKeys[index] = effectiveKey;
113486
- const itemHeight = itemHeightsRef.current[effectiveKey] || 0;
113487
- newItemHeights[effectiveKey] = itemHeight;
113488
- });
113489
- itemHeightsRef.current = newItemHeights;
113490
- itemKeysRef.current = newItemKeys;
113491
- itemOffsetsRef.current = new Array(newItemKeys.length).fill(0);
113492
- firstInvalidOffsetIndexRef.current = 0;
113493
- let newTotalHeight = 0;
113494
- newItemKeys.forEach((itemKey) => {
113495
- newTotalHeight += newItemHeights[itemKey] || 0;
113496
- });
113497
- const currentHeight = getContentHeight();
113498
- if (newTotalHeight !== currentHeight) {
113499
- setContentHeight(newTotalHeight);
113500
- }
113501
- }
113502
- import_react27.useImperativeHandle(ref, () => ({
113503
- getContentHeight,
113504
- getViewportHeight: () => getViewportSize().height,
113505
- getBottomOffset: () => Math.max(0, getContentHeight() - getViewportSize().height),
113506
- getItemHeight: (index) => {
113507
- const key = itemKeysRef.current[index] || index;
113508
- return itemHeightsRef.current[key] || 0;
113509
- },
113510
- remeasure: measureViewport,
113511
- remeasureItem: (index) => setItemMeasureKeys((prev) => ({
113512
- ...prev,
113513
- [index]: (prev[index] || 0) + 1
113514
- })),
113515
- getItemPosition: (index) => {
113516
- if (index < 0 || index >= itemKeysRef.current.length) {
113517
- return null;
113518
- }
113519
- if (index >= firstInvalidOffsetIndexRef.current) {
113520
- let currentOffset = 0;
113521
- let startIndex = 0;
113522
- if (firstInvalidOffsetIndexRef.current > 0) {
113523
- startIndex = firstInvalidOffsetIndexRef.current;
113524
- const prevIndex = startIndex - 1;
113525
- const prevKey = itemKeysRef.current[prevIndex] || prevIndex;
113526
- const prevHeight = itemHeightsRef.current[prevKey] || 0;
113527
- currentOffset = (itemOffsetsRef.current[prevIndex] ?? 0) + prevHeight;
113528
- }
113529
- for (let i = startIndex;i <= index; i++) {
113530
- itemOffsetsRef.current[i] = currentOffset;
113531
- const key2 = itemKeysRef.current[i] || i;
113532
- const height2 = itemHeightsRef.current[key2] || 0;
113533
- currentOffset += height2;
113534
- }
113535
- firstInvalidOffsetIndexRef.current = index + 1;
113536
- }
113537
- const top = itemOffsetsRef.current[index] ?? 0;
113538
- const key = itemKeysRef.current[index] || index;
113539
- const height = itemHeightsRef.current[key] || 0;
113540
- return { top, height };
113541
- }
113542
- }), []);
113543
- return /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, { ...boxProps, children: /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, { ref: viewportRef, width: "100%", children: /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, { overflow: debug ? undefined : "hidden", width: "100%", children: /* @__PURE__ */ import_jsx_runtime.jsx(Box_default, {
113544
- ref: contentRef,
113545
- width: "100%",
113546
- flexDirection: "column",
113547
- marginTop: -scrollOffset,
113548
- children: import_react27.Children.map(children, (child, index) => {
113549
- if (!child)
113550
- return null;
113551
- return /* @__PURE__ */ import_jsx_runtime.jsx(MeasurableItem, {
113552
- index,
113553
- width: viewportSize.width,
113554
- onMeasure: handleItemMeasure,
113555
- measureKey: itemMeasureKeys[index],
113556
- children: child
113557
- }, import_react27.isValidElement(child) ? child.key || index : index);
113558
- })
113559
- }) }) }) });
113560
- });
113561
- function useStateRef2(initialValue) {
113562
- const [state, setStateInternal] = import_react26.useState(initialValue);
113563
- const ref = import_react26.useRef(initialValue);
113564
- const setState = import_react26.useCallback((update) => {
113565
- const nextValue = typeof update === "function" ? update(ref.current) : update;
113566
- ref.current = nextValue;
113567
- setStateInternal(nextValue);
113568
- }, []);
113569
- const getState = import_react26.useCallback(() => ref.current, []);
113570
- return [state, setState, getState];
113571
- }
113572
- var ScrollView = import_react26.forwardRef(({
113573
- onScroll,
113574
- onViewportSizeChange,
113575
- onContentHeightChange,
113576
- onItemHeightChange,
113577
- debug = false,
113578
- children,
113579
- ...boxProps
113580
- }, ref) => {
113581
- const [scrollOffset, setScrollOffset, getScrollOffset] = useStateRef2(0);
113582
- const innerRef = import_react26.useRef(null);
113583
- const contentHeightRef = import_react26.useRef(0);
113584
- const handleContentHeightChange = import_react26.useCallback((height, previousHeight) => {
113585
- contentHeightRef.current = height;
113586
- onContentHeightChange?.(height, previousHeight);
113587
- if (getScrollOffset() > height) {
113588
- setScrollOffset(height);
113589
- onScroll?.(height);
113590
- }
113591
- }, [onContentHeightChange, onScroll, getScrollOffset, setScrollOffset]);
113592
- const getBottomOffset = import_react26.useCallback(() => Math.max(0, contentHeightRef.current - (innerRef.current?.getViewportHeight() || 0)), []);
113593
- import_react26.useImperativeHandle(ref, () => ({
113594
- scrollTo: (offset) => {
113595
- if (typeof offset !== "number" || isNaN(offset)) {
113596
- return;
113597
- }
113598
- const currentContentHeight = contentHeightRef.current;
113599
- const newScrollTop = Math.max(0, Math.min(offset, currentContentHeight));
113600
- if (newScrollTop !== getScrollOffset()) {
113601
- setScrollOffset(newScrollTop);
113602
- onScroll?.(newScrollTop);
113603
- }
113604
- },
113605
- scrollBy: (delta) => {
113606
- if (typeof delta !== "number" || isNaN(delta)) {
113607
- return;
113608
- }
113609
- const currentContentHeight = contentHeightRef.current;
113610
- const newScrollTop = Math.max(0, Math.min(getScrollOffset() + delta, currentContentHeight));
113611
- if (newScrollTop !== getScrollOffset()) {
113612
- setScrollOffset(newScrollTop);
113613
- onScroll?.(newScrollTop);
113614
- }
113615
- },
113616
- scrollToTop: () => {
113617
- if (getScrollOffset() !== 0) {
113618
- setScrollOffset(0);
113619
- onScroll?.(0);
113620
- }
113621
- },
113622
- scrollToBottom: () => {
113623
- const bottomOffset = getBottomOffset();
113624
- if (getScrollOffset() !== bottomOffset) {
113625
- setScrollOffset(bottomOffset);
113626
- onScroll?.(bottomOffset);
113627
- }
113628
- },
113629
- getScrollOffset,
113630
- getContentHeight: () => contentHeightRef.current,
113631
- getViewportHeight: () => innerRef.current?.getViewportHeight() || 0,
113632
- getBottomOffset,
113633
- getItemHeight: (index) => innerRef.current?.getItemHeight(index) || 0,
113634
- getItemPosition: (index) => innerRef.current?.getItemPosition(index) || null,
113635
- remeasure: () => innerRef.current?.remeasure(),
113636
- remeasureItem: (index) => innerRef.current?.remeasureItem(index)
113637
- }), [onScroll, getBottomOffset, getScrollOffset, setScrollOffset]);
113638
- return /* @__PURE__ */ import_jsx_runtime2.jsx(ControlledScrollView, {
113639
- ref: innerRef,
113640
- scrollOffset,
113641
- onViewportSizeChange,
113642
- onContentHeightChange: handleContentHeightChange,
113643
- onItemHeightChange,
113644
- debug,
113645
- children,
113646
- ...boxProps
113647
- });
113648
- });
113161
+ var import_react34 = __toESM(require_react(), 1);
113649
113162
 
113650
113163
  // packages/core/src/agent/loop.ts
113651
113164
  init_src();
@@ -114806,7 +114319,11 @@ class ToolRegistry {
114806
114319
  }
114807
114320
  const timeoutMsRaw = input?.timeoutMs ?? input?.timeout;
114808
114321
  const timeoutMsParsed = typeof timeoutMsRaw === "string" ? Number(timeoutMsRaw) : timeoutMsRaw;
114809
- const timeoutMs = typeof timeoutMsParsed === "number" && timeoutMsParsed > 0 ? timeoutMsParsed : 60000;
114322
+ let timeoutMs = typeof timeoutMsParsed === "number" && timeoutMsParsed > 0 ? timeoutMsParsed : 60000;
114323
+ const derivedWaitTimeout = deriveWaitTimeoutMs(toolCall.name, input);
114324
+ if (derivedWaitTimeout !== null && derivedWaitTimeout > timeoutMs) {
114325
+ timeoutMs = derivedWaitTimeout;
114326
+ }
114810
114327
  const result = await Promise.race([
114811
114328
  registered.executor(input),
114812
114329
  sleep(timeoutMs).then(() => {
@@ -114870,6 +114387,50 @@ class ToolRegistry {
114870
114387
  function resolveMode(defaultMode, override) {
114871
114388
  return override ?? defaultMode ?? "strict";
114872
114389
  }
114390
+ function toNumber(value) {
114391
+ if (value === undefined || value === null)
114392
+ return null;
114393
+ const num = typeof value === "string" ? Number(value) : value;
114394
+ if (!Number.isFinite(num))
114395
+ return null;
114396
+ return num;
114397
+ }
114398
+ function deriveWaitTimeoutMs(toolName, input) {
114399
+ if (!input)
114400
+ return null;
114401
+ if (toolName !== "wait" && toolName !== "sleep")
114402
+ return null;
114403
+ const durationMs = toNumber(input.durationMs);
114404
+ if (durationMs !== null) {
114405
+ return clampWaitTimeout(durationMs);
114406
+ }
114407
+ const seconds = toNumber(input.seconds);
114408
+ if (seconds !== null) {
114409
+ return clampWaitTimeout(seconds * 1000);
114410
+ }
114411
+ const minutes = toNumber(input.minutes);
114412
+ if (minutes !== null) {
114413
+ return clampWaitTimeout(minutes * 60 * 1000);
114414
+ }
114415
+ const minSeconds = toNumber(input.minSeconds);
114416
+ const maxSeconds = toNumber(input.maxSeconds);
114417
+ if (minSeconds !== null && maxSeconds !== null) {
114418
+ return clampWaitTimeout(Math.max(minSeconds, maxSeconds) * 1000);
114419
+ }
114420
+ const minMinutes = toNumber(input.minMinutes);
114421
+ const maxMinutes = toNumber(input.maxMinutes);
114422
+ if (minMinutes !== null && maxMinutes !== null) {
114423
+ return clampWaitTimeout(Math.max(minMinutes, maxMinutes) * 60 * 1000);
114424
+ }
114425
+ return null;
114426
+ }
114427
+ function clampWaitTimeout(durationMs) {
114428
+ const bufferMs = 5000;
114429
+ const maxMs = 7 * 24 * 60 * 60 * 1000;
114430
+ const safeDuration = Math.max(0, durationMs);
114431
+ const timeoutMs = safeDuration + bufferMs;
114432
+ return Math.min(timeoutMs, maxMs);
114433
+ }
114873
114434
  function normalizeToolError(error, toolCall) {
114874
114435
  if (error instanceof AssistantError)
114875
114436
  return error;
@@ -115593,6 +115154,13 @@ class BashTool {
115593
115154
  const cwd2 = input.cwd || process.cwd();
115594
115155
  const timeoutInput = Number(input.timeout);
115595
115156
  const timeout = Number.isFinite(timeoutInput) && timeoutInput > 0 ? timeoutInput : 30000;
115157
+ let allowEnv = true;
115158
+ try {
115159
+ const config = await loadConfig(cwd2);
115160
+ allowEnv = config.validation?.perTool?.bash?.allowEnv ?? true;
115161
+ } catch {
115162
+ allowEnv = true;
115163
+ }
115596
115164
  const baseCommand = command.replace(/\s*2>&1\s*/g, " ").trim();
115597
115165
  const baseTrimmed = baseCommand.toLowerCase();
115598
115166
  const allowConnectorNewlines = baseTrimmed.startsWith("connect-") || baseTrimmed.startsWith("connect_");
@@ -115643,8 +115211,30 @@ class BashTool {
115643
115211
  }
115644
115212
  }
115645
115213
  const commandTrimmed = commandForChecks.trim().toLowerCase();
115214
+ const isEnvCommand = /^(env|printenv)(\s|$)/.test(commandTrimmed);
115215
+ if (!allowEnv && isEnvCommand) {
115216
+ getSecurityLogger().log({
115217
+ eventType: "blocked_command",
115218
+ severity: "medium",
115219
+ details: {
115220
+ tool: "bash",
115221
+ command,
115222
+ reason: "env/printenv disabled by config"
115223
+ },
115224
+ sessionId: input.sessionId || "unknown"
115225
+ });
115226
+ throw new ToolExecutionError("Command not allowed: env/printenv disabled by config.", {
115227
+ toolName: "bash",
115228
+ toolInput: input,
115229
+ code: ErrorCodes.TOOL_PERMISSION_DENIED,
115230
+ recoverable: false,
115231
+ retryable: false,
115232
+ suggestion: "Enable validation.perTool.bash.allowEnv to allow env/printenv."
115233
+ });
115234
+ }
115646
115235
  let isAllowed = false;
115647
- for (const allowed of this.ALLOWED_COMMANDS) {
115236
+ const allowlist = allowEnv ? this.ALLOWED_COMMANDS : this.ALLOWED_COMMANDS.filter((allowed) => allowed !== "env" && allowed !== "printenv");
115237
+ for (const allowed of allowlist) {
115648
115238
  if (commandTrimmed.startsWith(allowed.toLowerCase())) {
115649
115239
  isAllowed = true;
115650
115240
  break;
@@ -118139,6 +117729,170 @@ function createAskUserTool(getHandler) {
118139
117729
  return { tool, executor };
118140
117730
  }
118141
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
+
118142
117896
  // packages/core/src/agent/subagent.ts
118143
117897
  init_src();
118144
117898
  var DEFAULT_HOOK_TOOLS = ["read", "glob", "grep"];
@@ -120239,7 +119993,7 @@ function formatAge(ms) {
120239
119993
  return `${days}d`;
120240
119994
  }
120241
119995
  // packages/core/src/commands/builtin.ts
120242
- var VERSION = process.env.ASSISTANTS_VERSION || process.env.npm_package_version || "unknown";
119996
+ var VERSION = "0.6.43";
120243
119997
  function resolveAuthTimeout(resolve5) {
120244
119998
  resolve5({ exitCode: 1, stdout: { toString: () => "{}" } });
120245
119999
  }
@@ -138885,6 +138639,8 @@ class AgentLoop {
138885
138639
  this.toolRegistry.register(askUserTool.tool, askUserTool.executor);
138886
138640
  this.toolRegistry.register(FeedbackTool.tool, FeedbackTool.executor);
138887
138641
  this.toolRegistry.register(SchedulerTool.tool, SchedulerTool.executor);
138642
+ this.toolRegistry.register(WaitTool.tool, WaitTool.executor);
138643
+ this.toolRegistry.register(SleepTool.tool, SleepTool.executor);
138888
138644
  if (this.config?.inbox?.enabled) {
138889
138645
  const assistant = this.assistantManager?.getActive();
138890
138646
  const agentId = assistant?.id || this.sessionId;
@@ -138908,8 +138664,8 @@ class AgentLoop {
138908
138664
  this.emit({ type: "text", content: message });
138909
138665
  });
138910
138666
  const jobTools = createJobTools(() => this.jobManager);
138911
- for (const { tool, executor } of jobTools) {
138912
- this.toolRegistry.register(tool, executor);
138667
+ for (const { tool, executor: executor2 } of jobTools) {
138668
+ this.toolRegistry.register(tool, executor2);
138913
138669
  }
138914
138670
  this.connectorBridge.setJobManagerGetter(() => this.jobManager);
138915
138671
  this.jobManager.cleanup().catch(() => {});
@@ -140600,17 +140356,17 @@ init_retry();
140600
140356
  init_src();
140601
140357
 
140602
140358
  // packages/terminal/src/components/Input.tsx
140603
- var import_react30 = __toESM(require_react(), 1);
140359
+ var import_react28 = __toESM(require_react(), 1);
140604
140360
 
140605
140361
  // node_modules/.bun/ink-text-input@6.0.0+43e67b6d697aa20c/node_modules/ink-text-input/build/index.js
140606
- var import_react29 = __toESM(require_react(), 1);
140362
+ var import_react27 = __toESM(require_react(), 1);
140607
140363
  function TextInput({ value: originalValue, placeholder = "", focus = true, mask, highlightPastedText = false, showCursor = true, onChange, onSubmit }) {
140608
- const [state, setState] = import_react29.useState({
140364
+ const [state, setState] = import_react27.useState({
140609
140365
  cursorOffset: (originalValue || "").length,
140610
140366
  cursorWidth: 0
140611
140367
  });
140612
140368
  const { cursorOffset, cursorWidth } = state;
140613
- import_react29.useEffect(() => {
140369
+ import_react27.useEffect(() => {
140614
140370
  setState((previousState) => {
140615
140371
  if (!focus || !showCursor) {
140616
140372
  return previousState;
@@ -140688,7 +140444,7 @@ function TextInput({ value: originalValue, placeholder = "", focus = true, mask,
140688
140444
  onChange(nextValue);
140689
140445
  }
140690
140446
  }, { isActive: focus });
140691
- return import_react29.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
140447
+ return import_react27.default.createElement(Text, null, placeholder ? value.length > 0 ? renderedValue : renderedPlaceholder : renderedValue);
140692
140448
  }
140693
140449
  var build_default = TextInput;
140694
140450
 
@@ -140730,9 +140486,9 @@ function Input({
140730
140486
  isAskingUser = false,
140731
140487
  askPlaceholder
140732
140488
  }) {
140733
- const [value, setValue] = import_react30.useState("");
140734
- const [selectedIndex, setSelectedIndex] = import_react30.useState(0);
140735
- const allCommands = import_react30.useMemo(() => {
140489
+ const [value, setValue] = import_react28.useState("");
140490
+ const [selectedIndex, setSelectedIndex] = import_react28.useState(0);
140491
+ const allCommands = import_react28.useMemo(() => {
140736
140492
  const merged = [...COMMANDS];
140737
140493
  if (commands3) {
140738
140494
  for (const cmd of commands3) {
@@ -140743,7 +140499,7 @@ function Input({
140743
140499
  }
140744
140500
  return merged.sort((a5, b7) => a5.name.localeCompare(b7.name));
140745
140501
  }, [commands3]);
140746
- const autocompleteMode = import_react30.useMemo(() => {
140502
+ const autocompleteMode = import_react28.useMemo(() => {
140747
140503
  if (isAskingUser)
140748
140504
  return null;
140749
140505
  if (value.startsWith("$") && !value.includes(" ")) {
@@ -140754,20 +140510,20 @@ function Input({
140754
140510
  }
140755
140511
  return null;
140756
140512
  }, [value]);
140757
- const filteredCommands = import_react30.useMemo(() => {
140513
+ const filteredCommands = import_react28.useMemo(() => {
140758
140514
  if (autocompleteMode !== "command")
140759
140515
  return [];
140760
140516
  const search = value.toLowerCase();
140761
140517
  return allCommands.filter((cmd) => cmd.name.toLowerCase().startsWith(search));
140762
140518
  }, [value, autocompleteMode, allCommands]);
140763
- const filteredSkills = import_react30.useMemo(() => {
140519
+ const filteredSkills = import_react28.useMemo(() => {
140764
140520
  if (autocompleteMode !== "skill")
140765
140521
  return [];
140766
140522
  const search = value.slice(1).toLowerCase();
140767
140523
  return skills.filter((skill) => skill.name.toLowerCase().startsWith(search));
140768
140524
  }, [value, autocompleteMode, skills]);
140769
140525
  const autocompleteItems = autocompleteMode === "skill" ? filteredSkills : filteredCommands;
140770
- import_react30.useEffect(() => {
140526
+ import_react28.useEffect(() => {
140771
140527
  if (autocompleteItems.length === 0) {
140772
140528
  setSelectedIndex(0);
140773
140529
  return;
@@ -141011,7 +140767,7 @@ function Input({
141011
140767
  }
141012
140768
 
141013
140769
  // packages/terminal/src/components/Messages.tsx
141014
- var import_react31 = __toESM(require_react(), 1);
140770
+ var import_react29 = __toESM(require_react(), 1);
141015
140771
 
141016
140772
  // packages/terminal/src/components/Markdown.tsx
141017
140773
  var jsx_dev_runtime2 = __toESM(require_jsx_dev_runtime(), 1);
@@ -141985,9 +141741,9 @@ function Messages3({
141985
141741
  queuedMessageIds,
141986
141742
  verboseTools = false
141987
141743
  }) {
141988
- const [now2, setNow] = import_react31.useState(Date.now());
141989
- const messageGroups = import_react31.useMemo(() => groupConsecutiveToolMessages(messages), [messages]);
141990
- const messageItems = import_react31.useMemo(() => {
141744
+ const [now2, setNow] = import_react29.useState(Date.now());
141745
+ const messageGroups = import_react29.useMemo(() => groupConsecutiveToolMessages(messages), [messages]);
141746
+ const messageItems = import_react29.useMemo(() => {
141991
141747
  return messageGroups.map((group) => group.type === "single" ? { kind: "message", message: group.message } : { kind: "grouped", messages: group.messages });
141992
141748
  }, [messageGroups]);
141993
141749
  const visibleMessageItems = messageItems;
@@ -142000,7 +141756,7 @@ function Messages3({
142000
141756
  }
142001
141757
  return { id: item.messages[0].id, item };
142002
141758
  });
142003
- const toolResultMap = import_react31.useMemo(() => {
141759
+ const toolResultMap = import_react29.useMemo(() => {
142004
141760
  const map2 = new Map;
142005
141761
  for (const entry of activityLog) {
142006
141762
  if (entry.type === "tool_result" && entry.toolResult) {
@@ -142009,7 +141765,7 @@ function Messages3({
142009
141765
  }
142010
141766
  return map2;
142011
141767
  }, [activityLog]);
142012
- const hasPendingTools = import_react31.useMemo(() => {
141768
+ const hasPendingTools = import_react29.useMemo(() => {
142013
141769
  for (const entry of activityLog) {
142014
141770
  if (entry.type === "tool_call" && entry.toolCall) {
142015
141771
  if (!toolResultMap.has(entry.toolCall.id)) {
@@ -142019,7 +141775,7 @@ function Messages3({
142019
141775
  }
142020
141776
  return false;
142021
141777
  }, [activityLog, toolResultMap]);
142022
- import_react31.useEffect(() => {
141778
+ import_react29.useEffect(() => {
142023
141779
  if (!hasPendingTools)
142024
141780
  return;
142025
141781
  const interval = setInterval(() => {
@@ -142065,7 +141821,7 @@ function Messages3({
142065
141821
  if (entry.type === "tool_call" && entry.toolCall) {
142066
141822
  const resultEntry = toolResultMap.get(entry.toolCall.id);
142067
141823
  const elapsedMs = (resultEntry ? resultEntry.timestamp : now2) - entry.timestamp;
142068
- const elapsedText = formatDuration(elapsedMs);
141824
+ const elapsedText = formatDuration2(elapsedMs);
142069
141825
  return /* @__PURE__ */ jsx_dev_runtime3.jsxDEV(Box_default, {
142070
141826
  marginY: 1,
142071
141827
  flexDirection: "column",
@@ -142139,7 +141895,7 @@ function Messages3({
142139
141895
  ]
142140
141896
  }, undefined, true, undefined, this);
142141
141897
  }
142142
- function formatDuration(ms2) {
141898
+ function formatDuration2(ms2) {
142143
141899
  const totalSeconds = Math.max(0, Math.floor(ms2 / 1000));
142144
141900
  if (totalSeconds < 60)
142145
141901
  return `${totalSeconds}s`;
@@ -142669,7 +142425,7 @@ function buildDisplayMessages(messages, chunkLines, wrapChars, options) {
142669
142425
  }
142670
142426
 
142671
142427
  // packages/terminal/src/components/Status.tsx
142672
- var import_react32 = __toESM(require_react(), 1);
142428
+ var import_react30 = __toESM(require_react(), 1);
142673
142429
  var jsx_dev_runtime4 = __toESM(require_jsx_dev_runtime(), 1);
142674
142430
  function Status({
142675
142431
  isProcessing,
@@ -142686,8 +142442,8 @@ function Status({
142686
142442
  processingStartTime,
142687
142443
  verboseTools = false
142688
142444
  }) {
142689
- const [elapsed, setElapsed] = import_react32.useState(0);
142690
- import_react32.useEffect(() => {
142445
+ const [elapsed, setElapsed] = import_react30.useState(0);
142446
+ import_react30.useEffect(() => {
142691
142447
  if (!isProcessing || !processingStartTime) {
142692
142448
  setElapsed(0);
142693
142449
  return;
@@ -142699,7 +142455,7 @@ function Status({
142699
142455
  const interval = setInterval(update, 1000);
142700
142456
  return () => clearInterval(interval);
142701
142457
  }, [isProcessing, processingStartTime]);
142702
- const formatDuration2 = (seconds) => {
142458
+ const formatDuration3 = (seconds) => {
142703
142459
  if (seconds < 60)
142704
142460
  return `${seconds}s`;
142705
142461
  const mins = Math.floor(seconds / 60);
@@ -142758,7 +142514,7 @@ function Status({
142758
142514
  dimColor: true,
142759
142515
  children: [
142760
142516
  " \xB7 ",
142761
- formatDuration2(elapsed)
142517
+ formatDuration3(elapsed)
142762
142518
  ]
142763
142519
  }, undefined, true, undefined, this),
142764
142520
  verboseLabel && /* @__PURE__ */ jsx_dev_runtime4.jsxDEV(Text, {
@@ -142789,12 +142545,12 @@ function Status({
142789
142545
  }
142790
142546
 
142791
142547
  // node_modules/.bun/ink-spinner@5.0.0+43e67b6d697aa20c/node_modules/ink-spinner/build/index.js
142792
- var import_react33 = __toESM(require_react(), 1);
142548
+ var import_react31 = __toESM(require_react(), 1);
142793
142549
  var import_cli_spinners = __toESM(require_cli_spinners(), 1);
142794
142550
  function Spinner({ type = "dots" }) {
142795
- const [frame, setFrame] = import_react33.useState(0);
142551
+ const [frame, setFrame] = import_react31.useState(0);
142796
142552
  const spinner = import_cli_spinners.default[type];
142797
- import_react33.useEffect(() => {
142553
+ import_react31.useEffect(() => {
142798
142554
  const timer = setInterval(() => {
142799
142555
  setFrame((previousFrame) => {
142800
142556
  const isLastFrame = previousFrame === spinner.frames.length - 1;
@@ -142805,7 +142561,7 @@ function Spinner({ type = "dots" }) {
142805
142561
  clearInterval(timer);
142806
142562
  };
142807
142563
  }, [spinner]);
142808
- return import_react33.default.createElement(Text, null, spinner.frames[frame]);
142564
+ return import_react31.default.createElement(Text, null, spinner.frames[frame]);
142809
142565
  }
142810
142566
  var build_default2 = Spinner;
142811
142567
 
@@ -142832,7 +142588,7 @@ function Spinner2({ label }) {
142832
142588
  }
142833
142589
 
142834
142590
  // packages/terminal/src/components/ProcessingIndicator.tsx
142835
- var import_react34 = __toESM(require_react(), 1);
142591
+ var import_react32 = __toESM(require_react(), 1);
142836
142592
  var jsx_dev_runtime6 = __toESM(require_jsx_dev_runtime(), 1);
142837
142593
  function ProcessingIndicator({
142838
142594
  isProcessing,
@@ -142840,8 +142596,8 @@ function ProcessingIndicator({
142840
142596
  tokenCount = 0,
142841
142597
  isThinking = false
142842
142598
  }) {
142843
- const [elapsed, setElapsed] = import_react34.useState(0);
142844
- import_react34.useEffect(() => {
142599
+ const [elapsed, setElapsed] = import_react32.useState(0);
142600
+ import_react32.useEffect(() => {
142845
142601
  if (!isProcessing || !startTime) {
142846
142602
  setElapsed(0);
142847
142603
  return;
@@ -142971,7 +142727,7 @@ function WelcomeBanner({ version: version2, model, directory }) {
142971
142727
  }
142972
142728
 
142973
142729
  // packages/terminal/src/components/SessionSelector.tsx
142974
- var import_react35 = __toESM(require_react(), 1);
142730
+ var import_react33 = __toESM(require_react(), 1);
142975
142731
  var jsx_dev_runtime8 = __toESM(require_jsx_dev_runtime(), 1);
142976
142732
  function formatSessionTime(timestamp) {
142977
142733
  const date = new Date(timestamp);
@@ -143006,8 +142762,8 @@ function SessionSelector({
143006
142762
  onNew,
143007
142763
  onCancel
143008
142764
  }) {
143009
- const [selectedIndex, setSelectedIndex] = import_react35.useState(0);
143010
- import_react35.useEffect(() => {
142765
+ const [selectedIndex, setSelectedIndex] = import_react33.useState(0);
142766
+ import_react33.useEffect(() => {
143011
142767
  setSelectedIndex((prev) => Math.min(prev, sessions.length));
143012
142768
  }, [sessions.length]);
143013
142769
  use_input_default((input, key) => {
@@ -143300,49 +143056,40 @@ function App2({ cwd: cwd2, version: version2 }) {
143300
143056
  const { stdout } = use_stdout_default();
143301
143057
  const rows = stdout?.rows ?? 24;
143302
143058
  const columns = stdout?.columns ?? 80;
143303
- const [registry] = import_react36.useState(() => new SessionRegistry);
143304
- const registryRef = import_react36.useRef(registry);
143305
- const [activeSessionId, setActiveSessionId] = import_react36.useState(null);
143306
- const [isInitializing, setIsInitializing] = import_react36.useState(true);
143307
- const [showSessionSelector, setShowSessionSelector] = import_react36.useState(false);
143308
- const sessionUIStates = import_react36.useRef(new Map);
143309
- const [messages, setMessages] = import_react36.useState([]);
143310
- const [currentResponse, setCurrentResponse] = import_react36.useState("");
143311
- const [currentToolCall, setCurrentToolCall] = import_react36.useState();
143312
- const [isProcessing, setIsProcessing] = import_react36.useState(false);
143313
- const [error2, setError] = import_react36.useState(null);
143314
- const [messageQueue, setMessageQueue] = import_react36.useState([]);
143315
- const [inlinePending, setInlinePending] = import_react36.useState([]);
143316
- const [activityLog, setActivityLog] = import_react36.useState([]);
143317
- const [tokenUsage, setTokenUsage] = import_react36.useState();
143318
- const [energyState, setEnergyState] = import_react36.useState();
143319
- const [voiceState, setVoiceState] = import_react36.useState();
143320
- const [identityInfo, setIdentityInfo] = import_react36.useState();
143321
- const [verboseTools, setVerboseTools] = import_react36.useState(false);
143322
- const [askUserState, setAskUserState] = import_react36.useState(null);
143323
- const [processingStartTime, setProcessingStartTime] = import_react36.useState();
143324
- const [currentTurnTokens, setCurrentTurnTokens] = import_react36.useState(0);
143325
- const [scrollOffset, setScrollOffset] = import_react36.useState(0);
143326
- const [autoScroll, setAutoScroll] = import_react36.useState(true);
143327
- const scrollRef = import_react36.useRef(null);
143328
- const [skills, setSkills] = import_react36.useState([]);
143329
- const [commands3, setCommands] = import_react36.useState([]);
143330
- const responseRef = import_react36.useRef("");
143331
- const toolCallsRef = import_react36.useRef([]);
143332
- const toolResultsRef = import_react36.useRef([]);
143333
- const activityLogRef = import_react36.useRef([]);
143334
- const skipNextDoneRef = import_react36.useRef(false);
143335
- const isProcessingRef = import_react36.useRef(isProcessing);
143336
- const processingStartTimeRef = import_react36.useRef(processingStartTime);
143337
- const pendingSendsRef = import_react36.useRef([]);
143338
- const askUserStateRef = import_react36.useRef(null);
143339
- const updateScrollMetrics = import_react36.useCallback((offset) => {
143340
- const currentOffset = typeof offset === "number" ? offset : scrollRef.current?.getScrollOffset() ?? 0;
143341
- const bottomOffset = scrollRef.current?.getBottomOffset() ?? 0;
143342
- setScrollOffset(currentOffset);
143343
- setAutoScroll(currentOffset >= Math.max(0, bottomOffset - 1));
143344
- }, []);
143345
- const beginAskUser = import_react36.useCallback((sessionId, request2) => {
143059
+ const [registry] = import_react34.useState(() => new SessionRegistry);
143060
+ const registryRef = import_react34.useRef(registry);
143061
+ const [activeSessionId, setActiveSessionId] = import_react34.useState(null);
143062
+ const [isInitializing, setIsInitializing] = import_react34.useState(true);
143063
+ const [showSessionSelector, setShowSessionSelector] = import_react34.useState(false);
143064
+ const sessionUIStates = import_react34.useRef(new Map);
143065
+ const [messages, setMessages] = import_react34.useState([]);
143066
+ const [currentResponse, setCurrentResponse] = import_react34.useState("");
143067
+ const [currentToolCall, setCurrentToolCall] = import_react34.useState();
143068
+ const [isProcessing, setIsProcessing] = import_react34.useState(false);
143069
+ const [error2, setError] = import_react34.useState(null);
143070
+ const [messageQueue, setMessageQueue] = import_react34.useState([]);
143071
+ const [inlinePending, setInlinePending] = import_react34.useState([]);
143072
+ const [activityLog, setActivityLog] = import_react34.useState([]);
143073
+ const [tokenUsage, setTokenUsage] = import_react34.useState();
143074
+ const [energyState, setEnergyState] = import_react34.useState();
143075
+ const [voiceState, setVoiceState] = import_react34.useState();
143076
+ const [identityInfo, setIdentityInfo] = import_react34.useState();
143077
+ const [verboseTools, setVerboseTools] = import_react34.useState(false);
143078
+ const [askUserState, setAskUserState] = import_react34.useState(null);
143079
+ const [processingStartTime, setProcessingStartTime] = import_react34.useState();
143080
+ const [currentTurnTokens, setCurrentTurnTokens] = import_react34.useState(0);
143081
+ const [skills, setSkills] = import_react34.useState([]);
143082
+ const [commands3, setCommands] = import_react34.useState([]);
143083
+ const responseRef = import_react34.useRef("");
143084
+ const toolCallsRef = import_react34.useRef([]);
143085
+ const toolResultsRef = import_react34.useRef([]);
143086
+ const activityLogRef = import_react34.useRef([]);
143087
+ const skipNextDoneRef = import_react34.useRef(false);
143088
+ const isProcessingRef = import_react34.useRef(isProcessing);
143089
+ const processingStartTimeRef = import_react34.useRef(processingStartTime);
143090
+ const pendingSendsRef = import_react34.useRef([]);
143091
+ const askUserStateRef = import_react34.useRef(null);
143092
+ const beginAskUser = import_react34.useCallback((sessionId, request2) => {
143346
143093
  return new Promise((resolve5, reject) => {
143347
143094
  if (askUserStateRef.current) {
143348
143095
  reject(new Error("Another interview is already in progress."));
@@ -143360,7 +143107,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143360
143107
  setAskUserState(state);
143361
143108
  });
143362
143109
  }, []);
143363
- const cancelAskUser = import_react36.useCallback((reason) => {
143110
+ const cancelAskUser = import_react34.useCallback((reason) => {
143364
143111
  const current = askUserStateRef.current;
143365
143112
  if (!current)
143366
143113
  return;
@@ -143368,7 +143115,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143368
143115
  setAskUserState(null);
143369
143116
  current.reject(new Error(reason));
143370
143117
  }, []);
143371
- const submitAskAnswer = import_react36.useCallback((answer) => {
143118
+ const submitAskAnswer = import_react34.useCallback((answer) => {
143372
143119
  setAskUserState((prev) => {
143373
143120
  if (!prev)
143374
143121
  return prev;
@@ -143389,31 +143136,19 @@ function App2({ cwd: cwd2, version: version2 }) {
143389
143136
  return nextState;
143390
143137
  });
143391
143138
  }, []);
143392
- import_react36.useEffect(() => {
143393
- if (!stdout)
143394
- return;
143395
- const handleResize = () => {
143396
- scrollRef.current?.remeasure();
143397
- updateScrollMetrics();
143398
- };
143399
- stdout.on("resize", handleResize);
143400
- return () => {
143401
- stdout.off("resize", handleResize);
143402
- };
143403
- }, [stdout, updateScrollMetrics]);
143404
- const turnIdRef = import_react36.useRef(0);
143405
- import_react36.useEffect(() => {
143139
+ const turnIdRef = import_react34.useRef(0);
143140
+ import_react34.useEffect(() => {
143406
143141
  isProcessingRef.current = isProcessing;
143407
143142
  }, [isProcessing]);
143408
- import_react36.useEffect(() => {
143143
+ import_react34.useEffect(() => {
143409
143144
  processingStartTimeRef.current = processingStartTime;
143410
143145
  }, [processingStartTime]);
143411
- import_react36.useEffect(() => {
143146
+ import_react34.useEffect(() => {
143412
143147
  if (isProcessing && !processingStartTime) {
143413
143148
  setProcessingStartTime(Date.now());
143414
143149
  }
143415
143150
  }, [isProcessing, processingStartTime]);
143416
- const buildFullResponse = import_react36.useCallback(() => {
143151
+ const buildFullResponse = import_react34.useCallback(() => {
143417
143152
  const parts = activityLogRef.current.filter((entry) => entry.type === "text" && entry.content).map((entry) => entry.content);
143418
143153
  if (responseRef.current.trim()) {
143419
143154
  parts.push(responseRef.current);
@@ -143421,7 +143156,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143421
143156
  return parts.join(`
143422
143157
  `).trim();
143423
143158
  }, []);
143424
- const loadSessionMetadata = import_react36.useCallback(async (session) => {
143159
+ const loadSessionMetadata = import_react34.useCallback(async (session) => {
143425
143160
  try {
143426
143161
  const [loadedSkills, loadedCommands] = await Promise.all([
143427
143162
  session.client.getSkills(),
@@ -143440,7 +143175,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143440
143175
  setError(err instanceof Error ? err.message : String(err));
143441
143176
  }
143442
143177
  }, []);
143443
- const finalizeResponse = import_react36.useCallback((status) => {
143178
+ const finalizeResponse = import_react34.useCallback((status) => {
143444
143179
  const baseContent = buildFullResponse();
143445
143180
  const hasContent = baseContent.length > 0;
143446
143181
  const activityToolCalls = activityLogRef.current.filter((entry) => entry.type === "tool_call" && entry.toolCall).map((entry) => entry.toolCall);
@@ -143498,7 +143233,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143498
143233
  ]);
143499
143234
  return true;
143500
143235
  }, [buildFullResponse]);
143501
- const resetTurnState = import_react36.useCallback(() => {
143236
+ const resetTurnState = import_react34.useCallback(() => {
143502
143237
  setCurrentResponse("");
143503
143238
  responseRef.current = "";
143504
143239
  toolCallsRef.current = [];
@@ -143509,7 +143244,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143509
143244
  setProcessingStartTime(undefined);
143510
143245
  setCurrentTurnTokens(0);
143511
143246
  }, []);
143512
- const saveCurrentSessionState = import_react36.useCallback(() => {
143247
+ const saveCurrentSessionState = import_react34.useCallback(() => {
143513
143248
  if (activeSessionId) {
143514
143249
  sessionUIStates.current.set(activeSessionId, {
143515
143250
  messages,
@@ -143527,7 +143262,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143527
143262
  });
143528
143263
  }
143529
143264
  }, [activeSessionId, messages, tokenUsage, energyState, voiceState, identityInfo, processingStartTime, currentTurnTokens, error2]);
143530
- const loadSessionState = import_react36.useCallback((sessionId) => {
143265
+ const loadSessionState = import_react34.useCallback((sessionId) => {
143531
143266
  const state = sessionUIStates.current.get(sessionId);
143532
143267
  if (state) {
143533
143268
  setMessages(state.messages);
@@ -143562,10 +143297,8 @@ function App2({ cwd: cwd2, version: version2 }) {
143562
143297
  setCurrentTurnTokens(0);
143563
143298
  setError(null);
143564
143299
  }
143565
- setScrollOffset(0);
143566
- setAutoScroll(true);
143567
143300
  }, []);
143568
- const handleChunk = import_react36.useCallback((chunk) => {
143301
+ const handleChunk = import_react34.useCallback((chunk) => {
143569
143302
  const isStartChunk = chunk.type === "text" || chunk.type === "tool_use";
143570
143303
  const isTerminalChunk = chunk.type === "error" || chunk.type === "done";
143571
143304
  if (!isProcessingRef.current && (isStartChunk || isTerminalChunk)) {
@@ -143689,7 +143422,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143689
143422
  }
143690
143423
  }
143691
143424
  }, [registry, exit, finalizeResponse, resetTurnState]);
143692
- import_react36.useEffect(() => {
143425
+ import_react34.useEffect(() => {
143693
143426
  const initSession = async () => {
143694
143427
  try {
143695
143428
  registry.onChunk(handleChunk);
@@ -143725,7 +143458,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143725
143458
  registry.closeAll();
143726
143459
  };
143727
143460
  }, [cwd2, registry, handleChunk, finalizeResponse, resetTurnState, loadSessionMetadata, beginAskUser]);
143728
- const processQueue = import_react36.useCallback(async () => {
143461
+ const processQueue = import_react34.useCallback(async () => {
143729
143462
  const activeSession2 = registryRef.current.getActiveSession();
143730
143463
  if (!activeSession2 || !activeSessionId)
143731
143464
  return;
@@ -143775,7 +143508,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143775
143508
  }, [activeSessionId]);
143776
143509
  const activeQueue = activeSessionId ? messageQueue.filter((msg) => msg.sessionId === activeSessionId) : [];
143777
143510
  const activeInline = activeSessionId ? inlinePending.filter((msg) => msg.sessionId === activeSessionId) : [];
143778
- const queuedMessageIds = import_react36.useMemo(() => new Set(activeQueue.filter((msg) => msg.mode === "queued").map((msg) => msg.id)), [activeQueue]);
143511
+ const queuedMessageIds = import_react34.useMemo(() => new Set(activeQueue.filter((msg) => msg.mode === "queued").map((msg) => msg.id)), [activeQueue]);
143779
143512
  const sessions = registry.listSessions();
143780
143513
  const activeSession = registry.getActiveSession();
143781
143514
  const sessionIndex = activeSessionId ? registry.getSessionIndex(activeSessionId) : 0;
@@ -143785,11 +143518,28 @@ function App2({ cwd: cwd2, version: version2 }) {
143785
143518
  const inlineCount = activeInline.length;
143786
143519
  const activeAskQuestion = askUserState?.request.questions[askUserState.index];
143787
143520
  const askPlaceholder = activeAskQuestion?.placeholder || activeAskQuestion?.question || "Answer the question...";
143521
+ const hasPendingTools = import_react34.useMemo(() => {
143522
+ const toolResultIds = new Set;
143523
+ for (const entry of activityLog) {
143524
+ if (entry.type === "tool_result" && entry.toolResult) {
143525
+ toolResultIds.add(entry.toolResult.toolCallId);
143526
+ }
143527
+ }
143528
+ for (const entry of activityLog) {
143529
+ if (entry.type === "tool_call" && entry.toolCall) {
143530
+ if (!toolResultIds.has(entry.toolCall.id)) {
143531
+ return true;
143532
+ }
143533
+ }
143534
+ }
143535
+ return false;
143536
+ }, [activityLog]);
143537
+ const isBusy = isProcessing || hasPendingTools;
143788
143538
  const showWelcome = messages.length === 0 && !isProcessing;
143789
143539
  const renderWidth = columns ? Math.max(1, columns - 2) : undefined;
143790
143540
  const wrapChars = renderWidth ?? MESSAGE_WRAP_CHARS;
143791
- const displayMessages = import_react36.useMemo(() => buildDisplayMessages(messages, MESSAGE_CHUNK_LINES, wrapChars, { maxWidth: renderWidth }), [messages, wrapChars, renderWidth]);
143792
- const streamingMessages = import_react36.useMemo(() => {
143541
+ const displayMessages = import_react34.useMemo(() => buildDisplayMessages(messages, MESSAGE_CHUNK_LINES, wrapChars, { maxWidth: renderWidth }), [messages, wrapChars, renderWidth]);
143542
+ const streamingMessages = import_react34.useMemo(() => {
143793
143543
  if (!isProcessing || !currentResponse.trim())
143794
143544
  return [];
143795
143545
  const streamingMessage = {
@@ -143800,20 +143550,12 @@ function App2({ cwd: cwd2, version: version2 }) {
143800
143550
  };
143801
143551
  return buildDisplayMessages([streamingMessage], MESSAGE_CHUNK_LINES, wrapChars, { maxWidth: renderWidth });
143802
143552
  }, [currentResponse, isProcessing, wrapChars, renderWidth]);
143803
- import_react36.useEffect(() => {
143553
+ import_react34.useEffect(() => {
143804
143554
  if (!isProcessing && activeQueue.length > 0 && activeInline.length === 0) {
143805
143555
  processQueue();
143806
143556
  }
143807
143557
  }, [isProcessing, activeQueue.length, activeInline.length, processQueue]);
143808
- import_react36.useEffect(() => {
143809
- if (!autoScroll)
143810
- return;
143811
- scrollRef.current?.scrollToBottom();
143812
- }, [displayMessages, activityLog, streamingMessages, autoScroll]);
143813
- import_react36.useEffect(() => {
143814
- updateScrollMetrics();
143815
- }, [displayMessages, activityLog, streamingMessages, updateScrollMetrics]);
143816
- const handleSessionSwitch = import_react36.useCallback(async (sessionId) => {
143558
+ const handleSessionSwitch = import_react34.useCallback(async (sessionId) => {
143817
143559
  setShowSessionSelector(false);
143818
143560
  if (sessionId === activeSessionId) {
143819
143561
  return;
@@ -143832,7 +143574,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143832
143574
  await registry.switchSession(sessionId);
143833
143575
  setActiveSessionId(sessionId);
143834
143576
  }, [activeSessionId, registry, saveCurrentSessionState, loadSessionState]);
143835
- const handleNewSession = import_react36.useCallback(async () => {
143577
+ const handleNewSession = import_react34.useCallback(async () => {
143836
143578
  setShowSessionSelector(false);
143837
143579
  try {
143838
143580
  saveCurrentSessionState();
@@ -143851,12 +143593,6 @@ function App2({ cwd: cwd2, version: version2 }) {
143851
143593
  setError(err instanceof Error ? err.message : "Failed to create session");
143852
143594
  }
143853
143595
  }, [cwd2, registry, saveCurrentSessionState, loadSessionState, beginAskUser]);
143854
- const getScrollStep = import_react36.useCallback(() => {
143855
- const viewport = scrollRef.current?.getViewportHeight();
143856
- const fallback = Math.max(3, rows - 6);
143857
- const height = viewport ?? fallback;
143858
- return Math.max(3, Math.floor(height / 2));
143859
- }, [rows]);
143860
143596
  use_input_default((input, key) => {
143861
143597
  if (key.ctrl && input === "s") {
143862
143598
  if (sessions.length > 0) {
@@ -143868,7 +143604,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143868
143604
  if (askUserStateRef.current) {
143869
143605
  cancelAskUser("Cancelled by user");
143870
143606
  }
143871
- if (isProcessing && activeSession) {
143607
+ if ((isProcessing || hasPendingTools) && activeSession) {
143872
143608
  activeSession.client.stop();
143873
143609
  const finalized = finalizeResponse("stopped");
143874
143610
  if (finalized) {
@@ -143891,7 +143627,7 @@ function App2({ cwd: cwd2, version: version2 }) {
143891
143627
  if (askUserStateRef.current) {
143892
143628
  cancelAskUser("Cancelled by user");
143893
143629
  }
143894
- if (isProcessing && activeSession) {
143630
+ if ((isProcessing || hasPendingTools) && activeSession) {
143895
143631
  activeSession.client.stop();
143896
143632
  const finalized = finalizeResponse("stopped");
143897
143633
  if (finalized) {
@@ -143903,31 +143639,8 @@ function App2({ cwd: cwd2, version: version2 }) {
143903
143639
  isProcessingRef.current = false;
143904
143640
  }
143905
143641
  }
143906
- if (key.pageUp || key.shift && key.upArrow) {
143907
- const step = getScrollStep();
143908
- scrollRef.current?.scrollBy(-step);
143909
- setAutoScroll(false);
143910
- }
143911
- if (key.pageDown || key.shift && key.downArrow) {
143912
- const step = getScrollStep();
143913
- scrollRef.current?.scrollBy(step);
143914
- }
143915
- if (key.ctrl && input === "u") {
143916
- scrollRef.current?.scrollToTop();
143917
- setAutoScroll(false);
143918
- }
143919
- if (key.ctrl && input === "d") {
143920
- scrollRef.current?.scrollToBottom();
143921
- setAutoScroll(true);
143922
- }
143923
143642
  }, { isActive: !showSessionSelector });
143924
- import_react36.useEffect(() => {
143925
- if (!activeSessionId)
143926
- return;
143927
- scrollRef.current?.scrollToBottom();
143928
- setAutoScroll(true);
143929
- }, [activeSessionId]);
143930
- const handleSubmit = import_react36.useCallback(async (input, mode = "normal") => {
143643
+ const handleSubmit = import_react34.useCallback(async (input, mode = "normal") => {
143931
143644
  if (askUserStateRef.current) {
143932
143645
  submitAskAnswer(input.trim());
143933
143646
  return;
@@ -144088,7 +143801,6 @@ function App2({ cwd: cwd2, version: version2 }) {
144088
143801
  return /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
144089
143802
  flexDirection: "column",
144090
143803
  padding: 1,
144091
- height: rows,
144092
143804
  children: [
144093
143805
  showWelcome && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(WelcomeBanner, {
144094
143806
  version: version2 ?? "unknown",
@@ -144107,37 +143819,29 @@ function App2({ cwd: cwd2, version: version2 }) {
144107
143819
  ]
144108
143820
  }, undefined, true, undefined, this)
144109
143821
  }, undefined, false, undefined, this),
144110
- scrollOffset > 0 && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
144111
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Text, {
144112
- dimColor: true,
144113
- children: [
144114
- "\u2191 ",
144115
- Math.round(scrollOffset),
144116
- " more lines above (Shift+\u2193 or Page Down to scroll down)"
144117
- ]
144118
- }, undefined, true, undefined, this)
144119
- }, undefined, false, undefined, this),
144120
- /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Box_default, {
144121
- flexGrow: 1,
144122
- flexShrink: 1,
144123
- minHeight: 1,
144124
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(ScrollView, {
144125
- ref: scrollRef,
144126
- onScroll: (offset) => updateScrollMetrics(offset),
144127
- onContentHeightChange: () => updateScrollMetrics(),
144128
- onViewportSizeChange: () => updateScrollMetrics(),
144129
- children: /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Messages3, {
144130
- messages: displayMessages,
144131
- currentResponse: undefined,
144132
- streamingMessages,
144133
- currentToolCall: undefined,
144134
- lastToolResult: undefined,
144135
- activityLog: isProcessing ? activityLog : [],
144136
- queuedMessageIds,
144137
- verboseTools
144138
- }, activeSessionId || "default", false, undefined, this)
144139
- }, undefined, false, undefined, this)
143822
+ /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Static, {
143823
+ items: displayMessages,
143824
+ children: (message) => /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Messages3, {
143825
+ messages: [message],
143826
+ currentResponse: undefined,
143827
+ streamingMessages: [],
143828
+ currentToolCall: undefined,
143829
+ lastToolResult: undefined,
143830
+ activityLog: [],
143831
+ queuedMessageIds,
143832
+ verboseTools
143833
+ }, message.id, false, undefined, this)
144140
143834
  }, undefined, false, undefined, this),
143835
+ isProcessing && /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Messages3, {
143836
+ messages: [],
143837
+ currentResponse: undefined,
143838
+ streamingMessages,
143839
+ currentToolCall: undefined,
143840
+ lastToolResult: undefined,
143841
+ activityLog,
143842
+ queuedMessageIds,
143843
+ verboseTools
143844
+ }, "streaming", false, undefined, this),
144141
143845
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(QueueIndicator, {
144142
143846
  messages: [...activeInline, ...activeQueue],
144143
143847
  maxPreview: MAX_QUEUED_PREVIEW
@@ -144161,7 +143865,7 @@ function App2({ cwd: cwd2, version: version2 }) {
144161
143865
  }, undefined, false, undefined, this),
144162
143866
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Input, {
144163
143867
  onSubmit: handleSubmit,
144164
- isProcessing,
143868
+ isProcessing: isBusy,
144165
143869
  queueLength: activeQueue.length + inlineCount,
144166
143870
  commands: commands3,
144167
143871
  skills,
@@ -144169,7 +143873,7 @@ function App2({ cwd: cwd2, version: version2 }) {
144169
143873
  askPlaceholder
144170
143874
  }, undefined, false, undefined, this),
144171
143875
  /* @__PURE__ */ jsx_dev_runtime12.jsxDEV(Status, {
144172
- isProcessing,
143876
+ isProcessing: isBusy,
144173
143877
  cwd: activeSession?.cwd || cwd2,
144174
143878
  queueLength: activeQueue.length + inlineCount,
144175
143879
  tokenUsage,
@@ -144362,8 +144066,7 @@ function formatStreamEvent(chunk) {
144362
144066
 
144363
144067
  // packages/terminal/src/index.tsx
144364
144068
  var jsx_dev_runtime13 = __toESM(require_jsx_dev_runtime(), 1);
144365
- var VERSION3 = "0.6.37";
144366
- process.env.ASSISTANTS_VERSION ??= VERSION3;
144069
+ var VERSION3 = "0.6.43";
144367
144070
  function parseArgs(argv) {
144368
144071
  const args = argv.slice(2);
144369
144072
  const options = {
@@ -144518,4 +144221,4 @@ if (options.print !== null) {
144518
144221
  });
144519
144222
  }
144520
144223
 
144521
- //# debugId=21F6ADAED0EB8F4A64756E2164756E21
144224
+ //# debugId=91A8E7F4880D78B064756E2164756E21