@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.
Files changed (492) hide show
  1. package/README.md +241 -0
  2. package/dist/Taskforce.d.ts +3 -0
  3. package/dist/Taskforce.js +3 -0
  4. package/dist/Taskforce.module.css +7587 -0
  5. package/dist/TaskforceCore.CategoryFallback.test.d.ts +1 -0
  6. package/dist/TaskforceCore.CategoryFallback.test.js +98 -0
  7. package/dist/TaskforceCore.d.ts +12 -0
  8. package/dist/TaskforceCore.js +729 -0
  9. package/dist/TaskforceCore.test.d.ts +1 -0
  10. package/dist/TaskforceCore.test.js +2132 -0
  11. package/dist/TaskforceScreenshot.d.ts +11 -0
  12. package/dist/TaskforceScreenshot.js +113 -0
  13. package/dist/TaskforceWidget.d.ts +6 -0
  14. package/dist/TaskforceWidget.js +101 -0
  15. package/dist/TaskforceWidget.test.d.ts +1 -0
  16. package/dist/TaskforceWidget.test.js +92 -0
  17. package/dist/UnsavedChangesRelaxed.test.d.ts +1 -0
  18. package/dist/UnsavedChangesRelaxed.test.js +16 -0
  19. package/dist/__tests__/localizationCatalogs.test.d.ts +1 -0
  20. package/dist/__tests__/localizationCatalogs.test.js +37 -0
  21. package/dist/__tests__/planParser.test.d.ts +1 -0
  22. package/dist/__tests__/planParser.test.js +183 -0
  23. package/dist/__tests__/releaseVersion.test.d.ts +1 -0
  24. package/dist/__tests__/releaseVersion.test.js +32 -0
  25. package/dist/__tests__/structuredCommentValidation.test.d.ts +1 -0
  26. package/dist/__tests__/structuredCommentValidation.test.js +31 -0
  27. package/dist/__tests__/structuredDocValidation.test.d.ts +1 -0
  28. package/dist/__tests__/structuredDocValidation.test.js +30 -0
  29. package/dist/__tests__/templateEngine.test.d.ts +1 -0
  30. package/dist/__tests__/templateEngine.test.js +150 -0
  31. package/dist/__tests__/templates.test.d.ts +1 -0
  32. package/dist/__tests__/templates.test.js +45 -0
  33. package/dist/__tests__/workflowDocumentFixtures.test.d.ts +1 -0
  34. package/dist/__tests__/workflowDocumentFixtures.test.js +78 -0
  35. package/dist/__tests__/workflowExportMatrix.test.d.ts +1 -0
  36. package/dist/__tests__/workflowExportMatrix.test.js +113 -0
  37. package/dist/__tests__/workflowExportSnapshots.test.d.ts +1 -0
  38. package/dist/__tests__/workflowExportSnapshots.test.js +28 -0
  39. package/dist/__tests__/workflowGeneration.test.d.ts +1 -0
  40. package/dist/__tests__/workflowGeneration.test.js +12 -0
  41. package/dist/__tests__/workflowSimulation.test.d.ts +1 -0
  42. package/dist/__tests__/workflowSimulation.test.js +113 -0
  43. package/dist/__tests__/workflowV2Policy.test.d.ts +1 -0
  44. package/dist/__tests__/workflowV2Policy.test.js +80 -0
  45. package/dist/api.d.ts +30 -0
  46. package/dist/api.js +85 -0
  47. package/dist/cli.d.ts +2 -0
  48. package/dist/cli.js +217 -0
  49. package/dist/compat/priorityCompat.d.ts +2 -0
  50. package/dist/compat/priorityCompat.js +24 -0
  51. package/dist/components/features/DocumentGenerateModal.d.ts +9 -0
  52. package/dist/components/features/DocumentGenerateModal.js +114 -0
  53. package/dist/components/features/DocumentIndex.d.ts +19 -0
  54. package/dist/components/features/DocumentIndex.js +51 -0
  55. package/dist/components/features/DocumentViewer.d.ts +9 -0
  56. package/dist/components/features/DocumentViewer.js +253 -0
  57. package/dist/components/features/DocumentWorkspace.d.ts +21 -0
  58. package/dist/components/features/DocumentWorkspace.js +88 -0
  59. package/dist/components/features/TaskSettings.d.ts +209 -0
  60. package/dist/components/features/TaskSettings.js +500 -0
  61. package/dist/components/features/TaskSettings.test.d.ts +1 -0
  62. package/dist/components/features/TaskSettings.test.js +308 -0
  63. package/dist/components/features/settings/CategoryManager.d.ts +19 -0
  64. package/dist/components/features/settings/CategoryManager.js +113 -0
  65. package/dist/components/features/settings/TaxonomyEditor.d.ts +8 -0
  66. package/dist/components/features/settings/TaxonomyEditor.js +98 -0
  67. package/dist/components/features/settings/TaxonomyManager 2.d.ts +52 -0
  68. package/dist/components/features/settings/TaxonomyManager 2.js +75 -0
  69. package/dist/components/features/settings/TaxonomyManager.d.ts +54 -0
  70. package/dist/components/features/settings/TaxonomyManager.js +77 -0
  71. package/dist/components/features/settings/TypeManager.d.ts +10 -0
  72. package/dist/components/features/settings/TypeManager.js +50 -0
  73. package/dist/components/features/settings/WorkflowEditorPrototype.d.ts +15 -0
  74. package/dist/components/features/settings/WorkflowEditorPrototype.js +245 -0
  75. package/dist/components/task/TaskActionHeader.d.ts +20 -0
  76. package/dist/components/task/TaskActionHeader.js +13 -0
  77. package/dist/components/task/TaskCard.d.ts +47 -0
  78. package/dist/components/task/TaskCard.js +326 -0
  79. package/dist/components/task/TaskCard.test.d.ts +1 -0
  80. package/dist/components/task/TaskCard.test.js +95 -0
  81. package/dist/components/task/TaskContextUpload.d.ts +12 -0
  82. package/dist/components/task/TaskContextUpload.js +393 -0
  83. package/dist/components/task/TaskContextUpload.test.d.ts +1 -0
  84. package/dist/components/task/TaskContextUpload.test.js +189 -0
  85. package/dist/components/task/TaskForm.d.ts +105 -0
  86. package/dist/components/task/TaskForm.js +241 -0
  87. package/dist/components/task/TaskForm.test.d.ts +1 -0
  88. package/dist/components/task/TaskForm.test.js +288 -0
  89. package/dist/components/task/TaskKanban 2.d.ts +76 -0
  90. package/dist/components/task/TaskKanban 2.js +1004 -0
  91. package/dist/components/task/TaskKanban.d.ts +76 -0
  92. package/dist/components/task/TaskKanban.empty-column-drop.test.d.ts +1 -0
  93. package/dist/components/task/TaskKanban.empty-column-drop.test.js +66 -0
  94. package/dist/components/task/TaskKanban.js +1026 -0
  95. package/dist/components/task/TaskKanban.test.d.ts +1 -0
  96. package/dist/components/task/TaskKanban.test.js +46 -0
  97. package/dist/components/task/TaskList.d.ts +74 -0
  98. package/dist/components/task/TaskList.js +38 -0
  99. package/dist/components/task/TaskList.test.d.ts +1 -0
  100. package/dist/components/task/TaskList.test.js +270 -0
  101. package/dist/components/task/TaskScreenshotSection.d.ts +15 -0
  102. package/dist/components/task/TaskScreenshotSection.js +22 -0
  103. package/dist/components/ui/LevelSelector.d.ts +13 -0
  104. package/dist/components/ui/LevelSelector.js +25 -0
  105. package/dist/components/ui/LevelSelector.test.d.ts +1 -0
  106. package/dist/components/ui/LevelSelector.test.js +55 -0
  107. package/dist/components/ui/Markdown.d.ts +6 -0
  108. package/dist/components/ui/Markdown.js +94 -0
  109. package/dist/components/ui/Markdown.test.d.ts +1 -0
  110. package/dist/components/ui/Markdown.test.js +38 -0
  111. package/dist/components/ui/Modal.d.ts +16 -0
  112. package/dist/components/ui/Modal.js +49 -0
  113. package/dist/components/ui/MultiSelectFilter.d.ts +10 -0
  114. package/dist/components/ui/MultiSelectFilter.js +71 -0
  115. package/dist/components/ui/MultiSelectFilter.test.d.ts +1 -0
  116. package/dist/components/ui/MultiSelectFilter.test.js +74 -0
  117. package/dist/components/ui/TaxonomyDropdown.d.ts +17 -0
  118. package/dist/components/ui/TaxonomyDropdown.js +145 -0
  119. package/dist/components/ui/TaxonomyDropdown.test.d.ts +1 -0
  120. package/dist/components/ui/TaxonomyDropdown.test.js +130 -0
  121. package/dist/components/views/StandaloneLayout 2.d.ts +8 -0
  122. package/dist/components/views/StandaloneLayout 2.js +1660 -0
  123. package/dist/components/views/StandaloneLayout.d.ts +8 -0
  124. package/dist/components/views/StandaloneLayout.js +2117 -0
  125. package/dist/components/views/WidgetView.d.ts +8 -0
  126. package/dist/components/views/WidgetView.js +221 -0
  127. package/dist/config/envSchema.d.ts +28 -0
  128. package/dist/config/envSchema.js +374 -0
  129. package/dist/config/envSchema.test.d.ts +1 -0
  130. package/dist/config/envSchema.test.js +97 -0
  131. package/dist/config/surfaceBase.d.ts +2 -0
  132. package/dist/config/surfaceBase.js +8 -0
  133. package/dist/core/BulkUpdateFieldsPreview.test.d.ts +1 -0
  134. package/dist/core/BulkUpdateFieldsPreview.test.js +62 -0
  135. package/dist/core/CompletedAt.test.d.ts +1 -0
  136. package/dist/core/CompletedAt.test.js +44 -0
  137. package/dist/core/CreatedBy.test.d.ts +1 -0
  138. package/dist/core/CreatedBy.test.js +60 -0
  139. package/dist/core/EntitlementsPolicy.test.d.ts +1 -0
  140. package/dist/core/EntitlementsPolicy.test.js +145 -0
  141. package/dist/core/InitiativeTemplates.test.d.ts +1 -0
  142. package/dist/core/InitiativeTemplates.test.js +50 -0
  143. package/dist/core/ParentLifecycle.test.d.ts +1 -0
  144. package/dist/core/ParentLifecycle.test.js +98 -0
  145. package/dist/core/ScheduleFields.test.d.ts +1 -0
  146. package/dist/core/ScheduleFields.test.js +197 -0
  147. package/dist/core/SetupState.test.d.ts +1 -0
  148. package/dist/core/SetupState.test.js +113 -0
  149. package/dist/core/SystemAdmin.test.d.ts +1 -0
  150. package/dist/core/SystemAdmin.test.js +295 -0
  151. package/dist/core/TaskTaxonomyValidation.test.d.ts +1 -0
  152. package/dist/core/TaskTaxonomyValidation.test.js +64 -0
  153. package/dist/core/Taskforce.d.ts +1063 -0
  154. package/dist/core/Taskforce.ids.test.d.ts +1 -0
  155. package/dist/core/Taskforce.ids.test.js +168 -0
  156. package/dist/core/Taskforce.js +5981 -0
  157. package/dist/core/Taskforce.realtimeMutation.test.d.ts +1 -0
  158. package/dist/core/Taskforce.realtimeMutation.test.js +76 -0
  159. package/dist/core/WorkspaceDelete.test.d.ts +1 -0
  160. package/dist/core/WorkspaceDelete.test.js +140 -0
  161. package/dist/core/WorkspacePermissions.test.d.ts +1 -0
  162. package/dist/core/WorkspacePermissions.test.js +151 -0
  163. package/dist/core/WorkspacePlanMode.test.d.ts +1 -0
  164. package/dist/core/WorkspacePlanMode.test.js +104 -0
  165. package/dist/hooks/authGuardPolicy.d.ts +26 -0
  166. package/dist/hooks/authGuardPolicy.js +32 -0
  167. package/dist/hooks/authGuardPolicy.test.d.ts +1 -0
  168. package/dist/hooks/authGuardPolicy.test.js +76 -0
  169. package/dist/hooks/useDraggable.d.ts +12 -0
  170. package/dist/hooks/useDraggable.js +65 -0
  171. package/dist/hooks/useRealtimeSync.d.ts +24 -0
  172. package/dist/hooks/useRealtimeSync.js +275 -0
  173. package/dist/hooks/useRealtimeSync.test.d.ts +1 -0
  174. package/dist/hooks/useRealtimeSync.test.js +284 -0
  175. package/dist/hooks/useSyncOrchestrator.d.ts +164 -0
  176. package/dist/hooks/useSyncOrchestrator.js +1427 -0
  177. package/dist/hooks/useSyncOrchestrator.retry-closure.test.d.ts +1 -0
  178. package/dist/hooks/useSyncOrchestrator.retry-closure.test.js +367 -0
  179. package/dist/hooks/useTaskforce.d.ts +727 -0
  180. package/dist/hooks/useTaskforce.js +4396 -0
  181. package/dist/hooks/useTaskforce.priority-filters.test.d.ts +1 -0
  182. package/dist/hooks/useTaskforce.priority-filters.test.js +33 -0
  183. package/dist/hooks/useWorkspaceSyncController.d.ts +80 -0
  184. package/dist/hooks/useWorkspaceSyncController.js +598 -0
  185. package/dist/hooks/useWorkspaceSyncController.test.d.ts +1 -0
  186. package/dist/hooks/useWorkspaceSyncController.test.js +236 -0
  187. package/dist/index.d.ts +12 -0
  188. package/dist/index.js +11 -0
  189. package/dist/localization/index.d.ts +8 -0
  190. package/dist/localization/index.js +81 -0
  191. package/dist/localization/locales/en-US.d.ts +151 -0
  192. package/dist/localization/locales/en-US.js +150 -0
  193. package/dist/localization/locales/es-419.d.ts +2 -0
  194. package/dist/localization/locales/es-419.js +150 -0
  195. package/dist/localization/locales/pt-BR.d.ts +2 -0
  196. package/dist/localization/locales/pt-BR.js +150 -0
  197. package/dist/main.d.ts +1 -0
  198. package/dist/main.js +33 -0
  199. package/dist/mcp/optionResolution.d.ts +14 -0
  200. package/dist/mcp/optionResolution.js +126 -0
  201. package/dist/mcp/optionResolution.test.d.ts +1 -0
  202. package/dist/mcp/optionResolution.test.js +39 -0
  203. package/dist/mcp/server.d.ts +1 -0
  204. package/dist/mcp/server.js +1793 -0
  205. package/dist/mcp/structuredCommentValidation.d.ts +6 -0
  206. package/dist/mcp/structuredCommentValidation.js +56 -0
  207. package/dist/mcp/structuredDocValidation.d.ts +6 -0
  208. package/dist/mcp/structuredDocValidation.js +75 -0
  209. package/dist/migrations/billingSchemaParity.test.d.ts +1 -0
  210. package/dist/migrations/billingSchemaParity.test.js +46 -0
  211. package/dist/migrations/clientMigrations.d.ts +9 -0
  212. package/dist/migrations/clientMigrations.js +74 -0
  213. package/dist/migrations/flags.d.ts +6 -0
  214. package/dist/migrations/flags.js +8 -0
  215. package/dist/migrations/taskMigrations.d.ts +71 -0
  216. package/dist/migrations/taskMigrations.js +236 -0
  217. package/dist/migrations/taskMigrations.test.d.ts +1 -0
  218. package/dist/migrations/taskMigrations.test.js +34 -0
  219. package/dist/migrations/taskSchemaMigrations.d.ts +11 -0
  220. package/dist/migrations/taskSchemaMigrations.js +453 -0
  221. package/dist/plugins/index.d.ts +10 -0
  222. package/dist/plugins/index.js +10 -0
  223. package/dist/plugins/vite.d.ts +19 -0
  224. package/dist/plugins/vite.js +271 -0
  225. package/dist/public/android-chrome-192x192.png +0 -0
  226. package/dist/public/android-chrome-512x512.png +0 -0
  227. package/dist/public/apple-touch-icon.png +0 -0
  228. package/dist/public/favicon-16x16.png +0 -0
  229. package/dist/public/favicon-32x32.png +0 -0
  230. package/dist/public/favicon.ico +0 -0
  231. package/dist/public/favicon.png +0 -0
  232. package/dist/public/site.webmanifest +1 -0
  233. package/dist/public/taskforce.png +0 -0
  234. package/dist/resources/templates/WORKFLOW_V2_POLICY.md +55 -0
  235. package/dist/resources/templates/environments/aider.yaml +14 -0
  236. package/dist/resources/templates/environments/antigravity.yaml +10 -0
  237. package/dist/resources/templates/environments/claude.yaml +10 -0
  238. package/dist/resources/templates/environments/cline.yaml +10 -0
  239. package/dist/resources/templates/environments/codex.yaml +13 -0
  240. package/dist/resources/templates/environments/copilot.yaml +10 -0
  241. package/dist/resources/templates/environments/cursor.yaml +9 -0
  242. package/dist/resources/templates/environments/gemini.yaml +9 -0
  243. package/dist/resources/templates/environments/windsurf.yaml +10 -0
  244. package/dist/resources/templates/workflow-sources/README.md +9 -0
  245. package/dist/resources/templates/workflow-sources/workflowDocs.mjs +520 -0
  246. package/dist/resources/templates/workflow-sources/workflowEditorOverrides.json +1 -0
  247. package/dist/resources/templates/workflows/collaborate.yaml +104 -0
  248. package/dist/resources/templates/workflows/do.yaml +82 -0
  249. package/dist/resources/templates/workflows/evaluate.yaml +111 -0
  250. package/dist/resources/templates/workflows/execute.yaml +142 -0
  251. package/dist/resources/templates/workflows/plan.yaml +112 -0
  252. package/dist/resources/templates/workflows/review.yaml +109 -0
  253. package/dist/runtime/capabilities.d.ts +8 -0
  254. package/dist/runtime/capabilities.js +16 -0
  255. package/dist/security/virusScan.d.ts +16 -0
  256. package/dist/security/virusScan.js +83 -0
  257. package/dist/server/auth.d.ts +51 -0
  258. package/dist/server/auth.js +266 -0
  259. package/dist/server/auth.test.d.ts +1 -0
  260. package/dist/server/auth.test.js +111 -0
  261. package/dist/server/buildInfo.d.ts +7 -0
  262. package/dist/server/buildInfo.js +100 -0
  263. package/dist/server/buildInfo.test.d.ts +1 -0
  264. package/dist/server/buildInfo.test.js +29 -0
  265. package/dist/server/cors.d.ts +7 -0
  266. package/dist/server/cors.js +76 -0
  267. package/dist/server/cors.test.d.ts +1 -0
  268. package/dist/server/cors.test.js +71 -0
  269. package/dist/server/email.d.ts +28 -0
  270. package/dist/server/email.js +138 -0
  271. package/dist/server/email.test.d.ts +1 -0
  272. package/dist/server/email.test.js +113 -0
  273. package/dist/server/index.cookieProxy.test.d.ts +1 -0
  274. package/dist/server/index.cookieProxy.test.js +19 -0
  275. package/dist/server/index.d.ts +17 -0
  276. package/dist/server/index.js +757 -0
  277. package/dist/server/index.rateLimit.test.d.ts +1 -0
  278. package/dist/server/index.rateLimit.test.js +13 -0
  279. package/dist/server/index.test.d.ts +1 -0
  280. package/dist/server/index.test.js +19 -0
  281. package/dist/server/rateLimit.d.ts +29 -0
  282. package/dist/server/rateLimit.js +99 -0
  283. package/dist/server/rateLimit.test.d.ts +1 -0
  284. package/dist/server/rateLimit.test.js +107 -0
  285. package/dist/server/realtimeSync.auth.test.d.ts +1 -0
  286. package/dist/server/realtimeSync.auth.test.js +62 -0
  287. package/dist/server/realtimeSync.replay.test.d.ts +1 -0
  288. package/dist/server/realtimeSync.replay.test.js +192 -0
  289. package/dist/server/realtimeSync.workspaceIsolation.test.d.ts +1 -0
  290. package/dist/server/realtimeSync.workspaceIsolation.test.js +101 -0
  291. package/dist/server/realtimeSyncWs.d.ts +30 -0
  292. package/dist/server/realtimeSyncWs.js +257 -0
  293. package/dist/server/routes.billing.d.ts +15 -0
  294. package/dist/server/routes.billing.js +991 -0
  295. package/dist/server/routes.billing.test.d.ts +1 -0
  296. package/dist/server/routes.billing.test.js +387 -0
  297. package/dist/server/routes.d.ts +72 -0
  298. package/dist/server/routes.js +4820 -0
  299. package/dist/server/routes.sync.d.ts +17 -0
  300. package/dist/server/routes.sync.integration.test.d.ts +1 -0
  301. package/dist/server/routes.sync.integration.test.js +470 -0
  302. package/dist/server/routes.sync.js +1141 -0
  303. package/dist/server/routes.test.d.ts +1 -0
  304. package/dist/server/routes.test.js +4945 -0
  305. package/dist/server/runtimeMode.d.ts +4 -0
  306. package/dist/server/runtimeMode.js +25 -0
  307. package/dist/server/runtimeMode.test.d.ts +1 -0
  308. package/dist/server/runtimeMode.test.js +26 -0
  309. package/dist/server/securityHeaders.d.ts +3 -0
  310. package/dist/server/securityHeaders.js +25 -0
  311. package/dist/server/securityHeaders.test.d.ts +1 -0
  312. package/dist/server/securityHeaders.test.js +32 -0
  313. package/dist/server/smtpTransport.d.ts +21 -0
  314. package/dist/server/smtpTransport.js +11 -0
  315. package/dist/server/start.d.ts +1 -0
  316. package/dist/server/start.js +17 -0
  317. package/dist/services/formatTransformers.d.ts +29 -0
  318. package/dist/services/formatTransformers.js +56 -0
  319. package/dist/services/templateEngine.d.ts +46 -0
  320. package/dist/services/templateEngine.js +148 -0
  321. package/dist/shared/runtimeContract.d.ts +12 -0
  322. package/dist/shared/runtimeContract.js +23 -0
  323. package/dist/shared/runtimeContract.test.d.ts +1 -0
  324. package/dist/shared/runtimeContract.test.js +23 -0
  325. package/dist/soak/preflight.cli.d.ts +1 -0
  326. package/dist/soak/preflight.cli.js +28 -0
  327. package/dist/soak/preflight.d.ts +26 -0
  328. package/dist/soak/preflight.js +113 -0
  329. package/dist/soak/preflight.test.d.ts +1 -0
  330. package/dist/soak/preflight.test.js +39 -0
  331. package/dist/soak/syncSoakHarness.d.ts +6 -0
  332. package/dist/soak/syncSoakHarness.js +10 -0
  333. package/dist/storage/createDatabaseAdapter.d.ts +2 -0
  334. package/dist/storage/createDatabaseAdapter.js +9 -0
  335. package/dist/storage/databaseAdapter.d.ts +22 -0
  336. package/dist/storage/databaseAdapter.js +1 -0
  337. package/dist/storage/documentIntegrity.d.ts +28 -0
  338. package/dist/storage/documentIntegrity.js +103 -0
  339. package/dist/storage/documentPurge.d.ts +14 -0
  340. package/dist/storage/documentPurge.js +46 -0
  341. package/dist/storage/documentRegistry.d.ts +39 -0
  342. package/dist/storage/documentRegistry.js +115 -0
  343. package/dist/storage/integritySchedule.d.ts +17 -0
  344. package/dist/storage/integritySchedule.js +62 -0
  345. package/dist/storage/objectStorage.d.ts +20 -0
  346. package/dist/storage/objectStorage.js +15 -0
  347. package/dist/storage/objectStorageClient.d.ts +18 -0
  348. package/dist/storage/objectStorageClient.js +301 -0
  349. package/dist/storage/objectStorageConfig.d.ts +2 -0
  350. package/dist/storage/objectStorageConfig.js +45 -0
  351. package/dist/storage/postgresAdapter.d.ts +20 -0
  352. package/dist/storage/postgresAdapter.js +204 -0
  353. package/dist/storage/postgresWorker.d.ts +1 -0
  354. package/dist/storage/postgresWorker.js +110 -0
  355. package/dist/storage/providerConfig.d.ts +6 -0
  356. package/dist/storage/providerConfig.js +11 -0
  357. package/dist/storage/sqliteAdapter.d.ts +14 -0
  358. package/dist/storage/sqliteAdapter.js +28 -0
  359. package/dist/storage/taskAssetStore.d.ts +56 -0
  360. package/dist/storage/taskAssetStore.js +297 -0
  361. package/dist/sync/cloudSyncApi.d.ts +47 -0
  362. package/dist/sync/cloudSyncApi.js +138 -0
  363. package/dist/sync/cloudSyncApi.test.d.ts +1 -0
  364. package/dist/sync/cloudSyncApi.test.js +54 -0
  365. package/dist/sync/encryptionService.d.ts +11 -0
  366. package/dist/sync/encryptionService.js +61 -0
  367. package/dist/sync/encryptionService.test.d.ts +1 -0
  368. package/dist/sync/encryptionService.test.js +52 -0
  369. package/dist/sync/realtimeFeature.d.ts +6 -0
  370. package/dist/sync/realtimeFeature.js +20 -0
  371. package/dist/sync/realtimeFeature.test.d.ts +1 -0
  372. package/dist/sync/realtimeFeature.test.js +30 -0
  373. package/dist/sync/realtimeReconcile.d.ts +30 -0
  374. package/dist/sync/realtimeReconcile.js +90 -0
  375. package/dist/sync/realtimeReconcile.test.d.ts +1 -0
  376. package/dist/sync/realtimeReconcile.test.js +43 -0
  377. package/dist/sync/syncService.d.ts +96 -0
  378. package/dist/sync/syncService.js +423 -0
  379. package/dist/sync/syncService.test.d.ts +1 -0
  380. package/dist/sync/syncService.test.js +484 -0
  381. package/dist/sync/workspaceSyncModel.d.ts +61 -0
  382. package/dist/sync/workspaceSyncModel.js +136 -0
  383. package/dist/sync/workspaceSyncModel.test.d.ts +1 -0
  384. package/dist/sync/workspaceSyncModel.test.js +73 -0
  385. package/dist/test/setup.d.ts +1 -0
  386. package/dist/test/setup.js +15 -0
  387. package/dist/types.d.ts +157 -0
  388. package/dist/types.js +41 -0
  389. package/dist/ui/assets/RussoOne-Regular-C3BxZIj7.ttf +0 -0
  390. package/dist/ui/assets/index-0W5vyCpn.css +1 -0
  391. package/dist/ui/assets/index-MCZuNNfn.js +23 -0
  392. package/dist/ui/assets/logo_white_01-0Vx-iIIv.png +0 -0
  393. package/dist/ui/assets/taskforce-BxLPokNB.png +0 -0
  394. package/dist/ui/assets/vendor-dnd-BI1K77C1.js +5 -0
  395. package/dist/ui/assets/vendor-icons-ZFG3SGwo.js +1 -0
  396. package/dist/ui/assets/vendor-markdown-CKYkQHfj.js +29 -0
  397. package/dist/ui/assets/vendor-react-DdIDsh7f.js +9 -0
  398. package/dist/ui/assets/vendor-router-BtiNU7Dl.js +3 -0
  399. package/dist/ui/branding/logos/logo_black_01.png +0 -0
  400. package/dist/ui/branding/logos/logo_black_02.png +0 -0
  401. package/dist/ui/branding/logos/logo_white_01.png +0 -0
  402. package/dist/ui/branding/logos/logo_white_02.png +0 -0
  403. package/dist/ui/favicon/android-chrome-192x192.png +0 -0
  404. package/dist/ui/favicon/android-chrome-512x512.png +0 -0
  405. package/dist/ui/favicon/apple-touch-icon.png +0 -0
  406. package/dist/ui/favicon/favicon-16x16.png +0 -0
  407. package/dist/ui/favicon/favicon-32x32.png +0 -0
  408. package/dist/ui/favicon/favicon.ico +0 -0
  409. package/dist/ui/favicon/favicon.png +0 -0
  410. package/dist/ui/favicon/site.webmanifest +1 -0
  411. package/dist/ui/fonts/RussoOne-Regular.ttf +0 -0
  412. package/dist/ui/images/taskforce.png +0 -0
  413. package/dist/ui/index.html +19 -0
  414. package/dist/utils/checklistMarkdown.d.ts +9 -0
  415. package/dist/utils/checklistMarkdown.js +46 -0
  416. package/dist/utils/constants.d.ts +21 -0
  417. package/dist/utils/constants.icons.test.d.ts +1 -0
  418. package/dist/utils/constants.icons.test.js +40 -0
  419. package/dist/utils/constants.js +100 -0
  420. package/dist/utils/contextFiles.d.ts +8 -0
  421. package/dist/utils/contextFiles.js +54 -0
  422. package/dist/utils/formatting.d.ts +5 -0
  423. package/dist/utils/formatting.js +30 -0
  424. package/dist/utils/planParser.d.ts +22 -0
  425. package/dist/utils/planParser.js +151 -0
  426. package/dist/utils/taskDragZones.d.ts +8 -0
  427. package/dist/utils/taskDragZones.js +14 -0
  428. package/dist/utils/taskDragZones.test.d.ts +1 -0
  429. package/dist/utils/taskDragZones.test.js +14 -0
  430. package/dist/utils/taskHierarchy.d.ts +4 -0
  431. package/dist/utils/taskHierarchy.js +69 -0
  432. package/dist/utils/taskHierarchy.test.d.ts +1 -0
  433. package/dist/utils/taskHierarchy.test.js +38 -0
  434. package/dist/utils/taskParenting.d.ts +3 -0
  435. package/dist/utils/taskParenting.js +24 -0
  436. package/dist/utils/taskParenting.test.d.ts +1 -0
  437. package/dist/utils/taskParenting.test.js +21 -0
  438. package/dist/utils/taskRelations.d.ts +6 -0
  439. package/dist/utils/taskRelations.js +24 -0
  440. package/dist/utils/taskRelations.test.d.ts +1 -0
  441. package/dist/utils/taskRelations.test.js +34 -0
  442. package/dist/utils/taskUtils.d.ts +2 -0
  443. package/dist/utils/taskUtils.js +20 -0
  444. package/dist/utils/taskforceApiClient.d.ts +7 -0
  445. package/dist/utils/taskforceApiClient.js +42 -0
  446. package/dist/utils/workspaceIdentity.d.ts +8 -0
  447. package/dist/utils/workspaceIdentity.js +47 -0
  448. package/dist/utils/workspaceIdentity.test.d.ts +1 -0
  449. package/dist/utils/workspaceIdentity.test.js +32 -0
  450. package/dist/utils/workspaceLifecycle.d.ts +26 -0
  451. package/dist/utils/workspaceLifecycle.js +69 -0
  452. package/dist/utils/workspaceLifecycle.test.d.ts +1 -0
  453. package/dist/utils/workspaceLifecycle.test.js +64 -0
  454. package/package.json +133 -0
  455. package/scripts/check-compat-boundaries.js +48 -0
  456. package/scripts/check-env.ts +24 -0
  457. package/scripts/check-localization-strings.mjs +49 -0
  458. package/scripts/check-runtime-boundaries.mjs +44 -0
  459. package/scripts/debug-global.mjs +34 -0
  460. package/scripts/debug-server.mjs +36 -0
  461. package/scripts/export-sqlite-to-postgres.mjs +125 -0
  462. package/scripts/generate-env-example.ts +8 -0
  463. package/scripts/generate-workflow-templates.mjs +134 -0
  464. package/scripts/mcp-stdio-adapter.mjs +160 -0
  465. package/scripts/postinstall.js +60 -0
  466. package/scripts/release-version-lib.mjs +88 -0
  467. package/scripts/release-version.mjs +72 -0
  468. package/scripts/run-dev-proxy.sh +49 -0
  469. package/scripts/run-e2e-realtime.sh +16 -0
  470. package/scripts/run-smoke.sh +23 -0
  471. package/scripts/run-soak.sh +29 -0
  472. package/scripts/test-global.js +143 -0
  473. package/scripts/update-homebrew-formula.sh +38 -0
  474. package/src/resources/templates/WORKFLOW_V2_POLICY.md +55 -0
  475. package/src/resources/templates/environments/aider.yaml +14 -0
  476. package/src/resources/templates/environments/antigravity.yaml +10 -0
  477. package/src/resources/templates/environments/claude.yaml +10 -0
  478. package/src/resources/templates/environments/cline.yaml +10 -0
  479. package/src/resources/templates/environments/codex.yaml +13 -0
  480. package/src/resources/templates/environments/copilot.yaml +10 -0
  481. package/src/resources/templates/environments/cursor.yaml +9 -0
  482. package/src/resources/templates/environments/gemini.yaml +9 -0
  483. package/src/resources/templates/environments/windsurf.yaml +10 -0
  484. package/src/resources/templates/workflow-sources/README.md +9 -0
  485. package/src/resources/templates/workflow-sources/workflowDocs.mjs +520 -0
  486. package/src/resources/templates/workflow-sources/workflowEditorOverrides.json +1 -0
  487. package/src/resources/templates/workflows/collaborate.yaml +104 -0
  488. package/src/resources/templates/workflows/do.yaml +82 -0
  489. package/src/resources/templates/workflows/evaluate.yaml +111 -0
  490. package/src/resources/templates/workflows/execute.yaml +142 -0
  491. package/src/resources/templates/workflows/plan.yaml +112 -0
  492. 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 {};