@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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ThinkingLevel } from '../../src/cli/cli-commands/coder/ThinkingLevel';
|
|
2
|
+
import type { PromptRunnerHarnessName } from '../../src/cli/cli-commands/common/promptRunnerCliOptions';
|
|
3
|
+
/**
|
|
4
|
+
* Options for one `ptbk coder ping` execution.
|
|
5
|
+
*/
|
|
6
|
+
export type RunCoderPingOptions = {
|
|
7
|
+
/**
|
|
8
|
+
* Harness used for the disposable turn.
|
|
9
|
+
*/
|
|
10
|
+
readonly agentName: PromptRunnerHarnessName;
|
|
11
|
+
/**
|
|
12
|
+
* Optional model passed to the harness.
|
|
13
|
+
*/
|
|
14
|
+
readonly model?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional reasoning effort passed to the harness.
|
|
17
|
+
*/
|
|
18
|
+
readonly thinkingLevel?: ThinkingLevel;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the harness should receive the shared no-UI option.
|
|
21
|
+
*/
|
|
22
|
+
readonly isUiDisabled: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Whether the harness may spend credits when its quota is exhausted.
|
|
25
|
+
*/
|
|
26
|
+
readonly isCreditsAllowed: boolean;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Result of one `ptbk coder ping` execution.
|
|
30
|
+
*/
|
|
31
|
+
export type CoderPingResult = {
|
|
32
|
+
/**
|
|
33
|
+
* Text returned by the harness after the dummy task.
|
|
34
|
+
*/
|
|
35
|
+
readonly result: string;
|
|
36
|
+
/**
|
|
37
|
+
* Time spent executing the disposable harness turn in milliseconds.
|
|
38
|
+
*/
|
|
39
|
+
readonly elapsedTimeMs: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* Runs one small harness/model turn in a disposable temporary project.
|
|
43
|
+
*
|
|
44
|
+
* The temporary project is outside the caller's repository, so even a harness
|
|
45
|
+
* that writes files cannot change the project from which `ptbk coder ping` was
|
|
46
|
+
* started.
|
|
47
|
+
*/
|
|
48
|
+
export declare function runCoderPing(options: RunCoderPingOptions): Promise<CoderPingResult>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PromptFile } from './types/PromptFile';
|
|
2
2
|
import type { PromptSelection } from './types/PromptSelection';
|
|
3
|
+
import type { PromptRunnerIdentity } from './isPromptCompatibleWithRunner';
|
|
3
4
|
import type { PriorityFilter } from './priorityFilter';
|
|
4
5
|
/**
|
|
5
6
|
* Selects the next runnable prompt based on priority.
|
|
6
7
|
*/
|
|
7
|
-
export declare function findNextTodoPrompt(files: PromptFile[], priorityFilter?: PriorityFilter): PromptSelection | undefined;
|
|
8
|
+
export declare function findNextTodoPrompt(files: PromptFile[], priorityFilter?: PriorityFilter, promptRunnerIdentity?: PromptRunnerIdentity): PromptSelection | undefined;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { PromptFile } from './types/PromptFile';
|
|
2
|
+
import type { PromptSection } from './types/PromptSection';
|
|
3
|
+
/**
|
|
4
|
+
* Names of the harness and model currently selected for a coder run.
|
|
5
|
+
*/
|
|
6
|
+
export type PromptRunnerIdentity = {
|
|
7
|
+
/**
|
|
8
|
+
* Stable harness identifier, for example `github-copilot`.
|
|
9
|
+
*/
|
|
10
|
+
readonly harnessName?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Effective model identifier, for example `gpt-5.5`.
|
|
13
|
+
*/
|
|
14
|
+
readonly modelName?: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Checks whether a prompt is unrestricted or matches the selected harness/model.
|
|
18
|
+
*
|
|
19
|
+
* A prompt status line can contain one or more backtick-delimited model or harness
|
|
20
|
+
* names. Matching is intentionally based on normalized substrings so a token such as
|
|
21
|
+
* `gpt` selects any `gpt-*` model and `opus` selects a `claude-opus-*` model.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isPromptCompatibleWithRunner(file: PromptFile, section: PromptSection, promptRunnerIdentity?: PromptRunnerIdentity): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Extracts model and harness tokens from a prompt status line.
|
|
26
|
+
*/
|
|
27
|
+
export declare function extractPromptRunnerTokens(statusLine: string): string[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PromptFile } from './types/PromptFile';
|
|
2
2
|
import type { PromptSelection } from './types/PromptSelection';
|
|
3
|
+
import { type PromptRunnerIdentity } from './isPromptCompatibleWithRunner';
|
|
3
4
|
import type { PriorityFilter } from './priorityFilter';
|
|
4
5
|
/**
|
|
5
6
|
* Lists todo prompts that are ready to run (no authoring placeholders).
|
|
6
7
|
*/
|
|
7
|
-
export declare function listRunnablePrompts(files: PromptFile[], priorityFilter?: PriorityFilter): PromptSelection[];
|
|
8
|
+
export declare function listRunnablePrompts(files: PromptFile[], priorityFilter?: PriorityFilter, promptRunnerIdentity?: PromptRunnerIdentity): PromptSelection[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { PromptFile } from './types/PromptFile';
|
|
2
2
|
import type { UpcomingTask } from './types/UpcomingTask';
|
|
3
|
+
import type { PromptRunnerIdentity } from './isPromptCompatibleWithRunner';
|
|
3
4
|
import type { PriorityFilter } from './priorityFilter';
|
|
4
5
|
/**
|
|
5
6
|
* Lists upcoming tasks that are ready to run (no authoring placeholders).
|
|
6
7
|
*/
|
|
7
|
-
export declare function listUpcomingTasks(files: PromptFile[], priorityFilter?: PriorityFilter): UpcomingTask[];
|
|
8
|
+
export declare function listUpcomingTasks(files: PromptFile[], priorityFilter?: PriorityFilter, promptRunnerIdentity?: PromptRunnerIdentity): UpcomingTask[];
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replaces the complete todo status line while preserving its indentation.
|
|
3
|
+
*
|
|
4
|
+
* The complete line is replaced because a todo status can contain a required
|
|
5
|
+
* model/harness token in addition to priority markers.
|
|
6
|
+
*/
|
|
7
|
+
export declare function replacePromptTodoStatusLine(line: string, replacementStatusLine: string): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Modes supported by `ptbk coder run --test-before`.
|
|
3
|
+
*/
|
|
4
|
+
export declare const TEST_BEFORE_MODE_VALUES: readonly ["no", "yes-and-fail", "yes-and-fix"];
|
|
5
|
+
/**
|
|
6
|
+
* Behavior requested for the pre-coding verification run.
|
|
7
|
+
*/
|
|
8
|
+
export type TestBeforeMode = (typeof TEST_BEFORE_MODE_VALUES)[number];
|
|
9
|
+
/**
|
|
10
|
+
* Default verification command used when a pre-coding mode is enabled without an explicit `--test` command.
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_CODER_TEST_COMMAND = "npm test";
|
|
13
|
+
/**
|
|
14
|
+
* Checks whether a value is a supported `--test-before` mode.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isTestBeforeMode(value: string): value is TestBeforeMode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { PromptSelection } from '../prompts/types/PromptSelection';
|
|
2
|
+
/**
|
|
3
|
+
* Creates the one queue prompt used to repair a pre-existing test failure.
|
|
4
|
+
*/
|
|
5
|
+
export declare function createTestBeforeRepairPrompt(options: {
|
|
6
|
+
readonly projectPath: string;
|
|
7
|
+
readonly testCommand: string;
|
|
8
|
+
readonly testOutput: string;
|
|
9
|
+
}): Promise<PromptSelection>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Options for running one verification command after a coding attempt.
|
|
3
3
|
*/
|
|
4
|
-
type RunPromptTestCommandOptions = {
|
|
4
|
+
export type RunPromptTestCommandOptions = {
|
|
5
5
|
command: string;
|
|
6
6
|
projectPath: string;
|
|
7
7
|
scriptPath: string;
|
|
@@ -12,4 +12,3 @@ type RunPromptTestCommandOptions = {
|
|
|
12
12
|
* Runs the configured verification command inside the project root and returns its output.
|
|
13
13
|
*/
|
|
14
14
|
export declare function runPromptTestCommand(options: RunPromptTestCommandOptions): Promise<string>;
|
|
15
|
-
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { WaitForCoderRunPauseCheckpoint } from '../common/CoderRunPauseCheckpoint';
|
|
2
|
+
import { runPromptTestCommand } from './runPromptTestCommand';
|
|
3
|
+
/**
|
|
4
|
+
* Result of the verification command executed before coding starts.
|
|
5
|
+
*/
|
|
6
|
+
export type TestBeforeResult = {
|
|
7
|
+
/**
|
|
8
|
+
* Whether the verification command completed successfully.
|
|
9
|
+
*/
|
|
10
|
+
readonly isPassed: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Combined output produced by the verification command.
|
|
13
|
+
*/
|
|
14
|
+
readonly testOutput: string;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Runs the configured verification command before the first coding prompt.
|
|
18
|
+
*/
|
|
19
|
+
export declare function runTestBefore(options: {
|
|
20
|
+
readonly testCommand: string;
|
|
21
|
+
readonly projectPath: string;
|
|
22
|
+
readonly waitForPauseCheckpoint?: WaitForCoderRunPauseCheckpoint;
|
|
23
|
+
readonly runPromptTestCommandExecutor?: typeof runPromptTestCommand;
|
|
24
|
+
}): Promise<TestBeforeResult>;
|
|
@@ -67,6 +67,7 @@ export declare function buildControlPills(options: {
|
|
|
67
67
|
* Builds the coder-run control pills shown in the footer box.
|
|
68
68
|
*/
|
|
69
69
|
export declare function buildCoderRunControlPills(options: {
|
|
70
|
+
readonly phase: CoderRunPhase;
|
|
70
71
|
readonly pauseControl: string;
|
|
71
72
|
readonly pendingEnterLabel: string | undefined;
|
|
72
73
|
readonly isEndAfterCurrentPromptRequested: boolean;
|
|
@@ -86,9 +86,7 @@ export type BookLanguageManualDictionary = {
|
|
|
86
86
|
readonly metadataLabels: {
|
|
87
87
|
readonly bookLanguageVersion: string;
|
|
88
88
|
readonly generatedAt: string;
|
|
89
|
-
readonly
|
|
90
|
-
readonly implementedCommitments: string;
|
|
91
|
-
readonly placeholderCommitments: string;
|
|
89
|
+
readonly commitmentCount: string;
|
|
92
90
|
};
|
|
93
91
|
/**
|
|
94
92
|
* Heading of the table of contents.
|
|
@@ -128,7 +126,6 @@ export type BookLanguageManualDictionary = {
|
|
|
128
126
|
readonly primitivesSections: {
|
|
129
127
|
readonly coreSyntax: BookLanguageManualChapter;
|
|
130
128
|
readonly references: BookLanguageManualChapter;
|
|
131
|
-
readonly keywordsTitle: string;
|
|
132
129
|
};
|
|
133
130
|
/**
|
|
134
131
|
* Suffixes distinguishing a server-specific catalog from the portable one.
|
|
@@ -141,18 +138,7 @@ export type BookLanguageManualDictionary = {
|
|
|
141
138
|
* Labels used in every commitment catalog entry.
|
|
142
139
|
*/
|
|
143
140
|
readonly commitmentLabels: {
|
|
144
|
-
readonly status: string;
|
|
145
141
|
readonly aliases: string;
|
|
146
|
-
readonly semantics: string;
|
|
147
|
-
readonly typeSchema: string;
|
|
148
|
-
readonly blockSchema: string;
|
|
149
|
-
readonly lowLevelNotice: string;
|
|
150
|
-
readonly usage: string;
|
|
151
|
-
readonly usageOccurrence: string;
|
|
152
|
-
readonly usageOccurrences: string;
|
|
153
|
-
readonly statusImplemented: string;
|
|
154
|
-
readonly statusPlaceholder: string;
|
|
155
|
-
readonly noAliases: string;
|
|
156
142
|
};
|
|
157
143
|
/**
|
|
158
144
|
* Labels used by end-to-end example sections.
|
package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export type BookLanguageManualCommitmentGroups = {
|
|
|
16
16
|
*/
|
|
17
17
|
readonly documented: ReadonlyArray<BookLanguageManualCommitmentGroup>;
|
|
18
18
|
/**
|
|
19
|
-
* Low-level
|
|
19
|
+
* Low-level commitments documented in their own closing chapter.
|
|
20
20
|
*/
|
|
21
21
|
readonly lowLevel: ReadonlyArray<BookLanguageManualCommitmentGroup>;
|
|
22
22
|
};
|
|
@@ -10,10 +10,6 @@ export type RenderCommitmentCatalogSectionOptions = {
|
|
|
10
10
|
* Grouped commitment definition with aliases.
|
|
11
11
|
*/
|
|
12
12
|
readonly groupedCommitment: BookLanguageManualCommitmentGroup;
|
|
13
|
-
/**
|
|
14
|
-
* Number of uses across the selected server agents.
|
|
15
|
-
*/
|
|
16
|
-
readonly usageCount: number;
|
|
17
13
|
/**
|
|
18
14
|
* Translated labels of the manual.
|
|
19
15
|
*/
|
|
@@ -25,6 +25,13 @@ export type MarkdownInlineReference = {
|
|
|
25
25
|
* Link target for the rendered reference.
|
|
26
26
|
*/
|
|
27
27
|
readonly href: string;
|
|
28
|
+
/**
|
|
29
|
+
* Markdown link destination prefixes that should render as this reference as well.
|
|
30
|
+
*
|
|
31
|
+
* This supports legacy links such as an Agents Server project file URL while keeping
|
|
32
|
+
* `reference` as the canonical `[[project]]` token.
|
|
33
|
+
*/
|
|
34
|
+
readonly sourceHrefPrefixes?: ReadonlyArray<string>;
|
|
28
35
|
/**
|
|
29
36
|
* Optional hover title for the rendered reference.
|
|
30
37
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { string_markdown } from '../../../types/typeAliases';
|
|
1
2
|
/**
|
|
2
3
|
* Relative path to the Promptbook Coder quick-reference file initialized in project roots.
|
|
3
4
|
*
|
|
@@ -9,6 +10,4 @@ export declare const AGENT_CODING_FILE_PATH = "AGENT_CODING.md";
|
|
|
9
10
|
*
|
|
10
11
|
* @private internal utility of `ptbk coder`
|
|
11
12
|
*/
|
|
12
|
-
export declare function getDefaultCoderAgentCodingFileContent(
|
|
13
|
-
readonly packageJsonScripts: Readonly<Record<string, string>>;
|
|
14
|
-
}): string;
|
|
13
|
+
export declare function getDefaultCoderAgentCodingFileContent(): string_markdown;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Command as Program } from 'commander';
|
|
2
|
+
import type { $side_effect } from '../../../utils/organization/$side_effect';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes `coder ping` command for Promptbook CLI utilities.
|
|
5
|
+
*
|
|
6
|
+
* The command makes one small, isolated harness/model call, prints its result
|
|
7
|
+
* and reports how long the harness/model turn took.
|
|
8
|
+
*
|
|
9
|
+
* Note: `$` is used to indicate that this function is not a pure function - it registers a command in the CLI.
|
|
10
|
+
*
|
|
11
|
+
* @private internal function of `promptbookCli`
|
|
12
|
+
*/
|
|
13
|
+
export declare function $initializeCoderPingCommand(program: Program): $side_effect;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,7 @@ import type { $side_effect } from '../../utils/organization/$side_effect';
|
|
|
8
8
|
* - add: Add one ready-to-run prompt file to the queue
|
|
9
9
|
* - generate-boilerplates: Generate prompt boilerplate files
|
|
10
10
|
* - find-refactor-candidates: Find files that need refactoring
|
|
11
|
+
* - ping: Test one harness and model connection with a disposable task
|
|
11
12
|
* - run: Run coding prompts with AI agents
|
|
12
13
|
* - verify: Verify completed prompts
|
|
13
14
|
* - find-fresh-emoji-tags: Find unused emoji tags
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
-
import { createManGoOnboardingApiErrorResponse } from '@/src/utils/manGoOnboarding/manGoOnboardingApiResponses';
|
|
3
|
-
import { generateManGoBookDraft } from '@/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime';
|
|
4
|
-
import { readManGoOnboardingStringProperty } from '@/src/utils/manGoOnboarding/manGoOnboardingApiRequest';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Handles `POST /api/onboarding/draft`.
|
|
8
|
-
*
|
|
9
|
-
* @param request - Incoming request with `agentName` and `agentBrief`.
|
|
10
|
-
* @returns Generated Book draft.
|
|
11
|
-
*/
|
|
12
|
-
export async function POST(request: NextRequest) {
|
|
13
|
-
try {
|
|
14
|
-
const body = await request.json();
|
|
15
|
-
const agentName = readManGoOnboardingStringProperty(body, 'agentName');
|
|
16
|
-
const agentBrief = readManGoOnboardingStringProperty(body, 'agentBrief');
|
|
17
|
-
const draft = await generateManGoBookDraft({ agentName, agentBrief });
|
|
18
|
-
|
|
19
|
-
return NextResponse.json({ draft });
|
|
20
|
-
} catch (error) {
|
|
21
|
-
return createManGoOnboardingApiErrorResponse(error);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import type { string_book } from '../../../../../../../src/book-2.0/agent-source/string_book';
|
|
6
|
-
import { BookEditor } from '../../../../../../../src/book-components/BookEditor/BookEditor';
|
|
7
|
-
import { convertToBook } from '../services/bookService';
|
|
8
|
-
import { Badge } from './ui/Badge';
|
|
9
|
-
import { Button } from './ui/Button';
|
|
10
|
-
import { Spinner } from './ui/Spinner';
|
|
11
|
-
|
|
12
|
-
type Phase = 'idle' | 'loading' | 'ready' | 'error';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Converts the editor's markdown draft into canonical Book language via the `generateBook`
|
|
16
|
-
* endpoint and shows the validated result. Optional, on-demand — keeps the free-markdown
|
|
17
|
-
* editing flow intact while exposing the "real" Book artifact.
|
|
18
|
-
*/
|
|
19
|
-
export function BookLanguagePanel({ source }: { readonly source: string }) {
|
|
20
|
-
const [phase, setPhase] = useState<Phase>('idle');
|
|
21
|
-
const [book, setBook] = useState('');
|
|
22
|
-
const [isValid, setIsValid] = useState(true);
|
|
23
|
-
const [error, setError] = useState<string | null>(null);
|
|
24
|
-
const [generatedFrom, setGeneratedFrom] = useState('');
|
|
25
|
-
const [copied, setCopied] = useState(false);
|
|
26
|
-
|
|
27
|
-
async function generate() {
|
|
28
|
-
setPhase('loading');
|
|
29
|
-
setError(null);
|
|
30
|
-
try {
|
|
31
|
-
const result = await convertToBook(source);
|
|
32
|
-
setBook(result.book);
|
|
33
|
-
setIsValid(result.isValid);
|
|
34
|
-
setGeneratedFrom(source);
|
|
35
|
-
setPhase('ready');
|
|
36
|
-
} catch (caught) {
|
|
37
|
-
setError(caught instanceof Error ? caught.message : 'Převod na Book selhal.');
|
|
38
|
-
setPhase('error');
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function copy() {
|
|
43
|
-
void navigator.clipboard?.writeText(book).then(() => {
|
|
44
|
-
setCopied(true);
|
|
45
|
-
setTimeout(() => setCopied(false), 1500);
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
const isStale = phase === 'ready' && source !== generatedFrom;
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<div className="mt-5 rounded-2xl border border-zinc-200/60 bg-white p-5 shadow-[var(--ob-shadow-sm)]">
|
|
53
|
-
<div className="flex items-center justify-between gap-3">
|
|
54
|
-
<div className="min-w-0">
|
|
55
|
-
<div className="text-sm font-semibold text-zinc-800">Book language</div>
|
|
56
|
-
<div className="mt-0.5 text-xs text-zinc-400">
|
|
57
|
-
Kanonická, validovaná podoba agenta vygenerovaná z vašeho draftu.
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
{phase === 'ready' && (
|
|
61
|
-
<Badge tone={isValid ? 'success' : 'warning'} dot>
|
|
62
|
-
{isValid ? 'Validní book' : 'Nevalidní'}
|
|
63
|
-
</Badge>
|
|
64
|
-
)}
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
{phase === 'idle' && (
|
|
68
|
-
<div className="mt-4">
|
|
69
|
-
<Button
|
|
70
|
-
variant="outline"
|
|
71
|
-
size="sm"
|
|
72
|
-
disabled={!source.trim()}
|
|
73
|
-
leadingIcon={<span aria-hidden>✨</span>}
|
|
74
|
-
onClick={() => void generate()}
|
|
75
|
-
>
|
|
76
|
-
Převést na Book language
|
|
77
|
-
</Button>
|
|
78
|
-
</div>
|
|
79
|
-
)}
|
|
80
|
-
|
|
81
|
-
{phase === 'loading' && (
|
|
82
|
-
<div className="mt-4 flex items-center gap-2 text-sm text-zinc-500">
|
|
83
|
-
<Spinner className="h-4 w-4" /> Generuji Book…
|
|
84
|
-
</div>
|
|
85
|
-
)}
|
|
86
|
-
|
|
87
|
-
{phase === 'error' && (
|
|
88
|
-
<div className="mt-4 rounded-xl border border-amber-200 bg-amber-50 px-3.5 py-2.5 text-sm text-amber-800">
|
|
89
|
-
<p>{error}</p>
|
|
90
|
-
<button
|
|
91
|
-
type="button"
|
|
92
|
-
onClick={() => void generate()}
|
|
93
|
-
className="mt-1 font-medium underline underline-offset-2"
|
|
94
|
-
>
|
|
95
|
-
Zkusit znovu
|
|
96
|
-
</button>
|
|
97
|
-
</div>
|
|
98
|
-
)}
|
|
99
|
-
|
|
100
|
-
{phase === 'ready' && (
|
|
101
|
-
<div className="mt-4">
|
|
102
|
-
<BookEditor value={book as string_book} isReadonly />
|
|
103
|
-
{isStale && (
|
|
104
|
-
<p className="mt-2 text-xs text-amber-600">
|
|
105
|
-
Draft se od převodu změnil — přegenerujte pro aktuální book.
|
|
106
|
-
</p>
|
|
107
|
-
)}
|
|
108
|
-
<div className="mt-3 flex items-center gap-2">
|
|
109
|
-
<Button
|
|
110
|
-
variant="outline"
|
|
111
|
-
size="sm"
|
|
112
|
-
leadingIcon={<span aria-hidden>↻</span>}
|
|
113
|
-
onClick={() => void generate()}
|
|
114
|
-
>
|
|
115
|
-
Přegenerovat
|
|
116
|
-
</Button>
|
|
117
|
-
<Button variant="ghost" size="sm" onClick={copy}>
|
|
118
|
-
{copied ? '✓ Zkopírováno' : 'Kopírovat'}
|
|
119
|
-
</Button>
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
)}
|
|
123
|
-
</div>
|
|
124
|
-
);
|
|
125
|
-
}
|
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useRef, useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import { BOOK_SECTION_PRESETS } from '../config/bookSections';
|
|
6
|
-
import { cn } from '../lib/cn';
|
|
7
|
-
import { MarkdownPreview } from './MarkdownPreview';
|
|
8
|
-
import { Badge } from './ui/Badge';
|
|
9
|
-
import { Spinner } from './ui/Spinner';
|
|
10
|
-
|
|
11
|
-
type MarkdownBookEditorProps = {
|
|
12
|
-
readonly value: string;
|
|
13
|
-
readonly onChange: (value: string) => void;
|
|
14
|
-
readonly onRegenerate?: () => void;
|
|
15
|
-
readonly isRegenerating?: boolean;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
type ViewMode = 'edit' | 'split' | 'preview';
|
|
19
|
-
|
|
20
|
-
const VIEW_MODES: ReadonlyArray<{ id: ViewMode; label: string; icon: string }> = [
|
|
21
|
-
{ id: 'edit', label: 'Editor', icon: '✎' },
|
|
22
|
-
{ id: 'split', label: 'Obojí', icon: '⊟' },
|
|
23
|
-
{ id: 'preview', label: 'Náhled', icon: '◳' },
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
const PANE_HEIGHT = 'h-[28rem]';
|
|
27
|
-
|
|
28
|
-
export function MarkdownBookEditor({ value, onChange, onRegenerate, isRegenerating }: MarkdownBookEditorProps) {
|
|
29
|
-
const textareaRef = useRef<HTMLTextAreaElement>(null);
|
|
30
|
-
const [mode, setMode] = useState<ViewMode>('edit');
|
|
31
|
-
|
|
32
|
-
function appendSection(markdown: string) {
|
|
33
|
-
const trimmed = value.replace(/\s+$/, '');
|
|
34
|
-
const next = trimmed ? `${trimmed}\n\n${markdown}\n` : `${markdown}\n`;
|
|
35
|
-
onChange(next);
|
|
36
|
-
|
|
37
|
-
// Make sure the new section is visible to edit.
|
|
38
|
-
if (mode === 'preview') {
|
|
39
|
-
setMode('split');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
const textarea = textareaRef.current;
|
|
43
|
-
if (textarea) {
|
|
44
|
-
textarea.focus();
|
|
45
|
-
requestAnimationFrame(() => {
|
|
46
|
-
textarea.scrollTop = textarea.scrollHeight;
|
|
47
|
-
textarea.setSelectionRange(next.length, next.length);
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const isEditorShown = mode !== 'preview';
|
|
53
|
-
const isPreviewShown = mode !== 'edit';
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div>
|
|
57
|
-
<div className="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-[var(--ob-shadow-md)] transition-shadow focus-within:shadow-[var(--ob-shadow-lg)] focus-within:ring-1 focus-within:ring-[color:var(--ob-accent-200)]">
|
|
58
|
-
<div className="flex flex-wrap items-center justify-between gap-3 border-b border-zinc-200 bg-zinc-50/80 px-4 py-2.5">
|
|
59
|
-
<span className="flex items-center gap-2 text-[13px] text-zinc-600">
|
|
60
|
-
<span aria-hidden>📄</span>
|
|
61
|
-
<strong className="font-semibold text-zinc-800">book.md</strong>
|
|
62
|
-
<span className="hidden sm:inline">
|
|
63
|
-
<Badge tone="accent">Plně editovatelný</Badge>
|
|
64
|
-
</span>
|
|
65
|
-
</span>
|
|
66
|
-
<span className="flex items-center gap-2">
|
|
67
|
-
<ViewToggle mode={mode} onChange={setMode} />
|
|
68
|
-
{onRegenerate && (
|
|
69
|
-
<button
|
|
70
|
-
type="button"
|
|
71
|
-
onClick={onRegenerate}
|
|
72
|
-
disabled={isRegenerating}
|
|
73
|
-
title="Přegenerovat ze zadání"
|
|
74
|
-
className="inline-flex items-center gap-1.5 rounded-lg px-1.5 py-1 text-xs font-medium text-zinc-500 transition-colors hover:bg-zinc-100 hover:text-[color:var(--ob-accent-700)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--ob-ring)] disabled:cursor-not-allowed disabled:opacity-50"
|
|
75
|
-
>
|
|
76
|
-
{isRegenerating ? <Spinner className="h-3.5 w-3.5" /> : <span aria-hidden>↻</span>}
|
|
77
|
-
<span className="hidden md:inline">Přegenerovat</span>
|
|
78
|
-
</button>
|
|
79
|
-
)}
|
|
80
|
-
</span>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div className={cn('grid', mode === 'split' && 'md:grid-cols-2 md:divide-x md:divide-zinc-200')}>
|
|
84
|
-
{isEditorShown && (
|
|
85
|
-
<textarea
|
|
86
|
-
ref={textareaRef}
|
|
87
|
-
value={value}
|
|
88
|
-
spellCheck={false}
|
|
89
|
-
onChange={(event) => onChange(event.target.value)}
|
|
90
|
-
aria-label="Obsah booku v markdownu"
|
|
91
|
-
className={cn(
|
|
92
|
-
'block w-full resize-none border-0 bg-white p-4 font-mono text-[13px] leading-relaxed text-zinc-800 focus:outline-none focus:ring-0',
|
|
93
|
-
mode === 'edit' ? 'min-h-[28rem] resize-y' : PANE_HEIGHT,
|
|
94
|
-
)}
|
|
95
|
-
/>
|
|
96
|
-
)}
|
|
97
|
-
{isPreviewShown && (
|
|
98
|
-
<div className={cn('overflow-y-auto bg-white p-4', mode === 'preview' ? 'min-h-[28rem]' : PANE_HEIGHT)}>
|
|
99
|
-
{value.trim() ? (
|
|
100
|
-
<MarkdownPreview source={value} />
|
|
101
|
-
) : (
|
|
102
|
-
<p className="text-sm text-zinc-400">Náhled se zobrazí, jakmile book nebude prázdný.</p>
|
|
103
|
-
)}
|
|
104
|
-
</div>
|
|
105
|
-
)}
|
|
106
|
-
</div>
|
|
107
|
-
</div>
|
|
108
|
-
|
|
109
|
-
<div className="mt-4">
|
|
110
|
-
<div className="mb-2 text-xs font-semibold text-zinc-500">Přidat předepsanou sekci:</div>
|
|
111
|
-
<div className="flex flex-wrap gap-2">
|
|
112
|
-
{BOOK_SECTION_PRESETS.map((preset) => (
|
|
113
|
-
<button
|
|
114
|
-
key={preset.key}
|
|
115
|
-
type="button"
|
|
116
|
-
onClick={() => appendSection(preset.markdown)}
|
|
117
|
-
className="inline-flex items-center gap-1 rounded-full border border-dashed border-zinc-300 bg-white px-3 py-1.5 text-xs font-medium text-zinc-500 transition-colors hover:border-[color:var(--ob-accent-400)] hover:bg-[color:var(--ob-accent-50)] hover:text-[color:var(--ob-accent-700)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--ob-ring)]"
|
|
118
|
-
>
|
|
119
|
-
+ {preset.label}
|
|
120
|
-
</button>
|
|
121
|
-
))}
|
|
122
|
-
</div>
|
|
123
|
-
</div>
|
|
124
|
-
</div>
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function ViewToggle({ mode, onChange }: { readonly mode: ViewMode; readonly onChange: (mode: ViewMode) => void }) {
|
|
129
|
-
return (
|
|
130
|
-
<div className="inline-flex rounded-lg border border-zinc-200 bg-white p-0.5" role="tablist" aria-label="Zobrazení editoru">
|
|
131
|
-
{VIEW_MODES.map((view) => {
|
|
132
|
-
const isActive = view.id === mode;
|
|
133
|
-
return (
|
|
134
|
-
<button
|
|
135
|
-
key={view.id}
|
|
136
|
-
type="button"
|
|
137
|
-
role="tab"
|
|
138
|
-
aria-selected={isActive}
|
|
139
|
-
onClick={() => onChange(view.id)}
|
|
140
|
-
className={cn(
|
|
141
|
-
'inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--ob-ring)]',
|
|
142
|
-
isActive
|
|
143
|
-
? 'bg-[color:var(--ob-accent-600)] text-white'
|
|
144
|
-
: 'text-zinc-500 hover:bg-zinc-100 hover:text-zinc-800',
|
|
145
|
-
)}
|
|
146
|
-
>
|
|
147
|
-
<span aria-hidden>{view.icon}</span>
|
|
148
|
-
<span className="hidden sm:inline">{view.label}</span>
|
|
149
|
-
</button>
|
|
150
|
-
);
|
|
151
|
-
})}
|
|
152
|
-
</div>
|
|
153
|
-
);
|
|
154
|
-
}
|