@jiggai/recipes 0.4.30 → 0.4.31

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.
@@ -2,7 +2,7 @@
2
2
  "id": "recipes",
3
3
  "name": "Recipes",
4
4
  "description": "Markdown recipes that scaffold agents and teams (workspace-local).",
5
- "version": "0.4.30",
5
+ "version": "0.4.31",
6
6
  "configSchema": {
7
7
  "type": "object",
8
8
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jiggai/recipes",
3
- "version": "0.4.30",
3
+ "version": "0.4.31",
4
4
  "description": "ClawRecipes plugin for OpenClaw (markdown recipes -> scaffold agents/teams)",
5
5
  "main": "index.ts",
6
6
  "type": "commonjs",
@@ -10,6 +10,9 @@
10
10
  ],
11
11
  "compat": {
12
12
  "pluginApi": "2026.3"
13
+ },
14
+ "build": {
15
+ "openclawVersion": "2026.3.28"
13
16
  }
14
17
  },
15
18
  "publishConfig": {
@@ -47,6 +47,8 @@ export function normalizeWorkflow(raw: unknown): Workflow {
47
47
  // LLM: allow either promptTemplatePath (preferred) or inline promptTemplate string
48
48
  ...(config['promptTemplate'] != null ? { promptTemplate: asString(config['promptTemplate']) } : {}),
49
49
  ...(config['promptTemplatePath'] != null ? { promptTemplatePath: asString(config['promptTemplatePath']) } : {}),
50
+ ...(config['model'] != null ? { model: asString(config['model']) } : {}),
51
+ ...(config['provider'] != null ? { provider: asString(config['provider']) } : {}),
50
52
 
51
53
  // Tool
52
54
  ...(config['tool'] != null ? { tool: asString(config['tool']) } : {}),
@@ -418,6 +418,19 @@ export async function runWorkflowWorkerTick(api: OpenClawPluginApi, opts: {
418
418
 
419
419
  const timeoutMsRaw = Number(asString(action['timeoutMs'] ?? (node as unknown as { config?: unknown })?.config?.['timeoutMs'] ?? '120000'));
420
420
  const timeoutMs = Number.isFinite(timeoutMsRaw) && timeoutMsRaw > 0 ? timeoutMsRaw : 120000;
421
+ const configuredModel = asString(action['model'] ?? (node as unknown as { config?: unknown })?.config?.['model']).trim();
422
+ const configuredProvider = asString(action['provider'] ?? (node as unknown as { config?: unknown })?.config?.['provider']).trim();
423
+ let provider = configuredProvider;
424
+ let model = configuredModel;
425
+ if (model) {
426
+ const slash = model.indexOf('/');
427
+ if (slash > 0 && slash < model.length - 1) {
428
+ const modelProvider = model.slice(0, slash).trim();
429
+ const bareModel = model.slice(slash + 1).trim();
430
+ if (!provider) provider = modelProvider;
431
+ if (provider === modelProvider) model = bareModel;
432
+ }
433
+ }
421
434
 
422
435
  // Inject team memory context for LLM nodes
423
436
  const memoryContext = await buildMemoryContext(teamDir);
@@ -430,6 +443,8 @@ export async function runWorkflowWorkerTick(api: OpenClawPluginApi, opts: {
430
443
  prompt: promptWithMemory,
431
444
  input: { teamId, runId, nodeId: node.id, agentId, ...priorInput },
432
445
  timeoutMs,
446
+ ...(provider ? { provider } : {}),
447
+ ...(model ? { model } : {}),
433
448
  },
434
449
  });
435
450
 
@@ -438,16 +453,34 @@ export async function runWorkflowWorkerTick(api: OpenClawPluginApi, opts: {
438
453
  const payload = details['json'] ?? (Object.keys(details).length ? details : llmRes) ?? null;
439
454
  text = JSON.stringify(payload, null, 2);
440
455
  } catch (e) {
441
- // Record the error on the run so it doesn't stay stuck in waiting_workers.
442
- const errMsg = `LLM execution failed for node ${nodeLabel(node)}: ${e instanceof Error ? e.message : String(e)}`;
456
+ const eRec = asRecord(e);
457
+ const errorDetails = {
458
+ message: e instanceof Error ? e.message : String(e),
459
+ name: e instanceof Error ? e.name : undefined,
460
+ stack: e instanceof Error ? e.stack : undefined,
461
+ error: eRec['error'],
462
+ details: eRec['details'],
463
+ data: eRec['data'],
464
+ cause: e instanceof Error && 'cause' in e ? (e as Error & { cause?: unknown }).cause : undefined,
465
+ };
466
+ const errMsg = `LLM execution failed for node ${nodeLabel(node)}: ${errorDetails.message}`;
443
467
  const errorTs = new Date().toISOString();
444
468
  await appendRunLog(runPath, (cur) => ({
445
469
  ...cur,
446
470
  status: 'error',
447
471
  updatedAt: errorTs,
448
- nodeStates: { ...(cur.nodeStates ?? {}), [node.id]: { status: 'error', ts: errorTs, error: errMsg } },
449
- events: [...cur.events, { ts: errorTs, type: 'node.error', nodeId: node.id, kind: node.kind, message: errMsg }],
450
- nodeResults: [...(cur.nodeResults ?? []), { nodeId: node.id, kind: node.kind, agentId: agentIdExec, error: errMsg }],
472
+ nodeStates: {
473
+ ...(cur.nodeStates ?? {}),
474
+ [node.id]: { status: 'error', ts: errorTs, error: errMsg, details: errorDetails },
475
+ },
476
+ events: [
477
+ ...cur.events,
478
+ { ts: errorTs, type: 'node.error', nodeId: node.id, kind: node.kind, message: errMsg, details: errorDetails },
479
+ ],
480
+ nodeResults: [
481
+ ...(cur.nodeResults ?? []),
482
+ { nodeId: node.id, kind: node.kind, agentId: agentIdExec, error: errMsg, details: errorDetails },
483
+ ],
451
484
  }));
452
485
  results.push({ taskId: task.id, runId: task.runId, nodeId: task.nodeId, status: 'error' });
453
486
  continue;