fluncle 0.134.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 +85 -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.134.0".trim() ? "0.134.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.134.0".trim() ? "0.134.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",
@@ -5445,6 +5446,35 @@ var init_auth_lastfm = __esm(() => {
5445
5446
  init_api();
5446
5447
  });
5447
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
+
5448
5478
  // src/commands/admin-catalogue.ts
5449
5479
  var exports_admin_catalogue = {};
5450
5480
  __export(exports_admin_catalogue, {
@@ -8441,6 +8471,18 @@ function addAdminCommands(program2) {
8441
8471
  const { galaxyMapWriteCommand: galaxyMapWriteCommand2 } = await Promise.resolve().then(() => (init_galaxies(), exports_galaxies));
8442
8472
  await runGalaxyMapWrite(options, galaxyMapWriteCommand2);
8443
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
+ });
8444
8486
  const catalogue = configureCommand(admin.command("catalogue").description("The catalogue (uncertified tracks): the crawler + its ranking"));
8445
8487
  catalogue.action(() => {
8446
8488
  catalogue.outputHelp();
@@ -9753,6 +9795,44 @@ async function runCatalogueList(options, catalogueListCommand2) {
9753
9795
  console.log(`${score} ${identity.padEnd(52)} ${why}`);
9754
9796
  }
9755
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
+ }
9756
9836
  async function runGalaxyMapRead(options, galaxyMapReadCommand2) {
9757
9837
  const galaxies = await galaxyMapReadCommand2();
9758
9838
  if (options.json) {
@@ -10359,8 +10439,10 @@ var stringOptions = new Set([
10359
10439
  "--lens",
10360
10440
  "--limit",
10361
10441
  "--max-hop",
10442
+ "--max-overlap",
10362
10443
  "--metrics",
10363
10444
  "--mime",
10445
+ "--min-phrase-words",
10364
10446
  "--model",
10365
10447
  "--note",
10366
10448
  "--order",
@@ -10377,9 +10459,9 @@ var stringOptions = new Set([
10377
10459
  "--render",
10378
10460
  "--scene",
10379
10461
  "--scheduled-for",
10462
+ "--scope",
10380
10463
  "--script",
10381
10464
  "--script-file",
10382
- "--scope",
10383
10465
  "--seed",
10384
10466
  "--soundcloud-url",
10385
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.134.0"
34
+ "version": "0.135.0"
35
35
  }