fluncle 0.233.0 → 0.234.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/fluncle.mjs +505 -10
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -622,7 +622,7 @@ function parseVersion(version) {
622
622
  var currentVersion;
623
623
  var init_version = __esm(() => {
624
624
  init_output();
625
- currentVersion = "0.233.0".trim() ? "0.233.0".trim() : "0.1.0";
625
+ currentVersion = "0.234.0".trim() ? "0.234.0".trim() : "0.1.0";
626
626
  });
627
627
 
628
628
  // src/update-notifier.ts
@@ -2335,7 +2335,7 @@ function parseVersion2(version) {
2335
2335
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2336
2336
  var init_version2 = __esm(() => {
2337
2337
  init_output();
2338
- currentVersion2 = "0.233.0".trim() ? "0.233.0".trim() : "0.1.0";
2338
+ currentVersion2 = "0.234.0".trim() ? "0.234.0".trim() : "0.1.0";
2339
2339
  });
2340
2340
 
2341
2341
  // ../../packages/registry/src/index.ts
@@ -2641,7 +2641,7 @@ var init_src = __esm(() => {
2641
2641
  },
2642
2642
  {
2643
2643
  exposedContent: [
2644
- "the galaxy factory — a draggable map of a finding's whole life, from the first CMD+F through the enrichment sweeps to the launch into the Galaxy"
2644
+ "the Galaxy factory — a draggable map of a finding's whole life, from the first CMD+F through the enrichment sweeps to the launch into the Galaxy"
2645
2645
  ],
2646
2646
  kind: "web_route",
2647
2647
  name: "web.pipeline",
@@ -5583,7 +5583,7 @@ var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid = (version) => {
5583
5583
  }, email, _emoji = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`, ipv4, ipv6, cidrv4, cidrv6, base64, base64url, httpProtocol, e164, dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`, date, string = (params) => {
5584
5584
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
5585
5585
  return new RegExp(`^${regex}$`);
5586
- }, integer, number, boolean, lowercase, uppercase;
5586
+ }, integer, number, boolean, _null, lowercase, uppercase;
5587
5587
  var init_regexes = __esm(() => {
5588
5588
  cuid = /^[cC][0-9a-z]{6,}$/;
5589
5589
  cuid2 = /^[0-9a-z]+$/;
@@ -5606,6 +5606,7 @@ var init_regexes = __esm(() => {
5606
5606
  integer = /^-?\d+$/;
5607
5607
  number = /^-?\d+(?:\.\d+)?$/;
5608
5608
  boolean = /^(?:true|false)$/i;
5609
+ _null = /^null$/i;
5609
5610
  lowercase = /^[^A-Z]*$/;
5610
5611
  uppercase = /^[^a-z]*$/;
5611
5612
  });
@@ -6367,7 +6368,7 @@ function handleRefineResult(result, payload, input, inst) {
6367
6368
  payload.issues.push(issue(_iss));
6368
6369
  }
6369
6370
  }
6370
- var $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodUnknown, $ZodNever, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodReadonly, $ZodTemplateLiteral, $ZodCustom;
6371
+ var $ZodType, $ZodString, $ZodStringFormat, $ZodGUID, $ZodUUID, $ZodEmail, $ZodURL, $ZodEmoji, $ZodNanoID, $ZodCUID, $ZodCUID2, $ZodULID, $ZodXID, $ZodKSUID, $ZodISODateTime, $ZodISODate, $ZodISOTime, $ZodISODuration, $ZodIPv4, $ZodIPv6, $ZodCIDRv4, $ZodCIDRv6, $ZodBase64, $ZodBase64URL, $ZodE164, $ZodJWT, $ZodNumber, $ZodNumberFormat, $ZodBoolean, $ZodNull, $ZodUnknown, $ZodNever, $ZodArray, $ZodObject, $ZodObjectJIT, $ZodUnion, $ZodDiscriminatedUnion, $ZodIntersection, $ZodTuple, $ZodRecord, $ZodEnum, $ZodLiteral, $ZodTransform, $ZodOptional, $ZodExactOptional, $ZodNullable, $ZodDefault, $ZodPrefault, $ZodNonOptional, $ZodCatch, $ZodPipe, $ZodReadonly, $ZodTemplateLiteral, $ZodLazy, $ZodCustom;
6371
6372
  var init_schemas = __esm(() => {
6372
6373
  init_checks();
6373
6374
  init_core();
@@ -6798,6 +6799,23 @@ var init_schemas = __esm(() => {
6798
6799
  return payload;
6799
6800
  };
6800
6801
  });
6802
+ $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
6803
+ $ZodType.init(inst, def);
6804
+ inst._zod.pattern = _null;
6805
+ inst._zod.values = new Set([null]);
6806
+ inst._zod.parse = (payload, _ctx) => {
6807
+ const input = payload.value;
6808
+ if (input === null)
6809
+ return payload;
6810
+ payload.issues.push({
6811
+ expected: "null",
6812
+ code: "invalid_type",
6813
+ input,
6814
+ inst
6815
+ });
6816
+ return payload;
6817
+ };
6818
+ });
6801
6819
  $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
6802
6820
  $ZodType.init(inst, def);
6803
6821
  inst._zod.parse = (payload) => payload;
@@ -7236,6 +7254,132 @@ var init_schemas = __esm(() => {
7236
7254
  return handleTupleResults(itemResults, payload, items, input, optoutStart);
7237
7255
  };
7238
7256
  });
7257
+ $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
7258
+ $ZodType.init(inst, def);
7259
+ inst._zod.parse = (payload, ctx) => {
7260
+ const input = payload.value;
7261
+ if (!isPlainObject(input)) {
7262
+ payload.issues.push({
7263
+ expected: "record",
7264
+ code: "invalid_type",
7265
+ input,
7266
+ inst
7267
+ });
7268
+ return payload;
7269
+ }
7270
+ const proms = [];
7271
+ const values = def.keyType._zod.values;
7272
+ if (values) {
7273
+ payload.value = {};
7274
+ const recordKeys = new Set;
7275
+ for (const key of values) {
7276
+ if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
7277
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
7278
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
7279
+ if (keyResult instanceof Promise) {
7280
+ throw new Error("Async schemas not supported in object keys currently");
7281
+ }
7282
+ if (keyResult.issues.length) {
7283
+ payload.issues.push({
7284
+ code: "invalid_key",
7285
+ origin: "record",
7286
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config3())),
7287
+ input: key,
7288
+ path: [key],
7289
+ inst
7290
+ });
7291
+ continue;
7292
+ }
7293
+ const outKey = keyResult.value;
7294
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
7295
+ if (result instanceof Promise) {
7296
+ proms.push(result.then((result) => {
7297
+ if (result.issues.length) {
7298
+ payload.issues.push(...prefixIssues(key, result.issues));
7299
+ }
7300
+ payload.value[outKey] = result.value;
7301
+ }));
7302
+ } else {
7303
+ if (result.issues.length) {
7304
+ payload.issues.push(...prefixIssues(key, result.issues));
7305
+ }
7306
+ payload.value[outKey] = result.value;
7307
+ }
7308
+ }
7309
+ }
7310
+ let unrecognized;
7311
+ for (const key in input) {
7312
+ if (!recordKeys.has(key)) {
7313
+ unrecognized = unrecognized ?? [];
7314
+ unrecognized.push(key);
7315
+ }
7316
+ }
7317
+ if (unrecognized && unrecognized.length > 0) {
7318
+ payload.issues.push({
7319
+ code: "unrecognized_keys",
7320
+ input,
7321
+ inst,
7322
+ keys: unrecognized
7323
+ });
7324
+ }
7325
+ } else {
7326
+ payload.value = {};
7327
+ for (const key of Reflect.ownKeys(input)) {
7328
+ if (key === "__proto__")
7329
+ continue;
7330
+ if (!Object.prototype.propertyIsEnumerable.call(input, key))
7331
+ continue;
7332
+ let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
7333
+ if (keyResult instanceof Promise) {
7334
+ throw new Error("Async schemas not supported in object keys currently");
7335
+ }
7336
+ const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
7337
+ if (checkNumericKey) {
7338
+ const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
7339
+ if (retryResult instanceof Promise) {
7340
+ throw new Error("Async schemas not supported in object keys currently");
7341
+ }
7342
+ if (retryResult.issues.length === 0) {
7343
+ keyResult = retryResult;
7344
+ }
7345
+ }
7346
+ if (keyResult.issues.length) {
7347
+ if (def.mode === "loose") {
7348
+ payload.value[key] = input[key];
7349
+ } else {
7350
+ payload.issues.push({
7351
+ code: "invalid_key",
7352
+ origin: "record",
7353
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config3())),
7354
+ input: key,
7355
+ path: [key],
7356
+ inst
7357
+ });
7358
+ }
7359
+ continue;
7360
+ }
7361
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
7362
+ if (result instanceof Promise) {
7363
+ proms.push(result.then((result) => {
7364
+ if (result.issues.length) {
7365
+ payload.issues.push(...prefixIssues(key, result.issues));
7366
+ }
7367
+ payload.value[keyResult.value] = result.value;
7368
+ }));
7369
+ } else {
7370
+ if (result.issues.length) {
7371
+ payload.issues.push(...prefixIssues(key, result.issues));
7372
+ }
7373
+ payload.value[keyResult.value] = result.value;
7374
+ }
7375
+ }
7376
+ }
7377
+ if (proms.length) {
7378
+ return Promise.all(proms).then(() => payload);
7379
+ }
7380
+ return payload;
7381
+ };
7382
+ });
7239
7383
  $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
7240
7384
  $ZodType.init(inst, def);
7241
7385
  const values = getEnumValues(def.entries);
@@ -7524,6 +7668,23 @@ var init_schemas = __esm(() => {
7524
7668
  return payload;
7525
7669
  };
7526
7670
  });
7671
+ $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
7672
+ $ZodType.init(inst, def);
7673
+ defineLazy(inst._zod, "innerType", () => {
7674
+ const d = def;
7675
+ if (!d._cachedInner)
7676
+ d._cachedInner = def.getter();
7677
+ return d._cachedInner;
7678
+ });
7679
+ defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
7680
+ defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
7681
+ defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? undefined);
7682
+ defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? undefined);
7683
+ inst._zod.parse = (payload, ctx) => {
7684
+ const inner = inst._zod.innerType;
7685
+ return inner._zod.run(payload, ctx);
7686
+ };
7687
+ });
7527
7688
  $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
7528
7689
  $ZodCheck.init(inst, def);
7529
7690
  $ZodType.init(inst, def);
@@ -7992,6 +8153,12 @@ function _coercedBoolean(Class, params) {
7992
8153
  ...normalizeParams(params)
7993
8154
  });
7994
8155
  }
8156
+ function _null2(Class, params) {
8157
+ return new Class({
8158
+ type: "null",
8159
+ ...normalizeParams(params)
8160
+ });
8161
+ }
7995
8162
  function _unknown(Class) {
7996
8163
  return new Class({
7997
8164
  type: "unknown"
@@ -8601,6 +8768,14 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
8601
8768
  json.multipleOf = multipleOf;
8602
8769
  }, booleanProcessor = (_schema, _ctx, json, _params) => {
8603
8770
  json.type = "boolean";
8771
+ }, nullProcessor = (_schema, ctx, json, _params) => {
8772
+ if (ctx.target === "openapi-3.0") {
8773
+ json.type = "string";
8774
+ json.nullable = true;
8775
+ json.enum = [null];
8776
+ } else {
8777
+ json.type = "null";
8778
+ }
8604
8779
  }, neverProcessor = (_schema, _ctx, json, _params) => {
8605
8780
  json.not = {};
8606
8781
  }, unknownProcessor = (_schema, _ctx, _json, _params) => {}, enumProcessor = (schema, _ctx, json, _params) => {
@@ -8780,6 +8955,41 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
8780
8955
  json.minItems = minimum;
8781
8956
  if (typeof maximum === "number")
8782
8957
  json.maxItems = maximum;
8958
+ }, recordProcessor = (schema, ctx, _json, params) => {
8959
+ const json = _json;
8960
+ const def = schema._zod.def;
8961
+ json.type = "object";
8962
+ const keyType = def.keyType;
8963
+ const keyBag = keyType._zod.bag;
8964
+ const patterns = keyBag?.patterns;
8965
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
8966
+ const valueSchema = process3(def.valueType, ctx, {
8967
+ ...params,
8968
+ path: [...params.path, "patternProperties", "*"]
8969
+ });
8970
+ json.patternProperties = {};
8971
+ for (const pattern of patterns) {
8972
+ json.patternProperties[pattern.source] = valueSchema;
8973
+ }
8974
+ } else {
8975
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
8976
+ json.propertyNames = process3(def.keyType, ctx, {
8977
+ ...params,
8978
+ path: [...params.path, "propertyNames"]
8979
+ });
8980
+ }
8981
+ json.additionalProperties = process3(def.valueType, ctx, {
8982
+ ...params,
8983
+ path: [...params.path, "additionalProperties"]
8984
+ });
8985
+ }
8986
+ const keyValues = keyType._zod.values;
8987
+ if (keyValues) {
8988
+ const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
8989
+ if (validKeyValues.length > 0) {
8990
+ json.required = validKeyValues;
8991
+ }
8992
+ }
8783
8993
  }, nullableProcessor = (schema, ctx, json, params) => {
8784
8994
  const def = schema._zod.def;
8785
8995
  const inner = process3(def.innerType, ctx, params);
@@ -8838,6 +9048,11 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
8838
9048
  process3(def.innerType, ctx, params);
8839
9049
  const seen = ctx.seen.get(schema);
8840
9050
  seen.ref = def.innerType;
9051
+ }, lazyProcessor = (schema, ctx, _json, params) => {
9052
+ const innerType = schema._zod.innerType;
9053
+ process3(innerType, ctx, params);
9054
+ const seen = ctx.seen.get(schema);
9055
+ seen.ref = innerType;
8841
9056
  };
8842
9057
  var init_json_schema_processors = __esm(() => {
8843
9058
  init_to_json_schema();
@@ -9018,6 +9233,9 @@ function int(params) {
9018
9233
  function boolean2(params) {
9019
9234
  return _boolean(ZodBoolean, params);
9020
9235
  }
9236
+ function _null3(params) {
9237
+ return _null2(ZodNull, params);
9238
+ }
9021
9239
  function unknown() {
9022
9240
  return _unknown(ZodUnknown);
9023
9241
  }
@@ -9084,6 +9302,22 @@ function tuple(items, _paramsOrRest, _params) {
9084
9302
  ...normalizeParams(params)
9085
9303
  });
9086
9304
  }
9305
+ function record(keyType, valueType, params) {
9306
+ if (!valueType || !valueType._zod) {
9307
+ return new ZodRecord({
9308
+ type: "record",
9309
+ keyType: string2(),
9310
+ valueType: keyType,
9311
+ ...normalizeParams(valueType)
9312
+ });
9313
+ }
9314
+ return new ZodRecord({
9315
+ type: "record",
9316
+ keyType,
9317
+ valueType,
9318
+ ...normalizeParams(params)
9319
+ });
9320
+ }
9087
9321
  function _enum(values, params) {
9088
9322
  const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
9089
9323
  return new ZodEnum({
@@ -9175,13 +9409,25 @@ function templateLiteral(parts, params) {
9175
9409
  ...normalizeParams(params)
9176
9410
  });
9177
9411
  }
9412
+ function lazy(getter) {
9413
+ return new ZodLazy({
9414
+ type: "lazy",
9415
+ getter
9416
+ });
9417
+ }
9178
9418
  function refine(fn, _params = {}) {
9179
9419
  return _refine(ZodCustom, fn, _params);
9180
9420
  }
9181
9421
  function superRefine(fn, params) {
9182
9422
  return _superRefine(fn, params);
9183
9423
  }
9184
- var _installedGroups, ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber, ZodNumberFormat, ZodBoolean, ZodUnknown, ZodNever, ZodArray, ZodObject, ZodUnion, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodEnum, ZodLiteral, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodCatch, ZodPipe, ZodReadonly, ZodTemplateLiteral, ZodCustom;
9424
+ function json(params) {
9425
+ const jsonSchema = lazy(() => {
9426
+ return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
9427
+ });
9428
+ return jsonSchema;
9429
+ }
9430
+ var _installedGroups, ZodType, _ZodString, ZodString, ZodStringFormat, ZodEmail, ZodGUID, ZodUUID, ZodURL, ZodEmoji, ZodNanoID, ZodCUID, ZodCUID2, ZodULID, ZodXID, ZodKSUID, ZodIPv4, ZodIPv6, ZodCIDRv4, ZodCIDRv6, ZodBase64, ZodBase64URL, ZodE164, ZodJWT, ZodNumber, ZodNumberFormat, ZodBoolean, ZodNull, ZodUnknown, ZodNever, ZodArray, ZodObject, ZodUnion, ZodDiscriminatedUnion, ZodIntersection, ZodTuple, ZodRecord, ZodEnum, ZodLiteral, ZodTransform, ZodOptional, ZodExactOptional, ZodNullable, ZodDefault, ZodPrefault, ZodNonOptional, ZodCatch, ZodPipe, ZodReadonly, ZodTemplateLiteral, ZodLazy, ZodCustom;
9185
9431
  var init_schemas2 = __esm(() => {
9186
9432
  init_core2();
9187
9433
  init_core2();
@@ -9554,6 +9800,11 @@ var init_schemas2 = __esm(() => {
9554
9800
  ZodType.init(inst, def);
9555
9801
  inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
9556
9802
  });
9803
+ ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
9804
+ $ZodNull.init(inst, def);
9805
+ ZodType.init(inst, def);
9806
+ inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
9807
+ });
9557
9808
  ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
9558
9809
  $ZodUnknown.init(inst, def);
9559
9810
  ZodType.init(inst, def);
@@ -9660,6 +9911,13 @@ var init_schemas2 = __esm(() => {
9660
9911
  rest
9661
9912
  });
9662
9913
  });
9914
+ ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
9915
+ $ZodRecord.init(inst, def);
9916
+ ZodType.init(inst, def);
9917
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
9918
+ inst.keyType = def.keyType;
9919
+ inst.valueType = def.valueType;
9920
+ });
9663
9921
  ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
9664
9922
  $ZodEnum.init(inst, def);
9665
9923
  ZodType.init(inst, def);
@@ -9808,6 +10066,12 @@ var init_schemas2 = __esm(() => {
9808
10066
  ZodType.init(inst, def);
9809
10067
  inst._zod.processJSONSchema = (ctx, json, params) => templateLiteralProcessor(inst, ctx, json, params);
9810
10068
  });
10069
+ ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
10070
+ $ZodLazy.init(inst, def);
10071
+ ZodType.init(inst, def);
10072
+ inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
10073
+ inst.unwrap = () => inst._zod.def.getter();
10074
+ });
9811
10075
  ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
9812
10076
  $ZodCustom.init(inst, def);
9813
10077
  ZodType.init(inst, def);
@@ -11144,7 +11408,7 @@ var init_admin_bios = __esm(() => {
11144
11408
  });
11145
11409
 
11146
11410
  // ../../packages/contracts/src/orpc/admin-catalogue.ts
11147
- var CatalogueLensSchema, CapturePriorityReasonSchema, CatalogueMatchSchema, CatalogueTrackItemSchema, CatalogueSummarySchema, listCatalogueTracks, rankCatalogue, recordDemand, clearWrongAudio, requeueUnmatchedCaptures, requeueAnchor, flagWrongAudio, forceCapture, certifyTrack, setTrackDismissed, CaptureVerifyItemSchema, listUnverifiedCaptures, verifyCapture, CrawlPassSchema, CrawlStatusSchema, crawlCatalogue, getCrawlStatus, ANCHOR_CANDIDATE_LIMIT = 100, ANCHOR_ARTIST_LIMIT = 20, ANCHOR_TEXT_MAX = 300, ANCHOR_ISRC_MAX = 64, ANCHOR_ID_MAX = 64, ANCHOR_URL_MAX = 2048, AnchorCandidateSchema, anchorTrack, DEEZER_CANDIDATE_LIMIT = 5, DEEZER_TEXT_MAX = 300, DEEZER_ISRC_MAX = 64, DEEZER_TRACK_ID_MAX = 32, DeezerIsrcCandidateSchema, resolveAnchor, resolveAnchorReview, setAnchorSearch, setAnchorApify, CaptureBudgetStateSchema, getCaptureBudget, setCaptureBudget, SpotifyAnchorBreakerStateSchema, getSpotifyAnchorBreaker, resetSpotifyAnchorBreaker, AppleBreakerStateSchema, resetAppleBreaker, adminCatalogueContract;
11411
+ var CatalogueLensSchema, CapturePriorityReasonSchema, CatalogueMatchSchema, CatalogueTrackItemSchema, CatalogueSummarySchema, listCatalogueTracks, rankCatalogue, recordDemand, clearWrongAudio, requeueUnmatchedCaptures, requeueAnchor, flagWrongAudio, forceCapture, certifyTrack, setTrackDismissed, CaptureVerifyItemSchema, listUnverifiedCaptures, verifyCapture, CrawlPassSchema, CrawlPhaseInitializationSchema, CrawlPhaseInputSchema, CrawlPhaseOutputSchema, CrawlStatusSchema, crawlCatalogue, getCrawlStatus, ANCHOR_CANDIDATE_LIMIT = 100, ANCHOR_ARTIST_LIMIT = 20, ANCHOR_TEXT_MAX = 300, ANCHOR_ISRC_MAX = 64, ANCHOR_ID_MAX = 64, ANCHOR_URL_MAX = 2048, AnchorCandidateSchema, anchorTrack, DEEZER_CANDIDATE_LIMIT = 5, DEEZER_TEXT_MAX = 300, DEEZER_ISRC_MAX = 64, DEEZER_TRACK_ID_MAX = 32, DeezerIsrcCandidateSchema, resolveAnchor, resolveAnchorReview, setAnchorSearch, setAnchorApify, CaptureBudgetStateSchema, getCaptureBudget, setCaptureBudget, SpotifyAnchorBreakerStateSchema, getSpotifyAnchorBreaker, resetSpotifyAnchorBreaker, AppleBreakerStateSchema, resetAppleBreaker, adminCatalogueContract;
11148
11412
  var init_admin_catalogue = __esm(() => {
11149
11413
  init_dist3();
11150
11414
  init_zod();
@@ -11365,6 +11629,70 @@ var init_admin_catalogue = __esm(() => {
11365
11629
  tracksSkippedLabelGate: number2().optional(),
11366
11630
  tracksWritten: number2()
11367
11631
  }).meta({ id: "CrawlPass" });
11632
+ CrawlPhaseInitializationSchema = object({
11633
+ artistsRearmed: number2(),
11634
+ releasesRearmed: number2(),
11635
+ seeded: number2(),
11636
+ seedsRearmed: number2()
11637
+ });
11638
+ CrawlPhaseInputSchema = discriminatedUnion("phase", [
11639
+ object({ phase: literal("initialize") }),
11640
+ object({
11641
+ limit: number2().int().min(1).max(2).default(2),
11642
+ maxHop: number2().int().min(0).max(3).default(2),
11643
+ phase: literal("prepare")
11644
+ }),
11645
+ object({ phase: literal("fetch"), preparedToken: string2().max(2 * 1024 * 1024) }),
11646
+ object({
11647
+ commitToken: string2().max(2 * 1024 * 1024),
11648
+ operationId: literal("catalogue.crawl"),
11649
+ operationKey: string2().max(128),
11650
+ phase: literal("commit"),
11651
+ requestDigest: string2().regex(/^[0-9a-f]{64}$/)
11652
+ })
11653
+ ]);
11654
+ CrawlPhaseOutputSchema = discriminatedUnion("phase", [
11655
+ object({
11656
+ initialization: CrawlPhaseInitializationSchema,
11657
+ kind: _enum(["initialized", "unavailable"]),
11658
+ ok: literal(true),
11659
+ phase: literal("initialize")
11660
+ }),
11661
+ object({
11662
+ frontierPending: number2(),
11663
+ initialization: CrawlPhaseInitializationSchema,
11664
+ items: array(object({ nodeId: string2(), preparedToken: string2() })).max(2),
11665
+ kind: _enum(["drained", "prepared", "unavailable"]),
11666
+ ok: literal(true),
11667
+ phase: literal("prepare")
11668
+ }),
11669
+ object({
11670
+ commitToken: string2(),
11671
+ ok: literal(true),
11672
+ operationId: literal("catalogue.crawl"),
11673
+ operationKey: string2(),
11674
+ phase: literal("fetch"),
11675
+ requestDigest: string2()
11676
+ }),
11677
+ object({
11678
+ ok: literal(true),
11679
+ phase: literal("commit"),
11680
+ receipt: object({
11681
+ outcome: _enum([
11682
+ "committed",
11683
+ "conflict",
11684
+ "in-progress",
11685
+ "lookup-failed",
11686
+ "rejected",
11687
+ "safely-retryable"
11688
+ ]),
11689
+ replayed: boolean2(),
11690
+ result: json().optional(),
11691
+ resultIdentity: string2().optional(),
11692
+ state: _enum(["accepted", "committed", "rejected"]).optional()
11693
+ })
11694
+ })
11695
+ ]);
11368
11696
  CrawlStatusSchema = object({
11369
11697
  anchorsPending: number2(),
11370
11698
  catalogueTracks: number2(),
@@ -11390,12 +11718,13 @@ var init_admin_catalogue = __esm(() => {
11390
11718
  summary: "Run one bounded, resumable pass of the catalogue crawler",
11391
11719
  tags: ["Admin"]
11392
11720
  }).input(object({
11721
+ body: CrawlPhaseInputSchema.optional(),
11393
11722
  query: object({
11394
11723
  dryRun: string2().optional(),
11395
11724
  limit: string2().optional(),
11396
11725
  maxHop: string2().optional()
11397
11726
  })
11398
- })).output(CrawlPassSchema.extend({ ok: literal(true) }));
11727
+ })).output(union([CrawlPassSchema.extend({ ok: literal(true) }), CrawlPhaseOutputSchema]));
11399
11728
  getCrawlStatus = oc.route({
11400
11729
  method: "GET",
11401
11730
  operationId: "getCrawlStatus",
@@ -14159,7 +14488,7 @@ var init_admin_tokens = __esm(() => {
14159
14488
  });
14160
14489
 
14161
14490
  // ../../packages/contracts/src/orpc/admin-tracks.ts
14162
- var UpdateTrackBodySchema, ObserveTrackBodySchema, ContextTrackBodySchema, NoteTrackBodySchema, NoteEchoSchema, PresignVideoUploadsBodySchema, FinalizeVideoBodySchema, VideoUploadSchema, updateTrack, observeTrack, contextTrack, noteTrack, presignTrackVideoUploads, finalizeTrackVideo, requeueVideo, purgeVideo, PublishTrackResultSchema, getTrackAdmin, listTracksAdmin, TrackWorkKindSchema, TrackWorkScopeSchema, TrackWorkItemSchema, listTrackWork, publishTrack, MixOrderStopSchema, getMixableOrder, adminTracksContract;
14491
+ var UpdateTrackBodySchema, ObserveTrackBodySchema, ContextTrackBodySchema, NoteTrackBodySchema, NoteEchoSchema, PresignVideoUploadsBodySchema, FinalizeVideoBodySchema, VideoUploadSchema, updateTrack, CaptureReconciliationKindSchema, CaptureExternalResultSchema, CaptureReceiptCoordinatesSchema, CapturePreparedTrackSchema, CaptureCommittedReceiptResultSchema, CaptureRejectedReceiptResultSchema, prepareTrackCapture, authorizeTrackCapture, commitTrackCapture, observeTrack, contextTrack, noteTrack, presignTrackVideoUploads, finalizeTrackVideo, requeueVideo, purgeVideo, PublishTrackResultSchema, getTrackAdmin, listTracksAdmin, TrackWorkKindSchema, TrackWorkScopeSchema, TrackWorkItemSchema, listTrackWork, publishTrack, MixOrderStopSchema, getMixableOrder, adminTracksContract;
14163
14492
  var init_admin_tracks = __esm(() => {
14164
14493
  init_dist3();
14165
14494
  init_zod();
@@ -14249,6 +14578,157 @@ var init_admin_tracks = __esm(() => {
14249
14578
  ok: literal(true),
14250
14579
  trackId: string2()
14251
14580
  }));
14581
+ CaptureReconciliationKindSchema = _enum([
14582
+ "capture",
14583
+ "youtube-provenance",
14584
+ "youtube-reverdict"
14585
+ ]);
14586
+ CaptureExternalResultSchema = union([
14587
+ discriminatedUnion("outcome", [
14588
+ strictObject({
14589
+ attemptedAt: string2().datetime({ offset: true }),
14590
+ kind: literal("capture"),
14591
+ outcome: _enum(["failed", "unmatched"]),
14592
+ sourceAudioRejected: string2().max(16384).optional()
14593
+ }),
14594
+ strictObject({
14595
+ attemptedAt: string2().datetime({ offset: true }),
14596
+ bytes: number2().int().min(1),
14597
+ captureVerification: _enum(["preview-match", "unverified"]),
14598
+ capturedAt: string2().datetime({ offset: true }),
14599
+ kind: literal("capture"),
14600
+ outcome: literal("done"),
14601
+ sourceAudioKey: string2().min(1).max(1024),
14602
+ sourceAudioRejected: string2().max(16384).optional(),
14603
+ verifiedAt: string2().datetime({ offset: true }),
14604
+ youtubeVideoId: string2().min(1).max(128).optional()
14605
+ })
14606
+ ]),
14607
+ discriminatedUnion("outcome", [
14608
+ strictObject({
14609
+ kind: literal("youtube-provenance"),
14610
+ outcome: literal("none"),
14611
+ verification: _enum(["inconclusive", "no-match"])
14612
+ }),
14613
+ strictObject({
14614
+ kind: literal("youtube-provenance"),
14615
+ outcome: literal("source-found"),
14616
+ sourceVerification: _enum(["soundcloud-archive-match", "soundcloud-preview-match"])
14617
+ }),
14618
+ strictObject({
14619
+ kind: literal("youtube-provenance"),
14620
+ outcome: literal("youtube-found"),
14621
+ verification: _enum(["archive-match", "metadata-match", "preview-match"]),
14622
+ youtubeVideoId: string2().min(1).max(128)
14623
+ })
14624
+ ]),
14625
+ strictObject({ kind: literal("youtube-reverdict"), outcome: literal("reverdict") })
14626
+ ]);
14627
+ CaptureReceiptCoordinatesSchema = strictObject({
14628
+ operationId: literal("track.capture"),
14629
+ operationKey: string2().min(1).max(256).regex(/^[A-Za-z0-9][A-Za-z0-9._~:/-]*$/),
14630
+ requestDigest: string2().regex(/^[0-9a-f]{64}$/)
14631
+ });
14632
+ CapturePreparedTrackSchema = strictObject({
14633
+ analyzedFrom: _enum(["full", "preview"]).optional(),
14634
+ artists: array(string2().max(512)).max(64),
14635
+ bpm: number2().optional(),
14636
+ certified: boolean2(),
14637
+ durationMs: number2().int().min(1).optional(),
14638
+ label: string2().max(1024).optional(),
14639
+ logId: string2().max(64).optional(),
14640
+ sourceAudioFailures: number2().int().min(0).optional(),
14641
+ sourceAudioKey: string2().max(1024).optional(),
14642
+ sourceAudioRejected: string2().max(16384).optional(),
14643
+ title: string2().max(2048),
14644
+ trackId: string2().min(1).max(256)
14645
+ });
14646
+ CaptureCommittedReceiptResultSchema = union([
14647
+ strictObject({
14648
+ applied: literal(true),
14649
+ kind: literal("capture"),
14650
+ outcome: _enum(["done", "failed", "unmatched"])
14651
+ }),
14652
+ strictObject({
14653
+ applied: literal(true),
14654
+ kind: literal("youtube-provenance"),
14655
+ outcome: _enum(["none", "source-found", "youtube-found"])
14656
+ }),
14657
+ strictObject({
14658
+ applied: literal(true),
14659
+ kind: literal("youtube-reverdict"),
14660
+ outcome: literal("reverdict")
14661
+ })
14662
+ ]);
14663
+ CaptureRejectedReceiptResultSchema = strictObject({
14664
+ applied: literal(false),
14665
+ reason: literal("stale")
14666
+ });
14667
+ prepareTrackCapture = oc.route({
14668
+ method: "POST",
14669
+ operationId: "prepareTrackCapture",
14670
+ path: "/admin/tracks/{trackId}/capture/prepare",
14671
+ summary: "Prepare a current capture reconciliation snapshot",
14672
+ tags: ["Admin"]
14673
+ }).input(strictObject({
14674
+ kind: CaptureReconciliationKindSchema,
14675
+ priorSnapshotToken: string2().min(1).max(65536).optional(),
14676
+ trackId: string2().min(1).max(256)
14677
+ })).output(discriminatedUnion("prepared", [
14678
+ strictObject({
14679
+ ok: literal(true),
14680
+ prepared: literal(false),
14681
+ reason: _enum(["ineligible", "not-found", "stale"])
14682
+ }),
14683
+ strictObject({
14684
+ ok: literal(true),
14685
+ prepared: literal(true),
14686
+ snapshotToken: string2().min(1).max(65536),
14687
+ track: CapturePreparedTrackSchema
14688
+ })
14689
+ ]));
14690
+ authorizeTrackCapture = oc.route({
14691
+ method: "POST",
14692
+ operationId: "authorizeTrackCapture",
14693
+ path: "/admin/tracks/{trackId}/capture/authorize",
14694
+ summary: "Authorize a prepared capture result",
14695
+ tags: ["Admin"]
14696
+ }).input(strictObject({
14697
+ result: CaptureExternalResultSchema,
14698
+ snapshotToken: string2().min(1).max(65536),
14699
+ trackId: string2().min(1).max(256)
14700
+ })).output(CaptureReceiptCoordinatesSchema.extend({
14701
+ commitToken: string2().min(1).max(65536),
14702
+ ok: literal(true)
14703
+ }));
14704
+ commitTrackCapture = oc.route({
14705
+ method: "POST",
14706
+ operationId: "commitTrackCapture",
14707
+ path: "/admin/tracks/{trackId}/capture/commit",
14708
+ summary: "Commit a prepared capture result",
14709
+ tags: ["Admin"]
14710
+ }).input(CaptureReceiptCoordinatesSchema.extend({
14711
+ commitToken: string2().min(1).max(65536),
14712
+ trackId: string2().min(1).max(256)
14713
+ })).output(discriminatedUnion("outcome", [
14714
+ strictObject({
14715
+ ok: literal(true),
14716
+ outcome: literal("committed"),
14717
+ replayed: boolean2(),
14718
+ result: CaptureCommittedReceiptResultSchema
14719
+ }),
14720
+ strictObject({
14721
+ ok: literal(true),
14722
+ outcome: literal("rejected"),
14723
+ replayed: boolean2(),
14724
+ result: CaptureRejectedReceiptResultSchema
14725
+ }),
14726
+ strictObject({
14727
+ ok: literal(true),
14728
+ outcome: _enum(["conflict", "in-progress", "safely-retryable"]),
14729
+ replayed: boolean2()
14730
+ })
14731
+ ]));
14252
14732
  observeTrack = oc.route({
14253
14733
  method: "POST",
14254
14734
  operationId: "observeTrack",
@@ -14484,6 +14964,8 @@ var init_admin_tracks = __esm(() => {
14484
14964
  totalCost: number2()
14485
14965
  }));
14486
14966
  adminTracksContract = {
14967
+ authorize_track_capture: authorizeTrackCapture,
14968
+ commit_track_capture: commitTrackCapture,
14487
14969
  context_track: contextTrack,
14488
14970
  finalize_track_video: finalizeTrackVideo,
14489
14971
  get_mixable_order: getMixableOrder,
@@ -14492,6 +14974,7 @@ var init_admin_tracks = __esm(() => {
14492
14974
  list_tracks_admin: listTracksAdmin,
14493
14975
  note_track: noteTrack,
14494
14976
  observe_track: observeTrack,
14977
+ prepare_track_capture: prepareTrackCapture,
14495
14978
  presign_track_video_uploads: presignTrackVideoUploads,
14496
14979
  publish_track: publishTrack,
14497
14980
  purge_video: purgeVideo,
@@ -18033,6 +18516,9 @@ async function crawlCatalogueCommand(limit, maxHop, dryRun) {
18033
18516
  }
18034
18517
  return adminApiPost(`/api/v1/admin/catalogue/crawl?${params.toString()}`);
18035
18518
  }
18519
+ async function crawlCataloguePhaseCommand(body) {
18520
+ return adminApiPost("/api/v1/admin/catalogue/crawl", body);
18521
+ }
18036
18522
  async function crawlStatusCommand() {
18037
18523
  return adminApiGet("/api/v1/admin/catalogue/crawl");
18038
18524
  }
@@ -21726,8 +22212,17 @@ JSON field reference:
21726
22212
  }
21727
22213
  console.log(changed ? `Restored ${trackId}. It re-enters the ranking on the next sweep.` : `${trackId} was not dismissed \u2014 nothing to restore.`);
21728
22214
  });
21729
- catalogue.command("crawl").description("Run one bounded, resumable pass of the catalogue crawler").option("--dry-run", "Report the seed plan and write nothing at all", false).option("--limit <limit>", "Frontier nodes to expand this pass", "10").option("--max-hop <maxHop>", "Graph distance from a seed label (0-3)", "2").option("--json", "Print JSON", false).action(async (options) => {
22215
+ catalogue.command("crawl").description("Run one bounded, resumable pass of the catalogue crawler").option("--dry-run", "Report the seed plan and write nothing at all", false).option("--limit <limit>", "Frontier nodes to expand this pass", "10").option("--max-hop <maxHop>", "Graph distance from a seed label (0-3)", "2").addOption(new Option("--phase-file <path>").hideHelp()).option("--json", "Print JSON", false).action(async (options) => {
21730
22216
  await Promise.resolve().then(() => init_admin_catalogue2());
22217
+ if (options.phaseFile) {
22218
+ if (options.dryRun) {
22219
+ throw new Error("--phase-file cannot be combined with --dry-run");
22220
+ }
22221
+ const body = JSON.parse(readFileSync6(options.phaseFile, "utf8"));
22222
+ const result = await crawlCataloguePhaseCommand(body);
22223
+ printJson(result);
22224
+ return;
22225
+ }
21731
22226
  await runCrawlCatalogue(options, crawlCatalogueCommand);
21732
22227
  });
21733
22228
  catalogue.command("status").description("The crawl frontier's state, the catalogue's size, and the seed set").option("--json", "Print JSON", false).action(async (options) => {
package/package.json CHANGED
@@ -31,5 +31,5 @@
31
31
  "url": "git+https://github.com/mauricekleine/fluncle.git"
32
32
  },
33
33
  "type": "module",
34
- "version": "0.233.0"
34
+ "version": "0.234.0"
35
35
  }