@womp/spark-agent 2.2.0 → 3.0.1

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/README.md CHANGED
@@ -201,6 +201,7 @@ Configure the process with:
201
201
 
202
202
  - `OPENAI_API_KEY`
203
203
  - `ANTHROPIC_API_KEY`
204
+ - `GEMINI_API_KEY`
204
205
  - `KAKAPO_URL` (defaults to `ws://127.0.0.1:5502`)
205
206
  - `PORT` (defaults to `8787`)
206
207
  - `SPARK_STORAGE_PATH` (defaults to `.spark/spark.sqlite`)
@@ -67,8 +67,22 @@ export function createSparkTools(options) {
67
67
  const invocation = new AbortController();
68
68
  const signal = AbortSignal.any([controller.signal, invocation.signal]);
69
69
  const userWait = new UserWait();
70
+ const serviceWait = new UserWait();
71
+ const executionWait = {
72
+ get active() {
73
+ return userWait.active || serviceWait.active;
74
+ },
75
+ subscribe(listener) {
76
+ const user = userWait.subscribe(listener);
77
+ const service = serviceWait.subscribe(listener);
78
+ return () => {
79
+ user();
80
+ service();
81
+ };
82
+ },
83
+ };
70
84
  const logs = [];
71
- const receipts = [];
85
+ const receipts = new Map();
72
86
  const artifacts = [];
73
87
  const pending = new Set();
74
88
  let outputBytes = 0;
@@ -82,6 +96,16 @@ export function createSparkTools(options) {
82
96
  runId: options.runId,
83
97
  toolCallId,
84
98
  signal,
99
+ waitForService: (label, action) => serviceWait.wait(signal, async () => {
100
+ context.reportStatus("running", label);
101
+ try {
102
+ return await action(signal);
103
+ }
104
+ finally {
105
+ if (!signal.aborted)
106
+ context.reportStatus("running", "Thinking");
107
+ }
108
+ }),
85
109
  waitForUser: (label, action) => userWait.wait(signal, async () => {
86
110
  context.reportStatus("requires_action", label);
87
111
  try {
@@ -93,7 +117,7 @@ export function createSparkTools(options) {
93
117
  }
94
118
  }),
95
119
  recordReceipt: (receipt) => {
96
- receipts.push(receipt);
120
+ receipts.set(receipt.id, structuredClone(receipt));
97
121
  options.write({
98
122
  type: "data-execution-receipt",
99
123
  id: receipt.id,
@@ -136,7 +160,7 @@ export function createSparkTools(options) {
136
160
  },
137
161
  emitImage: (ref) => emit(ref, "image"),
138
162
  emitFile: (ref) => emit(ref, "file"),
139
- }, options.executionTimeoutMs ?? 60_000, signal, userWait);
163
+ }, options.executionTimeoutMs ?? 60_000, signal, executionWait);
140
164
  await Promise.all(pending);
141
165
  signal.throwIfAborted();
142
166
  return {
@@ -145,7 +169,7 @@ export function createSparkTools(options) {
145
169
  purpose: input.purpose,
146
170
  value: jsonValue(value),
147
171
  logs,
148
- receipts,
172
+ receipts: [...receipts.values()],
149
173
  artifacts,
150
174
  };
151
175
  }
@@ -158,7 +182,7 @@ export function createSparkTools(options) {
158
182
  purpose: input.purpose,
159
183
  value: null,
160
184
  logs,
161
- receipts,
185
+ receipts: [...receipts.values()],
162
186
  artifacts,
163
187
  error: errorMessage(error),
164
188
  };
package/dist/agent.js CHANGED
@@ -144,6 +144,7 @@ export function runSparkAgent(options) {
144
144
  toolNames: step.toolCalls.map(({ toolName }) => toolName),
145
145
  responseTimeMs: step.performance.responseTimeMs,
146
146
  cost: calculateStepCost(options.modelId, step.usage),
147
+ usage: step.usage,
147
148
  },
148
149
  });
149
150
  if (options.persistence?.saveMessage !== undefined) {
@@ -87,12 +87,17 @@ export type OperationPage = {
87
87
  jobs: OperationJob[];
88
88
  nextFrom: number | null;
89
89
  };
90
+ export type OperationGenerationResult = {
91
+ status: "completed" | "failed" | "cancelled";
92
+ job: OperationJob;
93
+ } | {
94
+ status: "cancelled";
95
+ reason: string;
96
+ };
90
97
  export type WompOperationsApi = {
91
98
  catalog(): Promise<OperationCatalog>;
92
99
  list(options?: OperationListOptions): Promise<OperationPage>;
93
- start(request: OperationRequest): Promise<OperationStartResult>;
94
- read(messageId: number): Promise<OperationJob>;
95
- wait(messageId: number, options?: OperationWaitOptions): Promise<OperationWaitResult>;
100
+ generate(request: OperationRequest): Promise<OperationGenerationResult>;
96
101
  };
97
102
  export interface OperationsHost {
98
103
  catalog(context: SparkInvocationContext): Promise<OperationCatalog>;
@@ -66,28 +66,24 @@ const requestSchema = z.discriminatedUnion("type", [
66
66
  .strict(),
67
67
  z.object({ key, type: z.literal("remove-image-background"), inputs: inputs.max(1) }).strict(),
68
68
  ]);
69
- const messageIdSchema = z.number().int().positive();
70
69
  const listSchema = z
71
70
  .object({
72
71
  from: z.number().int().nonnegative().default(0),
73
72
  count: z.number().int().min(1).max(50).default(20),
74
73
  })
75
74
  .strict();
76
- const waitSchema = z
77
- .object({ timeoutMs: z.number().int().min(1).max(30_000).default(15_000) })
78
- .strict();
79
75
  export function createOperationsCapability(host) {
80
76
  return {
81
77
  skills: [
82
78
  {
83
79
  name: "generation",
84
- version: "4",
80
+ version: "5",
85
81
  description: "Generate or edit images and meshes, inspect jobs, and wait for their outputs.",
86
82
  instructions: `Read operations.catalog() for the currently available models and selected defaults.
87
83
  Use generation for inline chat results. If the user is working in their Flow graph and flow-graphs is available,
88
84
  add the generation to that graph instead unless they request an inline result. When they want repeated variations,
89
85
  offer a reusable Flow workflow if available; accepting that offer means editing the graph, not submitting another inline job.
90
- Use start() for image/mesh generation, image editing, upscaling, or background removal. Model IDs must
86
+ Use generate() for image/mesh generation, image editing, upscaling, or background removal. Model IDs must
91
87
  come from the catalog and support the requested operation. An unavailable or restricted explicit choice
92
88
  is an error; do not silently substitute another model. Omit model IDs to use the user's defaults.
93
89
  For text-to-mesh, imageParams configures the image step and params configures the mesh step. For
@@ -101,45 +97,72 @@ Do not fabricate references, replace a missing input with another image, or pass
101
97
  Assign a short, distinct key to each intended job. Reuse that key when checking the same submission;
102
98
  never choose a new key merely to retry a timeout or unknown outcome. A key cannot identify two
103
99
  different requests. Host receipts and saved message IDs record submitted effects.
104
- start() may wait for the user's existing cost confirmation. Dismissal is cancelled and must not be
105
- automatically retried. A returned job is submitted work, not a completed generation. Use read() or
106
- bounded wait() to inspect it. Use list() to discover existing jobs in this conversation. Follow nextFrom
107
- even when a page has no jobs, since pagination scans conversation messages. A wait timeout leaves the
108
- existing job running; do not submit a replacement. Make at most one bounded wait (timeoutMs <= 30000)
109
- per execute_javascript call, print its result, and return. If more waiting is needed, use another tool
110
- step. Do not loop over waits inside one script or exceed the limit; service waits consume execution time.
100
+ generate() waits for cost confirmation and then for completion, failure, or cancellation.
101
+ Use exactly one generation per execute_javascript call and print its result. Put follow-up work in
102
+ another call. Do not poll, start background work, use Promise.all, or report success before completion.
103
+ The host waits without consuming model steps. Pause ends the local wait, not an accepted backend job.
104
+ Refresh recovery reconnects the same job. It never resumes the interrupted JavaScript stack.
105
+ Inspect a recovered result and continue remaining work in a new call; do not repeat generation.
106
+ Use list() to discover existing jobs. Follow nextFrom even when a page has no jobs.
107
+ An uncertain submission requires inspection, never a replacement request.
111
108
  Only returned outputs exist. Emit images/files to inspect or show them; generating a mesh does not
112
109
  import it into the scene. Use the assets skill for importing. Stopping the agent ends its wait and
113
110
  prevents further submissions; it does not claim to cancel a job already accepted by the service.`,
114
111
  declarations: WOMP_OPERATIONS_DECLARATIONS,
115
112
  examples: [
116
113
  "print(await womp.operations.catalog());",
117
- 'const result = await womp.operations.start({ key: "blue-chair-preview", type: "text-to-image", prompt: "A blue chair on a plain background" }); print(result);',
118
- 'const result = await womp.operations.wait(123, { timeoutMs: 15000 }); print(result); for (const output of result.job.outputs) { if (output.mediaType.startsWith("image/")) await emitImage(output); }',
114
+ 'const result = await womp.operations.generate({ key: "blue-chair-preview", type: "text-to-image", prompt: "A blue chair on a plain background" }); print(result);',
119
115
  ],
120
116
  },
121
117
  ],
122
- createApi: (context) => ({
123
- catalog: () => {
124
- context.signal.throwIfAborted();
125
- return host.catalog(context);
126
- },
127
- list: (options) => {
128
- context.signal.throwIfAborted();
129
- return host.list(listSchema.parse(options ?? {}), context);
130
- },
131
- start: (request) => {
132
- context.signal.throwIfAborted();
133
- return host.start(requestSchema.parse(request), context);
134
- },
135
- read: (messageId) => {
136
- context.signal.throwIfAborted();
137
- return host.read(messageIdSchema.parse(messageId), context);
138
- },
139
- wait: (messageId, options) => {
140
- context.signal.throwIfAborted();
141
- return host.wait(messageIdSchema.parse(messageId), waitSchema.parse(options ?? {}), context);
142
- },
143
- }),
118
+ createApi: (context) => {
119
+ let requested = false;
120
+ return {
121
+ catalog: () => host.catalog(context),
122
+ list: (options) => host.list(listSchema.parse(options ?? {}), context),
123
+ generate: async (request) => {
124
+ context.signal.throwIfAborted();
125
+ const parsed = requestSchema.parse(request);
126
+ if (requested)
127
+ throw new Error("Use one generation per JavaScript call. Continue in a new call.");
128
+ if (!context.waitForService)
129
+ throw new Error("This host does not support durable generation waits.");
130
+ requested = true;
131
+ return context.waitForService(parsed.type.includes("mesh") ? "Generating 3D model" : "Generating image", async () => {
132
+ const result = await host.start(parsed, context);
133
+ if (result.status === "cancelled")
134
+ return result;
135
+ if (result.status === "unknown")
136
+ throw new Error(result.reason);
137
+ let job = result.job;
138
+ let failures = 0;
139
+ while (!["completed", "cancelled", "failed"].includes(job.status)) {
140
+ context.signal.throwIfAborted();
141
+ try {
142
+ job = (await host.wait(job.messageId, { timeoutMs: 30000 }, context)).job;
143
+ failures = 0;
144
+ }
145
+ catch (error) {
146
+ context.signal.throwIfAborted();
147
+ if (++failures >= 3)
148
+ throw error;
149
+ await new Promise((resolve, reject) => {
150
+ const abort = () => {
151
+ clearTimeout(timer);
152
+ reject(context.signal.reason);
153
+ };
154
+ const timer = setTimeout(() => {
155
+ context.signal.removeEventListener("abort", abort);
156
+ resolve();
157
+ }, failures * 1000);
158
+ context.signal.addEventListener("abort", abort, { once: true });
159
+ });
160
+ }
161
+ }
162
+ return { status: job.status, job };
163
+ });
164
+ },
165
+ };
166
+ },
144
167
  };
145
168
  }
@@ -9,7 +9,7 @@ export { createOperationsCapability } from "./capabilities/operations.js";
9
9
  export { createAssetsCapability } from "./capabilities/assets.js";
10
10
  export type { AssetImportsHost, MeshImportRequest, ImageImportRequest, AssetImportResult, MeshImportRetryRequest, AssetImportWaitOptions, WompAssetImportsApi, } from "./capabilities/asset-imports.js";
11
11
  export type { AssetsHost, AssetListOptions, ConversationAsset, AssetPage, WompAssetsApi, } from "./capabilities/assets.js";
12
- export type { OperationsHost, OperationType, OperationModel, OperationCatalog, OperationRequest, OperationJob, OperationStartResult, OperationWaitOptions, OperationWaitResult, OperationListOptions, OperationPage, WompOperationsApi, } from "./capabilities/operations.js";
12
+ export type { OperationsHost, OperationType, OperationModel, OperationCatalog, OperationRequest, OperationJob, OperationStartResult, OperationGenerationResult, OperationWaitOptions, OperationWaitResult, OperationListOptions, OperationPage, WompOperationsApi, } from "./capabilities/operations.js";
13
13
  export type { AccountHost, AccountRead, AccountSection, AccountScope, AccountResult, AccountSnapshot, AccountPage, AccountProfile, AccountTeam, AccountCreditBalance, AccountSubscription, AccountBilling, AccountOrderItem, AccountOrder, AccountProject, AccountNotification, AccountWorkflow, WompAccountApi, } from "./capabilities/account.js";
14
14
  export type { KnowledgeAnswer, KnowledgeHost, WompKnowledgeApi, } from "./capabilities/knowledge.js";
15
15
  export { createOpenScadCapability } from "./capabilities/openscad.js";
@@ -47,6 +47,8 @@ export type SparkInvocationContext = {
47
47
  signal: AbortSignal;
48
48
  recordReceipt(receipt: ExecutionReceipt): Promise<void>;
49
49
  reportStatus(status: "running" | "requires_action", label: string): void;
50
+ /** Trusted host wait; the host owns checkpointing and reconnecting its effect. */
51
+ waitForService?<T>(label: string, action: (signal: AbortSignal) => Promise<T>): Promise<T>;
50
52
  /** Wait for an actual user interaction, outside mutation locks and service work. */
51
53
  waitForUser<T>(label: string, action: (signal: AbortSignal) => Promise<T>): Promise<T>;
52
54
  };
package/dist/cli.js CHANGED
@@ -16,6 +16,7 @@ if (Number.isSafeInteger(port) === false || port < 1 || port > 65_535) {
16
16
  const app = await createStandaloneSparkAgentApp({
17
17
  openAiApiKey: process.env.OPENAI_API_KEY,
18
18
  anthropicApiKey: process.env.ANTHROPIC_API_KEY,
19
+ geminiApiKey: process.env.GEMINI_API_KEY,
19
20
  kakapoUrl: process.env.KAKAPO_URL ?? "ws://127.0.0.1:5502",
20
21
  developmentProfile: values.profile,
21
22
  storagePath: process.env.SPARK_STORAGE_PATH,
@@ -7,7 +7,7 @@ export declare class UserWait implements JavaScriptUserWait {
7
7
  wait<T>(signal: AbortSignal, action: () => Promise<T>): Promise<T>;
8
8
  private notify;
9
9
  }
10
- /** Counts execution/service time, excluding only host-declared user waits. */
10
+ /** Counts execution time, excluding trusted host waits. */
11
11
  export declare class ExecutionBudget {
12
12
  private readonly timeoutMs;
13
13
  private readonly signal;
@@ -33,7 +33,7 @@ export class UserWait {
33
33
  listener();
34
34
  }
35
35
  }
36
- /** Counts execution/service time, excluding only host-declared user waits. */
36
+ /** Counts execution time, excluding trusted host waits. */
37
37
  export class ExecutionBudget {
38
38
  timeoutMs;
39
39
  signal;
@@ -1 +1 @@
1
- export declare const WOMP_OPERATIONS_DECLARATIONS = "declare const womp: { operations: {\n\"catalog\": (() => Promise<{\n\"models\": Array<{\n\"id\": string;\n\"name\": string;\n\"description\"?: undefined | string;\n\"requiresSubscription\": false | true;\n\"operations\": Array<\"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\">;\n}>;\n\"defaults\": {\n\"image\"?: undefined | string;\n\"editing\"?: undefined | string;\n\"mesh\"?: undefined | string;\n};\n\"confirmationRequired\": false | true;\n}>);\n\"list\": ((options?: undefined | {\n\"from\"?: undefined | number;\n\"count\"?: undefined | number;\n}) => Promise<{\n\"jobs\": Array<{\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n}>;\n\"nextFrom\": null | number;\n}>);\n\"start\": ((request: {\n\"key\": string;\n} & {\n\"type\": \"text-to-image\";\n\"prompt\": string;\n\"pipeline\"?: undefined | string;\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"image-to-image\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"prompt\"?: undefined | string;\n\"pipeline\"?: undefined | string;\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"text-to-mesh\";\n\"prompt\": string;\n\"pipeline\"?: undefined | string;\n\"workflow\"?: undefined | string;\n\"imageParams\"?: undefined | {\n[key: string]: unknown;\n};\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"image-to-mesh\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"prompt\"?: undefined | string;\n\"pipeline\"?: undefined | string;\n\"workflow\"?: undefined | string;\n\"imageParams\"?: undefined | {\n[key: string]: unknown;\n};\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"upscale-image\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"scale\"?: undefined | number;\n\"modelName\"?: undefined | string;\n} | {\n\"key\": string;\n} & {\n\"type\": \"remove-image-background\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n}) => Promise<{\n\"status\": \"started\";\n\"job\": {\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n};\n} | {\n\"status\": \"cancelled\";\n\"reason\": string;\n} | {\n\"status\": \"unknown\";\n\"key\": string;\n\"reason\": string;\n}>);\n\"read\": ((messageId: number) => Promise<{\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n}>);\n\"wait\": ((messageId: number, options?: undefined | {\n\"timeoutMs\"?: undefined | number;\n}) => Promise<{\n\"job\": {\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n};\n\"timedOut\": false | true;\n}>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
1
+ export declare const WOMP_OPERATIONS_DECLARATIONS = "declare const womp: { operations: {\n\"catalog\": (() => Promise<{\n\"models\": Array<{\n\"id\": string;\n\"name\": string;\n\"description\"?: undefined | string;\n\"requiresSubscription\": false | true;\n\"operations\": Array<\"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\">;\n}>;\n\"defaults\": {\n\"image\"?: undefined | string;\n\"editing\"?: undefined | string;\n\"mesh\"?: undefined | string;\n};\n\"confirmationRequired\": false | true;\n}>);\n\"list\": ((options?: undefined | {\n\"from\"?: undefined | number;\n\"count\"?: undefined | number;\n}) => Promise<{\n\"jobs\": Array<{\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n}>;\n\"nextFrom\": null | number;\n}>);\n\"generate\": ((request: {\n\"key\": string;\n} & {\n\"type\": \"text-to-image\";\n\"prompt\": string;\n\"pipeline\"?: undefined | string;\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"image-to-image\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"prompt\"?: undefined | string;\n\"pipeline\"?: undefined | string;\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"text-to-mesh\";\n\"prompt\": string;\n\"pipeline\"?: undefined | string;\n\"workflow\"?: undefined | string;\n\"imageParams\"?: undefined | {\n[key: string]: unknown;\n};\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"image-to-mesh\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"prompt\"?: undefined | string;\n\"pipeline\"?: undefined | string;\n\"workflow\"?: undefined | string;\n\"imageParams\"?: undefined | {\n[key: string]: unknown;\n};\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"upscale-image\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"scale\"?: undefined | number;\n\"modelName\"?: undefined | string;\n} | {\n\"key\": string;\n} & {\n\"type\": \"remove-image-background\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n}) => Promise<{\n\"status\": \"completed\" | \"cancelled\" | \"failed\";\n\"job\": {\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n};\n} | {\n\"status\": \"cancelled\";\n\"reason\": string;\n}>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
@@ -1,3 +1,3 @@
1
1
  // Generated by scripts/generate-skill-declarations.mjs.
2
2
  // prettier-ignore
3
- export const WOMP_OPERATIONS_DECLARATIONS = "declare const womp: { operations: {\n\"catalog\": (() => Promise<{\n\"models\": Array<{\n\"id\": string;\n\"name\": string;\n\"description\"?: undefined | string;\n\"requiresSubscription\": false | true;\n\"operations\": Array<\"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\">;\n}>;\n\"defaults\": {\n\"image\"?: undefined | string;\n\"editing\"?: undefined | string;\n\"mesh\"?: undefined | string;\n};\n\"confirmationRequired\": false | true;\n}>);\n\"list\": ((options?: undefined | {\n\"from\"?: undefined | number;\n\"count\"?: undefined | number;\n}) => Promise<{\n\"jobs\": Array<{\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n}>;\n\"nextFrom\": null | number;\n}>);\n\"start\": ((request: {\n\"key\": string;\n} & {\n\"type\": \"text-to-image\";\n\"prompt\": string;\n\"pipeline\"?: undefined | string;\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"image-to-image\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"prompt\"?: undefined | string;\n\"pipeline\"?: undefined | string;\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"text-to-mesh\";\n\"prompt\": string;\n\"pipeline\"?: undefined | string;\n\"workflow\"?: undefined | string;\n\"imageParams\"?: undefined | {\n[key: string]: unknown;\n};\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"image-to-mesh\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"prompt\"?: undefined | string;\n\"pipeline\"?: undefined | string;\n\"workflow\"?: undefined | string;\n\"imageParams\"?: undefined | {\n[key: string]: unknown;\n};\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"upscale-image\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"scale\"?: undefined | number;\n\"modelName\"?: undefined | string;\n} | {\n\"key\": string;\n} & {\n\"type\": \"remove-image-background\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n}) => Promise<{\n\"status\": \"started\";\n\"job\": {\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n};\n} | {\n\"status\": \"cancelled\";\n\"reason\": string;\n} | {\n\"status\": \"unknown\";\n\"key\": string;\n\"reason\": string;\n}>);\n\"read\": ((messageId: number) => Promise<{\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n}>);\n\"wait\": ((messageId: number, options?: undefined | {\n\"timeoutMs\"?: undefined | number;\n}) => Promise<{\n\"job\": {\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n};\n\"timedOut\": false | true;\n}>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
3
+ export const WOMP_OPERATIONS_DECLARATIONS = "declare const womp: { operations: {\n\"catalog\": (() => Promise<{\n\"models\": Array<{\n\"id\": string;\n\"name\": string;\n\"description\"?: undefined | string;\n\"requiresSubscription\": false | true;\n\"operations\": Array<\"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\">;\n}>;\n\"defaults\": {\n\"image\"?: undefined | string;\n\"editing\"?: undefined | string;\n\"mesh\"?: undefined | string;\n};\n\"confirmationRequired\": false | true;\n}>);\n\"list\": ((options?: undefined | {\n\"from\"?: undefined | number;\n\"count\"?: undefined | number;\n}) => Promise<{\n\"jobs\": Array<{\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n}>;\n\"nextFrom\": null | number;\n}>);\n\"generate\": ((request: {\n\"key\": string;\n} & {\n\"type\": \"text-to-image\";\n\"prompt\": string;\n\"pipeline\"?: undefined | string;\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"image-to-image\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"prompt\"?: undefined | string;\n\"pipeline\"?: undefined | string;\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"text-to-mesh\";\n\"prompt\": string;\n\"pipeline\"?: undefined | string;\n\"workflow\"?: undefined | string;\n\"imageParams\"?: undefined | {\n[key: string]: unknown;\n};\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"image-to-mesh\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"prompt\"?: undefined | string;\n\"pipeline\"?: undefined | string;\n\"workflow\"?: undefined | string;\n\"imageParams\"?: undefined | {\n[key: string]: unknown;\n};\n\"params\"?: undefined | {\n[key: string]: unknown;\n};\n} | {\n\"key\": string;\n} & {\n\"type\": \"upscale-image\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"scale\"?: undefined | number;\n\"modelName\"?: undefined | string;\n} | {\n\"key\": string;\n} & {\n\"type\": \"remove-image-background\";\n\"inputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n}) => Promise<{\n\"status\": \"completed\" | \"cancelled\" | \"failed\";\n\"job\": {\n\"messageId\": number;\n\"operationId\"?: undefined | number;\n\"type\": \"text-to-image\" | \"image-to-image\" | \"text-to-mesh\" | \"image-to-mesh\" | \"upscale-image\" | \"remove-image-background\";\n\"status\": \"completed\" | \"cancelled\" | \"failed\" | \"submitted\" | \"not_ready\" | \"queued\" | \"running\" | \"waiting_for_capacity\";\n\"outputs\": Array<{\n\"id\": string;\n\"mediaType\": string;\n\"name\"?: undefined | string;\n}>;\n\"error\"?: undefined | string;\n};\n} | {\n\"status\": \"cancelled\";\n\"reason\": string;\n}>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";