fluncle 0.45.0 → 0.47.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.
- package/bin/fluncle.mjs +174 -42
- package/package.json +1 -1
package/bin/fluncle.mjs
CHANGED
|
@@ -48,7 +48,7 @@ var __export = (target, all) => {
|
|
|
48
48
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
49
49
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
50
50
|
|
|
51
|
-
// ../../node_modules
|
|
51
|
+
// ../../node_modules/commander/lib/error.js
|
|
52
52
|
var require_error = __commonJS((exports) => {
|
|
53
53
|
class CommanderError extends Error {
|
|
54
54
|
constructor(exitCode, code, message) {
|
|
@@ -72,7 +72,7 @@ var require_error = __commonJS((exports) => {
|
|
|
72
72
|
exports.InvalidArgumentError = InvalidArgumentError;
|
|
73
73
|
});
|
|
74
74
|
|
|
75
|
-
// ../../node_modules
|
|
75
|
+
// ../../node_modules/commander/lib/argument.js
|
|
76
76
|
var require_argument = __commonJS((exports) => {
|
|
77
77
|
var { InvalidArgumentError } = require_error();
|
|
78
78
|
|
|
@@ -152,7 +152,7 @@ var require_argument = __commonJS((exports) => {
|
|
|
152
152
|
exports.humanReadableArgName = humanReadableArgName;
|
|
153
153
|
});
|
|
154
154
|
|
|
155
|
-
// ../../node_modules
|
|
155
|
+
// ../../node_modules/commander/lib/help.js
|
|
156
156
|
var require_help = __commonJS((exports) => {
|
|
157
157
|
var { humanReadableArgName } = require_argument();
|
|
158
158
|
|
|
@@ -509,7 +509,7 @@ ${itemIndentStr}`);
|
|
|
509
509
|
exports.stripColor = stripColor;
|
|
510
510
|
});
|
|
511
511
|
|
|
512
|
-
// ../../node_modules
|
|
512
|
+
// ../../node_modules/commander/lib/option.js
|
|
513
513
|
var require_option = __commonJS((exports) => {
|
|
514
514
|
var { InvalidArgumentError } = require_error();
|
|
515
515
|
|
|
@@ -693,7 +693,7 @@ var require_option = __commonJS((exports) => {
|
|
|
693
693
|
exports.DualOptions = DualOptions;
|
|
694
694
|
});
|
|
695
695
|
|
|
696
|
-
// ../../node_modules
|
|
696
|
+
// ../../node_modules/commander/lib/suggestSimilar.js
|
|
697
697
|
var require_suggestSimilar = __commonJS((exports) => {
|
|
698
698
|
var maxDistance = 3;
|
|
699
699
|
function editDistance(a, b) {
|
|
@@ -766,7 +766,7 @@ var require_suggestSimilar = __commonJS((exports) => {
|
|
|
766
766
|
exports.suggestSimilar = suggestSimilar;
|
|
767
767
|
});
|
|
768
768
|
|
|
769
|
-
// ../../node_modules
|
|
769
|
+
// ../../node_modules/commander/lib/command.js
|
|
770
770
|
var require_command = __commonJS((exports) => {
|
|
771
771
|
var EventEmitter = __require("node:events").EventEmitter;
|
|
772
772
|
var childProcess = __require("node:child_process");
|
|
@@ -2121,7 +2121,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2121
2121
|
exports.useColor = useColor;
|
|
2122
2122
|
});
|
|
2123
2123
|
|
|
2124
|
-
// ../../node_modules
|
|
2124
|
+
// ../../node_modules/commander/index.js
|
|
2125
2125
|
var require_commander = __commonJS((exports) => {
|
|
2126
2126
|
var { Argument } = require_argument();
|
|
2127
2127
|
var { Command } = require_command();
|
|
@@ -2141,7 +2141,7 @@ var require_commander = __commonJS((exports) => {
|
|
|
2141
2141
|
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
2142
2142
|
});
|
|
2143
2143
|
|
|
2144
|
-
// ../../node_modules
|
|
2144
|
+
// ../../node_modules/dotenv/package.json
|
|
2145
2145
|
var require_package = __commonJS((exports, module) => {
|
|
2146
2146
|
module.exports = {
|
|
2147
2147
|
name: "dotenv",
|
|
@@ -2207,7 +2207,7 @@ var require_package = __commonJS((exports, module) => {
|
|
|
2207
2207
|
};
|
|
2208
2208
|
});
|
|
2209
2209
|
|
|
2210
|
-
// ../../node_modules
|
|
2210
|
+
// ../../node_modules/dotenv/lib/main.js
|
|
2211
2211
|
var require_main = __commonJS((exports, module) => {
|
|
2212
2212
|
var fs = __require("fs");
|
|
2213
2213
|
var path = __require("path");
|
|
@@ -2539,7 +2539,7 @@ function parseVersion(version) {
|
|
|
2539
2539
|
var currentVersion;
|
|
2540
2540
|
var init_version = __esm(() => {
|
|
2541
2541
|
init_output();
|
|
2542
|
-
currentVersion = "0.
|
|
2542
|
+
currentVersion = "0.47.0".trim() ? "0.47.0".trim() : "0.1.0";
|
|
2543
2543
|
});
|
|
2544
2544
|
|
|
2545
2545
|
// src/update-notifier.ts
|
|
@@ -4001,7 +4001,7 @@ function parseVersion2(version) {
|
|
|
4001
4001
|
var currentVersion2, latestReleaseUrl = "https://api.github.com/repos/mauricekleine/fluncle/releases/latest";
|
|
4002
4002
|
var init_version2 = __esm(() => {
|
|
4003
4003
|
init_output();
|
|
4004
|
-
currentVersion2 = "0.
|
|
4004
|
+
currentVersion2 = "0.47.0".trim() ? "0.47.0".trim() : "0.1.0";
|
|
4005
4005
|
});
|
|
4006
4006
|
|
|
4007
4007
|
// src/commands/track.ts
|
|
@@ -4013,7 +4013,8 @@ __export(exports_track, {
|
|
|
4013
4013
|
trackSocialShowCommand: () => trackSocialShowCommand,
|
|
4014
4014
|
trackObserveCommand: () => trackObserveCommand,
|
|
4015
4015
|
trackGetCommand: () => trackGetCommand,
|
|
4016
|
-
trackDraftCommand: () => trackDraftCommand
|
|
4016
|
+
trackDraftCommand: () => trackDraftCommand,
|
|
4017
|
+
trackContextCommand: () => trackContextCommand
|
|
4017
4018
|
});
|
|
4018
4019
|
async function trackGetCommand(idOrLogId) {
|
|
4019
4020
|
return publicApiGet(`/api/tracks/${encodeURIComponent(idOrLogId)}`);
|
|
@@ -4126,6 +4127,13 @@ async function trackObserveCommand(idOrLogId, options) {
|
|
|
4126
4127
|
}
|
|
4127
4128
|
return adminApiPost(`/api/admin/tracks/${encodeURIComponent(idOrLogId)}/observe`, body);
|
|
4128
4129
|
}
|
|
4130
|
+
async function trackContextCommand(idOrLogId, options = {}) {
|
|
4131
|
+
const body = {};
|
|
4132
|
+
if (options.query !== undefined) {
|
|
4133
|
+
body.query = options.query;
|
|
4134
|
+
}
|
|
4135
|
+
return adminApiPost(`/api/admin/tracks/${encodeURIComponent(idOrLogId)}/context`, body);
|
|
4136
|
+
}
|
|
4129
4137
|
var DEFAULT_VIDEO_MODEL = "anthropic/claude-opus-4-8", DEFAULT_VIDEO_REASONING = "high", FOUND_BASE = "https://found.fluncle.com", VIDEO_FIELDS;
|
|
4130
4138
|
var init_track = __esm(() => {
|
|
4131
4139
|
init_api();
|
|
@@ -4174,13 +4182,15 @@ var exports_admin_tracks = {};
|
|
|
4174
4182
|
__export(exports_admin_tracks, {
|
|
4175
4183
|
vehiclesCommand: () => vehiclesCommand,
|
|
4176
4184
|
queueCommand: () => queueCommand,
|
|
4185
|
+
observeQueueCommand: () => observeQueueCommand,
|
|
4177
4186
|
enrichSweepCommand: () => enrichSweepCommand,
|
|
4178
4187
|
enrichQueueCommand: () => enrichQueueCommand,
|
|
4188
|
+
contextQueueCommand: () => contextQueueCommand,
|
|
4179
4189
|
backfillLastfmCommand: () => backfillLastfmCommand,
|
|
4180
4190
|
backfillDiscogsCommand: () => backfillDiscogsCommand
|
|
4181
4191
|
});
|
|
4182
4192
|
async function fetchAdminTracks(options) {
|
|
4183
|
-
const { hasVideo, max, order, status } = options;
|
|
4193
|
+
const { hasContext, hasObservation, hasVideo, max, order, status } = options;
|
|
4184
4194
|
const results = [];
|
|
4185
4195
|
let cursor;
|
|
4186
4196
|
do {
|
|
@@ -4188,6 +4198,12 @@ async function fetchAdminTracks(options) {
|
|
|
4188
4198
|
if (hasVideo !== undefined) {
|
|
4189
4199
|
params.set("hasVideo", String(hasVideo));
|
|
4190
4200
|
}
|
|
4201
|
+
if (hasContext !== undefined) {
|
|
4202
|
+
params.set("hasContext", String(hasContext));
|
|
4203
|
+
}
|
|
4204
|
+
if (hasObservation !== undefined) {
|
|
4205
|
+
params.set("hasObservation", String(hasObservation));
|
|
4206
|
+
}
|
|
4191
4207
|
if (status !== undefined) {
|
|
4192
4208
|
params.set("status", status);
|
|
4193
4209
|
}
|
|
@@ -4209,12 +4225,29 @@ async function fetchAdminTracks(options) {
|
|
|
4209
4225
|
} while (cursor);
|
|
4210
4226
|
return results;
|
|
4211
4227
|
}
|
|
4212
|
-
async function queueCommand(limit) {
|
|
4213
|
-
return fetchAdminTracks({
|
|
4228
|
+
async function queueCommand(limit, filters = {}) {
|
|
4229
|
+
return fetchAdminTracks({
|
|
4230
|
+
hasContext: filters.hasContext,
|
|
4231
|
+
hasObservation: filters.hasObservation,
|
|
4232
|
+
hasVideo: false,
|
|
4233
|
+
max: limit,
|
|
4234
|
+
order: "asc"
|
|
4235
|
+
});
|
|
4214
4236
|
}
|
|
4215
4237
|
async function enrichQueueCommand(limit) {
|
|
4216
4238
|
return fetchAdminTracks({ max: limit, order: "asc", status: "queue" });
|
|
4217
4239
|
}
|
|
4240
|
+
async function contextQueueCommand(limit) {
|
|
4241
|
+
return fetchAdminTracks({ hasContext: false, max: limit, order: "asc" });
|
|
4242
|
+
}
|
|
4243
|
+
async function observeQueueCommand(limit) {
|
|
4244
|
+
return fetchAdminTracks({
|
|
4245
|
+
hasContext: true,
|
|
4246
|
+
hasObservation: false,
|
|
4247
|
+
max: limit,
|
|
4248
|
+
order: "asc"
|
|
4249
|
+
});
|
|
4250
|
+
}
|
|
4218
4251
|
async function enrichSweepCommand(limit) {
|
|
4219
4252
|
return adminApiPost(`/api/admin/tracks/enrich?limit=${limit}`);
|
|
4220
4253
|
}
|
|
@@ -4631,8 +4664,12 @@ __export(exports_submissions, {
|
|
|
4631
4664
|
approveSubmissionCommand: () => approveSubmissionCommand
|
|
4632
4665
|
});
|
|
4633
4666
|
import { createInterface as createInterface2 } from "node:readline/promises";
|
|
4634
|
-
async function listSubmissionsCommand() {
|
|
4667
|
+
async function listSubmissionsCommand(options = {}) {
|
|
4635
4668
|
const response = await adminApiGet("/api/admin/submissions");
|
|
4669
|
+
if (options.json) {
|
|
4670
|
+
printJson2({ ok: true, submissions: response.submissions });
|
|
4671
|
+
return;
|
|
4672
|
+
}
|
|
4636
4673
|
if (response.submissions.length === 0) {
|
|
4637
4674
|
console.log("No pending submissions.");
|
|
4638
4675
|
return;
|
|
@@ -4641,30 +4678,45 @@ async function listSubmissionsCommand() {
|
|
|
4641
4678
|
|
|
4642
4679
|
`));
|
|
4643
4680
|
}
|
|
4644
|
-
async function reviewSubmissionCommand(submissionId) {
|
|
4681
|
+
async function reviewSubmissionCommand(submissionId, options = {}) {
|
|
4645
4682
|
const submission = await fetchSubmission(submissionId);
|
|
4683
|
+
if (options.json) {
|
|
4684
|
+
printJson2({ ok: true, submission });
|
|
4685
|
+
return;
|
|
4686
|
+
}
|
|
4646
4687
|
console.log(formatSubmissionDetail(submission));
|
|
4647
4688
|
}
|
|
4648
|
-
async function rejectSubmissionCommand(submissionId) {
|
|
4689
|
+
async function rejectSubmissionCommand(submissionId, options = {}) {
|
|
4649
4690
|
const response = await adminApiPost(`/api/admin/submissions/${encodeURIComponent(submissionId)}/reject`);
|
|
4691
|
+
if (options.json) {
|
|
4692
|
+
printJson2({ ok: true, submission: response.submission });
|
|
4693
|
+
return;
|
|
4694
|
+
}
|
|
4650
4695
|
console.log(`Rejected ${formatTrackLine(response.submission)}.`);
|
|
4651
4696
|
}
|
|
4652
|
-
async function approveSubmissionCommand(submissionId) {
|
|
4697
|
+
async function approveSubmissionCommand(submissionId, options = {}) {
|
|
4653
4698
|
const submission = await fetchSubmission(submissionId);
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4662
|
-
|
|
4699
|
+
if (!options.json) {
|
|
4700
|
+
console.log(formatSubmissionDetail(submission));
|
|
4701
|
+
console.log("");
|
|
4702
|
+
await addCommand2(submission.spotifyUrl, {
|
|
4703
|
+
dryRun: true
|
|
4704
|
+
});
|
|
4705
|
+
const confirmed = await confirm("Publish this submission? (Y/n) ");
|
|
4706
|
+
if (!confirmed) {
|
|
4707
|
+
console.log("Approval cancelled.");
|
|
4708
|
+
return;
|
|
4709
|
+
}
|
|
4663
4710
|
}
|
|
4664
4711
|
await addCommand2(submission.spotifyUrl, {
|
|
4712
|
+
json: options.json,
|
|
4665
4713
|
note: submission.note
|
|
4666
4714
|
});
|
|
4667
|
-
await adminApiPost(`/api/admin/submissions/${encodeURIComponent(submission.id)}/approve`);
|
|
4715
|
+
const response = await adminApiPost(`/api/admin/submissions/${encodeURIComponent(submission.id)}/approve`);
|
|
4716
|
+
if (options.json) {
|
|
4717
|
+
printJson2({ ok: true, submission: response.submission });
|
|
4718
|
+
return;
|
|
4719
|
+
}
|
|
4668
4720
|
console.log(`Approved ${formatTrackLine(submission)}.`);
|
|
4669
4721
|
}
|
|
4670
4722
|
async function fetchSubmission(submissionId) {
|
|
@@ -4673,7 +4725,7 @@ async function fetchSubmission(submissionId) {
|
|
|
4673
4725
|
}
|
|
4674
4726
|
async function confirm(label) {
|
|
4675
4727
|
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
4676
|
-
|
|
4728
|
+
throw new CliError2("not_interactive", "Approving publishes a submission and needs a yes. Run this in a terminal, or pass --json to approve without the prompt.");
|
|
4677
4729
|
}
|
|
4678
4730
|
const rl = createInterface2({
|
|
4679
4731
|
input: process.stdin,
|
|
@@ -4713,6 +4765,7 @@ function formatTrackLine(submission) {
|
|
|
4713
4765
|
}
|
|
4714
4766
|
var init_submissions = __esm(() => {
|
|
4715
4767
|
init_api();
|
|
4768
|
+
init_output();
|
|
4716
4769
|
init_add2();
|
|
4717
4770
|
});
|
|
4718
4771
|
|
|
@@ -5194,7 +5247,7 @@ var COORD_FALLBACK2 = "—";
|
|
|
5194
5247
|
import { existsSync as existsSync2, readFileSync as readFileSync2 } from "fs";
|
|
5195
5248
|
import path from "path";
|
|
5196
5249
|
|
|
5197
|
-
// ../../node_modules
|
|
5250
|
+
// ../../node_modules/commander/esm.mjs
|
|
5198
5251
|
var import__ = __toESM(require_commander(), 1);
|
|
5199
5252
|
var {
|
|
5200
5253
|
program,
|
|
@@ -5395,14 +5448,22 @@ function addAdminCommands(program2) {
|
|
|
5395
5448
|
const { addCommand: addCommand3 } = await Promise.resolve().then(() => (init_add(), exports_add));
|
|
5396
5449
|
await runAdd(spotifyUrl, options, addCommand3);
|
|
5397
5450
|
});
|
|
5398
|
-
adminTracks.command("queue").description("Findings awaiting a video, oldest first (the next to film is first)").option("--limit <limit>", "Number of findings to show", "10").option("--json", "Print JSON", false).action(async (options) => {
|
|
5451
|
+
adminTracks.command("queue").description("Findings awaiting a video, oldest first (the next to film is first)").option("--limit <limit>", "Number of findings to show", "10").option("--has-context", "Only findings whose field notes are already gathered").option("--has-observation", "Only findings that already have a spoken observation").option("--json", "Print JSON", false).action(async (options) => {
|
|
5399
5452
|
const { queueCommand: queueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
|
|
5400
5453
|
await runAdminQueue(options, queueCommand2);
|
|
5401
5454
|
});
|
|
5402
|
-
admin.command("queue", { hidden: true }).description("Render queue (alias of `admin tracks queue`)").option("--limit <limit>", "Number of findings to show", "10").option("--json", "Print JSON", false).action(async (options) => {
|
|
5455
|
+
admin.command("queue", { hidden: true }).description("Render queue (alias of `admin tracks queue`)").option("--limit <limit>", "Number of findings to show", "10").option("--has-context", "Only findings whose field notes are already gathered").option("--has-observation", "Only findings that already have a spoken observation").option("--json", "Print JSON", false).action(async (options) => {
|
|
5403
5456
|
const { queueCommand: queueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
|
|
5404
5457
|
await runAdminQueue(options, queueCommand2);
|
|
5405
5458
|
});
|
|
5459
|
+
adminTracks.command("context-queue").description("Findings missing their field notes, oldest first (the context cron's worklist)").option("--limit <limit>", "Number of findings to show", "10").option("--json", "Print JSON", false).action(async (options) => {
|
|
5460
|
+
const { contextQueueCommand: contextQueueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
|
|
5461
|
+
await runAdminContextQueue(options, contextQueueCommand2);
|
|
5462
|
+
});
|
|
5463
|
+
adminTracks.command("observe-queue").description("Findings with notes but no observation yet, oldest first (the observe cron's worklist)").option("--limit <limit>", "Number of findings to show", "10").option("--json", "Print JSON", false).action(async (options) => {
|
|
5464
|
+
const { observeQueueCommand: observeQueueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
|
|
5465
|
+
await runAdminObserveQueue(options, observeQueueCommand2);
|
|
5466
|
+
});
|
|
5406
5467
|
adminTracks.command("enrich-queue").description("Findings needing (re-)enrichment: pending, failed, or stuck processing").option("--limit <limit>", "Number of findings to show", "10").option("--json", "Print JSON", false).action(async (options) => {
|
|
5407
5468
|
const { enrichQueueCommand: enrichQueueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
|
|
5408
5469
|
await runAdminEnrichQueue(options, enrichQueueCommand2);
|
|
@@ -5456,6 +5517,10 @@ function addAdminCommands(program2) {
|
|
|
5456
5517
|
const { trackObserveCommand: trackObserveCommand2 } = await Promise.resolve().then(() => (init_track(), exports_track));
|
|
5457
5518
|
await runTrackObserve(idOrLogId, options, trackObserveCommand2);
|
|
5458
5519
|
});
|
|
5520
|
+
adminTrack.command("context").description("Gather the field notes for a finding (facts only; observe speaks from them)").argument("[idOrLogId]").option("--query <text>", "Override the fact-search query (else the Worker builds one)").option("--json", "Print JSON", false).allowExcessArguments().action(async (idOrLogId, options) => {
|
|
5521
|
+
const { trackContextCommand: trackContextCommand2 } = await Promise.resolve().then(() => (init_track(), exports_track));
|
|
5522
|
+
await runTrackContext(idOrLogId, options, trackContextCommand2);
|
|
5523
|
+
});
|
|
5459
5524
|
const adminMixtapes = configureCommand(admin.command("mixtapes").description("Mixtape admin commands"));
|
|
5460
5525
|
adminMixtapes.action(() => {
|
|
5461
5526
|
adminMixtapes.outputHelp();
|
|
@@ -5497,30 +5562,30 @@ function addAdminCommands(program2) {
|
|
|
5497
5562
|
await runMixtapePublishYoutube(idOrLogId, options, publishYoutubeCommand3);
|
|
5498
5563
|
});
|
|
5499
5564
|
const submissions = configureCommand(admin.command("submissions").description("Review listener submissions"));
|
|
5500
|
-
submissions.action(async () => {
|
|
5565
|
+
submissions.option("--json", "Print JSON", false).action(async (options) => {
|
|
5501
5566
|
const { listSubmissionsCommand: listSubmissionsCommand2 } = await Promise.resolve().then(() => (init_submissions(), exports_submissions));
|
|
5502
|
-
await listSubmissionsCommand2();
|
|
5567
|
+
await listSubmissionsCommand2(options);
|
|
5503
5568
|
});
|
|
5504
|
-
submissions.command("review").description("Inspect one submission").argument("[submissionId]").action(async (submissionId) => {
|
|
5569
|
+
submissions.command("review").description("Inspect one submission").argument("[submissionId]").option("--json", "Print JSON", false).action(async (submissionId, options) => {
|
|
5505
5570
|
if (!submissionId) {
|
|
5506
5571
|
throw new Error("Missing submission id for: review");
|
|
5507
5572
|
}
|
|
5508
5573
|
const { reviewSubmissionCommand: reviewSubmissionCommand2 } = await Promise.resolve().then(() => (init_submissions(), exports_submissions));
|
|
5509
|
-
await reviewSubmissionCommand2(submissionId);
|
|
5574
|
+
await reviewSubmissionCommand2(submissionId, options);
|
|
5510
5575
|
});
|
|
5511
|
-
submissions.command("reject").description("Reject a submission").argument("[submissionId]").action(async (submissionId) => {
|
|
5576
|
+
submissions.command("reject").description("Reject a submission").argument("[submissionId]").option("--json", "Print JSON", false).action(async (submissionId, options) => {
|
|
5512
5577
|
if (!submissionId) {
|
|
5513
5578
|
throw new Error("Missing submission id for: reject");
|
|
5514
5579
|
}
|
|
5515
5580
|
const { rejectSubmissionCommand: rejectSubmissionCommand2 } = await Promise.resolve().then(() => (init_submissions(), exports_submissions));
|
|
5516
|
-
await rejectSubmissionCommand2(submissionId);
|
|
5581
|
+
await rejectSubmissionCommand2(submissionId, options);
|
|
5517
5582
|
});
|
|
5518
|
-
submissions.command("approve").description("Approve a submission").argument("[submissionId]").action(async (submissionId) => {
|
|
5583
|
+
submissions.command("approve").description("Approve a submission (--json approves without the confirm prompt)").argument("[submissionId]").option("--json", "Print JSON, skip the confirm prompt", false).action(async (submissionId, options) => {
|
|
5519
5584
|
if (!submissionId) {
|
|
5520
5585
|
throw new Error("Missing submission id for: approve");
|
|
5521
5586
|
}
|
|
5522
5587
|
const { approveSubmissionCommand: approveSubmissionCommand2 } = await Promise.resolve().then(() => (init_submissions(), exports_submissions));
|
|
5523
|
-
await approveSubmissionCommand2(submissionId);
|
|
5588
|
+
await approveSubmissionCommand2(submissionId, options);
|
|
5524
5589
|
});
|
|
5525
5590
|
const auth = configureCommand(admin.command("auth").description("Authentication commands"));
|
|
5526
5591
|
auth.command("spotify").description("Authorize Spotify access").action(async () => {
|
|
@@ -5604,6 +5669,29 @@ async function runTrackObserve(idOrLogId, options, trackObserveCommand2) {
|
|
|
5604
5669
|
console.log(` length: ${Math.round(result.durationMs / 1000)}s`);
|
|
5605
5670
|
console.log(` voice: ${result.voiceId}`);
|
|
5606
5671
|
}
|
|
5672
|
+
async function runTrackContext(idOrLogId, options, trackContextCommand2) {
|
|
5673
|
+
if (!idOrLogId) {
|
|
5674
|
+
throw new Error("Usage: fluncle admin tracks context <track_id|log_id> [--query <text>] [--json]");
|
|
5675
|
+
}
|
|
5676
|
+
const result = await trackContextCommand2(idOrLogId, { query: options.query });
|
|
5677
|
+
if (options.json) {
|
|
5678
|
+
printJson(result);
|
|
5679
|
+
return;
|
|
5680
|
+
}
|
|
5681
|
+
if (result.skipped) {
|
|
5682
|
+
console.log(`Field notes already on file for ${result.logId}. Nothing to gather.`);
|
|
5683
|
+
return;
|
|
5684
|
+
}
|
|
5685
|
+
if (!result.contextNote.trim()) {
|
|
5686
|
+
console.log(`No field notes turned up for ${result.logId}. The queue will swing back around.`);
|
|
5687
|
+
return;
|
|
5688
|
+
}
|
|
5689
|
+
console.log(`Gathered field notes for ${result.logId}:`);
|
|
5690
|
+
console.log(` ${result.contextNote}`);
|
|
5691
|
+
if (result.sources.length > 0) {
|
|
5692
|
+
console.log(` sources: ${result.sources.join(", ")}`);
|
|
5693
|
+
}
|
|
5694
|
+
}
|
|
5607
5695
|
async function runPreviewArchiveBackfill(options, previewArchiveBackfillCommand2) {
|
|
5608
5696
|
const limit = options.limit === undefined ? undefined : Number.parseInt(options.limit, 10);
|
|
5609
5697
|
if (limit !== undefined && (!Number.isInteger(limit) || limit < 1)) {
|
|
@@ -6055,7 +6143,10 @@ function parseListLimit(value) {
|
|
|
6055
6143
|
}
|
|
6056
6144
|
async function runAdminQueue(options, queueCommand2) {
|
|
6057
6145
|
const limit = parseListLimit(options.limit);
|
|
6058
|
-
const tracks = await queueCommand2(limit
|
|
6146
|
+
const tracks = await queueCommand2(limit, {
|
|
6147
|
+
hasContext: options.hasContext ? true : undefined,
|
|
6148
|
+
hasObservation: options.hasObservation ? true : undefined
|
|
6149
|
+
});
|
|
6059
6150
|
if (options.json) {
|
|
6060
6151
|
printJson({
|
|
6061
6152
|
ok: true,
|
|
@@ -6073,6 +6164,46 @@ async function runAdminQueue(options, queueCommand2) {
|
|
|
6073
6164
|
console.log(trackRows2(tracks).join(`
|
|
6074
6165
|
`));
|
|
6075
6166
|
}
|
|
6167
|
+
async function runAdminContextQueue(options, contextQueueCommand2) {
|
|
6168
|
+
const limit = parseListLimit(options.limit);
|
|
6169
|
+
const tracks = await contextQueueCommand2(limit);
|
|
6170
|
+
if (options.json) {
|
|
6171
|
+
printJson({
|
|
6172
|
+
ok: true,
|
|
6173
|
+
tracks
|
|
6174
|
+
});
|
|
6175
|
+
return;
|
|
6176
|
+
}
|
|
6177
|
+
if (tracks.length === 0) {
|
|
6178
|
+
console.log("Every finding has its field notes. Nothing waiting on context.");
|
|
6179
|
+
return;
|
|
6180
|
+
}
|
|
6181
|
+
const { trackRows: trackRows2 } = await Promise.resolve().then(() => exports_format);
|
|
6182
|
+
const noun = tracks.length === 1 ? "finding" : "findings";
|
|
6183
|
+
console.log(`${tracks.length} ${noun} missing field notes, oldest first:`);
|
|
6184
|
+
console.log(trackRows2(tracks).join(`
|
|
6185
|
+
`));
|
|
6186
|
+
}
|
|
6187
|
+
async function runAdminObserveQueue(options, observeQueueCommand2) {
|
|
6188
|
+
const limit = parseListLimit(options.limit);
|
|
6189
|
+
const tracks = await observeQueueCommand2(limit);
|
|
6190
|
+
if (options.json) {
|
|
6191
|
+
printJson({
|
|
6192
|
+
ok: true,
|
|
6193
|
+
tracks
|
|
6194
|
+
});
|
|
6195
|
+
return;
|
|
6196
|
+
}
|
|
6197
|
+
if (tracks.length === 0) {
|
|
6198
|
+
console.log("Every finding with notes has its observation. Nothing waiting on a voice.");
|
|
6199
|
+
return;
|
|
6200
|
+
}
|
|
6201
|
+
const { trackRows: trackRows2 } = await Promise.resolve().then(() => exports_format);
|
|
6202
|
+
const noun = tracks.length === 1 ? "finding" : "findings";
|
|
6203
|
+
console.log(`${tracks.length} ${noun} awaiting an observation, oldest first:`);
|
|
6204
|
+
console.log(trackRows2(tracks).join(`
|
|
6205
|
+
`));
|
|
6206
|
+
}
|
|
6076
6207
|
async function runAdminEnrichQueue(options, enrichQueueCommand2) {
|
|
6077
6208
|
const limit = parseListLimit(options.limit);
|
|
6078
6209
|
const tracks = await enrichQueueCommand2(limit);
|
|
@@ -6328,6 +6459,7 @@ var stringOptions = new Set([
|
|
|
6328
6459
|
"--platform",
|
|
6329
6460
|
"--poster",
|
|
6330
6461
|
"--props",
|
|
6462
|
+
"--query",
|
|
6331
6463
|
"--recorded-at",
|
|
6332
6464
|
"--render",
|
|
6333
6465
|
"--scheduled-for",
|
package/package.json
CHANGED