@taskforcehq/taskforce 0.3.168
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/README.md +241 -0
- package/dist/Taskforce.d.ts +3 -0
- package/dist/Taskforce.js +3 -0
- package/dist/Taskforce.module.css +7587 -0
- package/dist/TaskforceCore.CategoryFallback.test.d.ts +1 -0
- package/dist/TaskforceCore.CategoryFallback.test.js +98 -0
- package/dist/TaskforceCore.d.ts +12 -0
- package/dist/TaskforceCore.js +729 -0
- package/dist/TaskforceCore.test.d.ts +1 -0
- package/dist/TaskforceCore.test.js +2132 -0
- package/dist/TaskforceScreenshot.d.ts +11 -0
- package/dist/TaskforceScreenshot.js +113 -0
- package/dist/TaskforceWidget.d.ts +6 -0
- package/dist/TaskforceWidget.js +101 -0
- package/dist/TaskforceWidget.test.d.ts +1 -0
- package/dist/TaskforceWidget.test.js +92 -0
- package/dist/UnsavedChangesRelaxed.test.d.ts +1 -0
- package/dist/UnsavedChangesRelaxed.test.js +16 -0
- package/dist/__tests__/localizationCatalogs.test.d.ts +1 -0
- package/dist/__tests__/localizationCatalogs.test.js +37 -0
- package/dist/__tests__/planParser.test.d.ts +1 -0
- package/dist/__tests__/planParser.test.js +183 -0
- package/dist/__tests__/releaseVersion.test.d.ts +1 -0
- package/dist/__tests__/releaseVersion.test.js +32 -0
- package/dist/__tests__/structuredCommentValidation.test.d.ts +1 -0
- package/dist/__tests__/structuredCommentValidation.test.js +31 -0
- package/dist/__tests__/structuredDocValidation.test.d.ts +1 -0
- package/dist/__tests__/structuredDocValidation.test.js +30 -0
- package/dist/__tests__/templateEngine.test.d.ts +1 -0
- package/dist/__tests__/templateEngine.test.js +150 -0
- package/dist/__tests__/templates.test.d.ts +1 -0
- package/dist/__tests__/templates.test.js +45 -0
- package/dist/__tests__/workflowDocumentFixtures.test.d.ts +1 -0
- package/dist/__tests__/workflowDocumentFixtures.test.js +78 -0
- package/dist/__tests__/workflowExportMatrix.test.d.ts +1 -0
- package/dist/__tests__/workflowExportMatrix.test.js +113 -0
- package/dist/__tests__/workflowExportSnapshots.test.d.ts +1 -0
- package/dist/__tests__/workflowExportSnapshots.test.js +28 -0
- package/dist/__tests__/workflowGeneration.test.d.ts +1 -0
- package/dist/__tests__/workflowGeneration.test.js +12 -0
- package/dist/__tests__/workflowSimulation.test.d.ts +1 -0
- package/dist/__tests__/workflowSimulation.test.js +113 -0
- package/dist/__tests__/workflowV2Policy.test.d.ts +1 -0
- package/dist/__tests__/workflowV2Policy.test.js +80 -0
- package/dist/api.d.ts +30 -0
- package/dist/api.js +85 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +217 -0
- package/dist/compat/priorityCompat.d.ts +2 -0
- package/dist/compat/priorityCompat.js +24 -0
- package/dist/components/features/DocumentGenerateModal.d.ts +9 -0
- package/dist/components/features/DocumentGenerateModal.js +114 -0
- package/dist/components/features/DocumentIndex.d.ts +19 -0
- package/dist/components/features/DocumentIndex.js +51 -0
- package/dist/components/features/DocumentViewer.d.ts +9 -0
- package/dist/components/features/DocumentViewer.js +253 -0
- package/dist/components/features/DocumentWorkspace.d.ts +21 -0
- package/dist/components/features/DocumentWorkspace.js +88 -0
- package/dist/components/features/TaskSettings.d.ts +209 -0
- package/dist/components/features/TaskSettings.js +500 -0
- package/dist/components/features/TaskSettings.test.d.ts +1 -0
- package/dist/components/features/TaskSettings.test.js +308 -0
- package/dist/components/features/settings/CategoryManager.d.ts +19 -0
- package/dist/components/features/settings/CategoryManager.js +113 -0
- package/dist/components/features/settings/TaxonomyEditor.d.ts +8 -0
- package/dist/components/features/settings/TaxonomyEditor.js +98 -0
- package/dist/components/features/settings/TaxonomyManager 2.d.ts +52 -0
- package/dist/components/features/settings/TaxonomyManager 2.js +75 -0
- package/dist/components/features/settings/TaxonomyManager.d.ts +54 -0
- package/dist/components/features/settings/TaxonomyManager.js +77 -0
- package/dist/components/features/settings/TypeManager.d.ts +10 -0
- package/dist/components/features/settings/TypeManager.js +50 -0
- package/dist/components/features/settings/WorkflowEditorPrototype.d.ts +15 -0
- package/dist/components/features/settings/WorkflowEditorPrototype.js +245 -0
- package/dist/components/task/TaskActionHeader.d.ts +20 -0
- package/dist/components/task/TaskActionHeader.js +13 -0
- package/dist/components/task/TaskCard.d.ts +47 -0
- package/dist/components/task/TaskCard.js +326 -0
- package/dist/components/task/TaskCard.test.d.ts +1 -0
- package/dist/components/task/TaskCard.test.js +95 -0
- package/dist/components/task/TaskContextUpload.d.ts +12 -0
- package/dist/components/task/TaskContextUpload.js +393 -0
- package/dist/components/task/TaskContextUpload.test.d.ts +1 -0
- package/dist/components/task/TaskContextUpload.test.js +189 -0
- package/dist/components/task/TaskForm.d.ts +105 -0
- package/dist/components/task/TaskForm.js +241 -0
- package/dist/components/task/TaskForm.test.d.ts +1 -0
- package/dist/components/task/TaskForm.test.js +288 -0
- package/dist/components/task/TaskKanban 2.d.ts +76 -0
- package/dist/components/task/TaskKanban 2.js +1004 -0
- package/dist/components/task/TaskKanban.d.ts +76 -0
- package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +1 -0
- package/dist/components/task/TaskKanban.empty-column-drop.test.js +66 -0
- package/dist/components/task/TaskKanban.js +1026 -0
- package/dist/components/task/TaskKanban.test.d.ts +1 -0
- package/dist/components/task/TaskKanban.test.js +46 -0
- package/dist/components/task/TaskList.d.ts +74 -0
- package/dist/components/task/TaskList.js +38 -0
- package/dist/components/task/TaskList.test.d.ts +1 -0
- package/dist/components/task/TaskList.test.js +270 -0
- package/dist/components/task/TaskScreenshotSection.d.ts +15 -0
- package/dist/components/task/TaskScreenshotSection.js +22 -0
- package/dist/components/ui/LevelSelector.d.ts +13 -0
- package/dist/components/ui/LevelSelector.js +25 -0
- package/dist/components/ui/LevelSelector.test.d.ts +1 -0
- package/dist/components/ui/LevelSelector.test.js +55 -0
- package/dist/components/ui/Markdown.d.ts +6 -0
- package/dist/components/ui/Markdown.js +94 -0
- package/dist/components/ui/Markdown.test.d.ts +1 -0
- package/dist/components/ui/Markdown.test.js +38 -0
- package/dist/components/ui/Modal.d.ts +16 -0
- package/dist/components/ui/Modal.js +49 -0
- package/dist/components/ui/MultiSelectFilter.d.ts +10 -0
- package/dist/components/ui/MultiSelectFilter.js +71 -0
- package/dist/components/ui/MultiSelectFilter.test.d.ts +1 -0
- package/dist/components/ui/MultiSelectFilter.test.js +74 -0
- package/dist/components/ui/TaxonomyDropdown.d.ts +17 -0
- package/dist/components/ui/TaxonomyDropdown.js +145 -0
- package/dist/components/ui/TaxonomyDropdown.test.d.ts +1 -0
- package/dist/components/ui/TaxonomyDropdown.test.js +130 -0
- package/dist/components/views/StandaloneLayout 2.d.ts +8 -0
- package/dist/components/views/StandaloneLayout 2.js +1660 -0
- package/dist/components/views/StandaloneLayout.d.ts +8 -0
- package/dist/components/views/StandaloneLayout.js +2117 -0
- package/dist/components/views/WidgetView.d.ts +8 -0
- package/dist/components/views/WidgetView.js +221 -0
- package/dist/config/envSchema.d.ts +28 -0
- package/dist/config/envSchema.js +374 -0
- package/dist/config/envSchema.test.d.ts +1 -0
- package/dist/config/envSchema.test.js +97 -0
- package/dist/config/surfaceBase.d.ts +2 -0
- package/dist/config/surfaceBase.js +8 -0
- package/dist/core/BulkUpdateFieldsPreview.test.d.ts +1 -0
- package/dist/core/BulkUpdateFieldsPreview.test.js +62 -0
- package/dist/core/CompletedAt.test.d.ts +1 -0
- package/dist/core/CompletedAt.test.js +44 -0
- package/dist/core/CreatedBy.test.d.ts +1 -0
- package/dist/core/CreatedBy.test.js +60 -0
- package/dist/core/EntitlementsPolicy.test.d.ts +1 -0
- package/dist/core/EntitlementsPolicy.test.js +145 -0
- package/dist/core/InitiativeTemplates.test.d.ts +1 -0
- package/dist/core/InitiativeTemplates.test.js +50 -0
- package/dist/core/ParentLifecycle.test.d.ts +1 -0
- package/dist/core/ParentLifecycle.test.js +98 -0
- package/dist/core/ScheduleFields.test.d.ts +1 -0
- package/dist/core/ScheduleFields.test.js +197 -0
- package/dist/core/SetupState.test.d.ts +1 -0
- package/dist/core/SetupState.test.js +113 -0
- package/dist/core/SystemAdmin.test.d.ts +1 -0
- package/dist/core/SystemAdmin.test.js +295 -0
- package/dist/core/TaskTaxonomyValidation.test.d.ts +1 -0
- package/dist/core/TaskTaxonomyValidation.test.js +64 -0
- package/dist/core/Taskforce.d.ts +1063 -0
- package/dist/core/Taskforce.ids.test.d.ts +1 -0
- package/dist/core/Taskforce.ids.test.js +168 -0
- package/dist/core/Taskforce.js +5981 -0
- package/dist/core/Taskforce.realtimeMutation.test.d.ts +1 -0
- package/dist/core/Taskforce.realtimeMutation.test.js +76 -0
- package/dist/core/WorkspaceDelete.test.d.ts +1 -0
- package/dist/core/WorkspaceDelete.test.js +140 -0
- package/dist/core/WorkspacePermissions.test.d.ts +1 -0
- package/dist/core/WorkspacePermissions.test.js +151 -0
- package/dist/core/WorkspacePlanMode.test.d.ts +1 -0
- package/dist/core/WorkspacePlanMode.test.js +104 -0
- package/dist/hooks/authGuardPolicy.d.ts +26 -0
- package/dist/hooks/authGuardPolicy.js +32 -0
- package/dist/hooks/authGuardPolicy.test.d.ts +1 -0
- package/dist/hooks/authGuardPolicy.test.js +76 -0
- package/dist/hooks/useDraggable.d.ts +12 -0
- package/dist/hooks/useDraggable.js +65 -0
- package/dist/hooks/useRealtimeSync.d.ts +24 -0
- package/dist/hooks/useRealtimeSync.js +275 -0
- package/dist/hooks/useRealtimeSync.test.d.ts +1 -0
- package/dist/hooks/useRealtimeSync.test.js +284 -0
- package/dist/hooks/useSyncOrchestrator.d.ts +164 -0
- package/dist/hooks/useSyncOrchestrator.js +1427 -0
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +1 -0
- package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +367 -0
- package/dist/hooks/useTaskforce.d.ts +727 -0
- package/dist/hooks/useTaskforce.js +4396 -0
- package/dist/hooks/useTaskforce.priority-filters.test.d.ts +1 -0
- package/dist/hooks/useTaskforce.priority-filters.test.js +33 -0
- package/dist/hooks/useWorkspaceSyncController.d.ts +80 -0
- package/dist/hooks/useWorkspaceSyncController.js +598 -0
- package/dist/hooks/useWorkspaceSyncController.test.d.ts +1 -0
- package/dist/hooks/useWorkspaceSyncController.test.js +236 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +11 -0
- package/dist/localization/index.d.ts +8 -0
- package/dist/localization/index.js +81 -0
- package/dist/localization/locales/en-US.d.ts +151 -0
- package/dist/localization/locales/en-US.js +150 -0
- package/dist/localization/locales/es-419.d.ts +2 -0
- package/dist/localization/locales/es-419.js +150 -0
- package/dist/localization/locales/pt-BR.d.ts +2 -0
- package/dist/localization/locales/pt-BR.js +150 -0
- package/dist/main.d.ts +1 -0
- package/dist/main.js +33 -0
- package/dist/mcp/optionResolution.d.ts +14 -0
- package/dist/mcp/optionResolution.js +126 -0
- package/dist/mcp/optionResolution.test.d.ts +1 -0
- package/dist/mcp/optionResolution.test.js +39 -0
- package/dist/mcp/server.d.ts +1 -0
- package/dist/mcp/server.js +1793 -0
- package/dist/mcp/structuredCommentValidation.d.ts +6 -0
- package/dist/mcp/structuredCommentValidation.js +56 -0
- package/dist/mcp/structuredDocValidation.d.ts +6 -0
- package/dist/mcp/structuredDocValidation.js +75 -0
- package/dist/migrations/billingSchemaParity.test.d.ts +1 -0
- package/dist/migrations/billingSchemaParity.test.js +46 -0
- package/dist/migrations/clientMigrations.d.ts +9 -0
- package/dist/migrations/clientMigrations.js +74 -0
- package/dist/migrations/flags.d.ts +6 -0
- package/dist/migrations/flags.js +8 -0
- package/dist/migrations/taskMigrations.d.ts +71 -0
- package/dist/migrations/taskMigrations.js +236 -0
- package/dist/migrations/taskMigrations.test.d.ts +1 -0
- package/dist/migrations/taskMigrations.test.js +34 -0
- package/dist/migrations/taskSchemaMigrations.d.ts +11 -0
- package/dist/migrations/taskSchemaMigrations.js +453 -0
- package/dist/plugins/index.d.ts +10 -0
- package/dist/plugins/index.js +10 -0
- package/dist/plugins/vite.d.ts +19 -0
- package/dist/plugins/vite.js +271 -0
- package/dist/public/android-chrome-192x192.png +0 -0
- package/dist/public/android-chrome-512x512.png +0 -0
- package/dist/public/apple-touch-icon.png +0 -0
- package/dist/public/favicon-16x16.png +0 -0
- package/dist/public/favicon-32x32.png +0 -0
- package/dist/public/favicon.ico +0 -0
- package/dist/public/favicon.png +0 -0
- package/dist/public/site.webmanifest +1 -0
- package/dist/public/taskforce.png +0 -0
- package/dist/resources/templates/WORKFLOW_V2_POLICY.md +55 -0
- package/dist/resources/templates/environments/aider.yaml +14 -0
- package/dist/resources/templates/environments/antigravity.yaml +10 -0
- package/dist/resources/templates/environments/claude.yaml +10 -0
- package/dist/resources/templates/environments/cline.yaml +10 -0
- package/dist/resources/templates/environments/codex.yaml +13 -0
- package/dist/resources/templates/environments/copilot.yaml +10 -0
- package/dist/resources/templates/environments/cursor.yaml +9 -0
- package/dist/resources/templates/environments/gemini.yaml +9 -0
- package/dist/resources/templates/environments/windsurf.yaml +10 -0
- package/dist/resources/templates/workflow-sources/README.md +9 -0
- package/dist/resources/templates/workflow-sources/workflowDocs.mjs +520 -0
- package/dist/resources/templates/workflow-sources/workflowEditorOverrides.json +1 -0
- package/dist/resources/templates/workflows/collaborate.yaml +104 -0
- package/dist/resources/templates/workflows/do.yaml +82 -0
- package/dist/resources/templates/workflows/evaluate.yaml +111 -0
- package/dist/resources/templates/workflows/execute.yaml +142 -0
- package/dist/resources/templates/workflows/plan.yaml +112 -0
- package/dist/resources/templates/workflows/review.yaml +109 -0
- package/dist/runtime/capabilities.d.ts +8 -0
- package/dist/runtime/capabilities.js +16 -0
- package/dist/security/virusScan.d.ts +16 -0
- package/dist/security/virusScan.js +83 -0
- package/dist/server/auth.d.ts +51 -0
- package/dist/server/auth.js +266 -0
- package/dist/server/auth.test.d.ts +1 -0
- package/dist/server/auth.test.js +111 -0
- package/dist/server/buildInfo.d.ts +7 -0
- package/dist/server/buildInfo.js +100 -0
- package/dist/server/buildInfo.test.d.ts +1 -0
- package/dist/server/buildInfo.test.js +29 -0
- package/dist/server/cors.d.ts +7 -0
- package/dist/server/cors.js +76 -0
- package/dist/server/cors.test.d.ts +1 -0
- package/dist/server/cors.test.js +71 -0
- package/dist/server/email.d.ts +28 -0
- package/dist/server/email.js +138 -0
- package/dist/server/email.test.d.ts +1 -0
- package/dist/server/email.test.js +113 -0
- package/dist/server/index.cookieProxy.test.d.ts +1 -0
- package/dist/server/index.cookieProxy.test.js +19 -0
- package/dist/server/index.d.ts +17 -0
- package/dist/server/index.js +757 -0
- package/dist/server/index.rateLimit.test.d.ts +1 -0
- package/dist/server/index.rateLimit.test.js +13 -0
- package/dist/server/index.test.d.ts +1 -0
- package/dist/server/index.test.js +19 -0
- package/dist/server/rateLimit.d.ts +29 -0
- package/dist/server/rateLimit.js +99 -0
- package/dist/server/rateLimit.test.d.ts +1 -0
- package/dist/server/rateLimit.test.js +107 -0
- package/dist/server/realtimeSync.auth.test.d.ts +1 -0
- package/dist/server/realtimeSync.auth.test.js +62 -0
- package/dist/server/realtimeSync.replay.test.d.ts +1 -0
- package/dist/server/realtimeSync.replay.test.js +192 -0
- package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +1 -0
- package/dist/server/realtimeSync.workspaceIsolation.test.js +101 -0
- package/dist/server/realtimeSyncWs.d.ts +30 -0
- package/dist/server/realtimeSyncWs.js +257 -0
- package/dist/server/routes.billing.d.ts +15 -0
- package/dist/server/routes.billing.js +991 -0
- package/dist/server/routes.billing.test.d.ts +1 -0
- package/dist/server/routes.billing.test.js +387 -0
- package/dist/server/routes.d.ts +72 -0
- package/dist/server/routes.js +4820 -0
- package/dist/server/routes.sync.d.ts +17 -0
- package/dist/server/routes.sync.integration.test.d.ts +1 -0
- package/dist/server/routes.sync.integration.test.js +470 -0
- package/dist/server/routes.sync.js +1141 -0
- package/dist/server/routes.test.d.ts +1 -0
- package/dist/server/routes.test.js +4945 -0
- package/dist/server/runtimeMode.d.ts +4 -0
- package/dist/server/runtimeMode.js +25 -0
- package/dist/server/runtimeMode.test.d.ts +1 -0
- package/dist/server/runtimeMode.test.js +26 -0
- package/dist/server/securityHeaders.d.ts +3 -0
- package/dist/server/securityHeaders.js +25 -0
- package/dist/server/securityHeaders.test.d.ts +1 -0
- package/dist/server/securityHeaders.test.js +32 -0
- package/dist/server/smtpTransport.d.ts +21 -0
- package/dist/server/smtpTransport.js +11 -0
- package/dist/server/start.d.ts +1 -0
- package/dist/server/start.js +17 -0
- package/dist/services/formatTransformers.d.ts +29 -0
- package/dist/services/formatTransformers.js +56 -0
- package/dist/services/templateEngine.d.ts +46 -0
- package/dist/services/templateEngine.js +148 -0
- package/dist/shared/runtimeContract.d.ts +12 -0
- package/dist/shared/runtimeContract.js +23 -0
- package/dist/shared/runtimeContract.test.d.ts +1 -0
- package/dist/shared/runtimeContract.test.js +23 -0
- package/dist/soak/preflight.cli.d.ts +1 -0
- package/dist/soak/preflight.cli.js +28 -0
- package/dist/soak/preflight.d.ts +26 -0
- package/dist/soak/preflight.js +113 -0
- package/dist/soak/preflight.test.d.ts +1 -0
- package/dist/soak/preflight.test.js +39 -0
- package/dist/soak/syncSoakHarness.d.ts +6 -0
- package/dist/soak/syncSoakHarness.js +10 -0
- package/dist/storage/createDatabaseAdapter.d.ts +2 -0
- package/dist/storage/createDatabaseAdapter.js +9 -0
- package/dist/storage/databaseAdapter.d.ts +22 -0
- package/dist/storage/databaseAdapter.js +1 -0
- package/dist/storage/documentIntegrity.d.ts +28 -0
- package/dist/storage/documentIntegrity.js +103 -0
- package/dist/storage/documentPurge.d.ts +14 -0
- package/dist/storage/documentPurge.js +46 -0
- package/dist/storage/documentRegistry.d.ts +39 -0
- package/dist/storage/documentRegistry.js +115 -0
- package/dist/storage/integritySchedule.d.ts +17 -0
- package/dist/storage/integritySchedule.js +62 -0
- package/dist/storage/objectStorage.d.ts +20 -0
- package/dist/storage/objectStorage.js +15 -0
- package/dist/storage/objectStorageClient.d.ts +18 -0
- package/dist/storage/objectStorageClient.js +301 -0
- package/dist/storage/objectStorageConfig.d.ts +2 -0
- package/dist/storage/objectStorageConfig.js +45 -0
- package/dist/storage/postgresAdapter.d.ts +20 -0
- package/dist/storage/postgresAdapter.js +204 -0
- package/dist/storage/postgresWorker.d.ts +1 -0
- package/dist/storage/postgresWorker.js +110 -0
- package/dist/storage/providerConfig.d.ts +6 -0
- package/dist/storage/providerConfig.js +11 -0
- package/dist/storage/sqliteAdapter.d.ts +14 -0
- package/dist/storage/sqliteAdapter.js +28 -0
- package/dist/storage/taskAssetStore.d.ts +56 -0
- package/dist/storage/taskAssetStore.js +297 -0
- package/dist/sync/cloudSyncApi.d.ts +47 -0
- package/dist/sync/cloudSyncApi.js +138 -0
- package/dist/sync/cloudSyncApi.test.d.ts +1 -0
- package/dist/sync/cloudSyncApi.test.js +54 -0
- package/dist/sync/encryptionService.d.ts +11 -0
- package/dist/sync/encryptionService.js +61 -0
- package/dist/sync/encryptionService.test.d.ts +1 -0
- package/dist/sync/encryptionService.test.js +52 -0
- package/dist/sync/realtimeFeature.d.ts +6 -0
- package/dist/sync/realtimeFeature.js +20 -0
- package/dist/sync/realtimeFeature.test.d.ts +1 -0
- package/dist/sync/realtimeFeature.test.js +30 -0
- package/dist/sync/realtimeReconcile.d.ts +30 -0
- package/dist/sync/realtimeReconcile.js +90 -0
- package/dist/sync/realtimeReconcile.test.d.ts +1 -0
- package/dist/sync/realtimeReconcile.test.js +43 -0
- package/dist/sync/syncService.d.ts +96 -0
- package/dist/sync/syncService.js +423 -0
- package/dist/sync/syncService.test.d.ts +1 -0
- package/dist/sync/syncService.test.js +484 -0
- package/dist/sync/workspaceSyncModel.d.ts +61 -0
- package/dist/sync/workspaceSyncModel.js +136 -0
- package/dist/sync/workspaceSyncModel.test.d.ts +1 -0
- package/dist/sync/workspaceSyncModel.test.js +73 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/test/setup.js +15 -0
- package/dist/types.d.ts +157 -0
- package/dist/types.js +41 -0
- package/dist/ui/assets/RussoOne-Regular-C3BxZIj7.ttf +0 -0
- package/dist/ui/assets/index-0W5vyCpn.css +1 -0
- package/dist/ui/assets/index-MCZuNNfn.js +23 -0
- package/dist/ui/assets/logo_white_01-0Vx-iIIv.png +0 -0
- package/dist/ui/assets/taskforce-BxLPokNB.png +0 -0
- package/dist/ui/assets/vendor-dnd-BI1K77C1.js +5 -0
- package/dist/ui/assets/vendor-icons-ZFG3SGwo.js +1 -0
- package/dist/ui/assets/vendor-markdown-CKYkQHfj.js +29 -0
- package/dist/ui/assets/vendor-react-DdIDsh7f.js +9 -0
- package/dist/ui/assets/vendor-router-BtiNU7Dl.js +3 -0
- package/dist/ui/branding/logos/logo_black_01.png +0 -0
- package/dist/ui/branding/logos/logo_black_02.png +0 -0
- package/dist/ui/branding/logos/logo_white_01.png +0 -0
- package/dist/ui/branding/logos/logo_white_02.png +0 -0
- package/dist/ui/favicon/android-chrome-192x192.png +0 -0
- package/dist/ui/favicon/android-chrome-512x512.png +0 -0
- package/dist/ui/favicon/apple-touch-icon.png +0 -0
- package/dist/ui/favicon/favicon-16x16.png +0 -0
- package/dist/ui/favicon/favicon-32x32.png +0 -0
- package/dist/ui/favicon/favicon.ico +0 -0
- package/dist/ui/favicon/favicon.png +0 -0
- package/dist/ui/favicon/site.webmanifest +1 -0
- package/dist/ui/fonts/RussoOne-Regular.ttf +0 -0
- package/dist/ui/images/taskforce.png +0 -0
- package/dist/ui/index.html +19 -0
- package/dist/utils/checklistMarkdown.d.ts +9 -0
- package/dist/utils/checklistMarkdown.js +46 -0
- package/dist/utils/constants.d.ts +21 -0
- package/dist/utils/constants.icons.test.d.ts +1 -0
- package/dist/utils/constants.icons.test.js +40 -0
- package/dist/utils/constants.js +100 -0
- package/dist/utils/contextFiles.d.ts +8 -0
- package/dist/utils/contextFiles.js +54 -0
- package/dist/utils/formatting.d.ts +5 -0
- package/dist/utils/formatting.js +30 -0
- package/dist/utils/planParser.d.ts +22 -0
- package/dist/utils/planParser.js +151 -0
- package/dist/utils/taskDragZones.d.ts +8 -0
- package/dist/utils/taskDragZones.js +14 -0
- package/dist/utils/taskDragZones.test.d.ts +1 -0
- package/dist/utils/taskDragZones.test.js +14 -0
- package/dist/utils/taskHierarchy.d.ts +4 -0
- package/dist/utils/taskHierarchy.js +69 -0
- package/dist/utils/taskHierarchy.test.d.ts +1 -0
- package/dist/utils/taskHierarchy.test.js +38 -0
- package/dist/utils/taskParenting.d.ts +3 -0
- package/dist/utils/taskParenting.js +24 -0
- package/dist/utils/taskParenting.test.d.ts +1 -0
- package/dist/utils/taskParenting.test.js +21 -0
- package/dist/utils/taskRelations.d.ts +6 -0
- package/dist/utils/taskRelations.js +24 -0
- package/dist/utils/taskRelations.test.d.ts +1 -0
- package/dist/utils/taskRelations.test.js +34 -0
- package/dist/utils/taskUtils.d.ts +2 -0
- package/dist/utils/taskUtils.js +20 -0
- package/dist/utils/taskforceApiClient.d.ts +7 -0
- package/dist/utils/taskforceApiClient.js +42 -0
- package/dist/utils/workspaceIdentity.d.ts +8 -0
- package/dist/utils/workspaceIdentity.js +47 -0
- package/dist/utils/workspaceIdentity.test.d.ts +1 -0
- package/dist/utils/workspaceIdentity.test.js +32 -0
- package/dist/utils/workspaceLifecycle.d.ts +26 -0
- package/dist/utils/workspaceLifecycle.js +69 -0
- package/dist/utils/workspaceLifecycle.test.d.ts +1 -0
- package/dist/utils/workspaceLifecycle.test.js +64 -0
- package/package.json +133 -0
- package/scripts/check-compat-boundaries.js +48 -0
- package/scripts/check-env.ts +24 -0
- package/scripts/check-localization-strings.mjs +49 -0
- package/scripts/check-runtime-boundaries.mjs +44 -0
- package/scripts/debug-global.mjs +34 -0
- package/scripts/debug-server.mjs +36 -0
- package/scripts/export-sqlite-to-postgres.mjs +125 -0
- package/scripts/generate-env-example.ts +8 -0
- package/scripts/generate-workflow-templates.mjs +134 -0
- package/scripts/mcp-stdio-adapter.mjs +160 -0
- package/scripts/postinstall.js +60 -0
- package/scripts/release-version-lib.mjs +88 -0
- package/scripts/release-version.mjs +72 -0
- package/scripts/run-dev-proxy.sh +49 -0
- package/scripts/run-e2e-realtime.sh +16 -0
- package/scripts/run-smoke.sh +23 -0
- package/scripts/run-soak.sh +29 -0
- package/scripts/test-global.js +143 -0
- package/scripts/update-homebrew-formula.sh +38 -0
- package/src/resources/templates/WORKFLOW_V2_POLICY.md +55 -0
- package/src/resources/templates/environments/aider.yaml +14 -0
- package/src/resources/templates/environments/antigravity.yaml +10 -0
- package/src/resources/templates/environments/claude.yaml +10 -0
- package/src/resources/templates/environments/cline.yaml +10 -0
- package/src/resources/templates/environments/codex.yaml +13 -0
- package/src/resources/templates/environments/copilot.yaml +10 -0
- package/src/resources/templates/environments/cursor.yaml +9 -0
- package/src/resources/templates/environments/gemini.yaml +9 -0
- package/src/resources/templates/environments/windsurf.yaml +10 -0
- package/src/resources/templates/workflow-sources/README.md +9 -0
- package/src/resources/templates/workflow-sources/workflowDocs.mjs +520 -0
- package/src/resources/templates/workflow-sources/workflowEditorOverrides.json +1 -0
- package/src/resources/templates/workflows/collaborate.yaml +104 -0
- package/src/resources/templates/workflows/do.yaml +82 -0
- package/src/resources/templates/workflows/evaluate.yaml +111 -0
- package/src/resources/templates/workflows/execute.yaml +142 -0
- package/src/resources/templates/workflows/plan.yaml +112 -0
- package/src/resources/templates/workflows/review.yaml +109 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import * as os from 'os';
|
|
4
|
+
import * as path from 'path';
|
|
5
|
+
import { TaskforceCore } from './Taskforce';
|
|
6
|
+
function makeCore() {
|
|
7
|
+
const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-realtime-mutation-test-'));
|
|
8
|
+
const core = new TaskforceCore({
|
|
9
|
+
projectRoot,
|
|
10
|
+
storagePath: path.join(projectRoot, '.taskforce')
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
core,
|
|
14
|
+
cleanup: () => {
|
|
15
|
+
core.close();
|
|
16
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
describe('TaskforceCore realtime mutation stream', () => {
|
|
21
|
+
it('emits task upsert events for create and update paths (MCP/HTTP shared core)', () => {
|
|
22
|
+
const { core, cleanup } = makeCore();
|
|
23
|
+
try {
|
|
24
|
+
const events = [];
|
|
25
|
+
const off = core.onRealtimeMutation((event) => events.push(event));
|
|
26
|
+
const created = core.createTask({ title: 'Realtime Mutation Task' }, { workspaceId: 'workspace-a' });
|
|
27
|
+
core.updateTask(created.id, { description: 'updated via core' }, 'workspace-a');
|
|
28
|
+
off();
|
|
29
|
+
const taskEvents = events.filter((event) => event.entityType === 'task');
|
|
30
|
+
expect(taskEvents.length).toBe(2);
|
|
31
|
+
expect(taskEvents[0].changeType).toBe('upsert');
|
|
32
|
+
expect(taskEvents[0].workspaceId).toBe('workspace-a');
|
|
33
|
+
expect(taskEvents[0].entityIds).toContain(created.id);
|
|
34
|
+
expect(taskEvents[1].seq).toBeGreaterThan(taskEvents[0].seq);
|
|
35
|
+
}
|
|
36
|
+
finally {
|
|
37
|
+
cleanup();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
it('emits taxonomy events on taxonomy updates', () => {
|
|
41
|
+
const { core, cleanup } = makeCore();
|
|
42
|
+
try {
|
|
43
|
+
const events = [];
|
|
44
|
+
const off = core.onRealtimeMutation((event) => events.push(event));
|
|
45
|
+
core.updateTaxonomies([{ value: 'streaming', label: 'Streaming' }]);
|
|
46
|
+
off();
|
|
47
|
+
const taxonomyEvent = events.find((event) => event.entityType === 'taxonomy');
|
|
48
|
+
expect(taxonomyEvent).toBeTruthy();
|
|
49
|
+
expect(taxonomyEvent?.workspaceId).toBe('*');
|
|
50
|
+
expect(taxonomyEvent?.changeType).toBe('upsert');
|
|
51
|
+
expect(taxonomyEvent?.entityIds).toContain('__taxonomy_config__');
|
|
52
|
+
}
|
|
53
|
+
finally {
|
|
54
|
+
cleanup();
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
it('emits document metadata events and avoids duplicate emits for unchanged hash', () => {
|
|
58
|
+
const { core, cleanup } = makeCore();
|
|
59
|
+
try {
|
|
60
|
+
const events = [];
|
|
61
|
+
const off = core.onRealtimeMutation((event) => events.push(event));
|
|
62
|
+
core.upsertDocumentWatermark('workspace-docs', '.taskforce/docs/foo.md', 'hash-1', new Date().toISOString());
|
|
63
|
+
core.upsertDocumentWatermark('workspace-docs', '.taskforce/docs/foo.md', 'hash-1', new Date().toISOString());
|
|
64
|
+
core.deleteDocumentWatermark('workspace-docs', '.taskforce/docs/foo.md');
|
|
65
|
+
off();
|
|
66
|
+
const docEvents = events.filter((event) => event.entityType === 'document-metadata');
|
|
67
|
+
expect(docEvents.length).toBe(2);
|
|
68
|
+
expect(docEvents[0].changeType).toBe('upsert');
|
|
69
|
+
expect(docEvents[1].changeType).toBe('delete');
|
|
70
|
+
expect(docEvents.every((event) => event.workspaceId === 'workspace-docs')).toBe(true);
|
|
71
|
+
}
|
|
72
|
+
finally {
|
|
73
|
+
cleanup();
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { TaskforceCore } from './Taskforce';
|
|
6
|
+
function makeCore() {
|
|
7
|
+
const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-workspace-delete-'));
|
|
8
|
+
const core = new TaskforceCore({
|
|
9
|
+
projectRoot,
|
|
10
|
+
storagePath: path.join(projectRoot, '.taskforce')
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
core,
|
|
14
|
+
cleanup: () => {
|
|
15
|
+
core.close();
|
|
16
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function countByWorkspace(core, table, workspaceId) {
|
|
21
|
+
const row = core.getDatabaseAdapter().prepare(`
|
|
22
|
+
SELECT COUNT(*) AS count
|
|
23
|
+
FROM ${table}
|
|
24
|
+
WHERE tenant_id = ? AND workspace_id = ?
|
|
25
|
+
`).get(core.getTenantId(), workspaceId);
|
|
26
|
+
return Number(row?.count || 0);
|
|
27
|
+
}
|
|
28
|
+
describe('TaskforceCore deleteWorkspace', () => {
|
|
29
|
+
it('cascades deletion for workspace-scoped rows and preserves other workspaces', () => {
|
|
30
|
+
const { core, cleanup } = makeCore();
|
|
31
|
+
try {
|
|
32
|
+
const tenantId = core.getTenantId();
|
|
33
|
+
const wsDelete = 'workspace-delete';
|
|
34
|
+
const wsKeep = 'workspace-keep';
|
|
35
|
+
const now = '2026-03-03T10:00:00.000Z';
|
|
36
|
+
core.createWorkspace({ workspaceId: wsDelete, name: 'Workspace Delete' });
|
|
37
|
+
core.createWorkspace({ workspaceId: wsKeep, name: 'Workspace Keep' });
|
|
38
|
+
core.ensureBootstrapUserAccess({ userId: 'owner-del', workspaceId: wsDelete, role: 'owner', email: 'del@example.com' });
|
|
39
|
+
core.ensureBootstrapUserAccess({ userId: 'owner-keep', workspaceId: wsKeep, role: 'owner', email: 'keep@example.com' });
|
|
40
|
+
const parent = core.createTask({ title: 'Parent Delete', type: 'feature', category: 'default' }, { workspaceId: wsDelete });
|
|
41
|
+
const child = core.createTask({ title: 'Child Delete', type: 'feature', category: 'default', parentTaskId: parent.id }, { workspaceId: wsDelete });
|
|
42
|
+
const sibling = core.createTask({ title: 'Sibling Delete', type: 'feature', category: 'default' }, { workspaceId: wsDelete });
|
|
43
|
+
const keepTask = core.createTask({ title: 'Keep Task', type: 'feature', category: 'default' }, { workspaceId: wsKeep });
|
|
44
|
+
core.addComment(parent.id, 'comment delete', 'owner-del', wsDelete);
|
|
45
|
+
core.getDatabaseAdapter().prepare(`
|
|
46
|
+
INSERT INTO screenshots (id, tenant_id, workspace_id, task_id, path, fs_path, caption, timestamp)
|
|
47
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
48
|
+
`).run('shot-delete', tenantId, wsDelete, parent.id, 'task-data/shot-delete.png', '/tmp/shot-delete.png', 'shot', now);
|
|
49
|
+
core.getDatabaseAdapter().prepare(`
|
|
50
|
+
INSERT INTO screenshots (id, tenant_id, workspace_id, task_id, path, fs_path, caption, timestamp)
|
|
51
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
52
|
+
`).run('shot-keep', tenantId, wsKeep, keepTask.id, 'task-data/shot-keep.png', '/tmp/shot-keep.png', 'shot', now);
|
|
53
|
+
core.getDatabaseAdapter().prepare(`
|
|
54
|
+
INSERT INTO auth_tokens (id, tenant_id, user_id, workspace_id, purpose, token_hash, expires_at, used_at, revoked_at, created_at)
|
|
55
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
56
|
+
`).run('token-delete', tenantId, 'owner-del', wsDelete, 'password_reset', 'hash-delete', '2099-01-01T00:00:00.000Z', null, null, now);
|
|
57
|
+
core.getDatabaseAdapter().prepare(`
|
|
58
|
+
INSERT INTO auth_tokens (id, tenant_id, user_id, workspace_id, purpose, token_hash, expires_at, used_at, revoked_at, created_at)
|
|
59
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
60
|
+
`).run('token-keep', tenantId, 'owner-keep', wsKeep, 'password_reset', 'hash-keep', '2099-01-01T00:00:00.000Z', null, null, now);
|
|
61
|
+
core.updateUiState(wsDelete, 'owner-del', { stateKey: 'workspace-sync', patch: { enabled: true } });
|
|
62
|
+
core.updateUiState(wsKeep, 'owner-keep', { stateKey: 'workspace-sync', patch: { enabled: true } });
|
|
63
|
+
core.setWorkspacePlanMode(wsDelete, 'team', 'test');
|
|
64
|
+
core.setWorkspacePlanMode(wsKeep, 'team', 'test');
|
|
65
|
+
core.addAdminAuditLog({ action: 'test-delete', actorUserId: 'owner-del', actorRole: 'owner', workspaceId: wsDelete, details: { phase: 'before' } });
|
|
66
|
+
core.addAdminAuditLog({ action: 'test-keep', actorUserId: 'owner-keep', actorRole: 'owner', workspaceId: wsKeep, details: { phase: 'before' } });
|
|
67
|
+
core.recordSyncEvent(wsDelete, { eventType: 'pull', status: 'success' });
|
|
68
|
+
core.recordSyncEvent(wsKeep, { eventType: 'pull', status: 'success' });
|
|
69
|
+
core.writePushIdempotency(wsDelete, 'delete-key', '{}');
|
|
70
|
+
core.writePushIdempotency(wsKeep, 'keep-key', '{}');
|
|
71
|
+
core.deleteTask(child.id, wsDelete);
|
|
72
|
+
core.upsertDocumentWatermark(wsDelete, `docs/workspaces/${wsDelete}/notes.md`, 'hash-delete', now);
|
|
73
|
+
core.upsertDocumentWatermark(wsKeep, `docs/workspaces/${wsKeep}/notes.md`, 'hash-keep', now);
|
|
74
|
+
core.getDatabaseAdapter().prepare(`
|
|
75
|
+
INSERT INTO task_assets (
|
|
76
|
+
tenant_id, workspace_id, path, provider, version, content_type, size_bytes, sha256,
|
|
77
|
+
uploaded_at, scan_engine, scan_verdict, scan_details, scan_scanned_at, quarantine_status,
|
|
78
|
+
deleted_at, purge_after, updated_at
|
|
79
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
80
|
+
`).run(tenantId, wsDelete, `workspaces/${wsDelete}/tasks/${parent.id}/attachments/spec.md`, 'local', 1, 'text/markdown', 10, 'sha-delete', now, 'none', 'clean', null, now, 'none', null, null, now);
|
|
81
|
+
core.getDatabaseAdapter().prepare(`
|
|
82
|
+
INSERT INTO task_assets (
|
|
83
|
+
tenant_id, workspace_id, path, provider, version, content_type, size_bytes, sha256,
|
|
84
|
+
uploaded_at, scan_engine, scan_verdict, scan_details, scan_scanned_at, quarantine_status,
|
|
85
|
+
deleted_at, purge_after, updated_at
|
|
86
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
87
|
+
`).run(tenantId, wsKeep, `workspaces/${wsKeep}/tasks/${keepTask.id}/attachments/spec.md`, 'local', 1, 'text/markdown', 10, 'sha-keep', now, 'none', 'clean', null, now, 'none', null, null, now);
|
|
88
|
+
const summary = core.deleteWorkspace({ workspaceId: wsDelete });
|
|
89
|
+
expect(summary.deletedWorkspaceId).toBe(wsDelete);
|
|
90
|
+
expect(summary.deletedTaskIds).toEqual(expect.arrayContaining([parent.id, sibling.id]));
|
|
91
|
+
expect(summary.deletedDocumentPaths).toContain(`docs/workspaces/${wsDelete}/notes.md`);
|
|
92
|
+
expect(summary.deletedAssets.some((asset) => asset.workspaceId === wsDelete)).toBe(true);
|
|
93
|
+
expect(summary.counts.workspaces).toBe(1);
|
|
94
|
+
expect(summary.counts.workspace_memberships).toBeGreaterThan(0);
|
|
95
|
+
expect(summary.counts.tasks).toBeGreaterThan(0);
|
|
96
|
+
const workspaceDeleteExists = core.getDatabaseAdapter().prepare(`
|
|
97
|
+
SELECT 1 FROM workspaces WHERE tenant_id = ? AND id = ? LIMIT 1
|
|
98
|
+
`).get(tenantId, wsDelete);
|
|
99
|
+
const workspaceKeepExists = core.getDatabaseAdapter().prepare(`
|
|
100
|
+
SELECT 1 FROM workspaces WHERE tenant_id = ? AND id = ? LIMIT 1
|
|
101
|
+
`).get(tenantId, wsKeep);
|
|
102
|
+
expect(Boolean(workspaceDeleteExists)).toBe(false);
|
|
103
|
+
expect(Boolean(workspaceKeepExists)).toBe(true);
|
|
104
|
+
const scopedTables = [
|
|
105
|
+
'tasks',
|
|
106
|
+
'comments',
|
|
107
|
+
'screenshots',
|
|
108
|
+
'workspace_memberships',
|
|
109
|
+
'auth_tokens',
|
|
110
|
+
'ui_state',
|
|
111
|
+
'workspace_settings',
|
|
112
|
+
'admin_audit_logs',
|
|
113
|
+
'workspace_sync_deletes',
|
|
114
|
+
'sync_idempotency',
|
|
115
|
+
'sync_events',
|
|
116
|
+
'workspace_documents',
|
|
117
|
+
'task_assets'
|
|
118
|
+
];
|
|
119
|
+
for (const table of scopedTables) {
|
|
120
|
+
expect(countByWorkspace(core, table, wsDelete)).toBe(0);
|
|
121
|
+
}
|
|
122
|
+
expect(countByWorkspace(core, 'tasks', wsKeep)).toBeGreaterThan(0);
|
|
123
|
+
expect(countByWorkspace(core, 'workspace_memberships', wsKeep)).toBeGreaterThan(0);
|
|
124
|
+
expect(countByWorkspace(core, 'workspace_documents', wsKeep)).toBeGreaterThan(0);
|
|
125
|
+
expect(countByWorkspace(core, 'task_assets', wsKeep)).toBeGreaterThan(0);
|
|
126
|
+
}
|
|
127
|
+
finally {
|
|
128
|
+
cleanup();
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
it('rejects deleting the reserved default workspace', () => {
|
|
132
|
+
const { core, cleanup } = makeCore();
|
|
133
|
+
try {
|
|
134
|
+
expect(() => core.deleteWorkspace({ workspaceId: 'default' })).toThrowError(/reserved/i);
|
|
135
|
+
}
|
|
136
|
+
finally {
|
|
137
|
+
cleanup();
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { TaskforceCore } from './Taskforce';
|
|
6
|
+
function makeCore() {
|
|
7
|
+
const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-workspace-perm-'));
|
|
8
|
+
const core = new TaskforceCore({
|
|
9
|
+
projectRoot,
|
|
10
|
+
storagePath: path.join(projectRoot, '.taskforce')
|
|
11
|
+
});
|
|
12
|
+
return {
|
|
13
|
+
core,
|
|
14
|
+
cleanup: () => {
|
|
15
|
+
core.close();
|
|
16
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
describe('TaskforceCore workspace permission invariants', () => {
|
|
21
|
+
it('enforces member read-only via permission_mode in resolveUserAccess', () => {
|
|
22
|
+
const { core, cleanup } = makeCore();
|
|
23
|
+
try {
|
|
24
|
+
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
25
|
+
core.ensureBootstrapUserAccess({
|
|
26
|
+
userId: 'owner-1',
|
|
27
|
+
workspaceId: 'workspace-1',
|
|
28
|
+
role: 'owner',
|
|
29
|
+
email: 'owner@example.com'
|
|
30
|
+
});
|
|
31
|
+
core.ensureBootstrapUserAccess({
|
|
32
|
+
userId: 'member-1',
|
|
33
|
+
workspaceId: 'workspace-1',
|
|
34
|
+
role: 'member',
|
|
35
|
+
email: 'member@example.com'
|
|
36
|
+
});
|
|
37
|
+
expect(core.setWorkspaceUserPermissionMode('member-1', 'workspace-1', 'read-only')).toBe(true);
|
|
38
|
+
const access = core.resolveUserAccess('member-1', 'workspace-1', 'member');
|
|
39
|
+
expect(access?.permissionMode).toBe('read-only');
|
|
40
|
+
expect(access?.role).toBe('read-only');
|
|
41
|
+
}
|
|
42
|
+
finally {
|
|
43
|
+
cleanup();
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
it('rejects permission_mode updates for owner/admin', () => {
|
|
47
|
+
const { core, cleanup } = makeCore();
|
|
48
|
+
try {
|
|
49
|
+
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
50
|
+
core.ensureBootstrapUserAccess({
|
|
51
|
+
userId: 'owner-1',
|
|
52
|
+
workspaceId: 'workspace-1',
|
|
53
|
+
role: 'owner',
|
|
54
|
+
email: 'owner@example.com'
|
|
55
|
+
});
|
|
56
|
+
expect(() => core.setWorkspaceUserPermissionMode('owner-1', 'workspace-1', 'read-only')).toThrowError(/members/i);
|
|
57
|
+
}
|
|
58
|
+
finally {
|
|
59
|
+
cleanup();
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
it('prevents demoting the last workspace owner', () => {
|
|
63
|
+
const { core, cleanup } = makeCore();
|
|
64
|
+
try {
|
|
65
|
+
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
66
|
+
core.ensureBootstrapUserAccess({
|
|
67
|
+
userId: 'owner-1',
|
|
68
|
+
workspaceId: 'workspace-1',
|
|
69
|
+
role: 'owner',
|
|
70
|
+
email: 'owner@example.com'
|
|
71
|
+
});
|
|
72
|
+
expect(() => core.updateWorkspaceUserRole('owner-1', 'workspace-1', 'admin')).toThrowError(/last workspace owner/i);
|
|
73
|
+
}
|
|
74
|
+
finally {
|
|
75
|
+
cleanup();
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
it('prevents disabling and removing the last workspace owner', () => {
|
|
79
|
+
const { core, cleanup } = makeCore();
|
|
80
|
+
try {
|
|
81
|
+
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
82
|
+
core.ensureBootstrapUserAccess({
|
|
83
|
+
userId: 'owner-1',
|
|
84
|
+
workspaceId: 'workspace-1',
|
|
85
|
+
role: 'owner',
|
|
86
|
+
email: 'owner@example.com'
|
|
87
|
+
});
|
|
88
|
+
expect(() => core.setWorkspaceUserDisabled('owner-1', 'workspace-1', true)).toThrowError(/last workspace owner/i);
|
|
89
|
+
expect(() => core.removeWorkspaceUser('owner-1', 'workspace-1')).toThrowError(/last workspace owner/i);
|
|
90
|
+
}
|
|
91
|
+
finally {
|
|
92
|
+
cleanup();
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
it('transfers ownership and keeps one active owner', () => {
|
|
96
|
+
const { core, cleanup } = makeCore();
|
|
97
|
+
try {
|
|
98
|
+
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
99
|
+
core.ensureBootstrapUserAccess({
|
|
100
|
+
userId: 'owner-1',
|
|
101
|
+
workspaceId: 'workspace-1',
|
|
102
|
+
role: 'owner',
|
|
103
|
+
email: 'owner@example.com'
|
|
104
|
+
});
|
|
105
|
+
core.ensureBootstrapUserAccess({
|
|
106
|
+
userId: 'member-1',
|
|
107
|
+
workspaceId: 'workspace-1',
|
|
108
|
+
role: 'member',
|
|
109
|
+
email: 'member@example.com'
|
|
110
|
+
});
|
|
111
|
+
expect(core.transferWorkspaceOwnership({
|
|
112
|
+
workspaceId: 'workspace-1',
|
|
113
|
+
fromUserId: 'owner-1',
|
|
114
|
+
toUserId: 'member-1'
|
|
115
|
+
})).toBe(true);
|
|
116
|
+
const users = core.listWorkspaceUsers('workspace-1');
|
|
117
|
+
const newOwner = users.find((u) => u.userId === 'member-1');
|
|
118
|
+
const previousOwner = users.find((u) => u.userId === 'owner-1');
|
|
119
|
+
expect(newOwner?.role).toBe('owner');
|
|
120
|
+
expect(previousOwner?.role).toBe('admin');
|
|
121
|
+
expect(core.countWorkspaceOwners('workspace-1')).toBe(1);
|
|
122
|
+
}
|
|
123
|
+
finally {
|
|
124
|
+
cleanup();
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
it('marks deactivated users as disabled in access resolution immediately', () => {
|
|
128
|
+
const { core, cleanup } = makeCore();
|
|
129
|
+
try {
|
|
130
|
+
core.createWorkspace({ workspaceId: 'workspace-1', name: 'Workspace 1' });
|
|
131
|
+
core.ensureBootstrapUserAccess({
|
|
132
|
+
userId: 'owner-1',
|
|
133
|
+
workspaceId: 'workspace-1',
|
|
134
|
+
role: 'owner',
|
|
135
|
+
email: 'owner@example.com'
|
|
136
|
+
});
|
|
137
|
+
core.ensureBootstrapUserAccess({
|
|
138
|
+
userId: 'member-1',
|
|
139
|
+
workspaceId: 'workspace-1',
|
|
140
|
+
role: 'member',
|
|
141
|
+
email: 'member@example.com'
|
|
142
|
+
});
|
|
143
|
+
expect(core.setWorkspaceUserDisabled('member-1', 'workspace-1', true)).toBe(true);
|
|
144
|
+
const access = core.resolveUserAccess('member-1', 'workspace-1', 'member');
|
|
145
|
+
expect(access?.disabled).toBe(true);
|
|
146
|
+
}
|
|
147
|
+
finally {
|
|
148
|
+
cleanup();
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { TaskforceCore } from './Taskforce';
|
|
6
|
+
function makeProjectRoot() {
|
|
7
|
+
return fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-plan-mode-'));
|
|
8
|
+
}
|
|
9
|
+
function openCore(projectRoot) {
|
|
10
|
+
return new TaskforceCore({
|
|
11
|
+
projectRoot,
|
|
12
|
+
storagePath: path.join(projectRoot, '.taskforce')
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
describe('TaskforceCore account-level plan mode and invite revoke', () => {
|
|
16
|
+
it('derives workspace plan mode from owner account plan across all owned workspaces', () => {
|
|
17
|
+
const projectRoot = makeProjectRoot();
|
|
18
|
+
const initial = openCore(projectRoot);
|
|
19
|
+
try {
|
|
20
|
+
const now = new Date().toISOString();
|
|
21
|
+
const db = initial.db;
|
|
22
|
+
db.prepare(`
|
|
23
|
+
INSERT INTO workspaces (id, tenant_id, slug, name, created_at, updated_at)
|
|
24
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
25
|
+
`).run('workspace-single', 'default', 'workspace-single', 'Single', now, now);
|
|
26
|
+
db.prepare(`
|
|
27
|
+
INSERT INTO workspaces (id, tenant_id, slug, name, created_at, updated_at)
|
|
28
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
29
|
+
`).run('workspace-team', 'default', 'workspace-team', 'Team', now, now);
|
|
30
|
+
db.prepare(`
|
|
31
|
+
INSERT INTO workspaces (id, tenant_id, slug, name, created_at, updated_at)
|
|
32
|
+
VALUES (?, ?, ?, ?, ?, ?)
|
|
33
|
+
`).run('workspace-u1-second', 'default', 'workspace-u1-second', 'Second U1 Workspace', now, now);
|
|
34
|
+
db.prepare(`
|
|
35
|
+
INSERT INTO users (id, tenant_id, email, display_name, auth_provider, external_auth_id, is_disabled, created_at, updated_at)
|
|
36
|
+
VALUES (?, ?, ?, ?, ?, ?, 0, ?, ?)
|
|
37
|
+
`).run('u1', 'default', 'u1@example.com', 'U1', 'token', 'u1', now, now);
|
|
38
|
+
db.prepare(`
|
|
39
|
+
INSERT INTO users (id, tenant_id, email, display_name, auth_provider, external_auth_id, is_disabled, created_at, updated_at)
|
|
40
|
+
VALUES (?, ?, ?, ?, ?, ?, 0, ?, ?)
|
|
41
|
+
`).run('u2', 'default', 'u2@example.com', 'U2', 'token', 'u2', now, now);
|
|
42
|
+
db.prepare(`
|
|
43
|
+
INSERT INTO users (id, tenant_id, email, display_name, auth_provider, external_auth_id, is_disabled, created_at, updated_at)
|
|
44
|
+
VALUES (?, ?, ?, ?, ?, ?, 0, ?, ?)
|
|
45
|
+
`).run('u3', 'default', 'u3@example.com', 'U3', 'token', 'u3', now, now);
|
|
46
|
+
db.prepare(`
|
|
47
|
+
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
48
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
49
|
+
`).run('m1', 'default', 'workspace-single', 'u1', 'owner', 'active', now, now);
|
|
50
|
+
db.prepare(`
|
|
51
|
+
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
52
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
53
|
+
`).run('m2', 'default', 'workspace-team', 'u2', 'owner', 'active', now, now);
|
|
54
|
+
db.prepare(`
|
|
55
|
+
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
56
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
57
|
+
`).run('m3', 'default', 'workspace-team', 'u3', 'member', 'active', now, now);
|
|
58
|
+
db.prepare(`
|
|
59
|
+
INSERT INTO workspace_memberships (id, tenant_id, workspace_id, user_id, role, status, created_at, updated_at)
|
|
60
|
+
VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
61
|
+
`).run('m4', 'default', 'workspace-u1-second', 'u1', 'owner', 'active', now, now);
|
|
62
|
+
initial.setUserAccountPlanMode('u2', 'team');
|
|
63
|
+
}
|
|
64
|
+
finally {
|
|
65
|
+
initial.close();
|
|
66
|
+
}
|
|
67
|
+
const reopened = openCore(projectRoot);
|
|
68
|
+
try {
|
|
69
|
+
expect(reopened.getWorkspacePlanMode('workspace-single')).toBe('personal');
|
|
70
|
+
expect(reopened.getWorkspacePlanMode('workspace-team')).toBe('team');
|
|
71
|
+
expect(reopened.getWorkspacePlanMode('workspace-u1-second')).toBe('personal');
|
|
72
|
+
reopened.setWorkspacePlanMode('workspace-single', 'team');
|
|
73
|
+
expect(reopened.getWorkspacePlanMode('workspace-single')).toBe('team');
|
|
74
|
+
expect(reopened.getWorkspacePlanMode('workspace-u1-second')).toBe('team');
|
|
75
|
+
}
|
|
76
|
+
finally {
|
|
77
|
+
reopened.close();
|
|
78
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
it('marks invite token as revoked and inspect reflects revoked state', () => {
|
|
82
|
+
const projectRoot = makeProjectRoot();
|
|
83
|
+
const core = openCore(projectRoot);
|
|
84
|
+
try {
|
|
85
|
+
core.createWorkspace({ workspaceId: 'workspace-invite', name: 'Invite Workspace' });
|
|
86
|
+
core.ensureBootstrapUserAccess({
|
|
87
|
+
userId: 'user-invite',
|
|
88
|
+
workspaceId: 'workspace-invite',
|
|
89
|
+
role: 'member',
|
|
90
|
+
email: 'invite@example.com'
|
|
91
|
+
});
|
|
92
|
+
const invite = core.requestInviteAcceptance({ userId: 'user-invite', workspaceId: 'workspace-invite' });
|
|
93
|
+
expect(typeof invite.token).toBe('string');
|
|
94
|
+
const revoke = core.revokeInviteAcceptanceForUser('user-invite');
|
|
95
|
+
expect(revoke.revoked).toBeGreaterThan(0);
|
|
96
|
+
const inspected = core.inspectInviteAcceptance(String(invite.token));
|
|
97
|
+
expect(inspected.state).toBe('revoked');
|
|
98
|
+
}
|
|
99
|
+
finally {
|
|
100
|
+
core.close();
|
|
101
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export interface AuthGuardInputs {
|
|
2
|
+
shouldGateProtectedApiCalls: boolean;
|
|
3
|
+
runtimeMode: 'local' | 'cloud';
|
|
4
|
+
authSessionResolved: boolean;
|
|
5
|
+
authRequiredForApi: boolean;
|
|
6
|
+
isAuthenticated: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface AuthGuardPolicy {
|
|
9
|
+
shouldDeferProtectedApiCalls: boolean;
|
|
10
|
+
shouldBlockProtectedApiCalls: boolean;
|
|
11
|
+
canCallProtectedApi: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function deriveAuthGuardPolicy(inputs: AuthGuardInputs): AuthGuardPolicy;
|
|
14
|
+
export declare function shouldSkipDataVersionPolling(args: {
|
|
15
|
+
isOpen: boolean;
|
|
16
|
+
authBlocked: boolean;
|
|
17
|
+
authRequiredForApi: boolean;
|
|
18
|
+
isAuthenticated: boolean;
|
|
19
|
+
canCallProtectedApi: boolean;
|
|
20
|
+
}): boolean;
|
|
21
|
+
export declare function shouldSkipDataVersionTick(args: {
|
|
22
|
+
shouldGateProtectedApiCalls: boolean;
|
|
23
|
+
authSessionResolved: boolean;
|
|
24
|
+
authRequiredForApi: boolean;
|
|
25
|
+
isAuthenticated: boolean;
|
|
26
|
+
}): boolean;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export function deriveAuthGuardPolicy(inputs) {
|
|
2
|
+
const isCloudRuntime = inputs.runtimeMode === 'cloud';
|
|
3
|
+
const shouldDeferProtectedApiCalls = Boolean(inputs.shouldGateProtectedApiCalls && isCloudRuntime && !inputs.authSessionResolved);
|
|
4
|
+
const shouldBlockProtectedApiCalls = Boolean(inputs.shouldGateProtectedApiCalls
|
|
5
|
+
&& isCloudRuntime
|
|
6
|
+
&& inputs.authSessionResolved
|
|
7
|
+
&& inputs.authRequiredForApi
|
|
8
|
+
&& !inputs.isAuthenticated);
|
|
9
|
+
return {
|
|
10
|
+
shouldDeferProtectedApiCalls,
|
|
11
|
+
shouldBlockProtectedApiCalls,
|
|
12
|
+
canCallProtectedApi: !(shouldDeferProtectedApiCalls || shouldBlockProtectedApiCalls)
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export function shouldSkipDataVersionPolling(args) {
|
|
16
|
+
if (!args.isOpen)
|
|
17
|
+
return true;
|
|
18
|
+
if (!args.canCallProtectedApi)
|
|
19
|
+
return true;
|
|
20
|
+
if (args.authBlocked)
|
|
21
|
+
return true;
|
|
22
|
+
if (args.authRequiredForApi && !args.isAuthenticated)
|
|
23
|
+
return true;
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
export function shouldSkipDataVersionTick(args) {
|
|
27
|
+
if (args.shouldGateProtectedApiCalls && !args.authSessionResolved)
|
|
28
|
+
return true;
|
|
29
|
+
if (args.authRequiredForApi && !args.isAuthenticated)
|
|
30
|
+
return true;
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { deriveAuthGuardPolicy, shouldSkipDataVersionPolling, shouldSkipDataVersionTick } from './authGuardPolicy';
|
|
3
|
+
describe('authGuardPolicy', () => {
|
|
4
|
+
it('does not defer or block protected APIs in local runtime', () => {
|
|
5
|
+
const policy = deriveAuthGuardPolicy({
|
|
6
|
+
shouldGateProtectedApiCalls: true,
|
|
7
|
+
runtimeMode: 'local',
|
|
8
|
+
authSessionResolved: false,
|
|
9
|
+
authRequiredForApi: true,
|
|
10
|
+
isAuthenticated: false
|
|
11
|
+
});
|
|
12
|
+
expect(policy.shouldDeferProtectedApiCalls).toBe(false);
|
|
13
|
+
expect(policy.shouldBlockProtectedApiCalls).toBe(false);
|
|
14
|
+
expect(policy.canCallProtectedApi).toBe(true);
|
|
15
|
+
});
|
|
16
|
+
it('defers protected APIs in cloud runtime before auth session resolves', () => {
|
|
17
|
+
const policy = deriveAuthGuardPolicy({
|
|
18
|
+
shouldGateProtectedApiCalls: true,
|
|
19
|
+
runtimeMode: 'cloud',
|
|
20
|
+
authSessionResolved: false,
|
|
21
|
+
authRequiredForApi: false,
|
|
22
|
+
isAuthenticated: false
|
|
23
|
+
});
|
|
24
|
+
expect(policy.shouldDeferProtectedApiCalls).toBe(true);
|
|
25
|
+
expect(policy.shouldBlockProtectedApiCalls).toBe(false);
|
|
26
|
+
expect(policy.canCallProtectedApi).toBe(false);
|
|
27
|
+
});
|
|
28
|
+
it('blocks protected APIs in cloud runtime when auth is required but user is not authenticated', () => {
|
|
29
|
+
const policy = deriveAuthGuardPolicy({
|
|
30
|
+
shouldGateProtectedApiCalls: true,
|
|
31
|
+
runtimeMode: 'cloud',
|
|
32
|
+
authSessionResolved: true,
|
|
33
|
+
authRequiredForApi: true,
|
|
34
|
+
isAuthenticated: false
|
|
35
|
+
});
|
|
36
|
+
expect(policy.shouldDeferProtectedApiCalls).toBe(false);
|
|
37
|
+
expect(policy.shouldBlockProtectedApiCalls).toBe(true);
|
|
38
|
+
expect(policy.canCallProtectedApi).toBe(false);
|
|
39
|
+
});
|
|
40
|
+
it('keeps data-version polling active only when preconditions are met', () => {
|
|
41
|
+
expect(shouldSkipDataVersionPolling({
|
|
42
|
+
isOpen: true,
|
|
43
|
+
authBlocked: false,
|
|
44
|
+
authRequiredForApi: false,
|
|
45
|
+
isAuthenticated: false,
|
|
46
|
+
canCallProtectedApi: true
|
|
47
|
+
})).toBe(false);
|
|
48
|
+
expect(shouldSkipDataVersionPolling({
|
|
49
|
+
isOpen: false,
|
|
50
|
+
authBlocked: false,
|
|
51
|
+
authRequiredForApi: false,
|
|
52
|
+
isAuthenticated: false,
|
|
53
|
+
canCallProtectedApi: true
|
|
54
|
+
})).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
it('skips data-version tick checks until auth gate conditions are satisfied', () => {
|
|
57
|
+
expect(shouldSkipDataVersionTick({
|
|
58
|
+
shouldGateProtectedApiCalls: true,
|
|
59
|
+
authSessionResolved: false,
|
|
60
|
+
authRequiredForApi: false,
|
|
61
|
+
isAuthenticated: false
|
|
62
|
+
})).toBe(true);
|
|
63
|
+
expect(shouldSkipDataVersionTick({
|
|
64
|
+
shouldGateProtectedApiCalls: true,
|
|
65
|
+
authSessionResolved: true,
|
|
66
|
+
authRequiredForApi: true,
|
|
67
|
+
isAuthenticated: false
|
|
68
|
+
})).toBe(true);
|
|
69
|
+
expect(shouldSkipDataVersionTick({
|
|
70
|
+
shouldGateProtectedApiCalls: true,
|
|
71
|
+
authSessionResolved: true,
|
|
72
|
+
authRequiredForApi: true,
|
|
73
|
+
isAuthenticated: true
|
|
74
|
+
})).toBe(false);
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface Position {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
}
|
|
5
|
+
export declare function useDraggable(initialPosition?: Position): {
|
|
6
|
+
position: Position;
|
|
7
|
+
isDragging: boolean;
|
|
8
|
+
handleMouseDown: (e: React.MouseEvent) => void;
|
|
9
|
+
modalRef: import("react").RefObject<HTMLDivElement | null>;
|
|
10
|
+
setPosition: import("react").Dispatch<import("react").SetStateAction<Position>>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|