fluncle 0.46.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.
Files changed (2) hide show
  1. package/bin/fluncle.mjs +121 -9
  2. package/package.json +1 -1
package/bin/fluncle.mjs CHANGED
@@ -2539,7 +2539,7 @@ function parseVersion(version) {
2539
2539
  var currentVersion;
2540
2540
  var init_version = __esm(() => {
2541
2541
  init_output();
2542
- currentVersion = "0.46.0".trim() ? "0.46.0".trim() : "0.1.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.46.0".trim() ? "0.46.0".trim() : "0.1.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({ hasVideo: false, max: limit, order: "asc" });
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
  }
@@ -5415,14 +5448,22 @@ function addAdminCommands(program2) {
5415
5448
  const { addCommand: addCommand3 } = await Promise.resolve().then(() => (init_add(), exports_add));
5416
5449
  await runAdd(spotifyUrl, options, addCommand3);
5417
5450
  });
5418
- 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) => {
5419
5452
  const { queueCommand: queueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
5420
5453
  await runAdminQueue(options, queueCommand2);
5421
5454
  });
5422
- 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) => {
5423
5456
  const { queueCommand: queueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
5424
5457
  await runAdminQueue(options, queueCommand2);
5425
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
+ });
5426
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) => {
5427
5468
  const { enrichQueueCommand: enrichQueueCommand2 } = await Promise.resolve().then(() => (init_admin_tracks(), exports_admin_tracks));
5428
5469
  await runAdminEnrichQueue(options, enrichQueueCommand2);
@@ -5476,6 +5517,10 @@ function addAdminCommands(program2) {
5476
5517
  const { trackObserveCommand: trackObserveCommand2 } = await Promise.resolve().then(() => (init_track(), exports_track));
5477
5518
  await runTrackObserve(idOrLogId, options, trackObserveCommand2);
5478
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
+ });
5479
5524
  const adminMixtapes = configureCommand(admin.command("mixtapes").description("Mixtape admin commands"));
5480
5525
  adminMixtapes.action(() => {
5481
5526
  adminMixtapes.outputHelp();
@@ -5624,6 +5669,29 @@ async function runTrackObserve(idOrLogId, options, trackObserveCommand2) {
5624
5669
  console.log(` length: ${Math.round(result.durationMs / 1000)}s`);
5625
5670
  console.log(` voice: ${result.voiceId}`);
5626
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
+ }
5627
5695
  async function runPreviewArchiveBackfill(options, previewArchiveBackfillCommand2) {
5628
5696
  const limit = options.limit === undefined ? undefined : Number.parseInt(options.limit, 10);
5629
5697
  if (limit !== undefined && (!Number.isInteger(limit) || limit < 1)) {
@@ -6075,7 +6143,10 @@ function parseListLimit(value) {
6075
6143
  }
6076
6144
  async function runAdminQueue(options, queueCommand2) {
6077
6145
  const limit = parseListLimit(options.limit);
6078
- const tracks = await queueCommand2(limit);
6146
+ const tracks = await queueCommand2(limit, {
6147
+ hasContext: options.hasContext ? true : undefined,
6148
+ hasObservation: options.hasObservation ? true : undefined
6149
+ });
6079
6150
  if (options.json) {
6080
6151
  printJson({
6081
6152
  ok: true,
@@ -6093,6 +6164,46 @@ async function runAdminQueue(options, queueCommand2) {
6093
6164
  console.log(trackRows2(tracks).join(`
6094
6165
  `));
6095
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
+ }
6096
6207
  async function runAdminEnrichQueue(options, enrichQueueCommand2) {
6097
6208
  const limit = parseListLimit(options.limit);
6098
6209
  const tracks = await enrichQueueCommand2(limit);
@@ -6348,6 +6459,7 @@ var stringOptions = new Set([
6348
6459
  "--platform",
6349
6460
  "--poster",
6350
6461
  "--props",
6462
+ "--query",
6351
6463
  "--recorded-at",
6352
6464
  "--render",
6353
6465
  "--scheduled-for",
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.46.0"
34
+ "version": "0.47.0"
35
35
  }