codex-copilot-dx 0.7.7 → 0.7.8
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 +28 -2
- package/bin/cli.mjs +31 -2
- package/package.json +1 -1
- package/src/adapter.mjs +12 -0
- package/src/cli-image.mjs +199 -0
- package/src/cli-options.mjs +18 -0
- package/src/cli-status.mjs +12 -0
- package/src/config.mjs +88 -6
- package/src/copilot-responses-compat.mjs +28 -18
- package/src/image-mcp.mjs +169 -0
- package/src/image-provider-config.mjs +190 -0
- package/src/image-provider.mjs +268 -0
- package/src/observability.mjs +2 -0
- package/src/response-failures.mjs +100 -0
- package/src/responses-handler.mjs +2 -0
- package/src/responses-proxy.mjs +181 -35
- package/src/responses-request.mjs +23 -0
|
@@ -84,6 +84,7 @@ function isEncryptedContentPart(value) {
|
|
|
84
84
|
const OMIT_ENCRYPTED_CONTENT = Symbol("omit-encrypted-content");
|
|
85
85
|
const ENCRYPTED_HISTORY_REBASE = Symbol("encrypted-history-rebase");
|
|
86
86
|
const RELEASE_HISTORY_INPUT = Symbol("release-history-input");
|
|
87
|
+
const RELEASED_MATERIALIZED_HISTORY = Symbol("released-materialized-history");
|
|
87
88
|
const HISTORY_PRESSURE_ROOT = Symbol("history-pressure-root");
|
|
88
89
|
const ENCRYPTED_TOOL_OUTPUT_MARKER = "[CCDX: encrypted tool output omitted because upstream could not decrypt it.]";
|
|
89
90
|
|
|
@@ -187,6 +188,10 @@ function responseValueHasOpaqueState(value) {
|
|
|
187
188
|
return Object.values(value).some(responseValueHasOpaqueState);
|
|
188
189
|
}
|
|
189
190
|
|
|
191
|
+
export function hasEncryptedResponseState(value) {
|
|
192
|
+
return responseValueHasOpaqueState(value);
|
|
193
|
+
}
|
|
194
|
+
|
|
190
195
|
export function sanitizeEncryptedReasoningRequest(reqContext, { historicalOnly = false } = {}) {
|
|
191
196
|
const state = { changed: false };
|
|
192
197
|
let body = cloneJson(reqContext.body);
|
|
@@ -379,10 +384,28 @@ export function dropMaterializedResponseHistory(reqContext) {
|
|
|
379
384
|
reqContext.body = { ...reqContext.body, input: releaseInput };
|
|
380
385
|
reqContext.inputItems = releaseInput;
|
|
381
386
|
delete reqContext[RELEASE_HISTORY_INPUT];
|
|
387
|
+
reqContext[RELEASED_MATERIALIZED_HISTORY] = true;
|
|
382
388
|
reqContext.currentInputStart = 0;
|
|
383
389
|
return true;
|
|
384
390
|
}
|
|
385
391
|
|
|
392
|
+
export function restoreMaterializedResponseHistoryForRetry(reqContext, { assertActive } = {}) {
|
|
393
|
+
if (!reqContext?.[RELEASED_MATERIALIZED_HISTORY] || !reqContext.historyParentId) return reqContext;
|
|
394
|
+
const body = cloneJson(reqContext.body);
|
|
395
|
+
body.previous_response_id = reqContext.historyParentId;
|
|
396
|
+
body.input = cloneJson(reqContext.historyInputItems || reqContext.body.input);
|
|
397
|
+
let restored = prepareResponsesRequest(body, {
|
|
398
|
+
assertActive,
|
|
399
|
+
copilotBoundary: false,
|
|
400
|
+
mutate: true,
|
|
401
|
+
});
|
|
402
|
+
restored.surface = reqContext.surface;
|
|
403
|
+
if (reqContext.routePlan) {
|
|
404
|
+
restored = applyResponseHistoryRoutePlan(restored, reqContext.routePlan);
|
|
405
|
+
}
|
|
406
|
+
return restored;
|
|
407
|
+
}
|
|
408
|
+
|
|
386
409
|
export function rememberResponseHistory(reqContext, responseJson) {
|
|
387
410
|
if (!responseJson?.id || !Array.isArray(reqContext?.historyInputItems || reqContext?.inputItems)) return;
|
|
388
411
|
const compacted = isSuccessfulCompactionResponse(responseJson);
|