@taskforcehq/taskforce 0.3.324 → 0.3.327
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/LICENSE.md +68 -0
- package/README.md +19 -0
- package/dist/Taskforce.module.css +2191 -540
- package/dist/TaskforceCore.d.ts +1 -0
- package/dist/TaskforceCore.js +65 -22
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.d.ts +1 -0
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.js +3 -2
- package/dist/annotatedAttachments/commandService.d.ts +68 -0
- package/dist/annotatedAttachments/commandService.js +348 -0
- package/dist/annotatedAttachments/service.d.ts +2 -0
- package/dist/annotatedAttachments/service.js +13 -12
- package/dist/cli.js +158 -9
- package/dist/cliOpenPort.d.ts +1 -0
- package/dist/cliOpenPort.js +4 -0
- package/dist/compat/taskforceAgentDefinitionCompat.d.ts +12 -0
- package/dist/compat/taskforceAgentDefinitionCompat.js +25 -0
- package/dist/compat/workspaceSyncCompat.js +6 -2
- package/dist/compat/workspaceSyncV3CombinedCoverageCompat.d.ts +6 -0
- package/dist/compat/workspaceSyncV3CombinedCoverageCompat.js +22 -0
- package/dist/compat/workspaceSyncV3OperationCompat.d.ts +7 -0
- package/dist/compat/workspaceSyncV3OperationCompat.js +30 -0
- package/dist/components/activity/EntityActivityTimeline.d.ts +10 -2
- package/dist/components/activity/EntityActivityTimeline.js +73 -35
- package/dist/components/context/AttachmentPreviewHost.d.ts +6 -0
- package/dist/components/context/AttachmentPreviewHost.js +222 -0
- package/dist/components/context/ContextAttachmentManager.d.ts +4 -0
- package/dist/components/context/ContextAttachmentManager.js +418 -208
- package/dist/components/features/AiProfilesModule.d.ts +24 -0
- package/dist/components/features/AiProfilesModule.js +744 -0
- package/dist/components/features/AnnotatedAttachmentWorkspace.d.ts +4 -1
- package/dist/components/features/AnnotatedAttachmentWorkspace.js +351 -79
- package/dist/components/features/DocumentGenerateModal.js +23 -5
- package/dist/components/features/DocumentIndex.d.ts +19 -1
- package/dist/components/features/DocumentIndex.js +104 -15
- package/dist/components/features/DocumentViewer.d.ts +9 -1
- package/dist/components/features/DocumentViewer.js +721 -100
- package/dist/components/features/DocumentWorkspace.d.ts +37 -2
- package/dist/components/features/DocumentWorkspace.js +21 -6
- package/dist/components/features/TaskSettings.d.ts +6 -27
- package/dist/components/features/TaskSettings.js +257 -151
- package/dist/components/features/TaskforceAgentsModule.d.ts +36 -0
- package/dist/components/features/TaskforceAgentsModule.js +1782 -0
- package/dist/components/features/agentBehavior/AgentBehaviorManagerShared.d.ts +94 -0
- package/dist/components/features/agentBehavior/AgentBehaviorManagerShared.js +70 -0
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.d.ts +65 -0
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.js +115 -0
- package/dist/components/features/agentRoles/RoleManagerPanel.d.ts +4 -0
- package/dist/components/features/agentRoles/RoleManagerPanel.js +382 -0
- package/dist/components/features/agentSkills/SkillManagerPanel.d.ts +5 -0
- package/dist/components/features/agentSkills/SkillManagerPanel.js +355 -0
- package/dist/components/features/documentWorkspaceModel.d.ts +16 -4
- package/dist/components/features/documentWorkspaceModel.js +30 -5
- package/dist/components/features/planning/PlanningArchiveConfirmation.d.ts +9 -0
- package/dist/components/features/planning/PlanningArchiveConfirmation.js +19 -0
- package/dist/components/features/planning/PlanningCardIdentity.d.ts +12 -0
- package/dist/components/features/planning/PlanningCardIdentity.js +44 -0
- package/dist/components/features/planning/PlanningEntityDetails.d.ts +36 -0
- package/dist/components/features/planning/PlanningEntityDetails.js +131 -0
- package/dist/components/features/planning/PlanningEntitySummary.d.ts +44 -0
- package/dist/components/features/planning/PlanningEntitySummary.js +97 -0
- package/dist/components/features/planning/PlanningLinkPicker.d.ts +9 -0
- package/dist/components/features/planning/PlanningLinkPicker.js +26 -0
- package/dist/components/features/planning/PlanningModule.d.ts +6 -0
- package/dist/components/features/planning/PlanningModule.js +571 -0
- package/dist/components/features/planning/PlanningOwnerDropdown.d.ts +27 -0
- package/dist/components/features/planning/PlanningOwnerDropdown.js +80 -0
- package/dist/components/features/planning/PlanningTaskArrangeControl.d.ts +5 -0
- package/dist/components/features/planning/PlanningTaskArrangeControl.js +11 -0
- package/dist/components/features/planning/PlanningTaskCard.d.ts +20 -0
- package/dist/components/features/planning/PlanningTaskCard.js +26 -0
- package/dist/components/features/planning/PlanningTaskOrderList.d.ts +10 -0
- package/dist/components/features/planning/PlanningTaskOrderList.js +52 -0
- package/dist/components/features/planning/PlanningUnlinkConfirmation.d.ts +15 -0
- package/dist/components/features/planning/PlanningUnlinkConfirmation.js +7 -0
- package/dist/components/features/planning/planningCreateIntent.d.ts +10 -0
- package/dist/components/features/planning/planningCreateIntent.js +16 -0
- package/dist/components/features/planning/planningNavigator.d.ts +33 -0
- package/dist/components/features/planning/planningNavigator.js +96 -0
- package/dist/components/features/planning/planningTaskArrangement.d.ts +18 -0
- package/dist/components/features/planning/planningTaskArrangement.js +106 -0
- package/dist/components/features/planning/planningWorkspaceModel.d.ts +121 -0
- package/dist/components/features/planning/planningWorkspaceModel.js +5 -0
- package/dist/components/features/settings/CategoryManager.js +2 -2
- package/dist/components/features/settings/TaxonomyEditor.js +1 -1
- package/dist/components/features/settings/TaxonomyManager.js +1 -1
- package/dist/components/features/settings/TypeManager.js +1 -1
- package/dist/components/features/taskforceAgentAssignments/AgentBehaviorAssignments.d.ts +10 -0
- package/dist/components/features/taskforceAgentAssignments/AgentBehaviorAssignments.js +175 -0
- package/dist/components/features/taskforceAgentAssignments/agentBehaviorCatalogApi.d.ts +27 -0
- package/dist/components/features/taskforceAgentAssignments/agentBehaviorCatalogApi.js +24 -0
- package/dist/components/features/taskforceAgentEditorModel.d.ts +109 -0
- package/dist/components/features/taskforceAgentEditorModel.js +145 -0
- package/dist/components/features/useDocumentWorkspaceController.d.ts +20 -1
- package/dist/components/features/useDocumentWorkspaceController.js +106 -21
- package/dist/components/features/workflowManager/WorkflowManagerModule.d.ts +11 -0
- package/dist/components/features/workflowManager/WorkflowManagerModule.js +313 -0
- package/dist/components/features/workflowManager/WorkflowPublishDialog.d.ts +11 -0
- package/dist/components/features/workflowManager/WorkflowPublishDialog.js +8 -0
- package/dist/components/features/workflowManager/types.d.ts +74 -0
- package/dist/components/features/workflowManager/types.js +1 -0
- package/dist/components/features/workflowManager/useWorkflowManager.d.ts +30 -0
- package/dist/components/features/workflowManager/useWorkflowManager.js +213 -0
- package/dist/components/features/workflowManager/workflowManagerApi.d.ts +52 -0
- package/dist/components/features/workflowManager/workflowManagerApi.js +142 -0
- package/dist/components/task/TaskActionHeader.d.ts +6 -3
- package/dist/components/task/TaskActionHeader.js +46 -53
- package/dist/components/task/TaskCard.d.ts +10 -2
- package/dist/components/task/TaskCard.js +103 -54
- package/dist/components/task/TaskContextUpload.d.ts +1 -0
- package/dist/components/task/TaskContextUpload.js +3 -2
- package/dist/components/task/TaskForm.d.ts +12 -17
- package/dist/components/task/TaskForm.js +544 -199
- package/dist/components/task/TaskImageReviews.d.ts +8 -0
- package/dist/components/task/TaskImageReviews.js +47 -0
- package/dist/components/task/TaskKanban.d.ts +11 -12
- package/dist/components/task/TaskKanban.js +70 -18
- package/dist/components/task/TaskList.d.ts +9 -8
- package/dist/components/task/TaskList.js +46 -32
- package/dist/components/task/TaskReferenceBadge.d.ts +2 -1
- package/dist/components/task/TaskReferenceBadge.js +3 -2
- package/dist/components/task/TaskStatusActions.d.ts +3 -1
- package/dist/components/task/TaskStatusActions.js +17 -6
- package/dist/components/task/TaskWorkflowAssignmentField.d.ts +18 -0
- package/dist/components/task/TaskWorkflowAssignmentField.js +362 -0
- package/dist/components/task/TaskWorkstreamPicker.d.ts +8 -0
- package/dist/components/task/TaskWorkstreamPicker.js +24 -0
- package/dist/components/task/TrashRestoreControls.d.ts +18 -0
- package/dist/components/task/TrashRestoreControls.js +71 -0
- package/dist/components/ui/AiIdentityRosterCard.d.ts +20 -0
- package/dist/components/ui/AiIdentityRosterCard.js +5 -0
- package/dist/components/ui/AssetTraySortControl.d.ts +10 -0
- package/dist/components/ui/AssetTraySortControl.js +38 -0
- package/dist/components/ui/AssigneeIdentity.d.ts +12 -0
- package/dist/components/ui/AssigneeIdentity.js +41 -0
- package/dist/components/ui/DiscardChangesDialog.d.ts +10 -0
- package/dist/components/ui/DiscardChangesDialog.js +7 -0
- package/dist/components/ui/DisclosureSectionHeader.d.ts +4 -1
- package/dist/components/ui/DisclosureSectionHeader.js +2 -2
- package/dist/components/ui/EditableAvatarButton.d.ts +6 -1
- package/dist/components/ui/EditableAvatarButton.js +6 -5
- package/dist/components/ui/HierarchyActionBadge.d.ts +2 -1
- package/dist/components/ui/HierarchyActionBadge.js +2 -2
- package/dist/components/ui/Markdown.d.ts +13 -3
- package/dist/components/ui/Markdown.fixture.d.ts +1 -0
- package/dist/components/ui/Markdown.fixture.js +23 -0
- package/dist/components/ui/Markdown.js +158 -68
- package/dist/components/ui/Modal.d.ts +3 -1
- package/dist/components/ui/Modal.js +85 -19
- package/dist/components/ui/MultiSelectFilter.d.ts +9 -2
- package/dist/components/ui/MultiSelectFilter.js +26 -5
- package/dist/components/ui/ReferenceBadgeButton.js +2 -3
- package/dist/components/ui/TaxonomyDropdown.d.ts +10 -1
- package/dist/components/ui/TaxonomyDropdown.js +149 -58
- package/dist/components/ui/TopNoticeLayer.d.ts +2 -1
- package/dist/components/ui/TopNoticeLayer.js +5 -2
- package/dist/components/ui/useFallbackImageUrl.d.ts +4 -0
- package/dist/components/ui/useFallbackImageUrl.js +20 -0
- package/dist/components/views/AppShellHeader.js +2 -2
- package/dist/components/views/StandaloneLayout.d.ts +1 -0
- package/dist/components/views/StandaloneLayout.js +1684 -620
- package/dist/components/views/WidgetView.d.ts +1 -0
- package/dist/components/views/WidgetView.js +95 -30
- package/dist/components/views/chrome/WorkspaceChromeSections.d.ts +4 -2
- package/dist/components/views/chrome/WorkspaceChromeSections.js +3 -6
- package/dist/components/views/chrome/workspaceChrome.d.ts +5 -8
- package/dist/components/views/chrome/workspaceChrome.js +62 -27
- package/dist/components/views/panels/FilterToolbar.d.ts +4 -3
- package/dist/components/views/panels/FilterToolbar.js +8 -5
- package/dist/components/views/panels/FilterToolbarControls.d.ts +11 -2
- package/dist/components/views/panels/FilterToolbarControls.js +35 -20
- package/dist/components/views/panels/PlanningDrawer.d.ts +62 -51
- package/dist/components/views/panels/PlanningDrawer.js +993 -314
- package/dist/components/views/planningScope.d.ts +4 -0
- package/dist/components/views/planningScope.js +12 -1
- package/dist/components/views/standalone/modals/AccountSettingsModal.d.ts +62 -0
- package/dist/components/views/standalone/modals/AccountSettingsModal.js +197 -0
- package/dist/components/views/standalone/modals/AvatarImageManagerModal.d.ts +7 -2
- package/dist/components/views/standalone/modals/AvatarImageManagerModal.js +56 -9
- package/dist/components/views/standalone/modals/HelpModal.d.ts +1 -2
- package/dist/components/views/standalone/modals/HelpModal.js +3 -4
- package/dist/components/views/standalone/modals/SyncStatusModal.d.ts +8 -9
- package/dist/components/views/standalone/modals/SyncStatusModal.js +85 -25
- package/dist/components/views/standalone/modals/TeamManagementModal.js +1 -1
- package/dist/config/applicationBaseUrl.d.ts +2 -0
- package/dist/config/applicationBaseUrl.js +23 -0
- package/dist/config/envSchema.d.ts +1 -1
- package/dist/config/envSchema.js +166 -5
- package/dist/core/AdminAuditRetentionService.d.ts +43 -0
- package/dist/core/AdminAuditRetentionService.js +126 -0
- package/dist/core/AiProfileService.d.ts +34 -0
- package/dist/core/AiProfileService.js +516 -252
- package/dist/core/AttachmentLinkService.d.ts +10 -2
- package/dist/core/AttachmentLinkService.js +44 -12
- package/dist/core/AuthIdentityService.d.ts +6 -0
- package/dist/core/AuthIdentityService.js +38 -0
- package/dist/core/AuthTokenService.d.ts +1 -0
- package/dist/core/AuthTokenService.js +13 -0
- package/dist/core/DeletedTaskLifecycleService.d.ts +4 -2
- package/dist/core/DeletedTaskLifecycleService.js +124 -38
- package/dist/core/GlobalSettingsService.d.ts +3 -1
- package/dist/core/GlobalSettingsService.js +30 -4
- package/dist/core/InitiativeDurableMutationService.d.ts +89 -0
- package/dist/core/InitiativeDurableMutationService.js +187 -0
- package/dist/core/McpTokenService.d.ts +1 -0
- package/dist/core/McpTokenService.js +39 -13
- package/dist/core/PlanningCommandPreparationService.d.ts +60 -0
- package/dist/core/PlanningCommandPreparationService.js +149 -0
- package/dist/core/ScheduleCommandService.d.ts +76 -0
- package/dist/core/ScheduleCommandService.js +165 -0
- package/dist/core/SyncReconciliationService.d.ts +29 -6
- package/dist/core/SyncReconciliationService.js +256 -84
- package/dist/core/TaskActivityService.d.ts +22 -2
- package/dist/core/TaskActivityService.js +177 -29
- package/dist/core/TaskAttachmentLinksDurableMutationService.d.ts +31 -0
- package/dist/core/TaskAttachmentLinksDurableMutationService.js +231 -0
- package/dist/core/TaskChecklistCommandService.d.ts +50 -0
- package/dist/core/TaskChecklistCommandService.js +111 -0
- package/dist/core/TaskDurableCreateMutationService.d.ts +38 -0
- package/dist/core/TaskDurableCreateMutationService.js +85 -0
- package/dist/core/TaskDurableDeleteMutationService.d.ts +47 -0
- package/dist/core/TaskDurableDeleteMutationService.js +54 -0
- package/dist/core/TaskDurableLifecycleMutationService.d.ts +38 -0
- package/dist/core/TaskDurableLifecycleMutationService.js +42 -0
- package/dist/core/TaskDurableRelationshipMutationService.d.ts +58 -0
- package/dist/core/TaskDurableRelationshipMutationService.js +66 -0
- package/dist/core/TaskDurableRestoreMutationService.d.ts +31 -0
- package/dist/core/TaskDurableRestoreMutationService.js +33 -0
- package/dist/core/TaskDurableStatusMutationService.d.ts +74 -0
- package/dist/core/TaskDurableStatusMutationService.js +247 -0
- package/dist/core/TaskDurableSyncMutationService.d.ts +34 -0
- package/dist/core/TaskDurableSyncMutationService.js +70 -0
- package/dist/core/TaskDurableWorkflowMutationService.d.ts +48 -0
- package/dist/core/TaskDurableWorkflowMutationService.js +59 -0
- package/dist/core/TaskLifecycleCommandService.d.ts +101 -0
- package/dist/core/TaskLifecycleCommandService.js +161 -0
- package/dist/core/TaskRootCommandPreparationService.d.ts +35 -0
- package/dist/core/TaskRootCommandPreparationService.js +103 -0
- package/dist/core/Taskforce.d.ts +479 -59
- package/dist/core/Taskforce.js +3671 -841
- package/dist/core/WorkflowAssignmentService.d.ts +40 -0
- package/dist/core/WorkflowAssignmentService.js +158 -0
- package/dist/core/WorkflowExecutionService.d.ts +69 -0
- package/dist/core/WorkflowExecutionService.js +342 -0
- package/dist/core/WorkflowTaskActivationService.d.ts +32 -0
- package/dist/core/WorkflowTaskActivationService.js +63 -0
- package/dist/core/WorkflowTemplateService.d.ts +64 -0
- package/dist/core/WorkflowTemplateService.js +223 -0
- package/dist/core/WorkspaceLifecycleService.d.ts +1 -0
- package/dist/core/WorkspaceLifecycleService.js +18 -0
- package/dist/core/WorkstreamDurableMutationService.d.ts +90 -0
- package/dist/core/WorkstreamDurableMutationService.js +184 -0
- package/dist/core/planningReferencePolicy.d.ts +14 -0
- package/dist/core/planningReferencePolicy.js +53 -0
- package/dist/core/taskReferencePolicy.js +24 -3
- package/dist/core/types.d.ts +10 -10
- package/dist/documentReviews/DocumentReviewCommentStore.d.ts +22 -2
- package/dist/documentReviews/DocumentReviewCommentStore.js +92 -8
- package/dist/documentReviews/commandService.d.ts +51 -0
- package/dist/documentReviews/commandService.js +63 -0
- package/dist/documentReviews/service.d.ts +20 -1
- package/dist/documentReviews/service.js +234 -24
- package/dist/documentReviews/types.d.ts +18 -1
- package/dist/hooks/sync/bootstrap.d.ts +3 -7
- package/dist/hooks/sync/bootstrap.js +6 -14
- package/dist/hooks/sync/browserSyncAuthority.d.ts +21 -0
- package/dist/hooks/sync/browserSyncAuthority.js +70 -0
- package/dist/hooks/sync/browserSyncRemoteServices.d.ts +29 -0
- package/dist/hooks/sync/browserSyncRemoteServices.js +58 -0
- package/dist/hooks/sync/controlPlane.d.ts +1 -37
- package/dist/hooks/sync/controlPlane.js +1 -78
- package/dist/hooks/sync/lifecyclePolicy.d.ts +1 -45
- package/dist/hooks/sync/lifecyclePolicy.js +1 -93
- package/dist/hooks/sync/orchestratorShared.d.ts +9 -3
- package/dist/hooks/sync/orchestratorShared.js +70 -96
- package/dist/hooks/sync/pullLifecycle.d.ts +1 -31
- package/dist/hooks/sync/pullLifecycle.js +1 -24
- package/dist/hooks/sync/realtime.d.ts +4 -1
- package/dist/hooks/sync/realtime.js +103 -3
- package/dist/hooks/sync/recovery.d.ts +1 -84
- package/dist/hooks/sync/recovery.js +1 -245
- package/dist/hooks/sync/transfers.d.ts +8 -129
- package/dist/hooks/sync/transfers.js +19 -581
- package/dist/hooks/sync/useDataVersionRefresh.d.ts +6 -1
- package/dist/hooks/sync/useDataVersionRefresh.js +127 -12
- package/dist/hooks/sync/useDurableLocalOutboxDrain.d.ts +14 -0
- package/dist/hooks/sync/useDurableLocalOutboxDrain.js +208 -0
- package/dist/hooks/sync/useDurableTaskCreateMutation.d.ts +15 -0
- package/dist/hooks/sync/useDurableTaskCreateMutation.js +152 -0
- package/dist/hooks/sync/useDurableTaskDeleteMutation.d.ts +11 -0
- package/dist/hooks/sync/useDurableTaskDeleteMutation.js +21 -0
- package/dist/hooks/sync/useDurableTaskLifecycleMutation.d.ts +12 -0
- package/dist/hooks/sync/useDurableTaskLifecycleMutation.js +22 -0
- package/dist/hooks/sync/useDurableTaskMetadataMutation.d.ts +14 -0
- package/dist/hooks/sync/useDurableTaskMetadataMutation.js +24 -0
- package/dist/hooks/sync/useDurableTaskRestoreMutation.d.ts +12 -0
- package/dist/hooks/sync/useDurableTaskRestoreMutation.js +24 -0
- package/dist/hooks/sync/useDurableTaskStatusMutation.d.ts +18 -0
- package/dist/hooks/sync/useDurableTaskStatusMutation.js +23 -0
- package/dist/hooks/sync/useLocalSyncCoordinatorSnapshot.d.ts +23 -0
- package/dist/hooks/sync/useLocalSyncCoordinatorSnapshot.js +414 -0
- package/dist/hooks/sync/useSyncStatusActions.d.ts +2 -1
- package/dist/hooks/sync/useSyncStatusActions.js +8 -3
- package/dist/hooks/tasks/taskHttpMutation.d.ts +25 -0
- package/dist/hooks/tasks/taskHttpMutation.js +134 -0
- package/dist/hooks/tasks/useCurrentTaskRelations.d.ts +6 -1
- package/dist/hooks/tasks/useCurrentTaskRelations.js +32 -6
- package/dist/hooks/tasks/useTaskEditorNavigation.d.ts +4 -3
- package/dist/hooks/tasks/useTaskEditorNavigation.js +9 -13
- package/dist/hooks/tasks/useTaskFormActions.d.ts +17 -2
- package/dist/hooks/tasks/useTaskFormActions.js +309 -55
- package/dist/hooks/tasks/useTaskReferenceContract.d.ts +5 -0
- package/dist/hooks/tasks/useTaskReferenceContract.js +17 -0
- package/dist/hooks/tasks/useTaskRelationships.d.ts +1 -3
- package/dist/hooks/tasks/useTaskRelationships.js +5 -25
- package/dist/hooks/tasks/useTrashSelection.d.ts +12 -0
- package/dist/hooks/tasks/useTrashSelection.js +49 -0
- package/dist/hooks/ui/useInitiativeTemplates.d.ts +24 -0
- package/dist/hooks/ui/useInitiativeTemplates.js +22 -0
- package/dist/hooks/ui/useSettingsModel.d.ts +5 -29
- package/dist/hooks/ui/useSettingsModel.js +31 -15
- package/dist/hooks/ui/useSettingsPersistence.d.ts +0 -1
- package/dist/hooks/ui/useSettingsPersistence.js +4 -8
- package/dist/hooks/ui/useSettingsTaxonomyManagement.js +31 -0
- package/dist/hooks/useFilterSort.d.ts +2 -2
- package/dist/hooks/useFilterSort.js +19 -15
- package/dist/hooks/useRealtimeSync.d.ts +10 -0
- package/dist/hooks/useRealtimeSync.js +57 -4
- package/dist/hooks/useSyncOrchestrator.d.ts +32 -1
- package/dist/hooks/useSyncOrchestrator.js +963 -287
- package/dist/hooks/useTaskData.d.ts +11 -2
- package/dist/hooks/useTaskData.js +59 -26
- package/dist/hooks/useTaskMutations.d.ts +42 -5
- package/dist/hooks/useTaskMutations.js +750 -125
- package/dist/hooks/useTaskforce.d.ts +114 -118
- package/dist/hooks/useTaskforce.js +1106 -396
- package/dist/hooks/useUiNotice.d.ts +5 -1
- package/dist/hooks/useUiNotice.js +13 -2
- package/dist/hooks/useWorkspaceSyncController.d.ts +9 -0
- package/dist/hooks/useWorkspaceSyncController.js +159 -17
- package/dist/hooks/workspace/usePersistedAppUiState.d.ts +74 -0
- package/dist/hooks/workspace/usePersistedAppUiState.js +325 -0
- package/dist/hooks/workspace/usePersistedLayoutUiState.d.ts +76 -0
- package/dist/hooks/workspace/usePersistedLayoutUiState.js +479 -0
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.d.ts +2 -7
- package/dist/hooks/workspace/useTaskforceWorkspaceBootstrap.js +42 -31
- package/dist/hooks/workspace/workspaceLocalState.d.ts +42 -6
- package/dist/hooks/workspace/workspaceLocalState.js +213 -5
- package/dist/hooks/workstreams/workstreamHttpMutation.d.ts +23 -0
- package/dist/hooks/workstreams/workstreamHttpMutation.js +134 -0
- package/dist/localization/locales/en-US.d.ts +3 -3
- package/dist/localization/locales/en-US.js +3 -3
- package/dist/localization/locales/es-419.js +3 -3
- package/dist/localization/locales/pt-BR.js +3 -3
- package/dist/mcp/adminWorkspaceRegistrar.js +2 -40
- package/dist/mcp/aiProfileBootstrap.d.ts +3 -0
- package/dist/mcp/aiProfileBootstrap.js +4 -0
- package/dist/mcp/canonicalAssetHelpers.d.ts +16 -4
- package/dist/mcp/canonicalAssetHelpers.js +104 -35
- package/dist/mcp/clientIntegrations.d.ts +4 -2
- package/dist/mcp/clientIntegrations.js +104 -53
- package/dist/mcp/clientRegistry.d.ts +30 -0
- package/dist/mcp/clientRegistry.js +134 -0
- package/dist/mcp/collaborationRegistrar.js +21 -7
- package/dist/mcp/documentAssetRegistrar.js +227 -107
- package/dist/mcp/documentContentCommand.d.ts +94 -0
- package/dist/mcp/documentContentCommand.js +226 -0
- package/dist/mcp/documentHelpers.d.ts +14 -59
- package/dist/mcp/documentHelpers.js +52 -61
- package/dist/mcp/durableTaskMutationRouter.d.ts +65 -0
- package/dist/mcp/durableTaskMutationRouter.js +217 -0
- package/dist/mcp/durableTaskRelationshipMutationRouter.d.ts +38 -0
- package/dist/mcp/durableTaskRelationshipMutationRouter.js +168 -0
- package/dist/mcp/durableTaskRootMutationRouter.d.ts +64 -0
- package/dist/mcp/durableTaskRootMutationRouter.js +226 -0
- package/dist/mcp/gitWorktreeRoots.d.ts +2 -0
- package/dist/mcp/gitWorktreeRoots.js +19 -0
- package/dist/mcp/legacyServer.d.ts +1 -0
- package/dist/mcp/legacyServer.js +42 -0
- package/dist/mcp/localCliHealth.d.ts +56 -0
- package/dist/mcp/localCliHealth.js +170 -0
- package/dist/mcp/localServiceProxy.d.ts +23 -0
- package/dist/mcp/localServiceProxy.js +255 -0
- package/dist/mcp/mcpInputValidator.d.ts +17 -0
- package/dist/mcp/mcpInputValidator.js +58 -0
- package/dist/mcp/planningAttachmentCommandAdapter.d.ts +127 -0
- package/dist/mcp/planningAttachmentCommandAdapter.js +188 -0
- package/dist/mcp/programScaffoldCommandAdapter.d.ts +6 -0
- package/dist/mcp/programScaffoldCommandAdapter.js +39 -0
- package/dist/mcp/proxyServer.d.ts +1 -0
- package/dist/mcp/proxyServer.js +2 -0
- package/dist/mcp/runtime.d.ts +86 -1
- package/dist/mcp/runtime.js +4562 -2270
- package/dist/mcp/server.js +29 -2
- package/dist/mcp/sharedLocalServiceGateD.d.ts +115 -0
- package/dist/mcp/sharedLocalServiceGateD.js +344 -0
- package/dist/mcp/stdioLifecycle.d.ts +22 -0
- package/dist/mcp/stdioLifecycle.js +54 -0
- package/dist/mcp/taskAttachmentCommandAdapter.d.ts +190 -0
- package/dist/mcp/taskAttachmentCommandAdapter.js +464 -0
- package/dist/mcp/taskAttachmentHelpers.d.ts +8 -6
- package/dist/mcp/taskAttachmentHelpers.js +74 -2
- package/dist/mcp/taskAttachmentTypes.d.ts +26 -5
- package/dist/mcp/taskPlanCommand.d.ts +64 -0
- package/dist/mcp/taskPlanCommand.js +98 -0
- package/dist/mcp/taskPlanningRegistrar.js +253 -101
- package/dist/mcp/toolCallCompatibility.d.ts +6 -0
- package/dist/mcp/toolCallCompatibility.js +16 -0
- package/dist/mcp/toolCatalog.d.ts +3 -1
- package/dist/mcp/toolProfiles.d.ts +18 -0
- package/dist/mcp/toolProfiles.js +79 -0
- package/dist/mcp/toolRegistry.d.ts +102 -609
- package/dist/mcp/toolRegistry.js +108 -88
- package/dist/mcp/workflowExecutionRegistrar.d.ts +2 -0
- package/dist/mcp/workflowExecutionRegistrar.js +51 -0
- package/dist/migrations/taskSchemaMigrations.d.ts +35 -0
- package/dist/migrations/taskSchemaMigrations.js +1797 -4
- package/dist/migrations/taskUpdatedAtSyncDriftMigration.d.ts +20 -0
- package/dist/migrations/taskUpdatedAtSyncDriftMigration.js +153 -0
- package/dist/migrations/taskforceAgentDefinitionMigration.d.ts +26 -0
- package/dist/migrations/taskforceAgentDefinitionMigration.js +116 -0
- package/dist/plugins/vite.js +48 -17
- package/dist/public/Taskforce_Van.webp +0 -0
- package/dist/runtime/appGateDefinitions.d.ts +16 -10
- package/dist/runtime/appGateDefinitions.js +16 -10
- package/dist/runtime/appGates.d.ts +5 -4
- package/dist/runtime/appGates.js +4 -3
- package/dist/server/aiProfileAvatarAssets.d.ts +11 -8
- package/dist/server/aiProfileAvatarAssets.js +159 -70
- package/dist/server/auth.js +15 -1
- package/dist/server/cors.d.ts +2 -1
- package/dist/server/cors.js +45 -8
- package/dist/server/email.d.ts +3 -1
- package/dist/server/email.js +46 -8
- package/dist/server/index.d.ts +24 -1
- package/dist/server/index.js +342 -46
- package/dist/server/localDataOwnerPermit.d.ts +18 -0
- package/dist/server/localDataOwnerPermit.js +58 -0
- package/dist/server/localDatabaseIdentity.d.ts +14 -0
- package/dist/server/localDatabaseIdentity.js +69 -0
- package/dist/server/localRealtimeFileInvalidation.d.ts +1 -0
- package/dist/server/localRealtimeFileInvalidation.js +7 -0
- package/dist/server/localServiceLease.d.ts +62 -0
- package/dist/server/localServiceLease.js +477 -0
- package/dist/server/localServiceOwnershipBootstrap.d.ts +19 -0
- package/dist/server/localServiceOwnershipBootstrap.js +84 -0
- package/dist/server/localServiceSessions.d.ts +87 -0
- package/dist/server/localServiceSessions.js +309 -0
- package/dist/server/localServiceWindowsAcl.d.ts +8 -0
- package/dist/server/localServiceWindowsAcl.js +60 -0
- package/dist/server/localSyncProcessLockBootstrap.d.ts +3 -0
- package/dist/server/localSyncProcessLockBootstrap.js +16 -0
- package/dist/server/localWorkspaceSyncServerComposition.d.ts +59 -0
- package/dist/server/localWorkspaceSyncServerComposition.js +91 -0
- package/dist/server/localWorkspaceSyncServerRuntime.d.ts +119 -0
- package/dist/server/localWorkspaceSyncServerRuntime.js +1163 -0
- package/dist/server/rateLimit.d.ts +1 -0
- package/dist/server/rateLimit.js +16 -0
- package/dist/server/routes/admin.d.ts +2 -4
- package/dist/server/routes/admin.js +199 -337
- package/dist/server/routes/agentRoles.d.ts +13 -0
- package/dist/server/routes/agentRoles.js +273 -0
- package/dist/server/routes/agentSkills.d.ts +16 -0
- package/dist/server/routes/agentSkills.js +291 -0
- package/dist/server/routes/agents.d.ts +49 -0
- package/dist/server/routes/agents.js +1455 -0
- package/dist/server/routes/annotatedAttachments.js +46 -9
- package/dist/server/routes/assetAccess.d.ts +36 -0
- package/dist/server/routes/assetAccess.js +93 -0
- package/dist/server/routes/auth.d.ts +4 -3
- package/dist/server/routes/auth.js +236 -21
- package/dist/server/routes/authSupport.d.ts +3 -1
- package/dist/server/routes/authSupport.js +22 -8
- package/dist/server/routes/documentReviews.d.ts +2 -0
- package/dist/server/routes/documentReviews.js +155 -15
- package/dist/server/routes/documents.d.ts +1 -0
- package/dist/server/routes/documents.js +335 -141
- package/dist/server/routes/durableTaskHttpRouters.d.ts +165 -0
- package/dist/server/routes/durableTaskHttpRouters.js +89 -0
- package/dist/server/routes/localMcpHealth.d.ts +11 -0
- package/dist/server/routes/localMcpHealth.js +29 -0
- package/dist/server/routes/localService.d.ts +13 -0
- package/dist/server/routes/localService.js +444 -0
- package/dist/server/routes/localUpdate.d.ts +11 -0
- package/dist/server/routes/localUpdate.js +154 -0
- package/dist/server/routes/primitives.d.ts +27 -0
- package/dist/server/routes/primitives.js +18 -0
- package/dist/server/routes/resources.d.ts +1 -10
- package/dist/server/routes/resources.js +1 -153
- package/dist/server/routes/shared.d.ts +31 -2
- package/dist/server/routes/shared.js +394 -0
- package/dist/server/routes/sync.d.ts +2 -0
- package/dist/server/routes/sync.js +184 -272
- package/dist/server/routes/syncAuxRoutes.d.ts +3 -1
- package/dist/server/routes/syncAuxRoutes.js +9 -4
- package/dist/server/routes/syncCoordinatorLocalRoutes.d.ts +6 -0
- package/dist/server/routes/syncCoordinatorLocalRoutes.js +867 -0
- package/dist/server/routes/syncPullApplyRoutes.d.ts +29 -1
- package/dist/server/routes/syncPullApplyRoutes.js +520 -17
- package/dist/server/routes/syncPushRoutes.d.ts +33 -4
- package/dist/server/routes/syncPushRoutes.js +251 -62
- package/dist/server/routes/syncRouteTypes.d.ts +1 -1
- package/dist/server/routes/syncSnapshotRoutes.d.ts +15 -7
- package/dist/server/routes/syncSnapshotRoutes.js +95 -17
- package/dist/server/routes/syncV3DiagnosticsRoutes.d.ts +14 -0
- package/dist/server/routes/syncV3DiagnosticsRoutes.js +72 -0
- package/dist/server/routes/syncV3FeedRoutes.d.ts +20 -0
- package/dist/server/routes/syncV3FeedRoutes.js +462 -0
- package/dist/server/routes/syncV3LocalCaptureRoutes.d.ts +37 -0
- package/dist/server/routes/syncV3LocalCaptureRoutes.js +897 -0
- package/dist/server/routes/syncV3LocalDispatchRoutes.d.ts +17 -0
- package/dist/server/routes/syncV3LocalDispatchRoutes.js +280 -0
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.d.ts +17 -0
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.js +493 -0
- package/dist/server/routes/syncV3LocalOwnershipRoutes.d.ts +10 -0
- package/dist/server/routes/syncV3LocalOwnershipRoutes.js +51 -0
- package/dist/server/routes/syncV3LocalRecoveryRoutes.d.ts +12 -0
- package/dist/server/routes/syncV3LocalRecoveryRoutes.js +78 -0
- package/dist/server/routes/syncV3OperationRoutes.d.ts +35 -0
- package/dist/server/routes/syncV3OperationRoutes.js +1136 -0
- package/dist/server/routes/tasks.d.ts +0 -2
- package/dist/server/routes/tasks.js +932 -195
- package/dist/server/routes/workflows.d.ts +26 -0
- package/dist/server/routes/workflows.js +500 -0
- package/dist/server/routes.d.ts +1 -6
- package/dist/server/routes.js +148 -339
- package/dist/server/smtpTransport.d.ts +11 -3
- package/dist/server/smtpTransport.js +9 -2
- package/dist/server/start.js +42 -10
- package/dist/service/localServiceCli.d.ts +33 -0
- package/dist/service/localServiceCli.js +365 -0
- package/dist/service/localServiceClientLifecycle.d.ts +25 -0
- package/dist/service/localServiceClientLifecycle.js +128 -0
- package/dist/service/localServiceOpen.d.ts +17 -0
- package/dist/service/localServiceOpen.js +27 -0
- package/dist/services/agentRoleResolver.d.ts +4 -0
- package/dist/services/agentRoleResolver.js +7 -0
- package/dist/services/aiProfileAvatarGenerationService.d.ts +41 -0
- package/dist/services/aiProfileAvatarGenerationService.js +158 -0
- package/dist/services/avatarImageProvider.d.ts +33 -0
- package/dist/services/avatarImageProvider.js +140 -0
- package/dist/services/bedrockAnthropicMessagesModelGateway.d.ts +24 -0
- package/dist/services/bedrockAnthropicMessagesModelGateway.js +95 -0
- package/dist/services/bedrockMantleModelGateway.d.ts +43 -0
- package/dist/services/bedrockMantleModelGateway.js +81 -0
- package/dist/services/bedrockModelGateway.d.ts +26 -0
- package/dist/services/bedrockModelGateway.js +94 -0
- package/dist/services/modelGateway.d.ts +82 -0
- package/dist/services/modelGateway.js +61 -0
- package/dist/services/taskforceAgentAvatarImageProvider.d.ts +8 -0
- package/dist/services/taskforceAgentAvatarImageProvider.js +24 -0
- package/dist/services/taskforceAgentMcpBridge.d.ts +77 -0
- package/dist/services/taskforceAgentMcpBridge.js +527 -0
- package/dist/shared/agentRoleDefinition.d.ts +34 -0
- package/dist/shared/agentRoleDefinition.js +207 -0
- package/dist/shared/aiProfileAvatarEligibility.d.ts +10 -0
- package/dist/shared/aiProfileAvatarEligibility.js +27 -0
- package/dist/shared/aiProfileColors.d.ts +7 -0
- package/dist/shared/aiProfileColors.js +33 -0
- package/dist/shared/colorPalette.d.ts +3 -0
- package/dist/shared/colorPalette.js +20 -0
- package/dist/shared/commentProvenance.d.ts +4 -0
- package/dist/shared/commentProvenance.js +6 -0
- package/dist/shared/deletedTaskRetention.d.ts +2 -0
- package/dist/shared/deletedTaskRetention.js +7 -0
- package/dist/shared/passwordPolicy.d.ts +2 -1
- package/dist/shared/passwordPolicy.js +9 -0
- package/dist/shared/taskDeepLinks.d.ts +28 -0
- package/dist/shared/taskDeepLinks.js +48 -0
- package/dist/shared/taskRestoreDestination.d.ts +2 -0
- package/dist/shared/taskRestoreDestination.js +5 -0
- package/dist/shared/taskforceAgentDefinition.d.ts +88 -0
- package/dist/shared/taskforceAgentDefinition.js +434 -0
- package/dist/shared/taskforceAgentExecutionSnapshot.d.ts +50 -0
- package/dist/shared/taskforceAgentExecutionSnapshot.js +68 -0
- package/dist/shared/taskforceAgentModels.d.ts +56 -0
- package/dist/shared/taskforceAgentModels.js +314 -0
- package/dist/shared/taskforceAgentRunContext.d.ts +23 -0
- package/dist/shared/taskforceAgentRunContext.js +21 -0
- package/dist/shared/taskforceAgentRuntimeResolution.d.ts +31 -0
- package/dist/shared/taskforceAgentRuntimeResolution.js +72 -0
- package/dist/shared/taskforceAgentSkill.d.ts +33 -0
- package/dist/shared/taskforceAgentSkill.js +149 -0
- package/dist/shared/taxonomyLibrary.js +1 -1
- package/dist/storage/agentRoleStore.d.ts +91 -0
- package/dist/storage/agentRoleStore.js +385 -0
- package/dist/storage/databaseAdapter.d.ts +1 -0
- package/dist/storage/databaseAdapter.js +7 -1
- package/dist/storage/documentIntegrity.d.ts +12 -3
- package/dist/storage/documentIntegrity.js +105 -27
- package/dist/storage/objectStorageClient.d.ts +10 -4
- package/dist/storage/objectStorageClient.js +73 -43
- package/dist/storage/postgresAdapter.d.ts +2 -1
- package/dist/storage/postgresAdapter.js +38 -6
- package/dist/storage/postgresWorker.js +65 -1
- package/dist/storage/sqliteAdapter.d.ts +1 -1
- package/dist/storage/sqliteAdapter.js +7 -1
- package/dist/storage/sqliteWalHealth.d.ts +71 -0
- package/dist/storage/sqliteWalHealth.js +176 -0
- package/dist/storage/taskDataPath.d.ts +1 -0
- package/dist/storage/taskDataPath.js +20 -0
- package/dist/storage/taskforceAgentConversationStore.d.ts +66 -0
- package/dist/storage/taskforceAgentConversationStore.js +264 -0
- package/dist/storage/taskforceAgentSkillStore.d.ts +93 -0
- package/dist/storage/taskforceAgentSkillStore.js +355 -0
- package/dist/storage/taskforceAgentStore.d.ts +105 -0
- package/dist/storage/taskforceAgentStore.js +549 -0
- package/dist/storage/workflowStore.d.ts +223 -0
- package/dist/storage/workflowStore.js +1032 -0
- package/dist/storage/workspaceAssetStore.d.ts +70 -0
- package/dist/storage/workspaceAssetStore.js +418 -25
- package/dist/sync/aiProfileAvatarSyncPaths.d.ts +14 -0
- package/dist/sync/aiProfileAvatarSyncPaths.js +56 -0
- package/dist/sync/cloudSyncApi.d.ts +329 -0
- package/dist/sync/cloudSyncApi.js +596 -4
- package/dist/sync/collaborationSyncPayload.d.ts +5 -1
- package/dist/sync/collaborationSyncPayload.js +213 -1
- package/dist/sync/collaborationSyncState.d.ts +23 -3
- package/dist/sync/collaborationSyncState.js +92 -3
- package/dist/sync/contentSyncPayload.d.ts +9 -0
- package/dist/sync/contentSyncPayload.js +29 -0
- package/dist/sync/contentSyncState.d.ts +79 -4
- package/dist/sync/contentSyncState.js +1113 -313
- package/dist/sync/coordinator/localSyncBrowserApplyPermitContext.d.ts +39 -0
- package/dist/sync/coordinator/localSyncBrowserApplyPermitContext.js +234 -0
- package/dist/sync/coordinator/localSyncBrowserAuthorityCapability.d.ts +7 -0
- package/dist/sync/coordinator/localSyncBrowserAuthorityCapability.js +10 -0
- package/dist/sync/coordinator/localSyncCommittedApplyPolicy.d.ts +7 -0
- package/dist/sync/coordinator/localSyncCommittedApplyPolicy.js +41 -0
- package/dist/sync/coordinator/localSyncCoordinatorBrowserClient.d.ts +178 -0
- package/dist/sync/coordinator/localSyncCoordinatorBrowserClient.js +131 -0
- package/dist/sync/coordinator/localSyncCoordinatorCommandLifecycle.d.ts +25 -0
- package/dist/sync/coordinator/localSyncCoordinatorCommandLifecycle.js +200 -0
- package/dist/sync/coordinator/localSyncCoordinatorHost.d.ts +84 -0
- package/dist/sync/coordinator/localSyncCoordinatorHost.js +435 -0
- package/dist/sync/coordinator/localSyncCoordinatorRouteServices.d.ts +33 -0
- package/dist/sync/coordinator/localSyncCoordinatorRouteServices.js +1 -0
- package/dist/sync/coordinator/localSyncCoordinatorStore.d.ts +122 -0
- package/dist/sync/coordinator/localSyncCoordinatorStore.js +1039 -0
- package/dist/sync/coordinator/localSyncCoordinatorTypes.d.ts +82 -0
- package/dist/sync/coordinator/localSyncCoordinatorTypes.js +9 -0
- package/dist/sync/coordinator/localSyncDispatchTracker.d.ts +15 -0
- package/dist/sync/coordinator/localSyncDispatchTracker.js +68 -0
- package/dist/sync/coordinator/localSyncExecutionPermitStore.d.ts +200 -0
- package/dist/sync/coordinator/localSyncExecutionPermitStore.js +1388 -0
- package/dist/sync/coordinator/localSyncExecutionPermitTypes.d.ts +52 -0
- package/dist/sync/coordinator/localSyncExecutionPermitTypes.js +8 -0
- package/dist/sync/coordinator/localSyncOwnershipDrainBarrier.d.ts +33 -0
- package/dist/sync/coordinator/localSyncOwnershipDrainBarrier.js +83 -0
- package/dist/sync/coordinator/localSyncPermitTransactionHooks.d.ts +9 -0
- package/dist/sync/coordinator/localSyncPermitTransactionHooks.js +27 -0
- package/dist/sync/coordinator/localSyncProcessLock.d.ts +12 -0
- package/dist/sync/coordinator/localSyncProcessLock.js +212 -0
- package/dist/sync/coordinator/localSyncV3DispatchRecoveryReconciler.d.ts +17 -0
- package/dist/sync/coordinator/localSyncV3DispatchRecoveryReconciler.js +82 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunner.d.ts +134 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunner.js +981 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.d.ts +189 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.js +961 -0
- package/dist/sync/coordinator/workspaceSyncCloudCredentialValidator.d.ts +19 -0
- package/dist/sync/coordinator/workspaceSyncCloudCredentialValidator.js +83 -0
- package/dist/sync/coordinator/workspaceSyncCredentialBroker.d.ts +117 -0
- package/dist/sync/coordinator/workspaceSyncCredentialBroker.js +323 -0
- package/dist/sync/coordinator/workspaceSyncLocalAccessBootstrap.d.ts +11 -0
- package/dist/sync/coordinator/workspaceSyncLocalAccessBootstrap.js +51 -0
- package/dist/sync/coordinator/workspaceSyncTransportGateway.d.ts +139 -0
- package/dist/sync/coordinator/workspaceSyncTransportGateway.js +738 -0
- package/dist/sync/engine/localWorkspaceContentManifestService.d.ts +21 -0
- package/dist/sync/engine/localWorkspaceContentManifestService.js +44 -0
- package/dist/sync/engine/workspaceSyncAtomicLocalPublisher.d.ts +36 -0
- package/dist/sync/engine/workspaceSyncAtomicLocalPublisher.js +203 -0
- package/dist/sync/engine/workspaceSyncContentLifecycleAdapter.d.ts +21 -0
- package/dist/sync/engine/workspaceSyncContentLifecycleAdapter.js +13 -0
- package/dist/sync/engine/workspaceSyncContentPullObligationStore.d.ts +65 -0
- package/dist/sync/engine/workspaceSyncContentPullObligationStore.js +160 -0
- package/dist/sync/engine/workspaceSyncContentVersionStore.d.ts +216 -0
- package/dist/sync/engine/workspaceSyncContentVersionStore.js +1068 -0
- package/dist/sync/engine/workspaceSyncEngineBrowserGatewayRemoteServices.d.ts +28 -0
- package/dist/sync/engine/workspaceSyncEngineBrowserGatewayRemoteServices.js +543 -0
- package/dist/sync/engine/workspaceSyncEngineContracts.d.ts +78 -0
- package/dist/sync/engine/workspaceSyncEngineContracts.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineControlPlane.d.ts +37 -0
- package/dist/sync/engine/workspaceSyncEngineControlPlane.js +79 -0
- package/dist/sync/engine/workspaceSyncEngineIdentity.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncEngineIdentity.js +4 -0
- package/dist/sync/engine/workspaceSyncEngineLifecyclePolicy.d.ts +68 -0
- package/dist/sync/engine/workspaceSyncEngineLifecyclePolicy.js +180 -0
- package/dist/sync/engine/workspaceSyncEngineLocalApply.d.ts +72 -0
- package/dist/sync/engine/workspaceSyncEngineLocalApply.js +132 -0
- package/dist/sync/engine/workspaceSyncEngineLocalServices.d.ts +70 -0
- package/dist/sync/engine/workspaceSyncEngineLocalServices.js +25 -0
- package/dist/sync/engine/workspaceSyncEngineParity.d.ts +8 -0
- package/dist/sync/engine/workspaceSyncEngineParity.js +7 -0
- package/dist/sync/engine/workspaceSyncEnginePullPolicy.d.ts +32 -0
- package/dist/sync/engine/workspaceSyncEnginePullPolicy.js +27 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.d.ts +20 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.js +87 -0
- package/dist/sync/engine/workspaceSyncEngineRecovery.d.ts +56 -0
- package/dist/sync/engine/workspaceSyncEngineRecovery.js +288 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.d.ts +104 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.js +21 -0
- package/dist/sync/engine/workspaceSyncEngineRuntime.d.ts +61 -0
- package/dist/sync/engine/workspaceSyncEngineRuntime.js +59 -0
- package/dist/sync/engine/workspaceSyncEngineServerApplyBoundary.d.ts +28 -0
- package/dist/sync/engine/workspaceSyncEngineServerApplyBoundary.js +86 -0
- package/dist/sync/engine/workspaceSyncEngineServerLocalServices.d.ts +73 -0
- package/dist/sync/engine/workspaceSyncEngineServerLocalServices.js +452 -0
- package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.d.ts +23 -0
- package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.js +451 -0
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.d.ts +125 -0
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +1124 -0
- package/dist/sync/engine/workspaceSyncEngineServerSnapshotReader.d.ts +63 -0
- package/dist/sync/engine/workspaceSyncEngineServerSnapshotReader.js +276 -0
- package/dist/sync/engine/workspaceSyncEngineTransferCompletion.d.ts +20 -0
- package/dist/sync/engine/workspaceSyncEngineTransferCompletion.js +37 -0
- package/dist/sync/engine/workspaceSyncEngineTransferTypes.d.ts +7 -0
- package/dist/sync/engine/workspaceSyncEngineTransferTypes.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineTransfers.d.ts +240 -0
- package/dist/sync/engine/workspaceSyncEngineTransfers.js +1184 -0
- package/dist/sync/engine/workspaceSyncEngineV3LocalFeedApply.d.ts +39 -0
- package/dist/sync/engine/workspaceSyncEngineV3LocalFeedApply.js +39 -0
- package/dist/sync/engine/workspaceSyncImmutableContentGcRunner.d.ts +25 -0
- package/dist/sync/engine/workspaceSyncImmutableContentGcRunner.js +83 -0
- package/dist/sync/engine/workspaceSyncImmutableContentProvider.d.ts +71 -0
- package/dist/sync/engine/workspaceSyncImmutableContentProvider.js +209 -0
- package/dist/sync/engine/workspaceSyncImmutableContentStager.d.ts +32 -0
- package/dist/sync/engine/workspaceSyncImmutableContentStager.js +202 -0
- package/dist/sync/engine/workspaceSyncPublishedContentResolver.d.ts +43 -0
- package/dist/sync/engine/workspaceSyncPublishedContentResolver.js +142 -0
- package/dist/sync/engine/workspaceSyncServerContentRuntime.d.ts +26 -0
- package/dist/sync/engine/workspaceSyncServerContentRuntime.js +41 -0
- package/dist/sync/engine/workspaceSyncServerDataServices.d.ts +44 -0
- package/dist/sync/engine/workspaceSyncServerDataServices.js +143 -0
- package/dist/sync/engine/workspaceSyncTransferEvidence.d.ts +39 -0
- package/dist/sync/engine/workspaceSyncTransferEvidence.js +45 -0
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.d.ts +44 -0
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +990 -0
- package/dist/sync/engine/workspaceSyncV2PreparedContent.d.ts +82 -0
- package/dist/sync/engine/workspaceSyncV2PreparedContent.js +219 -0
- package/dist/sync/planningCanonicalFields.d.ts +41 -0
- package/dist/sync/planningCanonicalFields.js +211 -0
- package/dist/sync/planningSyncPayload.d.ts +5 -1
- package/dist/sync/planningSyncPayload.js +88 -4
- package/dist/sync/syncApplyHandlers.d.ts +98 -8
- package/dist/sync/syncApplyHandlers.js +816 -78
- package/dist/sync/syncResourceAdapters.d.ts +10 -0
- package/dist/sync/syncResourceAdapters.js +21 -1
- package/dist/sync/syncService.d.ts +57 -1
- package/dist/sync/syncService.js +1085 -138
- package/dist/sync/taskNestedContent.d.ts +2 -0
- package/dist/sync/taskNestedContent.js +8 -0
- package/dist/sync/taskSyncChangeKey.js +0 -1
- package/dist/sync/taskSyncPayload.d.ts +0 -1
- package/dist/sync/taskSyncPayload.js +14 -3
- package/dist/sync/v3/canonicalWorkspaceSyncJson.d.ts +2 -0
- package/dist/sync/v3/canonicalWorkspaceSyncJson.js +26 -0
- package/dist/sync/v3/combinedFeedCapability.d.ts +21 -0
- package/dist/sync/v3/combinedFeedCapability.js +80 -0
- package/dist/sync/v3/combinedFeedPrerequisites.d.ts +18 -0
- package/dist/sync/v3/combinedFeedPrerequisites.js +184 -0
- package/dist/sync/v3/durableInitiativeMutationRouter.d.ts +61 -0
- package/dist/sync/v3/durableInitiativeMutationRouter.js +287 -0
- package/dist/sync/v3/durableOperationReplay.d.ts +36 -0
- package/dist/sync/v3/durableOperationReplay.js +103 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.d.ts +49 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.js +198 -0
- package/dist/sync/v3/durableTaskChecklistMutationRouter.d.ts +47 -0
- package/dist/sync/v3/durableTaskChecklistMutationRouter.js +182 -0
- package/dist/sync/v3/durableTaskCommentMutationRouter.d.ts +47 -0
- package/dist/sync/v3/durableTaskCommentMutationRouter.js +191 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.d.ts +60 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.js +320 -0
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.d.ts +40 -0
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.js +518 -0
- package/dist/sync/v3/durableTaxonomyMutationRouter.d.ts +63 -0
- package/dist/sync/v3/durableTaxonomyMutationRouter.js +289 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.d.ts +77 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.js +361 -0
- package/dist/sync/v3/durableWorkstreamMutationRouter.d.ts +61 -0
- package/dist/sync/v3/durableWorkstreamMutationRouter.js +287 -0
- package/dist/sync/v3/durableWorkstreamTaskOrderMutationRouter.d.ts +42 -0
- package/dist/sync/v3/durableWorkstreamTaskOrderMutationRouter.js +122 -0
- package/dist/sync/v3/entityEventLegacyAdoptionContract.d.ts +6 -0
- package/dist/sync/v3/entityEventLegacyAdoptionContract.js +6 -0
- package/dist/sync/v3/entityEventLegacyAdoptionService.d.ts +62 -0
- package/dist/sync/v3/entityEventLegacyAdoptionService.js +180 -0
- package/dist/sync/v3/initiativeActivityAuthoritativeRevision.d.ts +11 -0
- package/dist/sync/v3/initiativeActivityAuthoritativeRevision.js +23 -0
- package/dist/sync/v3/initiativeActivityIdentity.d.ts +8 -0
- package/dist/sync/v3/initiativeActivityIdentity.js +14 -0
- package/dist/sync/v3/initiativeCoexistence.d.ts +26 -0
- package/dist/sync/v3/initiativeCoexistence.js +148 -0
- package/dist/sync/v3/initiativeFeedActivationCapability.d.ts +6 -0
- package/dist/sync/v3/initiativeFeedActivationCapability.js +16 -0
- package/dist/sync/v3/initiativeMutationPayload.d.ts +26 -0
- package/dist/sync/v3/initiativeMutationPayload.js +144 -0
- package/dist/sync/v3/initiativeMutationService.d.ts +62 -0
- package/dist/sync/v3/initiativeMutationService.js +206 -0
- package/dist/sync/v3/localEntityEventLegacyAdoption.d.ts +31 -0
- package/dist/sync/v3/localEntityEventLegacyAdoption.js +607 -0
- package/dist/sync/v3/localInitiativeOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localInitiativeOutboxHandler.js +88 -0
- package/dist/sync/v3/localInitiativeOutboxService.d.ts +50 -0
- package/dist/sync/v3/localInitiativeOutboxService.js +495 -0
- package/dist/sync/v3/localOperationIdentityStore.d.ts +81 -0
- package/dist/sync/v3/localOperationIdentityStore.js +388 -0
- package/dist/sync/v3/localOutboxDispatchCapability.d.ts +7 -0
- package/dist/sync/v3/localOutboxDispatchCapability.js +13 -0
- package/dist/sync/v3/localOutboxDispatchRuntime.d.ts +16 -0
- package/dist/sync/v3/localOutboxDispatchRuntime.js +269 -0
- package/dist/sync/v3/localOutboxDispatcher.d.ts +53 -0
- package/dist/sync/v3/localOutboxDispatcher.js +362 -0
- package/dist/sync/v3/localOutboxDrainClient.d.ts +50 -0
- package/dist/sync/v3/localOutboxDrainClient.js +250 -0
- package/dist/sync/v3/localOutboxOperationHandler.d.ts +31 -0
- package/dist/sync/v3/localOutboxOperationHandler.js +10 -0
- package/dist/sync/v3/localOutboxRecoveryClient.d.ts +14 -0
- package/dist/sync/v3/localOutboxRecoveryClient.js +45 -0
- package/dist/sync/v3/localOutboxRecoveryPreparationService.d.ts +12 -0
- package/dist/sync/v3/localOutboxRecoveryPreparationService.js +151 -0
- package/dist/sync/v3/localSyncIdentityStore.d.ts +9 -0
- package/dist/sync/v3/localSyncIdentityStore.js +43 -0
- package/dist/sync/v3/localTaskAttachmentLinksOutboxHandler.d.ts +10 -0
- package/dist/sync/v3/localTaskAttachmentLinksOutboxHandler.js +70 -0
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.d.ts +45 -0
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.js +291 -0
- package/dist/sync/v3/localTaskChecklistOutboxHandler.d.ts +10 -0
- package/dist/sync/v3/localTaskChecklistOutboxHandler.js +54 -0
- package/dist/sync/v3/localTaskChecklistOutboxService.d.ts +47 -0
- package/dist/sync/v3/localTaskChecklistOutboxService.js +221 -0
- package/dist/sync/v3/localTaskCommentOutboxHandler.d.ts +10 -0
- package/dist/sync/v3/localTaskCommentOutboxHandler.js +94 -0
- package/dist/sync/v3/localTaskCommentOutboxService.d.ts +75 -0
- package/dist/sync/v3/localTaskCommentOutboxService.js +391 -0
- package/dist/sync/v3/localTaskCreateClient.d.ts +27 -0
- package/dist/sync/v3/localTaskCreateClient.js +209 -0
- package/dist/sync/v3/localTaskCreateOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localTaskCreateOutboxHandler.js +147 -0
- package/dist/sync/v3/localTaskCreateOutboxService.d.ts +77 -0
- package/dist/sync/v3/localTaskCreateOutboxService.js +397 -0
- package/dist/sync/v3/localTaskDeleteClient.d.ts +10 -0
- package/dist/sync/v3/localTaskDeleteClient.js +23 -0
- package/dist/sync/v3/localTaskDeleteOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localTaskDeleteOutboxHandler.js +54 -0
- package/dist/sync/v3/localTaskDeleteOutboxService.d.ts +38 -0
- package/dist/sync/v3/localTaskDeleteOutboxService.js +235 -0
- package/dist/sync/v3/localTaskLegacyRootAdoption.d.ts +28 -0
- package/dist/sync/v3/localTaskLegacyRootAdoption.js +219 -0
- package/dist/sync/v3/localTaskLifecycleClient.d.ts +49 -0
- package/dist/sync/v3/localTaskLifecycleClient.js +57 -0
- package/dist/sync/v3/localTaskLifecycleOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localTaskLifecycleOutboxHandler.js +94 -0
- package/dist/sync/v3/localTaskLifecycleOutboxService.d.ts +60 -0
- package/dist/sync/v3/localTaskLifecycleOutboxService.js +304 -0
- package/dist/sync/v3/localTaskMetadataClient.d.ts +13 -0
- package/dist/sync/v3/localTaskMetadataClient.js +30 -0
- package/dist/sync/v3/localTaskMetadataOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localTaskMetadataOutboxHandler.js +70 -0
- package/dist/sync/v3/localTaskMetadataOutboxService.d.ts +48 -0
- package/dist/sync/v3/localTaskMetadataOutboxService.js +229 -0
- package/dist/sync/v3/localTaskOperationClient.d.ts +72 -0
- package/dist/sync/v3/localTaskOperationClient.js +195 -0
- package/dist/sync/v3/localTaskRelationshipOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localTaskRelationshipOutboxHandler.js +114 -0
- package/dist/sync/v3/localTaskRelationshipOutboxService.d.ts +45 -0
- package/dist/sync/v3/localTaskRelationshipOutboxService.js +192 -0
- package/dist/sync/v3/localTaskRestoreClient.d.ts +13 -0
- package/dist/sync/v3/localTaskRestoreClient.js +32 -0
- package/dist/sync/v3/localTaskRestoreOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localTaskRestoreOutboxHandler.js +41 -0
- package/dist/sync/v3/localTaskRestoreOutboxService.d.ts +56 -0
- package/dist/sync/v3/localTaskRestoreOutboxService.js +323 -0
- package/dist/sync/v3/localTaskStatusClient.d.ts +17 -0
- package/dist/sync/v3/localTaskStatusClient.js +35 -0
- package/dist/sync/v3/localTaskStatusOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localTaskStatusOutboxHandler.js +75 -0
- package/dist/sync/v3/localTaskStatusOutboxService.d.ts +53 -0
- package/dist/sync/v3/localTaskStatusOutboxService.js +422 -0
- package/dist/sync/v3/localTaxonomyCompositeOutboxService.d.ts +34 -0
- package/dist/sync/v3/localTaxonomyCompositeOutboxService.js +290 -0
- package/dist/sync/v3/localTaxonomyOutboxHandler.d.ts +9 -0
- package/dist/sync/v3/localTaxonomyOutboxHandler.js +106 -0
- package/dist/sync/v3/localTaxonomyOutboxService.d.ts +30 -0
- package/dist/sync/v3/localTaxonomyOutboxService.js +181 -0
- package/dist/sync/v3/localWorkflowRuntimeOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localWorkflowRuntimeOutboxHandler.js +113 -0
- package/dist/sync/v3/localWorkflowRuntimeOutboxService.d.ts +37 -0
- package/dist/sync/v3/localWorkflowRuntimeOutboxService.js +330 -0
- package/dist/sync/v3/localWorkspaceSyncServerOutboxDispatcher.d.ts +63 -0
- package/dist/sync/v3/localWorkspaceSyncServerOutboxDispatcher.js +264 -0
- package/dist/sync/v3/localWorkstreamOutboxHandler.d.ts +8 -0
- package/dist/sync/v3/localWorkstreamOutboxHandler.js +102 -0
- package/dist/sync/v3/localWorkstreamOutboxService.d.ts +52 -0
- package/dist/sync/v3/localWorkstreamOutboxService.js +579 -0
- package/dist/sync/v3/localWorkstreamTaskOrderOutboxHandler.d.ts +10 -0
- package/dist/sync/v3/localWorkstreamTaskOrderOutboxHandler.js +57 -0
- package/dist/sync/v3/localWorkstreamTaskOrderOutboxService.d.ts +30 -0
- package/dist/sync/v3/localWorkstreamTaskOrderOutboxService.js +128 -0
- package/dist/sync/v3/planningActivation.d.ts +13 -0
- package/dist/sync/v3/planningActivation.js +33 -0
- package/dist/sync/v3/planningAttachmentActivityValidation.d.ts +9 -0
- package/dist/sync/v3/planningAttachmentActivityValidation.js +87 -0
- package/dist/sync/v3/programScaffoldService.d.ts +143 -0
- package/dist/sync/v3/programScaffoldService.js +478 -0
- package/dist/sync/v3/syncDurabilityStore.d.ts +773 -0
- package/dist/sync/v3/syncDurabilityStore.js +4635 -0
- package/dist/sync/v3/taskActivityAuthoritativeRevision.d.ts +16 -0
- package/dist/sync/v3/taskActivityAuthoritativeRevision.js +67 -0
- package/dist/sync/v3/taskActivityJournal.d.ts +20 -0
- package/dist/sync/v3/taskActivityJournal.js +195 -0
- package/dist/sync/v3/taskAttachmentLinksActivityIdentity.d.ts +6 -0
- package/dist/sync/v3/taskAttachmentLinksActivityIdentity.js +14 -0
- package/dist/sync/v3/taskAttachmentLinksMutationService.d.ts +111 -0
- package/dist/sync/v3/taskAttachmentLinksMutationService.js +202 -0
- package/dist/sync/v3/taskChecklistActivityIdentity.d.ts +6 -0
- package/dist/sync/v3/taskChecklistActivityIdentity.js +14 -0
- package/dist/sync/v3/taskChecklistMutationService.d.ts +92 -0
- package/dist/sync/v3/taskChecklistMutationService.js +156 -0
- package/dist/sync/v3/taskCommentActivityIdentity.d.ts +7 -0
- package/dist/sync/v3/taskCommentActivityIdentity.js +15 -0
- package/dist/sync/v3/taskCommentMutationService.d.ts +150 -0
- package/dist/sync/v3/taskCommentMutationService.js +392 -0
- package/dist/sync/v3/taskCommentReconcileProvenance.d.ts +58 -0
- package/dist/sync/v3/taskCommentReconcileProvenance.js +170 -0
- package/dist/sync/v3/taskCreateActivation.d.ts +19 -0
- package/dist/sync/v3/taskCreateActivation.js +84 -0
- package/dist/sync/v3/taskCreateActivityIdentity.d.ts +7 -0
- package/dist/sync/v3/taskCreateActivityIdentity.js +18 -0
- package/dist/sync/v3/taskCreateMutationService.d.ts +103 -0
- package/dist/sync/v3/taskCreateMutationService.js +283 -0
- package/dist/sync/v3/taskDeleteActivation.d.ts +7 -0
- package/dist/sync/v3/taskDeleteActivation.js +14 -0
- package/dist/sync/v3/taskDeleteMutationService.d.ts +35 -0
- package/dist/sync/v3/taskDeleteMutationService.js +133 -0
- package/dist/sync/v3/taskLegacyRootAdoptionService.d.ts +78 -0
- package/dist/sync/v3/taskLegacyRootAdoptionService.js +175 -0
- package/dist/sync/v3/taskLifecycleActivityIdentity.d.ts +9 -0
- package/dist/sync/v3/taskLifecycleActivityIdentity.js +18 -0
- package/dist/sync/v3/taskLifecycleMutationPayload.d.ts +5 -0
- package/dist/sync/v3/taskLifecycleMutationPayload.js +28 -0
- package/dist/sync/v3/taskLifecycleMutationService.d.ts +66 -0
- package/dist/sync/v3/taskLifecycleMutationService.js +92 -0
- package/dist/sync/v3/taskMetadataActivation.d.ts +12 -0
- package/dist/sync/v3/taskMetadataActivation.js +38 -0
- package/dist/sync/v3/taskMetadataActivityIdentity.d.ts +7 -0
- package/dist/sync/v3/taskMetadataActivityIdentity.js +18 -0
- package/dist/sync/v3/taskMetadataCoexistence.d.ts +37 -0
- package/dist/sync/v3/taskMetadataCoexistence.js +134 -0
- package/dist/sync/v3/taskMetadataMutationService.d.ts +71 -0
- package/dist/sync/v3/taskMetadataMutationService.js +199 -0
- package/dist/sync/v3/taskRelationshipLegacyAdoptionService.d.ts +48 -0
- package/dist/sync/v3/taskRelationshipLegacyAdoptionService.js +164 -0
- package/dist/sync/v3/taskRelationshipMutationService.d.ts +50 -0
- package/dist/sync/v3/taskRelationshipMutationService.js +148 -0
- package/dist/sync/v3/taskRestoreMutationService.d.ts +90 -0
- package/dist/sync/v3/taskRestoreMutationService.js +179 -0
- package/dist/sync/v3/taskStatusActivation.d.ts +7 -0
- package/dist/sync/v3/taskStatusActivation.js +15 -0
- package/dist/sync/v3/taskStatusMutationService.d.ts +76 -0
- package/dist/sync/v3/taskStatusMutationService.js +308 -0
- package/dist/sync/v3/taskWorkflowMutationPayload.d.ts +4 -0
- package/dist/sync/v3/taskWorkflowMutationPayload.js +22 -0
- package/dist/sync/v3/taskWorkflowMutationService.d.ts +64 -0
- package/dist/sync/v3/taskWorkflowMutationService.js +102 -0
- package/dist/sync/v3/taxonomyCoexistence.d.ts +10 -0
- package/dist/sync/v3/taxonomyCoexistence.js +19 -0
- package/dist/sync/v3/taxonomyCompositeMutationService.d.ts +110 -0
- package/dist/sync/v3/taxonomyCompositeMutationService.js +304 -0
- package/dist/sync/v3/taxonomyMutationService.d.ts +57 -0
- package/dist/sync/v3/taxonomyMutationService.js +106 -0
- package/dist/sync/v3/taxonomyStateMutation.d.ts +22 -0
- package/dist/sync/v3/taxonomyStateMutation.js +49 -0
- package/dist/sync/v3/taxonomySyncPayload.d.ts +9 -0
- package/dist/sync/v3/taxonomySyncPayload.js +199 -0
- package/dist/sync/v3/workflowAssignmentSync.d.ts +22 -0
- package/dist/sync/v3/workflowAssignmentSync.js +213 -0
- package/dist/sync/v3/workflowRuntimeMutationService.d.ts +89 -0
- package/dist/sync/v3/workflowRuntimeMutationService.js +359 -0
- package/dist/sync/v3/workflowRuntimeOperationIdentity.d.ts +13 -0
- package/dist/sync/v3/workflowRuntimeOperationIdentity.js +35 -0
- package/dist/sync/v3/workflowRuntimeSync.d.ts +141 -0
- package/dist/sync/v3/workflowRuntimeSync.js +485 -0
- package/dist/sync/v3/workspaceSyncJournalReader.d.ts +43 -0
- package/dist/sync/v3/workspaceSyncJournalReader.js +45 -0
- package/dist/sync/v3/workspaceSyncLocalOwnershipSnapshot.d.ts +28 -0
- package/dist/sync/v3/workspaceSyncLocalOwnershipSnapshot.js +81 -0
- package/dist/sync/v3/workspaceSyncPayloadFingerprint.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncPayloadFingerprint.js +5 -0
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.d.ts +16 -0
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.js +161 -0
- package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.d.ts +83 -0
- package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.js +161 -0
- package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.d.ts +16 -0
- package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.js +90 -0
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.d.ts +65 -0
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.js +356 -0
- package/dist/sync/v3/workspaceSyncV3CombinedCoverage.d.ts +51 -0
- package/dist/sync/v3/workspaceSyncV3CombinedCoverage.js +171 -0
- package/dist/sync/v3/workspaceSyncV3CombinedFeedOrchestrator.d.ts +43 -0
- package/dist/sync/v3/workspaceSyncV3CombinedFeedOrchestrator.js +535 -0
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.d.ts +50 -0
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +1149 -0
- package/dist/sync/v3/workspaceSyncV3CombinedProjectionState.d.ts +96 -0
- package/dist/sync/v3/workspaceSyncV3CombinedProjectionState.js +672 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.d.ts +42 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.js +598 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.d.ts +65 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.js +505 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.d.ts +78 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.js +511 -0
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.d.ts +45 -0
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.js +125 -0
- package/dist/sync/v3/workspaceSyncV3CoverageRegistry.d.ts +13 -0
- package/dist/sync/v3/workspaceSyncV3CoverageRegistry.js +34 -0
- package/dist/sync/v3/workspaceSyncV3CursorEncoding.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3CursorEncoding.js +6 -0
- package/dist/sync/v3/workspaceSyncV3DomainAdmission.d.ts +43 -0
- package/dist/sync/v3/workspaceSyncV3DomainAdmission.js +118 -0
- package/dist/sync/v3/workspaceSyncV3Feed.d.ts +95 -0
- package/dist/sync/v3/workspaceSyncV3Feed.js +243 -0
- package/dist/sync/v3/workspaceSyncV3FeedApply.d.ts +13 -0
- package/dist/sync/v3/workspaceSyncV3FeedApply.js +67 -0
- package/dist/sync/v3/workspaceSyncV3FeedClientContract.d.ts +3 -0
- package/dist/sync/v3/workspaceSyncV3FeedClientContract.js +46 -0
- package/dist/sync/v3/workspaceSyncV3FeedCursorKeys.d.ts +10 -0
- package/dist/sync/v3/workspaceSyncV3FeedCursorKeys.js +58 -0
- package/dist/sync/v3/workspaceSyncV3FeedOrchestrator.d.ts +31 -0
- package/dist/sync/v3/workspaceSyncV3FeedOrchestrator.js +228 -0
- package/dist/sync/v3/workspaceSyncV3FeedProfile.d.ts +32 -0
- package/dist/sync/v3/workspaceSyncV3FeedProfile.js +21 -0
- package/dist/sync/v3/workspaceSyncV3InitiativeLocalApply.d.ts +36 -0
- package/dist/sync/v3/workspaceSyncV3InitiativeLocalApply.js +163 -0
- package/dist/sync/v3/workspaceSyncV3InitiativeRepair.d.ts +33 -0
- package/dist/sync/v3/workspaceSyncV3InitiativeRepair.js +118 -0
- package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.d.ts +10 -0
- package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.js +45 -0
- package/dist/sync/v3/workspaceSyncV3LocalOutboxStatus.d.ts +27 -0
- package/dist/sync/v3/workspaceSyncV3LocalOutboxStatus.js +83 -0
- package/dist/sync/v3/workspaceSyncV3NestedCoverage.d.ts +10 -0
- package/dist/sync/v3/workspaceSyncV3NestedCoverage.js +40 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskApply.d.ts +83 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskApply.js +325 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.d.ts +59 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.js +302 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.d.ts +47 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.js +329 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.d.ts +19 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.js +41 -0
- package/dist/sync/v3/workspaceSyncV3NestedWireContract.d.ts +6 -0
- package/dist/sync/v3/workspaceSyncV3NestedWireContract.js +16 -0
- package/dist/sync/v3/workspaceSyncV3OperationProjection.d.ts +8 -0
- package/dist/sync/v3/workspaceSyncV3OperationProjection.js +52 -0
- package/dist/sync/v3/workspaceSyncV3OperationProtocol.d.ts +229 -0
- package/dist/sync/v3/workspaceSyncV3OperationProtocol.js +1 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.d.ts +165 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.js +414 -0
- package/dist/sync/v3/workspaceSyncV3OriginActor.d.ts +36 -0
- package/dist/sync/v3/workspaceSyncV3OriginActor.js +61 -0
- package/dist/sync/v3/workspaceSyncV3OriginAssertion.d.ts +46 -0
- package/dist/sync/v3/workspaceSyncV3OriginAssertion.js +121 -0
- package/dist/sync/v3/workspaceSyncV3OriginAssertionHeader.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3OriginAssertionHeader.js +1 -0
- package/dist/sync/v3/workspaceSyncV3PlanningOrderCoverage.d.ts +10 -0
- package/dist/sync/v3/workspaceSyncV3PlanningOrderCoverage.js +34 -0
- package/dist/sync/v3/workspaceSyncV3PlanningOrderWireContract.d.ts +6 -0
- package/dist/sync/v3/workspaceSyncV3PlanningOrderWireContract.js +10 -0
- package/dist/sync/v3/workspaceSyncV3ProjectionState.d.ts +105 -0
- package/dist/sync/v3/workspaceSyncV3ProjectionState.js +467 -0
- package/dist/sync/v3/workspaceSyncV3TaskCommentAudit.d.ts +56 -0
- package/dist/sync/v3/workspaceSyncV3TaskCommentAudit.js +250 -0
- package/dist/sync/v3/workspaceSyncV3TaskRelationshipProjection.d.ts +30 -0
- package/dist/sync/v3/workspaceSyncV3TaskRelationshipProjection.js +142 -0
- package/dist/sync/v3/workspaceSyncV3TaskRootProjection.d.ts +40 -0
- package/dist/sync/v3/workspaceSyncV3TaskRootProjection.js +246 -0
- package/dist/sync/v3/workspaceSyncV3TaxonomyFeedProjection.d.ts +39 -0
- package/dist/sync/v3/workspaceSyncV3TaxonomyFeedProjection.js +185 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowCoverage.d.ts +10 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowCoverage.js +36 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeApply.d.ts +17 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeApply.js +143 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeProjection.d.ts +9 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowRuntimeProjection.js +195 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowWireContract.d.ts +11 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowWireContract.js +12 -0
- package/dist/sync/v3/workspaceSyncV3WorkstreamProjection.d.ts +4 -0
- package/dist/sync/v3/workspaceSyncV3WorkstreamProjection.js +98 -0
- package/dist/sync/v3/workspaceSyncV3WorkstreamTaskOrderProjection.d.ts +9 -0
- package/dist/sync/v3/workspaceSyncV3WorkstreamTaskOrderProjection.js +72 -0
- package/dist/sync/v3/workstreamActivityAuthoritativeRevision.d.ts +11 -0
- package/dist/sync/v3/workstreamActivityAuthoritativeRevision.js +23 -0
- package/dist/sync/v3/workstreamActivityIdentity.d.ts +8 -0
- package/dist/sync/v3/workstreamActivityIdentity.js +14 -0
- package/dist/sync/v3/workstreamCoexistence.d.ts +19 -0
- package/dist/sync/v3/workstreamCoexistence.js +64 -0
- package/dist/sync/v3/workstreamMutationPayload.d.ts +27 -0
- package/dist/sync/v3/workstreamMutationPayload.js +147 -0
- package/dist/sync/v3/workstreamMutationService.d.ts +72 -0
- package/dist/sync/v3/workstreamMutationService.js +256 -0
- package/dist/sync/v3/workstreamTaskOrderMutationService.d.ts +55 -0
- package/dist/sync/v3/workstreamTaskOrderMutationService.js +110 -0
- package/dist/sync/v3/workstreamTaskOrderSync.d.ts +14 -0
- package/dist/sync/v3/workstreamTaskOrderSync.js +25 -0
- package/dist/sync/workspaceContentManifest.d.ts +86 -0
- package/dist/sync/workspaceContentManifest.js +123 -0
- package/dist/sync/workspacePullFeed.d.ts +186 -2
- package/dist/sync/workspacePullFeed.js +513 -136
- package/dist/sync/workspacePushPreparedPlan.d.ts +21 -0
- package/dist/sync/workspacePushPreparedPlan.js +1 -0
- package/dist/sync/workspaceRepair.d.ts +17 -25
- package/dist/sync/workspaceRepair.js +348 -25
- package/dist/sync/workspaceSyncContentDecryption.d.ts +6 -0
- package/dist/sync/workspaceSyncContentDecryption.js +11 -0
- package/dist/sync/workspaceSyncModel.d.ts +216 -5
- package/dist/sync/workspaceSyncModel.js +371 -35
- package/dist/sync/workspaceSyncSnapshotProjection.d.ts +11 -0
- package/dist/sync/workspaceSyncSnapshotProjection.js +101 -0
- package/dist/sync/workspaceSyncState.d.ts +13 -0
- package/dist/sync/workspaceSyncState.js +36 -0
- package/dist/sync/workspaceSyncV2SnapshotBuilder.d.ts +106 -0
- package/dist/sync/workspaceSyncV2SnapshotBuilder.js +193 -0
- package/dist/types.d.ts +23 -15
- package/dist/types.js +2 -4
- package/dist/ui/ai-profile-clients/amazon-nova.svg +1 -0
- package/dist/ui/ai-profile-clients/antigravity.png +0 -0
- package/dist/ui/ai-profile-clients/chatgpt.svg +10 -0
- package/dist/ui/ai-profile-clients/claude-chat.svg +1 -0
- package/dist/ui/ai-profile-clients/claude-code.svg +15 -0
- package/dist/ui/ai-profile-clients/cline-app-icon-light.png +0 -0
- package/dist/ui/ai-profile-clients/cline.svg +16 -0
- package/dist/ui/ai-profile-clients/codex.svg +1 -0
- package/dist/ui/ai-profile-clients/copilot.png +0 -0
- package/dist/ui/ai-profile-clients/cursor.svg +1 -0
- package/dist/ui/ai-profile-clients/deepseek.svg +1 -0
- package/dist/ui/ai-profile-clients/gemini-cli-icon.png +0 -0
- package/dist/ui/ai-profile-clients/gemini.svg +10 -0
- package/dist/ui/ai-profile-clients/grok.svg +31 -0
- package/dist/ui/ai-profile-clients/kiro.svg +11 -0
- package/dist/ui/ai-profile-clients/llama.svg +1 -0
- package/dist/ui/ai-profile-clients/mistral.svg +1 -0
- package/dist/ui/ai-profile-clients/ms_copilot.jpeg +0 -0
- package/dist/ui/ai-profile-clients/openclaw.png +0 -0
- package/dist/ui/ai-profile-clients/perplexity.svg +1 -0
- package/dist/ui/ai-profile-clients/vscode.svg +41 -0
- package/dist/ui/ai-profile-clients/windsurf.svg +11 -0
- package/dist/ui/assets/AiIdentityRosterCard-DB1BLO_j.js +1 -0
- package/dist/ui/assets/AiProfilesModule-DPxQeF9N.js +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-CBRZ8rca.css +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-DHNYaNg6.js +3 -0
- package/dist/ui/assets/AssetTraySortControl-B9k5caQW.css +1 -0
- package/dist/ui/assets/AssetTraySortControl-DphbyHVc.js +1 -0
- package/dist/ui/assets/ContextAttachmentManager-CMxSzHqc.js +3 -0
- package/dist/ui/assets/DocumentWorkspace-BC7sy5TG.js +261 -0
- package/dist/ui/assets/DocumentWorkspace-BIBGBfd7.css +1 -0
- package/dist/ui/assets/EntityActivityTimeline-BfJbZRdl.css +1 -0
- package/dist/ui/assets/EntityActivityTimeline-pJ2ZjZ-k.js +1 -0
- package/dist/ui/assets/PlanningModule-CeTqXMMz.css +1 -0
- package/dist/ui/assets/PlanningModule-t5GbvVR9.js +1 -0
- package/dist/ui/assets/PlansPage-BVH_NfgT.js +1 -0
- package/dist/ui/assets/PlansPage-C2nkK2Bp.css +1 -0
- package/dist/ui/assets/TaskContextUpload-Ds4LnDzV.css +1 -0
- package/dist/ui/assets/TaskContextUpload-bl4fOOUz.js +1 -0
- package/dist/ui/assets/TaskSettings-xVsxSa0g.js +12 -0
- package/dist/ui/assets/TaskforceAgentsModule-CkAxW19K.js +21 -0
- package/dist/ui/assets/TaskforceAgentsModule-D6IC0S7Q.css +1 -0
- package/dist/ui/assets/WorkflowManagerModule-BKqIGVnF.js +1 -0
- package/dist/ui/assets/WorkflowManagerModule-DF10XENz.css +1 -0
- package/dist/ui/assets/antigravity-DRKQga2U.png +0 -0
- package/dist/ui/assets/cursor-BM_3k4Y4.svg +1 -0
- package/dist/ui/assets/gemini-cli-icon-dBAVjCcn.png +0 -0
- package/dist/ui/assets/grok-BuodbWaG.svg +31 -0
- package/dist/ui/assets/index-BzJlVnNS.css +1 -0
- package/dist/ui/assets/index-Cx7vZJHL.js +7 -0
- package/dist/ui/assets/{vendor-dnd-DRzYolkg.js → vendor-dnd-CJ-AjP-Y.js} +1 -1
- package/dist/ui/assets/{vendor-icons-CLnehDTw.js → vendor-icons-B8ZNsH1g.js} +1 -1
- package/dist/ui/assets/{vendor-markdown-BUxTU7dS.js → vendor-markdown-_lhNCyq-.js} +9 -9
- package/dist/ui/assets/vendor-router-AqJMU8Lz.js +3 -0
- package/dist/ui/assets/vscode-C_7wk1WI.svg +41 -0
- package/dist/ui/branding/logos/logo_dark_bg.png +0 -0
- package/dist/ui/branding/logos/logo_favicon_dark.png +0 -0
- package/dist/ui/branding/logos/logo_favicon_dark.svg +56 -0
- package/dist/ui/branding/logos/logo_favicon_light.png +0 -0
- package/dist/ui/branding/logos/logo_light_bg.png +0 -0
- package/dist/ui/images/Taskforce_Van.webp +0 -0
- package/dist/ui/index.html +6 -6
- package/dist/update/uiUpdateService.d.ts +43 -0
- package/dist/update/uiUpdateService.js +149 -0
- package/dist/update/updateCli.d.ts +15 -0
- package/dist/update/updateCli.js +76 -0
- package/dist/update/updateExecutor.d.ts +40 -0
- package/dist/update/updateExecutor.js +474 -0
- package/dist/update/updateStatus.d.ts +83 -0
- package/dist/update/updateStatus.js +703 -0
- package/dist/utils/aiProfileAvatarPaths.d.ts +14 -0
- package/dist/utils/aiProfileAvatarPaths.js +52 -0
- package/dist/utils/aiProfileDefaultLogo.d.ts +7 -0
- package/dist/utils/aiProfileDefaultLogo.js +84 -0
- package/dist/utils/aiProfileEvents.d.ts +9 -1
- package/dist/utils/annotatedAttachments.d.ts +8 -0
- package/dist/utils/annotatedAttachments.js +17 -1
- package/dist/utils/assetTraySorting.d.ts +25 -0
- package/dist/utils/assetTraySorting.js +83 -0
- package/dist/utils/assignees.d.ts +5 -0
- package/dist/utils/assignees.js +14 -9
- package/dist/utils/authLogin.d.ts +10 -0
- package/dist/utils/authLogin.js +8 -0
- package/dist/utils/authSessionEvents.d.ts +2 -0
- package/dist/utils/authSessionEvents.js +6 -0
- package/dist/utils/avatarUpload.js +5 -5
- package/dist/utils/canonicalReferenceAttachments.d.ts +12 -0
- package/dist/utils/canonicalReferenceAttachments.js +42 -0
- package/dist/utils/cloudAssetDisplay.d.ts +2 -0
- package/dist/utils/cloudAssetDisplay.js +8 -0
- package/dist/utils/constants.d.ts +4 -11
- package/dist/utils/constants.js +5 -64
- package/dist/utils/contextAttachmentPreview.d.ts +11 -0
- package/dist/utils/contextAttachmentPreview.js +8 -0
- package/dist/utils/contextAttachmentUpload.d.ts +8 -0
- package/dist/utils/contextAttachmentUpload.js +144 -0
- package/dist/utils/documentNames.js +6 -4
- package/dist/utils/entityReferences.d.ts +14 -0
- package/dist/utils/entityReferences.js +21 -0
- package/dist/utils/httpSetCookie.d.ts +3 -0
- package/dist/utils/httpSetCookie.js +22 -0
- package/dist/utils/imageNoteStoragePaths.d.ts +3 -0
- package/dist/utils/imageNoteStoragePaths.js +19 -0
- package/dist/utils/imageReferences.d.ts +6 -0
- package/dist/utils/imageReferences.js +1 -0
- package/dist/utils/planningArchiveOrchestrator.d.ts +23 -0
- package/dist/utils/planningArchiveOrchestrator.js +37 -0
- package/dist/utils/planningArchivePresentation.d.ts +20 -0
- package/dist/utils/planningArchivePresentation.js +23 -0
- package/dist/utils/planningArchiveReadiness.d.ts +26 -0
- package/dist/utils/planningArchiveReadiness.js +30 -0
- package/dist/utils/planningFavorites.d.ts +7 -0
- package/dist/utils/planningFavorites.js +34 -0
- package/dist/utils/syncEventPresentation.js +53 -0
- package/dist/utils/syncStatusPresentation.d.ts +25 -0
- package/dist/utils/syncStatusPresentation.js +86 -5
- package/dist/utils/taskActivity.d.ts +9 -2
- package/dist/utils/taskActivity.js +61 -0
- package/dist/utils/taskDraftDefaults.d.ts +0 -8
- package/dist/utils/taskDraftDefaults.js +0 -4
- package/dist/utils/taskEvents.d.ts +11 -0
- package/dist/utils/taskEvents.js +6 -0
- package/dist/utils/taskHeaderQuickFilter.d.ts +14 -0
- package/dist/utils/taskHeaderQuickFilter.js +32 -0
- package/dist/utils/taskInvalidation.d.ts +23 -0
- package/dist/utils/taskInvalidation.js +67 -0
- package/dist/utils/taskNormalization.d.ts +2 -1
- package/dist/utils/taskNormalization.js +44 -18
- package/dist/utils/taskReferences.d.ts +16 -0
- package/dist/utils/taskReferences.js +63 -0
- package/dist/utils/taskforceAgentEvents.d.ts +8 -0
- package/dist/utils/taskforceAgentEvents.js +6 -0
- package/dist/utils/taskforceAgentSkillEvents.d.ts +7 -0
- package/dist/utils/taskforceAgentSkillEvents.js +8 -0
- package/dist/utils/theme.js +1 -1
- package/dist/utils/uiNotice.d.ts +3 -0
- package/dist/utils/uiNotice.js +1 -1
- package/dist/utils/workspaceResourceEvents.d.ts +7 -0
- package/dist/utils/workspaceResourceEvents.js +6 -0
- package/dist/utils/workspaceSyncPresentation.d.ts +24 -0
- package/dist/utils/workspaceSyncPresentation.js +243 -6
- package/package.json +69 -21
- package/dist/components/features/AgentsModule.d.ts +0 -18
- package/dist/components/features/AgentsModule.js +0 -479
- package/dist/components/features/InitiativesModule.d.ts +0 -22
- package/dist/components/features/InitiativesModule.js +0 -33
- package/dist/components/features/WorkflowsModule.d.ts +0 -27
- package/dist/components/features/WorkflowsModule.js +0 -21
- package/dist/components/features/settings/WorkflowEditor.d.ts +0 -15
- package/dist/components/features/settings/WorkflowEditor.js +0 -245
- package/dist/components/views/panels/DocumentFilterToolbar.d.ts +0 -10
- package/dist/components/views/panels/DocumentFilterToolbar.js +0 -7
- package/dist/components/views/standalone/modals/AccountHubModal.d.ts +0 -61
- package/dist/components/views/standalone/modals/AccountHubModal.js +0 -108
- package/dist/components/views/standalone/modals/EditProfileModal.d.ts +0 -19
- package/dist/components/views/standalone/modals/EditProfileModal.js +0 -11
- package/dist/hooks/ui/useResourceExport.d.ts +0 -21
- package/dist/hooks/ui/useResourceExport.js +0 -87
- package/dist/hooks/ui/useWorkflowTemplates.d.ts +0 -37
- package/dist/hooks/ui/useWorkflowTemplates.js +0 -116
- package/dist/mcp/clientProfileDefaults.d.ts +0 -12
- package/dist/mcp/clientProfileDefaults.js +0 -37
- package/dist/resources/templates/WORKFLOW_V2_POLICY.md +0 -55
- package/dist/resources/templates/environments/aider.yaml +0 -14
- package/dist/resources/templates/environments/antigravity.yaml +0 -10
- package/dist/resources/templates/environments/claude.yaml +0 -10
- package/dist/resources/templates/environments/cline.yaml +0 -10
- package/dist/resources/templates/environments/codex.yaml +0 -13
- package/dist/resources/templates/environments/copilot.yaml +0 -10
- package/dist/resources/templates/environments/cursor.yaml +0 -9
- package/dist/resources/templates/environments/gemini.yaml +0 -9
- package/dist/resources/templates/environments/windsurf.yaml +0 -10
- package/dist/resources/templates/workflow-sources/README.md +0 -9
- package/dist/resources/templates/workflow-sources/workflowDocs.mjs +0 -530
- package/dist/resources/templates/workflow-sources/workflowEditorOverrides.json +0 -1
- package/dist/resources/templates/workflows/collaborate.yaml +0 -110
- package/dist/resources/templates/workflows/do.yaml +0 -88
- package/dist/resources/templates/workflows/evaluate.yaml +0 -117
- package/dist/resources/templates/workflows/execute.yaml +0 -159
- package/dist/resources/templates/workflows/plan.yaml +0 -119
- package/dist/resources/templates/workflows/review.yaml +0 -115
- package/dist/services/formatTransformers.d.ts +0 -29
- package/dist/services/formatTransformers.js +0 -56
- package/dist/services/templateEngine.d.ts +0 -46
- package/dist/services/templateEngine.js +0 -148
- package/dist/shared/workflowDefaults.d.ts +0 -9
- package/dist/shared/workflowDefaults.js +0 -11
- package/dist/ui/agent-logos/Gemini CLI.jpeg +0 -0
- package/dist/ui/agent-logos/antigravity.jpeg +0 -0
- package/dist/ui/agent-logos/chatgpt.png +0 -0
- package/dist/ui/agent-logos/claude-code.jpeg +0 -0
- package/dist/ui/agent-logos/codex.jpeg +0 -0
- package/dist/ui/agent-logos/cursor.png +0 -0
- package/dist/ui/agent-logos/openclaw.jpeg +0 -0
- package/dist/ui/agent-logos/windsurf.png +0 -0
- package/dist/ui/assets/AgentsModule-DvkbUHi0.js +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BVKew-mH.css +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-jhOhxqHT.js +0 -3
- package/dist/ui/assets/ContextAttachmentManager-BAmEyLHL.js +0 -3
- package/dist/ui/assets/DocumentWorkspace-D4rJKXzd.css +0 -1
- package/dist/ui/assets/DocumentWorkspace-X-CpD5OO.js +0 -252
- package/dist/ui/assets/EntityActivityTimeline-DD33onAC.js +0 -1
- package/dist/ui/assets/EntityActivityTimeline-DyqvvhuF.css +0 -1
- package/dist/ui/assets/InitiativesModule-5nDXtIjf.js +0 -1
- package/dist/ui/assets/PlansPage-B8nDR1hQ.js +0 -1
- package/dist/ui/assets/PlansPage-DeAzWYTb.css +0 -1
- package/dist/ui/assets/TaskContextUpload-DrGrXJHm.js +0 -1
- package/dist/ui/assets/TaskSettings-BXVvZZwH.js +0 -9
- package/dist/ui/assets/WorkflowsModule-DWCGhEWT.js +0 -5
- package/dist/ui/assets/documentReferences-Crup321p.js +0 -1
- package/dist/ui/assets/index-B9k24Aym.js +0 -5
- package/dist/ui/assets/index-DNeR5dYW.css +0 -1
- package/dist/ui/assets/vendor-router-BbWMxlnO.js +0 -3
- package/dist/ui/branding/logos/logo_black_01.png +0 -0
- package/dist/ui/branding/logos/logo_black_02.png +0 -0
- package/dist/ui/branding/logos/logo_white_01.png +0 -0
- package/dist/ui/branding/logos/logo_white_02.png +0 -0
- package/scripts/generate-workflow-templates.mjs +0 -134
- package/src/resources/templates/WORKFLOW_V2_POLICY.md +0 -55
- package/src/resources/templates/environments/aider.yaml +0 -14
- package/src/resources/templates/environments/antigravity.yaml +0 -10
- package/src/resources/templates/environments/claude.yaml +0 -10
- package/src/resources/templates/environments/cline.yaml +0 -10
- package/src/resources/templates/environments/codex.yaml +0 -13
- package/src/resources/templates/environments/copilot.yaml +0 -10
- package/src/resources/templates/environments/cursor.yaml +0 -9
- package/src/resources/templates/environments/gemini.yaml +0 -9
- package/src/resources/templates/environments/windsurf.yaml +0 -10
- package/src/resources/templates/workflow-sources/README.md +0 -9
- package/src/resources/templates/workflow-sources/workflowDocs.mjs +0 -530
- package/src/resources/templates/workflow-sources/workflowEditorOverrides.json +0 -1
- package/src/resources/templates/workflows/collaborate.yaml +0 -110
- package/src/resources/templates/workflows/do.yaml +0 -88
- package/src/resources/templates/workflows/evaluate.yaml +0 -117
- package/src/resources/templates/workflows/execute.yaml +0 -159
- package/src/resources/templates/workflows/plan.yaml +0 -119
- package/src/resources/templates/workflows/review.yaml +0 -115
- /package/dist/ui/branding/logos/{logo_dark.svg → logo_dark_no_bg.svg} +0 -0
- /package/dist/ui/branding/logos/{logo_favicon.svg → logo_favicon_light.svg} +0 -0
- /package/dist/ui/branding/logos/{logo_light.svg → logo_light_no_bg.svg} +0 -0
|
@@ -0,0 +1,1782 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
|
+
import { AlertTriangle, Beaker, Bot, BriefcaseBusiness, CheckCircle, ChevronLeft, Database, ExternalLink, Loader2, MessageSquare, Pencil, Plug, Plus, RotateCcw, Save, Send, Sparkles, X } from 'lucide-react';
|
|
4
|
+
import styles from '../../Taskforce.module.css';
|
|
5
|
+
import { AI_PROFILE_COLOR_TOKENS, assignedAiProfileColor } from '../../shared/aiProfileColors.js';
|
|
6
|
+
import { COLOR_PALETTE } from '../../shared/colorPalette.js';
|
|
7
|
+
import { DEFAULT_TASKFORCE_AGENT_MODEL_KEY, DEFAULT_TASKFORCE_AGENT_PROVIDER_KEY, TASKFORCE_AGENT_PROVIDER_OPTIONS, labelForTaskforceAgentModel, labelForTaskforceAgentProvider, modelsForTaskforceAgentProvider, normalizeTaskforceAgentModelKey, normalizeTaskforceAgentProviderKey, } from '../../shared/taskforceAgentModels';
|
|
8
|
+
import { dispatchTaskforceAgentsMutated, TASKFORCE_AGENTS_MUTATED_EVENT } from '../../utils/taskforceAgentEvents';
|
|
9
|
+
import { dispatchTaskforceTasksMutated } from '../../utils/taskEvents';
|
|
10
|
+
import { buildVersionedAvatarUrl } from '../../utils/avatarDisplay';
|
|
11
|
+
import { resolveCloudAssetDisplayUrl, withTaskforceCloudHint } from '../../utils/cloudAssetDisplay';
|
|
12
|
+
import { dispatchTaskforceAiProfilesMutated, TASKFORCE_AI_PROFILES_MUTATED_EVENT, } from '../../utils/aiProfileEvents';
|
|
13
|
+
import { AiIdentityRosterCard } from '../ui/AiIdentityRosterCard.js';
|
|
14
|
+
import { EditableAvatarButton } from '../ui/EditableAvatarButton.js';
|
|
15
|
+
import { useFallbackImageUrl } from '../ui/useFallbackImageUrl.js';
|
|
16
|
+
import { Modal } from '../ui/Modal.js';
|
|
17
|
+
import { AvatarImageManagerModal } from '../views/standalone/modals/AvatarImageManagerModal.js';
|
|
18
|
+
import { prepareAvatarUploadFile } from '../../utils/avatarUpload.js';
|
|
19
|
+
import { Markdown } from '../ui/Markdown.js';
|
|
20
|
+
import { RoleManagerPanel } from './agentRoles/RoleManagerPanel.js';
|
|
21
|
+
import { AgentBehaviorAssignments } from './taskforceAgentAssignments/AgentBehaviorAssignments.js';
|
|
22
|
+
import { AVATAR_ART_STYLE_PRESETS, buildTaskforceAgentDefinitionFromDraft, createTaskforceAgentEditorDraft, CUSTOM_PRESET_VALUE, DEFAULT_AVATAR_ART_STYLE_LABEL, hasUnsavedAvatarPresentation, PERSONALITY_PRESETS, RESPONSE_STYLE_PRESETS, } from './taskforceAgentEditorModel.js';
|
|
23
|
+
import { SkillManagerPanel } from './agentSkills/SkillManagerPanel.js';
|
|
24
|
+
import { EffectiveConfigurationSummary, FutureLibrarySummary, FutureWorkspacePanel, ToolAccessSelector, } from './agentCapabilities/AgentCapabilitiesPrototype.js';
|
|
25
|
+
import { applyCloudWorkflowCompletionProjection, } from './workflowManager/workflowManagerApi.js';
|
|
26
|
+
const DEFAULT_SYSTEM_PROMPT = 'Be concise and actionable.';
|
|
27
|
+
const DEFAULT_AGENT_NAME = 'New Taskforce Agent';
|
|
28
|
+
const TEST_PROMPT_PLACEHOLDER = 'Message this agent...';
|
|
29
|
+
const AGENT_ROSTER_REFRESH_INTERVAL_MS = 10_000;
|
|
30
|
+
const AGENT_BUILDER_TABS = [
|
|
31
|
+
{ id: 'agents', label: 'Agents' },
|
|
32
|
+
{ id: 'roles', label: 'Roles' },
|
|
33
|
+
{ id: 'skills', label: 'Skills' },
|
|
34
|
+
{ id: 'connections', label: 'Connections' },
|
|
35
|
+
{ id: 'resources', label: 'Resources' },
|
|
36
|
+
];
|
|
37
|
+
function formatModelGatewayUsage(result) {
|
|
38
|
+
const totalTokens = result?.usage?.totalTokens;
|
|
39
|
+
return totalTokens === undefined || totalTokens === null
|
|
40
|
+
? 'Not reported'
|
|
41
|
+
: `${totalTokens} tokens`;
|
|
42
|
+
}
|
|
43
|
+
function formatModelGatewayLatency(result) {
|
|
44
|
+
return result?.latencyMs === undefined || result?.latencyMs === null
|
|
45
|
+
? 'Not reported'
|
|
46
|
+
: `${result.latencyMs} ms`;
|
|
47
|
+
}
|
|
48
|
+
function getAgentAvatarUrl(agent) {
|
|
49
|
+
if (!agent?.avatarUrl)
|
|
50
|
+
return '';
|
|
51
|
+
return buildVersionedAvatarUrl(agent.avatarUrl, agent.avatarRevision, agent.avatarUpdatedAt);
|
|
52
|
+
}
|
|
53
|
+
function getAgentAvatarSourceUrl(agent) {
|
|
54
|
+
if (!agent?.avatarSourceUrl)
|
|
55
|
+
return '';
|
|
56
|
+
return buildVersionedAvatarUrl(agent.avatarSourceUrl, agent.avatarRevision, agent.avatarUpdatedAt);
|
|
57
|
+
}
|
|
58
|
+
function AgentAvatarImage({ src, fallbackSize }) {
|
|
59
|
+
const { activeImageUrl, handleImageError } = useFallbackImageUrl(src);
|
|
60
|
+
return activeImageUrl
|
|
61
|
+
? _jsx("img", { src: activeImageUrl, alt: "", onError: handleImageError })
|
|
62
|
+
: _jsx(Bot, { size: fallbackSize });
|
|
63
|
+
}
|
|
64
|
+
function fileToDataUrl(file) {
|
|
65
|
+
return new Promise((resolve, reject) => {
|
|
66
|
+
const reader = new FileReader();
|
|
67
|
+
reader.onload = () => resolve(String(reader.result || ''));
|
|
68
|
+
reader.onerror = () => reject(new Error('Failed to read image file.'));
|
|
69
|
+
reader.readAsDataURL(file);
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function normalizedAvatarRevision(value) {
|
|
73
|
+
if (value === null || value === undefined || value === '')
|
|
74
|
+
return null;
|
|
75
|
+
const revision = Number(value);
|
|
76
|
+
return Number.isFinite(revision) ? Math.max(0, Math.floor(revision)) : null;
|
|
77
|
+
}
|
|
78
|
+
function compactResponseText(value) {
|
|
79
|
+
const text = String(value || '').replace(/\s+/g, ' ').trim();
|
|
80
|
+
return text.length > 260 ? `${text.slice(0, 257).trim()}...` : text;
|
|
81
|
+
}
|
|
82
|
+
function isHtmlResponse(value) {
|
|
83
|
+
return /^\s*(?:<!doctype\s+html|<html\b)/i.test(String(value || ''));
|
|
84
|
+
}
|
|
85
|
+
function formatAgentProvider(_provider) {
|
|
86
|
+
return 'Taskforce HQ';
|
|
87
|
+
}
|
|
88
|
+
function formatModelTier(tier) {
|
|
89
|
+
if (tier === 'fast')
|
|
90
|
+
return 'Fast';
|
|
91
|
+
if (tier === 'advanced')
|
|
92
|
+
return 'Advanced';
|
|
93
|
+
return 'Balanced';
|
|
94
|
+
}
|
|
95
|
+
function formatModelAvailability(availability) {
|
|
96
|
+
if (availability === 'verified')
|
|
97
|
+
return 'Verified';
|
|
98
|
+
if (availability === 'configured')
|
|
99
|
+
return 'Configured';
|
|
100
|
+
return 'Unavailable';
|
|
101
|
+
}
|
|
102
|
+
const SENSITIVE_TOOL_ARG_PATTERN = /(token|secret|password|credential|api[-_]?key|access[-_]?key)/i;
|
|
103
|
+
function sanitizeToolLogValue(value) {
|
|
104
|
+
if (Array.isArray(value))
|
|
105
|
+
return value.map((item) => sanitizeToolLogValue(item));
|
|
106
|
+
if (!value || typeof value !== 'object') {
|
|
107
|
+
if (typeof value !== 'string')
|
|
108
|
+
return value;
|
|
109
|
+
return value.length > 240 ? `${value.slice(0, 237).trim()}...` : value;
|
|
110
|
+
}
|
|
111
|
+
return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
|
|
112
|
+
key,
|
|
113
|
+
SENSITIVE_TOOL_ARG_PATTERN.test(key) ? '[redacted]' : sanitizeToolLogValue(entry),
|
|
114
|
+
]));
|
|
115
|
+
}
|
|
116
|
+
function formatToolLogJson(value) {
|
|
117
|
+
const sanitized = sanitizeToolLogValue(value || {});
|
|
118
|
+
const text = JSON.stringify(sanitized, null, 2);
|
|
119
|
+
return text.length > 700 ? `${text.slice(0, 697).trim()}...` : text;
|
|
120
|
+
}
|
|
121
|
+
function formatToolLogResult(value) {
|
|
122
|
+
const text = String(value || '').replace(/\s+/g, ' ').trim();
|
|
123
|
+
if (!text)
|
|
124
|
+
return 'No result text returned.';
|
|
125
|
+
return text.length > 320 ? `${text.slice(0, 317).trim()}...` : text;
|
|
126
|
+
}
|
|
127
|
+
function formatToolActivitySummary(toolActivity) {
|
|
128
|
+
const count = toolActivity.length;
|
|
129
|
+
if (count === 0)
|
|
130
|
+
return 'No tools used';
|
|
131
|
+
const failedCount = toolActivity.filter((toolCall) => !toolCall.ok).length;
|
|
132
|
+
const toolLabel = count === 1 ? 'tool' : 'tools';
|
|
133
|
+
return failedCount > 0
|
|
134
|
+
? `${count} ${toolLabel} used, ${failedCount} failed`
|
|
135
|
+
: `${count} ${toolLabel} used`;
|
|
136
|
+
}
|
|
137
|
+
function formatToolActivityLogMessage(toolActivity) {
|
|
138
|
+
const count = toolActivity.length;
|
|
139
|
+
const failedCount = toolActivity.filter((toolCall) => !toolCall.ok).length;
|
|
140
|
+
const toolLabel = count === 1 ? 'tool' : 'tools';
|
|
141
|
+
return failedCount > 0
|
|
142
|
+
? `Used ${count} Taskforce ${toolLabel}; ${failedCount} failed.`
|
|
143
|
+
: `Used ${count} Taskforce ${toolLabel}.`;
|
|
144
|
+
}
|
|
145
|
+
function formatMaxOutputTokens(tokens) {
|
|
146
|
+
return typeof tokens === 'number' && Number.isFinite(tokens)
|
|
147
|
+
? `${tokens.toLocaleString()} tokens`
|
|
148
|
+
: 'Not configured';
|
|
149
|
+
}
|
|
150
|
+
function formatConversationRole(message, fallbackAgentLabel) {
|
|
151
|
+
return message.role === 'user' ? 'You' : (message.agentName || fallbackAgentLabel);
|
|
152
|
+
}
|
|
153
|
+
function summarizeConversation(conversation) {
|
|
154
|
+
return {
|
|
155
|
+
id: conversation.id,
|
|
156
|
+
workspaceId: conversation.workspaceId,
|
|
157
|
+
agentId: conversation.agentId,
|
|
158
|
+
taskId: conversation.taskId,
|
|
159
|
+
taskReference: conversation.taskReference,
|
|
160
|
+
taskTitle: conversation.taskTitle,
|
|
161
|
+
context: conversation.context,
|
|
162
|
+
title: conversation.title || conversation.messages.find((message) => message.role === 'user')?.content || 'Agent chat',
|
|
163
|
+
messageCount: conversation.messages.length,
|
|
164
|
+
modelProvider: conversation.modelProvider,
|
|
165
|
+
modelId: conversation.modelId,
|
|
166
|
+
usage: conversation.usage,
|
|
167
|
+
latencyMs: conversation.latencyMs,
|
|
168
|
+
createdAt: conversation.createdAt,
|
|
169
|
+
updatedAt: conversation.updatedAt,
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
function resolveConversationTaskContext(conversation) {
|
|
173
|
+
const context = conversation?.context?.type === 'task' ? conversation.context : null;
|
|
174
|
+
const taskId = String(context?.taskId || conversation?.taskId || '').trim();
|
|
175
|
+
if (!taskId)
|
|
176
|
+
return null;
|
|
177
|
+
const taskReference = String(context?.taskReference || conversation?.taskReference || '').trim();
|
|
178
|
+
const taskTitle = String(context?.taskTitle || conversation?.taskTitle || '').trim();
|
|
179
|
+
return {
|
|
180
|
+
type: 'task',
|
|
181
|
+
taskId,
|
|
182
|
+
taskReference,
|
|
183
|
+
taskTitle,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
function mergeTaskContext(context, fallback) {
|
|
187
|
+
if (!context)
|
|
188
|
+
return null;
|
|
189
|
+
if (!fallback || fallback.taskId !== context.taskId)
|
|
190
|
+
return context;
|
|
191
|
+
return {
|
|
192
|
+
type: 'task',
|
|
193
|
+
taskId: context.taskId,
|
|
194
|
+
taskReference: context.taskReference || fallback.taskReference,
|
|
195
|
+
taskTitle: context.taskTitle || fallback.taskTitle,
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
function formatTaskContextLabel(context) {
|
|
199
|
+
const reference = String(context.taskReference || '').trim();
|
|
200
|
+
const title = String(context.taskTitle || '').trim();
|
|
201
|
+
if (reference)
|
|
202
|
+
return `${reference}${title ? ` · ${title}` : ''}`;
|
|
203
|
+
return title || 'Linked task';
|
|
204
|
+
}
|
|
205
|
+
function formatConversationOption(summary, fallbackContext = null) {
|
|
206
|
+
const title = String(summary.title || 'Agent chat').trim() || 'Agent chat';
|
|
207
|
+
const count = Number(summary.messageCount || 0);
|
|
208
|
+
const ownTaskContext = resolveConversationTaskContext(summary);
|
|
209
|
+
const taskContext = ownTaskContext ? mergeTaskContext(ownTaskContext, fallbackContext) : null;
|
|
210
|
+
const label = count > 0 ? `${title} (${count})` : title;
|
|
211
|
+
return taskContext ? `${formatTaskContextLabel(taskContext)} · ${label}` : label;
|
|
212
|
+
}
|
|
213
|
+
export function TaskforceAgentsModule({ workspaceId, agentRosterTrayOpen = true, onCloseAgentRosterTray, launchContext = null, onClearLaunchContext, onOpenTaskContext, taskReferences, surface = 'module', runtimeMode = 'local', cloudAuthConfigured = false, authSessionResolved = true, isAuthenticated = false, resolveCloudAuthUrl, theme = 'dark', rememberedAgentId, rememberedConversationId, rememberedConversationByAgentId, rememberedSelectionReady = true, onRememberSelection, onRenderDrawerHeader, onOpenConversation, }) {
|
|
214
|
+
const logIdRef = useRef(1);
|
|
215
|
+
const initialAgentWorkspaceRef = useRef(null);
|
|
216
|
+
const loadedAgentWorkspaceRef = useRef(null);
|
|
217
|
+
const selectedAgentIdRef = useRef(null);
|
|
218
|
+
const signatureColorEditPendingRef = useRef(false);
|
|
219
|
+
const configurationDraftDirtyRef = useRef(false);
|
|
220
|
+
const conversationEndRef = useRef(null);
|
|
221
|
+
const conversationRenameRunIdRef = useRef(0);
|
|
222
|
+
const draftTestRunIdRef = useRef(0);
|
|
223
|
+
const builderTabRefs = useRef({
|
|
224
|
+
agents: null,
|
|
225
|
+
roles: null,
|
|
226
|
+
skills: null,
|
|
227
|
+
connections: null,
|
|
228
|
+
resources: null,
|
|
229
|
+
});
|
|
230
|
+
const [activeBuilderTab, setActiveBuilderTab] = useState('agents');
|
|
231
|
+
const [roleLibraryPortalTarget, setRoleLibraryPortalTarget] = useState(null);
|
|
232
|
+
const [skillLibraryPortalTarget, setSkillLibraryPortalTarget] = useState(null);
|
|
233
|
+
const [agents, setAgents] = useState([]);
|
|
234
|
+
const [selectedAgentId, setSelectedAgentId] = useState(null);
|
|
235
|
+
const [agentName, setAgentName] = useState('');
|
|
236
|
+
const [modelProvider, setModelProvider] = useState('taskforce_hq');
|
|
237
|
+
const [providerKey, setProviderKey] = useState(DEFAULT_TASKFORCE_AGENT_PROVIDER_KEY);
|
|
238
|
+
const [modelKey, setModelKey] = useState(DEFAULT_TASKFORCE_AGENT_MODEL_KEY);
|
|
239
|
+
const [modelTier, setModelTier] = useState('balanced');
|
|
240
|
+
const [definitionDraft, setDefinitionDraft] = useState(() => (createTaskforceAgentEditorDraft(null, { systemPrompt: DEFAULT_SYSTEM_PROMPT })));
|
|
241
|
+
const systemPrompt = definitionDraft.workingGuidelines;
|
|
242
|
+
const setSystemPrompt = useCallback((value) => {
|
|
243
|
+
configurationDraftDirtyRef.current = true;
|
|
244
|
+
setDefinitionDraft((current) => ({
|
|
245
|
+
...current,
|
|
246
|
+
workingGuidelines: value,
|
|
247
|
+
}));
|
|
248
|
+
}, []);
|
|
249
|
+
const [signatureColor, setSignatureColor] = useState('');
|
|
250
|
+
const [signatureColorDirty, setSignatureColorDirty] = useState(false);
|
|
251
|
+
const [signatureColorReset, setSignatureColorReset] = useState(false);
|
|
252
|
+
const [prompt, setPrompt] = useState('');
|
|
253
|
+
const [conversationId, setConversationId] = useState(null);
|
|
254
|
+
const [conversationSummaries, setConversationSummaries] = useState([]);
|
|
255
|
+
const [conversationMessages, setConversationMessages] = useState([]);
|
|
256
|
+
const [renamingConversation, setRenamingConversation] = useState(false);
|
|
257
|
+
const [conversationTitleDraft, setConversationTitleDraft] = useState('');
|
|
258
|
+
const [conversationRenameError, setConversationRenameError] = useState('');
|
|
259
|
+
const [savingConversationTitle, setSavingConversationTitle] = useState(false);
|
|
260
|
+
const [result, setResult] = useState(null);
|
|
261
|
+
const [toolActivity, setToolActivity] = useState([]);
|
|
262
|
+
const [promptStatus, setPromptStatus] = useState('');
|
|
263
|
+
const [logs, setLogs] = useState(() => [
|
|
264
|
+
{
|
|
265
|
+
id: logIdRef.current++,
|
|
266
|
+
type: 'info',
|
|
267
|
+
message: 'Ready to run this agent through the server-side model gateway.',
|
|
268
|
+
timestamp: new Date().toLocaleTimeString(),
|
|
269
|
+
}
|
|
270
|
+
]);
|
|
271
|
+
const [testing, setTesting] = useState(false);
|
|
272
|
+
const [draftTestPrompt, setDraftTestPrompt] = useState('');
|
|
273
|
+
const [draftTestResult, setDraftTestResult] = useState(null);
|
|
274
|
+
const [draftTestSnapshot, setDraftTestSnapshot] = useState(null);
|
|
275
|
+
const [draftTestToolActivity, setDraftTestToolActivity] = useState([]);
|
|
276
|
+
const [draftTestError, setDraftTestError] = useState('');
|
|
277
|
+
const [testingDraft, setTestingDraft] = useState(false);
|
|
278
|
+
const [loadingAgents, setLoadingAgents] = useState(false);
|
|
279
|
+
const [loadingConversationList, setLoadingConversationList] = useState(false);
|
|
280
|
+
const [loadingConversation, setLoadingConversation] = useState(false);
|
|
281
|
+
const [savingAgent, setSavingAgent] = useState(false);
|
|
282
|
+
const [configFeedback, setConfigFeedback] = useState(null);
|
|
283
|
+
const [pendingAgentNavigation, setPendingAgentNavigation] = useState(null);
|
|
284
|
+
const [generatingAvatarAgentIds, setGeneratingAvatarAgentIds] = useState(() => new Set());
|
|
285
|
+
const [avatarGenerationFeedbackByAgentId, setAvatarGenerationFeedbackByAgentId] = useState({});
|
|
286
|
+
const [avatarEditorOpen, setAvatarEditorOpen] = useState(false);
|
|
287
|
+
const [agentAvatarBusy, setAgentAvatarBusy] = useState(false);
|
|
288
|
+
const [agentAvatarError, setAgentAvatarError] = useState(null);
|
|
289
|
+
const [agentAvatarNotice, setAgentAvatarNotice] = useState(null);
|
|
290
|
+
const [agentProfileTrayOpen, setAgentProfileTrayOpen] = useState(false);
|
|
291
|
+
const [avatarSyncingAgentIds, setAvatarSyncingAgentIds] = useState(() => new Set());
|
|
292
|
+
const pendingCloudAvatarRevisionByAgentIdRef = useRef(new Map());
|
|
293
|
+
const configuredProviderOptions = useMemo(() => TASKFORCE_AGENT_PROVIDER_OPTIONS.filter((provider) => modelsForTaskforceAgentProvider(provider.key).length > 0), []);
|
|
294
|
+
const modelOptions = useMemo(() => modelsForTaskforceAgentProvider(providerKey), [providerKey]);
|
|
295
|
+
const selectedModel = useMemo(() => modelOptions.find((model) => model.key === modelKey) || null, [modelKey, modelOptions]);
|
|
296
|
+
const selectedAgent = useMemo(() => agents.find((agent) => agent.id === selectedAgentId) || null, [agents, selectedAgentId]);
|
|
297
|
+
const normalizedRememberedAgentId = useMemo(() => String(rememberedAgentId || '').trim(), [rememberedAgentId]);
|
|
298
|
+
const normalizedRememberedConversationId = useMemo(() => String(rememberedConversationId || '').trim(), [rememberedConversationId]);
|
|
299
|
+
const normalizedRememberedConversationByAgentId = useMemo(() => {
|
|
300
|
+
const normalized = {};
|
|
301
|
+
Object.entries(rememberedConversationByAgentId || {}).forEach(([agentId, conversationId]) => {
|
|
302
|
+
const normalizedAgentId = String(agentId || '').trim();
|
|
303
|
+
const normalizedConversationId = String(conversationId || '').trim();
|
|
304
|
+
if (!normalizedAgentId || !normalizedConversationId)
|
|
305
|
+
return;
|
|
306
|
+
normalized[normalizedAgentId] = normalizedConversationId;
|
|
307
|
+
});
|
|
308
|
+
return normalized;
|
|
309
|
+
}, [rememberedConversationByAgentId]);
|
|
310
|
+
const shouldUseCloudAvatarGeneration = runtimeMode === 'local' && cloudAuthConfigured;
|
|
311
|
+
const canUseCloudAvatarGeneration = !shouldUseCloudAvatarGeneration
|
|
312
|
+
|| (authSessionResolved && isAuthenticated && Boolean(resolveCloudAuthUrl));
|
|
313
|
+
const shouldUseCloudAgentRuntime = runtimeMode === 'local' && cloudAuthConfigured;
|
|
314
|
+
const canUseCloudAgentRuntime = !shouldUseCloudAgentRuntime
|
|
315
|
+
|| (authSessionResolved && isAuthenticated);
|
|
316
|
+
const selectedAgentAvatarUrl = useMemo(() => getAgentAvatarUrl(selectedAgent), [selectedAgent]);
|
|
317
|
+
const selectedAgentAvatarSourceUrl = useMemo(() => getAgentAvatarSourceUrl(selectedAgent), [selectedAgent]);
|
|
318
|
+
const isSelectedAgentAvatarSyncing = Boolean(selectedAgentId && avatarSyncingAgentIds.has(selectedAgentId));
|
|
319
|
+
const selectedAgentGenerationFeedback = selectedAgentId
|
|
320
|
+
? avatarGenerationFeedbackByAgentId[selectedAgentId] || null
|
|
321
|
+
: null;
|
|
322
|
+
const selectedConversationSummary = useMemo(() => conversationSummaries.find((conversation) => conversation.id === conversationId) || null, [conversationId, conversationSummaries]);
|
|
323
|
+
const taskLaunchContext = useMemo(() => {
|
|
324
|
+
const taskId = String(launchContext?.taskId || '').trim();
|
|
325
|
+
if (!taskId)
|
|
326
|
+
return null;
|
|
327
|
+
const taskReference = String(launchContext?.taskReference || '').trim();
|
|
328
|
+
const taskTitle = String(launchContext?.taskTitle || '').trim();
|
|
329
|
+
return {
|
|
330
|
+
type: 'task',
|
|
331
|
+
taskId,
|
|
332
|
+
taskReference,
|
|
333
|
+
taskTitle,
|
|
334
|
+
};
|
|
335
|
+
}, [launchContext?.taskId, launchContext?.taskReference, launchContext?.taskTitle]);
|
|
336
|
+
const selectedConversationTaskContext = useMemo(() => resolveConversationTaskContext(selectedConversationSummary), [selectedConversationSummary]);
|
|
337
|
+
const activeTaskContext = conversationId
|
|
338
|
+
? (selectedConversationTaskContext ? mergeTaskContext(selectedConversationTaskContext, taskLaunchContext) : null)
|
|
339
|
+
: taskLaunchContext;
|
|
340
|
+
const activeTaskContextLabel = activeTaskContext ? formatTaskContextLabel(activeTaskContext) : '';
|
|
341
|
+
const canClearActiveTaskContext = Boolean(activeTaskContext && taskLaunchContext && !conversationId);
|
|
342
|
+
const conversationOwnerAgent = useMemo(() => {
|
|
343
|
+
const agentId = String(selectedConversationSummary?.agentId || selectedAgentId || '').trim();
|
|
344
|
+
return agents.find((agent) => agent.id === agentId) || null;
|
|
345
|
+
}, [agents, selectedAgentId, selectedConversationSummary?.agentId]);
|
|
346
|
+
const conversationAgentLabel = conversationOwnerAgent?.name || selectedAgent?.name || agentName.trim() || DEFAULT_AGENT_NAME;
|
|
347
|
+
const conversationAgentColor = conversationOwnerAgent?.color
|
|
348
|
+
|| selectedAgent?.color
|
|
349
|
+
|| (conversationOwnerAgent?.id
|
|
350
|
+
? assignedAiProfileColor(conversationOwnerAgent.id)
|
|
351
|
+
: selectedAgent?.id
|
|
352
|
+
? assignedAiProfileColor(selectedAgent.id)
|
|
353
|
+
: undefined);
|
|
354
|
+
const lastEmittedSelectionRef = useRef('');
|
|
355
|
+
const rememberSelection = useCallback((agentId, nextConversationId) => {
|
|
356
|
+
if (!onRememberSelection)
|
|
357
|
+
return;
|
|
358
|
+
const normalizedAgentId = String(agentId || '').trim();
|
|
359
|
+
const normalizedConversationId = String(nextConversationId || '').trim();
|
|
360
|
+
const nextKey = `${normalizedAgentId}:${normalizedConversationId}`;
|
|
361
|
+
if (lastEmittedSelectionRef.current === nextKey)
|
|
362
|
+
return;
|
|
363
|
+
lastEmittedSelectionRef.current = nextKey;
|
|
364
|
+
onRememberSelection({
|
|
365
|
+
agentId: normalizedAgentId || null,
|
|
366
|
+
conversationId: normalizedConversationId || null,
|
|
367
|
+
});
|
|
368
|
+
}, [onRememberSelection]);
|
|
369
|
+
const appendLog = useCallback((type, message, nextToolActivity) => {
|
|
370
|
+
setLogs((current) => [
|
|
371
|
+
...current,
|
|
372
|
+
{
|
|
373
|
+
id: logIdRef.current++,
|
|
374
|
+
type,
|
|
375
|
+
message,
|
|
376
|
+
timestamp: new Date().toLocaleTimeString(),
|
|
377
|
+
...(nextToolActivity && nextToolActivity.length > 0 ? { toolActivity: nextToolActivity } : {}),
|
|
378
|
+
},
|
|
379
|
+
]);
|
|
380
|
+
}, []);
|
|
381
|
+
const resetDraftTest = useCallback(() => {
|
|
382
|
+
draftTestRunIdRef.current += 1;
|
|
383
|
+
setDraftTestPrompt('');
|
|
384
|
+
setDraftTestResult(null);
|
|
385
|
+
setDraftTestSnapshot(null);
|
|
386
|
+
setDraftTestToolActivity([]);
|
|
387
|
+
setDraftTestError('');
|
|
388
|
+
setTestingDraft(false);
|
|
389
|
+
}, []);
|
|
390
|
+
const applyAgent = useCallback((agent) => {
|
|
391
|
+
conversationRenameRunIdRef.current += 1;
|
|
392
|
+
configurationDraftDirtyRef.current = false;
|
|
393
|
+
selectedAgentIdRef.current = agent.id;
|
|
394
|
+
setSelectedAgentId(agent.id);
|
|
395
|
+
setAgentName(agent.name);
|
|
396
|
+
setModelProvider('taskforce_hq');
|
|
397
|
+
setProviderKey(normalizeTaskforceAgentProviderKey(agent.providerKey));
|
|
398
|
+
setModelKey(normalizeTaskforceAgentModelKey(agent.modelKey, agent.providerKey));
|
|
399
|
+
setModelTier(agent.modelTier);
|
|
400
|
+
setDefinitionDraft(createTaskforceAgentEditorDraft(agent.definition, {
|
|
401
|
+
systemPrompt: agent.systemPrompt,
|
|
402
|
+
}));
|
|
403
|
+
setSignatureColor(agent.color || assignedAiProfileColor(agent.id));
|
|
404
|
+
setSignatureColorDirty(false);
|
|
405
|
+
setSignatureColorReset(false);
|
|
406
|
+
signatureColorEditPendingRef.current = false;
|
|
407
|
+
setConversationId(null);
|
|
408
|
+
setConversationSummaries([]);
|
|
409
|
+
setConversationMessages([]);
|
|
410
|
+
setRenamingConversation(false);
|
|
411
|
+
setConversationTitleDraft('');
|
|
412
|
+
setConversationRenameError('');
|
|
413
|
+
setSavingConversationTitle(false);
|
|
414
|
+
setResult(null);
|
|
415
|
+
setToolActivity([]);
|
|
416
|
+
setConfigFeedback(null);
|
|
417
|
+
resetDraftTest();
|
|
418
|
+
}, [resetDraftTest]);
|
|
419
|
+
const selectAgent = useCallback((agent) => {
|
|
420
|
+
applyAgent(agent);
|
|
421
|
+
rememberSelection(agent.id, normalizedRememberedConversationByAgentId[agent.id] || null);
|
|
422
|
+
}, [applyAgent, normalizedRememberedConversationByAgentId, rememberSelection]);
|
|
423
|
+
const applyConversation = useCallback((conversation) => {
|
|
424
|
+
conversationRenameRunIdRef.current += 1;
|
|
425
|
+
const messages = Array.isArray(conversation?.messages) ? conversation.messages : [];
|
|
426
|
+
const lastAssistantMessage = [...messages].reverse().find((message) => message.role === 'assistant');
|
|
427
|
+
setConversationId(conversation?.id || null);
|
|
428
|
+
setConversationMessages(messages);
|
|
429
|
+
setRenamingConversation(false);
|
|
430
|
+
setConversationTitleDraft('');
|
|
431
|
+
setConversationRenameError('');
|
|
432
|
+
setSavingConversationTitle(false);
|
|
433
|
+
setResult(lastAssistantMessage ? {
|
|
434
|
+
text: lastAssistantMessage.content,
|
|
435
|
+
provider: conversation?.modelProvider || 'taskforce_hq',
|
|
436
|
+
modelId: conversation?.modelId || 'Not reported',
|
|
437
|
+
latencyMs: conversation?.latencyMs ?? null,
|
|
438
|
+
usage: conversation?.usage || null,
|
|
439
|
+
} : null);
|
|
440
|
+
}, []);
|
|
441
|
+
const upsertConversationSummary = useCallback((conversation) => {
|
|
442
|
+
const summary = summarizeConversation(conversation);
|
|
443
|
+
setConversationSummaries((current) => {
|
|
444
|
+
const withoutExisting = current.filter((candidate) => candidate.id !== summary.id);
|
|
445
|
+
return [summary, ...withoutExisting];
|
|
446
|
+
});
|
|
447
|
+
}, []);
|
|
448
|
+
const resetAgentDraft = useCallback(() => {
|
|
449
|
+
conversationRenameRunIdRef.current += 1;
|
|
450
|
+
configurationDraftDirtyRef.current = false;
|
|
451
|
+
selectedAgentIdRef.current = null;
|
|
452
|
+
setSelectedAgentId(null);
|
|
453
|
+
setAgentName('');
|
|
454
|
+
setModelProvider('taskforce_hq');
|
|
455
|
+
setProviderKey(DEFAULT_TASKFORCE_AGENT_PROVIDER_KEY);
|
|
456
|
+
setModelKey(DEFAULT_TASKFORCE_AGENT_MODEL_KEY);
|
|
457
|
+
setModelTier('balanced');
|
|
458
|
+
setDefinitionDraft(createTaskforceAgentEditorDraft(null, {
|
|
459
|
+
systemPrompt: DEFAULT_SYSTEM_PROMPT,
|
|
460
|
+
}));
|
|
461
|
+
setSignatureColor('');
|
|
462
|
+
setSignatureColorDirty(false);
|
|
463
|
+
setSignatureColorReset(false);
|
|
464
|
+
signatureColorEditPendingRef.current = false;
|
|
465
|
+
setConversationId(null);
|
|
466
|
+
setConversationSummaries([]);
|
|
467
|
+
setConversationMessages([]);
|
|
468
|
+
setRenamingConversation(false);
|
|
469
|
+
setConversationTitleDraft('');
|
|
470
|
+
setConversationRenameError('');
|
|
471
|
+
setSavingConversationTitle(false);
|
|
472
|
+
setResult(null);
|
|
473
|
+
setToolActivity([]);
|
|
474
|
+
setConfigFeedback(null);
|
|
475
|
+
resetDraftTest();
|
|
476
|
+
rememberSelection(null, null);
|
|
477
|
+
}, [rememberSelection, resetDraftTest]);
|
|
478
|
+
const performAgentNavigation = useCallback((target) => {
|
|
479
|
+
if (target.type === 'new') {
|
|
480
|
+
resetAgentDraft();
|
|
481
|
+
appendLog('info', 'Started a new Taskforce agent draft.');
|
|
482
|
+
return;
|
|
483
|
+
}
|
|
484
|
+
selectAgent(target.agent);
|
|
485
|
+
}, [appendLog, resetAgentDraft, selectAgent]);
|
|
486
|
+
const requestAgentNavigation = useCallback((target) => {
|
|
487
|
+
if (target.type === 'agent' && target.agent.id === selectedAgentIdRef.current)
|
|
488
|
+
return;
|
|
489
|
+
if (!configurationDraftDirtyRef.current) {
|
|
490
|
+
performAgentNavigation(target);
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
493
|
+
setPendingAgentNavigation(target);
|
|
494
|
+
}, [performAgentNavigation]);
|
|
495
|
+
const discardDraftAndNavigate = useCallback(() => {
|
|
496
|
+
if (!pendingAgentNavigation)
|
|
497
|
+
return;
|
|
498
|
+
const target = pendingAgentNavigation;
|
|
499
|
+
setPendingAgentNavigation(null);
|
|
500
|
+
configurationDraftDirtyRef.current = false;
|
|
501
|
+
performAgentNavigation(target);
|
|
502
|
+
}, [pendingAgentNavigation, performAgentNavigation]);
|
|
503
|
+
useEffect(() => {
|
|
504
|
+
const handleBeforeUnload = (event) => {
|
|
505
|
+
if (!configurationDraftDirtyRef.current)
|
|
506
|
+
return;
|
|
507
|
+
event.preventDefault();
|
|
508
|
+
event.returnValue = '';
|
|
509
|
+
};
|
|
510
|
+
window.addEventListener('beforeunload', handleBeforeUnload);
|
|
511
|
+
return () => window.removeEventListener('beforeunload', handleBeforeUnload);
|
|
512
|
+
}, []);
|
|
513
|
+
const loadConversation = useCallback(async (agentId, nextConversationId) => {
|
|
514
|
+
setLoadingConversation(true);
|
|
515
|
+
try {
|
|
516
|
+
const res = await fetch(`/api/taskforce/agents/${encodeURIComponent(agentId)}/conversation?workspaceId=${encodeURIComponent(workspaceId)}&conversationId=${encodeURIComponent(nextConversationId)}`, {
|
|
517
|
+
credentials: 'include',
|
|
518
|
+
});
|
|
519
|
+
const responseText = typeof res.clone === 'function'
|
|
520
|
+
? await res.clone().text().catch(() => '')
|
|
521
|
+
: '';
|
|
522
|
+
const payload = await res.json().catch(() => ({}));
|
|
523
|
+
if (!res.ok || payload?.success === false) {
|
|
524
|
+
const fallback = res.status === 404
|
|
525
|
+
? 'Taskforce agent conversation API route is not available. Restart the app server so the latest routes are active.'
|
|
526
|
+
: `Unable to load saved agent conversation. HTTP ${res.status || 'unknown'}.`;
|
|
527
|
+
appendLog('error', String(payload?.error || responseText || fallback));
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
530
|
+
if (selectedAgentIdRef.current !== agentId)
|
|
531
|
+
return;
|
|
532
|
+
const nextConversation = payload?.conversation || null;
|
|
533
|
+
applyConversation(nextConversation);
|
|
534
|
+
if (nextConversation)
|
|
535
|
+
upsertConversationSummary(nextConversation);
|
|
536
|
+
rememberSelection(agentId, nextConversation?.id || null);
|
|
537
|
+
setToolActivity([]);
|
|
538
|
+
}
|
|
539
|
+
catch (err) {
|
|
540
|
+
appendLog('error', String(err?.message || err || 'Unable to load saved agent conversation.'));
|
|
541
|
+
}
|
|
542
|
+
finally {
|
|
543
|
+
setLoadingConversation(false);
|
|
544
|
+
}
|
|
545
|
+
}, [appendLog, applyConversation, rememberSelection, upsertConversationSummary, workspaceId]);
|
|
546
|
+
const loadConversationHistory = useCallback(async (agentId) => {
|
|
547
|
+
setLoadingConversationList(true);
|
|
548
|
+
setLoadingConversation(true);
|
|
549
|
+
try {
|
|
550
|
+
const res = await fetch(`/api/taskforce/agents/${encodeURIComponent(agentId)}/conversations?workspaceId=${encodeURIComponent(workspaceId)}`, {
|
|
551
|
+
credentials: 'include',
|
|
552
|
+
});
|
|
553
|
+
const responseText = typeof res.clone === 'function'
|
|
554
|
+
? await res.clone().text().catch(() => '')
|
|
555
|
+
: '';
|
|
556
|
+
const payload = await res.json().catch(() => ({}));
|
|
557
|
+
if (!res.ok || payload?.success === false) {
|
|
558
|
+
const fallback = res.status === 404
|
|
559
|
+
? 'Taskforce agent conversation API route is not available. Restart the app server so the latest routes are active.'
|
|
560
|
+
: `Unable to load saved agent conversations. HTTP ${res.status || 'unknown'}.`;
|
|
561
|
+
appendLog('error', String(payload?.error || responseText || fallback));
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
if (selectedAgentIdRef.current !== agentId)
|
|
565
|
+
return;
|
|
566
|
+
const summaries = Array.isArray(payload?.conversations) ? payload.conversations : [];
|
|
567
|
+
setConversationSummaries(summaries);
|
|
568
|
+
if (summaries.length > 0) {
|
|
569
|
+
const rememberedConversationIdForAgent = normalizedRememberedConversationByAgentId[agentId]
|
|
570
|
+
|| (agentId === normalizedRememberedAgentId ? normalizedRememberedConversationId : '');
|
|
571
|
+
const restoredConversation = rememberedConversationIdForAgent
|
|
572
|
+
? summaries.find((conversation) => conversation.id === rememberedConversationIdForAgent)
|
|
573
|
+
: null;
|
|
574
|
+
const taskConversation = taskLaunchContext
|
|
575
|
+
? summaries.find((conversation) => resolveConversationTaskContext(conversation)?.taskId === taskLaunchContext.taskId)
|
|
576
|
+
: null;
|
|
577
|
+
const nextConversationId = restoredConversation?.id || taskConversation?.id || (taskLaunchContext ? null : summaries[0].id);
|
|
578
|
+
if (nextConversationId) {
|
|
579
|
+
await loadConversation(agentId, nextConversationId);
|
|
580
|
+
}
|
|
581
|
+
else {
|
|
582
|
+
applyConversation(null);
|
|
583
|
+
rememberSelection(agentId, null);
|
|
584
|
+
setToolActivity([]);
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
else {
|
|
588
|
+
applyConversation(null);
|
|
589
|
+
rememberSelection(agentId, null);
|
|
590
|
+
setToolActivity([]);
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
catch (err) {
|
|
594
|
+
appendLog('error', String(err?.message || err || 'Unable to load saved agent conversations.'));
|
|
595
|
+
}
|
|
596
|
+
finally {
|
|
597
|
+
setLoadingConversationList(false);
|
|
598
|
+
setLoadingConversation(false);
|
|
599
|
+
}
|
|
600
|
+
}, [appendLog, applyConversation, loadConversation, normalizedRememberedAgentId, normalizedRememberedConversationByAgentId, normalizedRememberedConversationId, rememberSelection, taskLaunchContext, workspaceId]);
|
|
601
|
+
const loadAgents = useCallback(async (options) => {
|
|
602
|
+
const quiet = options?.quiet === true;
|
|
603
|
+
if (!quiet) {
|
|
604
|
+
setLoadingAgents(true);
|
|
605
|
+
setConfigFeedback(null);
|
|
606
|
+
}
|
|
607
|
+
try {
|
|
608
|
+
const res = await fetch(`/api/taskforce/agents?workspaceId=${encodeURIComponent(workspaceId)}`, {
|
|
609
|
+
credentials: 'include',
|
|
610
|
+
});
|
|
611
|
+
const responseText = typeof res.clone === 'function'
|
|
612
|
+
? await res.clone().text().catch(() => '')
|
|
613
|
+
: '';
|
|
614
|
+
const payload = await res.json().catch(() => ({}));
|
|
615
|
+
if (!res.ok || payload?.success === false) {
|
|
616
|
+
const fallback = res.status === 404
|
|
617
|
+
? 'Taskforce agent API route is not available. Restart the app server so the latest routes are active.'
|
|
618
|
+
: `Unable to load saved agents. HTTP ${res.status || 'unknown'}.`;
|
|
619
|
+
const message = String(payload?.error || responseText || fallback);
|
|
620
|
+
appendLog('error', message);
|
|
621
|
+
if (!quiet)
|
|
622
|
+
setConfigFeedback({ type: 'error', message });
|
|
623
|
+
return;
|
|
624
|
+
}
|
|
625
|
+
const nextAgents = Array.isArray(payload?.agents) ? payload.agents : [];
|
|
626
|
+
loadedAgentWorkspaceRef.current = workspaceId;
|
|
627
|
+
setAgents((current) => {
|
|
628
|
+
const currentById = new Map(current.map((agent) => [agent.id, agent]));
|
|
629
|
+
return nextAgents.map((agent) => {
|
|
630
|
+
const pendingRevision = pendingCloudAvatarRevisionByAgentIdRef.current.get(agent.id);
|
|
631
|
+
const refreshedRevision = normalizedAvatarRevision(agent.avatarRevision);
|
|
632
|
+
if (pendingRevision === undefined || (refreshedRevision !== null && refreshedRevision >= pendingRevision)) {
|
|
633
|
+
return agent;
|
|
634
|
+
}
|
|
635
|
+
const optimisticAgent = currentById.get(agent.id);
|
|
636
|
+
if (!optimisticAgent)
|
|
637
|
+
return agent;
|
|
638
|
+
return {
|
|
639
|
+
...agent,
|
|
640
|
+
profileId: optimisticAgent.profileId || agent.profileId || null,
|
|
641
|
+
avatarUrl: optimisticAgent.avatarUrl,
|
|
642
|
+
avatarSourceUrl: optimisticAgent.avatarSourceUrl,
|
|
643
|
+
avatarRevision: optimisticAgent.avatarRevision,
|
|
644
|
+
avatarUpdatedAt: optimisticAgent.avatarUpdatedAt,
|
|
645
|
+
};
|
|
646
|
+
});
|
|
647
|
+
});
|
|
648
|
+
setAvatarSyncingAgentIds((current) => {
|
|
649
|
+
let next = null;
|
|
650
|
+
for (const agentId of current) {
|
|
651
|
+
const pendingRevision = pendingCloudAvatarRevisionByAgentIdRef.current.get(agentId);
|
|
652
|
+
const refreshedAgent = nextAgents.find((agent) => agent.id === agentId);
|
|
653
|
+
const refreshedRevision = normalizedAvatarRevision(refreshedAgent?.avatarRevision);
|
|
654
|
+
if (pendingRevision === undefined || refreshedRevision === null || refreshedRevision < pendingRevision)
|
|
655
|
+
continue;
|
|
656
|
+
next ??= new Set(current);
|
|
657
|
+
next.delete(agentId);
|
|
658
|
+
pendingCloudAvatarRevisionByAgentIdRef.current.delete(agentId);
|
|
659
|
+
}
|
|
660
|
+
return next || current;
|
|
661
|
+
});
|
|
662
|
+
const activeAgentId = selectedAgentIdRef.current;
|
|
663
|
+
const refreshedActiveAgent = activeAgentId
|
|
664
|
+
? nextAgents.find((agent) => agent.id === activeAgentId)
|
|
665
|
+
: null;
|
|
666
|
+
if (refreshedActiveAgent && !signatureColorEditPendingRef.current) {
|
|
667
|
+
setSignatureColor(refreshedActiveAgent.color || assignedAiProfileColor(refreshedActiveAgent.id));
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
catch (err) {
|
|
671
|
+
const message = String(err?.message || err || 'Unable to load saved agents.');
|
|
672
|
+
appendLog('error', message);
|
|
673
|
+
if (!quiet)
|
|
674
|
+
setConfigFeedback({ type: 'error', message });
|
|
675
|
+
}
|
|
676
|
+
finally {
|
|
677
|
+
if (!quiet)
|
|
678
|
+
setLoadingAgents(false);
|
|
679
|
+
}
|
|
680
|
+
}, [appendLog, workspaceId]);
|
|
681
|
+
useEffect(() => {
|
|
682
|
+
resetDraftTest();
|
|
683
|
+
}, [resetDraftTest, workspaceId]);
|
|
684
|
+
useEffect(() => {
|
|
685
|
+
void loadAgents();
|
|
686
|
+
}, [loadAgents]);
|
|
687
|
+
useEffect(() => {
|
|
688
|
+
if (!rememberedSelectionReady
|
|
689
|
+
|| loadedAgentWorkspaceRef.current !== workspaceId
|
|
690
|
+
|| initialAgentWorkspaceRef.current === workspaceId)
|
|
691
|
+
return;
|
|
692
|
+
if (agents.length === 0) {
|
|
693
|
+
if (loadingAgents)
|
|
694
|
+
return;
|
|
695
|
+
rememberSelection(null, null);
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
initialAgentWorkspaceRef.current = workspaceId;
|
|
699
|
+
const restoredAgent = agents.find((agent) => agent.id === normalizedRememberedAgentId);
|
|
700
|
+
if (configurationDraftDirtyRef.current)
|
|
701
|
+
return;
|
|
702
|
+
applyAgent(restoredAgent || agents[0]);
|
|
703
|
+
}, [agents, applyAgent, loadingAgents, normalizedRememberedAgentId, rememberedSelectionReady, rememberSelection, workspaceId]);
|
|
704
|
+
useEffect(() => {
|
|
705
|
+
const handleAgentsMutated = (event) => {
|
|
706
|
+
const detail = event.detail;
|
|
707
|
+
const eventWorkspaceId = String(detail?.workspaceId || '').trim() || 'default';
|
|
708
|
+
if (eventWorkspaceId !== workspaceId)
|
|
709
|
+
return;
|
|
710
|
+
const reason = detail?.reason;
|
|
711
|
+
const shouldRefreshAgents = reason === 'sync-apply'
|
|
712
|
+
|| reason === 'agent-avatar-upload'
|
|
713
|
+
|| reason === 'agent-avatar-remove'
|
|
714
|
+
|| (reason === 'agent-avatar-generate' && !shouldUseCloudAvatarGeneration);
|
|
715
|
+
if (!shouldRefreshAgents)
|
|
716
|
+
return;
|
|
717
|
+
void loadAgents({ quiet: true });
|
|
718
|
+
if (reason !== 'sync-apply')
|
|
719
|
+
return;
|
|
720
|
+
const eventAgentId = String(detail?.agentId || '').trim();
|
|
721
|
+
const activeAgentId = selectedAgentIdRef.current;
|
|
722
|
+
if (activeAgentId && (!eventAgentId || eventAgentId === activeAgentId)) {
|
|
723
|
+
void loadConversationHistory(activeAgentId);
|
|
724
|
+
}
|
|
725
|
+
};
|
|
726
|
+
window.addEventListener(TASKFORCE_AGENTS_MUTATED_EVENT, handleAgentsMutated);
|
|
727
|
+
return () => window.removeEventListener(TASKFORCE_AGENTS_MUTATED_EVENT, handleAgentsMutated);
|
|
728
|
+
}, [loadAgents, loadConversationHistory, shouldUseCloudAvatarGeneration, workspaceId]);
|
|
729
|
+
useEffect(() => {
|
|
730
|
+
const handleAiProfilesMutated = (event) => {
|
|
731
|
+
const detail = event.detail;
|
|
732
|
+
const eventWorkspaceId = String(detail?.workspaceId || '').trim() || 'default';
|
|
733
|
+
if (eventWorkspaceId !== workspaceId)
|
|
734
|
+
return;
|
|
735
|
+
if (detail?.origin === 'taskforce-agents-module')
|
|
736
|
+
return;
|
|
737
|
+
const avatar = detail?.taskforceAgentAvatar;
|
|
738
|
+
const avatarAgentId = String(avatar?.agentId || '').trim();
|
|
739
|
+
if (avatar && avatarAgentId) {
|
|
740
|
+
const avatarRevision = normalizedAvatarRevision(avatar.avatarRevision) ?? 0;
|
|
741
|
+
if (shouldUseCloudAvatarGeneration) {
|
|
742
|
+
pendingCloudAvatarRevisionByAgentIdRef.current.set(avatarAgentId, avatarRevision);
|
|
743
|
+
setAvatarSyncingAgentIds((current) => new Set(current).add(avatarAgentId));
|
|
744
|
+
}
|
|
745
|
+
setAgents((current) => current.map((agent) => agent.id === avatarAgentId ? {
|
|
746
|
+
...agent,
|
|
747
|
+
profileId: detail.profileId || agent.profileId || null,
|
|
748
|
+
avatarUrl: avatar.avatarUrl,
|
|
749
|
+
avatarSourceUrl: avatar.avatarSourceUrl,
|
|
750
|
+
avatarRevision,
|
|
751
|
+
avatarUpdatedAt: avatar.avatarUpdatedAt,
|
|
752
|
+
} : agent));
|
|
753
|
+
}
|
|
754
|
+
void loadAgents({ quiet: true });
|
|
755
|
+
};
|
|
756
|
+
window.addEventListener(TASKFORCE_AI_PROFILES_MUTATED_EVENT, handleAiProfilesMutated);
|
|
757
|
+
return () => window.removeEventListener(TASKFORCE_AI_PROFILES_MUTATED_EVENT, handleAiProfilesMutated);
|
|
758
|
+
}, [loadAgents, shouldUseCloudAvatarGeneration, workspaceId]);
|
|
759
|
+
useEffect(() => {
|
|
760
|
+
const interval = window.setInterval(() => {
|
|
761
|
+
void loadAgents({ quiet: true });
|
|
762
|
+
}, AGENT_ROSTER_REFRESH_INTERVAL_MS);
|
|
763
|
+
return () => window.clearInterval(interval);
|
|
764
|
+
}, [loadAgents]);
|
|
765
|
+
useEffect(() => {
|
|
766
|
+
selectedAgentIdRef.current = selectedAgentId;
|
|
767
|
+
}, [selectedAgentId]);
|
|
768
|
+
useEffect(() => {
|
|
769
|
+
if (!selectedAgentId)
|
|
770
|
+
return;
|
|
771
|
+
void loadConversationHistory(selectedAgentId);
|
|
772
|
+
}, [loadConversationHistory, selectedAgentId]);
|
|
773
|
+
useEffect(() => {
|
|
774
|
+
if (avatarSyncingAgentIds.size === 0)
|
|
775
|
+
return;
|
|
776
|
+
const interval = window.setInterval(() => {
|
|
777
|
+
void loadAgents();
|
|
778
|
+
}, 4000);
|
|
779
|
+
return () => window.clearInterval(interval);
|
|
780
|
+
}, [avatarSyncingAgentIds.size, loadAgents]);
|
|
781
|
+
useEffect(() => {
|
|
782
|
+
if (surface !== 'taskDrawer' || !onRenderDrawerHeader)
|
|
783
|
+
return;
|
|
784
|
+
onRenderDrawerHeader(_jsxs("div", { className: styles.taskforceAgentDrawerAgentHeader, children: [_jsxs("button", { type: "button", className: `${styles.taskforceAgentDrawerAgentAvatar} ${styles.taskforceAgentDrawerAgentAvatarButton} ${isSelectedAgentAvatarSyncing ? styles.taskforceAgentAvatarSyncing : ''}`.trim(), onClick: () => setAgentProfileTrayOpen((current) => !current), disabled: !selectedAgentId, title: selectedAgent ? `View ${selectedAgent.name} profile` : 'Select an agent to view profile', "aria-label": selectedAgent ? `View ${selectedAgent.name} profile` : 'View agent profile', "aria-expanded": agentProfileTrayOpen, children: [selectedAgentAvatarUrl
|
|
785
|
+
? _jsx(AgentAvatarImage, { src: selectedAgentAvatarUrl, fallbackSize: 16 })
|
|
786
|
+
: _jsx(Bot, { size: 16 }), isSelectedAgentAvatarSyncing ? _jsx(Loader2, { size: 12, className: `${styles.spinner} ${styles.taskforceAgentAvatarSyncIcon}` }) : null] }), _jsx("label", { className: styles.taskforceAgentDrawerAgentPicker, children: _jsx("select", { className: styles.select, value: selectedAgentId || '', onChange: (event) => {
|
|
787
|
+
const nextAgent = agents.find((agent) => agent.id === event.target.value);
|
|
788
|
+
if (nextAgent)
|
|
789
|
+
requestAgentNavigation({ type: 'agent', agent: nextAgent });
|
|
790
|
+
}, disabled: !rememberedSelectionReady || loadingAgents || agents.length === 0 || testing, "aria-label": "Agent", children: agents.length > 0 ? (agents.map((agent) => (_jsx("option", { value: agent.id, children: agent.name }, agent.id)))) : (_jsx("option", { value: "", children: "No agents configured" })) }) })] }));
|
|
791
|
+
return () => onRenderDrawerHeader(null);
|
|
792
|
+
}, [
|
|
793
|
+
agents,
|
|
794
|
+
agentProfileTrayOpen,
|
|
795
|
+
isSelectedAgentAvatarSyncing,
|
|
796
|
+
loadingAgents,
|
|
797
|
+
onRenderDrawerHeader,
|
|
798
|
+
requestAgentNavigation,
|
|
799
|
+
selectedAgent,
|
|
800
|
+
selectedAgentAvatarUrl,
|
|
801
|
+
selectedAgentId,
|
|
802
|
+
surface,
|
|
803
|
+
testing,
|
|
804
|
+
]);
|
|
805
|
+
useEffect(() => {
|
|
806
|
+
if (!taskLaunchContext)
|
|
807
|
+
return;
|
|
808
|
+
appendLog('info', `Task context attached: ${taskLaunchContext.taskReference}.`);
|
|
809
|
+
}, [appendLog, taskLaunchContext]);
|
|
810
|
+
useEffect(() => {
|
|
811
|
+
conversationEndRef.current?.scrollIntoView?.({ block: 'end' });
|
|
812
|
+
}, [conversationMessages.length, loadingConversation, testing]);
|
|
813
|
+
const buildCurrentDraftDefinition = useCallback(() => (buildTaskforceAgentDefinitionFromDraft({
|
|
814
|
+
baseDefinition: selectedAgent?.definition,
|
|
815
|
+
draft: definitionDraft,
|
|
816
|
+
name: agentName.trim() || DEFAULT_AGENT_NAME,
|
|
817
|
+
providerKey,
|
|
818
|
+
modelKey,
|
|
819
|
+
tier: selectedModel?.defaultTier || modelTier,
|
|
820
|
+
})), [
|
|
821
|
+
agentName,
|
|
822
|
+
definitionDraft,
|
|
823
|
+
modelKey,
|
|
824
|
+
modelTier,
|
|
825
|
+
providerKey,
|
|
826
|
+
selectedAgent?.definition,
|
|
827
|
+
selectedModel?.defaultTier,
|
|
828
|
+
]);
|
|
829
|
+
const handleSaveAgent = async () => {
|
|
830
|
+
const nextAgentName = agentName.trim();
|
|
831
|
+
const nextPurpose = definitionDraft.purpose.trim();
|
|
832
|
+
if (!nextAgentName || !nextPurpose || !modelKey || savingAgent)
|
|
833
|
+
return;
|
|
834
|
+
const isNewAgent = !selectedAgentId;
|
|
835
|
+
const definition = buildCurrentDraftDefinition();
|
|
836
|
+
setSavingAgent(true);
|
|
837
|
+
setConfigFeedback(null);
|
|
838
|
+
try {
|
|
839
|
+
const url = selectedAgentId
|
|
840
|
+
? `/api/taskforce/agents/${encodeURIComponent(selectedAgentId)}`
|
|
841
|
+
: '/api/taskforce/agents';
|
|
842
|
+
const res = await fetch(url, {
|
|
843
|
+
method: selectedAgentId ? 'PATCH' : 'POST',
|
|
844
|
+
headers: { 'Content-Type': 'application/json' },
|
|
845
|
+
credentials: 'include',
|
|
846
|
+
body: JSON.stringify({
|
|
847
|
+
workspaceId,
|
|
848
|
+
definition,
|
|
849
|
+
lifecycleStatus: selectedAgent?.lifecycleStatus
|
|
850
|
+
|| (selectedAgent?.enabled === false ? 'disabled' : 'active'),
|
|
851
|
+
...(selectedAgentId ? {
|
|
852
|
+
expectedDefinitionHash: selectedAgent?.definitionHash,
|
|
853
|
+
} : {}),
|
|
854
|
+
...(signatureColorDirty && signatureColor ? { signatureColor } : {}),
|
|
855
|
+
...(signatureColorReset ? { resetSignatureColor: true } : {}),
|
|
856
|
+
}),
|
|
857
|
+
});
|
|
858
|
+
const payload = await res.json().catch(() => ({}));
|
|
859
|
+
if (!res.ok || payload?.success === false || !payload?.agent) {
|
|
860
|
+
const message = payload?.code === 'TASKFORCE_AGENT_DEFINITION_CONFLICT'
|
|
861
|
+
? 'This Agent changed after you opened it. Your draft is preserved; reload the Agent before saving again.'
|
|
862
|
+
: String(payload?.error || 'Unable to save agent.');
|
|
863
|
+
appendLog('error', message);
|
|
864
|
+
setConfigFeedback({ type: 'error', message });
|
|
865
|
+
return;
|
|
866
|
+
}
|
|
867
|
+
const savedAgent = payload.agent;
|
|
868
|
+
configurationDraftDirtyRef.current = false;
|
|
869
|
+
setAgents((current) => {
|
|
870
|
+
const exists = current.some((agent) => agent.id === savedAgent.id);
|
|
871
|
+
return exists
|
|
872
|
+
? current.map((agent) => agent.id === savedAgent.id ? savedAgent : agent)
|
|
873
|
+
: [savedAgent, ...current];
|
|
874
|
+
});
|
|
875
|
+
if (isNewAgent) {
|
|
876
|
+
selectAgent(savedAgent);
|
|
877
|
+
}
|
|
878
|
+
else {
|
|
879
|
+
setAgentName(savedAgent.name);
|
|
880
|
+
setModelProvider('taskforce_hq');
|
|
881
|
+
setProviderKey(normalizeTaskforceAgentProviderKey(savedAgent.providerKey));
|
|
882
|
+
setModelKey(normalizeTaskforceAgentModelKey(savedAgent.modelKey, savedAgent.providerKey));
|
|
883
|
+
setModelTier(savedAgent.modelTier);
|
|
884
|
+
setDefinitionDraft(createTaskforceAgentEditorDraft(savedAgent.definition, {
|
|
885
|
+
systemPrompt: savedAgent.systemPrompt,
|
|
886
|
+
}));
|
|
887
|
+
setSignatureColor(savedAgent.color || assignedAiProfileColor(savedAgent.id));
|
|
888
|
+
setSignatureColorDirty(false);
|
|
889
|
+
setSignatureColorReset(false);
|
|
890
|
+
signatureColorEditPendingRef.current = false;
|
|
891
|
+
}
|
|
892
|
+
const message = `Saved ${savedAgent.name}.`;
|
|
893
|
+
appendLog('success', message);
|
|
894
|
+
setConfigFeedback({ type: 'success', message });
|
|
895
|
+
dispatchTaskforceAgentsMutated({
|
|
896
|
+
workspaceId,
|
|
897
|
+
agentId: savedAgent.id,
|
|
898
|
+
reason: 'agent-save',
|
|
899
|
+
});
|
|
900
|
+
if (savedAgent.profileId) {
|
|
901
|
+
dispatchTaskforceAiProfilesMutated({
|
|
902
|
+
workspaceId,
|
|
903
|
+
profileId: savedAgent.profileId,
|
|
904
|
+
reason: 'update',
|
|
905
|
+
origin: 'taskforce-agents-module',
|
|
906
|
+
});
|
|
907
|
+
}
|
|
908
|
+
if (isNewAgent && !getAgentAvatarUrl(savedAgent)) {
|
|
909
|
+
void generateAvatarForAgent(savedAgent);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
catch (err) {
|
|
913
|
+
const message = String(err?.message || err || 'Unable to save agent.');
|
|
914
|
+
appendLog('error', message);
|
|
915
|
+
setConfigFeedback({ type: 'error', message });
|
|
916
|
+
}
|
|
917
|
+
finally {
|
|
918
|
+
setSavingAgent(false);
|
|
919
|
+
}
|
|
920
|
+
};
|
|
921
|
+
async function generateAvatarForAgent(targetAgent) {
|
|
922
|
+
const targetAgentId = targetAgent.id;
|
|
923
|
+
if (!targetAgentId || generatingAvatarAgentIds.has(targetAgentId))
|
|
924
|
+
return false;
|
|
925
|
+
if (!canUseCloudAvatarGeneration) {
|
|
926
|
+
const message = authSessionResolved
|
|
927
|
+
? 'Sign in to Taskforce Cloud to generate agent avatars.'
|
|
928
|
+
: 'Cloud sign-in is still loading. Try again in a moment.';
|
|
929
|
+
setAvatarGenerationFeedbackByAgentId((current) => ({
|
|
930
|
+
...current,
|
|
931
|
+
[targetAgentId]: { error: message, notice: null },
|
|
932
|
+
}));
|
|
933
|
+
return false;
|
|
934
|
+
}
|
|
935
|
+
setGeneratingAvatarAgentIds((current) => new Set(current).add(targetAgentId));
|
|
936
|
+
setAgentAvatarError(null);
|
|
937
|
+
setAgentAvatarNotice(null);
|
|
938
|
+
setAvatarGenerationFeedbackByAgentId((current) => ({
|
|
939
|
+
...current,
|
|
940
|
+
[targetAgentId]: { error: null, notice: null },
|
|
941
|
+
}));
|
|
942
|
+
try {
|
|
943
|
+
const avatarGenerationPath = `/api/taskforce/agents/${encodeURIComponent(targetAgentId)}/avatar/generate`;
|
|
944
|
+
const avatarGenerationUrl = shouldUseCloudAvatarGeneration && resolveCloudAuthUrl
|
|
945
|
+
? resolveCloudAuthUrl(avatarGenerationPath)
|
|
946
|
+
: avatarGenerationPath;
|
|
947
|
+
const res = await fetch(avatarGenerationUrl, {
|
|
948
|
+
method: 'POST',
|
|
949
|
+
headers: { 'Content-Type': 'application/json' },
|
|
950
|
+
credentials: 'include',
|
|
951
|
+
body: JSON.stringify({ workspaceId }),
|
|
952
|
+
});
|
|
953
|
+
const responseText = typeof res.clone === 'function'
|
|
954
|
+
? await res.clone().text().catch(() => '')
|
|
955
|
+
: '';
|
|
956
|
+
const payload = await res.json().catch(() => ({}));
|
|
957
|
+
if (!res.ok || payload?.success === false || !payload?.agent) {
|
|
958
|
+
const fallback = res.status
|
|
959
|
+
? `Unable to generate agent avatar. HTTP ${res.status}.`
|
|
960
|
+
: 'Unable to generate agent avatar.';
|
|
961
|
+
const details = payload?.details && typeof payload.details === 'object'
|
|
962
|
+
? payload.details
|
|
963
|
+
: null;
|
|
964
|
+
const diagnosticParts = [
|
|
965
|
+
typeof details?.modelId === 'string' && details.modelId ? `model ${details.modelId}` : '',
|
|
966
|
+
typeof details?.region === 'string' && details.region ? `region ${details.region}` : '',
|
|
967
|
+
].filter(Boolean);
|
|
968
|
+
const diagnosticSuffix = diagnosticParts.length ? ` Tried ${diagnosticParts.join(' in ')}.` : '';
|
|
969
|
+
const responseError = isHtmlResponse(responseText)
|
|
970
|
+
? `${fallback} Please try again.`
|
|
971
|
+
: compactResponseText(responseText);
|
|
972
|
+
const message = `${String(payload?.error || responseError || fallback)}${diagnosticSuffix}`;
|
|
973
|
+
setAvatarGenerationFeedbackByAgentId((current) => ({
|
|
974
|
+
...current,
|
|
975
|
+
[targetAgentId]: { error: message, notice: null },
|
|
976
|
+
}));
|
|
977
|
+
return false;
|
|
978
|
+
}
|
|
979
|
+
const generatedAgent = payload.agent;
|
|
980
|
+
const generatedProfileId = typeof payload?.avatar?.profileId === 'string'
|
|
981
|
+
? payload.avatar.profileId.trim()
|
|
982
|
+
: '';
|
|
983
|
+
const cloudResolvedAgent = shouldUseCloudAvatarGeneration && resolveCloudAuthUrl ? {
|
|
984
|
+
...generatedAgent,
|
|
985
|
+
avatarUrl: generatedAgent.avatarUrl
|
|
986
|
+
? resolveCloudAssetDisplayUrl(generatedAgent.avatarUrl)
|
|
987
|
+
: generatedAgent.avatarUrl,
|
|
988
|
+
avatarSourceUrl: generatedAgent.avatarSourceUrl
|
|
989
|
+
? resolveCloudAssetDisplayUrl(generatedAgent.avatarSourceUrl)
|
|
990
|
+
: generatedAgent.avatarSourceUrl,
|
|
991
|
+
} : generatedAgent;
|
|
992
|
+
const updatedAgent = {
|
|
993
|
+
...cloudResolvedAgent,
|
|
994
|
+
profileId: cloudResolvedAgent.profileId || generatedProfileId || targetAgent.profileId || null,
|
|
995
|
+
};
|
|
996
|
+
setAgents((current) => current.map((agent) => agent.id === updatedAgent.id ? {
|
|
997
|
+
...agent,
|
|
998
|
+
...updatedAgent,
|
|
999
|
+
profileId: updatedAgent.profileId || agent.profileId || null,
|
|
1000
|
+
} : agent));
|
|
1001
|
+
if (shouldUseCloudAvatarGeneration) {
|
|
1002
|
+
const generatedRevision = normalizedAvatarRevision(updatedAgent.avatarRevision)
|
|
1003
|
+
?? normalizedAvatarRevision(payload?.avatar?.avatarRevision)
|
|
1004
|
+
?? 0;
|
|
1005
|
+
pendingCloudAvatarRevisionByAgentIdRef.current.set(updatedAgent.id, generatedRevision);
|
|
1006
|
+
setAvatarSyncingAgentIds((current) => new Set(current).add(updatedAgent.id));
|
|
1007
|
+
setAvatarGenerationFeedbackByAgentId((current) => ({
|
|
1008
|
+
...current,
|
|
1009
|
+
[targetAgentId]: {
|
|
1010
|
+
error: null,
|
|
1011
|
+
notice: `Generated photo for ${updatedAgent.name} was saved in Taskforce Cloud. The local copy will be retained when sync runs.`,
|
|
1012
|
+
},
|
|
1013
|
+
}));
|
|
1014
|
+
}
|
|
1015
|
+
else {
|
|
1016
|
+
setAvatarGenerationFeedbackByAgentId((current) => ({
|
|
1017
|
+
...current,
|
|
1018
|
+
[targetAgentId]: { error: null, notice: `Generated photo for ${updatedAgent.name} was saved.` },
|
|
1019
|
+
}));
|
|
1020
|
+
}
|
|
1021
|
+
dispatchTaskforceAgentsMutated({
|
|
1022
|
+
workspaceId,
|
|
1023
|
+
agentId: updatedAgent.id,
|
|
1024
|
+
reason: 'agent-avatar-generate',
|
|
1025
|
+
});
|
|
1026
|
+
dispatchTaskforceAiProfilesMutated({
|
|
1027
|
+
workspaceId,
|
|
1028
|
+
profileId: typeof payload?.avatar?.profileId === 'string' ? payload.avatar.profileId : null,
|
|
1029
|
+
reason: 'avatar',
|
|
1030
|
+
origin: 'taskforce-agents-module',
|
|
1031
|
+
});
|
|
1032
|
+
return true;
|
|
1033
|
+
}
|
|
1034
|
+
catch (err) {
|
|
1035
|
+
const message = String(err?.message || err || 'Unable to generate agent avatar.');
|
|
1036
|
+
setAvatarGenerationFeedbackByAgentId((current) => ({
|
|
1037
|
+
...current,
|
|
1038
|
+
[targetAgentId]: { error: message, notice: null },
|
|
1039
|
+
}));
|
|
1040
|
+
return false;
|
|
1041
|
+
}
|
|
1042
|
+
finally {
|
|
1043
|
+
setGeneratingAvatarAgentIds((current) => {
|
|
1044
|
+
const next = new Set(current);
|
|
1045
|
+
next.delete(targetAgentId);
|
|
1046
|
+
return next;
|
|
1047
|
+
});
|
|
1048
|
+
}
|
|
1049
|
+
}
|
|
1050
|
+
const handleGenerateAvatar = async () => {
|
|
1051
|
+
if (!selectedAgentId || !selectedAgent)
|
|
1052
|
+
return false;
|
|
1053
|
+
if (hasUnsavedAvatarPresentation(selectedAgent.definition, definitionDraft)) {
|
|
1054
|
+
setAgentAvatarError('Save the avatar description and art style before generating.');
|
|
1055
|
+
setAgentAvatarNotice(null);
|
|
1056
|
+
return false;
|
|
1057
|
+
}
|
|
1058
|
+
return generateAvatarForAgent(selectedAgent);
|
|
1059
|
+
};
|
|
1060
|
+
const applyAgentAvatarProfileUpdate = (updatedProfile) => {
|
|
1061
|
+
const profileId = String(updatedProfile?.id || '').trim();
|
|
1062
|
+
if (!profileId)
|
|
1063
|
+
return;
|
|
1064
|
+
setAgents((current) => current.map((agent) => agent.profileId === profileId ? {
|
|
1065
|
+
...agent,
|
|
1066
|
+
avatarUrl: typeof updatedProfile.avatarUrl === 'string' ? updatedProfile.avatarUrl : null,
|
|
1067
|
+
avatarSourceUrl: typeof updatedProfile.avatarSourceUrl === 'string' ? updatedProfile.avatarSourceUrl : null,
|
|
1068
|
+
avatarRevision: Number.isFinite(Number(updatedProfile.avatarRevision))
|
|
1069
|
+
? Math.max(0, Math.floor(Number(updatedProfile.avatarRevision)))
|
|
1070
|
+
: agent.avatarRevision,
|
|
1071
|
+
avatarUpdatedAt: typeof updatedProfile.avatarUpdatedAt === 'string'
|
|
1072
|
+
? updatedProfile.avatarUpdatedAt
|
|
1073
|
+
: agent.avatarUpdatedAt,
|
|
1074
|
+
} : agent));
|
|
1075
|
+
};
|
|
1076
|
+
const handleAgentAvatarSelected = async (file, sourceFile, options) => {
|
|
1077
|
+
const profileId = String(selectedAgent?.profileId || '').trim();
|
|
1078
|
+
if (!selectedAgentId || !profileId) {
|
|
1079
|
+
setAgentAvatarError('Save the agent before editing its profile photo.');
|
|
1080
|
+
return false;
|
|
1081
|
+
}
|
|
1082
|
+
if (!file.type.startsWith('image/')) {
|
|
1083
|
+
setAgentAvatarError('Agent profile photo must be an image file.');
|
|
1084
|
+
return false;
|
|
1085
|
+
}
|
|
1086
|
+
setAgentAvatarBusy(true);
|
|
1087
|
+
setAgentAvatarError(null);
|
|
1088
|
+
setAgentAvatarNotice(null);
|
|
1089
|
+
setAvatarGenerationFeedbackByAgentId((current) => {
|
|
1090
|
+
const next = { ...current };
|
|
1091
|
+
delete next[selectedAgentId];
|
|
1092
|
+
return next;
|
|
1093
|
+
});
|
|
1094
|
+
const shouldMutateCloudProfile = shouldUseCloudAvatarGeneration
|
|
1095
|
+
&& avatarSyncingAgentIds.has(selectedAgentId)
|
|
1096
|
+
&& Boolean(resolveCloudAuthUrl);
|
|
1097
|
+
try {
|
|
1098
|
+
const preparedAvatar = await prepareAvatarUploadFile(file, { maxBytes: 5 * 1024 * 1024 });
|
|
1099
|
+
if (preparedAvatar.exceededLimit) {
|
|
1100
|
+
throw new Error(file.type === 'image/gif'
|
|
1101
|
+
? 'Animated GIF agent photos must be 5 MB or smaller.'
|
|
1102
|
+
: 'Agent profile photo must be 5 MB or smaller.');
|
|
1103
|
+
}
|
|
1104
|
+
let preparedSourceFile = null;
|
|
1105
|
+
if (sourceFile) {
|
|
1106
|
+
const preparedSource = await prepareAvatarUploadFile(sourceFile, { maxBytes: 5 * 1024 * 1024 });
|
|
1107
|
+
if (preparedSource.exceededLimit) {
|
|
1108
|
+
throw new Error(sourceFile.type === 'image/gif'
|
|
1109
|
+
? 'Animated GIF agent source photos must be 5 MB or smaller.'
|
|
1110
|
+
: 'Agent profile source photo must be 5 MB or smaller.');
|
|
1111
|
+
}
|
|
1112
|
+
preparedSourceFile = preparedSource.file;
|
|
1113
|
+
}
|
|
1114
|
+
const displayFile = preparedAvatar.file;
|
|
1115
|
+
const displayDataUrl = await fileToDataUrl(displayFile);
|
|
1116
|
+
const sourceDataUrl = preparedSourceFile ? await fileToDataUrl(preparedSourceFile) : null;
|
|
1117
|
+
const payload = {
|
|
1118
|
+
profileId,
|
|
1119
|
+
preserveExistingSource: options?.preserveExistingSource === true,
|
|
1120
|
+
displayImage: {
|
|
1121
|
+
dataUrl: displayDataUrl,
|
|
1122
|
+
mimeType: displayFile.type || 'application/octet-stream',
|
|
1123
|
+
originalName: displayFile.name || 'display-avatar',
|
|
1124
|
+
},
|
|
1125
|
+
};
|
|
1126
|
+
if (preparedSourceFile && sourceDataUrl) {
|
|
1127
|
+
payload.sourceImage = {
|
|
1128
|
+
dataUrl: sourceDataUrl,
|
|
1129
|
+
mimeType: preparedSourceFile.type || 'application/octet-stream',
|
|
1130
|
+
originalName: preparedSourceFile.name || 'source-avatar',
|
|
1131
|
+
};
|
|
1132
|
+
}
|
|
1133
|
+
const uploadPath = '/api/taskforce/workspace/ai-profiles/avatar/upload';
|
|
1134
|
+
const uploadUrl = shouldMutateCloudProfile && resolveCloudAuthUrl
|
|
1135
|
+
? withTaskforceCloudHint(resolveCloudAuthUrl(uploadPath))
|
|
1136
|
+
: uploadPath;
|
|
1137
|
+
const res = await fetch(uploadUrl, {
|
|
1138
|
+
method: 'POST',
|
|
1139
|
+
credentials: 'include',
|
|
1140
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1141
|
+
body: JSON.stringify(payload),
|
|
1142
|
+
});
|
|
1143
|
+
const data = await res.json().catch(() => ({}));
|
|
1144
|
+
if (!res.ok || !data?.profile) {
|
|
1145
|
+
throw new Error(String(data?.error || 'Failed to update agent profile photo.'));
|
|
1146
|
+
}
|
|
1147
|
+
const updatedProfile = shouldMutateCloudProfile && resolveCloudAuthUrl ? {
|
|
1148
|
+
...data.profile,
|
|
1149
|
+
avatarUrl: data.profile.avatarUrl ? resolveCloudAuthUrl(data.profile.avatarUrl) : data.profile.avatarUrl,
|
|
1150
|
+
avatarSourceUrl: data.profile.avatarSourceUrl ? resolveCloudAuthUrl(data.profile.avatarSourceUrl) : data.profile.avatarSourceUrl,
|
|
1151
|
+
} : data.profile;
|
|
1152
|
+
applyAgentAvatarProfileUpdate(updatedProfile);
|
|
1153
|
+
const uploadedRevision = normalizedAvatarRevision(updatedProfile.avatarRevision);
|
|
1154
|
+
if (shouldMutateCloudProfile && uploadedRevision !== null) {
|
|
1155
|
+
pendingCloudAvatarRevisionByAgentIdRef.current.set(selectedAgentId, uploadedRevision);
|
|
1156
|
+
}
|
|
1157
|
+
if (!shouldMutateCloudProfile) {
|
|
1158
|
+
dispatchTaskforceAgentsMutated({ workspaceId, agentId: selectedAgentId, reason: 'agent-avatar-upload' });
|
|
1159
|
+
dispatchTaskforceAiProfilesMutated({ workspaceId, profileId, reason: 'avatar', origin: 'taskforce-agents-module' });
|
|
1160
|
+
}
|
|
1161
|
+
return true;
|
|
1162
|
+
}
|
|
1163
|
+
catch (error) {
|
|
1164
|
+
setAgentAvatarError(String(error?.message || 'Failed to update agent profile photo.'));
|
|
1165
|
+
return false;
|
|
1166
|
+
}
|
|
1167
|
+
finally {
|
|
1168
|
+
setAgentAvatarBusy(false);
|
|
1169
|
+
}
|
|
1170
|
+
};
|
|
1171
|
+
const handleAgentAvatarRemove = async () => {
|
|
1172
|
+
const profileId = String(selectedAgent?.profileId || '').trim();
|
|
1173
|
+
if (!selectedAgentId || !profileId)
|
|
1174
|
+
return;
|
|
1175
|
+
setAgentAvatarBusy(true);
|
|
1176
|
+
setAgentAvatarError(null);
|
|
1177
|
+
setAgentAvatarNotice(null);
|
|
1178
|
+
setAvatarGenerationFeedbackByAgentId((current) => {
|
|
1179
|
+
const next = { ...current };
|
|
1180
|
+
delete next[selectedAgentId];
|
|
1181
|
+
return next;
|
|
1182
|
+
});
|
|
1183
|
+
const shouldMutateCloudProfile = shouldUseCloudAvatarGeneration
|
|
1184
|
+
&& avatarSyncingAgentIds.has(selectedAgentId)
|
|
1185
|
+
&& Boolean(resolveCloudAuthUrl);
|
|
1186
|
+
try {
|
|
1187
|
+
const removePath = '/api/taskforce/workspace/ai-profiles/avatar';
|
|
1188
|
+
const removeUrl = shouldMutateCloudProfile && resolveCloudAuthUrl
|
|
1189
|
+
? withTaskforceCloudHint(resolveCloudAuthUrl(removePath))
|
|
1190
|
+
: removePath;
|
|
1191
|
+
const res = await fetch(removeUrl, {
|
|
1192
|
+
method: 'POST',
|
|
1193
|
+
credentials: 'include',
|
|
1194
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1195
|
+
body: JSON.stringify({ profileId, avatarUrl: null, avatarSourceUrl: null }),
|
|
1196
|
+
});
|
|
1197
|
+
const data = await res.json().catch(() => ({}));
|
|
1198
|
+
if (!res.ok || !data?.profile) {
|
|
1199
|
+
throw new Error(String(data?.error || 'Failed to remove agent profile photo.'));
|
|
1200
|
+
}
|
|
1201
|
+
applyAgentAvatarProfileUpdate(data.profile);
|
|
1202
|
+
const removedRevision = normalizedAvatarRevision(data.profile.avatarRevision);
|
|
1203
|
+
if (shouldMutateCloudProfile && removedRevision !== null) {
|
|
1204
|
+
pendingCloudAvatarRevisionByAgentIdRef.current.set(selectedAgentId, removedRevision);
|
|
1205
|
+
}
|
|
1206
|
+
setAgentAvatarNotice(shouldMutateCloudProfile
|
|
1207
|
+
? 'Agent profile photo removed in Taskforce Cloud. The local copy will be retained when sync runs.'
|
|
1208
|
+
: 'Agent profile photo removed.');
|
|
1209
|
+
if (!shouldMutateCloudProfile) {
|
|
1210
|
+
dispatchTaskforceAgentsMutated({ workspaceId, agentId: selectedAgentId, reason: 'agent-avatar-remove' });
|
|
1211
|
+
dispatchTaskforceAiProfilesMutated({ workspaceId, profileId, reason: 'avatar', origin: 'taskforce-agents-module' });
|
|
1212
|
+
}
|
|
1213
|
+
}
|
|
1214
|
+
catch (error) {
|
|
1215
|
+
setAgentAvatarError(String(error?.message || 'Failed to remove agent profile photo.'));
|
|
1216
|
+
}
|
|
1217
|
+
finally {
|
|
1218
|
+
setAgentAvatarBusy(false);
|
|
1219
|
+
}
|
|
1220
|
+
};
|
|
1221
|
+
const handleNewAgentDraft = () => requestAgentNavigation({ type: 'new' });
|
|
1222
|
+
const handleProviderChange = (nextProviderKeyRaw) => {
|
|
1223
|
+
configurationDraftDirtyRef.current = true;
|
|
1224
|
+
const nextProviderKey = normalizeTaskforceAgentProviderKey(nextProviderKeyRaw);
|
|
1225
|
+
const nextModels = modelsForTaskforceAgentProvider(nextProviderKey);
|
|
1226
|
+
setProviderKey(nextProviderKey);
|
|
1227
|
+
setModelKey(nextModels[0]?.key || '');
|
|
1228
|
+
setModelTier(nextModels[0]?.defaultTier || 'balanced');
|
|
1229
|
+
};
|
|
1230
|
+
const handleModelChange = (nextModelKeyRaw) => {
|
|
1231
|
+
configurationDraftDirtyRef.current = true;
|
|
1232
|
+
const nextModelKey = normalizeTaskforceAgentModelKey(nextModelKeyRaw, providerKey);
|
|
1233
|
+
const nextModel = modelOptions.find((model) => model.key === nextModelKey);
|
|
1234
|
+
setModelKey(nextModelKey);
|
|
1235
|
+
if (nextModel)
|
|
1236
|
+
setModelTier(nextModel.defaultTier);
|
|
1237
|
+
};
|
|
1238
|
+
const handleCancelConversationRename = () => {
|
|
1239
|
+
if (savingConversationTitle)
|
|
1240
|
+
return;
|
|
1241
|
+
conversationRenameRunIdRef.current += 1;
|
|
1242
|
+
setRenamingConversation(false);
|
|
1243
|
+
setConversationTitleDraft('');
|
|
1244
|
+
setConversationRenameError('');
|
|
1245
|
+
};
|
|
1246
|
+
const handleBeginConversationRename = () => {
|
|
1247
|
+
if (!selectedAgentId || !conversationId || !selectedConversationSummary)
|
|
1248
|
+
return;
|
|
1249
|
+
conversationRenameRunIdRef.current += 1;
|
|
1250
|
+
setConversationTitleDraft(selectedConversationSummary.title || 'Agent chat');
|
|
1251
|
+
setConversationRenameError('');
|
|
1252
|
+
setRenamingConversation(true);
|
|
1253
|
+
};
|
|
1254
|
+
const handleRenameConversation = async (event) => {
|
|
1255
|
+
event.preventDefault();
|
|
1256
|
+
const title = conversationTitleDraft.trim();
|
|
1257
|
+
if (!selectedAgentId || !conversationId || savingConversationTitle)
|
|
1258
|
+
return;
|
|
1259
|
+
if (!title) {
|
|
1260
|
+
setConversationRenameError('Chat name is required.');
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
if (title === selectedConversationSummary?.title) {
|
|
1264
|
+
handleCancelConversationRename();
|
|
1265
|
+
return;
|
|
1266
|
+
}
|
|
1267
|
+
const targetAgentId = selectedAgentId;
|
|
1268
|
+
const targetConversationId = conversationId;
|
|
1269
|
+
const renameRunId = ++conversationRenameRunIdRef.current;
|
|
1270
|
+
setSavingConversationTitle(true);
|
|
1271
|
+
setConversationRenameError('');
|
|
1272
|
+
try {
|
|
1273
|
+
const res = await fetch(`/api/taskforce/agents/${encodeURIComponent(targetAgentId)}/conversations/${encodeURIComponent(targetConversationId)}`, {
|
|
1274
|
+
method: 'PATCH',
|
|
1275
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1276
|
+
credentials: 'include',
|
|
1277
|
+
body: JSON.stringify({ workspaceId, title }),
|
|
1278
|
+
});
|
|
1279
|
+
const payload = await res.json().catch(() => ({}));
|
|
1280
|
+
if (conversationRenameRunIdRef.current !== renameRunId
|
|
1281
|
+
|| selectedAgentIdRef.current !== targetAgentId)
|
|
1282
|
+
return;
|
|
1283
|
+
if (!res.ok || payload?.success === false || !payload?.conversation) {
|
|
1284
|
+
setConversationRenameError(String(payload?.error || 'Unable to rename chat.'));
|
|
1285
|
+
return;
|
|
1286
|
+
}
|
|
1287
|
+
upsertConversationSummary(payload.conversation);
|
|
1288
|
+
setRenamingConversation(false);
|
|
1289
|
+
setConversationTitleDraft('');
|
|
1290
|
+
dispatchTaskforceAgentsMutated({
|
|
1291
|
+
workspaceId,
|
|
1292
|
+
agentId: targetAgentId,
|
|
1293
|
+
conversationId: targetConversationId,
|
|
1294
|
+
reason: 'conversation-update',
|
|
1295
|
+
});
|
|
1296
|
+
}
|
|
1297
|
+
catch (error) {
|
|
1298
|
+
if (conversationRenameRunIdRef.current !== renameRunId
|
|
1299
|
+
|| selectedAgentIdRef.current !== targetAgentId)
|
|
1300
|
+
return;
|
|
1301
|
+
setConversationRenameError(String(error?.message || error || 'Unable to rename chat.'));
|
|
1302
|
+
}
|
|
1303
|
+
finally {
|
|
1304
|
+
if (conversationRenameRunIdRef.current === renameRunId) {
|
|
1305
|
+
setSavingConversationTitle(false);
|
|
1306
|
+
}
|
|
1307
|
+
}
|
|
1308
|
+
};
|
|
1309
|
+
const handleNewConversation = async () => {
|
|
1310
|
+
if (!selectedAgentId) {
|
|
1311
|
+
setPrompt('');
|
|
1312
|
+
setConversationMessages([]);
|
|
1313
|
+
setResult(null);
|
|
1314
|
+
setToolActivity([]);
|
|
1315
|
+
setConversationId(null);
|
|
1316
|
+
appendLog('info', 'Started a new unsaved chat.');
|
|
1317
|
+
return;
|
|
1318
|
+
}
|
|
1319
|
+
setLoadingConversation(true);
|
|
1320
|
+
setToolActivity([]);
|
|
1321
|
+
try {
|
|
1322
|
+
const res = await fetch(`/api/taskforce/agents/${encodeURIComponent(selectedAgentId)}/conversation/new`, {
|
|
1323
|
+
method: 'POST',
|
|
1324
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1325
|
+
credentials: 'include',
|
|
1326
|
+
body: JSON.stringify({
|
|
1327
|
+
workspaceId,
|
|
1328
|
+
...(taskLaunchContext ? {
|
|
1329
|
+
taskId: taskLaunchContext.taskId,
|
|
1330
|
+
taskReference: taskLaunchContext.taskReference,
|
|
1331
|
+
taskTitle: taskLaunchContext.taskTitle,
|
|
1332
|
+
} : {}),
|
|
1333
|
+
}),
|
|
1334
|
+
});
|
|
1335
|
+
const payload = await res.json().catch(() => ({}));
|
|
1336
|
+
if (!res.ok || payload?.success === false) {
|
|
1337
|
+
appendLog('error', String(payload?.error || 'Unable to start a new chat.'));
|
|
1338
|
+
return;
|
|
1339
|
+
}
|
|
1340
|
+
setPrompt('');
|
|
1341
|
+
const nextConversation = payload?.conversation || null;
|
|
1342
|
+
applyConversation(nextConversation);
|
|
1343
|
+
rememberSelection(selectedAgentId, nextConversation?.id || null);
|
|
1344
|
+
if (nextConversation)
|
|
1345
|
+
upsertConversationSummary(nextConversation);
|
|
1346
|
+
dispatchTaskforceAgentsMutated({
|
|
1347
|
+
workspaceId,
|
|
1348
|
+
agentId: selectedAgentId,
|
|
1349
|
+
conversationId: payload?.conversation?.id || null,
|
|
1350
|
+
reason: 'conversation-create',
|
|
1351
|
+
});
|
|
1352
|
+
appendLog('info', 'Started a new saved chat.');
|
|
1353
|
+
}
|
|
1354
|
+
catch (err) {
|
|
1355
|
+
appendLog('error', String(err?.message || err || 'Unable to start a new chat.'));
|
|
1356
|
+
}
|
|
1357
|
+
finally {
|
|
1358
|
+
setLoadingConversation(false);
|
|
1359
|
+
}
|
|
1360
|
+
};
|
|
1361
|
+
const handleDraftTest = async () => {
|
|
1362
|
+
const nextPrompt = draftTestPrompt.trim();
|
|
1363
|
+
const nextAgentName = agentName.trim() || DEFAULT_AGENT_NAME;
|
|
1364
|
+
if (!nextPrompt || !definitionDraft.purpose.trim() || !modelKey || testingDraft)
|
|
1365
|
+
return;
|
|
1366
|
+
const draftDefinition = buildCurrentDraftDefinition();
|
|
1367
|
+
if (!canUseCloudAgentRuntime) {
|
|
1368
|
+
setDraftTestError(authSessionResolved
|
|
1369
|
+
? 'Sign in to Taskforce Cloud to test this agent.'
|
|
1370
|
+
: 'Cloud sign-in is still loading. Try again in a moment.');
|
|
1371
|
+
return;
|
|
1372
|
+
}
|
|
1373
|
+
setTestingDraft(true);
|
|
1374
|
+
const runId = ++draftTestRunIdRef.current;
|
|
1375
|
+
setDraftTestResult(null);
|
|
1376
|
+
setDraftTestSnapshot(null);
|
|
1377
|
+
setDraftTestToolActivity([]);
|
|
1378
|
+
setDraftTestError('');
|
|
1379
|
+
try {
|
|
1380
|
+
const res = await fetch('/api/taskforce/agents/model-gateway/test', {
|
|
1381
|
+
method: 'POST',
|
|
1382
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1383
|
+
credentials: 'include',
|
|
1384
|
+
body: JSON.stringify({
|
|
1385
|
+
workspaceId,
|
|
1386
|
+
agentName: nextAgentName,
|
|
1387
|
+
providerKey,
|
|
1388
|
+
modelKey,
|
|
1389
|
+
prompt: nextPrompt,
|
|
1390
|
+
messages: [{ role: 'user', content: nextPrompt }],
|
|
1391
|
+
draftDefinition,
|
|
1392
|
+
}),
|
|
1393
|
+
});
|
|
1394
|
+
const payload = await res.json().catch(() => ({}));
|
|
1395
|
+
if (draftTestRunIdRef.current !== runId)
|
|
1396
|
+
return;
|
|
1397
|
+
if (!res.ok || payload?.success === false) {
|
|
1398
|
+
setDraftTestError(String(payload?.error || 'Agent test failed.'));
|
|
1399
|
+
return;
|
|
1400
|
+
}
|
|
1401
|
+
setDraftTestResult(payload?.result || null);
|
|
1402
|
+
setDraftTestSnapshot({
|
|
1403
|
+
agentName: nextAgentName,
|
|
1404
|
+
providerKey,
|
|
1405
|
+
modelKey,
|
|
1406
|
+
prompt: nextPrompt,
|
|
1407
|
+
definition: draftDefinition,
|
|
1408
|
+
});
|
|
1409
|
+
const mcpToolCalls = Array.isArray(payload?.mcpToolCalls)
|
|
1410
|
+
? payload.mcpToolCalls
|
|
1411
|
+
: [];
|
|
1412
|
+
setDraftTestToolActivity(mcpToolCalls.reduce((activity, toolCall, index) => {
|
|
1413
|
+
const toolName = String(toolCall?.name || '').trim();
|
|
1414
|
+
if (!toolName)
|
|
1415
|
+
return activity;
|
|
1416
|
+
activity.push({
|
|
1417
|
+
id: `draft-${index}-${toolName}`,
|
|
1418
|
+
name: toolName,
|
|
1419
|
+
arguments: toolCall.arguments,
|
|
1420
|
+
resultText: toolCall.text,
|
|
1421
|
+
ok: toolCall.ok !== false,
|
|
1422
|
+
});
|
|
1423
|
+
return activity;
|
|
1424
|
+
}, []));
|
|
1425
|
+
}
|
|
1426
|
+
catch (error) {
|
|
1427
|
+
if (draftTestRunIdRef.current !== runId)
|
|
1428
|
+
return;
|
|
1429
|
+
setDraftTestError(String(error?.message || error || 'Agent test failed.'));
|
|
1430
|
+
}
|
|
1431
|
+
finally {
|
|
1432
|
+
if (draftTestRunIdRef.current === runId)
|
|
1433
|
+
setTestingDraft(false);
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
const handleTestModelGateway = async () => {
|
|
1437
|
+
const nextPrompt = prompt.trim();
|
|
1438
|
+
const nextSystemPrompt = systemPrompt.trim();
|
|
1439
|
+
const nextAgentName = agentName.trim() || DEFAULT_AGENT_NAME;
|
|
1440
|
+
if (!nextPrompt || !modelKey || testing || loadingConversation)
|
|
1441
|
+
return;
|
|
1442
|
+
if (!canUseCloudAgentRuntime) {
|
|
1443
|
+
const message = authSessionResolved
|
|
1444
|
+
? 'Sign in to Taskforce Cloud to chat with Taskforce agents.'
|
|
1445
|
+
: 'Cloud sign-in is still loading. Try again in a moment.';
|
|
1446
|
+
setPromptStatus(message);
|
|
1447
|
+
appendLog('error', message);
|
|
1448
|
+
return;
|
|
1449
|
+
}
|
|
1450
|
+
setTesting(true);
|
|
1451
|
+
setResult(null);
|
|
1452
|
+
setPromptStatus('');
|
|
1453
|
+
const startedAt = Date.now();
|
|
1454
|
+
const nextMessages = [
|
|
1455
|
+
...conversationMessages,
|
|
1456
|
+
{ role: 'user', content: nextPrompt },
|
|
1457
|
+
];
|
|
1458
|
+
setConversationMessages(nextMessages);
|
|
1459
|
+
setPrompt('');
|
|
1460
|
+
setToolActivity([]);
|
|
1461
|
+
appendLog('info', `Started test prompt for ${nextAgentName}.`);
|
|
1462
|
+
try {
|
|
1463
|
+
const res = await fetch('/api/taskforce/agents/model-gateway/test', {
|
|
1464
|
+
method: 'POST',
|
|
1465
|
+
headers: { 'Content-Type': 'application/json' },
|
|
1466
|
+
credentials: 'include',
|
|
1467
|
+
body: JSON.stringify({
|
|
1468
|
+
workspaceId,
|
|
1469
|
+
agentId: selectedAgentId,
|
|
1470
|
+
conversationId,
|
|
1471
|
+
agentName: nextAgentName,
|
|
1472
|
+
providerKey,
|
|
1473
|
+
modelKey,
|
|
1474
|
+
prompt: nextPrompt,
|
|
1475
|
+
messages: nextMessages,
|
|
1476
|
+
system: nextSystemPrompt,
|
|
1477
|
+
tier: selectedModel?.defaultTier || modelTier,
|
|
1478
|
+
...(activeTaskContext ? {
|
|
1479
|
+
taskId: activeTaskContext.taskId,
|
|
1480
|
+
taskReference: activeTaskContext.taskReference,
|
|
1481
|
+
taskTitle: activeTaskContext.taskTitle,
|
|
1482
|
+
} : {}),
|
|
1483
|
+
}),
|
|
1484
|
+
});
|
|
1485
|
+
const payload = await res.json().catch(() => ({}));
|
|
1486
|
+
if (!res.ok || payload?.success === false) {
|
|
1487
|
+
const message = String(payload?.error || 'Model gateway test failed.');
|
|
1488
|
+
setPromptStatus(message);
|
|
1489
|
+
appendLog('error', message);
|
|
1490
|
+
return;
|
|
1491
|
+
}
|
|
1492
|
+
const nextResult = payload?.result || null;
|
|
1493
|
+
setResult(nextResult);
|
|
1494
|
+
const mcpToolCalls = Array.isArray(payload?.mcpToolCalls)
|
|
1495
|
+
? payload.mcpToolCalls
|
|
1496
|
+
: [];
|
|
1497
|
+
const nextToolActivity = mcpToolCalls.reduce((activity, toolCall, index) => {
|
|
1498
|
+
const toolName = String(toolCall?.name || '').trim();
|
|
1499
|
+
if (!toolName)
|
|
1500
|
+
return activity;
|
|
1501
|
+
activity.push({
|
|
1502
|
+
id: `${startedAt}-${index}-${toolName}`,
|
|
1503
|
+
name: toolName,
|
|
1504
|
+
arguments: toolCall.arguments,
|
|
1505
|
+
resultText: toolCall.text,
|
|
1506
|
+
ok: toolCall.ok !== false,
|
|
1507
|
+
});
|
|
1508
|
+
return activity;
|
|
1509
|
+
}, []);
|
|
1510
|
+
setToolActivity(nextToolActivity);
|
|
1511
|
+
if (nextToolActivity.length > 0) {
|
|
1512
|
+
const hasToolError = nextToolActivity.some((toolCall) => !toolCall.ok);
|
|
1513
|
+
appendLog(hasToolError ? 'error' : 'success', formatToolActivityLogMessage(nextToolActivity), nextToolActivity);
|
|
1514
|
+
}
|
|
1515
|
+
const workflowCompletion = payload?.workflowCompletion;
|
|
1516
|
+
let installedWorkflowTask = workflowCompletion?.taskSnapshot || null;
|
|
1517
|
+
if (workflowCompletion?.executionId && workflowCompletion.assignmentSnapshot) {
|
|
1518
|
+
installedWorkflowTask = await applyCloudWorkflowCompletionProjection(workflowCompletion, { workspaceId, runtimeMode });
|
|
1519
|
+
}
|
|
1520
|
+
if (mcpToolCalls.length > 0) {
|
|
1521
|
+
nextToolActivity.forEach((toolCall) => {
|
|
1522
|
+
if ((toolCall.name === 'add_comment'
|
|
1523
|
+
|| toolCall.name === 'add_task_checklist_item'
|
|
1524
|
+
|| toolCall.name === 'replace_task_checklist'
|
|
1525
|
+
|| toolCall.name === 'complete_workflow_step') && toolCall.ok) {
|
|
1526
|
+
dispatchTaskforceTasksMutated({
|
|
1527
|
+
workspaceId,
|
|
1528
|
+
taskId: (toolCall.name === 'complete_workflow_step'
|
|
1529
|
+
? workflowCompletion?.taskId
|
|
1530
|
+
: null)
|
|
1531
|
+
|| activeTaskContext?.taskId
|
|
1532
|
+
|| String(toolCall.arguments?.taskId || toolCall.arguments?.id || '').trim()
|
|
1533
|
+
|| null,
|
|
1534
|
+
reason: toolCall.name === 'add_comment'
|
|
1535
|
+
? 'agent-comment'
|
|
1536
|
+
: toolCall.name === 'complete_workflow_step'
|
|
1537
|
+
? 'workflow-step'
|
|
1538
|
+
: 'agent-checklist',
|
|
1539
|
+
...(toolCall.name === 'complete_workflow_step' && installedWorkflowTask
|
|
1540
|
+
? { authoritativeTask: installedWorkflowTask }
|
|
1541
|
+
: {}),
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
if (payload?.conversation) {
|
|
1547
|
+
applyConversation(payload.conversation);
|
|
1548
|
+
rememberSelection(selectedAgentId, payload.conversation.id || conversationId || null);
|
|
1549
|
+
upsertConversationSummary(payload.conversation);
|
|
1550
|
+
dispatchTaskforceAgentsMutated({
|
|
1551
|
+
workspaceId,
|
|
1552
|
+
agentId: selectedAgentId,
|
|
1553
|
+
conversationId: payload.conversation.id || conversationId,
|
|
1554
|
+
reason: 'conversation-update',
|
|
1555
|
+
});
|
|
1556
|
+
}
|
|
1557
|
+
else {
|
|
1558
|
+
setConversationMessages(nextResult?.text
|
|
1559
|
+
? [...nextMessages, {
|
|
1560
|
+
role: 'assistant',
|
|
1561
|
+
content: String(nextResult.text),
|
|
1562
|
+
agentId: selectedAgentId || undefined,
|
|
1563
|
+
agentName: nextAgentName,
|
|
1564
|
+
providerKey,
|
|
1565
|
+
providerLabel: labelForTaskforceAgentProvider(providerKey),
|
|
1566
|
+
modelKey,
|
|
1567
|
+
modelLabel: labelForTaskforceAgentModel(modelKey),
|
|
1568
|
+
modelId: String(nextResult.modelId || ''),
|
|
1569
|
+
...(nextToolActivity.length > 0 ? {
|
|
1570
|
+
toolActivity: nextToolActivity.map(({ id: _id, ...toolCall }) => toolCall),
|
|
1571
|
+
} : {}),
|
|
1572
|
+
}]
|
|
1573
|
+
: nextMessages);
|
|
1574
|
+
}
|
|
1575
|
+
appendLog('success', `Model gateway completed successfully in ${nextResult?.latencyMs ?? Date.now() - startedAt} ms.`);
|
|
1576
|
+
}
|
|
1577
|
+
catch (err) {
|
|
1578
|
+
const message = String(err?.message || err || 'Model gateway test failed.');
|
|
1579
|
+
setPromptStatus(message);
|
|
1580
|
+
appendLog('error', message);
|
|
1581
|
+
}
|
|
1582
|
+
finally {
|
|
1583
|
+
setTesting(false);
|
|
1584
|
+
}
|
|
1585
|
+
};
|
|
1586
|
+
const handlePromptKeyDown = (event) => {
|
|
1587
|
+
if (event.key !== 'Enter' || event.shiftKey || event.nativeEvent.isComposing)
|
|
1588
|
+
return;
|
|
1589
|
+
event.preventDefault();
|
|
1590
|
+
void handleTestModelGateway();
|
|
1591
|
+
};
|
|
1592
|
+
const handleConversationSelect = (nextConversationId) => {
|
|
1593
|
+
if (!selectedAgentId || !nextConversationId || nextConversationId === conversationId)
|
|
1594
|
+
return;
|
|
1595
|
+
void loadConversation(selectedAgentId, nextConversationId);
|
|
1596
|
+
};
|
|
1597
|
+
const renderToolActivityList = (items) => (_jsx("div", { className: styles.taskforceAgentToolActivityList, children: items.map((toolCall) => (_jsxs("details", { className: `${styles.taskforceAgentToolCall} ${toolCall.ok ? '' : styles.taskforceAgentToolCallFailed}`.trim(), children: [_jsxs("summary", { children: [toolCall.ok ? _jsx(CheckCircle, { size: 13 }) : _jsx(AlertTriangle, { size: 13 }), _jsx("span", { className: styles.taskforceAgentToolCallName, children: toolCall.name }), _jsx("span", { className: styles.taskforceAgentToolCallStatus, children: toolCall.ok ? 'ok' : 'failed' })] }), _jsxs("div", { className: styles.taskforceAgentToolDetailsGrid, children: [_jsx("span", { children: "Arguments" }), _jsx("pre", { children: formatToolLogJson(toolCall.arguments) }), _jsx("span", { children: "Result" }), _jsx("pre", { children: formatToolLogResult(toolCall.resultText) })] })] }, toolCall.id))) }));
|
|
1598
|
+
const renderToolActivityDetails = (items, label = 'Tool Activity') => (_jsxs("details", { className: styles.taskforceAgentToolActivity, children: [_jsxs("summary", { children: [_jsx("span", { children: label }), _jsx("strong", { children: formatToolActivitySummary(items) })] }), renderToolActivityList(items)] }));
|
|
1599
|
+
const activeLibrary = activeBuilderTab === 'agents'
|
|
1600
|
+
? { icon: _jsx(Bot, { size: 14 }), title: 'Agent Roster', empty: 'No agents configured yet.' }
|
|
1601
|
+
: activeBuilderTab === 'roles'
|
|
1602
|
+
? { icon: _jsx(BriefcaseBusiness, { size: 14 }), title: 'Role Library', empty: 'No roles configured yet.' }
|
|
1603
|
+
: activeBuilderTab === 'skills'
|
|
1604
|
+
? { icon: _jsx(Sparkles, { size: 14 }), title: 'Skill Library', empty: 'Browse and manage Skills in the editor.' }
|
|
1605
|
+
: activeBuilderTab === 'connections'
|
|
1606
|
+
? { icon: _jsx(Plug, { size: 14 }), title: 'Connection Library', empty: 'Connections are not available yet.' }
|
|
1607
|
+
: { icon: _jsx(Database, { size: 14 }), title: 'Resource Library', empty: 'Resource Collections are not available yet.' };
|
|
1608
|
+
const builderTabs = (_jsxs("div", { className: styles.taskforceAgentBuilderNavigation, children: [_jsx("div", { className: styles.taskforceAgentBuilderTabs, role: "tablist", "aria-label": "Taskforce Agent builders", children: AGENT_BUILDER_TABS.map((tab, index) => {
|
|
1609
|
+
const active = activeBuilderTab === tab.id;
|
|
1610
|
+
return (_jsx("button", { ref: (element) => { builderTabRefs.current[tab.id] = element; }, type: "button", className: `${styles.taskforceAgentBuilderTab} ${active ? styles.taskforceAgentBuilderTabActive : ''}`.trim(), role: "tab", "aria-selected": active, "aria-controls": `taskforce-agent-builder-${tab.id}`, id: `taskforce-agent-builder-tab-${tab.id}`, tabIndex: active ? 0 : -1, onClick: () => setActiveBuilderTab(tab.id), onKeyDown: (event) => {
|
|
1611
|
+
let nextIndex = index;
|
|
1612
|
+
if (event.key === 'ArrowRight')
|
|
1613
|
+
nextIndex = (index + 1) % AGENT_BUILDER_TABS.length;
|
|
1614
|
+
else if (event.key === 'ArrowLeft')
|
|
1615
|
+
nextIndex = (index - 1 + AGENT_BUILDER_TABS.length) % AGENT_BUILDER_TABS.length;
|
|
1616
|
+
else if (event.key === 'Home')
|
|
1617
|
+
nextIndex = 0;
|
|
1618
|
+
else if (event.key === 'End')
|
|
1619
|
+
nextIndex = AGENT_BUILDER_TABS.length - 1;
|
|
1620
|
+
else
|
|
1621
|
+
return;
|
|
1622
|
+
event.preventDefault();
|
|
1623
|
+
const nextTab = AGENT_BUILDER_TABS[nextIndex];
|
|
1624
|
+
setActiveBuilderTab(nextTab.id);
|
|
1625
|
+
builderTabRefs.current[nextTab.id]?.focus();
|
|
1626
|
+
}, children: tab.label }, tab.id));
|
|
1627
|
+
}) }), activeBuilderTab === 'agents' ? (_jsxs("button", { type: "button", className: `${styles.secondaryHeaderBtn} ${styles.taskforceAgentBuilderCreateBtn}`.trim(), onClick: handleNewAgentDraft, children: [_jsx(Plus, { size: 14 }), "New Agent"] })) : null] }));
|
|
1628
|
+
const libraryTray = (_jsxs("aside", { className: `${styles.docTrayPanel} ${agentRosterTrayOpen ? styles.docTrayPanelOpen : ''}`.trim(), "aria-hidden": !agentRosterTrayOpen, "aria-label": activeLibrary.title, children: [_jsxs("div", { className: styles.taskforceAgentRosterHeader, children: [_jsxs("span", { className: styles.taskforceAgentRosterTitle, children: [activeLibrary.icon, activeLibrary.title] }), activeBuilderTab === 'agents' && loadingAgents && _jsx(Loader2, { size: 14, className: styles.spinner }), onCloseAgentRosterTray ? (_jsx("button", { type: "button", className: "tf-control-icon", onClick: onCloseAgentRosterTray, title: `Collapse ${activeLibrary.title.toLowerCase()}`, "aria-label": `Collapse ${activeLibrary.title.toLowerCase()}`, children: _jsx(ChevronLeft, { size: 16 }) })) : null] }), _jsx("div", { className: `${styles.taskforceAgentRosterContent} tf-scrollbar tf-tray-scroll-viewport`, children: activeBuilderTab === 'roles' ? (_jsx("div", { ref: setRoleLibraryPortalTarget, className: styles.taskforceAgentLibraryPortal })) : activeBuilderTab === 'skills' ? (_jsx("div", { ref: setSkillLibraryPortalTarget, className: styles.taskforceAgentLibraryPortal })) : activeBuilderTab === 'connections' ? (_jsx(FutureLibrarySummary, { kind: "connections" })) : activeBuilderTab === 'resources' ? (_jsx(FutureLibrarySummary, { kind: "resources" })) : activeBuilderTab === 'agents' && agents.length > 0 ? (_jsx("div", { className: styles.taskforceAgentList, children: agents.map((agent) => {
|
|
1629
|
+
const avatarUrl = getAgentAvatarUrl(agent);
|
|
1630
|
+
const color = agent.color || assignedAiProfileColor(agent.id);
|
|
1631
|
+
return (_jsx(AiIdentityRosterCard, { name: agent.name, username: agent.username, subtitle: "Taskforce Agent", avatar: avatarUrl
|
|
1632
|
+
? _jsx(AgentAvatarImage, { src: avatarUrl, fallbackSize: 22 })
|
|
1633
|
+
: _jsx(Bot, { size: 22 }), avatarStyle: { color }, selected: agent.id === selectedAgentId, disabled: !rememberedSelectionReady, onSelect: () => requestAgentNavigation({ type: 'agent', agent }), ariaLabel: `Edit ${agent.name}`, bottomUtility: _jsx("span", { className: styles.aiProfileGroupSignatureSwatch, style: { backgroundColor: color }, title: `Signature color ${color}`, "aria-hidden": "true" }) }, agent.id));
|
|
1634
|
+
}) })) : (_jsx("p", { className: styles.taskforceAgentListEmpty, children: activeLibrary.empty })) })] }));
|
|
1635
|
+
if (surface === 'taskDrawer') {
|
|
1636
|
+
return (_jsxs("div", { className: styles.taskforceAgentDrawerSurface, children: [activeTaskContext ? (_jsxs("div", { className: styles.taskforceAgentContextBanner, children: [_jsxs("div", { children: [_jsx("span", { children: "Context" }), _jsx("strong", { children: activeTaskContextLabel })] }), _jsxs("div", { className: styles.taskforceAgentContextActions, children: [onOpenTaskContext ? (_jsx("button", { type: "button", className: "tf-control-icon tf-control-icon-compact", onClick: () => onOpenTaskContext(activeTaskContext.taskId), title: "Open task", "aria-label": "Open task", children: _jsx(ExternalLink, { size: 13 }) })) : null, onClearLaunchContext && canClearActiveTaskContext ? (_jsx("button", { type: "button", className: "tf-control-icon tf-control-icon-compact", onClick: onClearLaunchContext, title: "Clear task context", "aria-label": "Clear task context", children: _jsx(X, { size: 13 }) })) : null] })] })) : null, agentProfileTrayOpen && selectedAgent ? (_jsxs("section", { className: styles.taskforceAgentProfileTray, "aria-label": `${selectedAgent.name} profile`, children: [_jsxs("div", { className: styles.taskforceAgentProfileTrayHeader, children: [_jsxs("span", { className: `${styles.taskforceAgentAvatarPreview} ${isSelectedAgentAvatarSyncing ? styles.taskforceAgentAvatarSyncing : ''}`.trim(), "aria-hidden": "true", children: [selectedAgentAvatarUrl
|
|
1637
|
+
? _jsx(AgentAvatarImage, { src: selectedAgentAvatarUrl, fallbackSize: 18 })
|
|
1638
|
+
: _jsx(Bot, { size: 18 }), isSelectedAgentAvatarSyncing ? _jsx(Loader2, { size: 13, className: `${styles.spinner} ${styles.taskforceAgentAvatarSyncIcon}` }) : null] }), _jsxs("div", { className: styles.taskforceAgentProfileTrayIdentity, children: [_jsx("span", { children: "Agent profile" }), _jsx("strong", { children: selectedAgent.name }), _jsxs("small", { children: [labelForTaskforceAgentProvider(selectedAgent.providerKey), " \u00B7 ", formatModelTier(selectedAgent.modelTier)] })] }), _jsx("button", { type: "button", className: "tf-control-icon tf-control-icon-compact", onClick: () => setAgentProfileTrayOpen(false), title: "Close agent profile", "aria-label": "Close agent profile", children: _jsx(X, { size: 13 }) })] }), _jsxs("dl", { className: styles.taskforceAgentProfileTrayDetails, children: [_jsxs("div", { children: [_jsx("dt", { children: "Platform" }), _jsx("dd", { children: formatAgentProvider(selectedAgent.modelProvider) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Provider" }), _jsx("dd", { children: labelForTaskforceAgentProvider(selectedAgent.providerKey) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Model" }), _jsx("dd", { children: labelForTaskforceAgentModel(selectedAgent.modelKey) })] }), _jsxs("div", { children: [_jsx("dt", { children: "Default tier" }), _jsx("dd", { children: formatModelTier(selectedAgent.modelTier) })] })] })] })) : null, _jsxs("div", { className: styles.taskforceAgentDrawerControls, children: [!onRenderDrawerHeader ? (_jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Agent" }), _jsx("select", { className: styles.select, value: selectedAgentId || '', onChange: (event) => {
|
|
1639
|
+
const nextAgent = agents.find((agent) => agent.id === event.target.value);
|
|
1640
|
+
if (nextAgent)
|
|
1641
|
+
requestAgentNavigation({ type: 'agent', agent: nextAgent });
|
|
1642
|
+
}, disabled: !rememberedSelectionReady || loadingAgents || agents.length === 0 || testing, children: agents.length > 0 ? (agents.map((agent) => (_jsxs("option", { value: agent.id, children: [agent.name, " \u00B7 ", labelForTaskforceAgentModel(agent.modelKey)] }, agent.id)))) : (_jsx("option", { value: "", children: "No agents configured" })) })] })) : null, renamingConversation ? (_jsxs("form", { className: styles.taskforceAgentConversationRename, onSubmit: handleRenameConversation, children: [_jsx("input", { className: styles.input, "aria-label": "Chat name", value: conversationTitleDraft, onChange: (event) => {
|
|
1643
|
+
setConversationTitleDraft(event.target.value);
|
|
1644
|
+
if (conversationRenameError)
|
|
1645
|
+
setConversationRenameError('');
|
|
1646
|
+
}, onKeyDown: (event) => {
|
|
1647
|
+
if (event.key !== 'Escape')
|
|
1648
|
+
return;
|
|
1649
|
+
event.preventDefault();
|
|
1650
|
+
handleCancelConversationRename();
|
|
1651
|
+
}, maxLength: 120, autoFocus: true, disabled: savingConversationTitle }), _jsx("button", { type: "submit", className: "tf-control-icon", "aria-label": "Save chat name", title: "Save chat name", disabled: savingConversationTitle || !conversationTitleDraft.trim(), children: savingConversationTitle ? _jsx(Loader2, { size: 14, className: styles.spinner }) : _jsx(Save, { size: 14 }) }), _jsx("button", { type: "button", className: "tf-control-icon", onClick: handleCancelConversationRename, "aria-label": "Cancel renaming", title: "Cancel", disabled: savingConversationTitle, children: _jsx(X, { size: 14 }) }), conversationRenameError ? (_jsx("div", { className: styles.taskforceAgentConversationRenameError, role: "alert", children: conversationRenameError })) : null] })) : (_jsxs("div", { className: styles.taskforceAgentDrawerChatControls, children: [selectedAgentId ? (_jsx("select", { className: `${styles.select} ${styles.taskforceAgentConversationSelect}`.trim(), "aria-label": "Saved chats", value: conversationId || '', onChange: (event) => handleConversationSelect(event.target.value), disabled: testing || loadingConversation || loadingConversationList || conversationSummaries.length === 0, children: conversationSummaries.length > 0 ? (_jsxs(_Fragment, { children: [!conversationId ? _jsx("option", { value: "", children: "Select chat" }) : null, conversationSummaries.map((conversation) => (_jsx("option", { value: conversation.id, children: formatConversationOption(conversation, taskLaunchContext) }, conversation.id)))] })) : (_jsx("option", { value: "", children: "No chats" })) })) : null, _jsx("button", { type: "button", className: "tf-control-icon", onClick: handleBeginConversationRename, disabled: testing || loadingConversation || !selectedConversationSummary, "aria-label": "Rename chat", title: "Rename chat", children: _jsx(Pencil, { size: 14 }) }), _jsx("button", { type: "button", className: "tf-control-icon", onClick: () => { void handleNewConversation(); }, disabled: testing || loadingConversation || !selectedAgentId, "aria-label": "New chat", title: "New chat", children: _jsx(Plus, { size: 14 }) })] }))] }), _jsxs("div", { className: `${styles.taskforceAgentConversationList} ${styles.taskforceAgentDrawerConversationList} tf-scrollbar`, children: [loadingConversation ? (_jsx("div", { className: styles.taskforceAgentConversationEmpty, children: "Loading saved conversation..." })) : conversationMessages.length > 0 ? (conversationMessages.map((message, index) => (_jsxs("div", { "data-conversation-role": message.role, style: message.role === 'assistant' && conversationAgentColor
|
|
1652
|
+
? { '--conversation-accent': conversationAgentColor }
|
|
1653
|
+
: undefined, className: `${styles.taskforceAgentConversationMessage} ${message.role === 'user' ? styles.taskforceAgentConversationMessageUser : styles.taskforceAgentConversationMessageAssistant}`.trim(), children: [_jsx("span", { children: formatConversationRole(message, conversationAgentLabel) }), _jsx(Markdown, { variant: "conversation", className: styles.taskforceAgentConversationBody, taskReferences: taskReferences, children: message.content }), message.role === 'assistant' && message.toolActivity?.length
|
|
1654
|
+
? renderToolActivityDetails(message.toolActivity.map((toolCall, toolIndex) => ({
|
|
1655
|
+
...toolCall,
|
|
1656
|
+
id: `${index}-${toolIndex}-${toolCall.name}`,
|
|
1657
|
+
})), 'Taskforce actions')
|
|
1658
|
+
: null] }, `${message.role}-${index}`)))) : !testing ? (_jsx("div", { className: styles.taskforceAgentConversationEmpty, children: selectedAgentId ? 'No conversation yet.' : 'Select an agent to start chatting.' })) : null, testing && !loadingConversation ? (_jsxs("div", { "data-conversation-role": "assistant", style: conversationAgentColor
|
|
1659
|
+
? { '--conversation-accent': conversationAgentColor }
|
|
1660
|
+
: undefined, className: `${styles.taskforceAgentConversationMessage} ${styles.taskforceAgentConversationMessageAssistant}`.trim(), children: [_jsx("span", { children: agentName.trim() || DEFAULT_AGENT_NAME }), _jsx("p", { children: "Waiting for model response..." })] })) : null, _jsx("div", { ref: conversationEndRef, "aria-hidden": "true" })] }), _jsxs("div", { className: styles.taskforceAgentDrawerPrompt, children: [_jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Message" }), _jsx("textarea", { className: styles.input, value: prompt, onChange: (event) => {
|
|
1661
|
+
setPrompt(event.target.value);
|
|
1662
|
+
if (promptStatus)
|
|
1663
|
+
setPromptStatus('');
|
|
1664
|
+
}, onKeyDown: handlePromptKeyDown, disabled: testing || loadingConversation || !selectedAgentId, placeholder: testing ? 'Waiting for response...' : TEST_PROMPT_PLACEHOLDER, maxLength: 4000 })] }), _jsxs("button", { type: "button", className: styles.secondaryHeaderBtn, onClick: () => { void handleTestModelGateway(); }, disabled: testing || loadingConversation || !prompt.trim() || !modelKey || !selectedAgentId, children: [testing ? _jsx(Loader2, { size: 14, className: styles.spinner }) : _jsx(Send, { size: 14 }), "Send"] }), promptStatus ? (_jsx("div", { className: styles.taskforceAgentDrawerPromptStatus, role: "status", children: promptStatus })) : null] }), _jsxs("div", { className: styles.taskforceAgentDrawerMetrics, "aria-label": "Response metrics", children: [_jsxs("span", { children: [_jsx("strong", { children: "Usage" }), formatModelGatewayUsage(result)] }), _jsxs("span", { children: [_jsx("strong", { children: "Latency" }), formatModelGatewayLatency(result)] })] })] }));
|
|
1665
|
+
}
|
|
1666
|
+
return (_jsxs("div", { className: `${styles.standalonePage} ${styles.standaloneContent} ${styles.taskforceAgentsModuleRoot} ${agentRosterTrayOpen ? styles.taskforceAgentsModuleTrayOpen : ''}`.trim(), children: [libraryTray, _jsxs("div", { className: `${styles.taskforceAgentsModuleMain} tf-scrollbar`, children: [_jsxs("div", { className: styles.settingsContent, style: { maxWidth: 1180, margin: '0 auto', width: '100%' }, children: [builderTabs, _jsx("div", { className: `${styles.settingGroup} ${styles.taskforceAgentBuilderPanel}`, hidden: activeBuilderTab !== 'agents', children: _jsxs("div", { className: styles.taskforceAgentTestGrid, role: "tabpanel", id: "taskforce-agent-builder-agents", "aria-labelledby": "taskforce-agent-builder-tab-agents", children: [_jsxs("div", { className: styles.settingGroup, children: [_jsxs("div", { className: styles.taskforceAgentAvatarPanel, children: [_jsxs("div", { className: styles.taskforceAgentAvatarEditControl, children: [_jsx(EditableAvatarButton, { label: selectedAgent ? `Edit ${selectedAgent.name} photo` : 'Photo editing is unavailable until agent creation', imageUrl: selectedAgentAvatarUrl, fallback: _jsx(Bot, { size: 28 }), accentColor: signatureColor || selectedAgent?.color, size: 88, editBadgeSize: 28, editIconSize: 14, disabled: !selectedAgentId, loading: Boolean(selectedAgentId && generatingAvatarAgentIds.has(selectedAgentId)), loadingLabel: `Generating ${selectedAgent?.name || 'agent'} photo`, error: Boolean(selectedAgentGenerationFeedback?.error), errorLabel: selectedAgentGenerationFeedback?.error || 'Agent photo generation failed', onClick: () => {
|
|
1667
|
+
setAgentAvatarError(null);
|
|
1668
|
+
setAgentAvatarNotice(null);
|
|
1669
|
+
setAvatarEditorOpen(true);
|
|
1670
|
+
} }), isSelectedAgentAvatarSyncing ? _jsx(Loader2, { size: 16, className: `${styles.spinner} ${styles.taskforceAgentAvatarSyncIcon}` }) : null] }), _jsxs("div", { className: styles.taskforceAgentAvatarCopy, children: [_jsx("strong", { children: agentName.trim() || selectedAgent?.name || DEFAULT_AGENT_NAME }), _jsx("span", { className: styles.taskforceAgentAvatarRole, children: "Taskforce Agent" }), isSelectedAgentAvatarSyncing ? _jsx("small", { children: "Syncing avatar..." }) : null] }), _jsxs("div", { className: styles.taskforceAgentToolbar, children: [configFeedback ? (_jsxs("span", { className: configFeedback.type === 'error' ? 'tf-chip-danger' : 'tf-chip-success', role: configFeedback.type === 'error' ? 'alert' : 'status', "aria-label": "Agent configuration status", children: [configFeedback.type === 'error' ? _jsx(AlertTriangle, { size: 12 }) : _jsx(CheckCircle, { size: 12 }), configFeedback.message] })) : null, _jsxs("button", { type: "button", className: styles.secondaryHeaderBtn, onClick: () => { void handleSaveAgent(); }, disabled: savingAgent || !agentName.trim() || !definitionDraft.purpose.trim() || !modelKey, children: [savingAgent ? _jsx(Loader2, { size: 14, className: styles.spinner }) : _jsx(Save, { size: 14 }), "Save"] })] })] }), selectedAgent?.configurationState && selectedAgent.configurationState !== 'valid' ? (_jsxs("div", { className: styles.taskforceAgentTestError, role: "alert", children: [_jsx(AlertTriangle, { size: 14 }), _jsxs("span", { children: ["This Agent configuration is ", selectedAgent.configurationState.replace(/-/g, ' '), ".", selectedAgent.configurationIssues?.[0]?.message
|
|
1671
|
+
? ` ${selectedAgent.configurationIssues[0].message}`
|
|
1672
|
+
: ' Repair the highlighted configuration before testing it.'] })] })) : null, _jsxs("div", { className: styles.topRow, children: [_jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Agent Name" }), _jsx("input", { className: styles.input, value: agentName, onChange: (event) => {
|
|
1673
|
+
configurationDraftDirtyRef.current = true;
|
|
1674
|
+
setAgentName(event.target.value);
|
|
1675
|
+
}, placeholder: DEFAULT_AGENT_NAME, required: true, maxLength: 80 })] }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Platform" }), _jsx("div", { className: styles.taskforceAgentReadonlyField, children: formatAgentProvider(modelProvider) })] }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Provider" }), _jsx("select", { className: styles.select, value: providerKey, onChange: (event) => handleProviderChange(event.target.value), children: configuredProviderOptions.map((provider) => (_jsx("option", { value: provider.key, children: provider.label }, provider.key))) })] }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Model" }), _jsx("select", { className: styles.select, value: modelKey, onChange: (event) => handleModelChange(event.target.value), disabled: modelOptions.length === 0, children: modelOptions.length > 0 ? (modelOptions.map((model) => (_jsx("option", { value: model.key, children: model.label }, model.key)))) : (_jsxs("option", { value: "", children: ["No configured ", labelForTaskforceAgentProvider(providerKey), " models yet"] })) })] }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Default Tier" }), _jsx("div", { className: styles.taskforceAgentReadonlyField, children: selectedModel ? formatModelTier(selectedModel.defaultTier) : 'No configured tier' })] })] }), _jsxs("div", { className: styles.taskforceAgentSignatureColorField, children: [_jsxs("div", { children: [_jsx("span", { className: styles.label, children: "Signature Color" }), _jsx("small", { children: "Identifies this agent across Taskforce." })] }), _jsxs("div", { className: styles.aiProfileColorPicker, "aria-label": "Signature color options", children: [AI_PROFILE_COLOR_TOKENS.map((token) => {
|
|
1676
|
+
const color = COLOR_PALETTE[token];
|
|
1677
|
+
return (_jsx("button", { type: "button", className: styles.aiProfileColorOption, style: { backgroundColor: color }, "aria-label": `Use ${token}`, "aria-pressed": signatureColor.toLowerCase() === color.toLowerCase(), onClick: () => {
|
|
1678
|
+
configurationDraftDirtyRef.current = true;
|
|
1679
|
+
setSignatureColor(color);
|
|
1680
|
+
setSignatureColorDirty(true);
|
|
1681
|
+
setSignatureColorReset(false);
|
|
1682
|
+
signatureColorEditPendingRef.current = true;
|
|
1683
|
+
} }, token));
|
|
1684
|
+
}), selectedAgent ? (_jsx("button", { type: "button", className: styles.secondaryHeaderBtn, onClick: () => {
|
|
1685
|
+
configurationDraftDirtyRef.current = true;
|
|
1686
|
+
setSignatureColor(assignedAiProfileColor(selectedAgent.id));
|
|
1687
|
+
setSignatureColorDirty(false);
|
|
1688
|
+
setSignatureColorReset(true);
|
|
1689
|
+
signatureColorEditPendingRef.current = true;
|
|
1690
|
+
}, children: "Reset" })) : null] })] }), _jsxs("div", { className: styles.taskforceAgentBehaviorGrid, children: [_jsxs("label", { className: `${styles.field} ${styles.taskforceAgentBehaviorWide}`, children: [_jsx("span", { className: styles.label, children: "Purpose" }), _jsx("small", { className: styles.taskforceAgentFieldHelper, children: "What should this agent help with?" }), _jsx("textarea", { className: styles.input, "aria-label": "Purpose", value: definitionDraft.purpose, onChange: (event) => {
|
|
1691
|
+
configurationDraftDirtyRef.current = true;
|
|
1692
|
+
setDefinitionDraft((current) => ({
|
|
1693
|
+
...current,
|
|
1694
|
+
purpose: event.target.value,
|
|
1695
|
+
}));
|
|
1696
|
+
}, maxLength: 1000, rows: 3, required: true })] }), _jsx("div", { className: styles.taskforceAgentBehaviorWide, children: _jsx(AgentBehaviorAssignments, { workspaceId: workspaceId, roleRef: definitionDraft.roleRef, skillRefs: definitionDraft.skillRefs, onRoleRefChange: (roleRef) => {
|
|
1697
|
+
configurationDraftDirtyRef.current = true;
|
|
1698
|
+
setDefinitionDraft((current) => ({
|
|
1699
|
+
...current,
|
|
1700
|
+
roleRef,
|
|
1701
|
+
}));
|
|
1702
|
+
}, onSkillRefsChange: (skillRefs) => {
|
|
1703
|
+
configurationDraftDirtyRef.current = true;
|
|
1704
|
+
setDefinitionDraft((current) => ({
|
|
1705
|
+
...current,
|
|
1706
|
+
skillRefs,
|
|
1707
|
+
}));
|
|
1708
|
+
}, onManageRoles: () => setActiveBuilderTab('roles'), onManageSkills: () => setActiveBuilderTab('skills') }) }), _jsx("div", { className: styles.taskforceAgentBehaviorWide, children: _jsx(ToolAccessSelector, { selectedKeys: definitionDraft.requestedCapabilities, hasCustomOverrides: Boolean(selectedAgent?.definition?.toolPolicy.toolOverrides?.length
|
|
1709
|
+
&& !definitionDraft.toolAccessChanged), onChange: (requestedCapabilities) => {
|
|
1710
|
+
configurationDraftDirtyRef.current = true;
|
|
1711
|
+
setDefinitionDraft((current) => ({
|
|
1712
|
+
...current,
|
|
1713
|
+
requestedCapabilities,
|
|
1714
|
+
toolAccessChanged: true,
|
|
1715
|
+
}));
|
|
1716
|
+
} }) }), _jsx("div", { className: styles.taskforceAgentBehaviorWide, children: _jsx(EffectiveConfigurationSummary, { hasRole: Boolean(definitionDraft.roleRef), directSkillCount: definitionDraft.skillRefs.length, toolKeys: definitionDraft.requestedCapabilities }) }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Personality and Voice" }), _jsx("small", { className: styles.taskforceAgentFieldHelper, children: "How should this agent behave or portray itself?" }), _jsxs("select", { className: styles.select, "aria-label": "Personality and Voice", value: definitionDraft.personalitySelection, onChange: (event) => {
|
|
1717
|
+
configurationDraftDirtyRef.current = true;
|
|
1718
|
+
setDefinitionDraft((current) => ({
|
|
1719
|
+
...current,
|
|
1720
|
+
personalitySelection: event.target.value,
|
|
1721
|
+
personalityCustom: event.target.value === CUSTOM_PRESET_VALUE
|
|
1722
|
+
? current.personalityCustom
|
|
1723
|
+
: '',
|
|
1724
|
+
}));
|
|
1725
|
+
}, children: [_jsx("option", { value: "", children: "No preset" }), PERSONALITY_PRESETS.map((preset) => (_jsx("option", { value: preset.key, children: preset.label }, preset.key))), _jsx("option", { value: CUSTOM_PRESET_VALUE, children: "Custom" })] })] }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Response Style" }), _jsx("small", { className: styles.taskforceAgentFieldHelper, children: "How should answers be written and structured?" }), _jsxs("select", { className: styles.select, "aria-label": "Response Style", value: definitionDraft.responseStyleSelection, onChange: (event) => {
|
|
1726
|
+
configurationDraftDirtyRef.current = true;
|
|
1727
|
+
setDefinitionDraft((current) => ({
|
|
1728
|
+
...current,
|
|
1729
|
+
responseStyleSelection: event.target.value,
|
|
1730
|
+
responseStyleCustom: event.target.value === CUSTOM_PRESET_VALUE
|
|
1731
|
+
? current.responseStyleCustom
|
|
1732
|
+
: '',
|
|
1733
|
+
}));
|
|
1734
|
+
}, children: [_jsx("option", { value: "", children: "No preset" }), RESPONSE_STYLE_PRESETS.map((preset) => (_jsx("option", { value: preset.key, children: preset.label }, preset.key))), _jsx("option", { value: CUSTOM_PRESET_VALUE, children: "Custom" })] })] }), definitionDraft.personalitySelection === CUSTOM_PRESET_VALUE ? (_jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Custom Personality and Voice" }), _jsx("textarea", { className: styles.input, "aria-label": "Custom Personality and Voice", value: definitionDraft.personalityCustom, onChange: (event) => {
|
|
1735
|
+
configurationDraftDirtyRef.current = true;
|
|
1736
|
+
setDefinitionDraft((current) => ({
|
|
1737
|
+
...current,
|
|
1738
|
+
personalityCustom: event.target.value,
|
|
1739
|
+
}));
|
|
1740
|
+
}, maxLength: 4000, rows: 3 })] })) : null, definitionDraft.responseStyleSelection === CUSTOM_PRESET_VALUE ? (_jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Custom Response Style" }), _jsx("textarea", { className: styles.input, "aria-label": "Custom Response Style", value: definitionDraft.responseStyleCustom, onChange: (event) => {
|
|
1741
|
+
configurationDraftDirtyRef.current = true;
|
|
1742
|
+
setDefinitionDraft((current) => ({
|
|
1743
|
+
...current,
|
|
1744
|
+
responseStyleCustom: event.target.value,
|
|
1745
|
+
}));
|
|
1746
|
+
}, maxLength: 4000, rows: 3 })] })) : null, _jsxs("label", { className: `${styles.field} ${styles.taskforceAgentBehaviorWide}`, children: [_jsx("span", { className: styles.label, children: "Working Guidelines" }), _jsx("small", { className: styles.taskforceAgentFieldHelper, children: "How should this agent approach tasks, decisions, and constraints?" }), _jsx("textarea", { className: styles.input, "aria-label": "Working Guidelines", style: { minHeight: 108, resize: 'vertical' }, value: systemPrompt, onChange: (event) => setSystemPrompt(event.target.value), maxLength: 8000 })] })] }), _jsxs("div", { className: styles.taskforceAgentPresentationGroup, children: [_jsxs("div", { children: [_jsx("span", { className: styles.label, children: "Avatar Generation Direction" }), _jsx("small", { className: styles.taskforceAgentFieldHelper, children: "Saved for manual avatar generation only. These details are excluded from normal Agent context." })] }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Avatar Visual Description" }), _jsx("textarea", { className: styles.input, "aria-label": "Avatar Visual Description", value: definitionDraft.avatarVisualDescription, onChange: (event) => {
|
|
1747
|
+
configurationDraftDirtyRef.current = true;
|
|
1748
|
+
setDefinitionDraft((current) => ({
|
|
1749
|
+
...current,
|
|
1750
|
+
avatarVisualDescription: event.target.value,
|
|
1751
|
+
}));
|
|
1752
|
+
}, maxLength: 4000, rows: 3, placeholder: "Describe what this agent or character looks like." })] }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Avatar Art Style" }), _jsxs("select", { className: styles.select, "aria-label": "Avatar Art Style", value: definitionDraft.avatarArtStyleSelection, onChange: (event) => {
|
|
1753
|
+
configurationDraftDirtyRef.current = true;
|
|
1754
|
+
setDefinitionDraft((current) => ({
|
|
1755
|
+
...current,
|
|
1756
|
+
avatarArtStyleSelection: event.target.value,
|
|
1757
|
+
avatarArtStyleCustom: event.target.value === CUSTOM_PRESET_VALUE
|
|
1758
|
+
? current.avatarArtStyleCustom
|
|
1759
|
+
: '',
|
|
1760
|
+
}));
|
|
1761
|
+
}, children: [_jsx("option", { value: "", children: DEFAULT_AVATAR_ART_STYLE_LABEL }), AVATAR_ART_STYLE_PRESETS.map((preset) => (_jsx("option", { value: preset.key, children: preset.label }, preset.key))), _jsx("option", { value: CUSTOM_PRESET_VALUE, children: "Custom" })] })] }), definitionDraft.avatarArtStyleSelection === CUSTOM_PRESET_VALUE ? (_jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Custom Avatar Art Style" }), _jsx("textarea", { className: styles.input, "aria-label": "Custom Avatar Art Style", value: definitionDraft.avatarArtStyleCustom, onChange: (event) => {
|
|
1762
|
+
configurationDraftDirtyRef.current = true;
|
|
1763
|
+
setDefinitionDraft((current) => ({
|
|
1764
|
+
...current,
|
|
1765
|
+
avatarArtStyleCustom: event.target.value,
|
|
1766
|
+
}));
|
|
1767
|
+
}, maxLength: 4000, rows: 3, placeholder: "Describe medium, palette, lighting, period, or atmosphere." })] })) : null] }), _jsxs("details", { className: styles.taskforceAgentToolActivity, children: [_jsxs("summary", { children: [_jsx("span", { children: "Technical model details" }), _jsx("strong", { children: selectedModel ? formatModelAvailability(selectedModel.availability) : 'Unavailable' })] }), _jsxs("div", { className: styles.taskforceAgentMetaGrid, children: [_jsxs("div", { children: [_jsx("span", { children: "Model ID" }), _jsx("code", { children: selectedModel?.runtimeModelId || 'No configured model' })] }), _jsxs("div", { children: [_jsx("span", { children: "Max Output" }), _jsx("strong", { children: formatMaxOutputTokens(selectedModel?.defaultMaxTokens) })] })] })] })] }), _jsx("div", { className: styles.taskforceAgentOutputStack, children: _jsxs("section", { className: styles.taskforceAgentOutputPanel, "aria-labelledby": "taskforce-agent-test-title", children: [_jsx("div", { className: styles.settingTitleRow, children: _jsxs("div", { className: styles.taskforceAgentTestTitle, children: [_jsx("span", { className: styles.taskforceAgentBuilderEmptyIcon, "aria-hidden": "true", children: _jsx(Beaker, { size: 18 }) }), _jsxs("div", { children: [_jsx("h4", { id: "taskforce-agent-test-title", className: styles.settingSubTitle, children: "Test Agent" }), _jsx("p", { children: "Run one isolated prompt against the current draft, including unsaved changes." })] })] }) }), _jsxs("div", { className: styles.taskforceAgentTestNotice, children: [_jsx(CheckCircle, { size: 14, "aria-hidden": "true" }), _jsx("span", { children: "Test messages are not saved to conversations and cannot write to task-scoped tools." })] }), _jsxs("label", { className: styles.field, children: [_jsx("span", { className: styles.label, children: "Test Prompt" }), _jsx("textarea", { className: styles.input, value: draftTestPrompt, onChange: (event) => setDraftTestPrompt(event.target.value), placeholder: "Ask the draft agent a representative question...", rows: 5, disabled: testingDraft })] }), _jsxs("div", { className: styles.taskforceAgentTestActions, children: [_jsxs("button", { type: "button", className: styles.secondaryHeaderBtn, onClick: resetDraftTest, disabled: testingDraft || (!draftTestPrompt && !draftTestResult && !draftTestError), children: [_jsx(RotateCcw, { size: 14 }), "Reset"] }), selectedAgentId && onOpenConversation ? (_jsxs("button", { type: "button", className: styles.secondaryHeaderBtn, onClick: () => onOpenConversation(selectedAgentId), disabled: testingDraft, children: [_jsx(MessageSquare, { size: 14 }), "Open in Conversation"] })) : null, _jsxs("button", { type: "button", className: styles.primaryUpdateBtn, onClick: () => { void handleDraftTest(); }, disabled: testingDraft || !draftTestPrompt.trim() || !definitionDraft.purpose.trim() || !modelKey, children: [testingDraft ? _jsx(Loader2, { size: 14, className: styles.spinner }) : _jsx(Beaker, { size: 14 }), testingDraft ? 'Testing...' : 'Run Test'] })] }), !canUseCloudAgentRuntime ? (_jsx("p", { className: styles.taskforceAgentTestRestriction, children: authSessionResolved
|
|
1768
|
+
? 'Sign in to Taskforce Cloud to run agent tests.'
|
|
1769
|
+
: 'Checking Taskforce Cloud sign-in...' })) : null, draftTestError ? (_jsxs("div", { className: styles.taskforceAgentTestError, role: "alert", children: [_jsx(AlertTriangle, { size: 14 }), _jsx("span", { children: draftTestError })] })) : null, testingDraft ? (_jsxs("div", { className: styles.taskforceAgentTestPending, role: "status", children: [_jsx(Loader2, { size: 15, className: styles.spinner }), _jsx("span", { children: "Running isolated test..." })] })) : null, draftTestResult ? (_jsxs("div", { className: styles.taskforceAgentTestResult, role: "status", "aria-live": "polite", children: [_jsxs("div", { className: styles.taskforceAgentTestResultHeader, children: [_jsxs("span", { children: [_jsx(CheckCircle, { size: 14 }), " Test completed"] }), _jsxs("span", { children: [formatModelGatewayLatency(draftTestResult), " \u00B7 ", formatModelGatewayUsage(draftTestResult)] })] }), _jsx("div", { className: styles.taskforceAgentTestResponse, children: _jsx(Markdown, { variant: "conversation", children: draftTestResult.text }) }), _jsxs("details", { className: styles.taskforceAgentToolActivity, children: [_jsxs("summary", { children: [_jsx("span", { children: "Response Details" }), _jsx("strong", { children: labelForTaskforceAgentModel(draftTestSnapshot?.modelKey || modelKey) })] }), _jsxs("div", { className: styles.taskforceAgentMetaGrid, children: [_jsxs("div", { children: [_jsx("span", { children: "Tested agent" }), _jsx("strong", { children: draftTestSnapshot?.agentName || agentName.trim() || DEFAULT_AGENT_NAME })] }), _jsxs("div", { children: [_jsx("span", { children: "Provider" }), _jsx("strong", { children: labelForTaskforceAgentProvider(draftTestSnapshot?.providerKey || providerKey) })] }), _jsxs("div", { children: [_jsx("span", { children: "Runtime model" }), _jsx("code", { children: draftTestResult.modelId || 'Not reported' })] }), _jsxs("div", { children: [_jsx("span", { children: "Test prompt" }), _jsx("strong", { children: draftTestSnapshot?.prompt || 'Not reported' })] }), _jsxs("div", { children: [_jsx("span", { children: "Tested purpose" }), _jsx("strong", { children: draftTestSnapshot?.definition.purpose || 'Not reported' })] }), _jsxs("div", { children: [_jsx("span", { children: "Tested working guidelines" }), _jsx("strong", { children: draftTestSnapshot?.definition.behavior.workingGuidelines || 'None' })] }), _jsxs("div", { children: [_jsx("span", { children: "Stop reason" }), _jsx("strong", { children: draftTestResult.stopReason || 'Not reported' })] }), _jsxs("div", { children: [_jsx("span", { children: "Input tokens" }), _jsx("strong", { children: draftTestResult.usage?.inputTokens ?? 'Not reported' })] }), _jsxs("div", { children: [_jsx("span", { children: "Output tokens" }), _jsx("strong", { children: draftTestResult.usage?.outputTokens ?? 'Not reported' })] }), _jsxs("div", { children: [_jsx("span", { children: "Total tokens" }), _jsx("strong", { children: draftTestResult.usage?.totalTokens ?? 'Not reported' })] }), _jsxs("div", { children: [_jsx("span", { children: "Latency" }), _jsx("strong", { children: formatModelGatewayLatency(draftTestResult) })] })] }), draftTestToolActivity.length > 0
|
|
1770
|
+
? renderToolActivityDetails(draftTestToolActivity, 'Managed Tool Activity')
|
|
1771
|
+
: null] })] })) : null] }) })] }) }), _jsx("section", { className: styles.taskforceAgentBuilderPanel, role: "tabpanel", id: "taskforce-agent-builder-roles", "aria-labelledby": "taskforce-agent-builder-tab-roles", hidden: activeBuilderTab !== 'roles', children: activeBuilderTab === 'roles'
|
|
1772
|
+
? (_jsx(RoleManagerPanel, { workspaceId: workspaceId, libraryPortalTarget: roleLibraryPortalTarget }))
|
|
1773
|
+
: null }), _jsx("section", { className: styles.taskforceAgentBuilderPanel, role: "tabpanel", id: "taskforce-agent-builder-skills", "aria-labelledby": "taskforce-agent-builder-tab-skills", hidden: activeBuilderTab !== 'skills', children: _jsx(SkillManagerPanel, { workspaceId: workspaceId, active: activeBuilderTab === 'skills', libraryPortalTarget: skillLibraryPortalTarget }, workspaceId) }), _jsx("section", { className: styles.taskforceAgentBuilderPanel, role: "tabpanel", id: "taskforce-agent-builder-connections", "aria-labelledby": "taskforce-agent-builder-tab-connections", hidden: activeBuilderTab !== 'connections', children: activeBuilderTab === 'connections' ? _jsx(FutureWorkspacePanel, { kind: "connections" }) : null }), _jsx("section", { className: styles.taskforceAgentBuilderPanel, role: "tabpanel", id: "taskforce-agent-builder-resources", "aria-labelledby": "taskforce-agent-builder-tab-resources", hidden: activeBuilderTab !== 'resources', children: activeBuilderTab === 'resources' ? _jsx(FutureWorkspacePanel, { kind: "resources" }) : null })] }), _jsx(Modal, { isOpen: Boolean(pendingAgentNavigation), onClose: () => setPendingAgentNavigation(null), title: "Discard unsaved changes?", size: "sm", theme: theme, closeOnOverlayClick: false, footer: (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", className: "tf-button-secondary", onClick: () => setPendingAgentNavigation(null), "data-modal-initial-focus": true, children: "Keep editing" }), _jsx("button", { type: "button", className: "tf-button-destructive", onClick: discardDraftAndNavigate, children: "Discard changes" })] })), children: _jsx("p", { children: "Your unsaved Agent changes will be lost." }) }), _jsx(AvatarImageManagerModal, { isOpen: avatarEditorOpen, theme: theme, title: "Edit Agent Profile Photo", currentImageUrl: selectedAgentAvatarUrl, editorImageUrl: selectedAgentAvatarSourceUrl, fallbackInitial: (selectedAgent?.name || 'Agent').charAt(0).toUpperCase(), accept: "image/png,image/jpeg,image/webp,image/gif", busy: agentAvatarBusy, generating: Boolean(selectedAgentId && generatingAvatarAgentIds.has(selectedAgentId)), generateLabel: selectedAgent?.avatarUrl ? 'Regenerate' : 'Generate', hasPendingImage: false, canRemove: Boolean(selectedAgent?.avatarUrl), error: agentAvatarError || selectedAgentGenerationFeedback?.error || null, notice: agentAvatarNotice || selectedAgentGenerationFeedback?.notice || null, onClose: () => {
|
|
1774
|
+
if (agentAvatarBusy)
|
|
1775
|
+
return;
|
|
1776
|
+
setAvatarEditorOpen(false);
|
|
1777
|
+
setAgentAvatarError(null);
|
|
1778
|
+
setAgentAvatarNotice(null);
|
|
1779
|
+
}, onApplyImage: handleAgentAvatarSelected, onGenerateImage: selectedAgentId && !generatingAvatarAgentIds.has(selectedAgentId)
|
|
1780
|
+
? handleGenerateAvatar
|
|
1781
|
+
: undefined, onRemoveImage: handleAgentAvatarRemove }, selectedAgentId || 'agent-avatar-draft')] })] }));
|
|
1782
|
+
}
|