@promptbook/cli 0.114.0-13 → 0.114.0-18
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/apps/agents-server/next.config.ts +6 -0
- package/apps/agents-server/src/app/admin/_components/AdminFilterFields.tsx +84 -0
- package/apps/agents-server/src/app/admin/_components/AdminMetricCard.tsx +36 -0
- package/apps/agents-server/src/app/admin/_components/AdminTaskManagerTabs.tsx +97 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerClient.tsx +103 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerEditDialog.tsx +232 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerFiltersCard.tsx +195 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerRow.tsx +189 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerSummaryMetrics.tsx +60 -0
- package/apps/agents-server/src/app/admin/planned-messages/PlannedMessageManagerTableCard.tsx +147 -0
- package/apps/agents-server/src/app/admin/planned-messages/page.tsx +17 -0
- package/apps/agents-server/src/app/admin/planned-messages/plannedMessageEditForm.ts +186 -0
- package/apps/agents-server/src/app/admin/planned-messages/plannedMessageManagerDialogs.ts +46 -0
- package/apps/agents-server/src/app/admin/planned-messages/plannedMessageManagerPresentation.tsx +188 -0
- package/apps/agents-server/src/app/admin/planned-messages/resolvePlannedMessageSortValue.ts +115 -0
- package/apps/agents-server/src/app/admin/planned-messages/usePlannedMessageManagerData.ts +116 -0
- package/apps/agents-server/src/app/admin/planned-messages/usePlannedMessageManagerState.ts +289 -0
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerClient.tsx +7 -2
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerFiltersCard.tsx +7 -73
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerSummaryMetrics.tsx +5 -30
- package/apps/agents-server/src/app/admin/task-manager/[taskId]/TaskManagerTaskDetailClient.tsx +1 -1
- package/apps/agents-server/src/app/agents/[agentName]/api/book/reference-diagnostics/route.ts +30 -7
- package/apps/agents-server/src/app/agents/[agentName]/api/book/route.ts +1 -0
- package/apps/agents-server/src/app/agents/[agentName]/api/book/test.http +3 -3
- package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorMissingReferences.tsx +106 -12
- package/apps/agents-server/src/app/agents/[agentName]/book/BookEditorWrapper.tsx +3 -0
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorDiagnostics.ts +12 -0
- package/apps/agents-server/src/app/agents/[agentName]/book/useBookEditorWrapper.tsx +2 -0
- package/apps/agents-server/src/app/agents/[agentName]/chat/AgentGoalChatPlannedMessages.tsx +46 -3
- package/apps/agents-server/src/app/api/admin/default-agents/reinstate/route.ts +5 -1
- package/apps/agents-server/src/app/api/admin/planned-messages/[timeoutId]/route.ts +80 -0
- package/apps/agents-server/src/app/api/admin/planned-messages/route.ts +19 -0
- package/apps/agents-server/src/app/api/internal/agent-goal-chat-planned-messages/route.ts +30 -2
- package/apps/agents-server/src/components/DefaultAgents/ReinstateBundledAgentsButton.tsx +7 -0
- package/apps/agents-server/src/components/DefaultAgents/coreAgentsAdminRoute.ts +6 -0
- package/apps/agents-server/src/components/Header/buildHeaderSystemMenuItems.ts +7 -0
- package/apps/agents-server/src/components/Homepage/DefaultAgentsStatusNotice.tsx +1 -7
- package/apps/agents-server/src/database/migrations/2026-08-1800-user-chat-timeout-schedule.sql +11 -0
- package/apps/agents-server/src/instrumentation-node.ts +18 -0
- package/apps/agents-server/src/languages/ServerTranslationKeys.ts +4 -0
- package/apps/agents-server/src/languages/translations/czech.yaml +4 -0
- package/apps/agents-server/src/languages/translations/english.yaml +4 -0
- package/apps/agents-server/src/tools/agentGoalChatTimeoutToolFunctions.ts +62 -15
- package/apps/agents-server/src/tools/agentGoalChatTimeoutTools.ts +63 -9
- package/apps/agents-server/src/utils/adminEntityLookups/loadAgentNamesByPermanentId.ts +45 -0
- package/apps/agents-server/src/utils/adminEntityLookups/loadUsernamesByUserId.ts +36 -0
- package/apps/agents-server/src/utils/adminEntityLookups.ts +2 -0
- package/apps/agents-server/src/utils/agentGoalChat/agentGoalChatPlannedMessageActions.ts +299 -52
- package/apps/agents-server/src/utils/agentGoalChat/createAgentGoalChatNoteContent.ts +45 -17
- package/apps/agents-server/src/utils/agentGoalChat.ts +1 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectIdentity.ts +46 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeAutostartScheduler.ts +162 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDesiredState.ts +252 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDisplay.ts +6 -3
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeDomains.ts +2 -44
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimePaths.ts +25 -0
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimePm2.ts +4 -3
- package/apps/agents-server/src/utils/agentProjects/agentProjectRuntimeRegistry.ts +77 -24
- package/apps/agents-server/src/utils/agentProjects/agentProjectStateMutationQueue.ts +58 -0
- package/apps/agents-server/src/utils/agentProjects/listAllLocalAgentProjectIdentities.ts +48 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectRuntimeEnvironmentFlag.ts +23 -0
- package/apps/agents-server/src/utils/agentProjects/resolveAgentProjectRuntimeStatus.ts +73 -0
- package/apps/agents-server/src/utils/agentProjects/startDefaultAgentProjectRuntimes.ts +110 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/MissingCoreAgentRecovery.ts +19 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/bookScopedAgentReferences.ts +7 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/createAgentInheritanceDiagnostics.ts +457 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/createUnresolvedAgentReferenceDiagnostics.ts +27 -0
- package/apps/agents-server/src/utils/agentReferenceResolver/resolveCoreAgentAwareMissingReferences.ts +156 -0
- package/apps/agents-server/src/utils/chatMessageChips/createAnsweredMessageChipToolCalls.ts +15 -3
- package/apps/agents-server/src/utils/chatMessageChips/createPlannedMessageChipToolCalls.ts +8 -3
- package/apps/agents-server/src/utils/chatMessageChips/createTouchedExternalSourceChipToolCalls.ts +39 -0
- package/apps/agents-server/src/utils/chatMessageChips/createTouchedProjectChipResult.ts +45 -0
- package/apps/agents-server/src/utils/chatMessageChips/createTouchedProjectChipToolCalls.ts +58 -24
- package/apps/agents-server/src/utils/cronExpression/CronExpression.ts +63 -0
- package/apps/agents-server/src/utils/cronExpression/normalizeCronExpression.ts +34 -0
- package/apps/agents-server/src/utils/cronExpression/normalizeCronExpressionWhitespace.ts +11 -0
- package/apps/agents-server/src/utils/cronExpression/parseCronExpression.ts +41 -0
- package/apps/agents-server/src/utils/cronExpression/parseCronExpressionField.ts +140 -0
- package/apps/agents-server/src/utils/cronExpression/resolveNextCronRun.ts +100 -0
- package/apps/agents-server/src/utils/cronExpression/throwInvalidCronExpressionField.ts +20 -0
- package/apps/agents-server/src/utils/cronExpression.ts +10 -0
- package/apps/agents-server/src/utils/explicitFromCommitment.ts +130 -0
- package/apps/agents-server/src/utils/getAdminChatTasksResponse/getAdminChatTasks/loadAdminChatTaskFallbackData.ts +3 -77
- package/apps/agents-server/src/utils/localChatRunner/applyLocalAgentPlannedMessageCommands.ts +53 -4
- package/apps/agents-server/src/utils/localChatRunner/prepareLocalAgentPlannedMessagesSidecar.ts +15 -7
- package/apps/agents-server/src/utils/localChatRunner/processLocalUserChatJob.ts +8 -0
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentBooks.ts +5 -11
- package/apps/agents-server/src/utils/manGoOnboarding/manGoOnboardingAgentRuntime.ts +2 -2
- package/apps/agents-server/src/utils/managementApi/managementApiSchemas.ts +2 -2
- package/apps/agents-server/src/utils/plannedMessageManager/cancelManagedPlannedMessage.ts +35 -0
- package/apps/agents-server/src/utils/plannedMessageManager/collectPlannedMessageAgentOptions.ts +56 -0
- package/apps/agents-server/src/utils/plannedMessageManager/createPlannedMessageManagerCounters.ts +104 -0
- package/apps/agents-server/src/utils/plannedMessageManager/filterPlannedMessages.ts +191 -0
- package/apps/agents-server/src/utils/plannedMessageManager/getPlannedMessageManagerResponse.ts +55 -0
- package/apps/agents-server/src/utils/plannedMessageManager/isPlannedMessageStillPlanned.ts +18 -0
- package/apps/agents-server/src/utils/plannedMessageManager/loadPlannedMessageManagerRecord.ts +32 -0
- package/apps/agents-server/src/utils/plannedMessageManager/mapPlannedMessageManagerRecord.ts +73 -0
- package/apps/agents-server/src/utils/plannedMessageManager/parsePlannedMessageManagerUpdateRequest.ts +76 -0
- package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageEndReason.ts +59 -0
- package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageLifecycle.ts +99 -0
- package/apps/agents-server/src/utils/plannedMessageManager/resolvePlannedMessageRecurrenceKind.ts +40 -0
- package/apps/agents-server/src/utils/plannedMessageManager/updateManagedPlannedMessage.ts +121 -0
- package/apps/agents-server/src/utils/plannedMessagesAdmin.ts +200 -0
- package/apps/agents-server/src/utils/resolveInheritedAgentSource.ts +114 -95
- package/apps/agents-server/src/utils/userChatClient.ts +4 -0
- package/apps/agents-server/src/utils/userChatTimeout/UserChatTimeoutRecord.ts +37 -1
- package/apps/agents-server/src/utils/userChatTimeout/agentScopedTimeoutBulkActions.ts +11 -17
- package/apps/agents-server/src/utils/userChatTimeout/createTimeoutWakeUpMessage.ts +37 -13
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/PlannedMessageSchedule.ts +52 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/hasPlannedMessageRecurrence.ts +13 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/isPlannedMessageScheduleFinished.ts +30 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/normalizePlannedMessageScheduleValues.ts +62 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/parsePlannedMessageSchedule.ts +202 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule/resolvePlannedMessageDueAt.ts +121 -0
- package/apps/agents-server/src/utils/userChatTimeout/plannedMessageSchedule.ts +12 -0
- package/apps/agents-server/src/utils/userChatTimeout/setAgentScopedUserChatTimeoutPausedState.ts +66 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/createUserChatTimeout.ts +76 -5
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/listAllUserChatTimeouts.ts +37 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/mapUserChatTimeoutRow.ts +9 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/repeatFiredUserChatTimeout.ts +19 -9
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore/updateAgentScopedUserChatTimeout.ts +39 -6
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutStore.ts +1 -0
- package/apps/agents-server/src/utils/userChatTimeout/userChatTimeoutWorker.ts +110 -11
- package/apps/agents-server/src/utils/userChatTimeout.ts +16 -0
- package/apps/agents-server/src/utils/vpsSelfUpdate/vpsSelfUpdateCron.ts +23 -316
- package/apps/agents-server/tests/e2e/support/AgentManagementApi.ts +3 -3
- package/esm/index.es.js +951 -102
- package/esm/index.es.js.map +1 -1
- package/esm/scripts/run-agent-messages/git/commitAgentProjectChanges.d.ts +15 -0
- package/esm/scripts/run-agent-messages/git/commitAnsweredMessageProjectChanges.d.ts +24 -0
- package/esm/scripts/run-agent-messages/git/ensureAgentProjectGitRepository.d.ts +20 -0
- package/esm/scripts/run-agent-messages/git/readAgentProjectCommitChange.d.ts +11 -0
- package/esm/scripts/run-agent-messages/git/runAgentProjectGitCommand.d.ts +29 -0
- package/esm/scripts/run-agent-messages/messages/buildAgentGoalChatPromptSection.d.ts +3 -3
- package/esm/scripts/run-agent-messages/messages/listAgentProjectDirectoryNames.d.ts +7 -0
- package/esm/scripts/run-agent-messages/messages/resolveAnsweredMessageTouches.d.ts +29 -0
- package/esm/scripts/run-codex-prompts/ping/pingCoderHarnessPeriodically.d.ts +22 -0
- package/esm/src/book-3.0/AgentMessageRunReport.d.ts +18 -0
- package/esm/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +38 -5
- 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/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/utils/agentProjectToolCall.d.ts +39 -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/timeoutToolCallPresentation.d.ts +6 -0
- package/esm/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
- package/esm/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
- 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 +3 -0
- 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/random/$generateBookBoilerplate.test.d.ts +1 -0
- package/esm/src/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/book-2.0/agent-source/string_book.ts +1 -1
- package/src/book-2.0/book-language-documentation/czechBookLanguageManualDictionary.ts +6 -1
- package/src/book-2.0/book-language-documentation/englishBookLanguageManualDictionary.ts +6 -1
- package/src/book-3.0/AgentMessageRunReport.ts +59 -0
- package/src/book-3.0/AgentPlannedMessagesSidecar.ts +64 -9
- package/src/book-3.0/describeAgentPlannedMessageSchedule.ts +94 -0
- package/src/book-components/BookEditor/BookEditorMonaco.tsx +2 -0
- package/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.ts +3 -11
- package/src/book-components/BookEditor/createDuplicateFromCommitmentDiagnostics.ts +71 -0
- package/src/book-components/Chat/Chat/Chat.module.css +165 -18
- package/src/book-components/Chat/Chat/ChatMessageMap.tsx +0 -1
- package/src/book-components/Chat/Chat/renderAgentProjectDiff.tsx +85 -0
- package/src/book-components/Chat/Chat/renderAgentProjectToolCallDetails.tsx +206 -0
- package/src/book-components/Chat/Chat/renderToolCallDetails.tsx +8 -0
- package/src/book-components/Chat/MarkdownContent/MarkdownContent.tsx +2 -3
- package/src/book-components/Chat/utils/agentProjectToolCall.ts +82 -5
- package/src/book-components/Chat/utils/externalSourceToolCall.ts +65 -0
- package/src/book-components/Chat/utils/getToolCallChipletInfo.ts +36 -0
- package/src/book-components/Chat/utils/renderMarkdown.ts +3 -10
- package/src/book-components/Chat/utils/timeoutToolCallPresentation.ts +12 -1
- package/src/cli/cli-commands/coder/ping.ts +35 -9
- package/src/cli/cli-commands/coder/waitOptions.ts +33 -0
- package/src/cli/cli-commands/common/harness/$applyHarnessInstallationStatus.ts +3 -1
- package/src/cli/cli-commands/common/harness/$checkHarnessInstallation.ts +3 -1
- package/src/cli/cli-commands/common/harnessUpdateCliOptions.ts +1 -4
- package/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.ts +47 -3
- package/src/commands/FORMAT/formatCommandParser.ts +4 -2
- package/src/commitments/FROM/FROM.ts +13 -0
- package/src/other/templates/getTemplatesPipelineCollection.ts +819 -751
- package/src/utils/agent-message-runtime/AgentMessageProjectChange.ts +183 -0
- package/src/utils/agent-message-runtime/AgentMessageTouchedExternalSource.ts +80 -0
- package/src/utils/agent-message-runtime/parseAgentMessageRuntimeLogEvents.ts +3 -0
- package/src/utils/agent-message-runtime/resolveAgentMessageRuntimeActivity.ts +2 -4
- package/src/utils/agent-message-runtime/resolveAgentMessageTouchedExternalSources.ts +341 -0
- package/src/utils/random/$generateBookBoilerplate.ts +1 -1
- package/src/version.ts +2 -2
- package/src/versions.txt +5 -0
- package/umd/index.umd.js +950 -101
- package/umd/index.umd.js.map +1 -1
- package/umd/scripts/run-agent-messages/git/commitAgentProjectChanges.d.ts +15 -0
- package/umd/scripts/run-agent-messages/git/commitAnsweredMessageProjectChanges.d.ts +24 -0
- package/umd/scripts/run-agent-messages/git/ensureAgentProjectGitRepository.d.ts +20 -0
- package/umd/scripts/run-agent-messages/git/readAgentProjectCommitChange.d.ts +11 -0
- package/umd/scripts/run-agent-messages/git/runAgentProjectGitCommand.d.ts +29 -0
- package/umd/scripts/run-agent-messages/messages/buildAgentGoalChatPromptSection.d.ts +3 -3
- package/umd/scripts/run-agent-messages/messages/listAgentProjectDirectoryNames.d.ts +7 -0
- package/umd/scripts/run-agent-messages/messages/resolveAnsweredMessageTouches.d.ts +29 -0
- package/umd/scripts/run-codex-prompts/ping/pingCoderHarnessPeriodically.d.ts +22 -0
- package/umd/src/book-3.0/AgentMessageRunReport.d.ts +18 -0
- package/umd/src/book-3.0/AgentPlannedMessagesSidecar.d.ts +38 -5
- 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/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/utils/agentProjectToolCall.d.ts +39 -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/timeoutToolCallPresentation.d.ts +6 -0
- package/umd/src/cli/cli-commands/coder/waitOptions.d.ts +12 -0
- package/umd/src/collection/agent-collection/constructors/agent-collection-in-supabase/AgentCollectionInSupabase.d.ts +15 -0
- 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 +3 -0
- 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/random/$generateBookBoilerplate.test.d.ts +1 -0
- package/umd/src/version.d.ts +1 -1
- package/apps/agents-server/src/app/admin/task-manager/TaskManagerScopeTabs.tsx +0 -74
- package/esm/scripts/run-agent-messages/messages/resolveTouchedAgentProjects.d.ts +0 -15
- package/umd/scripts/run-agent-messages/messages/resolveTouchedAgentProjects.d.ts +0 -15
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { AgentMessageProjectChange } from '../../../src/utils/agent-message-runtime/AgentMessageProjectChange';
|
|
2
|
+
/**
|
|
3
|
+
* Commits everything one answered message changed inside one agent project.
|
|
4
|
+
*
|
|
5
|
+
* The project is turned into a git repository first when it is not one yet, so the work of every
|
|
6
|
+
* answer stays recoverable and reviewable as a normal commit history.
|
|
7
|
+
*
|
|
8
|
+
* @param options - Project identity and the commit message describing the answered message.
|
|
9
|
+
* @returns What was committed, or `null` when the project changed nothing or cannot be committed.
|
|
10
|
+
*/
|
|
11
|
+
export declare function commitAgentProjectChanges(options: {
|
|
12
|
+
readonly projectPath: string;
|
|
13
|
+
readonly projectName: string;
|
|
14
|
+
readonly commitMessage: string;
|
|
15
|
+
}): Promise<AgentMessageProjectChange | null>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AgentMessageProjectChange } from '../../../src/utils/agent-message-runtime/AgentMessageProjectChange';
|
|
2
|
+
/**
|
|
3
|
+
* Commits what one answered message changed in every project of one agent.
|
|
4
|
+
*
|
|
5
|
+
* Every project of an agent is its own git repository, so each answer which modified one becomes a
|
|
6
|
+
* commit there. The projects are committed one after another because they share the git executable
|
|
7
|
+
* and because an agent works with a handful of projects at most.
|
|
8
|
+
*
|
|
9
|
+
* Committing is best-effort bookkeeping around an answer the agent already produced: a project
|
|
10
|
+
* whose commit fails is reported to the console and skipped instead of failing the message.
|
|
11
|
+
*
|
|
12
|
+
* @param options - Agent folder and the commit message describing the answered message.
|
|
13
|
+
* @returns What was committed, one entry per project the message really changed.
|
|
14
|
+
*/
|
|
15
|
+
export declare function commitAnsweredMessageProjectChanges(options: {
|
|
16
|
+
/**
|
|
17
|
+
* Absolute path of the local agent folder owning the projects.
|
|
18
|
+
*/
|
|
19
|
+
readonly agentFolderPath: string;
|
|
20
|
+
/**
|
|
21
|
+
* Commit message shared by every project commit of this message.
|
|
22
|
+
*/
|
|
23
|
+
readonly commitMessage: string;
|
|
24
|
+
}): Promise<ReadonlyArray<AgentMessageProjectChange>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How one agent project directory relates to git.
|
|
3
|
+
*
|
|
4
|
+
* - `own-repository` is a project whose own history the runner can commit into.
|
|
5
|
+
* - `tracked-elsewhere` is a project belonging to a repository around the agent folder, whose
|
|
6
|
+
* history is already kept by whoever owns that repository.
|
|
7
|
+
* - `unavailable` is a project which cannot be committed, for example because git is missing.
|
|
8
|
+
*/
|
|
9
|
+
export type AgentProjectGitRepositoryState = 'own-repository' | 'tracked-elsewhere' | 'unavailable';
|
|
10
|
+
/**
|
|
11
|
+
* Makes sure one agent project is a git repository of its own.
|
|
12
|
+
*
|
|
13
|
+
* A project which is already tracked by a repository around the agent folder is deliberately left
|
|
14
|
+
* alone: initializing a repository inside it would turn it into an embedded repository and break
|
|
15
|
+
* the history that already covers it.
|
|
16
|
+
*
|
|
17
|
+
* @param projectPath - Absolute path of the project directory.
|
|
18
|
+
* @returns How the project relates to git after this call.
|
|
19
|
+
*/
|
|
20
|
+
export declare function ensureAgentProjectGitRepository(projectPath: string): Promise<AgentProjectGitRepositoryState>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AgentMessageProjectChange } from '../../../src/utils/agent-message-runtime/AgentMessageProjectChange';
|
|
2
|
+
/**
|
|
3
|
+
* Describes the latest commit of one agent project repository.
|
|
4
|
+
*
|
|
5
|
+
* @param options - Project directory and the project name the description is reported under.
|
|
6
|
+
* @returns Description of the commit, or `null` when git could not describe it.
|
|
7
|
+
*/
|
|
8
|
+
export declare function readAgentProjectCommitChange(options: {
|
|
9
|
+
readonly projectPath: string;
|
|
10
|
+
readonly projectName: string;
|
|
11
|
+
}): Promise<AgentMessageProjectChange | null>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result of one git command executed inside one agent project.
|
|
3
|
+
*/
|
|
4
|
+
export type AgentProjectGitCommandResult = {
|
|
5
|
+
/**
|
|
6
|
+
* Whether git reported success.
|
|
7
|
+
*/
|
|
8
|
+
readonly isSuccessful: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Standard output of the command, with the trailing newline removed.
|
|
11
|
+
*/
|
|
12
|
+
readonly output: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Runs one git command inside one agent project directory.
|
|
16
|
+
*
|
|
17
|
+
* Commands are executed without a shell and with an explicit argument list, so a project name or
|
|
18
|
+
* a file path can never be interpreted as a shell fragment. A failing command is reported through
|
|
19
|
+
* `isSuccessful` instead of throwing, because git uses the exit code to answer questions such as
|
|
20
|
+
* "is there anything staged" and because auto-committing a project must never fail an answer the
|
|
21
|
+
* agent already produced.
|
|
22
|
+
*
|
|
23
|
+
* @param options - Project directory and the git arguments to run there.
|
|
24
|
+
* @returns Outcome of the command.
|
|
25
|
+
*/
|
|
26
|
+
export declare function runAgentProjectGitCommand(options: {
|
|
27
|
+
readonly projectPath: string;
|
|
28
|
+
readonly args: ReadonlyArray<string>;
|
|
29
|
+
}): Promise<AgentProjectGitCommandResult>;
|
|
@@ -16,9 +16,9 @@ export type AgentPlannedMessagesPromptSidecar = {
|
|
|
16
16
|
* Builds the planned-message instructions available to an Agents Server-managed coding agent.
|
|
17
17
|
*
|
|
18
18
|
* Planned messages always target the agent's singleton goal chat, regardless of the chat in which the
|
|
19
|
-
* wake-up is planned, and
|
|
20
|
-
* the only channel that changes them, so an answer that merely claims a follow-up
|
|
21
|
-
* nothing — and an answer that changes nothing keeps the current plan running.
|
|
19
|
+
* wake-up is planned, and each of them keeps repeating until its schedule is over or it is cancelled.
|
|
20
|
+
* The sidecar file is the only channel that changes them, so an answer that merely claims a follow-up
|
|
21
|
+
* was planned changes nothing — and an answer that changes nothing keeps the current plan running.
|
|
22
22
|
*
|
|
23
23
|
* @param sidecar - Sidecar prepared by the Agents Server for the answered message.
|
|
24
24
|
* @returns Prompt section, or an empty string outside Agents Server-managed runs.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lists the direct project directories of one agent folder.
|
|
3
|
+
*
|
|
4
|
+
* @param agentFolderPath - Absolute path of the local agent folder.
|
|
5
|
+
* @returns Project directory names, or an empty list when the agent has no projects folder.
|
|
6
|
+
*/
|
|
7
|
+
export declare function listAgentProjectDirectoryNames(agentFolderPath: string): Promise<ReadonlyArray<string>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AgentMessageTouchedExternalSource } from '../../../src/utils/agent-message-runtime/AgentMessageTouchedExternalSource';
|
|
2
|
+
/**
|
|
3
|
+
* Everything one answered message worked with, both inside and outside the agent.
|
|
4
|
+
*/
|
|
5
|
+
export type AnsweredMessageTouches = {
|
|
6
|
+
/**
|
|
7
|
+
* Directory names of the agent projects the answer viewed or edited.
|
|
8
|
+
*/
|
|
9
|
+
readonly touchedProjectNames: ReadonlyArray<string>;
|
|
10
|
+
/**
|
|
11
|
+
* Sources outside the agent the answer reached.
|
|
12
|
+
*/
|
|
13
|
+
readonly touchedExternalSources: ReadonlyArray<AgentMessageTouchedExternalSource>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Resolves which agent projects and which external sources one answered message touched.
|
|
17
|
+
*
|
|
18
|
+
* The runtime log is deleted as soon as the harness run finishes, so this must be called while
|
|
19
|
+
* the log still exists — the Agents Server later shows everything reported here as chips below
|
|
20
|
+
* the answer. Reporting touches is best-effort telemetry: an unreadable log or projects folder
|
|
21
|
+
* simply yields nothing instead of failing the already answered message.
|
|
22
|
+
*
|
|
23
|
+
* @param options - Agent folder path and the live runtime log path of the answered message.
|
|
24
|
+
* @returns Touched projects and external sources, ordered by first appearance in the run.
|
|
25
|
+
*/
|
|
26
|
+
export declare function resolveAnsweredMessageTouches(options: {
|
|
27
|
+
readonly projectPath: string;
|
|
28
|
+
readonly runtimeLogPath: string;
|
|
29
|
+
}): Promise<AnsweredMessageTouches>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PingCoderHarnessOptions } from './pingCoderHarness';
|
|
2
|
+
/**
|
|
3
|
+
* Options for the endless `ptbk coder ping --period <duration>` loop.
|
|
4
|
+
*/
|
|
5
|
+
export type PingCoderHarnessPeriodicallyOptions = PingCoderHarnessOptions & {
|
|
6
|
+
/**
|
|
7
|
+
* How long one ping period lasts, in milliseconds.
|
|
8
|
+
*
|
|
9
|
+
* The period is measured from the start of one ping to the start of the next one, so the pings
|
|
10
|
+
* really happen once per period instead of once per period plus the duration of the ping itself.
|
|
11
|
+
*/
|
|
12
|
+
readonly periodMs: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Pings the selected harness and model once per period until the process is stopped.
|
|
16
|
+
*
|
|
17
|
+
* This keeps the quota window of the harness refreshing without any real work, so the window is
|
|
18
|
+
* always open by the time you need it. The loop never ends on its own — it is stopped with `CTRL+C`
|
|
19
|
+
* or by killing the process — therefore a failing ping is reported and the next period is started
|
|
20
|
+
* instead of tearing the whole loop down.
|
|
21
|
+
*/
|
|
22
|
+
export declare function pingCoderHarnessPeriodically(options: PingCoderHarnessPeriodicallyOptions): Promise<never>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Usage } from '../execution/Usage';
|
|
2
|
+
import type { AgentMessageProjectChange } from '../utils/agent-message-runtime/AgentMessageProjectChange';
|
|
3
|
+
import type { AgentMessageTouchedExternalSource } from '../utils/agent-message-runtime/AgentMessageTouchedExternalSource';
|
|
2
4
|
import type { CodexLoginMethod } from './codexLoginMethod';
|
|
3
5
|
/**
|
|
4
6
|
* File suffix appended to one answered message book to store its run report sidecar.
|
|
@@ -72,6 +74,22 @@ export type AgentMessageRunReport = {
|
|
|
72
74
|
* answered, so this is the only trace of the projects one answer viewed or edited.
|
|
73
75
|
*/
|
|
74
76
|
readonly touchedProjectNames?: ReadonlyArray<string>;
|
|
77
|
+
/**
|
|
78
|
+
* Sources outside the agent — integrations, websites and web searches — the harness reached
|
|
79
|
+
* while answering the message.
|
|
80
|
+
*
|
|
81
|
+
* Reported from the same live runtime log as `touchedProjectNames`, so this is the only trace
|
|
82
|
+
* of what one answer touched beyond the agent itself.
|
|
83
|
+
*/
|
|
84
|
+
readonly touchedExternalSources?: ReadonlyArray<AgentMessageTouchedExternalSource>;
|
|
85
|
+
/**
|
|
86
|
+
* Changes the harness made to the agent projects while answering the message.
|
|
87
|
+
*
|
|
88
|
+
* Every agent project is a git repository and the runner commits each answer into it, so one
|
|
89
|
+
* entry describes exactly what one message did to one project — including the diff of the
|
|
90
|
+
* commit it created.
|
|
91
|
+
*/
|
|
92
|
+
readonly projectChanges?: ReadonlyArray<AgentMessageProjectChange>;
|
|
75
93
|
};
|
|
76
94
|
/**
|
|
77
95
|
* Builds the run-report sidecar path for one message book path.
|
|
@@ -9,7 +9,7 @@ export declare const AGENT_PLANNED_MESSAGES_DIRECTORY_PATH: string;
|
|
|
9
9
|
*
|
|
10
10
|
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
11
11
|
*/
|
|
12
|
-
export declare const AGENT_PLANNED_MESSAGE_COMMAND_ACTIONS: readonly ["set", "cancel"];
|
|
12
|
+
export declare const AGENT_PLANNED_MESSAGE_COMMAND_ACTIONS: readonly ["set", "update", "cancel"];
|
|
13
13
|
/**
|
|
14
14
|
* One planned-message command action.
|
|
15
15
|
*
|
|
@@ -19,8 +19,9 @@ export type AgentPlannedMessageCommandAction = (typeof AGENT_PLANNED_MESSAGE_COM
|
|
|
19
19
|
/**
|
|
20
20
|
* One planned message that is already waiting to wake the agent.
|
|
21
21
|
*
|
|
22
|
-
* A planned message
|
|
23
|
-
* goal, while `dueAt` only says
|
|
22
|
+
* A planned message can repeat like `setInterval`, run a bounded number of times, or wake the agent
|
|
23
|
+
* only once, so the whole schedule is what the agent compares with its goal, while `dueAt` only says
|
|
24
|
+
* when the nearest wake-up happens.
|
|
24
25
|
*
|
|
25
26
|
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
26
27
|
*/
|
|
@@ -29,9 +30,34 @@ export type AgentPlannedMessageSnapshot = {
|
|
|
29
30
|
readonly dueAt: string;
|
|
30
31
|
readonly message: string | null;
|
|
31
32
|
/**
|
|
32
|
-
* Repeat interval in milliseconds, or `null` for a planned message that
|
|
33
|
+
* Repeat interval in milliseconds, or `null` for a planned message that does not repeat at a fixed
|
|
34
|
+
* interval.
|
|
33
35
|
*/
|
|
34
36
|
readonly intervalMs: number | null;
|
|
37
|
+
/**
|
|
38
|
+
* Five-field cron expression driving the repetitions, or `null` when the planned message does not
|
|
39
|
+
* follow a cron.
|
|
40
|
+
*/
|
|
41
|
+
readonly cronExpression: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* Moment before which the planned message never wakes the agent, or `null` when it has no starting
|
|
44
|
+
* date.
|
|
45
|
+
*/
|
|
46
|
+
readonly startsAt: string | null;
|
|
47
|
+
/**
|
|
48
|
+
* Moment after which the planned message never wakes the agent again, or `null` when it has no
|
|
49
|
+
* ending date.
|
|
50
|
+
*/
|
|
51
|
+
readonly endsAt: string | null;
|
|
52
|
+
/**
|
|
53
|
+
* Total number of wake-ups the planned message performs, or `null` when it repeats until it is
|
|
54
|
+
* cancelled.
|
|
55
|
+
*/
|
|
56
|
+
readonly maxRunCount: number | null;
|
|
57
|
+
/**
|
|
58
|
+
* Number of times the planned message already woke the agent.
|
|
59
|
+
*/
|
|
60
|
+
readonly runCount: number;
|
|
35
61
|
};
|
|
36
62
|
/**
|
|
37
63
|
* One command written by the coding harness into its planned-message sidecar.
|
|
@@ -39,13 +65,20 @@ export type AgentPlannedMessageSnapshot = {
|
|
|
39
65
|
* The payload stays untyped on purpose: it is untrusted harness output and is validated by the very
|
|
40
66
|
* same shared planned-message actions that back the model tools and the internal runtime API.
|
|
41
67
|
*
|
|
42
|
-
* For a `set` command, `milliseconds` is the repeat interval of the planned message, not a one-shot
|
|
68
|
+
* For a `set` command, `milliseconds` is the repeat interval of the planned message, not a one-shot
|
|
69
|
+
* delay, and `cronExpression`, `startsAt`, `endsAt`, and `maxRunCount` bound how it repeats. An
|
|
70
|
+
* `update` command changes the very same fields of the planned message named by `timeoutId`, where a
|
|
71
|
+
* field that is left out stays as it is and an explicit `null` removes the bound.
|
|
43
72
|
*
|
|
44
73
|
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
45
74
|
*/
|
|
46
75
|
export type AgentPlannedMessageCommand = {
|
|
47
76
|
readonly action: AgentPlannedMessageCommandAction;
|
|
48
77
|
readonly milliseconds?: unknown;
|
|
78
|
+
readonly cronExpression?: unknown;
|
|
79
|
+
readonly startsAt?: unknown;
|
|
80
|
+
readonly endsAt?: unknown;
|
|
81
|
+
readonly maxRunCount?: unknown;
|
|
49
82
|
readonly message?: unknown;
|
|
50
83
|
readonly timeoutId?: unknown;
|
|
51
84
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedule of one planned message as it is described to an agent.
|
|
3
|
+
*
|
|
4
|
+
* The fields match `AgentPlannedMessageSnapshot`, so one snapshot, one scheduling result, and one
|
|
5
|
+
* stored planned message are all described by the very same sentence.
|
|
6
|
+
*
|
|
7
|
+
* @private internal convention shared by the Agents Server and agent-folder runner
|
|
8
|
+
*/
|
|
9
|
+
export type AgentPlannedMessageScheduleDescription = {
|
|
10
|
+
readonly intervalMs?: number | null;
|
|
11
|
+
readonly cronExpression?: string | null;
|
|
12
|
+
readonly startsAt?: string | null;
|
|
13
|
+
readonly endsAt?: string | null;
|
|
14
|
+
readonly maxRunCount?: number | null;
|
|
15
|
+
readonly runCount?: number | null;
|
|
16
|
+
readonly dueAt?: string | null;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Describes one planned-message schedule in a single sentence fragment.
|
|
20
|
+
*
|
|
21
|
+
* A planned message can repeat forever, repeat a bounded number of times, run inside a date window, or
|
|
22
|
+
* wake the agent only once. Every surface showing a planned message — the wake-up itself, the goal-chat
|
|
23
|
+
* notes, the planned-message prompt section, and the model tools — describes it with this one helper,
|
|
24
|
+
* so an agent never has to reconcile two different wordings of the same plan.
|
|
25
|
+
*
|
|
26
|
+
* @param schedule - Schedule of the planned message.
|
|
27
|
+
* @returns Fragment such as `repeats every 5 minutes (2 of 10 runs done)`.
|
|
28
|
+
*
|
|
29
|
+
* @private internal utility of the Agents Server planned messages
|
|
30
|
+
*/
|
|
31
|
+
export declare function describeAgentPlannedMessageSchedule(schedule: AgentPlannedMessageScheduleDescription): string;
|
package/esm/src/book-components/BookEditor/createDeprecatedCommitmentDiagnostics.browser.d.ts
CHANGED
|
@@ -1,9 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* Browser-compatible stub for `createDeprecatedCommitmentDiagnostics`.
|
|
3
|
-
*
|
|
4
|
-
* In the browser build the full Node.js implementation is not available,
|
|
5
|
-
* so this stub always returns an empty array to keep the editor functional.
|
|
6
|
-
*
|
|
7
|
-
* @private internal utility of `BookEditorMonaco`
|
|
8
|
-
*/
|
|
9
|
-
export declare function createDeprecatedCommitmentDiagnostics(_agentSource?: string): [];
|
|
1
|
+
export { createDeprecatedCommitmentDiagnostics } from './createDeprecatedCommitmentDiagnostics';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { string_book } from '../../book-2.0/agent-source/string_book';
|
|
2
|
+
/**
|
|
3
|
+
* Monaco diagnostic shown when a Book source declares its parent agent more than once.
|
|
4
|
+
*
|
|
5
|
+
* @private internal type of `BookEditorMonaco`
|
|
6
|
+
*/
|
|
7
|
+
type DuplicateFromCommitmentDiagnostic = {
|
|
8
|
+
readonly startLineNumber: number;
|
|
9
|
+
readonly startColumn: number;
|
|
10
|
+
readonly endLineNumber: number;
|
|
11
|
+
readonly endColumn: number;
|
|
12
|
+
readonly message: string;
|
|
13
|
+
readonly source: string;
|
|
14
|
+
readonly severity: 'warning';
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Creates Book editor diagnostics for a parent agent declared by more than one `FROM` commitment.
|
|
18
|
+
*
|
|
19
|
+
* Repeating `FROM` stays valid — the last one wins and overrides every earlier one — but an author who writes it
|
|
20
|
+
* twice usually means only one of them, so every `FROM` keyword is marked to show which one actually applies.
|
|
21
|
+
*
|
|
22
|
+
* @param agentSource - Current editor content.
|
|
23
|
+
* @returns Warning markers for every `FROM` keyword, empty when the book declares at most one parent.
|
|
24
|
+
*
|
|
25
|
+
* @private internal utility of `BookEditorMonaco`
|
|
26
|
+
*/
|
|
27
|
+
export declare function createDuplicateFromCommitmentDiagnostics(agentSource?: string_book): ReadonlyArray<DuplicateFromCommitmentDiagnostic>;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Renders one unified diff with added, removed and context lines told apart.
|
|
4
|
+
*
|
|
5
|
+
* @param options - Diff text and whether it holds only the beginning of the real diff.
|
|
6
|
+
* @returns Readable diff block.
|
|
7
|
+
*
|
|
8
|
+
* @private function of ChatToolCallModal
|
|
9
|
+
*/
|
|
10
|
+
export declare function renderAgentProjectDiff(options: {
|
|
11
|
+
readonly diff: string;
|
|
12
|
+
readonly isDiffTruncated: boolean;
|
|
13
|
+
}): ReactElement;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { AgentProjectToolCallResult } from '../utils/agentProjectToolCall';
|
|
3
|
+
/**
|
|
4
|
+
* Renders the detail view of one project the answer worked with.
|
|
5
|
+
*
|
|
6
|
+
* The card answers the two questions a project chip raises: what this project is right now — its
|
|
7
|
+
* runtime state and where to open it — and what this very message did to it.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Parsed project chip payload.
|
|
10
|
+
* @returns Project details section for the tool modal.
|
|
11
|
+
*
|
|
12
|
+
* @private function of ChatToolCallModal
|
|
13
|
+
*/
|
|
14
|
+
export declare function renderAgentProjectToolCallDetails(options: {
|
|
15
|
+
readonly project: AgentProjectToolCallResult;
|
|
16
|
+
}): ReactElement;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { AgentMessageProjectChange } from '../../../utils/agent-message-runtime/AgentMessageProjectChange';
|
|
1
2
|
/**
|
|
2
3
|
* Synthetic tool name used for agent-project chips in chat UI.
|
|
3
4
|
*
|
|
@@ -10,6 +11,9 @@ export declare const AGENT_PROJECT_TOOL_CALL_NAME = "agent_project_touched";
|
|
|
10
11
|
/**
|
|
11
12
|
* Safe, user-facing metadata shown in agent-project chips.
|
|
12
13
|
*
|
|
14
|
+
* Everything besides the project name is optional, because a chip written by an older server — or
|
|
15
|
+
* one whose project has meanwhile been deleted — still has to render.
|
|
16
|
+
*
|
|
13
17
|
* @private internal chat-ui type for touched agent projects
|
|
14
18
|
*/
|
|
15
19
|
export type AgentProjectToolCallResult = {
|
|
@@ -21,10 +25,45 @@ export type AgentProjectToolCallResult = {
|
|
|
21
25
|
* Human-readable project name shown in the chip.
|
|
22
26
|
*/
|
|
23
27
|
readonly displayName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Short project description, resolved the same way as on the project page.
|
|
30
|
+
*/
|
|
31
|
+
readonly description?: string;
|
|
24
32
|
/**
|
|
25
33
|
* Link to the project page, when the chat knows where the project lives.
|
|
26
34
|
*/
|
|
27
35
|
readonly projectHref?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Address the running project itself is served on, when it has one.
|
|
38
|
+
*/
|
|
39
|
+
readonly projectUrl?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Whether the project was running when the answer finished.
|
|
42
|
+
*/
|
|
43
|
+
readonly isRunning?: boolean;
|
|
44
|
+
/**
|
|
45
|
+
* Runtime status label, the same one the project page shows.
|
|
46
|
+
*/
|
|
47
|
+
readonly runtimeStatusLabel?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Total size of the project, already formatted for display.
|
|
50
|
+
*/
|
|
51
|
+
readonly sizeLabel?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Count of files inside the project.
|
|
54
|
+
*/
|
|
55
|
+
readonly fileCount?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Whether the project folder is a git repository.
|
|
58
|
+
*/
|
|
59
|
+
readonly isGitRepository?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* What this very message changed in the project, when it changed anything.
|
|
62
|
+
*
|
|
63
|
+
* Its `projectName` repeats the one above because the change is reported by the agent runner
|
|
64
|
+
* in exactly this shape, and reusing it keeps the two descriptions from drifting apart.
|
|
65
|
+
*/
|
|
66
|
+
readonly change?: AgentMessageProjectChange;
|
|
28
67
|
};
|
|
29
68
|
/**
|
|
30
69
|
* Parses the project-chip payload from one tool result.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { AgentMessageTouchedExternalSource } from '../../../utils/agent-message-runtime/AgentMessageTouchedExternalSource';
|
|
2
|
+
/**
|
|
3
|
+
* Synthetic tool name used for external-source chips in chat UI.
|
|
4
|
+
*
|
|
5
|
+
* The Agents Server emits one such tool call per source outside the agent an answer viewed or
|
|
6
|
+
* edited, so the chat shows which services, websites and searches the agent really reached below
|
|
7
|
+
* the message that touched them. Work the agent does inside itself emits nothing.
|
|
8
|
+
*
|
|
9
|
+
* @private internal chat-ui marker for touched external sources
|
|
10
|
+
*/
|
|
11
|
+
export declare const EXTERNAL_SOURCE_TOOL_CALL_NAME = "external_source_touched";
|
|
12
|
+
/**
|
|
13
|
+
* Parses the external-source chip payload from one tool result.
|
|
14
|
+
*
|
|
15
|
+
* @param result - Raw tool result payload.
|
|
16
|
+
* @returns Parsed source metadata, or `null` when the result describes no external source.
|
|
17
|
+
*
|
|
18
|
+
* @private internal helper reused by chip and modal rendering
|
|
19
|
+
*/
|
|
20
|
+
export declare function parseExternalSourceToolCallResult(result: unknown): AgentMessageTouchedExternalSource | null;
|
|
21
|
+
/**
|
|
22
|
+
* Resolves the chip label of one touched external source.
|
|
23
|
+
*
|
|
24
|
+
* @param externalSource - Parsed source metadata.
|
|
25
|
+
* @returns User-facing name of the source.
|
|
26
|
+
*
|
|
27
|
+
* @private internal helper reused by chip and modal rendering
|
|
28
|
+
*/
|
|
29
|
+
export declare function resolveExternalSourceToolCallLabel(externalSource: AgentMessageTouchedExternalSource): string;
|
|
30
|
+
/**
|
|
31
|
+
* Resolves the chip emoji of one touched external source.
|
|
32
|
+
*
|
|
33
|
+
* @param externalSource - Parsed source metadata.
|
|
34
|
+
* @returns Emoji telling apart an integration, a website and a search.
|
|
35
|
+
*
|
|
36
|
+
* @private internal helper reused by chip and modal rendering
|
|
37
|
+
*/
|
|
38
|
+
export declare function resolveExternalSourceToolCallEmoji(externalSource: AgentMessageTouchedExternalSource): string;
|
|
@@ -5,6 +5,12 @@ import type { TODO_any } from '../../../utils/organization/TODO_any';
|
|
|
5
5
|
* @private internal timeout-chat constant
|
|
6
6
|
*/
|
|
7
7
|
export declare const SET_TIMEOUT_TOOL_CALL_NAME = "set_timeout";
|
|
8
|
+
/**
|
|
9
|
+
* Tool name of one re-planned wake-up, used by every producer of timeout chips.
|
|
10
|
+
*
|
|
11
|
+
* @private internal timeout-chat constant
|
|
12
|
+
*/
|
|
13
|
+
export declare const UPDATE_TIMEOUT_TOOL_CALL_NAME = "update_timeout";
|
|
8
14
|
/**
|
|
9
15
|
* Tool name of one cancelled wake-up, used by every producer of timeout chips.
|
|
10
16
|
*
|
|
@@ -12,3 +12,15 @@ export declare const DEFAULT_WAIT_AFTER_ERROR_MS: number;
|
|
|
12
12
|
* @private internal utility of `ptbk coder` wait handling
|
|
13
13
|
*/
|
|
14
14
|
export declare function parseOptionalWaitDuration(value: string | undefined, defaultMs: number): number;
|
|
15
|
+
/**
|
|
16
|
+
* Parses an optional Commander period duration string and returns the resolved milliseconds.
|
|
17
|
+
*
|
|
18
|
+
* Returns `undefined` when the flag was not provided or was provided without a non-empty value,
|
|
19
|
+
* which means the command runs only once instead of repeating itself.
|
|
20
|
+
*
|
|
21
|
+
* @throws {NotAllowed} When the duration is not a positive one, because a non-positive period
|
|
22
|
+
* would repeat the command without ever pausing between two rounds
|
|
23
|
+
*
|
|
24
|
+
* @private internal utility of `ptbk coder` wait handling
|
|
25
|
+
*/
|
|
26
|
+
export declare function parseOptionalPeriodDuration(optionName: string, value: string | undefined): number | undefined;
|
|
@@ -84,8 +84,23 @@ export declare class AgentCollectionInSupabase {
|
|
|
84
84
|
private mapAgentBasicInformationRow;
|
|
85
85
|
/**
|
|
86
86
|
* Retrieves the permanent ID of an agent by its name or permanent ID.
|
|
87
|
+
*
|
|
88
|
+
* An agent that still exists always wins over a soft-deleted one, so a name that was deleted and
|
|
89
|
+
* later created again resolves to the agent that is live now instead of to the recycle-bin leftover.
|
|
90
|
+
* Soft-deleted agents stay resolvable as a fallback because the recycle bin restores them by name
|
|
91
|
+
* or permanent id.
|
|
87
92
|
*/
|
|
88
93
|
getAgentPermanentId(agentNameOrPermanentId: string_agent_name | string_agent_permanent_id): Promise<string_agent_permanent_id>;
|
|
94
|
+
/**
|
|
95
|
+
* Looks up the permanent id of the oldest agent matching one name or permanent id.
|
|
96
|
+
*
|
|
97
|
+
* @param agentNameOrPermanentId - Agent name or stable permanent identifier to match.
|
|
98
|
+
* @param options - Whether soft-deleted agents may be matched as well.
|
|
99
|
+
* @returns Permanent id of the matched agent, or `null` when nothing matches.
|
|
100
|
+
*
|
|
101
|
+
* @private internal helper of `AgentCollectionInSupabase`
|
|
102
|
+
*/
|
|
103
|
+
private findAgentPermanentId;
|
|
89
104
|
/**
|
|
90
105
|
* Retrieves the source code of an agent by its name or permanent ID.
|
|
91
106
|
*/
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One file an answered agent message created, edited or deleted inside one project.
|
|
3
|
+
*
|
|
4
|
+
* Note: [🚉] This is fully serializable as JSON
|
|
5
|
+
*
|
|
6
|
+
* @private internal type of the agent-message runtime
|
|
7
|
+
*/
|
|
8
|
+
export type AgentMessageProjectChangedFile = {
|
|
9
|
+
/**
|
|
10
|
+
* Path of the file relative to the project root, using `/` separators.
|
|
11
|
+
*/
|
|
12
|
+
readonly path: string;
|
|
13
|
+
/**
|
|
14
|
+
* Count of lines added to the file.
|
|
15
|
+
*/
|
|
16
|
+
readonly insertionCount: number;
|
|
17
|
+
/**
|
|
18
|
+
* Count of lines removed from the file.
|
|
19
|
+
*/
|
|
20
|
+
readonly deletionCount: number;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Everything answering one single message changed inside one agent project.
|
|
24
|
+
*
|
|
25
|
+
* Each agent project is a git repository and every answer which modifies it is committed there
|
|
26
|
+
* automatically, so this describes exactly one such commit — the trace of what one message really
|
|
27
|
+
* did to one project, which a chat can show below the answer that did it.
|
|
28
|
+
*
|
|
29
|
+
* Note: [🚉] This is fully serializable as JSON
|
|
30
|
+
*
|
|
31
|
+
* @private internal type of the agent-message runtime
|
|
32
|
+
*/
|
|
33
|
+
export type AgentMessageProjectChange = {
|
|
34
|
+
/**
|
|
35
|
+
* Directory name of the changed project inside the agent `projects/` folder.
|
|
36
|
+
*/
|
|
37
|
+
readonly projectName: string;
|
|
38
|
+
/**
|
|
39
|
+
* Full hash of the commit holding the changes of this message.
|
|
40
|
+
*/
|
|
41
|
+
readonly commitHash: string;
|
|
42
|
+
/**
|
|
43
|
+
* ISO 8601 timestamp when the changes were committed.
|
|
44
|
+
*/
|
|
45
|
+
readonly committedAt: string;
|
|
46
|
+
/**
|
|
47
|
+
* Files the message changed, ordered as git reports them.
|
|
48
|
+
*/
|
|
49
|
+
readonly changedFiles: ReadonlyArray<AgentMessageProjectChangedFile>;
|
|
50
|
+
/**
|
|
51
|
+
* Count of lines added across all changed files.
|
|
52
|
+
*/
|
|
53
|
+
readonly insertionCount: number;
|
|
54
|
+
/**
|
|
55
|
+
* Count of lines removed across all changed files.
|
|
56
|
+
*/
|
|
57
|
+
readonly deletionCount: number;
|
|
58
|
+
/**
|
|
59
|
+
* Unified diff of the commit, shortened when the change is too large to carry into a chat.
|
|
60
|
+
*/
|
|
61
|
+
readonly diff: string;
|
|
62
|
+
/**
|
|
63
|
+
* Whether `diff` holds only the beginning of the real diff.
|
|
64
|
+
*/
|
|
65
|
+
readonly isDiffTruncated: boolean;
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Validates one already-parsed JSON value as a project change.
|
|
69
|
+
*
|
|
70
|
+
* @param value - Raw serialized project change.
|
|
71
|
+
* @returns The typed project change, or `null` when the value does not match the expected shape,
|
|
72
|
+
* so consumers can silently skip foreign or malformed entries.
|
|
73
|
+
*
|
|
74
|
+
* @private internal utility of the agent-message runtime
|
|
75
|
+
*/
|
|
76
|
+
export declare function normalizeAgentMessageProjectChange(value: unknown): AgentMessageProjectChange | null;
|