@brainbase-labs/cli 0.6.1 → 0.7.0
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 +860 -743
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,25 +5,43 @@ var __getProtoOf = Object.getPrototypeOf;
|
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
function __accessProp(key) {
|
|
9
|
+
return this[key];
|
|
10
|
+
}
|
|
11
|
+
var __toESMCache_node;
|
|
12
|
+
var __toESMCache_esm;
|
|
8
13
|
var __toESM = (mod, isNodeMode, target) => {
|
|
14
|
+
var canCache = mod != null && typeof mod === "object";
|
|
15
|
+
if (canCache) {
|
|
16
|
+
var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
|
|
17
|
+
var cached = cache.get(mod);
|
|
18
|
+
if (cached)
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
9
21
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
10
22
|
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
11
23
|
for (let key of __getOwnPropNames(mod))
|
|
12
24
|
if (!__hasOwnProp.call(to, key))
|
|
13
25
|
__defProp(to, key, {
|
|
14
|
-
get: (
|
|
26
|
+
get: __accessProp.bind(mod, key),
|
|
15
27
|
enumerable: true
|
|
16
28
|
});
|
|
29
|
+
if (canCache)
|
|
30
|
+
cache.set(mod, to);
|
|
17
31
|
return to;
|
|
18
32
|
};
|
|
19
33
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
34
|
+
var __returnValue = (v) => v;
|
|
35
|
+
function __exportSetter(name, newValue) {
|
|
36
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
37
|
+
}
|
|
20
38
|
var __export = (target, all) => {
|
|
21
39
|
for (var name in all)
|
|
22
40
|
__defProp(target, name, {
|
|
23
41
|
get: all[name],
|
|
24
42
|
enumerable: true,
|
|
25
43
|
configurable: true,
|
|
26
|
-
set: (
|
|
44
|
+
set: __exportSetter.bind(all, name)
|
|
27
45
|
});
|
|
28
46
|
};
|
|
29
47
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
@@ -8996,16 +9014,16 @@ var require_signal_exit = __commonJS((exports, module) => {
|
|
|
8996
9014
|
if (opts && opts.alwaysLast) {
|
|
8997
9015
|
ev = "afterexit";
|
|
8998
9016
|
}
|
|
8999
|
-
var
|
|
9017
|
+
var remove2 = function() {
|
|
9000
9018
|
emitter.removeListener(ev, cb);
|
|
9001
9019
|
if (emitter.listeners("exit").length === 0 && emitter.listeners("afterexit").length === 0) {
|
|
9002
9020
|
unload();
|
|
9003
9021
|
}
|
|
9004
9022
|
};
|
|
9005
9023
|
emitter.on(ev, cb);
|
|
9006
|
-
return
|
|
9024
|
+
return remove2;
|
|
9007
9025
|
};
|
|
9008
|
-
unload = function
|
|
9026
|
+
unload = function unload2() {
|
|
9009
9027
|
if (!loaded || !processOk(global.process)) {
|
|
9010
9028
|
return;
|
|
9011
9029
|
}
|
|
@@ -9020,7 +9038,7 @@ var require_signal_exit = __commonJS((exports, module) => {
|
|
|
9020
9038
|
emitter.count -= 1;
|
|
9021
9039
|
};
|
|
9022
9040
|
module.exports.unload = unload;
|
|
9023
|
-
emit = function
|
|
9041
|
+
emit = function emit2(event, code, signal) {
|
|
9024
9042
|
if (emitter.emitted[event]) {
|
|
9025
9043
|
return;
|
|
9026
9044
|
}
|
|
@@ -9049,7 +9067,7 @@ var require_signal_exit = __commonJS((exports, module) => {
|
|
|
9049
9067
|
return signals;
|
|
9050
9068
|
};
|
|
9051
9069
|
loaded = false;
|
|
9052
|
-
load = function
|
|
9070
|
+
load = function load2() {
|
|
9053
9071
|
if (loaded || !processOk(global.process)) {
|
|
9054
9072
|
return;
|
|
9055
9073
|
}
|
|
@@ -9068,7 +9086,7 @@ var require_signal_exit = __commonJS((exports, module) => {
|
|
|
9068
9086
|
};
|
|
9069
9087
|
module.exports.load = load;
|
|
9070
9088
|
originalProcessReallyExit = process3.reallyExit;
|
|
9071
|
-
processReallyExit = function
|
|
9089
|
+
processReallyExit = function processReallyExit2(code) {
|
|
9072
9090
|
if (!processOk(global.process)) {
|
|
9073
9091
|
return;
|
|
9074
9092
|
}
|
|
@@ -9078,7 +9096,7 @@ var require_signal_exit = __commonJS((exports, module) => {
|
|
|
9078
9096
|
originalProcessReallyExit.call(process3, process3.exitCode);
|
|
9079
9097
|
};
|
|
9080
9098
|
originalProcessEmit = process3.emit;
|
|
9081
|
-
processEmit = function
|
|
9099
|
+
processEmit = function processEmit2(ev, arg) {
|
|
9082
9100
|
if (ev === "exit" && processOk(global.process)) {
|
|
9083
9101
|
if (arg !== undefined) {
|
|
9084
9102
|
process3.exitCode = arg;
|
|
@@ -9131,10 +9149,10 @@ var require_scheduler_development = __commonJS((exports) => {
|
|
|
9131
9149
|
return null;
|
|
9132
9150
|
}
|
|
9133
9151
|
var first = heap[0];
|
|
9134
|
-
var
|
|
9135
|
-
if (
|
|
9136
|
-
heap[0] =
|
|
9137
|
-
siftDown(heap,
|
|
9152
|
+
var last2 = heap.pop();
|
|
9153
|
+
if (last2 !== first) {
|
|
9154
|
+
heap[0] = last2;
|
|
9155
|
+
siftDown(heap, last2, 0);
|
|
9138
9156
|
}
|
|
9139
9157
|
return first;
|
|
9140
9158
|
}
|
|
@@ -9373,9 +9391,9 @@ var require_scheduler_development = __commonJS((exports) => {
|
|
|
9373
9391
|
var currentTime = exports.unstable_now();
|
|
9374
9392
|
var startTime2;
|
|
9375
9393
|
if (typeof options === "object" && options !== null) {
|
|
9376
|
-
var
|
|
9377
|
-
if (typeof
|
|
9378
|
-
startTime2 = currentTime +
|
|
9394
|
+
var delay2 = options.delay;
|
|
9395
|
+
if (typeof delay2 === "number" && delay2 > 0) {
|
|
9396
|
+
startTime2 = currentTime + delay2;
|
|
9379
9397
|
} else {
|
|
9380
9398
|
startTime2 = currentTime;
|
|
9381
9399
|
}
|
|
@@ -9608,11 +9626,11 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
9608
9626
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
9609
9627
|
}
|
|
9610
9628
|
}
|
|
9611
|
-
var
|
|
9612
|
-
function
|
|
9629
|
+
var assign2 = Object.assign;
|
|
9630
|
+
function get2(key) {
|
|
9613
9631
|
return key._reactInternals;
|
|
9614
9632
|
}
|
|
9615
|
-
function
|
|
9633
|
+
function set2(key, value) {
|
|
9616
9634
|
key._reactInternals = value;
|
|
9617
9635
|
}
|
|
9618
9636
|
var enableNewReconciler = false;
|
|
@@ -9884,7 +9902,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
9884
9902
|
instance._warnedAboutRefsInRender = true;
|
|
9885
9903
|
}
|
|
9886
9904
|
}
|
|
9887
|
-
var fiber =
|
|
9905
|
+
var fiber = get2(component);
|
|
9888
9906
|
if (!fiber) {
|
|
9889
9907
|
return false;
|
|
9890
9908
|
}
|
|
@@ -10032,7 +10050,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
10032
10050
|
return null;
|
|
10033
10051
|
}
|
|
10034
10052
|
var isArrayImpl = Array.isArray;
|
|
10035
|
-
function
|
|
10053
|
+
function isArray2(a3) {
|
|
10036
10054
|
return isArrayImpl(a3);
|
|
10037
10055
|
}
|
|
10038
10056
|
var getPublicInstance = $$$hostConfig.getPublicInstance;
|
|
@@ -10178,25 +10196,25 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
10178
10196
|
writable: true
|
|
10179
10197
|
};
|
|
10180
10198
|
Object.defineProperties(console, {
|
|
10181
|
-
log:
|
|
10199
|
+
log: assign2({}, props, {
|
|
10182
10200
|
value: prevLog
|
|
10183
10201
|
}),
|
|
10184
|
-
info:
|
|
10202
|
+
info: assign2({}, props, {
|
|
10185
10203
|
value: prevInfo
|
|
10186
10204
|
}),
|
|
10187
|
-
warn:
|
|
10205
|
+
warn: assign2({}, props, {
|
|
10188
10206
|
value: prevWarn
|
|
10189
10207
|
}),
|
|
10190
|
-
error:
|
|
10208
|
+
error: assign2({}, props, {
|
|
10191
10209
|
value: prevError
|
|
10192
10210
|
}),
|
|
10193
|
-
group:
|
|
10211
|
+
group: assign2({}, props, {
|
|
10194
10212
|
value: prevGroup
|
|
10195
10213
|
}),
|
|
10196
|
-
groupCollapsed:
|
|
10214
|
+
groupCollapsed: assign2({}, props, {
|
|
10197
10215
|
value: prevGroupCollapsed
|
|
10198
10216
|
}),
|
|
10199
|
-
groupEnd:
|
|
10217
|
+
groupEnd: assign2({}, props, {
|
|
10200
10218
|
value: prevGroupEnd
|
|
10201
10219
|
})
|
|
10202
10220
|
});
|
|
@@ -10281,9 +10299,9 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
10281
10299
|
}
|
|
10282
10300
|
fn();
|
|
10283
10301
|
}
|
|
10284
|
-
} catch (
|
|
10285
|
-
if (
|
|
10286
|
-
var sampleLines =
|
|
10302
|
+
} catch (sample2) {
|
|
10303
|
+
if (sample2 && control && typeof sample2.stack === "string") {
|
|
10304
|
+
var sampleLines = sample2.stack.split(`
|
|
10287
10305
|
`);
|
|
10288
10306
|
var controlLines = control.stack.split(`
|
|
10289
10307
|
`);
|
|
@@ -10398,11 +10416,11 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
10398
10416
|
}
|
|
10399
10417
|
}
|
|
10400
10418
|
}
|
|
10401
|
-
function checkPropTypes(typeSpecs,
|
|
10419
|
+
function checkPropTypes(typeSpecs, values2, location, componentName, element) {
|
|
10402
10420
|
{
|
|
10403
|
-
var
|
|
10421
|
+
var has2 = Function.call.bind(hasOwnProperty);
|
|
10404
10422
|
for (var typeSpecName in typeSpecs) {
|
|
10405
|
-
if (
|
|
10423
|
+
if (has2(typeSpecs, typeSpecName)) {
|
|
10406
10424
|
var error$1 = undefined;
|
|
10407
10425
|
try {
|
|
10408
10426
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
@@ -10410,7 +10428,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
10410
10428
|
err.name = "Invariant Violation";
|
|
10411
10429
|
throw err;
|
|
10412
10430
|
}
|
|
10413
|
-
error$1 = typeSpecs[typeSpecName](
|
|
10431
|
+
error$1 = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
10414
10432
|
} catch (ex) {
|
|
10415
10433
|
error$1 = ex;
|
|
10416
10434
|
}
|
|
@@ -10574,7 +10592,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
10574
10592
|
var name = getComponentNameFromFiber(fiber) || "Unknown";
|
|
10575
10593
|
checkPropTypes(childContextTypes, childContext, "child context", name);
|
|
10576
10594
|
}
|
|
10577
|
-
return
|
|
10595
|
+
return assign2({}, parentContext, childContext);
|
|
10578
10596
|
}
|
|
10579
10597
|
}
|
|
10580
10598
|
function pushContextProvider(workInProgress2) {
|
|
@@ -10982,14 +11000,14 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
10982
11000
|
function includesSomeLane(a3, b3) {
|
|
10983
11001
|
return (a3 & b3) !== NoLanes;
|
|
10984
11002
|
}
|
|
10985
|
-
function isSubsetOfLanes(
|
|
10986
|
-
return (
|
|
11003
|
+
function isSubsetOfLanes(set3, subset) {
|
|
11004
|
+
return (set3 & subset) === subset;
|
|
10987
11005
|
}
|
|
10988
11006
|
function mergeLanes(a3, b3) {
|
|
10989
11007
|
return a3 | b3;
|
|
10990
11008
|
}
|
|
10991
|
-
function removeLanes(
|
|
10992
|
-
return
|
|
11009
|
+
function removeLanes(set3, subset) {
|
|
11010
|
+
return set3 & ~subset;
|
|
10993
11011
|
}
|
|
10994
11012
|
function intersectLanes(a3, b3) {
|
|
10995
11013
|
return a3 & b3;
|
|
@@ -11000,10 +11018,10 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
11000
11018
|
function higherPriorityLane(a3, b3) {
|
|
11001
11019
|
return a3 !== NoLane && a3 < b3 ? a3 : b3;
|
|
11002
11020
|
}
|
|
11003
|
-
function createLaneMap(
|
|
11021
|
+
function createLaneMap(initial2) {
|
|
11004
11022
|
var laneMap = [];
|
|
11005
11023
|
for (var i = 0;i < TotalLanes; i++) {
|
|
11006
|
-
laneMap.push(
|
|
11024
|
+
laneMap.push(initial2);
|
|
11007
11025
|
}
|
|
11008
11026
|
return laneMap;
|
|
11009
11027
|
}
|
|
@@ -11197,7 +11215,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
11197
11215
|
var cancelCallback = Scheduler.unstable_cancelCallback;
|
|
11198
11216
|
var shouldYield = Scheduler.unstable_shouldYield;
|
|
11199
11217
|
var requestPaint = Scheduler.unstable_requestPaint;
|
|
11200
|
-
var
|
|
11218
|
+
var now2 = Scheduler.unstable_now;
|
|
11201
11219
|
var ImmediatePriority = Scheduler.unstable_ImmediatePriority;
|
|
11202
11220
|
var UserBlockingPriority = Scheduler.unstable_UserBlockingPriority;
|
|
11203
11221
|
var NormalPriority = Scheduler.unstable_NormalPriority;
|
|
@@ -11225,7 +11243,7 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
11225
11243
|
}
|
|
11226
11244
|
try {
|
|
11227
11245
|
if (enableSchedulingProfiler) {
|
|
11228
|
-
internals =
|
|
11246
|
+
internals = assign2({}, internals, {
|
|
11229
11247
|
getLaneLabelMap,
|
|
11230
11248
|
injectProfilingHooks
|
|
11231
11249
|
});
|
|
@@ -11347,14 +11365,14 @@ var require_react_reconciler_development = __commonJS((exports, module) => {
|
|
|
11347
11365
|
}
|
|
11348
11366
|
function getLaneLabelMap() {
|
|
11349
11367
|
{
|
|
11350
|
-
var
|
|
11368
|
+
var map2 = new Map;
|
|
11351
11369
|
var lane = 1;
|
|
11352
11370
|
for (var index2 = 0;index2 < TotalLanes; index2++) {
|
|
11353
11371
|
var label = getLabelForLane(lane);
|
|
11354
|
-
|
|
11372
|
+
map2.set(lane, label);
|
|
11355
11373
|
lane *= 2;
|
|
11356
11374
|
}
|
|
11357
|
-
return
|
|
11375
|
+
return map2;
|
|
11358
11376
|
}
|
|
11359
11377
|
}
|
|
11360
11378
|
function markCommitStarted(lanes) {
|
|
@@ -12220,9 +12238,9 @@ Error generating stack: ` + x3.message + `
|
|
|
12220
12238
|
}
|
|
12221
12239
|
return maybeStrictRoot;
|
|
12222
12240
|
};
|
|
12223
|
-
var setToSortedString = function(
|
|
12241
|
+
var setToSortedString = function(set3) {
|
|
12224
12242
|
var array = [];
|
|
12225
|
-
|
|
12243
|
+
set3.forEach(function(value) {
|
|
12226
12244
|
array.push(value);
|
|
12227
12245
|
});
|
|
12228
12246
|
return array.sort().join(", ");
|
|
@@ -12600,10 +12618,10 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
12600
12618
|
return existingChildren;
|
|
12601
12619
|
}
|
|
12602
12620
|
function useFiber(fiber, pendingProps) {
|
|
12603
|
-
var
|
|
12604
|
-
|
|
12605
|
-
|
|
12606
|
-
return
|
|
12621
|
+
var clone2 = createWorkInProgress(fiber, pendingProps);
|
|
12622
|
+
clone2.index = 0;
|
|
12623
|
+
clone2.sibling = null;
|
|
12624
|
+
return clone2;
|
|
12607
12625
|
}
|
|
12608
12626
|
function placeChild(newFiber, lastPlacedIndex, newIndex) {
|
|
12609
12627
|
newFiber.index = newIndex;
|
|
@@ -12711,7 +12729,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
12711
12729
|
return createChild(returnFiber, init(payload), lanes);
|
|
12712
12730
|
}
|
|
12713
12731
|
}
|
|
12714
|
-
if (
|
|
12732
|
+
if (isArray2(newChild) || getIteratorFn(newChild)) {
|
|
12715
12733
|
var _created3 = createFiberFromFragment(newChild, returnFiber.mode, lanes, null);
|
|
12716
12734
|
_created3.return = returnFiber;
|
|
12717
12735
|
return _created3;
|
|
@@ -12755,7 +12773,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
12755
12773
|
return updateSlot(returnFiber, oldFiber, init(payload), lanes);
|
|
12756
12774
|
}
|
|
12757
12775
|
}
|
|
12758
|
-
if (
|
|
12776
|
+
if (isArray2(newChild) || getIteratorFn(newChild)) {
|
|
12759
12777
|
if (key !== null) {
|
|
12760
12778
|
return null;
|
|
12761
12779
|
}
|
|
@@ -12790,7 +12808,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
12790
12808
|
var init = newChild._init;
|
|
12791
12809
|
return updateFromMap(existingChildren, returnFiber, newIdx, init(payload), lanes);
|
|
12792
12810
|
}
|
|
12793
|
-
if (
|
|
12811
|
+
if (isArray2(newChild) || getIteratorFn(newChild)) {
|
|
12794
12812
|
var _matchedFiber3 = existingChildren.get(newIdx) || null;
|
|
12795
12813
|
return updateFragment2(returnFiber, _matchedFiber3, newChild, lanes, null);
|
|
12796
12814
|
}
|
|
@@ -13158,7 +13176,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13158
13176
|
var init = newChild._init;
|
|
13159
13177
|
return reconcileChildFibers2(returnFiber, currentFirstChild, init(payload), lanes);
|
|
13160
13178
|
}
|
|
13161
|
-
if (
|
|
13179
|
+
if (isArray2(newChild)) {
|
|
13162
13180
|
return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, lanes);
|
|
13163
13181
|
}
|
|
13164
13182
|
if (getIteratorFn(newChild)) {
|
|
@@ -13309,8 +13327,8 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13309
13327
|
if (dependency.context === context) {
|
|
13310
13328
|
if (fiber.tag === ClassComponent) {
|
|
13311
13329
|
var lane = pickArbitraryLane(renderLanes2);
|
|
13312
|
-
var
|
|
13313
|
-
|
|
13330
|
+
var update2 = createUpdate(NoTimestamp, lane);
|
|
13331
|
+
update2.tag = ForceUpdate;
|
|
13314
13332
|
var updateQueue = fiber.updateQueue;
|
|
13315
13333
|
if (updateQueue === null)
|
|
13316
13334
|
;
|
|
@@ -13318,12 +13336,12 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13318
13336
|
var sharedQueue = updateQueue.shared;
|
|
13319
13337
|
var pending = sharedQueue.pending;
|
|
13320
13338
|
if (pending === null) {
|
|
13321
|
-
|
|
13339
|
+
update2.next = update2;
|
|
13322
13340
|
} else {
|
|
13323
|
-
|
|
13324
|
-
pending.next =
|
|
13341
|
+
update2.next = pending.next;
|
|
13342
|
+
pending.next = update2;
|
|
13325
13343
|
}
|
|
13326
|
-
sharedQueue.pending =
|
|
13344
|
+
sharedQueue.pending = update2;
|
|
13327
13345
|
}
|
|
13328
13346
|
}
|
|
13329
13347
|
fiber.lanes = mergeLanes(fiber.lanes, renderLanes2);
|
|
@@ -13450,39 +13468,39 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13450
13468
|
concurrentQueues = null;
|
|
13451
13469
|
}
|
|
13452
13470
|
}
|
|
13453
|
-
function enqueueConcurrentHookUpdate(fiber, queue,
|
|
13471
|
+
function enqueueConcurrentHookUpdate(fiber, queue, update2, lane) {
|
|
13454
13472
|
var interleaved = queue.interleaved;
|
|
13455
13473
|
if (interleaved === null) {
|
|
13456
|
-
|
|
13474
|
+
update2.next = update2;
|
|
13457
13475
|
pushConcurrentUpdateQueue(queue);
|
|
13458
13476
|
} else {
|
|
13459
|
-
|
|
13460
|
-
interleaved.next =
|
|
13477
|
+
update2.next = interleaved.next;
|
|
13478
|
+
interleaved.next = update2;
|
|
13461
13479
|
}
|
|
13462
|
-
queue.interleaved =
|
|
13480
|
+
queue.interleaved = update2;
|
|
13463
13481
|
return markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
13464
13482
|
}
|
|
13465
|
-
function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue,
|
|
13483
|
+
function enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update2, lane) {
|
|
13466
13484
|
var interleaved = queue.interleaved;
|
|
13467
13485
|
if (interleaved === null) {
|
|
13468
|
-
|
|
13486
|
+
update2.next = update2;
|
|
13469
13487
|
pushConcurrentUpdateQueue(queue);
|
|
13470
13488
|
} else {
|
|
13471
|
-
|
|
13472
|
-
interleaved.next =
|
|
13489
|
+
update2.next = interleaved.next;
|
|
13490
|
+
interleaved.next = update2;
|
|
13473
13491
|
}
|
|
13474
|
-
queue.interleaved =
|
|
13492
|
+
queue.interleaved = update2;
|
|
13475
13493
|
}
|
|
13476
|
-
function enqueueConcurrentClassUpdate(fiber, queue,
|
|
13494
|
+
function enqueueConcurrentClassUpdate(fiber, queue, update2, lane) {
|
|
13477
13495
|
var interleaved = queue.interleaved;
|
|
13478
13496
|
if (interleaved === null) {
|
|
13479
|
-
|
|
13497
|
+
update2.next = update2;
|
|
13480
13498
|
pushConcurrentUpdateQueue(queue);
|
|
13481
13499
|
} else {
|
|
13482
|
-
|
|
13483
|
-
interleaved.next =
|
|
13500
|
+
update2.next = interleaved.next;
|
|
13501
|
+
interleaved.next = update2;
|
|
13484
13502
|
}
|
|
13485
|
-
queue.interleaved =
|
|
13503
|
+
queue.interleaved = update2;
|
|
13486
13504
|
return markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
13487
13505
|
}
|
|
13488
13506
|
function enqueueConcurrentRenderForLane(fiber, lane) {
|
|
@@ -13553,18 +13571,18 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13553
13571
|
var queue = workInProgress2.updateQueue;
|
|
13554
13572
|
var currentQueue = current2.updateQueue;
|
|
13555
13573
|
if (queue === currentQueue) {
|
|
13556
|
-
var
|
|
13574
|
+
var clone2 = {
|
|
13557
13575
|
baseState: currentQueue.baseState,
|
|
13558
13576
|
firstBaseUpdate: currentQueue.firstBaseUpdate,
|
|
13559
13577
|
lastBaseUpdate: currentQueue.lastBaseUpdate,
|
|
13560
13578
|
shared: currentQueue.shared,
|
|
13561
13579
|
effects: currentQueue.effects
|
|
13562
13580
|
};
|
|
13563
|
-
workInProgress2.updateQueue =
|
|
13581
|
+
workInProgress2.updateQueue = clone2;
|
|
13564
13582
|
}
|
|
13565
13583
|
}
|
|
13566
13584
|
function createUpdate(eventTime, lane) {
|
|
13567
|
-
var
|
|
13585
|
+
var update2 = {
|
|
13568
13586
|
eventTime,
|
|
13569
13587
|
lane,
|
|
13570
13588
|
tag: UpdateState,
|
|
@@ -13572,9 +13590,9 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13572
13590
|
callback: null,
|
|
13573
13591
|
next: null
|
|
13574
13592
|
};
|
|
13575
|
-
return
|
|
13593
|
+
return update2;
|
|
13576
13594
|
}
|
|
13577
|
-
function enqueueUpdate(fiber,
|
|
13595
|
+
function enqueueUpdate(fiber, update2, lane) {
|
|
13578
13596
|
var updateQueue = fiber.updateQueue;
|
|
13579
13597
|
if (updateQueue === null) {
|
|
13580
13598
|
return null;
|
|
@@ -13589,15 +13607,15 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13589
13607
|
if (isUnsafeClassRenderPhaseUpdate()) {
|
|
13590
13608
|
var pending = sharedQueue.pending;
|
|
13591
13609
|
if (pending === null) {
|
|
13592
|
-
|
|
13610
|
+
update2.next = update2;
|
|
13593
13611
|
} else {
|
|
13594
|
-
|
|
13595
|
-
pending.next =
|
|
13612
|
+
update2.next = pending.next;
|
|
13613
|
+
pending.next = update2;
|
|
13596
13614
|
}
|
|
13597
|
-
sharedQueue.pending =
|
|
13615
|
+
sharedQueue.pending = update2;
|
|
13598
13616
|
return unsafe_markUpdateLaneFromFiberToRoot(fiber, lane);
|
|
13599
13617
|
} else {
|
|
13600
|
-
return enqueueConcurrentClassUpdate(fiber, sharedQueue,
|
|
13618
|
+
return enqueueConcurrentClassUpdate(fiber, sharedQueue, update2, lane);
|
|
13601
13619
|
}
|
|
13602
13620
|
}
|
|
13603
13621
|
function entangleTransitions(root, fiber, lane) {
|
|
@@ -13624,24 +13642,24 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13624
13642
|
var newLast = null;
|
|
13625
13643
|
var firstBaseUpdate = queue.firstBaseUpdate;
|
|
13626
13644
|
if (firstBaseUpdate !== null) {
|
|
13627
|
-
var
|
|
13645
|
+
var update2 = firstBaseUpdate;
|
|
13628
13646
|
do {
|
|
13629
|
-
var
|
|
13630
|
-
eventTime:
|
|
13631
|
-
lane:
|
|
13632
|
-
tag:
|
|
13633
|
-
payload:
|
|
13634
|
-
callback:
|
|
13647
|
+
var clone2 = {
|
|
13648
|
+
eventTime: update2.eventTime,
|
|
13649
|
+
lane: update2.lane,
|
|
13650
|
+
tag: update2.tag,
|
|
13651
|
+
payload: update2.payload,
|
|
13652
|
+
callback: update2.callback,
|
|
13635
13653
|
next: null
|
|
13636
13654
|
};
|
|
13637
13655
|
if (newLast === null) {
|
|
13638
|
-
newFirst = newLast =
|
|
13656
|
+
newFirst = newLast = clone2;
|
|
13639
13657
|
} else {
|
|
13640
|
-
newLast.next =
|
|
13641
|
-
newLast =
|
|
13658
|
+
newLast.next = clone2;
|
|
13659
|
+
newLast = clone2;
|
|
13642
13660
|
}
|
|
13643
|
-
|
|
13644
|
-
} while (
|
|
13661
|
+
update2 = update2.next;
|
|
13662
|
+
} while (update2 !== null);
|
|
13645
13663
|
if (newLast === null) {
|
|
13646
13664
|
newFirst = newLast = capturedUpdate;
|
|
13647
13665
|
} else {
|
|
@@ -13670,10 +13688,10 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13670
13688
|
}
|
|
13671
13689
|
queue.lastBaseUpdate = capturedUpdate;
|
|
13672
13690
|
}
|
|
13673
|
-
function getStateFromUpdate(workInProgress2, queue,
|
|
13674
|
-
switch (
|
|
13691
|
+
function getStateFromUpdate(workInProgress2, queue, update2, prevState, nextProps, instance) {
|
|
13692
|
+
switch (update2.tag) {
|
|
13675
13693
|
case ReplaceState: {
|
|
13676
|
-
var payload =
|
|
13694
|
+
var payload = update2.payload;
|
|
13677
13695
|
if (typeof payload === "function") {
|
|
13678
13696
|
{
|
|
13679
13697
|
enterDisallowedContextReadInDEV();
|
|
@@ -13698,7 +13716,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13698
13716
|
workInProgress2.flags = workInProgress2.flags & ~ShouldCapture | DidCapture;
|
|
13699
13717
|
}
|
|
13700
13718
|
case UpdateState: {
|
|
13701
|
-
var _payload =
|
|
13719
|
+
var _payload = update2.payload;
|
|
13702
13720
|
var partialState;
|
|
13703
13721
|
if (typeof _payload === "function") {
|
|
13704
13722
|
{
|
|
@@ -13722,7 +13740,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13722
13740
|
if (partialState === null || partialState === undefined) {
|
|
13723
13741
|
return prevState;
|
|
13724
13742
|
}
|
|
13725
|
-
return
|
|
13743
|
+
return assign2({}, prevState, partialState);
|
|
13726
13744
|
}
|
|
13727
13745
|
case ForceUpdate: {
|
|
13728
13746
|
hasForceUpdate = true;
|
|
@@ -13771,24 +13789,24 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13771
13789
|
var newBaseState = null;
|
|
13772
13790
|
var newFirstBaseUpdate = null;
|
|
13773
13791
|
var newLastBaseUpdate = null;
|
|
13774
|
-
var
|
|
13792
|
+
var update2 = firstBaseUpdate;
|
|
13775
13793
|
do {
|
|
13776
|
-
var updateLane =
|
|
13777
|
-
var updateEventTime =
|
|
13794
|
+
var updateLane = update2.lane;
|
|
13795
|
+
var updateEventTime = update2.eventTime;
|
|
13778
13796
|
if (!isSubsetOfLanes(renderLanes2, updateLane)) {
|
|
13779
|
-
var
|
|
13797
|
+
var clone2 = {
|
|
13780
13798
|
eventTime: updateEventTime,
|
|
13781
13799
|
lane: updateLane,
|
|
13782
|
-
tag:
|
|
13783
|
-
payload:
|
|
13784
|
-
callback:
|
|
13800
|
+
tag: update2.tag,
|
|
13801
|
+
payload: update2.payload,
|
|
13802
|
+
callback: update2.callback,
|
|
13785
13803
|
next: null
|
|
13786
13804
|
};
|
|
13787
13805
|
if (newLastBaseUpdate === null) {
|
|
13788
|
-
newFirstBaseUpdate = newLastBaseUpdate =
|
|
13806
|
+
newFirstBaseUpdate = newLastBaseUpdate = clone2;
|
|
13789
13807
|
newBaseState = newState;
|
|
13790
13808
|
} else {
|
|
13791
|
-
newLastBaseUpdate = newLastBaseUpdate.next =
|
|
13809
|
+
newLastBaseUpdate = newLastBaseUpdate.next = clone2;
|
|
13792
13810
|
}
|
|
13793
13811
|
newLanes = mergeLanes(newLanes, updateLane);
|
|
13794
13812
|
} else {
|
|
@@ -13796,27 +13814,27 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13796
13814
|
var _clone = {
|
|
13797
13815
|
eventTime: updateEventTime,
|
|
13798
13816
|
lane: NoLane,
|
|
13799
|
-
tag:
|
|
13800
|
-
payload:
|
|
13801
|
-
callback:
|
|
13817
|
+
tag: update2.tag,
|
|
13818
|
+
payload: update2.payload,
|
|
13819
|
+
callback: update2.callback,
|
|
13802
13820
|
next: null
|
|
13803
13821
|
};
|
|
13804
13822
|
newLastBaseUpdate = newLastBaseUpdate.next = _clone;
|
|
13805
13823
|
}
|
|
13806
|
-
newState = getStateFromUpdate(workInProgress2, queue,
|
|
13807
|
-
var callback =
|
|
13808
|
-
if (callback !== null &&
|
|
13824
|
+
newState = getStateFromUpdate(workInProgress2, queue, update2, newState, props, instance);
|
|
13825
|
+
var callback = update2.callback;
|
|
13826
|
+
if (callback !== null && update2.lane !== NoLane) {
|
|
13809
13827
|
workInProgress2.flags |= Callback;
|
|
13810
13828
|
var effects = queue.effects;
|
|
13811
13829
|
if (effects === null) {
|
|
13812
|
-
queue.effects = [
|
|
13830
|
+
queue.effects = [update2];
|
|
13813
13831
|
} else {
|
|
13814
|
-
effects.push(
|
|
13832
|
+
effects.push(update2);
|
|
13815
13833
|
}
|
|
13816
13834
|
}
|
|
13817
13835
|
}
|
|
13818
|
-
|
|
13819
|
-
if (
|
|
13836
|
+
update2 = update2.next;
|
|
13837
|
+
if (update2 === null) {
|
|
13820
13838
|
pendingQueue = queue.shared.pending;
|
|
13821
13839
|
if (pendingQueue === null) {
|
|
13822
13840
|
break;
|
|
@@ -13824,7 +13842,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
13824
13842
|
var _lastPendingUpdate = pendingQueue;
|
|
13825
13843
|
var _firstPendingUpdate = _lastPendingUpdate.next;
|
|
13826
13844
|
_lastPendingUpdate.next = null;
|
|
13827
|
-
|
|
13845
|
+
update2 = _firstPendingUpdate;
|
|
13828
13846
|
queue.lastBaseUpdate = _lastPendingUpdate;
|
|
13829
13847
|
queue.shared.pending = null;
|
|
13830
13848
|
}
|
|
@@ -14067,7 +14085,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14067
14085
|
}
|
|
14068
14086
|
function checkDepsAreArrayDev(deps) {
|
|
14069
14087
|
{
|
|
14070
|
-
if (deps !== undefined && deps !== null && !
|
|
14088
|
+
if (deps !== undefined && deps !== null && !isArray2(deps)) {
|
|
14071
14089
|
error("%s received a final argument that is not an array (instead, received `%s`). When " + "specified, the final argument must be an array.", currentHookNameInDev, typeof deps);
|
|
14072
14090
|
}
|
|
14073
14091
|
}
|
|
@@ -14360,22 +14378,22 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14360
14378
|
var newBaseState = null;
|
|
14361
14379
|
var newBaseQueueFirst = null;
|
|
14362
14380
|
var newBaseQueueLast = null;
|
|
14363
|
-
var
|
|
14381
|
+
var update2 = first;
|
|
14364
14382
|
do {
|
|
14365
|
-
var updateLane =
|
|
14383
|
+
var updateLane = update2.lane;
|
|
14366
14384
|
if (!isSubsetOfLanes(renderLanes, updateLane)) {
|
|
14367
|
-
var
|
|
14385
|
+
var clone2 = {
|
|
14368
14386
|
lane: updateLane,
|
|
14369
|
-
action:
|
|
14370
|
-
hasEagerState:
|
|
14371
|
-
eagerState:
|
|
14387
|
+
action: update2.action,
|
|
14388
|
+
hasEagerState: update2.hasEagerState,
|
|
14389
|
+
eagerState: update2.eagerState,
|
|
14372
14390
|
next: null
|
|
14373
14391
|
};
|
|
14374
14392
|
if (newBaseQueueLast === null) {
|
|
14375
|
-
newBaseQueueFirst = newBaseQueueLast =
|
|
14393
|
+
newBaseQueueFirst = newBaseQueueLast = clone2;
|
|
14376
14394
|
newBaseState = newState;
|
|
14377
14395
|
} else {
|
|
14378
|
-
newBaseQueueLast = newBaseQueueLast.next =
|
|
14396
|
+
newBaseQueueLast = newBaseQueueLast.next = clone2;
|
|
14379
14397
|
}
|
|
14380
14398
|
currentlyRenderingFiber$1.lanes = mergeLanes(currentlyRenderingFiber$1.lanes, updateLane);
|
|
14381
14399
|
markSkippedUpdateLanes(updateLane);
|
|
@@ -14383,22 +14401,22 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14383
14401
|
if (newBaseQueueLast !== null) {
|
|
14384
14402
|
var _clone = {
|
|
14385
14403
|
lane: NoLane,
|
|
14386
|
-
action:
|
|
14387
|
-
hasEagerState:
|
|
14388
|
-
eagerState:
|
|
14404
|
+
action: update2.action,
|
|
14405
|
+
hasEagerState: update2.hasEagerState,
|
|
14406
|
+
eagerState: update2.eagerState,
|
|
14389
14407
|
next: null
|
|
14390
14408
|
};
|
|
14391
14409
|
newBaseQueueLast = newBaseQueueLast.next = _clone;
|
|
14392
14410
|
}
|
|
14393
|
-
if (
|
|
14394
|
-
newState =
|
|
14411
|
+
if (update2.hasEagerState) {
|
|
14412
|
+
newState = update2.eagerState;
|
|
14395
14413
|
} else {
|
|
14396
|
-
var action =
|
|
14414
|
+
var action = update2.action;
|
|
14397
14415
|
newState = reducer(newState, action);
|
|
14398
14416
|
}
|
|
14399
14417
|
}
|
|
14400
|
-
|
|
14401
|
-
} while (
|
|
14418
|
+
update2 = update2.next;
|
|
14419
|
+
} while (update2 !== null && update2 !== first);
|
|
14402
14420
|
if (newBaseQueueLast === null) {
|
|
14403
14421
|
newBaseState = newState;
|
|
14404
14422
|
} else {
|
|
@@ -14440,12 +14458,12 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14440
14458
|
if (lastRenderPhaseUpdate !== null) {
|
|
14441
14459
|
queue.pending = null;
|
|
14442
14460
|
var firstRenderPhaseUpdate = lastRenderPhaseUpdate.next;
|
|
14443
|
-
var
|
|
14461
|
+
var update2 = firstRenderPhaseUpdate;
|
|
14444
14462
|
do {
|
|
14445
|
-
var action =
|
|
14463
|
+
var action = update2.action;
|
|
14446
14464
|
newState = reducer(newState, action);
|
|
14447
|
-
|
|
14448
|
-
} while (
|
|
14465
|
+
update2 = update2.next;
|
|
14466
|
+
} while (update2 !== firstRenderPhaseUpdate);
|
|
14449
14467
|
if (!objectIs(newState, hook.memoizedState)) {
|
|
14450
14468
|
markWorkInProgressReceivedUpdate();
|
|
14451
14469
|
}
|
|
@@ -14624,10 +14642,10 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14624
14642
|
function rerenderState(initialState) {
|
|
14625
14643
|
return rerenderReducer(basicStateReducer);
|
|
14626
14644
|
}
|
|
14627
|
-
function pushEffect(tag,
|
|
14645
|
+
function pushEffect(tag, create2, destroy, deps) {
|
|
14628
14646
|
var effect = {
|
|
14629
14647
|
tag,
|
|
14630
|
-
create,
|
|
14648
|
+
create: create2,
|
|
14631
14649
|
destroy,
|
|
14632
14650
|
deps,
|
|
14633
14651
|
next: null
|
|
@@ -14664,13 +14682,13 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14664
14682
|
var hook = updateWorkInProgressHook();
|
|
14665
14683
|
return hook.memoizedState;
|
|
14666
14684
|
}
|
|
14667
|
-
function mountEffectImpl(fiberFlags, hookFlags,
|
|
14685
|
+
function mountEffectImpl(fiberFlags, hookFlags, create2, deps) {
|
|
14668
14686
|
var hook = mountWorkInProgressHook();
|
|
14669
14687
|
var nextDeps = deps === undefined ? null : deps;
|
|
14670
14688
|
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
14671
|
-
hook.memoizedState = pushEffect(HasEffect | hookFlags,
|
|
14689
|
+
hook.memoizedState = pushEffect(HasEffect | hookFlags, create2, undefined, nextDeps);
|
|
14672
14690
|
}
|
|
14673
|
-
function updateEffectImpl(fiberFlags, hookFlags,
|
|
14691
|
+
function updateEffectImpl(fiberFlags, hookFlags, create2, deps) {
|
|
14674
14692
|
var hook = updateWorkInProgressHook();
|
|
14675
14693
|
var nextDeps = deps === undefined ? null : deps;
|
|
14676
14694
|
var destroy = undefined;
|
|
@@ -14680,31 +14698,31 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14680
14698
|
if (nextDeps !== null) {
|
|
14681
14699
|
var prevDeps = prevEffect.deps;
|
|
14682
14700
|
if (areHookInputsEqual(nextDeps, prevDeps)) {
|
|
14683
|
-
hook.memoizedState = pushEffect(hookFlags,
|
|
14701
|
+
hook.memoizedState = pushEffect(hookFlags, create2, destroy, nextDeps);
|
|
14684
14702
|
return;
|
|
14685
14703
|
}
|
|
14686
14704
|
}
|
|
14687
14705
|
}
|
|
14688
14706
|
currentlyRenderingFiber$1.flags |= fiberFlags;
|
|
14689
|
-
hook.memoizedState = pushEffect(HasEffect | hookFlags,
|
|
14707
|
+
hook.memoizedState = pushEffect(HasEffect | hookFlags, create2, destroy, nextDeps);
|
|
14690
14708
|
}
|
|
14691
|
-
function mountEffect(
|
|
14709
|
+
function mountEffect(create2, deps) {
|
|
14692
14710
|
if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
|
|
14693
|
-
return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1,
|
|
14711
|
+
return mountEffectImpl(MountPassiveDev | Passive | PassiveStatic, Passive$1, create2, deps);
|
|
14694
14712
|
} else {
|
|
14695
|
-
return mountEffectImpl(Passive | PassiveStatic, Passive$1,
|
|
14713
|
+
return mountEffectImpl(Passive | PassiveStatic, Passive$1, create2, deps);
|
|
14696
14714
|
}
|
|
14697
14715
|
}
|
|
14698
|
-
function updateEffect(
|
|
14699
|
-
return updateEffectImpl(Passive, Passive$1,
|
|
14716
|
+
function updateEffect(create2, deps) {
|
|
14717
|
+
return updateEffectImpl(Passive, Passive$1, create2, deps);
|
|
14700
14718
|
}
|
|
14701
|
-
function mountInsertionEffect(
|
|
14702
|
-
return mountEffectImpl(Update, Insertion,
|
|
14719
|
+
function mountInsertionEffect(create2, deps) {
|
|
14720
|
+
return mountEffectImpl(Update, Insertion, create2, deps);
|
|
14703
14721
|
}
|
|
14704
|
-
function updateInsertionEffect(
|
|
14705
|
-
return updateEffectImpl(Update, Insertion,
|
|
14722
|
+
function updateInsertionEffect(create2, deps) {
|
|
14723
|
+
return updateEffectImpl(Update, Insertion, create2, deps);
|
|
14706
14724
|
}
|
|
14707
|
-
function mountLayoutEffect(
|
|
14725
|
+
function mountLayoutEffect(create2, deps) {
|
|
14708
14726
|
var fiberFlags = Update;
|
|
14709
14727
|
{
|
|
14710
14728
|
fiberFlags |= LayoutStatic;
|
|
@@ -14712,15 +14730,15 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14712
14730
|
if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
|
|
14713
14731
|
fiberFlags |= MountLayoutDev;
|
|
14714
14732
|
}
|
|
14715
|
-
return mountEffectImpl(fiberFlags, Layout,
|
|
14733
|
+
return mountEffectImpl(fiberFlags, Layout, create2, deps);
|
|
14716
14734
|
}
|
|
14717
|
-
function updateLayoutEffect(
|
|
14718
|
-
return updateEffectImpl(Update, Layout,
|
|
14735
|
+
function updateLayoutEffect(create2, deps) {
|
|
14736
|
+
return updateEffectImpl(Update, Layout, create2, deps);
|
|
14719
14737
|
}
|
|
14720
|
-
function imperativeHandleEffect(
|
|
14738
|
+
function imperativeHandleEffect(create2, ref) {
|
|
14721
14739
|
if (typeof ref === "function") {
|
|
14722
14740
|
var refCallback = ref;
|
|
14723
|
-
var _inst =
|
|
14741
|
+
var _inst = create2();
|
|
14724
14742
|
refCallback(_inst);
|
|
14725
14743
|
return function() {
|
|
14726
14744
|
refCallback(null);
|
|
@@ -14732,17 +14750,17 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14732
14750
|
error("Expected useImperativeHandle() first argument to either be a " + "ref callback or React.createRef() object. Instead received: %s.", "an object with keys {" + Object.keys(refObject).join(", ") + "}");
|
|
14733
14751
|
}
|
|
14734
14752
|
}
|
|
14735
|
-
var _inst2 =
|
|
14753
|
+
var _inst2 = create2();
|
|
14736
14754
|
refObject.current = _inst2;
|
|
14737
14755
|
return function() {
|
|
14738
14756
|
refObject.current = null;
|
|
14739
14757
|
};
|
|
14740
14758
|
}
|
|
14741
14759
|
}
|
|
14742
|
-
function mountImperativeHandle(ref,
|
|
14760
|
+
function mountImperativeHandle(ref, create2, deps) {
|
|
14743
14761
|
{
|
|
14744
|
-
if (typeof
|
|
14745
|
-
error("Expected useImperativeHandle() second argument to be a function " + "that creates a handle. Instead received: %s.",
|
|
14762
|
+
if (typeof create2 !== "function") {
|
|
14763
|
+
error("Expected useImperativeHandle() second argument to be a function " + "that creates a handle. Instead received: %s.", create2 !== null ? typeof create2 : "null");
|
|
14746
14764
|
}
|
|
14747
14765
|
}
|
|
14748
14766
|
var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
|
|
@@ -14753,16 +14771,16 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14753
14771
|
if ((currentlyRenderingFiber$1.mode & StrictEffectsMode) !== NoMode) {
|
|
14754
14772
|
fiberFlags |= MountLayoutDev;
|
|
14755
14773
|
}
|
|
14756
|
-
return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null,
|
|
14774
|
+
return mountEffectImpl(fiberFlags, Layout, imperativeHandleEffect.bind(null, create2, ref), effectDeps);
|
|
14757
14775
|
}
|
|
14758
|
-
function updateImperativeHandle(ref,
|
|
14776
|
+
function updateImperativeHandle(ref, create2, deps) {
|
|
14759
14777
|
{
|
|
14760
|
-
if (typeof
|
|
14761
|
-
error("Expected useImperativeHandle() second argument to be a function " + "that creates a handle. Instead received: %s.",
|
|
14778
|
+
if (typeof create2 !== "function") {
|
|
14779
|
+
error("Expected useImperativeHandle() second argument to be a function " + "that creates a handle. Instead received: %s.", create2 !== null ? typeof create2 : "null");
|
|
14762
14780
|
}
|
|
14763
14781
|
}
|
|
14764
14782
|
var effectDeps = deps !== null && deps !== undefined ? deps.concat([ref]) : null;
|
|
14765
|
-
return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null,
|
|
14783
|
+
return updateEffectImpl(Update, Layout, imperativeHandleEffect.bind(null, create2, ref), effectDeps);
|
|
14766
14784
|
}
|
|
14767
14785
|
function mountDebugValue(value, formatterFn) {}
|
|
14768
14786
|
var updateDebugValue = mountDebugValue;
|
|
@@ -14934,7 +14952,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14934
14952
|
}
|
|
14935
14953
|
}
|
|
14936
14954
|
var lane = requestUpdateLane(fiber);
|
|
14937
|
-
var
|
|
14955
|
+
var update2 = {
|
|
14938
14956
|
lane,
|
|
14939
14957
|
action,
|
|
14940
14958
|
hasEagerState: false,
|
|
@@ -14942,9 +14960,9 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14942
14960
|
next: null
|
|
14943
14961
|
};
|
|
14944
14962
|
if (isRenderPhaseUpdate(fiber)) {
|
|
14945
|
-
enqueueRenderPhaseUpdate(queue,
|
|
14963
|
+
enqueueRenderPhaseUpdate(queue, update2);
|
|
14946
14964
|
} else {
|
|
14947
|
-
var root = enqueueConcurrentHookUpdate(fiber, queue,
|
|
14965
|
+
var root = enqueueConcurrentHookUpdate(fiber, queue, update2, lane);
|
|
14948
14966
|
if (root !== null) {
|
|
14949
14967
|
var eventTime = requestEventTime();
|
|
14950
14968
|
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
|
|
@@ -14960,7 +14978,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14960
14978
|
}
|
|
14961
14979
|
}
|
|
14962
14980
|
var lane = requestUpdateLane(fiber);
|
|
14963
|
-
var
|
|
14981
|
+
var update2 = {
|
|
14964
14982
|
lane,
|
|
14965
14983
|
action,
|
|
14966
14984
|
hasEagerState: false,
|
|
@@ -14968,7 +14986,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14968
14986
|
next: null
|
|
14969
14987
|
};
|
|
14970
14988
|
if (isRenderPhaseUpdate(fiber)) {
|
|
14971
|
-
enqueueRenderPhaseUpdate(queue,
|
|
14989
|
+
enqueueRenderPhaseUpdate(queue, update2);
|
|
14972
14990
|
} else {
|
|
14973
14991
|
var alternate = fiber.alternate;
|
|
14974
14992
|
if (fiber.lanes === NoLanes && (alternate === null || alternate.lanes === NoLanes)) {
|
|
@@ -14982,10 +15000,10 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14982
15000
|
try {
|
|
14983
15001
|
var currentState = queue.lastRenderedState;
|
|
14984
15002
|
var eagerState = lastRenderedReducer(currentState, action);
|
|
14985
|
-
|
|
14986
|
-
|
|
15003
|
+
update2.hasEagerState = true;
|
|
15004
|
+
update2.eagerState = eagerState;
|
|
14987
15005
|
if (objectIs(eagerState, currentState)) {
|
|
14988
|
-
enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue,
|
|
15006
|
+
enqueueConcurrentHookUpdateAndEagerlyBailout(fiber, queue, update2, lane);
|
|
14989
15007
|
return;
|
|
14990
15008
|
}
|
|
14991
15009
|
} catch (error2) {} finally {
|
|
@@ -14995,7 +15013,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
14995
15013
|
}
|
|
14996
15014
|
}
|
|
14997
15015
|
}
|
|
14998
|
-
var root = enqueueConcurrentHookUpdate(fiber, queue,
|
|
15016
|
+
var root = enqueueConcurrentHookUpdate(fiber, queue, update2, lane);
|
|
14999
15017
|
if (root !== null) {
|
|
15000
15018
|
var eventTime = requestEventTime();
|
|
15001
15019
|
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
|
|
@@ -15008,16 +15026,16 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15008
15026
|
var alternate = fiber.alternate;
|
|
15009
15027
|
return fiber === currentlyRenderingFiber$1 || alternate !== null && alternate === currentlyRenderingFiber$1;
|
|
15010
15028
|
}
|
|
15011
|
-
function enqueueRenderPhaseUpdate(queue,
|
|
15029
|
+
function enqueueRenderPhaseUpdate(queue, update2) {
|
|
15012
15030
|
didScheduleRenderPhaseUpdateDuringThisPass = didScheduleRenderPhaseUpdate = true;
|
|
15013
15031
|
var pending = queue.pending;
|
|
15014
15032
|
if (pending === null) {
|
|
15015
|
-
|
|
15033
|
+
update2.next = update2;
|
|
15016
15034
|
} else {
|
|
15017
|
-
|
|
15018
|
-
pending.next =
|
|
15035
|
+
update2.next = pending.next;
|
|
15036
|
+
pending.next = update2;
|
|
15019
15037
|
}
|
|
15020
|
-
queue.pending =
|
|
15038
|
+
queue.pending = update2;
|
|
15021
15039
|
}
|
|
15022
15040
|
function entangleTransitionUpdate(root, queue, lane) {
|
|
15023
15041
|
if (isTransitionLane(lane)) {
|
|
@@ -15082,38 +15100,38 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15082
15100
|
mountHookTypesDev();
|
|
15083
15101
|
return readContext(context);
|
|
15084
15102
|
},
|
|
15085
|
-
useEffect: function(
|
|
15103
|
+
useEffect: function(create2, deps) {
|
|
15086
15104
|
currentHookNameInDev = "useEffect";
|
|
15087
15105
|
mountHookTypesDev();
|
|
15088
15106
|
checkDepsAreArrayDev(deps);
|
|
15089
|
-
return mountEffect(
|
|
15107
|
+
return mountEffect(create2, deps);
|
|
15090
15108
|
},
|
|
15091
|
-
useImperativeHandle: function(ref,
|
|
15109
|
+
useImperativeHandle: function(ref, create2, deps) {
|
|
15092
15110
|
currentHookNameInDev = "useImperativeHandle";
|
|
15093
15111
|
mountHookTypesDev();
|
|
15094
15112
|
checkDepsAreArrayDev(deps);
|
|
15095
|
-
return mountImperativeHandle(ref,
|
|
15113
|
+
return mountImperativeHandle(ref, create2, deps);
|
|
15096
15114
|
},
|
|
15097
|
-
useInsertionEffect: function(
|
|
15115
|
+
useInsertionEffect: function(create2, deps) {
|
|
15098
15116
|
currentHookNameInDev = "useInsertionEffect";
|
|
15099
15117
|
mountHookTypesDev();
|
|
15100
15118
|
checkDepsAreArrayDev(deps);
|
|
15101
|
-
return mountInsertionEffect(
|
|
15119
|
+
return mountInsertionEffect(create2, deps);
|
|
15102
15120
|
},
|
|
15103
|
-
useLayoutEffect: function(
|
|
15121
|
+
useLayoutEffect: function(create2, deps) {
|
|
15104
15122
|
currentHookNameInDev = "useLayoutEffect";
|
|
15105
15123
|
mountHookTypesDev();
|
|
15106
15124
|
checkDepsAreArrayDev(deps);
|
|
15107
|
-
return mountLayoutEffect(
|
|
15125
|
+
return mountLayoutEffect(create2, deps);
|
|
15108
15126
|
},
|
|
15109
|
-
useMemo: function(
|
|
15127
|
+
useMemo: function(create2, deps) {
|
|
15110
15128
|
currentHookNameInDev = "useMemo";
|
|
15111
15129
|
mountHookTypesDev();
|
|
15112
15130
|
checkDepsAreArrayDev(deps);
|
|
15113
15131
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
15114
15132
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
15115
15133
|
try {
|
|
15116
|
-
return mountMemo(
|
|
15134
|
+
return mountMemo(create2, deps);
|
|
15117
15135
|
} finally {
|
|
15118
15136
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
15119
15137
|
}
|
|
@@ -15191,33 +15209,33 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15191
15209
|
updateHookTypesDev();
|
|
15192
15210
|
return readContext(context);
|
|
15193
15211
|
},
|
|
15194
|
-
useEffect: function(
|
|
15212
|
+
useEffect: function(create2, deps) {
|
|
15195
15213
|
currentHookNameInDev = "useEffect";
|
|
15196
15214
|
updateHookTypesDev();
|
|
15197
|
-
return mountEffect(
|
|
15215
|
+
return mountEffect(create2, deps);
|
|
15198
15216
|
},
|
|
15199
|
-
useImperativeHandle: function(ref,
|
|
15217
|
+
useImperativeHandle: function(ref, create2, deps) {
|
|
15200
15218
|
currentHookNameInDev = "useImperativeHandle";
|
|
15201
15219
|
updateHookTypesDev();
|
|
15202
|
-
return mountImperativeHandle(ref,
|
|
15220
|
+
return mountImperativeHandle(ref, create2, deps);
|
|
15203
15221
|
},
|
|
15204
|
-
useInsertionEffect: function(
|
|
15222
|
+
useInsertionEffect: function(create2, deps) {
|
|
15205
15223
|
currentHookNameInDev = "useInsertionEffect";
|
|
15206
15224
|
updateHookTypesDev();
|
|
15207
|
-
return mountInsertionEffect(
|
|
15225
|
+
return mountInsertionEffect(create2, deps);
|
|
15208
15226
|
},
|
|
15209
|
-
useLayoutEffect: function(
|
|
15227
|
+
useLayoutEffect: function(create2, deps) {
|
|
15210
15228
|
currentHookNameInDev = "useLayoutEffect";
|
|
15211
15229
|
updateHookTypesDev();
|
|
15212
|
-
return mountLayoutEffect(
|
|
15230
|
+
return mountLayoutEffect(create2, deps);
|
|
15213
15231
|
},
|
|
15214
|
-
useMemo: function(
|
|
15232
|
+
useMemo: function(create2, deps) {
|
|
15215
15233
|
currentHookNameInDev = "useMemo";
|
|
15216
15234
|
updateHookTypesDev();
|
|
15217
15235
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
15218
15236
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
15219
15237
|
try {
|
|
15220
|
-
return mountMemo(
|
|
15238
|
+
return mountMemo(create2, deps);
|
|
15221
15239
|
} finally {
|
|
15222
15240
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
15223
15241
|
}
|
|
@@ -15295,33 +15313,33 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15295
15313
|
updateHookTypesDev();
|
|
15296
15314
|
return readContext(context);
|
|
15297
15315
|
},
|
|
15298
|
-
useEffect: function(
|
|
15316
|
+
useEffect: function(create2, deps) {
|
|
15299
15317
|
currentHookNameInDev = "useEffect";
|
|
15300
15318
|
updateHookTypesDev();
|
|
15301
|
-
return updateEffect(
|
|
15319
|
+
return updateEffect(create2, deps);
|
|
15302
15320
|
},
|
|
15303
|
-
useImperativeHandle: function(ref,
|
|
15321
|
+
useImperativeHandle: function(ref, create2, deps) {
|
|
15304
15322
|
currentHookNameInDev = "useImperativeHandle";
|
|
15305
15323
|
updateHookTypesDev();
|
|
15306
|
-
return updateImperativeHandle(ref,
|
|
15324
|
+
return updateImperativeHandle(ref, create2, deps);
|
|
15307
15325
|
},
|
|
15308
|
-
useInsertionEffect: function(
|
|
15326
|
+
useInsertionEffect: function(create2, deps) {
|
|
15309
15327
|
currentHookNameInDev = "useInsertionEffect";
|
|
15310
15328
|
updateHookTypesDev();
|
|
15311
|
-
return updateInsertionEffect(
|
|
15329
|
+
return updateInsertionEffect(create2, deps);
|
|
15312
15330
|
},
|
|
15313
|
-
useLayoutEffect: function(
|
|
15331
|
+
useLayoutEffect: function(create2, deps) {
|
|
15314
15332
|
currentHookNameInDev = "useLayoutEffect";
|
|
15315
15333
|
updateHookTypesDev();
|
|
15316
|
-
return updateLayoutEffect(
|
|
15334
|
+
return updateLayoutEffect(create2, deps);
|
|
15317
15335
|
},
|
|
15318
|
-
useMemo: function(
|
|
15336
|
+
useMemo: function(create2, deps) {
|
|
15319
15337
|
currentHookNameInDev = "useMemo";
|
|
15320
15338
|
updateHookTypesDev();
|
|
15321
15339
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
15322
15340
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
15323
15341
|
try {
|
|
15324
|
-
return updateMemo(
|
|
15342
|
+
return updateMemo(create2, deps);
|
|
15325
15343
|
} finally {
|
|
15326
15344
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
15327
15345
|
}
|
|
@@ -15399,33 +15417,33 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15399
15417
|
updateHookTypesDev();
|
|
15400
15418
|
return readContext(context);
|
|
15401
15419
|
},
|
|
15402
|
-
useEffect: function(
|
|
15420
|
+
useEffect: function(create2, deps) {
|
|
15403
15421
|
currentHookNameInDev = "useEffect";
|
|
15404
15422
|
updateHookTypesDev();
|
|
15405
|
-
return updateEffect(
|
|
15423
|
+
return updateEffect(create2, deps);
|
|
15406
15424
|
},
|
|
15407
|
-
useImperativeHandle: function(ref,
|
|
15425
|
+
useImperativeHandle: function(ref, create2, deps) {
|
|
15408
15426
|
currentHookNameInDev = "useImperativeHandle";
|
|
15409
15427
|
updateHookTypesDev();
|
|
15410
|
-
return updateImperativeHandle(ref,
|
|
15428
|
+
return updateImperativeHandle(ref, create2, deps);
|
|
15411
15429
|
},
|
|
15412
|
-
useInsertionEffect: function(
|
|
15430
|
+
useInsertionEffect: function(create2, deps) {
|
|
15413
15431
|
currentHookNameInDev = "useInsertionEffect";
|
|
15414
15432
|
updateHookTypesDev();
|
|
15415
|
-
return updateInsertionEffect(
|
|
15433
|
+
return updateInsertionEffect(create2, deps);
|
|
15416
15434
|
},
|
|
15417
|
-
useLayoutEffect: function(
|
|
15435
|
+
useLayoutEffect: function(create2, deps) {
|
|
15418
15436
|
currentHookNameInDev = "useLayoutEffect";
|
|
15419
15437
|
updateHookTypesDev();
|
|
15420
|
-
return updateLayoutEffect(
|
|
15438
|
+
return updateLayoutEffect(create2, deps);
|
|
15421
15439
|
},
|
|
15422
|
-
useMemo: function(
|
|
15440
|
+
useMemo: function(create2, deps) {
|
|
15423
15441
|
currentHookNameInDev = "useMemo";
|
|
15424
15442
|
updateHookTypesDev();
|
|
15425
15443
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
15426
15444
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnRerenderInDEV;
|
|
15427
15445
|
try {
|
|
15428
|
-
return updateMemo(
|
|
15446
|
+
return updateMemo(create2, deps);
|
|
15429
15447
|
} finally {
|
|
15430
15448
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
15431
15449
|
}
|
|
@@ -15506,38 +15524,38 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15506
15524
|
mountHookTypesDev();
|
|
15507
15525
|
return readContext(context);
|
|
15508
15526
|
},
|
|
15509
|
-
useEffect: function(
|
|
15527
|
+
useEffect: function(create2, deps) {
|
|
15510
15528
|
currentHookNameInDev = "useEffect";
|
|
15511
15529
|
warnInvalidHookAccess();
|
|
15512
15530
|
mountHookTypesDev();
|
|
15513
|
-
return mountEffect(
|
|
15531
|
+
return mountEffect(create2, deps);
|
|
15514
15532
|
},
|
|
15515
|
-
useImperativeHandle: function(ref,
|
|
15533
|
+
useImperativeHandle: function(ref, create2, deps) {
|
|
15516
15534
|
currentHookNameInDev = "useImperativeHandle";
|
|
15517
15535
|
warnInvalidHookAccess();
|
|
15518
15536
|
mountHookTypesDev();
|
|
15519
|
-
return mountImperativeHandle(ref,
|
|
15537
|
+
return mountImperativeHandle(ref, create2, deps);
|
|
15520
15538
|
},
|
|
15521
|
-
useInsertionEffect: function(
|
|
15539
|
+
useInsertionEffect: function(create2, deps) {
|
|
15522
15540
|
currentHookNameInDev = "useInsertionEffect";
|
|
15523
15541
|
warnInvalidHookAccess();
|
|
15524
15542
|
mountHookTypesDev();
|
|
15525
|
-
return mountInsertionEffect(
|
|
15543
|
+
return mountInsertionEffect(create2, deps);
|
|
15526
15544
|
},
|
|
15527
|
-
useLayoutEffect: function(
|
|
15545
|
+
useLayoutEffect: function(create2, deps) {
|
|
15528
15546
|
currentHookNameInDev = "useLayoutEffect";
|
|
15529
15547
|
warnInvalidHookAccess();
|
|
15530
15548
|
mountHookTypesDev();
|
|
15531
|
-
return mountLayoutEffect(
|
|
15549
|
+
return mountLayoutEffect(create2, deps);
|
|
15532
15550
|
},
|
|
15533
|
-
useMemo: function(
|
|
15551
|
+
useMemo: function(create2, deps) {
|
|
15534
15552
|
currentHookNameInDev = "useMemo";
|
|
15535
15553
|
warnInvalidHookAccess();
|
|
15536
15554
|
mountHookTypesDev();
|
|
15537
15555
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
15538
15556
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnMountInDEV;
|
|
15539
15557
|
try {
|
|
15540
|
-
return mountMemo(
|
|
15558
|
+
return mountMemo(create2, deps);
|
|
15541
15559
|
} finally {
|
|
15542
15560
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
15543
15561
|
}
|
|
@@ -15627,38 +15645,38 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15627
15645
|
updateHookTypesDev();
|
|
15628
15646
|
return readContext(context);
|
|
15629
15647
|
},
|
|
15630
|
-
useEffect: function(
|
|
15648
|
+
useEffect: function(create2, deps) {
|
|
15631
15649
|
currentHookNameInDev = "useEffect";
|
|
15632
15650
|
warnInvalidHookAccess();
|
|
15633
15651
|
updateHookTypesDev();
|
|
15634
|
-
return updateEffect(
|
|
15652
|
+
return updateEffect(create2, deps);
|
|
15635
15653
|
},
|
|
15636
|
-
useImperativeHandle: function(ref,
|
|
15654
|
+
useImperativeHandle: function(ref, create2, deps) {
|
|
15637
15655
|
currentHookNameInDev = "useImperativeHandle";
|
|
15638
15656
|
warnInvalidHookAccess();
|
|
15639
15657
|
updateHookTypesDev();
|
|
15640
|
-
return updateImperativeHandle(ref,
|
|
15658
|
+
return updateImperativeHandle(ref, create2, deps);
|
|
15641
15659
|
},
|
|
15642
|
-
useInsertionEffect: function(
|
|
15660
|
+
useInsertionEffect: function(create2, deps) {
|
|
15643
15661
|
currentHookNameInDev = "useInsertionEffect";
|
|
15644
15662
|
warnInvalidHookAccess();
|
|
15645
15663
|
updateHookTypesDev();
|
|
15646
|
-
return updateInsertionEffect(
|
|
15664
|
+
return updateInsertionEffect(create2, deps);
|
|
15647
15665
|
},
|
|
15648
|
-
useLayoutEffect: function(
|
|
15666
|
+
useLayoutEffect: function(create2, deps) {
|
|
15649
15667
|
currentHookNameInDev = "useLayoutEffect";
|
|
15650
15668
|
warnInvalidHookAccess();
|
|
15651
15669
|
updateHookTypesDev();
|
|
15652
|
-
return updateLayoutEffect(
|
|
15670
|
+
return updateLayoutEffect(create2, deps);
|
|
15653
15671
|
},
|
|
15654
|
-
useMemo: function(
|
|
15672
|
+
useMemo: function(create2, deps) {
|
|
15655
15673
|
currentHookNameInDev = "useMemo";
|
|
15656
15674
|
warnInvalidHookAccess();
|
|
15657
15675
|
updateHookTypesDev();
|
|
15658
15676
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
15659
15677
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
15660
15678
|
try {
|
|
15661
|
-
return updateMemo(
|
|
15679
|
+
return updateMemo(create2, deps);
|
|
15662
15680
|
} finally {
|
|
15663
15681
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
15664
15682
|
}
|
|
@@ -15748,38 +15766,38 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15748
15766
|
updateHookTypesDev();
|
|
15749
15767
|
return readContext(context);
|
|
15750
15768
|
},
|
|
15751
|
-
useEffect: function(
|
|
15769
|
+
useEffect: function(create2, deps) {
|
|
15752
15770
|
currentHookNameInDev = "useEffect";
|
|
15753
15771
|
warnInvalidHookAccess();
|
|
15754
15772
|
updateHookTypesDev();
|
|
15755
|
-
return updateEffect(
|
|
15773
|
+
return updateEffect(create2, deps);
|
|
15756
15774
|
},
|
|
15757
|
-
useImperativeHandle: function(ref,
|
|
15775
|
+
useImperativeHandle: function(ref, create2, deps) {
|
|
15758
15776
|
currentHookNameInDev = "useImperativeHandle";
|
|
15759
15777
|
warnInvalidHookAccess();
|
|
15760
15778
|
updateHookTypesDev();
|
|
15761
|
-
return updateImperativeHandle(ref,
|
|
15779
|
+
return updateImperativeHandle(ref, create2, deps);
|
|
15762
15780
|
},
|
|
15763
|
-
useInsertionEffect: function(
|
|
15781
|
+
useInsertionEffect: function(create2, deps) {
|
|
15764
15782
|
currentHookNameInDev = "useInsertionEffect";
|
|
15765
15783
|
warnInvalidHookAccess();
|
|
15766
15784
|
updateHookTypesDev();
|
|
15767
|
-
return updateInsertionEffect(
|
|
15785
|
+
return updateInsertionEffect(create2, deps);
|
|
15768
15786
|
},
|
|
15769
|
-
useLayoutEffect: function(
|
|
15787
|
+
useLayoutEffect: function(create2, deps) {
|
|
15770
15788
|
currentHookNameInDev = "useLayoutEffect";
|
|
15771
15789
|
warnInvalidHookAccess();
|
|
15772
15790
|
updateHookTypesDev();
|
|
15773
|
-
return updateLayoutEffect(
|
|
15791
|
+
return updateLayoutEffect(create2, deps);
|
|
15774
15792
|
},
|
|
15775
|
-
useMemo: function(
|
|
15793
|
+
useMemo: function(create2, deps) {
|
|
15776
15794
|
currentHookNameInDev = "useMemo";
|
|
15777
15795
|
warnInvalidHookAccess();
|
|
15778
15796
|
updateHookTypesDev();
|
|
15779
15797
|
var prevDispatcher = ReactCurrentDispatcher$1.current;
|
|
15780
15798
|
ReactCurrentDispatcher$1.current = InvalidNestedHooksDispatcherOnUpdateInDEV;
|
|
15781
15799
|
try {
|
|
15782
|
-
return updateMemo(
|
|
15800
|
+
return updateMemo(create2, deps);
|
|
15783
15801
|
} finally {
|
|
15784
15802
|
ReactCurrentDispatcher$1.current = prevDispatcher;
|
|
15785
15803
|
}
|
|
@@ -15964,7 +15982,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
15964
15982
|
}
|
|
15965
15983
|
function resolveDefaultProps(Component, baseProps) {
|
|
15966
15984
|
if (Component && Component.defaultProps) {
|
|
15967
|
-
var props =
|
|
15985
|
+
var props = assign2({}, baseProps);
|
|
15968
15986
|
var defaultProps = Component.defaultProps;
|
|
15969
15987
|
for (var propName in defaultProps) {
|
|
15970
15988
|
if (props[propName] === undefined) {
|
|
@@ -16039,7 +16057,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16039
16057
|
}
|
|
16040
16058
|
warnOnUndefinedDerivedState(ctor, partialState);
|
|
16041
16059
|
}
|
|
16042
|
-
var memoizedState = partialState === null || partialState === undefined ? prevState :
|
|
16060
|
+
var memoizedState = partialState === null || partialState === undefined ? prevState : assign2({}, prevState, partialState);
|
|
16043
16061
|
workInProgress2.memoizedState = memoizedState;
|
|
16044
16062
|
if (workInProgress2.lanes === NoLanes) {
|
|
16045
16063
|
var updateQueue = workInProgress2.updateQueue;
|
|
@@ -16049,18 +16067,18 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16049
16067
|
var classComponentUpdater = {
|
|
16050
16068
|
isMounted,
|
|
16051
16069
|
enqueueSetState: function(inst, payload, callback) {
|
|
16052
|
-
var fiber =
|
|
16070
|
+
var fiber = get2(inst);
|
|
16053
16071
|
var eventTime = requestEventTime();
|
|
16054
16072
|
var lane = requestUpdateLane(fiber);
|
|
16055
|
-
var
|
|
16056
|
-
|
|
16073
|
+
var update2 = createUpdate(eventTime, lane);
|
|
16074
|
+
update2.payload = payload;
|
|
16057
16075
|
if (callback !== undefined && callback !== null) {
|
|
16058
16076
|
{
|
|
16059
16077
|
warnOnInvalidCallback(callback, "setState");
|
|
16060
16078
|
}
|
|
16061
|
-
|
|
16079
|
+
update2.callback = callback;
|
|
16062
16080
|
}
|
|
16063
|
-
var root = enqueueUpdate(fiber,
|
|
16081
|
+
var root = enqueueUpdate(fiber, update2, lane);
|
|
16064
16082
|
if (root !== null) {
|
|
16065
16083
|
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
|
|
16066
16084
|
entangleTransitions(root, fiber, lane);
|
|
@@ -16070,19 +16088,19 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16070
16088
|
}
|
|
16071
16089
|
},
|
|
16072
16090
|
enqueueReplaceState: function(inst, payload, callback) {
|
|
16073
|
-
var fiber =
|
|
16091
|
+
var fiber = get2(inst);
|
|
16074
16092
|
var eventTime = requestEventTime();
|
|
16075
16093
|
var lane = requestUpdateLane(fiber);
|
|
16076
|
-
var
|
|
16077
|
-
|
|
16078
|
-
|
|
16094
|
+
var update2 = createUpdate(eventTime, lane);
|
|
16095
|
+
update2.tag = ReplaceState;
|
|
16096
|
+
update2.payload = payload;
|
|
16079
16097
|
if (callback !== undefined && callback !== null) {
|
|
16080
16098
|
{
|
|
16081
16099
|
warnOnInvalidCallback(callback, "replaceState");
|
|
16082
16100
|
}
|
|
16083
|
-
|
|
16101
|
+
update2.callback = callback;
|
|
16084
16102
|
}
|
|
16085
|
-
var root = enqueueUpdate(fiber,
|
|
16103
|
+
var root = enqueueUpdate(fiber, update2, lane);
|
|
16086
16104
|
if (root !== null) {
|
|
16087
16105
|
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
|
|
16088
16106
|
entangleTransitions(root, fiber, lane);
|
|
@@ -16092,18 +16110,18 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16092
16110
|
}
|
|
16093
16111
|
},
|
|
16094
16112
|
enqueueForceUpdate: function(inst, callback) {
|
|
16095
|
-
var fiber =
|
|
16113
|
+
var fiber = get2(inst);
|
|
16096
16114
|
var eventTime = requestEventTime();
|
|
16097
16115
|
var lane = requestUpdateLane(fiber);
|
|
16098
|
-
var
|
|
16099
|
-
|
|
16116
|
+
var update2 = createUpdate(eventTime, lane);
|
|
16117
|
+
update2.tag = ForceUpdate;
|
|
16100
16118
|
if (callback !== undefined && callback !== null) {
|
|
16101
16119
|
{
|
|
16102
16120
|
warnOnInvalidCallback(callback, "forceUpdate");
|
|
16103
16121
|
}
|
|
16104
|
-
|
|
16122
|
+
update2.callback = callback;
|
|
16105
16123
|
}
|
|
16106
|
-
var root = enqueueUpdate(fiber,
|
|
16124
|
+
var root = enqueueUpdate(fiber, update2, lane);
|
|
16107
16125
|
if (root !== null) {
|
|
16108
16126
|
scheduleUpdateOnFiber(root, fiber, lane, eventTime);
|
|
16109
16127
|
entangleTransitions(root, fiber, lane);
|
|
@@ -16221,7 +16239,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16221
16239
|
error("%s: getSnapshotBeforeUpdate() is defined as a static method " + "and will be ignored. Instead, declare it as an instance method.", name);
|
|
16222
16240
|
}
|
|
16223
16241
|
var _state = instance.state;
|
|
16224
|
-
if (_state && (typeof _state !== "object" ||
|
|
16242
|
+
if (_state && (typeof _state !== "object" || isArray2(_state))) {
|
|
16225
16243
|
error("%s.state: must be set to an object or null", name);
|
|
16226
16244
|
}
|
|
16227
16245
|
if (typeof instance.getChildContext === "function" && typeof ctor.childContextTypes !== "object") {
|
|
@@ -16232,7 +16250,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16232
16250
|
function adoptClassInstance(workInProgress2, instance) {
|
|
16233
16251
|
instance.updater = classComponentUpdater;
|
|
16234
16252
|
workInProgress2.stateNode = instance;
|
|
16235
|
-
|
|
16253
|
+
set2(instance, workInProgress2);
|
|
16236
16254
|
{
|
|
16237
16255
|
instance._reactInternalInstance = fakeInternalInstance;
|
|
16238
16256
|
}
|
|
@@ -16633,7 +16651,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16633
16651
|
|
|
16634
16652
|
` + ("" + errorBoundaryMessage);
|
|
16635
16653
|
console["error"](combinedMessage);
|
|
16636
|
-
}
|
|
16654
|
+
}
|
|
16637
16655
|
} catch (e2) {
|
|
16638
16656
|
setTimeout(function() {
|
|
16639
16657
|
throw e2;
|
|
@@ -16642,28 +16660,28 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16642
16660
|
}
|
|
16643
16661
|
var PossiblyWeakMap$1 = typeof WeakMap === "function" ? WeakMap : Map;
|
|
16644
16662
|
function createRootErrorUpdate(fiber, errorInfo, lane) {
|
|
16645
|
-
var
|
|
16646
|
-
|
|
16647
|
-
|
|
16663
|
+
var update2 = createUpdate(NoTimestamp, lane);
|
|
16664
|
+
update2.tag = CaptureUpdate;
|
|
16665
|
+
update2.payload = {
|
|
16648
16666
|
element: null
|
|
16649
16667
|
};
|
|
16650
16668
|
var error2 = errorInfo.value;
|
|
16651
|
-
|
|
16669
|
+
update2.callback = function() {
|
|
16652
16670
|
onUncaughtError(error2);
|
|
16653
16671
|
logCapturedError(fiber, errorInfo);
|
|
16654
16672
|
};
|
|
16655
|
-
return
|
|
16673
|
+
return update2;
|
|
16656
16674
|
}
|
|
16657
16675
|
function createClassErrorUpdate(fiber, errorInfo, lane) {
|
|
16658
|
-
var
|
|
16659
|
-
|
|
16676
|
+
var update2 = createUpdate(NoTimestamp, lane);
|
|
16677
|
+
update2.tag = CaptureUpdate;
|
|
16660
16678
|
var getDerivedStateFromError = fiber.type.getDerivedStateFromError;
|
|
16661
16679
|
if (typeof getDerivedStateFromError === "function") {
|
|
16662
16680
|
var error$1 = errorInfo.value;
|
|
16663
|
-
|
|
16681
|
+
update2.payload = function() {
|
|
16664
16682
|
return getDerivedStateFromError(error$1);
|
|
16665
16683
|
};
|
|
16666
|
-
|
|
16684
|
+
update2.callback = function() {
|
|
16667
16685
|
{
|
|
16668
16686
|
markFailedErrorBoundaryForHotReloading(fiber);
|
|
16669
16687
|
}
|
|
@@ -16672,7 +16690,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16672
16690
|
}
|
|
16673
16691
|
var inst = fiber.stateNode;
|
|
16674
16692
|
if (inst !== null && typeof inst.componentDidCatch === "function") {
|
|
16675
|
-
|
|
16693
|
+
update2.callback = function callback() {
|
|
16676
16694
|
{
|
|
16677
16695
|
markFailedErrorBoundaryForHotReloading(fiber);
|
|
16678
16696
|
}
|
|
@@ -16694,7 +16712,7 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16694
16712
|
}
|
|
16695
16713
|
};
|
|
16696
16714
|
}
|
|
16697
|
-
return
|
|
16715
|
+
return update2;
|
|
16698
16716
|
}
|
|
16699
16717
|
function attachPingListener(root, wakeable, lanes) {
|
|
16700
16718
|
var pingCache = root.pingCache;
|
|
@@ -16768,9 +16786,9 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16768
16786
|
if (currentSourceFiber === null) {
|
|
16769
16787
|
sourceFiber.tag = IncompleteClassComponent;
|
|
16770
16788
|
} else {
|
|
16771
|
-
var
|
|
16772
|
-
|
|
16773
|
-
enqueueUpdate(sourceFiber,
|
|
16789
|
+
var update2 = createUpdate(NoTimestamp, SyncLane);
|
|
16790
|
+
update2.tag = ForceUpdate;
|
|
16791
|
+
enqueueUpdate(sourceFiber, update2, SyncLane);
|
|
16774
16792
|
}
|
|
16775
16793
|
}
|
|
16776
16794
|
sourceFiber.lanes = mergeLanes(sourceFiber.lanes, SyncLane);
|
|
@@ -16838,8 +16856,8 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
16838
16856
|
workInProgress2.flags |= ShouldCapture;
|
|
16839
16857
|
var lane = pickArbitraryLane(rootRenderLanes);
|
|
16840
16858
|
workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
|
|
16841
|
-
var
|
|
16842
|
-
enqueueCapturedUpdate(workInProgress2,
|
|
16859
|
+
var update2 = createRootErrorUpdate(workInProgress2, _errorInfo, lane);
|
|
16860
|
+
enqueueCapturedUpdate(workInProgress2, update2);
|
|
16843
16861
|
return;
|
|
16844
16862
|
}
|
|
16845
16863
|
case ClassComponent:
|
|
@@ -17192,8 +17210,8 @@ Learn more about this warning here: https://reactjs.org/link/legacy-context`, so
|
|
|
17192
17210
|
var error$1 = new Error("Simulated error coming from DevTools");
|
|
17193
17211
|
var lane = pickArbitraryLane(renderLanes2);
|
|
17194
17212
|
workInProgress2.lanes = mergeLanes(workInProgress2.lanes, lane);
|
|
17195
|
-
var
|
|
17196
|
-
enqueueCapturedUpdate(workInProgress2,
|
|
17213
|
+
var update2 = createClassErrorUpdate(workInProgress2, createCapturedValueAtFiber(error$1, workInProgress2), lane);
|
|
17214
|
+
enqueueCapturedUpdate(workInProgress2, update2);
|
|
17197
17215
|
break;
|
|
17198
17216
|
}
|
|
17199
17217
|
}
|
|
@@ -17997,7 +18015,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
17997
18015
|
}
|
|
17998
18016
|
function validateSuspenseListNestedChild(childSlot, index2) {
|
|
17999
18017
|
{
|
|
18000
|
-
var isAnArray =
|
|
18018
|
+
var isAnArray = isArray2(childSlot);
|
|
18001
18019
|
var isIterable = !isAnArray && typeof getIteratorFn(childSlot) === "function";
|
|
18002
18020
|
if (isAnArray || isIterable) {
|
|
18003
18021
|
var type = isAnArray ? "array" : "iterable";
|
|
@@ -18010,7 +18028,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
18010
18028
|
function validateSuspenseListChildren(children, revealOrder) {
|
|
18011
18029
|
{
|
|
18012
18030
|
if ((revealOrder === "forwards" || revealOrder === "backwards") && children !== undefined && children !== null && children !== false) {
|
|
18013
|
-
if (
|
|
18031
|
+
if (isArray2(children)) {
|
|
18014
18032
|
for (var i = 0;i < children.length; i++) {
|
|
18015
18033
|
if (!validateSuspenseListNestedChild(children[i], i)) {
|
|
18016
18034
|
return;
|
|
@@ -18037,7 +18055,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
18037
18055
|
}
|
|
18038
18056
|
}
|
|
18039
18057
|
}
|
|
18040
|
-
function initSuspenseListRenderState(workInProgress2, isBackwards,
|
|
18058
|
+
function initSuspenseListRenderState(workInProgress2, isBackwards, tail2, lastContentRow, tailMode) {
|
|
18041
18059
|
var renderState = workInProgress2.memoizedState;
|
|
18042
18060
|
if (renderState === null) {
|
|
18043
18061
|
workInProgress2.memoizedState = {
|
|
@@ -18045,7 +18063,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
18045
18063
|
rendering: null,
|
|
18046
18064
|
renderingStartTime: 0,
|
|
18047
18065
|
last: lastContentRow,
|
|
18048
|
-
tail,
|
|
18066
|
+
tail: tail2,
|
|
18049
18067
|
tailMode
|
|
18050
18068
|
};
|
|
18051
18069
|
} else {
|
|
@@ -18053,7 +18071,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
18053
18071
|
renderState.rendering = null;
|
|
18054
18072
|
renderState.renderingStartTime = 0;
|
|
18055
18073
|
renderState.last = lastContentRow;
|
|
18056
|
-
renderState.tail =
|
|
18074
|
+
renderState.tail = tail2;
|
|
18057
18075
|
renderState.tailMode = tailMode;
|
|
18058
18076
|
}
|
|
18059
18077
|
}
|
|
@@ -18085,15 +18103,15 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
18085
18103
|
switch (revealOrder) {
|
|
18086
18104
|
case "forwards": {
|
|
18087
18105
|
var lastContentRow = findLastContentRow(workInProgress2.child);
|
|
18088
|
-
var
|
|
18106
|
+
var tail2;
|
|
18089
18107
|
if (lastContentRow === null) {
|
|
18090
|
-
|
|
18108
|
+
tail2 = workInProgress2.child;
|
|
18091
18109
|
workInProgress2.child = null;
|
|
18092
18110
|
} else {
|
|
18093
|
-
|
|
18111
|
+
tail2 = lastContentRow.sibling;
|
|
18094
18112
|
lastContentRow.sibling = null;
|
|
18095
18113
|
}
|
|
18096
|
-
initSuspenseListRenderState(workInProgress2, false,
|
|
18114
|
+
initSuspenseListRenderState(workInProgress2, false, tail2, lastContentRow, tailMode);
|
|
18097
18115
|
break;
|
|
18098
18116
|
}
|
|
18099
18117
|
case "backwards": {
|
|
@@ -19091,7 +19109,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
19091
19109
|
row = row.sibling;
|
|
19092
19110
|
}
|
|
19093
19111
|
}
|
|
19094
|
-
if (renderState.tail !== null &&
|
|
19112
|
+
if (renderState.tail !== null && now2() > getRenderTargetTime()) {
|
|
19095
19113
|
workInProgress2.flags |= DidCapture;
|
|
19096
19114
|
didSuspendAlready = true;
|
|
19097
19115
|
cutOffTailIfNeeded(renderState, false);
|
|
@@ -19116,7 +19134,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
19116
19134
|
bubbleProperties(workInProgress2);
|
|
19117
19135
|
return null;
|
|
19118
19136
|
}
|
|
19119
|
-
} else if (
|
|
19137
|
+
} else if (now2() * 2 - renderState.renderingStartTime > getRenderTargetTime() && renderLanes2 !== OffscreenLane) {
|
|
19120
19138
|
workInProgress2.flags |= DidCapture;
|
|
19121
19139
|
didSuspendAlready = true;
|
|
19122
19140
|
cutOffTailIfNeeded(renderState, false);
|
|
@@ -19140,7 +19158,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
19140
19158
|
var next = renderState.tail;
|
|
19141
19159
|
renderState.rendering = next;
|
|
19142
19160
|
renderState.tail = next.sibling;
|
|
19143
|
-
renderState.renderingStartTime =
|
|
19161
|
+
renderState.renderingStartTime = now2();
|
|
19144
19162
|
next.sibling = null;
|
|
19145
19163
|
var suspenseContext = suspenseStackCursor.current;
|
|
19146
19164
|
if (didSuspendAlready) {
|
|
@@ -19660,13 +19678,13 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
19660
19678
|
markComponentLayoutEffectMountStarted(finishedWork);
|
|
19661
19679
|
}
|
|
19662
19680
|
}
|
|
19663
|
-
var
|
|
19681
|
+
var create2 = effect.create;
|
|
19664
19682
|
{
|
|
19665
19683
|
if ((flags & Insertion) !== NoFlags$1) {
|
|
19666
19684
|
setIsRunningInsertionEffect(true);
|
|
19667
19685
|
}
|
|
19668
19686
|
}
|
|
19669
|
-
effect.destroy =
|
|
19687
|
+
effect.destroy = create2();
|
|
19670
19688
|
{
|
|
19671
19689
|
if ((flags & Insertion) !== NoFlags$1) {
|
|
19672
19690
|
setIsRunningInsertionEffect(false);
|
|
@@ -20168,8 +20186,8 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
20168
20186
|
resetTextContent(parent);
|
|
20169
20187
|
parentFiber.flags &= ~ContentReset;
|
|
20170
20188
|
}
|
|
20171
|
-
var
|
|
20172
|
-
insertOrAppendPlacementNode(finishedWork,
|
|
20189
|
+
var before2 = getHostSibling(finishedWork);
|
|
20190
|
+
insertOrAppendPlacementNode(finishedWork, before2, parent);
|
|
20173
20191
|
break;
|
|
20174
20192
|
}
|
|
20175
20193
|
case HostRoot:
|
|
@@ -20183,13 +20201,13 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
20183
20201
|
throw new Error("Invalid host parent fiber. This error is likely caused by a bug " + "in React. Please file an issue.");
|
|
20184
20202
|
}
|
|
20185
20203
|
}
|
|
20186
|
-
function insertOrAppendPlacementNodeIntoContainer(node,
|
|
20204
|
+
function insertOrAppendPlacementNodeIntoContainer(node, before2, parent) {
|
|
20187
20205
|
var tag = node.tag;
|
|
20188
20206
|
var isHost = tag === HostComponent || tag === HostText;
|
|
20189
20207
|
if (isHost) {
|
|
20190
20208
|
var stateNode = node.stateNode;
|
|
20191
|
-
if (
|
|
20192
|
-
insertInContainerBefore(parent, stateNode,
|
|
20209
|
+
if (before2) {
|
|
20210
|
+
insertInContainerBefore(parent, stateNode, before2);
|
|
20193
20211
|
} else {
|
|
20194
20212
|
appendChildToContainer(parent, stateNode);
|
|
20195
20213
|
}
|
|
@@ -20198,22 +20216,22 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
20198
20216
|
else {
|
|
20199
20217
|
var child = node.child;
|
|
20200
20218
|
if (child !== null) {
|
|
20201
|
-
insertOrAppendPlacementNodeIntoContainer(child,
|
|
20219
|
+
insertOrAppendPlacementNodeIntoContainer(child, before2, parent);
|
|
20202
20220
|
var sibling = child.sibling;
|
|
20203
20221
|
while (sibling !== null) {
|
|
20204
|
-
insertOrAppendPlacementNodeIntoContainer(sibling,
|
|
20222
|
+
insertOrAppendPlacementNodeIntoContainer(sibling, before2, parent);
|
|
20205
20223
|
sibling = sibling.sibling;
|
|
20206
20224
|
}
|
|
20207
20225
|
}
|
|
20208
20226
|
}
|
|
20209
20227
|
}
|
|
20210
|
-
function insertOrAppendPlacementNode(node,
|
|
20228
|
+
function insertOrAppendPlacementNode(node, before2, parent) {
|
|
20211
20229
|
var tag = node.tag;
|
|
20212
20230
|
var isHost = tag === HostComponent || tag === HostText;
|
|
20213
20231
|
if (isHost) {
|
|
20214
20232
|
var stateNode = node.stateNode;
|
|
20215
|
-
if (
|
|
20216
|
-
insertBefore(parent, stateNode,
|
|
20233
|
+
if (before2) {
|
|
20234
|
+
insertBefore(parent, stateNode, before2);
|
|
20217
20235
|
} else {
|
|
20218
20236
|
appendChild(parent, stateNode);
|
|
20219
20237
|
}
|
|
@@ -20222,10 +20240,10 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
20222
20240
|
else {
|
|
20223
20241
|
var child = node.child;
|
|
20224
20242
|
if (child !== null) {
|
|
20225
|
-
insertOrAppendPlacementNode(child,
|
|
20243
|
+
insertOrAppendPlacementNode(child, before2, parent);
|
|
20226
20244
|
var sibling = child.sibling;
|
|
20227
20245
|
while (sibling !== null) {
|
|
20228
|
-
insertOrAppendPlacementNode(sibling,
|
|
20246
|
+
insertOrAppendPlacementNode(sibling, before2, parent);
|
|
20229
20247
|
sibling = sibling.sibling;
|
|
20230
20248
|
}
|
|
20231
20249
|
}
|
|
@@ -21544,7 +21562,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21544
21562
|
return isReactActEnvironmentGlobal;
|
|
21545
21563
|
}
|
|
21546
21564
|
}
|
|
21547
|
-
var
|
|
21565
|
+
var ceil2 = Math.ceil;
|
|
21548
21566
|
var { ReactCurrentDispatcher: ReactCurrentDispatcher$2, ReactCurrentOwner: ReactCurrentOwner$2, ReactCurrentBatchConfig: ReactCurrentBatchConfig$2, ReactCurrentActQueue: ReactCurrentActQueue$1 } = ReactSharedInternals;
|
|
21549
21567
|
var NoContext = 0;
|
|
21550
21568
|
var BatchedContext = 1;
|
|
@@ -21577,7 +21595,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21577
21595
|
var RENDER_TIMEOUT_MS = 500;
|
|
21578
21596
|
var workInProgressTransitions = null;
|
|
21579
21597
|
function resetRenderTimer() {
|
|
21580
|
-
workInProgressRootRenderTargetTime =
|
|
21598
|
+
workInProgressRootRenderTargetTime = now2() + RENDER_TIMEOUT_MS;
|
|
21581
21599
|
}
|
|
21582
21600
|
function getRenderTargetTime() {
|
|
21583
21601
|
return workInProgressRootRenderTargetTime;
|
|
@@ -21606,12 +21624,12 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21606
21624
|
}
|
|
21607
21625
|
function requestEventTime() {
|
|
21608
21626
|
if ((executionContext & (RenderContext | CommitContext)) !== NoContext) {
|
|
21609
|
-
return
|
|
21627
|
+
return now2();
|
|
21610
21628
|
}
|
|
21611
21629
|
if (currentEventTime !== NoTimestamp) {
|
|
21612
21630
|
return currentEventTime;
|
|
21613
21631
|
}
|
|
21614
|
-
currentEventTime =
|
|
21632
|
+
currentEventTime = now2();
|
|
21615
21633
|
return currentEventTime;
|
|
21616
21634
|
}
|
|
21617
21635
|
function requestUpdateLane(fiber) {
|
|
@@ -21802,7 +21820,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21802
21820
|
var fatalError = workInProgressRootFatalError;
|
|
21803
21821
|
prepareFreshStack(root, NoLanes);
|
|
21804
21822
|
markRootSuspended$1(root, lanes);
|
|
21805
|
-
ensureRootIsScheduled(root,
|
|
21823
|
+
ensureRootIsScheduled(root, now2());
|
|
21806
21824
|
throw fatalError;
|
|
21807
21825
|
}
|
|
21808
21826
|
if (exitStatus === RootDidNotComplete) {
|
|
@@ -21823,7 +21841,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21823
21841
|
var _fatalError = workInProgressRootFatalError;
|
|
21824
21842
|
prepareFreshStack(root, NoLanes);
|
|
21825
21843
|
markRootSuspended$1(root, lanes);
|
|
21826
|
-
ensureRootIsScheduled(root,
|
|
21844
|
+
ensureRootIsScheduled(root, now2());
|
|
21827
21845
|
throw _fatalError;
|
|
21828
21846
|
}
|
|
21829
21847
|
}
|
|
@@ -21832,7 +21850,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21832
21850
|
finishConcurrentRender(root, exitStatus, lanes);
|
|
21833
21851
|
}
|
|
21834
21852
|
}
|
|
21835
|
-
ensureRootIsScheduled(root,
|
|
21853
|
+
ensureRootIsScheduled(root, now2());
|
|
21836
21854
|
if (root.callbackNode === originalCallbackNode) {
|
|
21837
21855
|
return performConcurrentWorkOnRoot.bind(null, root);
|
|
21838
21856
|
}
|
|
@@ -21877,7 +21895,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21877
21895
|
case RootSuspended: {
|
|
21878
21896
|
markRootSuspended$1(root, lanes);
|
|
21879
21897
|
if (includesOnlyRetries(lanes) && !shouldForceFlushFallbacksInDEV()) {
|
|
21880
|
-
var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS -
|
|
21898
|
+
var msUntilTimeout = globalMostRecentFallbackTime + FALLBACK_THROTTLE_MS - now2();
|
|
21881
21899
|
if (msUntilTimeout > 10) {
|
|
21882
21900
|
var nextLanes = getNextLanes(root, NoLanes);
|
|
21883
21901
|
if (nextLanes !== NoLanes) {
|
|
@@ -21904,7 +21922,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21904
21922
|
if (!shouldForceFlushFallbacksInDEV()) {
|
|
21905
21923
|
var mostRecentEventTime = getMostRecentEventTime(root, lanes);
|
|
21906
21924
|
var eventTimeMs = mostRecentEventTime;
|
|
21907
|
-
var timeElapsedMs =
|
|
21925
|
+
var timeElapsedMs = now2() - eventTimeMs;
|
|
21908
21926
|
var _msUntilTimeout = jnd(timeElapsedMs) - timeElapsedMs;
|
|
21909
21927
|
if (_msUntilTimeout > 10) {
|
|
21910
21928
|
root.timeoutHandle = scheduleTimeout(commitRoot.bind(null, root, workInProgressRootRecoverableErrors, workInProgressTransitions), _msUntilTimeout);
|
|
@@ -21981,7 +21999,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21981
21999
|
flushPassiveEffects();
|
|
21982
22000
|
var lanes = getNextLanes(root, NoLanes);
|
|
21983
22001
|
if (!includesSomeLane(lanes, SyncLane)) {
|
|
21984
|
-
ensureRootIsScheduled(root,
|
|
22002
|
+
ensureRootIsScheduled(root, now2());
|
|
21985
22003
|
return null;
|
|
21986
22004
|
}
|
|
21987
22005
|
var exitStatus = renderRootSync(root, lanes);
|
|
@@ -21996,7 +22014,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
21996
22014
|
var fatalError = workInProgressRootFatalError;
|
|
21997
22015
|
prepareFreshStack(root, NoLanes);
|
|
21998
22016
|
markRootSuspended$1(root, lanes);
|
|
21999
|
-
ensureRootIsScheduled(root,
|
|
22017
|
+
ensureRootIsScheduled(root, now2());
|
|
22000
22018
|
throw fatalError;
|
|
22001
22019
|
}
|
|
22002
22020
|
if (exitStatus === RootDidNotComplete) {
|
|
@@ -22006,13 +22024,13 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
22006
22024
|
root.finishedWork = finishedWork;
|
|
22007
22025
|
root.finishedLanes = lanes;
|
|
22008
22026
|
commitRoot(root, workInProgressRootRecoverableErrors, workInProgressTransitions);
|
|
22009
|
-
ensureRootIsScheduled(root,
|
|
22027
|
+
ensureRootIsScheduled(root, now2());
|
|
22010
22028
|
return null;
|
|
22011
22029
|
}
|
|
22012
22030
|
function flushRoot(root, lanes) {
|
|
22013
22031
|
if (lanes !== NoLanes) {
|
|
22014
22032
|
markRootEntangled(root, mergeLanes(lanes, SyncLane));
|
|
22015
|
-
ensureRootIsScheduled(root,
|
|
22033
|
+
ensureRootIsScheduled(root, now2());
|
|
22016
22034
|
if ((executionContext & (RenderContext | CommitContext)) === NoContext) {
|
|
22017
22035
|
resetRenderTimer();
|
|
22018
22036
|
flushSyncCallbacks();
|
|
@@ -22202,7 +22220,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
22202
22220
|
ReactCurrentDispatcher$2.current = prevDispatcher;
|
|
22203
22221
|
}
|
|
22204
22222
|
function markCommitTimeOfFallback() {
|
|
22205
|
-
globalMostRecentFallbackTime =
|
|
22223
|
+
globalMostRecentFallbackTime = now2();
|
|
22206
22224
|
}
|
|
22207
22225
|
function markSkippedUpdateLanes(lane) {
|
|
22208
22226
|
workInProgressRootSkippedLanes = mergeLanes(lane, workInProgressRootSkippedLanes);
|
|
@@ -22536,7 +22554,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
22536
22554
|
{
|
|
22537
22555
|
onCommitRoot$1();
|
|
22538
22556
|
}
|
|
22539
|
-
ensureRootIsScheduled(root,
|
|
22557
|
+
ensureRootIsScheduled(root, now2());
|
|
22540
22558
|
if (recoverableErrors !== null) {
|
|
22541
22559
|
var onRecoverableError = root.onRecoverableError;
|
|
22542
22560
|
for (var i = 0;i < recoverableErrors.length; i++) {
|
|
@@ -22688,8 +22706,8 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
22688
22706
|
var onUncaughtError = prepareToThrowUncaughtError;
|
|
22689
22707
|
function captureCommitPhaseErrorOnRoot(rootFiber, sourceFiber, error2) {
|
|
22690
22708
|
var errorInfo = createCapturedValueAtFiber(error2, sourceFiber);
|
|
22691
|
-
var
|
|
22692
|
-
var root = enqueueUpdate(rootFiber,
|
|
22709
|
+
var update2 = createRootErrorUpdate(rootFiber, errorInfo, SyncLane);
|
|
22710
|
+
var root = enqueueUpdate(rootFiber, update2, SyncLane);
|
|
22693
22711
|
var eventTime = requestEventTime();
|
|
22694
22712
|
if (root !== null) {
|
|
22695
22713
|
markRootUpdated(root, SyncLane, eventTime);
|
|
@@ -22718,8 +22736,8 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
22718
22736
|
var instance = fiber.stateNode;
|
|
22719
22737
|
if (typeof ctor.getDerivedStateFromError === "function" || typeof instance.componentDidCatch === "function" && !isAlreadyFailedLegacyErrorBoundary(instance)) {
|
|
22720
22738
|
var errorInfo = createCapturedValueAtFiber(error$1, sourceFiber);
|
|
22721
|
-
var
|
|
22722
|
-
var root = enqueueUpdate(fiber,
|
|
22739
|
+
var update2 = createClassErrorUpdate(fiber, errorInfo, SyncLane);
|
|
22740
|
+
var root = enqueueUpdate(fiber, update2, SyncLane);
|
|
22723
22741
|
var eventTime = requestEventTime();
|
|
22724
22742
|
if (root !== null) {
|
|
22725
22743
|
markRootUpdated(root, SyncLane, eventTime);
|
|
@@ -22747,7 +22765,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
22747
22765
|
markRootPinged(root, pingedLanes);
|
|
22748
22766
|
warnIfSuspenseResolutionNotWrappedWithActDEV(root);
|
|
22749
22767
|
if (workInProgressRoot === root && isSubsetOfLanes(workInProgressRootRenderLanes, pingedLanes)) {
|
|
22750
|
-
if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) &&
|
|
22768
|
+
if (workInProgressRootExitStatus === RootSuspendedWithDelay || workInProgressRootExitStatus === RootSuspended && includesOnlyRetries(workInProgressRootRenderLanes) && now2() - globalMostRecentFallbackTime < FALLBACK_THROTTLE_MS) {
|
|
22751
22769
|
prepareFreshStack(root, NoLanes);
|
|
22752
22770
|
} else {
|
|
22753
22771
|
workInProgressRootPingedLanes = mergeLanes(workInProgressRootPingedLanes, pingedLanes);
|
|
@@ -22797,7 +22815,7 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
22797
22815
|
retryTimedOutBoundary(boundaryFiber, retryLane);
|
|
22798
22816
|
}
|
|
22799
22817
|
function jnd(timeElapsed) {
|
|
22800
|
-
return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 :
|
|
22818
|
+
return timeElapsed < 120 ? 120 : timeElapsed < 480 ? 480 : timeElapsed < 1080 ? 1080 : timeElapsed < 1920 ? 1920 : timeElapsed < 3000 ? 3000 : timeElapsed < 4320 ? 4320 : ceil2(timeElapsed / 1960) * 1960;
|
|
22801
22819
|
}
|
|
22802
22820
|
function checkForNestedUpdates() {
|
|
22803
22821
|
if (nestedUpdateCount > NESTED_UPDATE_LIMIT) {
|
|
@@ -23159,12 +23177,12 @@ It looks like you wrote ` + hookName + "(async () => ...) or returned a Promise.
|
|
|
23159
23177
|
failedBoundaries.add(fiber);
|
|
23160
23178
|
}
|
|
23161
23179
|
}
|
|
23162
|
-
var scheduleRefresh = function(root,
|
|
23180
|
+
var scheduleRefresh = function(root, update2) {
|
|
23163
23181
|
{
|
|
23164
23182
|
if (resolveFamily === null) {
|
|
23165
23183
|
return;
|
|
23166
23184
|
}
|
|
23167
|
-
var { staleFamilies, updatedFamilies } =
|
|
23185
|
+
var { staleFamilies, updatedFamilies } = update2;
|
|
23168
23186
|
flushPassiveEffects();
|
|
23169
23187
|
flushSync(function() {
|
|
23170
23188
|
scheduleFibersWithFamiliesRecursively(root.current, updatedFamilies, staleFamilies);
|
|
@@ -23834,7 +23852,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
23834
23852
|
if (!parentComponent) {
|
|
23835
23853
|
return emptyContextObject;
|
|
23836
23854
|
}
|
|
23837
|
-
var fiber =
|
|
23855
|
+
var fiber = get2(parentComponent);
|
|
23838
23856
|
var parentContext = findCurrentUnmaskedContext(fiber);
|
|
23839
23857
|
if (fiber.tag === ClassComponent) {
|
|
23840
23858
|
var Component = fiber.type;
|
|
@@ -23845,13 +23863,13 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
23845
23863
|
return parentContext;
|
|
23846
23864
|
}
|
|
23847
23865
|
function findHostInstance(component) {
|
|
23848
|
-
var fiber =
|
|
23866
|
+
var fiber = get2(component);
|
|
23849
23867
|
if (fiber === undefined) {
|
|
23850
23868
|
if (typeof component.render === "function") {
|
|
23851
23869
|
throw new Error("Unable to find node on an unmounted component.");
|
|
23852
23870
|
} else {
|
|
23853
|
-
var
|
|
23854
|
-
throw new Error("Argument appears to not be a ReactComponent. Keys: " +
|
|
23871
|
+
var keys2 = Object.keys(component).join(",");
|
|
23872
|
+
throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys2);
|
|
23855
23873
|
}
|
|
23856
23874
|
}
|
|
23857
23875
|
var hostFiber = findCurrentHostFiber(fiber);
|
|
@@ -23862,13 +23880,13 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
23862
23880
|
}
|
|
23863
23881
|
function findHostInstanceWithWarning(component, methodName) {
|
|
23864
23882
|
{
|
|
23865
|
-
var fiber =
|
|
23883
|
+
var fiber = get2(component);
|
|
23866
23884
|
if (fiber === undefined) {
|
|
23867
23885
|
if (typeof component.render === "function") {
|
|
23868
23886
|
throw new Error("Unable to find node on an unmounted component.");
|
|
23869
23887
|
} else {
|
|
23870
|
-
var
|
|
23871
|
-
throw new Error("Argument appears to not be a ReactComponent. Keys: " +
|
|
23888
|
+
var keys2 = Object.keys(component).join(",");
|
|
23889
|
+
throw new Error("Argument appears to not be a ReactComponent. Keys: " + keys2);
|
|
23872
23890
|
}
|
|
23873
23891
|
}
|
|
23874
23892
|
var hostFiber = findCurrentHostFiber(fiber);
|
|
@@ -23911,9 +23929,9 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
23911
23929
|
var current2 = root.current;
|
|
23912
23930
|
var eventTime = requestEventTime();
|
|
23913
23931
|
var lane = requestUpdateLane(current2);
|
|
23914
|
-
var
|
|
23915
|
-
|
|
23916
|
-
enqueueUpdate(current2,
|
|
23932
|
+
var update2 = createUpdate(eventTime, lane);
|
|
23933
|
+
update2.callback = callback !== undefined && callback !== null ? callback : null;
|
|
23934
|
+
enqueueUpdate(current2, update2, lane);
|
|
23917
23935
|
scheduleInitialHydrationOnRoot(root, lane, eventTime);
|
|
23918
23936
|
return root;
|
|
23919
23937
|
}
|
|
@@ -23941,8 +23959,8 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
23941
23959
|
` + "Check the render method of %s.", getComponentNameFromFiber(current) || "Unknown");
|
|
23942
23960
|
}
|
|
23943
23961
|
}
|
|
23944
|
-
var
|
|
23945
|
-
|
|
23962
|
+
var update2 = createUpdate(eventTime, lane);
|
|
23963
|
+
update2.payload = {
|
|
23946
23964
|
element
|
|
23947
23965
|
};
|
|
23948
23966
|
callback = callback === undefined ? null : callback;
|
|
@@ -23952,9 +23970,9 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
23952
23970
|
error("render(...): Expected the last optional `callback` argument to be a " + "function. Instead received: %s.", callback);
|
|
23953
23971
|
}
|
|
23954
23972
|
}
|
|
23955
|
-
|
|
23973
|
+
update2.callback = callback;
|
|
23956
23974
|
}
|
|
23957
|
-
var root = enqueueUpdate(current$1,
|
|
23975
|
+
var root = enqueueUpdate(current$1, update2, lane);
|
|
23958
23976
|
if (root !== null) {
|
|
23959
23977
|
scheduleUpdateOnFiber(root, current$1, lane, eventTime);
|
|
23960
23978
|
entangleTransitions(root, current$1, lane);
|
|
@@ -24077,9 +24095,9 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
24077
24095
|
{
|
|
24078
24096
|
var copyWithDeleteImpl = function(obj, path25, index2) {
|
|
24079
24097
|
var key = path25[index2];
|
|
24080
|
-
var updated =
|
|
24098
|
+
var updated = isArray2(obj) ? obj.slice() : assign2({}, obj);
|
|
24081
24099
|
if (index2 + 1 === path25.length) {
|
|
24082
|
-
if (
|
|
24100
|
+
if (isArray2(updated)) {
|
|
24083
24101
|
updated.splice(key, 1);
|
|
24084
24102
|
} else {
|
|
24085
24103
|
delete updated[key];
|
|
@@ -24094,11 +24112,11 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
24094
24112
|
};
|
|
24095
24113
|
var copyWithRenameImpl = function(obj, oldPath, newPath, index2) {
|
|
24096
24114
|
var oldKey = oldPath[index2];
|
|
24097
|
-
var updated =
|
|
24115
|
+
var updated = isArray2(obj) ? obj.slice() : assign2({}, obj);
|
|
24098
24116
|
if (index2 + 1 === oldPath.length) {
|
|
24099
24117
|
var newKey = newPath[index2];
|
|
24100
24118
|
updated[newKey] = updated[oldKey];
|
|
24101
|
-
if (
|
|
24119
|
+
if (isArray2(updated)) {
|
|
24102
24120
|
updated.splice(oldKey, 1);
|
|
24103
24121
|
} else {
|
|
24104
24122
|
delete updated[oldKey];
|
|
@@ -24127,7 +24145,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
24127
24145
|
return value;
|
|
24128
24146
|
}
|
|
24129
24147
|
var key = path25[index2];
|
|
24130
|
-
var updated =
|
|
24148
|
+
var updated = isArray2(obj) ? obj.slice() : assign2({}, obj);
|
|
24131
24149
|
updated[key] = copyWithSetImpl(obj[key], path25, index2 + 1, value);
|
|
24132
24150
|
return updated;
|
|
24133
24151
|
};
|
|
@@ -24148,7 +24166,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
24148
24166
|
var newState = copyWithSet(hook.memoizedState, path25, value);
|
|
24149
24167
|
hook.memoizedState = newState;
|
|
24150
24168
|
hook.baseState = newState;
|
|
24151
|
-
fiber.memoizedProps =
|
|
24169
|
+
fiber.memoizedProps = assign2({}, fiber.memoizedProps);
|
|
24152
24170
|
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
24153
24171
|
if (root !== null) {
|
|
24154
24172
|
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
|
|
@@ -24161,7 +24179,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
24161
24179
|
var newState = copyWithDelete(hook.memoizedState, path25);
|
|
24162
24180
|
hook.memoizedState = newState;
|
|
24163
24181
|
hook.baseState = newState;
|
|
24164
|
-
fiber.memoizedProps =
|
|
24182
|
+
fiber.memoizedProps = assign2({}, fiber.memoizedProps);
|
|
24165
24183
|
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
24166
24184
|
if (root !== null) {
|
|
24167
24185
|
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
|
|
@@ -24174,7 +24192,7 @@ Check the render method of \`` + ownerName + "`.";
|
|
|
24174
24192
|
var newState = copyWithRename(hook.memoizedState, oldPath, newPath);
|
|
24175
24193
|
hook.memoizedState = newState;
|
|
24176
24194
|
hook.baseState = newState;
|
|
24177
|
-
fiber.memoizedProps =
|
|
24195
|
+
fiber.memoizedProps = assign2({}, fiber.memoizedProps);
|
|
24178
24196
|
var root = enqueueConcurrentRenderForLane(fiber, SyncLane);
|
|
24179
24197
|
if (root !== null) {
|
|
24180
24198
|
scheduleUpdateOnFiber(root, fiber, SyncLane, NoTimestamp);
|
|
@@ -24374,7 +24392,7 @@ var require_constants2 = __commonJS((exports, module) => {
|
|
|
24374
24392
|
var require_buffer_util = __commonJS((exports, module) => {
|
|
24375
24393
|
var { EMPTY_BUFFER } = require_constants2();
|
|
24376
24394
|
var FastBuffer = Buffer[Symbol.species];
|
|
24377
|
-
function
|
|
24395
|
+
function concat2(list, totalLength) {
|
|
24378
24396
|
if (list.length === 0)
|
|
24379
24397
|
return EMPTY_BUFFER;
|
|
24380
24398
|
if (list.length === 1)
|
|
@@ -24423,7 +24441,7 @@ var require_buffer_util = __commonJS((exports, module) => {
|
|
|
24423
24441
|
return buf;
|
|
24424
24442
|
}
|
|
24425
24443
|
module.exports = {
|
|
24426
|
-
concat,
|
|
24444
|
+
concat: concat2,
|
|
24427
24445
|
mask: _mask,
|
|
24428
24446
|
toArrayBuffer,
|
|
24429
24447
|
toBuffer,
|
|
@@ -24628,17 +24646,17 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
24628
24646
|
}
|
|
24629
24647
|
decompress(data, fin, callback) {
|
|
24630
24648
|
zlibLimiter.add((done) => {
|
|
24631
|
-
this._decompress(data, fin, (err,
|
|
24649
|
+
this._decompress(data, fin, (err, result2) => {
|
|
24632
24650
|
done();
|
|
24633
|
-
callback(err,
|
|
24651
|
+
callback(err, result2);
|
|
24634
24652
|
});
|
|
24635
24653
|
});
|
|
24636
24654
|
}
|
|
24637
24655
|
compress(data, fin, callback) {
|
|
24638
24656
|
zlibLimiter.add((done) => {
|
|
24639
|
-
this._compress(data, fin, (err,
|
|
24657
|
+
this._compress(data, fin, (err, result2) => {
|
|
24640
24658
|
done();
|
|
24641
|
-
callback(err,
|
|
24659
|
+
callback(err, result2);
|
|
24642
24660
|
});
|
|
24643
24661
|
});
|
|
24644
24662
|
}
|
|
@@ -24717,14 +24735,14 @@ var require_permessage_deflate = __commonJS((exports, module) => {
|
|
|
24717
24735
|
}
|
|
24718
24736
|
}
|
|
24719
24737
|
module.exports = PerMessageDeflate;
|
|
24720
|
-
function deflateOnData(
|
|
24721
|
-
this[kBuffers].push(
|
|
24722
|
-
this[kTotalLength] +=
|
|
24738
|
+
function deflateOnData(chunk2) {
|
|
24739
|
+
this[kBuffers].push(chunk2);
|
|
24740
|
+
this[kTotalLength] += chunk2.length;
|
|
24723
24741
|
}
|
|
24724
|
-
function inflateOnData(
|
|
24725
|
-
this[kTotalLength] +=
|
|
24742
|
+
function inflateOnData(chunk2) {
|
|
24743
|
+
this[kTotalLength] += chunk2.length;
|
|
24726
24744
|
if (this[kPerMessageDeflate]._maxPayload < 1 || this[kTotalLength] <= this[kPerMessageDeflate]._maxPayload) {
|
|
24727
|
-
this[kBuffers].push(
|
|
24745
|
+
this[kBuffers].push(chunk2);
|
|
24728
24746
|
return;
|
|
24729
24747
|
}
|
|
24730
24748
|
this[kError] = new RangeError("Max payload size exceeded");
|
|
@@ -24941,7 +24959,7 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
24941
24959
|
kStatusCode,
|
|
24942
24960
|
kWebSocket
|
|
24943
24961
|
} = require_constants2();
|
|
24944
|
-
var { concat, toArrayBuffer, unmask } = require_buffer_util();
|
|
24962
|
+
var { concat: concat2, toArrayBuffer, unmask } = require_buffer_util();
|
|
24945
24963
|
var { isValidStatusCode, isValidUTF8 } = require_validation();
|
|
24946
24964
|
var FastBuffer = Buffer[Symbol.species];
|
|
24947
24965
|
var GET_INFO = 0;
|
|
@@ -24978,11 +24996,11 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
24978
24996
|
this._loop = false;
|
|
24979
24997
|
this._state = GET_INFO;
|
|
24980
24998
|
}
|
|
24981
|
-
_write(
|
|
24999
|
+
_write(chunk2, encoding, cb) {
|
|
24982
25000
|
if (this._opcode === 8 && this._state == GET_INFO)
|
|
24983
25001
|
return cb();
|
|
24984
|
-
this._bufferedBytes +=
|
|
24985
|
-
this._buffers.push(
|
|
25002
|
+
this._bufferedBytes += chunk2.length;
|
|
25003
|
+
this._buffers.push(chunk2);
|
|
24986
25004
|
this.startLoop(cb);
|
|
24987
25005
|
}
|
|
24988
25006
|
consume(n) {
|
|
@@ -25222,9 +25240,9 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
25222
25240
|
if (this._opcode === 2) {
|
|
25223
25241
|
let data;
|
|
25224
25242
|
if (this._binaryType === "nodebuffer") {
|
|
25225
|
-
data =
|
|
25243
|
+
data = concat2(fragments, messageLength);
|
|
25226
25244
|
} else if (this._binaryType === "arraybuffer") {
|
|
25227
|
-
data = toArrayBuffer(
|
|
25245
|
+
data = toArrayBuffer(concat2(fragments, messageLength));
|
|
25228
25246
|
} else if (this._binaryType === "blob") {
|
|
25229
25247
|
data = new Blob(fragments);
|
|
25230
25248
|
} else {
|
|
@@ -25242,7 +25260,7 @@ var require_receiver = __commonJS((exports, module) => {
|
|
|
25242
25260
|
});
|
|
25243
25261
|
}
|
|
25244
25262
|
} else {
|
|
25245
|
-
const buf =
|
|
25263
|
+
const buf = concat2(fragments, messageLength);
|
|
25246
25264
|
if (!this._skipUTF8Validation && !isValidUTF8(buf)) {
|
|
25247
25265
|
const error = this.createError(Error, "invalid UTF-8 sequence", true, 1007, "WS_ERR_INVALID_UTF8");
|
|
25248
25266
|
cb(error);
|
|
@@ -25347,7 +25365,7 @@ var require_sender = __commonJS((exports, module) => {
|
|
|
25347
25365
|
}
|
|
25348
25366
|
static frame(data, options) {
|
|
25349
25367
|
let mask;
|
|
25350
|
-
let
|
|
25368
|
+
let merge2 = false;
|
|
25351
25369
|
let offset = 2;
|
|
25352
25370
|
let skipMasking = false;
|
|
25353
25371
|
if (options.mask) {
|
|
@@ -25380,7 +25398,7 @@ var require_sender = __commonJS((exports, module) => {
|
|
|
25380
25398
|
}
|
|
25381
25399
|
} else {
|
|
25382
25400
|
dataLength = data.length;
|
|
25383
|
-
|
|
25401
|
+
merge2 = options.mask && options.readOnly && !skipMasking;
|
|
25384
25402
|
}
|
|
25385
25403
|
let payloadLength = dataLength;
|
|
25386
25404
|
if (dataLength >= 65536) {
|
|
@@ -25390,7 +25408,7 @@ var require_sender = __commonJS((exports, module) => {
|
|
|
25390
25408
|
offset += 2;
|
|
25391
25409
|
payloadLength = 126;
|
|
25392
25410
|
}
|
|
25393
|
-
const target = Buffer.allocUnsafe(
|
|
25411
|
+
const target = Buffer.allocUnsafe(merge2 ? dataLength + offset : offset);
|
|
25394
25412
|
target[0] = options.fin ? options.opcode | 128 : options.opcode;
|
|
25395
25413
|
if (options.rsv1)
|
|
25396
25414
|
target[0] |= 64;
|
|
@@ -25410,7 +25428,7 @@ var require_sender = __commonJS((exports, module) => {
|
|
|
25410
25428
|
target[offset - 1] = mask[3];
|
|
25411
25429
|
if (skipMasking)
|
|
25412
25430
|
return [target, data];
|
|
25413
|
-
if (
|
|
25431
|
+
if (merge2) {
|
|
25414
25432
|
applyMask(data, mask, target, offset, dataLength);
|
|
25415
25433
|
return [target];
|
|
25416
25434
|
}
|
|
@@ -25971,10 +25989,10 @@ var require_extension = __commonJS((exports, module) => {
|
|
|
25971
25989
|
configurations = [configurations];
|
|
25972
25990
|
return configurations.map((params) => {
|
|
25973
25991
|
return [extension].concat(Object.keys(params).map((k2) => {
|
|
25974
|
-
let
|
|
25975
|
-
if (!Array.isArray(
|
|
25976
|
-
|
|
25977
|
-
return
|
|
25992
|
+
let values2 = params[k2];
|
|
25993
|
+
if (!Array.isArray(values2))
|
|
25994
|
+
values2 = [values2];
|
|
25995
|
+
return values2.map((v2) => v2 === true ? k2 : `${k2}=${v2}`).join("; ");
|
|
25978
25996
|
})).join("; ");
|
|
25979
25997
|
}).join(", ");
|
|
25980
25998
|
}).join(", ");
|
|
@@ -26097,7 +26115,7 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
26097
26115
|
get url() {
|
|
26098
26116
|
return this._url;
|
|
26099
26117
|
}
|
|
26100
|
-
setSocket(socket,
|
|
26118
|
+
setSocket(socket, head3, options) {
|
|
26101
26119
|
const receiver = new Receiver({
|
|
26102
26120
|
allowSynchronousEvents: options.allowSynchronousEvents,
|
|
26103
26121
|
binaryType: this.binaryType,
|
|
@@ -26124,8 +26142,8 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
26124
26142
|
socket.setTimeout(0);
|
|
26125
26143
|
if (socket.setNoDelay)
|
|
26126
26144
|
socket.setNoDelay();
|
|
26127
|
-
if (
|
|
26128
|
-
socket.unshift(
|
|
26145
|
+
if (head3.length > 0)
|
|
26146
|
+
socket.unshift(head3);
|
|
26129
26147
|
socket.on("close", socketOnClose);
|
|
26130
26148
|
socket.on("data", socketOnData);
|
|
26131
26149
|
socket.on("end", socketOnEnd);
|
|
@@ -26308,29 +26326,29 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
26308
26326
|
"protocol",
|
|
26309
26327
|
"readyState",
|
|
26310
26328
|
"url"
|
|
26311
|
-
].forEach((
|
|
26312
|
-
Object.defineProperty(WebSocket.prototype,
|
|
26329
|
+
].forEach((property2) => {
|
|
26330
|
+
Object.defineProperty(WebSocket.prototype, property2, { enumerable: true });
|
|
26313
26331
|
});
|
|
26314
|
-
["open", "error", "close", "message"].forEach((
|
|
26315
|
-
Object.defineProperty(WebSocket.prototype, `on${
|
|
26332
|
+
["open", "error", "close", "message"].forEach((method2) => {
|
|
26333
|
+
Object.defineProperty(WebSocket.prototype, `on${method2}`, {
|
|
26316
26334
|
enumerable: true,
|
|
26317
26335
|
get() {
|
|
26318
|
-
for (const listener of this.listeners(
|
|
26336
|
+
for (const listener of this.listeners(method2)) {
|
|
26319
26337
|
if (listener[kForOnEventAttribute])
|
|
26320
26338
|
return listener[kListener];
|
|
26321
26339
|
}
|
|
26322
26340
|
return null;
|
|
26323
26341
|
},
|
|
26324
26342
|
set(handler) {
|
|
26325
|
-
for (const listener of this.listeners(
|
|
26343
|
+
for (const listener of this.listeners(method2)) {
|
|
26326
26344
|
if (listener[kForOnEventAttribute]) {
|
|
26327
|
-
this.removeListener(
|
|
26345
|
+
this.removeListener(method2, listener);
|
|
26328
26346
|
break;
|
|
26329
26347
|
}
|
|
26330
26348
|
}
|
|
26331
26349
|
if (typeof handler !== "function")
|
|
26332
26350
|
return;
|
|
26333
|
-
this.addEventListener(
|
|
26351
|
+
this.addEventListener(method2, handler, {
|
|
26334
26352
|
[kForOnEventAttribute]: true
|
|
26335
26353
|
});
|
|
26336
26354
|
}
|
|
@@ -26518,7 +26536,7 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
26518
26536
|
abortHandshake(websocket, req, `Unexpected server response: ${res.statusCode}`);
|
|
26519
26537
|
}
|
|
26520
26538
|
});
|
|
26521
|
-
req.on("upgrade", (res, socket,
|
|
26539
|
+
req.on("upgrade", (res, socket, head3) => {
|
|
26522
26540
|
websocket.emit("upgrade", res);
|
|
26523
26541
|
if (websocket.readyState !== WebSocket.CONNECTING)
|
|
26524
26542
|
return;
|
|
@@ -26580,7 +26598,7 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
26580
26598
|
}
|
|
26581
26599
|
websocket._extensions[PerMessageDeflate.extensionName] = perMessageDeflate;
|
|
26582
26600
|
}
|
|
26583
|
-
websocket.setSocket(socket,
|
|
26601
|
+
websocket.setSocket(socket, head3, {
|
|
26584
26602
|
allowSynchronousEvents: opts.allowSynchronousEvents,
|
|
26585
26603
|
generateMask: opts.generateMask,
|
|
26586
26604
|
maxPayload: opts.maxPayload,
|
|
@@ -26713,8 +26731,8 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
26713
26731
|
this.removeListener("end", socketOnEnd);
|
|
26714
26732
|
websocket._readyState = WebSocket.CLOSING;
|
|
26715
26733
|
if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) {
|
|
26716
|
-
const
|
|
26717
|
-
websocket._receiver.write(
|
|
26734
|
+
const chunk2 = this.read(this._readableState.length);
|
|
26735
|
+
websocket._receiver.write(chunk2);
|
|
26718
26736
|
}
|
|
26719
26737
|
websocket._receiver.end();
|
|
26720
26738
|
this[kWebSocket] = undefined;
|
|
@@ -26726,8 +26744,8 @@ var require_websocket = __commonJS((exports, module) => {
|
|
|
26726
26744
|
websocket._receiver.on("finish", receiverOnFinish);
|
|
26727
26745
|
}
|
|
26728
26746
|
}
|
|
26729
|
-
function socketOnData(
|
|
26730
|
-
if (!this[kWebSocket]._receiver.write(
|
|
26747
|
+
function socketOnData(chunk2) {
|
|
26748
|
+
if (!this[kWebSocket]._receiver.write(chunk2)) {
|
|
26731
26749
|
this.pause();
|
|
26732
26750
|
}
|
|
26733
26751
|
}
|
|
@@ -26835,14 +26853,14 @@ var require_stream = __commonJS((exports, module) => {
|
|
|
26835
26853
|
if (ws.isPaused)
|
|
26836
26854
|
ws.resume();
|
|
26837
26855
|
};
|
|
26838
|
-
duplex._write = function(
|
|
26856
|
+
duplex._write = function(chunk2, encoding, callback) {
|
|
26839
26857
|
if (ws.readyState === ws.CONNECTING) {
|
|
26840
26858
|
ws.once("open", function open() {
|
|
26841
|
-
duplex._write(
|
|
26859
|
+
duplex._write(chunk2, encoding, callback);
|
|
26842
26860
|
});
|
|
26843
26861
|
return;
|
|
26844
26862
|
}
|
|
26845
|
-
ws.send(
|
|
26863
|
+
ws.send(chunk2, callback);
|
|
26846
26864
|
};
|
|
26847
26865
|
duplex.on("end", duplexOnEnd);
|
|
26848
26866
|
duplex.on("error", duplexOnError);
|
|
@@ -26955,8 +26973,8 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
26955
26973
|
this._removeListeners = addListeners(this._server, {
|
|
26956
26974
|
listening: this.emit.bind(this, "listening"),
|
|
26957
26975
|
error: this.emit.bind(this, "error"),
|
|
26958
|
-
upgrade: (req, socket,
|
|
26959
|
-
this.handleUpgrade(req, socket,
|
|
26976
|
+
upgrade: (req, socket, head3) => {
|
|
26977
|
+
this.handleUpgrade(req, socket, head3, emitConnection);
|
|
26960
26978
|
}
|
|
26961
26979
|
});
|
|
26962
26980
|
}
|
|
@@ -27024,7 +27042,7 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
27024
27042
|
}
|
|
27025
27043
|
return true;
|
|
27026
27044
|
}
|
|
27027
|
-
handleUpgrade(req, socket,
|
|
27045
|
+
handleUpgrade(req, socket, head3, cb) {
|
|
27028
27046
|
socket.on("error", socketOnError);
|
|
27029
27047
|
const key = req.headers["sec-websocket-key"];
|
|
27030
27048
|
const upgrade = req.headers.upgrade;
|
|
@@ -27097,16 +27115,16 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
27097
27115
|
if (!verified) {
|
|
27098
27116
|
return abortHandshake(socket, code || 401, message, headers);
|
|
27099
27117
|
}
|
|
27100
|
-
this.completeUpgrade(extensions, key, protocols, req, socket,
|
|
27118
|
+
this.completeUpgrade(extensions, key, protocols, req, socket, head3, cb);
|
|
27101
27119
|
});
|
|
27102
27120
|
return;
|
|
27103
27121
|
}
|
|
27104
27122
|
if (!this.options.verifyClient(info))
|
|
27105
27123
|
return abortHandshake(socket, 401);
|
|
27106
27124
|
}
|
|
27107
|
-
this.completeUpgrade(extensions, key, protocols, req, socket,
|
|
27125
|
+
this.completeUpgrade(extensions, key, protocols, req, socket, head3, cb);
|
|
27108
27126
|
}
|
|
27109
|
-
completeUpgrade(extensions, key, protocols, req, socket,
|
|
27127
|
+
completeUpgrade(extensions, key, protocols, req, socket, head3, cb) {
|
|
27110
27128
|
if (!socket.readable || !socket.writable)
|
|
27111
27129
|
return socket.destroy();
|
|
27112
27130
|
if (socket[kWebSocket]) {
|
|
@@ -27142,7 +27160,7 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
27142
27160
|
`).join(`\r
|
|
27143
27161
|
`));
|
|
27144
27162
|
socket.removeListener("error", socketOnError);
|
|
27145
|
-
ws.setSocket(socket,
|
|
27163
|
+
ws.setSocket(socket, head3, {
|
|
27146
27164
|
allowSynchronousEvents: this.options.allowSynchronousEvents,
|
|
27147
27165
|
maxPayload: this.options.maxPayload,
|
|
27148
27166
|
skipUTF8Validation: this.options.skipUTF8Validation
|
|
@@ -27160,12 +27178,12 @@ var require_websocket_server = __commonJS((exports, module) => {
|
|
|
27160
27178
|
}
|
|
27161
27179
|
}
|
|
27162
27180
|
module.exports = WebSocketServer;
|
|
27163
|
-
function addListeners(server,
|
|
27164
|
-
for (const event of Object.keys(
|
|
27165
|
-
server.on(event,
|
|
27181
|
+
function addListeners(server, map2) {
|
|
27182
|
+
for (const event of Object.keys(map2))
|
|
27183
|
+
server.on(event, map2[event]);
|
|
27166
27184
|
return function removeListeners() {
|
|
27167
|
-
for (const event of Object.keys(
|
|
27168
|
-
server.removeListener(event,
|
|
27185
|
+
for (const event of Object.keys(map2)) {
|
|
27186
|
+
server.removeListener(event, map2[event]);
|
|
27169
27187
|
}
|
|
27170
27188
|
};
|
|
27171
27189
|
}
|
|
@@ -27473,7 +27491,7 @@ var require_stack_utils = __commonJS((exports, module) => {
|
|
|
27473
27491
|
}
|
|
27474
27492
|
let outdent = false;
|
|
27475
27493
|
let lastNonAtLine = null;
|
|
27476
|
-
const
|
|
27494
|
+
const result2 = [];
|
|
27477
27495
|
stack.forEach((st) => {
|
|
27478
27496
|
st = st.replace(/\\/g, "/");
|
|
27479
27497
|
if (this._internals.some((internal) => internal.test(st))) {
|
|
@@ -27492,17 +27510,17 @@ var require_stack_utils = __commonJS((exports, module) => {
|
|
|
27492
27510
|
if (st) {
|
|
27493
27511
|
if (isAtLine) {
|
|
27494
27512
|
if (lastNonAtLine) {
|
|
27495
|
-
|
|
27513
|
+
result2.push(lastNonAtLine);
|
|
27496
27514
|
lastNonAtLine = null;
|
|
27497
27515
|
}
|
|
27498
|
-
|
|
27516
|
+
result2.push(st);
|
|
27499
27517
|
} else {
|
|
27500
27518
|
outdent = true;
|
|
27501
27519
|
lastNonAtLine = st;
|
|
27502
27520
|
}
|
|
27503
27521
|
}
|
|
27504
27522
|
});
|
|
27505
|
-
return
|
|
27523
|
+
return result2.map((line) => `${indent}${line}
|
|
27506
27524
|
`).join("");
|
|
27507
27525
|
}
|
|
27508
27526
|
captureString(limit, fn = this.captureString) {
|
|
@@ -27596,7 +27614,7 @@ var require_stack_utils = __commonJS((exports, module) => {
|
|
|
27596
27614
|
const col = match[9];
|
|
27597
27615
|
const native = match[10] === "native";
|
|
27598
27616
|
const closeParen = match[11] === ")";
|
|
27599
|
-
let
|
|
27617
|
+
let method2;
|
|
27600
27618
|
const res = {};
|
|
27601
27619
|
if (lnum) {
|
|
27602
27620
|
res.line = Number(lnum);
|
|
@@ -27612,10 +27630,10 @@ var require_stack_utils = __commonJS((exports, module) => {
|
|
|
27612
27630
|
} else if (file.charAt(i) === "(" && file.charAt(i - 1) === " ") {
|
|
27613
27631
|
closes--;
|
|
27614
27632
|
if (closes === -1 && file.charAt(i - 1) === " ") {
|
|
27615
|
-
const
|
|
27616
|
-
const
|
|
27617
|
-
file =
|
|
27618
|
-
fname += ` (${
|
|
27633
|
+
const before2 = file.slice(0, i - 1);
|
|
27634
|
+
const after2 = file.slice(i + 1);
|
|
27635
|
+
file = after2;
|
|
27636
|
+
fname += ` (${before2}`;
|
|
27619
27637
|
break;
|
|
27620
27638
|
}
|
|
27621
27639
|
}
|
|
@@ -27625,7 +27643,7 @@ var require_stack_utils = __commonJS((exports, module) => {
|
|
|
27625
27643
|
const methodMatch = fname.match(methodRe);
|
|
27626
27644
|
if (methodMatch) {
|
|
27627
27645
|
fname = methodMatch[1];
|
|
27628
|
-
|
|
27646
|
+
method2 = methodMatch[2];
|
|
27629
27647
|
}
|
|
27630
27648
|
}
|
|
27631
27649
|
setFile(res, file, this._cwd);
|
|
@@ -27647,19 +27665,19 @@ var require_stack_utils = __commonJS((exports, module) => {
|
|
|
27647
27665
|
if (fname) {
|
|
27648
27666
|
res.function = fname;
|
|
27649
27667
|
}
|
|
27650
|
-
if (
|
|
27651
|
-
res.method =
|
|
27668
|
+
if (method2 && fname !== method2) {
|
|
27669
|
+
res.method = method2;
|
|
27652
27670
|
}
|
|
27653
27671
|
return res;
|
|
27654
27672
|
}
|
|
27655
27673
|
}
|
|
27656
|
-
function setFile(
|
|
27674
|
+
function setFile(result2, filename, cwd2) {
|
|
27657
27675
|
if (filename) {
|
|
27658
27676
|
filename = filename.replace(/\\/g, "/");
|
|
27659
27677
|
if (filename.startsWith(`${cwd2}/`)) {
|
|
27660
27678
|
filename = filename.slice(cwd2.length + 1);
|
|
27661
27679
|
}
|
|
27662
|
-
|
|
27680
|
+
result2.file = filename;
|
|
27663
27681
|
}
|
|
27664
27682
|
}
|
|
27665
27683
|
function ignoredPackagesRegExp(ignoredPackages) {
|
|
@@ -27823,7 +27841,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
|
|
|
27823
27841
|
}
|
|
27824
27842
|
return null;
|
|
27825
27843
|
}
|
|
27826
|
-
var
|
|
27844
|
+
var assign2 = Object.assign;
|
|
27827
27845
|
var disabledDepth = 0;
|
|
27828
27846
|
var prevLog;
|
|
27829
27847
|
var prevInfo;
|
|
@@ -27873,25 +27891,25 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
|
|
|
27873
27891
|
writable: true
|
|
27874
27892
|
};
|
|
27875
27893
|
Object.defineProperties(console, {
|
|
27876
|
-
log:
|
|
27894
|
+
log: assign2({}, props, {
|
|
27877
27895
|
value: prevLog
|
|
27878
27896
|
}),
|
|
27879
|
-
info:
|
|
27897
|
+
info: assign2({}, props, {
|
|
27880
27898
|
value: prevInfo
|
|
27881
27899
|
}),
|
|
27882
|
-
warn:
|
|
27900
|
+
warn: assign2({}, props, {
|
|
27883
27901
|
value: prevWarn
|
|
27884
27902
|
}),
|
|
27885
|
-
error:
|
|
27903
|
+
error: assign2({}, props, {
|
|
27886
27904
|
value: prevError
|
|
27887
27905
|
}),
|
|
27888
|
-
group:
|
|
27906
|
+
group: assign2({}, props, {
|
|
27889
27907
|
value: prevGroup
|
|
27890
27908
|
}),
|
|
27891
|
-
groupCollapsed:
|
|
27909
|
+
groupCollapsed: assign2({}, props, {
|
|
27892
27910
|
value: prevGroupCollapsed
|
|
27893
27911
|
}),
|
|
27894
|
-
groupEnd:
|
|
27912
|
+
groupEnd: assign2({}, props, {
|
|
27895
27913
|
value: prevGroupEnd
|
|
27896
27914
|
})
|
|
27897
27915
|
});
|
|
@@ -27976,9 +27994,9 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
|
|
|
27976
27994
|
}
|
|
27977
27995
|
fn();
|
|
27978
27996
|
}
|
|
27979
|
-
} catch (
|
|
27980
|
-
if (
|
|
27981
|
-
var sampleLines =
|
|
27997
|
+
} catch (sample2) {
|
|
27998
|
+
if (sample2 && control && typeof sample2.stack === "string") {
|
|
27999
|
+
var sampleLines = sample2.stack.split(`
|
|
27982
28000
|
`);
|
|
27983
28001
|
var controlLines = control.stack.split(`
|
|
27984
28002
|
`);
|
|
@@ -28088,11 +28106,11 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
|
|
|
28088
28106
|
}
|
|
28089
28107
|
}
|
|
28090
28108
|
}
|
|
28091
|
-
function checkPropTypes(typeSpecs,
|
|
28109
|
+
function checkPropTypes(typeSpecs, values2, location, componentName, element) {
|
|
28092
28110
|
{
|
|
28093
|
-
var
|
|
28111
|
+
var has2 = Function.call.bind(hasOwnProperty);
|
|
28094
28112
|
for (var typeSpecName in typeSpecs) {
|
|
28095
|
-
if (
|
|
28113
|
+
if (has2(typeSpecs, typeSpecName)) {
|
|
28096
28114
|
var error$1 = undefined;
|
|
28097
28115
|
try {
|
|
28098
28116
|
if (typeof typeSpecs[typeSpecName] !== "function") {
|
|
@@ -28100,7 +28118,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
|
|
|
28100
28118
|
err.name = "Invariant Violation";
|
|
28101
28119
|
throw err;
|
|
28102
28120
|
}
|
|
28103
|
-
error$1 = typeSpecs[typeSpecName](
|
|
28121
|
+
error$1 = typeSpecs[typeSpecName](values2, typeSpecName, componentName, location, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
28104
28122
|
} catch (ex) {
|
|
28105
28123
|
error$1 = ex;
|
|
28106
28124
|
}
|
|
@@ -28120,7 +28138,7 @@ var require_react_jsx_dev_runtime_development = __commonJS((exports) => {
|
|
|
28120
28138
|
}
|
|
28121
28139
|
}
|
|
28122
28140
|
var isArrayImpl = Array.isArray;
|
|
28123
|
-
function
|
|
28141
|
+
function isArray2(a3) {
|
|
28124
28142
|
return isArrayImpl(a3);
|
|
28125
28143
|
}
|
|
28126
28144
|
function typeName(value) {
|
|
@@ -28397,7 +28415,7 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
28397
28415
|
if (typeof node !== "object") {
|
|
28398
28416
|
return;
|
|
28399
28417
|
}
|
|
28400
|
-
if (
|
|
28418
|
+
if (isArray2(node)) {
|
|
28401
28419
|
for (var i = 0;i < node.length; i++) {
|
|
28402
28420
|
var child = node[i];
|
|
28403
28421
|
if (isValidElement(child)) {
|
|
@@ -28453,9 +28471,9 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
28453
28471
|
}
|
|
28454
28472
|
function validateFragmentProps(fragment) {
|
|
28455
28473
|
{
|
|
28456
|
-
var
|
|
28457
|
-
for (var i = 0;i <
|
|
28458
|
-
var key =
|
|
28474
|
+
var keys2 = Object.keys(fragment.props);
|
|
28475
|
+
for (var i = 0;i < keys2.length; i++) {
|
|
28476
|
+
var key = keys2[i];
|
|
28459
28477
|
if (key !== "children" && key !== "key") {
|
|
28460
28478
|
setCurrentlyValidatingElement$1(fragment);
|
|
28461
28479
|
error("Invalid prop `%s` supplied to `React.Fragment`. " + "React.Fragment can only have `key` and `children` props.", key);
|
|
@@ -28488,7 +28506,7 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
28488
28506
|
var typeString;
|
|
28489
28507
|
if (type === null) {
|
|
28490
28508
|
typeString = "null";
|
|
28491
|
-
} else if (
|
|
28509
|
+
} else if (isArray2(type)) {
|
|
28492
28510
|
typeString = "array";
|
|
28493
28511
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
28494
28512
|
typeString = "<" + (getComponentNameFromType(type.type) || "Unknown") + " />";
|
|
@@ -28506,7 +28524,7 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
28506
28524
|
var children = props.children;
|
|
28507
28525
|
if (children !== undefined) {
|
|
28508
28526
|
if (isStaticChildren) {
|
|
28509
|
-
if (
|
|
28527
|
+
if (isArray2(children)) {
|
|
28510
28528
|
for (var i = 0;i < children.length; i++) {
|
|
28511
28529
|
validateChildKeys(children[i], type);
|
|
28512
28530
|
}
|
|
@@ -28524,12 +28542,12 @@ Check the top-level render call using <` + parentName + ">.";
|
|
|
28524
28542
|
{
|
|
28525
28543
|
if (hasOwnProperty.call(props, "key")) {
|
|
28526
28544
|
var componentName = getComponentNameFromType(type);
|
|
28527
|
-
var
|
|
28545
|
+
var keys2 = Object.keys(props).filter(function(k2) {
|
|
28528
28546
|
return k2 !== "key";
|
|
28529
28547
|
});
|
|
28530
|
-
var beforeExample =
|
|
28548
|
+
var beforeExample = keys2.length > 0 ? "{key: someKey, " + keys2.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
28531
28549
|
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
28532
|
-
var afterExample =
|
|
28550
|
+
var afterExample = keys2.length > 0 ? "{" + keys2.join(": ..., ") + ": ...}" : "{}";
|
|
28533
28551
|
error(`A props object containing a "key" prop is being spread into JSX:
|
|
28534
28552
|
` + ` let props = %s;
|
|
28535
28553
|
` + ` <%s {...props} />
|
|
@@ -29428,9 +29446,73 @@ function padStart(s, n) {
|
|
|
29428
29446
|
const len = visibleLength(s);
|
|
29429
29447
|
return len >= n ? s : " ".repeat(n - len) + s;
|
|
29430
29448
|
}
|
|
29449
|
+
// package.json
|
|
29450
|
+
var package_default = {
|
|
29451
|
+
name: "@brainbase-labs/cli",
|
|
29452
|
+
version: "0.7.0",
|
|
29453
|
+
description: "Pack, share, and install agent templates across harnesses (Claude Code, Codex, ...).",
|
|
29454
|
+
type: "module",
|
|
29455
|
+
bin: {
|
|
29456
|
+
brainbase: "dist/index.js"
|
|
29457
|
+
},
|
|
29458
|
+
files: [
|
|
29459
|
+
"dist",
|
|
29460
|
+
"README.md",
|
|
29461
|
+
"LICENSE"
|
|
29462
|
+
],
|
|
29463
|
+
scripts: {
|
|
29464
|
+
dev: "bun run src/index.ts",
|
|
29465
|
+
build: "bun run scripts/build.ts",
|
|
29466
|
+
typecheck: "tsc --noEmit",
|
|
29467
|
+
prepublishOnly: "bun run typecheck && bun run build"
|
|
29468
|
+
},
|
|
29469
|
+
repository: {
|
|
29470
|
+
type: "git",
|
|
29471
|
+
url: "git+https://github.com/BrainbaseHQ/cli.git"
|
|
29472
|
+
},
|
|
29473
|
+
homepage: "https://github.com/BrainbaseHQ/cli#readme",
|
|
29474
|
+
bugs: {
|
|
29475
|
+
url: "https://github.com/BrainbaseHQ/cli/issues"
|
|
29476
|
+
},
|
|
29477
|
+
keywords: [
|
|
29478
|
+
"brainbase",
|
|
29479
|
+
"cli",
|
|
29480
|
+
"agents",
|
|
29481
|
+
"claude-code",
|
|
29482
|
+
"codex",
|
|
29483
|
+
"templates",
|
|
29484
|
+
"ai"
|
|
29485
|
+
],
|
|
29486
|
+
license: "MIT",
|
|
29487
|
+
publishConfig: {
|
|
29488
|
+
access: "public"
|
|
29489
|
+
},
|
|
29490
|
+
dependencies: {
|
|
29491
|
+
"@clack/prompts": "^0.7.0",
|
|
29492
|
+
ink: "^5.1.0",
|
|
29493
|
+
picocolors: "^1.0.0",
|
|
29494
|
+
react: "^18.3.1",
|
|
29495
|
+
"smol-toml": "^1.6.1",
|
|
29496
|
+
tar: "^7.4.3",
|
|
29497
|
+
yaml: "^2.8.4",
|
|
29498
|
+
zod: "^3.23.8"
|
|
29499
|
+
},
|
|
29500
|
+
devDependencies: {
|
|
29501
|
+
"@types/bun": "latest",
|
|
29502
|
+
"@types/node": "^20.0.0",
|
|
29503
|
+
"@types/react": "^18.3.0",
|
|
29504
|
+
"@types/tar": "^6.1.13",
|
|
29505
|
+
typescript: "^5.5.0"
|
|
29506
|
+
},
|
|
29507
|
+
engines: {
|
|
29508
|
+
node: ">=18"
|
|
29509
|
+
}
|
|
29510
|
+
};
|
|
29511
|
+
|
|
29512
|
+
// src/core/version.ts
|
|
29513
|
+
var VERSION = package_default.version;
|
|
29431
29514
|
|
|
29432
29515
|
// src/ui/banner.ts
|
|
29433
|
-
var VERSION = "0.1.0";
|
|
29434
29516
|
var WIDTH = 60;
|
|
29435
29517
|
function banner(subtitle) {
|
|
29436
29518
|
const ver = import_picocolors4.default.dim(`v${VERSION}`);
|
|
@@ -37624,7 +37706,6 @@ import process12 from "node:process";
|
|
|
37624
37706
|
// node_modules/ink/build/ink.js
|
|
37625
37707
|
var import_react10 = __toESM(require_react(), 1);
|
|
37626
37708
|
import process11 from "node:process";
|
|
37627
|
-
|
|
37628
37709
|
// node_modules/es-toolkit/dist/function/debounce.mjs
|
|
37629
37710
|
function debounce(func, debounceMs, { signal, edges } = {}) {
|
|
37630
37711
|
let pendingThis = undefined;
|
|
@@ -37957,7 +38038,7 @@ var getAllProperties = (object) => {
|
|
|
37957
38038
|
return properties;
|
|
37958
38039
|
};
|
|
37959
38040
|
function autoBind(self, { include, exclude } = {}) {
|
|
37960
|
-
const
|
|
38041
|
+
const filter2 = (key) => {
|
|
37961
38042
|
const match = (pattern) => typeof pattern === "string" ? key === pattern : pattern.test(key);
|
|
37962
38043
|
if (include) {
|
|
37963
38044
|
return include.some(match);
|
|
@@ -37968,7 +38049,7 @@ function autoBind(self, { include, exclude } = {}) {
|
|
|
37968
38049
|
return true;
|
|
37969
38050
|
};
|
|
37970
38051
|
for (const [object, key] of getAllProperties(self.constructor.prototype)) {
|
|
37971
|
-
if (key === "constructor" || !
|
|
38052
|
+
if (key === "constructor" || !filter2(key)) {
|
|
37972
38053
|
continue;
|
|
37973
38054
|
}
|
|
37974
38055
|
const descriptor = Reflect.getOwnPropertyDescriptor(object, key);
|
|
@@ -38015,13 +38096,13 @@ var patchConsole = (callback) => {
|
|
|
38015
38096
|
callback("stderr", data);
|
|
38016
38097
|
};
|
|
38017
38098
|
const internalConsole = new console.Console(stdout, stderr);
|
|
38018
|
-
for (const
|
|
38019
|
-
originalMethods[
|
|
38020
|
-
console[
|
|
38099
|
+
for (const method2 of consoleMethods) {
|
|
38100
|
+
originalMethods[method2] = console[method2];
|
|
38101
|
+
console[method2] = internalConsole[method2];
|
|
38021
38102
|
}
|
|
38022
38103
|
return () => {
|
|
38023
|
-
for (const
|
|
38024
|
-
console[
|
|
38104
|
+
for (const method2 of consoleMethods) {
|
|
38105
|
+
console[method2] = originalMethods[method2];
|
|
38025
38106
|
}
|
|
38026
38107
|
originalMethods = {};
|
|
38027
38108
|
};
|
|
@@ -39946,11 +40027,11 @@ function assembleStyles() {
|
|
|
39946
40027
|
},
|
|
39947
40028
|
hexToRgb: {
|
|
39948
40029
|
value(hex) {
|
|
39949
|
-
const
|
|
39950
|
-
if (!
|
|
40030
|
+
const matches2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
40031
|
+
if (!matches2) {
|
|
39951
40032
|
return [0, 0, 0];
|
|
39952
40033
|
}
|
|
39953
|
-
let [colorString] =
|
|
40034
|
+
let [colorString] = matches2;
|
|
39954
40035
|
if (colorString.length === 3) {
|
|
39955
40036
|
colorString = [...colorString].map((character) => character + character).join("");
|
|
39956
40037
|
}
|
|
@@ -39993,11 +40074,11 @@ function assembleStyles() {
|
|
|
39993
40074
|
if (value === 0) {
|
|
39994
40075
|
return 30;
|
|
39995
40076
|
}
|
|
39996
|
-
let
|
|
40077
|
+
let result2 = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
39997
40078
|
if (value === 2) {
|
|
39998
|
-
|
|
40079
|
+
result2 += 60;
|
|
39999
40080
|
}
|
|
40000
|
-
return
|
|
40081
|
+
return result2;
|
|
40001
40082
|
},
|
|
40002
40083
|
enumerable: false
|
|
40003
40084
|
},
|
|
@@ -40069,18 +40150,18 @@ var wrapWord = (rows, word, columns) => {
|
|
|
40069
40150
|
}
|
|
40070
40151
|
};
|
|
40071
40152
|
var stringVisibleTrimSpacesRight = (string) => {
|
|
40072
|
-
const
|
|
40073
|
-
let
|
|
40074
|
-
while (
|
|
40075
|
-
if (stringWidth(
|
|
40153
|
+
const words2 = string.split(" ");
|
|
40154
|
+
let last2 = words2.length;
|
|
40155
|
+
while (last2 > 0) {
|
|
40156
|
+
if (stringWidth(words2[last2 - 1]) > 0) {
|
|
40076
40157
|
break;
|
|
40077
40158
|
}
|
|
40078
|
-
|
|
40159
|
+
last2--;
|
|
40079
40160
|
}
|
|
40080
|
-
if (
|
|
40161
|
+
if (last2 === words2.length) {
|
|
40081
40162
|
return string;
|
|
40082
40163
|
}
|
|
40083
|
-
return
|
|
40164
|
+
return words2.slice(0, last2).join(" ") + words2.slice(last2).join("");
|
|
40084
40165
|
};
|
|
40085
40166
|
var exec = (string, columns, options = {}) => {
|
|
40086
40167
|
if (options.trim !== false && string.trim() === "") {
|
|
@@ -40746,26 +40827,26 @@ $ npm install --save-dev react-devtools-core
|
|
|
40746
40827
|
}
|
|
40747
40828
|
}
|
|
40748
40829
|
}
|
|
40749
|
-
var diff = (
|
|
40750
|
-
if (
|
|
40830
|
+
var diff = (before2, after2) => {
|
|
40831
|
+
if (before2 === after2) {
|
|
40751
40832
|
return;
|
|
40752
40833
|
}
|
|
40753
|
-
if (!
|
|
40754
|
-
return
|
|
40834
|
+
if (!before2) {
|
|
40835
|
+
return after2;
|
|
40755
40836
|
}
|
|
40756
40837
|
const changed = {};
|
|
40757
40838
|
let isChanged = false;
|
|
40758
|
-
for (const key of Object.keys(
|
|
40759
|
-
const isDeleted =
|
|
40839
|
+
for (const key of Object.keys(before2)) {
|
|
40840
|
+
const isDeleted = after2 ? !Object.hasOwn(after2, key) : true;
|
|
40760
40841
|
if (isDeleted) {
|
|
40761
40842
|
changed[key] = undefined;
|
|
40762
40843
|
isChanged = true;
|
|
40763
40844
|
}
|
|
40764
40845
|
}
|
|
40765
|
-
if (
|
|
40766
|
-
for (const key of Object.keys(
|
|
40767
|
-
if (
|
|
40768
|
-
changed[key] =
|
|
40846
|
+
if (after2) {
|
|
40847
|
+
for (const key of Object.keys(after2)) {
|
|
40848
|
+
if (after2[key] !== before2[key]) {
|
|
40849
|
+
changed[key] = after2[key];
|
|
40769
40850
|
isChanged = true;
|
|
40770
40851
|
}
|
|
40771
40852
|
}
|
|
@@ -41070,11 +41151,11 @@ function assembleStyles2() {
|
|
|
41070
41151
|
},
|
|
41071
41152
|
hexToRgb: {
|
|
41072
41153
|
value(hex) {
|
|
41073
|
-
const
|
|
41074
|
-
if (!
|
|
41154
|
+
const matches2 = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
41155
|
+
if (!matches2) {
|
|
41075
41156
|
return [0, 0, 0];
|
|
41076
41157
|
}
|
|
41077
|
-
let [colorString] =
|
|
41158
|
+
let [colorString] = matches2;
|
|
41078
41159
|
if (colorString.length === 3) {
|
|
41079
41160
|
colorString = [...colorString].map((character) => character + character).join("");
|
|
41080
41161
|
}
|
|
@@ -41117,11 +41198,11 @@ function assembleStyles2() {
|
|
|
41117
41198
|
if (value === 0) {
|
|
41118
41199
|
return 30;
|
|
41119
41200
|
}
|
|
41120
|
-
let
|
|
41201
|
+
let result2 = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
41121
41202
|
if (value === 2) {
|
|
41122
|
-
|
|
41203
|
+
result2 += 60;
|
|
41123
41204
|
}
|
|
41124
|
-
return
|
|
41205
|
+
return result2;
|
|
41125
41206
|
},
|
|
41126
41207
|
enumerable: false
|
|
41127
41208
|
},
|
|
@@ -41201,9 +41282,9 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
41201
41282
|
if (haveStream && !streamIsTTY && forceColor === undefined) {
|
|
41202
41283
|
return 0;
|
|
41203
41284
|
}
|
|
41204
|
-
const
|
|
41285
|
+
const min2 = forceColor || 0;
|
|
41205
41286
|
if (env2.TERM === "dumb") {
|
|
41206
|
-
return
|
|
41287
|
+
return min2;
|
|
41207
41288
|
}
|
|
41208
41289
|
if (process4.platform === "win32") {
|
|
41209
41290
|
const osRelease = os3.release().split(".");
|
|
@@ -41219,7 +41300,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
41219
41300
|
if (["TRAVIS", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => (sign in env2)) || env2.CI_NAME === "codeship") {
|
|
41220
41301
|
return 1;
|
|
41221
41302
|
}
|
|
41222
|
-
return
|
|
41303
|
+
return min2;
|
|
41223
41304
|
}
|
|
41224
41305
|
if ("TEAMCITY_VERSION" in env2) {
|
|
41225
41306
|
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env2.TEAMCITY_VERSION) ? 1 : 0;
|
|
@@ -41256,7 +41337,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
41256
41337
|
if ("COLORTERM" in env2) {
|
|
41257
41338
|
return 1;
|
|
41258
41339
|
}
|
|
41259
|
-
return
|
|
41340
|
+
return min2;
|
|
41260
41341
|
}
|
|
41261
41342
|
function createSupportsColor(stream, options = {}) {
|
|
41262
41343
|
const level = _supportsColor(stream, {
|
|
@@ -41472,21 +41553,21 @@ var colorize = (str, color, type) => {
|
|
|
41472
41553
|
return type === "foreground" ? source_default.hex(color)(str) : source_default.bgHex(color)(str);
|
|
41473
41554
|
}
|
|
41474
41555
|
if (color.startsWith("ansi256")) {
|
|
41475
|
-
const
|
|
41476
|
-
if (!
|
|
41556
|
+
const matches2 = ansiRegex2.exec(color);
|
|
41557
|
+
if (!matches2) {
|
|
41477
41558
|
return str;
|
|
41478
41559
|
}
|
|
41479
|
-
const value = Number(
|
|
41560
|
+
const value = Number(matches2[1]);
|
|
41480
41561
|
return type === "foreground" ? source_default.ansi256(value)(str) : source_default.bgAnsi256(value)(str);
|
|
41481
41562
|
}
|
|
41482
41563
|
if (color.startsWith("rgb")) {
|
|
41483
|
-
const
|
|
41484
|
-
if (!
|
|
41564
|
+
const matches2 = rgbRegex.exec(color);
|
|
41565
|
+
if (!matches2) {
|
|
41485
41566
|
return str;
|
|
41486
41567
|
}
|
|
41487
|
-
const firstValue = Number(
|
|
41488
|
-
const secondValue = Number(
|
|
41489
|
-
const thirdValue = Number(
|
|
41568
|
+
const firstValue = Number(matches2[1]);
|
|
41569
|
+
const secondValue = Number(matches2[2]);
|
|
41570
|
+
const thirdValue = Number(matches2[3]);
|
|
41490
41571
|
return type === "foreground" ? source_default.rgb(firstValue, secondValue, thirdValue)(str) : source_default.bgRgb(firstValue, secondValue, thirdValue)(str);
|
|
41491
41572
|
}
|
|
41492
41573
|
return str;
|
|
@@ -42152,7 +42233,7 @@ cliCursor.toggle = (force, writableStream) => {
|
|
|
42152
42233
|
var cli_cursor_default = cliCursor;
|
|
42153
42234
|
|
|
42154
42235
|
// node_modules/ink/build/log-update.js
|
|
42155
|
-
var
|
|
42236
|
+
var create2 = (stream, { showCursor = false } = {}) => {
|
|
42156
42237
|
let previousLineCount = 0;
|
|
42157
42238
|
let previousOutput = "";
|
|
42158
42239
|
let hasHiddenCursor = false;
|
|
@@ -42186,7 +42267,7 @@ var create = (stream, { showCursor = false } = {}) => {
|
|
|
42186
42267
|
};
|
|
42187
42268
|
return render;
|
|
42188
42269
|
};
|
|
42189
|
-
var logUpdate = { create };
|
|
42270
|
+
var logUpdate = { create: create2 };
|
|
42190
42271
|
var log_update_default = logUpdate;
|
|
42191
42272
|
|
|
42192
42273
|
// node_modules/ink/build/instances.js
|
|
@@ -42272,9 +42353,9 @@ var dist_default2 = convertToSpaces;
|
|
|
42272
42353
|
// node_modules/code-excerpt/dist/index.js
|
|
42273
42354
|
var generateLineNumbers = (line, around) => {
|
|
42274
42355
|
const lineNumbers = [];
|
|
42275
|
-
const
|
|
42276
|
-
const
|
|
42277
|
-
for (let lineNumber =
|
|
42356
|
+
const min2 = line - around;
|
|
42357
|
+
const max2 = line + around;
|
|
42358
|
+
for (let lineNumber = min2;lineNumber <= max2; lineNumber++) {
|
|
42278
42359
|
lineNumbers.push(lineNumber);
|
|
42279
42360
|
}
|
|
42280
42361
|
return lineNumbers;
|
|
@@ -42315,11 +42396,11 @@ var Box_default = Box;
|
|
|
42315
42396
|
|
|
42316
42397
|
// node_modules/ink/build/components/Text.js
|
|
42317
42398
|
var import_react7 = __toESM(require_react(), 1);
|
|
42318
|
-
function Text({ color, backgroundColor, dimColor = false, bold = false, italic = false, underline = false, strikethrough = false, inverse = false, wrap = "wrap", children }) {
|
|
42399
|
+
function Text({ color, backgroundColor, dimColor = false, bold = false, italic = false, underline = false, strikethrough = false, inverse = false, wrap: wrap2 = "wrap", children }) {
|
|
42319
42400
|
if (children === undefined || children === null) {
|
|
42320
42401
|
return null;
|
|
42321
42402
|
}
|
|
42322
|
-
const
|
|
42403
|
+
const transform2 = (children2) => {
|
|
42323
42404
|
if (dimColor) {
|
|
42324
42405
|
children2 = source_default.dim(children2);
|
|
42325
42406
|
}
|
|
@@ -42346,7 +42427,7 @@ function Text({ color, backgroundColor, dimColor = false, bold = false, italic =
|
|
|
42346
42427
|
}
|
|
42347
42428
|
return children2;
|
|
42348
42429
|
};
|
|
42349
|
-
return import_react7.default.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: "row", textWrap:
|
|
42430
|
+
return import_react7.default.createElement("ink-text", { style: { flexGrow: 0, flexShrink: 1, flexDirection: "row", textWrap: wrap2 }, internal_transform: transform2 }, children);
|
|
42350
42431
|
}
|
|
42351
42432
|
|
|
42352
42433
|
// node_modules/ink/build/components/ErrorOverview.js
|
|
@@ -42386,7 +42467,7 @@ function ErrorOverview({ error }) {
|
|
|
42386
42467
|
// node_modules/ink/build/components/App.js
|
|
42387
42468
|
var tab = "\t";
|
|
42388
42469
|
var shiftTab = "\x1B[Z";
|
|
42389
|
-
var
|
|
42470
|
+
var escape2 = "\x1B";
|
|
42390
42471
|
|
|
42391
42472
|
class App extends import_react9.PureComponent {
|
|
42392
42473
|
static displayName = "InternalApp";
|
|
@@ -42482,17 +42563,17 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
|
|
|
42482
42563
|
}
|
|
42483
42564
|
};
|
|
42484
42565
|
handleReadable = () => {
|
|
42485
|
-
let
|
|
42486
|
-
while ((
|
|
42487
|
-
this.handleInput(
|
|
42488
|
-
this.internal_eventEmitter.emit("input",
|
|
42566
|
+
let chunk2;
|
|
42567
|
+
while ((chunk2 = this.props.stdin.read()) !== null) {
|
|
42568
|
+
this.handleInput(chunk2);
|
|
42569
|
+
this.internal_eventEmitter.emit("input", chunk2);
|
|
42489
42570
|
}
|
|
42490
42571
|
};
|
|
42491
42572
|
handleInput = (input) => {
|
|
42492
42573
|
if (input === "\x03" && this.props.exitOnCtrlC) {
|
|
42493
42574
|
this.handleExit();
|
|
42494
42575
|
}
|
|
42495
|
-
if (input ===
|
|
42576
|
+
if (input === escape2 && this.state.activeFocusId) {
|
|
42496
42577
|
this.setState({
|
|
42497
42578
|
activeFocusId: undefined
|
|
42498
42579
|
});
|
|
@@ -42629,7 +42710,7 @@ Read about how to prevent this error on https://github.com/vadimdemedes/ink/#isr
|
|
|
42629
42710
|
}
|
|
42630
42711
|
|
|
42631
42712
|
// node_modules/ink/build/ink.js
|
|
42632
|
-
var
|
|
42713
|
+
var noop2 = () => {};
|
|
42633
42714
|
|
|
42634
42715
|
class Ink {
|
|
42635
42716
|
options;
|
|
@@ -42733,7 +42814,7 @@ class Ink {
|
|
|
42733
42814
|
};
|
|
42734
42815
|
render(node) {
|
|
42735
42816
|
const tree = import_react10.default.createElement(App, { stdin: this.options.stdin, stdout: this.options.stdout, stderr: this.options.stderr, writeToStdout: this.writeToStdout, writeToStderr: this.writeToStderr, exitOnCtrlC: this.options.exitOnCtrlC, onExit: this.unmount }, node);
|
|
42736
|
-
reconciler_default.updateContainer(tree, this.container, null,
|
|
42817
|
+
reconciler_default.updateContainer(tree, this.container, null, noop2);
|
|
42737
42818
|
}
|
|
42738
42819
|
writeToStdout(data) {
|
|
42739
42820
|
if (this.isUnmounted) {
|
|
@@ -42788,7 +42869,7 @@ class Ink {
|
|
|
42788
42869
|
this.log.done();
|
|
42789
42870
|
}
|
|
42790
42871
|
this.isUnmounted = true;
|
|
42791
|
-
reconciler_default.updateContainer(null, this.container, null,
|
|
42872
|
+
reconciler_default.updateContainer(null, this.container, null, noop2);
|
|
42792
42873
|
instances_default.delete(this.options.stdout);
|
|
42793
42874
|
if (error instanceof Error) {
|
|
42794
42875
|
this.rejectExitPromise(error);
|
|
@@ -42797,9 +42878,9 @@ class Ink {
|
|
|
42797
42878
|
}
|
|
42798
42879
|
}
|
|
42799
42880
|
async waitUntilExit() {
|
|
42800
|
-
this.exitPromise ||= new Promise((resolve,
|
|
42881
|
+
this.exitPromise ||= new Promise((resolve, reject2) => {
|
|
42801
42882
|
this.resolveExitPromise = resolve;
|
|
42802
|
-
this.rejectExitPromise =
|
|
42883
|
+
this.rejectExitPromise = reject2;
|
|
42803
42884
|
});
|
|
42804
42885
|
return this.exitPromise;
|
|
42805
42886
|
}
|
|
@@ -43139,8 +43220,8 @@ function humanBytes(n) {
|
|
|
43139
43220
|
}
|
|
43140
43221
|
function formatItemLabel(item) {
|
|
43141
43222
|
const desc = item.description ? import_picocolors7.default.dim(` — ${item.description}`) : "";
|
|
43142
|
-
const
|
|
43143
|
-
return `${fmtType(item.type)} ${import_picocolors7.default.bold(item.slug)} ${fmtScope(item.scope)}${desc}${
|
|
43223
|
+
const size2 = item.size ? import_picocolors7.default.dim(` (${humanBytes(item.size)})`) : "";
|
|
43224
|
+
return `${fmtType(item.type)} ${import_picocolors7.default.bold(item.slug)} ${fmtScope(item.scope)}${desc}${size2}`;
|
|
43144
43225
|
}
|
|
43145
43226
|
async function runPack(cwd2) {
|
|
43146
43227
|
banner("pack — bundle your agent into a template");
|
|
@@ -43377,7 +43458,7 @@ function looksLikeSecretKey(key) {
|
|
|
43377
43458
|
function isPlaceholder(v2) {
|
|
43378
43459
|
return /^\$\{[A-Z0-9_]+\}$/.test(v2);
|
|
43379
43460
|
}
|
|
43380
|
-
function redactSecrets(packed, destRoot, entries,
|
|
43461
|
+
function redactSecrets(packed, destRoot, entries, keys2) {
|
|
43381
43462
|
const secretToUsers = new Map;
|
|
43382
43463
|
for (const c2 of packed) {
|
|
43383
43464
|
if (c2.type !== "mcp" || !c2.payload)
|
|
@@ -43386,11 +43467,11 @@ function redactSecrets(packed, destRoot, entries, keys) {
|
|
|
43386
43467
|
if (!env3)
|
|
43387
43468
|
continue;
|
|
43388
43469
|
for (const [k2, v2] of Object.entries(env3)) {
|
|
43389
|
-
if (
|
|
43470
|
+
if (keys2.has(k2) && !isPlaceholder(v2)) {
|
|
43390
43471
|
env3[k2] = `\${${k2}}`;
|
|
43391
|
-
const
|
|
43392
|
-
|
|
43393
|
-
secretToUsers.set(k2,
|
|
43472
|
+
const set2 = secretToUsers.get(k2) ?? new Set;
|
|
43473
|
+
set2.add(`${c2.type}/${c2.slug}`);
|
|
43474
|
+
secretToUsers.set(k2, set2);
|
|
43394
43475
|
}
|
|
43395
43476
|
}
|
|
43396
43477
|
const entry = entries.find((e2) => e2.type === c2.type && e2.slug === c2.slug);
|
|
@@ -43456,14 +43537,14 @@ function writeInstalledStore(store) {
|
|
|
43456
43537
|
function key(t) {
|
|
43457
43538
|
return `${t.name}::${t.scope}::${t.scope === "global" ? "" : t.cwd}`;
|
|
43458
43539
|
}
|
|
43459
|
-
function upsertInstalled(
|
|
43540
|
+
function upsertInstalled(template2) {
|
|
43460
43541
|
const store = readInstalledStore();
|
|
43461
|
-
const k2 = key(
|
|
43542
|
+
const k2 = key(template2);
|
|
43462
43543
|
const idx = store.templates.findIndex((t) => key(t) === k2);
|
|
43463
43544
|
if (idx >= 0)
|
|
43464
|
-
store.templates[idx] =
|
|
43545
|
+
store.templates[idx] = template2;
|
|
43465
43546
|
else
|
|
43466
|
-
store.templates.push(
|
|
43547
|
+
store.templates.push(template2);
|
|
43467
43548
|
writeInstalledStore(store);
|
|
43468
43549
|
}
|
|
43469
43550
|
function removeInstalledRecord(name, scope, cwd2) {
|
|
@@ -43833,7 +43914,7 @@ var registryApi = {
|
|
|
43833
43914
|
if (done)
|
|
43834
43915
|
break;
|
|
43835
43916
|
if (value) {
|
|
43836
|
-
await new Promise((resolve,
|
|
43917
|
+
await new Promise((resolve, reject2) => out.write(value, (err) => err ? reject2(err) : resolve()));
|
|
43837
43918
|
}
|
|
43838
43919
|
}
|
|
43839
43920
|
} finally {
|
|
@@ -43918,7 +43999,7 @@ import Vt from "node:fs";
|
|
|
43918
43999
|
import { dirname as xn, parse as Ln } from "path";
|
|
43919
44000
|
import { EventEmitter as _n } from "events";
|
|
43920
44001
|
import Mi from "assert";
|
|
43921
|
-
import { Buffer as
|
|
44002
|
+
import { Buffer as gt2 } from "buffer";
|
|
43922
44003
|
import * as ks from "zlib";
|
|
43923
44004
|
import qr from "zlib";
|
|
43924
44005
|
import { posix as Zt } from "node:path";
|
|
@@ -44594,11 +44675,11 @@ var K3 = (s, t, e2, i, r2) => Object.assign((n = [], o2, h2) => {
|
|
|
44594
44675
|
}, { syncFile: s, asyncFile: t, syncNoFile: e2, asyncNoFile: i, validate: r2 });
|
|
44595
44676
|
var jr = qr.constants || { ZLIB_VERNUM: 4736 };
|
|
44596
44677
|
var M3 = Object.freeze(Object.assign(Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: 1 / 0, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31 }, jr));
|
|
44597
|
-
var Qr =
|
|
44598
|
-
var vs = Object.getOwnPropertyDescriptor(
|
|
44678
|
+
var Qr = gt2.concat;
|
|
44679
|
+
var vs = Object.getOwnPropertyDescriptor(gt2, "concat");
|
|
44599
44680
|
var Jr = (s) => s;
|
|
44600
44681
|
var ki = vs?.writable === true || vs?.set !== undefined ? (s) => {
|
|
44601
|
-
|
|
44682
|
+
gt2.concat = s ? Jr : Qr;
|
|
44602
44683
|
} : (s) => {};
|
|
44603
44684
|
var Ot = Symbol("_superWrite");
|
|
44604
44685
|
var Gt = class extends Error {
|
|
@@ -44651,7 +44732,7 @@ var ne = class extends D {
|
|
|
44651
44732
|
return Mi(this.#e, "zlib binding closed"), this.#e.reset?.();
|
|
44652
44733
|
}
|
|
44653
44734
|
flush(t) {
|
|
44654
|
-
this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(
|
|
44735
|
+
this.ended || (typeof t != "number" && (t = this.#r), this.write(Object.assign(gt2.alloc(0), { [vi]: t })));
|
|
44655
44736
|
}
|
|
44656
44737
|
end(t, e2, i) {
|
|
44657
44738
|
return typeof t == "function" && (i = t, e2 = undefined, t = undefined), typeof e2 == "function" && (i = e2, e2 = undefined), t && (e2 ? this.write(t, e2) : this.write(t)), this.flush(this.#n), this.#i = true, super.end(i);
|
|
@@ -44663,7 +44744,7 @@ var ne = class extends D {
|
|
|
44663
44744
|
return super.write(t);
|
|
44664
44745
|
}
|
|
44665
44746
|
write(t, e2, i) {
|
|
44666
|
-
if (typeof e2 == "function" && (i = e2, e2 = "utf8"), typeof t == "string" && (t =
|
|
44747
|
+
if (typeof e2 == "function" && (i = e2, e2 = "utf8"), typeof t == "string" && (t = gt2.from(t, e2)), this.#t)
|
|
44667
44748
|
return;
|
|
44668
44749
|
Mi(this.#e, "zlib binding closed");
|
|
44669
44750
|
let r2 = this.#e._handle, n = r2.close;
|
|
@@ -44684,11 +44765,11 @@ var ne = class extends D {
|
|
|
44684
44765
|
if (h2)
|
|
44685
44766
|
if (Array.isArray(h2) && h2.length > 0) {
|
|
44686
44767
|
let l2 = h2[0];
|
|
44687
|
-
a3 = this[Ot](
|
|
44768
|
+
a3 = this[Ot](gt2.from(l2));
|
|
44688
44769
|
for (let c2 = 1;c2 < h2.length; c2++)
|
|
44689
44770
|
a3 = this[Ot](h2[c2]);
|
|
44690
44771
|
} else
|
|
44691
|
-
a3 = this[Ot](
|
|
44772
|
+
a3 = this[Ot](gt2.from(h2));
|
|
44692
44773
|
return i && i(), a3;
|
|
44693
44774
|
}
|
|
44694
44775
|
};
|
|
@@ -44843,10 +44924,10 @@ var F = class {
|
|
|
44843
44924
|
decode(t, e2, i, r2) {
|
|
44844
44925
|
if (e2 || (e2 = 0), !t || !(t.length >= e2 + 512))
|
|
44845
44926
|
throw new Error("need 512 bytes for header");
|
|
44846
|
-
this.path = i?.path ?? Tt(t, e2, 100), this.mode = i?.mode ?? r2?.mode ??
|
|
44927
|
+
this.path = i?.path ?? Tt(t, e2, 100), this.mode = i?.mode ?? r2?.mode ?? at2(t, e2 + 100, 8), this.uid = i?.uid ?? r2?.uid ?? at2(t, e2 + 108, 8), this.gid = i?.gid ?? r2?.gid ?? at2(t, e2 + 116, 8), this.size = i?.size ?? r2?.size ?? at2(t, e2 + 124, 12), this.mtime = i?.mtime ?? r2?.mtime ?? Pi(t, e2 + 136, 12), this.cksum = at2(t, e2 + 148, 12), r2 && this.#i(r2, true), i && this.#i(i);
|
|
44847
44928
|
let n = Tt(t, e2 + 156, 1);
|
|
44848
44929
|
if (oe(n) && (this.#t = n || "0"), this.#t === "0" && this.path.slice(-1) === "/" && (this.#t = "5"), this.#t === "5" && (this.size = 0), this.linkpath = Tt(t, e2 + 157, 100), t.subarray(e2 + 257, e2 + 265).toString() === "ustar\x0000")
|
|
44849
|
-
if (this.uname = i?.uname ?? r2?.uname ?? Tt(t, e2 + 265, 32), this.gname = i?.gname ?? r2?.gname ?? Tt(t, e2 + 297, 32), this.devmaj = i?.devmaj ?? r2?.devmaj ??
|
|
44930
|
+
if (this.uname = i?.uname ?? r2?.uname ?? Tt(t, e2 + 265, 32), this.gname = i?.gname ?? r2?.gname ?? Tt(t, e2 + 297, 32), this.devmaj = i?.devmaj ?? r2?.devmaj ?? at2(t, e2 + 329, 8) ?? 0, this.devmin = i?.devmin ?? r2?.devmin ?? at2(t, e2 + 337, 8) ?? 0, t[e2 + 475] !== 0) {
|
|
44850
44931
|
let h2 = Tt(t, e2 + 345, 155);
|
|
44851
44932
|
this.path = h2 + "/" + this.path;
|
|
44852
44933
|
} else {
|
|
@@ -44867,13 +44948,13 @@ var F = class {
|
|
|
44867
44948
|
if (t || (t = this.block = Buffer.alloc(512)), this.#t === "Unsupported" && (this.#t = "0"), !(t.length >= e2 + 512))
|
|
44868
44949
|
throw new Error("need 512 bytes for header");
|
|
44869
44950
|
let i = this.ctime || this.atime ? 130 : 155, r2 = an(this.path || "", i), n = r2[0], o2 = r2[1];
|
|
44870
|
-
this.needPax = !!r2[2], this.needPax = xt(t, e2, 100, n) || this.needPax, this.needPax =
|
|
44951
|
+
this.needPax = !!r2[2], this.needPax = xt(t, e2, 100, n) || this.needPax, this.needPax = lt2(t, e2 + 100, 8, this.mode) || this.needPax, this.needPax = lt2(t, e2 + 108, 8, this.uid) || this.needPax, this.needPax = lt2(t, e2 + 116, 8, this.gid) || this.needPax, this.needPax = lt2(t, e2 + 124, 12, this.size) || this.needPax, this.needPax = zi(t, e2 + 136, 12, this.mtime) || this.needPax, t[e2 + 156] = Number(this.#t.codePointAt(0)), this.needPax = xt(t, e2 + 157, 100, this.linkpath) || this.needPax, t.write("ustar\x0000", e2 + 257, 8), this.needPax = xt(t, e2 + 265, 32, this.uname) || this.needPax, this.needPax = xt(t, e2 + 297, 32, this.gname) || this.needPax, this.needPax = lt2(t, e2 + 329, 8, this.devmaj) || this.needPax, this.needPax = lt2(t, e2 + 337, 8, this.devmin) || this.needPax, this.needPax = xt(t, e2 + 345, i, o2) || this.needPax, t[e2 + 475] !== 0 ? this.needPax = xt(t, e2 + 345, 155, o2) || this.needPax : (this.needPax = xt(t, e2 + 345, 130, o2) || this.needPax, this.needPax = zi(t, e2 + 476, 12, this.atime) || this.needPax, this.needPax = zi(t, e2 + 488, 12, this.ctime) || this.needPax);
|
|
44871
44952
|
let h2 = 256;
|
|
44872
44953
|
for (let a3 = e2;a3 < e2 + 148; a3++)
|
|
44873
44954
|
h2 += t[a3];
|
|
44874
44955
|
for (let a3 = e2 + 156;a3 < e2 + 512; a3++)
|
|
44875
44956
|
h2 += t[a3];
|
|
44876
|
-
return this.cksum = h2,
|
|
44957
|
+
return this.cksum = h2, lt2(t, e2 + 148, 8, this.cksum), this.cksumValid = true, this.needPax;
|
|
44877
44958
|
}
|
|
44878
44959
|
get type() {
|
|
44879
44960
|
return this.#t === "Unsupported" ? this.#t : he.get(this.#t);
|
|
@@ -44905,17 +44986,17 @@ var an = (s, t) => {
|
|
|
44905
44986
|
return n;
|
|
44906
44987
|
};
|
|
44907
44988
|
var Tt = (s, t, e2) => s.subarray(t, t + e2).toString("utf8").replace(/\0.*/, "");
|
|
44908
|
-
var Pi = (s, t, e2) => ln(
|
|
44989
|
+
var Pi = (s, t, e2) => ln(at2(s, t, e2));
|
|
44909
44990
|
var ln = (s) => s === undefined ? undefined : new Date(s * 1000);
|
|
44910
|
-
var
|
|
44991
|
+
var at2 = (s, t, e2) => Number(s[t]) & 128 ? Bs(s.subarray(t, t + e2)) : fn(s, t, e2);
|
|
44911
44992
|
var cn = (s) => isNaN(s) ? undefined : s;
|
|
44912
44993
|
var fn = (s, t, e2) => cn(parseInt(s.subarray(t, t + e2).toString("utf8").replace(/\0.*$/, "").trim(), 8));
|
|
44913
44994
|
var dn = { 12: 8589934591, 8: 2097151 };
|
|
44914
|
-
var
|
|
44995
|
+
var lt2 = (s, t, e2, i) => i === undefined ? false : i > dn[e2] || i < 0 ? (Ms(i, s.subarray(t, t + e2)), true) : (un(s, t, e2, i), false);
|
|
44915
44996
|
var un = (s, t, e2, i) => s.write(mn(i, e2), t, e2, "ascii");
|
|
44916
44997
|
var mn = (s, t) => pn(Math.floor(s).toString(8), t);
|
|
44917
44998
|
var pn = (s, t) => (s.length === t - 1 ? s : new Array(t - s.length - 1).join("0") + s + " ") + "\x00";
|
|
44918
|
-
var zi = (s, t, e2, i) => i === undefined ? false :
|
|
44999
|
+
var zi = (s, t, e2, i) => i === undefined ? false : lt2(s, t, e2, i.getTime() / 1000);
|
|
44919
45000
|
var En = new Array(156).join("\x00");
|
|
44920
45001
|
var xt = (s, t, e2, i) => i === undefined ? false : (s.write(i + En, t, e2, "utf8"), i.length !== Buffer.byteLength(i) || i.length > e2);
|
|
44921
45002
|
var ct = class s {
|
|
@@ -47396,9 +47477,9 @@ async function extract(opts) {
|
|
|
47396
47477
|
} catch (err) {
|
|
47397
47478
|
throw new TarballError(err.message);
|
|
47398
47479
|
}
|
|
47399
|
-
const
|
|
47400
|
-
if (
|
|
47401
|
-
throw new TarballError(`entry ${entryPath} size ${
|
|
47480
|
+
const size2 = entry.size ?? 0;
|
|
47481
|
+
if (size2 > maxBytes) {
|
|
47482
|
+
throw new TarballError(`entry ${entryPath} size ${size2} exceeds cap ${maxBytes}`);
|
|
47402
47483
|
}
|
|
47403
47484
|
if (t === "Directory" || t === "GNUDumpDir")
|
|
47404
47485
|
return true;
|
|
@@ -47406,7 +47487,7 @@ async function extract(opts) {
|
|
|
47406
47487
|
if (fileCount > maxCount) {
|
|
47407
47488
|
throw new TarballError(`too many entries (>${maxCount})`);
|
|
47408
47489
|
}
|
|
47409
|
-
totalBytes +=
|
|
47490
|
+
totalBytes += size2;
|
|
47410
47491
|
if (totalBytes > maxBytes) {
|
|
47411
47492
|
throw new TarballError(`total uncompressed bytes ${totalBytes} exceeds cap ${maxBytes}`);
|
|
47412
47493
|
}
|
|
@@ -47421,11 +47502,11 @@ async function extract(opts) {
|
|
|
47421
47502
|
return written;
|
|
47422
47503
|
}
|
|
47423
47504
|
async function sha256OfFile(filePath) {
|
|
47424
|
-
return await new Promise((resolve,
|
|
47505
|
+
return await new Promise((resolve, reject2) => {
|
|
47425
47506
|
const hash = crypto2.createHash("sha256");
|
|
47426
47507
|
const stream = fs25.createReadStream(filePath);
|
|
47427
|
-
stream.on("error",
|
|
47428
|
-
stream.on("data", (
|
|
47508
|
+
stream.on("error", reject2);
|
|
47509
|
+
stream.on("data", (chunk2) => hash.update(chunk2));
|
|
47429
47510
|
stream.on("end", () => resolve(hash.digest("hex")));
|
|
47430
47511
|
});
|
|
47431
47512
|
}
|
|
@@ -47481,13 +47562,13 @@ function readFileSafe(p2, byteCap = MAX_INSTRUCTION_BYTES) {
|
|
|
47481
47562
|
return null;
|
|
47482
47563
|
}
|
|
47483
47564
|
}
|
|
47484
|
-
function truncateLines(text,
|
|
47565
|
+
function truncateLines(text, max2) {
|
|
47485
47566
|
const lines = text.split(`
|
|
47486
47567
|
`);
|
|
47487
|
-
if (lines.length <=
|
|
47568
|
+
if (lines.length <= max2)
|
|
47488
47569
|
return text;
|
|
47489
|
-
const dropped = lines.length -
|
|
47490
|
-
return lines.slice(0,
|
|
47570
|
+
const dropped = lines.length - max2;
|
|
47571
|
+
return lines.slice(0, max2).join(`
|
|
47491
47572
|
`) + `
|
|
47492
47573
|
${import_picocolors8.default.dim(`... (${dropped} more lines)`)}`;
|
|
47493
47574
|
}
|
|
@@ -47563,14 +47644,14 @@ function buildInstallPreview(input) {
|
|
|
47563
47644
|
const scripts = listScriptFiles(c2.rootDir);
|
|
47564
47645
|
if (scripts.length === 0)
|
|
47565
47646
|
continue;
|
|
47566
|
-
const
|
|
47647
|
+
const sample2 = scripts.slice(0, 5).map((s3) => `${import_picocolors8.default.dim("-")} ${s3}`);
|
|
47567
47648
|
if (scripts.length > 5)
|
|
47568
|
-
|
|
47649
|
+
sample2.push(import_picocolors8.default.dim(`... and ${scripts.length - 5} more`));
|
|
47569
47650
|
blocks.push({
|
|
47570
47651
|
severity: "warn",
|
|
47571
47652
|
title: `skill ${import_picocolors8.default.bold(c2.slug)} bundles ${scripts.length} script file${scripts.length === 1 ? "" : "s"}`,
|
|
47572
47653
|
lines: [
|
|
47573
|
-
...
|
|
47654
|
+
...sample2,
|
|
47574
47655
|
import_picocolors8.default.dim("The agent can invoke these via Bash. Verify they match the skill description.")
|
|
47575
47656
|
]
|
|
47576
47657
|
});
|
|
@@ -47905,10 +47986,10 @@ function installWithCtx(harnessId, components, opts, templateName) {
|
|
|
47905
47986
|
return getAdapter(harnessId).install(components, opts);
|
|
47906
47987
|
}
|
|
47907
47988
|
function parseTemplateRef(input) {
|
|
47908
|
-
const
|
|
47909
|
-
if (
|
|
47989
|
+
const at3 = input.indexOf("@");
|
|
47990
|
+
if (at3 < 0)
|
|
47910
47991
|
return { name: input };
|
|
47911
|
-
return { name: input.slice(0,
|
|
47992
|
+
return { name: input.slice(0, at3), version: input.slice(at3 + 1) };
|
|
47912
47993
|
}
|
|
47913
47994
|
function buildTemplateComponents(manifest, rootDir) {
|
|
47914
47995
|
return manifest.components.map((c2) => ({
|
|
@@ -48068,7 +48149,7 @@ async function runOnboard(cwd2, args) {
|
|
|
48068
48149
|
};
|
|
48069
48150
|
const installSpinner = de();
|
|
48070
48151
|
installSpinner.start("Installing…");
|
|
48071
|
-
const
|
|
48152
|
+
const result2 = await installWithCtx(adapter.id, components, opts, templateRef.name);
|
|
48072
48153
|
installSpinner.stop("Installed.");
|
|
48073
48154
|
upsertInstalled({
|
|
48074
48155
|
name: templateRef.name,
|
|
@@ -48077,7 +48158,7 @@ async function runOnboard(cwd2, args) {
|
|
|
48077
48158
|
scope,
|
|
48078
48159
|
cwd: cwd2,
|
|
48079
48160
|
installedAt: new Date().toISOString(),
|
|
48080
|
-
components:
|
|
48161
|
+
components: result2.installed.map((o2) => ({
|
|
48081
48162
|
type: o2.type,
|
|
48082
48163
|
slug: o2.slug,
|
|
48083
48164
|
installedPaths: o2.installedPaths,
|
|
@@ -48095,12 +48176,12 @@ async function runOnboard(cwd2, args) {
|
|
|
48095
48176
|
});
|
|
48096
48177
|
} catch {}
|
|
48097
48178
|
const rows = [
|
|
48098
|
-
...
|
|
48179
|
+
...result2.installed.map((o2) => ({
|
|
48099
48180
|
type: "ok",
|
|
48100
48181
|
label: o2.type,
|
|
48101
48182
|
text: `${o2.slug} → ${o2.installedPaths[0] ?? ""}`
|
|
48102
48183
|
})),
|
|
48103
|
-
...
|
|
48184
|
+
...result2.skipped.map((s3) => ({
|
|
48104
48185
|
type: "warn",
|
|
48105
48186
|
label: s3.type,
|
|
48106
48187
|
text: `${s3.slug} — ${s3.reason}`
|
|
@@ -48109,7 +48190,7 @@ async function runOnboard(cwd2, args) {
|
|
|
48109
48190
|
$e(`${import_picocolors9.default.bold(templateRef.name)} installed.`);
|
|
48110
48191
|
await showResultCard({
|
|
48111
48192
|
title: "INSTALLED",
|
|
48112
|
-
tone:
|
|
48193
|
+
tone: result2.skipped.length === 0 ? "ok" : "warn",
|
|
48113
48194
|
subtitle: `${templateRef.name}@${templateRef.version}`,
|
|
48114
48195
|
rows: rows.length > 0 ? rows : [{ type: "plain", text: "No components written." }],
|
|
48115
48196
|
hint: "brainbase template list"
|
|
@@ -48365,12 +48446,12 @@ var import_picocolors10 = __toESM(require_picocolors(), 1);
|
|
|
48365
48446
|
async function runRemove(cwd2, args) {
|
|
48366
48447
|
banner(`remove — uninstall ${import_picocolors10.default.bold(args.name)}`);
|
|
48367
48448
|
const store = readInstalledStore();
|
|
48368
|
-
const
|
|
48369
|
-
if (
|
|
48449
|
+
const matches2 = store.templates.filter((t) => t.name === args.name && (t.scope === "global" || t.cwd === cwd2));
|
|
48450
|
+
if (matches2.length === 0) {
|
|
48370
48451
|
f2.warn(`No installation of ${args.name} found in this scope.`);
|
|
48371
48452
|
return;
|
|
48372
48453
|
}
|
|
48373
|
-
for (const inst of
|
|
48454
|
+
for (const inst of matches2) {
|
|
48374
48455
|
await showResultCard({
|
|
48375
48456
|
title: "WILL REMOVE",
|
|
48376
48457
|
tone: "danger",
|
|
@@ -48472,7 +48553,7 @@ var skillsApi = {
|
|
|
48472
48553
|
if (done)
|
|
48473
48554
|
break;
|
|
48474
48555
|
if (value) {
|
|
48475
|
-
await new Promise((resolve,
|
|
48556
|
+
await new Promise((resolve, reject2) => out.write(value, (err) => err ? reject2(err) : resolve()));
|
|
48476
48557
|
}
|
|
48477
48558
|
}
|
|
48478
48559
|
} finally {
|
|
@@ -48595,8 +48676,8 @@ function defaultSkillSlug(source) {
|
|
|
48595
48676
|
case "git": {
|
|
48596
48677
|
if (source.subpath)
|
|
48597
48678
|
return path32.basename(source.subpath);
|
|
48598
|
-
const
|
|
48599
|
-
return
|
|
48679
|
+
const last2 = source.url.split("/").pop() ?? source.url;
|
|
48680
|
+
return last2.replace(/\.git$/, "");
|
|
48600
48681
|
}
|
|
48601
48682
|
case "brainbase":
|
|
48602
48683
|
return source.slug;
|
|
@@ -48806,10 +48887,10 @@ async function showPublishCard(props) {
|
|
|
48806
48887
|
|
|
48807
48888
|
// src/cli/template-publish.ts
|
|
48808
48889
|
function parseRef(input) {
|
|
48809
|
-
const
|
|
48810
|
-
if (
|
|
48890
|
+
const at3 = input.indexOf("@");
|
|
48891
|
+
if (at3 < 0)
|
|
48811
48892
|
return { name: input };
|
|
48812
|
-
return { name: input.slice(0,
|
|
48893
|
+
return { name: input.slice(0, at3), version: input.slice(at3 + 1) };
|
|
48813
48894
|
}
|
|
48814
48895
|
async function publishSkillForTemplate(opts) {
|
|
48815
48896
|
const { entry, bundleRoot, ownerForFallback } = opts;
|
|
@@ -49059,14 +49140,14 @@ async function runTemplatePublish(_cwd, args) {
|
|
|
49059
49140
|
return;
|
|
49060
49141
|
}
|
|
49061
49142
|
const sha = await sha256OfFile(tarPath);
|
|
49062
|
-
const
|
|
49063
|
-
buildSpinner.stop(`Bundle ready (${(
|
|
49143
|
+
const size2 = fs31.statSync(tarPath).size;
|
|
49144
|
+
buildSpinner.stop(`Bundle ready (${(size2 / 1024).toFixed(1)} KB).`);
|
|
49064
49145
|
await showPublishCard({
|
|
49065
49146
|
name,
|
|
49066
49147
|
version,
|
|
49067
49148
|
ownerLabel: owner.label,
|
|
49068
49149
|
visibility,
|
|
49069
|
-
bundleSize:
|
|
49150
|
+
bundleSize: size2,
|
|
49070
49151
|
bundleSha: sha,
|
|
49071
49152
|
componentCount: ref.manifest.components.length,
|
|
49072
49153
|
target: registryHost2(),
|
|
@@ -49114,9 +49195,9 @@ async function runTemplatePublish(_cwd, args) {
|
|
|
49114
49195
|
}
|
|
49115
49196
|
const upSpinner = de();
|
|
49116
49197
|
upSpinner.start("Uploading bundle…");
|
|
49117
|
-
let
|
|
49198
|
+
let result2;
|
|
49118
49199
|
try {
|
|
49119
|
-
|
|
49200
|
+
result2 = await registryApi.publishVersion(creator, slug, {
|
|
49120
49201
|
manifestJson: fs31.readFileSync(path34.join(ref.rootDir, "brainbase.json"), "utf8"),
|
|
49121
49202
|
bundlePath: tarPath,
|
|
49122
49203
|
bundleSha256: sha,
|
|
@@ -49138,7 +49219,7 @@ async function runTemplatePublish(_cwd, args) {
|
|
|
49138
49219
|
tone: "ok",
|
|
49139
49220
|
subtitle: `${name}@${version}`,
|
|
49140
49221
|
meta: [
|
|
49141
|
-
["id",
|
|
49222
|
+
["id", result2.id],
|
|
49142
49223
|
["sha256", sha],
|
|
49143
49224
|
["visibility", visibility],
|
|
49144
49225
|
...visibility === "public" ? [["note", "Quarantined for review on first public publish."]] : []
|
|
@@ -49392,25 +49473,25 @@ async function runTemplateSearch(args) {
|
|
|
49392
49473
|
banner(`search ${args.q ? "— " + args.q : ""}`);
|
|
49393
49474
|
const spinner = de();
|
|
49394
49475
|
spinner.start("Searching the registry…");
|
|
49395
|
-
let
|
|
49476
|
+
let result2;
|
|
49396
49477
|
try {
|
|
49397
|
-
|
|
49478
|
+
result2 = await registryApi.search({
|
|
49398
49479
|
q: args.q,
|
|
49399
49480
|
category: args.category,
|
|
49400
49481
|
target: args.target,
|
|
49401
49482
|
page: args.page,
|
|
49402
49483
|
per_page: 25
|
|
49403
49484
|
});
|
|
49404
|
-
spinner.stop(`${
|
|
49485
|
+
spinner.stop(`${result2.total} match${result2.total === 1 ? "" : "es"}.`);
|
|
49405
49486
|
} catch (err) {
|
|
49406
49487
|
spinner.stop("Search failed.");
|
|
49407
49488
|
throw err;
|
|
49408
49489
|
}
|
|
49409
49490
|
await showSearchResultsCard({
|
|
49410
49491
|
query: args.q ?? null,
|
|
49411
|
-
total:
|
|
49412
|
-
shown:
|
|
49413
|
-
hits:
|
|
49492
|
+
total: result2.total,
|
|
49493
|
+
shown: result2.results.length,
|
|
49494
|
+
hits: result2.results.map((r2) => ({
|
|
49414
49495
|
creator: r2.creator,
|
|
49415
49496
|
slug: r2.slug,
|
|
49416
49497
|
visibility: r2.visibility,
|
|
@@ -49421,10 +49502,10 @@ async function runTemplateSearch(args) {
|
|
|
49421
49502
|
});
|
|
49422
49503
|
}
|
|
49423
49504
|
function parseRef2(input) {
|
|
49424
|
-
const
|
|
49425
|
-
if (
|
|
49505
|
+
const at3 = input.indexOf("@");
|
|
49506
|
+
if (at3 < 0)
|
|
49426
49507
|
return { name: input };
|
|
49427
|
-
return { name: input.slice(0,
|
|
49508
|
+
return { name: input.slice(0, at3), version: input.slice(at3 + 1) };
|
|
49428
49509
|
}
|
|
49429
49510
|
async function runTemplateInfo(args) {
|
|
49430
49511
|
banner(`info — ${args.ref}`);
|
|
@@ -49479,14 +49560,14 @@ async function runTemplateInfo(args) {
|
|
|
49479
49560
|
}
|
|
49480
49561
|
|
|
49481
49562
|
// src/cli/template.ts
|
|
49482
|
-
async function runTemplate(cwd2, sub,
|
|
49563
|
+
async function runTemplate(cwd2, sub, rest2, args) {
|
|
49483
49564
|
switch (sub) {
|
|
49484
49565
|
case "pack":
|
|
49485
49566
|
await runPack(cwd2);
|
|
49486
49567
|
return;
|
|
49487
49568
|
case "onboard":
|
|
49488
49569
|
case "install": {
|
|
49489
|
-
const ref =
|
|
49570
|
+
const ref = rest2[0];
|
|
49490
49571
|
if (!ref) {
|
|
49491
49572
|
console.error("Usage: brainbase template onboard <creator/slug>[@version]");
|
|
49492
49573
|
process.exit(1);
|
|
@@ -49501,14 +49582,14 @@ async function runTemplate(cwd2, sub, rest, args) {
|
|
|
49501
49582
|
}
|
|
49502
49583
|
case "publish":
|
|
49503
49584
|
await runTemplatePublish(cwd2, {
|
|
49504
|
-
ref:
|
|
49585
|
+
ref: rest2[0],
|
|
49505
49586
|
visibility: args.visibility,
|
|
49506
49587
|
yes: args.yes
|
|
49507
49588
|
});
|
|
49508
49589
|
return;
|
|
49509
49590
|
case "search":
|
|
49510
49591
|
await runTemplateSearch({
|
|
49511
|
-
q:
|
|
49592
|
+
q: rest2[0],
|
|
49512
49593
|
category: args.category,
|
|
49513
49594
|
target: args.target,
|
|
49514
49595
|
page: args.page
|
|
@@ -49516,7 +49597,7 @@ async function runTemplate(cwd2, sub, rest, args) {
|
|
|
49516
49597
|
return;
|
|
49517
49598
|
case "info":
|
|
49518
49599
|
case "show": {
|
|
49519
|
-
const ref =
|
|
49600
|
+
const ref = rest2[0];
|
|
49520
49601
|
if (!ref) {
|
|
49521
49602
|
console.error("Usage: brainbase template info <creator/slug>[@version]");
|
|
49522
49603
|
process.exit(1);
|
|
@@ -49531,7 +49612,7 @@ async function runTemplate(cwd2, sub, rest, args) {
|
|
|
49531
49612
|
case "remove":
|
|
49532
49613
|
case "uninstall":
|
|
49533
49614
|
case "rm": {
|
|
49534
|
-
const name =
|
|
49615
|
+
const name = rest2[0];
|
|
49535
49616
|
if (!name) {
|
|
49536
49617
|
console.error("Usage: brainbase template remove <creator/slug>");
|
|
49537
49618
|
process.exit(1);
|
|
@@ -49980,6 +50061,10 @@ async function runSkillPublish(cwd2, args) {
|
|
|
49980
50061
|
return;
|
|
49981
50062
|
}
|
|
49982
50063
|
if (!name) {
|
|
50064
|
+
if (args.yes) {
|
|
50065
|
+
f2.error("Non-interactive publish (--yes) requires --name <creator/slug>.");
|
|
50066
|
+
return;
|
|
50067
|
+
}
|
|
49983
50068
|
const ans = await te({
|
|
49984
50069
|
message: "Publish as (creator/slug)",
|
|
49985
50070
|
placeholder: `gokhan/${folderSlug}`,
|
|
@@ -49995,6 +50080,10 @@ async function runSkillPublish(cwd2, args) {
|
|
|
49995
50080
|
return;
|
|
49996
50081
|
}
|
|
49997
50082
|
if (!version) {
|
|
50083
|
+
if (args.yes) {
|
|
50084
|
+
f2.error("Non-interactive publish (--yes) requires --skill-version <MAJOR.MINOR.PATCH>.");
|
|
50085
|
+
return;
|
|
50086
|
+
}
|
|
49998
50087
|
const ans = await te({
|
|
49999
50088
|
message: "Version",
|
|
50000
50089
|
initialValue: "0.1.0",
|
|
@@ -50019,24 +50108,37 @@ async function runSkillPublish(cwd2, args) {
|
|
|
50019
50108
|
f2.error("Not logged in. Run `brainbase login` first.");
|
|
50020
50109
|
return;
|
|
50021
50110
|
}
|
|
50022
|
-
|
|
50111
|
+
let owner;
|
|
50112
|
+
if (args.yes) {
|
|
50113
|
+
owner = {
|
|
50114
|
+
type: "user",
|
|
50115
|
+
userId: status.session.user_id,
|
|
50116
|
+
label: `Personal — ${status.session.email ?? status.session.user_id}`
|
|
50117
|
+
};
|
|
50118
|
+
} else {
|
|
50119
|
+
owner = await pickOwner(status.session.user_id, status.session.email);
|
|
50120
|
+
}
|
|
50023
50121
|
if (!owner)
|
|
50024
50122
|
return;
|
|
50025
50123
|
let visibility = args.visibility;
|
|
50026
50124
|
if (!visibility) {
|
|
50027
|
-
|
|
50028
|
-
|
|
50029
|
-
|
|
50030
|
-
|
|
50031
|
-
|
|
50032
|
-
|
|
50033
|
-
value: "
|
|
50034
|
-
label: "
|
|
50035
|
-
|
|
50036
|
-
|
|
50037
|
-
|
|
50038
|
-
|
|
50039
|
-
|
|
50125
|
+
if (args.yes) {
|
|
50126
|
+
visibility = "private";
|
|
50127
|
+
} else {
|
|
50128
|
+
const v3 = await ie({
|
|
50129
|
+
message: "Visibility",
|
|
50130
|
+
options: [
|
|
50131
|
+
{ value: "private", label: "Private — only you / your team" },
|
|
50132
|
+
{ value: "unlisted", label: "Unlisted — anyone with the link" },
|
|
50133
|
+
{
|
|
50134
|
+
value: "public",
|
|
50135
|
+
label: "Public — listed and searchable (will quarantine for review)"
|
|
50136
|
+
}
|
|
50137
|
+
],
|
|
50138
|
+
initialValue: "private"
|
|
50139
|
+
});
|
|
50140
|
+
visibility = ensureNotCancelled(v3);
|
|
50141
|
+
}
|
|
50040
50142
|
}
|
|
50041
50143
|
try {
|
|
50042
50144
|
await skillsApi.createPackage({
|
|
@@ -50067,8 +50169,8 @@ async function runSkillPublish(cwd2, args) {
|
|
|
50067
50169
|
buildSp.start("Building skill bundle…");
|
|
50068
50170
|
await pack({ rootDir: skillDir, outFile: tar, files });
|
|
50069
50171
|
const sha = await sha256OfFile(tar);
|
|
50070
|
-
const
|
|
50071
|
-
buildSp.stop(`Bundle ready (${(
|
|
50172
|
+
const size2 = fs37.statSync(tar).size;
|
|
50173
|
+
buildSp.stop(`Bundle ready (${(size2 / 1024).toFixed(1)} KB).`);
|
|
50072
50174
|
if (!args.yes) {
|
|
50073
50175
|
const ok = await se({
|
|
50074
50176
|
message: `Publish ${import_picocolors16.default.bold(skillDir)} as ${import_picocolors16.default.bold(creator + "/" + pkgSlug)}@${version}?`,
|
|
@@ -50089,9 +50191,9 @@ async function runSkillPublish(cwd2, args) {
|
|
|
50089
50191
|
});
|
|
50090
50192
|
const upSp = de();
|
|
50091
50193
|
upSp.start("Uploading…");
|
|
50092
|
-
let
|
|
50194
|
+
let result2;
|
|
50093
50195
|
try {
|
|
50094
|
-
|
|
50196
|
+
result2 = await skillsApi.publishVersion(creator, pkgSlug, {
|
|
50095
50197
|
manifestJson: JSON.stringify(manifest, null, 2),
|
|
50096
50198
|
bundlePath: tar,
|
|
50097
50199
|
bundleSha256: sha,
|
|
@@ -50111,7 +50213,7 @@ async function runSkillPublish(cwd2, args) {
|
|
|
50111
50213
|
};
|
|
50112
50214
|
writeSkillMarker(skillDir, newSource);
|
|
50113
50215
|
$e(`${import_picocolors16.default.bold(creator + "/" + pkgSlug)}@${version} published.`);
|
|
50114
|
-
f2.info(import_picocolors16.default.dim(`id: ${
|
|
50216
|
+
f2.info(import_picocolors16.default.dim(`id: ${result2.id}`));
|
|
50115
50217
|
} finally {
|
|
50116
50218
|
try {
|
|
50117
50219
|
fs37.rmSync(tmp, { recursive: true, force: true });
|
|
@@ -50138,11 +50240,11 @@ function readSkillDescription(skillDir) {
|
|
|
50138
50240
|
const md = path40.join(skillDir, "SKILL.md");
|
|
50139
50241
|
if (!exists(md))
|
|
50140
50242
|
return;
|
|
50141
|
-
const
|
|
50142
|
-
const fm = /^description:\s*(.+)$/im.exec(
|
|
50243
|
+
const head3 = fs37.readFileSync(md, "utf8").slice(0, 4000);
|
|
50244
|
+
const fm = /^description:\s*(.+)$/im.exec(head3);
|
|
50143
50245
|
if (fm)
|
|
50144
50246
|
return fm[1].trim().slice(0, 256);
|
|
50145
|
-
const h1 = /^#\s*(.+)$/m.exec(
|
|
50247
|
+
const h1 = /^#\s*(.+)$/m.exec(head3);
|
|
50146
50248
|
return h1?.[1]?.trim().slice(0, 256);
|
|
50147
50249
|
}
|
|
50148
50250
|
async function pickOwner(userId, email) {
|
|
@@ -50249,31 +50351,31 @@ async function runSkillUpdate(cwd2, args) {
|
|
|
50249
50351
|
var import_picocolors18 = __toESM(require_picocolors(), 1);
|
|
50250
50352
|
async function runSkillSearch(args) {
|
|
50251
50353
|
banner(`skill search`);
|
|
50252
|
-
const
|
|
50354
|
+
const result2 = await skillsApi.search({
|
|
50253
50355
|
q: args.q,
|
|
50254
50356
|
category: args.category,
|
|
50255
50357
|
agent: args.agent,
|
|
50256
50358
|
page: args.page,
|
|
50257
50359
|
per_page: 20
|
|
50258
50360
|
});
|
|
50259
|
-
if (
|
|
50361
|
+
if (result2.results.length === 0) {
|
|
50260
50362
|
console.log(import_picocolors18.default.dim(" No skills found."));
|
|
50261
50363
|
return;
|
|
50262
50364
|
}
|
|
50263
|
-
for (const r2 of
|
|
50365
|
+
for (const r2 of result2.results) {
|
|
50264
50366
|
console.log(` ${import_picocolors18.default.bold(r2.creator + "/" + r2.slug)} ${import_picocolors18.default.dim("(" + r2.visibility + ")")}` + (r2.description ? ` ${import_picocolors18.default.dim("— " + r2.description)}` : ""));
|
|
50265
50367
|
}
|
|
50266
50368
|
console.log("");
|
|
50267
|
-
console.log(import_picocolors18.default.dim(` ${
|
|
50369
|
+
console.log(import_picocolors18.default.dim(` ${result2.results.length} of ${result2.total} (page ${result2.page}).`));
|
|
50268
50370
|
}
|
|
50269
50371
|
|
|
50270
50372
|
// src/cli/skill-info.ts
|
|
50271
50373
|
var import_picocolors19 = __toESM(require_picocolors(), 1);
|
|
50272
50374
|
function parseRef3(input) {
|
|
50273
|
-
const
|
|
50274
|
-
if (
|
|
50375
|
+
const at3 = input.indexOf("@");
|
|
50376
|
+
if (at3 < 0)
|
|
50275
50377
|
return { name: input };
|
|
50276
|
-
return { name: input.slice(0,
|
|
50378
|
+
return { name: input.slice(0, at3), version: input.slice(at3 + 1) };
|
|
50277
50379
|
}
|
|
50278
50380
|
async function runSkillInfo(args) {
|
|
50279
50381
|
banner(`skill info — ${import_picocolors19.default.bold(args.ref)}`);
|
|
@@ -50301,11 +50403,11 @@ async function runSkillInfo(args) {
|
|
|
50301
50403
|
}
|
|
50302
50404
|
|
|
50303
50405
|
// src/cli/skill.ts
|
|
50304
|
-
async function runSkill(cwd2, sub,
|
|
50406
|
+
async function runSkill(cwd2, sub, rest2, args) {
|
|
50305
50407
|
switch (sub) {
|
|
50306
50408
|
case "add":
|
|
50307
50409
|
case "install": {
|
|
50308
|
-
const source =
|
|
50410
|
+
const source = rest2[0];
|
|
50309
50411
|
if (!source) {
|
|
50310
50412
|
console.error("Usage: brainbase skill add <source>");
|
|
50311
50413
|
console.error(" source = owner/repo[@ref] | github:owner/repo/sub[@ref] | git URL | brainbase://creator/slug@version");
|
|
@@ -50326,7 +50428,7 @@ async function runSkill(cwd2, sub, rest, args) {
|
|
|
50326
50428
|
return;
|
|
50327
50429
|
case "update":
|
|
50328
50430
|
case "upgrade": {
|
|
50329
|
-
const slug =
|
|
50431
|
+
const slug = rest2[0];
|
|
50330
50432
|
if (!slug) {
|
|
50331
50433
|
console.error("Usage: brainbase skill update <slug>");
|
|
50332
50434
|
process.exit(1);
|
|
@@ -50342,7 +50444,7 @@ async function runSkill(cwd2, sub, rest, args) {
|
|
|
50342
50444
|
case "remove":
|
|
50343
50445
|
case "rm":
|
|
50344
50446
|
case "uninstall": {
|
|
50345
|
-
const slug =
|
|
50447
|
+
const slug = rest2[0];
|
|
50346
50448
|
if (!slug) {
|
|
50347
50449
|
console.error("Usage: brainbase skill remove <slug>");
|
|
50348
50450
|
process.exit(1);
|
|
@@ -50357,7 +50459,7 @@ async function runSkill(cwd2, sub, rest, args) {
|
|
|
50357
50459
|
}
|
|
50358
50460
|
case "search":
|
|
50359
50461
|
await runSkillSearch({
|
|
50360
|
-
q:
|
|
50462
|
+
q: rest2[0],
|
|
50361
50463
|
category: args.category,
|
|
50362
50464
|
agent: args.agent,
|
|
50363
50465
|
page: args.page
|
|
@@ -50365,7 +50467,7 @@ async function runSkill(cwd2, sub, rest, args) {
|
|
|
50365
50467
|
return;
|
|
50366
50468
|
case "info":
|
|
50367
50469
|
case "show": {
|
|
50368
|
-
const ref =
|
|
50470
|
+
const ref = rest2[0];
|
|
50369
50471
|
if (!ref) {
|
|
50370
50472
|
console.error("Usage: brainbase skill info <creator/slug>");
|
|
50371
50473
|
process.exit(1);
|
|
@@ -50375,7 +50477,7 @@ async function runSkill(cwd2, sub, rest, args) {
|
|
|
50375
50477
|
}
|
|
50376
50478
|
case "publish":
|
|
50377
50479
|
await runSkillPublish(cwd2, {
|
|
50378
|
-
dir:
|
|
50480
|
+
dir: rest2[0],
|
|
50379
50481
|
name: args.name,
|
|
50380
50482
|
version: args.skillVersion,
|
|
50381
50483
|
visibility: args.visibility,
|
|
@@ -50425,6 +50527,7 @@ function printSkillHelp() {
|
|
|
50425
50527
|
out.push(` ${import_picocolors20.default.dim("--visibility <v>")} for publish: public | unlisted | private`);
|
|
50426
50528
|
out.push(` ${import_picocolors20.default.dim("--name <c/s>")} for publish: creator/slug (skip prompt)`);
|
|
50427
50529
|
out.push(` ${import_picocolors20.default.dim("--skill-version <v>")} for publish: MAJOR.MINOR.PATCH (skip prompt)`);
|
|
50530
|
+
out.push(` ${import_picocolors20.default.dim(" --name and --skill-version are required with --yes")}`);
|
|
50428
50531
|
out.push("");
|
|
50429
50532
|
console.log(out.join(`
|
|
50430
50533
|
`));
|
|
@@ -50523,10 +50626,10 @@ function openInBrowser(url) {
|
|
|
50523
50626
|
spawn(cmd, args, { stdio: "ignore", detached: true }).unref();
|
|
50524
50627
|
}
|
|
50525
50628
|
function getFreePort() {
|
|
50526
|
-
return new Promise((resolve,
|
|
50629
|
+
return new Promise((resolve, reject2) => {
|
|
50527
50630
|
const srv = net.createServer();
|
|
50528
50631
|
srv.unref();
|
|
50529
|
-
srv.on("error",
|
|
50632
|
+
srv.on("error", reject2);
|
|
50530
50633
|
srv.listen(0, "127.0.0.1", () => {
|
|
50531
50634
|
const addr = srv.address();
|
|
50532
50635
|
if (typeof addr === "object" && addr) {
|
|
@@ -50534,17 +50637,17 @@ function getFreePort() {
|
|
|
50534
50637
|
srv.close(() => resolve(port));
|
|
50535
50638
|
} else {
|
|
50536
50639
|
srv.close();
|
|
50537
|
-
|
|
50640
|
+
reject2(new Error("no port"));
|
|
50538
50641
|
}
|
|
50539
50642
|
});
|
|
50540
50643
|
});
|
|
50541
50644
|
}
|
|
50542
50645
|
async function readBody(req) {
|
|
50543
|
-
return new Promise((resolve,
|
|
50646
|
+
return new Promise((resolve, reject2) => {
|
|
50544
50647
|
const chunks = [];
|
|
50545
50648
|
req.on("data", (c2) => chunks.push(c2));
|
|
50546
50649
|
req.on("end", () => resolve(Buffer.concat(chunks).toString("utf8")));
|
|
50547
|
-
req.on("error",
|
|
50650
|
+
req.on("error", reject2);
|
|
50548
50651
|
});
|
|
50549
50652
|
}
|
|
50550
50653
|
async function runLogin(_cwd, args) {
|
|
@@ -50556,7 +50659,7 @@ async function runLogin(_cwd, args) {
|
|
|
50556
50659
|
const url = `${webBase}/cli/auth?callback=${encodeURIComponent(callback)}&state=${expectedState}`;
|
|
50557
50660
|
let resolveResult;
|
|
50558
50661
|
let rejectResult;
|
|
50559
|
-
const
|
|
50662
|
+
const result2 = new Promise((res, rej) => {
|
|
50560
50663
|
resolveResult = res;
|
|
50561
50664
|
rejectResult = rej;
|
|
50562
50665
|
});
|
|
@@ -50615,8 +50718,8 @@ async function runLogin(_cwd, args) {
|
|
|
50615
50718
|
}
|
|
50616
50719
|
res.writeHead(404).end();
|
|
50617
50720
|
});
|
|
50618
|
-
await new Promise((resolve,
|
|
50619
|
-
server.once("error",
|
|
50721
|
+
await new Promise((resolve, reject2) => {
|
|
50722
|
+
server.once("error", reject2);
|
|
50620
50723
|
server.listen(port, "127.0.0.1", () => resolve());
|
|
50621
50724
|
});
|
|
50622
50725
|
f2.info(`Opening ${import_picocolors21.default.cyan(`${webBase}/cli/auth`)} in your browser…`);
|
|
@@ -50631,7 +50734,7 @@ async function runLogin(_cwd, args) {
|
|
|
50631
50734
|
rejectResult(new Error(`Login timed out after ${LOGIN_TIMEOUT_MS / 1000}s`));
|
|
50632
50735
|
}, LOGIN_TIMEOUT_MS);
|
|
50633
50736
|
try {
|
|
50634
|
-
const session = await
|
|
50737
|
+
const session = await result2;
|
|
50635
50738
|
clearTimeout(timeout);
|
|
50636
50739
|
server.close();
|
|
50637
50740
|
spinner.stop("Authorized.");
|
|
@@ -50790,6 +50893,9 @@ function parseSkillSource2(raw) {
|
|
|
50790
50893
|
}
|
|
50791
50894
|
throw new Error(`Unrecognized skill source "${raw}". Expected "registry:creator/slug[@version]", "registry:slug", or a relative path starting with "./".`);
|
|
50792
50895
|
}
|
|
50896
|
+
function registrySkillComponentSlug(s3) {
|
|
50897
|
+
return s3.creator ? `${s3.creator}--${s3.slug}` : s3.slug;
|
|
50898
|
+
}
|
|
50793
50899
|
var AgentMetaSchema = exports_external.object({
|
|
50794
50900
|
name: exports_external.string().min(1),
|
|
50795
50901
|
tagline: exports_external.string().optional()
|
|
@@ -50805,8 +50911,8 @@ var EntrypointSchema = exports_external.object({
|
|
|
50805
50911
|
commands: exports_external.array(exports_external.string().min(1)).optional(),
|
|
50806
50912
|
text: exports_external.string().optional()
|
|
50807
50913
|
}).refine((v3) => {
|
|
50808
|
-
const
|
|
50809
|
-
return
|
|
50914
|
+
const set2 = [v3.file, v3.commands, v3.text].filter((x3) => x3 !== undefined);
|
|
50915
|
+
return set2.length === 1;
|
|
50810
50916
|
}, {
|
|
50811
50917
|
message: "entrypoint must set exactly one of `file`, `commands`, or `text`"
|
|
50812
50918
|
});
|
|
@@ -50873,11 +50979,11 @@ function readManifest(cwd2) {
|
|
|
50873
50979
|
} catch (err) {
|
|
50874
50980
|
throw new Error(`${path42.basename(p2)} is not valid YAML: ${err.message}`);
|
|
50875
50981
|
}
|
|
50876
|
-
const
|
|
50877
|
-
if (!
|
|
50878
|
-
throw new Error(`${path42.basename(p2)} is invalid: ${
|
|
50982
|
+
const result2 = AgentManifestSchema.safeParse(parsed);
|
|
50983
|
+
if (!result2.success) {
|
|
50984
|
+
throw new Error(`${path42.basename(p2)} is invalid: ${result2.error.issues.map((i) => `${i.path.join(".") || "(root)"} — ${i.message}`).join("; ")}`);
|
|
50879
50985
|
}
|
|
50880
|
-
return
|
|
50986
|
+
return result2.data;
|
|
50881
50987
|
}
|
|
50882
50988
|
function writeManifest(cwd2, manifest) {
|
|
50883
50989
|
const doc = new import_yaml2.default.Document;
|
|
@@ -51233,11 +51339,11 @@ var claudeRouteAdapter = {
|
|
|
51233
51339
|
const settings = readJsonOr(file, {});
|
|
51234
51340
|
if (settings.env) {
|
|
51235
51341
|
for (const k3 of CLAUDE_ENV_KEYS) {
|
|
51236
|
-
const
|
|
51237
|
-
if (
|
|
51342
|
+
const before2 = snap?.envBefore?.[k3];
|
|
51343
|
+
if (before2 === undefined) {
|
|
51238
51344
|
delete settings.env[k3];
|
|
51239
51345
|
} else {
|
|
51240
|
-
settings.env[k3] =
|
|
51346
|
+
settings.env[k3] = before2;
|
|
51241
51347
|
}
|
|
51242
51348
|
}
|
|
51243
51349
|
if (Object.keys(settings.env).length === 0)
|
|
@@ -51840,13 +51946,13 @@ async function runSync(cwd2, args) {
|
|
|
51840
51946
|
resolveConflict: async (_c) => "overwrite",
|
|
51841
51947
|
resolveSecret: async () => null
|
|
51842
51948
|
};
|
|
51843
|
-
const
|
|
51949
|
+
const result2 = await runHarnessInstall(adapter.id, toInstall, opts, link2.name);
|
|
51844
51950
|
installSpinner.stop("Applied.");
|
|
51845
|
-
for (const o2 of
|
|
51951
|
+
for (const o2 of result2.installed) {
|
|
51846
51952
|
justInstalledPaths.set(`${o2.type}/${o2.slug}`, o2.installedPaths);
|
|
51847
51953
|
}
|
|
51848
|
-
if (
|
|
51849
|
-
f2.warn(`Skipped: ${
|
|
51954
|
+
if (result2.skipped.length) {
|
|
51955
|
+
f2.warn(`Skipped: ${result2.skipped.map((s3) => `${s3.type}/${s3.slug} (${s3.reason})`).join(", ")}`);
|
|
51850
51956
|
}
|
|
51851
51957
|
}
|
|
51852
51958
|
if (diff2.deletedUpstream.length > 0) {
|
|
@@ -52032,8 +52138,8 @@ function canonicalJson(value) {
|
|
|
52032
52138
|
}
|
|
52033
52139
|
if (typeof value === "object") {
|
|
52034
52140
|
const obj = value;
|
|
52035
|
-
const
|
|
52036
|
-
return "{" +
|
|
52141
|
+
const keys2 = Object.keys(obj).sort();
|
|
52142
|
+
return "{" + keys2.map((k3) => `${JSON.stringify(k3)}:${canonicalJson(obj[k3])}`).join(",") + "}";
|
|
52037
52143
|
}
|
|
52038
52144
|
throw new Error(`Unsupported value in canonicalJson: ${typeof value}`);
|
|
52039
52145
|
}
|
|
@@ -52127,7 +52233,7 @@ function readLocalComponents(cwd2, manifest) {
|
|
|
52127
52233
|
if (parsed.kind === "registry") {
|
|
52128
52234
|
out.push({
|
|
52129
52235
|
type: "skill",
|
|
52130
|
-
slug: parsed
|
|
52236
|
+
slug: registrySkillComponentSlug(parsed),
|
|
52131
52237
|
hash: null,
|
|
52132
52238
|
declaredSource: entry.source
|
|
52133
52239
|
});
|
|
@@ -52188,15 +52294,15 @@ function threeWayDiff(input) {
|
|
|
52188
52294
|
const localMap = new Map;
|
|
52189
52295
|
for (const c2 of input.local)
|
|
52190
52296
|
localMap.set(compKey(c2.type, c2.slug), c2);
|
|
52191
|
-
const
|
|
52297
|
+
const keys2 = new Set;
|
|
52192
52298
|
for (const k3 of lockMap.keys())
|
|
52193
|
-
|
|
52299
|
+
keys2.add(k3);
|
|
52194
52300
|
for (const k3 of cloudMap.keys())
|
|
52195
|
-
|
|
52301
|
+
keys2.add(k3);
|
|
52196
52302
|
for (const k3 of localMap.keys())
|
|
52197
|
-
|
|
52303
|
+
keys2.add(k3);
|
|
52198
52304
|
const rows = [];
|
|
52199
|
-
for (const key2 of [...
|
|
52305
|
+
for (const key2 of [...keys2].sort()) {
|
|
52200
52306
|
const lock = lockMap.get(key2);
|
|
52201
52307
|
const cloud = cloudMap.get(key2);
|
|
52202
52308
|
const local = localMap.get(key2);
|
|
@@ -52293,14 +52399,14 @@ function parseSecretsEnv(text) {
|
|
|
52293
52399
|
return out;
|
|
52294
52400
|
}
|
|
52295
52401
|
function formatSecretsEnv(secrets) {
|
|
52296
|
-
const
|
|
52402
|
+
const keys2 = Object.keys(secrets).sort();
|
|
52297
52403
|
const lines = [
|
|
52298
52404
|
"# Brainbase agent secrets — auto-generated by `brainbase agent pull`.",
|
|
52299
52405
|
"# Edit values here, then run `brainbase agent push` to sync back to the cloud.",
|
|
52300
52406
|
"# This file is gitignored. Do NOT commit it.",
|
|
52301
52407
|
""
|
|
52302
52408
|
];
|
|
52303
|
-
for (const k3 of
|
|
52409
|
+
for (const k3 of keys2) {
|
|
52304
52410
|
const v3 = secrets[k3] ?? "";
|
|
52305
52411
|
const escaped = v3.replace(/\\/g, "\\\\").replace(/"/g, "\\\"");
|
|
52306
52412
|
lines.push(`${k3}="${escaped}"`);
|
|
@@ -52519,13 +52625,13 @@ async function runAgentPull(cwd2, args) {
|
|
|
52519
52625
|
resolveConflict: async (_c) => "overwrite",
|
|
52520
52626
|
resolveSecret: async () => null
|
|
52521
52627
|
};
|
|
52522
|
-
const
|
|
52628
|
+
const result2 = await runHarnessInstall2(adapter.id, toInstall, opts, cloudAgent.name);
|
|
52523
52629
|
installSpinner.stop("Applied.");
|
|
52524
|
-
for (const o2 of
|
|
52630
|
+
for (const o2 of result2.installed) {
|
|
52525
52631
|
justInstalledPaths.set(`${o2.type}/${o2.slug}`, o2.installedPaths);
|
|
52526
52632
|
}
|
|
52527
|
-
if (
|
|
52528
|
-
f2.warn(`Skipped: ${
|
|
52633
|
+
if (result2.skipped.length) {
|
|
52634
|
+
f2.warn(`Skipped: ${result2.skipped.map((s3) => `${s3.type}/${s3.slug} (${s3.reason})`).join(", ")}`);
|
|
52529
52635
|
}
|
|
52530
52636
|
}
|
|
52531
52637
|
for (const r2 of removeRows) {
|
|
@@ -52915,13 +53021,13 @@ async function runEntrypointIfPresent(cwd2, manifest) {
|
|
|
52915
53021
|
env: env3,
|
|
52916
53022
|
stdio: ["ignore", "pipe", "pipe"]
|
|
52917
53023
|
});
|
|
52918
|
-
child.stdout?.on("data", (
|
|
52919
|
-
process.stdout.write(
|
|
52920
|
-
logStream.write(
|
|
53024
|
+
child.stdout?.on("data", (chunk2) => {
|
|
53025
|
+
process.stdout.write(chunk2);
|
|
53026
|
+
logStream.write(chunk2);
|
|
52921
53027
|
});
|
|
52922
|
-
child.stderr?.on("data", (
|
|
52923
|
-
process.stderr.write(
|
|
52924
|
-
logStream.write(
|
|
53028
|
+
child.stderr?.on("data", (chunk2) => {
|
|
53029
|
+
process.stderr.write(chunk2);
|
|
53030
|
+
logStream.write(chunk2);
|
|
52925
53031
|
});
|
|
52926
53032
|
child.on("error", (err) => {
|
|
52927
53033
|
f2.warn(`entrypoint failed to start: ${err.message}`);
|
|
@@ -53018,15 +53124,21 @@ async function buildOutgoingComponents(cwd2, manifest, cloud) {
|
|
|
53018
53124
|
}
|
|
53019
53125
|
}
|
|
53020
53126
|
for (const entry of manifest.skills) {
|
|
53021
|
-
|
|
53127
|
+
let parsed;
|
|
53128
|
+
try {
|
|
53129
|
+
parsed = parseSkillSource2(entry.source);
|
|
53130
|
+
} catch {
|
|
53131
|
+
continue;
|
|
53132
|
+
}
|
|
53022
53133
|
if (parsed.kind === "local") {
|
|
53023
53134
|
f2.error(`Skill ${import_picocolors26.default.bold(entry.source)} is a local-authored skill. Local skill push isn't supported yet — publish it to the registry first (\`brainbase skill publish\`).`);
|
|
53024
53135
|
return null;
|
|
53025
53136
|
}
|
|
53026
|
-
const
|
|
53137
|
+
const slug = registrySkillComponentSlug(parsed);
|
|
53138
|
+
const cloudMatch = cloud?.components.find((c2) => c2.type === "skill" && c2.slug === slug);
|
|
53027
53139
|
out.push({
|
|
53028
53140
|
type: "skill",
|
|
53029
|
-
slug
|
|
53141
|
+
slug,
|
|
53030
53142
|
hash: cloudMatch?.hash ?? "",
|
|
53031
53143
|
files: [],
|
|
53032
53144
|
meta: {
|
|
@@ -53187,7 +53299,12 @@ async function runAgentPush(cwd2, args) {
|
|
|
53187
53299
|
}
|
|
53188
53300
|
}
|
|
53189
53301
|
for (const entry of manifest.skills) {
|
|
53190
|
-
|
|
53302
|
+
let parsed;
|
|
53303
|
+
try {
|
|
53304
|
+
parsed = parseSkillSource2(entry.source);
|
|
53305
|
+
} catch {
|
|
53306
|
+
continue;
|
|
53307
|
+
}
|
|
53191
53308
|
if (parsed.kind === "local") {
|
|
53192
53309
|
f2.error(`Skill ${import_picocolors27.default.bold(entry.source)} is a local-authored skill. Local skill push isn't supported yet — publish it to the registry first (\`brainbase skill publish\`).`);
|
|
53193
53310
|
return;
|
|
@@ -53271,15 +53388,15 @@ async function runAgentPush(cwd2, args) {
|
|
|
53271
53388
|
const metaSpinner = de();
|
|
53272
53389
|
metaSpinner.start("Updating agent metadata…");
|
|
53273
53390
|
try {
|
|
53274
|
-
const
|
|
53391
|
+
const update2 = {};
|
|
53275
53392
|
if (meta.localChanged) {
|
|
53276
|
-
|
|
53277
|
-
|
|
53393
|
+
update2.name = manifest.agent.name;
|
|
53394
|
+
update2.tagline = manifest.agent.tagline ?? "";
|
|
53278
53395
|
}
|
|
53279
53396
|
if (entrypointChanged) {
|
|
53280
|
-
|
|
53397
|
+
update2.entrypoint = resolvedEntrypoint;
|
|
53281
53398
|
}
|
|
53282
|
-
await api.updateAgent(agentId,
|
|
53399
|
+
await api.updateAgent(agentId, update2);
|
|
53283
53400
|
metaSpinner.stop("Metadata updated.");
|
|
53284
53401
|
} catch (err) {
|
|
53285
53402
|
metaSpinner.stop("Failed.");
|
|
@@ -53329,7 +53446,7 @@ async function runAgentPush(cwd2, args) {
|
|
|
53329
53446
|
const decl = manifest.skills.find((s3) => {
|
|
53330
53447
|
try {
|
|
53331
53448
|
const parsed = parseSkillSource2(s3.source);
|
|
53332
|
-
return parsed.kind === "registry" && parsed
|
|
53449
|
+
return parsed.kind === "registry" && registrySkillComponentSlug(parsed) === c2.slug;
|
|
53333
53450
|
} catch {
|
|
53334
53451
|
return false;
|
|
53335
53452
|
}
|
|
@@ -53521,43 +53638,43 @@ async function runAgentStatus(cwd2) {
|
|
|
53521
53638
|
`));
|
|
53522
53639
|
}
|
|
53523
53640
|
function fmtRow(r2) {
|
|
53524
|
-
const
|
|
53641
|
+
const head3 = `${fmtType(r2.type)} ${import_picocolors28.default.bold(r2.slug)}`;
|
|
53525
53642
|
switch (r2.status) {
|
|
53526
53643
|
case "added-only-local":
|
|
53527
|
-
return `${
|
|
53644
|
+
return `${head3} ${import_picocolors28.default.dim("(new — only in brainbase.agent.yaml)")}`;
|
|
53528
53645
|
case "added-cloud":
|
|
53529
|
-
return `${
|
|
53646
|
+
return `${head3} ${import_picocolors28.default.dim("(new on cloud)")}`;
|
|
53530
53647
|
case "added-local":
|
|
53531
|
-
return `${
|
|
53648
|
+
return `${head3} ${import_picocolors28.default.dim("(present locally and on cloud, never synced here)")}`;
|
|
53532
53649
|
case "removed-local":
|
|
53533
|
-
return `${
|
|
53650
|
+
return `${head3} ${import_picocolors28.default.dim("(removed from brainbase.agent.yaml)")}`;
|
|
53534
53651
|
case "removed-cloud":
|
|
53535
|
-
return `${
|
|
53652
|
+
return `${head3} ${import_picocolors28.default.dim("(removed on cloud)")}`;
|
|
53536
53653
|
case "modified-local":
|
|
53537
|
-
return `${
|
|
53654
|
+
return `${head3} ${import_picocolors28.default.dim("(you edited it)")}`;
|
|
53538
53655
|
case "modified-cloud":
|
|
53539
|
-
return `${
|
|
53656
|
+
return `${head3} ${import_picocolors28.default.dim("(cloud was updated)")}`;
|
|
53540
53657
|
case "modified-both":
|
|
53541
|
-
return `${
|
|
53658
|
+
return `${head3} ${import_picocolors28.default.dim("(both diverged — needs resolution)")}`;
|
|
53542
53659
|
default:
|
|
53543
|
-
return
|
|
53660
|
+
return head3;
|
|
53544
53661
|
}
|
|
53545
53662
|
}
|
|
53546
53663
|
|
|
53547
53664
|
// src/cli/agent-env.ts
|
|
53548
53665
|
async function runAgentEnv(cwd2, args) {
|
|
53549
53666
|
const secrets = readLocalSecrets(cwd2);
|
|
53550
|
-
const
|
|
53551
|
-
if (
|
|
53667
|
+
const keys2 = Object.keys(secrets).sort();
|
|
53668
|
+
if (keys2.length === 0) {
|
|
53552
53669
|
process.stderr.write("No secrets in .brainbase/secrets.env. Run `brainbase agent pull` first.\n");
|
|
53553
53670
|
process.exit(0);
|
|
53554
53671
|
}
|
|
53555
53672
|
const shell = args.shell ?? detectShell();
|
|
53556
|
-
for (const k3 of
|
|
53673
|
+
for (const k3 of keys2) {
|
|
53557
53674
|
const v3 = secrets[k3] ?? "";
|
|
53558
53675
|
process.stdout.write(formatExport(shell, k3, v3));
|
|
53559
53676
|
}
|
|
53560
|
-
process.stderr.write(`# loaded ${
|
|
53677
|
+
process.stderr.write(`# loaded ${keys2.length} secret${keys2.length === 1 ? "" : "s"} for this shell
|
|
53561
53678
|
`);
|
|
53562
53679
|
}
|
|
53563
53680
|
function detectShell() {
|
|
@@ -54077,10 +54194,10 @@ async function runAgentUnpack(cwd2, args) {
|
|
|
54077
54194
|
};
|
|
54078
54195
|
const sp = de();
|
|
54079
54196
|
sp.start("Installing harness layout…");
|
|
54080
|
-
const
|
|
54197
|
+
const result2 = await runHarnessInstall3(harness, toInstall, opts, manifest.agent.name);
|
|
54081
54198
|
sp.stop("Installed.");
|
|
54082
|
-
if (
|
|
54083
|
-
f2.warn(`Skipped: ${
|
|
54199
|
+
if (result2.skipped.length) {
|
|
54200
|
+
f2.warn(`Skipped: ${result2.skipped.map((s3) => `${s3.type}/${s3.slug} (${s3.reason})`).join(", ")}`);
|
|
54084
54201
|
}
|
|
54085
54202
|
} catch (err) {
|
|
54086
54203
|
f2.error(`Install failed: ${err.message}`);
|
|
@@ -54210,15 +54327,15 @@ function runHarnessInstall3(harnessId, components, opts, agentName) {
|
|
|
54210
54327
|
return getAdapter(harnessId).install(components, opts);
|
|
54211
54328
|
}
|
|
54212
54329
|
async function pickHarness2(current) {
|
|
54213
|
-
const
|
|
54330
|
+
const initial2 = current ? normalizeHarnessId(current) : undefined;
|
|
54214
54331
|
const choice = await ie({
|
|
54215
54332
|
message: "Pick a harness to install as",
|
|
54216
54333
|
options: adapters.map((a3) => ({
|
|
54217
54334
|
value: a3.id,
|
|
54218
54335
|
label: a3.displayName,
|
|
54219
|
-
hint: a3.id ===
|
|
54336
|
+
hint: a3.id === initial2 ? "current" : undefined
|
|
54220
54337
|
})),
|
|
54221
|
-
initialValue:
|
|
54338
|
+
initialValue: initial2 ?? adapters[0].id
|
|
54222
54339
|
});
|
|
54223
54340
|
return ensureNotCancelled(choice);
|
|
54224
54341
|
}
|
|
@@ -54344,11 +54461,11 @@ function readOrchManifest(cwd2) {
|
|
|
54344
54461
|
} catch (err) {
|
|
54345
54462
|
throw new Error(`${ORCH_MANIFEST_FILE} is not valid YAML: ${err.message}`);
|
|
54346
54463
|
}
|
|
54347
|
-
const
|
|
54348
|
-
if (!
|
|
54349
|
-
throw new Error(`${ORCH_MANIFEST_FILE} is invalid: ${
|
|
54464
|
+
const result2 = OrchestrationManifestSchema.safeParse(parsed);
|
|
54465
|
+
if (!result2.success) {
|
|
54466
|
+
throw new Error(`${ORCH_MANIFEST_FILE} is invalid: ${result2.error.issues.map((i) => `${i.path.join(".") || "(root)"} — ${i.message}`).join("; ")}`);
|
|
54350
54467
|
}
|
|
54351
|
-
return
|
|
54468
|
+
return result2.data;
|
|
54352
54469
|
}
|
|
54353
54470
|
function writeOrchManifest(cwd2, manifest) {
|
|
54354
54471
|
const doc = new import_yaml4.default.Document;
|
|
@@ -54494,8 +54611,8 @@ async function installAgentFresh(input) {
|
|
|
54494
54611
|
resolveConflict: async (_c) => "overwrite",
|
|
54495
54612
|
resolveSecret: async () => null
|
|
54496
54613
|
};
|
|
54497
|
-
const
|
|
54498
|
-
for (const o2 of
|
|
54614
|
+
const result2 = await runHarnessInstall4(harness, toInstall, installOpts, agent.name);
|
|
54615
|
+
for (const o2 of result2.installed) {
|
|
54499
54616
|
justInstalledPaths.set(`${o2.type}/${o2.slug}`, o2.installedPaths);
|
|
54500
54617
|
}
|
|
54501
54618
|
}
|
|
@@ -54666,8 +54783,8 @@ async function runOrchestrationPull(cwd2, args) {
|
|
|
54666
54783
|
planLines.push(` ${import_picocolors33.default.dim("members:")}`);
|
|
54667
54784
|
for (const m3 of cloud.members) {
|
|
54668
54785
|
const skipped = !m3.manifest;
|
|
54669
|
-
const
|
|
54670
|
-
planLines.push(` ${import_picocolors33.default.cyan("•")} ${import_picocolors33.default.bold(m3.slug)} ${import_picocolors33.default.dim(`(${m3.name})`)}${
|
|
54786
|
+
const tail2 = skipped ? import_picocolors33.default.red(" (manifest unavailable — skipped)") : "";
|
|
54787
|
+
planLines.push(` ${import_picocolors33.default.cyan("•")} ${import_picocolors33.default.bold(m3.slug)} ${import_picocolors33.default.dim(`(${m3.name})`)}${tail2}`);
|
|
54671
54788
|
}
|
|
54672
54789
|
if (cloud.edges.length) {
|
|
54673
54790
|
planLines.push("");
|
|
@@ -55859,11 +55976,11 @@ async function runTokenClear() {
|
|
|
55859
55976
|
clearToken();
|
|
55860
55977
|
console.log(`${sym.ok} Cleared local token. (Server-side token still active until revoked.)`);
|
|
55861
55978
|
}
|
|
55862
|
-
function pickFlag(
|
|
55979
|
+
function pickFlag(rest2, ...names) {
|
|
55863
55980
|
for (const n of names) {
|
|
55864
|
-
const i =
|
|
55865
|
-
if (i !== -1 && i + 1 <
|
|
55866
|
-
return
|
|
55981
|
+
const i = rest2.indexOf(n);
|
|
55982
|
+
if (i !== -1 && i + 1 < rest2.length)
|
|
55983
|
+
return rest2[i + 1];
|
|
55867
55984
|
}
|
|
55868
55985
|
return;
|
|
55869
55986
|
}
|
|
@@ -55872,12 +55989,12 @@ function parseScopes(raw) {
|
|
|
55872
55989
|
return;
|
|
55873
55990
|
return raw.split(",").map((s3) => s3.trim()).filter((s3) => s3.length > 0);
|
|
55874
55991
|
}
|
|
55875
|
-
async function runToken(sub,
|
|
55992
|
+
async function runToken(sub, rest2, args) {
|
|
55876
55993
|
switch (sub) {
|
|
55877
55994
|
case "create":
|
|
55878
55995
|
case "new": {
|
|
55879
|
-
const name = pickFlag(
|
|
55880
|
-
const scopes = parseScopes(pickFlag(
|
|
55996
|
+
const name = pickFlag(rest2, "--name", "-n");
|
|
55997
|
+
const scopes = parseScopes(pickFlag(rest2, "--scope", "--scopes"));
|
|
55881
55998
|
return runTokenCreate({ name, scopes });
|
|
55882
55999
|
}
|
|
55883
56000
|
case "list":
|
|
@@ -55885,7 +56002,7 @@ async function runToken(sub, rest, args) {
|
|
|
55885
56002
|
return runTokenList();
|
|
55886
56003
|
case "revoke":
|
|
55887
56004
|
case "rm":
|
|
55888
|
-
return runTokenRevoke({ id:
|
|
56005
|
+
return runTokenRevoke({ id: rest2[0] ?? "", yes: args.yes });
|
|
55889
56006
|
case "clear":
|
|
55890
56007
|
return runTokenClear();
|
|
55891
56008
|
case undefined:
|
|
@@ -55934,7 +56051,7 @@ var PROTECTED = new Set([
|
|
|
55934
56051
|
function help() {
|
|
55935
56052
|
const out = [];
|
|
55936
56053
|
out.push("");
|
|
55937
|
-
out.push(` ${brandTint("◆")} ${import_picocolors40.default.bold("brainbase")} ${import_picocolors40.default.dim(
|
|
56054
|
+
out.push(` ${brandTint("◆")} ${import_picocolors40.default.bold("brainbase")} ${import_picocolors40.default.dim(`v${VERSION}`)}`);
|
|
55938
56055
|
out.push(` ${import_picocolors40.default.dim("connect your local agent to the brainbase platform")}`);
|
|
55939
56056
|
out.push("");
|
|
55940
56057
|
out.push(divider("USAGE"));
|