@promptbook/cli 0.114.0-5 → 0.114.0-7
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/agents/default/developer.book +1 -0
- package/apps/agents-server/next.config.ts +22 -0
- package/apps/agents-server/package.json +6 -6
- package/apps/agents-server/scripts/build-agents-server.js +43 -7
- package/apps/agents-server/scripts/build-e2e.js +12 -2
- package/apps/agents-server/scripts/generate-reserved-paths/generate-reserved-paths.ts +30 -16
- package/apps/agents-server/scripts/kill-port.js +163 -0
- package/apps/agents-server/scripts/run-e2e-tests.js +21 -8
- package/apps/agents-server/scripts/run-npm.js +81 -5
- package/apps/agents-server/src/app/actions.ts +3 -0
- package/apps/agents-server/src/app/admin/email-server/page.tsx +17 -18
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerTaskRow.tsx +2 -0
- package/apps/agents-server/src/app/admin/task-manager/[taskId]/TaskManagerTaskDetailClient.tsx +2 -0
- package/apps/agents-server/src/app/admin/task-manager/taskManagerTaskPresentation.tsx +23 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +7 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/[timeoutId]/route.ts +10 -153
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/route.ts +9 -4
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/route.ts +3 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/[chatId]/stream/route.ts +2 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/resolveUserChatScope.ts +8 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/user-chats/route.ts +15 -7
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorSaving.ts +18 -28
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatHistoryClient.tsx +19 -1
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentChatSidebarDefault.tsx +17 -5
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatNotice.tsx +23 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatPlannedMessages.tsx +153 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatPanel.tsx +6 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/CanonicalAgentChatSurface.tsx +13 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/ExternalUserChatAdminActions.tsx +51 -3
- package/apps/agents-server/src/app/agents/[agentName]/chat/TeamMemberFrozenChatPrimaryAgentLink.tsx +31 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/useAgentChatSidebarState.ts +26 -2
- package/apps/agents-server/src/app/agents/[agentName]/goal/page.tsx +35 -0
- package/apps/agents-server/src/app/agents/[agentName]/projects/[projectName]/page.tsx +2 -2
- package/apps/agents-server/src/app/api/admin/dns-records/cloudflare/route.ts +26 -16
- package/apps/agents-server/src/app/api/emails/incoming/stalwart/route.ts +9 -2
- package/apps/agents-server/src/app/superadmin/servers/ServersRegistryTable.tsx +31 -39
- package/apps/agents-server/src/components/AgentProfile/AgentProfile.tsx +10 -3
- package/apps/agents-server/src/components/AgentProjects/AgentProjectIcon.tsx +137 -0
- package/apps/agents-server/src/components/AgentProjects/AgentProjectItem.tsx +26 -10
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsApiTokenImportStep.tsx +5 -6
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsCheckStep.tsx +6 -5
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsManualStep.tsx +10 -14
- package/apps/agents-server/src/components/CloudflareDnsWizard/CloudflareDnsWizard.tsx +11 -20
- package/apps/agents-server/src/components/CloudflareDnsWizard/useCloudflareDnsRecordImport.ts +5 -6
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsInstructions.tsx +91 -57
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionPanel.tsx +63 -0
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsSectionVariantTabs.tsx +67 -0
- package/apps/agents-server/src/components/DnsRecordsInstructions/DnsRecordsTable.tsx +40 -0
- package/apps/agents-server/src/components/Header/buildActiveAgentViewItems.ts +5 -4
- package/apps/agents-server/src/components/Header/createAgentViewLabel.tsx +4 -4
- package/apps/agents-server/src/components/Header/resolveActiveAgentNavigation.ts +2 -2
- package/apps/agents-server/src/components/Homepage/useAgentsListImportExportState.ts +22 -10
- package/apps/agents-server/src/components/_utils/generateMetaTxt.ts +1 -1
- package/apps/agents-server/src/database/migratePrefix.ts +13 -12
- package/apps/agents-server/src/database/migrations/2026-08-0100-agent-goal-chat-source.sql +10 -0
- package/apps/agents-server/src/generated/reservedPaths.ts +42 -42
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +9 -1
- package/apps/agents-server/src/languages/translations/czech.yaml +9 -1
- package/apps/agents-server/src/languages/translations/english.yaml +9 -1
- package/apps/agents-server/src/message-providers/email/stalwart/parseInboundStalwartEmail.ts +17 -2
- package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatConstants.ts +9 -0
- package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatIdentity.ts +28 -0
- package/apps/agents-server/src/utils/agentGoalChat/appendAgentGoalChatNote.ts +43 -0
- package/apps/agents-server/src/utils/agentGoalChat/canAccessAgentGoalChat.ts +14 -0
- package/apps/agents-server/src/utils/agentGoalChat/createAgentGoalChatNoteContent.ts +69 -0
- package/apps/agents-server/src/utils/agentGoalChat/ensureAgentGoalChat.ts +66 -0
- package/apps/agents-server/src/utils/agentGoalChat/prependAgentGoalChatSummarySeed.ts +40 -0
- package/apps/agents-server/src/utils/agentGoalChat/recordAgentGoalChatLifecycleNote.ts +36 -0
- package/apps/agents-server/src/utils/agentGoalChat/resolveAgentGoalChatOwnerUserId.ts +104 -0
- package/apps/agents-server/src/utils/agentGoalChat/scheduleAgentGoalChatModifiedNote.ts +82 -0
- package/apps/agents-server/src/utils/agentGoalChat.ts +19 -0
- package/apps/agents-server/src/utils/agentProjects/AgentProjectInfo.ts +10 -1
- package/apps/agents-server/src/utils/agentProjects/AgentProjectReferenceInfo.ts +5 -2
- package/apps/agents-server/src/utils/agentProjects/agentProjectFileNames.ts +21 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectHrefs.ts +20 -11
- package/apps/agents-server/src/utils/agentProjects/agentProjectsPaths.ts +15 -5
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectInitials.ts +36 -0
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectMarkdownReferences.ts +11 -9
- package/apps/agents-server/src/utils/agentProjects/createAgentProjectsDnsRecordsSection.ts +113 -0
- package/apps/agents-server/src/utils/agentProjects/createStaticAgentProjectServer.ts +2 -6
- package/apps/agents-server/src/utils/agentProjects/humanizeAgentProjectName.ts +25 -0
- package/apps/agents-server/src/utils/agentProjects/listAgentProjectChatReferences.ts +10 -3
- package/apps/agents-server/src/utils/agentProjects/parseAgentProjectIndexHtml.ts +167 -0
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectIndexHtmlProfile.ts +24 -0
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectReadme.ts +3 -53
- package/apps/agents-server/src/utils/agentProjects/readAgentProjectRootTextFile.ts +73 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectFaviconRelativePath.ts +108 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectInfo.ts +12 -3
- package/apps/agents-server/src/utils/agentProjects/{resolveAgentProjectReadmeProfile.ts → resolveAgentProjectProfile.ts} +33 -33
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectPublicUrls.ts +34 -0
- package/apps/agents-server/src/utils/bookLanguageDocumentation/createBookLanguageDocumentationPdfResponse.ts +19 -17
- package/apps/agents-server/src/utils/chatTasksAdmin.ts +9 -0
- package/apps/agents-server/src/utils/dnsRecords/DnsRecordInstruction.ts +20 -0
- package/apps/agents-server/src/utils/dnsRecords/DnsRecordsSection.ts +77 -0
- package/apps/agents-server/src/utils/dnsRecords/createServerDnsRecordsSections.ts +58 -0
- package/apps/agents-server/src/utils/dnsRecords/createServerDomainDnsRecordsSection.ts +48 -0
- package/apps/agents-server/src/utils/dnsRecords/dnsRecordGroups.ts +52 -0
- package/apps/agents-server/src/utils/dnsRecords/resolveDnsRecordBatchPlan.ts +47 -1
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/adminChatTaskSqlQuery.ts +41 -36
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskFallbackRows.ts +3 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/mapAdminChatTaskSqlRows.ts +2 -0
- package/apps/agents-server/src/utils/localChatRunner/parseLocalTeamConversations.ts +281 -0
- package/apps/agents-server/src/utils/localChatRunner/persistLocalTeamConversations.ts +71 -0
- package/apps/agents-server/src/utils/localChatRunner/prepareLocalTeamConversationWorkspace.ts +233 -0
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +37 -6
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/insertManagedServerRegistryRow.ts +2 -2
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerCoreAgents.ts +7 -6
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerDefaultAgents.ts +5 -4
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerMetadata.ts +3 -2
- package/apps/agents-server/src/utils/serverManagement/createManagedServer/seedServerUsers.ts +3 -2
- package/apps/agents-server/src/utils/serverManagement/deleteManagedServer.ts +2 -2
- package/apps/agents-server/src/utils/stalwart/createEmailDnsRecordsSection.ts +53 -0
- package/apps/agents-server/src/utils/userChat/UserChatRecord.ts +13 -0
- package/apps/agents-server/src/utils/userChat/UserChatSource.ts +14 -0
- package/apps/agents-server/src/utils/userChat/createUserChatSummary.ts +10 -2
- package/apps/agents-server/src/utils/userChat/finalizeUserChatJob.ts +3 -2
- package/apps/agents-server/src/utils/userChat/getUserChat.ts +16 -1
- package/apps/agents-server/src/utils/userChat/getUserChatForJobRunner.ts +31 -0
- package/apps/agents-server/src/utils/userChat/listUserChats.ts +113 -110
- package/apps/agents-server/src/utils/userChat/persistFrozenUserChat.ts +21 -6
- package/apps/agents-server/src/utils/userChat/runImmediateUserChatAnswer.ts +2 -6
- package/apps/agents-server/src/utils/userChat/runUserChatJob.ts +2 -6
- package/apps/agents-server/src/utils/userChat/teamMemberUserChatContext.ts +63 -0
- package/apps/agents-server/src/utils/userChat.ts +5 -1
- package/apps/agents-server/src/utils/userChatClient/cancelAgentUserTimeout.ts +2 -2
- package/apps/agents-server/src/utils/userChatClient/fetchAgentUserTimeouts.ts +2 -2
- package/apps/agents-server/src/utils/userChatClient.ts +9 -31
- package/apps/agents-server/src/utils/userChatTimeout/UserChatTimeoutRecord.ts +10 -2
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/claimNextDueUserChatTimeout.ts +28 -25
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/getAgentScopedUserChatTimeout.ts +8 -4
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/listAgentUserChatTimeouts.ts +4 -1
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/recoverExpiredRunningUserChatTimeouts.ts +3 -2
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +53 -0
- package/esm/index.es.js +1534 -401
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +7 -1
- package/esm/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
- package/esm/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
- package/esm/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
- package/esm/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/esm/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
- package/esm/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
- package/esm/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
- package/esm/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
- package/esm/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/esm/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/esm/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +12 -3
- package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/{umd/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → esm/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/esm/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
- package/esm/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
- package/esm/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
- package/esm/src/utils/misc/debounce.d.ts +4 -2
- package/esm/src/utils/misc/debounce.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/avatars/renderAvatarVisualTerminalText.ts +249 -0
- package/src/avatars/types/AvatarVisualDefinition.ts +60 -0
- package/src/avatars/visuals/asciiOctopusAvatarVisual.ts +144 -22
- package/src/book-2.0/book-language-documentation/createStandaloneBookLanguageMarkdown.ts +4 -4
- package/src/book-2.0/book-language-documentation/renderCommitmentCatalogSection.ts +1 -4
- package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts +4 -17
- package/src/book-3.0/AgentTeamConversationWorkspace.ts +172 -0
- package/src/book-components/BookEditor/useBookEditorMonacoStyles.ts +56 -55
- package/src/book-components/Chat/Chat/Chat.module.css +1 -8
- package/src/book-components/Chat/Chat/ChatMessageMap.tsx +8 -4
- package/src/book-components/Chat/Chat/ChatProps.tsx +3 -2
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.module.css +14 -14
- package/src/book-components/Chat/save/react/exports/chat-preview-2025-10-13 (1).jsx +95 -5
- package/src/book-components/Chat/utils/renderMarkdown.ts +535 -89
- package/src/cli/cli-commands/coder/add.ts +3 -3
- package/src/cli/cli-commands/coder/boilerplateCount.ts +1 -1
- package/src/cli/cli-commands/coder/generate-boilerplates.ts +27 -27
- package/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.ts +5 -4
- package/src/cli/cli-commands/coder/init.ts +3 -3
- package/src/cli/cli-commands/coder/run.ts +10 -2
- package/src/cli/cli-commands/common/coderGitSyncCliOptions.ts +6 -2
- package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +2 -2
- package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +4 -4
- package/src/cli/cli-commands/common/harness/$resolveInstalledHarnessVersion.ts +2 -2
- package/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.ts → npm/$askForNpmPackageInstallationApproval.ts} +3 -3
- package/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.ts +49 -0
- package/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.ts +25 -0
- package/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.ts → npm/isNpmPackageVersionOutdated.ts} +6 -4
- package/src/cli/cli-commands/common/projectInitialization.ts +10 -1
- package/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.ts +73 -0
- package/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.ts +94 -0
- package/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.ts +223 -0
- package/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.ts +53 -0
- package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.ts +46 -0
- package/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.ts +32 -0
- package/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.ts +22 -0
- package/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.ts +47 -0
- package/src/commands/FORMAT/formatCommandParser.ts +2 -2
- package/src/llm-providers/openai/utils/buildToolInvocationScript.ts +21 -18
- package/src/other/templates/getTemplatesPipelineCollection.ts +976 -668
- package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +80 -27
- package/src/utils/agents/terminalAgentAvatarVisual.ts +31 -3
- package/src/utils/ascii-art/convertImageDataToAsciiArt.ts +9 -109
- package/src/utils/ascii-art/createAnsiColorCode.ts +132 -0
- package/src/utils/misc/debounce.ts +26 -5
- package/src/version.ts +2 -2
- package/src/versions.txt +2 -0
- package/umd/index.umd.js +1533 -400
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentMessagePrompt.d.ts +7 -1
- package/umd/scripts/run-agent-messages/messages/buildAgentTeamPromptSection.d.ts +12 -0
- package/umd/scripts/run-agent-messages/messages/finalizeAgentTeamConversationWorkspace.d.ts +16 -0
- package/umd/scripts/run-agent-messages/messages/loadAgentTeamConversationWorkspace.d.ts +6 -0
- package/umd/scripts/run-codex-prompts/common/normalizeLineEndingsInChangedFiles.d.ts +2 -3
- package/umd/scripts/run-codex-prompts/git/coderCommitScope.d.ts +31 -0
- package/umd/scripts/run-codex-prompts/git/coderGitSync.d.ts +15 -2
- package/umd/scripts/run-codex-prompts/git/commitChanges.d.ts +9 -3
- package/umd/scripts/run-codex-prompts/git/workingTreeChanges.d.ts +40 -0
- package/umd/scripts/run-codex-prompts/server/coderServerHtml.d.ts +1 -1
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunAgentVisual.d.ts +5 -5
- package/umd/scripts/run-codex-prompts/ui/buildCoderRunUiTerminalFrameUpdate.d.ts +27 -0
- package/umd/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/umd/src/avatars/renderAvatarVisualTerminalText.test.d.ts +1 -0
- package/umd/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +12 -3
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/{harness/$askForHarnessInstallationApproval.d.ts → npm/$askForNpmPackageInstallationApproval.d.ts} +2 -2
- package/{esm/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.d.ts → umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.d.ts} +2 -3
- package/umd/src/cli/cli-commands/common/npm/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$resolvePromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$updatePromptbookCliInstallation.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +39 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallationStatus.d.ts +26 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/buildPromptbookCliInstallCommand.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/umd/src/utils/agents/terminalAgentAvatarVisual.d.ts +5 -2
- package/umd/src/utils/ascii-art/convertImageDataToAsciiArt.d.ts +6 -0
- package/umd/src/utils/ascii-art/createAnsiColorCode.d.ts +46 -0
- package/umd/src/utils/misc/debounce.d.ts +4 -2
- package/umd/src/utils/misc/debounce.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/scripts/ignore-kill-eperm.js +0 -31
- package/apps/agents-server/src/app/agents/[agentName]/api/timeouts/actions/route.ts +0 -103
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsClient.tsx +0 -43
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsEditDialog.tsx +0 -98
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsFiltersCard.tsx +0 -75
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsHeader.tsx +0 -53
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsSummaryMetrics.tsx +0 -70
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableCard.tsx +0 -58
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/AgentTimeoutsTableRow.tsx +0 -242
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/loading.tsx +0 -15
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/page.tsx +0 -28
- package/apps/agents-server/src/app/agents/[agentName]/timeouts/useAgentTimeoutsClientState.ts +0 -769
- package/apps/agents-server/src/components/AgentProjectDnsInstructions/AgentProjectDnsInstructions.tsx +0 -182
- package/apps/agents-server/src/utils/userChatClient/runAgentUserTimeoutBulkAction.ts +0 -24
- package/apps/agents-server/src/utils/userChatClient/updateAgentUserTimeout.ts +0 -25
- package/esm/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
- package/esm/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
- package/src/cli/cli-commands/common/harness/$resolveLatestHarnessVersion.ts +0 -34
- package/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.ts +0 -28
- package/umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.d.ts +0 -11
- package/umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.d.ts +0 -9
- /package/esm/src/{cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → avatars/renderAvatarVisualTerminalText.test.d.ts} +0 -0
- /package/esm/src/cli/cli-commands/common/{harness/isHarnessVersionOutdated.test.d.ts → npm/$resolveLatestNpmPackageVersion.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable no-magic-numbers */
|
|
2
2
|
|
|
3
|
-
import { drawAvatarFrame } from '../avatarRenderingUtils';
|
|
3
|
+
import { DEFAULT_AVATAR_SIZE, drawAvatarFrame } from '../avatarRenderingUtils';
|
|
4
4
|
import type { AvatarPalette, AvatarVisualDefinition } from '../types/AvatarVisualDefinition';
|
|
5
5
|
import type { OrganicTentacleRibbonPoint } from './octopusAvatarVisualShared';
|
|
6
6
|
import {
|
|
@@ -31,6 +31,16 @@ const OUTLINE_GLYPHS = ['#', '%', '@'];
|
|
|
31
31
|
*/
|
|
32
32
|
const ATMOSPHERE_GLYPHS = ['.', ':', "'", '`'];
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Coordinate space the octopus layout is generated in when it is painted into a terminal.
|
|
36
|
+
*
|
|
37
|
+
* The terminal renderer has its own character grid, so the geometry only needs one stable
|
|
38
|
+
* square coordinate space which the grid is then sampled from.
|
|
39
|
+
*
|
|
40
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
41
|
+
*/
|
|
42
|
+
const TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE = DEFAULT_AVATAR_SIZE;
|
|
43
|
+
|
|
34
44
|
/**
|
|
35
45
|
* One 2D point used by the ASCII octopus helpers.
|
|
36
46
|
*
|
|
@@ -42,12 +52,11 @@ type Point = {
|
|
|
42
52
|
};
|
|
43
53
|
|
|
44
54
|
/**
|
|
45
|
-
* Character-grid
|
|
55
|
+
* Character-cell sampling grid shared by the canvas and the terminal ASCII renderers.
|
|
46
56
|
*
|
|
47
57
|
* @private helper of `asciiOctopusAvatarVisual`
|
|
48
58
|
*/
|
|
49
|
-
type
|
|
50
|
-
readonly fontSize: number;
|
|
59
|
+
type AsciiSampleGrid = {
|
|
51
60
|
readonly cellWidth: number;
|
|
52
61
|
readonly cellHeight: number;
|
|
53
62
|
readonly columnCount: number;
|
|
@@ -56,6 +65,22 @@ type AsciiGridMetrics = {
|
|
|
56
65
|
readonly offsetY: number;
|
|
57
66
|
};
|
|
58
67
|
|
|
68
|
+
/**
|
|
69
|
+
* Character-grid metrics used by the canvas ASCII renderer.
|
|
70
|
+
*
|
|
71
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
72
|
+
*/
|
|
73
|
+
type AsciiGridMetrics = AsciiSampleGrid & {
|
|
74
|
+
readonly fontSize: number;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Resolved glyph of every sampled cell of one ASCII octopus frame.
|
|
79
|
+
*
|
|
80
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
81
|
+
*/
|
|
82
|
+
type AsciiOctopusGlyphGrid = ReadonlyArray<ReadonlyArray<AsciiGlyphDescriptor | null>>;
|
|
83
|
+
|
|
59
84
|
/**
|
|
60
85
|
* One seeded eye definition used by the ASCII renderer.
|
|
61
86
|
*
|
|
@@ -135,6 +160,13 @@ export const asciiOctopusAvatarVisual: AvatarVisualDefinition = {
|
|
|
135
160
|
const staticRandom = createRandom('ascii-octopus-static');
|
|
136
161
|
const gridMetrics = createAsciiGridMetrics(size, gridRandom);
|
|
137
162
|
const layout = createAsciiOctopusLayout(size, timeMs, createRandom, staticRandom, interaction);
|
|
163
|
+
const glyphGrid = createAsciiOctopusGlyphGrid({
|
|
164
|
+
sampleGrid: gridMetrics,
|
|
165
|
+
layout,
|
|
166
|
+
palette,
|
|
167
|
+
cellRandom: createRandom('ascii-octopus-cells'),
|
|
168
|
+
timeMs,
|
|
169
|
+
});
|
|
138
170
|
|
|
139
171
|
drawAvatarFrame(context, size, palette);
|
|
140
172
|
drawAsciiBackdrop(context, size, palette, layout, timeMs);
|
|
@@ -144,31 +176,15 @@ export const asciiOctopusAvatarVisual: AvatarVisualDefinition = {
|
|
|
144
176
|
context.textAlign = 'center';
|
|
145
177
|
context.textBaseline = 'middle';
|
|
146
178
|
|
|
147
|
-
// The ASCII renderer samples the morphing octopus field on a low-resolution grid so the shape stays organic
|
|
148
|
-
// while the glyph layout remains deterministic for the same avatar input.
|
|
149
|
-
const cellRandom = createRandom('ascii-octopus-cells');
|
|
150
|
-
|
|
151
179
|
for (let rowIndex = 0; rowIndex < gridMetrics.rowCount; rowIndex++) {
|
|
152
180
|
for (let columnIndex = 0; columnIndex < gridMetrics.columnCount; columnIndex++) {
|
|
153
|
-
const
|
|
154
|
-
x: gridMetrics.offsetX + columnIndex * gridMetrics.cellWidth,
|
|
155
|
-
y: gridMetrics.offsetY + rowIndex * gridMetrics.cellHeight,
|
|
156
|
-
};
|
|
157
|
-
const noise = cellRandom();
|
|
158
|
-
const glyphDescriptor = resolveAsciiGlyph({
|
|
159
|
-
point,
|
|
160
|
-
layout,
|
|
161
|
-
palette,
|
|
162
|
-
cellWidth: gridMetrics.cellWidth,
|
|
163
|
-
cellHeight: gridMetrics.cellHeight,
|
|
164
|
-
noise,
|
|
165
|
-
timeMs,
|
|
166
|
-
});
|
|
181
|
+
const glyphDescriptor = glyphGrid[rowIndex]![columnIndex]!;
|
|
167
182
|
|
|
168
183
|
if (!glyphDescriptor) {
|
|
169
184
|
continue;
|
|
170
185
|
}
|
|
171
186
|
|
|
187
|
+
const point = resolveAsciiSampleGridPoint(gridMetrics, columnIndex, rowIndex);
|
|
172
188
|
context.fillStyle = glyphDescriptor.color;
|
|
173
189
|
context.fillText(glyphDescriptor.character, point.x, point.y);
|
|
174
190
|
}
|
|
@@ -176,8 +192,114 @@ export const asciiOctopusAvatarVisual: AvatarVisualDefinition = {
|
|
|
176
192
|
|
|
177
193
|
context.restore();
|
|
178
194
|
},
|
|
195
|
+
renderTerminalText({ columns, rows, palette, createRandom, timeMs, interaction }) {
|
|
196
|
+
const staticRandom = createRandom('ascii-octopus-static');
|
|
197
|
+
const layout = createAsciiOctopusLayout(
|
|
198
|
+
TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE,
|
|
199
|
+
timeMs,
|
|
200
|
+
createRandom,
|
|
201
|
+
staticRandom,
|
|
202
|
+
interaction,
|
|
203
|
+
);
|
|
204
|
+
|
|
205
|
+
return createAsciiOctopusGlyphGrid({
|
|
206
|
+
sampleGrid: createAsciiTerminalSampleGrid(columns, rows),
|
|
207
|
+
layout,
|
|
208
|
+
palette,
|
|
209
|
+
cellRandom: createRandom('ascii-octopus-cells'),
|
|
210
|
+
timeMs,
|
|
211
|
+
});
|
|
212
|
+
},
|
|
179
213
|
};
|
|
180
214
|
|
|
215
|
+
/**
|
|
216
|
+
* Resolves the geometry point sampled for one cell of the grid.
|
|
217
|
+
*
|
|
218
|
+
* @param sampleGrid Character-cell sampling grid.
|
|
219
|
+
* @param columnIndex Zero-based cell column.
|
|
220
|
+
* @param rowIndex Zero-based cell row.
|
|
221
|
+
* @returns Sampled point in the octopus coordinate space.
|
|
222
|
+
*
|
|
223
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
224
|
+
*/
|
|
225
|
+
function resolveAsciiSampleGridPoint(sampleGrid: AsciiSampleGrid, columnIndex: number, rowIndex: number): Point {
|
|
226
|
+
return {
|
|
227
|
+
x: sampleGrid.offsetX + columnIndex * sampleGrid.cellWidth,
|
|
228
|
+
y: sampleGrid.offsetY + rowIndex * sampleGrid.cellHeight,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Builds the sampling grid used when the octopus is painted straight into terminal character cells.
|
|
234
|
+
*
|
|
235
|
+
* @param columns Available terminal columns.
|
|
236
|
+
* @param rows Available terminal rows.
|
|
237
|
+
* @returns Character-cell sampling grid covering the whole octopus coordinate space.
|
|
238
|
+
*
|
|
239
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
240
|
+
*/
|
|
241
|
+
function createAsciiTerminalSampleGrid(columns: number, rows: number): AsciiSampleGrid {
|
|
242
|
+
const cellWidth = TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE / columns;
|
|
243
|
+
const cellHeight = TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE / rows;
|
|
244
|
+
|
|
245
|
+
return {
|
|
246
|
+
cellWidth,
|
|
247
|
+
cellHeight,
|
|
248
|
+
columnCount: columns,
|
|
249
|
+
rowCount: rows,
|
|
250
|
+
offsetX: cellWidth / 2,
|
|
251
|
+
offsetY: cellHeight / 2,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
/**
|
|
256
|
+
* Samples the morphing octopus field into one deterministic grid of ASCII glyphs.
|
|
257
|
+
*
|
|
258
|
+
* The field is sampled on a low-resolution grid so the shape stays organic while the glyph
|
|
259
|
+
* layout remains deterministic for the same avatar input. Both the canvas visual and the
|
|
260
|
+
* terminal visual share this single sampling pass so they always describe the same octopus.
|
|
261
|
+
*
|
|
262
|
+
* @param options Sampling grid, prepared octopus layout, palette, per-cell noise, and animation time.
|
|
263
|
+
* @returns Resolved glyph of every sampled cell, where `null` means an empty cell.
|
|
264
|
+
*
|
|
265
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
266
|
+
*/
|
|
267
|
+
function createAsciiOctopusGlyphGrid(options: {
|
|
268
|
+
sampleGrid: AsciiSampleGrid;
|
|
269
|
+
layout: AsciiOctopusLayout;
|
|
270
|
+
palette: AvatarPalette;
|
|
271
|
+
cellRandom: () => number;
|
|
272
|
+
timeMs: number;
|
|
273
|
+
}): AsciiOctopusGlyphGrid {
|
|
274
|
+
const { sampleGrid, layout, palette, cellRandom, timeMs } = options;
|
|
275
|
+
const glyphGrid: Array<Array<AsciiGlyphDescriptor | null>> = [];
|
|
276
|
+
|
|
277
|
+
for (let rowIndex = 0; rowIndex < sampleGrid.rowCount; rowIndex++) {
|
|
278
|
+
const glyphRow: Array<AsciiGlyphDescriptor | null> = [];
|
|
279
|
+
|
|
280
|
+
for (let columnIndex = 0; columnIndex < sampleGrid.columnCount; columnIndex++) {
|
|
281
|
+
const point = resolveAsciiSampleGridPoint(sampleGrid, columnIndex, rowIndex);
|
|
282
|
+
const noise = cellRandom();
|
|
283
|
+
|
|
284
|
+
glyphRow.push(
|
|
285
|
+
resolveAsciiGlyph({
|
|
286
|
+
point,
|
|
287
|
+
layout,
|
|
288
|
+
palette,
|
|
289
|
+
cellWidth: sampleGrid.cellWidth,
|
|
290
|
+
cellHeight: sampleGrid.cellHeight,
|
|
291
|
+
noise,
|
|
292
|
+
timeMs,
|
|
293
|
+
}),
|
|
294
|
+
);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
glyphGrid.push(glyphRow);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return glyphGrid;
|
|
301
|
+
}
|
|
302
|
+
|
|
181
303
|
/**
|
|
182
304
|
* Draws the dark terminal-like glow behind the ASCII octopus.
|
|
183
305
|
*
|
|
@@ -280,9 +280,7 @@ export function createStandaloneBookLanguageMarkdown(
|
|
|
280
280
|
${block(dictionary.tutorialSections.checklistBody)}
|
|
281
281
|
|
|
282
282
|
${block(
|
|
283
|
-
isLowLevelCommitmentsIncluded
|
|
284
|
-
? renderLowLevelCommitmentsChapter(lowLevelCommitments, dictionary)
|
|
285
|
-
: '',
|
|
283
|
+
isLowLevelCommitmentsIncluded ? renderLowLevelCommitmentsChapter(lowLevelCommitments, dictionary) : '',
|
|
286
284
|
)}
|
|
287
285
|
|
|
288
286
|
---
|
|
@@ -596,7 +594,9 @@ function renderExampleSection(
|
|
|
596
594
|
**${dictionary.exampleLabels.goal}:** ${exampleText.goal}
|
|
597
595
|
|
|
598
596
|
**${dictionary.exampleLabels.commitmentsUsed}:** ${renderCommitmentSectionLinks(
|
|
599
|
-
parseAgentSourceWithCommitments(example.source as string_book).commitments.map(
|
|
597
|
+
parseAgentSourceWithCommitments(example.source as string_book).commitments.map(
|
|
598
|
+
(commitment) => commitment.type,
|
|
599
|
+
),
|
|
600
600
|
commitmentSectionAnchorByType,
|
|
601
601
|
)}
|
|
602
602
|
|
|
@@ -53,10 +53,7 @@ export function renderCommitmentCatalogSection(options: RenderCommitmentCatalogS
|
|
|
53
53
|
${aliasesMarkdown}
|
|
54
54
|
|
|
55
55
|
${block(
|
|
56
|
-
renderGroupedCommitmentDocumentationMarkdown(
|
|
57
|
-
groupedCommitment,
|
|
58
|
-
COMMITMENT_CATALOG_HEADING_LEVEL_SHIFT,
|
|
59
|
-
),
|
|
56
|
+
renderGroupedCommitmentDocumentationMarkdown(groupedCommitment, COMMITMENT_CATALOG_HEADING_LEVEL_SHIFT),
|
|
60
57
|
)}
|
|
61
58
|
`,
|
|
62
59
|
);
|
package/src/book-2.0/book-language-documentation/renderGroupedCommitmentDocumentationMarkdown.ts
CHANGED
|
@@ -196,10 +196,7 @@ export function renderGroupedCommitmentDocumentationMarkdown(
|
|
|
196
196
|
*
|
|
197
197
|
* @private internal utility of `createStandaloneBookLanguageMarkdown`
|
|
198
198
|
*/
|
|
199
|
-
function renderFocusedCommitmentExamples(
|
|
200
|
-
documentation: string,
|
|
201
|
-
group: GroupedCommitmentDocumentationSource,
|
|
202
|
-
): string {
|
|
199
|
+
function renderFocusedCommitmentExamples(documentation: string, group: GroupedCommitmentDocumentationSource): string {
|
|
203
200
|
return documentation.replace(BOOK_CODE_BLOCK_PATTERN, (codeBlock, _fence, source: string) => {
|
|
204
201
|
const focusedSource = createFocusedCommitmentExampleSource(source, group);
|
|
205
202
|
return focusedSource ? getSafeCodeBlock(focusedSource, 'book') : codeBlock;
|
|
@@ -223,12 +220,7 @@ function createFocusedCommitmentExampleSource(
|
|
|
223
220
|
const commitmentTypes = new Set([group.primary.type, ...group.aliases]);
|
|
224
221
|
const isOpenClosedCommitmentFamily =
|
|
225
222
|
commitmentTypes.has(OPEN_COMMITMENT_TYPE) && commitmentTypes.has(CLOSED_COMMITMENT_TYPE);
|
|
226
|
-
const allowedCommitmentTypes = new Set([
|
|
227
|
-
group.primary.type,
|
|
228
|
-
...group.aliases,
|
|
229
|
-
'GOAL',
|
|
230
|
-
CLOSED_COMMITMENT_TYPE,
|
|
231
|
-
]);
|
|
223
|
+
const allowedCommitmentTypes = new Set([group.primary.type, ...group.aliases, 'GOAL', CLOSED_COMMITMENT_TYPE]);
|
|
232
224
|
const canonicalTypeByCommitmentType = createCanonicalCommitmentTypeByCommitmentType(
|
|
233
225
|
group,
|
|
234
226
|
isOpenClosedCommitmentFamily,
|
|
@@ -384,9 +376,7 @@ function finalizeFocusedCommitmentExampleSource(
|
|
|
384
376
|
normalizedFocusedCommitments.push(CLOSED_COMMITMENT_TYPE);
|
|
385
377
|
}
|
|
386
378
|
|
|
387
|
-
return [agentName, ...normalizedFocusedCommitments]
|
|
388
|
-
.filter((line): line is string => Boolean(line))
|
|
389
|
-
.join('\n\n');
|
|
379
|
+
return [agentName, ...normalizedFocusedCommitments].filter((line): line is string => Boolean(line)).join('\n\n');
|
|
390
380
|
}
|
|
391
381
|
|
|
392
382
|
/**
|
|
@@ -427,10 +417,7 @@ function createCanonicalCommitmentTypeByCommitmentType(
|
|
|
427
417
|
canonicalTypeByCommitmentType.set(group.primary.type, group.primary.type);
|
|
428
418
|
|
|
429
419
|
for (const alias of group.aliases) {
|
|
430
|
-
canonicalTypeByCommitmentType.set(
|
|
431
|
-
alias,
|
|
432
|
-
isOpenClosedCommitmentFamily ? alias : group.primary.type,
|
|
433
|
-
);
|
|
420
|
+
canonicalTypeByCommitmentType.set(alias, isOpenClosedCommitmentFamily ? alias : group.primary.type);
|
|
434
421
|
}
|
|
435
422
|
|
|
436
423
|
return canonicalTypeByCommitmentType;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { basename, join } from 'path';
|
|
2
|
+
import { AGENT_FINISHED_MESSAGES_DIRECTORY_PATH, AGENT_MESSAGES_DIRECTORY_PATH } from './agentFolderPaths';
|
|
3
|
+
|
|
4
|
+
// Note: [💞] This file defines the shared TEAM workspace convention rather than one standalone entity.
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Relative directory for an active TEAM conversation workspace.
|
|
8
|
+
*
|
|
9
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
10
|
+
*/
|
|
11
|
+
export const AGENT_TEAM_CONVERSATIONS_DIRECTORY_PATH = join(AGENT_MESSAGES_DIRECTORY_PATH, 'team');
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Relative directory where completed TEAM conversation transcripts are retained.
|
|
15
|
+
*
|
|
16
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
17
|
+
*/
|
|
18
|
+
export const AGENT_FINISHED_TEAM_CONVERSATIONS_DIRECTORY_PATH = join(AGENT_FINISHED_MESSAGES_DIRECTORY_PATH, 'team');
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Name of the JSON manifest that describes one TEAM conversation workspace.
|
|
22
|
+
*
|
|
23
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
24
|
+
*/
|
|
25
|
+
export const AGENT_TEAM_CONVERSATION_MANIFEST_FILE_NAME = 'team.json';
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Name of the read-only teammate-source directory inside one TEAM workspace.
|
|
29
|
+
*
|
|
30
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
31
|
+
*/
|
|
32
|
+
export const AGENT_TEAMMATE_SOURCES_DIRECTORY_NAME = 'teammates';
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* One primary agent represented in a TEAM workspace manifest.
|
|
36
|
+
*
|
|
37
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
38
|
+
*/
|
|
39
|
+
export type AgentTeamConversationPrimaryAgent = {
|
|
40
|
+
readonly permanentId: string;
|
|
41
|
+
readonly agentName: string;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* One local teammate made available to the coding harness for a single user turn.
|
|
46
|
+
*
|
|
47
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
48
|
+
*/
|
|
49
|
+
export type AgentTeamConversationTeammate = {
|
|
50
|
+
readonly permanentId: string;
|
|
51
|
+
readonly agentName: string;
|
|
52
|
+
readonly url: string;
|
|
53
|
+
readonly instructions: string;
|
|
54
|
+
readonly sourceFileName: string;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Persisted roster snapshot for the optional TEAM workspace of one queued message.
|
|
59
|
+
*
|
|
60
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
61
|
+
*/
|
|
62
|
+
export type AgentTeamConversationWorkspaceManifest = {
|
|
63
|
+
readonly version: 1;
|
|
64
|
+
readonly primaryAgent: AgentTeamConversationPrimaryAgent;
|
|
65
|
+
readonly teammates: ReadonlyArray<AgentTeamConversationTeammate>;
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Creates the stable directory name that belongs to one queued `.book` message.
|
|
70
|
+
*
|
|
71
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
72
|
+
*/
|
|
73
|
+
export function createAgentTeamConversationWorkspaceDirectoryName(messageFileName: string): string {
|
|
74
|
+
const rawBaseName = basename(messageFileName).replace(/\.book$/iu, '');
|
|
75
|
+
const normalizedBaseName = rawBaseName.replace(/[^A-Za-z0-9._-]+/gu, '-').replace(/^[._-]+|[._-]+$/gu, '');
|
|
76
|
+
|
|
77
|
+
return normalizedBaseName || 'message';
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Creates the relative active workspace path for one queued message.
|
|
82
|
+
*
|
|
83
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
84
|
+
*/
|
|
85
|
+
export function createAgentTeamConversationWorkspacePath(messageFileName: string): string {
|
|
86
|
+
return join(
|
|
87
|
+
AGENT_TEAM_CONVERSATIONS_DIRECTORY_PATH,
|
|
88
|
+
createAgentTeamConversationWorkspaceDirectoryName(messageFileName),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Creates the relative completed-workspace path for one queued message.
|
|
94
|
+
*
|
|
95
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
96
|
+
*/
|
|
97
|
+
export function createFinishedAgentTeamConversationWorkspacePath(messageFileName: string): string {
|
|
98
|
+
return join(
|
|
99
|
+
AGENT_FINISHED_TEAM_CONVERSATIONS_DIRECTORY_PATH,
|
|
100
|
+
createAgentTeamConversationWorkspaceDirectoryName(messageFileName),
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Creates the source-snapshot file name for one teammate.
|
|
106
|
+
*
|
|
107
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
108
|
+
*/
|
|
109
|
+
export function createAgentTeamTeammateSourceFileName(teammatePermanentId: string): string {
|
|
110
|
+
const normalizedPermanentId = teammatePermanentId
|
|
111
|
+
.trim()
|
|
112
|
+
.replace(/[^A-Za-z0-9._-]+/gu, '-')
|
|
113
|
+
.replace(/^[._-]+|[._-]+$/gu, '');
|
|
114
|
+
|
|
115
|
+
return `${normalizedPermanentId || 'teammate'}.book`;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Checks whether unknown JSON has the minimum shape required for a TEAM workspace manifest.
|
|
120
|
+
*
|
|
121
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
122
|
+
*/
|
|
123
|
+
export function isAgentTeamConversationWorkspaceManifest(
|
|
124
|
+
value: unknown,
|
|
125
|
+
): value is AgentTeamConversationWorkspaceManifest {
|
|
126
|
+
if (!value || typeof value !== 'object') {
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
const manifest = value as Partial<AgentTeamConversationWorkspaceManifest>;
|
|
131
|
+
if (
|
|
132
|
+
manifest.version !== 1 ||
|
|
133
|
+
!isPrimaryAgent(manifest.primaryAgent) ||
|
|
134
|
+
!Array.isArray(manifest.teammates) ||
|
|
135
|
+
!manifest.teammates.every(isTeammate)
|
|
136
|
+
) {
|
|
137
|
+
return false;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Checks the primary-agent part of an untrusted manifest.
|
|
145
|
+
*
|
|
146
|
+
* @private internal utility of `isAgentTeamConversationWorkspaceManifest`
|
|
147
|
+
*/
|
|
148
|
+
function isPrimaryAgent(value: unknown): value is AgentTeamConversationPrimaryAgent {
|
|
149
|
+
return Boolean(
|
|
150
|
+
value &&
|
|
151
|
+
typeof value === 'object' &&
|
|
152
|
+
typeof (value as AgentTeamConversationPrimaryAgent).permanentId === 'string' &&
|
|
153
|
+
typeof (value as AgentTeamConversationPrimaryAgent).agentName === 'string',
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Checks one teammate part of an untrusted manifest.
|
|
159
|
+
*
|
|
160
|
+
* @private internal utility of `isAgentTeamConversationWorkspaceManifest`
|
|
161
|
+
*/
|
|
162
|
+
function isTeammate(value: unknown): value is AgentTeamConversationTeammate {
|
|
163
|
+
return Boolean(
|
|
164
|
+
value &&
|
|
165
|
+
typeof value === 'object' &&
|
|
166
|
+
typeof (value as AgentTeamConversationTeammate).permanentId === 'string' &&
|
|
167
|
+
typeof (value as AgentTeamConversationTeammate).agentName === 'string' &&
|
|
168
|
+
typeof (value as AgentTeamConversationTeammate).url === 'string' &&
|
|
169
|
+
typeof (value as AgentTeamConversationTeammate).instructions === 'string' &&
|
|
170
|
+
typeof (value as AgentTeamConversationTeammate).sourceFileName === 'string',
|
|
171
|
+
);
|
|
172
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { spaceTrim } from 'spacetrim';
|
|
1
2
|
import { useEffect } from 'react';
|
|
2
3
|
import { PROMPTBOOK_SYNTAX_COLORS } from '../../config';
|
|
3
4
|
import type { BookEditorTheme } from './BookEditorTheme';
|
|
@@ -48,66 +49,66 @@ export function useBookEditorMonacoStyles({
|
|
|
48
49
|
document.head.appendChild(style);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
style.innerHTML = `
|
|
52
|
+
style.innerHTML = spaceTrim(`
|
|
52
53
|
|
|
53
|
-
|
|
54
|
-
|
|
54
|
+
@import url('https://fonts.googleapis.com/css2?family=Bitcount+Grid+Single:wght@100..900&family=Playfair+Display:ital,wght@0,400..900;1,400..900&display=swap');
|
|
55
|
+
/* <- [🚚] */
|
|
55
56
|
|
|
56
|
-
|
|
57
|
-
|
|
57
|
+
.${instanceClass} .monaco-editor .view-lines {
|
|
58
|
+
background-image: linear-gradient(to bottom, transparent ${scaledLineHeight - 1}px, ${lineColor} ${
|
|
58
59
|
scaledLineHeight - 1
|
|
59
60
|
}px);
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
background-size: calc(100% + ${scaledContentPaddingLeft}px) ${scaledLineHeight}px;
|
|
62
|
+
background-position-x: -${scaledContentPaddingLeft}px;
|
|
63
|
+
background-position-y: ${scaledLineHeight * BACKGROUND_POSITION_Y_MULTIPLIER}px;
|
|
64
|
+
}
|
|
65
|
+
.${instanceClass} .monaco-editor .overflow-guard::before {
|
|
66
|
+
content: '';
|
|
67
|
+
position: absolute;
|
|
68
|
+
left: ${scaledVerticalLineLeft}px;
|
|
69
|
+
top: 0;
|
|
70
|
+
bottom: 0;
|
|
71
|
+
width: 1px;
|
|
72
|
+
background-color: ${lineColor};
|
|
73
|
+
z-index: 10;
|
|
74
|
+
}
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
76
|
+
.${instanceClass} .monaco-editor .separator-line {
|
|
77
|
+
background: linear-gradient(
|
|
78
|
+
to bottom,
|
|
79
|
+
transparent ${scaledLineHeight * 0.9 - 2}px,
|
|
80
|
+
${separatorColor} ${scaledLineHeight * 0.9 - 2}px,
|
|
81
|
+
${separatorColor} ${scaledLineHeight * 0.9 + 1}px,
|
|
82
|
+
transparent ${scaledLineHeight * 0.9 + 1}px
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.${instanceClass} .monaco-editor .transparent-text {
|
|
87
|
+
color: transparent !important;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.${instanceClass} .monaco-editor .code-block-box {
|
|
91
|
+
background-color: ${codeBlockBackground};
|
|
92
|
+
border-left: 1px solid ${codeBlockBorderColor};
|
|
93
|
+
border-right: 1px solid ${codeBlockBorderColor};
|
|
94
|
+
padding-left: ${Math.round(8 * zoomLevel)}px;
|
|
95
|
+
padding-right: ${Math.round(8 * zoomLevel)}px;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.${instanceClass} .monaco-editor .code-block-top {
|
|
99
|
+
border-top: 1px solid ${codeBlockBorderColor};
|
|
100
|
+
border-top-left-radius: ${Math.round(10 * zoomLevel)}px;
|
|
101
|
+
border-top-right-radius: ${Math.round(10 * zoomLevel)}px;
|
|
102
|
+
overflow: hidden;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.${instanceClass} .monaco-editor .code-block-bottom {
|
|
106
|
+
border-bottom: 1px solid ${codeBlockBorderColor};
|
|
107
|
+
border-bottom-left-radius: ${Math.round(10 * zoomLevel)}px;
|
|
108
|
+
border-bottom-right-radius: ${Math.round(10 * zoomLevel)}px;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
}
|
|
111
|
+
`);
|
|
111
112
|
|
|
112
113
|
return () => {
|
|
113
114
|
if (process.env.NODE_ENV === 'production') {
|
|
@@ -426,17 +426,10 @@
|
|
|
426
426
|
}
|
|
427
427
|
|
|
428
428
|
.chatMainFlow .chatChildren {
|
|
429
|
-
grid-area:
|
|
429
|
+
grid-area: 🟦;
|
|
430
430
|
width: 100%;
|
|
431
|
-
height: 100%;
|
|
432
431
|
min-width: 0;
|
|
433
|
-
min-height: 0;
|
|
434
432
|
z-index: 300;
|
|
435
|
-
pointer-events: none;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
.chatMainFlow .chatChildren > * {
|
|
439
|
-
pointer-events: auto;
|
|
440
433
|
}
|
|
441
434
|
|
|
442
435
|
/* Chat messages area */
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
import { spaceTrim } from 'spacetrim';
|
|
3
|
+
|
|
2
4
|
|
|
3
5
|
import type { Feature, GeoJsonObject, GeoJsonProperties, Geometry } from 'geojson';
|
|
4
6
|
import type { LatLng, Layer, Map as LeafletMap, Path, PathOptions } from 'leaflet';
|
|
@@ -253,10 +255,12 @@ function createPointOfInterestMarker(leaflet: LeafletNamespace, feature: ChatGeo
|
|
|
253
255
|
|
|
254
256
|
const icon = leaflet.divIcon({
|
|
255
257
|
className: styles.poiMarkerIcon,
|
|
256
|
-
html:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
258
|
+
html: spaceTrim(
|
|
259
|
+
(block) => `
|
|
260
|
+
<span class="${styles.poiMarkerPulse}" aria-hidden="true"></span>
|
|
261
|
+
${block(initialHtml)}
|
|
262
|
+
`,
|
|
263
|
+
).trim(),
|
|
260
264
|
iconSize: [POI_MARKER_CONFIG.size, POI_MARKER_CONFIG.size],
|
|
261
265
|
iconAnchor: POI_MARKER_CONFIG.anchor,
|
|
262
266
|
});
|
|
@@ -681,8 +681,9 @@ export type ChatProps = {
|
|
|
681
681
|
readonly tasksProgress?: Array<{ id: string; name: string; progress?: number }>; // Simplified task progress type
|
|
682
682
|
|
|
683
683
|
/**
|
|
684
|
-
*
|
|
685
|
-
*
|
|
684
|
+
* Optional content displayed in the chat header above the message list.
|
|
685
|
+
*
|
|
686
|
+
* If not provided, the header row is not rendered.
|
|
686
687
|
*/
|
|
687
688
|
readonly children?: ReactNode;
|
|
688
689
|
|