@sudobility/testomniac_runner_service 0.1.35 → 0.1.37

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 (56) hide show
  1. package/dist/api/client.d.ts +61 -2
  2. package/dist/api/client.d.ts.map +1 -1
  3. package/dist/api/client.js +37 -18
  4. package/dist/api/client.js.map +1 -1
  5. package/dist/crawler/link-extractor.d.ts +8 -0
  6. package/dist/crawler/link-extractor.d.ts.map +1 -0
  7. package/dist/crawler/link-extractor.js +37 -0
  8. package/dist/crawler/link-extractor.js.map +1 -0
  9. package/dist/crawler/url-normalizer.d.ts +4 -0
  10. package/dist/crawler/url-normalizer.d.ts.map +1 -0
  11. package/dist/crawler/url-normalizer.js +27 -0
  12. package/dist/crawler/url-normalizer.js.map +1 -0
  13. package/dist/expertise/accessibility-expertise.d.ts +11 -0
  14. package/dist/expertise/accessibility-expertise.d.ts.map +1 -0
  15. package/dist/expertise/accessibility-expertise.js +131 -0
  16. package/dist/expertise/accessibility-expertise.js.map +1 -0
  17. package/dist/expertise/content-expertise.d.ts +10 -0
  18. package/dist/expertise/content-expertise.d.ts.map +1 -0
  19. package/dist/expertise/content-expertise.js +102 -0
  20. package/dist/expertise/content-expertise.js.map +1 -0
  21. package/dist/expertise/index.d.ts +3 -0
  22. package/dist/expertise/index.d.ts.map +1 -1
  23. package/dist/expertise/index.js +9 -4
  24. package/dist/expertise/index.js.map +1 -1
  25. package/dist/expertise/ui-expertise.d.ts +10 -0
  26. package/dist/expertise/ui-expertise.d.ts.map +1 -0
  27. package/dist/expertise/ui-expertise.js +76 -0
  28. package/dist/expertise/ui-expertise.js.map +1 -0
  29. package/dist/orchestrator/decomposition.d.ts.map +1 -1
  30. package/dist/orchestrator/decomposition.js +300 -65
  31. package/dist/orchestrator/decomposition.js.map +1 -1
  32. package/dist/orchestrator/direct-navigation.d.ts +4 -0
  33. package/dist/orchestrator/direct-navigation.d.ts.map +1 -0
  34. package/dist/orchestrator/direct-navigation.js +47 -0
  35. package/dist/orchestrator/direct-navigation.js.map +1 -0
  36. package/dist/orchestrator/discovery.d.ts +10 -0
  37. package/dist/orchestrator/discovery.d.ts.map +1 -0
  38. package/dist/orchestrator/discovery.js +77 -0
  39. package/dist/orchestrator/discovery.js.map +1 -0
  40. package/dist/orchestrator/expertise.d.ts +5 -0
  41. package/dist/orchestrator/expertise.d.ts.map +1 -0
  42. package/dist/orchestrator/expertise.js +157 -0
  43. package/dist/orchestrator/expertise.js.map +1 -0
  44. package/dist/orchestrator/orchestrator.d.ts.map +1 -1
  45. package/dist/orchestrator/orchestrator.js +63 -37
  46. package/dist/orchestrator/orchestrator.js.map +1 -1
  47. package/dist/orchestrator/page-capture.d.ts +22 -0
  48. package/dist/orchestrator/page-capture.d.ts.map +1 -0
  49. package/dist/orchestrator/page-capture.js +102 -0
  50. package/dist/orchestrator/page-capture.js.map +1 -0
  51. package/dist/orchestrator/test-execution.d.ts.map +1 -1
  52. package/dist/orchestrator/test-execution.js +17 -32
  53. package/dist/orchestrator/test-execution.js.map +1 -1
  54. package/dist/orchestrator/types.d.ts +10 -0
  55. package/dist/orchestrator/types.d.ts.map +1 -1
  56. package/package.json +3 -3
@@ -0,0 +1,102 @@
1
+ function stripHtml(html) {
2
+ return html
3
+ .replace(/<script[\s\S]*?<\/script>/gi, " ")
4
+ .replace(/<style[\s\S]*?<\/style>/gi, " ")
5
+ .replace(/<[^>]+>/g, " ")
6
+ .replace(/\s+/g, " ")
7
+ .trim();
8
+ }
9
+ export class ContentExpertise {
10
+ name = "content";
11
+ evaluate(context) {
12
+ const outcomes = [];
13
+ outcomes.push(this.checkMeaningfulBodyText(context.html));
14
+ outcomes.push(this.checkSingleH1(context.html));
15
+ outcomes.push(this.checkPlaceholderContent(context.html));
16
+ outcomes.push(this.checkImageAltCoverage(context.html));
17
+ return outcomes;
18
+ }
19
+ checkMeaningfulBodyText(html) {
20
+ const text = stripHtml(html);
21
+ if (text.length < 120) {
22
+ return {
23
+ expected: "Page should contain meaningful body content",
24
+ observed: `Only ${text.length} characters of visible text were detected`,
25
+ result: "warning",
26
+ };
27
+ }
28
+ return {
29
+ expected: "Page should contain meaningful body content",
30
+ observed: `${text.length} characters of visible text detected`,
31
+ result: "pass",
32
+ };
33
+ }
34
+ checkSingleH1(html) {
35
+ const matches = html.match(/<h1\b[^>]*>[\s\S]*?<\/h1>/gi) ?? [];
36
+ if (matches.length === 1) {
37
+ return {
38
+ expected: "Page should have exactly one H1 heading",
39
+ observed: "Found exactly one H1 heading",
40
+ result: "pass",
41
+ };
42
+ }
43
+ if (matches.length === 0) {
44
+ return {
45
+ expected: "Page should have exactly one H1 heading",
46
+ observed: "No H1 heading detected",
47
+ result: "warning",
48
+ };
49
+ }
50
+ return {
51
+ expected: "Page should have exactly one H1 heading",
52
+ observed: `Found ${matches.length} H1 headings`,
53
+ result: "warning",
54
+ };
55
+ }
56
+ checkPlaceholderContent(html) {
57
+ const placeholderPatterns = [
58
+ /lorem ipsum/i,
59
+ /\bTODO\b/i,
60
+ /coming soon/i,
61
+ /placeholder/i,
62
+ /insert text here/i,
63
+ ];
64
+ const matched = placeholderPatterns.find(pattern => pattern.test(html));
65
+ if (matched) {
66
+ return {
67
+ expected: "Page content should not contain placeholder copy",
68
+ observed: `Placeholder content matched pattern ${matched}`,
69
+ result: "warning",
70
+ };
71
+ }
72
+ return {
73
+ expected: "Page content should not contain placeholder copy",
74
+ observed: "No obvious placeholder copy detected",
75
+ result: "pass",
76
+ };
77
+ }
78
+ checkImageAltCoverage(html) {
79
+ const images = html.match(/<img\b[^>]*>/gi) ?? [];
80
+ if (images.length === 0) {
81
+ return {
82
+ expected: "Images should provide alt text",
83
+ observed: "No images detected on the page",
84
+ result: "pass",
85
+ };
86
+ }
87
+ const missingAlt = images.filter(image => !/\balt\s*=\s*["'][^"']*["']/i.test(image));
88
+ if (missingAlt.length > 0) {
89
+ return {
90
+ expected: "Images should provide alt text",
91
+ observed: `${missingAlt.length} of ${images.length} image(s) are missing alt text`,
92
+ result: "warning",
93
+ };
94
+ }
95
+ return {
96
+ expected: "Images should provide alt text",
97
+ observed: `All ${images.length} image(s) include alt text`,
98
+ result: "pass",
99
+ };
100
+ }
101
+ }
102
+ //# sourceMappingURL=content-expertise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-expertise.js","sourceRoot":"","sources":["../../src/expertise/content-expertise.ts"],"names":[],"mappings":"AAEA,SAAS,SAAS,CAAC,IAAY;IAC7B,OAAO,IAAI;SACR,OAAO,CAAC,6BAA6B,EAAE,GAAG,CAAC;SAC3C,OAAO,CAAC,2BAA2B,EAAE,GAAG,CAAC;SACzC,OAAO,CAAC,UAAU,EAAE,GAAG,CAAC;SACxB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE,CAAC;AACZ,CAAC;AAED,MAAM,OAAO,gBAAgB;IAC3B,IAAI,GAAG,SAAS,CAAC;IAEjB,QAAQ,CAAC,OAAyB;QAChC,MAAM,QAAQ,GAAc,EAAE,CAAC;QAE/B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAChD,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,uBAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;QAExD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEO,uBAAuB,CAAC,IAAY;QAC1C,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;QAC7B,IAAI,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;YACtB,OAAO;gBACL,QAAQ,EAAE,6CAA6C;gBACv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OAAO;YACL,QAAQ,EAAE,kDAAkD;YAC5D,QAAQ,EAAE,sCAAsC;YAChD,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;IAEO,qBAAqB,CAAC,IAAY;QACxC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;QAClD,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxB,OAAO;gBACL,QAAQ,EAAE,gCAAgC;gBAC1C,QAAQ,EAAE,gCAAgC;gBAC1C,MAAM,EAAE,MAAM;aACf,CAAC;QACJ,CAAC;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAC9B,KAAK,CAAC,EAAE,CAAC,CAAC,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,CACpD,CAAC;QACF,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC1B,OAAO;gBACL,QAAQ,EAAE,gCAAgC;gBAC1C,QAAQ,EAAE,GAAG,UAAU,CAAC,MAAM,OAAO,MAAM,CAAC,MAAM,gCAAgC;gBAClF,MAAM,EAAE,SAAS;aAClB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,gCAAgC;YAC1C,QAAQ,EAAE,OAAO,MAAM,CAAC,MAAM,4BAA4B;YAC1D,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;CACF"}
@@ -3,6 +3,9 @@ export { TesterExpertise } from "./tester-expertise";
3
3
  export { SeoExpertise } from "./seo-expertise";
4
4
  export { SecurityExpertise } from "./security-expertise";
5
5
  export { PerformanceExpertise } from "./performance-expertise";
6
+ export { ContentExpertise } from "./content-expertise";
7
+ export { UiExpertise } from "./ui-expertise";
8
+ export { AccessibilityExpertise } from "./accessibility-expertise";
6
9
  export { NoopExpertise } from "./noop-expertise";
7
10
  import type { Expertise } from "./types";
8
11
  export declare function createDefaultExpertises(): Expertise[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expertise/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAOzC,wBAAgB,uBAAuB,IAAI,SAAS,EAAE,CAUrD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/expertise/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AASzC,wBAAgB,uBAAuB,IAAI,SAAS,EAAE,CAUrD"}
@@ -2,21 +2,26 @@ export { TesterExpertise } from "./tester-expertise";
2
2
  export { SeoExpertise } from "./seo-expertise";
3
3
  export { SecurityExpertise } from "./security-expertise";
4
4
  export { PerformanceExpertise } from "./performance-expertise";
5
+ export { ContentExpertise } from "./content-expertise";
6
+ export { UiExpertise } from "./ui-expertise";
7
+ export { AccessibilityExpertise } from "./accessibility-expertise";
5
8
  export { NoopExpertise } from "./noop-expertise";
6
9
  import { TesterExpertise } from "./tester-expertise";
7
10
  import { SeoExpertise } from "./seo-expertise";
8
11
  import { SecurityExpertise } from "./security-expertise";
9
12
  import { PerformanceExpertise } from "./performance-expertise";
10
- import { NoopExpertise } from "./noop-expertise";
13
+ import { ContentExpertise } from "./content-expertise";
14
+ import { UiExpertise } from "./ui-expertise";
15
+ import { AccessibilityExpertise } from "./accessibility-expertise";
11
16
  export function createDefaultExpertises() {
12
17
  return [
13
18
  new TesterExpertise(),
14
19
  new SeoExpertise(),
15
20
  new SecurityExpertise(),
16
21
  new PerformanceExpertise(),
17
- new NoopExpertise("content"),
18
- new NoopExpertise("ui"),
19
- new NoopExpertise("accessibility"),
22
+ new ContentExpertise(),
23
+ new UiExpertise(),
24
+ new AccessibilityExpertise(),
20
25
  ];
21
26
  }
22
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expertise/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,O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,MAAM,UAAU,uBAAuB;IACrC,OAAO;QACL,IAAI,eAAe,EAAE;QACrB,IAAI,YAAY,EAAE;QAClB,IAAI,iBAAiB,EAAE;QACvB,IAAI,oBAAoB,EAAE;QAC1B,IAAI,gBAAgB,EAAE;QACtB,IAAI,WAAW,EAAE;QACjB,IAAI,sBAAsB,EAAE;KAC7B,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { Expertise, ExpertiseContext, Outcome } from "./types";
2
+ export declare class UiExpertise implements Expertise {
3
+ name: string;
4
+ evaluate(context: ExpertiseContext): Outcome[];
5
+ private checkMainLandmark;
6
+ private checkScaffoldConsistency;
7
+ private checkActiveErrorPatterns;
8
+ private checkInteractiveDensity;
9
+ }
10
+ //# sourceMappingURL=ui-expertise.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ui-expertise.d.ts","sourceRoot":"","sources":["../../src/expertise/ui-expertise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEpE,qBAAa,WAAY,YAAW,SAAS;IAC3C,IAAI,SAAQ;IAEZ,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,EAAE;IAW9C,OAAO,CAAC,iBAAiB;IAkBzB,OAAO,CAAC,wBAAwB;IAmBhC,OAAO,CAAC,wBAAwB;IAoBhC,OAAO,CAAC,uBAAuB;CAqBhC"}
@@ -0,0 +1,76 @@
1
+ export class UiExpertise {
2
+ name = "ui";
3
+ evaluate(context) {
4
+ const outcomes = [];
5
+ outcomes.push(this.checkMainLandmark(context.html));
6
+ outcomes.push(this.checkScaffoldConsistency(context));
7
+ outcomes.push(this.checkActiveErrorPatterns(context));
8
+ outcomes.push(this.checkInteractiveDensity(context.html));
9
+ return outcomes;
10
+ }
11
+ checkMainLandmark(html) {
12
+ const hasMain = /<main\b/i.test(html) || /\brole=["']main["']/i.test(html);
13
+ if (!hasMain) {
14
+ return {
15
+ expected: "Page should expose a main content landmark",
16
+ observed: 'No <main> element or role="main" landmark detected',
17
+ result: "warning",
18
+ };
19
+ }
20
+ return {
21
+ expected: "Page should expose a main content landmark",
22
+ observed: "Main content landmark detected",
23
+ result: "pass",
24
+ };
25
+ }
26
+ checkScaffoldConsistency(context) {
27
+ const topMenus = context.scaffolds.filter(item => item.type === "topMenu");
28
+ const footers = context.scaffolds.filter(item => item.type === "footer");
29
+ if (topMenus.length > 1 || footers.length > 1) {
30
+ return {
31
+ expected: "Shared page scaffolds should not be duplicated",
32
+ observed: `Detected ${topMenus.length} top menu(s) and ${footers.length} footer(s)`,
33
+ result: "warning",
34
+ };
35
+ }
36
+ return {
37
+ expected: "Shared page scaffolds should not be duplicated",
38
+ observed: `Detected ${topMenus.length} top menu(s) and ${footers.length} footer(s)`,
39
+ result: "pass",
40
+ };
41
+ }
42
+ checkActiveErrorPatterns(context) {
43
+ const errorPattern = context.patterns.find(pattern => pattern.type === "errorMessage" || pattern.type === "alert");
44
+ if (errorPattern && errorPattern.count > 0) {
45
+ return {
46
+ expected: "Page should not load with visible error UI",
47
+ observed: `Detected ${errorPattern.count} ${errorPattern.type} pattern(s)`,
48
+ result: "warning",
49
+ };
50
+ }
51
+ return {
52
+ expected: "Page should not load with visible error UI",
53
+ observed: "No error or alert patterns detected on initial render",
54
+ result: "pass",
55
+ };
56
+ }
57
+ checkInteractiveDensity(html) {
58
+ const controls = (html.match(/<button\b/gi) ?? []).length +
59
+ (html.match(/<a\b[^>]*href=/gi) ?? []).length +
60
+ (html.match(/<input\b/gi) ?? []).length +
61
+ (html.match(/<select\b/gi) ?? []).length;
62
+ if (controls === 0) {
63
+ return {
64
+ expected: "Page should expose at least one interactive control",
65
+ observed: "No links, buttons, inputs, or selects were detected",
66
+ result: "warning",
67
+ };
68
+ }
69
+ return {
70
+ expected: "Page should expose at least one interactive control",
71
+ observed: `Detected ${controls} interactive control(s) in the HTML`,
72
+ result: "pass",
73
+ };
74
+ }
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CAAC,IAAI,EAAE,CAAC,CAAC,MAAM;YAC7C,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM;YACvC,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QAE3C,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO;gBACL,QAAQ,EAAE,qDAAqD;gBAC/D,QAAQ,EAAE,qDAAqD;gBAC/D,MAAM,EAAE,SAAS;aAClB,CAAC;QACJ,CAAC;QAED,OAAO;YACL,QAAQ,EAAE,qDAAqD;YAC/D,QAAQ,EAAE,YAAY,QAAQ,qCAAqC;YACnE,MAAM,EAAE,MAAM;SACf,CAAC;IACJ,CAAC;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"decomposition.d.ts","sourceRoot":"","sources":["../../src/orchestrator/decomposition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAY5D;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,wBAAwB,EAC7B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,EAAE,CAAC,CA4LnB"}
1
+ {"version":3,"file":"decomposition.d.ts","sourceRoot":"","sources":["../../src/orchestrator/decomposition.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAK/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAmP5D;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,GAAG,EAAE,wBAAwB,EAC7B,OAAO,EAAE,cAAc,EACvB,MAAM,EAAE,UAAU,EAClB,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,gBAAgB,GACvB,OAAO,CAAC,MAAM,EAAE,CAAC,CAmTnB"}