@fungi.computer/bonsai 0.12.2 → 0.12.4

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # @fungi.computer/bonsai
2
2
 
3
+ ## 0.12.4
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - Updated dependencies
9
+ - Updated dependencies
10
+ - @fungi.computer/agar@0.28.0
11
+ - @fungi.computer/caps@0.13.0
12
+ - @fungi.computer/oyster@0.57.1
13
+ - @fungi.computer/trellis@0.28.4
14
+ - @fungi.computer/braid@0.6.11
15
+ - @fungi.computer/nacre@0.9.4
16
+ - @fungi.computer/workflows-wire@0.7.12
17
+
18
+ ## 0.12.3
19
+
20
+ ### Patch Changes
21
+
22
+ - Changes since 0.12.2:
23
+
24
+ - fix(bonsai): decode host workflow status across releases
25
+
26
+ - Updated dependencies
27
+ - Updated dependencies
28
+ - Updated dependencies
29
+ - @fungi.computer/agar@0.27.2
30
+ - @fungi.computer/caps@0.12.9
31
+ - @fungi.computer/oyster@0.57.0
32
+ - @fungi.computer/trellis@0.28.3
33
+ - @fungi.computer/braid@0.6.10
34
+ - @fungi.computer/nacre@0.9.3
35
+ - @fungi.computer/workflows-wire@0.7.11
36
+
3
37
  ## 0.12.2
4
38
 
5
39
  ### Patch Changes
@@ -9,7 +9,6 @@ import type { GraphStartRequest } from "@fungi.computer/braid/runtime";
9
9
  import {
10
10
  repositoryWorkflowSourceSchema,
11
11
  runReply,
12
- statusReply,
13
12
  runsReplySchema,
14
13
  } from "@fungi.computer/workflows-wire";
15
14
  import { AppMethodRefusal } from "@fungi.computer/agar/backend";
@@ -31,9 +30,7 @@ export type BuildWorkflowBindings = Readonly<{
31
30
  workflowId?: string;
32
31
  }): Promise<ReturnType<typeof runsReplySchema.parse>>;
33
32
  runGraph(input: GraphStartRequest): Promise<BuildWorkflowRunReply>;
34
- graphStatus(input: {
35
- runId: string;
36
- }): Promise<ReturnType<typeof statusReply.parse>>;
33
+ graphStatus(input: { runId: string }): Promise<typeof S.Json.Type>;
37
34
  }>;
38
35
  }>;
39
36
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runReply,
3
- statusReply,
3
+ hostStatusReply,
4
4
  runsReplySchema,
5
5
  } from "@fungi.computer/workflows-wire";
6
6
  import {
@@ -301,7 +301,7 @@ const definition = defineAppBackend<BonsaiMethodContext>({
301
301
  effect: "read",
302
302
  requires: ["workflow.run"],
303
303
  input: z.strictObject({ runId: z.string().min(1).max(256) }),
304
- output: statusReply,
304
+ output: hostStatusReply,
305
305
  handler: async (input, context: BonsaiMethodContext, caller) => {
306
306
  if (caller.role !== "owner")
307
307
  throw new AppMethodRefusal("forbidden", "Owner only");
@@ -310,7 +310,7 @@ const definition = defineAppBackend<BonsaiMethodContext>({
310
310
  "unavailable",
311
311
  "Workflow access is not granted",
312
312
  );
313
- return statusReply.parse(
313
+ return hostStatusReply.parse(
314
314
  await context.env.WORKFLOWS.graphStatus(input),
315
315
  );
316
316
  },
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@fungi.computer/bonsai",
3
- "version": "0.12.2",
3
+ "version": "0.12.4",
4
4
  "author": "Levi <levi@technomancy.dev>",
5
5
  "type": "module",
6
6
  "description": "Bonsai: a git platform for many agents working at once, on Workers and Artifacts",
7
7
  "dependencies": {
8
- "@fungi.computer/agar": "0.27.1",
9
- "@fungi.computer/caps": "0.12.8",
8
+ "@fungi.computer/agar": "0.28.0",
9
+ "@fungi.computer/caps": "0.13.0",
10
10
  "@fungi.computer/issues": "0.2.0",
11
- "@fungi.computer/oyster": "0.56.2",
11
+ "@fungi.computer/oyster": "0.57.1",
12
12
  "@fungi.computer/puffball": "0.15.0",
13
13
  "@fungi.computer/sigils": "0.3.2",
14
14
  "@fungi.computer/stipe": "0.1.1",
@@ -29,10 +29,10 @@
29
29
  "@fungi.computer/maosaico": "0.1.2",
30
30
  "@visx/hierarchy": "3.12.0",
31
31
  "@fungi.computer/gills": "0.4.0",
32
- "@fungi.computer/nacre": "0.9.2",
33
- "@fungi.computer/trellis": "0.28.2",
34
- "@fungi.computer/braid": "0.6.9",
35
- "@fungi.computer/workflows-wire": "0.7.10"
32
+ "@fungi.computer/nacre": "0.9.4",
33
+ "@fungi.computer/trellis": "0.28.4",
34
+ "@fungi.computer/braid": "0.6.11",
35
+ "@fungi.computer/workflows-wire": "0.7.12"
36
36
  },
37
37
  "devDependencies": {
38
38
  "playwright": "1.62.1",
@@ -52,7 +52,7 @@
52
52
  "eslint": "10.9.1",
53
53
  "oxlint": "1.78.0",
54
54
  "jsdom": "29.0.1",
55
- "@fungi.computer/computer-contract": "0.6.3"
55
+ "@fungi.computer/computer-contract": "0.6.4"
56
56
  },
57
57
  "botanical": {
58
58
  "role": "app",
@@ -14,7 +14,7 @@ import { appBackend, type AppsBindingReply } from "../backend/methods.js";
14
14
  import { gitStore } from "../backend/git.js";
15
15
  import { ensureBonsaiTables, BonsaiState } from "../backend/state.js";
16
16
  import type { Bonsai } from "../backend/service.js";
17
- import type { AppBuildInstallation } from "../shared/contract.js";
17
+ import type { AppBuildInstallation, JsonValue } from "../shared/contract.js";
18
18
  import {
19
19
  appBackendBindingOperation,
20
20
  scopeOperationToMethod,
@@ -66,6 +66,7 @@ function fixture(
66
66
  installation?: AppBuildInstallation,
67
67
  buildStatusReply?: AppsBindingReply,
68
68
  selectReply?: AppsBindingReply,
69
+ workflowStatusReply?: JsonValue,
69
70
  ) {
70
71
  const calls: Calls = {};
71
72
  const build = {
@@ -119,18 +120,19 @@ function fixture(
119
120
  },
120
121
  graphStatus: () =>
121
122
  Promise.resolve(
122
- statusReply.parse({
123
- runId: "run_manual",
124
- planDigest: "sha256:" + "d".repeat(64),
125
- outcome: "active",
126
- title: "Build on merge",
127
- input: {},
128
- status: "running",
129
- events: [],
130
- reviews: [],
131
- output: null,
132
- error: null,
133
- }),
123
+ workflowStatusReply ??
124
+ statusReply.parse({
125
+ runId: "run_manual",
126
+ planDigest: "sha256:" + "d".repeat(64),
127
+ outcome: "active",
128
+ title: "Build on merge",
129
+ input: {},
130
+ status: "running",
131
+ events: [],
132
+ reviews: [],
133
+ output: null,
134
+ error: null,
135
+ }),
134
136
  ),
135
137
  },
136
138
  APPS: {
@@ -335,6 +337,62 @@ describe("App authoring methods", () => {
335
337
  );
336
338
  });
337
339
 
340
+ it("reads build Workflow status from an older host without recorded input", async () => {
341
+ const status = {
342
+ runId: "run_manual",
343
+ planDigest: "sha256:" + "d".repeat(64),
344
+ outcome: "active",
345
+ title: "Build on merge",
346
+ status: "running",
347
+ events: [],
348
+ reviews: [],
349
+ output: null,
350
+ error: null,
351
+ };
352
+ const f = fixture(
353
+ undefined,
354
+ undefined,
355
+ undefined,
356
+ undefined,
357
+ undefined,
358
+ status,
359
+ );
360
+ await expect(
361
+ f.owner("apps.buildWorkflowRun", { runId: "run_manual" }),
362
+ ).resolves.toEqual({ ...status, input: null });
363
+ });
364
+
365
+ it("reads build Workflow status from a newer host without exposing its added fields", async () => {
366
+ const status = {
367
+ runId: "run_manual",
368
+ planDigest: "sha256:" + "d".repeat(64),
369
+ outcome: "active",
370
+ title: "Build on merge",
371
+ input: { repo: "my-fork" },
372
+ status: "running",
373
+ events: [],
374
+ reviews: [],
375
+ output: null,
376
+ error: null,
377
+ };
378
+ const f = fixture(undefined, undefined, undefined, undefined, undefined, {
379
+ ...status,
380
+ startedBy: { kind: "member", memberId: "Levi" },
381
+ });
382
+ await expect(
383
+ f.owner("apps.buildWorkflowRun", { runId: "run_manual" }),
384
+ ).resolves.toEqual(status);
385
+ });
386
+
387
+ it("preserves a host refusal while reading build Workflow status", async () => {
388
+ const f = fixture(undefined, undefined, undefined, undefined, undefined, {
389
+ error: "not_granted",
390
+ });
391
+ await expect(
392
+ f.owner("apps.buildWorkflowRun", { runId: "run_manual" }),
393
+ ).resolves.toEqual({ error: "not_granted" });
394
+ });
395
+
338
396
  it("the owner action starts the retained build/verify/install Workflow with its edited target", async () => {
339
397
  const f = fixture();
340
398
  const input = {