@giftsofprometheus/cli 0.6.0 → 0.7.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/README.md +2 -2
- package/dist/index.js +39 -9
- package/package.json +1 -1
- package/skills/giftsofprometheus/SKILL.md +14 -5
- package/skills/history.json +12 -2
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
|
|
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 =
|
|
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
|
|
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,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: giftsofprometheus
|
|
3
3
|
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.
|
|
4
|
-
allowed-tools: Bash(giftsofprometheus:*), Bash(npx -y @giftsofprometheus/cli:*)
|
|
4
|
+
allowed-tools: Bash(giftsofprometheus:*), Bash(npx -y @giftsofprometheus/cli:*), Bash(pnpm dlx @giftsofprometheus/cli:*), Bash(bunx @giftsofprometheus/cli:*)
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# Gifts of Prometheus
|
|
@@ -10,7 +10,11 @@ allowed-tools: Bash(giftsofprometheus:*), Bash(npx -y @giftsofprometheus/cli:*)
|
|
|
10
10
|
|
|
11
11
|
## Setup
|
|
12
12
|
|
|
13
|
-
Run `command -v giftsofprometheus`. If it is missing, run every command below as `npx -y @giftsofprometheus/cli` with the same arguments instead of `giftsofprometheus`, and mention once that a permanent install is described in https://github.com/timurkhakhalev/giftsofprometheus-cli#install.
|
|
13
|
+
Run `command -v giftsofprometheus`. If it is missing, run every command below as `npx -y @giftsofprometheus/cli` with the same arguments instead of `giftsofprometheus`, and mention once that a permanent install is described in https://github.com/timurkhakhalev/giftsofprometheus-cli#install. If `npx` is missing or disabled, use `pnpm dlx @giftsofprometheus/cli` or `bunx @giftsofprometheus/cli`. If none of them runs, ask the user to install the CLI and stop.
|
|
14
|
+
|
|
15
|
+
Use only the CLI. Do not call the site's API with `curl`, `fetch` or a script, even for public data: the service refuses any client other than the site and the CLI with `cli_required`, and its rules on `recId`, sign-in and feedback live in the CLI and this skill. For a path that no command covers, use `request` (see Read).
|
|
16
|
+
|
|
17
|
+
Then run `giftsofprometheus --json doctor`:
|
|
14
18
|
|
|
15
19
|
- `reachable: false`: the service is unavailable; report it and stop.
|
|
16
20
|
- `authenticated: false`: search, talk metadata and onboarding still work. Sign in only when a command needs it (see Sign in).
|
|
@@ -35,14 +39,19 @@ giftsofprometheus --json talks search 'agent evaluation' # published talks by
|
|
|
35
39
|
giftsofprometheus --json talks list --page 2 # the whole catalog, page by page
|
|
36
40
|
giftsofprometheus --json talks get <slug-or-id> # one talk: summary, speakers, topics, publication
|
|
37
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
|
|
38
44
|
giftsofprometheus --json talks similar <slug-or-id> # up to four similar talks with a reason each
|
|
39
45
|
giftsofprometheus --json feed # personal recommendations, requires login
|
|
40
46
|
giftsofprometheus --json favorites list # saved talks, requires login
|
|
41
47
|
giftsofprometheus --json profile get # interests and current task, requires login
|
|
42
48
|
```
|
|
43
49
|
|
|
44
|
-
- For questions about what speakers say, use `ask
|
|
45
|
-
- Open a found transcript with `talks content <slug> --rec-id <recId>` from the `ask` response. Summarize positions of different speakers and give
|
|
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
|
+
- For "how does the industry do X" questions, separate companies that describe their own production practice from vendors presenting their product (the speaker works at the company that sells the tool). Lead with the first; say plainly when the evidence is mostly vendor talks.
|
|
46
55
|
- If `ask` fails with code `passages_unavailable`, use `talks search`.
|
|
47
56
|
- Lists are paginated: check `totalPages` and pass `--page`.
|
|
48
57
|
- Search and use the returned `slug` or `id` for exact reads.
|
|
@@ -112,6 +121,6 @@ giftsofprometheus --json profile update --interest agents=high --remove-interest
|
|
|
112
121
|
|
|
113
122
|
## Errors
|
|
114
123
|
|
|
115
|
-
With `--json` a failure prints `{"error":{"message","status","code","nextStep"}}` and exits with code 1. `code` and `nextStep` are present when the service sent them: decide by `code` (for example `talk_not_found`, `unknown_recommendation`, `rate_limited`), follow `nextStep`, and show `message` to the user as it is. Status 401 means the session is missing, expired or revoked: sign in as described in Sign in and repeat the command.
|
|
124
|
+
With `--json` a failure prints `{"error":{"message","status","code","nextStep"}}` and exits with code 1. `code` and `nextStep` are present when the service sent them: decide by `code` (for example `talk_not_found`, `unknown_recommendation`, `rate_limited`), follow `nextStep`, and show `message` to the user as it is. Status 401 means the session is missing, expired or revoked: sign in as described in Sign in and repeat the command. Code `cli_required` means the request did not come from the CLI: run the command through the CLI as described in Setup.
|
|
116
125
|
|
|
117
126
|
The CLI repeats a request twice by itself after a connection failure or a 502, 503 or 504 from the proxy. If it still fails with "The service is temporarily unavailable" or "The service is unreachable", tell the user in one line, wait a minute and try once more before you stop.
|
package/skills/history.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
},
|
|
7
7
|
{
|
|
8
8
|
"version": "0.1.1",
|
|
9
|
-
"hash": "
|
|
9
|
+
"hash": "02e931c7faedd75f",
|
|
10
10
|
"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. 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."
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
13
|
"version": "0.1.2",
|
|
14
|
-
"hash": "
|
|
14
|
+
"hash": "02e931c7faedd75f",
|
|
15
15
|
"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. 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."
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -58,5 +58,15 @@
|
|
|
58
58
|
"version": "0.6.0",
|
|
59
59
|
"hash": "04c1f4fd0b948e24",
|
|
60
60
|
"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."
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"version": "0.6.1",
|
|
64
|
+
"hash": "fd663594e9d37fd3",
|
|
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."
|
|
61
71
|
}
|
|
62
72
|
]
|