@ccpocket/bridge 1.85.2 → 1.86.1

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/README.md CHANGED
@@ -39,6 +39,7 @@ ccpocket-bridge --version
39
39
  | Environment Variable | Default | Description |
40
40
  |---------------------|---------|-------------|
41
41
  | `BRIDGE_PORT` | `8765` | WebSocket port |
42
+ | `BRIDGE_NOTIFY_GOAL_TURN_COMPLETED` | `false` | Set exactly to `true` to notify intermediate Codex turns while a Goal is active. Goal completion, blockers, limits, approvals and errors remain enabled. Read at session creation; restart Bridge to apply to all sessions. |
42
43
  | `BRIDGE_HOST` | `0.0.0.0` | Bind address |
43
44
  | `BRIDGE_API_KEY` | (none) | API key authentication (enabled when set) |
44
45
  | `BRIDGE_ALLOWED_DIRS` | `$HOME` | Comma-separated list of project directories the Bridge may access; set exactly to `*` to allow any directory |
@@ -211,8 +211,9 @@ export declare class CodexProcess extends EventEmitter<CodexProcessEvents> {
211
211
  * Sends thread/name/set which persists to ~/.codex/session_index.jsonl.
212
212
  */
213
213
  renameThread(name: string): Promise<void>;
214
+ private goalLookup;
214
215
  /** Read the persisted goal attached to this Codex thread. */
215
- getGoal(): Promise<CodexGoal | null>;
216
+ getGoal(timeoutMs?: number): Promise<CodexGoal | null>;
216
217
  /** Create or update the persisted goal attached to this Codex thread. */
217
218
  setGoal(update: {
218
219
  objective?: string;
@@ -240,15 +240,21 @@ export class CodexProcess extends EventEmitter {
240
240
  name,
241
241
  });
242
242
  }
243
+ goalLookup;
243
244
  /** Read the persisted goal attached to this Codex thread. */
244
- async getGoal() {
245
+ async getGoal(timeoutMs = 3_000) {
245
246
  if (!this._threadId) {
246
247
  throw new Error("No thread ID available for goal lookup");
247
248
  }
248
- const response = (await this.request("thread/goal/get", {
249
- threadId: this._threadId,
250
- }));
251
- return response.goal == null ? null : parseCodexGoal(response.goal);
249
+ if (!this.goalLookup) {
250
+ this.goalLookup = this.request("thread/goal/get", { threadId: this._threadId }, timeoutMs).then((value) => {
251
+ const response = value;
252
+ return response.goal == null ? null : parseCodexGoal(response.goal);
253
+ }).finally(() => {
254
+ this.goalLookup = undefined;
255
+ });
256
+ }
257
+ return this.goalLookup;
252
258
  }
253
259
  /** Create or update the persisted goal attached to this Codex thread. */
254
260
  async setGoal(update) {