@elyracode/workflows 0.9.56 → 0.9.57

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 CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.9.57] - 2026-11-10
4
+
5
+ ### Fixed
6
+
7
+ - Workflow `prompt` steps crashed with `ctx.sendUserMessage is not a function`; now sent via `elyra.sendUserMessage` as a follow-up so consecutive prompt steps queue
8
+ - Tool failures were returned as normal results (`isError` on the return value is ignored) and the model saw them as successes; they now throw so the result is marked as an error
9
+
3
10
  ## [0.9.56] - 2026-11-01
4
11
 
5
12
  ## [0.9.55] - 2026-10-21
@@ -1,6 +1,6 @@
1
1
  import { existsSync, readdirSync, readFileSync } from "node:fs";
2
2
  import { join } from "node:path";
3
- import type { ExtensionAPI } from "@elyracode/coding-agent";
3
+ import type { AgentToolResult, ExtensionAPI } from "@elyracode/coding-agent";
4
4
  import { Type } from "typebox";
5
5
 
6
6
  // ── Types ───────────────────────────────────────────────────────────────────
@@ -137,15 +137,10 @@ export default function (elyra: ExtensionAPI): void {
137
137
  if (!args.trim()) {
138
138
  // List available workflows
139
139
  if (workflows.length === 0) {
140
- ctx.ui.notify(
141
- "No workflows found. Create JSON files in .elyra/workflows/",
142
- "info",
143
- );
140
+ ctx.ui.notify("No workflows found. Create JSON files in .elyra/workflows/", "info");
144
141
  return;
145
142
  }
146
- const list = workflows
147
- .map((w) => ` ${w.name}${w.description ? ` — ${w.description}` : ""}`)
148
- .join("\n");
143
+ const list = workflows.map((w) => ` ${w.name}${w.description ? ` — ${w.description}` : ""}`).join("\n");
149
144
  ctx.ui.notify(`Available workflows:\n${list}\n\nRun with: /workflow <name>`, "info");
150
145
  return;
151
146
  }
@@ -200,7 +195,9 @@ export default function (elyra: ExtensionAPI): void {
200
195
  for (const r of results) {
201
196
  context.steps[r.name] = r.result;
202
197
  }
203
- const summary = results.map((r) => `${r.name}: ${r.result.code === 0 ? "ok" : `exit ${r.result.code}`}`).join(", ");
198
+ const summary = results
199
+ .map((r) => `${r.name}: ${r.result.code === 0 ? "ok" : `exit ${r.result.code}`}`)
200
+ .join(", ");
204
201
  context.steps[step.name] = { output: summary, type: "parallel" };
205
202
  log.push(formatStepResult(step.name, context.steps[step.name]));
206
203
  continue;
@@ -225,23 +222,20 @@ export default function (elyra: ExtensionAPI): void {
225
222
  if (step.prompt) {
226
223
  const prompt = interpolate(step.prompt, context);
227
224
  ctx.ui.notify(`[${step.name}] sending prompt to agent...`, "info");
228
- await ctx.sendUserMessage(prompt);
225
+ elyra.sendUserMessage(prompt, { deliverAs: "followUp" });
229
226
  // The agent response will be in the session; capture it conceptually
230
227
  context.steps[step.name] = {
231
228
  output: "(agent responded in session)",
232
229
  type: "prompt",
233
230
  };
234
231
  log.push(formatStepResult(step.name, context.steps[step.name]));
235
- continue;
236
232
  }
237
233
  }
238
234
 
239
235
  // Summary
240
- const summary = [
241
- `Workflow "${workflow.name}" completed (${workflow.steps.length} steps):`,
242
- "",
243
- ...log,
244
- ].join("\n");
236
+ const summary = [`Workflow "${workflow.name}" completed (${workflow.steps.length} steps):`, "", ...log].join(
237
+ "\n",
238
+ );
245
239
  ctx.ui.notify(summary, "info");
246
240
  },
247
241
  });
@@ -263,17 +257,14 @@ export default function (elyra: ExtensionAPI): void {
263
257
  "List available workflows by reading .elyra/workflows/ directory",
264
258
  "Suggest creating a workflow when the user describes a repeatable multi-step process",
265
259
  ],
266
- async execute(_toolCallId, params) {
260
+ async execute(_toolCallId, params): Promise<AgentToolResult<undefined>> {
267
261
  const workflowDir = join(cwd, ".elyra", "workflows");
268
262
  workflows = loadWorkflows(workflowDir);
269
263
 
270
264
  const workflow = workflows.find((w) => w.name === params.name);
271
265
  if (!workflow) {
272
266
  const available = workflows.map((w) => w.name).join(", ") || "none";
273
- return {
274
- content: [{ type: "text", text: `Workflow "${params.name}" not found. Available: ${available}` }],
275
- isError: true,
276
- };
267
+ throw new Error(`Workflow "${params.name}" not found. Available: ${available}`);
277
268
  }
278
269
 
279
270
  const context: WorkflowContext = { steps: {} };
@@ -321,13 +312,16 @@ export default function (elyra: ExtensionAPI): void {
321
312
  "",
322
313
  prompt,
323
314
  "",
324
- `Remaining steps: ${workflow.steps
325
- .slice(workflow.steps.indexOf(step) + 1)
326
- .map((s) => s.name)
327
- .join(", ") || "none"}`,
315
+ `Remaining steps: ${
316
+ workflow.steps
317
+ .slice(workflow.steps.indexOf(step) + 1)
318
+ .map((s) => s.name)
319
+ .join(", ") || "none"
320
+ }`,
328
321
  ].join("\n"),
329
322
  },
330
323
  ],
324
+ details: undefined,
331
325
  };
332
326
  }
333
327
 
@@ -354,6 +348,7 @@ export default function (elyra: ExtensionAPI): void {
354
348
 
355
349
  return {
356
350
  content: [{ type: "text", text: log.join("\n") }],
351
+ details: undefined,
357
352
  };
358
353
  },
359
354
  });
@@ -365,10 +360,11 @@ export default function (elyra: ExtensionAPI): void {
365
360
  elyra.registerTool({
366
361
  name: "workflow_list",
367
362
  label: "List Workflows",
368
- description: "List available workflows defined in .elyra/workflows/. Shows each workflow name, description, and step count.",
363
+ description:
364
+ "List available workflows defined in .elyra/workflows/. Shows each workflow name, description, and step count.",
369
365
  parameters: listSchema,
370
366
  promptSnippet: "List available workflow pipelines",
371
- async execute() {
367
+ async execute(): Promise<AgentToolResult<undefined>> {
372
368
  const workflowDir = join(cwd, ".elyra", "workflows");
373
369
  workflows = loadWorkflows(workflowDir);
374
370
 
@@ -377,9 +373,10 @@ export default function (elyra: ExtensionAPI): void {
377
373
  content: [
378
374
  {
379
375
  type: "text",
380
- text: "No workflows found. Create JSON files in .elyra/workflows/ to define pipelines.\n\nExample workflow (.elyra/workflows/check.json):\n```json\n{\n \"name\": \"check\",\n \"description\": \"Lint, test, and type-check\",\n \"steps\": [\n { \"name\": \"lint\", \"run\": \"npm run lint\" },\n { \"name\": \"test\", \"run\": \"npm test\" },\n { \"name\": \"types\", \"run\": \"npm run check\" }\n ]\n}\n```",
376
+ text: 'No workflows found. Create JSON files in .elyra/workflows/ to define pipelines.\n\nExample workflow (.elyra/workflows/check.json):\n```json\n{\n "name": "check",\n "description": "Lint, test, and type-check",\n "steps": [\n { "name": "lint", "run": "npm run lint" },\n { "name": "test", "run": "npm test" },\n { "name": "types", "run": "npm run check" }\n ]\n}\n```',
381
377
  },
382
378
  ],
379
+ details: undefined,
383
380
  };
384
381
  }
385
382
 
@@ -395,6 +392,7 @@ export default function (elyra: ExtensionAPI): void {
395
392
 
396
393
  return {
397
394
  content: [{ type: "text", text: `Available workflows:\n\n${lines.join("\n")}` }],
395
+ details: undefined,
398
396
  };
399
397
  },
400
398
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elyracode/workflows",
3
- "version": "0.9.56",
3
+ "version": "0.9.57",
4
4
  "description": "Code-orchestrated workflows for Elyra -- define multi-step pipelines where code handles control flow and LLMs handle judgment",
5
5
  "type": "module",
6
6
  "keywords": [