@promptbook/cli 0.112.0-43 → 0.112.0-44

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 (33) hide show
  1. package/esm/index.es.js +481 -111
  2. package/esm/index.es.js.map +1 -1
  3. package/esm/scripts/run-codex-prompts/common/runGoScript/$runGoScript.d.ts +1 -1
  4. package/esm/scripts/run-codex-prompts/common/runGoScript/$runGoScriptUntilMarkerIdle.d.ts +1 -1
  5. package/esm/scripts/run-codex-prompts/common/runGoScript/$runGoScriptWithOutput.d.ts +1 -1
  6. package/esm/scripts/run-codex-prompts/common/runGoScript/PromptRoundArtifacts.d.ts +35 -0
  7. package/esm/scripts/run-codex-prompts/common/runGoScript/buildScriptLogPath.d.ts +4 -0
  8. package/esm/scripts/run-codex-prompts/common/runGoScript/runBashScriptWithOutput.d.ts +5 -0
  9. package/esm/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +28 -0
  10. package/esm/scripts/run-codex-prompts/common/runGoScript/withPromptRuntimeLog.d.ts +5 -0
  11. package/esm/scripts/run-codex-prompts/common/runGoScript/withTempScript.d.ts +1 -1
  12. package/esm/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -0
  13. package/esm/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
  14. package/esm/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +2 -1
  15. package/esm/src/commitments/PERSONA/PERSONA.d.ts +7 -0
  16. package/esm/src/version.d.ts +1 -1
  17. package/package.json +1 -1
  18. package/umd/index.umd.js +480 -110
  19. package/umd/index.umd.js.map +1 -1
  20. package/umd/scripts/run-codex-prompts/common/runGoScript/$runGoScript.d.ts +1 -1
  21. package/umd/scripts/run-codex-prompts/common/runGoScript/$runGoScriptUntilMarkerIdle.d.ts +1 -1
  22. package/umd/scripts/run-codex-prompts/common/runGoScript/$runGoScriptWithOutput.d.ts +1 -1
  23. package/umd/scripts/run-codex-prompts/common/runGoScript/PromptRoundArtifacts.d.ts +35 -0
  24. package/umd/scripts/run-codex-prompts/common/runGoScript/buildScriptLogPath.d.ts +4 -0
  25. package/umd/scripts/run-codex-prompts/common/runGoScript/runBashScriptWithOutput.d.ts +5 -0
  26. package/umd/scripts/run-codex-prompts/common/runGoScript/scriptExecutionLog.d.ts +28 -0
  27. package/umd/scripts/run-codex-prompts/common/runGoScript/withPromptRuntimeLog.d.ts +5 -0
  28. package/umd/scripts/run-codex-prompts/common/runGoScript/withTempScript.d.ts +1 -1
  29. package/umd/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -0
  30. package/umd/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
  31. package/umd/src/book-2.0/agent-source/TeammateProfileResolver.d.ts +2 -1
  32. package/umd/src/commitments/PERSONA/PERSONA.d.ts +7 -0
  33. package/umd/src/version.d.ts +1 -1
@@ -1,5 +1,5 @@
1
1
  import type { RunGoScriptOptions } from './RunGoScriptOptions';
2
2
  /**
3
- * Creates a temporary script file, runs it, and then deletes it.
3
+ * Creates a temporary script file, runs it, and cleans it up immediately unless a round tracker defers that cleanup.
4
4
  */
5
5
  export declare function $runGoScript(options: RunGoScriptOptions): Promise<void>;
@@ -1,6 +1,6 @@
1
1
  import type { RunGoScriptUntilMarkerIdleOptions } from './RunGoScriptUntilMarkerIdleOptions';
2
2
  /**
3
- * Creates a temporary script file, runs it, waits for a completion marker and idle time, and then deletes it.
3
+ * Creates a temporary script file, runs it, waits for a completion marker and idle time, and defers cleanup when a round tracker is provided.
4
4
  * Returns the captured output for post-processing.
5
5
  */
6
6
  export declare function $runGoScriptUntilMarkerIdle(options: RunGoScriptUntilMarkerIdleOptions): Promise<string>;
@@ -1,5 +1,5 @@
1
1
  import type { RunGoScriptOptions } from './RunGoScriptOptions';
2
2
  /**
3
- * Creates a temporary script file, runs it, captures output, and then deletes it.
3
+ * Creates a temporary script file, runs it, captures output, and cleans it up immediately unless a round tracker defers that cleanup.
4
4
  */
5
5
  export declare function $runGoScriptWithOutput(options: RunGoScriptOptions): Promise<string>;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Kind of temporary artifact created during one coder prompt round.
3
+ */
4
+ export type PromptRoundArtifactKind = 'runner-script' | 'test-script' | 'runtime-log';
5
+ /**
6
+ * Final outcome of one coder prompt round.
7
+ */
8
+ export type PromptRoundOutcome = 'success' | 'failure';
9
+ /**
10
+ * Tracks temporary prompt-round artifacts and deletes only those not preserved for the final round outcome.
11
+ */
12
+ export declare class PromptRoundArtifacts {
13
+ private readonly preservedArtifactKindsByOutcome;
14
+ private readonly trackedArtifacts;
15
+ /**
16
+ * Creates a new prompt-round artifact tracker.
17
+ */
18
+ constructor(preservedArtifactKindsByOutcome: Record<PromptRoundOutcome, ReadonlySet<PromptRoundArtifactKind>>);
19
+ /**
20
+ * Registers one temporary artifact for round-final cleanup.
21
+ */
22
+ track(path: string, kind: PromptRoundArtifactKind): void;
23
+ /**
24
+ * Cleans up all tracked artifacts that should not survive the final round outcome.
25
+ */
26
+ cleanup(outcome: PromptRoundOutcome): Promise<void>;
27
+ }
28
+ /**
29
+ * Creates the default artifact-retention policy used by `ptbk coder run`.
30
+ */
31
+ export declare function createCoderRunPromptRoundArtifacts(isPreserveLogs: boolean): PromptRoundArtifacts;
32
+ /**
33
+ * Derives the tracked artifact kind from one temporary shell path.
34
+ */
35
+ export declare function getPromptRoundArtifactKindFromScriptPath(scriptPath: string): PromptRoundArtifactKind;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Builds the temporary live runtime log path for one prompt script and its sibling test script.
3
+ */
4
+ export declare function buildScriptLogPath(scriptPath: string): string;
@@ -0,0 +1,5 @@
1
+ import type { RunGoScriptOptions } from './RunGoScriptOptions';
2
+ /**
3
+ * Runs one temporary bash script, optionally mirroring its raw input/output into a live runtime log file.
4
+ */
5
+ export declare function runBashScriptWithOutput(options: RunGoScriptOptions): Promise<string>;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Environment variable read by the shell wrapper to tee live output into the temporary runtime log file.
3
+ */
4
+ export declare const PTBK_CODER_LOG_FILE_ENV_NAME = "PTBK_CODER_LOG_FILE";
5
+ /**
6
+ * Shapes one bash invocation that optionally mirrors live script output into a temporary log file.
7
+ */
8
+ export declare function buildLoggedBashExecution(scriptPath: string, logPath?: string): {
9
+ args: string[];
10
+ env?: Record<string, string>;
11
+ };
12
+ /**
13
+ * Appends one execution-start section with the raw script input before the shell begins producing output.
14
+ */
15
+ export declare function appendScriptExecutionLogStart({ scriptPath, scriptContent, logPath, }: {
16
+ scriptPath: string;
17
+ scriptContent: string;
18
+ logPath?: string;
19
+ }): Promise<void>;
20
+ /**
21
+ * Appends one execution-finish section after the shell settles.
22
+ */
23
+ export declare function appendScriptExecutionLogFinish({ scriptPath, logPath, status, details, }: {
24
+ scriptPath: string;
25
+ logPath?: string;
26
+ status: string;
27
+ details?: unknown;
28
+ }): Promise<void>;
@@ -0,0 +1,5 @@
1
+ import type { PromptRoundArtifacts } from './PromptRoundArtifacts';
2
+ /**
3
+ * Runs one prompt-processing round with a dedicated temporary runtime log file and optionally defers cleanup to the round tracker.
4
+ */
5
+ export declare function withPromptRuntimeLog<T>(scriptPath: string, handler: (logPath: string) => Promise<T>, promptRoundArtifacts?: PromptRoundArtifacts): Promise<T>;
@@ -1,5 +1,5 @@
1
1
  import type { RunGoScriptOptions } from './RunGoScriptOptions';
2
2
  /**
3
- * Creates a temporary script file, runs a handler, and ensures cleanup.
3
+ * Creates a temporary script file, runs a handler, and either cleans it up immediately or defers cleanup to the round tracker.
4
4
  */
5
5
  export declare function withTempScript<T>(options: RunGoScriptOptions, handler: (scriptPath: string) => Promise<T>): Promise<T>;
@@ -5,6 +5,7 @@ type RunPromptTestCommandOptions = {
5
5
  command: string;
6
6
  projectPath: string;
7
7
  scriptPath: string;
8
+ logPath?: string;
8
9
  };
9
10
  /**
10
11
  * Runs the configured verification command inside the project root and returns its output.
@@ -66,7 +66,8 @@ export type AgentBasicInformation = {
66
66
  permanentId?: string_agent_permanent_id;
67
67
  /**
68
68
  * Optional description of the agent
69
- * This is the line starting with "PERSONA"
69
+ * This is derived from the last `GOAL` / `GOALS` commitment,
70
+ * falling back to deprecated `PERSONA` / `PERSONAE` for backward compatibility.
70
71
  */
71
72
  personaDescription: string | null;
72
73
  /**
@@ -9,7 +9,8 @@ export type TeammateProfile = {
9
9
  */
10
10
  readonly agentName: string;
11
11
  /**
12
- * Short description of what the agent does, from its PERSONA commitment.
12
+ * Short profile text for what the agent does, from the last GOAL commitment
13
+ * or deprecated PERSONA fallback.
13
14
  */
14
15
  readonly personaDescription: string | null;
15
16
  };
@@ -29,6 +29,13 @@ export declare class PersonaCommitmentDefinition extends BaseCommitmentDefinitio
29
29
  * Short one-line description of PERSONA.
30
30
  */
31
31
  get description(): string;
32
+ /**
33
+ * Optional UI/docs-only deprecation metadata.
34
+ */
35
+ get deprecation(): {
36
+ readonly message: "Use `GOAL` for agent profile text and inheritance-safe rewrites.";
37
+ readonly replacedBy: readonly ["GOAL"];
38
+ };
32
39
  /**
33
40
  * Icon for this commitment.
34
41
  */
@@ -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-42`).
18
+ * It follows semantic versioning (e.g., `0.112.0-43`).
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-43",
3
+ "version": "0.112.0-44",
4
4
  "description": "Promptbook: Turn your company's scattered knowledge into AI ready books",
5
5
  "private": false,
6
6
  "sideEffects": false,