@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.
Files changed (113) hide show
  1. package/README.md +16 -15
  2. package/apps/agents-server/package.json +6 -4
  3. package/apps/agents-server/playwright.config.ts +28 -38
  4. package/apps/agents-server/scripts/build-agents-server.js +62 -0
  5. package/apps/agents-server/scripts/build-e2e.js +38 -0
  6. package/apps/agents-server/scripts/ensure-root-dependencies.js +86 -0
  7. package/apps/agents-server/scripts/prerender-homepage.js +1 -1
  8. package/apps/agents-server/scripts/run-e2e-tests.js +34 -0
  9. package/apps/agents-server/scripts/run-npm.js +42 -0
  10. package/apps/agents-server/src/app/admin/email-server/page.tsx +14 -6
  11. package/apps/agents-server/src/app/api/elevenlabs/tts/route.ts +3 -3
  12. package/apps/agents-server/src/app/api/onboarding/book/route.ts +7 -6
  13. package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +105 -102
  14. package/apps/agents-server/src/app/superadmin/servers/useServersRegistryState.ts +15 -7
  15. package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +11 -11
  16. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ManGoBookEditor.tsx +82 -0
  17. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/WizardShell.tsx +2 -2
  18. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/BookStep.tsx +13 -16
  19. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/ZadaniStep.tsx +4 -4
  20. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/config/bookSections.ts +23 -16
  21. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/lib/bookSource.ts +54 -0
  22. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/bookService.ts +15 -8
  23. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoAgentSource.ts +3 -37
  24. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoOpenEditorRequest.ts +1 -1
  25. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/OnboardingProvider.tsx +2 -2
  26. package/apps/agents-server/src/components/UsersList/CreateUserDialog.tsx +13 -22
  27. package/apps/agents-server/src/components/UsersList/PasswordGeneratorDialog.tsx +216 -0
  28. package/apps/agents-server/src/components/UsersList/UsersList.tsx +16 -11
  29. package/apps/agents-server/src/components/UsersList/generateSecurePassword.ts +112 -24
  30. package/apps/agents-server/src/components/UsersList/userDialogClassNames.ts +11 -0
  31. package/apps/agents-server/src/languages/ServerTranslationKeys.ts +11 -0
  32. package/apps/agents-server/src/languages/translations/czech.yaml +11 -0
  33. package/apps/agents-server/src/languages/translations/english.yaml +11 -0
  34. package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +11 -0
  35. package/apps/agents-server/src/utils/agentProjects/createAgentProjectDnsRecords.ts +53 -7
  36. package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +37 -27
  37. package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +2 -13
  38. package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime.ts +21 -73
  39. package/apps/agents-server/src/utils/stalwart/createEmailDnsInstructions.ts +9 -5
  40. package/apps/agents-server/src/utils/stalwart/readStalwartEmailSnapshot.ts +23 -5
  41. package/apps/agents-server/src/utils/stalwart/stalwartBootstrap.ts +2 -1
  42. package/apps/agents-server/src/utils/stalwart/stalwartMailBridge.ts +7 -0
  43. package/apps/agents-server/tests/e2e/e2eEnvironment.cjs +49 -0
  44. package/esm/index.es.js +523 -169
  45. package/esm/index.es.js.map +1 -1
  46. package/esm/scripts/run-agent-chat/runCoderPing.d.ts +48 -0
  47. package/esm/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
  48. package/esm/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +27 -0
  49. package/esm/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
  50. package/esm/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
  51. package/esm/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +7 -0
  52. package/esm/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +16 -0
  53. package/esm/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +9 -0
  54. package/esm/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +4 -0
  55. package/esm/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -2
  56. package/esm/scripts/run-codex-prompts/testing/runTestBefore.d.ts +24 -0
  57. package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -0
  58. package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
  59. package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
  60. package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
  61. package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
  62. package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
  63. package/esm/src/cli/cli-commands/coder/ping.d.ts +13 -0
  64. package/esm/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
  65. package/esm/src/cli/cli-commands/coder.d.ts +1 -0
  66. package/package.json +1 -1
  67. package/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.ts +1 -15
  68. package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +1 -2
  69. package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +92 -32
  70. package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +16 -39
  71. package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +16 -36
  72. package/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.ts +9 -1
  73. package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +4 -51
  74. package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +291 -4
  75. package/src/book-components/Chat/utils/renderMarkdown.ts +133 -9
  76. package/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.ts +1 -0
  77. package/src/cli/cli-commands/coder/agentCodingFile.ts +6 -129
  78. package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +1 -1
  79. package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +1 -4
  80. package/src/cli/cli-commands/coder/ping.ts +94 -0
  81. package/src/cli/cli-commands/coder/run.ts +25 -2
  82. package/src/cli/cli-commands/coder.ts +4 -0
  83. package/src/other/templates/getTemplatesPipelineCollection.ts +805 -842
  84. package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +101 -0
  85. package/src/version.ts +1 -1
  86. package/src/versions.txt +1 -1
  87. package/umd/index.umd.js +525 -171
  88. package/umd/index.umd.js.map +1 -1
  89. package/umd/scripts/run-agent-chat/runCoderPing.d.ts +48 -0
  90. package/umd/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
  91. package/umd/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +27 -0
  92. package/umd/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
  93. package/umd/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
  94. package/umd/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +7 -0
  95. package/umd/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +16 -0
  96. package/umd/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +9 -0
  97. package/umd/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +4 -0
  98. package/umd/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -2
  99. package/umd/scripts/run-codex-prompts/testing/runTestBefore.d.ts +24 -0
  100. package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -0
  101. package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
  102. package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
  103. package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
  104. package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
  105. package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
  106. package/umd/src/cli/cli-commands/coder/ping.d.ts +13 -0
  107. package/umd/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
  108. package/umd/src/cli/cli-commands/coder.d.ts +1 -0
  109. package/apps/agents-server/src/app/api/onboarding/draft/route.ts +0 -23
  110. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/BookLanguagePanel.tsx +0 -125
  111. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownBookEditor.tsx +0 -154
  112. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownPreview.tsx +0 -188
  113. package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/draftService.ts +0 -32
@@ -21,6 +21,11 @@ type RuntimeLogEvent = {
21
21
  readonly text?: string;
22
22
  }>;
23
23
  };
24
+ readonly item?: {
25
+ readonly type?: string;
26
+ readonly command?: string;
27
+ readonly exit_code?: number | null;
28
+ };
24
29
  };
25
30
 
26
31
  /**
@@ -89,6 +94,11 @@ function parseRuntimeLogEvent(line: string): RuntimeLogEvent | null {
89
94
  * @private internal helper of `resolveAgentMessageRuntimeActivity`
90
95
  */
91
96
  function resolveRuntimeLogEventActivity(event: RuntimeLogEvent): string | null {
97
+ const codexActivity = resolveCodexRuntimeLogEventActivity(event);
98
+ if (codexActivity) {
99
+ return codexActivity;
100
+ }
101
+
92
102
  if (event.type !== 'assistant' || !Array.isArray(event.message?.content)) {
93
103
  return null;
94
104
  }
@@ -103,6 +113,97 @@ function resolveRuntimeLogEventActivity(event: RuntimeLogEvent): string | null {
103
113
  return assistantText.length > 0 ? assistantText : null;
104
114
  }
105
115
 
116
+ /**
117
+ * Resolves one short user-facing status from a structured Codex JSONL event.
118
+ *
119
+ * Codex reasoning and raw command text deliberately remain private. The event type tells us
120
+ * enough to report a useful action without exposing the internal trace or a command payload.
121
+ *
122
+ * @private internal helper of `resolveAgentMessageRuntimeActivity`
123
+ */
124
+ function resolveCodexRuntimeLogEventActivity(event: RuntimeLogEvent): string | null {
125
+ if (!event.item || !isCodexItemEvent(event.type)) {
126
+ return null;
127
+ }
128
+
129
+ const isCompleted = event.type === 'item.completed';
130
+
131
+ switch (event.item.type) {
132
+ case 'reasoning':
133
+ return isCompleted ? 'Considered the request.' : 'Considering the request.';
134
+ case 'command_execution':
135
+ return resolveCodexCommandActivity(event.item.command, isCompleted, event.item.exit_code);
136
+ case 'file_change':
137
+ return isCompleted ? 'Updated relevant files.' : 'Updating relevant files.';
138
+ case 'web_search':
139
+ return isCompleted ? 'Finished searching the web.' : 'Searching the web.';
140
+ case 'mcp_tool_call':
141
+ return isCompleted ? 'Finished using an integration.' : 'Using an integration.';
142
+ case 'plan_update':
143
+ return isCompleted ? 'Updated the plan.' : 'Planning the work.';
144
+ default:
145
+ return null;
146
+ }
147
+ }
148
+
149
+ /**
150
+ * Returns whether one runtime event is a Codex item lifecycle event.
151
+ *
152
+ * @private internal helper of `resolveAgentMessageRuntimeActivity`
153
+ */
154
+ function isCodexItemEvent(eventType: string | undefined): boolean {
155
+ return eventType === 'item.started' || eventType === 'item.updated' || eventType === 'item.completed';
156
+ }
157
+
158
+ /**
159
+ * Maps one Codex command event to a concise action without revealing the command itself.
160
+ *
161
+ * @private internal helper of `resolveAgentMessageRuntimeActivity`
162
+ */
163
+ function resolveCodexCommandActivity(
164
+ command: string | undefined,
165
+ isCompleted: boolean,
166
+ exitCode: number | null | undefined,
167
+ ): string {
168
+ if (isCompleted && exitCode !== undefined && exitCode !== null && exitCode !== 0) {
169
+ return 'A command needs attention.';
170
+ }
171
+
172
+ const activity = resolveCodexCommandActivityLabel(command);
173
+ return isCompleted ? activity.completed : activity.running;
174
+ }
175
+
176
+ /**
177
+ * Resolves the short running/completed labels for one safe command category.
178
+ *
179
+ * @private internal helper of `resolveAgentMessageRuntimeActivity`
180
+ */
181
+ function resolveCodexCommandActivityLabel(command: string | undefined): { running: string; completed: string } {
182
+ const normalizedCommand = command?.toLowerCase() || '';
183
+
184
+ if (/(^|\s)(npm\s+(?:run\s+)?test|pnpm\s+(?:run\s+)?test|yarn\s+test|jest|vitest|pytest)\b/u.test(normalizedCommand)) {
185
+ return { running: 'Running tests.', completed: 'Finished running tests.' };
186
+ }
187
+
188
+ if (/(^|\s)(npm\s+run\s+build|pnpm\s+(?:run\s+)?build|yarn\s+build|next\s+build)\b/u.test(normalizedCommand)) {
189
+ return { running: 'Building the project.', completed: 'Finished building the project.' };
190
+ }
191
+
192
+ if (/(^|\s)(npm|pnpm|yarn)\s+(?:install|add)\b/u.test(normalizedCommand)) {
193
+ return { running: 'Installing dependencies.', completed: 'Finished installing dependencies.' };
194
+ }
195
+
196
+ if (/(^|\s)git\s+(?:status|diff|log|show)\b/u.test(normalizedCommand)) {
197
+ return { running: 'Reviewing changes.', completed: 'Finished reviewing changes.' };
198
+ }
199
+
200
+ if (/(^|\s)(ls|find|rg|grep|sed|cat|head|tail)\b/u.test(normalizedCommand)) {
201
+ return { running: 'Inspecting relevant files.', completed: 'Finished inspecting relevant files.' };
202
+ }
203
+
204
+ return { running: 'Running a task.', completed: 'Finished a task.' };
205
+ }
206
+
106
207
  /**
107
208
  * Collapses one activity string to a single trimmed line, truncated for the progress card.
108
209
  *
package/src/version.ts CHANGED
@@ -16,7 +16,7 @@ export const BOOK_LANGUAGE_VERSION: string_semantic_version = '2.0.0';
16
16
  * @generated
17
17
  * @see https://github.com/webgptorg/promptbook
18
18
  */
19
- export const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version = '0.114.0-0';
19
+ export const PROMPTBOOK_ENGINE_VERSION: string_promptbook_version = '0.114.0-2';
20
20
 
21
21
  /**
22
22
  * Represents the version string of the Promptbook engine.
package/src/versions.txt CHANGED
@@ -1179,4 +1179,4 @@
1179
1179
  0.113.0-14
1180
1180
  0.113.0
1181
1181
  0.113.1-0
1182
- 0.114.0-0
1182
+ 0.114.0-2