fluncle 0.111.0 → 0.112.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 +76 -2
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -557,7 +557,7 @@ function parseVersion(version) {
557
557
  var currentVersion;
558
558
  var init_version = __esm(() => {
559
559
  init_output();
560
- currentVersion = "0.111.0".trim() ? "0.111.0".trim() : "0.1.0";
560
+ currentVersion = "0.112.0".trim() ? "0.112.0".trim() : "0.1.0";
561
561
  });
562
562
 
563
563
  // src/update-notifier.ts
@@ -2209,7 +2209,7 @@ function parseVersion2(version) {
2209
2209
  var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
2210
2210
  var init_version2 = __esm(() => {
2211
2211
  init_output();
2212
- currentVersion2 = "0.111.0".trim() ? "0.111.0".trim() : "0.1.0";
2212
+ currentVersion2 = "0.112.0".trim() ? "0.112.0".trim() : "0.1.0";
2213
2213
  });
2214
2214
 
2215
2215
  // ../../packages/registry/src/index.ts
@@ -3335,6 +3335,46 @@ var init_track = __esm(() => {
3335
3335
  NON_FILE_OPTIONS = ["model", "reasoning"];
3336
3336
  });
3337
3337
 
3338
+ // src/commands/admin-attention.ts
3339
+ var exports_admin_attention = {};
3340
+ __export(exports_admin_attention, {
3341
+ attentionQueueLines: () => attentionQueueLines,
3342
+ attentionQueueCommand: () => attentionQueueCommand
3343
+ });
3344
+ async function attentionQueueCommand() {
3345
+ const response = await adminApiGet("/api/admin/attention");
3346
+ return response.attention;
3347
+ }
3348
+ function attentionQueueLines(queue) {
3349
+ const lines = [queue.brief];
3350
+ if (queue.rows.length > 0) {
3351
+ const width = queue.rows.reduce((max, row) => Math.max(max, SOURCE_LABELS[row.source].length), 0);
3352
+ lines.push("");
3353
+ for (const row of queue.rows) {
3354
+ lines.push(` ${SOURCE_LABELS[row.source].padEnd(width)} ${row.title}`);
3355
+ }
3356
+ }
3357
+ if (queue.renderQueueDepth > 0) {
3358
+ const noun = queue.renderQueueDepth === 1 ? "finding" : "findings";
3359
+ lines.push("", `${queue.renderQueueDepth} ${noun} in the render queue.`);
3360
+ }
3361
+ return lines;
3362
+ }
3363
+ var SOURCE_LABELS;
3364
+ var init_admin_attention = __esm(() => {
3365
+ init_api();
3366
+ SOURCE_LABELS = {
3367
+ "artist-review": "artist links",
3368
+ "attach-cues": "cues",
3369
+ distribute: "distribute",
3370
+ "drip-empty": "clip drip",
3371
+ "post-tiktok": "tiktok",
3372
+ "post-youtube": "youtube",
3373
+ submission: "submission",
3374
+ "tiktok-draft": "tiktok draft"
3375
+ };
3376
+ });
3377
+
3338
3378
  // src/commands/add.ts
3339
3379
  var exports_add = {};
3340
3380
  __export(exports_add, {
@@ -4806,6 +4846,7 @@ var init_add2 = __esm(() => {
4806
4846
  // src/commands/submissions.ts
4807
4847
  var exports_submissions = {};
4808
4848
  __export(exports_submissions, {
4849
+ triageSubmissionCommand: () => triageSubmissionCommand,
4809
4850
  reviewSubmissionCommand: () => reviewSubmissionCommand,
4810
4851
  rejectSubmissionCommand: () => rejectSubmissionCommand,
4811
4852
  listSubmissionsCommand: () => listSubmissionsCommand,
@@ -4867,6 +4908,14 @@ async function approveSubmissionCommand(submissionId, options = {}) {
4867
4908
  }
4868
4909
  console.log(`Approved ${formatTrackLine(submission)}.`);
4869
4910
  }
4911
+ async function triageSubmissionCommand(submissionId, verdict, options = {}) {
4912
+ const response = await adminApiPost(`/api/admin/submissions/${encodeURIComponent(submissionId)}/triage`, { verdict });
4913
+ if (options.json) {
4914
+ printJson2({ ok: true, submission: response.submission });
4915
+ return;
4916
+ }
4917
+ console.log(`Triaged ${formatTrackLine(response.submission)}: ${response.submission.triageVerdict ?? ""}`);
4918
+ }
4870
4919
  async function fetchSubmission(submissionId) {
4871
4920
  const response = await adminApiGet(`/api/admin/submissions/${encodeURIComponent(submissionId)}`);
4872
4921
  return response.submission;
@@ -7692,6 +7741,10 @@ function addAdminCommands(program2) {
7692
7741
  admin.command("help", { hidden: true }).description("display help for command").action(() => {
7693
7742
  admin.outputHelp();
7694
7743
  });
7744
+ admin.command("queue").description("The attention queue: what's waiting, and the day's dispatch").option("--json", "Print JSON", false).action(async (options) => {
7745
+ const { attentionQueueCommand: attentionQueueCommand2 } = await Promise.resolve().then(() => (init_admin_attention(), exports_admin_attention));
7746
+ await runAdminAttention(options, attentionQueueCommand2);
7747
+ });
7695
7748
  const adminTracks = configureCommand(admin.command("tracks").description("Track admin commands"));
7696
7749
  adminTracks.action(() => {
7697
7750
  adminTracks.outputHelp();
@@ -7942,6 +7995,17 @@ function addAdminCommands(program2) {
7942
7995
  const { approveSubmissionCommand: approveSubmissionCommand2 } = await Promise.resolve().then(() => (init_submissions(), exports_submissions));
7943
7996
  await approveSubmissionCommand2(submissionId, options);
7944
7997
  });
7998
+ submissions.command("triage").description("Write the pre-chew triage verdict onto a pending submission").argument("[submissionId]").option("--verdict <text>", "The triage verdict one-liner").option("--verdict-file <file>", "Read the verdict from a file").option("--json", "Print JSON", false).action(async (submissionId, options) => {
7999
+ if (!submissionId) {
8000
+ throw new Error("Missing submission id for: triage");
8001
+ }
8002
+ const verdict = options.verdictFile ? readFileSync5(options.verdictFile, "utf8") : options.verdict;
8003
+ if (!verdict || !verdict.trim()) {
8004
+ throw new Error("Usage: fluncle admin submissions triage <submissionId> (--verdict <text> | --verdict-file <file>) [--json]");
8005
+ }
8006
+ const { triageSubmissionCommand: triageSubmissionCommand2 } = await Promise.resolve().then(() => (init_submissions(), exports_submissions));
8007
+ await triageSubmissionCommand2(submissionId, verdict, { json: options.json });
8008
+ });
7945
8009
  const auth = configureCommand(admin.command("auth").description("Authentication commands"));
7946
8010
  auth.command("spotify").description("Authorize Spotify access").action(async () => {
7947
8011
  const { authSpotifyCommand: authSpotifyCommand2 } = await Promise.resolve().then(() => (init_auth(), exports_auth));
@@ -8980,6 +9044,16 @@ async function runAdminTracksList(options, listCommand2) {
8980
9044
  console.log(trackRows2(tracks).join(`
8981
9045
  `));
8982
9046
  }
9047
+ async function runAdminAttention(options, attentionQueueCommand2) {
9048
+ const queue = await attentionQueueCommand2();
9049
+ if (options.json) {
9050
+ printJson({ attention: queue, ok: true });
9051
+ return;
9052
+ }
9053
+ const { attentionQueueLines: attentionQueueLines2 } = await Promise.resolve().then(() => (init_admin_attention(), exports_admin_attention));
9054
+ console.log(attentionQueueLines2(queue).join(`
9055
+ `));
9056
+ }
8983
9057
  async function runAdminQueue(options, queueCommand2) {
8984
9058
  const limit = parseListLimit(options.limit);
8985
9059
  const tracks = await queueCommand2(limit, {
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.111.0"
34
+ "version": "0.112.0"
35
35
  }