@mestreyoda/fabrica 0.1.6 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +541 -579
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5814,9 +5814,9 @@ var require_getMachineId_linux = __commonJS({
|
|
|
5814
5814
|
var api_1 = (init_esm(), __toCommonJS(esm_exports));
|
|
5815
5815
|
async function getMachineId() {
|
|
5816
5816
|
const paths = ["/etc/machine-id", "/var/lib/dbus/machine-id"];
|
|
5817
|
-
for (const
|
|
5817
|
+
for (const path42 of paths) {
|
|
5818
5818
|
try {
|
|
5819
|
-
const result = await fs_1.promises.readFile(
|
|
5819
|
+
const result = await fs_1.promises.readFile(path42, { encoding: "utf8" });
|
|
5820
5820
|
return result.trim();
|
|
5821
5821
|
} catch (e2) {
|
|
5822
5822
|
api_1.diag.debug(`error reading machine id: ${e2}`);
|
|
@@ -14060,19 +14060,19 @@ var require_module_details_from_path = __commonJS({
|
|
|
14060
14060
|
basedir += segments[i2] + sep2;
|
|
14061
14061
|
}
|
|
14062
14062
|
}
|
|
14063
|
-
var
|
|
14063
|
+
var path42 = "";
|
|
14064
14064
|
var lastSegmentIndex = segments.length - 1;
|
|
14065
14065
|
for (var i22 = index + offset; i22 <= lastSegmentIndex; i22++) {
|
|
14066
14066
|
if (i22 === lastSegmentIndex) {
|
|
14067
|
-
|
|
14067
|
+
path42 += segments[i22];
|
|
14068
14068
|
} else {
|
|
14069
|
-
|
|
14069
|
+
path42 += segments[i22] + sep2;
|
|
14070
14070
|
}
|
|
14071
14071
|
}
|
|
14072
14072
|
return {
|
|
14073
14073
|
name,
|
|
14074
14074
|
basedir,
|
|
14075
|
-
path:
|
|
14075
|
+
path: path42
|
|
14076
14076
|
};
|
|
14077
14077
|
};
|
|
14078
14078
|
}
|
|
@@ -14082,7 +14082,7 @@ var require_module_details_from_path = __commonJS({
|
|
|
14082
14082
|
var require_require_in_the_middle = __commonJS({
|
|
14083
14083
|
"node_modules/require-in-the-middle/index.js"(exports2, module2) {
|
|
14084
14084
|
"use strict";
|
|
14085
|
-
var
|
|
14085
|
+
var path42 = __require("path");
|
|
14086
14086
|
var Module = __require("module");
|
|
14087
14087
|
var debug = require_src9()("require-in-the-middle");
|
|
14088
14088
|
var moduleDetailsFromPath = require_module_details_from_path();
|
|
@@ -14227,7 +14227,7 @@ var require_require_in_the_middle = __commonJS({
|
|
|
14227
14227
|
}
|
|
14228
14228
|
moduleName2 = filename;
|
|
14229
14229
|
} else if (hasWhitelist === true && modules.includes(filename)) {
|
|
14230
|
-
const parsedPath =
|
|
14230
|
+
const parsedPath = path42.parse(filename);
|
|
14231
14231
|
moduleName2 = parsedPath.name;
|
|
14232
14232
|
basedir = parsedPath.dir;
|
|
14233
14233
|
} else {
|
|
@@ -14265,7 +14265,7 @@ var require_require_in_the_middle = __commonJS({
|
|
|
14265
14265
|
}
|
|
14266
14266
|
if (res !== filename) {
|
|
14267
14267
|
if (internals === true) {
|
|
14268
|
-
moduleName2 = moduleName2 +
|
|
14268
|
+
moduleName2 = moduleName2 + path42.sep + path42.relative(basedir, filename);
|
|
14269
14269
|
debug("preparing to process require of internal file: %s", moduleName2);
|
|
14270
14270
|
} else {
|
|
14271
14271
|
debug("ignoring require of non-main module file: %s", res);
|
|
@@ -14301,8 +14301,8 @@ var require_require_in_the_middle = __commonJS({
|
|
|
14301
14301
|
}
|
|
14302
14302
|
};
|
|
14303
14303
|
function resolveModuleName(stat2) {
|
|
14304
|
-
const normalizedPath =
|
|
14305
|
-
return
|
|
14304
|
+
const normalizedPath = path42.sep !== "/" ? stat2.path.split(path42.sep).join("/") : stat2.path;
|
|
14305
|
+
return path42.posix.join(stat2.name, normalizedPath).replace(normalize, "");
|
|
14306
14306
|
}
|
|
14307
14307
|
}
|
|
14308
14308
|
});
|
|
@@ -14387,7 +14387,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
|
|
|
14387
14387
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
14388
14388
|
exports2.RequireInTheMiddleSingleton = void 0;
|
|
14389
14389
|
var require_in_the_middle_1 = require_require_in_the_middle();
|
|
14390
|
-
var
|
|
14390
|
+
var path42 = __require("path");
|
|
14391
14391
|
var ModuleNameTrie_1 = require_ModuleNameTrie();
|
|
14392
14392
|
var isMocha = [
|
|
14393
14393
|
"afterEach",
|
|
@@ -14451,7 +14451,7 @@ var require_RequireInTheMiddleSingleton = __commonJS({
|
|
|
14451
14451
|
};
|
|
14452
14452
|
exports2.RequireInTheMiddleSingleton = RequireInTheMiddleSingleton;
|
|
14453
14453
|
function normalizePathSeparators(moduleNameOrPath) {
|
|
14454
|
-
return
|
|
14454
|
+
return path42.sep !== ModuleNameTrie_1.ModuleNameSeparator ? moduleNameOrPath.split(path42.sep).join(ModuleNameTrie_1.ModuleNameSeparator) : moduleNameOrPath;
|
|
14455
14455
|
}
|
|
14456
14456
|
}
|
|
14457
14457
|
});
|
|
@@ -14512,7 +14512,7 @@ var require_register = __commonJS({
|
|
|
14512
14512
|
// node_modules/import-in-the-middle/index.js
|
|
14513
14513
|
var require_import_in_the_middle = __commonJS({
|
|
14514
14514
|
"node_modules/import-in-the-middle/index.js"(exports2, module2) {
|
|
14515
|
-
var
|
|
14515
|
+
var path42 = __require("path");
|
|
14516
14516
|
var moduleDetailsFromPath = require_module_details_from_path();
|
|
14517
14517
|
var { fileURLToPath: fileURLToPath5 } = __require("url");
|
|
14518
14518
|
var { MessageChannel } = __require("worker_threads");
|
|
@@ -14625,7 +14625,7 @@ var require_import_in_the_middle = __commonJS({
|
|
|
14625
14625
|
} else if (baseDir.endsWith(specifiers.get(loadUrl))) {
|
|
14626
14626
|
callHookFn(hookFn, namespace, name, baseDir);
|
|
14627
14627
|
} else if (internals) {
|
|
14628
|
-
const internalPath = name +
|
|
14628
|
+
const internalPath = name + path42.sep + path42.relative(baseDir, filePath);
|
|
14629
14629
|
callHookFn(hookFn, namespace, internalPath, baseDir);
|
|
14630
14630
|
}
|
|
14631
14631
|
} else if (matchArg === specifier) {
|
|
@@ -14700,7 +14700,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
14700
14700
|
"use strict";
|
|
14701
14701
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
14702
14702
|
exports2.InstrumentationBase = void 0;
|
|
14703
|
-
var
|
|
14703
|
+
var path42 = __require("path");
|
|
14704
14704
|
var util_1 = __require("util");
|
|
14705
14705
|
var semver_1 = require_semver();
|
|
14706
14706
|
var shimmer_1 = require_shimmer();
|
|
@@ -14798,7 +14798,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
14798
14798
|
}
|
|
14799
14799
|
_extractPackageVersion(baseDir) {
|
|
14800
14800
|
try {
|
|
14801
|
-
const json2 = (0, fs_1.readFileSync)(
|
|
14801
|
+
const json2 = (0, fs_1.readFileSync)(path42.join(baseDir, "package.json"), {
|
|
14802
14802
|
encoding: "utf8"
|
|
14803
14803
|
});
|
|
14804
14804
|
const version2 = JSON.parse(json2).version;
|
|
@@ -14840,7 +14840,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
14840
14840
|
return exports3;
|
|
14841
14841
|
}
|
|
14842
14842
|
const files = module3.files ?? [];
|
|
14843
|
-
const normalizedName =
|
|
14843
|
+
const normalizedName = path42.normalize(name);
|
|
14844
14844
|
const supportedFileInstrumentations = files.filter((f3) => f3.name === normalizedName && isSupported(f3.supportedVersions, version2, module3.includePrerelease));
|
|
14845
14845
|
return supportedFileInstrumentations.reduce((patchedExports, file2) => {
|
|
14846
14846
|
file2.moduleExports = patchedExports;
|
|
@@ -14886,8 +14886,8 @@ var require_instrumentation2 = __commonJS({
|
|
|
14886
14886
|
this._warnOnPreloadedModules();
|
|
14887
14887
|
for (const module3 of this._modules) {
|
|
14888
14888
|
const hookFn = (exports3, name, baseDir) => {
|
|
14889
|
-
if (!baseDir &&
|
|
14890
|
-
const parsedPath =
|
|
14889
|
+
if (!baseDir && path42.isAbsolute(name)) {
|
|
14890
|
+
const parsedPath = path42.parse(name);
|
|
14891
14891
|
name = parsedPath.name;
|
|
14892
14892
|
baseDir = parsedPath.dir;
|
|
14893
14893
|
}
|
|
@@ -14896,7 +14896,7 @@ var require_instrumentation2 = __commonJS({
|
|
|
14896
14896
|
const onRequire = (exports3, name, baseDir) => {
|
|
14897
14897
|
return this._onRequire(module3, exports3, name, baseDir);
|
|
14898
14898
|
};
|
|
14899
|
-
const hook7 =
|
|
14899
|
+
const hook7 = path42.isAbsolute(module3.name) ? new require_in_the_middle_1.Hook([module3.name], { internals: true }, onRequire) : this._requireInTheMiddleSingleton.register(module3.name, onRequire);
|
|
14900
14900
|
this._hooks.push(hook7);
|
|
14901
14901
|
const esmHook = new import_in_the_middle_1.Hook([module3.name], { internals: true }, hookFn);
|
|
14902
14902
|
this._hooks.push(esmHook);
|
|
@@ -26088,7 +26088,7 @@ function appendRootPathToUrlIfNeeded(url2) {
|
|
|
26088
26088
|
return void 0;
|
|
26089
26089
|
}
|
|
26090
26090
|
}
|
|
26091
|
-
function appendResourcePathToUrl(url2,
|
|
26091
|
+
function appendResourcePathToUrl(url2, path42) {
|
|
26092
26092
|
try {
|
|
26093
26093
|
new URL(url2);
|
|
26094
26094
|
} catch {
|
|
@@ -26098,11 +26098,11 @@ function appendResourcePathToUrl(url2, path41) {
|
|
|
26098
26098
|
if (!url2.endsWith("/")) {
|
|
26099
26099
|
url2 = url2 + "/";
|
|
26100
26100
|
}
|
|
26101
|
-
url2 +=
|
|
26101
|
+
url2 += path42;
|
|
26102
26102
|
try {
|
|
26103
26103
|
new URL(url2);
|
|
26104
26104
|
} catch {
|
|
26105
|
-
diag2.warn(`Configuration: Provided URL appended with '${
|
|
26105
|
+
diag2.warn(`Configuration: Provided URL appended with '${path42}' is not a valid URL, using 'undefined' instead of '${url2}'`);
|
|
26106
26106
|
return void 0;
|
|
26107
26107
|
}
|
|
26108
26108
|
return url2;
|
|
@@ -26995,19 +26995,19 @@ var require_uri_parser = __commonJS({
|
|
|
26995
26995
|
};
|
|
26996
26996
|
}
|
|
26997
26997
|
var NUMBER_REGEX = /^\d+$/;
|
|
26998
|
-
function splitHostPort(
|
|
26999
|
-
if (
|
|
27000
|
-
const hostEnd =
|
|
26998
|
+
function splitHostPort(path42) {
|
|
26999
|
+
if (path42.startsWith("[")) {
|
|
27000
|
+
const hostEnd = path42.indexOf("]");
|
|
27001
27001
|
if (hostEnd === -1) {
|
|
27002
27002
|
return null;
|
|
27003
27003
|
}
|
|
27004
|
-
const host =
|
|
27004
|
+
const host = path42.substring(1, hostEnd);
|
|
27005
27005
|
if (host.indexOf(":") === -1) {
|
|
27006
27006
|
return null;
|
|
27007
27007
|
}
|
|
27008
|
-
if (
|
|
27009
|
-
if (
|
|
27010
|
-
const portString =
|
|
27008
|
+
if (path42.length > hostEnd + 1) {
|
|
27009
|
+
if (path42[hostEnd + 1] === ":") {
|
|
27010
|
+
const portString = path42.substring(hostEnd + 2);
|
|
27011
27011
|
if (NUMBER_REGEX.test(portString)) {
|
|
27012
27012
|
return {
|
|
27013
27013
|
host,
|
|
@@ -27025,7 +27025,7 @@ var require_uri_parser = __commonJS({
|
|
|
27025
27025
|
};
|
|
27026
27026
|
}
|
|
27027
27027
|
} else {
|
|
27028
|
-
const splitPath =
|
|
27028
|
+
const splitPath = path42.split(":");
|
|
27029
27029
|
if (splitPath.length === 2) {
|
|
27030
27030
|
if (NUMBER_REGEX.test(splitPath[1])) {
|
|
27031
27031
|
return {
|
|
@@ -27037,7 +27037,7 @@ var require_uri_parser = __commonJS({
|
|
|
27037
27037
|
}
|
|
27038
27038
|
} else {
|
|
27039
27039
|
return {
|
|
27040
|
-
host:
|
|
27040
|
+
host: path42
|
|
27041
27041
|
};
|
|
27042
27042
|
}
|
|
27043
27043
|
}
|
|
@@ -30037,14 +30037,14 @@ var require_client_interceptors = __commonJS({
|
|
|
30037
30037
|
}
|
|
30038
30038
|
};
|
|
30039
30039
|
exports2.InterceptingCall = InterceptingCall;
|
|
30040
|
-
function getCall(channel,
|
|
30040
|
+
function getCall(channel, path42, options) {
|
|
30041
30041
|
var _a2, _b;
|
|
30042
30042
|
const deadline = (_a2 = options.deadline) !== null && _a2 !== void 0 ? _a2 : Infinity;
|
|
30043
30043
|
const host = options.host;
|
|
30044
30044
|
const parent = (_b = options.parent) !== null && _b !== void 0 ? _b : null;
|
|
30045
30045
|
const propagateFlags = options.propagate_flags;
|
|
30046
30046
|
const credentials = options.credentials;
|
|
30047
|
-
const call = channel.createCall(
|
|
30047
|
+
const call = channel.createCall(path42, deadline, host, parent, propagateFlags);
|
|
30048
30048
|
if (credentials) {
|
|
30049
30049
|
call.setCredentials(credentials);
|
|
30050
30050
|
}
|
|
@@ -30614,9 +30614,9 @@ var require_make_client = __commonJS({
|
|
|
30614
30614
|
ServiceClientImpl.serviceName = serviceName;
|
|
30615
30615
|
return ServiceClientImpl;
|
|
30616
30616
|
}
|
|
30617
|
-
function partial2(fn,
|
|
30617
|
+
function partial2(fn, path42, serialize, deserialize) {
|
|
30618
30618
|
return function(...args) {
|
|
30619
|
-
return fn.call(this,
|
|
30619
|
+
return fn.call(this, path42, serialize, deserialize, ...args);
|
|
30620
30620
|
};
|
|
30621
30621
|
}
|
|
30622
30622
|
function isProtobufTypeDefinition(obj) {
|
|
@@ -31143,15 +31143,15 @@ var require_fetch = __commonJS({
|
|
|
31143
31143
|
var require_path = __commonJS({
|
|
31144
31144
|
"node_modules/@protobufjs/path/index.js"(exports2) {
|
|
31145
31145
|
"use strict";
|
|
31146
|
-
var
|
|
31146
|
+
var path42 = exports2;
|
|
31147
31147
|
var isAbsolute = (
|
|
31148
31148
|
/**
|
|
31149
31149
|
* Tests if the specified path is absolute.
|
|
31150
31150
|
* @param {string} path Path to test
|
|
31151
31151
|
* @returns {boolean} `true` if path is absolute
|
|
31152
31152
|
*/
|
|
31153
|
-
|
|
31154
|
-
return /^(?:\/|\w+:)/.test(
|
|
31153
|
+
path42.isAbsolute = function isAbsolute2(path43) {
|
|
31154
|
+
return /^(?:\/|\w+:)/.test(path43);
|
|
31155
31155
|
}
|
|
31156
31156
|
);
|
|
31157
31157
|
var normalize = (
|
|
@@ -31160,9 +31160,9 @@ var require_path = __commonJS({
|
|
|
31160
31160
|
* @param {string} path Path to normalize
|
|
31161
31161
|
* @returns {string} Normalized path
|
|
31162
31162
|
*/
|
|
31163
|
-
|
|
31164
|
-
|
|
31165
|
-
var parts =
|
|
31163
|
+
path42.normalize = function normalize2(path43) {
|
|
31164
|
+
path43 = path43.replace(/\\/g, "/").replace(/\/{2,}/g, "/");
|
|
31165
|
+
var parts = path43.split("/"), absolute = isAbsolute(path43), prefix = "";
|
|
31166
31166
|
if (absolute)
|
|
31167
31167
|
prefix = parts.shift() + "/";
|
|
31168
31168
|
for (var i2 = 0; i2 < parts.length; ) {
|
|
@@ -31181,7 +31181,7 @@ var require_path = __commonJS({
|
|
|
31181
31181
|
return prefix + parts.join("/");
|
|
31182
31182
|
}
|
|
31183
31183
|
);
|
|
31184
|
-
|
|
31184
|
+
path42.resolve = function resolve3(originPath, includePath, alreadyNormalized) {
|
|
31185
31185
|
if (!alreadyNormalized)
|
|
31186
31186
|
includePath = normalize(includePath);
|
|
31187
31187
|
if (isAbsolute(includePath))
|
|
@@ -31332,16 +31332,16 @@ var require_namespace = __commonJS({
|
|
|
31332
31332
|
object2.onRemove(this);
|
|
31333
31333
|
return clearCache(this);
|
|
31334
31334
|
};
|
|
31335
|
-
Namespace.prototype.define = function define2(
|
|
31336
|
-
if (util.isString(
|
|
31337
|
-
|
|
31338
|
-
else if (!Array.isArray(
|
|
31335
|
+
Namespace.prototype.define = function define2(path42, json2) {
|
|
31336
|
+
if (util.isString(path42))
|
|
31337
|
+
path42 = path42.split(".");
|
|
31338
|
+
else if (!Array.isArray(path42))
|
|
31339
31339
|
throw TypeError("illegal path");
|
|
31340
|
-
if (
|
|
31340
|
+
if (path42 && path42.length && path42[0] === "")
|
|
31341
31341
|
throw Error("path must be relative");
|
|
31342
31342
|
var ptr = this;
|
|
31343
|
-
while (
|
|
31344
|
-
var part =
|
|
31343
|
+
while (path42.length > 0) {
|
|
31344
|
+
var part = path42.shift();
|
|
31345
31345
|
if (ptr.nested && ptr.nested[part]) {
|
|
31346
31346
|
ptr = ptr.nested[part];
|
|
31347
31347
|
if (!(ptr instanceof Namespace))
|
|
@@ -31376,26 +31376,26 @@ var require_namespace = __commonJS({
|
|
|
31376
31376
|
});
|
|
31377
31377
|
return this;
|
|
31378
31378
|
};
|
|
31379
|
-
Namespace.prototype.lookup = function lookup(
|
|
31379
|
+
Namespace.prototype.lookup = function lookup(path42, filterTypes, parentAlreadyChecked) {
|
|
31380
31380
|
if (typeof filterTypes === "boolean") {
|
|
31381
31381
|
parentAlreadyChecked = filterTypes;
|
|
31382
31382
|
filterTypes = void 0;
|
|
31383
31383
|
} else if (filterTypes && !Array.isArray(filterTypes))
|
|
31384
31384
|
filterTypes = [filterTypes];
|
|
31385
|
-
if (util.isString(
|
|
31386
|
-
if (
|
|
31385
|
+
if (util.isString(path42) && path42.length) {
|
|
31386
|
+
if (path42 === ".")
|
|
31387
31387
|
return this.root;
|
|
31388
|
-
|
|
31389
|
-
} else if (!
|
|
31388
|
+
path42 = path42.split(".");
|
|
31389
|
+
} else if (!path42.length)
|
|
31390
31390
|
return this;
|
|
31391
|
-
var flatPath =
|
|
31392
|
-
if (
|
|
31393
|
-
return this.root.lookup(
|
|
31391
|
+
var flatPath = path42.join(".");
|
|
31392
|
+
if (path42[0] === "")
|
|
31393
|
+
return this.root.lookup(path42.slice(1), filterTypes);
|
|
31394
31394
|
var found = this.root._fullyQualifiedObjects && this.root._fullyQualifiedObjects["." + flatPath];
|
|
31395
31395
|
if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
|
|
31396
31396
|
return found;
|
|
31397
31397
|
}
|
|
31398
|
-
found = this._lookupImpl(
|
|
31398
|
+
found = this._lookupImpl(path42, flatPath);
|
|
31399
31399
|
if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
|
|
31400
31400
|
return found;
|
|
31401
31401
|
}
|
|
@@ -31403,7 +31403,7 @@ var require_namespace = __commonJS({
|
|
|
31403
31403
|
return null;
|
|
31404
31404
|
var current = this;
|
|
31405
31405
|
while (current.parent) {
|
|
31406
|
-
found = current.parent._lookupImpl(
|
|
31406
|
+
found = current.parent._lookupImpl(path42, flatPath);
|
|
31407
31407
|
if (found && (!filterTypes || filterTypes.indexOf(found.constructor) > -1)) {
|
|
31408
31408
|
return found;
|
|
31409
31409
|
}
|
|
@@ -31411,49 +31411,49 @@ var require_namespace = __commonJS({
|
|
|
31411
31411
|
}
|
|
31412
31412
|
return null;
|
|
31413
31413
|
};
|
|
31414
|
-
Namespace.prototype._lookupImpl = function lookup(
|
|
31414
|
+
Namespace.prototype._lookupImpl = function lookup(path42, flatPath) {
|
|
31415
31415
|
if (Object.prototype.hasOwnProperty.call(this._lookupCache, flatPath)) {
|
|
31416
31416
|
return this._lookupCache[flatPath];
|
|
31417
31417
|
}
|
|
31418
|
-
var found = this.get(
|
|
31418
|
+
var found = this.get(path42[0]);
|
|
31419
31419
|
var exact = null;
|
|
31420
31420
|
if (found) {
|
|
31421
|
-
if (
|
|
31421
|
+
if (path42.length === 1) {
|
|
31422
31422
|
exact = found;
|
|
31423
31423
|
} else if (found instanceof Namespace) {
|
|
31424
|
-
|
|
31425
|
-
exact = found._lookupImpl(
|
|
31424
|
+
path42 = path42.slice(1);
|
|
31425
|
+
exact = found._lookupImpl(path42, path42.join("."));
|
|
31426
31426
|
}
|
|
31427
31427
|
} else {
|
|
31428
31428
|
for (var i2 = 0; i2 < this.nestedArray.length; ++i2)
|
|
31429
|
-
if (this._nestedArray[i2] instanceof Namespace && (found = this._nestedArray[i2]._lookupImpl(
|
|
31429
|
+
if (this._nestedArray[i2] instanceof Namespace && (found = this._nestedArray[i2]._lookupImpl(path42, flatPath)))
|
|
31430
31430
|
exact = found;
|
|
31431
31431
|
}
|
|
31432
31432
|
this._lookupCache[flatPath] = exact;
|
|
31433
31433
|
return exact;
|
|
31434
31434
|
};
|
|
31435
|
-
Namespace.prototype.lookupType = function lookupType(
|
|
31436
|
-
var found = this.lookup(
|
|
31435
|
+
Namespace.prototype.lookupType = function lookupType(path42) {
|
|
31436
|
+
var found = this.lookup(path42, [Type]);
|
|
31437
31437
|
if (!found)
|
|
31438
|
-
throw Error("no such type: " +
|
|
31438
|
+
throw Error("no such type: " + path42);
|
|
31439
31439
|
return found;
|
|
31440
31440
|
};
|
|
31441
|
-
Namespace.prototype.lookupEnum = function lookupEnum(
|
|
31442
|
-
var found = this.lookup(
|
|
31441
|
+
Namespace.prototype.lookupEnum = function lookupEnum(path42) {
|
|
31442
|
+
var found = this.lookup(path42, [Enum]);
|
|
31443
31443
|
if (!found)
|
|
31444
|
-
throw Error("no such Enum '" +
|
|
31444
|
+
throw Error("no such Enum '" + path42 + "' in " + this);
|
|
31445
31445
|
return found;
|
|
31446
31446
|
};
|
|
31447
|
-
Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(
|
|
31448
|
-
var found = this.lookup(
|
|
31447
|
+
Namespace.prototype.lookupTypeOrEnum = function lookupTypeOrEnum(path42) {
|
|
31448
|
+
var found = this.lookup(path42, [Type, Enum]);
|
|
31449
31449
|
if (!found)
|
|
31450
|
-
throw Error("no such Type or Enum '" +
|
|
31450
|
+
throw Error("no such Type or Enum '" + path42 + "' in " + this);
|
|
31451
31451
|
return found;
|
|
31452
31452
|
};
|
|
31453
|
-
Namespace.prototype.lookupService = function lookupService(
|
|
31454
|
-
var found = this.lookup(
|
|
31453
|
+
Namespace.prototype.lookupService = function lookupService(path42) {
|
|
31454
|
+
var found = this.lookup(path42, [Service]);
|
|
31455
31455
|
if (!found)
|
|
31456
|
-
throw Error("no such Service '" +
|
|
31456
|
+
throw Error("no such Service '" + path42 + "' in " + this);
|
|
31457
31457
|
return found;
|
|
31458
31458
|
};
|
|
31459
31459
|
Namespace._configure = function(Type_, Service_, Enum_) {
|
|
@@ -32816,14 +32816,14 @@ var require_util2 = __commonJS({
|
|
|
32816
32816
|
Object.defineProperty(object2, "$type", { value: enm, enumerable: false });
|
|
32817
32817
|
return enm;
|
|
32818
32818
|
};
|
|
32819
|
-
util.setProperty = function setProperty(dst,
|
|
32820
|
-
function setProp(dst2,
|
|
32821
|
-
var part =
|
|
32819
|
+
util.setProperty = function setProperty(dst, path42, value, ifNotSet) {
|
|
32820
|
+
function setProp(dst2, path43, value2) {
|
|
32821
|
+
var part = path43.shift();
|
|
32822
32822
|
if (part === "__proto__" || part === "prototype") {
|
|
32823
32823
|
return dst2;
|
|
32824
32824
|
}
|
|
32825
|
-
if (
|
|
32826
|
-
dst2[part] = setProp(dst2[part] || {},
|
|
32825
|
+
if (path43.length > 0) {
|
|
32826
|
+
dst2[part] = setProp(dst2[part] || {}, path43, value2);
|
|
32827
32827
|
} else {
|
|
32828
32828
|
var prevValue = dst2[part];
|
|
32829
32829
|
if (prevValue && ifNotSet)
|
|
@@ -32836,10 +32836,10 @@ var require_util2 = __commonJS({
|
|
|
32836
32836
|
}
|
|
32837
32837
|
if (typeof dst !== "object")
|
|
32838
32838
|
throw TypeError("dst must be an object");
|
|
32839
|
-
if (!
|
|
32839
|
+
if (!path42)
|
|
32840
32840
|
throw TypeError("path must be specified");
|
|
32841
|
-
|
|
32842
|
-
return setProp(dst,
|
|
32841
|
+
path42 = path42.split(".");
|
|
32842
|
+
return setProp(dst, path42, value);
|
|
32843
32843
|
};
|
|
32844
32844
|
Object.defineProperty(util, "decorateRoot", {
|
|
32845
32845
|
get: function() {
|
|
@@ -33385,12 +33385,12 @@ var require_object = __commonJS({
|
|
|
33385
33385
|
*/
|
|
33386
33386
|
fullName: {
|
|
33387
33387
|
get: function() {
|
|
33388
|
-
var
|
|
33388
|
+
var path42 = [this.name], ptr = this.parent;
|
|
33389
33389
|
while (ptr) {
|
|
33390
|
-
|
|
33390
|
+
path42.unshift(ptr.name);
|
|
33391
33391
|
ptr = ptr.parent;
|
|
33392
33392
|
}
|
|
33393
|
-
return
|
|
33393
|
+
return path42.join(".");
|
|
33394
33394
|
}
|
|
33395
33395
|
}
|
|
33396
33396
|
});
|
|
@@ -37380,16 +37380,16 @@ var require_util3 = __commonJS({
|
|
|
37380
37380
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
37381
37381
|
exports2.addCommonProtos = exports2.loadProtosWithOptionsSync = exports2.loadProtosWithOptions = void 0;
|
|
37382
37382
|
var fs39 = __require("fs");
|
|
37383
|
-
var
|
|
37383
|
+
var path42 = __require("path");
|
|
37384
37384
|
var Protobuf = require_protobufjs();
|
|
37385
37385
|
function addIncludePathResolver(root, includePaths) {
|
|
37386
37386
|
const originalResolvePath = root.resolvePath;
|
|
37387
37387
|
root.resolvePath = (origin, target) => {
|
|
37388
|
-
if (
|
|
37388
|
+
if (path42.isAbsolute(target)) {
|
|
37389
37389
|
return target;
|
|
37390
37390
|
}
|
|
37391
37391
|
for (const directory of includePaths) {
|
|
37392
|
-
const fullPath =
|
|
37392
|
+
const fullPath = path42.join(directory, target);
|
|
37393
37393
|
try {
|
|
37394
37394
|
fs39.accessSync(fullPath, fs39.constants.R_OK);
|
|
37395
37395
|
return fullPath;
|
|
@@ -43712,9 +43712,9 @@ var require_server_call = __commonJS({
|
|
|
43712
43712
|
return status;
|
|
43713
43713
|
}
|
|
43714
43714
|
var ServerUnaryCallImpl = class extends events_1.EventEmitter {
|
|
43715
|
-
constructor(
|
|
43715
|
+
constructor(path42, call, metadata, request2) {
|
|
43716
43716
|
super();
|
|
43717
|
-
this.path =
|
|
43717
|
+
this.path = path42;
|
|
43718
43718
|
this.call = call;
|
|
43719
43719
|
this.metadata = metadata;
|
|
43720
43720
|
this.request = request2;
|
|
@@ -43744,9 +43744,9 @@ var require_server_call = __commonJS({
|
|
|
43744
43744
|
};
|
|
43745
43745
|
exports2.ServerUnaryCallImpl = ServerUnaryCallImpl;
|
|
43746
43746
|
var ServerReadableStreamImpl = class extends stream_1.Readable {
|
|
43747
|
-
constructor(
|
|
43747
|
+
constructor(path42, call, metadata) {
|
|
43748
43748
|
super({ objectMode: true });
|
|
43749
|
-
this.path =
|
|
43749
|
+
this.path = path42;
|
|
43750
43750
|
this.call = call;
|
|
43751
43751
|
this.metadata = metadata;
|
|
43752
43752
|
this.cancelled = false;
|
|
@@ -43778,9 +43778,9 @@ var require_server_call = __commonJS({
|
|
|
43778
43778
|
};
|
|
43779
43779
|
exports2.ServerReadableStreamImpl = ServerReadableStreamImpl;
|
|
43780
43780
|
var ServerWritableStreamImpl = class extends stream_1.Writable {
|
|
43781
|
-
constructor(
|
|
43781
|
+
constructor(path42, call, metadata, request2) {
|
|
43782
43782
|
super({ objectMode: true });
|
|
43783
|
-
this.path =
|
|
43783
|
+
this.path = path42;
|
|
43784
43784
|
this.call = call;
|
|
43785
43785
|
this.metadata = metadata;
|
|
43786
43786
|
this.request = request2;
|
|
@@ -43834,9 +43834,9 @@ var require_server_call = __commonJS({
|
|
|
43834
43834
|
};
|
|
43835
43835
|
exports2.ServerWritableStreamImpl = ServerWritableStreamImpl;
|
|
43836
43836
|
var ServerDuplexStreamImpl = class extends stream_1.Duplex {
|
|
43837
|
-
constructor(
|
|
43837
|
+
constructor(path42, call, metadata) {
|
|
43838
43838
|
super({ objectMode: true });
|
|
43839
|
-
this.path =
|
|
43839
|
+
this.path = path42;
|
|
43840
43840
|
this.call = call;
|
|
43841
43841
|
this.metadata = metadata;
|
|
43842
43842
|
this.pendingStatus = {
|
|
@@ -46112,11 +46112,11 @@ var require_server = __commonJS({
|
|
|
46112
46112
|
}
|
|
46113
46113
|
return true;
|
|
46114
46114
|
}
|
|
46115
|
-
_retrieveHandler(
|
|
46116
|
-
serverCallTrace("Received call to method " +
|
|
46117
|
-
const handler = this.handlers.get(
|
|
46115
|
+
_retrieveHandler(path42) {
|
|
46116
|
+
serverCallTrace("Received call to method " + path42 + " at address " + this.serverAddressString);
|
|
46117
|
+
const handler = this.handlers.get(path42);
|
|
46118
46118
|
if (handler === void 0) {
|
|
46119
|
-
serverCallTrace("No handler registered for method " +
|
|
46119
|
+
serverCallTrace("No handler registered for method " + path42 + ". Sending UNIMPLEMENTED status.");
|
|
46120
46120
|
return null;
|
|
46121
46121
|
}
|
|
46122
46122
|
return handler;
|
|
@@ -46138,10 +46138,10 @@ var require_server = __commonJS({
|
|
|
46138
46138
|
channelzSessionInfo === null || channelzSessionInfo === void 0 ? void 0 : channelzSessionInfo.streamTracker.addCallFailed();
|
|
46139
46139
|
return;
|
|
46140
46140
|
}
|
|
46141
|
-
const
|
|
46142
|
-
const handler = this._retrieveHandler(
|
|
46141
|
+
const path42 = headers[HTTP2_HEADER_PATH];
|
|
46142
|
+
const handler = this._retrieveHandler(path42);
|
|
46143
46143
|
if (!handler) {
|
|
46144
|
-
this._respondWithError(getUnimplementedStatusResponse(
|
|
46144
|
+
this._respondWithError(getUnimplementedStatusResponse(path42), stream, channelzSessionInfo);
|
|
46145
46145
|
return;
|
|
46146
46146
|
}
|
|
46147
46147
|
const callEventTracker = {
|
|
@@ -46189,10 +46189,10 @@ var require_server = __commonJS({
|
|
|
46189
46189
|
if (this._verifyContentType(stream, headers) !== true) {
|
|
46190
46190
|
return;
|
|
46191
46191
|
}
|
|
46192
|
-
const
|
|
46193
|
-
const handler = this._retrieveHandler(
|
|
46192
|
+
const path42 = headers[HTTP2_HEADER_PATH];
|
|
46193
|
+
const handler = this._retrieveHandler(path42);
|
|
46194
46194
|
if (!handler) {
|
|
46195
|
-
this._respondWithError(getUnimplementedStatusResponse(
|
|
46195
|
+
this._respondWithError(getUnimplementedStatusResponse(path42), stream, null);
|
|
46196
46196
|
return;
|
|
46197
46197
|
}
|
|
46198
46198
|
const call = (0, server_interceptors_1.getServerInterceptingCall)([...extraInterceptors, ...this.interceptors], stream, headers, null, handler, this.options);
|
|
@@ -47476,13 +47476,13 @@ var require_resolver_uds = __commonJS({
|
|
|
47476
47476
|
this.listener = listener;
|
|
47477
47477
|
this.hasReturnedResult = false;
|
|
47478
47478
|
this.endpoints = [];
|
|
47479
|
-
let
|
|
47479
|
+
let path42;
|
|
47480
47480
|
if (target.authority === "") {
|
|
47481
|
-
|
|
47481
|
+
path42 = "/" + target.path;
|
|
47482
47482
|
} else {
|
|
47483
|
-
|
|
47483
|
+
path42 = target.path;
|
|
47484
47484
|
}
|
|
47485
|
-
this.endpoints = [{ addresses: [{ path:
|
|
47485
|
+
this.endpoints = [{ addresses: [{ path: path42 }] }];
|
|
47486
47486
|
}
|
|
47487
47487
|
updateResolution() {
|
|
47488
47488
|
if (!this.hasReturnedResult) {
|
|
@@ -47542,12 +47542,12 @@ var require_resolver_ip = __commonJS({
|
|
|
47542
47542
|
return;
|
|
47543
47543
|
}
|
|
47544
47544
|
const pathList = target.path.split(",");
|
|
47545
|
-
for (const
|
|
47546
|
-
const hostPort = (0, uri_parser_1.splitHostPort)(
|
|
47545
|
+
for (const path42 of pathList) {
|
|
47546
|
+
const hostPort = (0, uri_parser_1.splitHostPort)(path42);
|
|
47547
47547
|
if (hostPort === null) {
|
|
47548
47548
|
this.error = {
|
|
47549
47549
|
code: constants_1.Status.UNAVAILABLE,
|
|
47550
|
-
details: `Failed to parse ${target.scheme} address ${
|
|
47550
|
+
details: `Failed to parse ${target.scheme} address ${path42}`,
|
|
47551
47551
|
metadata: new metadata_1.Metadata()
|
|
47552
47552
|
};
|
|
47553
47553
|
return;
|
|
@@ -47555,7 +47555,7 @@ var require_resolver_ip = __commonJS({
|
|
|
47555
47555
|
if (target.scheme === IPV4_SCHEME && !(0, net_1.isIPv4)(hostPort.host) || target.scheme === IPV6_SCHEME && !(0, net_1.isIPv6)(hostPort.host)) {
|
|
47556
47556
|
this.error = {
|
|
47557
47557
|
code: constants_1.Status.UNAVAILABLE,
|
|
47558
|
-
details: `Failed to parse ${target.scheme} address ${
|
|
47558
|
+
details: `Failed to parse ${target.scheme} address ${path42}`,
|
|
47559
47559
|
metadata: new metadata_1.Metadata()
|
|
47560
47560
|
};
|
|
47561
47561
|
return;
|
|
@@ -48911,10 +48911,10 @@ var require_create_service_client_constructor = __commonJS({
|
|
|
48911
48911
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
48912
48912
|
exports2.createServiceClientConstructor = void 0;
|
|
48913
48913
|
var grpc = require_src15();
|
|
48914
|
-
function createServiceClientConstructor(
|
|
48914
|
+
function createServiceClientConstructor(path42, name) {
|
|
48915
48915
|
const serviceDefinition = {
|
|
48916
48916
|
export: {
|
|
48917
|
-
path:
|
|
48917
|
+
path: path42,
|
|
48918
48918
|
requestStream: false,
|
|
48919
48919
|
responseStream: false,
|
|
48920
48920
|
requestSerialize: (arg) => {
|
|
@@ -49134,7 +49134,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
|
|
|
49134
49134
|
var grpc_exporter_transport_1 = require_grpc_exporter_transport();
|
|
49135
49135
|
var node_http_1 = (init_index_node_http(), __toCommonJS(index_node_http_exports));
|
|
49136
49136
|
var fs39 = __require("fs");
|
|
49137
|
-
var
|
|
49137
|
+
var path42 = __require("path");
|
|
49138
49138
|
var api_1 = (init_esm(), __toCommonJS(esm_exports));
|
|
49139
49139
|
function fallbackIfNullishOrBlank(signalSpecific, nonSignalSpecific) {
|
|
49140
49140
|
if (signalSpecific != null && signalSpecific !== "") {
|
|
@@ -49183,7 +49183,7 @@ var require_otlp_grpc_env_configuration = __commonJS({
|
|
|
49183
49183
|
const filePath = fallbackIfNullishOrBlank(signalSpecificPath, nonSignalSpecificPath);
|
|
49184
49184
|
if (filePath != null) {
|
|
49185
49185
|
try {
|
|
49186
|
-
return fs39.readFileSync(
|
|
49186
|
+
return fs39.readFileSync(path42.resolve(process.cwd(), filePath));
|
|
49187
49187
|
} catch {
|
|
49188
49188
|
api_1.diag.warn(warningMessage);
|
|
49189
49189
|
return void 0;
|
|
@@ -52480,17 +52480,17 @@ var require_visit = __commonJS({
|
|
|
52480
52480
|
visit.BREAK = BREAK;
|
|
52481
52481
|
visit.SKIP = SKIP;
|
|
52482
52482
|
visit.REMOVE = REMOVE;
|
|
52483
|
-
function visit_(key, node, visitor,
|
|
52484
|
-
const ctrl = callVisitor(key, node, visitor,
|
|
52483
|
+
function visit_(key, node, visitor, path42) {
|
|
52484
|
+
const ctrl = callVisitor(key, node, visitor, path42);
|
|
52485
52485
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
52486
|
-
replaceNode(key,
|
|
52487
|
-
return visit_(key, ctrl, visitor,
|
|
52486
|
+
replaceNode(key, path42, ctrl);
|
|
52487
|
+
return visit_(key, ctrl, visitor, path42);
|
|
52488
52488
|
}
|
|
52489
52489
|
if (typeof ctrl !== "symbol") {
|
|
52490
52490
|
if (identity.isCollection(node)) {
|
|
52491
|
-
|
|
52491
|
+
path42 = Object.freeze(path42.concat(node));
|
|
52492
52492
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
52493
|
-
const ci = visit_(i2, node.items[i2], visitor,
|
|
52493
|
+
const ci = visit_(i2, node.items[i2], visitor, path42);
|
|
52494
52494
|
if (typeof ci === "number")
|
|
52495
52495
|
i2 = ci - 1;
|
|
52496
52496
|
else if (ci === BREAK)
|
|
@@ -52501,13 +52501,13 @@ var require_visit = __commonJS({
|
|
|
52501
52501
|
}
|
|
52502
52502
|
}
|
|
52503
52503
|
} else if (identity.isPair(node)) {
|
|
52504
|
-
|
|
52505
|
-
const ck = visit_("key", node.key, visitor,
|
|
52504
|
+
path42 = Object.freeze(path42.concat(node));
|
|
52505
|
+
const ck = visit_("key", node.key, visitor, path42);
|
|
52506
52506
|
if (ck === BREAK)
|
|
52507
52507
|
return BREAK;
|
|
52508
52508
|
else if (ck === REMOVE)
|
|
52509
52509
|
node.key = null;
|
|
52510
|
-
const cv = visit_("value", node.value, visitor,
|
|
52510
|
+
const cv = visit_("value", node.value, visitor, path42);
|
|
52511
52511
|
if (cv === BREAK)
|
|
52512
52512
|
return BREAK;
|
|
52513
52513
|
else if (cv === REMOVE)
|
|
@@ -52528,17 +52528,17 @@ var require_visit = __commonJS({
|
|
|
52528
52528
|
visitAsync.BREAK = BREAK;
|
|
52529
52529
|
visitAsync.SKIP = SKIP;
|
|
52530
52530
|
visitAsync.REMOVE = REMOVE;
|
|
52531
|
-
async function visitAsync_(key, node, visitor,
|
|
52532
|
-
const ctrl = await callVisitor(key, node, visitor,
|
|
52531
|
+
async function visitAsync_(key, node, visitor, path42) {
|
|
52532
|
+
const ctrl = await callVisitor(key, node, visitor, path42);
|
|
52533
52533
|
if (identity.isNode(ctrl) || identity.isPair(ctrl)) {
|
|
52534
|
-
replaceNode(key,
|
|
52535
|
-
return visitAsync_(key, ctrl, visitor,
|
|
52534
|
+
replaceNode(key, path42, ctrl);
|
|
52535
|
+
return visitAsync_(key, ctrl, visitor, path42);
|
|
52536
52536
|
}
|
|
52537
52537
|
if (typeof ctrl !== "symbol") {
|
|
52538
52538
|
if (identity.isCollection(node)) {
|
|
52539
|
-
|
|
52539
|
+
path42 = Object.freeze(path42.concat(node));
|
|
52540
52540
|
for (let i2 = 0; i2 < node.items.length; ++i2) {
|
|
52541
|
-
const ci = await visitAsync_(i2, node.items[i2], visitor,
|
|
52541
|
+
const ci = await visitAsync_(i2, node.items[i2], visitor, path42);
|
|
52542
52542
|
if (typeof ci === "number")
|
|
52543
52543
|
i2 = ci - 1;
|
|
52544
52544
|
else if (ci === BREAK)
|
|
@@ -52549,13 +52549,13 @@ var require_visit = __commonJS({
|
|
|
52549
52549
|
}
|
|
52550
52550
|
}
|
|
52551
52551
|
} else if (identity.isPair(node)) {
|
|
52552
|
-
|
|
52553
|
-
const ck = await visitAsync_("key", node.key, visitor,
|
|
52552
|
+
path42 = Object.freeze(path42.concat(node));
|
|
52553
|
+
const ck = await visitAsync_("key", node.key, visitor, path42);
|
|
52554
52554
|
if (ck === BREAK)
|
|
52555
52555
|
return BREAK;
|
|
52556
52556
|
else if (ck === REMOVE)
|
|
52557
52557
|
node.key = null;
|
|
52558
|
-
const cv = await visitAsync_("value", node.value, visitor,
|
|
52558
|
+
const cv = await visitAsync_("value", node.value, visitor, path42);
|
|
52559
52559
|
if (cv === BREAK)
|
|
52560
52560
|
return BREAK;
|
|
52561
52561
|
else if (cv === REMOVE)
|
|
@@ -52582,23 +52582,23 @@ var require_visit = __commonJS({
|
|
|
52582
52582
|
}
|
|
52583
52583
|
return visitor;
|
|
52584
52584
|
}
|
|
52585
|
-
function callVisitor(key, node, visitor,
|
|
52585
|
+
function callVisitor(key, node, visitor, path42) {
|
|
52586
52586
|
if (typeof visitor === "function")
|
|
52587
|
-
return visitor(key, node,
|
|
52587
|
+
return visitor(key, node, path42);
|
|
52588
52588
|
if (identity.isMap(node))
|
|
52589
|
-
return visitor.Map?.(key, node,
|
|
52589
|
+
return visitor.Map?.(key, node, path42);
|
|
52590
52590
|
if (identity.isSeq(node))
|
|
52591
|
-
return visitor.Seq?.(key, node,
|
|
52591
|
+
return visitor.Seq?.(key, node, path42);
|
|
52592
52592
|
if (identity.isPair(node))
|
|
52593
|
-
return visitor.Pair?.(key, node,
|
|
52593
|
+
return visitor.Pair?.(key, node, path42);
|
|
52594
52594
|
if (identity.isScalar(node))
|
|
52595
|
-
return visitor.Scalar?.(key, node,
|
|
52595
|
+
return visitor.Scalar?.(key, node, path42);
|
|
52596
52596
|
if (identity.isAlias(node))
|
|
52597
|
-
return visitor.Alias?.(key, node,
|
|
52597
|
+
return visitor.Alias?.(key, node, path42);
|
|
52598
52598
|
return void 0;
|
|
52599
52599
|
}
|
|
52600
|
-
function replaceNode(key,
|
|
52601
|
-
const parent =
|
|
52600
|
+
function replaceNode(key, path42, node) {
|
|
52601
|
+
const parent = path42[path42.length - 1];
|
|
52602
52602
|
if (identity.isCollection(parent)) {
|
|
52603
52603
|
parent.items[key] = node;
|
|
52604
52604
|
} else if (identity.isPair(parent)) {
|
|
@@ -53206,10 +53206,10 @@ var require_Collection = __commonJS({
|
|
|
53206
53206
|
var createNode = require_createNode();
|
|
53207
53207
|
var identity = require_identity();
|
|
53208
53208
|
var Node = require_Node();
|
|
53209
|
-
function collectionFromPath(schema,
|
|
53209
|
+
function collectionFromPath(schema, path42, value) {
|
|
53210
53210
|
let v = value;
|
|
53211
|
-
for (let i2 =
|
|
53212
|
-
const k =
|
|
53211
|
+
for (let i2 = path42.length - 1; i2 >= 0; --i2) {
|
|
53212
|
+
const k = path42[i2];
|
|
53213
53213
|
if (typeof k === "number" && Number.isInteger(k) && k >= 0) {
|
|
53214
53214
|
const a = [];
|
|
53215
53215
|
a[k] = v;
|
|
@@ -53228,7 +53228,7 @@ var require_Collection = __commonJS({
|
|
|
53228
53228
|
sourceObjects: /* @__PURE__ */ new Map()
|
|
53229
53229
|
});
|
|
53230
53230
|
}
|
|
53231
|
-
var isEmptyPath = (
|
|
53231
|
+
var isEmptyPath = (path42) => path42 == null || typeof path42 === "object" && !!path42[Symbol.iterator]().next().done;
|
|
53232
53232
|
var Collection2 = class extends Node.NodeBase {
|
|
53233
53233
|
constructor(type, schema) {
|
|
53234
53234
|
super(type);
|
|
@@ -53258,11 +53258,11 @@ var require_Collection = __commonJS({
|
|
|
53258
53258
|
* be a Pair instance or a `{ key, value }` object, which may not have a key
|
|
53259
53259
|
* that already exists in the map.
|
|
53260
53260
|
*/
|
|
53261
|
-
addIn(
|
|
53262
|
-
if (isEmptyPath(
|
|
53261
|
+
addIn(path42, value) {
|
|
53262
|
+
if (isEmptyPath(path42))
|
|
53263
53263
|
this.add(value);
|
|
53264
53264
|
else {
|
|
53265
|
-
const [key, ...rest] =
|
|
53265
|
+
const [key, ...rest] = path42;
|
|
53266
53266
|
const node = this.get(key, true);
|
|
53267
53267
|
if (identity.isCollection(node))
|
|
53268
53268
|
node.addIn(rest, value);
|
|
@@ -53276,8 +53276,8 @@ var require_Collection = __commonJS({
|
|
|
53276
53276
|
* Removes a value from the collection.
|
|
53277
53277
|
* @returns `true` if the item was found and removed.
|
|
53278
53278
|
*/
|
|
53279
|
-
deleteIn(
|
|
53280
|
-
const [key, ...rest] =
|
|
53279
|
+
deleteIn(path42) {
|
|
53280
|
+
const [key, ...rest] = path42;
|
|
53281
53281
|
if (rest.length === 0)
|
|
53282
53282
|
return this.delete(key);
|
|
53283
53283
|
const node = this.get(key, true);
|
|
@@ -53291,8 +53291,8 @@ var require_Collection = __commonJS({
|
|
|
53291
53291
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
53292
53292
|
* `true` (collections are always returned intact).
|
|
53293
53293
|
*/
|
|
53294
|
-
getIn(
|
|
53295
|
-
const [key, ...rest] =
|
|
53294
|
+
getIn(path42, keepScalar) {
|
|
53295
|
+
const [key, ...rest] = path42;
|
|
53296
53296
|
const node = this.get(key, true);
|
|
53297
53297
|
if (rest.length === 0)
|
|
53298
53298
|
return !keepScalar && identity.isScalar(node) ? node.value : node;
|
|
@@ -53310,8 +53310,8 @@ var require_Collection = __commonJS({
|
|
|
53310
53310
|
/**
|
|
53311
53311
|
* Checks if the collection includes a value with the key `key`.
|
|
53312
53312
|
*/
|
|
53313
|
-
hasIn(
|
|
53314
|
-
const [key, ...rest] =
|
|
53313
|
+
hasIn(path42) {
|
|
53314
|
+
const [key, ...rest] = path42;
|
|
53315
53315
|
if (rest.length === 0)
|
|
53316
53316
|
return this.has(key);
|
|
53317
53317
|
const node = this.get(key, true);
|
|
@@ -53321,8 +53321,8 @@ var require_Collection = __commonJS({
|
|
|
53321
53321
|
* Sets a value in this collection. For `!!set`, `value` needs to be a
|
|
53322
53322
|
* boolean to add/remove the item from the set.
|
|
53323
53323
|
*/
|
|
53324
|
-
setIn(
|
|
53325
|
-
const [key, ...rest] =
|
|
53324
|
+
setIn(path42, value) {
|
|
53325
|
+
const [key, ...rest] = path42;
|
|
53326
53326
|
if (rest.length === 0) {
|
|
53327
53327
|
this.set(key, value);
|
|
53328
53328
|
} else {
|
|
@@ -55826,9 +55826,9 @@ var require_Document = __commonJS({
|
|
|
55826
55826
|
this.contents.add(value);
|
|
55827
55827
|
}
|
|
55828
55828
|
/** Adds a value to the document. */
|
|
55829
|
-
addIn(
|
|
55829
|
+
addIn(path42, value) {
|
|
55830
55830
|
if (assertCollection(this.contents))
|
|
55831
|
-
this.contents.addIn(
|
|
55831
|
+
this.contents.addIn(path42, value);
|
|
55832
55832
|
}
|
|
55833
55833
|
/**
|
|
55834
55834
|
* Create a new `Alias` node, ensuring that the target `node` has the required anchor.
|
|
@@ -55903,14 +55903,14 @@ var require_Document = __commonJS({
|
|
|
55903
55903
|
* Removes a value from the document.
|
|
55904
55904
|
* @returns `true` if the item was found and removed.
|
|
55905
55905
|
*/
|
|
55906
|
-
deleteIn(
|
|
55907
|
-
if (Collection2.isEmptyPath(
|
|
55906
|
+
deleteIn(path42) {
|
|
55907
|
+
if (Collection2.isEmptyPath(path42)) {
|
|
55908
55908
|
if (this.contents == null)
|
|
55909
55909
|
return false;
|
|
55910
55910
|
this.contents = null;
|
|
55911
55911
|
return true;
|
|
55912
55912
|
}
|
|
55913
|
-
return assertCollection(this.contents) ? this.contents.deleteIn(
|
|
55913
|
+
return assertCollection(this.contents) ? this.contents.deleteIn(path42) : false;
|
|
55914
55914
|
}
|
|
55915
55915
|
/**
|
|
55916
55916
|
* Returns item at `key`, or `undefined` if not found. By default unwraps
|
|
@@ -55925,10 +55925,10 @@ var require_Document = __commonJS({
|
|
|
55925
55925
|
* scalar values from their surrounding node; to disable set `keepScalar` to
|
|
55926
55926
|
* `true` (collections are always returned intact).
|
|
55927
55927
|
*/
|
|
55928
|
-
getIn(
|
|
55929
|
-
if (Collection2.isEmptyPath(
|
|
55928
|
+
getIn(path42, keepScalar) {
|
|
55929
|
+
if (Collection2.isEmptyPath(path42))
|
|
55930
55930
|
return !keepScalar && identity.isScalar(this.contents) ? this.contents.value : this.contents;
|
|
55931
|
-
return identity.isCollection(this.contents) ? this.contents.getIn(
|
|
55931
|
+
return identity.isCollection(this.contents) ? this.contents.getIn(path42, keepScalar) : void 0;
|
|
55932
55932
|
}
|
|
55933
55933
|
/**
|
|
55934
55934
|
* Checks if the document includes a value with the key `key`.
|
|
@@ -55939,10 +55939,10 @@ var require_Document = __commonJS({
|
|
|
55939
55939
|
/**
|
|
55940
55940
|
* Checks if the document includes a value at `path`.
|
|
55941
55941
|
*/
|
|
55942
|
-
hasIn(
|
|
55943
|
-
if (Collection2.isEmptyPath(
|
|
55942
|
+
hasIn(path42) {
|
|
55943
|
+
if (Collection2.isEmptyPath(path42))
|
|
55944
55944
|
return this.contents !== void 0;
|
|
55945
|
-
return identity.isCollection(this.contents) ? this.contents.hasIn(
|
|
55945
|
+
return identity.isCollection(this.contents) ? this.contents.hasIn(path42) : false;
|
|
55946
55946
|
}
|
|
55947
55947
|
/**
|
|
55948
55948
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
@@ -55959,13 +55959,13 @@ var require_Document = __commonJS({
|
|
|
55959
55959
|
* Sets a value in this document. For `!!set`, `value` needs to be a
|
|
55960
55960
|
* boolean to add/remove the item from the set.
|
|
55961
55961
|
*/
|
|
55962
|
-
setIn(
|
|
55963
|
-
if (Collection2.isEmptyPath(
|
|
55962
|
+
setIn(path42, value) {
|
|
55963
|
+
if (Collection2.isEmptyPath(path42)) {
|
|
55964
55964
|
this.contents = value;
|
|
55965
55965
|
} else if (this.contents == null) {
|
|
55966
|
-
this.contents = Collection2.collectionFromPath(this.schema, Array.from(
|
|
55966
|
+
this.contents = Collection2.collectionFromPath(this.schema, Array.from(path42), value);
|
|
55967
55967
|
} else if (assertCollection(this.contents)) {
|
|
55968
|
-
this.contents.setIn(
|
|
55968
|
+
this.contents.setIn(path42, value);
|
|
55969
55969
|
}
|
|
55970
55970
|
}
|
|
55971
55971
|
/**
|
|
@@ -57917,9 +57917,9 @@ var require_cst_visit = __commonJS({
|
|
|
57917
57917
|
visit.BREAK = BREAK;
|
|
57918
57918
|
visit.SKIP = SKIP;
|
|
57919
57919
|
visit.REMOVE = REMOVE;
|
|
57920
|
-
visit.itemAtPath = (cst,
|
|
57920
|
+
visit.itemAtPath = (cst, path42) => {
|
|
57921
57921
|
let item = cst;
|
|
57922
|
-
for (const [field, index] of
|
|
57922
|
+
for (const [field, index] of path42) {
|
|
57923
57923
|
const tok = item?.[field];
|
|
57924
57924
|
if (tok && "items" in tok) {
|
|
57925
57925
|
item = tok.items[index];
|
|
@@ -57928,23 +57928,23 @@ var require_cst_visit = __commonJS({
|
|
|
57928
57928
|
}
|
|
57929
57929
|
return item;
|
|
57930
57930
|
};
|
|
57931
|
-
visit.parentCollection = (cst,
|
|
57932
|
-
const parent = visit.itemAtPath(cst,
|
|
57933
|
-
const field =
|
|
57931
|
+
visit.parentCollection = (cst, path42) => {
|
|
57932
|
+
const parent = visit.itemAtPath(cst, path42.slice(0, -1));
|
|
57933
|
+
const field = path42[path42.length - 1][0];
|
|
57934
57934
|
const coll = parent?.[field];
|
|
57935
57935
|
if (coll && "items" in coll)
|
|
57936
57936
|
return coll;
|
|
57937
57937
|
throw new Error("Parent collection not found");
|
|
57938
57938
|
};
|
|
57939
|
-
function _visit(
|
|
57940
|
-
let ctrl = visitor(item,
|
|
57939
|
+
function _visit(path42, item, visitor) {
|
|
57940
|
+
let ctrl = visitor(item, path42);
|
|
57941
57941
|
if (typeof ctrl === "symbol")
|
|
57942
57942
|
return ctrl;
|
|
57943
57943
|
for (const field of ["key", "value"]) {
|
|
57944
57944
|
const token = item[field];
|
|
57945
57945
|
if (token && "items" in token) {
|
|
57946
57946
|
for (let i2 = 0; i2 < token.items.length; ++i2) {
|
|
57947
|
-
const ci = _visit(Object.freeze(
|
|
57947
|
+
const ci = _visit(Object.freeze(path42.concat([[field, i2]])), token.items[i2], visitor);
|
|
57948
57948
|
if (typeof ci === "number")
|
|
57949
57949
|
i2 = ci - 1;
|
|
57950
57950
|
else if (ci === BREAK)
|
|
@@ -57955,10 +57955,10 @@ var require_cst_visit = __commonJS({
|
|
|
57955
57955
|
}
|
|
57956
57956
|
}
|
|
57957
57957
|
if (typeof ctrl === "function" && field === "key")
|
|
57958
|
-
ctrl = ctrl(item,
|
|
57958
|
+
ctrl = ctrl(item, path42);
|
|
57959
57959
|
}
|
|
57960
57960
|
}
|
|
57961
|
-
return typeof ctrl === "function" ? ctrl(item,
|
|
57961
|
+
return typeof ctrl === "function" ? ctrl(item, path42) : ctrl;
|
|
57962
57962
|
}
|
|
57963
57963
|
exports2.visit = visit;
|
|
57964
57964
|
}
|
|
@@ -61444,7 +61444,7 @@ var require_instrumentation3 = __commonJS({
|
|
|
61444
61444
|
"use strict";
|
|
61445
61445
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
61446
61446
|
exports2.AwsLambdaInstrumentation = exports2.AWS_HANDLER_STREAMING_RESPONSE = exports2.AWS_HANDLER_STREAMING_SYMBOL = exports2.lambdaMaxInitInMilliseconds = void 0;
|
|
61447
|
-
var
|
|
61447
|
+
var path42 = __require("path");
|
|
61448
61448
|
var fs39 = __require("fs");
|
|
61449
61449
|
var instrumentation_1 = require_src10();
|
|
61450
61450
|
var api_1 = (init_esm(), __toCommonJS(esm_exports));
|
|
@@ -61485,10 +61485,10 @@ var require_instrumentation3 = __commonJS({
|
|
|
61485
61485
|
this._diag.debug("Skipping lambda instrumentation: no _HANDLER/lambdaHandler or LAMBDA_TASK_ROOT.", { taskRoot, handlerDef });
|
|
61486
61486
|
return [];
|
|
61487
61487
|
}
|
|
61488
|
-
const handler =
|
|
61488
|
+
const handler = path42.basename(handlerDef);
|
|
61489
61489
|
const moduleRoot = handlerDef.substring(0, handlerDef.length - handler.length);
|
|
61490
61490
|
const [module3, functionName] = handler.split(".", 2);
|
|
61491
|
-
let filename =
|
|
61491
|
+
let filename = path42.resolve(taskRoot, moduleRoot, module3);
|
|
61492
61492
|
if (!filename.endsWith(".js")) {
|
|
61493
61493
|
try {
|
|
61494
61494
|
fs39.statSync(`${filename}.js`);
|
|
@@ -65305,15 +65305,15 @@ var require_utils15 = __commonJS({
|
|
|
65305
65305
|
return { isLayerPathStored: true };
|
|
65306
65306
|
};
|
|
65307
65307
|
exports2.storeLayerPath = storeLayerPath;
|
|
65308
|
-
var getRouterPath = (
|
|
65308
|
+
var getRouterPath = (path42, layer) => {
|
|
65309
65309
|
const stackLayer = layer.handle?.stack?.[0];
|
|
65310
65310
|
if (stackLayer?.route?.path) {
|
|
65311
|
-
return `${
|
|
65311
|
+
return `${path42}${stackLayer.route.path}`;
|
|
65312
65312
|
}
|
|
65313
65313
|
if (stackLayer?.handle?.stack) {
|
|
65314
|
-
return (0, exports2.getRouterPath)(
|
|
65314
|
+
return (0, exports2.getRouterPath)(path42, stackLayer);
|
|
65315
65315
|
}
|
|
65316
|
-
return
|
|
65316
|
+
return path42;
|
|
65317
65317
|
};
|
|
65318
65318
|
exports2.getRouterPath = getRouterPath;
|
|
65319
65319
|
var getLayerMetadata = (route, layer, layerPath) => {
|
|
@@ -65395,7 +65395,7 @@ var require_utils15 = __commonJS({
|
|
|
65395
65395
|
};
|
|
65396
65396
|
function getConstructedRoute(req) {
|
|
65397
65397
|
const layersStore = Array.isArray(req[internal_types_1._LAYERS_STORE_PROPERTY]) ? req[internal_types_1._LAYERS_STORE_PROPERTY] : [];
|
|
65398
|
-
const meaningfulPaths = layersStore.filter((
|
|
65398
|
+
const meaningfulPaths = layersStore.filter((path42) => path42 !== "/" && path42 !== "/*");
|
|
65399
65399
|
if (meaningfulPaths.length === 1 && meaningfulPaths[0] === "*") {
|
|
65400
65400
|
return "*";
|
|
65401
65401
|
}
|
|
@@ -65407,7 +65407,7 @@ var require_utils15 = __commonJS({
|
|
|
65407
65407
|
if (layersStore.length === 0) {
|
|
65408
65408
|
return void 0;
|
|
65409
65409
|
}
|
|
65410
|
-
if (layersStore.every((
|
|
65410
|
+
if (layersStore.every((path42) => path42 === "/")) {
|
|
65411
65411
|
return req.originalUrl === "/" ? "/" : void 0;
|
|
65412
65412
|
}
|
|
65413
65413
|
const constructedRoute = getConstructedRoute(req);
|
|
@@ -66410,8 +66410,8 @@ var require_instrumentation12 = __commonJS({
|
|
|
66410
66410
|
}
|
|
66411
66411
|
};
|
|
66412
66412
|
const functionWithOriginalProperties = patchedFunctionWithOriginalProperties(patchedFunction, original);
|
|
66413
|
-
const promisified = function(
|
|
66414
|
-
return new Promise((resolve3) => functionWithOriginalProperties(
|
|
66413
|
+
const promisified = function(path42) {
|
|
66414
|
+
return new Promise((resolve3) => functionWithOriginalProperties(path42, resolve3));
|
|
66415
66415
|
};
|
|
66416
66416
|
Object.defineProperty(promisified, "name", { value: functionName });
|
|
66417
66417
|
Object.defineProperty(functionWithOriginalProperties, util_1.promisify.custom, {
|
|
@@ -66763,23 +66763,23 @@ var require_utils18 = __commonJS({
|
|
|
66763
66763
|
span.setAttribute(AttributeNames_1.AttributeNames.SOURCE, source);
|
|
66764
66764
|
}
|
|
66765
66765
|
exports2.addSpanSource = addSpanSource;
|
|
66766
|
-
function createFieldIfNotExists(tracer2, getConfig, contextValue, info,
|
|
66767
|
-
let field = getField(contextValue,
|
|
66766
|
+
function createFieldIfNotExists(tracer2, getConfig, contextValue, info, path42) {
|
|
66767
|
+
let field = getField(contextValue, path42);
|
|
66768
66768
|
if (field) {
|
|
66769
66769
|
return { field, spanAdded: false };
|
|
66770
66770
|
}
|
|
66771
66771
|
const config2 = getConfig();
|
|
66772
|
-
const parentSpan = config2.flatResolveSpans ? getRootSpan(contextValue) : getParentFieldSpan(contextValue,
|
|
66772
|
+
const parentSpan = config2.flatResolveSpans ? getRootSpan(contextValue) : getParentFieldSpan(contextValue, path42);
|
|
66773
66773
|
field = {
|
|
66774
|
-
span: createResolverSpan(tracer2, getConfig, contextValue, info,
|
|
66774
|
+
span: createResolverSpan(tracer2, getConfig, contextValue, info, path42, parentSpan)
|
|
66775
66775
|
};
|
|
66776
|
-
addField(contextValue,
|
|
66776
|
+
addField(contextValue, path42, field);
|
|
66777
66777
|
return { field, spanAdded: true };
|
|
66778
66778
|
}
|
|
66779
|
-
function createResolverSpan(tracer2, getConfig, contextValue, info,
|
|
66779
|
+
function createResolverSpan(tracer2, getConfig, contextValue, info, path42, parentSpan) {
|
|
66780
66780
|
const attributes = {
|
|
66781
66781
|
[AttributeNames_1.AttributeNames.FIELD_NAME]: info.fieldName,
|
|
66782
|
-
[AttributeNames_1.AttributeNames.FIELD_PATH]:
|
|
66782
|
+
[AttributeNames_1.AttributeNames.FIELD_PATH]: path42.join("."),
|
|
66783
66783
|
[AttributeNames_1.AttributeNames.FIELD_TYPE]: info.returnType.toString(),
|
|
66784
66784
|
[AttributeNames_1.AttributeNames.PARENT_NAME]: info.parentType.name
|
|
66785
66785
|
};
|
|
@@ -66811,15 +66811,15 @@ var require_utils18 = __commonJS({
|
|
|
66811
66811
|
}
|
|
66812
66812
|
}
|
|
66813
66813
|
exports2.getOperation = getOperation;
|
|
66814
|
-
function addField(contextValue,
|
|
66815
|
-
return contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].fields[
|
|
66814
|
+
function addField(contextValue, path42, field) {
|
|
66815
|
+
return contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].fields[path42.join(".")] = field;
|
|
66816
66816
|
}
|
|
66817
|
-
function getField(contextValue,
|
|
66818
|
-
return contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].fields[
|
|
66817
|
+
function getField(contextValue, path42) {
|
|
66818
|
+
return contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].fields[path42.join(".")];
|
|
66819
66819
|
}
|
|
66820
|
-
function getParentFieldSpan(contextValue,
|
|
66821
|
-
for (let i2 =
|
|
66822
|
-
const field = getField(contextValue,
|
|
66820
|
+
function getParentFieldSpan(contextValue, path42) {
|
|
66821
|
+
for (let i2 = path42.length - 1; i2 > 0; i2--) {
|
|
66822
|
+
const field = getField(contextValue, path42.slice(0, i2));
|
|
66823
66823
|
if (field) {
|
|
66824
66824
|
return field.span;
|
|
66825
66825
|
}
|
|
@@ -66829,9 +66829,9 @@ var require_utils18 = __commonJS({
|
|
|
66829
66829
|
function getRootSpan(contextValue) {
|
|
66830
66830
|
return contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL].span;
|
|
66831
66831
|
}
|
|
66832
|
-
function pathToArray(mergeItems,
|
|
66832
|
+
function pathToArray(mergeItems, path42) {
|
|
66833
66833
|
const flattened = [];
|
|
66834
|
-
let curr =
|
|
66834
|
+
let curr = path42;
|
|
66835
66835
|
while (curr) {
|
|
66836
66836
|
let key = curr.key;
|
|
66837
66837
|
if (mergeItems && typeof key === "number") {
|
|
@@ -66984,14 +66984,14 @@ var require_utils18 = __commonJS({
|
|
|
66984
66984
|
if (!contextValue[symbols_1.OTEL_GRAPHQL_DATA_SYMBOL]) {
|
|
66985
66985
|
return fieldResolver.call(this, source, args, contextValue, info);
|
|
66986
66986
|
}
|
|
66987
|
-
const
|
|
66988
|
-
const depth =
|
|
66987
|
+
const path42 = pathToArray(config2.mergeItems, info && info.path);
|
|
66988
|
+
const depth = path42.filter((item) => typeof item === "string").length;
|
|
66989
66989
|
let span;
|
|
66990
66990
|
let shouldEndSpan = false;
|
|
66991
66991
|
if (config2.depth >= 0 && config2.depth < depth) {
|
|
66992
|
-
span = getParentFieldSpan(contextValue,
|
|
66992
|
+
span = getParentFieldSpan(contextValue, path42);
|
|
66993
66993
|
} else {
|
|
66994
|
-
const { field, spanAdded } = createFieldIfNotExists(tracer2, getConfig, contextValue, info,
|
|
66994
|
+
const { field, spanAdded } = createFieldIfNotExists(tracer2, getConfig, contextValue, info, path42);
|
|
66995
66995
|
span = field.span;
|
|
66996
66996
|
shouldEndSpan = spanAdded;
|
|
66997
66997
|
}
|
|
@@ -68679,26 +68679,26 @@ var require_utils21 = __commonJS({
|
|
|
68679
68679
|
const reqUrlObject = requestUrl || {};
|
|
68680
68680
|
const protocol = reqUrlObject.protocol || fallbackProtocol;
|
|
68681
68681
|
const port = (reqUrlObject.port || "").toString();
|
|
68682
|
-
let
|
|
68682
|
+
let path42 = reqUrlObject.path || "/";
|
|
68683
68683
|
let host = reqUrlObject.host || reqUrlObject.hostname || headers.host || "localhost";
|
|
68684
68684
|
if (host.indexOf(":") === -1 && port && port !== "80" && port !== "443") {
|
|
68685
68685
|
host += `:${port}`;
|
|
68686
68686
|
}
|
|
68687
|
-
if (
|
|
68687
|
+
if (path42.includes("?")) {
|
|
68688
68688
|
try {
|
|
68689
|
-
const parsedUrl = new URL(
|
|
68689
|
+
const parsedUrl = new URL(path42, "http://localhost");
|
|
68690
68690
|
const sensitiveParamsToRedact = redactedQueryParams || [];
|
|
68691
68691
|
for (const sensitiveParam of sensitiveParamsToRedact) {
|
|
68692
68692
|
if (parsedUrl.searchParams.get(sensitiveParam)) {
|
|
68693
68693
|
parsedUrl.searchParams.set(sensitiveParam, internal_types_2.STR_REDACTED);
|
|
68694
68694
|
}
|
|
68695
68695
|
}
|
|
68696
|
-
|
|
68696
|
+
path42 = `${parsedUrl.pathname}${parsedUrl.search}`;
|
|
68697
68697
|
} catch {
|
|
68698
68698
|
}
|
|
68699
68699
|
}
|
|
68700
68700
|
const authPart = reqUrlObject.auth ? `${internal_types_2.STR_REDACTED}:${internal_types_2.STR_REDACTED}@` : "";
|
|
68701
|
-
return `${protocol}//${authPart}${host}${
|
|
68701
|
+
return `${protocol}//${authPart}${host}${path42}`;
|
|
68702
68702
|
};
|
|
68703
68703
|
exports2.getAbsoluteUrl = getAbsoluteUrl;
|
|
68704
68704
|
var parseResponseStatus = (kind, statusCode) => {
|
|
@@ -71108,11 +71108,11 @@ var require_instrumentation20 = __commonJS({
|
|
|
71108
71108
|
const router = dispatchLayer.router;
|
|
71109
71109
|
const routesStack = router?.stack ?? [];
|
|
71110
71110
|
for (const pathLayer of routesStack) {
|
|
71111
|
-
const
|
|
71111
|
+
const path42 = pathLayer.path;
|
|
71112
71112
|
const pathStack = pathLayer.stack;
|
|
71113
71113
|
for (let j = 0; j < pathStack.length; j++) {
|
|
71114
71114
|
const routedMiddleware = pathStack[j];
|
|
71115
|
-
pathStack[j] = this._patchLayer(routedMiddleware, true,
|
|
71115
|
+
pathStack[j] = this._patchLayer(routedMiddleware, true, path42);
|
|
71116
71116
|
}
|
|
71117
71117
|
}
|
|
71118
71118
|
return dispatchLayer;
|
|
@@ -76994,8 +76994,8 @@ var require_instrumentation34 = __commonJS({
|
|
|
76994
76994
|
}
|
|
76995
76995
|
_methodPatcher(original, methodName) {
|
|
76996
76996
|
const instrumentation = this;
|
|
76997
|
-
return function(
|
|
76998
|
-
return original.call(this,
|
|
76997
|
+
return function(path42, ...handler) {
|
|
76998
|
+
return original.call(this, path42, ...instrumentation._handlerPatcher({ type: types_1.LayerType.REQUEST_HANDLER, path: path42, methodName }, handler));
|
|
76999
76999
|
};
|
|
77000
77000
|
}
|
|
77001
77001
|
// will return the same type as `handler`, but all functions recursively patched
|
|
@@ -86002,22 +86002,22 @@ var init_from = __esm({
|
|
|
86002
86002
|
init_file();
|
|
86003
86003
|
init_fetch_blob();
|
|
86004
86004
|
({ stat } = fs2);
|
|
86005
|
-
blobFromSync = (
|
|
86006
|
-
blobFrom = (
|
|
86007
|
-
fileFrom = (
|
|
86008
|
-
fileFromSync = (
|
|
86009
|
-
fromBlob = (stat2,
|
|
86010
|
-
path:
|
|
86005
|
+
blobFromSync = (path42, type) => fromBlob(statSync(path42), path42, type);
|
|
86006
|
+
blobFrom = (path42, type) => stat(path42).then((stat2) => fromBlob(stat2, path42, type));
|
|
86007
|
+
fileFrom = (path42, type) => stat(path42).then((stat2) => fromFile(stat2, path42, type));
|
|
86008
|
+
fileFromSync = (path42, type) => fromFile(statSync(path42), path42, type);
|
|
86009
|
+
fromBlob = (stat2, path42, type = "") => new fetch_blob_default([new BlobDataItem({
|
|
86010
|
+
path: path42,
|
|
86011
86011
|
size: stat2.size,
|
|
86012
86012
|
lastModified: stat2.mtimeMs,
|
|
86013
86013
|
start: 0
|
|
86014
86014
|
})], { type });
|
|
86015
|
-
fromFile = (stat2,
|
|
86016
|
-
path:
|
|
86015
|
+
fromFile = (stat2, path42, type = "") => new file_default([new BlobDataItem({
|
|
86016
|
+
path: path42,
|
|
86017
86017
|
size: stat2.size,
|
|
86018
86018
|
lastModified: stat2.mtimeMs,
|
|
86019
86019
|
start: 0
|
|
86020
|
-
})], basename(
|
|
86020
|
+
})], basename(path42), { type, lastModified: stat2.mtimeMs });
|
|
86021
86021
|
BlobDataItem = class _BlobDataItem {
|
|
86022
86022
|
#path;
|
|
86023
86023
|
#start;
|
|
@@ -92016,8 +92016,8 @@ var require_req = __commonJS({
|
|
|
92016
92016
|
if (req.originalUrl) {
|
|
92017
92017
|
_req.url = req.originalUrl;
|
|
92018
92018
|
} else {
|
|
92019
|
-
const
|
|
92020
|
-
_req.url = typeof
|
|
92019
|
+
const path42 = req.path;
|
|
92020
|
+
_req.url = typeof path42 === "string" ? path42 : req.url ? req.url.path || req.url : void 0;
|
|
92021
92021
|
}
|
|
92022
92022
|
if (req.query) {
|
|
92023
92023
|
_req.query = req.query;
|
|
@@ -92182,14 +92182,14 @@ var require_redact = __commonJS({
|
|
|
92182
92182
|
}
|
|
92183
92183
|
return obj;
|
|
92184
92184
|
}
|
|
92185
|
-
function parsePath(
|
|
92185
|
+
function parsePath(path42) {
|
|
92186
92186
|
const parts = [];
|
|
92187
92187
|
let current = "";
|
|
92188
92188
|
let inBrackets = false;
|
|
92189
92189
|
let inQuotes = false;
|
|
92190
92190
|
let quoteChar = "";
|
|
92191
|
-
for (let i2 = 0; i2 <
|
|
92192
|
-
const char =
|
|
92191
|
+
for (let i2 = 0; i2 < path42.length; i2++) {
|
|
92192
|
+
const char = path42[i2];
|
|
92193
92193
|
if (!inBrackets && char === ".") {
|
|
92194
92194
|
if (current) {
|
|
92195
92195
|
parts.push(current);
|
|
@@ -92320,10 +92320,10 @@ var require_redact = __commonJS({
|
|
|
92320
92320
|
return current;
|
|
92321
92321
|
}
|
|
92322
92322
|
function redactPaths(obj, paths, censor, remove = false) {
|
|
92323
|
-
for (const
|
|
92324
|
-
const parts = parsePath(
|
|
92323
|
+
for (const path42 of paths) {
|
|
92324
|
+
const parts = parsePath(path42);
|
|
92325
92325
|
if (parts.includes("*")) {
|
|
92326
|
-
redactWildcardPath(obj, parts, censor,
|
|
92326
|
+
redactWildcardPath(obj, parts, censor, path42, remove);
|
|
92327
92327
|
} else {
|
|
92328
92328
|
if (remove) {
|
|
92329
92329
|
removeKey(obj, parts);
|
|
@@ -92408,8 +92408,8 @@ var require_redact = __commonJS({
|
|
|
92408
92408
|
}
|
|
92409
92409
|
} else {
|
|
92410
92410
|
if (afterWildcard.includes("*")) {
|
|
92411
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
92412
|
-
const fullPath = [...pathArray.slice(0, pathLength), ...
|
|
92411
|
+
const wrappedCensor = typeof censor === "function" ? (value, path42) => {
|
|
92412
|
+
const fullPath = [...pathArray.slice(0, pathLength), ...path42];
|
|
92413
92413
|
return censor(value, fullPath);
|
|
92414
92414
|
} : censor;
|
|
92415
92415
|
redactWildcardPath(current, afterWildcard, wrappedCensor, originalPath, remove);
|
|
@@ -92444,8 +92444,8 @@ var require_redact = __commonJS({
|
|
|
92444
92444
|
return null;
|
|
92445
92445
|
}
|
|
92446
92446
|
const pathStructure = /* @__PURE__ */ new Map();
|
|
92447
|
-
for (const
|
|
92448
|
-
const parts = parsePath(
|
|
92447
|
+
for (const path42 of pathsToClone) {
|
|
92448
|
+
const parts = parsePath(path42);
|
|
92449
92449
|
let current = pathStructure;
|
|
92450
92450
|
for (let i2 = 0; i2 < parts.length; i2++) {
|
|
92451
92451
|
const part = parts[i2];
|
|
@@ -92497,24 +92497,24 @@ var require_redact = __commonJS({
|
|
|
92497
92497
|
}
|
|
92498
92498
|
return cloneSelectively(obj, pathStructure);
|
|
92499
92499
|
}
|
|
92500
|
-
function validatePath(
|
|
92501
|
-
if (typeof
|
|
92500
|
+
function validatePath(path42) {
|
|
92501
|
+
if (typeof path42 !== "string") {
|
|
92502
92502
|
throw new Error("Paths must be (non-empty) strings");
|
|
92503
92503
|
}
|
|
92504
|
-
if (
|
|
92504
|
+
if (path42 === "") {
|
|
92505
92505
|
throw new Error("Invalid redaction path ()");
|
|
92506
92506
|
}
|
|
92507
|
-
if (
|
|
92508
|
-
throw new Error(`Invalid redaction path (${
|
|
92507
|
+
if (path42.includes("..")) {
|
|
92508
|
+
throw new Error(`Invalid redaction path (${path42})`);
|
|
92509
92509
|
}
|
|
92510
|
-
if (
|
|
92511
|
-
throw new Error(`Invalid redaction path (${
|
|
92510
|
+
if (path42.includes(",")) {
|
|
92511
|
+
throw new Error(`Invalid redaction path (${path42})`);
|
|
92512
92512
|
}
|
|
92513
92513
|
let bracketCount = 0;
|
|
92514
92514
|
let inQuotes = false;
|
|
92515
92515
|
let quoteChar = "";
|
|
92516
|
-
for (let i2 = 0; i2 <
|
|
92517
|
-
const char =
|
|
92516
|
+
for (let i2 = 0; i2 < path42.length; i2++) {
|
|
92517
|
+
const char = path42[i2];
|
|
92518
92518
|
if ((char === '"' || char === "'") && bracketCount > 0) {
|
|
92519
92519
|
if (!inQuotes) {
|
|
92520
92520
|
inQuotes = true;
|
|
@@ -92528,20 +92528,20 @@ var require_redact = __commonJS({
|
|
|
92528
92528
|
} else if (char === "]" && !inQuotes) {
|
|
92529
92529
|
bracketCount--;
|
|
92530
92530
|
if (bracketCount < 0) {
|
|
92531
|
-
throw new Error(`Invalid redaction path (${
|
|
92531
|
+
throw new Error(`Invalid redaction path (${path42})`);
|
|
92532
92532
|
}
|
|
92533
92533
|
}
|
|
92534
92534
|
}
|
|
92535
92535
|
if (bracketCount !== 0) {
|
|
92536
|
-
throw new Error(`Invalid redaction path (${
|
|
92536
|
+
throw new Error(`Invalid redaction path (${path42})`);
|
|
92537
92537
|
}
|
|
92538
92538
|
}
|
|
92539
92539
|
function validatePaths(paths) {
|
|
92540
92540
|
if (!Array.isArray(paths)) {
|
|
92541
92541
|
throw new TypeError("paths must be an array");
|
|
92542
92542
|
}
|
|
92543
|
-
for (const
|
|
92544
|
-
validatePath(
|
|
92543
|
+
for (const path42 of paths) {
|
|
92544
|
+
validatePath(path42);
|
|
92545
92545
|
}
|
|
92546
92546
|
}
|
|
92547
92547
|
function slowRedact(options = {}) {
|
|
@@ -92709,8 +92709,8 @@ var require_redaction = __commonJS({
|
|
|
92709
92709
|
if (shape[k] === null) {
|
|
92710
92710
|
o[k] = (value) => topCensor(value, [k]);
|
|
92711
92711
|
} else {
|
|
92712
|
-
const wrappedCensor = typeof censor === "function" ? (value,
|
|
92713
|
-
return censor(value, [k, ...
|
|
92712
|
+
const wrappedCensor = typeof censor === "function" ? (value, path42) => {
|
|
92713
|
+
return censor(value, [k, ...path42]);
|
|
92714
92714
|
} : censor;
|
|
92715
92715
|
o[k] = Redact({
|
|
92716
92716
|
paths: shape[k],
|
|
@@ -92931,7 +92931,7 @@ var require_sonic_boom = __commonJS({
|
|
|
92931
92931
|
var fs39 = __require("fs");
|
|
92932
92932
|
var EventEmitter = __require("events");
|
|
92933
92933
|
var inherits = __require("util").inherits;
|
|
92934
|
-
var
|
|
92934
|
+
var path42 = __require("path");
|
|
92935
92935
|
var sleep3 = require_atomic_sleep();
|
|
92936
92936
|
var assert2 = __require("assert");
|
|
92937
92937
|
var BUSY_WRITE_TIMEOUT = 100;
|
|
@@ -92985,7 +92985,7 @@ var require_sonic_boom = __commonJS({
|
|
|
92985
92985
|
const mode = sonic.mode;
|
|
92986
92986
|
if (sonic.sync) {
|
|
92987
92987
|
try {
|
|
92988
|
-
if (sonic.mkdir) fs39.mkdirSync(
|
|
92988
|
+
if (sonic.mkdir) fs39.mkdirSync(path42.dirname(file2), { recursive: true });
|
|
92989
92989
|
const fd = fs39.openSync(file2, flags, mode);
|
|
92990
92990
|
fileOpened(null, fd);
|
|
92991
92991
|
} catch (err) {
|
|
@@ -92993,7 +92993,7 @@ var require_sonic_boom = __commonJS({
|
|
|
92993
92993
|
throw err;
|
|
92994
92994
|
}
|
|
92995
92995
|
} else if (sonic.mkdir) {
|
|
92996
|
-
fs39.mkdir(
|
|
92996
|
+
fs39.mkdir(path42.dirname(file2), { recursive: true }, (err) => {
|
|
92997
92997
|
if (err) return fileOpened(err);
|
|
92998
92998
|
fs39.open(file2, flags, mode, fileOpened);
|
|
92999
92999
|
});
|
|
@@ -94227,15 +94227,15 @@ var require_transport2 = __commonJS({
|
|
|
94227
94227
|
if (!unquoted) {
|
|
94228
94228
|
return false;
|
|
94229
94229
|
}
|
|
94230
|
-
let
|
|
94231
|
-
if (
|
|
94230
|
+
let path42 = unquoted;
|
|
94231
|
+
if (path42.startsWith("file://")) {
|
|
94232
94232
|
try {
|
|
94233
|
-
|
|
94233
|
+
path42 = fileURLToPath5(path42);
|
|
94234
94234
|
} catch {
|
|
94235
94235
|
return false;
|
|
94236
94236
|
}
|
|
94237
94237
|
}
|
|
94238
|
-
return isAbsolute(
|
|
94238
|
+
return isAbsolute(path42) && !existsSync2(path42);
|
|
94239
94239
|
}
|
|
94240
94240
|
function stripQuotes(value) {
|
|
94241
94241
|
const first = value[0];
|
|
@@ -96468,10 +96468,10 @@ function mergeDefs(...defs) {
|
|
|
96468
96468
|
function cloneDef(schema) {
|
|
96469
96469
|
return mergeDefs(schema._zod.def);
|
|
96470
96470
|
}
|
|
96471
|
-
function getElementAtPath(obj,
|
|
96472
|
-
if (!
|
|
96471
|
+
function getElementAtPath(obj, path42) {
|
|
96472
|
+
if (!path42)
|
|
96473
96473
|
return obj;
|
|
96474
|
-
return
|
|
96474
|
+
return path42.reduce((acc, key) => acc?.[key], obj);
|
|
96475
96475
|
}
|
|
96476
96476
|
function promiseAllObject(promisesObj) {
|
|
96477
96477
|
const keys = Object.keys(promisesObj);
|
|
@@ -96783,11 +96783,11 @@ function aborted(x2, startIndex = 0) {
|
|
|
96783
96783
|
}
|
|
96784
96784
|
return false;
|
|
96785
96785
|
}
|
|
96786
|
-
function prefixIssues(
|
|
96786
|
+
function prefixIssues(path42, issues) {
|
|
96787
96787
|
return issues.map((iss) => {
|
|
96788
96788
|
var _a2;
|
|
96789
96789
|
(_a2 = iss).path ?? (_a2.path = []);
|
|
96790
|
-
iss.path.unshift(
|
|
96790
|
+
iss.path.unshift(path42);
|
|
96791
96791
|
return iss;
|
|
96792
96792
|
});
|
|
96793
96793
|
}
|
|
@@ -97029,7 +97029,7 @@ function formatError(error48, mapper = (issue2) => issue2.message) {
|
|
|
97029
97029
|
}
|
|
97030
97030
|
function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
97031
97031
|
const result = { errors: [] };
|
|
97032
|
-
const processError = (error49,
|
|
97032
|
+
const processError = (error49, path42 = []) => {
|
|
97033
97033
|
var _a2, _b;
|
|
97034
97034
|
for (const issue2 of error49.issues) {
|
|
97035
97035
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
@@ -97039,7 +97039,7 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
97039
97039
|
} else if (issue2.code === "invalid_element") {
|
|
97040
97040
|
processError({ issues: issue2.issues }, issue2.path);
|
|
97041
97041
|
} else {
|
|
97042
|
-
const fullpath = [...
|
|
97042
|
+
const fullpath = [...path42, ...issue2.path];
|
|
97043
97043
|
if (fullpath.length === 0) {
|
|
97044
97044
|
result.errors.push(mapper(issue2));
|
|
97045
97045
|
continue;
|
|
@@ -97071,8 +97071,8 @@ function treeifyError(error48, mapper = (issue2) => issue2.message) {
|
|
|
97071
97071
|
}
|
|
97072
97072
|
function toDotPath(_path) {
|
|
97073
97073
|
const segs = [];
|
|
97074
|
-
const
|
|
97075
|
-
for (const seg of
|
|
97074
|
+
const path42 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
97075
|
+
for (const seg of path42) {
|
|
97076
97076
|
if (typeof seg === "number")
|
|
97077
97077
|
segs.push(`[${seg}]`);
|
|
97078
97078
|
else if (typeof seg === "symbol")
|
|
@@ -109766,13 +109766,13 @@ function resolveRef(ref, ctx) {
|
|
|
109766
109766
|
if (!ref.startsWith("#")) {
|
|
109767
109767
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
109768
109768
|
}
|
|
109769
|
-
const
|
|
109770
|
-
if (
|
|
109769
|
+
const path42 = ref.slice(1).split("/").filter(Boolean);
|
|
109770
|
+
if (path42.length === 0) {
|
|
109771
109771
|
return ctx.rootSchema;
|
|
109772
109772
|
}
|
|
109773
109773
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
109774
|
-
if (
|
|
109775
|
-
const key =
|
|
109774
|
+
if (path42[0] === defsKey) {
|
|
109775
|
+
const key = path42[1];
|
|
109776
109776
|
if (!key || !ctx.defs[key]) {
|
|
109777
109777
|
throw new Error(`Reference not found: ${ref}`);
|
|
109778
109778
|
}
|
|
@@ -111329,8 +111329,8 @@ import fsSync from "node:fs";
|
|
|
111329
111329
|
import path5 from "node:path";
|
|
111330
111330
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
111331
111331
|
function getCurrentVersion() {
|
|
111332
|
-
if ("0.1.
|
|
111333
|
-
return "0.1.
|
|
111332
|
+
if ("0.1.8") {
|
|
111333
|
+
return "0.1.8";
|
|
111334
111334
|
}
|
|
111335
111335
|
try {
|
|
111336
111336
|
const pkgPath = path5.join(THIS_DIR, "..", "..", "package.json");
|
|
@@ -117820,9 +117820,9 @@ var GitLabProvider = class {
|
|
|
117820
117820
|
if (!token) return null;
|
|
117821
117821
|
const os5 = await import("node:os");
|
|
117822
117822
|
const fs39 = await import("node:fs/promises");
|
|
117823
|
-
const
|
|
117824
|
-
const tmpDir = await fs39.mkdtemp(
|
|
117825
|
-
const tmpFile =
|
|
117823
|
+
const path42 = await import("node:path");
|
|
117824
|
+
const tmpDir = await fs39.mkdtemp(path42.join(os5.tmpdir(), "devclaw-upload-"));
|
|
117825
|
+
const tmpFile = path42.join(tmpDir, file2.filename);
|
|
117826
117826
|
await fs39.writeFile(tmpFile, file2.buffer);
|
|
117827
117827
|
try {
|
|
117828
117828
|
const apiBase = webUrl.replace(/\/[^/]+\/[^/]+\/?$/, "");
|
|
@@ -138172,6 +138172,10 @@ var impactStep = {
|
|
|
138172
138172
|
}
|
|
138173
138173
|
};
|
|
138174
138174
|
|
|
138175
|
+
// lib/intake/steps/scaffold.ts
|
|
138176
|
+
import fsNode from "node:fs/promises";
|
|
138177
|
+
import path36 from "node:path";
|
|
138178
|
+
|
|
138175
138179
|
// lib/intake/lib/scaffold-service.ts
|
|
138176
138180
|
init_zod();
|
|
138177
138181
|
init_runtime_paths();
|
|
@@ -138361,89 +138365,36 @@ export PATH="$ROOT_DIR/node_modules/.bin:$PATH"
|
|
|
138361
138365
|
}
|
|
138362
138366
|
function buildPythonBootstrapPrelude() {
|
|
138363
138367
|
return `${buildCommonScriptPrelude()}
|
|
138364
|
-
PYTHON_FILES=()
|
|
138365
|
-
for candidate in pyproject.toml requirements.txt uv.lock; do
|
|
138366
|
-
if [[ -f "$candidate" ]]; then
|
|
138367
|
-
PYTHON_FILES+=("$candidate")
|
|
138368
|
-
fi
|
|
138369
|
-
done
|
|
138370
138368
|
|
|
138371
|
-
|
|
138372
|
-
|
|
138373
|
-
|
|
138369
|
+
# --- Shared toolchain (ruff, mypy, pip-audit) ---
|
|
138370
|
+
TOOLCHAIN="$HOME/.openclaw/toolchains/python"
|
|
138371
|
+
if [ ! -x "$TOOLCHAIN/bin/ruff" ]; then
|
|
138372
|
+
echo "[qa] Toolchain not found \u2014 provisioning..."
|
|
138373
|
+
command -v uv >/dev/null 2>&1 || {
|
|
138374
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
138375
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
138376
|
+
}
|
|
138377
|
+
uv venv "$TOOLCHAIN"
|
|
138378
|
+
uv pip install -p "$TOOLCHAIN/bin/python" ${PYTHON_TOOLCHAIN_PACKAGES.join(" ")}
|
|
138374
138379
|
fi
|
|
138375
|
-
|
|
138376
|
-
|
|
138377
|
-
|
|
138378
|
-
|
|
138379
|
-
|
|
138380
|
-
|
|
138381
|
-
|
|
138382
|
-
|
|
138383
|
-
|
|
138384
|
-
|
|
138385
|
-
|
|
138386
|
-
|
|
138387
|
-
fi
|
|
138388
|
-
|
|
138389
|
-
if "$PYTHON_BIN" -m venv "$VENV_DIR"; then
|
|
138390
|
-
return 0
|
|
138391
|
-
fi
|
|
138392
|
-
|
|
138393
|
-
if ! "$PYTHON_BIN" -m pip --version >/dev/null 2>&1; then
|
|
138394
|
-
echo "Python venv bootstrap failed and pip is unavailable for virtualenv fallback" >&2
|
|
138395
|
-
exit 2
|
|
138396
|
-
fi
|
|
138397
|
-
|
|
138398
|
-
PY_BOOT_DIR="$ROOT_DIR/${BOOTSTRAP_STATE_DIR}/python-bootstrap"
|
|
138399
|
-
mkdir -p "$PY_BOOT_DIR"
|
|
138400
|
-
"$PYTHON_BIN" -m pip install --disable-pip-version-check --target "$PY_BOOT_DIR" "virtualenv>=20.26.0"
|
|
138401
|
-
PYTHONPATH="$PY_BOOT_DIR\${PYTHONPATH:+:$PYTHONPATH}" "$PYTHON_BIN" -m virtualenv "$VENV_DIR"
|
|
138402
|
-
}
|
|
138403
|
-
|
|
138404
|
-
if [[ -x "$VENV_DIR/bin/python" && -f "$STATE_FILE" ]] && [[ "$(cat "$STATE_FILE")" == "$BOOTSTRAP_FINGERPRINT" ]]; then
|
|
138405
|
-
echo "Python test environment already prepared"
|
|
138406
|
-
else
|
|
138407
|
-
if [[ -f uv.lock ]]; then
|
|
138408
|
-
require_cmd uv "uv.lock detected but uv is not installed"
|
|
138409
|
-
uv sync --locked
|
|
138410
|
-
elif command -v uv >/dev/null 2>&1; then
|
|
138411
|
-
uv venv .venv
|
|
138412
|
-
|
|
138413
|
-
if [[ -f requirements.txt ]]; then
|
|
138414
|
-
uv pip install --python .venv/bin/python -r requirements.txt
|
|
138415
|
-
fi
|
|
138416
|
-
|
|
138417
|
-
if [[ -f pyproject.toml ]]; then
|
|
138418
|
-
if grep -Eq '^[[:space:]]*dev[[:space:]]*=' pyproject.toml; then
|
|
138419
|
-
uv pip install --python .venv/bin/python -e '.[dev]'
|
|
138420
|
-
else
|
|
138421
|
-
uv pip install --python .venv/bin/python -e .
|
|
138422
|
-
fi
|
|
138423
|
-
fi
|
|
138424
|
-
else
|
|
138425
|
-
create_python_venv
|
|
138426
|
-
"$VENV_DIR/bin/python" -m pip install --upgrade pip
|
|
138427
|
-
|
|
138428
|
-
if [[ -f requirements.txt ]]; then
|
|
138429
|
-
"$VENV_DIR/bin/python" -m pip install -r requirements.txt
|
|
138430
|
-
fi
|
|
138431
|
-
|
|
138432
|
-
if [[ -f pyproject.toml ]]; then
|
|
138433
|
-
if grep -Eq '^[[:space:]]*dev[[:space:]]*=' pyproject.toml; then
|
|
138434
|
-
"$VENV_DIR/bin/python" -m pip install -e '.[dev]'
|
|
138435
|
-
else
|
|
138436
|
-
"$VENV_DIR/bin/python" -m pip install -e .
|
|
138437
|
-
fi
|
|
138380
|
+
export PATH="$TOOLCHAIN/bin:$PATH"
|
|
138381
|
+
|
|
138382
|
+
# --- Project venv (runtime deps + pytest) ---
|
|
138383
|
+
if [ ! -x ".venv/bin/python" ]; then
|
|
138384
|
+
echo "[qa] .venv not found \u2014 creating..."
|
|
138385
|
+
command -v uv >/dev/null 2>&1 || export PATH="$HOME/.local/bin:$PATH"
|
|
138386
|
+
uv venv .venv
|
|
138387
|
+
if [ -f "pyproject.toml" ]; then
|
|
138388
|
+
if python3 -c "import tomllib; t=tomllib.load(open('pyproject.toml','rb')); t['project']['optional-dependencies']['dev']" 2>/dev/null; then
|
|
138389
|
+
uv pip install -e '.[dev]' --python .venv/bin/python
|
|
138390
|
+
else
|
|
138391
|
+
uv pip install -e . --python .venv/bin/python
|
|
138438
138392
|
fi
|
|
138393
|
+
elif [ -f "requirements.txt" ]; then
|
|
138394
|
+
uv pip install -r requirements.txt --python .venv/bin/python
|
|
138439
138395
|
fi
|
|
138440
|
-
|
|
138441
|
-
printf '%s' "$BOOTSTRAP_FINGERPRINT" > "$STATE_FILE"
|
|
138442
|
-
fi
|
|
138443
|
-
|
|
138444
|
-
if [[ -d "$VENV_DIR/bin" ]]; then
|
|
138445
|
-
export PATH="$VENV_DIR/bin:$PATH"
|
|
138446
138396
|
fi
|
|
138397
|
+
export PATH=".venv/bin:$PATH"
|
|
138447
138398
|
`;
|
|
138448
138399
|
}
|
|
138449
138400
|
function buildQaBootstrapPrelude(stack) {
|
|
@@ -138506,6 +138457,92 @@ async function runAndAssert(runCommand, repoPath, commands, command) {
|
|
|
138506
138457
|
);
|
|
138507
138458
|
}
|
|
138508
138459
|
}
|
|
138460
|
+
var UV_INSTALL_URL = "https://astral.sh/uv/install.sh";
|
|
138461
|
+
async function ensureUv(runCommand, log3) {
|
|
138462
|
+
const emit2 = log3 ?? (() => {
|
|
138463
|
+
});
|
|
138464
|
+
const check2 = await runCommand("uv", ["--version"], { timeout: 1e4 }).catch(() => ({
|
|
138465
|
+
stdout: "",
|
|
138466
|
+
stderr: "",
|
|
138467
|
+
exitCode: 1
|
|
138468
|
+
}));
|
|
138469
|
+
if (check2.exitCode === 0) {
|
|
138470
|
+
emit2(`[test-env] uv already available: ${check2.stdout.trim()}`);
|
|
138471
|
+
return "uv";
|
|
138472
|
+
}
|
|
138473
|
+
emit2("[test-env] uv not found \u2014 installing via official script...");
|
|
138474
|
+
const install = await runCommand("bash", [
|
|
138475
|
+
"-c",
|
|
138476
|
+
`curl -LsSf ${UV_INSTALL_URL} | sh`
|
|
138477
|
+
], { timeout: 12e4 }).catch(() => ({ stdout: "", stderr: "", exitCode: 1 }));
|
|
138478
|
+
if (install.exitCode !== 0) {
|
|
138479
|
+
throw new Error(
|
|
138480
|
+
`Failed to install uv. Install manually: curl -LsSf ${UV_INSTALL_URL} | sh
|
|
138481
|
+
Details: ${(install.stderr || install.stdout || "unknown error").trim()}`
|
|
138482
|
+
);
|
|
138483
|
+
}
|
|
138484
|
+
const verify2 = await runCommand("uv", ["--version"], { timeout: 1e4 }).catch(() => ({
|
|
138485
|
+
stdout: "",
|
|
138486
|
+
stderr: "",
|
|
138487
|
+
exitCode: 1
|
|
138488
|
+
}));
|
|
138489
|
+
if (verify2.exitCode === 0) {
|
|
138490
|
+
emit2(`[test-env] uv installed successfully: ${verify2.stdout.trim()}`);
|
|
138491
|
+
return "uv";
|
|
138492
|
+
}
|
|
138493
|
+
const home = process.env.HOME ?? "";
|
|
138494
|
+
const fallbackPath = path34.join(home, ".local", "bin", "uv");
|
|
138495
|
+
try {
|
|
138496
|
+
await fs34.access(fallbackPath);
|
|
138497
|
+
emit2(`[test-env] uv installed at fallback path: ${fallbackPath}`);
|
|
138498
|
+
return fallbackPath;
|
|
138499
|
+
} catch {
|
|
138500
|
+
throw new Error(
|
|
138501
|
+
`uv installed but not found. Expected at: ${fallbackPath}
|
|
138502
|
+
Install manually: curl -LsSf ${UV_INSTALL_URL} | sh`
|
|
138503
|
+
);
|
|
138504
|
+
}
|
|
138505
|
+
}
|
|
138506
|
+
var PYTHON_TOOLCHAIN_PACKAGES = ["ruff", "mypy", "pip-audit"];
|
|
138507
|
+
var TOOLCHAIN_DIR = ".openclaw/toolchains/python";
|
|
138508
|
+
var TOOLCHAIN_FINGERPRINT_FILE = "toolchain.sha256";
|
|
138509
|
+
function toolchainFingerprint() {
|
|
138510
|
+
return createHash4("sha256").update(PYTHON_TOOLCHAIN_PACKAGES.join(",")).digest("hex");
|
|
138511
|
+
}
|
|
138512
|
+
async function ensurePythonToolchain(runCommand, homeDir) {
|
|
138513
|
+
const home = homeDir ?? process.env.HOME ?? "/tmp";
|
|
138514
|
+
const toolchainPath = path34.join(home, TOOLCHAIN_DIR);
|
|
138515
|
+
const ruffPath = path34.join(toolchainPath, "bin", "ruff");
|
|
138516
|
+
const fingerprintPath = path34.join(toolchainPath, TOOLCHAIN_FINGERPRINT_FILE);
|
|
138517
|
+
const expectedFp = toolchainFingerprint();
|
|
138518
|
+
if (await pathExists(ruffPath)) {
|
|
138519
|
+
try {
|
|
138520
|
+
const currentFp = (await fs34.readFile(fingerprintPath, "utf-8")).trim();
|
|
138521
|
+
if (currentFp === expectedFp) {
|
|
138522
|
+
return toolchainPath;
|
|
138523
|
+
}
|
|
138524
|
+
} catch {
|
|
138525
|
+
}
|
|
138526
|
+
await fs34.rm(toolchainPath, { recursive: true, force: true });
|
|
138527
|
+
}
|
|
138528
|
+
await fs34.mkdir(path34.dirname(toolchainPath), { recursive: true });
|
|
138529
|
+
const venvResult = await runCommand("uv", ["venv", toolchainPath], { timeout: 6e4 });
|
|
138530
|
+
if (venvResult.exitCode !== 0) {
|
|
138531
|
+
throw new Error(`Failed to create toolchain venv: ${venvResult.stderr}`);
|
|
138532
|
+
}
|
|
138533
|
+
const installResult = await runCommand("uv", [
|
|
138534
|
+
"pip",
|
|
138535
|
+
"install",
|
|
138536
|
+
"-p",
|
|
138537
|
+
path34.join(toolchainPath, "bin", "python"),
|
|
138538
|
+
...PYTHON_TOOLCHAIN_PACKAGES
|
|
138539
|
+
], { timeout: 12e4 });
|
|
138540
|
+
if (installResult.exitCode !== 0) {
|
|
138541
|
+
throw new Error(`Failed to install toolchain packages: ${installResult.stderr}`);
|
|
138542
|
+
}
|
|
138543
|
+
await fs34.writeFile(fingerprintPath, expectedFp, "utf-8");
|
|
138544
|
+
return toolchainPath;
|
|
138545
|
+
}
|
|
138509
138546
|
async function hasPyprojectDevExtra(repoPath) {
|
|
138510
138547
|
const pyprojectPath = path34.join(repoPath, "pyproject.toml");
|
|
138511
138548
|
if (!await pathExists(pyprojectPath)) return false;
|
|
@@ -138741,11 +138778,6 @@ async function ensureNodeEnvironment(repoPath, stack, mode, runCommand) {
|
|
|
138741
138778
|
fingerprint: newFingerprint
|
|
138742
138779
|
};
|
|
138743
138780
|
}
|
|
138744
|
-
async function resolvePythonInterpreter(runCommand) {
|
|
138745
|
-
if (await toolExists(runCommand, "python3")) return "python3";
|
|
138746
|
-
if (await toolExists(runCommand, "python")) return "python";
|
|
138747
|
-
return null;
|
|
138748
|
-
}
|
|
138749
138781
|
async function ensurePythonEnvironment(repoPath, stack, runCommand) {
|
|
138750
138782
|
const commandsRun = [];
|
|
138751
138783
|
const fingerprint = await computeFingerprint(repoPath, ["pyproject.toml", "requirements.txt", "uv.lock"]);
|
|
@@ -138758,26 +138790,26 @@ async function ensurePythonEnvironment(repoPath, stack, runCommand) {
|
|
|
138758
138790
|
skipped: true,
|
|
138759
138791
|
stack,
|
|
138760
138792
|
family: "python",
|
|
138761
|
-
toolchain: "
|
|
138762
|
-
packageManager: "
|
|
138793
|
+
toolchain: "uv",
|
|
138794
|
+
packageManager: "uv",
|
|
138763
138795
|
lockfile: await pathExists(path34.join(repoPath, "uv.lock")) ? "uv.lock" : null,
|
|
138764
138796
|
environmentPath: venvPath,
|
|
138765
138797
|
commandsRun,
|
|
138766
138798
|
fingerprint
|
|
138767
138799
|
};
|
|
138768
138800
|
}
|
|
138801
|
+
await ensureUv(runCommand);
|
|
138769
138802
|
const uvLock = await pathExists(path34.join(repoPath, "uv.lock"));
|
|
138770
138803
|
const pyproject = await pathExists(path34.join(repoPath, "pyproject.toml"));
|
|
138771
138804
|
const requirements = await pathExists(path34.join(repoPath, "requirements.txt"));
|
|
138772
|
-
const hasUv = await toolExists(runCommand, "uv");
|
|
138773
138805
|
if (!uvLock && !pyproject && !requirements) {
|
|
138774
138806
|
return {
|
|
138775
138807
|
ready: false,
|
|
138776
138808
|
skipped: false,
|
|
138777
138809
|
stack,
|
|
138778
138810
|
family: "python",
|
|
138779
|
-
toolchain: "
|
|
138780
|
-
packageManager: "
|
|
138811
|
+
toolchain: "uv",
|
|
138812
|
+
packageManager: "uv",
|
|
138781
138813
|
lockfile: null,
|
|
138782
138814
|
environmentPath: null,
|
|
138783
138815
|
commandsRun,
|
|
@@ -138785,22 +138817,8 @@ async function ensurePythonEnvironment(repoPath, stack, runCommand) {
|
|
|
138785
138817
|
reason: "missing_pyproject_or_requirements"
|
|
138786
138818
|
};
|
|
138787
138819
|
}
|
|
138820
|
+
await ensurePythonToolchain(runCommand);
|
|
138788
138821
|
if (uvLock) {
|
|
138789
|
-
if (!hasUv) {
|
|
138790
|
-
return {
|
|
138791
|
-
ready: false,
|
|
138792
|
-
skipped: false,
|
|
138793
|
-
stack,
|
|
138794
|
-
family: "python",
|
|
138795
|
-
toolchain: "python",
|
|
138796
|
-
packageManager: "uv",
|
|
138797
|
-
lockfile: "uv.lock",
|
|
138798
|
-
environmentPath: null,
|
|
138799
|
-
commandsRun,
|
|
138800
|
-
fingerprint,
|
|
138801
|
-
reason: "uv_lock_without_uv"
|
|
138802
|
-
};
|
|
138803
|
-
}
|
|
138804
138822
|
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138805
138823
|
cmd: "uv",
|
|
138806
138824
|
args: ["sync", "--locked"],
|
|
@@ -138812,7 +138830,7 @@ async function ensurePythonEnvironment(repoPath, stack, runCommand) {
|
|
|
138812
138830
|
skipped: false,
|
|
138813
138831
|
stack,
|
|
138814
138832
|
family: "python",
|
|
138815
|
-
toolchain: "
|
|
138833
|
+
toolchain: "uv",
|
|
138816
138834
|
packageManager: "uv",
|
|
138817
138835
|
lockfile: "uv.lock",
|
|
138818
138836
|
environmentPath: venvPath,
|
|
@@ -138820,95 +138838,24 @@ async function ensurePythonEnvironment(repoPath, stack, runCommand) {
|
|
|
138820
138838
|
fingerprint
|
|
138821
138839
|
};
|
|
138822
138840
|
}
|
|
138823
|
-
if (hasUv) {
|
|
138824
|
-
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138825
|
-
cmd: "uv",
|
|
138826
|
-
args: ["venv", ".venv"],
|
|
138827
|
-
reason: "create project-local virtualenv with uv"
|
|
138828
|
-
});
|
|
138829
|
-
if (requirements) {
|
|
138830
|
-
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138831
|
-
cmd: "uv",
|
|
138832
|
-
args: ["pip", "install", "--python", ".venv/bin/python", "-r", "requirements.txt"],
|
|
138833
|
-
reason: "install requirements.txt dependencies with uv"
|
|
138834
|
-
});
|
|
138835
|
-
}
|
|
138836
|
-
if (pyproject) {
|
|
138837
|
-
const hasDevExtra = await hasPyprojectDevExtra(repoPath);
|
|
138838
|
-
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138839
|
-
cmd: "uv",
|
|
138840
|
-
args: ["pip", "install", "--python", ".venv/bin/python", "-e", hasDevExtra ? ".[dev]" : "."],
|
|
138841
|
-
reason: hasDevExtra ? "install editable project with dev extras via uv" : "install editable project via uv"
|
|
138842
|
-
});
|
|
138843
|
-
}
|
|
138844
|
-
if (fingerprint) await writeBootstrapFingerprint(repoPath, fingerprint);
|
|
138845
|
-
return {
|
|
138846
|
-
ready: true,
|
|
138847
|
-
skipped: false,
|
|
138848
|
-
stack,
|
|
138849
|
-
family: "python",
|
|
138850
|
-
toolchain: "python",
|
|
138851
|
-
packageManager: "uv",
|
|
138852
|
-
lockfile: null,
|
|
138853
|
-
environmentPath: venvPath,
|
|
138854
|
-
commandsRun,
|
|
138855
|
-
fingerprint
|
|
138856
|
-
};
|
|
138857
|
-
}
|
|
138858
|
-
const pythonInterpreter = await resolvePythonInterpreter(runCommand);
|
|
138859
|
-
if (!pythonInterpreter) {
|
|
138860
|
-
return {
|
|
138861
|
-
ready: false,
|
|
138862
|
-
skipped: false,
|
|
138863
|
-
stack,
|
|
138864
|
-
family: "python",
|
|
138865
|
-
toolchain: "python",
|
|
138866
|
-
packageManager: "pip",
|
|
138867
|
-
lockfile: null,
|
|
138868
|
-
environmentPath: null,
|
|
138869
|
-
commandsRun,
|
|
138870
|
-
fingerprint,
|
|
138871
|
-
reason: "python_not_available"
|
|
138872
|
-
};
|
|
138873
|
-
}
|
|
138874
138841
|
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138875
|
-
cmd:
|
|
138876
|
-
args: ["
|
|
138877
|
-
reason: "create project-local virtualenv"
|
|
138878
|
-
}).catch(async () => {
|
|
138879
|
-
const bootstrapDir = path34.join(repoPath, BOOTSTRAP_STATE_DIR, "python-bootstrap");
|
|
138880
|
-
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138881
|
-
cmd: pythonInterpreter,
|
|
138882
|
-
args: ["-m", "pip", "install", "--disable-pip-version-check", "--target", bootstrapDir, "virtualenv>=20.26.0"],
|
|
138883
|
-
reason: "install local virtualenv fallback"
|
|
138884
|
-
});
|
|
138885
|
-
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138886
|
-
cmd: pythonInterpreter,
|
|
138887
|
-
args: ["-m", "virtualenv", ".venv"],
|
|
138888
|
-
env: {
|
|
138889
|
-
PYTHONPATH: `${bootstrapDir}${process.env.PYTHONPATH ? `:${process.env.PYTHONPATH}` : ""}`
|
|
138890
|
-
},
|
|
138891
|
-
reason: "create project-local virtualenv with fallback"
|
|
138892
|
-
});
|
|
138893
|
-
});
|
|
138894
|
-
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138895
|
-
cmd: venvPython,
|
|
138896
|
-
args: ["-m", "pip", "install", "--upgrade", "pip"],
|
|
138897
|
-
reason: "upgrade pip in project-local virtualenv"
|
|
138842
|
+
cmd: "uv",
|
|
138843
|
+
args: ["venv", ".venv"],
|
|
138844
|
+
reason: "create project-local virtualenv with uv"
|
|
138898
138845
|
});
|
|
138899
138846
|
if (requirements) {
|
|
138900
138847
|
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138901
|
-
cmd:
|
|
138902
|
-
args: ["
|
|
138903
|
-
reason: "install requirements.txt dependencies"
|
|
138848
|
+
cmd: "uv",
|
|
138849
|
+
args: ["pip", "install", "--python", ".venv/bin/python", "-r", "requirements.txt"],
|
|
138850
|
+
reason: "install requirements.txt dependencies with uv"
|
|
138904
138851
|
});
|
|
138905
138852
|
}
|
|
138906
138853
|
if (pyproject) {
|
|
138907
138854
|
const hasDevExtra = await hasPyprojectDevExtra(repoPath);
|
|
138908
138855
|
await runAndAssert(runCommand, repoPath, commandsRun, {
|
|
138909
|
-
cmd:
|
|
138910
|
-
args: ["
|
|
138911
|
-
reason: hasDevExtra ? "install editable project with dev extras" : "install editable project"
|
|
138856
|
+
cmd: "uv",
|
|
138857
|
+
args: ["pip", "install", "--python", ".venv/bin/python", "-e", hasDevExtra ? ".[dev]" : "."],
|
|
138858
|
+
reason: hasDevExtra ? "install editable project with dev extras via uv" : "install editable project via uv"
|
|
138912
138859
|
});
|
|
138913
138860
|
}
|
|
138914
138861
|
if (fingerprint) await writeBootstrapFingerprint(repoPath, fingerprint);
|
|
@@ -138917,8 +138864,8 @@ async function ensurePythonEnvironment(repoPath, stack, runCommand) {
|
|
|
138917
138864
|
skipped: false,
|
|
138918
138865
|
stack,
|
|
138919
138866
|
family: "python",
|
|
138920
|
-
toolchain: "
|
|
138921
|
-
packageManager: "
|
|
138867
|
+
toolchain: "uv",
|
|
138868
|
+
packageManager: "uv",
|
|
138922
138869
|
lockfile: null,
|
|
138923
138870
|
environmentPath: venvPath,
|
|
138924
138871
|
commandsRun,
|
|
@@ -139064,7 +139011,82 @@ function parseScaffoldOutput(stdout) {
|
|
|
139064
139011
|
return parsed.scaffold;
|
|
139065
139012
|
}
|
|
139066
139013
|
|
|
139014
|
+
// lib/quality/qa-contracts.ts
|
|
139015
|
+
var GATE_NAMES = ["lint", "types", "security", "tests", "coverage"];
|
|
139016
|
+
var COVERAGE_THRESHOLD = 80;
|
|
139017
|
+
function generateQaContract(opts) {
|
|
139018
|
+
const { spec, stack, acceptanceCriteria } = opts;
|
|
139019
|
+
const cmds = getQaGateCommands(stack);
|
|
139020
|
+
const acs = acceptanceCriteria ?? spec.acceptance_criteria;
|
|
139021
|
+
const script = buildQaScript(cmds, stack, acs);
|
|
139022
|
+
return {
|
|
139023
|
+
gates: [...GATE_NAMES],
|
|
139024
|
+
acceptance_tests: acs,
|
|
139025
|
+
script_content: script
|
|
139026
|
+
};
|
|
139027
|
+
}
|
|
139028
|
+
function buildQaScript(cmds, stack, acs) {
|
|
139029
|
+
const acComments = acs.map((ac, i2) => `# AC${i2 + 1}: ${ac}`).join("\n");
|
|
139030
|
+
return `#!/usr/bin/env bash
|
|
139031
|
+
# qa.sh \u2014 Generated QA contract
|
|
139032
|
+
# Stack: ${stack}
|
|
139033
|
+
# Coverage threshold: ${COVERAGE_THRESHOLD}%
|
|
139034
|
+
#
|
|
139035
|
+
# Acceptance Criteria:
|
|
139036
|
+
${acComments}
|
|
139037
|
+
|
|
139038
|
+
set -euo pipefail
|
|
139039
|
+
|
|
139040
|
+
${buildQaBootstrapPrelude(stack)}
|
|
139041
|
+
|
|
139042
|
+
PASS=0
|
|
139043
|
+
FAIL=0
|
|
139044
|
+
|
|
139045
|
+
gate() {
|
|
139046
|
+
local name="$1"
|
|
139047
|
+
shift
|
|
139048
|
+
echo "=== Gate: $name ==="
|
|
139049
|
+
if "$@"; then
|
|
139050
|
+
echo "\u2705 $name PASSED"
|
|
139051
|
+
PASS=$((PASS + 1))
|
|
139052
|
+
else
|
|
139053
|
+
echo "\u274C $name FAILED"
|
|
139054
|
+
FAIL=$((FAIL + 1))
|
|
139055
|
+
fi
|
|
139056
|
+
echo ""
|
|
139057
|
+
}
|
|
139058
|
+
|
|
139059
|
+
# Gate 1: Lint
|
|
139060
|
+
gate "lint" ${cmds.lint}
|
|
139061
|
+
|
|
139062
|
+
# Gate 2: Type checking
|
|
139063
|
+
gate "types" ${cmds.types}
|
|
139064
|
+
|
|
139065
|
+
# Gate 3: Security audit
|
|
139066
|
+
gate "security" ${cmds.security}
|
|
139067
|
+
|
|
139068
|
+
# Gate 4: Tests
|
|
139069
|
+
gate "tests" ${cmds.tests}
|
|
139070
|
+
|
|
139071
|
+
# Gate 5: Coverage (>= ${COVERAGE_THRESHOLD}%)
|
|
139072
|
+
gate "coverage" ${cmds.coverage}
|
|
139073
|
+
|
|
139074
|
+
echo ""
|
|
139075
|
+
echo "=== QA Summary ==="
|
|
139076
|
+
echo "PASS: $PASS / FAIL: $FAIL / TOTAL: $((PASS + FAIL))"
|
|
139077
|
+
|
|
139078
|
+
if [ "$FAIL" -gt 0 ]; then
|
|
139079
|
+
echo "\u274C QA contract FAILED"
|
|
139080
|
+
exit 1
|
|
139081
|
+
else
|
|
139082
|
+
echo "\u2705 QA contract PASSED"
|
|
139083
|
+
exit 0
|
|
139084
|
+
fi
|
|
139085
|
+
`;
|
|
139086
|
+
}
|
|
139087
|
+
|
|
139067
139088
|
// lib/intake/steps/scaffold.ts
|
|
139089
|
+
var PYTHON_STACKS2 = /* @__PURE__ */ new Set(["python-cli", "fastapi", "flask", "django"]);
|
|
139068
139090
|
var scaffoldStep = {
|
|
139069
139091
|
name: "scaffold",
|
|
139070
139092
|
shouldRun: (payload) => payload.impact?.is_greenfield === true && !payload.dry_run,
|
|
@@ -139101,6 +139123,20 @@ var scaffoldStep = {
|
|
|
139101
139123
|
ctx.log(
|
|
139102
139124
|
bootstrap.skipped ? `Scaffold bootstrap already current (${bootstrap.packageManager})` : `Scaffold bootstrap completed (${bootstrap.packageManager})`
|
|
139103
139125
|
);
|
|
139126
|
+
if (scaffold.stack && PYTHON_STACKS2.has(scaffold.stack) && payload.spec) {
|
|
139127
|
+
try {
|
|
139128
|
+
const contract = generateQaContract({
|
|
139129
|
+
spec: payload.spec,
|
|
139130
|
+
stack: scaffold.stack,
|
|
139131
|
+
acceptanceCriteria: payload.spec.acceptance_criteria
|
|
139132
|
+
});
|
|
139133
|
+
const qaPath = path36.join(scaffold.repo_local, "scripts", "qa.sh");
|
|
139134
|
+
await fsNode.mkdir(path36.dirname(qaPath), { recursive: true });
|
|
139135
|
+
await fsNode.writeFile(qaPath, contract.script_content, { mode: 493 });
|
|
139136
|
+
} catch (err) {
|
|
139137
|
+
ctx.log(`Warning: could not write qa.sh: ${err instanceof Error ? err.message : String(err)}`);
|
|
139138
|
+
}
|
|
139139
|
+
}
|
|
139104
139140
|
}
|
|
139105
139141
|
return {
|
|
139106
139142
|
...result.plannedPayload,
|
|
@@ -139132,7 +139168,7 @@ var scaffoldPassthroughStep = {
|
|
|
139132
139168
|
|
|
139133
139169
|
// lib/intake/lib/repository-provision-service.ts
|
|
139134
139170
|
import fs35 from "node:fs/promises";
|
|
139135
|
-
import
|
|
139171
|
+
import path37 from "node:path";
|
|
139136
139172
|
function normalizeText2(value) {
|
|
139137
139173
|
if (typeof value !== "string") return null;
|
|
139138
139174
|
const trimmed = value.trim();
|
|
@@ -139180,7 +139216,7 @@ async function pathExists2(candidate) {
|
|
|
139180
139216
|
}
|
|
139181
139217
|
async function isGitRepository(candidate) {
|
|
139182
139218
|
if (!candidate) return false;
|
|
139183
|
-
return pathExists2(
|
|
139219
|
+
return pathExists2(path37.join(candidate, ".git"));
|
|
139184
139220
|
}
|
|
139185
139221
|
async function resolveLocalRepoRemote(ctx, repoPath) {
|
|
139186
139222
|
const result = await ctx.runCommand("git", ["remote", "get-url", "origin"], {
|
|
@@ -139227,7 +139263,7 @@ async function resolveRepositoryTarget(payload, ctx) {
|
|
|
139227
139263
|
}
|
|
139228
139264
|
if (repoUrl) {
|
|
139229
139265
|
const remote = parseGitHubRemote(repoUrl);
|
|
139230
|
-
const localPath = remote ?
|
|
139266
|
+
const localPath = remote ? path37.join(ctx.homeDir, "git", remote.owner, remote.name) : null;
|
|
139231
139267
|
return {
|
|
139232
139268
|
mode: "remote_only",
|
|
139233
139269
|
remote,
|
|
@@ -139422,80 +139458,6 @@ var registerStep = {
|
|
|
139422
139458
|
}
|
|
139423
139459
|
};
|
|
139424
139460
|
|
|
139425
|
-
// lib/quality/qa-contracts.ts
|
|
139426
|
-
var GATE_NAMES = ["lint", "types", "security", "tests", "coverage"];
|
|
139427
|
-
var COVERAGE_THRESHOLD = 80;
|
|
139428
|
-
function generateQaContract(opts) {
|
|
139429
|
-
const { spec, stack, acceptanceCriteria } = opts;
|
|
139430
|
-
const cmds = getQaGateCommands(stack);
|
|
139431
|
-
const acs = acceptanceCriteria ?? spec.acceptance_criteria;
|
|
139432
|
-
const script = buildQaScript(cmds, stack, acs);
|
|
139433
|
-
return {
|
|
139434
|
-
gates: [...GATE_NAMES],
|
|
139435
|
-
acceptance_tests: acs,
|
|
139436
|
-
script_content: script
|
|
139437
|
-
};
|
|
139438
|
-
}
|
|
139439
|
-
function buildQaScript(cmds, stack, acs) {
|
|
139440
|
-
const acComments = acs.map((ac, i2) => `# AC${i2 + 1}: ${ac}`).join("\n");
|
|
139441
|
-
return `#!/usr/bin/env bash
|
|
139442
|
-
# qa.sh \u2014 Generated QA contract
|
|
139443
|
-
# Stack: ${stack}
|
|
139444
|
-
# Coverage threshold: ${COVERAGE_THRESHOLD}%
|
|
139445
|
-
#
|
|
139446
|
-
# Acceptance Criteria:
|
|
139447
|
-
${acComments}
|
|
139448
|
-
|
|
139449
|
-
set -euo pipefail
|
|
139450
|
-
|
|
139451
|
-
${buildQaBootstrapPrelude(stack)}
|
|
139452
|
-
|
|
139453
|
-
PASS=0
|
|
139454
|
-
FAIL=0
|
|
139455
|
-
|
|
139456
|
-
gate() {
|
|
139457
|
-
local name="$1"
|
|
139458
|
-
shift
|
|
139459
|
-
echo "=== Gate: $name ==="
|
|
139460
|
-
if "$@"; then
|
|
139461
|
-
echo "\u2705 $name PASSED"
|
|
139462
|
-
PASS=$((PASS + 1))
|
|
139463
|
-
else
|
|
139464
|
-
echo "\u274C $name FAILED"
|
|
139465
|
-
FAIL=$((FAIL + 1))
|
|
139466
|
-
fi
|
|
139467
|
-
echo ""
|
|
139468
|
-
}
|
|
139469
|
-
|
|
139470
|
-
# Gate 1: Lint
|
|
139471
|
-
gate "lint" ${cmds.lint}
|
|
139472
|
-
|
|
139473
|
-
# Gate 2: Type checking
|
|
139474
|
-
gate "types" ${cmds.types}
|
|
139475
|
-
|
|
139476
|
-
# Gate 3: Security audit
|
|
139477
|
-
gate "security" ${cmds.security}
|
|
139478
|
-
|
|
139479
|
-
# Gate 4: Tests
|
|
139480
|
-
gate "tests" ${cmds.tests}
|
|
139481
|
-
|
|
139482
|
-
# Gate 5: Coverage (>= ${COVERAGE_THRESHOLD}%)
|
|
139483
|
-
gate "coverage" ${cmds.coverage}
|
|
139484
|
-
|
|
139485
|
-
echo ""
|
|
139486
|
-
echo "=== QA Summary ==="
|
|
139487
|
-
echo "PASS: $PASS / FAIL: $FAIL / TOTAL: $((PASS + FAIL))"
|
|
139488
|
-
|
|
139489
|
-
if [ "$FAIL" -gt 0 ]; then
|
|
139490
|
-
echo "\u274C QA contract FAILED"
|
|
139491
|
-
exit 1
|
|
139492
|
-
else
|
|
139493
|
-
echo "\u2705 QA contract PASSED"
|
|
139494
|
-
exit 0
|
|
139495
|
-
fi
|
|
139496
|
-
`;
|
|
139497
|
-
}
|
|
139498
|
-
|
|
139499
139461
|
// lib/intake/steps/qa-contract.ts
|
|
139500
139462
|
var qaContractStep = {
|
|
139501
139463
|
name: "qa-contract",
|
|
@@ -140654,25 +140616,25 @@ function getPendingQuestions(payload, answers = payload.answers ?? {}) {
|
|
|
140654
140616
|
var import_yaml4 = __toESM(require_dist(), 1);
|
|
140655
140617
|
init_migrate_layout();
|
|
140656
140618
|
import fs36 from "node:fs/promises";
|
|
140657
|
-
import
|
|
140619
|
+
import path38 from "node:path";
|
|
140658
140620
|
init_roles();
|
|
140659
140621
|
async function runDoctor(opts) {
|
|
140660
140622
|
const checks = [];
|
|
140661
140623
|
const { workspacePath, fix = false } = opts;
|
|
140662
140624
|
await migrateWorkspaceLayout(workspacePath);
|
|
140663
|
-
const dataDir =
|
|
140625
|
+
const dataDir = path38.join(workspacePath, DATA_DIR);
|
|
140664
140626
|
checks.push(await checkDirExists(dataDir, `Data directory (${DATA_DIR}/)`));
|
|
140665
|
-
checks.push(await checkFileExists(
|
|
140666
|
-
checks.push(await checkFileExists(
|
|
140667
|
-
checks.push(await checkDirExists(
|
|
140668
|
-
checks.push(await checkDirExists(
|
|
140669
|
-
checks.push(await checkDirExists(
|
|
140627
|
+
checks.push(await checkFileExists(path38.join(dataDir, "projects.json"), "projects.json"));
|
|
140628
|
+
checks.push(await checkFileExists(path38.join(dataDir, "workflow.yaml"), "workflow.yaml"));
|
|
140629
|
+
checks.push(await checkDirExists(path38.join(dataDir, "prompts"), "prompts/"));
|
|
140630
|
+
checks.push(await checkDirExists(path38.join(dataDir, "projects"), "projects/"));
|
|
140631
|
+
checks.push(await checkDirExists(path38.join(dataDir, "log"), "log/"));
|
|
140670
140632
|
for (const file2 of ["AGENTS.md", "HEARTBEAT.md", "TOOLS.md"]) {
|
|
140671
|
-
checks.push(await checkFileExists(
|
|
140633
|
+
checks.push(await checkFileExists(path38.join(workspacePath, file2), file2));
|
|
140672
140634
|
}
|
|
140673
140635
|
for (const role of getAllRoleIds()) {
|
|
140674
140636
|
checks.push(await checkFileExists(
|
|
140675
|
-
|
|
140637
|
+
path38.join(dataDir, "prompts", `${role}.md`),
|
|
140676
140638
|
`prompts/${role}.md`
|
|
140677
140639
|
));
|
|
140678
140640
|
}
|
|
@@ -140752,7 +140714,7 @@ async function checkFileExists(filePath, label) {
|
|
|
140752
140714
|
}
|
|
140753
140715
|
}
|
|
140754
140716
|
async function checkWorkflowYaml(dataDir) {
|
|
140755
|
-
const filePath =
|
|
140717
|
+
const filePath = path38.join(dataDir, "workflow.yaml");
|
|
140756
140718
|
try {
|
|
140757
140719
|
const content = await fs36.readFile(filePath, "utf-8");
|
|
140758
140720
|
const parsed = import_yaml4.default.parse(content);
|
|
@@ -140771,7 +140733,7 @@ async function checkWorkflowYaml(dataDir) {
|
|
|
140771
140733
|
}
|
|
140772
140734
|
}
|
|
140773
140735
|
async function checkProjectsJson(dataDir) {
|
|
140774
|
-
const filePath =
|
|
140736
|
+
const filePath = path38.join(dataDir, "projects.json");
|
|
140775
140737
|
try {
|
|
140776
140738
|
const content = await fs36.readFile(filePath, "utf-8");
|
|
140777
140739
|
const parsed = JSON.parse(content);
|
|
@@ -140846,7 +140808,7 @@ function checkGitHubWebhookMode(pluginConfig) {
|
|
|
140846
140808
|
}
|
|
140847
140809
|
async function checkProjects(dataDir) {
|
|
140848
140810
|
const results = [];
|
|
140849
|
-
const filePath =
|
|
140811
|
+
const filePath = path38.join(dataDir, "projects.json");
|
|
140850
140812
|
let data;
|
|
140851
140813
|
try {
|
|
140852
140814
|
const content = await fs36.readFile(filePath, "utf-8");
|
|
@@ -140886,8 +140848,8 @@ async function checkProjects(dataDir) {
|
|
|
140886
140848
|
message: `Project "${slug}" missing repo field`
|
|
140887
140849
|
});
|
|
140888
140850
|
}
|
|
140889
|
-
if (project.repo &&
|
|
140890
|
-
const qaPath =
|
|
140851
|
+
if (project.repo && path38.isAbsolute(project.repo)) {
|
|
140852
|
+
const qaPath = path38.join(project.repo, "scripts", "qa.sh");
|
|
140891
140853
|
try {
|
|
140892
140854
|
await fs36.access(qaPath);
|
|
140893
140855
|
} catch {
|
|
@@ -141014,7 +140976,7 @@ function formatMetrics(metrics2) {
|
|
|
141014
140976
|
// lib/setup/security-doctor.ts
|
|
141015
140977
|
init_migrate_layout();
|
|
141016
140978
|
import fs37 from "node:fs/promises";
|
|
141017
|
-
import
|
|
140979
|
+
import path39 from "node:path";
|
|
141018
140980
|
var LEGACY_EXTENSION_PATH_PATTERNS = [
|
|
141019
140981
|
"/extensions/secureclaw/",
|
|
141020
140982
|
"/extensions/devclaw/",
|
|
@@ -141033,10 +140995,10 @@ function summarize(checks) {
|
|
|
141033
140995
|
}
|
|
141034
140996
|
async function runSecurityDoctor(openclawHome) {
|
|
141035
140997
|
const checks = [];
|
|
141036
|
-
const configPath =
|
|
141037
|
-
const jobsPath =
|
|
141038
|
-
const workspacePath =
|
|
141039
|
-
const checklistPath =
|
|
140998
|
+
const configPath = path39.join(openclawHome, "openclaw.json");
|
|
140999
|
+
const jobsPath = path39.join(openclawHome, "cron", "jobs.json");
|
|
141000
|
+
const workspacePath = path39.join(openclawHome, "workspace");
|
|
141001
|
+
const checklistPath = path39.join(workspacePath, DATA_DIR, "prompts", "security-checklist.md");
|
|
141040
141002
|
let config2 = null;
|
|
141041
141003
|
try {
|
|
141042
141004
|
config2 = JSON.parse(await fs37.readFile(configPath, "utf-8"));
|
|
@@ -142075,13 +142037,13 @@ import { homedir as homedir3 } from "node:os";
|
|
|
142075
142037
|
init_migrate_layout();
|
|
142076
142038
|
import { createHash as createHash6 } from "node:crypto";
|
|
142077
142039
|
import fs38 from "node:fs/promises";
|
|
142078
|
-
import
|
|
142040
|
+
import path40 from "node:path";
|
|
142079
142041
|
var SESSION_TTL_MS = 10 * 6e4;
|
|
142080
142042
|
function sessionsDir(workspaceDir) {
|
|
142081
|
-
return
|
|
142043
|
+
return path40.join(workspaceDir, DATA_DIR, "bootstrap-sessions");
|
|
142082
142044
|
}
|
|
142083
142045
|
function sessionPath(workspaceDir, conversationId) {
|
|
142084
|
-
return
|
|
142046
|
+
return path40.join(sessionsDir(workspaceDir), `${conversationId}.json`);
|
|
142085
142047
|
}
|
|
142086
142048
|
function stableHash(input) {
|
|
142087
142049
|
return createHash6("sha256").update(input).digest("hex").slice(0, 16);
|
|
@@ -142225,7 +142187,7 @@ function parseBootstrapRequest(text) {
|
|
|
142225
142187
|
function isBootstrapCandidate(text) {
|
|
142226
142188
|
const lower2 = text.toLowerCase();
|
|
142227
142189
|
if (/^\s*(project name|nome do projeto|repository url|repo url|stack)\s*:/im.test(text)) return true;
|
|
142228
|
-
const createCue = /\b(crie|criar|create|register|registre|novo projeto|new project)\b/.test(lower2);
|
|
142190
|
+
const createCue = /\b(crie|cria|criar|create|register|registre|construa|desenvolva|novo projeto|new project)\b/.test(lower2);
|
|
142229
142191
|
const softwareCue = /\b(projeto|project|cli|api|app|aplicativo|servi[cç]o|library|biblioteca|repo|reposit[oó]rio)\b/.test(lower2);
|
|
142230
142192
|
return createCue && softwareCue;
|
|
142231
142193
|
}
|
|
@@ -142614,7 +142576,7 @@ function registerTelegramBootstrapHook(api, ctx) {
|
|
|
142614
142576
|
|
|
142615
142577
|
// lib/github/register-webhook-route.ts
|
|
142616
142578
|
init_store_factory();
|
|
142617
|
-
import
|
|
142579
|
+
import path41 from "node:path";
|
|
142618
142580
|
|
|
142619
142581
|
// lib/github/webhook.ts
|
|
142620
142582
|
init_zod();
|
|
@@ -142877,7 +142839,7 @@ function registerGitHubWebhookRoute(api, ctx) {
|
|
|
142877
142839
|
}
|
|
142878
142840
|
});
|
|
142879
142841
|
if ("child" in routeLogger) {
|
|
142880
|
-
routeLogger.child({ webhookPath:
|
|
142842
|
+
routeLogger.child({ webhookPath: path41.posix.normalize(webhookPath), workspaceDir }).info("GitHub webhook route registered");
|
|
142881
142843
|
}
|
|
142882
142844
|
}
|
|
142883
142845
|
|