@exaudeus/workrail 0.8.5 → 0.9.0

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 (424) hide show
  1. package/README.md +157 -403
  2. package/dist/application/services/enhanced-loop-validator.d.ts +2 -2
  3. package/dist/application/services/enhanced-loop-validator.js +12 -2
  4. package/dist/application/services/validation-engine.d.ts +8 -29
  5. package/dist/application/services/validation-engine.js +38 -21
  6. package/dist/application/services/workflow-compiler.d.ts +18 -0
  7. package/dist/application/services/workflow-compiler.js +79 -0
  8. package/dist/application/services/workflow-interpreter.d.ts +31 -0
  9. package/dist/application/services/workflow-interpreter.js +280 -0
  10. package/dist/application/services/workflow-service.d.ts +34 -32
  11. package/dist/application/services/workflow-service.js +93 -425
  12. package/dist/application/use-cases/get-next-step.d.ts +6 -10
  13. package/dist/application/use-cases/get-next-step.js +2 -6
  14. package/dist/application/use-cases/get-workflow.d.ts +8 -6
  15. package/dist/application/use-cases/get-workflow.js +42 -33
  16. package/dist/application/use-cases/list-workflows.d.ts +3 -3
  17. package/dist/application/use-cases/validate-step-output.d.ts +4 -4
  18. package/dist/application/use-cases/validate-workflow-file.d.ts +46 -0
  19. package/dist/application/use-cases/validate-workflow-file.js +57 -0
  20. package/dist/cli/commands/cleanup.d.ts +8 -0
  21. package/dist/cli/commands/cleanup.js +20 -0
  22. package/dist/cli/commands/index.d.ts +7 -0
  23. package/dist/cli/commands/index.js +21 -0
  24. package/dist/cli/commands/init.d.ts +11 -0
  25. package/dist/cli/commands/init.js +49 -0
  26. package/dist/cli/commands/list.d.ts +9 -0
  27. package/dist/cli/commands/list.js +34 -0
  28. package/dist/cli/commands/migrate.d.ts +78 -0
  29. package/dist/cli/commands/migrate.js +248 -0
  30. package/dist/cli/commands/sources.d.ts +21 -0
  31. package/dist/cli/commands/sources.js +87 -0
  32. package/dist/cli/commands/start.d.ts +8 -0
  33. package/dist/cli/commands/start.js +16 -0
  34. package/dist/cli/commands/validate.d.ts +6 -0
  35. package/dist/cli/commands/validate.js +55 -0
  36. package/dist/cli/interpret-result.d.ts +4 -0
  37. package/dist/cli/interpret-result.js +24 -0
  38. package/dist/cli/output-formatter.d.ts +10 -0
  39. package/dist/cli/output-formatter.js +97 -0
  40. package/dist/cli/types/cli-result.d.ts +23 -0
  41. package/dist/cli/types/cli-result.js +30 -0
  42. package/dist/cli/types/exit-code.d.ts +13 -0
  43. package/dist/cli/types/exit-code.js +23 -0
  44. package/dist/cli/types/index.d.ts +4 -0
  45. package/dist/cli/types/index.js +11 -0
  46. package/dist/cli.js +84 -278
  47. package/dist/config/app-config.d.ts +40 -0
  48. package/dist/config/app-config.js +58 -0
  49. package/dist/config/feature-flags.d.ts +10 -2
  50. package/dist/config/feature-flags.js +74 -12
  51. package/dist/core/error-handler.d.ts +18 -27
  52. package/dist/core/error-handler.js +24 -218
  53. package/dist/di/container.d.ts +12 -0
  54. package/dist/di/container.js +244 -0
  55. package/dist/di/tokens.d.ts +40 -0
  56. package/dist/di/tokens.js +42 -0
  57. package/dist/domain/execution/error.d.ts +32 -0
  58. package/dist/domain/execution/error.js +24 -0
  59. package/dist/domain/execution/event.d.ts +7 -0
  60. package/dist/domain/execution/event.js +11 -0
  61. package/dist/domain/execution/ids.d.ts +9 -0
  62. package/dist/domain/execution/ids.js +9 -0
  63. package/dist/domain/execution/result.d.ts +3 -0
  64. package/dist/domain/execution/result.js +10 -0
  65. package/dist/domain/execution/state.d.ts +57 -0
  66. package/dist/domain/execution/state.js +28 -0
  67. package/dist/errors/app-error.d.ts +23 -0
  68. package/dist/errors/factories.d.ts +6 -0
  69. package/dist/errors/factories.js +21 -0
  70. package/dist/errors/formatter.d.ts +2 -0
  71. package/dist/errors/formatter.js +32 -0
  72. package/dist/errors/index.d.ts +3 -0
  73. package/dist/errors/index.js +7 -0
  74. package/dist/index.d.ts +6 -1
  75. package/dist/index.js +10 -25
  76. package/dist/infrastructure/index.d.ts +0 -1
  77. package/dist/infrastructure/index.js +0 -1
  78. package/dist/infrastructure/session/DashboardHeartbeat.d.ts +8 -0
  79. package/dist/infrastructure/session/DashboardHeartbeat.js +39 -0
  80. package/dist/infrastructure/session/DashboardLockRelease.d.ts +2 -0
  81. package/dist/infrastructure/session/DashboardLockRelease.js +29 -0
  82. package/dist/infrastructure/session/HttpServer.d.ts +25 -6
  83. package/dist/infrastructure/session/HttpServer.js +245 -90
  84. package/dist/infrastructure/session/SessionDataNormalizer.js +12 -2
  85. package/dist/infrastructure/session/SessionDataValidator.js +12 -2
  86. package/dist/infrastructure/session/SessionManager.d.ts +5 -3
  87. package/dist/infrastructure/session/SessionManager.js +52 -6
  88. package/dist/infrastructure/storage/caching-workflow-storage.d.ts +30 -6
  89. package/dist/infrastructure/storage/caching-workflow-storage.js +105 -23
  90. package/dist/infrastructure/storage/enhanced-multi-source-workflow-storage.d.ts +13 -9
  91. package/dist/infrastructure/storage/enhanced-multi-source-workflow-storage.js +80 -54
  92. package/dist/infrastructure/storage/file-workflow-storage.d.ts +10 -8
  93. package/dist/infrastructure/storage/file-workflow-storage.js +48 -56
  94. package/dist/infrastructure/storage/git-workflow-storage.d.ts +7 -22
  95. package/dist/infrastructure/storage/git-workflow-storage.js +48 -103
  96. package/dist/infrastructure/storage/in-memory-storage.d.ts +10 -6
  97. package/dist/infrastructure/storage/in-memory-storage.js +18 -13
  98. package/dist/infrastructure/storage/plugin-workflow-storage.d.ts +6 -18
  99. package/dist/infrastructure/storage/plugin-workflow-storage.js +29 -51
  100. package/dist/infrastructure/storage/remote-workflow-storage.d.ts +8 -17
  101. package/dist/infrastructure/storage/remote-workflow-storage.js +33 -156
  102. package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts +21 -13
  103. package/dist/infrastructure/storage/schema-validating-workflow-storage.js +86 -24
  104. package/dist/infrastructure/storage/storage.d.ts +7 -5
  105. package/dist/infrastructure/storage/storage.js +7 -6
  106. package/dist/manifest.json +1093 -0
  107. package/dist/mcp/error-mapper.d.ts +9 -0
  108. package/dist/mcp/error-mapper.js +66 -0
  109. package/dist/mcp/handlers/session.d.ts +34 -0
  110. package/dist/mcp/handlers/session.js +135 -0
  111. package/dist/mcp/handlers/v2-workflow.d.ts +4 -0
  112. package/dist/mcp/handlers/v2-workflow.js +112 -0
  113. package/dist/mcp/handlers/workflow.d.ts +45 -0
  114. package/dist/mcp/handlers/workflow.js +167 -0
  115. package/dist/mcp/index.d.ts +16 -0
  116. package/dist/mcp/index.js +51 -0
  117. package/dist/mcp/output-schemas.d.ts +317 -0
  118. package/dist/mcp/output-schemas.js +91 -0
  119. package/dist/mcp/server.d.ts +3 -0
  120. package/dist/mcp/server.js +258 -0
  121. package/dist/mcp/tool-description-provider.d.ts +16 -0
  122. package/dist/mcp/tool-description-provider.js +43 -0
  123. package/dist/mcp/tool-descriptions.d.ts +2 -0
  124. package/dist/mcp/tool-descriptions.js +109 -0
  125. package/dist/mcp/tool-factory.d.ts +23 -0
  126. package/dist/mcp/tool-factory.js +14 -0
  127. package/dist/mcp/tools.d.ts +156 -0
  128. package/dist/mcp/tools.js +196 -0
  129. package/dist/mcp/types/tool-description-types.d.ts +8 -0
  130. package/dist/mcp/types/tool-description-types.js +24 -0
  131. package/dist/mcp/types.d.ts +25 -0
  132. package/dist/mcp/types.js +15 -0
  133. package/dist/mcp/v2/tool-registry.d.ts +11 -0
  134. package/dist/mcp/v2/tool-registry.js +26 -0
  135. package/dist/mcp/v2/tools.d.ts +20 -0
  136. package/dist/mcp/v2/tools.js +17 -0
  137. package/dist/mcp/validation/bounded-json.d.ts +3 -0
  138. package/dist/mcp/validation/bounded-json.js +22 -0
  139. package/dist/mcp/validation/workflow-next-prevalidate.d.ts +9 -0
  140. package/dist/mcp/validation/workflow-next-prevalidate.js +83 -0
  141. package/dist/mcp/zod-to-json-schema.d.ts +17 -0
  142. package/dist/mcp/zod-to-json-schema.js +134 -0
  143. package/dist/mcp-server.d.ts +1 -1
  144. package/dist/mcp-server.js +6 -424
  145. package/dist/runtime/adapters/in-memory-shutdown-events.d.ts +6 -0
  146. package/dist/runtime/adapters/in-memory-shutdown-events.js +20 -0
  147. package/dist/runtime/adapters/node-process-signals.d.ts +4 -0
  148. package/dist/runtime/adapters/node-process-signals.js +11 -0
  149. package/dist/runtime/adapters/node-process-terminator.d.ts +4 -0
  150. package/dist/runtime/adapters/node-process-terminator.js +17 -0
  151. package/dist/runtime/adapters/noop-process-signals.d.ts +4 -0
  152. package/dist/runtime/adapters/noop-process-signals.js +8 -0
  153. package/dist/runtime/adapters/throwing-process-terminator.d.ts +4 -0
  154. package/dist/runtime/adapters/throwing-process-terminator.js +9 -0
  155. package/dist/runtime/assert-never.d.ts +1 -0
  156. package/dist/runtime/assert-never.js +6 -0
  157. package/dist/runtime/brand.d.ts +5 -0
  158. package/dist/runtime/ports/process-signals.d.ts +4 -0
  159. package/dist/runtime/ports/process-signals.js +2 -0
  160. package/dist/runtime/ports/process-terminator.d.ts +8 -0
  161. package/dist/runtime/ports/process-terminator.js +2 -0
  162. package/dist/runtime/ports/shutdown-events.d.ts +11 -0
  163. package/dist/runtime/ports/shutdown-events.js +2 -0
  164. package/dist/runtime/process-lifecycle-policy.d.ts +5 -0
  165. package/dist/runtime/process-lifecycle-policy.js +2 -0
  166. package/dist/runtime/result.d.ts +17 -0
  167. package/dist/runtime/result.js +31 -0
  168. package/dist/runtime/runtime-mode.d.ts +9 -0
  169. package/dist/runtime/runtime-mode.js +2 -0
  170. package/dist/types/storage.d.ts +16 -5
  171. package/dist/types/storage.js +8 -0
  172. package/dist/types/validation.d.ts +27 -0
  173. package/dist/types/validation.js +10 -0
  174. package/dist/types/workflow-definition.d.ts +63 -0
  175. package/dist/types/workflow-definition.js +33 -0
  176. package/dist/types/workflow-source.d.ts +51 -0
  177. package/dist/types/workflow-source.js +128 -0
  178. package/dist/types/workflow.d.ts +28 -0
  179. package/dist/types/workflow.js +96 -0
  180. package/dist/utils/workflow-init.d.ts +1 -0
  181. package/dist/utils/workflow-init.js +38 -0
  182. package/dist/v2/durable-core/canonical/hashing.d.ts +11 -0
  183. package/dist/v2/durable-core/canonical/hashing.js +13 -0
  184. package/dist/v2/durable-core/canonical/jcs.d.ts +11 -0
  185. package/dist/v2/durable-core/canonical/jcs.js +65 -0
  186. package/dist/v2/durable-core/canonical/json-types.d.ts +6 -0
  187. package/dist/v2/durable-core/canonical/json-types.js +2 -0
  188. package/dist/v2/durable-core/canonical/json-zod.d.ts +2 -0
  189. package/dist/v2/durable-core/canonical/json-zod.js +7 -0
  190. package/dist/v2/durable-core/canonical/jsonl.d.ts +4 -0
  191. package/dist/v2/durable-core/canonical/jsonl.js +13 -0
  192. package/dist/v2/durable-core/ids/index.d.ts +23 -0
  193. package/dist/v2/durable-core/ids/index.js +46 -0
  194. package/dist/v2/durable-core/schemas/compiled-workflow/index.d.ts +47 -0
  195. package/dist/v2/durable-core/schemas/compiled-workflow/index.js +17 -0
  196. package/dist/v2/durable-core/schemas/session/events.d.ts +1812 -0
  197. package/dist/v2/durable-core/schemas/session/events.js +328 -0
  198. package/dist/v2/durable-core/schemas/session/index.d.ts +2 -0
  199. package/dist/v2/durable-core/schemas/session/index.js +8 -0
  200. package/dist/v2/durable-core/schemas/session/manifest.d.ts +57 -0
  201. package/dist/v2/durable-core/schemas/session/manifest.js +30 -0
  202. package/dist/v2/infra/local/crypto/index.d.ts +5 -0
  203. package/dist/v2/infra/local/crypto/index.js +12 -0
  204. package/dist/v2/infra/local/data-dir/index.d.ts +13 -0
  205. package/dist/v2/infra/local/data-dir/index.js +69 -0
  206. package/dist/v2/infra/local/fs/index.d.ts +26 -0
  207. package/dist/v2/infra/local/fs/index.js +156 -0
  208. package/dist/v2/infra/local/pinned-workflow-store/index.d.ts +11 -0
  209. package/dist/v2/infra/local/pinned-workflow-store/index.js +85 -0
  210. package/dist/v2/infra/local/session-lock/index.d.ts +12 -0
  211. package/dist/v2/infra/local/session-lock/index.js +44 -0
  212. package/dist/v2/infra/local/session-store/index.d.ts +22 -0
  213. package/dist/v2/infra/local/session-store/index.js +358 -0
  214. package/dist/v2/infra/local/sha256/index.d.ts +5 -0
  215. package/dist/v2/infra/local/sha256/index.js +12 -0
  216. package/dist/v2/ports/data-dir.port.d.ts +9 -0
  217. package/dist/v2/ports/data-dir.port.js +2 -0
  218. package/dist/v2/ports/fs.port.d.ts +41 -0
  219. package/dist/v2/ports/fs.port.js +2 -0
  220. package/dist/v2/ports/pinned-workflow-store.port.d.ts +11 -0
  221. package/dist/v2/ports/pinned-workflow-store.port.js +2 -0
  222. package/dist/v2/ports/session-event-log-store.port.d.ts +37 -0
  223. package/dist/v2/ports/session-event-log-store.port.js +2 -0
  224. package/dist/v2/ports/session-lock.port.d.ts +23 -0
  225. package/dist/v2/ports/session-lock.port.js +2 -0
  226. package/dist/v2/ports/sha256.port.d.ts +4 -0
  227. package/dist/v2/ports/sha256.port.js +2 -0
  228. package/dist/v2/projections/advance-outcomes.d.ts +23 -0
  229. package/dist/v2/projections/advance-outcomes.js +23 -0
  230. package/dist/v2/projections/capabilities.d.ts +27 -0
  231. package/dist/v2/projections/capabilities.js +33 -0
  232. package/dist/v2/projections/gaps.d.ts +29 -0
  233. package/dist/v2/projections/gaps.js +49 -0
  234. package/dist/v2/projections/node-outputs.d.ts +34 -0
  235. package/dist/v2/projections/node-outputs.js +73 -0
  236. package/dist/v2/projections/preferences.d.ts +28 -0
  237. package/dist/v2/projections/preferences.js +50 -0
  238. package/dist/v2/projections/run-dag.d.ts +42 -0
  239. package/dist/v2/projections/run-dag.js +186 -0
  240. package/dist/v2/projections/run-status-signals.d.ts +26 -0
  241. package/dist/v2/projections/run-status-signals.js +49 -0
  242. package/dist/v2/projections/session-health.d.ts +18 -0
  243. package/dist/v2/projections/session-health.js +15 -0
  244. package/dist/v2/read-only/v1-to-v2-shim.d.ts +3 -0
  245. package/dist/v2/read-only/v1-to-v2-shim.js +38 -0
  246. package/package.json +35 -10
  247. package/spec/mcp-api-v1.0.md +5 -5
  248. package/web/assets/services/data-normalizer.js +17 -2
  249. package/web/assets/services/pattern-recognizer.js +3 -1
  250. package/web/assets/services/session-data.js +13 -8
  251. package/web/assets/utils/formatters.js +34 -23
  252. package/workflows/CHANGELOG-bug-investigation.md +4 -4
  253. package/workflows/bug-investigation.agentic.json +156 -56
  254. package/workflows/coding-task-workflow-agentic.json +262 -0
  255. package/workflows/design-thinking-workflow-autonomous.agentic.json +215 -0
  256. package/workflows/design-thinking-workflow.json +198 -0
  257. package/workflows/mr-review-workflow.agentic.json +538 -0
  258. package/workflows/routines/context-gathering.json +0 -4
  259. package/workflows/routines/ideation.json +73 -0
  260. package/dist/application/app.d.ts +0 -29
  261. package/dist/application/app.d.ts.map +0 -1
  262. package/dist/application/app.js +0 -114
  263. package/dist/application/app.js.map +0 -1
  264. package/dist/application/decorators/simple-output-decorator.d.ts +0 -8
  265. package/dist/application/decorators/simple-output-decorator.js +0 -89
  266. package/dist/application/services/classification-engine.d.ts +0 -33
  267. package/dist/application/services/classification-engine.js +0 -258
  268. package/dist/application/services/compression-service.d.ts +0 -20
  269. package/dist/application/services/compression-service.js +0 -312
  270. package/dist/application/services/context-management-service.d.ts +0 -38
  271. package/dist/application/services/context-management-service.js +0 -301
  272. package/dist/application/services/context-optimizer.d.ts +0 -11
  273. package/dist/application/services/context-optimizer.js +0 -62
  274. package/dist/application/services/context-persistence-service.d.ts +0 -45
  275. package/dist/application/services/context-persistence-service.js +0 -273
  276. package/dist/application/services/documentation-service.d.ts +0 -20
  277. package/dist/application/services/documentation-service.js +0 -155
  278. package/dist/application/services/enhanced-error-service.d.ts.map +0 -1
  279. package/dist/application/services/enhanced-error-service.js.map +0 -1
  280. package/dist/application/services/loop-context-optimizer.d.ts +0 -8
  281. package/dist/application/services/loop-context-optimizer.js +0 -114
  282. package/dist/application/services/loop-execution-context.d.ts +0 -23
  283. package/dist/application/services/loop-execution-context.js +0 -188
  284. package/dist/application/services/loop-step-resolver.d.ts +0 -11
  285. package/dist/application/services/loop-step-resolver.js +0 -70
  286. package/dist/application/services/validation-engine.d.ts.map +0 -1
  287. package/dist/application/services/validation-engine.js.map +0 -1
  288. package/dist/application/services/workflow-service.d.ts.map +0 -1
  289. package/dist/application/services/workflow-service.js.map +0 -1
  290. package/dist/application/use-cases/get-next-step.d.ts.map +0 -1
  291. package/dist/application/use-cases/get-next-step.js.map +0 -1
  292. package/dist/application/use-cases/get-workflow-docs.d.ts +0 -4
  293. package/dist/application/use-cases/get-workflow-docs.js +0 -12
  294. package/dist/application/use-cases/get-workflow.d.ts.map +0 -1
  295. package/dist/application/use-cases/get-workflow.js.map +0 -1
  296. package/dist/application/use-cases/get-workrail-help.d.ts +0 -4
  297. package/dist/application/use-cases/get-workrail-help.js +0 -12
  298. package/dist/application/use-cases/list-workflows.d.ts.map +0 -1
  299. package/dist/application/use-cases/list-workflows.js.map +0 -1
  300. package/dist/application/use-cases/validate-step-output.d.ts.map +0 -1
  301. package/dist/application/use-cases/validate-step-output.js.map +0 -1
  302. package/dist/application/use-cases/validate-workflow-json.d.ts.map +0 -1
  303. package/dist/application/use-cases/validate-workflow-json.js.map +0 -1
  304. package/dist/application/validation.d.ts.map +0 -1
  305. package/dist/application/validation.js.map +0 -1
  306. package/dist/cli/migrate-workflow.d.ts +0 -22
  307. package/dist/cli/migrate-workflow.js +0 -196
  308. package/dist/cli.d.ts.map +0 -1
  309. package/dist/cli.js.map +0 -1
  310. package/dist/container.d.ts +0 -15
  311. package/dist/container.d.ts.map +0 -1
  312. package/dist/container.js +0 -25
  313. package/dist/container.js.map +0 -1
  314. package/dist/core/error-handler.d.ts.map +0 -1
  315. package/dist/core/error-handler.js.map +0 -1
  316. package/dist/domain/index.d.ts +0 -2
  317. package/dist/domain/index.d.ts.map +0 -1
  318. package/dist/domain/index.js +0 -18
  319. package/dist/domain/index.js.map +0 -1
  320. package/dist/index.d.ts.map +0 -1
  321. package/dist/index.js.map +0 -1
  322. package/dist/infrastructure/index.d.ts.map +0 -1
  323. package/dist/infrastructure/index.js.map +0 -1
  324. package/dist/infrastructure/rpc/handler.d.ts +0 -17
  325. package/dist/infrastructure/rpc/handler.d.ts.map +0 -1
  326. package/dist/infrastructure/rpc/handler.js +0 -78
  327. package/dist/infrastructure/rpc/handler.js.map +0 -1
  328. package/dist/infrastructure/rpc/index.d.ts +0 -1
  329. package/dist/infrastructure/rpc/index.d.ts.map +0 -1
  330. package/dist/infrastructure/rpc/index.js +0 -17
  331. package/dist/infrastructure/rpc/index.js.map +0 -1
  332. package/dist/infrastructure/rpc/server.d.ts +0 -3
  333. package/dist/infrastructure/rpc/server.d.ts.map +0 -1
  334. package/dist/infrastructure/rpc/server.js +0 -37
  335. package/dist/infrastructure/rpc/server.js.map +0 -1
  336. package/dist/infrastructure/storage/caching-workflow-storage.d.ts.map +0 -1
  337. package/dist/infrastructure/storage/caching-workflow-storage.js.map +0 -1
  338. package/dist/infrastructure/storage/context-storage.d.ts +0 -150
  339. package/dist/infrastructure/storage/context-storage.js +0 -40
  340. package/dist/infrastructure/storage/file-workflow-storage.d.ts.map +0 -1
  341. package/dist/infrastructure/storage/file-workflow-storage.js.map +0 -1
  342. package/dist/infrastructure/storage/filesystem-blob-storage.d.ts +0 -27
  343. package/dist/infrastructure/storage/filesystem-blob-storage.js +0 -363
  344. package/dist/infrastructure/storage/git-workflow-storage.d.ts.map +0 -1
  345. package/dist/infrastructure/storage/git-workflow-storage.js.map +0 -1
  346. package/dist/infrastructure/storage/hybrid-context-storage.d.ts +0 -29
  347. package/dist/infrastructure/storage/hybrid-context-storage.js +0 -400
  348. package/dist/infrastructure/storage/in-memory-storage.d.ts.map +0 -1
  349. package/dist/infrastructure/storage/in-memory-storage.js.map +0 -1
  350. package/dist/infrastructure/storage/index.d.ts.map +0 -1
  351. package/dist/infrastructure/storage/index.js.map +0 -1
  352. package/dist/infrastructure/storage/migrations/001_initial_schema.sql +0 -38
  353. package/dist/infrastructure/storage/migrations/002_context_concurrency_enhancements.sql +0 -234
  354. package/dist/infrastructure/storage/migrations/003_classification_overrides.sql +0 -20
  355. package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts +0 -32
  356. package/dist/infrastructure/storage/multi-directory-workflow-storage.d.ts.map +0 -1
  357. package/dist/infrastructure/storage/multi-directory-workflow-storage.js +0 -184
  358. package/dist/infrastructure/storage/multi-directory-workflow-storage.js.map +0 -1
  359. package/dist/infrastructure/storage/plugin-workflow-storage.d.ts.map +0 -1
  360. package/dist/infrastructure/storage/plugin-workflow-storage.js.map +0 -1
  361. package/dist/infrastructure/storage/remote-workflow-storage.d.ts.map +0 -1
  362. package/dist/infrastructure/storage/remote-workflow-storage.js.map +0 -1
  363. package/dist/infrastructure/storage/schema-validating-workflow-storage.d.ts.map +0 -1
  364. package/dist/infrastructure/storage/schema-validating-workflow-storage.js.map +0 -1
  365. package/dist/infrastructure/storage/sqlite-metadata-storage.d.ts +0 -35
  366. package/dist/infrastructure/storage/sqlite-metadata-storage.js +0 -410
  367. package/dist/infrastructure/storage/sqlite-migrator.d.ts +0 -46
  368. package/dist/infrastructure/storage/sqlite-migrator.js +0 -293
  369. package/dist/infrastructure/storage/storage.d.ts.map +0 -1
  370. package/dist/infrastructure/storage/storage.js.map +0 -1
  371. package/dist/mcp-server.d.ts.map +0 -1
  372. package/dist/mcp-server.js.map +0 -1
  373. package/dist/tools/mcp_initialize.d.ts +0 -2
  374. package/dist/tools/mcp_initialize.d.ts.map +0 -1
  375. package/dist/tools/mcp_initialize.js +0 -45
  376. package/dist/tools/mcp_initialize.js.map +0 -1
  377. package/dist/tools/mcp_shutdown.d.ts +0 -2
  378. package/dist/tools/mcp_shutdown.d.ts.map +0 -1
  379. package/dist/tools/mcp_shutdown.js +0 -10
  380. package/dist/tools/mcp_shutdown.js.map +0 -1
  381. package/dist/tools/mcp_tools_list.d.ts +0 -2
  382. package/dist/tools/mcp_tools_list.d.ts.map +0 -1
  383. package/dist/tools/mcp_tools_list.js +0 -60
  384. package/dist/tools/mcp_tools_list.js.map +0 -1
  385. package/dist/tools/session-tools.d.ts +0 -5
  386. package/dist/tools/session-tools.js +0 -270
  387. package/dist/types/context-types.d.ts +0 -236
  388. package/dist/types/context-types.js +0 -10
  389. package/dist/types/documentation-types.d.ts +0 -37
  390. package/dist/types/loop-context-optimizer.d.ts +0 -7
  391. package/dist/types/mcp-types.d.ts +0 -273
  392. package/dist/types/mcp-types.d.ts.map +0 -1
  393. package/dist/types/mcp-types.js +0 -19
  394. package/dist/types/mcp-types.js.map +0 -1
  395. package/dist/types/server.d.ts.map +0 -1
  396. package/dist/types/server.js.map +0 -1
  397. package/dist/types/storage.d.ts.map +0 -1
  398. package/dist/types/storage.js.map +0 -1
  399. package/dist/types/workflow-types.d.ts +0 -336
  400. package/dist/types/workflow-types.d.ts.map +0 -1
  401. package/dist/types/workflow-types.js +0 -20
  402. package/dist/types/workflow-types.js.map +0 -1
  403. package/dist/utils/condition-evaluator.d.ts.map +0 -1
  404. package/dist/utils/condition-evaluator.js.map +0 -1
  405. package/dist/utils/config.d.ts +0 -149
  406. package/dist/utils/config.d.ts.map +0 -1
  407. package/dist/utils/config.js +0 -251
  408. package/dist/utils/config.js.map +0 -1
  409. package/dist/utils/storage-security.d.ts.map +0 -1
  410. package/dist/utils/storage-security.js.map +0 -1
  411. package/dist/validation/request-validator.d.ts +0 -8
  412. package/dist/validation/request-validator.d.ts.map +0 -1
  413. package/dist/validation/request-validator.js +0 -32
  414. package/dist/validation/request-validator.js.map +0 -1
  415. package/dist/validation/response-validator.d.ts +0 -8
  416. package/dist/validation/response-validator.d.ts.map +0 -1
  417. package/dist/validation/response-validator.js +0 -110
  418. package/dist/validation/response-validator.js.map +0 -1
  419. package/dist/validation/schemas.d.ts +0 -1
  420. package/dist/validation/schemas.d.ts.map +0 -1
  421. package/dist/validation/schemas.js +0 -53
  422. package/dist/validation/schemas.js.map +0 -1
  423. /package/dist/{types/documentation-types.js → errors/app-error.js} +0 -0
  424. /package/dist/{types/loop-context-optimizer.js → runtime/brand.js} +0 -0
@@ -1,62 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ContextOptimizer = void 0;
4
- class ContextOptimizer {
5
- static createEnhancedContext(base, enhancements) {
6
- const hasOverlap = Object.keys(enhancements).some(key => key in base);
7
- if (!hasOverlap) {
8
- return Object.assign({}, base, enhancements);
9
- }
10
- return { ...base, ...enhancements };
11
- }
12
- static mergeLoopState(context, loopId, loopState) {
13
- if (!context._loopState) {
14
- return ContextOptimizer.createEnhancedContext(context, {
15
- _loopState: { [loopId]: loopState }
16
- });
17
- }
18
- if (context._loopState[loopId] === loopState) {
19
- return context;
20
- }
21
- return ContextOptimizer.createEnhancedContext(context, {
22
- _loopState: { ...context._loopState, [loopId]: loopState }
23
- });
24
- }
25
- static addWarnings(context, category, key, warnings) {
26
- if (warnings.length === 0) {
27
- return context;
28
- }
29
- const existingWarnings = context._warnings || {};
30
- const categoryWarnings = existingWarnings[category] || {};
31
- return ContextOptimizer.createEnhancedContext(context, {
32
- _warnings: {
33
- ...existingWarnings,
34
- [category]: {
35
- ...categoryWarnings,
36
- [key]: warnings
37
- }
38
- }
39
- });
40
- }
41
- static hasProperty(context, property) {
42
- return property in context;
43
- }
44
- static getProperty(context, property) {
45
- return context[property];
46
- }
47
- static getOwnPropertiesSize(context) {
48
- const ownProps = Object.getOwnPropertyNames(context);
49
- let size = 0;
50
- for (const prop of ownProps) {
51
- const value = context[prop];
52
- if (typeof value === 'string') {
53
- size += value.length;
54
- }
55
- else {
56
- size += JSON.stringify(value).length;
57
- }
58
- }
59
- return size;
60
- }
61
- }
62
- exports.ContextOptimizer = ContextOptimizer;
@@ -1,45 +0,0 @@
1
- import { IContextPersistenceService, IClassificationEngine, ICompressionService, RawContext, ClassifiedContext, PersistableContext, CompressedBlob, CompressionStats } from '../../types/context-types';
2
- interface PersistenceMetrics {
3
- totalOperations: number;
4
- averageClassificationTime: number;
5
- averageCompressionTime: number;
6
- averageTotalTime: number;
7
- lastOperationTime: number;
8
- compressionStats: CompressionStats;
9
- }
10
- export declare class ContextPersistenceService implements IContextPersistenceService {
11
- private readonly classificationEngine;
12
- private readonly compressionService;
13
- private metrics;
14
- constructor(classificationEngine: IClassificationEngine, compressionService: ICompressionService);
15
- classifyContext(context: RawContext): Promise<ClassifiedContext>;
16
- compressContext(classified: ClassifiedContext): Promise<CompressedBlob>;
17
- decompressContext(compressed: CompressedBlob): Promise<RawContext>;
18
- generateSessionId(workflowId: string, context: RawContext): string;
19
- processPersistencePipeline(context: RawContext, workflowId: string): Promise<{
20
- sessionId: string;
21
- classified: ClassifiedContext;
22
- compressed: CompressedBlob;
23
- metrics: {
24
- classificationTime: number;
25
- compressionTime: number;
26
- totalTime: number;
27
- };
28
- }>;
29
- processRestorationPipeline(compressed: CompressedBlob): Promise<{
30
- context: RawContext;
31
- metrics: {
32
- decompressionTime: number;
33
- };
34
- }>;
35
- getMetrics(): PersistenceMetrics;
36
- resetMetrics(): void;
37
- restoreFromPersistence(persistableContext: PersistableContext): Promise<RawContext>;
38
- private createFallbackClassification;
39
- private createUncompressedBlob;
40
- private generateFallbackSessionId;
41
- private updateClassificationMetrics;
42
- private updateCompressionMetrics;
43
- private updatePipelineMetrics;
44
- }
45
- export {};
@@ -1,273 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.ContextPersistenceService = void 0;
37
- const crypto = __importStar(require("crypto"));
38
- const context_types_1 = require("../../types/context-types");
39
- const SESSION_ID_CONFIG = {
40
- algorithm: 'sha256',
41
- encoding: 'hex',
42
- maxLength: 32
43
- };
44
- class ContextPersistenceService {
45
- constructor(classificationEngine, compressionService) {
46
- this.classificationEngine = classificationEngine;
47
- this.compressionService = compressionService;
48
- this.metrics = {
49
- totalOperations: 0,
50
- averageClassificationTime: 0,
51
- averageCompressionTime: 0,
52
- averageTotalTime: 0,
53
- lastOperationTime: 0,
54
- compressionStats: {
55
- totalOperations: 0,
56
- averageRatio: 1.0,
57
- totalSizeReduction: 0,
58
- averageCompressionTime: 0
59
- }
60
- };
61
- }
62
- async classifyContext(context) {
63
- const startTime = process.hrtime.bigint();
64
- try {
65
- const frozenContext = Object.freeze({ ...context });
66
- const classified = await this.classificationEngine.classify(frozenContext);
67
- const immutableClassified = {
68
- [context_types_1.ContextLayer.CRITICAL]: Object.freeze({ ...classified[context_types_1.ContextLayer.CRITICAL] }),
69
- [context_types_1.ContextLayer.IMPORTANT]: Object.freeze({ ...classified[context_types_1.ContextLayer.IMPORTANT] }),
70
- [context_types_1.ContextLayer.USEFUL]: Object.freeze({ ...classified[context_types_1.ContextLayer.USEFUL] }),
71
- [context_types_1.ContextLayer.EPHEMERAL]: Object.freeze({ ...classified[context_types_1.ContextLayer.EPHEMERAL] })
72
- };
73
- const endTime = process.hrtime.bigint();
74
- const classificationTime = Number(endTime - startTime) / 1000000;
75
- this.updateClassificationMetrics(classificationTime);
76
- return Object.freeze(immutableClassified);
77
- }
78
- catch (error) {
79
- console.error('Context classification failed:', error);
80
- return this.createFallbackClassification(context);
81
- }
82
- }
83
- async compressContext(classified) {
84
- const startTime = process.hrtime.bigint();
85
- try {
86
- const frozenClassified = Object.freeze({ ...classified });
87
- const compressed = await this.compressionService.compress(frozenClassified);
88
- const endTime = process.hrtime.bigint();
89
- const compressionTime = Number(endTime - startTime) / 1000000;
90
- this.updateCompressionMetrics(compressionTime);
91
- return compressed;
92
- }
93
- catch (error) {
94
- console.error('Context compression failed:', error);
95
- return this.createUncompressedBlob(classified);
96
- }
97
- }
98
- async decompressContext(compressed) {
99
- try {
100
- const decompressed = await this.compressionService.decompress(compressed);
101
- return Object.freeze({ ...decompressed });
102
- }
103
- catch (error) {
104
- console.error('Context decompression failed:', error);
105
- throw new Error(`Failed to decompress context: ${error instanceof Error ? error.message : String(error)}`);
106
- }
107
- }
108
- generateSessionId(workflowId, context) {
109
- try {
110
- const contextString = JSON.stringify(context, Object.keys(context).sort());
111
- const contextHash = crypto
112
- .createHash(SESSION_ID_CONFIG.algorithm)
113
- .update(contextString)
114
- .digest(SESSION_ID_CONFIG.encoding);
115
- const combinedInput = `${workflowId}:${contextHash}`;
116
- const sessionHash = crypto
117
- .createHash(SESSION_ID_CONFIG.algorithm)
118
- .update(combinedInput)
119
- .digest(SESSION_ID_CONFIG.encoding);
120
- const sessionId = sessionHash.substring(0, SESSION_ID_CONFIG.maxLength);
121
- if (!/^[a-zA-Z0-9-]+$/.test(sessionId)) {
122
- throw new Error('Generated session ID contains invalid characters');
123
- }
124
- return sessionId;
125
- }
126
- catch (error) {
127
- console.warn('Session ID generation failed, using fallback:', error);
128
- return this.generateFallbackSessionId(workflowId);
129
- }
130
- }
131
- async processPersistencePipeline(context, workflowId) {
132
- const pipelineStartTime = process.hrtime.bigint();
133
- try {
134
- const sessionId = this.generateSessionId(workflowId, context);
135
- const classificationStart = process.hrtime.bigint();
136
- const classified = await this.classifyContext(context);
137
- const classificationEnd = process.hrtime.bigint();
138
- const classificationTime = Number(classificationEnd - classificationStart) / 1000000;
139
- const compressionStart = process.hrtime.bigint();
140
- const compressed = await this.compressContext(classified);
141
- const compressionEnd = process.hrtime.bigint();
142
- const compressionTime = Number(compressionEnd - compressionStart) / 1000000;
143
- const pipelineEndTime = process.hrtime.bigint();
144
- const totalTime = Number(pipelineEndTime - pipelineStartTime) / 1000000;
145
- this.updatePipelineMetrics(totalTime);
146
- return {
147
- sessionId,
148
- classified: Object.freeze(classified),
149
- compressed,
150
- metrics: {
151
- classificationTime,
152
- compressionTime,
153
- totalTime
154
- }
155
- };
156
- }
157
- catch (error) {
158
- console.error('Persistence pipeline failed:', error);
159
- throw new Error(`Persistence pipeline error: ${error instanceof Error ? error.message : String(error)}`);
160
- }
161
- }
162
- async processRestorationPipeline(compressed) {
163
- const startTime = process.hrtime.bigint();
164
- try {
165
- const context = await this.decompressContext(compressed);
166
- const endTime = process.hrtime.bigint();
167
- const decompressionTime = Number(endTime - startTime) / 1000000;
168
- return {
169
- context: Object.freeze(context),
170
- metrics: {
171
- decompressionTime
172
- }
173
- };
174
- }
175
- catch (error) {
176
- console.error('Restoration pipeline failed:', error);
177
- throw new Error(`Restoration pipeline error: ${error instanceof Error ? error.message : String(error)}`);
178
- }
179
- }
180
- getMetrics() {
181
- const latestCompressionStats = this.compressionService.getStats();
182
- return {
183
- ...this.metrics,
184
- compressionStats: { ...latestCompressionStats }
185
- };
186
- }
187
- resetMetrics() {
188
- this.metrics = {
189
- totalOperations: 0,
190
- averageClassificationTime: 0,
191
- averageCompressionTime: 0,
192
- averageTotalTime: 0,
193
- lastOperationTime: 0,
194
- compressionStats: {
195
- totalOperations: 0,
196
- averageRatio: 1.0,
197
- totalSizeReduction: 0,
198
- averageCompressionTime: 0
199
- }
200
- };
201
- this.compressionService.resetStats?.();
202
- }
203
- async restoreFromPersistence(persistableContext) {
204
- const startTime = process.hrtime.bigint();
205
- try {
206
- const frozenPersistable = Object.freeze({ ...persistableContext });
207
- const restoredContext = await this.compressionService.decompress(frozenPersistable);
208
- const endTime = process.hrtime.bigint();
209
- const operationTime = Number(endTime - startTime) / 1000000;
210
- this.metrics.totalOperations++;
211
- this.metrics.lastOperationTime = operationTime;
212
- return Object.freeze({ ...restoredContext });
213
- }
214
- catch (error) {
215
- console.warn('Context restoration failed, attempting graceful fallback:', error);
216
- const fallbackContext = {
217
- restorationError: true,
218
- originalError: error instanceof Error ? error.message : 'Unknown error',
219
- fallbackData: persistableContext
220
- };
221
- return Object.freeze(fallbackContext);
222
- }
223
- }
224
- createFallbackClassification(context) {
225
- const safeContext = { ...context };
226
- return Object.freeze({
227
- [context_types_1.ContextLayer.CRITICAL]: {},
228
- [context_types_1.ContextLayer.IMPORTANT]: Object.freeze(safeContext),
229
- [context_types_1.ContextLayer.USEFUL]: {},
230
- [context_types_1.ContextLayer.EPHEMERAL]: {}
231
- });
232
- }
233
- async createUncompressedBlob(classified) {
234
- const flattened = {};
235
- for (const [layer, data] of Object.entries(classified)) {
236
- Object.assign(flattened, data);
237
- }
238
- const serialized = JSON.stringify(flattened);
239
- const data = Buffer.from(serialized, 'utf8');
240
- const size = data.length;
241
- return {
242
- data,
243
- originalSize: size,
244
- compressedSize: size,
245
- compressionRatio: 1.0,
246
- algorithm: 'none'
247
- };
248
- }
249
- generateFallbackSessionId(workflowId) {
250
- const timestamp = Date.now().toString(36);
251
- const randomSuffix = Math.random().toString(36).substring(2, 8);
252
- const fallbackId = `${workflowId}-${timestamp}-${randomSuffix}`;
253
- return fallbackId.substring(0, SESSION_ID_CONFIG.maxLength);
254
- }
255
- updateClassificationMetrics(classificationTime) {
256
- const prevOps = this.metrics.totalOperations;
257
- this.metrics.totalOperations += 1;
258
- this.metrics.averageClassificationTime =
259
- (this.metrics.averageClassificationTime * prevOps + classificationTime) / this.metrics.totalOperations;
260
- this.metrics.lastOperationTime = Date.now();
261
- }
262
- updateCompressionMetrics(compressionTime) {
263
- const prevOps = this.metrics.totalOperations || 1;
264
- this.metrics.averageCompressionTime =
265
- (this.metrics.averageCompressionTime * (prevOps - 1) + compressionTime) / prevOps;
266
- }
267
- updatePipelineMetrics(totalTime) {
268
- const prevOps = this.metrics.totalOperations || 1;
269
- this.metrics.averageTotalTime =
270
- (this.metrics.averageTotalTime * (prevOps - 1) + totalTime) / prevOps;
271
- }
272
- }
273
- exports.ContextPersistenceService = ContextPersistenceService;
@@ -1,20 +0,0 @@
1
- import { IWorkflowStorage } from '../../types/storage';
2
- import { ValidationEngine } from './validation-engine';
3
- import { DocumentationResult } from '../../types/documentation-types';
4
- export interface IDocumentationService {
5
- resolveDocumentation(workflowId: string, mode?: 'preview' | 'full', sections?: string[], format?: string): Promise<DocumentationResult>;
6
- isDocumentationAvailable(workflowId: string): Promise<boolean>;
7
- getWorkrailHelp(section?: string, format?: string): Promise<DocumentationResult>;
8
- }
9
- export declare class DefaultDocumentationService implements IDocumentationService {
10
- private readonly storage;
11
- private readonly validationEngine;
12
- constructor(storage: IWorkflowStorage, validationEngine: ValidationEngine);
13
- resolveDocumentation(workflowId: string, mode?: 'preview' | 'full', sections?: string[], format?: string): Promise<DocumentationResult>;
14
- isDocumentationAvailable(workflowId: string): Promise<boolean>;
15
- getWorkrailHelp(section?: string, format?: string): Promise<DocumentationResult>;
16
- private parseMarkdownSections;
17
- private createPreview;
18
- private generateFallbackDocumentation;
19
- private generateWorkrailHelp;
20
- }
@@ -1,155 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.DefaultDocumentationService = void 0;
4
- const error_handler_1 = require("../../core/error-handler");
5
- class DefaultDocumentationService {
6
- constructor(storage, validationEngine) {
7
- this.storage = storage;
8
- this.validationEngine = validationEngine;
9
- }
10
- async resolveDocumentation(workflowId, mode = 'preview', sections, format = 'text') {
11
- try {
12
- const workflow = await this.storage.getWorkflowById(workflowId);
13
- if (!workflow) {
14
- throw new error_handler_1.WorkflowNotFoundError(workflowId);
15
- }
16
- if (workflow.documentation) {
17
- return {
18
- source: 'json',
19
- format: 'json',
20
- content: workflow.documentation
21
- };
22
- }
23
- if (this.storage.getWorkflowReadme) {
24
- const readme = await this.storage.getWorkflowReadme(workflowId);
25
- if (readme) {
26
- const sections = this.parseMarkdownSections(readme);
27
- return {
28
- source: 'readme',
29
- format: 'markdown',
30
- content: mode === 'preview' ? this.createPreview(readme) : readme,
31
- sections
32
- };
33
- }
34
- }
35
- return this.generateFallbackDocumentation(workflow, format);
36
- }
37
- catch (error) {
38
- if (error instanceof error_handler_1.WorkflowNotFoundError) {
39
- throw error;
40
- }
41
- return {
42
- source: 'fallback',
43
- format: 'text',
44
- content: `Documentation unavailable for workflow: ${workflowId}. Error: ${error instanceof Error ? error.message : String(error)}`
45
- };
46
- }
47
- }
48
- async isDocumentationAvailable(workflowId) {
49
- try {
50
- const workflow = await this.storage.getWorkflowById(workflowId);
51
- if (!workflow) {
52
- return false;
53
- }
54
- if (workflow.documentation) {
55
- return true;
56
- }
57
- if (this.storage.hasDocumentation) {
58
- return await this.storage.hasDocumentation(workflowId);
59
- }
60
- return true;
61
- }
62
- catch {
63
- return false;
64
- }
65
- }
66
- async getWorkrailHelp(section, format = 'text') {
67
- const helpContent = this.generateWorkrailHelp(section);
68
- return {
69
- source: 'fallback',
70
- format: 'text',
71
- content: helpContent
72
- };
73
- }
74
- parseMarkdownSections(markdown) {
75
- const sections = {};
76
- const lines = markdown.split('\n');
77
- let currentSection = '';
78
- let currentContent = [];
79
- for (const line of lines) {
80
- if (line.startsWith('# ') || line.startsWith('## ')) {
81
- if (currentSection && currentContent.length > 0) {
82
- sections[currentSection] = currentContent.join('\n').trim();
83
- }
84
- currentSection = line.replace(/^#+\s*/, '').toLowerCase().replace(/\s+/g, '-');
85
- currentContent = [];
86
- }
87
- else {
88
- currentContent.push(line);
89
- }
90
- }
91
- if (currentSection && currentContent.length > 0) {
92
- sections[currentSection] = currentContent.join('\n').trim();
93
- }
94
- return sections;
95
- }
96
- createPreview(content) {
97
- const lines = content.split('\n');
98
- const previewLines = [];
99
- let lineCount = 0;
100
- const maxLines = 20;
101
- for (const line of lines) {
102
- if (lineCount >= maxLines) {
103
- previewLines.push('\n[... content truncated for preview mode ...]');
104
- break;
105
- }
106
- previewLines.push(line);
107
- lineCount++;
108
- }
109
- return previewLines.join('\n');
110
- }
111
- generateFallbackDocumentation(workflow, format) {
112
- const content = `# ${workflow.name}
113
-
114
- ${workflow.description}
115
-
116
- **Version:** ${workflow.version}
117
- **Steps:** ${workflow.steps?.length || 0} steps
118
-
119
- ${workflow.preconditions?.length ? `**Prerequisites:**\n${workflow.preconditions.map((p) => `- ${p}`).join('\n')}\n` : ''}
120
-
121
- *This is auto-generated documentation. For detailed guidance, consider adding a documentation object to the workflow JSON or creating a README file.*`;
122
- return {
123
- source: 'fallback',
124
- format: 'text',
125
- content
126
- };
127
- }
128
- generateWorkrailHelp(section) {
129
- const baseHelp = `# WorkRail Documentation System
130
-
131
- WorkRail provides structured workflow orchestration with built-in documentation support.
132
-
133
- ## Available Commands
134
- - \`workflow_list\` - List all available workflows
135
- - \`workflow_get\` - Get detailed workflow information
136
- - \`workflow_docs\` - Get workflow-specific documentation
137
- - \`workrail_help\` - Get general platform help (this command)
138
-
139
- ## Documentation Sources
140
- WorkRail resolves documentation in this priority order:
141
- 1. **JSON Documentation** - Structured metadata in workflow files
142
- 2. **README Files** - Markdown documentation alongside workflows
143
- 3. **Fallback** - Auto-generated from workflow metadata
144
-
145
- ## Getting Help
146
- - Use \`workflow_docs\` for specific workflow documentation
147
- - Use \`workrail_help\` for general platform information
148
- - Check workflow descriptions in \`workflow_list\` output`;
149
- if (section) {
150
- return `${baseHelp}\n\n*Note: Section-specific help for "${section}" is not yet implemented.*`;
151
- }
152
- return baseHelp;
153
- }
154
- }
155
- exports.DefaultDocumentationService = DefaultDocumentationService;
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhanced-error-service.d.ts","sourceRoot":"","sources":["../../../src/application/services/enhanced-error-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAElC;;;;;;;;;;GAUG;AACH,qBAAa,oBAAoB;IAC/B;;;;OAIG;WACW,aAAa,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE;IAW5D;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAsB/B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IA2B7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,sBAAsB;IAsCrC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,0BAA0B;IASzC;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAS7B;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IASzB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAS5B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAS7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAS7B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IASzB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,WAAW;IAI1B;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;CAG7B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"enhanced-error-service.js","sourceRoot":"","sources":["../../../src/application/services/enhanced-error-service.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;GAUG;AACH,MAAa,oBAAoB;IAC/B;;;;OAIG;IACI,MAAM,CAAC,aAAa,CAAC,MAAqB;QAC/C,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,6DAA6D;QAC7D,MAAM,iBAAiB,GAAG,IAAI,CAA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;IACK,MAAM,CAAC,cAAc,CAAC,KAAkB,EAAE,QAAgB;QAChE,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3B,OAAO,SAAS,QAAQ,sBAAsB,CAAC;QACjD,CAAC;QAED,OAAO,SAAS,QAAQ,8BAA8B,QAAQ,WAAW,CAAC;IAC5E,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,UAAU,CAAC,KAAkB,EAAE,QAAgB;QAC5D,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,eAAe,CAAC,CAAC;QACtD,IAAI,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;YACpD,OAAO,SAAS,QAAQ,oCAAoC,CAAC;QAC/D,CAAC;QAED,OAAO,SAAS,QAAQ,oBAAoB,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAC5F,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,WAAW,CAAC,MAAmB,EAAE,QAAgB;QAC9D,OAAO,SAAS,QAAQ,6GAA6G,CAAC;IACxI,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,WAAW,CAAC,MAAmB,EAAE,QAAgB;QAC9D,OAAO,SAAS,QAAQ,8GAA8G,CAAC;IACzI,CAAC;IAED;;OAEG;IACK,MAAM,CAAC,aAAa,CAAC,KAAkB,EAAE,QAAgB;QAC/D,OAAO,oBAAoB,QAAQ,KAAK,KAAK,CAAC,OAAO,IAAI,0BAA0B,EAAE,CAAC;IACxF,CAAC;CACF;AAjOD,oDAiOC"}
@@ -1,8 +0,0 @@
1
- import { EnhancedContext, OptimizedLoopContext, LoopPhaseReference, LoopStep } from '../../types/workflow-types';
2
- import { ILoopContextOptimizer } from '../../types/loop-context-optimizer';
3
- export declare class LoopContextOptimizer implements ILoopContextOptimizer {
4
- optimizeLoopContext(context: EnhancedContext, iteration: number): OptimizedLoopContext;
5
- createPhaseReference(loopStep: LoopStep): LoopPhaseReference;
6
- hasLoopItems(context: EnhancedContext, loopStep: LoopStep): boolean;
7
- stripLoopMetadata(context: EnhancedContext): OptimizedLoopContext;
8
- }