@floless/app 0.23.1 → 0.23.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/floless-server.cjs
CHANGED
|
@@ -5489,7 +5489,7 @@ var require_thread_stream = __commonJS({
|
|
|
5489
5489
|
var { version } = require_package();
|
|
5490
5490
|
var { EventEmitter: EventEmitter2 } = require("events");
|
|
5491
5491
|
var { Worker } = require("worker_threads");
|
|
5492
|
-
var { join:
|
|
5492
|
+
var { join: join25 } = require("path");
|
|
5493
5493
|
var { pathToFileURL } = require("url");
|
|
5494
5494
|
var { wait } = require_wait();
|
|
5495
5495
|
var {
|
|
@@ -5540,7 +5540,7 @@ var require_thread_stream = __commonJS({
|
|
|
5540
5540
|
function createWorker(stream, opts) {
|
|
5541
5541
|
const { filename, workerData } = opts;
|
|
5542
5542
|
const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
|
|
5543
|
-
const toExecute = bundlerOverrides["thread-stream-worker"] ||
|
|
5543
|
+
const toExecute = bundlerOverrides["thread-stream-worker"] || join25(__dirname, "lib", "worker.js");
|
|
5544
5544
|
const worker = new Worker(toExecute, {
|
|
5545
5545
|
...opts.workerOpts,
|
|
5546
5546
|
name: opts.workerOpts?.name || "thread-stream",
|
|
@@ -6006,9 +6006,9 @@ var require_transport = __commonJS({
|
|
|
6006
6006
|
"node_modules/pino/lib/transport.js"(exports2, module2) {
|
|
6007
6007
|
"use strict";
|
|
6008
6008
|
var { createRequire: createRequire4 } = require("module");
|
|
6009
|
-
var { existsSync:
|
|
6009
|
+
var { existsSync: existsSync23 } = require("node:fs");
|
|
6010
6010
|
var getCallers = require_caller();
|
|
6011
|
-
var { join:
|
|
6011
|
+
var { join: join25, isAbsolute: isAbsolute2, sep: sep4 } = require("node:path");
|
|
6012
6012
|
var { fileURLToPath: fileURLToPath4 } = require("node:url");
|
|
6013
6013
|
var sleep = require_atomic_sleep();
|
|
6014
6014
|
var onExit = require_on_exit_leak_free();
|
|
@@ -6080,7 +6080,7 @@ var require_transport = __commonJS({
|
|
|
6080
6080
|
return false;
|
|
6081
6081
|
}
|
|
6082
6082
|
}
|
|
6083
|
-
return isAbsolute2(path) && !
|
|
6083
|
+
return isAbsolute2(path) && !existsSync23(path);
|
|
6084
6084
|
}
|
|
6085
6085
|
function stripQuotes(value) {
|
|
6086
6086
|
const first = value[0];
|
|
@@ -6161,7 +6161,7 @@ var require_transport = __commonJS({
|
|
|
6161
6161
|
throw new Error("only one of target or targets can be specified");
|
|
6162
6162
|
}
|
|
6163
6163
|
if (targets) {
|
|
6164
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
6164
|
+
target = bundlerOverrides["pino-worker"] || join25(__dirname, "worker.js");
|
|
6165
6165
|
options.targets = targets.filter((dest) => dest.target).map((dest) => {
|
|
6166
6166
|
return {
|
|
6167
6167
|
...dest,
|
|
@@ -6179,7 +6179,7 @@ var require_transport = __commonJS({
|
|
|
6179
6179
|
});
|
|
6180
6180
|
});
|
|
6181
6181
|
} else if (pipeline2) {
|
|
6182
|
-
target = bundlerOverrides["pino-worker"] ||
|
|
6182
|
+
target = bundlerOverrides["pino-worker"] || join25(__dirname, "worker.js");
|
|
6183
6183
|
options.pipelines = [pipeline2.map((dest) => {
|
|
6184
6184
|
return {
|
|
6185
6185
|
...dest,
|
|
@@ -6202,7 +6202,7 @@ var require_transport = __commonJS({
|
|
|
6202
6202
|
return origin;
|
|
6203
6203
|
}
|
|
6204
6204
|
if (origin === "pino/file") {
|
|
6205
|
-
return
|
|
6205
|
+
return join25(__dirname, "..", "file.js");
|
|
6206
6206
|
}
|
|
6207
6207
|
let fixTarget2;
|
|
6208
6208
|
for (const filePath of callers) {
|
|
@@ -6317,14 +6317,14 @@ var require_tools = __commonJS({
|
|
|
6317
6317
|
}
|
|
6318
6318
|
return point < 32 ? JSON.stringify(str) : '"' + result + '"';
|
|
6319
6319
|
}
|
|
6320
|
-
function asJson(obj, msg,
|
|
6320
|
+
function asJson(obj, msg, num2, time) {
|
|
6321
6321
|
if (asJsonChan.hasSubscribers === false) {
|
|
6322
|
-
return _asJson.call(this, obj, msg,
|
|
6322
|
+
return _asJson.call(this, obj, msg, num2, time);
|
|
6323
6323
|
}
|
|
6324
6324
|
const store = { instance: this, arguments };
|
|
6325
|
-
return asJsonChan.traceSync(_asJson, store, this, obj, msg,
|
|
6325
|
+
return asJsonChan.traceSync(_asJson, store, this, obj, msg, num2, time);
|
|
6326
6326
|
}
|
|
6327
|
-
function _asJson(obj, msg,
|
|
6327
|
+
function _asJson(obj, msg, num2, time) {
|
|
6328
6328
|
const stringify2 = this[stringifySym];
|
|
6329
6329
|
const stringifySafe = this[stringifySafeSym];
|
|
6330
6330
|
const stringifiers = this[stringifiersSym];
|
|
@@ -6334,7 +6334,7 @@ var require_tools = __commonJS({
|
|
|
6334
6334
|
const formatters = this[formattersSym];
|
|
6335
6335
|
const messageKey = this[messageKeySym];
|
|
6336
6336
|
const errorKey = this[errorKeySym];
|
|
6337
|
-
let data = this[lsCacheSym][
|
|
6337
|
+
let data = this[lsCacheSym][num2] + time;
|
|
6338
6338
|
data = data + chindings;
|
|
6339
6339
|
let value;
|
|
6340
6340
|
if (formatters.log) {
|
|
@@ -6959,7 +6959,7 @@ var require_proto = __commonJS({
|
|
|
6959
6959
|
function defaultMixinMergeStrategy(mergeObject, mixinObject) {
|
|
6960
6960
|
return Object.assign(mixinObject, mergeObject);
|
|
6961
6961
|
}
|
|
6962
|
-
function write(_obj, msg,
|
|
6962
|
+
function write(_obj, msg, num2) {
|
|
6963
6963
|
const t = this[timeSym]();
|
|
6964
6964
|
const mixin = this[mixinSym];
|
|
6965
6965
|
const errorKey = this[errorKeySym];
|
|
@@ -6981,12 +6981,12 @@ var require_proto = __commonJS({
|
|
|
6981
6981
|
}
|
|
6982
6982
|
}
|
|
6983
6983
|
if (mixin) {
|
|
6984
|
-
obj = mixinMergeStrategy(obj, mixin(obj,
|
|
6984
|
+
obj = mixinMergeStrategy(obj, mixin(obj, num2, this));
|
|
6985
6985
|
}
|
|
6986
|
-
const s = this[asJsonSym](obj, msg,
|
|
6986
|
+
const s = this[asJsonSym](obj, msg, num2, t);
|
|
6987
6987
|
const stream = this[streamSym];
|
|
6988
6988
|
if (stream[needsMetadataGsym] === true) {
|
|
6989
|
-
stream.lastLevel =
|
|
6989
|
+
stream.lastLevel = num2;
|
|
6990
6990
|
stream.lastObj = obj;
|
|
6991
6991
|
stream.lastMsg = msg;
|
|
6992
6992
|
stream.lastTime = t.slice(this[timeSliceIndexSym]);
|
|
@@ -7182,7 +7182,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
7182
7182
|
return circularValue;
|
|
7183
7183
|
}
|
|
7184
7184
|
let res = "";
|
|
7185
|
-
let
|
|
7185
|
+
let join25 = ",";
|
|
7186
7186
|
const originalIndentation = indentation;
|
|
7187
7187
|
if (Array.isArray(value)) {
|
|
7188
7188
|
if (value.length === 0) {
|
|
@@ -7196,7 +7196,7 @@ var require_safe_stable_stringify = __commonJS({
|
|
|
7196
7196
|
indentation += spacer;
|
|
7197
7197
|
res += `
|
|
7198
7198
|
${indentation}`;
|
|
7199
|
-
|
|
7199
|
+
join25 = `,
|
|
7200
7200
|
${indentation}`;
|
|
7201
7201
|
}
|
|
7202
7202
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -7204,13 +7204,13 @@ ${indentation}`;
|
|
|
7204
7204
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
7205
7205
|
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
7206
7206
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7207
|
-
res +=
|
|
7207
|
+
res += join25;
|
|
7208
7208
|
}
|
|
7209
7209
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
7210
7210
|
res += tmp !== void 0 ? tmp : "null";
|
|
7211
7211
|
if (value.length - 1 > maximumBreadth) {
|
|
7212
7212
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
7213
|
-
res += `${
|
|
7213
|
+
res += `${join25}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
7214
7214
|
}
|
|
7215
7215
|
if (spacer !== "") {
|
|
7216
7216
|
res += `
|
|
@@ -7231,7 +7231,7 @@ ${originalIndentation}`;
|
|
|
7231
7231
|
let separator = "";
|
|
7232
7232
|
if (spacer !== "") {
|
|
7233
7233
|
indentation += spacer;
|
|
7234
|
-
|
|
7234
|
+
join25 = `,
|
|
7235
7235
|
${indentation}`;
|
|
7236
7236
|
whitespace = " ";
|
|
7237
7237
|
}
|
|
@@ -7245,13 +7245,13 @@ ${indentation}`;
|
|
|
7245
7245
|
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
7246
7246
|
if (tmp !== void 0) {
|
|
7247
7247
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
7248
|
-
separator =
|
|
7248
|
+
separator = join25;
|
|
7249
7249
|
}
|
|
7250
7250
|
}
|
|
7251
7251
|
if (keyLength > maximumBreadth) {
|
|
7252
7252
|
const removedKeys = keyLength - maximumBreadth;
|
|
7253
7253
|
res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
|
|
7254
|
-
separator =
|
|
7254
|
+
separator = join25;
|
|
7255
7255
|
}
|
|
7256
7256
|
if (spacer !== "" && separator.length > 1) {
|
|
7257
7257
|
res = `
|
|
@@ -7292,7 +7292,7 @@ ${originalIndentation}`;
|
|
|
7292
7292
|
}
|
|
7293
7293
|
const originalIndentation = indentation;
|
|
7294
7294
|
let res = "";
|
|
7295
|
-
let
|
|
7295
|
+
let join25 = ",";
|
|
7296
7296
|
if (Array.isArray(value)) {
|
|
7297
7297
|
if (value.length === 0) {
|
|
7298
7298
|
return "[]";
|
|
@@ -7305,7 +7305,7 @@ ${originalIndentation}`;
|
|
|
7305
7305
|
indentation += spacer;
|
|
7306
7306
|
res += `
|
|
7307
7307
|
${indentation}`;
|
|
7308
|
-
|
|
7308
|
+
join25 = `,
|
|
7309
7309
|
${indentation}`;
|
|
7310
7310
|
}
|
|
7311
7311
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
@@ -7313,13 +7313,13 @@ ${indentation}`;
|
|
|
7313
7313
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
7314
7314
|
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
7315
7315
|
res += tmp2 !== void 0 ? tmp2 : "null";
|
|
7316
|
-
res +=
|
|
7316
|
+
res += join25;
|
|
7317
7317
|
}
|
|
7318
7318
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
7319
7319
|
res += tmp !== void 0 ? tmp : "null";
|
|
7320
7320
|
if (value.length - 1 > maximumBreadth) {
|
|
7321
7321
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
7322
|
-
res += `${
|
|
7322
|
+
res += `${join25}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
7323
7323
|
}
|
|
7324
7324
|
if (spacer !== "") {
|
|
7325
7325
|
res += `
|
|
@@ -7332,7 +7332,7 @@ ${originalIndentation}`;
|
|
|
7332
7332
|
let whitespace = "";
|
|
7333
7333
|
if (spacer !== "") {
|
|
7334
7334
|
indentation += spacer;
|
|
7335
|
-
|
|
7335
|
+
join25 = `,
|
|
7336
7336
|
${indentation}`;
|
|
7337
7337
|
whitespace = " ";
|
|
7338
7338
|
}
|
|
@@ -7341,7 +7341,7 @@ ${indentation}`;
|
|
|
7341
7341
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
7342
7342
|
if (tmp !== void 0) {
|
|
7343
7343
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
7344
|
-
separator =
|
|
7344
|
+
separator = join25;
|
|
7345
7345
|
}
|
|
7346
7346
|
}
|
|
7347
7347
|
if (spacer !== "" && separator.length > 1) {
|
|
@@ -7399,20 +7399,20 @@ ${originalIndentation}`;
|
|
|
7399
7399
|
indentation += spacer;
|
|
7400
7400
|
let res2 = `
|
|
7401
7401
|
${indentation}`;
|
|
7402
|
-
const
|
|
7402
|
+
const join26 = `,
|
|
7403
7403
|
${indentation}`;
|
|
7404
7404
|
const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
|
|
7405
7405
|
let i = 0;
|
|
7406
7406
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
7407
7407
|
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
7408
7408
|
res2 += tmp2 !== void 0 ? tmp2 : "null";
|
|
7409
|
-
res2 +=
|
|
7409
|
+
res2 += join26;
|
|
7410
7410
|
}
|
|
7411
7411
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
7412
7412
|
res2 += tmp !== void 0 ? tmp : "null";
|
|
7413
7413
|
if (value.length - 1 > maximumBreadth) {
|
|
7414
7414
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
7415
|
-
res2 += `${
|
|
7415
|
+
res2 += `${join26}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
7416
7416
|
}
|
|
7417
7417
|
res2 += `
|
|
7418
7418
|
${originalIndentation}`;
|
|
@@ -7428,16 +7428,16 @@ ${originalIndentation}`;
|
|
|
7428
7428
|
return '"[Object]"';
|
|
7429
7429
|
}
|
|
7430
7430
|
indentation += spacer;
|
|
7431
|
-
const
|
|
7431
|
+
const join25 = `,
|
|
7432
7432
|
${indentation}`;
|
|
7433
7433
|
let res = "";
|
|
7434
7434
|
let separator = "";
|
|
7435
7435
|
let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
|
|
7436
7436
|
if (isTypedArrayWithEntries(value)) {
|
|
7437
|
-
res += stringifyTypedArray(value,
|
|
7437
|
+
res += stringifyTypedArray(value, join25, maximumBreadth);
|
|
7438
7438
|
keys = keys.slice(value.length);
|
|
7439
7439
|
maximumPropertiesToStringify -= value.length;
|
|
7440
|
-
separator =
|
|
7440
|
+
separator = join25;
|
|
7441
7441
|
}
|
|
7442
7442
|
if (deterministic) {
|
|
7443
7443
|
keys = sort(keys, comparator);
|
|
@@ -7448,13 +7448,13 @@ ${indentation}`;
|
|
|
7448
7448
|
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
7449
7449
|
if (tmp !== void 0) {
|
|
7450
7450
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
7451
|
-
separator =
|
|
7451
|
+
separator = join25;
|
|
7452
7452
|
}
|
|
7453
7453
|
}
|
|
7454
7454
|
if (keyLength > maximumBreadth) {
|
|
7455
7455
|
const removedKeys = keyLength - maximumBreadth;
|
|
7456
7456
|
res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
|
|
7457
|
-
separator =
|
|
7457
|
+
separator = join25;
|
|
7458
7458
|
}
|
|
7459
7459
|
if (separator !== "") {
|
|
7460
7460
|
res = `
|
|
@@ -8513,13 +8513,13 @@ var require_serializer = __commonJS({
|
|
|
8513
8513
|
return "" + integer;
|
|
8514
8514
|
}
|
|
8515
8515
|
asNumber(i) {
|
|
8516
|
-
const
|
|
8517
|
-
if (
|
|
8516
|
+
const num2 = Number(i);
|
|
8517
|
+
if (num2 !== num2) {
|
|
8518
8518
|
throw new Error(`The value "${i}" cannot be converted to a number.`);
|
|
8519
|
-
} else if (
|
|
8519
|
+
} else if (num2 === Infinity || num2 === -Infinity) {
|
|
8520
8520
|
return "null";
|
|
8521
8521
|
} else {
|
|
8522
|
-
return "" +
|
|
8522
|
+
return "" + num2;
|
|
8523
8523
|
}
|
|
8524
8524
|
}
|
|
8525
8525
|
asBoolean(bool) {
|
|
@@ -24673,9 +24673,9 @@ var require_semver = __commonJS({
|
|
|
24673
24673
|
} else {
|
|
24674
24674
|
this.prerelease = m[4].split(".").map((id) => {
|
|
24675
24675
|
if (/^[0-9]+$/.test(id)) {
|
|
24676
|
-
const
|
|
24677
|
-
if (
|
|
24678
|
-
return
|
|
24676
|
+
const num2 = +id;
|
|
24677
|
+
if (num2 >= 0 && num2 < MAX_SAFE_INTEGER) {
|
|
24678
|
+
return num2;
|
|
24679
24679
|
}
|
|
24680
24680
|
}
|
|
24681
24681
|
return id;
|
|
@@ -41036,24 +41036,24 @@ var require_dist5 = __commonJS({
|
|
|
41036
41036
|
var DAY = HOUR * 24;
|
|
41037
41037
|
var YEAR = DAY * 365.25;
|
|
41038
41038
|
function parse(val) {
|
|
41039
|
-
var
|
|
41040
|
-
if (arr != null && (
|
|
41041
|
-
if (arr[3] != null) return
|
|
41042
|
-
if (arr[4] != null) return
|
|
41043
|
-
if (arr[5] != null) return
|
|
41044
|
-
if (arr[6] != null) return
|
|
41045
|
-
if (arr[7] != null) return
|
|
41046
|
-
if (arr[8] != null) return
|
|
41047
|
-
return
|
|
41039
|
+
var num2, arr = val.toLowerCase().match(RGX);
|
|
41040
|
+
if (arr != null && (num2 = parseFloat(arr[1]))) {
|
|
41041
|
+
if (arr[3] != null) return num2 * SEC;
|
|
41042
|
+
if (arr[4] != null) return num2 * MIN;
|
|
41043
|
+
if (arr[5] != null) return num2 * HOUR;
|
|
41044
|
+
if (arr[6] != null) return num2 * DAY;
|
|
41045
|
+
if (arr[7] != null) return num2 * DAY * 7;
|
|
41046
|
+
if (arr[8] != null) return num2 * YEAR;
|
|
41047
|
+
return num2;
|
|
41048
41048
|
}
|
|
41049
41049
|
}
|
|
41050
41050
|
function fmt(val, pfx, str, long) {
|
|
41051
|
-
var
|
|
41052
|
-
return pfx +
|
|
41051
|
+
var num2 = (val | 0) === val ? val : ~~(val + 0.5);
|
|
41052
|
+
return pfx + num2 + (long ? " " + str + (num2 != 1 ? "s" : "") : str[0]);
|
|
41053
41053
|
}
|
|
41054
|
-
function format(
|
|
41055
|
-
var pfx =
|
|
41056
|
-
if (abs < SEC) return
|
|
41054
|
+
function format(num2, long) {
|
|
41055
|
+
var pfx = num2 < 0 ? "-" : "", abs = num2 < 0 ? -num2 : num2;
|
|
41056
|
+
if (abs < SEC) return num2 + (long ? " ms" : "ms");
|
|
41057
41057
|
if (abs < MIN) return fmt(abs / SEC, pfx, "second", long);
|
|
41058
41058
|
if (abs < HOUR) return fmt(abs / MIN, pfx, "minute", long);
|
|
41059
41059
|
if (abs < DAY) return fmt(abs / HOUR, pfx, "hour", long);
|
|
@@ -41991,7 +41991,7 @@ var require_send = __commonJS({
|
|
|
41991
41991
|
var { parseTokenList } = require_parseTokenList();
|
|
41992
41992
|
var { createHttpError } = require_createHttpError();
|
|
41993
41993
|
var extname2 = path.extname;
|
|
41994
|
-
var
|
|
41994
|
+
var join25 = path.join;
|
|
41995
41995
|
var normalize2 = path.normalize;
|
|
41996
41996
|
var resolve6 = path.resolve;
|
|
41997
41997
|
var sep4 = path.sep;
|
|
@@ -42078,7 +42078,7 @@ var require_send = __commonJS({
|
|
|
42078
42078
|
return { statusCode: 403 };
|
|
42079
42079
|
}
|
|
42080
42080
|
parts = path2.split(sep4);
|
|
42081
|
-
path2 = normalize2(
|
|
42081
|
+
path2 = normalize2(join25(root, path2));
|
|
42082
42082
|
} else {
|
|
42083
42083
|
if (UP_PATH_REGEXP.test(path2)) {
|
|
42084
42084
|
debug('malicious path "%s"', path2);
|
|
@@ -42194,15 +42194,15 @@ var require_send = __commonJS({
|
|
|
42194
42194
|
headers[headerName] = err.headers[headerName];
|
|
42195
42195
|
}
|
|
42196
42196
|
}
|
|
42197
|
-
const
|
|
42197
|
+
const doc2 = ERROR_RESPONSES[statusCode];
|
|
42198
42198
|
headers["Content-Type"] = "text/html; charset=utf-8";
|
|
42199
|
-
headers["Content-Length"] =
|
|
42199
|
+
headers["Content-Length"] = doc2[1];
|
|
42200
42200
|
headers["Content-Security-Policy"] = "default-src 'none'";
|
|
42201
42201
|
headers["X-Content-Type-Options"] = "nosniff";
|
|
42202
42202
|
return {
|
|
42203
42203
|
statusCode,
|
|
42204
42204
|
headers,
|
|
42205
|
-
stream: Readable3.from(
|
|
42205
|
+
stream: Readable3.from(doc2[0]),
|
|
42206
42206
|
// metadata
|
|
42207
42207
|
type: "error",
|
|
42208
42208
|
metadata: { error: createHttpError(statusCode, err) }
|
|
@@ -42341,17 +42341,17 @@ var require_send = __commonJS({
|
|
|
42341
42341
|
return sendError(403);
|
|
42342
42342
|
}
|
|
42343
42343
|
const loc = encodeURI(collapseLeadingSlashes(options.path + "/"));
|
|
42344
|
-
const
|
|
42344
|
+
const doc2 = createHtmlDocument("Redirecting", "Redirecting to " + escapeHtml(loc));
|
|
42345
42345
|
const headers = {};
|
|
42346
42346
|
headers["Content-Type"] = "text/html; charset=utf-8";
|
|
42347
|
-
headers["Content-Length"] =
|
|
42347
|
+
headers["Content-Length"] = doc2[1];
|
|
42348
42348
|
headers["Content-Security-Policy"] = "default-src 'none'";
|
|
42349
42349
|
headers["X-Content-Type-Options"] = "nosniff";
|
|
42350
42350
|
headers.Location = loc;
|
|
42351
42351
|
return {
|
|
42352
42352
|
statusCode: 301,
|
|
42353
42353
|
headers,
|
|
42354
|
-
stream: Readable3.from(
|
|
42354
|
+
stream: Readable3.from(doc2[0]),
|
|
42355
42355
|
// metadata
|
|
42356
42356
|
type: "directory",
|
|
42357
42357
|
metadata: { requestPath: options.path, path: path2 }
|
|
@@ -42361,7 +42361,7 @@ var require_send = __commonJS({
|
|
|
42361
42361
|
let err;
|
|
42362
42362
|
for (let i = 0; i < options.index.length; i++) {
|
|
42363
42363
|
const index = options.index[i];
|
|
42364
|
-
const p =
|
|
42364
|
+
const p = join25(path2, index);
|
|
42365
42365
|
const { error, stat: stat4 } = await tryStat(p);
|
|
42366
42366
|
if (error) {
|
|
42367
42367
|
err = error;
|
|
@@ -43799,13 +43799,13 @@ var require_directives = __commonJS({
|
|
|
43799
43799
|
}
|
|
43800
43800
|
return tag[0] === "!" ? tag : `!<${tag}>`;
|
|
43801
43801
|
}
|
|
43802
|
-
toString(
|
|
43802
|
+
toString(doc2) {
|
|
43803
43803
|
const lines = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [];
|
|
43804
43804
|
const tagEntries = Object.entries(this.tags);
|
|
43805
43805
|
let tagNames;
|
|
43806
|
-
if (
|
|
43806
|
+
if (doc2 && tagEntries.length > 0 && identity.isNode(doc2.contents)) {
|
|
43807
43807
|
const tags = {};
|
|
43808
|
-
visit.visit(
|
|
43808
|
+
visit.visit(doc2.contents, (_key, node) => {
|
|
43809
43809
|
if (identity.isNode(node) && node.tag)
|
|
43810
43810
|
tags[node.tag] = true;
|
|
43811
43811
|
});
|
|
@@ -43815,7 +43815,7 @@ var require_directives = __commonJS({
|
|
|
43815
43815
|
for (const [handle, prefix] of tagEntries) {
|
|
43816
43816
|
if (handle === "!!" && prefix === "tag:yaml.org,2002:")
|
|
43817
43817
|
continue;
|
|
43818
|
-
if (!
|
|
43818
|
+
if (!doc2 || tagNames.some((tn) => tn.startsWith(prefix)))
|
|
43819
43819
|
lines.push(`%TAG ${handle} ${prefix}`);
|
|
43820
43820
|
}
|
|
43821
43821
|
return lines.join("\n");
|
|
@@ -43858,14 +43858,14 @@ var require_anchors = __commonJS({
|
|
|
43858
43858
|
return name;
|
|
43859
43859
|
}
|
|
43860
43860
|
}
|
|
43861
|
-
function createNodeAnchors(
|
|
43861
|
+
function createNodeAnchors(doc2, prefix) {
|
|
43862
43862
|
const aliasObjects = [];
|
|
43863
43863
|
const sourceObjects = /* @__PURE__ */ new Map();
|
|
43864
43864
|
let prevAnchors = null;
|
|
43865
43865
|
return {
|
|
43866
43866
|
onAnchor: (source) => {
|
|
43867
43867
|
aliasObjects.push(source);
|
|
43868
|
-
prevAnchors ?? (prevAnchors = anchorNames(
|
|
43868
|
+
prevAnchors ?? (prevAnchors = anchorNames(doc2));
|
|
43869
43869
|
const anchor = findNewAnchor(prefix, prevAnchors);
|
|
43870
43870
|
prevAnchors.add(anchor);
|
|
43871
43871
|
return anchor;
|
|
@@ -43996,12 +43996,12 @@ var require_Node = __commonJS({
|
|
|
43996
43996
|
return copy;
|
|
43997
43997
|
}
|
|
43998
43998
|
/** A plain JavaScript representation of this node. */
|
|
43999
|
-
toJS(
|
|
44000
|
-
if (!identity.isDocument(
|
|
43999
|
+
toJS(doc2, { mapAsMap, maxAliasCount, onAnchor, reviver } = {}) {
|
|
44000
|
+
if (!identity.isDocument(doc2))
|
|
44001
44001
|
throw new TypeError("A document argument is required");
|
|
44002
44002
|
const ctx = {
|
|
44003
44003
|
anchors: /* @__PURE__ */ new Map(),
|
|
44004
|
-
doc,
|
|
44004
|
+
doc: doc2,
|
|
44005
44005
|
keep: true,
|
|
44006
44006
|
mapAsMap: mapAsMap === true,
|
|
44007
44007
|
mapKeyWarned: false,
|
|
@@ -44041,7 +44041,7 @@ var require_Alias = __commonJS({
|
|
|
44041
44041
|
* Resolve the value of this alias within `doc`, finding the last
|
|
44042
44042
|
* instance of the `source` anchor before this node.
|
|
44043
44043
|
*/
|
|
44044
|
-
resolve(
|
|
44044
|
+
resolve(doc2, ctx) {
|
|
44045
44045
|
if (ctx?.maxAliasCount === 0)
|
|
44046
44046
|
throw new ReferenceError("Alias resolution is disabled");
|
|
44047
44047
|
let nodes;
|
|
@@ -44049,7 +44049,7 @@ var require_Alias = __commonJS({
|
|
|
44049
44049
|
nodes = ctx.aliasResolveCache;
|
|
44050
44050
|
} else {
|
|
44051
44051
|
nodes = [];
|
|
44052
|
-
visit.visit(
|
|
44052
|
+
visit.visit(doc2, {
|
|
44053
44053
|
Node: (_key, node) => {
|
|
44054
44054
|
if (identity.isAlias(node) || identity.hasAnchor(node))
|
|
44055
44055
|
nodes.push(node);
|
|
@@ -44070,8 +44070,8 @@ var require_Alias = __commonJS({
|
|
|
44070
44070
|
toJSON(_arg, ctx) {
|
|
44071
44071
|
if (!ctx)
|
|
44072
44072
|
return { source: this.source };
|
|
44073
|
-
const { anchors: anchors2, doc, maxAliasCount } = ctx;
|
|
44074
|
-
const source = this.resolve(
|
|
44073
|
+
const { anchors: anchors2, doc: doc2, maxAliasCount } = ctx;
|
|
44074
|
+
const source = this.resolve(doc2, ctx);
|
|
44075
44075
|
if (!source) {
|
|
44076
44076
|
const msg = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
|
|
44077
44077
|
throw new ReferenceError(msg);
|
|
@@ -44088,7 +44088,7 @@ var require_Alias = __commonJS({
|
|
|
44088
44088
|
if (maxAliasCount >= 0) {
|
|
44089
44089
|
data.count += 1;
|
|
44090
44090
|
if (data.aliasCount === 0)
|
|
44091
|
-
data.aliasCount = getAliasCount(
|
|
44091
|
+
data.aliasCount = getAliasCount(doc2, source, anchors2);
|
|
44092
44092
|
if (data.count * data.aliasCount > maxAliasCount) {
|
|
44093
44093
|
const msg = "Excessive alias count indicates a resource exhaustion attack";
|
|
44094
44094
|
throw new ReferenceError(msg);
|
|
@@ -44110,22 +44110,22 @@ var require_Alias = __commonJS({
|
|
|
44110
44110
|
return src;
|
|
44111
44111
|
}
|
|
44112
44112
|
};
|
|
44113
|
-
function getAliasCount(
|
|
44113
|
+
function getAliasCount(doc2, node, anchors2) {
|
|
44114
44114
|
if (identity.isAlias(node)) {
|
|
44115
|
-
const source = node.resolve(
|
|
44115
|
+
const source = node.resolve(doc2);
|
|
44116
44116
|
const anchor = anchors2 && source && anchors2.get(source);
|
|
44117
44117
|
return anchor ? anchor.count * anchor.aliasCount : 0;
|
|
44118
44118
|
} else if (identity.isCollection(node)) {
|
|
44119
44119
|
let count = 0;
|
|
44120
44120
|
for (const item of node.items) {
|
|
44121
|
-
const c = getAliasCount(
|
|
44121
|
+
const c = getAliasCount(doc2, item, anchors2);
|
|
44122
44122
|
if (c > count)
|
|
44123
44123
|
count = c;
|
|
44124
44124
|
}
|
|
44125
44125
|
return count;
|
|
44126
44126
|
} else if (identity.isPair(node)) {
|
|
44127
|
-
const kc = getAliasCount(
|
|
44128
|
-
const vc = getAliasCount(
|
|
44127
|
+
const kc = getAliasCount(doc2, node.key, anchors2);
|
|
44128
|
+
const vc = getAliasCount(doc2, node.value, anchors2);
|
|
44129
44129
|
return Math.max(kc, vc);
|
|
44130
44130
|
}
|
|
44131
44131
|
return 1;
|
|
@@ -44826,7 +44826,7 @@ var require_stringify2 = __commonJS({
|
|
|
44826
44826
|
var identity = require_identity();
|
|
44827
44827
|
var stringifyComment = require_stringifyComment();
|
|
44828
44828
|
var stringifyString = require_stringifyString();
|
|
44829
|
-
function createStringifyContext(
|
|
44829
|
+
function createStringifyContext(doc2, options) {
|
|
44830
44830
|
const opt = Object.assign({
|
|
44831
44831
|
blockQuote: true,
|
|
44832
44832
|
commentString: stringifyComment.stringifyComment,
|
|
@@ -44846,7 +44846,7 @@ var require_stringify2 = __commonJS({
|
|
|
44846
44846
|
trailingComma: false,
|
|
44847
44847
|
trueStr: "true",
|
|
44848
44848
|
verifyAliasOrder: true
|
|
44849
|
-
},
|
|
44849
|
+
}, doc2.schema.toStringOptions, options);
|
|
44850
44850
|
let inFlow;
|
|
44851
44851
|
switch (opt.collectionStyle) {
|
|
44852
44852
|
case "block":
|
|
@@ -44860,7 +44860,7 @@ var require_stringify2 = __commonJS({
|
|
|
44860
44860
|
}
|
|
44861
44861
|
return {
|
|
44862
44862
|
anchors: /* @__PURE__ */ new Set(),
|
|
44863
|
-
doc,
|
|
44863
|
+
doc: doc2,
|
|
44864
44864
|
flowCollectionPadding: opt.flowCollectionPadding ? " " : "",
|
|
44865
44865
|
indent: "",
|
|
44866
44866
|
indentStep: typeof opt.indent === "number" ? " ".repeat(opt.indent) : " ",
|
|
@@ -44895,8 +44895,8 @@ var require_stringify2 = __commonJS({
|
|
|
44895
44895
|
}
|
|
44896
44896
|
return tagObj;
|
|
44897
44897
|
}
|
|
44898
|
-
function stringifyProps(node, tagObj, { anchors: anchors$1, doc }) {
|
|
44899
|
-
if (!
|
|
44898
|
+
function stringifyProps(node, tagObj, { anchors: anchors$1, doc: doc2 }) {
|
|
44899
|
+
if (!doc2.directives)
|
|
44900
44900
|
return "";
|
|
44901
44901
|
const props = [];
|
|
44902
44902
|
const anchor = (identity.isScalar(node) || identity.isCollection(node)) && node.anchor;
|
|
@@ -44906,7 +44906,7 @@ var require_stringify2 = __commonJS({
|
|
|
44906
44906
|
}
|
|
44907
44907
|
const tag = node.tag ?? (tagObj.default ? null : tagObj.tag);
|
|
44908
44908
|
if (tag)
|
|
44909
|
-
props.push(
|
|
44909
|
+
props.push(doc2.directives.tagString(tag));
|
|
44910
44910
|
return props.join(" ");
|
|
44911
44911
|
}
|
|
44912
44912
|
function stringify(item, ctx, onComment, onChompKeep) {
|
|
@@ -44951,7 +44951,7 @@ var require_stringifyPair = __commonJS({
|
|
|
44951
44951
|
var stringify = require_stringify2();
|
|
44952
44952
|
var stringifyComment = require_stringifyComment();
|
|
44953
44953
|
function stringifyPair({ key, value }, ctx, onComment, onChompKeep) {
|
|
44954
|
-
const { allNullValues, doc, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
44954
|
+
const { allNullValues, doc: doc2, indent, indentStep, options: { commentString, indentSeq, simpleKeys } } = ctx;
|
|
44955
44955
|
let keyComment = identity.isNode(key) && key.comment || null;
|
|
44956
44956
|
if (simpleKeys) {
|
|
44957
44957
|
if (keyComment) {
|
|
@@ -45012,7 +45012,7 @@ ${indent}:`;
|
|
|
45012
45012
|
vcb = null;
|
|
45013
45013
|
valueComment = null;
|
|
45014
45014
|
if (value && typeof value === "object")
|
|
45015
|
-
value =
|
|
45015
|
+
value = doc2.createNode(value);
|
|
45016
45016
|
}
|
|
45017
45017
|
ctx.implicitKey = false;
|
|
45018
45018
|
if (!explicitKey && !keyComment && identity.isScalar(value))
|
|
@@ -45784,9 +45784,9 @@ var require_stringifyNumber = __commonJS({
|
|
|
45784
45784
|
function stringifyNumber({ format, minFractionDigits, tag, value }) {
|
|
45785
45785
|
if (typeof value === "bigint")
|
|
45786
45786
|
return String(value);
|
|
45787
|
-
const
|
|
45788
|
-
if (!isFinite(
|
|
45789
|
-
return isNaN(
|
|
45787
|
+
const num2 = typeof value === "number" ? value : Number(value);
|
|
45788
|
+
if (!isFinite(num2))
|
|
45789
|
+
return isNaN(num2) ? ".nan" : num2 < 0 ? "-.inf" : ".inf";
|
|
45790
45790
|
let n = Object.is(value, -0) ? "-0" : JSON.stringify(value);
|
|
45791
45791
|
if (!format && minFractionDigits && (!tag || tag === "tag:yaml.org,2002:float") && /^-?\d/.test(n) && !n.includes("e")) {
|
|
45792
45792
|
let i = n.indexOf(".");
|
|
@@ -45826,8 +45826,8 @@ var require_float = __commonJS({
|
|
|
45826
45826
|
test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
|
|
45827
45827
|
resolve: (str) => parseFloat(str),
|
|
45828
45828
|
stringify(node) {
|
|
45829
|
-
const
|
|
45830
|
-
return isFinite(
|
|
45829
|
+
const num2 = Number(node.value);
|
|
45830
|
+
return isFinite(num2) ? num2.toExponential() : stringifyNumber.stringifyNumber(node);
|
|
45831
45831
|
}
|
|
45832
45832
|
};
|
|
45833
45833
|
var float = {
|
|
@@ -46266,8 +46266,8 @@ var require_float2 = __commonJS({
|
|
|
46266
46266
|
test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
|
|
46267
46267
|
resolve: (str) => parseFloat(str.replace(/_/g, "")),
|
|
46268
46268
|
stringify(node) {
|
|
46269
|
-
const
|
|
46270
|
-
return isFinite(
|
|
46269
|
+
const num2 = Number(node.value);
|
|
46270
|
+
return isFinite(num2) ? num2.toExponential() : stringifyNumber.stringifyNumber(node);
|
|
46271
46271
|
}
|
|
46272
46272
|
};
|
|
46273
46273
|
var float = {
|
|
@@ -46469,23 +46469,23 @@ var require_timestamp2 = __commonJS({
|
|
|
46469
46469
|
function parseSexagesimal(str, asBigInt) {
|
|
46470
46470
|
const sign = str[0];
|
|
46471
46471
|
const parts = sign === "-" || sign === "+" ? str.substring(1) : str;
|
|
46472
|
-
const
|
|
46473
|
-
const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 *
|
|
46474
|
-
return sign === "-" ?
|
|
46472
|
+
const num2 = (n) => asBigInt ? BigInt(n) : Number(n);
|
|
46473
|
+
const res = parts.replace(/_/g, "").split(":").reduce((res2, p) => res2 * num2(60) + num2(p), num2(0));
|
|
46474
|
+
return sign === "-" ? num2(-1) * res : res;
|
|
46475
46475
|
}
|
|
46476
46476
|
function stringifySexagesimal(node) {
|
|
46477
46477
|
let { value } = node;
|
|
46478
|
-
let
|
|
46478
|
+
let num2 = (n) => n;
|
|
46479
46479
|
if (typeof value === "bigint")
|
|
46480
|
-
|
|
46480
|
+
num2 = (n) => BigInt(n);
|
|
46481
46481
|
else if (isNaN(value) || !isFinite(value))
|
|
46482
46482
|
return stringifyNumber.stringifyNumber(node);
|
|
46483
46483
|
let sign = "";
|
|
46484
46484
|
if (value < 0) {
|
|
46485
46485
|
sign = "-";
|
|
46486
|
-
value *=
|
|
46486
|
+
value *= num2(-1);
|
|
46487
46487
|
}
|
|
46488
|
-
const _60 =
|
|
46488
|
+
const _60 = num2(60);
|
|
46489
46489
|
const parts = [value % _60];
|
|
46490
46490
|
if (value < 60) {
|
|
46491
46491
|
parts.unshift(0);
|
|
@@ -46726,42 +46726,42 @@ var require_stringifyDocument = __commonJS({
|
|
|
46726
46726
|
var identity = require_identity();
|
|
46727
46727
|
var stringify = require_stringify2();
|
|
46728
46728
|
var stringifyComment = require_stringifyComment();
|
|
46729
|
-
function stringifyDocument(
|
|
46729
|
+
function stringifyDocument(doc2, options) {
|
|
46730
46730
|
const lines = [];
|
|
46731
46731
|
let hasDirectives = options.directives === true;
|
|
46732
|
-
if (options.directives !== false &&
|
|
46733
|
-
const dir =
|
|
46732
|
+
if (options.directives !== false && doc2.directives) {
|
|
46733
|
+
const dir = doc2.directives.toString(doc2);
|
|
46734
46734
|
if (dir) {
|
|
46735
46735
|
lines.push(dir);
|
|
46736
46736
|
hasDirectives = true;
|
|
46737
|
-
} else if (
|
|
46737
|
+
} else if (doc2.directives.docStart)
|
|
46738
46738
|
hasDirectives = true;
|
|
46739
46739
|
}
|
|
46740
46740
|
if (hasDirectives)
|
|
46741
46741
|
lines.push("---");
|
|
46742
|
-
const ctx = stringify.createStringifyContext(
|
|
46742
|
+
const ctx = stringify.createStringifyContext(doc2, options);
|
|
46743
46743
|
const { commentString } = ctx.options;
|
|
46744
|
-
if (
|
|
46744
|
+
if (doc2.commentBefore) {
|
|
46745
46745
|
if (lines.length !== 1)
|
|
46746
46746
|
lines.unshift("");
|
|
46747
|
-
const cs = commentString(
|
|
46747
|
+
const cs = commentString(doc2.commentBefore);
|
|
46748
46748
|
lines.unshift(stringifyComment.indentComment(cs, ""));
|
|
46749
46749
|
}
|
|
46750
46750
|
let chompKeep = false;
|
|
46751
46751
|
let contentComment = null;
|
|
46752
|
-
if (
|
|
46753
|
-
if (identity.isNode(
|
|
46754
|
-
if (
|
|
46752
|
+
if (doc2.contents) {
|
|
46753
|
+
if (identity.isNode(doc2.contents)) {
|
|
46754
|
+
if (doc2.contents.spaceBefore && hasDirectives)
|
|
46755
46755
|
lines.push("");
|
|
46756
|
-
if (
|
|
46757
|
-
const cs = commentString(
|
|
46756
|
+
if (doc2.contents.commentBefore) {
|
|
46757
|
+
const cs = commentString(doc2.contents.commentBefore);
|
|
46758
46758
|
lines.push(stringifyComment.indentComment(cs, ""));
|
|
46759
46759
|
}
|
|
46760
|
-
ctx.forceBlockIndent = !!
|
|
46761
|
-
contentComment =
|
|
46760
|
+
ctx.forceBlockIndent = !!doc2.comment;
|
|
46761
|
+
contentComment = doc2.contents.comment;
|
|
46762
46762
|
}
|
|
46763
46763
|
const onChompKeep = contentComment ? void 0 : () => chompKeep = true;
|
|
46764
|
-
let body = stringify.stringify(
|
|
46764
|
+
let body = stringify.stringify(doc2.contents, ctx, () => contentComment = null, onChompKeep);
|
|
46765
46765
|
if (contentComment)
|
|
46766
46766
|
body += stringifyComment.lineComment(body, "", commentString(contentComment));
|
|
46767
46767
|
if ((body[0] === "|" || body[0] === ">") && lines[lines.length - 1] === "---") {
|
|
@@ -46769,11 +46769,11 @@ var require_stringifyDocument = __commonJS({
|
|
|
46769
46769
|
} else
|
|
46770
46770
|
lines.push(body);
|
|
46771
46771
|
} else {
|
|
46772
|
-
lines.push(stringify.stringify(
|
|
46772
|
+
lines.push(stringify.stringify(doc2.contents, ctx));
|
|
46773
46773
|
}
|
|
46774
|
-
if (
|
|
46775
|
-
if (
|
|
46776
|
-
const cs = commentString(
|
|
46774
|
+
if (doc2.directives?.docEnd) {
|
|
46775
|
+
if (doc2.comment) {
|
|
46776
|
+
const cs = commentString(doc2.comment);
|
|
46777
46777
|
if (cs.includes("\n")) {
|
|
46778
46778
|
lines.push("...");
|
|
46779
46779
|
lines.push(stringifyComment.indentComment(cs, ""));
|
|
@@ -46784,7 +46784,7 @@ var require_stringifyDocument = __commonJS({
|
|
|
46784
46784
|
lines.push("...");
|
|
46785
46785
|
}
|
|
46786
46786
|
} else {
|
|
46787
|
-
let dc =
|
|
46787
|
+
let dc = doc2.comment;
|
|
46788
46788
|
if (dc && chompKeep)
|
|
46789
46789
|
dc = dc.replace(/^\n+/, "");
|
|
46790
46790
|
if (dc) {
|
|
@@ -48474,13 +48474,13 @@ var require_compose_doc = __commonJS({
|
|
|
48474
48474
|
var resolveProps = require_resolve_props();
|
|
48475
48475
|
function composeDoc(options, directives, { offset, start, value, end }, onError) {
|
|
48476
48476
|
const opts = Object.assign({ _directives: directives }, options);
|
|
48477
|
-
const
|
|
48477
|
+
const doc2 = new Document.Document(void 0, opts);
|
|
48478
48478
|
const ctx = {
|
|
48479
48479
|
atKey: false,
|
|
48480
48480
|
atRoot: true,
|
|
48481
|
-
directives:
|
|
48482
|
-
options:
|
|
48483
|
-
schema:
|
|
48481
|
+
directives: doc2.directives,
|
|
48482
|
+
options: doc2.options,
|
|
48483
|
+
schema: doc2.schema
|
|
48484
48484
|
};
|
|
48485
48485
|
const props = resolveProps.resolveProps(start, {
|
|
48486
48486
|
indicator: "doc-start",
|
|
@@ -48491,17 +48491,17 @@ var require_compose_doc = __commonJS({
|
|
|
48491
48491
|
startOnNewline: true
|
|
48492
48492
|
});
|
|
48493
48493
|
if (props.found) {
|
|
48494
|
-
|
|
48494
|
+
doc2.directives.docStart = true;
|
|
48495
48495
|
if (value && (value.type === "block-map" || value.type === "block-seq") && !props.hasNewline)
|
|
48496
48496
|
onError(props.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker");
|
|
48497
48497
|
}
|
|
48498
|
-
|
|
48499
|
-
const contentEnd =
|
|
48498
|
+
doc2.contents = value ? composeNode.composeNode(ctx, value, props, onError) : composeNode.composeEmptyNode(ctx, props.end, start, null, props, onError);
|
|
48499
|
+
const contentEnd = doc2.contents.range[2];
|
|
48500
48500
|
const re = resolveEnd.resolveEnd(end, contentEnd, false, onError);
|
|
48501
48501
|
if (re.comment)
|
|
48502
|
-
|
|
48503
|
-
|
|
48504
|
-
return
|
|
48502
|
+
doc2.comment = re.comment;
|
|
48503
|
+
doc2.range = [offset, contentEnd, re.offset];
|
|
48504
|
+
return doc2;
|
|
48505
48505
|
}
|
|
48506
48506
|
exports2.composeDoc = composeDoc;
|
|
48507
48507
|
}
|
|
@@ -48568,15 +48568,15 @@ var require_composer = __commonJS({
|
|
|
48568
48568
|
this.directives = new directives.Directives({ version: options.version || "1.2" });
|
|
48569
48569
|
this.options = options;
|
|
48570
48570
|
}
|
|
48571
|
-
decorate(
|
|
48571
|
+
decorate(doc2, afterDoc) {
|
|
48572
48572
|
const { comment, afterEmptyLine } = parsePrelude(this.prelude);
|
|
48573
48573
|
if (comment) {
|
|
48574
|
-
const dc =
|
|
48574
|
+
const dc = doc2.contents;
|
|
48575
48575
|
if (afterDoc) {
|
|
48576
|
-
|
|
48576
|
+
doc2.comment = doc2.comment ? `${doc2.comment}
|
|
48577
48577
|
${comment}` : comment;
|
|
48578
|
-
} else if (afterEmptyLine ||
|
|
48579
|
-
|
|
48578
|
+
} else if (afterEmptyLine || doc2.directives.docStart || !dc) {
|
|
48579
|
+
doc2.commentBefore = comment;
|
|
48580
48580
|
} else if (identity.isCollection(dc) && !dc.flow && dc.items.length > 0) {
|
|
48581
48581
|
let it = dc.items[0];
|
|
48582
48582
|
if (identity.isPair(it))
|
|
@@ -48592,12 +48592,12 @@ ${cb}` : comment;
|
|
|
48592
48592
|
}
|
|
48593
48593
|
if (afterDoc) {
|
|
48594
48594
|
for (let i = 0; i < this.errors.length; ++i)
|
|
48595
|
-
|
|
48595
|
+
doc2.errors.push(this.errors[i]);
|
|
48596
48596
|
for (let i = 0; i < this.warnings.length; ++i)
|
|
48597
|
-
|
|
48597
|
+
doc2.warnings.push(this.warnings[i]);
|
|
48598
48598
|
} else {
|
|
48599
|
-
|
|
48600
|
-
|
|
48599
|
+
doc2.errors = this.errors;
|
|
48600
|
+
doc2.warnings = this.warnings;
|
|
48601
48601
|
}
|
|
48602
48602
|
this.prelude = [];
|
|
48603
48603
|
this.errors = [];
|
|
@@ -48642,13 +48642,13 @@ ${cb}` : comment;
|
|
|
48642
48642
|
this.atDirectives = true;
|
|
48643
48643
|
break;
|
|
48644
48644
|
case "document": {
|
|
48645
|
-
const
|
|
48646
|
-
if (this.atDirectives && !
|
|
48645
|
+
const doc2 = composeDoc.composeDoc(this.options, this.directives, token, this.onError);
|
|
48646
|
+
if (this.atDirectives && !doc2.directives.docStart)
|
|
48647
48647
|
this.onError(token, "MISSING_CHAR", "Missing directives-end/doc-start indicator line");
|
|
48648
|
-
this.decorate(
|
|
48648
|
+
this.decorate(doc2, false);
|
|
48649
48649
|
if (this.doc)
|
|
48650
48650
|
yield this.doc;
|
|
48651
|
-
this.doc =
|
|
48651
|
+
this.doc = doc2;
|
|
48652
48652
|
this.atDirectives = false;
|
|
48653
48653
|
break;
|
|
48654
48654
|
}
|
|
@@ -48702,12 +48702,12 @@ ${end.comment}` : end.comment;
|
|
|
48702
48702
|
this.doc = null;
|
|
48703
48703
|
} else if (forceDoc) {
|
|
48704
48704
|
const opts = Object.assign({ _directives: this.directives }, this.options);
|
|
48705
|
-
const
|
|
48705
|
+
const doc2 = new Document.Document(void 0, opts);
|
|
48706
48706
|
if (this.atDirectives)
|
|
48707
48707
|
this.onError(endOffset, "MISSING_CHAR", "Missing directives-end indicator line");
|
|
48708
|
-
|
|
48709
|
-
this.decorate(
|
|
48710
|
-
yield
|
|
48708
|
+
doc2.range = [0, endOffset, endOffset];
|
|
48709
|
+
this.decorate(doc2, false);
|
|
48710
|
+
yield doc2;
|
|
48711
48711
|
}
|
|
48712
48712
|
}
|
|
48713
48713
|
};
|
|
@@ -50064,14 +50064,14 @@ var require_parser = __commonJS({
|
|
|
50064
50064
|
return;
|
|
50065
50065
|
case "doc-mode":
|
|
50066
50066
|
case "doc-start": {
|
|
50067
|
-
const
|
|
50067
|
+
const doc2 = {
|
|
50068
50068
|
type: "document",
|
|
50069
50069
|
offset: this.offset,
|
|
50070
50070
|
start: []
|
|
50071
50071
|
};
|
|
50072
50072
|
if (this.type === "doc-start")
|
|
50073
|
-
|
|
50074
|
-
this.stack.push(
|
|
50073
|
+
doc2.start.push(this.sourceToken);
|
|
50074
|
+
this.stack.push(doc2);
|
|
50075
50075
|
return;
|
|
50076
50076
|
}
|
|
50077
50077
|
}
|
|
@@ -50082,16 +50082,16 @@ var require_parser = __commonJS({
|
|
|
50082
50082
|
source: this.source
|
|
50083
50083
|
};
|
|
50084
50084
|
}
|
|
50085
|
-
*document(
|
|
50086
|
-
if (
|
|
50087
|
-
return yield* this.lineEnd(
|
|
50085
|
+
*document(doc2) {
|
|
50086
|
+
if (doc2.value)
|
|
50087
|
+
return yield* this.lineEnd(doc2);
|
|
50088
50088
|
switch (this.type) {
|
|
50089
50089
|
case "doc-start": {
|
|
50090
|
-
if (findNonEmptyIndex(
|
|
50090
|
+
if (findNonEmptyIndex(doc2.start) !== -1) {
|
|
50091
50091
|
yield* this.pop();
|
|
50092
50092
|
yield* this.step();
|
|
50093
50093
|
} else
|
|
50094
|
-
|
|
50094
|
+
doc2.start.push(this.sourceToken);
|
|
50095
50095
|
return;
|
|
50096
50096
|
}
|
|
50097
50097
|
case "anchor":
|
|
@@ -50099,10 +50099,10 @@ var require_parser = __commonJS({
|
|
|
50099
50099
|
case "space":
|
|
50100
50100
|
case "comment":
|
|
50101
50101
|
case "newline":
|
|
50102
|
-
|
|
50102
|
+
doc2.start.push(this.sourceToken);
|
|
50103
50103
|
return;
|
|
50104
50104
|
}
|
|
50105
|
-
const bv = this.startBlockValue(
|
|
50105
|
+
const bv = this.startBlockValue(doc2);
|
|
50106
50106
|
if (bv)
|
|
50107
50107
|
this.stack.push(bv);
|
|
50108
50108
|
else {
|
|
@@ -50641,9 +50641,9 @@ var require_public_api = __commonJS({
|
|
|
50641
50641
|
const composer$1 = new composer.Composer(options);
|
|
50642
50642
|
const docs = Array.from(composer$1.compose(parser$1.parse(source)));
|
|
50643
50643
|
if (prettyErrors && lineCounter2)
|
|
50644
|
-
for (const
|
|
50645
|
-
|
|
50646
|
-
|
|
50644
|
+
for (const doc2 of docs) {
|
|
50645
|
+
doc2.errors.forEach(errors.prettifyError(source, lineCounter2));
|
|
50646
|
+
doc2.warnings.forEach(errors.prettifyError(source, lineCounter2));
|
|
50647
50647
|
}
|
|
50648
50648
|
if (docs.length > 0)
|
|
50649
50649
|
return docs;
|
|
@@ -50653,20 +50653,20 @@ var require_public_api = __commonJS({
|
|
|
50653
50653
|
const { lineCounter: lineCounter2, prettyErrors } = parseOptions(options);
|
|
50654
50654
|
const parser$1 = new parser.Parser(lineCounter2?.addNewLine);
|
|
50655
50655
|
const composer$1 = new composer.Composer(options);
|
|
50656
|
-
let
|
|
50656
|
+
let doc2 = null;
|
|
50657
50657
|
for (const _doc of composer$1.compose(parser$1.parse(source), true, source.length)) {
|
|
50658
|
-
if (!
|
|
50659
|
-
|
|
50660
|
-
else if (
|
|
50661
|
-
|
|
50658
|
+
if (!doc2)
|
|
50659
|
+
doc2 = _doc;
|
|
50660
|
+
else if (doc2.options.logLevel !== "silent") {
|
|
50661
|
+
doc2.errors.push(new errors.YAMLParseError(_doc.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
|
|
50662
50662
|
break;
|
|
50663
50663
|
}
|
|
50664
50664
|
}
|
|
50665
50665
|
if (prettyErrors && lineCounter2) {
|
|
50666
|
-
|
|
50667
|
-
|
|
50666
|
+
doc2.errors.forEach(errors.prettifyError(source, lineCounter2));
|
|
50667
|
+
doc2.warnings.forEach(errors.prettifyError(source, lineCounter2));
|
|
50668
50668
|
}
|
|
50669
|
-
return
|
|
50669
|
+
return doc2;
|
|
50670
50670
|
}
|
|
50671
50671
|
function parse(src, reviver, options) {
|
|
50672
50672
|
let _reviver = void 0;
|
|
@@ -50675,17 +50675,17 @@ var require_public_api = __commonJS({
|
|
|
50675
50675
|
} else if (options === void 0 && reviver && typeof reviver === "object") {
|
|
50676
50676
|
options = reviver;
|
|
50677
50677
|
}
|
|
50678
|
-
const
|
|
50679
|
-
if (!
|
|
50678
|
+
const doc2 = parseDocument2(src, options);
|
|
50679
|
+
if (!doc2)
|
|
50680
50680
|
return null;
|
|
50681
|
-
|
|
50682
|
-
if (
|
|
50683
|
-
if (
|
|
50684
|
-
throw
|
|
50681
|
+
doc2.warnings.forEach((warning) => log2.warn(doc2.options.logLevel, warning));
|
|
50682
|
+
if (doc2.errors.length > 0) {
|
|
50683
|
+
if (doc2.options.logLevel !== "silent")
|
|
50684
|
+
throw doc2.errors[0];
|
|
50685
50685
|
else
|
|
50686
|
-
|
|
50686
|
+
doc2.errors = [];
|
|
50687
50687
|
}
|
|
50688
|
-
return
|
|
50688
|
+
return doc2.toJS(Object.assign({ reviver: _reviver }, options));
|
|
50689
50689
|
}
|
|
50690
50690
|
function stringify(value, replacer, options) {
|
|
50691
50691
|
let _replacer = null;
|
|
@@ -50827,9 +50827,9 @@ var import_node_readline2 = require("node:readline");
|
|
|
50827
50827
|
|
|
50828
50828
|
// index.ts
|
|
50829
50829
|
var import_node_url3 = require("node:url");
|
|
50830
|
-
var
|
|
50831
|
-
var
|
|
50832
|
-
var
|
|
50830
|
+
var import_node_path23 = require("node:path");
|
|
50831
|
+
var import_node_os17 = require("node:os");
|
|
50832
|
+
var import_node_fs24 = require("node:fs");
|
|
50833
50833
|
var import_node_child_process6 = require("node:child_process");
|
|
50834
50834
|
|
|
50835
50835
|
// log.mjs
|
|
@@ -51078,13 +51078,13 @@ function readCommandSpec(agent, command, agentsDir = AGENTS_DIR) {
|
|
|
51078
51078
|
if (!safe(agent) || !safe(command)) return null;
|
|
51079
51079
|
const manifestPath = (0, import_node_path2.join)(agentsDir, agent, "manifest.yaml");
|
|
51080
51080
|
if (!(0, import_node_fs3.existsSync)(manifestPath)) return null;
|
|
51081
|
-
let
|
|
51081
|
+
let doc2;
|
|
51082
51082
|
try {
|
|
51083
|
-
|
|
51083
|
+
doc2 = asRecord((0, import_yaml.parse)((0, import_node_fs3.readFileSync)(manifestPath, "utf8")));
|
|
51084
51084
|
} catch {
|
|
51085
51085
|
return null;
|
|
51086
51086
|
}
|
|
51087
|
-
const cmd = asRecord(asRecord(
|
|
51087
|
+
const cmd = asRecord(asRecord(doc2.commands)[command]);
|
|
51088
51088
|
if (Object.keys(cmd).length === 0) return null;
|
|
51089
51089
|
const lifecycle = typeof cmd.lifecycle === "string" ? cmd.lifecycle : "single";
|
|
51090
51090
|
const streaming = asRecord(cmd.outputs).type === "stream";
|
|
@@ -51123,13 +51123,13 @@ function readNodeSkill(agent, command, agentsDir = AGENTS_DIR) {
|
|
|
51123
51123
|
if (!safe(agent) || !safe(command)) return null;
|
|
51124
51124
|
const manifestPath = (0, import_node_path2.join)(agentsDir, agent, "manifest.yaml");
|
|
51125
51125
|
if (!(0, import_node_fs3.existsSync)(manifestPath)) return null;
|
|
51126
|
-
let
|
|
51126
|
+
let doc2;
|
|
51127
51127
|
try {
|
|
51128
|
-
|
|
51128
|
+
doc2 = asRecord((0, import_yaml.parse)((0, import_node_fs3.readFileSync)(manifestPath, "utf8")));
|
|
51129
51129
|
} catch {
|
|
51130
51130
|
return null;
|
|
51131
51131
|
}
|
|
51132
|
-
const cmd = asRecord(asRecord(
|
|
51132
|
+
const cmd = asRecord(asRecord(doc2.commands)[command]);
|
|
51133
51133
|
if (Object.keys(cmd).length === 0) return null;
|
|
51134
51134
|
const outRec = asRecord(cmd.outputs);
|
|
51135
51135
|
const outputs = typeof outRec.type === "string" ? {
|
|
@@ -51140,10 +51140,10 @@ function readNodeSkill(agent, command, agentsDir = AGENTS_DIR) {
|
|
|
51140
51140
|
} : null;
|
|
51141
51141
|
return {
|
|
51142
51142
|
agent,
|
|
51143
|
-
agentDisplayName: typeof
|
|
51144
|
-
agentDescription: firstParagraph(
|
|
51145
|
-
homepage: typeof
|
|
51146
|
-
capabilities: Object.keys(asRecord(
|
|
51143
|
+
agentDisplayName: typeof doc2["display-name"] === "string" ? doc2["display-name"] : agent,
|
|
51144
|
+
agentDescription: firstParagraph(doc2.description),
|
|
51145
|
+
homepage: typeof doc2.homepage === "string" ? doc2.homepage : null,
|
|
51146
|
+
capabilities: Object.keys(asRecord(doc2.requires)),
|
|
51147
51147
|
command,
|
|
51148
51148
|
commandDescription: firstParagraph(cmd.description),
|
|
51149
51149
|
inputs: parseManifestInputs(cmd.inputs),
|
|
@@ -51165,8 +51165,8 @@ function credentialStatus(secret) {
|
|
|
51165
51165
|
const file = (0, import_node_path2.join)(CREDENTIALS_DIR, `${secret}.json`);
|
|
51166
51166
|
if (!(0, import_node_fs3.existsSync)(file)) return { status: "disconnected", expiresAt: null };
|
|
51167
51167
|
try {
|
|
51168
|
-
const
|
|
51169
|
-
const raw =
|
|
51168
|
+
const doc2 = JSON.parse((0, import_node_fs3.readFileSync)(file, "utf8"));
|
|
51169
|
+
const raw = doc2["expires_at"] ?? doc2["expiresAt"] ?? doc2["expiry"];
|
|
51170
51170
|
if (raw != null) {
|
|
51171
51171
|
const ms = typeof raw === "number" ? raw * (raw < 1e12 ? 1e3 : 1) : Date.parse(String(raw));
|
|
51172
51172
|
if (!Number.isNaN(ms)) {
|
|
@@ -51188,13 +51188,13 @@ function listIntegrations() {
|
|
|
51188
51188
|
if (!(0, import_node_fs3.existsSync)(manifestPath)) continue;
|
|
51189
51189
|
const manifestText = (0, import_node_fs3.readFileSync)(manifestPath, "utf8");
|
|
51190
51190
|
if (!manifestText.includes("secrets:")) continue;
|
|
51191
|
-
let
|
|
51191
|
+
let doc2;
|
|
51192
51192
|
try {
|
|
51193
|
-
|
|
51193
|
+
doc2 = asRecord((0, import_yaml.parse)(manifestText));
|
|
51194
51194
|
} catch {
|
|
51195
51195
|
continue;
|
|
51196
51196
|
}
|
|
51197
|
-
const requires = asRecord(
|
|
51197
|
+
const requires = asRecord(doc2.requires);
|
|
51198
51198
|
const secrets = Array.isArray(requires.secrets) ? requires.secrets.map(String) : [];
|
|
51199
51199
|
if (!secrets.length) continue;
|
|
51200
51200
|
const network = Array.isArray(requires.network) ? requires.network.map(String) : [];
|
|
@@ -51203,8 +51203,8 @@ function listIntegrations() {
|
|
|
51203
51203
|
seen.add(secret);
|
|
51204
51204
|
out.push({
|
|
51205
51205
|
id: secret,
|
|
51206
|
-
name: typeof
|
|
51207
|
-
vendor: typeof
|
|
51206
|
+
name: typeof doc2["display-name"] === "string" ? doc2["display-name"] : agentId,
|
|
51207
|
+
vendor: typeof doc2.vendor === "string" ? doc2.vendor : null,
|
|
51208
51208
|
agent: agentId,
|
|
51209
51209
|
network,
|
|
51210
51210
|
...credentialStatus(secret)
|
|
@@ -52729,7 +52729,7 @@ function appVersion() {
|
|
|
52729
52729
|
return resolveVersion({
|
|
52730
52730
|
isSea: isSea2(),
|
|
52731
52731
|
sqVersionXml: readSqVersionXml(),
|
|
52732
|
-
define: true ? "0.23.
|
|
52732
|
+
define: true ? "0.23.3" : void 0,
|
|
52733
52733
|
pkgVersion: readPkgVersion()
|
|
52734
52734
|
});
|
|
52735
52735
|
}
|
|
@@ -52739,7 +52739,7 @@ function resolveChannel(s) {
|
|
|
52739
52739
|
return "dev";
|
|
52740
52740
|
}
|
|
52741
52741
|
function appChannel() {
|
|
52742
|
-
return resolveChannel({ isSea: isSea2(), define: true ? "0.23.
|
|
52742
|
+
return resolveChannel({ isSea: isSea2(), define: true ? "0.23.3" : void 0 });
|
|
52743
52743
|
}
|
|
52744
52744
|
|
|
52745
52745
|
// oauth-presets.ts
|
|
@@ -52827,13 +52827,13 @@ function buildExposedCommands(inputs) {
|
|
|
52827
52827
|
};
|
|
52828
52828
|
}
|
|
52829
52829
|
function bakeFloSource(source, inputs) {
|
|
52830
|
-
const
|
|
52831
|
-
if (
|
|
52832
|
-
throw new Error(`bake: source is not valid YAML: ${
|
|
52830
|
+
const doc2 = (0, import_yaml2.parseDocument)(source);
|
|
52831
|
+
if (doc2.errors.length > 0) {
|
|
52832
|
+
throw new Error(`bake: source is not valid YAML: ${doc2.errors[0]?.message ?? "parse error"}`);
|
|
52833
52833
|
}
|
|
52834
|
-
|
|
52835
|
-
|
|
52836
|
-
return
|
|
52834
|
+
doc2.set("exposes-as-agent", true);
|
|
52835
|
+
doc2.set("exposed-commands", buildExposedCommands(inputs));
|
|
52836
|
+
return doc2.toString();
|
|
52837
52837
|
}
|
|
52838
52838
|
|
|
52839
52839
|
// app-import.ts
|
|
@@ -52909,17 +52909,98 @@ function withBadge(report, opts) {
|
|
|
52909
52909
|
return { ...report, html: injectBadge(report.html, opts) };
|
|
52910
52910
|
}
|
|
52911
52911
|
|
|
52912
|
+
// steel-report.ts
|
|
52913
|
+
var esc = (s) => String(s ?? "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
52914
|
+
var num = (v) => typeof v === "number" ? v : Number(v) || 0;
|
|
52915
|
+
var STYLE = `<style>
|
|
52916
|
+
body{font-family:-apple-system,'Segoe UI',Roboto,sans-serif;background:#0f172a;color:#e2e8f0;padding:2.5rem;line-height:1.55}
|
|
52917
|
+
.wrap{max-width:560px;margin:0 auto;background:#111c33;border:1px solid #1e293b;border-radius:14px;padding:1.9rem 2.1rem;box-shadow:0 12px 34px rgba(2,6,23,.5)}
|
|
52918
|
+
h1{font-size:1.4rem;font-weight:800;margin:0 0 .3rem;color:#f1f5f9}
|
|
52919
|
+
.ok{color:#4ade80;font-size:.82rem;font-weight:700;margin:.15rem 0 .25rem;letter-spacing:.02em}
|
|
52920
|
+
.sub{color:#94a3b8;font-size:.92rem;margin-bottom:1.3rem}
|
|
52921
|
+
.big{font-size:2.1rem;font-weight:800;color:#60a5fa;line-height:1}
|
|
52922
|
+
.big span{font-size:1rem;font-weight:600;color:#94a3b8}
|
|
52923
|
+
table{width:100%;border-collapse:collapse;font-size:.9rem;margin:1.2rem 0}
|
|
52924
|
+
td{padding:.45rem .2rem;border-bottom:1px solid #1e293b}td:last-child{text-align:right;font-weight:700;color:#cbd5e1}
|
|
52925
|
+
thead td{color:#64748b;font-weight:600;font-size:.78rem;text-transform:uppercase;letter-spacing:.04em}thead td:last-child{text-align:right}
|
|
52926
|
+
.path{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.82rem;background:#0b1424;border:1px solid #1e293b;border-radius:7px;padding:.6rem .75rem;color:#93c5fd;word-break:break-all;margin:.6rem 0 1.1rem}
|
|
52927
|
+
.path-label{color:#94a3b8;font-size:.8rem;margin:.2rem 0 .35rem}
|
|
52928
|
+
.tools{font-size:.9rem;color:#cbd5e1}.tools b{color:#f1f5f9}
|
|
52929
|
+
</style>`;
|
|
52930
|
+
function profileRows(profiles) {
|
|
52931
|
+
if (!profiles || typeof profiles !== "object") return "";
|
|
52932
|
+
return Object.entries(profiles).map(([k, v]) => `<tr><td>${esc(k)}</td><td>${num(v)}</td></tr>`).join("");
|
|
52933
|
+
}
|
|
52934
|
+
function doc(body) {
|
|
52935
|
+
return `<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8"><title>Steel report</title>${STYLE}</head><body><div class="wrap">${body}</div></body></html>`;
|
|
52936
|
+
}
|
|
52937
|
+
function ifcCard(r) {
|
|
52938
|
+
const members = num(r.members);
|
|
52939
|
+
const columns = num(r.columns);
|
|
52940
|
+
const beams = num(r.beams);
|
|
52941
|
+
const path = String(r.path ?? "");
|
|
52942
|
+
const fname = path.split(/[\\/]/).pop() || "model.ifc";
|
|
52943
|
+
const rows = profileRows(r.profiles);
|
|
52944
|
+
return doc(
|
|
52945
|
+
`<h1>Steel exported to IFC</h1><div class="ok">✓ IFC file written</div><div class="sub">${esc(fname)}</div><div class="big">${members} <span>members · ${columns} columns · ${beams} beams</span></div>` + (rows ? `<table><thead><tr><td>Profile</td><td>Count</td></tr></thead><tbody>${rows}</tbody></table>` : "") + `<div class="path-label">Saved here — open it in Tekla / SDS2 / Revit:</div><div class="path">${esc(path)}</div><div class="tools">Open the IFC in <b>Tekla</b>, <b>SDS2</b>, <b>Revit</b> or <b>Navisworks</b> — IFC is the universal exchange format. Schematic model — confirm & detail in your tool.</div>`
|
|
52946
|
+
);
|
|
52947
|
+
}
|
|
52948
|
+
function teklaCard(r) {
|
|
52949
|
+
const created = num(r.created);
|
|
52950
|
+
const columns = num(r.columns);
|
|
52951
|
+
const beams = num(r.beams);
|
|
52952
|
+
const failed = num(r.failed);
|
|
52953
|
+
const skipped = num(r.skipped);
|
|
52954
|
+
const placeholder = num(r.placeholder);
|
|
52955
|
+
const sceneName = String(r.scene_name ?? "Steel from Drawings");
|
|
52956
|
+
const model = String(r.model ?? "Tekla model");
|
|
52957
|
+
const rows = profileRows(r.profiles);
|
|
52958
|
+
const extra = (failed > 0 ? ` · ${failed} failed` : "") + (skipped > 0 ? ` · ${skipped} skipped` : "");
|
|
52959
|
+
const note = placeholder > 0 ? `${placeholder} member(s) used a sized placeholder profile because this Tekla environment didn't have the drawing's catalogue profile \u2014 remap those. <b>Undo</b> in Tekla reverts the whole bake.` : `Native Tekla parts on the model grid \u2014 detail them as usual. <b>Undo</b> in Tekla reverts the whole bake.`;
|
|
52960
|
+
return doc(
|
|
52961
|
+
`<h1>Steel baked into Tekla</h1><div class="ok">✓ ${created} member(s) created in the live model</div><div class="sub">${esc(sceneName)} → ${esc(model)}</div><div class="big">${created} <span>members · ${columns} columns · ${beams} beams${extra}</span></div>` + (rows ? `<table><thead><tr><td>Profile</td><td>Count</td></tr></thead><tbody>${rows}</tbody></table>` : "") + `<div class="tools">${note}</div>`
|
|
52962
|
+
);
|
|
52963
|
+
}
|
|
52964
|
+
function buildSteelReportHtml(data) {
|
|
52965
|
+
if (!data || typeof data !== "object") return null;
|
|
52966
|
+
const result = data.result && typeof data.result === "object" ? data.result : null;
|
|
52967
|
+
if (result && typeof result.created === "number") return teklaCard(result);
|
|
52968
|
+
if (typeof data.members === "number" && typeof data.path === "string") return ifcCard(data);
|
|
52969
|
+
if (result && typeof result.members === "number" && typeof result.path === "string") return ifcCard(result);
|
|
52970
|
+
return null;
|
|
52971
|
+
}
|
|
52972
|
+
|
|
52912
52973
|
// report-html.ts
|
|
52913
|
-
function extractReportHtml(events) {
|
|
52974
|
+
function extractReportHtml(events, appId) {
|
|
52914
52975
|
let found = null;
|
|
52976
|
+
const steelApp = appId === "steel-to-ifc" || appId === "steel-to-tekla";
|
|
52977
|
+
let steel = null;
|
|
52915
52978
|
for (const ev of events) {
|
|
52916
52979
|
const data = ev?.data;
|
|
52917
52980
|
if (!data || typeof data !== "object") continue;
|
|
52918
52981
|
const result = data.result;
|
|
52919
52982
|
const html = typeof data.html === "string" ? data.html : result && typeof result.html === "string" ? result.html : null;
|
|
52920
|
-
if (html)
|
|
52983
|
+
if (html) {
|
|
52984
|
+
found = { nodeId: ev.node ?? null, html };
|
|
52985
|
+
} else if (steelApp) {
|
|
52986
|
+
const card = buildSteelReportHtml(data);
|
|
52987
|
+
if (card) steel = { nodeId: ev.node ?? null, html: card };
|
|
52988
|
+
}
|
|
52921
52989
|
}
|
|
52922
|
-
return found;
|
|
52990
|
+
return found ?? steel;
|
|
52991
|
+
}
|
|
52992
|
+
|
|
52993
|
+
// steel-output-path.ts
|
|
52994
|
+
var import_node_path8 = require("node:path");
|
|
52995
|
+
var import_node_os8 = require("node:os");
|
|
52996
|
+
var import_node_fs9 = require("node:fs");
|
|
52997
|
+
function steelIfcRunInputs(id, inputs) {
|
|
52998
|
+
if (id !== "steel-to-ifc") return inputs;
|
|
52999
|
+
const op = inputs?.output_path;
|
|
53000
|
+
if (op != null && op !== "" && op !== "steel-from-drawings.ifc") return inputs;
|
|
53001
|
+
const dl = (0, import_node_path8.join)((0, import_node_os8.homedir)(), "Downloads");
|
|
53002
|
+
const dir = (0, import_node_fs9.existsSync)(dl) ? dl : (0, import_node_os8.homedir)();
|
|
53003
|
+
return { ...inputs ?? {}, output_path: (0, import_node_path8.join)(dir, "steel-from-drawings.ifc") };
|
|
52923
53004
|
}
|
|
52924
53005
|
|
|
52925
53006
|
// index.ts
|
|
@@ -52967,21 +53048,21 @@ function buildPreview(m, sourceKind, sourceRef, stagedRef) {
|
|
|
52967
53048
|
}
|
|
52968
53049
|
|
|
52969
53050
|
// graft-manifest-reader.ts
|
|
52970
|
-
var
|
|
52971
|
-
var
|
|
53051
|
+
var import_node_fs10 = require("node:fs");
|
|
53052
|
+
var import_node_path9 = require("node:path");
|
|
52972
53053
|
var import_yaml3 = __toESM(require_dist6(), 1);
|
|
52973
53054
|
var asRecord2 = (v) => v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
52974
53055
|
function readStagedManifest(agentDir) {
|
|
52975
|
-
const manifestPath = (0,
|
|
52976
|
-
if (!(0,
|
|
52977
|
-
let
|
|
53056
|
+
const manifestPath = (0, import_node_path9.join)(agentDir, "manifest.yaml");
|
|
53057
|
+
if (!(0, import_node_fs10.existsSync)(manifestPath)) return null;
|
|
53058
|
+
let doc2;
|
|
52978
53059
|
try {
|
|
52979
|
-
|
|
53060
|
+
doc2 = asRecord2((0, import_yaml3.parse)((0, import_node_fs10.readFileSync)(manifestPath, "utf8")));
|
|
52980
53061
|
} catch {
|
|
52981
53062
|
return null;
|
|
52982
53063
|
}
|
|
52983
53064
|
const commands = {};
|
|
52984
|
-
for (const [name, raw] of Object.entries(asRecord2(
|
|
53065
|
+
for (const [name, raw] of Object.entries(asRecord2(doc2.commands))) {
|
|
52985
53066
|
const c = asRecord2(raw);
|
|
52986
53067
|
const inputs = {};
|
|
52987
53068
|
for (const [inName, inRaw] of Object.entries(asRecord2(c.inputs))) {
|
|
@@ -53004,26 +53085,26 @@ function readStagedManifest(agentDir) {
|
|
|
53004
53085
|
inputs
|
|
53005
53086
|
};
|
|
53006
53087
|
}
|
|
53007
|
-
let skillCount = Array.isArray(
|
|
53088
|
+
let skillCount = Array.isArray(doc2.skills) ? doc2.skills.length : 0;
|
|
53008
53089
|
if (!skillCount) {
|
|
53009
|
-
const skillsDir = (0,
|
|
53010
|
-
if ((0,
|
|
53090
|
+
const skillsDir = (0, import_node_path9.join)(agentDir, "skills");
|
|
53091
|
+
if ((0, import_node_fs10.existsSync)(skillsDir)) {
|
|
53011
53092
|
try {
|
|
53012
|
-
skillCount = (0,
|
|
53093
|
+
skillCount = (0, import_node_fs10.readdirSync)(skillsDir).filter((f) => f.endsWith(".md")).length;
|
|
53013
53094
|
} catch {
|
|
53014
53095
|
}
|
|
53015
53096
|
}
|
|
53016
53097
|
}
|
|
53017
53098
|
return {
|
|
53018
|
-
agentId: typeof
|
|
53019
|
-
description: typeof
|
|
53099
|
+
agentId: typeof doc2.agent === "string" ? doc2.agent : "",
|
|
53100
|
+
description: typeof doc2.description === "string" ? doc2.description : "",
|
|
53020
53101
|
skillCount,
|
|
53021
53102
|
commands
|
|
53022
53103
|
};
|
|
53023
53104
|
}
|
|
53024
53105
|
|
|
53025
53106
|
// graft-stage-registry.ts
|
|
53026
|
-
var
|
|
53107
|
+
var import_node_fs11 = require("node:fs");
|
|
53027
53108
|
var TTL_MS = 30 * 60 * 1e3;
|
|
53028
53109
|
var registry = /* @__PURE__ */ new Map();
|
|
53029
53110
|
function registerStage(token, tempDir, agentId) {
|
|
@@ -53045,7 +53126,7 @@ function evict(token) {
|
|
|
53045
53126
|
clearTimeout(e.timer);
|
|
53046
53127
|
registry.delete(token);
|
|
53047
53128
|
try {
|
|
53048
|
-
(0,
|
|
53129
|
+
(0, import_node_fs11.rmSync)(e.tempDir, { recursive: true, force: true });
|
|
53049
53130
|
} catch {
|
|
53050
53131
|
}
|
|
53051
53132
|
}
|
|
@@ -53054,8 +53135,8 @@ function clearAllStages() {
|
|
|
53054
53135
|
}
|
|
53055
53136
|
|
|
53056
53137
|
// graft-commit.ts
|
|
53057
|
-
var
|
|
53058
|
-
var
|
|
53138
|
+
var import_node_fs12 = require("node:fs");
|
|
53139
|
+
var import_node_path10 = require("node:path");
|
|
53059
53140
|
var GraftCommitError = class extends Error {
|
|
53060
53141
|
constructor(message, code) {
|
|
53061
53142
|
super(message);
|
|
@@ -53065,60 +53146,60 @@ var GraftCommitError = class extends Error {
|
|
|
53065
53146
|
code;
|
|
53066
53147
|
};
|
|
53067
53148
|
function commitStaged(tempDir, agentId, targetAgentsDir, force) {
|
|
53068
|
-
const staged = (0,
|
|
53069
|
-
const target = (0,
|
|
53070
|
-
if ((0,
|
|
53149
|
+
const staged = (0, import_node_path10.join)(tempDir, "agents", agentId);
|
|
53150
|
+
const target = (0, import_node_path10.join)(targetAgentsDir, agentId);
|
|
53151
|
+
if ((0, import_node_fs12.existsSync)(target)) {
|
|
53071
53152
|
if (!force) throw new GraftCommitError(`an agent named "${agentId}" is already installed`, "collision");
|
|
53072
|
-
(0,
|
|
53153
|
+
(0, import_node_fs12.rmSync)(target, { recursive: true, force: true });
|
|
53073
53154
|
}
|
|
53074
|
-
(0,
|
|
53155
|
+
(0, import_node_fs12.mkdirSync)(targetAgentsDir, { recursive: true });
|
|
53075
53156
|
try {
|
|
53076
|
-
(0,
|
|
53157
|
+
(0, import_node_fs12.renameSync)(staged, target);
|
|
53077
53158
|
} catch {
|
|
53078
|
-
(0,
|
|
53159
|
+
(0, import_node_fs12.cpSync)(staged, target, { recursive: true });
|
|
53079
53160
|
}
|
|
53080
|
-
(0,
|
|
53161
|
+
(0, import_node_fs12.rmSync)(tempDir, { recursive: true, force: true });
|
|
53081
53162
|
return { agentId };
|
|
53082
53163
|
}
|
|
53083
53164
|
function matchAssemblies(globOrDir) {
|
|
53084
53165
|
let dir;
|
|
53085
53166
|
let pattern;
|
|
53086
|
-
if ((0,
|
|
53167
|
+
if ((0, import_node_fs12.existsSync)(globOrDir) && (0, import_node_fs12.statSync)(globOrDir).isDirectory()) {
|
|
53087
53168
|
dir = globOrDir;
|
|
53088
53169
|
pattern = "*.dll";
|
|
53089
53170
|
} else {
|
|
53090
|
-
dir = (0,
|
|
53091
|
-
pattern = (0,
|
|
53171
|
+
dir = (0, import_node_path10.dirname)(globOrDir);
|
|
53172
|
+
pattern = (0, import_node_path10.basename)(globOrDir);
|
|
53092
53173
|
}
|
|
53093
|
-
if (!dir || !(0,
|
|
53174
|
+
if (!dir || !(0, import_node_fs12.existsSync)(dir) || !(0, import_node_fs12.statSync)(dir).isDirectory()) return [];
|
|
53094
53175
|
const re = globToRegExp(pattern);
|
|
53095
|
-
return (0,
|
|
53176
|
+
return (0, import_node_fs12.readdirSync)(dir).filter((f) => re.test(f)).sort();
|
|
53096
53177
|
}
|
|
53097
53178
|
function globToRegExp(p) {
|
|
53098
|
-
const
|
|
53099
|
-
return new RegExp(`^${
|
|
53179
|
+
const esc2 = p.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/\?/g, ".");
|
|
53180
|
+
return new RegExp(`^${esc2}$`, "i");
|
|
53100
53181
|
}
|
|
53101
53182
|
|
|
53102
53183
|
// floless-store.ts
|
|
53103
53184
|
var import_node_crypto4 = require("node:crypto");
|
|
53104
|
-
var
|
|
53105
|
-
var
|
|
53106
|
-
var
|
|
53107
|
-
var ROOT2 = process.env.FLOLESS_HOME ?? (0,
|
|
53108
|
-
var TEMPLATES_FILE = (0,
|
|
53109
|
-
var REQUESTS_DIR = (0,
|
|
53185
|
+
var import_node_fs13 = require("node:fs");
|
|
53186
|
+
var import_node_os9 = require("node:os");
|
|
53187
|
+
var import_node_path11 = require("node:path");
|
|
53188
|
+
var ROOT2 = process.env.FLOLESS_HOME ?? (0, import_node_path11.join)((0, import_node_os9.homedir)(), ".floless");
|
|
53189
|
+
var TEMPLATES_FILE = (0, import_node_path11.join)(ROOT2, "templates.json");
|
|
53190
|
+
var REQUESTS_DIR = (0, import_node_path11.join)(ROOT2, "requests");
|
|
53110
53191
|
function ensureRoot() {
|
|
53111
|
-
if (!(0,
|
|
53192
|
+
if (!(0, import_node_fs13.existsSync)(ROOT2)) (0, import_node_fs13.mkdirSync)(ROOT2, { recursive: true });
|
|
53112
53193
|
}
|
|
53113
53194
|
function withinRequestsDir(p) {
|
|
53114
|
-
const base = (0,
|
|
53115
|
-
const full = (0,
|
|
53116
|
-
return full === base || full.startsWith(base +
|
|
53195
|
+
const base = (0, import_node_path11.resolve)(REQUESTS_DIR);
|
|
53196
|
+
const full = (0, import_node_path11.resolve)(p);
|
|
53197
|
+
return full === base || full.startsWith(base + import_node_path11.sep);
|
|
53117
53198
|
}
|
|
53118
53199
|
function listTemplates() {
|
|
53119
|
-
if (!(0,
|
|
53200
|
+
if (!(0, import_node_fs13.existsSync)(TEMPLATES_FILE)) return [];
|
|
53120
53201
|
try {
|
|
53121
|
-
const parsed = JSON.parse((0,
|
|
53202
|
+
const parsed = JSON.parse((0, import_node_fs13.readFileSync)(TEMPLATES_FILE, "utf8"));
|
|
53122
53203
|
return Array.isArray(parsed) ? parsed : [];
|
|
53123
53204
|
} catch {
|
|
53124
53205
|
return [];
|
|
@@ -53127,8 +53208,8 @@ function listTemplates() {
|
|
|
53127
53208
|
function writeTemplates(list) {
|
|
53128
53209
|
ensureRoot();
|
|
53129
53210
|
const tmp = `${TEMPLATES_FILE}.${process.pid}.tmp`;
|
|
53130
|
-
(0,
|
|
53131
|
-
(0,
|
|
53211
|
+
(0, import_node_fs13.writeFileSync)(tmp, JSON.stringify(list, null, 2));
|
|
53212
|
+
(0, import_node_fs13.renameSync)(tmp, TEMPLATES_FILE);
|
|
53132
53213
|
}
|
|
53133
53214
|
function addTemplate(input) {
|
|
53134
53215
|
const list = listTemplates();
|
|
@@ -53173,13 +53254,13 @@ function updateTemplate(id, patch) {
|
|
|
53173
53254
|
}
|
|
53174
53255
|
function addRequest(req, decoded = []) {
|
|
53175
53256
|
ensureRoot();
|
|
53176
|
-
if (!(0,
|
|
53257
|
+
if (!(0, import_node_fs13.existsSync)(REQUESTS_DIR)) (0, import_node_fs13.mkdirSync)(REQUESTS_DIR, { recursive: true });
|
|
53177
53258
|
const id = (0, import_node_crypto4.randomUUID)();
|
|
53178
53259
|
const createdAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
53179
53260
|
const base = `${createdAt.replace(/[:.]/g, "-")}__${id}`;
|
|
53180
53261
|
const snapshots = decoded.map((d, i) => {
|
|
53181
|
-
const p = (0,
|
|
53182
|
-
(0,
|
|
53262
|
+
const p = (0, import_node_path11.join)(REQUESTS_DIR, `${base}__snap${i + 1}.${d.ext}`);
|
|
53263
|
+
(0, import_node_fs13.writeFileSync)(p, d.buf);
|
|
53183
53264
|
return p;
|
|
53184
53265
|
});
|
|
53185
53266
|
const full = {
|
|
@@ -53189,55 +53270,55 @@ function addRequest(req, decoded = []) {
|
|
|
53189
53270
|
...req,
|
|
53190
53271
|
...snapshots.length ? { snapshots } : {}
|
|
53191
53272
|
};
|
|
53192
|
-
(0,
|
|
53273
|
+
(0, import_node_fs13.writeFileSync)((0, import_node_path11.join)(REQUESTS_DIR, `${base}.json`), JSON.stringify(full, null, 2));
|
|
53193
53274
|
return full;
|
|
53194
53275
|
}
|
|
53195
53276
|
function listRequests() {
|
|
53196
|
-
if (!(0,
|
|
53197
|
-
return (0,
|
|
53277
|
+
if (!(0, import_node_fs13.existsSync)(REQUESTS_DIR)) return [];
|
|
53278
|
+
return (0, import_node_fs13.readdirSync)(REQUESTS_DIR).filter((f) => f.endsWith(".json")).sort().map((f) => {
|
|
53198
53279
|
try {
|
|
53199
|
-
return JSON.parse((0,
|
|
53280
|
+
return JSON.parse((0, import_node_fs13.readFileSync)((0, import_node_path11.join)(REQUESTS_DIR, f), "utf8"));
|
|
53200
53281
|
} catch {
|
|
53201
53282
|
return null;
|
|
53202
53283
|
}
|
|
53203
53284
|
}).filter((r) => r !== null);
|
|
53204
53285
|
}
|
|
53205
53286
|
function deleteRequest(id) {
|
|
53206
|
-
if (!(0,
|
|
53207
|
-
const file = (0,
|
|
53287
|
+
if (!(0, import_node_fs13.existsSync)(REQUESTS_DIR)) return false;
|
|
53288
|
+
const file = (0, import_node_fs13.readdirSync)(REQUESTS_DIR).find((f) => f.endsWith(`__${id}.json`));
|
|
53208
53289
|
if (!file) return false;
|
|
53209
53290
|
try {
|
|
53210
|
-
const parsed = JSON.parse((0,
|
|
53291
|
+
const parsed = JSON.parse((0, import_node_fs13.readFileSync)((0, import_node_path11.join)(REQUESTS_DIR, file), "utf8"));
|
|
53211
53292
|
for (const p of parsed.snapshots ?? []) {
|
|
53212
53293
|
if (!withinRequestsDir(p)) continue;
|
|
53213
53294
|
try {
|
|
53214
|
-
(0,
|
|
53295
|
+
(0, import_node_fs13.rmSync)(p);
|
|
53215
53296
|
} catch {
|
|
53216
53297
|
}
|
|
53217
53298
|
}
|
|
53218
53299
|
} catch {
|
|
53219
53300
|
}
|
|
53220
|
-
(0,
|
|
53301
|
+
(0, import_node_fs13.rmSync)((0, import_node_path11.join)(REQUESTS_DIR, file));
|
|
53221
53302
|
return true;
|
|
53222
53303
|
}
|
|
53223
53304
|
function clearRequests() {
|
|
53224
|
-
if (!(0,
|
|
53225
|
-
const allFiles = (0,
|
|
53305
|
+
if (!(0, import_node_fs13.existsSync)(REQUESTS_DIR)) return 0;
|
|
53306
|
+
const allFiles = (0, import_node_fs13.readdirSync)(REQUESTS_DIR);
|
|
53226
53307
|
const jsonFiles = allFiles.filter((f) => f.endsWith(".json"));
|
|
53227
53308
|
for (const f of allFiles) {
|
|
53228
53309
|
try {
|
|
53229
|
-
(0,
|
|
53310
|
+
(0, import_node_fs13.rmSync)((0, import_node_path11.join)(REQUESTS_DIR, f));
|
|
53230
53311
|
} catch {
|
|
53231
53312
|
}
|
|
53232
53313
|
}
|
|
53233
53314
|
return jsonFiles.length;
|
|
53234
53315
|
}
|
|
53235
53316
|
function snapshotPathFor(id, n) {
|
|
53236
|
-
if (!(0,
|
|
53237
|
-
const file = (0,
|
|
53317
|
+
if (!(0, import_node_fs13.existsSync)(REQUESTS_DIR)) return null;
|
|
53318
|
+
const file = (0, import_node_fs13.readdirSync)(REQUESTS_DIR).find((f) => f.endsWith(`__${id}.json`));
|
|
53238
53319
|
if (!file) return null;
|
|
53239
53320
|
try {
|
|
53240
|
-
const parsed = JSON.parse((0,
|
|
53321
|
+
const parsed = JSON.parse((0, import_node_fs13.readFileSync)((0, import_node_path11.join)(REQUESTS_DIR, file), "utf8"));
|
|
53241
53322
|
const cand = parsed.snapshots?.[n] ?? null;
|
|
53242
53323
|
return cand && withinRequestsDir(cand) ? cand : null;
|
|
53243
53324
|
} catch {
|
|
@@ -53274,15 +53355,15 @@ function decodeSnapshots(inputs) {
|
|
|
53274
53355
|
|
|
53275
53356
|
// visual-input-store.ts
|
|
53276
53357
|
var import_node_crypto5 = require("node:crypto");
|
|
53277
|
-
var
|
|
53278
|
-
var
|
|
53279
|
-
var
|
|
53358
|
+
var import_node_fs14 = require("node:fs");
|
|
53359
|
+
var import_node_os10 = require("node:os");
|
|
53360
|
+
var import_node_path12 = require("node:path");
|
|
53280
53361
|
var MAX_BYTES3 = 25 * 1024 * 1024;
|
|
53281
53362
|
var VisualInputError = class extends Error {
|
|
53282
53363
|
};
|
|
53283
53364
|
function inputsDir() {
|
|
53284
|
-
const root = process.env.FLOLESS_HOME ?? (0,
|
|
53285
|
-
return (0,
|
|
53365
|
+
const root = process.env.FLOLESS_HOME ?? (0, import_node_path12.join)((0, import_node_os10.homedir)(), ".floless");
|
|
53366
|
+
return (0, import_node_path12.join)(root, "inputs");
|
|
53286
53367
|
}
|
|
53287
53368
|
function sniffExt2(buf) {
|
|
53288
53369
|
if (buf.length >= 8 && buf[0] === 137 && buf[1] === 80 && buf[2] === 78 && buf[3] === 71) return "png";
|
|
@@ -53294,7 +53375,7 @@ function sniffExt2(buf) {
|
|
|
53294
53375
|
var RESERVED = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i;
|
|
53295
53376
|
function safeSegment(s) {
|
|
53296
53377
|
if (!s || s === "." || s.includes("..")) return false;
|
|
53297
|
-
if (s.includes("/") || s.includes("\\") || s.includes(
|
|
53378
|
+
if (s.includes("/") || s.includes("\\") || s.includes(import_node_path12.sep)) return false;
|
|
53298
53379
|
for (let i = 0; i < s.length; i++) {
|
|
53299
53380
|
const c = s.charCodeAt(i);
|
|
53300
53381
|
if (c < 32 || c === 58) return false;
|
|
@@ -53312,50 +53393,50 @@ function storeVisualInput(appId, dataUrl) {
|
|
|
53312
53393
|
const ext = sniffExt2(buf);
|
|
53313
53394
|
if (!ext) throw new VisualInputError("visual input must be PNG, JPEG, WebP, or PDF");
|
|
53314
53395
|
const sha2562 = (0, import_node_crypto5.createHash)("sha256").update(buf).digest("hex");
|
|
53315
|
-
const dir = (0,
|
|
53316
|
-
const path = (0,
|
|
53317
|
-
const root = (0,
|
|
53318
|
-
const target = (0,
|
|
53319
|
-
if (target !== root && !target.startsWith(root +
|
|
53396
|
+
const dir = (0, import_node_path12.join)(inputsDir(), appId);
|
|
53397
|
+
const path = (0, import_node_path12.join)(dir, `${sha2562}.${ext}`);
|
|
53398
|
+
const root = (0, import_node_path12.resolve)(inputsDir());
|
|
53399
|
+
const target = (0, import_node_path12.resolve)(path);
|
|
53400
|
+
if (target !== root && !target.startsWith(root + import_node_path12.sep)) {
|
|
53320
53401
|
throw new VisualInputError("refusing to write outside the inputs root");
|
|
53321
53402
|
}
|
|
53322
|
-
(0,
|
|
53323
|
-
if (!(0,
|
|
53403
|
+
(0, import_node_fs14.mkdirSync)(dir, { recursive: true });
|
|
53404
|
+
if (!(0, import_node_fs14.existsSync)(path)) {
|
|
53324
53405
|
const tmp = `${path}.tmp`;
|
|
53325
|
-
(0,
|
|
53326
|
-
(0,
|
|
53406
|
+
(0, import_node_fs14.writeFileSync)(tmp, buf);
|
|
53407
|
+
(0, import_node_fs14.renameSync)(tmp, path);
|
|
53327
53408
|
}
|
|
53328
|
-
return { path, ext, bytes: (0,
|
|
53409
|
+
return { path, ext, bytes: (0, import_node_fs14.statSync)(path).size, sha256: sha2562 };
|
|
53329
53410
|
}
|
|
53330
53411
|
function renameVisualInputs(oldId, newId) {
|
|
53331
53412
|
if (!safeSegment(oldId) || !safeSegment(newId)) throw new VisualInputError("invalid app id");
|
|
53332
|
-
const from = (0,
|
|
53333
|
-
if (!(0,
|
|
53334
|
-
const to = (0,
|
|
53335
|
-
if ((0,
|
|
53336
|
-
(0,
|
|
53337
|
-
(0,
|
|
53413
|
+
const from = (0, import_node_path12.join)(inputsDir(), oldId);
|
|
53414
|
+
if (!(0, import_node_fs14.existsSync)(from)) return;
|
|
53415
|
+
const to = (0, import_node_path12.join)(inputsDir(), newId);
|
|
53416
|
+
if ((0, import_node_fs14.existsSync)(to)) (0, import_node_fs14.rmSync)(to, { recursive: true, force: true });
|
|
53417
|
+
(0, import_node_fs14.mkdirSync)(inputsDir(), { recursive: true });
|
|
53418
|
+
(0, import_node_fs14.renameSync)(from, to);
|
|
53338
53419
|
}
|
|
53339
53420
|
function copyVisualInputs(srcId, newId) {
|
|
53340
53421
|
if (!safeSegment(srcId) || !safeSegment(newId)) throw new VisualInputError("invalid app id");
|
|
53341
|
-
const from = (0,
|
|
53342
|
-
if (!(0,
|
|
53343
|
-
(0,
|
|
53422
|
+
const from = (0, import_node_path12.join)(inputsDir(), srcId);
|
|
53423
|
+
if (!(0, import_node_fs14.existsSync)(from)) return;
|
|
53424
|
+
(0, import_node_fs14.cpSync)(from, (0, import_node_path12.join)(inputsDir(), newId), { recursive: true });
|
|
53344
53425
|
}
|
|
53345
53426
|
function deleteVisualInputs(id) {
|
|
53346
53427
|
if (!safeSegment(id)) throw new VisualInputError("invalid app id");
|
|
53347
|
-
const dir = (0,
|
|
53348
|
-
if ((0,
|
|
53428
|
+
const dir = (0, import_node_path12.join)(inputsDir(), id);
|
|
53429
|
+
if ((0, import_node_fs14.existsSync)(dir)) (0, import_node_fs14.rmSync)(dir, { recursive: true, force: true });
|
|
53349
53430
|
}
|
|
53350
53431
|
|
|
53351
53432
|
// app-lifecycle.ts
|
|
53352
|
-
var
|
|
53353
|
-
var
|
|
53354
|
-
var
|
|
53433
|
+
var import_node_fs17 = require("node:fs");
|
|
53434
|
+
var import_node_os12 = require("node:os");
|
|
53435
|
+
var import_node_path15 = require("node:path");
|
|
53355
53436
|
|
|
53356
53437
|
// routines.ts
|
|
53357
|
-
var
|
|
53358
|
-
var
|
|
53438
|
+
var import_node_fs16 = require("node:fs");
|
|
53439
|
+
var import_node_path14 = require("node:path");
|
|
53359
53440
|
|
|
53360
53441
|
// sse.ts
|
|
53361
53442
|
var clients = /* @__PURE__ */ new Set();
|
|
@@ -53392,11 +53473,11 @@ function clientCount() {
|
|
|
53392
53473
|
}
|
|
53393
53474
|
|
|
53394
53475
|
// trigger-sessions.ts
|
|
53395
|
-
var
|
|
53396
|
-
var
|
|
53397
|
-
var
|
|
53476
|
+
var import_node_fs15 = require("node:fs");
|
|
53477
|
+
var import_node_os11 = require("node:os");
|
|
53478
|
+
var import_node_path13 = require("node:path");
|
|
53398
53479
|
var import_yaml4 = __toESM(require_dist6(), 1);
|
|
53399
|
-
var AGENTS_DIR2 = process.env.AWARE_HOME ? (0,
|
|
53480
|
+
var AGENTS_DIR2 = process.env.AWARE_HOME ? (0, import_node_path13.join)(process.env.AWARE_HOME, "agents") : (0, import_node_path13.join)((0, import_node_os11.homedir)(), ".aware", "agents");
|
|
53400
53481
|
function summarizeFire(data) {
|
|
53401
53482
|
if (!data) return "event";
|
|
53402
53483
|
const type = typeof data.type === "string" ? data.type : "";
|
|
@@ -53413,11 +53494,11 @@ function mapTriggerState(phase) {
|
|
|
53413
53494
|
function isHostBacked(agent, agentsDir = AGENTS_DIR2) {
|
|
53414
53495
|
const safe = (n) => !n.includes("/") && !n.includes("\\") && !n.includes("..");
|
|
53415
53496
|
if (!safe(agent)) return false;
|
|
53416
|
-
const manifestPath = (0,
|
|
53417
|
-
if (!(0,
|
|
53497
|
+
const manifestPath = (0, import_node_path13.join)(agentsDir, agent, "manifest.yaml");
|
|
53498
|
+
if (!(0, import_node_fs15.existsSync)(manifestPath)) return false;
|
|
53418
53499
|
try {
|
|
53419
|
-
const
|
|
53420
|
-
const transport =
|
|
53500
|
+
const doc2 = (0, import_yaml4.parse)((0, import_node_fs15.readFileSync)(manifestPath, "utf8"));
|
|
53501
|
+
const transport = doc2?.transport;
|
|
53421
53502
|
return !!(transport && typeof transport === "object" && "cli" in transport);
|
|
53422
53503
|
} catch {
|
|
53423
53504
|
return false;
|
|
@@ -53691,7 +53772,7 @@ var RoutineError = class extends Error {
|
|
|
53691
53772
|
}
|
|
53692
53773
|
status;
|
|
53693
53774
|
};
|
|
53694
|
-
var ROUTINES_FILE = (0,
|
|
53775
|
+
var ROUTINES_FILE = (0, import_node_path14.join)(flolessRoot, "routines.json");
|
|
53695
53776
|
var routines = [];
|
|
53696
53777
|
var loaded = false;
|
|
53697
53778
|
function ensureLoaded() {
|
|
@@ -53727,10 +53808,10 @@ function sanitizeRoutine(raw) {
|
|
|
53727
53808
|
};
|
|
53728
53809
|
}
|
|
53729
53810
|
function loadFromDisk() {
|
|
53730
|
-
if (!(0,
|
|
53811
|
+
if (!(0, import_node_fs16.existsSync)(ROUTINES_FILE)) return [];
|
|
53731
53812
|
let text;
|
|
53732
53813
|
try {
|
|
53733
|
-
text = (0,
|
|
53814
|
+
text = (0, import_node_fs16.readFileSync)(ROUTINES_FILE, "utf8");
|
|
53734
53815
|
} catch {
|
|
53735
53816
|
return [];
|
|
53736
53817
|
}
|
|
@@ -53739,17 +53820,17 @@ function loadFromDisk() {
|
|
|
53739
53820
|
return Array.isArray(parsed) ? parsed.map(sanitizeRoutine).filter((r) => r !== null) : [];
|
|
53740
53821
|
} catch {
|
|
53741
53822
|
try {
|
|
53742
|
-
(0,
|
|
53823
|
+
(0, import_node_fs16.renameSync)(ROUTINES_FILE, `${ROUTINES_FILE}.corrupt-${Date.now()}`);
|
|
53743
53824
|
} catch {
|
|
53744
53825
|
}
|
|
53745
53826
|
return [];
|
|
53746
53827
|
}
|
|
53747
53828
|
}
|
|
53748
53829
|
function saveRoutines() {
|
|
53749
|
-
if (!(0,
|
|
53830
|
+
if (!(0, import_node_fs16.existsSync)(flolessRoot)) (0, import_node_fs16.mkdirSync)(flolessRoot, { recursive: true });
|
|
53750
53831
|
const tmp = `${ROUTINES_FILE}.${process.pid}.tmp`;
|
|
53751
|
-
(0,
|
|
53752
|
-
(0,
|
|
53832
|
+
(0, import_node_fs16.writeFileSync)(tmp, JSON.stringify(routines, null, 2));
|
|
53833
|
+
(0, import_node_fs16.renameSync)(tmp, ROUTINES_FILE);
|
|
53753
53834
|
}
|
|
53754
53835
|
function listRoutines() {
|
|
53755
53836
|
ensureLoaded();
|
|
@@ -54144,13 +54225,13 @@ var AppLifecycleError = class extends Error {
|
|
|
54144
54225
|
}
|
|
54145
54226
|
};
|
|
54146
54227
|
function appsDir() {
|
|
54147
|
-
return process.env.AWARE_HOME ? (0,
|
|
54228
|
+
return process.env.AWARE_HOME ? (0, import_node_path15.join)(process.env.AWARE_HOME, "apps") : (0, import_node_path15.join)((0, import_node_os12.homedir)(), ".aware", "apps");
|
|
54148
54229
|
}
|
|
54149
54230
|
function appDirPath(id) {
|
|
54150
|
-
return (0,
|
|
54231
|
+
return (0, import_node_path15.join)(appsDir(), id);
|
|
54151
54232
|
}
|
|
54152
54233
|
function appInstalled(id) {
|
|
54153
|
-
return APP_ID3.test(id) && (0,
|
|
54234
|
+
return APP_ID3.test(id) && (0, import_node_fs17.existsSync)(appDirPath(id));
|
|
54154
54235
|
}
|
|
54155
54236
|
function logCascade(what, e) {
|
|
54156
54237
|
console.error(`[app-lifecycle] cascade step failed (${what}):`, e instanceof Error ? e.message : e);
|
|
@@ -54248,9 +54329,9 @@ function isGatedAwareRoute(url, method) {
|
|
|
54248
54329
|
|
|
54249
54330
|
// autostart.mjs
|
|
54250
54331
|
var import_node_child_process3 = require("node:child_process");
|
|
54251
|
-
var
|
|
54252
|
-
var
|
|
54253
|
-
var
|
|
54332
|
+
var import_node_fs18 = require("node:fs");
|
|
54333
|
+
var import_node_os13 = require("node:os");
|
|
54334
|
+
var import_node_path16 = require("node:path");
|
|
54254
54335
|
|
|
54255
54336
|
// teardown.mjs
|
|
54256
54337
|
var RUN_KEY = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run";
|
|
@@ -54362,8 +54443,8 @@ function removeLegacyRunKey() {
|
|
|
54362
54443
|
}
|
|
54363
54444
|
function logLine(msg) {
|
|
54364
54445
|
try {
|
|
54365
|
-
(0,
|
|
54366
|
-
(0,
|
|
54446
|
+
(0, import_node_fs18.mkdirSync)(logDir(), { recursive: true });
|
|
54447
|
+
(0, import_node_fs18.appendFileSync)(logFilePath(), `${(/* @__PURE__ */ new Date()).toISOString()} ${msg}
|
|
54367
54448
|
`);
|
|
54368
54449
|
} catch {
|
|
54369
54450
|
}
|
|
@@ -54371,8 +54452,8 @@ function logLine(msg) {
|
|
|
54371
54452
|
function registerAutostart(exePath) {
|
|
54372
54453
|
if (!isWin) return;
|
|
54373
54454
|
const xml = buildAutostartTaskXml(exePath, currentUserId());
|
|
54374
|
-
const tmp = (0,
|
|
54375
|
-
(0,
|
|
54455
|
+
const tmp = (0, import_node_path16.join)((0, import_node_os13.tmpdir)(), `floless-autostart-${process.pid}-${Date.now()}.xml`);
|
|
54456
|
+
(0, import_node_fs18.writeFileSync)(tmp, "\uFEFF" + xml, { encoding: "utf16le" });
|
|
54376
54457
|
try {
|
|
54377
54458
|
(0, import_node_child_process3.execFileSync)("schtasks", ["/Create", "/TN", TASK_NAME, "/XML", tmp, "/F"], {
|
|
54378
54459
|
stdio: ["ignore", "ignore", "ignore"],
|
|
@@ -54383,7 +54464,7 @@ function registerAutostart(exePath) {
|
|
|
54383
54464
|
throw err;
|
|
54384
54465
|
} finally {
|
|
54385
54466
|
try {
|
|
54386
|
-
(0,
|
|
54467
|
+
(0, import_node_fs18.rmSync)(tmp, { force: true });
|
|
54387
54468
|
} catch {
|
|
54388
54469
|
}
|
|
54389
54470
|
}
|
|
@@ -54418,26 +54499,26 @@ function unregisterAutostart() {
|
|
|
54418
54499
|
// updater.ts
|
|
54419
54500
|
var import_node_child_process4 = require("node:child_process");
|
|
54420
54501
|
var import_node_crypto6 = require("node:crypto");
|
|
54421
|
-
var
|
|
54502
|
+
var import_node_fs20 = require("node:fs");
|
|
54422
54503
|
var import_node_stream = require("node:stream");
|
|
54423
54504
|
var import_promises = require("node:stream/promises");
|
|
54424
|
-
var
|
|
54505
|
+
var import_node_path18 = require("node:path");
|
|
54425
54506
|
|
|
54426
54507
|
// post-update-marker.mjs
|
|
54427
|
-
var
|
|
54428
|
-
var
|
|
54429
|
-
var
|
|
54508
|
+
var import_node_fs19 = require("node:fs");
|
|
54509
|
+
var import_node_os14 = require("node:os");
|
|
54510
|
+
var import_node_path17 = require("node:path");
|
|
54430
54511
|
var FRESH_MS = 12e4;
|
|
54431
54512
|
function markerPath() {
|
|
54432
54513
|
const override = (process.env.FLOLESS_POST_UPDATE_MARKER ?? "").trim();
|
|
54433
54514
|
if (override) return override;
|
|
54434
|
-
const root = process.env.FLOLESS_HOME ?? (0,
|
|
54435
|
-
return (0,
|
|
54515
|
+
const root = process.env.FLOLESS_HOME ?? (0, import_node_path17.join)((0, import_node_os14.homedir)(), ".floless");
|
|
54516
|
+
return (0, import_node_path17.join)(root, ".post-update");
|
|
54436
54517
|
}
|
|
54437
54518
|
function legacyMarkerPath() {
|
|
54438
54519
|
if ((process.env.FLOLESS_POST_UPDATE_MARKER ?? "").trim()) return null;
|
|
54439
54520
|
try {
|
|
54440
|
-
return (0,
|
|
54521
|
+
return (0, import_node_path17.join)((0, import_node_path17.dirname)((0, import_node_path17.dirname)(process.execPath)), ".floless-post-update");
|
|
54441
54522
|
} catch {
|
|
54442
54523
|
return null;
|
|
54443
54524
|
}
|
|
@@ -54447,7 +54528,7 @@ function writePostUpdateMarker() {
|
|
|
54447
54528
|
for (const p of [markerPath(), legacyMarkerPath()]) {
|
|
54448
54529
|
if (!p) continue;
|
|
54449
54530
|
try {
|
|
54450
|
-
(0,
|
|
54531
|
+
(0, import_node_fs19.writeFileSync)(p, (/* @__PURE__ */ new Date()).toISOString());
|
|
54451
54532
|
wrote = true;
|
|
54452
54533
|
} catch {
|
|
54453
54534
|
}
|
|
@@ -54459,9 +54540,9 @@ function consumePostUpdateMarker() {
|
|
|
54459
54540
|
for (const p of [markerPath(), legacyMarkerPath()]) {
|
|
54460
54541
|
if (!p) continue;
|
|
54461
54542
|
try {
|
|
54462
|
-
if (!(0,
|
|
54463
|
-
const ageMs = Date.now() - (0,
|
|
54464
|
-
(0,
|
|
54543
|
+
if (!(0, import_node_fs19.existsSync)(p)) continue;
|
|
54544
|
+
const ageMs = Date.now() - (0, import_node_fs19.statSync)(p).mtimeMs;
|
|
54545
|
+
(0, import_node_fs19.rmSync)(p, { force: true });
|
|
54465
54546
|
if (ageMs < FRESH_MS) fresh = true;
|
|
54466
54547
|
} catch {
|
|
54467
54548
|
}
|
|
@@ -54478,13 +54559,13 @@ function currentVersion() {
|
|
|
54478
54559
|
return appVersion();
|
|
54479
54560
|
}
|
|
54480
54561
|
function installRoot() {
|
|
54481
|
-
return (0,
|
|
54562
|
+
return (0, import_node_path18.dirname)((0, import_node_path18.dirname)(process.execPath));
|
|
54482
54563
|
}
|
|
54483
54564
|
function updateExePath() {
|
|
54484
|
-
return (0,
|
|
54565
|
+
return (0, import_node_path18.join)(installRoot(), "Update.exe");
|
|
54485
54566
|
}
|
|
54486
54567
|
function packagesDir() {
|
|
54487
|
-
return (0,
|
|
54568
|
+
return (0, import_node_path18.join)(installRoot(), "packages");
|
|
54488
54569
|
}
|
|
54489
54570
|
function feedUrl() {
|
|
54490
54571
|
const env2 = (process.env.FLOLESS_UPDATE_URL ?? "").trim().replace(/\/+$/, "");
|
|
@@ -54577,22 +54658,22 @@ async function checkForUpdate() {
|
|
|
54577
54658
|
}
|
|
54578
54659
|
async function sha1OfFile(path) {
|
|
54579
54660
|
const hash = (0, import_node_crypto6.createHash)("sha1");
|
|
54580
|
-
await (0, import_promises.pipeline)((0,
|
|
54661
|
+
await (0, import_promises.pipeline)((0, import_node_fs20.createReadStream)(path), hash);
|
|
54581
54662
|
return hash.digest("hex").toUpperCase();
|
|
54582
54663
|
}
|
|
54583
54664
|
async function downloadPackage(asset) {
|
|
54584
54665
|
if (!NUPKG_NAME.test(asset.FileName)) throw new Error(`refusing suspicious package name: ${asset.FileName}`);
|
|
54585
54666
|
const want = asset.SHA1.toUpperCase();
|
|
54586
54667
|
const dir = packagesDir();
|
|
54587
|
-
(0,
|
|
54588
|
-
const dest = (0,
|
|
54589
|
-
if ((0,
|
|
54668
|
+
(0, import_node_fs20.mkdirSync)(dir, { recursive: true });
|
|
54669
|
+
const dest = (0, import_node_path18.join)(dir, asset.FileName);
|
|
54670
|
+
if ((0, import_node_fs20.existsSync)(dest) && await sha1OfFile(dest) === want) return dest;
|
|
54590
54671
|
const res = await authedFetch(`${feedUrl()}/${encodeURIComponent(asset.FileName)}`, {
|
|
54591
54672
|
redirect: "follow",
|
|
54592
54673
|
signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS)
|
|
54593
54674
|
});
|
|
54594
54675
|
if (!res.ok || !res.body) throw new Error(`download failed: HTTP ${res.status} for ${asset.FileName}`);
|
|
54595
|
-
await (0, import_promises.pipeline)(import_node_stream.Readable.fromWeb(res.body), (0,
|
|
54676
|
+
await (0, import_promises.pipeline)(import_node_stream.Readable.fromWeb(res.body), (0, import_node_fs20.createWriteStream)(dest));
|
|
54596
54677
|
const got = await sha1OfFile(dest);
|
|
54597
54678
|
if (got !== want) throw new Error(`SHA1 mismatch for ${asset.FileName}: feed=${want} got=${got}`);
|
|
54598
54679
|
return dest;
|
|
@@ -54601,7 +54682,7 @@ async function applyUpdate(check, opts) {
|
|
|
54601
54682
|
if (!check.supported) return { applied: false, message: check.reason ?? "auto-update not supported in this runtime" };
|
|
54602
54683
|
if (!check.updateAvailable || !check.asset) return { applied: false, message: check.reason ?? "no update available" };
|
|
54603
54684
|
const exe = updateExePath();
|
|
54604
|
-
if (!(0,
|
|
54685
|
+
if (!(0, import_node_fs20.existsSync)(exe)) {
|
|
54605
54686
|
return { applied: false, message: `Update.exe not found at ${exe} \u2014 is this a Velopack install?` };
|
|
54606
54687
|
}
|
|
54607
54688
|
const pkg = await downloadPackage(check.asset);
|
|
@@ -54810,12 +54891,12 @@ function isTraceCorrupt(events) {
|
|
|
54810
54891
|
|
|
54811
54892
|
// launch.mjs
|
|
54812
54893
|
var import_node_child_process5 = require("node:child_process");
|
|
54813
|
-
var
|
|
54894
|
+
var import_node_path19 = require("node:path");
|
|
54814
54895
|
var import_node_url = require("node:url");
|
|
54815
|
-
var
|
|
54896
|
+
var import_node_fs21 = require("node:fs");
|
|
54816
54897
|
var import_node_http = __toESM(require("node:http"), 1);
|
|
54817
54898
|
var import_node_readline = require("node:readline");
|
|
54818
|
-
var __dirname2 = (0,
|
|
54899
|
+
var __dirname2 = (0, import_node_path19.dirname)((0, import_node_url.fileURLToPath)(__import_meta_url));
|
|
54819
54900
|
var PORT = Number(process.env.PORT ?? 4317);
|
|
54820
54901
|
var HEALTH_URL = `http://127.0.0.1:${PORT}/api/health`;
|
|
54821
54902
|
var BROWSER_URL = `http://floless.localhost:${PORT}`;
|
|
@@ -54887,8 +54968,8 @@ async function waitHealthy(timeoutMs = 3e4) {
|
|
|
54887
54968
|
function resolveServerStart() {
|
|
54888
54969
|
const packaged = /flolessapp\.exe$/i.test(process.execPath);
|
|
54889
54970
|
if (packaged) return { cmd: process.execPath, args: ["--serve"], shell: false };
|
|
54890
|
-
const bundle = (0,
|
|
54891
|
-
if ((0,
|
|
54971
|
+
const bundle = (0, import_node_path19.join)(__dirname2, "dist", "floless-server.cjs");
|
|
54972
|
+
if ((0, import_node_fs21.existsSync)(bundle)) return { cmd: process.execPath, args: [bundle, "--serve"], shell: false };
|
|
54892
54973
|
return { cmd: "npm", args: ["run", "start"], shell: isWin2 };
|
|
54893
54974
|
}
|
|
54894
54975
|
function startServerDetached() {
|
|
@@ -55041,8 +55122,8 @@ function taskkillArgs(pid, { tree = true } = {}) {
|
|
|
55041
55122
|
}
|
|
55042
55123
|
function killSupervisor({ tree = true } = {}) {
|
|
55043
55124
|
if (!isWin2) return;
|
|
55044
|
-
const isNpmChannel = /^node(\.exe)?$/i.test((0,
|
|
55045
|
-
const scriptMatch = isNpmChannel ? (0,
|
|
55125
|
+
const isNpmChannel = /^node(\.exe)?$/i.test((0, import_node_path19.basename)(process.execPath));
|
|
55126
|
+
const scriptMatch = isNpmChannel ? (0, import_node_path19.basename)((0, import_node_url.fileURLToPath)(__import_meta_url)) : void 0;
|
|
55046
55127
|
const realExe = resolveRealInstallExe(process.execPath);
|
|
55047
55128
|
const exeMatch = realExe === process.execPath ? process.execPath : [process.execPath, realExe];
|
|
55048
55129
|
const pids = supervisorPidsToKill(enumerateProcesses(), process.pid, exeMatch, scriptMatch);
|
|
@@ -55207,7 +55288,7 @@ async function runAction(arg, flagArgv = [], selfVersion = null) {
|
|
|
55207
55288
|
}
|
|
55208
55289
|
await action(parseTeardownFlags(flagArgv));
|
|
55209
55290
|
}
|
|
55210
|
-
var entry = (0,
|
|
55291
|
+
var entry = (0, import_node_path19.basename)(process.argv[1] ?? "").toLowerCase();
|
|
55211
55292
|
if (entry === "launch.mjs") {
|
|
55212
55293
|
runAction(process.argv[2], process.argv.slice(3)).catch((e) => {
|
|
55213
55294
|
log(`error: ${e?.message ?? e}`);
|
|
@@ -55281,9 +55362,9 @@ function awareUpgradeBlockReason(s) {
|
|
|
55281
55362
|
}
|
|
55282
55363
|
|
|
55283
55364
|
// skill-sync.ts
|
|
55284
|
-
var
|
|
55285
|
-
var
|
|
55286
|
-
var
|
|
55365
|
+
var import_node_fs22 = require("node:fs");
|
|
55366
|
+
var import_node_os15 = require("node:os");
|
|
55367
|
+
var import_node_path20 = require("node:path");
|
|
55287
55368
|
var import_node_url2 = require("node:url");
|
|
55288
55369
|
var import_yaml5 = __toESM(require_dist6(), 1);
|
|
55289
55370
|
|
|
@@ -55312,30 +55393,30 @@ function selectShippedSkillNames(names) {
|
|
|
55312
55393
|
}
|
|
55313
55394
|
|
|
55314
55395
|
// skill-sync.ts
|
|
55315
|
-
var __dirname3 = (0,
|
|
55396
|
+
var __dirname3 = (0, import_node_path20.dirname)((0, import_node_url2.fileURLToPath)(__import_meta_url));
|
|
55316
55397
|
function bundledSkillsRoot() {
|
|
55317
55398
|
const candidates = [
|
|
55318
|
-
(0,
|
|
55319
|
-
(0,
|
|
55320
|
-
(0,
|
|
55399
|
+
(0, import_node_path20.join)(__dirname3, "skills"),
|
|
55400
|
+
(0, import_node_path20.join)((0, import_node_path20.dirname)(process.execPath), "skills"),
|
|
55401
|
+
(0, import_node_path20.join)(__dirname3, "..", ".claude", "skills")
|
|
55321
55402
|
];
|
|
55322
|
-
return candidates.find((p) => (0,
|
|
55403
|
+
return candidates.find((p) => (0, import_node_fs22.existsSync)(p)) ?? null;
|
|
55323
55404
|
}
|
|
55324
55405
|
function targetConfigDirs() {
|
|
55325
55406
|
const override = process.env.FLOLESS_SKILL_TARGETS;
|
|
55326
55407
|
if (override) {
|
|
55327
55408
|
return override.split(";").map((d) => d.trim()).filter(Boolean).map((dir) => ({ runtime: "custom", dir }));
|
|
55328
55409
|
}
|
|
55329
|
-
const home = (0,
|
|
55410
|
+
const home = (0, import_node_os15.homedir)();
|
|
55330
55411
|
return [
|
|
55331
|
-
{ runtime: "claude", dir: (0,
|
|
55332
|
-
{ runtime: "codex", dir: (0,
|
|
55333
|
-
{ runtime: "opencode", dir: (0,
|
|
55412
|
+
{ runtime: "claude", dir: (0, import_node_path20.join)(home, ".claude") },
|
|
55413
|
+
{ runtime: "codex", dir: (0, import_node_path20.join)(home, ".codex") },
|
|
55414
|
+
{ runtime: "opencode", dir: (0, import_node_path20.join)(home, ".opencode") }
|
|
55334
55415
|
];
|
|
55335
55416
|
}
|
|
55336
55417
|
function skillVersion(skillMdPath) {
|
|
55337
55418
|
try {
|
|
55338
|
-
const text = (0,
|
|
55419
|
+
const text = (0, import_node_fs22.readFileSync)(skillMdPath, "utf8");
|
|
55339
55420
|
const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(text);
|
|
55340
55421
|
if (!m || m[1] === void 0) return null;
|
|
55341
55422
|
const fm = (0, import_yaml5.parse)(m[1]);
|
|
@@ -55375,21 +55456,21 @@ function decideAction(installed, bundled) {
|
|
|
55375
55456
|
function bundledSkills(root) {
|
|
55376
55457
|
let entries = [];
|
|
55377
55458
|
try {
|
|
55378
|
-
entries = selectShippedSkillNames((0,
|
|
55459
|
+
entries = selectShippedSkillNames((0, import_node_fs22.readdirSync)(root));
|
|
55379
55460
|
} catch {
|
|
55380
55461
|
return [];
|
|
55381
55462
|
}
|
|
55382
55463
|
const out = [];
|
|
55383
55464
|
for (const name of entries) {
|
|
55384
|
-
const dir = (0,
|
|
55465
|
+
const dir = (0, import_node_path20.join)(root, name);
|
|
55385
55466
|
let isDir = false;
|
|
55386
55467
|
try {
|
|
55387
|
-
isDir = (0,
|
|
55468
|
+
isDir = (0, import_node_fs22.statSync)(dir).isDirectory();
|
|
55388
55469
|
} catch {
|
|
55389
55470
|
isDir = false;
|
|
55390
55471
|
}
|
|
55391
55472
|
if (!isDir) continue;
|
|
55392
|
-
const v = skillVersion((0,
|
|
55473
|
+
const v = skillVersion((0, import_node_path20.join)(dir, "SKILL.md"));
|
|
55393
55474
|
if (!v) continue;
|
|
55394
55475
|
out.push({ name, dir, version: v });
|
|
55395
55476
|
}
|
|
@@ -55402,17 +55483,17 @@ function syncSkills() {
|
|
|
55402
55483
|
const skills = bundledSkills(root);
|
|
55403
55484
|
if (!skills.length) return results;
|
|
55404
55485
|
for (const { runtime, dir: cfg } of targetConfigDirs()) {
|
|
55405
|
-
if (!(0,
|
|
55406
|
-
const skillsDir = (0,
|
|
55486
|
+
if (!(0, import_node_fs22.existsSync)(cfg)) continue;
|
|
55487
|
+
const skillsDir = (0, import_node_path20.join)(cfg, "skills");
|
|
55407
55488
|
for (const s of skills) {
|
|
55408
|
-
const dest = (0,
|
|
55409
|
-
const installedMd = (0,
|
|
55410
|
-
const installed = (0,
|
|
55489
|
+
const dest = (0, import_node_path20.join)(skillsDir, s.name);
|
|
55490
|
+
const installedMd = (0, import_node_path20.join)(dest, "SKILL.md");
|
|
55491
|
+
const installed = (0, import_node_fs22.existsSync)(installedMd) ? skillVersion(installedMd) : null;
|
|
55411
55492
|
const action = decideAction(installed, s.version);
|
|
55412
55493
|
if (action === "installed" || action === "updated") {
|
|
55413
55494
|
try {
|
|
55414
|
-
if (action === "updated") (0,
|
|
55415
|
-
(0,
|
|
55495
|
+
if (action === "updated") (0, import_node_fs22.rmSync)(dest, { recursive: true, force: true });
|
|
55496
|
+
(0, import_node_fs22.cpSync)(s.dir, dest, { recursive: true });
|
|
55416
55497
|
results.push({ runtime, skill: s.name, action, from: installed, to: s.version });
|
|
55417
55498
|
} catch {
|
|
55418
55499
|
}
|
|
@@ -55425,9 +55506,9 @@ function syncSkills() {
|
|
|
55425
55506
|
}
|
|
55426
55507
|
|
|
55427
55508
|
// watch.ts
|
|
55428
|
-
var
|
|
55429
|
-
var
|
|
55430
|
-
var
|
|
55509
|
+
var import_node_os16 = require("node:os");
|
|
55510
|
+
var import_node_path22 = require("node:path");
|
|
55511
|
+
var import_node_fs23 = require("node:fs");
|
|
55431
55512
|
|
|
55432
55513
|
// node_modules/chokidar/esm/index.js
|
|
55433
55514
|
var import_fs2 = require("fs");
|
|
@@ -55438,7 +55519,7 @@ var sysPath2 = __toESM(require("path"), 1);
|
|
|
55438
55519
|
// node_modules/readdirp/esm/index.js
|
|
55439
55520
|
var import_promises2 = require("node:fs/promises");
|
|
55440
55521
|
var import_node_stream2 = require("node:stream");
|
|
55441
|
-
var
|
|
55522
|
+
var import_node_path21 = require("node:path");
|
|
55442
55523
|
var EntryTypes = {
|
|
55443
55524
|
FILE_TYPE: "files",
|
|
55444
55525
|
DIR_TYPE: "directories",
|
|
@@ -55513,7 +55594,7 @@ var ReaddirpStream = class extends import_node_stream2.Readable {
|
|
|
55513
55594
|
this._wantsDir = type ? DIR_TYPES.has(type) : false;
|
|
55514
55595
|
this._wantsFile = type ? FILE_TYPES.has(type) : false;
|
|
55515
55596
|
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
55516
|
-
this._root = (0,
|
|
55597
|
+
this._root = (0, import_node_path21.resolve)(root);
|
|
55517
55598
|
this._isDirent = !opts.alwaysStat;
|
|
55518
55599
|
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
55519
55600
|
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
@@ -55584,8 +55665,8 @@ var ReaddirpStream = class extends import_node_stream2.Readable {
|
|
|
55584
55665
|
let entry2;
|
|
55585
55666
|
const basename5 = this._isDirent ? dirent.name : dirent;
|
|
55586
55667
|
try {
|
|
55587
|
-
const fullPath = (0,
|
|
55588
|
-
entry2 = { path: (0,
|
|
55668
|
+
const fullPath = (0, import_node_path21.resolve)((0, import_node_path21.join)(path, basename5));
|
|
55669
|
+
entry2 = { path: (0, import_node_path21.relative)(this._root, fullPath), fullPath, basename: basename5 };
|
|
55589
55670
|
entry2[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
55590
55671
|
} catch (err) {
|
|
55591
55672
|
this._onError(err);
|
|
@@ -55619,7 +55700,7 @@ var ReaddirpStream = class extends import_node_stream2.Readable {
|
|
|
55619
55700
|
}
|
|
55620
55701
|
if (entryRealPathStats.isDirectory()) {
|
|
55621
55702
|
const len = entryRealPath.length;
|
|
55622
|
-
if (full.startsWith(entryRealPath) && full.substr(len, 1) ===
|
|
55703
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === import_node_path21.sep) {
|
|
55623
55704
|
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
55624
55705
|
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
55625
55706
|
return this._onError(recursiveError);
|
|
@@ -57127,33 +57208,33 @@ function appIdFromLogPath(path) {
|
|
|
57127
57208
|
return i >= 0 && parts[i + 1] ? parts[i + 1] : null;
|
|
57128
57209
|
}
|
|
57129
57210
|
function samePath(a, b) {
|
|
57130
|
-
const ra = (0,
|
|
57131
|
-
const rb = (0,
|
|
57211
|
+
const ra = (0, import_node_path22.resolve)(a);
|
|
57212
|
+
const rb = (0, import_node_path22.resolve)(b);
|
|
57132
57213
|
return process.platform === "win32" ? ra.toLowerCase() === rb.toLowerCase() : ra === rb;
|
|
57133
57214
|
}
|
|
57134
57215
|
function underDir(path, dir) {
|
|
57135
|
-
const rp = (0,
|
|
57136
|
-
const rd = (0,
|
|
57216
|
+
const rp = (0, import_node_path22.resolve)(path);
|
|
57217
|
+
const rd = (0, import_node_path22.resolve)(dir);
|
|
57137
57218
|
const [p, d] = process.platform === "win32" ? [rp.toLowerCase(), rd.toLowerCase()] : [rp, rd];
|
|
57138
|
-
return p === d || p.startsWith(d +
|
|
57219
|
+
return p === d || p.startsWith(d + import_node_path22.sep);
|
|
57139
57220
|
}
|
|
57140
57221
|
function startWatcher() {
|
|
57141
|
-
const awareDir = process.env.AWARE_HOME ?? (0,
|
|
57142
|
-
const credentialsDir = (0,
|
|
57143
|
-
if (!(0,
|
|
57222
|
+
const awareDir = process.env.AWARE_HOME ?? (0, import_node_path22.join)((0, import_node_os16.homedir)(), ".aware");
|
|
57223
|
+
const credentialsDir = (0, import_node_path22.join)(awareDir, "credentials");
|
|
57224
|
+
if (!(0, import_node_fs23.existsSync)(credentialsDir)) {
|
|
57144
57225
|
try {
|
|
57145
|
-
(0,
|
|
57226
|
+
(0, import_node_fs23.mkdirSync)(credentialsDir, { recursive: true });
|
|
57146
57227
|
} catch {
|
|
57147
57228
|
}
|
|
57148
57229
|
}
|
|
57149
|
-
if (!(0,
|
|
57230
|
+
if (!(0, import_node_fs23.existsSync)(uiDir)) {
|
|
57150
57231
|
try {
|
|
57151
|
-
(0,
|
|
57232
|
+
(0, import_node_fs23.mkdirSync)(uiDir, { recursive: true });
|
|
57152
57233
|
} catch {
|
|
57153
57234
|
}
|
|
57154
57235
|
}
|
|
57155
|
-
const targets = ["apps", "logs", "credentials"].map((d) => (0,
|
|
57156
|
-
if ((0,
|
|
57236
|
+
const targets = ["apps", "logs", "credentials"].map((d) => (0, import_node_path22.join)(awareDir, d)).filter((p) => (0, import_node_fs23.existsSync)(p));
|
|
57237
|
+
if ((0, import_node_fs23.existsSync)(uiDir)) targets.push(uiDir);
|
|
57157
57238
|
if (targets.length === 0) {
|
|
57158
57239
|
return null;
|
|
57159
57240
|
}
|
|
@@ -57183,11 +57264,11 @@ function startWatcher() {
|
|
|
57183
57264
|
const isCredential = path.split(/[\\/]/).includes("credentials");
|
|
57184
57265
|
const kind = isCredential ? "credential" : path.endsWith(".jsonl") ? "trace" : path.endsWith(".lock") ? "lock" : path.endsWith(".flo") || path.endsWith(".app") ? "source" : "file";
|
|
57185
57266
|
broadcast({ type: "fs-change", kind, event, path });
|
|
57186
|
-
if (kind === "trace" && event !== "unlink" && (0,
|
|
57267
|
+
if (kind === "trace" && event !== "unlink" && (0, import_node_fs23.existsSync)(path)) {
|
|
57187
57268
|
const id = appIdFromLogPath(path);
|
|
57188
57269
|
if (!id) return;
|
|
57189
57270
|
try {
|
|
57190
|
-
broadcast({ type: "trace-file", id, runId: path.split(
|
|
57271
|
+
broadcast({ type: "trace-file", id, runId: path.split(import_node_path22.sep).pop()?.replace(/\.jsonl$/, "") ?? null, events: parseTrace((0, import_node_fs23.readFileSync)(path, "utf8")) });
|
|
57191
57272
|
} catch {
|
|
57192
57273
|
}
|
|
57193
57274
|
}
|
|
@@ -57196,10 +57277,10 @@ function startWatcher() {
|
|
|
57196
57277
|
}
|
|
57197
57278
|
|
|
57198
57279
|
// index.ts
|
|
57199
|
-
var __dirname4 = (0,
|
|
57200
|
-
var WEB_ROOT = [(0,
|
|
57201
|
-
(p) => (0,
|
|
57202
|
-
) ?? (0,
|
|
57280
|
+
var __dirname4 = (0, import_node_path23.dirname)((0, import_node_url3.fileURLToPath)(__import_meta_url));
|
|
57281
|
+
var WEB_ROOT = [(0, import_node_path23.join)(__dirname4, "web"), (0, import_node_path23.join)((0, import_node_path23.dirname)(process.execPath), "web"), (0, import_node_path23.join)(__dirname4, "..", "web")].find(
|
|
57282
|
+
(p) => (0, import_node_fs24.existsSync)(p)
|
|
57283
|
+
) ?? (0, import_node_path23.join)(__dirname4, "..", "web");
|
|
57203
57284
|
var PORT2 = Number(process.env.PORT ?? 4317);
|
|
57204
57285
|
var HOST = "127.0.0.1";
|
|
57205
57286
|
var crashHandlersInstalled = false;
|
|
@@ -57215,7 +57296,7 @@ function installCrashHandlers() {
|
|
|
57215
57296
|
${stack}
|
|
57216
57297
|
`;
|
|
57217
57298
|
try {
|
|
57218
|
-
(0,
|
|
57299
|
+
(0, import_node_fs24.appendFileSync)(logFilePath(), line);
|
|
57219
57300
|
} catch {
|
|
57220
57301
|
}
|
|
57221
57302
|
if (process.stderr.isTTY) process.stderr.write(line);
|
|
@@ -57246,7 +57327,7 @@ async function startServer() {
|
|
|
57246
57327
|
}
|
|
57247
57328
|
});
|
|
57248
57329
|
await app.register(import_static.default, { root: WEB_ROOT, prefix: "/" });
|
|
57249
|
-
const MIN_AWARE = "0.
|
|
57330
|
+
const MIN_AWARE = "0.70.0";
|
|
57250
57331
|
const isWin3 = process.platform === "win32";
|
|
57251
57332
|
const has = (cmd) => {
|
|
57252
57333
|
try {
|
|
@@ -57597,11 +57678,11 @@ async function startServer() {
|
|
|
57597
57678
|
if (appExists(id)) {
|
|
57598
57679
|
return reply.status(409).send({ ok: false, error: `a workflow named "${id}" is already installed \u2014 remove it first, or rename the file's app: id`, code: "exists", id });
|
|
57599
57680
|
}
|
|
57600
|
-
const stageRoot = (0,
|
|
57681
|
+
const stageRoot = (0, import_node_fs24.mkdtempSync)((0, import_node_path23.join)((0, import_node_os17.tmpdir)(), "floless-import-"));
|
|
57601
57682
|
try {
|
|
57602
|
-
const stageDir = (0,
|
|
57603
|
-
(0,
|
|
57604
|
-
(0,
|
|
57683
|
+
const stageDir = (0, import_node_path23.join)(stageRoot, id);
|
|
57684
|
+
(0, import_node_fs24.mkdirSync)(stageDir);
|
|
57685
|
+
(0, import_node_fs24.writeFileSync)((0, import_node_path23.join)(stageDir, `${id}.flo`), content);
|
|
57605
57686
|
await aware.install(stageDir);
|
|
57606
57687
|
} catch (err) {
|
|
57607
57688
|
try {
|
|
@@ -57611,7 +57692,7 @@ async function startServer() {
|
|
|
57611
57692
|
const msg = err instanceof AwareError ? err.message : String(err?.message ?? err);
|
|
57612
57693
|
return reply.status(502).send({ ok: false, error: `import failed: ${msg}` });
|
|
57613
57694
|
} finally {
|
|
57614
|
-
(0,
|
|
57695
|
+
(0, import_node_fs24.rmSync)(stageRoot, { recursive: true, force: true });
|
|
57615
57696
|
}
|
|
57616
57697
|
broadcast({ type: "apps-changed", id });
|
|
57617
57698
|
return { ok: true, id };
|
|
@@ -57625,13 +57706,13 @@ async function startServer() {
|
|
|
57625
57706
|
}
|
|
57626
57707
|
const inputs = appData.inputs.map((i) => ({ name: i.name, type: i.type }));
|
|
57627
57708
|
const baked = bakeFloSource(appData.source.text, inputs);
|
|
57628
|
-
const tmpRoot = (0,
|
|
57629
|
-
const backupDir = (0,
|
|
57630
|
-
const bakeDir = (0,
|
|
57631
|
-
(0,
|
|
57632
|
-
(0,
|
|
57709
|
+
const tmpRoot = (0, import_node_fs24.mkdtempSync)((0, import_node_path23.join)((0, import_node_os17.tmpdir)(), "floless-bake-"));
|
|
57710
|
+
const backupDir = (0, import_node_path23.join)(tmpRoot, `${id}-backup`);
|
|
57711
|
+
const bakeDir = (0, import_node_path23.join)(tmpRoot, id);
|
|
57712
|
+
(0, import_node_fs24.cpSync)(appDir(id), backupDir, { recursive: true });
|
|
57713
|
+
(0, import_node_fs24.cpSync)(appDir(id), bakeDir, { recursive: true });
|
|
57633
57714
|
const floName = appData.source.path.split(/[\\/]/).pop();
|
|
57634
|
-
(0,
|
|
57715
|
+
(0, import_node_fs24.writeFileSync)((0, import_node_path23.join)(bakeDir, floName), baked);
|
|
57635
57716
|
let appInstalled2 = true;
|
|
57636
57717
|
try {
|
|
57637
57718
|
await aware.uninstall(id);
|
|
@@ -57653,17 +57734,17 @@ async function startServer() {
|
|
|
57653
57734
|
throw installErr;
|
|
57654
57735
|
}
|
|
57655
57736
|
try {
|
|
57656
|
-
await aware.compile((0,
|
|
57737
|
+
await aware.compile((0, import_node_path23.join)(appDir(id), floName));
|
|
57657
57738
|
} catch (compileErr) {
|
|
57658
57739
|
app.log.warn({ id, compileErr: String(compileErr) }, "bake: post-install recompile failed (app baked but may need a manual Compile)");
|
|
57659
57740
|
}
|
|
57660
57741
|
broadcast({ type: "baked", id });
|
|
57661
57742
|
return { ok: true, id, agent: id, inputs };
|
|
57662
57743
|
} finally {
|
|
57663
|
-
if (appInstalled2) (0,
|
|
57744
|
+
if (appInstalled2) (0, import_node_fs24.rmSync)(tmpRoot, { recursive: true, force: true });
|
|
57664
57745
|
}
|
|
57665
57746
|
});
|
|
57666
|
-
const graftAgentsDir = () => (0,
|
|
57747
|
+
const graftAgentsDir = () => (0, import_node_path23.join)((0, import_node_os17.homedir)(), ".aware", "agents");
|
|
57667
57748
|
app.post("/api/graft/match", async (req, reply) => {
|
|
57668
57749
|
const { glob } = req.body ?? {};
|
|
57669
57750
|
if (!glob) return reply.status(400).send({ ok: false, error: "glob required" });
|
|
@@ -57680,7 +57761,7 @@ async function startServer() {
|
|
|
57680
57761
|
if (!sourceKind || !sourceRef) {
|
|
57681
57762
|
return reply.status(400).send({ ok: false, error: "sourceKind and sourceRef required" });
|
|
57682
57763
|
}
|
|
57683
|
-
const tempHome = (0,
|
|
57764
|
+
const tempHome = (0, import_node_fs24.mkdtempSync)((0, import_node_path23.join)((0, import_node_os17.tmpdir)(), "floless-graft-"));
|
|
57684
57765
|
let result;
|
|
57685
57766
|
try {
|
|
57686
57767
|
result = await aware.build({
|
|
@@ -57693,19 +57774,19 @@ async function startServer() {
|
|
|
57693
57774
|
awareHome: tempHome
|
|
57694
57775
|
});
|
|
57695
57776
|
} catch (err) {
|
|
57696
|
-
(0,
|
|
57777
|
+
(0, import_node_fs24.rmSync)(tempHome, { recursive: true, force: true });
|
|
57697
57778
|
const msg = err instanceof AwareError ? err.message : String(err?.message ?? err);
|
|
57698
57779
|
return reply.status(422).send({ ok: false, error: msg });
|
|
57699
57780
|
}
|
|
57700
57781
|
const manifest = readStagedManifest(result.agentDir);
|
|
57701
57782
|
if (!manifest) {
|
|
57702
|
-
(0,
|
|
57783
|
+
(0, import_node_fs24.rmSync)(tempHome, { recursive: true, force: true });
|
|
57703
57784
|
return reply.status(502).send({ ok: false, error: `build produced output at ${result.agentDir} but no manifest.yaml` });
|
|
57704
57785
|
}
|
|
57705
57786
|
const token = (0, import_node_crypto7.randomUUID)();
|
|
57706
57787
|
registerStage(token, tempHome, result.agentId);
|
|
57707
57788
|
const preview = buildPreview(manifest, sourceKind, sourceRef, token);
|
|
57708
|
-
if ((0,
|
|
57789
|
+
if ((0, import_node_fs24.existsSync)((0, import_node_path23.join)(graftAgentsDir(), result.agentId))) {
|
|
57709
57790
|
preview.warnings.unshift(`An agent named "${result.agentId}" is already installed \u2014 creating it will overwrite it.`);
|
|
57710
57791
|
}
|
|
57711
57792
|
return { ok: true, preview };
|
|
@@ -57724,7 +57805,7 @@ async function startServer() {
|
|
|
57724
57805
|
registerStage(stagedRef, stage.tempDir, stage.agentId);
|
|
57725
57806
|
return reply.status(409).send({ ok: false, error: err.message, agentId: stage.agentId, collision: true });
|
|
57726
57807
|
}
|
|
57727
|
-
(0,
|
|
57808
|
+
(0, import_node_fs24.rmSync)(stage.tempDir, { recursive: true, force: true });
|
|
57728
57809
|
throw err;
|
|
57729
57810
|
}
|
|
57730
57811
|
broadcast({ type: "grafted", id: stage.agentId });
|
|
@@ -57762,9 +57843,10 @@ async function startServer() {
|
|
|
57762
57843
|
if (!id) return reply.status(400).send({ ok: false, error: "id required" });
|
|
57763
57844
|
const blocked = hostRunBlocked(appProvider(id));
|
|
57764
57845
|
if (blocked) return reply.send({ ok: false, error: blocked, blocked: true, simulate: !!simulate });
|
|
57846
|
+
const runInputs = steelIfcRunInputs(id, inputs);
|
|
57765
57847
|
let result;
|
|
57766
57848
|
try {
|
|
57767
|
-
result = await aware.run(id, { dryRun, simulate, inputs });
|
|
57849
|
+
result = await aware.run(id, { dryRun, simulate, inputs: runInputs });
|
|
57768
57850
|
} catch (err) {
|
|
57769
57851
|
if (err instanceof AwareError) {
|
|
57770
57852
|
const detail = err.detail && typeof err.detail === "object" ? err.detail : null;
|
|
@@ -57783,7 +57865,7 @@ async function startServer() {
|
|
|
57783
57865
|
broadcast({ type: "run-started", id, dryRun: !!dryRun, simulate: !!simulate, runId: result.runId });
|
|
57784
57866
|
for (const ev of events) broadcast({ type: "trace", id, event: ev });
|
|
57785
57867
|
broadcast({ type: "run-ended", id, runId: result.runId });
|
|
57786
|
-
const extracted = extractReportHtml(events);
|
|
57868
|
+
const extracted = extractReportHtml(events, id);
|
|
57787
57869
|
let report = null;
|
|
57788
57870
|
if (extracted) {
|
|
57789
57871
|
let interactive = false;
|
|
@@ -57956,11 +58038,11 @@ async function startServer() {
|
|
|
57956
58038
|
app.get("/api/requests/:id/snapshot/:n", async (req, reply) => {
|
|
57957
58039
|
const n = Number.parseInt(req.params.n, 10);
|
|
57958
58040
|
const p = Number.isInteger(n) ? snapshotPathFor(req.params.id, n) : null;
|
|
57959
|
-
if (!p || !(0,
|
|
58041
|
+
if (!p || !(0, import_node_fs24.existsSync)(p)) return reply.status(404).send({ ok: false, error: "snapshot not found" });
|
|
57960
58042
|
const ext = p.split(".").pop().toLowerCase();
|
|
57961
58043
|
reply.header("Content-Type", ext === "png" ? "image/png" : ext === "webp" ? "image/webp" : ext === "pdf" ? "application/pdf" : "image/jpeg");
|
|
57962
58044
|
reply.header("Cache-Control", "no-store");
|
|
57963
|
-
return (0,
|
|
58045
|
+
return (0, import_node_fs24.readFileSync)(p);
|
|
57964
58046
|
});
|
|
57965
58047
|
app.post(
|
|
57966
58048
|
"/api/tweak",
|
|
@@ -58079,7 +58161,7 @@ async function startServer() {
|
|
|
58079
58161
|
runId: latest.runId,
|
|
58080
58162
|
status: summarizeRun(events).status,
|
|
58081
58163
|
rows: extractRunRows(events),
|
|
58082
|
-
html: withBadge(extractReportHtml(events))?.html ?? null
|
|
58164
|
+
html: withBadge(extractReportHtml(events, ref))?.html ?? null
|
|
58083
58165
|
};
|
|
58084
58166
|
}
|
|
58085
58167
|
if (kind === "last-run-status") {
|
|
@@ -58090,7 +58172,7 @@ async function startServer() {
|
|
|
58090
58172
|
warn(`last-run-status:${ref} \u2014 trace exists but couldn't be parsed (corrupt/truncated)`);
|
|
58091
58173
|
let finishedAt2 = null;
|
|
58092
58174
|
try {
|
|
58093
|
-
finishedAt2 = (0,
|
|
58175
|
+
finishedAt2 = (0, import_node_fs24.statSync)(latest.path).mtime.toISOString();
|
|
58094
58176
|
} catch {
|
|
58095
58177
|
finishedAt2 = null;
|
|
58096
58178
|
}
|
|
@@ -58100,7 +58182,7 @@ async function startServer() {
|
|
|
58100
58182
|
let finishedAt = typeof runEnd?.ts === "string" ? runEnd.ts : null;
|
|
58101
58183
|
if (!finishedAt) {
|
|
58102
58184
|
try {
|
|
58103
|
-
finishedAt = (0,
|
|
58185
|
+
finishedAt = (0, import_node_fs24.statSync)(latest.path).mtime.toISOString();
|
|
58104
58186
|
} catch {
|
|
58105
58187
|
finishedAt = null;
|
|
58106
58188
|
}
|