@promptbook/cli 0.114.0-0 → 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 +805 -842
- 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
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { normalizeEmailDomain } from '../email/agentEmailAddress';
|
|
2
2
|
import { listAgentEmailIdentities, type AgentEmailIdentity } from '../email/listAgentEmailIdentities';
|
|
3
|
+
import type { ManagedServerDnsDiagnostic } from '../../app/superadmin/servers/ServersRegistryDnsTypes';
|
|
4
|
+
import { createStandaloneVpsDomainDnsDiagnostic } from '../standaloneVpsDnsDiagnostics';
|
|
3
5
|
import { readStalwartConfiguration } from './StalwartConfiguration';
|
|
4
6
|
import { listStalwartObjects } from './stalwartJmapClient';
|
|
5
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
buildStalwartInboundHookUrl,
|
|
9
|
+
buildStalwartMailServerHostname,
|
|
10
|
+
STALWART_MAIL_BRIDGE_LOCAL_PART,
|
|
11
|
+
} from './stalwartMailBridge';
|
|
6
12
|
|
|
7
13
|
/**
|
|
8
14
|
* Read-only operational state shown on Stalwart administration pages.
|
|
@@ -19,6 +25,7 @@ export type StalwartEmailSnapshot = {
|
|
|
19
25
|
readonly isBridgeAccountConfigured: boolean;
|
|
20
26
|
readonly isInboundHookConfigured: boolean;
|
|
21
27
|
readonly agents: ReadonlyArray<AgentEmailIdentity>;
|
|
28
|
+
readonly mailDnsDiagnostic: ManagedServerDnsDiagnostic;
|
|
22
29
|
};
|
|
23
30
|
|
|
24
31
|
/**
|
|
@@ -33,13 +40,14 @@ export function isStalwartEmailSnapshotOperational(
|
|
|
33
40
|
snapshot: Pick<
|
|
34
41
|
StalwartEmailSnapshot,
|
|
35
42
|
'isReachable' | 'domainId' | 'isBridgeAccountConfigured' | 'isInboundHookConfigured'
|
|
36
|
-
|
|
43
|
+
> & { readonly mailDnsDiagnostic: Pick<ManagedServerDnsDiagnostic, 'status'> },
|
|
37
44
|
): boolean {
|
|
38
45
|
return Boolean(
|
|
39
46
|
snapshot.isReachable &&
|
|
40
47
|
snapshot.domainId &&
|
|
41
48
|
snapshot.isBridgeAccountConfigured &&
|
|
42
|
-
snapshot.isInboundHookConfigured
|
|
49
|
+
snapshot.isInboundHookConfigured &&
|
|
50
|
+
snapshot.mailDnsDiagnostic.status === 'verified',
|
|
43
51
|
);
|
|
44
52
|
}
|
|
45
53
|
|
|
@@ -49,13 +57,20 @@ export function isStalwartEmailSnapshotOperational(
|
|
|
49
57
|
export async function readStalwartEmailSnapshot(domainValue: string): Promise<StalwartEmailSnapshot> {
|
|
50
58
|
const domain = normalizeEmailDomain(domainValue);
|
|
51
59
|
const configuration = readStalwartConfiguration();
|
|
52
|
-
const agents = await
|
|
60
|
+
const [agents, mailDnsDiagnostic] = await Promise.all([
|
|
61
|
+
listAgentEmailIdentities(domain),
|
|
62
|
+
createStandaloneVpsDomainDnsDiagnostic({
|
|
63
|
+
domain: buildStalwartMailServerHostname(domain),
|
|
64
|
+
publicIpAddress: process.env.PTBK_PUBLIC_IP_ADDRESS,
|
|
65
|
+
}),
|
|
66
|
+
]);
|
|
53
67
|
const baseSnapshot = {
|
|
54
68
|
checkedAt: new Date().toISOString(),
|
|
55
69
|
apiUrl: configuration.apiUrl,
|
|
56
70
|
isConfigured: configuration.isConfigured,
|
|
57
71
|
domain,
|
|
58
72
|
agents,
|
|
73
|
+
mailDnsDiagnostic,
|
|
59
74
|
};
|
|
60
75
|
|
|
61
76
|
if (!configuration.isConfigured) {
|
|
@@ -83,7 +98,10 @@ export async function readStalwartEmailSnapshot(domainValue: string): Promise<St
|
|
|
83
98
|
return {
|
|
84
99
|
...baseSnapshot,
|
|
85
100
|
isReachable: true,
|
|
86
|
-
errorMessage:
|
|
101
|
+
errorMessage:
|
|
102
|
+
mailDnsDiagnostic.status === 'verified'
|
|
103
|
+
? null
|
|
104
|
+
: `Public SMTP delivery needs attention. ${mailDnsDiagnostic.summary}`,
|
|
87
105
|
domainId,
|
|
88
106
|
dnsZoneFile: typeof domainObject?.dnsZoneFile === 'string' ? domainObject.dnsZoneFile : null,
|
|
89
107
|
isBridgeAccountConfigured: accounts.some(
|
|
@@ -3,6 +3,7 @@ import { UnexpectedError } from '../../../../../src/errors/UnexpectedError';
|
|
|
3
3
|
import { spaceTrim } from '../../../../../src/utils/organization/spaceTrim';
|
|
4
4
|
import type { StalwartConfiguration } from './StalwartConfiguration';
|
|
5
5
|
import { callStalwartJmapAllowingBootstrapMode } from './stalwartJmapClient';
|
|
6
|
+
import { buildStalwartMailServerHostname } from './stalwartMailBridge';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Whether the initial setup of the bundled Stalwart instance is still pending or already finished.
|
|
@@ -50,7 +51,7 @@ const STALWART_BOOTSTRAP_VERIFICATION_DELAY_MS = 1_000;
|
|
|
50
51
|
*/
|
|
51
52
|
export function buildStalwartBootstrapValue(domain: string): Readonly<Record<string, unknown>> {
|
|
52
53
|
return {
|
|
53
|
-
serverHostname:
|
|
54
|
+
serverHostname: buildStalwartMailServerHostname(domain),
|
|
54
55
|
defaultDomain: domain,
|
|
55
56
|
requestTlsCertificate: false,
|
|
56
57
|
generateDkimKeys: true,
|
|
@@ -3,6 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const STALWART_MAIL_BRIDGE_LOCAL_PART = 'promptbook-mailbridge';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Builds the canonical public hostname of the Stalwart SMTP server for one Agents Server domain.
|
|
8
|
+
*/
|
|
9
|
+
export function buildStalwartMailServerHostname(domain: string): string {
|
|
10
|
+
return `mail.${domain}`;
|
|
11
|
+
}
|
|
12
|
+
|
|
6
13
|
/**
|
|
7
14
|
* Builds the address of the mail bridge mailbox which is also the catch-all address of one domain.
|
|
8
15
|
*/
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Local host and port used by the mocked Supabase API during integration tests.
|
|
5
|
+
*/
|
|
6
|
+
const MOCK_SUPABASE_PORT = 54321;
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Base URL served by the mocked Supabase API.
|
|
10
|
+
*/
|
|
11
|
+
const MOCK_SUPABASE_URL = `http://127.0.0.1:${MOCK_SUPABASE_PORT}`;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Local host and port used by the Agents Server application during integration tests.
|
|
15
|
+
*/
|
|
16
|
+
const APP_PORT = 4440;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Base URL served by the Agents Server application during integration tests.
|
|
20
|
+
*/
|
|
21
|
+
const APP_URL = `http://127.0.0.1:${APP_PORT}`;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Shared environment variables required by deterministic E2E builds and runs.
|
|
25
|
+
*/
|
|
26
|
+
const APP_E2E_ENV = Object.freeze({
|
|
27
|
+
ADMIN_PASSWORD: 'e2e-admin-password',
|
|
28
|
+
SESSION_SECRET: 'e2e-session-secret-must-differ-from-admin-password',
|
|
29
|
+
PTBK_AGENTS_SERVER_USER_CHAT_WORKER_TOKEN: 'e2e-user-chat-worker-token-must-differ-from-admin-password',
|
|
30
|
+
PROMPTBOOK_TEAM_AGENT_ACCESS_TOKEN: 'e2e-team-agent-access-token-must-differ-from-admin-password',
|
|
31
|
+
NEXT_DIST_DIR: '.next-e2e',
|
|
32
|
+
NEXT_PUBLIC_SITE_URL: APP_URL,
|
|
33
|
+
PTBK_AGENTS_SERVER_DATABASE: 'supabase',
|
|
34
|
+
PTBK_AGENTS_SERVER_SQLITE_PATH: '',
|
|
35
|
+
SUPABASE_TABLE_PREFIX: '',
|
|
36
|
+
POSTGRES_URL: '',
|
|
37
|
+
DATABASE_URL: '',
|
|
38
|
+
NEXT_PUBLIC_SUPABASE_URL: MOCK_SUPABASE_URL,
|
|
39
|
+
NEXT_PUBLIC_SUPABASE_ANON_KEY: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiJ9.e2e-signature',
|
|
40
|
+
SUPABASE_SERVICE_ROLE_KEY: 'eyJhbGciOiJIUzI1NiIsInR5cCI6InNlcnZpY2Vfcm9sZSJ9.e2e-signature',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
module.exports = {
|
|
44
|
+
APP_E2E_ENV,
|
|
45
|
+
APP_PORT,
|
|
46
|
+
APP_URL,
|
|
47
|
+
MOCK_SUPABASE_PORT,
|
|
48
|
+
MOCK_SUPABASE_URL,
|
|
49
|
+
};
|