@taskforcehq/taskforce 0.3.327 → 0.3.329
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/dist/Taskforce.module.css +257 -87
- package/dist/TaskforceCore.js +237 -230
- package/dist/annotatedAttachments/AnnotatedAttachmentSessionStore.js +1 -1
- package/dist/cli.js +34 -0
- package/dist/cliCloudTargetGuard.d.ts +5 -0
- package/dist/cliCloudTargetGuard.js +11 -0
- package/dist/components/activity/EntityActivityTimeline.js +15 -5
- package/dist/components/context/AttachmentPreviewHost.js +1 -1
- package/dist/components/context/ContextAttachmentManager.d.ts +3 -0
- package/dist/components/context/ContextAttachmentManager.js +116 -20
- package/dist/components/features/AnnotatedAttachmentWorkspace.js +24 -8
- package/dist/components/features/TaskSettings.d.ts +12 -1
- package/dist/components/features/TaskSettings.js +147 -40
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.d.ts +1 -1
- package/dist/components/features/planning/PlanningEntitySummary.d.ts +3 -1
- package/dist/components/features/planning/PlanningEntitySummary.js +3 -2
- package/dist/components/features/planning/PlanningLinkPicker.d.ts +3 -1
- package/dist/components/features/planning/PlanningLinkPicker.js +5 -3
- package/dist/components/features/planning/PlanningModule.js +28 -14
- package/dist/components/features/planning/PlanningTaskOrderList.d.ts +1 -1
- package/dist/components/features/planning/PlanningTaskOrderList.js +17 -6
- package/dist/components/features/planning/PlanningVisualIdentity.d.ts +14 -0
- package/dist/components/features/planning/PlanningVisualIdentity.js +106 -0
- package/dist/components/features/planning/planningTaskArrangement.d.ts +1 -0
- package/dist/components/features/planning/planningTaskArrangement.js +5 -5
- package/dist/components/features/planning/planningWorkspaceModel.d.ts +11 -0
- package/dist/components/features/taskforceAgentEditorModel.js +3 -1
- package/dist/components/task/TaskActionHeader.d.ts +2 -1
- package/dist/components/task/TaskActionHeader.js +2 -2
- package/dist/components/task/TaskCard.d.ts +5 -0
- package/dist/components/task/TaskCard.js +101 -13
- package/dist/components/task/TaskContextUpload.d.ts +3 -0
- package/dist/components/task/TaskContextUpload.js +2 -2
- package/dist/components/task/TaskForm.d.ts +4 -0
- package/dist/components/task/TaskForm.js +32 -7
- package/dist/components/task/TaskImageReviews.js +28 -19
- package/dist/components/task/TaskKanban.d.ts +6 -1
- package/dist/components/task/TaskKanban.js +152 -6
- package/dist/components/task/TaskList.d.ts +5 -0
- package/dist/components/task/TaskList.js +3 -3
- package/dist/components/task/TaskStatusActions.js +11 -2
- package/dist/components/task/TaskWorkstreamPicker.js +2 -1
- package/dist/components/ui/DocumentTypeIcon.d.ts +7 -0
- package/dist/components/ui/DocumentTypeIcon.js +8 -0
- package/dist/components/ui/PasswordInput.d.ts +6 -0
- package/dist/components/ui/PasswordInput.js +11 -0
- package/dist/components/ui/TaxonomyDropdown.d.ts +9 -1
- package/dist/components/ui/TaxonomyDropdown.js +30 -3
- package/dist/components/ui/TopNoticeLayer.js +1 -1
- package/dist/components/views/AppShellHeader.js +32 -11
- package/dist/components/views/PlanComparisonPage.js +12 -0
- package/dist/components/views/StandaloneLayout.js +68 -39
- package/dist/components/views/WidgetView.js +10 -7
- package/dist/components/views/panels/PlanningDrawer.d.ts +7 -1
- package/dist/components/views/panels/PlanningDrawer.js +51 -54
- package/dist/components/views/standalone/modals/AccountSettingsModal.js +26 -17
- package/dist/config/envSchema.js +13 -0
- package/dist/config/localServiceCloudTarget.d.ts +10 -0
- package/dist/config/localServiceCloudTarget.js +76 -0
- package/dist/config/localServiceRuntimeContract.d.ts +13 -0
- package/dist/config/localServiceRuntimeContract.js +135 -0
- package/dist/core/AiProfileService.d.ts +1 -0
- package/dist/core/AiProfileService.js +48 -9
- package/dist/core/AttachmentLinkService.js +7 -4
- package/dist/core/DeletedTaskLifecycleService.d.ts +5 -0
- package/dist/core/DeletedTaskLifecycleService.js +55 -3
- package/dist/core/McpTokenService.d.ts +4 -0
- package/dist/core/McpTokenService.js +52 -0
- package/dist/core/TaskAttachmentLinksDurableMutationService.d.ts +8 -2
- package/dist/core/TaskAttachmentLinksDurableMutationService.js +51 -18
- package/dist/core/Taskforce.d.ts +124 -2
- package/dist/core/Taskforce.js +1175 -87
- package/dist/core/types.d.ts +8 -1
- package/dist/documentReviews/DocumentReviewCommentStore.d.ts +11 -0
- package/dist/documentReviews/DocumentReviewCommentStore.js +35 -2
- package/dist/documentReviews/service.d.ts +4 -0
- package/dist/documentReviews/service.js +141 -46
- package/dist/hooks/sync/useDurableLocalOutboxDrain.d.ts +1 -1
- package/dist/hooks/sync/useDurableTaskCreateMutation.js +1 -1
- package/dist/hooks/sync/useDurableTaskMetadataMutation.d.ts +1 -0
- package/dist/hooks/sync/useDurableTaskMetadataMutation.js +1 -0
- package/dist/hooks/sync/useDurableTaskStatusMutation.d.ts +1 -0
- package/dist/hooks/tasks/taskHttpMutation.js +1 -0
- package/dist/hooks/tasks/useCloudTaskSearch.d.ts +12 -0
- package/dist/hooks/tasks/useCloudTaskSearch.js +71 -0
- package/dist/hooks/tasks/useTaskDescriptionImageDraftRecovery.d.ts +16 -0
- package/dist/hooks/tasks/useTaskDescriptionImageDraftRecovery.js +197 -0
- package/dist/hooks/tasks/useTaskEditorNavigation.d.ts +16 -3
- package/dist/hooks/tasks/useTaskEditorNavigation.js +72 -13
- package/dist/hooks/tasks/useTaskFormActions.d.ts +9 -0
- package/dist/hooks/tasks/useTaskFormActions.js +96 -17
- package/dist/hooks/ui/useSettingsModel.d.ts +24 -2
- package/dist/hooks/ui/useSettingsModel.js +13 -2
- package/dist/hooks/ui/useSettingsPersistence.d.ts +12 -1
- package/dist/hooks/ui/useSettingsPersistence.js +74 -47
- package/dist/hooks/useFilterSort.d.ts +7 -3
- package/dist/hooks/useFilterSort.js +15 -5
- package/dist/hooks/useTaskData.d.ts +10 -1
- package/dist/hooks/useTaskData.js +216 -7
- package/dist/hooks/useTaskMutations.d.ts +10 -2
- package/dist/hooks/useTaskMutations.js +223 -43
- package/dist/hooks/useTaskforce.d.ts +94 -57
- package/dist/hooks/useTaskforce.js +428 -16
- package/dist/hooks/useUiNotice.d.ts +4 -0
- package/dist/hooks/useUiNotice.js +4 -0
- package/dist/mcp/adminWorkspaceRegistrar.js +3 -3
- package/dist/mcp/canonicalAssetHelpers.d.ts +13 -0
- package/dist/mcp/canonicalAssetHelpers.js +39 -5
- package/dist/mcp/collaborationRegistrar.js +15 -13
- package/dist/mcp/documentAssetRegistrar.js +60 -44
- package/dist/mcp/documentHelpers.d.ts +1 -0
- package/dist/mcp/documentHelpers.js +7 -3
- package/dist/mcp/localServiceProxy.js +4 -1
- package/dist/mcp/runtime.d.ts +16 -0
- package/dist/mcp/runtime.js +735 -210
- package/dist/mcp/taskAttachmentCommandAdapter.d.ts +2 -0
- package/dist/mcp/taskAttachmentCommandAdapter.js +14 -8
- package/dist/mcp/taskPlanningRegistrar.js +78 -67
- package/dist/mcp/toolCallCompatibility.js +38 -1
- package/dist/mcp/toolCatalog.d.ts +1 -0
- package/dist/mcp/toolRegistry.js +2 -2
- package/dist/migrations/taskSchemaMigrations.js +47 -0
- package/dist/runtime/appGateDefinitions.d.ts +30 -6
- package/dist/runtime/appGateDefinitions.js +6 -6
- package/dist/runtime/appGates.d.ts +12 -13
- package/dist/runtime/appGates.js +29 -13
- package/dist/runtime/nodeAppGates.d.ts +8 -0
- package/dist/runtime/nodeAppGates.js +27 -0
- package/dist/server/appAccess.d.ts +12 -0
- package/dist/server/appAccess.js +21 -0
- package/dist/server/authorizedWorkspaceAccess.d.ts +12 -0
- package/dist/server/authorizedWorkspaceAccess.js +40 -0
- package/dist/server/cloudCollectionRead.d.ts +25 -0
- package/dist/server/cloudCollectionRead.js +120 -0
- package/dist/server/cloudCollectionReadPool.d.ts +52 -0
- package/dist/server/cloudCollectionReadPool.js +140 -0
- package/dist/server/cloudCollectionReadWorker.d.ts +1 -0
- package/dist/server/cloudCollectionReadWorker.js +36 -0
- package/dist/server/index.d.ts +6 -11
- package/dist/server/index.js +67 -42
- package/dist/server/localServiceLease.d.ts +6 -0
- package/dist/server/localServiceLease.js +17 -1
- package/dist/server/localWorkspaceSyncServerRuntime.js +10 -3
- package/dist/server/rateLimit.d.ts +1 -0
- package/dist/server/rateLimit.js +4 -0
- package/dist/server/realtimeSyncWs.js +36 -12
- package/dist/server/routes/admin.js +1 -0
- package/dist/server/routes/agentRoles.js +3 -2
- package/dist/server/routes/agentSkills.js +3 -2
- package/dist/server/routes/agents.js +118 -16
- package/dist/server/routes/annotatedAttachments.js +3 -2
- package/dist/server/routes/auth.js +3 -1
- package/dist/server/routes/documents.d.ts +5 -2
- package/dist/server/routes/documents.js +160 -13
- package/dist/server/routes/durableTaskHttpRouters.d.ts +11 -2
- package/dist/server/routes/durableTaskHttpRouters.js +2 -2
- package/dist/server/routes/localService.js +4 -0
- package/dist/server/routes/primitives.d.ts +4 -0
- package/dist/server/routes/shared.d.ts +24 -0
- package/dist/server/routes/shared.js +114 -18
- package/dist/server/routes/sync.js +22 -0
- package/dist/server/routes/syncAuxRoutes.js +5 -2
- package/dist/server/routes/syncPullApplyRoutes.js +23 -4
- package/dist/server/routes/syncV3FeedRoutes.js +22 -18
- package/dist/server/routes/syncV3LocalCaptureRoutes.js +48 -4
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.d.ts +1 -0
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.js +26 -0
- package/dist/server/routes/syncV3OperationRoutes.js +27 -2
- package/dist/server/routes/tasks.js +299 -97
- package/dist/server/routes/workspaces.js +43 -1
- package/dist/server/routes.js +35 -7
- package/dist/server/workspaceDeletionAdmission.d.ts +23 -0
- package/dist/server/workspaceDeletionAdmission.js +50 -0
- package/dist/service/localServiceCli.js +52 -25
- package/dist/service/localServiceClientLifecycle.js +93 -6
- package/dist/services/codexAppServerModelGateway.d.ts +112 -0
- package/dist/services/codexAppServerModelGateway.js +438 -0
- package/dist/services/taskforceAgentMcpBridge.d.ts +7 -1
- package/dist/services/taskforceAgentMcpBridge.js +23 -3
- package/dist/shared/planningIdentity.d.ts +20 -0
- package/dist/shared/planningIdentity.js +79 -0
- package/dist/shared/taskforceAgentDefinition.js +7 -1
- package/dist/shared/taskforceAgentModels.d.ts +1 -0
- package/dist/shared/taskforceAgentModels.js +30 -1
- package/dist/storage/postgresAdapter.d.ts +20 -3
- package/dist/storage/postgresAdapter.js +110 -14
- package/dist/storage/postgresRequestDiagnostics.d.ts +8 -0
- package/dist/storage/postgresRequestDiagnostics.js +24 -0
- package/dist/storage/postgresWorker.js +13 -4
- package/dist/storage/postgresWorkerProtocol.d.ts +29 -0
- package/dist/storage/postgresWorkerProtocol.js +30 -0
- package/dist/storage/workspaceAssetStore.d.ts +32 -0
- package/dist/storage/workspaceAssetStore.js +70 -0
- package/dist/sync/cloudSyncApi.d.ts +4 -1
- package/dist/sync/cloudSyncApi.js +7 -2
- package/dist/sync/contentSyncState.d.ts +1 -1
- package/dist/sync/coordinator/localSyncExecutionPermitStore.d.ts +17 -0
- package/dist/sync/coordinator/localSyncExecutionPermitStore.js +77 -23
- package/dist/sync/coordinator/localWorkspaceSyncRunner.js +6 -2
- package/dist/sync/coordinator/workspaceSyncTransportGateway.js +4 -2
- package/dist/sync/engine/workspaceSyncEngineBrowserGatewayRemoteServices.js +20 -2
- package/dist/sync/engine/workspaceSyncEngineLocalServices.d.ts +4 -0
- package/dist/sync/engine/workspaceSyncEngineLocalServices.js +11 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.d.ts +16 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.js +2 -1
- package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.d.ts +1 -1
- package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.js +46 -4
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.d.ts +3 -1
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +51 -11
- package/dist/sync/engine/workspaceSyncEngineTransfers.d.ts +1 -1
- package/dist/sync/engine/workspaceSyncEngineTransfers.js +8 -3
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +2 -0
- package/dist/sync/syncApplyHandlers.d.ts +3 -1
- package/dist/sync/syncApplyHandlers.js +29 -0
- package/dist/sync/syncService.d.ts +2 -0
- package/dist/sync/syncService.js +13 -1
- package/dist/sync/taskSyncPayload.d.ts +1 -0
- package/dist/sync/taskSyncPayload.js +6 -0
- package/dist/sync/v3/combinedFeedCapability.js +4 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.d.ts +3 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.js +31 -3
- package/dist/sync/v3/durableTaskChecklistMutationRouter.d.ts +2 -0
- package/dist/sync/v3/durableTaskChecklistMutationRouter.js +4 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.d.ts +1 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.js +47 -12
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.d.ts +5 -3
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.js +27 -2
- package/dist/sync/v3/localInitiativeOutboxService.js +4 -2
- package/dist/sync/v3/localOutboxDispatcher.js +5 -1
- package/dist/sync/v3/localTaskAttachmentLinksOutboxHandler.js +12 -2
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.d.ts +3 -0
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.js +62 -10
- package/dist/sync/v3/localTaskCreateOutboxService.js +15 -6
- package/dist/sync/v3/localTaskMetadataClient.d.ts +1 -0
- package/dist/sync/v3/localTaskMetadataClient.js +1 -0
- package/dist/sync/v3/localTaskMetadataOutboxHandler.js +5 -1
- package/dist/sync/v3/localTaskMetadataOutboxService.d.ts +2 -0
- package/dist/sync/v3/localTaskMetadataOutboxService.js +7 -0
- package/dist/sync/v3/localTaskRestoreOutboxService.js +14 -6
- package/dist/sync/v3/localTaskStatusClient.d.ts +1 -0
- package/dist/sync/v3/localTaskStatusClient.js +6 -1
- package/dist/sync/v3/localTaskStatusOutboxService.d.ts +2 -0
- package/dist/sync/v3/localTaskStatusOutboxService.js +54 -13
- package/dist/sync/v3/localWorkstreamOutboxService.js +4 -2
- package/dist/sync/v3/syncDurabilityStore.d.ts +15 -0
- package/dist/sync/v3/syncDurabilityStore.js +201 -43
- package/dist/sync/v3/taskAttachmentLinksMutationService.d.ts +7 -4
- package/dist/sync/v3/taskAttachmentLinksMutationService.js +37 -12
- package/dist/sync/v3/taskChecklistMutationService.d.ts +4 -2
- package/dist/sync/v3/taskChecklistMutationService.js +4 -0
- package/dist/sync/v3/taskCreateMutationService.d.ts +2 -2
- package/dist/sync/v3/taskCreateMutationService.js +7 -4
- package/dist/sync/v3/taskMetadataCoexistence.js +4 -0
- package/dist/sync/v3/taskMetadataMutationService.d.ts +3 -0
- package/dist/sync/v3/taskMetadataMutationService.js +4 -0
- package/dist/sync/v3/taskRestoreMutationService.d.ts +2 -2
- package/dist/sync/v3/taskRestoreMutationService.js +7 -4
- package/dist/sync/v3/taskStatusMutationService.d.ts +2 -0
- package/dist/sync/v3/taskStatusMutationService.js +4 -0
- package/dist/sync/v3/workflowAssignmentSync.d.ts +1 -0
- package/dist/sync/v3/workflowAssignmentSync.js +3 -0
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.d.ts +1 -1
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.js +14 -12
- package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.d.ts +11 -0
- package/dist/sync/v3/workspaceSyncV3AttachmentApplyObligationStore.js +27 -10
- package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.d.ts +2 -1
- package/dist/sync/v3/workspaceSyncV3AttachmentAssetHydration.js +52 -10
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.js +10 -1
- package/dist/sync/v3/workspaceSyncV3CombinedFeedOrchestrator.js +15 -4
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +66 -13
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.d.ts +11 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.js +57 -22
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.d.ts +10 -4
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.js +124 -51
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.d.ts +10 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.js +120 -28
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.d.ts +3 -1
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.js +18 -0
- package/dist/sync/v3/workspaceSyncV3CoverageRegistry.js +6 -0
- package/dist/sync/v3/workspaceSyncV3FeedProfile.d.ts +1 -1
- package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3LegacyBoundaryAttestation.js +23 -10
- package/dist/sync/v3/workspaceSyncV3NestedTaskApply.d.ts +3 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskApply.js +64 -13
- package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.d.ts +9 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskCodecs.js +26 -0
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.d.ts +15 -5
- package/dist/sync/v3/workspaceSyncV3NestedTaskProjection.js +50 -14
- package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.d.ts +2 -1
- package/dist/sync/v3/workspaceSyncV3NestedTaskRepairSnapshot.js +11 -3
- package/dist/sync/v3/workspaceSyncV3OperationProtocol.d.ts +3 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.d.ts +2 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.js +19 -7
- package/dist/sync/v3/workspaceSyncV3RepairSqlBatching.d.ts +2 -0
- package/dist/sync/v3/workspaceSyncV3RepairSqlBatching.js +10 -0
- package/dist/sync/v3/workspaceSyncV3TaskCommentAudit.js +9 -2
- package/dist/sync/v3/workspaceSyncV3TaskCoverCoverage.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverCoverage.js +37 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverWireContract.d.ts +6 -0
- package/dist/sync/v3/workspaceSyncV3TaskCoverWireContract.js +9 -0
- package/dist/sync/v3/workspaceSyncV3TaskRootProjection.d.ts +1 -1
- package/dist/sync/v3/workspaceSyncV3TaskRootProjection.js +1 -1
- package/dist/sync/workspacePullFeed.d.ts +6 -1
- package/dist/sync/workspacePullFeed.js +174 -162
- package/dist/sync/workspaceRepair.d.ts +3 -0
- package/dist/sync/workspaceRepair.js +67 -6
- package/dist/sync/workspaceSyncModel.d.ts +11 -0
- package/dist/sync/workspaceSyncModel.js +27 -2
- package/dist/types.d.ts +55 -1
- package/dist/types.js +6 -0
- package/dist/ui/assets/{AiIdentityRosterCard-DB1BLO_j.js → AiIdentityRosterCard-BZM4aQnM.js} +1 -1
- package/dist/ui/assets/AiProfilesModule-BbAEWtHH.js +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-B68Wg-RV.js +3 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-TzYu7pkG.css +1 -0
- package/dist/ui/assets/AssetTraySortControl-C8Rztyal.js +1 -0
- package/dist/ui/assets/ContextAttachmentManager-Cj3c7X9y.js +3 -0
- package/dist/ui/assets/{DocumentWorkspace-BC7sy5TG.js → DocumentWorkspace-B5uvzems.js} +4 -4
- package/dist/ui/assets/EntityActivityTimeline-BVFvCB5R.js +1 -0
- package/dist/ui/assets/PlanningModule-B5DWQOGz.js +1 -0
- package/dist/ui/assets/PlanningModule-CoIR9hbV.css +1 -0
- package/dist/ui/assets/PlansPage-AY4cGWco.js +1 -0
- package/dist/ui/assets/TaskContextUpload-DZxTVesW.js +1 -0
- package/dist/ui/assets/TaskContextUpload-qmBeUw3u.css +1 -0
- package/dist/ui/assets/TaskSettings-BeWAuyZj.js +12 -0
- package/dist/ui/assets/{TaskforceAgentsModule-CkAxW19K.js → TaskforceAgentsModule-BifCYtjR.js} +6 -6
- package/dist/ui/assets/WorkflowManagerModule-DEr5di_r.js +1 -0
- package/dist/ui/assets/index-I5zhdtgt.js +7 -0
- package/dist/ui/assets/index-VRFsx3wz.css +1 -0
- package/dist/ui/assets/{vendor-icons-B8ZNsH1g.js → vendor-icons-D9Lpw-j4.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/utils/constants.d.ts +2 -2
- package/dist/utils/constants.js +1 -1
- package/dist/utils/contextAttachmentUpload.d.ts +2 -0
- package/dist/utils/contextAttachmentUpload.js +7 -0
- package/dist/utils/contextFiles.d.ts +1 -1
- package/dist/utils/contextFiles.js +4 -4
- package/dist/utils/taskActivity.d.ts +3 -2
- package/dist/utils/taskActivity.js +19 -2
- package/dist/utils/taskEditorReconciliation.d.ts +40 -0
- package/dist/utils/taskEditorReconciliation.js +217 -0
- package/dist/utils/taskNormalization.d.ts +1 -0
- package/dist/utils/taskNormalization.js +39 -0
- package/dist/utils/taskSearch.js +2 -2
- package/dist/utils/uiNotice.d.ts +4 -0
- package/package.json +21 -4
- package/dist/ui/assets/AiProfilesModule-DPxQeF9N.js +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-CBRZ8rca.css +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-DHNYaNg6.js +0 -3
- package/dist/ui/assets/AssetTraySortControl-DphbyHVc.js +0 -1
- package/dist/ui/assets/ContextAttachmentManager-CMxSzHqc.js +0 -3
- package/dist/ui/assets/EntityActivityTimeline-pJ2ZjZ-k.js +0 -1
- package/dist/ui/assets/PlanningModule-CeTqXMMz.css +0 -1
- package/dist/ui/assets/PlanningModule-t5GbvVR9.js +0 -1
- package/dist/ui/assets/PlansPage-BVH_NfgT.js +0 -1
- package/dist/ui/assets/TaskContextUpload-Ds4LnDzV.css +0 -1
- package/dist/ui/assets/TaskContextUpload-bl4fOOUz.js +0 -1
- package/dist/ui/assets/TaskSettings-xVsxSa0g.js +0 -12
- package/dist/ui/assets/WorkflowManagerModule-BKqIGVnF.js +0 -1
- package/dist/ui/assets/index-BzJlVnNS.css +0 -1
- package/dist/ui/assets/index-Cx7vZJHL.js +0 -7
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
import { spawn } from 'child_process';
|
|
2
|
+
import { tmpdir } from 'os';
|
|
3
|
+
import readline from 'readline';
|
|
4
|
+
import { ModelGatewayConfigurationError } from './modelGateway.js';
|
|
5
|
+
import { TASKFORCE_AGENT_MODEL_OPTIONS, isTaskforceAgentSubscriptionDevModelsEnabled } from '../shared/taskforceAgentModels.js';
|
|
6
|
+
const CODEX_APP_SERVER_STDERR_LIMIT = 4_096;
|
|
7
|
+
export const DEFAULT_CODEX_APP_SERVER_MODEL_KEY_IDS = {
|
|
8
|
+
...Object.fromEntries(TASKFORCE_AGENT_MODEL_OPTIONS
|
|
9
|
+
.filter((model) => model.runtime === 'subscription-dev' && model.providerKey === 'openai')
|
|
10
|
+
.map((model) => [model.key, model.runtimeModelId])),
|
|
11
|
+
};
|
|
12
|
+
const CODEX_APP_SERVER_ENV_ALLOWLIST = [
|
|
13
|
+
'HOME',
|
|
14
|
+
'USER',
|
|
15
|
+
'LOGNAME',
|
|
16
|
+
'PATH',
|
|
17
|
+
'SHELL',
|
|
18
|
+
'TMPDIR',
|
|
19
|
+
'TEMP',
|
|
20
|
+
'TMP',
|
|
21
|
+
'LANG',
|
|
22
|
+
'LC_ALL',
|
|
23
|
+
'LC_CTYPE',
|
|
24
|
+
'TERM',
|
|
25
|
+
'COLORTERM',
|
|
26
|
+
'NO_COLOR',
|
|
27
|
+
'CODEX_HOME',
|
|
28
|
+
'XDG_CONFIG_HOME',
|
|
29
|
+
'XDG_CACHE_HOME',
|
|
30
|
+
'XDG_DATA_HOME',
|
|
31
|
+
];
|
|
32
|
+
export function buildCodexAppServerEnv(source = process.env) {
|
|
33
|
+
const env = {};
|
|
34
|
+
for (const key of CODEX_APP_SERVER_ENV_ALLOWLIST) {
|
|
35
|
+
const value = source[key];
|
|
36
|
+
if (typeof value === 'string' && value.length > 0)
|
|
37
|
+
env[key] = value;
|
|
38
|
+
}
|
|
39
|
+
return env;
|
|
40
|
+
}
|
|
41
|
+
export function sanitizeCodexAppServerStderr(value) {
|
|
42
|
+
return String(value || '')
|
|
43
|
+
.replace(/((?:api[_-]?key|access[_-]?token|refresh[_-]?token|client[_-]?secret)\s*[:=]\s*)[^\s]+/gi, '$1[redacted]')
|
|
44
|
+
.replace(/sk-[A-Za-z0-9_-]{8,}/g, '[redacted OpenAI credential]')
|
|
45
|
+
.replace(/(Bearer\s+)[^\s]+/gi, '$1[redacted]')
|
|
46
|
+
.replace(/[^\x09\x0A\x0D\x20-\x7E]/g, '?');
|
|
47
|
+
}
|
|
48
|
+
export function collectCodexAppServerStderr(current, chunk) {
|
|
49
|
+
return (current + String(chunk || '')).slice(-CODEX_APP_SERVER_STDERR_LIMIT);
|
|
50
|
+
}
|
|
51
|
+
export function assertCodexChatGptSubscriptionAccount(result) {
|
|
52
|
+
const accountType = readStringPath(result, ['account', 'type']);
|
|
53
|
+
if (accountType !== 'chatgpt') {
|
|
54
|
+
throw new ModelGatewayConfigurationError('Codex is not signed in with a ChatGPT subscription. Run codex login on this machine and choose Sign in with ChatGPT.', 'MODEL_SOURCE_UNAVAILABLE');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export function isCodexSubscriptionDevRuntimeAllowed(source = process.env) {
|
|
58
|
+
const runtimeMode = String(source.TASKFORCE_RUNTIME_MODE || '').trim().toLowerCase();
|
|
59
|
+
return runtimeMode === 'local';
|
|
60
|
+
}
|
|
61
|
+
function resolveCodexAppServerCwd(cwd) {
|
|
62
|
+
return String(cwd || process.env.TASKFORCE_CODEX_APP_SERVER_CWD || tmpdir()).trim() || tmpdir();
|
|
63
|
+
}
|
|
64
|
+
function buildCodexAppServerRuntimePolicy(cwd) {
|
|
65
|
+
return {
|
|
66
|
+
cwd,
|
|
67
|
+
approvalPolicy: 'never',
|
|
68
|
+
sandbox: 'read-only',
|
|
69
|
+
sandboxPolicy: {
|
|
70
|
+
type: 'readOnly',
|
|
71
|
+
networkAccess: false,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function extractCodexTurnCompletion(messages) {
|
|
76
|
+
const jsonMessages = messages;
|
|
77
|
+
const completed = jsonMessages.find((message) => message.method === 'turn/completed');
|
|
78
|
+
if (!completed)
|
|
79
|
+
return null;
|
|
80
|
+
const stopReason = readStringPath(completed.params, ['turn', 'status'])
|
|
81
|
+
|| readStringPath(completed.params, ['status'])
|
|
82
|
+
|| 'completed';
|
|
83
|
+
if (stopReason !== 'completed') {
|
|
84
|
+
const errorMessage = readStringPath(completed.params, ['turn', 'error', 'message'])
|
|
85
|
+
|| readStringPath(completed.params, ['error', 'message'])
|
|
86
|
+
|| `Codex app-server turn ended with status ${stopReason}.`;
|
|
87
|
+
throw new Error(errorMessage);
|
|
88
|
+
}
|
|
89
|
+
return {
|
|
90
|
+
text: extractAgentText(jsonMessages),
|
|
91
|
+
stopReason,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
export class CodexAppServerJsonRpcClient {
|
|
95
|
+
process;
|
|
96
|
+
pending = new Map();
|
|
97
|
+
notifications = [];
|
|
98
|
+
nextId = 1;
|
|
99
|
+
initialized = false;
|
|
100
|
+
lineReader;
|
|
101
|
+
requestTimeoutMs;
|
|
102
|
+
turnRejectors = new Set();
|
|
103
|
+
terminalError = null;
|
|
104
|
+
stderrTail = '';
|
|
105
|
+
constructor(options = {}) {
|
|
106
|
+
const command = options.command || process.env.TASKFORCE_CODEX_APP_SERVER_COMMAND || 'codex';
|
|
107
|
+
const args = options.args || ['app-server', '--listen', 'stdio://'];
|
|
108
|
+
const cwd = resolveCodexAppServerCwd(options.cwd);
|
|
109
|
+
this.requestTimeoutMs = options.requestTimeoutMs ?? 30_000;
|
|
110
|
+
this.process = spawn(command, args, {
|
|
111
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
112
|
+
env: options.env || buildCodexAppServerEnv(),
|
|
113
|
+
cwd,
|
|
114
|
+
});
|
|
115
|
+
this.lineReader = readline.createInterface({ input: this.process.stdout });
|
|
116
|
+
this.lineReader.on('line', (line) => this.handleLine(line));
|
|
117
|
+
this.process.on('error', (error) => {
|
|
118
|
+
this.fail(new Error(`Codex app-server failed to start: ${error.message}`));
|
|
119
|
+
});
|
|
120
|
+
this.process.on('exit', (code, signal) => {
|
|
121
|
+
const reason = signal ? `signal ${signal}` : `exit code ${code ?? 'unknown'}`;
|
|
122
|
+
const details = sanitizeCodexAppServerStderr(this.stderrTail).trim();
|
|
123
|
+
this.fail(new Error(`Codex app-server stopped before completing the request (${reason}).${details ? ` ${details}` : ''}`));
|
|
124
|
+
});
|
|
125
|
+
this.process.stderr.on('data', (chunk) => {
|
|
126
|
+
this.stderrTail = collectCodexAppServerStderr(this.stderrTail, chunk);
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
async initialize() {
|
|
130
|
+
if (this.initialized)
|
|
131
|
+
return;
|
|
132
|
+
await this.request('initialize', {
|
|
133
|
+
clientInfo: {
|
|
134
|
+
name: 'taskforce_dev',
|
|
135
|
+
title: 'Taskforce Dev',
|
|
136
|
+
version: '0.1.0',
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
this.sendNotification('initialized', {});
|
|
140
|
+
this.initialized = true;
|
|
141
|
+
}
|
|
142
|
+
async assertChatGptSubscriptionAuth() {
|
|
143
|
+
const result = await this.request('account/read', { refreshToken: false });
|
|
144
|
+
assertCodexChatGptSubscriptionAccount(result);
|
|
145
|
+
}
|
|
146
|
+
async startThread(input) {
|
|
147
|
+
const result = await this.request('thread/start', {
|
|
148
|
+
model: input.model,
|
|
149
|
+
cwd: input.cwd,
|
|
150
|
+
approvalPolicy: input.approvalPolicy,
|
|
151
|
+
sandbox: input.sandbox,
|
|
152
|
+
serviceName: 'taskforce_agent_manager_dev',
|
|
153
|
+
...(input.developerInstructions
|
|
154
|
+
? { developerInstructions: input.developerInstructions }
|
|
155
|
+
: {}),
|
|
156
|
+
});
|
|
157
|
+
const threadId = readStringPath(result, ['thread', 'id']) || readStringPath(result, ['id']);
|
|
158
|
+
if (!threadId)
|
|
159
|
+
throw new Error('Codex app-server did not return a thread id.');
|
|
160
|
+
return { threadId };
|
|
161
|
+
}
|
|
162
|
+
async startTurnAndCollectText(input) {
|
|
163
|
+
const startedAt = this.notifications.length;
|
|
164
|
+
await this.request('turn/start', {
|
|
165
|
+
threadId: input.threadId,
|
|
166
|
+
input: [{ type: 'text', text: input.prompt }],
|
|
167
|
+
cwd: input.cwd,
|
|
168
|
+
approvalPolicy: input.approvalPolicy,
|
|
169
|
+
sandboxPolicy: input.sandboxPolicy,
|
|
170
|
+
model: input.model,
|
|
171
|
+
});
|
|
172
|
+
return this.waitForTurnCompletion(startedAt, input.timeoutMs);
|
|
173
|
+
}
|
|
174
|
+
close() {
|
|
175
|
+
this.lineReader.close();
|
|
176
|
+
this.process.kill();
|
|
177
|
+
}
|
|
178
|
+
request(method, params) {
|
|
179
|
+
const id = this.nextId++;
|
|
180
|
+
const message = { jsonrpc: '2.0', id, method, params };
|
|
181
|
+
return new Promise((resolve, reject) => {
|
|
182
|
+
const timeout = setTimeout(() => {
|
|
183
|
+
this.pending.delete(id);
|
|
184
|
+
reject(new Error(`Timed out waiting for Codex app-server ${method} response.`));
|
|
185
|
+
}, this.requestTimeoutMs);
|
|
186
|
+
this.pending.set(id, {
|
|
187
|
+
resolve: (value) => {
|
|
188
|
+
clearTimeout(timeout);
|
|
189
|
+
resolve(value);
|
|
190
|
+
},
|
|
191
|
+
reject: (error) => {
|
|
192
|
+
clearTimeout(timeout);
|
|
193
|
+
reject(error);
|
|
194
|
+
},
|
|
195
|
+
});
|
|
196
|
+
this.process.stdin.write(JSON.stringify(message) + '\n', (error) => {
|
|
197
|
+
if (error) {
|
|
198
|
+
const pending = this.pending.get(id);
|
|
199
|
+
if (!pending)
|
|
200
|
+
return;
|
|
201
|
+
this.pending.delete(id);
|
|
202
|
+
pending.reject(error);
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
sendNotification(method, params) {
|
|
208
|
+
this.process.stdin.write(JSON.stringify({ jsonrpc: '2.0', method, params }) + '\n');
|
|
209
|
+
}
|
|
210
|
+
handleLine(line) {
|
|
211
|
+
const trimmed = line.trim();
|
|
212
|
+
if (!trimmed)
|
|
213
|
+
return;
|
|
214
|
+
let message;
|
|
215
|
+
try {
|
|
216
|
+
message = JSON.parse(trimmed);
|
|
217
|
+
}
|
|
218
|
+
catch {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (typeof message.id === 'number') {
|
|
222
|
+
const pending = this.pending.get(message.id);
|
|
223
|
+
if (!pending) {
|
|
224
|
+
if (message.method) {
|
|
225
|
+
this.sendResponseError(message.id, -32601, `Taskforce does not support Codex app-server request ${message.method}.`);
|
|
226
|
+
}
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
this.pending.delete(message.id);
|
|
230
|
+
if (message.error) {
|
|
231
|
+
pending.reject(new Error(message.error.message || 'Codex app-server request failed.'));
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
pending.resolve(message.result);
|
|
235
|
+
}
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
if (message.method)
|
|
239
|
+
this.notifications.push(message);
|
|
240
|
+
}
|
|
241
|
+
sendResponseError(id, code, message) {
|
|
242
|
+
this.process.stdin.write(JSON.stringify({
|
|
243
|
+
jsonrpc: '2.0',
|
|
244
|
+
id,
|
|
245
|
+
error: { code, message },
|
|
246
|
+
}) + '\n');
|
|
247
|
+
}
|
|
248
|
+
waitForTurnCompletion(startIndex, timeoutMs) {
|
|
249
|
+
const startedAt = Date.now();
|
|
250
|
+
return new Promise((resolve, reject) => {
|
|
251
|
+
let settled = false;
|
|
252
|
+
const rejectTurn = (error) => {
|
|
253
|
+
if (settled)
|
|
254
|
+
return;
|
|
255
|
+
settled = true;
|
|
256
|
+
this.turnRejectors.delete(rejectTurn);
|
|
257
|
+
reject(error);
|
|
258
|
+
};
|
|
259
|
+
const resolveTurn = (value) => {
|
|
260
|
+
if (settled)
|
|
261
|
+
return;
|
|
262
|
+
settled = true;
|
|
263
|
+
this.turnRejectors.delete(rejectTurn);
|
|
264
|
+
resolve(value);
|
|
265
|
+
};
|
|
266
|
+
this.turnRejectors.add(rejectTurn);
|
|
267
|
+
if (this.terminalError) {
|
|
268
|
+
rejectTurn(this.terminalError);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const poll = () => {
|
|
272
|
+
if (settled)
|
|
273
|
+
return;
|
|
274
|
+
const messages = this.notifications.slice(startIndex);
|
|
275
|
+
try {
|
|
276
|
+
const completion = extractCodexTurnCompletion(messages);
|
|
277
|
+
if (completion) {
|
|
278
|
+
resolveTurn(completion);
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
catch (error) {
|
|
283
|
+
rejectTurn(error instanceof Error ? error : new Error(String(error)));
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (Date.now() - startedAt > timeoutMs) {
|
|
287
|
+
rejectTurn(new Error('Timed out waiting for Codex app-server turn completion.'));
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
setTimeout(poll, 50);
|
|
291
|
+
};
|
|
292
|
+
poll();
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
rejectAll(error) {
|
|
296
|
+
for (const pending of this.pending.values())
|
|
297
|
+
pending.reject(error);
|
|
298
|
+
this.pending.clear();
|
|
299
|
+
}
|
|
300
|
+
fail(error) {
|
|
301
|
+
if (!this.terminalError)
|
|
302
|
+
this.terminalError = error;
|
|
303
|
+
this.rejectAll(this.terminalError);
|
|
304
|
+
for (const rejectTurn of [...this.turnRejectors])
|
|
305
|
+
rejectTurn(this.terminalError);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
export class CodexAppServerModelGateway {
|
|
309
|
+
client;
|
|
310
|
+
clientFactory;
|
|
311
|
+
modelKeyIds;
|
|
312
|
+
timeoutMs;
|
|
313
|
+
cwd;
|
|
314
|
+
constructor(options = {}) {
|
|
315
|
+
this.client = options.client;
|
|
316
|
+
this.cwd = resolveCodexAppServerCwd(options.cwd);
|
|
317
|
+
this.clientFactory = options.clientFactory || (() => new CodexAppServerJsonRpcClient({
|
|
318
|
+
command: options.command,
|
|
319
|
+
args: options.args,
|
|
320
|
+
cwd: this.cwd,
|
|
321
|
+
env: options.env,
|
|
322
|
+
requestTimeoutMs: options.requestTimeoutMs,
|
|
323
|
+
}));
|
|
324
|
+
this.modelKeyIds = {
|
|
325
|
+
...DEFAULT_CODEX_APP_SERVER_MODEL_KEY_IDS,
|
|
326
|
+
...(options.modelKeyIds ?? {}),
|
|
327
|
+
};
|
|
328
|
+
this.timeoutMs = options.timeoutMs ?? 120_000;
|
|
329
|
+
}
|
|
330
|
+
async generate(input) {
|
|
331
|
+
if (!isTaskforceAgentSubscriptionDevModelsEnabled()) {
|
|
332
|
+
throw new ModelGatewayConfigurationError('OpenAI Codex subscription-dev models are disabled. Set TASKFORCE_AGENT_SUBSCRIPTION_DEV_MODELS=true for this development runtime.', 'MODEL_SOURCE_UNAVAILABLE');
|
|
333
|
+
}
|
|
334
|
+
if (!isCodexSubscriptionDevRuntimeAllowed()) {
|
|
335
|
+
throw new ModelGatewayConfigurationError('OpenAI Codex subscription-dev models are only available in the local Taskforce runtime.', 'MODEL_SOURCE_UNAVAILABLE');
|
|
336
|
+
}
|
|
337
|
+
const modelId = this.resolveModelId(input);
|
|
338
|
+
const client = this.client || this.clientFactory();
|
|
339
|
+
const shouldClose = !this.client;
|
|
340
|
+
const runtimePolicy = buildCodexAppServerRuntimePolicy(this.cwd);
|
|
341
|
+
const startedAt = Date.now();
|
|
342
|
+
try {
|
|
343
|
+
await client.initialize();
|
|
344
|
+
await client.assertChatGptSubscriptionAuth();
|
|
345
|
+
const thread = await client.startThread({
|
|
346
|
+
model: modelId,
|
|
347
|
+
developerInstructions: input.system,
|
|
348
|
+
...runtimePolicy,
|
|
349
|
+
});
|
|
350
|
+
const result = await client.startTurnAndCollectText({
|
|
351
|
+
threadId: thread.threadId,
|
|
352
|
+
prompt: this.formatMessages(input),
|
|
353
|
+
model: modelId,
|
|
354
|
+
timeoutMs: this.timeoutMs,
|
|
355
|
+
...runtimePolicy,
|
|
356
|
+
});
|
|
357
|
+
return {
|
|
358
|
+
text: result.text.trim(),
|
|
359
|
+
provider: 'openai-codex-subscription-dev',
|
|
360
|
+
modelId,
|
|
361
|
+
stopReason: result.stopReason,
|
|
362
|
+
latencyMs: Date.now() - startedAt,
|
|
363
|
+
};
|
|
364
|
+
}
|
|
365
|
+
finally {
|
|
366
|
+
if (shouldClose)
|
|
367
|
+
client.close();
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
resolveModelId(input) {
|
|
371
|
+
const modelKey = String(input.modelKey || '').trim();
|
|
372
|
+
if (!modelKey)
|
|
373
|
+
throw new Error('No OpenAI Codex subscription-dev model selected.');
|
|
374
|
+
const modelId = this.modelKeyIds[modelKey];
|
|
375
|
+
if (!modelId)
|
|
376
|
+
throw new Error('No OpenAI Codex subscription-dev model configured for the selected model.');
|
|
377
|
+
return modelId;
|
|
378
|
+
}
|
|
379
|
+
formatMessages(input) {
|
|
380
|
+
return input.messages
|
|
381
|
+
.map((message) => `${message.role === 'assistant' ? 'Assistant' : 'User'}: ${message.content}`)
|
|
382
|
+
.join('\n\n');
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
function readStringPath(value, path) {
|
|
386
|
+
let cursor = value;
|
|
387
|
+
for (const segment of path) {
|
|
388
|
+
if (!cursor || typeof cursor !== 'object')
|
|
389
|
+
return '';
|
|
390
|
+
cursor = cursor[segment];
|
|
391
|
+
}
|
|
392
|
+
return typeof cursor === 'string' ? cursor.trim() : '';
|
|
393
|
+
}
|
|
394
|
+
function readTextPath(value, path) {
|
|
395
|
+
let cursor = value;
|
|
396
|
+
for (const segment of path) {
|
|
397
|
+
if (!cursor || typeof cursor !== 'object')
|
|
398
|
+
return '';
|
|
399
|
+
cursor = cursor[segment];
|
|
400
|
+
}
|
|
401
|
+
return typeof cursor === 'string' ? cursor : '';
|
|
402
|
+
}
|
|
403
|
+
function extractAgentText(messages) {
|
|
404
|
+
const deltaTextParts = [];
|
|
405
|
+
const finalAnswerTextParts = [];
|
|
406
|
+
const legacyCompletedTextParts = [];
|
|
407
|
+
for (const message of messages) {
|
|
408
|
+
if (message.method === 'item/agentMessage/delta') {
|
|
409
|
+
const text = readTextPath(message.params, ['delta'])
|
|
410
|
+
|| readTextPath(message.params, ['text'])
|
|
411
|
+
|| readTextPath(message.params, ['message', 'delta']);
|
|
412
|
+
if (text)
|
|
413
|
+
deltaTextParts.push(text);
|
|
414
|
+
}
|
|
415
|
+
if (message.method === 'item/completed') {
|
|
416
|
+
const itemType = readStringPath(message.params, ['item', 'type']);
|
|
417
|
+
if (itemType && itemType !== 'agentMessage')
|
|
418
|
+
continue;
|
|
419
|
+
const phase = readStringPath(message.params, ['item', 'phase']);
|
|
420
|
+
if (phase === 'commentary')
|
|
421
|
+
continue;
|
|
422
|
+
const text = readTextPath(message.params, ['item', 'text'])
|
|
423
|
+
|| readTextPath(message.params, ['item', 'content', 'text']);
|
|
424
|
+
if (!text)
|
|
425
|
+
continue;
|
|
426
|
+
if (phase === 'final_answer')
|
|
427
|
+
finalAnswerTextParts.push(text);
|
|
428
|
+
else
|
|
429
|
+
legacyCompletedTextParts.push(text);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
const textParts = finalAnswerTextParts.length > 0
|
|
433
|
+
? finalAnswerTextParts
|
|
434
|
+
: legacyCompletedTextParts.length > 0
|
|
435
|
+
? legacyCompletedTextParts
|
|
436
|
+
: deltaTextParts;
|
|
437
|
+
return textParts.join('').trim();
|
|
438
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type TaskforceCore } from '../core/Taskforce.js';
|
|
2
|
+
import { createTaskforceMcpServer } from '../mcp/runtime.js';
|
|
2
3
|
import { type ManagedAgentMcpToolProfile } from '../mcp/toolProfiles.js';
|
|
3
4
|
import { type McpToolName } from '../mcp/toolRegistry.js';
|
|
4
5
|
import type { AgentToolPolicy } from '../shared/taskforceAgentDefinition.js';
|
|
@@ -33,8 +34,12 @@ export type PrepareTaskforceAgentMcpBridgeInput = {
|
|
|
33
34
|
readOnly?: boolean;
|
|
34
35
|
toolProfile?: ManagedAgentMcpToolProfile;
|
|
35
36
|
toolPolicy?: AgentToolPolicy;
|
|
37
|
+
executionRequestId: string;
|
|
36
38
|
system: string;
|
|
37
39
|
};
|
|
40
|
+
type PrepareTaskforceAgentMcpBridgeDependencies = {
|
|
41
|
+
createMcpServer?: typeof createTaskforceMcpServer;
|
|
42
|
+
};
|
|
38
43
|
export declare const MANAGED_AGENT_LIST_TASKS_DEFAULT_LIMIT = 25;
|
|
39
44
|
export declare const MANAGED_AGENT_LIST_TASKS_MAX_LIMIT = 50;
|
|
40
45
|
export declare const MANAGED_AGENT_TOOL_RESULT_MAX_BYTES: number;
|
|
@@ -50,6 +55,7 @@ type McpToolDescriptor = {
|
|
|
50
55
|
export declare function hashTaskforceAgentMcpToolContract(tools: McpToolDescriptor[]): string;
|
|
51
56
|
export declare function isTaskforceAgentMutationToolName(name: string): boolean;
|
|
52
57
|
export declare function taskforceAgentMutationCallKey(name: string, argumentsValue: Record<string, unknown>): string | null;
|
|
58
|
+
export declare function taskforceAgentMcpRequestId(call: TaskforceAgentMcpToolCall): string;
|
|
53
59
|
declare const MANAGED_AGENT_CAPABILITY_TOOLS: Readonly<{
|
|
54
60
|
readonly tasks: readonly ["add_comment", "add_task_checklist_item", "complete_workflow_step", "get_schedule_board", "get_stats", "get_task", "get_task_attachments", "get_task_checklist", "get_task_workflow", "list_task_relationships", "list_tasks", "replace_task_checklist", "search_tasks"];
|
|
55
61
|
readonly planning: readonly ["add_initiative_comment", "add_workstream_comment", "get_initiative", "get_workstream", "list_initiatives", "list_workstreams"];
|
|
@@ -72,6 +78,6 @@ type BoundedManagedAgentToolResult = {
|
|
|
72
78
|
rejected: boolean;
|
|
73
79
|
};
|
|
74
80
|
export declare function boundManagedAgentMcpToolResult(toolName: string, text: string): BoundedManagedAgentToolResult;
|
|
75
|
-
export declare function prepareTaskforceAgentMcpBridge(input: PrepareTaskforceAgentMcpBridgeInput): Promise<PreparedTaskforceAgentMcpBridge | null>;
|
|
81
|
+
export declare function prepareTaskforceAgentMcpBridge(input: PrepareTaskforceAgentMcpBridgeInput, dependencies?: PrepareTaskforceAgentMcpBridgeDependencies): Promise<PreparedTaskforceAgentMcpBridge | null>;
|
|
76
82
|
export declare function serializeTaskforceAgentMcpToolResult(result: TaskforceAgentMcpToolResult): Record<string, unknown>;
|
|
77
83
|
export {};
|
|
@@ -31,6 +31,15 @@ export function taskforceAgentMutationCallKey(name, argumentsValue) {
|
|
|
31
31
|
return null;
|
|
32
32
|
return `${normalizedName}:${serializeCanonicalJson(argumentsValue || {})}`;
|
|
33
33
|
}
|
|
34
|
+
export function taskforceAgentMcpRequestId(call) {
|
|
35
|
+
return `managed-agent-${createHash('sha256')
|
|
36
|
+
.update(serializeCanonicalJson({
|
|
37
|
+
name: String(call.name || '').trim(),
|
|
38
|
+
arguments: call.arguments || {},
|
|
39
|
+
}))
|
|
40
|
+
.digest('hex')
|
|
41
|
+
.slice(0, 32)}`;
|
|
42
|
+
}
|
|
34
43
|
const TASK_SCOPED_MUTATION_TOOL_NAMES = new Set([
|
|
35
44
|
'add_comment',
|
|
36
45
|
'add_task_checklist_item',
|
|
@@ -284,6 +293,14 @@ function utf8ByteLength(value) {
|
|
|
284
293
|
return Buffer.byteLength(value, 'utf8');
|
|
285
294
|
}
|
|
286
295
|
export function normalizeManagedAgentMcpToolCall(call) {
|
|
296
|
+
if (call.name === 'get_task_workflow' || call.name === 'complete_workflow_step') {
|
|
297
|
+
const args = { ...call.arguments };
|
|
298
|
+
if (!String(args.taskId || '').trim() && String(args.id || '').trim()) {
|
|
299
|
+
args.taskId = args.id;
|
|
300
|
+
}
|
|
301
|
+
delete args.id;
|
|
302
|
+
return { name: call.name, arguments: args };
|
|
303
|
+
}
|
|
287
304
|
if (call.name !== 'list_tasks')
|
|
288
305
|
return call;
|
|
289
306
|
const args = { ...call.arguments };
|
|
@@ -438,7 +455,7 @@ function buildManagedAgentToolResultMessage(result, workflowReminder) {
|
|
|
438
455
|
'Use a narrower Taskforce read before answering the user.',
|
|
439
456
|
].join('\n');
|
|
440
457
|
}
|
|
441
|
-
export async function prepareTaskforceAgentMcpBridge(input) {
|
|
458
|
+
export async function prepareTaskforceAgentMcpBridge(input, dependencies = {}) {
|
|
442
459
|
if (!input.core)
|
|
443
460
|
return null;
|
|
444
461
|
if (input.runtimeMode !== 'cloud') {
|
|
@@ -454,7 +471,7 @@ export async function prepareTaskforceAgentMcpBridge(input) {
|
|
|
454
471
|
}
|
|
455
472
|
if (!input.agentProfileId)
|
|
456
473
|
managedToolNames.delete('complete_workflow_step');
|
|
457
|
-
const runtime = createTaskforceMcpServer({
|
|
474
|
+
const runtime = (dependencies.createMcpServer || createTaskforceMcpServer)({
|
|
458
475
|
core: input.core,
|
|
459
476
|
workspaceId: input.workspaceId,
|
|
460
477
|
runtimeMode: input.runtimeMode,
|
|
@@ -469,6 +486,7 @@ export async function prepareTaskforceAgentMcpBridge(input) {
|
|
|
469
486
|
aiProfileProvider: input.providerKey || 'taskforce_hq',
|
|
470
487
|
aiProfileModel: input.modelKey || null,
|
|
471
488
|
aiProfileSurfaceType: 'agent',
|
|
489
|
+
requestId: input.executionRequestId,
|
|
472
490
|
},
|
|
473
491
|
});
|
|
474
492
|
const tools = (await listRuntimeTools(runtime))
|
|
@@ -499,7 +517,9 @@ export async function prepareTaskforceAgentMcpBridge(input) {
|
|
|
499
517
|
name: effectiveCall.name,
|
|
500
518
|
arguments: effectiveCall.arguments,
|
|
501
519
|
},
|
|
502
|
-
}, {
|
|
520
|
+
}, {
|
|
521
|
+
requestId: taskforceAgentMcpRequestId(effectiveCall),
|
|
522
|
+
});
|
|
503
523
|
const bounded = boundManagedAgentMcpToolResult(effectiveCall.name, extractToolResultText(result));
|
|
504
524
|
return {
|
|
505
525
|
name: effectiveCall.name,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type PlanningIdentityEntityType = 'initiative' | 'workstream';
|
|
2
|
+
export declare const PLANNING_IDENTITY_ICONS: readonly ["Target", "Route", "Flag", "Rocket", "Briefcase", "Folder", "Layers", "Map", "Compass", "Landmark", "BookOpen", "Lightbulb", "Wrench", "Shield", "Bug", "Palette", "Camera", "Music", "Heart", "Globe", "Users", "Sparkles", "FlaskConical", "Code"];
|
|
3
|
+
export type PlanningIdentityIcon = typeof PLANNING_IDENTITY_ICONS[number];
|
|
4
|
+
export declare const PLANNING_IDENTITY_COLORS: readonly ["red", "orange", "amber", "green", "teal", "sky", "blue", "indigo", "violet"];
|
|
5
|
+
export type PlanningIdentityColor = typeof PLANNING_IDENTITY_COLORS[number];
|
|
6
|
+
export declare function normalizePlanningIdentityIcon(value: unknown): PlanningIdentityIcon | null;
|
|
7
|
+
export declare function normalizePlanningIdentityColor(value: unknown): PlanningIdentityColor | null;
|
|
8
|
+
export declare function assertPlanningIdentityIcon(value: unknown): PlanningIdentityIcon | null;
|
|
9
|
+
export declare function assertPlanningIdentityColor(value: unknown): PlanningIdentityColor | null;
|
|
10
|
+
export declare function resolvePlanningIdentity(input: {
|
|
11
|
+
entityType: PlanningIdentityEntityType;
|
|
12
|
+
entityId: string;
|
|
13
|
+
icon?: unknown;
|
|
14
|
+
color?: unknown;
|
|
15
|
+
}): {
|
|
16
|
+
icon: PlanningIdentityIcon;
|
|
17
|
+
color: PlanningIdentityColor | null;
|
|
18
|
+
customized: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare function planningIdentityColorToken(color?: PlanningIdentityColor | null): string;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export const PLANNING_IDENTITY_ICONS = Object.freeze([
|
|
2
|
+
'Target',
|
|
3
|
+
'Route',
|
|
4
|
+
'Flag',
|
|
5
|
+
'Rocket',
|
|
6
|
+
'Briefcase',
|
|
7
|
+
'Folder',
|
|
8
|
+
'Layers',
|
|
9
|
+
'Map',
|
|
10
|
+
'Compass',
|
|
11
|
+
'Landmark',
|
|
12
|
+
'BookOpen',
|
|
13
|
+
'Lightbulb',
|
|
14
|
+
'Wrench',
|
|
15
|
+
'Shield',
|
|
16
|
+
'Bug',
|
|
17
|
+
'Palette',
|
|
18
|
+
'Camera',
|
|
19
|
+
'Music',
|
|
20
|
+
'Heart',
|
|
21
|
+
'Globe',
|
|
22
|
+
'Users',
|
|
23
|
+
'Sparkles',
|
|
24
|
+
'FlaskConical',
|
|
25
|
+
'Code',
|
|
26
|
+
]);
|
|
27
|
+
export const PLANNING_IDENTITY_COLORS = Object.freeze([
|
|
28
|
+
'red',
|
|
29
|
+
'orange',
|
|
30
|
+
'amber',
|
|
31
|
+
'green',
|
|
32
|
+
'teal',
|
|
33
|
+
'sky',
|
|
34
|
+
'blue',
|
|
35
|
+
'indigo',
|
|
36
|
+
'violet',
|
|
37
|
+
]);
|
|
38
|
+
const ICON_SET = new Set(PLANNING_IDENTITY_ICONS);
|
|
39
|
+
const COLOR_SET = new Set(PLANNING_IDENTITY_COLORS);
|
|
40
|
+
export function normalizePlanningIdentityIcon(value) {
|
|
41
|
+
if (value === null || value === undefined || value === '')
|
|
42
|
+
return null;
|
|
43
|
+
const normalized = typeof value === 'string' ? value.trim() : '';
|
|
44
|
+
return ICON_SET.has(normalized) ? normalized : null;
|
|
45
|
+
}
|
|
46
|
+
export function normalizePlanningIdentityColor(value) {
|
|
47
|
+
if (value === null || value === undefined || value === '')
|
|
48
|
+
return null;
|
|
49
|
+
const normalized = typeof value === 'string' ? value.trim().toLowerCase() : '';
|
|
50
|
+
return COLOR_SET.has(normalized) ? normalized : null;
|
|
51
|
+
}
|
|
52
|
+
export function assertPlanningIdentityIcon(value) {
|
|
53
|
+
const normalized = normalizePlanningIdentityIcon(value);
|
|
54
|
+
if (value !== null && value !== undefined && value !== '' && !normalized) {
|
|
55
|
+
throw new Error('Planning identity icon is not supported.');
|
|
56
|
+
}
|
|
57
|
+
return normalized;
|
|
58
|
+
}
|
|
59
|
+
export function assertPlanningIdentityColor(value) {
|
|
60
|
+
const normalized = normalizePlanningIdentityColor(value);
|
|
61
|
+
if (value !== null && value !== undefined && value !== '' && !normalized) {
|
|
62
|
+
throw new Error('Planning identity color is not supported.');
|
|
63
|
+
}
|
|
64
|
+
return normalized;
|
|
65
|
+
}
|
|
66
|
+
export function resolvePlanningIdentity(input) {
|
|
67
|
+
const explicitIcon = normalizePlanningIdentityIcon(input.icon);
|
|
68
|
+
const explicitColor = normalizePlanningIdentityColor(input.color);
|
|
69
|
+
return {
|
|
70
|
+
icon: explicitIcon || (input.entityType === 'initiative' ? 'Target' : 'Route'),
|
|
71
|
+
color: explicitColor,
|
|
72
|
+
customized: Boolean(explicitIcon || explicitColor),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function planningIdentityColorToken(color) {
|
|
76
|
+
return color
|
|
77
|
+
? `var(--planning-identity-${color})`
|
|
78
|
+
: 'var(--planning-progress-empty)';
|
|
79
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getTaskforceAgentModel, isTaskforceAgentModelSource, normalizeTaskforceAgentConnectionScope, normalizeTaskforceAgentModelSource, } from './taskforceAgentModels.js';
|
|
1
|
+
import { getTaskforceAgentModel, isTaskforceAgentModelVisible, isTaskforceAgentModelSource, normalizeTaskforceAgentConnectionScope, normalizeTaskforceAgentModelSource, } from './taskforceAgentModels.js';
|
|
2
2
|
export const AGENT_DEFINITION_SCHEMA_VERSION = 1;
|
|
3
3
|
const FIELD_LIMITS = {
|
|
4
4
|
name: 80,
|
|
@@ -305,6 +305,12 @@ export function inspectAgentDefinition(value) {
|
|
|
305
305
|
if (value.model.connectionScope !== undefined && !connectionScope) {
|
|
306
306
|
issue(issues, 'invalid_model_connection_scope', 'model.connectionScope', 'Must be taskforce, workspace, personal, or local_dev when provided.');
|
|
307
307
|
}
|
|
308
|
+
if (catalogModel && !isTaskforceAgentModelVisible(catalogModel)) {
|
|
309
|
+
issue(issues, 'model_unavailable', 'model.modelKey', 'The selected model is not available in this runtime.');
|
|
310
|
+
}
|
|
311
|
+
if (modelSource === 'subscription_dev' && connectionScope !== 'local_dev') {
|
|
312
|
+
issue(issues, 'invalid_subscription_dev_connection_scope', 'model.connectionScope', 'Subscription-dev models require local_dev connection scope.');
|
|
313
|
+
}
|
|
308
314
|
const connectionId = readOptionalString(value.model.connectionId, 'model.connectionId', FIELD_LIMITS.referenceId, issues);
|
|
309
315
|
if (catalogModel && catalogModel.providerKey === providerKey && modelSource === catalogModel.source && MODEL_TIERS.has(value.model.tier)) {
|
|
310
316
|
model = {
|
|
@@ -36,6 +36,7 @@ export declare const DEFAULT_TASKFORCE_AGENT_MODEL_KEY = "anthropic.claude-sonne
|
|
|
36
36
|
export declare const TASKFORCE_AGENT_MODEL_SOURCES: TaskforceAgentModelSource[];
|
|
37
37
|
export declare const TASKFORCE_AGENT_PROVIDER_OPTIONS: TaskforceAgentProviderOption[];
|
|
38
38
|
export declare const TASKFORCE_AGENT_MODEL_OPTIONS: TaskforceAgentModelOption[];
|
|
39
|
+
export declare function isTaskforceAgentSubscriptionDevModelsEnabled(): boolean;
|
|
39
40
|
export declare function isTaskforceAgentModelVisible(model: TaskforceAgentModelOption): boolean;
|
|
40
41
|
export declare function getTaskforceAgentModel(modelKey: unknown): TaskforceAgentModelOption | null;
|
|
41
42
|
export declare function normalizeTaskforceAgentModelSource(value: unknown, fallback?: TaskforceAgentModelSource): TaskforceAgentModelSource;
|