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