@womp/spark-agent 10.1.1 → 10.2.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.
- package/CHANGELOG.md +14 -0
- package/dist/capabilities/flow-runs.d.ts +2 -0
- package/dist/capabilities/flow-runs.js +1 -1
- package/dist/generated/flow-runs-declarations.d.ts +1 -1
- package/dist/generated/flow-runs-declarations.js +1 -1
- package/dist/ui.d.ts +2 -0
- package/dist/ui.js +6 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ Notable changes to `@womp/spark-agent`, newest first. Versions follow
|
|
|
4
4
|
[Semantic Versioning](https://semver.org/). Add an entry with each version bump; describe what
|
|
5
5
|
changed for hosts and users, and how to migrate across breaking changes.
|
|
6
6
|
|
|
7
|
+
## 10.2.0 — 2026-10-14
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- `reason` (optional, at most 300 characters) on each `failedNodes` entry of the `flow-run-result` data
|
|
12
|
+
part and of `womp.flowRuns` run/status results: why the step failed, only when the host has a
|
|
13
|
+
message written for users (for example "Generate Image needs a prompt."). Provider messages are
|
|
14
|
+
never passed. The model's text for the part lists it after the step's name, and the flow-runs
|
|
15
|
+
skill tells the agent to pass the reason and its fix on to the user.
|
|
16
|
+
|
|
17
|
+
### Migration
|
|
18
|
+
|
|
19
|
+
- None. The field is optional; readers on older versions drop it.
|
|
20
|
+
|
|
7
21
|
## 10.1.1 — 2026-10-13
|
|
8
22
|
|
|
9
23
|
### Fixed
|
|
@@ -17,6 +17,8 @@ export type FlowRunOutputNode = {
|
|
|
17
17
|
export type FlowRunFailedNode = {
|
|
18
18
|
nodeId: string;
|
|
19
19
|
label: string;
|
|
20
|
+
/** Why the step failed, when the host has a message written for users (e.g. an empty prompt). Absent otherwise. */
|
|
21
|
+
reason?: string;
|
|
20
22
|
};
|
|
21
23
|
export type FlowRunLive = {
|
|
22
24
|
runId: string;
|
|
@@ -29,7 +29,7 @@ Only one run of a flow can be live. run() starts the run and returns at once. Fo
|
|
|
29
29
|
To leave the user's flow untouched, pass copy: true. The run then happens on a new copy of the project, placed in the user's "Flow runs" folder: the input values, outputs and any scene changes land on the copy, and the user's flow, its saved values and its scene are not changed. Use it when the user wants to try values without changing their flow, or when their flow is busy. A copy run does not lock the scene. run() returns the copy's projectUrl; give it to the user so they can open the result.
|
|
30
30
|
To keep only the result of a copy run, also pass deleteCopy: true: the copy is deleted when the run ends, whether it completed, failed or was cancelled. Use it when the user wants the outputs, not the project; do not give them that run's projectUrl, which stops working (status() then returns projectUrl null).
|
|
31
31
|
To delete a copy run's copy later, call deleteCopy(runId) once the run has ended; it is refused for a run that is still running (cancel it first) or one that did not run on a copy. Right after cancel(), deleteCopy() may answer run_active for about a minute while the run stops: retry later, or pass deleteCopy: true at start instead. Output links keep working after the copy is deleted, either way.
|
|
32
|
-
When a run fails, name the failed steps from failedNodes in your answer (the error alone is generic). The outputs listed for a run are only what that run produced; do not present anything else as its result.
|
|
32
|
+
When a run fails, name the failed steps from failedNodes in your answer (the error alone is generic), and when a step has a reason, tell the user that reason and how to fix it. The outputs listed for a run are only what that run produced; do not present anything else as its result.
|
|
33
33
|
A run may outlive your turn. If it does, the system reports the result in a follow-up, so do not keep calling status() across many calls.
|
|
34
34
|
When status() or wait() returns an ended run with reported "now", the result is yours to tell the user. With reported "earlier", the result was already reported, earlier in the conversation or by the refusal run() returned to you; do not repeat it.
|
|
35
35
|
Errors start with a code. flow_busy and snapshot_changed mean the user is using the flow: tell them and do not retry. backend_deploying means try again later. not_authorized is final. no_project means the conversation needs a project first.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const WOMP_FLOW_RUNS_DECLARATIONS = "declare const womp: { flowRuns: {\n\"describe\": (() => Promise<{\n\"projectId\": number;\n\"snapshotId\": string;\n\"inputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n\"valueType\": string;\n\"value\": unknown;\n\"required\": false | true;\n}>;\n\"outputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n}>;\n\"liveRun\": null | {\n\"runId\": string;\n\"trigger\": string;\n};\n}>);\n\"run\": ((options?: undefined | {\n\"inputs\"?: undefined | {\n[key: string]: unknown;\n};\n\"copy\"?: undefined | false | true;\n\"deleteCopy\"?: undefined | false | true;\n}) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"repeated\": false | true;\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n}>;\n}>);\n\"status\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n}>;\n}>);\n\"wait\": ((runId: string, seconds?: undefined | number) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n}>;\n}>);\n\"cancel\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"cancelled\": false | true;\n}>);\n\"deleteCopy\": ((runId: string) => Promise<{\n\"runId\": string;\n\"copyDeletedAt\": string;\n}>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }, options?: { inspect?: boolean }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
|
|
1
|
+
export declare const WOMP_FLOW_RUNS_DECLARATIONS = "declare const womp: { flowRuns: {\n\"describe\": (() => Promise<{\n\"projectId\": number;\n\"snapshotId\": string;\n\"inputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n\"valueType\": string;\n\"value\": unknown;\n\"required\": false | true;\n}>;\n\"outputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n}>;\n\"liveRun\": null | {\n\"runId\": string;\n\"trigger\": string;\n};\n}>);\n\"run\": ((options?: undefined | {\n\"inputs\"?: undefined | {\n[key: string]: unknown;\n};\n\"copy\"?: undefined | false | true;\n\"deleteCopy\"?: undefined | false | true;\n}) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"repeated\": false | true;\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n\"reason\"?: undefined | string;\n}>;\n}>);\n\"status\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n\"reason\"?: undefined | string;\n}>;\n}>);\n\"wait\": ((runId: string, seconds?: undefined | number) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n\"reason\"?: undefined | string;\n}>;\n}>);\n\"cancel\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"cancelled\": false | true;\n}>);\n\"deleteCopy\": ((runId: string) => Promise<{\n\"runId\": string;\n\"copyDeletedAt\": string;\n}>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }, options?: { inspect?: boolean }): 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_FLOW_RUNS_DECLARATIONS = "declare const womp: { flowRuns: {\n\"describe\": (() => Promise<{\n\"projectId\": number;\n\"snapshotId\": string;\n\"inputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n\"valueType\": string;\n\"value\": unknown;\n\"required\": false | true;\n}>;\n\"outputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n}>;\n\"liveRun\": null | {\n\"runId\": string;\n\"trigger\": string;\n};\n}>);\n\"run\": ((options?: undefined | {\n\"inputs\"?: undefined | {\n[key: string]: unknown;\n};\n\"copy\"?: undefined | false | true;\n\"deleteCopy\"?: undefined | false | true;\n}) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"repeated\": false | true;\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n}>;\n}>);\n\"status\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n}>;\n}>);\n\"wait\": ((runId: string, seconds?: undefined | number) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n}>;\n}>);\n\"cancel\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"cancelled\": false | true;\n}>);\n\"deleteCopy\": ((runId: string) => Promise<{\n\"runId\": string;\n\"copyDeletedAt\": string;\n}>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }, options?: { inspect?: boolean }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
|
|
3
|
+
export const WOMP_FLOW_RUNS_DECLARATIONS = "declare const womp: { flowRuns: {\n\"describe\": (() => Promise<{\n\"projectId\": number;\n\"snapshotId\": string;\n\"inputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n\"valueType\": string;\n\"value\": unknown;\n\"required\": false | true;\n}>;\n\"outputs\": Array<{\n\"nodeId\": string;\n\"typeId\": string;\n}>;\n\"liveRun\": null | {\n\"runId\": string;\n\"trigger\": string;\n};\n}>);\n\"run\": ((options?: undefined | {\n\"inputs\"?: undefined | {\n[key: string]: unknown;\n};\n\"copy\"?: undefined | false | true;\n\"deleteCopy\"?: undefined | false | true;\n}) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"repeated\": false | true;\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n\"reason\"?: undefined | string;\n}>;\n}>);\n\"status\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n\"reason\"?: undefined | string;\n}>;\n}>);\n\"wait\": ((runId: string, seconds?: undefined | number) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"outputs\": unknown;\n\"error\": null | string;\n\"errorCode\": null | string;\n\"reported\": null | \"now\" | \"earlier\";\n\"projectId\": number;\n\"sourceProjectId\": null | number;\n\"projectUrl\": null | string;\n\"deleteCopy\": false | true;\n\"copyDeletedAt\": null | string;\n\"failedNodes\"?: undefined | Array<{\n\"nodeId\": string;\n\"label\": string;\n\"reason\"?: undefined | string;\n}>;\n}>);\n\"cancel\": ((runId: string) => Promise<{\n\"runId\": string;\n\"status\": string;\n\"cancelled\": false | true;\n}>);\n\"deleteCopy\": ((runId: string) => Promise<{\n\"runId\": string;\n\"copyDeletedAt\": string;\n}>);\n} };\ndeclare function print(...values: unknown[]): void;\ndeclare function emitImage(ref: { id: string; mediaType: string; name?: string }, options?: { inspect?: boolean }): Promise<void>;\ndeclare function emitFile(ref: { id: string; mediaType: string; name?: string }): Promise<void>;\n";
|
package/dist/ui.d.ts
CHANGED
|
@@ -268,6 +268,7 @@ declare const flowRunResultSchema: z.ZodObject<{
|
|
|
268
268
|
failedNodes: z.ZodArray<z.ZodObject<{
|
|
269
269
|
nodeId: z.ZodString;
|
|
270
270
|
label: z.ZodString;
|
|
271
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
271
272
|
}, z.core.$strip>>;
|
|
272
273
|
outputs: z.ZodArray<z.ZodObject<{
|
|
273
274
|
nodeId: z.ZodString;
|
|
@@ -438,6 +439,7 @@ export declare const sparkDataPartSchemas: {
|
|
|
438
439
|
failedNodes: z.ZodArray<z.ZodObject<{
|
|
439
440
|
nodeId: z.ZodString;
|
|
440
441
|
label: z.ZodString;
|
|
442
|
+
reason: z.ZodOptional<z.ZodString>;
|
|
441
443
|
}, z.core.$strip>>;
|
|
442
444
|
outputs: z.ZodArray<z.ZodObject<{
|
|
443
445
|
nodeId: z.ZodString;
|
package/dist/ui.js
CHANGED
|
@@ -59,7 +59,8 @@ const flowRunResultSchema = z.object({
|
|
|
59
59
|
status: z.enum(["completed", "failed", "cancelled"]),
|
|
60
60
|
/** A sentence for the user; never a provider message. */
|
|
61
61
|
error: z.string().nullable(),
|
|
62
|
-
|
|
62
|
+
/** `reason`: why the step failed, only when the host wrote it for users (never a provider message). */
|
|
63
|
+
failedNodes: z.array(z.object({ nodeId: z.string(), label: z.string(), reason: z.string().max(300).optional() })).max(10),
|
|
63
64
|
/** Only what this run produced; outputs with no URL are left out. */
|
|
64
65
|
outputs: z
|
|
65
66
|
.array(z.object({ nodeId: z.string(), label: z.string(), title: z.string(), url: z.string(), thumbnailUrl: z.string().optional() }))
|
|
@@ -70,8 +71,10 @@ const flowRunResultSchema = z.object({
|
|
|
70
71
|
export function flowRunResultText(data) {
|
|
71
72
|
const sentence = (text) => (/[.!?]$/.test(text) ? text : `${text}.`);
|
|
72
73
|
const segments = [`[Flow run finished] Flow "${data.flowTitle}" ${data.status}.`];
|
|
73
|
-
if (data.failedNodes.length)
|
|
74
|
-
|
|
74
|
+
if (data.failedNodes.length) {
|
|
75
|
+
const steps = data.failedNodes.map((node) => (node.reason ? `${node.label} (${node.reason})` : node.label));
|
|
76
|
+
segments.push(`Failed steps: ${steps.join(", ")}.`);
|
|
77
|
+
}
|
|
75
78
|
if (data.outputs.length)
|
|
76
79
|
segments.push(`Outputs: ${data.outputs.map((output) => `${output.title} (${output.url})`).join(", ")}.`);
|
|
77
80
|
if (data.copy)
|