@promptbook/cli 0.112.0-101 → 0.112.0-103
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/package.json +1 -1
- package/apps/agents-server/scripts/prerender-homepage.js +76 -1
- package/apps/agents-server/src/app/actions.ts +0 -6
- package/apps/agents-server/src/app/admin/about/page.tsx +1 -1
- package/apps/agents-server/src/app/admin/image-generator-test/ImageAttachmentsEditor.tsx +11 -6
- package/apps/agents-server/src/app/admin/login-methods/shibboleth/page.tsx +365 -0
- package/apps/agents-server/src/app/admin/metadata/MetadataClient.tsx +13 -15
- package/apps/agents-server/src/app/admin/servers/ServersRegistryTable.tsx +3 -3
- package/apps/agents-server/src/app/admin/servers/useCreateServerWizard.ts +13 -14
- package/apps/agents-server/src/app/admin/update/UpdateClient.tsx +12 -3
- package/apps/agents-server/src/app/admin/usage/UsageClientTimelineChart.tsx +1 -1
- package/apps/agents-server/src/app/admin/users/[userId]/UserDetailClient.tsx +21 -14
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatPageLayout.tsx +2 -2
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatSidebarDefault.tsx +11 -7
- package/apps/agents-server/src/app/api/admin/cli-access/route.ts +27 -123
- package/apps/agents-server/src/app/api/admin/code-runners/authentication/route.ts +33 -125
- package/apps/agents-server/src/app/api/auth/login/route.ts +0 -10
- package/apps/agents-server/src/app/api/auth/shibboleth/acs/route.ts +77 -57
- package/apps/agents-server/src/app/api/auth/shibboleth/login/route.ts +57 -33
- package/apps/agents-server/src/app/api/auth/shibboleth/metadata/route.ts +4 -29
- package/apps/agents-server/src/app/api/auth/shibboleth/status/route.ts +17 -0
- package/apps/agents-server/src/app/api/upload/route.ts +148 -209
- package/apps/agents-server/src/app/api/users/[username]/route.ts +1 -1
- package/apps/agents-server/src/app/api/users/route.ts +5 -5
- package/apps/agents-server/src/app/dashboard/page.tsx +1 -1
- package/apps/agents-server/src/app/docs/[docId]/page.tsx +1 -1
- package/apps/agents-server/src/app/docs/page.tsx +1 -1
- package/apps/agents-server/src/app/globals.css +100 -0
- package/apps/agents-server/src/app/layout.tsx +7 -0
- package/apps/agents-server/src/app/recycle-bin/page.tsx +1 -1
- package/apps/agents-server/src/app/system/settings/KeybindingsSettingsClient.tsx +13 -7
- package/apps/agents-server/src/components/AdminTerminal/useAdminTerminalSession.ts +29 -1
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +3 -3
- package/apps/agents-server/src/components/AgentProfile/AgentProfileImage.tsx +8 -2
- package/apps/agents-server/src/components/DocsToolbar/DocsToolbar.tsx +4 -4
- package/apps/agents-server/src/components/DocumentationContent/DocumentationContent.tsx +9 -9
- package/apps/agents-server/src/components/Footer/Footer.tsx +7 -7
- package/apps/agents-server/src/components/Header/Header.tsx +24 -4
- package/apps/agents-server/src/components/Header/HeaderTypes.ts +6 -0
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +51 -1
- package/apps/agents-server/src/components/Homepage/Card.tsx +1 -1
- package/apps/agents-server/src/components/Homepage/Section.tsx +3 -1
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +12 -1
- package/apps/agents-server/src/components/LoginForm/LoginForm.tsx +100 -149
- package/apps/agents-server/src/components/Skeleton/ConsolePageLoadingSkeleton.tsx +1 -1
- package/apps/agents-server/src/components/Skeleton/DocumentationRouteLoadingSkeleton.tsx +1 -1
- package/apps/agents-server/src/components/Skeleton/HomepageLoadingSkeleton.tsx +1 -1
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +20 -4
- package/apps/agents-server/src/components/UsersList/useUsersAdmin.ts +3 -0
- package/apps/agents-server/src/constants/shibbolethAuth.ts +139 -0
- package/apps/agents-server/src/database/metadataDefaults.ts +54 -80
- package/apps/agents-server/src/database/migrate.ts +30 -1
- package/apps/agents-server/src/database/migrations/2026-06-0100-shibboleth-auth.sql +136 -0
- package/apps/agents-server/src/database/sqlite/$provideLocalSqliteSupabase.ts +88 -36
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +4 -2
- package/apps/agents-server/src/languages/translations/czech.yaml +4 -2
- package/apps/agents-server/src/languages/translations/english.yaml +5 -3
- package/apps/agents-server/src/tools/$provideCdnForServer.ts +54 -11
- package/apps/agents-server/src/utils/cdn/classes/DigitalOceanSpaces.ts +18 -2
- package/apps/agents-server/src/utils/cdn/classes/TrackedFilesStorage.ts +6 -5
- package/apps/agents-server/src/utils/cdn/interfaces/IFilesStorage.ts +5 -0
- package/apps/agents-server/src/utils/chatExport/renderHtmlToPdfOnServer.ts +11 -0
- package/apps/agents-server/src/utils/createAdminTerminalRouteHandlers.ts +264 -0
- package/apps/agents-server/src/utils/shareTargetPayloads.ts +19 -66
- package/apps/agents-server/src/utils/shibbolethAuthentication.ts +729 -621
- package/apps/agents-server/src/utils/upload/createBookEditorUploadHandler.ts +19 -28
- package/apps/agents-server/src/utils/upload/uploadFileToServer.ts +113 -0
- package/esm/index.es.js +194 -35
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-codex-prompts/common/waitForPause.d.ts +12 -0
- package/esm/scripts/run-codex-prompts/main/runPromptRound.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +1 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -1
- package/esm/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.tsx +63 -4
- package/src/other/templates/getTemplatesPipelineCollection.ts +730 -739
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -0
- package/umd/index.umd.js +194 -35
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-codex-prompts/common/waitForPause.d.ts +12 -0
- package/umd/scripts/run-codex-prompts/main/runPromptRound.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiFrame.d.ts +1 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -1
- package/umd/src/book-components/Chat/MarkdownContent/MarkdownContent.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/src/app/api/auth/methods/route.ts +0 -44
- package/apps/agents-server/src/constants/authenticationMethods.ts +0 -74
- package/apps/agents-server/src/constants/shibbolethAuthentication.ts +0 -107
|
@@ -30,6 +30,18 @@ export declare function checkPause(options?: {
|
|
|
30
30
|
* Returns the current pause state for external consumers such as the terminal UI.
|
|
31
31
|
*/
|
|
32
32
|
export declare function getPauseState(): CoderRunPauseState;
|
|
33
|
+
/**
|
|
34
|
+
* Returns the label of the next checkpoint where pausing will take effect.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getPauseTargetLabel(): string;
|
|
37
|
+
/**
|
|
38
|
+
* Updates the label of the next pause checkpoint.
|
|
39
|
+
*/
|
|
40
|
+
export declare function announcePauseTargetLabel(nextPauseTargetLabel: string): void;
|
|
41
|
+
/**
|
|
42
|
+
* Restores the default generic pause target label.
|
|
43
|
+
*/
|
|
44
|
+
export declare function resetPauseTargetLabel(): void;
|
|
33
45
|
/**
|
|
34
46
|
* Requests a pause from an external controller (e.g. the Ink UI).
|
|
35
47
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WaitForCoderRunPauseCheckpoint } from '../common/CoderRunPauseCheckpoint';
|
|
1
2
|
import type { CliProgressDisplay } from '../common/cliProgressDisplay';
|
|
2
3
|
import type { RunOptions } from '../cli/RunOptions';
|
|
3
4
|
import type { PromptSelection } from '../prompts/types/PromptSelection';
|
|
@@ -19,7 +20,7 @@ type RunPromptRoundOptions = {
|
|
|
19
20
|
isRichUiEnabled: boolean;
|
|
20
21
|
progressDisplay?: CliProgressDisplay;
|
|
21
22
|
uiHandle?: CoderRunUiHandle;
|
|
22
|
-
waitForRequestedPause
|
|
23
|
+
waitForRequestedPause: WaitForCoderRunPauseCheckpoint;
|
|
23
24
|
};
|
|
24
25
|
/**
|
|
25
26
|
* Runs one prompt round from prompt construction through commit or failure logging.
|
|
@@ -12,6 +12,7 @@ export type BuildCoderRunUiFrameOptions = {
|
|
|
12
12
|
readonly animationFrame: number;
|
|
13
13
|
readonly spinner: string;
|
|
14
14
|
readonly pauseState: CoderRunPauseState;
|
|
15
|
+
readonly pauseTargetLabel: string;
|
|
15
16
|
readonly config: CoderRunConfig;
|
|
16
17
|
readonly phase: CoderRunPhase;
|
|
17
18
|
readonly currentPromptLabel: string;
|
|
@@ -42,7 +42,7 @@ export declare function buildScriptPathSessionRows(scriptPaths: readonly string[
|
|
|
42
42
|
/**
|
|
43
43
|
* Builds the colored phase badge shown in the session box.
|
|
44
44
|
*/
|
|
45
|
-
export declare function buildPausePresentation(phase: CoderRunPhase, pauseState: CoderRunPauseState, statusMessage: string): PausePresentation;
|
|
45
|
+
export declare function buildPausePresentation(phase: CoderRunPhase, pauseState: CoderRunPauseState, pauseTargetLabel: string, statusMessage: string): PausePresentation;
|
|
46
46
|
/**
|
|
47
47
|
* Builds the progress bar shown in the session box.
|
|
48
48
|
*/
|
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-102`).
|
|
19
19
|
*
|
|
20
20
|
* @generated
|
|
21
21
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@promptbook/cli",
|
|
3
|
-
"version": "0.112.0-
|
|
3
|
+
"version": "0.112.0-103",
|
|
4
4
|
"description": "Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
@@ -159,6 +159,7 @@
|
|
|
159
159
|
"@types/swagger-ui-react": "5.18.0",
|
|
160
160
|
"@types/turndown": "5.0.6",
|
|
161
161
|
"@vercel/blob": "1.1.1",
|
|
162
|
+
"@xmldom/xmldom": "^0.9.10",
|
|
162
163
|
"@xterm/addon-fit": "0.11.0",
|
|
163
164
|
"@xterm/xterm": "6.0.0",
|
|
164
165
|
"better-sqlite3": "^11.10.0",
|
|
@@ -166,7 +167,6 @@
|
|
|
166
167
|
"cross-fetch": "4.0.0",
|
|
167
168
|
"destroyable": "0.12.145",
|
|
168
169
|
"dompurify": "3.4.6",
|
|
169
|
-
"fast-xml-parser": "^5.2.5",
|
|
170
170
|
"formidable": "3.5.4",
|
|
171
171
|
"highlight.js": "11.11.1",
|
|
172
172
|
"html-to-image": "1.11.13",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import { memo, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { memo, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { createRoot, type Root } from 'react-dom/client';
|
|
5
5
|
import type { string_markdown } from '../../../types/string_markdown';
|
|
6
6
|
import { classNames } from '../../_common/react-utils/classNames';
|
|
@@ -23,8 +23,37 @@ type MarkdownContentProps = {
|
|
|
23
23
|
|
|
24
24
|
className?: string;
|
|
25
25
|
onCreateAgent?: (bookContent: string) => void;
|
|
26
|
+
theme?: 'LIGHT' | 'DARK';
|
|
26
27
|
};
|
|
27
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Visual theme consumed by nested code-block renderers.
|
|
31
|
+
*
|
|
32
|
+
* @private utility of `MarkdownContent` component
|
|
33
|
+
*/
|
|
34
|
+
type MarkdownContentTheme = NonNullable<MarkdownContentProps['theme']>;
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the active document theme when a host application does not pass an explicit theme.
|
|
38
|
+
*
|
|
39
|
+
* @private utility of `MarkdownContent` component
|
|
40
|
+
*/
|
|
41
|
+
function resolveMarkdownContentTheme(explicitTheme?: MarkdownContentTheme): MarkdownContentTheme {
|
|
42
|
+
if (explicitTheme) {
|
|
43
|
+
return explicitTheme;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (typeof document !== 'undefined') {
|
|
47
|
+
const resolvedTheme = document.documentElement.dataset.themeResolved;
|
|
48
|
+
|
|
49
|
+
if (resolvedTheme === 'dark' || document.documentElement.classList.contains('dark')) {
|
|
50
|
+
return 'DARK';
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return 'LIGHT';
|
|
55
|
+
}
|
|
56
|
+
|
|
28
57
|
/**
|
|
29
58
|
* Returns a stable key for a `<details>` element based on its `<summary>` text.
|
|
30
59
|
* Used to identify and restore open state across re-renders.
|
|
@@ -85,7 +114,7 @@ function resolveClickedDetailsElement(target: EventTarget | null, container: HTM
|
|
|
85
114
|
* @public exported from `@promptbook/components`
|
|
86
115
|
*/
|
|
87
116
|
export const MarkdownContent = memo(function MarkdownContent(props: MarkdownContentProps) {
|
|
88
|
-
const { content, className, onCreateAgent } = props;
|
|
117
|
+
const { content, className, onCreateAgent, theme } = props;
|
|
89
118
|
const htmlContent = useMemo(
|
|
90
119
|
() =>
|
|
91
120
|
renderMarkdown(content, {
|
|
@@ -93,6 +122,7 @@ export const MarkdownContent = memo(function MarkdownContent(props: MarkdownCont
|
|
|
93
122
|
}),
|
|
94
123
|
[content],
|
|
95
124
|
);
|
|
125
|
+
const [resolvedTheme, setResolvedTheme] = useState<MarkdownContentTheme>(() => resolveMarkdownContentTheme(theme));
|
|
96
126
|
const containerRef = useRef<HTMLDivElement>(null);
|
|
97
127
|
const rootsRef = useRef<Root[]>([]);
|
|
98
128
|
/** Tracks which `<details>` elements (by summary key) are currently open */
|
|
@@ -100,6 +130,28 @@ export const MarkdownContent = memo(function MarkdownContent(props: MarkdownCont
|
|
|
100
130
|
const onCreateAgentRef = useRef(onCreateAgent);
|
|
101
131
|
onCreateAgentRef.current = onCreateAgent;
|
|
102
132
|
|
|
133
|
+
useEffect(() => {
|
|
134
|
+
if (theme) {
|
|
135
|
+
setResolvedTheme(theme);
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const updateTheme = () => setResolvedTheme(resolveMarkdownContentTheme());
|
|
140
|
+
updateTheme();
|
|
141
|
+
|
|
142
|
+
if (typeof document === 'undefined' || typeof MutationObserver === 'undefined') {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const observer = new MutationObserver(updateTheme);
|
|
147
|
+
observer.observe(document.documentElement, {
|
|
148
|
+
attributes: true,
|
|
149
|
+
attributeFilter: ['class', 'data-theme-resolved'],
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
return () => observer.disconnect();
|
|
153
|
+
}, [theme]);
|
|
154
|
+
|
|
103
155
|
useEffect(() => {
|
|
104
156
|
// Cleanup previous roots
|
|
105
157
|
rootsRef.current.forEach((root) => root.unmount());
|
|
@@ -191,7 +243,14 @@ export const MarkdownContent = memo(function MarkdownContent(props: MarkdownCont
|
|
|
191
243
|
|
|
192
244
|
// Render CodeBlock
|
|
193
245
|
const root = createRoot(mountPoint);
|
|
194
|
-
root.render(
|
|
246
|
+
root.render(
|
|
247
|
+
<CodeBlock
|
|
248
|
+
code={code}
|
|
249
|
+
language={language}
|
|
250
|
+
onCreateAgent={onCreateAgentRef.current}
|
|
251
|
+
theme={resolvedTheme}
|
|
252
|
+
/>,
|
|
253
|
+
);
|
|
195
254
|
rootsRef.current.push(root);
|
|
196
255
|
});
|
|
197
256
|
|
|
@@ -203,7 +262,7 @@ export const MarkdownContent = memo(function MarkdownContent(props: MarkdownCont
|
|
|
203
262
|
rootsRef.current.forEach((root) => root.unmount());
|
|
204
263
|
rootsRef.current = [];
|
|
205
264
|
};
|
|
206
|
-
}, [htmlContent]);
|
|
265
|
+
}, [htmlContent, resolvedTheme]);
|
|
207
266
|
|
|
208
267
|
return (
|
|
209
268
|
<div
|