@enclave-vm/types 0.0.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.
package/src/index.js ADDED
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ /**
3
+ * @enclave-vm/types
4
+ *
5
+ * Type definitions and Zod schemas for the EnclaveJS streaming runtime protocol.
6
+ *
7
+ * @packageDocumentation
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.SessionInitPayloadSchema = exports.EncryptionConfigSchema = exports.BaseEventSchema = exports.ToolConfigSchema = exports.SessionLimitsSchema = exports.RefTokenSchema = exports.ErrorInfoSchema = exports.SessionStateSchema = exports.LogLevelSchema = exports.RefIdSchema = exports.CallIdSchema = exports.SessionIdSchema = exports.ProtocolVersionSchema = exports.isEncryptedEnvelope = exports.MAX_MESSAGES_PER_KEY = exports.AES_256_KEY_SIZE = exports.AES_GCM_TAG_SIZE = exports.AES_GCM_NONCE_SIZE = exports.HkdfInfo = exports.EncryptionErrorCode = exports.EncryptionMode = exports.KeyDerivation = exports.EncryptionAlgorithm = exports.SupportedCurve = exports.isErrorEvent = exports.isHeartbeatEvent = exports.isFinalEvent = exports.isToolResultAppliedEvent = exports.isToolCallEvent = exports.isLogEvent = exports.isStdoutEvent = exports.isSessionInitEvent = exports.getEventType = exports.RuntimeChannelMessageType = exports.EventType = exports.createRefToken = exports.isRefToken = exports.LogLevel = exports.SessionState = exports.DEFAULT_SESSION_LIMITS = exports.isRefId = exports.isCallId = exports.isSessionId = exports.generateRefId = exports.generateCallId = exports.generateSessionId = exports.REF_ID_PREFIX = exports.CALL_ID_PREFIX = exports.SESSION_ID_PREFIX = exports.PROTOCOL_VERSION = void 0;
11
+ exports.DEFAULT_ALWAYS_ALLOW = exports.PatternType = exports.FilterMode = exports.parseStreamEventOrEncrypted = exports.parseCreateSessionRequest = exports.parseRuntimeChannelMessage = exports.parseEncryptedEnvelope = exports.parseStreamEvent = exports.CreateSessionRequestSchema = exports.RuntimeChannelMessageSchema = exports.CancelMessageSchema = exports.CancelPayloadSchema = exports.ToolResultSubmitMessageSchema = exports.ToolResultSubmitPayloadSchema = exports.EncryptionRequestSchema = exports.ServerHelloSchema = exports.ClientHelloSchema = exports.EncryptedEnvelopeSchema = exports.EncryptedEnvelopePayloadSchema = exports.EncryptionModeSchema = exports.KeyDerivationSchema = exports.EncryptionAlgorithmSchema = exports.SupportedCurveSchema = exports.StreamEventSchema = exports.ErrorEventSchema = exports.HeartbeatEventSchema = exports.FinalEventSchema = exports.ToolResultAppliedEventSchema = exports.ToolCallEventSchema = exports.LogEventSchema = exports.StdoutEventSchema = exports.SessionInitEventSchema = exports.ErrorEventPayloadSchema = exports.HeartbeatPayloadSchema = exports.FinalPayloadSchema = exports.SessionStatsSchema = exports.ToolResultAppliedPayloadSchema = exports.ToolCallPayloadSchema = exports.LogPayloadSchema = exports.StdoutPayloadSchema = void 0;
12
+ // Protocol exports
13
+ var protocol_js_1 = require("./protocol.js");
14
+ Object.defineProperty(exports, "PROTOCOL_VERSION", { enumerable: true, get: function () { return protocol_js_1.PROTOCOL_VERSION; } });
15
+ Object.defineProperty(exports, "SESSION_ID_PREFIX", { enumerable: true, get: function () { return protocol_js_1.SESSION_ID_PREFIX; } });
16
+ Object.defineProperty(exports, "CALL_ID_PREFIX", { enumerable: true, get: function () { return protocol_js_1.CALL_ID_PREFIX; } });
17
+ Object.defineProperty(exports, "REF_ID_PREFIX", { enumerable: true, get: function () { return protocol_js_1.REF_ID_PREFIX; } });
18
+ Object.defineProperty(exports, "generateSessionId", { enumerable: true, get: function () { return protocol_js_1.generateSessionId; } });
19
+ Object.defineProperty(exports, "generateCallId", { enumerable: true, get: function () { return protocol_js_1.generateCallId; } });
20
+ Object.defineProperty(exports, "generateRefId", { enumerable: true, get: function () { return protocol_js_1.generateRefId; } });
21
+ Object.defineProperty(exports, "isSessionId", { enumerable: true, get: function () { return protocol_js_1.isSessionId; } });
22
+ Object.defineProperty(exports, "isCallId", { enumerable: true, get: function () { return protocol_js_1.isCallId; } });
23
+ Object.defineProperty(exports, "isRefId", { enumerable: true, get: function () { return protocol_js_1.isRefId; } });
24
+ Object.defineProperty(exports, "DEFAULT_SESSION_LIMITS", { enumerable: true, get: function () { return protocol_js_1.DEFAULT_SESSION_LIMITS; } });
25
+ Object.defineProperty(exports, "SessionState", { enumerable: true, get: function () { return protocol_js_1.SessionState; } });
26
+ Object.defineProperty(exports, "LogLevel", { enumerable: true, get: function () { return protocol_js_1.LogLevel; } });
27
+ Object.defineProperty(exports, "isRefToken", { enumerable: true, get: function () { return protocol_js_1.isRefToken; } });
28
+ Object.defineProperty(exports, "createRefToken", { enumerable: true, get: function () { return protocol_js_1.createRefToken; } });
29
+ // Event exports
30
+ var events_js_1 = require("./events.js");
31
+ Object.defineProperty(exports, "EventType", { enumerable: true, get: function () { return events_js_1.EventType; } });
32
+ Object.defineProperty(exports, "RuntimeChannelMessageType", { enumerable: true, get: function () { return events_js_1.RuntimeChannelMessageType; } });
33
+ Object.defineProperty(exports, "getEventType", { enumerable: true, get: function () { return events_js_1.getEventType; } });
34
+ Object.defineProperty(exports, "isSessionInitEvent", { enumerable: true, get: function () { return events_js_1.isSessionInitEvent; } });
35
+ Object.defineProperty(exports, "isStdoutEvent", { enumerable: true, get: function () { return events_js_1.isStdoutEvent; } });
36
+ Object.defineProperty(exports, "isLogEvent", { enumerable: true, get: function () { return events_js_1.isLogEvent; } });
37
+ Object.defineProperty(exports, "isToolCallEvent", { enumerable: true, get: function () { return events_js_1.isToolCallEvent; } });
38
+ Object.defineProperty(exports, "isToolResultAppliedEvent", { enumerable: true, get: function () { return events_js_1.isToolResultAppliedEvent; } });
39
+ Object.defineProperty(exports, "isFinalEvent", { enumerable: true, get: function () { return events_js_1.isFinalEvent; } });
40
+ Object.defineProperty(exports, "isHeartbeatEvent", { enumerable: true, get: function () { return events_js_1.isHeartbeatEvent; } });
41
+ Object.defineProperty(exports, "isErrorEvent", { enumerable: true, get: function () { return events_js_1.isErrorEvent; } });
42
+ // Encryption exports
43
+ var encryption_js_1 = require("./encryption.js");
44
+ Object.defineProperty(exports, "SupportedCurve", { enumerable: true, get: function () { return encryption_js_1.SupportedCurve; } });
45
+ Object.defineProperty(exports, "EncryptionAlgorithm", { enumerable: true, get: function () { return encryption_js_1.EncryptionAlgorithm; } });
46
+ Object.defineProperty(exports, "KeyDerivation", { enumerable: true, get: function () { return encryption_js_1.KeyDerivation; } });
47
+ Object.defineProperty(exports, "EncryptionMode", { enumerable: true, get: function () { return encryption_js_1.EncryptionMode; } });
48
+ Object.defineProperty(exports, "EncryptionErrorCode", { enumerable: true, get: function () { return encryption_js_1.EncryptionErrorCode; } });
49
+ Object.defineProperty(exports, "HkdfInfo", { enumerable: true, get: function () { return encryption_js_1.HkdfInfo; } });
50
+ Object.defineProperty(exports, "AES_GCM_NONCE_SIZE", { enumerable: true, get: function () { return encryption_js_1.AES_GCM_NONCE_SIZE; } });
51
+ Object.defineProperty(exports, "AES_GCM_TAG_SIZE", { enumerable: true, get: function () { return encryption_js_1.AES_GCM_TAG_SIZE; } });
52
+ Object.defineProperty(exports, "AES_256_KEY_SIZE", { enumerable: true, get: function () { return encryption_js_1.AES_256_KEY_SIZE; } });
53
+ Object.defineProperty(exports, "MAX_MESSAGES_PER_KEY", { enumerable: true, get: function () { return encryption_js_1.MAX_MESSAGES_PER_KEY; } });
54
+ Object.defineProperty(exports, "isEncryptedEnvelope", { enumerable: true, get: function () { return encryption_js_1.isEncryptedEnvelope; } });
55
+ // Schema exports
56
+ var schemas_js_1 = require("./schemas.js");
57
+ // Base schemas
58
+ Object.defineProperty(exports, "ProtocolVersionSchema", { enumerable: true, get: function () { return schemas_js_1.ProtocolVersionSchema; } });
59
+ Object.defineProperty(exports, "SessionIdSchema", { enumerable: true, get: function () { return schemas_js_1.SessionIdSchema; } });
60
+ Object.defineProperty(exports, "CallIdSchema", { enumerable: true, get: function () { return schemas_js_1.CallIdSchema; } });
61
+ Object.defineProperty(exports, "RefIdSchema", { enumerable: true, get: function () { return schemas_js_1.RefIdSchema; } });
62
+ Object.defineProperty(exports, "LogLevelSchema", { enumerable: true, get: function () { return schemas_js_1.LogLevelSchema; } });
63
+ Object.defineProperty(exports, "SessionStateSchema", { enumerable: true, get: function () { return schemas_js_1.SessionStateSchema; } });
64
+ Object.defineProperty(exports, "ErrorInfoSchema", { enumerable: true, get: function () { return schemas_js_1.ErrorInfoSchema; } });
65
+ Object.defineProperty(exports, "RefTokenSchema", { enumerable: true, get: function () { return schemas_js_1.RefTokenSchema; } });
66
+ Object.defineProperty(exports, "SessionLimitsSchema", { enumerable: true, get: function () { return schemas_js_1.SessionLimitsSchema; } });
67
+ Object.defineProperty(exports, "ToolConfigSchema", { enumerable: true, get: function () { return schemas_js_1.ToolConfigSchema; } });
68
+ Object.defineProperty(exports, "BaseEventSchema", { enumerable: true, get: function () { return schemas_js_1.BaseEventSchema; } });
69
+ // Event payload schemas
70
+ Object.defineProperty(exports, "EncryptionConfigSchema", { enumerable: true, get: function () { return schemas_js_1.EncryptionConfigSchema; } });
71
+ Object.defineProperty(exports, "SessionInitPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.SessionInitPayloadSchema; } });
72
+ Object.defineProperty(exports, "StdoutPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.StdoutPayloadSchema; } });
73
+ Object.defineProperty(exports, "LogPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.LogPayloadSchema; } });
74
+ Object.defineProperty(exports, "ToolCallPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.ToolCallPayloadSchema; } });
75
+ Object.defineProperty(exports, "ToolResultAppliedPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.ToolResultAppliedPayloadSchema; } });
76
+ Object.defineProperty(exports, "SessionStatsSchema", { enumerable: true, get: function () { return schemas_js_1.SessionStatsSchema; } });
77
+ Object.defineProperty(exports, "FinalPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.FinalPayloadSchema; } });
78
+ Object.defineProperty(exports, "HeartbeatPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.HeartbeatPayloadSchema; } });
79
+ Object.defineProperty(exports, "ErrorEventPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.ErrorEventPayloadSchema; } });
80
+ // Event schemas
81
+ Object.defineProperty(exports, "SessionInitEventSchema", { enumerable: true, get: function () { return schemas_js_1.SessionInitEventSchema; } });
82
+ Object.defineProperty(exports, "StdoutEventSchema", { enumerable: true, get: function () { return schemas_js_1.StdoutEventSchema; } });
83
+ Object.defineProperty(exports, "LogEventSchema", { enumerable: true, get: function () { return schemas_js_1.LogEventSchema; } });
84
+ Object.defineProperty(exports, "ToolCallEventSchema", { enumerable: true, get: function () { return schemas_js_1.ToolCallEventSchema; } });
85
+ Object.defineProperty(exports, "ToolResultAppliedEventSchema", { enumerable: true, get: function () { return schemas_js_1.ToolResultAppliedEventSchema; } });
86
+ Object.defineProperty(exports, "FinalEventSchema", { enumerable: true, get: function () { return schemas_js_1.FinalEventSchema; } });
87
+ Object.defineProperty(exports, "HeartbeatEventSchema", { enumerable: true, get: function () { return schemas_js_1.HeartbeatEventSchema; } });
88
+ Object.defineProperty(exports, "ErrorEventSchema", { enumerable: true, get: function () { return schemas_js_1.ErrorEventSchema; } });
89
+ Object.defineProperty(exports, "StreamEventSchema", { enumerable: true, get: function () { return schemas_js_1.StreamEventSchema; } });
90
+ // Encryption schemas
91
+ Object.defineProperty(exports, "SupportedCurveSchema", { enumerable: true, get: function () { return schemas_js_1.SupportedCurveSchema; } });
92
+ Object.defineProperty(exports, "EncryptionAlgorithmSchema", { enumerable: true, get: function () { return schemas_js_1.EncryptionAlgorithmSchema; } });
93
+ Object.defineProperty(exports, "KeyDerivationSchema", { enumerable: true, get: function () { return schemas_js_1.KeyDerivationSchema; } });
94
+ Object.defineProperty(exports, "EncryptionModeSchema", { enumerable: true, get: function () { return schemas_js_1.EncryptionModeSchema; } });
95
+ Object.defineProperty(exports, "EncryptedEnvelopePayloadSchema", { enumerable: true, get: function () { return schemas_js_1.EncryptedEnvelopePayloadSchema; } });
96
+ Object.defineProperty(exports, "EncryptedEnvelopeSchema", { enumerable: true, get: function () { return schemas_js_1.EncryptedEnvelopeSchema; } });
97
+ Object.defineProperty(exports, "ClientHelloSchema", { enumerable: true, get: function () { return schemas_js_1.ClientHelloSchema; } });
98
+ Object.defineProperty(exports, "ServerHelloSchema", { enumerable: true, get: function () { return schemas_js_1.ServerHelloSchema; } });
99
+ Object.defineProperty(exports, "EncryptionRequestSchema", { enumerable: true, get: function () { return schemas_js_1.EncryptionRequestSchema; } });
100
+ // Runtime channel schemas
101
+ Object.defineProperty(exports, "ToolResultSubmitPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.ToolResultSubmitPayloadSchema; } });
102
+ Object.defineProperty(exports, "ToolResultSubmitMessageSchema", { enumerable: true, get: function () { return schemas_js_1.ToolResultSubmitMessageSchema; } });
103
+ Object.defineProperty(exports, "CancelPayloadSchema", { enumerable: true, get: function () { return schemas_js_1.CancelPayloadSchema; } });
104
+ Object.defineProperty(exports, "CancelMessageSchema", { enumerable: true, get: function () { return schemas_js_1.CancelMessageSchema; } });
105
+ Object.defineProperty(exports, "RuntimeChannelMessageSchema", { enumerable: true, get: function () { return schemas_js_1.RuntimeChannelMessageSchema; } });
106
+ // Session request schemas
107
+ Object.defineProperty(exports, "CreateSessionRequestSchema", { enumerable: true, get: function () { return schemas_js_1.CreateSessionRequestSchema; } });
108
+ // Validation helpers
109
+ Object.defineProperty(exports, "parseStreamEvent", { enumerable: true, get: function () { return schemas_js_1.parseStreamEvent; } });
110
+ Object.defineProperty(exports, "parseEncryptedEnvelope", { enumerable: true, get: function () { return schemas_js_1.parseEncryptedEnvelope; } });
111
+ Object.defineProperty(exports, "parseRuntimeChannelMessage", { enumerable: true, get: function () { return schemas_js_1.parseRuntimeChannelMessage; } });
112
+ Object.defineProperty(exports, "parseCreateSessionRequest", { enumerable: true, get: function () { return schemas_js_1.parseCreateSessionRequest; } });
113
+ Object.defineProperty(exports, "parseStreamEventOrEncrypted", { enumerable: true, get: function () { return schemas_js_1.parseStreamEventOrEncrypted; } });
114
+ // Filter exports
115
+ var filter_js_1 = require("./filter.js");
116
+ Object.defineProperty(exports, "FilterMode", { enumerable: true, get: function () { return filter_js_1.FilterMode; } });
117
+ Object.defineProperty(exports, "PatternType", { enumerable: true, get: function () { return filter_js_1.PatternType; } });
118
+ Object.defineProperty(exports, "DEFAULT_ALWAYS_ALLOW", { enumerable: true, get: function () { return filter_js_1.DEFAULT_ALWAYS_ALLOW; } });
119
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"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","sourcesContent":["/**\n * @enclave-vm/types\n *\n * Type definitions and Zod schemas for the EnclaveJS streaming runtime protocol.\n *\n * @packageDocumentation\n */\n\n// Protocol exports\nexport {\n PROTOCOL_VERSION,\n SESSION_ID_PREFIX,\n CALL_ID_PREFIX,\n REF_ID_PREFIX,\n generateSessionId,\n generateCallId,\n generateRefId,\n isSessionId,\n isCallId,\n isRefId,\n DEFAULT_SESSION_LIMITS,\n SessionState,\n LogLevel,\n isRefToken,\n createRefToken,\n} from './protocol.js';\n\nexport type {\n ProtocolVersion,\n SessionId,\n CallId,\n RefId,\n SessionLimits,\n ToolConfig,\n RefToken,\n ErrorInfo,\n} from './protocol.js';\n\n// Event exports\nexport {\n EventType,\n RuntimeChannelMessageType,\n getEventType,\n isSessionInitEvent,\n isStdoutEvent,\n isLogEvent,\n isToolCallEvent,\n isToolResultAppliedEvent,\n isFinalEvent,\n isHeartbeatEvent,\n isErrorEvent,\n} from './events.js';\n\nexport type {\n BaseEvent,\n EncryptionConfig,\n SessionInitPayload,\n SessionInitEvent,\n StdoutPayload,\n StdoutEvent,\n LogPayload,\n LogEvent,\n ToolCallPayload,\n ToolCallEvent,\n ToolResultAppliedPayload,\n ToolResultAppliedEvent,\n FinalPayload,\n SessionStats,\n FinalEvent,\n HeartbeatPayload,\n HeartbeatEvent,\n ErrorEventPayload,\n ErrorEvent,\n StreamEvent,\n ToolResultSubmitPayload,\n ToolResultSubmitMessage,\n CancelPayload,\n CancelMessage,\n RuntimeChannelMessage,\n} from './events.js';\n\n// Encryption exports\nexport {\n SupportedCurve,\n EncryptionAlgorithm,\n KeyDerivation,\n EncryptionMode,\n EncryptionErrorCode,\n HkdfInfo,\n AES_GCM_NONCE_SIZE,\n AES_GCM_TAG_SIZE,\n AES_256_KEY_SIZE,\n MAX_MESSAGES_PER_KEY,\n isEncryptedEnvelope,\n} from './encryption.js';\n\nexport type {\n EncryptedEnvelopePayload,\n EncryptedEnvelope,\n ClientHello,\n ServerHello,\n EncryptionRequest,\n SessionKeyInfo,\n MaybeEncrypted,\n} from './encryption.js';\n\n// Schema exports\nexport {\n // Base schemas\n ProtocolVersionSchema,\n SessionIdSchema,\n CallIdSchema,\n RefIdSchema,\n LogLevelSchema,\n SessionStateSchema,\n ErrorInfoSchema,\n RefTokenSchema,\n SessionLimitsSchema,\n ToolConfigSchema,\n BaseEventSchema,\n // Event payload schemas\n EncryptionConfigSchema,\n SessionInitPayloadSchema,\n StdoutPayloadSchema,\n LogPayloadSchema,\n ToolCallPayloadSchema,\n ToolResultAppliedPayloadSchema,\n SessionStatsSchema,\n FinalPayloadSchema,\n HeartbeatPayloadSchema,\n ErrorEventPayloadSchema,\n // Event schemas\n SessionInitEventSchema,\n StdoutEventSchema,\n LogEventSchema,\n ToolCallEventSchema,\n ToolResultAppliedEventSchema,\n FinalEventSchema,\n HeartbeatEventSchema,\n ErrorEventSchema,\n StreamEventSchema,\n // Encryption schemas\n SupportedCurveSchema,\n EncryptionAlgorithmSchema,\n KeyDerivationSchema,\n EncryptionModeSchema,\n EncryptedEnvelopePayloadSchema,\n EncryptedEnvelopeSchema,\n ClientHelloSchema,\n ServerHelloSchema,\n EncryptionRequestSchema,\n // Runtime channel schemas\n ToolResultSubmitPayloadSchema,\n ToolResultSubmitMessageSchema,\n CancelPayloadSchema,\n CancelMessageSchema,\n RuntimeChannelMessageSchema,\n // Session request schemas\n CreateSessionRequestSchema,\n // Validation helpers\n parseStreamEvent,\n parseEncryptedEnvelope,\n parseRuntimeChannelMessage,\n parseCreateSessionRequest,\n parseStreamEventOrEncrypted,\n} from './schemas.js';\n\nexport type {\n ParsedStreamEvent,\n ParsedEncryptedEnvelope,\n ParsedRuntimeChannelMessage,\n ParsedCreateSessionRequest,\n} from './schemas.js';\n\n// Filter exports\nexport { FilterMode, PatternType, DEFAULT_ALWAYS_ALLOW } from './filter.js';\n\nexport type { ContentPattern, TypeFilter, ContentFilter, FilterRule, EventFilterConfig } from './filter.js';\n"]}
@@ -0,0 +1,183 @@
1
+ /**
2
+ * @enclave-vm/types - Protocol definitions
3
+ *
4
+ * Core protocol constants and base types for the EnclaveJS streaming runtime.
5
+ */
6
+ /**
7
+ * Current protocol version.
8
+ * Increment when making breaking changes to the wire format.
9
+ */
10
+ export declare const PROTOCOL_VERSION: 1;
11
+ /**
12
+ * Protocol version type for type-safe versioning.
13
+ */
14
+ export type ProtocolVersion = typeof PROTOCOL_VERSION;
15
+ /**
16
+ * Session ID prefix for identification and debugging.
17
+ */
18
+ export declare const SESSION_ID_PREFIX: "s_";
19
+ /**
20
+ * Call ID prefix for tool call identification.
21
+ */
22
+ export declare const CALL_ID_PREFIX: "c_";
23
+ /**
24
+ * Reference ID prefix for sidecar references.
25
+ */
26
+ export declare const REF_ID_PREFIX: "ref_";
27
+ /**
28
+ * Session identifier type.
29
+ */
30
+ export type SessionId = `${typeof SESSION_ID_PREFIX}${string}`;
31
+ /**
32
+ * Tool call identifier type.
33
+ */
34
+ export type CallId = `${typeof CALL_ID_PREFIX}${string}`;
35
+ /**
36
+ * Reference identifier type.
37
+ */
38
+ export type RefId = `${typeof REF_ID_PREFIX}${string}`;
39
+ /**
40
+ * Generate a unique session ID.
41
+ */
42
+ export declare function generateSessionId(): SessionId;
43
+ /**
44
+ * Generate a unique call ID.
45
+ */
46
+ export declare function generateCallId(): CallId;
47
+ /**
48
+ * Generate a unique reference ID.
49
+ */
50
+ export declare function generateRefId(): RefId;
51
+ /**
52
+ * Check if a string is a valid session ID.
53
+ */
54
+ export declare function isSessionId(value: string): value is SessionId;
55
+ /**
56
+ * Check if a string is a valid call ID.
57
+ */
58
+ export declare function isCallId(value: string): value is CallId;
59
+ /**
60
+ * Check if a string is a valid reference ID.
61
+ */
62
+ export declare function isRefId(value: string): value is RefId;
63
+ /**
64
+ * Session limits configuration.
65
+ */
66
+ export interface SessionLimits {
67
+ /**
68
+ * Maximum session duration in milliseconds.
69
+ * @default 60000 (1 minute)
70
+ */
71
+ sessionTtlMs?: number;
72
+ /**
73
+ * Maximum number of tool calls allowed in a session.
74
+ * @default 50
75
+ */
76
+ maxToolCalls?: number;
77
+ /**
78
+ * Maximum stdout/output bytes.
79
+ * @default 262144 (256KB)
80
+ */
81
+ maxStdoutBytes?: number;
82
+ /**
83
+ * Maximum size of a single tool result in bytes.
84
+ * @default 5242880 (5MB)
85
+ */
86
+ maxToolResultBytes?: number;
87
+ /**
88
+ * Individual tool execution timeout in milliseconds.
89
+ * @default 30000 (30 seconds)
90
+ */
91
+ toolTimeoutMs?: number;
92
+ /**
93
+ * Heartbeat interval in milliseconds.
94
+ * @default 15000 (15 seconds)
95
+ */
96
+ heartbeatIntervalMs?: number;
97
+ }
98
+ /**
99
+ * Default session limits.
100
+ */
101
+ export declare const DEFAULT_SESSION_LIMITS: Required<SessionLimits>;
102
+ /**
103
+ * Session state enumeration.
104
+ */
105
+ export declare const SessionState: {
106
+ /** Session is starting up */
107
+ readonly Starting: "starting";
108
+ /** Session is actively running code */
109
+ readonly Running: "running";
110
+ /** Session is waiting for a tool result */
111
+ readonly WaitingForTool: "waiting_for_tool";
112
+ /** Session completed successfully */
113
+ readonly Completed: "completed";
114
+ /** Session was cancelled */
115
+ readonly Cancelled: "cancelled";
116
+ /** Session failed with an error */
117
+ readonly Failed: "failed";
118
+ };
119
+ export type SessionState = (typeof SessionState)[keyof typeof SessionState];
120
+ /**
121
+ * Tool configuration for timeout and retry behavior.
122
+ */
123
+ export interface ToolConfig {
124
+ /**
125
+ * Tool execution timeout in milliseconds.
126
+ * Overrides session-level toolTimeoutMs.
127
+ */
128
+ timeout?: number;
129
+ /**
130
+ * Whether the tool can be retried on failure.
131
+ * @default false
132
+ */
133
+ retryable?: boolean;
134
+ /**
135
+ * Maximum number of retries if retryable is true.
136
+ * @default 3
137
+ */
138
+ maxRetries?: number;
139
+ /**
140
+ * Whether the tool result can be read by runtime code.
141
+ * If false, result is always stored as a reference.
142
+ * @default true
143
+ */
144
+ runtimeReadable?: boolean;
145
+ }
146
+ /**
147
+ * Reference token for pass-by-reference values.
148
+ * Used to avoid transmitting large/sensitive values through the runtime.
149
+ */
150
+ export interface RefToken {
151
+ $ref: {
152
+ id: RefId;
153
+ };
154
+ }
155
+ /**
156
+ * Check if a value is a reference token.
157
+ */
158
+ export declare function isRefToken(value: unknown): value is RefToken;
159
+ /**
160
+ * Create a reference token from a ref ID.
161
+ */
162
+ export declare function createRefToken(id: RefId): RefToken;
163
+ /**
164
+ * Error information structure.
165
+ */
166
+ export interface ErrorInfo {
167
+ /** Human-readable error message */
168
+ message: string;
169
+ /** Machine-readable error code */
170
+ code?: string;
171
+ /** Stack trace (only in development/debug mode) */
172
+ stack?: string;
173
+ }
174
+ /**
175
+ * Log levels for session logging.
176
+ */
177
+ export declare const LogLevel: {
178
+ readonly Debug: "debug";
179
+ readonly Info: "info";
180
+ readonly Warn: "warn";
181
+ readonly Error: "error";
182
+ };
183
+ export type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ /**
3
+ * @enclave-vm/types - Protocol definitions
4
+ *
5
+ * Core protocol constants and base types for the EnclaveJS streaming runtime.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.LogLevel = exports.SessionState = exports.DEFAULT_SESSION_LIMITS = exports.REF_ID_PREFIX = exports.CALL_ID_PREFIX = exports.SESSION_ID_PREFIX = exports.PROTOCOL_VERSION = void 0;
9
+ exports.generateSessionId = generateSessionId;
10
+ exports.generateCallId = generateCallId;
11
+ exports.generateRefId = generateRefId;
12
+ exports.isSessionId = isSessionId;
13
+ exports.isCallId = isCallId;
14
+ exports.isRefId = isRefId;
15
+ exports.isRefToken = isRefToken;
16
+ exports.createRefToken = createRefToken;
17
+ /**
18
+ * Current protocol version.
19
+ * Increment when making breaking changes to the wire format.
20
+ */
21
+ exports.PROTOCOL_VERSION = 1;
22
+ /**
23
+ * Session ID prefix for identification and debugging.
24
+ */
25
+ exports.SESSION_ID_PREFIX = 's_';
26
+ /**
27
+ * Call ID prefix for tool call identification.
28
+ */
29
+ exports.CALL_ID_PREFIX = 'c_';
30
+ /**
31
+ * Reference ID prefix for sidecar references.
32
+ */
33
+ exports.REF_ID_PREFIX = 'ref_';
34
+ /**
35
+ * Generate a unique session ID.
36
+ */
37
+ function generateSessionId() {
38
+ return `${exports.SESSION_ID_PREFIX}${crypto.randomUUID()}`;
39
+ }
40
+ /**
41
+ * Generate a unique call ID.
42
+ */
43
+ function generateCallId() {
44
+ return `${exports.CALL_ID_PREFIX}${crypto.randomUUID()}`;
45
+ }
46
+ /**
47
+ * Generate a unique reference ID.
48
+ */
49
+ function generateRefId() {
50
+ return `${exports.REF_ID_PREFIX}${crypto.randomUUID()}`;
51
+ }
52
+ /**
53
+ * Check if a string is a valid session ID.
54
+ */
55
+ function isSessionId(value) {
56
+ return value.startsWith(exports.SESSION_ID_PREFIX);
57
+ }
58
+ /**
59
+ * Check if a string is a valid call ID.
60
+ */
61
+ function isCallId(value) {
62
+ return value.startsWith(exports.CALL_ID_PREFIX);
63
+ }
64
+ /**
65
+ * Check if a string is a valid reference ID.
66
+ */
67
+ function isRefId(value) {
68
+ return value.startsWith(exports.REF_ID_PREFIX);
69
+ }
70
+ /**
71
+ * Default session limits.
72
+ */
73
+ exports.DEFAULT_SESSION_LIMITS = {
74
+ sessionTtlMs: 60000,
75
+ maxToolCalls: 50,
76
+ maxStdoutBytes: 262144,
77
+ maxToolResultBytes: 5242880,
78
+ toolTimeoutMs: 30000,
79
+ heartbeatIntervalMs: 15000,
80
+ };
81
+ /**
82
+ * Session state enumeration.
83
+ */
84
+ exports.SessionState = {
85
+ /** Session is starting up */
86
+ Starting: 'starting',
87
+ /** Session is actively running code */
88
+ Running: 'running',
89
+ /** Session is waiting for a tool result */
90
+ WaitingForTool: 'waiting_for_tool',
91
+ /** Session completed successfully */
92
+ Completed: 'completed',
93
+ /** Session was cancelled */
94
+ Cancelled: 'cancelled',
95
+ /** Session failed with an error */
96
+ Failed: 'failed',
97
+ };
98
+ /**
99
+ * Check if a value is a reference token.
100
+ */
101
+ function isRefToken(value) {
102
+ return (typeof value === 'object' &&
103
+ value !== null &&
104
+ '$ref' in value &&
105
+ typeof value.$ref === 'object' &&
106
+ value.$ref !== null &&
107
+ 'id' in value.$ref &&
108
+ typeof value.$ref.id === 'string' &&
109
+ isRefId(value.$ref.id));
110
+ }
111
+ /**
112
+ * Create a reference token from a ref ID.
113
+ */
114
+ function createRefToken(id) {
115
+ return { $ref: { id } };
116
+ }
117
+ /**
118
+ * Log levels for session logging.
119
+ */
120
+ exports.LogLevel = {
121
+ Debug: 'debug',
122
+ Info: 'info',
123
+ Warn: 'warn',
124
+ Error: 'error',
125
+ };
126
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../src/protocol.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA8CH,8CAEC;AAKD,wCAEC;AAKD,sCAEC;AAKD,kCAEC;AAKD,4BAEC;AAKD,0BAEC;AAsHD,gCAWC;AAKD,wCAEC;AAzND;;;GAGG;AACU,QAAA,gBAAgB,GAAG,CAAU,CAAC;AAO3C;;GAEG;AACU,QAAA,iBAAiB,GAAG,IAAa,CAAC;AAE/C;;GAEG;AACU,QAAA,cAAc,GAAG,IAAa,CAAC;AAE5C;;GAEG;AACU,QAAA,aAAa,GAAG,MAAe,CAAC;AAiB7C;;GAEG;AACH,SAAgB,iBAAiB;IAC/B,OAAO,GAAG,yBAAiB,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;AACtD,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc;IAC5B,OAAO,GAAG,sBAAc,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAgB,aAAa;IAC3B,OAAO,GAAG,qBAAa,GAAG,MAAM,CAAC,UAAU,EAAE,EAAE,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,SAAgB,WAAW,CAAC,KAAa;IACvC,OAAO,KAAK,CAAC,UAAU,CAAC,yBAAiB,CAAC,CAAC;AAC7C,CAAC;AAED;;GAEG;AACH,SAAgB,QAAQ,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,UAAU,CAAC,sBAAc,CAAC,CAAC;AAC1C,CAAC;AAED;;GAEG;AACH,SAAgB,OAAO,CAAC,KAAa;IACnC,OAAO,KAAK,CAAC,UAAU,CAAC,qBAAa,CAAC,CAAC;AACzC,CAAC;AA2CD;;GAEG;AACU,QAAA,sBAAsB,GAA4B;IAC7D,YAAY,EAAE,KAAK;IACnB,YAAY,EAAE,EAAE;IAChB,cAAc,EAAE,MAAM;IACtB,kBAAkB,EAAE,OAAO;IAC3B,aAAa,EAAE,KAAK;IACpB,mBAAmB,EAAE,KAAK;CAC3B,CAAC;AAEF;;GAEG;AACU,QAAA,YAAY,GAAG;IAC1B,6BAA6B;IAC7B,QAAQ,EAAE,UAAU;IACpB,uCAAuC;IACvC,OAAO,EAAE,SAAS;IAClB,2CAA2C;IAC3C,cAAc,EAAE,kBAAkB;IAClC,qCAAqC;IACrC,SAAS,EAAE,WAAW;IACtB,4BAA4B;IAC5B,SAAS,EAAE,WAAW;IACtB,mCAAmC;IACnC,MAAM,EAAE,QAAQ;CACR,CAAC;AA4CX;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAc;IACvC,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,MAAM,IAAI,KAAK;QACf,OAAQ,KAAkB,CAAC,IAAI,KAAK,QAAQ;QAC3C,KAAkB,CAAC,IAAI,KAAK,IAAI;QACjC,IAAI,IAAK,KAAkB,CAAC,IAAI;QAChC,OAAQ,KAAkB,CAAC,IAAI,CAAC,EAAE,KAAK,QAAQ;QAC/C,OAAO,CAAE,KAAkB,CAAC,IAAI,CAAC,EAAE,CAAC,CACrC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc,CAAC,EAAS;IACtC,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC;AAC1B,CAAC;AAcD;;GAEG;AACU,QAAA,QAAQ,GAAG;IACtB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,OAAO;CACN,CAAC","sourcesContent":["/**\n * @enclave-vm/types - Protocol definitions\n *\n * Core protocol constants and base types for the EnclaveJS streaming runtime.\n */\n\n/**\n * Current protocol version.\n * Increment when making breaking changes to the wire format.\n */\nexport const PROTOCOL_VERSION = 1 as const;\n\n/**\n * Protocol version type for type-safe versioning.\n */\nexport type ProtocolVersion = typeof PROTOCOL_VERSION;\n\n/**\n * Session ID prefix for identification and debugging.\n */\nexport const SESSION_ID_PREFIX = 's_' as const;\n\n/**\n * Call ID prefix for tool call identification.\n */\nexport const CALL_ID_PREFIX = 'c_' as const;\n\n/**\n * Reference ID prefix for sidecar references.\n */\nexport const REF_ID_PREFIX = 'ref_' as const;\n\n/**\n * Session identifier type.\n */\nexport type SessionId = `${typeof SESSION_ID_PREFIX}${string}`;\n\n/**\n * Tool call identifier type.\n */\nexport type CallId = `${typeof CALL_ID_PREFIX}${string}`;\n\n/**\n * Reference identifier type.\n */\nexport type RefId = `${typeof REF_ID_PREFIX}${string}`;\n\n/**\n * Generate a unique session ID.\n */\nexport function generateSessionId(): SessionId {\n return `${SESSION_ID_PREFIX}${crypto.randomUUID()}`;\n}\n\n/**\n * Generate a unique call ID.\n */\nexport function generateCallId(): CallId {\n return `${CALL_ID_PREFIX}${crypto.randomUUID()}`;\n}\n\n/**\n * Generate a unique reference ID.\n */\nexport function generateRefId(): RefId {\n return `${REF_ID_PREFIX}${crypto.randomUUID()}`;\n}\n\n/**\n * Check if a string is a valid session ID.\n */\nexport function isSessionId(value: string): value is SessionId {\n return value.startsWith(SESSION_ID_PREFIX);\n}\n\n/**\n * Check if a string is a valid call ID.\n */\nexport function isCallId(value: string): value is CallId {\n return value.startsWith(CALL_ID_PREFIX);\n}\n\n/**\n * Check if a string is a valid reference ID.\n */\nexport function isRefId(value: string): value is RefId {\n return value.startsWith(REF_ID_PREFIX);\n}\n\n/**\n * Session limits configuration.\n */\nexport interface SessionLimits {\n /**\n * Maximum session duration in milliseconds.\n * @default 60000 (1 minute)\n */\n sessionTtlMs?: number;\n\n /**\n * Maximum number of tool calls allowed in a session.\n * @default 50\n */\n maxToolCalls?: number;\n\n /**\n * Maximum stdout/output bytes.\n * @default 262144 (256KB)\n */\n maxStdoutBytes?: number;\n\n /**\n * Maximum size of a single tool result in bytes.\n * @default 5242880 (5MB)\n */\n maxToolResultBytes?: number;\n\n /**\n * Individual tool execution timeout in milliseconds.\n * @default 30000 (30 seconds)\n */\n toolTimeoutMs?: number;\n\n /**\n * Heartbeat interval in milliseconds.\n * @default 15000 (15 seconds)\n */\n heartbeatIntervalMs?: number;\n}\n\n/**\n * Default session limits.\n */\nexport const DEFAULT_SESSION_LIMITS: Required<SessionLimits> = {\n sessionTtlMs: 60000,\n maxToolCalls: 50,\n maxStdoutBytes: 262144,\n maxToolResultBytes: 5242880,\n toolTimeoutMs: 30000,\n heartbeatIntervalMs: 15000,\n};\n\n/**\n * Session state enumeration.\n */\nexport const SessionState = {\n /** Session is starting up */\n Starting: 'starting',\n /** Session is actively running code */\n Running: 'running',\n /** Session is waiting for a tool result */\n WaitingForTool: 'waiting_for_tool',\n /** Session completed successfully */\n Completed: 'completed',\n /** Session was cancelled */\n Cancelled: 'cancelled',\n /** Session failed with an error */\n Failed: 'failed',\n} as const;\n\nexport type SessionState = (typeof SessionState)[keyof typeof SessionState];\n\n/**\n * Tool configuration for timeout and retry behavior.\n */\nexport interface ToolConfig {\n /**\n * Tool execution timeout in milliseconds.\n * Overrides session-level toolTimeoutMs.\n */\n timeout?: number;\n\n /**\n * Whether the tool can be retried on failure.\n * @default false\n */\n retryable?: boolean;\n\n /**\n * Maximum number of retries if retryable is true.\n * @default 3\n */\n maxRetries?: number;\n\n /**\n * Whether the tool result can be read by runtime code.\n * If false, result is always stored as a reference.\n * @default true\n */\n runtimeReadable?: boolean;\n}\n\n/**\n * Reference token for pass-by-reference values.\n * Used to avoid transmitting large/sensitive values through the runtime.\n */\nexport interface RefToken {\n $ref: {\n id: RefId;\n };\n}\n\n/**\n * Check if a value is a reference token.\n */\nexport function isRefToken(value: unknown): value is RefToken {\n return (\n typeof value === 'object' &&\n value !== null &&\n '$ref' in value &&\n typeof (value as RefToken).$ref === 'object' &&\n (value as RefToken).$ref !== null &&\n 'id' in (value as RefToken).$ref &&\n typeof (value as RefToken).$ref.id === 'string' &&\n isRefId((value as RefToken).$ref.id)\n );\n}\n\n/**\n * Create a reference token from a ref ID.\n */\nexport function createRefToken(id: RefId): RefToken {\n return { $ref: { id } };\n}\n\n/**\n * Error information structure.\n */\nexport interface ErrorInfo {\n /** Human-readable error message */\n message: string;\n /** Machine-readable error code */\n code?: string;\n /** Stack trace (only in development/debug mode) */\n stack?: string;\n}\n\n/**\n * Log levels for session logging.\n */\nexport const LogLevel = {\n Debug: 'debug',\n Info: 'info',\n Warn: 'warn',\n Error: 'error',\n} as const;\n\nexport type LogLevel = (typeof LogLevel)[keyof typeof LogLevel];\n"]}