@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
|
@@ -159,8 +159,7 @@
|
|
|
159
159
|
rgba(248, 250, 252, 0.94) 100%
|
|
160
160
|
);
|
|
161
161
|
--chat-input-container-border-color: rgba(148, 163, 184, 0.3);
|
|
162
|
-
--chat-input-container-shadow: 0 14px 34px rgba(15, 23, 42, 0.12),
|
|
163
|
-
inset 0 1px 0 rgba(255, 255, 255, 0.9);
|
|
162
|
+
--chat-input-container-shadow: 0 14px 34px rgba(15, 23, 42, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
|
|
164
163
|
--chat-input-text-color: #0f172a;
|
|
165
164
|
--chat-input-placeholder-color: #8b9bb1;
|
|
166
165
|
--chat-input-action-color: #64748b;
|
|
@@ -244,19 +243,10 @@
|
|
|
244
243
|
rgba(2, 6, 23, 0.88) 58%,
|
|
245
244
|
rgba(2, 6, 23, 0.98) 100%
|
|
246
245
|
);
|
|
247
|
-
--chat-input-drag-over-backdrop: linear-gradient(
|
|
248
|
-
|
|
249
|
-
rgba(14, 165, 233, 0.08) 0%,
|
|
250
|
-
rgba(8, 47, 73, 0.5) 100%
|
|
251
|
-
);
|
|
252
|
-
--chat-input-container-background: linear-gradient(
|
|
253
|
-
150deg,
|
|
254
|
-
rgba(15, 23, 42, 0.96) 0%,
|
|
255
|
-
rgba(15, 23, 42, 0.9) 100%
|
|
256
|
-
);
|
|
246
|
+
--chat-input-drag-over-backdrop: linear-gradient(180deg, rgba(14, 165, 233, 0.08) 0%, rgba(8, 47, 73, 0.5) 100%);
|
|
247
|
+
--chat-input-container-background: linear-gradient(150deg, rgba(15, 23, 42, 0.96) 0%, rgba(15, 23, 42, 0.9) 100%);
|
|
257
248
|
--chat-input-container-border-color: rgba(71, 85, 105, 0.88);
|
|
258
|
-
--chat-input-container-shadow: 0 20px 44px rgba(2, 6, 23, 0.42),
|
|
259
|
-
inset 0 1px 0 rgba(148, 163, 184, 0.1);
|
|
249
|
+
--chat-input-container-shadow: 0 20px 44px rgba(2, 6, 23, 0.42), inset 0 1px 0 rgba(148, 163, 184, 0.1);
|
|
260
250
|
--chat-input-text-color: #e2e8f0;
|
|
261
251
|
--chat-input-placeholder-color: #94a3b8;
|
|
262
252
|
--chat-input-action-color: #cbd5e1;
|
|
@@ -1487,10 +1477,7 @@
|
|
|
1487
1477
|
color: inherit;
|
|
1488
1478
|
cursor: pointer;
|
|
1489
1479
|
opacity: 0.85;
|
|
1490
|
-
transition:
|
|
1491
|
-
background 0.2s ease,
|
|
1492
|
-
opacity 0.2s ease,
|
|
1493
|
-
transform 0.2s ease;
|
|
1480
|
+
transition: background 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
|
|
1494
1481
|
}
|
|
1495
1482
|
|
|
1496
1483
|
.attachmentRemoveButton:hover {
|
|
@@ -2817,6 +2804,166 @@
|
|
|
2817
2804
|
color: #a16207;
|
|
2818
2805
|
}
|
|
2819
2806
|
|
|
2807
|
+
.agentProjectStatus {
|
|
2808
|
+
display: flex;
|
|
2809
|
+
align-items: center;
|
|
2810
|
+
gap: 8px;
|
|
2811
|
+
margin: 0 0 14px 0;
|
|
2812
|
+
font-size: 15px;
|
|
2813
|
+
font-weight: 600;
|
|
2814
|
+
}
|
|
2815
|
+
|
|
2816
|
+
.agentProjectStatusDot {
|
|
2817
|
+
width: 9px;
|
|
2818
|
+
height: 9px;
|
|
2819
|
+
border-radius: 999px;
|
|
2820
|
+
background: currentColor;
|
|
2821
|
+
flex: none;
|
|
2822
|
+
}
|
|
2823
|
+
|
|
2824
|
+
.agentProjectStatusRunning {
|
|
2825
|
+
color: #047857;
|
|
2826
|
+
}
|
|
2827
|
+
|
|
2828
|
+
.agentProjectStatusStopped {
|
|
2829
|
+
color: #64748b;
|
|
2830
|
+
}
|
|
2831
|
+
|
|
2832
|
+
.agentProjectLinks {
|
|
2833
|
+
display: flex;
|
|
2834
|
+
flex-direction: column;
|
|
2835
|
+
align-items: flex-start;
|
|
2836
|
+
gap: 8px;
|
|
2837
|
+
}
|
|
2838
|
+
|
|
2839
|
+
.agentProjectLink {
|
|
2840
|
+
color: #1d4ed8;
|
|
2841
|
+
font-size: 14px;
|
|
2842
|
+
font-weight: 600;
|
|
2843
|
+
text-decoration: none;
|
|
2844
|
+
word-break: break-word;
|
|
2845
|
+
}
|
|
2846
|
+
|
|
2847
|
+
.agentProjectLink:hover {
|
|
2848
|
+
text-decoration: underline;
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
.agentProjectChange {
|
|
2852
|
+
padding: 0 32px 8px;
|
|
2853
|
+
background: #fefefe;
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
.agentProjectChangeSummary {
|
|
2857
|
+
display: flex;
|
|
2858
|
+
flex-wrap: wrap;
|
|
2859
|
+
align-items: center;
|
|
2860
|
+
gap: 10px;
|
|
2861
|
+
margin-bottom: 12px;
|
|
2862
|
+
}
|
|
2863
|
+
|
|
2864
|
+
.agentProjectChangeCount {
|
|
2865
|
+
font-family: Consolas, 'Courier New', monospace;
|
|
2866
|
+
font-size: 13px;
|
|
2867
|
+
font-weight: 700;
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
.agentProjectChangeCountAdded {
|
|
2871
|
+
color: #047857;
|
|
2872
|
+
}
|
|
2873
|
+
|
|
2874
|
+
.agentProjectChangeCountRemoved {
|
|
2875
|
+
color: #b91c1c;
|
|
2876
|
+
}
|
|
2877
|
+
|
|
2878
|
+
.agentProjectCommit {
|
|
2879
|
+
font-family: Consolas, 'Courier New', monospace;
|
|
2880
|
+
font-size: 12px;
|
|
2881
|
+
color: #64748b;
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
.agentProjectChangedFiles {
|
|
2885
|
+
list-style: none;
|
|
2886
|
+
margin: 0 0 12px 0;
|
|
2887
|
+
padding: 0;
|
|
2888
|
+
display: flex;
|
|
2889
|
+
flex-direction: column;
|
|
2890
|
+
gap: 6px;
|
|
2891
|
+
max-height: 160px;
|
|
2892
|
+
overflow-y: auto;
|
|
2893
|
+
}
|
|
2894
|
+
|
|
2895
|
+
.agentProjectChangedFile {
|
|
2896
|
+
display: flex;
|
|
2897
|
+
align-items: baseline;
|
|
2898
|
+
justify-content: space-between;
|
|
2899
|
+
gap: 12px;
|
|
2900
|
+
font-size: 13px;
|
|
2901
|
+
}
|
|
2902
|
+
|
|
2903
|
+
.agentProjectChangedFilePath {
|
|
2904
|
+
font-family: Consolas, 'Courier New', monospace;
|
|
2905
|
+
color: #0f172a;
|
|
2906
|
+
word-break: break-all;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
.agentProjectChangedFileCounts {
|
|
2910
|
+
font-family: Consolas, 'Courier New', monospace;
|
|
2911
|
+
font-size: 12px;
|
|
2912
|
+
white-space: nowrap;
|
|
2913
|
+
}
|
|
2914
|
+
|
|
2915
|
+
.agentProjectDiff {
|
|
2916
|
+
border: 1px solid #e2e8f0;
|
|
2917
|
+
border-radius: 12px;
|
|
2918
|
+
overflow: hidden;
|
|
2919
|
+
background: #f8fafc;
|
|
2920
|
+
}
|
|
2921
|
+
|
|
2922
|
+
.agentProjectDiffCode {
|
|
2923
|
+
display: flex;
|
|
2924
|
+
flex-direction: column;
|
|
2925
|
+
margin: 0;
|
|
2926
|
+
padding: 12px 0;
|
|
2927
|
+
max-height: 320px;
|
|
2928
|
+
overflow: auto;
|
|
2929
|
+
font-family: Consolas, 'Courier New', monospace;
|
|
2930
|
+
font-size: 12px;
|
|
2931
|
+
line-height: 1.5;
|
|
2932
|
+
}
|
|
2933
|
+
|
|
2934
|
+
.agentProjectDiffLine {
|
|
2935
|
+
padding: 0 12px;
|
|
2936
|
+
white-space: pre;
|
|
2937
|
+
color: #334155;
|
|
2938
|
+
}
|
|
2939
|
+
|
|
2940
|
+
.agentProjectDiffLineAdded {
|
|
2941
|
+
background: rgba(16, 185, 129, 0.14);
|
|
2942
|
+
color: #065f46;
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
.agentProjectDiffLineRemoved {
|
|
2946
|
+
background: rgba(239, 68, 68, 0.12);
|
|
2947
|
+
color: #991b1b;
|
|
2948
|
+
}
|
|
2949
|
+
|
|
2950
|
+
.agentProjectDiffLineHunk {
|
|
2951
|
+
color: #6d28d9;
|
|
2952
|
+
background: rgba(109, 40, 217, 0.08);
|
|
2953
|
+
}
|
|
2954
|
+
|
|
2955
|
+
.agentProjectDiffLineMeta {
|
|
2956
|
+
color: #94a3b8;
|
|
2957
|
+
}
|
|
2958
|
+
|
|
2959
|
+
.agentProjectDiffTruncated {
|
|
2960
|
+
margin: 0;
|
|
2961
|
+
padding: 8px 12px;
|
|
2962
|
+
border-top: 1px solid #e2e8f0;
|
|
2963
|
+
font-size: 12px;
|
|
2964
|
+
color: #64748b;
|
|
2965
|
+
}
|
|
2966
|
+
|
|
2820
2967
|
.toolCallModeFooter {
|
|
2821
2968
|
display: flex;
|
|
2822
2969
|
justify-content: flex-end;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { spaceTrim } from 'spacetrim';
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
import type { Feature, GeoJsonObject, GeoJsonProperties, Geometry } from 'geojson';
|
|
6
5
|
import type { LatLng, Layer, Map as LeafletMap, Path, PathOptions } from 'leaflet';
|
|
7
6
|
import { Maximize2, X } from 'lucide-react';
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import { classNames } from '../../_common/react-utils/classNames';
|
|
3
|
+
import styles from './Chat.module.css';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Line prefixes of unified-diff metadata, which is shown dimmed instead of as a change.
|
|
7
|
+
*/
|
|
8
|
+
const AGENT_PROJECT_DIFF_META_LINE_PREFIXES = [
|
|
9
|
+
'diff ',
|
|
10
|
+
'index ',
|
|
11
|
+
'--- ',
|
|
12
|
+
'+++ ',
|
|
13
|
+
'new file',
|
|
14
|
+
'deleted file',
|
|
15
|
+
'old mode',
|
|
16
|
+
'new mode',
|
|
17
|
+
'similarity index',
|
|
18
|
+
'rename from',
|
|
19
|
+
'rename to',
|
|
20
|
+
'Binary files',
|
|
21
|
+
'\\ No newline',
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Renders one unified diff with added, removed and context lines told apart.
|
|
26
|
+
*
|
|
27
|
+
* @param options - Diff text and whether it holds only the beginning of the real diff.
|
|
28
|
+
* @returns Readable diff block.
|
|
29
|
+
*
|
|
30
|
+
* @private function of ChatToolCallModal
|
|
31
|
+
*/
|
|
32
|
+
export function renderAgentProjectDiff(options: {
|
|
33
|
+
readonly diff: string;
|
|
34
|
+
readonly isDiffTruncated: boolean;
|
|
35
|
+
}): ReactElement {
|
|
36
|
+
const diffLines = options.diff.split(/\r?\n/u);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<div className={styles.agentProjectDiff}>
|
|
40
|
+
<pre className={styles.agentProjectDiffCode}>
|
|
41
|
+
{diffLines.map((diffLine, diffLineIndex) => (
|
|
42
|
+
<span
|
|
43
|
+
key={`${diffLineIndex}-${diffLine}`}
|
|
44
|
+
className={classNames(styles.agentProjectDiffLine, resolveAgentProjectDiffLineStyle(diffLine))}
|
|
45
|
+
>
|
|
46
|
+
{diffLine === '' ? ' ' : diffLine}
|
|
47
|
+
</span>
|
|
48
|
+
))}
|
|
49
|
+
</pre>
|
|
50
|
+
{options.isDiffTruncated && (
|
|
51
|
+
<p className={styles.agentProjectDiffTruncated}>
|
|
52
|
+
The change is too large to show in full — open the project to see the rest.
|
|
53
|
+
</p>
|
|
54
|
+
)}
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Resolves the style of one diff line from its unified-diff prefix.
|
|
61
|
+
*
|
|
62
|
+
* @param diffLine - One raw diff line.
|
|
63
|
+
* @returns Class name of the line, or `undefined` for plain context lines.
|
|
64
|
+
*
|
|
65
|
+
* @private function of ChatToolCallModal
|
|
66
|
+
*/
|
|
67
|
+
function resolveAgentProjectDiffLineStyle(diffLine: string): string | undefined {
|
|
68
|
+
if (AGENT_PROJECT_DIFF_META_LINE_PREFIXES.some((metaLinePrefix) => diffLine.startsWith(metaLinePrefix))) {
|
|
69
|
+
return styles.agentProjectDiffLineMeta;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (diffLine.startsWith('@@')) {
|
|
73
|
+
return styles.agentProjectDiffLineHunk;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if (diffLine.startsWith('+')) {
|
|
77
|
+
return styles.agentProjectDiffLineAdded;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (diffLine.startsWith('-')) {
|
|
81
|
+
return styles.agentProjectDiffLineRemoved;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return undefined;
|
|
85
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { type ReactElement } from 'react';
|
|
2
|
+
import type { AgentMessageProjectChange } from '../../../utils/agent-message-runtime/AgentMessageProjectChange';
|
|
3
|
+
import { classNames } from '../../_common/react-utils/classNames';
|
|
4
|
+
import type { AgentProjectToolCallResult } from '../utils/agentProjectToolCall';
|
|
5
|
+
import { resolveAgentProjectToolCallLabel } from '../utils/agentProjectToolCall';
|
|
6
|
+
import styles from './Chat.module.css';
|
|
7
|
+
import { renderAgentProjectDiff } from './renderAgentProjectDiff';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Length of the commit hash shown in the change summary.
|
|
11
|
+
*/
|
|
12
|
+
const AGENT_PROJECT_COMMIT_HASH_DISPLAY_LENGTH = 7;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Renders the detail view of one project the answer worked with.
|
|
16
|
+
*
|
|
17
|
+
* The card answers the two questions a project chip raises: what this project is right now — its
|
|
18
|
+
* runtime state and where to open it — and what this very message did to it.
|
|
19
|
+
*
|
|
20
|
+
* @param options - Parsed project chip payload.
|
|
21
|
+
* @returns Project details section for the tool modal.
|
|
22
|
+
*
|
|
23
|
+
* @private function of ChatToolCallModal
|
|
24
|
+
*/
|
|
25
|
+
export function renderAgentProjectToolCallDetails(options: {
|
|
26
|
+
readonly project: AgentProjectToolCallResult;
|
|
27
|
+
}): ReactElement {
|
|
28
|
+
const { project } = options;
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<>
|
|
32
|
+
<header className={styles.toolCallHeader}>
|
|
33
|
+
<span className={styles.toolCallIcon} aria-hidden="true">
|
|
34
|
+
📁
|
|
35
|
+
</span>
|
|
36
|
+
<div className={styles.toolCallHeaderMeta}>
|
|
37
|
+
<p className={styles.toolCallModalLabel}>Project</p>
|
|
38
|
+
<h3 className={styles.toolCallTitle}>{resolveAgentProjectToolCallLabel(project)}</h3>
|
|
39
|
+
<p className={styles.toolCallSubtitle}>
|
|
40
|
+
{project.description || 'Here is what the agent worked with.'}
|
|
41
|
+
</p>
|
|
42
|
+
</div>
|
|
43
|
+
</header>
|
|
44
|
+
|
|
45
|
+
<div className={styles.toolCallGrid}>
|
|
46
|
+
{renderAgentProjectStatusPanel(project)}
|
|
47
|
+
{renderAgentProjectFactsPanel(project)}
|
|
48
|
+
</div>
|
|
49
|
+
|
|
50
|
+
{renderAgentProjectChangeSection(project.change)}
|
|
51
|
+
</>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Renders the runtime state of the project together with the ways to open it.
|
|
57
|
+
*
|
|
58
|
+
* @param project - Parsed project chip payload.
|
|
59
|
+
* @returns Status panel.
|
|
60
|
+
*
|
|
61
|
+
* @private function of ChatToolCallModal
|
|
62
|
+
*/
|
|
63
|
+
function renderAgentProjectStatusPanel(project: AgentProjectToolCallResult): ReactElement {
|
|
64
|
+
const isRunning = project.isRunning === true;
|
|
65
|
+
// Note: A chip written before projects reported their state knows nothing, which must not be
|
|
66
|
+
// shown as a project that is stopped
|
|
67
|
+
const isRuntimeStateKnown = project.isRunning !== undefined || project.runtimeStatusLabel !== undefined;
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<section className={styles.toolCallPanel}>
|
|
71
|
+
<p className={styles.toolCallPanelTitle}>Status</p>
|
|
72
|
+
{isRuntimeStateKnown && (
|
|
73
|
+
<p
|
|
74
|
+
className={classNames(
|
|
75
|
+
styles.agentProjectStatus,
|
|
76
|
+
isRunning ? styles.agentProjectStatusRunning : styles.agentProjectStatusStopped,
|
|
77
|
+
)}
|
|
78
|
+
>
|
|
79
|
+
<span className={styles.agentProjectStatusDot} aria-hidden="true" />
|
|
80
|
+
{project.runtimeStatusLabel || (isRunning ? 'Running' : 'Not running')}
|
|
81
|
+
</p>
|
|
82
|
+
)}
|
|
83
|
+
<div className={styles.agentProjectLinks}>
|
|
84
|
+
{project.projectUrl && (
|
|
85
|
+
<a
|
|
86
|
+
className={styles.agentProjectLink}
|
|
87
|
+
href={project.projectUrl}
|
|
88
|
+
target="_blank"
|
|
89
|
+
rel="noreferrer"
|
|
90
|
+
title={
|
|
91
|
+
isRunning
|
|
92
|
+
? 'Open the project in a new tab'
|
|
93
|
+
: 'The project must run before it can be opened.'
|
|
94
|
+
}
|
|
95
|
+
>
|
|
96
|
+
Open the project ↗
|
|
97
|
+
</a>
|
|
98
|
+
)}
|
|
99
|
+
{project.projectHref && (
|
|
100
|
+
<a className={styles.agentProjectLink} href={project.projectHref} target="_blank" rel="noreferrer">
|
|
101
|
+
Open the project page ↗
|
|
102
|
+
</a>
|
|
103
|
+
)}
|
|
104
|
+
</div>
|
|
105
|
+
</section>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Renders the project facts shown in the header of the project page.
|
|
111
|
+
*
|
|
112
|
+
* @param project - Parsed project chip payload.
|
|
113
|
+
* @returns Facts panel.
|
|
114
|
+
*
|
|
115
|
+
* @private function of ChatToolCallModal
|
|
116
|
+
*/
|
|
117
|
+
function renderAgentProjectFactsPanel(project: AgentProjectToolCallResult): ReactElement {
|
|
118
|
+
return (
|
|
119
|
+
<section className={styles.toolCallPanel}>
|
|
120
|
+
<p className={styles.toolCallPanelTitle}>Project</p>
|
|
121
|
+
<ul className={styles.toolCallList}>
|
|
122
|
+
<li className={styles.toolCallItem}>
|
|
123
|
+
<span className={styles.toolCallItemLabel}>Folder</span>
|
|
124
|
+
<span className={styles.toolCallItemValue}>{project.projectName}</span>
|
|
125
|
+
</li>
|
|
126
|
+
{project.sizeLabel && (
|
|
127
|
+
<li className={styles.toolCallItem}>
|
|
128
|
+
<span className={styles.toolCallItemLabel}>Size</span>
|
|
129
|
+
<span className={styles.toolCallItemValue}>
|
|
130
|
+
{project.sizeLabel}
|
|
131
|
+
{typeof project.fileCount === 'number' &&
|
|
132
|
+
` in ${project.fileCount} ${project.fileCount === 1 ? 'file' : 'files'}`}
|
|
133
|
+
</span>
|
|
134
|
+
</li>
|
|
135
|
+
)}
|
|
136
|
+
{project.isGitRepository !== undefined && (
|
|
137
|
+
<li className={styles.toolCallItem}>
|
|
138
|
+
<span className={styles.toolCallItemLabel}>Version control</span>
|
|
139
|
+
<span className={styles.toolCallItemValue}>
|
|
140
|
+
{project.isGitRepository ? 'Git repository' : 'Not a git repository'}
|
|
141
|
+
</span>
|
|
142
|
+
</li>
|
|
143
|
+
)}
|
|
144
|
+
</ul>
|
|
145
|
+
</section>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Renders what this very message changed in the project.
|
|
151
|
+
*
|
|
152
|
+
* @param change - Commit the answered message created, when it changed anything.
|
|
153
|
+
* @returns Change section.
|
|
154
|
+
*
|
|
155
|
+
* @private function of ChatToolCallModal
|
|
156
|
+
*/
|
|
157
|
+
function renderAgentProjectChangeSection(change: AgentMessageProjectChange | undefined): ReactElement {
|
|
158
|
+
if (!change) {
|
|
159
|
+
return (
|
|
160
|
+
<div className={styles.agentProjectChange}>
|
|
161
|
+
<p className={styles.toolCallPanelTitle}>Changes in this message</p>
|
|
162
|
+
<p className={styles.toolCallEmpty}>This message did not change anything in the project.</p>
|
|
163
|
+
</div>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
return (
|
|
168
|
+
<div className={styles.agentProjectChange}>
|
|
169
|
+
<p className={styles.toolCallPanelTitle}>Changes in this message</p>
|
|
170
|
+
<div className={styles.agentProjectChangeSummary}>
|
|
171
|
+
<span className={styles.toolCallSummaryMetaBadge}>
|
|
172
|
+
{change.changedFiles.length} {change.changedFiles.length === 1 ? 'file' : 'files'}
|
|
173
|
+
</span>
|
|
174
|
+
<span className={classNames(styles.agentProjectChangeCount, styles.agentProjectChangeCountAdded)}>
|
|
175
|
+
+{change.insertionCount}
|
|
176
|
+
</span>
|
|
177
|
+
<span className={classNames(styles.agentProjectChangeCount, styles.agentProjectChangeCountRemoved)}>
|
|
178
|
+
−{change.deletionCount}
|
|
179
|
+
</span>
|
|
180
|
+
<span className={styles.agentProjectCommit}>
|
|
181
|
+
commit {change.commitHash.slice(0, AGENT_PROJECT_COMMIT_HASH_DISPLAY_LENGTH)} ·{' '}
|
|
182
|
+
{new Date(change.committedAt).toLocaleString()}
|
|
183
|
+
</span>
|
|
184
|
+
</div>
|
|
185
|
+
{change.changedFiles.length > 0 && (
|
|
186
|
+
<ul className={styles.agentProjectChangedFiles}>
|
|
187
|
+
{change.changedFiles.map((changedFile) => (
|
|
188
|
+
<li key={changedFile.path} className={styles.agentProjectChangedFile}>
|
|
189
|
+
<span className={styles.agentProjectChangedFilePath}>{changedFile.path}</span>
|
|
190
|
+
<span className={styles.agentProjectChangedFileCounts}>
|
|
191
|
+
<span className={styles.agentProjectChangeCountAdded}>
|
|
192
|
+
+{changedFile.insertionCount}
|
|
193
|
+
</span>{' '}
|
|
194
|
+
<span className={styles.agentProjectChangeCountRemoved}>
|
|
195
|
+
−{changedFile.deletionCount}
|
|
196
|
+
</span>
|
|
197
|
+
</span>
|
|
198
|
+
</li>
|
|
199
|
+
))}
|
|
200
|
+
</ul>
|
|
201
|
+
)}
|
|
202
|
+
{change.diff.trim().length > 0 &&
|
|
203
|
+
renderAgentProjectDiff({ diff: change.diff, isDiffTruncated: change.isDiffTruncated })}
|
|
204
|
+
</div>
|
|
205
|
+
);
|
|
206
|
+
}
|
|
@@ -5,6 +5,7 @@ import type { WithTake } from '../../../utils/take/interfaces/ITakeChain';
|
|
|
5
5
|
import { classNames } from '../../_common/react-utils/classNames';
|
|
6
6
|
import type { ChatMessage } from '../types/ChatMessage';
|
|
7
7
|
import type { ChatParticipant } from '../types/ChatParticipant';
|
|
8
|
+
import { AGENT_PROJECT_TOOL_CALL_NAME, parseAgentProjectToolCallResult } from '../utils/agentProjectToolCall';
|
|
8
9
|
import { getToolCallChipletInfo, TOOL_TITLES } from '../utils/getToolCallChipletInfo';
|
|
9
10
|
import { resolveToolCallState } from '../utils/resolveToolCallState';
|
|
10
11
|
import { isTimeoutToolCallName } from '../utils/timeoutToolCallPresentation';
|
|
@@ -16,6 +17,7 @@ import {
|
|
|
16
17
|
WALLET_CREDENTIAL_TOOL_CALL_NAME,
|
|
17
18
|
} from '../utils/walletCredentialToolCall';
|
|
18
19
|
import styles from './Chat.module.css';
|
|
20
|
+
import { renderAgentProjectToolCallDetails } from './renderAgentProjectToolCallDetails';
|
|
19
21
|
import { renderEmailToolCallDetails } from './renderEmailToolCallDetails';
|
|
20
22
|
import { renderMemoryToolCallDetails } from './renderMemoryToolCallDetails';
|
|
21
23
|
import { renderPopupToolCallDetails } from './renderPopupToolCallDetails';
|
|
@@ -125,6 +127,12 @@ export function renderToolCallDetails(options: ToolCallDetailsOptions): ReactEle
|
|
|
125
127
|
return memoryView;
|
|
126
128
|
}
|
|
127
129
|
|
|
130
|
+
const agentProjectResult =
|
|
131
|
+
toolCall.name === AGENT_PROJECT_TOOL_CALL_NAME ? parseAgentProjectToolCallResult(resultRaw) : null;
|
|
132
|
+
if (agentProjectResult) {
|
|
133
|
+
return renderAgentProjectToolCallDetails({ project: agentProjectResult });
|
|
134
|
+
}
|
|
135
|
+
|
|
128
136
|
const walletCredentialResult =
|
|
129
137
|
toolCall.name === WALLET_CREDENTIAL_TOOL_CALL_NAME ? parseWalletCredentialToolCallResult(resultRaw) : null;
|
|
130
138
|
if (walletCredentialResult) {
|
|
@@ -314,9 +314,8 @@ export const MarkdownContent = memo(function MarkdownContent(props: MarkdownCont
|
|
|
314
314
|
containerElement.addEventListener('click', handleSummaryClick);
|
|
315
315
|
containerElement.addEventListener('click', handleInlineReferenceMenuActionClick);
|
|
316
316
|
|
|
317
|
-
const inlineReferenceIconImages =
|
|
318
|
-
INLINE_REFERENCE_ICON_SELECTOR
|
|
319
|
-
);
|
|
317
|
+
const inlineReferenceIconImages =
|
|
318
|
+
containerElement.querySelectorAll<HTMLImageElement>(INLINE_REFERENCE_ICON_SELECTOR);
|
|
320
319
|
const handleInlineReferenceIconError = (event: Event) => {
|
|
321
320
|
if (event.currentTarget instanceof HTMLImageElement) {
|
|
322
321
|
event.currentTarget.hidden = true;
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import type { AgentMessageProjectChange } from '../../../utils/agent-message-runtime/AgentMessageProjectChange';
|
|
2
|
+
import { normalizeAgentMessageProjectChange } from '../../../utils/agent-message-runtime/AgentMessageProjectChange';
|
|
3
|
+
|
|
1
4
|
/**
|
|
2
5
|
* Synthetic tool name used for agent-project chips in chat UI.
|
|
3
6
|
*
|
|
@@ -11,6 +14,9 @@ export const AGENT_PROJECT_TOOL_CALL_NAME = 'agent_project_touched';
|
|
|
11
14
|
/**
|
|
12
15
|
* Safe, user-facing metadata shown in agent-project chips.
|
|
13
16
|
*
|
|
17
|
+
* Everything besides the project name is optional, because a chip written by an older server — or
|
|
18
|
+
* one whose project has meanwhile been deleted — still has to render.
|
|
19
|
+
*
|
|
14
20
|
* @private internal chat-ui type for touched agent projects
|
|
15
21
|
*/
|
|
16
22
|
export type AgentProjectToolCallResult = {
|
|
@@ -24,10 +30,53 @@ export type AgentProjectToolCallResult = {
|
|
|
24
30
|
*/
|
|
25
31
|
readonly displayName?: string;
|
|
26
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Short project description, resolved the same way as on the project page.
|
|
35
|
+
*/
|
|
36
|
+
readonly description?: string;
|
|
37
|
+
|
|
27
38
|
/**
|
|
28
39
|
* Link to the project page, when the chat knows where the project lives.
|
|
29
40
|
*/
|
|
30
41
|
readonly projectHref?: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Address the running project itself is served on, when it has one.
|
|
45
|
+
*/
|
|
46
|
+
readonly projectUrl?: string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Whether the project was running when the answer finished.
|
|
50
|
+
*/
|
|
51
|
+
readonly isRunning?: boolean;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Runtime status label, the same one the project page shows.
|
|
55
|
+
*/
|
|
56
|
+
readonly runtimeStatusLabel?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Total size of the project, already formatted for display.
|
|
60
|
+
*/
|
|
61
|
+
readonly sizeLabel?: string;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Count of files inside the project.
|
|
65
|
+
*/
|
|
66
|
+
readonly fileCount?: number;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Whether the project folder is a git repository.
|
|
70
|
+
*/
|
|
71
|
+
readonly isGitRepository?: boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* What this very message changed in the project, when it changed anything.
|
|
75
|
+
*
|
|
76
|
+
* Its `projectName` repeats the one above because the change is reported by the agent runner
|
|
77
|
+
* in exactly this shape, and reusing it keeps the two descriptions from drifting apart.
|
|
78
|
+
*/
|
|
79
|
+
readonly change?: AgentMessageProjectChange;
|
|
31
80
|
};
|
|
32
81
|
|
|
33
82
|
/**
|
|
@@ -48,17 +97,45 @@ export function parseAgentProjectToolCallResult(result: unknown): AgentProjectTo
|
|
|
48
97
|
return null;
|
|
49
98
|
}
|
|
50
99
|
|
|
100
|
+
const change = normalizeAgentMessageProjectChange(candidate.change);
|
|
101
|
+
|
|
51
102
|
return {
|
|
52
103
|
projectName: candidate.projectName.trim(),
|
|
53
|
-
...(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
...(
|
|
57
|
-
|
|
104
|
+
...pickTrimmedText('displayName', candidate.displayName),
|
|
105
|
+
...pickTrimmedText('description', candidate.description),
|
|
106
|
+
...pickTrimmedText('projectHref', candidate.projectHref),
|
|
107
|
+
...pickTrimmedText('projectUrl', candidate.projectUrl),
|
|
108
|
+
...pickTrimmedText('runtimeStatusLabel', candidate.runtimeStatusLabel),
|
|
109
|
+
...pickTrimmedText('sizeLabel', candidate.sizeLabel),
|
|
110
|
+
...(typeof candidate.isRunning === 'boolean' ? { isRunning: candidate.isRunning } : {}),
|
|
111
|
+
...(typeof candidate.isGitRepository === 'boolean' ? { isGitRepository: candidate.isGitRepository } : {}),
|
|
112
|
+
...(typeof candidate.fileCount === 'number' && Number.isFinite(candidate.fileCount) && candidate.fileCount >= 0
|
|
113
|
+
? { fileCount: candidate.fileCount }
|
|
58
114
|
: {}),
|
|
115
|
+
...(change ? { change } : {}),
|
|
59
116
|
};
|
|
60
117
|
}
|
|
61
118
|
|
|
119
|
+
/**
|
|
120
|
+
* Keeps one optional text field only when it carries content.
|
|
121
|
+
*
|
|
122
|
+
* @param fieldName - Name of the payload field.
|
|
123
|
+
* @param value - Raw field value.
|
|
124
|
+
* @returns Object holding the trimmed field, or an empty object.
|
|
125
|
+
*
|
|
126
|
+
* @private internal helper of `parseAgentProjectToolCallResult`
|
|
127
|
+
*/
|
|
128
|
+
function pickTrimmedText<TFieldName extends string>(
|
|
129
|
+
fieldName: TFieldName,
|
|
130
|
+
value: unknown,
|
|
131
|
+
): Partial<Record<TFieldName, string>> {
|
|
132
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
133
|
+
return {};
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return { [fieldName]: value.trim() } as Record<TFieldName, string>;
|
|
137
|
+
}
|
|
138
|
+
|
|
62
139
|
/**
|
|
63
140
|
* Resolves the chip label of one touched agent project.
|
|
64
141
|
*
|