@probelabs/visor 0.1.126 → 0.1.128

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 (178) hide show
  1. package/dist/ai-review-service.d.ts +2 -0
  2. package/dist/ai-review-service.d.ts.map +1 -1
  3. package/dist/docs/ai-configuration.md +23 -0
  4. package/dist/docs/commands.md +1 -1
  5. package/dist/docs/timeouts.md +1 -1
  6. package/dist/docs/workflows.md +30 -1
  7. package/dist/failure-condition-evaluator.d.ts.map +1 -1
  8. package/dist/generated/config-schema.d.ts +63 -9
  9. package/dist/generated/config-schema.d.ts.map +1 -1
  10. package/dist/generated/config-schema.json +67 -11
  11. package/dist/index.js +11476 -6945
  12. package/dist/liquid-extensions.d.ts.map +1 -1
  13. package/dist/output/traces/{run-2026-01-31T16-37-22-321Z.ndjson → run-2026-02-05T13-36-03-279Z.ndjson} +84 -84
  14. package/dist/output/traces/{run-2026-01-31T16-38-06-031Z.ndjson → run-2026-02-05T13-36-48-767Z.ndjson} +839 -1059
  15. package/dist/output/traces/run-2026-02-05T13-36-58-960Z.ndjson +17 -0
  16. package/dist/output/traces/run-2026-02-05T13-37-00-184Z.ndjson +205 -0
  17. package/dist/providers/ai-check-provider.d.ts +16 -0
  18. package/dist/providers/ai-check-provider.d.ts.map +1 -1
  19. package/dist/providers/command-check-provider.d.ts.map +1 -1
  20. package/dist/providers/custom-tool-executor.d.ts.map +1 -1
  21. package/dist/providers/http-client-provider.d.ts.map +1 -1
  22. package/dist/providers/mcp-check-provider.d.ts +3 -0
  23. package/dist/providers/mcp-check-provider.d.ts.map +1 -1
  24. package/dist/providers/mcp-custom-sse-server.d.ts +22 -2
  25. package/dist/providers/mcp-custom-sse-server.d.ts.map +1 -1
  26. package/dist/providers/memory-check-provider.d.ts.map +1 -1
  27. package/dist/providers/workflow-check-provider.d.ts.map +1 -1
  28. package/dist/providers/workflow-tool-executor.d.ts +2 -0
  29. package/dist/providers/workflow-tool-executor.d.ts.map +1 -1
  30. package/dist/sdk/check-provider-registry-OB5FEBJU.mjs +28 -0
  31. package/dist/sdk/check-provider-registry-UC2LPSB4.mjs +28 -0
  32. package/dist/sdk/{chunk-CNX7V5JK.mjs → chunk-25IC7KXZ.mjs} +2 -2
  33. package/dist/sdk/{chunk-YSN4G6CI.mjs → chunk-4HVFUUNB.mjs} +2 -2
  34. package/dist/sdk/{chunk-3OMWVM6J.mjs → chunk-B7BVQM5K.mjs} +2 -2
  35. package/dist/sdk/{chunk-5LI6T4O3.mjs → chunk-D55IQCUP.mjs} +71 -17
  36. package/dist/sdk/chunk-D55IQCUP.mjs.map +1 -0
  37. package/dist/sdk/{chunk-BOVFH3LI.mjs → chunk-EJN6Q4D3.mjs} +16 -7
  38. package/dist/sdk/chunk-EJN6Q4D3.mjs.map +1 -0
  39. package/dist/sdk/{chunk-WMJKH4XE.mjs → chunk-J7LXIPZS.mjs} +16 -1
  40. package/dist/sdk/{chunk-EXFGO4FX.mjs → chunk-KFKHU6CM.mjs} +2 -2
  41. package/dist/sdk/{chunk-7GUAFV6L.mjs → chunk-LMJSJQPP.mjs} +18 -13
  42. package/dist/sdk/chunk-LMJSJQPP.mjs.map +1 -0
  43. package/dist/sdk/{chunk-VW2GBXQT.mjs → chunk-N7IVCCGH.mjs} +3 -3
  44. package/dist/sdk/{chunk-O5EZDNYL.mjs → chunk-NCWIZVOT.mjs} +2 -2
  45. package/dist/sdk/{chunk-3NMLT3YS.mjs → chunk-P6YFV6N2.mjs} +3 -3
  46. package/dist/sdk/{chunk-HQL734ZI.mjs → chunk-QRXSDDYN.mjs} +3 -3
  47. package/dist/sdk/{chunk-J2QWVDXK.mjs → chunk-SIMCSNXO.mjs} +3 -3
  48. package/dist/sdk/{chunk-IHZOSIF4.mjs → chunk-UEWXVJ6C.mjs} +3 -3
  49. package/dist/sdk/{chunk-SWEEZ5D5.mjs → chunk-UKG5UP5U.mjs} +17 -83
  50. package/dist/sdk/chunk-UKG5UP5U.mjs.map +1 -0
  51. package/dist/sdk/chunk-UPKHRMUA.mjs +35108 -0
  52. package/dist/sdk/chunk-UPKHRMUA.mjs.map +1 -0
  53. package/dist/sdk/chunk-V7RIRPO7.mjs +35108 -0
  54. package/dist/sdk/chunk-V7RIRPO7.mjs.map +1 -0
  55. package/dist/sdk/{chunk-2CPMMNIX.mjs → chunk-VEROLBCD.mjs} +21 -65
  56. package/dist/sdk/{chunk-2CPMMNIX.mjs.map → chunk-VEROLBCD.mjs.map} +1 -1
  57. package/dist/sdk/{chunk-ZYAUYXSW.mjs → chunk-WVNQ56DO.mjs} +3 -3
  58. package/dist/sdk/{chunk-NAW3DB3I.mjs → chunk-XXAEN5KU.mjs} +3 -3
  59. package/dist/sdk/{chunk-S2RUE2RG.mjs → chunk-YCUWMIV5.mjs} +3 -3
  60. package/dist/sdk/command-executor-C4DGIQ4Q.mjs +14 -0
  61. package/dist/sdk/config-GYTBTHRZ.mjs +16 -0
  62. package/dist/sdk/config-merger-RKCZJQ44.mjs +10 -0
  63. package/dist/sdk/{event-bus-5BEVPQ6T.mjs → event-bus-XV2TOQFU.mjs} +2 -2
  64. package/dist/sdk/failure-condition-evaluator-KRFY4OLQ.mjs +17 -0
  65. package/dist/sdk/{git-repository-analyzer-HJC4MYW4.mjs → git-repository-analyzer-VO7OZMTM.mjs} +2 -2
  66. package/dist/sdk/{github-frontend-BZ4N3BFZ.mjs → github-frontend-UC326PMS.mjs} +11 -11
  67. package/dist/sdk/{host-NYWXLIFC.mjs → host-H7MKML2H.mjs} +5 -5
  68. package/dist/sdk/{liquid-extensions-DFDEBMUI.mjs → liquid-extensions-WJAC7QKG.mjs} +8 -7
  69. package/dist/sdk/memory-store-LPOZWQ5E.mjs +12 -0
  70. package/dist/sdk/{metrics-7PP3EJUH.mjs → metrics-CSBGJEWW.mjs} +4 -4
  71. package/dist/sdk/{ndjson-sink-B4V4NTAQ.mjs → ndjson-sink-JQ2INHTS.mjs} +2 -2
  72. package/dist/sdk/{prompt-state-EZYOUG75.mjs → prompt-state-X2WDGSEM.mjs} +5 -5
  73. package/dist/sdk/{renderer-schema-CKFB5NDB.mjs → renderer-schema-FRCLA6KH.mjs} +4 -4
  74. package/dist/sdk/routing-745DOEKR.mjs +24 -0
  75. package/dist/sdk/sdk.d.mts +65 -3
  76. package/dist/sdk/sdk.d.ts +65 -3
  77. package/dist/sdk/sdk.js +17945 -540
  78. package/dist/sdk/sdk.js.map +1 -1
  79. package/dist/sdk/sdk.mjs +107 -34
  80. package/dist/sdk/sdk.mjs.map +1 -1
  81. package/dist/sdk/session-registry-6PV6SGEJ.mjs +10 -0
  82. package/dist/sdk/{slack-frontend-JUT3TYVC.mjs → slack-frontend-UPYUYCUQ.mjs} +5 -5
  83. package/dist/sdk/{trace-helpers-VP6QYVBX.mjs → trace-helpers-LUCR52GY.mjs} +4 -4
  84. package/dist/sdk/tracer-init-XPRWKMZT.mjs +10 -0
  85. package/dist/sdk/workflow-check-provider-AA3VNYUY.mjs +28 -0
  86. package/dist/sdk/workflow-check-provider-LQNQZUN5.mjs +28 -0
  87. package/dist/sdk/workflow-registry-W7IEH7GK.mjs +12 -0
  88. package/dist/state-machine/states/routing.d.ts.map +1 -1
  89. package/dist/test-runner/index.d.ts +5 -0
  90. package/dist/test-runner/index.d.ts.map +1 -1
  91. package/dist/test-runner/validator.d.ts.map +1 -1
  92. package/dist/traces/{run-2026-01-31T16-37-22-321Z.ndjson → run-2026-02-05T13-36-03-279Z.ndjson} +84 -84
  93. package/dist/traces/{run-2026-01-31T16-38-06-031Z.ndjson → run-2026-02-05T13-36-48-767Z.ndjson} +839 -1059
  94. package/dist/traces/run-2026-02-05T13-36-58-960Z.ndjson +17 -0
  95. package/dist/traces/run-2026-02-05T13-37-00-184Z.ndjson +205 -0
  96. package/dist/types/config.d.ts +65 -3
  97. package/dist/types/config.d.ts.map +1 -1
  98. package/dist/utils/sandbox.d.ts.map +1 -1
  99. package/dist/utils/workspace-manager.d.ts +22 -2
  100. package/dist/utils/workspace-manager.d.ts.map +1 -1
  101. package/dist/utils/worktree-manager.d.ts +2 -1
  102. package/dist/utils/worktree-manager.d.ts.map +1 -1
  103. package/package.json +6 -7
  104. package/dist/sdk/check-provider-registry-3KI5RKXT.mjs +0 -28
  105. package/dist/sdk/check-provider-registry-IYILYY35.mjs +0 -28
  106. package/dist/sdk/chunk-5LI6T4O3.mjs.map +0 -1
  107. package/dist/sdk/chunk-7GUAFV6L.mjs.map +0 -1
  108. package/dist/sdk/chunk-A4PGHURG.mjs +0 -17667
  109. package/dist/sdk/chunk-A4PGHURG.mjs.map +0 -1
  110. package/dist/sdk/chunk-BOVFH3LI.mjs.map +0 -1
  111. package/dist/sdk/chunk-J6EVEXC2.mjs +0 -558
  112. package/dist/sdk/chunk-J6EVEXC2.mjs.map +0 -1
  113. package/dist/sdk/chunk-PJ7K5UFC.mjs +0 -17732
  114. package/dist/sdk/chunk-PJ7K5UFC.mjs.map +0 -1
  115. package/dist/sdk/chunk-PXFIALUH.mjs +0 -1458
  116. package/dist/sdk/chunk-PXFIALUH.mjs.map +0 -1
  117. package/dist/sdk/chunk-RTKJXNZS.mjs +0 -3591
  118. package/dist/sdk/chunk-RTKJXNZS.mjs.map +0 -1
  119. package/dist/sdk/chunk-SWEEZ5D5.mjs.map +0 -1
  120. package/dist/sdk/command-executor-Q7MHJKZJ.mjs +0 -14
  121. package/dist/sdk/config-5AUYQFHE.mjs +0 -16
  122. package/dist/sdk/config-6CUVEH7H.mjs +0 -16
  123. package/dist/sdk/config-merger-PX3WIT57.mjs +0 -10
  124. package/dist/sdk/failure-condition-evaluator-HB35XRLZ.mjs +0 -17
  125. package/dist/sdk/host-4MT3EW2I.mjs +0 -52
  126. package/dist/sdk/host-NYWXLIFC.mjs.map +0 -1
  127. package/dist/sdk/memory-store-RW5N2NGJ.mjs +0 -12
  128. package/dist/sdk/routing-6R42GXUO.mjs +0 -24
  129. package/dist/sdk/routing-7FXPULTO.mjs +0 -24
  130. package/dist/sdk/session-registry-4E6YRQ77.mjs +0 -10
  131. package/dist/sdk/slack-frontend-J442FJWZ.mjs +0 -793
  132. package/dist/sdk/slack-frontend-J442FJWZ.mjs.map +0 -1
  133. package/dist/sdk/tracer-init-GSLPPLCD.mjs +0 -10
  134. package/dist/sdk/workflow-check-provider-H3CUOLUD.mjs +0 -28
  135. package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs +0 -28
  136. package/dist/sdk/workflow-check-provider-YUNNF4KC.mjs.map +0 -1
  137. package/dist/sdk/workflow-registry-6LZKCWHP.mjs +0 -12
  138. package/dist/sdk/workflow-registry-6LZKCWHP.mjs.map +0 -1
  139. package/dist/sdk/workflow-registry-KFWSDSLM.mjs +0 -12
  140. package/dist/sdk/workflow-registry-KFWSDSLM.mjs.map +0 -1
  141. /package/dist/sdk/{check-provider-registry-3KI5RKXT.mjs.map → check-provider-registry-OB5FEBJU.mjs.map} +0 -0
  142. /package/dist/sdk/{check-provider-registry-IYILYY35.mjs.map → check-provider-registry-UC2LPSB4.mjs.map} +0 -0
  143. /package/dist/sdk/{chunk-CNX7V5JK.mjs.map → chunk-25IC7KXZ.mjs.map} +0 -0
  144. /package/dist/sdk/{chunk-YSN4G6CI.mjs.map → chunk-4HVFUUNB.mjs.map} +0 -0
  145. /package/dist/sdk/{chunk-3OMWVM6J.mjs.map → chunk-B7BVQM5K.mjs.map} +0 -0
  146. /package/dist/sdk/{chunk-WMJKH4XE.mjs.map → chunk-J7LXIPZS.mjs.map} +0 -0
  147. /package/dist/sdk/{chunk-EXFGO4FX.mjs.map → chunk-KFKHU6CM.mjs.map} +0 -0
  148. /package/dist/sdk/{chunk-VW2GBXQT.mjs.map → chunk-N7IVCCGH.mjs.map} +0 -0
  149. /package/dist/sdk/{chunk-O5EZDNYL.mjs.map → chunk-NCWIZVOT.mjs.map} +0 -0
  150. /package/dist/sdk/{chunk-3NMLT3YS.mjs.map → chunk-P6YFV6N2.mjs.map} +0 -0
  151. /package/dist/sdk/{chunk-HQL734ZI.mjs.map → chunk-QRXSDDYN.mjs.map} +0 -0
  152. /package/dist/sdk/{chunk-J2QWVDXK.mjs.map → chunk-SIMCSNXO.mjs.map} +0 -0
  153. /package/dist/sdk/{chunk-IHZOSIF4.mjs.map → chunk-UEWXVJ6C.mjs.map} +0 -0
  154. /package/dist/sdk/{chunk-ZYAUYXSW.mjs.map → chunk-WVNQ56DO.mjs.map} +0 -0
  155. /package/dist/sdk/{chunk-NAW3DB3I.mjs.map → chunk-XXAEN5KU.mjs.map} +0 -0
  156. /package/dist/sdk/{chunk-S2RUE2RG.mjs.map → chunk-YCUWMIV5.mjs.map} +0 -0
  157. /package/dist/sdk/{command-executor-Q7MHJKZJ.mjs.map → command-executor-C4DGIQ4Q.mjs.map} +0 -0
  158. /package/dist/sdk/{config-5AUYQFHE.mjs.map → config-GYTBTHRZ.mjs.map} +0 -0
  159. /package/dist/sdk/{config-6CUVEH7H.mjs.map → config-merger-RKCZJQ44.mjs.map} +0 -0
  160. /package/dist/sdk/{event-bus-5BEVPQ6T.mjs.map → event-bus-XV2TOQFU.mjs.map} +0 -0
  161. /package/dist/sdk/{config-merger-PX3WIT57.mjs.map → failure-condition-evaluator-KRFY4OLQ.mjs.map} +0 -0
  162. /package/dist/sdk/{git-repository-analyzer-HJC4MYW4.mjs.map → git-repository-analyzer-VO7OZMTM.mjs.map} +0 -0
  163. /package/dist/sdk/{github-frontend-BZ4N3BFZ.mjs.map → github-frontend-UC326PMS.mjs.map} +0 -0
  164. /package/dist/sdk/{host-4MT3EW2I.mjs.map → host-H7MKML2H.mjs.map} +0 -0
  165. /package/dist/sdk/{failure-condition-evaluator-HB35XRLZ.mjs.map → liquid-extensions-WJAC7QKG.mjs.map} +0 -0
  166. /package/dist/sdk/{liquid-extensions-DFDEBMUI.mjs.map → memory-store-LPOZWQ5E.mjs.map} +0 -0
  167. /package/dist/sdk/{memory-store-RW5N2NGJ.mjs.map → metrics-CSBGJEWW.mjs.map} +0 -0
  168. /package/dist/sdk/{ndjson-sink-B4V4NTAQ.mjs.map → ndjson-sink-JQ2INHTS.mjs.map} +0 -0
  169. /package/dist/sdk/{metrics-7PP3EJUH.mjs.map → prompt-state-X2WDGSEM.mjs.map} +0 -0
  170. /package/dist/sdk/{renderer-schema-CKFB5NDB.mjs.map → renderer-schema-FRCLA6KH.mjs.map} +0 -0
  171. /package/dist/sdk/{prompt-state-EZYOUG75.mjs.map → routing-745DOEKR.mjs.map} +0 -0
  172. /package/dist/sdk/{routing-6R42GXUO.mjs.map → session-registry-6PV6SGEJ.mjs.map} +0 -0
  173. /package/dist/sdk/{slack-frontend-JUT3TYVC.mjs.map → slack-frontend-UPYUYCUQ.mjs.map} +0 -0
  174. /package/dist/sdk/{routing-7FXPULTO.mjs.map → trace-helpers-LUCR52GY.mjs.map} +0 -0
  175. /package/dist/sdk/{session-registry-4E6YRQ77.mjs.map → tracer-init-XPRWKMZT.mjs.map} +0 -0
  176. /package/dist/sdk/{trace-helpers-VP6QYVBX.mjs.map → workflow-check-provider-AA3VNYUY.mjs.map} +0 -0
  177. /package/dist/sdk/{tracer-init-GSLPPLCD.mjs.map → workflow-check-provider-LQNQZUN5.mjs.map} +0 -0
  178. /package/dist/sdk/{workflow-check-provider-H3CUOLUD.mjs.map → workflow-registry-W7IEH7GK.mjs.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/utils/sandbox.ts"],"sourcesContent":["import Sandbox from '@nyariv/sandboxjs';\n\n/**\n * Centralized helpers for creating and using SandboxJS instances consistently\n * across providers. The goal is to have one place to define allowed globals\n * and prototype whitelists, and to offer a small helper to inject a `log`\n * utility inside user-provided JS snippets.\n */\n\nexport interface CompileOptions {\n injectLog?: boolean;\n logPrefix?: string;\n /** When true, wrap the code in a function and `return` its result */\n wrapFunction?: boolean;\n}\n\nexport interface JsSyntaxValidationResult {\n valid: boolean;\n error?: string;\n}\n\n/**\n * Validate JavaScript syntax without executing it.\n * Uses the sandbox's compile method to check for syntax errors.\n * Returns validation result with error message if invalid.\n */\nexport function validateJsSyntax(code: string): JsSyntaxValidationResult {\n if (!code || typeof code !== 'string') {\n return { valid: false, error: 'Code must be a non-empty string' };\n }\n\n const trimmed = code.trim();\n if (trimmed.length === 0) {\n return { valid: false, error: 'Code cannot be empty' };\n }\n\n // Create a minimal sandbox instance for syntax checking\n const sandbox = createSecureSandbox();\n\n // Wrap code similar to compileAndRun to catch the same syntax issues\n const looksLikeBlock = /\\breturn\\b/.test(trimmed) || /;/.test(trimmed) || /\\n/.test(trimmed);\n const looksLikeIife = /\\)\\s*\\(\\s*\\)\\s*;?$/.test(trimmed);\n const body = looksLikeBlock\n ? looksLikeIife\n ? `return (\\n${trimmed}\\n);\\n`\n : `return (() => {\\n${trimmed}\\n})();\\n`\n : `return (\\n${trimmed}\\n);\\n`;\n\n // Add log injection header (same as compileAndRun)\n const header = `const __lp = \"[syntax-check]\"; const log = (...a) => { try { console.log(__lp, ...a); } catch {} };\\n`;\n const fullCode = `${header}${body}`;\n\n try {\n sandbox.compile(fullCode);\n return { valid: true };\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n return { valid: false, error: msg };\n }\n}\n\n/**\n * Create a hardened Sandbox with a consistent set of globals and prototype\n * whitelists. This is a superset of the sets previously used by individual\n * providers, kept intentionally minimal and side‑effect free.\n */\nexport function createSecureSandbox(): Sandbox {\n const globals = {\n ...Sandbox.SAFE_GLOBALS,\n Math,\n JSON,\n // Provide console with limited surface. Use trampolines so that any test\n // spies (e.g., jest.spyOn(console, 'log')) see calls made inside the sandbox.\n console: {\n log: (...args: unknown[]) => {\n try {\n (console as any).log(...args);\n } catch {}\n },\n warn: (...args: unknown[]) => {\n try {\n (console as any).warn(...args);\n } catch {}\n },\n error: (...args: unknown[]) => {\n try {\n (console as any).error(...args);\n } catch {}\n },\n },\n } as Record<string, unknown>;\n\n const prototypeWhitelist = new Map(Sandbox.SAFE_PROTOTYPES);\n\n // Arrays — union of methods used around the codebase\n const arrayMethods = new Set<string>([\n // Query/iteration\n 'some',\n 'every',\n 'filter',\n 'map',\n 'reduce',\n 'reduceRight',\n 'find',\n 'findIndex',\n 'findLast',\n 'findLastIndex',\n 'includes',\n 'indexOf',\n 'lastIndexOf',\n 'keys',\n 'values',\n 'entries',\n 'forEach',\n // Non‑mutating ES2023 additions\n 'toReversed',\n 'toSorted',\n 'toSpliced',\n 'with',\n 'at',\n // Mutators and common ops\n 'slice',\n 'concat',\n 'join',\n 'push',\n 'pop',\n 'shift',\n 'unshift',\n 'sort',\n 'reverse',\n 'copyWithin',\n 'fill',\n // Flattening\n 'flat',\n 'flatMap',\n // Meta\n 'length',\n ]);\n prototypeWhitelist.set(Array.prototype, arrayMethods);\n\n // Strings — allow common, safe manipulation helpers\n const stringMethods = new Set<string>([\n 'toLowerCase',\n 'toUpperCase',\n 'includes',\n 'indexOf',\n 'lastIndexOf',\n 'startsWith',\n 'endsWith',\n 'slice',\n 'substring',\n 'substr',\n 'trim',\n 'trimStart',\n 'trimEnd',\n 'split',\n 'replace',\n 'replaceAll',\n 'match',\n 'matchAll',\n 'charAt',\n 'charCodeAt',\n 'codePointAt',\n 'normalize',\n 'repeat',\n 'padStart',\n 'padEnd',\n 'at',\n 'length',\n ]);\n prototypeWhitelist.set(String.prototype, stringMethods);\n\n // Objects — keep to basic safe operations\n const objectMethods = new Set<string>([\n 'hasOwnProperty',\n 'propertyIsEnumerable',\n 'toString',\n 'valueOf',\n ]);\n prototypeWhitelist.set(Object.prototype, objectMethods);\n\n // Keep native constructors from SAFE_GLOBALS; rely on prototype whitelists above.\n\n // Maps and Sets — allow common, safe operations\n const mapMethods = new Set<string>([\n 'get',\n 'set',\n 'has',\n 'delete',\n 'entries',\n 'keys',\n 'values',\n 'forEach',\n ]);\n // @ts-ignore - sandbox typings accept Map.prototype as a key\n prototypeWhitelist.set((Map as any).prototype, mapMethods);\n\n const setMethods = new Set<string>([\n 'add',\n 'has',\n 'delete',\n 'entries',\n 'keys',\n 'values',\n 'forEach',\n ]);\n // @ts-ignore\n prototypeWhitelist.set((Set as any).prototype, setMethods);\n\n // Date and RegExp — read‑only helpers\n const dateMethods = new Set<string>(['toISOString', 'toJSON', 'getTime']);\n // @ts-ignore\n prototypeWhitelist.set((Date as any).prototype, dateMethods);\n\n const regexpMethods = new Set<string>(['test', 'exec']);\n // @ts-ignore\n prototypeWhitelist.set((RegExp as any).prototype, regexpMethods);\n\n return new Sandbox({ globals, prototypeWhitelist });\n}\n\n/**\n * Compile and execute user-provided JS inside the sandbox with optional\n * helper injection. By default, code is wrapped in a function to keep the\n * global scope clean.\n */\nexport function compileAndRun<T = unknown>(\n sandbox: Sandbox,\n userCode: string,\n scope: Record<string, unknown>,\n opts: CompileOptions = { injectLog: true, wrapFunction: true, logPrefix: '[sandbox]' }\n): T {\n const inject = opts?.injectLog === true;\n let safePrefix = String(opts?.logPrefix ?? '[sandbox]');\n // Sanitize prefix aggressively: drop control chars and risky tokens, limit length\n safePrefix = safePrefix\n .replace(/[\\r\\n\\t\\0]/g, '')\n .replace(/[`$\\\\]/g, '') // strip backticks, dollar (template) and backslashes\n .replace(/\\$\\{/g, '') // remove template openings if present\n .slice(0, 64);\n // Build a safe header without string concatenation inside user code\n const header = inject\n ? `const __lp = ${JSON.stringify(safePrefix)}; const log = (...a) => { try { console.log(__lp, ...a); } catch {} };\\n`\n : '';\n // When wrapping, execute user code inside an IIFE and return its value.\n // This reliably captures the value of the last expression or any explicit\n // return statements inside the script, without requiring the caller to\n // manually `return` at top level.\n // Wrapper heuristic:\n // - If the snippet contains an explicit `return`, semicolons or newlines (likely a block),\n // run it inside an IIFE so `return` works: (() => { code })()\n // - Otherwise treat it as a pure expression and return its value directly.\n const src = String(userCode);\n const looksLikeBlock = /\\breturn\\b/.test(src) || /;/.test(src) || /\\n/.test(src);\n // Heuristic: if the snippet itself looks like an IIFE/callable expression\n // (e.g., `(() => { ... })()` or `(function(){ ... })()`), return its value\n // directly to avoid swallowing the result by nesting it inside another block.\n const looksLikeIife = /\\)\\s*\\(\\s*\\)\\s*;?$/.test(src.trim());\n const body = opts.wrapFunction\n ? looksLikeBlock\n ? looksLikeIife\n ? `return (\\n${src}\\n);\\n`\n : `return (() => {\\n${src}\\n})();\\n`\n : `return (\\n${src}\\n);\\n`\n : `${src}`;\n const code = `${header}${body}`;\n let exec: ReturnType<typeof sandbox.compile>;\n try {\n exec = sandbox.compile(code);\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n throw new Error(`sandbox_compile_error: ${msg}`);\n }\n\n let out: any;\n try {\n out = exec(scope);\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n throw new Error(`sandbox_execution_error: ${msg}`);\n }\n\n if (out && typeof out.run === 'function') {\n try {\n return out.run();\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n throw new Error(`sandbox_runner_error: ${msg}`);\n }\n }\n return out as T;\n}\n"],"mappings":";;;;;AAAA,OAAO,aAAa;AA0Bb,SAAS,iBAAiB,MAAwC;AACvE,MAAI,CAAC,QAAQ,OAAO,SAAS,UAAU;AACrC,WAAO,EAAE,OAAO,OAAO,OAAO,kCAAkC;AAAA,EAClE;AAEA,QAAM,UAAU,KAAK,KAAK;AAC1B,MAAI,QAAQ,WAAW,GAAG;AACxB,WAAO,EAAE,OAAO,OAAO,OAAO,uBAAuB;AAAA,EACvD;AAGA,QAAM,UAAU,oBAAoB;AAGpC,QAAM,iBAAiB,aAAa,KAAK,OAAO,KAAK,IAAI,KAAK,OAAO,KAAK,KAAK,KAAK,OAAO;AAC3F,QAAM,gBAAgB,qBAAqB,KAAK,OAAO;AACvD,QAAM,OAAO,iBACT,gBACE;AAAA,EAAa,OAAO;AAAA;AAAA,IACpB;AAAA,EAAoB,OAAO;AAAA;AAAA,IAC7B;AAAA,EAAa,OAAO;AAAA;AAAA;AAGxB,QAAM,SAAS;AAAA;AACf,QAAM,WAAW,GAAG,MAAM,GAAG,IAAI;AAEjC,MAAI;AACF,YAAQ,QAAQ,QAAQ;AACxB,WAAO,EAAE,OAAO,KAAK;AAAA,EACvB,SAAS,GAAG;AACV,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logger
4
- } from "./chunk-3NMLT3YS.mjs";
5
- import {
6
- __esm
7
- } from "./chunk-WMJKH4XE.mjs";
8
-
9
- // src/dependency-resolver.ts
10
- var DependencyResolver;
11
- var init_dependency_resolver = __esm({
12
- "src/dependency-resolver.ts"() {
13
- "use strict";
14
- DependencyResolver = class {
15
- /**
16
- * Build dependency graph from check dependencies
17
- */
18
- static buildDependencyGraph(checkDependencies) {
19
- const nodes = /* @__PURE__ */ new Map();
20
- for (const checkId of Object.keys(checkDependencies)) {
21
- nodes.set(checkId, {
22
- id: checkId,
23
- dependencies: checkDependencies[checkId] || [],
24
- dependents: [],
25
- depth: 0
26
- });
27
- }
28
- for (const [checkId, dependencies] of Object.entries(checkDependencies)) {
29
- for (const depId of dependencies || []) {
30
- if (!nodes.has(depId)) {
31
- throw new Error(`Check "${checkId}" depends on "${depId}" but "${depId}" is not defined`);
32
- }
33
- const depNode = nodes.get(depId);
34
- depNode.dependents.push(checkId);
35
- }
36
- }
37
- const cycleDetection = this.detectCycles(nodes);
38
- if (cycleDetection.hasCycles) {
39
- return {
40
- nodes,
41
- executionOrder: [],
42
- hasCycles: true,
43
- cycleNodes: cycleDetection.cycleNodes
44
- };
45
- }
46
- const executionOrder = this.topologicalSort(nodes);
47
- return {
48
- nodes,
49
- executionOrder,
50
- hasCycles: false
51
- };
52
- }
53
- /**
54
- * Detect cycles in the dependency graph using DFS
55
- */
56
- static detectCycles(nodes) {
57
- const visited = /* @__PURE__ */ new Set();
58
- const recursionStack = /* @__PURE__ */ new Set();
59
- const cycleNodes = [];
60
- const dfs = (nodeId) => {
61
- if (recursionStack.has(nodeId)) {
62
- cycleNodes.push(nodeId);
63
- return true;
64
- }
65
- if (visited.has(nodeId)) {
66
- return false;
67
- }
68
- visited.add(nodeId);
69
- recursionStack.add(nodeId);
70
- const node = nodes.get(nodeId);
71
- if (node) {
72
- for (const depId of node.dependencies) {
73
- if (dfs(depId)) {
74
- cycleNodes.push(nodeId);
75
- return true;
76
- }
77
- }
78
- }
79
- recursionStack.delete(nodeId);
80
- return false;
81
- };
82
- for (const nodeId of nodes.keys()) {
83
- if (!visited.has(nodeId)) {
84
- if (dfs(nodeId)) {
85
- return { hasCycles: true, cycleNodes: [...new Set(cycleNodes)] };
86
- }
87
- }
88
- }
89
- return { hasCycles: false };
90
- }
91
- /**
92
- * Perform topological sort to determine execution order
93
- * Groups checks that can run in parallel at each level
94
- */
95
- static topologicalSort(nodes) {
96
- const remainingNodes = new Map(nodes);
97
- const executionGroups = [];
98
- let level = 0;
99
- while (remainingNodes.size > 0) {
100
- const readyNodes = [];
101
- for (const [nodeId, node] of remainingNodes.entries()) {
102
- const unmetDependencies = node.dependencies.filter((depId) => remainingNodes.has(depId));
103
- if (unmetDependencies.length === 0) {
104
- readyNodes.push(nodeId);
105
- }
106
- }
107
- if (readyNodes.length === 0) {
108
- throw new Error("Unable to resolve dependencies - possible circular dependency detected");
109
- }
110
- executionGroups.push({
111
- parallel: readyNodes,
112
- level
113
- });
114
- for (const nodeId of readyNodes) {
115
- remainingNodes.delete(nodeId);
116
- }
117
- level++;
118
- }
119
- return executionGroups;
120
- }
121
- /**
122
- * Validate that all dependencies exist
123
- */
124
- static validateDependencies(checkIds, dependencies) {
125
- const errors = [];
126
- const checkIdSet = new Set(checkIds);
127
- for (const [checkId, deps] of Object.entries(dependencies)) {
128
- if (!checkIdSet.has(checkId)) {
129
- errors.push(`Check "${checkId}" is not in the list of available checks`);
130
- continue;
131
- }
132
- for (const depId of deps || []) {
133
- if (!checkIdSet.has(depId)) {
134
- errors.push(`Check "${checkId}" depends on "${depId}" which is not available`);
135
- }
136
- }
137
- }
138
- return {
139
- valid: errors.length === 0,
140
- errors
141
- };
142
- }
143
- /**
144
- * Get all transitive dependencies (ancestors) for a given check
145
- * This returns all checks that must complete before the given check can run,
146
- * not just the direct dependencies.
147
- *
148
- * For example, if A -> B -> C, then:
149
- * - getAllDependencies(C) returns [A, B]
150
- * - getAllDependencies(B) returns [A]
151
- * - getAllDependencies(A) returns []
152
- *
153
- * @param checkId The check to find dependencies for
154
- * @param nodes The dependency graph nodes
155
- * @returns Array of all transitive dependency IDs
156
- */
157
- static getAllDependencies(checkId, nodes) {
158
- const allDeps = /* @__PURE__ */ new Set();
159
- const visited = /* @__PURE__ */ new Set();
160
- const collectDependencies = (currentId) => {
161
- if (visited.has(currentId)) {
162
- return;
163
- }
164
- visited.add(currentId);
165
- const node = nodes.get(currentId);
166
- if (!node) {
167
- return;
168
- }
169
- for (const depId of node.dependencies) {
170
- allDeps.add(depId);
171
- collectDependencies(depId);
172
- }
173
- };
174
- collectDependencies(checkId);
175
- return Array.from(allDeps);
176
- }
177
- /**
178
- * Get execution statistics for debugging
179
- */
180
- static getExecutionStats(graph) {
181
- const totalChecks = graph.nodes.size;
182
- const parallelLevels = graph.executionOrder.length;
183
- const maxParallelism = Math.max(...graph.executionOrder.map((group) => group.parallel.length));
184
- const averageParallelism = totalChecks / parallelLevels;
185
- const checksWithDependencies = Array.from(graph.nodes.values()).filter(
186
- (node) => node.dependencies.length > 0
187
- ).length;
188
- return {
189
- totalChecks,
190
- parallelLevels,
191
- maxParallelism,
192
- averageParallelism,
193
- checksWithDependencies
194
- };
195
- }
196
- };
197
- }
198
- });
199
-
200
- // src/workflow-registry.ts
201
- import { promises as fs } from "fs";
202
- import * as path from "path";
203
- import * as yaml from "js-yaml";
204
- import Ajv from "ajv";
205
- import addFormats from "ajv-formats";
206
- var WorkflowRegistry;
207
- var init_workflow_registry = __esm({
208
- "src/workflow-registry.ts"() {
209
- init_logger();
210
- init_dependency_resolver();
211
- WorkflowRegistry = class _WorkflowRegistry {
212
- static instance;
213
- workflows = /* @__PURE__ */ new Map();
214
- ajv;
215
- constructor() {
216
- this.ajv = new Ajv({ allErrors: true, strict: false });
217
- addFormats(this.ajv);
218
- }
219
- /**
220
- * Get the singleton instance of the workflow registry
221
- */
222
- static getInstance() {
223
- if (!_WorkflowRegistry.instance) {
224
- _WorkflowRegistry.instance = new _WorkflowRegistry();
225
- }
226
- return _WorkflowRegistry.instance;
227
- }
228
- /**
229
- * Register a workflow definition
230
- */
231
- register(workflow, source = "inline", options) {
232
- const validation = this.validateWorkflow(workflow);
233
- if (!validation.valid) {
234
- return validation;
235
- }
236
- if (this.workflows.has(workflow.id) && !options?.override) {
237
- return {
238
- valid: false,
239
- errors: [
240
- {
241
- path: "id",
242
- message: `Workflow with ID '${workflow.id}' already exists`,
243
- value: workflow.id
244
- }
245
- ]
246
- };
247
- }
248
- this.workflows.set(workflow.id, {
249
- definition: workflow,
250
- source,
251
- registeredAt: /* @__PURE__ */ new Date(),
252
- usage: {
253
- count: 0
254
- }
255
- });
256
- logger.debug(`Registered workflow '${workflow.id}' from ${source}`);
257
- return { valid: true };
258
- }
259
- /**
260
- * Get a workflow by ID
261
- */
262
- get(id) {
263
- const entry = this.workflows.get(id);
264
- if (entry) {
265
- entry.usage = entry.usage || { count: 0 };
266
- entry.usage.count++;
267
- entry.usage.lastUsed = /* @__PURE__ */ new Date();
268
- }
269
- return entry?.definition;
270
- }
271
- /**
272
- * Check if a workflow exists
273
- */
274
- has(id) {
275
- return this.workflows.has(id);
276
- }
277
- /**
278
- * List all registered workflows
279
- */
280
- list() {
281
- return Array.from(this.workflows.values()).map((entry) => entry.definition);
282
- }
283
- /**
284
- * Get workflow metadata
285
- */
286
- getMetadata(id) {
287
- return this.workflows.get(id);
288
- }
289
- /**
290
- * Remove a workflow from the registry
291
- */
292
- unregister(id) {
293
- return this.workflows.delete(id);
294
- }
295
- /**
296
- * Clear all workflows
297
- */
298
- clear() {
299
- this.workflows.clear();
300
- }
301
- /**
302
- * Import workflows from a file or URL
303
- */
304
- async import(source, options) {
305
- const results = [];
306
- try {
307
- const content = await this.loadWorkflowContent(source, options?.basePath);
308
- const data = this.parseWorkflowContent(content, source);
309
- const workflows = Array.isArray(data) ? data : [data];
310
- for (const workflow of workflows) {
311
- if (options?.validate !== false) {
312
- const validation = this.validateWorkflow(workflow);
313
- if (!validation.valid) {
314
- results.push(validation);
315
- continue;
316
- }
317
- if (options?.validators) {
318
- for (const validator of options.validators) {
319
- const customValidation = validator(workflow);
320
- if (!customValidation.valid) {
321
- results.push(customValidation);
322
- continue;
323
- }
324
- }
325
- }
326
- }
327
- const workflowWithoutTests = { ...workflow };
328
- delete workflowWithoutTests.tests;
329
- const result = this.register(workflowWithoutTests, source, { override: options?.override });
330
- results.push(result);
331
- }
332
- } catch (error) {
333
- results.push({
334
- valid: false,
335
- errors: [
336
- {
337
- path: "source",
338
- message: `Failed to import workflows from '${source}': ${error instanceof Error ? error.message : String(error)}`,
339
- value: source
340
- }
341
- ]
342
- });
343
- }
344
- return results;
345
- }
346
- /**
347
- * Import multiple workflow sources
348
- */
349
- async importMany(sources, options) {
350
- const results = /* @__PURE__ */ new Map();
351
- for (const source of sources) {
352
- const importResults = await this.import(source, options);
353
- results.set(source, importResults);
354
- }
355
- return results;
356
- }
357
- /**
358
- * Validate a workflow definition
359
- */
360
- validateWorkflow(workflow) {
361
- const errors = [];
362
- const warnings = [];
363
- if (!workflow.id) {
364
- errors.push({ path: "id", message: "Workflow ID is required" });
365
- }
366
- if (!workflow.name) {
367
- errors.push({ path: "name", message: "Workflow name is required" });
368
- }
369
- if (!workflow.steps || Object.keys(workflow.steps).length === 0) {
370
- errors.push({ path: "steps", message: "Workflow must have at least one step" });
371
- }
372
- if (workflow.inputs) {
373
- for (let i = 0; i < workflow.inputs.length; i++) {
374
- const input = workflow.inputs[i];
375
- if (!input.name) {
376
- errors.push({ path: `inputs[${i}].name`, message: "Input parameter name is required" });
377
- }
378
- if (!input.schema) {
379
- warnings.push({
380
- path: `inputs[${i}].schema`,
381
- message: "Input parameter schema is recommended"
382
- });
383
- }
384
- }
385
- }
386
- if (workflow.outputs) {
387
- for (let i = 0; i < workflow.outputs.length; i++) {
388
- const output = workflow.outputs[i];
389
- if (!output.name) {
390
- errors.push({ path: `outputs[${i}].name`, message: "Output parameter name is required" });
391
- }
392
- if (!output.value && !output.value_js) {
393
- errors.push({
394
- path: `outputs[${i}]`,
395
- message: "Output parameter must have either value or value_js"
396
- });
397
- }
398
- }
399
- }
400
- for (const [stepId, step] of Object.entries(workflow.steps || {})) {
401
- if (step.depends_on) {
402
- for (const dep of step.depends_on) {
403
- if (!workflow.steps[dep]) {
404
- errors.push({
405
- path: `steps.${stepId}.depends_on`,
406
- message: `Step '${stepId}' depends on non-existent step '${dep}'`,
407
- value: dep
408
- });
409
- }
410
- }
411
- }
412
- if (step.inputs) {
413
- for (const [inputName, mapping] of Object.entries(step.inputs)) {
414
- if (typeof mapping === "object" && mapping !== null && "source" in mapping) {
415
- const typedMapping = mapping;
416
- if (typedMapping.source === "step" && !typedMapping.stepId) {
417
- errors.push({
418
- path: `steps.${stepId}.inputs.${inputName}`,
419
- message: 'Step input mapping with source "step" must have stepId'
420
- });
421
- }
422
- if (typedMapping.source === "param") {
423
- const paramExists = workflow.inputs?.some((p) => p.name === typedMapping.value);
424
- if (!paramExists) {
425
- errors.push({
426
- path: `steps.${stepId}.inputs.${inputName}`,
427
- message: `Step input references non-existent parameter '${typedMapping.value}'`,
428
- value: typedMapping.value
429
- });
430
- }
431
- }
432
- }
433
- }
434
- }
435
- }
436
- const circularDeps = this.detectCircularDependencies(workflow);
437
- if (circularDeps.length > 0) {
438
- errors.push({
439
- path: "steps",
440
- message: `Circular dependencies detected: ${circularDeps.join(" -> ")}`
441
- });
442
- }
443
- return {
444
- valid: errors.length === 0,
445
- errors: errors.length > 0 ? errors : void 0,
446
- warnings: warnings.length > 0 ? warnings : void 0
447
- };
448
- }
449
- /**
450
- * Validate input values against workflow input schema
451
- */
452
- validateInputs(workflow, inputs) {
453
- const errors = [];
454
- if (!workflow.inputs) {
455
- return { valid: true };
456
- }
457
- for (const param of workflow.inputs) {
458
- if (param.required !== false && !(param.name in inputs) && param.default === void 0) {
459
- errors.push({
460
- path: `inputs.${param.name}`,
461
- message: `Required input '${param.name}' is missing`
462
- });
463
- }
464
- }
465
- for (const param of workflow.inputs) {
466
- if (param.name in inputs && param.schema) {
467
- const value = inputs[param.name];
468
- const valid = this.validateAgainstSchema(value, param.schema);
469
- if (!valid.valid) {
470
- errors.push({
471
- path: `inputs.${param.name}`,
472
- message: valid.error || "Invalid input value",
473
- value
474
- });
475
- }
476
- }
477
- }
478
- return {
479
- valid: errors.length === 0,
480
- errors: errors.length > 0 ? errors : void 0
481
- };
482
- }
483
- /**
484
- * Load workflow content from file or URL
485
- */
486
- async loadWorkflowContent(source, basePath) {
487
- if (source.startsWith("http://") || source.startsWith("https://")) {
488
- const response = await fetch(source);
489
- if (!response.ok) {
490
- throw new Error(`Failed to fetch workflow from ${source}: ${response.statusText}`);
491
- }
492
- return await response.text();
493
- }
494
- const filePath = path.isAbsolute(source) ? source : path.resolve(basePath || process.cwd(), source);
495
- return await fs.readFile(filePath, "utf-8");
496
- }
497
- /**
498
- * Parse workflow content (YAML or JSON)
499
- */
500
- parseWorkflowContent(content, source) {
501
- try {
502
- return JSON.parse(content);
503
- } catch {
504
- try {
505
- return yaml.load(content);
506
- } catch (error) {
507
- throw new Error(
508
- `Failed to parse workflow file ${source}: ${error instanceof Error ? error.message : String(error)}`
509
- );
510
- }
511
- }
512
- }
513
- /**
514
- * Detect circular dependencies in workflow steps using DependencyResolver
515
- */
516
- detectCircularDependencies(workflow) {
517
- const dependencies = {};
518
- for (const [stepId, step] of Object.entries(workflow.steps || {})) {
519
- const rawDeps = step.depends_on;
520
- dependencies[stepId] = Array.isArray(rawDeps) ? rawDeps : rawDeps ? [rawDeps] : [];
521
- }
522
- try {
523
- const graph = DependencyResolver.buildDependencyGraph(dependencies);
524
- if (graph.hasCycles && graph.cycleNodes) {
525
- return graph.cycleNodes;
526
- }
527
- return [];
528
- } catch {
529
- return [];
530
- }
531
- }
532
- /**
533
- * Validate a value against a JSON schema
534
- */
535
- validateAgainstSchema(value, schema) {
536
- try {
537
- const validate = this.ajv.compile(schema);
538
- const valid = validate(value);
539
- if (!valid) {
540
- const errors = validate.errors?.map((e) => `${e.instancePath || "/"}: ${e.message}`).join(", ");
541
- return { valid: false, error: errors };
542
- }
543
- return { valid: true };
544
- } catch (error) {
545
- return { valid: false, error: error instanceof Error ? error.message : String(error) };
546
- }
547
- }
548
- };
549
- }
550
- });
551
-
552
- export {
553
- DependencyResolver,
554
- init_dependency_resolver,
555
- WorkflowRegistry,
556
- init_workflow_registry
557
- };
558
- //# sourceMappingURL=chunk-J6EVEXC2.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../src/dependency-resolver.ts","../../src/workflow-registry.ts"],"sourcesContent":["/**\n * Dependency resolution and execution ordering for checks\n */\n\nexport interface CheckNode {\n id: string;\n dependencies: string[];\n dependents: string[];\n depth: number;\n}\n\nexport interface ExecutionGroup {\n /** Checks that can run in parallel */\n parallel: string[];\n /** Execution level/wave (0 = no dependencies, 1 = depends on level 0, etc.) */\n level: number;\n}\n\nexport interface DependencyGraph {\n nodes: Map<string, CheckNode>;\n executionOrder: ExecutionGroup[];\n hasCycles: boolean;\n cycleNodes?: string[];\n}\n\nexport class DependencyResolver {\n /**\n * Build dependency graph from check dependencies\n */\n static buildDependencyGraph(checkDependencies: Record<string, string[]>): DependencyGraph {\n const nodes = new Map<string, CheckNode>();\n\n // Initialize all nodes\n for (const checkId of Object.keys(checkDependencies)) {\n nodes.set(checkId, {\n id: checkId,\n dependencies: checkDependencies[checkId] || [],\n dependents: [],\n depth: 0,\n });\n }\n\n // Build bidirectional relationships\n for (const [checkId, dependencies] of Object.entries(checkDependencies)) {\n for (const depId of dependencies || []) {\n if (!nodes.has(depId)) {\n throw new Error(`Check \"${checkId}\" depends on \"${depId}\" but \"${depId}\" is not defined`);\n }\n\n const depNode = nodes.get(depId)!;\n depNode.dependents.push(checkId);\n }\n }\n\n // Detect cycles using DFS\n const cycleDetection = this.detectCycles(nodes);\n if (cycleDetection.hasCycles) {\n return {\n nodes,\n executionOrder: [],\n hasCycles: true,\n cycleNodes: cycleDetection.cycleNodes,\n };\n }\n\n // Calculate execution order using topological sort\n const executionOrder = this.topologicalSort(nodes);\n\n return {\n nodes,\n executionOrder,\n hasCycles: false,\n };\n }\n\n /**\n * Detect cycles in the dependency graph using DFS\n */\n private static detectCycles(nodes: Map<string, CheckNode>): {\n hasCycles: boolean;\n cycleNodes?: string[];\n } {\n const visited = new Set<string>();\n const recursionStack = new Set<string>();\n const cycleNodes: string[] = [];\n\n const dfs = (nodeId: string): boolean => {\n if (recursionStack.has(nodeId)) {\n cycleNodes.push(nodeId);\n return true;\n }\n if (visited.has(nodeId)) {\n return false;\n }\n\n visited.add(nodeId);\n recursionStack.add(nodeId);\n\n const node = nodes.get(nodeId);\n if (node) {\n for (const depId of node.dependencies) {\n if (dfs(depId)) {\n cycleNodes.push(nodeId);\n return true;\n }\n }\n }\n\n recursionStack.delete(nodeId);\n return false;\n };\n\n for (const nodeId of nodes.keys()) {\n if (!visited.has(nodeId)) {\n if (dfs(nodeId)) {\n return { hasCycles: true, cycleNodes: [...new Set(cycleNodes)] };\n }\n }\n }\n\n return { hasCycles: false };\n }\n\n /**\n * Perform topological sort to determine execution order\n * Groups checks that can run in parallel at each level\n */\n private static topologicalSort(nodes: Map<string, CheckNode>): ExecutionGroup[] {\n const remainingNodes = new Map(nodes);\n const executionGroups: ExecutionGroup[] = [];\n let level = 0;\n\n while (remainingNodes.size > 0) {\n // Find nodes with no remaining dependencies\n const readyNodes: string[] = [];\n\n for (const [nodeId, node] of remainingNodes.entries()) {\n const unmetDependencies = node.dependencies.filter(depId => remainingNodes.has(depId));\n if (unmetDependencies.length === 0) {\n readyNodes.push(nodeId);\n }\n }\n\n if (readyNodes.length === 0) {\n // This shouldn't happen if cycle detection worked correctly\n throw new Error('Unable to resolve dependencies - possible circular dependency detected');\n }\n\n // Add this group to execution order\n executionGroups.push({\n parallel: readyNodes,\n level,\n });\n\n // Remove processed nodes\n for (const nodeId of readyNodes) {\n remainingNodes.delete(nodeId);\n }\n\n level++;\n }\n\n return executionGroups;\n }\n\n /**\n * Validate that all dependencies exist\n */\n static validateDependencies(\n checkIds: string[],\n dependencies: Record<string, string[]>\n ): { valid: boolean; errors: string[] } {\n const errors: string[] = [];\n const checkIdSet = new Set(checkIds);\n\n for (const [checkId, deps] of Object.entries(dependencies)) {\n if (!checkIdSet.has(checkId)) {\n errors.push(`Check \"${checkId}\" is not in the list of available checks`);\n continue;\n }\n\n for (const depId of deps || []) {\n if (!checkIdSet.has(depId)) {\n errors.push(`Check \"${checkId}\" depends on \"${depId}\" which is not available`);\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n };\n }\n\n /**\n * Get all transitive dependencies (ancestors) for a given check\n * This returns all checks that must complete before the given check can run,\n * not just the direct dependencies.\n *\n * For example, if A -> B -> C, then:\n * - getAllDependencies(C) returns [A, B]\n * - getAllDependencies(B) returns [A]\n * - getAllDependencies(A) returns []\n *\n * @param checkId The check to find dependencies for\n * @param nodes The dependency graph nodes\n * @returns Array of all transitive dependency IDs\n */\n static getAllDependencies(checkId: string, nodes: Map<string, CheckNode>): string[] {\n const allDeps = new Set<string>();\n const visited = new Set<string>();\n\n const collectDependencies = (currentId: string) => {\n if (visited.has(currentId)) {\n return;\n }\n visited.add(currentId);\n\n const node = nodes.get(currentId);\n if (!node) {\n return;\n }\n\n // Add direct dependencies and recurse\n for (const depId of node.dependencies) {\n allDeps.add(depId);\n collectDependencies(depId);\n }\n };\n\n collectDependencies(checkId);\n return Array.from(allDeps);\n }\n\n /**\n * Get execution statistics for debugging\n */\n static getExecutionStats(graph: DependencyGraph): {\n totalChecks: number;\n parallelLevels: number;\n maxParallelism: number;\n averageParallelism: number;\n checksWithDependencies: number;\n } {\n const totalChecks = graph.nodes.size;\n const parallelLevels = graph.executionOrder.length;\n const maxParallelism = Math.max(...graph.executionOrder.map(group => group.parallel.length));\n const averageParallelism = totalChecks / parallelLevels;\n const checksWithDependencies = Array.from(graph.nodes.values()).filter(\n node => node.dependencies.length > 0\n ).length;\n\n return {\n totalChecks,\n parallelLevels,\n maxParallelism,\n averageParallelism,\n checksWithDependencies,\n };\n }\n}\n","/**\n * Workflow registry for managing reusable workflow definitions\n */\n\nimport {\n WorkflowDefinition,\n WorkflowRegistryEntry,\n WorkflowValidationResult,\n WorkflowImportOptions,\n JsonSchema,\n} from './types/workflow';\nimport { promises as fs } from 'fs';\nimport * as path from 'path';\nimport * as yaml from 'js-yaml';\nimport { logger } from './logger';\nimport { DependencyResolver } from './dependency-resolver';\nimport Ajv from 'ajv';\nimport addFormats from 'ajv-formats';\n\n/**\n * Registry for managing workflow definitions\n */\nexport class WorkflowRegistry {\n private static instance: WorkflowRegistry;\n private workflows: Map<string, WorkflowRegistryEntry> = new Map();\n private ajv: Ajv;\n\n private constructor() {\n this.ajv = new Ajv({ allErrors: true, strict: false });\n addFormats(this.ajv);\n }\n\n /**\n * Get the singleton instance of the workflow registry\n */\n public static getInstance(): WorkflowRegistry {\n if (!WorkflowRegistry.instance) {\n WorkflowRegistry.instance = new WorkflowRegistry();\n }\n return WorkflowRegistry.instance;\n }\n\n /**\n * Register a workflow definition\n */\n public register(\n workflow: WorkflowDefinition,\n source: string = 'inline',\n options?: { override?: boolean }\n ): WorkflowValidationResult {\n // Validate the workflow\n const validation = this.validateWorkflow(workflow);\n if (!validation.valid) {\n return validation;\n }\n\n // Check if workflow already exists\n if (this.workflows.has(workflow.id) && !options?.override) {\n return {\n valid: false,\n errors: [\n {\n path: 'id',\n message: `Workflow with ID '${workflow.id}' already exists`,\n value: workflow.id,\n },\n ],\n };\n }\n\n // Register the workflow\n this.workflows.set(workflow.id, {\n definition: workflow,\n source,\n registeredAt: new Date(),\n usage: {\n count: 0,\n },\n });\n\n logger.debug(`Registered workflow '${workflow.id}' from ${source}`);\n return { valid: true };\n }\n\n /**\n * Get a workflow by ID\n */\n public get(id: string): WorkflowDefinition | undefined {\n const entry = this.workflows.get(id);\n if (entry) {\n // Update usage statistics\n entry.usage = entry.usage || { count: 0 };\n entry.usage.count++;\n entry.usage.lastUsed = new Date();\n }\n return entry?.definition;\n }\n\n /**\n * Check if a workflow exists\n */\n public has(id: string): boolean {\n return this.workflows.has(id);\n }\n\n /**\n * List all registered workflows\n */\n public list(): WorkflowDefinition[] {\n return Array.from(this.workflows.values()).map(entry => entry.definition);\n }\n\n /**\n * Get workflow metadata\n */\n public getMetadata(id: string): WorkflowRegistryEntry | undefined {\n return this.workflows.get(id);\n }\n\n /**\n * Remove a workflow from the registry\n */\n public unregister(id: string): boolean {\n return this.workflows.delete(id);\n }\n\n /**\n * Clear all workflows\n */\n public clear(): void {\n this.workflows.clear();\n }\n\n /**\n * Import workflows from a file or URL\n */\n public async import(\n source: string,\n options?: WorkflowImportOptions\n ): Promise<WorkflowValidationResult[]> {\n const results: WorkflowValidationResult[] = [];\n\n try {\n // Load the workflow file\n const content = await this.loadWorkflowContent(source, options?.basePath);\n const data = this.parseWorkflowContent(content, source);\n\n // Handle both single workflow and multiple workflows\n const workflows: WorkflowDefinition[] = Array.isArray(data) ? data : [data];\n\n for (const workflow of workflows) {\n // Validate if requested\n if (options?.validate !== false) {\n const validation = this.validateWorkflow(workflow);\n if (!validation.valid) {\n results.push(validation);\n continue;\n }\n\n // Run custom validators if provided\n if (options?.validators) {\n for (const validator of options.validators) {\n const customValidation = validator(workflow);\n if (!customValidation.valid) {\n results.push(customValidation);\n continue;\n }\n }\n }\n }\n\n // Strip out 'tests' field before registering - tests are only for standalone execution\n const workflowWithoutTests = { ...workflow };\n delete (workflowWithoutTests as any).tests;\n\n // Register the workflow (without tests)\n const result = this.register(workflowWithoutTests, source, { override: options?.override });\n results.push(result);\n }\n } catch (error) {\n results.push({\n valid: false,\n errors: [\n {\n path: 'source',\n message: `Failed to import workflows from '${source}': ${error instanceof Error ? error.message : String(error)}`,\n value: source,\n },\n ],\n });\n }\n\n return results;\n }\n\n /**\n * Import multiple workflow sources\n */\n public async importMany(\n sources: string[],\n options?: WorkflowImportOptions\n ): Promise<Map<string, WorkflowValidationResult[]>> {\n const results = new Map<string, WorkflowValidationResult[]>();\n\n for (const source of sources) {\n const importResults = await this.import(source, options);\n results.set(source, importResults);\n }\n\n return results;\n }\n\n /**\n * Validate a workflow definition\n */\n public validateWorkflow(workflow: WorkflowDefinition): WorkflowValidationResult {\n const errors: Array<{ path: string; message: string; value?: unknown }> = [];\n const warnings: Array<{ path: string; message: string }> = [];\n\n // Validate required fields\n if (!workflow.id) {\n errors.push({ path: 'id', message: 'Workflow ID is required' });\n }\n\n if (!workflow.name) {\n errors.push({ path: 'name', message: 'Workflow name is required' });\n }\n\n if (!workflow.steps || Object.keys(workflow.steps).length === 0) {\n errors.push({ path: 'steps', message: 'Workflow must have at least one step' });\n }\n\n // Validate input parameters\n if (workflow.inputs) {\n for (let i = 0; i < workflow.inputs.length; i++) {\n const input = workflow.inputs[i];\n if (!input.name) {\n errors.push({ path: `inputs[${i}].name`, message: 'Input parameter name is required' });\n }\n if (!input.schema) {\n warnings.push({\n path: `inputs[${i}].schema`,\n message: 'Input parameter schema is recommended',\n });\n }\n }\n }\n\n // Validate output parameters\n if (workflow.outputs) {\n for (let i = 0; i < workflow.outputs.length; i++) {\n const output = workflow.outputs[i];\n if (!output.name) {\n errors.push({ path: `outputs[${i}].name`, message: 'Output parameter name is required' });\n }\n if (!output.value && !output.value_js) {\n errors.push({\n path: `outputs[${i}]`,\n message: 'Output parameter must have either value or value_js',\n });\n }\n }\n }\n\n // Validate steps\n for (const [stepId, step] of Object.entries(workflow.steps || {})) {\n // Validate step dependencies\n if (step.depends_on) {\n for (const dep of step.depends_on) {\n if (!workflow.steps[dep]) {\n errors.push({\n path: `steps.${stepId}.depends_on`,\n message: `Step '${stepId}' depends on non-existent step '${dep}'`,\n value: dep,\n });\n }\n }\n }\n\n // Validate input mappings\n if (step.inputs) {\n for (const [inputName, mapping] of Object.entries(step.inputs)) {\n if (typeof mapping === 'object' && mapping !== null && 'source' in mapping) {\n const typedMapping = mapping as any;\n if (typedMapping.source === 'step' && !typedMapping.stepId) {\n errors.push({\n path: `steps.${stepId}.inputs.${inputName}`,\n message: 'Step input mapping with source \"step\" must have stepId',\n });\n }\n if (typedMapping.source === 'param') {\n // Validate that the parameter exists\n const paramExists = workflow.inputs?.some(p => p.name === typedMapping.value);\n if (!paramExists) {\n errors.push({\n path: `steps.${stepId}.inputs.${inputName}`,\n message: `Step input references non-existent parameter '${typedMapping.value}'`,\n value: typedMapping.value,\n });\n }\n }\n }\n }\n }\n }\n\n // Check for circular dependencies\n const circularDeps = this.detectCircularDependencies(workflow);\n if (circularDeps.length > 0) {\n errors.push({\n path: 'steps',\n message: `Circular dependencies detected: ${circularDeps.join(' -> ')}`,\n });\n }\n\n return {\n valid: errors.length === 0,\n errors: errors.length > 0 ? errors : undefined,\n warnings: warnings.length > 0 ? warnings : undefined,\n };\n }\n\n /**\n * Validate input values against workflow input schema\n */\n public validateInputs(\n workflow: WorkflowDefinition,\n inputs: Record<string, unknown>\n ): WorkflowValidationResult {\n const errors: Array<{ path: string; message: string; value?: unknown }> = [];\n\n if (!workflow.inputs) {\n return { valid: true };\n }\n\n // Check required inputs\n for (const param of workflow.inputs) {\n if (param.required !== false && !(param.name in inputs) && param.default === undefined) {\n errors.push({\n path: `inputs.${param.name}`,\n message: `Required input '${param.name}' is missing`,\n });\n }\n }\n\n // Validate input schemas\n for (const param of workflow.inputs) {\n if (param.name in inputs && param.schema) {\n const value = inputs[param.name];\n const valid = this.validateAgainstSchema(value, param.schema);\n if (!valid.valid) {\n errors.push({\n path: `inputs.${param.name}`,\n message: valid.error || 'Invalid input value',\n value,\n });\n }\n }\n }\n\n return {\n valid: errors.length === 0,\n errors: errors.length > 0 ? errors : undefined,\n };\n }\n\n /**\n * Load workflow content from file or URL\n */\n private async loadWorkflowContent(source: string, basePath?: string): Promise<string> {\n // Handle URLs\n if (source.startsWith('http://') || source.startsWith('https://')) {\n const response = await fetch(source);\n if (!response.ok) {\n throw new Error(`Failed to fetch workflow from ${source}: ${response.statusText}`);\n }\n return await response.text();\n }\n\n // Handle file paths\n const filePath = path.isAbsolute(source)\n ? source\n : path.resolve(basePath || process.cwd(), source);\n return await fs.readFile(filePath, 'utf-8');\n }\n\n /**\n * Parse workflow content (YAML or JSON)\n */\n private parseWorkflowContent(content: string, source: string): any {\n // Try JSON first\n try {\n return JSON.parse(content);\n } catch {\n // Try YAML\n try {\n return yaml.load(content);\n } catch (error) {\n throw new Error(\n `Failed to parse workflow file ${source}: ${error instanceof Error ? error.message : String(error)}`\n );\n }\n }\n }\n\n /**\n * Detect circular dependencies in workflow steps using DependencyResolver\n */\n private detectCircularDependencies(workflow: WorkflowDefinition): string[] {\n // Build dependency map\n const dependencies: Record<string, string[]> = {};\n for (const [stepId, step] of Object.entries(workflow.steps || {})) {\n // Normalize depends_on to array (supports string | string[])\n const rawDeps = step.depends_on;\n dependencies[stepId] = Array.isArray(rawDeps) ? rawDeps : rawDeps ? [rawDeps] : [];\n }\n\n try {\n // Use DependencyResolver to check for cycles\n const graph = DependencyResolver.buildDependencyGraph(dependencies);\n\n if (graph.hasCycles && graph.cycleNodes) {\n return graph.cycleNodes;\n }\n\n return [];\n } catch {\n // DependencyResolver throws error for non-existent dependencies\n // This should be caught by the dependency validation in validateWorkflow\n // Return empty array here and let the validation handle it\n return [];\n }\n }\n\n /**\n * Validate a value against a JSON schema\n */\n private validateAgainstSchema(\n value: unknown,\n schema: JsonSchema\n ): { valid: boolean; error?: string } {\n try {\n const validate = this.ajv.compile(schema as any);\n const valid = validate(value);\n if (!valid) {\n const errors = validate.errors\n ?.map(e => `${e.instancePath || '/'}: ${e.message}`)\n .join(', ');\n return { valid: false, error: errors };\n }\n return { valid: true };\n } catch (error) {\n return { valid: false, error: error instanceof Error ? error.message : String(error) };\n }\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAyBa;AAzBb;AAAA;AAAA;AAyBO,IAAM,qBAAN,MAAyB;AAAA;AAAA;AAAA;AAAA,MAI9B,OAAO,qBAAqB,mBAA8D;AACxF,cAAM,QAAQ,oBAAI,IAAuB;AAGzC,mBAAW,WAAW,OAAO,KAAK,iBA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