@promptbook/javascript 0.112.0-36 → 0.112.0-38

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 (122) hide show
  1. package/README.md +10 -6
  2. package/esm/index.es.js +1 -1
  3. package/esm/src/_packages/components.index.d.ts +2 -0
  4. package/esm/src/_packages/types.index.d.ts +48 -46
  5. package/esm/src/book-components/Chat/Chat/ChatActionsBar.d.ts +7 -0
  6. package/esm/src/book-components/Chat/Chat/ChatActionsBar.test.d.ts +2 -0
  7. package/esm/src/book-components/Chat/Chat/ChatInputArea.d.ts +4 -0
  8. package/esm/src/book-components/Chat/Chat/ChatMessageItem.d.ts +8 -0
  9. package/esm/src/book-components/Chat/Chat/ChatMessageList.d.ts +2 -0
  10. package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +50 -1
  11. package/esm/src/book-components/Chat/Chat/ChatReplyPreview.d.ts +19 -0
  12. package/esm/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +2 -2
  13. package/esm/src/book-components/Chat/MockedChat/MockedChat.d.ts +1 -1
  14. package/esm/src/book-components/Chat/types/ChatMessage.d.ts +35 -0
  15. package/esm/src/book-components/Chat/utils/resolveChatMessageReplyPreviewText.d.ts +25 -0
  16. package/esm/src/book-components/Chat/utils/resolveChatMessageReplySenderLabel.d.ts +12 -0
  17. package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +14 -0
  18. package/esm/src/cli/cli-commands/coder/agentsFile.d.ts +12 -0
  19. package/esm/src/cli/cli-commands/coder/appendBlock.d.ts +6 -0
  20. package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +10 -0
  21. package/esm/src/cli/cli-commands/coder/ensureCoderEnvFile.d.ts +15 -0
  22. package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +7 -0
  23. package/esm/src/cli/cli-commands/coder/ensureCoderMarkdownFile.d.ts +7 -0
  24. package/esm/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +7 -0
  25. package/esm/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +7 -0
  26. package/esm/src/cli/cli-commands/coder/ensureDirectory.d.ts +7 -0
  27. package/esm/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +1 -1
  28. package/esm/src/cli/cli-commands/coder/find-refactor-candidates.test.d.ts +1 -0
  29. package/esm/src/cli/cli-commands/coder/formatDisplayPath.d.ts +6 -0
  30. package/esm/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
  31. package/esm/src/cli/cli-commands/coder/getDefaultCoderVscodeSettings.d.ts +6 -0
  32. package/esm/src/cli/cli-commands/coder/init.d.ts +3 -38
  33. package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +25 -0
  34. package/esm/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +18 -0
  35. package/esm/src/cli/cli-commands/coder/printInitializationSummary.d.ts +7 -0
  36. package/esm/src/cli/cli-commands/coder/readTextFileIfExists.d.ts +6 -0
  37. package/esm/src/types/string_agent_url.d.ts +7 -0
  38. package/esm/src/types/string_agent_url_private.d.ts +9 -0
  39. package/esm/src/types/string_base64.d.ts +13 -0
  40. package/esm/src/types/string_base64_private.d.ts +2 -2
  41. package/esm/src/types/string_base_url.d.ts +7 -0
  42. package/esm/src/types/string_base_url_private.d.ts +9 -0
  43. package/esm/src/types/string_email.d.ts +13 -0
  44. package/esm/src/types/string_email_private.d.ts +2 -2
  45. package/esm/src/types/string_host.d.ts +42 -0
  46. package/esm/src/types/string_host_private.d.ts +7 -7
  47. package/esm/src/types/string_href.d.ts +19 -0
  48. package/esm/src/types/string_href_private.d.ts +24 -0
  49. package/esm/src/types/string_mime_type.d.ts +15 -0
  50. package/esm/src/types/string_mime_type_private.d.ts +2 -2
  51. package/esm/src/types/string_pipeline_root_url.d.ts +7 -0
  52. package/esm/src/types/string_pipeline_root_url_private.d.ts +9 -0
  53. package/esm/src/types/string_pipeline_url.d.ts +13 -0
  54. package/esm/src/types/string_pipeline_url_private.d.ts +17 -0
  55. package/esm/src/types/string_promptbook_server_url.d.ts +7 -0
  56. package/esm/src/types/string_promptbook_server_url_private.d.ts +9 -0
  57. package/esm/src/types/string_url.d.ts +14 -141
  58. package/esm/src/types/string_url_image.d.ts +7 -0
  59. package/esm/src/types/string_url_image_private.d.ts +9 -0
  60. package/esm/src/types/string_url_private.d.ts +0 -80
  61. package/esm/src/version.d.ts +1 -1
  62. package/package.json +2 -2
  63. package/umd/index.umd.js +1 -1
  64. package/umd/src/_packages/components.index.d.ts +2 -0
  65. package/umd/src/_packages/types.index.d.ts +48 -46
  66. package/umd/src/book-components/Chat/Chat/ChatActionsBar.d.ts +7 -0
  67. package/umd/src/book-components/Chat/Chat/ChatActionsBar.test.d.ts +2 -0
  68. package/umd/src/book-components/Chat/Chat/ChatInputArea.d.ts +4 -0
  69. package/umd/src/book-components/Chat/Chat/ChatMessageItem.d.ts +8 -0
  70. package/umd/src/book-components/Chat/Chat/ChatMessageList.d.ts +2 -0
  71. package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +50 -1
  72. package/umd/src/book-components/Chat/Chat/ChatReplyPreview.d.ts +19 -0
  73. package/umd/src/book-components/Chat/Chat/createProgressCardChecklistMarkdown.d.ts +2 -2
  74. package/umd/src/book-components/Chat/MockedChat/MockedChat.d.ts +1 -1
  75. package/umd/src/book-components/Chat/types/ChatMessage.d.ts +35 -0
  76. package/umd/src/book-components/Chat/utils/resolveChatMessageReplyPreviewText.d.ts +25 -0
  77. package/umd/src/book-components/Chat/utils/resolveChatMessageReplySenderLabel.d.ts +12 -0
  78. package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +14 -0
  79. package/umd/src/cli/cli-commands/coder/agentsFile.d.ts +12 -0
  80. package/umd/src/cli/cli-commands/coder/appendBlock.d.ts +6 -0
  81. package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +10 -0
  82. package/umd/src/cli/cli-commands/coder/ensureCoderEnvFile.d.ts +15 -0
  83. package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +7 -0
  84. package/umd/src/cli/cli-commands/coder/ensureCoderMarkdownFile.d.ts +7 -0
  85. package/umd/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +7 -0
  86. package/umd/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +7 -0
  87. package/umd/src/cli/cli-commands/coder/ensureDirectory.d.ts +7 -0
  88. package/umd/src/cli/cli-commands/coder/find-refactor-candidates.d.ts +1 -1
  89. package/umd/src/cli/cli-commands/coder/find-refactor-candidates.test.d.ts +1 -0
  90. package/umd/src/cli/cli-commands/coder/formatDisplayPath.d.ts +6 -0
  91. package/umd/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
  92. package/umd/src/cli/cli-commands/coder/getDefaultCoderVscodeSettings.d.ts +6 -0
  93. package/umd/src/cli/cli-commands/coder/init.d.ts +3 -38
  94. package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +25 -0
  95. package/umd/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +18 -0
  96. package/umd/src/cli/cli-commands/coder/printInitializationSummary.d.ts +7 -0
  97. package/umd/src/cli/cli-commands/coder/readTextFileIfExists.d.ts +6 -0
  98. package/umd/src/types/string_agent_url.d.ts +7 -0
  99. package/umd/src/types/string_agent_url_private.d.ts +9 -0
  100. package/umd/src/types/string_base64.d.ts +13 -0
  101. package/umd/src/types/string_base64_private.d.ts +2 -2
  102. package/umd/src/types/string_base_url.d.ts +7 -0
  103. package/umd/src/types/string_base_url_private.d.ts +9 -0
  104. package/umd/src/types/string_email.d.ts +13 -0
  105. package/umd/src/types/string_email_private.d.ts +2 -2
  106. package/umd/src/types/string_host.d.ts +42 -0
  107. package/umd/src/types/string_host_private.d.ts +7 -7
  108. package/umd/src/types/string_href.d.ts +19 -0
  109. package/umd/src/types/string_href_private.d.ts +24 -0
  110. package/umd/src/types/string_mime_type.d.ts +15 -0
  111. package/umd/src/types/string_mime_type_private.d.ts +2 -2
  112. package/umd/src/types/string_pipeline_root_url.d.ts +7 -0
  113. package/umd/src/types/string_pipeline_root_url_private.d.ts +9 -0
  114. package/umd/src/types/string_pipeline_url.d.ts +13 -0
  115. package/umd/src/types/string_pipeline_url_private.d.ts +17 -0
  116. package/umd/src/types/string_promptbook_server_url.d.ts +7 -0
  117. package/umd/src/types/string_promptbook_server_url_private.d.ts +9 -0
  118. package/umd/src/types/string_url.d.ts +14 -141
  119. package/umd/src/types/string_url_image.d.ts +7 -0
  120. package/umd/src/types/string_url_image_private.d.ts +9 -0
  121. package/umd/src/types/string_url_private.d.ts +0 -80
  122. package/umd/src/version.d.ts +1 -1
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Props for one faded quoted-message preview rendered inside the chat UI.
3
+ *
4
+ * @private component of `<Chat/>`
5
+ */
6
+ export type ChatReplyPreviewProps = {
7
+ readonly label: string;
8
+ readonly senderLabel: string;
9
+ readonly previewText: string;
10
+ readonly className?: string;
11
+ readonly dismissLabel?: string;
12
+ readonly onDismiss?: () => void;
13
+ };
14
+ /**
15
+ * Renders the common faded preview used for reply bubbles and composer reply mode.
16
+ *
17
+ * @private component of `<Chat/>`
18
+ */
19
+ export declare function ChatReplyPreview(props: ChatReplyPreviewProps): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import type { ChatMessage } from '../types/ChatMessage';
2
2
  /**
3
- * Converts one structured progress card payload into markdown checklist content.
3
+ * Converts one structured progress card payload into markdown content.
4
4
  *
5
5
  * @param progressCard Structured progress card payload.
6
- * @returns Markdown checklist rendered through the normal message markdown pipeline.
6
+ * @returns Markdown rendered through the normal message markdown pipeline.
7
7
  *
8
8
  * @private internal helper of `<ChatMessageItem/>`
9
9
  */
@@ -53,7 +53,7 @@ export type MockedChatDelayConfig = {
53
53
  *
54
54
  * @public exported from `@promptbook/components`
55
55
  */
56
- export type MockedChatProps = Omit<ChatProps, 'onReset' | /*'onMessage' | */ 'onUseTemplate' | 'isVoiceRecognitionButtonShown'> & {
56
+ export type MockedChatProps = Omit<ChatProps, 'onReset' | 'newChatButtonHref' | /*'onMessage' | */ 'onUseTemplate' | 'isVoiceRecognitionButtonShown'> & {
57
57
  /**
58
58
  * Whether the chat can be reset via the "New chat" button.
59
59
  *
@@ -58,6 +58,37 @@ export type ChatProgressCard = {
58
58
  */
59
59
  readonly isVisible?: boolean;
60
60
  };
61
+ /**
62
+ * Serialized reference to an earlier chat message quoted by a reply bubble.
63
+ *
64
+ * Stores the durable relationship (`threadId` + `messageId`) together with a
65
+ * lightweight snapshot of the original message so UIs and prompt builders can
66
+ * render reply context without performing extra fetches.
67
+ *
68
+ * @public exported from `@promptbook/components`
69
+ */
70
+ export type ChatMessageReplyingTo = {
71
+ /**
72
+ * Durable chat thread identifier that owns the replied-to message.
73
+ */
74
+ readonly threadId: string;
75
+ /**
76
+ * Durable identifier of the specific replied-to message inside the thread.
77
+ */
78
+ readonly messageId: string;
79
+ /**
80
+ * Sender of the original replied-to message.
81
+ */
82
+ readonly sender: string;
83
+ /**
84
+ * Original markdown content of the replied-to message.
85
+ */
86
+ readonly content: string_markdown;
87
+ /**
88
+ * Optional list of attachment names from the replied-to message.
89
+ */
90
+ readonly attachmentNames?: ReadonlyArray<string>;
91
+ };
61
92
  /**
62
93
  * Serializable prompt snapshot stored alongside one assistant message for debugging and inspection.
63
94
  */
@@ -243,5 +274,9 @@ export type ChatMessage = Omit<Message<id>, 'direction' | 'recipients' | 'thread
243
274
  * resolved parameters, tool availability, and provider payload associated with one turn.
244
275
  */
245
276
  readonly prompt?: ChatMessagePrompt;
277
+ /**
278
+ * Optional metadata describing which earlier message this one replies to.
279
+ */
280
+ readonly replyingTo?: ChatMessageReplyingTo;
246
281
  };
247
282
  export {};
@@ -0,0 +1,25 @@
1
+ import type { ChatMessage, ChatMessageReplyingTo } from '../types/ChatMessage';
2
+ /**
3
+ * Lightweight message-like shape accepted by reply-preview text helpers.
4
+ *
5
+ * @private helper contract for chat reply previews
6
+ */
7
+ type ChatMessageReplyPreviewSource = Pick<ChatMessage, 'content' | 'attachments'> & {
8
+ readonly attachmentNames?: ChatMessageReplyingTo['attachmentNames'];
9
+ };
10
+ /**
11
+ * Optional settings for reply-preview text generation.
12
+ *
13
+ * @private helper contract for chat reply previews
14
+ */
15
+ type ResolveChatMessageReplyPreviewTextOptions = {
16
+ readonly maxLength?: number;
17
+ readonly emptyLabel?: string;
18
+ };
19
+ /**
20
+ * Resolves one compact plain-text preview for reply UI surfaces and prompt context.
21
+ *
22
+ * @private helper for chat reply previews
23
+ */
24
+ export declare function resolveChatMessageReplyPreviewText(source: ChatMessageReplyPreviewSource, options?: ResolveChatMessageReplyPreviewTextOptions): string;
25
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { ChatMessage } from '../types/ChatMessage';
2
+ import type { ChatParticipant } from '../types/ChatParticipant';
3
+ /**
4
+ * Resolves the human-readable sender label shown in reply previews.
5
+ *
6
+ * @private helper for chat reply previews
7
+ */
8
+ export declare function resolveChatMessageReplySenderLabel(options: {
9
+ sender: ChatMessage['sender'];
10
+ participants?: ReadonlyArray<ChatParticipant>;
11
+ fallbackLabel?: string;
12
+ }): string;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Relative path to the Promptbook Coder quick-reference file initialized in project roots.
3
+ *
4
+ * @private internal utility of `ptbk coder`
5
+ */
6
+ export declare const AGENT_CODING_FILE_PATH = "AGENT_CODING.md";
7
+ /**
8
+ * Returns the default coder `AGENT_CODING.md` quick-reference content.
9
+ *
10
+ * @private internal utility of `ptbk coder`
11
+ */
12
+ export declare function getDefaultCoderAgentCodingFileContent({ packageJsonScripts, }: {
13
+ readonly packageJsonScripts: Readonly<Record<string, string>>;
14
+ }): string;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Relative path to the shared coder context file initialized in project roots.
3
+ *
4
+ * @private internal utility of `ptbk coder`
5
+ */
6
+ export declare const AGENTS_FILE_PATH = "AGENTS.md";
7
+ /**
8
+ * Returns the default coder `AGENTS.md` boilerplate instructions.
9
+ *
10
+ * @private internal utility of `ptbk coder`
11
+ */
12
+ export declare function getDefaultCoderAgentsFileContent(): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Appends one text block to existing file content while preserving readable newlines.
3
+ *
4
+ * @private function of `initializeCoderProjectConfiguration`
5
+ */
6
+ export declare function appendBlock(currentContent: string, blockToAppend: string): string;
@@ -50,6 +50,10 @@ export type CoderPromptTemplateDefinition = {
50
50
  * Markdown content of the template.
51
51
  */
52
52
  readonly content: string;
53
+ /**
54
+ * Whether `ptbk coder init` should materialize this template into project-owned files.
55
+ */
56
+ readonly isDefaultProjectTemplate: boolean;
53
57
  };
54
58
  /**
55
59
  * Result of ensuring one default coder template file exists inside a project.
@@ -99,6 +103,12 @@ export type ResolvedCoderPromptTemplate = {
99
103
  * @private internal utility of `ptbk coder`
100
104
  */
101
105
  export declare function getDefaultCoderPromptTemplateDefinitions(): ReadonlyArray<CoderPromptTemplateDefinition>;
106
+ /**
107
+ * Lists the built-in coder prompt templates that are safe to initialize in any project.
108
+ *
109
+ * @private internal utility of `ptbk coder`
110
+ */
111
+ export declare function getDefaultCoderProjectPromptTemplateDefinitions(): ReadonlyArray<CoderPromptTemplateDefinition>;
102
112
  /**
103
113
  * Resolves one built-in coder boilerplate template definition by its stable identifier.
104
114
  *
@@ -0,0 +1,15 @@
1
+ import type { InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Result of ensuring coder environment variables inside `.env`.
4
+ */
5
+ type EnsureCoderEnvFileResult = {
6
+ readonly envFileStatus: InitializationStatus;
7
+ readonly initializedEnvVariableNames: ReadonlyArray<string>;
8
+ };
9
+ /**
10
+ * Ensures `.env` exists and contains all required coder environment variables.
11
+ *
12
+ * @private function of `initializeCoderProjectConfiguration`
13
+ */
14
+ export declare function ensureCoderEnvFile(projectPath: string): Promise<EnsureCoderEnvFileResult>;
15
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Ensures `.gitignore` contains the standalone Promptbook coder cache entry.
4
+ *
5
+ * @private function of `initializeCoderProjectConfiguration`
6
+ */
7
+ export declare function ensureCoderGitignoreFile(projectPath: string): Promise<InitializationStatus>;
@@ -0,0 +1,7 @@
1
+ import type { InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Ensures one coder markdown file exists with the provided default boilerplate.
4
+ *
5
+ * @private function of `initializeCoderProjectConfiguration`
6
+ */
7
+ export declare function ensureCoderMarkdownFile(projectPath: string, relativeFilePath: string, fileContent: string): Promise<InitializationStatus>;
@@ -0,0 +1,7 @@
1
+ import type { InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Ensures `package.json` contains the standalone Promptbook coder helper scripts.
4
+ *
5
+ * @private function of `initializeCoderProjectConfiguration`
6
+ */
7
+ export declare function ensureCoderPackageJsonFile(projectPath: string): Promise<InitializationStatus>;
@@ -0,0 +1,7 @@
1
+ import type { InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Ensures VS Code routes pasted prompt images into `prompts/screenshots`.
4
+ *
5
+ * @private function of `initializeCoderProjectConfiguration`
6
+ */
7
+ export declare function ensureCoderVscodeSettingsFile(projectPath: string): Promise<InitializationStatus>;
@@ -0,0 +1,7 @@
1
+ import type { InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Ensures a relative directory exists in the project root.
4
+ *
5
+ * @private function of `initializeCoderProjectConfiguration`
6
+ */
7
+ export declare function ensureDirectory(projectPath: string, relativeDirectoryPath: string): Promise<InitializationStatus>;
@@ -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 `coder find-refactor-candidates` command for Promptbook CLI utilities
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Normalizes one project-relative path for human-readable CLI output and markdown.
3
+ *
4
+ * @private internal utility of `ptbk coder`
5
+ */
6
+ export declare function formatDisplayPath(relativePath: string): string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Lists the default npm scripts initialized by `ptbk coder init`.
3
+ *
4
+ * @private internal utility of `coder init` command
5
+ */
6
+ export declare function getDefaultCoderPackageJsonScripts(): Readonly<Record<string, string>>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Lists the default VS Code settings initialized by `ptbk coder init`.
3
+ *
4
+ * @private internal utility of `coder init` command
5
+ */
6
+ export declare function getDefaultCoderVscodeSettings(): Readonly<Record<string, Readonly<Record<string, string>>>>;
@@ -1,24 +1,8 @@
1
1
  import type { Command as Program } from 'commander';
2
2
  import type { $side_effect } from '../../../utils/organization/$side_effect';
3
- import { type EnsuredCoderPromptTemplateFile, type InitializationStatus } from './boilerplateTemplates';
4
- /**
5
- * Generic JSON object used for standalone coder configuration files.
6
- */
7
- type JsonObject = Record<string, unknown>;
8
- /**
9
- * Result summary returned after coder configuration initialization.
10
- */
11
- type CoderInitializationSummary = {
12
- readonly promptsDirectoryStatus: InitializationStatus;
13
- readonly promptsDoneDirectoryStatus: InitializationStatus;
14
- readonly promptsTemplatesDirectoryStatus: InitializationStatus;
15
- readonly promptTemplateFileStatuses: ReadonlyArray<EnsuredCoderPromptTemplateFile>;
16
- readonly envFileStatus: InitializationStatus;
17
- readonly gitignoreFileStatus: InitializationStatus;
18
- readonly packageJsonFileStatus: InitializationStatus;
19
- readonly vscodeSettingsFileStatus: InitializationStatus;
20
- readonly initializedEnvVariableNames: ReadonlyArray<string>;
21
- };
3
+ export { getDefaultCoderPackageJsonScripts } from './getDefaultCoderPackageJsonScripts';
4
+ export { getDefaultCoderVscodeSettings } from './getDefaultCoderVscodeSettings';
5
+ export { initializeCoderProjectConfiguration } from './initializeCoderProjectConfiguration';
22
6
  /**
23
7
  * Initializes `coder init` command for Promptbook CLI utilities.
24
8
  *
@@ -27,22 +11,3 @@ type CoderInitializationSummary = {
27
11
  * @private internal function of `promptbookCli`
28
12
  */
29
13
  export declare function $initializeCoderInitCommand(program: Program): $side_effect;
30
- /**
31
- * Lists the default npm scripts initialized by `ptbk coder init`.
32
- *
33
- * @private internal utility of `coder init` command
34
- */
35
- export declare function getDefaultCoderPackageJsonScripts(): Readonly<Record<string, string>>;
36
- /**
37
- * Lists the default VS Code settings initialized by `ptbk coder init`.
38
- *
39
- * @private internal utility of `coder init` command
40
- */
41
- export declare function getDefaultCoderVscodeSettings(): Readonly<JsonObject>;
42
- /**
43
- * Creates or updates all coder configuration artifacts required in the current project.
44
- *
45
- * @private internal utility of `coder init` command
46
- */
47
- export declare function initializeCoderProjectConfiguration(projectPath: string): Promise<CoderInitializationSummary>;
48
- export {};
@@ -0,0 +1,25 @@
1
+ import { type EnsuredCoderPromptTemplateFile, type InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Result summary returned after coder configuration initialization.
4
+ *
5
+ * @private internal utility of `coder init` command
6
+ */
7
+ export type CoderInitializationSummary = {
8
+ readonly promptsDirectoryStatus: InitializationStatus;
9
+ readonly promptsDoneDirectoryStatus: InitializationStatus;
10
+ readonly promptsTemplatesDirectoryStatus: InitializationStatus;
11
+ readonly promptTemplateFileStatuses: ReadonlyArray<EnsuredCoderPromptTemplateFile>;
12
+ readonly agentsFileStatus: InitializationStatus;
13
+ readonly agentCodingFileStatus: InitializationStatus;
14
+ readonly envFileStatus: InitializationStatus;
15
+ readonly gitignoreFileStatus: InitializationStatus;
16
+ readonly packageJsonFileStatus: InitializationStatus;
17
+ readonly vscodeSettingsFileStatus: InitializationStatus;
18
+ readonly initializedEnvVariableNames: ReadonlyArray<string>;
19
+ };
20
+ /**
21
+ * Creates or updates all coder configuration artifacts required in the current project.
22
+ *
23
+ * @private internal utility of `coder init` command
24
+ */
25
+ export declare function initializeCoderProjectConfiguration(projectPath: string): Promise<CoderInitializationSummary>;
@@ -0,0 +1,18 @@
1
+ import type { InitializationStatus } from './boilerplateTemplates';
2
+ /**
3
+ * Parameters controlling one string-record merge into a JSON file.
4
+ */
5
+ type MergeStringRecordJsonFileOptions = {
6
+ readonly projectPath: string;
7
+ readonly relativeFilePath: string;
8
+ readonly fieldPath: string;
9
+ readonly nextEntries: Readonly<Record<string, string>>;
10
+ readonly ensureParentDirectoryPath?: string;
11
+ };
12
+ /**
13
+ * Ensures one JSON object field contains the provided string-record entries.
14
+ *
15
+ * @private function of `initializeCoderProjectConfiguration`
16
+ */
17
+ export declare function mergeStringRecordJsonFile({ projectPath, relativeFilePath, fieldPath, nextEntries, ensureParentDirectoryPath, }: MergeStringRecordJsonFileOptions): Promise<InitializationStatus>;
18
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { CoderInitializationSummary } from './initializeCoderProjectConfiguration';
2
+ /**
3
+ * Prints a readable summary of what was initialized for the user.
4
+ *
5
+ * @private function of `coder init` command
6
+ */
7
+ export declare function printInitializationSummary(summary: CoderInitializationSummary): void;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Reads one text file when it exists, otherwise returns `undefined`.
3
+ *
4
+ * @private function of `initializeCoderProjectConfiguration`
5
+ */
6
+ export declare function readTextFileIfExists(path: string): Promise<string | undefined>;
@@ -0,0 +1,7 @@
1
+ import type { string_agent_url_private } from './string_agent_url_private';
2
+ /**
3
+ * Semantic helper
4
+ *
5
+ * For example `"https://s6.ptbk.io/agents/agent-007"`
6
+ */
7
+ export type string_agent_url = string_agent_url_private;
@@ -0,0 +1,9 @@
1
+ import type { string_url_private } from './string_url_private';
2
+ /**
3
+ * Semantic helper
4
+ *
5
+ * For example `"https://s6.ptbk.io/agents/agent-007"`
6
+ *
7
+ * @private internal utility of `string_agent_url.ts`
8
+ */
9
+ export type string_agent_url_private = string_url_private;
@@ -0,0 +1,13 @@
1
+ import type { string_base64_private, string_data_url_private } from './string_base64_private';
2
+ /**
3
+ * Semantic helper
4
+ *
5
+ * For example `"SGVsbG8sIFdvcmxkIQ=="`
6
+ */
7
+ export type string_base64 = string_base64_private;
8
+ /**
9
+ * Semantic helper
10
+ *
11
+ * For example `"data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="`
12
+ */
13
+ export type string_data_url = string_data_url_private;
@@ -4,7 +4,7 @@ import type { string_mime_type_private } from './string_mime_type_private';
4
4
  *
5
5
  * For example `"SGVsbG8sIFdvcmxkIQ=="`
6
6
  *
7
- * @private internal utility of `string_url.ts`
7
+ * @private internal utility of `string_base64.ts`
8
8
  */
9
9
  export type string_base64_private = string;
10
10
  /**
@@ -12,6 +12,6 @@ export type string_base64_private = string;
12
12
  *
13
13
  * For example `"data:text/plain;base64,SGVsbG8sIFdvcmxkIQ=="`
14
14
  *
15
- * @private internal utility of `string_url.ts`
15
+ * @private internal utility of `string_base64.ts`
16
16
  */
17
17
  export type string_data_url_private = `data:${string_mime_type_private};base64,${string_base64_private}`;
@@ -0,0 +1,7 @@
1
+ import type { string_base_url_private } from './string_base_url_private';
2
+ /**
3
+ * Semantic helper
4
+ *
5
+ * For example `"https://collboard.com"`
6
+ */
7
+ export type string_base_url = string_base_url_private;
@@ -0,0 +1,9 @@
1
+ import type { string_url_private } from './string_url_private';
2
+ /**
3
+ * Semantic helper
4
+ *
5
+ * For example `"https://collboard.com"`
6
+ *
7
+ * @private internal utility of `string_base_url.ts`
8
+ */
9
+ export type string_base_url_private = string_url_private;
@@ -0,0 +1,13 @@
1
+ import type { string_email_private, string_emails_private } from './string_email_private';
2
+ /**
3
+ * Semantic helper
4
+ *
5
+ * For example `"pavol@hejny.org"`
6
+ */
7
+ export type string_email = string_email_private;
8
+ /**
9
+ * Semantic helper
10
+ *
11
+ * For example `"pavol@hejny.org, jirka@webgpt.cz"`
12
+ */
13
+ export type string_emails = string_emails_private;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * For example `"pavol@hejny.org"`
5
5
  *
6
- * @private internal utility of `string_url.ts`
6
+ * @private internal utility of `string_email.ts`
7
7
  */
8
8
  export type string_email_private = string;
9
9
  /**
@@ -11,6 +11,6 @@ export type string_email_private = string;
11
11
  *
12
12
  * For example `"pavol@hejny.org, jirka@webgpt.cz"`
13
13
  *
14
- * @private internal utility of `string_url.ts`
14
+ * @private internal utility of `string_email.ts`
15
15
  */
16
16
  export type string_emails_private = string;
@@ -0,0 +1,42 @@
1
+ import type { string_domain_private, string_host_private, string_hostname_private, string_ip_address_private, string_origin_private, string_protocol_private, string_tdl_private } from './string_host_private';
2
+ /**
3
+ * Semantic helper
4
+ *
5
+ * For example `"towns.cz"`
6
+ */
7
+ export type string_domain = string_domain_private;
8
+ /**
9
+ * Semantic helper
10
+ *
11
+ * For example `"https://*.pavolhejny.com/*"`
12
+ */
13
+ export type string_origin = string_origin_private;
14
+ /**
15
+ * Semantic helper
16
+ *
17
+ * For example `"com"`
18
+ */
19
+ export type string_tdl = string_tdl_private;
20
+ /**
21
+ * Semantic helper
22
+ *
23
+ * For example `"localhost"` or `"collboard.com"`
24
+ */
25
+ export type string_hostname = string_hostname_private;
26
+ /**
27
+ * Semantic helper
28
+ *
29
+ * For example `"localhost:9977"` or `"collboard.com"`
30
+ */
31
+ export type string_host = string_host_private;
32
+ /**
33
+ * Semantic helper
34
+ */
35
+ export type string_protocol = string_protocol_private;
36
+ /**
37
+ * Semantic helper
38
+ *
39
+ * For example `"192.168.1.1"` (IPv4)
40
+ * For example `"2001:0db8:85a3:0000:0000:8a2e:0370:7334"` (IPv6)
41
+ */
42
+ export type string_ip_address = string_ip_address_private;
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * For example `"towns.cz"`
5
5
  *
6
- * @private internal utility of `string_url.ts`
6
+ * @private internal utility of `string_host.ts`
7
7
  */
8
8
  export type string_domain_private = string;
9
9
  /**
@@ -11,7 +11,7 @@ export type string_domain_private = string;
11
11
  *
12
12
  * For example `"https://*.pavolhejny.com/*"`
13
13
  *
14
- * @private internal utility of `string_url.ts`
14
+ * @private internal utility of `string_host.ts`
15
15
  */
16
16
  export type string_origin_private = string;
17
17
  /**
@@ -19,7 +19,7 @@ export type string_origin_private = string;
19
19
  *
20
20
  * For example `"com"`
21
21
  *
22
- * @private internal utility of `string_url.ts`
22
+ * @private internal utility of `string_host.ts`
23
23
  */
24
24
  export type string_tdl_private = string;
25
25
  /**
@@ -27,7 +27,7 @@ export type string_tdl_private = string;
27
27
  *
28
28
  * For example `"localhost"` or `"collboard.com"`
29
29
  *
30
- * @private internal utility of `string_url.ts`
30
+ * @private internal utility of `string_host.ts`
31
31
  */
32
32
  export type string_hostname_private = string;
33
33
  /**
@@ -35,13 +35,13 @@ export type string_hostname_private = string;
35
35
  *
36
36
  * For example `"localhost:9977"` or `"collboard.com"`
37
37
  *
38
- * @private internal utility of `string_url.ts`
38
+ * @private internal utility of `string_host.ts`
39
39
  */
40
40
  export type string_host_private = string;
41
41
  /**
42
42
  * Semantic helper
43
43
  *
44
- * @private internal utility of `string_url.ts`
44
+ * @private internal utility of `string_host.ts`
45
45
  */
46
46
  export type string_protocol_private = 'http:' | 'https:';
47
47
  /**
@@ -50,6 +50,6 @@ export type string_protocol_private = 'http:' | 'https:';
50
50
  * For example `"192.168.1.1"` (IPv4)
51
51
  * For example `"2001:0db8:85a3:0000:0000:8a2e:0370:7334"` (IPv6)
52
52
  *
53
- * @private internal utility of `string_url.ts`
53
+ * @private internal utility of `string_host.ts`
54
54
  */
55
55
  export type string_ip_address_private = string;
@@ -0,0 +1,19 @@
1
+ import type { string_href_private, string_uri_part_private, string_uri_private } from './string_href_private';
2
+ /**
3
+ * Semantic helper
4
+ *
5
+ * For example `"https://collboard.com/9SeSQTupmQHwuSrLi"` OR `/9SeSQTupmQHwuSrLi`
6
+ */
7
+ export type string_href = string_href_private;
8
+ /**
9
+ * Semantic helper
10
+ *
11
+ * For example `"/9SeSQTupmQHwuSrLi"`
12
+ */
13
+ export type string_uri = string_uri_private;
14
+ /**
15
+ * Semantic helper
16
+ *
17
+ * For example `"9SeSQTupmQHwuSrLi"`
18
+ */
19
+ export type string_uri_part = string_uri_part_private;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Semantic helper
3
+ *
4
+ * For example `"https://collboard.com/9SeSQTupmQHwuSrLi"` OR `/9SeSQTupmQHwuSrLi`
5
+ *
6
+ * @private internal utility of `string_href.ts`
7
+ */
8
+ export type string_href_private = string;
9
+ /**
10
+ * Semantic helper
11
+ *
12
+ * For example `"/9SeSQTupmQHwuSrLi"`
13
+ *
14
+ * @private internal utility of `string_href.ts`
15
+ */
16
+ export type string_uri_private = string;
17
+ /**
18
+ * Semantic helper
19
+ *
20
+ * For example `"9SeSQTupmQHwuSrLi"`
21
+ *
22
+ * @private internal utility of `string_href.ts`
23
+ */
24
+ export type string_uri_part_private = string;