@synergenius/flow-weaver 0.12.0 → 0.12.1

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.
@@ -1,8 +1,6 @@
1
1
  import * as fs from 'node:fs/promises';
2
- import { createRequire } from 'node:module';
3
2
  import * as path from 'node:path';
4
- const require = createRequire(import.meta.url);
5
- const { version: COMPILER_VERSION } = require('../../package.json');
3
+ import { VERSION as COMPILER_VERSION } from '../generated-version.js';
6
4
  import { generateCode } from './generate.js';
7
5
  import { generateInPlace } from './generate-in-place.js';
8
6
  import { parseWorkflow } from './parse.js';
@@ -3127,13 +3127,39 @@ var init_unescape = __esm({
3127
3127
  });
3128
3128
 
3129
3129
  // node_modules/minimatch/dist/esm/ast.js
3130
- var types, isExtglobType, startNoTraversal, startNoDot, addPatternStart, justDots, reSpecials, regExpEscape, qmark, star, starNoEmpty, AST;
3130
+ var _a, types, isExtglobType, isExtglobAST, adoptionMap, adoptionWithSpaceMap, adoptionAnyMap, usurpMap, startNoTraversal, startNoDot, addPatternStart, justDots, reSpecials, regExpEscape, qmark, star, starNoEmpty, AST;
3131
3131
  var init_ast = __esm({
3132
3132
  "node_modules/minimatch/dist/esm/ast.js"() {
3133
3133
  init_brace_expressions();
3134
3134
  init_unescape();
3135
3135
  types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
3136
3136
  isExtglobType = (c) => types.has(c);
3137
+ isExtglobAST = (c) => isExtglobType(c.type);
3138
+ adoptionMap = /* @__PURE__ */ new Map([
3139
+ ["!", ["@"]],
3140
+ ["?", ["?", "@"]],
3141
+ ["@", ["@"]],
3142
+ ["*", ["*", "+", "?", "@"]],
3143
+ ["+", ["+", "@"]]
3144
+ ]);
3145
+ adoptionWithSpaceMap = /* @__PURE__ */ new Map([
3146
+ ["!", ["?"]],
3147
+ ["@", ["?"]],
3148
+ ["+", ["?", "*"]]
3149
+ ]);
3150
+ adoptionAnyMap = /* @__PURE__ */ new Map([
3151
+ ["!", ["?", "@"]],
3152
+ ["?", ["?", "@"]],
3153
+ ["@", ["?", "@"]],
3154
+ ["*", ["*", "+", "?", "@"]],
3155
+ ["+", ["+", "@", "?", "*"]]
3156
+ ]);
3157
+ usurpMap = /* @__PURE__ */ new Map([
3158
+ ["!", /* @__PURE__ */ new Map([["!", "@"]])],
3159
+ ["?", /* @__PURE__ */ new Map([["*", "*"], ["+", "*"]])],
3160
+ ["@", /* @__PURE__ */ new Map([["!", "!"], ["?", "?"], ["@", "@"], ["*", "*"], ["+", "+"]])],
3161
+ ["+", /* @__PURE__ */ new Map([["?", "*"], ["*", "*"]])]
3162
+ ]);
3137
3163
  startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
3138
3164
  startNoDot = "(?!\\.)";
3139
3165
  addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
@@ -3143,7 +3169,7 @@ var init_ast = __esm({
3143
3169
  qmark = "[^/]";
3144
3170
  star = qmark + "*?";
3145
3171
  starNoEmpty = qmark + "+?";
3146
- AST = class _AST {
3172
+ AST = class {
3147
3173
  type;
3148
3174
  #root;
3149
3175
  #hasMagic;
@@ -3223,7 +3249,7 @@ var init_ast = __esm({
3223
3249
  for (const p of parts2) {
3224
3250
  if (p === "")
3225
3251
  continue;
3226
- if (typeof p !== "string" && !(p instanceof _AST && p.#parent === this)) {
3252
+ if (typeof p !== "string" && !(p instanceof _a && p.#parent === this)) {
3227
3253
  throw new Error("invalid part: " + p);
3228
3254
  }
3229
3255
  this.#parts.push(p);
@@ -3248,7 +3274,7 @@ var init_ast = __esm({
3248
3274
  const p = this.#parent;
3249
3275
  for (let i = 0; i < this.#parentIndex; i++) {
3250
3276
  const pp = p.#parts[i];
3251
- if (!(pp instanceof _AST && pp.type === "!")) {
3277
+ if (!(pp instanceof _a && pp.type === "!")) {
3252
3278
  return false;
3253
3279
  }
3254
3280
  }
@@ -3273,13 +3299,14 @@ var init_ast = __esm({
3273
3299
  this.push(part.clone(this));
3274
3300
  }
3275
3301
  clone(parent) {
3276
- const c = new _AST(this.type, parent);
3302
+ const c = new _a(this.type, parent);
3277
3303
  for (const p of this.#parts) {
3278
3304
  c.copyIn(p);
3279
3305
  }
3280
3306
  return c;
3281
3307
  }
3282
- static #parseAST(str2, ast, pos, opt) {
3308
+ static #parseAST(str2, ast, pos, opt, extDepth) {
3309
+ const maxDepth = opt.maxExtglobRecursion ?? 2;
3283
3310
  let escaping = false;
3284
3311
  let inBrace = false;
3285
3312
  let braceStart = -1;
@@ -3311,11 +3338,12 @@ var init_ast = __esm({
3311
3338
  acc2 += c;
3312
3339
  continue;
3313
3340
  }
3314
- if (!opt.noext && isExtglobType(c) && str2.charAt(i2) === "(") {
3341
+ const doRecurse = !opt.noext && isExtglobType(c) && str2.charAt(i2) === "(" && extDepth <= maxDepth;
3342
+ if (doRecurse) {
3315
3343
  ast.push(acc2);
3316
3344
  acc2 = "";
3317
- const ext2 = new _AST(c, ast);
3318
- i2 = _AST.#parseAST(str2, ext2, i2, opt);
3345
+ const ext2 = new _a(c, ast);
3346
+ i2 = _a.#parseAST(str2, ext2, i2, opt, extDepth + 1);
3319
3347
  ast.push(ext2);
3320
3348
  continue;
3321
3349
  }
@@ -3325,7 +3353,7 @@ var init_ast = __esm({
3325
3353
  return i2;
3326
3354
  }
3327
3355
  let i = pos + 1;
3328
- let part = new _AST(null, ast);
3356
+ let part = new _a(null, ast);
3329
3357
  const parts2 = [];
3330
3358
  let acc = "";
3331
3359
  while (i < str2.length) {
@@ -3352,19 +3380,22 @@ var init_ast = __esm({
3352
3380
  acc += c;
3353
3381
  continue;
3354
3382
  }
3355
- if (isExtglobType(c) && str2.charAt(i) === "(") {
3383
+ const doRecurse = isExtglobType(c) && str2.charAt(i) === "(" && /* c8 ignore start - the maxDepth is sufficient here */
3384
+ (extDepth <= maxDepth || ast && ast.#canAdoptType(c));
3385
+ if (doRecurse) {
3386
+ const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
3356
3387
  part.push(acc);
3357
3388
  acc = "";
3358
- const ext2 = new _AST(c, part);
3389
+ const ext2 = new _a(c, part);
3359
3390
  part.push(ext2);
3360
- i = _AST.#parseAST(str2, ext2, i, opt);
3391
+ i = _a.#parseAST(str2, ext2, i, opt, extDepth + depthAdd);
3361
3392
  continue;
3362
3393
  }
3363
3394
  if (c === "|") {
3364
3395
  part.push(acc);
3365
3396
  acc = "";
3366
3397
  parts2.push(part);
3367
- part = new _AST(null, ast);
3398
+ part = new _a(null, ast);
3368
3399
  continue;
3369
3400
  }
3370
3401
  if (c === ")") {
@@ -3383,9 +3414,101 @@ var init_ast = __esm({
3383
3414
  ast.#parts = [str2.substring(pos - 1)];
3384
3415
  return i;
3385
3416
  }
3417
+ #canAdoptWithSpace(child) {
3418
+ return this.#canAdopt(child, adoptionWithSpaceMap);
3419
+ }
3420
+ #canAdopt(child, map3 = adoptionMap) {
3421
+ if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null) {
3422
+ return false;
3423
+ }
3424
+ const gc = child.#parts[0];
3425
+ if (!gc || typeof gc !== "object" || gc.type === null) {
3426
+ return false;
3427
+ }
3428
+ return this.#canAdoptType(gc.type, map3);
3429
+ }
3430
+ #canAdoptType(c, map3 = adoptionAnyMap) {
3431
+ return !!map3.get(this.type)?.includes(c);
3432
+ }
3433
+ #adoptWithSpace(child, index) {
3434
+ const gc = child.#parts[0];
3435
+ const blank = new _a(null, gc, this.options);
3436
+ blank.#parts.push("");
3437
+ gc.push(blank);
3438
+ this.#adopt(child, index);
3439
+ }
3440
+ #adopt(child, index) {
3441
+ const gc = child.#parts[0];
3442
+ this.#parts.splice(index, 1, ...gc.#parts);
3443
+ for (const p of gc.#parts) {
3444
+ if (typeof p === "object")
3445
+ p.#parent = this;
3446
+ }
3447
+ this.#toString = void 0;
3448
+ }
3449
+ #canUsurpType(c) {
3450
+ const m = usurpMap.get(this.type);
3451
+ return !!m?.has(c);
3452
+ }
3453
+ #canUsurp(child) {
3454
+ if (!child || typeof child !== "object" || child.type !== null || child.#parts.length !== 1 || this.type === null || this.#parts.length !== 1) {
3455
+ return false;
3456
+ }
3457
+ const gc = child.#parts[0];
3458
+ if (!gc || typeof gc !== "object" || gc.type === null) {
3459
+ return false;
3460
+ }
3461
+ return this.#canUsurpType(gc.type);
3462
+ }
3463
+ #usurp(child) {
3464
+ const m = usurpMap.get(this.type);
3465
+ const gc = child.#parts[0];
3466
+ const nt = m?.get(gc.type);
3467
+ if (!nt)
3468
+ return false;
3469
+ this.#parts = gc.#parts;
3470
+ for (const p of this.#parts) {
3471
+ if (typeof p === "object")
3472
+ p.#parent = this;
3473
+ }
3474
+ this.type = nt;
3475
+ this.#toString = void 0;
3476
+ this.#emptyExt = false;
3477
+ }
3478
+ #flatten() {
3479
+ if (!isExtglobAST(this)) {
3480
+ for (const p of this.#parts) {
3481
+ if (typeof p === "object")
3482
+ p.#flatten();
3483
+ }
3484
+ } else {
3485
+ let iterations = 0;
3486
+ let done = false;
3487
+ do {
3488
+ done = true;
3489
+ for (let i = 0; i < this.#parts.length; i++) {
3490
+ const c = this.#parts[i];
3491
+ if (typeof c === "object") {
3492
+ c.#flatten();
3493
+ if (this.#canAdopt(c)) {
3494
+ done = false;
3495
+ this.#adopt(c, i);
3496
+ } else if (this.#canAdoptWithSpace(c)) {
3497
+ done = false;
3498
+ this.#adoptWithSpace(c, i);
3499
+ } else if (this.#canUsurp(c)) {
3500
+ done = false;
3501
+ this.#usurp(c);
3502
+ }
3503
+ }
3504
+ }
3505
+ } while (!done && ++iterations < 10);
3506
+ }
3507
+ this.#toString = void 0;
3508
+ }
3386
3509
  static fromGlob(pattern, options = {}) {
3387
- const ast = new _AST(null, void 0, options);
3388
- _AST.#parseAST(pattern, ast, 0, options);
3510
+ const ast = new _a(null, void 0, options);
3511
+ _a.#parseAST(pattern, ast, 0, options, 0);
3389
3512
  return ast;
3390
3513
  }
3391
3514
  // returns the regular expression if there's magic, or the unescaped
@@ -3479,12 +3602,14 @@ var init_ast = __esm({
3479
3602
  // or start or whatever) and prepend ^ or / at the Regexp construction.
3480
3603
  toRegExpSource(allowDot) {
3481
3604
  const dot = allowDot ?? !!this.#options.dot;
3482
- if (this.#root === this)
3605
+ if (this.#root === this) {
3606
+ this.#flatten();
3483
3607
  this.#fillNegs();
3484
- if (!this.type) {
3608
+ }
3609
+ if (!isExtglobAST(this)) {
3485
3610
  const noEmpty = this.isStart() && this.isEnd();
3486
3611
  const src = this.#parts.map((p) => {
3487
- const [re2, _, hasMagic2, uflag] = typeof p === "string" ? _AST.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
3612
+ const [re2, _, hasMagic2, uflag] = typeof p === "string" ? _a.#parseGlob(p, this.#hasMagic, noEmpty) : p.toRegExpSource(allowDot);
3488
3613
  this.#hasMagic = this.#hasMagic || hasMagic2;
3489
3614
  this.#uflag = this.#uflag || uflag;
3490
3615
  return re2;
@@ -3523,9 +3648,10 @@ var init_ast = __esm({
3523
3648
  let body = this.#partsToRegExp(dot);
3524
3649
  if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
3525
3650
  const s = this.toString();
3526
- this.#parts = [s];
3527
- this.type = null;
3528
- this.#hasMagic = void 0;
3651
+ const me = this;
3652
+ me.#parts = [s];
3653
+ me.type = null;
3654
+ me.#hasMagic = void 0;
3529
3655
  return [s, unescape2(this.toString()), false, false];
3530
3656
  }
3531
3657
  let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? "" : this.#partsToRegExp(true);
@@ -3566,11 +3692,13 @@ var init_ast = __esm({
3566
3692
  let escaping = false;
3567
3693
  let re2 = "";
3568
3694
  let uflag = false;
3695
+ let inStar = false;
3569
3696
  for (let i = 0; i < glob2.length; i++) {
3570
3697
  const c = glob2.charAt(i);
3571
3698
  if (escaping) {
3572
3699
  escaping = false;
3573
3700
  re2 += (reSpecials.has(c) ? "\\" : "") + c;
3701
+ inStar = false;
3574
3702
  continue;
3575
3703
  }
3576
3704
  if (c === "\\") {
@@ -3588,16 +3716,19 @@ var init_ast = __esm({
3588
3716
  uflag = uflag || needUflag;
3589
3717
  i += consumed - 1;
3590
3718
  hasMagic2 = hasMagic2 || magic;
3719
+ inStar = false;
3591
3720
  continue;
3592
3721
  }
3593
3722
  }
3594
3723
  if (c === "*") {
3595
- if (noEmpty && glob2 === "*")
3596
- re2 += starNoEmpty;
3597
- else
3598
- re2 += star;
3724
+ if (inStar)
3725
+ continue;
3726
+ inStar = true;
3727
+ re2 += noEmpty && /^[*]+$/.test(glob2) ? starNoEmpty : star;
3599
3728
  hasMagic2 = true;
3600
3729
  continue;
3730
+ } else {
3731
+ inStar = false;
3601
3732
  }
3602
3733
  if (c === "?") {
3603
3734
  re2 += qmark;
@@ -3609,6 +3740,7 @@ var init_ast = __esm({
3609
3740
  return [re2, unescape2(glob2), !!hasMagic2, uflag];
3610
3741
  }
3611
3742
  };
3743
+ _a = AST;
3612
3744
  }
3613
3745
  });
3614
3746
 
@@ -3782,11 +3914,13 @@ var init_esm = __esm({
3782
3914
  isWindows;
3783
3915
  platform;
3784
3916
  windowsNoMagicRoot;
3917
+ maxGlobstarRecursion;
3785
3918
  regexp;
3786
3919
  constructor(pattern, options = {}) {
3787
3920
  assertValidPattern(pattern);
3788
3921
  options = options || {};
3789
3922
  this.options = options;
3923
+ this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
3790
3924
  this.pattern = pattern;
3791
3925
  this.platform = options.platform || defaultPlatform;
3792
3926
  this.isWindows = this.platform === "win32";
@@ -4119,7 +4253,8 @@ var init_esm = __esm({
4119
4253
  // out of pattern, then that's fine, as long as all
4120
4254
  // the parts match.
4121
4255
  matchOne(file, pattern, partial2 = false) {
4122
- const options = this.options;
4256
+ let fileStartIndex = 0;
4257
+ let patternStartIndex = 0;
4123
4258
  if (this.isWindows) {
4124
4259
  const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
4125
4260
  const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
@@ -4128,14 +4263,14 @@ var init_esm = __esm({
4128
4263
  const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
4129
4264
  const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
4130
4265
  if (typeof fdi === "number" && typeof pdi === "number") {
4131
- const [fd, pd] = [file[fdi], pattern[pdi]];
4266
+ const [fd, pd] = [
4267
+ file[fdi],
4268
+ pattern[pdi]
4269
+ ];
4132
4270
  if (fd.toLowerCase() === pd.toLowerCase()) {
4133
4271
  pattern[pdi] = fd;
4134
- if (pdi > fdi) {
4135
- pattern = pattern.slice(pdi);
4136
- } else if (fdi > pdi) {
4137
- file = file.slice(fdi);
4138
- }
4272
+ patternStartIndex = pdi;
4273
+ fileStartIndex = fdi;
4139
4274
  }
4140
4275
  }
4141
4276
  }
@@ -4143,51 +4278,118 @@ var init_esm = __esm({
4143
4278
  if (optimizationLevel >= 2) {
4144
4279
  file = this.levelTwoFileOptimize(file);
4145
4280
  }
4146
- this.debug("matchOne", this, { file, pattern });
4147
- this.debug("matchOne", file.length, pattern.length);
4148
- for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
4149
- this.debug("matchOne loop");
4150
- var p = pattern[pi];
4151
- var f = file[fi];
4152
- this.debug(pattern, p, f);
4153
- if (p === false) {
4281
+ if (pattern.includes(GLOBSTAR)) {
4282
+ return this.#matchGlobstar(file, pattern, partial2, fileStartIndex, patternStartIndex);
4283
+ }
4284
+ return this.#matchOne(file, pattern, partial2, fileStartIndex, patternStartIndex);
4285
+ }
4286
+ #matchGlobstar(file, pattern, partial2, fileIndex, patternIndex) {
4287
+ const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
4288
+ const lastgs = pattern.lastIndexOf(GLOBSTAR);
4289
+ const [head2, body, tail] = partial2 ? [
4290
+ pattern.slice(patternIndex, firstgs),
4291
+ pattern.slice(firstgs + 1),
4292
+ []
4293
+ ] : [
4294
+ pattern.slice(patternIndex, firstgs),
4295
+ pattern.slice(firstgs + 1, lastgs),
4296
+ pattern.slice(lastgs + 1)
4297
+ ];
4298
+ if (head2.length) {
4299
+ const fileHead = file.slice(fileIndex, fileIndex + head2.length);
4300
+ if (!this.#matchOne(fileHead, head2, partial2, 0, 0))
4154
4301
  return false;
4155
- }
4156
- if (p === GLOBSTAR) {
4157
- this.debug("GLOBSTAR", [pattern, p, f]);
4158
- var fr = fi;
4159
- var pr = pi + 1;
4160
- if (pr === pl) {
4161
- this.debug("** at the end");
4162
- for (; fi < fl; fi++) {
4163
- if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
4164
- return false;
4165
- }
4166
- return true;
4302
+ fileIndex += head2.length;
4303
+ }
4304
+ let fileTailMatch = 0;
4305
+ if (tail.length) {
4306
+ if (tail.length + fileIndex > file.length)
4307
+ return false;
4308
+ let tailStart = file.length - tail.length;
4309
+ if (this.#matchOne(file, tail, partial2, tailStart, 0)) {
4310
+ fileTailMatch = tail.length;
4311
+ } else {
4312
+ if (file[file.length - 1] !== "" || fileIndex + tail.length === file.length) {
4313
+ return false;
4167
4314
  }
4168
- while (fr < fl) {
4169
- var swallowee = file[fr];
4170
- this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
4171
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial2)) {
4172
- this.debug("globstar found match!", fr, fl, swallowee);
4173
- return true;
4174
- } else {
4175
- if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
4176
- this.debug("dot detected!", file, fr, pattern, pr);
4177
- break;
4178
- }
4179
- this.debug("globstar swallow a segment, and continue");
4180
- fr++;
4181
- }
4315
+ tailStart--;
4316
+ if (!this.#matchOne(file, tail, partial2, tailStart, 0))
4317
+ return false;
4318
+ fileTailMatch = tail.length + 1;
4319
+ }
4320
+ }
4321
+ if (!body.length) {
4322
+ let sawSome = !!fileTailMatch;
4323
+ for (let i2 = fileIndex; i2 < file.length - fileTailMatch; i2++) {
4324
+ const f = String(file[i2]);
4325
+ sawSome = true;
4326
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
4327
+ return false;
4182
4328
  }
4183
- if (partial2) {
4184
- this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
4185
- if (fr === fl) {
4186
- return true;
4187
- }
4329
+ }
4330
+ return partial2 || sawSome;
4331
+ }
4332
+ const bodySegments = [[[], 0]];
4333
+ let currentBody = bodySegments[0];
4334
+ let nonGsParts = 0;
4335
+ const nonGsPartsSums = [0];
4336
+ for (const b of body) {
4337
+ if (b === GLOBSTAR) {
4338
+ nonGsPartsSums.push(nonGsParts);
4339
+ currentBody = [[], 0];
4340
+ bodySegments.push(currentBody);
4341
+ } else {
4342
+ currentBody[0].push(b);
4343
+ nonGsParts++;
4344
+ }
4345
+ }
4346
+ let i = bodySegments.length - 1;
4347
+ const fileLength = file.length - fileTailMatch;
4348
+ for (const b of bodySegments) {
4349
+ b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
4350
+ }
4351
+ return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial2, 0, !!fileTailMatch);
4352
+ }
4353
+ #matchGlobStarBodySections(file, bodySegments, fileIndex, bodyIndex, partial2, globStarDepth, sawTail) {
4354
+ const bs = bodySegments[bodyIndex];
4355
+ if (!bs) {
4356
+ for (let i = fileIndex; i < file.length; i++) {
4357
+ sawTail = true;
4358
+ const f = file[i];
4359
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
4360
+ return false;
4188
4361
  }
4362
+ }
4363
+ return sawTail;
4364
+ }
4365
+ const [body, after] = bs;
4366
+ while (fileIndex <= after) {
4367
+ const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial2, fileIndex, 0);
4368
+ if (m && globStarDepth < this.maxGlobstarRecursion) {
4369
+ const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial2, globStarDepth + 1, sawTail);
4370
+ if (sub !== false)
4371
+ return sub;
4372
+ }
4373
+ const f = file[fileIndex];
4374
+ if (f === "." || f === ".." || !this.options.dot && f.startsWith(".")) {
4189
4375
  return false;
4190
4376
  }
4377
+ fileIndex++;
4378
+ }
4379
+ return partial2 || null;
4380
+ }
4381
+ #matchOne(file, pattern, partial2, fileIndex, patternIndex) {
4382
+ let fi;
4383
+ let pi;
4384
+ let pl;
4385
+ let fl;
4386
+ for (fi = fileIndex, pi = patternIndex, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
4387
+ this.debug("matchOne loop");
4388
+ let p = pattern[pi];
4389
+ let f = file[fi];
4390
+ this.debug(pattern, p, f);
4391
+ if (p === false || p === GLOBSTAR)
4392
+ return false;
4191
4393
  let hit;
4192
4394
  if (typeof p === "string") {
4193
4395
  hit = f === p;
@@ -9464,6 +9666,15 @@ var init_esm5 = __esm({
9464
9666
  }
9465
9667
  });
9466
9668
 
9669
+ // src/generated-version.ts
9670
+ var VERSION;
9671
+ var init_generated_version = __esm({
9672
+ "src/generated-version.ts"() {
9673
+ "use strict";
9674
+ VERSION = "0.12.1";
9675
+ }
9676
+ });
9677
+
9467
9678
  // src/constants.ts
9468
9679
  function isReservedNodeName(name) {
9469
9680
  return Object.values(RESERVED_NODE_NAMES).includes(name);
@@ -17576,10 +17787,10 @@ var init_string_distance = __esm({
17576
17787
  });
17577
17788
 
17578
17789
  // node_modules/chevrotain/lib/src/version.js
17579
- var VERSION;
17790
+ var VERSION2;
17580
17791
  var init_version = __esm({
17581
17792
  "node_modules/chevrotain/lib/src/version.js"() {
17582
- VERSION = "11.1.1";
17793
+ VERSION2 = "11.1.1";
17583
17794
  }
17584
17795
  });
17585
17796
 
@@ -26896,8 +27107,8 @@ var init_llk_lookahead = __esm({
26896
27107
  init_lookahead();
26897
27108
  LLkLookaheadStrategy = class {
26898
27109
  constructor(options) {
26899
- var _a;
26900
- this.maxLookahead = (_a = options === null || options === void 0 ? void 0 : options.maxLookahead) !== null && _a !== void 0 ? _a : DEFAULT_PARSER_CONFIG.maxLookahead;
27110
+ var _a2;
27111
+ this.maxLookahead = (_a2 = options === null || options === void 0 ? void 0 : options.maxLookahead) !== null && _a2 !== void 0 ? _a2 : DEFAULT_PARSER_CONFIG.maxLookahead;
26901
27112
  }
26902
27113
  validate(options) {
26903
27114
  const leftRecursionErrors = this.validateNoLeftRecursion(options.rules);
@@ -28766,8 +28977,8 @@ var init_parser = __esm({
28766
28977
  });
28767
28978
  }
28768
28979
  this.TRACE_INIT("ComputeLookaheadFunctions", () => {
28769
- var _a, _b;
28770
- (_b = (_a = this.lookaheadStrategy).initialize) === null || _b === void 0 ? void 0 : _b.call(_a, {
28980
+ var _a2, _b;
28981
+ (_b = (_a2 = this.lookaheadStrategy).initialize) === null || _b === void 0 ? void 0 : _b.call(_a2, {
28771
28982
  rules: values_default(this.gastProductionsCache)
28772
28983
  });
28773
28984
  this.preComputeLookaheadFunctions(values_default(this.gastProductionsCache));
@@ -28844,7 +29055,7 @@ var init_api4 = __esm({
28844
29055
  });
28845
29056
 
28846
29057
  // node_modules/chevrotain/lib/src/diagrams/render_public.js
28847
- function createSyntaxDiagramsCode(grammar, { resourceBase = `https://unpkg.com/chevrotain@${VERSION}/diagrams/`, css = `https://unpkg.com/chevrotain@${VERSION}/diagrams/diagrams.css` } = {}) {
29058
+ function createSyntaxDiagramsCode(grammar, { resourceBase = `https://unpkg.com/chevrotain@${VERSION2}/diagrams/`, css = `https://unpkg.com/chevrotain@${VERSION2}/diagrams/diagrams.css` } = {}) {
28848
29059
  const header = `
28849
29060
  <!-- This is a generated file -->
28850
29061
  <!DOCTYPE html>
@@ -36948,7 +37159,6 @@ var init_serialization_node = __esm({
36948
37159
 
36949
37160
  // src/api/compile.ts
36950
37161
  import * as fs8 from "node:fs/promises";
36951
- import { createRequire } from "node:module";
36952
37162
  import * as path7 from "node:path";
36953
37163
  async function compileWorkflow(filePath, options = {}) {
36954
37164
  const startTime = Date.now();
@@ -37010,7 +37220,7 @@ ${errorMessages.join("\n")}`);
37010
37220
  sourceFile: filePath,
37011
37221
  outputFile,
37012
37222
  compiledAt: (/* @__PURE__ */ new Date()).toISOString(),
37013
- compilerVersion: COMPILER_VERSION,
37223
+ compilerVersion: VERSION,
37014
37224
  generationTime: Date.now() - startTime
37015
37225
  }
37016
37226
  };
@@ -37021,15 +37231,13 @@ function getDefaultOutputFile(sourceFile) {
37021
37231
  const basename19 = path7.basename(sourceFile, ".ts");
37022
37232
  return path7.join(dir, `${basename19}.generated.ts`);
37023
37233
  }
37024
- var require2, COMPILER_VERSION;
37025
37234
  var init_compile = __esm({
37026
37235
  "src/api/compile.ts"() {
37027
37236
  "use strict";
37237
+ init_generated_version();
37028
37238
  init_generate();
37029
37239
  init_generate_in_place();
37030
37240
  init_parse();
37031
- require2 = createRequire(import.meta.url);
37032
- ({ version: COMPILER_VERSION } = require2("../../package.json"));
37033
37241
  }
37034
37242
  });
37035
37243
 
@@ -57618,12 +57826,12 @@ var require_code = __commonJS({
57618
57826
  return item === "" || item === '""';
57619
57827
  }
57620
57828
  get str() {
57621
- var _a;
57622
- return (_a = this._str) !== null && _a !== void 0 ? _a : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
57829
+ var _a2;
57830
+ return (_a2 = this._str) !== null && _a2 !== void 0 ? _a2 : this._str = this._items.reduce((s, c) => `${s}${c}`, "");
57623
57831
  }
57624
57832
  get names() {
57625
- var _a;
57626
- return (_a = this._names) !== null && _a !== void 0 ? _a : this._names = this._items.reduce((names, c) => {
57833
+ var _a2;
57834
+ return (_a2 = this._names) !== null && _a2 !== void 0 ? _a2 : this._names = this._items.reduce((names, c) => {
57627
57835
  if (c instanceof Name)
57628
57836
  names[c.str] = (names[c.str] || 0) + 1;
57629
57837
  return names;
@@ -57769,8 +57977,8 @@ var require_scope = __commonJS({
57769
57977
  return `${prefix}${ng.index++}`;
57770
57978
  }
57771
57979
  _nameGroup(prefix) {
57772
- var _a, _b;
57773
- if (((_b = (_a = this._parent) === null || _a === void 0 ? void 0 : _a._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) {
57980
+ var _a2, _b;
57981
+ if (((_b = (_a2 = this._parent) === null || _a2 === void 0 ? void 0 : _a2._prefixes) === null || _b === void 0 ? void 0 : _b.has(prefix)) || this._prefixes && !this._prefixes.has(prefix)) {
57774
57982
  throw new Error(`CodeGen: prefix "${prefix}" is not allowed in this scope`);
57775
57983
  }
57776
57984
  return this._names[prefix] = { prefix, index: 0 };
@@ -57803,12 +58011,12 @@ var require_scope = __commonJS({
57803
58011
  return new ValueScopeName(prefix, this._newName(prefix));
57804
58012
  }
57805
58013
  value(nameOrPrefix, value2) {
57806
- var _a;
58014
+ var _a2;
57807
58015
  if (value2.ref === void 0)
57808
58016
  throw new Error("CodeGen: ref must be passed in value");
57809
58017
  const name = this.toName(nameOrPrefix);
57810
58018
  const { prefix } = name;
57811
- const valueKey = (_a = value2.key) !== null && _a !== void 0 ? _a : value2.ref;
58019
+ const valueKey = (_a2 = value2.key) !== null && _a2 !== void 0 ? _a2 : value2.ref;
57812
58020
  let vs = this._values[prefix];
57813
58021
  if (vs) {
57814
58022
  const _name = vs.get(valueKey);
@@ -58126,8 +58334,8 @@ var require_codegen = __commonJS({
58126
58334
  return this;
58127
58335
  }
58128
58336
  optimizeNames(names, constants) {
58129
- var _a;
58130
- this.else = (_a = this.else) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
58337
+ var _a2;
58338
+ this.else = (_a2 = this.else) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants);
58131
58339
  if (!(super.optimizeNames(names, constants) || this.else))
58132
58340
  return;
58133
58341
  this.condition = optimizeExpr(this.condition, names, constants);
@@ -58231,16 +58439,16 @@ var require_codegen = __commonJS({
58231
58439
  return code;
58232
58440
  }
58233
58441
  optimizeNodes() {
58234
- var _a, _b;
58442
+ var _a2, _b;
58235
58443
  super.optimizeNodes();
58236
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNodes();
58444
+ (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNodes();
58237
58445
  (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNodes();
58238
58446
  return this;
58239
58447
  }
58240
58448
  optimizeNames(names, constants) {
58241
- var _a, _b;
58449
+ var _a2, _b;
58242
58450
  super.optimizeNames(names, constants);
58243
- (_a = this.catch) === null || _a === void 0 ? void 0 : _a.optimizeNames(names, constants);
58451
+ (_a2 = this.catch) === null || _a2 === void 0 ? void 0 : _a2.optimizeNames(names, constants);
58244
58452
  (_b = this.finally) === null || _b === void 0 ? void 0 : _b.optimizeNames(names, constants);
58245
58453
  return this;
58246
58454
  }
@@ -59020,8 +59228,8 @@ var require_applicability = __commonJS({
59020
59228
  }
59021
59229
  exports2.shouldUseGroup = shouldUseGroup;
59022
59230
  function shouldUseRule(schema2, rule) {
59023
- var _a;
59024
- return schema2[rule.keyword] !== void 0 || ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema2[kwd] !== void 0));
59231
+ var _a2;
59232
+ return schema2[rule.keyword] !== void 0 || ((_a2 = rule.definition.implements) === null || _a2 === void 0 ? void 0 : _a2.some((kwd) => schema2[kwd] !== void 0));
59025
59233
  }
59026
59234
  exports2.shouldUseRule = shouldUseRule;
59027
59235
  }
@@ -59409,14 +59617,14 @@ var require_keyword = __commonJS({
59409
59617
  }
59410
59618
  exports2.macroKeywordCode = macroKeywordCode;
59411
59619
  function funcKeywordCode(cxt, def) {
59412
- var _a;
59620
+ var _a2;
59413
59621
  const { gen, keyword, schema: schema2, parentSchema, $data, it } = cxt;
59414
59622
  checkAsyncKeyword(it, def);
59415
59623
  const validate = !$data && def.compile ? def.compile.call(it.self, schema2, parentSchema, it) : def.validate;
59416
59624
  const validateRef = useKeyword(gen, keyword, validate);
59417
59625
  const valid = gen.let("valid");
59418
59626
  cxt.block$data(valid, validateKeyword);
59419
- cxt.ok((_a = def.valid) !== null && _a !== void 0 ? _a : valid);
59627
+ cxt.ok((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid);
59420
59628
  function validateKeyword() {
59421
59629
  if (def.errors === false) {
59422
59630
  assignValid();
@@ -59447,8 +59655,8 @@ var require_keyword = __commonJS({
59447
59655
  gen.assign(valid, (0, codegen_1._)`${_await}${(0, code_1.callValidateCode)(cxt, validateRef, passCxt, passSchema)}`, def.modifying);
59448
59656
  }
59449
59657
  function reportErrs(errors2) {
59450
- var _a2;
59451
- gen.if((0, codegen_1.not)((_a2 = def.valid) !== null && _a2 !== void 0 ? _a2 : valid), errors2);
59658
+ var _a3;
59659
+ gen.if((0, codegen_1.not)((_a3 = def.valid) !== null && _a3 !== void 0 ? _a3 : valid), errors2);
59452
59660
  }
59453
59661
  }
59454
59662
  exports2.funcKeywordCode = funcKeywordCode;
@@ -60416,7 +60624,7 @@ var require_compile = __commonJS({
60416
60624
  var validate_1 = require_validate();
60417
60625
  var SchemaEnv = class {
60418
60626
  constructor(env) {
60419
- var _a;
60627
+ var _a2;
60420
60628
  this.refs = {};
60421
60629
  this.dynamicAnchors = {};
60422
60630
  let schema2;
@@ -60425,7 +60633,7 @@ var require_compile = __commonJS({
60425
60633
  this.schema = env.schema;
60426
60634
  this.schemaId = env.schemaId;
60427
60635
  this.root = env.root || this;
60428
- this.baseId = (_a = env.baseId) !== null && _a !== void 0 ? _a : (0, resolve_1.normalizeId)(schema2 === null || schema2 === void 0 ? void 0 : schema2[env.schemaId || "$id"]);
60636
+ this.baseId = (_a2 = env.baseId) !== null && _a2 !== void 0 ? _a2 : (0, resolve_1.normalizeId)(schema2 === null || schema2 === void 0 ? void 0 : schema2[env.schemaId || "$id"]);
60429
60637
  this.schemaPath = env.schemaPath;
60430
60638
  this.localRefs = env.localRefs;
60431
60639
  this.meta = env.meta;
@@ -60521,14 +60729,14 @@ var require_compile = __commonJS({
60521
60729
  }
60522
60730
  exports2.compileSchema = compileSchema;
60523
60731
  function resolveRef(root2, baseId, ref) {
60524
- var _a;
60732
+ var _a2;
60525
60733
  ref = (0, resolve_1.resolveUrl)(this.opts.uriResolver, baseId, ref);
60526
60734
  const schOrFunc = root2.refs[ref];
60527
60735
  if (schOrFunc)
60528
60736
  return schOrFunc;
60529
60737
  let _sch = resolve35.call(this, root2, ref);
60530
60738
  if (_sch === void 0) {
60531
- const schema2 = (_a = root2.localRefs) === null || _a === void 0 ? void 0 : _a[ref];
60739
+ const schema2 = (_a2 = root2.localRefs) === null || _a2 === void 0 ? void 0 : _a2[ref];
60532
60740
  const { schemaId } = this.opts;
60533
60741
  if (schema2)
60534
60742
  _sch = new SchemaEnv({ schema: schema2, schemaId, root: root2, baseId });
@@ -60597,8 +60805,8 @@ var require_compile = __commonJS({
60597
60805
  "definitions"
60598
60806
  ]);
60599
60807
  function getJsonPointer(parsedRef, { baseId, schema: schema2, root: root2 }) {
60600
- var _a;
60601
- if (((_a = parsedRef.fragment) === null || _a === void 0 ? void 0 : _a[0]) !== "/")
60808
+ var _a2;
60809
+ if (((_a2 = parsedRef.fragment) === null || _a2 === void 0 ? void 0 : _a2[0]) !== "/")
60602
60810
  return;
60603
60811
  for (const part of parsedRef.fragment.slice(1).split("/")) {
60604
60812
  if (typeof schema2 === "boolean")
@@ -61459,9 +61667,9 @@ var require_core = __commonJS({
61459
61667
  };
61460
61668
  var MAX_EXPRESSION = 200;
61461
61669
  function requiredOptions(o) {
61462
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
61670
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0;
61463
61671
  const s = o.strict;
61464
- const _optz = (_a = o.code) === null || _a === void 0 ? void 0 : _a.optimize;
61672
+ const _optz = (_a2 = o.code) === null || _a2 === void 0 ? void 0 : _a2.optimize;
61465
61673
  const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
61466
61674
  const regExp = (_c = (_b = o.code) === null || _b === void 0 ? void 0 : _b.regExp) !== null && _c !== void 0 ? _c : defaultRegExp;
61467
61675
  const uriResolver = (_d = o.uriResolver) !== null && _d !== void 0 ? _d : uri_1.default;
@@ -61935,7 +62143,7 @@ var require_core = __commonJS({
61935
62143
  }
61936
62144
  }
61937
62145
  function addRule(keyword, definition, dataType) {
61938
- var _a;
62146
+ var _a2;
61939
62147
  const post = definition === null || definition === void 0 ? void 0 : definition.post;
61940
62148
  if (dataType && post)
61941
62149
  throw new Error('keyword with "post" flag cannot have "type"');
@@ -61961,7 +62169,7 @@ var require_core = __commonJS({
61961
62169
  else
61962
62170
  ruleGroup.rules.push(rule);
61963
62171
  RULES.all[keyword] = rule;
61964
- (_a = definition.implements) === null || _a === void 0 ? void 0 : _a.forEach((kwd) => this.addKeyword(kwd));
62172
+ (_a2 = definition.implements) === null || _a2 === void 0 ? void 0 : _a2.forEach((kwd) => this.addKeyword(kwd));
61965
62173
  }
61966
62174
  function addBeforeRule(ruleGroup, rule, before) {
61967
62175
  const i = ruleGroup.rules.findIndex((_rule) => _rule.keyword === before);
@@ -62095,10 +62303,10 @@ var require_ref = __commonJS({
62095
62303
  gen.assign(names_1.default.errors, (0, codegen_1._)`${names_1.default.vErrors}.length`);
62096
62304
  }
62097
62305
  function addEvaluatedFrom(source) {
62098
- var _a;
62306
+ var _a2;
62099
62307
  if (!it.opts.unevaluated)
62100
62308
  return;
62101
- const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
62309
+ const schEvaluated = (_a2 = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a2 === void 0 ? void 0 : _a2.evaluated;
62102
62310
  if (it.props !== true) {
62103
62311
  if (schEvaluated && !schEvaluated.dynamicProps) {
62104
62312
  if (schEvaluated.props !== void 0) {
@@ -63749,7 +63957,7 @@ var require_discriminator = __commonJS({
63749
63957
  return _valid;
63750
63958
  }
63751
63959
  function getMapping() {
63752
- var _a;
63960
+ var _a2;
63753
63961
  const oneOfMapping = {};
63754
63962
  const topRequired = hasRequired(parentSchema);
63755
63963
  let tagRequired = true;
@@ -63763,7 +63971,7 @@ var require_discriminator = __commonJS({
63763
63971
  if (sch === void 0)
63764
63972
  throw new ref_error_1.default(it.opts.uriResolver, it.baseId, ref);
63765
63973
  }
63766
- const propSch = (_a = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a === void 0 ? void 0 : _a[tagName];
63974
+ const propSch = (_a2 = sch === null || sch === void 0 ? void 0 : sch.properties) === null || _a2 === void 0 ? void 0 : _a2[tagName];
63767
63975
  if (typeof propSch != "object") {
63768
63976
  throw new Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${tagName}"`);
63769
63977
  }
@@ -64332,9 +64540,9 @@ var require_dist = __commonJS({
64332
64540
  return f;
64333
64541
  };
64334
64542
  function addFormats(ajv, list, fs51, exportName) {
64335
- var _a;
64543
+ var _a2;
64336
64544
  var _b;
64337
- (_a = (_b = ajv.opts.code).formats) !== null && _a !== void 0 ? _a : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
64545
+ (_a2 = (_b = ajv.opts.code).formats) !== null && _a2 !== void 0 ? _a2 : _b.formats = (0, codegen_1._)`require("ajv-formats/dist/formats").${exportName}`;
64338
64546
  for (const f of list)
64339
64547
  ajv.addFormat(f, fs51[f]);
64340
64548
  }
@@ -75294,8 +75502,8 @@ var CookieJar = class {
75294
75502
  get cookies() {
75295
75503
  const now = Date.now();
75296
75504
  this._cookies.forEach((cookie, name) => {
75297
- var _a;
75298
- if (((_a = cookie.expires) === null || _a === void 0 ? void 0 : _a.getTime()) < now) {
75505
+ var _a2;
75506
+ if (((_a2 = cookie.expires) === null || _a2 === void 0 ? void 0 : _a2.getTime()) < now) {
75299
75507
  this._cookies.delete(name);
75300
75508
  }
75301
75509
  });
@@ -75756,7 +75964,7 @@ var Request = class _Request extends import_component_emitter2.Emitter {
75756
75964
  * @private
75757
75965
  */
75758
75966
  _create() {
75759
- var _a;
75967
+ var _a2;
75760
75968
  const opts = pick(this._opts, "agent", "pfx", "key", "passphrase", "cert", "ca", "ciphers", "rejectUnauthorized", "autoUnref");
75761
75969
  opts.xdomain = !!this._opts.xd;
75762
75970
  const xhr = this._xhr = this.createRequest(opts);
@@ -75784,7 +75992,7 @@ var Request = class _Request extends import_component_emitter2.Emitter {
75784
75992
  xhr.setRequestHeader("Accept", "*/*");
75785
75993
  } catch (e) {
75786
75994
  }
75787
- (_a = this._opts.cookieJar) === null || _a === void 0 ? void 0 : _a.addCookies(xhr);
75995
+ (_a2 = this._opts.cookieJar) === null || _a2 === void 0 ? void 0 : _a2.addCookies(xhr);
75788
75996
  if ("withCredentials" in xhr) {
75789
75997
  xhr.withCredentials = this._opts.withCredentials;
75790
75998
  }
@@ -75792,9 +76000,9 @@ var Request = class _Request extends import_component_emitter2.Emitter {
75792
76000
  xhr.timeout = this._opts.requestTimeout;
75793
76001
  }
75794
76002
  xhr.onreadystatechange = () => {
75795
- var _a2;
76003
+ var _a3;
75796
76004
  if (xhr.readyState === 3) {
75797
- (_a2 = this._opts.cookieJar) === null || _a2 === void 0 ? void 0 : _a2.parseCookies(
76005
+ (_a3 = this._opts.cookieJar) === null || _a3 === void 0 ? void 0 : _a3.parseCookies(
75798
76006
  // @ts-ignore
75799
76007
  xhr.getResponseHeader("set-cookie")
75800
76008
  );
@@ -75917,8 +76125,8 @@ function newRequest(opts) {
75917
76125
  var XMLHttpRequest2 = XMLHttpRequestModule.default || XMLHttpRequestModule;
75918
76126
  var XHR = class extends BaseXHR {
75919
76127
  request(opts = {}) {
75920
- var _a;
75921
- Object.assign(opts, { xd: this.xd, cookieJar: (_a = this.socket) === null || _a === void 0 ? void 0 : _a._cookieJar }, this.opts);
76128
+ var _a2;
76129
+ Object.assign(opts, { xd: this.xd, cookieJar: (_a2 = this.socket) === null || _a2 === void 0 ? void 0 : _a2._cookieJar }, this.opts);
75922
76130
  return new Request((opts2) => new XMLHttpRequest2(opts2), this.uri(), opts);
75923
76131
  }
75924
76132
  };
@@ -76022,8 +76230,8 @@ var WebSocketCtor = globalThisShim.WebSocket || globalThisShim.MozWebSocket;
76022
76230
  // node_modules/engine.io-client/build/esm-debug/transports/websocket.node.js
76023
76231
  var WS = class extends BaseWS {
76024
76232
  createSocket(uri, protocols, opts) {
76025
- var _a;
76026
- if ((_a = this.socket) === null || _a === void 0 ? void 0 : _a._cookieJar) {
76233
+ var _a2;
76234
+ if ((_a2 = this.socket) === null || _a2 === void 0 ? void 0 : _a2._cookieJar) {
76027
76235
  opts.headers = opts.headers || {};
76028
76236
  opts.headers.cookie = typeof opts.headers.cookie === "string" ? [opts.headers.cookie] : opts.headers.cookie || [];
76029
76237
  for (const [name, cookie] of this.socket._cookieJar.cookies) {
@@ -76115,8 +76323,8 @@ var WT = class extends Transport {
76115
76323
  }
76116
76324
  }
76117
76325
  doClose() {
76118
- var _a;
76119
- (_a = this._transport) === null || _a === void 0 ? void 0 : _a.close();
76326
+ var _a2;
76327
+ (_a2 = this._transport) === null || _a2 === void 0 ? void 0 : _a2.close();
76120
76328
  }
76121
76329
  };
76122
76330
 
@@ -77395,7 +77603,7 @@ var Socket2 = class extends import_component_emitter5.Emitter {
77395
77603
  * @return self
77396
77604
  */
77397
77605
  emit(ev, ...args) {
77398
- var _a, _b, _c;
77606
+ var _a2, _b, _c;
77399
77607
  if (RESERVED_EVENTS2.hasOwnProperty(ev)) {
77400
77608
  throw new Error('"' + ev.toString() + '" is a reserved event name');
77401
77609
  }
@@ -77417,7 +77625,7 @@ var Socket2 = class extends import_component_emitter5.Emitter {
77417
77625
  this._registerAckCallback(id, ack);
77418
77626
  packet.id = id;
77419
77627
  }
77420
- const isTransportWritable = (_b = (_a = this.io.engine) === null || _a === void 0 ? void 0 : _a.transport) === null || _b === void 0 ? void 0 : _b.writable;
77628
+ const isTransportWritable = (_b = (_a2 = this.io.engine) === null || _a2 === void 0 ? void 0 : _a2.transport) === null || _b === void 0 ? void 0 : _b.writable;
77421
77629
  const isConnected = this.connected && !((_c = this.io.engine) === null || _c === void 0 ? void 0 : _c._hasPingExpired());
77422
77630
  const discardPacket = this.flags.volatile && !isTransportWritable;
77423
77631
  if (discardPacket) {
@@ -77435,8 +77643,8 @@ var Socket2 = class extends import_component_emitter5.Emitter {
77435
77643
  * @private
77436
77644
  */
77437
77645
  _registerAckCallback(id, ack) {
77438
- var _a;
77439
- const timeout = (_a = this.flags.timeout) !== null && _a !== void 0 ? _a : this._opts.ackTimeout;
77646
+ var _a2;
77647
+ const timeout = (_a2 = this.flags.timeout) !== null && _a2 !== void 0 ? _a2 : this._opts.ackTimeout;
77440
77648
  if (timeout === void 0) {
77441
77649
  this.acks[id] = ack;
77442
77650
  return;
@@ -78074,7 +78282,7 @@ var import_debug10 = __toESM(require_src(), 1);
78074
78282
  var debug10 = (0, import_debug10.default)("socket.io-client:manager");
78075
78283
  var Manager = class extends import_component_emitter6.Emitter {
78076
78284
  constructor(uri, opts) {
78077
- var _a;
78285
+ var _a2;
78078
78286
  super();
78079
78287
  this.nsps = {};
78080
78288
  this.subs = [];
@@ -78090,7 +78298,7 @@ var Manager = class extends import_component_emitter6.Emitter {
78090
78298
  this.reconnectionAttempts(opts.reconnectionAttempts || Infinity);
78091
78299
  this.reconnectionDelay(opts.reconnectionDelay || 1e3);
78092
78300
  this.reconnectionDelayMax(opts.reconnectionDelayMax || 5e3);
78093
- this.randomizationFactor((_a = opts.randomizationFactor) !== null && _a !== void 0 ? _a : 0.5);
78301
+ this.randomizationFactor((_a2 = opts.randomizationFactor) !== null && _a2 !== void 0 ? _a2 : 0.5);
78094
78302
  this.backoff = new Backoff({
78095
78303
  min: this.reconnectionDelay(),
78096
78304
  max: this.reconnectionDelayMax(),
@@ -78122,27 +78330,27 @@ var Manager = class extends import_component_emitter6.Emitter {
78122
78330
  return this;
78123
78331
  }
78124
78332
  reconnectionDelay(v) {
78125
- var _a;
78333
+ var _a2;
78126
78334
  if (v === void 0)
78127
78335
  return this._reconnectionDelay;
78128
78336
  this._reconnectionDelay = v;
78129
- (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMin(v);
78337
+ (_a2 = this.backoff) === null || _a2 === void 0 ? void 0 : _a2.setMin(v);
78130
78338
  return this;
78131
78339
  }
78132
78340
  randomizationFactor(v) {
78133
- var _a;
78341
+ var _a2;
78134
78342
  if (v === void 0)
78135
78343
  return this._randomizationFactor;
78136
78344
  this._randomizationFactor = v;
78137
- (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setJitter(v);
78345
+ (_a2 = this.backoff) === null || _a2 === void 0 ? void 0 : _a2.setJitter(v);
78138
78346
  return this;
78139
78347
  }
78140
78348
  reconnectionDelayMax(v) {
78141
- var _a;
78349
+ var _a2;
78142
78350
  if (v === void 0)
78143
78351
  return this._reconnectionDelayMax;
78144
78352
  this._reconnectionDelayMax = v;
78145
- (_a = this.backoff) === null || _a === void 0 ? void 0 : _a.setMax(v);
78353
+ (_a2 = this.backoff) === null || _a2 === void 0 ? void 0 : _a2.setMax(v);
78146
78354
  return this;
78147
78355
  }
78148
78356
  timeout(v) {
@@ -78369,10 +78577,10 @@ var Manager = class extends import_component_emitter6.Emitter {
78369
78577
  * @private
78370
78578
  */
78371
78579
  onclose(reason, description) {
78372
- var _a;
78580
+ var _a2;
78373
78581
  debug10("closed due to %s", reason);
78374
78582
  this.cleanup();
78375
- (_a = this.engine) === null || _a === void 0 ? void 0 : _a.close();
78583
+ (_a2 = this.engine) === null || _a2 === void 0 ? void 0 : _a2.close();
78376
78584
  this.backoff.reset();
78377
78585
  this._readyState = "closed";
78378
78586
  this.emitReserved("close", reason, description);
@@ -83735,12 +83943,12 @@ var NEVER2 = Object.freeze({
83735
83943
  // @__NO_SIDE_EFFECTS__
83736
83944
  function $constructor(name, initializer3, params) {
83737
83945
  function init(inst, def) {
83738
- var _a;
83946
+ var _a2;
83739
83947
  Object.defineProperty(inst, "_zod", {
83740
83948
  value: inst._zod ?? {},
83741
83949
  enumerable: false
83742
83950
  });
83743
- (_a = inst._zod).traits ?? (_a.traits = /* @__PURE__ */ new Set());
83951
+ (_a2 = inst._zod).traits ?? (_a2.traits = /* @__PURE__ */ new Set());
83744
83952
  inst._zod.traits.add(name);
83745
83953
  initializer3(inst, def);
83746
83954
  for (const k in _.prototype) {
@@ -83755,10 +83963,10 @@ function $constructor(name, initializer3, params) {
83755
83963
  }
83756
83964
  Object.defineProperty(Definition, "name", { value: name });
83757
83965
  function _(def) {
83758
- var _a;
83966
+ var _a2;
83759
83967
  const inst = params?.Parent ? new Definition() : this;
83760
83968
  init(inst, def);
83761
- (_a = inst._zod).deferred ?? (_a.deferred = []);
83969
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
83762
83970
  for (const fn of inst._zod.deferred) {
83763
83971
  fn();
83764
83972
  }
@@ -84248,8 +84456,8 @@ function aborted(x, startIndex = 0) {
84248
84456
  }
84249
84457
  function prefixIssues(path51, issues) {
84250
84458
  return issues.map((iss) => {
84251
- var _a;
84252
- (_a = iss).path ?? (_a.path = []);
84459
+ var _a2;
84460
+ (_a2 = iss).path ?? (_a2.path = []);
84253
84461
  iss.path.unshift(path51);
84254
84462
  return iss;
84255
84463
  });
@@ -84495,10 +84703,10 @@ var uppercase = /^[^a-z]*$/;
84495
84703
 
84496
84704
  // node_modules/zod/v4/core/checks.js
84497
84705
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
84498
- var _a;
84706
+ var _a2;
84499
84707
  inst._zod ?? (inst._zod = {});
84500
84708
  inst._zod.def = def;
84501
- (_a = inst._zod).onattach ?? (_a.onattach = []);
84709
+ (_a2 = inst._zod).onattach ?? (_a2.onattach = []);
84502
84710
  });
84503
84711
  var numericOriginMap = {
84504
84712
  number: "number",
@@ -84564,8 +84772,8 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
84564
84772
  var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
84565
84773
  $ZodCheck.init(inst, def);
84566
84774
  inst._zod.onattach.push((inst2) => {
84567
- var _a;
84568
- (_a = inst2._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
84775
+ var _a2;
84776
+ (_a2 = inst2._zod.bag).multipleOf ?? (_a2.multipleOf = def.value);
84569
84777
  });
84570
84778
  inst._zod.check = (payload) => {
84571
84779
  if (typeof payload.value !== typeof def.value)
@@ -84658,9 +84866,9 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
84658
84866
  };
84659
84867
  });
84660
84868
  var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
84661
- var _a;
84869
+ var _a2;
84662
84870
  $ZodCheck.init(inst, def);
84663
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
84871
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
84664
84872
  const val = payload.value;
84665
84873
  return !nullish(val) && val.length !== void 0;
84666
84874
  });
@@ -84687,9 +84895,9 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
84687
84895
  };
84688
84896
  });
84689
84897
  var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
84690
- var _a;
84898
+ var _a2;
84691
84899
  $ZodCheck.init(inst, def);
84692
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
84900
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
84693
84901
  const val = payload.value;
84694
84902
  return !nullish(val) && val.length !== void 0;
84695
84903
  });
@@ -84716,9 +84924,9 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
84716
84924
  };
84717
84925
  });
84718
84926
  var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
84719
- var _a;
84927
+ var _a2;
84720
84928
  $ZodCheck.init(inst, def);
84721
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
84929
+ (_a2 = inst._zod.def).when ?? (_a2.when = (payload) => {
84722
84930
  const val = payload.value;
84723
84931
  return !nullish(val) && val.length !== void 0;
84724
84932
  });
@@ -84747,7 +84955,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
84747
84955
  };
84748
84956
  });
84749
84957
  var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
84750
- var _a, _b;
84958
+ var _a2, _b;
84751
84959
  $ZodCheck.init(inst, def);
84752
84960
  inst._zod.onattach.push((inst2) => {
84753
84961
  const bag = inst2._zod.bag;
@@ -84758,7 +84966,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
84758
84966
  }
84759
84967
  });
84760
84968
  if (def.pattern)
84761
- (_a = inst._zod).check ?? (_a.check = (payload) => {
84969
+ (_a2 = inst._zod).check ?? (_a2.check = (payload) => {
84762
84970
  def.pattern.lastIndex = 0;
84763
84971
  if (def.pattern.test(payload.value))
84764
84972
  return;
@@ -84923,7 +85131,7 @@ var version = {
84923
85131
 
84924
85132
  // node_modules/zod/v4/core/schemas.js
84925
85133
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
84926
- var _a;
85134
+ var _a2;
84927
85135
  inst ?? (inst = {});
84928
85136
  inst._zod.def = def;
84929
85137
  inst._zod.bag = inst._zod.bag || {};
@@ -84938,7 +85146,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
84938
85146
  }
84939
85147
  }
84940
85148
  if (checks.length === 0) {
84941
- (_a = inst._zod).deferred ?? (_a.deferred = []);
85149
+ (_a2 = inst._zod).deferred ?? (_a2.deferred = []);
84942
85150
  inst._zod.deferred?.push(() => {
84943
85151
  inst._zod.run = inst._zod.parse;
84944
85152
  });
@@ -86777,7 +86985,7 @@ var JSONSchemaGenerator = class {
86777
86985
  this.seen = /* @__PURE__ */ new Map();
86778
86986
  }
86779
86987
  process(schema2, _params = { path: [], schemaPath: [] }) {
86780
- var _a;
86988
+ var _a2;
86781
86989
  const def = schema2._zod.def;
86782
86990
  const formatMap = {
86783
86991
  guid: "uuid",
@@ -87239,7 +87447,7 @@ var JSONSchemaGenerator = class {
87239
87447
  delete result.schema.default;
87240
87448
  }
87241
87449
  if (this.io === "input" && result.schema._prefault)
87242
- (_a = result.schema).default ?? (_a.default = result.schema._prefault);
87450
+ (_a2 = result.schema).default ?? (_a2.default = result.schema._prefault);
87243
87451
  delete result.schema._prefault;
87244
87452
  const _result = this.seen.get(schema2);
87245
87453
  return _result.schema;
@@ -107590,7 +107798,7 @@ async function mcpSetupCommand(options, deps) {
107590
107798
 
107591
107799
  // src/cli/index.ts
107592
107800
  init_error_utils();
107593
- var version2 = true ? "0.12.0" : "0.0.0-dev";
107801
+ var version2 = true ? "0.12.1" : "0.0.0-dev";
107594
107802
  var program2 = new Command();
107595
107803
  program2.name("flow-weaver").description("Flow Weaver Annotations - Compile and validate workflow files").version(version2, "-v, --version", "Output the current version");
107596
107804
  program2.configureOutput({
@@ -0,0 +1,2 @@
1
+ export declare const VERSION = "0.12.1";
2
+ //# sourceMappingURL=generated-version.d.ts.map
@@ -0,0 +1,3 @@
1
+ // Auto-generated by scripts/generate-version.ts — do not edit manually
2
+ export const VERSION = '0.12.1';
3
+ //# sourceMappingURL=generated-version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synergenius/flow-weaver",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "description": "Deterministic workflow compiler for AI agents. Compiles to standalone TypeScript, no runtime dependencies.",
5
5
  "private": false,
6
6
  "type": "module",
@@ -83,6 +83,7 @@
83
83
  "LICENSE"
84
84
  ],
85
85
  "scripts": {
86
+ "prebuild": "tsx scripts/generate-version.ts",
86
87
  "build": "rimraf dist .tsbuildinfo && tsc -p tsconfig.build.json && npm run build:cli",
87
88
  "postbuild": "npx tsx scripts/postbuild.ts && npm run generate:docs",
88
89
  "generate:docs": "tsx scripts/generate-docs.ts",