@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,30 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { validateStructuredDocForAttach } from '../mcp/structuredDocValidation';
|
|
3
|
+
describe('structured doc attach validation', () => {
|
|
4
|
+
it('passes non-structured paths', () => {
|
|
5
|
+
const result = validateStructuredDocForAttach('notes/random.md', '# anything');
|
|
6
|
+
expect(result).toEqual({ ok: true });
|
|
7
|
+
});
|
|
8
|
+
it('passes evaluation docs with all required headings', () => {
|
|
9
|
+
const content = [
|
|
10
|
+
'## Evaluation Summary',
|
|
11
|
+
'### Recommendation (Proceed | Pivot | Kill)',
|
|
12
|
+
'### Value Score (1-5)',
|
|
13
|
+
'### Risk Score (1-5)',
|
|
14
|
+
'### Alternatives Considered',
|
|
15
|
+
'### Key Tradeoffs',
|
|
16
|
+
'### Next Step'
|
|
17
|
+
].join('\n');
|
|
18
|
+
const result = validateStructuredDocForAttach('.taskforce/task-data/task-1/evaluations/evaluation.md', content);
|
|
19
|
+
expect(result).toEqual({ ok: true });
|
|
20
|
+
});
|
|
21
|
+
it('fails review docs missing required headings', () => {
|
|
22
|
+
const content = ['## Review Verdict', '### Findings'].join('\n');
|
|
23
|
+
const result = validateStructuredDocForAttach('.taskforce/task-data/task-1/reviews/review.md', content);
|
|
24
|
+
expect(result.ok).toBe(false);
|
|
25
|
+
if (!result.ok) {
|
|
26
|
+
expect(result.message).toContain('### Verdict (PASS | WARN | FAIL)');
|
|
27
|
+
expect(result.message).toContain('### Regression Risks');
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
|
2
|
+
import { TemplateEngine } from '../services/templateEngine';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
// Explicitly mock fs
|
|
5
|
+
vi.mock('fs', () => ({
|
|
6
|
+
default: {
|
|
7
|
+
existsSync: vi.fn(),
|
|
8
|
+
readFileSync: vi.fn()
|
|
9
|
+
},
|
|
10
|
+
existsSync: vi.fn(),
|
|
11
|
+
readFileSync: vi.fn()
|
|
12
|
+
}));
|
|
13
|
+
// Mock formatTransformers
|
|
14
|
+
vi.mock('../services/formatTransformers', () => ({
|
|
15
|
+
formatTransformers: {
|
|
16
|
+
toToml: (content, metadata) => `prompt = """${content}"""\ndescription = "${metadata.description}"`,
|
|
17
|
+
toMarkdown: (content) => content
|
|
18
|
+
}
|
|
19
|
+
}));
|
|
20
|
+
describe('TemplateEngine', () => {
|
|
21
|
+
let engine;
|
|
22
|
+
beforeEach(() => {
|
|
23
|
+
vi.resetAllMocks();
|
|
24
|
+
// Inject a mock base directory
|
|
25
|
+
engine = new TemplateEngine('/templates');
|
|
26
|
+
});
|
|
27
|
+
it('should load and process a template with default content', () => {
|
|
28
|
+
const mockTemplate = `
|
|
29
|
+
name: test-workflow
|
|
30
|
+
description: Test Description
|
|
31
|
+
type: workflow
|
|
32
|
+
content:
|
|
33
|
+
default: |
|
|
34
|
+
# Test Workflow
|
|
35
|
+
Step 1
|
|
36
|
+
`;
|
|
37
|
+
const mockEnv = `
|
|
38
|
+
id: test-env
|
|
39
|
+
name: Test Env
|
|
40
|
+
workflows:
|
|
41
|
+
directory: .test/workflows
|
|
42
|
+
format: markdown
|
|
43
|
+
filenamePattern: "{name}.md"
|
|
44
|
+
mcp:
|
|
45
|
+
prefix: "mcp_"
|
|
46
|
+
`;
|
|
47
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
48
|
+
vi.mocked(fs.readFileSync).mockImplementation((filePath) => {
|
|
49
|
+
const p = filePath.toString();
|
|
50
|
+
// path.join might use platform specific separators, normalize for check
|
|
51
|
+
if (p.includes('test-workflow.yaml'))
|
|
52
|
+
return mockTemplate;
|
|
53
|
+
if (p.includes('test-env.yaml'))
|
|
54
|
+
return mockEnv;
|
|
55
|
+
return '';
|
|
56
|
+
});
|
|
57
|
+
const result = engine.processTemplate('test-workflow', 'test-env');
|
|
58
|
+
expect(result.filename).toBe('test-workflow.md');
|
|
59
|
+
expect(result.content).toContain('# Test Workflow');
|
|
60
|
+
});
|
|
61
|
+
it('should substitute variables', () => {
|
|
62
|
+
const mockTemplate = `
|
|
63
|
+
name: vars-workflow
|
|
64
|
+
description: Desc
|
|
65
|
+
type: workflow
|
|
66
|
+
content:
|
|
67
|
+
default: "Run {{MCP_PREFIX}}command with {{CUSTOM_VAR}}"
|
|
68
|
+
`;
|
|
69
|
+
const mockEnv = `
|
|
70
|
+
id: env-1
|
|
71
|
+
name: Env 1
|
|
72
|
+
workflows:
|
|
73
|
+
directory: .dir
|
|
74
|
+
format: markdown
|
|
75
|
+
filenamePattern: "{name}.md"
|
|
76
|
+
mcp:
|
|
77
|
+
prefix: "my_prefix_"
|
|
78
|
+
`;
|
|
79
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
80
|
+
vi.mocked(fs.readFileSync).mockImplementation((filePath) => {
|
|
81
|
+
const p = filePath.toString();
|
|
82
|
+
if (p.includes('vars-workflow.yaml'))
|
|
83
|
+
return mockTemplate;
|
|
84
|
+
if (p.includes('env-1.yaml'))
|
|
85
|
+
return mockEnv;
|
|
86
|
+
return '';
|
|
87
|
+
});
|
|
88
|
+
const result = engine.processTemplate('vars-workflow', 'env-1', { CUSTOM_VAR: 'custom_value' });
|
|
89
|
+
expect(result.content).toBe('Run my_prefix_command with custom_value');
|
|
90
|
+
});
|
|
91
|
+
it('should use environment-specific content if available', () => {
|
|
92
|
+
const mockTemplate = `
|
|
93
|
+
name: multi-env
|
|
94
|
+
description: Desc
|
|
95
|
+
type: workflow
|
|
96
|
+
content:
|
|
97
|
+
default: "Default Content"
|
|
98
|
+
special-env: "Special Content"
|
|
99
|
+
`;
|
|
100
|
+
const mockEnv = `
|
|
101
|
+
id: special-env
|
|
102
|
+
name: Special Env
|
|
103
|
+
workflows:
|
|
104
|
+
directory: .dir
|
|
105
|
+
format: markdown
|
|
106
|
+
filenamePattern: "{name}.md"
|
|
107
|
+
`;
|
|
108
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
109
|
+
vi.mocked(fs.readFileSync).mockImplementation((filePath) => {
|
|
110
|
+
const p = filePath.toString();
|
|
111
|
+
if (p.includes('multi-env.yaml'))
|
|
112
|
+
return mockTemplate;
|
|
113
|
+
if (p.includes('special-env.yaml'))
|
|
114
|
+
return mockEnv;
|
|
115
|
+
return '';
|
|
116
|
+
});
|
|
117
|
+
const result = engine.processTemplate('multi-env', 'special-env');
|
|
118
|
+
expect(result.content).toBe('Special Content');
|
|
119
|
+
});
|
|
120
|
+
it('should apply TOML transformation', () => {
|
|
121
|
+
const mockTemplate = `
|
|
122
|
+
name: toml-test
|
|
123
|
+
description: My Description
|
|
124
|
+
type: workflow
|
|
125
|
+
content:
|
|
126
|
+
default: "Simple Content"
|
|
127
|
+
`;
|
|
128
|
+
const mockEnv = `
|
|
129
|
+
id: gemini
|
|
130
|
+
name: Gemini
|
|
131
|
+
workflows:
|
|
132
|
+
directory: .gemini
|
|
133
|
+
format: toml
|
|
134
|
+
filenamePattern: "{name}.toml"
|
|
135
|
+
`;
|
|
136
|
+
vi.mocked(fs.existsSync).mockReturnValue(true);
|
|
137
|
+
vi.mocked(fs.readFileSync).mockImplementation((filePath) => {
|
|
138
|
+
const p = filePath.toString();
|
|
139
|
+
if (p.includes('toml-test.yaml'))
|
|
140
|
+
return mockTemplate;
|
|
141
|
+
if (p.includes('gemini.yaml'))
|
|
142
|
+
return mockEnv;
|
|
143
|
+
return '';
|
|
144
|
+
});
|
|
145
|
+
const result = engine.processTemplate('toml-test', 'gemini');
|
|
146
|
+
expect(result.filename).toBe('toml-test.toml');
|
|
147
|
+
expect(result.content).toContain('prompt = """Simple Content"""');
|
|
148
|
+
expect(result.content).toContain('description = "My Description"');
|
|
149
|
+
});
|
|
150
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { TemplateEngine } from '../services/templateEngine';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
// Compute the real path to templates
|
|
7
|
+
// src/__tests__/templates.test.ts -> src/resources/templates
|
|
8
|
+
const realTemplatesDir = path.resolve(__dirname, '../resources/templates');
|
|
9
|
+
describe('Workflow Templates Integration', () => {
|
|
10
|
+
const engine = new TemplateEngine(realTemplatesDir);
|
|
11
|
+
// Workflows that use MCP tools
|
|
12
|
+
const mcpWorkflows = ['do', 'execute', 'plan', 'evaluate', 'collaborate', 'review'];
|
|
13
|
+
mcpWorkflows.forEach(name => {
|
|
14
|
+
it(`should successfully load and process '${name}' template`, () => {
|
|
15
|
+
// 1. Load raw template
|
|
16
|
+
const template = engine.loadTemplate(name);
|
|
17
|
+
expect(template.name).toBe(name);
|
|
18
|
+
expect(template.content.default).toBeDefined();
|
|
19
|
+
expect(template.content.default.length).toBeGreaterThan(10);
|
|
20
|
+
// 2. Process for Antigravity (Markdown)
|
|
21
|
+
// Note: Environment config dictates MCP_PREFIX, so we expect the one from antigravity.yaml
|
|
22
|
+
const mdResult = engine.processTemplate(name, 'antigravity');
|
|
23
|
+
expect(mdResult.filename).toBe(`${name}.md`);
|
|
24
|
+
expect(mdResult.content).toContain('mcp_taskforce-taskforce_'); // default prefix
|
|
25
|
+
// 3. Process for Gemini (TOML)
|
|
26
|
+
const tomlResult = engine.processTemplate(name, 'gemini');
|
|
27
|
+
expect(tomlResult.filename).toBe(`${name}.toml`);
|
|
28
|
+
expect(tomlResult.content).toContain('prompt = """');
|
|
29
|
+
expect(tomlResult.content).toContain('description = "');
|
|
30
|
+
expect(tomlResult.content).toContain('mcp_taskforce-taskforce_');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
// Release workflow template was removed; build identity is now metadata-driven.
|
|
34
|
+
it('codex environment routes do workflow into AGENTS.md via inject override', () => {
|
|
35
|
+
const result = engine.processTemplate('do', 'codex');
|
|
36
|
+
expect(result.filename).toBe('AGENTS.md');
|
|
37
|
+
expect(result.strategy).toBe('inject');
|
|
38
|
+
expect(result.content).toContain('mcp_taskforce-taskforce_');
|
|
39
|
+
});
|
|
40
|
+
it('sanitizes invalid projectName characters in MCP prefix variables', () => {
|
|
41
|
+
const result = engine.processTemplate('do', 'codex', { projectName: '@taskforcehq/taskforce' });
|
|
42
|
+
expect(result.content).toContain('mcp_taskforce-taskforcehq-taskforce_');
|
|
43
|
+
expect(result.content).not.toContain('mcp_taskforce-@taskforcehq/taskforce_');
|
|
44
|
+
});
|
|
45
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { validateStructuredDocForAttach } from '../mcp/structuredDocValidation';
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const fixturesDir = path.resolve(__dirname, 'fixtures/workflow-docs');
|
|
8
|
+
function assertOrderedAndNonEmpty(content, headings) {
|
|
9
|
+
let cursor = 0;
|
|
10
|
+
for (let i = 0; i < headings.length; i++) {
|
|
11
|
+
const heading = headings[i];
|
|
12
|
+
const start = content.indexOf(heading, cursor);
|
|
13
|
+
expect(start, `Missing heading: ${heading}`).toBeGreaterThanOrEqual(0);
|
|
14
|
+
const nextHeading = headings[i + 1];
|
|
15
|
+
const end = nextHeading ? content.indexOf(nextHeading, start + heading.length) : content.length;
|
|
16
|
+
const body = content.slice(start + heading.length, end >= 0 ? end : content.length).trim();
|
|
17
|
+
if (heading.startsWith('### ')) {
|
|
18
|
+
expect(body.length, `Section body is empty for: ${heading}`).toBeGreaterThan(0);
|
|
19
|
+
}
|
|
20
|
+
cursor = start + heading.length;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
describe('Workflow document fixtures', () => {
|
|
24
|
+
it('sample implementation plan is complete and valid for attach', () => {
|
|
25
|
+
const relativePath = '.taskforce/task-data/task-1/implementation_plans/implementation-plan.md';
|
|
26
|
+
const content = fs.readFileSync(path.join(fixturesDir, 'sample-implementation-plan.md'), 'utf8');
|
|
27
|
+
expect(validateStructuredDocForAttach(relativePath, content)).toEqual({ ok: true });
|
|
28
|
+
assertOrderedAndNonEmpty(content, [
|
|
29
|
+
'## Implementation Plan',
|
|
30
|
+
'### Goal',
|
|
31
|
+
'### Change Plan',
|
|
32
|
+
'### Risk Analysis',
|
|
33
|
+
'### Verification Checklist'
|
|
34
|
+
]);
|
|
35
|
+
});
|
|
36
|
+
it('sample evaluation is complete and valid for attach', () => {
|
|
37
|
+
const relativePath = '.taskforce/task-data/task-1/evaluations/evaluation.md';
|
|
38
|
+
const content = fs.readFileSync(path.join(fixturesDir, 'sample-evaluation.md'), 'utf8');
|
|
39
|
+
expect(validateStructuredDocForAttach(relativePath, content)).toEqual({ ok: true });
|
|
40
|
+
assertOrderedAndNonEmpty(content, [
|
|
41
|
+
'## Evaluation Summary',
|
|
42
|
+
'### Recommendation (Proceed | Pivot | Kill)',
|
|
43
|
+
'### Value Score (1-5)',
|
|
44
|
+
'### Risk Score (1-5)',
|
|
45
|
+
'### Alternatives Considered',
|
|
46
|
+
'### Key Tradeoffs',
|
|
47
|
+
'### Next Step'
|
|
48
|
+
]);
|
|
49
|
+
});
|
|
50
|
+
it('sample review is complete and valid for attach', () => {
|
|
51
|
+
const relativePath = '.taskforce/task-data/task-1/reviews/review.md';
|
|
52
|
+
const content = fs.readFileSync(path.join(fixturesDir, 'sample-review.md'), 'utf8');
|
|
53
|
+
expect(validateStructuredDocForAttach(relativePath, content)).toEqual({ ok: true });
|
|
54
|
+
assertOrderedAndNonEmpty(content, [
|
|
55
|
+
'## Review Verdict',
|
|
56
|
+
'### Verdict (PASS | WARN | FAIL)',
|
|
57
|
+
'### Findings',
|
|
58
|
+
'### Regression Risks',
|
|
59
|
+
'### Required Fixes',
|
|
60
|
+
'### Recommended Next Status'
|
|
61
|
+
]);
|
|
62
|
+
});
|
|
63
|
+
it('sample collaboration blueprint is complete and valid for attach', () => {
|
|
64
|
+
const relativePath = '.taskforce/task-data/task-1/collaborations/collaboration-blueprint.md';
|
|
65
|
+
const content = fs.readFileSync(path.join(fixturesDir, 'sample-collaboration-blueprint.md'), 'utf8');
|
|
66
|
+
expect(validateStructuredDocForAttach(relativePath, content)).toEqual({ ok: true });
|
|
67
|
+
assertOrderedAndNonEmpty(content, [
|
|
68
|
+
'## Collaboration Blueprint',
|
|
69
|
+
'### Problem Statement',
|
|
70
|
+
'### Constraints',
|
|
71
|
+
'### Proposed Architecture',
|
|
72
|
+
'### Must-Haves',
|
|
73
|
+
'### Non-Goals',
|
|
74
|
+
'### Risks & Open Questions',
|
|
75
|
+
'### Recommended Next Step'
|
|
76
|
+
]);
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { TemplateEngine } from '../services/templateEngine';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const templatesDir = path.resolve(__dirname, '../resources/templates');
|
|
8
|
+
const engine = new TemplateEngine(templatesDir);
|
|
9
|
+
const workflowNames = ['do', 'execute', 'plan', 'evaluate', 'collaborate', 'review'];
|
|
10
|
+
const contractHeadings = {
|
|
11
|
+
plan: [
|
|
12
|
+
'## Implementation Plan',
|
|
13
|
+
'### Goal',
|
|
14
|
+
'### Change Plan',
|
|
15
|
+
'### Risk Analysis',
|
|
16
|
+
'### Verification Checklist'
|
|
17
|
+
],
|
|
18
|
+
collaborate: [
|
|
19
|
+
'## Collaboration Blueprint',
|
|
20
|
+
'### Problem Statement',
|
|
21
|
+
'### Constraints',
|
|
22
|
+
'### Proposed Architecture',
|
|
23
|
+
'### Must-Haves',
|
|
24
|
+
'### Non-Goals',
|
|
25
|
+
'### Risks & Open Questions',
|
|
26
|
+
'### Recommended Next Step'
|
|
27
|
+
],
|
|
28
|
+
evaluate: [
|
|
29
|
+
'## Evaluation Summary',
|
|
30
|
+
'### Recommendation (Proceed | Pivot | Kill)',
|
|
31
|
+
'### Value Score (1-5)',
|
|
32
|
+
'### Risk Score (1-5)',
|
|
33
|
+
'### Alternatives Considered',
|
|
34
|
+
'### Key Tradeoffs',
|
|
35
|
+
'### Next Step'
|
|
36
|
+
],
|
|
37
|
+
review: [
|
|
38
|
+
'## Review Verdict',
|
|
39
|
+
'### Verdict (PASS | WARN | FAIL)',
|
|
40
|
+
'### Findings',
|
|
41
|
+
'### Regression Risks',
|
|
42
|
+
'### Required Fixes',
|
|
43
|
+
'### Recommended Next Status'
|
|
44
|
+
]
|
|
45
|
+
};
|
|
46
|
+
const summaryCommentHeadings = {
|
|
47
|
+
plan: [
|
|
48
|
+
'## Plan Summary',
|
|
49
|
+
'### Goal',
|
|
50
|
+
'### Scope',
|
|
51
|
+
'### Next Action'
|
|
52
|
+
],
|
|
53
|
+
collaborate: [
|
|
54
|
+
'## Collaboration Summary',
|
|
55
|
+
'### Architecture Direction',
|
|
56
|
+
'### Key Constraints',
|
|
57
|
+
'### Next Step'
|
|
58
|
+
],
|
|
59
|
+
evaluate: [
|
|
60
|
+
'## Evaluation Summary',
|
|
61
|
+
'### Recommendation (Proceed | Pivot | Kill)',
|
|
62
|
+
'### Value Score (1-5)',
|
|
63
|
+
'### Risk Score (1-5)',
|
|
64
|
+
'### Next Step'
|
|
65
|
+
],
|
|
66
|
+
review: [
|
|
67
|
+
'## Review Summary',
|
|
68
|
+
'### Verdict (PASS | WARN | FAIL)',
|
|
69
|
+
'### Findings',
|
|
70
|
+
'### Next Status'
|
|
71
|
+
]
|
|
72
|
+
};
|
|
73
|
+
describe('Workflow export matrix', () => {
|
|
74
|
+
const envDir = path.resolve(templatesDir, 'environments');
|
|
75
|
+
const envIds = fs.readdirSync(envDir).filter((f) => f.endsWith('.yaml')).map((f) => f.replace('.yaml', ''));
|
|
76
|
+
it('exports every workflow for every environment with correct format and MCP substitution', () => {
|
|
77
|
+
for (const envId of envIds) {
|
|
78
|
+
const env = engine.loadEnvironment(envId);
|
|
79
|
+
const expectedPrefix = env.mcp?.prefix?.replace('{projectName}', 'taskforce');
|
|
80
|
+
const expectedExt = env.workflows.format === 'toml' ? '.toml' : env.workflows.format === 'mdc' ? '.mdc' : '.md';
|
|
81
|
+
for (const workflowName of workflowNames) {
|
|
82
|
+
const result = engine.processTemplate(workflowName, envId);
|
|
83
|
+
expect(result.filename.endsWith(expectedExt), `${envId}/${workflowName} extension mismatch`).toBe(true);
|
|
84
|
+
expect(result.content.includes('{{MCP_PREFIX}}'), `${envId}/${workflowName} has unresolved MCP variable`).toBe(false);
|
|
85
|
+
if (expectedPrefix) {
|
|
86
|
+
expect(result.content.includes(expectedPrefix), `${envId}/${workflowName} missing MCP prefix`).toBe(true);
|
|
87
|
+
}
|
|
88
|
+
if (env.workflows.format === 'toml') {
|
|
89
|
+
expect(result.content.includes('prompt = """'), `${envId}/${workflowName} expected TOML prompt block`).toBe(true);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
expect(result.content.startsWith('---\n'), `${envId}/${workflowName} expected frontmatter`).toBe(true);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
it('keeps structured comment output contracts in master templates', () => {
|
|
98
|
+
for (const [workflowName, headings] of Object.entries(contractHeadings)) {
|
|
99
|
+
const template = engine.loadTemplate(workflowName);
|
|
100
|
+
for (const heading of headings) {
|
|
101
|
+
expect(template.content.default.includes(heading), `${workflowName} missing heading: ${heading}`).toBe(true);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
it('keeps structured summary comment contracts in master templates', () => {
|
|
106
|
+
for (const [workflowName, headings] of Object.entries(summaryCommentHeadings)) {
|
|
107
|
+
const template = engine.loadTemplate(workflowName);
|
|
108
|
+
for (const heading of headings) {
|
|
109
|
+
expect(template.content.default.includes(heading), `${workflowName} missing summary heading: ${heading}`).toBe(true);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { TemplateEngine } from '../services/templateEngine';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import fs from 'fs';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
const templatesDir = path.resolve(__dirname, '../resources/templates');
|
|
8
|
+
const engine = new TemplateEngine(templatesDir);
|
|
9
|
+
const workflowNames = ['do', 'execute', 'plan', 'evaluate', 'collaborate', 'review'];
|
|
10
|
+
describe('Workflow export snapshots', () => {
|
|
11
|
+
const envDir = path.resolve(templatesDir, 'environments');
|
|
12
|
+
const envIds = fs.readdirSync(envDir)
|
|
13
|
+
.filter((f) => f.endsWith('.yaml'))
|
|
14
|
+
.map((f) => f.replace('.yaml', ''))
|
|
15
|
+
.sort();
|
|
16
|
+
for (const envId of envIds) {
|
|
17
|
+
for (const workflowName of workflowNames) {
|
|
18
|
+
it(`${envId}/${workflowName} export snapshot`, () => {
|
|
19
|
+
const result = engine.processTemplate(workflowName, envId);
|
|
20
|
+
expect({
|
|
21
|
+
filename: result.filename,
|
|
22
|
+
strategy: result.strategy,
|
|
23
|
+
content: result.content
|
|
24
|
+
}).toMatchSnapshot();
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { execFileSync } from 'child_process';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
describe('Workflow template generation', () => {
|
|
5
|
+
it('generated workflow YAML files are up to date', () => {
|
|
6
|
+
const scriptPath = path.resolve(process.cwd(), 'scripts/generate-workflow-templates.mjs');
|
|
7
|
+
expect(() => execFileSync('node', [scriptPath, '--check'], {
|
|
8
|
+
cwd: process.cwd(),
|
|
9
|
+
stdio: 'pipe'
|
|
10
|
+
})).not.toThrow();
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import yaml from 'js-yaml';
|
|
5
|
+
const workflowsDir = path.resolve(process.cwd(), 'src/resources/templates/workflows');
|
|
6
|
+
function loadWorkflow(name) {
|
|
7
|
+
const raw = fs.readFileSync(path.join(workflowsDir, `${name}.yaml`), 'utf8');
|
|
8
|
+
return yaml.load(raw);
|
|
9
|
+
}
|
|
10
|
+
function buildAliasMap(names) {
|
|
11
|
+
const map = new Map();
|
|
12
|
+
for (const name of names) {
|
|
13
|
+
const workflow = loadWorkflow(name);
|
|
14
|
+
for (const alias of workflow.dispatch?.aliases || []) {
|
|
15
|
+
map.set(alias, name);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
return map;
|
|
19
|
+
}
|
|
20
|
+
function simulateDoDispatch(params) {
|
|
21
|
+
const doWorkflow = loadWorkflow('do');
|
|
22
|
+
const aliasMap = buildAliasMap(['do', 'execute', 'plan', 'evaluate', 'collaborate', 'review']);
|
|
23
|
+
const calls = [];
|
|
24
|
+
if (params.knownTaskId) {
|
|
25
|
+
calls.push({ tool: 'get_task' });
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
calls.push({ tool: 'list_tasks' });
|
|
29
|
+
calls.push({ tool: 'get_task' });
|
|
30
|
+
}
|
|
31
|
+
const explicitRoute = aliasMap.get(params.command);
|
|
32
|
+
if (explicitRoute && explicitRoute !== 'do') {
|
|
33
|
+
return { routedTo: explicitRoute, calls };
|
|
34
|
+
}
|
|
35
|
+
const mapped = params.approach ? doWorkflow.dispatch?.approachMap?.[params.approach] : undefined;
|
|
36
|
+
return {
|
|
37
|
+
routedTo: mapped || doWorkflow.dispatch?.default || 'execute',
|
|
38
|
+
calls
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
function simulateExecuteFlow(params) {
|
|
42
|
+
const calls = [{ tool: 'update_task', args: { status: 'in-progress' } }];
|
|
43
|
+
const requested = params.explicitFinalStatus;
|
|
44
|
+
if (!requested) {
|
|
45
|
+
calls.push({ tool: 'add_comment', args: { kind: 'summary' } });
|
|
46
|
+
calls.push({ tool: 'update_task', args: { status: 'review' } });
|
|
47
|
+
return calls;
|
|
48
|
+
}
|
|
49
|
+
if ((requested === 'done' || requested === 'cancelled') && !params.explicitUserInstructionForDoneOrCancelled) {
|
|
50
|
+
throw new Error('Blocked unsafe status transition');
|
|
51
|
+
}
|
|
52
|
+
if (requested === 'task' || requested === 'on-hold') {
|
|
53
|
+
calls.push({ tool: 'add_comment', args: { kind: 'status-justification' } });
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
calls.push({ tool: 'add_comment', args: { kind: 'summary' } });
|
|
57
|
+
}
|
|
58
|
+
calls.push({ tool: 'update_task', args: { status: requested } });
|
|
59
|
+
return calls;
|
|
60
|
+
}
|
|
61
|
+
function simulateOptionalArtifactSave(workflowName, approveSave) {
|
|
62
|
+
const workflow = loadWorkflow(workflowName);
|
|
63
|
+
const artifact = Object.values(workflow.artifacts || {})[0];
|
|
64
|
+
const calls = [{ tool: 'render_in_screen' }];
|
|
65
|
+
if (!artifact || artifact.required || artifact.savePolicy !== 'ask-before-save') {
|
|
66
|
+
return calls;
|
|
67
|
+
}
|
|
68
|
+
calls.push({ tool: 'prompt_save_artifact', args: { path: artifact.path } });
|
|
69
|
+
if (approveSave) {
|
|
70
|
+
calls.push({ tool: 'write_file', args: { path: artifact.path } });
|
|
71
|
+
calls.push({ tool: 'attach_context_file', args: { path: artifact.path } });
|
|
72
|
+
}
|
|
73
|
+
return calls;
|
|
74
|
+
}
|
|
75
|
+
describe('Workflow simulation', () => {
|
|
76
|
+
it('/do routes by approach to execute when approach is implement', () => {
|
|
77
|
+
const result = simulateDoDispatch({ command: '/do', approach: 'implement', knownTaskId: true });
|
|
78
|
+
expect(result.routedTo).toBe('execute');
|
|
79
|
+
expect(result.calls[0].tool).toBe('get_task');
|
|
80
|
+
});
|
|
81
|
+
it('/do defaults to execute when approach is missing', () => {
|
|
82
|
+
const result = simulateDoDispatch({ command: '/do', knownTaskId: true });
|
|
83
|
+
expect(result.routedTo).toBe('execute');
|
|
84
|
+
});
|
|
85
|
+
it('explicit slash command wins over approach routing', () => {
|
|
86
|
+
const result = simulateDoDispatch({ command: '/review', approach: 'implement', knownTaskId: true });
|
|
87
|
+
expect(result.routedTo).toBe('review');
|
|
88
|
+
});
|
|
89
|
+
it('unknown task id uses list before get', () => {
|
|
90
|
+
const result = simulateDoDispatch({ command: '/do', approach: 'plan', knownTaskId: false });
|
|
91
|
+
expect(result.calls.map((c) => c.tool)).toEqual(['list_tasks', 'get_task']);
|
|
92
|
+
});
|
|
93
|
+
it('execute flow defaults to in-progress then review', () => {
|
|
94
|
+
const calls = simulateExecuteFlow({});
|
|
95
|
+
expect(calls.map((c) => c.tool)).toEqual(['update_task', 'add_comment', 'update_task']);
|
|
96
|
+
expect(calls[0].args?.status).toBe('in-progress');
|
|
97
|
+
expect(calls[2].args?.status).toBe('review');
|
|
98
|
+
});
|
|
99
|
+
it('execute flow requires justification for task/on-hold final status', () => {
|
|
100
|
+
const calls = simulateExecuteFlow({ explicitFinalStatus: 'on-hold' });
|
|
101
|
+
expect(calls[1].args?.kind).toBe('status-justification');
|
|
102
|
+
expect(calls[2].args?.status).toBe('on-hold');
|
|
103
|
+
});
|
|
104
|
+
it('execute flow blocks done/cancelled without explicit user instruction', () => {
|
|
105
|
+
expect(() => simulateExecuteFlow({ explicitFinalStatus: 'done' })).toThrow('Blocked unsafe status transition');
|
|
106
|
+
});
|
|
107
|
+
it('optional artifact flow prompts first and only attaches on approval', () => {
|
|
108
|
+
const noSave = simulateOptionalArtifactSave('evaluate', false);
|
|
109
|
+
expect(noSave.map((c) => c.tool)).toEqual(['render_in_screen', 'prompt_save_artifact']);
|
|
110
|
+
const saved = simulateOptionalArtifactSave('evaluate', true);
|
|
111
|
+
expect(saved.map((c) => c.tool)).toEqual(['render_in_screen', 'prompt_save_artifact', 'write_file', 'attach_context_file']);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|