@fungi.computer/oyster 0.47.4 → 0.48.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 (41) hide show
  1. package/README.md +8 -0
  2. package/dist/apps/index.d.ts +1 -0
  3. package/dist/apps/index.js +1 -0
  4. package/dist/apps/install-confirmation.d.ts +26 -0
  5. package/dist/apps/install-confirmation.js +28 -0
  6. package/dist/apps/installation.d.ts +6 -0
  7. package/dist/apps/installation.js +12 -7
  8. package/dist/boot-host-script.js +1 -1
  9. package/dist/build/job-log.d.ts +2 -0
  10. package/dist/build/job-log.js +16 -1
  11. package/dist/cloudflare.d.ts +11 -1
  12. package/dist/cloudflare.js +5 -4
  13. package/dist/embed-metafiles.js +2 -2
  14. package/dist/embed-scripts.js +1 -1
  15. package/dist/frame-failure.d.ts +47 -0
  16. package/dist/frame-failure.js +75 -0
  17. package/dist/hello-app-script.js +1 -1
  18. package/dist/host.d.ts +5 -1
  19. package/dist/host.js +61 -15
  20. package/dist/install-release-cli.d.ts +1 -1
  21. package/dist/install-release-cli.js +73 -24
  22. package/dist/pack.d.ts +52 -1
  23. package/dist/pack.js +54 -11
  24. package/dist/page/app-permissions.js +2 -5
  25. package/dist/page/mount.js +2 -5
  26. package/dist/page-script.js +2 -2
  27. package/dist/standalone/agents.d.ts +1 -1
  28. package/dist/standalone/agents.js +1 -4
  29. package/dist/standalone/computer.d.ts +10 -0
  30. package/dist/standalone/computer.js +43 -1
  31. package/dist/starter-agent.d.ts +1 -3
  32. package/dist/starter-agent.js +4 -8
  33. package/dist/workers.d.ts +4 -0
  34. package/dist/workers.js +28 -1
  35. package/docs/api/apps.md +53 -0
  36. package/docs/api/cloudflare.md +151 -4
  37. package/docs/api/host.md +2 -0
  38. package/docs/api/pack.md +131 -3
  39. package/docs/api/workers-git.md +1 -1
  40. package/docs/api/workers.md +13 -0
  41. package/package.json +12 -12
@@ -702,7 +702,7 @@ export declare const agentFrameMethods: {
702
702
  readonly kind: "workflow-review";
703
703
  readonly installationId: string;
704
704
  readonly workflowId: string | null;
705
- readonly state: "pending" | "closed" | "delivered" | "answered" | "timed_out";
705
+ readonly state: "pending" | "timed_out" | "closed" | "delivered" | "answered";
706
706
  readonly workflowTitle: string;
707
707
  readonly reviewTitle: string;
708
708
  readonly reviewers: "owners" | "runner";
@@ -1505,7 +1505,6 @@ export class StandaloneAgentBase extends ShiitakeDO {
1505
1505
  roster: [
1506
1506
  ...extensions.roster,
1507
1507
  homeExtension({
1508
- instructionsRoot: "",
1509
1508
  computers: {
1510
1509
  prepare: async () => {
1511
1510
  await this.preparedComputerSnapshot();
@@ -2798,9 +2797,7 @@ export function standaloneAgents(env, scope) {
2798
2797
  // AGENTS.md. A Home the owner already wrote to is left as it is. With
2799
2798
  // no Home, the same section stays on the Agent until it has one.
2800
2799
  seedHome: async (agentId) => {
2801
- await seedStarterHome("AGENTS.md", async (path, content) => {
2802
- if (path !== "AGENTS.md")
2803
- throw new Error(`The starter seeds only AGENTS.md, not ${path}`);
2800
+ await seedStarterHome(async (content) => {
2804
2801
  const result = await env.AGENTS.getByName(agentId).replaceInstructions(JSON.stringify(principal), null, content);
2805
2802
  if (!("error" in result))
2806
2803
  return;
@@ -97,6 +97,16 @@ export declare class ComputerDO extends NativeComputerDO implements ComputerFetc
97
97
  #private;
98
98
  private readonly previewBindings;
99
99
  constructor(state: DurableObjectState, previewBindings: StandaloneComputerOwnerEnv);
100
+ /**
101
+ * Once per Computer, copy an owner's Home AGENTS.md from the Workspace root,
102
+ * where the owner editor used to write it and no guest could see it, to
103
+ * /workspace/AGENTS.md, the file an Agent's relative path names. The root copy
104
+ * is kept. The copy pulls every attached guest first and happens only while
105
+ * /workspace/AGENTS.md is absent: when both exist, nothing changes, the
106
+ * conflict is logged and the Agent uses the /workspace file. A guest that
107
+ * cannot be pulled leaves the marker unset, so the next request tries again.
108
+ */
109
+ protected prepareFiles(): Promise<void>;
100
110
  /**
101
111
  * The configured Computer predates the name record, and the container's
102
112
  * object-id reconnect wakes it nameless after every redeploy; it learns its
@@ -1,3 +1,4 @@
1
+ import { agentWorkspacePath } from "@fungi.computer/computer/files";
1
2
  import { PortAccessError } from "@fungi.computer/computer/port-access";
2
3
  import { attachedBackendId, computerSizeSchema, defaultComputerSize, hostedBackingSchema, } from "@fungi.computer/computer/backing";
3
4
  import { appMethodRefusalStatus, appMethodRefusedReplySchema, } from "@fungi.computer/agar/backend";
@@ -140,6 +141,8 @@ export function standaloneComputerSize(sql) {
140
141
  ? defaultComputerSize
141
142
  : computerSizeSchema.parse(row.size);
142
143
  }
144
+ /** Set once the Workspace root's Home AGENTS.md has been copied under /workspace. */
145
+ const homeInstructionsRootMarker = "home-instructions-root:v1";
143
146
  /** Durable workspace and existing backings, with fleet checks at native acceptance. */
144
147
  export class ComputerDO extends NativeComputerDO {
145
148
  previewBindings;
@@ -155,6 +158,45 @@ export class ComputerDO extends NativeComputerDO {
155
158
  });
156
159
  this.previewBindings = previewBindings;
157
160
  }
161
+ #homeInstructionsCopied;
162
+ #homeInstructionsDone = false;
163
+ /**
164
+ * Once per Computer, copy an owner's Home AGENTS.md from the Workspace root,
165
+ * where the owner editor used to write it and no guest could see it, to
166
+ * /workspace/AGENTS.md, the file an Agent's relative path names. The root copy
167
+ * is kept. The copy pulls every attached guest first and happens only while
168
+ * /workspace/AGENTS.md is absent: when both exist, nothing changes, the
169
+ * conflict is logged and the Agent uses the /workspace file. A guest that
170
+ * cannot be pulled leaves the marker unset, so the next request tries again.
171
+ */
172
+ async prepareFiles() {
173
+ if (this.#homeInstructionsDone)
174
+ return;
175
+ this.#homeInstructionsCopied ??= this.#copyHomeInstructions().finally(() => {
176
+ this.#homeInstructionsCopied = undefined;
177
+ });
178
+ await this.#homeInstructionsCopied;
179
+ }
180
+ async #copyHomeInstructions() {
181
+ try {
182
+ if ((await this.state.storage.get(homeInstructionsRootMarker)) !== undefined) {
183
+ this.#homeInstructionsDone = true;
184
+ return;
185
+ }
186
+ const copied = await this.copyWorkspaceFileIfFree("/AGENTS.md", agentWorkspacePath("AGENTS.md"));
187
+ if (copied === "unknown")
188
+ return;
189
+ if (copied === "conflict")
190
+ console.warn("home-instructions-root-conflict", {
191
+ computerId: this.#id(),
192
+ });
193
+ await this.state.storage.put(homeInstructionsRootMarker, true);
194
+ this.#homeInstructionsDone = true;
195
+ }
196
+ catch (cause) {
197
+ console.error("Home AGENTS.md copy under /workspace failed", cause);
198
+ }
199
+ }
158
200
  /**
159
201
  * The configured Computer predates the name record, and the container's
160
202
  * object-id reconnect wakes it nameless after every redeploy; it learns its
@@ -766,7 +808,7 @@ export function standaloneWorkspace(env, keysLive, selectedComputerId = env.OYST
766
808
  */
767
809
  export function standaloneHomeInstructionsFile(computer, computerId, actor) {
768
810
  const authority = grant(computerId, actor);
769
- const path = "/AGENTS.md";
811
+ const path = agentWorkspacePath("AGENTS.md");
770
812
  return {
771
813
  read: async () => {
772
814
  const bytes = await computer.fileRead(authority, path);
@@ -14,9 +14,7 @@ export declare const starterAgent: {
14
14
  readonly requestId: "starter-agent:v1";
15
15
  };
16
16
  /** Seed only a missing Home file; the host supplies an atomic create-if-absent. */
17
- export declare function seedStarterHome(
18
- /** Where this host keeps Home's AGENTS.md. */
19
- instructionsPath: string, writeIfMissing: (path: string, content: string) => Promise<void>): Promise<void>;
17
+ export declare function seedStarterHome(writeIfMissing: (content: string) => Promise<void>): Promise<void>;
20
18
  /** Why the last create or Home seed attempt failed, in plain words. */
21
19
  export type StarterFailure = Readonly<{
22
20
  reason: string;
@@ -6,21 +6,17 @@ export const starterAgent = {
6
6
  requestId: "starter-agent:v1",
7
7
  };
8
8
  /** Seed only a missing Home file; the host supplies an atomic create-if-absent. */
9
- export async function seedStarterHome(
10
- /** Where this host keeps Home's AGENTS.md. */
11
- instructionsPath, writeIfMissing) {
12
- await writeIfMissing(instructionsPath, starterHomeInstructions(`computer://home/${instructionsPath.replace(/^\//u, "")}`));
9
+ export async function seedStarterHome(writeIfMissing) {
10
+ await writeIfMissing(starterHomeInstructions);
13
11
  }
14
12
  /**
15
13
  * The Home AGENTS.md a new Team's Agent starts with. It says nothing about
16
14
  * money; the person and the Agent both edit it from here on.
17
15
  */
18
- const starterHomeInstructions = (
19
- /** Where Home's AGENTS.md is read from on this host, as the Agent names it. */
20
- location) => `# Shiitake's instructions
16
+ const starterHomeInstructions = `# Shiitake's instructions
21
17
 
22
18
  These are my standing instructions. They live on my Computer at
23
- ${location} and load at the start of every conversation. My
19
+ computer://home/AGENTS.md and load at the start of every conversation. My
24
20
  person and I both edit this file.
25
21
 
26
22
  ## First conversation
package/dist/workers.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { ApprovalListInput, ApprovalAnswerInput, AutoApproveInput } from "@fungi.computer/approvals";
2
2
  import type { HostActor, AppMethodCallContext } from "@fungi.computer/puffball/app";
3
3
  import { type OysterApprovalCall } from "./approval-home.js";
4
+ import { type FrameFailureSlot } from "./frame-failure.js";
4
5
  import { type BootCapabilityGrant, type BootCapabilityLease } from "./boot-capability.js";
5
6
  import { type Installation } from "./apps/installation.js";
6
7
  import { type UiBootCheckOutcome } from "./boot-gate.js";
@@ -33,6 +34,7 @@ import type { AppApi } from "@fungi.computer/puffball";
33
34
  import type { AppDeclaration } from "@fungi.computer/puffball/app";
34
35
  import { createOysterAppSourceReceipts, createOysterAppRegistrations, createOysterArtifactsRepositoryMetadataStore } from "./app-sources.js";
35
36
  export { r2ArtifactStore, r2FileSource, ownerKeyAuth };
37
+ export type { FrameFailure, FrameFailureSlot } from "./frame-failure.js";
36
38
  /** Native values returned by the standalone Git, event and JSON binding owners. */
37
39
  export type OysterBindingResult = Awaited<ReturnType<GitBinding[keyof GitBinding]>> | Schema.Json | undefined;
38
40
  /** Verified backend custody is captured in the frame, never in a current-context field. */
@@ -42,6 +44,8 @@ export type OysterInvocationHost = BackgroundFrameState & Readonly<{
42
44
  count: number;
43
45
  ms: number;
44
46
  };
47
+ /** The reason this frame's own owner failed it, read when its guest call rejects. */
48
+ failure: FrameFailureSlot;
45
49
  artifact: Backend;
46
50
  declaration: AppDeclaration | null;
47
51
  /** The verified declared method; opaque backend and lifecycle frames have none. */
package/dist/workers.js CHANGED
@@ -3,6 +3,7 @@ import { createInstallationStoreGeneration } from "./installation-store-generati
3
3
  import { OysterApprovalHome, } from "./approval-home.js";
4
4
  import { timingSafeEqual } from "node:crypto";
5
5
  import { z } from "zod";
6
+ import { FrameFailureError, createFrameFailureSlot, decodeBindingReply, } from "./frame-failure.js";
6
7
  import { bootCapabilityGrantSchema, bootCapabilityLeaseSchema, reportBootPage, validateCapabilityAssetSet, } from "./boot-capability.js";
7
8
  import { serveBootCapability } from "./boot-capability-route.js";
8
9
  import { installationSchema, isCommittedInstallation, } from "./apps/installation.js";
@@ -528,6 +529,21 @@ function result(run) {
528
529
  causeClass: causeClass(error),
529
530
  code: error.code,
530
531
  };
532
+ if (error instanceof FrameFailureError) {
533
+ console.error("AppInstance failure", {
534
+ stage: "instance_operation",
535
+ code: "failed",
536
+ reason: error.failure.reason,
537
+ ref: error.ref,
538
+ });
539
+ return {
540
+ ok: false,
541
+ causeClass: causeClass(error),
542
+ code: "failed",
543
+ reason: error.failure.reason,
544
+ ref: error.ref,
545
+ };
546
+ }
531
547
  const diagnostic = failureDiagnostic(error);
532
548
  console.error("AppInstance failure", {
533
549
  stage: "instance_operation",
@@ -939,7 +955,7 @@ export class OysterInstance extends DurableObject {
939
955
  if (this.frames.active(props.frameId) !== frame)
940
956
  throw new AppInstanceError("revoked");
941
957
  assertBackgroundBinding(frame, props.binding);
942
- return descriptor.decodeResult(result);
958
+ return decodeBindingReply(descriptor, { binding: props.binding, method }, result, frame.host.failure, { frameId: frame.frameId });
943
959
  }
944
960
  /** Last provider-accepted ref recorded by this installation's journal. */
945
961
  async gitTip(installationId, repository, ref, tenantId = defaultTenant) {
@@ -1063,6 +1079,7 @@ export class OysterInstance extends DurableObject {
1063
1079
  }
1064
1080
  let host = {
1065
1081
  bindingWaits: { count: 0, ms: 0 },
1082
+ failure: createFrameFailureSlot(),
1066
1083
  artifact: { release, ...resolved },
1067
1084
  declaration: resolved.declaration,
1068
1085
  origin: "unchecked",
@@ -1073,12 +1090,22 @@ export class OysterInstance extends DurableObject {
1073
1090
  // checks them against the owner state the host applied to it, never by
1074
1091
  // calling back up to the registry.
1075
1092
  let admitted = verified;
1093
+ let frameRef = "";
1076
1094
  try {
1077
1095
  return await this.frames.run(scoped, host, (frame) => {
1078
1096
  admitted = Date.now();
1097
+ frameRef = frame.frameId;
1079
1098
  return work(this.runtimeFor(limits), frame);
1080
1099
  });
1081
1100
  }
1101
+ catch (cause) {
1102
+ const failure = host.failure.read();
1103
+ // A typed refusal already says why; only a generic rejection takes the
1104
+ // host's own recorded reason.
1105
+ if (failure === undefined || cause instanceof AppInstanceError)
1106
+ throw cause;
1107
+ throw new FrameFailureError(failure, frameRef, { cause });
1108
+ }
1082
1109
  finally {
1083
1110
  reportSlowInvocation(methodName ?? facts.subject.kind, host, {
1084
1111
  entered,
package/docs/api/apps.md CHANGED
@@ -338,6 +338,38 @@ admission.
338
338
 
339
339
  ---
340
340
 
341
+ ### InstallConfirmationLine
342
+
343
+ ```ts
344
+ type InstallConfirmationLine = Readonly<{
345
+ capability: AppCapabilityId;
346
+ label: string;
347
+ description: string;
348
+ warning: string | null;
349
+ apps: readonly string[];
350
+ }>;
351
+ ```
352
+
353
+ One declared permission as the install confirmation words it.
354
+
355
+ ---
356
+
357
+ ### InstallConfirmation
358
+
359
+ ```ts
360
+ type InstallConfirmation = Readonly<{
361
+ granted: readonly InstallConfirmationLine[];
362
+ needsApproval: readonly InstallConfirmationLine[];
363
+ }>;
364
+ ```
365
+
366
+ Every permission an install declares, once, for one confirmation. `granted` is
367
+ what confirming approves; `needsApproval` is what stays refused until an owner
368
+ approves it. Both come from the rule the install reducer applies, so the list
369
+ cannot promise more or less than the install does.
370
+
371
+ ---
372
+
341
373
  ### ResourceRef
342
374
 
343
375
  ```ts
@@ -1862,6 +1894,27 @@ stay outside this pure gate.
1862
1894
 
1863
1895
  ---
1864
1896
 
1897
+ ### installConfirmation()
1898
+
1899
+ ```ts
1900
+ function installConfirmation(role, apps): InstallConfirmation;
1901
+ ```
1902
+
1903
+ Merge any number of Apps into one combined, once-per-permission list.
1904
+
1905
+ #### Parameters
1906
+
1907
+ | Parameter | Type |
1908
+ | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
1909
+ | `role` | `"member"` \| `"owner"` \| `"admin"` \| `null` |
1910
+ | `apps` | readonly `Readonly`\<\{ `name`: `string`; `capabilities`: readonly ( \| `"computer.list"` \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \| `"approvals"` \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \| `"agent.avatar"` \| `"agent.instructions"` \| `"agent.toolPolicy"` \| `"agent.read"` \| `"agent.send"` \| `"llm.generation"` \| `"media.generation"` \| `"media.share"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"` \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \| `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \| `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \| `"channels.read"` \| `"channels.personal.manage"`)[]; \}\>[] |
1911
+
1912
+ #### Returns
1913
+
1914
+ [`InstallConfirmation`](#installconfirmation)
1915
+
1916
+ ---
1917
+
1865
1918
  ### applyGrantCommand()
1866
1919
 
1867
1920
  ```ts
@@ -161,6 +161,39 @@ Method descriptors for the closed App binding vocabulary.
161
161
 
162
162
  ---
163
163
 
164
+ ### FrameBindingEntrypointMethod
165
+
166
+ ```ts
167
+ type FrameBindingEntrypointMethod = Omit<
168
+ FrameBindingMethod<unknown>,
169
+ "decodeResult"
170
+ >;
171
+ ```
172
+
173
+ What the binding entrypoint needs of a method: its argument grammar and
174
+ operation policy. It never decodes a reply; the frame owner does, with the full
175
+ [FrameBindingMethod](#framebindingmethod).
176
+
177
+ ---
178
+
179
+ ### FrameBindingEntrypointMethods
180
+
181
+ ```ts
182
+ type FrameBindingEntrypointMethods = Readonly<
183
+ Partial<
184
+ Record<
185
+ AppBackendBindingName,
186
+ Readonly<Record<string, FrameBindingEntrypointMethod>>
187
+ >
188
+ >
189
+ >;
190
+ ```
191
+
192
+ The entrypoint's view of [FrameBindingMethods](#framebindingmethods): no reply
193
+ decoders.
194
+
195
+ ---
196
+
164
197
  ### AppFacetStub
165
198
 
166
199
  ```ts
@@ -303,6 +336,44 @@ wrap.
303
336
 
304
337
  ---
305
338
 
339
+ ### FrameFailure
340
+
341
+ ```ts
342
+ type FrameFailure = Readonly<{
343
+ reason: Extract<AppFailureReason, "binding_reply_invalid">;
344
+ binding: string;
345
+ method: string;
346
+ path: string;
347
+ }>;
348
+ ```
349
+
350
+ Why one invocation failed on the host's side, written by the frame owner and
351
+ read by the same invocation when its guest call rejects. Only host-known names
352
+ and a field path: a failure that crossed the guest facet is never trusted for
353
+ text.
354
+
355
+ ---
356
+
357
+ ### FrameFailureSlot
358
+
359
+ ```ts
360
+ type FrameFailureSlot = Readonly<{
361
+ record: void;
362
+ read:
363
+ | Readonly<{
364
+ reason: Extract<AppFailureReason, "binding_reply_invalid">;
365
+ binding: string;
366
+ method: string;
367
+ path: string;
368
+ }>
369
+ | undefined;
370
+ }>;
371
+ ```
372
+
373
+ One slot per invocation; the first host failure wins.
374
+
375
+ ---
376
+
306
377
  ### GuestLimits
307
378
 
308
379
  ```ts
@@ -627,10 +698,10 @@ One native binding factory for both Hub and standalone, preserving RPC values.
627
698
 
628
699
  #### Parameters
629
700
 
630
- | Parameter | Type |
631
- | ---------- | --------------------------------------------------------------------------------------------------------- |
632
- | `methods` | [`FrameBindingMethods`](#framebindingmethods)\<`Result`\> |
633
- | `dispatch` | (`env`, `props`, `method`, `args`) => `Promise`\<[`FrameBindingReply`](#framebindingreply)\<`unknown`\>\> |
701
+ | Parameter | Type |
702
+ | ---------- | -------------------------------------------------------------------------------------------------------- |
703
+ | `methods` | [`FrameBindingEntrypointMethods`](#framebindingentrypointmethods) |
704
+ | `dispatch` | (`env`, `props`, `method`, `args`) => `Promise`\<[`FrameBindingReply`](#framebindingreply)\<`Result`\>\> |
634
705
 
635
706
  #### Returns
636
707
 
@@ -756,6 +827,82 @@ Guest code gets only host gatekeeper bindings and no ambient outbound access.
756
827
 
757
828
  [`AppInstance`](index.md#appinstance)\<`Host`\>
758
829
 
830
+ ---
831
+
832
+ ### createFrameFailureSlot()
833
+
834
+ ```ts
835
+ function createFrameFailureSlot(): FrameFailureSlot;
836
+ ```
837
+
838
+ A fresh, empty failure slot for one invocation.
839
+
840
+ #### Returns
841
+
842
+ [`FrameFailureSlot`](#framefailureslot)
843
+
844
+ ---
845
+
846
+ ### rejectedFieldPath()
847
+
848
+ ```ts
849
+ function rejectedFieldPath(cause): string;
850
+ ```
851
+
852
+ The field a reply decoder rejected: the deepest path among its (nested union)
853
+ issues.
854
+
855
+ #### Parameters
856
+
857
+ | Parameter | Type |
858
+ | --------- | ------- |
859
+ | `cause` | `Error` |
860
+
861
+ #### Returns
862
+
863
+ `string`
864
+
865
+ ---
866
+
867
+ ### decodeBindingReply()
868
+
869
+ ```ts
870
+ function decodeBindingReply<Result>(
871
+ descriptor,
872
+ call,
873
+ reply,
874
+ failure,
875
+ logged,
876
+ ): Result;
877
+ ```
878
+
879
+ Decode one connection reply with its method's descriptor: the only place a reply
880
+ is decoded, where it first arrives and the frame that asked is in hand. A reply
881
+ the descriptor rejects is our bug, not the App's: it is recorded on the frame
882
+ (and named in the log, never its values) before the exception reaches the guest,
883
+ which cannot be trusted to say why. `logged` names the frame and invocation in
884
+ that log line.
885
+
886
+ #### Type Parameters
887
+
888
+ | Type Parameter |
889
+ | -------------- |
890
+ | `Result` |
891
+
892
+ #### Parameters
893
+
894
+ | Parameter | Type |
895
+ | ------------ | ----------------------------------------------------------------------------------- |
896
+ | `descriptor` | `Pick`\<[`FrameBindingMethod`](#framebindingmethod)\<`Result`\>, `"decodeResult"`\> |
897
+ | `call` | `Readonly`\<\{ `binding`: `string`; `method`: `string`; \}\> |
898
+ | `reply` | `unknown` |
899
+ | `failure` | [`FrameFailureSlot`](#framefailureslot) |
900
+ | `logged` | `Readonly`\<`Record`\<`string`, `string` \| `null`\>\> |
901
+
902
+ #### Returns
903
+
904
+ `Result`
905
+
759
906
  ## References
760
907
 
761
908
  ### BackgroundFrameState
package/docs/api/host.md CHANGED
@@ -256,6 +256,8 @@ type InstanceResult<T> =
256
256
  | "AbortError"
257
257
  | "TimeoutError"
258
258
  | "Other";
259
+ reason?: AppFailureReason;
260
+ ref?: string;
259
261
  }>;
260
262
  ```
261
263
 
package/docs/api/pack.md CHANGED
@@ -317,6 +317,134 @@ retains its original lifetime.
317
317
 
318
318
  ---
319
319
 
320
+ ### previewRelease()
321
+
322
+ ```ts
323
+ function previewRelease(input): Promise<{
324
+ name: string;
325
+ capabilities: readonly (
326
+ | "computer.list"
327
+ | "computer.readFile"
328
+ | "computer.writeFile"
329
+ | "computer.execute"
330
+ | "approvals"
331
+ | "agent.list"
332
+ | "agent.manage"
333
+ | "agent.rename"
334
+ | "agent.avatar"
335
+ | "agent.instructions"
336
+ | "agent.toolPolicy"
337
+ | "agent.read"
338
+ | "agent.send"
339
+ | "llm.generation"
340
+ | "media.generation"
341
+ | "media.share"
342
+ | "games:servers"
343
+ | "git.repository"
344
+ | "apps.open"
345
+ | "apps.call"
346
+ | "app.storage"
347
+ | "app.events.emit"
348
+ | "team.workbenchHost"
349
+ | "marketplace.browse"
350
+ | "marketplace.purchase"
351
+ | "workflow.run"
352
+ | "workflow.publish"
353
+ | "workflow.arm"
354
+ | "world"
355
+ | "channels.read"
356
+ | "channels.personal.manage"
357
+ )[];
358
+ update: {
359
+ installationId: string;
360
+ needsApproval: readonly (
361
+ | "computer.list"
362
+ | "computer.readFile"
363
+ | "computer.writeFile"
364
+ | "computer.execute"
365
+ | "approvals"
366
+ | "agent.list"
367
+ | "agent.manage"
368
+ | "agent.rename"
369
+ | "agent.avatar"
370
+ | "agent.instructions"
371
+ | "agent.toolPolicy"
372
+ | "agent.read"
373
+ | "agent.send"
374
+ | "llm.generation"
375
+ | "media.generation"
376
+ | "media.share"
377
+ | "games:servers"
378
+ | "git.repository"
379
+ | "apps.open"
380
+ | "apps.call"
381
+ | "app.storage"
382
+ | "app.events.emit"
383
+ | "team.workbenchHost"
384
+ | "marketplace.browse"
385
+ | "marketplace.purchase"
386
+ | "workflow.run"
387
+ | "workflow.publish"
388
+ | "workflow.arm"
389
+ | "world"
390
+ | "channels.read"
391
+ | "channels.personal.manage"
392
+ )[];
393
+ } | null;
394
+ release: {
395
+ releaseId: ReleaseId;
396
+ appId: AppId;
397
+ artifact: {
398
+ artifactRef: ArtifactRef;
399
+ artifactDigest: Sha256Digest;
400
+ provenance: {
401
+ sourceRevision: SourceRevision;
402
+ sourceTreeDigest: Sha256Digest;
403
+ buildRecipeDigest: Sha256Digest;
404
+ };
405
+ };
406
+ };
407
+ }>;
408
+ ```
409
+
410
+ Upload one built Release and ask the Oyster what installing it would request, so
411
+ an owner can confirm several Releases once before any install.
412
+
413
+ #### Parameters
414
+
415
+ | Parameter | Type |
416
+ | --------- | --------------------------------------------------------------------------------------------------------- |
417
+ | `input` | `Readonly`\<\{ `directory`: `string`; `url`: `string`; `key`: `string`; `installationId?`: `string`; \}\> |
418
+
419
+ #### Returns
420
+
421
+ `Promise`\<\{ `name`: `string`; `capabilities`: readonly ( \| `"computer.list"`
422
+ \| `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \|
423
+ `"approvals"` \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \|
424
+ `"agent.avatar"` \| `"agent.instructions"` \| `"agent.toolPolicy"` \|
425
+ `"agent.read"` \| `"agent.send"` \| `"llm.generation"` \| `"media.generation"`
426
+ \| `"media.share"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"`
427
+ \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \|
428
+ `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \|
429
+ `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \|
430
+ `"channels.read"` \| `"channels.personal.manage"`)[]; `update`: \| \{
431
+ `installationId`: `string`; `needsApproval`: readonly ( \| `"computer.list"` \|
432
+ `"computer.readFile"` \| `"computer.writeFile"` \| `"computer.execute"` \|
433
+ `"approvals"` \| `"agent.list"` \| `"agent.manage"` \| `"agent.rename"` \|
434
+ `"agent.avatar"` \| `"agent.instructions"` \| `"agent.toolPolicy"` \|
435
+ `"agent.read"` \| `"agent.send"` \| `"llm.generation"` \| `"media.generation"`
436
+ \| `"media.share"` \| `"games:servers"` \| `"git.repository"` \| `"apps.open"`
437
+ \| `"apps.call"` \| `"app.storage"` \| `"app.events.emit"` \|
438
+ `"team.workbenchHost"` \| `"marketplace.browse"` \| `"marketplace.purchase"` \|
439
+ `"workflow.run"` \| `"workflow.publish"` \| `"workflow.arm"` \| `"world"` \|
440
+ `"channels.read"` \| `"channels.personal.manage"`)[]; \} \| `null`; `release`:
441
+ \{ `releaseId`: `ReleaseId`; `appId`: `AppId`; `artifact`: \{ `artifactRef`:
442
+ `ArtifactRef`; `artifactDigest`: `Sha256Digest`; `provenance`: \{
443
+ `sourceRevision`: `SourceRevision`; `sourceTreeDigest`: `Sha256Digest`;
444
+ `buildRecipeDigest`: `Sha256Digest`; \}; \}; \}; \}\>
445
+
446
+ ---
447
+
320
448
  ### installRelease()
321
449
 
322
450
  ```ts
@@ -333,9 +461,9 @@ is reported as an unconfirmed observation, not refusal.
333
461
 
334
462
  #### Parameters
335
463
 
336
- | Parameter | Type |
337
- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
338
- | `input` | `Readonly`\<\{ `directory`: `string`; `url`: `string`; `key`: `string`; `installationId?`: `string`; `onAdmitted?`: (`operation`) => `void`; `onCompleted?`: (`operation`) => `Promise`\<`void`\>; \}\> & `Readonly`\<\{ `waitMs?`: `number`; `signal?`: `AbortSignal`; \}\> |
464
+ | Parameter | Type |
465
+ | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
466
+ | `input` | `Readonly`\<\{ `directory`: `string`; `url`: `string`; `key`: `string`; `installationId?`: `string`; `uploaded?`: \{ `releaseId`: `ReleaseId`; `appId`: `AppId`; `artifact`: \{ `artifactRef`: `ArtifactRef`; `artifactDigest`: `Sha256Digest`; `provenance`: \{ `sourceRevision`: `SourceRevision`; `sourceTreeDigest`: `Sha256Digest`; `buildRecipeDigest`: `Sha256Digest`; \}; \}; \}; `onAdmitted?`: (`operation`) => `void`; `onCompleted?`: (`operation`) => `Promise`\<`void`\>; \}\> & `Readonly`\<\{ `waitMs?`: `number`; `signal?`: `AbortSignal`; \}\> |
339
467
 
340
468
  #### Returns
341
469