codex-copilot-dx 0.10.0 → 0.10.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/bin/cli.mjs +1 -0
- package/docs/REFERENCE.md +3 -0
- package/package.json +1 -1
- package/src/provider-runtime.mjs +5 -4
- package/src/providers/m365.mjs +1 -1
package/bin/cli.mjs
CHANGED
|
@@ -411,6 +411,7 @@ try {
|
|
|
411
411
|
log: (kind, message) => console.log(startupComplete ? status(kind, message) : startupCheck(kind, "Models", message)),
|
|
412
412
|
});
|
|
413
413
|
providerRuntime = createProviderRuntime({ githubClient: profileRuntime.codexClient, githubRegistry: profileModels.codexRegistry,
|
|
414
|
+
corePort: ADAPTER_PORT,
|
|
414
415
|
githubCredentialFingerprint: () => profileRuntime.codexCredentialFingerprint,
|
|
415
416
|
log: (kind, message) => console.log(startupComplete ? status(kind, message) : startupCheck(kind, "M365", message)) });
|
|
416
417
|
const m365Setup = runInBackground(() => providerRuntime.start());
|
package/docs/REFERENCE.md
CHANGED
|
@@ -89,6 +89,9 @@ optional image MCP/skill/API remains separately configured and off by default.
|
|
|
89
89
|
### Claude gateway and client ownership
|
|
90
90
|
|
|
91
91
|
The gateway is a second listener in the same Node service, on `127.0.0.1:2027`.
|
|
92
|
+
If the core service itself is configured on 2027, CCDX reserves that port for the
|
|
93
|
+
core and skips only the Claude listener/setup. M365 GPT backup still works. Select
|
|
94
|
+
a different core `ADAPTER_PORT` if both client surfaces are needed; no port is moved automatically.
|
|
92
95
|
It accepts a private local Bearer key or `x-api-key`, rejects browser Origin
|
|
93
96
|
headers and exposes Claude only: `GET /v1/models`, `POST /v1/messages` and
|
|
94
97
|
`POST /v1/messages/count_tokens` (upstream support remains authoritative).
|
package/package.json
CHANGED
package/src/provider-runtime.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import { createGithubProvider } from "./providers/github.mjs";
|
|
3
3
|
import { readProviderSettings, writeProviderSettings } from "./provider-settings.mjs";
|
|
4
|
-
import { readM365Settings, updateM365Settings, m365Paths, ensureM365GatewayKey } from "./m365-settings.mjs";
|
|
4
|
+
import { readM365Settings, updateM365Settings, m365Paths, ensureM365GatewayKey, M365_GATEWAY_PORT } from "./m365-settings.mjs";
|
|
5
5
|
|
|
6
6
|
const unavailable = reason => Object.assign(new Error(`Microsoft 365 is unavailable (${reason}); GitHub routing was not substituted`),
|
|
7
7
|
{ code: reason, statusCode: 503 });
|
|
@@ -9,7 +9,7 @@ const unavailable = reason => Object.assign(new Error(`Microsoft 365 is unavaila
|
|
|
9
9
|
// Composition owns source selection. Providers never modify Codex, prediction,
|
|
10
10
|
// image configuration or each other's credentials.
|
|
11
11
|
export function createProviderRuntime({ githubClient, githubRegistry, githubCredentialFingerprint = "", home, env = process.env, platform = process.platform,
|
|
12
|
-
log = () => {}, createM365, startGateway, configureClients, restoreClients } = {}) {
|
|
12
|
+
corePort = Number(env.ADAPTER_PORT || 2026), log = () => {}, createM365, startGateway, configureClients, restoreClients } = {}) {
|
|
13
13
|
const options = { home, env, platform }, github = { ...createGithubProvider({ client: githubClient,
|
|
14
14
|
profileId: () => { const value = typeof githubCredentialFingerprint === "function" ? githubCredentialFingerprint() : githubCredentialFingerprint;
|
|
15
15
|
return value ? `codex:${value}` : "codex"; } }), registry: githubRegistry };
|
|
@@ -32,8 +32,9 @@ export function createProviderRuntime({ githubClient, githubRegistry, githubCred
|
|
|
32
32
|
}
|
|
33
33
|
await m365.refresh();if (closed || !enabled) return null;
|
|
34
34
|
const claudeModels = m365.models("claude");
|
|
35
|
-
claudeReason = claudeModels.length ?
|
|
36
|
-
if (
|
|
35
|
+
claudeReason = !claudeModels.length ? "m365_no_claude_models" : corePort === M365_GATEWAY_PORT ? "m365_gateway_core_port_conflict" : null;
|
|
36
|
+
if (claudeReason === "m365_gateway_core_port_conflict") log("warn", `Claude gateway skipped: port ${M365_GATEWAY_PORT} belongs to the configured core service; M365 GPT routing remains available`);
|
|
37
|
+
if (claudeModels.length && !claudeReason) try {
|
|
37
38
|
const apiKey = ensureM365GatewayKey(options);
|
|
38
39
|
if (!gateway) {
|
|
39
40
|
const start = startGateway || (await import("./claude-gateway.mjs")).startClaudeGateway;
|
package/src/providers/m365.mjs
CHANGED
|
@@ -23,7 +23,7 @@ const protocolError = (code, message, statusCode = 400) => Object.assign(new Err
|
|
|
23
23
|
|
|
24
24
|
export function m365Headers(token, { headers = {}, conversationId, stream = false } = {}) {
|
|
25
25
|
const out = { Authorization: `Bearer ${token}`, "Content-Type": "application/json", Accept: stream ? "text/event-stream" : "application/json",
|
|
26
|
-
"X-ClientType": "GitHub", "X-ClientVersion": "0.10.
|
|
26
|
+
"X-ClientType": "GitHub", "X-ClientVersion": "0.10.1", "X-Llm-Api-Version": "2026-09-28", "X-ClientScenario": "Code",
|
|
27
27
|
"X-ClientFeature": "LlmApiProxy", "X-ClientCorrelationId": randomUUID(), "X-ClientCallId": randomUUID() };
|
|
28
28
|
if (conversationId) out["X-ConversationId"] = conversationId;
|
|
29
29
|
for (const name of ["anthropic-version", "anthropic-beta"]) {
|