@flowrunner/cli 0.1.19-dev.2 → 0.1.19-dev.4

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.
Files changed (31) hide show
  1. package/ai-docs/instructions/service-code-format/02-zod-types.md +6 -5
  2. package/ai-docs/instructions/service-code-format/17-client-certificates.md +4 -5
  3. package/bin/banner.js +36 -0
  4. package/bin/flowrunner.js +24 -1
  5. package/dist/cli.js +260 -206
  6. package/dist/cli.js.map +4 -4
  7. package/dist/index.js +111 -91
  8. package/dist/index.js.map +3 -3
  9. package/dist/types/packages/cli/src/constants/testing.d.ts +13 -6
  10. package/dist/types/shared/src/constants/error-codes.d.ts +14 -0
  11. package/dist/types/shared/src/constants/flow-catalog.d.ts +54 -0
  12. package/dist/types/shared/src/constants/index.d.ts +1 -0
  13. package/dist/types/shared/src/errors/flow-catalog.d.ts +37 -0
  14. package/dist/types/shared/src/errors/index.d.ts +1 -0
  15. package/dist/types/shared/src/scheme/flow-catalog/analysis.d.ts +190 -0
  16. package/dist/types/shared/src/scheme/flow-catalog/index.d.ts +6 -0
  17. package/dist/types/shared/src/scheme/flow-catalog/pack.d.ts +144 -0
  18. package/dist/types/shared/src/scheme/flow-catalog/requests.d.ts +664 -0
  19. package/dist/types/shared/src/scheme/flow-catalog/summary.d.ts +69 -0
  20. package/dist/types/shared/src/scheme/flow-catalog/version.d.ts +132 -0
  21. package/dist/types/shared/src/scheme/flowrunner/java.dto.d.ts +76 -0
  22. package/dist/types/shared/src/scheme/index.d.ts +1 -0
  23. package/dist/types/shared/src/scheme/knowledge-base/dto.d.ts +12 -12
  24. package/dist/types/shared/src/scheme/properties/index.d.ts +1 -0
  25. package/dist/types/shared/src/scheme/properties/secret.d.ts +12 -0
  26. package/dist/types/shared/src/scheme/remote-mcp-server/dto.d.ts +0 -11
  27. package/dist/types/shared/src/scheme/shared-extensions/config.d.ts +20 -2
  28. package/dist/types/shared/src/scheme/shared-extensions/rest.d.ts +1 -0
  29. package/dist/types/shared/src/scheme/shared-extensions/usage-stats.d.ts +6 -6
  30. package/package.json +1 -4
  31. package/project-files/sandbox/nock-mock.js +61 -5
package/dist/cli.js CHANGED
@@ -8877,11 +8877,11 @@ var require_mime_types = __commonJS({
8877
8877
  }
8878
8878
  return exts[0];
8879
8879
  }
8880
- function lookup(path22) {
8881
- if (!path22 || typeof path22 !== "string") {
8880
+ function lookup(path23) {
8881
+ if (!path23 || typeof path23 !== "string") {
8882
8882
  return false;
8883
8883
  }
8884
- var extension2 = extname("x." + path22).toLowerCase().substr(1);
8884
+ var extension2 = extname("x." + path23).toLowerCase().substr(1);
8885
8885
  if (!extension2) {
8886
8886
  return false;
8887
8887
  }
@@ -10044,11 +10044,11 @@ var require_form_data = __commonJS({
10044
10044
  "use strict";
10045
10045
  var CombinedStream = require_combined_stream();
10046
10046
  var util = require("util");
10047
- var path22 = require("path");
10047
+ var path23 = require("path");
10048
10048
  var http2 = require("http");
10049
10049
  var https = require("https");
10050
10050
  var parseUrl = require("url").parse;
10051
- var fs19 = require("fs");
10051
+ var fs21 = require("fs");
10052
10052
  var crypto3 = require("crypto");
10053
10053
  var mime = require_mime_types();
10054
10054
  var asynckit = require_asynckit();
@@ -10118,7 +10118,7 @@ var require_form_data = __commonJS({
10118
10118
  if (value.end != null && value.end !== Infinity && value.start != null) {
10119
10119
  callback(null, value.end + 1 - (value.start ? value.start : 0));
10120
10120
  } else {
10121
- fs19.stat(value.path, function(err, stat) {
10121
+ fs21.stat(value.path, function(err, stat) {
10122
10122
  var fileSize;
10123
10123
  if (err) {
10124
10124
  callback(err);
@@ -10176,11 +10176,11 @@ var require_form_data = __commonJS({
10176
10176
  FormData2.prototype._getContentDisposition = function(value, options) {
10177
10177
  var filename, contentDisposition;
10178
10178
  if (typeof options.filepath === "string") {
10179
- filename = path22.normalize(options.filepath).replace(/\\/g, "/");
10179
+ filename = path23.normalize(options.filepath).replace(/\\/g, "/");
10180
10180
  } else if (options.filename || value && (value.name || value.path)) {
10181
- filename = path22.basename(options.filename || value && (value.name || value.path));
10181
+ filename = path23.basename(options.filename || value && (value.name || value.path));
10182
10182
  } else if (value && value.readable && hasOwn(value, "httpVersion")) {
10183
- filename = path22.basename(value.client._httpMessage.path || "");
10183
+ filename = path23.basename(value.client._httpMessage.path || "");
10184
10184
  }
10185
10185
  if (filename) {
10186
10186
  contentDisposition = 'filename="' + escapeHeaderParam(filename) + '"';
@@ -10431,15 +10431,15 @@ var require_utils = __commonJS({
10431
10431
  }
10432
10432
  return uriComponent;
10433
10433
  }
10434
- function encodePath(path22) {
10435
- return path22.split("/").map(ensureComponentEncoding).join("/");
10434
+ function encodePath(path23) {
10435
+ return path23.split("/").map(ensureComponentEncoding).join("/");
10436
10436
  }
10437
- function ensureEncoding(path22) {
10437
+ function ensureEncoding(path23) {
10438
10438
  try {
10439
- var url = new URL(path22);
10440
- return url.origin + encodePath(normalizeTrailingSlashInPath(path22, url)) + url.search;
10439
+ var url = new URL(path23);
10440
+ return url.origin + encodePath(normalizeTrailingSlashInPath(path23, url)) + url.search;
10441
10441
  } catch (_unused) {
10442
- return encodePath(path22);
10442
+ return encodePath(path23);
10443
10443
  }
10444
10444
  }
10445
10445
  function normalizeTrailingSlashInPath(originPath, _ref) {
@@ -10794,15 +10794,15 @@ var require_client_node = __commonJS({
10794
10794
  exports2.sendNodeAPIRequest = sendNodeAPIRequest;
10795
10795
  var _utils = require_utils();
10796
10796
  var _error = require_error();
10797
- function sendNodeAPIRequest(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10797
+ function sendNodeAPIRequest(path23, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
10798
10798
  return new Promise(function(resolve, reject) {
10799
- var u = require("url").parse(path22);
10799
+ var u = require("url").parse(path23);
10800
10800
  var form = (0, _utils.isFormData)(body) && body;
10801
10801
  var https = u.protocol === "https:";
10802
10802
  var options = {
10803
10803
  host: u.hostname,
10804
10804
  port: u.port || (https ? 443 : 80),
10805
- path: (0, _utils.normalizeTrailingSlashInPath)(path22, u) + (u.search || ""),
10805
+ path: (0, _utils.normalizeTrailingSlashInPath)(path23, u) + (u.search || ""),
10806
10806
  method,
10807
10807
  headers,
10808
10808
  timeout
@@ -11210,12 +11210,12 @@ var require_request = __commonJS({
11210
11210
  var Request = exports2.Request = /* @__PURE__ */ (function(_EventEmitter) {
11211
11211
  _inherits(Request2, _EventEmitter);
11212
11212
  var _super = _createSuper(Request2);
11213
- function Request2(path22, method, body) {
11213
+ function Request2(path23, method, body) {
11214
11214
  var _this;
11215
11215
  _classCallCheck(this, Request2);
11216
11216
  _this = _super.call(this);
11217
11217
  _this.method = method;
11218
- _this.path = (0, _utils.ensureEncoding)(path22);
11218
+ _this.path = (0, _utils.ensureEncoding)(path23);
11219
11219
  _this.body = body;
11220
11220
  _this.unwrap = true;
11221
11221
  _this.raw = false;
@@ -11444,10 +11444,10 @@ var require_request = __commonJS({
11444
11444
  value: function send(body) {
11445
11445
  var _this2 = this;
11446
11446
  this.emit(REQUEST_EVENT, this);
11447
- var path22 = this.path;
11447
+ var path23 = this.path;
11448
11448
  var queryString = qs.stringify(this.queryParams);
11449
11449
  if (queryString) {
11450
- path22 += "?" + queryString;
11450
+ path23 += "?" + queryString;
11451
11451
  }
11452
11452
  if (!(0, _utils.isFormData)(body) && (0, _utils.isWebFormData)(body)) {
11453
11453
  body = toRequestFormData(body);
@@ -11464,11 +11464,11 @@ var require_request = __commonJS({
11464
11464
  return _this2.unwrap ? res.body : res;
11465
11465
  };
11466
11466
  if (Request2.verbose) {
11467
- console.log(this.method.toUpperCase(), decodeURIComponent(path22), body, this.headers);
11467
+ console.log(this.method.toUpperCase(), decodeURIComponent(path23), body, this.headers);
11468
11468
  }
11469
11469
  var withCredentials = typeof this.withCredentials === "boolean" ? this.withCredentials : Request2.withCredentials;
11470
11470
  var syncError = new Error();
11471
- var request = Request2.send(path22, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11471
+ var request = Request2.send(path23, this.method.toUpperCase(), this.headers, body, this.encoding, this.timeout, withCredentials, this.tlsOptions).then(function(res) {
11472
11472
  return parseBody(res, _this2.raw);
11473
11473
  }).then(function(res) {
11474
11474
  return ensureRawBody(res, _this2.raw);
@@ -11577,14 +11577,14 @@ var require_client_browser = __commonJS({
11577
11577
  });
11578
11578
  exports2.sendXmlHttpRequest = sendXmlHttpRequest;
11579
11579
  var _request2 = require_request();
11580
- function sendXmlHttpRequest(path22, method, headers, body, encoding, timeout, withCredentials) {
11580
+ function sendXmlHttpRequest(path23, method, headers, body, encoding, timeout, withCredentials) {
11581
11581
  return new Promise(function sendRequest(resolve, reject) {
11582
11582
  var request = new _request2.Request.XMLHttpRequest();
11583
11583
  request.timeout = timeout;
11584
11584
  if (!encoding) {
11585
11585
  request.responseType = "arraybuffer";
11586
11586
  }
11587
- request.open(method.toUpperCase(), path22, true);
11587
+ request.open(method.toUpperCase(), path23, true);
11588
11588
  if (typeof withCredentials === "boolean") {
11589
11589
  request.withCredentials = withCredentials;
11590
11590
  }
@@ -11657,16 +11657,16 @@ var require_lib = __commonJS({
11657
11657
  }
11658
11658
  });
11659
11659
  _request.Request.XMLHttpRequest = typeof XMLHttpRequest !== "undefined" ? XMLHttpRequest : void 0;
11660
- _request.Request.send = function(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11660
+ _request.Request.send = function(path23, method, headers, body, encoding, timeout, withCredentials, tlsOptions) {
11661
11661
  var sender = typeof _request.Request.XMLHttpRequest !== "undefined" ? _clientBrowser.sendXmlHttpRequest : _clientNode.sendNodeAPIRequest;
11662
- return sender(path22, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11662
+ return sender(path23, method, headers, body, encoding, timeout, withCredentials, tlsOptions);
11663
11663
  };
11664
11664
  _request.Request.verbose = false;
11665
11665
  _request.Request.withCredentials = false;
11666
11666
  _request.Request.methods = ["get", "post", "put", "patch", "delete", "head", "options"];
11667
11667
  _request.Request.methods.forEach(function(method) {
11668
- _request.Request[method] = function(path22, body) {
11669
- return new _request.Request(path22, method, body);
11668
+ _request.Request[method] = function(path23, body) {
11669
+ return new _request.Request(path23, method, body);
11670
11670
  };
11671
11671
  });
11672
11672
  exports2 = module2.exports = _request.Request;
@@ -12007,25 +12007,25 @@ var require_utils2 = __commonJS({
12007
12007
  }
12008
12008
  mkdirSync(folder);
12009
12009
  };
12010
- Utils.prototype.writeFileTo = function(path22, content, overwrite, attr) {
12010
+ Utils.prototype.writeFileTo = function(path23, content, overwrite, attr) {
12011
12011
  const self = this;
12012
- if (self.fs.existsSync(path22)) {
12012
+ if (self.fs.existsSync(path23)) {
12013
12013
  if (!overwrite) return false;
12014
- var stat = self.fs.statSync(path22);
12014
+ var stat = self.fs.statSync(path23);
12015
12015
  if (stat.isDirectory()) {
12016
12016
  return false;
12017
12017
  }
12018
12018
  }
12019
- var folder = pth.dirname(path22);
12019
+ var folder = pth.dirname(path23);
12020
12020
  if (!self.fs.existsSync(folder)) {
12021
12021
  self.makeDir(folder);
12022
12022
  }
12023
12023
  var fd;
12024
12024
  try {
12025
- fd = self.fs.openSync(path22, "w", 438);
12025
+ fd = self.fs.openSync(path23, "w", 438);
12026
12026
  } catch (e) {
12027
- self.fs.chmodSync(path22, 438);
12028
- fd = self.fs.openSync(path22, "w", 438);
12027
+ self.fs.chmodSync(path23, 438);
12028
+ fd = self.fs.openSync(path23, "w", 438);
12029
12029
  }
12030
12030
  if (fd) {
12031
12031
  try {
@@ -12034,22 +12034,22 @@ var require_utils2 = __commonJS({
12034
12034
  self.fs.closeSync(fd);
12035
12035
  }
12036
12036
  }
12037
- self.fs.chmodSync(path22, attr || 438);
12037
+ self.fs.chmodSync(path23, attr || 438);
12038
12038
  return true;
12039
12039
  };
12040
- Utils.prototype.writeFileToAsync = function(path22, content, overwrite, attr, callback) {
12040
+ Utils.prototype.writeFileToAsync = function(path23, content, overwrite, attr, callback) {
12041
12041
  if (typeof attr === "function") {
12042
12042
  callback = attr;
12043
12043
  attr = void 0;
12044
12044
  }
12045
12045
  const self = this;
12046
- self.fs.exists(path22, function(exist) {
12046
+ self.fs.exists(path23, function(exist) {
12047
12047
  if (exist && !overwrite) return callback(false);
12048
- self.fs.stat(path22, function(err, stat) {
12048
+ self.fs.stat(path23, function(err, stat) {
12049
12049
  if (exist && stat && stat.isDirectory()) {
12050
12050
  return callback(false);
12051
12051
  }
12052
- var folder = pth.dirname(path22);
12052
+ var folder = pth.dirname(path23);
12053
12053
  self.fs.exists(folder, function(exists) {
12054
12054
  if (!exists) {
12055
12055
  try {
@@ -12062,16 +12062,16 @@ var require_utils2 = __commonJS({
12062
12062
  self.fs.write(fd, content, 0, content.length, 0, function(writeErr) {
12063
12063
  self.fs.close(fd, function() {
12064
12064
  if (writeErr) return callback(false);
12065
- self.fs.chmod(path22, attr || 438, function() {
12065
+ self.fs.chmod(path23, attr || 438, function() {
12066
12066
  callback(true);
12067
12067
  });
12068
12068
  });
12069
12069
  });
12070
12070
  };
12071
- self.fs.open(path22, "w", 438, function(err2, fd) {
12071
+ self.fs.open(path23, "w", 438, function(err2, fd) {
12072
12072
  if (err2) {
12073
- self.fs.chmod(path22, 438, function() {
12074
- self.fs.open(path22, "w", 438, function(retryErr, fd2) {
12073
+ self.fs.chmod(path23, 438, function() {
12074
+ self.fs.open(path23, "w", 438, function(retryErr, fd2) {
12075
12075
  if (retryErr || !fd2) return callback(false);
12076
12076
  writeToFd(fd2);
12077
12077
  });
@@ -12107,10 +12107,10 @@ var require_utils2 = __commonJS({
12107
12107
  if (stat.isSymbolicLink()) throw Errors.FILE_IN_THE_WAY(`"${cur}"`);
12108
12108
  }
12109
12109
  };
12110
- Utils.prototype.findFiles = function(path22) {
12110
+ Utils.prototype.findFiles = function(path23) {
12111
12111
  const self = this;
12112
12112
  const canLstat = typeof self.fs.lstatSync === "function";
12113
- const rootReal = self.fs.realpathSync(path22);
12113
+ const rootReal = self.fs.realpathSync(path23);
12114
12114
  function escapesRoot(p) {
12115
12115
  if (!canLstat) return false;
12116
12116
  if (!self.fs.lstatSync(p).isSymbolicLink()) return false;
@@ -12129,23 +12129,23 @@ var require_utils2 = __commonJS({
12129
12129
  }
12130
12130
  let files = [];
12131
12131
  self.fs.readdirSync(dir).forEach(function(file) {
12132
- const path23 = pth.join(dir, file);
12133
- if (escapesRoot(path23)) return;
12134
- const stat = self.fs.statSync(path23);
12135
- if (!pattern || pattern.test(path23)) {
12136
- files.push(pth.normalize(path23) + (stat.isDirectory() ? self.sep : ""));
12132
+ const path24 = pth.join(dir, file);
12133
+ if (escapesRoot(path24)) return;
12134
+ const stat = self.fs.statSync(path24);
12135
+ if (!pattern || pattern.test(path24)) {
12136
+ files.push(pth.normalize(path24) + (stat.isDirectory() ? self.sep : ""));
12137
12137
  }
12138
12138
  if (stat.isDirectory() && recursive) {
12139
- const realDir = self.fs.realpathSync(path23);
12139
+ const realDir = self.fs.realpathSync(path24);
12140
12140
  if (!visited.has(realDir)) {
12141
12141
  visited.add(realDir);
12142
- files = files.concat(findSync(path23, pattern, recursive, visited));
12142
+ files = files.concat(findSync(path24, pattern, recursive, visited));
12143
12143
  }
12144
12144
  }
12145
12145
  });
12146
12146
  return files;
12147
12147
  }
12148
- return findSync(path22, void 0, true, /* @__PURE__ */ new Set([rootReal]));
12148
+ return findSync(path23, void 0, true, /* @__PURE__ */ new Set([rootReal]));
12149
12149
  };
12150
12150
  Utils.prototype.findFilesAsync = function(dir, cb) {
12151
12151
  const self = this;
@@ -12242,14 +12242,14 @@ var require_utils2 = __commonJS({
12242
12242
  return "UNSUPPORTED (" + method + ")";
12243
12243
  }
12244
12244
  };
12245
- Utils.canonical = function(path22) {
12246
- if (!path22) return "";
12247
- const safeSuffix = pth.posix.normalize("/" + path22.split("\\").join("/"));
12245
+ Utils.canonical = function(path23) {
12246
+ if (!path23) return "";
12247
+ const safeSuffix = pth.posix.normalize("/" + path23.split("\\").join("/"));
12248
12248
  return pth.join(".", safeSuffix);
12249
12249
  };
12250
- Utils.zipnamefix = function(path22) {
12251
- if (!path22) return "";
12252
- const safeSuffix = pth.posix.normalize("/" + path22.split("\\").join("/"));
12250
+ Utils.zipnamefix = function(path23) {
12251
+ if (!path23) return "";
12252
+ const safeSuffix = pth.posix.normalize("/" + path23.split("\\").join("/"));
12253
12253
  return pth.posix.join(".", safeSuffix);
12254
12254
  };
12255
12255
  Utils.findLast = function(arr, callback) {
@@ -12266,9 +12266,9 @@ var require_utils2 = __commonJS({
12266
12266
  prefix = pth.resolve(pth.normalize(prefix));
12267
12267
  var parts = name.split("/");
12268
12268
  for (var i = 0, l = parts.length; i < l; i++) {
12269
- var path22 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
12270
- if (path22 === prefix || path22.startsWith(prefix + pth.sep)) {
12271
- return path22;
12269
+ var path23 = pth.normalize(pth.join(prefix, parts.slice(i, l).join(pth.sep)));
12270
+ if (path23 === prefix || path23.startsWith(prefix + pth.sep)) {
12271
+ return path23;
12272
12272
  }
12273
12273
  }
12274
12274
  return pth.normalize(pth.join(prefix, pth.basename(name)));
@@ -12318,8 +12318,8 @@ var require_utils2 = __commonJS({
12318
12318
  var require_fattr = __commonJS({
12319
12319
  "node_modules/adm-zip/util/fattr.js"(exports2, module2) {
12320
12320
  var pth = require("path");
12321
- module2.exports = function(path22, { fs: fs19 }) {
12322
- var _path = path22 || "", _obj = newAttr(), _stat = null;
12321
+ module2.exports = function(path23, { fs: fs21 }) {
12322
+ var _path = path23 || "", _obj = newAttr(), _stat = null;
12323
12323
  function newAttr() {
12324
12324
  return {
12325
12325
  directory: false,
@@ -12330,8 +12330,8 @@ var require_fattr = __commonJS({
12330
12330
  atime: 0
12331
12331
  };
12332
12332
  }
12333
- if (_path && fs19.existsSync(_path)) {
12334
- _stat = fs19.statSync(_path);
12333
+ if (_path && fs21.existsSync(_path)) {
12334
+ _stat = fs21.statSync(_path);
12335
12335
  _obj.directory = _stat.isDirectory();
12336
12336
  _obj.mtime = _stat.mtime;
12337
12337
  _obj.atime = _stat.atime;
@@ -14503,12 +14503,32 @@ var require_adm_zip = __commonJS({
14503
14503
  }
14504
14504
  });
14505
14505
 
14506
+ // bin/banner.js
14507
+ var require_banner = __commonJS({
14508
+ "bin/banner.js"(exports2, module2) {
14509
+ "use strict";
14510
+ var os = require("os");
14511
+ var path23 = require("path");
14512
+ function shortPath(target, home) {
14513
+ return target === home || target.startsWith(home + path23.sep) ? "~" + target.slice(home.length) : target;
14514
+ }
14515
+ function versionBanner2(cli, home = os.homedir()) {
14516
+ const lines = [`FlowRunner CLI ${cli.version} \u2014 ${shortPath(cli.root, home)}`];
14517
+ if (cli.launcher) {
14518
+ lines.push(` this project's copy, started by ${cli.launcher.version} \u2014 ${shortPath(cli.launcher.root, home)}`);
14519
+ }
14520
+ return lines;
14521
+ }
14522
+ module2.exports = { versionBanner: versionBanner2 };
14523
+ }
14524
+ });
14525
+
14506
14526
  // package.json
14507
14527
  var require_package = __commonJS({
14508
14528
  "package.json"(exports2, module2) {
14509
14529
  module2.exports = {
14510
14530
  name: "@flowrunner/cli",
14511
- version: "0.1.19-dev.2",
14531
+ version: "0.1.19-dev.4",
14512
14532
  publishConfig: {
14513
14533
  access: "public"
14514
14534
  },
@@ -14543,7 +14563,6 @@ var require_package = __commonJS({
14543
14563
  dependencies: {
14544
14564
  "@types/node": "^20.0.0",
14545
14565
  "adm-zip": "^0.6.1",
14546
- archiver: "^7.0.0",
14547
14566
  commander: "^12.0.0",
14548
14567
  zod: "^4.6.2"
14549
14568
  },
@@ -14551,10 +14570,8 @@ var require_package = __commonJS({
14551
14570
  "@asteasolutions/zod-to-openapi": "^8.4.0",
14552
14571
  "@flowrunner/flow-extension-runner": "*",
14553
14572
  "@types/adm-zip": "^0.5.7",
14554
- "@types/archiver": "^6.0.0",
14555
14573
  esbuild: "^0.28.2",
14556
14574
  nock: "^14.0.17",
14557
- "query-string": "^7.1.3",
14558
14575
  "tsconfig-paths": "^4.2.0",
14559
14576
  tsx: "^4.0.0",
14560
14577
  typescript: "^5.4.0"
@@ -14624,8 +14641,10 @@ var TESTING_FILES = [
14624
14641
  ];
14625
14642
  var TEST_DEV_DEPENDENCIES = {
14626
14643
  jest: "^30.0.0",
14627
- nock: "^14.0.0",
14628
- "query-string": "^7.1.3"
14644
+ nock: "^14.0.0"
14645
+ };
14646
+ var TEST_OVERRIDES = {
14647
+ glob: "^13.0.7"
14629
14648
  };
14630
14649
  var TEST_SCRIPTS = {
14631
14650
  test: "jest",
@@ -15268,6 +15287,10 @@ function sayError(text2) {
15268
15287
  console.error(text2);
15269
15288
  record(text2);
15270
15289
  }
15290
+ function sayStatus(text2) {
15291
+ console.error(text2);
15292
+ record(text2);
15293
+ }
15271
15294
  function sayWarning(text2) {
15272
15295
  console.warn(text2);
15273
15296
  record(text2);
@@ -15502,7 +15525,7 @@ async function downloadRemoteService(credentials, serviceId) {
15502
15525
  }
15503
15526
 
15504
15527
  // src/operations/deploy/index.ts
15505
- var import_fs11 = __toESM(require("fs"));
15528
+ var import_fs12 = __toESM(require("fs"));
15506
15529
  var import_path16 = __toESM(require("path"));
15507
15530
 
15508
15531
  // src/operations/deploy/discover-services.ts
@@ -16338,31 +16361,31 @@ var SUPPORTED_TYPES = /* @__PURE__ */ new Set([
16338
16361
  ]);
16339
16362
  var SUPPORTED_SPELLING = "z.string(), z.number(), z.bigint(), z.boolean(), z.date(), z.enum([\u2026]), z.literal(\u2026), z.object({ \u2026 }), z.array(\u2026), z.record(\u2026), z.union([\u2026]), z.null(), z.any(), z.unknown()";
16340
16363
  var MODIFIER_SPELLING = ".optional(), .nullable(), .nullish(), .default(v), .prefault(v), .readonly(), .nonoptional(), .pipe(\u2026)/.transform(\u2026) and z.lazy(\u2026)";
16341
- function subjectOf(source, path22) {
16364
+ function subjectOf(source, path23) {
16342
16365
  const kind = source.kind ?? "extension";
16343
16366
  const subject = source.itemId ? `${kind} "${source.itemId}": ` : "";
16344
- return `${subject}\`${path22}\``;
16367
+ return `${subject}\`${path23}\``;
16345
16368
  }
16346
- function refuse(message, source, path22, received) {
16369
+ function refuse(message, source, path23, received) {
16347
16370
  throw new InvalidSchemaError(
16348
16371
  `[flow-extension:${source.serviceId}] ${message}`,
16349
- { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path22, received }
16372
+ { serviceId: source.serviceId, kind: source.kind ?? "extension", itemId: source.itemId, slot: source.slot, path: path23, received }
16350
16373
  );
16351
16374
  }
16352
- function refuseCatch(source, path22) {
16375
+ function refuseCatch(source, path23) {
16353
16376
  refuse(
16354
- `${subjectOf(source, path22)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
16377
+ `${subjectOf(source, path23)} uses \`.catch(\u2026)\`, which a parameter may not: it replaces an invalid value with the fallback instead of reporting it, and drops the field out of type coercion. Use \`.default(v)\` \u2014 same fallback when the value is absent, and a supplied-but-invalid one still fails.`,
16355
16378
  source,
16356
- path22,
16379
+ path23,
16357
16380
  "catch"
16358
16381
  );
16359
16382
  }
16360
- function refuseType(source, path22, type) {
16383
+ function refuseType(source, path23, type) {
16361
16384
  const received = type ? `z.${type}()` : "a value that is not a zod schema";
16362
16385
  refuse(
16363
- `${subjectOf(source, path22)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
16386
+ `${subjectOf(source, path23)} declares ${received}, which the runtime cannot publish as a parameter \u2014 it has no widget, no published type and no coercion for it. Supported: ${SUPPORTED_SPELLING}; each may carry ${MODIFIER_SPELLING}.`,
16364
16387
  source,
16365
- path22,
16388
+ path23,
16366
16389
  type ?? "unknown"
16367
16390
  );
16368
16391
  }
@@ -16378,7 +16401,7 @@ function isLooseObject(schema) {
16378
16401
  function isDynamicPropsSlot(source, topLevel) {
16379
16402
  return topLevel && source.kind === "action" && source.slot === "params";
16380
16403
  }
16381
- function assertDynamicProps(schema, name, siblings, source, path22) {
16404
+ function assertDynamicProps(schema, name, siblings, source, path23) {
16382
16405
  const ins = inspect(schema);
16383
16406
  const spec = ins.meta.frDynamicProps;
16384
16407
  if (!spec) {
@@ -16389,49 +16412,49 @@ function assertDynamicProps(schema, name, siblings, source, path22) {
16389
16412
  }
16390
16413
  if (typeof spec.execute !== "function") {
16391
16414
  refuse(
16392
- `${subjectOf(source, path22)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
16415
+ `${subjectOf(source, path23)}: \`.dynamicProps()\` needs an \`execute\` function that returns the loaded fields.`,
16393
16416
  source,
16394
- path22,
16417
+ path23,
16395
16418
  typeof spec.execute
16396
16419
  );
16397
16420
  }
16398
16421
  if (spec.dependsOn !== void 0 && (!Array.isArray(spec.dependsOn) || spec.dependsOn.some((item) => typeof item !== "string"))) {
16399
16422
  refuse(
16400
- `${subjectOf(source, path22)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
16423
+ `${subjectOf(source, path23)}: \`.dynamicProps()\` \`dependsOn\` must be an array of param names.`,
16401
16424
  source,
16402
- path22,
16425
+ path23,
16403
16426
  "dependsOn"
16404
16427
  );
16405
16428
  }
16406
16429
  for (const dependency of spec.dependsOn ?? []) {
16407
16430
  if (dependency === name || !siblings.includes(dependency)) {
16408
16431
  refuse(
16409
- `${subjectOf(source, path22)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
16432
+ `${subjectOf(source, path23)}: \`.dynamicProps()\` depends on "${dependency}", which is not another param of this action. Name its sibling params: ${siblings.filter((sibling) => sibling !== name).join(", ") || "none"}.`,
16410
16433
  source,
16411
- path22,
16434
+ path23,
16412
16435
  dependency
16413
16436
  );
16414
16437
  }
16415
16438
  }
16416
16439
  if (ins.meta.frDictionary) {
16417
16440
  refuse(
16418
- `${subjectOf(source, path22)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
16441
+ `${subjectOf(source, path23)} declares both \`.dynamicProps()\` and \`.dictionary()\`. A dictionary offers values for one field; dynamic props load the fields inside an object \u2014 use one or the other.`,
16419
16442
  source,
16420
- path22,
16443
+ path23,
16421
16444
  "dictionary"
16422
16445
  );
16423
16446
  }
16424
16447
  const element = ins.resolvedType === "array" ? ins.core?._zod?.def?.element : void 0;
16425
16448
  if (!isLooseObject(schema) && !isLooseObject(element)) {
16426
16449
  refuse(
16427
- `${subjectOf(source, path22)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
16450
+ `${subjectOf(source, path23)}: \`.dynamicProps()\` needs a loose object \u2014 the loaded fields are not declared, so a plain \`z.object()\` would strip them. ${DYNAMIC_PROPS_FIX}`,
16428
16451
  source,
16429
- path22,
16452
+ path23,
16430
16453
  ins.resolvedType ?? "unknown"
16431
16454
  );
16432
16455
  }
16433
16456
  }
16434
- function assertDictionaryBinding(schema, source, path22, scope2) {
16457
+ function assertDictionaryBinding(schema, source, path23, scope2) {
16435
16458
  const binding = inspect(schema).meta.frDictionary;
16436
16459
  if (!binding) {
16437
16460
  return;
@@ -16439,14 +16462,14 @@ function assertDictionaryBinding(schema, source, path22, scope2) {
16439
16462
  const { clash } = resolveDependsOn(binding, scope2);
16440
16463
  if (clash) {
16441
16464
  refuse(
16442
- `${subjectOf(source, path22)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
16465
+ `${subjectOf(source, path23)} uses dictionary "${binding.id}", whose criteria "${clash.key}" can come from ${clash.names.map((name) => `"${name}"`).join(" or ")} \u2014 and this field can see all of them, so the dictionary cannot tell which one is meant. Rename one of the params, or bind this field to a dictionary without that alias.`,
16443
16466
  source,
16444
- path22,
16467
+ path23,
16445
16468
  clash.names.join(", ")
16446
16469
  );
16447
16470
  }
16448
16471
  }
16449
- function assertDateString(schema, source, path22) {
16472
+ function assertDateString(schema, source, path23) {
16450
16473
  const ins = inspect(schema);
16451
16474
  const pattern = ins.meta.frDateFormat;
16452
16475
  const kind = dateStringKind(ins);
@@ -16454,9 +16477,9 @@ function assertDateString(schema, source, path22) {
16454
16477
  const format = ins.core?._zod?.def?.format;
16455
16478
  const zoned = ins.coreType === "string" && format === "datetime";
16456
16479
  refuse(
16457
- `${subjectOf(source, path22)} uses \`.dateFormat()\` on ${zoned ? "z.iso.datetime() with a zone \u2014 an instant, not a wall clock" : "a type that is not a date string"}. Only z.iso.date(), z.iso.datetime({ local: true }) and z.iso.time() take a format.`,
16480
+ `${subjectOf(source, path23)} uses \`.dateFormat()\` on ${zoned ? "z.iso.datetime() with a zone \u2014 an instant, not a wall clock" : "a type that is not a date string"}. Only z.iso.date(), z.iso.datetime({ local: true }) and z.iso.time() take a format.`,
16458
16481
  source,
16459
- path22,
16482
+ path23,
16460
16483
  zoned ? "datetime" : ins.resolvedType ?? "unknown"
16461
16484
  );
16462
16485
  }
@@ -16468,7 +16491,7 @@ function assertDateString(schema, source, path22) {
16468
16491
  compilePattern(pattern, kind);
16469
16492
  } catch (error) {
16470
16493
  if (error instanceof DateFormatError) {
16471
- refuse(`${subjectOf(source, path22)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path22, pattern);
16494
+ refuse(`${subjectOf(source, path23)}: \`.dateFormat('${pattern}')\` ${error.message}.`, source, path23, pattern);
16472
16495
  }
16473
16496
  throw error;
16474
16497
  }
@@ -16481,14 +16504,14 @@ function assertDateString(schema, source, path22) {
16481
16504
  const fits = typeof fallback === "string" && (pattern !== void 0 ? !!parseInPattern(fallback, pattern, kind) : ((parts) => !!parts && toCanonical(parts, kind) === fallback)(parseIso(fallback, kind)));
16482
16505
  if (!fits) {
16483
16506
  refuse(
16484
- `${subjectOf(source, path22)} has the default ${JSON.stringify(fallback)}, which is not written in ${written.replace(/'T'/, "T")} \u2014 a default is handed to \`execute\` as written, so write it in the field's own format.`,
16507
+ `${subjectOf(source, path23)} has the default ${JSON.stringify(fallback)}, which is not written in ${written.replace(/'T'/, "T")} \u2014 a default is handed to \`execute\` as written, so write it in the field's own format.`,
16485
16508
  source,
16486
- path22,
16509
+ path23,
16487
16510
  String(fallback)
16488
16511
  );
16489
16512
  }
16490
16513
  }
16491
- function assertField(schema, source, path22, seen, scope2, topLevel = false) {
16514
+ function assertField(schema, source, path23, seen, scope2, topLevel = false) {
16492
16515
  if (!schema || seen.has(schema)) {
16493
16516
  return;
16494
16517
  }
@@ -16496,35 +16519,35 @@ function assertField(schema, source, path22, seen, scope2, topLevel = false) {
16496
16519
  const ins = inspect(schema);
16497
16520
  if (ins.meta.frDynamicProps && !isDynamicPropsSlot(source, topLevel)) {
16498
16521
  refuse(
16499
- `${subjectOf(source, path22)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
16522
+ `${subjectOf(source, path23)} uses \`.dynamicProps()\`, which is supported on top-level action params only. For a list of objects, put it on the array rather than on its element.`,
16500
16523
  source,
16501
- path22,
16524
+ path23,
16502
16525
  "dynamicProps"
16503
16526
  );
16504
16527
  }
16505
16528
  if (ins.resolvedType === "catch") {
16506
- refuseCatch(source, path22);
16529
+ refuseCatch(source, path23);
16507
16530
  }
16508
- assertDictionaryBinding(schema, source, path22, scope2);
16509
- assertDateString(schema, source, path22);
16531
+ assertDictionaryBinding(schema, source, path23, scope2);
16532
+ assertDateString(schema, source, path23);
16510
16533
  if (!ins.resolvedType || !SUPPORTED_TYPES.has(ins.resolvedType)) {
16511
- refuseType(source, path22, ins.resolvedType);
16534
+ refuseType(source, path23, ins.resolvedType);
16512
16535
  }
16513
16536
  if (ins.branches) {
16514
- ins.branches.forEach((branch, index) => assertField(branch, source, `${path22}|branch ${index + 1}`, seen, scope2));
16537
+ ins.branches.forEach((branch, index) => assertField(branch, source, `${path23}|branch ${index + 1}`, seen, scope2));
16515
16538
  }
16516
16539
  const def = ins.core._zod?.def ?? {};
16517
16540
  if (ins.resolvedType === "array") {
16518
- assertField(def.element, source, `${path22}[]`, seen, scope2);
16541
+ assertField(def.element, source, `${path23}[]`, seen, scope2);
16519
16542
  }
16520
16543
  if (ins.resolvedType === "record") {
16521
- assertField(def.valueType, source, `${path22}{}`, seen, scope2);
16544
+ assertField(def.valueType, source, `${path23}{}`, seen, scope2);
16522
16545
  }
16523
16546
  if (ins.resolvedType === "object") {
16524
16547
  const properties = shapeEntries(ins.core);
16525
16548
  const inner = scope2.enter(properties.map(([name]) => name));
16526
16549
  for (const [name, property] of properties) {
16527
- assertField(property, source, `${path22}.${name}`, seen, inner);
16550
+ assertField(property, source, `${path23}.${name}`, seen, inner);
16528
16551
  }
16529
16552
  }
16530
16553
  }
@@ -17186,52 +17209,52 @@ function isAuthored(issue) {
17186
17209
  }
17187
17210
  function toFieldIssue(plan2, issue, fieldValue) {
17188
17211
  const segments = (issue.path ?? []).map(String).filter(Boolean);
17189
- const path22 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
17212
+ const path23 = segments.length ? `${plan2.name}.${segments.join(".")}` : plan2.name;
17190
17213
  const code = issue.code ?? "custom";
17191
17214
  const target = resolveTarget(plan2, segments, fieldValue);
17192
17215
  const named = { ...plan2, label: target.label };
17193
17216
  if (isAuthored(issue)) {
17194
- return { path: path22, code, message: issue.message };
17217
+ return { path: path23, code, message: issue.message };
17195
17218
  }
17196
17219
  if (code === "invalid_format" && target.schema && inspect(target.schema).branches) {
17197
17220
  const combined = unionPhrases(target.schema, target.value);
17198
17221
  if (combined.length > 1) {
17199
- return { path: path22, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
17222
+ return { path: path23, code: "invalid_union", message: `\xAB${target.label}\xBB must be ${combined.join(", or ")}` };
17200
17223
  }
17201
17224
  }
17202
17225
  const dateKind = target.schema ? dateStringKind(inspect(target.schema)) : void 0;
17203
17226
  const dateMissing = target.value == null || target.value === "";
17204
17227
  if (dateKind && (code === "invalid_type" || code === "invalid_format")) {
17205
- return dateMissing ? { path: path22, code, message: requiredMessage(named) } : { path: path22, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
17228
+ return dateMissing ? { path: path23, code, message: requiredMessage(named) } : { path: path23, code, message: invalidTypeMessage(named, expectedDateString(inspect(target.schema), dateKind)) };
17206
17229
  }
17207
17230
  if (code === "invalid_type") {
17208
17231
  const received = issue.received;
17209
17232
  const absent = segments.length ? target.found && target.value == null : received === "undefined" || received === "null" || issue.expected === void 0;
17210
- return absent ? { path: path22, code, message: requiredMessage(named) } : { path: path22, code, message: invalidTypeMessage(named, issue.expected ?? "") };
17233
+ return absent ? { path: path23, code, message: requiredMessage(named) } : { path: path23, code, message: invalidTypeMessage(named, issue.expected ?? "") };
17211
17234
  }
17212
17235
  if (code === "too_small") {
17213
- return { path: path22, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
17236
+ return { path: path23, code, message: `\xAB${target.label}\xBB must be at least ${bound(issue.minimum, plan2)}` };
17214
17237
  }
17215
17238
  if (code === "too_big") {
17216
- return { path: path22, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
17239
+ return { path: path23, code, message: `\xAB${target.label}\xBB must be at most ${bound(issue.maximum, plan2)}` };
17217
17240
  }
17218
17241
  if (code === "invalid_value") {
17219
- return { path: path22, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
17242
+ return { path: path23, code, message: `\xAB${target.label}\xBB must be ${oneOf(issue.values ?? [])}` };
17220
17243
  }
17221
17244
  if (code === "invalid_format") {
17222
17245
  const described = FORMAT_DESCRIPTIONS[issue.format ?? ""];
17223
- return described ? { path: path22, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path22, code, message: `\xAB${target.label}\xBB has an invalid format` };
17246
+ return described ? { path: path23, code, message: `\xAB${target.label}\xBB is invalid \u2014 ${described.replace(/^Expects /, "expects ")}` } : { path: path23, code, message: `\xAB${target.label}\xBB has an invalid format` };
17224
17247
  }
17225
17248
  if (code === "invalid_union") {
17226
17249
  if (segments.length && target.found && target.value == null) {
17227
- return { path: path22, code, message: requiredMessage(named) };
17250
+ return { path: path23, code, message: requiredMessage(named) };
17228
17251
  }
17229
17252
  const combined = unionIssue(plan2, issue, target.schema, target.value, fieldValue);
17230
17253
  if (combined) {
17231
- return combined.path ? combined : { path: path22, code, message: `\xAB${target.label}\xBB ${combined.message}` };
17254
+ return combined.path ? combined : { path: path23, code, message: `\xAB${target.label}\xBB ${combined.message}` };
17232
17255
  }
17233
17256
  }
17234
- return { path: path22, code, message: `\xAB${target.label}\xBB is invalid` };
17257
+ return { path: path23, code, message: `\xAB${target.label}\xBB is invalid` };
17235
17258
  }
17236
17259
 
17237
17260
  // ../../flow-extension-runner/src/params/schema/normalize.ts
@@ -17352,10 +17375,10 @@ var EXPECTED2 = {
17352
17375
  };
17353
17376
  function toIssues(error, param) {
17354
17377
  return (error?.issues ?? []).map((issue) => {
17355
- const path22 = (issue.path ?? []).map(String).join(".");
17378
+ const path23 = (issue.path ?? []).map(String).join(".");
17356
17379
  const expected = issue.expected;
17357
- const restated = param && !path22 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
17358
- return { path: path22, message: restated ?? issue.message ?? "invalid value", code: issue.code };
17380
+ const restated = param && !path23 && issue.code === "invalid_type" && expected ? `\xAB${param}\xBB must be ${EXPECTED2[expected] ?? expected}` : void 0;
17381
+ return { path: path23, message: restated ?? issue.message ?? "invalid value", code: issue.code };
17359
17382
  });
17360
17383
  }
17361
17384
  function parseSchema(schema, value, fail3, param) {
@@ -19032,8 +19055,8 @@ var PollingTriggers = class {
19032
19055
  };
19033
19056
 
19034
19057
  // ../../flow-extension-runner/src/path.ts
19035
- function getPath(source, path22) {
19036
- return path22.split(".").reduce(
19058
+ function getPath(source, path23) {
19059
+ return path23.split(".").reduce(
19037
19060
  (acc, key) => acc == null ? acc : acc[key],
19038
19061
  source
19039
19062
  );
@@ -19703,12 +19726,12 @@ var RealtimeTriggerMethod = class extends ExtensionMethod {
19703
19726
  if (typeof match === "function") {
19704
19727
  return !!await match({ params, providerEventData, webhookData });
19705
19728
  }
19706
- for (const [paramKey, path22] of Object.entries(match)) {
19729
+ for (const [paramKey, path23] of Object.entries(match)) {
19707
19730
  const paramValue = params[paramKey];
19708
19731
  if (!isFilled(paramValue)) {
19709
19732
  continue;
19710
19733
  }
19711
- if (`${paramValue}` !== `${getPath(providerEventData, path22)}`) {
19734
+ if (`${paramValue}` !== `${getPath(providerEventData, path23)}`) {
19712
19735
  return false;
19713
19736
  }
19714
19737
  }
@@ -20272,19 +20295,31 @@ function selectServices(available, selection = {}) {
20272
20295
  }
20273
20296
 
20274
20297
  // src/operations/deploy/zip.ts
20275
- var import_archiver = __toESM(require("archiver"));
20298
+ var import_adm_zip = __toESM(require_adm_zip());
20299
+ var import_fs11 = __toESM(require("fs"));
20276
20300
  var import_path15 = __toESM(require("path"));
20301
+ var S_IFLNK = 40960;
20277
20302
  async function createServiceZip(definition, projectRoot, serviceId) {
20278
- return new Promise((resolve, reject) => {
20279
- const archive = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
20280
- const chunks = [];
20281
- archive.on("data", (chunk) => chunks.push(chunk));
20282
- archive.on("end", () => resolve(Buffer.concat(chunks)));
20283
- archive.on("error", reject);
20284
- archive.directory(`${import_path15.default.resolve(projectRoot, "services", serviceId)}/`, "package");
20285
- archive.append(JSON.stringify(definition, null, 2), { name: "definition.json" });
20286
- archive.finalize();
20287
- });
20303
+ const zip = new import_adm_zip.default();
20304
+ addDirectory(zip, import_path15.default.resolve(projectRoot, "services", serviceId), "package");
20305
+ zip.addFile("definition.json", Buffer.from(JSON.stringify(definition, null, 2)));
20306
+ return zip.toBuffer();
20307
+ }
20308
+ function addDirectory(zip, dir, zipDir) {
20309
+ for (const name of import_fs11.default.readdirSync(dir)) {
20310
+ const fullPath = import_path15.default.join(dir, name);
20311
+ const zipPath = `${zipDir}/${name}`;
20312
+ const stats = import_fs11.default.lstatSync(fullPath);
20313
+ if (stats.isDirectory()) {
20314
+ zip.addFile(`${zipPath}/`, Buffer.alloc(0), "", stats);
20315
+ addDirectory(zip, fullPath, zipPath);
20316
+ } else if (stats.isSymbolicLink()) {
20317
+ const entry = zip.addFile(zipPath, Buffer.from(import_fs11.default.readlinkSync(fullPath)), "", stats);
20318
+ entry.attr = (S_IFLNK | stats.mode & 4095) << 16 >>> 0;
20319
+ } else if (stats.isFile()) {
20320
+ zip.addFile(zipPath, import_fs11.default.readFileSync(fullPath), "", stats);
20321
+ }
20322
+ }
20288
20323
  }
20289
20324
 
20290
20325
  // src/operations/deploy/index.ts
@@ -20314,7 +20349,7 @@ async function deploy(options = {}) {
20314
20349
  const { serverUrl, workspaceId, workspaceName, deployToken } = await resolveAuth(projectRoot, options.onAuthRequired);
20315
20350
  const credentials = { serverUrl, workspaceId, deployToken };
20316
20351
  const workspace = { workspaceId, workspaceName };
20317
- if (!import_fs11.default.existsSync(import_path16.default.resolve(projectRoot, "services"))) {
20352
+ if (!import_fs12.default.existsSync(import_path16.default.resolve(projectRoot, "services"))) {
20318
20353
  throw new NoServicesDirectoryError();
20319
20354
  }
20320
20355
  emit({ type: "connecting", serverUrl, workspace });
@@ -20448,7 +20483,7 @@ var ERROR_HTML = (error) => `<!DOCTYPE html>
20448
20483
  </body></html>`;
20449
20484
 
20450
20485
  // src/server/routes/callback.ts
20451
- function callbackRoute(path22 = "/callback") {
20486
+ function callbackRoute(path23 = "/callback") {
20452
20487
  let resolveCode = null;
20453
20488
  let rejectCode = null;
20454
20489
  const respond = (route2, html) => {
@@ -20457,7 +20492,7 @@ function callbackRoute(path22 = "/callback") {
20457
20492
  };
20458
20493
  const route = {
20459
20494
  method: "GET",
20460
- path: path22,
20495
+ path: path23,
20461
20496
  handle: (context) => {
20462
20497
  const code = context.url.searchParams.get("code");
20463
20498
  const error = context.url.searchParams.get("error");
@@ -21260,11 +21295,11 @@ var import_path21 = __toESM(require("path"));
21260
21295
 
21261
21296
  // src/operations/init/index.ts
21262
21297
  var import_child_process = require("child_process");
21263
- var import_fs13 = __toESM(require("fs"));
21298
+ var import_fs14 = __toESM(require("fs"));
21264
21299
  var import_path19 = __toESM(require("path"));
21265
21300
 
21266
21301
  // src/operations/init/testing.ts
21267
- var import_fs12 = __toESM(require("fs"));
21302
+ var import_fs13 = __toESM(require("fs"));
21268
21303
  var import_path18 = __toESM(require("path"));
21269
21304
  function testingFilesDirectory() {
21270
21305
  return import_path18.default.join(packageRoot(), PROJECT_FILES_DIRECTORY);
@@ -21275,13 +21310,13 @@ function writeTestingFiles(projectRoot) {
21275
21310
  const skipped = [];
21276
21311
  for (const file of TESTING_FILES) {
21277
21312
  const target = import_path18.default.join(projectRoot, file);
21278
- if (import_fs12.default.existsSync(target)) {
21313
+ if (import_fs13.default.existsSync(target)) {
21279
21314
  skipped.push(file);
21280
21315
  continue;
21281
21316
  }
21282
- const contents = import_fs12.default.readFileSync(import_path18.default.join(source, file));
21283
- import_fs12.default.mkdirSync(import_path18.default.dirname(target), { recursive: true });
21284
- import_fs12.default.writeFileSync(target, contents);
21317
+ const contents = import_fs13.default.readFileSync(import_path18.default.join(source, file));
21318
+ import_fs13.default.mkdirSync(import_path18.default.dirname(target), { recursive: true });
21319
+ import_fs13.default.writeFileSync(target, contents);
21285
21320
  created.push(file);
21286
21321
  }
21287
21322
  return { created, skipped };
@@ -21292,7 +21327,7 @@ var GITIGNORE_ENTRIES = ["node_modules/", `${TOKEN_DIR}/`, ...TEST_GITIGNORE_ENT
21292
21327
  var CLI_PACKAGE = "@flowrunner/cli";
21293
21328
  var CLI_PACKAGE_NAMES = [CLI_PACKAGE, "flowrunner-cli"];
21294
21329
  function cliVersion() {
21295
- return JSON.parse(import_fs13.default.readFileSync(import_path19.default.join(packageRoot(), "package.json"), "utf-8")).version;
21330
+ return JSON.parse(import_fs14.default.readFileSync(import_path19.default.join(packageRoot(), "package.json"), "utf-8")).version;
21296
21331
  }
21297
21332
  function packageNameFrom(directory) {
21298
21333
  const name = import_path19.default.basename(import_path19.default.resolve(directory)).toLowerCase().replace(/[^a-z0-9._-]+/g, "-").replace(/^[._-]+|[-._]+$/g, "");
@@ -21313,46 +21348,52 @@ function writePackageJson(projectRoot, tests) {
21313
21348
  const version2 = cliVersion();
21314
21349
  const devDependencies = { [CLI_PACKAGE]: version2, ...tests ? TEST_DEV_DEPENDENCIES : {} };
21315
21350
  const scripts = { deploy: "flowrunner deploy --all", ...tests ? TEST_SCRIPTS : {} };
21316
- if (!import_fs13.default.existsSync(fullPath)) {
21351
+ const overrides = tests ? TEST_OVERRIDES : {};
21352
+ if (!import_fs14.default.existsSync(fullPath)) {
21317
21353
  const manifest2 = {
21318
21354
  name: packageNameFrom(projectRoot),
21319
21355
  version: "0.0.1",
21320
21356
  private: true,
21321
21357
  description: "FlowRunner custom extensions.",
21322
21358
  scripts,
21323
- devDependencies
21359
+ devDependencies,
21360
+ ...tests ? { overrides } : {}
21324
21361
  };
21325
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
21362
+ import_fs14.default.writeFileSync(fullPath, JSON.stringify(manifest2, null, 2) + "\n", "utf-8");
21326
21363
  return "created";
21327
21364
  }
21328
- const manifest = JSON.parse(import_fs13.default.readFileSync(fullPath, "utf-8"));
21365
+ const manifest = JSON.parse(import_fs14.default.readFileSync(fullPath, "utf-8"));
21329
21366
  const alreadyDeclared = CLI_PACKAGE_NAMES.some((name) => manifest.dependencies?.[name] || manifest.devDependencies?.[name]);
21330
21367
  const additions = alreadyDeclared ? Object.fromEntries(Object.entries(devDependencies).filter(([name]) => name !== CLI_PACKAGE)) : devDependencies;
21331
21368
  manifest.devDependencies ??= {};
21332
21369
  manifest.scripts ??= {};
21370
+ if (tests) {
21371
+ manifest.overrides ??= {};
21372
+ }
21333
21373
  const changed = [
21334
21374
  addMissing(manifest.devDependencies, additions),
21335
- addMissing(manifest.scripts, tests ? TEST_SCRIPTS : {}, PLACEHOLDER_SCRIPTS)
21375
+ addMissing(manifest.scripts, tests ? TEST_SCRIPTS : {}, PLACEHOLDER_SCRIPTS),
21376
+ tests && addMissing(manifest.overrides, overrides)
21336
21377
  ].some(Boolean);
21337
21378
  if (!changed) {
21338
21379
  return "skipped";
21339
21380
  }
21340
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
21381
+ import_fs14.default.writeFileSync(fullPath, JSON.stringify(manifest, null, 2) + "\n", "utf-8");
21341
21382
  return "updated";
21342
21383
  }
21343
21384
  function writeGitignore(projectRoot) {
21344
21385
  const fullPath = import_path19.default.join(projectRoot, ".gitignore");
21345
- if (!import_fs13.default.existsSync(fullPath)) {
21346
- import_fs13.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
21386
+ if (!import_fs14.default.existsSync(fullPath)) {
21387
+ import_fs14.default.writeFileSync(fullPath, GITIGNORE_ENTRIES.join("\n") + "\n", "utf-8");
21347
21388
  return "created";
21348
21389
  }
21349
- const content = import_fs13.default.readFileSync(fullPath, "utf-8");
21390
+ const content = import_fs14.default.readFileSync(fullPath, "utf-8");
21350
21391
  const lines = content.split("\n").map((line) => line.trim());
21351
21392
  const missing = GITIGNORE_ENTRIES.filter((entry) => !lines.includes(entry) && !lines.includes(entry.replace(/\/$/, "")));
21352
21393
  if (missing.length === 0) {
21353
21394
  return "skipped";
21354
21395
  }
21355
- import_fs13.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
21396
+ import_fs14.default.appendFileSync(fullPath, `${content.endsWith("\n") ? "" : "\n"}${missing.join("\n")}
21356
21397
  `);
21357
21398
  return "updated";
21358
21399
  }
@@ -21401,10 +21442,10 @@ The authoring reference the CLI ships lives in
21401
21442
  `;
21402
21443
  function writeReadme(projectRoot) {
21403
21444
  const fullPath = import_path19.default.join(projectRoot, "README.md");
21404
- if (import_fs13.default.existsSync(fullPath)) {
21445
+ if (import_fs14.default.existsSync(fullPath)) {
21405
21446
  return "skipped";
21406
21447
  }
21407
- import_fs13.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
21448
+ import_fs14.default.writeFileSync(fullPath, README(packageNameFrom(projectRoot)), "utf-8");
21408
21449
  return "created";
21409
21450
  }
21410
21451
  var JSCONFIG = {
@@ -21417,10 +21458,10 @@ var JSCONFIG = {
21417
21458
  };
21418
21459
  function writeJsconfig(projectRoot) {
21419
21460
  const fullPath = import_path19.default.join(projectRoot, "jsconfig.json");
21420
- if (import_fs13.default.existsSync(fullPath)) {
21461
+ if (import_fs14.default.existsSync(fullPath)) {
21421
21462
  return "skipped";
21422
21463
  }
21423
- import_fs13.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
21464
+ import_fs14.default.writeFileSync(fullPath, JSON.stringify(JSCONFIG, null, 2) + "\n", "utf-8");
21424
21465
  return "created";
21425
21466
  }
21426
21467
  function git(projectRoot, args) {
@@ -21471,13 +21512,13 @@ function npmInstall(projectRoot, warn) {
21471
21512
  }
21472
21513
  }
21473
21514
  function describeTarget(projectRoot) {
21474
- if (!import_fs13.default.existsSync(projectRoot)) {
21515
+ if (!import_fs14.default.existsSync(projectRoot)) {
21475
21516
  return { projectRoot, lines: ["a new directory"], defaultYes: true };
21476
21517
  }
21477
- if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
21518
+ if (!import_fs14.default.statSync(projectRoot).isDirectory()) {
21478
21519
  return { projectRoot, lines: ["not a directory"], defaultYes: false };
21479
21520
  }
21480
- const entries = import_fs13.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
21521
+ const entries = import_fs14.default.readdirSync(projectRoot).filter((entry) => entry !== ".git");
21481
21522
  if (entries.length === 0) {
21482
21523
  return { projectRoot, lines: ["an empty directory"], defaultYes: true };
21483
21524
  }
@@ -21521,10 +21562,10 @@ async function init(options = {}) {
21521
21562
  committed: false
21522
21563
  };
21523
21564
  }
21524
- if (!import_fs13.default.existsSync(projectRoot)) {
21525
- import_fs13.default.mkdirSync(projectRoot, { recursive: true });
21565
+ if (!import_fs14.default.existsSync(projectRoot)) {
21566
+ import_fs14.default.mkdirSync(projectRoot, { recursive: true });
21526
21567
  }
21527
- if (!import_fs13.default.statSync(projectRoot).isDirectory()) {
21568
+ if (!import_fs14.default.statSync(projectRoot).isDirectory()) {
21528
21569
  throw new PromptAbortedError(`${projectRoot} is not a directory.`);
21529
21570
  }
21530
21571
  const created = [];
@@ -21566,10 +21607,10 @@ async function init(options = {}) {
21566
21607
 
21567
21608
  // src/cli/offer-global-install.ts
21568
21609
  var import_child_process2 = require("child_process");
21569
- var import_fs14 = __toESM(require("fs"));
21610
+ var import_fs15 = __toESM(require("fs"));
21570
21611
  var import_path20 = __toESM(require("path"));
21571
21612
  function runningVersion() {
21572
- return JSON.parse(import_fs14.default.readFileSync(import_path20.default.join(packageRoot(), "package.json"), "utf-8")).version;
21613
+ return JSON.parse(import_fs15.default.readFileSync(import_path20.default.join(packageRoot(), "package.json"), "utf-8")).version;
21573
21614
  }
21574
21615
  async function offerGlobalInstall() {
21575
21616
  if (!process.stdin.isTTY || hasGlobalInstall()) {
@@ -21656,7 +21697,7 @@ async function initCommand(templateId, options = {}) {
21656
21697
  }
21657
21698
 
21658
21699
  // src/operations/init-claude/index.ts
21659
- var import_fs15 = __toESM(require("fs"));
21700
+ var import_fs16 = __toESM(require("fs"));
21660
21701
  var import_path22 = __toESM(require("path"));
21661
21702
 
21662
21703
  // src/operations/init-claude/segment.ts
@@ -21695,10 +21736,10 @@ function providerDirectory(provider = CLAUDE_PROVIDER) {
21695
21736
  return import_path22.default.join(packageRoot(), AI_PROVIDERS_DIRECTORY, provider);
21696
21737
  }
21697
21738
  function packedAgents(directory) {
21698
- if (!import_fs15.default.existsSync(directory)) {
21739
+ if (!import_fs16.default.existsSync(directory)) {
21699
21740
  return [];
21700
21741
  }
21701
- return import_fs15.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
21742
+ return import_fs16.default.readdirSync(directory, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".md")).map((entry) => entry.name).sort();
21702
21743
  }
21703
21744
  function writeAgents(sourceDirectory, projectRoot, layout) {
21704
21745
  const directory = import_path22.default.join(projectRoot, layout.agentsDirectory);
@@ -21711,23 +21752,23 @@ function writeAgents(sourceDirectory, projectRoot, layout) {
21711
21752
  warnings.push(`The installed CLI ships no agent definitions in ${PROVIDER_AGENTS_DIRECTORY}/ \u2014 none were written.`);
21712
21753
  return { directory, created, updated, unchanged, warnings };
21713
21754
  }
21714
- import_fs15.default.mkdirSync(directory, { recursive: true });
21755
+ import_fs16.default.mkdirSync(directory, { recursive: true });
21715
21756
  for (const agent of agents) {
21716
- const contents = import_fs15.default.readFileSync(import_path22.default.join(sourceDirectory, agent), "utf-8");
21757
+ const contents = import_fs16.default.readFileSync(import_path22.default.join(sourceDirectory, agent), "utf-8");
21717
21758
  const target = import_path22.default.join(directory, agent);
21718
21759
  if (contents.length === 0) {
21719
21760
  warnings.push(`${agent} is empty in the installed CLI \u2014 written as an empty file.`);
21720
21761
  }
21721
- if (!import_fs15.default.existsSync(target)) {
21722
- import_fs15.default.writeFileSync(target, contents, "utf-8");
21762
+ if (!import_fs16.default.existsSync(target)) {
21763
+ import_fs16.default.writeFileSync(target, contents, "utf-8");
21723
21764
  created.push(agent);
21724
21765
  continue;
21725
21766
  }
21726
- if (import_fs15.default.readFileSync(target, "utf-8") === contents) {
21767
+ if (import_fs16.default.readFileSync(target, "utf-8") === contents) {
21727
21768
  unchanged.push(agent);
21728
21769
  continue;
21729
21770
  }
21730
- import_fs15.default.writeFileSync(target, contents, "utf-8");
21771
+ import_fs16.default.writeFileSync(target, contents, "utf-8");
21731
21772
  updated.push(agent);
21732
21773
  }
21733
21774
  return { directory, created, updated, unchanged, warnings };
@@ -21736,18 +21777,18 @@ function writeSegment(sourceDirectory, projectRoot, layout) {
21736
21777
  const file = import_path22.default.join(projectRoot, layout.instructionsFile);
21737
21778
  const source = import_path22.default.join(sourceDirectory, ORCHESTRATOR_SEGMENT_FILE);
21738
21779
  const warnings = [];
21739
- if (!import_fs15.default.existsSync(source)) {
21780
+ if (!import_fs16.default.existsSync(source)) {
21740
21781
  warnings.push(`The installed CLI ships no ${ORCHESTRATOR_SEGMENT_FILE} \u2014 ${layout.instructionsFile} was left alone.`);
21741
21782
  return { file, outcome: "unchanged", warnings };
21742
21783
  }
21743
- const segment = import_fs15.default.readFileSync(source, "utf-8");
21784
+ const segment = import_fs16.default.readFileSync(source, "utf-8");
21744
21785
  if (segment.trim().length === 0) {
21745
21786
  warnings.push(`${ORCHESTRATOR_SEGMENT_FILE} is empty in the installed CLI \u2014 the marked block is empty.`);
21746
21787
  }
21747
- const current = import_fs15.default.existsSync(file) ? import_fs15.default.readFileSync(file, "utf-8") : null;
21788
+ const current = import_fs16.default.existsSync(file) ? import_fs16.default.readFileSync(file, "utf-8") : null;
21748
21789
  const merged = mergeSegment(current, segment, layout.instructionsFile);
21749
21790
  if (merged.outcome !== "unchanged") {
21750
- import_fs15.default.writeFileSync(file, merged.contents, "utf-8");
21791
+ import_fs16.default.writeFileSync(file, merged.contents, "utf-8");
21751
21792
  }
21752
21793
  return { file, outcome: merged.outcome, warnings };
21753
21794
  }
@@ -21757,11 +21798,11 @@ async function initClaude(options = {}) {
21757
21798
  const warnAll = (messages) => messages.forEach((message) => emit({ type: "warning", message }));
21758
21799
  const layout = PROVIDERS[CLAUDE_PROVIDER];
21759
21800
  const sourceDirectory = providerDirectory(layout.id);
21760
- if (!import_fs15.default.existsSync(sourceDirectory)) {
21801
+ if (!import_fs16.default.existsSync(sourceDirectory)) {
21761
21802
  throw new AiDocsMissingError(import_path22.default.join(AI_PROVIDERS_DIRECTORY, CLAUDE_PROVIDER));
21762
21803
  }
21763
- if (!import_fs15.default.existsSync(projectRoot)) {
21764
- import_fs15.default.mkdirSync(projectRoot, { recursive: true });
21804
+ if (!import_fs16.default.existsSync(projectRoot)) {
21805
+ import_fs16.default.mkdirSync(projectRoot, { recursive: true });
21765
21806
  }
21766
21807
  const agents = writeAgents(import_path22.default.join(sourceDirectory, PROVIDER_AGENTS_DIRECTORY), projectRoot, layout);
21767
21808
  emit({
@@ -21836,12 +21877,12 @@ async function logoutCommand() {
21836
21877
  }
21837
21878
 
21838
21879
  // src/operations/pull/index.ts
21839
- var import_adm_zip = __toESM(require_adm_zip());
21840
- var import_fs17 = __toESM(require("fs"));
21880
+ var import_adm_zip2 = __toESM(require_adm_zip());
21881
+ var import_fs18 = __toESM(require("fs"));
21841
21882
  var import_path24 = __toESM(require("path"));
21842
21883
 
21843
21884
  // src/operations/pull/extract.ts
21844
- var import_fs16 = __toESM(require("fs"));
21885
+ var import_fs17 = __toESM(require("fs"));
21845
21886
  var import_path23 = __toESM(require("path"));
21846
21887
  var PACKAGE_PREFIX = "package/";
21847
21888
  var SAFE_SERVICE_ID = /^[A-Za-z0-9][A-Za-z0-9._-]*$/;
@@ -21865,8 +21906,8 @@ function extractService(archive, directory) {
21865
21906
  if (target !== directory && !target.startsWith(directory + import_path23.default.sep)) {
21866
21907
  continue;
21867
21908
  }
21868
- import_fs16.default.mkdirSync(import_path23.default.dirname(target), { recursive: true });
21869
- import_fs16.default.writeFileSync(target, entry.getData());
21909
+ import_fs17.default.mkdirSync(import_path23.default.dirname(target), { recursive: true });
21910
+ import_fs17.default.writeFileSync(target, entry.getData());
21870
21911
  written++;
21871
21912
  }
21872
21913
  return written;
@@ -21886,7 +21927,7 @@ function declaredDependencies(archive) {
21886
21927
 
21887
21928
  // src/operations/pull/index.ts
21888
21929
  async function localState(projectRoot, service) {
21889
- if (!import_fs17.default.existsSync(import_path24.default.resolve(projectRoot, "services", service.serviceId))) {
21930
+ if (!import_fs18.default.existsSync(import_path24.default.resolve(projectRoot, "services", service.serviceId))) {
21890
21931
  return "absent";
21891
21932
  }
21892
21933
  try {
@@ -21950,9 +21991,9 @@ async function pull(options = {}) {
21950
21991
  }
21951
21992
  const exists = state === "different";
21952
21993
  const zipBuffer = await guard(() => downloadRemoteService(credentials, service.serviceId));
21953
- const archive = new import_adm_zip.default(zipBuffer);
21994
+ const archive = new import_adm_zip2.default(zipBuffer);
21954
21995
  if (exists) {
21955
- import_fs17.default.rmSync(directory, { recursive: true, force: true });
21996
+ import_fs18.default.rmSync(directory, { recursive: true, force: true });
21956
21997
  }
21957
21998
  const files = extractService(archive, directory);
21958
21999
  const dependencies = declaredDependencies(archive);
@@ -22052,10 +22093,10 @@ async function pickServices2(available) {
22052
22093
  }
22053
22094
 
22054
22095
  // src/operations/use-server.ts
22055
- var import_fs18 = __toESM(require("fs"));
22096
+ var import_fs19 = __toESM(require("fs"));
22056
22097
  function useServer(target, options = {}) {
22057
22098
  const projectRoot = options.cwd ?? process.cwd();
22058
- if (!import_fs18.default.existsSync(configPath(projectRoot))) {
22099
+ if (!import_fs19.default.existsSync(configPath(projectRoot))) {
22059
22100
  throw new NotAProjectError();
22060
22101
  }
22061
22102
  const serverUrl = resolveServerTarget(target);
@@ -22128,10 +22169,23 @@ async function useCommand(target) {
22128
22169
  }
22129
22170
  }
22130
22171
 
22172
+ // src/cli/version-banner.ts
22173
+ var import_fs20 = __toESM(require("fs"));
22174
+ var import_path25 = __toESM(require("path"));
22175
+ var { versionBanner } = require_banner();
22176
+ function runningCli() {
22177
+ const root = packageRoot();
22178
+ const { version: version2 } = JSON.parse(import_fs20.default.readFileSync(import_path25.default.join(root, "package.json"), "utf-8"));
22179
+ return { version: version2, root };
22180
+ }
22181
+ function commandBanner(env = process.env) {
22182
+ return env.FLOWRUNNER_BANNER_SHOWN ? [] : versionBanner(runningCli());
22183
+ }
22184
+
22131
22185
  // src/cli/index.ts
22132
22186
  var { version } = require_package();
22133
22187
  var program = new import_commander.Command();
22134
- program.name("flowrunner").description("Flowrunner CLI for Custom extension management").version(version);
22188
+ program.name("flowrunner").description("Flowrunner CLI for Custom extension management").version(version).hook("preAction", () => commandBanner().forEach((line) => sayStatus(line)));
22135
22189
  program.command("init").argument("[template]", "Template to scaffold a first service from; omit to create just the project").description("Create a FlowRunner extensions project (package.json, flowrunner.json, .gitignore)").option("-d, --dir <path>", "Directory to create the project in (defaults to the current one)").option("-s, --server <target>", `Server to point the project at: prod, dev, local, or a full URL (default: ${DEFAULT_CLUSTER} \u2014 ${CLUSTERS[DEFAULT_CLUSTER]})`).option("--id <id>", "Service id, when a template is given (skips that prompt)").option("--name <name>", "Display name, when a template is given (skips that prompt)").option("--set <name=value...>", "Answer any prompt the template declares (repeatable)").option("-y, --yes", "Accept every default and ask nothing").option("--no-install", "Skip the npm install at the end").option("--no-git", "Skip initialising a git repository and making the first commit").option("--no-tests", "Skip the unit-test harness (jest config + sandbox/)").action(initCommand);
22136
22190
  program.command("init-claude").description("Wire the FlowRunner agent instructions into this project's Claude setup").option("-d, --dir <path>", "Project directory to wire up (defaults to the current one)").action(initClaudeCommand);
22137
22191
  program.command("login").description("Log in to a FlowRunner server via browser-based authorization").option("-s, --server <target>", "prod, dev, local, or a full URL (defaults to serverUrl in flowrunner.json)").action(loginCommand);