@promptbook/cli 0.112.0-71 → 0.112.0-72

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.
Files changed (53) hide show
  1. package/esm/index.es.js +3176 -2474
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/scripts/run-agent-messages/main/tickAgentMessages.d.ts +14 -0
  4. package/esm/scripts/run-agent-messages/ui/loadAgentRunUiMetadata.d.ts +12 -0
  5. package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +5 -0
  6. package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +1 -0
  7. package/esm/src/book-3.0/Book.d.ts +6 -0
  8. package/esm/src/book-components/Chat/utils/getToolCallChipletInfo.test.d.ts +1 -0
  9. package/esm/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +12 -2
  10. package/esm/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -0
  11. package/esm/src/cli/cli-commands/run/prepareRunCommandResources.d.ts +20 -0
  12. package/esm/src/cli/cli-commands/run/resolveRunInputParameters.d.ts +12 -0
  13. package/esm/src/cli/cli-commands/run/runCommandAction.d.ts +21 -0
  14. package/esm/src/cli/cli-commands/run/runPipelineExecution.d.ts +14 -0
  15. package/esm/src/cli/cli-commands/run.d.ts +1 -1
  16. package/esm/src/conversion/parsePipeline/applyPipelineHead.d.ts +8 -0
  17. package/esm/src/conversion/parsePipeline/createInitialPipelineJson.d.ts +8 -0
  18. package/esm/src/conversion/parsePipeline/createUniqueSectionNameResolver.d.ts +14 -0
  19. package/esm/src/conversion/parsePipeline/defineParameter.d.ts +8 -0
  20. package/esm/src/conversion/parsePipeline/extractPipelineDescription.d.ts +6 -0
  21. package/esm/src/conversion/parsePipeline/finalizeParsedPipeline.d.ts +8 -0
  22. package/esm/src/conversion/parsePipeline/getPipelineIdentification.d.ts +7 -0
  23. package/esm/src/conversion/parsePipeline/parsePreparedPipelineSections.d.ts +18 -0
  24. package/esm/src/conversion/parsePipeline/preparePipelineString.d.ts +8 -0
  25. package/esm/src/conversion/parsePipeline/processPipelineSection.d.ts +9 -0
  26. package/esm/src/version.d.ts +1 -1
  27. package/package.json +1 -1
  28. package/umd/index.umd.js +3177 -2475
  29. package/umd/index.umd.js.map +1 -1
  30. package/umd/scripts/run-agent-messages/main/tickAgentMessages.d.ts +14 -0
  31. package/umd/scripts/run-agent-messages/ui/loadAgentRunUiMetadata.d.ts +12 -0
  32. package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +5 -0
  33. package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +1 -0
  34. package/umd/src/book-3.0/Book.d.ts +6 -0
  35. package/umd/src/book-components/Chat/utils/getToolCallChipletInfo.test.d.ts +1 -0
  36. package/umd/src/cli/cli-commands/agent/agentRunCliOptions.d.ts +12 -2
  37. package/umd/src/cli/cli-commands/agent/initializeAgentRunnerCommand.d.ts +1 -0
  38. package/umd/src/cli/cli-commands/run/prepareRunCommandResources.d.ts +20 -0
  39. package/umd/src/cli/cli-commands/run/resolveRunInputParameters.d.ts +12 -0
  40. package/umd/src/cli/cli-commands/run/runCommandAction.d.ts +21 -0
  41. package/umd/src/cli/cli-commands/run/runPipelineExecution.d.ts +14 -0
  42. package/umd/src/cli/cli-commands/run.d.ts +1 -1
  43. package/umd/src/conversion/parsePipeline/applyPipelineHead.d.ts +8 -0
  44. package/umd/src/conversion/parsePipeline/createInitialPipelineJson.d.ts +8 -0
  45. package/umd/src/conversion/parsePipeline/createUniqueSectionNameResolver.d.ts +14 -0
  46. package/umd/src/conversion/parsePipeline/defineParameter.d.ts +8 -0
  47. package/umd/src/conversion/parsePipeline/extractPipelineDescription.d.ts +6 -0
  48. package/umd/src/conversion/parsePipeline/finalizeParsedPipeline.d.ts +8 -0
  49. package/umd/src/conversion/parsePipeline/getPipelineIdentification.d.ts +7 -0
  50. package/umd/src/conversion/parsePipeline/parsePreparedPipelineSections.d.ts +18 -0
  51. package/umd/src/conversion/parsePipeline/preparePipelineString.d.ts +8 -0
  52. package/umd/src/conversion/parsePipeline/processPipelineSection.d.ts +9 -0
  53. package/umd/src/version.d.ts +1 -1
@@ -1,3 +1,4 @@
1
+ import type { PromptStats } from '../../run-codex-prompts/prompts/types/PromptStats';
1
2
  import { type CoderRunUiHandle } from '../../run-codex-prompts/ui/renderCoderRunUi';
2
3
  import type { AgentRunOptions } from '../AgentRunOptions';
3
4
  import type { AgentMessageFile } from '../messages/AgentMessageFile';
@@ -17,6 +18,19 @@ export type AgentTickResult = {
17
18
  export type TickAgentMessagesOptions = {
18
19
  readonly isQuietWhenIdle?: boolean;
19
20
  readonly uiHandle?: CoderRunUiHandle;
21
+ readonly uiPresentation?: AgentTickUiPresentation;
22
+ };
23
+ /**
24
+ * Optional rich UI presentation overrides used by shared multi-agent sessions.
25
+ */
26
+ export type AgentTickUiPresentation = {
27
+ readonly sessionAgentName?: string;
28
+ readonly agentStatusLines?: readonly string[];
29
+ readonly messagePreviewLines?: readonly string[];
30
+ readonly progressStats?: PromptStats;
31
+ readonly completedAgentStatusLines?: readonly string[];
32
+ readonly completedMessagePreviewLines?: readonly string[];
33
+ readonly completedProgressStats?: PromptStats;
20
34
  };
21
35
  /**
22
36
  * Answers one queued `.book` message thread and moves it to `messages/finished`.
@@ -6,10 +6,22 @@ export type AgentRunUiMetadata = {
6
6
  readonly localAgentName: string;
7
7
  readonly latestUserMessageLines: readonly string[];
8
8
  };
9
+ /**
10
+ * Preview of one queued `.book` thread used by the rich terminal UI.
11
+ */
12
+ export type AgentRunQueuedMessagePreview = {
13
+ readonly queuedMessage: AgentMessageFile;
14
+ readonly latestUserMessageLines: readonly string[];
15
+ readonly latestUserMessageSummary: string;
16
+ };
9
17
  /**
10
18
  * Reads the local agent title and latest queued user message for the rich agent dashboard.
11
19
  */
12
20
  export declare function loadAgentRunUiMetadata(projectPath: string, queuedMessage: AgentMessageFile): Promise<AgentRunUiMetadata>;
21
+ /**
22
+ * Reads and summarizes the latest queued user message from one thread book.
23
+ */
24
+ export declare function loadAgentRunQueuedMessagePreview(queuedMessage: AgentMessageFile): Promise<AgentRunQueuedMessagePreview>;
13
25
  /**
14
26
  * Reads the local `agent.book` title and falls back to a stable generic name when unavailable.
15
27
  */
@@ -44,6 +44,7 @@ export declare class CoderRunUiState extends EventEmitter {
44
44
  maxAttempts: number;
45
45
  detailLines: string[];
46
46
  messagePreviewLines: string[];
47
+ agentStatusLines: string[];
47
48
  pendingEnterLabel: string | undefined;
48
49
  agentOutputLines: string[];
49
50
  phase: CoderRunPhase;
@@ -101,6 +102,10 @@ export declare class CoderRunUiState extends EventEmitter {
101
102
  * Replaces the exact user-message preview lines shown in agent-specific panels.
102
103
  */
103
104
  setMessagePreviewLines(messagePreviewLines: string[]): void;
105
+ /**
106
+ * Replaces agent status rows shown by agent-specific terminal frames.
107
+ */
108
+ setAgentStatusLines(agentStatusLines: string[]): void;
104
109
  /**
105
110
  * Sets or clears the Enter-key action label shown in the controls panel.
106
111
  */
@@ -20,6 +20,7 @@ export type BuildCoderRunUiFrameOptions = {
20
20
  readonly statusMessage: string;
21
21
  readonly detailLines: readonly string[];
22
22
  readonly messagePreviewLines?: readonly string[];
23
+ readonly agentStatusLines?: readonly string[];
23
24
  readonly pendingEnterLabel?: string;
24
25
  readonly agentOutputLines: readonly string[];
25
26
  readonly errors: readonly string[];
@@ -24,6 +24,12 @@ export declare class Book {
24
24
  private constructor();
25
25
  stringify(): string_book;
26
26
  getMessages(): ReadonlyArray<ChatMessage>;
27
+ /**
28
+ * Gets the newest parsed chat message written by the given sender.
29
+ *
30
+ * @public exported from `@promptbook/core`
31
+ */
32
+ getLatestMessageBySender(sender: string): ChatMessage | null;
27
33
  }
28
34
  type Commitment = {
29
35
  type: string;
@@ -4,10 +4,20 @@ import type { NormalizedPromptRunnerCliOptions, PromptRunnerCliOptions } from '.
4
4
  *
5
5
  * @private internal utility of `ptbk agent`
6
6
  */
7
- export type AgentRunCliOptions = PromptRunnerCliOptions;
7
+ export type AgentRunCliOptions = PromptRunnerCliOptions & {
8
+ readonly autoClone?: boolean;
9
+ };
10
+ /**
11
+ * Normalized options passed from `ptbk agent` CLI commands to the message runner.
12
+ *
13
+ * @private internal utility of `ptbk agent`
14
+ */
15
+ export type NormalizedAgentRunCliOptions = NormalizedPromptRunnerCliOptions & {
16
+ readonly autoClone: boolean;
17
+ };
8
18
  /**
9
19
  * Converts Commander options into the `scripts/run-agent-messages` option shape.
10
20
  *
11
21
  * @private internal utility of `ptbk agent`
12
22
  */
13
- export declare function createAgentRunOptionsFromCliOptions(cliOptions: AgentRunCliOptions): NormalizedPromptRunnerCliOptions;
23
+ export declare function createAgentRunOptionsFromCliOptions(cliOptions: AgentRunCliOptions): NormalizedAgentRunCliOptions;
@@ -11,6 +11,7 @@ type InitializeAgentRunnerCommandOptions = {
11
11
  readonly aliases?: ReadonlyArray<string>;
12
12
  readonly summary: string;
13
13
  readonly featureLines: ReadonlyArray<string>;
14
+ readonly configureCommand?: (command: Program) => void;
14
15
  readonly loadExecutor: () => Promise<(runOptions: ReturnType<typeof createAgentRunOptionsFromCliOptions>) => Promise<unknown>>;
15
16
  };
16
17
  /**
@@ -0,0 +1,20 @@
1
+ import type { PipelineExecutor } from '../../../execution/PipelineExecutor';
2
+ import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
3
+ import type { PrepareAndScrapeOptions } from '../../../prepare/PrepareAndScrapeOptions';
4
+ import type { RunCommandCliOptions } from './runCommandAction';
5
+ /**
6
+ * Prepares the tools, pipeline, and executor required to run one `ptbk run` invocation.
7
+ *
8
+ * @private internal utility of `$initializeRunCommand`
9
+ */
10
+ export declare function prepareRunCommandResources(options: {
11
+ readonly pipelineSource?: string;
12
+ readonly cliOptions: RunCommandCliOptions;
13
+ readonly prepareAndScrapeOptions: Pick<PrepareAndScrapeOptions, 'isVerbose'> & {
14
+ readonly isCacheReloaded: boolean;
15
+ };
16
+ readonly logStage: (stage: string) => void;
17
+ }): Promise<{
18
+ readonly pipeline: PipelineJson;
19
+ readonly pipelineExecutor: PipelineExecutor;
20
+ }>;
@@ -0,0 +1,12 @@
1
+ import type { PipelineJson } from '../../../pipeline/PipelineJson/PipelineJson';
2
+ import type { string_parameter_name, string_parameter_value } from '../../../types/string_name';
3
+ /**
4
+ * Resolves all missing input parameters while keeping the current interactive and non-interactive behavior.
5
+ *
6
+ * @private internal utility of `$initializeRunCommand`
7
+ */
8
+ export declare function resolveRunInputParameters(options: {
9
+ readonly pipeline: PipelineJson;
10
+ readonly inputParameters: Record<string_parameter_name, string_parameter_value>;
11
+ readonly isInteractive: boolean;
12
+ }): Promise<Record<string_parameter_name, string_parameter_value>>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * CLI options consumed by the `run` command action.
3
+ *
4
+ * @private internal utility of `$initializeRunCommand`
5
+ */
6
+ export type RunCommandCliOptions = {
7
+ readonly reload: boolean;
8
+ readonly interactive: boolean;
9
+ readonly formfactor: boolean;
10
+ readonly json?: string;
11
+ readonly verbose: boolean;
12
+ readonly saveReport?: string;
13
+ readonly provider: string;
14
+ readonly remoteServerUrl: string;
15
+ };
16
+ /**
17
+ * Runs the whole `ptbk run` flow as a top-down orchestration of focused steps.
18
+ *
19
+ * @private internal utility of `$initializeRunCommand`
20
+ */
21
+ export declare function runCommandAction(pipelineSource: string | undefined, cliOptions: RunCommandCliOptions): Promise<void | never>;
@@ -0,0 +1,14 @@
1
+ import type { PipelineExecutor } from '../../../execution/PipelineExecutor';
2
+ import type { string_parameter_name, string_parameter_value } from '../../../types/string_name';
3
+ /**
4
+ * Executes the pipeline, persists any requested report, and prints the final CLI output.
5
+ *
6
+ * @private internal utility of `$initializeRunCommand`
7
+ */
8
+ export declare function runPipelineExecution(options: {
9
+ readonly pipelineExecutor: PipelineExecutor;
10
+ readonly inputParameters: Record<string_parameter_name, string_parameter_value>;
11
+ readonly isVerbose: boolean;
12
+ readonly json?: string;
13
+ readonly saveReport?: string;
14
+ }): Promise<void>;
@@ -1,4 +1,4 @@
1
- import type { Command as Program } from 'commander';
1
+ import { Command as Program } from 'commander';
2
2
  import type { $side_effect } from '../../utils/organization/$side_effect';
3
3
  /**
4
4
  * Initializes `run` command for Promptbook CLI utilities
@@ -0,0 +1,8 @@
1
+ import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
2
+ import type { MarkdownSection } from '../../utils/markdown/parseMarkdownSection';
3
+ /**
4
+ * Applies the pipeline head title, description, and head-level commands.
5
+ *
6
+ * @private internal utility of `parsePipeline`
7
+ */
8
+ export declare function applyPipelineHead(pipelineHead: MarkdownSection, $pipelineJson: $PipelineJson): void;
@@ -0,0 +1,8 @@
1
+ import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
2
+ import type { PipelineString } from '../../pipeline/PipelineString';
3
+ /**
4
+ * Creates the mutable pipeline JSON structure used throughout parsing.
5
+ *
6
+ * @private internal utility of `parsePipeline`
7
+ */
8
+ export declare function createInitialPipelineJson(pipelineString: PipelineString): $PipelineJson;
@@ -0,0 +1,14 @@
1
+ import type { string_name } from '../../types/string_name';
2
+ import type { MarkdownSection } from '../../utils/markdown/parseMarkdownSection';
3
+ /**
4
+ * Resolves a unique task name for one parsed markdown section title.
5
+ *
6
+ * @private internal type of `parsePipeline`
7
+ */
8
+ export type UniqueSectionNameResolver = (title: string) => string_name;
9
+ /**
10
+ * Creates stable unique task names for duplicate section titles.
11
+ *
12
+ * @private internal utility of `parsePipeline`
13
+ */
14
+ export declare function createUniqueSectionNameResolver(pipelineSections: ReadonlyArray<MarkdownSection>): UniqueSectionNameResolver;
@@ -0,0 +1,8 @@
1
+ import type { ParameterCommand } from '../../commands/PARAMETER/ParameterCommand';
2
+ import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
3
+ /**
4
+ * Merges one parameter declaration into the mutable pipeline parameter list.
5
+ *
6
+ * @private internal utility of `parsePipeline`
7
+ */
8
+ export declare function defineParameter($pipelineJson: $PipelineJson, parameterCommand: Omit<ParameterCommand, 'type'>): void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Extracts the plain-text description from a head or task section body.
3
+ *
4
+ * @private internal utility of `parsePipeline`
5
+ */
6
+ export declare function extractPipelineDescription(sectionContent: string): string | undefined;
@@ -0,0 +1,8 @@
1
+ import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
2
+ import type { PipelineJson } from '../../pipeline/PipelineJson/PipelineJson';
3
+ /**
4
+ * Applies postprocessing and exports the parsed pipeline JSON.
5
+ *
6
+ * @private internal utility of `parsePipeline`
7
+ */
8
+ export declare function finalizeParsedPipeline($pipelineJson: $PipelineJson): PipelineJson;
@@ -0,0 +1,7 @@
1
+ import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
2
+ /**
3
+ * Builds a short file/url identification block for parse errors.
4
+ *
5
+ * @private internal utility of `parsePipeline`
6
+ */
7
+ export declare function getPipelineIdentification($pipelineJson: $PipelineJson): string;
@@ -0,0 +1,18 @@
1
+ import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
2
+ import type { MarkdownSection } from '../../utils/markdown/parseMarkdownSection';
3
+ import type { PipelineString } from '../../pipeline/PipelineString';
4
+ /**
5
+ * Parsed markdown structure split into the pipeline head and task sections.
6
+ *
7
+ * @private internal type of `parsePipeline`
8
+ */
9
+ export type ParsedPipelineSections = {
10
+ readonly pipelineHead: MarkdownSection;
11
+ readonly pipelineSections: ReadonlyArray<MarkdownSection>;
12
+ };
13
+ /**
14
+ * Splits the prepared markdown into the pipeline head and task sections.
15
+ *
16
+ * @private internal utility of `parsePipeline`
17
+ */
18
+ export declare function parsePreparedPipelineSections(pipelineString: PipelineString, $pipelineJson: $PipelineJson): ParsedPipelineSections;
@@ -0,0 +1,8 @@
1
+ import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
2
+ import type { PipelineString } from '../../pipeline/PipelineString';
3
+ /**
4
+ * Removes shebang/comments and normalizes markdown into a parseable pipeline form.
5
+ *
6
+ * @private internal utility of `parsePipeline`
7
+ */
8
+ export declare function preparePipelineString(pipelineString: PipelineString, $pipelineJson: $PipelineJson): PipelineString;
@@ -0,0 +1,9 @@
1
+ import type { $PipelineJson } from '../../commands/_common/types/CommandParser';
2
+ import type { MarkdownSection } from '../../utils/markdown/parseMarkdownSection';
3
+ import type { UniqueSectionNameResolver } from './createUniqueSectionNameResolver';
4
+ /**
5
+ * Parses, applies, and persists one h2 task section.
6
+ *
7
+ * @private internal utility of `parsePipeline`
8
+ */
9
+ export declare function processPipelineSection(pipelineSection: MarkdownSection, $pipelineJson: $PipelineJson, getUniqueSectionName: UniqueSectionNameResolver): void;
@@ -15,7 +15,7 @@ export declare const BOOK_LANGUAGE_VERSION: string_semantic_version;
15
15
  export declare const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version;
16
16
  /**
17
17
  * Represents the version string of the Promptbook engine.
18
- * It follows semantic versioning (e.g., `0.112.0-70`).
18
+ * It follows semantic versioning (e.g., `0.112.0-71`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/cli",
3
- "version": "0.112.0-71",
3
+ "version": "0.112.0-72",
4
4
  "description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
5
5
  "private": false,
6
6
  "sideEffects": false,