@promptbook/browser 0.114.0-5 → 0.114.0-50
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 +50 -31
- package/esm/index.es.js +573 -115
- package/esm/index.es.js.map +1 -1
- package/esm/src/_packages/components.index.d.ts +4 -0
- package/esm/src/_packages/types.index.d.ts +4 -0
- package/esm/src/avatars/renderAvatarVisualTerminalText.d.ts +80 -0
- package/esm/src/avatars/types/AvatarVisualDefinition.d.ts +54 -0
- package/esm/src/book-2.0/agent-source/AgentReferenceResolutionIssue.d.ts +45 -0
- package/esm/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -0
- package/esm/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
- package/esm/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
- package/esm/src/book-2.0/agent-source/deduplicateSystemMessage.d.ts +14 -0
- package/esm/src/book-2.0/agent-source/explicitFromCommitment.d.ts +62 -0
- package/esm/src/book-2.0/agent-source/extractAgentReferenceTokens.d.ts +32 -0
- package/esm/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
- package/esm/src/book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts +1 -0
- package/esm/src/book-2.0/agent-source/resolveInheritedAgentSource.d.ts +73 -0
- package/esm/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +1 -1
- package/esm/src/book-3.0/AgentMessageRunReport.d.ts +46 -0
- package/esm/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +127 -0
- package/esm/src/book-3.0/AgentPlannedMessagesSidecar.test.d.ts +1 -0
- package/esm/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/esm/src/book-3.0/cliAgentEnv.d.ts +3 -3
- package/esm/src/book-3.0/createAgentMessageSidecarBaseName.d.ts +13 -0
- package/esm/src/book-3.0/describeAgentPlannedMessageSchedule.d.ts +31 -0
- package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +1 -9
- package/esm/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.d.ts +28 -0
- package/esm/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.test.d.ts +1 -0
- package/esm/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
- package/esm/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts +1 -0
- package/esm/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/esm/src/book-components/Chat/Chat/renderAgentProjectDiff.d.ts +13 -0
- package/esm/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.d.ts +16 -0
- package/esm/src/book-components/Chat/MockedChat/MockedChat.test.d.ts +2 -0
- package/esm/src/book-components/Chat/utils/agentProjectToolCall.d.ts +85 -0
- package/esm/src/book-components/Chat/utils/agentProjectToolCall.test.d.ts +1 -0
- package/esm/src/book-components/Chat/utils/externalSourceToolCall.d.ts +38 -0
- package/esm/src/book-components/Chat/utils/renderMarkdown.d.ts +68 -3
- package/esm/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +30 -0
- package/esm/src/cli/$initializePromptbookCliProgram.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/GitChangesMode.d.ts +28 -0
- package/esm/src/cli/cli-commands/coder/add.d.ts +22 -1
- package/esm/src/cli/cli-commands/coder/agentCliOptions.d.ts +27 -0
- package/esm/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +8 -21
- package/esm/src/cli/cli-commands/coder/coderAgentRole.d.ts +21 -0
- package/esm/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +34 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderGitattributesFile.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +14 -1
- package/esm/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +5 -2
- package/esm/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +2 -0
- package/esm/src/cli/cli-commands/coder/ensureDirectory.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/findLegacyCoderCheckCallers.d.ts +5 -0
- package/esm/src/cli/cli-commands/coder/fix.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/fix.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/fixWorkflow.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/generate-boilerplates.d.ts +2 -2
- package/esm/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
- package/esm/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/init.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +18 -6
- package/esm/src/cli/cli-commands/coder/list.d.ts +10 -0
- package/esm/src/cli/cli-commands/coder/list.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +21 -1
- package/esm/src/cli/cli-commands/coder/plan.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningTerminal.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningTerminal.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/createPlanningWorkspace.d.ts +11 -0
- package/esm/src/cli/cli-commands/coder/planning/discussPlanningTurn.d.ts +15 -0
- package/esm/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.d.ts +5 -0
- package/esm/src/cli/cli-commands/coder/planning/planningGitSync.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/planningPackagedCli.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/planningProtocol.d.ts +152 -0
- package/esm/src/cli/cli-commands/coder/planning/planningTeam.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/preparePlanningChanges.d.ts +16 -0
- package/esm/src/cli/cli-commands/coder/planning/readPlanningContext.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/planning/resolvePlanningPath.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningHarness.d.ts +30 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningHarness.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningSession.d.ts +24 -0
- package/esm/src/cli/cli-commands/coder/planning/runPlanningSession.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/planning/savePlanningChanges.d.ts +7 -0
- package/esm/src/cli/cli-commands/coder/prepareCoderPackageJsonScripts.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder/printCoderRunFailure.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/printInitializationSummary.d.ts +2 -1
- package/esm/src/cli/cli-commands/coder/promptsReadmeTemplate.d.ts +13 -0
- package/esm/src/cli/cli-commands/coder/promptsReadmeTemplate.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/readCoderAgentBook.d.ts +8 -0
- package/esm/src/cli/cli-commands/coder/server.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
- package/esm/src/cli/cli-commands/coder/workspacePreflight.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/coder.d.ts +3 -0
- package/esm/src/cli/cli-commands/common/$askForConfirmation.d.ts +11 -0
- package/esm/src/cli/cli-commands/common/$askForConfirmation.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +48 -0
- package/esm/src/cli/cli-commands/common/coderCheckCliOptions.d.ts +21 -0
- package/esm/src/cli/cli-commands/common/coderCheckCliOptions.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
- package/esm/src/cli/cli-commands/common/createLocalAgentReferenceResolver.d.ts +8 -0
- package/esm/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.d.ts +11 -0
- package/esm/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.d.ts +33 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.d.ts +28 -0
- package/esm/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/ensureAdamAgentBook.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/ensureProjectTextFile.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +3 -2
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
- package/esm/src/cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +6 -3
- package/esm/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.d.ts +14 -0
- package/esm/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.d.ts +10 -0
- package/esm/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.d.ts +43 -0
- package/esm/src/cli/cli-commands/common/harness/HARNESS_DEFAULT_MODELS.d.ts +25 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +62 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.d.ts +36 -0
- package/esm/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +8 -2
- package/esm/src/cli/cli-commands/common/harness/HarnessUpdatePlan.d.ts +23 -0
- package/esm/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +4 -1
- package/esm/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.d.ts +8 -0
- package/esm/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts +31 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts +11 -0
- 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/$resolveLatestNpmPackageVersion.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/$resolveNpmGlobalPrefixPath.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/extractNpmPackageVersionFromOutput.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.d.ts +12 -0
- package/esm/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/projectCliOptions.d.ts +30 -0
- package/esm/src/cli/cli-commands/common/projectCliOptions.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/projectInitialization.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/promptPriorityCliOptions.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +17 -4
- package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +15 -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/$updatePromptbookCliInstallation.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +66 -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/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/esm/src/cli/cli-commands/common/questionsCliOptions.d.ts +45 -0
- package/esm/src/cli/cli-commands/common/questionsCliOptions.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/resolveBundledAgentBookPath.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +26 -0
- package/esm/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
- package/esm/src/cli/cli-commands/common/workspaceRepository.d.ts +48 -0
- package/esm/src/cli/cli-commands/common/workspaceRepository.test.d.ts +1 -0
- package/esm/src/cli/cli-commands/common/workspaceRepositoryCliOptions.d.ts +11 -0
- package/esm/src/cli/common/$deprecateCliCommand.d.ts +3 -0
- package/esm/src/cli/common/$hideCliCommandFromHelp.d.ts +11 -0
- package/esm/src/cli/common/$hideCliCommandFromHelp.test.d.ts +1 -0
- package/esm/src/cli/common/$requireCliSubcommand.d.ts +18 -0
- package/esm/src/cli/common/$requireCliSubcommand.test.d.ts +1 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
- package/esm/src/commitments/TEAM/TEAM.test.d.ts +1 -0
- package/esm/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +14 -7
- package/esm/src/commitments/index.d.ts +1 -1
- package/esm/src/conversion/archive/loadJsZipModule.d.ts +10 -0
- package/esm/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
- package/esm/src/executables/platforms/locateAppOnWindows.test.d.ts +1 -0
- package/esm/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +5 -2
- package/esm/src/utils/agent-message-runtime/AgentMessageProjectChange.d.ts +76 -0
- package/esm/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.d.ts +45 -0
- package/esm/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.d.ts +62 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.d.ts +18 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.test.d.ts +1 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.d.ts +19 -0
- package/esm/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.test.d.ts +1 -0
- 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/files/findFilesByGlob.d.ts +28 -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/utils/misc/emojis.d.ts +3 -2
- package/esm/src/utils/random/$generateBookBoilerplate.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +2 -7
- package/umd/index.umd.js +572 -114
- package/umd/index.umd.js.map +1 -1
- package/umd/src/_packages/components.index.d.ts +4 -0
- package/umd/src/_packages/types.index.d.ts +4 -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-2.0/agent-source/AgentReferenceResolutionIssue.d.ts +45 -0
- package/umd/src/book-2.0/agent-source/AgentSourceParseResult.d.ts +5 -0
- package/umd/src/book-2.0/agent-source/CreateAgentModelRequirementsOptions.d.ts +2 -0
- package/umd/src/book-2.0/agent-source/ParsedUnknownCommitment.d.ts +26 -0
- package/umd/src/book-2.0/agent-source/createAgentModelRequirements.deduplication.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/deduplicateSystemMessage.d.ts +14 -0
- package/umd/src/book-2.0/agent-source/deduplicateSystemMessage.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/explicitFromCommitment.d.ts +62 -0
- package/umd/src/book-2.0/agent-source/extractAgentReferenceTokens.d.ts +32 -0
- package/umd/src/book-2.0/agent-source/getBookCommitmentLineType.d.ts +19 -0
- package/umd/src/book-2.0/agent-source/parseAgentSourceWithCommitments.unknown.test.d.ts +1 -0
- package/umd/src/book-2.0/agent-source/resolveInheritedAgentSource.d.ts +73 -0
- package/umd/src/book-2.0/book-language-documentation/getSafeCodeBlock.d.ts +1 -1
- package/umd/src/book-3.0/AgentMessageRunReport.d.ts +46 -0
- package/umd/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +127 -0
- package/umd/src/book-3.0/AgentPlannedMessagesSidecar.test.d.ts +1 -0
- package/umd/src/book-3.0/AgentTeamConversationWorkspace.d.ts +85 -0
- package/umd/src/book-3.0/cliAgentEnv.d.ts +3 -3
- package/umd/src/book-3.0/createAgentMessageSidecarBaseName.d.ts +13 -0
- package/umd/src/book-3.0/describeAgentPlannedMessageSchedule.d.ts +31 -0
- package/umd/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts +1 -9
- package/umd/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.d.ts +28 -0
- package/umd/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.test.d.ts +1 -0
- package/umd/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.d.ts +28 -0
- package/umd/src/book-components/BookEditor/createUnknownCommitmentDiagnostics.test.d.ts +1 -0
- package/umd/src/book-components/Chat/Chat/ChatProps.d.ts +3 -2
- package/umd/src/book-components/Chat/Chat/renderAgentProjectDiff.d.ts +13 -0
- package/umd/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.d.ts +16 -0
- package/umd/src/book-components/Chat/MockedChat/MockedChat.test.d.ts +2 -0
- package/umd/src/book-components/Chat/utils/agentProjectToolCall.d.ts +85 -0
- package/umd/src/book-components/Chat/utils/agentProjectToolCall.test.d.ts +1 -0
- package/umd/src/book-components/Chat/utils/externalSourceToolCall.d.ts +38 -0
- package/umd/src/book-components/Chat/utils/renderMarkdown.d.ts +68 -3
- package/umd/src/book-components/Chat/utils/timeoutToolCallPresentation.d.ts +30 -0
- package/umd/src/cli/$initializePromptbookCliProgram.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/$ensureCoderHarnessGitignoreRules.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/GitChangesMode.d.ts +28 -0
- package/umd/src/cli/cli-commands/coder/add.d.ts +22 -1
- package/umd/src/cli/cli-commands/coder/agentCliOptions.d.ts +27 -0
- package/umd/src/cli/cli-commands/coder/augmentCoderAgentTeam.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/boilerplateCount.d.ts +1 -1
- package/umd/src/cli/cli-commands/coder/boilerplateTemplates.d.ts +8 -21
- package/umd/src/cli/cli-commands/coder/coderAgentRole.d.ts +21 -0
- package/umd/src/cli/cli-commands/coder/coderReferencedArtifacts.d.ts +34 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderDefaultAgentFiles.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderGitattributesFile.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderGitignoreFile.d.ts +14 -1
- package/umd/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.d.ts +5 -2
- package/umd/src/cli/cli-commands/coder/ensureCoderPackageJsonFile.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderRoleAgentFile.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder/ensureCoderVscodeSettingsFile.d.ts +2 -0
- package/umd/src/cli/cli-commands/coder/ensureDirectory.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/findLegacyCoderCheckCallers.d.ts +5 -0
- package/umd/src/cli/cli-commands/coder/fix.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/fix.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/fixWorkflow.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/generate-boilerplates.d.ts +2 -2
- package/umd/src/cli/cli-commands/coder/getCoderInitializationCommitPaths.d.ts +9 -0
- package/umd/src/cli/cli-commands/coder/getDefaultCoderPackageJsonScripts.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/init.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/initializeCoderProjectConfiguration.d.ts +18 -6
- package/umd/src/cli/cli-commands/coder/list.d.ts +10 -0
- package/umd/src/cli/cli-commands/coder/list.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/mergeStringRecordJsonFile.d.ts +21 -1
- package/umd/src/cli/cli-commands/coder/plan.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningCommitSafe.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningPrdCommitScope.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/assertPlanningRuntimePath.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningTerminal.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningTerminal.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/createPlanningWorkspace.d.ts +11 -0
- package/umd/src/cli/cli-commands/coder/planning/discussPlanningTurn.d.ts +15 -0
- package/umd/src/cli/cli-commands/coder/planning/fixtures/snapshotPlanningProject.d.ts +5 -0
- package/umd/src/cli/cli-commands/coder/planning/planningGitSync.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/planningPackagedCli.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/planningProtocol.d.ts +152 -0
- package/umd/src/cli/cli-commands/coder/planning/planningTeam.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/preparePlanningChanges.d.ts +16 -0
- package/umd/src/cli/cli-commands/coder/planning/readPlanningContext.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/planning/resolvePlanningPath.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningHarness.d.ts +30 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningHarness.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningSession.d.ts +24 -0
- package/umd/src/cli/cli-commands/coder/planning/runPlanningSession.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/planning/savePlanningChanges.d.ts +7 -0
- package/umd/src/cli/cli-commands/coder/prepareCoderPackageJsonScripts.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder/printCoderRunFailure.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/printInitializationSummary.d.ts +2 -1
- package/umd/src/cli/cli-commands/coder/promptsReadmeTemplate.d.ts +13 -0
- package/umd/src/cli/cli-commands/coder/promptsReadmeTemplate.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/readCoderAgentBook.d.ts +8 -0
- package/umd/src/cli/cli-commands/coder/server.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
- package/umd/src/cli/cli-commands/coder/workspacePreflight.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/coder.d.ts +3 -0
- package/umd/src/cli/cli-commands/common/$askForConfirmation.d.ts +11 -0
- package/umd/src/cli/cli-commands/common/$askForConfirmation.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/LocalAgentBookCollection.d.ts +48 -0
- package/umd/src/cli/cli-commands/common/coderCheckCliOptions.d.ts +21 -0
- package/umd/src/cli/cli-commands/common/coderCheckCliOptions.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/coderGitSyncCliOptions.d.ts +1 -1
- package/umd/src/cli/cli-commands/common/createLocalAgentReferenceResolver.d.ts +8 -0
- package/umd/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/disk-space/$assertSufficientFreeDiskSpace.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.d.ts +11 -0
- package/umd/src/cli/cli-commands/common/disk-space/$readFreeDiskSpaceStatus.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/FreeDiskSpaceStatus.d.ts +33 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatFreeDiskSpaceBytes.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/disk-space/formatLowFreeDiskSpaceWarning.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/disk-space/freeDiskSpaceConstants.d.ts +28 -0
- package/umd/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/disk-space/resolveFreeDiskSpaceLevel.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/ensureAdamAgentBook.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/ensureProjectTextFile.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.d.ts +3 -2
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.d.ts +3 -3
- package/umd/src/cli/cli-commands/common/harness/$checkHarnessInstallation.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/$ensureHarnessInstallations.d.ts +6 -3
- package/umd/src/cli/cli-commands/common/harness/$resolveHarnessCommandPath.d.ts +14 -0
- package/umd/src/cli/cli-commands/common/harness/$resolveHarnessInstallationOrigin.d.ts +10 -0
- package/umd/src/cli/cli-commands/common/harness/$runHarnessInstallationCommand.d.ts +43 -0
- package/umd/src/cli/cli-commands/common/harness/HARNESS_DEFAULT_MODELS.d.ts +25 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessDefinition.d.ts +62 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationOrigin.d.ts +36 -0
- package/umd/src/cli/cli-commands/common/harness/HarnessInstallationStatus.d.ts +8 -2
- package/umd/src/cli/cli-commands/common/harness/HarnessUpdatePlan.d.ts +23 -0
- package/umd/src/cli/cli-commands/common/harness/buildHarnessInstallCommand.d.ts +4 -1
- package/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.d.ts +8 -0
- package/umd/src/cli/cli-commands/common/harness/formatHarnessManualUpdateInstruction.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.d.ts +31 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessInstallationMethodFromPaths.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/harness/resolveHarnessUpdatePlan.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/npm/$askForNpmPackageInstallationApproval.d.ts +11 -0
- 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/$resolveNpmGlobalPrefixPath.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.d.ts +12 -0
- package/umd/src/cli/cli-commands/common/npm/buildNpmPackageInstallCommand.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 +12 -0
- package/umd/src/cli/cli-commands/common/npm/isNpmPackageVersionOutdated.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/projectCliOptions.d.ts +30 -0
- package/umd/src/cli/cli-commands/common/projectCliOptions.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/projectInitialization.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/promptPriorityCliOptions.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/promptRunnerCliOptions.d.ts +17 -4
- package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.d.ts +9 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$checkPromptbookCliInstallations.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/$ensurePromptbookCliInstallations.d.ts +15 -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/$updatePromptbookCliInstallation.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/promptbook-cli/PromptbookCliInstallation.d.ts +66 -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/formatPromptbookCliInstallationWarning.d.ts +7 -0
- package/umd/src/cli/cli-commands/common/questionsCliOptions.d.ts +45 -0
- package/umd/src/cli/cli-commands/common/questionsCliOptions.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/resolveBundledAgentBookPath.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/resolveLocalAgentSource.d.ts +26 -0
- package/umd/src/cli/cli-commands/common/validateCoderRunOptions.d.ts +6 -0
- package/umd/src/cli/cli-commands/common/workspaceRepository.d.ts +48 -0
- package/umd/src/cli/cli-commands/common/workspaceRepository.test.d.ts +1 -0
- package/umd/src/cli/cli-commands/common/workspaceRepositoryCliOptions.d.ts +11 -0
- package/umd/src/cli/common/$deprecateCliCommand.d.ts +3 -0
- package/umd/src/cli/common/$hideCliCommandFromHelp.d.ts +11 -0
- package/umd/src/cli/common/$hideCliCommandFromHelp.test.d.ts +1 -0
- package/umd/src/cli/common/$requireCliSubcommand.d.ts +18 -0
- package/umd/src/cli/common/$requireCliSubcommand.test.d.ts +1 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
- package/umd/src/commitments/TEAM/TEAM.test.d.ts +1 -0
- package/umd/src/commitments/WRITING_RULES/WRITING_RULES.d.ts +14 -7
- package/umd/src/commitments/index.d.ts +1 -1
- package/umd/src/conversion/archive/loadJsZipModule.d.ts +10 -0
- package/umd/src/executables/platforms/locateAppOnWindows.d.ts +1 -1
- package/umd/src/executables/platforms/locateAppOnWindows.test.d.ts +1 -0
- package/umd/src/llm-providers/vercel/VercelExecutionToolsOptions.d.ts +5 -2
- package/umd/src/utils/agent-message-runtime/AgentMessageProjectChange.d.ts +76 -0
- package/umd/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.d.ts +45 -0
- package/umd/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.d.ts +62 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.d.ts +3 -3
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.d.ts +18 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.test.d.ts +1 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.d.ts +19 -0
- package/umd/src/utils/agent-message-runtime/resolveAgentMessageTouchedProjectNames.test.d.ts +1 -0
- 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/files/findFilesByGlob.d.ts +28 -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/utils/misc/emojis.d.ts +3 -2
- package/umd/src/utils/random/$generateBookBoilerplate.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/esm/src/cli/cli-commands/coder/agentCodingFile.d.ts +0 -13
- package/esm/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +0 -9
- package/esm/src/cli/cli-commands/common/harness/$installHarness.d.ts +0 -13
- 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/umd/src/cli/cli-commands/coder/agentCodingFile.d.ts +0 -13
- package/umd/src/cli/cli-commands/common/harness/$askForHarnessInstallationApproval.d.ts +0 -9
- package/umd/src/cli/cli-commands/common/harness/$installHarness.d.ts +0 -13
- 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 → book-2.0/agent-source/createAgentModelRequirements.deduplication.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/extractHarnessVersionFromOutput.test.d.ts → esm/src/book-2.0/agent-source/createAgentModelRequirementsWithCommitments.unknown.test.d.ts} +0 -0
- /package/{umd/src/cli/cli-commands/common/harness/isHarnessVersionOutdated.test.d.ts → esm/src/book-2.0/agent-source/deduplicateSystemMessage.test.d.ts} +0 -0
package/esm/index.es.js
CHANGED
|
@@ -26,7 +26,7 @@ const BOOK_LANGUAGE_VERSION = '2.0.0';
|
|
|
26
26
|
* @generated
|
|
27
27
|
* @see https://github.com/webgptorg/promptbook
|
|
28
28
|
*/
|
|
29
|
-
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-
|
|
29
|
+
const PROMPTBOOK_ENGINE_VERSION = '0.114.0-50';
|
|
30
30
|
/**
|
|
31
31
|
* TODO: string_promptbook_version should be constrained to the all versions of Promptbook engine
|
|
32
32
|
* Note: [💞] Ignore a discrepancy between file name and entity name
|
|
@@ -2603,6 +2603,12 @@ class FromCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
2603
2603
|
|
|
2604
2604
|
Inherits agent source from another agent.
|
|
2605
2605
|
|
|
2606
|
+
Every agent inherits from the core agent \`@Adam\` unless it says otherwise, so writing no ${this.type} at all
|
|
2607
|
+
is the same as writing \`${this.type} @Adam\`. Write \`${this.type} @Null\` to inherit from nothing.
|
|
2608
|
+
|
|
2609
|
+
An agent has exactly one parent, so when ${this.type} is written more than once, the last one wins and
|
|
2610
|
+
overrides every earlier one.
|
|
2611
|
+
|
|
2606
2612
|
## Examples
|
|
2607
2613
|
|
|
2608
2614
|
\`\`\`book
|
|
@@ -2611,6 +2617,13 @@ class FromCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
2611
2617
|
FROM https://s6.ptbk.io/benjamin-white
|
|
2612
2618
|
RULE Speak only in English.
|
|
2613
2619
|
\`\`\`
|
|
2620
|
+
|
|
2621
|
+
\`\`\`book
|
|
2622
|
+
My Standalone Agent
|
|
2623
|
+
|
|
2624
|
+
FROM @Null
|
|
2625
|
+
RULE Speak only in English.
|
|
2626
|
+
\`\`\`
|
|
2614
2627
|
`);
|
|
2615
2628
|
}
|
|
2616
2629
|
applyToAgentModelRequirements(requirements, content) {
|
|
@@ -4115,6 +4128,13 @@ function darken(amount) {
|
|
|
4115
4128
|
}
|
|
4116
4129
|
|
|
4117
4130
|
/* eslint-disable no-magic-numbers */
|
|
4131
|
+
// Note: [💞] Ignore a discrepancy between file name and entity name
|
|
4132
|
+
/**
|
|
4133
|
+
* Default square size used by avatar renderers.
|
|
4134
|
+
*
|
|
4135
|
+
* @private utility of the avatar rendering system
|
|
4136
|
+
*/
|
|
4137
|
+
const DEFAULT_AVATAR_SIZE = 192;
|
|
4118
4138
|
/**
|
|
4119
4139
|
* Corner radius ratio used for the common rounded card frame.
|
|
4120
4140
|
*
|
|
@@ -4485,6 +4505,15 @@ const OUTLINE_GLYPHS = ['#', '%', '@'];
|
|
|
4485
4505
|
* @private helper of `asciiOctopusAvatarVisual`
|
|
4486
4506
|
*/
|
|
4487
4507
|
const ATMOSPHERE_GLYPHS = ['.', ':', "'", '`'];
|
|
4508
|
+
/**
|
|
4509
|
+
* Coordinate space the octopus layout is generated in when it is painted into a terminal.
|
|
4510
|
+
*
|
|
4511
|
+
* The terminal renderer has its own character grid, so the geometry only needs one stable
|
|
4512
|
+
* square coordinate space which the grid is then sampled from.
|
|
4513
|
+
*
|
|
4514
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
4515
|
+
*/
|
|
4516
|
+
const TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE = DEFAULT_AVATAR_SIZE;
|
|
4488
4517
|
/**
|
|
4489
4518
|
* AsciiOctopus avatar visual.
|
|
4490
4519
|
*
|
|
@@ -4501,41 +4530,115 @@ const asciiOctopusAvatarVisual = {
|
|
|
4501
4530
|
const staticRandom = createRandom('ascii-octopus-static');
|
|
4502
4531
|
const gridMetrics = createAsciiGridMetrics(size, gridRandom);
|
|
4503
4532
|
const layout = createAsciiOctopusLayout(size, timeMs, createRandom, staticRandom, interaction);
|
|
4533
|
+
const glyphGrid = createAsciiOctopusGlyphGrid({
|
|
4534
|
+
sampleGrid: gridMetrics,
|
|
4535
|
+
layout,
|
|
4536
|
+
palette,
|
|
4537
|
+
cellRandom: createRandom('ascii-octopus-cells'),
|
|
4538
|
+
timeMs,
|
|
4539
|
+
});
|
|
4504
4540
|
drawAvatarFrame(context, size, palette);
|
|
4505
4541
|
drawAsciiBackdrop(context, size, palette, layout, timeMs);
|
|
4506
4542
|
context.save();
|
|
4507
4543
|
context.font = `600 ${gridMetrics.fontSize}px monospace`;
|
|
4508
4544
|
context.textAlign = 'center';
|
|
4509
4545
|
context.textBaseline = 'middle';
|
|
4510
|
-
// The ASCII renderer samples the morphing octopus field on a low-resolution grid so the shape stays organic
|
|
4511
|
-
// while the glyph layout remains deterministic for the same avatar input.
|
|
4512
|
-
const cellRandom = createRandom('ascii-octopus-cells');
|
|
4513
4546
|
for (let rowIndex = 0; rowIndex < gridMetrics.rowCount; rowIndex++) {
|
|
4514
4547
|
for (let columnIndex = 0; columnIndex < gridMetrics.columnCount; columnIndex++) {
|
|
4515
|
-
const
|
|
4516
|
-
x: gridMetrics.offsetX + columnIndex * gridMetrics.cellWidth,
|
|
4517
|
-
y: gridMetrics.offsetY + rowIndex * gridMetrics.cellHeight,
|
|
4518
|
-
};
|
|
4519
|
-
const noise = cellRandom();
|
|
4520
|
-
const glyphDescriptor = resolveAsciiGlyph({
|
|
4521
|
-
point,
|
|
4522
|
-
layout,
|
|
4523
|
-
palette,
|
|
4524
|
-
cellWidth: gridMetrics.cellWidth,
|
|
4525
|
-
cellHeight: gridMetrics.cellHeight,
|
|
4526
|
-
noise,
|
|
4527
|
-
timeMs,
|
|
4528
|
-
});
|
|
4548
|
+
const glyphDescriptor = glyphGrid[rowIndex][columnIndex];
|
|
4529
4549
|
if (!glyphDescriptor) {
|
|
4530
4550
|
continue;
|
|
4531
4551
|
}
|
|
4552
|
+
const point = resolveAsciiSampleGridPoint(gridMetrics, columnIndex, rowIndex);
|
|
4532
4553
|
context.fillStyle = glyphDescriptor.color;
|
|
4533
4554
|
context.fillText(glyphDescriptor.character, point.x, point.y);
|
|
4534
4555
|
}
|
|
4535
4556
|
}
|
|
4536
4557
|
context.restore();
|
|
4537
4558
|
},
|
|
4559
|
+
renderTerminalText({ columns, rows, palette, createRandom, timeMs, interaction }) {
|
|
4560
|
+
const staticRandom = createRandom('ascii-octopus-static');
|
|
4561
|
+
const layout = createAsciiOctopusLayout(TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE, timeMs, createRandom, staticRandom, interaction);
|
|
4562
|
+
return createAsciiOctopusGlyphGrid({
|
|
4563
|
+
sampleGrid: createAsciiTerminalSampleGrid(columns, rows),
|
|
4564
|
+
layout,
|
|
4565
|
+
palette,
|
|
4566
|
+
cellRandom: createRandom('ascii-octopus-cells'),
|
|
4567
|
+
timeMs,
|
|
4568
|
+
});
|
|
4569
|
+
},
|
|
4538
4570
|
};
|
|
4571
|
+
/**
|
|
4572
|
+
* Resolves the geometry point sampled for one cell of the grid.
|
|
4573
|
+
*
|
|
4574
|
+
* @param sampleGrid Character-cell sampling grid.
|
|
4575
|
+
* @param columnIndex Zero-based cell column.
|
|
4576
|
+
* @param rowIndex Zero-based cell row.
|
|
4577
|
+
* @returns Sampled point in the octopus coordinate space.
|
|
4578
|
+
*
|
|
4579
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
4580
|
+
*/
|
|
4581
|
+
function resolveAsciiSampleGridPoint(sampleGrid, columnIndex, rowIndex) {
|
|
4582
|
+
return {
|
|
4583
|
+
x: sampleGrid.offsetX + columnIndex * sampleGrid.cellWidth,
|
|
4584
|
+
y: sampleGrid.offsetY + rowIndex * sampleGrid.cellHeight,
|
|
4585
|
+
};
|
|
4586
|
+
}
|
|
4587
|
+
/**
|
|
4588
|
+
* Builds the sampling grid used when the octopus is painted straight into terminal character cells.
|
|
4589
|
+
*
|
|
4590
|
+
* @param columns Available terminal columns.
|
|
4591
|
+
* @param rows Available terminal rows.
|
|
4592
|
+
* @returns Character-cell sampling grid covering the whole octopus coordinate space.
|
|
4593
|
+
*
|
|
4594
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
4595
|
+
*/
|
|
4596
|
+
function createAsciiTerminalSampleGrid(columns, rows) {
|
|
4597
|
+
const cellWidth = TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE / columns;
|
|
4598
|
+
const cellHeight = TERMINAL_ASCII_OCTOPUS_LAYOUT_SIZE / rows;
|
|
4599
|
+
return {
|
|
4600
|
+
cellWidth,
|
|
4601
|
+
cellHeight,
|
|
4602
|
+
columnCount: columns,
|
|
4603
|
+
rowCount: rows,
|
|
4604
|
+
offsetX: cellWidth / 2,
|
|
4605
|
+
offsetY: cellHeight / 2,
|
|
4606
|
+
};
|
|
4607
|
+
}
|
|
4608
|
+
/**
|
|
4609
|
+
* Samples the morphing octopus field into one deterministic grid of ASCII glyphs.
|
|
4610
|
+
*
|
|
4611
|
+
* The field is sampled on a low-resolution grid so the shape stays organic while the glyph
|
|
4612
|
+
* layout remains deterministic for the same avatar input. Both the canvas visual and the
|
|
4613
|
+
* terminal visual share this single sampling pass so they always describe the same octopus.
|
|
4614
|
+
*
|
|
4615
|
+
* @param options Sampling grid, prepared octopus layout, palette, per-cell noise, and animation time.
|
|
4616
|
+
* @returns Resolved glyph of every sampled cell, where `null` means an empty cell.
|
|
4617
|
+
*
|
|
4618
|
+
* @private helper of `asciiOctopusAvatarVisual`
|
|
4619
|
+
*/
|
|
4620
|
+
function createAsciiOctopusGlyphGrid(options) {
|
|
4621
|
+
const { sampleGrid, layout, palette, cellRandom, timeMs } = options;
|
|
4622
|
+
const glyphGrid = [];
|
|
4623
|
+
for (let rowIndex = 0; rowIndex < sampleGrid.rowCount; rowIndex++) {
|
|
4624
|
+
const glyphRow = [];
|
|
4625
|
+
for (let columnIndex = 0; columnIndex < sampleGrid.columnCount; columnIndex++) {
|
|
4626
|
+
const point = resolveAsciiSampleGridPoint(sampleGrid, columnIndex, rowIndex);
|
|
4627
|
+
const noise = cellRandom();
|
|
4628
|
+
glyphRow.push(resolveAsciiGlyph({
|
|
4629
|
+
point,
|
|
4630
|
+
layout,
|
|
4631
|
+
palette,
|
|
4632
|
+
cellWidth: sampleGrid.cellWidth,
|
|
4633
|
+
cellHeight: sampleGrid.cellHeight,
|
|
4634
|
+
noise,
|
|
4635
|
+
timeMs,
|
|
4636
|
+
}));
|
|
4637
|
+
}
|
|
4638
|
+
glyphGrid.push(glyphRow);
|
|
4639
|
+
}
|
|
4640
|
+
return glyphGrid;
|
|
4641
|
+
}
|
|
4539
4642
|
/**
|
|
4540
4643
|
* Draws the dark terminal-like glow behind the ASCII octopus.
|
|
4541
4644
|
*
|
|
@@ -12722,6 +12825,18 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
12722
12825
|
|
|
12723
12826
|
Registers teammate agents that the current agent can consult via tools.
|
|
12724
12827
|
|
|
12828
|
+
The primary agent sends a question and relevant context to a teammate and receives an attributed answer.
|
|
12829
|
+
Each teammate uses its own Book. Declaring a team makes advisers available when relevant; it does not
|
|
12830
|
+
merge their rules into the primary agent or start every teammate automatically.
|
|
12831
|
+
|
|
12832
|
+
In \`ptbk coder run\` and \`ptbk coder plan\`, TEAM entries in the selected Book, its ancestors and imports
|
|
12833
|
+
use the existing reference rules: \`@Name\`, \`{Agent Name}\`, \`{./lawyer.book}\`, project paths such as
|
|
12834
|
+
\`{agents/lawyer.book}\`, and HTTP(S) Book URLs. Local advisers require no Agents Server. A remote Book
|
|
12835
|
+
must be readable through its normal endpoint; private or inaccessible sources return errors.
|
|
12836
|
+
Coding harnesses expose scoped command tools; planning uses restricted host tools and currently requires
|
|
12837
|
+
OpenAI Codex. Planning restrictions apply to every adviser, including custom Developer Books.
|
|
12838
|
+
The primary agent retains responsibility for the task, PRD proposals and final output.
|
|
12839
|
+
|
|
12725
12840
|
## Examples
|
|
12726
12841
|
|
|
12727
12842
|
\`\`\`book
|
|
@@ -12733,7 +12848,7 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
12733
12848
|
`);
|
|
12734
12849
|
}
|
|
12735
12850
|
applyToAgentModelRequirements(requirements, content) {
|
|
12736
|
-
var _a, _b, _c;
|
|
12851
|
+
var _a, _b, _c, _d;
|
|
12737
12852
|
const trimmedContent = content.trim();
|
|
12738
12853
|
if (!trimmedContent) {
|
|
12739
12854
|
return requirements;
|
|
@@ -12747,20 +12862,30 @@ class TeamCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
12747
12862
|
const existingTeammates = ((_b = requirements._metadata) === null || _b === void 0 ? void 0 : _b.teammates) || [];
|
|
12748
12863
|
const preResolvedProfiles = (((_c = requirements._metadata) === null || _c === void 0 ? void 0 : _c.preResolvedTeammateProfiles) || {});
|
|
12749
12864
|
const resolvedTeammates = resolveTeamTeammateLabels(trimmedContent, teammates);
|
|
12865
|
+
const toolUrls = new Map(existingTeammates.map((teammate) => [teammate.toolName, teammate.url]));
|
|
12750
12866
|
const teamEntries = resolvedTeammates.map((teammate) => {
|
|
12751
12867
|
const profile = preResolvedProfiles[teammate.url];
|
|
12752
12868
|
const resolvedLabel = (profile === null || profile === void 0 ? void 0 : profile.agentName) || teammate.label;
|
|
12753
12869
|
const existingTeammate = existingTeammates.find((entry) => entry.url === teammate.url);
|
|
12870
|
+
const baseToolName = (existingTeammate === null || existingTeammate === void 0 ? void 0 : existingTeammate.toolName) || createTeamToolName(teammate.url, resolvedLabel);
|
|
12871
|
+
let toolName = baseToolName;
|
|
12872
|
+
let suffix = 1;
|
|
12873
|
+
// Explicit paths can identify distinct Books with the same display name or normalized label.
|
|
12874
|
+
while (toolUrls.has(toolName) && toolUrls.get(toolName) !== teammate.url) {
|
|
12875
|
+
toolName = `${baseToolName}_${++suffix}`;
|
|
12876
|
+
}
|
|
12877
|
+
toolUrls.set(toolName, teammate.url);
|
|
12754
12878
|
return {
|
|
12755
|
-
toolName:
|
|
12756
|
-
createTeamToolName(teammate.url, resolvedLabel)),
|
|
12879
|
+
toolName: toolName,
|
|
12757
12880
|
teammate: { ...teammate, label: resolvedLabel },
|
|
12758
12881
|
agentName,
|
|
12759
12882
|
description: (profile === null || profile === void 0 ? void 0 : profile.personaDescription) || null,
|
|
12760
12883
|
};
|
|
12761
12884
|
});
|
|
12762
|
-
|
|
12763
|
-
|
|
12885
|
+
if (!((_d = requirements._metadata) === null || _d === void 0 ? void 0 : _d.isTeamToolRegistrationDisabled)) {
|
|
12886
|
+
for (const entry of teamEntries) {
|
|
12887
|
+
registerTeamTool(entry);
|
|
12888
|
+
}
|
|
12764
12889
|
}
|
|
12765
12890
|
const existingTools = requirements.tools || [];
|
|
12766
12891
|
const updatedTools = [...existingTools];
|
|
@@ -16932,29 +17057,36 @@ class UseUserLocationCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
16932
17057
|
/**
|
|
16933
17058
|
* `WRITING RULES` commitment definition.
|
|
16934
17059
|
*
|
|
16935
|
-
*
|
|
16936
|
-
* rather than task-solving behavior.
|
|
17060
|
+
* The `WRITING RULES`/`WRITING RULE` commitment adds constraints that apply strictly to writing style
|
|
17061
|
+
* and presentation rather than task-solving behavior.
|
|
17062
|
+
*
|
|
17063
|
+
* Example usage in agent source:
|
|
17064
|
+
*
|
|
17065
|
+
* ```book
|
|
17066
|
+
* WRITING RULES Keep every response under 120 words
|
|
17067
|
+
* WRITING RULE Always end the message with an emoji
|
|
17068
|
+
* ```
|
|
16937
17069
|
*
|
|
16938
17070
|
* @private [🪔] Maybe export the commitments through some package
|
|
16939
17071
|
*/
|
|
16940
17072
|
class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition {
|
|
16941
|
-
constructor() {
|
|
16942
|
-
super(
|
|
17073
|
+
constructor(type = 'WRITING RULES') {
|
|
17074
|
+
super(type);
|
|
16943
17075
|
}
|
|
16944
17076
|
/**
|
|
16945
|
-
* Short one-line description of `WRITING RULES`.
|
|
17077
|
+
* Short one-line description of `WRITING RULES`/`WRITING RULE`.
|
|
16946
17078
|
*/
|
|
16947
17079
|
get description() {
|
|
16948
17080
|
return 'Add writing-only constraints such as tone, length, formatting, or emoji usage.';
|
|
16949
17081
|
}
|
|
16950
17082
|
/**
|
|
16951
|
-
* Icon for `WRITING RULES`.
|
|
17083
|
+
* Icon for `WRITING RULES`/`WRITING RULE`.
|
|
16952
17084
|
*/
|
|
16953
17085
|
get icon() {
|
|
16954
17086
|
return '📝';
|
|
16955
17087
|
}
|
|
16956
17088
|
/**
|
|
16957
|
-
* Markdown documentation for `WRITING RULES
|
|
17089
|
+
* Markdown documentation for `WRITING RULES`/`WRITING RULE` commitment.
|
|
16958
17090
|
*/
|
|
16959
17091
|
get documentation() {
|
|
16960
17092
|
return spaceTrim$1(`
|
|
@@ -16964,6 +17096,7 @@ class WritingRulesCommitmentDefinition extends BaseCommitmentDefinition {
|
|
|
16964
17096
|
|
|
16965
17097
|
## Key aspects
|
|
16966
17098
|
|
|
17099
|
+
- All writing rules are treated equally regardless of singular/plural form.
|
|
16967
17100
|
- Use it for writing-only constraints such as tone, formatting, length, emoji usage, punctuation, or reading level.
|
|
16968
17101
|
- Do **not** use it for problem-solving behavior, policy, tool usage, or decision-making logic. Use \`RULE\` for that.
|
|
16969
17102
|
- Newer writing-rules blocks override conflicting earlier writing-rules blocks.
|
|
@@ -17162,7 +17295,8 @@ const COMMITMENT_REGISTRY = [
|
|
|
17162
17295
|
new LanguageCommitmentDefinition('LANGUAGE'),
|
|
17163
17296
|
new LanguageCommitmentDefinition('LANGUAGES'),
|
|
17164
17297
|
new WritingSampleCommitmentDefinition(),
|
|
17165
|
-
new WritingRulesCommitmentDefinition(),
|
|
17298
|
+
new WritingRulesCommitmentDefinition('WRITING RULES'),
|
|
17299
|
+
new WritingRulesCommitmentDefinition('WRITING RULE'),
|
|
17166
17300
|
new SampleCommitmentDefinition('SAMPLE'),
|
|
17167
17301
|
new SampleCommitmentDefinition('EXAMPLE'),
|
|
17168
17302
|
new FormatCommitmentDefinition('FORMAT'),
|
|
@@ -18470,6 +18604,30 @@ function createDefaultAgentName(agentSource) {
|
|
|
18470
18604
|
return normalizeAgentName(`Agent ${agentHash.substring(0, LIMITS.SHORT_NAME_LENGTH)}`);
|
|
18471
18605
|
}
|
|
18472
18606
|
|
|
18607
|
+
/**
|
|
18608
|
+
* Pattern shared by Book parsing and editor highlighting for a commitment-like line.
|
|
18609
|
+
*
|
|
18610
|
+
* A Book commitment keyword consists of one or more all-uppercase words with at least
|
|
18611
|
+
* two characters each. This deliberately mirrors the Book editor syntax rule so an
|
|
18612
|
+
* unknown keyword starts a new source block everywhere it is interpreted.
|
|
18613
|
+
*
|
|
18614
|
+
* @private internal constant of `getBookCommitmentLineType`
|
|
18615
|
+
*/
|
|
18616
|
+
const BOOK_COMMITMENT_LINE_TYPE_REGEX = /^\s*(?<type>[A-Z][A-Z0-9]+(?:\s+[A-Z][A-Z0-9]+)*)(?=\s|$)/;
|
|
18617
|
+
/**
|
|
18618
|
+
* Extracts the uppercase commitment type from a Book line, including types not registered by Promptbook.
|
|
18619
|
+
*
|
|
18620
|
+
* @param line - One raw Book source line.
|
|
18621
|
+
* @returns Matched commitment type or `null` when the line does not begin with commitment syntax.
|
|
18622
|
+
*
|
|
18623
|
+
* @private internal utility of Book parsing and `<BookEditor/>`
|
|
18624
|
+
*/
|
|
18625
|
+
function getBookCommitmentLineType(line) {
|
|
18626
|
+
var _a;
|
|
18627
|
+
const match = BOOK_COMMITMENT_LINE_TYPE_REGEX.exec(line);
|
|
18628
|
+
return ((_a = match === null || match === void 0 ? void 0 : match.groups) === null || _a === void 0 ? void 0 : _a.type) || null;
|
|
18629
|
+
}
|
|
18630
|
+
|
|
18473
18631
|
/**
|
|
18474
18632
|
* Consumes the agent-name prelude from raw source.
|
|
18475
18633
|
*
|
|
@@ -18527,13 +18685,15 @@ function parseAgentSourceWithCommitments(agentSource) {
|
|
|
18527
18685
|
return {
|
|
18528
18686
|
agentName: null,
|
|
18529
18687
|
commitments: [],
|
|
18688
|
+
unknownCommitments: [],
|
|
18530
18689
|
nonCommitmentLines: [],
|
|
18531
18690
|
};
|
|
18532
18691
|
}
|
|
18533
18692
|
const { lines, agentName, agentNameLineIndex, agentNameLineNumber } = parseAgentSourcePrelude(agentSource);
|
|
18534
18693
|
const commitments = [];
|
|
18694
|
+
const unknownCommitments = [];
|
|
18535
18695
|
const nonCommitmentLines = agentNameLineIndex >= 0 ? [lines[agentNameLineIndex]] : [];
|
|
18536
|
-
// Parse commitments with multiline support
|
|
18696
|
+
// Parse commitments with multiline support.
|
|
18537
18697
|
let currentCommitment = null;
|
|
18538
18698
|
// Process lines starting from after the agent name line
|
|
18539
18699
|
const startIndex = agentNameLineIndex >= 0 ? agentNameLineIndex + 1 : 0;
|
|
@@ -18547,25 +18707,11 @@ function parseAgentSourceWithCommitments(agentSource) {
|
|
|
18547
18707
|
// Check if this line starts or ends a code block
|
|
18548
18708
|
if (trimmedLine.startsWith('```')) {
|
|
18549
18709
|
isInsideCodeBlock = !isInsideCodeBlock;
|
|
18550
|
-
|
|
18551
|
-
// If we are inside a commitment, the code block is part of it
|
|
18552
|
-
currentCommitment.contentLines.push(line);
|
|
18553
|
-
}
|
|
18554
|
-
else {
|
|
18555
|
-
// If we are not inside a commitment, the code block is non-commitment
|
|
18556
|
-
nonCommitmentLines.push(line);
|
|
18557
|
-
}
|
|
18710
|
+
appendLineToCurrentCommitmentOrNonCommitmentLines(currentCommitment, line, nonCommitmentLines);
|
|
18558
18711
|
continue;
|
|
18559
18712
|
}
|
|
18560
18713
|
if (isInsideCodeBlock) {
|
|
18561
|
-
|
|
18562
|
-
// If we are inside a commitment and a code block, the line is part of the commitment
|
|
18563
|
-
currentCommitment.contentLines.push(line);
|
|
18564
|
-
}
|
|
18565
|
-
else {
|
|
18566
|
-
// If we are inside a code block but not a commitment, the line is non-commitment
|
|
18567
|
-
nonCommitmentLines.push(line);
|
|
18568
|
-
}
|
|
18714
|
+
appendLineToCurrentCommitmentOrNonCommitmentLines(currentCommitment, line, nonCommitmentLines);
|
|
18569
18715
|
continue;
|
|
18570
18716
|
}
|
|
18571
18717
|
// Check if this line starts a new commitment
|
|
@@ -18574,22 +18720,14 @@ function parseAgentSourceWithCommitments(agentSource) {
|
|
|
18574
18720
|
const typeRegex = definition.createTypeRegex();
|
|
18575
18721
|
const match = typeRegex.exec(line.trim());
|
|
18576
18722
|
if (match && ((_a = match.groups) === null || _a === void 0 ? void 0 : _a.type)) {
|
|
18577
|
-
|
|
18578
|
-
if (currentCommitment) {
|
|
18579
|
-
const fullContent = currentCommitment.contentLines.join('\n');
|
|
18580
|
-
commitments.push({
|
|
18581
|
-
type: currentCommitment.type,
|
|
18582
|
-
content: spaceTrim$1(fullContent),
|
|
18583
|
-
originalLine: currentCommitment.originalStartLine,
|
|
18584
|
-
lineNumber: currentCommitment.startLineNumber,
|
|
18585
|
-
});
|
|
18586
|
-
}
|
|
18723
|
+
appendCurrentCommitment(currentCommitment, commitments, unknownCommitments);
|
|
18587
18724
|
// Extract the initial content from the commitment line
|
|
18588
18725
|
const fullRegex = definition.createRegex();
|
|
18589
18726
|
const fullMatch = fullRegex.exec(line.trim());
|
|
18590
18727
|
const initialContent = ((_b = fullMatch === null || fullMatch === void 0 ? void 0 : fullMatch.groups) === null || _b === void 0 ? void 0 : _b.contents) || '';
|
|
18591
18728
|
// Start a new commitment
|
|
18592
18729
|
currentCommitment = {
|
|
18730
|
+
kind: 'known',
|
|
18593
18731
|
type: definition.type,
|
|
18594
18732
|
startLineNumber: i + 1,
|
|
18595
18733
|
originalStartLine: line,
|
|
@@ -18599,52 +18737,90 @@ function parseAgentSourceWithCommitments(agentSource) {
|
|
|
18599
18737
|
break;
|
|
18600
18738
|
}
|
|
18601
18739
|
}
|
|
18740
|
+
if (foundNewCommitment) {
|
|
18741
|
+
continue;
|
|
18742
|
+
}
|
|
18743
|
+
const unknownCommitmentType = getBookCommitmentLineType(line);
|
|
18744
|
+
if (unknownCommitmentType) {
|
|
18745
|
+
appendCurrentCommitment(currentCommitment, commitments, unknownCommitments);
|
|
18746
|
+
currentCommitment = {
|
|
18747
|
+
kind: 'unknown',
|
|
18748
|
+
type: unknownCommitmentType,
|
|
18749
|
+
startLineNumber: i + 1,
|
|
18750
|
+
originalStartLine: line,
|
|
18751
|
+
sourceLines: [line],
|
|
18752
|
+
};
|
|
18753
|
+
continue;
|
|
18754
|
+
}
|
|
18602
18755
|
// Check if this is a horizontal line (ends any current commitment)
|
|
18603
18756
|
const isHorizontalLine = HORIZONTAL_LINE_PATTERN$1.test(line);
|
|
18604
18757
|
if (isHorizontalLine) {
|
|
18605
|
-
|
|
18606
|
-
|
|
18607
|
-
const fullContent = currentCommitment.contentLines.join('\n');
|
|
18608
|
-
commitments.push({
|
|
18609
|
-
type: currentCommitment.type,
|
|
18610
|
-
content: spaceTrim$1(fullContent),
|
|
18611
|
-
originalLine: currentCommitment.originalStartLine,
|
|
18612
|
-
lineNumber: currentCommitment.startLineNumber,
|
|
18613
|
-
});
|
|
18614
|
-
currentCommitment = null;
|
|
18615
|
-
}
|
|
18758
|
+
appendCurrentCommitment(currentCommitment, commitments, unknownCommitments);
|
|
18759
|
+
currentCommitment = null;
|
|
18616
18760
|
// Add horizontal line to non-commitment lines
|
|
18617
18761
|
nonCommitmentLines.push(line);
|
|
18618
18762
|
continue;
|
|
18619
18763
|
}
|
|
18620
|
-
|
|
18621
|
-
if (currentCommitment) {
|
|
18622
|
-
// This line belongs to the current commitment
|
|
18623
|
-
currentCommitment.contentLines.push(line);
|
|
18624
|
-
}
|
|
18625
|
-
else {
|
|
18626
|
-
// This line is not part of any commitment
|
|
18627
|
-
nonCommitmentLines.push(line);
|
|
18628
|
-
}
|
|
18629
|
-
}
|
|
18630
|
-
}
|
|
18631
|
-
// Don't forget to save the last commitment if it exists
|
|
18632
|
-
if (currentCommitment) {
|
|
18633
|
-
const fullContent = currentCommitment.contentLines.join('\n');
|
|
18634
|
-
commitments.push({
|
|
18635
|
-
type: currentCommitment.type,
|
|
18636
|
-
content: spaceTrim$1(fullContent),
|
|
18637
|
-
originalLine: currentCommitment.originalStartLine,
|
|
18638
|
-
lineNumber: currentCommitment.startLineNumber,
|
|
18639
|
-
});
|
|
18764
|
+
appendLineToCurrentCommitmentOrNonCommitmentLines(currentCommitment, line, nonCommitmentLines);
|
|
18640
18765
|
}
|
|
18766
|
+
appendCurrentCommitment(currentCommitment, commitments, unknownCommitments);
|
|
18641
18767
|
return {
|
|
18642
18768
|
agentName,
|
|
18643
18769
|
agentNameLineNumber,
|
|
18644
18770
|
commitments,
|
|
18771
|
+
unknownCommitments,
|
|
18645
18772
|
nonCommitmentLines,
|
|
18646
18773
|
};
|
|
18647
18774
|
}
|
|
18775
|
+
/**
|
|
18776
|
+
* Stores the current known or unknown commitment in its appropriate parsed collection.
|
|
18777
|
+
*
|
|
18778
|
+
* @param currentCommitment - Commitment-like block collected so far.
|
|
18779
|
+
* @param commitments - Parsed registered commitments to append to.
|
|
18780
|
+
* @param unknownCommitments - Parsed unregistered commitments to append to.
|
|
18781
|
+
*
|
|
18782
|
+
* @private internal utility of `parseAgentSourceWithCommitments`
|
|
18783
|
+
*/
|
|
18784
|
+
function appendCurrentCommitment(currentCommitment, commitments, unknownCommitments) {
|
|
18785
|
+
if (!currentCommitment) {
|
|
18786
|
+
return;
|
|
18787
|
+
}
|
|
18788
|
+
if (currentCommitment.kind === 'unknown') {
|
|
18789
|
+
unknownCommitments.push({
|
|
18790
|
+
type: currentCommitment.type,
|
|
18791
|
+
originalLine: currentCommitment.originalStartLine,
|
|
18792
|
+
lineNumber: currentCommitment.startLineNumber,
|
|
18793
|
+
source: spaceTrim$1(currentCommitment.sourceLines.join('\n')),
|
|
18794
|
+
});
|
|
18795
|
+
return;
|
|
18796
|
+
}
|
|
18797
|
+
commitments.push({
|
|
18798
|
+
type: currentCommitment.type,
|
|
18799
|
+
content: spaceTrim$1(currentCommitment.contentLines.join('\n')),
|
|
18800
|
+
originalLine: currentCommitment.originalStartLine,
|
|
18801
|
+
lineNumber: currentCommitment.startLineNumber,
|
|
18802
|
+
});
|
|
18803
|
+
}
|
|
18804
|
+
/**
|
|
18805
|
+
* Adds one source line to the active commitment-like block, or to plain source content when none is active.
|
|
18806
|
+
*
|
|
18807
|
+
* @param currentCommitment - Commitment-like block currently being collected.
|
|
18808
|
+
* @param line - Source line to append.
|
|
18809
|
+
* @param nonCommitmentLines - Plain source lines to append to when no block is active.
|
|
18810
|
+
*
|
|
18811
|
+
* @private internal utility of `parseAgentSourceWithCommitments`
|
|
18812
|
+
*/
|
|
18813
|
+
function appendLineToCurrentCommitmentOrNonCommitmentLines(currentCommitment, line, nonCommitmentLines) {
|
|
18814
|
+
if (!currentCommitment) {
|
|
18815
|
+
nonCommitmentLines.push(line);
|
|
18816
|
+
return;
|
|
18817
|
+
}
|
|
18818
|
+
if (currentCommitment.kind === 'unknown') {
|
|
18819
|
+
currentCommitment.sourceLines.push(line);
|
|
18820
|
+
return;
|
|
18821
|
+
}
|
|
18822
|
+
currentCommitment.contentLines.push(line);
|
|
18823
|
+
}
|
|
18648
18824
|
|
|
18649
18825
|
/**
|
|
18650
18826
|
* Parses parameters from text using both supported notations:
|
|
@@ -19545,7 +19721,7 @@ function validateBook(source) {
|
|
|
19545
19721
|
padBook(validateBook(spaceTrim$1(`
|
|
19546
19722
|
AI Avatar
|
|
19547
19723
|
|
|
19548
|
-
|
|
19724
|
+
GOAL Help users with their tasks as a friendly AI assistant.
|
|
19549
19725
|
`)));
|
|
19550
19726
|
// <- Note: Not using book`...` notation to avoid strange error in jest unit tests `TypeError: (0 , book_notation_1.book) is not a function`
|
|
19551
19727
|
// <- TODO: [🐱🚀] `GENESIS_BOOK` / `ADAM_BOOK` in `/agents/adam.book`
|
|
@@ -26235,9 +26411,15 @@ async function preResolveTeammateProfilesForTeamCommitment(requirements, commitm
|
|
|
26235
26411
|
if (preResolvedTeammateProfiles[teammate.url]) {
|
|
26236
26412
|
continue;
|
|
26237
26413
|
}
|
|
26238
|
-
|
|
26239
|
-
|
|
26240
|
-
|
|
26414
|
+
try {
|
|
26415
|
+
const profile = await profileResolver.resolveTeammateProfile(teammate.url);
|
|
26416
|
+
if (profile) {
|
|
26417
|
+
preResolvedTeammateProfiles[teammate.url] = profile;
|
|
26418
|
+
}
|
|
26419
|
+
}
|
|
26420
|
+
catch (error) {
|
|
26421
|
+
// One inaccessible adviser must not erase the names and roles of other callable teammates.
|
|
26422
|
+
console.warn(`Failed to resolve TEAM profile for ${teammate.url}:`, error);
|
|
26241
26423
|
}
|
|
26242
26424
|
}
|
|
26243
26425
|
return {
|
|
@@ -26427,7 +26609,8 @@ async function augmentAgentModelRequirementsFromSource(requirements, parseResult
|
|
|
26427
26609
|
requirements = await importReferencedFiles(requirements);
|
|
26428
26610
|
requirements = appendMcpServers(requirements, agentSource);
|
|
26429
26611
|
requirements = appendNonCommitmentContent(requirements, parseResult);
|
|
26430
|
-
|
|
26612
|
+
requirements = appendExampleInteractions(requirements, parseResult);
|
|
26613
|
+
return appendUnknownCommitmentContent(requirements, parseResult);
|
|
26431
26614
|
}
|
|
26432
26615
|
/**
|
|
26433
26616
|
* Imports text files referenced by IMPORT commitments and appends their transformed content to the system message.
|
|
@@ -26549,6 +26732,36 @@ function appendNonCommitmentContent(requirements, parseResult) {
|
|
|
26549
26732
|
}
|
|
26550
26733
|
return appendSystemMessageSection(requirements, nonCommitmentContent);
|
|
26551
26734
|
}
|
|
26735
|
+
/**
|
|
26736
|
+
* Appends unknown commitment blocks as final extra context without applying commitment side effects.
|
|
26737
|
+
*
|
|
26738
|
+
* @param requirements - Current requirements snapshot.
|
|
26739
|
+
* @param parseResult - Parsed source including unknown commitment blocks.
|
|
26740
|
+
* @returns Requirements with unknown commitment context appended at the end of the system message.
|
|
26741
|
+
*
|
|
26742
|
+
* @private internal utility of `augmentAgentModelRequirementsFromSource`
|
|
26743
|
+
*/
|
|
26744
|
+
function appendUnknownCommitmentContent(requirements, parseResult) {
|
|
26745
|
+
const unknownCommitmentContent = getUnknownCommitmentContent(parseResult);
|
|
26746
|
+
if (!unknownCommitmentContent) {
|
|
26747
|
+
return requirements;
|
|
26748
|
+
}
|
|
26749
|
+
return appendSystemMessageSection(requirements, unknownCommitmentContent);
|
|
26750
|
+
}
|
|
26751
|
+
/**
|
|
26752
|
+
* Joins unknown commitment blocks into their final extra-context representation.
|
|
26753
|
+
*
|
|
26754
|
+
* @param parseResult - Parsed source including unknown commitment blocks.
|
|
26755
|
+
* @returns Unknown commitment source blocks in their original order.
|
|
26756
|
+
*
|
|
26757
|
+
* @private internal utility of `appendUnknownCommitmentContent`
|
|
26758
|
+
*/
|
|
26759
|
+
function getUnknownCommitmentContent(parseResult) {
|
|
26760
|
+
return parseResult.unknownCommitments
|
|
26761
|
+
.map((commitment) => commitment.source)
|
|
26762
|
+
.filter(Boolean)
|
|
26763
|
+
.join('\n\n');
|
|
26764
|
+
}
|
|
26552
26765
|
/**
|
|
26553
26766
|
* Collects plain-text lines that were not parsed as commitments and should still become part of the final system message.
|
|
26554
26767
|
*
|
|
@@ -26876,6 +27089,245 @@ function stripInlineKnowledgeMetadata(metadata) {
|
|
|
26876
27089
|
return Object.keys(rest).length > 0 ? rest : undefined;
|
|
26877
27090
|
}
|
|
26878
27091
|
|
|
27092
|
+
/**
|
|
27093
|
+
* Pattern matching a markdown section heading (`## Title`) that separates system-message sections
|
|
27094
|
+
*
|
|
27095
|
+
* @private internal constant of `deduplicateSystemMessage`
|
|
27096
|
+
*/
|
|
27097
|
+
const SYSTEM_MESSAGE_SECTION_HEADING_PATTERN = /^##(?!#)\s*(.+?)\s*$/;
|
|
27098
|
+
/**
|
|
27099
|
+
* Pattern matching a fenced code block delimiter which suspends section and block splitting
|
|
27100
|
+
*
|
|
27101
|
+
* @private internal constant of `deduplicateSystemMessage`
|
|
27102
|
+
*/
|
|
27103
|
+
const CODE_FENCE_PATTERN = /^\s*(?:```|~~~)/;
|
|
27104
|
+
/**
|
|
27105
|
+
* Pattern matching a markdown list item which keeps merged bullet lists visually compact
|
|
27106
|
+
*
|
|
27107
|
+
* @private internal constant of `deduplicateSystemMessage`
|
|
27108
|
+
*/
|
|
27109
|
+
const LIST_ITEM_PATTERN = /^\s*(?:[-*+]|\d+[.)])\s/;
|
|
27110
|
+
/**
|
|
27111
|
+
* Removes duplicated instructions from a generated system message
|
|
27112
|
+
*
|
|
27113
|
+
* Commitments are applied one by one, so a commitment used multiple times in one book repeats its whole
|
|
27114
|
+
* section, including the shared guidance preamble. For example two `WRITING RULES` commitments emit the
|
|
27115
|
+
* `## Writing rules` heading and its guidance paragraph twice. This function merges all sections sharing
|
|
27116
|
+
* one heading into the position of their first occurrence and keeps every identical block only once.
|
|
27117
|
+
*
|
|
27118
|
+
* @param systemMessage The assembled system message which may contain repeated sections and blocks
|
|
27119
|
+
* @returns The system message where each section heading and each identical block appears exactly once
|
|
27120
|
+
*
|
|
27121
|
+
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
27122
|
+
*/
|
|
27123
|
+
function deduplicateSystemMessage(systemMessage) {
|
|
27124
|
+
if (!systemMessage.trim()) {
|
|
27125
|
+
return systemMessage;
|
|
27126
|
+
}
|
|
27127
|
+
return splitSystemMessageIntoRegions(systemMessage)
|
|
27128
|
+
.reduce(mergeRegionSharingHeading, [])
|
|
27129
|
+
.map(removeDuplicateBlocksFromRegion)
|
|
27130
|
+
.map(renderRegion)
|
|
27131
|
+
.filter((renderedRegion) => renderedRegion !== '')
|
|
27132
|
+
.join('\n\n');
|
|
27133
|
+
}
|
|
27134
|
+
/**
|
|
27135
|
+
* Splits the system message into the intro region and one region per `## Title` section
|
|
27136
|
+
*
|
|
27137
|
+
* @param systemMessage The system message to split
|
|
27138
|
+
* @returns Regions in their original order, without empty ones
|
|
27139
|
+
*
|
|
27140
|
+
* @private internal utility of `deduplicateSystemMessage`
|
|
27141
|
+
*/
|
|
27142
|
+
function splitSystemMessageIntoRegions(systemMessage) {
|
|
27143
|
+
const regions = [];
|
|
27144
|
+
let headingLine = null;
|
|
27145
|
+
let bodyLines = [];
|
|
27146
|
+
let isInsideCodeFence = false;
|
|
27147
|
+
for (const line of systemMessage.split(/\r?\n/)) {
|
|
27148
|
+
if (CODE_FENCE_PATTERN.test(line)) {
|
|
27149
|
+
isInsideCodeFence = !isInsideCodeFence;
|
|
27150
|
+
}
|
|
27151
|
+
if (isInsideCodeFence || !SYSTEM_MESSAGE_SECTION_HEADING_PATTERN.test(line)) {
|
|
27152
|
+
bodyLines.push(line);
|
|
27153
|
+
continue;
|
|
27154
|
+
}
|
|
27155
|
+
regions.push(createRegion(headingLine, bodyLines));
|
|
27156
|
+
headingLine = line;
|
|
27157
|
+
bodyLines = [];
|
|
27158
|
+
}
|
|
27159
|
+
regions.push(createRegion(headingLine, bodyLines));
|
|
27160
|
+
return regions.filter((region) => region.headingLine !== null || region.blocks.length > 0);
|
|
27161
|
+
}
|
|
27162
|
+
/**
|
|
27163
|
+
* Creates one region from its heading line and its raw body lines
|
|
27164
|
+
*
|
|
27165
|
+
* @param headingLine The original `## Title` line, or `null` for the intro before the first heading
|
|
27166
|
+
* @param bodyLines The raw lines following the heading line
|
|
27167
|
+
* @returns The region with its body already split into blocks
|
|
27168
|
+
*
|
|
27169
|
+
* @private internal utility of `splitSystemMessageIntoRegions`
|
|
27170
|
+
*/
|
|
27171
|
+
function createRegion(headingLine, bodyLines) {
|
|
27172
|
+
return {
|
|
27173
|
+
titleKey: headingLine === null ? null : normalizeSectionTitle(headingLine),
|
|
27174
|
+
headingLine,
|
|
27175
|
+
isBodySeparatedByBlankLine: bodyLines[0] !== undefined && bodyLines[0].trim() === '',
|
|
27176
|
+
blocks: splitBodyIntoBlocks(bodyLines),
|
|
27177
|
+
};
|
|
27178
|
+
}
|
|
27179
|
+
/**
|
|
27180
|
+
* Normalizes a heading line into a key usable for matching sections which belong together
|
|
27181
|
+
*
|
|
27182
|
+
* @param headingLine The original `## Title` line
|
|
27183
|
+
* @returns Lowercased title without the markdown heading prefix
|
|
27184
|
+
*
|
|
27185
|
+
* @private internal utility of `createRegion`
|
|
27186
|
+
*/
|
|
27187
|
+
function normalizeSectionTitle(headingLine) {
|
|
27188
|
+
var _a, _b;
|
|
27189
|
+
return ((_b = (_a = SYSTEM_MESSAGE_SECTION_HEADING_PATTERN.exec(headingLine)) === null || _a === void 0 ? void 0 : _a[1]) !== null && _b !== void 0 ? _b : headingLine).toLowerCase();
|
|
27190
|
+
}
|
|
27191
|
+
/**
|
|
27192
|
+
* Splits raw body lines into blocks separated by blank lines while keeping fenced code blocks intact
|
|
27193
|
+
*
|
|
27194
|
+
* @param bodyLines The raw lines of one region body
|
|
27195
|
+
* @returns Non-empty blocks in their original order
|
|
27196
|
+
*
|
|
27197
|
+
* @private internal utility of `createRegion`
|
|
27198
|
+
*/
|
|
27199
|
+
function splitBodyIntoBlocks(bodyLines) {
|
|
27200
|
+
const blockTexts = [];
|
|
27201
|
+
let blockLines = [];
|
|
27202
|
+
let isInsideCodeFence = false;
|
|
27203
|
+
for (const line of bodyLines) {
|
|
27204
|
+
if (CODE_FENCE_PATTERN.test(line)) {
|
|
27205
|
+
isInsideCodeFence = !isInsideCodeFence;
|
|
27206
|
+
}
|
|
27207
|
+
if (!isInsideCodeFence && line.trim() === '') {
|
|
27208
|
+
blockTexts.push(blockLines.join('\n'));
|
|
27209
|
+
blockLines = [];
|
|
27210
|
+
continue;
|
|
27211
|
+
}
|
|
27212
|
+
blockLines.push(line);
|
|
27213
|
+
}
|
|
27214
|
+
blockTexts.push(blockLines.join('\n'));
|
|
27215
|
+
return blockTexts
|
|
27216
|
+
.filter((blockText) => blockText.trim() !== '')
|
|
27217
|
+
.map((blockText) => ({ text: blockText, isOpeningMergedSection: false }));
|
|
27218
|
+
}
|
|
27219
|
+
/**
|
|
27220
|
+
* Appends one region to the already merged regions, merging it into an earlier region with the same heading
|
|
27221
|
+
*
|
|
27222
|
+
* @param mergedRegions Regions merged so far, used as the reducer accumulator
|
|
27223
|
+
* @param region The next region in original order
|
|
27224
|
+
* @returns The accumulator with the region either appended or merged into its earlier twin
|
|
27225
|
+
*
|
|
27226
|
+
* @private internal utility of `deduplicateSystemMessage`
|
|
27227
|
+
*/
|
|
27228
|
+
function mergeRegionSharingHeading(mergedRegions, region) {
|
|
27229
|
+
const existingRegionIndex = mergedRegions.findIndex((mergedRegion) => region.titleKey !== null && mergedRegion.titleKey === region.titleKey);
|
|
27230
|
+
if (existingRegionIndex === -1) {
|
|
27231
|
+
return [...mergedRegions, region];
|
|
27232
|
+
}
|
|
27233
|
+
return mergedRegions.map((mergedRegion, index) => index !== existingRegionIndex
|
|
27234
|
+
? mergedRegion
|
|
27235
|
+
: {
|
|
27236
|
+
...mergedRegion,
|
|
27237
|
+
blocks: [...mergedRegion.blocks, ...markFirstBlockAsOpeningMergedSection(region.blocks)],
|
|
27238
|
+
});
|
|
27239
|
+
}
|
|
27240
|
+
/**
|
|
27241
|
+
* Marks the first block of a merged section occurrence so the merge seam can be rendered as one list
|
|
27242
|
+
*
|
|
27243
|
+
* @param blocks The blocks of the section occurrence being merged into an earlier section
|
|
27244
|
+
* @returns The same blocks with the first one marked as opening a merged section
|
|
27245
|
+
*
|
|
27246
|
+
* @private internal utility of `mergeRegionSharingHeading`
|
|
27247
|
+
*/
|
|
27248
|
+
function markFirstBlockAsOpeningMergedSection(blocks) {
|
|
27249
|
+
return blocks.map((block, index) => (index === 0 ? { ...block, isOpeningMergedSection: true } : block));
|
|
27250
|
+
}
|
|
27251
|
+
/**
|
|
27252
|
+
* Keeps only the first occurrence of every identical block inside one region
|
|
27253
|
+
*
|
|
27254
|
+
* @param region The region whose blocks may repeat
|
|
27255
|
+
* @returns The region without repeated blocks
|
|
27256
|
+
*
|
|
27257
|
+
* @private internal utility of `deduplicateSystemMessage`
|
|
27258
|
+
*/
|
|
27259
|
+
function removeDuplicateBlocksFromRegion(region) {
|
|
27260
|
+
const alreadyRenderedTexts = new Set();
|
|
27261
|
+
const uniqueBlocks = [];
|
|
27262
|
+
let isMergeSeamPending = false;
|
|
27263
|
+
for (const block of region.blocks) {
|
|
27264
|
+
if (alreadyRenderedTexts.has(block.text)) {
|
|
27265
|
+
// Note: A removed block must still hand its merge seam over to the next block which survives
|
|
27266
|
+
isMergeSeamPending = isMergeSeamPending || block.isOpeningMergedSection;
|
|
27267
|
+
continue;
|
|
27268
|
+
}
|
|
27269
|
+
alreadyRenderedTexts.add(block.text);
|
|
27270
|
+
uniqueBlocks.push({
|
|
27271
|
+
text: block.text,
|
|
27272
|
+
isOpeningMergedSection: block.isOpeningMergedSection || isMergeSeamPending,
|
|
27273
|
+
});
|
|
27274
|
+
isMergeSeamPending = false;
|
|
27275
|
+
}
|
|
27276
|
+
return { ...region, blocks: uniqueBlocks };
|
|
27277
|
+
}
|
|
27278
|
+
/**
|
|
27279
|
+
* Renders one region back into its markdown representation
|
|
27280
|
+
*
|
|
27281
|
+
* @param region The region to render
|
|
27282
|
+
* @returns The heading line together with its joined blocks
|
|
27283
|
+
*
|
|
27284
|
+
* @private internal utility of `deduplicateSystemMessage`
|
|
27285
|
+
*/
|
|
27286
|
+
function renderRegion(region) {
|
|
27287
|
+
const body = joinBlocks(region.blocks);
|
|
27288
|
+
if (region.headingLine === null) {
|
|
27289
|
+
return body;
|
|
27290
|
+
}
|
|
27291
|
+
if (body === '') {
|
|
27292
|
+
return region.headingLine;
|
|
27293
|
+
}
|
|
27294
|
+
return `${region.headingLine}${region.isBodySeparatedByBlankLine ? '\n\n' : '\n'}${body}`;
|
|
27295
|
+
}
|
|
27296
|
+
/**
|
|
27297
|
+
* Joins blocks of one region back together
|
|
27298
|
+
*
|
|
27299
|
+
* @param blocks The blocks to join in their original order
|
|
27300
|
+
* @returns The joined body of one region
|
|
27301
|
+
*
|
|
27302
|
+
* @private internal utility of `renderRegion`
|
|
27303
|
+
*/
|
|
27304
|
+
function joinBlocks(blocks) {
|
|
27305
|
+
return blocks
|
|
27306
|
+
.map((block, index) => index === 0 ? block.text : `${createBlockSeparator(blocks[index - 1], block)}${block.text}`)
|
|
27307
|
+
.join('');
|
|
27308
|
+
}
|
|
27309
|
+
/**
|
|
27310
|
+
* Chooses the separator between two neighboring blocks
|
|
27311
|
+
*
|
|
27312
|
+
* Blocks are normally separated by a blank line, exactly as they were written. Only where two sections were
|
|
27313
|
+
* merged together their lists are joined into one compact list instead of two separate ones.
|
|
27314
|
+
*
|
|
27315
|
+
* @param previousBlock The block rendered before the separator
|
|
27316
|
+
* @param nextBlock The block rendered after the separator
|
|
27317
|
+
* @returns Either a single or a double newline
|
|
27318
|
+
*
|
|
27319
|
+
* @private internal utility of `joinBlocks`
|
|
27320
|
+
*/
|
|
27321
|
+
function createBlockSeparator(previousBlock, nextBlock) {
|
|
27322
|
+
if (!nextBlock.isOpeningMergedSection) {
|
|
27323
|
+
return '\n\n';
|
|
27324
|
+
}
|
|
27325
|
+
const previousBlockLines = previousBlock.text.split('\n');
|
|
27326
|
+
const isListContinuing = LIST_ITEM_PATTERN.test(previousBlockLines[previousBlockLines.length - 1]) &&
|
|
27327
|
+
LIST_ITEM_PATTERN.test(nextBlock.text.split('\n')[0]);
|
|
27328
|
+
return isListContinuing ? '\n' : '\n\n';
|
|
27329
|
+
}
|
|
27330
|
+
|
|
26879
27331
|
/**
|
|
26880
27332
|
* Removes single-hash comment lines (`# Comment`) from a system message
|
|
26881
27333
|
* This is used to clean up the final system message before sending it to the AI model
|
|
@@ -26914,6 +27366,12 @@ async function createAgentModelRequirementsWithCommitments(agentSource, modelNam
|
|
|
26914
27366
|
const parseResult = parseAgentSourceWithCommitments(agentSource);
|
|
26915
27367
|
const filteredCommitments = filterCommitmentsForAgentModelRequirements(parseResult.commitments);
|
|
26916
27368
|
let requirements = createInitialAgentModelRequirements(parseResult.agentName, modelName);
|
|
27369
|
+
if (options === null || options === void 0 ? void 0 : options.isTeamToolRegistrationDisabled) {
|
|
27370
|
+
requirements = {
|
|
27371
|
+
...requirements,
|
|
27372
|
+
_metadata: { ...requirements._metadata, isTeamToolRegistrationDisabled: true },
|
|
27373
|
+
};
|
|
27374
|
+
}
|
|
26917
27375
|
requirements = await applyCommitmentsToAgentModelRequirements(requirements, filteredCommitments, options);
|
|
26918
27376
|
requirements = await augmentAgentModelRequirementsFromSource(requirements, parseResult, agentSource);
|
|
26919
27377
|
requirements = await materializeInlineKnowledgeSources(requirements, options === null || options === void 0 ? void 0 : options.inlineKnowledgeSourceUploader);
|
|
@@ -26949,14 +27407,14 @@ function createInitialAgentModelRequirements(agentName, modelName) {
|
|
|
26949
27407
|
* Performs the final system-message cleanup pass after all other augmentation steps are complete.
|
|
26950
27408
|
*
|
|
26951
27409
|
* @param requirements - Fully built requirements before final cleanup.
|
|
26952
|
-
* @returns Requirements with comment lines removed
|
|
27410
|
+
* @returns Requirements with comment lines removed and repeated instructions deduplicated in the final system message.
|
|
26953
27411
|
*
|
|
26954
27412
|
* @private internal utility of `createAgentModelRequirementsWithCommitments`
|
|
26955
27413
|
*/
|
|
26956
27414
|
function finalizeRequirements(requirements) {
|
|
26957
27415
|
return {
|
|
26958
27416
|
...requirements,
|
|
26959
|
-
systemMessage: removeCommentsFromSystemMessage(requirements.systemMessage),
|
|
27417
|
+
systemMessage: deduplicateSystemMessage(removeCommentsFromSystemMessage(requirements.systemMessage)),
|
|
26960
27418
|
};
|
|
26961
27419
|
}
|
|
26962
27420
|
|
|
@@ -27632,28 +28090,28 @@ function parseToolExecutionEnvelope(rawValue) {
|
|
|
27632
28090
|
*/
|
|
27633
28091
|
function buildToolInvocationScript(options) {
|
|
27634
28092
|
const { functionName, functionArgsExpression } = options;
|
|
27635
|
-
return `
|
|
27636
|
-
|
|
27637
|
-
|
|
27638
|
-
|
|
27639
|
-
|
|
27640
|
-
|
|
27641
|
-
|
|
27642
|
-
|
|
27643
|
-
|
|
27644
|
-
|
|
28093
|
+
return spaceTrim$1((block) => `
|
|
28094
|
+
const args = ${block(functionArgsExpression)};
|
|
28095
|
+
const runtimeContextRaw =
|
|
28096
|
+
typeof ${TOOL_RUNTIME_CONTEXT_PARAMETER} === 'undefined'
|
|
28097
|
+
? undefined
|
|
28098
|
+
: ${TOOL_RUNTIME_CONTEXT_PARAMETER};
|
|
28099
|
+
|
|
28100
|
+
if (runtimeContextRaw !== undefined && args && typeof args === 'object' && !Array.isArray(args)) {
|
|
28101
|
+
args.${TOOL_RUNTIME_CONTEXT_ARGUMENT} = runtimeContextRaw;
|
|
28102
|
+
}
|
|
27645
28103
|
|
|
27646
|
-
|
|
27647
|
-
|
|
27648
|
-
|
|
27649
|
-
|
|
28104
|
+
const toolProgressTokenRaw =
|
|
28105
|
+
typeof ${TOOL_PROGRESS_TOKEN_PARAMETER} === 'undefined'
|
|
28106
|
+
? undefined
|
|
28107
|
+
: ${TOOL_PROGRESS_TOKEN_PARAMETER};
|
|
27650
28108
|
|
|
27651
|
-
|
|
27652
|
-
|
|
27653
|
-
|
|
28109
|
+
if (toolProgressTokenRaw !== undefined && args && typeof args === 'object' && !Array.isArray(args)) {
|
|
28110
|
+
args.${TOOL_PROGRESS_TOKEN_ARGUMENT} = toolProgressTokenRaw;
|
|
28111
|
+
}
|
|
27654
28112
|
|
|
27655
|
-
|
|
27656
|
-
|
|
28113
|
+
return await ${functionName}(args);
|
|
28114
|
+
`);
|
|
27657
28115
|
}
|
|
27658
28116
|
|
|
27659
28117
|
/**
|