@kuralle-agents/core 0.3.1 → 0.3.2

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.
@@ -61,6 +61,15 @@ async function dispatchNode(node, run, driver, ctx) {
61
61
  if (!driver.runStructured) {
62
62
  throw new Error('ChannelDriver.runStructured is required for decide nodes');
63
63
  }
64
+ // An interactive choice node (withChoices) reached without the user's reply
65
+ // this turn: its choices were already presented on node-enter, so wait for
66
+ // the user to actually pick rather than auto-deciding on stale conversation
67
+ // context. Returning `stay` lets the loop park as `awaitingUser` (it already
68
+ // persists state + ends the turn when no input is pending). (A plain decide
69
+ // with no choices is a pure branch and still runs.)
70
+ if (node.choices?.length && !hasPendingUserInput(ctx.session)) {
71
+ return { kind: 'stay' };
72
+ }
64
73
  // On resume, the new turn's input is buffered as pending and is not yet in
65
74
  // the message history the decision reads. Consume it first (mirrors the
66
75
  // collect path) so the decision sees the user's actual reply instead of
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "url": "git+https://github.com/kuralle/kuralle-agents.git",
7
7
  "directory": "packages/kuralle-core"
8
8
  },
9
- "version": "0.3.1",
9
+ "version": "0.3.2",
10
10
  "description": "A framework for structured conversational AI agents",
11
11
  "publishConfig": {
12
12
  "access": "public"
@@ -97,7 +97,7 @@
97
97
  "dotenv": "^16.4.0",
98
98
  "typescript": "^5.3.0",
99
99
  "zod": "^3.23.0",
100
- "@kuralle-agents/realtime-audio": "0.3.1"
100
+ "@kuralle-agents/realtime-audio": "0.3.2"
101
101
  },
102
102
  "dependencies": {
103
103
  "chrono-node": "^2.6.0",