@gjermundgaraba/effect-actions 0.22.0 → 0.24.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 (276) hide show
  1. package/README.md +9 -3
  2. package/dist/Action.d.mts +2 -2
  3. package/dist/Action.mjs +1 -0
  4. package/dist/ActionCli.d.mts +1 -1
  5. package/dist/ActionCli.mjs +1 -2
  6. package/dist/ActionHttp.d.mts +2 -2
  7. package/dist/ActionMcp.d.mts +20 -20
  8. package/dist/ActionMcp.mjs +9 -11
  9. package/dist/ActionRpc.d.mts +8 -15
  10. package/dist/ActionRpc.mjs +29 -54
  11. package/dist/ActionToolkit.d.mts +0 -2
  12. package/dist/ActionToolkit.mjs +0 -2
  13. package/dist/Event.d.mts +0 -23
  14. package/dist/Testing.mjs +3 -2
  15. package/dist/Webhook.mjs +2 -2
  16. package/dist/authentication/refusal.mjs +0 -1
  17. package/dist/cli/commands.mjs +0 -5
  18. package/dist/contract/authorizer.mjs +0 -5
  19. package/dist/contract/call.mjs +0 -23
  20. package/dist/contract/callback.mjs +0 -1
  21. package/dist/contract/caller.mjs +0 -11
  22. package/dist/contract/canonical.mjs +0 -5
  23. package/dist/contract/codec.d.mts +0 -1
  24. package/dist/contract/codec.mjs +0 -1
  25. package/dist/contract/codes.mjs +1 -15
  26. package/dist/contract/declared.mjs +0 -15
  27. package/dist/contract/digest.mjs +0 -1
  28. package/dist/contract/errors.d.mts +0 -4
  29. package/dist/contract/errors.mjs +0 -4
  30. package/dist/contract/feed.d.mts +0 -1
  31. package/dist/contract/feed.mjs +0 -20
  32. package/dist/contract/hints.mjs +0 -6
  33. package/dist/contract/hub.mjs +0 -3
  34. package/dist/contract/idempotency.mjs +0 -4
  35. package/dist/contract/implementation.d.mts +0 -1
  36. package/dist/contract/implementation.mjs +0 -27
  37. package/dist/contract/input-check.mjs +0 -1
  38. package/dist/contract/lease.mjs +0 -1
  39. package/dist/contract/listed.mjs +0 -6
  40. package/dist/contract/log.mjs +0 -8
  41. package/dist/contract/names.mjs +0 -1
  42. package/dist/contract/occurrence.mjs +0 -8
  43. package/dist/contract/pages.mjs +5 -12
  44. package/dist/contract/progress.mjs +2 -25
  45. package/dist/contract/push.d.mts +0 -5
  46. package/dist/contract/push.mjs +1 -24
  47. package/dist/contract/receiving.mjs +0 -7
  48. package/dist/contract/reported.mjs +0 -5
  49. package/dist/contract/serving.mjs +0 -18
  50. package/dist/contract/status.mjs +0 -3
  51. package/dist/contract/stream.mjs +0 -2
  52. package/dist/contract/subscribe.d.mts +0 -2
  53. package/dist/contract/subscribe.mjs +0 -8
  54. package/dist/contract/transient.mjs +0 -12
  55. package/dist/contract/watch.mjs +5 -17
  56. package/dist/contract/webhooks.mjs +0 -11
  57. package/dist/http/client.mjs +0 -1
  58. package/dist/http/events.d.mts +0 -10
  59. package/dist/http/events.mjs +2 -31
  60. package/dist/http/placed.d.mts +0 -2
  61. package/dist/http/streamed.d.mts +0 -1
  62. package/dist/http/streamed.mjs +4 -32
  63. package/dist/http/watch.mjs +0 -6
  64. package/dist/mcp/bridge.mjs +1 -26
  65. package/dist/mcp/client.d.mts +0 -1
  66. package/dist/mcp/client.mjs +0 -1
  67. package/dist/mcp/events.mjs +0 -6
  68. package/dist/mcp/progress.mjs +0 -7
  69. package/dist/mcp/protocol.mjs +0 -6
  70. package/dist/mcp/reply.mjs +0 -11
  71. package/dist/mcp/request.mjs +0 -1
  72. package/dist/mcp/watch.mjs +0 -6
  73. package/dist/rpc/watch.mjs +0 -6
  74. package/dist/stdio/console.mjs +2 -2
  75. package/dist/webhook/address.mjs +4 -9
  76. package/dist/webhook/attempt.mjs +2 -15
  77. package/dist/webhook/receiver.mjs +2 -8
  78. package/dist/webhook/signing.mjs +0 -3
  79. package/dist/webhook/stored.mjs +8 -17
  80. package/dist/webhook/subscriptions.mjs +19 -23
  81. package/docs/Action-streams.md +0 -12
  82. package/docs/Action.md +0 -10
  83. package/docs/ActionCli.md +2 -26
  84. package/docs/ActionHttp-failures.md +1 -1
  85. package/docs/ActionHttp.md +0 -28
  86. package/docs/ActionMcp-failures.md +2 -1
  87. package/docs/ActionMcp.md +2 -37
  88. package/docs/ActionRpc-events.md +0 -16
  89. package/docs/ActionRpc.md +0 -63
  90. package/docs/ActionToolkit.md +0 -11
  91. package/docs/Authentication-advanced.md +0 -31
  92. package/docs/Authentication.md +4 -13
  93. package/docs/Event.md +0 -37
  94. package/docs/README.md +1 -1
  95. package/docs/Testing-failures.md +1 -1
  96. package/docs/Testing.md +3 -13
  97. package/docs/Webhook.md +0 -46
  98. package/docs/setup-failures.md +1 -1
  99. package/docs/setup.md +5 -10
  100. package/examples/README.md +7 -1
  101. package/examples/assistant/src/agent.ts +8 -31
  102. package/examples/assistant/src/cli.ts +2 -9
  103. package/examples/assistant/src/commands.ts +0 -8
  104. package/examples/assistant/src/identity/Identity.ts +0 -10
  105. package/examples/assistant/src/identity/authorize.ts +0 -4
  106. package/examples/assistant/src/identity/members.ts +1 -3
  107. package/examples/assistant/src/identity/permissions.ts +0 -5
  108. package/examples/assistant/src/platform/tasks-file.ts +1 -6
  109. package/examples/assistant/src/scripted.ts +0 -4
  110. package/examples/assistant/src/tasks/Tasks.ts +0 -2
  111. package/examples/assistant/src/tasks/handlers.ts +0 -3
  112. package/examples/assistant/src/tasks/store.ts +0 -7
  113. package/examples/assistant/src/toolkit.ts +0 -11
  114. package/examples/assistant/test/commands.test.ts +0 -5
  115. package/examples/assistant/test/identity/identity.test.ts +6 -6
  116. package/examples/assistant/test/platform/tasks-file.test.ts +2 -6
  117. package/examples/assistant/test/tasks/tasks.test.ts +13 -14
  118. package/examples/assistant/test/toolkit.test.ts +7 -18
  119. package/examples/build-events/README.md +2 -0
  120. package/examples/build-events/src/Api.ts +0 -3
  121. package/examples/build-events/src/Rpc.ts +0 -2
  122. package/examples/build-events/src/builds/Builds.ts +0 -15
  123. package/examples/build-events/src/builds/events.ts +0 -10
  124. package/examples/build-events/src/builds/handlers.ts +0 -6
  125. package/examples/build-events/src/builds/log.ts +0 -6
  126. package/examples/build-events/src/builds/status.ts +0 -4
  127. package/examples/build-events/src/builds/store.ts +0 -21
  128. package/examples/build-events/src/cli.ts +0 -2
  129. package/examples/build-events/src/commands.ts +0 -9
  130. package/examples/build-events/src/deploys/approvers.ts +0 -3
  131. package/examples/build-events/src/deploys/events.ts +0 -8
  132. package/examples/build-events/src/deploys/handlers.ts +0 -2
  133. package/examples/build-events/src/identity/Identity.ts +0 -11
  134. package/examples/build-events/src/identity/members.ts +1 -2
  135. package/examples/build-events/src/identity/verifier.ts +8 -9
  136. package/examples/build-events/src/notifier/Notices.ts +0 -3
  137. package/examples/build-events/src/notifier/routes.ts +0 -10
  138. package/examples/build-events/src/notifier.ts +0 -8
  139. package/examples/build-events/src/routes.ts +0 -24
  140. package/examples/build-events/src/server.ts +0 -14
  141. package/examples/build-events/test/builds/events.test.ts +0 -6
  142. package/examples/build-events/test/builds/log.test.ts +0 -1
  143. package/examples/build-events/test/builds/progress.test.ts +0 -1
  144. package/examples/build-events/test/commands.test.ts +0 -5
  145. package/examples/build-events/test/deploys/events.test.ts +0 -1
  146. package/examples/build-events/test/http.test.ts +0 -4
  147. package/examples/build-events/test/notifier.test.ts +0 -9
  148. package/examples/build-events/test/routes.test.ts +0 -9
  149. package/examples/build-events/test/rpc.test.ts +0 -4
  150. package/examples/build-events/test/support/as.ts +3 -4
  151. package/examples/build-events/test/support/memory.ts +0 -5
  152. package/examples/build-events/test/webhooks.test.ts +0 -12
  153. package/examples/kitchen-sink/README.md +1 -1
  154. package/examples/kitchen-sink/src/Actions.ts +0 -10
  155. package/examples/kitchen-sink/src/Api.ts +0 -8
  156. package/examples/kitchen-sink/src/Rpc.ts +0 -4
  157. package/examples/kitchen-sink/src/admin/Admin.ts +0 -9
  158. package/examples/kitchen-sink/src/admin/authenticate.ts +2 -6
  159. package/examples/kitchen-sink/src/admin/authorize.ts +0 -5
  160. package/examples/kitchen-sink/src/admin/grants.ts +0 -5
  161. package/examples/kitchen-sink/src/admin/handlers.ts +0 -2
  162. package/examples/kitchen-sink/src/admin/keys.ts +1 -3
  163. package/examples/kitchen-sink/src/agent.ts +2 -13
  164. package/examples/kitchen-sink/src/assistant/Assistant.ts +7 -24
  165. package/examples/kitchen-sink/src/assistant/conversations.ts +3 -21
  166. package/examples/kitchen-sink/src/assistant/demo-model.ts +0 -5
  167. package/examples/kitchen-sink/src/assistant/handlers.ts +1 -30
  168. package/examples/kitchen-sink/src/attachments/Attachments.ts +0 -4
  169. package/examples/kitchen-sink/src/attachments/download.ts +0 -10
  170. package/examples/kitchen-sink/src/attachments/handlers.ts +0 -3
  171. package/examples/kitchen-sink/src/attachments/store.ts +0 -3
  172. package/examples/kitchen-sink/src/browser.ts +0 -9
  173. package/examples/kitchen-sink/src/cli.ts +0 -19
  174. package/examples/kitchen-sink/src/config.ts +3 -11
  175. package/examples/kitchen-sink/src/identity/Identity.ts +0 -18
  176. package/examples/kitchen-sink/src/identity/authenticate.ts +3 -14
  177. package/examples/kitchen-sink/src/identity/authorize.ts +0 -6
  178. package/examples/kitchen-sink/src/identity/directory.ts +8 -18
  179. package/examples/kitchen-sink/src/identity/handlers.ts +0 -3
  180. package/examples/kitchen-sink/src/identity/members.ts +1 -5
  181. package/examples/kitchen-sink/src/identity/quota.ts +0 -11
  182. package/examples/kitchen-sink/src/issues/Issues.ts +0 -24
  183. package/examples/kitchen-sink/src/issues/assistant.ts +0 -10
  184. package/examples/kitchen-sink/src/issues/events.ts +2 -16
  185. package/examples/kitchen-sink/src/issues/export.ts +0 -5
  186. package/examples/kitchen-sink/src/issues/guide.ts +0 -5
  187. package/examples/kitchen-sink/src/issues/handlers.ts +0 -5
  188. package/examples/kitchen-sink/src/issues/store.ts +19 -23
  189. package/examples/kitchen-sink/src/issues/write-limit.ts +0 -12
  190. package/examples/kitchen-sink/src/memory.ts +0 -9
  191. package/examples/kitchen-sink/src/ops.ts +0 -6
  192. package/examples/kitchen-sink/src/request-policy.ts +0 -17
  193. package/examples/kitchen-sink/src/routes.ts +0 -48
  194. package/examples/kitchen-sink/src/sdk.ts +0 -12
  195. package/examples/kitchen-sink/src/seed.ts +0 -10
  196. package/examples/kitchen-sink/src/server.ts +0 -22
  197. package/examples/kitchen-sink/src/stdio.ts +2 -12
  198. package/examples/kitchen-sink/src/workspaces/Workspaces.ts +0 -4
  199. package/examples/kitchen-sink/src/workspaces/handlers.ts +0 -4
  200. package/examples/kitchen-sink/src/workspaces/registry.ts +0 -5
  201. package/examples/kitchen-sink/src/workspaces/tenant.ts +0 -4
  202. package/examples/kitchen-sink/test/admin/admin.test.ts +0 -1
  203. package/examples/kitchen-sink/test/assistant/assistant.test.ts +0 -18
  204. package/examples/kitchen-sink/test/attachments/attachments.test.ts +0 -9
  205. package/examples/kitchen-sink/test/identity/identity.test.ts +0 -10
  206. package/examples/kitchen-sink/test/identity/session.test.ts +0 -10
  207. package/examples/kitchen-sink/test/issues/assistant.test.ts +3 -7
  208. package/examples/kitchen-sink/test/issues/events.test.ts +2 -9
  209. package/examples/kitchen-sink/test/issues/export.test.ts +0 -3
  210. package/examples/kitchen-sink/test/issues/issues.test.ts +6 -12
  211. package/examples/kitchen-sink/test/request-policy.test.ts +0 -6
  212. package/examples/kitchen-sink/test/routes.test.ts +0 -6
  213. package/examples/kitchen-sink/test/support/as.ts +3 -5
  214. package/examples/kitchen-sink/test/support/scripted.ts +0 -3
  215. package/examples/kitchen-sink/test/support/services.ts +0 -3
  216. package/examples/live-rpc/src/Rpc.ts +0 -4
  217. package/examples/live-rpc/src/browser.ts +0 -24
  218. package/examples/live-rpc/src/chat/Chat.ts +0 -22
  219. package/examples/live-rpc/src/chat/authorize.ts +0 -3
  220. package/examples/live-rpc/src/chat/events.ts +0 -14
  221. package/examples/live-rpc/src/chat/handlers.ts +0 -5
  222. package/examples/live-rpc/src/chat/room.ts +0 -6
  223. package/examples/live-rpc/src/chat/store.ts +0 -9
  224. package/examples/live-rpc/src/client.ts +0 -6
  225. package/examples/live-rpc/src/identity/Identity.ts +0 -6
  226. package/examples/live-rpc/src/identity/members.ts +1 -3
  227. package/examples/live-rpc/src/identity/verifier.ts +6 -12
  228. package/examples/live-rpc/src/page.ts +0 -10
  229. package/examples/live-rpc/src/routes.ts +0 -13
  230. package/examples/live-rpc/src/server.ts +0 -16
  231. package/examples/live-rpc/test/browser.test.ts +0 -9
  232. package/examples/live-rpc/test/chat/chat.test.ts +3 -11
  233. package/examples/live-rpc/test/routes.test.ts +0 -8
  234. package/examples/live-rpc/test/server.test.ts +0 -13
  235. package/examples/mcp-tools/src/instructions.ts +0 -4
  236. package/examples/mcp-tools/src/platform/fake-farm.ts +0 -6
  237. package/examples/mcp-tools/src/platform/print-farm.ts +0 -16
  238. package/examples/mcp-tools/src/printers/Printers.ts +0 -21
  239. package/examples/mcp-tools/src/printers/farm.ts +0 -5
  240. package/examples/mcp-tools/src/printers/handlers.ts +0 -6
  241. package/examples/mcp-tools/src/routes.ts +0 -11
  242. package/examples/mcp-tools/src/server.ts +0 -9
  243. package/examples/mcp-tools/src/stdio.ts +1 -13
  244. package/examples/mcp-tools/test/printers/printers.test.ts +0 -10
  245. package/examples/mcp-tools/test/routes.test.ts +0 -14
  246. package/examples/notes-service/src/Api.ts +0 -4
  247. package/examples/notes-service/src/browser.ts +0 -12
  248. package/examples/notes-service/src/cli.ts +0 -2
  249. package/examples/notes-service/src/commands.ts +0 -30
  250. package/examples/notes-service/src/identity/Identity.ts +0 -2
  251. package/examples/notes-service/src/identity/authorize.ts +0 -4
  252. package/examples/notes-service/src/identity/users.ts +1 -3
  253. package/examples/notes-service/src/identity/verifier.ts +4 -11
  254. package/examples/notes-service/src/notes/Notes.ts +0 -12
  255. package/examples/notes-service/src/notes/handlers.ts +0 -4
  256. package/examples/notes-service/src/notes/store.ts +62 -48
  257. package/examples/notes-service/src/routes.ts +0 -12
  258. package/examples/notes-service/src/server.ts +0 -6
  259. package/examples/notes-service/src/status/Status.ts +0 -1
  260. package/examples/notes-service/src/status/handlers.ts +0 -1
  261. package/examples/notes-service/src/stdio.ts +2 -12
  262. package/examples/notes-service/src/worker.ts +0 -7
  263. package/examples/notes-service/test/commands.test.ts +0 -20
  264. package/examples/notes-service/test/notes/as.ts +3 -4
  265. package/examples/notes-service/test/notes/in-process.test.ts +3 -6
  266. package/examples/notes-service/test/notes/notes.test.ts +0 -6
  267. package/examples/notes-service/test/routes.test.ts +0 -5
  268. package/examples/notes-service/test/worker.test.ts +0 -1
  269. package/examples/quickstart/src/Api.ts +0 -1
  270. package/examples/quickstart/src/client.ts +0 -3
  271. package/examples/quickstart/src/greeting/Greeting.ts +0 -2
  272. package/examples/quickstart/src/greeting/handlers.ts +0 -1
  273. package/examples/quickstart/src/routes.ts +0 -1
  274. package/examples/quickstart/src/server.ts +3 -6
  275. package/examples/quickstart/test/routes.test.ts +0 -1
  276. package/package.json +6 -6
@@ -1,26 +1,16 @@
1
1
  import * as Action from "@gjermundgaraba/effect-actions/Action";
2
2
  import { Context, Schema } from "effect";
3
3
 
4
- /** A teammate: what a sign-in can name. The assistant acts for one in each turn. */
5
4
  export interface Member {
6
5
  readonly kind: "member";
7
6
  readonly id: string;
8
7
  }
9
8
 
10
- /**
11
- * Whoever runs the machine. Only a host builds one, in its own code: nothing that turns a
12
- * credential into a caller is typed to return it, so no token can claim to be the operator.
13
- */
14
9
  export interface Operator {
15
10
  readonly kind: "operator";
16
11
  readonly id: string;
17
12
  }
18
13
 
19
- /**
20
- * Who is calling. A protected action declares it, `caller: CurrentCaller`. Nothing here
21
- * authenticates anyone: the host provides it around each call, as the member a model acts for
22
- * or as the operator at the terminal.
23
- */
24
14
  export class CurrentCaller extends Context.Service<
25
15
  CurrentCaller,
26
16
  Member | Operator
@@ -5,16 +5,12 @@ import { CurrentCaller } from "./Identity.js";
5
5
  import { Permissions } from "./permissions.js";
6
6
  import type { Permission } from "./permissions.js";
7
7
 
8
- // The one rule, for a model's tool call and for a command alike. The permission store is a
9
- // startup service, so this Effect gets it; the caller differs per call, so the function it
10
- // returns reads it.
11
8
  export const authorize = Effect.gen(function* () {
12
9
  const permissions = yield* Permissions;
13
10
 
14
11
  return Effect.fn("authorize")(function* (action: Action.Any) {
15
12
  const caller = yield* CurrentCaller;
16
13
 
17
- // The operator is trusted, and has no entry in the store. Only a host can name one.
18
14
  if (caller.kind === "operator") {
19
15
  return;
20
16
  }
@@ -1,8 +1,6 @@
1
1
  import type { Member } from "./Identity.js";
2
2
 
3
- // DEMO ONLY: the team, by name. A real host maps the user its chat platform has verified to a
4
- // `Member`. Typed as members alone: no entry, and so no sign-in, can be the operator.
5
- export const members = {
3
+ export const demoMembers = {
6
4
  ada: { kind: "member", id: "ada" },
7
5
  grace: { kind: "member", id: "grace" },
8
6
  guest: { kind: "member", id: "guest" },
@@ -2,10 +2,6 @@ import { Context, Effect, Layer } from "effect";
2
2
 
3
3
  export type Permission = "tasks:read" | "tasks:write";
4
4
 
5
- /**
6
- * What each member may do. Permissions are kept here, not in the identity, so changing one
7
- * takes effect on the member's next call.
8
- */
9
5
  export class Permissions extends Context.Service<
10
6
  Permissions,
11
7
  {
@@ -14,7 +10,6 @@ export class Permissions extends Context.Service<
14
10
  ) => Effect.Effect<readonly Permission[]>;
15
11
  }
16
12
  >()("assistant/Permissions") {
17
- // DEMO ONLY: a fixed table. A real application reads its database or its directory.
18
13
  static readonly layerMemory = Layer.sync(Permissions, () => {
19
14
  const table = new Map<string, readonly Permission[]>([
20
15
  ["ada", ["tasks:read", "tasks:write"]],
@@ -8,11 +8,7 @@ import { Task } from "../tasks/Tasks.js";
8
8
 
9
9
  const TasksFile = Schema.fromJsonString(Schema.Array(Task));
10
10
 
11
- // DEMO ONLY: one JSON file, rewritten on every change. Changes are serialized within a
12
- // process, by the store's lock, but nothing locks the file across processes: the agent and a
13
- // command writing at once lose a task. A real application uses a database. The agent and the
14
- // commands are separate processes: this file is what lets one see what the other wrote.
15
- export const tasksFile = Layer.effect(
11
+ export const demoTasksFile = Layer.effect(
16
12
  TaskStore,
17
13
  Effect.gen(function* () {
18
14
  const files = yield* FileSystem.FileSystem;
@@ -32,7 +28,6 @@ export const tasksFile = Layer.effect(
32
28
  const save = (tasks: readonly Task[]) =>
33
29
  Schema.encodeEffect(TasksFile)(tasks).pipe(
34
30
  Effect.flatMap((json) => files.writeFileString(file, json)),
35
- // A log, not a result: a command sends its handler's logs to stderr.
36
31
  Effect.tap(() => Effect.log(`Saved ${tasks.length} tasks to ${file}.`)),
37
32
  Effect.orDie
38
33
  );
@@ -2,10 +2,6 @@ import { Effect, Layer, Ref, Stream } from "effect";
2
2
  import { LanguageModel } from "effect/ai";
3
3
  import type { Response } from "effect/ai";
4
4
 
5
- // DEMO ONLY: a model that needs no API key. It answers its first request with the first reply
6
- // it was given, its second with the second, whatever the prompt says, and with nothing once
7
- // they run out. It stands exactly where a provider's model layer goes, such as
8
- // `OpenAiLanguageModel.model(...)` of `@effect/ai-openai`.
9
5
  export const scripted = (
10
6
  ...replies: ReadonlyArray<readonly Response.PartEncoded[]>
11
7
  ) =>
@@ -14,7 +14,6 @@ export const Task = Schema.Struct({
14
14
 
15
15
  export type Task = typeof Task.Type;
16
16
 
17
- // A declared error is part of the contract.
18
17
  export class TaskNotFound extends Schema.TaggedError<
19
18
  TaskNotFound,
20
19
  { readonly brand: unique symbol }
@@ -22,7 +21,6 @@ export class TaskNotFound extends Schema.TaggedError<
22
21
  id: Schema.String,
23
22
  }) {}
24
23
 
25
- // A field's description is what a model reads beside the tool, and the flag's help text.
26
24
  const Id = Schema.String.annotate({
27
25
  description: "The id listed beside the task.",
28
26
  });
@@ -6,9 +6,6 @@ import { CurrentCaller } from "../identity/Identity.js";
6
6
  import { TaskStore } from "./store.js";
7
7
  import { Tasks } from "./Tasks.js";
8
8
 
9
- // The builder gets the store. `CurrentCaller` is read per call. No handler knows whether a model
10
- // or a person at a terminal called it, and none checks a permission: `authorize` has run before
11
- // it.
12
9
  export const tasks = Action.implement(
13
10
  Tasks,
14
11
  Effect.gen(function* () {
@@ -5,14 +5,10 @@ import { TaskNotFound } from "./Tasks.js";
5
5
 
6
6
  type TaskList = readonly Task[];
7
7
 
8
- // Every method reads the whole list, and a change writes it back: a layer says only where the
9
- // list is kept, in memory below or in a file (src/platform/tasks-file.ts).
10
8
  const make = (
11
9
  load: Effect.Effect<TaskList>,
12
10
  save: (tasks: TaskList) => Effect.Effect<void>
13
11
  ) => {
14
- // A model's tool calls in one turn run concurrently. Two changes reading the list before
15
- // either writes it would lose one, so a change holds this lock from its read to its write.
16
12
  const lock = Semaphore.makeUnsafe(1);
17
13
 
18
14
  const change = Effect.fn("TaskStore.change")(function* (
@@ -61,7 +57,6 @@ const make = (
61
57
  });
62
58
  };
63
59
 
64
- /** The team's tasks. Its methods require nothing: a layer captures where the tasks are kept. */
65
60
  export class TaskStore extends Context.Service<
66
61
  TaskStore,
67
62
  {
@@ -78,10 +73,8 @@ export class TaskStore extends Context.Service<
78
73
  ) => Effect.Effect<Task, TaskNotFound>;
79
74
  }
80
75
  >()("assistant/TaskStore") {
81
- /** The store over a list kept by `load` and `save`, each change serialized. */
82
76
  static readonly make = make;
83
77
 
84
- /** Memory, lost with the process: what a test provides. */
85
78
  static readonly layerMemory = Layer.effect(
86
79
  TaskStore,
87
80
  Effect.map(Ref.make<TaskList>([]), (tasks) =>
@@ -7,12 +7,7 @@ import { CurrentCaller } from "./identity/Identity.js";
7
7
  import type { Member } from "./identity/Identity.js";
8
8
  import { tasks } from "./tasks/handlers.js";
9
9
 
10
- // `actions.layer` holds the handlers, and requires the startup services their builders read;
11
- // neither it nor `actions.toolkit` holds a caller.
12
10
  const actions = ActionToolkit.make([tasks, identity], {
13
- // One rule over every call a model makes, asked before the call runs. A read runs at once. A
14
- // write waits for a person to approve it, except a task the caller adds to their own list:
15
- // `call.name` narrows `call.input` to that action's. Without a caller, it asks.
16
11
  needsApproval: (call) =>
17
12
  !call.action.readOnly &&
18
13
  Effect.map(
@@ -25,8 +20,6 @@ const actions = ActionToolkit.make([tasks, identity], {
25
20
  ),
26
21
  });
27
22
 
28
- // A title for this assistant's approval display. The model still calls the tool `addTask`.
29
- // The later definition wins; annotating the generated tool keeps its handler and approval rule.
30
23
  export const toolkit = Toolkit.merge(
31
24
  actions.toolkit,
32
25
  Toolkit.make(actions.toolkit.tools.addTask.annotate(Tool.Title, "Add a task"))
@@ -34,9 +27,5 @@ export const toolkit = Toolkit.merge(
34
27
 
35
28
  export const { layer } = actions;
36
29
 
37
- // One toolkit serves every member, so who a turn runs as is provided around that turn. This is
38
- // how this example names a model's caller, and it takes a `Member`. The tools themselves accept
39
- // any `CurrentCaller`, so keeping the operator away from a model is this function's doing, and
40
- // that of every host using it.
41
30
  export const actingFor = (member: Member) =>
42
31
  Effect.provideService(CurrentCaller, member);
@@ -10,15 +10,10 @@ import type { Operator } from "../src/identity/Identity.js";
10
10
  import { Permissions } from "../src/identity/permissions.js";
11
11
  import { TaskStore } from "../src/tasks/store.js";
12
12
 
13
- // What the commands add to the implementations: their syntax and what they print. The services
14
- // are provided around a test, not on the command as cli.ts does, so the commands of one test
15
- // share one store in memory.
16
13
  const services = Layer.mergeAll(TaskStore.layerMemory, Permissions.layerMemory);
17
14
 
18
15
  const operator: Operator = { kind: "operator", id: "root" };
19
16
 
20
- // Effect's own runner, given arguments instead of the process's, and stdin the text given here.
21
- // The console of `it.effect` keeps every line printed, so a run returns the lines it added.
22
17
  const run = (args: readonly string[], stdin = "") =>
23
18
  Effect.gen(function* () {
24
19
  const before = (yield* TestConsole.logLines).length;
@@ -5,7 +5,7 @@ import { Effect, Ref } from "effect";
5
5
  import { identity } from "../../src/identity/handlers.js";
6
6
  import { CurrentCaller } from "../../src/identity/Identity.js";
7
7
  import type { Member, Operator } from "../../src/identity/Identity.js";
8
- import { members } from "../../src/identity/members.js";
8
+ import { demoMembers } from "../../src/identity/members.js";
9
9
  import { Permissions } from "../../src/identity/permissions.js";
10
10
  import type { Permission } from "../../src/identity/permissions.js";
11
11
 
@@ -19,7 +19,7 @@ describe("identity, in process", () => {
19
19
  Effect.gen(function* () {
20
20
  const client = yield* Action.client(identity);
21
21
 
22
- expect(yield* client.whoAmI().pipe(as(members.ada))).toStrictEqual({
22
+ expect(yield* client.whoAmI().pipe(as(demoMembers.ada))).toStrictEqual({
23
23
  id: "ada",
24
24
  kind: "member",
25
25
  });
@@ -34,8 +34,6 @@ describe("identity, in process", () => {
34
34
  Effect.gen(function* () {
35
35
  const granted = yield* Ref.make<readonly Permission[]>([]);
36
36
 
37
- // The store is a startup service, so it is provided where the client is acquired: the
38
- // authorizer is built there. No call is given it again.
39
37
  const client = yield* Action.client(identity).pipe(
40
38
  Effect.provideService(
41
39
  Permissions,
@@ -43,14 +41,16 @@ describe("identity, in process", () => {
43
41
  )
44
42
  );
45
43
 
46
- const refusal = yield* Effect.flip(client.whoAmI().pipe(as(members.ada)));
44
+ const refusal = yield* Effect.flip(
45
+ client.whoAmI().pipe(as(demoMembers.ada))
46
+ );
47
47
 
48
48
  expect(refusal).toBeInstanceOf(Action.Forbidden);
49
49
  expect(refusal.message).toBe("Requires tasks:read.");
50
50
 
51
51
  yield* Ref.set(granted, ["tasks:read"]);
52
52
 
53
- expect(yield* client.whoAmI().pipe(as(members.ada))).toStrictEqual({
53
+ expect(yield* client.whoAmI().pipe(as(demoMembers.ada))).toStrictEqual({
54
54
  id: "ada",
55
55
  kind: "member",
56
56
  });
@@ -2,12 +2,9 @@ import { NodeServices } from "@effect/platform-node";
2
2
  import { describe, expect, it } from "@effect/vitest";
3
3
  import { ConfigProvider, Effect, FileSystem, Layer, Path } from "effect";
4
4
 
5
- import { tasksFile } from "../../src/platform/tasks-file.js";
5
+ import { demoTasksFile } from "../../src/platform/tasks-file.js";
6
6
  import { TaskStore } from "../../src/tasks/store.js";
7
7
 
8
- // The file store, on a file of the test's own: `ASSISTANT_TASKS` is set through a
9
- // `ConfigProvider`, as the environment sets it for an entrypoint. The directory is removed
10
- // with the test's scope.
11
8
  const fileStore = Effect.gen(function* () {
12
9
  const files = yield* FileSystem.FileSystem;
13
10
  const path = yield* Path.Path;
@@ -15,7 +12,7 @@ const fileStore = Effect.gen(function* () {
15
12
  const tasks = path.join(directory, "tasks.json");
16
13
  const config = ConfigProvider.fromUnknown({ ASSISTANT_TASKS: tasks });
17
14
 
18
- return tasksFile.pipe(Layer.provide(ConfigProvider.layer(config)));
15
+ return demoTasksFile.pipe(Layer.provide(ConfigProvider.layer(config)));
19
16
  });
20
17
 
21
18
  describe("the file store", () => {
@@ -54,7 +51,6 @@ describe("the file store", () => {
54
51
  tasks.list(undefined)
55
52
  );
56
53
 
57
- // `local` builds the layer anew for each, as each run of the agent or of a command does.
58
54
  const task = yield* add.pipe(Effect.provide(store, { local: true }));
59
55
 
60
56
  expect(
@@ -4,20 +4,17 @@ import { Effect, Layer } from "effect";
4
4
 
5
5
  import { CurrentCaller } from "../../src/identity/Identity.js";
6
6
  import type { Member, Operator } from "../../src/identity/Identity.js";
7
- import { members } from "../../src/identity/members.js";
7
+ import { demoMembers } from "../../src/identity/members.js";
8
8
  import { Permissions } from "../../src/identity/permissions.js";
9
9
  import { tasks } from "../../src/tasks/handlers.js";
10
10
  import { TaskStore } from "../../src/tasks/store.js";
11
11
  import { TaskNotFound } from "../../src/tasks/Tasks.js";
12
12
 
13
- // What the implementation does, with no model and no command line: `Action.client` runs the
14
- // same decoding, `authorize` and handler every surface runs. Each call names its caller.
15
13
  const as = (caller: Member | Operator) =>
16
14
  Effect.provideService(CurrentCaller, caller);
17
15
 
18
16
  const operator: Operator = { kind: "operator", id: "root" };
19
17
 
20
- // A test supplies its services as an entrypoint does: here the store is memory.
21
18
  const services = Layer.mergeAll(TaskStore.layerMemory, Permissions.layerMemory);
22
19
 
23
20
  describe("tasks, in process", () => {
@@ -27,21 +24,23 @@ describe("tasks, in process", () => {
27
24
 
28
25
  yield* client
29
26
  .addTask({ title: "Book the venue", assignee: "ada" })
30
- .pipe(as(members.ada));
27
+ .pipe(as(demoMembers.ada));
31
28
  yield* client
32
29
  .addTask({ title: "Send invitations", assignee: "grace" })
33
30
  .pipe(as(operator));
34
31
 
35
32
  const { tasks: listed } = yield* client
36
33
  .listTasks()
37
- .pipe(as(members.grace));
34
+ .pipe(as(demoMembers.grace));
38
35
 
39
36
  expect(listed.map(({ id, addedBy }) => [id, addedBy])).toStrictEqual([
40
37
  ["1", "ada"],
41
38
  ["2", "root"],
42
39
  ]);
43
40
  expect(
44
- yield* client.listTasks({ assignee: "grace" }).pipe(as(members.grace))
41
+ yield* client
42
+ .listTasks({ assignee: "grace" })
43
+ .pipe(as(demoMembers.grace))
45
44
  ).toMatchObject({
46
45
  tasks: [{ title: "Send invitations" }],
47
46
  });
@@ -55,15 +54,15 @@ describe("tasks, in process", () => {
55
54
  const client = yield* Action.client(tasks);
56
55
  const add = client.addTask({ title: "Order lunch", assignee: "guest" });
57
56
 
58
- const refusal = yield* Effect.flip(add.pipe(as(members.guest)));
57
+ const refusal = yield* Effect.flip(add.pipe(as(demoMembers.guest)));
59
58
 
60
59
  expect(refusal).toBeInstanceOf(Action.Forbidden);
61
60
  expect(refusal.message).toBe("Requires tasks:write.");
62
- expect(yield* client.listTasks().pipe(as(members.guest))).toStrictEqual(
63
- {
64
- tasks: [],
65
- }
66
- );
61
+ expect(
62
+ yield* client.listTasks().pipe(as(demoMembers.guest))
63
+ ).toStrictEqual({
64
+ tasks: [],
65
+ });
67
66
  }).pipe(Effect.provide(services))
68
67
  );
69
68
 
@@ -94,7 +93,7 @@ describe("tasks, in process", () => {
94
93
  const annotate = client.annotateTask({ id: "9", notes: "Urgent." });
95
94
 
96
95
  expect(
97
- yield* Effect.flip(annotate.pipe(as(members.ada)))
96
+ yield* Effect.flip(annotate.pipe(as(demoMembers.ada)))
98
97
  ).toStrictEqual(new TaskNotFound({ id: "9" }));
99
98
  }).pipe(Effect.provide(services))
100
99
  );
@@ -3,21 +3,18 @@ import { Effect, Layer, Stream } from "effect";
3
3
  import { Chat, LanguageModel } from "effect/ai";
4
4
 
5
5
  import type { Member } from "../src/identity/Identity.js";
6
- import { members } from "../src/identity/members.js";
6
+ import { demoMembers } from "../src/identity/members.js";
7
7
  import { Permissions } from "../src/identity/permissions.js";
8
8
  import { scripted } from "../src/scripted.js";
9
9
  import { TaskStore } from "../src/tasks/store.js";
10
10
  import { actingFor, layer, toolkit } from "../src/toolkit.js";
11
11
 
12
- // What the toolkit adds to the implementations: a caller per call, and a model's approvals.
13
- // The handlers run in this process, on a store in memory the tests can read too.
14
12
  const tools = layer.pipe(
15
13
  Layer.provideMerge(
16
14
  Layer.mergeAll(TaskStore.layerMemory, Permissions.layerMemory)
17
15
  )
18
16
  );
19
17
 
20
- // A model's call of `addTask`, as a provider sends it.
21
18
  const adding = (id: string, assignee: string) =>
22
19
  ({
23
20
  type: "tool-call",
@@ -26,7 +23,6 @@ const adding = (id: string, assignee: string) =>
26
23
  params: { title: "Order lunch", assignee },
27
24
  }) as const;
28
25
 
29
- // Which calls of a turn ran, and which wait for a person.
30
26
  const outcome = (
31
27
  response: LanguageModel.GenerateTextResponse<typeof toolkit.tools, "opaque">
32
28
  ) => ({
@@ -36,7 +32,6 @@ const outcome = (
36
32
  ),
37
33
  });
38
34
 
39
- // The model answers each member with the same two calls.
40
35
  const plan = (member: Member) =>
41
36
  LanguageModel.generateText({
42
37
  prompt: "Plan the launch.",
@@ -54,18 +49,15 @@ describe("the toolkit", () => {
54
49
  Effect.gen(function* () {
55
50
  const { handle } = yield* toolkit;
56
51
 
57
- // A call by hand, with the JSON arguments a model sends. The member goes around the whole
58
- // call, the collecting of its results included.
59
52
  const add = handle("addTask", {
60
53
  title: "Order lunch",
61
54
  assignee: "guest",
62
55
  }).pipe(Effect.flatMap(Stream.runCollect));
63
56
 
64
- // A refusal is not raised: it is a result the model reads, as a declared error is.
65
- expect(yield* add.pipe(actingFor(members.guest))).toMatchObject([
57
+ expect(yield* add.pipe(actingFor(demoMembers.guest))).toMatchObject([
66
58
  { isFailure: true, result: { message: "Requires tasks:write." } },
67
59
  ]);
68
- expect(yield* add.pipe(actingFor(members.ada))).toMatchObject([
60
+ expect(yield* add.pipe(actingFor(demoMembers.ada))).toMatchObject([
69
61
  { isFailure: false, result: { id: "1", addedBy: "ada" } },
70
62
  ]);
71
63
  }).pipe(Effect.provide(tools))
@@ -75,16 +67,15 @@ describe("the toolkit", () => {
75
67
  "asks for approval before a model adds to a list that is not its caller's",
76
68
  () =>
77
69
  Effect.gen(function* () {
78
- expect(yield* plan(members.ada)).toStrictEqual({
70
+ expect(yield* plan(demoMembers.ada)).toStrictEqual({
79
71
  ran: ["for ada"],
80
72
  waiting: ["for grace"],
81
73
  });
82
- expect(yield* plan(members.grace)).toStrictEqual({
74
+ expect(yield* plan(demoMembers.grace)).toStrictEqual({
83
75
  ran: ["for grace"],
84
76
  waiting: ["for ada"],
85
77
  });
86
78
 
87
- // A call that waits has not run.
88
79
  const store = yield* TaskStore;
89
80
 
90
81
  expect(
@@ -97,16 +88,14 @@ describe("the toolkit", () => {
97
88
  "authorizes an approved call too: approval lets no one do what they may not",
98
89
  () =>
99
90
  Effect.gen(function* () {
100
- // The `Chat` keeps the request in its history, which the answer is matched against.
101
91
  const chat = yield* Chat.empty;
102
92
 
103
93
  const asked = yield* chat
104
94
  .generateText({ prompt: "Add lunch to Ada's list.", toolkit })
105
- .pipe(actingFor(members.guest));
95
+ .pipe(actingFor(demoMembers.guest));
106
96
 
107
97
  expect(outcome(asked)).toStrictEqual({ ran: [], waiting: ["for ada"] });
108
98
 
109
- // The approved call runs in the turn that carries the answer, as that turn's caller.
110
99
  const answered = yield* chat
111
100
  .generateText({
112
101
  prompt: [
@@ -127,7 +116,7 @@ describe("the toolkit", () => {
127
116
  ],
128
117
  toolkit,
129
118
  })
130
- .pipe(actingFor(members.guest));
119
+ .pipe(actingFor(demoMembers.guest));
131
120
 
132
121
  expect(answered.toolResults).toMatchObject([
133
122
  {
@@ -13,6 +13,8 @@ BUILDS_TOKEN=grace PUBLIC_URL=https://<a tunnel to port 3001> node --import tsx
13
13
  vp test examples/build-events
14
14
  ```
15
15
 
16
+ `WEBHOOKS_DIR` (default `.build-events/webhooks`) is where the server keeps webhook subscriptions, so a restart goes on delivering them. Its files hold each subscriber's secret: give the directory to that server alone, one directory per server process, since the server is the store's only writer.
17
+
16
18
  ## Layout
17
19
 
18
20
  ```text
@@ -10,9 +10,6 @@ import {
10
10
  import { DeployRequested, RequestDeploy } from "./deploys/Deploys.js";
11
11
  import { Login } from "./identity/Identity.js";
12
12
 
13
- // The HTTP binding: each action at `POST /api/<name>`, and each event at
14
- // `POST /api/events/<name>`, which answers a page of JSON, or, asked for `text/event-stream`,
15
- // holds a stream open. It imports no server code, so a client imports it with the contracts.
16
13
  export const Http = ActionHttp.make(
17
14
  [
18
15
  FinishBuild,
@@ -10,8 +10,6 @@ import {
10
10
  import { DeployRequested, RequestDeploy } from "./deploys/Deploys.js";
11
11
  import { Login } from "./identity/Identity.js";
12
12
 
13
- // The RPC binding: each action an rpc named after it, and each event a stream rpc named after
14
- // it, which pushes each occurrence as the server reads it. Plain data, as the HTTP binding is.
15
13
  export const Rpc = ActionRpc.make(
16
14
  [
17
15
  FinishBuild,
@@ -20,8 +20,6 @@ export const Build = Schema.Struct({
20
20
 
21
21
  export type Build = typeof Build.Type;
22
22
 
23
- // DEMO ONLY: a CI runner reports finished builds; here a member does, so the example can
24
- // cause the event it watches.
25
23
  export const FinishBuild = Action.make("finishBuild", {
26
24
  description: "Record that a build of a pipeline finished.",
27
25
  input: { pipeline: Pipeline, status: Status },
@@ -30,10 +28,6 @@ export const FinishBuild = Action.make("finishBuild", {
30
28
  caller: CurrentMember,
31
29
  });
32
30
 
33
- // A build run here, which reports each step as it starts, before it answers how the build ended.
34
- // A caller reads the steps only if it asks, with `onProgress`; each surface carries them its
35
- // own way. They are a snapshot to show: a caller falling behind misses some, never the answer.
36
- // What a caller must see every time is the answer, or `build.finished`, which this build causes.
37
31
  export const StartBuild = Action.make("startBuild", {
38
32
  description:
39
33
  "Run a build of a pipeline, reporting each step, and record how it ended.",
@@ -54,16 +48,11 @@ export const StartBuild = Action.make("startBuild", {
54
48
  caller: CurrentMember,
55
49
  });
56
50
 
57
- // A build this member may not see is not found, as one that never ran: its id tells nothing.
58
51
  export class BuildNotFound extends Schema.TaggedError<
59
52
  BuildNotFound,
60
53
  { readonly brand: unique symbol }
61
54
  >()("BuildNotFound", { buildId: Schema.String }, { httpApiStatus: 404 }) {}
62
55
 
63
- // An action answering a stream: its handler returns a `Stream` of lines, and every client's
64
- // call returns one, each line arriving as the server sends it. HTTP, RPC and a command carry a
65
- // stream; an MCP tool answers one result, the lines collected once the stream ends, so the MCP
66
- // endpoint in `routes.ts` leaves it out rather than put a whole log in a model's context.
67
56
  export const TailLog = Action.make("tailLog", {
68
57
  description: "Stream a build's log, line by line.",
69
58
  input: {
@@ -77,8 +66,6 @@ export const TailLog = Action.make("tailLog", {
77
66
  caller: CurrentMember,
78
67
  });
79
68
 
80
- // An event type: what a subscription takes, what each occurrence carries, and who may
81
- // subscribe. Like an action's contract, it imports no server code.
82
69
  export const BuildFinished = Event.make("build.finished", {
83
70
  description: "A build of a pipeline you may see finished.",
84
71
  input: {
@@ -93,8 +80,6 @@ export const BuildFinished = Event.make("build.finished", {
93
80
  caller: CurrentMember,
94
81
  });
95
82
 
96
- // An event whose occurrence is the whole value: how a pipeline's last build ended, `null` before
97
- // its first. A subscriber is sent it as it is, then again each time a build of it finishes.
98
83
  export const PipelineStatus = Event.make("pipeline.status", {
99
84
  description:
100
85
  "How a pipeline's last build ended: first as it is, then each time one finishes.",
@@ -5,9 +5,6 @@ import { CurrentMember } from "../identity/Identity.js";
5
5
  import { BuildFinished } from "./Builds.js";
6
6
  import { BuildStore } from "./store.js";
7
7
 
8
- // A check source: one function answers "what finished since this cursor?" for every
9
- // subscriber, whether it polls or holds a stream open, on every surface. The builder runs once,
10
- // at startup; the check runs per subscriber, as that subscriber.
11
8
  export const buildEvents = Event.implement(
12
9
  BuildFinished,
13
10
  Effect.gen(function* () {
@@ -18,8 +15,6 @@ export const buildEvents = Event.implement(
18
15
  Effect.gen(function* () {
19
16
  const member = yield* CurrentMember;
20
17
 
21
- // A first subscription asks with `null`: the store answers the current position, so
22
- // the subscriber starts from now.
23
18
  const page = yield* store.finishedSince(
24
19
  member.pipelines,
25
20
  cursor,
@@ -29,7 +24,6 @@ export const buildEvents = Event.implement(
29
24
  return {
30
25
  cursor: page.cursor,
31
26
  hasMore: page.hasMore,
32
- // A cursor the store cannot resume from: the subscriber is sent a gap first.
33
27
  truncated: page.truncated,
34
28
  events: page.builds
35
29
  .filter(
@@ -38,9 +32,6 @@ export const buildEvents = Event.implement(
38
32
  .filter(
39
33
  (build) => status === undefined || build.status === status
40
34
  )
41
- // The store's own id, within its epoch: a subscriber that sees a build twice,
42
- // after a reconnect, drops the second, and never drops a build of a restarted store
43
- // as one it saw before.
44
35
  .map((build) => ({
45
36
  eventId: `${page.epoch}/${build.id}`,
46
37
  data: build,
@@ -49,6 +40,5 @@ export const buildEvents = Event.implement(
49
40
  }),
50
41
  };
51
42
  }),
52
- // Every member may watch; which builds each sees is the store's check, by pipeline.
53
43
  { authorize: Event.allowAll }
54
44
  );
@@ -11,8 +11,6 @@ import {
11
11
  import type { Build } from "./Builds.js";
12
12
  import { BuildStore } from "./store.js";
13
13
 
14
- // DEMO ONLY: each step passes at once. A runner's steps take their time, which is why a caller
15
- // wants to see them.
16
14
  const steps = ["install", "build", "test"];
17
15
 
18
16
  export const builds = Action.implement(
@@ -21,9 +19,6 @@ export const builds = Action.implement(
21
19
  const store = yield* BuildStore;
22
20
  const events = yield* Event.Events;
23
21
 
24
- // `build.finished` is a check source over the store: write the build there first, then wake
25
- // its subscribers, who read it now rather than at their next poll. `pipeline.status` is a
26
- // current source: the notify moves its pipeline's revision, so its subscribers alone read it.
27
22
  const finished = (build: Effect.Effect<Build>) =>
28
23
  Effect.tap(build, ({ pipeline }) =>
29
24
  Effect.andThen(
@@ -35,7 +30,6 @@ export const builds = Action.implement(
35
30
  return {
36
31
  finishBuild: ({ pipeline, status }) =>
37
32
  finished(store.finish(pipeline, status, [status])),
38
- // `progress` never waits for the caller: the build runs at its own pace.
39
33
  startBuild: ({ pipeline }, { progress }) =>
40
34
  Effect.andThen(
41
35
  Effect.forEach(