mrvn-cli 0.2.8 → 0.2.9

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.js CHANGED
@@ -333,13 +333,10 @@ var DocumentStore = class {
333
333
  if (!prefix) {
334
334
  throw new Error(`Unknown document type: ${type}`);
335
335
  }
336
- const dirName = this.typeDirs[type];
337
- const dir = path3.join(this.docsDir, dirName);
338
- if (!fs3.existsSync(dir)) return `${prefix}-001`;
339
- const files = fs3.readdirSync(dir).filter((f) => f.endsWith(".md"));
336
+ const pattern = new RegExp(`^${prefix}-(\\d+)$`);
340
337
  let maxNum = 0;
341
- for (const file2 of files) {
342
- const match = file2.match(new RegExp(`^${prefix}-(\\d+)\\.md$`));
338
+ for (const id of this.index.keys()) {
339
+ const match = id.match(pattern);
343
340
  if (match) {
344
341
  maxNum = Math.max(maxNum, parseInt(match[1], 10));
345
342
  }
@@ -500,14 +497,14 @@ function getPersona(idOrShortName) {
500
497
  function listPersonas() {
501
498
  return [...BUILTIN_PERSONAS];
502
499
  }
503
- function resolvePersonaId(input3) {
504
- const persona = getPersona(input3);
500
+ function resolvePersonaId(input4) {
501
+ const persona = getPersona(input4);
505
502
  if (!persona) {
506
503
  const available = BUILTIN_PERSONAS.map(
507
504
  (p) => `${p.shortName} (${p.name})`
508
505
  ).join(", ");
509
506
  throw new Error(
510
- `Unknown persona "${input3}". Available: ${available}`
507
+ `Unknown persona "${input4}". Available: ${available}`
511
508
  );
512
509
  }
513
510
  return persona.id;
@@ -1266,8 +1263,8 @@ function cached(getter) {
1266
1263
  }
1267
1264
  };
1268
1265
  }
1269
- function nullish(input3) {
1270
- return input3 === null || input3 === void 0;
1266
+ function nullish(input4) {
1267
+ return input4 === null || input4 === void 0;
1271
1268
  }
1272
1269
  function cleanRegex(source) {
1273
1270
  const start = source.startsWith("^") ? 1 : 0;
@@ -1361,8 +1358,8 @@ function randomString(length = 10) {
1361
1358
  function esc(str) {
1362
1359
  return JSON.stringify(str);
1363
1360
  }
1364
- function slugify2(input3) {
1365
- return input3.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
1361
+ function slugify2(input4) {
1362
+ return input4.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
1366
1363
  }
1367
1364
  var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
1368
1365
  };
@@ -1744,19 +1741,19 @@ function finalizeIssue(iss, ctx, config2) {
1744
1741
  }
1745
1742
  return full;
1746
1743
  }
1747
- function getSizableOrigin(input3) {
1748
- if (input3 instanceof Set)
1744
+ function getSizableOrigin(input4) {
1745
+ if (input4 instanceof Set)
1749
1746
  return "set";
1750
- if (input3 instanceof Map)
1747
+ if (input4 instanceof Map)
1751
1748
  return "map";
1752
- if (input3 instanceof File)
1749
+ if (input4 instanceof File)
1753
1750
  return "file";
1754
1751
  return "unknown";
1755
1752
  }
1756
- function getLengthableOrigin(input3) {
1757
- if (Array.isArray(input3))
1753
+ function getLengthableOrigin(input4) {
1754
+ if (Array.isArray(input4))
1758
1755
  return "array";
1759
- if (typeof input3 === "string")
1756
+ if (typeof input4 === "string")
1760
1757
  return "string";
1761
1758
  return "unknown";
1762
1759
  }
@@ -1782,12 +1779,12 @@ function parsedType(data) {
1782
1779
  return t;
1783
1780
  }
1784
1781
  function issue(...args) {
1785
- const [iss, input3, inst] = args;
1782
+ const [iss, input4, inst] = args;
1786
1783
  if (typeof iss === "string") {
1787
1784
  return {
1788
1785
  message: iss,
1789
1786
  code: "custom",
1790
- input: input3,
1787
+ input: input4,
1791
1788
  inst
1792
1789
  };
1793
1790
  }
@@ -2326,23 +2323,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2326
2323
  bag.pattern = integer;
2327
2324
  });
2328
2325
  inst._zod.check = (payload) => {
2329
- const input3 = payload.value;
2326
+ const input4 = payload.value;
2330
2327
  if (isInt) {
2331
- if (!Number.isInteger(input3)) {
2328
+ if (!Number.isInteger(input4)) {
2332
2329
  payload.issues.push({
2333
2330
  expected: origin,
2334
2331
  format: def.format,
2335
2332
  code: "invalid_type",
2336
2333
  continue: false,
2337
- input: input3,
2334
+ input: input4,
2338
2335
  inst
2339
2336
  });
2340
2337
  return;
2341
2338
  }
2342
- if (!Number.isSafeInteger(input3)) {
2343
- if (input3 > 0) {
2339
+ if (!Number.isSafeInteger(input4)) {
2340
+ if (input4 > 0) {
2344
2341
  payload.issues.push({
2345
- input: input3,
2342
+ input: input4,
2346
2343
  code: "too_big",
2347
2344
  maximum: Number.MAX_SAFE_INTEGER,
2348
2345
  note: "Integers must be within the safe integer range.",
@@ -2353,7 +2350,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2353
2350
  });
2354
2351
  } else {
2355
2352
  payload.issues.push({
2356
- input: input3,
2353
+ input: input4,
2357
2354
  code: "too_small",
2358
2355
  minimum: Number.MIN_SAFE_INTEGER,
2359
2356
  note: "Integers must be within the safe integer range.",
@@ -2366,10 +2363,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2366
2363
  return;
2367
2364
  }
2368
2365
  }
2369
- if (input3 < minimum) {
2366
+ if (input4 < minimum) {
2370
2367
  payload.issues.push({
2371
2368
  origin: "number",
2372
- input: input3,
2369
+ input: input4,
2373
2370
  code: "too_small",
2374
2371
  minimum,
2375
2372
  inclusive: true,
@@ -2377,10 +2374,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
2377
2374
  continue: !def.abort
2378
2375
  });
2379
2376
  }
2380
- if (input3 > maximum) {
2377
+ if (input4 > maximum) {
2381
2378
  payload.issues.push({
2382
2379
  origin: "number",
2383
- input: input3,
2380
+ input: input4,
2384
2381
  code: "too_big",
2385
2382
  maximum,
2386
2383
  inclusive: true,
@@ -2400,11 +2397,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
2400
2397
  bag.maximum = maximum;
2401
2398
  });
2402
2399
  inst._zod.check = (payload) => {
2403
- const input3 = payload.value;
2404
- if (input3 < minimum) {
2400
+ const input4 = payload.value;
2401
+ if (input4 < minimum) {
2405
2402
  payload.issues.push({
2406
2403
  origin: "bigint",
2407
- input: input3,
2404
+ input: input4,
2408
2405
  code: "too_small",
2409
2406
  minimum,
2410
2407
  inclusive: true,
@@ -2412,10 +2409,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
2412
2409
  continue: !def.abort
2413
2410
  });
2414
2411
  }
2415
- if (input3 > maximum) {
2412
+ if (input4 > maximum) {
2416
2413
  payload.issues.push({
2417
2414
  origin: "bigint",
2418
- input: input3,
2415
+ input: input4,
2419
2416
  code: "too_big",
2420
2417
  maximum,
2421
2418
  inclusive: true,
@@ -2438,16 +2435,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
2438
2435
  inst2._zod.bag.maximum = def.maximum;
2439
2436
  });
2440
2437
  inst._zod.check = (payload) => {
2441
- const input3 = payload.value;
2442
- const size = input3.size;
2438
+ const input4 = payload.value;
2439
+ const size = input4.size;
2443
2440
  if (size <= def.maximum)
2444
2441
  return;
2445
2442
  payload.issues.push({
2446
- origin: getSizableOrigin(input3),
2443
+ origin: getSizableOrigin(input4),
2447
2444
  code: "too_big",
2448
2445
  maximum: def.maximum,
2449
2446
  inclusive: true,
2450
- input: input3,
2447
+ input: input4,
2451
2448
  inst,
2452
2449
  continue: !def.abort
2453
2450
  });
@@ -2466,16 +2463,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
2466
2463
  inst2._zod.bag.minimum = def.minimum;
2467
2464
  });
2468
2465
  inst._zod.check = (payload) => {
2469
- const input3 = payload.value;
2470
- const size = input3.size;
2466
+ const input4 = payload.value;
2467
+ const size = input4.size;
2471
2468
  if (size >= def.minimum)
2472
2469
  return;
2473
2470
  payload.issues.push({
2474
- origin: getSizableOrigin(input3),
2471
+ origin: getSizableOrigin(input4),
2475
2472
  code: "too_small",
2476
2473
  minimum: def.minimum,
2477
2474
  inclusive: true,
2478
- input: input3,
2475
+ input: input4,
2479
2476
  inst,
2480
2477
  continue: !def.abort
2481
2478
  });
@@ -2495,13 +2492,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
2495
2492
  bag.size = def.size;
2496
2493
  });
2497
2494
  inst._zod.check = (payload) => {
2498
- const input3 = payload.value;
2499
- const size = input3.size;
2495
+ const input4 = payload.value;
2496
+ const size = input4.size;
2500
2497
  if (size === def.size)
2501
2498
  return;
2502
2499
  const tooBig = size > def.size;
2503
2500
  payload.issues.push({
2504
- origin: getSizableOrigin(input3),
2501
+ origin: getSizableOrigin(input4),
2505
2502
  ...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
2506
2503
  inclusive: true,
2507
2504
  exact: true,
@@ -2524,17 +2521,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
2524
2521
  inst2._zod.bag.maximum = def.maximum;
2525
2522
  });
2526
2523
  inst._zod.check = (payload) => {
2527
- const input3 = payload.value;
2528
- const length = input3.length;
2524
+ const input4 = payload.value;
2525
+ const length = input4.length;
2529
2526
  if (length <= def.maximum)
2530
2527
  return;
2531
- const origin = getLengthableOrigin(input3);
2528
+ const origin = getLengthableOrigin(input4);
2532
2529
  payload.issues.push({
2533
2530
  origin,
2534
2531
  code: "too_big",
2535
2532
  maximum: def.maximum,
2536
2533
  inclusive: true,
2537
- input: input3,
2534
+ input: input4,
2538
2535
  inst,
2539
2536
  continue: !def.abort
2540
2537
  });
@@ -2553,17 +2550,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
2553
2550
  inst2._zod.bag.minimum = def.minimum;
2554
2551
  });
2555
2552
  inst._zod.check = (payload) => {
2556
- const input3 = payload.value;
2557
- const length = input3.length;
2553
+ const input4 = payload.value;
2554
+ const length = input4.length;
2558
2555
  if (length >= def.minimum)
2559
2556
  return;
2560
- const origin = getLengthableOrigin(input3);
2557
+ const origin = getLengthableOrigin(input4);
2561
2558
  payload.issues.push({
2562
2559
  origin,
2563
2560
  code: "too_small",
2564
2561
  minimum: def.minimum,
2565
2562
  inclusive: true,
2566
- input: input3,
2563
+ input: input4,
2567
2564
  inst,
2568
2565
  continue: !def.abort
2569
2566
  });
@@ -2583,11 +2580,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
2583
2580
  bag.length = def.length;
2584
2581
  });
2585
2582
  inst._zod.check = (payload) => {
2586
- const input3 = payload.value;
2587
- const length = input3.length;
2583
+ const input4 = payload.value;
2584
+ const length = input4.length;
2588
2585
  if (length === def.length)
2589
2586
  return;
2590
- const origin = getLengthableOrigin(input3);
2587
+ const origin = getLengthableOrigin(input4);
2591
2588
  const tooBig = length > def.length;
2592
2589
  payload.issues.push({
2593
2590
  origin,
@@ -3241,15 +3238,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
3241
3238
  payload.value = Number(payload.value);
3242
3239
  } catch (_) {
3243
3240
  }
3244
- const input3 = payload.value;
3245
- if (typeof input3 === "number" && !Number.isNaN(input3) && Number.isFinite(input3)) {
3241
+ const input4 = payload.value;
3242
+ if (typeof input4 === "number" && !Number.isNaN(input4) && Number.isFinite(input4)) {
3246
3243
  return payload;
3247
3244
  }
3248
- const received = typeof input3 === "number" ? Number.isNaN(input3) ? "NaN" : !Number.isFinite(input3) ? "Infinity" : void 0 : void 0;
3245
+ const received = typeof input4 === "number" ? Number.isNaN(input4) ? "NaN" : !Number.isFinite(input4) ? "Infinity" : void 0 : void 0;
3249
3246
  payload.issues.push({
3250
3247
  expected: "number",
3251
3248
  code: "invalid_type",
3252
- input: input3,
3249
+ input: input4,
3253
3250
  inst,
3254
3251
  ...received ? { received } : {}
3255
3252
  });
@@ -3269,13 +3266,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
3269
3266
  payload.value = Boolean(payload.value);
3270
3267
  } catch (_) {
3271
3268
  }
3272
- const input3 = payload.value;
3273
- if (typeof input3 === "boolean")
3269
+ const input4 = payload.value;
3270
+ if (typeof input4 === "boolean")
3274
3271
  return payload;
3275
3272
  payload.issues.push({
3276
3273
  expected: "boolean",
3277
3274
  code: "invalid_type",
3278
- input: input3,
3275
+ input: input4,
3279
3276
  inst
3280
3277
  });
3281
3278
  return payload;
@@ -3308,13 +3305,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
3308
3305
  var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
3309
3306
  $ZodType.init(inst, def);
3310
3307
  inst._zod.parse = (payload, _ctx) => {
3311
- const input3 = payload.value;
3312
- if (typeof input3 === "symbol")
3308
+ const input4 = payload.value;
3309
+ if (typeof input4 === "symbol")
3313
3310
  return payload;
3314
3311
  payload.issues.push({
3315
3312
  expected: "symbol",
3316
3313
  code: "invalid_type",
3317
- input: input3,
3314
+ input: input4,
3318
3315
  inst
3319
3316
  });
3320
3317
  return payload;
@@ -3327,13 +3324,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
3327
3324
  inst._zod.optin = "optional";
3328
3325
  inst._zod.optout = "optional";
3329
3326
  inst._zod.parse = (payload, _ctx) => {
3330
- const input3 = payload.value;
3331
- if (typeof input3 === "undefined")
3327
+ const input4 = payload.value;
3328
+ if (typeof input4 === "undefined")
3332
3329
  return payload;
3333
3330
  payload.issues.push({
3334
3331
  expected: "undefined",
3335
3332
  code: "invalid_type",
3336
- input: input3,
3333
+ input: input4,
3337
3334
  inst
3338
3335
  });
3339
3336
  return payload;
@@ -3344,13 +3341,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
3344
3341
  inst._zod.pattern = _null;
3345
3342
  inst._zod.values = /* @__PURE__ */ new Set([null]);
3346
3343
  inst._zod.parse = (payload, _ctx) => {
3347
- const input3 = payload.value;
3348
- if (input3 === null)
3344
+ const input4 = payload.value;
3345
+ if (input4 === null)
3349
3346
  return payload;
3350
3347
  payload.issues.push({
3351
3348
  expected: "null",
3352
3349
  code: "invalid_type",
3353
- input: input3,
3350
+ input: input4,
3354
3351
  inst
3355
3352
  });
3356
3353
  return payload;
@@ -3379,13 +3376,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
3379
3376
  var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
3380
3377
  $ZodType.init(inst, def);
3381
3378
  inst._zod.parse = (payload, _ctx) => {
3382
- const input3 = payload.value;
3383
- if (typeof input3 === "undefined")
3379
+ const input4 = payload.value;
3380
+ if (typeof input4 === "undefined")
3384
3381
  return payload;
3385
3382
  payload.issues.push({
3386
3383
  expected: "void",
3387
3384
  code: "invalid_type",
3388
- input: input3,
3385
+ input: input4,
3389
3386
  inst
3390
3387
  });
3391
3388
  return payload;
@@ -3400,15 +3397,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
3400
3397
  } catch (_err) {
3401
3398
  }
3402
3399
  }
3403
- const input3 = payload.value;
3404
- const isDate = input3 instanceof Date;
3405
- const isValidDate = isDate && !Number.isNaN(input3.getTime());
3400
+ const input4 = payload.value;
3401
+ const isDate = input4 instanceof Date;
3402
+ const isValidDate = isDate && !Number.isNaN(input4.getTime());
3406
3403
  if (isValidDate)
3407
3404
  return payload;
3408
3405
  payload.issues.push({
3409
3406
  expected: "date",
3410
3407
  code: "invalid_type",
3411
- input: input3,
3408
+ input: input4,
3412
3409
  ...isDate ? { received: "Invalid Date" } : {},
3413
3410
  inst
3414
3411
  });
@@ -3424,20 +3421,20 @@ function handleArrayResult(result, final, index) {
3424
3421
  var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3425
3422
  $ZodType.init(inst, def);
3426
3423
  inst._zod.parse = (payload, ctx) => {
3427
- const input3 = payload.value;
3428
- if (!Array.isArray(input3)) {
3424
+ const input4 = payload.value;
3425
+ if (!Array.isArray(input4)) {
3429
3426
  payload.issues.push({
3430
3427
  expected: "array",
3431
3428
  code: "invalid_type",
3432
- input: input3,
3429
+ input: input4,
3433
3430
  inst
3434
3431
  });
3435
3432
  return payload;
3436
3433
  }
3437
- payload.value = Array(input3.length);
3434
+ payload.value = Array(input4.length);
3438
3435
  const proms = [];
3439
- for (let i = 0; i < input3.length; i++) {
3440
- const item = input3[i];
3436
+ for (let i = 0; i < input4.length; i++) {
3437
+ const item = input4[i];
3441
3438
  const result = def.element._zod.run({
3442
3439
  value: item,
3443
3440
  issues: []
@@ -3454,15 +3451,15 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
3454
3451
  return payload;
3455
3452
  };
3456
3453
  });
3457
- function handlePropertyResult(result, final, key, input3, isOptionalOut) {
3454
+ function handlePropertyResult(result, final, key, input4, isOptionalOut) {
3458
3455
  if (result.issues.length) {
3459
- if (isOptionalOut && !(key in input3)) {
3456
+ if (isOptionalOut && !(key in input4)) {
3460
3457
  return;
3461
3458
  }
3462
3459
  final.issues.push(...prefixIssues(key, result.issues));
3463
3460
  }
3464
3461
  if (result.value === void 0) {
3465
- if (key in input3) {
3462
+ if (key in input4) {
3466
3463
  final.value[key] = void 0;
3467
3464
  }
3468
3465
  } else {
@@ -3485,31 +3482,31 @@ function normalizeDef(def) {
3485
3482
  optionalKeys: new Set(okeys)
3486
3483
  };
3487
3484
  }
3488
- function handleCatchall(proms, input3, payload, ctx, def, inst) {
3485
+ function handleCatchall(proms, input4, payload, ctx, def, inst) {
3489
3486
  const unrecognized = [];
3490
3487
  const keySet = def.keySet;
3491
3488
  const _catchall = def.catchall._zod;
3492
3489
  const t = _catchall.def.type;
3493
3490
  const isOptionalOut = _catchall.optout === "optional";
3494
- for (const key in input3) {
3491
+ for (const key in input4) {
3495
3492
  if (keySet.has(key))
3496
3493
  continue;
3497
3494
  if (t === "never") {
3498
3495
  unrecognized.push(key);
3499
3496
  continue;
3500
3497
  }
3501
- const r = _catchall.run({ value: input3[key], issues: [] }, ctx);
3498
+ const r = _catchall.run({ value: input4[key], issues: [] }, ctx);
3502
3499
  if (r instanceof Promise) {
3503
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input3, isOptionalOut)));
3500
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input4, isOptionalOut)));
3504
3501
  } else {
3505
- handlePropertyResult(r, payload, key, input3, isOptionalOut);
3502
+ handlePropertyResult(r, payload, key, input4, isOptionalOut);
3506
3503
  }
3507
3504
  }
3508
3505
  if (unrecognized.length) {
3509
3506
  payload.issues.push({
3510
3507
  code: "unrecognized_keys",
3511
3508
  keys: unrecognized,
3512
- input: input3,
3509
+ input: input4,
3513
3510
  inst
3514
3511
  });
3515
3512
  }
@@ -3553,12 +3550,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3553
3550
  let value;
3554
3551
  inst._zod.parse = (payload, ctx) => {
3555
3552
  value ?? (value = _normalized.value);
3556
- const input3 = payload.value;
3557
- if (!isObject2(input3)) {
3553
+ const input4 = payload.value;
3554
+ if (!isObject2(input4)) {
3558
3555
  payload.issues.push({
3559
3556
  expected: "object",
3560
3557
  code: "invalid_type",
3561
- input: input3,
3558
+ input: input4,
3562
3559
  inst
3563
3560
  });
3564
3561
  return payload;
@@ -3569,17 +3566,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
3569
3566
  for (const key of value.keys) {
3570
3567
  const el = shape[key];
3571
3568
  const isOptionalOut = el._zod.optout === "optional";
3572
- const r = el._zod.run({ value: input3[key], issues: [] }, ctx);
3569
+ const r = el._zod.run({ value: input4[key], issues: [] }, ctx);
3573
3570
  if (r instanceof Promise) {
3574
- proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input3, isOptionalOut)));
3571
+ proms.push(r.then((r2) => handlePropertyResult(r2, payload, key, input4, isOptionalOut)));
3575
3572
  } else {
3576
- handlePropertyResult(r, payload, key, input3, isOptionalOut);
3573
+ handlePropertyResult(r, payload, key, input4, isOptionalOut);
3577
3574
  }
3578
3575
  }
3579
3576
  if (!catchall) {
3580
3577
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
3581
3578
  }
3582
- return handleCatchall(proms, input3, payload, ctx, _normalized.value, inst);
3579
+ return handleCatchall(proms, input4, payload, ctx, _normalized.value, inst);
3583
3580
  };
3584
3581
  });
3585
3582
  var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -3660,12 +3657,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3660
3657
  let value;
3661
3658
  inst._zod.parse = (payload, ctx) => {
3662
3659
  value ?? (value = _normalized.value);
3663
- const input3 = payload.value;
3664
- if (!isObject2(input3)) {
3660
+ const input4 = payload.value;
3661
+ if (!isObject2(input4)) {
3665
3662
  payload.issues.push({
3666
3663
  expected: "object",
3667
3664
  code: "invalid_type",
3668
- input: input3,
3665
+ input: input4,
3669
3666
  inst
3670
3667
  });
3671
3668
  return payload;
@@ -3676,7 +3673,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
3676
3673
  payload = fastpass(payload, ctx);
3677
3674
  if (!catchall)
3678
3675
  return payload;
3679
- return handleCatchall([], input3, payload, ctx, value, inst);
3676
+ return handleCatchall([], input4, payload, ctx, value, inst);
3680
3677
  }
3681
3678
  return superParse(payload, ctx);
3682
3679
  };
@@ -3838,17 +3835,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3838
3835
  return map2;
3839
3836
  });
3840
3837
  inst._zod.parse = (payload, ctx) => {
3841
- const input3 = payload.value;
3842
- if (!isObject(input3)) {
3838
+ const input4 = payload.value;
3839
+ if (!isObject(input4)) {
3843
3840
  payload.issues.push({
3844
3841
  code: "invalid_type",
3845
3842
  expected: "object",
3846
- input: input3,
3843
+ input: input4,
3847
3844
  inst
3848
3845
  });
3849
3846
  return payload;
3850
3847
  }
3851
- const opt = disc.value.get(input3?.[def.discriminator]);
3848
+ const opt = disc.value.get(input4?.[def.discriminator]);
3852
3849
  if (opt) {
3853
3850
  return opt._zod.run(payload, ctx);
3854
3851
  }
@@ -3860,7 +3857,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3860
3857
  errors: [],
3861
3858
  note: "No matching discriminator",
3862
3859
  discriminator: def.discriminator,
3863
- input: input3,
3860
+ input: input4,
3864
3861
  path: [def.discriminator],
3865
3862
  inst
3866
3863
  });
@@ -3870,9 +3867,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
3870
3867
  var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
3871
3868
  $ZodType.init(inst, def);
3872
3869
  inst._zod.parse = (payload, ctx) => {
3873
- const input3 = payload.value;
3874
- const left = def.left._zod.run({ value: input3, issues: [] }, ctx);
3875
- const right = def.right._zod.run({ value: input3, issues: [] }, ctx);
3870
+ const input4 = payload.value;
3871
+ const left = def.left._zod.run({ value: input4, issues: [] }, ctx);
3872
+ const right = def.right._zod.run({ value: input4, issues: [] }, ctx);
3876
3873
  const async = left instanceof Promise || right instanceof Promise;
3877
3874
  if (async) {
3878
3875
  return Promise.all([left, right]).then(([left2, right2]) => {
@@ -3969,10 +3966,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3969
3966
  $ZodType.init(inst, def);
3970
3967
  const items = def.items;
3971
3968
  inst._zod.parse = (payload, ctx) => {
3972
- const input3 = payload.value;
3973
- if (!Array.isArray(input3)) {
3969
+ const input4 = payload.value;
3970
+ if (!Array.isArray(input4)) {
3974
3971
  payload.issues.push({
3975
- input: input3,
3972
+ input: input4,
3976
3973
  inst,
3977
3974
  expected: "tuple",
3978
3975
  code: "invalid_type"
@@ -3984,12 +3981,12 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3984
3981
  const reversedIndex = [...items].reverse().findIndex((item) => item._zod.optin !== "optional");
3985
3982
  const optStart = reversedIndex === -1 ? 0 : items.length - reversedIndex;
3986
3983
  if (!def.rest) {
3987
- const tooBig = input3.length > items.length;
3988
- const tooSmall = input3.length < optStart - 1;
3984
+ const tooBig = input4.length > items.length;
3985
+ const tooSmall = input4.length < optStart - 1;
3989
3986
  if (tooBig || tooSmall) {
3990
3987
  payload.issues.push({
3991
3988
  ...tooBig ? { code: "too_big", maximum: items.length, inclusive: true } : { code: "too_small", minimum: items.length },
3992
- input: input3,
3989
+ input: input4,
3993
3990
  inst,
3994
3991
  origin: "array"
3995
3992
  });
@@ -3999,12 +3996,12 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
3999
3996
  let i = -1;
4000
3997
  for (const item of items) {
4001
3998
  i++;
4002
- if (i >= input3.length) {
3999
+ if (i >= input4.length) {
4003
4000
  if (i >= optStart)
4004
4001
  continue;
4005
4002
  }
4006
4003
  const result = item._zod.run({
4007
- value: input3[i],
4004
+ value: input4[i],
4008
4005
  issues: []
4009
4006
  }, ctx);
4010
4007
  if (result instanceof Promise) {
@@ -4014,7 +4011,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
4014
4011
  }
4015
4012
  }
4016
4013
  if (def.rest) {
4017
- const rest = input3.slice(items.length);
4014
+ const rest = input4.slice(items.length);
4018
4015
  for (const el of rest) {
4019
4016
  i++;
4020
4017
  const result = def.rest._zod.run({
@@ -4042,12 +4039,12 @@ function handleTupleResult(result, final, index) {
4042
4039
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4043
4040
  $ZodType.init(inst, def);
4044
4041
  inst._zod.parse = (payload, ctx) => {
4045
- const input3 = payload.value;
4046
- if (!isPlainObject(input3)) {
4042
+ const input4 = payload.value;
4043
+ if (!isPlainObject(input4)) {
4047
4044
  payload.issues.push({
4048
4045
  expected: "record",
4049
4046
  code: "invalid_type",
4050
- input: input3,
4047
+ input: input4,
4051
4048
  inst
4052
4049
  });
4053
4050
  return payload;
@@ -4060,7 +4057,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4060
4057
  for (const key of values) {
4061
4058
  if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
4062
4059
  recordKeys.add(typeof key === "number" ? key.toString() : key);
4063
- const result = def.valueType._zod.run({ value: input3[key], issues: [] }, ctx);
4060
+ const result = def.valueType._zod.run({ value: input4[key], issues: [] }, ctx);
4064
4061
  if (result instanceof Promise) {
4065
4062
  proms.push(result.then((result2) => {
4066
4063
  if (result2.issues.length) {
@@ -4077,7 +4074,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4077
4074
  }
4078
4075
  }
4079
4076
  let unrecognized;
4080
- for (const key in input3) {
4077
+ for (const key in input4) {
4081
4078
  if (!recordKeys.has(key)) {
4082
4079
  unrecognized = unrecognized ?? [];
4083
4080
  unrecognized.push(key);
@@ -4086,14 +4083,14 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4086
4083
  if (unrecognized && unrecognized.length > 0) {
4087
4084
  payload.issues.push({
4088
4085
  code: "unrecognized_keys",
4089
- input: input3,
4086
+ input: input4,
4090
4087
  inst,
4091
4088
  keys: unrecognized
4092
4089
  });
4093
4090
  }
4094
4091
  } else {
4095
4092
  payload.value = {};
4096
- for (const key of Reflect.ownKeys(input3)) {
4093
+ for (const key of Reflect.ownKeys(input4)) {
4097
4094
  if (key === "__proto__")
4098
4095
  continue;
4099
4096
  let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
@@ -4112,7 +4109,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4112
4109
  }
4113
4110
  if (keyResult.issues.length) {
4114
4111
  if (def.mode === "loose") {
4115
- payload.value[key] = input3[key];
4112
+ payload.value[key] = input4[key];
4116
4113
  } else {
4117
4114
  payload.issues.push({
4118
4115
  code: "invalid_key",
@@ -4125,7 +4122,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4125
4122
  }
4126
4123
  continue;
4127
4124
  }
4128
- const result = def.valueType._zod.run({ value: input3[key], issues: [] }, ctx);
4125
+ const result = def.valueType._zod.run({ value: input4[key], issues: [] }, ctx);
4129
4126
  if (result instanceof Promise) {
4130
4127
  proms.push(result.then((result2) => {
4131
4128
  if (result2.issues.length) {
@@ -4150,27 +4147,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
4150
4147
  var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
4151
4148
  $ZodType.init(inst, def);
4152
4149
  inst._zod.parse = (payload, ctx) => {
4153
- const input3 = payload.value;
4154
- if (!(input3 instanceof Map)) {
4150
+ const input4 = payload.value;
4151
+ if (!(input4 instanceof Map)) {
4155
4152
  payload.issues.push({
4156
4153
  expected: "map",
4157
4154
  code: "invalid_type",
4158
- input: input3,
4155
+ input: input4,
4159
4156
  inst
4160
4157
  });
4161
4158
  return payload;
4162
4159
  }
4163
4160
  const proms = [];
4164
4161
  payload.value = /* @__PURE__ */ new Map();
4165
- for (const [key, value] of input3) {
4162
+ for (const [key, value] of input4) {
4166
4163
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
4167
4164
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
4168
4165
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
4169
4166
  proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
4170
- handleMapResult(keyResult2, valueResult2, payload, key, input3, inst, ctx);
4167
+ handleMapResult(keyResult2, valueResult2, payload, key, input4, inst, ctx);
4171
4168
  }));
4172
4169
  } else {
4173
- handleMapResult(keyResult, valueResult, payload, key, input3, inst, ctx);
4170
+ handleMapResult(keyResult, valueResult, payload, key, input4, inst, ctx);
4174
4171
  }
4175
4172
  }
4176
4173
  if (proms.length)
@@ -4178,7 +4175,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
4178
4175
  return payload;
4179
4176
  };
4180
4177
  });
4181
- function handleMapResult(keyResult, valueResult, final, key, input3, inst, ctx) {
4178
+ function handleMapResult(keyResult, valueResult, final, key, input4, inst, ctx) {
4182
4179
  if (keyResult.issues.length) {
4183
4180
  if (propertyKeyTypes.has(typeof key)) {
4184
4181
  final.issues.push(...prefixIssues(key, keyResult.issues));
@@ -4186,7 +4183,7 @@ function handleMapResult(keyResult, valueResult, final, key, input3, inst, ctx)
4186
4183
  final.issues.push({
4187
4184
  code: "invalid_key",
4188
4185
  origin: "map",
4189
- input: input3,
4186
+ input: input4,
4190
4187
  inst,
4191
4188
  issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
4192
4189
  });
@@ -4199,7 +4196,7 @@ function handleMapResult(keyResult, valueResult, final, key, input3, inst, ctx)
4199
4196
  final.issues.push({
4200
4197
  origin: "map",
4201
4198
  code: "invalid_element",
4202
- input: input3,
4199
+ input: input4,
4203
4200
  inst,
4204
4201
  key,
4205
4202
  issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
@@ -4211,10 +4208,10 @@ function handleMapResult(keyResult, valueResult, final, key, input3, inst, ctx)
4211
4208
  var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
4212
4209
  $ZodType.init(inst, def);
4213
4210
  inst._zod.parse = (payload, ctx) => {
4214
- const input3 = payload.value;
4215
- if (!(input3 instanceof Set)) {
4211
+ const input4 = payload.value;
4212
+ if (!(input4 instanceof Set)) {
4216
4213
  payload.issues.push({
4217
- input: input3,
4214
+ input: input4,
4218
4215
  inst,
4219
4216
  expected: "set",
4220
4217
  code: "invalid_type"
@@ -4223,7 +4220,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
4223
4220
  }
4224
4221
  const proms = [];
4225
4222
  payload.value = /* @__PURE__ */ new Set();
4226
- for (const item of input3) {
4223
+ for (const item of input4) {
4227
4224
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
4228
4225
  if (result instanceof Promise) {
4229
4226
  proms.push(result.then((result2) => handleSetResult(result2, payload)));
@@ -4248,14 +4245,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
4248
4245
  inst._zod.values = valuesSet;
4249
4246
  inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
4250
4247
  inst._zod.parse = (payload, _ctx) => {
4251
- const input3 = payload.value;
4252
- if (valuesSet.has(input3)) {
4248
+ const input4 = payload.value;
4249
+ if (valuesSet.has(input4)) {
4253
4250
  return payload;
4254
4251
  }
4255
4252
  payload.issues.push({
4256
4253
  code: "invalid_value",
4257
4254
  values,
4258
- input: input3,
4255
+ input: input4,
4259
4256
  inst
4260
4257
  });
4261
4258
  return payload;
@@ -4270,14 +4267,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
4270
4267
  inst._zod.values = values;
4271
4268
  inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
4272
4269
  inst._zod.parse = (payload, _ctx) => {
4273
- const input3 = payload.value;
4274
- if (values.has(input3)) {
4270
+ const input4 = payload.value;
4271
+ if (values.has(input4)) {
4275
4272
  return payload;
4276
4273
  }
4277
4274
  payload.issues.push({
4278
4275
  code: "invalid_value",
4279
4276
  values: def.values,
4280
- input: input3,
4277
+ input: input4,
4281
4278
  inst
4282
4279
  });
4283
4280
  return payload;
@@ -4286,13 +4283,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
4286
4283
  var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
4287
4284
  $ZodType.init(inst, def);
4288
4285
  inst._zod.parse = (payload, _ctx) => {
4289
- const input3 = payload.value;
4290
- if (input3 instanceof File)
4286
+ const input4 = payload.value;
4287
+ if (input4 instanceof File)
4291
4288
  return payload;
4292
4289
  payload.issues.push({
4293
4290
  expected: "file",
4294
4291
  code: "invalid_type",
4295
- input: input3,
4292
+ input: input4,
4296
4293
  inst
4297
4294
  });
4298
4295
  return payload;
@@ -4319,8 +4316,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
4319
4316
  return payload;
4320
4317
  };
4321
4318
  });
4322
- function handleOptionalResult(result, input3) {
4323
- if (result.issues.length && input3 === void 0) {
4319
+ function handleOptionalResult(result, input4) {
4320
+ if (result.issues.length && input4 === void 0) {
4324
4321
  return { issues: [], value: void 0 };
4325
4322
  }
4326
4323
  return result;
@@ -4756,20 +4753,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
4756
4753
  return payload;
4757
4754
  };
4758
4755
  inst._zod.check = (payload) => {
4759
- const input3 = payload.value;
4760
- const r = def.fn(input3);
4756
+ const input4 = payload.value;
4757
+ const r = def.fn(input4);
4761
4758
  if (r instanceof Promise) {
4762
- return r.then((r2) => handleRefineResult(r2, payload, input3, inst));
4759
+ return r.then((r2) => handleRefineResult(r2, payload, input4, inst));
4763
4760
  }
4764
- handleRefineResult(r, payload, input3, inst);
4761
+ handleRefineResult(r, payload, input4, inst);
4765
4762
  return;
4766
4763
  };
4767
4764
  });
4768
- function handleRefineResult(result, payload, input3, inst) {
4765
+ function handleRefineResult(result, payload, input4, inst) {
4769
4766
  if (!result) {
4770
4767
  const _iss = {
4771
4768
  code: "custom",
4772
- input: input3,
4769
+ input: input4,
4773
4770
  inst,
4774
4771
  // incorporates params.error into issue reporting
4775
4772
  path: [...inst._zod.def.path ?? []],
@@ -11079,23 +11076,23 @@ function _overwrite(tx) {
11079
11076
  }
11080
11077
  // @__NO_SIDE_EFFECTS__
11081
11078
  function _normalize(form) {
11082
- return /* @__PURE__ */ _overwrite((input3) => input3.normalize(form));
11079
+ return /* @__PURE__ */ _overwrite((input4) => input4.normalize(form));
11083
11080
  }
11084
11081
  // @__NO_SIDE_EFFECTS__
11085
11082
  function _trim() {
11086
- return /* @__PURE__ */ _overwrite((input3) => input3.trim());
11083
+ return /* @__PURE__ */ _overwrite((input4) => input4.trim());
11087
11084
  }
11088
11085
  // @__NO_SIDE_EFFECTS__
11089
11086
  function _toLowerCase() {
11090
- return /* @__PURE__ */ _overwrite((input3) => input3.toLowerCase());
11087
+ return /* @__PURE__ */ _overwrite((input4) => input4.toLowerCase());
11091
11088
  }
11092
11089
  // @__NO_SIDE_EFFECTS__
11093
11090
  function _toUpperCase() {
11094
- return /* @__PURE__ */ _overwrite((input3) => input3.toUpperCase());
11091
+ return /* @__PURE__ */ _overwrite((input4) => input4.toUpperCase());
11095
11092
  }
11096
11093
  // @__NO_SIDE_EFFECTS__
11097
11094
  function _slugify() {
11098
- return /* @__PURE__ */ _overwrite((input3) => slugify2(input3));
11095
+ return /* @__PURE__ */ _overwrite((input4) => slugify2(input4));
11099
11096
  }
11100
11097
  // @__NO_SIDE_EFFECTS__
11101
11098
  function _array(Class2, element, params) {
@@ -11400,8 +11397,8 @@ function _stringbool(Classes, _params) {
11400
11397
  type: "pipe",
11401
11398
  in: stringSchema,
11402
11399
  out: booleanSchema,
11403
- transform: ((input3, payload) => {
11404
- let data = input3;
11400
+ transform: ((input4, payload) => {
11401
+ let data = input4;
11405
11402
  if (params.case !== "sensitive")
11406
11403
  data = data.toLowerCase();
11407
11404
  if (truthySet.has(data)) {
@@ -11420,8 +11417,8 @@ function _stringbool(Classes, _params) {
11420
11417
  return {};
11421
11418
  }
11422
11419
  }),
11423
- reverseTransform: ((input3, _payload) => {
11424
- if (input3 === true) {
11420
+ reverseTransform: ((input4, _payload) => {
11421
+ if (input4 === true) {
11425
11422
  return truthyArray[0] || "true";
11426
11423
  } else {
11427
11424
  return falsyArray[0] || "false";
@@ -12317,9 +12314,9 @@ var allProcessors = {
12317
12314
  optional: optionalProcessor,
12318
12315
  lazy: lazyProcessor
12319
12316
  };
12320
- function toJSONSchema(input3, params) {
12321
- if ("_idmap" in input3) {
12322
- const registry2 = input3;
12317
+ function toJSONSchema(input4, params) {
12318
+ if ("_idmap" in input4) {
12319
+ const registry2 = input4;
12323
12320
  const ctx2 = initializeContext({ ...params, processors: allProcessors });
12324
12321
  const defs = {};
12325
12322
  for (const entry of registry2._idmap.entries()) {
@@ -12347,9 +12344,9 @@ function toJSONSchema(input3, params) {
12347
12344
  return { schemas };
12348
12345
  }
12349
12346
  const ctx = initializeContext({ ...params, processors: allProcessors });
12350
- process2(input3, ctx);
12351
- extractDefs(ctx, input3);
12352
- return finalize(ctx, input3);
12347
+ process2(input4, ctx);
12348
+ extractDefs(ctx, input4);
12349
+ return finalize(ctx, input4);
12353
12350
  }
12354
12351
 
12355
12352
  // node_modules/zod/v4/core/json-schema-generator.js
@@ -17653,12 +17650,12 @@ var JiraClient = class {
17653
17650
  );
17654
17651
  }
17655
17652
  };
17656
- function createJiraClient() {
17657
- const host = process.env.JIRA_HOST;
17658
- const email3 = process.env.JIRA_EMAIL;
17659
- const apiToken = process.env.JIRA_API_TOKEN;
17653
+ function createJiraClient(jiraUserConfig) {
17654
+ const host = jiraUserConfig?.host ?? process.env.JIRA_HOST;
17655
+ const email3 = jiraUserConfig?.email ?? process.env.JIRA_EMAIL;
17656
+ const apiToken = jiraUserConfig?.apiToken ?? process.env.JIRA_API_TOKEN;
17660
17657
  if (!host || !email3 || !apiToken) return null;
17661
- return new JiraClient({ host, email: email3, apiToken });
17658
+ return { client: new JiraClient({ host, email: email3, apiToken }), host };
17662
17659
  }
17663
17660
 
17664
17661
  // src/skills/builtin/jira/tools.ts
@@ -17668,7 +17665,7 @@ function jiraNotConfiguredError() {
17668
17665
  content: [
17669
17666
  {
17670
17667
  type: "text",
17671
- text: "Jira is not configured. Set JIRA_HOST, JIRA_EMAIL, and JIRA_API_TOKEN environment variables."
17668
+ text: 'Jira is not configured. Run "marvin config jira" or set JIRA_HOST, JIRA_EMAIL, and JIRA_API_TOKEN environment variables.'
17672
17669
  }
17673
17670
  ],
17674
17671
  isError: true
@@ -17700,6 +17697,7 @@ function findByJiraKey(store, jiraKey) {
17700
17697
  return docs.find((d) => d.frontmatter.jiraKey === jiraKey);
17701
17698
  }
17702
17699
  function createJiraTools(store) {
17700
+ const jiraUserConfig = loadUserConfig().jira;
17703
17701
  return [
17704
17702
  // --- Local read tools ---
17705
17703
  tool19(
@@ -17770,15 +17768,14 @@ function createJiraTools(store) {
17770
17768
  key: external_exports.string().describe("Jira issue key (e.g. 'PROJ-123')")
17771
17769
  },
17772
17770
  async (args) => {
17773
- const client = createJiraClient();
17774
- if (!client) return jiraNotConfiguredError();
17775
- const issue2 = await client.getIssue(args.key);
17776
- const host = process.env.JIRA_HOST;
17771
+ const jira = createJiraClient(jiraUserConfig);
17772
+ if (!jira) return jiraNotConfiguredError();
17773
+ const issue2 = await jira.client.getIssue(args.key);
17777
17774
  const existing = findByJiraKey(store, args.key);
17778
17775
  if (existing) {
17779
17776
  const fm2 = jiraIssueToFrontmatter(
17780
17777
  issue2,
17781
- host,
17778
+ jira.host,
17782
17779
  existing.frontmatter.linkedArtifacts
17783
17780
  );
17784
17781
  const doc2 = store.update(
@@ -17795,7 +17792,7 @@ function createJiraTools(store) {
17795
17792
  ]
17796
17793
  };
17797
17794
  }
17798
- const fm = jiraIssueToFrontmatter(issue2, host);
17795
+ const fm = jiraIssueToFrontmatter(issue2, jira.host);
17799
17796
  const doc = store.create(
17800
17797
  JIRA_TYPE,
17801
17798
  fm,
@@ -17819,10 +17816,9 @@ function createJiraTools(store) {
17819
17816
  maxResults: external_exports.number().optional().describe("Max issues to fetch (default 50)")
17820
17817
  },
17821
17818
  async (args) => {
17822
- const client = createJiraClient();
17823
- if (!client) return jiraNotConfiguredError();
17824
- const result = await client.searchIssues(args.jql, args.maxResults);
17825
- const host = process.env.JIRA_HOST;
17819
+ const jira = createJiraClient(jiraUserConfig);
17820
+ if (!jira) return jiraNotConfiguredError();
17821
+ const result = await jira.client.searchIssues(args.jql, args.maxResults);
17826
17822
  const created = [];
17827
17823
  const updated = [];
17828
17824
  for (const issue2 of result.issues) {
@@ -17830,7 +17826,7 @@ function createJiraTools(store) {
17830
17826
  if (existing) {
17831
17827
  const fm = jiraIssueToFrontmatter(
17832
17828
  issue2,
17833
- host,
17829
+ jira.host,
17834
17830
  existing.frontmatter.linkedArtifacts
17835
17831
  );
17836
17832
  store.update(
@@ -17840,7 +17836,7 @@ function createJiraTools(store) {
17840
17836
  );
17841
17837
  updated.push(`${existing.frontmatter.id} (${issue2.key})`);
17842
17838
  } else {
17843
- const fm = jiraIssueToFrontmatter(issue2, host);
17839
+ const fm = jiraIssueToFrontmatter(issue2, jira.host);
17844
17840
  const doc = store.create(
17845
17841
  JIRA_TYPE,
17846
17842
  fm,
@@ -17869,8 +17865,8 @@ function createJiraTools(store) {
17869
17865
  issueType: external_exports.enum(["Story", "Task", "Bug", "Epic"]).optional().describe("Jira issue type (default: 'Task')")
17870
17866
  },
17871
17867
  async (args) => {
17872
- const client = createJiraClient();
17873
- if (!client) return jiraNotConfiguredError();
17868
+ const jira = createJiraClient(jiraUserConfig);
17869
+ if (!jira) return jiraNotConfiguredError();
17874
17870
  const artifact = store.get(args.artifactId);
17875
17871
  if (!artifact) {
17876
17872
  return {
@@ -17887,20 +17883,19 @@ function createJiraTools(store) {
17887
17883
  `Marvin artifact: ${artifact.frontmatter.id} (${artifact.frontmatter.type})`,
17888
17884
  `Status: ${artifact.frontmatter.status}`
17889
17885
  ].join("\n");
17890
- const jiraResult = await client.createIssue({
17886
+ const jiraResult = await jira.client.createIssue({
17891
17887
  project: { key: args.projectKey },
17892
17888
  summary: artifact.frontmatter.title,
17893
17889
  description,
17894
17890
  issuetype: { name: args.issueType ?? "Task" }
17895
17891
  });
17896
- const host = process.env.JIRA_HOST;
17897
17892
  const jiDoc = store.create(
17898
17893
  JIRA_TYPE,
17899
17894
  {
17900
17895
  title: artifact.frontmatter.title,
17901
17896
  status: "open",
17902
17897
  jiraKey: jiraResult.key,
17903
- jiraUrl: `https://${host}/browse/${jiraResult.key}`,
17898
+ jiraUrl: `https://${jira.host}/browse/${jiraResult.key}`,
17904
17899
  issueType: args.issueType ?? "Task",
17905
17900
  priority: "Medium",
17906
17901
  assignee: "",
@@ -17929,8 +17924,8 @@ function createJiraTools(store) {
17929
17924
  id: external_exports.string().describe("Local JI-xxx ID")
17930
17925
  },
17931
17926
  async (args) => {
17932
- const client = createJiraClient();
17933
- if (!client) return jiraNotConfiguredError();
17927
+ const jira = createJiraClient(jiraUserConfig);
17928
+ if (!jira) return jiraNotConfiguredError();
17934
17929
  const doc = store.get(args.id);
17935
17930
  if (!doc || doc.frontmatter.type !== JIRA_TYPE) {
17936
17931
  return {
@@ -17941,15 +17936,14 @@ function createJiraTools(store) {
17941
17936
  };
17942
17937
  }
17943
17938
  const jiraKey = doc.frontmatter.jiraKey;
17944
- await client.updateIssue(jiraKey, {
17939
+ await jira.client.updateIssue(jiraKey, {
17945
17940
  summary: doc.frontmatter.title,
17946
17941
  description: doc.content || void 0
17947
17942
  });
17948
- const issue2 = await client.getIssue(jiraKey);
17949
- const host = process.env.JIRA_HOST;
17943
+ const issue2 = await jira.client.getIssue(jiraKey);
17950
17944
  const fm = jiraIssueToFrontmatter(
17951
17945
  issue2,
17952
- host,
17946
+ jira.host,
17953
17947
  doc.frontmatter.linkedArtifacts
17954
17948
  );
17955
17949
  store.update(args.id, fm, issue2.fields.description ?? "");
@@ -18408,10 +18402,10 @@ Marvin \u2014 ${persona.name}
18408
18402
  });
18409
18403
  try {
18410
18404
  while (true) {
18411
- const input3 = await new Promise((resolve5) => {
18405
+ const input4 = await new Promise((resolve5) => {
18412
18406
  rl.question(chalk.green("\nYou: "), resolve5);
18413
18407
  });
18414
- const trimmed = input3.trim();
18408
+ const trimmed = input4.trim();
18415
18409
  if (trimmed === "exit" || trimmed === "quit") {
18416
18410
  break;
18417
18411
  }
@@ -19202,23 +19196,29 @@ Project: ${project.config.name}
19202
19196
 
19203
19197
  // src/cli/commands/config.ts
19204
19198
  import chalk6 from "chalk";
19205
- import { password } from "@inquirer/prompts";
19199
+ import { input as input2, password } from "@inquirer/prompts";
19206
19200
  async function configCommand(key, value) {
19207
19201
  if (key === "api-key") {
19208
19202
  return setApiKey();
19209
19203
  }
19204
+ if (key === "jira") {
19205
+ return setJira();
19206
+ }
19210
19207
  if (!key) {
19211
19208
  const config2 = loadUserConfig();
19212
19209
  console.log(chalk6.bold("\nUser Configuration:\n"));
19213
19210
  console.log(
19214
- ` API Key: ${config2.apiKey ? chalk6.green("configured") : chalk6.red("not set")}`
19211
+ ` API Key: ${config2.apiKey ? chalk6.green("configured") : chalk6.red("not set")}`
19215
19212
  );
19216
19213
  console.log(
19217
- ` Default Model: ${config2.defaultModel ?? chalk6.dim("(default: claude-sonnet-4-5-20250929)")}`
19214
+ ` Default Model: ${config2.defaultModel ?? chalk6.dim("(default: claude-sonnet-4-5-20250929)")}`
19218
19215
  );
19219
19216
  console.log(
19220
19217
  ` Default Persona: ${config2.defaultPersona ?? chalk6.dim("(default: product-owner)")}`
19221
19218
  );
19219
+ console.log(
19220
+ ` Jira: ${config2.jira?.host ? chalk6.green(`configured (${config2.jira.host})`) : chalk6.red("not set")}`
19221
+ );
19222
19222
  console.log();
19223
19223
  return;
19224
19224
  }
@@ -19251,6 +19251,37 @@ async function configCommand(key, value) {
19251
19251
  }
19252
19252
  }
19253
19253
  }
19254
+ async function setJira() {
19255
+ const host = await input2({
19256
+ message: "Jira host (e.g. mycompany.atlassian.net):"
19257
+ });
19258
+ if (!host.trim()) {
19259
+ console.log(chalk6.red("No host provided."));
19260
+ return;
19261
+ }
19262
+ const email3 = await input2({
19263
+ message: "Jira email:"
19264
+ });
19265
+ if (!email3.trim()) {
19266
+ console.log(chalk6.red("No email provided."));
19267
+ return;
19268
+ }
19269
+ const apiToken = await password({
19270
+ message: "Jira API token:"
19271
+ });
19272
+ if (!apiToken.trim()) {
19273
+ console.log(chalk6.red("No API token provided."));
19274
+ return;
19275
+ }
19276
+ const config2 = loadUserConfig();
19277
+ config2.jira = {
19278
+ host: host.trim(),
19279
+ email: email3.trim(),
19280
+ apiToken: apiToken.trim()
19281
+ };
19282
+ saveUserConfig(config2);
19283
+ console.log(chalk6.green("Jira credentials saved."));
19284
+ }
19254
19285
  async function setApiKey() {
19255
19286
  const apiKey = await password({
19256
19287
  message: "Enter your Anthropic API key:"
@@ -19564,7 +19595,7 @@ ${pending} file${pending === 1 ? "" : "s"} ready to process. Run "marvin ingest
19564
19595
  // src/cli/commands/sync.ts
19565
19596
  import chalk9 from "chalk";
19566
19597
  import ora3 from "ora";
19567
- import { input as input2 } from "@inquirer/prompts";
19598
+ import { input as input3 } from "@inquirer/prompts";
19568
19599
 
19569
19600
  // src/git/repository.ts
19570
19601
  import * as path13 from "path";
@@ -19771,7 +19802,7 @@ async function syncInitCommand(opts) {
19771
19802
  const git = new MarvinGit(project.marvinDir);
19772
19803
  let remote = opts.remote;
19773
19804
  if (!remote) {
19774
- remote = await input2({
19805
+ remote = await input3({
19775
19806
  message: "Remote repository URL (leave blank to skip):"
19776
19807
  }) || void 0;
19777
19808
  }
@@ -21372,7 +21403,7 @@ function createProgram() {
21372
21403
  const program = new Command();
21373
21404
  program.name("marvin").description(
21374
21405
  "AI-powered product development assistant with Product Owner, Delivery Manager, and Technical Lead personas"
21375
- ).version("0.2.8");
21406
+ ).version("0.2.9");
21376
21407
  program.command("init").description("Initialize a new Marvin project in the current directory").action(async () => {
21377
21408
  await initCommand();
21378
21409
  });