@promptbook/cli 0.112.0-91 → 0.112.0-93
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/layout.tsx +11 -5
- package/apps/agents-server/src/constants/themeMode.ts +27 -1
- package/apps/agents-server/src/database/$provideClientSql.ts +1 -1
- package/apps/agents-server/src/database/metadataDefaults.ts +10 -0
- package/apps/agents-server/src/database/migrations/2026-05-2600-default-theme.sql +16 -0
- package/apps/agents-server/src/utils/externalChatRunner/createExternalAgentRepositoryFiles.ts +2 -2
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks.ts +532 -1
- package/apps/agents-server/src/utils/userThemeModeSettings.ts +10 -2
- package/esm/index.es.js +65 -65
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/main/agentIgnorePatterns.d.ts +2 -2
- package/esm/scripts/run-agent-messages/main/createCoderRunOptionsForAgent.d.ts +1 -1
- package/esm/scripts/run-agent-messages/main/runPersistentAgentWatch.d.ts +1 -1
- package/esm/scripts/run-agent-messages/main/tickAgentMessages.d.ts +1 -1
- package/esm/scripts/run-agent-messages/main/validateAgentRunOptions.d.ts +1 -1
- package/esm/scripts/run-agent-messages/ui/agentRunUiConstants.d.ts +1 -1
- package/esm/scripts/run-agent-messages/ui/buildAgentRunUiFrame.d.ts +1 -1
- package/esm/scripts/run-agent-messages/ui/initializeAgentRunUi.d.ts +1 -1
- package/esm/scripts/run-agent-messages/ui/loadAgentRunUiMetadata.d.ts +2 -2
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/agentProjectPaths.d.ts +16 -16
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/agentRunCliOptions.d.ts +5 -5
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/init.d.ts +1 -1
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/initializeAgentProjectConfiguration.d.ts +2 -2
- package/esm/src/cli/cli-commands/{agent → agent-folder}/initializeAgentRunnerCommand.d.ts +4 -4
- package/esm/src/cli/cli-commands/{agent → agent-folder}/printAgentInitializationSummary.d.ts +1 -1
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/run.d.ts +1 -1
- package/{umd/src/cli/cli-commands/agent → esm/src/cli/cli-commands/agent-folder}/runMultiple.d.ts +1 -1
- package/esm/src/cli/cli-commands/{agent → agent-folder}/tick.d.ts +1 -1
- package/esm/src/cli/cli-commands/{agent.d.ts → agent-folder.d.ts} +3 -3
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/cli/cli-commands/{agent → agent-folder}/agentProjectPaths.ts +18 -18
- package/src/cli/cli-commands/{agent → agent-folder}/agentRunCliOptions.ts +7 -7
- package/src/cli/cli-commands/{agent → agent-folder}/init.ts +2 -2
- package/src/cli/cli-commands/{agent → agent-folder}/initializeAgentProjectConfiguration.ts +3 -3
- package/src/cli/cli-commands/{agent → agent-folder}/initializeAgentRunnerCommand.ts +6 -6
- package/src/cli/cli-commands/{agent → agent-folder}/printAgentInitializationSummary.ts +2 -2
- package/src/cli/cli-commands/{agent → agent-folder}/run.ts +2 -2
- package/src/cli/cli-commands/{agent → agent-folder}/runMultiple.ts +2 -2
- package/src/cli/cli-commands/{agent → agent-folder}/tick.ts +2 -2
- package/src/cli/cli-commands/{agent.ts → agent-folder.ts} +16 -16
- package/src/cli/promptbookCli.ts +2 -2
- package/src/other/templates/getTemplatesPipelineCollection.ts +865 -755
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -1
- package/umd/index.umd.js +65 -65
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/main/agentIgnorePatterns.d.ts +2 -2
- package/umd/scripts/run-agent-messages/main/createCoderRunOptionsForAgent.d.ts +1 -1
- package/umd/scripts/run-agent-messages/main/runPersistentAgentWatch.d.ts +1 -1
- package/umd/scripts/run-agent-messages/main/tickAgentMessages.d.ts +1 -1
- package/umd/scripts/run-agent-messages/main/validateAgentRunOptions.d.ts +1 -1
- package/umd/scripts/run-agent-messages/ui/agentRunUiConstants.d.ts +1 -1
- package/umd/scripts/run-agent-messages/ui/buildAgentRunUiFrame.d.ts +1 -1
- package/umd/scripts/run-agent-messages/ui/initializeAgentRunUi.d.ts +1 -1
- package/umd/scripts/run-agent-messages/ui/loadAgentRunUiMetadata.d.ts +2 -2
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/agentProjectPaths.d.ts +16 -16
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/agentRunCliOptions.d.ts +5 -5
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/init.d.ts +1 -1
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/initializeAgentProjectConfiguration.d.ts +2 -2
- package/umd/src/cli/cli-commands/{agent → agent-folder}/initializeAgentRunnerCommand.d.ts +4 -4
- package/umd/src/cli/cli-commands/{agent → agent-folder}/printAgentInitializationSummary.d.ts +1 -1
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/run.d.ts +1 -1
- package/umd/src/cli/cli-commands/agent-folder/run.test.d.ts +1 -0
- package/{esm/src/cli/cli-commands/agent → umd/src/cli/cli-commands/agent-folder}/runMultiple.d.ts +1 -1
- package/umd/src/cli/cli-commands/{agent → agent-folder}/tick.d.ts +1 -1
- package/umd/src/cli/cli-commands/{agent.d.ts → agent-folder.d.ts} +3 -3
- package/umd/src/cli/other/vpsInstall.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- /package/esm/src/cli/cli-commands/{agent → agent-folder}/run.test.d.ts +0 -0
- /package/{umd/src/cli/cli-commands/agent/run.test.d.ts → esm/src/cli/other/vpsInstall.test.d.ts} +0 -0
|
@@ -30,7 +30,11 @@ import {
|
|
|
30
30
|
DEFAULT_AGENT_AVATAR_VISUAL_METADATA_KEY,
|
|
31
31
|
resolveDefaultAgentAvatarVisualId,
|
|
32
32
|
} from '../constants/defaultAgentAvatarVisual';
|
|
33
|
-
import {
|
|
33
|
+
import {
|
|
34
|
+
DEFAULT_THEME_METADATA_KEY,
|
|
35
|
+
THEME_MODE_COOKIE_NAME,
|
|
36
|
+
resolveThemeMode,
|
|
37
|
+
} from '../constants/themeMode';
|
|
34
38
|
import { parseChatFeedbackMode } from '../utils/chatFeedbackMode';
|
|
35
39
|
import { getFederatedServers } from '../utils/getFederatedServers';
|
|
36
40
|
import { isUserAdmin } from '../utils/isUserAdmin';
|
|
@@ -249,6 +253,7 @@ export default async function RootLayout({
|
|
|
249
253
|
'IS_EXPERIMENTAL_PWA_APP_ENABLED',
|
|
250
254
|
CHAT_VISUAL_MODE_METADATA_KEY,
|
|
251
255
|
DEFAULT_AGENT_AVATAR_VISUAL_METADATA_KEY,
|
|
256
|
+
DEFAULT_THEME_METADATA_KEY,
|
|
252
257
|
SERVER_LANGUAGE_METADATA_KEY,
|
|
253
258
|
IS_SERVER_LANGUAGE_ENFORCED_METADATA_KEY,
|
|
254
259
|
...CONTROL_PANEL_OPTION_AVAILABILITY_METADATA_KEYS,
|
|
@@ -272,19 +277,20 @@ export default async function RootLayout({
|
|
|
272
277
|
getCustomJavascriptWithIntegrations,
|
|
273
278
|
);
|
|
274
279
|
const cookieStorePromise = cookies();
|
|
275
|
-
const defaultThemeModePromise = Promise.all([currentUserPromise, cookieStorePromise]).then(
|
|
276
|
-
async ([currentUser, cookieStore]) => {
|
|
280
|
+
const defaultThemeModePromise = Promise.all([currentUserPromise, cookieStorePromise, layoutMetadataPromise]).then(
|
|
281
|
+
async ([currentUser, cookieStore, layoutMetadata]) => {
|
|
277
282
|
const cookieThemeMode = cookieStore.get(THEME_MODE_COOKIE_NAME)?.value || null;
|
|
283
|
+
const metadataDefaultThemeMode = resolveThemeMode(layoutMetadata[DEFAULT_THEME_METADATA_KEY]);
|
|
278
284
|
if (cookieThemeMode) {
|
|
279
285
|
return resolveThemeMode(cookieThemeMode);
|
|
280
286
|
}
|
|
281
287
|
|
|
282
288
|
if (!currentUser?.id) {
|
|
283
|
-
return
|
|
289
|
+
return metadataDefaultThemeMode;
|
|
284
290
|
}
|
|
285
291
|
|
|
286
292
|
const storedThemeSettings = await getUserThemeModeSettingsForUser(currentUser.id);
|
|
287
|
-
return storedThemeSettings?.themeMode ||
|
|
293
|
+
return storedThemeSettings?.themeMode || metadataDefaultThemeMode;
|
|
288
294
|
},
|
|
289
295
|
);
|
|
290
296
|
const federatedServersPromise = Promise.all([layoutMetadataPromise, currentUserPromise]).then(
|
|
@@ -18,7 +18,33 @@ export type ThemeMode = (typeof THEME_MODES)[keyof typeof THEME_MODES];
|
|
|
18
18
|
export type ResolvedThemeMode = Exclude<ThemeMode, 'SYSTEM'>;
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Metadata key controlling the default theme mode for new browser sessions.
|
|
22
|
+
*/
|
|
23
|
+
export const DEFAULT_THEME_METADATA_KEY = 'DEFAULT_THEME';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Shared select options for default theme configuration.
|
|
27
|
+
*/
|
|
28
|
+
export const THEME_MODE_OPTIONS: ReadonlyArray<{
|
|
29
|
+
readonly value: ThemeMode;
|
|
30
|
+
readonly label: string;
|
|
31
|
+
}> = [
|
|
32
|
+
{
|
|
33
|
+
value: THEME_MODES.SYSTEM,
|
|
34
|
+
label: 'System',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: THEME_MODES.LIGHT,
|
|
38
|
+
label: 'Light',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
value: THEME_MODES.DARK,
|
|
42
|
+
label: 'Dark',
|
|
43
|
+
},
|
|
44
|
+
] as const;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Built-in fallback theme mode applied when metadata/browser values are missing or invalid.
|
|
22
48
|
*/
|
|
23
49
|
export const DEFAULT_THEME_MODE: ThemeMode = THEME_MODES.SYSTEM;
|
|
24
50
|
|
|
@@ -65,7 +65,7 @@ export async function $provideClientSql(): Promise<ClientSqlExecutor> {
|
|
|
65
65
|
): Promise<TRow> => {
|
|
66
66
|
const textChunks: Array<string> = [];
|
|
67
67
|
for (let index = 0; index < templateStrings.length; index++) {
|
|
68
|
-
textChunks.push(templateStrings[index]);
|
|
68
|
+
textChunks.push(templateStrings[index]!);
|
|
69
69
|
if (index < templateValues.length) {
|
|
70
70
|
textChunks.push(`$${index + 1}`);
|
|
71
71
|
}
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
DEFAULT_AGENT_AVATAR_VISUAL_METADATA_OPTIONS,
|
|
14
14
|
DEFAULT_AGENT_AVATAR_VISUAL_METADATA_VALUE,
|
|
15
15
|
} from '../constants/defaultAgentAvatarVisual';
|
|
16
|
+
import { DEFAULT_THEME_METADATA_KEY, DEFAULT_THEME_MODE, THEME_MODE_OPTIONS } from '../constants/themeMode';
|
|
16
17
|
import { DEFAULT_NAME_POOL, NAME_POOL_METADATA_KEY, NAME_POOL_OPTIONS } from '../constants/namePool';
|
|
17
18
|
import { NEW_AGENT_WIZZARD_METADATA_KEY, NEW_AGENT_WIZZARD_OPTIONS } from '../constants/newAgentWizard';
|
|
18
19
|
import {
|
|
@@ -336,6 +337,15 @@ export const metadataDefaults = [
|
|
|
336
337
|
note: 'Default state for browser push notifications when a user has no saved preference. When false, users must opt in before agent replies can trigger notifications.',
|
|
337
338
|
type: 'BOOLEAN',
|
|
338
339
|
},
|
|
340
|
+
{
|
|
341
|
+
key: DEFAULT_THEME_METADATA_KEY,
|
|
342
|
+
value: DEFAULT_THEME_MODE,
|
|
343
|
+
note: `Default theme mode for browsers without a saved preference. Allowed values: ${formatMetadataOptionValues(
|
|
344
|
+
THEME_MODE_OPTIONS,
|
|
345
|
+
)}.`,
|
|
346
|
+
type: 'TEXT_SINGLE_LINE',
|
|
347
|
+
options: THEME_MODE_OPTIONS,
|
|
348
|
+
},
|
|
339
349
|
{
|
|
340
350
|
key: CHAT_VISUAL_MODE_METADATA_KEY,
|
|
341
351
|
value: DEFAULT_CHAT_VISUAL_MODE,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
INSERT INTO "prefix_Metadata" ("key", "value", "note", "createdAt", "updatedAt")
|
|
2
|
+
SELECT 'DEFAULT_THEME',
|
|
3
|
+
'SYSTEM',
|
|
4
|
+
'Default theme mode for browsers without a saved preference. Allowed values: SYSTEM, LIGHT, DARK.',
|
|
5
|
+
NOW(),
|
|
6
|
+
NOW()
|
|
7
|
+
WHERE NOT EXISTS (SELECT 1 FROM "prefix_Metadata" WHERE "key" = 'DEFAULT_THEME');
|
|
8
|
+
|
|
9
|
+
UPDATE "prefix_Metadata"
|
|
10
|
+
SET "value" = CASE
|
|
11
|
+
WHEN UPPER(COALESCE("value", '')) IN ('SYSTEM', 'LIGHT', 'DARK') THEN UPPER("value")
|
|
12
|
+
ELSE 'SYSTEM'
|
|
13
|
+
END,
|
|
14
|
+
"note" = 'Default theme mode for browsers without a saved preference. Allowed values: SYSTEM, LIGHT, DARK.',
|
|
15
|
+
"updatedAt" = NOW()
|
|
16
|
+
WHERE "key" = 'DEFAULT_THEME';
|
package/apps/agents-server/src/utils/externalChatRunner/createExternalAgentRepositoryFiles.ts
CHANGED
|
@@ -53,9 +53,9 @@ function createExternalAgentRepositoryPackageJson(): string {
|
|
|
53
53
|
scripts: {
|
|
54
54
|
start: 'npm run agent:run',
|
|
55
55
|
'agent:run':
|
|
56
|
-
'npx ptbk agent run-agent --agent github-copilot --model gpt-5.4 --thinking-level high --auto-pull --auto-push',
|
|
56
|
+
'npx ptbk agent-folder run-agent --agent github-copilot --model gpt-5.4 --thinking-level high --auto-pull --auto-push',
|
|
57
57
|
'agent-local:run':
|
|
58
|
-
'ts-node ../../promptbook/src/cli/test/ptbk.ts agent run-agent --agent github-copilot --model gpt-5.4 --auto-pull --auto-push',
|
|
58
|
+
'ts-node ../../promptbook/src/cli/test/ptbk.ts agent-folder run-agent --agent github-copilot --model gpt-5.4 --auto-pull --auto-push',
|
|
59
59
|
},
|
|
60
60
|
},
|
|
61
61
|
null,
|