@relayflows/sdk 2.0.30 → 2.0.32

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 (347) hide show
  1. package/dist/agent-artifacts.d.ts.map +1 -1
  2. package/dist/agent-artifacts.js +2 -9
  3. package/dist/agent-artifacts.js.map +1 -1
  4. package/dist/agent-cwd.d.ts +69 -0
  5. package/dist/agent-cwd.d.ts.map +1 -0
  6. package/dist/agent-cwd.js +140 -0
  7. package/dist/agent-cwd.js.map +1 -0
  8. package/dist/artifact-scan-policy.d.ts +35 -0
  9. package/dist/artifact-scan-policy.d.ts.map +1 -0
  10. package/dist/artifact-scan-policy.js +49 -0
  11. package/dist/artifact-scan-policy.js.map +1 -0
  12. package/dist/authored-completion-record.d.ts +35 -0
  13. package/dist/authored-completion-record.d.ts.map +1 -0
  14. package/dist/authored-completion-record.js +92 -0
  15. package/dist/authored-completion-record.js.map +1 -0
  16. package/dist/authored-completion.d.ts +99 -0
  17. package/dist/authored-completion.d.ts.map +1 -0
  18. package/dist/authored-completion.js +184 -0
  19. package/dist/authored-completion.js.map +1 -0
  20. package/dist/authored-flow-error.d.ts +13 -1
  21. package/dist/authored-flow-error.d.ts.map +1 -1
  22. package/dist/authored-flow-error.js +12 -0
  23. package/dist/authored-flow-error.js.map +1 -1
  24. package/dist/authored-flow-executor.d.ts +7 -30
  25. package/dist/authored-flow-executor.d.ts.map +1 -1
  26. package/dist/authored-flow-executor.js +54 -47
  27. package/dist/authored-flow-executor.js.map +1 -1
  28. package/dist/authored-human.d.ts.map +1 -1
  29. package/dist/authored-human.js +1 -3
  30. package/dist/authored-human.js.map +1 -1
  31. package/dist/authored-node-entry.js +4 -1
  32. package/dist/authored-node-entry.js.map +1 -1
  33. package/dist/authored-node-runner.d.ts +9 -1
  34. package/dist/authored-node-runner.d.ts.map +1 -1
  35. package/dist/authored-node-runner.js +92 -17
  36. package/dist/authored-node-runner.js.map +1 -1
  37. package/dist/authored-preflight.d.ts +4 -0
  38. package/dist/authored-preflight.d.ts.map +1 -0
  39. package/dist/authored-preflight.js +50 -0
  40. package/dist/authored-preflight.js.map +1 -0
  41. package/dist/authored-root.d.ts +5 -0
  42. package/dist/authored-root.d.ts.map +1 -1
  43. package/dist/authored-root.js +20 -2
  44. package/dist/authored-root.js.map +1 -1
  45. package/dist/authored-step-output.d.ts +35 -10
  46. package/dist/authored-step-output.d.ts.map +1 -1
  47. package/dist/authored-step-output.js +108 -40
  48. package/dist/authored-step-output.js.map +1 -1
  49. package/dist/authored-verdict.d.ts +28 -0
  50. package/dist/authored-verdict.d.ts.map +1 -0
  51. package/dist/authored-verdict.js +79 -0
  52. package/dist/authored-verdict.js.map +1 -0
  53. package/dist/authored-worker-step.d.ts +5 -2
  54. package/dist/authored-worker-step.d.ts.map +1 -1
  55. package/dist/authored-worker-step.js +51 -13
  56. package/dist/authored-worker-step.js.map +1 -1
  57. package/dist/cli/check-worker-surface.d.ts +27 -0
  58. package/dist/cli/check-worker-surface.d.ts.map +1 -0
  59. package/dist/cli/check-worker-surface.js +63 -0
  60. package/dist/cli/check-worker-surface.js.map +1 -0
  61. package/dist/cli/check.d.ts +28 -3
  62. package/dist/cli/check.d.ts.map +1 -1
  63. package/dist/cli/check.js +27 -140
  64. package/dist/cli/check.js.map +1 -1
  65. package/dist/cli/cli-probe.d.ts +20 -0
  66. package/dist/cli/cli-probe.d.ts.map +1 -0
  67. package/dist/cli/cli-probe.js +166 -0
  68. package/dist/cli/cli-probe.js.map +1 -0
  69. package/dist/cli/cloud-format.d.ts +9 -0
  70. package/dist/cli/cloud-format.d.ts.map +1 -0
  71. package/dist/cli/cloud-format.js +77 -0
  72. package/dist/cli/cloud-format.js.map +1 -0
  73. package/dist/cli/cloud-live.d.ts +39 -0
  74. package/dist/cli/cloud-live.d.ts.map +1 -0
  75. package/dist/cli/cloud-live.js +325 -0
  76. package/dist/cli/cloud-live.js.map +1 -0
  77. package/dist/cli/cloud-mirror-session.d.ts +97 -0
  78. package/dist/cli/cloud-mirror-session.d.ts.map +1 -0
  79. package/dist/cli/cloud-mirror-session.js +264 -0
  80. package/dist/cli/cloud-mirror-session.js.map +1 -0
  81. package/dist/cli/cloud-read.d.ts +3 -7
  82. package/dist/cli/cloud-read.d.ts.map +1 -1
  83. package/dist/cli/cloud-read.js +14 -266
  84. package/dist/cli/cloud-read.js.map +1 -1
  85. package/dist/cli/cloud-refusal.d.ts +39 -0
  86. package/dist/cli/cloud-refusal.d.ts.map +1 -0
  87. package/dist/cli/cloud-refusal.js +95 -0
  88. package/dist/cli/cloud-refusal.js.map +1 -0
  89. package/dist/cli/cloud-status-view.d.ts +7 -0
  90. package/dist/cli/cloud-status-view.d.ts.map +1 -0
  91. package/dist/cli/cloud-status-view.js +214 -0
  92. package/dist/cli/cloud-status-view.js.map +1 -0
  93. package/dist/cli/direct-run.d.ts.map +1 -1
  94. package/dist/cli/direct-run.js +16 -2
  95. package/dist/cli/direct-run.js.map +1 -1
  96. package/dist/cli/hn-monitor.d.ts +0 -13
  97. package/dist/cli/hn-monitor.d.ts.map +1 -1
  98. package/dist/cli/hn-monitor.js +2 -1
  99. package/dist/cli/hn-monitor.js.map +1 -1
  100. package/dist/cli/local-agent-remedy.d.ts +80 -0
  101. package/dist/cli/local-agent-remedy.d.ts.map +1 -0
  102. package/dist/cli/local-agent-remedy.js +116 -0
  103. package/dist/cli/local-agent-remedy.js.map +1 -0
  104. package/dist/cli/observer-session.d.ts +41 -0
  105. package/dist/cli/observer-session.d.ts.map +1 -0
  106. package/dist/cli/observer-session.js +78 -0
  107. package/dist/cli/observer-session.js.map +1 -0
  108. package/dist/cli/run.d.ts +30 -2
  109. package/dist/cli/run.d.ts.map +1 -1
  110. package/dist/cli/run.js +186 -24
  111. package/dist/cli/run.js.map +1 -1
  112. package/dist/cli/status.d.ts +9 -0
  113. package/dist/cli/status.d.ts.map +1 -1
  114. package/dist/cli/status.js +31 -2
  115. package/dist/cli/status.js.map +1 -1
  116. package/dist/cli/step-evidence.d.ts +90 -0
  117. package/dist/cli/step-evidence.d.ts.map +1 -0
  118. package/dist/cli/step-evidence.js +259 -0
  119. package/dist/cli/step-evidence.js.map +1 -0
  120. package/dist/cli/step-failure.d.ts +14 -4
  121. package/dist/cli/step-failure.d.ts.map +1 -1
  122. package/dist/cli/step-failure.js +41 -76
  123. package/dist/cli/step-failure.js.map +1 -1
  124. package/dist/cli-commands.d.ts +12 -0
  125. package/dist/cli-commands.d.ts.map +1 -1
  126. package/dist/cli-commands.js +3 -0
  127. package/dist/cli-commands.js.map +1 -1
  128. package/dist/cli.d.ts +17 -0
  129. package/dist/cli.d.ts.map +1 -1
  130. package/dist/cli.js +134 -57
  131. package/dist/cli.js.map +1 -1
  132. package/dist/cloud-deploy.d.ts +1 -1
  133. package/dist/cloud-deploy.d.ts.map +1 -1
  134. package/dist/cloud-deploy.js +24 -8
  135. package/dist/cloud-deploy.js.map +1 -1
  136. package/dist/cloud-mirror-ledger.d.ts +40 -0
  137. package/dist/cloud-mirror-ledger.d.ts.map +1 -0
  138. package/dist/cloud-mirror-ledger.js +142 -0
  139. package/dist/cloud-mirror-ledger.js.map +1 -0
  140. package/dist/cloud-mirror-step.d.ts +168 -0
  141. package/dist/cloud-mirror-step.d.ts.map +1 -0
  142. package/dist/cloud-mirror-step.js +504 -0
  143. package/dist/cloud-mirror-step.js.map +1 -0
  144. package/dist/cloud-mirror-transport.d.ts +94 -0
  145. package/dist/cloud-mirror-transport.d.ts.map +1 -0
  146. package/dist/cloud-mirror-transport.js +163 -0
  147. package/dist/cloud-mirror-transport.js.map +1 -0
  148. package/dist/cloud-mirror.d.ts +132 -0
  149. package/dist/cloud-mirror.d.ts.map +1 -0
  150. package/dist/cloud-mirror.js +556 -0
  151. package/dist/cloud-mirror.js.map +1 -0
  152. package/dist/cloud-read.d.ts +15 -0
  153. package/dist/cloud-read.d.ts.map +1 -1
  154. package/dist/cloud-read.js +20 -1
  155. package/dist/cloud-read.js.map +1 -1
  156. package/dist/cloud-run-record.d.ts +27 -0
  157. package/dist/cloud-run-record.d.ts.map +1 -0
  158. package/dist/cloud-run-record.js +56 -0
  159. package/dist/cloud-run-record.js.map +1 -0
  160. package/dist/cloud-run.d.ts +2 -9
  161. package/dist/cloud-run.d.ts.map +1 -1
  162. package/dist/cloud-run.js +3 -20
  163. package/dist/cloud-run.js.map +1 -1
  164. package/dist/communication/local.d.ts.map +1 -1
  165. package/dist/communication/local.js +2 -1
  166. package/dist/communication/local.js.map +1 -1
  167. package/dist/communication/worker.d.ts +1 -1
  168. package/dist/communication/worker.d.ts.map +1 -1
  169. package/dist/communication/worker.js +13 -5
  170. package/dist/communication/worker.js.map +1 -1
  171. package/dist/compile.d.ts.map +1 -1
  172. package/dist/compile.js +28 -6
  173. package/dist/compile.js.map +1 -1
  174. package/dist/direct-input.d.ts.map +1 -1
  175. package/dist/direct-input.js +21 -1
  176. package/dist/direct-input.js.map +1 -1
  177. package/dist/failure-kinds.d.ts +96 -6
  178. package/dist/failure-kinds.d.ts.map +1 -1
  179. package/dist/failure-kinds.js +29 -2
  180. package/dist/failure-kinds.js.map +1 -1
  181. package/dist/flow-requirements.d.ts.map +1 -1
  182. package/dist/flow-requirements.js +24 -9
  183. package/dist/flow-requirements.js.map +1 -1
  184. package/dist/gate-contract.d.ts +7 -0
  185. package/dist/gate-contract.d.ts.map +1 -1
  186. package/dist/gate-contract.js +6 -1
  187. package/dist/gate-contract.js.map +1 -1
  188. package/dist/helper-preflight.d.ts.map +1 -1
  189. package/dist/helper-preflight.js +10 -3
  190. package/dist/helper-preflight.js.map +1 -1
  191. package/dist/helper-reference.d.ts +25 -0
  192. package/dist/helper-reference.d.ts.map +1 -0
  193. package/dist/helper-reference.js +129 -0
  194. package/dist/helper-reference.js.map +1 -0
  195. package/dist/hosted-extension-runtime.js +1 -1
  196. package/dist/index.d.ts +1 -1
  197. package/dist/index.d.ts.map +1 -1
  198. package/dist/index.js.map +1 -1
  199. package/dist/journal-client.d.ts +3 -1
  200. package/dist/journal-client.d.ts.map +1 -1
  201. package/dist/journal-client.js +17 -2
  202. package/dist/journal-client.js.map +1 -1
  203. package/dist/journal-projection.d.ts +16 -0
  204. package/dist/journal-projection.d.ts.map +1 -0
  205. package/dist/journal-projection.js +108 -0
  206. package/dist/journal-projection.js.map +1 -0
  207. package/dist/llm-worker.js +1 -1
  208. package/dist/llm-worker.js.map +1 -1
  209. package/dist/local-agent.d.ts +1 -1
  210. package/dist/local-agent.d.ts.map +1 -1
  211. package/dist/local-agent.js +4 -3
  212. package/dist/local-agent.js.map +1 -1
  213. package/dist/named-gate-lowering.js +35 -5
  214. package/dist/named-gate-lowering.js.map +1 -1
  215. package/dist/named-gate-preflight.d.ts +27 -0
  216. package/dist/named-gate-preflight.d.ts.map +1 -0
  217. package/dist/named-gate-preflight.js +47 -0
  218. package/dist/named-gate-preflight.js.map +1 -0
  219. package/dist/named-gates.d.ts +1 -1
  220. package/dist/named-gates.d.ts.map +1 -1
  221. package/dist/named-gates.js +3 -0
  222. package/dist/named-gates.js.map +1 -1
  223. package/dist/observer-link.d.ts +7 -0
  224. package/dist/observer-link.d.ts.map +1 -1
  225. package/dist/observer-link.js +3 -1
  226. package/dist/observer-link.js.map +1 -1
  227. package/dist/package-version.d.ts +10 -0
  228. package/dist/package-version.d.ts.map +1 -0
  229. package/dist/package-version.js +22 -0
  230. package/dist/package-version.js.map +1 -0
  231. package/dist/preflight.d.ts +14 -0
  232. package/dist/preflight.d.ts.map +1 -1
  233. package/dist/preflight.js +25 -3
  234. package/dist/preflight.js.map +1 -1
  235. package/dist/protocol.d.ts +2 -0
  236. package/dist/protocol.d.ts.map +1 -1
  237. package/dist/redact.d.ts +42 -0
  238. package/dist/redact.d.ts.map +1 -1
  239. package/dist/redact.js +128 -0
  240. package/dist/redact.js.map +1 -1
  241. package/dist/relay-cli.d.ts.map +1 -1
  242. package/dist/relay-cli.js +1 -21
  243. package/dist/relay-cli.js.map +1 -1
  244. package/dist/run-projection.d.ts +83 -0
  245. package/dist/run-projection.d.ts.map +1 -0
  246. package/dist/run-projection.js +199 -0
  247. package/dist/run-projection.js.map +1 -0
  248. package/dist/shell-word.d.ts +19 -0
  249. package/dist/shell-word.d.ts.map +1 -0
  250. package/dist/shell-word.js +23 -0
  251. package/dist/shell-word.js.map +1 -0
  252. package/dist/spec.d.ts +52 -3
  253. package/dist/spec.d.ts.map +1 -1
  254. package/dist/spec.js.map +1 -1
  255. package/dist/step-fields.d.ts +1 -1
  256. package/dist/step-fields.js +1 -1
  257. package/dist/step-fields.js.map +1 -1
  258. package/dist/steps-green.d.ts +27 -0
  259. package/dist/steps-green.d.ts.map +1 -0
  260. package/dist/steps-green.js +164 -0
  261. package/dist/steps-green.js.map +1 -0
  262. package/dist/validate.d.ts.map +1 -1
  263. package/dist/validate.js +39 -8
  264. package/dist/validate.js.map +1 -1
  265. package/dist/worker-lease.d.ts +8 -1
  266. package/dist/worker-lease.d.ts.map +1 -1
  267. package/dist/worker-lease.js +34 -4
  268. package/dist/worker-lease.js.map +1 -1
  269. package/dist/worker.d.ts +8 -0
  270. package/dist/worker.d.ts.map +1 -1
  271. package/dist/worker.js +17 -9
  272. package/dist/worker.js.map +1 -1
  273. package/package.json +3 -7
  274. package/src/agent-artifacts.ts +2 -10
  275. package/src/agent-cwd.ts +139 -0
  276. package/src/artifact-scan-policy.ts +51 -0
  277. package/src/authored-completion-record.ts +119 -0
  278. package/src/authored-completion.ts +203 -0
  279. package/src/authored-flow-error.ts +13 -1
  280. package/src/authored-flow-executor.ts +91 -58
  281. package/src/authored-human.ts +1 -4
  282. package/src/authored-node-entry.ts +4 -1
  283. package/src/authored-node-runner.ts +96 -22
  284. package/src/authored-preflight.ts +46 -0
  285. package/src/authored-root.ts +20 -2
  286. package/src/authored-step-output.ts +139 -42
  287. package/src/authored-verdict.ts +87 -0
  288. package/src/authored-worker-step.ts +63 -14
  289. package/src/cli/check-worker-surface.ts +66 -0
  290. package/src/cli/check.ts +59 -166
  291. package/src/cli/cli-probe.ts +194 -0
  292. package/src/cli/cloud-format.ts +82 -0
  293. package/src/cli/cloud-live.ts +366 -0
  294. package/src/cli/cloud-mirror-session.ts +329 -0
  295. package/src/cli/cloud-read.ts +13 -282
  296. package/src/cli/cloud-refusal.ts +113 -0
  297. package/src/cli/cloud-status-view.ts +213 -0
  298. package/src/cli/direct-run.ts +19 -2
  299. package/src/cli/hn-monitor.ts +2 -1
  300. package/src/cli/local-agent-remedy.ts +160 -0
  301. package/src/cli/observer-session.ts +107 -0
  302. package/src/cli/run.ts +233 -28
  303. package/src/cli/status.ts +59 -3
  304. package/src/cli/step-evidence.ts +310 -0
  305. package/src/cli/step-failure.ts +57 -81
  306. package/src/cli-commands.ts +3 -0
  307. package/src/cli.ts +155 -60
  308. package/src/cloud-deploy.ts +26 -8
  309. package/src/cloud-mirror-ledger.ts +161 -0
  310. package/src/cloud-mirror-step.ts +618 -0
  311. package/src/cloud-mirror-transport.ts +261 -0
  312. package/src/cloud-mirror.ts +633 -0
  313. package/src/cloud-read.ts +25 -1
  314. package/src/cloud-run-record.ts +64 -0
  315. package/src/cloud-run.ts +5 -24
  316. package/src/communication/local.ts +2 -1
  317. package/src/communication/worker.ts +13 -5
  318. package/src/compile.ts +28 -6
  319. package/src/direct-input.ts +22 -1
  320. package/src/failure-kinds.ts +104 -2
  321. package/src/flow-requirements.ts +24 -9
  322. package/src/gate-contract.ts +13 -1
  323. package/src/helper-preflight.ts +10 -3
  324. package/src/helper-reference.ts +130 -0
  325. package/src/hosted-extension-runtime.ts +1 -1
  326. package/src/index.ts +2 -0
  327. package/src/journal-client.ts +19 -2
  328. package/src/journal-projection.ts +106 -0
  329. package/src/llm-worker.ts +1 -1
  330. package/src/local-agent.ts +4 -2
  331. package/src/named-gate-lowering.ts +35 -5
  332. package/src/named-gate-preflight.ts +47 -0
  333. package/src/named-gates.ts +3 -0
  334. package/src/observer-link.ts +10 -1
  335. package/src/package-version.ts +23 -0
  336. package/src/preflight.ts +38 -7
  337. package/src/protocol.ts +2 -0
  338. package/src/redact.ts +111 -0
  339. package/src/relay-cli.ts +1 -24
  340. package/src/run-projection.ts +247 -0
  341. package/src/shell-word.ts +24 -0
  342. package/src/spec.ts +54 -3
  343. package/src/step-fields.ts +1 -1
  344. package/src/steps-green.ts +168 -0
  345. package/src/validate.ts +35 -8
  346. package/src/worker-lease.ts +35 -5
  347. package/src/worker.ts +27 -11
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-live.js","sourceRoot":"","sources":["../../src/cli/cloud-live.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,kCAAkC;AAClC,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,kEAAkE;AAClE,EAAE;AACF,+EAA+E;AAC/E,uEAAuE;AACvE,+EAA+E;AAC/E,uEAAuE;AACvE,uEAAuE;AACvE,8EAA8E;AAC9E,4EAA4E;AAC5E,yEAAyE;AACzE,+EAA+E;AAC/E,6EAA6E;AAC7E,wEAAwE;AACxE,EAAE;AACF,6EAA6E;AAC7E,6EAA6E;AAC7E,4EAA4E;AAE5E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EACL,qBAAqB,EAAE,cAAc,EAAE,gBAAgB,GAExD,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAsB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAyB,MAAM,oBAAoB,CAAC;AAC/G,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAG9D,kFAAkF;AAClF,MAAM,wBAAwB,GAA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Mirror } from '../cloud-mirror.js';
3
+ import { registerLocalRun, type MirrorRunSource } from '../cloud-mirror-transport.js';
4
+ import type { ProgressEvent } from '../progress.js';
5
+ import type { RunReport } from './run.js';
6
+ /** `FLOWS_CLOUD_MIRROR=1|true|on` turns the mirror on for a whole shell. */
7
+ export declare const MIRROR_ENV = "FLOWS_CLOUD_MIRROR";
8
+ /** What the mirror knows about this run on Cloud, once it is registered. */
9
+ export interface CloudMirrorReceipt {
10
+ /** Cloud's run id — the argument `flows status --cloud` and `flows logs` take. */
11
+ cloudRunId: string;
12
+ dashboardUrl: string;
13
+ }
14
+ export interface CloudMirrorSession {
15
+ /** The root run is admitted: the mirror can start reading its journal. */
16
+ onRunStarted(run: {
17
+ runId: string;
18
+ }): void;
19
+ /**
20
+ * The registration, once it lands. Resolves to nothing when the mirror is
21
+ * off, was refused, or the run never started.
22
+ *
23
+ * Awaiting it is what lets `--json` carry the same handle the terminal line
24
+ * carries: registration is one request made when the run is admitted, so by
25
+ * the time a run has a report it has long since settled — and a consumer of
26
+ * a machine-readable report can wait for a request that has already
27
+ * happened.
28
+ */
29
+ receipt(): Promise<CloudMirrorReceipt | undefined>;
30
+ /** A journaled entry; the first one names the run for a declarative flow. */
31
+ onJournalEntry(entry: {
32
+ run_id: string;
33
+ }): void;
34
+ /** Step transitions, pushed as lifecycle events the run page's stream shows. */
35
+ onProgress(event: ProgressEvent): void;
36
+ /** Publish the final report and the terminal status. Never rejects. */
37
+ finish(report: RunReport): Promise<void>;
38
+ }
39
+ export interface CloudMirrorDeps {
40
+ register?: typeof registerLocalRun;
41
+ createMirror?: typeof createRunMirror;
42
+ }
43
+ export interface CloudMirrorRequest {
44
+ /**
45
+ * The flow's source and input, exactly as `flows run --cloud` would send
46
+ * them. Resolved lazily, once the run id exists: a `resume` has no flow
47
+ * path at all and has to read what ran out of the journal.
48
+ */
49
+ source: (runId: string) => Promise<MirrorRunSource>;
50
+ dataDir: string;
51
+ /** Lines the CLI has printed for this run, uploaded as the run's `runner.log`. */
52
+ log: () => readonly string[];
53
+ /** How the dashboard was asked for, so a refusal can name the right switch. */
54
+ requested: 'flag' | 'env';
55
+ }
56
+ /**
57
+ * Whether this shell asked for the dashboard.
58
+ *
59
+ * Only an affirmative turns it on. Anything else — unset, empty, `0`, or a
60
+ * value nobody meant as a switch — leaves the run local, because the cost of
61
+ * reading a stray value as consent is someone's runs being uploaded.
62
+ */
63
+ export declare function cloudMirrorRequested(env: NodeJS.ProcessEnv): boolean;
64
+ /**
65
+ * Open the session. Registration is deferred until the run id exists, so a
66
+ * refused flow never reaches Cloud at all: `flows run` on a spec that does not
67
+ * compile creates no dashboard row, the same as today.
68
+ */
69
+ export declare function createCloudMirrorSession(request: CloudMirrorRequest, io: CliIo, env?: NodeJS.ProcessEnv, deps?: CloudMirrorDeps): CloudMirrorSession;
70
+ /**
71
+ * What `flows run` mirrors: the flow file's exact bytes, and — for an authored
72
+ * flow — the input it was invoked with.
73
+ *
74
+ * The same source `flows run --cloud` would submit, so a run mirrored from a
75
+ * terminal and the same run launched hosted are recorded identically. It is
76
+ * read here rather than taken from the compiled spec because the compiled
77
+ * form is not what the author wrote, and the run page shows source.
78
+ */
79
+ export declare function mirrorSourceFromPath(path: string, inputArgument: string | undefined, dataDir: string): (runId: string) => Promise<MirrorRunSource>;
80
+ /**
81
+ * What `flows resume` mirrors: the kernel spec the journal recorded at
82
+ * `run.spawned`, canonicalized.
83
+ *
84
+ * A resume names a run id, not a file — the flow it continues may have been
85
+ * edited or deleted since. The journal is the record of what actually ran, so
86
+ * that is what the mirror publishes, as canonical JSON (a YAML subset, the
87
+ * same representation `runInCloud` sends for a declarative flow).
88
+ *
89
+ * Each resume registers its own Cloud run, and that is deliberate rather than
90
+ * a shortcut: a mirrored run goes terminal on Cloud when the CLI exits, and
91
+ * Cloud refuses to move a terminal run back to `running`. Cloud's own v2
92
+ * resume is likewise a new attempt row, so one dashboard row per invocation is
93
+ * the shape the control plane already has — and it costs no credential stored
94
+ * on disk between invocations.
95
+ */
96
+ export declare function mirrorSourceFromJournal(dataDir: string): (runId: string) => Promise<MirrorRunSource>;
97
+ //# sourceMappingURL=cloud-mirror-session.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-mirror-session.d.ts","sourceRoot":"","sources":["../../src/cli/cloud-mirror-session.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAIvC,OAAO,EAAE,eAAe,EAAqC,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAgB,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAGpG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,4EAA4E;AAC5E,eAAO,MAAM,UAAU,uBAAuB,CAAC;AAE/C,4EAA4E;AAC5E,MAAM,WAAW,kBAAkB;IACjC,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,0EAA0E;IAC1E,YAAY,CAAC,GAAG,EAAE;QAAE,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3C;;;;;;;;;OASG;IACH,OAAO,IAAI,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAAC;IACnD,6EAA6E;IAC7E,cAAc,CAAC,KAAK,EAAE;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAChD,gFAAgF;IAChF,UAAU,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI,CAAC;IACvC,uEAAuE;IACvE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1C;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,OAAO,gBAAgB,CAAC;IACnC,YAAY,CAAC,EAAE,OAAO,eAAe,CAAC;CACvC;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,kFAAkF;IAClF,GAAG,EAAE,MAAM,SAAS,MAAM,EAAE,CAAC;IAC7B,+EAA+E;IAC/E,SAAS,EAAE,MAAM,GAAG,KAAK,CAAC;CAC3B;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,OAAO,CAGpE;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,kBAAkB,EAC3B,EAAE,EAAE,KAAK,EACT,GAAG,GAAE,MAAM,CAAC,UAAwB,EACpC,IAAI,GAAE,eAAoB,GACzB,kBAAkB,CAwEpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,GACd,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAa7C;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,eAAe,CAAC,CAwBpG"}
@@ -0,0 +1,264 @@
1
+ // The Cloud half of `flows run` / `flows resume`: also put this local run on
2
+ // the Cloud dashboard.
3
+ //
4
+ // Opt-in, and deliberately the only opt-in thing on this path.
5
+ //
6
+ // A local run is already watchable by default: `observer-session.ts` beside
7
+ // this one projects the run into its own channel and prints a read-only link,
8
+ // off a workspace key, for free. That is the right default — it is a step
9
+ // projection, it costs nothing, and a run that never joins a workspace is not
10
+ // a defect (RFC-0001 settled decision 7).
11
+ //
12
+ // The dashboard is the richer, hosted view of the same run: the flow source,
13
+ // every step's transcript, the run graph, the logs, and the run sitting in the
14
+ // same history as the hosted ones. It is also the one that *stores* all of
15
+ // that. So it is asked for — `--cloud-mirror`, or `FLOWS_CLOUD_MIRROR=1` for a
16
+ // shell — and never turned on by a login happening to be present. Mirroring
17
+ // someone's local runs because they once signed in is not a default anyone
18
+ // consented to.
19
+ //
20
+ // Best-effort once it is on, like the observer: a registration failure is one
21
+ // labeled stderr line, and nothing here can change a run's exit code or its
22
+ // journal. But it is a *louder* line than it used to be, because the run asked
23
+ // for this and did not get it.
24
+ import { readFile } from 'node:fs/promises';
25
+ import { canonicalize } from '../canonical.js';
26
+ import { cloudConnection, CloudFlowError } from '../cloud-http.js';
27
+ import { recordMirroredRun, readMirroredRun } from '../cloud-mirror-ledger.js';
28
+ import { createRunMirror, readJournalEvents } from '../cloud-mirror.js';
29
+ import { MirrorClient, registerLocalRun } from '../cloud-mirror-transport.js';
30
+ import { parseDigestReference } from '../bundle-transport.js';
31
+ import { isAuthoredFlowPath, parseDirectInput } from '../direct-input.js';
32
+ /** `FLOWS_CLOUD_MIRROR=1|true|on` turns the mirror on for a whole shell. */
33
+ export const MIRROR_ENV = 'FLOWS_CLOUD_MIRROR';
34
+ /**
35
+ * Whether this shell asked for the dashboard.
36
+ *
37
+ * Only an affirmative turns it on. Anything else — unset, empty, `0`, or a
38
+ * value nobody meant as a switch — leaves the run local, because the cost of
39
+ * reading a stray value as consent is someone's runs being uploaded.
40
+ */
41
+ export function cloudMirrorRequested(env) {
42
+ const value = env[MIRROR_ENV]?.trim().toLowerCase();
43
+ return value === '1' || value === 'true' || value === 'on' || value === 'yes';
44
+ }
45
+ /**
46
+ * Open the session. Registration is deferred until the run id exists, so a
47
+ * refused flow never reaches Cloud at all: `flows run` on a spec that does not
48
+ * compile creates no dashboard row, the same as today.
49
+ */
50
+ export function createCloudMirrorSession(request, io, env = process.env, deps = {}) {
51
+ const register = deps.register ?? registerLocalRun;
52
+ const createMirror = deps.createMirror ?? createRunMirror;
53
+ let opening;
54
+ let receipt;
55
+ const open = (runId) => opening ??= request.source(runId)
56
+ .then(register)
57
+ .then(registration => {
58
+ const mirror = createMirror({
59
+ client: new MirrorClient(registration),
60
+ dataDir: request.dataDir,
61
+ env,
62
+ diagnostic: message => io.stderr(`[cloud] ${message}`),
63
+ });
64
+ receipt = { cloudRunId: registration.runId, dashboardUrl: registration.runUrl };
65
+ // So a later `flows resume` of this same journal can name this attempt
66
+ // as its predecessor. The credential is deliberately not written; a
67
+ // resume mints its own.
68
+ void recordMirroredRun(request.dataDir, runId, {
69
+ cloudRunId: registration.runId, apiUrl: registration.apiUrl,
70
+ });
71
+ // The page, and the command that follows the same run from a terminal.
72
+ // The id is Cloud's, not the journal's, and nothing else in this
73
+ // invocation prints it — without it a reader has to pick it out of the
74
+ // URL to use any of the hosted read verbs.
75
+ io.stderr(`Dashboard: ${mirror.runUrl} · flows status --cloud --watch ${registration.runId}`);
76
+ mirror.start(runId);
77
+ return mirror;
78
+ })
79
+ .catch((error) => {
80
+ io.stderr(`[cloud] ${mirrorRefusal(error, request.requested)}`);
81
+ return undefined;
82
+ });
83
+ return {
84
+ onRunStarted(run) {
85
+ void open(run.runId);
86
+ },
87
+ onJournalEntry(entry) {
88
+ void open(entry.run_id);
89
+ },
90
+ async receipt() {
91
+ if (opening === undefined)
92
+ return undefined;
93
+ await opening;
94
+ return receipt;
95
+ },
96
+ onProgress(event) {
97
+ // Fire-and-forget, and only for transitions: a `step.running` tick
98
+ // arrives every second and would say nothing the snapshot does not.
99
+ if (opening === undefined)
100
+ return;
101
+ if (event.type !== 'step.started' && event.type !== 'step.completed')
102
+ return;
103
+ void opening.then(mirror => mirror?.event({
104
+ eventType: `relayflow.${event.type}`,
105
+ stepName: event.stepId,
106
+ payload: { stepType: event.stepType },
107
+ }));
108
+ },
109
+ async finish(report) {
110
+ const mirror = opening === undefined ? undefined : await opening;
111
+ if (mirror === undefined)
112
+ return;
113
+ await mirror.finish({
114
+ status: report.completionReason === 'canceled'
115
+ ? 'cancelled'
116
+ : report.ok ? 'completed' : 'failed',
117
+ result: completionReport(report),
118
+ ...(report.completionReason === undefined ? {} : { completionReason: report.completionReason }),
119
+ ...(terminalError(report) === undefined ? {} : { error: terminalError(report) }),
120
+ log: request.log(),
121
+ });
122
+ },
123
+ };
124
+ }
125
+ /**
126
+ * What `flows run` mirrors: the flow file's exact bytes, and — for an authored
127
+ * flow — the input it was invoked with.
128
+ *
129
+ * The same source `flows run --cloud` would submit, so a run mirrored from a
130
+ * terminal and the same run launched hosted are recorded identically. It is
131
+ * read here rather than taken from the compiled spec because the compiled
132
+ * form is not what the author wrote, and the run page shows source.
133
+ */
134
+ export function mirrorSourceFromPath(path, inputArgument, dataDir) {
135
+ const fromJournal = mirrorSourceFromJournal(dataDir);
136
+ return async (runId) => {
137
+ // `flows run <flow>@sha256:<digest>` names a bundle, not a file on this
138
+ // disk: the runner fetches it before executing. Reading the argument as a
139
+ // path there refused the registration and left a perfectly good run off
140
+ // the dashboard, so fall back to what the journal recorded — the same
141
+ // source a resume mirrors.
142
+ if (parseDigestReference(path))
143
+ return fromJournal(runId);
144
+ const workflow = await readFile(path, 'utf8');
145
+ if (!isAuthoredFlowPath(path))
146
+ return { workflow, fileType: 'yaml' };
147
+ return { workflow, fileType: 'ts', inputs: parseDirectInput(inputArgument) };
148
+ };
149
+ }
150
+ /**
151
+ * What `flows resume` mirrors: the kernel spec the journal recorded at
152
+ * `run.spawned`, canonicalized.
153
+ *
154
+ * A resume names a run id, not a file — the flow it continues may have been
155
+ * edited or deleted since. The journal is the record of what actually ran, so
156
+ * that is what the mirror publishes, as canonical JSON (a YAML subset, the
157
+ * same representation `runInCloud` sends for a declarative flow).
158
+ *
159
+ * Each resume registers its own Cloud run, and that is deliberate rather than
160
+ * a shortcut: a mirrored run goes terminal on Cloud when the CLI exits, and
161
+ * Cloud refuses to move a terminal run back to `running`. Cloud's own v2
162
+ * resume is likewise a new attempt row, so one dashboard row per invocation is
163
+ * the shape the control plane already has — and it costs no credential stored
164
+ * on disk between invocations.
165
+ */
166
+ export function mirrorSourceFromJournal(dataDir) {
167
+ return async (runId) => {
168
+ // The predecessor, if this journal has been mirrored before. Read against
169
+ // the deployment this invocation will actually register with, so a run
170
+ // mirrored to staging never claims to continue an id that means something
171
+ // else in production.
172
+ const resumedFromRunId = await readMirroredRun(dataDir, runId, cloudConnection({}).baseUrl)
173
+ .catch(() => undefined);
174
+ // Through the retrying reader: a resume reads this journal while the
175
+ // daemon is writing to it, and a single `journal_busy` used to abandon
176
+ // the registration and leave the resumed run off the dashboard entirely.
177
+ for (const event of await readJournalEvents(runId, dataDir)) {
178
+ if (event.entry_type !== 'run.spawned')
179
+ continue;
180
+ const payload = event.payload;
181
+ if (payload?.spec === undefined)
182
+ break;
183
+ return {
184
+ workflow: canonicalize(payload.spec),
185
+ fileType: 'yaml',
186
+ ...(resumedFromRunId === undefined ? {} : { resumedFromRunId }),
187
+ };
188
+ }
189
+ throw new CloudFlowError('invalid_input', `Run "${runId}" journals no spec to mirror; the run is unaffected.`);
190
+ };
191
+ }
192
+ /** Diagnostics one completion report carries; the rest are counted. */
193
+ const MAX_REPORT_DIAGNOSTICS = 20;
194
+ /** One diagnostic message, in code points. */
195
+ const MAX_DIAGNOSTIC_CHARS = 2_000;
196
+ /**
197
+ * The run's completion report, as the terminal callback stores it.
198
+ *
199
+ * Cloud reconciles a v2 run's reported status against this document: a
200
+ * `completed` callback whose report does not carry `ok`, `status`,
201
+ * `completionReason` and `runId` together is recorded as `failed`. That guard
202
+ * exists so a sandbox whose bootstrap exits cleanly cannot report a run that
203
+ * died at step 1 as green — and it cuts the other way too, so a mirror that
204
+ * omits the report turns a finished local run red. Those four fields are the
205
+ * contract; everything else here is what a reader of the run page gets for
206
+ * free, since the run list extracts `completionReason` from the same document.
207
+ *
208
+ * Diagnostics are bounded and their messages clipped. They are the one part of
209
+ * a report that is unbounded free text, and this document is stored whole.
210
+ */
211
+ function completionReport(report) {
212
+ const diagnostics = report.diagnostics.slice(0, MAX_REPORT_DIAGNOSTICS).map(entry => ({
213
+ severity: 'severity' in entry ? entry.severity : 'refusal',
214
+ kind: entry.kind,
215
+ message: [...entry.message].slice(0, MAX_DIAGNOSTIC_CHARS).join(''),
216
+ }));
217
+ return {
218
+ ok: report.ok,
219
+ command: report.command,
220
+ ...(report.runId === undefined ? {} : { runId: report.runId }),
221
+ ...(report.rootRunId === undefined ? {} : { rootRunId: report.rootRunId }),
222
+ ...(report.status === undefined ? {} : { status: report.status }),
223
+ ...(report.completionReason === undefined ? {} : { completionReason: report.completionReason }),
224
+ ...(report.completionDetail === undefined ? {} : { completionDetail: report.completionDetail }),
225
+ ...(report.completedSteps === undefined ? {} : { completedSteps: report.completedSteps }),
226
+ ...(report.parkedStep === undefined ? {} : { parkedStep: report.parkedStep }),
227
+ ...(report.parkCause === undefined ? {} : { parkCause: report.parkCause }),
228
+ ...(report.next === undefined ? {} : { next: report.next }),
229
+ ...(diagnostics.length === 0 ? {} : { diagnostics }),
230
+ ...(report.diagnostics.length > diagnostics.length
231
+ ? { diagnosticsOmitted: report.diagnostics.length - diagnostics.length }
232
+ : {}),
233
+ };
234
+ }
235
+ /**
236
+ * Why the dashboard is not getting this run, in one line a reader can act on.
237
+ *
238
+ * Every one of these is a request that was not honoured — the run asked for
239
+ * the dashboard and is not on it — so none of them read as an aside. The
240
+ * missing-login case is the common one and names the two commands that fix
241
+ * it: sign in, or stop asking.
242
+ */
243
+ function mirrorRefusal(error, requested) {
244
+ const asked = requested === 'flag' ? '--cloud-mirror' : `${MIRROR_ENV}=1`;
245
+ if (error instanceof CloudFlowError && error.code === 'configuration') {
246
+ return error.reason === 'auth_missing'
247
+ ? `${asked} asked for the Cloud dashboard, but there is no Cloud login, so this run stays local. `
248
+ + `Sign in with \`agent-relay cloud login\`, or drop ${asked}.`
249
+ : `${asked} asked for the Cloud dashboard, but this run stays local: ${error.message}`;
250
+ }
251
+ if (error instanceof CloudFlowError && error.status === 404) {
252
+ return `${asked} asked for the Cloud dashboard, but this deployment does not accept local runs; `
253
+ + 'the run itself is unaffected.';
254
+ }
255
+ return `${asked} asked for the Cloud dashboard, but this run could not be registered (${error instanceof Error ? error.message : String(error)}); the run itself is unaffected.`;
256
+ }
257
+ /** The run's own failure text, bounded by the mirror's transport, or nothing. */
258
+ function terminalError(report) {
259
+ if (report.ok)
260
+ return undefined;
261
+ const diagnostic = report.diagnostics.find(entry => 'severity' in entry && (entry.severity === 'failure' || entry.severity === 'refusal'));
262
+ return diagnostic?.message;
263
+ }
264
+ //# sourceMappingURL=cloud-mirror-session.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cloud-mirror-session.js","sourceRoot":"","sources":["../../src/cli/cloud-mirror-session.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,uBAAuB;AACvB,EAAE;AACF,+DAA+D;AAC/D,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,0EAA0E;AAC1E,8EAA8E;AAC9E,0CAA0C;AAC1C,EAAE;AACF,6EAA6E;AAC7E,+EAA+E;AAC/E,2EAA2E;AAC3E,+EAA+E;AAC/E,4EAA4E;AAC5E,2EAA2E;AAC3E,gBAAgB;AAChB,EAAE;AACF,8EAA8E;AAC9E,4EAA4E;AAC5E,+EAA+E;AAC/E,+BAA+B;AAE/B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAkB,MAAM,oBAAoB,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAwB,MAAM,8BAA8B,CAAC;AACpG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9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EAAE,SAAyB;IAC9D,MAAM,KAAK,GAAG,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,UAAU,IAAI,CAAC;IAC1E,IAAI,KAAK,YAAY,cAAc,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE,CAAC;QACtE,OAAO,KAAK,CAAC,MAAM,KAAK,cAAc;YACpC,CAAC,CAAC,GAAG,KAAK,wFAAwF;kBAC9F,qDAAqD,KAAK,GAAG;YACjE,CAAC,CAAC,GAAG,KAAK,6DAA6D,KAAK,CAAC,OAAO,EAAE,CAAC;IAC3F,CAAC;IACD,IAAI,KAAK,YAAY,cAAc,IAAI,KAAK,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;QAC5D,OAAO,GAAG,KAAK,kFAAkF;cAC7F,+BAA+B,CAAC;IACtC,CAAC;IACD,OAAO,GAAG,KAAK,yEACb,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,CAAC;AAC7F,CAAC;AAED,iFAAiF;AACjF,SAAS,aAAa,CAAC,MAAiB;IACtC,IAAI,MAAM,CAAC,EAAE;QAAE,OAAO,SAAS,CAAC;IAChC,MAAM,UAAU,GAAG,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CACjD,UAAU,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;IACzF,OAAO,UAAU,EAAE,OAAO,CAAC;AAC7B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { type CloudConnectionOptions } from '../cloud-http.js';
1
+ import { type CloudReadOptions } from './cloud-refusal.js';
2
2
  import type { CliIo } from '../cli.js';
3
3
  export interface RunsArgs {
4
4
  command: 'runs';
@@ -11,17 +11,13 @@ export interface LogsArgs {
11
11
  step: string | undefined;
12
12
  raw: boolean;
13
13
  json: boolean;
14
+ /** `--follow`: append new runner output until the run is terminal (cli/cloud-live.ts). */
15
+ follow: boolean;
14
16
  }
15
17
  /** Enough runs to recognise the one you mean; `--limit` raises it. */
16
18
  export declare const DEFAULT_RUN_LIMIT = 20;
17
- /** Injected by tests; production takes the ambient clock and environment. */
18
- export interface CloudReadOptions extends CloudConnectionOptions {
19
- env?: NodeJS.ProcessEnv;
20
- now?: () => number;
21
- }
22
19
  export declare function parseRunsArgs(args: readonly string[]): RunsArgs | undefined;
23
20
  export declare function parseLogsArgs(args: readonly string[]): LogsArgs | undefined;
24
- export declare function errorLines(text: string, indent: string): string[];
25
21
  export declare function runCloudRunsCli(args: RunsArgs, io: CliIo, options?: CloudReadOptions): Promise<0 | 1 | 2>;
26
22
  export declare function runCloudLogsCli(args: LogsArgs, io: CliIo, options?: CloudReadOptions): Promise<0 | 1 | 2>;
27
23
  export declare function runCloudStatusCli(args: {
@@ -1 +1 @@
1
- {"version":3,"file":"cloud-read.d.ts","sourceRoot":"","sources":["../../src/cli/cloud-read.ts"],"names":[],"mappings":"AAeA,OAAO,EAAkB,KAAK,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAQ/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEvC,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,GAAG,EAAE,OAAO,CAAC;IACb,IAAI,EAAE,OAAO,CAAC;CACf;AAED,sEAAsE;AACtE,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAEpC,6EAA6E;AAC7E,MAAM,WAAW,gBAAiB,SAAQ,sBAAsB;I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