@taodigital/agents 0.0.0-stage → 1.2.1

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 (76) hide show
  1. package/README.md +99 -2
  2. package/dist/api-test-agent.d.ts +126 -0
  3. package/dist/api-test-agent.js +267 -0
  4. package/dist/artifact-intel-agent.d.ts +11 -0
  5. package/dist/artifact-intel-agent.js +152 -0
  6. package/dist/coverage-gap-agent.d.ts +25 -0
  7. package/dist/coverage-gap-agent.js +269 -0
  8. package/dist/coverage-map-agent.d.ts +15 -0
  9. package/dist/coverage-map-agent.js +255 -0
  10. package/dist/crawl-diff-agent.d.ts +27 -0
  11. package/dist/crawl-diff-agent.js +412 -0
  12. package/dist/data-agent.d.ts +101 -0
  13. package/dist/data-agent.js +2284 -0
  14. package/dist/document-agent.d.ts +10 -0
  15. package/dist/document-agent.js +32 -0
  16. package/dist/enhancement-agent.d.ts +48 -0
  17. package/dist/enhancement-agent.js +342 -0
  18. package/dist/field-detector-agent.d.ts +35 -0
  19. package/dist/field-detector-agent.js +220 -0
  20. package/dist/flow-agent.d.ts +130 -0
  21. package/dist/flow-agent.js +169 -0
  22. package/dist/github-agent.d.ts +18 -0
  23. package/dist/github-agent.js +39 -0
  24. package/dist/github-write-agent.d.ts +67 -0
  25. package/dist/github-write-agent.js +249 -0
  26. package/dist/grouping-agent.d.ts +18 -0
  27. package/dist/grouping-agent.js +338 -0
  28. package/dist/healing-agent.d.ts +73 -0
  29. package/dist/healing-agent.js +137 -0
  30. package/dist/index.d.ts +36 -0
  31. package/dist/index.js +67 -0
  32. package/dist/integration-test-agent.d.ts +118 -0
  33. package/dist/integration-test-agent.js +165 -0
  34. package/dist/label-assignment-agent.d.ts +15 -0
  35. package/dist/label-assignment-agent.js +97 -0
  36. package/dist/llm-config.d.ts +38 -0
  37. package/dist/llm-config.js +287 -0
  38. package/dist/llm-mock.d.ts +77 -0
  39. package/dist/llm-mock.js +192 -0
  40. package/dist/llm.d.ts +58 -0
  41. package/dist/llm.js +438 -0
  42. package/dist/nlp-agent.d.ts +208 -0
  43. package/dist/nlp-agent.js +340 -0
  44. package/dist/orchestrator.d.ts +285 -0
  45. package/dist/orchestrator.js +141 -0
  46. package/dist/plan-agent.d.ts +4 -0
  47. package/dist/plan-agent.js +200 -0
  48. package/dist/repo-scan-agent.d.ts +189 -0
  49. package/dist/repo-scan-agent.js +2032 -0
  50. package/dist/requirements-agent.d.ts +59 -0
  51. package/dist/requirements-agent.js +641 -0
  52. package/dist/scenario-agent.d.ts +20 -0
  53. package/dist/scenario-agent.js +123 -0
  54. package/dist/script-agent.d.ts +447 -0
  55. package/dist/script-agent.js +11813 -0
  56. package/dist/security-test-agent.d.ts +111 -0
  57. package/dist/security-test-agent.js +141 -0
  58. package/dist/skill-file-agent.d.ts +264 -0
  59. package/dist/skill-file-agent.js +3470 -0
  60. package/dist/step-coverage.d.ts +46 -0
  61. package/dist/step-coverage.js +288 -0
  62. package/dist/step-utils.d.ts +2 -0
  63. package/dist/step-utils.js +62 -0
  64. package/dist/test-case-agent.d.ts +206 -0
  65. package/dist/test-case-agent.js +2141 -0
  66. package/dist/test-import-agent.d.ts +148 -0
  67. package/dist/test-import-agent.js +3235 -0
  68. package/dist/test-script-agent.d.ts +16 -0
  69. package/dist/test-script-agent.js +48 -0
  70. package/dist/token-pricing.d.ts +14 -0
  71. package/dist/token-pricing.js +62 -0
  72. package/dist/types.d.ts +232 -0
  73. package/dist/types.js +7 -0
  74. package/dist/visual-agent.d.ts +114 -0
  75. package/dist/visual-agent.js +261 -0
  76. package/package.json +26 -4
@@ -0,0 +1,148 @@
1
+ export interface ParsedTestCase {
2
+ ref?: string;
3
+ traceTo?: string;
4
+ caseRefs?: Array<Record<string, unknown>>;
5
+ title: string;
6
+ kind: string;
7
+ priority: string;
8
+ preconditions?: string;
9
+ steps: Array<{
10
+ stepId?: string;
11
+ action: string;
12
+ data?: string;
13
+ expected: string;
14
+ actualResult?: string;
15
+ comment?: string;
16
+ screenshotUrl?: string;
17
+ }>;
18
+ expectedResult: string;
19
+ actualResult?: string;
20
+ comment?: string;
21
+ screenshotUrl?: string;
22
+ status?: string;
23
+ gherkin?: string;
24
+ tags?: string[];
25
+ section?: string;
26
+ testDataInline?: Record<string, unknown>;
27
+ }
28
+ /**
29
+ * Maps QIP test-case fields → zero-based column indices in a spreadsheet.
30
+ * Any field may be undefined (= "not used").
31
+ */
32
+ export interface ColumnMapping {
33
+ title?: number;
34
+ ref?: number;
35
+ steps?: number;
36
+ expected?: number;
37
+ priority?: number;
38
+ kind?: number;
39
+ preconditions?: number;
40
+ data?: number;
41
+ tags?: number;
42
+ section?: number;
43
+ caseStart?: number;
44
+ actualResult?: number;
45
+ comment?: number;
46
+ stepId?: number;
47
+ screenshotUrl?: number;
48
+ status?: number;
49
+ }
50
+ export declare function parseTestCases(content: string, format: string, tenantId: string, mapping?: ColumnMapping, scenarioContext?: string[], filePath?: string, sourcePlatform?: string): Promise<{
51
+ cases: ParsedTestCase[];
52
+ errors: string[];
53
+ }>;
54
+ /** Stable 8-char hex key for a header set (order-independent). */
55
+ export declare function headerSignature(headers: string[]): string;
56
+ export interface InferMappingResult {
57
+ mapping: ColumnMapping;
58
+ source: 'ai' | 'saved' | 'heuristic';
59
+ signature: string;
60
+ headers: string[];
61
+ sampleRows: string[][];
62
+ }
63
+ /**
64
+ * Load or infer a column mapping for the given headers.
65
+ * Order: saved → AI inference → heuristic synonym fallback.
66
+ */
67
+ export declare function inferColumnMapping(headers: string[], sampleRows: string[][], tenantId: string): Promise<InferMappingResult>;
68
+ export declare function saveColumnMapping(tenantId: string, signature: string, mapping: ColumnMapping): Promise<void>;
69
+ export declare function loadColumnMapping(tenantId: string, signature: string): Promise<ColumnMapping | null>;
70
+ /**
71
+ * Coerce an untrusted (LLM- or client-supplied) object into a valid ParsedTestCase.
72
+ * Returns null when the object cannot represent a test case.
73
+ */
74
+ export declare function sanitizeParsedCase(tc: any): ParsedTestCase | null;
75
+ /**
76
+ * Extract headers and up to `maxSamples` data rows from the first sheet
77
+ * of a markdown-table artifact. Used by the /infer-mapping route.
78
+ */
79
+ export declare function extractTabularHeaders(content: string, maxSamples?: number): {
80
+ headers: string[];
81
+ sampleRows: string[][];
82
+ };
83
+ /** Stable cache key from a scenario context string — strips count hint, normalises. */
84
+ export declare function scenarioContextKey(ctx: string): string;
85
+ /**
86
+ * Cache-aware scenario test case generator.
87
+ * Returns cached cases for previously generated scenarios and only calls LLM for new ones.
88
+ * `existingCaseCache` is the `scenarioCases` map from `cachedScenarios` in DB.
89
+ * Returns merged cases + `updatedCache` to persist back.
90
+ */
91
+ export declare function parseTestCasesWithCache(content: string, tenantId: string, scenarioContext: string[], existingCaseCache: Record<string, ParsedTestCase[]>): Promise<{
92
+ cases: ParsedTestCase[];
93
+ errors: string[];
94
+ updatedCache: Record<string, ParsedTestCase[]>;
95
+ }>;
96
+ /**
97
+ * Standard JSON.parse, falling back to repairJsonStringLiterals() on failure
98
+ * (Passes 1+2 of tryParseJsonCases's 3-pass chain below). Exported so other
99
+ * routes that parse the same real-world-messy FZE JSON exports — e.g.
100
+ * packages/api/src/routes/functionize.ts, which previously did a bare
101
+ * JSON.parse with no fallback and would throw on the exact literal-newline/
102
+ * unescaped-quote files this repairs — don't need their own copy of this
103
+ * logic. Pass 3 (extractFzeRawPairs + parseFunctionizeCases) is intentionally
104
+ * NOT included here: it returns ParsedTestCase[], a different shape than
105
+ * functionize.ts's own per-key step decoder expects, so wiring it in would
106
+ * need a larger rewrite of that route's data flow — left as a follow-up.
107
+ * See docs/101-GAPS-FUNCTIONIZE-MIGRATION-PIPELINE.md §3.1.
108
+ */
109
+ export declare function parseJsonWithRepair(raw: string): any;
110
+ /**
111
+ * Line-based raw pair extractor — last-resort fallback for files with unescaped
112
+ * interior double-quotes inside code/conditional values (e.g. `"qa"` inside a
113
+ * string). Parses the FZE structure directly without relying on JSON.parse.
114
+ * Returns one Record<string,string> per JSON object found in the input.
115
+ */
116
+ export declare function extractFzeRawPairs(content: string): Record<string, string>[];
117
+ /**
118
+ * Detect Functionize / FZE recording format — a JSON array of flat key→value
119
+ * maps representing a recorded browser session. Matches on the most distinctive
120
+ * key patterns present across all known FZE file variants.
121
+ */
122
+ export declare function isFunctionizeFormat(arr: any[]): boolean;
123
+ export interface ScenarioSummary {
124
+ id: string;
125
+ title: string;
126
+ description: string;
127
+ sourceSection?: string;
128
+ requirementId?: string;
129
+ category?: string;
130
+ sourceExcerpt?: string;
131
+ suggestedTestCount: number;
132
+ }
133
+ export declare function extractGroundedScenarioCandidates(content: string): ScenarioSummary[];
134
+ export declare function extractScenarios(content: string, tenantId: string): Promise<{
135
+ scenarios: ScenarioSummary[];
136
+ errors: string[];
137
+ }>;
138
+ /**
139
+ * Parse a Selenium Python script and extract a map of action descriptions → Playwright locators.
140
+ * Used to annotate FZE test case steps with real locators from matched Selenium recordings.
141
+ */
142
+ export declare function buildSeleniumHints(pyContent: string): Map<string, string>;
143
+ /**
144
+ * Annotate parsed test case steps with Playwright locators from Selenium hints.
145
+ * Matches steps by normalized action text against the hint map.
146
+ * Adds locatorHint comment to matched steps.
147
+ */
148
+ export declare function annotateWithSeleniumHints(cases: ParsedTestCase[], hints: Map<string, string>): ParsedTestCase[];