@rynx-ai/daemon 0.1.11-beta.36 → 0.1.11-beta.37

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.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rynx-ai/plugin-channel-lark",
3
- "version": "0.1.11-beta.36",
3
+ "version": "0.1.11-beta.37",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/rynx-ai/rynx.git",
@@ -558,6 +558,7 @@ export class PluginHostRpc {
558
558
  return result;
559
559
  }
560
560
  async pumpRun(run, generator) {
561
+ let terminalCompleted = false;
561
562
  let terminalFailure;
562
563
  try {
563
564
  for await (const event of generator) {
@@ -588,6 +589,10 @@ export class PluginHostRpc {
588
589
  terminalFailure = sessionRunFailure(event);
589
590
  if (terminalFailure)
590
591
  break;
592
+ if (sessionRunCompleted(event)) {
593
+ terminalCompleted = true;
594
+ break;
595
+ }
591
596
  }
592
597
  if (!this.disposed &&
593
598
  this.activeRuns.get(run.runId) === run &&
@@ -602,7 +607,7 @@ export class PluginHostRpc {
602
607
  },
603
608
  });
604
609
  }
605
- else {
610
+ else if (terminalCompleted) {
606
611
  await this.emit({
607
612
  event: "session.run.completed",
608
613
  payload: {
@@ -614,6 +619,20 @@ export class PluginHostRpc {
614
619
  },
615
620
  });
616
621
  }
622
+ else {
623
+ await this.emit({
624
+ event: "session.run.failed",
625
+ payload: {
626
+ runId: run.runId,
627
+ sessionId: run.sessionId,
628
+ error: {
629
+ code: "RUNTIME_EVENT_STREAM_ENDED",
630
+ message: "Runtime event stream ended before a terminal response event",
631
+ retryable: true,
632
+ },
633
+ },
634
+ });
635
+ }
617
636
  }
618
637
  }
619
638
  catch (error) {
@@ -1509,6 +1528,13 @@ function sessionEventResponseId(event) {
1509
1528
  }
1510
1529
  function sessionRunFailure(event) {
1511
1530
  const input = jsonRecord(event);
1531
+ if (input?.type === "session.interrupted") {
1532
+ return {
1533
+ code: "RUNTIME_TURN_INTERRUPTED",
1534
+ message: "Runtime Turn was interrupted",
1535
+ retryable: false,
1536
+ };
1537
+ }
1512
1538
  if (input?.type !== "response.failed")
1513
1539
  return undefined;
1514
1540
  const error = jsonRecord(input.error);
@@ -1524,6 +1550,9 @@ function sessionRunFailure(event) {
1524
1550
  retryable: false,
1525
1551
  };
1526
1552
  }
1553
+ function sessionRunCompleted(event) {
1554
+ return jsonRecord(event)?.type === "response.completed";
1555
+ }
1527
1556
  function sessionHostEvent(run, event, delivery) {
1528
1557
  return {
1529
1558
  event: "session.run.event",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rynx-ai/daemon",
3
- "version": "0.1.11-beta.36",
3
+ "version": "0.1.11-beta.37",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/rynx-ai/rynx.git",
@@ -51,17 +51,17 @@
51
51
  "tar": "^7.5.19",
52
52
  "undici": "^7.28.0",
53
53
  "ws": "^8.21.0",
54
- "@rynx-ai/core": "0.1.11-beta.36",
55
- "@rynx-ai/emulator": "0.1.11-beta.36",
56
- "@rynx-ai/plugin-sdk": "0.1.11-beta.36",
57
- "@rynx-ai/plugin-runner": "0.1.11-beta.36",
58
- "@rynx-ai/protocol": "0.1.11-beta.36",
59
- "@rynx-ai/remote-runtime-client": "0.1.11-beta.36",
60
- "@rynx-ai/server": "0.1.11-beta.36"
54
+ "@rynx-ai/plugin-runner": "0.1.11-beta.37",
55
+ "@rynx-ai/emulator": "0.1.11-beta.37",
56
+ "@rynx-ai/core": "0.1.11-beta.37",
57
+ "@rynx-ai/plugin-sdk": "0.1.11-beta.37",
58
+ "@rynx-ai/protocol": "0.1.11-beta.37",
59
+ "@rynx-ai/remote-runtime-client": "0.1.11-beta.37",
60
+ "@rynx-ai/server": "0.1.11-beta.37"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@types/ws": "^8.18.1",
64
- "@rynx-ai/plugin-channel-lark": "0.1.11-beta.36"
64
+ "@rynx-ai/plugin-channel-lark": "0.1.11-beta.37"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "rm -rf dist bundled-plugins && tsc -p tsconfig.json && chmod +x dist/index-daemon.js && node ../../scripts/stage-bundled-plugins.mjs",