@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,60 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { afterEach, describe, it, expect } from 'vitest';
|
|
5
|
+
import { TaskforceCore } from './Taskforce';
|
|
6
|
+
function createProjectRoot(prefix = 'taskforce-created-by-') {
|
|
7
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
|
|
8
|
+
fs.writeFileSync(path.join(root, 'package.json'), JSON.stringify({ name: 'created-by-test' }), 'utf-8');
|
|
9
|
+
return root;
|
|
10
|
+
}
|
|
11
|
+
const createdRoots = [];
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
while (createdRoots.length > 0) {
|
|
14
|
+
const root = createdRoots.pop();
|
|
15
|
+
if (root && fs.existsSync(root)) {
|
|
16
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
describe('TaskforceCore - createdBy Field', () => {
|
|
21
|
+
it('populates createdBy field correctly on creation', () => {
|
|
22
|
+
const projectRoot = createProjectRoot();
|
|
23
|
+
createdRoots.push(projectRoot);
|
|
24
|
+
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
25
|
+
const task = core.createTask({
|
|
26
|
+
title: 'AI Task',
|
|
27
|
+
createdBy: 'AI Agent'
|
|
28
|
+
});
|
|
29
|
+
expect(task.createdBy).toBe('AI Agent');
|
|
30
|
+
});
|
|
31
|
+
it('defaults createdBy to undefined if not provided', () => {
|
|
32
|
+
const projectRoot = createProjectRoot();
|
|
33
|
+
createdRoots.push(projectRoot);
|
|
34
|
+
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
35
|
+
const task = core.createTask({ title: 'User Task' });
|
|
36
|
+
expect(task.createdBy).toBeUndefined();
|
|
37
|
+
});
|
|
38
|
+
it('infers assignee user from [User] title hint when assignee is missing', () => {
|
|
39
|
+
const projectRoot = createProjectRoot();
|
|
40
|
+
createdRoots.push(projectRoot);
|
|
41
|
+
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
42
|
+
const task = core.createTask({
|
|
43
|
+
title: '[User] Configure backups',
|
|
44
|
+
createdBy: 'AI Agent'
|
|
45
|
+
});
|
|
46
|
+
expect(task.assignee).toBe('user');
|
|
47
|
+
});
|
|
48
|
+
it('overrides unassigned with explicit owner hint for compatibility', () => {
|
|
49
|
+
const projectRoot = createProjectRoot();
|
|
50
|
+
createdRoots.push(projectRoot);
|
|
51
|
+
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
52
|
+
const task = core.createTask({
|
|
53
|
+
title: 'Configure alerts',
|
|
54
|
+
description: 'Owner: User',
|
|
55
|
+
assignee: 'unassigned',
|
|
56
|
+
createdBy: 'AI Agent'
|
|
57
|
+
});
|
|
58
|
+
expect(task.assignee).toBe('user');
|
|
59
|
+
});
|
|
60
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
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, TaskforceRuleError } from './Taskforce';
|
|
6
|
+
function makeProjectRoot() {
|
|
7
|
+
return fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-entitlements-'));
|
|
8
|
+
}
|
|
9
|
+
function openCore(projectRoot) {
|
|
10
|
+
return new TaskforceCore({
|
|
11
|
+
projectRoot,
|
|
12
|
+
storagePath: path.join(projectRoot, '.taskforce')
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
describe('Taskforce entitlements policy engine', () => {
|
|
16
|
+
it('counts active + invited + disabled seats and removal frees a seat', () => {
|
|
17
|
+
const projectRoot = makeProjectRoot();
|
|
18
|
+
const core = openCore(projectRoot);
|
|
19
|
+
try {
|
|
20
|
+
core.createWorkspace({ workspaceId: 'workspace-seat', name: 'Seat Workspace' });
|
|
21
|
+
core.ensureBootstrapUserAccess({
|
|
22
|
+
userId: 'owner-u1',
|
|
23
|
+
workspaceId: 'workspace-seat',
|
|
24
|
+
role: 'owner',
|
|
25
|
+
email: 'owner@example.com'
|
|
26
|
+
});
|
|
27
|
+
core.setUserAccountPlanMode('owner-u1', 'team');
|
|
28
|
+
core.ensureBootstrapUserAccess({
|
|
29
|
+
userId: 'member-u2',
|
|
30
|
+
workspaceId: 'workspace-seat',
|
|
31
|
+
role: 'member',
|
|
32
|
+
email: 'member2@example.com'
|
|
33
|
+
});
|
|
34
|
+
core.ensureBootstrapUserAccess({
|
|
35
|
+
userId: 'member-u3',
|
|
36
|
+
workspaceId: 'workspace-seat',
|
|
37
|
+
role: 'member',
|
|
38
|
+
email: 'member3@example.com'
|
|
39
|
+
});
|
|
40
|
+
core.setWorkspaceUserDisabled('member-u3', 'workspace-seat', true);
|
|
41
|
+
core.inviteWorkspaceUser({
|
|
42
|
+
workspaceId: 'workspace-seat',
|
|
43
|
+
email: 'invite4@example.com',
|
|
44
|
+
role: 'member'
|
|
45
|
+
});
|
|
46
|
+
const initial = core.countWorkspaceSeatUsage('workspace-seat', { includeInvited: true });
|
|
47
|
+
expect(initial.used).toBe(4);
|
|
48
|
+
expect(initial.limit).toBe(5);
|
|
49
|
+
expect(initial.remaining).toBe(1);
|
|
50
|
+
const inviteUser = core.listWorkspaceUsers('workspace-seat').find((item) => item.email === 'invite4@example.com');
|
|
51
|
+
expect(inviteUser?.status).toBe('invited');
|
|
52
|
+
core.removeWorkspaceUser(String(inviteUser?.userId || ''), 'workspace-seat');
|
|
53
|
+
const afterRemoval = core.countWorkspaceSeatUsage('workspace-seat', { includeInvited: true });
|
|
54
|
+
expect(afterRemoval.used).toBe(3);
|
|
55
|
+
expect(afterRemoval.remaining).toBe(2);
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
core.close();
|
|
59
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
it('blocks collaboration features when entitlement state is suspended', () => {
|
|
63
|
+
const projectRoot = makeProjectRoot();
|
|
64
|
+
const core = openCore(projectRoot);
|
|
65
|
+
try {
|
|
66
|
+
core.createWorkspace({ workspaceId: 'workspace-suspend', name: 'Suspend Workspace' });
|
|
67
|
+
core.ensureBootstrapUserAccess({
|
|
68
|
+
userId: 'owner-u1',
|
|
69
|
+
workspaceId: 'workspace-suspend',
|
|
70
|
+
role: 'owner',
|
|
71
|
+
email: 'owner@example.com'
|
|
72
|
+
});
|
|
73
|
+
core.setUserAccountPlanMode('owner-u1', 'team');
|
|
74
|
+
core.updateAccountEntitlement({
|
|
75
|
+
accountId: 'owner-u1',
|
|
76
|
+
entitlementState: 'suspended',
|
|
77
|
+
actorUserId: 'system-admin',
|
|
78
|
+
actorRole: 'system_admin'
|
|
79
|
+
});
|
|
80
|
+
const evaluation = core.evaluateFeatureAccess({
|
|
81
|
+
userId: 'owner-u1',
|
|
82
|
+
workspaceId: 'workspace-suspend',
|
|
83
|
+
featureKey: 'collaboration.invites'
|
|
84
|
+
});
|
|
85
|
+
expect(evaluation.allowed).toBe(false);
|
|
86
|
+
expect(evaluation.reasonCode).toBe('ENTITLEMENT_STATE_BLOCKED');
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
core.close();
|
|
90
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
it('enforces seat limits on invite path', () => {
|
|
94
|
+
const projectRoot = makeProjectRoot();
|
|
95
|
+
const core = openCore(projectRoot);
|
|
96
|
+
try {
|
|
97
|
+
core.createWorkspace({ workspaceId: 'workspace-cap', name: 'Cap Workspace' });
|
|
98
|
+
core.ensureBootstrapUserAccess({
|
|
99
|
+
userId: 'owner-u1',
|
|
100
|
+
workspaceId: 'workspace-cap',
|
|
101
|
+
role: 'owner',
|
|
102
|
+
email: 'owner@example.com'
|
|
103
|
+
});
|
|
104
|
+
core.createPlanVersion({
|
|
105
|
+
planId: 'team',
|
|
106
|
+
versionNumber: 2,
|
|
107
|
+
isDefault: false,
|
|
108
|
+
seatLimit: 2
|
|
109
|
+
});
|
|
110
|
+
core.updatePlanVersionFeatures({
|
|
111
|
+
planVersionId: 'team-v2',
|
|
112
|
+
features: [
|
|
113
|
+
{ featureKey: 'collaboration.invites', access: 'enabled' },
|
|
114
|
+
{ featureKey: 'collaboration.team_management', access: 'enabled' },
|
|
115
|
+
{ featureKey: 'collaboration.seat_limit', access: 'limited', config: { seat_limit: 2 } }
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
core.updateAccountEntitlement({
|
|
119
|
+
accountId: 'owner-u1',
|
|
120
|
+
planVersionId: 'team-v2',
|
|
121
|
+
entitlementState: 'active',
|
|
122
|
+
actorUserId: 'system-admin',
|
|
123
|
+
actorRole: 'system_admin'
|
|
124
|
+
});
|
|
125
|
+
core.ensureBootstrapUserAccess({
|
|
126
|
+
userId: 'member-u2',
|
|
127
|
+
workspaceId: 'workspace-cap',
|
|
128
|
+
role: 'member',
|
|
129
|
+
email: 'member2@example.com'
|
|
130
|
+
});
|
|
131
|
+
expect(() => {
|
|
132
|
+
core.inviteWorkspaceUser({
|
|
133
|
+
workspaceId: 'workspace-cap',
|
|
134
|
+
email: 'member3@example.com',
|
|
135
|
+
role: 'member'
|
|
136
|
+
});
|
|
137
|
+
}).toThrowError(TaskforceRuleError);
|
|
138
|
+
expect(() => core.assertSeatAvailable('workspace-cap')).toThrowError(TaskforceRuleError);
|
|
139
|
+
}
|
|
140
|
+
finally {
|
|
141
|
+
core.close();
|
|
142
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { describe, it, expect } 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 makeTempProjectRoot() {
|
|
7
|
+
return fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-initiative-'));
|
|
8
|
+
}
|
|
9
|
+
describe('TaskforceCore initiative templates', () => {
|
|
10
|
+
it('returns launch/migration/incident templates', () => {
|
|
11
|
+
const projectRoot = makeTempProjectRoot();
|
|
12
|
+
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
13
|
+
const templates = core.getInitiativeTemplates();
|
|
14
|
+
expect(templates.map(t => t.id)).toEqual(expect.arrayContaining(['launch', 'migration', 'incident']));
|
|
15
|
+
core.close();
|
|
16
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
17
|
+
});
|
|
18
|
+
it('creates initiative and milestone children from template', () => {
|
|
19
|
+
const projectRoot = makeTempProjectRoot();
|
|
20
|
+
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
21
|
+
const created = core.createInitiativeFromTemplate({
|
|
22
|
+
templateId: 'launch',
|
|
23
|
+
title: 'My Launch'
|
|
24
|
+
});
|
|
25
|
+
expect(created.initiative.id).toBeTruthy();
|
|
26
|
+
expect(created.milestones.length).toBeGreaterThan(0);
|
|
27
|
+
expect(created.milestones.every(m => m.parentTaskId === created.initiative.id)).toBe(true);
|
|
28
|
+
core.close();
|
|
29
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
30
|
+
});
|
|
31
|
+
it('clones checklist blocks to direct children in one action', () => {
|
|
32
|
+
const projectRoot = makeTempProjectRoot();
|
|
33
|
+
const core = new TaskforceCore({ projectRoot, storagePath: '.taskforce' });
|
|
34
|
+
const parent = core.createTask({ title: 'Parent' });
|
|
35
|
+
const childA = core.createTask({ title: 'Child A', parentTaskId: parent.id });
|
|
36
|
+
core.createTask({ title: 'Child B', parentTaskId: parent.id });
|
|
37
|
+
core.createTask({ title: 'Other Parent Child', parentTaskId: childA.id });
|
|
38
|
+
const result = core.cloneChecklistBlocksToChildren({
|
|
39
|
+
parentTaskId: parent.id,
|
|
40
|
+
checklistBlocks: {
|
|
41
|
+
definitionOfDone: ['Done A'],
|
|
42
|
+
rollbackPlan: ['Rollback A']
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
expect(result.updated).toBe(2);
|
|
46
|
+
expect(result.children.length).toBe(2);
|
|
47
|
+
core.close();
|
|
48
|
+
fs.rmSync(projectRoot, { recursive: true, force: true });
|
|
49
|
+
});
|
|
50
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { afterEach, describe, expect, it } from 'vitest';
|
|
5
|
+
import { TaskforceCore } from './Taskforce';
|
|
6
|
+
const roots = [];
|
|
7
|
+
function createCore() {
|
|
8
|
+
const projectRoot = fs.mkdtempSync(path.join(os.tmpdir(), 'taskforce-parent-lifecycle-'));
|
|
9
|
+
roots.push(projectRoot);
|
|
10
|
+
return new TaskforceCore({ projectRoot });
|
|
11
|
+
}
|
|
12
|
+
afterEach(() => {
|
|
13
|
+
while (roots.length > 0) {
|
|
14
|
+
const root = roots.pop();
|
|
15
|
+
if (root)
|
|
16
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
describe('TaskforceCore parent lifecycle', () => {
|
|
20
|
+
it('auto-completes parent chain when all descendants are terminal', () => {
|
|
21
|
+
const core = createCore();
|
|
22
|
+
const parent = core.createTask({ title: 'Parent', status: 'task' });
|
|
23
|
+
const child = core.createTask({ title: 'Child', parentTaskId: parent.id, status: 'task' });
|
|
24
|
+
const grandchild = core.createTask({ title: 'Grandchild', parentTaskId: child.id, status: 'task' });
|
|
25
|
+
const updatedGrandchild = core.updateTask(grandchild.id, { status: 'done' });
|
|
26
|
+
const updatedChild = core.getTask(child.id);
|
|
27
|
+
const updatedParent = core.getTask(parent.id);
|
|
28
|
+
expect(updatedGrandchild?.status).toBe('done');
|
|
29
|
+
expect(updatedChild?.status).toBe('done');
|
|
30
|
+
expect(updatedParent?.status).toBe('done');
|
|
31
|
+
core.close();
|
|
32
|
+
});
|
|
33
|
+
it('keeps parent open when any descendant remains open', () => {
|
|
34
|
+
const core = createCore();
|
|
35
|
+
const parent = core.createTask({ title: 'Parent', status: 'task' });
|
|
36
|
+
const doneChild = core.createTask({ title: 'Done Child', parentTaskId: parent.id, status: 'done' });
|
|
37
|
+
const openChild = core.createTask({ title: 'Open Child', parentTaskId: parent.id, status: 'task' });
|
|
38
|
+
const refreshedParent = core.getTask(parent.id);
|
|
39
|
+
expect(doneChild.status).toBe('done');
|
|
40
|
+
expect(openChild.status).toBe('task');
|
|
41
|
+
expect(refreshedParent?.status).toBe('task');
|
|
42
|
+
core.close();
|
|
43
|
+
});
|
|
44
|
+
it('reopens done parent when a new open descendant is added', () => {
|
|
45
|
+
const core = createCore();
|
|
46
|
+
const parent = core.createTask({ title: 'Parent', status: 'task' });
|
|
47
|
+
const child = core.createTask({ title: 'Child', parentTaskId: parent.id, status: 'task' });
|
|
48
|
+
core.updateTask(child.id, { status: 'done' });
|
|
49
|
+
expect(core.getTask(parent.id)?.status).toBe('done');
|
|
50
|
+
core.createTask({ title: 'New Child', parentTaskId: parent.id, status: 'task' });
|
|
51
|
+
expect(core.getTask(parent.id)?.status).toBe('task');
|
|
52
|
+
core.close();
|
|
53
|
+
});
|
|
54
|
+
it('does not reopen cancelled parent when open descendant is added', () => {
|
|
55
|
+
const core = createCore();
|
|
56
|
+
const parent = core.createTask({ title: 'Parent', status: 'task' });
|
|
57
|
+
core.updateTask(parent.id, { status: 'cancelled' });
|
|
58
|
+
core.createTask({ title: 'Child', parentTaskId: parent.id, status: 'task' });
|
|
59
|
+
expect(core.getTask(parent.id)?.status).toBe('cancelled');
|
|
60
|
+
core.close();
|
|
61
|
+
});
|
|
62
|
+
it('blocks manual done on parent tasks', () => {
|
|
63
|
+
const core = createCore();
|
|
64
|
+
const parent = core.createTask({ title: 'Parent', status: 'task' });
|
|
65
|
+
core.createTask({ title: 'Child', parentTaskId: parent.id, status: 'task' });
|
|
66
|
+
expect(() => core.updateTask(parent.id, { status: 'done' })).toThrow(/Parent tasks cannot be marked done manually/);
|
|
67
|
+
core.close();
|
|
68
|
+
});
|
|
69
|
+
it('cancels open descendants in cascade mode', () => {
|
|
70
|
+
const core = createCore();
|
|
71
|
+
const parent = core.createTask({ title: 'Parent', status: 'task' });
|
|
72
|
+
const child = core.createTask({ title: 'Child', parentTaskId: parent.id, status: 'task' });
|
|
73
|
+
const grandchild = core.createTask({ title: 'Grandchild', parentTaskId: child.id, status: 'task' });
|
|
74
|
+
const cancelledParent = core.cancelParentWithOpenDescendants(parent.id, { mode: 'cascade', reason: 'No longer needed' });
|
|
75
|
+
const refreshedChild = core.getTask(child.id);
|
|
76
|
+
const refreshedGrandchild = core.getTask(grandchild.id);
|
|
77
|
+
expect(cancelledParent?.status).toBe('cancelled');
|
|
78
|
+
expect(cancelledParent?.canceledReason).toBe('No longer needed');
|
|
79
|
+
expect(refreshedChild?.status).toBe('cancelled');
|
|
80
|
+
expect(refreshedGrandchild?.status).toBe('cancelled');
|
|
81
|
+
core.close();
|
|
82
|
+
});
|
|
83
|
+
it('unlinks open descendants in unlink mode and cancels only parent', () => {
|
|
84
|
+
const core = createCore();
|
|
85
|
+
const parent = core.createTask({ title: 'Parent', status: 'task' });
|
|
86
|
+
const child = core.createTask({ title: 'Child', parentTaskId: parent.id, status: 'task' });
|
|
87
|
+
const grandchild = core.createTask({ title: 'Grandchild', parentTaskId: child.id, status: 'task' });
|
|
88
|
+
const cancelledParent = core.cancelParentWithOpenDescendants(parent.id, { mode: 'unlink', reason: 'No longer needed' });
|
|
89
|
+
const refreshedChild = core.getTask(child.id);
|
|
90
|
+
const refreshedGrandchild = core.getTask(grandchild.id);
|
|
91
|
+
expect(cancelledParent?.status).toBe('cancelled');
|
|
92
|
+
expect(refreshedChild?.status).toBe('task');
|
|
93
|
+
expect(refreshedGrandchild?.status).toBe('task');
|
|
94
|
+
expect(refreshedChild?.parentTaskId).toBeNull();
|
|
95
|
+
expect(refreshedGrandchild?.parentTaskId).toBeNull();
|
|
96
|
+
core.close();
|
|
97
|
+
});
|
|
98
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import os from 'os';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import Database from 'better-sqlite3';
|
|
5
|
+
import { afterEach, describe, expect, it } from 'vitest';
|
|
6
|
+
import { TaskforceCore } from './Taskforce';
|
|
7
|
+
const roots = [];
|
|
8
|
+
function makeRoot(prefix) {
|
|
9
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), prefix));
|
|
10
|
+
roots.push(root);
|
|
11
|
+
return root;
|
|
12
|
+
}
|
|
13
|
+
function localDateOffset(days) {
|
|
14
|
+
const date = new Date();
|
|
15
|
+
date.setDate(date.getDate() + days);
|
|
16
|
+
const year = date.getFullYear();
|
|
17
|
+
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
18
|
+
const day = String(date.getDate()).padStart(2, '0');
|
|
19
|
+
return `${year}-${month}-${day}`;
|
|
20
|
+
}
|
|
21
|
+
afterEach(() => {
|
|
22
|
+
while (roots.length > 0) {
|
|
23
|
+
const root = roots.pop();
|
|
24
|
+
if (root)
|
|
25
|
+
fs.rmSync(root, { recursive: true, force: true });
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
describe('TaskforceCore schedule fields', () => {
|
|
29
|
+
it('persists and reads schedule fields on create/update', () => {
|
|
30
|
+
const projectRoot = makeRoot('taskforce-schedule-fields-');
|
|
31
|
+
const core = new TaskforceCore({ projectRoot });
|
|
32
|
+
const created = core.createTask({
|
|
33
|
+
title: 'Schedule Roundtrip',
|
|
34
|
+
scheduledDate: '2026-02-16',
|
|
35
|
+
dueDate: '2026-02-15',
|
|
36
|
+
scheduledWeekKey: '2026-W08',
|
|
37
|
+
orderInDay: 2
|
|
38
|
+
});
|
|
39
|
+
expect(created.scheduledDate).toBe('2026-02-16');
|
|
40
|
+
expect(created.dueDate).toBe('2026-02-15');
|
|
41
|
+
expect(created.scheduledWeekKey).toBe('2026-W08');
|
|
42
|
+
expect(created.orderInDay).toBe(2);
|
|
43
|
+
const updated = core.updateTask(created.id, {
|
|
44
|
+
scheduledDate: 'invalid-date',
|
|
45
|
+
orderInDay: -5,
|
|
46
|
+
dueDate: null
|
|
47
|
+
});
|
|
48
|
+
expect(updated?.scheduledDate).toBeNull();
|
|
49
|
+
expect(updated?.orderInDay).toBeNull();
|
|
50
|
+
expect(updated?.dueDate).toBeNull();
|
|
51
|
+
core.close();
|
|
52
|
+
});
|
|
53
|
+
it('normalizes blocked status alias to on-hold', () => {
|
|
54
|
+
const projectRoot = makeRoot('taskforce-status-alias-');
|
|
55
|
+
const core = new TaskforceCore({ projectRoot });
|
|
56
|
+
const created = core.createTask({
|
|
57
|
+
title: 'Blocked alias',
|
|
58
|
+
status: 'blocked'
|
|
59
|
+
});
|
|
60
|
+
expect(created.status).toBe('on-hold');
|
|
61
|
+
const updated = core.updateTask(created.id, { status: 'blocked' });
|
|
62
|
+
expect(updated?.status).toBe('on-hold');
|
|
63
|
+
core.close();
|
|
64
|
+
});
|
|
65
|
+
it('migrates existing database schema with schedule columns', () => {
|
|
66
|
+
const projectRoot = makeRoot('taskforce-schedule-schema-');
|
|
67
|
+
const storageRoot = path.join(projectRoot, '.taskforce');
|
|
68
|
+
fs.mkdirSync(storageRoot, { recursive: true });
|
|
69
|
+
const dbPath = path.join(storageRoot, 'taskforce.db');
|
|
70
|
+
const legacyDb = new Database(dbPath);
|
|
71
|
+
legacyDb.exec(`
|
|
72
|
+
CREATE TABLE IF NOT EXISTS tasks (
|
|
73
|
+
id TEXT PRIMARY KEY,
|
|
74
|
+
title TEXT NOT NULL,
|
|
75
|
+
description TEXT,
|
|
76
|
+
status TEXT NOT NULL,
|
|
77
|
+
priority INTEGER DEFAULT 2,
|
|
78
|
+
complexity INTEGER DEFAULT 3,
|
|
79
|
+
type TEXT DEFAULT 'feature',
|
|
80
|
+
category TEXT DEFAULT 'general',
|
|
81
|
+
approach TEXT,
|
|
82
|
+
created_at TEXT NOT NULL,
|
|
83
|
+
updated_at TEXT,
|
|
84
|
+
completed_at TEXT,
|
|
85
|
+
canceled_reason TEXT,
|
|
86
|
+
is_archived BOOLEAN DEFAULT 0,
|
|
87
|
+
specialists TEXT,
|
|
88
|
+
taxonomies TEXT,
|
|
89
|
+
created_by TEXT
|
|
90
|
+
);
|
|
91
|
+
`);
|
|
92
|
+
legacyDb.close();
|
|
93
|
+
const core = new TaskforceCore({ projectRoot });
|
|
94
|
+
core.close();
|
|
95
|
+
const upgradedDb = new Database(dbPath, { readonly: true });
|
|
96
|
+
const columns = upgradedDb.prepare(`PRAGMA table_info(tasks)`).all();
|
|
97
|
+
upgradedDb.close();
|
|
98
|
+
const names = new Set(columns.map((c) => c.name));
|
|
99
|
+
expect(names.has('scheduled_date')).toBe(true);
|
|
100
|
+
expect(names.has('due_date')).toBe(true);
|
|
101
|
+
expect(names.has('scheduled_week_key')).toBe(true);
|
|
102
|
+
expect(names.has('order_in_day')).toBe(true);
|
|
103
|
+
});
|
|
104
|
+
it('blocks scheduling parent tasks and surfaces expired bucket', () => {
|
|
105
|
+
const projectRoot = makeRoot('taskforce-schedule-rules-');
|
|
106
|
+
const core = new TaskforceCore({ projectRoot });
|
|
107
|
+
const parent = core.createTask({ title: 'Parent', status: 'task' });
|
|
108
|
+
const child = core.createTask({ title: 'Child', parentTaskId: parent.id, status: 'task' });
|
|
109
|
+
expect(() => {
|
|
110
|
+
core.updateTaskSchedule(parent.id, { scheduledDate: localDateOffset(1), orderInDay: 0 });
|
|
111
|
+
}).toThrowError(/Only leaf tasks can be scheduled/);
|
|
112
|
+
const scheduled = core.updateTaskSchedule(child.id, { scheduledDate: localDateOffset(-1), orderInDay: 0 });
|
|
113
|
+
expect(scheduled?.task.scheduledDate).toBe(localDateOffset(-1));
|
|
114
|
+
const currentWeek = core.getScheduleBoard(`${new Date().getFullYear()}-W01`);
|
|
115
|
+
expect(Array.isArray(currentWeek.columns.expired)).toBe(true);
|
|
116
|
+
expect(currentWeek.columns.expired.some((task) => task.id === child.id)).toBe(true);
|
|
117
|
+
core.close();
|
|
118
|
+
});
|
|
119
|
+
it('returns schedule board day columns sorted by orderInDay', () => {
|
|
120
|
+
const projectRoot = makeRoot('taskforce-schedule-order-');
|
|
121
|
+
const core = new TaskforceCore({ projectRoot });
|
|
122
|
+
const date = localDateOffset(1);
|
|
123
|
+
const t1 = core.createTask({ title: 'A', scheduledDate: date, orderInDay: 2, status: 'task' });
|
|
124
|
+
const t2 = core.createTask({ title: 'B', scheduledDate: date, orderInDay: 0, status: 'task' });
|
|
125
|
+
const t3 = core.createTask({ title: 'C', scheduledDate: date, orderInDay: 1, status: 'task' });
|
|
126
|
+
const weekKey = t1.scheduledWeekKey || '';
|
|
127
|
+
expect(weekKey).toMatch(/^\d{4}-W\d{2}$/);
|
|
128
|
+
const board = core.getScheduleBoard(weekKey, true);
|
|
129
|
+
const dayKey = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'].find((key) => board.columns[key]?.some((task) => task.id === t1.id));
|
|
130
|
+
expect(dayKey).toBeTruthy();
|
|
131
|
+
const ids = (board.columns[dayKey] || []).map((task) => task.id);
|
|
132
|
+
expect(ids).toEqual([t2.id, t3.id, t1.id]);
|
|
133
|
+
core.close();
|
|
134
|
+
});
|
|
135
|
+
it('allows non-schedule updates on tasks with children even if legacy scheduledDate exists', () => {
|
|
136
|
+
const projectRoot = makeRoot('taskforce-schedule-non-schedule-update-');
|
|
137
|
+
const core = new TaskforceCore({ projectRoot });
|
|
138
|
+
const parent = core.createTask({ title: 'Top Parent', status: 'task' });
|
|
139
|
+
const middle = core.createTask({
|
|
140
|
+
title: 'Middle',
|
|
141
|
+
status: 'task',
|
|
142
|
+
scheduledDate: localDateOffset(1),
|
|
143
|
+
parentTaskId: parent.id
|
|
144
|
+
});
|
|
145
|
+
core.createTask({ title: 'Leaf', parentTaskId: middle.id, status: 'task' });
|
|
146
|
+
// Non-schedule mutations should remain allowed so users can repair hierarchy links.
|
|
147
|
+
const updated = core.updateTask(middle.id, { parentTaskId: null });
|
|
148
|
+
expect(updated?.parentTaskId).toBeNull();
|
|
149
|
+
expect(updated?.scheduledDate).toBe(localDateOffset(1));
|
|
150
|
+
core.close();
|
|
151
|
+
});
|
|
152
|
+
it('persists explicit order updates for unscheduled backlog tasks', () => {
|
|
153
|
+
const projectRoot = makeRoot('taskforce-backlog-order-');
|
|
154
|
+
const core = new TaskforceCore({ projectRoot });
|
|
155
|
+
const a = core.createTask({ title: 'Backlog A', status: 'task' });
|
|
156
|
+
const b = core.createTask({ title: 'Backlog B', status: 'task' });
|
|
157
|
+
const updatedA = core.updateTask(a.id, { orderInDay: 1 });
|
|
158
|
+
const updatedB = core.updateTask(b.id, { orderInDay: 0 });
|
|
159
|
+
expect(updatedA?.scheduledDate).toBeNull();
|
|
160
|
+
expect(updatedB?.scheduledDate).toBeNull();
|
|
161
|
+
expect(updatedA?.orderInDay).toBe(1);
|
|
162
|
+
expect(updatedB?.orderInDay).toBe(0);
|
|
163
|
+
const list = core.listTasks().tasks.filter((t) => t.id === a.id || t.id === b.id);
|
|
164
|
+
const byId = new Map(list.map((t) => [t.id, t]));
|
|
165
|
+
expect(byId.get(a.id)?.orderInDay).toBe(1);
|
|
166
|
+
expect(byId.get(b.id)?.orderInDay).toBe(0);
|
|
167
|
+
core.close();
|
|
168
|
+
});
|
|
169
|
+
it('persists schedule preferences in global settings', () => {
|
|
170
|
+
const projectRoot = makeRoot('taskforce-schedule-prefs-');
|
|
171
|
+
const fakeHome = makeRoot('taskforce-home-');
|
|
172
|
+
const previousHome = process.env.HOME;
|
|
173
|
+
process.env.HOME = fakeHome;
|
|
174
|
+
try {
|
|
175
|
+
const core = new TaskforceCore({ projectRoot });
|
|
176
|
+
core.updateGlobalSettings({
|
|
177
|
+
schedulePreferences: {
|
|
178
|
+
showWeekends: true,
|
|
179
|
+
isCalendarSidebarOpen: false,
|
|
180
|
+
dailyCapacity: {
|
|
181
|
+
monday: 8,
|
|
182
|
+
friday: 5
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
const updated = core.getGlobalSettings();
|
|
187
|
+
expect(updated.schedulePreferences?.showWeekends).toBe(true);
|
|
188
|
+
expect(updated.schedulePreferences?.isCalendarSidebarOpen).toBe(false);
|
|
189
|
+
expect(updated.schedulePreferences?.dailyCapacity?.monday).toBe(8);
|
|
190
|
+
expect(updated.schedulePreferences?.dailyCapacity?.friday).toBe(5);
|
|
191
|
+
core.close();
|
|
192
|
+
}
|
|
193
|
+
finally {
|
|
194
|
+
process.env.HOME = previousHome;
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|