@secondlayer/cli 2.0.0 → 2.2.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.
package/dist/cli.js CHANGED
@@ -15429,8 +15429,8 @@ var require_fill_range = __commonJS((exports, module) => {
15429
15429
  return typeof value === "number" || typeof value === "string" && value !== "";
15430
15430
  };
15431
15431
  var isNumber = (num) => Number.isInteger(+num);
15432
- var zeros = (input3) => {
15433
- let value = `${input3}`;
15432
+ var zeros = (input4) => {
15433
+ let value = `${input4}`;
15434
15434
  let index = -1;
15435
15435
  if (value[0] === "-")
15436
15436
  value = value.slice(1);
@@ -15446,27 +15446,27 @@ var require_fill_range = __commonJS((exports, module) => {
15446
15446
  }
15447
15447
  return options2.stringify === true;
15448
15448
  };
15449
- var pad = (input3, maxLength, toNumber) => {
15449
+ var pad = (input4, maxLength, toNumber) => {
15450
15450
  if (maxLength > 0) {
15451
- let dash = input3[0] === "-" ? "-" : "";
15451
+ let dash = input4[0] === "-" ? "-" : "";
15452
15452
  if (dash)
15453
- input3 = input3.slice(1);
15454
- input3 = dash + input3.padStart(dash ? maxLength - 1 : maxLength, "0");
15453
+ input4 = input4.slice(1);
15454
+ input4 = dash + input4.padStart(dash ? maxLength - 1 : maxLength, "0");
15455
15455
  }
15456
15456
  if (toNumber === false) {
15457
- return String(input3);
15457
+ return String(input4);
15458
15458
  }
15459
- return input3;
15459
+ return input4;
15460
15460
  };
15461
- var toMaxLen = (input3, maxLength) => {
15462
- let negative = input3[0] === "-" ? "-" : "";
15461
+ var toMaxLen = (input4, maxLength) => {
15462
+ let negative = input4[0] === "-" ? "-" : "";
15463
15463
  if (negative) {
15464
- input3 = input3.slice(1);
15464
+ input4 = input4.slice(1);
15465
15465
  maxLength--;
15466
15466
  }
15467
- while (input3.length < maxLength)
15468
- input3 = "0" + input3;
15469
- return negative ? "-" + input3 : input3;
15467
+ while (input4.length < maxLength)
15468
+ input4 = "0" + input4;
15469
+ return negative ? "-" + input4 : input4;
15470
15470
  };
15471
15471
  var toSequence = (parts, options2, maxLen) => {
15472
15472
  parts.negatives.sort((a, b2) => a < b2 ? -1 : a > b2 ? 1 : 0);
@@ -15835,25 +15835,25 @@ var require_parse = __commonJS((exports, module) => {
15835
15835
  CHAR_NO_BREAK_SPACE,
15836
15836
  CHAR_ZERO_WIDTH_NOBREAK_SPACE
15837
15837
  } = require_constants();
15838
- var parse2 = (input3, options2 = {}) => {
15839
- if (typeof input3 !== "string") {
15838
+ var parse2 = (input4, options2 = {}) => {
15839
+ if (typeof input4 !== "string") {
15840
15840
  throw new TypeError("Expected a string");
15841
15841
  }
15842
15842
  const opts = options2 || {};
15843
15843
  const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
15844
- if (input3.length > max) {
15845
- throw new SyntaxError(`Input length (${input3.length}), exceeds max characters (${max})`);
15844
+ if (input4.length > max) {
15845
+ throw new SyntaxError(`Input length (${input4.length}), exceeds max characters (${max})`);
15846
15846
  }
15847
- const ast = { type: "root", input: input3, nodes: [] };
15847
+ const ast = { type: "root", input: input4, nodes: [] };
15848
15848
  const stack = [ast];
15849
15849
  let block = ast;
15850
15850
  let prev = ast;
15851
15851
  let brackets = 0;
15852
- const length = input3.length;
15852
+ const length = input4.length;
15853
15853
  let index = 0;
15854
15854
  let depth = 0;
15855
15855
  let value;
15856
- const advance = () => input3[index++];
15856
+ const advance = () => input4[index++];
15857
15857
  const push = (node) => {
15858
15858
  if (node.type === "text" && prev.type === "dot") {
15859
15859
  prev.type = "text";
@@ -16048,10 +16048,10 @@ var require_braces = __commonJS((exports, module) => {
16048
16048
  var compile = require_compile();
16049
16049
  var expand = require_expand();
16050
16050
  var parse2 = require_parse();
16051
- var braces = (input3, options2 = {}) => {
16051
+ var braces = (input4, options2 = {}) => {
16052
16052
  let output = [];
16053
- if (Array.isArray(input3)) {
16054
- for (const pattern of input3) {
16053
+ if (Array.isArray(input4)) {
16054
+ for (const pattern of input4) {
16055
16055
  const result = braces.create(pattern, options2);
16056
16056
  if (Array.isArray(result)) {
16057
16057
  output.push(...result);
@@ -16060,31 +16060,31 @@ var require_braces = __commonJS((exports, module) => {
16060
16060
  }
16061
16061
  }
16062
16062
  } else {
16063
- output = [].concat(braces.create(input3, options2));
16063
+ output = [].concat(braces.create(input4, options2));
16064
16064
  }
16065
16065
  if (options2 && options2.expand === true && options2.nodupes === true) {
16066
16066
  output = [...new Set(output)];
16067
16067
  }
16068
16068
  return output;
16069
16069
  };
16070
- braces.parse = (input3, options2 = {}) => parse2(input3, options2);
16071
- braces.stringify = (input3, options2 = {}) => {
16072
- if (typeof input3 === "string") {
16073
- return stringify2(braces.parse(input3, options2), options2);
16070
+ braces.parse = (input4, options2 = {}) => parse2(input4, options2);
16071
+ braces.stringify = (input4, options2 = {}) => {
16072
+ if (typeof input4 === "string") {
16073
+ return stringify2(braces.parse(input4, options2), options2);
16074
16074
  }
16075
- return stringify2(input3, options2);
16075
+ return stringify2(input4, options2);
16076
16076
  };
16077
- braces.compile = (input3, options2 = {}) => {
16078
- if (typeof input3 === "string") {
16079
- input3 = braces.parse(input3, options2);
16077
+ braces.compile = (input4, options2 = {}) => {
16078
+ if (typeof input4 === "string") {
16079
+ input4 = braces.parse(input4, options2);
16080
16080
  }
16081
- return compile(input3, options2);
16081
+ return compile(input4, options2);
16082
16082
  };
16083
- braces.expand = (input3, options2 = {}) => {
16084
- if (typeof input3 === "string") {
16085
- input3 = braces.parse(input3, options2);
16083
+ braces.expand = (input4, options2 = {}) => {
16084
+ if (typeof input4 === "string") {
16085
+ input4 = braces.parse(input4, options2);
16086
16086
  }
16087
- let result = expand(input3, options2);
16087
+ let result = expand(input4, options2);
16088
16088
  if (options2.noempty === true) {
16089
16089
  result = result.filter(Boolean);
16090
16090
  }
@@ -16093,11 +16093,11 @@ var require_braces = __commonJS((exports, module) => {
16093
16093
  }
16094
16094
  return result;
16095
16095
  };
16096
- braces.create = (input3, options2 = {}) => {
16097
- if (input3 === "" || input3.length < 3) {
16098
- return [input3];
16096
+ braces.create = (input4, options2 = {}) => {
16097
+ if (input4 === "" || input4.length < 3) {
16098
+ return [input4];
16099
16099
  }
16100
- return options2.expand !== true ? braces.compile(input3, options2) : braces.expand(input3, options2);
16100
+ return options2.expand !== true ? braces.compile(input4, options2) : braces.expand(input4, options2);
16101
16101
  };
16102
16102
  module.exports = braces;
16103
16103
  });
@@ -16275,26 +16275,26 @@ var require_utils2 = __commonJS((exports) => {
16275
16275
  }
16276
16276
  return win32 === true || path.sep === "\\";
16277
16277
  };
16278
- exports.escapeLast = (input3, char, lastIdx) => {
16279
- const idx = input3.lastIndexOf(char, lastIdx);
16278
+ exports.escapeLast = (input4, char, lastIdx) => {
16279
+ const idx = input4.lastIndexOf(char, lastIdx);
16280
16280
  if (idx === -1)
16281
- return input3;
16282
- if (input3[idx - 1] === "\\")
16283
- return exports.escapeLast(input3, char, idx - 1);
16284
- return `${input3.slice(0, idx)}\\${input3.slice(idx)}`;
16281
+ return input4;
16282
+ if (input4[idx - 1] === "\\")
16283
+ return exports.escapeLast(input4, char, idx - 1);
16284
+ return `${input4.slice(0, idx)}\\${input4.slice(idx)}`;
16285
16285
  };
16286
- exports.removePrefix = (input3, state = {}) => {
16287
- let output = input3;
16286
+ exports.removePrefix = (input4, state = {}) => {
16287
+ let output = input4;
16288
16288
  if (output.startsWith("./")) {
16289
16289
  output = output.slice(2);
16290
16290
  state.prefix = "./";
16291
16291
  }
16292
16292
  return output;
16293
16293
  };
16294
- exports.wrapOutput = (input3, state = {}, options2 = {}) => {
16294
+ exports.wrapOutput = (input4, state = {}, options2 = {}) => {
16295
16295
  const prepend = options2.contains ? "" : "^";
16296
16296
  const append = options2.contains ? "" : "$";
16297
- let output = `${prepend}(?:${input3})${append}`;
16297
+ let output = `${prepend}(?:${input4})${append}`;
16298
16298
  if (state.negated === true) {
16299
16299
  output = `(?:^(?!${output}).*$)`;
16300
16300
  }
@@ -16330,14 +16330,14 @@ var require_scan = __commonJS((exports, module) => {
16330
16330
  token.depth = token.isGlobstar ? Infinity : 1;
16331
16331
  }
16332
16332
  };
16333
- var scan = (input3, options2) => {
16333
+ var scan = (input4, options2) => {
16334
16334
  const opts = options2 || {};
16335
- const length = input3.length - 1;
16335
+ const length = input4.length - 1;
16336
16336
  const scanToEnd = opts.parts === true || opts.scanToEnd === true;
16337
16337
  const slashes = [];
16338
16338
  const tokens = [];
16339
16339
  const parts = [];
16340
- let str = input3;
16340
+ let str = input4;
16341
16341
  let index = -1;
16342
16342
  let start = 0;
16343
16343
  let lastIndex = 0;
@@ -16560,7 +16560,7 @@ var require_scan = __commonJS((exports, module) => {
16560
16560
  }
16561
16561
  const state = {
16562
16562
  prefix,
16563
- input: input3,
16563
+ input: input4,
16564
16564
  start,
16565
16565
  base,
16566
16566
  glob,
@@ -16584,7 +16584,7 @@ var require_scan = __commonJS((exports, module) => {
16584
16584
  for (let idx = 0;idx < slashes.length; idx++) {
16585
16585
  const n = prevIndex ? prevIndex + 1 : start;
16586
16586
  const i = slashes[idx];
16587
- const value = input3.slice(n, i);
16587
+ const value = input4.slice(n, i);
16588
16588
  if (opts.tokens) {
16589
16589
  if (idx === 0 && start !== 0) {
16590
16590
  tokens[idx].isPrefix = true;
@@ -16600,8 +16600,8 @@ var require_scan = __commonJS((exports, module) => {
16600
16600
  }
16601
16601
  prevIndex = i;
16602
16602
  }
16603
- if (prevIndex && prevIndex + 1 < input3.length) {
16604
- const value = input3.slice(prevIndex + 1);
16603
+ if (prevIndex && prevIndex + 1 < input4.length) {
16604
+ const value = input4.slice(prevIndex + 1);
16605
16605
  parts.push(value);
16606
16606
  if (opts.tokens) {
16607
16607
  tokens[tokens.length - 1].value = value;
@@ -16644,14 +16644,14 @@ var require_parse2 = __commonJS((exports, module) => {
16644
16644
  var syntaxError = (type, char) => {
16645
16645
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
16646
16646
  };
16647
- var parse2 = (input3, options2) => {
16648
- if (typeof input3 !== "string") {
16647
+ var parse2 = (input4, options2) => {
16648
+ if (typeof input4 !== "string") {
16649
16649
  throw new TypeError("Expected a string");
16650
16650
  }
16651
- input3 = REPLACEMENTS[input3] || input3;
16651
+ input4 = REPLACEMENTS[input4] || input4;
16652
16652
  const opts = { ...options2 };
16653
16653
  const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
16654
- let len = input3.length;
16654
+ let len = input4.length;
16655
16655
  if (len > max) {
16656
16656
  throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
16657
16657
  }
@@ -16688,7 +16688,7 @@ var require_parse2 = __commonJS((exports, module) => {
16688
16688
  opts.noextglob = opts.noext;
16689
16689
  }
16690
16690
  const state = {
16691
- input: input3,
16691
+ input: input4,
16692
16692
  index: -1,
16693
16693
  start: 0,
16694
16694
  dot: opts.dot === true,
@@ -16704,17 +16704,17 @@ var require_parse2 = __commonJS((exports, module) => {
16704
16704
  globstar: false,
16705
16705
  tokens
16706
16706
  };
16707
- input3 = utils.removePrefix(input3, state);
16708
- len = input3.length;
16707
+ input4 = utils.removePrefix(input4, state);
16708
+ len = input4.length;
16709
16709
  const extglobs = [];
16710
16710
  const braces = [];
16711
16711
  const stack = [];
16712
16712
  let prev = bos;
16713
16713
  let value;
16714
16714
  const eos = () => state.index === len - 1;
16715
- const peek = state.peek = (n = 1) => input3[state.index + n];
16716
- const advance = state.advance = () => input3[++state.index] || "";
16717
- const remaining = () => input3.slice(state.index + 1);
16715
+ const peek = state.peek = (n = 1) => input4[state.index + n];
16716
+ const advance = state.advance = () => input4[++state.index] || "";
16717
+ const remaining = () => input4.slice(state.index + 1);
16718
16718
  const consume = (value2 = "", num = 0) => {
16719
16719
  state.consumed += value2;
16720
16720
  state.index += num;
@@ -16804,9 +16804,9 @@ var require_parse2 = __commonJS((exports, module) => {
16804
16804
  push({ type: "paren", extglob: true, value, output });
16805
16805
  decrement("parens");
16806
16806
  };
16807
- if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input3)) {
16807
+ if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input4)) {
16808
16808
  let backslashes = false;
16809
- let output = input3.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
16809
+ let output = input4.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
16810
16810
  if (first === "\\") {
16811
16811
  backslashes = true;
16812
16812
  return m;
@@ -16840,8 +16840,8 @@ var require_parse2 = __commonJS((exports, module) => {
16840
16840
  });
16841
16841
  }
16842
16842
  }
16843
- if (output === input3 && opts.contains === true) {
16844
- state.output = input3;
16843
+ if (output === input4 && opts.contains === true) {
16844
+ state.output = input4;
16845
16845
  return state;
16846
16846
  }
16847
16847
  state.output = utils.wrapOutput(output, state, options2);
@@ -17200,7 +17200,7 @@ var require_parse2 = __commonJS((exports, module) => {
17200
17200
  continue;
17201
17201
  }
17202
17202
  while (rest.slice(0, 3) === "/**") {
17203
- const after = input3[state.index + 4];
17203
+ const after = input4[state.index + 4];
17204
17204
  if (after && after !== "/") {
17205
17205
  break;
17206
17206
  }
@@ -17323,14 +17323,14 @@ var require_parse2 = __commonJS((exports, module) => {
17323
17323
  }
17324
17324
  return state;
17325
17325
  };
17326
- parse2.fastpaths = (input3, options2) => {
17326
+ parse2.fastpaths = (input4, options2) => {
17327
17327
  const opts = { ...options2 };
17328
17328
  const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
17329
- const len = input3.length;
17329
+ const len = input4.length;
17330
17330
  if (len > max) {
17331
17331
  throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
17332
17332
  }
17333
- input3 = REPLACEMENTS[input3] || input3;
17333
+ input4 = REPLACEMENTS[input4] || input4;
17334
17334
  const win32 = utils.isWindows(options2);
17335
17335
  const {
17336
17336
  DOT_LITERAL,
@@ -17385,7 +17385,7 @@ var require_parse2 = __commonJS((exports, module) => {
17385
17385
  }
17386
17386
  }
17387
17387
  };
17388
- const output = utils.removePrefix(input3, state);
17388
+ const output = utils.removePrefix(input4, state);
17389
17389
  let source = create2(output);
17390
17390
  if (source && opts.strictSlashes !== true) {
17391
17391
  source += `${SLASH_LITERAL}?`;
@@ -17405,7 +17405,7 @@ var require_picomatch = __commonJS((exports, module) => {
17405
17405
  var isObject = (val) => val && typeof val === "object" && !Array.isArray(val);
17406
17406
  var picomatch = (glob, options2, returnState = false) => {
17407
17407
  if (Array.isArray(glob)) {
17408
- const fns = glob.map((input3) => picomatch(input3, options2, returnState));
17408
+ const fns = glob.map((input4) => picomatch(input4, options2, returnState));
17409
17409
  const arrayMatcher = (str) => {
17410
17410
  for (const isMatch of fns) {
17411
17411
  const state2 = isMatch(str);
@@ -17430,9 +17430,9 @@ var require_picomatch = __commonJS((exports, module) => {
17430
17430
  const ignoreOpts = { ...options2, ignore: null, onMatch: null, onResult: null };
17431
17431
  isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
17432
17432
  }
17433
- const matcher = (input3, returnObject = false) => {
17434
- const { isMatch, match, output } = picomatch.test(input3, regex, options2, { glob, posix });
17435
- const result = { glob, state, regex, posix, input: input3, output, match, isMatch };
17433
+ const matcher = (input4, returnObject = false) => {
17434
+ const { isMatch, match, output } = picomatch.test(input4, regex, options2, { glob, posix });
17435
+ const result = { glob, state, regex, posix, input: input4, output, match, isMatch };
17436
17436
  if (typeof opts.onResult === "function") {
17437
17437
  opts.onResult(result);
17438
17438
  }
@@ -17440,7 +17440,7 @@ var require_picomatch = __commonJS((exports, module) => {
17440
17440
  result.isMatch = false;
17441
17441
  return returnObject ? result : false;
17442
17442
  }
17443
- if (isIgnored(input3)) {
17443
+ if (isIgnored(input4)) {
17444
17444
  if (typeof opts.onIgnore === "function") {
17445
17445
  opts.onIgnore(result);
17446
17446
  }
@@ -17457,33 +17457,33 @@ var require_picomatch = __commonJS((exports, module) => {
17457
17457
  }
17458
17458
  return matcher;
17459
17459
  };
17460
- picomatch.test = (input3, regex, options2, { glob, posix } = {}) => {
17461
- if (typeof input3 !== "string") {
17460
+ picomatch.test = (input4, regex, options2, { glob, posix } = {}) => {
17461
+ if (typeof input4 !== "string") {
17462
17462
  throw new TypeError("Expected input to be a string");
17463
17463
  }
17464
- if (input3 === "") {
17464
+ if (input4 === "") {
17465
17465
  return { isMatch: false, output: "" };
17466
17466
  }
17467
17467
  const opts = options2 || {};
17468
17468
  const format = opts.format || (posix ? utils.toPosixSlashes : null);
17469
- let match = input3 === glob;
17470
- let output = match && format ? format(input3) : input3;
17469
+ let match = input4 === glob;
17470
+ let output = match && format ? format(input4) : input4;
17471
17471
  if (match === false) {
17472
- output = format ? format(input3) : input3;
17472
+ output = format ? format(input4) : input4;
17473
17473
  match = output === glob;
17474
17474
  }
17475
17475
  if (match === false || opts.capture === true) {
17476
17476
  if (opts.matchBase === true || opts.basename === true) {
17477
- match = picomatch.matchBase(input3, regex, options2, posix);
17477
+ match = picomatch.matchBase(input4, regex, options2, posix);
17478
17478
  } else {
17479
17479
  match = regex.exec(output);
17480
17480
  }
17481
17481
  }
17482
17482
  return { isMatch: Boolean(match), match, output };
17483
17483
  };
17484
- picomatch.matchBase = (input3, glob, options2, posix = utils.isWindows(options2)) => {
17484
+ picomatch.matchBase = (input4, glob, options2, posix = utils.isWindows(options2)) => {
17485
17485
  const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options2);
17486
- return regex.test(path.basename(input3));
17486
+ return regex.test(path.basename(input4));
17487
17487
  };
17488
17488
  picomatch.isMatch = (str, patterns, options2) => picomatch(patterns, options2)(str);
17489
17489
  picomatch.parse = (pattern, options2) => {
@@ -17491,7 +17491,7 @@ var require_picomatch = __commonJS((exports, module) => {
17491
17491
  return pattern.map((p) => picomatch.parse(p, options2));
17492
17492
  return parse2(pattern, { ...options2, fastpaths: false });
17493
17493
  };
17494
- picomatch.scan = (input3, options2) => scan(input3, options2);
17494
+ picomatch.scan = (input4, options2) => scan(input4, options2);
17495
17495
  picomatch.compileRe = (state, options2, returnOutput = false, returnState = false) => {
17496
17496
  if (returnOutput === true) {
17497
17497
  return state.output;
@@ -17509,16 +17509,16 @@ var require_picomatch = __commonJS((exports, module) => {
17509
17509
  }
17510
17510
  return regex;
17511
17511
  };
17512
- picomatch.makeRe = (input3, options2 = {}, returnOutput = false, returnState = false) => {
17513
- if (!input3 || typeof input3 !== "string") {
17512
+ picomatch.makeRe = (input4, options2 = {}, returnOutput = false, returnState = false) => {
17513
+ if (!input4 || typeof input4 !== "string") {
17514
17514
  throw new TypeError("Expected a non-empty string");
17515
17515
  }
17516
17516
  let parsed = { negated: false, fastpaths: true };
17517
- if (options2.fastpaths !== false && (input3[0] === "." || input3[0] === "*")) {
17518
- parsed.output = parse2.fastpaths(input3, options2);
17517
+ if (options2.fastpaths !== false && (input4[0] === "." || input4[0] === "*")) {
17518
+ parsed.output = parse2.fastpaths(input4, options2);
17519
17519
  }
17520
17520
  if (!parsed.output) {
17521
- parsed = parse2(input3, options2);
17521
+ parsed = parse2(input4, options2);
17522
17522
  }
17523
17523
  return picomatch.compileRe(parsed, options2, returnOutput, returnState);
17524
17524
  };
@@ -17664,10 +17664,10 @@ var require_micromatch = __commonJS((exports, module) => {
17664
17664
  }
17665
17665
  return [].concat(patterns).every((p) => picomatch(p, options2)(str));
17666
17666
  };
17667
- micromatch.capture = (glob, input3, options2) => {
17667
+ micromatch.capture = (glob, input4, options2) => {
17668
17668
  let posix = utils.isWindows(options2);
17669
17669
  let regex = picomatch.makeRe(String(glob), { ...options2, capture: true });
17670
- let match = regex.exec(posix ? utils.toPosixSlashes(input3) : input3);
17670
+ let match = regex.exec(posix ? utils.toPosixSlashes(input4) : input4);
17671
17671
  if (match) {
17672
17672
  return match.slice(1).map((v) => v === undefined ? "" : v);
17673
17673
  }
@@ -18002,12 +18002,12 @@ var require_stream = __commonJS((exports) => {
18002
18002
  var require_string = __commonJS((exports) => {
18003
18003
  Object.defineProperty(exports, "__esModule", { value: true });
18004
18004
  exports.isEmpty = exports.isString = undefined;
18005
- function isString(input3) {
18006
- return typeof input3 === "string";
18005
+ function isString(input4) {
18006
+ return typeof input4 === "string";
18007
18007
  }
18008
18008
  exports.isString = isString;
18009
- function isEmpty(input3) {
18010
- return input3 === "";
18009
+ function isEmpty(input4) {
18010
+ return input4 === "";
18011
18011
  }
18012
18012
  exports.isEmpty = isEmpty;
18013
18013
  });
@@ -18037,8 +18037,8 @@ var require_tasks = __commonJS((exports) => {
18037
18037
  Object.defineProperty(exports, "__esModule", { value: true });
18038
18038
  exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = undefined;
18039
18039
  var utils = require_utils3();
18040
- function generate(input3, settings) {
18041
- const patterns = processPatterns(input3, settings);
18040
+ function generate(input4, settings) {
18041
+ const patterns = processPatterns(input4, settings);
18042
18042
  const ignore = processPatterns(settings.ignore, settings);
18043
18043
  const positivePatterns = getPositivePatterns(patterns);
18044
18044
  const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
@@ -18049,8 +18049,8 @@ var require_tasks = __commonJS((exports) => {
18049
18049
  return staticTasks.concat(dynamicTasks);
18050
18050
  }
18051
18051
  exports.generate = generate;
18052
- function processPatterns(input3, settings) {
18053
- let patterns = input3;
18052
+ function processPatterns(input4, settings) {
18053
+ let patterns = input4;
18054
18054
  if (settings.braceExpansion) {
18055
18055
  patterns = utils.pattern.expandPatternsWithBraceExpansion(patterns);
18056
18056
  }
@@ -20006,8 +20006,8 @@ var require_out4 = __commonJS((exports, module) => {
20006
20006
  const provider = new _Provider(settings);
20007
20007
  return tasks.map(provider.read, provider);
20008
20008
  }
20009
- function assertPatternsInput(input3) {
20010
- const source = [].concat(input3);
20009
+ function assertPatternsInput(input4) {
20010
+ const source = [].concat(input4);
20011
20011
  const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
20012
20012
  if (!isValidSource) {
20013
20013
  throw new TypeError("Patterns must be a string (non empty) or an array of strings");
@@ -22375,10 +22375,10 @@ function requireStyle() {
22375
22375
  const c2 = requireKleur();
22376
22376
  const figures = requireFigures();
22377
22377
  const styles3 = Object.freeze({
22378
- password: { scale: 1, render: (input3) => "*".repeat(input3.length) },
22379
- emoji: { scale: 2, render: (input3) => "\uD83D\uDE03".repeat(input3.length) },
22380
- invisible: { scale: 0, render: (input3) => "" },
22381
- default: { scale: 1, render: (input3) => `${input3}` }
22378
+ password: { scale: 1, render: (input4) => "*".repeat(input4.length) },
22379
+ emoji: { scale: 2, render: (input4) => "\uD83D\uDE03".repeat(input4.length) },
22380
+ invisible: { scale: 0, render: (input4) => "" },
22381
+ default: { scale: 1, render: (input4) => `${input4}` }
22382
22382
  });
22383
22383
  const render = (type) => styles3[type] || styles3.default;
22384
22384
  const symbols = Object.freeze({
@@ -24386,7 +24386,7 @@ function requirePrompts$1() {
24386
24386
  onSubmit: toSelected
24387
24387
  });
24388
24388
  };
24389
- const byTitle = (input3, choices) => Promise.resolve(choices.filter((item) => item.title.slice(0, input3.length).toLowerCase() === input3.toLowerCase()));
24389
+ const byTitle = (input4, choices) => Promise.resolve(choices.filter((item) => item.title.slice(0, input4.length).toLowerCase() === input4.toLowerCase()));
24390
24390
  $.autocomplete = (args) => {
24391
24391
  args.suggest = args.suggest || byTitle;
24392
24392
  args.choices = [].concat(args.choices || []);
@@ -25675,12 +25675,12 @@ var init_figures = __esm(() => {
25675
25675
  import tty2 from "node:tty";
25676
25676
  var hasColors, format = (open, close) => {
25677
25677
  if (!hasColors) {
25678
- return (input3) => input3;
25678
+ return (input4) => input4;
25679
25679
  }
25680
25680
  const openCode = `\x1B[${open}m`;
25681
25681
  const closeCode = `\x1B[${close}m`;
25682
- return (input3) => {
25683
- const string = input3 + "";
25682
+ return (input4) => {
25683
+ const string = input4 + "";
25684
25684
  let index = string.indexOf(closeCode);
25685
25685
  if (index === -1) {
25686
25686
  return openCode + string + closeCode;
@@ -27789,16 +27789,16 @@ var init_options2 = __esm(() => {
27789
27789
  var concatenateShell = (file, commandArguments, options3) => options3.shell && commandArguments.length > 0 ? [[file, ...commandArguments].join(" "), [], options3] : [file, commandArguments, options3];
27790
27790
 
27791
27791
  // ../../node_modules/strip-final-newline/index.js
27792
- function stripFinalNewline(input3) {
27793
- if (typeof input3 === "string") {
27794
- return stripFinalNewlineString(input3);
27792
+ function stripFinalNewline(input4) {
27793
+ if (typeof input4 === "string") {
27794
+ return stripFinalNewlineString(input4);
27795
27795
  }
27796
- if (!(ArrayBuffer.isView(input3) && input3.BYTES_PER_ELEMENT === 1)) {
27796
+ if (!(ArrayBuffer.isView(input4) && input4.BYTES_PER_ELEMENT === 1)) {
27797
27797
  throw new Error("Input must be a string or a Uint8Array");
27798
27798
  }
27799
- return stripFinalNewlineBinary(input3);
27799
+ return stripFinalNewlineBinary(input4);
27800
27800
  }
27801
- var stripFinalNewlineString = (input3) => input3.at(-1) === LF ? input3.slice(0, input3.at(-2) === CR ? -2 : -1) : input3, stripFinalNewlineBinary = (input3) => input3.at(-1) === LF_BINARY ? input3.subarray(0, input3.at(-2) === CR_BINARY ? -2 : -1) : input3, LF = `
27801
+ var stripFinalNewlineString = (input4) => input4.at(-1) === LF ? input4.slice(0, input4.at(-2) === CR ? -2 : -1) : input4, stripFinalNewlineBinary = (input4) => input4.at(-1) === LF_BINARY ? input4.subarray(0, input4.at(-2) === CR_BINARY ? -2 : -1) : input4, LF = `
27802
27802
  `, LF_BINARY, CR = "\r", CR_BINARY;
27803
27803
  var init_strip_final_newline = __esm(() => {
27804
27804
  LF_BINARY = LF.codePointAt(0);
@@ -28837,21 +28837,21 @@ var init_native = __esm(() => {
28837
28837
  });
28838
28838
 
28839
28839
  // ../../node_modules/execa/lib/stdio/input-option.js
28840
- var handleInputOptions = ({ input: input3, inputFile }, fdNumber) => fdNumber === 0 ? [
28841
- ...handleInputOption(input3),
28840
+ var handleInputOptions = ({ input: input4, inputFile }, fdNumber) => fdNumber === 0 ? [
28841
+ ...handleInputOption(input4),
28842
28842
  ...handleInputFileOption(inputFile)
28843
- ] : [], handleInputOption = (input3) => input3 === undefined ? [] : [{
28844
- type: getInputType(input3),
28845
- value: input3,
28843
+ ] : [], handleInputOption = (input4) => input4 === undefined ? [] : [{
28844
+ type: getInputType(input4),
28845
+ value: input4,
28846
28846
  optionName: "input"
28847
- }], getInputType = (input3) => {
28848
- if (isReadableStream(input3, { checkOpen: false })) {
28847
+ }], getInputType = (input4) => {
28848
+ if (isReadableStream(input4, { checkOpen: false })) {
28849
28849
  return "nodeStream";
28850
28850
  }
28851
- if (typeof input3 === "string") {
28851
+ if (typeof input4 === "string") {
28852
28852
  return "string";
28853
28853
  }
28854
- if (isUint8Array(input3)) {
28854
+ if (isUint8Array(input4)) {
28855
28855
  return "uint8Array";
28856
28856
  }
28857
28857
  throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.");
@@ -31967,7 +31967,7 @@ var init_command2 = __esm(() => {
31967
31967
  var setScriptSync = (boundExeca, createNested, boundOptions) => {
31968
31968
  boundExeca.sync = createNested(mapScriptSync, boundOptions);
31969
31969
  boundExeca.s = boundExeca.sync;
31970
- }, mapScriptAsync = ({ options: options3 }) => getScriptOptions(options3), mapScriptSync = ({ options: options3 }) => ({ ...getScriptOptions(options3), isSync: true }), getScriptOptions = (options3) => ({ options: { ...getScriptStdinOption(options3), ...options3 } }), getScriptStdinOption = ({ input: input3, inputFile, stdio }) => input3 === undefined && inputFile === undefined && stdio === undefined ? { stdin: "inherit" } : {}, deepScriptOptions;
31970
+ }, mapScriptAsync = ({ options: options3 }) => getScriptOptions(options3), mapScriptSync = ({ options: options3 }) => ({ ...getScriptOptions(options3), isSync: true }), getScriptOptions = (options3) => ({ options: { ...getScriptStdinOption(options3), ...options3 } }), getScriptStdinOption = ({ input: input4, inputFile, stdio }) => input4 === undefined && inputFile === undefined && stdio === undefined ? { stdin: "inherit" } : {}, deepScriptOptions;
31971
31971
  var init_script = __esm(() => {
31972
31972
  deepScriptOptions = { preferLocal: true };
31973
31973
  });
@@ -32078,20 +32078,20 @@ __export(exports_generate, {
32078
32078
  import path10 from "path";
32079
32079
  import { getErrorMessage as getErrorMessage2 } from "@secondlayer/shared";
32080
32080
  import { toCamelCase as toCamelCase8 } from "@secondlayer/stacks/clarity";
32081
- function isContractAddress(input3) {
32081
+ function isContractAddress(input4) {
32082
32082
  const contractIdPattern = /^(SP|ST|SM|SN)[A-Z0-9]{38,}\.[a-zA-Z][a-zA-Z0-9-]*$/;
32083
- return contractIdPattern.test(input3);
32083
+ return contractIdPattern.test(input4);
32084
32084
  }
32085
32085
  async function parseInputs(inputs) {
32086
32086
  const files = [];
32087
32087
  const contractIds = [];
32088
- for (const input3 of inputs) {
32089
- if (isContractAddress(input3)) {
32090
- contractIds.push(input3);
32088
+ for (const input4 of inputs) {
32089
+ if (isContractAddress(input4)) {
32090
+ contractIds.push(input4);
32091
32091
  continue;
32092
32092
  }
32093
- if (input3.includes("*") || input3.includes("?")) {
32094
- const matches = await import_fast_glob.default(input3, { cwd: process.cwd(), absolute: true });
32093
+ if (input4.includes("*") || input4.includes("?")) {
32094
+ const matches = await import_fast_glob.default(input4, { cwd: process.cwd(), absolute: true });
32095
32095
  for (const file of matches) {
32096
32096
  if (file.endsWith(".clar")) {
32097
32097
  files.push(file);
@@ -32099,8 +32099,8 @@ async function parseInputs(inputs) {
32099
32099
  }
32100
32100
  continue;
32101
32101
  }
32102
- if (input3.endsWith(".clar")) {
32103
- const absolutePath = path10.resolve(process.cwd(), input3);
32102
+ if (input4.endsWith(".clar")) {
32103
+ const absolutePath = path10.resolve(process.cwd(), input4);
32104
32104
  files.push(absolutePath);
32105
32105
  }
32106
32106
  }
@@ -32383,7 +32383,7 @@ var {
32383
32383
  // package.json
32384
32384
  var package_default = {
32385
32385
  name: "@secondlayer/cli",
32386
- version: "2.0.0",
32386
+ version: "2.2.0",
32387
32387
  description: "CLI for subgraphs and blockchain indexing on Stacks",
32388
32388
  type: "module",
32389
32389
  bin: {
@@ -32424,12 +32424,12 @@ var package_default = {
32424
32424
  license: "MIT",
32425
32425
  dependencies: {
32426
32426
  "@inquirer/prompts": "^8.2.0",
32427
- "@secondlayer/bundler": "^0.2.0",
32427
+ "@secondlayer/bundler": "^0.3.0",
32428
32428
  "@secondlayer/sdk": "^1.0.0",
32429
- "@secondlayer/shared": "^1.0.0",
32430
- "@secondlayer/stacks": "^0.2.2",
32431
- "@secondlayer/subgraphs": "^0.11.6",
32432
- "@secondlayer/workflows": "^1.0.0",
32429
+ "@secondlayer/shared": "^1.1.0",
32430
+ "@secondlayer/stacks": "^0.3.0",
32431
+ "@secondlayer/subgraphs": "^0.11.7",
32432
+ "@secondlayer/workflows": "^1.1.0",
32433
32433
  "@biomejs/js-api": "^0.7.0",
32434
32434
  "@biomejs/wasm-nodejs": "^1.9.0",
32435
32435
  esbuild: "^0.19.0",
@@ -35381,6 +35381,97 @@ Endpoints:`));
35381
35381
  }
35382
35382
  });
35383
35383
  }
35384
+ // src/commands/secrets.ts
35385
+ init_api_client();
35386
+ init_config();
35387
+ init_output();
35388
+ import { input as input3, password } from "@inquirer/prompts";
35389
+ function registerSecretsCommand(program2) {
35390
+ const secrets = program2.command("secrets").description("Manage workflow signer secrets (HMAC shared secrets for Remote Signer)");
35391
+ secrets.command("list").description("List secret names for the authenticated account").action(async () => {
35392
+ const { apiUrl, headers } = await apiContext();
35393
+ const res = await fetch(`${apiUrl}/api/secrets`, { headers });
35394
+ await assertOk(res);
35395
+ const { secrets: rows } = await res.json();
35396
+ if (rows.length === 0) {
35397
+ dim("No secrets set. Add one with: sl secrets set <name> <value>");
35398
+ return;
35399
+ }
35400
+ const table = formatTable(["Name", "Created", "Updated"], rows.map((r) => [
35401
+ r.name,
35402
+ new Date(r.createdAt).toLocaleString(),
35403
+ new Date(r.updatedAt).toLocaleString()
35404
+ ]));
35405
+ console.log(table);
35406
+ });
35407
+ secrets.command("set <name> [value]").description("Set or rotate a secret. If value is omitted, reads from stdin prompt.").action(async (name, value) => {
35408
+ const resolved = value ?? await password({ message: `Value for "${name}":`, mask: true });
35409
+ if (!resolved) {
35410
+ error("Value cannot be empty");
35411
+ process.exit(1);
35412
+ }
35413
+ const { apiUrl, headers } = await apiContext();
35414
+ const res = await fetch(`${apiUrl}/api/secrets/${encodeURIComponent(name)}`, {
35415
+ method: "PUT",
35416
+ headers: { ...headers, "Content-Type": "application/json" },
35417
+ body: JSON.stringify({ value: resolved })
35418
+ });
35419
+ await assertOk(res);
35420
+ success(`Secret "${name}" set`);
35421
+ console.log(formatKeyValue([
35422
+ ["name", name],
35423
+ ["action", "upsert"]
35424
+ ]));
35425
+ });
35426
+ secrets.command("rotate <name>").description("Rotate a secret (prompts for new value, replaces existing)").action(async (name) => {
35427
+ const next = await password({
35428
+ message: `New value for "${name}":`,
35429
+ mask: true
35430
+ });
35431
+ if (!next) {
35432
+ error("Value cannot be empty");
35433
+ process.exit(1);
35434
+ }
35435
+ const confirmed = await input3({
35436
+ message: `Type "${name}" to confirm rotation:`
35437
+ });
35438
+ if (confirmed !== name) {
35439
+ error("Confirmation mismatch — aborting");
35440
+ process.exit(1);
35441
+ }
35442
+ const { apiUrl, headers } = await apiContext();
35443
+ const res = await fetch(`${apiUrl}/api/secrets/${encodeURIComponent(name)}`, {
35444
+ method: "PUT",
35445
+ headers: { ...headers, "Content-Type": "application/json" },
35446
+ body: JSON.stringify({ value: next })
35447
+ });
35448
+ await assertOk(res);
35449
+ success(`Secret "${name}" rotated`);
35450
+ dim("Workflows using this secret will pick it up within 5 minutes.");
35451
+ });
35452
+ secrets.command("delete <name>").description("Delete a secret").action(async (name) => {
35453
+ const confirmed = await input3({
35454
+ message: `Type "${name}" to confirm deletion:`
35455
+ });
35456
+ if (confirmed !== name) {
35457
+ error("Confirmation mismatch — aborting");
35458
+ process.exit(1);
35459
+ }
35460
+ const { apiUrl, headers } = await apiContext();
35461
+ const res = await fetch(`${apiUrl}/api/secrets/${encodeURIComponent(name)}`, { method: "DELETE", headers });
35462
+ await assertOk(res);
35463
+ success(`Secret "${name}" deleted`);
35464
+ });
35465
+ }
35466
+ async function apiContext() {
35467
+ const config = await loadConfig();
35468
+ const apiUrl = resolveApiUrl(config);
35469
+ if (!apiUrl) {
35470
+ error("No API URL configured. Set network with: sl config set network testnet");
35471
+ process.exit(1);
35472
+ }
35473
+ return { apiUrl, headers: authHeaders(config) };
35474
+ }
35384
35475
  // src/commands/whoami.ts
35385
35476
  init_api_client();
35386
35477
  init_config();
@@ -35558,8 +35649,8 @@ ${items.length} workflow(s) total`));
35558
35649
  });
35559
35650
  workflows.command("trigger <name>").description("Trigger a workflow run").option("--input <json>", "Input JSON string").action(async (name, options2) => {
35560
35651
  try {
35561
- const input3 = options2.input ? JSON.parse(options2.input) : undefined;
35562
- const result = await getClient2().workflows.trigger(name, input3);
35652
+ const input4 = options2.input ? JSON.parse(options2.input) : undefined;
35653
+ const result = await getClient2().workflows.trigger(name, input4);
35563
35654
  success(`Triggered workflow "${name}"`);
35564
35655
  info(`Run ID: ${result.runId}`);
35565
35656
  } catch (err) {
@@ -35662,6 +35753,7 @@ program.command("init").description("Initialize a new secondlayer.config.ts file
35662
35753
  });
35663
35754
  registerSubgraphsCommand(program);
35664
35755
  registerWorkflowsCommand(program);
35756
+ registerSecretsCommand(program);
35665
35757
  registerMarketplaceCommand(program);
35666
35758
  registerStatusCommand(program);
35667
35759
  registerLocalCommand(program);
@@ -35675,5 +35767,5 @@ registerAuthCommand(program);
35675
35767
  registerWhoamiCommand(program);
35676
35768
  program.parse();
35677
35769
 
35678
- //# debugId=4C1634EBC4C4A9EE64756E2164756E21
35770
+ //# debugId=217C08CACE85108C64756E2164756E21
35679
35771
  //# sourceMappingURL=cli.js.map