@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,4 @@
|
|
|
1
|
+
export type RuntimeMode = 'local' | 'cloud';
|
|
2
|
+
export type DatabaseProvider = 'sqlite' | 'postgres';
|
|
3
|
+
export declare function resolveRuntimeModeFromEnv(env?: NodeJS.ProcessEnv, fallbackProvider?: 'sqlite' | 'postgres'): RuntimeMode;
|
|
4
|
+
export declare function assertCloudDatabaseProvider(runtimeMode: RuntimeMode, provider: DatabaseProvider, env?: NodeJS.ProcessEnv): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
function normalizeMode(raw) {
|
|
2
|
+
const normalized = String(raw || '').trim().toLowerCase();
|
|
3
|
+
if (normalized === 'local')
|
|
4
|
+
return 'local';
|
|
5
|
+
if (normalized === 'cloud')
|
|
6
|
+
return 'cloud';
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
export function resolveRuntimeModeFromEnv(env = process.env, fallbackProvider) {
|
|
10
|
+
const explicit = normalizeMode(env.TASKFORCE_RUNTIME_MODE);
|
|
11
|
+
if (explicit)
|
|
12
|
+
return explicit;
|
|
13
|
+
// Hosted deployments commonly use postgres and may omit an explicit runtime env.
|
|
14
|
+
// Keep provider-based fallback for compatibility, while still allowing explicit
|
|
15
|
+
// TASKFORCE_RUNTIME_MODE=local to force local behavior.
|
|
16
|
+
if (fallbackProvider === 'postgres')
|
|
17
|
+
return 'cloud';
|
|
18
|
+
return 'local';
|
|
19
|
+
}
|
|
20
|
+
export function assertCloudDatabaseProvider(runtimeMode, provider, env = process.env) {
|
|
21
|
+
const allowSqliteInCloud = String(env.TASKFORCE_ALLOW_SQLITE_IN_CLOUD || '').trim().toLowerCase() === 'true';
|
|
22
|
+
if (runtimeMode === 'cloud' && provider !== 'postgres' && !allowSqliteInCloud) {
|
|
23
|
+
throw new Error('[Taskforce] Cloud runtime requires Postgres. Set TASKFORCE_DB_PROVIDER=postgres and TASKFORCE_DATABASE_URL, or set TASKFORCE_ALLOW_SQLITE_IN_CLOUD=true only for temporary/non-production use.');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { assertCloudDatabaseProvider, resolveRuntimeModeFromEnv } from './runtimeMode';
|
|
3
|
+
describe('server/runtimeMode', () => {
|
|
4
|
+
it('defaults to local when unset and sqlite fallback', () => {
|
|
5
|
+
expect(resolveRuntimeModeFromEnv({}, 'sqlite')).toBe('local');
|
|
6
|
+
});
|
|
7
|
+
it('falls back to cloud when postgres provider is set', () => {
|
|
8
|
+
expect(resolveRuntimeModeFromEnv({ TASKFORCE_DB_PROVIDER: 'postgres' }, 'postgres')).toBe('cloud');
|
|
9
|
+
});
|
|
10
|
+
it('honors explicit TASKFORCE_RUNTIME_MODE override', () => {
|
|
11
|
+
expect(resolveRuntimeModeFromEnv({ TASKFORCE_RUNTIME_MODE: 'local', TASKFORCE_DB_PROVIDER: 'postgres' })).toBe('local');
|
|
12
|
+
expect(resolveRuntimeModeFromEnv({ TASKFORCE_RUNTIME_MODE: 'cloud', TASKFORCE_DB_PROVIDER: 'sqlite' })).toBe('cloud');
|
|
13
|
+
});
|
|
14
|
+
it('keeps explicit local override even when postgres fallback is provided', () => {
|
|
15
|
+
expect(resolveRuntimeModeFromEnv({ TASKFORCE_RUNTIME_MODE: 'local', TASKFORCE_DB_PROVIDER: 'postgres' }, 'postgres')).toBe('local');
|
|
16
|
+
});
|
|
17
|
+
it('rejects sqlite provider in cloud runtime by default', () => {
|
|
18
|
+
expect(() => assertCloudDatabaseProvider('cloud', 'sqlite', {})).toThrow(/Cloud runtime requires Postgres/i);
|
|
19
|
+
});
|
|
20
|
+
it('allows sqlite provider in cloud runtime only with explicit override', () => {
|
|
21
|
+
expect(() => assertCloudDatabaseProvider('cloud', 'sqlite', { TASKFORCE_ALLOW_SQLITE_IN_CLOUD: 'true' })).not.toThrow();
|
|
22
|
+
});
|
|
23
|
+
it('allows postgres provider in cloud runtime', () => {
|
|
24
|
+
expect(() => assertCloudDatabaseProvider('cloud', 'postgres', {})).not.toThrow();
|
|
25
|
+
});
|
|
26
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function applySecurityHeaders(res, runtimeMode) {
|
|
2
|
+
const cspDirectives = [
|
|
3
|
+
"default-src 'self'",
|
|
4
|
+
"base-uri 'self'",
|
|
5
|
+
"frame-ancestors 'none'",
|
|
6
|
+
"object-src 'none'",
|
|
7
|
+
"connect-src 'self' https://api.stripe.com",
|
|
8
|
+
"frame-src 'self' https://js.stripe.com https://hooks.stripe.com",
|
|
9
|
+
"script-src 'self' https://js.stripe.com",
|
|
10
|
+
"img-src 'self' data: blob:",
|
|
11
|
+
"style-src 'self' 'unsafe-inline'",
|
|
12
|
+
"font-src 'self' data:"
|
|
13
|
+
];
|
|
14
|
+
res.setHeader('Content-Security-Policy', cspDirectives.join('; '));
|
|
15
|
+
res.setHeader('X-Content-Type-Options', 'nosniff');
|
|
16
|
+
res.setHeader('X-Frame-Options', 'DENY');
|
|
17
|
+
res.setHeader('Referrer-Policy', 'strict-origin-when-cross-origin');
|
|
18
|
+
res.setHeader('Permissions-Policy', 'camera=(), microphone=(), geolocation=(), payment=()');
|
|
19
|
+
res.setHeader('Cross-Origin-Opener-Policy', 'same-origin');
|
|
20
|
+
res.setHeader('Cross-Origin-Resource-Policy', 'same-origin');
|
|
21
|
+
// HSTS is safe only on HTTPS deployments; cloud mode is expected to be TLS-terminated.
|
|
22
|
+
if (runtimeMode === 'cloud') {
|
|
23
|
+
res.setHeader('Strict-Transport-Security', 'max-age=31536000; includeSubDomains');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { applySecurityHeaders } from './securityHeaders';
|
|
3
|
+
function mockRes() {
|
|
4
|
+
const store = {};
|
|
5
|
+
return {
|
|
6
|
+
setHeader: (name, value) => {
|
|
7
|
+
store[name] = value;
|
|
8
|
+
return undefined;
|
|
9
|
+
},
|
|
10
|
+
getHeader: (name) => store[name]
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
describe('server security headers', () => {
|
|
14
|
+
it('applies baseline security headers in local mode', () => {
|
|
15
|
+
const res = mockRes();
|
|
16
|
+
applySecurityHeaders(res, 'local');
|
|
17
|
+
expect(res.getHeader('X-Content-Type-Options')).toBe('nosniff');
|
|
18
|
+
expect(res.getHeader('Content-Security-Policy')).toContain("connect-src 'self' https://api.stripe.com");
|
|
19
|
+
expect(res.getHeader('Content-Security-Policy')).toContain("frame-src 'self' https://js.stripe.com https://hooks.stripe.com");
|
|
20
|
+
expect(res.getHeader('X-Frame-Options')).toBe('DENY');
|
|
21
|
+
expect(res.getHeader('Referrer-Policy')).toBe('strict-origin-when-cross-origin');
|
|
22
|
+
expect(res.getHeader('Permissions-Policy')).toBe('camera=(), microphone=(), geolocation=(), payment=()');
|
|
23
|
+
expect(res.getHeader('Cross-Origin-Opener-Policy')).toBe('same-origin');
|
|
24
|
+
expect(res.getHeader('Cross-Origin-Resource-Policy')).toBe('same-origin');
|
|
25
|
+
expect(res.getHeader('Strict-Transport-Security')).toBeUndefined();
|
|
26
|
+
});
|
|
27
|
+
it('adds HSTS in cloud mode', () => {
|
|
28
|
+
const res = mockRes();
|
|
29
|
+
applySecurityHeaders(res, 'cloud');
|
|
30
|
+
expect(res.getHeader('Strict-Transport-Security')).toBe('max-age=31536000; includeSubDomains');
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface SmtpTransport {
|
|
2
|
+
sendMail(input: {
|
|
3
|
+
from: string;
|
|
4
|
+
to: string;
|
|
5
|
+
replyTo?: string;
|
|
6
|
+
subject: string;
|
|
7
|
+
text: string;
|
|
8
|
+
html?: string;
|
|
9
|
+
}): Promise<{
|
|
10
|
+
messageId?: string;
|
|
11
|
+
}>;
|
|
12
|
+
}
|
|
13
|
+
export declare function createSmtpTransport(config: {
|
|
14
|
+
host: string;
|
|
15
|
+
port: number;
|
|
16
|
+
secure: boolean;
|
|
17
|
+
auth: {
|
|
18
|
+
user: string;
|
|
19
|
+
pass: string;
|
|
20
|
+
};
|
|
21
|
+
}): Promise<SmtpTransport>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export async function createSmtpTransport(config) {
|
|
2
|
+
try {
|
|
3
|
+
const dynamicImport = new Function('modulePath', 'return import(modulePath);');
|
|
4
|
+
const mod = await dynamicImport('nodemailer');
|
|
5
|
+
const nodemailer = mod.default || mod;
|
|
6
|
+
return nodemailer.createTransport(config);
|
|
7
|
+
}
|
|
8
|
+
catch {
|
|
9
|
+
throw new Error('Nodemailer dependency is missing. Install nodemailer to use google-workspace provider.');
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createStandaloneServer } from './index.js';
|
|
2
|
+
const parsedPort = Number.parseInt(String(process.env.PORT || '8080'), 10);
|
|
3
|
+
const port = Number.isFinite(parsedPort) && parsedPort > 0 ? parsedPort : 8080;
|
|
4
|
+
const projectRoot = process.cwd();
|
|
5
|
+
try {
|
|
6
|
+
const server = createStandaloneServer({
|
|
7
|
+
projectRoot,
|
|
8
|
+
port
|
|
9
|
+
});
|
|
10
|
+
server.listen(port, () => {
|
|
11
|
+
console.log(`[Taskforce] Server started on port ${port}`);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
console.error(`[Taskforce] Failed to start standalone server: ${error?.message || error}`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export interface WorkflowMetadata {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export declare const formatTransformers: {
|
|
7
|
+
/**
|
|
8
|
+
* Transforms content to TOML format (Gemini CLI style)
|
|
9
|
+
* Structure:
|
|
10
|
+
* description = "..."
|
|
11
|
+
* prompt = """..."""
|
|
12
|
+
*/
|
|
13
|
+
toToml(content: string, metadata: WorkflowMetadata): string;
|
|
14
|
+
/**
|
|
15
|
+
* Transforms content to Markdown format with frontmatter
|
|
16
|
+
* Structure:
|
|
17
|
+
* ---
|
|
18
|
+
* name: ...
|
|
19
|
+
* description: ...
|
|
20
|
+
* ---
|
|
21
|
+
* # Content
|
|
22
|
+
*/
|
|
23
|
+
toMarkdown(content: string, metadata: WorkflowMetadata): string;
|
|
24
|
+
/**
|
|
25
|
+
* Transforms content to Cursor MDC format (.mdc)
|
|
26
|
+
* Structure: Markdown with YAML frontmatter + specific fields
|
|
27
|
+
*/
|
|
28
|
+
toMdc(content: string, metadata: WorkflowMetadata): string;
|
|
29
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import TOML from '@iarna/toml';
|
|
2
|
+
export const formatTransformers = {
|
|
3
|
+
/**
|
|
4
|
+
* Transforms content to TOML format (Gemini CLI style)
|
|
5
|
+
* Structure:
|
|
6
|
+
* description = "..."
|
|
7
|
+
* prompt = """..."""
|
|
8
|
+
*/
|
|
9
|
+
toToml(content, metadata) {
|
|
10
|
+
const { name, ...rest } = metadata;
|
|
11
|
+
// Ensure prompt is set
|
|
12
|
+
const data = {
|
|
13
|
+
...rest,
|
|
14
|
+
prompt: content
|
|
15
|
+
};
|
|
16
|
+
return TOML.stringify(data);
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* Transforms content to Markdown format with frontmatter
|
|
20
|
+
* Structure:
|
|
21
|
+
* ---
|
|
22
|
+
* name: ...
|
|
23
|
+
* description: ...
|
|
24
|
+
* ---
|
|
25
|
+
* # Content
|
|
26
|
+
*/
|
|
27
|
+
toMarkdown(content, metadata) {
|
|
28
|
+
const frontmatter = Object.entries(metadata)
|
|
29
|
+
.map(([key, value]) => `${key}: ${JSON.stringify(value)}`)
|
|
30
|
+
.join('\n');
|
|
31
|
+
return `---\n${frontmatter}\n---\n\n${content}`;
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* Transforms content to Cursor MDC format (.mdc)
|
|
35
|
+
* Structure: Markdown with YAML frontmatter + specific fields
|
|
36
|
+
*/
|
|
37
|
+
toMdc(content, metadata) {
|
|
38
|
+
const { name, description, ...rest } = metadata;
|
|
39
|
+
// Ensure description is present
|
|
40
|
+
const mdcMetadata = {
|
|
41
|
+
description: description || `Workflow: ${name}`,
|
|
42
|
+
globs: rest.globs || [],
|
|
43
|
+
alwaysApply: rest.alwaysApply !== undefined ? rest.alwaysApply : false,
|
|
44
|
+
...rest
|
|
45
|
+
};
|
|
46
|
+
const frontmatter = Object.entries(mdcMetadata)
|
|
47
|
+
.map(([key, value]) => {
|
|
48
|
+
if (Array.isArray(value)) {
|
|
49
|
+
return `${key}: [${value.map(v => JSON.stringify(v)).join(', ')}]`;
|
|
50
|
+
}
|
|
51
|
+
return `${key}: ${JSON.stringify(value)}`;
|
|
52
|
+
})
|
|
53
|
+
.join('\n');
|
|
54
|
+
return `---\n${frontmatter}\n---\n\n${content}`;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Environment } from '../types.js';
|
|
2
|
+
export interface WorkflowTemplate {
|
|
3
|
+
name: string;
|
|
4
|
+
description: string;
|
|
5
|
+
type: 'workflow' | 'command';
|
|
6
|
+
metadata?: Record<string, any>;
|
|
7
|
+
content: {
|
|
8
|
+
default: string;
|
|
9
|
+
[envId: string]: string;
|
|
10
|
+
};
|
|
11
|
+
variables?: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface EnvironmentConfig {
|
|
14
|
+
id: string;
|
|
15
|
+
name: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
workflows: {
|
|
18
|
+
directory: string;
|
|
19
|
+
format: 'toml' | 'markdown' | 'mdc';
|
|
20
|
+
filenamePattern: string;
|
|
21
|
+
overrides?: Record<string, string | {
|
|
22
|
+
filename: string;
|
|
23
|
+
strategy?: 'overwrite' | 'inject' | 'append';
|
|
24
|
+
}>;
|
|
25
|
+
};
|
|
26
|
+
mcp?: {
|
|
27
|
+
prefix: string;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare class TemplateEngine {
|
|
31
|
+
private templatesDir;
|
|
32
|
+
private sanitizeMcpIdentifier;
|
|
33
|
+
constructor(templatesDir?: string);
|
|
34
|
+
getTemplatePath(name: string): string;
|
|
35
|
+
listTemplates(): string[];
|
|
36
|
+
getEnvironmentPath(envId: string): string;
|
|
37
|
+
listEnvironments(): Environment[];
|
|
38
|
+
loadTemplate(name: string): WorkflowTemplate;
|
|
39
|
+
loadEnvironment(envId: string): EnvironmentConfig;
|
|
40
|
+
processTemplate(templateName: string, envId: string, variables?: Record<string, string>): {
|
|
41
|
+
filename: string;
|
|
42
|
+
content: string;
|
|
43
|
+
strategy: 'overwrite' | 'inject' | 'append';
|
|
44
|
+
};
|
|
45
|
+
private substituteVariables;
|
|
46
|
+
}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import yaml from 'js-yaml';
|
|
2
|
+
import { existsSync, readdirSync, readFileSync } from 'fs';
|
|
3
|
+
import path from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { formatTransformers } from './formatTransformers.js';
|
|
6
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
export class TemplateEngine {
|
|
8
|
+
templatesDir;
|
|
9
|
+
sanitizeMcpIdentifier(value) {
|
|
10
|
+
const normalized = String(value || '')
|
|
11
|
+
.replace(/[^a-zA-Z0-9_-]+/g, '-')
|
|
12
|
+
.replace(/-+/g, '-')
|
|
13
|
+
.replace(/^[-_]+|[-_]+$/g, '');
|
|
14
|
+
return normalized || 'taskforce';
|
|
15
|
+
}
|
|
16
|
+
constructor(templatesDir) {
|
|
17
|
+
if (templatesDir) {
|
|
18
|
+
this.templatesDir = templatesDir;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
// Locate templates directory relative to this service file
|
|
22
|
+
// Works for both src/ (dev) and dist/ (prod) structure
|
|
23
|
+
// src/services/templateEngine.ts -> src/resources/templates
|
|
24
|
+
this.templatesDir = path.resolve(__dirname, '../resources/templates');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
getTemplatePath(name) {
|
|
28
|
+
return path.join(this.templatesDir, 'workflows', `${name}.yaml`);
|
|
29
|
+
}
|
|
30
|
+
listTemplates() {
|
|
31
|
+
const workflowsDir = path.join(this.templatesDir, 'workflows');
|
|
32
|
+
if (!existsSync(workflowsDir))
|
|
33
|
+
return [];
|
|
34
|
+
return readdirSync(workflowsDir)
|
|
35
|
+
.filter(file => file.endsWith('.yaml'))
|
|
36
|
+
.map(file => file.replace('.yaml', ''));
|
|
37
|
+
}
|
|
38
|
+
getEnvironmentPath(envId) {
|
|
39
|
+
return path.join(this.templatesDir, 'environments', `${envId}.yaml`);
|
|
40
|
+
}
|
|
41
|
+
listEnvironments() {
|
|
42
|
+
const envDir = path.join(this.templatesDir, 'environments');
|
|
43
|
+
if (!existsSync(envDir))
|
|
44
|
+
return [];
|
|
45
|
+
const envs = readdirSync(envDir)
|
|
46
|
+
.filter(file => file.endsWith('.yaml'))
|
|
47
|
+
.map(file => {
|
|
48
|
+
const envId = file.replace('.yaml', '');
|
|
49
|
+
try {
|
|
50
|
+
const config = this.loadEnvironment(envId);
|
|
51
|
+
return {
|
|
52
|
+
id: config.id,
|
|
53
|
+
name: config.name,
|
|
54
|
+
icon: config.icon,
|
|
55
|
+
directory: config.workflows.directory
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
console.error(`Failed to load environment config ${file}:`, e);
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
return envs.filter((env) => env !== null);
|
|
64
|
+
}
|
|
65
|
+
loadTemplate(name) {
|
|
66
|
+
const filePath = this.getTemplatePath(name);
|
|
67
|
+
if (!existsSync(filePath)) {
|
|
68
|
+
throw new Error(`Template not found: ${name}`);
|
|
69
|
+
}
|
|
70
|
+
return yaml.load(readFileSync(filePath, 'utf-8'));
|
|
71
|
+
}
|
|
72
|
+
loadEnvironment(envId) {
|
|
73
|
+
const filePath = this.getEnvironmentPath(envId);
|
|
74
|
+
if (!existsSync(filePath)) {
|
|
75
|
+
throw new Error(`Environment not found: ${envId}`);
|
|
76
|
+
}
|
|
77
|
+
return yaml.load(readFileSync(filePath, 'utf-8'));
|
|
78
|
+
}
|
|
79
|
+
processTemplate(templateName, envId, variables = {}) {
|
|
80
|
+
const template = this.loadTemplate(templateName);
|
|
81
|
+
const envConfig = this.loadEnvironment(envId);
|
|
82
|
+
// 1. Select Content (Env-specific or Default)
|
|
83
|
+
let rawContent = template.content[envId] || template.content.default;
|
|
84
|
+
// 2. Substitute Variables
|
|
85
|
+
// Add default variables from environment config
|
|
86
|
+
const effectiveVars = { ...variables };
|
|
87
|
+
if (envConfig.mcp?.prefix) {
|
|
88
|
+
const projectName = this.sanitizeMcpIdentifier(variables['projectName'] || 'taskforce');
|
|
89
|
+
const dynamicPrefix = envConfig.mcp.prefix.replace('{projectName}', projectName);
|
|
90
|
+
effectiveVars['MCP_PREFIX'] = dynamicPrefix;
|
|
91
|
+
}
|
|
92
|
+
const processedContent = this.substituteVariables(rawContent, effectiveVars);
|
|
93
|
+
// 3. Transform Format
|
|
94
|
+
let finalContent = processedContent;
|
|
95
|
+
const metadata = {
|
|
96
|
+
name: template.name,
|
|
97
|
+
description: template.description,
|
|
98
|
+
...(template.metadata || {})
|
|
99
|
+
};
|
|
100
|
+
if (envConfig.workflows.format === 'toml') {
|
|
101
|
+
finalContent = formatTransformers.toToml(processedContent, metadata);
|
|
102
|
+
}
|
|
103
|
+
else if (envConfig.workflows.format === 'markdown') {
|
|
104
|
+
finalContent = formatTransformers.toMarkdown(processedContent, metadata);
|
|
105
|
+
}
|
|
106
|
+
else if (envConfig.workflows.format === 'mdc') {
|
|
107
|
+
finalContent = formatTransformers.toMdc(processedContent, metadata);
|
|
108
|
+
}
|
|
109
|
+
// 4. Generate Filename
|
|
110
|
+
const extMap = {
|
|
111
|
+
'toml': 'toml',
|
|
112
|
+
'markdown': 'md',
|
|
113
|
+
'mdc': 'mdc'
|
|
114
|
+
};
|
|
115
|
+
const ext = extMap[envConfig.workflows.format] || 'txt';
|
|
116
|
+
let filenamePattern = envConfig.workflows.filenamePattern;
|
|
117
|
+
let strategy = 'overwrite';
|
|
118
|
+
// Check for overrides
|
|
119
|
+
if (envConfig.workflows.overrides && envConfig.workflows.overrides[template.name]) {
|
|
120
|
+
const override = envConfig.workflows.overrides[template.name];
|
|
121
|
+
if (typeof override === 'string') {
|
|
122
|
+
filenamePattern = override;
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
filenamePattern = override.filename;
|
|
126
|
+
if (override.strategy) {
|
|
127
|
+
strategy = override.strategy;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const filename = filenamePattern
|
|
132
|
+
.replace('{name}', template.name)
|
|
133
|
+
.replace('{ext}', ext);
|
|
134
|
+
return {
|
|
135
|
+
filename,
|
|
136
|
+
content: finalContent,
|
|
137
|
+
strategy
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
substituteVariables(content, vars) {
|
|
141
|
+
let result = content;
|
|
142
|
+
for (const [key, value] of Object.entries(vars)) {
|
|
143
|
+
const regex = new RegExp(`{{${key}}}`, 'g');
|
|
144
|
+
result = result.replace(regex, value);
|
|
145
|
+
}
|
|
146
|
+
return result;
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type RuntimeMode = 'local' | 'cloud';
|
|
2
|
+
export type AuthSource = 'cloud' | 'local';
|
|
3
|
+
export type WorkspaceMode = 'single-local' | 'multi-cloud';
|
|
4
|
+
export interface RuntimeModeContract {
|
|
5
|
+
runtimeMode: RuntimeMode;
|
|
6
|
+
authSource: AuthSource;
|
|
7
|
+
workspaceMode: WorkspaceMode;
|
|
8
|
+
workspaceSwitchingEnabled: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function normalizeRuntimeMode(mode: unknown): RuntimeMode;
|
|
11
|
+
export declare function resolveRuntimeModeContract(mode: unknown): RuntimeModeContract;
|
|
12
|
+
export declare function isWorkspaceSwitchingEnabledForRuntime(mode: unknown): boolean;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const RUNTIME_MODE_CONTRACTS = {
|
|
2
|
+
local: {
|
|
3
|
+
runtimeMode: 'local',
|
|
4
|
+
authSource: 'cloud',
|
|
5
|
+
workspaceMode: 'single-local',
|
|
6
|
+
workspaceSwitchingEnabled: false
|
|
7
|
+
},
|
|
8
|
+
cloud: {
|
|
9
|
+
runtimeMode: 'cloud',
|
|
10
|
+
authSource: 'cloud',
|
|
11
|
+
workspaceMode: 'multi-cloud',
|
|
12
|
+
workspaceSwitchingEnabled: true
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
export function normalizeRuntimeMode(mode) {
|
|
16
|
+
return String(mode || '').trim().toLowerCase() === 'cloud' ? 'cloud' : 'local';
|
|
17
|
+
}
|
|
18
|
+
export function resolveRuntimeModeContract(mode) {
|
|
19
|
+
return RUNTIME_MODE_CONTRACTS[normalizeRuntimeMode(mode)];
|
|
20
|
+
}
|
|
21
|
+
export function isWorkspaceSwitchingEnabledForRuntime(mode) {
|
|
22
|
+
return resolveRuntimeModeContract(mode).workspaceSwitchingEnabled;
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { isWorkspaceSwitchingEnabledForRuntime, normalizeRuntimeMode, resolveRuntimeModeContract } from './runtimeContract';
|
|
3
|
+
describe('runtimeContract', () => {
|
|
4
|
+
it('resolves local runtime contract', () => {
|
|
5
|
+
const contract = resolveRuntimeModeContract('local');
|
|
6
|
+
expect(contract.runtimeMode).toBe('local');
|
|
7
|
+
expect(contract.authSource).toBe('cloud');
|
|
8
|
+
expect(contract.workspaceMode).toBe('single-local');
|
|
9
|
+
expect(contract.workspaceSwitchingEnabled).toBe(false);
|
|
10
|
+
});
|
|
11
|
+
it('resolves cloud runtime contract', () => {
|
|
12
|
+
const contract = resolveRuntimeModeContract('cloud');
|
|
13
|
+
expect(contract.runtimeMode).toBe('cloud');
|
|
14
|
+
expect(contract.authSource).toBe('cloud');
|
|
15
|
+
expect(contract.workspaceMode).toBe('multi-cloud');
|
|
16
|
+
expect(contract.workspaceSwitchingEnabled).toBe(true);
|
|
17
|
+
});
|
|
18
|
+
it('normalizes unknown modes to local', () => {
|
|
19
|
+
expect(normalizeRuntimeMode(undefined)).toBe('local');
|
|
20
|
+
expect(normalizeRuntimeMode('staging')).toBe('local');
|
|
21
|
+
expect(isWorkspaceSwitchingEnabledForRuntime('staging')).toBe(false);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { loadSyncEndurancePreflightConfig, validateSyncEndurancePreflight } from './preflight';
|
|
2
|
+
function printList(title, values) {
|
|
3
|
+
if (values.length === 0)
|
|
4
|
+
return;
|
|
5
|
+
console.log(title);
|
|
6
|
+
for (const value of values)
|
|
7
|
+
console.log(`- ${value}`);
|
|
8
|
+
}
|
|
9
|
+
function main() {
|
|
10
|
+
const config = loadSyncEndurancePreflightConfig(process.env);
|
|
11
|
+
const result = validateSyncEndurancePreflight(config);
|
|
12
|
+
console.log('Sync Soak Preflight');
|
|
13
|
+
console.log(`Profile: ${config.profile}`);
|
|
14
|
+
console.log(`Duration (min): ${config.durationMin}`);
|
|
15
|
+
console.log(`Artifact dir: ${config.artifactDir}`);
|
|
16
|
+
console.log(`Local base URL: ${config.localBaseUrl || '(missing)'}`);
|
|
17
|
+
console.log(`Cloud base URL: ${config.cloudBaseUrl || '(missing)'}`);
|
|
18
|
+
console.log(`Local workspace ID: ${config.localWorkspaceId || '(missing)'}`);
|
|
19
|
+
console.log(`Cloud workspace ID: ${config.cloudWorkspaceId || '(missing)'}`);
|
|
20
|
+
printList('Warnings:', result.warnings);
|
|
21
|
+
printList('Errors:', result.errors);
|
|
22
|
+
if (!result.ok) {
|
|
23
|
+
process.exitCode = 1;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
console.log('Preflight passed.');
|
|
27
|
+
}
|
|
28
|
+
main();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export type SyncSoakProfile = 'smoke' | 'stress' | 'overnight';
|
|
2
|
+
export interface SyncEndurancePreflightConfig {
|
|
3
|
+
localBaseUrl: string;
|
|
4
|
+
cloudBaseUrl: string;
|
|
5
|
+
workspaceId: string;
|
|
6
|
+
localWorkspaceId: string;
|
|
7
|
+
cloudWorkspaceId: string;
|
|
8
|
+
localEmail: string;
|
|
9
|
+
localPassword: string;
|
|
10
|
+
cloudEmail: string;
|
|
11
|
+
cloudPassword: string;
|
|
12
|
+
durationMin: number;
|
|
13
|
+
seed: string;
|
|
14
|
+
profile: SyncSoakProfile;
|
|
15
|
+
artifactDir: string;
|
|
16
|
+
enableSyncDebug: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface SyncEndurancePreflightResult {
|
|
19
|
+
ok: boolean;
|
|
20
|
+
config: SyncEndurancePreflightConfig;
|
|
21
|
+
errors: string[];
|
|
22
|
+
warnings: string[];
|
|
23
|
+
}
|
|
24
|
+
export declare function loadSyncEndurancePreflightConfig(env?: NodeJS.ProcessEnv): SyncEndurancePreflightConfig;
|
|
25
|
+
export declare function validateSyncEndurancePreflight(config: SyncEndurancePreflightConfig): SyncEndurancePreflightResult;
|
|
26
|
+
export declare function assertSyncEndurancePreflight(env?: NodeJS.ProcessEnv): SyncEndurancePreflightConfig;
|