@xera-ai/web 0.1.5 → 0.1.7

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/core/src/adapter/types.d.ts +69 -0
  2. package/dist/core/src/artifact/hash.d.ts +3 -0
  3. package/dist/core/src/artifact/meta.d.ts +45 -0
  4. package/dist/core/src/artifact/paths.d.ts +24 -0
  5. package/dist/core/src/artifact/status.d.ts +95 -0
  6. package/dist/core/src/auth/encrypt.d.ts +3 -0
  7. package/dist/core/src/auth/key.d.ts +2 -0
  8. package/dist/core/src/auth/refresh.d.ts +8 -0
  9. package/dist/core/src/auth/state.d.ts +23 -0
  10. package/dist/core/src/config/define.d.ts +2 -0
  11. package/dist/core/src/config/load.d.ts +2 -0
  12. package/dist/core/src/config/schema.d.ts +325 -0
  13. package/dist/core/src/index.d.ts +19 -0
  14. package/dist/core/src/jira/client.d.ts +10 -0
  15. package/dist/core/src/jira/fields.d.ts +6 -0
  16. package/dist/core/src/jira/mcp-backend.d.ts +2 -0
  17. package/dist/core/src/jira/rest-backend.d.ts +7 -0
  18. package/dist/core/src/jira/retry.d.ts +7 -0
  19. package/dist/core/src/jira/types.d.ts +28 -0
  20. package/dist/core/src/lock/file-lock.d.ts +11 -0
  21. package/dist/core/src/logging/ndjson-logger.d.ts +10 -0
  22. package/dist/index.js +91 -32
  23. package/dist/web/src/generator/typecheck.d.ts +10 -0
  24. package/dist/{trace-normalizer → web/src/trace-normalizer}/scrub-rules.d.ts +4 -0
  25. package/package.json +1 -1
  26. package/src/adapter.ts +16 -5
  27. package/src/auth-setup/playwright-state.ts +1 -1
  28. package/src/auth-setup/runner.ts +1 -1
  29. package/src/executor/index.ts +4 -1
  30. package/src/generator/lint.ts +2 -2
  31. package/src/generator/pom-scan.ts +1 -1
  32. package/src/generator/promote.ts +4 -2
  33. package/src/generator/selector-rules.ts +18 -3
  34. package/src/generator/typecheck.ts +44 -4
  35. package/src/trace-normalizer/normalize.ts +20 -7
  36. package/src/trace-normalizer/parse.ts +36 -11
  37. package/src/trace-normalizer/scrub-rules.ts +11 -2
  38. package/src/trace-normalizer/scrub.ts +6 -3
  39. package/src/trace-normalizer/unzip.ts +6 -1
  40. package/dist/generator/typecheck.d.ts +0 -5
  41. /package/dist/{adapter.d.ts → web/src/adapter.d.ts} +0 -0
  42. /package/dist/{auth-setup → web/src/auth-setup}/define.d.ts +0 -0
  43. /package/dist/{auth-setup → web/src/auth-setup}/playwright-state.d.ts +0 -0
  44. /package/dist/{auth-setup → web/src/auth-setup}/runner.d.ts +0 -0
  45. /package/dist/{executor → web/src/executor}/index.d.ts +0 -0
  46. /package/dist/{executor → web/src/executor}/playwright-args.d.ts +0 -0
  47. /package/dist/{generator → web/src/generator}/gherkin-validate.d.ts +0 -0
  48. /package/dist/{generator → web/src/generator}/lint.d.ts +0 -0
  49. /package/dist/{generator → web/src/generator}/pom-scan.d.ts +0 -0
  50. /package/dist/{generator → web/src/generator}/promote.d.ts +0 -0
  51. /package/dist/{generator → web/src/generator}/selector-rules.d.ts +0 -0
  52. /package/dist/{index.d.ts → web/src/index.d.ts} +0 -0
  53. /package/dist/{trace-normalizer → web/src/trace-normalizer}/normalize.d.ts +0 -0
  54. /package/dist/{trace-normalizer → web/src/trace-normalizer}/parse.d.ts +0 -0
  55. /package/dist/{trace-normalizer → web/src/trace-normalizer}/scrub.d.ts +0 -0
  56. /package/dist/{trace-normalizer → web/src/trace-normalizer}/unzip.d.ts +0 -0
@@ -24,9 +24,14 @@ export const SENSITIVE_BODY_KEYS: readonly RegExp[] = [
24
24
 
25
25
  export const JWT_RE = /\beyJ[A-Za-z0-9_-]{7,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{5,}\b/;
26
26
  export const CREDIT_CARD_RE = /\b(?:\d{4}[-\s]?){3}\d{4}\b/;
27
+ export const EMAIL_RE = /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/;
28
+ // E.164-ish phone with optional + and separators. Conservative: require at least 7 digits.
29
+ export const PHONE_RE = /(?:\+?\d[\d\s().-]{6,}\d)/;
27
30
 
28
31
  const JWT_RE_G = new RegExp(JWT_RE.source, 'g');
29
32
  const CREDIT_CARD_RE_G = new RegExp(CREDIT_CARD_RE.source, 'g');
33
+ export const EMAIL_RE_G = new RegExp(EMAIL_RE.source, 'g');
34
+ export const PHONE_RE_G = new RegExp(PHONE_RE.source, 'g');
30
35
 
31
36
  const REDACTED = '[REDACTED]';
32
37
 
@@ -43,7 +48,7 @@ export function scrubBodyJson(body: unknown): unknown {
43
48
  if (body && typeof body === 'object') {
44
49
  const out: Record<string, unknown> = {};
45
50
  for (const [k, v] of Object.entries(body)) {
46
- if (SENSITIVE_BODY_KEYS.some(re => re.test(k))) {
51
+ if (SENSITIVE_BODY_KEYS.some((re) => re.test(k))) {
47
52
  out[k] = REDACTED;
48
53
  } else {
49
54
  out[k] = scrubBodyJson(v);
@@ -56,5 +61,9 @@ export function scrubBodyJson(body: unknown): unknown {
56
61
  }
57
62
 
58
63
  export function scrubFreeText(s: string): string {
59
- return s.replace(JWT_RE_G, REDACTED).replace(CREDIT_CARD_RE_G, REDACTED);
64
+ return s
65
+ .replace(JWT_RE_G, REDACTED)
66
+ .replace(CREDIT_CARD_RE_G, REDACTED)
67
+ .replace(EMAIL_RE_G, REDACTED)
68
+ .replace(PHONE_RE_G, REDACTED);
60
69
  }
@@ -1,4 +1,4 @@
1
- import { scrubHeaders, scrubBodyJson, scrubFreeText } from './scrub-rules';
1
+ import { scrubBodyJson, scrubFreeText, scrubHeaders } from './scrub-rules';
2
2
 
3
3
  export interface NormalizedNetworkEntry {
4
4
  method: string;
@@ -38,7 +38,10 @@ function countScrubbed(before: unknown, after: unknown): number {
38
38
  if (before && after && typeof before === 'object' && typeof after === 'object') {
39
39
  let n = 0;
40
40
  for (const k of Object.keys(before as Record<string, unknown>)) {
41
- n += countScrubbed((before as Record<string, unknown>)[k], (after as Record<string, unknown>)[k]);
41
+ n += countScrubbed(
42
+ (before as Record<string, unknown>)[k],
43
+ (after as Record<string, unknown>)[k],
44
+ );
42
45
  }
43
46
  return n;
44
47
  }
@@ -65,7 +68,7 @@ export function scrub(run: NormalizedRun): NormalizedRun {
65
68
  );
66
69
  }
67
70
  if (f.networkAtFailure) {
68
- newF.networkAtFailure = f.networkAtFailure.map(n => {
71
+ newF.networkAtFailure = f.networkAtFailure.map((n) => {
69
72
  const reqHeaders = n.requestHeaders ? scrubHeaders(n.requestHeaders) : undefined;
70
73
  const resHeaders = n.responseHeaders ? scrubHeaders(n.responseHeaders) : undefined;
71
74
  const reqBody = n.requestBody !== undefined ? scrubBodyJson(n.requestBody) : undefined;
@@ -12,7 +12,12 @@ export function unzipTrace(tracePath: string): TraceEntries {
12
12
  const files: Record<string, string> = {};
13
13
  for (const [name, data] of Object.entries(entries)) {
14
14
  if (name.endsWith('/')) continue;
15
- if (name.endsWith('.network') || name.endsWith('.trace') || name.endsWith('.txt') || name.endsWith('.json')) {
15
+ if (
16
+ name.endsWith('.network') ||
17
+ name.endsWith('.trace') ||
18
+ name.endsWith('.txt') ||
19
+ name.endsWith('.json')
20
+ ) {
16
21
  files[name] = new TextDecoder().decode(data);
17
22
  }
18
23
  }
@@ -1,5 +0,0 @@
1
- export interface TypecheckResult {
2
- ok: boolean;
3
- errors: string[];
4
- }
5
- export declare function typecheckTicket(ticketDir: string): Promise<TypecheckResult>;
File without changes
File without changes
File without changes
File without changes