@ccpocket/bridge 1.64.0 → 1.65.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 +1 -1
- package/dist/codex-process.d.ts +12 -1
- package/dist/codex-process.js +95 -0
- package/dist/codex-process.js.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/mdns.d.ts +1 -0
- package/dist/mdns.js +3 -0
- package/dist/mdns.js.map +1 -1
- package/dist/parser.d.ts +26 -0
- package/dist/parser.js +31 -0
- package/dist/parser.js.map +1 -1
- package/dist/session.d.ts +3 -1
- package/dist/session.js +5 -0
- package/dist/session.js.map +1 -1
- package/dist/websocket.js +84 -0
- package/dist/websocket.js.map +1 -1
- package/package.json +1 -1
package/dist/websocket.js
CHANGED
|
@@ -78,6 +78,7 @@ const CODEX_RECENT_THREAD_SOURCE_KINDS = [
|
|
|
78
78
|
const CODEX_USER_TURN_UUID_RE = /^codex:user-turn:(\d+)$/;
|
|
79
79
|
const OPT_IN_SERVER_MESSAGES = new Set([
|
|
80
80
|
"conversation_queue",
|
|
81
|
+
"goal_state",
|
|
81
82
|
"prompt_history_status",
|
|
82
83
|
]);
|
|
83
84
|
function parseCodexUserTurnOrdinal(uuid) {
|
|
@@ -2438,6 +2439,89 @@ export class BridgeWebSocketServer {
|
|
|
2438
2439
|
console.log(`[ws] set_codex_model(codex): model=${model} effort=${modelReasoningEffort ?? ""}`);
|
|
2439
2440
|
break;
|
|
2440
2441
|
}
|
|
2442
|
+
case "get_goal": {
|
|
2443
|
+
const session = this.resolveSession(msg.sessionId);
|
|
2444
|
+
if (!session || session.provider !== "codex") {
|
|
2445
|
+
this.send(ws, {
|
|
2446
|
+
type: "error",
|
|
2447
|
+
message: "Goal lookup is only supported for active Codex sessions.",
|
|
2448
|
+
errorCode: "goal_get_unsupported",
|
|
2449
|
+
});
|
|
2450
|
+
break;
|
|
2451
|
+
}
|
|
2452
|
+
try {
|
|
2453
|
+
const goal = await session.process.getGoal();
|
|
2454
|
+
session.codexGoal = goal;
|
|
2455
|
+
this.send(ws, { type: "goal_state", sessionId: session.id, goal });
|
|
2456
|
+
}
|
|
2457
|
+
catch (err) {
|
|
2458
|
+
this.send(ws, {
|
|
2459
|
+
type: "error",
|
|
2460
|
+
message: `Failed to get goal: ${errorMessageOf(err)}`,
|
|
2461
|
+
errorCode: "goal_get_failed",
|
|
2462
|
+
});
|
|
2463
|
+
}
|
|
2464
|
+
break;
|
|
2465
|
+
}
|
|
2466
|
+
case "set_goal": {
|
|
2467
|
+
const session = this.resolveSession(msg.sessionId);
|
|
2468
|
+
if (!session || session.provider !== "codex") {
|
|
2469
|
+
this.send(ws, {
|
|
2470
|
+
type: "error",
|
|
2471
|
+
message: "Goal updates are only supported for active Codex sessions.",
|
|
2472
|
+
errorCode: "goal_set_unsupported",
|
|
2473
|
+
});
|
|
2474
|
+
break;
|
|
2475
|
+
}
|
|
2476
|
+
try {
|
|
2477
|
+
const goal = await session.process.setGoal({
|
|
2478
|
+
...(msg.objective !== undefined
|
|
2479
|
+
? { objective: msg.objective }
|
|
2480
|
+
: {}),
|
|
2481
|
+
...(msg.status !== undefined ? { status: msg.status } : {}),
|
|
2482
|
+
});
|
|
2483
|
+
session.codexGoal = goal;
|
|
2484
|
+
this.broadcastSessionMessage(session.id, {
|
|
2485
|
+
type: "goal_state",
|
|
2486
|
+
goal,
|
|
2487
|
+
});
|
|
2488
|
+
}
|
|
2489
|
+
catch (err) {
|
|
2490
|
+
this.send(ws, {
|
|
2491
|
+
type: "error",
|
|
2492
|
+
message: `Failed to set goal: ${errorMessageOf(err)}`,
|
|
2493
|
+
errorCode: "goal_set_failed",
|
|
2494
|
+
});
|
|
2495
|
+
}
|
|
2496
|
+
break;
|
|
2497
|
+
}
|
|
2498
|
+
case "clear_goal": {
|
|
2499
|
+
const session = this.resolveSession(msg.sessionId);
|
|
2500
|
+
if (!session || session.provider !== "codex") {
|
|
2501
|
+
this.send(ws, {
|
|
2502
|
+
type: "error",
|
|
2503
|
+
message: "Goal clearing is only supported for active Codex sessions.",
|
|
2504
|
+
errorCode: "goal_clear_unsupported",
|
|
2505
|
+
});
|
|
2506
|
+
break;
|
|
2507
|
+
}
|
|
2508
|
+
try {
|
|
2509
|
+
await session.process.clearGoal();
|
|
2510
|
+
session.codexGoal = null;
|
|
2511
|
+
this.broadcastSessionMessage(session.id, {
|
|
2512
|
+
type: "goal_state",
|
|
2513
|
+
goal: null,
|
|
2514
|
+
});
|
|
2515
|
+
}
|
|
2516
|
+
catch (err) {
|
|
2517
|
+
this.send(ws, {
|
|
2518
|
+
type: "error",
|
|
2519
|
+
message: `Failed to clear goal: ${errorMessageOf(err)}`,
|
|
2520
|
+
errorCode: "goal_clear_failed",
|
|
2521
|
+
});
|
|
2522
|
+
}
|
|
2523
|
+
break;
|
|
2524
|
+
}
|
|
2441
2525
|
case "set_sandbox_mode": {
|
|
2442
2526
|
if (this.failSetSandboxMode) {
|
|
2443
2527
|
this.send(ws, {
|