@floless/app 0.16.1 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -294,41 +294,41 @@ var require_queue = __commonJS({
294
294
  queue2.drained = drained;
295
295
  return queue2;
296
296
  function push(value) {
297
- var p = new Promise(function(resolve5, reject) {
297
+ var p = new Promise(function(resolve6, reject) {
298
298
  pushCb(value, function(err, result) {
299
299
  if (err) {
300
300
  reject(err);
301
301
  return;
302
302
  }
303
- resolve5(result);
303
+ resolve6(result);
304
304
  });
305
305
  });
306
306
  p.catch(noop);
307
307
  return p;
308
308
  }
309
309
  function unshift(value) {
310
- var p = new Promise(function(resolve5, reject) {
310
+ var p = new Promise(function(resolve6, reject) {
311
311
  unshiftCb(value, function(err, result) {
312
312
  if (err) {
313
313
  reject(err);
314
314
  return;
315
315
  }
316
- resolve5(result);
316
+ resolve6(result);
317
317
  });
318
318
  });
319
319
  p.catch(noop);
320
320
  return p;
321
321
  }
322
322
  function drained() {
323
- var p = new Promise(function(resolve5) {
323
+ var p = new Promise(function(resolve6) {
324
324
  process.nextTick(function() {
325
325
  if (queue2.idle()) {
326
- resolve5();
326
+ resolve6();
327
327
  } else {
328
328
  var previousDrain = queue2.drain;
329
329
  queue2.drain = function() {
330
330
  if (typeof previousDrain === "function") previousDrain();
331
- resolve5();
331
+ resolve6();
332
332
  queue2.drain = previousDrain;
333
333
  };
334
334
  }
@@ -671,8 +671,8 @@ var require_create_promise = __commonJS({
671
671
  reject: null,
672
672
  promise: null
673
673
  };
674
- obj.promise = new Promise((resolve5, reject) => {
675
- obj.resolve = resolve5;
674
+ obj.promise = new Promise((resolve6, reject) => {
675
+ obj.resolve = resolve6;
676
676
  obj.reject = reject;
677
677
  });
678
678
  return obj;
@@ -941,11 +941,11 @@ var require_thenify = __commonJS({
941
941
  return;
942
942
  }
943
943
  debug("thenify");
944
- return (resolve5, reject) => {
944
+ return (resolve6, reject) => {
945
945
  const p = this._loadRegistered();
946
946
  return p.then(() => {
947
947
  this[kThenifyDoNotWrap] = true;
948
- return resolve5(this._server);
948
+ return resolve6(this._server);
949
949
  }, reject);
950
950
  };
951
951
  }
@@ -1082,12 +1082,12 @@ var require_boot = __commonJS({
1082
1082
  inherits(Boot, EE);
1083
1083
  if ("asyncDispose" in Symbol) {
1084
1084
  Boot.prototype[Symbol.asyncDispose] = function() {
1085
- return new Promise((resolve5, reject) => {
1085
+ return new Promise((resolve6, reject) => {
1086
1086
  this.close((err) => {
1087
1087
  if (err) {
1088
1088
  return reject(err);
1089
1089
  }
1090
- resolve5();
1090
+ resolve6();
1091
1091
  });
1092
1092
  });
1093
1093
  };
@@ -1234,12 +1234,12 @@ var require_boot = __commonJS({
1234
1234
  throw new AVV_ERR_CALLBACK_NOT_FN("close", typeof func);
1235
1235
  }
1236
1236
  } else {
1237
- promise = new Promise(function(resolve5, reject) {
1237
+ promise = new Promise(function(resolve6, reject) {
1238
1238
  func = function(err) {
1239
1239
  if (err) {
1240
1240
  return reject(err);
1241
1241
  }
1242
- resolve5();
1242
+ resolve6();
1243
1243
  };
1244
1244
  });
1245
1245
  }
@@ -1259,7 +1259,7 @@ var require_boot = __commonJS({
1259
1259
  queueMicrotask(this.start.bind(this));
1260
1260
  return;
1261
1261
  }
1262
- return new Promise((resolve5, reject) => {
1262
+ return new Promise((resolve6, reject) => {
1263
1263
  this._readyQ.push(readyPromiseCB);
1264
1264
  this.start();
1265
1265
  const relativeContext = this._current[0].server;
@@ -1267,7 +1267,7 @@ var require_boot = __commonJS({
1267
1267
  if (err) {
1268
1268
  reject(err);
1269
1269
  } else {
1270
- resolve5(relativeContext);
1270
+ resolve6(relativeContext);
1271
1271
  }
1272
1272
  process.nextTick(done);
1273
1273
  }
@@ -2542,8 +2542,8 @@ var require_promise = __commonJS({
2542
2542
  var { kTestInternals } = require_symbols2();
2543
2543
  function withResolvers() {
2544
2544
  let res, rej;
2545
- const promise = new Promise((resolve5, reject) => {
2546
- res = resolve5;
2545
+ const promise = new Promise((resolve6, reject) => {
2546
+ res = resolve6;
2547
2547
  rej = reject;
2548
2548
  });
2549
2549
  return { promise, resolve: res, reject: rej };
@@ -2642,15 +2642,15 @@ var require_server = __commonJS({
2642
2642
  if (cb === void 0) {
2643
2643
  const listening = listenPromise.call(this, server, listenOptions);
2644
2644
  return listening.then((address) => {
2645
- const { promise, resolve: resolve5 } = PonyPromise.withResolvers();
2645
+ const { promise, resolve: resolve6 } = PonyPromise.withResolvers();
2646
2646
  if (host === "localhost") {
2647
2647
  multipleBindings.call(this, server, httpHandler, options, listenOptions, () => {
2648
2648
  this[kState].listening = true;
2649
- resolve5(address);
2649
+ resolve6(address);
2650
2650
  onListenHookRunner(this);
2651
2651
  });
2652
2652
  } else {
2653
- resolve5(address);
2653
+ resolve6(address);
2654
2654
  onListenHookRunner(this);
2655
2655
  }
2656
2656
  return promise;
@@ -2777,7 +2777,7 @@ var require_server = __commonJS({
2777
2777
  }
2778
2778
  return this.ready().then(() => {
2779
2779
  if (this[kState].aborted) return;
2780
- const { promise, resolve: resolve5, reject } = PonyPromise.withResolvers();
2780
+ const { promise, resolve: resolve6, reject } = PonyPromise.withResolvers();
2781
2781
  const errEventHandler = (err) => {
2782
2782
  cleanup();
2783
2783
  this[kState].listening = false;
@@ -2786,7 +2786,7 @@ var require_server = __commonJS({
2786
2786
  const listeningEventHandler = () => {
2787
2787
  cleanup();
2788
2788
  this[kState].listening = true;
2789
- resolve5(logServerAddress.call(
2789
+ resolve6(logServerAddress.call(
2790
2790
  this,
2791
2791
  server,
2792
2792
  listenOptions.listenTextResolver || defaultResolveServerListeningText
@@ -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: join22 } = require("path");
5492
+ var { join: join23 } = 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"] || join22(__dirname, "lib", "worker.js");
5543
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join23(__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: existsSync20 } = require("node:fs");
6009
+ var { existsSync: existsSync21 } = require("node:fs");
6010
6010
  var getCallers = require_caller();
6011
- var { join: join22, isAbsolute: isAbsolute2, sep: sep3 } = require("node:path");
6011
+ var { join: join23, 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) && !existsSync20(path);
6083
+ return isAbsolute2(path) && !existsSync21(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"] || join22(__dirname, "worker.js");
6164
+ target = bundlerOverrides["pino-worker"] || join23(__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"] || join22(__dirname, "worker.js");
6182
+ target = bundlerOverrides["pino-worker"] || join23(__dirname, "worker.js");
6183
6183
  options.pipelines = [pipeline2.map((dest) => {
6184
6184
  return {
6185
6185
  ...dest,
@@ -6202,12 +6202,12 @@ var require_transport = __commonJS({
6202
6202
  return origin;
6203
6203
  }
6204
6204
  if (origin === "pino/file") {
6205
- return join22(__dirname, "..", "file.js");
6205
+ return join23(__dirname, "..", "file.js");
6206
6206
  }
6207
6207
  let fixTarget2;
6208
6208
  for (const filePath of callers) {
6209
6209
  try {
6210
- const context = filePath === "node:repl" ? process.cwd() + sep3 : filePath;
6210
+ const context = filePath === "node:repl" ? process.cwd() + sep4 : filePath;
6211
6211
  fixTarget2 = createRequire4(context).resolve(origin);
6212
6212
  break;
6213
6213
  } catch (err) {
@@ -7182,7 +7182,7 @@ var require_safe_stable_stringify = __commonJS({
7182
7182
  return circularValue;
7183
7183
  }
7184
7184
  let res = "";
7185
- let join22 = ",";
7185
+ let join23 = ",";
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
- join22 = `,
7199
+ join23 = `,
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 += join22;
7207
+ res += join23;
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 += `${join22}"... ${getItemCount(removedKeys)} not stringified"`;
7213
+ res += `${join23}"... ${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
- join22 = `,
7234
+ join23 = `,
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 = join22;
7248
+ separator = join23;
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 = join22;
7254
+ separator = join23;
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 join22 = ",";
7295
+ let join23 = ",";
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
- join22 = `,
7308
+ join23 = `,
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 += join22;
7316
+ res += join23;
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 += `${join22}"... ${getItemCount(removedKeys)} not stringified"`;
7322
+ res += `${join23}"... ${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
- join22 = `,
7335
+ join23 = `,
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 = join22;
7344
+ separator = join23;
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 join23 = `,
7402
+ const join24 = `,
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 += join23;
7409
+ res2 += join24;
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 += `${join23}"... ${getItemCount(removedKeys)} not stringified"`;
7415
+ res2 += `${join24}"... ${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 join22 = `,
7431
+ const join23 = `,
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, join22, maximumBreadth);
7437
+ res += stringifyTypedArray(value, join23, maximumBreadth);
7438
7438
  keys = keys.slice(value.length);
7439
7439
  maximumPropertiesToStringify -= value.length;
7440
- separator = join22;
7440
+ separator = join23;
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 = join22;
7451
+ separator = join23;
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 = join22;
7457
+ separator = join23;
7458
7458
  }
7459
7459
  if (separator !== "") {
7460
7460
  res = `
@@ -15309,7 +15309,7 @@ var require_compile = __commonJS({
15309
15309
  const schOrFunc = root.refs[ref];
15310
15310
  if (schOrFunc)
15311
15311
  return schOrFunc;
15312
- let _sch = resolve5.call(this, root, ref);
15312
+ let _sch = resolve6.call(this, root, ref);
15313
15313
  if (_sch === void 0) {
15314
15314
  const schema = (_a = root.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
15315
15315
  const { schemaId } = this.opts;
@@ -15336,7 +15336,7 @@ var require_compile = __commonJS({
15336
15336
  function sameSchemaEnv(s1, s2) {
15337
15337
  return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
15338
15338
  }
15339
- function resolve5(root, ref) {
15339
+ function resolve6(root, ref) {
15340
15340
  let sch;
15341
15341
  while (typeof (sch = this.refs[ref]) == "string")
15342
15342
  ref = sch;
@@ -15967,7 +15967,7 @@ var require_fast_uri = __commonJS({
15967
15967
  }
15968
15968
  return uri;
15969
15969
  }
15970
- function resolve5(baseURI, relativeURI, options) {
15970
+ function resolve6(baseURI, relativeURI, options) {
15971
15971
  const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
15972
15972
  const resolved = resolveComponent(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
15973
15973
  schemelessOptions.skipEscape = true;
@@ -16225,7 +16225,7 @@ var require_fast_uri = __commonJS({
16225
16225
  var fastUri = {
16226
16226
  SCHEMES,
16227
16227
  normalize: normalize2,
16228
- resolve: resolve5,
16228
+ resolve: resolve6,
16229
16229
  resolveComponent,
16230
16230
  equal,
16231
16231
  serialize,
@@ -33572,9 +33572,9 @@ var require_light_my_request = __commonJS({
33572
33572
  const res = new Response(req, callback);
33573
33573
  return makeRequest(dispatchFunc, server, req, res);
33574
33574
  } else {
33575
- return new Promise((resolve5, reject) => {
33575
+ return new Promise((resolve6, reject) => {
33576
33576
  const req = new RequestConstructor(options);
33577
- const res = new Response(req, resolve5, reject);
33577
+ const res = new Response(req, resolve6, reject);
33578
33578
  makeRequest(dispatchFunc, server, req, res);
33579
33579
  });
33580
33580
  }
@@ -37706,10 +37706,10 @@ var require_commonjs4 = __commonJS({
37706
37706
  * Return a void Promise that resolves once the stream ends.
37707
37707
  */
37708
37708
  async promise() {
37709
- return new Promise((resolve5, reject) => {
37709
+ return new Promise((resolve6, reject) => {
37710
37710
  this.on(DESTROYED, () => reject(new Error("stream destroyed")));
37711
37711
  this.on("error", (er) => reject(er));
37712
- this.on("end", () => resolve5());
37712
+ this.on("end", () => resolve6());
37713
37713
  });
37714
37714
  }
37715
37715
  /**
@@ -37733,7 +37733,7 @@ var require_commonjs4 = __commonJS({
37733
37733
  return Promise.resolve({ done: false, value: res });
37734
37734
  if (this[EOF])
37735
37735
  return stop();
37736
- let resolve5;
37736
+ let resolve6;
37737
37737
  let reject;
37738
37738
  const onerr = (er) => {
37739
37739
  this.off("data", ondata);
@@ -37747,19 +37747,19 @@ var require_commonjs4 = __commonJS({
37747
37747
  this.off("end", onend);
37748
37748
  this.off(DESTROYED, ondestroy);
37749
37749
  this.pause();
37750
- resolve5({ value, done: !!this[EOF] });
37750
+ resolve6({ value, done: !!this[EOF] });
37751
37751
  };
37752
37752
  const onend = () => {
37753
37753
  this.off("error", onerr);
37754
37754
  this.off("data", ondata);
37755
37755
  this.off(DESTROYED, ondestroy);
37756
37756
  stop();
37757
- resolve5({ done: true, value: void 0 });
37757
+ resolve6({ done: true, value: void 0 });
37758
37758
  };
37759
37759
  const ondestroy = () => onerr(new Error("stream destroyed"));
37760
37760
  return new Promise((res2, rej) => {
37761
37761
  reject = rej;
37762
- resolve5 = res2;
37762
+ resolve6 = res2;
37763
37763
  this.once(DESTROYED, ondestroy);
37764
37764
  this.once("error", onerr);
37765
37765
  this.once("end", onend);
@@ -38779,9 +38779,9 @@ var require_commonjs5 = __commonJS({
38779
38779
  if (this.#asyncReaddirInFlight) {
38780
38780
  await this.#asyncReaddirInFlight;
38781
38781
  } else {
38782
- let resolve5 = () => {
38782
+ let resolve6 = () => {
38783
38783
  };
38784
- this.#asyncReaddirInFlight = new Promise((res) => resolve5 = res);
38784
+ this.#asyncReaddirInFlight = new Promise((res) => resolve6 = res);
38785
38785
  try {
38786
38786
  for (const e of await this.#fs.promises.readdir(fullpath, {
38787
38787
  withFileTypes: true
@@ -38794,7 +38794,7 @@ var require_commonjs5 = __commonJS({
38794
38794
  children.provisional = 0;
38795
38795
  }
38796
38796
  this.#asyncReaddirInFlight = void 0;
38797
- resolve5();
38797
+ resolve6();
38798
38798
  }
38799
38799
  return children.slice(0, children.provisional);
38800
38800
  }
@@ -39027,7 +39027,7 @@ var require_commonjs5 = __commonJS({
39027
39027
  *
39028
39028
  * @internal
39029
39029
  */
39030
- constructor(cwd = process.cwd(), pathImpl, sep3, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
39030
+ constructor(cwd = process.cwd(), pathImpl, sep4, { nocase, childrenCacheSize = 16 * 1024, fs = defaultFS } = {}) {
39031
39031
  this.#fs = fsFromOption(fs);
39032
39032
  if (cwd instanceof URL || cwd.startsWith("file://")) {
39033
39033
  cwd = (0, node_url_1.fileURLToPath)(cwd);
@@ -39038,7 +39038,7 @@ var require_commonjs5 = __commonJS({
39038
39038
  this.#resolveCache = new ResolveCache();
39039
39039
  this.#resolvePosixCache = new ResolveCache();
39040
39040
  this.#children = new ChildrenCache(childrenCacheSize);
39041
- const split = cwdPath.substring(this.rootPath.length).split(sep3);
39041
+ const split = cwdPath.substring(this.rootPath.length).split(sep4);
39042
39042
  if (split.length === 1 && !split[0]) {
39043
39043
  split.pop();
39044
39044
  }
@@ -41991,10 +41991,10 @@ var require_send = __commonJS({
41991
41991
  var { parseTokenList } = require_parseTokenList();
41992
41992
  var { createHttpError } = require_createHttpError();
41993
41993
  var extname2 = path.extname;
41994
- var join22 = path.join;
41994
+ var join23 = path.join;
41995
41995
  var normalize2 = path.normalize;
41996
- var resolve5 = path.resolve;
41997
- var sep3 = path.sep;
41996
+ var resolve6 = path.resolve;
41997
+ var sep4 = path.sep;
41998
41998
  var Readable3 = stream.Readable;
41999
41999
  var BYTES_RANGE_REGEXP = /^ *bytes=/;
42000
42000
  var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
@@ -42040,7 +42040,7 @@ var require_send = __commonJS({
42040
42040
  const lastModified = options.lastModified !== void 0 ? Boolean(options.lastModified) : true;
42041
42041
  const maxage = normalizeMaxAge(options.maxAge ?? options.maxage);
42042
42042
  const maxContentRangeChunkSize = options.maxContentRangeChunkSize !== void 0 ? Number(options.maxContentRangeChunkSize) : null;
42043
- const root = options.root ? resolve5(options.root) : null;
42043
+ const root = options.root ? resolve6(options.root) : null;
42044
42044
  const highWaterMark = Number.isSafeInteger(options.highWaterMark) && options.highWaterMark > 0 ? options.highWaterMark : null;
42045
42045
  return {
42046
42046
  acceptRanges,
@@ -42071,21 +42071,21 @@ var require_send = __commonJS({
42071
42071
  let parts;
42072
42072
  if (root !== null) {
42073
42073
  if (path2) {
42074
- path2 = normalize2("." + sep3 + path2);
42074
+ path2 = normalize2("." + sep4 + path2);
42075
42075
  }
42076
42076
  if (UP_PATH_REGEXP.test(path2)) {
42077
42077
  debug('malicious path "%s"', path2);
42078
42078
  return { statusCode: 403 };
42079
42079
  }
42080
- parts = path2.split(sep3);
42081
- path2 = normalize2(join22(root, path2));
42080
+ parts = path2.split(sep4);
42081
+ path2 = normalize2(join23(root, path2));
42082
42082
  } else {
42083
42083
  if (UP_PATH_REGEXP.test(path2)) {
42084
42084
  debug('malicious path "%s"', path2);
42085
42085
  return { statusCode: 403 };
42086
42086
  }
42087
- parts = normalize2(path2).split(sep3);
42088
- path2 = resolve5(path2);
42087
+ parts = normalize2(path2).split(sep4);
42088
+ path2 = resolve6(path2);
42089
42089
  }
42090
42090
  return { path: path2, parts };
42091
42091
  }
@@ -42181,9 +42181,9 @@ var require_send = __commonJS({
42181
42181
  );
42182
42182
  }
42183
42183
  function tryStat(path2) {
42184
- return new Promise((resolve6) => {
42184
+ return new Promise((resolve7) => {
42185
42185
  fs.stat(path2, function onstat(error, stat4) {
42186
- resolve6({ error, stat: stat4 });
42186
+ resolve7({ error, stat: stat4 });
42187
42187
  });
42188
42188
  });
42189
42189
  }
@@ -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 = join22(path2, index);
42364
+ const p = join23(path2, index);
42365
42365
  const { error, stat: stat4 } = await tryStat(p);
42366
42366
  if (error) {
42367
42367
  err = error;
@@ -42377,7 +42377,7 @@ var require_send = __commonJS({
42377
42377
  }
42378
42378
  async function sendFile(request, path2, options) {
42379
42379
  const { error, stat: stat4 } = await tryStat(path2);
42380
- if (error && error.code === "ENOENT" && !extname2(path2) && path2[path2.length - 1] !== sep3) {
42380
+ if (error && error.code === "ENOENT" && !extname2(path2) && path2[path2.length - 1] !== sep4) {
42381
42381
  let err = error;
42382
42382
  for (let i = 0; i < options.extensions.length; i++) {
42383
42383
  const extension = options.extensions[i];
@@ -43012,7 +43012,7 @@ var require_static = __commonJS({
43012
43012
  "use strict";
43013
43013
  var path = require("node:path");
43014
43014
  var { fileURLToPath: fileURLToPath4 } = require("node:url");
43015
- var { statSync: statSync8 } = require("node:fs");
43015
+ var { statSync: statSync9 } = require("node:fs");
43016
43016
  var { glob } = require_commonjs6();
43017
43017
  var fp = require_plugin2();
43018
43018
  var send = require_send2();
@@ -43375,7 +43375,7 @@ var require_static = __commonJS({
43375
43375
  }
43376
43376
  let pathStat;
43377
43377
  try {
43378
- pathStat = statSync8(rootPath);
43378
+ pathStat = statSync9(rootPath);
43379
43379
  } catch (e) {
43380
43380
  if (e.code === "ENOENT") {
43381
43381
  fastify.log.warn(`"root" path "${rootPath}" must exist`);
@@ -43399,7 +43399,7 @@ var require_static = __commonJS({
43399
43399
  return indexFiles.find((filename) => {
43400
43400
  const p = path.join(root, pathname, filename);
43401
43401
  try {
43402
- const stats = statSync8(p);
43402
+ const stats = statSync9(p);
43403
43403
  return !stats.isDirectory();
43404
43404
  } catch {
43405
43405
  return false;
@@ -47402,10 +47402,10 @@ var require_resolve_block_map = __commonJS({
47402
47402
  let offset = bm.offset;
47403
47403
  let commentEnd = null;
47404
47404
  for (const collItem of bm.items) {
47405
- const { start, key, sep: sep3, value } = collItem;
47405
+ const { start, key, sep: sep4, value } = collItem;
47406
47406
  const keyProps = resolveProps.resolveProps(start, {
47407
47407
  indicator: "explicit-key-ind",
47408
- next: key ?? sep3?.[0],
47408
+ next: key ?? sep4?.[0],
47409
47409
  offset,
47410
47410
  onError,
47411
47411
  parentIndent: bm.indent,
@@ -47419,7 +47419,7 @@ var require_resolve_block_map = __commonJS({
47419
47419
  else if ("indent" in key && key.indent !== bm.indent)
47420
47420
  onError(offset, "BAD_INDENT", startColMsg);
47421
47421
  }
47422
- if (!keyProps.anchor && !keyProps.tag && !sep3) {
47422
+ if (!keyProps.anchor && !keyProps.tag && !sep4) {
47423
47423
  commentEnd = keyProps.end;
47424
47424
  if (keyProps.comment) {
47425
47425
  if (map.comment)
@@ -47443,7 +47443,7 @@ var require_resolve_block_map = __commonJS({
47443
47443
  ctx.atKey = false;
47444
47444
  if (utilMapIncludes.mapIncludes(ctx, map.items, keyNode))
47445
47445
  onError(keyStart, "DUPLICATE_KEY", "Map keys must be unique");
47446
- const valueProps = resolveProps.resolveProps(sep3 ?? [], {
47446
+ const valueProps = resolveProps.resolveProps(sep4 ?? [], {
47447
47447
  indicator: "map-value-ind",
47448
47448
  next: value,
47449
47449
  offset: keyNode.range[2],
@@ -47459,7 +47459,7 @@ var require_resolve_block_map = __commonJS({
47459
47459
  if (ctx.options.strict && keyProps.start < valueProps.found.offset - 1024)
47460
47460
  onError(keyNode.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key");
47461
47461
  }
47462
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep3, null, valueProps, onError);
47462
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : composeEmptyNode(ctx, offset, sep4, null, valueProps, onError);
47463
47463
  if (ctx.schema.compat)
47464
47464
  utilFlowIndentCheck.flowIndentCheck(bm.indent, value, onError);
47465
47465
  offset = valueNode.range[2];
@@ -47550,7 +47550,7 @@ var require_resolve_end = __commonJS({
47550
47550
  let comment = "";
47551
47551
  if (end) {
47552
47552
  let hasSpace = false;
47553
- let sep3 = "";
47553
+ let sep4 = "";
47554
47554
  for (const token of end) {
47555
47555
  const { source, type } = token;
47556
47556
  switch (type) {
@@ -47564,13 +47564,13 @@ var require_resolve_end = __commonJS({
47564
47564
  if (!comment)
47565
47565
  comment = cb;
47566
47566
  else
47567
- comment += sep3 + cb;
47568
- sep3 = "";
47567
+ comment += sep4 + cb;
47568
+ sep4 = "";
47569
47569
  break;
47570
47570
  }
47571
47571
  case "newline":
47572
47572
  if (comment)
47573
- sep3 += source;
47573
+ sep4 += source;
47574
47574
  hasSpace = true;
47575
47575
  break;
47576
47576
  default:
@@ -47613,18 +47613,18 @@ var require_resolve_flow_collection = __commonJS({
47613
47613
  let offset = fc.offset + fc.start.source.length;
47614
47614
  for (let i = 0; i < fc.items.length; ++i) {
47615
47615
  const collItem = fc.items[i];
47616
- const { start, key, sep: sep3, value } = collItem;
47616
+ const { start, key, sep: sep4, value } = collItem;
47617
47617
  const props = resolveProps.resolveProps(start, {
47618
47618
  flow: fcName,
47619
47619
  indicator: "explicit-key-ind",
47620
- next: key ?? sep3?.[0],
47620
+ next: key ?? sep4?.[0],
47621
47621
  offset,
47622
47622
  onError,
47623
47623
  parentIndent: fc.indent,
47624
47624
  startOnNewline: false
47625
47625
  });
47626
47626
  if (!props.found) {
47627
- if (!props.anchor && !props.tag && !sep3 && !value) {
47627
+ if (!props.anchor && !props.tag && !sep4 && !value) {
47628
47628
  if (i === 0 && props.comma)
47629
47629
  onError(props.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${fcName}`);
47630
47630
  else if (i < fc.items.length - 1)
@@ -47678,8 +47678,8 @@ var require_resolve_flow_collection = __commonJS({
47678
47678
  }
47679
47679
  }
47680
47680
  }
47681
- if (!isMap && !sep3 && !props.found) {
47682
- const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep3, null, props, onError);
47681
+ if (!isMap && !sep4 && !props.found) {
47682
+ const valueNode = value ? composeNode(ctx, value, props, onError) : composeEmptyNode(ctx, props.end, sep4, null, props, onError);
47683
47683
  coll.items.push(valueNode);
47684
47684
  offset = valueNode.range[2];
47685
47685
  if (isBlock(value))
@@ -47691,7 +47691,7 @@ var require_resolve_flow_collection = __commonJS({
47691
47691
  if (isBlock(key))
47692
47692
  onError(keyNode.range, "BLOCK_IN_FLOW", blockMsg);
47693
47693
  ctx.atKey = false;
47694
- const valueProps = resolveProps.resolveProps(sep3 ?? [], {
47694
+ const valueProps = resolveProps.resolveProps(sep4 ?? [], {
47695
47695
  flow: fcName,
47696
47696
  indicator: "map-value-ind",
47697
47697
  next: value,
@@ -47702,8 +47702,8 @@ var require_resolve_flow_collection = __commonJS({
47702
47702
  });
47703
47703
  if (valueProps.found) {
47704
47704
  if (!isMap && !props.found && ctx.options.strict) {
47705
- if (sep3)
47706
- for (const st of sep3) {
47705
+ if (sep4)
47706
+ for (const st of sep4) {
47707
47707
  if (st === valueProps.found)
47708
47708
  break;
47709
47709
  if (st.type === "newline") {
@@ -47720,7 +47720,7 @@ var require_resolve_flow_collection = __commonJS({
47720
47720
  else
47721
47721
  onError(valueProps.start, "MISSING_CHAR", `Missing , or : between ${fcName} items`);
47722
47722
  }
47723
- const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep3, null, valueProps, onError) : null;
47723
+ const valueNode = value ? composeNode(ctx, value, valueProps, onError) : valueProps.found ? composeEmptyNode(ctx, valueProps.end, sep4, null, valueProps, onError) : null;
47724
47724
  if (valueNode) {
47725
47725
  if (isBlock(value))
47726
47726
  onError(valueNode.range, "BLOCK_IN_FLOW", blockMsg);
@@ -47900,7 +47900,7 @@ var require_resolve_block_scalar = __commonJS({
47900
47900
  chompStart = i + 1;
47901
47901
  }
47902
47902
  let value = "";
47903
- let sep3 = "";
47903
+ let sep4 = "";
47904
47904
  let prevMoreIndented = false;
47905
47905
  for (let i = 0; i < contentStart; ++i)
47906
47906
  value += lines[i][0].slice(trimIndent) + "\n";
@@ -47917,24 +47917,24 @@ var require_resolve_block_scalar = __commonJS({
47917
47917
  indent = "";
47918
47918
  }
47919
47919
  if (type === Scalar.Scalar.BLOCK_LITERAL) {
47920
- value += sep3 + indent.slice(trimIndent) + content;
47921
- sep3 = "\n";
47920
+ value += sep4 + indent.slice(trimIndent) + content;
47921
+ sep4 = "\n";
47922
47922
  } else if (indent.length > trimIndent || content[0] === " ") {
47923
- if (sep3 === " ")
47924
- sep3 = "\n";
47925
- else if (!prevMoreIndented && sep3 === "\n")
47926
- sep3 = "\n\n";
47927
- value += sep3 + indent.slice(trimIndent) + content;
47928
- sep3 = "\n";
47923
+ if (sep4 === " ")
47924
+ sep4 = "\n";
47925
+ else if (!prevMoreIndented && sep4 === "\n")
47926
+ sep4 = "\n\n";
47927
+ value += sep4 + indent.slice(trimIndent) + content;
47928
+ sep4 = "\n";
47929
47929
  prevMoreIndented = true;
47930
47930
  } else if (content === "") {
47931
- if (sep3 === "\n")
47931
+ if (sep4 === "\n")
47932
47932
  value += "\n";
47933
47933
  else
47934
- sep3 = "\n";
47934
+ sep4 = "\n";
47935
47935
  } else {
47936
- value += sep3 + content;
47937
- sep3 = " ";
47936
+ value += sep4 + content;
47937
+ sep4 = " ";
47938
47938
  prevMoreIndented = false;
47939
47939
  }
47940
47940
  }
@@ -48116,25 +48116,25 @@ var require_resolve_flow_scalar = __commonJS({
48116
48116
  if (!match)
48117
48117
  return source;
48118
48118
  let res = match[1];
48119
- let sep3 = " ";
48119
+ let sep4 = " ";
48120
48120
  let pos = first.lastIndex;
48121
48121
  line.lastIndex = pos;
48122
48122
  while (match = line.exec(source)) {
48123
48123
  if (match[1] === "") {
48124
- if (sep3 === "\n")
48125
- res += sep3;
48124
+ if (sep4 === "\n")
48125
+ res += sep4;
48126
48126
  else
48127
- sep3 = "\n";
48127
+ sep4 = "\n";
48128
48128
  } else {
48129
- res += sep3 + match[1];
48130
- sep3 = " ";
48129
+ res += sep4 + match[1];
48130
+ sep4 = " ";
48131
48131
  }
48132
48132
  pos = line.lastIndex;
48133
48133
  }
48134
48134
  const last = /[ \t]*(.*)/sy;
48135
48135
  last.lastIndex = pos;
48136
48136
  match = last.exec(source);
48137
- return res + sep3 + (match?.[1] ?? "");
48137
+ return res + sep4 + (match?.[1] ?? "");
48138
48138
  }
48139
48139
  function doubleQuotedValue(source, onError) {
48140
48140
  let res = "";
@@ -48944,14 +48944,14 @@ var require_cst_stringify = __commonJS({
48944
48944
  }
48945
48945
  }
48946
48946
  }
48947
- function stringifyItem({ start, key, sep: sep3, value }) {
48947
+ function stringifyItem({ start, key, sep: sep4, value }) {
48948
48948
  let res = "";
48949
48949
  for (const st of start)
48950
48950
  res += st.source;
48951
48951
  if (key)
48952
48952
  res += stringifyToken(key);
48953
- if (sep3)
48954
- for (const st of sep3)
48953
+ if (sep4)
48954
+ for (const st of sep4)
48955
48955
  res += st.source;
48956
48956
  if (value)
48957
48957
  res += stringifyToken(value);
@@ -50118,18 +50118,18 @@ var require_parser = __commonJS({
50118
50118
  if (this.type === "map-value-ind") {
50119
50119
  const prev = getPrevProps(this.peek(2));
50120
50120
  const start = getFirstKeyStartProps(prev);
50121
- let sep3;
50121
+ let sep4;
50122
50122
  if (scalar.end) {
50123
- sep3 = scalar.end;
50124
- sep3.push(this.sourceToken);
50123
+ sep4 = scalar.end;
50124
+ sep4.push(this.sourceToken);
50125
50125
  delete scalar.end;
50126
50126
  } else
50127
- sep3 = [this.sourceToken];
50127
+ sep4 = [this.sourceToken];
50128
50128
  const map = {
50129
50129
  type: "block-map",
50130
50130
  offset: scalar.offset,
50131
50131
  indent: scalar.indent,
50132
- items: [{ start, key: scalar, sep: sep3 }]
50132
+ items: [{ start, key: scalar, sep: sep4 }]
50133
50133
  };
50134
50134
  this.onKeyLine = true;
50135
50135
  this.stack[this.stack.length - 1] = map;
@@ -50282,15 +50282,15 @@ var require_parser = __commonJS({
50282
50282
  } else if (isFlowToken(it.key) && !includesToken(it.sep, "newline")) {
50283
50283
  const start2 = getFirstKeyStartProps(it.start);
50284
50284
  const key = it.key;
50285
- const sep3 = it.sep;
50286
- sep3.push(this.sourceToken);
50285
+ const sep4 = it.sep;
50286
+ sep4.push(this.sourceToken);
50287
50287
  delete it.key;
50288
50288
  delete it.sep;
50289
50289
  this.stack.push({
50290
50290
  type: "block-map",
50291
50291
  offset: this.offset,
50292
50292
  indent: this.indent,
50293
- items: [{ start: start2, key, sep: sep3 }]
50293
+ items: [{ start: start2, key, sep: sep4 }]
50294
50294
  });
50295
50295
  } else if (start.length > 0) {
50296
50296
  it.sep = it.sep.concat(start, this.sourceToken);
@@ -50484,13 +50484,13 @@ var require_parser = __commonJS({
50484
50484
  const prev = getPrevProps(parent);
50485
50485
  const start = getFirstKeyStartProps(prev);
50486
50486
  fixFlowSeqItems(fc);
50487
- const sep3 = fc.end.splice(1, fc.end.length);
50488
- sep3.push(this.sourceToken);
50487
+ const sep4 = fc.end.splice(1, fc.end.length);
50488
+ sep4.push(this.sourceToken);
50489
50489
  const map = {
50490
50490
  type: "block-map",
50491
50491
  offset: fc.offset,
50492
50492
  indent: fc.indent,
50493
- items: [{ start, key: fc, sep: sep3 }]
50493
+ items: [{ start, key: fc, sep: sep4 }]
50494
50494
  };
50495
50495
  this.onKeyLine = true;
50496
50496
  this.stack[this.stack.length - 1] = map;
@@ -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 import_node_path20 = require("node:path");
50831
- var import_node_os14 = require("node:os");
50832
- var import_node_fs21 = require("node:fs");
50830
+ var import_node_path21 = require("node:path");
50831
+ var import_node_os15 = require("node:os");
50832
+ var import_node_fs22 = require("node:fs");
50833
50833
  var import_node_child_process6 = require("node:child_process");
50834
50834
 
50835
50835
  // log.mjs
@@ -50899,6 +50899,13 @@ function normalizeNote(n) {
50899
50899
  const kind = /defaulting to write-mode|not installed/i.test(text) ? "warn" : "info";
50900
50900
  return { kind, text };
50901
50901
  }
50902
+ function isVisualInput(i) {
50903
+ return i.widget === "file" || i.type === "image" || i.type === "file";
50904
+ }
50905
+ function findRebakeInput(inputs) {
50906
+ const hit = inputs.find((i) => isVisualInput(i) && i.readStrategy === "bake");
50907
+ return hit ? hit.name : null;
50908
+ }
50902
50909
  var AppNotFoundError = class extends Error {
50903
50910
  constructor(id) {
50904
50911
  super(`app not found: ${id}`);
@@ -50989,6 +50996,7 @@ function readApp(id) {
50989
50996
  command,
50990
50997
  kind: locked && typeof locked.kind === "string" ? locked.kind : "agent",
50991
50998
  mode: lockMode === "write" || lockMode === "read" ? lockMode : "unknown",
50999
+ runtimeModel: !!locked && locked["runtime-model"] === true,
50992
51000
  inputs: asRecord(locked?.inputs),
50993
51001
  config: asRecord(n.config),
50994
51002
  notes: notes2,
@@ -51011,11 +51019,15 @@ function readApp(id) {
51011
51019
  const inputsDecl = asRecord(src.inputs);
51012
51020
  const inputs = Object.entries(inputsDecl).map(([name, spec]) => {
51013
51021
  const s = asRecord(spec);
51022
+ const rs = typeof s["read-strategy"] === "string" ? s["read-strategy"] : null;
51014
51023
  return {
51015
51024
  name,
51016
51025
  type: typeof s.type === "string" ? s.type : "string",
51017
51026
  default: "default" in s ? s.default : null,
51018
- description: typeof s.description === "string" ? s.description : ""
51027
+ description: typeof s.description === "string" ? s.description : "",
51028
+ widget: typeof s.widget === "string" ? s.widget : null,
51029
+ accept: Array.isArray(s.accept) ? s.accept.map(String) : [],
51030
+ readStrategy: rs === "parse" || rs === "bake" || rs === "rebake" || rs === "vision" ? rs : null
51019
51031
  };
51020
51032
  });
51021
51033
  const notes = nodes.flatMap((n) => n.notes.map((nt) => ({ nodeId: n.id, kind: nt.kind, text: nt.text })));
@@ -51037,7 +51049,8 @@ function readApp(id) {
51037
51049
  runState,
51038
51050
  runnable: runState === "ready",
51039
51051
  triggerSource: detectTriggerSource(nodes, connections, readCommandSpec),
51040
- baked: src["exposes-as-agent"] === true
51052
+ baked: src["exposes-as-agent"] === true,
51053
+ rebakeInput: findRebakeInput(inputs)
51041
51054
  };
51042
51055
  }
51043
51056
  function sourceNodeId(nodes, connections) {
@@ -51289,7 +51302,7 @@ function runRaw(args, onSpawn) {
51289
51302
  if (bad !== void 0) throw new AwareError(`refusing to pass unsafe argument to shell: ${bad}`);
51290
51303
  }
51291
51304
  const argv = [...preArgs, ...args];
51292
- return new Promise((resolve5, reject) => {
51305
+ return new Promise((resolve6, reject) => {
51293
51306
  const child = (0, import_node_child_process.spawn)(bin, argv, { shell: invoker.shell, windowsHide: true });
51294
51307
  onSpawn?.(child);
51295
51308
  let stdout = "";
@@ -51307,7 +51320,7 @@ function runRaw(args, onSpawn) {
51307
51320
  });
51308
51321
  child.on("close", (code) => {
51309
51322
  clearTimeout(timer);
51310
- resolve5({ code: code ?? -1, stdout, stderr });
51323
+ resolve6({ code: code ?? -1, stdout, stderr });
51311
51324
  });
51312
51325
  });
51313
51326
  }
@@ -51321,7 +51334,7 @@ function runRawWithEnv(args, env2, timeoutMs) {
51321
51334
  }
51322
51335
  const argv = [...preArgs, ...args];
51323
51336
  const limit = timeoutMs ?? RUN_TIMEOUT_MS;
51324
- return new Promise((resolve5, reject) => {
51337
+ return new Promise((resolve6, reject) => {
51325
51338
  const child = (0, import_node_child_process.spawn)(bin, argv, { shell: invoker.shell, windowsHide: true, env: env2 ?? process.env });
51326
51339
  let stdout = "";
51327
51340
  let stderr = "";
@@ -51338,7 +51351,7 @@ function runRawWithEnv(args, env2, timeoutMs) {
51338
51351
  });
51339
51352
  child.on("close", (code) => {
51340
51353
  clearTimeout(timer);
51341
- resolve5({ code: code ?? -1, stdout, stderr });
51354
+ resolve6({ code: code ?? -1, stdout, stderr });
51342
51355
  });
51343
51356
  });
51344
51357
  }
@@ -51388,7 +51401,7 @@ async function execTekla(code, opts = {}) {
51388
51401
  args: opts.args ?? {}
51389
51402
  });
51390
51403
  const timeoutMs = opts.debug ? 15 * 6e4 : RUN_TIMEOUT_MS;
51391
- return new Promise((resolve5, reject) => {
51404
+ return new Promise((resolve6, reject) => {
51392
51405
  const child = (0, import_node_child_process.spawn)(bin, ["exec", "--version", version, "--json-stdin"], { windowsHide: true });
51393
51406
  let stdout = "";
51394
51407
  let stderr = "";
@@ -51416,7 +51429,7 @@ async function execTekla(code, opts = {}) {
51416
51429
  })
51417
51430
  );
51418
51431
  }
51419
- resolve5(parsed);
51432
+ resolve6(parsed);
51420
51433
  });
51421
51434
  child.stdin.write(payload);
51422
51435
  child.stdin.end();
@@ -51714,7 +51727,7 @@ function connectDeviceCode(id, onEvent) {
51714
51727
  if (!bin) throw new AwareError("aware CLI invoker not resolved");
51715
51728
  inFlightConnects.get(id)?.();
51716
51729
  const argv = [...preArgs, "connect", id, "--device-code", "--json"];
51717
- return new Promise((resolve5, reject) => {
51730
+ return new Promise((resolve6, reject) => {
51718
51731
  const child = (0, import_node_child_process.spawn)(bin, argv, { shell: invoker.shell, windowsHide: true });
51719
51732
  let buf = "";
51720
51733
  let gotPrompt = false;
@@ -51740,7 +51753,7 @@ function connectDeviceCode(id, onEvent) {
51740
51753
  }
51741
51754
  if (!gotPrompt && obj.phase === "prompt" && typeof obj.user_code === "string") {
51742
51755
  gotPrompt = true;
51743
- resolve5({ prompt: obj, cancel });
51756
+ resolve6({ prompt: obj, cancel });
51744
51757
  } else {
51745
51758
  onEvent(obj);
51746
51759
  }
@@ -52666,7 +52679,7 @@ function appVersion() {
52666
52679
  return resolveVersion({
52667
52680
  isSea: isSea2(),
52668
52681
  sqVersionXml: readSqVersionXml(),
52669
- define: true ? "0.16.1" : void 0,
52682
+ define: true ? "0.17.0" : void 0,
52670
52683
  pkgVersion: readPkgVersion()
52671
52684
  });
52672
52685
  }
@@ -52676,7 +52689,7 @@ function resolveChannel(s) {
52676
52689
  return "dev";
52677
52690
  }
52678
52691
  function appChannel() {
52679
- return resolveChannel({ isSea: isSea2(), define: true ? "0.16.1" : void 0 });
52692
+ return resolveChannel({ isSea: isSea2(), define: true ? "0.17.0" : void 0 });
52680
52693
  }
52681
52694
 
52682
52695
  // oauth-presets.ts
@@ -52739,10 +52752,10 @@ function ensureManagedProfile(id) {
52739
52752
  return "written";
52740
52753
  }
52741
52754
  function isPortBindable(port, host = "127.0.0.1") {
52742
- return new Promise((resolve5) => {
52755
+ return new Promise((resolve6) => {
52743
52756
  const srv = import_node_net.default.createServer();
52744
- srv.once("error", () => resolve5(false));
52745
- srv.listen(port, host, () => srv.close(() => resolve5(true)));
52757
+ srv.once("error", () => resolve6(false));
52758
+ srv.listen(port, host, () => srv.close(() => resolve6(true)));
52746
52759
  });
52747
52760
  }
52748
52761
 
@@ -52826,7 +52839,7 @@ function extractReportHtml(events) {
52826
52839
  }
52827
52840
 
52828
52841
  // index.ts
52829
- var import_node_crypto6 = require("node:crypto");
52842
+ var import_node_crypto7 = require("node:crypto");
52830
52843
 
52831
52844
  // graft.ts
52832
52845
  var TEKLA_MARKER = "Recipe: Tekla model plug-in";
@@ -53162,9 +53175,65 @@ function decodeSnapshots(inputs) {
53162
53175
  });
53163
53176
  }
53164
53177
 
53178
+ // visual-input-store.ts
53179
+ var import_node_crypto5 = require("node:crypto");
53180
+ var import_node_fs13 = require("node:fs");
53181
+ var import_node_os9 = require("node:os");
53182
+ var import_node_path11 = require("node:path");
53183
+ var MAX_BYTES3 = 25 * 1024 * 1024;
53184
+ var VisualInputError = class extends Error {
53185
+ };
53186
+ function inputsDir() {
53187
+ const root = process.env.FLOLESS_HOME ?? (0, import_node_path11.join)((0, import_node_os9.homedir)(), ".floless");
53188
+ return (0, import_node_path11.join)(root, "inputs");
53189
+ }
53190
+ function sniffExt2(buf) {
53191
+ if (buf.length >= 8 && buf[0] === 137 && buf[1] === 80 && buf[2] === 78 && buf[3] === 71) return "png";
53192
+ if (buf.length >= 3 && buf[0] === 255 && buf[1] === 216 && buf[2] === 255) return "jpg";
53193
+ if (buf.length >= 12 && buf.toString("ascii", 0, 4) === "RIFF" && buf.toString("ascii", 8, 12) === "WEBP") return "webp";
53194
+ if (buf.length >= 5 && buf.toString("ascii", 0, 5) === "%PDF-") return "pdf";
53195
+ return null;
53196
+ }
53197
+ var RESERVED = /^(con|prn|aux|nul|com[1-9]|lpt[1-9])(\..*)?$/i;
53198
+ function safeSegment(s) {
53199
+ if (!s || s === "." || s.includes("..")) return false;
53200
+ if (s.includes("/") || s.includes("\\") || s.includes(import_node_path11.sep)) return false;
53201
+ for (let i = 0; i < s.length; i++) {
53202
+ const c = s.charCodeAt(i);
53203
+ if (c < 32 || c === 58) return false;
53204
+ }
53205
+ if (/[. ]$/.test(s)) return false;
53206
+ return !RESERVED.test(s);
53207
+ }
53208
+ function storeVisualInput(appId, dataUrl) {
53209
+ if (!safeSegment(appId)) throw new VisualInputError("invalid app id");
53210
+ const m = /^data:([\w/+.-]+);base64,(.*)$/s.exec(dataUrl || "");
53211
+ if (!m) throw new VisualInputError("visual input must be a base64 data URL");
53212
+ const buf = Buffer.from(m[2] ?? "", "base64");
53213
+ if (buf.length === 0) throw new VisualInputError("empty visual input");
53214
+ if (buf.length > MAX_BYTES3) throw new VisualInputError("visual input too large (max 25 MB)");
53215
+ const ext = sniffExt2(buf);
53216
+ if (!ext) throw new VisualInputError("visual input must be PNG, JPEG, WebP, or PDF");
53217
+ const sha2562 = (0, import_node_crypto5.createHash)("sha256").update(buf).digest("hex");
53218
+ const dir = (0, import_node_path11.join)(inputsDir(), appId);
53219
+ const path = (0, import_node_path11.join)(dir, `${sha2562}.${ext}`);
53220
+ const root = (0, import_node_path11.resolve)(inputsDir());
53221
+ const target = (0, import_node_path11.resolve)(path);
53222
+ if (target !== root && !target.startsWith(root + import_node_path11.sep)) {
53223
+ throw new VisualInputError("refusing to write outside the inputs root");
53224
+ }
53225
+ (0, import_node_fs13.mkdirSync)(dir, { recursive: true });
53226
+ if (!(0, import_node_fs13.existsSync)(path)) {
53227
+ const tmp = `${path}.tmp`;
53228
+ (0, import_node_fs13.writeFileSync)(tmp, buf);
53229
+ (0, import_node_fs13.renameSync)(tmp, path);
53230
+ }
53231
+ return { path, ext, bytes: (0, import_node_fs13.statSync)(path).size, sha256: sha2562 };
53232
+ }
53233
+
53165
53234
  // routines.ts
53166
- var import_node_fs14 = require("node:fs");
53167
- var import_node_path12 = require("node:path");
53235
+ var import_node_fs15 = require("node:fs");
53236
+ var import_node_path13 = require("node:path");
53168
53237
 
53169
53238
  // sse.ts
53170
53239
  var clients = /* @__PURE__ */ new Set();
@@ -53201,11 +53270,11 @@ function clientCount() {
53201
53270
  }
53202
53271
 
53203
53272
  // trigger-sessions.ts
53204
- var import_node_fs13 = require("node:fs");
53205
- var import_node_os9 = require("node:os");
53206
- var import_node_path11 = require("node:path");
53273
+ var import_node_fs14 = require("node:fs");
53274
+ var import_node_os10 = require("node:os");
53275
+ var import_node_path12 = require("node:path");
53207
53276
  var import_yaml4 = __toESM(require_dist6(), 1);
53208
- var AGENTS_DIR2 = process.env.AWARE_HOME ? (0, import_node_path11.join)(process.env.AWARE_HOME, "agents") : (0, import_node_path11.join)((0, import_node_os9.homedir)(), ".aware", "agents");
53277
+ var AGENTS_DIR2 = process.env.AWARE_HOME ? (0, import_node_path12.join)(process.env.AWARE_HOME, "agents") : (0, import_node_path12.join)((0, import_node_os10.homedir)(), ".aware", "agents");
53209
53278
  function summarizeFire(data) {
53210
53279
  if (!data) return "event";
53211
53280
  const type = typeof data.type === "string" ? data.type : "";
@@ -53222,10 +53291,10 @@ function mapTriggerState(phase) {
53222
53291
  function isHostBacked(agent, agentsDir = AGENTS_DIR2) {
53223
53292
  const safe = (n) => !n.includes("/") && !n.includes("\\") && !n.includes("..");
53224
53293
  if (!safe(agent)) return false;
53225
- const manifestPath = (0, import_node_path11.join)(agentsDir, agent, "manifest.yaml");
53226
- if (!(0, import_node_fs13.existsSync)(manifestPath)) return false;
53294
+ const manifestPath = (0, import_node_path12.join)(agentsDir, agent, "manifest.yaml");
53295
+ if (!(0, import_node_fs14.existsSync)(manifestPath)) return false;
53227
53296
  try {
53228
- const doc = (0, import_yaml4.parse)((0, import_node_fs13.readFileSync)(manifestPath, "utf8"));
53297
+ const doc = (0, import_yaml4.parse)((0, import_node_fs14.readFileSync)(manifestPath, "utf8"));
53229
53298
  const transport = doc?.transport;
53230
53299
  return !!(transport && typeof transport === "object" && "cli" in transport);
53231
53300
  } catch {
@@ -53500,7 +53569,7 @@ var RoutineError = class extends Error {
53500
53569
  }
53501
53570
  status;
53502
53571
  };
53503
- var ROUTINES_FILE = (0, import_node_path12.join)(flolessRoot, "routines.json");
53572
+ var ROUTINES_FILE = (0, import_node_path13.join)(flolessRoot, "routines.json");
53504
53573
  var routines = [];
53505
53574
  var loaded = false;
53506
53575
  function ensureLoaded() {
@@ -53536,10 +53605,10 @@ function sanitizeRoutine(raw) {
53536
53605
  };
53537
53606
  }
53538
53607
  function loadFromDisk() {
53539
- if (!(0, import_node_fs14.existsSync)(ROUTINES_FILE)) return [];
53608
+ if (!(0, import_node_fs15.existsSync)(ROUTINES_FILE)) return [];
53540
53609
  let text;
53541
53610
  try {
53542
- text = (0, import_node_fs14.readFileSync)(ROUTINES_FILE, "utf8");
53611
+ text = (0, import_node_fs15.readFileSync)(ROUTINES_FILE, "utf8");
53543
53612
  } catch {
53544
53613
  return [];
53545
53614
  }
@@ -53548,17 +53617,17 @@ function loadFromDisk() {
53548
53617
  return Array.isArray(parsed) ? parsed.map(sanitizeRoutine).filter((r) => r !== null) : [];
53549
53618
  } catch {
53550
53619
  try {
53551
- (0, import_node_fs14.renameSync)(ROUTINES_FILE, `${ROUTINES_FILE}.corrupt-${Date.now()}`);
53620
+ (0, import_node_fs15.renameSync)(ROUTINES_FILE, `${ROUTINES_FILE}.corrupt-${Date.now()}`);
53552
53621
  } catch {
53553
53622
  }
53554
53623
  return [];
53555
53624
  }
53556
53625
  }
53557
53626
  function saveRoutines() {
53558
- if (!(0, import_node_fs14.existsSync)(flolessRoot)) (0, import_node_fs14.mkdirSync)(flolessRoot, { recursive: true });
53627
+ if (!(0, import_node_fs15.existsSync)(flolessRoot)) (0, import_node_fs15.mkdirSync)(flolessRoot, { recursive: true });
53559
53628
  const tmp = `${ROUTINES_FILE}.${process.pid}.tmp`;
53560
- (0, import_node_fs14.writeFileSync)(tmp, JSON.stringify(routines, null, 2));
53561
- (0, import_node_fs14.renameSync)(tmp, ROUTINES_FILE);
53629
+ (0, import_node_fs15.writeFileSync)(tmp, JSON.stringify(routines, null, 2));
53630
+ (0, import_node_fs15.renameSync)(tmp, ROUTINES_FILE);
53562
53631
  }
53563
53632
  function listRoutines() {
53564
53633
  ensureLoaded();
@@ -53950,9 +54019,9 @@ function isGatedAwareRoute(url, method) {
53950
54019
 
53951
54020
  // autostart.mjs
53952
54021
  var import_node_child_process3 = require("node:child_process");
53953
- var import_node_fs15 = require("node:fs");
53954
- var import_node_os10 = require("node:os");
53955
- var import_node_path13 = require("node:path");
54022
+ var import_node_fs16 = require("node:fs");
54023
+ var import_node_os11 = require("node:os");
54024
+ var import_node_path14 = require("node:path");
53956
54025
 
53957
54026
  // teardown.mjs
53958
54027
  var RUN_KEY = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Run";
@@ -54064,8 +54133,8 @@ function removeLegacyRunKey() {
54064
54133
  }
54065
54134
  function logLine(msg) {
54066
54135
  try {
54067
- (0, import_node_fs15.mkdirSync)(logDir(), { recursive: true });
54068
- (0, import_node_fs15.appendFileSync)(logFilePath(), `${(/* @__PURE__ */ new Date()).toISOString()} ${msg}
54136
+ (0, import_node_fs16.mkdirSync)(logDir(), { recursive: true });
54137
+ (0, import_node_fs16.appendFileSync)(logFilePath(), `${(/* @__PURE__ */ new Date()).toISOString()} ${msg}
54069
54138
  `);
54070
54139
  } catch {
54071
54140
  }
@@ -54073,8 +54142,8 @@ function logLine(msg) {
54073
54142
  function registerAutostart(exePath) {
54074
54143
  if (!isWin) return;
54075
54144
  const xml = buildAutostartTaskXml(exePath, currentUserId());
54076
- const tmp = (0, import_node_path13.join)((0, import_node_os10.tmpdir)(), `floless-autostart-${process.pid}-${Date.now()}.xml`);
54077
- (0, import_node_fs15.writeFileSync)(tmp, "\uFEFF" + xml, { encoding: "utf16le" });
54145
+ const tmp = (0, import_node_path14.join)((0, import_node_os11.tmpdir)(), `floless-autostart-${process.pid}-${Date.now()}.xml`);
54146
+ (0, import_node_fs16.writeFileSync)(tmp, "\uFEFF" + xml, { encoding: "utf16le" });
54078
54147
  try {
54079
54148
  (0, import_node_child_process3.execFileSync)("schtasks", ["/Create", "/TN", TASK_NAME, "/XML", tmp, "/F"], {
54080
54149
  stdio: ["ignore", "ignore", "ignore"],
@@ -54085,7 +54154,7 @@ function registerAutostart(exePath) {
54085
54154
  throw err;
54086
54155
  } finally {
54087
54156
  try {
54088
- (0, import_node_fs15.rmSync)(tmp, { force: true });
54157
+ (0, import_node_fs16.rmSync)(tmp, { force: true });
54089
54158
  } catch {
54090
54159
  }
54091
54160
  }
@@ -54119,27 +54188,27 @@ function unregisterAutostart() {
54119
54188
 
54120
54189
  // updater.ts
54121
54190
  var import_node_child_process4 = require("node:child_process");
54122
- var import_node_crypto5 = require("node:crypto");
54123
- var import_node_fs17 = require("node:fs");
54191
+ var import_node_crypto6 = require("node:crypto");
54192
+ var import_node_fs18 = require("node:fs");
54124
54193
  var import_node_stream = require("node:stream");
54125
54194
  var import_promises = require("node:stream/promises");
54126
- var import_node_path15 = require("node:path");
54195
+ var import_node_path16 = require("node:path");
54127
54196
 
54128
54197
  // post-update-marker.mjs
54129
- var import_node_fs16 = require("node:fs");
54130
- var import_node_os11 = require("node:os");
54131
- var import_node_path14 = require("node:path");
54198
+ var import_node_fs17 = require("node:fs");
54199
+ var import_node_os12 = require("node:os");
54200
+ var import_node_path15 = require("node:path");
54132
54201
  var FRESH_MS = 12e4;
54133
54202
  function markerPath() {
54134
54203
  const override = (process.env.FLOLESS_POST_UPDATE_MARKER ?? "").trim();
54135
54204
  if (override) return override;
54136
- const root = process.env.FLOLESS_HOME ?? (0, import_node_path14.join)((0, import_node_os11.homedir)(), ".floless");
54137
- return (0, import_node_path14.join)(root, ".post-update");
54205
+ const root = process.env.FLOLESS_HOME ?? (0, import_node_path15.join)((0, import_node_os12.homedir)(), ".floless");
54206
+ return (0, import_node_path15.join)(root, ".post-update");
54138
54207
  }
54139
54208
  function legacyMarkerPath() {
54140
54209
  if ((process.env.FLOLESS_POST_UPDATE_MARKER ?? "").trim()) return null;
54141
54210
  try {
54142
- return (0, import_node_path14.join)((0, import_node_path14.dirname)((0, import_node_path14.dirname)(process.execPath)), ".floless-post-update");
54211
+ return (0, import_node_path15.join)((0, import_node_path15.dirname)((0, import_node_path15.dirname)(process.execPath)), ".floless-post-update");
54143
54212
  } catch {
54144
54213
  return null;
54145
54214
  }
@@ -54149,7 +54218,7 @@ function writePostUpdateMarker() {
54149
54218
  for (const p of [markerPath(), legacyMarkerPath()]) {
54150
54219
  if (!p) continue;
54151
54220
  try {
54152
- (0, import_node_fs16.writeFileSync)(p, (/* @__PURE__ */ new Date()).toISOString());
54221
+ (0, import_node_fs17.writeFileSync)(p, (/* @__PURE__ */ new Date()).toISOString());
54153
54222
  wrote = true;
54154
54223
  } catch {
54155
54224
  }
@@ -54161,9 +54230,9 @@ function consumePostUpdateMarker() {
54161
54230
  for (const p of [markerPath(), legacyMarkerPath()]) {
54162
54231
  if (!p) continue;
54163
54232
  try {
54164
- if (!(0, import_node_fs16.existsSync)(p)) continue;
54165
- const ageMs = Date.now() - (0, import_node_fs16.statSync)(p).mtimeMs;
54166
- (0, import_node_fs16.rmSync)(p, { force: true });
54233
+ if (!(0, import_node_fs17.existsSync)(p)) continue;
54234
+ const ageMs = Date.now() - (0, import_node_fs17.statSync)(p).mtimeMs;
54235
+ (0, import_node_fs17.rmSync)(p, { force: true });
54167
54236
  if (ageMs < FRESH_MS) fresh = true;
54168
54237
  } catch {
54169
54238
  }
@@ -54180,13 +54249,13 @@ function currentVersion() {
54180
54249
  return appVersion();
54181
54250
  }
54182
54251
  function installRoot() {
54183
- return (0, import_node_path15.dirname)((0, import_node_path15.dirname)(process.execPath));
54252
+ return (0, import_node_path16.dirname)((0, import_node_path16.dirname)(process.execPath));
54184
54253
  }
54185
54254
  function updateExePath() {
54186
- return (0, import_node_path15.join)(installRoot(), "Update.exe");
54255
+ return (0, import_node_path16.join)(installRoot(), "Update.exe");
54187
54256
  }
54188
54257
  function packagesDir() {
54189
- return (0, import_node_path15.join)(installRoot(), "packages");
54258
+ return (0, import_node_path16.join)(installRoot(), "packages");
54190
54259
  }
54191
54260
  function feedUrl() {
54192
54261
  const env2 = (process.env.FLOLESS_UPDATE_URL ?? "").trim().replace(/\/+$/, "");
@@ -54278,23 +54347,23 @@ async function checkForUpdate() {
54278
54347
  return { supported: true, currentVersion: cur, updateAvailable: true, targetVersion: latest.Version, asset: latest };
54279
54348
  }
54280
54349
  async function sha1OfFile(path) {
54281
- const hash = (0, import_node_crypto5.createHash)("sha1");
54282
- await (0, import_promises.pipeline)((0, import_node_fs17.createReadStream)(path), hash);
54350
+ const hash = (0, import_node_crypto6.createHash)("sha1");
54351
+ await (0, import_promises.pipeline)((0, import_node_fs18.createReadStream)(path), hash);
54283
54352
  return hash.digest("hex").toUpperCase();
54284
54353
  }
54285
54354
  async function downloadPackage(asset) {
54286
54355
  if (!NUPKG_NAME.test(asset.FileName)) throw new Error(`refusing suspicious package name: ${asset.FileName}`);
54287
54356
  const want = asset.SHA1.toUpperCase();
54288
54357
  const dir = packagesDir();
54289
- (0, import_node_fs17.mkdirSync)(dir, { recursive: true });
54290
- const dest = (0, import_node_path15.join)(dir, asset.FileName);
54291
- if ((0, import_node_fs17.existsSync)(dest) && await sha1OfFile(dest) === want) return dest;
54358
+ (0, import_node_fs18.mkdirSync)(dir, { recursive: true });
54359
+ const dest = (0, import_node_path16.join)(dir, asset.FileName);
54360
+ if ((0, import_node_fs18.existsSync)(dest) && await sha1OfFile(dest) === want) return dest;
54292
54361
  const res = await authedFetch(`${feedUrl()}/${encodeURIComponent(asset.FileName)}`, {
54293
54362
  redirect: "follow",
54294
54363
  signal: AbortSignal.timeout(DOWNLOAD_TIMEOUT_MS)
54295
54364
  });
54296
54365
  if (!res.ok || !res.body) throw new Error(`download failed: HTTP ${res.status} for ${asset.FileName}`);
54297
- await (0, import_promises.pipeline)(import_node_stream.Readable.fromWeb(res.body), (0, import_node_fs17.createWriteStream)(dest));
54366
+ await (0, import_promises.pipeline)(import_node_stream.Readable.fromWeb(res.body), (0, import_node_fs18.createWriteStream)(dest));
54298
54367
  const got = await sha1OfFile(dest);
54299
54368
  if (got !== want) throw new Error(`SHA1 mismatch for ${asset.FileName}: feed=${want} got=${got}`);
54300
54369
  return dest;
@@ -54303,12 +54372,12 @@ async function applyUpdate(check, opts) {
54303
54372
  if (!check.supported) return { applied: false, message: check.reason ?? "auto-update not supported in this runtime" };
54304
54373
  if (!check.updateAvailable || !check.asset) return { applied: false, message: check.reason ?? "no update available" };
54305
54374
  const exe = updateExePath();
54306
- if (!(0, import_node_fs17.existsSync)(exe)) {
54375
+ if (!(0, import_node_fs18.existsSync)(exe)) {
54307
54376
  return { applied: false, message: `Update.exe not found at ${exe} \u2014 is this a Velopack install?` };
54308
54377
  }
54309
54378
  const pkg = await downloadPackage(check.asset);
54310
54379
  if (opts?.onBeforeApply) await opts.onBeforeApply();
54311
- await new Promise((resolve5, reject) => {
54380
+ await new Promise((resolve6, reject) => {
54312
54381
  const child = (0, import_node_child_process4.spawn)(exe, ["apply", "--package", pkg, "--waitPid", String(process.pid)], {
54313
54382
  cwd: installRoot(),
54314
54383
  detached: true,
@@ -54318,7 +54387,7 @@ async function applyUpdate(check, opts) {
54318
54387
  child.once("error", reject);
54319
54388
  child.once("spawn", () => {
54320
54389
  child.unref();
54321
- resolve5();
54390
+ resolve6();
54322
54391
  });
54323
54392
  });
54324
54393
  writePostUpdateMarker();
@@ -54512,12 +54581,12 @@ function isTraceCorrupt(events) {
54512
54581
 
54513
54582
  // launch.mjs
54514
54583
  var import_node_child_process5 = require("node:child_process");
54515
- var import_node_path16 = require("node:path");
54584
+ var import_node_path17 = require("node:path");
54516
54585
  var import_node_url = require("node:url");
54517
- var import_node_fs18 = require("node:fs");
54586
+ var import_node_fs19 = require("node:fs");
54518
54587
  var import_node_http = __toESM(require("node:http"), 1);
54519
54588
  var import_node_readline = require("node:readline");
54520
- var __dirname2 = (0, import_node_path16.dirname)((0, import_node_url.fileURLToPath)(__import_meta_url));
54589
+ var __dirname2 = (0, import_node_path17.dirname)((0, import_node_url.fileURLToPath)(__import_meta_url));
54521
54590
  var PORT = Number(process.env.PORT ?? 4317);
54522
54591
  var HEALTH_URL = `http://127.0.0.1:${PORT}/api/health`;
54523
54592
  var BROWSER_URL = `http://floless.localhost:${PORT}`;
@@ -54530,20 +54599,20 @@ var log = (m) => {
54530
54599
  }
54531
54600
  };
54532
54601
  function ping() {
54533
- return new Promise((resolve5) => {
54602
+ return new Promise((resolve6) => {
54534
54603
  const req = import_node_http.default.get(HEALTH_URL, { timeout: 1500 }, (res) => {
54535
54604
  res.resume();
54536
- resolve5(res.statusCode === 200);
54605
+ resolve6(res.statusCode === 200);
54537
54606
  });
54538
- req.on("error", () => resolve5(false));
54607
+ req.on("error", () => resolve6(false));
54539
54608
  req.on("timeout", () => {
54540
54609
  req.destroy();
54541
- resolve5(false);
54610
+ resolve6(false);
54542
54611
  });
54543
54612
  });
54544
54613
  }
54545
54614
  function probeVersion() {
54546
- return new Promise((resolve5) => {
54615
+ return new Promise((resolve6) => {
54547
54616
  const req = import_node_http.default.get(HEALTH_URL, { timeout: 1500 }, (res) => {
54548
54617
  let body = "";
54549
54618
  res.on("data", (c) => {
@@ -54551,16 +54620,16 @@ function probeVersion() {
54551
54620
  });
54552
54621
  res.on("end", () => {
54553
54622
  try {
54554
- resolve5(JSON.parse(body).appVersion || null);
54623
+ resolve6(JSON.parse(body).appVersion || null);
54555
54624
  } catch {
54556
- resolve5(null);
54625
+ resolve6(null);
54557
54626
  }
54558
54627
  });
54559
54628
  });
54560
- req.on("error", () => resolve5(null));
54629
+ req.on("error", () => resolve6(null));
54561
54630
  req.on("timeout", () => {
54562
54631
  req.destroy();
54563
- resolve5(null);
54632
+ resolve6(null);
54564
54633
  });
54565
54634
  });
54566
54635
  }
@@ -54589,8 +54658,8 @@ async function waitHealthy(timeoutMs = 3e4) {
54589
54658
  function resolveServerStart() {
54590
54659
  const packaged = /flolessapp\.exe$/i.test(process.execPath);
54591
54660
  if (packaged) return { cmd: process.execPath, args: ["--serve"], shell: false };
54592
- const bundle = (0, import_node_path16.join)(__dirname2, "dist", "floless-server.cjs");
54593
- if ((0, import_node_fs18.existsSync)(bundle)) return { cmd: process.execPath, args: [bundle, "--serve"], shell: false };
54661
+ const bundle = (0, import_node_path17.join)(__dirname2, "dist", "floless-server.cjs");
54662
+ if ((0, import_node_fs19.existsSync)(bundle)) return { cmd: process.execPath, args: [bundle, "--serve"], shell: false };
54594
54663
  return { cmd: "npm", args: ["run", "start"], shell: isWin2 };
54595
54664
  }
54596
54665
  function startServerDetached() {
@@ -54743,8 +54812,8 @@ function taskkillArgs(pid, { tree = true } = {}) {
54743
54812
  }
54744
54813
  function killSupervisor({ tree = true } = {}) {
54745
54814
  if (!isWin2) return;
54746
- const isNpmChannel = /^node(\.exe)?$/i.test((0, import_node_path16.basename)(process.execPath));
54747
- const scriptMatch = isNpmChannel ? (0, import_node_path16.basename)((0, import_node_url.fileURLToPath)(__import_meta_url)) : void 0;
54815
+ const isNpmChannel = /^node(\.exe)?$/i.test((0, import_node_path17.basename)(process.execPath));
54816
+ const scriptMatch = isNpmChannel ? (0, import_node_path17.basename)((0, import_node_url.fileURLToPath)(__import_meta_url)) : void 0;
54748
54817
  const realExe = resolveRealInstallExe(process.execPath);
54749
54818
  const exeMatch = realExe === process.execPath ? process.execPath : [process.execPath, realExe];
54750
54819
  const pids = supervisorPidsToKill(enumerateProcesses(), process.pid, exeMatch, scriptMatch);
@@ -54777,15 +54846,15 @@ async function cmdRestart() {
54777
54846
  await cmdOpen();
54778
54847
  }
54779
54848
  function apiJson(path, method = "GET") {
54780
- return new Promise((resolve5, reject) => {
54849
+ return new Promise((resolve6, reject) => {
54781
54850
  const req = import_node_http.default.request(`http://127.0.0.1:${PORT}${path}`, { method, timeout: 5e3 }, (res) => {
54782
54851
  let body = "";
54783
54852
  res.on("data", (c) => body += c);
54784
54853
  res.on("end", () => {
54785
54854
  try {
54786
- resolve5(JSON.parse(body || "{}"));
54855
+ resolve6(JSON.parse(body || "{}"));
54787
54856
  } catch {
54788
- resolve5({});
54857
+ resolve6({});
54789
54858
  }
54790
54859
  });
54791
54860
  });
@@ -54851,11 +54920,11 @@ function removeRegistryFootprint() {
54851
54920
  }
54852
54921
  }
54853
54922
  function promptYesNo(question) {
54854
- return new Promise((resolve5) => {
54923
+ return new Promise((resolve6) => {
54855
54924
  const rl = (0, import_node_readline.createInterface)({ input: process.stdin, output: process.stdout });
54856
54925
  rl.question(`${question} `, (answer) => {
54857
54926
  rl.close();
54858
- resolve5(/^y(es)?$/i.test((answer ?? "").trim()));
54927
+ resolve6(/^y(es)?$/i.test((answer ?? "").trim()));
54859
54928
  });
54860
54929
  });
54861
54930
  }
@@ -54909,7 +54978,7 @@ async function runAction(arg, flagArgv = [], selfVersion = null) {
54909
54978
  }
54910
54979
  await action(parseTeardownFlags(flagArgv));
54911
54980
  }
54912
- var entry = (0, import_node_path16.basename)(process.argv[1] ?? "").toLowerCase();
54981
+ var entry = (0, import_node_path17.basename)(process.argv[1] ?? "").toLowerCase();
54913
54982
  if (entry === "launch.mjs") {
54914
54983
  runAction(process.argv[2], process.argv.slice(3)).catch((e) => {
54915
54984
  log(`error: ${e?.message ?? e}`);
@@ -54983,9 +55052,9 @@ function awareUpgradeBlockReason(s) {
54983
55052
  }
54984
55053
 
54985
55054
  // skill-sync.ts
54986
- var import_node_fs19 = require("node:fs");
54987
- var import_node_os12 = require("node:os");
54988
- var import_node_path17 = require("node:path");
55055
+ var import_node_fs20 = require("node:fs");
55056
+ var import_node_os13 = require("node:os");
55057
+ var import_node_path18 = require("node:path");
54989
55058
  var import_node_url2 = require("node:url");
54990
55059
  var import_yaml5 = __toESM(require_dist6(), 1);
54991
55060
 
@@ -54995,6 +55064,8 @@ var PRODUCT_SKILLS = [
54995
55064
  // drive the floless.app CLI / desktop bridge from the user's AI
54996
55065
  "floless-app-onboarding",
54997
55066
  // guided, re-runnable tour of AWARE + floless.app for new users
55067
+ "floless-app-rebake",
55068
+ // re-read & re-bake a baked Visual Input (B3) after the user swaps the drawing
54998
55069
  "floless-app-report-issue",
54999
55070
  // file a diagnosed bug/idea/question to the private log via the floless.io relay
55000
55071
  "floless-app-routines",
@@ -55010,30 +55081,30 @@ function selectShippedSkillNames(names) {
55010
55081
  }
55011
55082
 
55012
55083
  // skill-sync.ts
55013
- var __dirname3 = (0, import_node_path17.dirname)((0, import_node_url2.fileURLToPath)(__import_meta_url));
55084
+ var __dirname3 = (0, import_node_path18.dirname)((0, import_node_url2.fileURLToPath)(__import_meta_url));
55014
55085
  function bundledSkillsRoot() {
55015
55086
  const candidates = [
55016
- (0, import_node_path17.join)(__dirname3, "skills"),
55017
- (0, import_node_path17.join)((0, import_node_path17.dirname)(process.execPath), "skills"),
55018
- (0, import_node_path17.join)(__dirname3, "..", ".claude", "skills")
55087
+ (0, import_node_path18.join)(__dirname3, "skills"),
55088
+ (0, import_node_path18.join)((0, import_node_path18.dirname)(process.execPath), "skills"),
55089
+ (0, import_node_path18.join)(__dirname3, "..", ".claude", "skills")
55019
55090
  ];
55020
- return candidates.find((p) => (0, import_node_fs19.existsSync)(p)) ?? null;
55091
+ return candidates.find((p) => (0, import_node_fs20.existsSync)(p)) ?? null;
55021
55092
  }
55022
55093
  function targetConfigDirs() {
55023
55094
  const override = process.env.FLOLESS_SKILL_TARGETS;
55024
55095
  if (override) {
55025
55096
  return override.split(";").map((d) => d.trim()).filter(Boolean).map((dir) => ({ runtime: "custom", dir }));
55026
55097
  }
55027
- const home = (0, import_node_os12.homedir)();
55098
+ const home = (0, import_node_os13.homedir)();
55028
55099
  return [
55029
- { runtime: "claude", dir: (0, import_node_path17.join)(home, ".claude") },
55030
- { runtime: "codex", dir: (0, import_node_path17.join)(home, ".codex") },
55031
- { runtime: "opencode", dir: (0, import_node_path17.join)(home, ".opencode") }
55100
+ { runtime: "claude", dir: (0, import_node_path18.join)(home, ".claude") },
55101
+ { runtime: "codex", dir: (0, import_node_path18.join)(home, ".codex") },
55102
+ { runtime: "opencode", dir: (0, import_node_path18.join)(home, ".opencode") }
55032
55103
  ];
55033
55104
  }
55034
55105
  function skillVersion(skillMdPath) {
55035
55106
  try {
55036
- const text = (0, import_node_fs19.readFileSync)(skillMdPath, "utf8");
55107
+ const text = (0, import_node_fs20.readFileSync)(skillMdPath, "utf8");
55037
55108
  const m = /^---\r?\n([\s\S]*?)\r?\n---/.exec(text);
55038
55109
  if (!m || m[1] === void 0) return null;
55039
55110
  const fm = (0, import_yaml5.parse)(m[1]);
@@ -55073,21 +55144,21 @@ function decideAction(installed, bundled) {
55073
55144
  function bundledSkills(root) {
55074
55145
  let entries = [];
55075
55146
  try {
55076
- entries = selectShippedSkillNames((0, import_node_fs19.readdirSync)(root));
55147
+ entries = selectShippedSkillNames((0, import_node_fs20.readdirSync)(root));
55077
55148
  } catch {
55078
55149
  return [];
55079
55150
  }
55080
55151
  const out = [];
55081
55152
  for (const name of entries) {
55082
- const dir = (0, import_node_path17.join)(root, name);
55153
+ const dir = (0, import_node_path18.join)(root, name);
55083
55154
  let isDir = false;
55084
55155
  try {
55085
- isDir = (0, import_node_fs19.statSync)(dir).isDirectory();
55156
+ isDir = (0, import_node_fs20.statSync)(dir).isDirectory();
55086
55157
  } catch {
55087
55158
  isDir = false;
55088
55159
  }
55089
55160
  if (!isDir) continue;
55090
- const v = skillVersion((0, import_node_path17.join)(dir, "SKILL.md"));
55161
+ const v = skillVersion((0, import_node_path18.join)(dir, "SKILL.md"));
55091
55162
  if (!v) continue;
55092
55163
  out.push({ name, dir, version: v });
55093
55164
  }
@@ -55100,17 +55171,17 @@ function syncSkills() {
55100
55171
  const skills = bundledSkills(root);
55101
55172
  if (!skills.length) return results;
55102
55173
  for (const { runtime, dir: cfg } of targetConfigDirs()) {
55103
- if (!(0, import_node_fs19.existsSync)(cfg)) continue;
55104
- const skillsDir = (0, import_node_path17.join)(cfg, "skills");
55174
+ if (!(0, import_node_fs20.existsSync)(cfg)) continue;
55175
+ const skillsDir = (0, import_node_path18.join)(cfg, "skills");
55105
55176
  for (const s of skills) {
55106
- const dest = (0, import_node_path17.join)(skillsDir, s.name);
55107
- const installedMd = (0, import_node_path17.join)(dest, "SKILL.md");
55108
- const installed = (0, import_node_fs19.existsSync)(installedMd) ? skillVersion(installedMd) : null;
55177
+ const dest = (0, import_node_path18.join)(skillsDir, s.name);
55178
+ const installedMd = (0, import_node_path18.join)(dest, "SKILL.md");
55179
+ const installed = (0, import_node_fs20.existsSync)(installedMd) ? skillVersion(installedMd) : null;
55109
55180
  const action = decideAction(installed, s.version);
55110
55181
  if (action === "installed" || action === "updated") {
55111
55182
  try {
55112
- if (action === "updated") (0, import_node_fs19.rmSync)(dest, { recursive: true, force: true });
55113
- (0, import_node_fs19.cpSync)(s.dir, dest, { recursive: true });
55183
+ if (action === "updated") (0, import_node_fs20.rmSync)(dest, { recursive: true, force: true });
55184
+ (0, import_node_fs20.cpSync)(s.dir, dest, { recursive: true });
55114
55185
  results.push({ runtime, skill: s.name, action, from: installed, to: s.version });
55115
55186
  } catch {
55116
55187
  }
@@ -55123,9 +55194,9 @@ function syncSkills() {
55123
55194
  }
55124
55195
 
55125
55196
  // watch.ts
55126
- var import_node_os13 = require("node:os");
55127
- var import_node_path19 = require("node:path");
55128
- var import_node_fs20 = require("node:fs");
55197
+ var import_node_os14 = require("node:os");
55198
+ var import_node_path20 = require("node:path");
55199
+ var import_node_fs21 = require("node:fs");
55129
55200
 
55130
55201
  // node_modules/chokidar/esm/index.js
55131
55202
  var import_fs2 = require("fs");
@@ -55136,7 +55207,7 @@ var sysPath2 = __toESM(require("path"), 1);
55136
55207
  // node_modules/readdirp/esm/index.js
55137
55208
  var import_promises2 = require("node:fs/promises");
55138
55209
  var import_node_stream2 = require("node:stream");
55139
- var import_node_path18 = require("node:path");
55210
+ var import_node_path19 = require("node:path");
55140
55211
  var EntryTypes = {
55141
55212
  FILE_TYPE: "files",
55142
55213
  DIR_TYPE: "directories",
@@ -55211,7 +55282,7 @@ var ReaddirpStream = class extends import_node_stream2.Readable {
55211
55282
  this._wantsDir = type ? DIR_TYPES.has(type) : false;
55212
55283
  this._wantsFile = type ? FILE_TYPES.has(type) : false;
55213
55284
  this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
55214
- this._root = (0, import_node_path18.resolve)(root);
55285
+ this._root = (0, import_node_path19.resolve)(root);
55215
55286
  this._isDirent = !opts.alwaysStat;
55216
55287
  this._statsProp = this._isDirent ? "dirent" : "stats";
55217
55288
  this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
@@ -55282,8 +55353,8 @@ var ReaddirpStream = class extends import_node_stream2.Readable {
55282
55353
  let entry2;
55283
55354
  const basename5 = this._isDirent ? dirent.name : dirent;
55284
55355
  try {
55285
- const fullPath = (0, import_node_path18.resolve)((0, import_node_path18.join)(path, basename5));
55286
- entry2 = { path: (0, import_node_path18.relative)(this._root, fullPath), fullPath, basename: basename5 };
55356
+ const fullPath = (0, import_node_path19.resolve)((0, import_node_path19.join)(path, basename5));
55357
+ entry2 = { path: (0, import_node_path19.relative)(this._root, fullPath), fullPath, basename: basename5 };
55287
55358
  entry2[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
55288
55359
  } catch (err) {
55289
55360
  this._onError(err);
@@ -55317,7 +55388,7 @@ var ReaddirpStream = class extends import_node_stream2.Readable {
55317
55388
  }
55318
55389
  if (entryRealPathStats.isDirectory()) {
55319
55390
  const len = entryRealPath.length;
55320
- if (full.startsWith(entryRealPath) && full.substr(len, 1) === import_node_path18.sep) {
55391
+ if (full.startsWith(entryRealPath) && full.substr(len, 1) === import_node_path19.sep) {
55321
55392
  const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
55322
55393
  recursiveError.code = RECURSIVE_ERROR_CODE;
55323
55394
  return this._onError(recursiveError);
@@ -55981,7 +56052,7 @@ var NodeFsHandler = class {
55981
56052
  this._addToNodeFs(path, initialAdd, wh, depth + 1);
55982
56053
  }
55983
56054
  }).on(EV.ERROR, this._boundHandleError);
55984
- return new Promise((resolve5, reject) => {
56055
+ return new Promise((resolve6, reject) => {
55985
56056
  if (!stream)
55986
56057
  return reject();
55987
56058
  stream.once(STR_END, () => {
@@ -55990,7 +56061,7 @@ var NodeFsHandler = class {
55990
56061
  return;
55991
56062
  }
55992
56063
  const wasThrottled = throttler ? throttler.clear() : false;
55993
- resolve5(void 0);
56064
+ resolve6(void 0);
55994
56065
  previous.getChildren().filter((item) => {
55995
56066
  return item !== directory && !current.has(item);
55996
56067
  }).forEach((item) => {
@@ -56825,33 +56896,33 @@ function appIdFromLogPath(path) {
56825
56896
  return i >= 0 && parts[i + 1] ? parts[i + 1] : null;
56826
56897
  }
56827
56898
  function samePath(a, b) {
56828
- const ra = (0, import_node_path19.resolve)(a);
56829
- const rb = (0, import_node_path19.resolve)(b);
56899
+ const ra = (0, import_node_path20.resolve)(a);
56900
+ const rb = (0, import_node_path20.resolve)(b);
56830
56901
  return process.platform === "win32" ? ra.toLowerCase() === rb.toLowerCase() : ra === rb;
56831
56902
  }
56832
56903
  function underDir(path, dir) {
56833
- const rp = (0, import_node_path19.resolve)(path);
56834
- const rd = (0, import_node_path19.resolve)(dir);
56904
+ const rp = (0, import_node_path20.resolve)(path);
56905
+ const rd = (0, import_node_path20.resolve)(dir);
56835
56906
  const [p, d] = process.platform === "win32" ? [rp.toLowerCase(), rd.toLowerCase()] : [rp, rd];
56836
- return p === d || p.startsWith(d + import_node_path19.sep);
56907
+ return p === d || p.startsWith(d + import_node_path20.sep);
56837
56908
  }
56838
56909
  function startWatcher() {
56839
- const awareDir = process.env.AWARE_HOME ?? (0, import_node_path19.join)((0, import_node_os13.homedir)(), ".aware");
56840
- const credentialsDir = (0, import_node_path19.join)(awareDir, "credentials");
56841
- if (!(0, import_node_fs20.existsSync)(credentialsDir)) {
56910
+ const awareDir = process.env.AWARE_HOME ?? (0, import_node_path20.join)((0, import_node_os14.homedir)(), ".aware");
56911
+ const credentialsDir = (0, import_node_path20.join)(awareDir, "credentials");
56912
+ if (!(0, import_node_fs21.existsSync)(credentialsDir)) {
56842
56913
  try {
56843
- (0, import_node_fs20.mkdirSync)(credentialsDir, { recursive: true });
56914
+ (0, import_node_fs21.mkdirSync)(credentialsDir, { recursive: true });
56844
56915
  } catch {
56845
56916
  }
56846
56917
  }
56847
- if (!(0, import_node_fs20.existsSync)(uiDir)) {
56918
+ if (!(0, import_node_fs21.existsSync)(uiDir)) {
56848
56919
  try {
56849
- (0, import_node_fs20.mkdirSync)(uiDir, { recursive: true });
56920
+ (0, import_node_fs21.mkdirSync)(uiDir, { recursive: true });
56850
56921
  } catch {
56851
56922
  }
56852
56923
  }
56853
- const targets = ["apps", "logs", "credentials"].map((d) => (0, import_node_path19.join)(awareDir, d)).filter((p) => (0, import_node_fs20.existsSync)(p));
56854
- if ((0, import_node_fs20.existsSync)(uiDir)) targets.push(uiDir);
56924
+ const targets = ["apps", "logs", "credentials"].map((d) => (0, import_node_path20.join)(awareDir, d)).filter((p) => (0, import_node_fs21.existsSync)(p));
56925
+ if ((0, import_node_fs21.existsSync)(uiDir)) targets.push(uiDir);
56855
56926
  if (targets.length === 0) {
56856
56927
  return null;
56857
56928
  }
@@ -56881,11 +56952,11 @@ function startWatcher() {
56881
56952
  const isCredential = path.split(/[\\/]/).includes("credentials");
56882
56953
  const kind = isCredential ? "credential" : path.endsWith(".jsonl") ? "trace" : path.endsWith(".lock") ? "lock" : path.endsWith(".flo") || path.endsWith(".app") ? "source" : "file";
56883
56954
  broadcast({ type: "fs-change", kind, event, path });
56884
- if (kind === "trace" && event !== "unlink" && (0, import_node_fs20.existsSync)(path)) {
56955
+ if (kind === "trace" && event !== "unlink" && (0, import_node_fs21.existsSync)(path)) {
56885
56956
  const id = appIdFromLogPath(path);
56886
56957
  if (!id) return;
56887
56958
  try {
56888
- broadcast({ type: "trace-file", id, runId: path.split(import_node_path19.sep).pop()?.replace(/\.jsonl$/, "") ?? null, events: parseTrace((0, import_node_fs20.readFileSync)(path, "utf8")) });
56959
+ broadcast({ type: "trace-file", id, runId: path.split(import_node_path20.sep).pop()?.replace(/\.jsonl$/, "") ?? null, events: parseTrace((0, import_node_fs21.readFileSync)(path, "utf8")) });
56889
56960
  } catch {
56890
56961
  }
56891
56962
  }
@@ -56894,10 +56965,10 @@ function startWatcher() {
56894
56965
  }
56895
56966
 
56896
56967
  // index.ts
56897
- var __dirname4 = (0, import_node_path20.dirname)((0, import_node_url3.fileURLToPath)(__import_meta_url));
56898
- var WEB_ROOT = [(0, import_node_path20.join)(__dirname4, "web"), (0, import_node_path20.join)((0, import_node_path20.dirname)(process.execPath), "web"), (0, import_node_path20.join)(__dirname4, "..", "web")].find(
56899
- (p) => (0, import_node_fs21.existsSync)(p)
56900
- ) ?? (0, import_node_path20.join)(__dirname4, "..", "web");
56968
+ var __dirname4 = (0, import_node_path21.dirname)((0, import_node_url3.fileURLToPath)(__import_meta_url));
56969
+ var WEB_ROOT = [(0, import_node_path21.join)(__dirname4, "web"), (0, import_node_path21.join)((0, import_node_path21.dirname)(process.execPath), "web"), (0, import_node_path21.join)(__dirname4, "..", "web")].find(
56970
+ (p) => (0, import_node_fs22.existsSync)(p)
56971
+ ) ?? (0, import_node_path21.join)(__dirname4, "..", "web");
56901
56972
  var PORT2 = Number(process.env.PORT ?? 4317);
56902
56973
  var HOST = "127.0.0.1";
56903
56974
  var crashHandlersInstalled = false;
@@ -56913,7 +56984,7 @@ function installCrashHandlers() {
56913
56984
  ${stack}
56914
56985
  `;
56915
56986
  try {
56916
- (0, import_node_fs21.appendFileSync)(logFilePath(), line);
56987
+ (0, import_node_fs22.appendFileSync)(logFilePath(), line);
56917
56988
  } catch {
56918
56989
  }
56919
56990
  if (process.stderr.isTTY) process.stderr.write(line);
@@ -56956,7 +57027,7 @@ async function startServer() {
56956
57027
  };
56957
57028
  function installAwareGlobal(spec, onLine = () => {
56958
57029
  }) {
56959
- return new Promise((resolve5, reject) => {
57030
+ return new Promise((resolve6, reject) => {
56960
57031
  const child = (0, import_node_child_process6.spawn)("npm", ["i", "-g", `@aware-aeco/cli@${spec}`], { shell: isWin3, windowsHide: true });
56961
57032
  let stderrTail = "";
56962
57033
  let combinedTail = "";
@@ -56973,7 +57044,7 @@ async function startServer() {
56973
57044
  onLine(s.trimEnd());
56974
57045
  });
56975
57046
  child.on("error", (e) => reject(e));
56976
- child.on("close", (code) => code === 0 ? resolve5() : reject(new Error(`npm exited ${code}: ${stderrTail || combinedTail}`)));
57047
+ child.on("close", (code) => code === 0 ? resolve6() : reject(new Error(`npm exited ${code}: ${stderrTail || combinedTail}`)));
56977
57048
  });
56978
57049
  }
56979
57050
  const bootstrapDeps = {
@@ -57258,13 +57329,13 @@ async function startServer() {
57258
57329
  }
57259
57330
  const inputs = appData.inputs.map((i) => ({ name: i.name, type: i.type }));
57260
57331
  const baked = bakeFloSource(appData.source.text, inputs);
57261
- const tmpRoot = (0, import_node_fs21.mkdtempSync)((0, import_node_path20.join)((0, import_node_os14.tmpdir)(), "floless-bake-"));
57262
- const backupDir = (0, import_node_path20.join)(tmpRoot, `${id}-backup`);
57263
- const bakeDir = (0, import_node_path20.join)(tmpRoot, id);
57264
- (0, import_node_fs21.cpSync)(appDir(id), backupDir, { recursive: true });
57265
- (0, import_node_fs21.cpSync)(appDir(id), bakeDir, { recursive: true });
57332
+ const tmpRoot = (0, import_node_fs22.mkdtempSync)((0, import_node_path21.join)((0, import_node_os15.tmpdir)(), "floless-bake-"));
57333
+ const backupDir = (0, import_node_path21.join)(tmpRoot, `${id}-backup`);
57334
+ const bakeDir = (0, import_node_path21.join)(tmpRoot, id);
57335
+ (0, import_node_fs22.cpSync)(appDir(id), backupDir, { recursive: true });
57336
+ (0, import_node_fs22.cpSync)(appDir(id), bakeDir, { recursive: true });
57266
57337
  const floName = appData.source.path.split(/[\\/]/).pop();
57267
- (0, import_node_fs21.writeFileSync)((0, import_node_path20.join)(bakeDir, floName), baked);
57338
+ (0, import_node_fs22.writeFileSync)((0, import_node_path21.join)(bakeDir, floName), baked);
57268
57339
  let appInstalled = true;
57269
57340
  try {
57270
57341
  await aware.uninstall(id);
@@ -57286,17 +57357,17 @@ async function startServer() {
57286
57357
  throw installErr;
57287
57358
  }
57288
57359
  try {
57289
- await aware.compile((0, import_node_path20.join)(appDir(id), floName));
57360
+ await aware.compile((0, import_node_path21.join)(appDir(id), floName));
57290
57361
  } catch (compileErr) {
57291
57362
  app.log.warn({ id, compileErr: String(compileErr) }, "bake: post-install recompile failed (app baked but may need a manual Compile)");
57292
57363
  }
57293
57364
  broadcast({ type: "baked", id });
57294
57365
  return { ok: true, id, agent: id, inputs };
57295
57366
  } finally {
57296
- if (appInstalled) (0, import_node_fs21.rmSync)(tmpRoot, { recursive: true, force: true });
57367
+ if (appInstalled) (0, import_node_fs22.rmSync)(tmpRoot, { recursive: true, force: true });
57297
57368
  }
57298
57369
  });
57299
- const graftAgentsDir = () => (0, import_node_path20.join)((0, import_node_os14.homedir)(), ".aware", "agents");
57370
+ const graftAgentsDir = () => (0, import_node_path21.join)((0, import_node_os15.homedir)(), ".aware", "agents");
57300
57371
  app.post("/api/graft/match", async (req, reply) => {
57301
57372
  const { glob } = req.body ?? {};
57302
57373
  if (!glob) return reply.status(400).send({ ok: false, error: "glob required" });
@@ -57313,7 +57384,7 @@ async function startServer() {
57313
57384
  if (!sourceKind || !sourceRef) {
57314
57385
  return reply.status(400).send({ ok: false, error: "sourceKind and sourceRef required" });
57315
57386
  }
57316
- const tempHome = (0, import_node_fs21.mkdtempSync)((0, import_node_path20.join)((0, import_node_os14.tmpdir)(), "floless-graft-"));
57387
+ const tempHome = (0, import_node_fs22.mkdtempSync)((0, import_node_path21.join)((0, import_node_os15.tmpdir)(), "floless-graft-"));
57317
57388
  let result;
57318
57389
  try {
57319
57390
  result = await aware.build({
@@ -57326,19 +57397,19 @@ async function startServer() {
57326
57397
  awareHome: tempHome
57327
57398
  });
57328
57399
  } catch (err) {
57329
- (0, import_node_fs21.rmSync)(tempHome, { recursive: true, force: true });
57400
+ (0, import_node_fs22.rmSync)(tempHome, { recursive: true, force: true });
57330
57401
  const msg = err instanceof AwareError ? err.message : String(err?.message ?? err);
57331
57402
  return reply.status(422).send({ ok: false, error: msg });
57332
57403
  }
57333
57404
  const manifest = readStagedManifest(result.agentDir);
57334
57405
  if (!manifest) {
57335
- (0, import_node_fs21.rmSync)(tempHome, { recursive: true, force: true });
57406
+ (0, import_node_fs22.rmSync)(tempHome, { recursive: true, force: true });
57336
57407
  return reply.status(502).send({ ok: false, error: `build produced output at ${result.agentDir} but no manifest.yaml` });
57337
57408
  }
57338
- const token = (0, import_node_crypto6.randomUUID)();
57409
+ const token = (0, import_node_crypto7.randomUUID)();
57339
57410
  registerStage(token, tempHome, result.agentId);
57340
57411
  const preview = buildPreview(manifest, sourceKind, sourceRef, token);
57341
- if ((0, import_node_fs21.existsSync)((0, import_node_path20.join)(graftAgentsDir(), result.agentId))) {
57412
+ if ((0, import_node_fs22.existsSync)((0, import_node_path21.join)(graftAgentsDir(), result.agentId))) {
57342
57413
  preview.warnings.unshift(`An agent named "${result.agentId}" is already installed \u2014 creating it will overwrite it.`);
57343
57414
  }
57344
57415
  return { ok: true, preview };
@@ -57357,7 +57428,7 @@ async function startServer() {
57357
57428
  registerStage(stagedRef, stage.tempDir, stage.agentId);
57358
57429
  return reply.status(409).send({ ok: false, error: err.message, agentId: stage.agentId, collision: true });
57359
57430
  }
57360
- (0, import_node_fs21.rmSync)(stage.tempDir, { recursive: true, force: true });
57431
+ (0, import_node_fs22.rmSync)(stage.tempDir, { recursive: true, force: true });
57361
57432
  throw err;
57362
57433
  }
57363
57434
  broadcast({ type: "grafted", id: stage.agentId });
@@ -57567,11 +57638,11 @@ async function startServer() {
57567
57638
  app.get("/api/requests/:id/snapshot/:n", async (req, reply) => {
57568
57639
  const n = Number.parseInt(req.params.n, 10);
57569
57640
  const p = Number.isInteger(n) ? snapshotPathFor(req.params.id, n) : null;
57570
- if (!p || !(0, import_node_fs21.existsSync)(p)) return reply.status(404).send({ ok: false, error: "snapshot not found" });
57641
+ if (!p || !(0, import_node_fs22.existsSync)(p)) return reply.status(404).send({ ok: false, error: "snapshot not found" });
57571
57642
  const ext = p.split(".").pop().toLowerCase();
57572
57643
  reply.header("Content-Type", ext === "png" ? "image/png" : ext === "webp" ? "image/webp" : "image/jpeg");
57573
57644
  reply.header("Cache-Control", "no-store");
57574
- return (0, import_node_fs21.readFileSync)(p);
57645
+ return (0, import_node_fs22.readFileSync)(p);
57575
57646
  });
57576
57647
  app.post(
57577
57648
  "/api/tweak",
@@ -57592,6 +57663,42 @@ async function startServer() {
57592
57663
  return { ok: true, request };
57593
57664
  }
57594
57665
  );
57666
+ const REBAKE_INSTRUCTION = "Re-read the attached drawing and re-bake the extracted values into this app's config.yaml (the literals the deterministic run uses), then `aware app compile` the app and tell me to approve the new lock. Do not change node logic \u2014 only the baked config values.";
57667
+ app.post(
57668
+ "/api/rebake",
57669
+ { bodyLimit: 25 * 1024 * 1024 },
57670
+ async (req, reply) => {
57671
+ const { appId, inputName, instruction, snapshots } = req.body ?? {};
57672
+ if (!appId) return reply.status(400).send({ ok: false, error: "appId required" });
57673
+ let decoded;
57674
+ try {
57675
+ decoded = decodeSnapshots(snapshots);
57676
+ } catch (e) {
57677
+ return reply.status(400).send({ ok: false, error: e instanceof Error ? e.message : "bad snapshot" });
57678
+ }
57679
+ const request = addRequest(
57680
+ { type: "rebake", appId, ...inputName ? { inputName } : {}, instruction: instruction || REBAKE_INSTRUCTION },
57681
+ decoded
57682
+ );
57683
+ broadcast({ type: "request-added", request });
57684
+ return { ok: true, request };
57685
+ }
57686
+ );
57687
+ app.post(
57688
+ "/api/visual-input",
57689
+ { bodyLimit: 25 * 1024 * 1024 },
57690
+ async (req, reply) => {
57691
+ const { appId, dataUrl } = req.body ?? {};
57692
+ if (!appId || !dataUrl) return reply.status(400).send({ ok: false, error: "appId and dataUrl required" });
57693
+ try {
57694
+ const stored = storeVisualInput(appId, dataUrl);
57695
+ return { ok: true, path: stored.path, ext: stored.ext, bytes: stored.bytes };
57696
+ } catch (e) {
57697
+ if (e instanceof VisualInputError) return reply.status(400).send({ ok: false, error: e.message });
57698
+ throw e;
57699
+ }
57700
+ }
57701
+ );
57595
57702
  app.post("/api/use-template", async (req, reply) => {
57596
57703
  const { appId, templateId } = req.body ?? {};
57597
57704
  if (!appId || !templateId) return reply.status(400).send({ ok: false, error: "appId and templateId required" });
@@ -57636,10 +57743,10 @@ async function startServer() {
57636
57743
  const EXT_TRACE_MAX_BYTES = 5 * 1024 * 1024;
57637
57744
  function resolveExtensionSource(source, warn = () => {
57638
57745
  }) {
57639
- const sep3 = source.indexOf(":");
57640
- if (sep3 <= 0) return void 0;
57641
- const kind = source.slice(0, sep3);
57642
- const ref = source.slice(sep3 + 1);
57746
+ const sep4 = source.indexOf(":");
57747
+ if (sep4 <= 0) return void 0;
57748
+ const kind = source.slice(0, sep4);
57749
+ const ref = source.slice(sep4 + 1);
57643
57750
  if (!EXT_SOURCE_REF.test(ref)) return void 0;
57644
57751
  if (kind === "last-run-output") {
57645
57752
  const latest = readLatestTrace(ref, void 0, EXT_TRACE_MAX_BYTES);
@@ -57665,7 +57772,7 @@ async function startServer() {
57665
57772
  warn(`last-run-status:${ref} \u2014 trace exists but couldn't be parsed (corrupt/truncated)`);
57666
57773
  let finishedAt2 = null;
57667
57774
  try {
57668
- finishedAt2 = (0, import_node_fs21.statSync)(latest.path).mtime.toISOString();
57775
+ finishedAt2 = (0, import_node_fs22.statSync)(latest.path).mtime.toISOString();
57669
57776
  } catch {
57670
57777
  finishedAt2 = null;
57671
57778
  }
@@ -57675,7 +57782,7 @@ async function startServer() {
57675
57782
  let finishedAt = typeof runEnd?.ts === "string" ? runEnd.ts : null;
57676
57783
  if (!finishedAt) {
57677
57784
  try {
57678
- finishedAt = (0, import_node_fs21.statSync)(latest.path).mtime.toISOString();
57785
+ finishedAt = (0, import_node_fs22.statSync)(latest.path).mtime.toISOString();
57679
57786
  } catch {
57680
57787
  finishedAt = null;
57681
57788
  }
@@ -57828,11 +57935,11 @@ function unregisterProtocol() {
57828
57935
 
57829
57936
  // main.ts
57830
57937
  function promptYesNo2(question) {
57831
- return new Promise((resolve5) => {
57938
+ return new Promise((resolve6) => {
57832
57939
  const rl = (0, import_node_readline2.createInterface)({ input: process.stdin, output: process.stdout });
57833
57940
  rl.question(`${question} `, (answer) => {
57834
57941
  rl.close();
57835
- resolve5(/^y(es)?$/i.test((answer ?? "").trim()));
57942
+ resolve6(/^y(es)?$/i.test((answer ?? "").trim()));
57836
57943
  });
57837
57944
  });
57838
57945
  }