fluncle 0.133.0 → 0.135.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 +95 -8
  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.133.0".trim() ? "0.133.0".trim() : "0.1.0";
564
+ currentVersion = "0.135.0".trim() ? "0.135.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.133.0".trim() ? "0.133.0".trim() : "0.1.0";
2192
+ currentVersion2 = "0.135.0".trim() ? "0.135.0".trim() : "0.1.0";
2193
2193
  });
2194
2194
 
2195
2195
  // ../../packages/registry/src/index.ts
@@ -3546,6 +3546,7 @@ var init_admin_attention = __esm(() => {
3546
3546
  "drip-empty": "clip drip",
3547
3547
  "label-review": "label",
3548
3548
  newsletter: "newsletter",
3549
+ "note-rejected": "held note",
3549
3550
  "post-tiktok": "tiktok",
3550
3551
  "post-youtube": "youtube",
3551
3552
  submission: "submission",
@@ -3743,8 +3744,11 @@ async function trackWorkCommand(options) {
3743
3744
  limit: String(Math.min(Math.max(1, options.limit), 200)),
3744
3745
  scope: options.scope
3745
3746
  });
3747
+ if (options.count) {
3748
+ params.set("count", "true");
3749
+ }
3746
3750
  const response = await adminApiGet(`/api/admin/tracks/work?${params.toString()}`);
3747
- return response.tracks ?? [];
3751
+ return { queued: response.queued, tracks: response.tracks ?? [] };
3748
3752
  }
3749
3753
  async function requeueAnalysisCommand(options) {
3750
3754
  const findings = await fetchAdminTracks({ max: options.max, order: "asc" });
@@ -5442,6 +5446,35 @@ var init_auth_lastfm = __esm(() => {
5442
5446
  init_api();
5443
5447
  });
5444
5448
 
5449
+ // src/commands/admin-notes.ts
5450
+ var exports_admin_notes = {};
5451
+ __export(exports_admin_notes, {
5452
+ noteHeldCommand: () => noteHeldCommand,
5453
+ noteGateCommand: () => noteGateCommand
5454
+ });
5455
+ async function noteHeldCommand(options) {
5456
+ const query = options.settled ? "?open=false" : "";
5457
+ return adminApiGet(`/api/admin/note-rejections${query}`);
5458
+ }
5459
+ async function noteGateCommand(options) {
5460
+ const patch = {};
5461
+ if (options.minPhraseWords !== undefined) {
5462
+ patch.minPhraseWords = options.minPhraseWords;
5463
+ }
5464
+ if (options.maxOverlap !== undefined) {
5465
+ patch.maxOverlap = options.maxOverlap;
5466
+ }
5467
+ if (Object.keys(patch).length === 0) {
5468
+ const response2 = await adminApiGet("/api/admin/note-rejections");
5469
+ return response2.gate;
5470
+ }
5471
+ const response = await adminApiPatch("/api/admin/note-gate", patch);
5472
+ return response.gate;
5473
+ }
5474
+ var init_admin_notes = __esm(() => {
5475
+ init_api();
5476
+ });
5477
+
5445
5478
  // src/commands/admin-catalogue.ts
5446
5479
  var exports_admin_catalogue = {};
5447
5480
  __export(exports_admin_catalogue, {
@@ -8123,7 +8156,7 @@ function addAdminCommands(program2) {
8123
8156
  const { captureQueueCommand: captureQueueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
8124
8157
  await runAdminCaptureQueue(options, captureQueueCommand2);
8125
8158
  });
8126
- adminTracks.command("work").description("The audio pipeline's worklist for one stage, in capture-priority order").requiredOption("--kind <kind>", "Pipeline stage: analyze | capture | embed").option("--scope <scope>", "Which half of the archive: all | catalogue | findings", "all").option("--limit <limit>", "Rows to show", "10").option("--json", "Print JSON", false).action(async (options) => {
8159
+ adminTracks.command("work").description("The audio pipeline's worklist for one stage, in capture-priority order").requiredOption("--kind <kind>", "Pipeline stage: analyze | capture | embed").option("--scope <scope>", "Which half of the archive: all | catalogue | findings", "all").option("--limit <limit>", "Rows to show", "10").option("--count", "Also report the size of the whole backlog, not just this page", false).option("--json", "Print JSON", false).action(async (options) => {
8127
8160
  const { trackWorkCommand: trackWorkCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
8128
8161
  await runAdminTrackWork(options, trackWorkCommand2);
8129
8162
  });
@@ -8438,6 +8471,18 @@ function addAdminCommands(program2) {
8438
8471
  const { galaxyMapWriteCommand: galaxyMapWriteCommand2 } = await Promise.resolve().then(() => (init_galaxies(), exports_galaxies));
8439
8472
  await runGalaxyMapWrite(options, galaxyMapWriteCommand2);
8440
8473
  });
8474
+ const notes = configureCommand(admin.command("notes").description("The auto-note echo gate: held notes + its dials"));
8475
+ notes.action(() => {
8476
+ notes.outputHelp();
8477
+ });
8478
+ notes.command("held").description("The auto-notes the echo gate held back (and why)").option("--settled", "Read the ones already ruled on instead (the retune evidence)", false).option("--json", "Print JSON", false).action(async (options) => {
8479
+ const { noteHeldCommand: noteHeldCommand2 } = await Promise.resolve().then(() => (init_admin_notes(), exports_admin_notes));
8480
+ await runNoteHeld(options, noteHeldCommand2);
8481
+ });
8482
+ notes.command("gate").description("Read or retune the echo gate's thresholds (a flip, not a deploy)").option("--min-phrase-words <n>", "A shared run this long is a lift (2-20; default 4)").option("--max-overlap <x>", "Content-word overlap at/above this is an echo (0.05-1; default 0.3)").option("--json", "Print JSON", false).action(async (options) => {
8483
+ const { noteGateCommand: noteGateCommand2 } = await Promise.resolve().then(() => (init_admin_notes(), exports_admin_notes));
8484
+ await runNoteGate(options, noteGateCommand2);
8485
+ });
8441
8486
  const catalogue = configureCommand(admin.command("catalogue").description("The catalogue (uncertified tracks): the crawler + its ranking"));
8442
8487
  catalogue.action(() => {
8443
8488
  catalogue.outputHelp();
@@ -9750,6 +9795,44 @@ async function runCatalogueList(options, catalogueListCommand2) {
9750
9795
  console.log(`${score} ${identity.padEnd(52)} ${why}`);
9751
9796
  }
9752
9797
  }
9798
+ async function runNoteHeld(options, noteHeldCommand2) {
9799
+ const { gate, rejections } = await noteHeldCommand2({ settled: options.settled === true });
9800
+ if (options.json) {
9801
+ printJson({ gate, ok: true, rejections });
9802
+ return;
9803
+ }
9804
+ if (rejections.length === 0) {
9805
+ console.log(options.settled ? "Nothing ruled on yet." : "Nothing held back. The gate is quiet.");
9806
+ return;
9807
+ }
9808
+ console.log(`The gate sits at ${gate.minPhraseWords} lifted words / ${Math.round(gate.maxOverlap * 100)}% overlap.`);
9809
+ for (const held of rejections) {
9810
+ const ruled = held.resolution ? ` [${held.resolution}]` : "";
9811
+ const bounced = held.attempts > 1 ? ` (bounced ${held.attempts}x)` : "";
9812
+ console.log("");
9813
+ console.log(`${held.logId ?? held.trackId} ${held.title}${bounced}${ruled}`);
9814
+ console.log(` wrote: ${held.note}`);
9815
+ if (held.phrase) {
9816
+ console.log(` lifted: "${held.phrase}" from ${held.neighborLogId ?? "a neighbour"}`);
9817
+ } else {
9818
+ console.log(` reuses: ${Math.round(held.overlap * 100)}% of ${held.neighborLogId ?? "a neighbour"}'s words`);
9819
+ }
9820
+ console.log(` judged at: ${held.minPhraseWords} words / ${Math.round(held.maxOverlap * 100)}%`);
9821
+ }
9822
+ }
9823
+ async function runNoteGate(options, noteGateCommand2) {
9824
+ const minPhraseWords = options.minPhraseWords === undefined ? undefined : Number(options.minPhraseWords);
9825
+ const maxOverlap = options.maxOverlap === undefined ? undefined : Number(options.maxOverlap);
9826
+ const gate = await noteGateCommand2({
9827
+ ...maxOverlap === undefined ? {} : { maxOverlap },
9828
+ ...minPhraseWords === undefined ? {} : { minPhraseWords }
9829
+ });
9830
+ if (options.json) {
9831
+ printJson({ gate, ok: true });
9832
+ return;
9833
+ }
9834
+ console.log(`The echo gate: a lift is ${gate.minPhraseWords}+ shared words; an echo is ${Math.round(gate.maxOverlap * 100)}%+ of a neighbour's words.`);
9835
+ }
9753
9836
  async function runGalaxyMapRead(options, galaxyMapReadCommand2) {
9754
9837
  const galaxies = await galaxyMapReadCommand2();
9755
9838
  if (options.json) {
@@ -10010,13 +10093,14 @@ async function runAdminTrackWork(options, trackWorkCommand2) {
10010
10093
  process.exitCode = 1;
10011
10094
  return;
10012
10095
  }
10013
- const tracks = await trackWorkCommand2({
10096
+ const { queued, tracks } = await trackWorkCommand2({
10097
+ count: options.count,
10014
10098
  kind,
10015
10099
  limit: parseListLimit(options.limit),
10016
10100
  scope
10017
10101
  });
10018
10102
  if (options.json) {
10019
- printJson({ ok: true, tracks });
10103
+ printJson({ ok: true, queued, tracks });
10020
10104
  return;
10021
10105
  }
10022
10106
  if (tracks.length === 0) {
@@ -10024,7 +10108,8 @@ async function runAdminTrackWork(options, trackWorkCommand2) {
10024
10108
  return;
10025
10109
  }
10026
10110
  const noun = tracks.length === 1 ? "track" : "tracks";
10027
- console.log(`${tracks.length} ${noun} to ${kind} (${scope}), in drain order:`);
10111
+ const head = queued === undefined ? `${tracks.length} ${noun} to ${kind} (${scope}), in drain order:` : `${queued} queued to ${kind} (${scope}) \u2014 showing the first ${tracks.length}, in drain order:`;
10112
+ console.log(head);
10028
10113
  for (const track of tracks) {
10029
10114
  const who = track.logId ?? `${track.trackId} \xB7 catalogue`;
10030
10115
  const rung = track.capturePriority === null ? "" : ` \xB7 p${track.capturePriority}`;
@@ -10354,8 +10439,10 @@ var stringOptions = new Set([
10354
10439
  "--lens",
10355
10440
  "--limit",
10356
10441
  "--max-hop",
10442
+ "--max-overlap",
10357
10443
  "--metrics",
10358
10444
  "--mime",
10445
+ "--min-phrase-words",
10359
10446
  "--model",
10360
10447
  "--note",
10361
10448
  "--order",
@@ -10372,9 +10459,9 @@ var stringOptions = new Set([
10372
10459
  "--render",
10373
10460
  "--scene",
10374
10461
  "--scheduled-for",
10462
+ "--scope",
10375
10463
  "--script",
10376
10464
  "--script-file",
10377
- "--scope",
10378
10465
  "--seed",
10379
10466
  "--soundcloud-url",
10380
10467
  "--source",
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.133.0"
34
+ "version": "0.135.0"
35
35
  }