@promptbook/cli 0.103.0-55 → 0.103.0-66
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/TODO.txt +5 -1
- package/apps/agents-server/package-lock.json +2336 -0
- package/apps/agents-server/package.json +9 -0
- package/apps/agents-server/src/app/actions.ts +3 -1
- package/apps/agents-server/src/app/agents/[agentName]/AgentChatWrapper.tsx +3 -1
- package/apps/agents-server/src/app/agents/[agentName]/AgentOptionsMenu.tsx +282 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileChat.tsx +91 -0
- package/apps/agents-server/src/app/agents/[agentName]/AgentProfileWrapper.tsx +44 -0
- package/apps/agents-server/src/app/agents/[agentName]/CloneAgentButton.tsx +4 -4
- package/apps/agents-server/src/app/agents/[agentName]/InstallPwaButton.tsx +2 -2
- package/apps/agents-server/src/app/agents/[agentName]/agentLinks.tsx +80 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +3 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/chat/route.ts +11 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/models/route.ts +93 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/v1/chat/completions/route.ts +10 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/openai/v1/models/route.ts +93 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/voice/route.ts +4 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/page.tsx +9 -2
- package/apps/agents-server/src/app/agents/[agentName]/generateAgentMetadata.ts +7 -3
- package/apps/agents-server/src/app/agents/[agentName]/integration/SdkCodeTabs.tsx +31 -0
- package/apps/agents-server/src/app/agents/[agentName]/integration/page.tsx +271 -30
- package/apps/agents-server/src/app/agents/[agentName]/layout.tsx +41 -0
- package/apps/agents-server/src/app/agents/[agentName]/links/page.tsx +61 -97
- package/apps/agents-server/src/app/agents/[agentName]/page.tsx +47 -157
- package/apps/agents-server/src/app/agents/[agentName]/website-integration/page.tsx +70 -0
- package/apps/agents-server/src/app/api/openai/v1/chat/completions/route.ts +6 -0
- package/apps/agents-server/src/app/api/openai/v1/models/route.ts +65 -0
- package/apps/agents-server/src/app/docs/[docId]/page.tsx +12 -32
- package/apps/agents-server/src/app/docs/page.tsx +42 -17
- package/apps/agents-server/src/app/embed/page.tsx +2 -2
- package/apps/agents-server/src/app/globals.css +129 -0
- package/apps/agents-server/src/app/layout.tsx +16 -26
- package/apps/agents-server/src/app/manifest.ts +9 -4
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +334 -0
- package/apps/agents-server/src/components/AgentProfile/AgentProfileFromSource.tsx +23 -0
- package/apps/agents-server/src/{app/agents/[agentName] → components/AgentProfile}/AgentQrCode.tsx +8 -1
- package/apps/agents-server/src/components/AgentProfile/QrCodeModal.tsx +90 -0
- package/apps/agents-server/src/components/DocumentationContent/DocumentationContent.tsx +87 -0
- package/apps/agents-server/src/components/LayoutWrapper/LayoutWrapper.tsx +7 -6
- package/apps/agents-server/src/components/OpenMojiIcon/OpenMojiIcon.tsx +20 -0
- package/apps/agents-server/src/components/PrintButton/PrintButton.tsx +18 -0
- package/apps/agents-server/src/components/PrintHeader/PrintHeader.tsx +18 -0
- package/apps/agents-server/src/database/metadataDefaults.ts +6 -0
- package/apps/agents-server/src/database/migrations/2025-12-0070-chat-history-source.sql +2 -0
- package/apps/agents-server/src/database/schema.ts +6 -0
- package/apps/agents-server/src/utils/handleChatCompletion.ts +186 -14
- package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +13 -6
- package/apps/agents-server/src/utils/validateApiKey.ts +128 -0
- package/apps/agents-server/tailwind.config.ts +1 -1
- package/esm/index.es.js +953 -474
- package/esm/index.es.js.map +1 -1
- package/esm/typings/src/_packages/components.index.d.ts +2 -2
- package/esm/typings/src/_packages/core.index.d.ts +6 -8
- package/esm/typings/src/_packages/types.index.d.ts +7 -1
- package/esm/typings/src/book-2.0/agent-source/AgentBasicInformation.d.ts +2 -1
- package/esm/typings/src/book-2.0/agent-source/createCommitmentRegex.d.ts +1 -1
- package/esm/typings/src/book-components/Chat/AgentChat/AgentChat.d.ts +3 -0
- package/esm/typings/src/book-components/Chat/Chat/ChatProps.d.ts +6 -0
- package/esm/typings/src/book-components/Chat/LlmChat/LlmChatProps.d.ts +5 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentIntegration.d.ts +52 -0
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgentSeamlessIntegration.d.ts +14 -0
- package/esm/typings/src/book-components/icons/SendIcon.d.ts +3 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.d.ts +4 -0
- package/esm/typings/src/commitments/CLOSED/CLOSED.test.d.ts +4 -0
- package/esm/typings/src/commitments/META_COLOR/META_COLOR.d.ts +6 -0
- package/esm/typings/src/commitments/META_FONT/META_FONT.d.ts +42 -0
- package/esm/typings/src/commitments/USE/USE.d.ts +53 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.d.ts +42 -0
- package/esm/typings/src/commitments/USE_BROWSER/USE_BROWSER.test.d.ts +1 -0
- package/esm/typings/src/commitments/{IMPORTANT/IMPORTANT.d.ts → USE_MCP/USE_MCP.d.ts} +16 -5
- package/esm/typings/src/commitments/USE_SEARCH_ENGINE/USE_SEARCH_ENGINE.d.ts +38 -0
- package/esm/typings/src/commitments/_base/BaseCommitmentDefinition.d.ts +6 -0
- package/esm/typings/src/commitments/index.d.ts +93 -1
- package/esm/typings/src/llm-providers/agent/Agent.d.ts +3 -1
- package/esm/typings/src/other/templates/getTemplatesPipelineCollection.d.ts +1 -1
- package/esm/typings/src/playground/playground.d.ts +3 -0
- package/esm/typings/src/types/typeAliases.d.ts +6 -0
- package/esm/typings/src/utils/color/Color.d.ts +9 -1
- package/esm/typings/src/utils/color/css-colors.d.ts +1 -0
- package/esm/typings/src/utils/random/$generateBookBoilerplate.d.ts +6 -0
- package/esm/typings/src/utils/random/CzechNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/EnglishNamePool.d.ts +7 -0
- package/esm/typings/src/utils/random/NamePool.d.ts +17 -0
- package/esm/typings/src/utils/random/getNamePool.d.ts +10 -0
- package/esm/typings/src/version.d.ts +1 -1
- package/package.json +2 -2
- package/umd/index.umd.js +902 -423
- package/umd/index.umd.js.map +1 -1
- package/esm/typings/src/book-components/PromptbookAgent/PromptbookAgent.d.ts +0 -29
- package/esm/typings/src/commitments/registry.d.ts +0 -68
- package/esm/typings/src/playground/playground1.d.ts +0 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { notFound } from 'next/navigation';
|
|
2
|
-
import ReactMarkdown from 'react-markdown';
|
|
3
2
|
import { BookCommitment } from '../../../../../../src/commitments/_base/BookCommitment';
|
|
4
3
|
import { getVisibleCommitmentDefinitions } from '../../../utils/getVisibleCommitmentDefinitions';
|
|
4
|
+
import { PrintButton } from '../../../components/PrintButton/PrintButton';
|
|
5
|
+
import { PrintHeader } from '../../../components/PrintHeader/PrintHeader';
|
|
6
|
+
import { DocumentationContent } from '../../../components/DocumentationContent/DocumentationContent';
|
|
5
7
|
|
|
6
8
|
type DocPageProps = {
|
|
7
9
|
params: Promise<{
|
|
@@ -25,38 +27,16 @@ export default async function DocPage(props: DocPageProps) {
|
|
|
25
27
|
|
|
26
28
|
return (
|
|
27
29
|
<div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50">
|
|
30
|
+
<PrintButton />
|
|
31
|
+
|
|
28
32
|
<div className="container mx-auto px-4 py-16">
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
<span className="text-gray-400 font-normal ml-4 text-2xl">
|
|
37
|
-
/ {aliases.join(' / ')}
|
|
38
|
-
</span>
|
|
39
|
-
)}
|
|
40
|
-
</h1>
|
|
41
|
-
<span className="px-3 py-1 rounded-full text-xs font-medium bg-blue-100 text-blue-700">
|
|
42
|
-
Commitment
|
|
43
|
-
</span>
|
|
44
|
-
</div>
|
|
45
|
-
{primary.description && (
|
|
46
|
-
<p className="text-xl text-gray-600 leading-relaxed max-w-3xl">
|
|
47
|
-
{primary.description}
|
|
48
|
-
</p>
|
|
49
|
-
)}
|
|
50
|
-
</div>
|
|
51
|
-
|
|
52
|
-
<div className="p-8">
|
|
53
|
-
<article className="prose prose-lg prose-slate max-w-none prose-headings:font-bold prose-h2:text-2xl prose-h2:mt-8 prose-h2:mb-4 prose-p:text-gray-600 prose-pre:bg-gray-50 prose-pre:border prose-pre:border-gray-200 prose-pre:text-gray-800">
|
|
54
|
-
<ReactMarkdown>
|
|
55
|
-
{primary.documentation}
|
|
56
|
-
</ReactMarkdown>
|
|
57
|
-
</article>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
33
|
+
<PrintHeader title={primary.type} />
|
|
34
|
+
|
|
35
|
+
<DocumentationContent
|
|
36
|
+
primary={primary}
|
|
37
|
+
aliases={aliases}
|
|
38
|
+
isPrintOnly={false}
|
|
39
|
+
/>
|
|
60
40
|
</div>
|
|
61
41
|
</div>
|
|
62
42
|
);
|
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
import Link from 'next/link';
|
|
2
2
|
import { Card } from '../../components/Homepage/Card';
|
|
3
3
|
import { Section } from '../../components/Homepage/Section';
|
|
4
|
+
import { OpenMojiIcon } from '../../components/OpenMojiIcon/OpenMojiIcon';
|
|
4
5
|
import { getVisibleCommitmentDefinitions } from '../../utils/getVisibleCommitmentDefinitions';
|
|
6
|
+
import { PrintButton } from '../../components/PrintButton/PrintButton';
|
|
7
|
+
import { PrintHeader } from '../../components/PrintHeader/PrintHeader';
|
|
8
|
+
import { DocumentationContent } from '../../components/DocumentationContent/DocumentationContent';
|
|
5
9
|
|
|
6
10
|
export default function DocsPage() {
|
|
7
11
|
const groupedCommitments = getVisibleCommitmentDefinitions();
|
|
8
12
|
|
|
9
13
|
return (
|
|
10
14
|
<div className="min-h-screen bg-gradient-to-br from-blue-50 via-white to-purple-50">
|
|
15
|
+
<PrintButton />
|
|
16
|
+
|
|
11
17
|
<div className="container mx-auto px-4 py-16">
|
|
12
|
-
<
|
|
18
|
+
<PrintHeader title="Full Documentation" />
|
|
19
|
+
|
|
20
|
+
{/* Screen view: Cards */}
|
|
21
|
+
<div className="print:hidden">
|
|
22
|
+
<Section title="Documentation">
|
|
23
|
+
{groupedCommitments.map(({ primary, aliases }) => (
|
|
24
|
+
<Link key={primary.type} href={`/docs/${primary.type}`} className="block h-full group">
|
|
25
|
+
<Card className="h-full group-hover:border-blue-500 transition-colors">
|
|
26
|
+
<h3 className="text-xl font-semibold mb-2 group-hover:text-blue-600 transition-colors">
|
|
27
|
+
<OpenMojiIcon icon={primary.icon} className="mr-2" />
|
|
28
|
+
{primary.type}
|
|
29
|
+
{aliases.length > 0 && (
|
|
30
|
+
<span className="text-gray-400 font-normal text-lg">
|
|
31
|
+
{' / '}
|
|
32
|
+
{aliases.join(' / ')}
|
|
33
|
+
</span>
|
|
34
|
+
)}
|
|
35
|
+
</h3>
|
|
36
|
+
{primary.description && <p className="text-gray-600 line-clamp-3">{primary.description}</p>}
|
|
37
|
+
</Card>
|
|
38
|
+
</Link>
|
|
39
|
+
))}
|
|
40
|
+
</Section>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
{/* Print view: Full Content */}
|
|
44
|
+
<div className="hidden print:block space-y-12">
|
|
13
45
|
{groupedCommitments.map(({ primary, aliases }) => (
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{aliases.join(' / ')}
|
|
23
|
-
</span>
|
|
24
|
-
)}
|
|
25
|
-
</h3>
|
|
26
|
-
{primary.description && <p className="text-gray-600 line-clamp-3">{primary.description}</p>}
|
|
27
|
-
</Card>
|
|
28
|
-
</Link>
|
|
46
|
+
<div key={primary.type} className="break-inside-avoid page-break-after-always">
|
|
47
|
+
<DocumentationContent
|
|
48
|
+
primary={primary}
|
|
49
|
+
aliases={aliases}
|
|
50
|
+
isPrintOnly={true}
|
|
51
|
+
/>
|
|
52
|
+
<hr className="my-8 border-gray-200" />
|
|
53
|
+
</div>
|
|
29
54
|
))}
|
|
30
|
-
</
|
|
55
|
+
</div>
|
|
31
56
|
</div>
|
|
32
57
|
</div>
|
|
33
58
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { PromptbookAgentIntegration } from '@promptbook-local/components';
|
|
4
4
|
import { useSearchParams } from 'next/navigation';
|
|
5
5
|
|
|
6
6
|
export default function EmbedPage() {
|
|
@@ -13,7 +13,7 @@ export default function EmbedPage() {
|
|
|
13
13
|
|
|
14
14
|
return (
|
|
15
15
|
<div className="w-full h-full bg-transparent">
|
|
16
|
-
<
|
|
16
|
+
<PromptbookAgentIntegration
|
|
17
17
|
agentUrl={agentUrl}
|
|
18
18
|
onOpenChange={(isOpen) => {
|
|
19
19
|
window.parent.postMessage({ type: 'PROMPTBOOK_AGENT_RESIZE', isOpen }, '*');
|
|
@@ -54,6 +54,11 @@ body {
|
|
|
54
54
|
font-family: var(--font-barlow-condensed), 'OpenMojiBlack', Arial, Helvetica, sans-serif;
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
/* Poppins font for agent names and headings */
|
|
58
|
+
.font-poppins {
|
|
59
|
+
font-family: var(--font-poppins), 'Poppins', system-ui, -apple-system, sans-serif;
|
|
60
|
+
}
|
|
61
|
+
|
|
57
62
|
/* Custom utilities */
|
|
58
63
|
.line-clamp-2 {
|
|
59
64
|
display: -webkit-box;
|
|
@@ -135,6 +140,53 @@ textarea:focus-visible {
|
|
|
135
140
|
animation: spin 1s linear infinite;
|
|
136
141
|
}
|
|
137
142
|
|
|
143
|
+
/* Tailwind CSS animation utilities */
|
|
144
|
+
@keyframes fade-in {
|
|
145
|
+
from {
|
|
146
|
+
opacity: 0;
|
|
147
|
+
}
|
|
148
|
+
to {
|
|
149
|
+
opacity: 1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
@keyframes slide-in-from-top-2 {
|
|
154
|
+
from {
|
|
155
|
+
transform: translateY(-0.5rem);
|
|
156
|
+
}
|
|
157
|
+
to {
|
|
158
|
+
transform: translateY(0);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@keyframes zoom-in-95 {
|
|
163
|
+
from {
|
|
164
|
+
opacity: 0;
|
|
165
|
+
transform: scale(0.95);
|
|
166
|
+
}
|
|
167
|
+
to {
|
|
168
|
+
opacity: 1;
|
|
169
|
+
transform: scale(1);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.animate-in {
|
|
174
|
+
animation-duration: 200ms;
|
|
175
|
+
animation-fill-mode: both;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.fade-in {
|
|
179
|
+
animation-name: fade-in;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
.slide-in-from-top-2 {
|
|
183
|
+
animation-name: slide-in-from-top-2;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
.zoom-in-95 {
|
|
187
|
+
animation-name: zoom-in-95;
|
|
188
|
+
}
|
|
189
|
+
|
|
138
190
|
/* Gradient backgrounds */
|
|
139
191
|
.bg-gradient-to-br {
|
|
140
192
|
background-image: linear-gradient(to bottom right, var(--tw-gradient-stops));
|
|
@@ -145,3 +197,80 @@ textarea:focus-visible {
|
|
|
145
197
|
background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
|
|
146
198
|
border: 1px solid #e2e8f0;
|
|
147
199
|
}
|
|
200
|
+
|
|
201
|
+
/* Print styles */
|
|
202
|
+
@media print {
|
|
203
|
+
@page {
|
|
204
|
+
margin: 2cm;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/* Hide UI elements */
|
|
208
|
+
header,
|
|
209
|
+
footer,
|
|
210
|
+
nav,
|
|
211
|
+
aside,
|
|
212
|
+
button:not(.print:block),
|
|
213
|
+
.no-print,
|
|
214
|
+
[role="complementary"],
|
|
215
|
+
#portal-root {
|
|
216
|
+
display: none !important;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/* Reset layout */
|
|
220
|
+
body,
|
|
221
|
+
main {
|
|
222
|
+
padding: 0 !important;
|
|
223
|
+
margin: 0 !important;
|
|
224
|
+
background: white !important;
|
|
225
|
+
min-height: auto !important;
|
|
226
|
+
width: 100% !important;
|
|
227
|
+
color: black !important;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Remove shadows and backgrounds for clean print */
|
|
231
|
+
* {
|
|
232
|
+
box-shadow: none !important;
|
|
233
|
+
text-shadow: none !important;
|
|
234
|
+
background-color: transparent !important;
|
|
235
|
+
background-image: none !important;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/* Ensure text visibility */
|
|
239
|
+
h1, h2, h3, h4, h5, h6, p, li, span, div {
|
|
240
|
+
color: black !important;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/* Links */
|
|
244
|
+
a {
|
|
245
|
+
text-decoration: underline;
|
|
246
|
+
color: black !important;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/* Preserve borders */
|
|
250
|
+
.border, .border-b, .border-t, .border-l, .border-r {
|
|
251
|
+
border-color: #ddd !important;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/* Page break control */
|
|
255
|
+
h1, h2 {
|
|
256
|
+
break-after: avoid;
|
|
257
|
+
page-break-after: avoid;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
p, li, pre, code {
|
|
261
|
+
break-inside: avoid;
|
|
262
|
+
page-break-inside: avoid;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
/* Specific component overrides */
|
|
266
|
+
.card, .bg-white {
|
|
267
|
+
border: none !important;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/* Code blocks */
|
|
271
|
+
pre, code {
|
|
272
|
+
background-color: #f5f5f5 !important;
|
|
273
|
+
border: 1px solid #ddd !important;
|
|
274
|
+
white-space: pre-wrap !important;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import faviconLogoImage from '@/public/favicon.ico';
|
|
2
2
|
import { LayoutWrapper } from '@/src/components/LayoutWrapper/LayoutWrapper';
|
|
3
3
|
import type { Metadata } from 'next';
|
|
4
|
-
import { Barlow_Condensed } from 'next/font/google';
|
|
4
|
+
import { Barlow_Condensed, Poppins } from 'next/font/google';
|
|
5
5
|
import { getMetadata } from '../database/getMetadata';
|
|
6
6
|
import { $provideAgentCollectionForServer } from '../tools/$provideAgentCollectionForServer';
|
|
7
7
|
import { $provideServer } from '../tools/$provideServer';
|
|
8
|
-
import { isUserAdmin } from '../utils/isUserAdmin';
|
|
9
8
|
import { getCurrentUser } from '../utils/getCurrentUser';
|
|
9
|
+
import { isUserAdmin } from '../utils/isUserAdmin';
|
|
10
10
|
import './globals.css';
|
|
11
11
|
|
|
12
12
|
const barlowCondensed = Barlow_Condensed({
|
|
@@ -15,16 +15,28 @@ const barlowCondensed = Barlow_Condensed({
|
|
|
15
15
|
variable: '--font-barlow-condensed',
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
+
const poppins = Poppins({
|
|
19
|
+
subsets: ['latin'],
|
|
20
|
+
weight: ['400', '500', '600', '700', '800'],
|
|
21
|
+
variable: '--font-poppins',
|
|
22
|
+
});
|
|
23
|
+
|
|
18
24
|
export async function generateMetadata(): Promise<Metadata> {
|
|
19
25
|
const { publicUrl } = await $provideServer();
|
|
20
26
|
const serverName = (await getMetadata('SERVER_NAME')) || 'Promptbook Agents Server';
|
|
21
27
|
const serverDescription = (await getMetadata('SERVER_DESCRIPTION')) || 'Agents server powered by Promptbook';
|
|
28
|
+
const serverFaviconUrl = (await getMetadata('SERVER_FAVICON_URL')) || faviconLogoImage.src;
|
|
22
29
|
|
|
23
30
|
return {
|
|
24
31
|
title: serverName,
|
|
25
32
|
description: serverDescription,
|
|
26
33
|
// TODO: keywords: ['@@@'],
|
|
27
34
|
authors: [{ name: 'Promptbook Team' }],
|
|
35
|
+
icons: {
|
|
36
|
+
icon: serverFaviconUrl,
|
|
37
|
+
shortcut: serverFaviconUrl,
|
|
38
|
+
apple: serverFaviconUrl,
|
|
39
|
+
},
|
|
28
40
|
openGraph: {
|
|
29
41
|
title: serverName,
|
|
30
42
|
description: serverDescription,
|
|
@@ -60,7 +72,6 @@ export default async function RootLayout({
|
|
|
60
72
|
const currentUser = await getCurrentUser();
|
|
61
73
|
const serverName = (await getMetadata('SERVER_NAME')) || 'Promptbook Agents Server';
|
|
62
74
|
const serverLogoUrl = (await getMetadata('SERVER_LOGO_URL')) || null;
|
|
63
|
-
const serverFaviconUrl = (await getMetadata('SERVER_FAVICON_URL')) || faviconLogoImage.src;
|
|
64
75
|
const isFooterShown = ((await getMetadata('IS_FOOTER_SHOWN')) || 'true') === 'true';
|
|
65
76
|
|
|
66
77
|
let footerLinks = [];
|
|
@@ -76,29 +87,8 @@ export default async function RootLayout({
|
|
|
76
87
|
|
|
77
88
|
return (
|
|
78
89
|
<html lang="en">
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{/*
|
|
82
|
-
<link
|
|
83
|
-
rel="icon"
|
|
84
|
-
href="https://www.ptbk.io/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Flogo-blue-transparent-256.493b7e49.png&w=64&q=75"
|
|
85
|
-
media="(prefers-color-scheme: light)"
|
|
86
|
-
type="image/svg+xml"
|
|
87
|
-
/>
|
|
88
|
-
*/}
|
|
89
|
-
{/* Favicon for dark mode */}
|
|
90
|
-
{/*
|
|
91
|
-
<link
|
|
92
|
-
rel="icon"
|
|
93
|
-
href="https://www.ptbk.io/_next/image?url=%2F_next%2Fstatic%2Fmedia%2Flogo-blue-transparent-256.493b7e49.png&w=64&q=75"
|
|
94
|
-
media="(prefers-color-scheme: dark)"
|
|
95
|
-
type="image/svg+xml"
|
|
96
|
-
/>
|
|
97
|
-
*/}
|
|
98
|
-
{/* Default favicon as a fallback */}
|
|
99
|
-
<link rel="icon" href={serverFaviconUrl} type="image/x-icon" />
|
|
100
|
-
</head>
|
|
101
|
-
<body className={`${barlowCondensed.variable} antialiased bg-white text-gray-900`}>
|
|
90
|
+
{/* Note: Icon is set via metadata to allow agent-page specific icons to override it */}
|
|
91
|
+
<body className={`${barlowCondensed.variable} ${poppins.variable} antialiased bg-white text-gray-900`}>
|
|
102
92
|
<LayoutWrapper
|
|
103
93
|
isAdmin={isAdmin}
|
|
104
94
|
currentUser={currentUser}
|
|
@@ -6,6 +6,9 @@ import { getMetadata } from '../database/getMetadata';
|
|
|
6
6
|
import { $provideServer } from '../tools/$provideServer';
|
|
7
7
|
import { getAgentProfile } from './agents/[agentName]/_utils';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Manifest for PWA Progressive Web App
|
|
11
|
+
*/
|
|
9
12
|
export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
|
10
13
|
const { publicUrl } = await $provideServer();
|
|
11
14
|
const serverName = (await getMetadata('SERVER_NAME')) || 'Promptbook Agents Server';
|
|
@@ -19,7 +22,7 @@ export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
|
|
19
22
|
name: serverName,
|
|
20
23
|
short_name: serverName,
|
|
21
24
|
description: serverDescription,
|
|
22
|
-
start_url: publicUrl.href,
|
|
25
|
+
start_url: publicUrl.href + '?utm_source=pwa&utm_medium=install&utm_campaign=agents_server_app',
|
|
23
26
|
display_override: ['fullscreen', 'minimal-ui'],
|
|
24
27
|
display: 'standalone',
|
|
25
28
|
background_color: PROMPTBOOK_COLOR.toHex(),
|
|
@@ -41,7 +44,7 @@ export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
|
|
41
44
|
const description = agentProfile.meta.description || agentProfile.personaDescription || `Agent ${name}`;
|
|
42
45
|
|
|
43
46
|
// Extract brand color from meta
|
|
44
|
-
const brandColor = Color.
|
|
47
|
+
const brandColor = Color.fromSafe(agentProfile.meta.color || PROMPTBOOK_COLOR);
|
|
45
48
|
const theme_color = brandColor.toHex();
|
|
46
49
|
const background_color = '#ffffff';
|
|
47
50
|
|
|
@@ -84,7 +87,7 @@ export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
|
|
84
87
|
name,
|
|
85
88
|
short_name,
|
|
86
89
|
description,
|
|
87
|
-
start_url: `${agentUrl}
|
|
90
|
+
start_url: `${agentUrl}?headless&utm_source=pwa&utm_medium=install&utm_campaign=agent_app`,
|
|
88
91
|
scope: agentUrl,
|
|
89
92
|
display_override: ['fullscreen', 'minimal-ui'],
|
|
90
93
|
display: 'standalone',
|
|
@@ -98,7 +101,9 @@ export default async function manifest(): Promise<MetadataRoute.Manifest> {
|
|
|
98
101
|
return {
|
|
99
102
|
name: agentName,
|
|
100
103
|
short_name: agentName,
|
|
101
|
-
start_url: `${publicUrl.href}agents/${encodeURIComponent(
|
|
104
|
+
start_url: `${publicUrl.href}agents/${encodeURIComponent(
|
|
105
|
+
agentName,
|
|
106
|
+
)}?headless&utm_source=pwa&utm_medium=install&utm_campaign=agent_app`,
|
|
102
107
|
display_override: ['fullscreen', 'minimal-ui'],
|
|
103
108
|
display: 'standalone',
|
|
104
109
|
background_color: '#ffffff',
|