@ccpocket/bridge 0.2.0 → 1.0.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/dist/codex-process.d.ts +63 -6
- package/dist/codex-process.js +1081 -205
- package/dist/codex-process.js.map +1 -1
- package/dist/parser.d.ts +0 -2
- package/dist/parser.js.map +1 -1
- package/dist/session.js +11 -4
- package/dist/session.js.map +1 -1
- package/dist/websocket.js +44 -36
- package/dist/websocket.js.map +1 -1
- package/package.json +1 -1
package/dist/codex-process.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface CodexStartOptions {
|
|
|
8
8
|
modelReasoningEffort?: "minimal" | "low" | "medium" | "high" | "xhigh";
|
|
9
9
|
networkAccessEnabled?: boolean;
|
|
10
10
|
webSearchMode?: "disabled" | "cached" | "live";
|
|
11
|
+
collaborationMode?: "plan" | "default";
|
|
11
12
|
}
|
|
12
13
|
export interface CodexProcessEvents {
|
|
13
14
|
message: [ServerMessage];
|
|
@@ -15,19 +16,42 @@ export interface CodexProcessEvents {
|
|
|
15
16
|
exit: [number | null];
|
|
16
17
|
}
|
|
17
18
|
export declare class CodexProcess extends EventEmitter<CodexProcessEvents> {
|
|
18
|
-
private
|
|
19
|
-
private thread;
|
|
19
|
+
private child;
|
|
20
20
|
private _status;
|
|
21
21
|
private _threadId;
|
|
22
22
|
private stopped;
|
|
23
23
|
private startModel;
|
|
24
24
|
private inputResolve;
|
|
25
|
-
private
|
|
25
|
+
private pendingTurnId;
|
|
26
|
+
private pendingTurnCompletion;
|
|
27
|
+
private pendingApprovals;
|
|
28
|
+
private pendingUserInputs;
|
|
29
|
+
private lastTokenUsage;
|
|
30
|
+
private rpcSeq;
|
|
31
|
+
private pendingRpc;
|
|
32
|
+
private stdoutBuffer;
|
|
33
|
+
private _approvalPolicy;
|
|
34
|
+
private _collaborationMode;
|
|
35
|
+
private lastPlanItemText;
|
|
36
|
+
private pendingPlanCompletion;
|
|
37
|
+
/** Queued plan execution text when inputResolve wasn't ready at approval time. */
|
|
38
|
+
private _pendingPlanInput;
|
|
26
39
|
get status(): ProcessStatus;
|
|
27
40
|
get isWaitingForInput(): boolean;
|
|
28
41
|
get sessionId(): string | null;
|
|
29
42
|
get isRunning(): boolean;
|
|
30
|
-
|
|
43
|
+
get approvalPolicy(): string;
|
|
44
|
+
/**
|
|
45
|
+
* Update approval policy at runtime.
|
|
46
|
+
* Takes effect on the next `turn/start` RPC call.
|
|
47
|
+
*/
|
|
48
|
+
setApprovalPolicy(policy: string): void;
|
|
49
|
+
/**
|
|
50
|
+
* Set collaboration mode ("plan" or "default").
|
|
51
|
+
* Takes effect on the next `turn/start` RPC call.
|
|
52
|
+
*/
|
|
53
|
+
setCollaborationMode(mode: "plan" | "default"): void;
|
|
54
|
+
get collaborationMode(): "plan" | "default";
|
|
31
55
|
start(projectPath: string, options?: CodexStartOptions): void;
|
|
32
56
|
stop(): void;
|
|
33
57
|
interrupt(): void;
|
|
@@ -36,11 +60,44 @@ export declare class CodexProcess extends EventEmitter<CodexProcessEvents> {
|
|
|
36
60
|
base64: string;
|
|
37
61
|
mimeType: string;
|
|
38
62
|
}>): void;
|
|
63
|
+
approve(toolUseId?: string, _updatedInput?: Record<string, unknown>): void;
|
|
64
|
+
approveAlways(toolUseId?: string): void;
|
|
65
|
+
reject(toolUseId?: string, _message?: string): void;
|
|
66
|
+
answer(toolUseId: string, result: string): void;
|
|
67
|
+
getPendingPermission(toolUseId?: string): {
|
|
68
|
+
toolUseId: string;
|
|
69
|
+
toolName: string;
|
|
70
|
+
input: Record<string, unknown>;
|
|
71
|
+
} | undefined;
|
|
72
|
+
/** Emit a synthetic tool_result so history replay can match it to a permission_request. */
|
|
73
|
+
private emitToolResult;
|
|
74
|
+
private resolvePendingApproval;
|
|
75
|
+
private resolvePendingUserInput;
|
|
76
|
+
/**
|
|
77
|
+
* Plan approved → switch to Default mode and auto-start execution.
|
|
78
|
+
*/
|
|
79
|
+
private handlePlanApproved;
|
|
80
|
+
/**
|
|
81
|
+
* Plan rejected → stay in Plan mode and re-plan with feedback.
|
|
82
|
+
*/
|
|
83
|
+
private handlePlanRejected;
|
|
84
|
+
private bootstrap;
|
|
39
85
|
private runInputLoop;
|
|
40
|
-
private
|
|
86
|
+
private handleStdoutChunk;
|
|
87
|
+
private handleRpcEnvelope;
|
|
88
|
+
private handleRpcResponse;
|
|
89
|
+
private handleServerRequest;
|
|
90
|
+
private handleNotification;
|
|
91
|
+
private handleTurnCompleted;
|
|
41
92
|
private processItemStarted;
|
|
42
93
|
private processItemCompleted;
|
|
94
|
+
private toRpcInput;
|
|
95
|
+
private request;
|
|
96
|
+
private notify;
|
|
97
|
+
private respondToServerRequest;
|
|
98
|
+
private writeEnvelope;
|
|
99
|
+
private rejectAllPending;
|
|
43
100
|
private setStatus;
|
|
44
101
|
private emitMessage;
|
|
45
|
-
private
|
|
102
|
+
private extractToolUseId;
|
|
46
103
|
}
|