@taskforcehq/taskforce 0.3.328 → 0.3.330
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 +523 -79
- 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/features/AiProfilesModule.js +3 -5
- package/dist/components/features/AnnotatedAttachmentWorkspace.js +24 -8
- package/dist/components/features/TaskSettings.d.ts +12 -1
- package/dist/components/features/TaskSettings.js +217 -54
- package/dist/components/features/TaskforceAgentsModule.d.ts +1 -2
- package/dist/components/features/TaskforceAgentsModule.js +586 -116
- package/dist/components/features/agentCapabilities/AgentCapabilitiesPrototype.d.ts +1 -1
- package/dist/components/features/agentConnections/AgentConnectionControl.d.ts +15 -0
- package/dist/components/features/agentConnections/AgentConnectionControl.js +125 -0
- package/dist/components/features/agentConnections/ModelConnectionsPanel.d.ts +18 -0
- package/dist/components/features/agentConnections/ModelConnectionsPanel.js +393 -0
- package/dist/components/features/agentConnections/modelConnectionsApi.d.ts +65 -0
- package/dist/components/features/agentConnections/modelConnectionsApi.js +129 -0
- package/dist/components/features/planning/PlanningModule.js +2 -5
- package/dist/components/features/planning/PlanningTaskOrderList.d.ts +1 -1
- package/dist/components/features/planning/PlanningTaskOrderList.js +17 -6
- package/dist/components/features/planning/planningTaskArrangement.d.ts +1 -0
- package/dist/components/features/planning/planningTaskArrangement.js +5 -5
- package/dist/components/features/taskforceAgentAssignments/AgentBehaviorAssignments.js +15 -24
- package/dist/components/features/taskforceAgentEditorModel.d.ts +2 -1
- package/dist/components/features/taskforceAgentEditorModel.js +5 -1
- package/dist/components/features/workflowManager/workflowManagerApi.d.ts +1 -1
- package/dist/components/features/workflowManager/workflowManagerApi.js +3 -0
- package/dist/components/task/TaskCard.d.ts +5 -0
- package/dist/components/task/TaskCard.js +65 -10
- package/dist/components/task/TaskImageReviews.js +14 -5
- 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/TaskWorkflowAssignmentField.js +68 -10
- package/dist/components/ui/PasswordInput.d.ts +6 -0
- package/dist/components/ui/PasswordInput.js +11 -0
- 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 +32 -55
- package/dist/components/views/WidgetView.js +3 -3
- package/dist/components/views/panels/PlanningDrawer.js +5 -12
- package/dist/components/views/standalone/modals/AccountSettingsModal.js +26 -17
- package/dist/components/views/standalone/modals/SyncStatusModal.d.ts +4 -3
- package/dist/components/views/standalone/modals/SyncStatusModal.js +33 -38
- package/dist/config/envSchema.js +60 -1
- package/dist/config/localServiceRuntimeContract.d.ts +13 -0
- package/dist/config/localServiceRuntimeContract.js +135 -0
- package/dist/core/AiProfileService.js +46 -8
- package/dist/core/DeletedTaskLifecycleService.d.ts +1 -0
- package/dist/core/DeletedTaskLifecycleService.js +37 -6
- package/dist/core/McpTokenService.d.ts +23 -1
- package/dist/core/McpTokenService.js +93 -10
- package/dist/core/TaskAttachmentLinksDurableMutationService.d.ts +3 -2
- package/dist/core/TaskAttachmentLinksDurableMutationService.js +33 -9
- package/dist/core/TaskChecklistCommandService.d.ts +27 -0
- package/dist/core/TaskChecklistCommandService.js +83 -5
- package/dist/core/TaskLifecycleCommandService.d.ts +3 -1
- package/dist/core/TaskLifecycleCommandService.js +6 -2
- package/dist/core/Taskforce.d.ts +94 -2
- package/dist/core/Taskforce.js +760 -36
- package/dist/core/types.d.ts +14 -0
- package/dist/documentReviews/commandService.d.ts +2 -1
- package/dist/documentReviews/commandService.js +6 -3
- package/dist/hooks/sync/orchestratorShared.d.ts +1 -0
- package/dist/hooks/sync/orchestratorShared.js +2 -0
- 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/sync/useLocalSyncCoordinatorSnapshot.d.ts +3 -0
- package/dist/hooks/sync/useLocalSyncCoordinatorSnapshot.js +85 -9
- package/dist/hooks/sync/useSyncStatusControls.d.ts +4 -1
- package/dist/hooks/sync/useSyncStatusControls.js +47 -11
- 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 +6 -0
- package/dist/hooks/tasks/useTaskFormActions.js +65 -12
- 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/useSyncOrchestrator.d.ts +3 -0
- package/dist/hooks/useSyncOrchestrator.js +111 -2
- package/dist/hooks/useTaskData.d.ts +40 -1
- package/dist/hooks/useTaskData.js +240 -9
- package/dist/hooks/useTaskMutations.d.ts +12 -2
- package/dist/hooks/useTaskMutations.js +266 -52
- package/dist/hooks/useTaskforce.d.ts +39 -9
- package/dist/hooks/useTaskforce.js +359 -40
- 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/clientRegistry.d.ts +2 -2
- package/dist/mcp/clientRegistry.js +1 -1
- package/dist/mcp/documentAssetRegistrar.js +53 -41
- package/dist/mcp/documentHelpers.d.ts +1 -0
- package/dist/mcp/documentHelpers.js +7 -3
- package/dist/mcp/durableTaskMutationRouter.d.ts +4 -1
- package/dist/mcp/durableTaskMutationRouter.js +10 -0
- package/dist/mcp/durableTaskRelationshipMutationRouter.js +4 -0
- package/dist/mcp/httpProtocolRouting.d.ts +10 -0
- package/dist/mcp/httpProtocolRouting.js +19 -0
- package/dist/mcp/localCliHealth.d.ts +2 -2
- package/dist/mcp/localCliHealth.js +2 -2
- package/dist/mcp/localServiceProxy.d.ts +1 -0
- package/dist/mcp/localServiceProxy.js +530 -68
- package/dist/mcp/planningAttachmentCommandAdapter.d.ts +3 -1
- package/dist/mcp/planningAttachmentCommandAdapter.js +20 -2
- package/dist/mcp/runtime.d.ts +54 -79
- package/dist/mcp/runtime.js +556 -139
- package/dist/mcp/taskPlanningRegistrar.js +64 -42
- package/dist/mcp/toolCallCompatibility.js +38 -1
- package/dist/mcp/toolCatalog.d.ts +1 -0
- package/dist/mcp/toolProfiles.d.ts +2 -0
- package/dist/mcp/toolProfiles.js +10 -0
- package/dist/mcp/toolRegistry.d.ts +1 -0
- package/dist/mcp/toolRegistry.js +1 -0
- package/dist/mcp/workflowExecutionRegistrar.js +4 -4
- package/dist/migrations/taskSchemaMigrations.d.ts +5 -0
- package/dist/migrations/taskSchemaMigrations.js +427 -0
- package/dist/runtime/appGateDefinitions.d.ts +30 -6
- package/dist/runtime/appGateDefinitions.js +6 -6
- package/dist/runtime/appGates.d.ts +13 -13
- package/dist/runtime/appGates.js +36 -13
- package/dist/runtime/nodeAppGates.d.ts +8 -0
- package/dist/runtime/nodeAppGates.js +27 -0
- package/dist/server/cloudCollectionRead.d.ts +1 -1
- package/dist/server/cloudCollectionRead.js +2 -2
- package/dist/server/index.d.ts +6 -0
- package/dist/server/index.js +123 -14
- package/dist/server/localDatabaseIdentity.js +4 -1
- package/dist/server/localServiceLease.d.ts +3 -0
- package/dist/server/localServiceLease.js +11 -2
- package/dist/server/localServiceSessions.d.ts +14 -17
- package/dist/server/localServiceSessions.js +308 -94
- package/dist/server/localWorkspaceSyncServerRuntime.js +12 -7
- 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.d.ts +4 -0
- package/dist/server/routes/admin.js +113 -3
- package/dist/server/routes/agentRoles.js +3 -2
- package/dist/server/routes/agentSkills.js +3 -2
- package/dist/server/routes/agents.d.ts +7 -0
- package/dist/server/routes/agents.js +394 -39
- package/dist/server/routes/annotatedAttachments.js +3 -2
- package/dist/server/routes/auth.js +3 -1
- package/dist/server/routes/billing.js +5 -1
- package/dist/server/routes/durableTaskHttpRouters.d.ts +11 -2
- package/dist/server/routes/executorPhaseAApprovals.d.ts +19 -0
- package/dist/server/routes/executorPhaseAApprovals.js +140 -0
- package/dist/server/routes/executorPhaseAIssuerRedemptions.d.ts +11 -0
- package/dist/server/routes/executorPhaseAIssuerRedemptions.js +24 -0
- package/dist/server/routes/githubReviewEvidence.d.ts +19 -0
- package/dist/server/routes/githubReviewEvidence.js +116 -0
- package/dist/server/routes/localService.d.ts +15 -4
- package/dist/server/routes/localService.js +138 -40
- package/dist/server/routes/modelConnections.d.ts +24 -0
- package/dist/server/routes/modelConnections.js +205 -0
- package/dist/server/routes/primitives.d.ts +2 -0
- package/dist/server/routes/shared.d.ts +19 -0
- package/dist/server/routes/shared.js +95 -19
- package/dist/server/routes/sync.js +1 -0
- package/dist/server/routes/syncAuxRoutes.js +9 -2
- package/dist/server/routes/syncPullApplyRoutes.js +23 -4
- package/dist/server/routes/syncPushRoutes.d.ts +1 -0
- package/dist/server/routes/syncPushRoutes.js +1 -0
- package/dist/server/routes/syncV3FeedRoutes.js +27 -16
- package/dist/server/routes/syncV3LocalCaptureRoutes.js +28 -2
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.d.ts +1 -0
- package/dist/server/routes/syncV3LocalFeedApplyRoutes.js +26 -0
- package/dist/server/routes/syncV3OperationRoutes.js +45 -9
- package/dist/server/routes/tasks.js +124 -13
- package/dist/server/routes/workflows.js +9 -1
- package/dist/server/routes/workspaces.js +43 -1
- package/dist/server/routes.js +59 -0
- package/dist/server/workspaceDeletionAdmission.d.ts +23 -0
- package/dist/server/workspaceDeletionAdmission.js +50 -0
- package/dist/service/localServiceCli.js +16 -0
- package/dist/service/localServiceClientLifecycle.js +36 -10
- package/dist/services/codexAppServerModelGateway.d.ts +161 -0
- package/dist/services/codexAppServerModelGateway.js +663 -0
- package/dist/services/codexDeviceCodeLoginManager.d.ts +39 -0
- package/dist/services/codexDeviceCodeLoginManager.js +265 -0
- package/dist/services/codexModelProviderConnectionLifecycle.d.ts +8 -0
- package/dist/services/codexModelProviderConnectionLifecycle.js +73 -0
- package/dist/services/executorPhaseAApprovalRuntime.d.ts +14 -0
- package/dist/services/executorPhaseAApprovalRuntime.js +24 -0
- package/dist/services/executorPhaseAApprovalService.d.ts +40 -0
- package/dist/services/executorPhaseAApprovalService.js +609 -0
- package/dist/services/executorPhaseADriftEvaluator.d.ts +78 -0
- package/dist/services/executorPhaseADriftEvaluator.js +93 -0
- package/dist/services/executorPhaseAIssuerCore.d.ts +126 -0
- package/dist/services/executorPhaseAIssuerCore.js +295 -0
- package/dist/services/executorPhaseAIssuerRedemptionService.d.ts +34 -0
- package/dist/services/executorPhaseAIssuerRedemptionService.js +158 -0
- package/dist/services/githubReviewEvidenceRuntime.d.ts +14 -0
- package/dist/services/githubReviewEvidenceRuntime.js +30 -0
- package/dist/services/githubReviewEvidenceService.d.ts +93 -0
- package/dist/services/githubReviewEvidenceService.js +336 -0
- package/dist/services/modelGateway.d.ts +7 -0
- package/dist/services/modelProviderConnectionService.d.ts +71 -0
- package/dist/services/modelProviderConnectionService.js +279 -0
- package/dist/services/modelProviderCredentialHome.d.ts +32 -0
- package/dist/services/modelProviderCredentialHome.js +271 -0
- package/dist/services/ownerScopedModelConnectionGateway.d.ts +12 -0
- package/dist/services/ownerScopedModelConnectionGateway.js +30 -0
- package/dist/services/taskforceAgentConnectionBindingService.d.ts +66 -0
- package/dist/services/taskforceAgentConnectionBindingService.js +185 -0
- package/dist/services/taskforceAgentMcpBridge.d.ts +8 -2
- package/dist/services/taskforceAgentMcpBridge.js +30 -27
- package/dist/shared/adminEdgeProxy.d.ts +5 -0
- package/dist/shared/adminEdgeProxy.js +94 -0
- package/dist/shared/adminProxySessionCookies.d.ts +16 -0
- package/dist/shared/adminProxySessionCookies.js +86 -0
- package/dist/shared/aiProfileColors.d.ts +31 -1
- package/dist/shared/aiProfileColors.js +14 -6
- package/dist/shared/executorPhaseAApprovalGoldenVector.json +269 -0
- package/dist/shared/executorPhaseAApprovalReceipt.d.ts +112 -0
- package/dist/shared/executorPhaseAApprovalReceipt.js +58 -0
- package/dist/shared/executorPhaseAApprovalTrustPolicy.json +10 -0
- package/dist/shared/executorPhaseADriftContracts.d.ts +37 -0
- package/dist/shared/executorPhaseADriftContracts.js +63 -0
- package/dist/shared/executorPhaseAIssuerContracts.d.ts +75 -0
- package/dist/shared/executorPhaseAIssuerContracts.js +90 -0
- package/dist/shared/executorPhaseARunAuthorization.d.ts +120 -0
- package/dist/shared/executorPhaseARunAuthorization.js +232 -0
- package/dist/shared/executorPhaseASchemaValidation.d.ts +7 -0
- package/dist/shared/executorPhaseASchemaValidation.js +53 -0
- package/dist/shared/executorPhaseASchemas/approval-receipt.schema.json +106 -0
- package/dist/shared/executorPhaseASchemas/drift-attestation.schema.json +54 -0
- package/dist/shared/executorPhaseASchemas/drift-request.schema.json +47 -0
- package/dist/shared/executorPhaseASchemas/foundation-manifest.schema.json +29 -0
- package/dist/shared/executorPhaseASchemas/issuer-audit-record.schema.json +24 -0
- package/dist/shared/executorPhaseASchemas/issuer-proof.schema.json +43 -0
- package/dist/shared/executorPhaseASchemas/issuer-redemption-request.schema.json +18 -0
- package/dist/shared/executorPhaseASchemas/issuer-redemption-response.schema.json +39 -0
- package/dist/shared/executorPhaseASchemas/logical-envelope.schema.json +149 -0
- package/dist/shared/executorPhaseASchemas/preflight-report.schema.json +216 -0
- package/dist/shared/executorPhaseASchemas/run-capability.schema.json +111 -0
- package/dist/shared/executorPhaseASchemas/sender-proof.schema.json +37 -0
- package/dist/shared/executorPhaseASchemas/workload-grant.schema.json +68 -0
- package/dist/shared/executorPhaseASchemas/workload-jwt-claims.schema.json +67 -0
- package/dist/shared/executorPhaseATiming.d.ts +1 -0
- package/dist/shared/executorPhaseATiming.js +1 -0
- package/dist/shared/planningIdentity.js +1 -1
- package/dist/shared/productLogoKeys.d.ts +2 -0
- package/dist/shared/productLogoKeys.js +18 -0
- package/dist/shared/taskforceAgentDefinition.d.ts +0 -1
- package/dist/shared/taskforceAgentDefinition.js +6 -3
- package/dist/shared/taskforceAgentModels.d.ts +1 -0
- package/dist/shared/taskforceAgentModels.js +36 -3
- package/dist/shared/userFeatureGrants.d.ts +4 -0
- package/dist/shared/userFeatureGrants.js +7 -0
- package/dist/storage/executorPhaseAApprovalReceiptStore.d.ts +37 -0
- package/dist/storage/executorPhaseAApprovalReceiptStore.js +81 -0
- package/dist/storage/executorPhaseARunAuthorizationStore.d.ts +103 -0
- package/dist/storage/executorPhaseARunAuthorizationStore.js +492 -0
- package/dist/storage/githubReviewEvidenceInstallationStore.d.ts +26 -0
- package/dist/storage/githubReviewEvidenceInstallationStore.js +89 -0
- package/dist/storage/modelProviderConnectionStore.d.ts +99 -0
- package/dist/storage/modelProviderConnectionStore.js +446 -0
- package/dist/storage/postgresAdapter.d.ts +24 -3
- package/dist/storage/postgresAdapter.js +117 -14
- package/dist/storage/postgresWorker.js +22 -5
- package/dist/storage/postgresWorkerProtocol.d.ts +30 -0
- package/dist/storage/postgresWorkerProtocol.js +30 -0
- package/dist/storage/taskforceAgentConnectionBindingStore.d.ts +31 -0
- package/dist/storage/taskforceAgentConnectionBindingStore.js +84 -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 +1 -0
- package/dist/sync/coordinator/localSyncExecutionPermitStore.js +67 -30
- package/dist/sync/coordinator/localWorkspaceSyncPendingV2PushProgress.d.ts +10 -0
- package/dist/sync/coordinator/localWorkspaceSyncPendingV2PushProgress.js +29 -0
- package/dist/sync/coordinator/localWorkspaceSyncRunner.js +6 -2
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.d.ts +15 -1
- package/dist/sync/coordinator/localWorkspaceSyncRunnerState.js +99 -2
- package/dist/sync/coordinator/workspaceSyncCredentialBroker.d.ts +1 -0
- package/dist/sync/coordinator/workspaceSyncCredentialBroker.js +33 -4
- package/dist/sync/engine/workspaceSyncContentLifecycleAdapter.d.ts +2 -1
- package/dist/sync/engine/workspaceSyncContentVersionStore.d.ts +38 -0
- package/dist/sync/engine/workspaceSyncContentVersionStore.js +50 -1
- package/dist/sync/engine/workspaceSyncEngineBrowserGatewayRemoteServices.js +20 -2
- package/dist/sync/engine/workspaceSyncEngineLifecyclePolicy.js +6 -6
- package/dist/sync/engine/workspaceSyncEngineLocalServices.d.ts +4 -0
- package/dist/sync/engine/workspaceSyncEngineLocalServices.js +11 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.d.ts +14 -0
- package/dist/sync/engine/workspaceSyncEnginePushCompletion.js +84 -0
- package/dist/sync/engine/workspaceSyncEngineRecovery.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.d.ts +11 -0
- package/dist/sync/engine/workspaceSyncEngineRemoteServices.js +2 -1
- package/dist/sync/engine/workspaceSyncEngineRuntime.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncEngineRuntime.js +1 -0
- package/dist/sync/engine/workspaceSyncEngineServerRemoteServices.js +31 -4
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.d.ts +3 -1
- package/dist/sync/engine/workspaceSyncEngineServerRunnerOperations.js +134 -43
- package/dist/sync/engine/workspaceSyncEngineServerSnapshotReader.js +6 -0
- package/dist/sync/engine/workspaceSyncEngineTransfers.d.ts +1 -1
- package/dist/sync/engine/workspaceSyncEngineTransfers.js +11 -4
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.d.ts +1 -0
- package/dist/sync/engine/workspaceSyncV2ChangeDispatcher.js +29 -0
- package/dist/sync/syncApplyHandlers.d.ts +2 -0
- package/dist/sync/syncApplyHandlers.js +10 -1
- package/dist/sync/syncService.d.ts +17 -0
- package/dist/sync/syncService.js +87 -19
- package/dist/sync/taskforceAgentSyncAuthorization.d.ts +16 -0
- package/dist/sync/taskforceAgentSyncAuthorization.js +20 -0
- package/dist/sync/v3/combinedFeedCapability.js +8 -0
- package/dist/sync/v3/durableInitiativeMutationRouter.js +18 -10
- package/dist/sync/v3/durableOperationReplay.d.ts +14 -0
- package/dist/sync/v3/durableOperationReplay.js +18 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.d.ts +2 -0
- package/dist/sync/v3/durableTaskAttachmentLinksMutationRouter.js +14 -1
- package/dist/sync/v3/durableTaskChecklistMutationRouter.d.ts +4 -1
- package/dist/sync/v3/durableTaskChecklistMutationRouter.js +62 -15
- package/dist/sync/v3/durableTaskCommentMutationRouter.js +3 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.d.ts +1 -0
- package/dist/sync/v3/durableTaskHttpBulkMutationRouter.js +30 -8
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.d.ts +5 -3
- package/dist/sync/v3/durableTaskHttpRootMutationRouter.js +37 -2
- package/dist/sync/v3/durableTaxonomyMutationRouter.js +5 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.d.ts +11 -0
- package/dist/sync/v3/durableWorkflowRuntimeMutationRouter.js +39 -10
- package/dist/sync/v3/durableWorkstreamMutationRouter.js +18 -10
- package/dist/sync/v3/durableWorkstreamTaskOrderMutationRouter.js +16 -5
- package/dist/sync/v3/localOutboxDispatchRuntime.js +2 -2
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.d.ts +2 -0
- package/dist/sync/v3/localTaskAttachmentLinksOutboxService.js +47 -7
- package/dist/sync/v3/localTaskChecklistOutboxHandler.js +16 -2
- package/dist/sync/v3/localTaskChecklistOutboxService.d.ts +4 -0
- package/dist/sync/v3/localTaskChecklistOutboxService.js +14 -1
- 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 +10 -0
- package/dist/sync/v3/localTaskStatusOutboxService.js +272 -24
- package/dist/sync/v3/syncDurabilityStore.d.ts +41 -0
- package/dist/sync/v3/syncDurabilityStore.js +199 -13
- package/dist/sync/v3/taskAttachmentLinksMutationService.d.ts +6 -4
- package/dist/sync/v3/taskAttachmentLinksMutationService.js +19 -10
- package/dist/sync/v3/taskChecklistMutationService.d.ts +15 -2
- package/dist/sync/v3/taskChecklistMutationService.js +48 -1
- package/dist/sync/v3/taskCreateMutationService.d.ts +2 -2
- package/dist/sync/v3/taskCreateMutationService.js +7 -4
- 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 +31 -1
- package/dist/sync/v3/taskStatusMutationService.js +123 -3
- package/dist/sync/v3/workflowAssignmentSync.d.ts +6 -0
- package/dist/sync/v3/workflowAssignmentSync.js +30 -0
- package/dist/sync/v3/workspaceSyncJournalReader.js +1 -1
- package/dist/sync/v3/workspaceSyncOperationRetentionService.d.ts +16 -0
- package/dist/sync/v3/workspaceSyncOperationRetentionService.js +83 -0
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.d.ts +1 -1
- package/dist/sync/v3/workspaceSyncV2ProjectionExclusions.js +13 -3
- 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.d.ts +1 -0
- package/dist/sync/v3/workspaceSyncV3CloudOperationHandler.js +18 -3
- package/dist/sync/v3/workspaceSyncV3CombinedFeedOrchestrator.js +8 -3
- package/dist/sync/v3/workspaceSyncV3CombinedLocalApply.js +51 -10
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.d.ts +14 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairBaseline.js +49 -25
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.d.ts +13 -4
- package/dist/sync/v3/workspaceSyncV3CombinedRepairMaterialization.js +124 -57
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.d.ts +20 -0
- package/dist/sync/v3/workspaceSyncV3CombinedRepairSnapshot.js +106 -30
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.d.ts +4 -1
- package/dist/sync/v3/workspaceSyncV3CombinedWireContract.js +34 -0
- package/dist/sync/v3/workspaceSyncV3CoverageRegistry.js +12 -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 +5 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3OperatorDiagnostics.js +55 -9
- package/dist/sync/v3/workspaceSyncV3RepairSnapshotRetentionService.d.ts +17 -0
- package/dist/sync/v3/workspaceSyncV3RepairSnapshotRetentionService.js +64 -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/workspaceSyncV3WorkflowTaskCoverCoverage.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverCoverage.js +33 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverWireContract.d.ts +7 -0
- package/dist/sync/v3/workspaceSyncV3WorkflowTaskCoverWireContract.js +8 -0
- package/dist/sync/workspacePullFeed.js +2 -1
- package/dist/sync/workspaceRepair.d.ts +8 -2
- package/dist/sync/workspaceRepair.js +222 -6
- package/dist/sync/workspaceSyncModel.d.ts +21 -0
- package/dist/sync/workspaceSyncModel.js +35 -7
- package/dist/sync/workspaceSyncState.d.ts +1 -0
- package/dist/sync/workspaceSyncV2SnapshotBuilder.d.ts +6 -0
- package/dist/sync/workspaceSyncV2SnapshotBuilder.js +5 -0
- package/dist/types.d.ts +47 -1
- package/dist/types.js +6 -0
- package/dist/ui/assets/AiIdentityRosterCard-OcSz1PkK.js +1 -0
- package/dist/ui/assets/AiProfilesModule-ByhYW5Xi.js +1 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-BTM6nIg_.js +3 -0
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-TzYu7pkG.css +1 -0
- package/dist/ui/assets/{AssetTraySortControl-Kf1pelSy.js → AssetTraySortControl-DabEG8L4.js} +1 -1
- package/dist/ui/assets/{ContextAttachmentManager-B8boOs6Q.js → ContextAttachmentManager-Coa8yVGM.js} +2 -2
- package/dist/ui/assets/{DocumentWorkspace-DXH4XUsB.js → DocumentWorkspace-BB0qhdix.js} +1 -1
- package/dist/ui/assets/{EntityActivityTimeline-BtSTq0ON.js → EntityActivityTimeline-CZ8x4UJE.js} +1 -1
- package/dist/ui/assets/PlanningModule-pRPjR7v5.js +1 -0
- package/dist/ui/assets/PlansPage-D86pZSSl.js +1 -0
- package/dist/ui/assets/TaskContextUpload-BVIkU9yT.js +1 -0
- package/dist/ui/assets/TaskSettings-Cv1mNhv_.js +12 -0
- package/dist/ui/assets/TaskforceAgentsModule-b-8R25cJ.css +1 -0
- package/dist/ui/assets/TaskforceAgentsModule-gmH-PD2q.js +24 -0
- package/dist/ui/assets/{WorkflowManagerModule-DWFspC-o.js → WorkflowManagerModule-DbfnHJ-f.js} +1 -1
- package/dist/ui/assets/index-BZ-hdZSk.css +1 -0
- package/dist/ui/assets/index-CTsDBaef.js +7 -0
- package/dist/ui/assets/{vendor-icons-BkFLXavV.js → vendor-icons-Bsq-mcEn.js} +1 -1
- package/dist/ui/branding/logos/letterhead_dark.png +0 -0
- package/dist/ui/branding/logos/letterhead_light.png +0 -0
- package/dist/ui/branding/logos/signature_dark.png +0 -0
- package/dist/ui/branding/logos/signature_light.png +0 -0
- package/dist/ui/index.html +3 -3
- package/dist/utils/aiProfileDefaultLogo.js +16 -48
- package/dist/utils/httpSetCookie.d.ts +1 -0
- package/dist/utils/httpSetCookie.js +4 -1
- package/dist/utils/localRuntimeUrl.d.ts +1 -0
- package/dist/utils/localRuntimeUrl.js +14 -0
- package/dist/utils/productLogoRegistry.d.ts +2 -0
- package/dist/utils/productLogoRegistry.js +36 -0
- package/dist/utils/syncStatusPresentation.d.ts +4 -0
- package/dist/utils/syncStatusPresentation.js +17 -0
- 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/taskEvents.d.ts +2 -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/dist/utils/workspaceSyncPresentation.d.ts +1 -1
- package/dist/utils/workspaceSyncPresentation.js +23 -17
- package/package.json +36 -6
- package/dist/ui/assets/AiIdentityRosterCard-MZs7lVED.js +0 -1
- package/dist/ui/assets/AiProfilesModule-C3i0LOxe.js +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-CBRZ8rca.css +0 -1
- package/dist/ui/assets/AnnotatedAttachmentWorkspace-DVZk5Tln.js +0 -3
- package/dist/ui/assets/PlanningModule-BPVyEa-f.js +0 -1
- package/dist/ui/assets/PlansPage-ChqgxALc.js +0 -1
- package/dist/ui/assets/TaskContextUpload-CB3ol0sN.js +0 -1
- package/dist/ui/assets/TaskSettings-g4ECKNOz.js +0 -12
- package/dist/ui/assets/TaskforceAgentsModule-BazdUwxZ.js +0 -21
- package/dist/ui/assets/TaskforceAgentsModule-D6IC0S7Q.css +0 -1
- package/dist/ui/assets/index-BUplSsv_.js +0 -7
- package/dist/ui/assets/index-gz2EXuoK.css +0 -1
|
@@ -534,6 +534,7 @@ export function ensureWorkspaceSchema(db) {
|
|
|
534
534
|
user_id TEXT NOT NULL,
|
|
535
535
|
name TEXT NOT NULL,
|
|
536
536
|
scopes_json TEXT NOT NULL,
|
|
537
|
+
tool_profile TEXT NOT NULL DEFAULT 'default',
|
|
537
538
|
token_prefix TEXT NOT NULL,
|
|
538
539
|
token_hash TEXT NOT NULL,
|
|
539
540
|
status TEXT NOT NULL DEFAULT 'active',
|
|
@@ -654,6 +655,7 @@ export function ensureWorkspaceSchema(db) {
|
|
|
654
655
|
{ name: 'user_id', sql: `ALTER TABLE mcp_access_tokens ADD COLUMN user_id TEXT NOT NULL DEFAULT ''` },
|
|
655
656
|
{ name: 'name', sql: `ALTER TABLE mcp_access_tokens ADD COLUMN name TEXT NOT NULL DEFAULT ''` },
|
|
656
657
|
{ name: 'scopes_json', sql: `ALTER TABLE mcp_access_tokens ADD COLUMN scopes_json TEXT NOT NULL DEFAULT '[]'` },
|
|
658
|
+
{ name: 'tool_profile', sql: `ALTER TABLE mcp_access_tokens ADD COLUMN tool_profile TEXT NOT NULL DEFAULT 'default'` },
|
|
657
659
|
{ name: 'token_prefix', sql: `ALTER TABLE mcp_access_tokens ADD COLUMN token_prefix TEXT NOT NULL DEFAULT ''` },
|
|
658
660
|
{ name: 'token_hash', sql: `ALTER TABLE mcp_access_tokens ADD COLUMN token_hash TEXT NOT NULL DEFAULT ''` },
|
|
659
661
|
{ name: 'status', sql: `ALTER TABLE mcp_access_tokens ADD COLUMN status TEXT NOT NULL DEFAULT 'active'` },
|
|
@@ -1423,6 +1425,7 @@ export function buildWorkspaceSyncDurabilitySchemaSql(provider) {
|
|
|
1423
1425
|
base_lifecycle_revision ${revisionType} NOT NULL DEFAULT 0,
|
|
1424
1426
|
payload_json TEXT NOT NULL,
|
|
1425
1427
|
payload_fingerprint TEXT NOT NULL,
|
|
1428
|
+
canonical_intent_json TEXT,
|
|
1426
1429
|
status TEXT NOT NULL DEFAULT 'pending',
|
|
1427
1430
|
attempt_count INTEGER NOT NULL DEFAULT 0,
|
|
1428
1431
|
initial_not_found_attempt_count INTEGER NOT NULL DEFAULT 0,
|
|
@@ -1687,6 +1690,9 @@ export function buildWorkspaceSyncDurabilitySchemaSql(provider) {
|
|
|
1687
1690
|
CREATE INDEX IF NOT EXISTS idx_workspace_sync_repair_snapshots_expiry
|
|
1688
1691
|
ON workspace_sync_repair_snapshots(tenant_id, workspace_id, expires_at);
|
|
1689
1692
|
|
|
1693
|
+
CREATE INDEX IF NOT EXISTS idx_workspace_sync_repair_snapshots_global_expiry
|
|
1694
|
+
ON workspace_sync_repair_snapshots(tenant_id, expires_at, workspace_id, snapshot_id);
|
|
1695
|
+
|
|
1690
1696
|
CREATE INDEX IF NOT EXISTS idx_workspace_sync_repair_snapshots_created
|
|
1691
1697
|
ON workspace_sync_repair_snapshots(tenant_id, workspace_id, created_at);
|
|
1692
1698
|
|
|
@@ -1729,6 +1735,60 @@ export function buildWorkspaceSyncDurabilitySchemaSql(provider) {
|
|
|
1729
1735
|
}
|
|
1730
1736
|
export function ensureWorkspaceSyncDurabilitySchema(db) {
|
|
1731
1737
|
db.exec(buildWorkspaceSyncDurabilitySchemaSql(db.provider));
|
|
1738
|
+
db.exec(`
|
|
1739
|
+
CREATE TABLE IF NOT EXISTS workspace_sync_content_tombstone_provenance (
|
|
1740
|
+
id TEXT PRIMARY KEY,
|
|
1741
|
+
tenant_id TEXT NOT NULL,
|
|
1742
|
+
workspace_id TEXT NOT NULL,
|
|
1743
|
+
kind TEXT NOT NULL,
|
|
1744
|
+
logical_path TEXT NOT NULL,
|
|
1745
|
+
source TEXT NOT NULL,
|
|
1746
|
+
operation_id TEXT,
|
|
1747
|
+
actor_id TEXT,
|
|
1748
|
+
source_runtime TEXT,
|
|
1749
|
+
source_updated_at TEXT NOT NULL,
|
|
1750
|
+
repair_involved INTEGER NOT NULL DEFAULT 0,
|
|
1751
|
+
recorded_at TEXT NOT NULL
|
|
1752
|
+
);
|
|
1753
|
+
CREATE INDEX IF NOT EXISTS idx_workspace_sync_content_tombstone_provenance_path
|
|
1754
|
+
ON workspace_sync_content_tombstone_provenance(
|
|
1755
|
+
tenant_id, workspace_id, kind, logical_path, recorded_at
|
|
1756
|
+
);
|
|
1757
|
+
CREATE INDEX IF NOT EXISTS idx_workspace_sync_content_tombstone_provenance_recorded
|
|
1758
|
+
ON workspace_sync_content_tombstone_provenance(tenant_id, workspace_id, recorded_at);
|
|
1759
|
+
`);
|
|
1760
|
+
// workspace_sync_content_pull_obligations (T-1607) is normally created by
|
|
1761
|
+
// ensureLocalSyncCoordinatorSchema, but that function only runs for
|
|
1762
|
+
// runtimeMode === 'local' (see core/Taskforce.ts). Cloud/Postgres deployments
|
|
1763
|
+
// otherwise depended solely on the static migrations/postgres/001_init.sql
|
|
1764
|
+
// bootstrap, which only benefits brand-new databases — an existing cloud
|
|
1765
|
+
// deployment provisioned before that table existed would never self-heal.
|
|
1766
|
+
// ensureWorkspaceSyncDurabilitySchema runs unconditionally on every startup
|
|
1767
|
+
// for both runtimes, so creating it here too (idempotently) closes that gap
|
|
1768
|
+
// for already-provisioned cloud deployments as well.
|
|
1769
|
+
db.exec(`
|
|
1770
|
+
CREATE TABLE IF NOT EXISTS workspace_sync_content_pull_obligations (
|
|
1771
|
+
tenant_id TEXT NOT NULL,
|
|
1772
|
+
workspace_id TEXT NOT NULL,
|
|
1773
|
+
kind TEXT NOT NULL,
|
|
1774
|
+
path TEXT NOT NULL,
|
|
1775
|
+
source_watermark TEXT NOT NULL,
|
|
1776
|
+
metadata_fingerprint TEXT NOT NULL,
|
|
1777
|
+
expected_sha256 TEXT NOT NULL,
|
|
1778
|
+
expected_size_bytes INTEGER NOT NULL,
|
|
1779
|
+
manifest_updated_at TEXT NOT NULL,
|
|
1780
|
+
attempts INTEGER NOT NULL DEFAULT 0,
|
|
1781
|
+
last_error TEXT,
|
|
1782
|
+
created_at TEXT NOT NULL,
|
|
1783
|
+
updated_at TEXT NOT NULL,
|
|
1784
|
+
resolved_at TEXT,
|
|
1785
|
+
PRIMARY KEY (tenant_id, workspace_id, kind, path)
|
|
1786
|
+
);
|
|
1787
|
+
CREATE INDEX IF NOT EXISTS idx_workspace_sync_content_pull_obligations_open
|
|
1788
|
+
ON workspace_sync_content_pull_obligations(
|
|
1789
|
+
tenant_id, workspace_id, resolved_at, updated_at, kind, path
|
|
1790
|
+
);
|
|
1791
|
+
`);
|
|
1732
1792
|
if (db.provider === 'sqlite' && hasTable(db, 'tasks')) {
|
|
1733
1793
|
db.exec(`
|
|
1734
1794
|
CREATE TRIGGER IF NOT EXISTS trg_tasks_v3_create_fence
|
|
@@ -1827,6 +1887,9 @@ export function ensureWorkspaceSyncDurabilitySchema(db) {
|
|
|
1827
1887
|
if (!outboxColumns.some((column) => column.name === 'initial_not_found_attempt_count')) {
|
|
1828
1888
|
db.exec(`ALTER TABLE workspace_sync_outbox ADD COLUMN initial_not_found_attempt_count INTEGER NOT NULL DEFAULT 0`);
|
|
1829
1889
|
}
|
|
1890
|
+
if (!outboxColumns.some((column) => column.name === 'canonical_intent_json')) {
|
|
1891
|
+
db.exec(`ALTER TABLE workspace_sync_outbox ADD COLUMN canonical_intent_json TEXT`);
|
|
1892
|
+
}
|
|
1830
1893
|
if (!outboxColumns.some((column) => column.name === 'owns_task_metadata')) {
|
|
1831
1894
|
db.exec(`ALTER TABLE workspace_sync_outbox ADD COLUMN owns_task_metadata INTEGER NOT NULL DEFAULT 0`);
|
|
1832
1895
|
}
|
|
@@ -2072,6 +2135,7 @@ export function ensureLocalSyncCoordinatorSchema(db) {
|
|
|
2072
2135
|
upstream_disposition TEXT NOT NULL,
|
|
2073
2136
|
last_committed_cursor_json TEXT,
|
|
2074
2137
|
required_action TEXT NOT NULL,
|
|
2138
|
+
coalescing_key TEXT,
|
|
2075
2139
|
created_at TEXT NOT NULL,
|
|
2076
2140
|
resolved_at TEXT,
|
|
2077
2141
|
resolved_boundary_json TEXT
|
|
@@ -2129,6 +2193,8 @@ export function ensureLocalSyncCoordinatorSchema(db) {
|
|
|
2129
2193
|
created_at TEXT NOT NULL,
|
|
2130
2194
|
updated_at TEXT NOT NULL,
|
|
2131
2195
|
next_attempt_at TEXT NOT NULL,
|
|
2196
|
+
terminal_at TEXT,
|
|
2197
|
+
terminal_reason TEXT,
|
|
2132
2198
|
resolved_at TEXT,
|
|
2133
2199
|
PRIMARY KEY (tenant_id, workspace_id, task_id)
|
|
2134
2200
|
);
|
|
@@ -2172,6 +2238,12 @@ export function ensureLocalSyncCoordinatorSchema(db) {
|
|
|
2172
2238
|
if (!attachmentApplyColumns.has('revision_fingerprint')) {
|
|
2173
2239
|
db.exec(`ALTER TABLE workspace_sync_v3_attachment_apply_obligations ADD COLUMN revision_fingerprint TEXT`);
|
|
2174
2240
|
}
|
|
2241
|
+
if (!attachmentApplyColumns.has('terminal_at')) {
|
|
2242
|
+
db.exec(`ALTER TABLE workspace_sync_v3_attachment_apply_obligations ADD COLUMN terminal_at TEXT`);
|
|
2243
|
+
}
|
|
2244
|
+
if (!attachmentApplyColumns.has('terminal_reason')) {
|
|
2245
|
+
db.exec(`ALTER TABLE workspace_sync_v3_attachment_apply_obligations ADD COLUMN terminal_reason TEXT`);
|
|
2246
|
+
}
|
|
2175
2247
|
const coordinatorStateColumns = db.provider === 'postgres'
|
|
2176
2248
|
? new Set(db.prepare(`
|
|
2177
2249
|
SELECT column_name AS name
|
|
@@ -2280,6 +2352,17 @@ export function ensureLocalSyncCoordinatorSchema(db) {
|
|
|
2280
2352
|
ADD COLUMN resolved_boundary_json TEXT
|
|
2281
2353
|
`);
|
|
2282
2354
|
}
|
|
2355
|
+
if (!recoveryObligationColumns.has('coalescing_key')) {
|
|
2356
|
+
db.exec(`
|
|
2357
|
+
ALTER TABLE local_sync_recovery_obligations
|
|
2358
|
+
ADD COLUMN coalescing_key TEXT
|
|
2359
|
+
`);
|
|
2360
|
+
}
|
|
2361
|
+
db.exec(`
|
|
2362
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_local_sync_recovery_obligations_open_key
|
|
2363
|
+
ON local_sync_recovery_obligations(coalescing_key)
|
|
2364
|
+
WHERE coalescing_key IS NOT NULL AND resolved_at IS NULL
|
|
2365
|
+
`);
|
|
2283
2366
|
}
|
|
2284
2367
|
export function ensureWorkspaceDocumentsSchema(db) {
|
|
2285
2368
|
db.exec(`
|
|
@@ -2413,6 +2496,350 @@ export function ensureTaskforceAgentsSchema(db) {
|
|
|
2413
2496
|
: `ALTER TABLE agent_conversations ADD COLUMN task_id TEXT`);
|
|
2414
2497
|
}
|
|
2415
2498
|
}
|
|
2499
|
+
export function ensureModelProviderConnectionsSchema(db) {
|
|
2500
|
+
db.exec(`
|
|
2501
|
+
CREATE TABLE IF NOT EXISTS model_provider_connections (
|
|
2502
|
+
id TEXT PRIMARY KEY,
|
|
2503
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2504
|
+
owner_user_id TEXT NOT NULL,
|
|
2505
|
+
provider_key TEXT NOT NULL,
|
|
2506
|
+
authentication_type TEXT NOT NULL,
|
|
2507
|
+
lifecycle_status TEXT NOT NULL DEFAULT 'pending',
|
|
2508
|
+
display_metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
2509
|
+
credential_home_ref TEXT NOT NULL,
|
|
2510
|
+
last_verified_at TEXT,
|
|
2511
|
+
last_refreshed_at TEXT,
|
|
2512
|
+
last_failure_at TEXT,
|
|
2513
|
+
failure_code TEXT,
|
|
2514
|
+
disconnected_at TEXT,
|
|
2515
|
+
revoked_at TEXT,
|
|
2516
|
+
revoked_by_user_id TEXT,
|
|
2517
|
+
created_at TEXT NOT NULL,
|
|
2518
|
+
updated_at TEXT NOT NULL,
|
|
2519
|
+
UNIQUE (tenant_id, credential_home_ref),
|
|
2520
|
+
FOREIGN KEY (owner_user_id) REFERENCES users(id)
|
|
2521
|
+
);
|
|
2522
|
+
|
|
2523
|
+
CREATE INDEX IF NOT EXISTS idx_model_provider_connections_owner
|
|
2524
|
+
ON model_provider_connections(tenant_id, owner_user_id, lifecycle_status, updated_at);
|
|
2525
|
+
|
|
2526
|
+
CREATE TABLE IF NOT EXISTS model_provider_connection_leases (
|
|
2527
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2528
|
+
connection_id TEXT NOT NULL,
|
|
2529
|
+
lease_token TEXT NOT NULL,
|
|
2530
|
+
operation TEXT NOT NULL,
|
|
2531
|
+
acquired_at TEXT NOT NULL,
|
|
2532
|
+
expires_at TEXT NOT NULL,
|
|
2533
|
+
updated_at TEXT NOT NULL,
|
|
2534
|
+
PRIMARY KEY (tenant_id, connection_id),
|
|
2535
|
+
FOREIGN KEY (connection_id) REFERENCES model_provider_connections(id) ON DELETE CASCADE
|
|
2536
|
+
);
|
|
2537
|
+
|
|
2538
|
+
CREATE INDEX IF NOT EXISTS idx_model_provider_connection_leases_expiry
|
|
2539
|
+
ON model_provider_connection_leases(tenant_id, expires_at);
|
|
2540
|
+
|
|
2541
|
+
CREATE TABLE IF NOT EXISTS model_provider_connection_events (
|
|
2542
|
+
id TEXT PRIMARY KEY,
|
|
2543
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2544
|
+
connection_id TEXT NOT NULL,
|
|
2545
|
+
owner_user_id TEXT NOT NULL,
|
|
2546
|
+
actor_user_id TEXT NOT NULL,
|
|
2547
|
+
event_type TEXT NOT NULL,
|
|
2548
|
+
outcome TEXT NOT NULL,
|
|
2549
|
+
reason_code TEXT,
|
|
2550
|
+
created_at TEXT NOT NULL
|
|
2551
|
+
);
|
|
2552
|
+
|
|
2553
|
+
CREATE INDEX IF NOT EXISTS idx_model_provider_connection_events_connection
|
|
2554
|
+
ON model_provider_connection_events(tenant_id, connection_id, created_at);
|
|
2555
|
+
`);
|
|
2556
|
+
}
|
|
2557
|
+
export function ensureTaskforceAgentConnectionBindingsSchema(db) {
|
|
2558
|
+
db.exec(`
|
|
2559
|
+
CREATE TABLE IF NOT EXISTS taskforce_agent_connection_bindings (
|
|
2560
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2561
|
+
workspace_id TEXT NOT NULL DEFAULT 'default',
|
|
2562
|
+
agent_id TEXT NOT NULL,
|
|
2563
|
+
connection_id TEXT NOT NULL,
|
|
2564
|
+
owner_user_id TEXT NOT NULL,
|
|
2565
|
+
provider_key TEXT NOT NULL,
|
|
2566
|
+
model_source TEXT NOT NULL,
|
|
2567
|
+
created_by_user_id TEXT NOT NULL,
|
|
2568
|
+
updated_by_user_id TEXT NOT NULL,
|
|
2569
|
+
created_at TEXT NOT NULL,
|
|
2570
|
+
updated_at TEXT NOT NULL,
|
|
2571
|
+
PRIMARY KEY (tenant_id, workspace_id, agent_id),
|
|
2572
|
+
FOREIGN KEY (agent_id) REFERENCES taskforce_agents(id) ON DELETE CASCADE,
|
|
2573
|
+
FOREIGN KEY (connection_id) REFERENCES model_provider_connections(id) ON DELETE CASCADE
|
|
2574
|
+
);
|
|
2575
|
+
|
|
2576
|
+
CREATE INDEX IF NOT EXISTS idx_taskforce_agent_connection_bindings_owner
|
|
2577
|
+
ON taskforce_agent_connection_bindings(
|
|
2578
|
+
tenant_id, workspace_id, owner_user_id, updated_at
|
|
2579
|
+
);
|
|
2580
|
+
|
|
2581
|
+
CREATE INDEX IF NOT EXISTS idx_taskforce_agent_connection_bindings_connection
|
|
2582
|
+
ON taskforce_agent_connection_bindings(tenant_id, connection_id);
|
|
2583
|
+
`);
|
|
2584
|
+
}
|
|
2585
|
+
export function ensureGitHubReviewEvidenceInstallationBindingsSchema(db) {
|
|
2586
|
+
db.exec(`
|
|
2587
|
+
CREATE TABLE IF NOT EXISTS github_review_evidence_installation_bindings (
|
|
2588
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2589
|
+
workspace_id TEXT NOT NULL,
|
|
2590
|
+
installation_id TEXT NOT NULL,
|
|
2591
|
+
account_id TEXT NOT NULL,
|
|
2592
|
+
account_login TEXT NOT NULL,
|
|
2593
|
+
account_type TEXT NOT NULL,
|
|
2594
|
+
repository_selection TEXT NOT NULL,
|
|
2595
|
+
bound_by_user_id TEXT NOT NULL,
|
|
2596
|
+
created_at TEXT NOT NULL,
|
|
2597
|
+
updated_at TEXT NOT NULL,
|
|
2598
|
+
PRIMARY KEY (tenant_id, workspace_id),
|
|
2599
|
+
UNIQUE (installation_id),
|
|
2600
|
+
FOREIGN KEY (workspace_id) REFERENCES workspaces(id) ON DELETE CASCADE
|
|
2601
|
+
);
|
|
2602
|
+
|
|
2603
|
+
CREATE INDEX IF NOT EXISTS idx_github_review_evidence_installation
|
|
2604
|
+
ON github_review_evidence_installation_bindings(tenant_id, installation_id);
|
|
2605
|
+
`);
|
|
2606
|
+
}
|
|
2607
|
+
export function ensureExecutorPhaseAApprovalReceiptsSchema(db) {
|
|
2608
|
+
const bytesType = db.provider === 'postgres' ? 'BYTEA' : 'BLOB';
|
|
2609
|
+
if (hasTable(db, 'executor_phase_a_approval_receipts')) {
|
|
2610
|
+
if (db.provider === 'postgres') {
|
|
2611
|
+
db.exec(`
|
|
2612
|
+
ALTER TABLE executor_phase_a_approval_receipts
|
|
2613
|
+
ADD COLUMN IF NOT EXISTS receipt_kind TEXT,
|
|
2614
|
+
ADD COLUMN IF NOT EXISTS original_capability_id TEXT,
|
|
2615
|
+
ADD COLUMN IF NOT EXISTS residual_inventory_sha256 TEXT;
|
|
2616
|
+
UPDATE executor_phase_a_approval_receipts
|
|
2617
|
+
SET receipt_kind = 'main'
|
|
2618
|
+
WHERE receipt_kind IS NULL;
|
|
2619
|
+
ALTER TABLE executor_phase_a_approval_receipts
|
|
2620
|
+
ALTER COLUMN receipt_kind SET NOT NULL;
|
|
2621
|
+
DO $$
|
|
2622
|
+
BEGIN
|
|
2623
|
+
IF NOT EXISTS (
|
|
2624
|
+
SELECT 1 FROM pg_constraint
|
|
2625
|
+
WHERE conrelid = 'executor_phase_a_approval_receipts'::regclass
|
|
2626
|
+
AND conname = 'executor_phase_a_approval_receipts_kind_check'
|
|
2627
|
+
) THEN
|
|
2628
|
+
ALTER TABLE executor_phase_a_approval_receipts
|
|
2629
|
+
ADD CONSTRAINT executor_phase_a_approval_receipts_kind_check
|
|
2630
|
+
CHECK (receipt_kind IN ('main', 'cleanup-only'));
|
|
2631
|
+
END IF;
|
|
2632
|
+
END $$;
|
|
2633
|
+
`);
|
|
2634
|
+
const legacyConstraints = db.prepare(`
|
|
2635
|
+
SELECT constraint_name AS name
|
|
2636
|
+
FROM information_schema.table_constraints
|
|
2637
|
+
WHERE table_schema = current_schema()
|
|
2638
|
+
AND table_name = 'executor_phase_a_approval_receipts'
|
|
2639
|
+
AND constraint_type = 'UNIQUE'
|
|
2640
|
+
`).all();
|
|
2641
|
+
for (const constraint of legacyConstraints) {
|
|
2642
|
+
const name = String(constraint.name || '');
|
|
2643
|
+
if (!/^[A-Za-z0-9_]+$/.test(name))
|
|
2644
|
+
continue;
|
|
2645
|
+
const columns = db.prepare(`
|
|
2646
|
+
SELECT column_name AS name
|
|
2647
|
+
FROM information_schema.key_column_usage
|
|
2648
|
+
WHERE table_schema = current_schema()
|
|
2649
|
+
AND table_name = 'executor_phase_a_approval_receipts'
|
|
2650
|
+
AND constraint_name = ?
|
|
2651
|
+
ORDER BY ordinal_position
|
|
2652
|
+
`).all(name);
|
|
2653
|
+
if (columns.map((column) => column.name).join(',') === 'tenant_id,workspace_id,task_id,run_id') {
|
|
2654
|
+
db.exec(`ALTER TABLE executor_phase_a_approval_receipts DROP CONSTRAINT "${name}"`);
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
else {
|
|
2659
|
+
const columns = db.prepare(`PRAGMA table_info(executor_phase_a_approval_receipts)`).all();
|
|
2660
|
+
if (!columns.some((column) => column.name === 'receipt_kind')) {
|
|
2661
|
+
db.transaction(() => db.exec(`
|
|
2662
|
+
ALTER TABLE executor_phase_a_approval_receipts RENAME TO executor_phase_a_approval_receipts_v1;
|
|
2663
|
+
CREATE TABLE executor_phase_a_approval_receipts (
|
|
2664
|
+
receipt_id TEXT PRIMARY KEY,
|
|
2665
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2666
|
+
workspace_id TEXT NOT NULL,
|
|
2667
|
+
task_id TEXT NOT NULL,
|
|
2668
|
+
task_reference TEXT NOT NULL,
|
|
2669
|
+
run_id TEXT NOT NULL,
|
|
2670
|
+
receipt_kind TEXT NOT NULL CHECK (receipt_kind IN ('main', 'cleanup-only')),
|
|
2671
|
+
original_capability_id TEXT,
|
|
2672
|
+
residual_inventory_sha256 TEXT,
|
|
2673
|
+
actor_user_id TEXT NOT NULL,
|
|
2674
|
+
preflight_sha256 TEXT NOT NULL,
|
|
2675
|
+
logical_envelope_sha256 TEXT NOT NULL,
|
|
2676
|
+
canonical_preflight_bytes BLOB NOT NULL,
|
|
2677
|
+
canonical_receipt_bytes BLOB NOT NULL,
|
|
2678
|
+
receipt_sha256 TEXT NOT NULL,
|
|
2679
|
+
key_id TEXT NOT NULL,
|
|
2680
|
+
approved_at TEXT NOT NULL,
|
|
2681
|
+
expires_at TEXT NOT NULL,
|
|
2682
|
+
created_at TEXT NOT NULL,
|
|
2683
|
+
UNIQUE (tenant_id, workspace_id, task_id, run_id, receipt_kind)
|
|
2684
|
+
);
|
|
2685
|
+
INSERT INTO executor_phase_a_approval_receipts (
|
|
2686
|
+
receipt_id, tenant_id, workspace_id, task_id, task_reference, run_id,
|
|
2687
|
+
receipt_kind, original_capability_id, residual_inventory_sha256,
|
|
2688
|
+
actor_user_id, preflight_sha256, logical_envelope_sha256,
|
|
2689
|
+
canonical_preflight_bytes, canonical_receipt_bytes, receipt_sha256,
|
|
2690
|
+
key_id, approved_at, expires_at, created_at
|
|
2691
|
+
)
|
|
2692
|
+
SELECT receipt_id, tenant_id, workspace_id, task_id, task_reference, run_id,
|
|
2693
|
+
'main', NULL, NULL, actor_user_id, preflight_sha256, logical_envelope_sha256,
|
|
2694
|
+
canonical_preflight_bytes, canonical_receipt_bytes, receipt_sha256,
|
|
2695
|
+
key_id, approved_at, expires_at, created_at
|
|
2696
|
+
FROM executor_phase_a_approval_receipts_v1;
|
|
2697
|
+
DROP TABLE executor_phase_a_approval_receipts_v1;
|
|
2698
|
+
`))();
|
|
2699
|
+
}
|
|
2700
|
+
}
|
|
2701
|
+
}
|
|
2702
|
+
db.exec(`
|
|
2703
|
+
CREATE TABLE IF NOT EXISTS executor_phase_a_approval_receipts (
|
|
2704
|
+
receipt_id TEXT PRIMARY KEY,
|
|
2705
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2706
|
+
workspace_id TEXT NOT NULL,
|
|
2707
|
+
task_id TEXT NOT NULL,
|
|
2708
|
+
task_reference TEXT NOT NULL,
|
|
2709
|
+
run_id TEXT NOT NULL,
|
|
2710
|
+
receipt_kind TEXT NOT NULL CHECK (receipt_kind IN ('main', 'cleanup-only')),
|
|
2711
|
+
original_capability_id TEXT,
|
|
2712
|
+
residual_inventory_sha256 TEXT,
|
|
2713
|
+
actor_user_id TEXT NOT NULL,
|
|
2714
|
+
preflight_sha256 TEXT NOT NULL,
|
|
2715
|
+
logical_envelope_sha256 TEXT NOT NULL,
|
|
2716
|
+
canonical_preflight_bytes ${bytesType} NOT NULL,
|
|
2717
|
+
canonical_receipt_bytes ${bytesType} NOT NULL,
|
|
2718
|
+
receipt_sha256 TEXT NOT NULL,
|
|
2719
|
+
key_id TEXT NOT NULL,
|
|
2720
|
+
approved_at TEXT NOT NULL,
|
|
2721
|
+
expires_at TEXT NOT NULL,
|
|
2722
|
+
created_at TEXT NOT NULL,
|
|
2723
|
+
UNIQUE (tenant_id, workspace_id, task_id, run_id, receipt_kind)
|
|
2724
|
+
);
|
|
2725
|
+
|
|
2726
|
+
CREATE INDEX IF NOT EXISTS idx_executor_phase_a_receipts_scope
|
|
2727
|
+
ON executor_phase_a_approval_receipts(tenant_id, workspace_id, task_id, approved_at);
|
|
2728
|
+
|
|
2729
|
+
CREATE UNIQUE INDEX IF NOT EXISTS idx_executor_phase_a_receipts_run_kind
|
|
2730
|
+
ON executor_phase_a_approval_receipts(tenant_id, workspace_id, task_id, run_id, receipt_kind);
|
|
2731
|
+
`);
|
|
2732
|
+
}
|
|
2733
|
+
export function ensureExecutorPhaseARunAuthorizationsSchema(db) {
|
|
2734
|
+
db.exec(`
|
|
2735
|
+
CREATE TABLE IF NOT EXISTS executor_phase_a_run_capabilities (
|
|
2736
|
+
capability_id TEXT PRIMARY KEY,
|
|
2737
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2738
|
+
workspace_id TEXT NOT NULL,
|
|
2739
|
+
task_id TEXT NOT NULL,
|
|
2740
|
+
run_id TEXT NOT NULL,
|
|
2741
|
+
receipt_id TEXT NOT NULL,
|
|
2742
|
+
receipt_sha256 TEXT NOT NULL,
|
|
2743
|
+
capability_kind TEXT NOT NULL CHECK (capability_kind IN ('main', 'cleanup-only')),
|
|
2744
|
+
original_capability_id TEXT,
|
|
2745
|
+
residual_inventory_sha256 TEXT,
|
|
2746
|
+
actor_user_id TEXT NOT NULL,
|
|
2747
|
+
account_id TEXT NOT NULL,
|
|
2748
|
+
region TEXT NOT NULL,
|
|
2749
|
+
availability_zone TEXT NOT NULL,
|
|
2750
|
+
read_principal_arn TEXT NOT NULL,
|
|
2751
|
+
broker_key_fingerprint TEXT NOT NULL,
|
|
2752
|
+
capability_sha256 TEXT NOT NULL,
|
|
2753
|
+
preflight_sha256 TEXT NOT NULL,
|
|
2754
|
+
logical_envelope_sha256 TEXT NOT NULL,
|
|
2755
|
+
source_commit TEXT NOT NULL,
|
|
2756
|
+
role_map_sha256 TEXT NOT NULL,
|
|
2757
|
+
oidc_audience_sha256 TEXT NOT NULL,
|
|
2758
|
+
issued_at TEXT NOT NULL,
|
|
2759
|
+
expires_at TEXT NOT NULL,
|
|
2760
|
+
mutation_deadline TEXT NOT NULL,
|
|
2761
|
+
cleanup_deadline TEXT NOT NULL,
|
|
2762
|
+
status TEXT NOT NULL CHECK (status IN (
|
|
2763
|
+
'active', 'awaiting-cleanup-approval', 'completed', 'cleanup-failed', 'expired'
|
|
2764
|
+
)),
|
|
2765
|
+
hard_stopped_at TEXT,
|
|
2766
|
+
created_at TEXT NOT NULL,
|
|
2767
|
+
updated_at TEXT NOT NULL,
|
|
2768
|
+
UNIQUE (tenant_id, workspace_id, task_id, run_id, receipt_id, broker_key_fingerprint),
|
|
2769
|
+
UNIQUE (tenant_id, receipt_id),
|
|
2770
|
+
UNIQUE (tenant_id, original_capability_id)
|
|
2771
|
+
);
|
|
2772
|
+
|
|
2773
|
+
CREATE INDEX IF NOT EXISTS idx_executor_phase_a_run_capabilities_scope
|
|
2774
|
+
ON executor_phase_a_run_capabilities(tenant_id, workspace_id, task_id, run_id, status);
|
|
2775
|
+
|
|
2776
|
+
CREATE TABLE IF NOT EXISTS executor_phase_a_sender_nonces (
|
|
2777
|
+
nonce_id TEXT PRIMARY KEY,
|
|
2778
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2779
|
+
capability_id TEXT NOT NULL,
|
|
2780
|
+
request_sha256 TEXT NOT NULL,
|
|
2781
|
+
phase TEXT NOT NULL CHECK (phase IN ('bootstrap', 'ami-build', 'provenance', 'runtime', 'cleanup')),
|
|
2782
|
+
issued_at TEXT NOT NULL,
|
|
2783
|
+
expires_at TEXT NOT NULL,
|
|
2784
|
+
consumed_at TEXT,
|
|
2785
|
+
status TEXT NOT NULL CHECK (status IN ('issued', 'consumed', 'revoked', 'expired')),
|
|
2786
|
+
created_at TEXT NOT NULL,
|
|
2787
|
+
updated_at TEXT NOT NULL,
|
|
2788
|
+
UNIQUE (tenant_id, capability_id, nonce_id),
|
|
2789
|
+
FOREIGN KEY (capability_id) REFERENCES executor_phase_a_run_capabilities(capability_id) ON DELETE RESTRICT
|
|
2790
|
+
);
|
|
2791
|
+
|
|
2792
|
+
CREATE TABLE IF NOT EXISTS executor_phase_a_workload_grants (
|
|
2793
|
+
grant_id TEXT PRIMARY KEY,
|
|
2794
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2795
|
+
capability_id TEXT NOT NULL,
|
|
2796
|
+
workspace_id TEXT NOT NULL,
|
|
2797
|
+
task_id TEXT NOT NULL,
|
|
2798
|
+
run_id TEXT NOT NULL,
|
|
2799
|
+
receipt_id TEXT NOT NULL,
|
|
2800
|
+
phase TEXT NOT NULL CHECK (phase IN ('bootstrap', 'ami-build', 'provenance', 'runtime', 'cleanup')),
|
|
2801
|
+
role_arn TEXT NOT NULL,
|
|
2802
|
+
grant_sha256 TEXT NOT NULL,
|
|
2803
|
+
token_id TEXT NOT NULL,
|
|
2804
|
+
nonce_id TEXT NOT NULL,
|
|
2805
|
+
sender_proof_sha256 TEXT NOT NULL,
|
|
2806
|
+
broker_key_fingerprint TEXT NOT NULL,
|
|
2807
|
+
source_identity TEXT NOT NULL,
|
|
2808
|
+
session_tags_sha256 TEXT NOT NULL,
|
|
2809
|
+
policy_sha256 TEXT NOT NULL,
|
|
2810
|
+
issued_at TEXT NOT NULL,
|
|
2811
|
+
expires_at TEXT NOT NULL,
|
|
2812
|
+
used_at TEXT,
|
|
2813
|
+
status TEXT NOT NULL CHECK (status IN ('issued', 'used', 'revoked', 'rejected', 'expired')),
|
|
2814
|
+
created_at TEXT NOT NULL,
|
|
2815
|
+
updated_at TEXT NOT NULL,
|
|
2816
|
+
UNIQUE (tenant_id, token_id),
|
|
2817
|
+
UNIQUE (tenant_id, capability_id, nonce_id),
|
|
2818
|
+
UNIQUE (tenant_id, capability_id, sender_proof_sha256),
|
|
2819
|
+
FOREIGN KEY (capability_id) REFERENCES executor_phase_a_run_capabilities(capability_id) ON DELETE RESTRICT
|
|
2820
|
+
);
|
|
2821
|
+
|
|
2822
|
+
CREATE INDEX IF NOT EXISTS idx_executor_phase_a_workload_grants_scope
|
|
2823
|
+
ON executor_phase_a_workload_grants(tenant_id, capability_id, phase, status, issued_at);
|
|
2824
|
+
|
|
2825
|
+
CREATE TABLE IF NOT EXISTS executor_phase_a_issuer_redemptions (
|
|
2826
|
+
request_id TEXT PRIMARY KEY,
|
|
2827
|
+
tenant_id TEXT NOT NULL DEFAULT 'default',
|
|
2828
|
+
grant_id TEXT NOT NULL,
|
|
2829
|
+
grant_sha256 TEXT NOT NULL,
|
|
2830
|
+
sender_proof_sha256 TEXT NOT NULL,
|
|
2831
|
+
request_sha256 TEXT NOT NULL,
|
|
2832
|
+
canonical_response_bytes ${db.provider === 'postgres' ? 'BYTEA' : 'BLOB'} NOT NULL,
|
|
2833
|
+
response_sha256 TEXT NOT NULL,
|
|
2834
|
+
redeemed_at TEXT NOT NULL,
|
|
2835
|
+
UNIQUE (tenant_id, grant_id),
|
|
2836
|
+
FOREIGN KEY (grant_id) REFERENCES executor_phase_a_workload_grants(grant_id) ON DELETE RESTRICT
|
|
2837
|
+
);
|
|
2838
|
+
|
|
2839
|
+
CREATE INDEX IF NOT EXISTS idx_executor_phase_a_issuer_redemptions_grant
|
|
2840
|
+
ON executor_phase_a_issuer_redemptions(tenant_id, grant_id, redeemed_at);
|
|
2841
|
+
`);
|
|
2842
|
+
}
|
|
2416
2843
|
export function ensureAgentRolesSchema(db) {
|
|
2417
2844
|
db.exec(`
|
|
2418
2845
|
CREATE TABLE IF NOT EXISTS agent_roles (
|
|
@@ -1,36 +1,60 @@
|
|
|
1
1
|
export declare const APP_GATE_DEFINITIONS: {
|
|
2
2
|
readonly 'annotated_attachments.workspace_access': {
|
|
3
|
-
readonly
|
|
3
|
+
readonly enabledByEnvironment: {
|
|
4
|
+
readonly performance: true;
|
|
5
|
+
readonly staging: true;
|
|
6
|
+
readonly production: true;
|
|
7
|
+
};
|
|
4
8
|
readonly description: "Annotated Attachment workspace readiness gate.";
|
|
5
9
|
readonly owner: "taskforce";
|
|
6
10
|
readonly removalMilestone: "Annotated Attachment GA";
|
|
7
11
|
};
|
|
8
12
|
readonly 'documents.workspace_access': {
|
|
9
|
-
readonly
|
|
13
|
+
readonly enabledByEnvironment: {
|
|
14
|
+
readonly performance: true;
|
|
15
|
+
readonly staging: true;
|
|
16
|
+
readonly production: true;
|
|
17
|
+
};
|
|
10
18
|
readonly description: "Document Manager/editor workspace readiness gate.";
|
|
11
19
|
readonly owner: "taskforce";
|
|
12
20
|
readonly removalMilestone: "Document Manager GA";
|
|
13
21
|
};
|
|
14
22
|
readonly 'workflow_manager.workspace_access': {
|
|
15
|
-
readonly
|
|
23
|
+
readonly enabledByEnvironment: {
|
|
24
|
+
readonly performance: true;
|
|
25
|
+
readonly staging: true;
|
|
26
|
+
readonly production: false;
|
|
27
|
+
};
|
|
16
28
|
readonly description: "Workflow Manager workspace readiness gate.";
|
|
17
29
|
readonly owner: "taskforce";
|
|
18
30
|
readonly removalMilestone: "Workflow Manager GA";
|
|
19
31
|
};
|
|
20
32
|
readonly 'taskforce_agents.workspace_access': {
|
|
21
|
-
readonly
|
|
33
|
+
readonly enabledByEnvironment: {
|
|
34
|
+
readonly performance: true;
|
|
35
|
+
readonly staging: true;
|
|
36
|
+
readonly production: false;
|
|
37
|
+
};
|
|
22
38
|
readonly description: "Taskforce Agents workspace readiness gate.";
|
|
23
39
|
readonly owner: "taskforce";
|
|
24
40
|
readonly removalMilestone: "Taskforce Agents workspace GA";
|
|
25
41
|
};
|
|
26
42
|
readonly 'ai_profiles.workspace_access': {
|
|
27
|
-
readonly
|
|
43
|
+
readonly enabledByEnvironment: {
|
|
44
|
+
readonly performance: true;
|
|
45
|
+
readonly staging: true;
|
|
46
|
+
readonly production: true;
|
|
47
|
+
};
|
|
28
48
|
readonly description: "AI Profiles workspace readiness gate.";
|
|
29
49
|
readonly owner: "taskforce";
|
|
30
50
|
readonly removalMilestone: "AI Profiles workspace GA";
|
|
31
51
|
};
|
|
32
52
|
readonly 'planning.workspace_access': {
|
|
33
|
-
readonly
|
|
53
|
+
readonly enabledByEnvironment: {
|
|
54
|
+
readonly performance: false;
|
|
55
|
+
readonly staging: false;
|
|
56
|
+
readonly production: false;
|
|
57
|
+
};
|
|
34
58
|
readonly description: "Planning workspace readiness gate.";
|
|
35
59
|
readonly owner: "taskforce";
|
|
36
60
|
readonly removalMilestone: "Planning workspace GA";
|
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
export const APP_GATE_DEFINITIONS = {
|
|
2
2
|
'annotated_attachments.workspace_access': {
|
|
3
|
-
|
|
3
|
+
enabledByEnvironment: { performance: true, staging: true, production: true },
|
|
4
4
|
description: 'Annotated Attachment workspace readiness gate.',
|
|
5
5
|
owner: 'taskforce',
|
|
6
6
|
removalMilestone: 'Annotated Attachment GA'
|
|
7
7
|
},
|
|
8
8
|
'documents.workspace_access': {
|
|
9
|
-
|
|
9
|
+
enabledByEnvironment: { performance: true, staging: true, production: true },
|
|
10
10
|
description: 'Document Manager/editor workspace readiness gate.',
|
|
11
11
|
owner: 'taskforce',
|
|
12
12
|
removalMilestone: 'Document Manager GA'
|
|
13
13
|
},
|
|
14
14
|
'workflow_manager.workspace_access': {
|
|
15
|
-
|
|
15
|
+
enabledByEnvironment: { performance: true, staging: true, production: false },
|
|
16
16
|
description: 'Workflow Manager workspace readiness gate.',
|
|
17
17
|
owner: 'taskforce',
|
|
18
18
|
removalMilestone: 'Workflow Manager GA'
|
|
19
19
|
},
|
|
20
20
|
'taskforce_agents.workspace_access': {
|
|
21
|
-
|
|
21
|
+
enabledByEnvironment: { performance: true, staging: true, production: false },
|
|
22
22
|
description: 'Taskforce Agents workspace readiness gate.',
|
|
23
23
|
owner: 'taskforce',
|
|
24
24
|
removalMilestone: 'Taskforce Agents workspace GA'
|
|
25
25
|
},
|
|
26
26
|
'ai_profiles.workspace_access': {
|
|
27
|
-
|
|
27
|
+
enabledByEnvironment: { performance: true, staging: true, production: true },
|
|
28
28
|
description: 'AI Profiles workspace readiness gate.',
|
|
29
29
|
owner: 'taskforce',
|
|
30
30
|
removalMilestone: 'AI Profiles workspace GA'
|
|
31
31
|
},
|
|
32
32
|
'planning.workspace_access': {
|
|
33
|
-
|
|
33
|
+
enabledByEnvironment: { performance: false, staging: false, production: false },
|
|
34
34
|
description: 'Planning workspace readiness gate.',
|
|
35
35
|
owner: 'taskforce',
|
|
36
36
|
removalMilestone: 'Planning workspace GA'
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
|
|
1
|
+
import { type TaskforceCloudEnvironment } from '../config/cloudEnvironment.js';
|
|
2
|
+
import { APP_GATE_DEFINITIONS as APP_GATE_CONFIG } from './appGateDefinitions.js';
|
|
2
3
|
export declare const ANNOTATED_ATTACHMENTS_WORKSPACE_FEATURE_KEY: "annotated_attachments.workspace_access";
|
|
3
4
|
export declare const DOCUMENT_WORKSPACE_FEATURE_KEY: "documents.workspace_access";
|
|
4
5
|
export declare const WORKFLOW_MANAGER_WORKSPACE_FEATURE_KEY: "workflow_manager.workspace_access";
|
|
5
6
|
export declare const TASKFORCE_AGENTS_WORKSPACE_FEATURE_KEY: "taskforce_agents.workspace_access";
|
|
6
7
|
export declare const AI_PROFILES_WORKSPACE_FEATURE_KEY: "ai_profiles.workspace_access";
|
|
7
8
|
export declare const PLANNING_WORKSPACE_FEATURE_KEY: "planning.workspace_access";
|
|
8
|
-
export type AppGateKey =
|
|
9
|
+
export type AppGateKey = keyof typeof APP_GATE_CONFIG;
|
|
9
10
|
export interface AppGateDefinition {
|
|
10
|
-
key: AppGateKey;
|
|
11
|
-
|
|
12
|
-
description: string;
|
|
13
|
-
owner: string;
|
|
14
|
-
removalMilestone: string;
|
|
11
|
+
readonly key: AppGateKey;
|
|
12
|
+
readonly enabledByEnvironment: Readonly<Record<TaskforceCloudEnvironment, boolean>>;
|
|
13
|
+
readonly description: string;
|
|
14
|
+
readonly owner: string;
|
|
15
|
+
readonly removalMilestone: string;
|
|
15
16
|
}
|
|
16
17
|
export interface ResolvedFeatureAccess {
|
|
17
18
|
featureKey: string;
|
|
@@ -20,11 +21,10 @@ export interface ResolvedFeatureAccess {
|
|
|
20
21
|
code: string;
|
|
21
22
|
}
|
|
22
23
|
export type ResolvedFeatureAccessMap = Record<string, ResolvedFeatureAccess>;
|
|
23
|
-
export declare const APP_GATE_DEFINITIONS: Record<AppGateKey, AppGateDefinition
|
|
24
|
+
export declare const APP_GATE_DEFINITIONS: Readonly<Record<AppGateKey, AppGateDefinition>>;
|
|
24
25
|
export declare function listAppGateDefinitions(): AppGateDefinition[];
|
|
25
26
|
export declare function getAppGateDefinition(featureKey: string): AppGateDefinition | null;
|
|
26
|
-
export declare function resolveAppGateAccess(featureKey: string): ResolvedFeatureAccess;
|
|
27
|
-
export declare function
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}): ResolvedFeatureAccess;
|
|
27
|
+
export declare function resolveAppGateAccess(featureKey: string, environment: TaskforceCloudEnvironment): ResolvedFeatureAccess;
|
|
28
|
+
export declare function resolveAppGateAccessMap(environment: TaskforceCloudEnvironment): ResolvedFeatureAccessMap;
|
|
29
|
+
export declare function resolveClientAppGateAccessMap(accessMap: ResolvedFeatureAccessMap | null | undefined, cloudEnvironment: unknown): ResolvedFeatureAccessMap;
|
|
30
|
+
export declare function isResolvedFeatureAccessMap(value: unknown): value is ResolvedFeatureAccessMap;
|