claude-warden 2.0.1 → 2.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -166,9 +166,9 @@ var require_compose_function = __commonJS({
166
166
  }
167
167
  });
168
168
 
169
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/shell-lexer.js
169
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/shell-lexer.js
170
170
  var require_shell_lexer = __commonJS({
171
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/shell-lexer.js"(exports2, module2) {
171
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/shell-lexer.js"(exports2, module2) {
172
172
  "use strict";
173
173
  var compose = require_compose_function();
174
174
  var posixShellLexer = (mode, options) => ({
@@ -220,9 +220,9 @@ var require_shell_lexer = __commonJS({
220
220
  }
221
221
  });
222
222
 
223
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/logger-phase.js
223
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/logger-phase.js
224
224
  var require_logger_phase = __commonJS({
225
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/logger-phase.js"(exports2, module2) {
225
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/logger-phase.js"(exports2, module2) {
226
226
  "use strict";
227
227
  var logger = (name) => () => function* (tokens) {
228
228
  for (const tk of tokens) {
@@ -273,9 +273,9 @@ var require_filter_obj = __commonJS({
273
273
  }
274
274
  });
275
275
 
276
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/operators.js
276
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/operators.js
277
277
  var require_operators = __commonJS({
278
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/operators.js"(exports2, module2) {
278
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/operators.js"(exports2, module2) {
279
279
  "use strict";
280
280
  var operators = {
281
281
  "&": "AND",
@@ -300,9 +300,9 @@ var require_operators = __commonJS({
300
300
  }
301
301
  });
302
302
 
303
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/tokens.js
303
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/tokens.js
304
304
  var require_tokens = __commonJS({
305
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/tokens.js"(exports2) {
305
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/tokens.js"(exports2) {
306
306
  "use strict";
307
307
  var hasOwnProperty = require_has_own_property();
308
308
  var filter = require_filter_obj();
@@ -340,7 +340,7 @@ var require_tokens = __commonJS({
340
340
  exports2.token = (args2) => new Token(args2);
341
341
  function mkToken(type, value, loc, expansion) {
342
342
  const tk = new Token({ type, value, loc });
343
- if (expansion && expansion.length) {
343
+ if (expansion && expansion.length > 0) {
344
344
  tk.expansion = expansion;
345
345
  }
346
346
  return tk;
@@ -366,12 +366,15 @@ var require_tokens = __commonJS({
366
366
  exports2.setExpansions = (tk, expansion) => tk.setExpansions(expansion);
367
367
  exports2.tokenOrEmpty = function tokenOrEmpty(state) {
368
368
  if (state.current !== "" && state.current !== "\n") {
369
- const expansion = (state.expansion || []).map((xp) => {
370
- return Object.assign({}, xp, { loc: {
371
- start: xp.loc.start.char - state.loc.start.char,
372
- end: xp.loc.end.char - state.loc.start.char
373
- } });
374
- });
369
+ const expansion = (state.expansion || []).map(
370
+ (xp) => (
371
+ // console.log('aaa', {token: state.loc, xp: xp.loc});
372
+ Object.assign({}, xp, { loc: {
373
+ start: xp.loc.start.char - state.loc.start.char,
374
+ end: xp.loc.end.char - state.loc.start.char
375
+ } })
376
+ )
377
+ );
375
378
  const token = mkToken("TOKEN", state.current, {
376
379
  start: Object.assign({}, state.loc.start),
377
380
  end: Object.assign({}, state.loc.previous)
@@ -420,12 +423,12 @@ var require_tokens = __commonJS({
420
423
  }
421
424
  });
422
425
 
423
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/is-valid-name.js
426
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/is-valid-name.js
424
427
  var require_is_valid_name = __commonJS({
425
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/is-valid-name.js"(exports2, module2) {
428
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/is-valid-name.js"(exports2, module2) {
426
429
  "use strict";
427
430
  module2.exports = function isValidName(text) {
428
- return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(text);
431
+ return /^[a-zA-Z_]\w*$/.test(text);
429
432
  };
430
433
  }
431
434
  });
@@ -554,9 +557,9 @@ var require_iterable_transform_replace = __commonJS({
554
557
  }
555
558
  });
556
559
 
557
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/index.js
560
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/index.js
558
561
  var require_utils = __commonJS({
559
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/index.js"(exports2) {
562
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/index.js"(exports2) {
560
563
  "use strict";
561
564
  exports2.loggerPhase = require_logger_phase();
562
565
  exports2.tokens = require_tokens();
@@ -655,9 +658,9 @@ var require_transform_spread_iterable = __commonJS({
655
658
  }
656
659
  });
657
660
 
658
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/bash/rules/alias-substitution.js
661
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/bash/rules/alias-substitution.js
659
662
  var require_alias_substitution = __commonJS({
660
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/bash/rules/alias-substitution.js"(exports2, module2) {
663
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/bash/rules/alias-substitution.js"(exports2, module2) {
661
664
  "use strict";
662
665
  var compose = require_compose_function();
663
666
  var identity = require_identity_function();
@@ -667,7 +670,7 @@ var require_alias_substitution = __commonJS({
667
670
  var tokens = require_tokens();
668
671
  var expandAlias = (preAliasLexer, resolveAlias, reservedWords) => {
669
672
  function* tryExpandToken(token, expandingAliases) {
670
- if (expandingAliases.indexOf(token.value) !== -1) {
673
+ if (expandingAliases.includes(token.value)) {
671
674
  yield token;
672
675
  return;
673
676
  }
@@ -693,9 +696,9 @@ var require_alias_substitution = __commonJS({
693
696
  const visitor = {
694
697
  WORD: expandToken
695
698
  };
696
- reservedWords.forEach((w) => {
699
+ for (const w of reservedWords) {
697
700
  visitor[w] = expandToken;
698
- });
701
+ }
699
702
  return visitor;
700
703
  };
701
704
  module2.exports = (options, mode, previousPhases) => {
@@ -714,9 +717,9 @@ var require_alias_substitution = __commonJS({
714
717
  }
715
718
  });
716
719
 
717
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/bash/index.js
720
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/bash/index.js
718
721
  var require_bash = __commonJS({
719
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/bash/index.js"(exports2, module2) {
722
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/bash/index.js"(exports2, module2) {
720
723
  "use strict";
721
724
  var bashAliasSubstitution = require_alias_substitution();
722
725
  var name = "[a-zA-Z_][a-zA-Z0-9_]*";
@@ -727,8 +730,8 @@ var require_bash = __commonJS({
727
730
  [`^(${name}):([^:]*):?([^:]*)$`]: {
728
731
  op: "substring",
729
732
  parameter: (m) => m[1],
730
- offset: (m) => parseInt(m[2], 10),
731
- length: (m) => parseInt(m[3], 10) || void 0
733
+ offset: (m) => Number.parseInt(m[2], 10),
734
+ length: (m) => Number.parseInt(m[3], 10) || void 0
732
735
  },
733
736
  // Expands to the names of variables whose names begin with prefix,
734
737
  // separated by the first character of the IFS special variable.
@@ -806,18 +809,24 @@ var require_bash = __commonJS({
806
809
  parameter: (m) => m[1],
807
810
  kind: (m) => {
808
811
  switch (m[2]) {
809
- case "Q":
812
+ case "Q": {
810
813
  return "quoted";
811
- case "E":
814
+ }
815
+ case "E": {
812
816
  return "escape";
813
- case "P":
817
+ }
818
+ case "P": {
814
819
  return "prompt";
815
- case "A":
820
+ }
821
+ case "A": {
816
822
  return "assignment";
817
- case "a":
823
+ }
824
+ case "a": {
818
825
  return "flags";
819
- default:
826
+ }
827
+ default: {
820
828
  return "unknown";
829
+ }
821
830
  }
822
831
  }
823
832
  },
@@ -830,7 +839,7 @@ var require_bash = __commonJS({
830
839
  // performing the complete indirect expansion. The exceptions to this are the expansions
831
840
  // of ${!prefix*} and ${!name[@]} described below. The exclamation point must immediately
832
841
  // follow the left brace in order to introduce indirection.
833
- [`^!(.+)$`]: {
842
+ "^!(.+)$": {
834
843
  op: "indirection",
835
844
  word: (m) => m[1],
836
845
  parameter: () => void 0
@@ -910,9 +919,9 @@ var require_array_last = __commonJS({
910
919
  }
911
920
  });
912
921
 
913
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/ast-builder.js
922
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/ast-builder.js
914
923
  var require_ast_builder = __commonJS({
915
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/ast-builder.js"(exports2, module2) {
924
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/ast-builder.js"(exports2, module2) {
916
925
  "use strict";
917
926
  module2.exports = (options) => {
918
927
  const builder = {};
@@ -959,7 +968,7 @@ var require_ast_builder = __commonJS({
959
968
  return node;
960
969
  };
961
970
  function isAsyncSeparator(separator) {
962
- return separator.text.indexOf("&") !== -1;
971
+ return separator.text.includes("&");
963
972
  }
964
973
  const last = require_array_last();
965
974
  builder.checkAsync = (list, separator) => {
@@ -981,7 +990,7 @@ var require_ast_builder = __commonJS({
981
990
  builder.addRedirections = (compoundCommand, redirectList) => {
982
991
  compoundCommand.redirections = redirectList;
983
992
  if (options.insertLOC) {
984
- const lastRedirect = redirectList[redirectList.length - 1];
993
+ const lastRedirect = redirectList.at(-1);
985
994
  setLocEnd(compoundCommand.loc, lastRedirect.loc);
986
995
  }
987
996
  return compoundCommand;
@@ -1123,12 +1132,12 @@ var require_ast_builder = __commonJS({
1123
1132
  node.loc.start = command.loc.start;
1124
1133
  }
1125
1134
  if (suffix) {
1126
- const lastSuffix = suffix[suffix.length - 1];
1135
+ const lastSuffix = suffix.at(-1);
1127
1136
  node.loc.end = lastSuffix.loc.end;
1128
1137
  } else if (command) {
1129
1138
  node.loc.end = command.loc.end;
1130
1139
  } else {
1131
- const lastPrefix = prefix[prefix.length - 1];
1140
+ const lastPrefix = prefix.at(-1);
1132
1141
  node.loc.end = lastPrefix.loc.end;
1133
1142
  }
1134
1143
  }
@@ -1169,9 +1178,7 @@ var require_ast_builder = __commonJS({
1169
1178
  return target;
1170
1179
  }
1171
1180
  function mkListHelper(builder, listName) {
1172
- builder[listName] = (item) => {
1173
- return [item];
1174
- };
1181
+ builder[listName] = (item) => [item];
1175
1182
  builder[`${listName}Append`] = (list, item) => {
1176
1183
  list.push(item);
1177
1184
  return list;
@@ -1196,9 +1203,9 @@ var require_deep_freeze = __commonJS({
1196
1203
  }
1197
1204
  });
1198
1205
 
1199
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/end.js
1206
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/end.js
1200
1207
  var require_end = __commonJS({
1201
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/end.js"(exports2, module2) {
1208
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/end.js"(exports2, module2) {
1202
1209
  "use strict";
1203
1210
  var eof = require_tokens().eof;
1204
1211
  module2.exports = function end() {
@@ -1210,9 +1217,9 @@ var require_end = __commonJS({
1210
1217
  }
1211
1218
  });
1212
1219
 
1213
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/operator.js
1220
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/operator.js
1214
1221
  var require_operator = __commonJS({
1215
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/operator.js"(exports2, module2) {
1222
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/operator.js"(exports2, module2) {
1216
1223
  "use strict";
1217
1224
  var t = require_tokens();
1218
1225
  var isPartOfOperator = t.isPartOfOperator;
@@ -1257,9 +1264,9 @@ var require_operator = __commonJS({
1257
1264
  }
1258
1265
  });
1259
1266
 
1260
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/comment.js
1267
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/comment.js
1261
1268
  var require_comment = __commonJS({
1262
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/comment.js"(exports2, module2) {
1269
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/comment.js"(exports2, module2) {
1263
1270
  "use strict";
1264
1271
  var newLine = require_tokens().newLine;
1265
1272
  module2.exports = function comment(state, source, reducers) {
@@ -1285,9 +1292,9 @@ var require_comment = __commonJS({
1285
1292
  }
1286
1293
  });
1287
1294
 
1288
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/single-quoting.js
1295
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/single-quoting.js
1289
1296
  var require_single_quoting = __commonJS({
1290
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/single-quoting.js"(exports2, module2) {
1297
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/single-quoting.js"(exports2, module2) {
1291
1298
  "use strict";
1292
1299
  var t = require_tokens();
1293
1300
  var tokenOrEmpty = t.tokenOrEmpty;
@@ -1315,9 +1322,9 @@ var require_single_quoting = __commonJS({
1315
1322
  }
1316
1323
  });
1317
1324
 
1318
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/double-quoting.js
1325
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/double-quoting.js
1319
1326
  var require_double_quoting = __commonJS({
1320
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/double-quoting.js"(exports2, module2) {
1327
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/double-quoting.js"(exports2, module2) {
1321
1328
  "use strict";
1322
1329
  var t = require_tokens();
1323
1330
  var tokenOrEmpty = t.tokenOrEmpty;
@@ -1364,12 +1371,12 @@ var require_double_quoting = __commonJS({
1364
1371
  }
1365
1372
  });
1366
1373
 
1367
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-start.js
1374
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-start.js
1368
1375
  var require_expansion_start = __commonJS({
1369
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-start.js"(exports2, module2) {
1376
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-start.js"(exports2, module2) {
1370
1377
  "use strict";
1371
1378
  function isSpecialParameter(char) {
1372
- return char.match(/^[0-9\-!@#\?\*\$]$/);
1379
+ return char.match(/^[\d\-!@#?*$]$/);
1373
1380
  }
1374
1381
  module2.exports = function expansionStart(state, source, reducers) {
1375
1382
  const char = source && source.shift();
@@ -1385,7 +1392,7 @@ var require_expansion_start = __commonJS({
1385
1392
  nextState: state.appendChar(char)
1386
1393
  };
1387
1394
  }
1388
- if (char.match(/[a-zA-Z_]/)) {
1395
+ if (/[a-zA-Z_]/.test(char)) {
1389
1396
  return {
1390
1397
  nextReduction: reducers.expansionParameter,
1391
1398
  nextState: state.appendChar(char).replaceLastExpansion({
@@ -1395,16 +1402,17 @@ var require_expansion_start = __commonJS({
1395
1402
  };
1396
1403
  }
1397
1404
  if (isSpecialParameter(char)) {
1398
- return reducers.expansionSpecialParameter(state, [char].concat(source));
1405
+ return reducers.expansionSpecialParameter(state, [char].concat(source), reducers);
1399
1406
  }
1400
- return state.previousReducer(state, [char].concat(source));
1407
+ const cleanState = state.removeLastExpansion();
1408
+ return cleanState.previousReducer(cleanState, [char].concat(source), reducers);
1401
1409
  };
1402
1410
  }
1403
1411
  });
1404
1412
 
1405
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-command-tick.js
1413
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-command-tick.js
1406
1414
  var require_expansion_command_tick = __commonJS({
1407
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-command-tick.js"(exports2, module2) {
1415
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-command-tick.js"(exports2, module2) {
1408
1416
  "use strict";
1409
1417
  var last = require_array_last();
1410
1418
  var t = require_tokens();
@@ -1444,9 +1452,9 @@ var require_expansion_command_tick = __commonJS({
1444
1452
  }
1445
1453
  });
1446
1454
 
1447
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/start.js
1455
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/start.js
1448
1456
  var require_start = __commonJS({
1449
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/start.js"(exports2, module2) {
1457
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/start.js"(exports2, module2) {
1450
1458
  "use strict";
1451
1459
  var t = require_tokens();
1452
1460
  var tokenOrEmpty = t.tokenOrEmpty;
@@ -1504,7 +1512,7 @@ var require_start = __commonJS({
1504
1512
  nextState: state.appendChar(char)
1505
1513
  };
1506
1514
  }
1507
- if (!state.escaping && char.match(/\s/)) {
1515
+ if (!state.escaping && /\s/.test(char)) {
1508
1516
  return {
1509
1517
  nextReduction: reducers.start,
1510
1518
  tokensToEmit: tokenOrEmpty(state),
@@ -1531,9 +1539,9 @@ var require_start = __commonJS({
1531
1539
  }
1532
1540
  });
1533
1541
 
1534
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-arithmetic.js
1542
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-arithmetic.js
1535
1543
  var require_expansion_arithmetic = __commonJS({
1536
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-arithmetic.js"(exports2, module2) {
1544
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-arithmetic.js"(exports2, module2) {
1537
1545
  "use strict";
1538
1546
  var last = require_array_last();
1539
1547
  var t = require_tokens();
@@ -1541,7 +1549,7 @@ var require_expansion_arithmetic = __commonJS({
1541
1549
  module2.exports = function expansionArithmetic(state, source) {
1542
1550
  const char = source && source.shift();
1543
1551
  const xp = last(state.expansion);
1544
- if (char === ")" && state.current.slice(-1)[0] === ")") {
1552
+ if (char === ")" && state.current.at(-1) === ")") {
1545
1553
  return {
1546
1554
  nextReduction: state.previousReducer,
1547
1555
  nextState: state.appendChar(char).replaceLastExpansion({
@@ -1568,12 +1576,12 @@ var require_expansion_arithmetic = __commonJS({
1568
1576
  }
1569
1577
  });
1570
1578
 
1571
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-special-parameter.js
1579
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-special-parameter.js
1572
1580
  var require_expansion_special_parameter = __commonJS({
1573
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-special-parameter.js"(exports2, module2) {
1581
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-special-parameter.js"(exports2, module2) {
1574
1582
  "use strict";
1575
1583
  var last = require_array_last();
1576
- module2.exports = function expansionSpecialParameter(state, source) {
1584
+ module2.exports = function expansionSpecialParameter(state, source, _reducers) {
1577
1585
  const char = source && source.shift();
1578
1586
  const xp = last(state.expansion);
1579
1587
  return {
@@ -1588,9 +1596,9 @@ var require_expansion_special_parameter = __commonJS({
1588
1596
  }
1589
1597
  });
1590
1598
 
1591
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-parameter.js
1599
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-parameter.js
1592
1600
  var require_expansion_parameter = __commonJS({
1593
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-parameter.js"(exports2, module2) {
1601
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-parameter.js"(exports2, module2) {
1594
1602
  "use strict";
1595
1603
  var last = require_array_last();
1596
1604
  module2.exports = function expansionParameter(state, source, reducers) {
@@ -1604,7 +1612,7 @@ var require_expansion_parameter = __commonJS({
1604
1612
  })
1605
1613
  };
1606
1614
  }
1607
- if (char.match(/[0-9a-zA-Z_]/)) {
1615
+ if (/\w/.test(char)) {
1608
1616
  return {
1609
1617
  nextReduction: reducers.expansionParameter,
1610
1618
  nextState: state.appendChar(char).replaceLastExpansion({
@@ -1621,9 +1629,9 @@ var require_expansion_parameter = __commonJS({
1621
1629
  }
1622
1630
  });
1623
1631
 
1624
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-command-or-arithmetic.js
1632
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-command-or-arithmetic.js
1625
1633
  var require_expansion_command_or_arithmetic = __commonJS({
1626
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-command-or-arithmetic.js"(exports2, module2) {
1634
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-command-or-arithmetic.js"(exports2, module2) {
1627
1635
  "use strict";
1628
1636
  var last = require_array_last();
1629
1637
  var t = require_tokens();
@@ -1665,9 +1673,9 @@ var require_expansion_command_or_arithmetic = __commonJS({
1665
1673
  }
1666
1674
  });
1667
1675
 
1668
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-parameter-extended.js
1676
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-parameter-extended.js
1669
1677
  var require_expansion_parameter_extended = __commonJS({
1670
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/expansion-parameter-extended.js"(exports2, module2) {
1678
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/expansion-parameter-extended.js"(exports2, module2) {
1671
1679
  "use strict";
1672
1680
  var last = require_array_last();
1673
1681
  var t = require_tokens();
@@ -1701,9 +1709,9 @@ var require_expansion_parameter_extended = __commonJS({
1701
1709
  }
1702
1710
  });
1703
1711
 
1704
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/index.js
1712
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/index.js
1705
1713
  var require_reducers = __commonJS({
1706
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/reducers/index.js"(exports2, module2) {
1714
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/reducers/index.js"(exports2, module2) {
1707
1715
  "use strict";
1708
1716
  var end = require_end();
1709
1717
  var operator = require_operator();
@@ -1736,9 +1744,9 @@ var require_reducers = __commonJS({
1736
1744
  }
1737
1745
  });
1738
1746
 
1739
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/index.js
1747
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/index.js
1740
1748
  var require_tokenizer = __commonJS({
1741
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/tokenizer/index.js"(exports2, module2) {
1749
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/tokenizer/index.js"(exports2, module2) {
1742
1750
  "use strict";
1743
1751
  var deepFreeze = require_deep_freeze();
1744
1752
  var last = require_array_last();
@@ -1778,6 +1786,9 @@ var require_tokenizer = __commonJS({
1778
1786
  });
1779
1787
  return this.setExpansion(expansion);
1780
1788
  }
1789
+ removeLastExpansion() {
1790
+ return this.setExpansion((this.expansion || []).slice(0, -1));
1791
+ }
1781
1792
  appendChar(char) {
1782
1793
  return new ImmutableState(Object.assign({}, this, { current: this.current + char }));
1783
1794
  }
@@ -1806,7 +1817,7 @@ var require_tokenizer = __commonJS({
1806
1817
  loc.current.col++;
1807
1818
  }
1808
1819
  loc.current.char++;
1809
- if (char && char.match(/\s/) && this.current === "") {
1820
+ if (char && /\s/.test(char) && this.current === "") {
1810
1821
  loc.start = Object.assign({}, loc.current);
1811
1822
  }
1812
1823
  return this.setLoc(loc);
@@ -1843,8 +1854,12 @@ var require_tokenizer = __commonJS({
1843
1854
  });
1844
1855
  return this;
1845
1856
  }
1857
+ removeLastExpansion() {
1858
+ this.expansion = (this.expansion || []).slice(0, -1);
1859
+ return this;
1860
+ }
1846
1861
  appendChar(char) {
1847
- this.current = this.current + char;
1862
+ this.current += char;
1848
1863
  return this;
1849
1864
  }
1850
1865
  removeLastChar() {
@@ -1879,7 +1894,7 @@ var require_tokenizer = __commonJS({
1879
1894
  loc.current.col++;
1880
1895
  }
1881
1896
  loc.current.char++;
1882
- if (char && char.match(/\s/) && this.current === "") {
1897
+ if (char && /\s/.test(char) && this.current === "") {
1883
1898
  loc.start = Object.assign({}, loc.current);
1884
1899
  }
1885
1900
  return this.setLoc(loc);
@@ -1900,11 +1915,7 @@ var require_tokenizer = __commonJS({
1900
1915
  if (tokensToEmit) {
1901
1916
  yield* tokensToEmit;
1902
1917
  }
1903
- if (nextState) {
1904
- state = nextState.advanceLoc(char);
1905
- } else {
1906
- state = state.advanceLoc(char);
1907
- }
1918
+ state = nextState ? nextState.advanceLoc(char) : state.advanceLoc(char);
1908
1919
  reduction = nextReduction;
1909
1920
  }
1910
1921
  };
@@ -2899,9 +2910,9 @@ var init_magic_string_es6 = __esm({
2899
2910
  }
2900
2911
  });
2901
2912
 
2902
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/field-splitting.js
2913
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/field-splitting.js
2903
2914
  var require_field_splitting = __commonJS({
2904
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/field-splitting.js"(exports2) {
2915
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/field-splitting.js"(exports2) {
2905
2916
  "use strict";
2906
2917
  var map = require_map_iterable();
2907
2918
  var merge = require_transform_spread_iterable();
@@ -2911,7 +2922,7 @@ var require_field_splitting = __commonJS({
2911
2922
  if (typeof options.resolveEnv === "function" && text[0] !== "'" && text[0] !== '"') {
2912
2923
  const ifs = options.resolveEnv("IFS");
2913
2924
  if (ifs !== null) {
2914
- return result.replace(new RegExp(`[${ifs}]+`, "g"), "\0");
2925
+ return result.replaceAll(new RegExp(`[${ifs}]+`, "g"), "\0");
2915
2926
  }
2916
2927
  }
2917
2928
  return result;
@@ -2934,9 +2945,9 @@ var require_field_splitting = __commonJS({
2934
2945
  }
2935
2946
  });
2936
2947
 
2937
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/parameter-expansion.js
2948
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/parameter-expansion.js
2938
2949
  var require_parameter_expansion = __commonJS({
2939
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/parameter-expansion.js"(exports2, module2) {
2950
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/parameter-expansion.js"(exports2, module2) {
2940
2951
  "use strict";
2941
2952
  var mapObj = require_map_obj();
2942
2953
  var filter = require_filter_obj();
@@ -2967,7 +2978,7 @@ var require_parameter_expansion = __commonJS({
2967
2978
  return ret;
2968
2979
  };
2969
2980
  function expandParameter(xp, enums) {
2970
- let parameter = xp.parameter;
2981
+ const parameter = xp.parameter;
2971
2982
  for (const pair of pairs(enums.parameterOperators)) {
2972
2983
  const re = new RegExp(pair[0]);
2973
2984
  const match = parameter.match(re);
@@ -3021,9 +3032,9 @@ var require_parameter_expansion = __commonJS({
3021
3032
  }
3022
3033
  });
3023
3034
 
3024
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/command-expansion.js
3035
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/command-expansion.js
3025
3036
  var require_command_expansion = __commonJS({
3026
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/command-expansion.js"(exports2, module2) {
3037
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/command-expansion.js"(exports2, module2) {
3027
3038
  "use strict";
3028
3039
  var map = require_map_iterable();
3029
3040
  var MagicString2 = (init_magic_string_es6(), __toCommonJS(magic_string_es6_exports));
@@ -3032,7 +3043,7 @@ var require_command_expansion = __commonJS({
3032
3043
  function setCommandExpansion(xp, token) {
3033
3044
  let command = xp.command;
3034
3045
  if (token.value[xp.loc.start - 1] === "`") {
3035
- command = command.replace(/\\`/g, "`");
3046
+ command = command.replaceAll("\\`", "`");
3036
3047
  }
3037
3048
  const bashParser = require_src();
3038
3049
  const commandAST = bashParser(command);
@@ -8656,9 +8667,9 @@ var require_lib = __commonJS({
8656
8667
  }
8657
8668
  });
8658
8669
 
8659
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/arithmetic-expansion.js
8670
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/arithmetic-expansion.js
8660
8671
  var require_arithmetic_expansion = __commonJS({
8661
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/arithmetic-expansion.js"(exports2, module2) {
8672
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/arithmetic-expansion.js"(exports2, module2) {
8662
8673
  "use strict";
8663
8674
  var map = require_map_iterable();
8664
8675
  var babylon = require_lib();
@@ -8669,8 +8680,8 @@ var require_arithmetic_expansion = __commonJS({
8669
8680
  let AST;
8670
8681
  try {
8671
8682
  AST = babylon.parse(xp.expression);
8672
- } catch (err) {
8673
- throw new SyntaxError(`Cannot parse arithmetic expression "${xp.expression}": ${err.message}`);
8683
+ } catch (error) {
8684
+ throw new SyntaxError(`Cannot parse arithmetic expression "${xp.expression}": ${error.message}`);
8674
8685
  }
8675
8686
  const expression = AST.program.body[0].expression;
8676
8687
  if (expression === void 0) {
@@ -8715,9 +8726,9 @@ var require_arithmetic_expansion = __commonJS({
8715
8726
  }
8716
8727
  });
8717
8728
 
8718
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/alias-substitution.js
8729
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/alias-substitution.js
8719
8730
  var require_alias_substitution2 = __commonJS({
8720
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/alias-substitution.js"(exports2, module2) {
8731
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/alias-substitution.js"(exports2, module2) {
8721
8732
  "use strict";
8722
8733
  var compose = require_compose_function();
8723
8734
  var identity = require_identity_function();
@@ -8726,7 +8737,7 @@ var require_alias_substitution2 = __commonJS({
8726
8737
  var tokens = require_tokens();
8727
8738
  var expandAlias = (preAliasLexer, resolveAlias) => {
8728
8739
  function* tryExpandToken(token, expandingAliases) {
8729
- if (expandingAliases.indexOf(token.value) !== -1 || !token._.maybeSimpleCommandName) {
8740
+ if (expandingAliases.includes(token.value) || !token._.maybeSimpleCommandName) {
8730
8741
  yield token;
8731
8742
  return;
8732
8743
  }
@@ -8747,9 +8758,7 @@ var require_alias_substitution2 = __commonJS({
8747
8758
  }
8748
8759
  }
8749
8760
  return {
8750
- WORD: (tk) => {
8751
- return Array.from(tryExpandToken(tk, []));
8752
- }
8761
+ WORD: (tk) => Array.from(tryExpandToken(tk, []))
8753
8762
  };
8754
8763
  };
8755
8764
  module2.exports = (options, mode, previousPhases) => {
@@ -8825,9 +8834,9 @@ var require_to_pascal_case = __commonJS({
8825
8834
  }
8826
8835
  });
8827
8836
 
8828
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/default-node-type.js
8837
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/default-node-type.js
8829
8838
  var require_default_node_type = __commonJS({
8830
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/default-node-type.js"(exports2, module2) {
8839
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/default-node-type.js"(exports2, module2) {
8831
8840
  "use strict";
8832
8841
  var toPascal = require_to_pascal_case();
8833
8842
  var map = require_map_iterable();
@@ -8835,11 +8844,7 @@ var require_default_node_type = __commonJS({
8835
8844
  const tk = Object.assign({}, token);
8836
8845
  if (tk.type) {
8837
8846
  tk.originalType = token.type;
8838
- if (token.is("WORD") || token.is("NAME") || token.is("ASSIGNMENT_WORD")) {
8839
- tk.type = toPascal(tk.type);
8840
- } else {
8841
- tk.type = token.type.toLowerCase();
8842
- }
8847
+ tk.type = token.is("WORD") || token.is("NAME") || token.is("ASSIGNMENT_WORD") ? toPascal(tk.type) : token.type.toLowerCase();
8843
8848
  for (const xp of tk.expansion || []) {
8844
8849
  xp.type = toPascal(xp.type);
8845
8850
  }
@@ -8850,22 +8855,20 @@ var require_default_node_type = __commonJS({
8850
8855
  }
8851
8856
  });
8852
8857
 
8853
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/tilde-expanding.js
8858
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/tilde-expanding.js
8854
8859
  var require_tilde_expanding = __commonJS({
8855
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/tilde-expanding.js"(exports2, module2) {
8860
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/tilde-expanding.js"(exports2, module2) {
8856
8861
  "use strict";
8857
8862
  var map = require_map_iterable();
8858
8863
  var tokens = require_tokens();
8859
8864
  var replace = (text, resolveHomeUser) => {
8860
8865
  let replaced = false;
8861
- let result = text.replace(/^~([^\/]*)\//, (match, p1) => {
8866
+ let result = text.replace(/^~([^/]*)\//, (match, p1) => {
8862
8867
  replaced = true;
8863
8868
  return resolveHomeUser(p1 || null) + "/";
8864
8869
  });
8865
8870
  if (!replaced) {
8866
- result = text.replace(/^~(.*)$/, (match, p1) => {
8867
- return resolveHomeUser(p1 || null);
8868
- });
8871
+ result = text.replace(/^~(.*)$/, (match, p1) => resolveHomeUser(p1 || null));
8869
8872
  }
8870
8873
  return result;
8871
8874
  };
@@ -8885,9 +8888,9 @@ var require_tilde_expanding = __commonJS({
8885
8888
  }
8886
8889
  });
8887
8890
 
8888
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/path-expansion.js
8891
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/path-expansion.js
8889
8892
  var require_path_expansion = __commonJS({
8890
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/path-expansion.js"(exports2, module2) {
8893
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/path-expansion.js"(exports2, module2) {
8891
8894
  "use strict";
8892
8895
  var map = require_map_iterable();
8893
8896
  var tokens = require_tokens();
@@ -9097,9 +9100,9 @@ var require_dist = __commonJS({
9097
9100
  }
9098
9101
  });
9099
9102
 
9100
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/quote-removal.js
9103
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/quote-removal.js
9101
9104
  var require_quote_removal = __commonJS({
9102
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/quote-removal.js"(exports2, module2) {
9105
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/quote-removal.js"(exports2, module2) {
9103
9106
  "use strict";
9104
9107
  var parse2 = require_shell_quote_word();
9105
9108
  var unescape = require_dist();
@@ -9123,10 +9126,8 @@ var require_quote_removal = __commonJS({
9123
9126
  return unresolved.length > 0;
9124
9127
  }
9125
9128
  module2.exports = () => map((token) => {
9126
- if (token.is("WORD") || token.is("ASSIGNMENT_WORD")) {
9127
- if (!unresolvedExpansions(token)) {
9128
- return tokens.setValue(token, unquote(token.value));
9129
- }
9129
+ if ((token.is("WORD") || token.is("ASSIGNMENT_WORD")) && !unresolvedExpansions(token)) {
9130
+ return tokens.setValue(token, unquote(token.value));
9130
9131
  }
9131
9132
  return token;
9132
9133
  });
@@ -9208,9 +9209,9 @@ var require_iterable_lookahead = __commonJS({
9208
9209
  }
9209
9210
  });
9210
9211
 
9211
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/identify-simplecommand-names.js
9212
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/identify-simplecommand-names.js
9212
9213
  var require_identify_simplecommand_names = __commonJS({
9213
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/identify-simplecommand-names.js"(exports2, module2) {
9214
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/identify-simplecommand-names.js"(exports2, module2) {
9214
9215
  "use strict";
9215
9216
  var lookahead = require_iterable_lookahead();
9216
9217
  var compose = require_compose_function();
@@ -9253,9 +9254,9 @@ var require_identify_simplecommand_names = __commonJS({
9253
9254
  }
9254
9255
  });
9255
9256
 
9256
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/identify-maybe-simple-commands.js
9257
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/identify-maybe-simple-commands.js
9257
9258
  var require_identify_maybe_simple_commands = __commonJS({
9258
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/identify-maybe-simple-commands.js"(exports2, module2) {
9259
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/identify-maybe-simple-commands.js"(exports2, module2) {
9259
9260
  "use strict";
9260
9261
  var values = require_object_values();
9261
9262
  var compose = require_compose_function();
@@ -9273,9 +9274,9 @@ var require_identify_maybe_simple_commands = __commonJS({
9273
9274
  }
9274
9275
  });
9275
9276
 
9276
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/operator-tokens.js
9277
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/operator-tokens.js
9277
9278
  var require_operator_tokens = __commonJS({
9278
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/operator-tokens.js"(exports2, module2) {
9279
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/operator-tokens.js"(exports2, module2) {
9279
9280
  "use strict";
9280
9281
  var hasOwnProperty = require_has_own_property();
9281
9282
  var map = require_map_iterable();
@@ -9298,9 +9299,9 @@ var require_operator_tokens = __commonJS({
9298
9299
  }
9299
9300
  });
9300
9301
 
9301
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/reserved-words.js
9302
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/reserved-words.js
9302
9303
  var require_reserved_words = __commonJS({
9303
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/reserved-words.js"(exports2, module2) {
9304
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/reserved-words.js"(exports2, module2) {
9304
9305
  "use strict";
9305
9306
  var hasOwnProperty = require_has_own_property();
9306
9307
  var values = require_object_values();
@@ -9356,9 +9357,9 @@ var require_reverse_arguments = __commonJS({
9356
9357
  }
9357
9358
  });
9358
9359
 
9359
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/filter.js
9360
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/filter.js
9360
9361
  var require_filter = __commonJS({
9361
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/filter.js"(exports2, module2) {
9362
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/filter.js"(exports2, module2) {
9362
9363
  "use strict";
9363
9364
  var filterIterator = require_filter_iterator();
9364
9365
  var reverse = require_reverse_arguments();
@@ -9368,22 +9369,20 @@ var require_filter = __commonJS({
9368
9369
  }
9369
9370
  });
9370
9371
 
9371
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/non-null.js
9372
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/non-null.js
9372
9373
  var require_non_null = __commonJS({
9373
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/utils/non-null.js"(exports2, module2) {
9374
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/utils/non-null.js"(exports2, module2) {
9374
9375
  "use strict";
9375
9376
  var filter = require_filter();
9376
- var nonNull = (tk) => {
9377
- return tk !== null;
9378
- };
9377
+ var nonNull = (tk) => tk !== null;
9379
9378
  module2.exports = filter(nonNull);
9380
9379
  filter.predicate = nonNull;
9381
9380
  }
9382
9381
  });
9383
9382
 
9384
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/separator.js
9383
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/separator.js
9385
9384
  var require_separator = __commonJS({
9386
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/separator.js"(exports2, module2) {
9385
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/separator.js"(exports2, module2) {
9387
9386
  "use strict";
9388
9387
  var compose = require_compose_function();
9389
9388
  var map = require_map_iterable();
@@ -9433,9 +9432,9 @@ var require_separator = __commonJS({
9433
9432
  }
9434
9433
  });
9435
9434
 
9436
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/linebreak-in.js
9435
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/linebreak-in.js
9437
9436
  var require_linebreak_in = __commonJS({
9438
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/linebreak-in.js"(exports2, module2) {
9437
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/linebreak-in.js"(exports2, module2) {
9439
9438
  "use strict";
9440
9439
  var compose = require_compose_function();
9441
9440
  var map = require_map_iterable();
@@ -9472,9 +9471,9 @@ var require_linebreak_in = __commonJS({
9472
9471
  }
9473
9472
  });
9474
9473
 
9475
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/for-name-variable.js
9474
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/for-name-variable.js
9476
9475
  var require_for_name_variable = __commonJS({
9477
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/for-name-variable.js"(exports2, module2) {
9476
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/for-name-variable.js"(exports2, module2) {
9478
9477
  "use strict";
9479
9478
  var compose = require_compose_function();
9480
9479
  var map = require_map_iterable();
@@ -9482,7 +9481,7 @@ var require_for_name_variable = __commonJS({
9482
9481
  var isValidName = require_is_valid_name();
9483
9482
  module2.exports = function forNameVariable() {
9484
9483
  return compose(map((tk, idx, iterable) => {
9485
- let lastToken = iterable.behind(1) || { is: () => false };
9484
+ const lastToken = iterable.behind(1) || { is: () => false };
9486
9485
  if (lastToken.is("For") && tk.is("WORD") && isValidName(tk.value)) {
9487
9486
  return tk.changeTokenType("NAME", tk.value);
9488
9487
  }
@@ -9492,9 +9491,9 @@ var require_for_name_variable = __commonJS({
9492
9491
  }
9493
9492
  });
9494
9493
 
9495
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/function-name.js
9494
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/function-name.js
9496
9495
  var require_function_name = __commonJS({
9497
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/function-name.js"(exports2, module2) {
9496
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/function-name.js"(exports2, module2) {
9498
9497
  "use strict";
9499
9498
  var compose = require_compose_function();
9500
9499
  var map = require_map_iterable();
@@ -9510,9 +9509,9 @@ var require_function_name = __commonJS({
9510
9509
  }
9511
9510
  });
9512
9511
 
9513
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/io-number.js
9512
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/io-number.js
9514
9513
  var require_io_number = __commonJS({
9515
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/io-number.js"(exports2, module2) {
9514
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/io-number.js"(exports2, module2) {
9516
9515
  "use strict";
9517
9516
  var compose = require_compose_function();
9518
9517
  var map = require_map_iterable();
@@ -9520,7 +9519,7 @@ var require_io_number = __commonJS({
9520
9519
  module2.exports = function ioNumber(options, mode) {
9521
9520
  return compose(map((tk, idx, iterable) => {
9522
9521
  const next = iterable.ahead(1);
9523
- if (tk && tk.is("WORD") && tk.value.match(/^[0-9]+$/) && mode.enums.IOFileOperators.isOperator(next)) {
9522
+ if (tk && tk.is("WORD") && /^\d+$/.test(tk.value) && mode.enums.IOFileOperators.isOperator(next)) {
9524
9523
  return tk.changeTokenType("IO_NUMBER", tk.value);
9525
9524
  }
9526
9525
  return tk;
@@ -9529,9 +9528,9 @@ var require_io_number = __commonJS({
9529
9528
  }
9530
9529
  });
9531
9530
 
9532
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/new-line-list.js
9531
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/new-line-list.js
9533
9532
  var require_new_line_list = __commonJS({
9534
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/new-line-list.js"(exports2, module2) {
9533
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/new-line-list.js"(exports2, module2) {
9535
9534
  "use strict";
9536
9535
  var compose = require_compose_function();
9537
9536
  var map = require_map_iterable();
@@ -9557,9 +9556,9 @@ var require_new_line_list = __commonJS({
9557
9556
  }
9558
9557
  });
9559
9558
 
9560
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/assignment-word.js
9559
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/assignment-word.js
9561
9560
  var require_assignment_word = __commonJS({
9562
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/assignment-word.js"(exports2, module2) {
9561
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/assignment-word.js"(exports2, module2) {
9563
9562
  "use strict";
9564
9563
  var map = require_map_iterable();
9565
9564
  var isValidName = require_is_valid_name();
@@ -9579,9 +9578,9 @@ var require_assignment_word = __commonJS({
9579
9578
  }
9580
9579
  });
9581
9580
 
9582
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/syntaxerror-oncontinue.js
9581
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/syntaxerror-oncontinue.js
9583
9582
  var require_syntaxerror_oncontinue = __commonJS({
9584
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/syntaxerror-oncontinue.js"(exports2, module2) {
9583
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/syntaxerror-oncontinue.js"(exports2, module2) {
9585
9584
  "use strict";
9586
9585
  var map = require_map_iterable();
9587
9586
  module2.exports = function syntaxerrorOnContinue() {
@@ -9595,9 +9594,9 @@ var require_syntaxerror_oncontinue = __commonJS({
9595
9594
  }
9596
9595
  });
9597
9596
 
9598
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/index.js
9597
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/index.js
9599
9598
  var require_rules = __commonJS({
9600
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/rules/index.js"(exports2) {
9599
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/rules/index.js"(exports2) {
9601
9600
  "use strict";
9602
9601
  exports2.parameterExpansion = require_parameter_expansion();
9603
9602
  exports2.commandExpansion = require_command_expansion();
@@ -9623,9 +9622,9 @@ var require_rules = __commonJS({
9623
9622
  }
9624
9623
  });
9625
9624
 
9626
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/grammar.js
9625
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/grammar.js
9627
9626
  var require_grammar = __commonJS({
9628
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/grammar.js"(exports2, module2) {
9627
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/grammar.js"(exports2, module2) {
9629
9628
  "use strict";
9630
9629
  module2.exports = {
9631
9630
  start: "complete_command",
@@ -10074,9 +10073,9 @@ var require_grammar = __commonJS({
10074
10073
  }
10075
10074
  });
10076
10075
 
10077
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/io-file-operators.js
10076
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/io-file-operators.js
10078
10077
  var require_io_file_operators = __commonJS({
10079
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/io-file-operators.js"(exports2, module2) {
10078
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/io-file-operators.js"(exports2, module2) {
10080
10079
  "use strict";
10081
10080
  var ioFileOperators = module2.exports = [
10082
10081
  "LESS",
@@ -10099,9 +10098,9 @@ var require_io_file_operators = __commonJS({
10099
10098
  }
10100
10099
  });
10101
10100
 
10102
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/parameter-operators.js
10101
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/parameter-operators.js
10103
10102
  var require_parameter_operators = __commonJS({
10104
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/parameter-operators.js"(exports2, module2) {
10103
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/parameter-operators.js"(exports2, module2) {
10105
10104
  "use strict";
10106
10105
  var name = "[a-zA-Z_][a-zA-Z0-9_]*";
10107
10106
  var parameterOps = {
@@ -10181,7 +10180,7 @@ var require_parameter_operators = __commonJS({
10181
10180
  op: "stringLength",
10182
10181
  parameter: (m) => m[1]
10183
10182
  },
10184
- [`^([1-9][0-9]*)$`]: {
10183
+ "^([1-9][0-9]*)$": {
10185
10184
  kind: "positional",
10186
10185
  parameter: (m) => Number(m[1])
10187
10186
  },
@@ -10214,9 +10213,9 @@ var require_parameter_operators = __commonJS({
10214
10213
  }
10215
10214
  });
10216
10215
 
10217
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/reserved-words.js
10216
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/reserved-words.js
10218
10217
  var require_reserved_words2 = __commonJS({
10219
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/reserved-words.js"(exports2, module2) {
10218
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/reserved-words.js"(exports2, module2) {
10220
10219
  "use strict";
10221
10220
  module2.exports = {
10222
10221
  "if": "If",
@@ -10239,9 +10238,9 @@ var require_reserved_words2 = __commonJS({
10239
10238
  }
10240
10239
  });
10241
10240
 
10242
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/index.js
10241
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/index.js
10243
10242
  var require_enums = __commonJS({
10244
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/enums/index.js"(exports2) {
10243
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/enums/index.js"(exports2) {
10245
10244
  "use strict";
10246
10245
  exports2.IOFileOperators = require_io_file_operators();
10247
10246
  exports2.operators = require_operators();
@@ -10250,9 +10249,9 @@ var require_enums = __commonJS({
10250
10249
  }
10251
10250
  });
10252
10251
 
10253
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/built-grammar.js
10252
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/built-grammar.js
10254
10253
  var require_built_grammar = __commonJS({
10255
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/built-grammar.js"(exports2, module2) {
10254
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/built-grammar.js"(exports2, module2) {
10256
10255
  "use strict";
10257
10256
  var parser = (function() {
10258
10257
  var o = function(k, v, o2, l) {
@@ -10483,13 +10482,9 @@ var require_built_grammar = __commonJS({
10483
10482
  if (hash.recoverable) {
10484
10483
  this.trace(str);
10485
10484
  } else {
10486
- let _parseError2 = function(msg, hash2) {
10487
- this.message = msg;
10488
- this.hash = hash2;
10489
- };
10490
- var _parseError = _parseError2;
10491
- _parseError2.prototype = Error;
10492
- throw new _parseError2(str, hash);
10485
+ var error = new Error(str);
10486
+ error.hash = hash;
10487
+ throw error;
10493
10488
  }
10494
10489
  },
10495
10490
  parse: function parse2(input) {
@@ -10658,9 +10653,9 @@ var require_built_grammar = __commonJS({
10658
10653
  }
10659
10654
  });
10660
10655
 
10661
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/index.js
10656
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/index.js
10662
10657
  var require_posix = __commonJS({
10663
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/posix/index.js"(exports2, module2) {
10658
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/posix/index.js"(exports2, module2) {
10664
10659
  "use strict";
10665
10660
  var astBuilder = require_ast_builder();
10666
10661
  var tokenizer = require_tokenizer();
@@ -10702,7 +10697,7 @@ var require_posix = __commonJS({
10702
10697
  let grammar = null;
10703
10698
  try {
10704
10699
  grammar = require_built_grammar();
10705
- } catch (err) {
10700
+ } catch {
10706
10701
  }
10707
10702
  return {
10708
10703
  enums,
@@ -10718,9 +10713,9 @@ var require_posix = __commonJS({
10718
10713
  }
10719
10714
  });
10720
10715
 
10721
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/word-expansion/index.js
10716
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/word-expansion/index.js
10722
10717
  var require_word_expansion = __commonJS({
10723
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/modes/word-expansion/index.js"(exports2, module2) {
10718
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/modes/word-expansion/index.js"(exports2, module2) {
10724
10719
  "use strict";
10725
10720
  var map = require_map_iterable();
10726
10721
  var tokenOrEmpty = require_tokens().tokenOrEmpty;
@@ -10806,9 +10801,9 @@ var require_word_expansion = __commonJS({
10806
10801
  }
10807
10802
  });
10808
10803
 
10809
- // node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/index.js
10804
+ // node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/index.js
10810
10805
  var require_src = __commonJS({
10811
- "node_modules/.pnpm/bash-parser@0.5.0/node_modules/bash-parser/src/index.js"(exports2, module2) {
10806
+ "node_modules/.pnpm/@banyudu+bash-parser@0.5.2/node_modules/@banyudu/bash-parser/src/index.js"(exports2, module2) {
10812
10807
  "use strict";
10813
10808
  var shellLexer = require_shell_lexer();
10814
10809
  var utils = require_utils();
@@ -10836,11 +10831,11 @@ var require_src = __commonJS({
10836
10831
  parser.yy = astBuilder(options);
10837
10832
  const ast = parser.parse(sourceCode);
10838
10833
  return ast;
10839
- } catch (err) {
10840
- if (err instanceof SyntaxError) {
10841
- throw err;
10834
+ } catch (error) {
10835
+ if (error instanceof SyntaxError) {
10836
+ throw error;
10842
10837
  }
10843
- throw new Error(err.stack || err.message);
10838
+ throw new Error(error.stack || error.message);
10844
10839
  }
10845
10840
  };
10846
10841
  }
@@ -18352,7 +18347,7 @@ function parseCommand(input) {
18352
18347
  for (const cmd of cmdAst.commands) {
18353
18348
  walkNode(cmd, result);
18354
18349
  }
18355
- return { commands: result.commands, hasSubshell: true, subshellCommands: result.subshellCommands, parseError: false };
18350
+ return { commands: result.commands, hasSubshell: result.hasSubshell, subshellCommands: result.subshellCommands, parseError: false };
18356
18351
  } catch {
18357
18352
  return { commands: [], hasSubshell: true, subshellCommands: [], parseError: true };
18358
18353
  }
@@ -18374,9 +18369,9 @@ function parseCommand(input) {
18374
18369
  for (const cmd of ast.commands) {
18375
18370
  walkNode(cmd, result);
18376
18371
  }
18377
- return { commands: result.commands, hasSubshell: true, subshellCommands: result.subshellCommands, parseError: false };
18372
+ return { commands: result.commands, hasSubshell: result.hasSubshell, subshellCommands: result.subshellCommands, parseError: false };
18378
18373
  } catch {
18379
- return { commands: [], hasSubshell: true, subshellCommands: [], parseError: true };
18374
+ return { commands: [], hasSubshell: false, subshellCommands: [], parseError: true };
18380
18375
  }
18381
18376
  }
18382
18377
  const fallback = regexFallbackParse(input);
@@ -18456,6 +18451,284 @@ function regexFallbackParse(input) {
18456
18451
 
18457
18452
  // src/evaluator.ts
18458
18453
  var import_os = require("os");
18454
+
18455
+ // src/targets.ts
18456
+ var import_path2 = require("path");
18457
+
18458
+ // src/glob.ts
18459
+ function globToRegex(pattern) {
18460
+ let regex = "";
18461
+ let i = 0;
18462
+ while (i < pattern.length) {
18463
+ const ch = pattern[i];
18464
+ if (ch === "*") {
18465
+ regex += ".*";
18466
+ } else if (ch === "?") {
18467
+ regex += ".";
18468
+ } else if (ch === "[") {
18469
+ i++;
18470
+ if (i < pattern.length && pattern[i] === "!") {
18471
+ regex += "[^";
18472
+ i++;
18473
+ } else {
18474
+ regex += "[";
18475
+ }
18476
+ while (i < pattern.length && pattern[i] !== "]") {
18477
+ regex += pattern[i];
18478
+ i++;
18479
+ }
18480
+ if (i < pattern.length) regex += "]";
18481
+ } else if (ch === "{") {
18482
+ const end = pattern.indexOf("}", i);
18483
+ if (end !== -1) {
18484
+ const alternatives = pattern.slice(i + 1, end).split(",").map((s) => s.replace(/[.+^$|\\()]/g, "\\$&"));
18485
+ regex += `(${alternatives.join("|")})`;
18486
+ i = end;
18487
+ } else {
18488
+ regex += "\\{";
18489
+ }
18490
+ } else if (".+^$|\\()".includes(ch)) {
18491
+ regex += "\\" + ch;
18492
+ } else {
18493
+ regex += ch;
18494
+ }
18495
+ i++;
18496
+ }
18497
+ return new RegExp(`^${regex}$`);
18498
+ }
18499
+
18500
+ // src/targets.ts
18501
+ var PATH_COMMANDS = /* @__PURE__ */ new Set([
18502
+ "rm",
18503
+ "chmod",
18504
+ "chown",
18505
+ "cp",
18506
+ "mv",
18507
+ "tee",
18508
+ "mkdir",
18509
+ "rmdir",
18510
+ "touch",
18511
+ "ln"
18512
+ ]);
18513
+ function evaluatePathTarget(cmd, cwd, targets) {
18514
+ if (targets.length === 0) return null;
18515
+ const positionalArgs = cmd.args.filter((a) => !a.startsWith("-"));
18516
+ if (positionalArgs.length === 0) return null;
18517
+ let bestMatch = null;
18518
+ for (const target of targets) {
18519
+ if (target.allowAll) {
18520
+ } else {
18521
+ if (target.commands && target.commands.length > 0 && !target.commands.includes(cmd.command)) {
18522
+ continue;
18523
+ }
18524
+ if (!target.commands && !PATH_COMMANDS.has(cmd.command)) {
18525
+ continue;
18526
+ }
18527
+ }
18528
+ const targetPath = (0, import_path2.normalize)(target.path.replace(/\{\{cwd\}\}/g, cwd));
18529
+ const recursive = target.recursive !== false;
18530
+ for (const arg of positionalArgs) {
18531
+ const resolvedArg = (0, import_path2.normalize)((0, import_path2.resolve)(cwd, arg));
18532
+ const matches = recursive ? resolvedArg === targetPath || resolvedArg.startsWith(targetPath + "/") : resolvedArg === targetPath;
18533
+ if (matches) {
18534
+ const decision = target.allowAll ? "allow" : target.decision;
18535
+ const detail = {
18536
+ command: cmd.command,
18537
+ args: cmd.args,
18538
+ decision,
18539
+ reason: target.reason || `Path "${resolvedArg}" matches trusted path "${target.path}" (${decision})`,
18540
+ matchedRule: "trustedPaths"
18541
+ };
18542
+ if (decision === "deny") return detail;
18543
+ if (!bestMatch || bestMatch.decision !== "deny") {
18544
+ bestMatch = detail;
18545
+ }
18546
+ }
18547
+ }
18548
+ }
18549
+ return bestMatch;
18550
+ }
18551
+ var DB_HOST_FLAGS = {
18552
+ psql: ["-h", "--host"],
18553
+ mysql: ["-h", "--host"],
18554
+ mariadb: ["-h", "--host"],
18555
+ "redis-cli": ["-h"],
18556
+ mongosh: ["--host"]
18557
+ };
18558
+ var DB_DATABASE_FLAGS = {
18559
+ psql: ["-d", "--dbname"],
18560
+ mysql: ["-D", "--database"],
18561
+ mariadb: ["-D", "--database"]
18562
+ };
18563
+ var DB_PORT_FLAGS = {
18564
+ psql: ["-p", "--port"],
18565
+ mysql: ["-P", "--port"],
18566
+ mariadb: ["-P", "--port"],
18567
+ "redis-cli": ["-p"],
18568
+ mongosh: ["--port"]
18569
+ };
18570
+ function extractFlagValue(args2, flags) {
18571
+ for (let i = 0; i < args2.length; i++) {
18572
+ const arg = args2[i];
18573
+ for (const f of flags) {
18574
+ if (arg.startsWith(f + "=")) {
18575
+ return arg.slice(f.length + 1);
18576
+ }
18577
+ }
18578
+ if (flags.includes(arg) && i + 1 < args2.length) {
18579
+ return args2[i + 1];
18580
+ }
18581
+ }
18582
+ return void 0;
18583
+ }
18584
+ function parseDBConnection(cmd) {
18585
+ const command = cmd.command;
18586
+ const info = {};
18587
+ for (const arg of cmd.args) {
18588
+ if (arg.startsWith("postgresql://") || arg.startsWith("postgres://")) {
18589
+ try {
18590
+ const url = new URL(arg);
18591
+ info.host = url.hostname;
18592
+ if (url.port) info.port = parseInt(url.port, 10);
18593
+ if (url.pathname.length > 1) info.database = url.pathname.slice(1);
18594
+ return info;
18595
+ } catch {
18596
+ }
18597
+ }
18598
+ if (arg.startsWith("mongodb://") || arg.startsWith("mongodb+srv://")) {
18599
+ try {
18600
+ const url = new URL(arg);
18601
+ info.host = url.hostname;
18602
+ if (url.port) info.port = parseInt(url.port, 10);
18603
+ if (url.pathname.length > 1) info.database = url.pathname.slice(1);
18604
+ return info;
18605
+ } catch {
18606
+ }
18607
+ }
18608
+ }
18609
+ const hostFlags = DB_HOST_FLAGS[command];
18610
+ if (hostFlags) {
18611
+ const h = extractFlagValue(cmd.args, hostFlags);
18612
+ if (h) info.host = h;
18613
+ }
18614
+ const dbFlags = DB_DATABASE_FLAGS[command];
18615
+ if (dbFlags) {
18616
+ const d = extractFlagValue(cmd.args, dbFlags);
18617
+ if (d) info.database = d;
18618
+ }
18619
+ const portFlags = DB_PORT_FLAGS[command];
18620
+ if (portFlags) {
18621
+ const p = extractFlagValue(cmd.args, portFlags);
18622
+ if (p) info.port = parseInt(p, 10);
18623
+ }
18624
+ return info;
18625
+ }
18626
+ var DB_COMMANDS = new Set(Object.keys(DB_HOST_FLAGS));
18627
+ function evaluateDatabaseTarget(cmd, targets) {
18628
+ if (targets.length === 0) return null;
18629
+ const hasAllowAll = targets.some((t) => t.allowAll);
18630
+ if (!hasAllowAll && !DB_COMMANDS.has(cmd.command)) return null;
18631
+ const applicableTargets = targets.filter((t) => t.allowAll || DB_COMMANDS.has(cmd.command));
18632
+ if (applicableTargets.length === 0) return null;
18633
+ const conn = parseDBConnection(cmd);
18634
+ if (!conn.host) return null;
18635
+ let bestMatch = null;
18636
+ for (const target of applicableTargets) {
18637
+ if (!target.allowAll && target.commands && target.commands.length > 0 && !target.commands.includes(cmd.command)) {
18638
+ continue;
18639
+ }
18640
+ const hostMatch = globToRegex(target.host).test(conn.host);
18641
+ if (!hostMatch) continue;
18642
+ if (target.port !== void 0 && conn.port !== void 0 && target.port !== conn.port) {
18643
+ continue;
18644
+ }
18645
+ if (target.database) {
18646
+ if (!conn.database || !globToRegex(target.database).test(conn.database)) continue;
18647
+ }
18648
+ const decision = target.allowAll ? "allow" : target.decision;
18649
+ const detail = {
18650
+ command: cmd.command,
18651
+ args: cmd.args,
18652
+ decision,
18653
+ reason: target.reason || `Database "${conn.host}${conn.database ? "/" + conn.database : ""}" matches trusted database (${decision})`,
18654
+ matchedRule: "trustedDatabases"
18655
+ };
18656
+ if (decision === "deny") return detail;
18657
+ if (!bestMatch) bestMatch = detail;
18658
+ }
18659
+ return bestMatch;
18660
+ }
18661
+ var ENDPOINT_COMMANDS = /* @__PURE__ */ new Set(["curl", "wget", "http", "httpie"]);
18662
+ function extractURLs(cmd) {
18663
+ const urls = [];
18664
+ const args2 = cmd.args;
18665
+ for (let i = 0; i < args2.length; i++) {
18666
+ const arg = args2[i];
18667
+ if (arg === "--url" && i + 1 < args2.length) {
18668
+ urls.push(args2[i + 1]);
18669
+ i++;
18670
+ continue;
18671
+ }
18672
+ if (arg.startsWith("http://") || arg.startsWith("https://")) {
18673
+ urls.push(arg);
18674
+ }
18675
+ }
18676
+ return urls;
18677
+ }
18678
+ function evaluateEndpointTarget(cmd, targets) {
18679
+ if (targets.length === 0) return null;
18680
+ const hasAllowAll = targets.some((t) => t.allowAll);
18681
+ if (!hasAllowAll && !ENDPOINT_COMMANDS.has(cmd.command)) return null;
18682
+ const urls = extractURLs(cmd);
18683
+ if (urls.length === 0) return null;
18684
+ let bestMatch = null;
18685
+ for (const target of targets) {
18686
+ if (!target.allowAll && target.commands && target.commands.length > 0 && !target.commands.includes(cmd.command)) {
18687
+ continue;
18688
+ }
18689
+ for (const url of urls) {
18690
+ if (globToRegex(target.pattern).test(url)) {
18691
+ const decision = target.allowAll ? "allow" : target.decision;
18692
+ const detail = {
18693
+ command: cmd.command,
18694
+ args: cmd.args,
18695
+ decision,
18696
+ reason: target.reason || `URL "${url}" matches trusted endpoint "${target.pattern}" (${decision})`,
18697
+ matchedRule: "trustedEndpoints"
18698
+ };
18699
+ if (decision === "deny") return detail;
18700
+ if (!bestMatch) bestMatch = detail;
18701
+ }
18702
+ }
18703
+ }
18704
+ return bestMatch;
18705
+ }
18706
+ function evaluateTargetPolicies(cmd, cwd, config) {
18707
+ const policies = config.targetPolicies;
18708
+ if (!policies?.length) return null;
18709
+ const results = [];
18710
+ const pathPolicies = policies.filter((p) => p.type === "path");
18711
+ if (pathPolicies.length) {
18712
+ const r = evaluatePathTarget(cmd, cwd, pathPolicies);
18713
+ if (r) results.push(r);
18714
+ }
18715
+ const dbPolicies = policies.filter((p) => p.type === "database");
18716
+ if (dbPolicies.length) {
18717
+ const r = evaluateDatabaseTarget(cmd, dbPolicies);
18718
+ if (r) results.push(r);
18719
+ }
18720
+ const endpointPolicies = policies.filter((p) => p.type === "endpoint");
18721
+ if (endpointPolicies.length) {
18722
+ const r = evaluateEndpointTarget(cmd, endpointPolicies);
18723
+ if (r) results.push(r);
18724
+ }
18725
+ if (results.length === 0) return null;
18726
+ const deny = results.find((r) => r.decision === "deny");
18727
+ if (deny) return deny;
18728
+ return results[0];
18729
+ }
18730
+
18731
+ // src/evaluator.ts
18459
18732
  function safeRegexTest(pattern, input) {
18460
18733
  try {
18461
18734
  return new RegExp(pattern).test(input);
@@ -18475,7 +18748,9 @@ function commandMatchesName(cmd, name) {
18475
18748
  return cmd.command === name;
18476
18749
  }
18477
18750
  var MAX_RECURSION_DEPTH = 10;
18478
- function evaluate(parsed, config, depth = 0) {
18751
+ function evaluate(parsed, config, cwdOrDepth, maybeDepth) {
18752
+ const cwd = typeof cwdOrDepth === "string" ? cwdOrDepth : void 0;
18753
+ const depth = typeof cwdOrDepth === "number" ? cwdOrDepth : maybeDepth ?? 0;
18479
18754
  if (depth > MAX_RECURSION_DEPTH) {
18480
18755
  return { decision: "ask", reason: "Maximum recursion depth exceeded", details: [] };
18481
18756
  }
@@ -18488,7 +18763,7 @@ function evaluate(parsed, config, depth = 0) {
18488
18763
  if (parsed.hasSubshell && parsed.subshellCommands.length > 0) {
18489
18764
  for (const subCmd of parsed.subshellCommands) {
18490
18765
  const subParsed = parseCommand(subCmd);
18491
- const subResult = evaluate(subParsed, config, depth + 1);
18766
+ const subResult = evaluate(subParsed, config, cwd, depth + 1);
18492
18767
  if (subResult.decision === "deny") {
18493
18768
  return { decision: "deny", reason: `Subshell command: ${subResult.reason}`, details: subResult.details };
18494
18769
  }
@@ -18501,7 +18776,7 @@ function evaluate(parsed, config, depth = 0) {
18501
18776
  }
18502
18777
  const details = [];
18503
18778
  for (const cmd of parsed.commands) {
18504
- details.push(evaluateCommand(cmd, config, depth));
18779
+ details.push(evaluateCommand(cmd, config, cwd, depth));
18505
18780
  }
18506
18781
  const decisions = details.map((d) => d.decision);
18507
18782
  if (decisions.includes("deny")) {
@@ -18522,7 +18797,7 @@ function evaluate(parsed, config, depth = 0) {
18522
18797
  }
18523
18798
  return { decision: "allow", reason: "All commands are safe", details };
18524
18799
  }
18525
- function evaluateCommand(cmd, config, depth = 0) {
18800
+ function evaluateCommand(cmd, config, cwd, depth = 0) {
18526
18801
  const { command, args: args2 } = cmd;
18527
18802
  for (const layer of config.layers) {
18528
18803
  if (layer.alwaysDeny.some((name) => commandMatchesName(cmd, name))) {
@@ -18532,27 +18807,51 @@ function evaluateCommand(cmd, config, depth = 0) {
18532
18807
  return { command, args: args2, decision: "allow", reason: `"${command}" is safe`, matchedRule: "alwaysAllow" };
18533
18808
  }
18534
18809
  }
18535
- if ((command === "ssh" || command === "scp" || command === "rsync") && config.trustedSSHHosts?.length) {
18536
- const sshResult = evaluateSSHCommand(cmd, config, depth);
18537
- if (sshResult) return sshResult;
18810
+ if (cwd) {
18811
+ const targetResult = evaluateTargetPolicies(cmd, cwd, config);
18812
+ if (targetResult) return targetResult;
18538
18813
  }
18539
- if (command === "docker" && config.trustedDockerContainers?.length) {
18540
- const dockerResult = evaluateDockerExec(cmd, config, depth);
18541
- if (dockerResult) return dockerResult;
18814
+ const remotes = config.trustedRemotes || [];
18815
+ if (command === "ssh" || command === "scp" || command === "rsync") {
18816
+ const sshTargets = remotes.filter((r) => r.context === "ssh");
18817
+ if (sshTargets.length) {
18818
+ const sshResult = evaluateSSHCommand(cmd, config, sshTargets, depth);
18819
+ if (sshResult) return sshResult;
18820
+ }
18542
18821
  }
18543
- if (command === "kubectl" && config.trustedKubectlContexts?.length) {
18544
- const kubectlResult = evaluateKubectlExec(cmd, config, depth);
18545
- if (kubectlResult) return kubectlResult;
18822
+ if (command === "docker") {
18823
+ const dockerTargets = remotes.filter((r) => r.context === "docker");
18824
+ if (dockerTargets.length) {
18825
+ const dockerResult = evaluateDockerExec(cmd, config, dockerTargets, depth);
18826
+ if (dockerResult) return dockerResult;
18827
+ }
18546
18828
  }
18547
- if (command === "sprite" && config.trustedSprites?.length) {
18548
- const spriteResult = evaluateSpriteExec(cmd, config, depth);
18549
- if (spriteResult) return spriteResult;
18829
+ if (command === "kubectl") {
18830
+ const kubectlTargets = remotes.filter((r) => r.context === "kubectl");
18831
+ if (kubectlTargets.length) {
18832
+ const kubectlResult = evaluateKubectlExec(cmd, config, kubectlTargets, depth);
18833
+ if (kubectlResult) return kubectlResult;
18834
+ }
18835
+ }
18836
+ if (command === "sprite") {
18837
+ const spriteTargets = remotes.filter((r) => r.context === "sprite");
18838
+ if (spriteTargets.length) {
18839
+ const spriteResult = evaluateSpriteExec(cmd, config, spriteTargets, depth);
18840
+ if (spriteResult) return spriteResult;
18841
+ }
18842
+ }
18843
+ if (command === "fly" || command === "flyctl") {
18844
+ const flyTargets = remotes.filter((r) => r.context === "fly");
18845
+ if (flyTargets.length) {
18846
+ const flyResult = evaluateFlyCommand(cmd, config, flyTargets, depth);
18847
+ if (flyResult) return flyResult;
18848
+ }
18550
18849
  }
18551
18850
  if (command === "xargs") {
18552
- return evaluateXargsCommand(cmd, config, depth);
18851
+ return evaluateXargsCommand(cmd, config, cwd, depth);
18553
18852
  }
18554
18853
  if (command === "find") {
18555
- return evaluateFindCommand(cmd, config, depth);
18854
+ return evaluateFindCommand(cmd, config, cwd, depth);
18556
18855
  }
18557
18856
  const mergedRule = collectMergedRule(cmd, config);
18558
18857
  if (mergedRule) {
@@ -18714,7 +19013,7 @@ function parseXargsSubcommand(args2) {
18714
19013
  }
18715
19014
  };
18716
19015
  }
18717
- function evaluateXargsCommand(cmd, config, depth = 0) {
19016
+ function evaluateXargsCommand(cmd, config, cwd, depth = 0) {
18718
19017
  const { command, args: args2 } = cmd;
18719
19018
  const { subcommand, unresolved } = parseXargsSubcommand(args2);
18720
19019
  if (unresolved || !subcommand) {
@@ -18738,7 +19037,7 @@ function evaluateXargsCommand(cmd, config, depth = 0) {
18738
19037
  } else {
18739
19038
  parsed = { commands: [subcommand], hasSubshell: false, subshellCommands: [], parseError: false };
18740
19039
  }
18741
- const result = evaluate(parsed, config, depth + 1);
19040
+ const result = evaluate(parsed, config, cwd, depth + 1);
18742
19041
  return {
18743
19042
  command,
18744
19043
  args: args2,
@@ -18776,7 +19075,7 @@ function parseFindExecCommands(args2) {
18776
19075
  }
18777
19076
  return commands;
18778
19077
  }
18779
- function evaluateFindCommand(cmd, config, depth = 0) {
19078
+ function evaluateFindCommand(cmd, config, cwd, depth = 0) {
18780
19079
  const { command, args: args2 } = cmd;
18781
19080
  if (args2.some((a) => a === "-delete")) {
18782
19081
  return { command, args: args2, decision: "ask", reason: "find -delete can remove files", matchedRule: "find:delete" };
@@ -18795,7 +19094,7 @@ function evaluateFindCommand(cmd, config, depth = 0) {
18795
19094
  subshellCommands: [],
18796
19095
  parseError: false
18797
19096
  };
18798
- const result = evaluate(parsed, config, depth + 1);
19097
+ const result = evaluate(parsed, config, cwd, depth + 1);
18799
19098
  if (result.decision === "deny") {
18800
19099
  return { command, args: args2, decision: "deny", reason: `find -exec: ${result.reason}`, matchedRule: "find:exec" };
18801
19100
  }
@@ -18827,48 +19126,6 @@ var SSH_FLAGS_WITH_VALUE = /* @__PURE__ */ new Set([
18827
19126
  "-W",
18828
19127
  "-w"
18829
19128
  ]);
18830
- function globToRegex(pattern) {
18831
- let regex = "";
18832
- let i = 0;
18833
- while (i < pattern.length) {
18834
- const ch = pattern[i];
18835
- if (ch === "*") {
18836
- regex += ".*";
18837
- } else if (ch === "?") {
18838
- regex += ".";
18839
- } else if (ch === "[") {
18840
- i++;
18841
- if (i < pattern.length && pattern[i] === "!") {
18842
- regex += "[^";
18843
- i++;
18844
- } else {
18845
- regex += "[";
18846
- }
18847
- while (i < pattern.length && pattern[i] !== "]") {
18848
- regex += pattern[i];
18849
- i++;
18850
- }
18851
- if (i < pattern.length) {
18852
- regex += "]";
18853
- }
18854
- } else if (ch === "{") {
18855
- const end = pattern.indexOf("}", i);
18856
- if (end !== -1) {
18857
- const alternatives = pattern.slice(i + 1, end).split(",").map((s) => s.replace(/[.+^$|\\()]/g, "\\$&"));
18858
- regex += `(${alternatives.join("|")})`;
18859
- i = end;
18860
- } else {
18861
- regex += "\\{";
18862
- }
18863
- } else if (".+^$|\\()".includes(ch)) {
18864
- regex += "\\" + ch;
18865
- } else {
18866
- regex += ch;
18867
- }
18868
- i++;
18869
- }
18870
- return new RegExp(`^${regex}$`);
18871
- }
18872
19129
  function findMatchingTarget(value, targets) {
18873
19130
  return targets.find((t) => globToRegex(t.name).test(value)) || null;
18874
19131
  }
@@ -18909,13 +19166,12 @@ function extractHostFromRemotePath(args2) {
18909
19166
  }
18910
19167
  return null;
18911
19168
  }
18912
- function evaluateSSHCommand(cmd, config, depth = 0) {
19169
+ function evaluateSSHCommand(cmd, config, targets, depth = 0) {
18913
19170
  const { command, args: args2 } = cmd;
18914
- const trustedHosts = config.trustedSSHHosts || [];
18915
19171
  if (command === "scp" || command === "rsync") {
18916
19172
  const host2 = extractHostFromRemotePath(args2);
18917
19173
  if (!host2) return null;
18918
- const target2 = findMatchingTarget(host2, trustedHosts);
19174
+ const target2 = findMatchingTarget(host2, targets);
18919
19175
  if (!target2) return null;
18920
19176
  if (target2.allowAll || !target2.overrides) {
18921
19177
  return {
@@ -18945,7 +19201,7 @@ function evaluateSSHCommand(cmd, config, depth = 0) {
18945
19201
  }
18946
19202
  const { host, remoteCommand } = parseSSHArgs(args2);
18947
19203
  if (!host) return null;
18948
- const target = findMatchingTarget(host, trustedHosts);
19204
+ const target = findMatchingTarget(host, targets);
18949
19205
  if (!target) return null;
18950
19206
  if (!remoteCommand) {
18951
19207
  return {
@@ -19054,12 +19310,12 @@ function parseDockerExecArgs(args2) {
19054
19310
  }
19055
19311
  return { target, remoteArgs };
19056
19312
  }
19057
- function evaluateDockerExec(cmd, config, depth = 0) {
19313
+ function evaluateDockerExec(cmd, config, targets, depth = 0) {
19058
19314
  const { command, args: args2 } = cmd;
19059
19315
  if (args2[0] !== "exec") return null;
19060
19316
  const { target: containerName, remoteArgs } = parseDockerExecArgs(args2.slice(1));
19061
19317
  if (!containerName) return null;
19062
- const matched = findMatchingTarget(containerName, config.trustedDockerContainers || []);
19318
+ const matched = findMatchingTarget(containerName, targets);
19063
19319
  if (!matched) return null;
19064
19320
  const result = evaluateRemoteCommand(remoteArgs, config, matched, depth);
19065
19321
  return {
@@ -19134,12 +19390,12 @@ function parseKubectlExecArgs(args2) {
19134
19390
  }
19135
19391
  return { context, pod, remoteArgs };
19136
19392
  }
19137
- function evaluateKubectlExec(cmd, config, depth = 0) {
19393
+ function evaluateKubectlExec(cmd, config, targets, depth = 0) {
19138
19394
  const { command, args: args2 } = cmd;
19139
19395
  if (args2[0] !== "exec") return null;
19140
19396
  const { context, pod, remoteArgs } = parseKubectlExecArgs(args2.slice(1));
19141
19397
  if (!context) return null;
19142
- const matched = findMatchingTarget(context, config.trustedKubectlContexts || []);
19398
+ const matched = findMatchingTarget(context, targets);
19143
19399
  if (!matched) return null;
19144
19400
  const result = evaluateRemoteCommand(remoteArgs, config, matched, depth);
19145
19401
  return {
@@ -19201,11 +19457,11 @@ function parseSpriteExecArgs(args2) {
19201
19457
  }
19202
19458
  return { spriteName, remoteArgs };
19203
19459
  }
19204
- function evaluateSpriteExec(cmd, config, depth = 0) {
19460
+ function evaluateSpriteExec(cmd, config, targets, depth = 0) {
19205
19461
  const { command, args: args2 } = cmd;
19206
19462
  const { spriteName, remoteArgs } = parseSpriteExecArgs(args2);
19207
19463
  if (!spriteName) return null;
19208
- const matched = findMatchingTarget(spriteName, config.trustedSprites || []);
19464
+ const matched = findMatchingTarget(spriteName, targets);
19209
19465
  if (!matched) return null;
19210
19466
  const result = evaluateRemoteCommand(remoteArgs, config, matched, depth);
19211
19467
  return {
@@ -19216,12 +19472,99 @@ function evaluateSpriteExec(cmd, config, depth = 0) {
19216
19472
  matchedRule: "trustedSprites"
19217
19473
  };
19218
19474
  }
19475
+ var FLY_SSH_FLAGS_WITH_VALUE = /* @__PURE__ */ new Set([
19476
+ "-a",
19477
+ "--app",
19478
+ "-C",
19479
+ "--command",
19480
+ "-o",
19481
+ "--org",
19482
+ "-r",
19483
+ "--region",
19484
+ "-u",
19485
+ "--user",
19486
+ "--address"
19487
+ ]);
19488
+ function parseFlySSHArgs(args2) {
19489
+ let app = null;
19490
+ const remoteArgs = [];
19491
+ let isSSH = false;
19492
+ let foundConsole = false;
19493
+ let i = 0;
19494
+ while (i < args2.length) {
19495
+ const arg = args2[i];
19496
+ if (arg.startsWith("--app=")) {
19497
+ app = arg.slice(6);
19498
+ i++;
19499
+ continue;
19500
+ }
19501
+ if (FLY_SSH_FLAGS_WITH_VALUE.has(arg)) {
19502
+ if (arg === "-a" || arg === "--app") {
19503
+ app = args2[i + 1] || null;
19504
+ }
19505
+ if ((arg === "-C" || arg === "--command") && foundConsole) {
19506
+ const cmdValue = args2[i + 1];
19507
+ if (cmdValue) {
19508
+ const parsed = parseCommand(cmdValue);
19509
+ if (!parsed.parseError && parsed.commands.length > 0) {
19510
+ const cmd = parsed.commands[0];
19511
+ remoteArgs.push(cmd.command, ...cmd.args);
19512
+ }
19513
+ }
19514
+ i += 2;
19515
+ continue;
19516
+ }
19517
+ i += 2;
19518
+ continue;
19519
+ }
19520
+ if (arg === "--") {
19521
+ i++;
19522
+ while (i < args2.length) {
19523
+ remoteArgs.push(args2[i]);
19524
+ i++;
19525
+ }
19526
+ break;
19527
+ }
19528
+ if (arg.startsWith("-")) {
19529
+ i++;
19530
+ continue;
19531
+ }
19532
+ if (!isSSH && arg === "ssh") {
19533
+ isSSH = true;
19534
+ i++;
19535
+ continue;
19536
+ }
19537
+ if (isSSH && !foundConsole && (arg === "console" || arg === "sftp")) {
19538
+ foundConsole = true;
19539
+ i++;
19540
+ continue;
19541
+ }
19542
+ i++;
19543
+ }
19544
+ return { app, remoteArgs, isSSH: isSSH && foundConsole };
19545
+ }
19546
+ function evaluateFlyCommand(cmd, config, targets, depth = 0) {
19547
+ const { command, args: args2 } = cmd;
19548
+ const { app, remoteArgs, isSSH } = parseFlySSHArgs(args2);
19549
+ if (!isSSH) return null;
19550
+ if (!app) return null;
19551
+ const matched = findMatchingTarget(app, targets);
19552
+ if (!matched) return null;
19553
+ const result = evaluateRemoteCommand(remoteArgs, config, matched, depth);
19554
+ return {
19555
+ command,
19556
+ args: args2,
19557
+ decision: result.decision,
19558
+ reason: `Trusted Fly app "${app}" (${result.reason})`,
19559
+ matchedRule: "trustedFlyApps"
19560
+ };
19561
+ }
19219
19562
 
19220
19563
  // src/rules.ts
19221
19564
  var import_fs = require("fs");
19222
19565
  var import_yaml = __toESM(require_dist2(), 1);
19223
19566
  var import_os2 = require("os");
19224
- var import_path2 = require("path");
19567
+ var import_path3 = require("path");
19225
19568
 
19226
19569
  // src/defaults.ts
19227
19570
  var SAFE_DEV_TOOLS = [
@@ -19369,10 +19712,8 @@ var DEFAULT_CONFIG = {
19369
19712
  askOnSubshell: true,
19370
19713
  notifyOnAsk: true,
19371
19714
  notifyOnDeny: true,
19372
- trustedSSHHosts: [],
19373
- trustedDockerContainers: [],
19374
- trustedKubectlContexts: [],
19375
- trustedSprites: [],
19715
+ trustedRemotes: [],
19716
+ targetPolicies: [],
19376
19717
  layers: [{
19377
19718
  alwaysAllow: [
19378
19719
  // Read-only file operations
@@ -19542,6 +19883,16 @@ var DEFAULT_CONFIG = {
19542
19883
  "ldd",
19543
19884
  "otool",
19544
19885
  "size",
19886
+ // ImageMagick
19887
+ "magick",
19888
+ "convert",
19889
+ "identify",
19890
+ "mogrify",
19891
+ "composite",
19892
+ "montage",
19893
+ "compare",
19894
+ "conjure",
19895
+ "stream",
19545
19896
  // macOS utilities (read-only)
19546
19897
  "mdfind",
19547
19898
  "mdls",
@@ -19614,7 +19965,8 @@ var DEFAULT_CONFIG = {
19614
19965
  command: "claude",
19615
19966
  default: "ask",
19616
19967
  argPatterns: [
19617
- { match: { anyArgMatches: ["^--(version|help)$", "^-[vh]$"] }, decision: "allow", description: "Version/help flags" }
19968
+ { match: { anyArgMatches: ["^--(version|help)$", "^-[vh]$"] }, decision: "allow", description: "Version/help flags" },
19969
+ { match: { argsMatch: ["^plugin(s)?\\s+(list|help|validate|marketplace\\s+(list|help))\\b"] }, decision: "allow", description: "Read-only plugin commands" }
19618
19970
  ]
19619
19971
  },
19620
19972
  // --- Shell sourcing ---
@@ -19795,8 +20147,8 @@ var DEFAULT_CONFIG = {
19795
20147
  command: "rm",
19796
20148
  default: "ask",
19797
20149
  argPatterns: [
19798
- { match: { argsMatch: ["-[^\\s]*r[^\\s]*f|-[^\\s]*f[^\\s]*r"] }, decision: "ask", reason: "Recursive force delete (rm -rf)" },
19799
- { match: { argsMatch: ["-[^\\s]*r"] }, decision: "ask", reason: "Recursive delete" },
20150
+ { match: { anyArgMatches: ["^-[^\\s]*r[^\\s]*f$|^-[^\\s]*f[^\\s]*r$"] }, decision: "ask", reason: "Recursive force delete (rm -rf)" },
20151
+ { match: { anyArgMatches: ["^-[^\\s]*r"] }, decision: "ask", reason: "Recursive delete" },
19800
20152
  { match: { argCount: { max: 3 }, not: false }, decision: "allow", description: "Deleting a small number of non-recursive files" }
19801
20153
  ]
19802
20154
  },
@@ -19884,6 +20236,17 @@ var DEFAULT_CONFIG = {
19884
20236
  { match: { anyArgMatches: ["^(list|search|show|status|get|template|version|env|history)$"] }, decision: "allow", description: "Read-only helm commands" },
19885
20237
  VERSION_HELP_FLAGS
19886
20238
  ] },
20239
+ // --- Fly.io ---
20240
+ ...["fly", "flyctl"].map((cmd) => ({
20241
+ command: cmd,
20242
+ default: "ask",
20243
+ argPatterns: [
20244
+ { match: { anyArgMatches: ["^(status|logs|info|version|platform|doctor|dig)$"] }, decision: "allow", description: "Read-only fly commands" },
20245
+ { match: { argsMatch: ["^apps\\s+list"] }, decision: "allow", description: "List fly apps" },
20246
+ { match: { anyArgMatches: ["^(deploy|destroy|scale|secrets)$"] }, decision: "ask", reason: "Destructive fly operation" },
20247
+ VERSION_HELP_FLAGS
20248
+ ]
20249
+ })),
19887
20250
  // --- Screen/tmux ---
19888
20251
  ...["screen", "tmux"].map((cmd) => ({
19889
20252
  command: cmd,
@@ -19931,8 +20294,8 @@ function isValidDecision(value) {
19931
20294
  return VALID_DECISIONS.has(value);
19932
20295
  }
19933
20296
  var USER_CONFIG_PATHS = [
19934
- (0, import_path2.join)((0, import_os2.homedir)(), ".claude", "warden.yaml"),
19935
- (0, import_path2.join)((0, import_os2.homedir)(), ".claude", "warden.json")
20297
+ (0, import_path3.join)((0, import_os2.homedir)(), ".claude", "warden.yaml"),
20298
+ (0, import_path3.join)((0, import_os2.homedir)(), ".claude", "warden.json")
19936
20299
  ];
19937
20300
  var PROJECT_CONFIG_NAMES = [
19938
20301
  ".claude/warden.yaml",
@@ -19955,7 +20318,7 @@ function loadConfig(cwd) {
19955
20318
  let workspaceRaw = null;
19956
20319
  if (cwd) {
19957
20320
  for (const name of PROJECT_CONFIG_NAMES) {
19958
- const result = tryLoadFile((0, import_path2.join)(cwd, name));
20321
+ const result = tryLoadFile((0, import_path3.join)(cwd, name));
19959
20322
  if (result) {
19960
20323
  workspaceLayer = extractLayer(result);
19961
20324
  workspaceRaw = result;
@@ -20057,18 +20420,153 @@ function parseTrustedList(raw) {
20057
20420
  return null;
20058
20421
  }).filter((t) => t !== null);
20059
20422
  }
20423
+ var VALID_REMOTE_CONTEXTS = /* @__PURE__ */ new Set(["ssh", "docker", "kubectl", "sprite", "fly"]);
20424
+ function parseTrustedRemotes(raw) {
20425
+ const results = [];
20426
+ for (const entry of raw) {
20427
+ if (!entry || typeof entry !== "object") continue;
20428
+ const obj = entry;
20429
+ const context = String(obj.context || "");
20430
+ if (!VALID_REMOTE_CONTEXTS.has(context)) {
20431
+ process.stderr.write(`[warden] Warning: unknown remote context "${context}", skipping
20432
+ `);
20433
+ continue;
20434
+ }
20435
+ const name = String(obj.name || "");
20436
+ if (!name) continue;
20437
+ const remote = { name, context };
20438
+ if (obj.allowAll === true) remote.allowAll = true;
20439
+ if (obj.overrides && typeof obj.overrides === "object") {
20440
+ remote.overrides = extractLayer(obj.overrides);
20441
+ }
20442
+ results.push(remote);
20443
+ }
20444
+ return results;
20445
+ }
20446
+ function parseTargetPolicies(raw) {
20447
+ const results = [];
20448
+ for (const entry of raw) {
20449
+ if (!entry || typeof entry !== "object") continue;
20450
+ const obj = entry;
20451
+ const type = String(obj.type || "");
20452
+ const rawDecision = String(obj.decision || "allow");
20453
+ const decision = isValidDecision(rawDecision) ? rawDecision : "allow";
20454
+ const base = {
20455
+ commands: Array.isArray(obj.commands) ? obj.commands.map(String) : void 0,
20456
+ decision,
20457
+ reason: obj.reason ? String(obj.reason) : void 0,
20458
+ allowAll: obj.allowAll === true ? true : void 0
20459
+ };
20460
+ switch (type) {
20461
+ case "path": {
20462
+ const path = String(obj.path || "");
20463
+ if (!path) continue;
20464
+ const policy = { ...base, type: "path", path };
20465
+ if (obj.recursive === false) policy.recursive = false;
20466
+ results.push(policy);
20467
+ break;
20468
+ }
20469
+ case "database": {
20470
+ const host = String(obj.host || "");
20471
+ if (!host) continue;
20472
+ const policy = { ...base, type: "database", host };
20473
+ if (typeof obj.port === "number") policy.port = obj.port;
20474
+ if (obj.database) policy.database = String(obj.database);
20475
+ results.push(policy);
20476
+ break;
20477
+ }
20478
+ case "endpoint": {
20479
+ const pattern = String(obj.pattern || "");
20480
+ if (!pattern) continue;
20481
+ results.push({ ...base, type: "endpoint", pattern });
20482
+ break;
20483
+ }
20484
+ default:
20485
+ process.stderr.write(`[warden] Warning: unknown target policy type "${type}", skipping
20486
+ `);
20487
+ }
20488
+ }
20489
+ return results;
20490
+ }
20491
+ function parseLegacyPaths(raw) {
20492
+ const results = [];
20493
+ for (const e of raw) {
20494
+ if (!e || typeof e !== "object") continue;
20495
+ const obj = e;
20496
+ const decision = String(obj.decision || "allow");
20497
+ if (!isValidDecision(decision)) continue;
20498
+ const path = String(obj.path || "");
20499
+ if (!path) continue;
20500
+ const tp = { type: "path", path, decision };
20501
+ if (obj.recursive === false) tp.recursive = false;
20502
+ if (Array.isArray(obj.commands)) tp.commands = obj.commands.map(String);
20503
+ if (obj.reason) tp.reason = String(obj.reason);
20504
+ results.push(tp);
20505
+ }
20506
+ return results;
20507
+ }
20508
+ function parseLegacyDatabases(raw) {
20509
+ const results = [];
20510
+ for (const e of raw) {
20511
+ if (!e || typeof e !== "object") continue;
20512
+ const obj = e;
20513
+ const decision = String(obj.decision || "allow");
20514
+ if (!isValidDecision(decision)) continue;
20515
+ const host = String(obj.host || "");
20516
+ if (!host) continue;
20517
+ const td = { type: "database", host, decision };
20518
+ if (typeof obj.port === "number") td.port = obj.port;
20519
+ if (obj.database) td.database = String(obj.database);
20520
+ if (Array.isArray(obj.commands)) td.commands = obj.commands.map(String);
20521
+ if (obj.reason) td.reason = String(obj.reason);
20522
+ results.push(td);
20523
+ }
20524
+ return results;
20525
+ }
20526
+ function parseLegacyEndpoints(raw) {
20527
+ const results = [];
20528
+ for (const e of raw) {
20529
+ if (!e || typeof e !== "object") continue;
20530
+ const obj = e;
20531
+ const decision = String(obj.decision || "allow");
20532
+ if (!isValidDecision(decision)) continue;
20533
+ const pattern = String(obj.pattern || "");
20534
+ if (!pattern) continue;
20535
+ const te = { type: "endpoint", pattern, decision };
20536
+ if (Array.isArray(obj.commands)) te.commands = obj.commands.map(String);
20537
+ if (obj.reason) te.reason = String(obj.reason);
20538
+ results.push(te);
20539
+ }
20540
+ return results;
20541
+ }
20542
+ var LEGACY_REMOTE_MAP = {
20543
+ trustedSSHHosts: "ssh",
20544
+ trustedDockerContainers: "docker",
20545
+ trustedKubectlContexts: "kubectl",
20546
+ trustedSprites: "sprite",
20547
+ trustedFlyApps: "fly"
20548
+ };
20060
20549
  function mergeNonLayerFields(config, raw) {
20061
- if (Array.isArray(raw.trustedSSHHosts)) {
20062
- config.trustedSSHHosts = [...config.trustedSSHHosts || [], ...parseTrustedList(raw.trustedSSHHosts)];
20550
+ if (Array.isArray(raw.trustedRemotes)) {
20551
+ config.trustedRemotes = [...config.trustedRemotes || [], ...parseTrustedRemotes(raw.trustedRemotes)];
20552
+ }
20553
+ if (Array.isArray(raw.targetPolicies)) {
20554
+ config.targetPolicies = [...config.targetPolicies || [], ...parseTargetPolicies(raw.targetPolicies)];
20555
+ }
20556
+ for (const [key, context] of Object.entries(LEGACY_REMOTE_MAP)) {
20557
+ if (Array.isArray(raw[key])) {
20558
+ const remotes = parseTrustedList(raw[key]).map((t) => ({ ...t, context }));
20559
+ config.trustedRemotes = [...config.trustedRemotes || [], ...remotes];
20560
+ }
20063
20561
  }
20064
- if (Array.isArray(raw.trustedDockerContainers)) {
20065
- config.trustedDockerContainers = [...config.trustedDockerContainers || [], ...parseTrustedList(raw.trustedDockerContainers)];
20562
+ if (Array.isArray(raw.trustedPaths)) {
20563
+ config.targetPolicies = [...config.targetPolicies || [], ...parseLegacyPaths(raw.trustedPaths)];
20066
20564
  }
20067
- if (Array.isArray(raw.trustedKubectlContexts)) {
20068
- config.trustedKubectlContexts = [...config.trustedKubectlContexts || [], ...parseTrustedList(raw.trustedKubectlContexts)];
20565
+ if (Array.isArray(raw.trustedDatabases)) {
20566
+ config.targetPolicies = [...config.targetPolicies || [], ...parseLegacyDatabases(raw.trustedDatabases)];
20069
20567
  }
20070
- if (Array.isArray(raw.trustedSprites)) {
20071
- config.trustedSprites = [...config.trustedSprites || [], ...parseTrustedList(raw.trustedSprites)];
20568
+ if (Array.isArray(raw.trustedEndpoints)) {
20569
+ config.targetPolicies = [...config.targetPolicies || [], ...parseLegacyEndpoints(raw.trustedEndpoints)];
20072
20570
  }
20073
20571
  if (typeof raw.defaultDecision === "string") {
20074
20572
  if (isValidDecision(raw.defaultDecision)) {
@@ -20237,9 +20735,9 @@ function sendNotification(title, message, config) {
20237
20735
  // src/yolo.ts
20238
20736
  var import_fs2 = require("fs");
20239
20737
  var import_os3 = require("os");
20240
- var import_path3 = require("path");
20738
+ var import_path4 = require("path");
20241
20739
  function yoloFilePath(sessionId) {
20242
- return (0, import_path3.join)((0, import_os3.tmpdir)(), `claude-warden-yolo-${sessionId}`);
20740
+ return (0, import_path4.join)((0, import_os3.tmpdir)(), `claude-warden-yolo-${sessionId}`);
20243
20741
  }
20244
20742
  function getYoloState(sessionId) {
20245
20743
  const filePath = yoloFilePath(sessionId);
@@ -20327,7 +20825,10 @@ async function main() {
20327
20825
  if (input.tool_name !== "Bash") {
20328
20826
  process.exit(0);
20329
20827
  }
20330
- if (input.permission_mode === "dangerously-skip-permissions") {
20828
+ if (input.permission_mode === "bypassPermissions") {
20829
+ process.exit(0);
20830
+ }
20831
+ if (process.env.WARDEN_YOLO === "true" || process.env.WARDEN_YOLO === "1") {
20331
20832
  process.exit(0);
20332
20833
  }
20333
20834
  const command = input.tool_input?.command;
@@ -20367,7 +20868,7 @@ async function main() {
20367
20868
  const yoloState = getYoloState(input.session_id);
20368
20869
  if (yoloState) {
20369
20870
  const parsed2 = parseCommand(command);
20370
- const result2 = evaluate(parsed2, config);
20871
+ const result2 = evaluate(parsed2, config, input.cwd);
20371
20872
  if (result2.decision === "deny" && !yoloState.bypassDeny) {
20372
20873
  } else {
20373
20874
  const expiryInfo = yoloState.expiresAt ? `expires ${new Date(yoloState.expiresAt).toLocaleTimeString()}` : "full session";
@@ -20383,7 +20884,7 @@ async function main() {
20383
20884
  }
20384
20885
  }
20385
20886
  const parsed = parseCommand(command);
20386
- const result = evaluate(parsed, config);
20887
+ const result = evaluate(parsed, config, input.cwd);
20387
20888
  if (result.decision === "allow") {
20388
20889
  const output2 = {
20389
20890
  hookSpecificOutput: {