@ccpocket/bridge 0.2.0 → 1.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/dist/cli.js CHANGED
File without changes
@@ -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,47 @@ export interface CodexProcessEvents {
15
16
  exit: [number | null];
16
17
  }
17
18
  export declare class CodexProcess extends EventEmitter<CodexProcessEvents> {
18
- private codex;
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 pendingAbort;
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
- constructor();
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";
55
+ /**
56
+ * Rename a thread via the app-server RPC.
57
+ * Sends thread/name/set which persists to ~/.codex/session_index.jsonl.
58
+ */
59
+ renameThread(name: string): Promise<void>;
31
60
  start(projectPath: string, options?: CodexStartOptions): void;
32
61
  stop(): void;
33
62
  interrupt(): void;
@@ -36,11 +65,50 @@ export declare class CodexProcess extends EventEmitter<CodexProcessEvents> {
36
65
  base64: string;
37
66
  mimeType: string;
38
67
  }>): void;
68
+ approve(toolUseId?: string, _updatedInput?: Record<string, unknown>): void;
69
+ approveAlways(toolUseId?: string): void;
70
+ reject(toolUseId?: string, _message?: string): void;
71
+ answer(toolUseId: string, result: string): void;
72
+ getPendingPermission(toolUseId?: string): {
73
+ toolUseId: string;
74
+ toolName: string;
75
+ input: Record<string, unknown>;
76
+ } | undefined;
77
+ /** Emit a synthetic tool_result so history replay can match it to a permission_request. */
78
+ private emitToolResult;
79
+ private resolvePendingApproval;
80
+ private resolvePendingUserInput;
81
+ /**
82
+ * Plan approved → switch to Default mode and auto-start execution.
83
+ */
84
+ private handlePlanApproved;
85
+ /**
86
+ * Plan rejected → stay in Plan mode and re-plan with feedback.
87
+ */
88
+ private handlePlanRejected;
89
+ private bootstrap;
90
+ /**
91
+ * Fetch skills from Codex app-server via `skills/list` RPC and emit them
92
+ * as a `supported_commands` system message so the Flutter client can display
93
+ * skill entries alongside built-in slash commands.
94
+ */
95
+ private fetchSkills;
39
96
  private runInputLoop;
40
- private processEvent;
97
+ private handleStdoutChunk;
98
+ private handleRpcEnvelope;
99
+ private handleRpcResponse;
100
+ private handleServerRequest;
101
+ private handleNotification;
102
+ private handleTurnCompleted;
41
103
  private processItemStarted;
42
104
  private processItemCompleted;
105
+ private toRpcInput;
106
+ private request;
107
+ private notify;
108
+ private respondToServerRequest;
109
+ private writeEnvelope;
110
+ private rejectAllPending;
43
111
  private setStatus;
44
112
  private emitMessage;
45
- private toSdkInput;
113
+ private extractToolUseId;
46
114
  }