fluncle 0.154.0 → 0.155.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 +115 -3
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -561,7 +561,7 @@ function parseVersion(version) {
561
561
  var currentVersion;
562
562
  var init_version = __esm(() => {
563
563
  init_output();
564
- currentVersion = "0.154.0".trim() ? "0.154.0".trim() : "0.1.0";
564
+ currentVersion = "0.155.0".trim() ? "0.155.0".trim() : "0.1.0";
565
565
  });
566
566
 
567
567
  // src/update-notifier.ts
@@ -2189,7 +2189,7 @@ function parseVersion2(version) {
2189
2189
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2190
2190
  var init_version2 = __esm(() => {
2191
2191
  init_output();
2192
- currentVersion2 = "0.154.0".trim() ? "0.154.0".trim() : "0.1.0";
2192
+ currentVersion2 = "0.155.0".trim() ? "0.155.0".trim() : "0.1.0";
2193
2193
  });
2194
2194
 
2195
2195
  // ../../packages/registry/src/index.ts
@@ -5896,9 +5896,29 @@ var exports_admin_artists = {};
5896
5896
  __export(exports_admin_artists, {
5897
5897
  resolveArtistCommand: () => resolveArtistCommand,
5898
5898
  listArtistsCommand: () => listArtistsCommand,
5899
+ describeArtistCommand: () => describeArtistCommand,
5900
+ buildBioBody: () => buildBioBody,
5899
5901
  backfillArtistsCommand: () => backfillArtistsCommand,
5900
- backfillArtistImagesCommand: () => backfillArtistImagesCommand
5902
+ backfillArtistImagesCommand: () => backfillArtistImagesCommand,
5903
+ artistsBioQueueCommand: () => artistsBioQueueCommand
5901
5904
  });
5905
+ function buildBioBody(options) {
5906
+ const body = { bio: options.bio };
5907
+ if (options.dryRun) {
5908
+ body.dryRun = true;
5909
+ }
5910
+ if (typeof options.promptVersion === "number") {
5911
+ body.promptVersion = options.promptVersion;
5912
+ }
5913
+ return body;
5914
+ }
5915
+ async function describeArtistCommand(slug, options) {
5916
+ return adminApiPost(`/api/admin/artists/${encodeURIComponent(slug)}/bio`, buildBioBody(options));
5917
+ }
5918
+ async function artistsBioQueueCommand(limit) {
5919
+ const response = await adminApiGet(`/api/admin/artists/bio-queue?limit=${limit}`);
5920
+ return response.artists;
5921
+ }
5902
5922
  async function listArtistsCommand(limit, cursor) {
5903
5923
  const params = new URLSearchParams({ limit: String(limit) });
5904
5924
  if (cursor) {
@@ -5927,11 +5947,35 @@ var init_admin_artists = __esm(() => {
5927
5947
  init_api();
5928
5948
  });
5929
5949
 
5950
+ // src/commands/admin-artists.ts
5951
+ function buildBioBody2(options) {
5952
+ const body = { bio: options.bio };
5953
+ if (options.dryRun) {
5954
+ body.dryRun = true;
5955
+ }
5956
+ if (typeof options.promptVersion === "number") {
5957
+ body.promptVersion = options.promptVersion;
5958
+ }
5959
+ return body;
5960
+ }
5961
+ var init_admin_artists2 = __esm(() => {
5962
+ init_api();
5963
+ });
5964
+
5930
5965
  // src/commands/admin-labels.ts
5931
5966
  var exports_admin_labels = {};
5932
5967
  __export(exports_admin_labels, {
5968
+ labelsBioQueueCommand: () => labelsBioQueueCommand,
5969
+ describeLabelCommand: () => describeLabelCommand,
5933
5970
  backfillLabelImagesCommand: () => backfillLabelImagesCommand
5934
5971
  });
5972
+ async function describeLabelCommand(slug, options) {
5973
+ return adminApiPost(`/api/admin/labels/${encodeURIComponent(slug)}/bio`, buildBioBody2(options));
5974
+ }
5975
+ async function labelsBioQueueCommand(limit) {
5976
+ const response = await adminApiGet(`/api/admin/labels/bio-queue?limit=${limit}`);
5977
+ return response.labels;
5978
+ }
5935
5979
  async function backfillLabelImagesCommand(limit, dryRun, cursor) {
5936
5980
  const params = new URLSearchParams({ dryRun: String(dryRun), limit: String(limit) });
5937
5981
  if (cursor) {
@@ -5941,6 +5985,7 @@ async function backfillLabelImagesCommand(limit, dryRun, cursor) {
5941
5985
  }
5942
5986
  var init_admin_labels = __esm(() => {
5943
5987
  init_api();
5988
+ init_admin_artists2();
5944
5989
  });
5945
5990
 
5946
5991
  // src/commands/admin-covers.ts
@@ -9121,6 +9166,28 @@ function addAdminCommands(program2) {
9121
9166
  const { resolveArtistCommand: resolveArtistCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
9122
9167
  await runArtistResolve(artistId, options, resolveArtistCommand2);
9123
9168
  });
9169
+ artists.command("describe").description("Author the voiced bio for an artist (fills an empty bio only)").argument("[slug]").option("--queue", "Show the bio worklist (artists with findings but no bio), oldest first", false).option("--limit <limit>", "Number of artists to show with --queue", "50").option("--bio <text>", "The voice-gated bio paragraph").option("--bio-file <file>", "Read the bio from a file").option("--prompt-version <n>", "The prompt-registry version that authored the bio (the sweep sends this; it is the bio's provenance)").option("--dry-run", "Run the voice gate and report the verdict without storing anything", false).option("--json", "Print JSON", false).allowExcessArguments().action(async (slug, options) => {
9170
+ if (options.queue) {
9171
+ const { artistsBioQueueCommand: artistsBioQueueCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
9172
+ await runEntityBioQueue("artist", options, artistsBioQueueCommand2);
9173
+ return;
9174
+ }
9175
+ const { describeArtistCommand: describeArtistCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
9176
+ await runEntityDescribe("artist", slug, options, describeArtistCommand2);
9177
+ });
9178
+ const labels = configureCommand(admin.command("labels").description("Label entity commands (the voiced bio)"));
9179
+ labels.action(() => {
9180
+ labels.outputHelp();
9181
+ });
9182
+ labels.command("describe").description("Author the voiced bio for a label (fills an empty bio only)").argument("[slug]").option("--queue", "Show the bio worklist (labels with findings but no bio), oldest first", false).option("--limit <limit>", "Number of labels to show with --queue", "50").option("--bio <text>", "The voice-gated bio paragraph").option("--bio-file <file>", "Read the bio from a file").option("--prompt-version <n>", "The prompt-registry version that authored the bio (the sweep sends this; it is the bio's provenance)").option("--dry-run", "Run the voice gate and report the verdict without storing anything", false).option("--json", "Print JSON", false).allowExcessArguments().action(async (slug, options) => {
9183
+ if (options.queue) {
9184
+ const { labelsBioQueueCommand: labelsBioQueueCommand2 } = await Promise.resolve().then(() => (init_admin_labels(), exports_admin_labels));
9185
+ await runEntityBioQueue("label", options, labelsBioQueueCommand2);
9186
+ return;
9187
+ }
9188
+ const { describeLabelCommand: describeLabelCommand2 } = await Promise.resolve().then(() => (init_admin_labels(), exports_admin_labels));
9189
+ await runEntityDescribe("label", slug, options, describeLabelCommand2);
9190
+ });
9124
9191
  const migrations = configureCommand(admin.command("migrations").description("One-off operator data migrations"));
9125
9192
  migrations.action(() => {
9126
9193
  migrations.outputHelp();
@@ -9242,6 +9309,49 @@ async function runTrackNote(idOrLogId, options, trackNoteCommand2) {
9242
9309
  console.log(`Authored the note for ${result.logId}:`);
9243
9310
  console.log(` ${result.note}`);
9244
9311
  }
9312
+ async function runEntityDescribe(kind, slug, options, describeCommand) {
9313
+ const bio = options.bioFile ? readFileSync7(options.bioFile, "utf8") : options.bio;
9314
+ if (!slug || !bio || !bio.trim()) {
9315
+ throw new Error(`Usage: fluncle admin ${kind}s describe <slug> (--bio <text> | --bio-file <file>) [--dry-run] [--json]`);
9316
+ }
9317
+ const result = await describeCommand(slug, {
9318
+ bio: bio.trim(),
9319
+ dryRun: options.dryRun,
9320
+ promptVersion: parsePromptVersion(options.promptVersion)
9321
+ });
9322
+ if (options.json) {
9323
+ printJson(result);
9324
+ return;
9325
+ }
9326
+ if (result.skipped) {
9327
+ console.log(`A bio is already on file for ${result.slug}. The operator's bio stands.`);
9328
+ return;
9329
+ }
9330
+ if (result.dryRun) {
9331
+ console.log(`The voice gate passed for ${result.slug}. Nothing was stored (dry run).`);
9332
+ console.log(` ${result.bio}`);
9333
+ return;
9334
+ }
9335
+ console.log(`Authored the bio for ${result.slug}:`);
9336
+ console.log(` ${result.bio}`);
9337
+ }
9338
+ async function runEntityBioQueue(kind, options, queueCommand2) {
9339
+ const limit = options.limit ? Number.parseInt(options.limit, 10) : 50;
9340
+ const items = await queueCommand2(Number.isFinite(limit) ? limit : 50);
9341
+ if (options.json) {
9342
+ printJson(items);
9343
+ return;
9344
+ }
9345
+ if (items.length === 0) {
9346
+ console.log(`No ${kind}s awaiting a bio.`);
9347
+ return;
9348
+ }
9349
+ const noun = items.length === 1 ? kind : `${kind}s`;
9350
+ console.log(`${items.length} ${noun} awaiting a bio, oldest first:`);
9351
+ for (const item of items) {
9352
+ console.log(` ${item.slug} ${item.name}`);
9353
+ }
9354
+ }
9245
9355
  async function runTrackSimilar(idOrLogId, options, trackSimilarCommand2) {
9246
9356
  if (!idOrLogId) {
9247
9357
  throw new Error("Missing id. Usage: fluncle tracks similar <track_id|log_id> [--limit <n>] [--json]");
@@ -11423,6 +11533,8 @@ var stringOptions = new Set([
11423
11533
  "--analyzed-from",
11424
11534
  "--at",
11425
11535
  "--audio",
11536
+ "--bio",
11537
+ "--bio-file",
11426
11538
  "--body",
11427
11539
  "--body-file",
11428
11540
  "--bpm",
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.154.0"
34
+ "version": "0.155.0"
35
35
  }