@enclave-vm/core 2.11.1 → 2.13.0

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.
package/esm/index.mjs CHANGED
@@ -10516,6 +10516,12 @@ var SessionEmitter = class {
10516
10516
  getSeq() {
10517
10517
  return this.seq;
10518
10518
  }
10519
+ /**
10520
+ * Advance and return the next sequence number.
10521
+ */
10522
+ nextSeq() {
10523
+ return ++this.seq;
10524
+ }
10519
10525
  /**
10520
10526
  * Emit a stream event
10521
10527
  */
@@ -10630,7 +10636,7 @@ var SessionEmitter = class {
10630
10636
  /**
10631
10637
  * Create and emit a final event (success)
10632
10638
  */
10633
- emitFinalSuccess(result, stats) {
10639
+ emitFinalSuccess(result, stats, errors) {
10634
10640
  const event = {
10635
10641
  protocolVersion: PROTOCOL_VERSION,
10636
10642
  sessionId: this.sessionId,
@@ -10639,6 +10645,7 @@ var SessionEmitter = class {
10639
10645
  payload: {
10640
10646
  ok: true,
10641
10647
  result,
10648
+ ...errors && errors.length > 0 && { errors },
10642
10649
  stats
10643
10650
  }
10644
10651
  };
@@ -10648,7 +10655,7 @@ var SessionEmitter = class {
10648
10655
  /**
10649
10656
  * Create and emit a final event (failure)
10650
10657
  */
10651
- emitFinalError(error, stats) {
10658
+ emitFinalError(error, stats, errors) {
10652
10659
  const event = {
10653
10660
  protocolVersion: PROTOCOL_VERSION,
10654
10661
  sessionId: this.sessionId,
@@ -10657,6 +10664,7 @@ var SessionEmitter = class {
10657
10664
  payload: {
10658
10665
  ok: false,
10659
10666
  error,
10667
+ ...errors && errors.length > 0 && { errors },
10660
10668
  stats
10661
10669
  }
10662
10670
  };
package/index.js CHANGED
@@ -10611,6 +10611,12 @@ var SessionEmitter = class {
10611
10611
  getSeq() {
10612
10612
  return this.seq;
10613
10613
  }
10614
+ /**
10615
+ * Advance and return the next sequence number.
10616
+ */
10617
+ nextSeq() {
10618
+ return ++this.seq;
10619
+ }
10614
10620
  /**
10615
10621
  * Emit a stream event
10616
10622
  */
@@ -10725,7 +10731,7 @@ var SessionEmitter = class {
10725
10731
  /**
10726
10732
  * Create and emit a final event (success)
10727
10733
  */
10728
- emitFinalSuccess(result, stats) {
10734
+ emitFinalSuccess(result, stats, errors) {
10729
10735
  const event = {
10730
10736
  protocolVersion: import_types8.PROTOCOL_VERSION,
10731
10737
  sessionId: this.sessionId,
@@ -10734,6 +10740,7 @@ var SessionEmitter = class {
10734
10740
  payload: {
10735
10741
  ok: true,
10736
10742
  result,
10743
+ ...errors && errors.length > 0 && { errors },
10737
10744
  stats
10738
10745
  }
10739
10746
  };
@@ -10743,7 +10750,7 @@ var SessionEmitter = class {
10743
10750
  /**
10744
10751
  * Create and emit a final event (failure)
10745
10752
  */
10746
- emitFinalError(error, stats) {
10753
+ emitFinalError(error, stats, errors) {
10747
10754
  const event = {
10748
10755
  protocolVersion: import_types8.PROTOCOL_VERSION,
10749
10756
  sessionId: this.sessionId,
@@ -10752,6 +10759,7 @@ var SessionEmitter = class {
10752
10759
  payload: {
10753
10760
  ok: false,
10754
10761
  error,
10762
+ ...errors && errors.length > 0 && { errors },
10755
10763
  stats
10756
10764
  }
10757
10765
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enclave-vm/core",
3
- "version": "2.11.1",
3
+ "version": "2.13.0",
4
4
  "description": "Sandbox runtime for secure JavaScript code execution",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://github.com/agentfront/enclave",
@@ -38,8 +38,8 @@
38
38
  },
39
39
  "dependencies": {
40
40
  "@babel/standalone": "^7.29.0",
41
- "@enclave-vm/types": "2.11.1",
42
- "@enclave-vm/ast": "2.11.1",
41
+ "@enclave-vm/types": "2.13.0",
42
+ "@enclave-vm/ast": "2.13.0",
43
43
  "acorn": "8.15.0",
44
44
  "acorn-walk": "8.3.4",
45
45
  "astring": "1.9.0",
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * @packageDocumentation
7
7
  */
8
- import type { SessionId, StreamEvent, SessionInitEvent, StdoutEvent, LogEvent, ToolCallEvent, ToolResultAppliedEvent, FinalEvent, HeartbeatEvent, ErrorEvent, EncryptionConfig, SessionStats, CallId, LogPayload, ErrorInfo } from '@enclave-vm/types';
8
+ import type { SessionId, StreamEvent, SessionInitEvent, StdoutEvent, LogEvent, ToolCallEvent, ToolResultAppliedEvent, FinalEvent, HeartbeatEvent, ErrorEvent, EncryptionConfig, SessionStats, CallId, LogPayload, ErrorInfo, ErrorPayload } from '@enclave-vm/types';
9
9
  import type { SessionEventEmitter } from '../session-types';
10
10
  /**
11
11
  * Configuration for SessionEmitter
@@ -52,6 +52,10 @@ export declare class SessionEmitter implements SessionEventEmitter {
52
52
  * Get current sequence number
53
53
  */
54
54
  getSeq(): number;
55
+ /**
56
+ * Advance and return the next sequence number.
57
+ */
58
+ nextSeq(): number;
55
59
  /**
56
60
  * Emit a stream event
57
61
  */
@@ -87,11 +91,11 @@ export declare class SessionEmitter implements SessionEventEmitter {
87
91
  /**
88
92
  * Create and emit a final event (success)
89
93
  */
90
- emitFinalSuccess(result: unknown, stats: SessionStats): FinalEvent;
94
+ emitFinalSuccess(result: unknown, stats: SessionStats, errors?: ErrorPayload[]): FinalEvent;
91
95
  /**
92
96
  * Create and emit a final event (failure)
93
97
  */
94
- emitFinalError(error: ErrorInfo, stats: SessionStats): FinalEvent;
98
+ emitFinalError(error: ErrorInfo, stats: SessionStats, errors?: ErrorPayload[]): FinalEvent;
95
99
  /**
96
100
  * Create and emit a heartbeat event
97
101
  */
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enclave-vm/core",
3
- "version": "2.11.1",
3
+ "version": "2.13.0",
4
4
  "description": "Sandbox runtime for secure JavaScript code execution",
5
5
  "author": "AgentFront <info@agentfront.dev>",
6
6
  "homepage": "https://github.com/agentfront/enclave",
@@ -39,8 +39,8 @@
39
39
  },
40
40
  "dependencies": {
41
41
  "@babel/standalone": "^7.29.0",
42
- "@enclave-vm/types": "2.11.1",
43
- "@enclave-vm/ast": "2.11.1",
42
+ "@enclave-vm/types": "2.13.0",
43
+ "@enclave-vm/ast": "2.13.0",
44
44
  "acorn": "8.15.0",
45
45
  "acorn-walk": "8.3.4",
46
46
  "astring": "1.9.0",