fluncle 0.172.0 → 0.173.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 +21 -2
  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.172.0".trim() ? "0.172.0".trim() : "0.1.0";
564
+ currentVersion = "0.173.0".trim() ? "0.173.0".trim() : "0.1.0";
565
565
  });
566
566
 
567
567
  // src/update-notifier.ts
@@ -2259,7 +2259,7 @@ function parseVersion2(version) {
2259
2259
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2260
2260
  var init_version2 = __esm(() => {
2261
2261
  init_output();
2262
- currentVersion2 = "0.172.0".trim() ? "0.172.0".trim() : "0.1.0";
2262
+ currentVersion2 = "0.173.0".trim() ? "0.173.0".trim() : "0.1.0";
2263
2263
  });
2264
2264
 
2265
2265
  // ../../packages/registry/src/index.ts
@@ -6293,6 +6293,7 @@ var init_admin_reach = __esm(() => {
6293
6293
  var exports_admin_artists = {};
6294
6294
  __export(exports_admin_artists, {
6295
6295
  resolveArtistCommand: () => resolveArtistCommand,
6296
+ rankArtistsCommand: () => rankArtistsCommand,
6296
6297
  listArtistsCommand: () => listArtistsCommand,
6297
6298
  draftArtistBioCommand: () => draftArtistBioCommand,
6298
6299
  describeArtistCommand: () => describeArtistCommand,
@@ -6331,6 +6332,11 @@ async function listArtistsCommand(limit, cursor) {
6331
6332
  async function resolveArtistCommand(artistId) {
6332
6333
  return adminApiPost(`/api/admin/artists/${encodeURIComponent(artistId)}/resolve`);
6333
6334
  }
6335
+ async function rankArtistsCommand(options) {
6336
+ const limit = options.limit ? Number.parseInt(options.limit, 10) : undefined;
6337
+ const response = await adminApiPost("/api/admin/artists/rank", limit ? { limit } : {});
6338
+ return { summary: response.summary };
6339
+ }
6334
6340
  async function backfillArtistImagesCommand(limit, dryRun, cursor) {
6335
6341
  const params = new URLSearchParams({ dryRun: String(dryRun), limit: String(limit) });
6336
6342
  if (cursor) {
@@ -9693,6 +9699,10 @@ function addAdminCommands(program2) {
9693
9699
  const { describeArtistCommand: describeArtistCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
9694
9700
  await runEntityDescribe("artist", slug, options, describeArtistCommand2);
9695
9701
  });
9702
+ artists.command("rank").description("Run one tick of the similar-artists sweep (artist centroids + nearest neighbours)").option("--limit <limit>", "Stale artists per tick (default 100)").option("--json", "Print JSON", false).action(async (options) => {
9703
+ const { rankArtistsCommand: rankArtistsCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
9704
+ await runArtistsRank(options, rankArtistsCommand2);
9705
+ });
9696
9706
  artists.command("draft-bio").description("Assemble the Worker-grounded bio prompt for an artist (the sweep's trigger)").argument("<slug>").option("--json", "Print JSON", false).allowExcessArguments().action(async (slug, options) => {
9697
9707
  const { draftArtistBioCommand: draftArtistBioCommand2 } = await Promise.resolve().then(() => (init_admin_artists(), exports_admin_artists));
9698
9708
  await runEntityBioDraft("artist", slug, options, draftArtistBioCommand2);
@@ -11521,6 +11531,15 @@ async function runGalaxies(slug, options, commands) {
11521
11531
  console.log(`${galaxy.name.padEnd(40)} ${String(galaxy.memberCount).padStart(3)} finding${galaxy.memberCount === 1 ? "" : "s"}`);
11522
11532
  }
11523
11533
  }
11534
+ async function runArtistsRank(options, rankArtistsCommand2) {
11535
+ const { summary } = await rankArtistsCommand2({ limit: options.limit });
11536
+ if (options.json) {
11537
+ printJson({ ok: true, summary });
11538
+ return;
11539
+ }
11540
+ const removed = summary.centroidsRemoved > 0 ? ` Purged ${summary.centroidsRemoved} orphan(s).` : "";
11541
+ console.log(`Ranked ${summary.centroidsComputed} artist(s); wrote ${summary.edgesWritten} edges.${removed} ${summary.remaining} still stale.`);
11542
+ }
11524
11543
  async function runCatalogueRank(options, catalogueRankCommand2) {
11525
11544
  const { summary, telescope } = await catalogueRankCommand2({ limit: options.limit });
11526
11545
  if (options.json) {
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.172.0"
34
+ "version": "0.173.0"
35
35
  }