@fungi.computer/oyster 0.47.3 → 0.47.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/dist/mcp.d.ts CHANGED
@@ -4,6 +4,7 @@ import type { DeclaredOperations, Installation } from "./apps/installation.js";
4
4
  import { type CapabilitySource, type Grants, type ModuleRegistration } from "@fungi.computer/mycelium";
5
5
  import { computerPageSchema } from "@fungi.computer/computer/fleet/inventory-wire";
6
6
  import { localBackendDetachSchema } from "@fungi.computer/computer/fleet/wire";
7
+ import { computerStateSchema } from "@fungi.computer/computer/fleet/wire";
7
8
  import type { InvocationContext } from "@fungi.computer/mycelium";
8
9
  import type { ComputerControlPort } from "./computer-control-port.js";
9
10
  export type { ComputerControlPort } from "./computer-control-port.js";
@@ -22,6 +23,14 @@ export declare const appApprovalInstructions: string;
22
23
  declare const fleetComputerId: z.ZodObject<{
23
24
  computerId: z.ZodString;
24
25
  }, z.core.$strict>;
26
+ /**
27
+ * `reason: true` asks for a failed start's plain-words reason. Callers that
28
+ * never ask get the state shape every released client decodes strictly.
29
+ */
30
+ declare const fleetStateRead: z.ZodObject<{
31
+ computerId: z.ZodString;
32
+ reason: z.ZodExactOptional<z.ZodLiteral<true>>;
33
+ }, z.core.$strict>;
25
34
  declare const fleetCreate: z.ZodObject<{
26
35
  name: z.ZodDefault<z.ZodNullable<z.ZodString>>;
27
36
  size: z.ZodDefault<z.ZodNullable<z.ZodEnum<{
@@ -145,25 +154,25 @@ export declare function computerControlSpecs(port: ComputerControlPort): {
145
154
  description: string;
146
155
  input: z.ZodObject<{
147
156
  computerId: z.ZodString;
157
+ reason: z.ZodExactOptional<z.ZodLiteral<true>>;
148
158
  }, z.core.$strict>;
149
- output: z.ZodDiscriminatedUnion<[z.ZodObject<{
159
+ output: z.ZodUnion<readonly [z.ZodObject<{
150
160
  state: z.ZodEnum<{
151
161
  running: "running";
152
162
  sleeping: "sleeping";
153
163
  starting: "starting";
154
- start_failed: "start_failed";
155
164
  }>;
165
+ }, z.core.$strict>, z.ZodObject<{
166
+ state: z.ZodLiteral<"start_failed">;
167
+ }, z.core.$strict>, z.ZodObject<{
168
+ state: z.ZodLiteral<"start_failed">;
169
+ reason: z.ZodString;
156
170
  }, z.core.$strict>, z.ZodObject<{
157
171
  state: z.ZodLiteral<"queued">;
158
172
  position: z.ZodNumber;
159
- }, z.core.$strict>], "state">;
173
+ }, z.core.$strict>]>;
160
174
  /** Return liveness without waking the runtime. */
161
- execute: (input: z.output<typeof fleetComputerId>, context: InvocationContext) => Promise<{
162
- state: "running" | "sleeping" | "starting" | "start_failed";
163
- } | {
164
- state: "queued";
165
- position: number;
166
- }>;
175
+ execute: (input: z.output<typeof fleetStateRead>, context: InvocationContext) => Promise<z.output<typeof computerStateSchema>>;
167
176
  };
168
177
  start: {
169
178
  replay: "unsafe";
@@ -171,20 +180,29 @@ export declare function computerControlSpecs(port: ComputerControlPort): {
171
180
  input: z.ZodObject<{
172
181
  computerId: z.ZodString;
173
182
  }, z.core.$strict>;
174
- output: z.ZodDiscriminatedUnion<[z.ZodObject<{
183
+ output: z.ZodUnion<readonly [z.ZodObject<{
175
184
  state: z.ZodEnum<{
176
185
  running: "running";
177
186
  sleeping: "sleeping";
178
187
  starting: "starting";
179
- start_failed: "start_failed";
180
188
  }>;
189
+ }, z.core.$strict>, z.ZodObject<{
190
+ state: z.ZodLiteral<"start_failed">;
191
+ }, z.core.$strict>, z.ZodObject<{
192
+ state: z.ZodLiteral<"start_failed">;
193
+ reason: z.ZodString;
181
194
  }, z.core.$strict>, z.ZodObject<{
182
195
  state: z.ZodLiteral<"queued">;
183
196
  position: z.ZodNumber;
184
- }, z.core.$strict>], "state">;
197
+ }, z.core.$strict>]>;
185
198
  /** Admit and start this Computer. */
186
199
  execute: (input: z.output<typeof fleetComputerId>, context: InvocationContext) => Promise<{
187
- state: "running" | "sleeping" | "starting" | "start_failed";
200
+ state: "running" | "sleeping" | "starting";
201
+ } | {
202
+ state: "start_failed";
203
+ } | {
204
+ state: "start_failed";
205
+ reason: string;
188
206
  } | {
189
207
  state: "queued";
190
208
  position: number;
package/dist/mcp.js CHANGED
@@ -38,6 +38,14 @@ const fleetIds = defineIdFamily({
38
38
  const fleetComputerId = z.strictObject({
39
39
  computerId: z.string().min(1).max(256),
40
40
  });
41
+ /**
42
+ * `reason: true` asks for a failed start's plain-words reason. Callers that
43
+ * never ask get the state shape every released client decodes strictly.
44
+ */
45
+ const fleetStateRead = z.strictObject({
46
+ computerId: z.string().min(1).max(256),
47
+ reason: z.literal(true).exactOptional(),
48
+ });
41
49
  const fleetCreate = z.strictObject({
42
50
  name: computerCreateRequestSchema.shape.name
43
51
  .unwrap()
@@ -107,11 +115,16 @@ export function computerControlSpecs(port) {
107
115
  state: {
108
116
  replay: "safe",
109
117
  access: "read",
110
- description: "Read runtime state without waking a Computer, including its live admission queue position.",
111
- input: fleetComputerId,
118
+ description: "Read runtime state without waking a Computer, including its live admission queue position. Pass reason: true to get why a failed start failed.",
119
+ input: fleetStateRead,
112
120
  output: computerStateSchema,
113
121
  /** Return liveness without waking the runtime. */
114
- execute: (input, context) => port.state(input.computerId, context),
122
+ execute: async (input, context) => {
123
+ const state = await port.state(input.computerId, context);
124
+ if (state.state !== "start_failed" || input.reason === true)
125
+ return state;
126
+ return { state: state.state };
127
+ },
115
128
  },
116
129
  start: {
117
130
  replay: "unsafe",