@reticlehq/server 2.2.0 → 2.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 (66) hide show
  1. package/dist/cli-parse.d.ts +19 -1
  2. package/dist/cli-parse.d.ts.map +1 -1
  3. package/dist/cli-parse.js +40 -2
  4. package/dist/cli-parse.js.map +1 -1
  5. package/dist/cli-verify.d.ts +2 -0
  6. package/dist/cli-verify.d.ts.map +1 -1
  7. package/dist/cli-verify.js +24 -2
  8. package/dist/cli-verify.js.map +1 -1
  9. package/dist/cli.d.ts +2 -3
  10. package/dist/cli.d.ts.map +1 -1
  11. package/dist/cli.js +94 -7
  12. package/dist/cli.js.map +1 -1
  13. package/dist/cloud/cloud-config.d.ts +37 -0
  14. package/dist/cloud/cloud-config.d.ts.map +1 -0
  15. package/dist/cloud/cloud-config.js +87 -0
  16. package/dist/cloud/cloud-config.js.map +1 -0
  17. package/dist/cloud/cloud-sync.d.ts +96 -3
  18. package/dist/cloud/cloud-sync.d.ts.map +1 -1
  19. package/dist/cloud/cloud-sync.js +131 -2
  20. package/dist/cloud/cloud-sync.js.map +1 -1
  21. package/dist/cloud-cli.d.ts +4 -0
  22. package/dist/cloud-cli.d.ts.map +1 -0
  23. package/dist/cloud-cli.js +507 -0
  24. package/dist/cloud-cli.js.map +1 -0
  25. package/dist/daemon.d.ts.map +1 -1
  26. package/dist/daemon.js +52 -7
  27. package/dist/daemon.js.map +1 -1
  28. package/dist/flows/flow-replay-run.d.ts.map +1 -1
  29. package/dist/flows/flow-replay-run.js +22 -5
  30. package/dist/flows/flow-replay-run.js.map +1 -1
  31. package/dist/flows/flow-tools.d.ts.map +1 -1
  32. package/dist/flows/flow-tools.js +24 -8
  33. package/dist/flows/flow-tools.js.map +1 -1
  34. package/dist/flows/server-verify.d.ts +16 -0
  35. package/dist/flows/server-verify.d.ts.map +1 -0
  36. package/dist/flows/server-verify.js +43 -0
  37. package/dist/flows/server-verify.js.map +1 -0
  38. package/dist/pool/playwright-launcher.d.ts +2 -0
  39. package/dist/pool/playwright-launcher.d.ts.map +1 -1
  40. package/dist/pool/playwright-launcher.js +13 -1
  41. package/dist/pool/playwright-launcher.js.map +1 -1
  42. package/dist/project/baselines.d.ts.map +1 -1
  43. package/dist/project/baselines.js +5 -3
  44. package/dist/project/baselines.js.map +1 -1
  45. package/dist/project/project-store.js +20 -8
  46. package/dist/project/project-store.js.map +1 -1
  47. package/dist/project/project-tools.d.ts.map +1 -1
  48. package/dist/project/project-tools.js +29 -6
  49. package/dist/project/project-tools.js.map +1 -1
  50. package/dist/runs/verification-sync.d.ts +24 -0
  51. package/dist/runs/verification-sync.d.ts.map +1 -0
  52. package/dist/runs/verification-sync.js +67 -0
  53. package/dist/runs/verification-sync.js.map +1 -0
  54. package/dist/telemetry/telemetry.d.ts +41 -0
  55. package/dist/telemetry/telemetry.d.ts.map +1 -0
  56. package/dist/telemetry/telemetry.js +220 -0
  57. package/dist/telemetry/telemetry.js.map +1 -0
  58. package/dist/tools/dynamic-tools.js +1 -1
  59. package/dist/tools/dynamic-tools.js.map +1 -1
  60. package/dist/tools/invoke-tool.d.ts.map +1 -1
  61. package/dist/tools/invoke-tool.js +4 -0
  62. package/dist/tools/invoke-tool.js.map +1 -1
  63. package/dist/update/update-checker.d.ts.map +1 -1
  64. package/dist/update/update-checker.js +26 -1
  65. package/dist/update/update-checker.js.map +1 -1
  66. package/package.json +2 -2
@@ -0,0 +1,37 @@
1
+ import type { FileSystemPort } from '../project/fs-port.js';
2
+ import { type CloudConfig } from './cloud-sync.js';
3
+ /** `<reticleRoot>/cloud.json` — the project's cloud binding + sync policy (non-secret). */
4
+ export declare const CLOUD_LINK_FILE = "cloud.json";
5
+ /** `~/.reticle/credentials.json` — the user's per-cloud-project API keys (the only secret). */
6
+ export declare const CREDENTIALS_FILE = "credentials.json";
7
+ /** What the daemon mirrors to the cloud for a project. Each surface is independently toggleable. */
8
+ export interface SyncPolicy {
9
+ /** Push verification-run artifacts to the dashboard Runs tab. */
10
+ runs: boolean;
11
+ /** Push per-flow project-memory outcomes (the regression history). */
12
+ memory: boolean;
13
+ /** Sync saved flow files (the shared regression suite). */
14
+ flows: boolean;
15
+ }
16
+ export declare const DEFAULT_SYNC_POLICY: SyncPolicy;
17
+ /** Where a verification actually executes. Reserved for the hosted-runner path; default local. */
18
+ export declare const VerifyMode: {
19
+ readonly LOCAL: "local";
20
+ readonly SERVER: "server";
21
+ };
22
+ export type VerifyMode = (typeof VerifyMode)[keyof typeof VerifyMode];
23
+ /** The resolved cloud picture for one project. `config === null` ⇒ cloud NOT attached (stay 100% local). */
24
+ export interface ProjectCloud {
25
+ config: CloudConfig | null;
26
+ policy: SyncPolicy;
27
+ verify: VerifyMode;
28
+ /** The cloud project id this project is linked to (for display/logging); null when env-fallback. */
29
+ projectId: string | null;
30
+ }
31
+ /**
32
+ * Resolve the cloud picture for a project rooted at `reticleRoot`. Reads the project's link file + the
33
+ * user credential store; if the project isn't linked (no cloud.json), falls back to the global env creds
34
+ * so the single-project / CI flow is unchanged. `homeDir` is injected (testable; `os.homedir()` at call).
35
+ */
36
+ export declare function resolveProjectCloud(fs: FileSystemPort, reticleRoot: string, homeDir: string, env: NodeJS.ProcessEnv): Promise<ProjectCloud>;
37
+ //# sourceMappingURL=cloud-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-config.d.ts","sourceRoot":"","sources":["../../src/cloud/cloud-config.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEvE,2FAA2F;AAC3F,eAAO,MAAM,eAAe,eAAe,CAAC;AAC5C,+FAA+F;AAC/F,eAAO,MAAM,gBAAgB,qBAAqB,CAAC;AAEnD,oGAAoG;AACpG,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,IAAI,EAAE,OAAO,CAAC;IACd,sEAAsE;IACtE,MAAM,EAAE,OAAO,CAAC;IAChB,2DAA2D;IAC3D,KAAK,EAAE,OAAO,CAAC;CAChB;AACD,eAAO,MAAM,mBAAmB,EAAE,UAAsD,CAAC;AAEzF,kGAAkG;AAClG,eAAO,MAAM,UAAU;;;CAAgD,CAAC;AACxE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC;AAEtE,4GAA4G;AAC5G,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,UAAU,CAAC;IACnB,MAAM,EAAE,UAAU,CAAC;IACnB,oGAAoG;IACpG,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAgDD;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,cAAc,EAClB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,CAAC,UAAU,GACrB,OAAO,CAAC,YAAY,CAAC,CAuBvB"}
@@ -0,0 +1,87 @@
1
+ /**
2
+ * Per-project cloud resolution for a SHARED daemon. One reticle MCP/daemon serves many projects; each
3
+ * project declares its own cloud binding + sync policy in `<root>/.reticle/cloud.json`, and the SECRET
4
+ * (the API key) lives once per user in `~/.reticle/credentials.json` (keyed by cloud project id) — never
5
+ * in the repo. The daemon resolves "is cloud attached for THIS project, and what should I push where?"
6
+ * from those two files, falling back to the global `RETICLE_CLOUD_*` env vars for the single-project /
7
+ * CI case (backward compatible).
8
+ *
9
+ * Vercel-style split: `.reticle/cloud.json` is the safe-to-commit-but-gitignored binding, the key is a
10
+ * user-level credential. "Cloud attached" = a valid link file AND a key for its project id (or env creds).
11
+ */
12
+ import { join } from 'node:path';
13
+ import { ReticleDir } from '@reticlehq/core';
14
+ import { resolveCloudConfig } from './cloud-sync.js';
15
+ /** `<reticleRoot>/cloud.json` — the project's cloud binding + sync policy (non-secret). */
16
+ export const CLOUD_LINK_FILE = 'cloud.json';
17
+ /** `~/.reticle/credentials.json` — the user's per-cloud-project API keys (the only secret). */
18
+ export const CREDENTIALS_FILE = 'credentials.json';
19
+ export const DEFAULT_SYNC_POLICY = { runs: true, memory: true, flows: true };
20
+ /** Where a verification actually executes. Reserved for the hosted-runner path; default local. */
21
+ export const VerifyMode = { LOCAL: 'local', SERVER: 'server' };
22
+ const asBool = (v, fallback) => (typeof v === 'boolean' ? v : fallback);
23
+ /** Read + JSON-parse a file, or null on any problem (missing/malformed) — never throws. */
24
+ async function readJson(fs, path) {
25
+ try {
26
+ if (!(await fs.exists(path)))
27
+ return null;
28
+ return JSON.parse(await fs.readFile(path));
29
+ }
30
+ catch {
31
+ return null;
32
+ }
33
+ }
34
+ /** Validate the shape of `.reticle/cloud.json`. Requires projectId + url; policy/verify default in. */
35
+ function parseLink(raw) {
36
+ if (typeof raw !== 'object' || raw === null)
37
+ return null;
38
+ const o = raw;
39
+ if (typeof o.projectId !== 'string' || o.projectId.length === 0)
40
+ return null;
41
+ if (typeof o.url !== 'string' || o.url.length === 0)
42
+ return null;
43
+ const sync = typeof o.sync === 'object' && o.sync !== null ? o.sync : {};
44
+ return {
45
+ projectId: o.projectId,
46
+ url: o.url,
47
+ sync: {
48
+ runs: asBool(sync.runs, DEFAULT_SYNC_POLICY.runs),
49
+ memory: asBool(sync.memory, DEFAULT_SYNC_POLICY.memory),
50
+ flows: asBool(sync.flows, DEFAULT_SYNC_POLICY.flows),
51
+ },
52
+ verify: o.verify === VerifyMode.SERVER ? VerifyMode.SERVER : VerifyMode.LOCAL,
53
+ };
54
+ }
55
+ /** Look up the API key for a cloud project id in the user credentials map. */
56
+ function credentialFor(raw, projectId) {
57
+ if (typeof raw !== 'object' || raw === null)
58
+ return null;
59
+ const key = raw[projectId];
60
+ return typeof key === 'string' && key.length > 0 ? key : null;
61
+ }
62
+ /**
63
+ * Resolve the cloud picture for a project rooted at `reticleRoot`. Reads the project's link file + the
64
+ * user credential store; if the project isn't linked (no cloud.json), falls back to the global env creds
65
+ * so the single-project / CI flow is unchanged. `homeDir` is injected (testable; `os.homedir()` at call).
66
+ */
67
+ export async function resolveProjectCloud(fs, reticleRoot, homeDir, env) {
68
+ const link = parseLink(await readJson(fs, join(reticleRoot, CLOUD_LINK_FILE)));
69
+ if (link === null) {
70
+ // No per-project link → the env vars are the whole story (legacy single-project / CI behaviour).
71
+ return {
72
+ config: resolveCloudConfig(env),
73
+ policy: DEFAULT_SYNC_POLICY,
74
+ verify: VerifyMode.LOCAL,
75
+ projectId: null,
76
+ };
77
+ }
78
+ const policy = {
79
+ runs: link.sync.runs ?? DEFAULT_SYNC_POLICY.runs,
80
+ memory: link.sync.memory ?? DEFAULT_SYNC_POLICY.memory,
81
+ flows: link.sync.flows ?? DEFAULT_SYNC_POLICY.flows,
82
+ };
83
+ const key = credentialFor(await readJson(fs, join(homeDir, ReticleDir.ROOT, CREDENTIALS_FILE)), link.projectId);
84
+ const config = key !== null ? { url: link.url.replace(/\/+$/, ''), apiKey: key } : null;
85
+ return { config, policy, verify: link.verify, projectId: link.projectId };
86
+ }
87
+ //# sourceMappingURL=cloud-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-config.js","sourceRoot":"","sources":["../../src/cloud/cloud-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,OAAO,EAAE,kBAAkB,EAAoB,MAAM,iBAAiB,CAAC;AAEvE,2FAA2F;AAC3F,MAAM,CAAC,MAAM,eAAe,GAAG,YAAY,CAAC;AAC5C,+FAA+F;AAC/F,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AAWnD,MAAM,CAAC,MAAM,mBAAmB,GAAe,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,E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AK;YACxB,SAAS,EAAE,IAAI;SAChB,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAe;QACzB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,mBAAmB,CAAC,IAAI;QAChD,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,IAAI,mBAAmB,CAAC,MAAM;QACtD,KAAK,EAAE,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,mBAAmB,CAAC,KAAK;KACpD,CAAC;IACF,MAAM,GAAG,GAAG,aAAa,CACvB,MAAM,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,EACpE,IAAI,CAAC,SAAS,CACf,CAAC;IACF,MAAM,MAAM,GACV,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,EAAE,CAAC;AAC5E,CAAC"}
@@ -8,14 +8,19 @@
8
8
  * Sync is best-effort: a network failure NEVER fails the local save. The flow is already on disk; the
9
9
  * cloud copy is an enhancement, so a push error is logged and swallowed.
10
10
  */
11
- import type { FlowFile } from '@reticlehq/core';
12
- /** Env var names — the presence of BOTH is what "logged in" means for flow sync. */
11
+ import { z } from 'zod';
12
+ import type { FlowFile, ReticleVerificationRun, RunRecord } from '@reticlehq/core';
13
+ /** Env var names — the presence of BOTH is what "logged in" means for cloud sync. */
13
14
  export declare const CloudEnv: {
14
15
  readonly URL: "RETICLE_CLOUD_URL";
15
16
  readonly KEY: "RETICLE_CLOUD_KEY";
16
17
  };
17
- /** Path the OSS server pushes a flow to (matches the cloud app's contract). */
18
+ /** Paths the OSS server pushes to (match the cloud app's contract). */
18
19
  export declare const CLOUD_FLOWS_PATH = "/v1/flows";
20
+ export declare const CLOUD_RUNS_PATH = "/v1/runs";
21
+ export declare const CLOUD_PROJECT_RUNS_PATH = "/v1/project/runs";
22
+ export declare const CLOUD_PROJECT_REGRESSION_PATH = "/v1/project/regression";
23
+ export declare const CLOUD_VERIFICATIONS_PATH = "/v1/verifications";
19
24
  export interface CloudConfig {
20
25
  url: string;
21
26
  apiKey: string;
@@ -42,9 +47,97 @@ export type FetchLike = (url: string, init: {
42
47
  ok: boolean;
43
48
  status: number;
44
49
  }>;
50
+ /** GET-shaped fetch (no body, reads back JSON), injected so the read is testable without a network. */
51
+ export type FetchGetLike = (url: string, init: {
52
+ method: string;
53
+ headers: Record<string, string>;
54
+ }) => Promise<{
55
+ ok: boolean;
56
+ status: number;
57
+ json: () => Promise<unknown>;
58
+ }>;
45
59
  /**
46
60
  * Push one flow to the cloud. `projectId` scopes it to this app. Returns a structured outcome; never
47
61
  * throws — a failure is reported, not propagated, so the local save is authoritative.
48
62
  */
49
63
  export declare function syncFlowToCloud(flow: FlowFile, config: CloudConfig | null, projectId: string | undefined, fetchImpl: FetchLike): Promise<SyncResult>;
64
+ /**
65
+ * Push one verification-run artifact to the cloud. This is what makes "runs recorded on the dashboard"
66
+ * real once a user shifts to the server: after `reticle verify` produces a run, it lands in the team's
67
+ * hosted history with its verdict. Same opt-in creds as flow sync — absent → no-op (stays local). The
68
+ * cloud's `POST /v1/runs` ingests the RAW artifact (validated by the same `@reticlehq/core` schema that
69
+ * built it), so the body is the run itself, not a wrapper. Best-effort: never throws, never blocks exit.
70
+ */
71
+ export declare function syncRunToCloud(run: ReticleVerificationRun, config: CloudConfig | null, fetchImpl: FetchLike): Promise<SyncResult>;
72
+ /**
73
+ * Push one project-memory RunRecord (a flow replay/verify outcome) to the cloud so the team's server-side
74
+ * regression history stays current: "did this development break a previously-passing flow?" is answered
75
+ * from these. Same opt-in creds as the others — absent → no-op (project.json stays the local source of
76
+ * truth). `projectId` scopes an org's multiple suites. Best-effort: never throws, never blocks the tool.
77
+ */
78
+ export declare function syncRunRecordToCloud(record: RunRecord, projectId: string | undefined, config: CloudConfig | null, fetchImpl: FetchLike): Promise<SyncResult>;
79
+ /**
80
+ * Read the team's server-side regression report back down to the agent. This is the half that makes the
81
+ * system "agent-friendly across context loss": a fresh agent (new session, CI box, teammate's machine)
82
+ * whose local .reticle/project.json is empty can still ask the ONE tool it knows — reticle_project — and
83
+ * get the durable cloud memory of what's broken vs before. Returns the raw report (shape owned by the
84
+ * cloud), or null when not logged in / unreachable — so the caller degrades to local-only, never fails.
85
+ */
86
+ export declare function fetchProjectRegressionFromCloud(config: CloudConfig | null, projectId: string | undefined, fetchImpl: FetchGetLike): Promise<unknown>;
87
+ /** POST-that-reads-JSON fetch shape (injected so the server-verify submit is testable without a network). */
88
+ export type FetchPostJsonLike = (url: string, init: {
89
+ method: string;
90
+ headers: Record<string, string>;
91
+ body: string;
92
+ }) => Promise<{
93
+ ok: boolean;
94
+ status: number;
95
+ json: () => Promise<unknown>;
96
+ }>;
97
+ /** The hosted runner's report, validated at the boundary (the full shape is owned by the cloud app). */
98
+ declare const ServerVerificationSchema: z.ZodObject<{
99
+ verificationId: z.ZodString;
100
+ verdict: z.ZodNullable<z.ZodString>;
101
+ flows: z.ZodArray<z.ZodObject<{
102
+ name: z.ZodString;
103
+ status: z.ZodString;
104
+ }, "strip", z.ZodTypeAny, {
105
+ status: string;
106
+ name: string;
107
+ }, {
108
+ status: string;
109
+ name: string;
110
+ }>, "many">;
111
+ summary: z.ZodString;
112
+ }, "strip", z.ZodTypeAny, {
113
+ verificationId: string;
114
+ verdict: string | null;
115
+ flows: {
116
+ status: string;
117
+ name: string;
118
+ }[];
119
+ summary: string;
120
+ }, {
121
+ verificationId: string;
122
+ verdict: string | null;
123
+ flows: {
124
+ status: string;
125
+ name: string;
126
+ }[];
127
+ summary: string;
128
+ }>;
129
+ export type ServerVerification = z.infer<typeof ServerVerificationSchema>;
130
+ /**
131
+ * Delegate a verification to the hosted runner: submit the preview URL + flow names to `POST
132
+ * /v1/verifications` and read back the report. This is the `verify: 'server'` half of the per-project
133
+ * config — the WORK runs on the server (real browser pool, later), not the local machine. The server
134
+ * records the verification itself, so there is no separate run-push. Returns null when not attached or the
135
+ * submit fails, so the caller falls back to a local replay. Never throws.
136
+ */
137
+ export declare function submitServerVerification(body: {
138
+ previewUrl: string;
139
+ flows: string[];
140
+ source: string;
141
+ }, config: CloudConfig | null, fetchImpl: FetchPostJsonLike): Promise<ServerVerification | null>;
142
+ export {};
50
143
  //# sourceMappingURL=cloud-sync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-sync.d.ts","sourceRoot":"","sources":["../../src/cloud/cloud-sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEhD,oFAAoF;AACpF,eAAO,MAAM,QAAQ;;;CAGX,CAAC;AAEX,+EAA+E;AAC/E,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,kGAAkG;AAClG,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,WAAW,GAAG,IAAI,CAM7E;AAED,eAAO,MAAM,WAAW;;;;CAId,CAAC;AACX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,OAAO,WAAW,CAAC,CAAC;AAEzE,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wFAAwF;AACxF,MAAM,MAAM,SAAS,GAAG,CACtB,GAAG,EAAE,M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here means the two cloud env vars are set (written by
3
+ * `reticle login` later; settable by hand today): the hosted URL and an API key from the Reticle Cloud
4
+ * dashboard. When present, a freshly-saved flow is pushed to `POST /v1/flows` so the team's regression
5
+ * suite lives in the cloud — surviving refactors and runnable in CI. When absent, sync is a no-op and
6
+ * everything stays 100% local (the "no phone-home" default: nothing leaves the machine unless you opt in).
7
+ *
8
+ * Sync is best-effort: a network failure NEVER fails the local save. The flow is already on disk; the
9
+ * cloud copy is an enhancement, so a push error is logged and swallowed.
10
+ */
11
+ import { z } from 'zod';
12
+ /** Env var names — the presence of BOTH is what "logged in" means for cloud sync. */
2
13
  export const CloudEnv = {
3
14
  URL: 'RETICLE_CLOUD_URL',
4
15
  KEY: 'RETICLE_CLOUD_KEY',
5
16
  };
6
- /** Path the OSS server pushes a flow to (matches the cloud app's contract). */
17
+ /** Paths the OSS server pushes to (match the cloud app's contract). */
7
18
  export const CLOUD_FLOWS_PATH = '/v1/flows';
19
+ export const CLOUD_RUNS_PATH = '/v1/runs';
20
+ export const CLOUD_PROJECT_RUNS_PATH = '/v1/project/runs';
21
+ export const CLOUD_PROJECT_REGRESSION_PATH = '/v1/project/regression';
22
+ export const CLOUD_VERIFICATIONS_PATH = '/v1/verifications';
8
23
  /** Resolve cloud credentials from the environment, or null when not logged in (sync disabled). */
9
24
  export function resolveCloudConfig(env) {
10
25
  const url = env[CloudEnv.URL];
@@ -44,4 +59,118 @@ export async function syncFlowToCloud(flow, config, projectId, fetchImpl) {
44
59
  return { outcome: SyncOutcome.FAILED, error: err instanceof Error ? err.message : String(err) };
45
60
  }
46
61
  }
62
+ /**
63
+ * Push one verification-run artifact to the cloud. This is what makes "runs recorded on the dashboard"
64
+ * real once a user shifts to the server: after `reticle verify` produces a run, it lands in the team's
65
+ * hosted history with its verdict. Same opt-in creds as flow sync — absent → no-op (stays local). The
66
+ * cloud's `POST /v1/runs` ingests the RAW artifact (validated by the same `@reticlehq/core` schema that
67
+ * built it), so the body is the run itself, not a wrapper. Best-effort: never throws, never blocks exit.
68
+ */
69
+ export async function syncRunToCloud(run, config, fetchImpl) {
70
+ if (config === null)
71
+ return { outcome: SyncOutcome.SKIPPED };
72
+ try {
73
+ const res = await fetchImpl(`${config.url}${CLOUD_RUNS_PATH}`, {
74
+ method: 'POST',
75
+ headers: {
76
+ 'content-type': 'application/json',
77
+ authorization: `Bearer ${config.apiKey}`,
78
+ },
79
+ body: JSON.stringify(run),
80
+ });
81
+ return res.ok
82
+ ? { outcome: SyncOutcome.SYNCED, status: res.status }
83
+ : { outcome: SyncOutcome.FAILED, status: res.status };
84
+ }
85
+ catch (err) {
86
+ return { outcome: SyncOutcome.FAILED, error: err instanceof Error ? err.message : String(err) };
87
+ }
88
+ }
89
+ /**
90
+ * Push one project-memory RunRecord (a flow replay/verify outcome) to the cloud so the team's server-side
91
+ * regression history stays current: "did this development break a previously-passing flow?" is answered
92
+ * from these. Same opt-in creds as the others — absent → no-op (project.json stays the local source of
93
+ * truth). `projectId` scopes an org's multiple suites. Best-effort: never throws, never blocks the tool.
94
+ */
95
+ export async function syncRunRecordToCloud(record, projectId, config, fetchImpl) {
96
+ if (config === null)
97
+ return { outcome: SyncOutcome.SKIPPED };
98
+ try {
99
+ const res = await fetchImpl(`${config.url}${CLOUD_PROJECT_RUNS_PATH}`, {
100
+ method: 'POST',
101
+ headers: {
102
+ 'content-type': 'application/json',
103
+ authorization: `Bearer ${config.apiKey}`,
104
+ },
105
+ body: JSON.stringify({
106
+ flowName: record.name,
107
+ status: record.status,
108
+ kind: record.kind,
109
+ summary: record.summary,
110
+ at: record.at,
111
+ ...(projectId === undefined ? {} : { projectId }),
112
+ }),
113
+ });
114
+ return res.ok
115
+ ? { outcome: SyncOutcome.SYNCED, status: res.status }
116
+ : { outcome: SyncOutcome.FAILED, status: res.status };
117
+ }
118
+ catch (err) {
119
+ return { outcome: SyncOutcome.FAILED, error: err instanceof Error ? err.message : String(err) };
120
+ }
121
+ }
122
+ /**
123
+ * Read the team's server-side regression report back down to the agent. This is the half that makes the
124
+ * system "agent-friendly across context loss": a fresh agent (new session, CI box, teammate's machine)
125
+ * whose local .reticle/project.json is empty can still ask the ONE tool it knows — reticle_project — and
126
+ * get the durable cloud memory of what's broken vs before. Returns the raw report (shape owned by the
127
+ * cloud), or null when not logged in / unreachable — so the caller degrades to local-only, never fails.
128
+ */
129
+ export async function fetchProjectRegressionFromCloud(config, projectId, fetchImpl) {
130
+ if (config === null)
131
+ return null;
132
+ try {
133
+ const query = projectId === undefined ? '' : `?projectId=${encodeURIComponent(projectId)}`;
134
+ const res = await fetchImpl(`${config.url}${CLOUD_PROJECT_REGRESSION_PATH}${query}`, {
135
+ method: 'GET',
136
+ headers: { authorization: `Bearer ${config.apiKey}` },
137
+ });
138
+ return res.ok ? await res.json() : null;
139
+ }
140
+ catch {
141
+ return null;
142
+ }
143
+ }
144
+ /** The hosted runner's report, validated at the boundary (the full shape is owned by the cloud app). */
145
+ const ServerVerificationSchema = z.object({
146
+ verificationId: z.string(),
147
+ verdict: z.string().nullable(),
148
+ flows: z.array(z.object({ name: z.string(), status: z.string() })),
149
+ summary: z.string(),
150
+ });
151
+ /**
152
+ * Delegate a verification to the hosted runner: submit the preview URL + flow names to `POST
153
+ * /v1/verifications` and read back the report. This is the `verify: 'server'` half of the per-project
154
+ * config — the WORK runs on the server (real browser pool, later), not the local machine. The server
155
+ * records the verification itself, so there is no separate run-push. Returns null when not attached or the
156
+ * submit fails, so the caller falls back to a local replay. Never throws.
157
+ */
158
+ export async function submitServerVerification(body, config, fetchImpl) {
159
+ if (config === null)
160
+ return null;
161
+ try {
162
+ const res = await fetchImpl(`${config.url}${CLOUD_VERIFICATIONS_PATH}`, {
163
+ method: 'POST',
164
+ headers: { 'content-type': 'application/json', authorization: `Bearer ${config.apiKey}` },
165
+ body: JSON.stringify(body),
166
+ });
167
+ if (!res.ok)
168
+ return null;
169
+ const parsed = ServerVerificationSchema.safeParse(await res.json());
170
+ return parsed.success ? parsed.data : null;
171
+ }
172
+ catch {
173
+ return null;
174
+ }
175
+ }
47
176
  //# sourceMappingURL=cloud-sync.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-sync.js","sourceRoot":"","sources":["../../src/cloud/cloud-sync.ts"],"names":[],"mappings":"AAYA,oFAAoF;AACpF,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,mBAAmB;CAChB,CAAC;AAEX,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;AAO5C,kGAAkG;AAClG,MAAM,UAAU,kBAAkB,CAAC,GAAsB;IACvD,MAAM,GAAG,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,MAAM,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;IACjC,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,GAAG,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC7D,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACnE,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;AAClD,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,QAAQ;CACR,CAAC;AAeX;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAc,EACd,MAA0B,EAC1B,SAA6B,EAC7B,SAAoB;IAEpB,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC;IAC7D,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,MAAM,CAAC,GAAG,G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,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;IAClE,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;CACpB,CAAC,CAAC;AAGH;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC5C,IAA6D,EAC7D,MAA0B,EAC1B,SAA4B;IAE5B,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACjC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,SAAS,CAAC,GAAG,MAAM,CAAC,GAAG,GAAG,wBAAwB,EAAE,EAAE;YACtE,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,aAAa,EAAE,UAAU,MAAM,CAAC,MAAM,EAAE,EAAE;YACzF,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;SAC3B,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,EAAE;YAAE,OAAO,IAAI,CAAC;QACzB,MAAM,MAAM,GAAG,wBAAwB,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;QACpE,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IAC7C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const isCloudCommand: (cmd: string | undefined) => boolean;
2
+ /** Dispatch a cloud subcommand. Returns the process exit code. */
3
+ export declare const runCloudCommand: (argv: readonly string[]) => Promise<number>;
4
+ //# sourceMappingURL=cloud-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-cli.d.ts","sourceRoot":"","sources":["../src/cloud-cli.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,GAAG,SAAS,KAAG,OACX,CAAC;AAif/C,kEAAkE;AAClE,eAAO,MAAM,eAAe,GAAU,MAAM,SAAS,MAAM,EAAE,KAAG,OAAO,CAAC,MAAM,CAgC7E,CAAC"}