@saltcorn/agents 0.8.2 → 0.8.3

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.
Files changed (2) hide show
  1. package/agent-view.js +7 -7
  2. package/package.json +1 -1
package/agent-view.js CHANGED
@@ -309,13 +309,13 @@ const run = async (
309
309
 
310
310
  const initial_q = state.run_id ? undefined : state._q;
311
311
  if (state.run_id) {
312
- const run = prevRuns
313
- ? prevRuns.find((r) => r.id == state.run_id)
314
- : await WorkflowRun.findOne({
315
- trigger_id: action.id,
316
- ...(shared ? {} : { started_by: req.user?.id }),
317
- id: state.run_id,
318
- });
312
+ let run = prevRuns ? prevRuns.find((r) => r.id == state.run_id) : null;
313
+ if (!run)
314
+ run = await WorkflowRun.findOne({
315
+ trigger_id: action.id,
316
+ ...(shared ? {} : { started_by: req.user?.id }),
317
+ id: state.run_id,
318
+ });
319
319
  const interactMarkups = [];
320
320
  if (run.context.html_interactions) {
321
321
  interactMarkups.push(...run.context.html_interactions);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saltcorn/agents",
3
- "version": "0.8.2",
3
+ "version": "0.8.3",
4
4
  "description": "AI agents for Saltcorn",
5
5
  "main": "index.js",
6
6
  "dependencies": {