pi-app-server 0.1.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/LICENSE +21 -0
- package/README.md +195 -0
- package/dist/command-classification.d.ts +59 -0
- package/dist/command-classification.d.ts.map +1 -0
- package/dist/command-classification.js +78 -0
- package/dist/command-classification.js.map +7 -0
- package/dist/command-execution-engine.d.ts +118 -0
- package/dist/command-execution-engine.d.ts.map +1 -0
- package/dist/command-execution-engine.js +259 -0
- package/dist/command-execution-engine.js.map +7 -0
- package/dist/command-replay-store.d.ts +241 -0
- package/dist/command-replay-store.d.ts.map +1 -0
- package/dist/command-replay-store.js +306 -0
- package/dist/command-replay-store.js.map +7 -0
- package/dist/command-router.d.ts +25 -0
- package/dist/command-router.d.ts.map +1 -0
- package/dist/command-router.js +353 -0
- package/dist/command-router.js.map +7 -0
- package/dist/extension-ui.d.ts +139 -0
- package/dist/extension-ui.d.ts.map +1 -0
- package/dist/extension-ui.js +189 -0
- package/dist/extension-ui.js.map +7 -0
- package/dist/resource-governor.d.ts +254 -0
- package/dist/resource-governor.d.ts.map +1 -0
- package/dist/resource-governor.js +603 -0
- package/dist/resource-governor.js.map +7 -0
- package/dist/server-command-handlers.d.ts +120 -0
- package/dist/server-command-handlers.d.ts.map +1 -0
- package/dist/server-command-handlers.js +234 -0
- package/dist/server-command-handlers.js.map +7 -0
- package/dist/server-ui-context.d.ts +22 -0
- package/dist/server-ui-context.d.ts.map +1 -0
- package/dist/server-ui-context.js +221 -0
- package/dist/server-ui-context.js.map +7 -0
- package/dist/server.d.ts +82 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +561 -0
- package/dist/server.js.map +7 -0
- package/dist/session-lock-manager.d.ts +100 -0
- package/dist/session-lock-manager.d.ts.map +1 -0
- package/dist/session-lock-manager.js +199 -0
- package/dist/session-lock-manager.js.map +7 -0
- package/dist/session-manager.d.ts +196 -0
- package/dist/session-manager.d.ts.map +1 -0
- package/dist/session-manager.js +1010 -0
- package/dist/session-manager.js.map +7 -0
- package/dist/session-store.d.ts +190 -0
- package/dist/session-store.d.ts.map +1 -0
- package/dist/session-store.js +446 -0
- package/dist/session-store.js.map +7 -0
- package/dist/session-version-store.d.ts +83 -0
- package/dist/session-version-store.d.ts.map +1 -0
- package/dist/session-version-store.js +117 -0
- package/dist/session-version-store.js.map +7 -0
- package/dist/type-guards.d.ts +59 -0
- package/dist/type-guards.d.ts.map +1 -0
- package/dist/type-guards.js +40 -0
- package/dist/type-guards.js.map +7 -0
- package/dist/types.d.ts +621 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +23 -0
- package/dist/types.js.map +7 -0
- package/dist/validation.d.ts +22 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +323 -0
- package/dist/validation.js.map +7 -0
- package/package.json +135 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,621 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol types for pi-app-server session multiplexer.
|
|
3
|
+
* The protocol IS the architecture.
|
|
4
|
+
*/
|
|
5
|
+
import type { AgentMessage, ThinkingLevel } from "@mariozechner/pi-agent-core";
|
|
6
|
+
import type { AgentSessionEvent } from "@mariozechner/pi-coding-agent";
|
|
7
|
+
import type { ImageContent, Model } from "@mariozechner/pi-ai";
|
|
8
|
+
import type { SessionStats } from "@mariozechner/pi-coding-agent";
|
|
9
|
+
import type { CompactionResult } from "@mariozechner/pi-coding-agent";
|
|
10
|
+
import type { CircuitBreakerMetrics } from "./circuit-breaker.js";
|
|
11
|
+
export interface SessionInfo {
|
|
12
|
+
sessionId: string;
|
|
13
|
+
sessionName?: string;
|
|
14
|
+
sessionFile?: string;
|
|
15
|
+
model?: Model<any>;
|
|
16
|
+
thinkingLevel: ThinkingLevel;
|
|
17
|
+
isStreaming: boolean;
|
|
18
|
+
messageCount: number;
|
|
19
|
+
createdAt: string;
|
|
20
|
+
}
|
|
21
|
+
export type ServerCommand = {
|
|
22
|
+
id?: string;
|
|
23
|
+
type: "list_sessions";
|
|
24
|
+
} | {
|
|
25
|
+
id?: string;
|
|
26
|
+
type: "create_session";
|
|
27
|
+
sessionId?: string;
|
|
28
|
+
cwd?: string;
|
|
29
|
+
} | {
|
|
30
|
+
id?: string;
|
|
31
|
+
type: "delete_session";
|
|
32
|
+
sessionId: string;
|
|
33
|
+
} | {
|
|
34
|
+
id?: string;
|
|
35
|
+
type: "switch_session";
|
|
36
|
+
sessionId: string;
|
|
37
|
+
} | {
|
|
38
|
+
id?: string;
|
|
39
|
+
type: "get_metrics";
|
|
40
|
+
} | {
|
|
41
|
+
id?: string;
|
|
42
|
+
type: "health_check";
|
|
43
|
+
} | {
|
|
44
|
+
id?: string;
|
|
45
|
+
type: "list_stored_sessions";
|
|
46
|
+
} | {
|
|
47
|
+
id?: string;
|
|
48
|
+
type: "load_session";
|
|
49
|
+
sessionId?: string;
|
|
50
|
+
sessionPath: string;
|
|
51
|
+
};
|
|
52
|
+
export type SessionCommand = {
|
|
53
|
+
id?: string;
|
|
54
|
+
sessionId: string;
|
|
55
|
+
type: "extension_ui_response";
|
|
56
|
+
requestId: string;
|
|
57
|
+
response: {
|
|
58
|
+
method: "select";
|
|
59
|
+
value: string;
|
|
60
|
+
} | {
|
|
61
|
+
method: "confirm";
|
|
62
|
+
confirmed: boolean;
|
|
63
|
+
} | {
|
|
64
|
+
method: "input";
|
|
65
|
+
value: string;
|
|
66
|
+
} | {
|
|
67
|
+
method: "editor";
|
|
68
|
+
value: string;
|
|
69
|
+
} | {
|
|
70
|
+
method: "interview";
|
|
71
|
+
responses: Record<string, any>;
|
|
72
|
+
} | {
|
|
73
|
+
method: "cancelled";
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
id?: string;
|
|
77
|
+
sessionId: string;
|
|
78
|
+
type: "get_available_models";
|
|
79
|
+
} | {
|
|
80
|
+
id?: string;
|
|
81
|
+
sessionId: string;
|
|
82
|
+
type: "get_commands";
|
|
83
|
+
} | {
|
|
84
|
+
id?: string;
|
|
85
|
+
sessionId: string;
|
|
86
|
+
type: "get_skills";
|
|
87
|
+
} | {
|
|
88
|
+
id?: string;
|
|
89
|
+
sessionId: string;
|
|
90
|
+
type: "get_tools";
|
|
91
|
+
} | {
|
|
92
|
+
id?: string;
|
|
93
|
+
sessionId: string;
|
|
94
|
+
type: "list_session_files";
|
|
95
|
+
} | {
|
|
96
|
+
id?: string;
|
|
97
|
+
sessionId: string;
|
|
98
|
+
type: "prompt";
|
|
99
|
+
message: string;
|
|
100
|
+
images?: ImageContent[];
|
|
101
|
+
streamingBehavior?: "steer" | "followUp";
|
|
102
|
+
} | {
|
|
103
|
+
id?: string;
|
|
104
|
+
sessionId: string;
|
|
105
|
+
type: "steer";
|
|
106
|
+
message: string;
|
|
107
|
+
images?: ImageContent[];
|
|
108
|
+
} | {
|
|
109
|
+
id?: string;
|
|
110
|
+
sessionId: string;
|
|
111
|
+
type: "follow_up";
|
|
112
|
+
message: string;
|
|
113
|
+
images?: ImageContent[];
|
|
114
|
+
} | {
|
|
115
|
+
id?: string;
|
|
116
|
+
sessionId: string;
|
|
117
|
+
type: "abort";
|
|
118
|
+
} | {
|
|
119
|
+
id?: string;
|
|
120
|
+
sessionId: string;
|
|
121
|
+
type: "get_state";
|
|
122
|
+
} | {
|
|
123
|
+
id?: string;
|
|
124
|
+
sessionId: string;
|
|
125
|
+
type: "get_messages";
|
|
126
|
+
} | {
|
|
127
|
+
id?: string;
|
|
128
|
+
sessionId: string;
|
|
129
|
+
type: "set_model";
|
|
130
|
+
provider: string;
|
|
131
|
+
modelId: string;
|
|
132
|
+
} | {
|
|
133
|
+
id?: string;
|
|
134
|
+
sessionId: string;
|
|
135
|
+
type: "cycle_model";
|
|
136
|
+
direction?: "forward" | "backward";
|
|
137
|
+
} | {
|
|
138
|
+
id?: string;
|
|
139
|
+
sessionId: string;
|
|
140
|
+
type: "set_thinking_level";
|
|
141
|
+
level: ThinkingLevel;
|
|
142
|
+
} | {
|
|
143
|
+
id?: string;
|
|
144
|
+
sessionId: string;
|
|
145
|
+
type: "cycle_thinking_level";
|
|
146
|
+
} | {
|
|
147
|
+
id?: string;
|
|
148
|
+
sessionId: string;
|
|
149
|
+
type: "compact";
|
|
150
|
+
customInstructions?: string;
|
|
151
|
+
} | {
|
|
152
|
+
id?: string;
|
|
153
|
+
sessionId: string;
|
|
154
|
+
type: "abort_compaction";
|
|
155
|
+
} | {
|
|
156
|
+
id?: string;
|
|
157
|
+
sessionId: string;
|
|
158
|
+
type: "set_auto_compaction";
|
|
159
|
+
enabled: boolean;
|
|
160
|
+
} | {
|
|
161
|
+
id?: string;
|
|
162
|
+
sessionId: string;
|
|
163
|
+
type: "set_auto_retry";
|
|
164
|
+
enabled: boolean;
|
|
165
|
+
} | {
|
|
166
|
+
id?: string;
|
|
167
|
+
sessionId: string;
|
|
168
|
+
type: "abort_retry";
|
|
169
|
+
} | {
|
|
170
|
+
id?: string;
|
|
171
|
+
sessionId: string;
|
|
172
|
+
type: "bash";
|
|
173
|
+
command: string;
|
|
174
|
+
excludeFromContext?: boolean;
|
|
175
|
+
} | {
|
|
176
|
+
id?: string;
|
|
177
|
+
sessionId: string;
|
|
178
|
+
type: "abort_bash";
|
|
179
|
+
} | {
|
|
180
|
+
id?: string;
|
|
181
|
+
sessionId: string;
|
|
182
|
+
type: "get_session_stats";
|
|
183
|
+
} | {
|
|
184
|
+
id?: string;
|
|
185
|
+
sessionId: string;
|
|
186
|
+
type: "set_session_name";
|
|
187
|
+
name: string;
|
|
188
|
+
} | {
|
|
189
|
+
id?: string;
|
|
190
|
+
sessionId: string;
|
|
191
|
+
type: "export_html";
|
|
192
|
+
outputPath?: string;
|
|
193
|
+
} | {
|
|
194
|
+
id?: string;
|
|
195
|
+
sessionId: string;
|
|
196
|
+
type: "new_session";
|
|
197
|
+
parentSession?: string;
|
|
198
|
+
} | {
|
|
199
|
+
id?: string;
|
|
200
|
+
sessionId: string;
|
|
201
|
+
type: "switch_session_file";
|
|
202
|
+
sessionPath: string;
|
|
203
|
+
} | {
|
|
204
|
+
id?: string;
|
|
205
|
+
sessionId: string;
|
|
206
|
+
type: "fork";
|
|
207
|
+
entryId: string;
|
|
208
|
+
} | {
|
|
209
|
+
id?: string;
|
|
210
|
+
sessionId: string;
|
|
211
|
+
type: "get_fork_messages";
|
|
212
|
+
} | {
|
|
213
|
+
id?: string;
|
|
214
|
+
sessionId: string;
|
|
215
|
+
type: "get_last_assistant_text";
|
|
216
|
+
} | {
|
|
217
|
+
id?: string;
|
|
218
|
+
sessionId: string;
|
|
219
|
+
type: "get_context_usage";
|
|
220
|
+
};
|
|
221
|
+
export interface RpcCommandEnvelope {
|
|
222
|
+
/** Optional causal dependencies for command ordering. */
|
|
223
|
+
dependsOn?: string[];
|
|
224
|
+
/** Optional optimistic concurrency precondition for session-targeted commands. */
|
|
225
|
+
ifSessionVersion?: number;
|
|
226
|
+
/** Optional idempotency key for replay-safe retries. */
|
|
227
|
+
idempotencyKey?: string;
|
|
228
|
+
}
|
|
229
|
+
export type RpcCommand = (ServerCommand | SessionCommand) & RpcCommandEnvelope;
|
|
230
|
+
export interface RpcResponseBase {
|
|
231
|
+
id?: string;
|
|
232
|
+
type: "response";
|
|
233
|
+
command: string;
|
|
234
|
+
success: boolean;
|
|
235
|
+
error?: string;
|
|
236
|
+
/** Monotonic per-session version after successful command execution. */
|
|
237
|
+
sessionVersion?: number;
|
|
238
|
+
/** True when response was replayed from idempotency/duplicate-command cache. */
|
|
239
|
+
replayed?: boolean;
|
|
240
|
+
/** True when the response is due to a timeout (ADR-0001: timeout IS a response). */
|
|
241
|
+
timedOut?: boolean;
|
|
242
|
+
}
|
|
243
|
+
export type ServerResponse = (RpcResponseBase & {
|
|
244
|
+
command: "list_sessions";
|
|
245
|
+
success: true;
|
|
246
|
+
data: {
|
|
247
|
+
sessions: SessionInfo[];
|
|
248
|
+
};
|
|
249
|
+
}) | (RpcResponseBase & {
|
|
250
|
+
command: "create_session";
|
|
251
|
+
success: true;
|
|
252
|
+
data: {
|
|
253
|
+
sessionId: string;
|
|
254
|
+
sessionInfo: SessionInfo;
|
|
255
|
+
};
|
|
256
|
+
}) | (RpcResponseBase & {
|
|
257
|
+
command: "delete_session";
|
|
258
|
+
success: true;
|
|
259
|
+
data: {
|
|
260
|
+
deleted: true;
|
|
261
|
+
};
|
|
262
|
+
}) | (RpcResponseBase & {
|
|
263
|
+
command: "switch_session";
|
|
264
|
+
success: true;
|
|
265
|
+
data: {
|
|
266
|
+
sessionInfo: SessionInfo;
|
|
267
|
+
};
|
|
268
|
+
}) | (RpcResponseBase & {
|
|
269
|
+
command: "get_metrics";
|
|
270
|
+
success: true;
|
|
271
|
+
data: {
|
|
272
|
+
sessionCount: number;
|
|
273
|
+
connectionCount: number;
|
|
274
|
+
totalCommandsExecuted: number;
|
|
275
|
+
commandsRejected: {
|
|
276
|
+
sessionLimit: number;
|
|
277
|
+
messageSize: number;
|
|
278
|
+
rateLimit: number;
|
|
279
|
+
globalRateLimit: number;
|
|
280
|
+
connectionLimit: number;
|
|
281
|
+
extensionUIResponseRateLimit: number;
|
|
282
|
+
};
|
|
283
|
+
zombieSessionsDetected: number;
|
|
284
|
+
zombieSessionsCleaned: number;
|
|
285
|
+
doubleUnregisterErrors: number;
|
|
286
|
+
rateLimitUsage: {
|
|
287
|
+
globalCount: number;
|
|
288
|
+
globalLimit: number;
|
|
289
|
+
};
|
|
290
|
+
/** Store stats for observability (ADR-0001) */
|
|
291
|
+
stores: {
|
|
292
|
+
replay: {
|
|
293
|
+
inFlightCount: number;
|
|
294
|
+
outcomeCount: number;
|
|
295
|
+
idempotencyCacheSize: number;
|
|
296
|
+
maxInFlightCommands: number;
|
|
297
|
+
maxCommandOutcomes: number;
|
|
298
|
+
inFlightRejections: number;
|
|
299
|
+
};
|
|
300
|
+
version: {
|
|
301
|
+
sessionCount: number;
|
|
302
|
+
};
|
|
303
|
+
execution: {
|
|
304
|
+
laneCount: number;
|
|
305
|
+
};
|
|
306
|
+
lock: {
|
|
307
|
+
activeLocks: number;
|
|
308
|
+
timeoutCount: number;
|
|
309
|
+
waitingCount: number;
|
|
310
|
+
};
|
|
311
|
+
extensionUI: {
|
|
312
|
+
pendingCount: number;
|
|
313
|
+
maxPendingRequests: number;
|
|
314
|
+
rejectedCount: number;
|
|
315
|
+
};
|
|
316
|
+
sessionStore: {
|
|
317
|
+
/** Count of metadata file resets due to corruption/oversize */
|
|
318
|
+
metadataResetCount: number;
|
|
319
|
+
};
|
|
320
|
+
};
|
|
321
|
+
/** Circuit breaker metrics per provider (ADR-0010) */
|
|
322
|
+
circuitBreakers: CircuitBreakerMetrics[];
|
|
323
|
+
/** Bash circuit breaker metrics */
|
|
324
|
+
bashCircuitBreaker: {
|
|
325
|
+
enabled: boolean;
|
|
326
|
+
globalState: string;
|
|
327
|
+
sessionCount: number;
|
|
328
|
+
openSessionCount: number;
|
|
329
|
+
totalCalls: number;
|
|
330
|
+
totalTimeouts: number;
|
|
331
|
+
totalRejected: number;
|
|
332
|
+
};
|
|
333
|
+
/** Metrics system data (ADR-0016) - optional, only if MemorySink is enabled */
|
|
334
|
+
metrics?: Record<string, unknown>;
|
|
335
|
+
};
|
|
336
|
+
}) | (RpcResponseBase & {
|
|
337
|
+
command: "health_check";
|
|
338
|
+
success: true;
|
|
339
|
+
data: {
|
|
340
|
+
healthy: boolean;
|
|
341
|
+
issues: string[];
|
|
342
|
+
/** Whether any LLM provider circuit is open (ADR-0010) */
|
|
343
|
+
hasOpenCircuit: boolean;
|
|
344
|
+
/** Whether bash command circuit is open */
|
|
345
|
+
hasOpenBashCircuit: boolean;
|
|
346
|
+
};
|
|
347
|
+
}) | (RpcResponseBase & {
|
|
348
|
+
command: "list_stored_sessions";
|
|
349
|
+
success: true;
|
|
350
|
+
data: {
|
|
351
|
+
sessions: StoredSessionInfo[];
|
|
352
|
+
};
|
|
353
|
+
}) | (RpcResponseBase & {
|
|
354
|
+
command: "load_session";
|
|
355
|
+
success: true;
|
|
356
|
+
data: {
|
|
357
|
+
sessionId: string;
|
|
358
|
+
sessionInfo: SessionInfo;
|
|
359
|
+
};
|
|
360
|
+
});
|
|
361
|
+
export interface StoredSessionInfo extends SessionInfo {
|
|
362
|
+
sessionFile: string;
|
|
363
|
+
cwd: string;
|
|
364
|
+
fileExists: boolean;
|
|
365
|
+
}
|
|
366
|
+
export type SessionResponse = (RpcResponseBase & {
|
|
367
|
+
command: "extension_ui_response";
|
|
368
|
+
success: true;
|
|
369
|
+
}) | (RpcResponseBase & {
|
|
370
|
+
command: "get_available_models";
|
|
371
|
+
success: true;
|
|
372
|
+
data: {
|
|
373
|
+
models: Model<any>[];
|
|
374
|
+
};
|
|
375
|
+
}) | (RpcResponseBase & {
|
|
376
|
+
command: "get_commands";
|
|
377
|
+
success: true;
|
|
378
|
+
data: {
|
|
379
|
+
commands: Array<{
|
|
380
|
+
name: string;
|
|
381
|
+
description?: string;
|
|
382
|
+
source: string;
|
|
383
|
+
location?: string;
|
|
384
|
+
path?: string;
|
|
385
|
+
}>;
|
|
386
|
+
};
|
|
387
|
+
}) | (RpcResponseBase & {
|
|
388
|
+
command: "get_skills";
|
|
389
|
+
success: true;
|
|
390
|
+
data: {
|
|
391
|
+
skills: Array<{
|
|
392
|
+
name: string;
|
|
393
|
+
description: string;
|
|
394
|
+
filePath: string;
|
|
395
|
+
source: string;
|
|
396
|
+
}>;
|
|
397
|
+
};
|
|
398
|
+
}) | (RpcResponseBase & {
|
|
399
|
+
command: "get_tools";
|
|
400
|
+
success: true;
|
|
401
|
+
data: {
|
|
402
|
+
tools: Array<{
|
|
403
|
+
name: string;
|
|
404
|
+
description: string;
|
|
405
|
+
}>;
|
|
406
|
+
};
|
|
407
|
+
}) | (RpcResponseBase & {
|
|
408
|
+
command: "list_session_files";
|
|
409
|
+
success: true;
|
|
410
|
+
data: {
|
|
411
|
+
files: Array<{
|
|
412
|
+
path: string;
|
|
413
|
+
name: string;
|
|
414
|
+
modifiedAt?: string;
|
|
415
|
+
}>;
|
|
416
|
+
};
|
|
417
|
+
}) | (RpcResponseBase & {
|
|
418
|
+
command: "prompt";
|
|
419
|
+
success: true;
|
|
420
|
+
}) | (RpcResponseBase & {
|
|
421
|
+
command: "steer";
|
|
422
|
+
success: true;
|
|
423
|
+
}) | (RpcResponseBase & {
|
|
424
|
+
command: "follow_up";
|
|
425
|
+
success: true;
|
|
426
|
+
}) | (RpcResponseBase & {
|
|
427
|
+
command: "abort";
|
|
428
|
+
success: true;
|
|
429
|
+
}) | (RpcResponseBase & {
|
|
430
|
+
command: "get_state";
|
|
431
|
+
success: true;
|
|
432
|
+
data: SessionInfo;
|
|
433
|
+
}) | (RpcResponseBase & {
|
|
434
|
+
command: "get_messages";
|
|
435
|
+
success: true;
|
|
436
|
+
data: {
|
|
437
|
+
messages: AgentMessage[];
|
|
438
|
+
};
|
|
439
|
+
}) | (RpcResponseBase & {
|
|
440
|
+
command: "set_model";
|
|
441
|
+
success: true;
|
|
442
|
+
data: {
|
|
443
|
+
model: Model<any>;
|
|
444
|
+
};
|
|
445
|
+
}) | (RpcResponseBase & {
|
|
446
|
+
command: "cycle_model";
|
|
447
|
+
success: true;
|
|
448
|
+
data: {
|
|
449
|
+
model: Model<any>;
|
|
450
|
+
thinkingLevel: ThinkingLevel;
|
|
451
|
+
isScoped: boolean;
|
|
452
|
+
} | null;
|
|
453
|
+
}) | (RpcResponseBase & {
|
|
454
|
+
command: "set_thinking_level";
|
|
455
|
+
success: true;
|
|
456
|
+
}) | (RpcResponseBase & {
|
|
457
|
+
command: "cycle_thinking_level";
|
|
458
|
+
success: true;
|
|
459
|
+
data: {
|
|
460
|
+
level: ThinkingLevel;
|
|
461
|
+
} | null;
|
|
462
|
+
}) | (RpcResponseBase & {
|
|
463
|
+
command: "compact";
|
|
464
|
+
success: true;
|
|
465
|
+
data: CompactionResult;
|
|
466
|
+
}) | (RpcResponseBase & {
|
|
467
|
+
command: "abort_compaction";
|
|
468
|
+
success: true;
|
|
469
|
+
}) | (RpcResponseBase & {
|
|
470
|
+
command: "set_auto_compaction";
|
|
471
|
+
success: true;
|
|
472
|
+
}) | (RpcResponseBase & {
|
|
473
|
+
command: "set_auto_retry";
|
|
474
|
+
success: true;
|
|
475
|
+
}) | (RpcResponseBase & {
|
|
476
|
+
command: "abort_retry";
|
|
477
|
+
success: true;
|
|
478
|
+
}) | (RpcResponseBase & {
|
|
479
|
+
command: "bash";
|
|
480
|
+
success: true;
|
|
481
|
+
data: {
|
|
482
|
+
exitCode: number;
|
|
483
|
+
output: string;
|
|
484
|
+
cancelled: boolean;
|
|
485
|
+
};
|
|
486
|
+
}) | (RpcResponseBase & {
|
|
487
|
+
command: "abort_bash";
|
|
488
|
+
success: true;
|
|
489
|
+
}) | (RpcResponseBase & {
|
|
490
|
+
command: "get_session_stats";
|
|
491
|
+
success: true;
|
|
492
|
+
data: SessionStats;
|
|
493
|
+
}) | (RpcResponseBase & {
|
|
494
|
+
command: "set_session_name";
|
|
495
|
+
success: true;
|
|
496
|
+
}) | (RpcResponseBase & {
|
|
497
|
+
command: "export_html";
|
|
498
|
+
success: true;
|
|
499
|
+
data: {
|
|
500
|
+
path: string;
|
|
501
|
+
};
|
|
502
|
+
}) | (RpcResponseBase & {
|
|
503
|
+
command: "new_session";
|
|
504
|
+
success: true;
|
|
505
|
+
data: {
|
|
506
|
+
cancelled: boolean;
|
|
507
|
+
};
|
|
508
|
+
}) | (RpcResponseBase & {
|
|
509
|
+
command: "switch_session_file";
|
|
510
|
+
success: true;
|
|
511
|
+
data: {
|
|
512
|
+
cancelled: boolean;
|
|
513
|
+
};
|
|
514
|
+
}) | (RpcResponseBase & {
|
|
515
|
+
command: "fork";
|
|
516
|
+
success: true;
|
|
517
|
+
data: {
|
|
518
|
+
text: string;
|
|
519
|
+
cancelled: boolean;
|
|
520
|
+
};
|
|
521
|
+
}) | (RpcResponseBase & {
|
|
522
|
+
command: "get_fork_messages";
|
|
523
|
+
success: true;
|
|
524
|
+
data: {
|
|
525
|
+
messages: Array<{
|
|
526
|
+
entryId: string;
|
|
527
|
+
text: string;
|
|
528
|
+
}>;
|
|
529
|
+
};
|
|
530
|
+
}) | (RpcResponseBase & {
|
|
531
|
+
command: "get_last_assistant_text";
|
|
532
|
+
success: true;
|
|
533
|
+
data: {
|
|
534
|
+
text: string | null;
|
|
535
|
+
};
|
|
536
|
+
}) | (RpcResponseBase & {
|
|
537
|
+
command: "get_context_usage";
|
|
538
|
+
success: true;
|
|
539
|
+
data: {
|
|
540
|
+
tokens: number | null;
|
|
541
|
+
contextWindow: number;
|
|
542
|
+
percent: number | null;
|
|
543
|
+
} | null;
|
|
544
|
+
});
|
|
545
|
+
export type ErrorResponse = RpcResponseBase & {
|
|
546
|
+
success: false;
|
|
547
|
+
error: string;
|
|
548
|
+
};
|
|
549
|
+
export type RpcResponse = ServerResponse | SessionResponse | ErrorResponse;
|
|
550
|
+
export interface RpcEvent {
|
|
551
|
+
type: "event";
|
|
552
|
+
sessionId: string;
|
|
553
|
+
event: AgentSessionEvent;
|
|
554
|
+
}
|
|
555
|
+
export interface ServerEvent {
|
|
556
|
+
type: "server_ready";
|
|
557
|
+
data: {
|
|
558
|
+
/** Server software version (semver) */
|
|
559
|
+
serverVersion: string;
|
|
560
|
+
/** Protocol version for wire compatibility (semver) */
|
|
561
|
+
protocolVersion: string;
|
|
562
|
+
/** Available transports */
|
|
563
|
+
transports: string[];
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
export interface ServerShutdownEvent {
|
|
567
|
+
type: "server_shutdown";
|
|
568
|
+
data: {
|
|
569
|
+
reason: string;
|
|
570
|
+
timeoutMs?: number;
|
|
571
|
+
};
|
|
572
|
+
}
|
|
573
|
+
export interface SessionLifecycleEvent {
|
|
574
|
+
type: "session_created" | "session_deleted";
|
|
575
|
+
data: {
|
|
576
|
+
sessionId: string;
|
|
577
|
+
sessionInfo?: SessionInfo;
|
|
578
|
+
};
|
|
579
|
+
}
|
|
580
|
+
export interface CommandLifecycleEvent {
|
|
581
|
+
type: "command_accepted" | "command_started" | "command_finished";
|
|
582
|
+
data: {
|
|
583
|
+
commandId: string;
|
|
584
|
+
commandType: string;
|
|
585
|
+
sessionId?: string;
|
|
586
|
+
dependsOn?: string[];
|
|
587
|
+
ifSessionVersion?: number;
|
|
588
|
+
idempotencyKey?: string;
|
|
589
|
+
success?: boolean;
|
|
590
|
+
error?: string;
|
|
591
|
+
sessionVersion?: number;
|
|
592
|
+
replayed?: boolean;
|
|
593
|
+
};
|
|
594
|
+
}
|
|
595
|
+
export type RpcBroadcast = RpcEvent | ServerEvent | ServerShutdownEvent | SessionLifecycleEvent | CommandLifecycleEvent;
|
|
596
|
+
export interface Subscriber {
|
|
597
|
+
send: (data: string) => void;
|
|
598
|
+
subscribedSessions: Set<string>;
|
|
599
|
+
}
|
|
600
|
+
import type { AgentSession } from "@mariozechner/pi-coding-agent";
|
|
601
|
+
/**
|
|
602
|
+
* Interface for resolving sessions by ID.
|
|
603
|
+
*
|
|
604
|
+
* This is the NEXUS abstraction - a clean seam that enables:
|
|
605
|
+
* - Test doubles for unit testing without real AgentSession
|
|
606
|
+
* - Future multi-server clustering (resolver over RPC)
|
|
607
|
+
* - Session migration between servers
|
|
608
|
+
* - Dependency injection for cleaner architecture
|
|
609
|
+
*
|
|
610
|
+
* Implementations must be idempotent: calling getSession multiple times
|
|
611
|
+
* with the same ID returns the same session (or undefined consistently).
|
|
612
|
+
*/
|
|
613
|
+
export interface SessionResolver {
|
|
614
|
+
/**
|
|
615
|
+
* Get a session by ID.
|
|
616
|
+
* @returns The session if it exists, undefined otherwise.
|
|
617
|
+
*/
|
|
618
|
+
getSession(sessionId: string): AgentSession | undefined;
|
|
619
|
+
}
|
|
620
|
+
export { getCommandId, getCommandType, getSessionId, getCommandDependsOn, getCommandIfSessionVersion, getCommandIdempotencyKey, isSessionCommand, isCreateSessionResponse, isSwitchSessionResponse, } from "./type-guards.js";
|
|
621
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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0B,EAC1B,wBAAwB,EACxB,gBAAgB,EAChB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,kBAAkB,CAAC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getCommandId,
|
|
3
|
+
getCommandType,
|
|
4
|
+
getSessionId,
|
|
5
|
+
getCommandDependsOn,
|
|
6
|
+
getCommandIfSessionVersion,
|
|
7
|
+
getCommandIdempotencyKey,
|
|
8
|
+
isSessionCommand,
|
|
9
|
+
isCreateSessionResponse,
|
|
10
|
+
isSwitchSessionResponse
|
|
11
|
+
} from "./type-guards.js";
|
|
12
|
+
export {
|
|
13
|
+
getCommandDependsOn,
|
|
14
|
+
getCommandId,
|
|
15
|
+
getCommandIdempotencyKey,
|
|
16
|
+
getCommandIfSessionVersion,
|
|
17
|
+
getCommandType,
|
|
18
|
+
getSessionId,
|
|
19
|
+
isCreateSessionResponse,
|
|
20
|
+
isSessionCommand,
|
|
21
|
+
isSwitchSessionResponse
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=types.js.map
|