@ccpocket/bridge 1.88.2 → 1.88.4
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 -0
- package/dist/codex-process.js +45 -1
- package/dist/codex-process.js.map +1 -1
- package/dist/performance-mode.js +4 -2
- package/dist/performance-mode.js.map +1 -1
- package/dist/sdk-process.d.ts +1 -0
- package/dist/sdk-process.js +50 -29
- package/dist/sdk-process.js.map +1 -1
- package/dist/session.d.ts +2 -0
- package/dist/session.js +9 -5
- package/dist/session.js.map +1 -1
- package/dist/websocket.js +1 -0
- package/dist/websocket.js.map +1 -1
- package/package.json +1 -1
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_IDLE_SESSION_TTL_MINUTES` | Disabled | Automatically stop idle sessions after this many minutes. Only a finite positive number enables this; unset, empty, zero, negative, or invalid values disable it. The 30-idle-session retention cap still applies. |
|
|
42
43
|
| `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. |
|
|
43
44
|
| `BRIDGE_HOST` | `0.0.0.0` | Bind address |
|
|
44
45
|
| `BRIDGE_API_KEY` | (none) | API key authentication (enabled when set) |
|
package/dist/codex-process.js
CHANGED
|
@@ -938,7 +938,7 @@ export class CodexProcess extends EventEmitter {
|
|
|
938
938
|
this.pendingUserInputs.delete(pending.toolUseId);
|
|
939
939
|
this.forgetPendingRequest(pending.toolUseId);
|
|
940
940
|
this.respondToServerRequest(pending.requestId, buildUserInputResponse(pending, result));
|
|
941
|
-
this.emitToolResult(pending.toolUseId,
|
|
941
|
+
this.emitToolResult(pending.toolUseId, questionAnswerResultForHistory(pending, result), "answered");
|
|
942
942
|
if (this.pendingApprovals.size === 0 &&
|
|
943
943
|
!this.hasBlockingUserInput() &&
|
|
944
944
|
!this.pendingPlanCompletion) {
|
|
@@ -2020,6 +2020,7 @@ export class CodexProcess extends EventEmitter {
|
|
|
2020
2020
|
questions: questions.map((q) => ({
|
|
2021
2021
|
id: q.id,
|
|
2022
2022
|
question: q.question,
|
|
2023
|
+
isSecret: q.isSecret,
|
|
2023
2024
|
})),
|
|
2024
2025
|
input,
|
|
2025
2026
|
kind: "questions",
|
|
@@ -3059,6 +3060,49 @@ function buildUserInputResponse(pending, rawResult) {
|
|
|
3059
3060
|
}
|
|
3060
3061
|
return buildElicitationResponse(pending, rawResult);
|
|
3061
3062
|
}
|
|
3063
|
+
/** Keep secret question values out of the replayable transcript. */
|
|
3064
|
+
function questionAnswerResultForHistory(pending, rawResult) {
|
|
3065
|
+
if (pending.kind !== "questions" ||
|
|
3066
|
+
!pending.questions.some((question) => question.isSecret)) {
|
|
3067
|
+
return rawResult;
|
|
3068
|
+
}
|
|
3069
|
+
const parsed = parseResultObject(rawResult);
|
|
3070
|
+
const structuredResult = isJsonObjectOrArray(rawResult);
|
|
3071
|
+
const answers = {};
|
|
3072
|
+
for (const [index, question] of pending.questions.entries()) {
|
|
3073
|
+
const candidate = parsed.byId[question.id] ?? parsed.byQuestion[question.question];
|
|
3074
|
+
const fallback = index === 0 && candidate === undefined && !structuredResult
|
|
3075
|
+
? plainAnswerValue(rawResult)
|
|
3076
|
+
: null;
|
|
3077
|
+
const values = normalizeAnswerValues(candidate ?? fallback);
|
|
3078
|
+
if (question.isSecret) {
|
|
3079
|
+
if (values.length > 0)
|
|
3080
|
+
answers[question.id] = { redacted: true };
|
|
3081
|
+
}
|
|
3082
|
+
else if (values.length > 0) {
|
|
3083
|
+
answers[question.id] = values;
|
|
3084
|
+
}
|
|
3085
|
+
}
|
|
3086
|
+
return JSON.stringify({ answers });
|
|
3087
|
+
}
|
|
3088
|
+
function isJsonObjectOrArray(value) {
|
|
3089
|
+
try {
|
|
3090
|
+
const parsed = JSON.parse(value);
|
|
3091
|
+
return parsed !== null && typeof parsed === "object";
|
|
3092
|
+
}
|
|
3093
|
+
catch {
|
|
3094
|
+
return false;
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
function plainAnswerValue(value) {
|
|
3098
|
+
try {
|
|
3099
|
+
const parsed = JSON.parse(value);
|
|
3100
|
+
return typeof parsed === "string" ? parsed : null;
|
|
3101
|
+
}
|
|
3102
|
+
catch {
|
|
3103
|
+
return value;
|
|
3104
|
+
}
|
|
3105
|
+
}
|
|
3062
3106
|
function resolveUserInputRejectResult(pending, fallback) {
|
|
3063
3107
|
if (pending.kind !== "elicitation_approval")
|
|
3064
3108
|
return fallback;
|