fluncle 0.233.0 → 0.235.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 +558 -21
  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.235.0".trim() ? "0.235.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.235.0".trim() ? "0.235.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",
@@ -3059,6 +3059,28 @@ var init_src = __esm(() => {
3059
3059
  url: `${SITE}/robots.txt`,
3060
3060
  weights: { web: "tertiary" }
3061
3061
  },
3062
+ {
3063
+ apiFormat: "text/plain",
3064
+ exposedContent: [
3065
+ "RFC 9116 security.txt — where to send a vulnerability report, in the one place a researcher looks first"
3066
+ ],
3067
+ kind: "discovery",
3068
+ name: "discovery.security-txt",
3069
+ operatorNotes: "A static file, apps/web/public/.well-known/security.txt. It carries an `Expires` field the RFC requires a responder to keep in the future — when it lapses, a reporter reads the contact as stale. No probeConfig, exactly like robots.txt and llms.txt: a static asset the Worker never computes.",
3070
+ route: "/.well-known/security.txt",
3071
+ url: `${SITE}/.well-known/security.txt`,
3072
+ weights: { web: "tertiary" }
3073
+ },
3074
+ {
3075
+ apiFormat: "text/plain",
3076
+ exposedContent: ["humans.txt — who made this, who is thanked, and what it is built with"],
3077
+ kind: "discovery",
3078
+ name: "discovery.humans",
3079
+ operatorNotes: "A static file, apps/web/public/humans.txt — the human counterpart to robots.txt. Machine-fetched by convention, never browsed, which is why it sits under `discovery` beside robots.txt rather than as a web route.",
3080
+ route: "/humans.txt",
3081
+ url: `${SITE}/humans.txt`,
3082
+ weights: { web: "tertiary" }
3083
+ },
3062
3084
  {
3063
3085
  apiFormat: "text/markdown",
3064
3086
  discoveryUrl: `${SITE}/.well-known/api-catalog`,
@@ -3875,7 +3897,7 @@ var init_src = __esm(() => {
3875
3897
  ],
3876
3898
  kind: "cron",
3877
3899
  name: "cron.reconcile-hub-counts",
3878
- operatorNotes: "04:10 Amsterdam (after the 04:00 reach snapshot, before the 04:40 demand tick), a rave-02 host systemd timer (docs/agents/hermes/reconcile-hub-counts-timer/). The SELF-HEALING BACKSTOP under keystone 2's maintained hub counts: they are moved as DELTAS by every edge-writing path (recompute-from-truth measured 27,400 ms at 150k hosted vs ~200 ms for the delta form), and a maintained counter drifts silently — a missed write path, a non-atomic bulk op, or an out-of-band write (the catalogue-prune skill deletes tracks straight out of the database). Keystone 2's own rollout proved it on day one: the deploy-window skew left 44 artists / 3 albums / 1 label wrong until a manual reconcile. A bare trigger (the funnel-snapshot shape): fires the AGENT-tier reconcile_hub_counts op once and the Worker runs two statements per table a grouped `UPDATE FROM ( GROUP BY fk)` guarded by a counts-DIFFER predicate (so rowsAffected IS the corrected-row count) plus a zero-truth pass for an entity whose last track vanished. The artists source is PINNED to `track_artists JOIN tracks` so orphaned edges never count. Idempotent; zero LLM tokens; no new secret. The corrected-row numbers are the operator's DRIFT AUDIT — journalctl -u fluncle-reconcile-hub-counts.service | grep AUDIT. Source: docs/agents/hermes/scripts/reconcile-hub-counts.*.",
3900
+ operatorNotes: "04:10 Amsterdam (after the 04:00 reach snapshot, before the 04:40 demand tick), a rave-02 host systemd timer (docs/agents/hermes/reconcile-hub-counts-timer/). The SELF-HEALING BACKSTOP under keystone 2's maintained hub counts: they are moved as DELTAS by every edge-writing path (recompute-from-truth measured 27,400 ms at 150k hosted vs ~200 ms for the delta form), and a maintained counter drifts silently — a missed write path, a non-atomic bulk op, or an out-of-band write (the catalogue-prune skill deletes tracks straight out of the database). Keystone 2's own rollout proved it on day one: the deploy-window skew left 44 artists / 3 albums / 1 label wrong until a manual reconcile. Walks the AGENT-tier reconcile_hub_counts op in bounded windows, one admitted database phase each: the Worker reads bounded keyset pages of entity rows beside their truth (never an aggregate inside a write transaction) and rewrites only disagreeing rows as compare-and-set point writes, so a concurrent maintained delta is never overwritten. The artists source is PINNED to `track_artists JOIN tracks` so orphaned edges never count. Idempotent; zero LLM tokens; no new secret. The corrected-row numbers are the operator's DRIFT AUDIT — journalctl -u fluncle-reconcile-hub-counts.service | grep AUDIT. Source: docs/agents/hermes/scripts/reconcile-hub-counts.*.",
3879
3901
  probeConfig: {
3880
3902
  cadenceMs: 24 * 60 * MINUTE_MS,
3881
3903
  cronName: "fluncle-reconcile-hub-counts",
@@ -5583,7 +5605,7 @@ var cuid, cuid2, ulid, xid, ksuid, nanoid, duration, guid, uuid = (version) => {
5583
5605
  }, 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
5606
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
5585
5607
  return new RegExp(`^${regex}$`);
5586
- }, integer, number, boolean, lowercase, uppercase;
5608
+ }, integer, number, boolean, _null, lowercase, uppercase;
5587
5609
  var init_regexes = __esm(() => {
5588
5610
  cuid = /^[cC][0-9a-z]{6,}$/;
5589
5611
  cuid2 = /^[0-9a-z]+$/;
@@ -5606,6 +5628,7 @@ var init_regexes = __esm(() => {
5606
5628
  integer = /^-?\d+$/;
5607
5629
  number = /^-?\d+(?:\.\d+)?$/;
5608
5630
  boolean = /^(?:true|false)$/i;
5631
+ _null = /^null$/i;
5609
5632
  lowercase = /^[^A-Z]*$/;
5610
5633
  uppercase = /^[^a-z]*$/;
5611
5634
  });
@@ -6367,7 +6390,7 @@ function handleRefineResult(result, payload, input, inst) {
6367
6390
  payload.issues.push(issue(_iss));
6368
6391
  }
6369
6392
  }
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;
6393
+ 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
6394
  var init_schemas = __esm(() => {
6372
6395
  init_checks();
6373
6396
  init_core();
@@ -6798,6 +6821,23 @@ var init_schemas = __esm(() => {
6798
6821
  return payload;
6799
6822
  };
6800
6823
  });
6824
+ $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
6825
+ $ZodType.init(inst, def);
6826
+ inst._zod.pattern = _null;
6827
+ inst._zod.values = new Set([null]);
6828
+ inst._zod.parse = (payload, _ctx) => {
6829
+ const input = payload.value;
6830
+ if (input === null)
6831
+ return payload;
6832
+ payload.issues.push({
6833
+ expected: "null",
6834
+ code: "invalid_type",
6835
+ input,
6836
+ inst
6837
+ });
6838
+ return payload;
6839
+ };
6840
+ });
6801
6841
  $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
6802
6842
  $ZodType.init(inst, def);
6803
6843
  inst._zod.parse = (payload) => payload;
@@ -7236,6 +7276,132 @@ var init_schemas = __esm(() => {
7236
7276
  return handleTupleResults(itemResults, payload, items, input, optoutStart);
7237
7277
  };
7238
7278
  });
7279
+ $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
7280
+ $ZodType.init(inst, def);
7281
+ inst._zod.parse = (payload, ctx) => {
7282
+ const input = payload.value;
7283
+ if (!isPlainObject(input)) {
7284
+ payload.issues.push({
7285
+ expected: "record",
7286
+ code: "invalid_type",
7287
+ input,
7288
+ inst
7289
+ });
7290
+ return payload;
7291
+ }
7292
+ const proms = [];
7293
+ const values = def.keyType._zod.values;
7294
+ if (values) {
7295
+ payload.value = {};
7296
+ const recordKeys = new Set;
7297
+ for (const key of values) {
7298
+ if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
7299
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
7300
+ const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
7301
+ if (keyResult instanceof Promise) {
7302
+ throw new Error("Async schemas not supported in object keys currently");
7303
+ }
7304
+ if (keyResult.issues.length) {
7305
+ payload.issues.push({
7306
+ code: "invalid_key",
7307
+ origin: "record",
7308
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config3())),
7309
+ input: key,
7310
+ path: [key],
7311
+ inst
7312
+ });
7313
+ continue;
7314
+ }
7315
+ const outKey = keyResult.value;
7316
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
7317
+ if (result instanceof Promise) {
7318
+ proms.push(result.then((result) => {
7319
+ if (result.issues.length) {
7320
+ payload.issues.push(...prefixIssues(key, result.issues));
7321
+ }
7322
+ payload.value[outKey] = result.value;
7323
+ }));
7324
+ } else {
7325
+ if (result.issues.length) {
7326
+ payload.issues.push(...prefixIssues(key, result.issues));
7327
+ }
7328
+ payload.value[outKey] = result.value;
7329
+ }
7330
+ }
7331
+ }
7332
+ let unrecognized;
7333
+ for (const key in input) {
7334
+ if (!recordKeys.has(key)) {
7335
+ unrecognized = unrecognized ?? [];
7336
+ unrecognized.push(key);
7337
+ }
7338
+ }
7339
+ if (unrecognized && unrecognized.length > 0) {
7340
+ payload.issues.push({
7341
+ code: "unrecognized_keys",
7342
+ input,
7343
+ inst,
7344
+ keys: unrecognized
7345
+ });
7346
+ }
7347
+ } else {
7348
+ payload.value = {};
7349
+ for (const key of Reflect.ownKeys(input)) {
7350
+ if (key === "__proto__")
7351
+ continue;
7352
+ if (!Object.prototype.propertyIsEnumerable.call(input, key))
7353
+ continue;
7354
+ let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
7355
+ if (keyResult instanceof Promise) {
7356
+ throw new Error("Async schemas not supported in object keys currently");
7357
+ }
7358
+ const checkNumericKey = typeof key === "string" && number.test(key) && keyResult.issues.length;
7359
+ if (checkNumericKey) {
7360
+ const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);
7361
+ if (retryResult instanceof Promise) {
7362
+ throw new Error("Async schemas not supported in object keys currently");
7363
+ }
7364
+ if (retryResult.issues.length === 0) {
7365
+ keyResult = retryResult;
7366
+ }
7367
+ }
7368
+ if (keyResult.issues.length) {
7369
+ if (def.mode === "loose") {
7370
+ payload.value[key] = input[key];
7371
+ } else {
7372
+ payload.issues.push({
7373
+ code: "invalid_key",
7374
+ origin: "record",
7375
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config3())),
7376
+ input: key,
7377
+ path: [key],
7378
+ inst
7379
+ });
7380
+ }
7381
+ continue;
7382
+ }
7383
+ const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
7384
+ if (result instanceof Promise) {
7385
+ proms.push(result.then((result) => {
7386
+ if (result.issues.length) {
7387
+ payload.issues.push(...prefixIssues(key, result.issues));
7388
+ }
7389
+ payload.value[keyResult.value] = result.value;
7390
+ }));
7391
+ } else {
7392
+ if (result.issues.length) {
7393
+ payload.issues.push(...prefixIssues(key, result.issues));
7394
+ }
7395
+ payload.value[keyResult.value] = result.value;
7396
+ }
7397
+ }
7398
+ }
7399
+ if (proms.length) {
7400
+ return Promise.all(proms).then(() => payload);
7401
+ }
7402
+ return payload;
7403
+ };
7404
+ });
7239
7405
  $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
7240
7406
  $ZodType.init(inst, def);
7241
7407
  const values = getEnumValues(def.entries);
@@ -7524,6 +7690,23 @@ var init_schemas = __esm(() => {
7524
7690
  return payload;
7525
7691
  };
7526
7692
  });
7693
+ $ZodLazy = /* @__PURE__ */ $constructor("$ZodLazy", (inst, def) => {
7694
+ $ZodType.init(inst, def);
7695
+ defineLazy(inst._zod, "innerType", () => {
7696
+ const d = def;
7697
+ if (!d._cachedInner)
7698
+ d._cachedInner = def.getter();
7699
+ return d._cachedInner;
7700
+ });
7701
+ defineLazy(inst._zod, "pattern", () => inst._zod.innerType?._zod?.pattern);
7702
+ defineLazy(inst._zod, "propValues", () => inst._zod.innerType?._zod?.propValues);
7703
+ defineLazy(inst._zod, "optin", () => inst._zod.innerType?._zod?.optin ?? undefined);
7704
+ defineLazy(inst._zod, "optout", () => inst._zod.innerType?._zod?.optout ?? undefined);
7705
+ inst._zod.parse = (payload, ctx) => {
7706
+ const inner = inst._zod.innerType;
7707
+ return inner._zod.run(payload, ctx);
7708
+ };
7709
+ });
7527
7710
  $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
7528
7711
  $ZodCheck.init(inst, def);
7529
7712
  $ZodType.init(inst, def);
@@ -7992,6 +8175,12 @@ function _coercedBoolean(Class, params) {
7992
8175
  ...normalizeParams(params)
7993
8176
  });
7994
8177
  }
8178
+ function _null2(Class, params) {
8179
+ return new Class({
8180
+ type: "null",
8181
+ ...normalizeParams(params)
8182
+ });
8183
+ }
7995
8184
  function _unknown(Class) {
7996
8185
  return new Class({
7997
8186
  type: "unknown"
@@ -8601,6 +8790,14 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
8601
8790
  json.multipleOf = multipleOf;
8602
8791
  }, booleanProcessor = (_schema, _ctx, json, _params) => {
8603
8792
  json.type = "boolean";
8793
+ }, nullProcessor = (_schema, ctx, json, _params) => {
8794
+ if (ctx.target === "openapi-3.0") {
8795
+ json.type = "string";
8796
+ json.nullable = true;
8797
+ json.enum = [null];
8798
+ } else {
8799
+ json.type = "null";
8800
+ }
8604
8801
  }, neverProcessor = (_schema, _ctx, json, _params) => {
8605
8802
  json.not = {};
8606
8803
  }, unknownProcessor = (_schema, _ctx, _json, _params) => {}, enumProcessor = (schema, _ctx, json, _params) => {
@@ -8780,6 +8977,41 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
8780
8977
  json.minItems = minimum;
8781
8978
  if (typeof maximum === "number")
8782
8979
  json.maxItems = maximum;
8980
+ }, recordProcessor = (schema, ctx, _json, params) => {
8981
+ const json = _json;
8982
+ const def = schema._zod.def;
8983
+ json.type = "object";
8984
+ const keyType = def.keyType;
8985
+ const keyBag = keyType._zod.bag;
8986
+ const patterns = keyBag?.patterns;
8987
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
8988
+ const valueSchema = process3(def.valueType, ctx, {
8989
+ ...params,
8990
+ path: [...params.path, "patternProperties", "*"]
8991
+ });
8992
+ json.patternProperties = {};
8993
+ for (const pattern of patterns) {
8994
+ json.patternProperties[pattern.source] = valueSchema;
8995
+ }
8996
+ } else {
8997
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
8998
+ json.propertyNames = process3(def.keyType, ctx, {
8999
+ ...params,
9000
+ path: [...params.path, "propertyNames"]
9001
+ });
9002
+ }
9003
+ json.additionalProperties = process3(def.valueType, ctx, {
9004
+ ...params,
9005
+ path: [...params.path, "additionalProperties"]
9006
+ });
9007
+ }
9008
+ const keyValues = keyType._zod.values;
9009
+ if (keyValues) {
9010
+ const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
9011
+ if (validKeyValues.length > 0) {
9012
+ json.required = validKeyValues;
9013
+ }
9014
+ }
8783
9015
  }, nullableProcessor = (schema, ctx, json, params) => {
8784
9016
  const def = schema._zod.def;
8785
9017
  const inner = process3(def.innerType, ctx, params);
@@ -8838,6 +9070,11 @@ var formatMap, stringProcessor = (schema, ctx, _json, _params) => {
8838
9070
  process3(def.innerType, ctx, params);
8839
9071
  const seen = ctx.seen.get(schema);
8840
9072
  seen.ref = def.innerType;
9073
+ }, lazyProcessor = (schema, ctx, _json, params) => {
9074
+ const innerType = schema._zod.innerType;
9075
+ process3(innerType, ctx, params);
9076
+ const seen = ctx.seen.get(schema);
9077
+ seen.ref = innerType;
8841
9078
  };
8842
9079
  var init_json_schema_processors = __esm(() => {
8843
9080
  init_to_json_schema();
@@ -9018,6 +9255,9 @@ function int(params) {
9018
9255
  function boolean2(params) {
9019
9256
  return _boolean(ZodBoolean, params);
9020
9257
  }
9258
+ function _null3(params) {
9259
+ return _null2(ZodNull, params);
9260
+ }
9021
9261
  function unknown() {
9022
9262
  return _unknown(ZodUnknown);
9023
9263
  }
@@ -9084,6 +9324,22 @@ function tuple(items, _paramsOrRest, _params) {
9084
9324
  ...normalizeParams(params)
9085
9325
  });
9086
9326
  }
9327
+ function record(keyType, valueType, params) {
9328
+ if (!valueType || !valueType._zod) {
9329
+ return new ZodRecord({
9330
+ type: "record",
9331
+ keyType: string2(),
9332
+ valueType: keyType,
9333
+ ...normalizeParams(valueType)
9334
+ });
9335
+ }
9336
+ return new ZodRecord({
9337
+ type: "record",
9338
+ keyType,
9339
+ valueType,
9340
+ ...normalizeParams(params)
9341
+ });
9342
+ }
9087
9343
  function _enum(values, params) {
9088
9344
  const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;
9089
9345
  return new ZodEnum({
@@ -9175,13 +9431,25 @@ function templateLiteral(parts, params) {
9175
9431
  ...normalizeParams(params)
9176
9432
  });
9177
9433
  }
9434
+ function lazy(getter) {
9435
+ return new ZodLazy({
9436
+ type: "lazy",
9437
+ getter
9438
+ });
9439
+ }
9178
9440
  function refine(fn, _params = {}) {
9179
9441
  return _refine(ZodCustom, fn, _params);
9180
9442
  }
9181
9443
  function superRefine(fn, params) {
9182
9444
  return _superRefine(fn, params);
9183
9445
  }
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;
9446
+ function json(params) {
9447
+ const jsonSchema = lazy(() => {
9448
+ return union([string2(params), number2(), boolean2(), _null3(), array(jsonSchema), record(string2(), jsonSchema)]);
9449
+ });
9450
+ return jsonSchema;
9451
+ }
9452
+ 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
9453
  var init_schemas2 = __esm(() => {
9186
9454
  init_core2();
9187
9455
  init_core2();
@@ -9554,6 +9822,11 @@ var init_schemas2 = __esm(() => {
9554
9822
  ZodType.init(inst, def);
9555
9823
  inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
9556
9824
  });
9825
+ ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
9826
+ $ZodNull.init(inst, def);
9827
+ ZodType.init(inst, def);
9828
+ inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
9829
+ });
9557
9830
  ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
9558
9831
  $ZodUnknown.init(inst, def);
9559
9832
  ZodType.init(inst, def);
@@ -9660,6 +9933,13 @@ var init_schemas2 = __esm(() => {
9660
9933
  rest
9661
9934
  });
9662
9935
  });
9936
+ ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
9937
+ $ZodRecord.init(inst, def);
9938
+ ZodType.init(inst, def);
9939
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
9940
+ inst.keyType = def.keyType;
9941
+ inst.valueType = def.valueType;
9942
+ });
9663
9943
  ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
9664
9944
  $ZodEnum.init(inst, def);
9665
9945
  ZodType.init(inst, def);
@@ -9808,6 +10088,12 @@ var init_schemas2 = __esm(() => {
9808
10088
  ZodType.init(inst, def);
9809
10089
  inst._zod.processJSONSchema = (ctx, json, params) => templateLiteralProcessor(inst, ctx, json, params);
9810
10090
  });
10091
+ ZodLazy = /* @__PURE__ */ $constructor("ZodLazy", (inst, def) => {
10092
+ $ZodLazy.init(inst, def);
10093
+ ZodType.init(inst, def);
10094
+ inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
10095
+ inst.unwrap = () => inst._zod.def.getter();
10096
+ });
9811
10097
  ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
9812
10098
  $ZodCustom.init(inst, def);
9813
10099
  ZodType.init(inst, def);
@@ -10429,7 +10715,10 @@ var init_admin_artists = __esm(() => {
10429
10715
  path: "/admin/artists/rank",
10430
10716
  summary: "One tick of the similar-artists sweep (artist centroids + top-K edges)",
10431
10717
  tags: ["Admin"]
10432
- }).input(object({ limit: number3().int().min(1).max(1000).default(50) })).output(object({
10718
+ }).input(object({
10719
+ countRemaining: boolean3().default(false),
10720
+ limit: number3().int().min(1).max(1000).default(50)
10721
+ })).output(object({
10433
10722
  ok: literal(true),
10434
10723
  summary: object({
10435
10724
  centroidsComputed: number2(),
@@ -11144,7 +11433,7 @@ var init_admin_bios = __esm(() => {
11144
11433
  });
11145
11434
 
11146
11435
  // ../../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;
11436
+ 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
11437
  var init_admin_catalogue = __esm(() => {
11149
11438
  init_dist3();
11150
11439
  init_zod();
@@ -11365,6 +11654,70 @@ var init_admin_catalogue = __esm(() => {
11365
11654
  tracksSkippedLabelGate: number2().optional(),
11366
11655
  tracksWritten: number2()
11367
11656
  }).meta({ id: "CrawlPass" });
11657
+ CrawlPhaseInitializationSchema = object({
11658
+ artistsRearmed: number2(),
11659
+ releasesRearmed: number2(),
11660
+ seeded: number2(),
11661
+ seedsRearmed: number2()
11662
+ });
11663
+ CrawlPhaseInputSchema = discriminatedUnion("phase", [
11664
+ object({ phase: literal("initialize") }),
11665
+ object({
11666
+ limit: number2().int().min(1).max(2).default(2),
11667
+ maxHop: number2().int().min(0).max(3).default(2),
11668
+ phase: literal("prepare")
11669
+ }),
11670
+ object({ phase: literal("fetch"), preparedToken: string2().max(2 * 1024 * 1024) }),
11671
+ object({
11672
+ commitToken: string2().max(2 * 1024 * 1024),
11673
+ operationId: literal("catalogue.crawl"),
11674
+ operationKey: string2().max(128),
11675
+ phase: literal("commit"),
11676
+ requestDigest: string2().regex(/^[0-9a-f]{64}$/)
11677
+ })
11678
+ ]);
11679
+ CrawlPhaseOutputSchema = discriminatedUnion("phase", [
11680
+ object({
11681
+ initialization: CrawlPhaseInitializationSchema,
11682
+ kind: _enum(["initialized", "unavailable"]),
11683
+ ok: literal(true),
11684
+ phase: literal("initialize")
11685
+ }),
11686
+ object({
11687
+ frontierPending: number2(),
11688
+ initialization: CrawlPhaseInitializationSchema,
11689
+ items: array(object({ nodeId: string2(), preparedToken: string2() })).max(2),
11690
+ kind: _enum(["drained", "prepared", "unavailable"]),
11691
+ ok: literal(true),
11692
+ phase: literal("prepare")
11693
+ }),
11694
+ object({
11695
+ commitToken: string2(),
11696
+ ok: literal(true),
11697
+ operationId: literal("catalogue.crawl"),
11698
+ operationKey: string2(),
11699
+ phase: literal("fetch"),
11700
+ requestDigest: string2()
11701
+ }),
11702
+ object({
11703
+ ok: literal(true),
11704
+ phase: literal("commit"),
11705
+ receipt: object({
11706
+ outcome: _enum([
11707
+ "committed",
11708
+ "conflict",
11709
+ "in-progress",
11710
+ "lookup-failed",
11711
+ "rejected",
11712
+ "safely-retryable"
11713
+ ]),
11714
+ replayed: boolean2(),
11715
+ result: json().optional(),
11716
+ resultIdentity: string2().optional(),
11717
+ state: _enum(["accepted", "committed", "rejected"]).optional()
11718
+ })
11719
+ })
11720
+ ]);
11368
11721
  CrawlStatusSchema = object({
11369
11722
  anchorsPending: number2(),
11370
11723
  catalogueTracks: number2(),
@@ -11390,12 +11743,13 @@ var init_admin_catalogue = __esm(() => {
11390
11743
  summary: "Run one bounded, resumable pass of the catalogue crawler",
11391
11744
  tags: ["Admin"]
11392
11745
  }).input(object({
11746
+ body: CrawlPhaseInputSchema.optional(),
11393
11747
  query: object({
11394
11748
  dryRun: string2().optional(),
11395
11749
  limit: string2().optional(),
11396
11750
  maxHop: string2().optional()
11397
11751
  })
11398
- })).output(CrawlPassSchema.extend({ ok: literal(true) }));
11752
+ })).output(union([CrawlPassSchema.extend({ ok: literal(true) }), CrawlPhaseOutputSchema]));
11399
11753
  getCrawlStatus = oc.route({
11400
11754
  method: "GET",
11401
11755
  operationId: "getCrawlStatus",
@@ -11953,7 +12307,8 @@ var init_admin_projections = __esm(() => {
11953
12307
  processed: CountSchema,
11954
12308
  scheduled: CountSchema,
11955
12309
  status: ProjectionStatusSchema.optional(),
11956
- target: ProjectionTargetSchema
12310
+ target: ProjectionTargetSchema,
12311
+ trackSourceMarkersPending: boolean2().optional()
11957
12312
  }));
11958
12313
  setProjectionCutover = oc.route({
11959
12314
  method: "PUT",
@@ -12897,7 +13252,7 @@ var init_admin_operation_receipts = __esm(() => {
12897
13252
  });
12898
13253
 
12899
13254
  // ../../packages/contracts/src/orpc/admin-health.ts
12900
- var HEALTH_SNAPSHOT_PRODUCER_MAX = 64, HEALTH_SNAPSHOT_PRODUCER_PATTERN, ServiceHealthStatusSchema, HealthCheckSchema, recordHealth, adminHealthContract;
13255
+ var HEALTH_SNAPSHOT_PRODUCER_MAX = 64, HEALTH_SNAPSHOT_PRODUCER_PATTERN, HEALTH_SNAPSHOT_CHECKS_MAX = 128, HEALTH_SNAPSHOT_SERVICE_MAX = 64, ServiceHealthStatusSchema, HealthCheckSchema, recordHealth, adminHealthContract;
12901
13256
  var init_admin_health = __esm(() => {
12902
13257
  init_dist3();
12903
13258
  init_zod();
@@ -12907,7 +13262,7 @@ var init_admin_health = __esm(() => {
12907
13262
  HealthCheckSchema = object({
12908
13263
  latencyMs: number2().int().nullable(),
12909
13264
  message: string2().nullable(),
12910
- service: string2().min(1),
13265
+ service: string2().min(1).max(HEALTH_SNAPSHOT_SERVICE_MAX),
12911
13266
  status: ServiceHealthStatusSchema,
12912
13267
  transitioned: boolean2()
12913
13268
  }).meta({ id: "HealthCheck" });
@@ -12919,7 +13274,7 @@ var init_admin_health = __esm(() => {
12919
13274
  tags: ["Admin"]
12920
13275
  }).input(object({
12921
13276
  at: string2().max(64).datetime({ offset: true }),
12922
- checks: array(HealthCheckSchema),
13277
+ checks: array(HealthCheckSchema).max(HEALTH_SNAPSHOT_CHECKS_MAX),
12923
13278
  operationKey: string2().min(1).max(OPERATION_RECEIPT_KEY_MAX).regex(OPERATION_RECEIPT_KEY_PATTERN).optional(),
12924
13279
  producer: string2().max(HEALTH_SNAPSHOT_PRODUCER_MAX).regex(HEALTH_SNAPSHOT_PRODUCER_PATTERN).optional(),
12925
13280
  requestDigest: string2().regex(OPERATION_RECEIPT_REQUEST_DIGEST_PATTERN).optional()
@@ -12934,24 +13289,34 @@ var init_admin_health = __esm(() => {
12934
13289
  });
12935
13290
 
12936
13291
  // ../../packages/contracts/src/orpc/admin-hub-counts.ts
12937
- var HubCountsTableResultSchema, reconcileHubCounts, adminHubCountsContract;
13292
+ var HubCountsTableResultSchema, HubCountsReconcileCursorSchema, reconcileHubCounts, adminHubCountsContract;
12938
13293
  var init_admin_hub_counts = __esm(() => {
12939
13294
  init_dist3();
12940
13295
  init_zod();
12941
13296
  HubCountsTableResultSchema = object({
12942
- corrected: number2()
13297
+ corrected: number2(),
13298
+ deferred: number2()
12943
13299
  }).meta({ id: "HubCountsTableResult" });
13300
+ HubCountsReconcileCursorSchema = object({
13301
+ afterId: string2().min(1).max(512).nullable(),
13302
+ table: _enum(["labels", "albums", "artists"])
13303
+ }).meta({ id: "HubCountsReconcileCursor" });
12944
13304
  reconcileHubCounts = oc.route({
12945
13305
  method: "POST",
12946
13306
  operationId: "reconcileHubCounts",
12947
13307
  path: "/admin/hub-counts/reconcile",
12948
13308
  summary: "Reconcile the maintained hub counts against truth and report the corrected rows",
12949
13309
  tags: ["Admin"]
12950
- }).input(object({})).output(object({
13310
+ }).input(object({
13311
+ cursor: HubCountsReconcileCursorSchema.optional(),
13312
+ pageLimit: number2().int().min(1).max(20).optional()
13313
+ })).output(object({
12951
13314
  albums: HubCountsTableResultSchema,
12952
13315
  artists: HubCountsTableResultSchema,
12953
13316
  labels: HubCountsTableResultSchema,
13317
+ next: HubCountsReconcileCursorSchema.nullable(),
12954
13318
  ok: literal(true),
13319
+ pages: number2(),
12955
13320
  tookMs: number2()
12956
13321
  }));
12957
13322
  adminHubCountsContract = {
@@ -14159,7 +14524,7 @@ var init_admin_tokens = __esm(() => {
14159
14524
  });
14160
14525
 
14161
14526
  // ../../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;
14527
+ 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
14528
  var init_admin_tracks = __esm(() => {
14164
14529
  init_dist3();
14165
14530
  init_zod();
@@ -14249,6 +14614,157 @@ var init_admin_tracks = __esm(() => {
14249
14614
  ok: literal(true),
14250
14615
  trackId: string2()
14251
14616
  }));
14617
+ CaptureReconciliationKindSchema = _enum([
14618
+ "capture",
14619
+ "youtube-provenance",
14620
+ "youtube-reverdict"
14621
+ ]);
14622
+ CaptureExternalResultSchema = union([
14623
+ discriminatedUnion("outcome", [
14624
+ strictObject({
14625
+ attemptedAt: string2().datetime({ offset: true }),
14626
+ kind: literal("capture"),
14627
+ outcome: _enum(["failed", "unmatched"]),
14628
+ sourceAudioRejected: string2().max(16384).optional()
14629
+ }),
14630
+ strictObject({
14631
+ attemptedAt: string2().datetime({ offset: true }),
14632
+ bytes: number2().int().min(1),
14633
+ captureVerification: _enum(["preview-match", "unverified"]),
14634
+ capturedAt: string2().datetime({ offset: true }),
14635
+ kind: literal("capture"),
14636
+ outcome: literal("done"),
14637
+ sourceAudioKey: string2().min(1).max(1024),
14638
+ sourceAudioRejected: string2().max(16384).optional(),
14639
+ verifiedAt: string2().datetime({ offset: true }),
14640
+ youtubeVideoId: string2().min(1).max(128).optional()
14641
+ })
14642
+ ]),
14643
+ discriminatedUnion("outcome", [
14644
+ strictObject({
14645
+ kind: literal("youtube-provenance"),
14646
+ outcome: literal("none"),
14647
+ verification: _enum(["inconclusive", "no-match"])
14648
+ }),
14649
+ strictObject({
14650
+ kind: literal("youtube-provenance"),
14651
+ outcome: literal("source-found"),
14652
+ sourceVerification: _enum(["soundcloud-archive-match", "soundcloud-preview-match"])
14653
+ }),
14654
+ strictObject({
14655
+ kind: literal("youtube-provenance"),
14656
+ outcome: literal("youtube-found"),
14657
+ verification: _enum(["archive-match", "metadata-match", "preview-match"]),
14658
+ youtubeVideoId: string2().min(1).max(128)
14659
+ })
14660
+ ]),
14661
+ strictObject({ kind: literal("youtube-reverdict"), outcome: literal("reverdict") })
14662
+ ]);
14663
+ CaptureReceiptCoordinatesSchema = strictObject({
14664
+ operationId: literal("track.capture"),
14665
+ operationKey: string2().min(1).max(256).regex(/^[A-Za-z0-9][A-Za-z0-9._~:/-]*$/),
14666
+ requestDigest: string2().regex(/^[0-9a-f]{64}$/)
14667
+ });
14668
+ CapturePreparedTrackSchema = strictObject({
14669
+ analyzedFrom: _enum(["full", "preview"]).optional(),
14670
+ artists: array(string2().max(512)).max(64),
14671
+ bpm: number2().optional(),
14672
+ certified: boolean2(),
14673
+ durationMs: number2().int().min(1).optional(),
14674
+ label: string2().max(1024).optional(),
14675
+ logId: string2().max(64).optional(),
14676
+ sourceAudioFailures: number2().int().min(0).optional(),
14677
+ sourceAudioKey: string2().max(1024).optional(),
14678
+ sourceAudioRejected: string2().max(16384).optional(),
14679
+ title: string2().max(2048),
14680
+ trackId: string2().min(1).max(256)
14681
+ });
14682
+ CaptureCommittedReceiptResultSchema = union([
14683
+ strictObject({
14684
+ applied: literal(true),
14685
+ kind: literal("capture"),
14686
+ outcome: _enum(["done", "failed", "unmatched"])
14687
+ }),
14688
+ strictObject({
14689
+ applied: literal(true),
14690
+ kind: literal("youtube-provenance"),
14691
+ outcome: _enum(["none", "source-found", "youtube-found"])
14692
+ }),
14693
+ strictObject({
14694
+ applied: literal(true),
14695
+ kind: literal("youtube-reverdict"),
14696
+ outcome: literal("reverdict")
14697
+ })
14698
+ ]);
14699
+ CaptureRejectedReceiptResultSchema = strictObject({
14700
+ applied: literal(false),
14701
+ reason: literal("stale")
14702
+ });
14703
+ prepareTrackCapture = oc.route({
14704
+ method: "POST",
14705
+ operationId: "prepareTrackCapture",
14706
+ path: "/admin/tracks/{trackId}/capture/prepare",
14707
+ summary: "Prepare a current capture reconciliation snapshot",
14708
+ tags: ["Admin"]
14709
+ }).input(strictObject({
14710
+ kind: CaptureReconciliationKindSchema,
14711
+ priorSnapshotToken: string2().min(1).max(65536).optional(),
14712
+ trackId: string2().min(1).max(256)
14713
+ })).output(discriminatedUnion("prepared", [
14714
+ strictObject({
14715
+ ok: literal(true),
14716
+ prepared: literal(false),
14717
+ reason: _enum(["ineligible", "not-found", "stale"])
14718
+ }),
14719
+ strictObject({
14720
+ ok: literal(true),
14721
+ prepared: literal(true),
14722
+ snapshotToken: string2().min(1).max(65536),
14723
+ track: CapturePreparedTrackSchema
14724
+ })
14725
+ ]));
14726
+ authorizeTrackCapture = oc.route({
14727
+ method: "POST",
14728
+ operationId: "authorizeTrackCapture",
14729
+ path: "/admin/tracks/{trackId}/capture/authorize",
14730
+ summary: "Authorize a prepared capture result",
14731
+ tags: ["Admin"]
14732
+ }).input(strictObject({
14733
+ result: CaptureExternalResultSchema,
14734
+ snapshotToken: string2().min(1).max(65536),
14735
+ trackId: string2().min(1).max(256)
14736
+ })).output(CaptureReceiptCoordinatesSchema.extend({
14737
+ commitToken: string2().min(1).max(65536),
14738
+ ok: literal(true)
14739
+ }));
14740
+ commitTrackCapture = oc.route({
14741
+ method: "POST",
14742
+ operationId: "commitTrackCapture",
14743
+ path: "/admin/tracks/{trackId}/capture/commit",
14744
+ summary: "Commit a prepared capture result",
14745
+ tags: ["Admin"]
14746
+ }).input(CaptureReceiptCoordinatesSchema.extend({
14747
+ commitToken: string2().min(1).max(65536),
14748
+ trackId: string2().min(1).max(256)
14749
+ })).output(discriminatedUnion("outcome", [
14750
+ strictObject({
14751
+ ok: literal(true),
14752
+ outcome: literal("committed"),
14753
+ replayed: boolean2(),
14754
+ result: CaptureCommittedReceiptResultSchema
14755
+ }),
14756
+ strictObject({
14757
+ ok: literal(true),
14758
+ outcome: literal("rejected"),
14759
+ replayed: boolean2(),
14760
+ result: CaptureRejectedReceiptResultSchema
14761
+ }),
14762
+ strictObject({
14763
+ ok: literal(true),
14764
+ outcome: _enum(["conflict", "in-progress", "safely-retryable"]),
14765
+ replayed: boolean2()
14766
+ })
14767
+ ]));
14252
14768
  observeTrack = oc.route({
14253
14769
  method: "POST",
14254
14770
  operationId: "observeTrack",
@@ -14484,6 +15000,8 @@ var init_admin_tracks = __esm(() => {
14484
15000
  totalCost: number2()
14485
15001
  }));
14486
15002
  adminTracksContract = {
15003
+ authorize_track_capture: authorizeTrackCapture,
15004
+ commit_track_capture: commitTrackCapture,
14487
15005
  context_track: contextTrack,
14488
15006
  finalize_track_video: finalizeTrackVideo,
14489
15007
  get_mixable_order: getMixableOrder,
@@ -14492,6 +15010,7 @@ var init_admin_tracks = __esm(() => {
14492
15010
  list_tracks_admin: listTracksAdmin,
14493
15011
  note_track: noteTrack,
14494
15012
  observe_track: observeTrack,
15013
+ prepare_track_capture: prepareTrackCapture,
14495
15014
  presign_track_video_uploads: presignTrackVideoUploads,
14496
15015
  publish_track: publishTrack,
14497
15016
  purge_video: purgeVideo,
@@ -18033,6 +18552,9 @@ async function crawlCatalogueCommand(limit, maxHop, dryRun) {
18033
18552
  }
18034
18553
  return adminApiPost(`/api/v1/admin/catalogue/crawl?${params.toString()}`);
18035
18554
  }
18555
+ async function crawlCataloguePhaseCommand(body) {
18556
+ return adminApiPost("/api/v1/admin/catalogue/crawl", body);
18557
+ }
18036
18558
  async function crawlStatusCommand() {
18037
18559
  return adminApiGet("/api/v1/admin/catalogue/crawl");
18038
18560
  }
@@ -18115,7 +18637,10 @@ async function resolveArtistCommand(artistId) {
18115
18637
  }
18116
18638
  async function rankArtistsCommand(options) {
18117
18639
  const limit = options.limit ? Number.parseInt(options.limit, 10) : undefined;
18118
- const response = await adminApiPost("/api/v1/admin/artists/rank", limit ? { limit } : {});
18640
+ const response = await adminApiPost("/api/v1/admin/artists/rank", {
18641
+ ...limit ? { limit } : {},
18642
+ ...options.countRemaining ? { countRemaining: true } : {}
18643
+ });
18119
18644
  return { summary: response.summary };
18120
18645
  }
18121
18646
  async function backfillArtistImagesCommand(limit, dryRun, cursor) {
@@ -21726,8 +22251,17 @@ JSON field reference:
21726
22251
  }
21727
22252
  console.log(changed ? `Restored ${trackId}. It re-enters the ranking on the next sweep.` : `${trackId} was not dismissed \u2014 nothing to restore.`);
21728
22253
  });
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) => {
22254
+ 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
22255
  await Promise.resolve().then(() => init_admin_catalogue2());
22256
+ if (options.phaseFile) {
22257
+ if (options.dryRun) {
22258
+ throw new Error("--phase-file cannot be combined with --dry-run");
22259
+ }
22260
+ const body = JSON.parse(readFileSync6(options.phaseFile, "utf8"));
22261
+ const result = await crawlCataloguePhaseCommand(body);
22262
+ printJson(result);
22263
+ return;
22264
+ }
21731
22265
  await runCrawlCatalogue(options, crawlCatalogueCommand);
21732
22266
  });
21733
22267
  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) => {
@@ -24034,7 +24568,10 @@ async function runGalaxies(slug, options, commands) {
24034
24568
  }
24035
24569
  }
24036
24570
  async function runArtistsRank(options, rankArtistsCommand) {
24037
- const { summary } = await rankArtistsCommand({ limit: options.limit });
24571
+ const { summary } = await rankArtistsCommand({
24572
+ countRemaining: !options.json,
24573
+ limit: options.limit
24574
+ });
24038
24575
  if (options.json) {
24039
24576
  printJson({ ok: true, summary });
24040
24577
  return;
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.235.0"
35
35
  }