@giftsofprometheus/cli 0.2.2 → 0.3.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/dist/index.js CHANGED
@@ -375,9 +375,16 @@ async function resolveTalk(value) {
375
375
  .loose()
376
376
  .parse(await request(`/api/knowledge/talks/${encodeURIComponent(value)}`, 'GET', undefined, false));
377
377
  }
378
- async function event(talk, type) {
378
+ // The service checks the recId against its own deliveries; the CLI only refuses what cannot be one
379
+ const recIdOption = z.uuid();
380
+ function recIdQuery(recId) {
381
+ return recId === undefined ? '' : `?recId=${encodeURIComponent(recIdOption.parse(recId))}`;
382
+ }
383
+ async function event(talk, type, recId) {
379
384
  const item = await resolveTalk(talk);
380
- return request('/api/knowledge/events', 'POST', [{ id: randomUUID(), type, talkId: item.id, context: 'talk_page' }]);
385
+ // With a recId the service takes the context from that list; `similar` only passes its check
386
+ const source = recId === undefined ? { context: 'talk_page' } : { context: 'similar', recId: recIdOption.parse(recId) };
387
+ return request('/api/knowledge/events', 'POST', [{ id: randomUUID(), type, talkId: item.id, ...source }]);
381
388
  }
382
389
  program.exitOverride();
383
390
  program.configureOutput({
@@ -474,9 +481,27 @@ talks
474
481
  talks
475
482
  .command('content')
476
483
  .argument('<slug-or-id>')
484
+ .option('--rec-id <recId>', 'recId of the list the talk came from (feed, search or similar)')
485
+ .action(run(async (id, options) => {
486
+ const talk = await resolveTalk(id);
487
+ const result = await request(`/api/knowledge/talks/${encodeURIComponent(String(talk.slug))}/content${recIdQuery(options.recId)}`, 'POST');
488
+ // After the transcript: talks like this one, or saving it if the user found it useful
489
+ console.error(`Next: similar talks — ${launcher} talks similar ${talk.slug}; save it if the user asks — ${launcher} favorites add ${talk.slug}`);
490
+ return result;
491
+ }));
492
+ talks
493
+ .command('similar')
494
+ .argument('<slug-or-id>')
477
495
  .action(run(async (id) => {
478
496
  const talk = await resolveTalk(id);
479
- return request(`/api/knowledge/talks/${encodeURIComponent(String(talk.slug))}/content`, 'POST');
497
+ // Public; with a session the list gets a recId, and each item's contentUrl carries it
498
+ const result = z
499
+ .object({ recId: z.string().optional() })
500
+ .loose()
501
+ .parse(await request(`/api/knowledge/talks/${encodeURIComponent(String(talk.slug))}/similar`));
502
+ if (result.recId)
503
+ console.error(`Next: open one with ${launcher} talks content <slug> --rec-id ${result.recId}`);
504
+ return result;
480
505
  }));
481
506
  const favorites = program.command('favorites').description('Manage bookmarks');
482
507
  favorites
@@ -487,7 +512,8 @@ favorites
487
512
  favorites
488
513
  .command('add')
489
514
  .argument('<slug-or-id>')
490
- .action(run((id) => event(id, 'bookmark')));
515
+ .option('--rec-id <recId>', 'recId of the list the talk came from')
516
+ .action(run((id, options) => event(id, 'bookmark', options.recId)));
491
517
  favorites
492
518
  .command('remove')
493
519
  .argument('<slug-or-id>')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giftsofprometheus/cli",
3
- "version": "0.2.2",
3
+ "version": "0.3.0",
4
4
  "description": "Search AI conference talks, read transcripts, and manage your Gifts of Prometheus favorites from the shell or an AI agent",
5
5
  "keywords": [
6
6
  "agents",
@@ -34,6 +34,7 @@ giftsofprometheus --json talks search 'agent evaluation' # published talks by
34
34
  giftsofprometheus --json talks list --page 2 # the whole catalog, page by page
35
35
  giftsofprometheus --json talks get <slug-or-id> # one talk: summary, speakers, topics, publication
36
36
  giftsofprometheus --json talks content <slug-or-id> # full transcript, requires login
37
+ giftsofprometheus --json talks similar <slug-or-id> # up to four similar talks with a reason each
37
38
  giftsofprometheus --json feed # personal recommendations, requires login
38
39
  giftsofprometheus --json favorites list # saved talks, requires login
39
40
  giftsofprometheus --json profile get # interests and current task, requires login
@@ -44,6 +45,17 @@ giftsofprometheus --json profile get # interests and curre
44
45
  - A transcript is in the talk's original language. Segment timecodes are in milliseconds from the start of the talk. When a talk is a part of a longer recording, `sourceRange` gives its bounds in that recording. A talk without a transcript returns an empty array.
45
46
  - `request <path>` makes a read-only GET to a path under `/api/knowledge/` or `/api/account/` that no command covers.
46
47
  - Reading never needs the user's confirmation: search, open talks and transcripts as the task requires.
48
+ - A list with a `recId` (feed, search, similar) puts it into each item's `contentUrl`. When you open a talk from that list, pass it on: `talks content <slug> --rec-id <recId>`, and `favorites add <slug> --rec-id <recId>` when the user saves it.
49
+
50
+ ## Next steps
51
+
52
+ After answering, offer one next step in a short line, matched to where the user is. Offer each kind at most once per talk, and skip it when the user is busy with something else:
53
+
54
+ - After a summary (`talks get`): the full transcript.
55
+ - After the transcript or a discussion of it: talks like this one (`talks similar`); show titles with their `reason`.
56
+ - When the user says a talk was useful: saving it to favorites. Save only after they agree.
57
+
58
+ Commands print the suggested next command on stderr. It is a hint for you; do not run a change without the user.
47
59
 
48
60
  ## Onboarding
49
61
 
@@ -33,5 +33,10 @@
33
33
  "version": "0.2.2",
34
34
  "hash": "dc7123cc1ecddd93",
35
35
  "description": "description: Find AI conference talks (AI Engineer, BAAI, Apsara and others) with Russian summaries, read their full transcripts, and manage the signed-in user's favorites, interests and personal feed through the giftsofprometheus CLI, and build a starting profile in the chat. Use when the user asks for talks, speakers or transcripts on an AI engineering topic, or wants to save, list or remove favorites on Gifts of Prometheus."
36
+ },
37
+ {
38
+ "version": "0.3.0",
39
+ "hash": "dd211af3576fc485",
40
+ "description": "description: Find AI conference talks (AI Engineer, BAAI, Apsara and others) with Russian summaries, read their full transcripts, and manage the signed-in user's favorites, interests and personal feed through the giftsofprometheus CLI, and build a starting profile in the chat. Use when the user asks for talks, speakers or transcripts on an AI engineering topic, or wants to save, list or remove favorites on Gifts of Prometheus."
36
41
  }
37
42
  ]