@metaphi-ai/hum 0.1.6 → 0.1.7
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/cli.mjs +509 -289
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -999,15 +999,15 @@ var require_react_development = __commonJS({
|
|
|
999
999
|
}
|
|
1000
1000
|
return 1;
|
|
1001
1001
|
}
|
|
1002
|
-
var
|
|
1002
|
+
var child;
|
|
1003
1003
|
var nextName;
|
|
1004
1004
|
var subtreeCount = 0;
|
|
1005
1005
|
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1006
1006
|
if (isArray(children)) {
|
|
1007
1007
|
for (var i = 0; i < children.length; i++) {
|
|
1008
|
-
|
|
1009
|
-
nextName = nextNamePrefix + getElementKey(
|
|
1010
|
-
subtreeCount += mapIntoArray(
|
|
1008
|
+
child = children[i];
|
|
1009
|
+
nextName = nextNamePrefix + getElementKey(child, i);
|
|
1010
|
+
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1011
1011
|
}
|
|
1012
1012
|
} else {
|
|
1013
1013
|
var iteratorFn = getIteratorFn(children);
|
|
@@ -1025,9 +1025,9 @@ var require_react_development = __commonJS({
|
|
|
1025
1025
|
var step;
|
|
1026
1026
|
var ii = 0;
|
|
1027
1027
|
while (!(step = iterator.next()).done) {
|
|
1028
|
-
|
|
1029
|
-
nextName = nextNamePrefix + getElementKey(
|
|
1030
|
-
subtreeCount += mapIntoArray(
|
|
1028
|
+
child = step.value;
|
|
1029
|
+
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
1030
|
+
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1031
1031
|
}
|
|
1032
1032
|
} else if (type === "object") {
|
|
1033
1033
|
var childrenString = String(children);
|
|
@@ -1042,8 +1042,8 @@ var require_react_development = __commonJS({
|
|
|
1042
1042
|
}
|
|
1043
1043
|
var result = [];
|
|
1044
1044
|
var count = 0;
|
|
1045
|
-
mapIntoArray(children, result, "", "", function(
|
|
1046
|
-
return func.call(context,
|
|
1045
|
+
mapIntoArray(children, result, "", "", function(child) {
|
|
1046
|
+
return func.call(context, child, count++);
|
|
1047
1047
|
});
|
|
1048
1048
|
return result;
|
|
1049
1049
|
}
|
|
@@ -1060,8 +1060,8 @@ var require_react_development = __commonJS({
|
|
|
1060
1060
|
}, forEachContext);
|
|
1061
1061
|
}
|
|
1062
1062
|
function toArray(children) {
|
|
1063
|
-
return mapChildren(children, function(
|
|
1064
|
-
return
|
|
1063
|
+
return mapChildren(children, function(child) {
|
|
1064
|
+
return child;
|
|
1065
1065
|
}) || [];
|
|
1066
1066
|
}
|
|
1067
1067
|
function onlyChild(children) {
|
|
@@ -1795,9 +1795,9 @@ var require_react_development = __commonJS({
|
|
|
1795
1795
|
}
|
|
1796
1796
|
if (isArray(node)) {
|
|
1797
1797
|
for (var i = 0; i < node.length; i++) {
|
|
1798
|
-
var
|
|
1799
|
-
if (isValidElement(
|
|
1800
|
-
validateExplicitKey(
|
|
1798
|
+
var child = node[i];
|
|
1799
|
+
if (isValidElement(child)) {
|
|
1800
|
+
validateExplicitKey(child, parentType);
|
|
1801
1801
|
}
|
|
1802
1802
|
}
|
|
1803
1803
|
} else if (isValidElement(node)) {
|
|
@@ -8305,17 +8305,17 @@ var require_react_reconciler_development = __commonJS({
|
|
|
8305
8305
|
break;
|
|
8306
8306
|
}
|
|
8307
8307
|
if (parentA.child === parentB.child) {
|
|
8308
|
-
var
|
|
8309
|
-
while (
|
|
8310
|
-
if (
|
|
8308
|
+
var child = parentA.child;
|
|
8309
|
+
while (child) {
|
|
8310
|
+
if (child === a) {
|
|
8311
8311
|
assertIsMounted(parentA);
|
|
8312
8312
|
return fiber;
|
|
8313
8313
|
}
|
|
8314
|
-
if (
|
|
8314
|
+
if (child === b) {
|
|
8315
8315
|
assertIsMounted(parentA);
|
|
8316
8316
|
return alternate;
|
|
8317
8317
|
}
|
|
8318
|
-
|
|
8318
|
+
child = child.sibling;
|
|
8319
8319
|
}
|
|
8320
8320
|
throw new Error("Unable to find node on an unmounted component.");
|
|
8321
8321
|
}
|
|
@@ -8382,13 +8382,13 @@ var require_react_reconciler_development = __commonJS({
|
|
|
8382
8382
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
8383
8383
|
return node;
|
|
8384
8384
|
}
|
|
8385
|
-
var
|
|
8386
|
-
while (
|
|
8387
|
-
var match = findCurrentHostFiberImpl(
|
|
8385
|
+
var child = node.child;
|
|
8386
|
+
while (child !== null) {
|
|
8387
|
+
var match = findCurrentHostFiberImpl(child);
|
|
8388
8388
|
if (match !== null) {
|
|
8389
8389
|
return match;
|
|
8390
8390
|
}
|
|
8391
|
-
|
|
8391
|
+
child = child.sibling;
|
|
8392
8392
|
}
|
|
8393
8393
|
return null;
|
|
8394
8394
|
}
|
|
@@ -8400,15 +8400,15 @@ var require_react_reconciler_development = __commonJS({
|
|
|
8400
8400
|
if (node.tag === HostComponent || node.tag === HostText) {
|
|
8401
8401
|
return node;
|
|
8402
8402
|
}
|
|
8403
|
-
var
|
|
8404
|
-
while (
|
|
8405
|
-
if (
|
|
8406
|
-
var match = findCurrentHostFiberWithNoPortalsImpl(
|
|
8403
|
+
var child = node.child;
|
|
8404
|
+
while (child !== null) {
|
|
8405
|
+
if (child.tag !== HostPortal) {
|
|
8406
|
+
var match = findCurrentHostFiberWithNoPortalsImpl(child);
|
|
8407
8407
|
if (match !== null) {
|
|
8408
8408
|
return match;
|
|
8409
8409
|
}
|
|
8410
8410
|
}
|
|
8411
|
-
|
|
8411
|
+
child = child.sibling;
|
|
8412
8412
|
}
|
|
8413
8413
|
return null;
|
|
8414
8414
|
}
|
|
@@ -10975,7 +10975,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
10975
10975
|
var didWarnAboutStringRefs;
|
|
10976
10976
|
var ownerHasKeyUseWarning;
|
|
10977
10977
|
var ownerHasFunctionTypeWarning;
|
|
10978
|
-
var warnForMissingKey = function(
|
|
10978
|
+
var warnForMissingKey = function(child, returnFiber) {
|
|
10979
10979
|
};
|
|
10980
10980
|
{
|
|
10981
10981
|
didWarnAboutMaps = false;
|
|
@@ -10983,17 +10983,17 @@ var require_react_reconciler_development = __commonJS({
|
|
|
10983
10983
|
didWarnAboutStringRefs = {};
|
|
10984
10984
|
ownerHasKeyUseWarning = {};
|
|
10985
10985
|
ownerHasFunctionTypeWarning = {};
|
|
10986
|
-
warnForMissingKey = function(
|
|
10987
|
-
if (
|
|
10986
|
+
warnForMissingKey = function(child, returnFiber) {
|
|
10987
|
+
if (child === null || typeof child !== "object") {
|
|
10988
10988
|
return;
|
|
10989
10989
|
}
|
|
10990
|
-
if (!
|
|
10990
|
+
if (!child._store || child._store.validated || child.key != null) {
|
|
10991
10991
|
return;
|
|
10992
10992
|
}
|
|
10993
|
-
if (typeof
|
|
10993
|
+
if (typeof child._store !== "object") {
|
|
10994
10994
|
throw new Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");
|
|
10995
10995
|
}
|
|
10996
|
-
|
|
10996
|
+
child._store.validated = true;
|
|
10997
10997
|
var componentName = getComponentNameFromFiber(returnFiber) || "Component";
|
|
10998
10998
|
if (ownerHasKeyUseWarning[componentName]) {
|
|
10999
10999
|
return;
|
|
@@ -11332,16 +11332,16 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11332
11332
|
}
|
|
11333
11333
|
return null;
|
|
11334
11334
|
}
|
|
11335
|
-
function warnOnInvalidKey(
|
|
11335
|
+
function warnOnInvalidKey(child, knownKeys, returnFiber) {
|
|
11336
11336
|
{
|
|
11337
|
-
if (typeof
|
|
11337
|
+
if (typeof child !== "object" || child === null) {
|
|
11338
11338
|
return knownKeys;
|
|
11339
11339
|
}
|
|
11340
|
-
switch (
|
|
11340
|
+
switch (child.$$typeof) {
|
|
11341
11341
|
case REACT_ELEMENT_TYPE:
|
|
11342
11342
|
case REACT_PORTAL_TYPE:
|
|
11343
|
-
warnForMissingKey(
|
|
11344
|
-
var key =
|
|
11343
|
+
warnForMissingKey(child, returnFiber);
|
|
11344
|
+
var key = child.key;
|
|
11345
11345
|
if (typeof key !== "string") {
|
|
11346
11346
|
break;
|
|
11347
11347
|
}
|
|
@@ -11357,8 +11357,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11357
11357
|
error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted \u2014 the behavior is unsupported and could change in a future version.", key);
|
|
11358
11358
|
break;
|
|
11359
11359
|
case REACT_LAZY_TYPE:
|
|
11360
|
-
var payload =
|
|
11361
|
-
var init =
|
|
11360
|
+
var payload = child._payload;
|
|
11361
|
+
var init = child._init;
|
|
11362
11362
|
warnOnInvalidKey(init(payload), knownKeys, returnFiber);
|
|
11363
11363
|
break;
|
|
11364
11364
|
}
|
|
@@ -11369,8 +11369,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11369
11369
|
{
|
|
11370
11370
|
var knownKeys = null;
|
|
11371
11371
|
for (var i = 0; i < newChildren.length; i++) {
|
|
11372
|
-
var
|
|
11373
|
-
knownKeys = warnOnInvalidKey(
|
|
11372
|
+
var child = newChildren[i];
|
|
11373
|
+
knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
|
|
11374
11374
|
}
|
|
11375
11375
|
}
|
|
11376
11376
|
var resultingFirstChild = null;
|
|
@@ -11454,8 +11454,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11454
11454
|
}
|
|
11455
11455
|
}
|
|
11456
11456
|
if (shouldTrackSideEffects) {
|
|
11457
|
-
existingChildren.forEach(function(
|
|
11458
|
-
return deleteChild(returnFiber,
|
|
11457
|
+
existingChildren.forEach(function(child2) {
|
|
11458
|
+
return deleteChild(returnFiber, child2);
|
|
11459
11459
|
});
|
|
11460
11460
|
}
|
|
11461
11461
|
if (getIsHydrating()) {
|
|
@@ -11488,8 +11488,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11488
11488
|
var knownKeys = null;
|
|
11489
11489
|
var _step = _newChildren.next();
|
|
11490
11490
|
for (; !_step.done; _step = _newChildren.next()) {
|
|
11491
|
-
var
|
|
11492
|
-
knownKeys = warnOnInvalidKey(
|
|
11491
|
+
var child = _step.value;
|
|
11492
|
+
knownKeys = warnOnInvalidKey(child, knownKeys, returnFiber);
|
|
11493
11493
|
}
|
|
11494
11494
|
}
|
|
11495
11495
|
}
|
|
@@ -11579,8 +11579,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11579
11579
|
}
|
|
11580
11580
|
}
|
|
11581
11581
|
if (shouldTrackSideEffects) {
|
|
11582
|
-
existingChildren.forEach(function(
|
|
11583
|
-
return deleteChild(returnFiber,
|
|
11582
|
+
existingChildren.forEach(function(child2) {
|
|
11583
|
+
return deleteChild(returnFiber, child2);
|
|
11584
11584
|
});
|
|
11585
11585
|
}
|
|
11586
11586
|
if (getIsHydrating()) {
|
|
@@ -11603,14 +11603,14 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11603
11603
|
}
|
|
11604
11604
|
function reconcileSingleElement(returnFiber, currentFirstChild, element, lanes) {
|
|
11605
11605
|
var key = element.key;
|
|
11606
|
-
var
|
|
11607
|
-
while (
|
|
11608
|
-
if (
|
|
11606
|
+
var child = currentFirstChild;
|
|
11607
|
+
while (child !== null) {
|
|
11608
|
+
if (child.key === key) {
|
|
11609
11609
|
var elementType = element.type;
|
|
11610
11610
|
if (elementType === REACT_FRAGMENT_TYPE) {
|
|
11611
|
-
if (
|
|
11612
|
-
deleteRemainingChildren(returnFiber,
|
|
11613
|
-
var existing = useFiber(
|
|
11611
|
+
if (child.tag === Fragment) {
|
|
11612
|
+
deleteRemainingChildren(returnFiber, child.sibling);
|
|
11613
|
+
var existing = useFiber(child, element.props.children);
|
|
11614
11614
|
existing.return = returnFiber;
|
|
11615
11615
|
{
|
|
11616
11616
|
existing._debugSource = element._source;
|
|
@@ -11619,15 +11619,15 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11619
11619
|
return existing;
|
|
11620
11620
|
}
|
|
11621
11621
|
} else {
|
|
11622
|
-
if (
|
|
11623
|
-
isCompatibleFamilyForHotReloading(
|
|
11622
|
+
if (child.elementType === elementType || // Keep this check inline so it only runs on the false path:
|
|
11623
|
+
isCompatibleFamilyForHotReloading(child, element) || // Lazy types should reconcile their resolved type.
|
|
11624
11624
|
// We need to do this after the Hot Reloading check above,
|
|
11625
11625
|
// because hot reloading has different semantics than prod because
|
|
11626
11626
|
// it doesn't resuspend. So we can't let the call below suspend.
|
|
11627
|
-
typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) ===
|
|
11628
|
-
deleteRemainingChildren(returnFiber,
|
|
11629
|
-
var _existing = useFiber(
|
|
11630
|
-
_existing.ref = coerceRef(returnFiber,
|
|
11627
|
+
typeof elementType === "object" && elementType !== null && elementType.$$typeof === REACT_LAZY_TYPE && resolveLazy(elementType) === child.type) {
|
|
11628
|
+
deleteRemainingChildren(returnFiber, child.sibling);
|
|
11629
|
+
var _existing = useFiber(child, element.props);
|
|
11630
|
+
_existing.ref = coerceRef(returnFiber, child, element);
|
|
11631
11631
|
_existing.return = returnFiber;
|
|
11632
11632
|
{
|
|
11633
11633
|
_existing._debugSource = element._source;
|
|
@@ -11636,12 +11636,12 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11636
11636
|
return _existing;
|
|
11637
11637
|
}
|
|
11638
11638
|
}
|
|
11639
|
-
deleteRemainingChildren(returnFiber,
|
|
11639
|
+
deleteRemainingChildren(returnFiber, child);
|
|
11640
11640
|
break;
|
|
11641
11641
|
} else {
|
|
11642
|
-
deleteChild(returnFiber,
|
|
11642
|
+
deleteChild(returnFiber, child);
|
|
11643
11643
|
}
|
|
11644
|
-
|
|
11644
|
+
child = child.sibling;
|
|
11645
11645
|
}
|
|
11646
11646
|
if (element.type === REACT_FRAGMENT_TYPE) {
|
|
11647
11647
|
var created = createFiberFromFragment(element.props.children, returnFiber.mode, lanes, element.key);
|
|
@@ -11656,22 +11656,22 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11656
11656
|
}
|
|
11657
11657
|
function reconcileSinglePortal(returnFiber, currentFirstChild, portal, lanes) {
|
|
11658
11658
|
var key = portal.key;
|
|
11659
|
-
var
|
|
11660
|
-
while (
|
|
11661
|
-
if (
|
|
11662
|
-
if (
|
|
11663
|
-
deleteRemainingChildren(returnFiber,
|
|
11664
|
-
var existing = useFiber(
|
|
11659
|
+
var child = currentFirstChild;
|
|
11660
|
+
while (child !== null) {
|
|
11661
|
+
if (child.key === key) {
|
|
11662
|
+
if (child.tag === HostPortal && child.stateNode.containerInfo === portal.containerInfo && child.stateNode.implementation === portal.implementation) {
|
|
11663
|
+
deleteRemainingChildren(returnFiber, child.sibling);
|
|
11664
|
+
var existing = useFiber(child, portal.children || []);
|
|
11665
11665
|
existing.return = returnFiber;
|
|
11666
11666
|
return existing;
|
|
11667
11667
|
} else {
|
|
11668
|
-
deleteRemainingChildren(returnFiber,
|
|
11668
|
+
deleteRemainingChildren(returnFiber, child);
|
|
11669
11669
|
break;
|
|
11670
11670
|
}
|
|
11671
11671
|
} else {
|
|
11672
|
-
deleteChild(returnFiber,
|
|
11672
|
+
deleteChild(returnFiber, child);
|
|
11673
11673
|
}
|
|
11674
|
-
|
|
11674
|
+
child = child.sibling;
|
|
11675
11675
|
}
|
|
11676
11676
|
var created = createFiberFromPortal(portal, returnFiber.mode, lanes);
|
|
11677
11677
|
created.return = returnFiber;
|
|
@@ -11734,10 +11734,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
11734
11734
|
newChild.sibling = null;
|
|
11735
11735
|
}
|
|
11736
11736
|
function resetChildFibers(workInProgress2, lanes) {
|
|
11737
|
-
var
|
|
11738
|
-
while (
|
|
11739
|
-
resetWorkInProgress(
|
|
11740
|
-
|
|
11737
|
+
var child = workInProgress2.child;
|
|
11738
|
+
while (child !== null) {
|
|
11739
|
+
resetWorkInProgress(child, lanes);
|
|
11740
|
+
child = child.sibling;
|
|
11741
11741
|
}
|
|
11742
11742
|
}
|
|
11743
11743
|
var valueCursor = createCursor(null);
|
|
@@ -14512,10 +14512,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
14512
14512
|
passiveEffectStartTime = now$1();
|
|
14513
14513
|
}
|
|
14514
14514
|
function transferActualDuration(fiber) {
|
|
14515
|
-
var
|
|
14516
|
-
while (
|
|
14517
|
-
fiber.actualDuration +=
|
|
14518
|
-
|
|
14515
|
+
var child = fiber.child;
|
|
14516
|
+
while (child) {
|
|
14517
|
+
fiber.actualDuration += child.actualDuration;
|
|
14518
|
+
child = child.sibling;
|
|
14519
14519
|
}
|
|
14520
14520
|
}
|
|
14521
14521
|
function resolveDefaultProps(Component, baseProps) {
|
|
@@ -15538,11 +15538,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
15538
15538
|
}
|
|
15539
15539
|
}
|
|
15540
15540
|
}
|
|
15541
|
-
var
|
|
15542
|
-
|
|
15543
|
-
|
|
15544
|
-
workInProgress2.child =
|
|
15545
|
-
return
|
|
15541
|
+
var child = createFiberFromTypeAndProps(Component.type, null, nextProps, workInProgress2, workInProgress2.mode, renderLanes2);
|
|
15542
|
+
child.ref = workInProgress2.ref;
|
|
15543
|
+
child.return = workInProgress2;
|
|
15544
|
+
workInProgress2.child = child;
|
|
15545
|
+
return child;
|
|
15546
15546
|
}
|
|
15547
15547
|
{
|
|
15548
15548
|
var _type = Component.type;
|
|
@@ -15918,9 +15918,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
15918
15918
|
return mountHostRootWithoutHydrating(current2, workInProgress2, nextChildren, renderLanes2, _recoverableError);
|
|
15919
15919
|
} else {
|
|
15920
15920
|
enterHydrationState(workInProgress2);
|
|
15921
|
-
var
|
|
15922
|
-
workInProgress2.child =
|
|
15923
|
-
var node =
|
|
15921
|
+
var child = mountChildFibers(workInProgress2, null, nextChildren, renderLanes2);
|
|
15922
|
+
workInProgress2.child = child;
|
|
15923
|
+
var node = child;
|
|
15924
15924
|
while (node) {
|
|
15925
15925
|
node.flags = node.flags & ~Placement | Hydrating;
|
|
15926
15926
|
node = node.sibling;
|
|
@@ -15977,29 +15977,29 @@ var require_react_reconciler_development = __commonJS({
|
|
|
15977
15977
|
workInProgress2.type = Component;
|
|
15978
15978
|
var resolvedTag = workInProgress2.tag = resolveLazyComponentTag(Component);
|
|
15979
15979
|
var resolvedProps = resolveDefaultProps(Component, props);
|
|
15980
|
-
var
|
|
15980
|
+
var child;
|
|
15981
15981
|
switch (resolvedTag) {
|
|
15982
15982
|
case FunctionComponent: {
|
|
15983
15983
|
{
|
|
15984
15984
|
validateFunctionComponentInDev(workInProgress2, Component);
|
|
15985
15985
|
workInProgress2.type = Component = resolveFunctionForHotReloading(Component);
|
|
15986
15986
|
}
|
|
15987
|
-
|
|
15988
|
-
return
|
|
15987
|
+
child = updateFunctionComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
15988
|
+
return child;
|
|
15989
15989
|
}
|
|
15990
15990
|
case ClassComponent: {
|
|
15991
15991
|
{
|
|
15992
15992
|
workInProgress2.type = Component = resolveClassForHotReloading(Component);
|
|
15993
15993
|
}
|
|
15994
|
-
|
|
15995
|
-
return
|
|
15994
|
+
child = updateClassComponent(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
15995
|
+
return child;
|
|
15996
15996
|
}
|
|
15997
15997
|
case ForwardRef: {
|
|
15998
15998
|
{
|
|
15999
15999
|
workInProgress2.type = Component = resolveForwardRefForHotReloading(Component);
|
|
16000
16000
|
}
|
|
16001
|
-
|
|
16002
|
-
return
|
|
16001
|
+
child = updateForwardRef(null, workInProgress2, Component, resolvedProps, renderLanes2);
|
|
16002
|
+
return child;
|
|
16003
16003
|
}
|
|
16004
16004
|
case MemoComponent: {
|
|
16005
16005
|
{
|
|
@@ -16016,7 +16016,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
16016
16016
|
}
|
|
16017
16017
|
}
|
|
16018
16018
|
}
|
|
16019
|
-
|
|
16019
|
+
child = updateMemoComponent(
|
|
16020
16020
|
null,
|
|
16021
16021
|
workInProgress2,
|
|
16022
16022
|
Component,
|
|
@@ -16024,7 +16024,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
16024
16024
|
// The inner type can have defaults too
|
|
16025
16025
|
renderLanes2
|
|
16026
16026
|
);
|
|
16027
|
-
return
|
|
16027
|
+
return child;
|
|
16028
16028
|
}
|
|
16029
16029
|
}
|
|
16030
16030
|
var hint = "";
|
|
@@ -16986,9 +16986,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
16986
16986
|
return updateSuspenseComponent(current2, workInProgress2, renderLanes2);
|
|
16987
16987
|
} else {
|
|
16988
16988
|
pushSuspenseContext(workInProgress2, setDefaultShallowSuspenseContext(suspenseStackCursor.current));
|
|
16989
|
-
var
|
|
16990
|
-
if (
|
|
16991
|
-
return
|
|
16989
|
+
var child = bailoutOnAlreadyFinishedWork(current2, workInProgress2, renderLanes2);
|
|
16990
|
+
if (child !== null) {
|
|
16991
|
+
return child.sibling;
|
|
16992
16992
|
} else {
|
|
16993
16993
|
return null;
|
|
16994
16994
|
}
|
|
@@ -17168,12 +17168,12 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17168
17168
|
if ((completedWork.flags & ChildDeletion) !== NoFlags) {
|
|
17169
17169
|
return false;
|
|
17170
17170
|
}
|
|
17171
|
-
var
|
|
17172
|
-
while (
|
|
17173
|
-
if ((
|
|
17171
|
+
var child = completedWork.child;
|
|
17172
|
+
while (child !== null) {
|
|
17173
|
+
if ((child.flags & MutationMask) !== NoFlags || (child.subtreeFlags & MutationMask) !== NoFlags) {
|
|
17174
17174
|
return false;
|
|
17175
17175
|
}
|
|
17176
|
-
|
|
17176
|
+
child = child.sibling;
|
|
17177
17177
|
}
|
|
17178
17178
|
return true;
|
|
17179
17179
|
}
|
|
@@ -17247,9 +17247,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17247
17247
|
appendInitialChild(parent, _instance);
|
|
17248
17248
|
} else if (node.tag === HostPortal) ;
|
|
17249
17249
|
else if (node.tag === OffscreenComponent && node.memoizedState !== null) {
|
|
17250
|
-
var
|
|
17251
|
-
if (
|
|
17252
|
-
|
|
17250
|
+
var child = node.child;
|
|
17251
|
+
if (child !== null) {
|
|
17252
|
+
child.return = node;
|
|
17253
17253
|
}
|
|
17254
17254
|
appendAllChildren(parent, node, true, true);
|
|
17255
17255
|
} else if (node.child !== null) {
|
|
@@ -17291,9 +17291,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17291
17291
|
appendChildToContainerChildSet(containerChildSet, _instance2);
|
|
17292
17292
|
} else if (node.tag === HostPortal) ;
|
|
17293
17293
|
else if (node.tag === OffscreenComponent && node.memoizedState !== null) {
|
|
17294
|
-
var
|
|
17295
|
-
if (
|
|
17296
|
-
|
|
17294
|
+
var child = node.child;
|
|
17295
|
+
if (child !== null) {
|
|
17296
|
+
child.return = node;
|
|
17297
17297
|
}
|
|
17298
17298
|
appendAllChildrenToContainer(containerChildSet, node, true, true);
|
|
17299
17299
|
} else if (node.child !== null) {
|
|
@@ -17426,14 +17426,14 @@ var require_react_reconciler_development = __commonJS({
|
|
|
17426
17426
|
if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
17427
17427
|
var actualDuration = completedWork.actualDuration;
|
|
17428
17428
|
var treeBaseDuration = completedWork.selfBaseDuration;
|
|
17429
|
-
var
|
|
17430
|
-
while (
|
|
17431
|
-
newChildLanes = mergeLanes(newChildLanes, mergeLanes(
|
|
17432
|
-
subtreeFlags |=
|
|
17433
|
-
subtreeFlags |=
|
|
17434
|
-
actualDuration +=
|
|
17435
|
-
treeBaseDuration +=
|
|
17436
|
-
|
|
17429
|
+
var child = completedWork.child;
|
|
17430
|
+
while (child !== null) {
|
|
17431
|
+
newChildLanes = mergeLanes(newChildLanes, mergeLanes(child.lanes, child.childLanes));
|
|
17432
|
+
subtreeFlags |= child.subtreeFlags;
|
|
17433
|
+
subtreeFlags |= child.flags;
|
|
17434
|
+
actualDuration += child.actualDuration;
|
|
17435
|
+
treeBaseDuration += child.treeBaseDuration;
|
|
17436
|
+
child = child.sibling;
|
|
17437
17437
|
}
|
|
17438
17438
|
completedWork.actualDuration = actualDuration;
|
|
17439
17439
|
completedWork.treeBaseDuration = treeBaseDuration;
|
|
@@ -18186,10 +18186,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
18186
18186
|
function commitBeforeMutationEffects_begin() {
|
|
18187
18187
|
while (nextEffect !== null) {
|
|
18188
18188
|
var fiber = nextEffect;
|
|
18189
|
-
var
|
|
18190
|
-
if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags &&
|
|
18191
|
-
|
|
18192
|
-
nextEffect =
|
|
18189
|
+
var child = fiber.child;
|
|
18190
|
+
if ((fiber.subtreeFlags & BeforeMutationMask) !== NoFlags && child !== null) {
|
|
18191
|
+
child.return = fiber;
|
|
18192
|
+
nextEffect = child;
|
|
18193
18193
|
} else {
|
|
18194
18194
|
commitBeforeMutationEffects_complete();
|
|
18195
18195
|
}
|
|
@@ -18847,10 +18847,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
18847
18847
|
}
|
|
18848
18848
|
} else if (tag2 === HostPortal) ;
|
|
18849
18849
|
else {
|
|
18850
|
-
var
|
|
18851
|
-
if (
|
|
18852
|
-
insertOrAppendPlacementNodeIntoContainer(
|
|
18853
|
-
var sibling =
|
|
18850
|
+
var child = node.child;
|
|
18851
|
+
if (child !== null) {
|
|
18852
|
+
insertOrAppendPlacementNodeIntoContainer(child, before, parent);
|
|
18853
|
+
var sibling = child.sibling;
|
|
18854
18854
|
while (sibling !== null) {
|
|
18855
18855
|
insertOrAppendPlacementNodeIntoContainer(sibling, before, parent);
|
|
18856
18856
|
sibling = sibling.sibling;
|
|
@@ -18870,10 +18870,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
18870
18870
|
}
|
|
18871
18871
|
} else if (tag2 === HostPortal) ;
|
|
18872
18872
|
else {
|
|
18873
|
-
var
|
|
18874
|
-
if (
|
|
18875
|
-
insertOrAppendPlacementNode(
|
|
18876
|
-
var sibling =
|
|
18873
|
+
var child = node.child;
|
|
18874
|
+
if (child !== null) {
|
|
18875
|
+
insertOrAppendPlacementNode(child, before, parent);
|
|
18876
|
+
var sibling = child.sibling;
|
|
18877
18877
|
while (sibling !== null) {
|
|
18878
18878
|
insertOrAppendPlacementNode(sibling, before, parent);
|
|
18879
18879
|
sibling = sibling.sibling;
|
|
@@ -18918,10 +18918,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
18918
18918
|
detachFiberMutation(deletedFiber);
|
|
18919
18919
|
}
|
|
18920
18920
|
function recursivelyTraverseDeletionEffects(finishedRoot, nearestMountedAncestor, parent) {
|
|
18921
|
-
var
|
|
18922
|
-
while (
|
|
18923
|
-
commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor,
|
|
18924
|
-
|
|
18921
|
+
var child = parent.child;
|
|
18922
|
+
while (child !== null) {
|
|
18923
|
+
commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, child);
|
|
18924
|
+
child = child.sibling;
|
|
18925
18925
|
}
|
|
18926
18926
|
}
|
|
18927
18927
|
function commitDeletionEffectsOnFiber(finishedRoot, nearestMountedAncestor, deletedFiber) {
|
|
@@ -19125,11 +19125,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19125
19125
|
}
|
|
19126
19126
|
var prevDebugFiber = getCurrentFiber();
|
|
19127
19127
|
if (parentFiber.subtreeFlags & MutationMask) {
|
|
19128
|
-
var
|
|
19129
|
-
while (
|
|
19130
|
-
setCurrentFiber(
|
|
19131
|
-
commitMutationEffectsOnFiber(
|
|
19132
|
-
|
|
19128
|
+
var child = parentFiber.child;
|
|
19129
|
+
while (child !== null) {
|
|
19130
|
+
setCurrentFiber(child);
|
|
19131
|
+
commitMutationEffectsOnFiber(child, root);
|
|
19132
|
+
child = child.sibling;
|
|
19133
19133
|
}
|
|
19134
19134
|
}
|
|
19135
19135
|
setCurrentFiber(prevDebugFiber);
|
|
@@ -19411,16 +19411,16 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19411
19411
|
nextEffect = fiber;
|
|
19412
19412
|
reappearLayoutEffects_begin(fiber);
|
|
19413
19413
|
}
|
|
19414
|
-
var
|
|
19415
|
-
while (
|
|
19416
|
-
nextEffect =
|
|
19414
|
+
var child = firstChild;
|
|
19415
|
+
while (child !== null) {
|
|
19416
|
+
nextEffect = child;
|
|
19417
19417
|
commitLayoutEffects_begin(
|
|
19418
|
-
|
|
19418
|
+
child,
|
|
19419
19419
|
// New root; bubble back up to here and stop.
|
|
19420
19420
|
root,
|
|
19421
19421
|
committedLanes
|
|
19422
19422
|
);
|
|
19423
|
-
|
|
19423
|
+
child = child.sibling;
|
|
19424
19424
|
}
|
|
19425
19425
|
nextEffect = fiber;
|
|
19426
19426
|
offscreenSubtreeIsHidden = prevOffscreenSubtreeIsHidden;
|
|
@@ -19638,7 +19638,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19638
19638
|
function commitPassiveUnmountEffects_begin() {
|
|
19639
19639
|
while (nextEffect !== null) {
|
|
19640
19640
|
var fiber = nextEffect;
|
|
19641
|
-
var
|
|
19641
|
+
var child = fiber.child;
|
|
19642
19642
|
if ((nextEffect.flags & ChildDeletion) !== NoFlags) {
|
|
19643
19643
|
var deletions = fiber.deletions;
|
|
19644
19644
|
if (deletions !== null) {
|
|
@@ -19664,9 +19664,9 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19664
19664
|
nextEffect = fiber;
|
|
19665
19665
|
}
|
|
19666
19666
|
}
|
|
19667
|
-
if ((fiber.subtreeFlags & PassiveMask) !== NoFlags &&
|
|
19668
|
-
|
|
19669
|
-
nextEffect =
|
|
19667
|
+
if ((fiber.subtreeFlags & PassiveMask) !== NoFlags && child !== null) {
|
|
19668
|
+
child.return = fiber;
|
|
19669
|
+
nextEffect = child;
|
|
19670
19670
|
} else {
|
|
19671
19671
|
commitPassiveUnmountEffects_complete();
|
|
19672
19672
|
}
|
|
@@ -19711,10 +19711,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19711
19711
|
setCurrentFiber(fiber);
|
|
19712
19712
|
commitPassiveUnmountInsideDeletedTreeOnFiber(fiber, nearestMountedAncestor);
|
|
19713
19713
|
resetCurrentFiber();
|
|
19714
|
-
var
|
|
19715
|
-
if (
|
|
19716
|
-
|
|
19717
|
-
nextEffect =
|
|
19714
|
+
var child = fiber.child;
|
|
19715
|
+
if (child !== null) {
|
|
19716
|
+
child.return = fiber;
|
|
19717
|
+
nextEffect = child;
|
|
19718
19718
|
} else {
|
|
19719
19719
|
commitPassiveUnmountEffectsInsideOfDeletedTree_complete(deletedSubtreeRoot);
|
|
19720
19720
|
}
|
|
@@ -19967,10 +19967,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19967
19967
|
if (selectorIndex === selectors.length) {
|
|
19968
19968
|
matchingFibers.push(fiber);
|
|
19969
19969
|
} else {
|
|
19970
|
-
var
|
|
19971
|
-
while (
|
|
19972
|
-
stack.push(
|
|
19973
|
-
|
|
19970
|
+
var child = fiber.child;
|
|
19971
|
+
while (child !== null) {
|
|
19972
|
+
stack.push(child, selectorIndex);
|
|
19973
|
+
child = child.sibling;
|
|
19974
19974
|
}
|
|
19975
19975
|
}
|
|
19976
19976
|
}
|
|
@@ -19994,10 +19994,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
19994
19994
|
if (selectorIndex === selectors.length) {
|
|
19995
19995
|
return true;
|
|
19996
19996
|
} else {
|
|
19997
|
-
var
|
|
19998
|
-
while (
|
|
19999
|
-
stack.push(
|
|
20000
|
-
|
|
19997
|
+
var child = fiber.child;
|
|
19998
|
+
while (child !== null) {
|
|
19999
|
+
stack.push(child, selectorIndex);
|
|
20000
|
+
child = child.sibling;
|
|
20001
20001
|
}
|
|
20002
20002
|
}
|
|
20003
20003
|
}
|
|
@@ -20020,10 +20020,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
20020
20020
|
}
|
|
20021
20021
|
instanceRoots.push(node.stateNode);
|
|
20022
20022
|
} else {
|
|
20023
|
-
var
|
|
20024
|
-
while (
|
|
20025
|
-
stack.push(
|
|
20026
|
-
|
|
20023
|
+
var child = node.child;
|
|
20024
|
+
while (child !== null) {
|
|
20025
|
+
stack.push(child);
|
|
20026
|
+
child = child.sibling;
|
|
20027
20027
|
}
|
|
20028
20028
|
}
|
|
20029
20029
|
}
|
|
@@ -20052,10 +20052,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
20052
20052
|
}
|
|
20053
20053
|
}
|
|
20054
20054
|
if (selectorIndex < selectors.length) {
|
|
20055
|
-
var
|
|
20056
|
-
while (
|
|
20057
|
-
stack.push(
|
|
20058
|
-
|
|
20055
|
+
var child = fiber.child;
|
|
20056
|
+
while (child !== null) {
|
|
20057
|
+
stack.push(child, selectorIndex);
|
|
20058
|
+
child = child.sibling;
|
|
20059
20059
|
}
|
|
20060
20060
|
}
|
|
20061
20061
|
}
|
|
@@ -20138,10 +20138,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
20138
20138
|
return true;
|
|
20139
20139
|
}
|
|
20140
20140
|
}
|
|
20141
|
-
var
|
|
20142
|
-
while (
|
|
20143
|
-
stack.push(
|
|
20144
|
-
|
|
20141
|
+
var child = fiber.child;
|
|
20142
|
+
while (child !== null) {
|
|
20143
|
+
stack.push(child);
|
|
20144
|
+
child = child.sibling;
|
|
20145
20145
|
}
|
|
20146
20146
|
}
|
|
20147
20147
|
return false;
|
|
@@ -20633,10 +20633,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
20633
20633
|
}
|
|
20634
20634
|
}
|
|
20635
20635
|
}
|
|
20636
|
-
var
|
|
20637
|
-
if (node.subtreeFlags & StoreConsistency &&
|
|
20638
|
-
|
|
20639
|
-
node =
|
|
20636
|
+
var child = node.child;
|
|
20637
|
+
if (node.subtreeFlags & StoreConsistency && child !== null) {
|
|
20638
|
+
child.return = node;
|
|
20639
|
+
node = child;
|
|
20640
20640
|
continue;
|
|
20641
20641
|
}
|
|
20642
20642
|
if (node === finishedWork) {
|
|
@@ -21070,10 +21070,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
21070
21070
|
if ((completedWork.mode & ProfileMode) !== NoMode) {
|
|
21071
21071
|
stopProfilerTimerIfRunningAndRecordDelta(completedWork, false);
|
|
21072
21072
|
var actualDuration = completedWork.actualDuration;
|
|
21073
|
-
var
|
|
21074
|
-
while (
|
|
21075
|
-
actualDuration +=
|
|
21076
|
-
|
|
21073
|
+
var child = completedWork.child;
|
|
21074
|
+
while (child !== null) {
|
|
21075
|
+
actualDuration += child.actualDuration;
|
|
21076
|
+
child = child.sibling;
|
|
21077
21077
|
}
|
|
21078
21078
|
completedWork.actualDuration = actualDuration;
|
|
21079
21079
|
}
|
|
@@ -21850,7 +21850,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
21850
21850
|
};
|
|
21851
21851
|
function scheduleFibersWithFamiliesRecursively(fiber, updatedFamilies, staleFamilies) {
|
|
21852
21852
|
{
|
|
21853
|
-
var alternate = fiber.alternate,
|
|
21853
|
+
var alternate = fiber.alternate, child = fiber.child, sibling = fiber.sibling, tag2 = fiber.tag, type = fiber.type;
|
|
21854
21854
|
var candidateType = null;
|
|
21855
21855
|
switch (tag2) {
|
|
21856
21856
|
case FunctionComponent:
|
|
@@ -21895,8 +21895,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
21895
21895
|
scheduleUpdateOnFiber(_root, fiber, SyncLane, NoTimestamp);
|
|
21896
21896
|
}
|
|
21897
21897
|
}
|
|
21898
|
-
if (
|
|
21899
|
-
scheduleFibersWithFamiliesRecursively(
|
|
21898
|
+
if (child !== null && !needsRemount) {
|
|
21899
|
+
scheduleFibersWithFamiliesRecursively(child, updatedFamilies, staleFamilies);
|
|
21900
21900
|
}
|
|
21901
21901
|
if (sibling !== null) {
|
|
21902
21902
|
scheduleFibersWithFamiliesRecursively(sibling, updatedFamilies, staleFamilies);
|
|
@@ -21915,7 +21915,7 @@ var require_react_reconciler_development = __commonJS({
|
|
|
21915
21915
|
};
|
|
21916
21916
|
function findHostInstancesForMatchingFibersRecursively(fiber, types, hostInstances) {
|
|
21917
21917
|
{
|
|
21918
|
-
var
|
|
21918
|
+
var child = fiber.child, sibling = fiber.sibling, tag2 = fiber.tag, type = fiber.type;
|
|
21919
21919
|
var candidateType = null;
|
|
21920
21920
|
switch (tag2) {
|
|
21921
21921
|
case FunctionComponent:
|
|
@@ -21936,8 +21936,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
21936
21936
|
if (didMatch) {
|
|
21937
21937
|
findHostInstancesForFiberShallowly(fiber, hostInstances);
|
|
21938
21938
|
} else {
|
|
21939
|
-
if (
|
|
21940
|
-
findHostInstancesForMatchingFibersRecursively(
|
|
21939
|
+
if (child !== null) {
|
|
21940
|
+
findHostInstancesForMatchingFibersRecursively(child, types, hostInstances);
|
|
21941
21941
|
}
|
|
21942
21942
|
}
|
|
21943
21943
|
if (sibling !== null) {
|
|
@@ -22744,10 +22744,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22744
22744
|
var setErrorHandler = null;
|
|
22745
22745
|
var setSuspenseHandler = null;
|
|
22746
22746
|
{
|
|
22747
|
-
var copyWithDeleteImpl = function(obj,
|
|
22748
|
-
var key =
|
|
22747
|
+
var copyWithDeleteImpl = function(obj, path4, index2) {
|
|
22748
|
+
var key = path4[index2];
|
|
22749
22749
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
22750
|
-
if (index2 + 1 ===
|
|
22750
|
+
if (index2 + 1 === path4.length) {
|
|
22751
22751
|
if (isArray(updated)) {
|
|
22752
22752
|
updated.splice(key, 1);
|
|
22753
22753
|
} else {
|
|
@@ -22755,11 +22755,11 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22755
22755
|
}
|
|
22756
22756
|
return updated;
|
|
22757
22757
|
}
|
|
22758
|
-
updated[key] = copyWithDeleteImpl(obj[key],
|
|
22758
|
+
updated[key] = copyWithDeleteImpl(obj[key], path4, index2 + 1);
|
|
22759
22759
|
return updated;
|
|
22760
22760
|
};
|
|
22761
|
-
var copyWithDelete = function(obj,
|
|
22762
|
-
return copyWithDeleteImpl(obj,
|
|
22761
|
+
var copyWithDelete = function(obj, path4) {
|
|
22762
|
+
return copyWithDeleteImpl(obj, path4, 0);
|
|
22763
22763
|
};
|
|
22764
22764
|
var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
|
|
22765
22765
|
var oldKey = oldPath[index2];
|
|
@@ -22797,17 +22797,17 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22797
22797
|
}
|
|
22798
22798
|
return copyWithRenameImpl(obj, oldPath, newPath, 0);
|
|
22799
22799
|
};
|
|
22800
|
-
var copyWithSetImpl = function(obj,
|
|
22801
|
-
if (index2 >=
|
|
22800
|
+
var copyWithSetImpl = function(obj, path4, index2, value) {
|
|
22801
|
+
if (index2 >= path4.length) {
|
|
22802
22802
|
return value;
|
|
22803
22803
|
}
|
|
22804
|
-
var key =
|
|
22804
|
+
var key = path4[index2];
|
|
22805
22805
|
var updated = isArray(obj) ? obj.slice() : assign({}, obj);
|
|
22806
|
-
updated[key] = copyWithSetImpl(obj[key],
|
|
22806
|
+
updated[key] = copyWithSetImpl(obj[key], path4, index2 + 1, value);
|
|
22807
22807
|
return updated;
|
|
22808
22808
|
};
|
|
22809
|
-
var copyWithSet = function(obj,
|
|
22810
|
-
return copyWithSetImpl(obj,
|
|
22809
|
+
var copyWithSet = function(obj, path4, value) {
|
|
22810
|
+
return copyWithSetImpl(obj, path4, 0, value);
|
|
22811
22811
|
};
|
|
22812
22812
|
var findHook = function(fiber, id) {
|
|
22813
22813
|
var currentHook2 = fiber.memoizedState;
|
|
@@ -22817,10 +22817,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22817
22817
|
}
|
|
22818
22818
|
return currentHook2;
|
|
22819
22819
|
};
|
|
22820
|
-
overrideHookState = function(fiber, id,
|
|
22820
|
+
overrideHookState = function(fiber, id, path4, value) {
|
|
22821
22821
|
var hook = findHook(fiber, id);
|
|
22822
22822
|
if (hook !== null) {
|
|
22823
|
-
var newState = copyWithSet(hook.memoizedState,
|
|
22823
|
+
var newState = copyWithSet(hook.memoizedState, path4, value);
|
|
22824
22824
|
hook.memoizedState = newState;
|
|
22825
22825
|
hook.baseState = newState;
|
|
22826
22826
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
@@ -22830,10 +22830,10 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22830
22830
|
}
|
|
22831
22831
|
}
|
|
22832
22832
|
};
|
|
22833
|
-
overrideHookStateDeletePath = function(fiber, id,
|
|
22833
|
+
overrideHookStateDeletePath = function(fiber, id, path4) {
|
|
22834
22834
|
var hook = findHook(fiber, id);
|
|
22835
22835
|
if (hook !== null) {
|
|
22836
|
-
var newState = copyWithDelete(hook.memoizedState,
|
|
22836
|
+
var newState = copyWithDelete(hook.memoizedState, path4);
|
|
22837
22837
|
hook.memoizedState = newState;
|
|
22838
22838
|
hook.baseState = newState;
|
|
22839
22839
|
fiber.memoizedProps = assign({}, fiber.memoizedProps);
|
|
@@ -22856,8 +22856,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22856
22856
|
}
|
|
22857
22857
|
}
|
|
22858
22858
|
};
|
|
22859
|
-
overrideProps = function(fiber,
|
|
22860
|
-
fiber.pendingProps = copyWithSet(fiber.memoizedProps,
|
|
22859
|
+
overrideProps = function(fiber, path4, value) {
|
|
22860
|
+
fiber.pendingProps = copyWithSet(fiber.memoizedProps, path4, value);
|
|
22861
22861
|
if (fiber.alternate) {
|
|
22862
22862
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
22863
22863
|
}
|
|
@@ -22866,8 +22866,8 @@ var require_react_reconciler_development = __commonJS({
|
|
|
22866
22866
|
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
|
|
22867
22867
|
}
|
|
22868
22868
|
};
|
|
22869
|
-
overridePropsDeletePath = function(fiber,
|
|
22870
|
-
fiber.pendingProps = copyWithDelete(fiber.memoizedProps,
|
|
22869
|
+
overridePropsDeletePath = function(fiber, path4) {
|
|
22870
|
+
fiber.pendingProps = copyWithDelete(fiber.memoizedProps, path4);
|
|
22871
22871
|
if (fiber.alternate) {
|
|
22872
22872
|
fiber.alternate.pendingProps = fiber.pendingProps;
|
|
22873
22873
|
}
|
|
@@ -29446,7 +29446,7 @@ var require_has_flag = __commonJS({
|
|
|
29446
29446
|
var require_supports_colors = __commonJS({
|
|
29447
29447
|
"node_modules/@colors/colors/lib/system/supports-colors.js"(exports, module) {
|
|
29448
29448
|
"use strict";
|
|
29449
|
-
var
|
|
29449
|
+
var os5 = __require("os");
|
|
29450
29450
|
var hasFlag2 = require_has_flag();
|
|
29451
29451
|
var env3 = process.env;
|
|
29452
29452
|
var forceColor = void 0;
|
|
@@ -29484,7 +29484,7 @@ var require_supports_colors = __commonJS({
|
|
|
29484
29484
|
}
|
|
29485
29485
|
var min = forceColor ? 1 : 0;
|
|
29486
29486
|
if (process.platform === "win32") {
|
|
29487
|
-
var osRelease =
|
|
29487
|
+
var osRelease = os5.release().split(".");
|
|
29488
29488
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
29489
29489
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
29490
29490
|
}
|
|
@@ -30897,7 +30897,7 @@ var require_core = __commonJS({
|
|
|
30897
30897
|
builder.addText(node);
|
|
30898
30898
|
} else if (node.children) {
|
|
30899
30899
|
builder.openNode(node);
|
|
30900
|
-
node.children.forEach((
|
|
30900
|
+
node.children.forEach((child) => this._walk(builder, child));
|
|
30901
30901
|
builder.closeNode(node);
|
|
30902
30902
|
}
|
|
30903
30903
|
return builder;
|
|
@@ -30911,8 +30911,8 @@ var require_core = __commonJS({
|
|
|
30911
30911
|
if (node.children.every((el) => typeof el === "string")) {
|
|
30912
30912
|
node.children = [node.children.join("")];
|
|
30913
30913
|
} else {
|
|
30914
|
-
node.children.forEach((
|
|
30915
|
-
_TokenTree._collapse(
|
|
30914
|
+
node.children.forEach((child) => {
|
|
30915
|
+
_TokenTree._collapse(child);
|
|
30916
30916
|
});
|
|
30917
30917
|
}
|
|
30918
30918
|
}
|
|
@@ -31542,21 +31542,21 @@ var require_core = __commonJS({
|
|
|
31542
31542
|
function nodeStream(node) {
|
|
31543
31543
|
const result = [];
|
|
31544
31544
|
(function _nodeStream(node2, offset) {
|
|
31545
|
-
for (let
|
|
31546
|
-
if (
|
|
31547
|
-
offset +=
|
|
31548
|
-
} else if (
|
|
31545
|
+
for (let child = node2.firstChild; child; child = child.nextSibling) {
|
|
31546
|
+
if (child.nodeType === 3) {
|
|
31547
|
+
offset += child.nodeValue.length;
|
|
31548
|
+
} else if (child.nodeType === 1) {
|
|
31549
31549
|
result.push({
|
|
31550
31550
|
event: "start",
|
|
31551
31551
|
offset,
|
|
31552
|
-
node:
|
|
31552
|
+
node: child
|
|
31553
31553
|
});
|
|
31554
|
-
offset = _nodeStream(
|
|
31555
|
-
if (!tag2(
|
|
31554
|
+
offset = _nodeStream(child, offset);
|
|
31555
|
+
if (!tag2(child).match(/br|hr|img|input/)) {
|
|
31556
31556
|
result.push({
|
|
31557
31557
|
event: "stop",
|
|
31558
31558
|
offset,
|
|
31559
|
-
node:
|
|
31559
|
+
node: child
|
|
31560
31560
|
});
|
|
31561
31561
|
}
|
|
31562
31562
|
}
|
|
@@ -70141,9 +70141,9 @@ var require_parser = __commonJS({
|
|
|
70141
70141
|
}
|
|
70142
70142
|
}
|
|
70143
70143
|
_adoptNodes(donor, recipient) {
|
|
70144
|
-
for (let
|
|
70145
|
-
this.treeAdapter.detachNode(
|
|
70146
|
-
this.treeAdapter.appendChild(recipient,
|
|
70144
|
+
for (let child = this.treeAdapter.getFirstChild(donor); child; child = this.treeAdapter.getFirstChild(donor)) {
|
|
70145
|
+
this.treeAdapter.detachNode(child);
|
|
70146
|
+
this.treeAdapter.appendChild(recipient, child);
|
|
70147
70147
|
}
|
|
70148
70148
|
}
|
|
70149
70149
|
//Token processing
|
|
@@ -73569,15 +73569,15 @@ var require_route = __commonJS({
|
|
|
73569
73569
|
};
|
|
73570
73570
|
}
|
|
73571
73571
|
function wrapConversion(toModel, graph) {
|
|
73572
|
-
const
|
|
73572
|
+
const path4 = [graph[toModel].parent, toModel];
|
|
73573
73573
|
let fn = conversions[graph[toModel].parent][toModel];
|
|
73574
73574
|
let cur = graph[toModel].parent;
|
|
73575
73575
|
while (graph[cur].parent) {
|
|
73576
|
-
|
|
73576
|
+
path4.unshift(graph[cur].parent);
|
|
73577
73577
|
fn = link3(conversions[graph[cur].parent][cur], fn);
|
|
73578
73578
|
cur = graph[cur].parent;
|
|
73579
73579
|
}
|
|
73580
|
-
fn.conversion =
|
|
73580
|
+
fn.conversion = path4;
|
|
73581
73581
|
return fn;
|
|
73582
73582
|
}
|
|
73583
73583
|
module.exports = function(fromModel) {
|
|
@@ -73817,7 +73817,7 @@ var require_has_flag2 = __commonJS({
|
|
|
73817
73817
|
var require_supports_color = __commonJS({
|
|
73818
73818
|
"node_modules/supports-color/index.js"(exports, module) {
|
|
73819
73819
|
"use strict";
|
|
73820
|
-
var
|
|
73820
|
+
var os5 = __require("os");
|
|
73821
73821
|
var tty2 = __require("tty");
|
|
73822
73822
|
var hasFlag2 = require_has_flag2();
|
|
73823
73823
|
var { env: env3 } = process;
|
|
@@ -73865,7 +73865,7 @@ var require_supports_color = __commonJS({
|
|
|
73865
73865
|
return min;
|
|
73866
73866
|
}
|
|
73867
73867
|
if (process.platform === "win32") {
|
|
73868
|
-
const osRelease =
|
|
73868
|
+
const osRelease = os5.release().split(".");
|
|
73869
73869
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
73870
73870
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
73871
73871
|
}
|
|
@@ -75327,9 +75327,9 @@ var require_react_jsx_runtime_development = __commonJS({
|
|
|
75327
75327
|
}
|
|
75328
75328
|
if (isArray(node)) {
|
|
75329
75329
|
for (var i = 0; i < node.length; i++) {
|
|
75330
|
-
var
|
|
75331
|
-
if (isValidElement(
|
|
75332
|
-
validateExplicitKey(
|
|
75330
|
+
var child = node[i];
|
|
75331
|
+
if (isValidElement(child)) {
|
|
75332
|
+
validateExplicitKey(child, parentType);
|
|
75333
75333
|
}
|
|
75334
75334
|
}
|
|
75335
75335
|
} else if (isValidElement(node)) {
|
|
@@ -80406,8 +80406,8 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
|
|
|
80406
80406
|
}
|
|
80407
80407
|
|
|
80408
80408
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
80409
|
-
var cleanupPath = (
|
|
80410
|
-
return
|
|
80409
|
+
var cleanupPath = (path4) => {
|
|
80410
|
+
return path4?.replace(`file://${cwd()}/`, "");
|
|
80411
80411
|
};
|
|
80412
80412
|
var stackUtils = new import_stack_utils.default({
|
|
80413
80413
|
cwd: cwd(),
|
|
@@ -83704,6 +83704,12 @@ var input_default = MultilineInput;
|
|
|
83704
83704
|
// src/app.jsx
|
|
83705
83705
|
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
|
|
83706
83706
|
var fmtDur = (s) => s < 60 ? `${Math.max(1, Math.round(s))}s` : `${Math.floor(s / 60)}m ${Math.round(s % 60)}s`;
|
|
83707
|
+
var plural = (n, w) => `${n} ${w}${n === 1 ? "" : "s"}`;
|
|
83708
|
+
var shortSession = (name) => (name || "").replace(/\.jsonl$/, "");
|
|
83709
|
+
var homeRel = (p) => {
|
|
83710
|
+
const h = os3.homedir();
|
|
83711
|
+
return p && h && p.startsWith(h) ? "~" + p.slice(h.length) : p;
|
|
83712
|
+
};
|
|
83707
83713
|
var fmtCost = (c) => c >= 0.01 ? `$${c.toFixed(2)}` : c > 0 ? `$${c.toFixed(4)}` : "$0";
|
|
83708
83714
|
var HISTORY_PATH = path.join(os3.homedir(), ".hum", "history.json");
|
|
83709
83715
|
var HISTORY_MAX = 300;
|
|
@@ -83736,10 +83742,12 @@ var COMMANDS = [
|
|
|
83736
83742
|
{ name: "/continue", desc: "after a pause: let the agent carry on" },
|
|
83737
83743
|
{ name: "/image", desc: "attach an image file to your next message (/image <path>); ctrl+v pastes a screenshot" },
|
|
83738
83744
|
{ name: "/tools", desc: "what is mounted" },
|
|
83745
|
+
{ name: "/hooks", desc: "the lifecycle hooks in scope (~/.hum/hooks.json, <repo>/.hum/hooks.json; Claude Code and Codex hook files too)" },
|
|
83739
83746
|
{ name: "/help", desc: "keys and commands" },
|
|
83740
|
-
{ name: "/quit", desc: "
|
|
83747
|
+
{ name: "/quit", desc: "leave; the session keeps running (hum brings you back)" },
|
|
83748
|
+
{ name: "/stop", desc: "end this session's engine (the record is saved)" }
|
|
83741
83749
|
];
|
|
83742
|
-
var HELP = "!cmd runs a command as you \xB7 esc interrupts the model (what it had is kept) \xB7 type while it works to steer \xB7 edit files in your editor any time (recorded as your turn) \xB7 ctrl+o shows the full output of the last tool result \xB7 ctrl+v pastes a screenshot from the clipboard \xB7 @path.png or /image <path> attaches an image file \xB7 /approve makes changes and commands wait for you (enter approves, a typed reason rejects) \xB7 /resume picks a past session \xB7 /compact restarts the context from a summary \xB7 ctrl+c twice
|
|
83750
|
+
var HELP = "!cmd runs a command as you \xB7 esc interrupts the model (what it had is kept) \xB7 type while it works to steer \xB7 edit files in your editor any time (recorded as your turn) \xB7 ctrl+o shows the full output of the last tool result \xB7 ctrl+v pastes a screenshot from the clipboard \xB7 @path.png or /image <path> attaches an image file \xB7 /approve makes changes and commands wait for you (enter approves, a typed reason rejects) \xB7 /resume picks a past session (a running one attaches) \xB7 /compact restarts the context from a summary \xB7 ctrl+c twice leaves and the session keeps running (`hum` brings you back) \xB7 /stop ends it";
|
|
83743
83751
|
var DIFF_TAIL_LINES = 20;
|
|
83744
83752
|
var OUTPUT_MAX_LINES = 200;
|
|
83745
83753
|
var ERR_TAIL_LINES = 5;
|
|
@@ -83774,6 +83782,8 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
83774
83782
|
const historyRef = (0, import_react24.useRef)(loadHistory());
|
|
83775
83783
|
const modelRef = (0, import_react24.useRef)("");
|
|
83776
83784
|
const lastOutRef = (0, import_react24.useRef)(null);
|
|
83785
|
+
const helloRef = (0, import_react24.useRef)(false);
|
|
83786
|
+
const preHello = (0, import_react24.useRef)([]);
|
|
83777
83787
|
const [meter, setMeter] = (0, import_react24.useState)({ tokens: 0, cap: 0, input: 0, output: 0 });
|
|
83778
83788
|
const setPhaseBoth = (p) => {
|
|
83779
83789
|
phaseRef.current = p;
|
|
@@ -83838,15 +83848,31 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
83838
83848
|
append({ kind: "agent", text: `agent ${ev.n} \xB7 ${ev.kind} \xB7 ${ev.desc}` });
|
|
83839
83849
|
break;
|
|
83840
83850
|
case "agent_end":
|
|
83841
|
-
append({ kind: "agent_end", text: `agent ${ev.n} done \xB7 ${ev.steps}
|
|
83851
|
+
append({ kind: "agent_end", text: `agent ${ev.n} done \xB7 ${plural(ev.steps, "step")} \xB7 ${fmtCost(ev.cost_usd)}${ev.reason !== "done" ? ` \xB7 ${ev.reason}` : ""}` });
|
|
83842
83852
|
break;
|
|
83843
|
-
case "hello":
|
|
83853
|
+
case "hello": {
|
|
83844
83854
|
setHello(ev);
|
|
83855
|
+
helloRef.current = true;
|
|
83845
83856
|
modelRef.current = ev.model;
|
|
83846
83857
|
setMeter((m) => ({ ...m, tokens: 0, cap: ev.compact_at || 0 }));
|
|
83847
83858
|
setGate(ev.gate === "approve" ? "approve" : "off");
|
|
83848
|
-
|
|
83849
|
-
|
|
83859
|
+
if (ev.session) setSession(ev.session);
|
|
83860
|
+
const state = ev.state && ev.state !== "new" && ev.state !== "idle" ? ` \xB7 ${ev.state}` : "";
|
|
83861
|
+
append({
|
|
83862
|
+
kind: "banner",
|
|
83863
|
+
text: `${ev.model}${ev.user ? ` \xB7 ${ev.user}` : ""} \xB7 ${homeRel(ev.cwd)} \xB7 tools: ${ev.tools.join(", ")}${state}`,
|
|
83864
|
+
instruction: ev.session ? ev.instruction : null
|
|
83865
|
+
});
|
|
83866
|
+
preHello.current.forEach((it) => append(it));
|
|
83867
|
+
preHello.current = [];
|
|
83868
|
+
if (ev.session) {
|
|
83869
|
+
if (ev.busy) {
|
|
83870
|
+
setPhaseBoth("busy");
|
|
83871
|
+
setStatus(ev.phase || "");
|
|
83872
|
+
turnT0.current = Date.now();
|
|
83873
|
+
} else setPhaseBoth("idle");
|
|
83874
|
+
if (resume === "pick") engine2.send({ cmd: "sessions" });
|
|
83875
|
+
} else if (task) {
|
|
83850
83876
|
if (images.length && !ev.images) append({ kind: "warn", text: "this engine does not take images; update hum" });
|
|
83851
83877
|
engine2.send({ cmd: "start", task, images: ev.images ? images : [] });
|
|
83852
83878
|
} else if (resume === "pick") {
|
|
@@ -83859,6 +83885,78 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
83859
83885
|
else if (images.length) append({ kind: "warn", text: "this engine does not take images; update hum" });
|
|
83860
83886
|
}
|
|
83861
83887
|
break;
|
|
83888
|
+
}
|
|
83889
|
+
case "replay":
|
|
83890
|
+
for (const it of ev.items || []) {
|
|
83891
|
+
switch (it.type) {
|
|
83892
|
+
case "you":
|
|
83893
|
+
append({ kind: "you", text: it.text, images: it.images || [] });
|
|
83894
|
+
break;
|
|
83895
|
+
case "text":
|
|
83896
|
+
append({ kind: "hum", text: it.text });
|
|
83897
|
+
break;
|
|
83898
|
+
case "thought":
|
|
83899
|
+
append({ kind: "thought", text: `thought for ${fmtDur(it.secs || 0)} \xB7 ${((it.chars || 0) / 1e3).toFixed(1)}k chars` });
|
|
83900
|
+
break;
|
|
83901
|
+
case "tool_call": {
|
|
83902
|
+
toolsRef.current[it.id] = it;
|
|
83903
|
+
append({ kind: "tool", text: it.name === "write_file" && it.lines != null ? `${it.desc || it.name} (${it.lines} lines)` : it.desc || it.name, name: it.name, args: it.args, agent: it.agent });
|
|
83904
|
+
if (it.diff) {
|
|
83905
|
+
const ls = it.diff.split("\n");
|
|
83906
|
+
append({ kind: "diff", lines: ls.slice(0, DIFF_TAIL_LINES), more: Math.max(0, ls.length - DIFF_TAIL_LINES) });
|
|
83907
|
+
}
|
|
83908
|
+
break;
|
|
83909
|
+
}
|
|
83910
|
+
case "tool_result": {
|
|
83911
|
+
if (!it.agent) lastOutRef.current = { name: it.name, content: it.content || "" };
|
|
83912
|
+
const more = (it.lines || 0) > 1 ? ` (+${it.lines - 1} lines)` : "";
|
|
83913
|
+
append({ kind: "tool_result", text: `${it.summary || "(no output)"}${more}`, isError: !it.ok, agent: it.agent });
|
|
83914
|
+
break;
|
|
83915
|
+
}
|
|
83916
|
+
case "plan": {
|
|
83917
|
+
const glyph = { completed: "\u25FC", in_progress: "\u25B8", pending: "\u25FB" };
|
|
83918
|
+
append({ kind: "plan", steps: (it.steps || []).map((st) => ({ ...st, glyph: glyph[st.status] || "\u25FB" })), explanation: it.explanation });
|
|
83919
|
+
break;
|
|
83920
|
+
}
|
|
83921
|
+
case "turn_end":
|
|
83922
|
+
append({ kind: "turn", text: `${fmtDur(it.elapsed_s || 0)} \xB7 ${plural(it.turns, "step")} \xB7 ${fmtCost(it.cost_usd)} session` });
|
|
83923
|
+
setSpend(it.cost_usd || 0);
|
|
83924
|
+
break;
|
|
83925
|
+
case "agent_start":
|
|
83926
|
+
append({ kind: "agent", text: `agent ${it.n} \xB7 ${it.kind} \xB7 ${it.desc}` });
|
|
83927
|
+
break;
|
|
83928
|
+
case "agent_end":
|
|
83929
|
+
append({ kind: "agent_end", text: `agent ${it.n} done \xB7 ${plural(it.steps, "step")} \xB7 ${fmtCost(it.cost_usd)}` });
|
|
83930
|
+
break;
|
|
83931
|
+
case "compaction":
|
|
83932
|
+
append({ kind: "info", text: `context summarised and restarted${it.prompt_tokens_before ? ` at ${it.prompt_tokens_before.toLocaleString()} tokens` : ""}` });
|
|
83933
|
+
break;
|
|
83934
|
+
case "human_edit":
|
|
83935
|
+
append({ kind: "info", text: `you edited files: ${it.stat}` });
|
|
83936
|
+
break;
|
|
83937
|
+
case "paused":
|
|
83938
|
+
append({ kind: "paused", text: it.detail, trip: it.kind });
|
|
83939
|
+
setPaused(true);
|
|
83940
|
+
break;
|
|
83941
|
+
case "resumed":
|
|
83942
|
+
setPaused(false);
|
|
83943
|
+
break;
|
|
83944
|
+
case "interrupted":
|
|
83945
|
+
append({ kind: "info", text: it.kept ? "stopped \xB7 what it had so far is kept in the session" : "stopped" });
|
|
83946
|
+
break;
|
|
83947
|
+
case "gate":
|
|
83948
|
+
setGate(it.mode);
|
|
83949
|
+
break;
|
|
83950
|
+
case "info":
|
|
83951
|
+
case "warn":
|
|
83952
|
+
case "error":
|
|
83953
|
+
append({ kind: it.type, text: it.text });
|
|
83954
|
+
break;
|
|
83955
|
+
default:
|
|
83956
|
+
break;
|
|
83957
|
+
}
|
|
83958
|
+
}
|
|
83959
|
+
break;
|
|
83862
83960
|
case "sessions":
|
|
83863
83961
|
if (!ev.items || ev.items.length === 0) {
|
|
83864
83962
|
append({ kind: "info", text: "no sessions yet" });
|
|
@@ -83872,7 +83970,6 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
83872
83970
|
setPaused(false);
|
|
83873
83971
|
setProposal(null);
|
|
83874
83972
|
if (ev.model) modelRef.current = ev.model;
|
|
83875
|
-
append({ kind: "info", text: `session ${ev.name}` });
|
|
83876
83973
|
break;
|
|
83877
83974
|
case "turn_start":
|
|
83878
83975
|
turnT0.current = turnT0.current || Date.now();
|
|
@@ -83977,7 +84074,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
83977
84074
|
setSpend(ev.cost_usd);
|
|
83978
84075
|
const dur = turnT0.current ? fmtDur((Date.now() - turnT0.current) / 1e3) : fmtDur(ev.elapsed_s);
|
|
83979
84076
|
turnT0.current = null;
|
|
83980
|
-
append({ kind: "turn", text: `${dur} \xB7 ${ev.turns}
|
|
84077
|
+
append({ kind: "turn", text: `${dur} \xB7 ${plural(ev.turns, "step")} \xB7 ${fmtCost(ev.cost_usd)} session` + (ev.stop_reason !== "done" && !String(ev.stop_reason).startsWith("paused") ? ` \xB7 stopped: ${ev.stop_reason}` : "") });
|
|
83981
84078
|
setPhaseBoth("idle");
|
|
83982
84079
|
setStatus("");
|
|
83983
84080
|
break;
|
|
@@ -83990,15 +84087,17 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
83990
84087
|
break;
|
|
83991
84088
|
}
|
|
83992
84089
|
case "info":
|
|
83993
|
-
|
|
83994
|
-
|
|
83995
|
-
|
|
83996
|
-
|
|
84090
|
+
case "warn": {
|
|
84091
|
+
const it = { kind: ev.type, text: ev.text };
|
|
84092
|
+
if (helloRef.current) append(it);
|
|
84093
|
+
else preHello.current.push(it);
|
|
83997
84094
|
break;
|
|
84095
|
+
}
|
|
83998
84096
|
case "error":
|
|
83999
84097
|
foldThinking();
|
|
84000
84098
|
flushDraft();
|
|
84001
|
-
append({ kind: "error", text: ev.text });
|
|
84099
|
+
if (helloRef.current) append({ kind: "error", text: ev.text });
|
|
84100
|
+
else preHello.current.push({ kind: "error", text: ev.text });
|
|
84002
84101
|
setPhaseBoth("idle");
|
|
84003
84102
|
setStatus("");
|
|
84004
84103
|
break;
|
|
@@ -84016,12 +84115,22 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84016
84115
|
}, []);
|
|
84017
84116
|
const quit = () => {
|
|
84018
84117
|
if (phaseRef.current === "dead") return;
|
|
84019
|
-
|
|
84118
|
+
const busy = phaseRef.current === "busy";
|
|
84119
|
+
append({ kind: "info", text: !session ? "bye" : busy ? "still working \xB7 `hum` brings you back" : `saved \xB7 \`hum\` brings you back` });
|
|
84020
84120
|
engine2.send({ cmd: "quit" });
|
|
84021
84121
|
setTimeout(() => {
|
|
84022
84122
|
setPhaseBoth("dead");
|
|
84023
84123
|
exit();
|
|
84024
|
-
},
|
|
84124
|
+
}, 400);
|
|
84125
|
+
};
|
|
84126
|
+
const stop = () => {
|
|
84127
|
+
if (phaseRef.current === "dead") return;
|
|
84128
|
+
append({ kind: "info", text: session ? `stopped \xB7 saved \xB7 hum resume ${shortSession(session)}` : "stopped" });
|
|
84129
|
+
engine2.send({ cmd: "stop" });
|
|
84130
|
+
setTimeout(() => {
|
|
84131
|
+
setPhaseBoth("dead");
|
|
84132
|
+
exit();
|
|
84133
|
+
}, 2500);
|
|
84025
84134
|
};
|
|
84026
84135
|
use_input_default((input, key) => {
|
|
84027
84136
|
if (key.ctrl && input === "c") {
|
|
@@ -84063,7 +84172,9 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84063
84172
|
else if (key.return) {
|
|
84064
84173
|
const it = picker.items[picker.index];
|
|
84065
84174
|
setPicker(null);
|
|
84066
|
-
|
|
84175
|
+
if (it.live && it.live.here) {
|
|
84176
|
+
} else if (it.live && it.live.port) attachTo(it.live.port);
|
|
84177
|
+
else engine2.send({ cmd: "resume", name: it.name });
|
|
84067
84178
|
} else if (key.escape) setPicker(null);
|
|
84068
84179
|
return;
|
|
84069
84180
|
}
|
|
@@ -84078,6 +84189,22 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84078
84189
|
(0, import_react24.useEffect)(() => {
|
|
84079
84190
|
setMenuIndex(0);
|
|
84080
84191
|
}, [value]);
|
|
84192
|
+
const attachTo = (port2) => {
|
|
84193
|
+
setItems([]);
|
|
84194
|
+
setDraft("");
|
|
84195
|
+
setThinking("");
|
|
84196
|
+
thinkChars.current = 0;
|
|
84197
|
+
setProposal(null);
|
|
84198
|
+
setPaused(false);
|
|
84199
|
+
setSpend(0);
|
|
84200
|
+
helloRef.current = false;
|
|
84201
|
+
setPhaseBoth("connecting");
|
|
84202
|
+
setStatus("");
|
|
84203
|
+
engine2.reconnect(port2).catch((e) => {
|
|
84204
|
+
append({ kind: "error", text: `could not attach: ${e.message}` });
|
|
84205
|
+
setPhaseBoth("idle");
|
|
84206
|
+
});
|
|
84207
|
+
};
|
|
84081
84208
|
const decide = (decision, note) => {
|
|
84082
84209
|
const p = proposal;
|
|
84083
84210
|
setProposal(null);
|
|
@@ -84097,6 +84224,9 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84097
84224
|
case "/quit":
|
|
84098
84225
|
quit();
|
|
84099
84226
|
break;
|
|
84227
|
+
case "/stop":
|
|
84228
|
+
stop();
|
|
84229
|
+
break;
|
|
84100
84230
|
case "/help":
|
|
84101
84231
|
append({ kind: "info", text: HELP });
|
|
84102
84232
|
break;
|
|
@@ -84125,6 +84255,9 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84125
84255
|
case "/tools":
|
|
84126
84256
|
append({ kind: "info", text: (hello?.tools || []).join(", ") });
|
|
84127
84257
|
break;
|
|
84258
|
+
case "/hooks":
|
|
84259
|
+
engine2.send({ cmd: "hooks" });
|
|
84260
|
+
break;
|
|
84128
84261
|
case "/continue":
|
|
84129
84262
|
engine2.send({ cmd: "continue" });
|
|
84130
84263
|
break;
|
|
@@ -84150,7 +84283,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84150
84283
|
hist.push(text);
|
|
84151
84284
|
saveHistory(hist);
|
|
84152
84285
|
}
|
|
84153
|
-
if (proposal && !/^\/(approve|quit|exit)\b/.test(text)) {
|
|
84286
|
+
if (proposal && !/^\/(approve|quit|exit|stop)\b/.test(text)) {
|
|
84154
84287
|
decide("reject", text);
|
|
84155
84288
|
return;
|
|
84156
84289
|
}
|
|
@@ -84178,7 +84311,7 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84178
84311
|
setPhaseBoth("busy");
|
|
84179
84312
|
}
|
|
84180
84313
|
};
|
|
84181
|
-
const statusLine = phase === "connecting" ? "starting the engine \u2026" : `${modelRef.current || ""}${session ? ` \xB7 ${session}` : ""} \xB7 ${fmtCost(spend)}` + (ctxPct >= 10 ? ` \xB7 ctx ${ctxPct}%` : "") + (gate === "approve" ? " \xB7 approvals on" : "") + (ctrlc ? " \xB7 ctrl+c again to quit" : " \xB7 / for commands");
|
|
84314
|
+
const statusLine = phase === "connecting" ? "starting the engine \u2026" : `${modelRef.current || ""}${session ? ` \xB7 ${shortSession(session)}` : ""} \xB7 ${fmtCost(spend)}` + (ctxPct >= 10 ? ` \xB7 ctx ${ctxPct}%` : "") + (gate === "approve" ? " \xB7 approvals on" : "") + (ctrlc ? " \xB7 ctrl+c again to quit" : " \xB7 / for commands");
|
|
84182
84315
|
const spinnerLabel = phase === "connecting" ? " starting \u2026" : ` ${status || "working"}${elapsed >= 2 ? ` \xB7 ${fmtDur(elapsed)}` : ""}` + (thinkChars.current > 4e3 ? ` \xB7 ${(thinkChars.current / 1e3).toFixed(0)}k thinking` : "");
|
|
84183
84316
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", children: [
|
|
84184
84317
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Static, { items, children: (item) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { flexDirection: "column", marginBottom: ["hum", "you", "banner", "turn"].includes(item.kind) ? 1 : 0, children: [
|
|
@@ -84187,7 +84320,8 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84187
84320
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, bold: true, children: "\u2733 hum " }),
|
|
84188
84321
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "\u0939\u092E" })
|
|
84189
84322
|
] }),
|
|
84190
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: item.text })
|
|
84323
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: item.text }),
|
|
84324
|
+
item.instruction ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { children: item.instruction.split("\n")[0].slice(0, width - 8) }) : null
|
|
84191
84325
|
] }),
|
|
84192
84326
|
item.kind === "hum" && /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
|
|
84193
84327
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Box_default, { width: 2, flexShrink: 0, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: ACCENT, children: "\u25CF" }) }),
|
|
@@ -84332,16 +84466,20 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84332
84466
|
"pick a session to continue ",
|
|
84333
84467
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { dimColor: true, children: "\xB7 enter continues \xB7 esc cancels" })
|
|
84334
84468
|
] }),
|
|
84335
|
-
picker.items.map((it, i) =>
|
|
84336
|
-
|
|
84337
|
-
|
|
84338
|
-
|
|
84339
|
-
|
|
84340
|
-
|
|
84341
|
-
|
|
84342
|
-
|
|
84343
|
-
|
|
84344
|
-
|
|
84469
|
+
picker.items.map((it, i) => {
|
|
84470
|
+
const live = it.live ? it.live.here ? " \xB7 here" : ` \xB7 ${it.live.state || "running"}` : "";
|
|
84471
|
+
const tail2 = (it.steps != null ? ` \xB7 ${plural(it.steps, "step")}` : " \xB7 on the server") + (it.cost_usd ? ` \xB7 ${fmtCost(it.cost_usd)}` : "") + (it.cwd ? ` \xB7 ${path.basename(it.cwd)}` : "") + live;
|
|
84472
|
+
const room = Math.max(16, width - 13 - tail2.length - 1);
|
|
84473
|
+
const what = (it.instruction || "(untitled)").replace(/\s+/g, " ");
|
|
84474
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { children: [
|
|
84475
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "cyan", inverse: i === picker.index, children: (i === picker.index ? "\u276F " : " ") + (it.when || "").padEnd(9) }),
|
|
84476
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Text, { dimColor: i !== picker.index, color: it.live && !it.live.here ? "magenta" : void 0, children: [
|
|
84477
|
+
" ",
|
|
84478
|
+
what.length > room ? what.slice(0, room - 1) + "\u2026" : what,
|
|
84479
|
+
tail2
|
|
84480
|
+
] })
|
|
84481
|
+
] }, it.name);
|
|
84482
|
+
})
|
|
84345
84483
|
] }),
|
|
84346
84484
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(Box_default, { borderStyle: "round", borderColor: "gray", paddingX: 1, marginTop: 1, children: [
|
|
84347
84485
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(Text, { color: "cyan", children: "\u276F " }),
|
|
@@ -84375,8 +84513,20 @@ function App2({ engine: engine2, task, resume, images = [] }) {
|
|
|
84375
84513
|
}
|
|
84376
84514
|
|
|
84377
84515
|
// src/engine.js
|
|
84516
|
+
import fs3 from "node:fs";
|
|
84378
84517
|
import net from "node:net";
|
|
84518
|
+
import os4 from "node:os";
|
|
84519
|
+
import path2 from "node:path";
|
|
84520
|
+
import crypto from "node:crypto";
|
|
84379
84521
|
import { spawn } from "node:child_process";
|
|
84522
|
+
var runDir = () => path2.join(process.env.HUM_HOME || path2.join(os4.homedir(), ".hum"), "run");
|
|
84523
|
+
var readRun = (id) => {
|
|
84524
|
+
try {
|
|
84525
|
+
return JSON.parse(fs3.readFileSync(path2.join(runDir(), `${id}.json`), "utf8"));
|
|
84526
|
+
} catch {
|
|
84527
|
+
return null;
|
|
84528
|
+
}
|
|
84529
|
+
};
|
|
84380
84530
|
var EngineError = class extends Error {
|
|
84381
84531
|
};
|
|
84382
84532
|
var ENGINE_CANDIDATES = [
|
|
@@ -84386,7 +84536,7 @@ var ENGINE_CANDIDATES = [
|
|
|
84386
84536
|
// uv tool install hum-cli
|
|
84387
84537
|
`${process.env.HOME || ""}/.local/bin/hum-engine`
|
|
84388
84538
|
];
|
|
84389
|
-
function spawnEngine(cwd2) {
|
|
84539
|
+
function spawnEngine(cwd2, { task = null, images = [], resume = null } = {}) {
|
|
84390
84540
|
return new Promise((resolve, reject) => {
|
|
84391
84541
|
const tryNext = (i) => {
|
|
84392
84542
|
const cmd = ENGINE_CANDIDATES[i];
|
|
@@ -84400,21 +84550,48 @@ function spawnEngine(cwd2) {
|
|
|
84400
84550
|
tryNext(i + 1);
|
|
84401
84551
|
return;
|
|
84402
84552
|
}
|
|
84553
|
+
const runId = crypto.randomBytes(6).toString("hex");
|
|
84554
|
+
fs3.mkdirSync(runDir(), { recursive: true });
|
|
84555
|
+
const log = fs3.openSync(path2.join(runDir(), `${runId}.log`), "a");
|
|
84403
84556
|
const [bin, ...rest] = cmd.split(" ");
|
|
84404
|
-
const
|
|
84405
|
-
|
|
84406
|
-
|
|
84407
|
-
|
|
84408
|
-
|
|
84409
|
-
|
|
84410
|
-
|
|
84411
|
-
|
|
84412
|
-
|
|
84413
|
-
|
|
84557
|
+
const args2 = [...rest, "-C", cwd2, "--run-id", runId];
|
|
84558
|
+
if (task) args2.push("--task", task);
|
|
84559
|
+
for (const p of images) args2.push("--image", p);
|
|
84560
|
+
if (resume) args2.push("--resume", resume);
|
|
84561
|
+
let child;
|
|
84562
|
+
try {
|
|
84563
|
+
child = spawn(bin, args2, { stdio: ["ignore", log, log], detached: true, windowsHide: true });
|
|
84564
|
+
} catch {
|
|
84565
|
+
tryNext(i + 1);
|
|
84566
|
+
return;
|
|
84567
|
+
}
|
|
84568
|
+
let failed = false;
|
|
84569
|
+
child.on("error", () => {
|
|
84570
|
+
failed = true;
|
|
84571
|
+
tryNext(i + 1);
|
|
84414
84572
|
});
|
|
84415
|
-
|
|
84416
|
-
|
|
84573
|
+
child.on("exit", () => {
|
|
84574
|
+
failed = true;
|
|
84417
84575
|
});
|
|
84576
|
+
const t0 = Date.now();
|
|
84577
|
+
const poll = () => {
|
|
84578
|
+
const rec = readRun(runId);
|
|
84579
|
+
if (rec && rec.port) {
|
|
84580
|
+
child.unref();
|
|
84581
|
+
resolve(rec);
|
|
84582
|
+
return;
|
|
84583
|
+
}
|
|
84584
|
+
if (failed && !rec) {
|
|
84585
|
+
reject(new EngineError(`the engine did not start (see ${path2.join(runDir(), `${runId}.log`)})`));
|
|
84586
|
+
return;
|
|
84587
|
+
}
|
|
84588
|
+
if (Date.now() - t0 > 25e3) {
|
|
84589
|
+
reject(new EngineError("the engine did not start in time"));
|
|
84590
|
+
return;
|
|
84591
|
+
}
|
|
84592
|
+
setTimeout(poll, 50);
|
|
84593
|
+
};
|
|
84594
|
+
poll();
|
|
84418
84595
|
};
|
|
84419
84596
|
tryNext(0);
|
|
84420
84597
|
});
|
|
@@ -84427,12 +84604,14 @@ var Engine = class {
|
|
|
84427
84604
|
}
|
|
84428
84605
|
connect() {
|
|
84429
84606
|
return new Promise((resolve, reject) => {
|
|
84430
|
-
|
|
84431
|
-
this.sock
|
|
84432
|
-
|
|
84607
|
+
const sock = net.createConnection({ host: "127.0.0.1", port: this.port }, () => resolve());
|
|
84608
|
+
this.sock = sock;
|
|
84609
|
+
sock.on("error", (e) => {
|
|
84610
|
+
if (!this.closed && this.sock === sock) reject(new EngineError(`engine: ${e.message}`));
|
|
84433
84611
|
});
|
|
84434
84612
|
let buf = "";
|
|
84435
|
-
|
|
84613
|
+
sock.on("data", (d) => {
|
|
84614
|
+
if (this.sock !== sock) return;
|
|
84436
84615
|
buf += d.toString();
|
|
84437
84616
|
const lines = buf.split("\n");
|
|
84438
84617
|
buf = lines.pop();
|
|
@@ -84447,12 +84626,26 @@ var Engine = class {
|
|
|
84447
84626
|
for (const h of this.handlers) h(ev);
|
|
84448
84627
|
}
|
|
84449
84628
|
});
|
|
84450
|
-
|
|
84629
|
+
sock.on("close", () => {
|
|
84630
|
+
if (this.sock !== sock) return;
|
|
84451
84631
|
this.closed = true;
|
|
84452
84632
|
for (const h of this.handlers) h({ type: "bye", gone: true });
|
|
84453
84633
|
});
|
|
84454
84634
|
});
|
|
84455
84635
|
}
|
|
84636
|
+
// Attach to another engine (a session running elsewhere on this machine): the old
|
|
84637
|
+
// socket is dropped quietly, the new one greets us with hello and a replay.
|
|
84638
|
+
async reconnect(port2) {
|
|
84639
|
+
const old = this.sock;
|
|
84640
|
+
this.sock = null;
|
|
84641
|
+
this.port = port2;
|
|
84642
|
+
this.closed = false;
|
|
84643
|
+
try {
|
|
84644
|
+
old.destroy();
|
|
84645
|
+
} catch {
|
|
84646
|
+
}
|
|
84647
|
+
await this.connect();
|
|
84648
|
+
}
|
|
84456
84649
|
on(handler) {
|
|
84457
84650
|
this.handlers.push(handler);
|
|
84458
84651
|
}
|
|
@@ -84474,6 +84667,8 @@ var Engine = class {
|
|
|
84474
84667
|
|
|
84475
84668
|
// src/cli.jsx
|
|
84476
84669
|
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
|
|
84670
|
+
import fs4 from "node:fs";
|
|
84671
|
+
import path3 from "node:path";
|
|
84477
84672
|
function parseArgs(argv) {
|
|
84478
84673
|
const a = { task: null, resume: null, cwd: process.cwd(), images: [] };
|
|
84479
84674
|
for (let i = 0; i < argv.length; i += 1) {
|
|
@@ -84498,10 +84693,41 @@ if (!process.stdin.isTTY) {
|
|
|
84498
84693
|
process.stderr.write('hum needs an interactive terminal; use `hum run "task"` when piping.\n');
|
|
84499
84694
|
process.exit(1);
|
|
84500
84695
|
}
|
|
84501
|
-
var
|
|
84696
|
+
var liveRuns = () => {
|
|
84697
|
+
let out = [];
|
|
84698
|
+
try {
|
|
84699
|
+
for (const f of fs4.readdirSync(runDir())) {
|
|
84700
|
+
if (!f.endsWith(".json")) continue;
|
|
84701
|
+
try {
|
|
84702
|
+
const r = JSON.parse(fs4.readFileSync(path3.join(runDir(), f), "utf8"));
|
|
84703
|
+
if (r.port && r.session) out.push(r);
|
|
84704
|
+
} catch {
|
|
84705
|
+
}
|
|
84706
|
+
}
|
|
84707
|
+
} catch {
|
|
84708
|
+
}
|
|
84709
|
+
out.sort((a, b) => (b.updated || 0) - (a.updated || 0));
|
|
84710
|
+
for (const r of out) {
|
|
84711
|
+
try {
|
|
84712
|
+
process.kill(r.pid, 0);
|
|
84713
|
+
} catch {
|
|
84714
|
+
r.dead = true;
|
|
84715
|
+
}
|
|
84716
|
+
}
|
|
84717
|
+
return out.filter((r) => !r.dead);
|
|
84718
|
+
};
|
|
84502
84719
|
var port = Number(process.env.HUM_ENGINE_PORT || 0);
|
|
84720
|
+
var startedHere = false;
|
|
84503
84721
|
try {
|
|
84504
|
-
if (!port)
|
|
84722
|
+
if (!port) {
|
|
84723
|
+
let rec = null;
|
|
84724
|
+
if (!args.task && !args.resume && args.images.length === 0) rec = liveRuns()[0] || null;
|
|
84725
|
+
if (!rec) {
|
|
84726
|
+
rec = await spawnEngine(args.cwd, { task: args.task, images: args.images, resume: args.resume && args.resume !== "pick" ? args.resume : null });
|
|
84727
|
+
startedHere = true;
|
|
84728
|
+
}
|
|
84729
|
+
port = rec.port;
|
|
84730
|
+
}
|
|
84505
84731
|
} catch (exc) {
|
|
84506
84732
|
if (exc instanceof EngineError) {
|
|
84507
84733
|
process.stderr.write(exc.message + "\n");
|
|
@@ -84516,15 +84742,9 @@ try {
|
|
|
84516
84742
|
process.stderr.write(exc.message + "\n");
|
|
84517
84743
|
process.exit(1);
|
|
84518
84744
|
}
|
|
84519
|
-
var { waitUntilExit } = render_default(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(App2, { engine, task: args.task, resume: args.resume, images: args.images }), { exitOnCtrlC: false });
|
|
84745
|
+
var { waitUntilExit } = render_default(/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(App2, { engine, task: startedHere ? null : args.task, resume: args.resume === "pick" || !startedHere ? args.resume : null, images: startedHere ? [] : args.images }), { exitOnCtrlC: false });
|
|
84520
84746
|
waitUntilExit().then(() => {
|
|
84521
84747
|
engine.close();
|
|
84522
|
-
if (child) setTimeout(() => {
|
|
84523
|
-
try {
|
|
84524
|
-
child.kill();
|
|
84525
|
-
} catch {
|
|
84526
|
-
}
|
|
84527
|
-
}, 3e3);
|
|
84528
84748
|
process.exit(0);
|
|
84529
84749
|
});
|
|
84530
84750
|
/*! Bundled license information:
|