feat: project Pi conversation events
This commit is contained in:
1 parent
e79aeffffa
commit
3599064bc4
11 files changed
+2428
-32
No files matched your search
@@ -35,7 +35,22 @@ class AuthFailureWorker implements PiConversationWorker {
|
||||
if (command.type === 'prompt') {
|
||||
throw new PiProcessError('PI_RPC_RESPONSE_ERROR', '401 provider authentication failed');
|
||||
}
|
||||
return { type: 'response', id: 'fake', success: true };
|
||||
const data = command.type === 'get_state'
|
||||
? { sessionId: `session-${this.id}`, isStreaming: false, isCompacting: false }
|
||||
: command.type === 'get_entries'
|
||||
? { entries: [], leafId: null }
|
||||
: command.type === 'get_session_stats'
|
||||
? {
|
||||
contextUsage: { tokens: 0, contextWindow: 100_000, percent: 0 },
|
||||
tokens: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
|
||||
}
|
||||
: undefined;
|
||||
return {
|
||||
type: 'response',
|
||||
id: 'fake',
|
||||
success: true,
|
||||
...(data === undefined ? {} : { data: data as T }),
|
||||
};
|
||||
}
|
||||
|
||||
subscribe(_listener: (event: PiRpcEvent) => void): () => void { return () => undefined; }
|
||||
|
||||
Reference in new issue
Block a user