@promptbook/cli 0.112.0-132 → 0.112.0-134

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 (101) hide show
  1. package/apps/agents-server/src/app/admin/api-tokens/ApiTokensClient.tsx +4 -1
  2. package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackClient.tsx +3 -0
  3. package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackTable.tsx +13 -8
  4. package/apps/agents-server/src/app/admin/chat-history/ChatHistoryClient.tsx +3 -0
  5. package/apps/agents-server/src/app/admin/chat-history/ChatHistoryTable.tsx +13 -8
  6. package/apps/agents-server/src/app/admin/custom-css/CustomCssClient.tsx +4 -0
  7. package/apps/agents-server/src/app/admin/custom-css/CustomCssEditorPanel.tsx +7 -1
  8. package/apps/agents-server/src/app/admin/custom-css/CustomCssFilesPanel.tsx +7 -1
  9. package/apps/agents-server/src/app/admin/custom-js/CustomJsClient.tsx +4 -0
  10. package/apps/agents-server/src/app/admin/custom-js/CustomJsEditorPanel.tsx +7 -1
  11. package/apps/agents-server/src/app/admin/custom-js/CustomJsFilesPanel.tsx +7 -1
  12. package/apps/agents-server/src/app/admin/files/FilesGalleryClient.tsx +4 -0
  13. package/apps/agents-server/src/app/admin/files/FilesGalleryGrid.tsx +9 -11
  14. package/apps/agents-server/src/app/admin/files/FilesGalleryTable.tsx +9 -8
  15. package/apps/agents-server/src/app/admin/images/ImagesGalleryClient.tsx +4 -0
  16. package/apps/agents-server/src/app/admin/images/ImagesGalleryGrid.tsx +16 -11
  17. package/apps/agents-server/src/app/admin/images/ImagesGalleryTable.tsx +18 -9
  18. package/apps/agents-server/src/app/admin/login-methods/shibboleth/page.tsx +9 -9
  19. package/apps/agents-server/src/app/admin/messages/MessagesClient.tsx +7 -6
  20. package/apps/agents-server/src/app/admin/servers/ServersRegistryTable.tsx +11 -10
  21. package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +4 -2
  22. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +14 -15
  23. package/apps/agents-server/src/app/admin/task-manager/TaskManagerTasksCard.tsx +4 -1
  24. package/apps/agents-server/src/app/admin/task-manager/useTaskManagerState.ts +6 -9
  25. package/apps/agents-server/src/app/admin/update/CustomCommitPicker.tsx +258 -0
  26. package/apps/agents-server/src/app/admin/update/UpdateClient.tsx +305 -108
  27. package/apps/agents-server/src/app/admin/usage/UsageClient.tsx +4 -2
  28. package/apps/agents-server/src/app/admin/usage/UsageClientAnalyticsPanels.tsx +6 -4
  29. package/apps/agents-server/src/app/admin/usage/UsageClientFormatting.ts +6 -12
  30. package/apps/agents-server/src/app/admin/usage/UsageClientTimelineChart.tsx +6 -3
  31. package/apps/agents-server/src/app/admin/usage/useUsageClientState.ts +12 -4
  32. package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +8 -3
  33. package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +6 -20
  34. package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +2 -0
  35. package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorHistory.ts +9 -2
  36. package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatHistoryClientState.ts +2 -15
  37. package/apps/agents-server/src/app/agents/[agentName]/history/page.tsx +6 -1
  38. package/apps/agents-server/src/app/agents/[agentName]/integration/CalendarIntegrationSection.tsx +23 -5
  39. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +4 -2
  40. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +9 -4
  41. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +4 -1
  42. package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +10 -3
  43. package/apps/agents-server/src/app/api/admin/update/commits/route.ts +35 -0
  44. package/apps/agents-server/src/app/api/admin/update/route.ts +10 -2
  45. package/apps/agents-server/src/app/api/agents/[agentName]/route.ts +5 -0
  46. package/apps/agents-server/src/app/api/internal/user-chat-jobs/run/route.ts +14 -2
  47. package/apps/agents-server/src/app/api/v1/agents/[agentId]/route.ts +4 -0
  48. package/apps/agents-server/src/app/api/v1/agents/route.ts +2 -0
  49. package/apps/agents-server/src/app/dashboard/page.tsx +11 -16
  50. package/apps/agents-server/src/app/recycle-bin/actions.ts +3 -0
  51. package/apps/agents-server/src/app/swagger/SwaggerApiKeysPanel.tsx +4 -1
  52. package/apps/agents-server/src/app/system/user-memory/UserMemoryClient.tsx +4 -2
  53. package/apps/agents-server/src/app/system/user-wallet/UserWalletClient.tsx +3 -0
  54. package/apps/agents-server/src/app/system/user-wallet/UserWalletRecordsTable.tsx +5 -1
  55. package/apps/agents-server/src/app/system/utilities/mocked-chats/MockedChatsEditorClient.tsx +3 -0
  56. package/apps/agents-server/src/app/system/utilities/mocked-chats/MockedChatsEditorSidebar.tsx +7 -8
  57. package/apps/agents-server/src/components/PrintHeader/PrintHeader.tsx +4 -2
  58. package/apps/agents-server/src/components/UsersList/UsersList.tsx +4 -2
  59. package/apps/agents-server/src/database/migrations/2026-06-2600-agent-directory-performance-indexes.sql +14 -0
  60. package/apps/agents-server/src/database/sqlite/$provideLocalSqliteSupabase.ts +92 -1
  61. package/apps/agents-server/src/tools/createAgentProgressTools.ts +8 -6
  62. package/apps/agents-server/src/utils/localization/formatServerLanguageHumanReadableDate.ts +70 -0
  63. package/apps/agents-server/src/utils/localization/getRequestServerLanguage.ts +32 -0
  64. package/apps/agents-server/src/utils/userChat/createRunUserChatJobExecutionContext.ts +17 -0
  65. package/apps/agents-server/src/utils/userChat/createRunUserChatJobPersistenceController.ts +0 -21
  66. package/apps/agents-server/src/utils/userChat/listUserChats.ts +5 -1
  67. package/apps/agents-server/src/utils/userChat/persistUserChatJobProgressCard.ts +31 -0
  68. package/apps/agents-server/src/utils/userChat/retryUserChatJob.ts +0 -4
  69. package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +29 -0
  70. package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +2 -2
  71. package/apps/agents-server/src/utils/userChat/userChatProgressCard.ts +99 -401
  72. package/apps/agents-server/src/utils/vpsSelfUpdate.ts +625 -51
  73. package/esm/index.es.js +252 -41
  74. package/esm/index.es.js.map +1 -1
  75. package/esm/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +5 -1
  76. package/esm/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +7 -0
  77. package/esm/scripts/run-codex-prompts/common/coderRunEstimateCache.d.ts +31 -0
  78. package/esm/scripts/run-codex-prompts/common/progressFormatting.d.ts +2 -0
  79. package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +3 -1
  80. package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +7 -0
  81. package/esm/src/book-3.0/cliAgentEnv.d.ts +1 -1
  82. package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
  83. package/esm/src/version.d.ts +1 -1
  84. package/package.json +1 -1
  85. package/src/book-3.0/cliAgentEnv.ts +1 -1
  86. package/src/cli/cli-commands/agents-server/startAgentsServer.ts +1 -1
  87. package/src/cli/cli-commands/coder/ThinkingLevel.ts +3 -1
  88. package/src/other/templates/getTemplatesPipelineCollection.ts +911 -741
  89. package/src/version.ts +2 -2
  90. package/src/versions.txt +2 -0
  91. package/umd/index.umd.js +254 -44
  92. package/umd/index.umd.js.map +1 -1
  93. package/umd/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +5 -1
  94. package/umd/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +7 -0
  95. package/umd/scripts/run-codex-prompts/common/coderRunEstimateCache.d.ts +31 -0
  96. package/umd/scripts/run-codex-prompts/common/progressFormatting.d.ts +2 -0
  97. package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +3 -1
  98. package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +7 -0
  99. package/umd/src/book-3.0/cliAgentEnv.d.ts +1 -1
  100. package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
  101. package/umd/src/version.d.ts +1 -1
@@ -19,5 +19,9 @@ export type CoderRunProgressSnapshot = {
19
19
  };
20
20
  /**
21
21
  * Builds a session-scoped progress snapshot from prompt stats and elapsed active time.
22
+ *
23
+ * When the current session has not finished any prompt yet but a `cachedAveragePromptDurationMs` is
24
+ * provided (loaded from the per-config estimate cache stored in the temp folder), the snapshot uses
25
+ * that historical average to project the remaining work instead of waiting for the first completion.
22
26
  */
23
- export declare function buildCoderRunProgressSnapshot(stats: PromptStats, elapsedDuration: moment.Duration, initialDone: number): CoderRunProgressSnapshot;
27
+ export declare function buildCoderRunProgressSnapshot(stats: PromptStats, elapsedDuration: moment.Duration, initialDone: number, cachedAveragePromptDurationMs?: number): CoderRunProgressSnapshot;
@@ -15,10 +15,17 @@ export declare class CliProgressDisplay {
15
15
  private readonly timer;
16
16
  private isHeaderReserved;
17
17
  private interval;
18
+ private cachedAveragePromptDurationMs;
18
19
  /**
19
20
  * Creates a new display that uses the provided start time when computing estimates.
20
21
  */
21
22
  constructor(startTime: moment.Moment, minimumPriority: number);
23
+ /**
24
+ * Sets the cached average prompt duration (in milliseconds) loaded from the temp-folder estimate cache.
25
+ *
26
+ * Used to project completion estimates before the first prompt of the current session finishes.
27
+ */
28
+ setCachedAveragePromptDurationMs(cachedAveragePromptDurationMs: number | undefined): void;
22
29
  /**
23
30
  * Updates the progress statistics shown in the header.
24
31
  */
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Cache key used to uniquely identify the average prompt duration for a given runner configuration.
3
+ *
4
+ * @private internal type of `coderRunEstimateCache`
5
+ */
6
+ export type CoderRunEstimateCacheKey = {
7
+ readonly harness: string;
8
+ readonly model?: string;
9
+ readonly thinkingLevel?: string;
10
+ };
11
+ /**
12
+ * Loads the cached average prompt duration for the given runner configuration.
13
+ *
14
+ * Returns `undefined` when no usable cache entry exists. Cache failures must never break the run, so this
15
+ * function swallows IO and parsing errors instead of throwing.
16
+ *
17
+ * @public exported for use by the coder run progress displays
18
+ */
19
+ export declare function loadCachedAveragePromptDurationMs(key: CoderRunEstimateCacheKey): Promise<number | undefined>;
20
+ /**
21
+ * Records a new prompt-duration sample for the given runner configuration into the temp folder cache.
22
+ *
23
+ * Updates a running average so future `ptbk coder run` / `ptbk coder server` invocations can show
24
+ * meaningful estimates immediately, before the first prompt of the new session has completed.
25
+ *
26
+ * Cache failures are swallowed because the next-run estimate is best-effort and must not affect the
27
+ * current run.
28
+ *
29
+ * @public exported for use by the prompt round finalizer
30
+ */
31
+ export declare function recordPromptDurationSample(key: CoderRunEstimateCacheKey, promptDurationMs: number): Promise<void>;
@@ -1,6 +1,8 @@
1
1
  import moment from 'moment';
2
2
  /**
3
3
  * Calendar formats used when displaying the estimated completion time.
4
+ *
5
+ * Uses 24-hour format (`HH:mm`) so estimates are unambiguous (for example `17:30` instead of `5:30`).
4
6
  */
5
7
  export declare const ESTIMATED_DONE_CALENDAR_FORMATS: {
6
8
  sameDay: string;
@@ -1,15 +1,17 @@
1
1
  import type { PromptRunOptions } from '../types/PromptRunOptions';
2
2
  import type { PromptRunResult } from '../types/PromptRunResult';
3
3
  import type { PromptRunner } from '../types/PromptRunner';
4
+ import type { ClaudeCodeRunnerOptions } from './ClaudeCodeRunnerOptions';
4
5
  /**
5
6
  * Runs prompts via the Claude Code CLI.
6
7
  */
7
8
  export declare class ClaudeCodeRunner implements PromptRunner {
9
+ private readonly options;
8
10
  readonly name = "claude-code";
9
11
  /**
10
12
  * Creates a new Claude Code runner.
11
13
  */
12
- constructor();
14
+ constructor(options?: ClaudeCodeRunnerOptions);
13
15
  /**
14
16
  * Runs the prompt using Claude Code and parses usage output.
15
17
  */
@@ -58,6 +58,7 @@ export declare class CoderRunUiState extends EventEmitter {
58
58
  private stats;
59
59
  private readonly timer;
60
60
  private initialDone;
61
+ private cachedAveragePromptDurationMs;
61
62
  constructor(startTime: moment.Moment);
62
63
  /**
63
64
  * Pauses the elapsed timer (e.g. while waiting for user input or paused state).
@@ -75,6 +76,12 @@ export declare class CoderRunUiState extends EventEmitter {
75
76
  * Feeds new prompt statistics from the main loop so the progress bar updates.
76
77
  */
77
78
  updateProgress(stats: PromptStats): void;
79
+ /**
80
+ * Sets the cached average prompt duration (in milliseconds) loaded from the temp-folder estimate cache.
81
+ *
82
+ * Used to project completion estimates before the first prompt of the current session finishes.
83
+ */
84
+ setCachedAveragePromptDurationMs(cachedAveragePromptDurationMs: number | undefined): void;
78
85
  /**
79
86
  * Computes a progress snapshot on demand so elapsed time ticks with periodic re-renders.
80
87
  */
@@ -9,7 +9,7 @@ export declare const CLI_AGENT_HARNESS_NAMES: readonly ["openai-codex", "github-
9
9
  *
10
10
  * @public exported from `@promptbook/node`
11
11
  */
12
- export declare const CLI_AGENT_THINKING_LEVEL_VALUES: readonly ["low", "medium", "high", "xhigh"];
12
+ export declare const CLI_AGENT_THINKING_LEVEL_VALUES: readonly ["low", "medium", "high", "xhigh", "max"];
13
13
  /**
14
14
  * Environment variable used as the default runner identifier when `--harness` is omitted or not set in `CliAgent`.
15
15
  *
@@ -3,7 +3,7 @@
3
3
  *
4
4
  * @private internal shared utility of `ptbk coder run`
5
5
  */
6
- export declare const THINKING_LEVEL_VALUES: readonly ["low", "medium", "high", "xhigh"];
6
+ export declare const THINKING_LEVEL_VALUES: readonly ["low", "medium", "high", "xhigh", "max"];
7
7
  /**
8
8
  * Supported reasoning effort values for coding-agent runners with configurable thinking levels.
9
9
  *
@@ -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-131`).
18
+ * It follows semantic versioning (e.g., `0.112.0-133`).
19
19
  *
20
20
  * @generated
21
21
  */