@relayflows/core 0.0.1 → 1.0.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 (182) hide show
  1. package/dist/agent-handle.d.ts +27 -0
  2. package/dist/agent-handle.d.ts.map +1 -0
  3. package/dist/agent-handle.js +32 -0
  4. package/dist/agent-handle.js.map +1 -0
  5. package/dist/api-executor.d.ts +16 -0
  6. package/dist/api-executor.d.ts.map +1 -0
  7. package/dist/api-executor.js +94 -0
  8. package/dist/api-executor.js.map +1 -0
  9. package/dist/barrier.d.ts +72 -0
  10. package/dist/barrier.d.ts.map +1 -0
  11. package/dist/barrier.js +162 -0
  12. package/dist/barrier.js.map +1 -0
  13. package/dist/budget-tracker.d.ts +75 -0
  14. package/dist/budget-tracker.d.ts.map +1 -0
  15. package/dist/budget-tracker.js +184 -0
  16. package/dist/budget-tracker.js.map +1 -0
  17. package/dist/builder.d.ts +229 -0
  18. package/dist/builder.d.ts.map +1 -0
  19. package/dist/builder.js +430 -0
  20. package/dist/builder.js.map +1 -0
  21. package/dist/builtin-templates/bug-fix.yaml +139 -0
  22. package/dist/builtin-templates/code-review.yaml +137 -0
  23. package/dist/builtin-templates/competitive.yaml +107 -0
  24. package/dist/builtin-templates/documentation.yaml +128 -0
  25. package/dist/builtin-templates/feature-dev.yaml +146 -0
  26. package/dist/builtin-templates/refactor.yaml +145 -0
  27. package/dist/builtin-templates/review-loop.yaml +227 -0
  28. package/dist/builtin-templates/security-audit.yaml +139 -0
  29. package/dist/channel-messenger.d.ts +28 -0
  30. package/dist/channel-messenger.d.ts.map +1 -0
  31. package/dist/channel-messenger.js +275 -0
  32. package/dist/channel-messenger.js.map +1 -0
  33. package/dist/cli-registry.d.ts +77 -0
  34. package/dist/cli-registry.d.ts.map +1 -0
  35. package/dist/cli-registry.js +268 -0
  36. package/dist/cli-registry.js.map +1 -0
  37. package/dist/cli-session-collector.d.ts +39 -0
  38. package/dist/cli-session-collector.d.ts.map +1 -0
  39. package/dist/cli-session-collector.js +23 -0
  40. package/dist/cli-session-collector.js.map +1 -0
  41. package/dist/cli.d.ts +11 -0
  42. package/dist/cli.d.ts.map +1 -0
  43. package/dist/cli.js +395 -0
  44. package/dist/cli.js.map +1 -0
  45. package/dist/cloud-runner.d.ts +15 -0
  46. package/dist/cloud-runner.d.ts.map +1 -0
  47. package/dist/cloud-runner.js +41 -0
  48. package/dist/cloud-runner.js.map +1 -0
  49. package/dist/cloud-schedules.d.ts +3 -0
  50. package/dist/cloud-schedules.d.ts.map +1 -0
  51. package/dist/cloud-schedules.js +2 -0
  52. package/dist/cloud-schedules.js.map +1 -0
  53. package/dist/collectors/claude.d.ts +6 -0
  54. package/dist/collectors/claude.d.ts.map +1 -0
  55. package/dist/collectors/claude.js +330 -0
  56. package/dist/collectors/claude.js.map +1 -0
  57. package/dist/collectors/codex.d.ts +18 -0
  58. package/dist/collectors/codex.d.ts.map +1 -0
  59. package/dist/collectors/codex.js +265 -0
  60. package/dist/collectors/codex.js.map +1 -0
  61. package/dist/collectors/opencode.d.ts +6 -0
  62. package/dist/collectors/opencode.d.ts.map +1 -0
  63. package/dist/collectors/opencode.js +204 -0
  64. package/dist/collectors/opencode.js.map +1 -0
  65. package/dist/coordinator.d.ts +73 -0
  66. package/dist/coordinator.d.ts.map +1 -0
  67. package/dist/coordinator.js +647 -0
  68. package/dist/coordinator.js.map +1 -0
  69. package/dist/custom-steps.d.ts +73 -0
  70. package/dist/custom-steps.d.ts.map +1 -0
  71. package/dist/custom-steps.js +321 -0
  72. package/dist/custom-steps.js.map +1 -0
  73. package/dist/default-logger.d.ts +9 -0
  74. package/dist/default-logger.d.ts.map +1 -0
  75. package/dist/default-logger.js +104 -0
  76. package/dist/default-logger.js.map +1 -0
  77. package/dist/dry-run-format.d.ts +6 -0
  78. package/dist/dry-run-format.d.ts.map +1 -0
  79. package/dist/dry-run-format.js +79 -0
  80. package/dist/dry-run-format.js.map +1 -0
  81. package/dist/file-db.d.ts +85 -0
  82. package/dist/file-db.d.ts.map +1 -0
  83. package/dist/file-db.js +215 -0
  84. package/dist/file-db.js.map +1 -0
  85. package/dist/index.d.ts +37 -1
  86. package/dist/index.d.ts.map +1 -0
  87. package/dist/index.js +34 -3
  88. package/dist/index.js.map +1 -0
  89. package/dist/integrations/browser.d.ts +99 -0
  90. package/dist/integrations/browser.d.ts.map +1 -0
  91. package/dist/integrations/browser.js +419 -0
  92. package/dist/integrations/browser.js.map +1 -0
  93. package/dist/integrations/github.d.ts +79 -0
  94. package/dist/integrations/github.d.ts.map +1 -0
  95. package/dist/integrations/github.js +459 -0
  96. package/dist/integrations/github.js.map +1 -0
  97. package/dist/integrations/slack.d.ts +80 -0
  98. package/dist/integrations/slack.d.ts.map +1 -0
  99. package/dist/integrations/slack.js +355 -0
  100. package/dist/integrations/slack.js.map +1 -0
  101. package/dist/listr-renderer.d.ts +26 -0
  102. package/dist/listr-renderer.d.ts.map +1 -0
  103. package/dist/listr-renderer.js +230 -0
  104. package/dist/listr-renderer.js.map +1 -0
  105. package/dist/memory-db.d.ts +17 -0
  106. package/dist/memory-db.d.ts.map +1 -0
  107. package/dist/memory-db.js +33 -0
  108. package/dist/memory-db.js.map +1 -0
  109. package/dist/process-backend-executor.d.ts +18 -0
  110. package/dist/process-backend-executor.d.ts.map +1 -0
  111. package/dist/process-backend-executor.js +74 -0
  112. package/dist/process-backend-executor.js.map +1 -0
  113. package/dist/process-spawner.d.ts +35 -0
  114. package/dist/process-spawner.d.ts.map +1 -0
  115. package/dist/process-spawner.js +173 -0
  116. package/dist/process-spawner.js.map +1 -0
  117. package/dist/provisioner.d.ts +64 -0
  118. package/dist/provisioner.d.ts.map +1 -0
  119. package/dist/provisioner.js +269 -0
  120. package/dist/provisioner.js.map +1 -0
  121. package/dist/proxy-env.d.ts +52 -0
  122. package/dist/proxy-env.d.ts.map +1 -0
  123. package/dist/proxy-env.js +92 -0
  124. package/dist/proxy-env.js.map +1 -0
  125. package/dist/run-script.d.ts +82 -0
  126. package/dist/run-script.d.ts.map +1 -0
  127. package/dist/run-script.js +527 -0
  128. package/dist/run-script.js.map +1 -0
  129. package/dist/run-summary-table.d.ts +5 -0
  130. package/dist/run-summary-table.d.ts.map +1 -0
  131. package/dist/run-summary-table.js +132 -0
  132. package/dist/run-summary-table.js.map +1 -0
  133. package/dist/run.d.ts +45 -0
  134. package/dist/run.d.ts.map +1 -0
  135. package/dist/run.js +37 -0
  136. package/dist/run.js.map +1 -0
  137. package/dist/runner.d.ts +528 -0
  138. package/dist/runner.d.ts.map +1 -0
  139. package/dist/runner.js +6269 -0
  140. package/dist/runner.js.map +1 -0
  141. package/dist/schema.d.ts +275 -0
  142. package/dist/schema.d.ts.map +1 -0
  143. package/dist/schema.js +27 -0
  144. package/dist/schema.js.map +1 -0
  145. package/dist/schema.json +940 -0
  146. package/dist/sibling-links.d.ts +100 -0
  147. package/dist/sibling-links.d.ts.map +1 -0
  148. package/dist/sibling-links.js +205 -0
  149. package/dist/sibling-links.js.map +1 -0
  150. package/dist/state.d.ts +77 -0
  151. package/dist/state.d.ts.map +1 -0
  152. package/dist/state.js +140 -0
  153. package/dist/state.js.map +1 -0
  154. package/dist/step-executor.d.ts +95 -0
  155. package/dist/step-executor.d.ts.map +1 -0
  156. package/dist/step-executor.js +393 -0
  157. package/dist/step-executor.js.map +1 -0
  158. package/dist/template-resolver.d.ts +33 -0
  159. package/dist/template-resolver.d.ts.map +1 -0
  160. package/dist/template-resolver.js +144 -0
  161. package/dist/template-resolver.js.map +1 -0
  162. package/dist/templates.d.ts +47 -0
  163. package/dist/templates.d.ts.map +1 -0
  164. package/dist/templates.js +405 -0
  165. package/dist/templates.js.map +1 -0
  166. package/dist/trajectory.d.ts +87 -0
  167. package/dist/trajectory.d.ts.map +1 -0
  168. package/dist/trajectory.js +412 -0
  169. package/dist/trajectory.js.map +1 -0
  170. package/dist/types.d.ts +471 -0
  171. package/dist/types.d.ts.map +1 -0
  172. package/dist/types.js +37 -0
  173. package/dist/types.js.map +1 -0
  174. package/dist/validator.d.ts +11 -0
  175. package/dist/validator.d.ts.map +1 -0
  176. package/dist/validator.js +186 -0
  177. package/dist/validator.js.map +1 -0
  178. package/dist/verification.d.ts +53 -0
  179. package/dist/verification.d.ts.map +1 -0
  180. package/dist/verification.js +238 -0
  181. package/dist/verification.js.map +1 -0
  182. package/package.json +12 -8
@@ -0,0 +1,79 @@
1
+ /**
2
+ * Format a DryRunReport as human-readable text for terminal output.
3
+ */
4
+ export function formatDryRunReport(report) {
5
+ const lines = [];
6
+ // Header
7
+ lines.push(`Dry Run: ${report.name}`);
8
+ const meta = [`Pattern: ${report.pattern}`];
9
+ if (report.maxConcurrency !== undefined) {
10
+ meta.push(`Max Concurrency: ${report.maxConcurrency}`);
11
+ }
12
+ lines.push(meta.join(' | '));
13
+ if (report.description) {
14
+ lines.push(report.description);
15
+ }
16
+ lines.push('');
17
+ // Agents
18
+ if (report.agents.length > 0) {
19
+ lines.push(`Agents (${report.agents.length}):`);
20
+ const maxNameLen = Math.max(...report.agents.map((a) => a.name.length));
21
+ const maxCliLen = Math.max(...report.agents.map((a) => a.cli.length));
22
+ for (const agent of report.agents) {
23
+ const stepLabel = agent.stepCount === 1 ? '1 step' : `${agent.stepCount} steps`;
24
+ const cwdInfo = agent.cwd ? ` [cwd: ${agent.cwd}]` : '';
25
+ lines.push(` ${agent.name.padEnd(maxNameLen)} ${agent.cli.padEnd(maxCliLen)} ${stepLabel}${cwdInfo}`);
26
+ }
27
+ lines.push('');
28
+ }
29
+ // Permissions
30
+ if (report.permissions && report.permissions.length > 0) {
31
+ lines.push(`Permissions (${report.permissions.length} agents):`);
32
+ for (const perm of report.permissions) {
33
+ lines.push(` ${perm.agent}: ${perm.access} (read: ${perm.readPaths}, write: ${perm.writePaths}, deny: ${perm.denyPaths}, scopes: ${perm.scopes}) [${perm.source}]`);
34
+ }
35
+ lines.push('');
36
+ }
37
+ // Execution Plan
38
+ if (report.waves.length > 0) {
39
+ lines.push(`Execution Plan (${report.totalSteps} steps, ${report.estimatedWaves} waves):`);
40
+ lines.push('');
41
+ for (const wave of report.waves) {
42
+ for (let i = 0; i < wave.steps.length; i++) {
43
+ const step = wave.steps[i];
44
+ const prefix = i === 0 ? ` Wave ${String(wave.wave).padStart(2)}:` : ' ';
45
+ // Steps without an agent are deterministic (shell/gate) steps; label
46
+ // them as such rather than printing the literal "undefined".
47
+ const actor = step.agent ?? 'deterministic';
48
+ lines.push(`${prefix} ${step.name} (${actor})`);
49
+ }
50
+ }
51
+ lines.push('');
52
+ }
53
+ // Resource estimation
54
+ if (report.estimatedPeakConcurrency !== undefined) {
55
+ lines.push(`Resource Estimate:`);
56
+ lines.push(` Peak Concurrency: ${report.estimatedPeakConcurrency} agents`);
57
+ if (report.estimatedTotalAgentSteps !== undefined) {
58
+ lines.push(` Total Agent Steps: ${report.estimatedTotalAgentSteps}`);
59
+ }
60
+ lines.push('');
61
+ }
62
+ // Validation summary
63
+ if (report.errors.length > 0) {
64
+ lines.push(`Validation: FAIL (${report.errors.length} errors, ${report.warnings.length} warnings)`);
65
+ for (const err of report.errors) {
66
+ lines.push(` ERROR: ${err}`);
67
+ }
68
+ }
69
+ else {
70
+ lines.push(`Validation: PASS (0 errors, ${report.warnings.length} warnings)`);
71
+ }
72
+ if (report.warnings.length > 0) {
73
+ for (const warn of report.warnings) {
74
+ lines.push(` WARNING: ${warn}`);
75
+ }
76
+ }
77
+ return lines.join('\n');
78
+ }
79
+ //# sourceMappingURL=dry-run-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dry-run-format.js","sourceRoot":"","sources":["../src/dry-run-format.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAoB;IACrD,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,SAAS;IACT,KAAK,CAAC,IAAI,CAAC,YAAY,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC;IACtC,MAAM,IAAI,GAAa,CAAC,YAAY,MAAM,CAAC,O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AC,IAAI,CAAC,+BAA+B,MAAM,CAAC,QAAQ,CAAC,MAAM,YAAY,CAAC,CAAC;IAChF,CAAC;IAED,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACnC,KAAK,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,85 @@
1
+ import type { WorkflowRunRow, WorkflowStepRow } from './types.js';
2
+ import type { WorkflowDb } from './runner.js';
3
+ /**
4
+ * Optional hook: fired whenever a persistence write fails (e.g. EACCES,
5
+ * ENOSPC). Surfaced so the CLI, dashboard, or bootstrap can decide how
6
+ * to react beyond the single console.warn. Not called for the initial
7
+ * "directory unwritable" detection — that's stored in {@link isWritable}.
8
+ */
9
+ export type DbWriteFailureListener = (err: unknown, filePath: string) => void;
10
+ export interface JsonFileWorkflowDbOptions {
11
+ /** Override the resolved filePath. Kept for tests / advanced callers. */
12
+ filePath?: string;
13
+ /** Notified on every underlying write error. */
14
+ onWriteFailure?: DbWriteFailureListener;
15
+ /**
16
+ * When true, if the preferred file path is unwritable, fall back to
17
+ * `$HOME/.agent-relay/workflow-runs-<basename>.jsonl` so `--resume`
18
+ * still works in environments where the workflow cwd is read-only
19
+ * (cloud sandboxes with restrictive workspace ACLs).
20
+ *
21
+ * Defaults to `false` — strict "write to this path or run in-memory"
22
+ * semantics, matching the pre-cache behavior. Opt-in via `true`.
23
+ */
24
+ homeFallback?: boolean;
25
+ }
26
+ /**
27
+ * JSONL-backed WorkflowDb for the CLI.
28
+ *
29
+ * Design: the **in-memory cache is the single source of truth** for the
30
+ * process lifetime. Every mutation updates the cache synchronously and
31
+ * then best-effort appends to the jsonl file for durability / `--resume`.
32
+ *
33
+ * This matters because the runtime correctness of a running workflow
34
+ * must not depend on disk writes succeeding. If the storage path is
35
+ * unwritable (ACL-restricted workspace, full disk, ENOSPC), the workflow
36
+ * still progresses through its state machine correctly — we just lose
37
+ * the ability to resume a future process from that run.
38
+ *
39
+ * Read paths used to re-snapshot the jsonl on every call, which meant
40
+ * a failed `updateRun(..., { status: 'completed' })` would leave a
41
+ * subsequent `getRun` returning the stale 'running' row from disk.
42
+ * That bug surfaced as workflows passing per-step but reporting
43
+ * `status: 'running'` to callers.
44
+ *
45
+ * Storage path resolution:
46
+ * 1. Try the caller-supplied file path. If the parent directory is
47
+ * writable, use it.
48
+ * 2. If (1) fails and `homeFallback` is true (opt-in, default false),
49
+ * try `$HOME/.agent-relay/workflow-runs-<basename>.jsonl`. This is
50
+ * outside any workspace mount in cloud sandboxes and almost always
51
+ * writable by the agent.
52
+ * 3. If both fail, run in memory-only mode. The workflow still
53
+ * executes correctly; `--resume` won't be available for this run.
54
+ *
55
+ * File: `.agent-relay/workflow-runs.jsonl` in the workflow cwd by default.
56
+ */
57
+ export declare class JsonFileWorkflowDb implements WorkflowDb {
58
+ private readonly filePath;
59
+ /** Whether persistence is active. False = in-memory-only mode. */
60
+ private readonly writable;
61
+ private appendFailedOnce;
62
+ private readonly onWriteFailure?;
63
+ /**
64
+ * Authoritative in-memory mirror. Every mutation updates this; reads
65
+ * return from here. The jsonl file is only consulted at construction
66
+ * (to replay prior state for `--resume`) and is otherwise write-only.
67
+ */
68
+ private readonly cache;
69
+ constructor(filePathOrOptions: string | JsonFileWorkflowDbOptions);
70
+ /** Returns false if persistence is not active (in-memory-only mode). */
71
+ isWritable(): boolean;
72
+ /** Resolved path on disk. For tests + diagnostics. */
73
+ getStoragePath(): string;
74
+ hasStepOutputs(runId: string): boolean;
75
+ private static resolveStoragePath;
76
+ private static loadSnapshot;
77
+ private append;
78
+ insertRun(run: WorkflowRunRow): Promise<void>;
79
+ updateRun(id: string, patch: Partial<WorkflowRunRow>): Promise<void>;
80
+ getRun(id: string): Promise<WorkflowRunRow | null>;
81
+ insertStep(step: WorkflowStepRow): Promise<void>;
82
+ updateStep(id: string, patch: Partial<WorkflowStepRow>): Promise<void>;
83
+ getStepsByRunId(runId: string): Promise<WorkflowStepRow[]>;
84
+ }
85
+ //# sourceMappingURL=file-db.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-db.d.ts","sourceRoot":"","sources":["../src/file-db.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAClE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAI9C;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;AAE9E,MAAM,WAAW,yBAAyB;IACxC,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gDAAgD;IAChD,cAAc,CAAC,EAAE,sBAAsB,CAAC;IACxC;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAAa,kBAAmB,YAAW,UAAU;IACnD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAS;IAElC,kEAAkE;IAClE,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAU;IACnC,OAAO,CAAC,gBAAgB,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAyB;IAEzD;;;;OAIG;IACH,OAAO,CAAC,QAAQ,CAAC,KAAK,CAGpB;gBAEU,iBAAiB,EAAE,MAAM,GAAG,yBAAyB;IAiBjE,wEAAwE;IACxE,UAAU,IAAI,OAAO;IAIrB,sDAAsD;IACtD,cAAc,IAAI,MAAM;IAIxB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAWtC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IA8CjC,OAAO,CAAC,MAAM,CAAC,YAAY;IA6B3B,OAAO,CAAC,MAAM;IAuBR,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAY7C,SAAS,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAYpE,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,GAAG,IAAI,CAAC;IAIlD,UAAU,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC;IAMhD,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAYtE,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAGjE"}
@@ -0,0 +1,215 @@
1
+ import { accessSync, appendFileSync, constants as fsConstants, existsSync, mkdirSync, readdirSync, readFileSync, } from 'node:fs';
2
+ import os from 'node:os';
3
+ import path from 'node:path';
4
+ /**
5
+ * JSONL-backed WorkflowDb for the CLI.
6
+ *
7
+ * Design: the **in-memory cache is the single source of truth** for the
8
+ * process lifetime. Every mutation updates the cache synchronously and
9
+ * then best-effort appends to the jsonl file for durability / `--resume`.
10
+ *
11
+ * This matters because the runtime correctness of a running workflow
12
+ * must not depend on disk writes succeeding. If the storage path is
13
+ * unwritable (ACL-restricted workspace, full disk, ENOSPC), the workflow
14
+ * still progresses through its state machine correctly — we just lose
15
+ * the ability to resume a future process from that run.
16
+ *
17
+ * Read paths used to re-snapshot the jsonl on every call, which meant
18
+ * a failed `updateRun(..., { status: 'completed' })` would leave a
19
+ * subsequent `getRun` returning the stale 'running' row from disk.
20
+ * That bug surfaced as workflows passing per-step but reporting
21
+ * `status: 'running'` to callers.
22
+ *
23
+ * Storage path resolution:
24
+ * 1. Try the caller-supplied file path. If the parent directory is
25
+ * writable, use it.
26
+ * 2. If (1) fails and `homeFallback` is true (opt-in, default false),
27
+ * try `$HOME/.agent-relay/workflow-runs-<basename>.jsonl`. This is
28
+ * outside any workspace mount in cloud sandboxes and almost always
29
+ * writable by the agent.
30
+ * 3. If both fail, run in memory-only mode. The workflow still
31
+ * executes correctly; `--resume` won't be available for this run.
32
+ *
33
+ * File: `.agent-relay/workflow-runs.jsonl` in the workflow cwd by default.
34
+ */
35
+ export class JsonFileWorkflowDb {
36
+ filePath;
37
+ /** Whether persistence is active. False = in-memory-only mode. */
38
+ writable;
39
+ appendFailedOnce = false;
40
+ onWriteFailure;
41
+ /**
42
+ * Authoritative in-memory mirror. Every mutation updates this; reads
43
+ * return from here. The jsonl file is only consulted at construction
44
+ * (to replay prior state for `--resume`) and is otherwise write-only.
45
+ */
46
+ cache;
47
+ constructor(filePathOrOptions) {
48
+ const options = typeof filePathOrOptions === 'string' ? { filePath: filePathOrOptions } : filePathOrOptions;
49
+ this.onWriteFailure = options.onWriteFailure;
50
+ const requestedPath = options.filePath ?? path.join('.agent-relay', 'workflow-runs.jsonl');
51
+ const homeFallback = options.homeFallback ?? false;
52
+ const { resolvedPath, writable } = JsonFileWorkflowDb.resolveStoragePath(requestedPath, homeFallback);
53
+ this.filePath = resolvedPath;
54
+ this.writable = writable;
55
+ // Load existing state from disk (for --resume) once at construction.
56
+ // From this point on, the cache is authoritative.
57
+ this.cache = JsonFileWorkflowDb.loadSnapshot(this.filePath);
58
+ }
59
+ /** Returns false if persistence is not active (in-memory-only mode). */
60
+ isWritable() {
61
+ return this.writable;
62
+ }
63
+ /** Resolved path on disk. For tests + diagnostics. */
64
+ getStoragePath() {
65
+ return this.filePath;
66
+ }
67
+ hasStepOutputs(runId) {
68
+ try {
69
+ const dir = path.join(path.dirname(this.filePath), 'step-outputs', runId);
70
+ return existsSync(dir) && readdirSync(dir).length > 0;
71
+ }
72
+ catch {
73
+ return false;
74
+ }
75
+ }
76
+ // ── Private helpers ─────────────────────────────────────────────────────
77
+ static resolveStoragePath(requestedPath, homeFallback) {
78
+ const candidates = [requestedPath];
79
+ if (homeFallback) {
80
+ const base = path.basename(requestedPath) || 'workflow-runs.jsonl';
81
+ candidates.push(path.join(os.homedir(), '.agent-relay', `workflow-runs-${base}`));
82
+ }
83
+ for (let i = 0; i < candidates.length; i++) {
84
+ const candidate = candidates[i];
85
+ const isLastCandidate = i === candidates.length - 1;
86
+ try {
87
+ mkdirSync(path.dirname(candidate), { recursive: true });
88
+ // If there's a later fallback to try, actively probe writability
89
+ // so we know whether to move on. Two levels matter:
90
+ // 1. Directory must be writable to create the jsonl file.
91
+ // 2. If the jsonl file already exists, IT must also be writable
92
+ // — a writable directory does not guarantee a writable file.
93
+ // Relayfile-mount, for example, can sync a file and chmod it
94
+ // to 0o444 while leaving the parent dir at 0o755; the old
95
+ // dir-only check would accept the path and every append would
96
+ // then lazy-fail, bypassing the fallback.
97
+ // If this is already the last candidate, skip the probe and be
98
+ // optimistic — an unwritable path will surface as a lazy append()
99
+ // failure handled by the cache + onWriteFailure path. Matches the
100
+ // pre-cache "warn on first failure" semantic callers expect.
101
+ if (!isLastCandidate) {
102
+ accessSync(path.dirname(candidate), fsConstants.W_OK);
103
+ if (existsSync(candidate)) {
104
+ accessSync(candidate, fsConstants.W_OK);
105
+ }
106
+ }
107
+ return { resolvedPath: candidate, writable: true };
108
+ }
109
+ catch {
110
+ // Try the next candidate; if this was the last, fall through
111
+ // to memory-only.
112
+ }
113
+ }
114
+ // Memory-only mode. Path is reported for diagnostics but nothing
115
+ // is written to it.
116
+ return { resolvedPath: requestedPath, writable: false };
117
+ }
118
+ static loadSnapshot(filePath) {
119
+ const runs = new Map();
120
+ const steps = new Map();
121
+ let raw = '';
122
+ try {
123
+ raw = readFileSync(filePath, 'utf8');
124
+ }
125
+ catch {
126
+ return { runs, steps };
127
+ }
128
+ for (const line of raw.split('\n')) {
129
+ const trimmed = line.trim();
130
+ if (!trimmed)
131
+ continue;
132
+ try {
133
+ const entry = JSON.parse(trimmed);
134
+ if (entry.kind === 'run') {
135
+ runs.set(entry.row.id, entry.row);
136
+ }
137
+ else {
138
+ steps.set(entry.row.id, entry.row);
139
+ }
140
+ }
141
+ catch {
142
+ // Skip malformed lines
143
+ }
144
+ }
145
+ return { runs, steps };
146
+ }
147
+ append(entry) {
148
+ if (!this.writable)
149
+ return;
150
+ try {
151
+ appendFileSync(this.filePath, JSON.stringify(entry) + '\n', 'utf8');
152
+ }
153
+ catch (err) {
154
+ // Notify every failure so callers can aggregate / surface.
155
+ this.onWriteFailure?.(err, this.filePath);
156
+ // Warn to console once per process — subsequent failures are noise.
157
+ if (!this.appendFailedOnce) {
158
+ this.appendFailedOnce = true;
159
+ console.warn('[workflow] warning: failed to write run state to ' +
160
+ this.filePath +
161
+ ' — --resume will not be available for this run. Use --start-from instead. ' +
162
+ 'Error: ' +
163
+ (err instanceof Error ? err.message : String(err)));
164
+ }
165
+ }
166
+ }
167
+ // ── WorkflowDb interface ─────────────────────────────────────────────────
168
+ async insertRun(run) {
169
+ // Shallow-copy so later mutations on the caller's object don't silently
170
+ // alias into the cache. Matches InMemoryWorkflowDb semantics. The runner
171
+ // keeps inserted rows in its own stepStates map and occasionally mutates
172
+ // state.row.status directly before calling updateRun — without this copy
173
+ // the mutation would land in the cache and bypass updateRun's
174
+ // updatedAt + append path, causing exactly the observability hazard this
175
+ // cache is meant to prevent.
176
+ this.cache.runs.set(run.id, { ...run });
177
+ this.append({ kind: 'run', row: run });
178
+ }
179
+ async updateRun(id, patch) {
180
+ const existing = this.cache.runs.get(id);
181
+ if (!existing)
182
+ return;
183
+ const updated = {
184
+ ...existing,
185
+ ...patch,
186
+ updatedAt: new Date().toISOString(),
187
+ };
188
+ this.cache.runs.set(id, updated);
189
+ this.append({ kind: 'run', row: updated });
190
+ }
191
+ async getRun(id) {
192
+ return this.cache.runs.get(id) ?? null;
193
+ }
194
+ async insertStep(step) {
195
+ // Shallow-copy to prevent caller-mutation aliasing — see insertRun.
196
+ this.cache.steps.set(step.id, { ...step });
197
+ this.append({ kind: 'step', row: step });
198
+ }
199
+ async updateStep(id, patch) {
200
+ const existing = this.cache.steps.get(id);
201
+ if (!existing)
202
+ return;
203
+ const updated = {
204
+ ...existing,
205
+ ...patch,
206
+ updatedAt: new Date().toISOString(),
207
+ };
208
+ this.cache.steps.set(id, updated);
209
+ this.append({ kind: 'step', row: updated });
210
+ }
211
+ async getStepsByRunId(runId) {
212
+ return Array.from(this.cache.steps.values()).filter((s) => s.runId === runId);
213
+ }
214
+ }
215
+ //# sourceMappingURL=file-db.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-db.js","sourceRoot":"","sources":["../src/file-db.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,cAAc,EACd,SAAS,IAAI,WAAW,EACxB,UAAU,EACV,SAAS,EACT,WAAW,EACX,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAgC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,OAAO,kBAAkB;IACZ,QAAQ,CAAS;IAElC,kEAAkE;IACjD,QAAQ,CAAU;IAC3B,gBAAgB,GAAG,KAAK,CAAC;IAChB,cAAc,CAA0B;IAEzD;;;;OAIG;IACc,KAAK,CAGpB;IAEF,YAAY,iBAAqD;QAC/D,MAAM,OAAO,GACX,OAAO,iBAAiB,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,iBAAiB,CAAC;QAC9F,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAE7C,MAAM,aAAa,GAAG,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,qBAAqB,CAAC,CAAC;QAC3F,MAAM,YAAY,GAAG,OAAO,CAAC,Y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';
4
+ export * from './cli-session-collector.js';
5
+ export * from './channel-messenger.js';
6
+ export * from './process-spawner.js';
7
+ export { createProcessBackendExecutor, type ProcessBackendExecutorOptions, } from './process-backend-executor.js';
8
+ export * from './run-summary-table.js';
9
+ export * from './template-resolver.js';
10
+ export * from './verification.js';
11
+ export { StepExecutor,
12
+ /** @deprecated Use {@link StepExecutor} instead. */
13
+ StepExecutor as WorkflowStepLifecycleExecutor, type StepExecutorDeps, type StepResult, type StepSchedule, } from './step-executor.js';
14
+ export { Models, ClaudeModels, CodexModels, GeminiModels, CursorModels, CLIs, CLIVersions, CLIRegistry, SwarmPatterns, } from '@agent-relay/config';
15
+ export * from './memory-db.js';
16
+ export * from './file-db.js';
17
+ export * from './run.js';
18
+ export * from './cloud-schedules.js';
19
+ export * from './builder.js';
20
+ export * from './coordinator.js';
21
+ export * from './barrier.js';
22
+ export * from './state.js';
23
+ export * from './templates.js';
24
+ export { WorkflowTrajectory, type StepOutcome } from './trajectory.js';
25
+ export { formatDryRunReport } from './dry-run-format.js';
26
+ export { createWorkflowRenderer, type WorkflowRenderer } from './listr-renderer.js';
27
+ export { createDefaultEventLogger } from './default-logger.js';
28
+ export { executeApiStep, type ApiExecutorOptions } from './api-executor.js';
29
+ export type { CloudRunOptions } from './cloud-runner.js';
30
+ export * from './proxy-env.js';
31
+ export * from './budget-tracker.js';
32
+ export * from './provisioner.js';
33
+ export { applySiblingLinks, buildSiblingLinkScript } from './sibling-links.js';
34
+ export type { SiblingLink, SiblingLinkOptions } from './sibling-links.js';
35
+ export { runScriptWorkflow, parseTsxStderr, formatWorkflowParseError, findLocalSdkWorkspace, ensureLocalSdkWorkflowRuntime, } from './run-script.js';
36
+ export type { RunScriptWorkflowOptions, ParsedWorkflowError, LocalSdkWorkspace, ExecFileSyncLike, } from './run-script.js';
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAC/E,YAAY,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,wBAAwB,EACxB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,iBAAiB,CAAC"}
package/dist/index.js CHANGED
@@ -1,3 +1,34 @@
1
- // Placeholder for @relayflows/core v0.0.1 — npm namespace reservation.
2
- // Use 0.1.0+ for the real workflow engine; this version exports nothing.
3
- export {};
1
+ export * from './types.js';
2
+ export * from './runner.js';
3
+ export * from './custom-steps.js';
4
+ export * from './cli-session-collector.js';
5
+ export * from './channel-messenger.js';
6
+ export * from './process-spawner.js';
7
+ export { createProcessBackendExecutor, } from './process-backend-executor.js';
8
+ export * from './run-summary-table.js';
9
+ export * from './template-resolver.js';
10
+ export * from './verification.js';
11
+ export { StepExecutor,
12
+ /** @deprecated Use {@link StepExecutor} instead. */
13
+ StepExecutor as WorkflowStepLifecycleExecutor, } from './step-executor.js';
14
+ export { Models, ClaudeModels, CodexModels, GeminiModels, CursorModels, CLIs, CLIVersions, CLIRegistry, SwarmPatterns, } from '@agent-relay/config';
15
+ export * from './memory-db.js';
16
+ export * from './file-db.js';
17
+ export * from './run.js';
18
+ export * from './cloud-schedules.js';
19
+ export * from './builder.js';
20
+ export * from './coordinator.js';
21
+ export * from './barrier.js';
22
+ export * from './state.js';
23
+ export * from './templates.js';
24
+ export { WorkflowTrajectory } from './trajectory.js';
25
+ export { formatDryRunReport } from './dry-run-format.js';
26
+ export { createWorkflowRenderer } from './listr-renderer.js';
27
+ export { createDefaultEventLogger } from './default-logger.js';
28
+ export { executeApiStep } from './api-executor.js';
29
+ export * from './proxy-env.js';
30
+ export * from './budget-tracker.js';
31
+ export * from './provisioner.js';
32
+ export { applySiblingLinks, buildSiblingLinkScript } from './sibling-links.js';
33
+ export { runScriptWorkflow, parseTsxStderr, formatWorkflowParseError, findLocalSdkWorkspace, ensureLocalSdkWorkflowRuntime, } from './run-script.js';
34
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,4BAA4B,GAE7B,MAAM,+BAA+B,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EACL,YAAY;AACZ,oDAAoD;AACpD,YAAY,IAAI,6BAA6B,GAI9C,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,MAAM,EACN,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,WAAW,EACX,aAAa,GACd,MAAM,qBAAqB,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAyB,MAAM,qBAAqB,CAAC;AACpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAC/D,OAAO,EAAE,cAAc,EAA2B,MAAM,mBAAmB,CAAC;AAE5E,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAE/E,OAAO,EACL,iBAAiB,EACjB,cAAc,EACd,wBAAwB,EACxB,qBAAqB,EACrB,6BAA6B,GAC9B,MAAM,iBAAiB,CAAC"}
@@ -0,0 +1,99 @@
1
+ import type { RunnerStepExecutor, WorkflowStep } from '../types.js';
2
+ import { BrowserClient, type BrowserClientOptions } from '@relayflows/browser-primitive';
3
+ import type { ActionResult, BrowserActionName, BrowserActionParamsMap, BrowserConfig, BrowserSession } from '@relayflows/browser-primitive';
4
+ export type BrowserStepOutputMode = 'last' | 'all' | 'captures' | 'summary' | 'none';
5
+ export type BrowserStepOutputFormat = 'json' | 'text';
6
+ export type BrowserStepAction<TName extends BrowserActionName = BrowserActionName> = {
7
+ [Name in TName]: {
8
+ action: Name;
9
+ params: BrowserActionParamsMap[Name];
10
+ /** Stable key for captured output. Defaults to the zero-based action index. */
11
+ id?: string;
12
+ /** Include this action in output.mode = "captures". Defaults true for extraction actions. */
13
+ capture?: boolean;
14
+ /** Output object key when output.mode = "captures". Defaults to id or action_<index>. */
15
+ outputKey?: string;
16
+ /** Continue running later actions if this action fails. Defaults false. */
17
+ continueOnError?: boolean;
18
+ };
19
+ }[TName];
20
+ export interface BrowserStepOutputConfig {
21
+ /** Which action results become the workflow step output. Defaults to "last". */
22
+ mode?: BrowserStepOutputMode;
23
+ /** Emit JSON for structured chaining or text for simple downstream interpolation. Defaults to "json". */
24
+ format?: BrowserStepOutputFormat;
25
+ /** Include per-action metadata such as current URL and timing in JSON output. Defaults false. */
26
+ includeMetadata?: boolean;
27
+ /** Include final browser session state in JSON output. Defaults false. */
28
+ includeSession?: boolean;
29
+ /** Pretty-print JSON output. Defaults false. */
30
+ pretty?: boolean;
31
+ }
32
+ export interface BrowserStepConfig {
33
+ /** Unique step name within the workflow. */
34
+ name: string;
35
+ /** Dependencies in the Relay workflow DAG. */
36
+ dependsOn?: string[];
37
+ /** Browser settings for this step/session. */
38
+ config?: BrowserConfig;
39
+ /** Ordered browser actions to execute in one browser session. */
40
+ actions: BrowserStepAction[];
41
+ /** Controls the string captured as {{steps.<name>.output}}. */
42
+ output?: BrowserStepOutputConfig;
43
+ /** Reuse a named browser session across browser steps. Defaults to the workspace/config session. */
44
+ sessionId?: string;
45
+ /** Close the session after this step, even when persistSession is true. */
46
+ closeSession?: boolean;
47
+ /** Workflow step timeout in milliseconds. */
48
+ timeoutMs?: number;
49
+ /** Number of retry attempts when the workflow runner retries this integration step. */
50
+ retries?: number;
51
+ }
52
+ export interface BrowserStepExecutionContext {
53
+ workspaceId?: string;
54
+ sessionId?: string;
55
+ client?: BrowserClient;
56
+ }
57
+ export interface BrowserStepActionRecord<TOutput = unknown> {
58
+ index: number;
59
+ id?: string;
60
+ action: BrowserActionName;
61
+ success: boolean;
62
+ output?: TOutput;
63
+ error?: string;
64
+ metadata?: ActionResult['metadata'];
65
+ }
66
+ export interface BrowserStepExecutionResult {
67
+ success: boolean;
68
+ output: string;
69
+ results: BrowserStepActionRecord[];
70
+ session: BrowserSession;
71
+ error?: string;
72
+ }
73
+ export interface BrowserIntegrationStepResult {
74
+ output: string;
75
+ success: boolean;
76
+ }
77
+ /**
78
+ * Create a Relay integration step that can be used in relay.yaml or passed to
79
+ * WorkflowRunner directly. Complex action/config objects are serialized into
80
+ * params so the existing workflow template resolver can interpolate them.
81
+ */
82
+ export declare function createBrowserStep(config: BrowserStepConfig): WorkflowStep;
83
+ export declare class BrowserStepExecutor implements RunnerStepExecutor {
84
+ private readonly options;
85
+ private readonly sessions;
86
+ constructor(options?: BrowserClientOptions);
87
+ executeAgentStep(): Promise<string>;
88
+ execute(config: BrowserStepConfig, context?: BrowserStepExecutionContext): Promise<BrowserStepExecutionResult>;
89
+ executeIntegrationStep(step: WorkflowStep, resolvedParams: Record<string, string>, context?: {
90
+ workspaceId?: string;
91
+ }): Promise<BrowserIntegrationStepResult>;
92
+ closeSession(sessionId: string): Promise<boolean>;
93
+ closeAll(): Promise<void>;
94
+ listSessions(): BrowserSession[];
95
+ private getOrCreateClient;
96
+ private resolveSessionKey;
97
+ }
98
+ export declare function browserStepConfigFromWorkflowStep(step: WorkflowStep, resolvedParams: Record<string, string>): BrowserStepConfig;
99
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/integrations/browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEpE,OAAO,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACzF,OAAO,KAAK,EACV,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EAEtB,aAAa,EACb,cAAc,EACf,MAAM,+BAA+B,CAAC;AAEvC,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,KAAK,GAAG,UAAU,GAAG,SAAS,GAAG,MAAM,CAAC;AACrF,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,MAAM,CAAC;AAEtD,MAAM,MAAM,iBAAiB,CAAC,KAAK,SAAS,iBAAiB,GAAG,iBAAiB,IAAI;KAClF,IAAI,IAAI,KAAK,GAAG;QACf,MAAM,EAAE,IAAI,CAAC;QACb,MAAM,EAAE,sBAAsB,CAAC,IAAI,CAAC,CAAC;QACrC,+EAA+E;QAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;QACZ,6FAA6F;QAC7F,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,yFAAyF;QACzF,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,2EAA2E;QAC3E,eA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