@promptbook/documents 0.114.0-49 → 0.114.0-50

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 (34) hide show
  1. package/README.md +3 -3
  2. package/esm/index.es.js +3 -2
  3. package/esm/index.es.js.map +1 -1
  4. package/esm/src/cli/cli-commands/coder/add.d.ts +7 -2
  5. package/esm/src/cli/cli-commands/coder/ensureCoderGitattributesFile.d.ts +13 -0
  6. package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
  7. package/esm/src/cli/cli-commands/coder/fix.d.ts +7 -0
  8. package/esm/src/cli/cli-commands/coder/fix.test.d.ts +1 -0
  9. package/esm/src/cli/cli-commands/coder/fixWorkflow.test.d.ts +1 -0
  10. package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +1 -0
  11. package/esm/src/cli/cli-commands/coder.d.ts +1 -0
  12. package/esm/src/cli/cli-commands/common/coderCheckCliOptions.d.ts +1 -1
  13. package/esm/src/cli/cli-commands/common/ensureProjectTextFile.d.ts +7 -0
  14. package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -1
  15. package/esm/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +1 -1
  16. package/esm/src/cli/cli-commands/common/workspaceRepository.d.ts +12 -0
  17. package/esm/src/version.d.ts +1 -1
  18. package/package.json +2 -2
  19. package/umd/index.umd.js +3 -2
  20. package/umd/index.umd.js.map +1 -1
  21. package/umd/src/cli/cli-commands/coder/add.d.ts +7 -2
  22. package/umd/src/cli/cli-commands/coder/ensureCoderGitattributesFile.d.ts +13 -0
  23. package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +1 -1
  24. package/umd/src/cli/cli-commands/coder/fix.d.ts +7 -0
  25. package/umd/src/cli/cli-commands/coder/fix.test.d.ts +1 -0
  26. package/umd/src/cli/cli-commands/coder/fixWorkflow.test.d.ts +1 -0
  27. package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +1 -0
  28. package/umd/src/cli/cli-commands/coder.d.ts +1 -0
  29. package/umd/src/cli/cli-commands/common/coderCheckCliOptions.d.ts +1 -1
  30. package/umd/src/cli/cli-commands/common/ensureProjectTextFile.d.ts +7 -0
  31. package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +3 -1
  32. package/umd/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +1 -1
  33. package/umd/src/cli/cli-commands/common/workspaceRepository.d.ts +12 -0
  34. package/umd/src/version.d.ts +1 -1
@@ -1,5 +1,6 @@
1
1
  import type { Command as Program } from 'commander';
2
2
  import type { $side_effect } from '../../../utils/organization/$side_effect';
3
+ import { type ResolvedCoderPromptTemplate } from './boilerplateTemplates';
3
4
  /**
4
5
  * Initializes `coder add` command for Promptbook CLI utilities
5
6
  *
@@ -28,11 +29,13 @@ export type AddCoderPromptResult = {
28
29
  *
29
30
  * @private internal utility of `coder add` command
30
31
  */
31
- export declare function addCoderPrompt({ projectPath, description, priority, templateOption, }: {
32
+ export declare function addCoderPrompt({ projectPath, description, priority, templateOption, promptTemplate, }: {
32
33
  readonly projectPath: string;
33
34
  readonly description: string;
34
35
  readonly priority: number;
35
36
  readonly templateOption?: string;
37
+ /** Internal authoring workflows may supply their own bounded instructions instead of the feature template. */
38
+ readonly promptTemplate?: ResolvedCoderPromptTemplate;
36
39
  }): Promise<AddCoderPromptResult>;
37
40
  /**
38
41
  * Prepares a numbered, emoji-tagged prompt for preview without writing the prompt file.
@@ -40,13 +43,15 @@ export declare function addCoderPrompt({ projectPath, description, priority, tem
40
43
  *
41
44
  * @private internal utility shared by `coder add` and `coder plan`
42
45
  */
43
- export declare function prepareCoderPrompt({ projectPath, description, priority, templateOption, numberOffset, reservedEmojiTag, }: {
46
+ export declare function prepareCoderPrompt({ projectPath, description, priority, templateOption, numberOffset, reservedEmojiTag, promptTemplate: providedPromptTemplate, }: {
44
47
  readonly projectPath: string;
45
48
  readonly description: string;
46
49
  readonly priority: number;
47
50
  readonly templateOption?: string;
48
51
  readonly numberOffset?: number;
49
52
  readonly reservedEmojiTag?: string;
53
+ /** Shared repair authoring preserves numbering and tags without appending ordinary implementation instructions. */
54
+ readonly promptTemplate?: ResolvedCoderPromptTemplate;
50
55
  }): Promise<AddCoderPromptResult & {
51
56
  readonly content: string;
52
57
  }>;
@@ -0,0 +1,13 @@
1
+ import type { InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Project-relative path to the Git attributes initialized by Promptbook Coder.
4
+ *
5
+ * @private internal constant of `coder init`
6
+ */
7
+ export declare const CODER_GITATTRIBUTES_FILE_PATH = ".gitattributes";
8
+ /**
9
+ * Creates default Git attributes when missing, preserving project-owned attributes.
10
+ *
11
+ * @private function of `initializeCoderProjectConfiguration`
12
+ */
13
+ export declare function ensureCoderGitattributesFile(projectPath: string): Promise<InitializationStatus>;
@@ -1,7 +1,7 @@
1
1
  import { type PromptRunnerHarnessName } from '../common/promptRunnerCliOptions';
2
2
  import type { InitializationStatus } from './boilerplateTemplates';
3
3
  /**
4
- * Ensures `.gitignore` contains Promptbook Coder's local artifacts and every supported harness's local artifacts.
4
+ * Ensures `.gitignore` covers local dependencies, coder artifacts and every supported harness's local artifacts.
5
5
  *
6
6
  * @private function of `initializeCoderProjectConfiguration`
7
7
  */
@@ -0,0 +1,7 @@
1
+ import type { Command as Program } from 'commander';
2
+ import type { $side_effect } from '../../../utils/organization/$side_effect';
3
+ /**
4
+ * Registers a finite check-repair command with the shared parser, defaults and execution policy.
5
+ * @private internal CLI command registration
6
+ */
7
+ export declare function $initializeCoderFixCommand(program: Program): $side_effect;
@@ -0,0 +1 @@
1
+ export {};
@@ -15,6 +15,7 @@ export type CoderInitializationSummary = {
15
15
  readonly adamAgentFileDiagnostic?: string;
16
16
  readonly envFileStatus: InitializationStatus;
17
17
  readonly gitignoreFileStatus: InitializationStatus;
18
+ readonly gitattributesFileStatus: InitializationStatus;
18
19
  readonly packageJsonFileStatus: InitializationStatus;
19
20
  readonly vscodeSettingsFileStatus: InitializationStatus;
20
21
  readonly addedPackageJsonScriptNames: ReadonlyArray<string>;
@@ -11,6 +11,7 @@ import type { $side_effect } from '../../utils/organization/$side_effect';
11
11
  * - find-refactor-candidates: Find files that need refactoring
12
12
  * - list: List ready prompts in priority order without running them
13
13
  * - run: Run coding prompts with AI agents
14
+ * - fix: Check and repair the project, then exit without processing the queue
14
15
  * - ping: Test one harness and model with a tiny dummy prompt
15
16
  * - verify: Verify completed prompts
16
17
  * - find-fresh-emoji-tags: Find unused emoji tags
@@ -8,7 +8,7 @@ export declare const LEGACY_CODER_CHECK_OPTIONS: readonly [readonly ["--test", "
8
8
  * Registers the shared project check command and rejects retired aggregate-test spellings.
9
9
  * @private shared CLI registration for Coder execution
10
10
  */
11
- export declare function addCoderCheckOptions(command: Command, isCheckBeforeSupported: boolean): void;
11
+ export declare function addCoderCheckOptions(command: Command, isCheckBeforeSupported: boolean, description?: string): void;
12
12
  /**
13
13
  * Builds the same actionable migration diagnostic for registered and direct-script entrypoints.
14
14
  * @private shared CLI diagnostic for Coder execution
@@ -0,0 +1,7 @@
1
+ import type { ProjectInitializationStatus } from './projectInitialization';
2
+ /**
3
+ * Creates one project text file with default content, preserving any existing file.
4
+ *
5
+ * @private internal utility of Promptbook CLI project initialization
6
+ */
7
+ export declare function ensureProjectTextFile(projectPath: string, relativeFilePath: string, fileContent: string): Promise<ProjectInitializationStatus>;
@@ -11,4 +11,6 @@ import type { NormalizedQuestionsCliOptions } from '../questionsCliOptions';
11
11
  *
12
12
  * @private internal utility of `promptbookCli`
13
13
  */
14
- export declare function $ensureHarnessInstallations(harnessNames: ReadonlyArray<PromptRunnerHarnessName | undefined>, questionsOptions: NormalizedQuestionsCliOptions): Promise<void>;
14
+ export declare function $ensureHarnessInstallations(harnessNames: ReadonlyArray<PromptRunnerHarnessName | undefined>, questionsOptions: NormalizedQuestionsCliOptions, options?: {
15
+ readonly isRequired?: boolean;
16
+ }): Promise<void>;
@@ -3,4 +3,4 @@ import type { RunOptions } from '../../../../scripts/run-codex-prompts/cli/RunOp
3
3
  * Validates cross-flag constraints before workspace setup or the run starts.
4
4
  * @private shared validation for Coder execution commands
5
5
  */
6
- export declare function validateCoderRunOptions(options: RunOptions): void;
6
+ export declare function validateCoderRunOptions(options: Pick<RunOptions, 'checkCommand' | 'checkBefore' | 'allowDestructiveAutoMigrate' | 'autoMigrate' | 'noCommit' | 'waitForUser' | 'gitChanges' | 'autoPull' | 'dryRun' | 'isIsolated' | 'limit'>): void;
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import type { NormalizedQuestionsCliOptions } from './questionsCliOptions';
2
4
  /**
3
5
  * Resolved project directory and its enclosing working tree. Project artifacts belong to `projectPath`;
@@ -34,3 +36,13 @@ export declare function $preflightWorkspaceRepository(options: {
34
36
  readonly projectDirectory?: string;
35
37
  readonly policy: WorkspaceRepositoryPolicy;
36
38
  } & Partial<NormalizedQuestionsCliOptions>): Promise<WorkspaceRepositoryContext>;
39
+ /**
40
+ * Executes Git without a shell, optional index locks, or credential prompts, retaining raw output boundaries.
41
+ * Drains both output streams without execFile's fixed buffer limit so large repository listings remain complete.
42
+ * @private shared Git discovery and commit-scope inspection
43
+ */
44
+ export declare function $runWorkspaceGit(projectPath: string, argumentsList: ReadonlyArray<string>, options?: {
45
+ readonly env?: Record<string, string>;
46
+ readonly signal?: AbortSignal;
47
+ readonly input?: string | Buffer;
48
+ }): Promise<string>;
@@ -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.114.0-48`).
18
+ * It follows semantic versioning (e.g., `0.114.0-49`).
19
19
  *
20
20
  * @generated
21
21
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@promptbook/documents",
3
- "version": "0.114.0-49",
3
+ "version": "0.114.0-50",
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,
@@ -96,7 +96,7 @@
96
96
  "types": "./esm/src/_packages/documents.index.d.ts",
97
97
  "typings": "./esm/src/_packages/documents.index.d.ts",
98
98
  "peerDependencies": {
99
- "@promptbook/core": "0.114.0-49"
99
+ "@promptbook/core": "0.114.0-50"
100
100
  },
101
101
  "dependencies": {
102
102
  "colors": "1.4.0",
package/umd/index.umd.js CHANGED
@@ -26,7 +26,7 @@
26
26
  * @generated
27
27
  * @see https://github.com/webgptorg/promptbook
28
28
  */
29
- const PROMPTBOOK_ENGINE_VERSION = '0.114.0-49';
29
+ const PROMPTBOOK_ENGINE_VERSION = '0.114.0-50';
30
30
  /**
31
31
  * TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
32
32
  * Note: [💞] Ignore a discrepancy between file name and entity name
@@ -1553,8 +1553,9 @@
1553
1553
  resolve(spacetrim.spaceTrim(output.join('\n')));
1554
1554
  }
1555
1555
  };
1556
+ // `exit` can arrive before the stdout/stderr pipes finish. Git metadata and hook diagnostics
1557
+ // must be complete before a following repository inspection uses the command's result.
1556
1558
  commandProcess.on('close', finishWithCode);
1557
- commandProcess.on('exit', finishWithCode);
1558
1559
  commandProcess.on('disconnect', () => {
1559
1560
  // Note: Unexpected disconnection should always result in rejection
1560
1561
  reject(new Error(`Command "${humanReadableCommand}" disconnected`));