fluncle 0.153.0 → 0.154.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 +82 -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.153.0".trim() ? "0.153.0".trim() : "0.1.0";
564
+ currentVersion = "0.154.0".trim() ? "0.154.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.153.0".trim() ? "0.153.0".trim() : "0.1.0";
2192
+ currentVersion2 = "0.154.0".trim() ? "0.154.0".trim() : "0.1.0";
2193
2193
  });
2194
2194
 
2195
2195
  // ../../packages/registry/src/index.ts
@@ -3626,6 +3626,7 @@ var init_admin_attention = __esm(() => {
3626
3626
  "label-review": "label",
3627
3627
  newsletter: "newsletter",
3628
3628
  "note-rejected": "held note",
3629
+ "observation-rejected": "held observation",
3629
3630
  "post-tiktok": "tiktok",
3630
3631
  "post-youtube": "youtube",
3631
3632
  submission: "submission",
@@ -5761,6 +5762,35 @@ var init_admin_notes = __esm(() => {
5761
5762
  init_api();
5762
5763
  });
5763
5764
 
5765
+ // src/commands/admin-observations.ts
5766
+ var exports_admin_observations = {};
5767
+ __export(exports_admin_observations, {
5768
+ observationHeldCommand: () => observationHeldCommand,
5769
+ observationGateCommand: () => observationGateCommand
5770
+ });
5771
+ async function observationHeldCommand(options) {
5772
+ const query = options.settled ? "?open=false" : "";
5773
+ return adminApiGet(`/api/admin/observation-rejections${query}`);
5774
+ }
5775
+ async function observationGateCommand(options) {
5776
+ const patch = {};
5777
+ if (options.minPhraseWords !== undefined) {
5778
+ patch.minPhraseWords = options.minPhraseWords;
5779
+ }
5780
+ if (options.maxOverlap !== undefined) {
5781
+ patch.maxOverlap = options.maxOverlap;
5782
+ }
5783
+ if (Object.keys(patch).length === 0) {
5784
+ const response2 = await adminApiGet("/api/admin/observation-rejections");
5785
+ return response2.gate;
5786
+ }
5787
+ const response = await adminApiPatch("/api/admin/observation-gate", patch);
5788
+ return response.gate;
5789
+ }
5790
+ var init_admin_observations = __esm(() => {
5791
+ init_api();
5792
+ });
5793
+
5764
5794
  // src/commands/admin-catalogue.ts
5765
5795
  var exports_admin_catalogue = {};
5766
5796
  __export(exports_admin_catalogue, {
@@ -8901,6 +8931,18 @@ function addAdminCommands(program2) {
8901
8931
  const { noteGateCommand: noteGateCommand2 } = await Promise.resolve().then(() => (init_admin_notes(), exports_admin_notes));
8902
8932
  await runNoteGate(options, noteGateCommand2);
8903
8933
  });
8934
+ const observations = configureCommand(admin.command("observations").description("The observation echo gate: held scripts + dials"));
8935
+ observations.action(() => {
8936
+ observations.outputHelp();
8937
+ });
8938
+ observations.command("held").description("The observation scripts 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) => {
8939
+ const { observationHeldCommand: observationHeldCommand2 } = await Promise.resolve().then(() => (init_admin_observations(), exports_admin_observations));
8940
+ await runObservationHeld(options, observationHeldCommand2);
8941
+ });
8942
+ observations.command("gate").description("Read or retune the observation 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) => {
8943
+ const { observationGateCommand: observationGateCommand2 } = await Promise.resolve().then(() => (init_admin_observations(), exports_admin_observations));
8944
+ await runObservationGate(options, observationGateCommand2);
8945
+ });
8904
8946
  const catalogue = configureCommand(admin.command("catalogue").description("The catalogue (uncertified tracks): the crawler + its ranking"));
8905
8947
  catalogue.action(() => {
8906
8948
  catalogue.outputHelp();
@@ -10771,6 +10813,44 @@ async function runNoteGate(options, noteGateCommand2) {
10771
10813
  }
10772
10814
  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.`);
10773
10815
  }
10816
+ async function runObservationHeld(options, observationHeldCommand2) {
10817
+ const { gate, rejections } = await observationHeldCommand2({ settled: options.settled === true });
10818
+ if (options.json) {
10819
+ printJson({ gate, ok: true, rejections });
10820
+ return;
10821
+ }
10822
+ if (rejections.length === 0) {
10823
+ console.log(options.settled ? "Nothing ruled on yet." : "Nothing held back. The gate is quiet.");
10824
+ return;
10825
+ }
10826
+ console.log(`The gate sits at ${gate.minPhraseWords} lifted words / ${Math.round(gate.maxOverlap * 100)}% overlap.`);
10827
+ for (const held of rejections) {
10828
+ const ruled = held.resolution ? ` [${held.resolution}]` : "";
10829
+ const bounced = held.attempts > 1 ? ` (bounced ${held.attempts}x)` : "";
10830
+ console.log("");
10831
+ console.log(`${held.logId ?? held.trackId} ${held.title}${bounced}${ruled}`);
10832
+ console.log(` wrote: ${held.script}`);
10833
+ if (held.phrase) {
10834
+ console.log(` lifted: "${held.phrase}" from ${held.neighborLogId ?? "a neighbour"}`);
10835
+ } else {
10836
+ console.log(` reuses: ${Math.round(held.overlap * 100)}% of ${held.neighborLogId ?? "a neighbour"}'s words`);
10837
+ }
10838
+ console.log(` judged at: ${held.minPhraseWords} words / ${Math.round(held.maxOverlap * 100)}%`);
10839
+ }
10840
+ }
10841
+ async function runObservationGate(options, observationGateCommand2) {
10842
+ const minPhraseWords = options.minPhraseWords === undefined ? undefined : Number(options.minPhraseWords);
10843
+ const maxOverlap = options.maxOverlap === undefined ? undefined : Number(options.maxOverlap);
10844
+ const gate = await observationGateCommand2({
10845
+ ...maxOverlap === undefined ? {} : { maxOverlap },
10846
+ ...minPhraseWords === undefined ? {} : { minPhraseWords }
10847
+ });
10848
+ if (options.json) {
10849
+ printJson({ gate, ok: true });
10850
+ return;
10851
+ }
10852
+ console.log(`The observation echo gate: a lift is ${gate.minPhraseWords}+ shared words; an echo is ${Math.round(gate.maxOverlap * 100)}%+ of a neighbour's words.`);
10853
+ }
10774
10854
  async function runGalaxyMapRead(options, galaxyMapReadCommand2) {
10775
10855
  const galaxies = await galaxyMapReadCommand2();
10776
10856
  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.153.0"
34
+ "version": "0.154.0"
35
35
  }