@fungi.computer/oyster 0.8.1 → 0.9.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.
@@ -19718,6 +19718,7 @@ var appCapabilityIds = [
19718
19718
  "computer.execute",
19719
19719
  "llm.generation",
19720
19720
  "media.generation",
19721
+ "media.share",
19721
19722
  "games:servers",
19722
19723
  "git.repository",
19723
19724
  "apps.open",
package/dist/host.d.ts CHANGED
@@ -149,13 +149,16 @@ export type CapabilityAdmission = Readonly<{
149
149
  export type CapabilityEnv = {
150
150
  Bindings: CapabilityAdmission;
151
151
  };
152
- /** A capability adapter whose routes require live installation admission. */
152
+ /** An App capability adapter, with an optional narrow owner-direct table. */
153
153
  export type OysterCapability = Readonly<CapabilityDescriptor & {
154
154
  /** The permission declared by an App Release to use this contract. */
155
155
  permission: AppCapabilityId;
156
156
  /** Declared routes relative to the descriptor's base path; each names
157
157
  * its own requirement beyond the App holding this capability. */
158
158
  routes: Routes<CapabilityEnv>;
159
+ /** An explicit owner-only capability table, available without an App
160
+ * installation. It must not include the App's broader transport routes. */
161
+ ownerDirect?: Routes<OysterEnv>;
159
162
  }>;
160
163
  /** The host table's Hono env; every route receives its principal from its declared requirement. */
161
164
  export type OysterEnv = {
package/dist/host.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { hostGateFacts, releaseCache } from "./internal/host-gate.js";
2
- import { InstallationOperationError, installationCommandIds, installationRequestIdSchema, } from "./installation-operations.js";
2
+ import { InstallationOperationError, installationCommandIds, installationRequestIdSchema, installationWaitQuerySchema, maxSettlementWaitMs, } from "./installation-operations.js";
3
3
  import { completedInstallationResponse, observeInstallation, InstallationObservationError, } from "./installation-client.js";
4
4
  import { instanceRefusalBody, instanceRefusalStatus, } from "./instance-refusal.js";
5
5
  import { appSandbox } from "./app-sandbox.js";
@@ -168,7 +168,7 @@ export async function installOrSelect(host, installationId, release, principal,
168
168
  return completedInstallationResponse(await observeInstallation({
169
169
  requestId,
170
170
  initial: admitted,
171
- read: () => operations.read(requestId, installationId),
171
+ read: () => operations.awaitSettled(requestId, installationId, maxSettlementWaitMs),
172
172
  signal,
173
173
  }));
174
174
  }
@@ -466,6 +466,15 @@ export function oysterRouteTable(host) {
466
466
  candidates.some((route) => route.kind === "transport");
467
467
  const installationId = context.req.header("X-Oyster-Installation") ??
468
468
  (browserTransport ? url.searchParams.get("oysterInstallation") : null);
469
+ // A direct owner capability is a separate, narrow table. Never lend an
470
+ // owner's role to the ordinary App table or skip an App's installation gate.
471
+ if (installationId === null) {
472
+ const direct = candidates.find(({ capability }) => capability.ownerDirect);
473
+ if (direct?.capability.ownerDirect !== undefined) {
474
+ url.pathname = "/" + url.pathname.slice(direct.capability.base.length);
475
+ return serveHost(direct.capability.ownerDirect, () => Promise.resolve({ kind: "admitted", principal }), ports).fetch(new Request(url, context.req.raw));
476
+ }
477
+ }
469
478
  const installation = installationId === null
470
479
  ? null
471
480
  : await host.installations.get(installationId);
@@ -640,11 +649,18 @@ export function oysterRouteTable(host) {
640
649
  const key = installationRequestIdSchema.safeParse(context.req.query("requestId"));
641
650
  if (!key.success)
642
651
  return refusal(400, "Invalid installation request identity");
652
+ const wait = installationWaitQuerySchema.safeParse(context.req.query("waitMs"));
653
+ if (!wait.success)
654
+ return refusal(400, "Invalid installation wait");
643
655
  const operations = host.installations.operations;
644
656
  if (operations === undefined)
645
657
  return refusal(503, "Installation commands unavailable");
646
658
  try {
647
- const operation = await operations.read(key.data, context.req.param("installationId"));
659
+ const installationId = context.req.param("installationId");
660
+ // With waitMs, the owner answers when it settles the command.
661
+ const operation = wait.data === undefined
662
+ ? await operations.read(key.data, installationId)
663
+ : await operations.awaitSettled(key.data, installationId, wait.data);
648
664
  return operation === null
649
665
  ? refusal(404, "Installation request not found")
650
666
  : Response.json(operation);
@@ -869,7 +885,7 @@ export function oysterRouteTable(host) {
869
885
  // desktop chrome belongs to the shell.
870
886
  return new Response(config.workbench
871
887
  ? `${head}<style>html,body,#oyster-shell{margin:0;height:100%}body{font-family:var(--font-sans)}</style><div id="oyster-shell"></div>${tail}`
872
- : `${head}<style>html,body{margin:0;height:100%}iframe{border:0;width:100%;height:100%;display:block}</style><iframe id="oyster-app" sandbox="${appSandbox}" allowfullscreen src="${escapeHtml(config.uiUrl)}" title="${escapeHtml(installation.installationId)}"></iframe>${tail}`, {
888
+ : `${head}<style>html,body{margin:0;height:100%}iframe{border:0;width:100%;height:100%;display:block}</style><iframe id="oyster-app" sandbox="${appSandbox}" allowfullscreen title="${escapeHtml(installation.installationId)}"></iframe>${tail}`, {
873
889
  headers: {
874
890
  "Content-Type": "text/html; charset=utf-8",
875
891
  "Cache-Control": "no-store",
@@ -16,14 +16,17 @@ export declare class InstallationObservationError extends Error {
16
16
  readonly requestId: string;
17
17
  constructor(requestId: string, options?: ErrorOptions);
18
18
  }
19
- /** Observe one retained command, over either HTTP or the host's decoded port. */
19
+ /**
20
+ * Observe one retained command, over either HTTP or the host's decoded port.
21
+ * Each `read` is the owner's settlement wait: it answers as soon as the owner
22
+ * settles (or admits) the command, or with the still-pending state after the
23
+ * owner's bounded wait, so this loop never sleeps between reads.
24
+ */
20
25
  export declare function observeInstallation(input: Readonly<{
21
26
  requestId: string;
22
27
  initial: InstallationOperation | null;
23
28
  read(): Promise<InstallationOperation | null>;
24
29
  signal: AbortSignal;
25
- pollMs?: number;
26
- idle?: (ms: number, signal: AbortSignal) => Promise<void>;
27
30
  }>): Promise<InstallationCompletion>;
28
31
  /** Completed HTTP meaning shared by pack and the retained PUT selection door. */
29
32
  export declare function completedInstallationResponse(operation: InstallationCompletion): Response;
@@ -36,8 +39,6 @@ export declare function installOnOyster(input: Readonly<{
36
39
  key: string;
37
40
  installationId: string;
38
41
  release: Release;
39
- pollMs?: number;
40
- idle?: (ms: number, signal: AbortSignal) => Promise<void>;
41
42
  /** Once, after the owner supplies a correlated record, even after a lost ack. */
42
43
  onAdmitted?: (operation: InstallationOperation) => void;
43
44
  }> & InstallationObservationBudget): Promise<InstallationCompletion>;
@@ -1,9 +1,8 @@
1
- import { setTimeout as sleep } from "node:timers/promises";
2
1
  import { addAbortListener } from "node:events";
3
2
  import * as Schema from "effect/Schema";
4
3
  import { releaseSchema } from "@fungi.computer/puffball/effect";
5
4
  import { instanceRefusalBody } from "./instance-refusal.js";
6
- import { installationOperationSchema, installationCommandIds, } from "./installation-operations.js";
5
+ import { installationOperationSchema, installationCommandIds, maxSettlementWaitMs, } from "./installation-operations.js";
7
6
  /**
8
7
  * Installer-owned observer budget, matching the standalone installer's existing
9
8
  * twenty-minute default. Not an App grant lifetime or a server execution limit.
@@ -26,8 +25,12 @@ export class InstallationObservationError extends Error {
26
25
  this.requestId = requestId;
27
26
  }
28
27
  }
29
- const idle = (ms, signal) => sleep(ms, undefined, { signal });
30
- /** Observe one retained command, over either HTTP or the host's decoded port. */
28
+ /**
29
+ * Observe one retained command, over either HTTP or the host's decoded port.
30
+ * Each `read` is the owner's settlement wait: it answers as soon as the owner
31
+ * settles (or admits) the command, or with the still-pending state after the
32
+ * owner's bounded wait, so this loop never sleeps between reads.
33
+ */
31
34
  export async function observeInstallation(input) {
32
35
  try {
33
36
  input.signal.throwIfAborted();
@@ -54,8 +57,6 @@ export async function observeInstallation(input) {
54
57
  listener?.[Symbol.dispose]();
55
58
  }
56
59
  input.signal.throwIfAborted();
57
- if (operation === null || operation.state === "pending")
58
- await (input.idle ?? idle)(input.pollMs ?? 5_000, input.signal);
59
60
  }
60
61
  return operation;
61
62
  }
@@ -149,26 +150,29 @@ export async function installOnOyster(input) {
149
150
  throw new InstallationObservationError(requestId);
150
151
  const statusUrl = new URL(`/api/installations/${encodeURIComponent(input.installationId)}/status`, input.url);
151
152
  statusUrl.searchParams.set("requestId", requestId);
152
- let observation = {
153
+ const settlementUrl = new URL(statusUrl);
154
+ settlementUrl.searchParams.set("waitMs", String(maxSettlementWaitMs));
155
+ // Without an acknowledgement, read once at once so the caller learns of
156
+ // its admission promptly; every later read is the owner's settlement wait.
157
+ let readOnce = false;
158
+ return await observeInstallation({
153
159
  requestId,
154
160
  initial: operation,
155
161
  signal,
156
162
  read: async () => {
163
+ const url = admitted || readOnce ? settlementUrl : statusUrl;
164
+ readOnce = true;
157
165
  // Like decoded RPC reads, transport errors reach the observer with
158
166
  // their original cause; they are not an authoritative pending read.
159
- const observed = await fetch(statusUrl, { headers, signal });
167
+ // A 404 is the owner's answer: not admitted (yet).
168
+ const observed = await fetch(url, { headers, signal });
160
169
  if (observed.status === 200)
161
170
  return decode(observed);
162
- if (observed.status !== 404 && observed.status < 500)
163
- throw new InstallationObservationError(requestId);
164
- return null;
171
+ if (observed.status === 404)
172
+ return null;
173
+ throw new InstallationObservationError(requestId);
165
174
  },
166
- };
167
- if (input.pollMs !== undefined)
168
- observation = { ...observation, pollMs: input.pollMs };
169
- if (input.idle !== undefined)
170
- observation = { ...observation, idle: input.idle };
171
- return await observeInstallation(observation);
175
+ });
172
176
  }
173
177
  catch (cause) {
174
178
  if (cause instanceof InstallationObservationError)
@@ -7,6 +7,7 @@ import { applyInstallationCommand, isCommittedInstallation, } from "./apps/insta
7
7
  import { deriveDeclaredOperations } from "./apps/operations.js";
8
8
  import { pendingCapabilities } from "./apps/permissions.js";
9
9
  import { BootGateError } from "./boot-gate.js";
10
+ import { failureDiagnostic } from "./cause-class.js";
10
11
  import { guestLimits } from "./guest-policy.js";
11
12
  import { instanceSchema, selectionOf } from "./index.js";
12
13
  import { ReleaseError, verifyRelease } from "./release.js";
@@ -22,6 +23,28 @@ const unconfirmed = {
22
23
  state: "unconfirmed",
23
24
  outcome: "outcome_unknown",
24
25
  };
26
+ /**
27
+ * Delays before each further preparation attempt. A cold Instance (first
28
+ * backend construction, a Durable Object reset or an overloaded isolate) can
29
+ * fail its first generic preparation and pass the next one.
30
+ */
31
+ const preparationRetryDelaysMs = [500, 2_000];
32
+ /** Retry only generic preparation failures; typed refusals are final. */
33
+ async function prepareWithRetry(prepare) {
34
+ for (let attempt = 1;; attempt++) {
35
+ const prepared = await prepare();
36
+ if (prepared.ok || prepared.code !== "failed")
37
+ return prepared;
38
+ console.error("Installation preparation failed", {
39
+ attempt,
40
+ causeClass: prepared.causeClass,
41
+ });
42
+ const wait = preparationRetryDelaysMs[attempt - 1];
43
+ if (wait === undefined)
44
+ return prepared;
45
+ await new Promise((resolve) => setTimeout(resolve, wait));
46
+ }
47
+ }
25
48
  /** Ordinary Worker-side verification and lifecycle I/O for one retained intent. */
26
49
  export async function executeInstallation(host, input) {
27
50
  let command = retainedInstallationCommandSchema.parse(input);
@@ -45,9 +68,13 @@ export async function executeInstallation(host, input) {
45
68
  verified = await verifyRelease(host.artifacts, command.admission.release);
46
69
  }
47
70
  catch (cause) {
48
- return cause instanceof ReleaseError
49
- ? refused(422, cause.code)
50
- : unconfirmed;
71
+ if (cause instanceof ReleaseError)
72
+ return refused(422, cause.code);
73
+ console.error("Installation release verification failed", {
74
+ requestId: command.admission.requestId,
75
+ ...failureDiagnostic(cause),
76
+ });
77
+ return unconfirmed;
51
78
  }
52
79
  if (command.plan === null) {
53
80
  const declaration = verified.declaration ?? emptyAppDeclaration;
@@ -123,16 +150,22 @@ export async function executeInstallation(host, input) {
123
150
  uiCheck = await host.bootUi(verified.release);
124
151
  }
125
152
  catch (cause) {
126
- return cause instanceof BootGateError
127
- ? refused(422, cause.code)
128
- : unconfirmed;
153
+ if (cause instanceof BootGateError)
154
+ return refused(422, cause.code);
155
+ console.error("Installation UI boot check failed", {
156
+ requestId: command.admission.requestId,
157
+ ...failureDiagnostic(cause),
158
+ });
159
+ return unconfirmed;
129
160
  }
130
161
  }
131
162
  else {
132
- const prepared = await instance.prepare(state, next.release);
163
+ const prepared = await prepareWithRetry(() => instance.prepare(state, next.release));
133
164
  if (!prepared.ok)
165
+ // Preparation never changes the active runtime and runs before the
166
+ // commit, so a generic failure here leaves the previous release live.
134
167
  return prepared.code === "failed"
135
- ? unconfirmed
168
+ ? refused(503, "installation_not_applied")
136
169
  : refused(instanceRefusalStatus(prepared.code), prepared.code);
137
170
  uiCheck = prepared.value;
138
171
  }
@@ -32,7 +32,7 @@ declare const installationOutcomeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
32
32
  authorityVersion: z.ZodLazy<z.ZodNumber>;
33
33
  declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
34
34
  approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
35
- capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "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", unknown>>;
35
+ capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "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", unknown>>;
36
36
  capabilityApproved: z.ZodLiteral<true>;
37
37
  operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
38
38
  resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
@@ -250,7 +250,7 @@ export declare const installationOperationSchema: z.ZodDiscriminatedUnion<[z.Zod
250
250
  authorityVersion: z.ZodLazy<z.ZodNumber>;
251
251
  declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
252
252
  approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
253
- capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "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", unknown>>;
253
+ capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "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", unknown>>;
254
254
  capabilityApproved: z.ZodLiteral<true>;
255
255
  operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
256
256
  resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
@@ -431,7 +431,7 @@ export declare const retainedInstallationCommandSchema: z.ZodObject<{
431
431
  authorityVersion: z.ZodLazy<z.ZodNumber>;
432
432
  declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
433
433
  approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
434
- capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "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", unknown>>;
434
+ capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "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", unknown>>;
435
435
  capabilityApproved: z.ZodLiteral<true>;
436
436
  operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
437
437
  resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
@@ -492,7 +492,7 @@ export declare const retainedInstallationCommandSchema: z.ZodObject<{
492
492
  authorityVersion: z.ZodLazy<z.ZodNumber>;
493
493
  declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
494
494
  approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
495
- capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "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", unknown>>;
495
+ capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "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", unknown>>;
496
496
  capabilityApproved: z.ZodLiteral<true>;
497
497
  operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
498
498
  resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
@@ -598,6 +598,12 @@ export type InstallationOperations = Readonly<{
598
598
  admit(input: InstallationAdmission): Promise<InstallationOperation>;
599
599
  /** The operation's current state, when it names this installation. */
600
600
  read(requestId: string, installationId: string): Promise<InstallationOperation | null>;
601
+ /**
602
+ * The operation once it leaves pending, or its current state when it is
603
+ * still pending (or not yet admitted) after at most `waitMs`. The owner
604
+ * answers the moment it settles the command; there is no caller poll.
605
+ */
606
+ awaitSettled(requestId: string, installationId: string, waitMs: number): Promise<InstallationOperation | null>;
601
607
  /** Only pending recovery is executable; terminal history returns null. */
602
608
  load(requestId: string): Promise<RetainedInstallationCommand | null>;
603
609
  /** Record the executor's one reduced installation for this command. */
@@ -605,6 +611,13 @@ export type InstallationOperations = Readonly<{
605
611
  /** Commit the planned installation against its exact baseline. */
606
612
  commit(requestId: string, uiCheck: UiBootCheckOutcome | null): Promise<InstallationCommit>;
607
613
  }>;
614
+ /**
615
+ * One owner wait's bound, under ordinary HTTP idle timeouts; an observer that
616
+ * needs longer simply waits again.
617
+ */
618
+ export declare const maxSettlementWaitMs = 25000;
619
+ /** The status door's optional `waitMs` query: whole milliseconds, bounded. */
620
+ export declare const installationWaitQuerySchema: z.ZodOptional<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<number, string>>, z.ZodNumber>>;
608
621
  declare const installationOperationRequestSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
609
622
  action: z.ZodLiteral<"admit">;
610
623
  scope: z.ZodObject<{
@@ -655,6 +668,15 @@ declare const installationOperationRequestSchema: z.ZodDiscriminatedUnion<[z.Zod
655
668
  }, z.core.$strict>;
656
669
  requestId: z.ZodString;
657
670
  installationId: z.ZodLazy<z.ZodString>;
671
+ }, z.core.$strict>, z.ZodObject<{
672
+ action: z.ZodLiteral<"await">;
673
+ scope: z.ZodObject<{
674
+ tenantId: z.ZodPipe<z.ZodUnknown, z.ZodTransform<string & import("effect/Brand").Brand<"OysterTenantId">, unknown>>;
675
+ origin: z.ZodURL;
676
+ }, z.core.$strict>;
677
+ requestId: z.ZodString;
678
+ installationId: z.ZodLazy<z.ZodString>;
679
+ waitMs: z.ZodNumber;
658
680
  }, z.core.$strict>, z.ZodObject<{
659
681
  action: z.ZodLiteral<"load">;
660
682
  scope: z.ZodObject<{
@@ -694,7 +716,7 @@ declare const installationOperationRequestSchema: z.ZodDiscriminatedUnion<[z.Zod
694
716
  authorityVersion: z.ZodLazy<z.ZodNumber>;
695
717
  declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
696
718
  approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
697
- capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "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", unknown>>;
719
+ capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "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", unknown>>;
698
720
  capabilityApproved: z.ZodLiteral<true>;
699
721
  operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
700
722
  resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
@@ -914,7 +936,7 @@ declare const installationOperationReplySchema: z.ZodDiscriminatedUnion<[z.ZodOb
914
936
  authorityVersion: z.ZodLazy<z.ZodNumber>;
915
937
  declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
916
938
  approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
917
- capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "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", unknown>>;
939
+ capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "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", unknown>>;
918
940
  capabilityApproved: z.ZodLiteral<true>;
919
941
  operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
920
942
  resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
@@ -1058,7 +1080,7 @@ declare const installationOperationReplySchema: z.ZodDiscriminatedUnion<[z.ZodOb
1058
1080
  authorityVersion: z.ZodLazy<z.ZodNumber>;
1059
1081
  declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
1060
1082
  approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1061
- capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "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", unknown>>;
1083
+ capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "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", unknown>>;
1062
1084
  capabilityApproved: z.ZodLiteral<true>;
1063
1085
  operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1064
1086
  resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{
@@ -1119,7 +1141,7 @@ declare const installationOperationReplySchema: z.ZodDiscriminatedUnion<[z.ZodOb
1119
1141
  authorityVersion: z.ZodLazy<z.ZodNumber>;
1120
1142
  declaredOperationsDigest: z.ZodPipe<z.ZodUnknown, z.ZodTransform<import("@fungi.computer/puffball").Sha256Digest, unknown>>;
1121
1143
  approvedGrants: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodReadonly<z.ZodObject<{
1122
- capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "llm.generation" | "media.generation" | "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", unknown>>;
1144
+ capability: z.ZodPipe<z.ZodUnknown, z.ZodTransform<"approvals" | "agent.list" | "agent.manage" | "agent.rename" | "agent.avatar" | "agent.toolPolicy" | "agent.read" | "agent.send" | "computer.list" | "computer.readFile" | "computer.writeFile" | "computer.execute" | "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", unknown>>;
1123
1145
  capabilityApproved: z.ZodLiteral<true>;
1124
1146
  operations: z.ZodLazy<z.ZodReadonly<z.ZodArray<z.ZodString>>>;
1125
1147
  resources: z.ZodUnion<readonly [z.ZodLiteral<"tenant-scope">, z.ZodReadonly<z.ZodArray<z.ZodLazy<z.ZodReadonly<z.ZodObject<{