@agent-relay/protocol 0.1.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.
- package/dist/channels.d.ts +137 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/channels.js +154 -0
- package/dist/channels.js.map +1 -0
- package/dist/framing.d.ts +80 -0
- package/dist/framing.d.ts.map +1 -0
- package/dist/framing.js +206 -0
- package/dist/framing.js.map +1 -0
- package/dist/id-generator.d.ts +35 -0
- package/dist/id-generator.d.ts.map +1 -0
- package/dist/id-generator.js +60 -0
- package/dist/id-generator.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/relay-pty-schemas.d.ts +258 -0
- package/dist/relay-pty-schemas.d.ts.map +1 -0
- package/dist/relay-pty-schemas.js +60 -0
- package/dist/relay-pty-schemas.js.map +1 -0
- package/dist/types.d.ts +341 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/package.json +56 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Relay Protocol Types
|
|
3
|
+
* @agent-relay/sdk
|
|
4
|
+
*
|
|
5
|
+
* These types define the wire protocol for agent-to-agent communication.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PROTOCOL_VERSION = 1;
|
|
8
|
+
export type MessageType = 'HELLO' | 'WELCOME' | 'SEND' | 'DELIVER' | 'ACK' | 'NACK' | 'PING' | 'PONG' | 'ERROR' | 'BUSY' | 'RESUME' | 'BYE' | 'STATE' | 'SYNC' | 'SYNC_SNAPSHOT' | 'SYNC_DELTA' | 'SUBSCRIBE' | 'UNSUBSCRIBE' | 'SHADOW_BIND' | 'SHADOW_UNBIND' | 'LOG' | 'CHANNEL_JOIN' | 'CHANNEL_LEAVE' | 'CHANNEL_MESSAGE' | 'CHANNEL_INFO' | 'CHANNEL_MEMBERS' | 'CHANNEL_TYPING' | 'SPAWN' | 'SPAWN_RESULT' | 'RELEASE' | 'RELEASE_RESULT';
|
|
9
|
+
export type PayloadKind = 'message' | 'action' | 'state' | 'thinking';
|
|
10
|
+
/**
|
|
11
|
+
* Base envelope structure for all protocol messages.
|
|
12
|
+
*/
|
|
13
|
+
export interface Envelope<T = unknown> {
|
|
14
|
+
/** Protocol version */
|
|
15
|
+
v: number;
|
|
16
|
+
/** Message type */
|
|
17
|
+
type: MessageType;
|
|
18
|
+
/** Unique message ID */
|
|
19
|
+
id: string;
|
|
20
|
+
/** Timestamp (Unix ms) */
|
|
21
|
+
ts: number;
|
|
22
|
+
/** Sender name */
|
|
23
|
+
from?: string;
|
|
24
|
+
/** Recipient name or '*' for broadcast */
|
|
25
|
+
to?: string | '*';
|
|
26
|
+
/** Topic for pub/sub */
|
|
27
|
+
topic?: string;
|
|
28
|
+
/** Message payload */
|
|
29
|
+
payload: T;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Entity type distinguishes between AI agents and human users.
|
|
33
|
+
*/
|
|
34
|
+
export type EntityType = 'agent' | 'user';
|
|
35
|
+
export interface HelloPayload {
|
|
36
|
+
/** Agent name */
|
|
37
|
+
agent: string;
|
|
38
|
+
/** Client capabilities */
|
|
39
|
+
capabilities: {
|
|
40
|
+
ack: boolean;
|
|
41
|
+
resume: boolean;
|
|
42
|
+
max_inflight: number;
|
|
43
|
+
supports_topics: boolean;
|
|
44
|
+
};
|
|
45
|
+
/** Entity type: 'agent' (default) or 'user' */
|
|
46
|
+
entityType?: EntityType;
|
|
47
|
+
/** CLI identifier (claude, codex, gemini, etc.) */
|
|
48
|
+
cli?: string;
|
|
49
|
+
/** Program identifier */
|
|
50
|
+
program?: string;
|
|
51
|
+
/** Model identifier */
|
|
52
|
+
model?: string;
|
|
53
|
+
/** Task/role description */
|
|
54
|
+
task?: string;
|
|
55
|
+
/** Working directory */
|
|
56
|
+
workingDirectory?: string;
|
|
57
|
+
/** Display name for human users */
|
|
58
|
+
displayName?: string;
|
|
59
|
+
/** Avatar URL for human users */
|
|
60
|
+
avatarUrl?: string;
|
|
61
|
+
/** Session resume info */
|
|
62
|
+
session?: {
|
|
63
|
+
resume_token?: string;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export interface WelcomePayload {
|
|
67
|
+
/** Session ID assigned by server */
|
|
68
|
+
session_id: string;
|
|
69
|
+
/** Token for session resume */
|
|
70
|
+
resume_token?: string;
|
|
71
|
+
/** Server configuration */
|
|
72
|
+
server: {
|
|
73
|
+
max_frame_bytes: number;
|
|
74
|
+
heartbeat_ms: number;
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export interface SendPayload {
|
|
78
|
+
/** Message type */
|
|
79
|
+
kind: PayloadKind;
|
|
80
|
+
/** Message body */
|
|
81
|
+
body: string;
|
|
82
|
+
/** Optional structured data */
|
|
83
|
+
data?: Record<string, unknown>;
|
|
84
|
+
/** Thread ID for grouping related messages */
|
|
85
|
+
thread?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface SyncMeta {
|
|
88
|
+
/** Correlation ID for matching responses */
|
|
89
|
+
correlationId: string;
|
|
90
|
+
/** Timeout for blocking sends (ms) */
|
|
91
|
+
timeoutMs?: number;
|
|
92
|
+
/** Whether sender should block awaiting ACK */
|
|
93
|
+
blocking: boolean;
|
|
94
|
+
}
|
|
95
|
+
export interface SendMeta {
|
|
96
|
+
requires_ack?: boolean;
|
|
97
|
+
ttl_ms?: number;
|
|
98
|
+
/** Importance level (0-100, higher = more important) */
|
|
99
|
+
importance?: number;
|
|
100
|
+
/** Correlation ID for replies */
|
|
101
|
+
replyTo?: string;
|
|
102
|
+
/** Sync metadata for blocking sends */
|
|
103
|
+
sync?: SyncMeta;
|
|
104
|
+
}
|
|
105
|
+
export interface DeliveryInfo {
|
|
106
|
+
/** Delivery sequence number */
|
|
107
|
+
seq: number;
|
|
108
|
+
/** Session ID */
|
|
109
|
+
session_id: string;
|
|
110
|
+
/** Original 'to' field ('*' indicates broadcast) */
|
|
111
|
+
originalTo?: string;
|
|
112
|
+
}
|
|
113
|
+
export interface AckPayload {
|
|
114
|
+
/** ID of the message being acknowledged */
|
|
115
|
+
ack_id: string;
|
|
116
|
+
/** Sequence number */
|
|
117
|
+
seq: number;
|
|
118
|
+
/** Cumulative acknowledgment */
|
|
119
|
+
cumulative_seq?: number;
|
|
120
|
+
/** Selective acknowledgments */
|
|
121
|
+
sack?: number[];
|
|
122
|
+
/**
|
|
123
|
+
* Correlation ID for matching ACK to original blocking SEND.
|
|
124
|
+
* Set by daemon when forwarding ACK back to the sender.
|
|
125
|
+
*/
|
|
126
|
+
correlationId?: string;
|
|
127
|
+
/**
|
|
128
|
+
* Response status for sync messaging.
|
|
129
|
+
* Common values: 'OK', 'ERROR', 'ACCEPTED', 'REJECTED'.
|
|
130
|
+
* Allows richer status codes than a simple boolean.
|
|
131
|
+
*/
|
|
132
|
+
response?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Optional structured response data.
|
|
135
|
+
* Can contain any additional information the responder wants to include.
|
|
136
|
+
*/
|
|
137
|
+
responseData?: unknown;
|
|
138
|
+
}
|
|
139
|
+
export interface NackPayload {
|
|
140
|
+
/** ID of the message being rejected */
|
|
141
|
+
ack_id: string;
|
|
142
|
+
/** Rejection code */
|
|
143
|
+
code?: 'BUSY' | 'INVALID' | 'FORBIDDEN' | 'STALE';
|
|
144
|
+
/** Legacy reason field */
|
|
145
|
+
reason?: 'busy' | 'invalid' | 'forbidden';
|
|
146
|
+
/** Human-readable message */
|
|
147
|
+
message?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface BusyPayload {
|
|
150
|
+
/** Time before retry (ms) */
|
|
151
|
+
retry_after_ms: number;
|
|
152
|
+
/** Current queue depth */
|
|
153
|
+
queue_depth: number;
|
|
154
|
+
}
|
|
155
|
+
export interface PingPayload {
|
|
156
|
+
nonce: string;
|
|
157
|
+
}
|
|
158
|
+
export interface PongPayload {
|
|
159
|
+
nonce: string;
|
|
160
|
+
}
|
|
161
|
+
export type ErrorCode = 'BAD_REQUEST' | 'UNAUTHORIZED' | 'NOT_FOUND' | 'INTERNAL' | 'RESUME_TOO_OLD';
|
|
162
|
+
export interface ErrorPayload {
|
|
163
|
+
/** Error code */
|
|
164
|
+
code: ErrorCode;
|
|
165
|
+
/** Error message */
|
|
166
|
+
message: string;
|
|
167
|
+
/** Whether the error is fatal (connection should be closed) */
|
|
168
|
+
fatal: boolean;
|
|
169
|
+
}
|
|
170
|
+
export interface LogPayload {
|
|
171
|
+
/** Log/output data */
|
|
172
|
+
data: string;
|
|
173
|
+
/** Timestamp (defaults to envelope ts) */
|
|
174
|
+
timestamp?: number;
|
|
175
|
+
}
|
|
176
|
+
export interface SyncStream {
|
|
177
|
+
topic: string;
|
|
178
|
+
peer: string;
|
|
179
|
+
last_seq: number;
|
|
180
|
+
server_last_seq?: number;
|
|
181
|
+
}
|
|
182
|
+
export interface SyncPayload {
|
|
183
|
+
session_id: string;
|
|
184
|
+
streams: SyncStream[];
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Attachment metadata for messages.
|
|
188
|
+
*/
|
|
189
|
+
export interface MessageAttachment {
|
|
190
|
+
id: string;
|
|
191
|
+
filename: string;
|
|
192
|
+
mimeType: string;
|
|
193
|
+
size?: number;
|
|
194
|
+
url?: string;
|
|
195
|
+
data?: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Payload for CHANNEL_JOIN message.
|
|
199
|
+
*/
|
|
200
|
+
export interface ChannelJoinPayload {
|
|
201
|
+
/** Channel to join (e.g., '#general') */
|
|
202
|
+
channel: string;
|
|
203
|
+
/** Display name for the channel member list */
|
|
204
|
+
displayName?: string;
|
|
205
|
+
/** Avatar URL */
|
|
206
|
+
avatarUrl?: string;
|
|
207
|
+
/** Member name to add (for admin operations) */
|
|
208
|
+
member?: string;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Payload for CHANNEL_LEAVE message.
|
|
212
|
+
*/
|
|
213
|
+
export interface ChannelLeavePayload {
|
|
214
|
+
/** Channel to leave */
|
|
215
|
+
channel: string;
|
|
216
|
+
/** Reason for leaving */
|
|
217
|
+
reason?: string;
|
|
218
|
+
/** Member name to remove (for admin operations) */
|
|
219
|
+
member?: string;
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Payload for CHANNEL_MESSAGE.
|
|
223
|
+
*/
|
|
224
|
+
export interface ChannelMessagePayload {
|
|
225
|
+
/** Target channel */
|
|
226
|
+
channel: string;
|
|
227
|
+
/** Message content */
|
|
228
|
+
body: string;
|
|
229
|
+
/** Thread ID for threaded replies */
|
|
230
|
+
thread?: string;
|
|
231
|
+
/** Mentioned usernames/agent names */
|
|
232
|
+
mentions?: string[];
|
|
233
|
+
/** File attachments */
|
|
234
|
+
attachments?: MessageAttachment[];
|
|
235
|
+
/** Optional structured data */
|
|
236
|
+
data?: Record<string, unknown>;
|
|
237
|
+
}
|
|
238
|
+
export type SpeakOnTrigger = 'SESSION_END' | 'CODE_WRITTEN' | 'REVIEW_REQUEST' | 'EXPLICIT_ASK' | 'ALL_MESSAGES';
|
|
239
|
+
export interface ShadowConfig {
|
|
240
|
+
/** Primary agent this shadow is attached to */
|
|
241
|
+
primaryAgent: string;
|
|
242
|
+
/** When the shadow should speak */
|
|
243
|
+
speakOn: SpeakOnTrigger[];
|
|
244
|
+
/** Receive messages TO the primary */
|
|
245
|
+
receiveIncoming?: boolean;
|
|
246
|
+
/** Receive messages FROM the primary */
|
|
247
|
+
receiveOutgoing?: boolean;
|
|
248
|
+
}
|
|
249
|
+
export interface ShadowBindPayload {
|
|
250
|
+
primaryAgent: string;
|
|
251
|
+
speakOn?: SpeakOnTrigger[];
|
|
252
|
+
receiveIncoming?: boolean;
|
|
253
|
+
receiveOutgoing?: boolean;
|
|
254
|
+
}
|
|
255
|
+
export interface ShadowUnbindPayload {
|
|
256
|
+
primaryAgent: string;
|
|
257
|
+
}
|
|
258
|
+
export interface SpawnPayload {
|
|
259
|
+
/** Name for the new agent */
|
|
260
|
+
name: string;
|
|
261
|
+
/** CLI to use (claude, codex, gemini, etc.) */
|
|
262
|
+
cli: string;
|
|
263
|
+
/** Task description */
|
|
264
|
+
task: string;
|
|
265
|
+
/** Team name */
|
|
266
|
+
team?: string;
|
|
267
|
+
/** Working directory */
|
|
268
|
+
cwd?: string;
|
|
269
|
+
/** Socket path for the spawned agent */
|
|
270
|
+
socketPath?: string;
|
|
271
|
+
/** Parent agent name */
|
|
272
|
+
spawnerName?: string;
|
|
273
|
+
/** Interactive mode */
|
|
274
|
+
interactive?: boolean;
|
|
275
|
+
/** Spawn as shadow of this agent */
|
|
276
|
+
shadowOf?: string;
|
|
277
|
+
/** Shadow speak-on triggers */
|
|
278
|
+
shadowSpeakOn?: SpeakOnTrigger[];
|
|
279
|
+
/** User ID for cloud persistence */
|
|
280
|
+
userId?: string;
|
|
281
|
+
}
|
|
282
|
+
export interface SpawnPolicyDecision {
|
|
283
|
+
allowed: boolean;
|
|
284
|
+
reason?: string;
|
|
285
|
+
quotaRemaining?: number;
|
|
286
|
+
}
|
|
287
|
+
export interface SpawnResultPayload {
|
|
288
|
+
/** Correlation ID (matches original SPAWN envelope ID) */
|
|
289
|
+
replyTo: string;
|
|
290
|
+
/** Whether spawn succeeded */
|
|
291
|
+
success: boolean;
|
|
292
|
+
/** Spawned agent name */
|
|
293
|
+
name: string;
|
|
294
|
+
/** Process ID (if successful) */
|
|
295
|
+
pid?: number;
|
|
296
|
+
/** Error message (if failed) */
|
|
297
|
+
error?: string;
|
|
298
|
+
/** Policy decision (if blocked) */
|
|
299
|
+
policyDecision?: SpawnPolicyDecision;
|
|
300
|
+
}
|
|
301
|
+
export interface ReleasePayload {
|
|
302
|
+
/** Agent name to release */
|
|
303
|
+
name: string;
|
|
304
|
+
}
|
|
305
|
+
export interface ReleaseResultPayload {
|
|
306
|
+
/** Correlation ID */
|
|
307
|
+
replyTo: string;
|
|
308
|
+
/** Whether release succeeded */
|
|
309
|
+
success: boolean;
|
|
310
|
+
/** Released agent name */
|
|
311
|
+
name: string;
|
|
312
|
+
/** Error message (if failed) */
|
|
313
|
+
error?: string;
|
|
314
|
+
}
|
|
315
|
+
export type HelloEnvelope = Envelope<HelloPayload>;
|
|
316
|
+
export type WelcomeEnvelope = Envelope<WelcomePayload>;
|
|
317
|
+
export type SendEnvelope = Envelope<SendPayload> & {
|
|
318
|
+
payload_meta?: SendMeta;
|
|
319
|
+
};
|
|
320
|
+
export type DeliverEnvelope = Envelope<SendPayload> & {
|
|
321
|
+
delivery: DeliveryInfo;
|
|
322
|
+
payload_meta?: SendMeta;
|
|
323
|
+
};
|
|
324
|
+
export type AckEnvelope = Envelope<AckPayload>;
|
|
325
|
+
export type NackEnvelope = Envelope<NackPayload>;
|
|
326
|
+
export type PingEnvelope = Envelope<PingPayload>;
|
|
327
|
+
export type PongEnvelope = Envelope<PongPayload>;
|
|
328
|
+
export type ErrorEnvelope = Envelope<ErrorPayload>;
|
|
329
|
+
export type BusyEnvelope = Envelope<BusyPayload>;
|
|
330
|
+
export type LogEnvelope = Envelope<LogPayload>;
|
|
331
|
+
export type ShadowBindEnvelope = Envelope<ShadowBindPayload>;
|
|
332
|
+
export type ShadowUnbindEnvelope = Envelope<ShadowUnbindPayload>;
|
|
333
|
+
export type SyncEnvelope = Envelope<SyncPayload>;
|
|
334
|
+
export type SpawnEnvelope = Envelope<SpawnPayload>;
|
|
335
|
+
export type SpawnResultEnvelope = Envelope<SpawnResultPayload>;
|
|
336
|
+
export type ReleaseEnvelope = Envelope<ReleasePayload>;
|
|
337
|
+
export type ReleaseResultEnvelope = Envelope<ReleaseResultPayload>;
|
|
338
|
+
export type ChannelJoinEnvelope = Envelope<ChannelJoinPayload>;
|
|
339
|
+
export type ChannelLeaveEnvelope = Envelope<ChannelLeavePayload>;
|
|
340
|
+
export type ChannelMessageEnvelope = Envelope<ChannelMessagePayload>;
|
|
341
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,eAAO,MAAM,gBAAgB,IAAI,CAAC;AAElC,MAAM,MAAM,WAAW,GACnB,OAAO,GACP,SAAS,GACT,MAAM,GACN,SAAS,GACT,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,GACN,OAAO,GACP,MAAM,GACN,QAAQ,GACR,KAAK,GACL,OAAO,GACP,MAAM,GACN,eAAe,GACf,YAAY,GACZ,WAAW,GACX,aAAa,GACb,aAAa,GACb,eAAe,GACf,KAAK,GAEL,cAAc,GACd,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,gBAAgB,GAEhB,OAAO,GACP,cAAc,GACd,SAAS,GACT,gBAAgB,CAAC;AAErB,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,UAAU,CAAC;AAEtE;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC,GAAG,OAAO;IACnC,uBAAuB;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,mBAAmB;IACnB,IAAI,EAAE,WAAW,CAAC;IAClB,wBAAwB;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,0BAA0B;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,kBAAkB;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,EAAE,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IAClB,wBAAwB;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,OAAO,EAAE,CAAC,CAAC;CACZ;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAM1C,MAAM,WAAW,YAAY;IAC3B,iBAAiB;IACjB,KAAK,EAAE,MAAM,CAAC;IAC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c,CAAC,CAAC;AACvD,MAAM,MAAM,qBAAqB,GAAG,QAAQ,CAAC,oBAAoB,CAAC,CAAC;AACnE,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,kBAAkB,CAAC,CAAC;AAC/D,MAAM,MAAM,oBAAoB,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AACjE,MAAM,MAAM,sBAAsB,GAAG,QAAQ,CAAC,qBAAqB,CAAC,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agent-relay/protocol",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Wire protocol types and framing for Agent Relay",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./types": {
|
|
15
|
+
"types": "./dist/types.d.ts",
|
|
16
|
+
"import": "./dist/types.js",
|
|
17
|
+
"default": "./dist/types.js"
|
|
18
|
+
},
|
|
19
|
+
"./framing": {
|
|
20
|
+
"types": "./dist/framing.d.ts",
|
|
21
|
+
"import": "./dist/framing.js",
|
|
22
|
+
"default": "./dist/framing.js"
|
|
23
|
+
},
|
|
24
|
+
"./channels": {
|
|
25
|
+
"types": "./dist/channels.d.ts",
|
|
26
|
+
"import": "./dist/channels.js",
|
|
27
|
+
"default": "./dist/channels.js"
|
|
28
|
+
},
|
|
29
|
+
"./relay-pty-schemas": {
|
|
30
|
+
"types": "./dist/relay-pty-schemas.d.ts",
|
|
31
|
+
"import": "./dist/relay-pty-schemas.js",
|
|
32
|
+
"default": "./dist/relay-pty-schemas.js"
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md"
|
|
38
|
+
],
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc",
|
|
41
|
+
"clean": "rm -rf dist",
|
|
42
|
+
"test": "vitest run",
|
|
43
|
+
"test:watch": "vitest"
|
|
44
|
+
},
|
|
45
|
+
"publishConfig": {
|
|
46
|
+
"access": "public"
|
|
47
|
+
},
|
|
48
|
+
"optionalDependencies": {
|
|
49
|
+
"@msgpack/msgpack": "^3.0.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^22.19.3",
|
|
53
|
+
"typescript": "^5.9.3",
|
|
54
|
+
"vitest": "^3.0.0"
|
|
55
|
+
}
|
|
56
|
+
}
|