@giftsofprometheus/cli 0.6.1 → 0.7.1

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/README.md CHANGED
@@ -116,8 +116,8 @@ npx skills add timurkhakhalev/giftsofprometheus-cli
116
116
  | `ask <вопрос> [--q формулировка] [--limit n] [--per-talk n]` | Фрагменты транскриптов с цитатами и ссылками на секунду; `--q` повторяется до двух раз | ✓ |
117
117
  | `talks search <запрос> [--page n]` | Поиск опубликованных докладов по названию, описанию, спикеру и теме | |
118
118
  | `talks list [--page n]` | Каталог по страницам | |
119
- | `talks get <slug-или-id>` | Доклад с описанием, спикерами, темами и видео | |
120
- | `talks content <slug-или-id> [--rec-id UUID]` | Полный транскрипт на языке доклада | ✓ |
119
+ | `talks get <slug-или-id>` | Доклад с описанием, спикерами (компания и должность), темами и видео | |
120
+ | `talks content <slug-или-id> [--rec-id UUID] [--from время] [--to время] [--outline]` | Транскрипт на языке доклада: целиком, отрезок (`--from 12:30 --to 18:00`) или только спикеры и главы (`--outline`) | ✓ |
121
121
  | `favorites list [--page n] [--limit n]` | Ваше избранное | ✓ |
122
122
  | `favorites add <slug-или-id>` / `remove` | Добавить в избранное или убрать | ✓ |
123
123
  | `profile get` | Ваши интересы и текущая задача | ✓ |
package/dist/index.js CHANGED
@@ -498,15 +498,11 @@ program
498
498
  .command('ask')
499
499
  .description('Find relevant passages in talk transcripts')
500
500
  .argument('<query>', 'question or search formulation')
501
- .option('--q <query>', 'another formulation, up to three in total', (value, previous) => [...previous, value], [])
502
- .option('--limit <n>', 'maximum number of talks')
503
- .option('--per-talk <n>', 'maximum passages per talk')
501
+ .option('--q <query>', 'another formulation; the query and --q together are at most three, so at most two --q', (value, previous) => [...previous, value], [])
502
+ .option('--limit <n>', 'maximum number of talks (1-20)')
503
+ .option('--per-talk <n>', 'maximum passages per talk (1-3)')
504
504
  .action(run((query, options) => {
505
- const queries = z
506
- .array(z.string().trim().min(1).max(200))
507
- .min(1)
508
- .max(3)
509
- .parse([query, ...options.q]);
505
+ const queries = askQueries([query, ...options.q]);
510
506
  const number = z.string().regex(/^\d+$/);
511
507
  const params = new URLSearchParams();
512
508
  for (const value of queries)
@@ -517,6 +513,25 @@ program
517
513
  params.set('perTalk', number.parse(options.perTalk));
518
514
  return request(`/api/knowledge/passages?${params}`);
519
515
  }));
516
+ /** The service takes one to three texts of up to 200 characters; a plain message tells an agent what to drop */
517
+ function askQueries(values) {
518
+ const queries = values.map(value => value.trim());
519
+ if (queries.some(value => !value))
520
+ throw new ApiError('Empty formulation: the query and every --q need text');
521
+ if (queries.length > 3)
522
+ throw new ApiError(`ask takes at most 3 formulations in total: the query and up to two --q. Got ${queries.length}; drop ${queries.length - 3}.`);
523
+ const long = queries.find(value => value.length > 200);
524
+ if (long !== undefined)
525
+ throw new ApiError(`A formulation is longer than 200 characters (${long.length}); shorten it`);
526
+ return queries;
527
+ }
528
+ /** Seconds as `90`, `1:30` or `1:02:03` */
529
+ function seconds(value) {
530
+ if (!/^\d+(:\d{1,2}){0,2}$/.test(value))
531
+ throw new ApiError(`Invalid time "${value}": use seconds (90), m:ss (1:30) or h:mm:ss (1:02:03)`);
532
+ return value.split(':').reduce((total, part) => total * 60 + Number(part), 0);
533
+ }
534
+ const contentShape = z.object({ transcript: z.array(z.object({ startMs: z.number() }).loose()) }).loose();
520
535
  const talks = program.command('talks').description('Browse talks');
521
536
  talks
522
537
  .command('list')
@@ -548,10 +563,25 @@ talks
548
563
  .command('content')
549
564
  .argument('<slug-or-id>')
550
565
  .option('--rec-id <recId>', 'recId of the list the talk came from (feed, search or similar)')
566
+ .option('--from <time>', 'keep transcript segments that start at or after this time: seconds, m:ss or h:mm:ss')
567
+ .option('--to <time>', 'keep transcript segments that start before this time')
568
+ .option('--outline', 'speakers, chapters and publication without the transcript')
551
569
  .action(run(async (id, options) => {
552
570
  const query = recIdQuery(options.recId);
571
+ const from = options.from === undefined ? 0 : seconds(options.from) * 1000;
572
+ const to = options.to === undefined ? Infinity : seconds(options.to) * 1000;
573
+ if (from >= to)
574
+ throw new ApiError('--from must be earlier than --to');
553
575
  const talk = await resolveTalk(id);
554
- const result = await request(`/api/knowledge/talks/${encodeURIComponent(String(talk.slug))}/content${query}`, 'POST');
576
+ const raw = await request(`/api/knowledge/talks/${encodeURIComponent(String(talk.slug))}/content${query}`, 'POST');
577
+ const whole = !options.outline && options.from === undefined && options.to === undefined;
578
+ const content = whole ? null : contentShape.parse(raw);
579
+ // A range keeps the chapters, so an agent still sees where it is in the talk
580
+ const result = content === null
581
+ ? raw
582
+ : options.outline
583
+ ? { ...content, transcript: undefined, transcriptSegments: content.transcript.length }
584
+ : { ...content, transcript: content.transcript.filter(segment => segment.startMs >= from && segment.startMs < to) };
555
585
  // After the transcript: talks like this one, or saving it if the user found it useful
556
586
  console.error(`Next: similar talks — ${launcher} talks similar ${talk.slug}; save it if the user asks — ${launcher} favorites add ${talk.slug}`);
557
587
  return result;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giftsofprometheus/cli",
3
- "version": "0.6.1",
3
+ "version": "0.7.1",
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",
@@ -39,14 +39,23 @@ giftsofprometheus --json talks search 'agent evaluation' # published talks by
39
39
  giftsofprometheus --json talks list --page 2 # the whole catalog, page by page
40
40
  giftsofprometheus --json talks get <slug-or-id> # one talk: summary, speakers, topics, publication
41
41
  giftsofprometheus --json talks content <slug-or-id> # full transcript, requires login
42
+ giftsofprometheus --json talks content <slug> --outline # speakers and chapters, no transcript
43
+ giftsofprometheus --json talks content <slug> --from 12:30 --to 18:00 # one stretch of the transcript
42
44
  giftsofprometheus --json talks similar <slug-or-id> # up to four similar talks with a reason each
43
45
  giftsofprometheus --json feed # personal recommendations, requires login
44
46
  giftsofprometheus --json favorites list # saved talks, requires login
45
47
  giftsofprometheus --json profile get # interests and current task, requires login
46
48
  ```
47
49
 
48
- - For questions about what speakers say, use `ask` with 2–3 formulations: English, Chinese and the original language. For names, titles, topics and conferences use `talks search`.
49
- - Open a found transcript with `talks content <slug> --rec-id <recId>` from the `ask` response. Summarize positions of different speakers and give the passage `url` links with timecodes.
50
+ - For questions about what speakers say, use `ask`. It takes at most three formulations in total: the query and up to two `--q`, for example English, Chinese and the user's language. For names, titles, topics and conferences use `talks search`.
51
+ - Open a found transcript with `talks content <slug> --rec-id <recId>` from the `ask` response. To read around a passage, take `--outline` for the chapters, then `--from`/`--to` for the stretch you need instead of the whole transcript. Summarize positions of different speakers and give links with timecodes.
52
+ - A link to a moment is the talk `url` with `t` set to the second where the cited words start in the transcript segment, not the start of the `ask` passage. Keep the `recId` in every link.
53
+ - Each speaker has `organization` and `jobTitle` (`null` when unknown). Name a person's company only from these fields, never guess it. In a talk with several speakers, attribute a claim to a person only when the transcript makes clear who says it; otherwise attribute it to the talk. A company named in a title or a summary may be a customer or the subject of the talk, not the speaker's employer.
54
+ - Practice questions ("how to review / roll out / test / organize X", "how does the industry do X") are answered with how teams that run X in production do it, not with your own recipe:
55
+ - Queries for `ask` (the query and up to two `--q`): the core of the question in English; a first-person wording the way practitioners speak, such as `how we <do X> in production at our company`; lessons and failures, such as `lessons learned rolling out <X>`.
56
+ - Lead with companies that describe their own production practice; mark vendors presenting their product (the speaker works at the company that sells the tool) as vendors. Say plainly when the evidence is mostly vendor talks.
57
+ - Structure the answer by company: what they did, how it works, numbers from the talk, a link to the moment. End with a couple of lines on what they have in common, without "the right way" in your own voice.
58
+ - Do not apply this to "how to install / run / configure a specific tool", "what is X", or a search for a particular talk or speaker.
50
59
  - If `ask` fails with code `passages_unavailable`, use `talks search`.
51
60
  - Lists are paginated: check `totalPages` and pass `--page`.
52
61
  - Search and use the returned `slug` or `id` for exact reads.
@@ -63,5 +63,15 @@
63
63
  "version": "0.6.1",
64
64
  "hash": "fd663594e9d37fd3",
65
65
  "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."
66
+ },
67
+ {
68
+ "version": "0.7.0",
69
+ "hash": "ab66d3c17c52874a",
70
+ "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."
71
+ },
72
+ {
73
+ "version": "0.7.1",
74
+ "hash": "a16baed938e9e2a6",
75
+ "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."
66
76
  }
67
77
  ]