@promptbook/cli 0.114.0-1 → 0.114.0-2
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/README.md +16 -15
- package/apps/agents-server/package.json +6 -4
- package/apps/agents-server/playwright.config.ts +28 -38
- package/apps/agents-server/scripts/build-agents-server.js +62 -0
- package/apps/agents-server/scripts/build-e2e.js +38 -0
- package/apps/agents-server/scripts/ensure-root-dependencies.js +86 -0
- package/apps/agents-server/scripts/prerender-homepage.js +1 -1
- package/apps/agents-server/scripts/run-e2e-tests.js +34 -0
- package/apps/agents-server/scripts/run-npm.js +42 -0
- package/apps/agents-server/src/app/admin/email-server/page.tsx +14 -6
- package/apps/agents-server/src/app/api/elevenlabs/tts/route.ts +3 -3
- package/apps/agents-server/src/app/api/onboarding/book/route.ts +7 -6
- package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +105 -102
- package/apps/agents-server/src/app/superadmin/servers/useServersRegistryState.ts +15 -7
- package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +11 -11
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/ManGoBookEditor.tsx +82 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/WizardShell.tsx +2 -2
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/BookStep.tsx +13 -16
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/steps/ZadaniStep.tsx +4 -4
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/config/bookSections.ts +23 -16
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/lib/bookSource.ts +54 -0
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/bookService.ts +15 -8
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoAgentSource.ts +3 -37
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/createManGoOpenEditorRequest.ts +1 -1
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/state/OnboardingProvider.tsx +2 -2
- package/apps/agents-server/src/components/UsersList/CreateUserDialog.tsx +13 -22
- package/apps/agents-server/src/components/UsersList/PasswordGeneratorDialog.tsx +216 -0
- package/apps/agents-server/src/components/UsersList/UsersList.tsx +16 -11
- package/apps/agents-server/src/components/UsersList/generateSecurePassword.ts +112 -24
- package/apps/agents-server/src/components/UsersList/userDialogClassNames.ts +11 -0
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +11 -0
- package/apps/agents-server/src/languages/translations/czech.yaml +11 -0
- package/apps/agents-server/src/languages/translations/english.yaml +11 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +11 -0
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectDnsRecords.ts +53 -7
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +37 -27
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +2 -13
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime.ts +21 -73
- package/apps/agents-server/src/utils/stalwart/createEmailDnsInstructions.ts +9 -5
- package/apps/agents-server/src/utils/stalwart/readStalwartEmailSnapshot.ts +23 -5
- package/apps/agents-server/src/utils/stalwart/stalwartBootstrap.ts +2 -1
- package/apps/agents-server/src/utils/stalwart/stalwartMailBridge.ts +7 -0
- package/apps/agents-server/tests/e2e/e2eEnvironment.cjs +49 -0
- package/esm/index.es.js +523 -169
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-chat/runCoderPing.d.ts +48 -0
- package/esm/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +27 -0
- package/esm/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
- package/esm/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +7 -0
- package/esm/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +16 -0
- package/esm/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +9 -0
- package/esm/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +4 -0
- package/esm/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -2
- package/esm/scripts/run-codex-prompts/testing/runTestBefore.d.ts +24 -0
- package/esm/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -0
- package/esm/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/esm/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/esm/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/esm/src/cli/cli-commands/coder/ping.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +1 -0
- package/package.json +1 -1
- package/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.ts +1 -15
- package/src/book-2.0/book-language-documentation/bookLanguageDocumentationExamples.ts +1 -2
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +92 -32
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +16 -39
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +16 -36
- package/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.ts +9 -1
- package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +4 -51
- package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +291 -4
- package/src/book-components/Chat/utils/renderMarkdown.ts +133 -9
- package/src/cli/cli-commands/agents-server/startAgentsServer/createLocalAgentRunOptions.ts +1 -0
- package/src/cli/cli-commands/coder/agentCodingFile.ts +6 -129
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +1 -1
- package/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.ts +1 -4
- package/src/cli/cli-commands/coder/ping.ts +94 -0
- package/src/cli/cli-commands/coder/run.ts +25 -2
- package/src/cli/cli-commands/coder.ts +4 -0
- package/src/other/templates/getTemplatesPipelineCollection.ts +835 -738
- package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +101 -0
- package/src/version.ts +1 -1
- package/src/versions.txt +1 -1
- package/umd/index.umd.js +525 -171
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-chat/runCoderPing.d.ts +48 -0
- package/umd/scripts/run-codex-prompts/prompts/findNextTodoPrompt.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/isPromptCompatibleWithRunner.d.ts +27 -0
- package/umd/scripts/run-codex-prompts/prompts/listRunnablePrompts.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/listUpcomingTasks.d.ts +2 -1
- package/umd/scripts/run-codex-prompts/prompts/replacePromptTodoStatusLine.d.ts +7 -0
- package/umd/scripts/run-codex-prompts/testing/TestBeforeMode.d.ts +16 -0
- package/umd/scripts/run-codex-prompts/testing/createTestBeforeRepairPrompt.d.ts +9 -0
- package/umd/scripts/run-codex-prompts/testing/limitTestOutput.d.ts +4 -0
- package/umd/scripts/run-codex-prompts/testing/runPromptTestCommand.d.ts +1 -2
- package/umd/scripts/run-codex-prompts/testing/runTestBefore.d.ts +24 -0
- package/umd/scripts/run-codex-prompts/ui/buildRunUiFrameShared.d.ts +1 -0
- package/umd/src/book-2.0/book-language-documentation/BookLanguageManualDictionary.d.ts +1 -15
- package/umd/src/book-2.0/book-language-documentation/getBookLanguageManualCommitmentGroups.d.ts +1 -1
- package/umd/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.d.ts +0 -4
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +2 -3
- package/umd/src/cli/cli-commands/coder/ping.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/ping.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +1 -0
- package/apps/agents-server/src/app/api/onboarding/draft/route.ts +0 -23
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/BookLanguagePanel.tsx +0 -125
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownBookEditor.tsx +0 -154
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/components/MarkdownPreview.tsx +0 -188
- package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/services/draftService.ts +0 -32
|
@@ -388,17 +388,15 @@ function ServersRegistryTableRow(props: ServersRegistryTableRowProps) {
|
|
|
388
388
|
</div>
|
|
389
389
|
</td>
|
|
390
390
|
</tr>
|
|
391
|
-
|
|
392
|
-
<
|
|
393
|
-
<
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
</tr>
|
|
401
|
-
) : null}
|
|
391
|
+
<tr className="bg-sky-50/50">
|
|
392
|
+
<td colSpan={columnCount} className="px-4 py-4">
|
|
393
|
+
<ProjectDomainsPanel
|
|
394
|
+
projectDomains={projectDomains}
|
|
395
|
+
publicIpAddress={dnsDiagnostic?.publicIpAddress}
|
|
396
|
+
serverDomain={server.domain}
|
|
397
|
+
/>
|
|
398
|
+
</td>
|
|
399
|
+
</tr>
|
|
402
400
|
{hasDnsIssue && dnsDiagnostic ? (
|
|
403
401
|
<tr className="bg-amber-50/70">
|
|
404
402
|
<td colSpan={columnCount} className="px-4 py-4">
|
|
@@ -423,7 +421,7 @@ function ServersRegistryTableRow(props: ServersRegistryTableRowProps) {
|
|
|
423
421
|
}
|
|
424
422
|
|
|
425
423
|
/**
|
|
426
|
-
* Renders project domains
|
|
424
|
+
* Renders assigned project domains and preventive DNS guidance for one server.
|
|
427
425
|
*/
|
|
428
426
|
function ProjectDomainsPanel({
|
|
429
427
|
publicIpAddress,
|
|
@@ -447,97 +445,102 @@ function ProjectDomainsPanel({
|
|
|
447
445
|
return (
|
|
448
446
|
<div className="space-y-3 rounded-lg border border-sky-200 bg-sky-50 px-4 py-4 text-sm text-sky-950">
|
|
449
447
|
<p className="font-semibold">Project domains</p>
|
|
450
|
-
|
|
451
|
-
<
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
<a
|
|
491
|
-
href={projectDomain.projectHref}
|
|
492
|
-
className="font-semibold text-sky-800 hover:text-sky-950 hover:underline"
|
|
493
|
-
>
|
|
494
|
-
{projectDomain.projectName}
|
|
495
|
-
</a>
|
|
496
|
-
</td>
|
|
497
|
-
<td className="px-3 py-2">
|
|
498
|
-
<a
|
|
499
|
-
href={projectDomain.publicUrl}
|
|
500
|
-
target="_blank"
|
|
501
|
-
rel="noreferrer"
|
|
502
|
-
className="inline-flex items-center gap-1 font-mono text-sky-800 hover:text-sky-950 hover:underline"
|
|
503
|
-
>
|
|
504
|
-
{projectDomain.domain}
|
|
505
|
-
<ExternalLink className="h-3.5 w-3.5" aria-hidden />
|
|
506
|
-
</a>
|
|
507
|
-
{projectDomain.customDomain ? (
|
|
508
|
-
<span className="ml-2 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 font-sans text-[0.7rem] font-semibold text-emerald-700">
|
|
509
|
-
Custom
|
|
510
|
-
</span>
|
|
511
|
-
) : null}
|
|
512
|
-
{isManagedServerDnsDiagnosticIssue(projectDomain.dnsDiagnostic) ? (
|
|
513
|
-
<span className="ml-2 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 font-sans text-[0.7rem] font-semibold text-amber-700">
|
|
514
|
-
DNS setup needed
|
|
515
|
-
</span>
|
|
516
|
-
) : null}
|
|
517
|
-
</td>
|
|
518
|
-
<td className="px-3 py-2">
|
|
519
|
-
<a
|
|
520
|
-
href={projectDomain.agentProjectsHref}
|
|
521
|
-
title="Open agent projects"
|
|
522
|
-
className="inline-flex max-w-full items-center gap-1.5 rounded-full border border-sky-200 bg-sky-50 px-2 py-1 font-sans text-xs font-semibold text-sky-800 hover:border-sky-300 hover:bg-sky-100 hover:text-sky-950"
|
|
523
|
-
>
|
|
524
|
-
<Bot className="h-3.5 w-3.5 shrink-0" aria-hidden />
|
|
525
|
-
<span className="truncate">{projectDomain.agentName || 'Agent'}</span>
|
|
526
|
-
</a>
|
|
527
|
-
</td>
|
|
448
|
+
{projectDomains.length === 0 ? (
|
|
449
|
+
<p className="text-sky-800">
|
|
450
|
+
No project domains are assigned yet. Configure the wildcard record below before the first project is
|
|
451
|
+
published.
|
|
452
|
+
</p>
|
|
453
|
+
) : (
|
|
454
|
+
<div className="overflow-x-auto rounded-md border border-sky-100 bg-white">
|
|
455
|
+
<table className="min-w-full divide-y divide-sky-100 text-xs">
|
|
456
|
+
<thead className="bg-sky-50 text-sky-900">
|
|
457
|
+
<tr>
|
|
458
|
+
<AdminSortableTableHeaderCell
|
|
459
|
+
className="px-3 py-2 text-left font-semibold"
|
|
460
|
+
label="project"
|
|
461
|
+
sortBy="projectName"
|
|
462
|
+
activeSortBy={projectDomainSorting.sortBy}
|
|
463
|
+
sortOrder={projectDomainSorting.sortOrder}
|
|
464
|
+
onSortChange={projectDomainSorting.handleSortChange}
|
|
465
|
+
>
|
|
466
|
+
Project
|
|
467
|
+
</AdminSortableTableHeaderCell>
|
|
468
|
+
<AdminSortableTableHeaderCell
|
|
469
|
+
className="px-3 py-2 text-left font-semibold"
|
|
470
|
+
label="domain"
|
|
471
|
+
sortBy="domain"
|
|
472
|
+
activeSortBy={projectDomainSorting.sortBy}
|
|
473
|
+
sortOrder={projectDomainSorting.sortOrder}
|
|
474
|
+
onSortChange={projectDomainSorting.handleSortChange}
|
|
475
|
+
>
|
|
476
|
+
Domain
|
|
477
|
+
</AdminSortableTableHeaderCell>
|
|
478
|
+
<AdminSortableTableHeaderCell
|
|
479
|
+
className="px-3 py-2 text-left font-semibold"
|
|
480
|
+
label="agent"
|
|
481
|
+
sortBy="agentPermanentId"
|
|
482
|
+
activeSortBy={projectDomainSorting.sortBy}
|
|
483
|
+
sortOrder={projectDomainSorting.sortOrder}
|
|
484
|
+
onSortChange={projectDomainSorting.handleSortChange}
|
|
485
|
+
>
|
|
486
|
+
Agent
|
|
487
|
+
</AdminSortableTableHeaderCell>
|
|
528
488
|
</tr>
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
489
|
+
</thead>
|
|
490
|
+
<tbody className="divide-y divide-sky-100">
|
|
491
|
+
{projectDomainSorting.sortedRows.map((projectDomain) => (
|
|
492
|
+
<tr key={`${projectDomain.agentPermanentId}-${projectDomain.projectName}`}>
|
|
493
|
+
<td className="px-3 py-2">
|
|
494
|
+
<a
|
|
495
|
+
href={projectDomain.projectHref}
|
|
496
|
+
className="font-semibold text-sky-800 hover:text-sky-950 hover:underline"
|
|
497
|
+
>
|
|
498
|
+
{projectDomain.projectName}
|
|
499
|
+
</a>
|
|
500
|
+
</td>
|
|
501
|
+
<td className="px-3 py-2">
|
|
502
|
+
<a
|
|
503
|
+
href={projectDomain.publicUrl}
|
|
504
|
+
target="_blank"
|
|
505
|
+
rel="noreferrer"
|
|
506
|
+
className="inline-flex items-center gap-1 font-mono text-sky-800 hover:text-sky-950 hover:underline"
|
|
507
|
+
>
|
|
508
|
+
{projectDomain.domain}
|
|
509
|
+
<ExternalLink className="h-3.5 w-3.5" aria-hidden />
|
|
510
|
+
</a>
|
|
511
|
+
{projectDomain.customDomain ? (
|
|
512
|
+
<span className="ml-2 rounded-full border border-emerald-200 bg-emerald-50 px-2 py-0.5 font-sans text-[0.7rem] font-semibold text-emerald-700">
|
|
513
|
+
Custom
|
|
514
|
+
</span>
|
|
515
|
+
) : null}
|
|
516
|
+
{isManagedServerDnsDiagnosticIssue(projectDomain.dnsDiagnostic) ? (
|
|
517
|
+
<span className="ml-2 rounded-full border border-amber-200 bg-amber-50 px-2 py-0.5 font-sans text-[0.7rem] font-semibold text-amber-700">
|
|
518
|
+
DNS setup needed
|
|
519
|
+
</span>
|
|
520
|
+
) : null}
|
|
521
|
+
</td>
|
|
522
|
+
<td className="px-3 py-2">
|
|
523
|
+
<a
|
|
524
|
+
href={projectDomain.agentProjectsHref}
|
|
525
|
+
title="Open agent projects"
|
|
526
|
+
className="inline-flex max-w-full items-center gap-1.5 rounded-full border border-sky-200 bg-sky-50 px-2 py-1 font-sans text-xs font-semibold text-sky-800 hover:border-sky-300 hover:bg-sky-100 hover:text-sky-950"
|
|
527
|
+
>
|
|
528
|
+
<Bot className="h-3.5 w-3.5 shrink-0" aria-hidden />
|
|
529
|
+
<span className="truncate">{projectDomain.agentName || 'Agent'}</span>
|
|
530
|
+
</a>
|
|
531
|
+
</td>
|
|
532
|
+
</tr>
|
|
533
|
+
))}
|
|
534
|
+
</tbody>
|
|
535
|
+
</table>
|
|
536
|
+
</div>
|
|
537
|
+
)}
|
|
538
|
+
<AgentProjectDnsInstructions
|
|
539
|
+
isDnsIssue={hasProjectDnsIssue}
|
|
540
|
+
projectDomain={generatedProjectDomain}
|
|
541
|
+
publicIpAddress={publicIpAddress}
|
|
542
|
+
serverDomain={serverDomain}
|
|
543
|
+
/>
|
|
541
544
|
</div>
|
|
542
545
|
);
|
|
543
546
|
}
|
|
@@ -474,13 +474,21 @@ function useServersRegistryDraftState(servers: ReadonlyArray<ManagedServerRow>)
|
|
|
474
474
|
}, []);
|
|
475
475
|
|
|
476
476
|
const updateServerDraft = useCallback<UpdateServerDraft>((serverId, fieldName, value) => {
|
|
477
|
-
setServerDrafts((previousServerDrafts) =>
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
}
|
|
483
|
-
|
|
477
|
+
setServerDrafts((previousServerDrafts) => {
|
|
478
|
+
const serverDraft = previousServerDrafts[serverId];
|
|
479
|
+
|
|
480
|
+
if (!serverDraft) {
|
|
481
|
+
return previousServerDrafts;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
return {
|
|
485
|
+
...previousServerDrafts,
|
|
486
|
+
[serverId]: {
|
|
487
|
+
...serverDraft,
|
|
488
|
+
[fieldName]: value,
|
|
489
|
+
},
|
|
490
|
+
};
|
|
491
|
+
});
|
|
484
492
|
}, []);
|
|
485
493
|
|
|
486
494
|
const isServerDraftDirty = useCallback(
|
|
@@ -23,9 +23,9 @@ export function AgentProjectDnsInstructions({
|
|
|
23
23
|
readonly isDnsIssue?: boolean;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* Example generated project domain used by the single-project variant.
|
|
26
|
+
* Example generated project domain used by the single-project variant, when one already exists.
|
|
27
27
|
*/
|
|
28
|
-
readonly projectDomain
|
|
28
|
+
readonly projectDomain?: string | null;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Public VPS IP address, when known by the server.
|
|
@@ -49,23 +49,25 @@ export function AgentProjectDnsInstructions({
|
|
|
49
49
|
});
|
|
50
50
|
const selectedDomainDescription = isWildcardDomain
|
|
51
51
|
? `This covers all generated project domains under ${serverDomain}.`
|
|
52
|
-
:
|
|
52
|
+
: projectDomain
|
|
53
|
+
? `This covers one project, for example ${projectDomain}. Repeat it for each project that needs a public URL.`
|
|
54
|
+
: 'This covers one generated project. Replace the project name placeholder above with its full hostname.';
|
|
53
55
|
|
|
54
56
|
return (
|
|
55
57
|
<section className="space-y-4 rounded-lg border border-indigo-200 bg-indigo-50 px-4 py-4 text-sm text-indigo-950">
|
|
56
58
|
<div className="space-y-1">
|
|
57
59
|
<h4 className="font-semibold">Project DNS setup</h4>
|
|
58
60
|
<p>
|
|
59
|
-
Project URLs use a subdomain of <code>{serverDomain}</code>. Configure exactly one of the
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
Project URLs use a subdomain of <code>{serverDomain}</code>. Configure exactly one of the following
|
|
62
|
+
setups; do not add both the single-project and wildcard records, or both A and CNAME records for the
|
|
63
|
+
same hostname.
|
|
62
64
|
</p>
|
|
63
65
|
</div>
|
|
64
66
|
|
|
65
67
|
{isDnsIssue ? (
|
|
66
68
|
<p className="rounded-md border border-amber-200 bg-amber-50 px-3 py-2 text-amber-900">
|
|
67
|
-
One or more generated project domains do not resolve to this VPS yet. The recommended wildcard
|
|
68
|
-
|
|
69
|
+
One or more generated project domains do not resolve to this VPS yet. The recommended wildcard CNAME
|
|
70
|
+
setup is selected below.
|
|
69
71
|
</p>
|
|
70
72
|
) : null}
|
|
71
73
|
|
|
@@ -106,9 +108,7 @@ export function AgentProjectDnsInstructions({
|
|
|
106
108
|
</thead>
|
|
107
109
|
<tbody>
|
|
108
110
|
<tr>
|
|
109
|
-
<td className="px-3 py-2 font-mono font-semibold text-indigo-950">
|
|
110
|
-
{selectedRecord.type}
|
|
111
|
-
</td>
|
|
111
|
+
<td className="px-3 py-2 font-mono font-semibold text-indigo-950">{selectedRecord.type}</td>
|
|
112
112
|
<td className="px-3 py-2 font-mono text-slate-800">{selectedRecord.name}</td>
|
|
113
113
|
<td className="px-3 py-2 font-mono text-slate-800">{selectedRecord.value}</td>
|
|
114
114
|
<td className="px-3 py-2 text-indigo-900">{selectedRecord.note}</td>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import type { string_book } from '../../../../../../../src/book-2.0/agent-source/string_book';
|
|
4
|
+
import { BookEditor } from '../../../../../../../src/book-components/BookEditor/BookEditor';
|
|
5
|
+
import { BOOK_SECTION_PRESETS } from '../config/bookSections';
|
|
6
|
+
import { insertBookContentBeforeLearningMarker } from '../lib/bookSource';
|
|
7
|
+
import { Badge } from './ui/Badge';
|
|
8
|
+
import { Button } from './ui/Button';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Props for the editable manGo Book editor.
|
|
12
|
+
*/
|
|
13
|
+
type ManGoBookEditorProps = {
|
|
14
|
+
readonly value: string;
|
|
15
|
+
readonly onChange: (value: string) => void;
|
|
16
|
+
readonly onRegenerate?: () => void;
|
|
17
|
+
readonly isRegenerating?: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Renders the editable Book source and the Book-language section presets used by manGo.
|
|
22
|
+
*
|
|
23
|
+
* @param props - Current source and editor actions.
|
|
24
|
+
* @returns Editable Book editor with section controls.
|
|
25
|
+
*/
|
|
26
|
+
export function ManGoBookEditor({ value, onChange, onRegenerate, isRegenerating = false }: ManGoBookEditorProps) {
|
|
27
|
+
function addSection(section: string): void {
|
|
28
|
+
onChange(insertBookContentBeforeLearningMarker(value, [section]));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<div>
|
|
33
|
+
<div className="overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-[var(--ob-shadow-md)]">
|
|
34
|
+
<div className="flex flex-wrap items-center justify-between gap-3 border-b border-zinc-200 bg-zinc-50/80 px-4 py-2.5">
|
|
35
|
+
<span className="flex items-center gap-2 text-[13px] text-zinc-600">
|
|
36
|
+
<span aria-hidden>📖</span>
|
|
37
|
+
<strong className="font-semibold text-zinc-800">Book</strong>
|
|
38
|
+
<span className="hidden sm:inline">
|
|
39
|
+
<Badge tone="accent">Plně editovatelný</Badge>
|
|
40
|
+
</span>
|
|
41
|
+
</span>
|
|
42
|
+
{onRegenerate && (
|
|
43
|
+
<Button
|
|
44
|
+
variant="ghost"
|
|
45
|
+
size="sm"
|
|
46
|
+
isLoading={isRegenerating}
|
|
47
|
+
leadingIcon={<span aria-hidden>↻</span>}
|
|
48
|
+
onClick={onRegenerate}
|
|
49
|
+
title="Přegenerovat book ze zadání"
|
|
50
|
+
>
|
|
51
|
+
<span className="hidden md:inline">Přegenerovat</span>
|
|
52
|
+
</Button>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
|
|
56
|
+
<BookEditor
|
|
57
|
+
value={value as string_book}
|
|
58
|
+
onChange={(nextValue) => onChange(nextValue)}
|
|
59
|
+
height="28rem"
|
|
60
|
+
isBorderRadiusDisabled
|
|
61
|
+
isVerbose={false}
|
|
62
|
+
/>
|
|
63
|
+
</div>
|
|
64
|
+
|
|
65
|
+
<div className="mt-4">
|
|
66
|
+
<div className="mb-2 text-xs font-semibold text-zinc-500">Přidat sekci do booku:</div>
|
|
67
|
+
<div className="flex flex-wrap gap-2">
|
|
68
|
+
{BOOK_SECTION_PRESETS.map((preset) => (
|
|
69
|
+
<button
|
|
70
|
+
key={preset.key}
|
|
71
|
+
type="button"
|
|
72
|
+
onClick={() => addSection(preset.book)}
|
|
73
|
+
className="inline-flex items-center gap-1 rounded-full border border-dashed border-zinc-300 bg-white px-3 py-1.5 text-xs font-medium text-zinc-500 transition-colors hover:border-[color:var(--ob-accent-400)] hover:bg-[color:var(--ob-accent-50)] hover:text-[color:var(--ob-accent-700)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--ob-ring)]"
|
|
74
|
+
>
|
|
75
|
+
+ {preset.label}
|
|
76
|
+
</button>
|
|
77
|
+
))}
|
|
78
|
+
</div>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
}
|
|
@@ -30,7 +30,7 @@ const ONBOARDING_DONE_PATH = ONBOARDING_FLOW.find((step) => step.id === 'done')?
|
|
|
30
30
|
*/
|
|
31
31
|
type ClassicBookEditorButtonProps = {
|
|
32
32
|
/**
|
|
33
|
-
* Opens the classic Book editor with the current
|
|
33
|
+
* Opens the classic Book editor with the current Book.
|
|
34
34
|
*/
|
|
35
35
|
readonly onOpenEditor: () => void;
|
|
36
36
|
|
|
@@ -107,7 +107,7 @@ export function WizardShell({ children, defaultVisibility, onOpenEditor }: Wizar
|
|
|
107
107
|
const isClassicBookEditorButtonVisible = currentPath !== ONBOARDING_DONE_PATH;
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
|
-
* Opens the classic Book editor with the current manGo
|
|
110
|
+
* Opens the classic Book editor with the current manGo Book.
|
|
111
111
|
*/
|
|
112
112
|
function handleOpenEditor(): void {
|
|
113
113
|
onOpenEditor(createManGoOpenEditorRequest(state, defaultVisibility));
|
|
@@ -4,10 +4,9 @@ import { useCallback, useEffect, useRef, useState } from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { ONBOARDING_ENTRY_PATH, ONBOARDING_STEPS } from '../../config/steps';
|
|
6
6
|
import { useManGoOnboardingNavigation } from '../../ManGoOnboardingNavigation';
|
|
7
|
-
import {
|
|
7
|
+
import { generateBook } from '../../services/bookService';
|
|
8
8
|
import { useOnboarding } from '../../state/OnboardingProvider';
|
|
9
|
-
import {
|
|
10
|
-
import { MarkdownBookEditor } from '../MarkdownBookEditor';
|
|
9
|
+
import { ManGoBookEditor } from '../ManGoBookEditor';
|
|
11
10
|
import { StepFooter, StepHeader } from '../StepFrame';
|
|
12
11
|
import { Banner } from '../ui/Banner';
|
|
13
12
|
import { Button } from '../ui/Button';
|
|
@@ -29,16 +28,16 @@ export function BookStep() {
|
|
|
29
28
|
setPhase('generating');
|
|
30
29
|
setError(null);
|
|
31
30
|
try {
|
|
32
|
-
const
|
|
33
|
-
update({ bookSource:
|
|
31
|
+
const book = await generateBook({ agentName: state.agentName, agentBrief: state.agentBrief });
|
|
32
|
+
update({ bookSource: book });
|
|
34
33
|
setPhase('ready');
|
|
35
34
|
} catch (caught) {
|
|
36
|
-
setError(caught instanceof Error ? caught.message : 'Generování
|
|
35
|
+
setError(caught instanceof Error ? caught.message : 'Generování booku selhalo.');
|
|
37
36
|
setPhase('error');
|
|
38
37
|
}
|
|
39
38
|
}, [state.agentName, state.agentBrief, update]);
|
|
40
39
|
|
|
41
|
-
// Generate the
|
|
40
|
+
// Generate the Book once, after hydration completes — so we read the persisted
|
|
42
41
|
// name/brief rather than the initial empty state. Runs a single time (startedRef),
|
|
43
42
|
// reading the latest values from the closure captured when hydration flips true.
|
|
44
43
|
useEffect(() => {
|
|
@@ -59,7 +58,7 @@ export function BookStep() {
|
|
|
59
58
|
if (phase === 'init' || phase === 'generating') {
|
|
60
59
|
return (
|
|
61
60
|
<div className="mx-auto max-w-2xl">
|
|
62
|
-
<StepHeader eyebrow="Definice agenta" title="
|
|
61
|
+
<StepHeader eyebrow="Definice agenta" title="Generujeme book" />
|
|
63
62
|
<Card variant="elevated" className="flex flex-col items-center justify-center gap-5 px-8 py-20 text-center">
|
|
64
63
|
<span className="relative flex h-14 w-14 items-center justify-center">
|
|
65
64
|
<span className="absolute inset-0 animate-ping rounded-full bg-[color:var(--ob-accent-200)] opacity-60" />
|
|
@@ -68,7 +67,7 @@ export function BookStep() {
|
|
|
68
67
|
</span>
|
|
69
68
|
</span>
|
|
70
69
|
<div>
|
|
71
|
-
<p className="text-sm font-semibold text-zinc-800">Čtu vaše zadání a píšu
|
|
70
|
+
<p className="text-sm font-semibold text-zinc-800">Čtu vaše zadání a píšu book…</p>
|
|
72
71
|
<p className="mt-1 text-xs text-zinc-400">Chvíli to může trvat — generuje skutečný model.</p>
|
|
73
72
|
</div>
|
|
74
73
|
</Card>
|
|
@@ -82,12 +81,12 @@ export function BookStep() {
|
|
|
82
81
|
<div className="mx-auto max-w-4xl">
|
|
83
82
|
<StepHeader
|
|
84
83
|
eyebrow="Definice agenta"
|
|
85
|
-
title="
|
|
86
|
-
subtitle="Je to
|
|
84
|
+
title="Book je připravený"
|
|
85
|
+
subtitle="Je to výchozí verze — cokoli přepište, smažte nebo doplňte přímo v editoru booku."
|
|
87
86
|
/>
|
|
88
87
|
|
|
89
88
|
{phase === 'error' && (
|
|
90
|
-
<Banner tone="warning" title="
|
|
89
|
+
<Banner tone="warning" title="Book se nepodařilo vygenerovat." className="mb-5">
|
|
91
90
|
<p>{error}</p>
|
|
92
91
|
<p className="mt-1">Book můžete napsat i ručně níže, nebo to zkuste znovu.</p>
|
|
93
92
|
</Banner>
|
|
@@ -95,7 +94,7 @@ export function BookStep() {
|
|
|
95
94
|
|
|
96
95
|
{!isBriefAvailable && state.bookSource.trim().length === 0 && phase !== 'error' && (
|
|
97
96
|
<Banner tone="info" className="mb-5">
|
|
98
|
-
Nejprve vyplňte zadání, ať můžeme
|
|
97
|
+
Nejprve vyplňte zadání, ať můžeme book vygenerovat — nebo book napište ručně níže.{' '}
|
|
99
98
|
<button
|
|
100
99
|
type="button"
|
|
101
100
|
className="font-semibold text-[color:var(--ob-accent-700)] underline underline-offset-2 hover:text-[color:var(--ob-accent-800)]"
|
|
@@ -106,14 +105,12 @@ export function BookStep() {
|
|
|
106
105
|
</Banner>
|
|
107
106
|
)}
|
|
108
107
|
|
|
109
|
-
<
|
|
108
|
+
<ManGoBookEditor
|
|
110
109
|
value={state.bookSource}
|
|
111
110
|
onChange={(value) => update({ bookSource: value })}
|
|
112
111
|
onRegenerate={isBriefAvailable ? () => void generate() : undefined}
|
|
113
112
|
/>
|
|
114
113
|
|
|
115
|
-
{state.bookSource.trim().length > 0 && <BookLanguagePanel source={state.bookSource} />}
|
|
116
|
-
|
|
117
114
|
<StepFooter
|
|
118
115
|
left={
|
|
119
116
|
<Button variant="ghost" onClick={() => navigateToPath(ONBOARDING_ENTRY_PATH)}>
|
|
@@ -9,7 +9,7 @@ import { InputField, TextareaField } from '../ui/Field';
|
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Entry screen of the wizard ("Řekněte mi o agentovi"). Captures the agent name + a
|
|
12
|
-
* one-sentence brief, then continues to the Book step where the
|
|
12
|
+
* one-sentence brief, then continues to the Book step where the Book is generated.
|
|
13
13
|
*/
|
|
14
14
|
export function ZadaniStep() {
|
|
15
15
|
const { navigateToPath } = useManGoOnboardingNavigation();
|
|
@@ -24,8 +24,8 @@ export function ZadaniStep() {
|
|
|
24
24
|
Řekněte mi o agentovi
|
|
25
25
|
</h1>
|
|
26
26
|
<p className="mt-2.5 text-sm leading-relaxed text-zinc-500">
|
|
27
|
-
Stačí název a jedna věta o tom, co má agent dělat. Z toho připravíme
|
|
28
|
-
|
|
27
|
+
Stačí název a jedna věta o tom, co má agent dělat. Z toho připravíme book, který si pak libovolně
|
|
28
|
+
upravíte.
|
|
29
29
|
</p>
|
|
30
30
|
|
|
31
31
|
<div className="mt-8 space-y-6">
|
|
@@ -54,7 +54,7 @@ export function ZadaniStep() {
|
|
|
54
54
|
trailingIcon={<span aria-hidden>→</span>}
|
|
55
55
|
onClick={() => navigateToPath(ONBOARDING_STEPS[0].path)}
|
|
56
56
|
>
|
|
57
|
-
Vygenerovat
|
|
57
|
+
Vygenerovat book
|
|
58
58
|
</Button>
|
|
59
59
|
}
|
|
60
60
|
/>
|
package/apps/agents-server/src/components/NewAgentDialog/ManGoNewAgentWizard/config/bookSections.ts
CHANGED
|
@@ -1,31 +1,36 @@
|
|
|
1
1
|
import { spaceTrim } from 'spacetrim';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Predefined
|
|
5
|
-
* Mirrors the wireframe's section presets; users
|
|
4
|
+
* Predefined Book-language sections offered as "Přidat sekci" chips in the editor.
|
|
5
|
+
* Mirrors the wireframe's section presets; users insert and then freely edit them.
|
|
6
6
|
*/
|
|
7
7
|
export type BookSectionPreset = {
|
|
8
8
|
readonly key: string;
|
|
9
9
|
readonly label: string;
|
|
10
|
-
readonly
|
|
10
|
+
readonly book: string;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Book-language section presets shown below the manGo Book editor.
|
|
15
|
+
*
|
|
16
|
+
* @private internal constant of <ManGoBookEditor/>
|
|
17
|
+
*/
|
|
13
18
|
export const BOOK_SECTION_PRESETS: readonly BookSectionPreset[] = [
|
|
14
19
|
{
|
|
15
20
|
key: 'priklady',
|
|
16
21
|
label: 'Příklady odpovědí',
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
book: spaceTrim(`
|
|
23
|
+
WRITING SAMPLE
|
|
24
|
+
Uživatel: Kde je moje objednávka?
|
|
25
|
+
Agent: Dobrý den, děkujeme za zprávu. Vaši objednávku jsme ověřili — …
|
|
21
26
|
`),
|
|
22
27
|
},
|
|
23
28
|
{
|
|
24
29
|
key: 'eskalace',
|
|
25
30
|
label: 'Eskalace',
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
book: spaceTrim(`
|
|
32
|
+
RULE
|
|
33
|
+
Požadavek předejte člověku, pokud jde o:
|
|
29
34
|
- Reklamace nad 10 000 Kč
|
|
30
35
|
- Rozzlobený zákazník (2. a další urgence)
|
|
31
36
|
- Právní dotazy
|
|
@@ -34,8 +39,8 @@ export const BOOK_SECTION_PRESETS: readonly BookSectionPreset[] = [
|
|
|
34
39
|
{
|
|
35
40
|
key: 'podpis',
|
|
36
41
|
label: 'Podpis / šablona',
|
|
37
|
-
|
|
38
|
-
|
|
42
|
+
book: spaceTrim(`
|
|
43
|
+
MESSAGE SUFFIX
|
|
39
44
|
S pozdravem,
|
|
40
45
|
Zákaznická podpora
|
|
41
46
|
kontakt@firma.cz
|
|
@@ -44,8 +49,9 @@ export const BOOK_SECTION_PRESETS: readonly BookSectionPreset[] = [
|
|
|
44
49
|
{
|
|
45
50
|
key: 'zakazana',
|
|
46
51
|
label: 'Zakázaná témata',
|
|
47
|
-
|
|
48
|
-
|
|
52
|
+
book: spaceTrim(`
|
|
53
|
+
RULE
|
|
54
|
+
Nikdy neposkytujte ani nerozebírejte:
|
|
49
55
|
- Interní procesy a ceny dodavatelů
|
|
50
56
|
- Srovnávání s konkurencí
|
|
51
57
|
- Právní stanoviska
|
|
@@ -54,8 +60,9 @@ export const BOOK_SECTION_PRESETS: readonly BookSectionPreset[] = [
|
|
|
54
60
|
{
|
|
55
61
|
key: 'vlastni',
|
|
56
62
|
label: 'Vlastní sekce',
|
|
57
|
-
|
|
58
|
-
|
|
63
|
+
book: spaceTrim(`
|
|
64
|
+
NOTE
|
|
65
|
+
Vlastní sekce:
|
|
59
66
|
Sem napište cokoli dalšího…
|
|
60
67
|
`),
|
|
61
68
|
},
|