agenter 0.0.1 → 0.0.3
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/bin/agenter.js +0 -0
- package/dist/agenter.js +1066 -1012
- package/package.json +1 -1
package/dist/agenter.js
CHANGED
|
@@ -48,6 +48,1002 @@ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
|
48
48
|
var __promiseAll = (args) => Promise.all(args);
|
|
49
49
|
var __require = import.meta.require;
|
|
50
50
|
|
|
51
|
+
// node_modules/.bun/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
|
|
52
|
+
var require_Reflect = __commonJS(() => {
|
|
53
|
+
/*! *****************************************************************************
|
|
54
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
55
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
56
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
57
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
58
|
+
|
|
59
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
60
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
61
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
62
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
63
|
+
|
|
64
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
65
|
+
and limitations under the License.
|
|
66
|
+
***************************************************************************** */
|
|
67
|
+
var Reflect2;
|
|
68
|
+
(function(Reflect3) {
|
|
69
|
+
(function(factory) {
|
|
70
|
+
var root = typeof globalThis === "object" ? globalThis : typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : sloppyModeThis();
|
|
71
|
+
var exporter = makeExporter(Reflect3);
|
|
72
|
+
if (typeof root.Reflect !== "undefined") {
|
|
73
|
+
exporter = makeExporter(root.Reflect, exporter);
|
|
74
|
+
}
|
|
75
|
+
factory(exporter, root);
|
|
76
|
+
if (typeof root.Reflect === "undefined") {
|
|
77
|
+
root.Reflect = Reflect3;
|
|
78
|
+
}
|
|
79
|
+
function makeExporter(target, previous) {
|
|
80
|
+
return function(key, value) {
|
|
81
|
+
Object.defineProperty(target, key, { configurable: true, writable: true, value });
|
|
82
|
+
if (previous)
|
|
83
|
+
previous(key, value);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
function functionThis() {
|
|
87
|
+
try {
|
|
88
|
+
return Function("return this;")();
|
|
89
|
+
} catch (_) {}
|
|
90
|
+
}
|
|
91
|
+
function indirectEvalThis() {
|
|
92
|
+
try {
|
|
93
|
+
return (undefined, eval)("(function() { return this; })()");
|
|
94
|
+
} catch (_) {}
|
|
95
|
+
}
|
|
96
|
+
function sloppyModeThis() {
|
|
97
|
+
return functionThis() || indirectEvalThis();
|
|
98
|
+
}
|
|
99
|
+
})(function(exporter, root) {
|
|
100
|
+
var hasOwn = Object.prototype.hasOwnProperty;
|
|
101
|
+
var supportsSymbol = typeof Symbol === "function";
|
|
102
|
+
var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
|
|
103
|
+
var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
|
|
104
|
+
var supportsCreate = typeof Object.create === "function";
|
|
105
|
+
var supportsProto = { __proto__: [] } instanceof Array;
|
|
106
|
+
var downLevel = !supportsCreate && !supportsProto;
|
|
107
|
+
var HashMap = {
|
|
108
|
+
create: supportsCreate ? function() {
|
|
109
|
+
return MakeDictionary(Object.create(null));
|
|
110
|
+
} : supportsProto ? function() {
|
|
111
|
+
return MakeDictionary({ __proto__: null });
|
|
112
|
+
} : function() {
|
|
113
|
+
return MakeDictionary({});
|
|
114
|
+
},
|
|
115
|
+
has: downLevel ? function(map, key) {
|
|
116
|
+
return hasOwn.call(map, key);
|
|
117
|
+
} : function(map, key) {
|
|
118
|
+
return key in map;
|
|
119
|
+
},
|
|
120
|
+
get: downLevel ? function(map, key) {
|
|
121
|
+
return hasOwn.call(map, key) ? map[key] : undefined;
|
|
122
|
+
} : function(map, key) {
|
|
123
|
+
return map[key];
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
var functionPrototype = Object.getPrototypeOf(Function);
|
|
127
|
+
var _Map = typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
|
|
128
|
+
var _Set = typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
|
|
129
|
+
var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
|
130
|
+
var registrySymbol = supportsSymbol ? Symbol.for("@reflect-metadata:registry") : undefined;
|
|
131
|
+
var metadataRegistry = GetOrCreateMetadataRegistry();
|
|
132
|
+
var metadataProvider = CreateMetadataProvider(metadataRegistry);
|
|
133
|
+
function decorate(decorators, target, propertyKey, attributes) {
|
|
134
|
+
if (!IsUndefined(propertyKey)) {
|
|
135
|
+
if (!IsArray(decorators))
|
|
136
|
+
throw new TypeError;
|
|
137
|
+
if (!IsObject(target))
|
|
138
|
+
throw new TypeError;
|
|
139
|
+
if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
|
|
140
|
+
throw new TypeError;
|
|
141
|
+
if (IsNull(attributes))
|
|
142
|
+
attributes = undefined;
|
|
143
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
144
|
+
return DecorateProperty(decorators, target, propertyKey, attributes);
|
|
145
|
+
} else {
|
|
146
|
+
if (!IsArray(decorators))
|
|
147
|
+
throw new TypeError;
|
|
148
|
+
if (!IsConstructor(target))
|
|
149
|
+
throw new TypeError;
|
|
150
|
+
return DecorateConstructor(decorators, target);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
exporter("decorate", decorate);
|
|
154
|
+
function metadata(metadataKey, metadataValue) {
|
|
155
|
+
function decorator(target, propertyKey) {
|
|
156
|
+
if (!IsObject(target))
|
|
157
|
+
throw new TypeError;
|
|
158
|
+
if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
|
|
159
|
+
throw new TypeError;
|
|
160
|
+
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
161
|
+
}
|
|
162
|
+
return decorator;
|
|
163
|
+
}
|
|
164
|
+
exporter("metadata", metadata);
|
|
165
|
+
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
166
|
+
if (!IsObject(target))
|
|
167
|
+
throw new TypeError;
|
|
168
|
+
if (!IsUndefined(propertyKey))
|
|
169
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
170
|
+
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
171
|
+
}
|
|
172
|
+
exporter("defineMetadata", defineMetadata);
|
|
173
|
+
function hasMetadata(metadataKey, target, propertyKey) {
|
|
174
|
+
if (!IsObject(target))
|
|
175
|
+
throw new TypeError;
|
|
176
|
+
if (!IsUndefined(propertyKey))
|
|
177
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
178
|
+
return OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
179
|
+
}
|
|
180
|
+
exporter("hasMetadata", hasMetadata);
|
|
181
|
+
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
182
|
+
if (!IsObject(target))
|
|
183
|
+
throw new TypeError;
|
|
184
|
+
if (!IsUndefined(propertyKey))
|
|
185
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
186
|
+
return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
187
|
+
}
|
|
188
|
+
exporter("hasOwnMetadata", hasOwnMetadata);
|
|
189
|
+
function getMetadata(metadataKey, target, propertyKey) {
|
|
190
|
+
if (!IsObject(target))
|
|
191
|
+
throw new TypeError;
|
|
192
|
+
if (!IsUndefined(propertyKey))
|
|
193
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
194
|
+
return OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
195
|
+
}
|
|
196
|
+
exporter("getMetadata", getMetadata);
|
|
197
|
+
function getOwnMetadata(metadataKey, target, propertyKey) {
|
|
198
|
+
if (!IsObject(target))
|
|
199
|
+
throw new TypeError;
|
|
200
|
+
if (!IsUndefined(propertyKey))
|
|
201
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
202
|
+
return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
|
|
203
|
+
}
|
|
204
|
+
exporter("getOwnMetadata", getOwnMetadata);
|
|
205
|
+
function getMetadataKeys(target, propertyKey) {
|
|
206
|
+
if (!IsObject(target))
|
|
207
|
+
throw new TypeError;
|
|
208
|
+
if (!IsUndefined(propertyKey))
|
|
209
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
210
|
+
return OrdinaryMetadataKeys(target, propertyKey);
|
|
211
|
+
}
|
|
212
|
+
exporter("getMetadataKeys", getMetadataKeys);
|
|
213
|
+
function getOwnMetadataKeys(target, propertyKey) {
|
|
214
|
+
if (!IsObject(target))
|
|
215
|
+
throw new TypeError;
|
|
216
|
+
if (!IsUndefined(propertyKey))
|
|
217
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
218
|
+
return OrdinaryOwnMetadataKeys(target, propertyKey);
|
|
219
|
+
}
|
|
220
|
+
exporter("getOwnMetadataKeys", getOwnMetadataKeys);
|
|
221
|
+
function deleteMetadata(metadataKey, target, propertyKey) {
|
|
222
|
+
if (!IsObject(target))
|
|
223
|
+
throw new TypeError;
|
|
224
|
+
if (!IsUndefined(propertyKey))
|
|
225
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
226
|
+
if (!IsObject(target))
|
|
227
|
+
throw new TypeError;
|
|
228
|
+
if (!IsUndefined(propertyKey))
|
|
229
|
+
propertyKey = ToPropertyKey(propertyKey);
|
|
230
|
+
var provider = GetMetadataProvider(target, propertyKey, false);
|
|
231
|
+
if (IsUndefined(provider))
|
|
232
|
+
return false;
|
|
233
|
+
return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);
|
|
234
|
+
}
|
|
235
|
+
exporter("deleteMetadata", deleteMetadata);
|
|
236
|
+
function DecorateConstructor(decorators, target) {
|
|
237
|
+
for (var i = decorators.length - 1;i >= 0; --i) {
|
|
238
|
+
var decorator = decorators[i];
|
|
239
|
+
var decorated = decorator(target);
|
|
240
|
+
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
241
|
+
if (!IsConstructor(decorated))
|
|
242
|
+
throw new TypeError;
|
|
243
|
+
target = decorated;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return target;
|
|
247
|
+
}
|
|
248
|
+
function DecorateProperty(decorators, target, propertyKey, descriptor) {
|
|
249
|
+
for (var i = decorators.length - 1;i >= 0; --i) {
|
|
250
|
+
var decorator = decorators[i];
|
|
251
|
+
var decorated = decorator(target, propertyKey, descriptor);
|
|
252
|
+
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
253
|
+
if (!IsObject(decorated))
|
|
254
|
+
throw new TypeError;
|
|
255
|
+
descriptor = decorated;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return descriptor;
|
|
259
|
+
}
|
|
260
|
+
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
261
|
+
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
262
|
+
if (hasOwn2)
|
|
263
|
+
return true;
|
|
264
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
265
|
+
if (!IsNull(parent))
|
|
266
|
+
return OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
267
|
+
return false;
|
|
268
|
+
}
|
|
269
|
+
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
270
|
+
var provider = GetMetadataProvider(O, P, false);
|
|
271
|
+
if (IsUndefined(provider))
|
|
272
|
+
return false;
|
|
273
|
+
return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));
|
|
274
|
+
}
|
|
275
|
+
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
276
|
+
var hasOwn2 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
277
|
+
if (hasOwn2)
|
|
278
|
+
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
279
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
280
|
+
if (!IsNull(parent))
|
|
281
|
+
return OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
285
|
+
var provider = GetMetadataProvider(O, P, false);
|
|
286
|
+
if (IsUndefined(provider))
|
|
287
|
+
return;
|
|
288
|
+
return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
289
|
+
}
|
|
290
|
+
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
291
|
+
var provider = GetMetadataProvider(O, P, true);
|
|
292
|
+
provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);
|
|
293
|
+
}
|
|
294
|
+
function OrdinaryMetadataKeys(O, P) {
|
|
295
|
+
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
|
|
296
|
+
var parent = OrdinaryGetPrototypeOf(O);
|
|
297
|
+
if (parent === null)
|
|
298
|
+
return ownKeys;
|
|
299
|
+
var parentKeys = OrdinaryMetadataKeys(parent, P);
|
|
300
|
+
if (parentKeys.length <= 0)
|
|
301
|
+
return ownKeys;
|
|
302
|
+
if (ownKeys.length <= 0)
|
|
303
|
+
return parentKeys;
|
|
304
|
+
var set = new _Set;
|
|
305
|
+
var keys = [];
|
|
306
|
+
for (var _i = 0, ownKeys_1 = ownKeys;_i < ownKeys_1.length; _i++) {
|
|
307
|
+
var key = ownKeys_1[_i];
|
|
308
|
+
var hasKey = set.has(key);
|
|
309
|
+
if (!hasKey) {
|
|
310
|
+
set.add(key);
|
|
311
|
+
keys.push(key);
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
for (var _a = 0, parentKeys_1 = parentKeys;_a < parentKeys_1.length; _a++) {
|
|
315
|
+
var key = parentKeys_1[_a];
|
|
316
|
+
var hasKey = set.has(key);
|
|
317
|
+
if (!hasKey) {
|
|
318
|
+
set.add(key);
|
|
319
|
+
keys.push(key);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return keys;
|
|
323
|
+
}
|
|
324
|
+
function OrdinaryOwnMetadataKeys(O, P) {
|
|
325
|
+
var provider = GetMetadataProvider(O, P, false);
|
|
326
|
+
if (!provider) {
|
|
327
|
+
return [];
|
|
328
|
+
}
|
|
329
|
+
return provider.OrdinaryOwnMetadataKeys(O, P);
|
|
330
|
+
}
|
|
331
|
+
function Type(x) {
|
|
332
|
+
if (x === null)
|
|
333
|
+
return 1;
|
|
334
|
+
switch (typeof x) {
|
|
335
|
+
case "undefined":
|
|
336
|
+
return 0;
|
|
337
|
+
case "boolean":
|
|
338
|
+
return 2;
|
|
339
|
+
case "string":
|
|
340
|
+
return 3;
|
|
341
|
+
case "symbol":
|
|
342
|
+
return 4;
|
|
343
|
+
case "number":
|
|
344
|
+
return 5;
|
|
345
|
+
case "object":
|
|
346
|
+
return x === null ? 1 : 6;
|
|
347
|
+
default:
|
|
348
|
+
return 6;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
function IsUndefined(x) {
|
|
352
|
+
return x === undefined;
|
|
353
|
+
}
|
|
354
|
+
function IsNull(x) {
|
|
355
|
+
return x === null;
|
|
356
|
+
}
|
|
357
|
+
function IsSymbol(x) {
|
|
358
|
+
return typeof x === "symbol";
|
|
359
|
+
}
|
|
360
|
+
function IsObject(x) {
|
|
361
|
+
return typeof x === "object" ? x !== null : typeof x === "function";
|
|
362
|
+
}
|
|
363
|
+
function ToPrimitive(input, PreferredType) {
|
|
364
|
+
switch (Type(input)) {
|
|
365
|
+
case 0:
|
|
366
|
+
return input;
|
|
367
|
+
case 1:
|
|
368
|
+
return input;
|
|
369
|
+
case 2:
|
|
370
|
+
return input;
|
|
371
|
+
case 3:
|
|
372
|
+
return input;
|
|
373
|
+
case 4:
|
|
374
|
+
return input;
|
|
375
|
+
case 5:
|
|
376
|
+
return input;
|
|
377
|
+
}
|
|
378
|
+
var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
|
|
379
|
+
var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
380
|
+
if (exoticToPrim !== undefined) {
|
|
381
|
+
var result = exoticToPrim.call(input, hint);
|
|
382
|
+
if (IsObject(result))
|
|
383
|
+
throw new TypeError;
|
|
384
|
+
return result;
|
|
385
|
+
}
|
|
386
|
+
return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
|
|
387
|
+
}
|
|
388
|
+
function OrdinaryToPrimitive(O, hint) {
|
|
389
|
+
if (hint === "string") {
|
|
390
|
+
var toString_1 = O.toString;
|
|
391
|
+
if (IsCallable(toString_1)) {
|
|
392
|
+
var result = toString_1.call(O);
|
|
393
|
+
if (!IsObject(result))
|
|
394
|
+
return result;
|
|
395
|
+
}
|
|
396
|
+
var valueOf = O.valueOf;
|
|
397
|
+
if (IsCallable(valueOf)) {
|
|
398
|
+
var result = valueOf.call(O);
|
|
399
|
+
if (!IsObject(result))
|
|
400
|
+
return result;
|
|
401
|
+
}
|
|
402
|
+
} else {
|
|
403
|
+
var valueOf = O.valueOf;
|
|
404
|
+
if (IsCallable(valueOf)) {
|
|
405
|
+
var result = valueOf.call(O);
|
|
406
|
+
if (!IsObject(result))
|
|
407
|
+
return result;
|
|
408
|
+
}
|
|
409
|
+
var toString_2 = O.toString;
|
|
410
|
+
if (IsCallable(toString_2)) {
|
|
411
|
+
var result = toString_2.call(O);
|
|
412
|
+
if (!IsObject(result))
|
|
413
|
+
return result;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
throw new TypeError;
|
|
417
|
+
}
|
|
418
|
+
function ToBoolean(argument) {
|
|
419
|
+
return !!argument;
|
|
420
|
+
}
|
|
421
|
+
function ToString(argument) {
|
|
422
|
+
return "" + argument;
|
|
423
|
+
}
|
|
424
|
+
function ToPropertyKey(argument) {
|
|
425
|
+
var key = ToPrimitive(argument, 3);
|
|
426
|
+
if (IsSymbol(key))
|
|
427
|
+
return key;
|
|
428
|
+
return ToString(key);
|
|
429
|
+
}
|
|
430
|
+
function IsArray(argument) {
|
|
431
|
+
return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
|
|
432
|
+
}
|
|
433
|
+
function IsCallable(argument) {
|
|
434
|
+
return typeof argument === "function";
|
|
435
|
+
}
|
|
436
|
+
function IsConstructor(argument) {
|
|
437
|
+
return typeof argument === "function";
|
|
438
|
+
}
|
|
439
|
+
function IsPropertyKey(argument) {
|
|
440
|
+
switch (Type(argument)) {
|
|
441
|
+
case 3:
|
|
442
|
+
return true;
|
|
443
|
+
case 4:
|
|
444
|
+
return true;
|
|
445
|
+
default:
|
|
446
|
+
return false;
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
function SameValueZero(x, y) {
|
|
450
|
+
return x === y || x !== x && y !== y;
|
|
451
|
+
}
|
|
452
|
+
function GetMethod(V, P) {
|
|
453
|
+
var func = V[P];
|
|
454
|
+
if (func === undefined || func === null)
|
|
455
|
+
return;
|
|
456
|
+
if (!IsCallable(func))
|
|
457
|
+
throw new TypeError;
|
|
458
|
+
return func;
|
|
459
|
+
}
|
|
460
|
+
function GetIterator(obj) {
|
|
461
|
+
var method = GetMethod(obj, iteratorSymbol);
|
|
462
|
+
if (!IsCallable(method))
|
|
463
|
+
throw new TypeError;
|
|
464
|
+
var iterator = method.call(obj);
|
|
465
|
+
if (!IsObject(iterator))
|
|
466
|
+
throw new TypeError;
|
|
467
|
+
return iterator;
|
|
468
|
+
}
|
|
469
|
+
function IteratorValue(iterResult) {
|
|
470
|
+
return iterResult.value;
|
|
471
|
+
}
|
|
472
|
+
function IteratorStep(iterator) {
|
|
473
|
+
var result = iterator.next();
|
|
474
|
+
return result.done ? false : result;
|
|
475
|
+
}
|
|
476
|
+
function IteratorClose(iterator) {
|
|
477
|
+
var f = iterator["return"];
|
|
478
|
+
if (f)
|
|
479
|
+
f.call(iterator);
|
|
480
|
+
}
|
|
481
|
+
function OrdinaryGetPrototypeOf(O) {
|
|
482
|
+
var proto = Object.getPrototypeOf(O);
|
|
483
|
+
if (typeof O !== "function" || O === functionPrototype)
|
|
484
|
+
return proto;
|
|
485
|
+
if (proto !== functionPrototype)
|
|
486
|
+
return proto;
|
|
487
|
+
var prototype = O.prototype;
|
|
488
|
+
var prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
489
|
+
if (prototypeProto == null || prototypeProto === Object.prototype)
|
|
490
|
+
return proto;
|
|
491
|
+
var constructor = prototypeProto.constructor;
|
|
492
|
+
if (typeof constructor !== "function")
|
|
493
|
+
return proto;
|
|
494
|
+
if (constructor === O)
|
|
495
|
+
return proto;
|
|
496
|
+
return constructor;
|
|
497
|
+
}
|
|
498
|
+
function CreateMetadataRegistry() {
|
|
499
|
+
var fallback;
|
|
500
|
+
if (!IsUndefined(registrySymbol) && typeof root.Reflect !== "undefined" && !(registrySymbol in root.Reflect) && typeof root.Reflect.defineMetadata === "function") {
|
|
501
|
+
fallback = CreateFallbackProvider(root.Reflect);
|
|
502
|
+
}
|
|
503
|
+
var first;
|
|
504
|
+
var second;
|
|
505
|
+
var rest;
|
|
506
|
+
var targetProviderMap = new _WeakMap;
|
|
507
|
+
var registry = {
|
|
508
|
+
registerProvider,
|
|
509
|
+
getProvider,
|
|
510
|
+
setProvider
|
|
511
|
+
};
|
|
512
|
+
return registry;
|
|
513
|
+
function registerProvider(provider) {
|
|
514
|
+
if (!Object.isExtensible(registry)) {
|
|
515
|
+
throw new Error("Cannot add provider to a frozen registry.");
|
|
516
|
+
}
|
|
517
|
+
switch (true) {
|
|
518
|
+
case fallback === provider:
|
|
519
|
+
break;
|
|
520
|
+
case IsUndefined(first):
|
|
521
|
+
first = provider;
|
|
522
|
+
break;
|
|
523
|
+
case first === provider:
|
|
524
|
+
break;
|
|
525
|
+
case IsUndefined(second):
|
|
526
|
+
second = provider;
|
|
527
|
+
break;
|
|
528
|
+
case second === provider:
|
|
529
|
+
break;
|
|
530
|
+
default:
|
|
531
|
+
if (rest === undefined)
|
|
532
|
+
rest = new _Set;
|
|
533
|
+
rest.add(provider);
|
|
534
|
+
break;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
function getProviderNoCache(O, P) {
|
|
538
|
+
if (!IsUndefined(first)) {
|
|
539
|
+
if (first.isProviderFor(O, P))
|
|
540
|
+
return first;
|
|
541
|
+
if (!IsUndefined(second)) {
|
|
542
|
+
if (second.isProviderFor(O, P))
|
|
543
|
+
return first;
|
|
544
|
+
if (!IsUndefined(rest)) {
|
|
545
|
+
var iterator = GetIterator(rest);
|
|
546
|
+
while (true) {
|
|
547
|
+
var next = IteratorStep(iterator);
|
|
548
|
+
if (!next) {
|
|
549
|
+
return;
|
|
550
|
+
}
|
|
551
|
+
var provider = IteratorValue(next);
|
|
552
|
+
if (provider.isProviderFor(O, P)) {
|
|
553
|
+
IteratorClose(iterator);
|
|
554
|
+
return provider;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
if (!IsUndefined(fallback) && fallback.isProviderFor(O, P)) {
|
|
561
|
+
return fallback;
|
|
562
|
+
}
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
function getProvider(O, P) {
|
|
566
|
+
var providerMap = targetProviderMap.get(O);
|
|
567
|
+
var provider;
|
|
568
|
+
if (!IsUndefined(providerMap)) {
|
|
569
|
+
provider = providerMap.get(P);
|
|
570
|
+
}
|
|
571
|
+
if (!IsUndefined(provider)) {
|
|
572
|
+
return provider;
|
|
573
|
+
}
|
|
574
|
+
provider = getProviderNoCache(O, P);
|
|
575
|
+
if (!IsUndefined(provider)) {
|
|
576
|
+
if (IsUndefined(providerMap)) {
|
|
577
|
+
providerMap = new _Map;
|
|
578
|
+
targetProviderMap.set(O, providerMap);
|
|
579
|
+
}
|
|
580
|
+
providerMap.set(P, provider);
|
|
581
|
+
}
|
|
582
|
+
return provider;
|
|
583
|
+
}
|
|
584
|
+
function hasProvider(provider) {
|
|
585
|
+
if (IsUndefined(provider))
|
|
586
|
+
throw new TypeError;
|
|
587
|
+
return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);
|
|
588
|
+
}
|
|
589
|
+
function setProvider(O, P, provider) {
|
|
590
|
+
if (!hasProvider(provider)) {
|
|
591
|
+
throw new Error("Metadata provider not registered.");
|
|
592
|
+
}
|
|
593
|
+
var existingProvider = getProvider(O, P);
|
|
594
|
+
if (existingProvider !== provider) {
|
|
595
|
+
if (!IsUndefined(existingProvider)) {
|
|
596
|
+
return false;
|
|
597
|
+
}
|
|
598
|
+
var providerMap = targetProviderMap.get(O);
|
|
599
|
+
if (IsUndefined(providerMap)) {
|
|
600
|
+
providerMap = new _Map;
|
|
601
|
+
targetProviderMap.set(O, providerMap);
|
|
602
|
+
}
|
|
603
|
+
providerMap.set(P, provider);
|
|
604
|
+
}
|
|
605
|
+
return true;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
function GetOrCreateMetadataRegistry() {
|
|
609
|
+
var metadataRegistry2;
|
|
610
|
+
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
611
|
+
metadataRegistry2 = root.Reflect[registrySymbol];
|
|
612
|
+
}
|
|
613
|
+
if (IsUndefined(metadataRegistry2)) {
|
|
614
|
+
metadataRegistry2 = CreateMetadataRegistry();
|
|
615
|
+
}
|
|
616
|
+
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
617
|
+
Object.defineProperty(root.Reflect, registrySymbol, {
|
|
618
|
+
enumerable: false,
|
|
619
|
+
configurable: false,
|
|
620
|
+
writable: false,
|
|
621
|
+
value: metadataRegistry2
|
|
622
|
+
});
|
|
623
|
+
}
|
|
624
|
+
return metadataRegistry2;
|
|
625
|
+
}
|
|
626
|
+
function CreateMetadataProvider(registry) {
|
|
627
|
+
var metadata2 = new _WeakMap;
|
|
628
|
+
var provider = {
|
|
629
|
+
isProviderFor: function(O, P) {
|
|
630
|
+
var targetMetadata = metadata2.get(O);
|
|
631
|
+
if (IsUndefined(targetMetadata))
|
|
632
|
+
return false;
|
|
633
|
+
return targetMetadata.has(P);
|
|
634
|
+
},
|
|
635
|
+
OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata2,
|
|
636
|
+
OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata2,
|
|
637
|
+
OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata2,
|
|
638
|
+
OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys2,
|
|
639
|
+
OrdinaryDeleteMetadata
|
|
640
|
+
};
|
|
641
|
+
metadataRegistry.registerProvider(provider);
|
|
642
|
+
return provider;
|
|
643
|
+
function GetOrCreateMetadataMap(O, P, Create) {
|
|
644
|
+
var targetMetadata = metadata2.get(O);
|
|
645
|
+
var createdTargetMetadata = false;
|
|
646
|
+
if (IsUndefined(targetMetadata)) {
|
|
647
|
+
if (!Create)
|
|
648
|
+
return;
|
|
649
|
+
targetMetadata = new _Map;
|
|
650
|
+
metadata2.set(O, targetMetadata);
|
|
651
|
+
createdTargetMetadata = true;
|
|
652
|
+
}
|
|
653
|
+
var metadataMap = targetMetadata.get(P);
|
|
654
|
+
if (IsUndefined(metadataMap)) {
|
|
655
|
+
if (!Create)
|
|
656
|
+
return;
|
|
657
|
+
metadataMap = new _Map;
|
|
658
|
+
targetMetadata.set(P, metadataMap);
|
|
659
|
+
if (!registry.setProvider(O, P, provider)) {
|
|
660
|
+
targetMetadata.delete(P);
|
|
661
|
+
if (createdTargetMetadata) {
|
|
662
|
+
metadata2.delete(O);
|
|
663
|
+
}
|
|
664
|
+
throw new Error("Wrong provider for target.");
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
return metadataMap;
|
|
668
|
+
}
|
|
669
|
+
function OrdinaryHasOwnMetadata2(MetadataKey, O, P) {
|
|
670
|
+
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
671
|
+
if (IsUndefined(metadataMap))
|
|
672
|
+
return false;
|
|
673
|
+
return ToBoolean(metadataMap.has(MetadataKey));
|
|
674
|
+
}
|
|
675
|
+
function OrdinaryGetOwnMetadata2(MetadataKey, O, P) {
|
|
676
|
+
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
677
|
+
if (IsUndefined(metadataMap))
|
|
678
|
+
return;
|
|
679
|
+
return metadataMap.get(MetadataKey);
|
|
680
|
+
}
|
|
681
|
+
function OrdinaryDefineOwnMetadata2(MetadataKey, MetadataValue, O, P) {
|
|
682
|
+
var metadataMap = GetOrCreateMetadataMap(O, P, true);
|
|
683
|
+
metadataMap.set(MetadataKey, MetadataValue);
|
|
684
|
+
}
|
|
685
|
+
function OrdinaryOwnMetadataKeys2(O, P) {
|
|
686
|
+
var keys = [];
|
|
687
|
+
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
688
|
+
if (IsUndefined(metadataMap))
|
|
689
|
+
return keys;
|
|
690
|
+
var keysObj = metadataMap.keys();
|
|
691
|
+
var iterator = GetIterator(keysObj);
|
|
692
|
+
var k = 0;
|
|
693
|
+
while (true) {
|
|
694
|
+
var next = IteratorStep(iterator);
|
|
695
|
+
if (!next) {
|
|
696
|
+
keys.length = k;
|
|
697
|
+
return keys;
|
|
698
|
+
}
|
|
699
|
+
var nextValue = IteratorValue(next);
|
|
700
|
+
try {
|
|
701
|
+
keys[k] = nextValue;
|
|
702
|
+
} catch (e) {
|
|
703
|
+
try {
|
|
704
|
+
IteratorClose(iterator);
|
|
705
|
+
} finally {
|
|
706
|
+
throw e;
|
|
707
|
+
}
|
|
708
|
+
}
|
|
709
|
+
k++;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
function OrdinaryDeleteMetadata(MetadataKey, O, P) {
|
|
713
|
+
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
714
|
+
if (IsUndefined(metadataMap))
|
|
715
|
+
return false;
|
|
716
|
+
if (!metadataMap.delete(MetadataKey))
|
|
717
|
+
return false;
|
|
718
|
+
if (metadataMap.size === 0) {
|
|
719
|
+
var targetMetadata = metadata2.get(O);
|
|
720
|
+
if (!IsUndefined(targetMetadata)) {
|
|
721
|
+
targetMetadata.delete(P);
|
|
722
|
+
if (targetMetadata.size === 0) {
|
|
723
|
+
metadata2.delete(targetMetadata);
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
}
|
|
727
|
+
return true;
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
function CreateFallbackProvider(reflect) {
|
|
731
|
+
var { defineMetadata: defineMetadata2, hasOwnMetadata: hasOwnMetadata2, getOwnMetadata: getOwnMetadata2, getOwnMetadataKeys: getOwnMetadataKeys2, deleteMetadata: deleteMetadata2 } = reflect;
|
|
732
|
+
var metadataOwner = new _WeakMap;
|
|
733
|
+
var provider = {
|
|
734
|
+
isProviderFor: function(O, P) {
|
|
735
|
+
var metadataPropertySet = metadataOwner.get(O);
|
|
736
|
+
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
|
|
737
|
+
return true;
|
|
738
|
+
}
|
|
739
|
+
if (getOwnMetadataKeys2(O, P).length) {
|
|
740
|
+
if (IsUndefined(metadataPropertySet)) {
|
|
741
|
+
metadataPropertySet = new _Set;
|
|
742
|
+
metadataOwner.set(O, metadataPropertySet);
|
|
743
|
+
}
|
|
744
|
+
metadataPropertySet.add(P);
|
|
745
|
+
return true;
|
|
746
|
+
}
|
|
747
|
+
return false;
|
|
748
|
+
},
|
|
749
|
+
OrdinaryDefineOwnMetadata: defineMetadata2,
|
|
750
|
+
OrdinaryHasOwnMetadata: hasOwnMetadata2,
|
|
751
|
+
OrdinaryGetOwnMetadata: getOwnMetadata2,
|
|
752
|
+
OrdinaryOwnMetadataKeys: getOwnMetadataKeys2,
|
|
753
|
+
OrdinaryDeleteMetadata: deleteMetadata2
|
|
754
|
+
};
|
|
755
|
+
return provider;
|
|
756
|
+
}
|
|
757
|
+
function GetMetadataProvider(O, P, Create) {
|
|
758
|
+
var registeredProvider = metadataRegistry.getProvider(O, P);
|
|
759
|
+
if (!IsUndefined(registeredProvider)) {
|
|
760
|
+
return registeredProvider;
|
|
761
|
+
}
|
|
762
|
+
if (Create) {
|
|
763
|
+
if (metadataRegistry.setProvider(O, P, metadataProvider)) {
|
|
764
|
+
return metadataProvider;
|
|
765
|
+
}
|
|
766
|
+
throw new Error("Illegal state.");
|
|
767
|
+
}
|
|
768
|
+
return;
|
|
769
|
+
}
|
|
770
|
+
function CreateMapPolyfill() {
|
|
771
|
+
var cacheSentinel = {};
|
|
772
|
+
var arraySentinel = [];
|
|
773
|
+
var MapIterator = function() {
|
|
774
|
+
function MapIterator2(keys, values, selector) {
|
|
775
|
+
this._index = 0;
|
|
776
|
+
this._keys = keys;
|
|
777
|
+
this._values = values;
|
|
778
|
+
this._selector = selector;
|
|
779
|
+
}
|
|
780
|
+
MapIterator2.prototype["@@iterator"] = function() {
|
|
781
|
+
return this;
|
|
782
|
+
};
|
|
783
|
+
MapIterator2.prototype[iteratorSymbol] = function() {
|
|
784
|
+
return this;
|
|
785
|
+
};
|
|
786
|
+
MapIterator2.prototype.next = function() {
|
|
787
|
+
var index = this._index;
|
|
788
|
+
if (index >= 0 && index < this._keys.length) {
|
|
789
|
+
var result = this._selector(this._keys[index], this._values[index]);
|
|
790
|
+
if (index + 1 >= this._keys.length) {
|
|
791
|
+
this._index = -1;
|
|
792
|
+
this._keys = arraySentinel;
|
|
793
|
+
this._values = arraySentinel;
|
|
794
|
+
} else {
|
|
795
|
+
this._index++;
|
|
796
|
+
}
|
|
797
|
+
return { value: result, done: false };
|
|
798
|
+
}
|
|
799
|
+
return { value: undefined, done: true };
|
|
800
|
+
};
|
|
801
|
+
MapIterator2.prototype.throw = function(error) {
|
|
802
|
+
if (this._index >= 0) {
|
|
803
|
+
this._index = -1;
|
|
804
|
+
this._keys = arraySentinel;
|
|
805
|
+
this._values = arraySentinel;
|
|
806
|
+
}
|
|
807
|
+
throw error;
|
|
808
|
+
};
|
|
809
|
+
MapIterator2.prototype.return = function(value) {
|
|
810
|
+
if (this._index >= 0) {
|
|
811
|
+
this._index = -1;
|
|
812
|
+
this._keys = arraySentinel;
|
|
813
|
+
this._values = arraySentinel;
|
|
814
|
+
}
|
|
815
|
+
return { value, done: true };
|
|
816
|
+
};
|
|
817
|
+
return MapIterator2;
|
|
818
|
+
}();
|
|
819
|
+
var Map2 = function() {
|
|
820
|
+
function Map3() {
|
|
821
|
+
this._keys = [];
|
|
822
|
+
this._values = [];
|
|
823
|
+
this._cacheKey = cacheSentinel;
|
|
824
|
+
this._cacheIndex = -2;
|
|
825
|
+
}
|
|
826
|
+
Object.defineProperty(Map3.prototype, "size", {
|
|
827
|
+
get: function() {
|
|
828
|
+
return this._keys.length;
|
|
829
|
+
},
|
|
830
|
+
enumerable: true,
|
|
831
|
+
configurable: true
|
|
832
|
+
});
|
|
833
|
+
Map3.prototype.has = function(key) {
|
|
834
|
+
return this._find(key, false) >= 0;
|
|
835
|
+
};
|
|
836
|
+
Map3.prototype.get = function(key) {
|
|
837
|
+
var index = this._find(key, false);
|
|
838
|
+
return index >= 0 ? this._values[index] : undefined;
|
|
839
|
+
};
|
|
840
|
+
Map3.prototype.set = function(key, value) {
|
|
841
|
+
var index = this._find(key, true);
|
|
842
|
+
this._values[index] = value;
|
|
843
|
+
return this;
|
|
844
|
+
};
|
|
845
|
+
Map3.prototype.delete = function(key) {
|
|
846
|
+
var index = this._find(key, false);
|
|
847
|
+
if (index >= 0) {
|
|
848
|
+
var size = this._keys.length;
|
|
849
|
+
for (var i = index + 1;i < size; i++) {
|
|
850
|
+
this._keys[i - 1] = this._keys[i];
|
|
851
|
+
this._values[i - 1] = this._values[i];
|
|
852
|
+
}
|
|
853
|
+
this._keys.length--;
|
|
854
|
+
this._values.length--;
|
|
855
|
+
if (SameValueZero(key, this._cacheKey)) {
|
|
856
|
+
this._cacheKey = cacheSentinel;
|
|
857
|
+
this._cacheIndex = -2;
|
|
858
|
+
}
|
|
859
|
+
return true;
|
|
860
|
+
}
|
|
861
|
+
return false;
|
|
862
|
+
};
|
|
863
|
+
Map3.prototype.clear = function() {
|
|
864
|
+
this._keys.length = 0;
|
|
865
|
+
this._values.length = 0;
|
|
866
|
+
this._cacheKey = cacheSentinel;
|
|
867
|
+
this._cacheIndex = -2;
|
|
868
|
+
};
|
|
869
|
+
Map3.prototype.keys = function() {
|
|
870
|
+
return new MapIterator(this._keys, this._values, getKey);
|
|
871
|
+
};
|
|
872
|
+
Map3.prototype.values = function() {
|
|
873
|
+
return new MapIterator(this._keys, this._values, getValue);
|
|
874
|
+
};
|
|
875
|
+
Map3.prototype.entries = function() {
|
|
876
|
+
return new MapIterator(this._keys, this._values, getEntry);
|
|
877
|
+
};
|
|
878
|
+
Map3.prototype["@@iterator"] = function() {
|
|
879
|
+
return this.entries();
|
|
880
|
+
};
|
|
881
|
+
Map3.prototype[iteratorSymbol] = function() {
|
|
882
|
+
return this.entries();
|
|
883
|
+
};
|
|
884
|
+
Map3.prototype._find = function(key, insert) {
|
|
885
|
+
if (!SameValueZero(this._cacheKey, key)) {
|
|
886
|
+
this._cacheIndex = -1;
|
|
887
|
+
for (var i = 0;i < this._keys.length; i++) {
|
|
888
|
+
if (SameValueZero(this._keys[i], key)) {
|
|
889
|
+
this._cacheIndex = i;
|
|
890
|
+
break;
|
|
891
|
+
}
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
if (this._cacheIndex < 0 && insert) {
|
|
895
|
+
this._cacheIndex = this._keys.length;
|
|
896
|
+
this._keys.push(key);
|
|
897
|
+
this._values.push(undefined);
|
|
898
|
+
}
|
|
899
|
+
return this._cacheIndex;
|
|
900
|
+
};
|
|
901
|
+
return Map3;
|
|
902
|
+
}();
|
|
903
|
+
return Map2;
|
|
904
|
+
function getKey(key, _) {
|
|
905
|
+
return key;
|
|
906
|
+
}
|
|
907
|
+
function getValue(_, value) {
|
|
908
|
+
return value;
|
|
909
|
+
}
|
|
910
|
+
function getEntry(key, value) {
|
|
911
|
+
return [key, value];
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
function CreateSetPolyfill() {
|
|
915
|
+
var Set2 = function() {
|
|
916
|
+
function Set3() {
|
|
917
|
+
this._map = new _Map;
|
|
918
|
+
}
|
|
919
|
+
Object.defineProperty(Set3.prototype, "size", {
|
|
920
|
+
get: function() {
|
|
921
|
+
return this._map.size;
|
|
922
|
+
},
|
|
923
|
+
enumerable: true,
|
|
924
|
+
configurable: true
|
|
925
|
+
});
|
|
926
|
+
Set3.prototype.has = function(value) {
|
|
927
|
+
return this._map.has(value);
|
|
928
|
+
};
|
|
929
|
+
Set3.prototype.add = function(value) {
|
|
930
|
+
return this._map.set(value, value), this;
|
|
931
|
+
};
|
|
932
|
+
Set3.prototype.delete = function(value) {
|
|
933
|
+
return this._map.delete(value);
|
|
934
|
+
};
|
|
935
|
+
Set3.prototype.clear = function() {
|
|
936
|
+
this._map.clear();
|
|
937
|
+
};
|
|
938
|
+
Set3.prototype.keys = function() {
|
|
939
|
+
return this._map.keys();
|
|
940
|
+
};
|
|
941
|
+
Set3.prototype.values = function() {
|
|
942
|
+
return this._map.keys();
|
|
943
|
+
};
|
|
944
|
+
Set3.prototype.entries = function() {
|
|
945
|
+
return this._map.entries();
|
|
946
|
+
};
|
|
947
|
+
Set3.prototype["@@iterator"] = function() {
|
|
948
|
+
return this.keys();
|
|
949
|
+
};
|
|
950
|
+
Set3.prototype[iteratorSymbol] = function() {
|
|
951
|
+
return this.keys();
|
|
952
|
+
};
|
|
953
|
+
return Set3;
|
|
954
|
+
}();
|
|
955
|
+
return Set2;
|
|
956
|
+
}
|
|
957
|
+
function CreateWeakMapPolyfill() {
|
|
958
|
+
var UUID_SIZE = 16;
|
|
959
|
+
var keys = HashMap.create();
|
|
960
|
+
var rootKey = CreateUniqueKey();
|
|
961
|
+
return function() {
|
|
962
|
+
function WeakMap2() {
|
|
963
|
+
this._key = CreateUniqueKey();
|
|
964
|
+
}
|
|
965
|
+
WeakMap2.prototype.has = function(target) {
|
|
966
|
+
var table = GetOrCreateWeakMapTable(target, false);
|
|
967
|
+
return table !== undefined ? HashMap.has(table, this._key) : false;
|
|
968
|
+
};
|
|
969
|
+
WeakMap2.prototype.get = function(target) {
|
|
970
|
+
var table = GetOrCreateWeakMapTable(target, false);
|
|
971
|
+
return table !== undefined ? HashMap.get(table, this._key) : undefined;
|
|
972
|
+
};
|
|
973
|
+
WeakMap2.prototype.set = function(target, value) {
|
|
974
|
+
var table = GetOrCreateWeakMapTable(target, true);
|
|
975
|
+
table[this._key] = value;
|
|
976
|
+
return this;
|
|
977
|
+
};
|
|
978
|
+
WeakMap2.prototype.delete = function(target) {
|
|
979
|
+
var table = GetOrCreateWeakMapTable(target, false);
|
|
980
|
+
return table !== undefined ? delete table[this._key] : false;
|
|
981
|
+
};
|
|
982
|
+
WeakMap2.prototype.clear = function() {
|
|
983
|
+
this._key = CreateUniqueKey();
|
|
984
|
+
};
|
|
985
|
+
return WeakMap2;
|
|
986
|
+
}();
|
|
987
|
+
function CreateUniqueKey() {
|
|
988
|
+
var key;
|
|
989
|
+
do
|
|
990
|
+
key = "@@WeakMap@@" + CreateUUID();
|
|
991
|
+
while (HashMap.has(keys, key));
|
|
992
|
+
keys[key] = true;
|
|
993
|
+
return key;
|
|
994
|
+
}
|
|
995
|
+
function GetOrCreateWeakMapTable(target, create) {
|
|
996
|
+
if (!hasOwn.call(target, rootKey)) {
|
|
997
|
+
if (!create)
|
|
998
|
+
return;
|
|
999
|
+
Object.defineProperty(target, rootKey, { value: HashMap.create() });
|
|
1000
|
+
}
|
|
1001
|
+
return target[rootKey];
|
|
1002
|
+
}
|
|
1003
|
+
function FillRandomBytes(buffer, size) {
|
|
1004
|
+
for (var i = 0;i < size; ++i)
|
|
1005
|
+
buffer[i] = Math.random() * 255 | 0;
|
|
1006
|
+
return buffer;
|
|
1007
|
+
}
|
|
1008
|
+
function GenRandomBytes(size) {
|
|
1009
|
+
if (typeof Uint8Array === "function") {
|
|
1010
|
+
var array = new Uint8Array(size);
|
|
1011
|
+
if (typeof crypto !== "undefined") {
|
|
1012
|
+
crypto.getRandomValues(array);
|
|
1013
|
+
} else if (typeof msCrypto !== "undefined") {
|
|
1014
|
+
msCrypto.getRandomValues(array);
|
|
1015
|
+
} else {
|
|
1016
|
+
FillRandomBytes(array, size);
|
|
1017
|
+
}
|
|
1018
|
+
return array;
|
|
1019
|
+
}
|
|
1020
|
+
return FillRandomBytes(new Array(size), size);
|
|
1021
|
+
}
|
|
1022
|
+
function CreateUUID() {
|
|
1023
|
+
var data = GenRandomBytes(UUID_SIZE);
|
|
1024
|
+
data[6] = data[6] & 79 | 64;
|
|
1025
|
+
data[8] = data[8] & 191 | 128;
|
|
1026
|
+
var result = "";
|
|
1027
|
+
for (var offset = 0;offset < UUID_SIZE; ++offset) {
|
|
1028
|
+
var byte = data[offset];
|
|
1029
|
+
if (offset === 4 || offset === 6 || offset === 8)
|
|
1030
|
+
result += "-";
|
|
1031
|
+
if (byte < 16)
|
|
1032
|
+
result += "0";
|
|
1033
|
+
result += byte.toString(16).toLowerCase();
|
|
1034
|
+
}
|
|
1035
|
+
return result;
|
|
1036
|
+
}
|
|
1037
|
+
}
|
|
1038
|
+
function MakeDictionary(obj) {
|
|
1039
|
+
obj.__ = undefined;
|
|
1040
|
+
delete obj.__;
|
|
1041
|
+
return obj;
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
})(Reflect2 || (Reflect2 = {}));
|
|
1045
|
+
});
|
|
1046
|
+
|
|
51
1047
|
// node_modules/.bun/zod@4.4.3/node_modules/zod/v4/core/core.js
|
|
52
1048
|
function $constructor(name, initializer, params) {
|
|
53
1049
|
function init(inst, def) {
|
|
@@ -14708,6 +15704,7 @@ var init_descriptor = __esm(() => {
|
|
|
14708
15704
|
productCommandDescriptorSchema = exports_external.object({
|
|
14709
15705
|
productId: productIdSchema,
|
|
14710
15706
|
command: productCommandSchema,
|
|
15707
|
+
description: exports_external.string().trim().min(1).optional(),
|
|
14711
15708
|
packageName: productPackageNameSchema,
|
|
14712
15709
|
bin: productBinDescriptorSchema,
|
|
14713
15710
|
sourcePolicy: productSourcePolicySchema,
|
|
@@ -14882,7 +15879,11 @@ var DAEMON_RUNTIME_DESCRIPTOR_FILENAME = "daemon.runtime.json", isRecord = (valu
|
|
|
14882
15879
|
homeDir: value.homeDir,
|
|
14883
15880
|
updatedAt: value.updatedAt
|
|
14884
15881
|
};
|
|
14885
|
-
}, resolveDaemonRuntimeDescriptorPath = (homeDir) => join2(resolve6(homeDir), ".agenter", DAEMON_RUNTIME_DESCRIPTOR_FILENAME),
|
|
15882
|
+
}, resolveDaemonRuntimeDescriptorPath = (homeDir) => join2(resolve6(homeDir), ".agenter", DAEMON_RUNTIME_DESCRIPTOR_FILENAME), resolveDaemonLogDir = (homeDir) => join2(resolve6(homeDir), ".agenter", "logs", "daemon"), resolveDaemonLogPath = (homeDir, authority, startedAt = new Date) => {
|
|
15883
|
+
const safeHost = authority.host.replace(/[^a-zA-Z0-9_.-]/gu, "_");
|
|
15884
|
+
const safeStartedAt = startedAt.toISOString().replace(/[:.]/gu, "-");
|
|
15885
|
+
return join2(resolveDaemonLogDir(homeDir), `${safeStartedAt}-${safeHost}-${authority.port}.log`);
|
|
15886
|
+
}, readDaemonRuntimeDescriptor = (homeDir) => {
|
|
14886
15887
|
const filePath = resolveDaemonRuntimeDescriptorPath(homeDir);
|
|
14887
15888
|
try {
|
|
14888
15889
|
return normalizeDaemonRuntimeDescriptor(JSON.parse(readFileSync4(filePath, "utf8")));
|
|
@@ -119938,1002 +120939,6 @@ var init_getCertificateInfo = __esm(() => {
|
|
|
119938
120939
|
};
|
|
119939
120940
|
});
|
|
119940
120941
|
|
|
119941
|
-
// node_modules/.bun/reflect-metadata@0.2.2/node_modules/reflect-metadata/Reflect.js
|
|
119942
|
-
var require_Reflect = __commonJS(() => {
|
|
119943
|
-
/*! *****************************************************************************
|
|
119944
|
-
Copyright (C) Microsoft. All rights reserved.
|
|
119945
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
119946
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
119947
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
119948
|
-
|
|
119949
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
119950
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
119951
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
119952
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
119953
|
-
|
|
119954
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
119955
|
-
and limitations under the License.
|
|
119956
|
-
***************************************************************************** */
|
|
119957
|
-
var Reflect2;
|
|
119958
|
-
(function(Reflect3) {
|
|
119959
|
-
(function(factory) {
|
|
119960
|
-
var root = typeof globalThis === "object" ? globalThis : typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : sloppyModeThis();
|
|
119961
|
-
var exporter = makeExporter(Reflect3);
|
|
119962
|
-
if (typeof root.Reflect !== "undefined") {
|
|
119963
|
-
exporter = makeExporter(root.Reflect, exporter);
|
|
119964
|
-
}
|
|
119965
|
-
factory(exporter, root);
|
|
119966
|
-
if (typeof root.Reflect === "undefined") {
|
|
119967
|
-
root.Reflect = Reflect3;
|
|
119968
|
-
}
|
|
119969
|
-
function makeExporter(target, previous) {
|
|
119970
|
-
return function(key, value) {
|
|
119971
|
-
Object.defineProperty(target, key, { configurable: true, writable: true, value });
|
|
119972
|
-
if (previous)
|
|
119973
|
-
previous(key, value);
|
|
119974
|
-
};
|
|
119975
|
-
}
|
|
119976
|
-
function functionThis() {
|
|
119977
|
-
try {
|
|
119978
|
-
return Function("return this;")();
|
|
119979
|
-
} catch (_) {}
|
|
119980
|
-
}
|
|
119981
|
-
function indirectEvalThis() {
|
|
119982
|
-
try {
|
|
119983
|
-
return (undefined, eval)("(function() { return this; })()");
|
|
119984
|
-
} catch (_) {}
|
|
119985
|
-
}
|
|
119986
|
-
function sloppyModeThis() {
|
|
119987
|
-
return functionThis() || indirectEvalThis();
|
|
119988
|
-
}
|
|
119989
|
-
})(function(exporter, root) {
|
|
119990
|
-
var hasOwn4 = Object.prototype.hasOwnProperty;
|
|
119991
|
-
var supportsSymbol = typeof Symbol === "function";
|
|
119992
|
-
var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== "undefined" ? Symbol.toPrimitive : "@@toPrimitive";
|
|
119993
|
-
var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== "undefined" ? Symbol.iterator : "@@iterator";
|
|
119994
|
-
var supportsCreate = typeof Object.create === "function";
|
|
119995
|
-
var supportsProto = { __proto__: [] } instanceof Array;
|
|
119996
|
-
var downLevel = !supportsCreate && !supportsProto;
|
|
119997
|
-
var HashMap = {
|
|
119998
|
-
create: supportsCreate ? function() {
|
|
119999
|
-
return MakeDictionary(Object.create(null));
|
|
120000
|
-
} : supportsProto ? function() {
|
|
120001
|
-
return MakeDictionary({ __proto__: null });
|
|
120002
|
-
} : function() {
|
|
120003
|
-
return MakeDictionary({});
|
|
120004
|
-
},
|
|
120005
|
-
has: downLevel ? function(map2, key) {
|
|
120006
|
-
return hasOwn4.call(map2, key);
|
|
120007
|
-
} : function(map2, key) {
|
|
120008
|
-
return key in map2;
|
|
120009
|
-
},
|
|
120010
|
-
get: downLevel ? function(map2, key) {
|
|
120011
|
-
return hasOwn4.call(map2, key) ? map2[key] : undefined;
|
|
120012
|
-
} : function(map2, key) {
|
|
120013
|
-
return map2[key];
|
|
120014
|
-
}
|
|
120015
|
-
};
|
|
120016
|
-
var functionPrototype = Object.getPrototypeOf(Function);
|
|
120017
|
-
var _Map = typeof Map === "function" && typeof Map.prototype.entries === "function" ? Map : CreateMapPolyfill();
|
|
120018
|
-
var _Set = typeof Set === "function" && typeof Set.prototype.entries === "function" ? Set : CreateSetPolyfill();
|
|
120019
|
-
var _WeakMap = typeof WeakMap === "function" ? WeakMap : CreateWeakMapPolyfill();
|
|
120020
|
-
var registrySymbol = supportsSymbol ? Symbol.for("@reflect-metadata:registry") : undefined;
|
|
120021
|
-
var metadataRegistry = GetOrCreateMetadataRegistry();
|
|
120022
|
-
var metadataProvider = CreateMetadataProvider(metadataRegistry);
|
|
120023
|
-
function decorate(decorators, target, propertyKey, attributes) {
|
|
120024
|
-
if (!IsUndefined(propertyKey)) {
|
|
120025
|
-
if (!IsArray(decorators))
|
|
120026
|
-
throw new TypeError;
|
|
120027
|
-
if (!IsObject(target))
|
|
120028
|
-
throw new TypeError;
|
|
120029
|
-
if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))
|
|
120030
|
-
throw new TypeError;
|
|
120031
|
-
if (IsNull(attributes))
|
|
120032
|
-
attributes = undefined;
|
|
120033
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120034
|
-
return DecorateProperty(decorators, target, propertyKey, attributes);
|
|
120035
|
-
} else {
|
|
120036
|
-
if (!IsArray(decorators))
|
|
120037
|
-
throw new TypeError;
|
|
120038
|
-
if (!IsConstructor(target))
|
|
120039
|
-
throw new TypeError;
|
|
120040
|
-
return DecorateConstructor(decorators, target);
|
|
120041
|
-
}
|
|
120042
|
-
}
|
|
120043
|
-
exporter("decorate", decorate);
|
|
120044
|
-
function metadata(metadataKey, metadataValue) {
|
|
120045
|
-
function decorator(target, propertyKey) {
|
|
120046
|
-
if (!IsObject(target))
|
|
120047
|
-
throw new TypeError;
|
|
120048
|
-
if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))
|
|
120049
|
-
throw new TypeError;
|
|
120050
|
-
OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
120051
|
-
}
|
|
120052
|
-
return decorator;
|
|
120053
|
-
}
|
|
120054
|
-
exporter("metadata", metadata);
|
|
120055
|
-
function defineMetadata(metadataKey, metadataValue, target, propertyKey) {
|
|
120056
|
-
if (!IsObject(target))
|
|
120057
|
-
throw new TypeError;
|
|
120058
|
-
if (!IsUndefined(propertyKey))
|
|
120059
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120060
|
-
return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);
|
|
120061
|
-
}
|
|
120062
|
-
exporter("defineMetadata", defineMetadata);
|
|
120063
|
-
function hasMetadata(metadataKey, target, propertyKey) {
|
|
120064
|
-
if (!IsObject(target))
|
|
120065
|
-
throw new TypeError;
|
|
120066
|
-
if (!IsUndefined(propertyKey))
|
|
120067
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120068
|
-
return OrdinaryHasMetadata(metadataKey, target, propertyKey);
|
|
120069
|
-
}
|
|
120070
|
-
exporter("hasMetadata", hasMetadata);
|
|
120071
|
-
function hasOwnMetadata(metadataKey, target, propertyKey) {
|
|
120072
|
-
if (!IsObject(target))
|
|
120073
|
-
throw new TypeError;
|
|
120074
|
-
if (!IsUndefined(propertyKey))
|
|
120075
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120076
|
-
return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);
|
|
120077
|
-
}
|
|
120078
|
-
exporter("hasOwnMetadata", hasOwnMetadata);
|
|
120079
|
-
function getMetadata(metadataKey, target, propertyKey) {
|
|
120080
|
-
if (!IsObject(target))
|
|
120081
|
-
throw new TypeError;
|
|
120082
|
-
if (!IsUndefined(propertyKey))
|
|
120083
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120084
|
-
return OrdinaryGetMetadata(metadataKey, target, propertyKey);
|
|
120085
|
-
}
|
|
120086
|
-
exporter("getMetadata", getMetadata);
|
|
120087
|
-
function getOwnMetadata(metadataKey, target, propertyKey) {
|
|
120088
|
-
if (!IsObject(target))
|
|
120089
|
-
throw new TypeError;
|
|
120090
|
-
if (!IsUndefined(propertyKey))
|
|
120091
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120092
|
-
return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);
|
|
120093
|
-
}
|
|
120094
|
-
exporter("getOwnMetadata", getOwnMetadata);
|
|
120095
|
-
function getMetadataKeys(target, propertyKey) {
|
|
120096
|
-
if (!IsObject(target))
|
|
120097
|
-
throw new TypeError;
|
|
120098
|
-
if (!IsUndefined(propertyKey))
|
|
120099
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120100
|
-
return OrdinaryMetadataKeys(target, propertyKey);
|
|
120101
|
-
}
|
|
120102
|
-
exporter("getMetadataKeys", getMetadataKeys);
|
|
120103
|
-
function getOwnMetadataKeys(target, propertyKey) {
|
|
120104
|
-
if (!IsObject(target))
|
|
120105
|
-
throw new TypeError;
|
|
120106
|
-
if (!IsUndefined(propertyKey))
|
|
120107
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120108
|
-
return OrdinaryOwnMetadataKeys(target, propertyKey);
|
|
120109
|
-
}
|
|
120110
|
-
exporter("getOwnMetadataKeys", getOwnMetadataKeys);
|
|
120111
|
-
function deleteMetadata(metadataKey, target, propertyKey) {
|
|
120112
|
-
if (!IsObject(target))
|
|
120113
|
-
throw new TypeError;
|
|
120114
|
-
if (!IsUndefined(propertyKey))
|
|
120115
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120116
|
-
if (!IsObject(target))
|
|
120117
|
-
throw new TypeError;
|
|
120118
|
-
if (!IsUndefined(propertyKey))
|
|
120119
|
-
propertyKey = ToPropertyKey(propertyKey);
|
|
120120
|
-
var provider = GetMetadataProvider(target, propertyKey, false);
|
|
120121
|
-
if (IsUndefined(provider))
|
|
120122
|
-
return false;
|
|
120123
|
-
return provider.OrdinaryDeleteMetadata(metadataKey, target, propertyKey);
|
|
120124
|
-
}
|
|
120125
|
-
exporter("deleteMetadata", deleteMetadata);
|
|
120126
|
-
function DecorateConstructor(decorators, target) {
|
|
120127
|
-
for (var i = decorators.length - 1;i >= 0; --i) {
|
|
120128
|
-
var decorator = decorators[i];
|
|
120129
|
-
var decorated = decorator(target);
|
|
120130
|
-
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
120131
|
-
if (!IsConstructor(decorated))
|
|
120132
|
-
throw new TypeError;
|
|
120133
|
-
target = decorated;
|
|
120134
|
-
}
|
|
120135
|
-
}
|
|
120136
|
-
return target;
|
|
120137
|
-
}
|
|
120138
|
-
function DecorateProperty(decorators, target, propertyKey, descriptor) {
|
|
120139
|
-
for (var i = decorators.length - 1;i >= 0; --i) {
|
|
120140
|
-
var decorator = decorators[i];
|
|
120141
|
-
var decorated = decorator(target, propertyKey, descriptor);
|
|
120142
|
-
if (!IsUndefined(decorated) && !IsNull(decorated)) {
|
|
120143
|
-
if (!IsObject(decorated))
|
|
120144
|
-
throw new TypeError;
|
|
120145
|
-
descriptor = decorated;
|
|
120146
|
-
}
|
|
120147
|
-
}
|
|
120148
|
-
return descriptor;
|
|
120149
|
-
}
|
|
120150
|
-
function OrdinaryHasMetadata(MetadataKey, O, P) {
|
|
120151
|
-
var hasOwn5 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
120152
|
-
if (hasOwn5)
|
|
120153
|
-
return true;
|
|
120154
|
-
var parent = OrdinaryGetPrototypeOf(O);
|
|
120155
|
-
if (!IsNull(parent))
|
|
120156
|
-
return OrdinaryHasMetadata(MetadataKey, parent, P);
|
|
120157
|
-
return false;
|
|
120158
|
-
}
|
|
120159
|
-
function OrdinaryHasOwnMetadata(MetadataKey, O, P) {
|
|
120160
|
-
var provider = GetMetadataProvider(O, P, false);
|
|
120161
|
-
if (IsUndefined(provider))
|
|
120162
|
-
return false;
|
|
120163
|
-
return ToBoolean(provider.OrdinaryHasOwnMetadata(MetadataKey, O, P));
|
|
120164
|
-
}
|
|
120165
|
-
function OrdinaryGetMetadata(MetadataKey, O, P) {
|
|
120166
|
-
var hasOwn5 = OrdinaryHasOwnMetadata(MetadataKey, O, P);
|
|
120167
|
-
if (hasOwn5)
|
|
120168
|
-
return OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
120169
|
-
var parent = OrdinaryGetPrototypeOf(O);
|
|
120170
|
-
if (!IsNull(parent))
|
|
120171
|
-
return OrdinaryGetMetadata(MetadataKey, parent, P);
|
|
120172
|
-
return;
|
|
120173
|
-
}
|
|
120174
|
-
function OrdinaryGetOwnMetadata(MetadataKey, O, P) {
|
|
120175
|
-
var provider = GetMetadataProvider(O, P, false);
|
|
120176
|
-
if (IsUndefined(provider))
|
|
120177
|
-
return;
|
|
120178
|
-
return provider.OrdinaryGetOwnMetadata(MetadataKey, O, P);
|
|
120179
|
-
}
|
|
120180
|
-
function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {
|
|
120181
|
-
var provider = GetMetadataProvider(O, P, true);
|
|
120182
|
-
provider.OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P);
|
|
120183
|
-
}
|
|
120184
|
-
function OrdinaryMetadataKeys(O, P) {
|
|
120185
|
-
var ownKeys = OrdinaryOwnMetadataKeys(O, P);
|
|
120186
|
-
var parent = OrdinaryGetPrototypeOf(O);
|
|
120187
|
-
if (parent === null)
|
|
120188
|
-
return ownKeys;
|
|
120189
|
-
var parentKeys = OrdinaryMetadataKeys(parent, P);
|
|
120190
|
-
if (parentKeys.length <= 0)
|
|
120191
|
-
return ownKeys;
|
|
120192
|
-
if (ownKeys.length <= 0)
|
|
120193
|
-
return parentKeys;
|
|
120194
|
-
var set2 = new _Set;
|
|
120195
|
-
var keys = [];
|
|
120196
|
-
for (var _i = 0, ownKeys_1 = ownKeys;_i < ownKeys_1.length; _i++) {
|
|
120197
|
-
var key = ownKeys_1[_i];
|
|
120198
|
-
var hasKey = set2.has(key);
|
|
120199
|
-
if (!hasKey) {
|
|
120200
|
-
set2.add(key);
|
|
120201
|
-
keys.push(key);
|
|
120202
|
-
}
|
|
120203
|
-
}
|
|
120204
|
-
for (var _a9 = 0, parentKeys_1 = parentKeys;_a9 < parentKeys_1.length; _a9++) {
|
|
120205
|
-
var key = parentKeys_1[_a9];
|
|
120206
|
-
var hasKey = set2.has(key);
|
|
120207
|
-
if (!hasKey) {
|
|
120208
|
-
set2.add(key);
|
|
120209
|
-
keys.push(key);
|
|
120210
|
-
}
|
|
120211
|
-
}
|
|
120212
|
-
return keys;
|
|
120213
|
-
}
|
|
120214
|
-
function OrdinaryOwnMetadataKeys(O, P) {
|
|
120215
|
-
var provider = GetMetadataProvider(O, P, false);
|
|
120216
|
-
if (!provider) {
|
|
120217
|
-
return [];
|
|
120218
|
-
}
|
|
120219
|
-
return provider.OrdinaryOwnMetadataKeys(O, P);
|
|
120220
|
-
}
|
|
120221
|
-
function Type2(x) {
|
|
120222
|
-
if (x === null)
|
|
120223
|
-
return 1;
|
|
120224
|
-
switch (typeof x) {
|
|
120225
|
-
case "undefined":
|
|
120226
|
-
return 0;
|
|
120227
|
-
case "boolean":
|
|
120228
|
-
return 2;
|
|
120229
|
-
case "string":
|
|
120230
|
-
return 3;
|
|
120231
|
-
case "symbol":
|
|
120232
|
-
return 4;
|
|
120233
|
-
case "number":
|
|
120234
|
-
return 5;
|
|
120235
|
-
case "object":
|
|
120236
|
-
return x === null ? 1 : 6;
|
|
120237
|
-
default:
|
|
120238
|
-
return 6;
|
|
120239
|
-
}
|
|
120240
|
-
}
|
|
120241
|
-
function IsUndefined(x) {
|
|
120242
|
-
return x === undefined;
|
|
120243
|
-
}
|
|
120244
|
-
function IsNull(x) {
|
|
120245
|
-
return x === null;
|
|
120246
|
-
}
|
|
120247
|
-
function IsSymbol(x) {
|
|
120248
|
-
return typeof x === "symbol";
|
|
120249
|
-
}
|
|
120250
|
-
function IsObject(x) {
|
|
120251
|
-
return typeof x === "object" ? x !== null : typeof x === "function";
|
|
120252
|
-
}
|
|
120253
|
-
function ToPrimitive(input, PreferredType) {
|
|
120254
|
-
switch (Type2(input)) {
|
|
120255
|
-
case 0:
|
|
120256
|
-
return input;
|
|
120257
|
-
case 1:
|
|
120258
|
-
return input;
|
|
120259
|
-
case 2:
|
|
120260
|
-
return input;
|
|
120261
|
-
case 3:
|
|
120262
|
-
return input;
|
|
120263
|
-
case 4:
|
|
120264
|
-
return input;
|
|
120265
|
-
case 5:
|
|
120266
|
-
return input;
|
|
120267
|
-
}
|
|
120268
|
-
var hint = PreferredType === 3 ? "string" : PreferredType === 5 ? "number" : "default";
|
|
120269
|
-
var exoticToPrim = GetMethod(input, toPrimitiveSymbol);
|
|
120270
|
-
if (exoticToPrim !== undefined) {
|
|
120271
|
-
var result = exoticToPrim.call(input, hint);
|
|
120272
|
-
if (IsObject(result))
|
|
120273
|
-
throw new TypeError;
|
|
120274
|
-
return result;
|
|
120275
|
-
}
|
|
120276
|
-
return OrdinaryToPrimitive(input, hint === "default" ? "number" : hint);
|
|
120277
|
-
}
|
|
120278
|
-
function OrdinaryToPrimitive(O, hint) {
|
|
120279
|
-
if (hint === "string") {
|
|
120280
|
-
var toString_1 = O.toString;
|
|
120281
|
-
if (IsCallable(toString_1)) {
|
|
120282
|
-
var result = toString_1.call(O);
|
|
120283
|
-
if (!IsObject(result))
|
|
120284
|
-
return result;
|
|
120285
|
-
}
|
|
120286
|
-
var valueOf = O.valueOf;
|
|
120287
|
-
if (IsCallable(valueOf)) {
|
|
120288
|
-
var result = valueOf.call(O);
|
|
120289
|
-
if (!IsObject(result))
|
|
120290
|
-
return result;
|
|
120291
|
-
}
|
|
120292
|
-
} else {
|
|
120293
|
-
var valueOf = O.valueOf;
|
|
120294
|
-
if (IsCallable(valueOf)) {
|
|
120295
|
-
var result = valueOf.call(O);
|
|
120296
|
-
if (!IsObject(result))
|
|
120297
|
-
return result;
|
|
120298
|
-
}
|
|
120299
|
-
var toString_2 = O.toString;
|
|
120300
|
-
if (IsCallable(toString_2)) {
|
|
120301
|
-
var result = toString_2.call(O);
|
|
120302
|
-
if (!IsObject(result))
|
|
120303
|
-
return result;
|
|
120304
|
-
}
|
|
120305
|
-
}
|
|
120306
|
-
throw new TypeError;
|
|
120307
|
-
}
|
|
120308
|
-
function ToBoolean(argument) {
|
|
120309
|
-
return !!argument;
|
|
120310
|
-
}
|
|
120311
|
-
function ToString(argument) {
|
|
120312
|
-
return "" + argument;
|
|
120313
|
-
}
|
|
120314
|
-
function ToPropertyKey(argument) {
|
|
120315
|
-
var key = ToPrimitive(argument, 3);
|
|
120316
|
-
if (IsSymbol(key))
|
|
120317
|
-
return key;
|
|
120318
|
-
return ToString(key);
|
|
120319
|
-
}
|
|
120320
|
-
function IsArray(argument) {
|
|
120321
|
-
return Array.isArray ? Array.isArray(argument) : argument instanceof Object ? argument instanceof Array : Object.prototype.toString.call(argument) === "[object Array]";
|
|
120322
|
-
}
|
|
120323
|
-
function IsCallable(argument) {
|
|
120324
|
-
return typeof argument === "function";
|
|
120325
|
-
}
|
|
120326
|
-
function IsConstructor(argument) {
|
|
120327
|
-
return typeof argument === "function";
|
|
120328
|
-
}
|
|
120329
|
-
function IsPropertyKey(argument) {
|
|
120330
|
-
switch (Type2(argument)) {
|
|
120331
|
-
case 3:
|
|
120332
|
-
return true;
|
|
120333
|
-
case 4:
|
|
120334
|
-
return true;
|
|
120335
|
-
default:
|
|
120336
|
-
return false;
|
|
120337
|
-
}
|
|
120338
|
-
}
|
|
120339
|
-
function SameValueZero(x, y) {
|
|
120340
|
-
return x === y || x !== x && y !== y;
|
|
120341
|
-
}
|
|
120342
|
-
function GetMethod(V, P) {
|
|
120343
|
-
var func = V[P];
|
|
120344
|
-
if (func === undefined || func === null)
|
|
120345
|
-
return;
|
|
120346
|
-
if (!IsCallable(func))
|
|
120347
|
-
throw new TypeError;
|
|
120348
|
-
return func;
|
|
120349
|
-
}
|
|
120350
|
-
function GetIterator(obj) {
|
|
120351
|
-
var method = GetMethod(obj, iteratorSymbol);
|
|
120352
|
-
if (!IsCallable(method))
|
|
120353
|
-
throw new TypeError;
|
|
120354
|
-
var iterator = method.call(obj);
|
|
120355
|
-
if (!IsObject(iterator))
|
|
120356
|
-
throw new TypeError;
|
|
120357
|
-
return iterator;
|
|
120358
|
-
}
|
|
120359
|
-
function IteratorValue(iterResult) {
|
|
120360
|
-
return iterResult.value;
|
|
120361
|
-
}
|
|
120362
|
-
function IteratorStep(iterator) {
|
|
120363
|
-
var result = iterator.next();
|
|
120364
|
-
return result.done ? false : result;
|
|
120365
|
-
}
|
|
120366
|
-
function IteratorClose(iterator) {
|
|
120367
|
-
var f = iterator["return"];
|
|
120368
|
-
if (f)
|
|
120369
|
-
f.call(iterator);
|
|
120370
|
-
}
|
|
120371
|
-
function OrdinaryGetPrototypeOf(O) {
|
|
120372
|
-
var proto = Object.getPrototypeOf(O);
|
|
120373
|
-
if (typeof O !== "function" || O === functionPrototype)
|
|
120374
|
-
return proto;
|
|
120375
|
-
if (proto !== functionPrototype)
|
|
120376
|
-
return proto;
|
|
120377
|
-
var prototype = O.prototype;
|
|
120378
|
-
var prototypeProto = prototype && Object.getPrototypeOf(prototype);
|
|
120379
|
-
if (prototypeProto == null || prototypeProto === Object.prototype)
|
|
120380
|
-
return proto;
|
|
120381
|
-
var constructor = prototypeProto.constructor;
|
|
120382
|
-
if (typeof constructor !== "function")
|
|
120383
|
-
return proto;
|
|
120384
|
-
if (constructor === O)
|
|
120385
|
-
return proto;
|
|
120386
|
-
return constructor;
|
|
120387
|
-
}
|
|
120388
|
-
function CreateMetadataRegistry() {
|
|
120389
|
-
var fallback2;
|
|
120390
|
-
if (!IsUndefined(registrySymbol) && typeof root.Reflect !== "undefined" && !(registrySymbol in root.Reflect) && typeof root.Reflect.defineMetadata === "function") {
|
|
120391
|
-
fallback2 = CreateFallbackProvider(root.Reflect);
|
|
120392
|
-
}
|
|
120393
|
-
var first;
|
|
120394
|
-
var second;
|
|
120395
|
-
var rest;
|
|
120396
|
-
var targetProviderMap = new _WeakMap;
|
|
120397
|
-
var registry2 = {
|
|
120398
|
-
registerProvider,
|
|
120399
|
-
getProvider,
|
|
120400
|
-
setProvider
|
|
120401
|
-
};
|
|
120402
|
-
return registry2;
|
|
120403
|
-
function registerProvider(provider) {
|
|
120404
|
-
if (!Object.isExtensible(registry2)) {
|
|
120405
|
-
throw new Error("Cannot add provider to a frozen registry.");
|
|
120406
|
-
}
|
|
120407
|
-
switch (true) {
|
|
120408
|
-
case fallback2 === provider:
|
|
120409
|
-
break;
|
|
120410
|
-
case IsUndefined(first):
|
|
120411
|
-
first = provider;
|
|
120412
|
-
break;
|
|
120413
|
-
case first === provider:
|
|
120414
|
-
break;
|
|
120415
|
-
case IsUndefined(second):
|
|
120416
|
-
second = provider;
|
|
120417
|
-
break;
|
|
120418
|
-
case second === provider:
|
|
120419
|
-
break;
|
|
120420
|
-
default:
|
|
120421
|
-
if (rest === undefined)
|
|
120422
|
-
rest = new _Set;
|
|
120423
|
-
rest.add(provider);
|
|
120424
|
-
break;
|
|
120425
|
-
}
|
|
120426
|
-
}
|
|
120427
|
-
function getProviderNoCache(O, P) {
|
|
120428
|
-
if (!IsUndefined(first)) {
|
|
120429
|
-
if (first.isProviderFor(O, P))
|
|
120430
|
-
return first;
|
|
120431
|
-
if (!IsUndefined(second)) {
|
|
120432
|
-
if (second.isProviderFor(O, P))
|
|
120433
|
-
return first;
|
|
120434
|
-
if (!IsUndefined(rest)) {
|
|
120435
|
-
var iterator = GetIterator(rest);
|
|
120436
|
-
while (true) {
|
|
120437
|
-
var next = IteratorStep(iterator);
|
|
120438
|
-
if (!next) {
|
|
120439
|
-
return;
|
|
120440
|
-
}
|
|
120441
|
-
var provider = IteratorValue(next);
|
|
120442
|
-
if (provider.isProviderFor(O, P)) {
|
|
120443
|
-
IteratorClose(iterator);
|
|
120444
|
-
return provider;
|
|
120445
|
-
}
|
|
120446
|
-
}
|
|
120447
|
-
}
|
|
120448
|
-
}
|
|
120449
|
-
}
|
|
120450
|
-
if (!IsUndefined(fallback2) && fallback2.isProviderFor(O, P)) {
|
|
120451
|
-
return fallback2;
|
|
120452
|
-
}
|
|
120453
|
-
return;
|
|
120454
|
-
}
|
|
120455
|
-
function getProvider(O, P) {
|
|
120456
|
-
var providerMap = targetProviderMap.get(O);
|
|
120457
|
-
var provider;
|
|
120458
|
-
if (!IsUndefined(providerMap)) {
|
|
120459
|
-
provider = providerMap.get(P);
|
|
120460
|
-
}
|
|
120461
|
-
if (!IsUndefined(provider)) {
|
|
120462
|
-
return provider;
|
|
120463
|
-
}
|
|
120464
|
-
provider = getProviderNoCache(O, P);
|
|
120465
|
-
if (!IsUndefined(provider)) {
|
|
120466
|
-
if (IsUndefined(providerMap)) {
|
|
120467
|
-
providerMap = new _Map;
|
|
120468
|
-
targetProviderMap.set(O, providerMap);
|
|
120469
|
-
}
|
|
120470
|
-
providerMap.set(P, provider);
|
|
120471
|
-
}
|
|
120472
|
-
return provider;
|
|
120473
|
-
}
|
|
120474
|
-
function hasProvider(provider) {
|
|
120475
|
-
if (IsUndefined(provider))
|
|
120476
|
-
throw new TypeError;
|
|
120477
|
-
return first === provider || second === provider || !IsUndefined(rest) && rest.has(provider);
|
|
120478
|
-
}
|
|
120479
|
-
function setProvider(O, P, provider) {
|
|
120480
|
-
if (!hasProvider(provider)) {
|
|
120481
|
-
throw new Error("Metadata provider not registered.");
|
|
120482
|
-
}
|
|
120483
|
-
var existingProvider = getProvider(O, P);
|
|
120484
|
-
if (existingProvider !== provider) {
|
|
120485
|
-
if (!IsUndefined(existingProvider)) {
|
|
120486
|
-
return false;
|
|
120487
|
-
}
|
|
120488
|
-
var providerMap = targetProviderMap.get(O);
|
|
120489
|
-
if (IsUndefined(providerMap)) {
|
|
120490
|
-
providerMap = new _Map;
|
|
120491
|
-
targetProviderMap.set(O, providerMap);
|
|
120492
|
-
}
|
|
120493
|
-
providerMap.set(P, provider);
|
|
120494
|
-
}
|
|
120495
|
-
return true;
|
|
120496
|
-
}
|
|
120497
|
-
}
|
|
120498
|
-
function GetOrCreateMetadataRegistry() {
|
|
120499
|
-
var metadataRegistry2;
|
|
120500
|
-
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
120501
|
-
metadataRegistry2 = root.Reflect[registrySymbol];
|
|
120502
|
-
}
|
|
120503
|
-
if (IsUndefined(metadataRegistry2)) {
|
|
120504
|
-
metadataRegistry2 = CreateMetadataRegistry();
|
|
120505
|
-
}
|
|
120506
|
-
if (!IsUndefined(registrySymbol) && IsObject(root.Reflect) && Object.isExtensible(root.Reflect)) {
|
|
120507
|
-
Object.defineProperty(root.Reflect, registrySymbol, {
|
|
120508
|
-
enumerable: false,
|
|
120509
|
-
configurable: false,
|
|
120510
|
-
writable: false,
|
|
120511
|
-
value: metadataRegistry2
|
|
120512
|
-
});
|
|
120513
|
-
}
|
|
120514
|
-
return metadataRegistry2;
|
|
120515
|
-
}
|
|
120516
|
-
function CreateMetadataProvider(registry2) {
|
|
120517
|
-
var metadata2 = new _WeakMap;
|
|
120518
|
-
var provider = {
|
|
120519
|
-
isProviderFor: function(O, P) {
|
|
120520
|
-
var targetMetadata = metadata2.get(O);
|
|
120521
|
-
if (IsUndefined(targetMetadata))
|
|
120522
|
-
return false;
|
|
120523
|
-
return targetMetadata.has(P);
|
|
120524
|
-
},
|
|
120525
|
-
OrdinaryDefineOwnMetadata: OrdinaryDefineOwnMetadata2,
|
|
120526
|
-
OrdinaryHasOwnMetadata: OrdinaryHasOwnMetadata2,
|
|
120527
|
-
OrdinaryGetOwnMetadata: OrdinaryGetOwnMetadata2,
|
|
120528
|
-
OrdinaryOwnMetadataKeys: OrdinaryOwnMetadataKeys2,
|
|
120529
|
-
OrdinaryDeleteMetadata
|
|
120530
|
-
};
|
|
120531
|
-
metadataRegistry.registerProvider(provider);
|
|
120532
|
-
return provider;
|
|
120533
|
-
function GetOrCreateMetadataMap(O, P, Create) {
|
|
120534
|
-
var targetMetadata = metadata2.get(O);
|
|
120535
|
-
var createdTargetMetadata = false;
|
|
120536
|
-
if (IsUndefined(targetMetadata)) {
|
|
120537
|
-
if (!Create)
|
|
120538
|
-
return;
|
|
120539
|
-
targetMetadata = new _Map;
|
|
120540
|
-
metadata2.set(O, targetMetadata);
|
|
120541
|
-
createdTargetMetadata = true;
|
|
120542
|
-
}
|
|
120543
|
-
var metadataMap = targetMetadata.get(P);
|
|
120544
|
-
if (IsUndefined(metadataMap)) {
|
|
120545
|
-
if (!Create)
|
|
120546
|
-
return;
|
|
120547
|
-
metadataMap = new _Map;
|
|
120548
|
-
targetMetadata.set(P, metadataMap);
|
|
120549
|
-
if (!registry2.setProvider(O, P, provider)) {
|
|
120550
|
-
targetMetadata.delete(P);
|
|
120551
|
-
if (createdTargetMetadata) {
|
|
120552
|
-
metadata2.delete(O);
|
|
120553
|
-
}
|
|
120554
|
-
throw new Error("Wrong provider for target.");
|
|
120555
|
-
}
|
|
120556
|
-
}
|
|
120557
|
-
return metadataMap;
|
|
120558
|
-
}
|
|
120559
|
-
function OrdinaryHasOwnMetadata2(MetadataKey, O, P) {
|
|
120560
|
-
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
120561
|
-
if (IsUndefined(metadataMap))
|
|
120562
|
-
return false;
|
|
120563
|
-
return ToBoolean(metadataMap.has(MetadataKey));
|
|
120564
|
-
}
|
|
120565
|
-
function OrdinaryGetOwnMetadata2(MetadataKey, O, P) {
|
|
120566
|
-
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
120567
|
-
if (IsUndefined(metadataMap))
|
|
120568
|
-
return;
|
|
120569
|
-
return metadataMap.get(MetadataKey);
|
|
120570
|
-
}
|
|
120571
|
-
function OrdinaryDefineOwnMetadata2(MetadataKey, MetadataValue, O, P) {
|
|
120572
|
-
var metadataMap = GetOrCreateMetadataMap(O, P, true);
|
|
120573
|
-
metadataMap.set(MetadataKey, MetadataValue);
|
|
120574
|
-
}
|
|
120575
|
-
function OrdinaryOwnMetadataKeys2(O, P) {
|
|
120576
|
-
var keys = [];
|
|
120577
|
-
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
120578
|
-
if (IsUndefined(metadataMap))
|
|
120579
|
-
return keys;
|
|
120580
|
-
var keysObj = metadataMap.keys();
|
|
120581
|
-
var iterator = GetIterator(keysObj);
|
|
120582
|
-
var k = 0;
|
|
120583
|
-
while (true) {
|
|
120584
|
-
var next = IteratorStep(iterator);
|
|
120585
|
-
if (!next) {
|
|
120586
|
-
keys.length = k;
|
|
120587
|
-
return keys;
|
|
120588
|
-
}
|
|
120589
|
-
var nextValue = IteratorValue(next);
|
|
120590
|
-
try {
|
|
120591
|
-
keys[k] = nextValue;
|
|
120592
|
-
} catch (e) {
|
|
120593
|
-
try {
|
|
120594
|
-
IteratorClose(iterator);
|
|
120595
|
-
} finally {
|
|
120596
|
-
throw e;
|
|
120597
|
-
}
|
|
120598
|
-
}
|
|
120599
|
-
k++;
|
|
120600
|
-
}
|
|
120601
|
-
}
|
|
120602
|
-
function OrdinaryDeleteMetadata(MetadataKey, O, P) {
|
|
120603
|
-
var metadataMap = GetOrCreateMetadataMap(O, P, false);
|
|
120604
|
-
if (IsUndefined(metadataMap))
|
|
120605
|
-
return false;
|
|
120606
|
-
if (!metadataMap.delete(MetadataKey))
|
|
120607
|
-
return false;
|
|
120608
|
-
if (metadataMap.size === 0) {
|
|
120609
|
-
var targetMetadata = metadata2.get(O);
|
|
120610
|
-
if (!IsUndefined(targetMetadata)) {
|
|
120611
|
-
targetMetadata.delete(P);
|
|
120612
|
-
if (targetMetadata.size === 0) {
|
|
120613
|
-
metadata2.delete(targetMetadata);
|
|
120614
|
-
}
|
|
120615
|
-
}
|
|
120616
|
-
}
|
|
120617
|
-
return true;
|
|
120618
|
-
}
|
|
120619
|
-
}
|
|
120620
|
-
function CreateFallbackProvider(reflect) {
|
|
120621
|
-
var { defineMetadata: defineMetadata2, hasOwnMetadata: hasOwnMetadata2, getOwnMetadata: getOwnMetadata2, getOwnMetadataKeys: getOwnMetadataKeys2, deleteMetadata: deleteMetadata2 } = reflect;
|
|
120622
|
-
var metadataOwner = new _WeakMap;
|
|
120623
|
-
var provider = {
|
|
120624
|
-
isProviderFor: function(O, P) {
|
|
120625
|
-
var metadataPropertySet = metadataOwner.get(O);
|
|
120626
|
-
if (!IsUndefined(metadataPropertySet) && metadataPropertySet.has(P)) {
|
|
120627
|
-
return true;
|
|
120628
|
-
}
|
|
120629
|
-
if (getOwnMetadataKeys2(O, P).length) {
|
|
120630
|
-
if (IsUndefined(metadataPropertySet)) {
|
|
120631
|
-
metadataPropertySet = new _Set;
|
|
120632
|
-
metadataOwner.set(O, metadataPropertySet);
|
|
120633
|
-
}
|
|
120634
|
-
metadataPropertySet.add(P);
|
|
120635
|
-
return true;
|
|
120636
|
-
}
|
|
120637
|
-
return false;
|
|
120638
|
-
},
|
|
120639
|
-
OrdinaryDefineOwnMetadata: defineMetadata2,
|
|
120640
|
-
OrdinaryHasOwnMetadata: hasOwnMetadata2,
|
|
120641
|
-
OrdinaryGetOwnMetadata: getOwnMetadata2,
|
|
120642
|
-
OrdinaryOwnMetadataKeys: getOwnMetadataKeys2,
|
|
120643
|
-
OrdinaryDeleteMetadata: deleteMetadata2
|
|
120644
|
-
};
|
|
120645
|
-
return provider;
|
|
120646
|
-
}
|
|
120647
|
-
function GetMetadataProvider(O, P, Create) {
|
|
120648
|
-
var registeredProvider = metadataRegistry.getProvider(O, P);
|
|
120649
|
-
if (!IsUndefined(registeredProvider)) {
|
|
120650
|
-
return registeredProvider;
|
|
120651
|
-
}
|
|
120652
|
-
if (Create) {
|
|
120653
|
-
if (metadataRegistry.setProvider(O, P, metadataProvider)) {
|
|
120654
|
-
return metadataProvider;
|
|
120655
|
-
}
|
|
120656
|
-
throw new Error("Illegal state.");
|
|
120657
|
-
}
|
|
120658
|
-
return;
|
|
120659
|
-
}
|
|
120660
|
-
function CreateMapPolyfill() {
|
|
120661
|
-
var cacheSentinel = {};
|
|
120662
|
-
var arraySentinel = [];
|
|
120663
|
-
var MapIterator = function() {
|
|
120664
|
-
function MapIterator2(keys, values2, selector) {
|
|
120665
|
-
this._index = 0;
|
|
120666
|
-
this._keys = keys;
|
|
120667
|
-
this._values = values2;
|
|
120668
|
-
this._selector = selector;
|
|
120669
|
-
}
|
|
120670
|
-
MapIterator2.prototype["@@iterator"] = function() {
|
|
120671
|
-
return this;
|
|
120672
|
-
};
|
|
120673
|
-
MapIterator2.prototype[iteratorSymbol] = function() {
|
|
120674
|
-
return this;
|
|
120675
|
-
};
|
|
120676
|
-
MapIterator2.prototype.next = function() {
|
|
120677
|
-
var index2 = this._index;
|
|
120678
|
-
if (index2 >= 0 && index2 < this._keys.length) {
|
|
120679
|
-
var result = this._selector(this._keys[index2], this._values[index2]);
|
|
120680
|
-
if (index2 + 1 >= this._keys.length) {
|
|
120681
|
-
this._index = -1;
|
|
120682
|
-
this._keys = arraySentinel;
|
|
120683
|
-
this._values = arraySentinel;
|
|
120684
|
-
} else {
|
|
120685
|
-
this._index++;
|
|
120686
|
-
}
|
|
120687
|
-
return { value: result, done: false };
|
|
120688
|
-
}
|
|
120689
|
-
return { value: undefined, done: true };
|
|
120690
|
-
};
|
|
120691
|
-
MapIterator2.prototype.throw = function(error53) {
|
|
120692
|
-
if (this._index >= 0) {
|
|
120693
|
-
this._index = -1;
|
|
120694
|
-
this._keys = arraySentinel;
|
|
120695
|
-
this._values = arraySentinel;
|
|
120696
|
-
}
|
|
120697
|
-
throw error53;
|
|
120698
|
-
};
|
|
120699
|
-
MapIterator2.prototype.return = function(value) {
|
|
120700
|
-
if (this._index >= 0) {
|
|
120701
|
-
this._index = -1;
|
|
120702
|
-
this._keys = arraySentinel;
|
|
120703
|
-
this._values = arraySentinel;
|
|
120704
|
-
}
|
|
120705
|
-
return { value, done: true };
|
|
120706
|
-
};
|
|
120707
|
-
return MapIterator2;
|
|
120708
|
-
}();
|
|
120709
|
-
var Map2 = function() {
|
|
120710
|
-
function Map3() {
|
|
120711
|
-
this._keys = [];
|
|
120712
|
-
this._values = [];
|
|
120713
|
-
this._cacheKey = cacheSentinel;
|
|
120714
|
-
this._cacheIndex = -2;
|
|
120715
|
-
}
|
|
120716
|
-
Object.defineProperty(Map3.prototype, "size", {
|
|
120717
|
-
get: function() {
|
|
120718
|
-
return this._keys.length;
|
|
120719
|
-
},
|
|
120720
|
-
enumerable: true,
|
|
120721
|
-
configurable: true
|
|
120722
|
-
});
|
|
120723
|
-
Map3.prototype.has = function(key) {
|
|
120724
|
-
return this._find(key, false) >= 0;
|
|
120725
|
-
};
|
|
120726
|
-
Map3.prototype.get = function(key) {
|
|
120727
|
-
var index2 = this._find(key, false);
|
|
120728
|
-
return index2 >= 0 ? this._values[index2] : undefined;
|
|
120729
|
-
};
|
|
120730
|
-
Map3.prototype.set = function(key, value) {
|
|
120731
|
-
var index2 = this._find(key, true);
|
|
120732
|
-
this._values[index2] = value;
|
|
120733
|
-
return this;
|
|
120734
|
-
};
|
|
120735
|
-
Map3.prototype.delete = function(key) {
|
|
120736
|
-
var index2 = this._find(key, false);
|
|
120737
|
-
if (index2 >= 0) {
|
|
120738
|
-
var size3 = this._keys.length;
|
|
120739
|
-
for (var i = index2 + 1;i < size3; i++) {
|
|
120740
|
-
this._keys[i - 1] = this._keys[i];
|
|
120741
|
-
this._values[i - 1] = this._values[i];
|
|
120742
|
-
}
|
|
120743
|
-
this._keys.length--;
|
|
120744
|
-
this._values.length--;
|
|
120745
|
-
if (SameValueZero(key, this._cacheKey)) {
|
|
120746
|
-
this._cacheKey = cacheSentinel;
|
|
120747
|
-
this._cacheIndex = -2;
|
|
120748
|
-
}
|
|
120749
|
-
return true;
|
|
120750
|
-
}
|
|
120751
|
-
return false;
|
|
120752
|
-
};
|
|
120753
|
-
Map3.prototype.clear = function() {
|
|
120754
|
-
this._keys.length = 0;
|
|
120755
|
-
this._values.length = 0;
|
|
120756
|
-
this._cacheKey = cacheSentinel;
|
|
120757
|
-
this._cacheIndex = -2;
|
|
120758
|
-
};
|
|
120759
|
-
Map3.prototype.keys = function() {
|
|
120760
|
-
return new MapIterator(this._keys, this._values, getKey);
|
|
120761
|
-
};
|
|
120762
|
-
Map3.prototype.values = function() {
|
|
120763
|
-
return new MapIterator(this._keys, this._values, getValue);
|
|
120764
|
-
};
|
|
120765
|
-
Map3.prototype.entries = function() {
|
|
120766
|
-
return new MapIterator(this._keys, this._values, getEntry);
|
|
120767
|
-
};
|
|
120768
|
-
Map3.prototype["@@iterator"] = function() {
|
|
120769
|
-
return this.entries();
|
|
120770
|
-
};
|
|
120771
|
-
Map3.prototype[iteratorSymbol] = function() {
|
|
120772
|
-
return this.entries();
|
|
120773
|
-
};
|
|
120774
|
-
Map3.prototype._find = function(key, insert) {
|
|
120775
|
-
if (!SameValueZero(this._cacheKey, key)) {
|
|
120776
|
-
this._cacheIndex = -1;
|
|
120777
|
-
for (var i = 0;i < this._keys.length; i++) {
|
|
120778
|
-
if (SameValueZero(this._keys[i], key)) {
|
|
120779
|
-
this._cacheIndex = i;
|
|
120780
|
-
break;
|
|
120781
|
-
}
|
|
120782
|
-
}
|
|
120783
|
-
}
|
|
120784
|
-
if (this._cacheIndex < 0 && insert) {
|
|
120785
|
-
this._cacheIndex = this._keys.length;
|
|
120786
|
-
this._keys.push(key);
|
|
120787
|
-
this._values.push(undefined);
|
|
120788
|
-
}
|
|
120789
|
-
return this._cacheIndex;
|
|
120790
|
-
};
|
|
120791
|
-
return Map3;
|
|
120792
|
-
}();
|
|
120793
|
-
return Map2;
|
|
120794
|
-
function getKey(key, _) {
|
|
120795
|
-
return key;
|
|
120796
|
-
}
|
|
120797
|
-
function getValue(_, value) {
|
|
120798
|
-
return value;
|
|
120799
|
-
}
|
|
120800
|
-
function getEntry(key, value) {
|
|
120801
|
-
return [key, value];
|
|
120802
|
-
}
|
|
120803
|
-
}
|
|
120804
|
-
function CreateSetPolyfill() {
|
|
120805
|
-
var Set3 = function() {
|
|
120806
|
-
function Set4() {
|
|
120807
|
-
this._map = new _Map;
|
|
120808
|
-
}
|
|
120809
|
-
Object.defineProperty(Set4.prototype, "size", {
|
|
120810
|
-
get: function() {
|
|
120811
|
-
return this._map.size;
|
|
120812
|
-
},
|
|
120813
|
-
enumerable: true,
|
|
120814
|
-
configurable: true
|
|
120815
|
-
});
|
|
120816
|
-
Set4.prototype.has = function(value) {
|
|
120817
|
-
return this._map.has(value);
|
|
120818
|
-
};
|
|
120819
|
-
Set4.prototype.add = function(value) {
|
|
120820
|
-
return this._map.set(value, value), this;
|
|
120821
|
-
};
|
|
120822
|
-
Set4.prototype.delete = function(value) {
|
|
120823
|
-
return this._map.delete(value);
|
|
120824
|
-
};
|
|
120825
|
-
Set4.prototype.clear = function() {
|
|
120826
|
-
this._map.clear();
|
|
120827
|
-
};
|
|
120828
|
-
Set4.prototype.keys = function() {
|
|
120829
|
-
return this._map.keys();
|
|
120830
|
-
};
|
|
120831
|
-
Set4.prototype.values = function() {
|
|
120832
|
-
return this._map.keys();
|
|
120833
|
-
};
|
|
120834
|
-
Set4.prototype.entries = function() {
|
|
120835
|
-
return this._map.entries();
|
|
120836
|
-
};
|
|
120837
|
-
Set4.prototype["@@iterator"] = function() {
|
|
120838
|
-
return this.keys();
|
|
120839
|
-
};
|
|
120840
|
-
Set4.prototype[iteratorSymbol] = function() {
|
|
120841
|
-
return this.keys();
|
|
120842
|
-
};
|
|
120843
|
-
return Set4;
|
|
120844
|
-
}();
|
|
120845
|
-
return Set3;
|
|
120846
|
-
}
|
|
120847
|
-
function CreateWeakMapPolyfill() {
|
|
120848
|
-
var UUID_SIZE = 16;
|
|
120849
|
-
var keys = HashMap.create();
|
|
120850
|
-
var rootKey = CreateUniqueKey();
|
|
120851
|
-
return function() {
|
|
120852
|
-
function WeakMap2() {
|
|
120853
|
-
this._key = CreateUniqueKey();
|
|
120854
|
-
}
|
|
120855
|
-
WeakMap2.prototype.has = function(target) {
|
|
120856
|
-
var table = GetOrCreateWeakMapTable(target, false);
|
|
120857
|
-
return table !== undefined ? HashMap.has(table, this._key) : false;
|
|
120858
|
-
};
|
|
120859
|
-
WeakMap2.prototype.get = function(target) {
|
|
120860
|
-
var table = GetOrCreateWeakMapTable(target, false);
|
|
120861
|
-
return table !== undefined ? HashMap.get(table, this._key) : undefined;
|
|
120862
|
-
};
|
|
120863
|
-
WeakMap2.prototype.set = function(target, value) {
|
|
120864
|
-
var table = GetOrCreateWeakMapTable(target, true);
|
|
120865
|
-
table[this._key] = value;
|
|
120866
|
-
return this;
|
|
120867
|
-
};
|
|
120868
|
-
WeakMap2.prototype.delete = function(target) {
|
|
120869
|
-
var table = GetOrCreateWeakMapTable(target, false);
|
|
120870
|
-
return table !== undefined ? delete table[this._key] : false;
|
|
120871
|
-
};
|
|
120872
|
-
WeakMap2.prototype.clear = function() {
|
|
120873
|
-
this._key = CreateUniqueKey();
|
|
120874
|
-
};
|
|
120875
|
-
return WeakMap2;
|
|
120876
|
-
}();
|
|
120877
|
-
function CreateUniqueKey() {
|
|
120878
|
-
var key;
|
|
120879
|
-
do
|
|
120880
|
-
key = "@@WeakMap@@" + CreateUUID();
|
|
120881
|
-
while (HashMap.has(keys, key));
|
|
120882
|
-
keys[key] = true;
|
|
120883
|
-
return key;
|
|
120884
|
-
}
|
|
120885
|
-
function GetOrCreateWeakMapTable(target, create) {
|
|
120886
|
-
if (!hasOwn4.call(target, rootKey)) {
|
|
120887
|
-
if (!create)
|
|
120888
|
-
return;
|
|
120889
|
-
Object.defineProperty(target, rootKey, { value: HashMap.create() });
|
|
120890
|
-
}
|
|
120891
|
-
return target[rootKey];
|
|
120892
|
-
}
|
|
120893
|
-
function FillRandomBytes(buffer, size3) {
|
|
120894
|
-
for (var i = 0;i < size3; ++i)
|
|
120895
|
-
buffer[i] = Math.random() * 255 | 0;
|
|
120896
|
-
return buffer;
|
|
120897
|
-
}
|
|
120898
|
-
function GenRandomBytes(size3) {
|
|
120899
|
-
if (typeof Uint8Array === "function") {
|
|
120900
|
-
var array2 = new Uint8Array(size3);
|
|
120901
|
-
if (typeof crypto !== "undefined") {
|
|
120902
|
-
crypto.getRandomValues(array2);
|
|
120903
|
-
} else if (typeof msCrypto !== "undefined") {
|
|
120904
|
-
msCrypto.getRandomValues(array2);
|
|
120905
|
-
} else {
|
|
120906
|
-
FillRandomBytes(array2, size3);
|
|
120907
|
-
}
|
|
120908
|
-
return array2;
|
|
120909
|
-
}
|
|
120910
|
-
return FillRandomBytes(new Array(size3), size3);
|
|
120911
|
-
}
|
|
120912
|
-
function CreateUUID() {
|
|
120913
|
-
var data = GenRandomBytes(UUID_SIZE);
|
|
120914
|
-
data[6] = data[6] & 79 | 64;
|
|
120915
|
-
data[8] = data[8] & 191 | 128;
|
|
120916
|
-
var result = "";
|
|
120917
|
-
for (var offset = 0;offset < UUID_SIZE; ++offset) {
|
|
120918
|
-
var byte = data[offset];
|
|
120919
|
-
if (offset === 4 || offset === 6 || offset === 8)
|
|
120920
|
-
result += "-";
|
|
120921
|
-
if (byte < 16)
|
|
120922
|
-
result += "0";
|
|
120923
|
-
result += byte.toString(16).toLowerCase();
|
|
120924
|
-
}
|
|
120925
|
-
return result;
|
|
120926
|
-
}
|
|
120927
|
-
}
|
|
120928
|
-
function MakeDictionary(obj) {
|
|
120929
|
-
obj.__ = undefined;
|
|
120930
|
-
delete obj.__;
|
|
120931
|
-
return obj;
|
|
120932
|
-
}
|
|
120933
|
-
});
|
|
120934
|
-
})(Reflect2 || (Reflect2 = {}));
|
|
120935
|
-
});
|
|
120936
|
-
|
|
120937
120942
|
// node_modules/.bun/@peculiar+asn1-cms@2.6.1/node_modules/@peculiar/asn1-cms/build/es2015/issuer_and_serial_number.js
|
|
120938
120943
|
class IssuerAndSerialNumber {
|
|
120939
120944
|
constructor(params = {}) {
|
|
@@ -343948,13 +343953,17 @@ var init_src25 = __esm(async () => {
|
|
|
343948
343953
|
await init_run_tui();
|
|
343949
343954
|
});
|
|
343950
343955
|
|
|
343956
|
+
// packages/agenter/src/bin/agenter.ts
|
|
343957
|
+
var import_reflect_metadata2 = __toESM(require_Reflect(), 1);
|
|
343958
|
+
|
|
343951
343959
|
// packages/cli/src/run-cli.ts
|
|
343952
343960
|
import { spawn as spawnChildProcess } from "child_process";
|
|
343953
|
-
import { existsSync as existsSync38 } from "fs";
|
|
343961
|
+
import { closeSync as closeSync3, existsSync as existsSync38, mkdirSync as mkdirSync38, openSync as openSync3, readFileSync as readFileSync30 } from "fs";
|
|
343962
|
+
import { createRequire as createRequire5 } from "module";
|
|
343954
343963
|
import { request as httpRequest2 } from "http";
|
|
343955
343964
|
import { request as httpsRequest } from "https";
|
|
343956
343965
|
import { homedir as homedir25 } from "os";
|
|
343957
|
-
import { join as join64, resolve as resolve57 } from "path";
|
|
343966
|
+
import { dirname as dirname44, join as join64, resolve as resolve57 } from "path";
|
|
343958
343967
|
import { pathToFileURL as pathToFileURL3 } from "url";
|
|
343959
343968
|
import { suffix as suffix4 } from "bun:ffi";
|
|
343960
343969
|
|
|
@@ -348821,6 +348830,7 @@ var productCommandDescriptors = [
|
|
|
348821
348830
|
productCommandDescriptorSchema.parse({
|
|
348822
348831
|
productId: "cli-shell",
|
|
348823
348832
|
command: "shell",
|
|
348833
|
+
description: "run cli-shell terminal workspace",
|
|
348824
348834
|
packageName: "agenter-ext-shell",
|
|
348825
348835
|
bin: {
|
|
348826
348836
|
name: "agenter-cli-shell",
|
|
@@ -348837,6 +348847,7 @@ var productCommandDescriptors = [
|
|
|
348837
348847
|
productCommandDescriptorSchema.parse({
|
|
348838
348848
|
productId: "studio",
|
|
348839
348849
|
command: "studio",
|
|
348850
|
+
description: "run Studio web UI",
|
|
348840
348851
|
packageName: "agenter-ext-studio",
|
|
348841
348852
|
bin: {
|
|
348842
348853
|
name: "agenter-studio",
|
|
@@ -348852,6 +348863,7 @@ var productCommandDescriptors = [
|
|
|
348852
348863
|
})
|
|
348853
348864
|
];
|
|
348854
348865
|
var descriptorByCommand = new Map(productCommandDescriptors.map((descriptor) => [descriptor.command, descriptor]));
|
|
348866
|
+
var listProductCommandDescriptors = () => productCommandDescriptors;
|
|
348855
348867
|
var resolveProductCommandDescriptor = (command2) => descriptorByCommand.get(command2) ?? null;
|
|
348856
348868
|
|
|
348857
348869
|
// packages/cli/src/product-command-launcher.ts
|
|
@@ -349052,6 +349064,13 @@ var buildProductLaunchEnv = (input) => {
|
|
|
349052
349064
|
};
|
|
349053
349065
|
var resolveProductPackageRunner = (env2 = process.env) => env2.AGENTER_PRODUCT_PACKAGE_RUNNER?.trim() || DEFAULT_PRODUCT_PACKAGE_RUNNER;
|
|
349054
349066
|
var isProductMetadataOnlyArgv = (productArgv) => productArgv.some((token) => metadataOnlyTokens.has(token));
|
|
349067
|
+
var applyProductCommandsToYargs = (builder) => {
|
|
349068
|
+
let next = builder;
|
|
349069
|
+
for (const descriptor of listProductCommandDescriptors()) {
|
|
349070
|
+
next = next.command(descriptor.command, descriptor.description ?? `run ${descriptor.productId}`, (commandBuilder) => commandBuilder, () => {});
|
|
349071
|
+
}
|
|
349072
|
+
return next;
|
|
349073
|
+
};
|
|
349055
349074
|
var buildProductProcessCommand = (target, descriptor, productArgv, env2 = process.env) => {
|
|
349056
349075
|
if (target.source !== "remote") {
|
|
349057
349076
|
return [BUN_BIN, "run", target.binPath, ...productArgv];
|
|
@@ -349070,6 +349089,7 @@ init_daemon_runtime_descriptor();
|
|
|
349070
349089
|
var INTERNAL_DAEMON_FOREGROUND_ENV = "AGENTER_INTERNAL_DAEMON_FOREGROUND";
|
|
349071
349090
|
var BUNDLED_ASSETS_ROOT_ENV3 = "AGENTER_BUNDLED_ASSETS_ROOT";
|
|
349072
349091
|
var MANAGED_DAEMON_START_TIMEOUT_MS = 15000;
|
|
349092
|
+
var packageJson = createRequire5(import.meta.url)("../package.json");
|
|
349073
349093
|
var waitForSignal = async (cleanup) => {
|
|
349074
349094
|
await new Promise((resolve58) => {
|
|
349075
349095
|
const onSignal = async () => {
|
|
@@ -349090,6 +349110,13 @@ var resolveLauncherHomeDir = () => process.env.HOME || homedir25();
|
|
|
349090
349110
|
var resolveLauncherOwnedAuthServiceDataDir = () => join64(resolveLauncherHomeDir(), ".agenter", "launcher-auth-service");
|
|
349091
349111
|
var resolveDaemonHealthLabel = (args) => `http://${args.host}:${args.port}/health`;
|
|
349092
349112
|
var resolveCliEntryPath = () => resolve57(import.meta.dir, "bin", "agenter.ts");
|
|
349113
|
+
var resolveCurrentCliEntrypointArgv = () => {
|
|
349114
|
+
const entrypoint = process.argv[1];
|
|
349115
|
+
if (entrypoint && existsSync38(entrypoint)) {
|
|
349116
|
+
return [entrypoint];
|
|
349117
|
+
}
|
|
349118
|
+
return ["run", resolveCliEntryPath()];
|
|
349119
|
+
};
|
|
349093
349120
|
var resolveBunExecutable = () => Bun.which("bun") ?? process.execPath;
|
|
349094
349121
|
var resolveBundledAssetsRoot2 = () => process.env[BUNDLED_ASSETS_ROOT_ENV3]?.trim() || null;
|
|
349095
349122
|
var resolveBundledAssetPath2 = (...segments) => {
|
|
@@ -349150,7 +349177,7 @@ var sameDaemonAuthority = (descriptor, requested) => descriptor.host === request
|
|
|
349150
349177
|
var resolveDaemonCommandAction = (value) => value === "stop" || value === "restart" ? value : "start";
|
|
349151
349178
|
var isForegroundDaemonServeRequested = () => process.env[INTERNAL_DAEMON_FOREGROUND_ENV] === "1";
|
|
349152
349179
|
var buildDaemonServeArgv = (args) => {
|
|
349153
|
-
const argv = [
|
|
349180
|
+
const argv = [...resolveCurrentCliEntrypointArgv(), "daemon", "start", "--host", args.host, "--port", String(args.port)];
|
|
349154
349181
|
if (args.authServiceEndpoint) {
|
|
349155
349182
|
argv.push("--auth-service-endpoint", args.authServiceEndpoint);
|
|
349156
349183
|
}
|
|
@@ -349165,21 +349192,41 @@ var buildDaemonServeArgv = (args) => {
|
|
|
349165
349192
|
}
|
|
349166
349193
|
return argv;
|
|
349167
349194
|
};
|
|
349195
|
+
var readLogTail = (path7, maxBytes = 16384) => {
|
|
349196
|
+
try {
|
|
349197
|
+
const text4 = readFileSync30(path7, "utf8");
|
|
349198
|
+
return text4.length > maxBytes ? text4.slice(-maxBytes) : text4;
|
|
349199
|
+
} catch {
|
|
349200
|
+
return "";
|
|
349201
|
+
}
|
|
349202
|
+
};
|
|
349168
349203
|
var spawnManagedDaemonProcess = (args) => {
|
|
349169
|
-
const
|
|
349170
|
-
|
|
349171
|
-
|
|
349172
|
-
|
|
349173
|
-
|
|
349174
|
-
|
|
349175
|
-
|
|
349204
|
+
const logPath = resolveDaemonLogPath(resolveLauncherHomeDir(), args);
|
|
349205
|
+
mkdirSync38(dirname44(logPath), { recursive: true });
|
|
349206
|
+
const logFd = openSync3(logPath, "a");
|
|
349207
|
+
const child = (() => {
|
|
349208
|
+
try {
|
|
349209
|
+
return spawnChildProcess(resolveBunExecutable(), buildDaemonServeArgv(args), {
|
|
349210
|
+
cwd: process.cwd(),
|
|
349211
|
+
detached: true,
|
|
349212
|
+
stdio: ["ignore", logFd, logFd],
|
|
349213
|
+
env: {
|
|
349214
|
+
...process.env,
|
|
349215
|
+
[INTERNAL_DAEMON_FOREGROUND_ENV]: "1"
|
|
349216
|
+
}
|
|
349217
|
+
});
|
|
349218
|
+
} finally {
|
|
349219
|
+
closeSync3(logFd);
|
|
349176
349220
|
}
|
|
349177
|
-
});
|
|
349221
|
+
})();
|
|
349178
349222
|
child.unref();
|
|
349179
349223
|
if (typeof child.pid !== "number" || child.pid <= 0) {
|
|
349180
349224
|
throw new Error("failed to spawn background daemon process");
|
|
349181
349225
|
}
|
|
349182
|
-
return
|
|
349226
|
+
return {
|
|
349227
|
+
pid: child.pid,
|
|
349228
|
+
logPath
|
|
349229
|
+
};
|
|
349183
349230
|
};
|
|
349184
349231
|
var waitForManagedDaemonHealthy = async (authority, pid, timeoutMs = MANAGED_DAEMON_START_TIMEOUT_MS) => {
|
|
349185
349232
|
const startedAt = Date.now();
|
|
@@ -349255,13 +349302,20 @@ var runDaemonStartCommand = async (args) => {
|
|
|
349255
349302
|
return;
|
|
349256
349303
|
}
|
|
349257
349304
|
}
|
|
349258
|
-
const pid = spawnManagedDaemonProcess(args);
|
|
349305
|
+
const { pid, logPath } = spawnManagedDaemonProcess(args);
|
|
349259
349306
|
const status = await waitForManagedDaemonHealthy(requested, pid);
|
|
349260
349307
|
if (status === "healthy") {
|
|
349261
349308
|
console.log(`agenter daemon started in background on ${requested.host}:${requested.port}`);
|
|
349309
|
+
console.log(`daemon log: ${logPath}`);
|
|
349262
349310
|
return;
|
|
349263
349311
|
}
|
|
349264
349312
|
console.error(status === "exited" ? `background daemon process ${pid} exited before becoming healthy on ${requested.host}:${requested.port}` : `timed out waiting for background daemon ${pid} to become healthy on ${requested.host}:${requested.port}`);
|
|
349313
|
+
console.error(`daemon log: ${logPath}`);
|
|
349314
|
+
const logTail = readLogTail(logPath).trim();
|
|
349315
|
+
if (logTail.length > 0) {
|
|
349316
|
+
console.error("daemon log tail:");
|
|
349317
|
+
console.error(logTail);
|
|
349318
|
+
}
|
|
349265
349319
|
process.exitCode = 1;
|
|
349266
349320
|
};
|
|
349267
349321
|
var runDaemonStopCommand = async () => {
|
|
@@ -349504,7 +349558,7 @@ var runCli = async (argvInput = process.argv) => {
|
|
|
349504
349558
|
if (await launchProductCommand(rawArgs)) {
|
|
349505
349559
|
return;
|
|
349506
349560
|
}
|
|
349507
|
-
const argv = await yargs_default(rawArgs).scriptName("agenter").option("host", {
|
|
349561
|
+
const argv = await applyProductCommandsToYargs(yargs_default(rawArgs).scriptName("agenter").version(packageJson.version ?? "unknown").option("host", {
|
|
349508
349562
|
type: "string",
|
|
349509
349563
|
default: "127.0.0.1",
|
|
349510
349564
|
describe: "daemon host"
|
|
@@ -349512,7 +349566,7 @@ var runCli = async (argvInput = process.argv) => {
|
|
|
349512
349566
|
type: "number",
|
|
349513
349567
|
default: 4580,
|
|
349514
349568
|
describe: "daemon port"
|
|
349515
|
-
}).command(["auth-service", "profile-service"], "start standalone auth-service (profile-service remains a deprecated compatibility alias)", (builder) => builder.option("port", {
|
|
349569
|
+
})).command(["auth-service", "profile-service"], "start standalone auth-service (profile-service remains a deprecated compatibility alias)", (builder) => builder.option("port", {
|
|
349516
349570
|
type: "number",
|
|
349517
349571
|
default: 4591,
|
|
349518
349572
|
describe: "auth-service port"
|