@noetic-tools/core 2.2.0 → 2.2.1

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.
@@ -205,7 +205,12 @@ function finalizeCodecOutput(codec, lastText, ctx, emit) {
205
205
  const session = codec.start();
206
206
  const broadcaster = getBroadcaster(ctx);
207
207
  const agentName = ctx.harness.config.name;
208
- session.push(lastText, (eventType, data) => {
208
+ // A streaming codec emits per completed (newline-terminated) statement, so the
209
+ // final line — usually `root` — would stay buffered and never be emitted.
210
+ // Push a newline-terminated copy so that last statement is flushed as an event
211
+ // too; `finish` still reparses the original text for the returned value.
212
+ const textForEmit = lastText.endsWith('\n') ? lastText : `${lastText}\n`;
213
+ session.push(textForEmit, (eventType, data) => {
209
214
  if (shouldEmit(emit, eventType, data)) {
210
215
  emitFrameworkEvent({
211
216
  broadcaster,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noetic-tools/core",
3
- "version": "2.2.0",
3
+ "version": "2.2.1",
4
4
  "type": "module",
5
5
  "description": "Step primitives, interpreter, runtime, and memory layer contract for Noetic agents.",
6
6
  "license": "Apache-2.0",