@b3os/sdk 0.1.0 → 0.2.0

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 (225) hide show
  1. package/README.md +172 -42
  2. package/dist/cjs/core/bytes.d.ts +30 -0
  3. package/dist/cjs/core/bytes.js +115 -0
  4. package/dist/cjs/core/bytes.js.map +1 -0
  5. package/dist/cjs/core/client.d.ts +80 -3
  6. package/dist/cjs/core/client.js +236 -33
  7. package/dist/cjs/core/client.js.map +1 -1
  8. package/dist/cjs/core/errors.d.ts +16 -4
  9. package/dist/cjs/core/errors.js +9 -6
  10. package/dist/cjs/core/errors.js.map +1 -1
  11. package/dist/cjs/core/handle.d.ts +36 -0
  12. package/dist/cjs/core/handle.js +97 -0
  13. package/dist/cjs/core/handle.js.map +1 -0
  14. package/dist/cjs/core/index.d.ts +8 -4
  15. package/dist/cjs/core/index.js +14 -1
  16. package/dist/cjs/core/index.js.map +1 -1
  17. package/dist/cjs/core/login.d.ts +24 -0
  18. package/dist/cjs/core/login.js +93 -0
  19. package/dist/cjs/core/login.js.map +1 -0
  20. package/dist/cjs/core/namespace.d.ts +1 -1
  21. package/dist/cjs/core/namespace.js +1 -1
  22. package/dist/cjs/core/op.d.ts +11 -1
  23. package/dist/cjs/core/timing.d.ts +1 -1
  24. package/dist/cjs/core/timing.js +8 -1
  25. package/dist/cjs/core/timing.js.map +1 -1
  26. package/dist/cjs/core/traces-api.d.ts +42 -0
  27. package/dist/cjs/core/traces-api.js +54 -0
  28. package/dist/cjs/core/traces-api.js.map +1 -0
  29. package/dist/cjs/core/traces.d.ts +120 -0
  30. package/dist/cjs/core/traces.js +306 -0
  31. package/dist/cjs/core/traces.js.map +1 -0
  32. package/dist/cjs/core/transport.js +1 -1
  33. package/dist/cjs/core/transport.js.map +1 -1
  34. package/dist/cjs/core/util.d.ts +15 -3
  35. package/dist/cjs/core/util.js +54 -2
  36. package/dist/cjs/core/util.js.map +1 -1
  37. package/dist/cjs/core/ws.d.ts +4 -0
  38. package/dist/cjs/core/ws.js +7 -4
  39. package/dist/cjs/core/ws.js.map +1 -1
  40. package/dist/cjs/generated/client.d.ts +2 -2
  41. package/dist/cjs/generated/client.js +2 -2
  42. package/dist/cjs/generated/errors.d.ts +1 -1
  43. package/dist/cjs/generated/errors.js +42 -0
  44. package/dist/cjs/generated/errors.js.map +1 -1
  45. package/dist/cjs/generated/ids.d.ts +12 -0
  46. package/dist/cjs/generated/ids.js +3 -0
  47. package/dist/cjs/generated/ids.js.map +1 -1
  48. package/dist/cjs/generated/jobs.js +1 -1
  49. package/dist/cjs/generated/ns/actions.d.ts +48 -6
  50. package/dist/cjs/generated/ns/actions.js +59 -6
  51. package/dist/cjs/generated/ns/actions.js.map +1 -1
  52. package/dist/cjs/generated/ns/infer.d.ts +185 -54
  53. package/dist/cjs/generated/ns/infer.js +28 -74
  54. package/dist/cjs/generated/ns/infer.js.map +1 -1
  55. package/dist/cjs/generated/ns/keys.d.ts +14 -1
  56. package/dist/cjs/generated/ns/keys.js +24 -1
  57. package/dist/cjs/generated/ns/keys.js.map +1 -1
  58. package/dist/cjs/generated/ns/render.d.ts +115 -6
  59. package/dist/cjs/generated/ns/render.js +135 -7
  60. package/dist/cjs/generated/ns/render.js.map +1 -1
  61. package/dist/cjs/generated/ns/requests.d.ts +3 -1
  62. package/dist/cjs/generated/ns/requests.js +3 -1
  63. package/dist/cjs/generated/ns/requests.js.map +1 -1
  64. package/dist/cjs/generated/ns/routines.d.ts +131 -9
  65. package/dist/cjs/generated/ns/routines.js +186 -9
  66. package/dist/cjs/generated/ns/routines.js.map +1 -1
  67. package/dist/cjs/generated/ns/sandboxes.d.ts +327 -31
  68. package/dist/cjs/generated/ns/sandboxes.js +417 -29
  69. package/dist/cjs/generated/ns/sandboxes.js.map +1 -1
  70. package/dist/cjs/generated/ns/vision.d.ts +133 -14
  71. package/dist/cjs/generated/ns/vision.js +158 -12
  72. package/dist/cjs/generated/ns/vision.js.map +1 -1
  73. package/dist/cjs/generated/ns/webhooks.d.ts +8 -5
  74. package/dist/cjs/generated/ns/webhooks.js +8 -5
  75. package/dist/cjs/generated/ns/webhooks.js.map +1 -1
  76. package/dist/cjs/generated/types.d.ts +2750 -328
  77. package/dist/cjs/helpers/agents.d.ts +95 -0
  78. package/dist/cjs/helpers/agents.js +205 -0
  79. package/dist/cjs/helpers/agents.js.map +1 -0
  80. package/dist/cjs/helpers/render.d.ts +15 -0
  81. package/dist/cjs/helpers/render.js +74 -0
  82. package/dist/cjs/helpers/render.js.map +1 -0
  83. package/dist/cjs/helpers/routines.d.ts +61 -0
  84. package/dist/cjs/helpers/routines.js +234 -0
  85. package/dist/cjs/helpers/routines.js.map +1 -0
  86. package/dist/cjs/helpers/sandboxes.d.ts +237 -0
  87. package/dist/cjs/helpers/sandboxes.js +608 -0
  88. package/dist/cjs/helpers/sandboxes.js.map +1 -0
  89. package/dist/cjs/index.d.ts +4 -1
  90. package/dist/cjs/index.js +8 -5
  91. package/dist/cjs/index.js.map +1 -1
  92. package/dist/cjs/routines.d.ts +1 -0
  93. package/dist/cjs/routines.js +21 -0
  94. package/dist/cjs/routines.js.map +1 -0
  95. package/dist/cjs/webhooks.js.map +1 -1
  96. package/dist/esm/core/bytes.d.ts +30 -0
  97. package/dist/esm/core/bytes.js +111 -0
  98. package/dist/esm/core/bytes.js.map +1 -0
  99. package/dist/esm/core/client.d.ts +80 -3
  100. package/dist/esm/core/client.js +233 -31
  101. package/dist/esm/core/client.js.map +1 -1
  102. package/dist/esm/core/errors.d.ts +16 -4
  103. package/dist/esm/core/errors.js +9 -6
  104. package/dist/esm/core/errors.js.map +1 -1
  105. package/dist/esm/core/handle.d.ts +36 -0
  106. package/dist/esm/core/handle.js +93 -0
  107. package/dist/esm/core/handle.js.map +1 -0
  108. package/dist/esm/core/index.d.ts +8 -4
  109. package/dist/esm/core/index.js +6 -2
  110. package/dist/esm/core/index.js.map +1 -1
  111. package/dist/esm/core/login.d.ts +24 -0
  112. package/dist/esm/core/login.js +85 -0
  113. package/dist/esm/core/login.js.map +1 -0
  114. package/dist/esm/core/namespace.d.ts +1 -1
  115. package/dist/esm/core/namespace.js +1 -1
  116. package/dist/esm/core/op.d.ts +11 -1
  117. package/dist/esm/core/timing.d.ts +1 -1
  118. package/dist/esm/core/timing.js +8 -1
  119. package/dist/esm/core/timing.js.map +1 -1
  120. package/dist/esm/core/traces-api.d.ts +42 -0
  121. package/dist/esm/core/traces-api.js +50 -0
  122. package/dist/esm/core/traces-api.js.map +1 -0
  123. package/dist/esm/core/traces.d.ts +120 -0
  124. package/dist/esm/core/traces.js +295 -0
  125. package/dist/esm/core/traces.js.map +1 -0
  126. package/dist/esm/core/transport.js +1 -1
  127. package/dist/esm/core/transport.js.map +1 -1
  128. package/dist/esm/core/util.d.ts +15 -3
  129. package/dist/esm/core/util.js +48 -1
  130. package/dist/esm/core/util.js.map +1 -1
  131. package/dist/esm/core/ws.d.ts +4 -0
  132. package/dist/esm/core/ws.js +7 -4
  133. package/dist/esm/core/ws.js.map +1 -1
  134. package/dist/esm/generated/client.d.ts +2 -2
  135. package/dist/esm/generated/client.js +2 -2
  136. package/dist/esm/generated/errors.d.ts +1 -1
  137. package/dist/esm/generated/errors.js +42 -0
  138. package/dist/esm/generated/errors.js.map +1 -1
  139. package/dist/esm/generated/ids.d.ts +12 -0
  140. package/dist/esm/generated/ids.js +3 -0
  141. package/dist/esm/generated/ids.js.map +1 -1
  142. package/dist/esm/generated/jobs.js +1 -1
  143. package/dist/esm/generated/ns/actions.d.ts +48 -6
  144. package/dist/esm/generated/ns/actions.js +59 -6
  145. package/dist/esm/generated/ns/actions.js.map +1 -1
  146. package/dist/esm/generated/ns/infer.d.ts +185 -54
  147. package/dist/esm/generated/ns/infer.js +28 -74
  148. package/dist/esm/generated/ns/infer.js.map +1 -1
  149. package/dist/esm/generated/ns/keys.d.ts +14 -1
  150. package/dist/esm/generated/ns/keys.js +24 -1
  151. package/dist/esm/generated/ns/keys.js.map +1 -1
  152. package/dist/esm/generated/ns/render.d.ts +115 -6
  153. package/dist/esm/generated/ns/render.js +135 -7
  154. package/dist/esm/generated/ns/render.js.map +1 -1
  155. package/dist/esm/generated/ns/requests.d.ts +3 -1
  156. package/dist/esm/generated/ns/requests.js +3 -1
  157. package/dist/esm/generated/ns/requests.js.map +1 -1
  158. package/dist/esm/generated/ns/routines.d.ts +131 -9
  159. package/dist/esm/generated/ns/routines.js +186 -9
  160. package/dist/esm/generated/ns/routines.js.map +1 -1
  161. package/dist/esm/generated/ns/sandboxes.d.ts +327 -31
  162. package/dist/esm/generated/ns/sandboxes.js +417 -29
  163. package/dist/esm/generated/ns/sandboxes.js.map +1 -1
  164. package/dist/esm/generated/ns/vision.d.ts +133 -14
  165. package/dist/esm/generated/ns/vision.js +158 -12
  166. package/dist/esm/generated/ns/vision.js.map +1 -1
  167. package/dist/esm/generated/ns/webhooks.d.ts +8 -5
  168. package/dist/esm/generated/ns/webhooks.js +8 -5
  169. package/dist/esm/generated/ns/webhooks.js.map +1 -1
  170. package/dist/esm/generated/types.d.ts +2750 -328
  171. package/dist/esm/helpers/agents.d.ts +95 -0
  172. package/dist/esm/helpers/agents.js +199 -0
  173. package/dist/esm/helpers/agents.js.map +1 -0
  174. package/dist/esm/helpers/render.d.ts +15 -0
  175. package/dist/esm/helpers/render.js +70 -0
  176. package/dist/esm/helpers/render.js.map +1 -0
  177. package/dist/esm/helpers/routines.d.ts +61 -0
  178. package/dist/esm/helpers/routines.js +226 -0
  179. package/dist/esm/helpers/routines.js.map +1 -0
  180. package/dist/esm/helpers/sandboxes.d.ts +237 -0
  181. package/dist/esm/helpers/sandboxes.js +600 -0
  182. package/dist/esm/helpers/sandboxes.js.map +1 -0
  183. package/dist/esm/index.d.ts +4 -1
  184. package/dist/esm/index.js +6 -5
  185. package/dist/esm/index.js.map +1 -1
  186. package/dist/esm/routines.d.ts +1 -0
  187. package/dist/esm/routines.js +5 -0
  188. package/dist/esm/routines.js.map +1 -0
  189. package/dist/esm/webhooks.js.map +1 -1
  190. package/package.json +14 -3
  191. package/src/core/bytes.ts +112 -0
  192. package/src/core/client.ts +285 -33
  193. package/src/core/errors.ts +27 -10
  194. package/src/core/handle.ts +107 -0
  195. package/src/core/index.ts +17 -2
  196. package/src/core/login.ts +98 -0
  197. package/src/core/namespace.ts +1 -1
  198. package/src/core/op.ts +11 -1
  199. package/src/core/timing.ts +7 -2
  200. package/src/core/traces-api.ts +80 -0
  201. package/src/core/traces.ts +375 -0
  202. package/src/core/transport.ts +1 -1
  203. package/src/core/util.ts +53 -3
  204. package/src/core/ws.ts +11 -4
  205. package/src/generated/client.ts +2 -2
  206. package/src/generated/errors.ts +84 -0
  207. package/src/generated/ids.ts +3 -0
  208. package/src/generated/jobs.ts +1 -1
  209. package/src/generated/ns/actions.ts +69 -6
  210. package/src/generated/ns/infer.ts +229 -61
  211. package/src/generated/ns/keys.ts +25 -1
  212. package/src/generated/ns/render.ts +172 -7
  213. package/src/generated/ns/requests.ts +3 -1
  214. package/src/generated/ns/routines.ts +205 -9
  215. package/src/generated/ns/sandboxes.ts +493 -34
  216. package/src/generated/ns/vision.ts +168 -14
  217. package/src/generated/ns/webhooks.ts +8 -5
  218. package/src/generated/types.ts +3034 -472
  219. package/src/helpers/agents.ts +300 -0
  220. package/src/helpers/render.ts +91 -0
  221. package/src/helpers/routines.ts +278 -0
  222. package/src/helpers/sandboxes.ts +788 -0
  223. package/src/index.ts +29 -5
  224. package/src/routines.ts +5 -0
  225. package/src/webhooks.ts +5 -1
@@ -8,18 +8,23 @@ import type * as T from "../types.ts";
8
8
  export declare const routinesOps: {
9
9
  readonly listRoutines: Op;
10
10
  readonly createRoutine: Op;
11
+ readonly sendEvent: Op;
11
12
  readonly importRoutine: Op;
12
13
  readonly getRun: Op;
13
14
  readonly cancelRun: Op;
14
15
  readonly runEvents: Op;
16
+ readonly replayRun: Op;
15
17
  readonly signalRun: Op;
16
18
  readonly listRunSteps: Op;
17
19
  readonly validateRoutine: Op;
20
+ readonly getWait: Op;
18
21
  readonly deleteRoutine: Op;
19
22
  readonly getRoutine: Op;
20
23
  readonly updateRoutine: Op;
21
24
  readonly publishRoutine: Op;
25
+ readonly listHookDeliveries: Op;
22
26
  readonly rotateHookSecret: Op;
27
+ readonly testHook: Op;
23
28
  readonly rollbackRoutine: Op;
24
29
  readonly listRuns: Op;
25
30
  readonly createRun: Op;
@@ -43,11 +48,28 @@ export declare class RoutinesAPI extends Namespace {
43
48
  * (`Content-Type: application/yaml`). Fails with `routine_invalid` (pointers into the definition) when it does
44
49
  * not compile, and with `routine_name_taken` when the name exists; `PUT /v1/routines/{routine}` creates or
45
50
  * updates by name instead. Webhook triggers verified with the `b3os` scheme get a signing secret that is
46
- * returned in this response only.
51
+ * returned in this response only. A webhook trigger that names a vault connection (`verify.secret`,
52
+ * `challenge.token_connection`) needs `vault:run` on top of `routines:write`: without it the request answers
53
+ * 403 `forbidden` with `required_scope: vault:run` and nothing is read from the vault.
47
54
  *
48
55
  * `POST /v1/routines` · scope `routines:write` · served by the node
49
56
  */
50
57
  createRoutine(body: T.RoutineDefinition | string, options?: RequestOptions): APIPromise<T.Routine>;
58
+ /**
59
+ * Send an event to waiting runs
60
+ *
61
+ * Resumes every step of your project's active runs that waits for this event (`wait: {event, match}`,
62
+ * routine.schema.json) and whose `match` values are all in `data`, without knowing their run IDs: an order
63
+ * system sends `order.paid` with the order's ID, and the run waiting for that order continues. Each step
64
+ * completes with `{event, data, id, received_at, timed_out: false}`, journaled with its run like a signal.
65
+ * Events are not buffered: a step that starts waiting after the event does not see it, and an event no step
66
+ * waits for answers `delivered: 0`. Runs of other projects never see your events. Each step journals the
67
+ * event, so an event's JSON plus 256 bytes a step may add up to at most 4 MiB across the steps it resumes; past
68
+ * that it is refused whole with `event_fan_out_too_large` and no step continues.
69
+ *
70
+ * `POST /v1/routines/events` · scope `routines:run` · served by the node
71
+ */
72
+ sendEvent(body: T.RoutineEventRequest, options?: RequestOptions): APIPromise<T.RoutineEvent>;
51
73
  /**
52
74
  * Convert a B3OS workflow
53
75
  *
@@ -61,7 +83,7 @@ export declare class RoutinesAPI extends Namespace {
61
83
  /**
62
84
  * Get a run
63
85
  *
64
- * Returns the run with its status, input, result and the state of every top-level step (map items are summarized; list them with `…/steps`).
86
+ * Returns the run with its status, input, result and the state of every top-level step (map items are summarized; list them with `…/steps`). An `ephemeral` run read after it ended returns its summary: `steps` is empty and `steps_kept` is `false`, since its step history was not kept.
65
87
  *
66
88
  * `GET /v1/routines/runs/{run_id}` · scope `routines:read` · served by the node
67
89
  */
@@ -69,7 +91,7 @@ export declare class RoutinesAPI extends Namespace {
69
91
  /**
70
92
  * Cancel a run
71
93
  *
72
- * Cancels the run. In-flight steps are told to stop; steps that already had effects are not undone. The run ends `canceled` with `job_canceled`.
94
+ * Cancels the run. In-flight steps are told to stop (their in-process calls end; a buffered sandbox command is killed with its connection), child runs of `routine/` steps are canceled too, and steps that already had effects are not undone. The run ends `canceled` with `job_canceled`.
73
95
  *
74
96
  * `POST /v1/routines/runs/{run_id}/cancel` · scope `routines:run` · served by the node
75
97
  */
@@ -79,17 +101,47 @@ export declare class RoutinesAPI extends Namespace {
79
101
  *
80
102
  * Server-sent events for the run: lifecycle events, `step.*` events as steps start, retry, wait and finish,
81
103
  * and `run.log` from `core/log` steps. Ends after the terminal event; reconnect with `Last-Event-ID` to resume
82
- * (events are kept with the run history).
104
+ * (events are kept with the run history). An `ephemeral` run that ended kept no events but its terminal one:
105
+ * the stream sends that event alone, with the `seq` it had and the run's summary as its `job`.
83
106
  *
84
107
  * `GET /v1/routines/runs/{run_id}/events` · scope `routines:read` · served by the node
85
108
  */
86
109
  runEvents(runId: string, options?: StreamOptions): EventStream<T.RunEvent>;
110
+ /**
111
+ * Replay a run
112
+ *
113
+ * Starts a new run of a finished run's routine that reuses what the source run already did. Each top-level
114
+ * step that succeeded in the source run is copied: it succeeds at once with its recorded outputs, does not
115
+ * run its callable again (no request, no sandbox, no charge) and shows `replayed: true`. Everything else runs:
116
+ * `from_step` and every step downstream of it, the steps that failed, were skipped or were canceled, steps
117
+ * another version adds or changes (compared with the source version's step of the same id: the step as
118
+ * written, the pack and routine versions it pinned at publish, the steps it depends on, and the `vars` and
119
+ * `env` it reads), steps that read an `input` that differs from the source's (directly or through `env`),
120
+ * steps that wait for a signal unless the version and input are the source's, and every step downstream of
121
+ * one of those. `trigger` and `run` are not compared. Without `from_step`, a replay of a failed run picks up
122
+ * where it failed.
123
+ *
124
+ * The new run uses the source run's version and input unless `version` or `input` is given, so a fix
125
+ * published as a new version can be replayed against the run that failed. Its trigger is
126
+ * `{type: replay, parent_run_id, from_step}`; steps that run again read what the source got from its
127
+ * trigger through the input. Copied steps do not count toward `routines.steps.daily`. The copied outputs
128
+ * and the input together are at most `routines.max_step_output_bytes` (1 MiB by default), or the replay
129
+ * answers 422 `replay_too_large`. Answers like `routinesCreateRun`: `?wait=`, `Accept: text/event-stream`,
130
+ * `webhook` and `Idempotency-Key` work the same way. An `ephemeral` source run kept no step outputs to copy:
131
+ * 410 `run_steps_not_kept` (start a new run with its input instead).
132
+ *
133
+ * `POST /v1/routines/runs/{run_id}/replay` · scope `routines:run` · served by the node
134
+ */
135
+ replayRun(runId: string, body?: T.RunReplayRequest, options?: RequestOptions): JobPromise<T.RoutineRun, T.RunEvent>;
87
136
  /**
88
137
  * Send a signal to a run
89
138
  *
90
139
  * Delivers a named signal to the run. A `wait` step waiting for it completes with `payload` as its outputs; a
91
140
  * signal sent before its step starts waiting is buffered (up to 16 per name) and consumed in order. Fails with
92
- * `run_not_waiting` when the run already finished or the buffer for this name is full.
141
+ * `run_not_waiting` when the run already finished or the buffer for this name is full. The payload counts
142
+ * against the organization's run data on the node (`max_org_run_bytes`): one that does not fit answers 429
143
+ * `concurrency_limited` (503 `capacity_unavailable` at the node's cap), except a payload of up to 1 KiB that
144
+ * ends a wait, so a run can always be let go.
93
145
  *
94
146
  * `POST /v1/routines/runs/{run_id}/signal` · scope `routines:run` · served by the node
95
147
  */
@@ -97,7 +149,7 @@ export declare class RoutinesAPI extends Namespace {
97
149
  /**
98
150
  * List a run's steps
99
151
  *
100
- * Lists every step execution of the run in start order, including each map item (`item_index`) and retries (`attempt`), with outputs and errors.
152
+ * Lists every step execution of the run in start order, including each map item (`item_index`) and retries (`attempt`), with outputs and errors. An `ephemeral` run that ended kept none: 410 `run_steps_not_kept`.
101
153
  *
102
154
  * `GET /v1/routines/runs/{run_id}/steps` · scope `routines:read` · served by the node
103
155
  */
@@ -112,6 +164,24 @@ export declare class RoutinesAPI extends Namespace {
112
164
  * `POST /v1/routines/validate` · scope `routines:write` · served by the node
113
165
  */
114
166
  validateRoutine(body: T.RoutineDefinition, options?: RequestOptions): APIPromise<T.RoutineValidation>;
167
+ /**
168
+ * Read a wait link
169
+ *
170
+ * The link of a `wait` step with `token: true` (`run.wait_urls.<step id>`, routine.schema.json). Send it
171
+ * to the person who should answer: no API key and no login are needed, the link is the credential. A
172
+ * browser (`Accept: text/html`) gets a page with the step's `prompt` (title, body, image, link) and Approve
173
+ * and Reject buttons; `?decision=approve` or `?decision=reject` preselects one, for buttons in a Slack or
174
+ * email message (the person still confirms, so link previews and mail scanners that fetch the URL answer
175
+ * nothing). Programs get the `RoutineWait` JSON. The link names one run and step of one project and is
176
+ * signed by the node; it works once, while the step waits, and for at most 7 days after the step started
177
+ * waiting. The run's end, the step's own deadline or a signal sent through the API ends it too. Any link
178
+ * that is malformed, signed for another run, step or project, or whose run is no longer kept answers the
179
+ * same 404 `wait_link_invalid`. Answers carry `Cache-Control: no-store` and `Referrer-Policy:
180
+ * no-referrer`, and the link never appears in your organization's request log.
181
+ *
182
+ * `GET /v1/routines/waits/{token}` · scope `public` · served by the node
183
+ */
184
+ getWait(token: string, params?: T.RoutinesGetWaitParams, options?: RequestOptions): APIPromise<T.RoutineWait>;
115
185
  /**
116
186
  * Delete a routine
117
187
  *
@@ -149,11 +219,33 @@ export declare class RoutinesAPI extends Namespace {
149
219
  * identity and its scopes are snapshotted. Hook IDs stay the same across versions for the same trigger ID.
150
220
  * Pack triggers (`type: action`) are subscriptions: publishing creates or updates one trigger subscription
151
221
  * (`tsub_`, read-only at `GET /v1/actions/subscriptions`) per action trigger, and removes the subscriptions of
152
- * action triggers the new version no longer has.
222
+ * action triggers the new version no longer has. When the actions product cannot take the subscriptions now
223
+ * (it is not running, or answers 5xx or 429), the version is still published and the routine carries a
224
+ * `product_unavailable` entry in `warnings` per action trigger until a retry subscribes it; when it refuses
225
+ * a trigger (an unknown trigger, a `with` that fails its config schema, a missing connection), the publish
226
+ * fails with `routine_invalid` and an `errors[]` item at that trigger. A webhook trigger that names a vault
227
+ * connection (`verify.secret`, `challenge.token_connection`) needs `vault:run` on top of `routines:write`
228
+ * (403 `forbidden`, `required_scope: vault:run`), as a connection in a pack trigger does.
153
229
  *
154
230
  * `PUT /v1/routines/{routine}` · scope `routines:write` · served by the node
155
231
  */
156
232
  publishRoutine(routine: string, body: T.RoutineDefinition | string, options?: RequestOptions): APIPromise<T.Routine>;
233
+ /**
234
+ * List a hook's deliveries
235
+ *
236
+ * The hook's delivery log, newest first: every request that reached a known hook in the last 7 days, the
237
+ * GET verifications included, whatever the answer (a run started, a duplicate, `if` false, a handshake, a
238
+ * 401 with its `reason`, a 422, a 503). An entry is listed within a second of the answer. Each entry has the
239
+ * status, the error `code`, `reason` and `detail`, the run, the size of the body and a fixed set of headers
240
+ * (`content-type`, `content-length`, `user-agent`, `idempotency-key`, `traceparent`, `x-github-event`,
241
+ * `x-github-delivery`, `x-github-hook-id`, `x-slack-retry-num`, `x-slack-retry-reason`, `webhook-id`,
242
+ * `webhook-timestamp`); no body, signature, cookie, credential or infrastructure header is stored. At most
243
+ * the newest 10,000 entries per hook are kept, and at most 1,200 POST and 60 GET requests per hook and
244
+ * minute are written: requests past that are answered as usual but not listed.
245
+ *
246
+ * `GET /v1/routines/{routine}/hooks/{hook_id}/deliveries` · scope `routines:read` · served by the node
247
+ */
248
+ listHookDeliveries(routine: string, hookId: string, params?: T.RoutinesListHookDeliveriesParams, options?: RequestOptions): ListPromise<T.HookDeliveryEntryList, T.HookDeliveryEntry>;
157
249
  /**
158
250
  * Rotate a hook's signing secret
159
251
  *
@@ -163,13 +255,27 @@ export declare class RoutinesAPI extends Namespace {
163
255
  * `POST /v1/routines/{routine}/hooks/{hook_id}/rotate` · scope `routines:write` · served by the node
164
256
  */
165
257
  rotateHookSecret(routine: string, hookId: string, body?: T.HookRotateRequest, options?: RequestOptions): APIPromise<T.HookSecret>;
258
+ /**
259
+ * Send a test delivery
260
+ *
261
+ * Signs `body` (default `{"test": true, "sent_at": "<now>"}`) with the hook's current secret and delivers it
262
+ * through the hook ingress the way a sender would, with a fresh `Idempotency-Key`. It is verified, matched
263
+ * against `if` and starts a run like any delivery, and its log entry (`source: test`) is the answer and is
264
+ * listed with the hook's deliveries. Only hooks verified with the `b3os` scheme: B3OS does not hold another
265
+ * provider's signing secret in the clear, so send a test from that provider's settings instead.
266
+ *
267
+ * `POST /v1/routines/{routine}/hooks/{hook_id}/test` · scope `routines:write` · served by the node
268
+ */
269
+ testHook(routine: string, hookId: string, body?: T.HookTestRequest, options?: RequestOptions): APIPromise<T.HookDeliveryEntry>;
166
270
  /**
167
271
  * Roll back to a version
168
272
  *
169
273
  * Makes an earlier version active again (triggers switch atomically). Running runs keep their version. The
170
274
  * rollback is recorded as the routine's update; no new version is created. Trigger subscriptions follow the
171
275
  * version: those of action triggers the earlier version does not have are removed, and the others are updated
172
- * to its definition.
276
+ * to its definition (pending, with `warnings`, when the actions product cannot take them now, as on publish).
277
+ * An earlier version whose webhook triggers name vault connections needs `vault:run` of the caller and of the
278
+ * key that published it; either missing answers 403 `forbidden` with `required_scope: vault:run`.
173
279
  *
174
280
  * `POST /v1/routines/{routine}/rollback` · scope `routines:write` · served by the node
175
281
  */
@@ -177,7 +283,7 @@ export declare class RoutinesAPI extends Namespace {
177
283
  /**
178
284
  * List a routine's runs
179
285
  *
180
- * Lists runs of the routine, newest first. Run history is kept for 30 days.
286
+ * Lists runs of the routine, newest first. Run history is kept for 30 days (for an `ephemeral` run, its summary only: `steps_kept: false`).
181
287
  *
182
288
  * `GET /v1/routines/{routine}/runs` · scope `routines:read` · served by the node
183
289
  */
@@ -190,6 +296,22 @@ export declare class RoutinesAPI extends Namespace {
190
296
  * the journal), `Accept: text/event-stream` to follow steps live, or `webhook`. Effect steps without a product
191
297
  * meter of their own bill `routines.effect_step`; product steps bill their product's unit.
192
298
  *
299
+ * Once an `ephemeral` run ends, only its summary is stored: status, timing, `input`, `result`, `error` and its
300
+ * IDs, without its step history. The `?wait=` answer, the event stream and the webhook carry its steps as it
301
+ * ends; every read after that returns the summary with `steps_kept: false` (`routinesGetRun`).
302
+ *
303
+ * Organizations share a node's run shards fairly: the next turn goes to the organization that used the least
304
+ * so far, and each organization's I/O steps run within per-organization, per-routine and per-key budgets.
305
+ * The data an organization's runs hold on the node is capped (`max_org_run_bytes`): a run's input and its
306
+ * journal records count from its start, so a run that does not fit answers 429 `concurrency_limited` with
307
+ * `Retry-After` (503 `capacity_unavailable` when the node's own cap is reached), and a step whose data does
308
+ * not fit fails with `limit_exceeded`; new runs also answer 429 while the run store is a whole cap behind on
309
+ * the organization's finished runs. If the node restarts while a step runs, the step runs again as a new
310
+ * attempt (its `attempt` grows, with the same `Idempotency-Key` to the destination); a result of the earlier
311
+ * attempt that arrives late is discarded. With `defaults.pause_sandboxes`, a run that execs in an existing
312
+ * sandbox and then waits a long time pauses that sandbox until its next exec there (or until the run ends),
313
+ * unless another run on the node execs in it too.
314
+ *
193
315
  * `POST /v1/routines/{routine}/runs` · scope `routines:run` · served by the node
194
316
  */
195
317
  createRun(routine: string, body?: T.RunCreateRequest, options?: RequestOptions): JobPromise<T.RoutineRun, T.RunEvent>;
@@ -20,6 +20,14 @@ const createRoutineOp = {
20
20
  timeoutMs: 15000,
21
21
  scope: "routines:write",
22
22
  };
23
+ const sendEventOp = {
24
+ id: "routinesSendEvent",
25
+ method: "POST",
26
+ path: "/v1/routines/events",
27
+ body: "json",
28
+ timeoutMs: 10000,
29
+ scope: "routines:run",
30
+ };
23
31
  const importRoutineOp = {
24
32
  id: "routinesImportRoutine",
25
33
  method: "POST",
@@ -79,6 +87,14 @@ const validateRoutineOp = {
79
87
  timeoutMs: 15000,
80
88
  scope: "routines:write",
81
89
  };
90
+ const getWaitOp = {
91
+ id: "routinesGetWait",
92
+ method: "GET",
93
+ path: "/v1/routines/waits/{token}",
94
+ params: ["token"],
95
+ timeoutMs: 10000,
96
+ scope: "public",
97
+ };
82
98
  const deleteRoutineOp = {
83
99
  id: "routinesDeleteRoutine",
84
100
  method: "DELETE",
@@ -114,6 +130,14 @@ const publishRoutineOp = {
114
130
  timeoutMs: 15000,
115
131
  scope: "routines:write",
116
132
  };
133
+ const listHookDeliveriesOp = {
134
+ id: "routinesListHookDeliveries",
135
+ method: "GET",
136
+ path: "/v1/routines/{routine}/hooks/{hook_id}/deliveries",
137
+ params: ["routine", "hook_id"],
138
+ timeoutMs: 10000,
139
+ scope: "routines:read",
140
+ };
117
141
  const rotateHookSecretOp = {
118
142
  id: "routinesRotateHookSecret",
119
143
  method: "POST",
@@ -123,6 +147,15 @@ const rotateHookSecretOp = {
123
147
  timeoutMs: 10000,
124
148
  scope: "routines:write",
125
149
  };
150
+ const testHookOp = {
151
+ id: "routinesTestHook",
152
+ method: "POST",
153
+ path: "/v1/routines/{routine}/hooks/{hook_id}/test",
154
+ params: ["routine", "hook_id"],
155
+ body: "json",
156
+ timeoutMs: 10000,
157
+ scope: "routines:write",
158
+ };
126
159
  const rollbackRoutineOp = {
127
160
  id: "routinesRollbackRoutine",
128
161
  method: "POST",
@@ -156,6 +189,18 @@ const getVersionOp = {
156
189
  timeoutMs: 10000,
157
190
  scope: "routines:read",
158
191
  };
192
+ const replayRunOp = {
193
+ id: "routinesReplayRun",
194
+ method: "POST",
195
+ path: "/v1/routines/runs/{run_id}/replay",
196
+ params: ["run_id"],
197
+ body: "json",
198
+ idem: true,
199
+ stream: "sse",
200
+ timeoutMs: 3600000,
201
+ scope: "routines:run",
202
+ job: { get: getRunOp, events: runEventsOp, cancel: cancelRunOp },
203
+ };
159
204
  const createRunOp = {
160
205
  id: "routinesCreateRun",
161
206
  method: "POST",
@@ -172,18 +217,23 @@ const createRunOp = {
172
217
  exports.routinesOps = {
173
218
  listRoutines: listRoutinesOp,
174
219
  createRoutine: createRoutineOp,
220
+ sendEvent: sendEventOp,
175
221
  importRoutine: importRoutineOp,
176
222
  getRun: getRunOp,
177
223
  cancelRun: cancelRunOp,
178
224
  runEvents: runEventsOp,
225
+ replayRun: replayRunOp,
179
226
  signalRun: signalRunOp,
180
227
  listRunSteps: listRunStepsOp,
181
228
  validateRoutine: validateRoutineOp,
229
+ getWait: getWaitOp,
182
230
  deleteRoutine: deleteRoutineOp,
183
231
  getRoutine: getRoutineOp,
184
232
  updateRoutine: updateRoutineOp,
185
233
  publishRoutine: publishRoutineOp,
234
+ listHookDeliveries: listHookDeliveriesOp,
186
235
  rotateHookSecret: rotateHookSecretOp,
236
+ testHook: testHookOp,
187
237
  rollbackRoutine: rollbackRoutineOp,
188
238
  listRuns: listRunsOp,
189
239
  createRun: createRunOp,
@@ -209,13 +259,32 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
209
259
  * (`Content-Type: application/yaml`). Fails with `routine_invalid` (pointers into the definition) when it does
210
260
  * not compile, and with `routine_name_taken` when the name exists; `PUT /v1/routines/{routine}` creates or
211
261
  * updates by name instead. Webhook triggers verified with the `b3os` scheme get a signing secret that is
212
- * returned in this response only.
262
+ * returned in this response only. A webhook trigger that names a vault connection (`verify.secret`,
263
+ * `challenge.token_connection`) needs `vault:run` on top of `routines:write`: without it the request answers
264
+ * 403 `forbidden` with `required_scope: vault:run` and nothing is read from the vault.
213
265
  *
214
266
  * `POST /v1/routines` · scope `routines:write` · served by the node
215
267
  */
216
268
  createRoutine(body, options) {
217
269
  return this._client._call(createRoutineOp, { body, bodyType: typeof body === "string" ? "yaml" : "json" }, options);
218
270
  }
271
+ /**
272
+ * Send an event to waiting runs
273
+ *
274
+ * Resumes every step of your project's active runs that waits for this event (`wait: {event, match}`,
275
+ * routine.schema.json) and whose `match` values are all in `data`, without knowing their run IDs: an order
276
+ * system sends `order.paid` with the order's ID, and the run waiting for that order continues. Each step
277
+ * completes with `{event, data, id, received_at, timed_out: false}`, journaled with its run like a signal.
278
+ * Events are not buffered: a step that starts waiting after the event does not see it, and an event no step
279
+ * waits for answers `delivered: 0`. Runs of other projects never see your events. Each step journals the
280
+ * event, so an event's JSON plus 256 bytes a step may add up to at most 4 MiB across the steps it resumes; past
281
+ * that it is refused whole with `event_fan_out_too_large` and no step continues.
282
+ *
283
+ * `POST /v1/routines/events` · scope `routines:run` · served by the node
284
+ */
285
+ sendEvent(body, options) {
286
+ return this._client._call(sendEventOp, { body }, options);
287
+ }
219
288
  /**
220
289
  * Convert a B3OS workflow
221
290
  *
@@ -231,7 +300,7 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
231
300
  /**
232
301
  * Get a run
233
302
  *
234
- * Returns the run with its status, input, result and the state of every top-level step (map items are summarized; list them with `…/steps`).
303
+ * Returns the run with its status, input, result and the state of every top-level step (map items are summarized; list them with `…/steps`). An `ephemeral` run read after it ended returns its summary: `steps` is empty and `steps_kept` is `false`, since its step history was not kept.
235
304
  *
236
305
  * `GET /v1/routines/runs/{run_id}` · scope `routines:read` · served by the node
237
306
  */
@@ -241,7 +310,7 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
241
310
  /**
242
311
  * Cancel a run
243
312
  *
244
- * Cancels the run. In-flight steps are told to stop; steps that already had effects are not undone. The run ends `canceled` with `job_canceled`.
313
+ * Cancels the run. In-flight steps are told to stop (their in-process calls end; a buffered sandbox command is killed with its connection), child runs of `routine/` steps are canceled too, and steps that already had effects are not undone. The run ends `canceled` with `job_canceled`.
245
314
  *
246
315
  * `POST /v1/routines/runs/{run_id}/cancel` · scope `routines:run` · served by the node
247
316
  */
@@ -253,7 +322,8 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
253
322
  *
254
323
  * Server-sent events for the run: lifecycle events, `step.*` events as steps start, retry, wait and finish,
255
324
  * and `run.log` from `core/log` steps. Ends after the terminal event; reconnect with `Last-Event-ID` to resume
256
- * (events are kept with the run history).
325
+ * (events are kept with the run history). An `ephemeral` run that ended kept no events but its terminal one:
326
+ * the stream sends that event alone, with the `seq` it had and the run's summary as its `job`.
257
327
  *
258
328
  * `GET /v1/routines/runs/{run_id}/events` · scope `routines:read` · served by the node
259
329
  */
@@ -263,12 +333,43 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
263
333
  reconnectOnEnd: true,
264
334
  });
265
335
  }
336
+ /**
337
+ * Replay a run
338
+ *
339
+ * Starts a new run of a finished run's routine that reuses what the source run already did. Each top-level
340
+ * step that succeeded in the source run is copied: it succeeds at once with its recorded outputs, does not
341
+ * run its callable again (no request, no sandbox, no charge) and shows `replayed: true`. Everything else runs:
342
+ * `from_step` and every step downstream of it, the steps that failed, were skipped or were canceled, steps
343
+ * another version adds or changes (compared with the source version's step of the same id: the step as
344
+ * written, the pack and routine versions it pinned at publish, the steps it depends on, and the `vars` and
345
+ * `env` it reads), steps that read an `input` that differs from the source's (directly or through `env`),
346
+ * steps that wait for a signal unless the version and input are the source's, and every step downstream of
347
+ * one of those. `trigger` and `run` are not compared. Without `from_step`, a replay of a failed run picks up
348
+ * where it failed.
349
+ *
350
+ * The new run uses the source run's version and input unless `version` or `input` is given, so a fix
351
+ * published as a new version can be replayed against the run that failed. Its trigger is
352
+ * `{type: replay, parent_run_id, from_step}`; steps that run again read what the source got from its
353
+ * trigger through the input. Copied steps do not count toward `routines.steps.daily`. The copied outputs
354
+ * and the input together are at most `routines.max_step_output_bytes` (1 MiB by default), or the replay
355
+ * answers 422 `replay_too_large`. Answers like `routinesCreateRun`: `?wait=`, `Accept: text/event-stream`,
356
+ * `webhook` and `Idempotency-Key` work the same way. An `ephemeral` source run kept no step outputs to copy:
357
+ * 410 `run_steps_not_kept` (start a new run with its input instead).
358
+ *
359
+ * `POST /v1/routines/runs/{run_id}/replay` · scope `routines:run` · served by the node
360
+ */
361
+ replayRun(runId, body, options) {
362
+ return this._client._job(replayRunOp, { path: [runId], body }, options);
363
+ }
266
364
  /**
267
365
  * Send a signal to a run
268
366
  *
269
367
  * Delivers a named signal to the run. A `wait` step waiting for it completes with `payload` as its outputs; a
270
368
  * signal sent before its step starts waiting is buffered (up to 16 per name) and consumed in order. Fails with
271
- * `run_not_waiting` when the run already finished or the buffer for this name is full.
369
+ * `run_not_waiting` when the run already finished or the buffer for this name is full. The payload counts
370
+ * against the organization's run data on the node (`max_org_run_bytes`): one that does not fit answers 429
371
+ * `concurrency_limited` (503 `capacity_unavailable` at the node's cap), except a payload of up to 1 KiB that
372
+ * ends a wait, so a run can always be let go.
272
373
  *
273
374
  * `POST /v1/routines/runs/{run_id}/signal` · scope `routines:run` · served by the node
274
375
  */
@@ -278,7 +379,7 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
278
379
  /**
279
380
  * List a run's steps
280
381
  *
281
- * Lists every step execution of the run in start order, including each map item (`item_index`) and retries (`attempt`), with outputs and errors.
382
+ * Lists every step execution of the run in start order, including each map item (`item_index`) and retries (`attempt`), with outputs and errors. An `ephemeral` run that ended kept none: 410 `run_steps_not_kept`.
282
383
  *
283
384
  * `GET /v1/routines/runs/{run_id}/steps` · scope `routines:read` · served by the node
284
385
  */
@@ -297,6 +398,26 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
297
398
  validateRoutine(body, options) {
298
399
  return this._client._call(validateRoutineOp, { body }, options);
299
400
  }
401
+ /**
402
+ * Read a wait link
403
+ *
404
+ * The link of a `wait` step with `token: true` (`run.wait_urls.<step id>`, routine.schema.json). Send it
405
+ * to the person who should answer: no API key and no login are needed, the link is the credential. A
406
+ * browser (`Accept: text/html`) gets a page with the step's `prompt` (title, body, image, link) and Approve
407
+ * and Reject buttons; `?decision=approve` or `?decision=reject` preselects one, for buttons in a Slack or
408
+ * email message (the person still confirms, so link previews and mail scanners that fetch the URL answer
409
+ * nothing). Programs get the `RoutineWait` JSON. The link names one run and step of one project and is
410
+ * signed by the node; it works once, while the step waits, and for at most 7 days after the step started
411
+ * waiting. The run's end, the step's own deadline or a signal sent through the API ends it too. Any link
412
+ * that is malformed, signed for another run, step or project, or whose run is no longer kept answers the
413
+ * same 404 `wait_link_invalid`. Answers carry `Cache-Control: no-store` and `Referrer-Policy:
414
+ * no-referrer`, and the link never appears in your organization's request log.
415
+ *
416
+ * `GET /v1/routines/waits/{token}` · scope `public` · served by the node
417
+ */
418
+ getWait(token, params, options) {
419
+ return this._client._call(getWaitOp, { path: [token], query: params }, options);
420
+ }
300
421
  /**
301
422
  * Delete a routine
302
423
  *
@@ -340,13 +461,37 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
340
461
  * identity and its scopes are snapshotted. Hook IDs stay the same across versions for the same trigger ID.
341
462
  * Pack triggers (`type: action`) are subscriptions: publishing creates or updates one trigger subscription
342
463
  * (`tsub_`, read-only at `GET /v1/actions/subscriptions`) per action trigger, and removes the subscriptions of
343
- * action triggers the new version no longer has.
464
+ * action triggers the new version no longer has. When the actions product cannot take the subscriptions now
465
+ * (it is not running, or answers 5xx or 429), the version is still published and the routine carries a
466
+ * `product_unavailable` entry in `warnings` per action trigger until a retry subscribes it; when it refuses
467
+ * a trigger (an unknown trigger, a `with` that fails its config schema, a missing connection), the publish
468
+ * fails with `routine_invalid` and an `errors[]` item at that trigger. A webhook trigger that names a vault
469
+ * connection (`verify.secret`, `challenge.token_connection`) needs `vault:run` on top of `routines:write`
470
+ * (403 `forbidden`, `required_scope: vault:run`), as a connection in a pack trigger does.
344
471
  *
345
472
  * `PUT /v1/routines/{routine}` · scope `routines:write` · served by the node
346
473
  */
347
474
  publishRoutine(routine, body, options) {
348
475
  return this._client._call(publishRoutineOp, { path: [routine], body, bodyType: typeof body === "string" ? "yaml" : "json" }, options);
349
476
  }
477
+ /**
478
+ * List a hook's deliveries
479
+ *
480
+ * The hook's delivery log, newest first: every request that reached a known hook in the last 7 days, the
481
+ * GET verifications included, whatever the answer (a run started, a duplicate, `if` false, a handshake, a
482
+ * 401 with its `reason`, a 422, a 503). An entry is listed within a second of the answer. Each entry has the
483
+ * status, the error `code`, `reason` and `detail`, the run, the size of the body and a fixed set of headers
484
+ * (`content-type`, `content-length`, `user-agent`, `idempotency-key`, `traceparent`, `x-github-event`,
485
+ * `x-github-delivery`, `x-github-hook-id`, `x-slack-retry-num`, `x-slack-retry-reason`, `webhook-id`,
486
+ * `webhook-timestamp`); no body, signature, cookie, credential or infrastructure header is stored. At most
487
+ * the newest 10,000 entries per hook are kept, and at most 1,200 POST and 60 GET requests per hook and
488
+ * minute are written: requests past that are answered as usual but not listed.
489
+ *
490
+ * `GET /v1/routines/{routine}/hooks/{hook_id}/deliveries` · scope `routines:read` · served by the node
491
+ */
492
+ listHookDeliveries(routine, hookId, params, options) {
493
+ return this._client._list(listHookDeliveriesOp, { path: [routine, hookId], query: params }, options);
494
+ }
350
495
  /**
351
496
  * Rotate a hook's signing secret
352
497
  *
@@ -358,13 +503,29 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
358
503
  rotateHookSecret(routine, hookId, body, options) {
359
504
  return this._client._call(rotateHookSecretOp, { path: [routine, hookId], body }, options);
360
505
  }
506
+ /**
507
+ * Send a test delivery
508
+ *
509
+ * Signs `body` (default `{"test": true, "sent_at": "<now>"}`) with the hook's current secret and delivers it
510
+ * through the hook ingress the way a sender would, with a fresh `Idempotency-Key`. It is verified, matched
511
+ * against `if` and starts a run like any delivery, and its log entry (`source: test`) is the answer and is
512
+ * listed with the hook's deliveries. Only hooks verified with the `b3os` scheme: B3OS does not hold another
513
+ * provider's signing secret in the clear, so send a test from that provider's settings instead.
514
+ *
515
+ * `POST /v1/routines/{routine}/hooks/{hook_id}/test` · scope `routines:write` · served by the node
516
+ */
517
+ testHook(routine, hookId, body, options) {
518
+ return this._client._call(testHookOp, { path: [routine, hookId], body }, options);
519
+ }
361
520
  /**
362
521
  * Roll back to a version
363
522
  *
364
523
  * Makes an earlier version active again (triggers switch atomically). Running runs keep their version. The
365
524
  * rollback is recorded as the routine's update; no new version is created. Trigger subscriptions follow the
366
525
  * version: those of action triggers the earlier version does not have are removed, and the others are updated
367
- * to its definition.
526
+ * to its definition (pending, with `warnings`, when the actions product cannot take them now, as on publish).
527
+ * An earlier version whose webhook triggers name vault connections needs `vault:run` of the caller and of the
528
+ * key that published it; either missing answers 403 `forbidden` with `required_scope: vault:run`.
368
529
  *
369
530
  * `POST /v1/routines/{routine}/rollback` · scope `routines:write` · served by the node
370
531
  */
@@ -374,7 +535,7 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
374
535
  /**
375
536
  * List a routine's runs
376
537
  *
377
- * Lists runs of the routine, newest first. Run history is kept for 30 days.
538
+ * Lists runs of the routine, newest first. Run history is kept for 30 days (for an `ephemeral` run, its summary only: `steps_kept: false`).
378
539
  *
379
540
  * `GET /v1/routines/{routine}/runs` · scope `routines:read` · served by the node
380
541
  */
@@ -389,6 +550,22 @@ class RoutinesAPI extends namespace_ts_1.Namespace {
389
550
  * the journal), `Accept: text/event-stream` to follow steps live, or `webhook`. Effect steps without a product
390
551
  * meter of their own bill `routines.effect_step`; product steps bill their product's unit.
391
552
  *
553
+ * Once an `ephemeral` run ends, only its summary is stored: status, timing, `input`, `result`, `error` and its
554
+ * IDs, without its step history. The `?wait=` answer, the event stream and the webhook carry its steps as it
555
+ * ends; every read after that returns the summary with `steps_kept: false` (`routinesGetRun`).
556
+ *
557
+ * Organizations share a node's run shards fairly: the next turn goes to the organization that used the least
558
+ * so far, and each organization's I/O steps run within per-organization, per-routine and per-key budgets.
559
+ * The data an organization's runs hold on the node is capped (`max_org_run_bytes`): a run's input and its
560
+ * journal records count from its start, so a run that does not fit answers 429 `concurrency_limited` with
561
+ * `Retry-After` (503 `capacity_unavailable` when the node's own cap is reached), and a step whose data does
562
+ * not fit fails with `limit_exceeded`; new runs also answer 429 while the run store is a whole cap behind on
563
+ * the organization's finished runs. If the node restarts while a step runs, the step runs again as a new
564
+ * attempt (its `attempt` grows, with the same `Idempotency-Key` to the destination); a result of the earlier
565
+ * attempt that arrives late is discarded. With `defaults.pause_sandboxes`, a run that execs in an existing
566
+ * sandbox and then waits a long time pauses that sandbox until its next exec there (or until the run ends),
567
+ * unless another run on the node execs in it too.
568
+ *
392
569
  * `POST /v1/routines/{routine}/runs` · scope `routines:run` · served by the node
393
570
  */
394
571
  createRun(routine, body, options) {
@@ -1 +1 @@
1
- {"version":3,"file":"routines.js","sourceRoot":"","sources":["../../../../src/generated/ns/routines.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,gDAAwD;AACxD,0DAAoD;AAMpD,MAAM,cAAc,GAAO;IACzB,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,qBAAqB;IAC3B,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,QAAQ,GAAO;IACnB,EAAE,EAAE,gBAAgB;IACpB,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,4BAA4B;IAClC,MAAM,EAAE,CAAC,QAAQ,CAAC;IAClB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,WAAW,GAAO;IACtB,EAAE,EAAE,mBAAmB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;;;;;;;;OASG;IACH,SAAS,CACP,OAAe,EACf,IAAyB,EACzB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAA2B,WAAW,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,CAAC;IACtG,CAAC;IAED;;;;;;OAMG;IACH,YAAY,CACV,OAAe,EACf,MAAqC,EACrC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CACvB,cAAc,EACd,EAAE,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,EAClC,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;OAMG;IACH,UAAU,CAAC,OAAe,EAAE,OAAe,EAAE,OAAwB;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAmB,YAAY,EAAE,EAAE,IAAI,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;IACnG,CAAC;CACF;AAlRD,kCAkRC"}
1
+ {"version":3,"file":"routines.js","sourceRoot":"","sources":["../../../../src/generated/ns/routines.ts"],"names":[],"mappings":";AAAA,4GAA4G;;;AAG5G,gDAAwD;AACxD,0DAAoD;AAMpD,MAAM,cAAc,GAAO;IACzB,EAAE,EAAE,sBAAsB;IAC1B,MAAM,EAAE,KAAK;IACb,IAAI,EAAE,cAAc;IACpB,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,eAAe;CACvB,CAAC;AACF,MAAM,eAAe,GAAO;IAC1B,EAAE,EAAE,uBAAuB;IAC3B,MAAM,EAAE,MAAM;IACd,IAAI,EAAE,cAAc;IACpB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;IACV,SAAS,EAAE,KAAK;IAChB,KAAK,EAAE,gBAAgB;CACxB,CAAC;AACF,MAAM,WAAW,GAAO;IACtB,EAAE,EAAE,mBAAmB;IACvB,MAAM,EAAE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