@promptbook/cli 0.112.0-131 → 0.112.0-133
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.
- package/apps/agents-server/src/app/admin/api-tokens/ApiTokensClient.tsx +4 -1
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackClient.tsx +3 -0
- package/apps/agents-server/src/app/admin/chat-feedback/ChatFeedbackTable.tsx +13 -8
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryClient.tsx +3 -0
- package/apps/agents-server/src/app/admin/chat-history/ChatHistoryTable.tsx +13 -8
- package/apps/agents-server/src/app/admin/custom-css/CustomCssClient.tsx +4 -0
- package/apps/agents-server/src/app/admin/custom-css/CustomCssEditorPanel.tsx +7 -1
- package/apps/agents-server/src/app/admin/custom-css/CustomCssFilesPanel.tsx +7 -1
- package/apps/agents-server/src/app/admin/custom-js/CustomJsClient.tsx +11 -0
- package/apps/agents-server/src/app/admin/custom-js/CustomJsEditorPanel.tsx +7 -1
- package/apps/agents-server/src/app/admin/custom-js/CustomJsFilesPanel.tsx +7 -1
- package/apps/agents-server/src/app/admin/files/FilesGalleryClient.tsx +4 -0
- package/apps/agents-server/src/app/admin/files/FilesGalleryGrid.tsx +9 -11
- package/apps/agents-server/src/app/admin/files/FilesGalleryTable.tsx +9 -8
- package/apps/agents-server/src/app/admin/images/ImagesGalleryClient.tsx +4 -0
- package/apps/agents-server/src/app/admin/images/ImagesGalleryGrid.tsx +16 -11
- package/apps/agents-server/src/app/admin/images/ImagesGalleryTable.tsx +18 -9
- package/apps/agents-server/src/app/admin/login-methods/shibboleth/page.tsx +9 -9
- package/apps/agents-server/src/app/admin/messages/MessagesClient.tsx +7 -6
- package/apps/agents-server/src/app/admin/servers/ServersRegistryTable.tsx +11 -10
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +4 -2
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +14 -15
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTasksCard.tsx +4 -1
- package/apps/agents-server/src/app/admin/task-manager/useTaskManagerState.ts +6 -9
- package/apps/agents-server/src/app/admin/update/CustomCommitPicker.tsx +258 -0
- package/apps/agents-server/src/app/admin/update/UpdateClient.tsx +305 -108
- package/apps/agents-server/src/app/admin/usage/UsageClient.tsx +4 -2
- package/apps/agents-server/src/app/admin/usage/UsageClientAnalyticsPanels.tsx +6 -4
- package/apps/agents-server/src/app/admin/usage/UsageClientFormatting.ts +6 -12
- package/apps/agents-server/src/app/admin/usage/UsageClientTimelineChart.tsx +6 -3
- package/apps/agents-server/src/app/admin/usage/useUsageClientState.ts +12 -4
- package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +8 -3
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +6 -20
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorHistory.ts +9 -2
- package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatHistoryClientState.ts +2 -15
- package/apps/agents-server/src/app/agents/[agentName]/history/page.tsx +6 -1
- package/apps/agents-server/src/app/agents/[agentName]/integration/CalendarIntegrationSection.tsx +23 -5
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +4 -2
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +9 -4
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +4 -1
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +10 -3
- package/apps/agents-server/src/app/api/admin/update/commits/route.ts +35 -0
- package/apps/agents-server/src/app/api/admin/update/route.ts +10 -2
- package/apps/agents-server/src/app/api/internal/user-chat-jobs/run/route.ts +14 -2
- package/apps/agents-server/src/app/dashboard/page.tsx +11 -16
- package/apps/agents-server/src/app/layout.tsx +12 -3
- package/apps/agents-server/src/app/swagger/SwaggerApiKeysPanel.tsx +4 -1
- package/apps/agents-server/src/app/system/user-memory/UserMemoryClient.tsx +4 -2
- package/apps/agents-server/src/app/system/user-wallet/UserWalletClient.tsx +3 -0
- package/apps/agents-server/src/app/system/user-wallet/UserWalletRecordsTable.tsx +5 -1
- package/apps/agents-server/src/app/system/utilities/mocked-chats/MockedChatsEditorClient.tsx +3 -0
- package/apps/agents-server/src/app/system/utilities/mocked-chats/MockedChatsEditorSidebar.tsx +7 -8
- package/apps/agents-server/src/components/Footer/Footer.tsx +3 -2
- package/apps/agents-server/src/components/Footer/getCommitFooterEmoji.ts +112 -0
- package/apps/agents-server/src/components/PrintHeader/PrintHeader.tsx +4 -2
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +4 -2
- package/apps/agents-server/src/languages/translations/czech.yaml +1 -1
- package/apps/agents-server/src/languages/translations/english.yaml +1 -1
- package/apps/agents-server/src/middleware/applyEmbeddingHeader.ts +4 -2
- package/apps/agents-server/src/middleware/contentSecurityPolicy.ts +97 -0
- package/apps/agents-server/src/tools/createAgentProgressTools.ts +8 -6
- package/apps/agents-server/src/utils/localization/formatServerLanguageHumanReadableDate.ts +70 -0
- package/apps/agents-server/src/utils/localization/getRequestServerLanguage.ts +32 -0
- package/apps/agents-server/src/utils/userChat/createRunUserChatJobExecutionContext.ts +17 -0
- package/apps/agents-server/src/utils/userChat/createRunUserChatJobPersistenceController.ts +0 -21
- package/apps/agents-server/src/utils/userChat/persistUserChatJobProgressCard.ts +31 -0
- package/apps/agents-server/src/utils/userChat/retryUserChatJob.ts +0 -4
- package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +29 -0
- package/apps/agents-server/src/utils/userChat/userChatMessageLifecycle.ts +2 -2
- package/apps/agents-server/src/utils/userChat/userChatProgressCard.ts +99 -401
- package/apps/agents-server/src/utils/vpsSelfUpdate.ts +625 -51
- package/esm/index.es.js +252 -41
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +5 -1
- package/esm/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/common/coderRunEstimateCache.d.ts +31 -0
- package/esm/scripts/run-codex-prompts/common/progressFormatting.d.ts +2 -0
- package/esm/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +3 -1
- package/esm/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +7 -0
- package/esm/src/book-3.0/cliAgentEnv.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/book-3.0/cliAgentEnv.ts +1 -1
- package/src/cli/cli-commands/agents-server/startAgentsServer.ts +1 -1
- package/src/cli/cli-commands/coder/ThinkingLevel.ts +3 -1
- package/src/other/templates/getTemplatesPipelineCollection.ts +681 -766
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -0
- package/umd/index.umd.js +254 -44
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/common/buildCoderRunProgressSnapshot.d.ts +5 -1
- package/umd/scripts/run-codex-prompts/common/cliProgressDisplay.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/common/coderRunEstimateCache.d.ts +31 -0
- package/umd/scripts/run-codex-prompts/common/progressFormatting.d.ts +2 -0
- package/umd/scripts/run-codex-prompts/runners/claude-code/ClaudeCodeRunner.d.ts +3 -1
- package/umd/scripts/run-codex-prompts/ui/CoderRunUiState.d.ts +7 -0
- package/umd/src/book-3.0/cliAgentEnv.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/ThinkingLevel.d.ts +1 -1
- 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
|
*
|
package/esm/src/version.d.ts
CHANGED
|
@@ -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-
|
|
18
|
+
* It follows semantic versioning (e.g., `0.112.0-132`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ export const CLI_AGENT_HARNESS_NAMES = [
|
|
|
19
19
|
*
|
|
20
20
|
* @public exported from `@promptbook/node`
|
|
21
21
|
*/
|
|
22
|
-
export const CLI_AGENT_THINKING_LEVEL_VALUES = ['low', 'medium', 'high', 'xhigh'] as const;
|
|
22
|
+
export const CLI_AGENT_THINKING_LEVEL_VALUES = ['low', 'medium', 'high', 'xhigh', 'max'] as const;
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* Environment variable used as the default runner identifier when `--harness` is omitted or not set in `CliAgent`.
|
|
@@ -28,7 +28,7 @@ import { DEFAULT_LOCAL_AGENT_RUNNER_MAX_FAILED_ATTEMPTS } from '../../../../apps
|
|
|
28
28
|
*
|
|
29
29
|
* @private internal constant of `ptbk agents-server`
|
|
30
30
|
*/
|
|
31
|
-
const USER_CHAT_JOB_WORKER_POLL_INTERVAL_MS =
|
|
31
|
+
const USER_CHAT_JOB_WORKER_POLL_INTERVAL_MS = 10_000;
|
|
32
32
|
|
|
33
33
|
/**
|
|
34
34
|
* Number of identical worker failures suppressed before logging a repeated summary.
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { CLI_AGENT_THINKING_LEVEL_VALUES } from '../../../book-3.0/cliAgentEnv';
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Supported thinking-level CLI values for coding-agent runners with configurable reasoning effort.
|
|
3
5
|
*
|
|
4
6
|
* @private internal shared utility of `ptbk coder run`
|
|
5
7
|
*/
|
|
6
|
-
export const THINKING_LEVEL_VALUES =
|
|
8
|
+
export const THINKING_LEVEL_VALUES = CLI_AGENT_THINKING_LEVEL_VALUES;
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* Supported reasoning effort values for coding-agent runners with configurable thinking levels.
|