@promptbook/cli 0.114.0-0 → 0.114.0-2
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 +16 -15
- package/apps/agents-server/package.json +6 -4
- package/apps/agents-server/playwright.config.ts +28 -38
- package/apps/agents-server/scripts/build-agents-server.js +62 -0
- package/apps/agents-server/scripts/build-e2e.js +38 -0
- package/apps/agents-server/scripts/ensure-root-dependencies.js +86 -0
- package/apps/agents-server/scripts/prerender-homepage.js +1 -1
- package/apps/agents-server/scripts/run-e2e-tests.js +34 -0
- package/apps/agents-server/scripts/run-npm.js +42 -0
- package/apps/agents-server/src/app/admin/email-server/page.tsx +14 -6
- package/apps/agents-server/src/app/api/elevenlabs/tts/route.ts +3 -3
- package/apps/agents-server/src/app/api/onboarding/book/route.ts +7 -6
- package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +105 -102
- package/apps/agents-server/src/app/superadmin/servers/useServersRegistryState.ts +15 -7
- package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +11 -11
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ManGoBookEditor.tsx +82 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/WizardShell.tsx +2 -2
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/BookStep.tsx +13 -16
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/ZadaniStep.tsx +4 -4
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/config/bookSections.ts +23 -16
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/lib/bookSource.ts +54 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/bookService.ts +15 -8
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoAgentSource.ts +3 -37
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoOpenEditorRequest.ts +1 -1
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/OnboardingProvider.tsx +2 -2
- package/apps/agents-server/src/components/UsersList/CreateUserDialog.tsx +13 -22
- package/apps/agents-server/src/components/UsersList/PasswordGeneratorDialog.tsx +216 -0
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +16 -11
- package/apps/agents-server/src/components/UsersList/generateSecurePassword.ts +112 -24
- package/apps/agents-server/src/components/UsersList/userDialogClassNames.ts +11 -0
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +11 -0
- package/apps/agents-server/src/languages/translations/czech.yaml +11 -0
- package/apps/agents-server/src/languages/translations/english.yaml +11 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +11 -0
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectDnsRecords.ts +53 -7
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +37 -27
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +2 -13
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime.ts +21 -73
- package/apps/agents-server/src/utils/stalwart/createEmailDnsInstructions.ts +9 -5
- package/apps/agents-server/src/utils/stalwart/readStalwartEmailSnapshot.ts +23 -5
- package/apps/agents-server/src/utils/stalwart/stalwartBootstrap.ts +2 -1
- package/apps/agents-server/src/utils/stalwart/stalwartMailBridge.ts +7 -0
- package/apps/agents-server/tests/e2e/e2eEnvironment.cjs +49 -0
- package/esm/index.es.js +523 -169
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-chat/runCoderPing.d.ts +48 -0
- package/esm/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +16 -0
- package/esm/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -2
- package/esm/scripts/run-codex-prompts/testing/runTestBefore.d.ts +24 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -0
- package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/esm/src/cli/cli-commands/coder/ping.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/package.json +1 -1
- package/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.ts +1 -15
- package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +1 -2
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +92 -32
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +16 -39
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +16 -36
- package/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.ts +9 -1
- package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +4 -51
- package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +291 -4
- package/src/book-components/Chat/utils/renderMarkdown.ts +133 -9
- package/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.ts +1 -0
- package/src/cli/cli-commands/coder/agentCodingFile.ts +6 -129
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +1 -1
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +1 -4
- package/src/cli/cli-commands/coder/ping.ts +94 -0
- package/src/cli/cli-commands/coder/run.ts +25 -2
- package/src/cli/cli-commands/coder.ts +4 -0
- package/src/other/templates/getTemplatesPipelineCollection.ts +805 -842
- package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +101 -0
- package/src/version.ts +1 -1
- package/src/versions.txt +1 -1
- package/umd/index.umd.js +525 -171
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-chat/runCoderPing.d.ts +48 -0
- package/umd/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +16 -0
- package/umd/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -2
- package/umd/scripts/run-codex-prompts/testing/runTestBefore.d.ts +24 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -0
- package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/umd/src/cli/cli-commands/coder/ping.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/apps/agents-server/src/app/api/onboarding/draft/route.ts +0 -23
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/BookLanguagePanel.tsx +0 -125
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownBookEditor.tsx +0 -154
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownPreview.tsx +0 -188
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/draftService.ts +0 -32
|
@@ -19,9 +19,7 @@ export const czechBookLanguageManualDictionary: BookLanguageManualDictionary = {
|
|
|
19
19
|
metadataLabels: {
|
|
20
20
|
bookLanguageVersion: 'Verze jazyka Book',
|
|
21
21
|
generatedAt: 'Vygenerováno',
|
|
22
|
-
|
|
23
|
-
implementedCommitments: 'Hotových commitmentů',
|
|
24
|
-
placeholderCommitments: 'Připravovaných commitmentů',
|
|
22
|
+
commitmentCount: 'Počet commitmentů',
|
|
25
23
|
},
|
|
26
24
|
tableOfContentsTitle: 'Obsah',
|
|
27
25
|
chapters: {
|
|
@@ -83,15 +81,7 @@ export const czechBookLanguageManualDictionary: BookLanguageManualDictionary = {
|
|
|
83
81
|
commitmentCatalog: {
|
|
84
82
|
title: 'Katalog commitmentů',
|
|
85
83
|
body: spaceTrim(`
|
|
86
|
-
|
|
87
|
-
U každé skupiny commitmentů najdete:
|
|
88
|
-
|
|
89
|
-
- shrnutí významu (popis, ikona, stav)
|
|
90
|
-
- schéma pro parsování (\`createTypeRegex\` a \`createRegex\`)
|
|
91
|
-
- úplnou dokumentaci
|
|
92
|
-
|
|
93
|
-
Klíčová slova commitmentů jsou součástí syntaxe, a proto zůstávají anglicky.
|
|
94
|
-
Anglicky zůstávají i jejich referenční popisy, které jsou závaznou specifikací jazyka.
|
|
84
|
+
Každá sekce commitmentu vysvětluje jeho účel, důležité podrobnosti a ukazuje soustředěný příklad.
|
|
95
85
|
`),
|
|
96
86
|
},
|
|
97
87
|
examples: {
|
|
@@ -178,41 +168,28 @@ export const czechBookLanguageManualDictionary: BookLanguageManualDictionary = {
|
|
|
178
168
|
První neprázdný řádek, který není klíčovým slovem commitmentu.
|
|
179
169
|
2. **Blok commitmentu**:
|
|
180
170
|
Začíná klíčovým slovem commitmentu a pokračuje až k dalšímu commitmentu nebo oddělovači.
|
|
181
|
-
3. **
|
|
182
|
-
Řádky jako \`---\`
|
|
171
|
+
3. **Více agentů**:
|
|
172
|
+
Řádky jako \`---\` oddělují agenty definované ve stejném zdroji Booku.
|
|
183
173
|
4. **Bloky kódu**:
|
|
184
|
-
|
|
185
|
-
5. **Parametry**:
|
|
186
|
-
Podporovaný a rozpoznávaný je zápis \`@parametr\` i \`{parametr}\`.
|
|
174
|
+
Začínají a končí pomocí <code>\`\`\`</code>; jejich obsah zůstává uvnitř commitmentu zachovaný a hodí se pro ukázky a instrukce.
|
|
187
175
|
`),
|
|
188
176
|
},
|
|
189
177
|
references: {
|
|
190
178
|
title: 'Odkazy a zástupní agenti',
|
|
191
179
|
body: spaceTrim(`
|
|
192
|
-
-
|
|
180
|
+
- \`@Foo\` a \`{Foo foo}\` odkazují na jiného agenta; nejde o zápis parametrů.
|
|
181
|
+
- Zkrácené odkazy jako \`@Jméno agenta\` a \`{Jméno agenta}\` vyhodnocuje resolver odkazů v Agents Serveru.
|
|
193
182
|
- V příslušných commitmentech lze použít i zástupné agenty (například \`{User}\` nebo \`{Void}\`).
|
|
194
183
|
- \`{User}\` je určený pro \`TEAM\`; \`{Void}\` se hodí pro výslovné zrušení dědičnosti.
|
|
195
184
|
`),
|
|
196
185
|
},
|
|
197
|
-
keywordsTitle: 'Aktuálně rozpoznávaná klíčová slova commitmentů',
|
|
198
186
|
},
|
|
199
187
|
commitmentCatalogTitleSuffixes: {
|
|
200
188
|
usedFirst: ' (nejdřív používané commitmenty)',
|
|
201
189
|
all: ' (všechny commitmenty)',
|
|
202
190
|
},
|
|
203
191
|
commitmentLabels: {
|
|
204
|
-
status: 'Stav',
|
|
205
192
|
aliases: 'Varianty zápisu',
|
|
206
|
-
semantics: 'Význam',
|
|
207
|
-
typeSchema: 'Schéma klíčového slova',
|
|
208
|
-
blockSchema: 'Schéma bloku',
|
|
209
|
-
lowLevelNotice: 'Nízkoúrovňový commitment',
|
|
210
|
-
usage: 'Použití u vybraných agentů',
|
|
211
|
-
usageOccurrence: 'výskyt',
|
|
212
|
-
usageOccurrences: 'výskytů',
|
|
213
|
-
statusImplemented: 'Hotovo',
|
|
214
|
-
statusPlaceholder: 'Připravuje se (zatím není plně hotové)',
|
|
215
|
-
noAliases: 'Žádné',
|
|
216
193
|
},
|
|
217
194
|
exampleLabels: {
|
|
218
195
|
commitmentsUsed: 'Použité commitmenty',
|
|
@@ -262,14 +239,14 @@ export const czechBookLanguageManualDictionary: BookLanguageManualDictionary = {
|
|
|
262
239
|
'Hodí se pro asistenty, kteří si musí držet kontext v čase.',
|
|
263
240
|
],
|
|
264
241
|
},
|
|
265
|
-
'use-project-
|
|
266
|
-
title: 'Napojení na projekt (USE PROJECT)
|
|
267
|
-
goal: 'Pracovat s
|
|
242
|
+
'use-project-integration-agent': {
|
|
243
|
+
title: 'Napojení na projekt (USE PROJECT)',
|
|
244
|
+
goal: 'Pracovat s repozitářem na GitHubu přes připojení projektu.',
|
|
268
245
|
walkthrough: [
|
|
269
246
|
'`USE PROJECT` zapne nástroje pro výpis, čtení a úpravy souborů a pro zakládání pull requestů.',
|
|
270
247
|
'Přihlašovací údaje se v Agents Serveru za běhu načtou ze záznamů v peněžence.',
|
|
271
|
-
'
|
|
272
|
-
'
|
|
248
|
+
'Agent má také výslovná pravidla pro bezpečné úpravy a práci s přihlašovacími údaji.',
|
|
249
|
+
'Tento vzor použijte, když agent potřebuje soustředěný přístup k repozitáři.',
|
|
273
250
|
],
|
|
274
251
|
},
|
|
275
252
|
'use-calendar-integration-agent': {
|
|
@@ -340,10 +317,10 @@ export const czechBookLanguageManualDictionary: BookLanguageManualDictionary = {
|
|
|
340
317
|
footer: {
|
|
341
318
|
title: 'Vygenerováno z:',
|
|
342
319
|
body: spaceTrim(`
|
|
343
|
-
- Registru commitmentů a běhové dokumentace
|
|
344
|
-
-
|
|
345
|
-
- Vyhodnocení odkazů a dědičnosti v Agents Serveru
|
|
346
|
-
- Zdrojových
|
|
320
|
+
- [Registru commitmentů a běhové dokumentace](https://github.com/webgptorg/promptbook/tree/main/src/commitments)
|
|
321
|
+
- [Parseru jazyka Book a práce se zdrojem](https://github.com/webgptorg/promptbook/tree/main/src/book-2.0/agent-source)
|
|
322
|
+
- [Vyhodnocení odkazů a dědičnosti v Agents Serveru](https://github.com/webgptorg/promptbook/tree/main/apps/agents-server/src/utils)
|
|
323
|
+
- [Zdrojových kódů samostatné příručky](https://github.com/webgptorg/promptbook/tree/main/src/book-2.0/book-language-documentation)
|
|
347
324
|
`),
|
|
348
325
|
},
|
|
349
326
|
};
|
|
@@ -19,9 +19,7 @@ export const englishBookLanguageManualDictionary: BookLanguageManualDictionary =
|
|
|
19
19
|
metadataLabels: {
|
|
20
20
|
bookLanguageVersion: 'Book language version',
|
|
21
21
|
generatedAt: 'Generated at',
|
|
22
|
-
|
|
23
|
-
implementedCommitments: 'Implemented commitments',
|
|
24
|
-
placeholderCommitments: 'Placeholder commitments',
|
|
22
|
+
commitmentCount: 'Number of commitments',
|
|
25
23
|
},
|
|
26
24
|
tableOfContentsTitle: 'Table of Contents',
|
|
27
25
|
chapters: {
|
|
@@ -83,12 +81,7 @@ export const englishBookLanguageManualDictionary: BookLanguageManualDictionary =
|
|
|
83
81
|
commitmentCatalog: {
|
|
84
82
|
title: 'Commitment catalog',
|
|
85
83
|
body: spaceTrim(`
|
|
86
|
-
|
|
87
|
-
For each commitment group you get:
|
|
88
|
-
|
|
89
|
-
- semantics summary (description/icon/status)
|
|
90
|
-
- parsing schema (\`createTypeRegex\` and \`createRegex\`)
|
|
91
|
-
- canonical documentation block
|
|
84
|
+
Each commitment section explains its purpose, important details, and a focused example.
|
|
92
85
|
`),
|
|
93
86
|
},
|
|
94
87
|
examples: {
|
|
@@ -175,41 +168,28 @@ export const englishBookLanguageManualDictionary: BookLanguageManualDictionary =
|
|
|
175
168
|
First non-empty line that is not a commitment keyword.
|
|
176
169
|
2. **Commitment block**:
|
|
177
170
|
Starts with a commitment keyword and continues until the next commitment block or separator.
|
|
178
|
-
3. **
|
|
179
|
-
Lines like \`---\`
|
|
171
|
+
3. **Multiple agent**:
|
|
172
|
+
Lines like \`---\` separate agents defined in the same Book source.
|
|
180
173
|
4. **Code fences**:
|
|
181
|
-
|
|
182
|
-
5. **Parameters**:
|
|
183
|
-
Both \`@parameter\` and \`{parameter}\` notations are supported and parsed.
|
|
174
|
+
Start and end with <code>\`\`\`</code>; their content is preserved inside commitments and is useful for examples and instructions.
|
|
184
175
|
`),
|
|
185
176
|
},
|
|
186
177
|
references: {
|
|
187
178
|
title: 'Reference tokens and pseudo-agents',
|
|
188
179
|
body: spaceTrim(`
|
|
189
|
-
-
|
|
180
|
+
- \`@Foo\` and \`{Foo foo}\` reference another agent; they are not parameter notation.
|
|
181
|
+
- Compact references like \`@Agent Name\` and \`{Agent Name}\` are resolved by the Agents Server reference resolver.
|
|
190
182
|
- Pseudo-agent forms (for example \`{User}\`, \`{Void}\`) are supported in relevant commitments.
|
|
191
183
|
- \`{User}\` is intended for \`TEAM\`; \`{Void}\` is useful for explicit no-parent inheritance.
|
|
192
184
|
`),
|
|
193
185
|
},
|
|
194
|
-
keywordsTitle: 'Commitment keywords currently recognized',
|
|
195
186
|
},
|
|
196
187
|
commitmentCatalogTitleSuffixes: {
|
|
197
188
|
usedFirst: ' (used commitments first)',
|
|
198
189
|
all: ' (all commitments)',
|
|
199
190
|
},
|
|
200
191
|
commitmentLabels: {
|
|
201
|
-
status: 'Status',
|
|
202
192
|
aliases: 'Aliases',
|
|
203
|
-
semantics: 'Semantics',
|
|
204
|
-
typeSchema: 'Type schema',
|
|
205
|
-
blockSchema: 'Block schema',
|
|
206
|
-
lowLevelNotice: 'Low-level commitment',
|
|
207
|
-
usage: 'Used in selected agents',
|
|
208
|
-
usageOccurrence: 'occurrence',
|
|
209
|
-
usageOccurrences: 'occurrences',
|
|
210
|
-
statusImplemented: 'Implemented',
|
|
211
|
-
statusPlaceholder: 'Placeholder (not fully implemented)',
|
|
212
|
-
noAliases: 'None',
|
|
213
193
|
},
|
|
214
194
|
exampleLabels: {
|
|
215
195
|
commitmentsUsed: 'Commitments used',
|
|
@@ -259,14 +239,14 @@ export const englishBookLanguageManualDictionary: BookLanguageManualDictionary =
|
|
|
259
239
|
'Use this for assistants that must preserve context over time.',
|
|
260
240
|
],
|
|
261
241
|
},
|
|
262
|
-
'use-project-
|
|
263
|
-
title: 'USE PROJECT
|
|
264
|
-
goal: 'Work with GitHub
|
|
242
|
+
'use-project-integration-agent': {
|
|
243
|
+
title: 'USE PROJECT external integration',
|
|
244
|
+
goal: 'Work with a GitHub repository through a connected project integration.',
|
|
265
245
|
walkthrough: [
|
|
266
246
|
'`USE PROJECT` enables repository tools for listing, reading, editing files, and creating PRs.',
|
|
267
247
|
'Credentials are resolved from wallet records at runtime in Agents Server.',
|
|
268
|
-
'
|
|
269
|
-
'
|
|
248
|
+
'The agent also defines explicit rules for safe editing and credential handling.',
|
|
249
|
+
'Use this pattern when an agent needs focused repository access.',
|
|
270
250
|
],
|
|
271
251
|
},
|
|
272
252
|
'use-calendar-integration-agent': {
|
|
@@ -337,10 +317,10 @@ export const englishBookLanguageManualDictionary: BookLanguageManualDictionary =
|
|
|
337
317
|
footer: {
|
|
338
318
|
title: 'Generated from:',
|
|
339
319
|
body: spaceTrim(`
|
|
340
|
-
- Commitments registry and runtime
|
|
341
|
-
-
|
|
342
|
-
- Agents Server reference
|
|
343
|
-
- Standalone
|
|
320
|
+
- [Commitments registry and runtime documentation](https://github.com/webgptorg/promptbook/tree/main/src/commitments)
|
|
321
|
+
- [Book language parser and source handling](https://github.com/webgptorg/promptbook/tree/main/src/book-2.0/agent-source)
|
|
322
|
+
- [Agents Server reference and inheritance resolution](https://github.com/webgptorg/promptbook/tree/main/apps/agents-server/src/utils)
|
|
323
|
+
- [Standalone manual source](https://github.com/webgptorg/promptbook/tree/main/src/book-2.0/book-language-documentation)
|
|
344
324
|
`),
|
|
345
325
|
},
|
|
346
326
|
};
|
|
@@ -3,6 +3,7 @@ import {
|
|
|
3
3
|
isLowVisibilityCommitmentNotice,
|
|
4
4
|
} from '../../commitments/_common/getCommitmentNoticeMetadata';
|
|
5
5
|
import { getGroupedCommitmentDefinitions } from '../../commitments/_common/getGroupedCommitmentDefinitions';
|
|
6
|
+
import { NotYetImplementedCommitmentDefinition } from '../../commitments/_base/NotYetImplementedCommitmentDefinition';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* One grouped commitment definition as returned by the runtime registry.
|
|
@@ -23,7 +24,7 @@ export type BookLanguageManualCommitmentGroups = {
|
|
|
23
24
|
readonly documented: ReadonlyArray<BookLanguageManualCommitmentGroup>;
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
* Low-level
|
|
27
|
+
* Low-level commitments documented in their own closing chapter.
|
|
27
28
|
*/
|
|
28
29
|
readonly lowLevel: ReadonlyArray<BookLanguageManualCommitmentGroup>;
|
|
29
30
|
};
|
|
@@ -49,6 +50,13 @@ export function getBookLanguageManualCommitmentGroups(): BookLanguageManualCommi
|
|
|
49
50
|
continue;
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
if (
|
|
54
|
+
groupedCommitment.primary instanceof NotYetImplementedCommitmentDefinition ||
|
|
55
|
+
groupedCommitment.primary.isUnfinished
|
|
56
|
+
) {
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
|
|
52
60
|
if (isLowVisibilityCommitmentNotice(notice)) {
|
|
53
61
|
lowLevel.push(groupedCommitment);
|
|
54
62
|
continue;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { spaceTrim } from 'spacetrim';
|
|
2
|
-
import { NotYetImplementedCommitmentDefinition } from '../../commitments/_base/NotYetImplementedCommitmentDefinition';
|
|
3
|
-
import {
|
|
4
|
-
formatCommitmentReplacementText,
|
|
5
|
-
getCommitmentNoticeMetadata,
|
|
6
|
-
} from '../../commitments/_common/getCommitmentNoticeMetadata';
|
|
7
2
|
import type { BookLanguageManualDictionary } from './BookLanguageManualDictionary';
|
|
8
3
|
import type { BookLanguageManualCommitmentGroup } from './getBookLanguageManualCommitmentGroups';
|
|
9
4
|
import { renderGroupedCommitmentDocumentationMarkdown } from './renderGroupedCommitmentDocumentationMarkdown';
|
|
@@ -30,11 +25,6 @@ export type RenderCommitmentCatalogSectionOptions = {
|
|
|
30
25
|
*/
|
|
31
26
|
readonly groupedCommitment: BookLanguageManualCommitmentGroup;
|
|
32
27
|
|
|
33
|
-
/**
|
|
34
|
-
* Number of uses across the selected server agents.
|
|
35
|
-
*/
|
|
36
|
-
readonly usageCount: number;
|
|
37
|
-
|
|
38
28
|
/**
|
|
39
29
|
* Translated labels of the manual.
|
|
40
30
|
*/
|
|
@@ -50,42 +40,17 @@ export type RenderCommitmentCatalogSectionOptions = {
|
|
|
50
40
|
* @private internal utility of `createStandaloneBookLanguageMarkdown`
|
|
51
41
|
*/
|
|
52
42
|
export function renderCommitmentCatalogSection(options: RenderCommitmentCatalogSectionOptions): string {
|
|
53
|
-
const { groupedCommitment,
|
|
43
|
+
const { groupedCommitment, dictionary } = options;
|
|
54
44
|
const { primary, aliases } = groupedCommitment;
|
|
55
45
|
const labels = dictionary.commitmentLabels;
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
primary instanceof NotYetImplementedCommitmentDefinition
|
|
59
|
-
? labels.statusPlaceholder
|
|
60
|
-
: notice
|
|
61
|
-
? `${labels.statusImplemented} (${notice.detailLabel})`
|
|
62
|
-
: labels.statusImplemented;
|
|
63
|
-
const aliasText = aliases.length === 0 ? labels.noAliases : aliases.map((alias) => `\`${alias}\``).join(', ');
|
|
64
|
-
const noticeText = notice
|
|
65
|
-
? notice.kind === 'deprecated'
|
|
66
|
-
? `- **${notice.detailLabel}:** ${notice.message}${formatCommitmentReplacementText(
|
|
67
|
-
primary.deprecation?.replacedBy,
|
|
68
|
-
)}`
|
|
69
|
-
: `- **${labels.lowLevelNotice}:** ${notice.message}`
|
|
70
|
-
: '';
|
|
71
|
-
const usageMarkdown =
|
|
72
|
-
usageCount > 0
|
|
73
|
-
? `- **${labels.usage}:** ${usageCount} ${
|
|
74
|
-
usageCount === 1 ? labels.usageOccurrence : labels.usageOccurrences
|
|
75
|
-
}`
|
|
76
|
-
: '';
|
|
46
|
+
const aliasesMarkdown =
|
|
47
|
+
aliases.length === 0 ? '' : `- **${labels.aliases}:** ${aliases.map((alias) => `\`${alias}\``).join(', ')}`;
|
|
77
48
|
|
|
78
49
|
return spaceTrim(
|
|
79
50
|
(block) => `
|
|
80
51
|
### <a id="commitment-${toStableAnchorId(primary.type)}"></a>${primary.icon} ${primary.type}
|
|
81
52
|
|
|
82
|
-
|
|
83
|
-
- **${labels.aliases}:** ${aliasText}
|
|
84
|
-
- **${labels.semantics}:** ${primary.description}
|
|
85
|
-
- **${labels.typeSchema} (\`createTypeRegex\`):** \`${stringifyRegex(primary.createTypeRegex())}\`
|
|
86
|
-
- **${labels.blockSchema} (\`createRegex\`):** \`${stringifyRegex(primary.createRegex())}\`
|
|
87
|
-
${noticeText}
|
|
88
|
-
${usageMarkdown}
|
|
53
|
+
${aliasesMarkdown}
|
|
89
54
|
|
|
90
55
|
${block(
|
|
91
56
|
renderGroupedCommitmentDocumentationMarkdown(
|
|
@@ -96,15 +61,3 @@ export function renderCommitmentCatalogSection(options: RenderCommitmentCatalogS
|
|
|
96
61
|
`,
|
|
97
62
|
);
|
|
98
63
|
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Converts a regular expression into a concise literal-like string.
|
|
102
|
-
*
|
|
103
|
-
* @param regex - Regex instance.
|
|
104
|
-
* @returns Printable regex pattern and flags.
|
|
105
|
-
*
|
|
106
|
-
* @private internal utility of `renderCommitmentCatalogSection`
|
|
107
|
-
*/
|
|
108
|
-
function stringifyRegex(regex: RegExp): string {
|
|
109
|
-
return `/${regex.source}/${regex.flags}`;
|
|
110
|
-
}
|