fluncle 0.252.0 → 0.254.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 +85 -4
  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.252.0".trim() ? "0.252.0".trim() : "0.1.0";
625
+ currentVersion = "0.254.0".trim() ? "0.254.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.252.0".trim() ? "0.252.0".trim() : "0.1.0";
2338
+ currentVersion2 = "0.254.0".trim() ? "0.254.0".trim() : "0.1.0";
2339
2339
  });
2340
2340
 
2341
2341
  // ../../packages/registry/src/index.ts
@@ -4309,6 +4309,15 @@ async function trackRequeueVideoCommand(idOrLogId) {
4309
4309
  async function trackPurgeVideoCommand(idOrLogId) {
4310
4310
  return adminApiPost(`/api/v1/admin/tracks/${encodeURIComponent(idOrLogId)}/video/purge`);
4311
4311
  }
4312
+ async function trackPinSourceCommand(idOrLogId, youtube, options = {}) {
4313
+ return adminApiPut(`/api/v1/admin/tracks/${encodeURIComponent(idOrLogId)}/capture-source`, {
4314
+ ...options.allowDurationMismatch === true ? { allowDurationMismatch: true } : {},
4315
+ youtubeVideoId: youtube
4316
+ });
4317
+ }
4318
+ async function trackClearSourcePinCommand(idOrLogId) {
4319
+ return adminApiDelete(`/api/v1/admin/tracks/${encodeURIComponent(idOrLogId)}/capture-source`);
4320
+ }
4312
4321
  async function trackObserveCommand(idOrLogId, options) {
4313
4322
  const body = { script: options.script };
4314
4323
  if (options.voiceId !== undefined) {
@@ -11644,6 +11653,7 @@ var init_admin_catalogue = __esm(() => {
11644
11653
  action: _enum([
11645
11654
  "flagged-finding",
11646
11655
  "not-captured",
11656
+ "operator-verified",
11647
11657
  "preview-match",
11648
11658
  "quarantined-catalogue",
11649
11659
  "unverified"
@@ -14722,7 +14732,7 @@ var init_admin_tokens = __esm(() => {
14722
14732
  });
14723
14733
 
14724
14734
  // ../../packages/contracts/src/orpc/admin-tracks.ts
14725
- var UpdateTrackBodySchema, ObserveTrackBodySchema, ContextTrackBodySchema, NoteTrackBodySchema, NoteEchoSchema, PresignVideoUploadsBodySchema, FinalizeVideoBodySchema, VideoUploadSchema, updateTrack, CaptureReconciliationKindSchema, CaptureExternalResultSchema, CaptureReceiptCoordinatesSchema, CapturePreparedTrackSchema, CaptureCommittedReceiptResultSchema, CaptureRejectedReceiptResultSchema, prepareTrackCapture, authorizeTrackCapture, commitTrackCapture, MAX_CAPTURE_PREPARE_BATCH = 12, MAX_CAPTURE_COMMIT_BATCH = 6, MAX_EMBEDDING_WRITE_BATCH = 6, EMBEDDING_DIMENSIONS = 1024, TrackWorkCapabilitiesSchema, ItemElapsedMsSchema, CapturePreparedItemSchema, prepareTrackCaptures, CaptureCommitReceiptSchema, commitTrackCaptures, updateTrackEmbeddings, observeTrack, contextTrack, noteTrack, presignTrackVideoUploads, finalizeTrackVideo, requeueVideo, purgeVideo, PublishTrackResultSchema, getTrackAdmin, listTracksAdmin, TrackWorkKindSchema, TrackWorkScopeSchema, TrackWorkItemSchema, listTrackWork, publishTrack, MixOrderStopSchema, getMixableOrder, adminTracksContract;
14735
+ var UpdateTrackBodySchema, ObserveTrackBodySchema, ContextTrackBodySchema, NoteTrackBodySchema, NoteEchoSchema, PresignVideoUploadsBodySchema, FinalizeVideoBodySchema, VideoUploadSchema, updateTrack, CaptureReconciliationKindSchema, CaptureExternalResultSchema, CaptureReceiptCoordinatesSchema, CapturePreparedTrackSchema, CaptureCommittedReceiptResultSchema, CaptureRejectedReceiptResultSchema, prepareTrackCapture, authorizeTrackCapture, commitTrackCapture, MAX_CAPTURE_PREPARE_BATCH = 12, MAX_CAPTURE_COMMIT_BATCH = 6, MAX_EMBEDDING_WRITE_BATCH = 6, EMBEDDING_DIMENSIONS = 1024, TrackWorkCapabilitiesSchema, ItemElapsedMsSchema, CapturePreparedItemSchema, prepareTrackCaptures, CaptureCommitReceiptSchema, commitTrackCaptures, updateTrackEmbeddings, observeTrack, contextTrack, noteTrack, presignTrackVideoUploads, finalizeTrackVideo, requeueVideo, purgeVideo, CaptureSourcePinResultSchema, pinCaptureSource, clearCaptureSource, PublishTrackResultSchema, getTrackAdmin, listTracksAdmin, TrackWorkKindSchema, TrackWorkScopeSchema, TrackWorkItemSchema, listTrackWork, publishTrack, MixOrderStopSchema, getMixableOrder, adminTracksContract;
14726
14736
  var init_admin_tracks = __esm(() => {
14727
14737
  init_dist3();
14728
14738
  init_zod();
@@ -14828,7 +14838,12 @@ var init_admin_tracks = __esm(() => {
14828
14838
  strictObject({
14829
14839
  attemptedAt: string2().datetime({ offset: true }),
14830
14840
  bytes: number2().int().min(1),
14831
- captureVerification: _enum(["preview-match", "unverified"]),
14841
+ captureVerification: _enum([
14842
+ "consensus-verified",
14843
+ "operator-verified",
14844
+ "preview-match",
14845
+ "unverified"
14846
+ ]),
14832
14847
  capturedAt: string2().datetime({ offset: true }),
14833
14848
  kind: literal("capture"),
14834
14849
  outcome: literal("done"),
@@ -14868,6 +14883,8 @@ var init_admin_tracks = __esm(() => {
14868
14883
  anchored: boolean2().optional(),
14869
14884
  artists: array(string2().max(512)).max(64),
14870
14885
  bpm: number2().optional(),
14886
+ captureSourcePin: string2().max(64).optional(),
14887
+ captureSourcePinAllowDuration: boolean2().optional(),
14871
14888
  certified: boolean2(),
14872
14889
  durationMs: number2().int().min(1).optional(),
14873
14890
  label: string2().max(1024).optional(),
@@ -15154,6 +15171,32 @@ var init_admin_tracks = __esm(() => {
15154
15171
  ok: literal(true),
15155
15172
  trackId: string2()
15156
15173
  }));
15174
+ CaptureSourcePinResultSchema = object({
15175
+ captureSourcePin: string2().nullable(),
15176
+ captureSourcePinAllowDuration: boolean2(),
15177
+ captureStatus: string2(),
15178
+ logId: string2().nullable(),
15179
+ ok: literal(true),
15180
+ trackId: string2()
15181
+ }).meta({ id: "CaptureSourcePinResult" });
15182
+ pinCaptureSource = oc.route({
15183
+ method: "PUT",
15184
+ operationId: "pinCaptureSource",
15185
+ path: "/admin/tracks/{trackId}/capture-source",
15186
+ summary: "Pin the YouTube upload the capture sweep must download for a track",
15187
+ tags: ["Admin"]
15188
+ }).input(object({
15189
+ allowDurationMismatch: boolean2().optional(),
15190
+ trackId: string2(),
15191
+ youtubeVideoId: string2().min(1).max(2048)
15192
+ })).output(CaptureSourcePinResultSchema);
15193
+ clearCaptureSource = oc.route({
15194
+ method: "DELETE",
15195
+ operationId: "clearCaptureSource",
15196
+ path: "/admin/tracks/{trackId}/capture-source",
15197
+ summary: "Clear a track's pinned capture source (the ladder runs again)",
15198
+ tags: ["Admin"]
15199
+ }).input(object({ trackId: string2() })).output(CaptureSourcePinResultSchema);
15157
15200
  PublishTrackResultSchema = object({
15158
15201
  addedToSpotify: boolean2(),
15159
15202
  dryRun: boolean2(),
@@ -15231,6 +15274,8 @@ var init_admin_tracks = __esm(() => {
15231
15274
  artists: array(string2()),
15232
15275
  bpm: number2().optional(),
15233
15276
  capturePriority: number2().nullable(),
15277
+ captureSourcePin: string2().optional(),
15278
+ captureSourcePinAllowDuration: boolean2().optional(),
15234
15279
  certified: boolean2(),
15235
15280
  deezerQuery: string2().optional(),
15236
15281
  durationMs: number2(),
@@ -15297,6 +15342,7 @@ var init_admin_tracks = __esm(() => {
15297
15342
  }));
15298
15343
  adminTracksContract = {
15299
15344
  authorize_track_capture: authorizeTrackCapture,
15345
+ clear_capture_source: clearCaptureSource,
15300
15346
  commit_track_capture: commitTrackCapture,
15301
15347
  commit_track_captures: commitTrackCaptures,
15302
15348
  context_track: contextTrack,
@@ -15307,6 +15353,7 @@ var init_admin_tracks = __esm(() => {
15307
15353
  list_tracks_admin: listTracksAdmin,
15308
15354
  note_track: noteTrack,
15309
15355
  observe_track: observeTrack,
15356
+ pin_capture_source: pinCaptureSource,
15310
15357
  prepare_track_capture: prepareTrackCapture,
15311
15358
  prepare_track_captures: prepareTrackCaptures,
15312
15359
  presign_track_video_uploads: presignTrackVideoUploads,
@@ -22183,6 +22230,13 @@ JSON field reference:
22183
22230
  await Promise.resolve().then(() => init_track());
22184
22231
  await runTrackPurgeVideo(idOrLogId, options, trackPurgeVideoCommand);
22185
22232
  });
22233
+ adminTrack.command("pin-source").description("Pin the YouTube upload the capture sweep must download for a track (operator); --clear withdraws it").argument("[idOrLogId]").option("--allow-duration-mismatch", "Waive the duration guard for this pin: a deliberately chosen different edit of the same recording (the finding keeps its store length)", false).option("--clear", "Withdraw the pin (capture status and captured audio stay as they are)", false).option("--json", "Print JSON", false).option("--upload <url|id>", "The YouTube upload: a bare 11-char video id or a youtube.com / youtu.be URL").allowExcessArguments().action(async (idOrLogId, options) => {
22234
+ await Promise.resolve().then(() => init_track());
22235
+ await runTrackPinSource(idOrLogId, options, {
22236
+ clear: trackClearSourcePinCommand,
22237
+ pin: trackPinSourceCommand
22238
+ });
22239
+ });
22186
22240
  adminTrack.command("draft").description("Push the video to a platform as a draft").argument("[idOrLogId]").option("--json", "Print JSON", false).option("--platform <platform>", "Publishing platform").allowExcessArguments().action(async (idOrLogId, options) => {
22187
22241
  await Promise.resolve().then(() => init_track());
22188
22242
  await runTrackDraft(idOrLogId, options, trackDraftCommand);
@@ -24550,6 +24604,32 @@ async function runTrackRequeueVideo(idOrLogId, options, trackRequeueVideoCommand
24550
24604
  }
24551
24605
  console.log(result.alreadyClear ? `${result.logId} already had no video. Nothing to clear.` : `Cleared the video for ${result.logId}. It's back on the render queue (and off radio until re-rendered).`);
24552
24606
  }
24607
+ async function runTrackPinSource(idOrLogId, options, commands) {
24608
+ const usage = "Usage: fluncle admin tracks pin-source <track_id|log_id> --upload <url|id> [--allow-duration-mismatch] [--json] | --clear";
24609
+ if (!idOrLogId) {
24610
+ throw new Error(`Missing id. ${usage}`);
24611
+ }
24612
+ const youtube = options.upload?.trim();
24613
+ if (options.clear && youtube) {
24614
+ throw new Error(`Pass either --upload or --clear, not both. ${usage}`);
24615
+ }
24616
+ if (!options.clear && !youtube) {
24617
+ throw new Error(`Missing --upload <url|id> (or --clear to withdraw the pin). ${usage}`);
24618
+ }
24619
+ if (options.clear && options.allowDurationMismatch) {
24620
+ throw new Error(`--allow-duration-mismatch rides a pin, not --clear. ${usage}`);
24621
+ }
24622
+ const result = options.clear ? await commands.clear(idOrLogId) : await commands.pin(idOrLogId, youtube ?? "", {
24623
+ allowDurationMismatch: options.allowDurationMismatch
24624
+ });
24625
+ if (options.json) {
24626
+ printJson(result);
24627
+ return;
24628
+ }
24629
+ const who = result.logId ?? result.trackId;
24630
+ const guard = result.captureSourcePinAllowDuration ? "any length accepted" : "duration guard applies";
24631
+ console.log(result.captureSourcePin ? `Pinned ${who} to youtube ${result.captureSourcePin} \u2014 capture ${result.captureStatus.toUpperCase()}; the next capture tick downloads that upload, ladder skipped, ${guard}.` : `Cleared the capture-source pin on ${who} \u2014 capture ${result.captureStatus.toUpperCase()} untouched; the ladder runs again.`);
24632
+ }
24553
24633
  async function runTrackPurgeVideo(idOrLogId, options, trackPurgeVideoCommand) {
24554
24634
  if (!idOrLogId) {
24555
24635
  throw new Error("Missing id. Usage: fluncle admin tracks purge-video <track_id|log_id>");
@@ -26008,6 +26088,7 @@ var stringOptions = new Set([
26008
26088
  "--wall-ms",
26009
26089
  "--window-since",
26010
26090
  "--window-until",
26091
+ "--upload",
26011
26092
  "--work-kind"
26012
26093
  ]);
26013
26094
  var rootHelpSections = `
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.252.0"
34
+ "version": "0.254.0"
35
35
  }