codex-copilot-dx 1.2.5 → 1.2.7
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 +4 -4
- package/bin/cli.mjs +42 -2
- package/docs/ARCHITECTURE.md +11 -0
- package/docs/README.md +4 -0
- package/docs/REFERENCE.md +26 -2
- package/package.json +1 -1
- package/src/account-tools.mjs +121 -0
- package/src/adapter.mjs +2 -0
- package/src/auth-credentials.mjs +18 -8
- package/src/auth-status.mjs +21 -7
- package/src/auth.mjs +1 -0
- package/src/cli-auth.mjs +38 -1
- package/src/cli-m365.mjs +3 -1
- package/src/cli-options.mjs +46 -13
- package/src/cli-tools.mjs +25 -0
- package/src/cli-web.mjs +37 -0
- package/src/codex-config-doctor.mjs +4 -0
- package/src/copilot-client.mjs +1 -0
- package/src/copilot-token-session.mjs +9 -0
- package/src/dashboard/console.js +1 -1
- package/src/dashboard/icons.js +24 -0
- package/src/dashboard/index.html +57 -15
- package/src/dashboard/language.js +101 -0
- package/src/dashboard/status.js +16 -1
- package/src/dashboard/tools.js +151 -0
- package/src/dashboard/ui.css +23 -0
- package/src/dashboard/ui.js +11 -6
- package/src/dashboard-api.mjs +8 -0
- package/src/dashboard-tools.mjs +43 -0
- package/src/dashboard.mjs +2 -0
- package/src/doctor.mjs +3 -2
- package/src/local-tools.mjs +53 -0
- package/src/native-prediction-environment.mjs +1 -1
- package/src/network-route.mjs +12 -1
- package/src/optional-routes.mjs +9 -3
- package/src/provider-runtime.mjs +5 -4
- package/src/providers/m365-network-diagnostic.mjs +28 -0
- package/src/providers/m365-network.mjs +6 -3
- package/src/providers/m365.mjs +7 -2
package/src/providers/m365.mjs
CHANGED
|
@@ -16,6 +16,7 @@ import { resolveClaudeModel } from "../claude-models.mjs";
|
|
|
16
16
|
import { modelReasoningEfforts } from "../provider-metadata.mjs";
|
|
17
17
|
import { limitM365CacheTtl } from "./m365-messages-policy.mjs";
|
|
18
18
|
import { createM365ConversationGuard } from "./m365-conversation-accounts.mjs";
|
|
19
|
+
import { m365NetworkDiagnostic } from "./m365-network-diagnostic.mjs";
|
|
19
20
|
|
|
20
21
|
export const M365_API_BASE = "https://df.loki.delve.office.com/api/v1/llmapi";
|
|
21
22
|
const SOFT_TTL_MS = 2 * 60 * 60 * 1000;
|
|
@@ -74,6 +75,7 @@ export function createM365Provider({ home, env = process.env, account: accountOv
|
|
|
74
75
|
const guardConversation = createM365ConversationGuard({ home });
|
|
75
76
|
let catalog = null, account = null, catalogAt = 0, state = "idle", reason = null, flight = null, controller = null, generation = 0;
|
|
76
77
|
let network = null, networkFlight = null, cacheTtlAdjustments = 0;
|
|
78
|
+
let networkDiagnostic = null;
|
|
77
79
|
const registry = { models: null, source: "unavailable", cacheState: "none", cacheSavedAtMs: null,
|
|
78
80
|
refreshInFlight: false, generation: 0, lastError: null, lastErrorAtMs: null };
|
|
79
81
|
const profile = () => account ? `m365:${m365AccountKey(account)}` : "m365:unavailable";
|
|
@@ -85,7 +87,7 @@ export function createM365Provider({ home, env = process.env, account: accountOv
|
|
|
85
87
|
const start = createNetwork || (await import("./m365-network.mjs")).createM365Network;
|
|
86
88
|
const opened = await start({ env, signal });
|
|
87
89
|
if (state === "disabled") { opened.close();throw m365Error("m365_disabled"); }
|
|
88
|
-
network = opened;return opened.fetch;
|
|
90
|
+
network = opened;networkDiagnostic = null;return opened.fetch;
|
|
89
91
|
})().finally(() => { if (networkFlight === pending) networkFlight = null; });
|
|
90
92
|
networkFlight = pending;
|
|
91
93
|
}
|
|
@@ -128,7 +130,8 @@ export function createM365Provider({ home, env = process.env, account: accountOv
|
|
|
128
130
|
} catch (error) {
|
|
129
131
|
if (options.signal?.aborted) throw options.signal.reason || error;
|
|
130
132
|
throw Object.assign(new Error(redactDiagnosticText(String(error.message).split(credential.token).join("[redacted]"))), {
|
|
131
|
-
code: /^m365_[a-z0-9_]+$/.test(error.code || "") ? error.code : "m365_network_error", statusCode: 502
|
|
133
|
+
code: /^m365_[a-z0-9_]+$/.test(error.code || "") ? error.code : "m365_network_error", statusCode: 502,
|
|
134
|
+
network_diagnostic: m365NetworkDiagnostic(error.network_diagnostic) });
|
|
132
135
|
}
|
|
133
136
|
}
|
|
134
137
|
|
|
@@ -156,6 +159,7 @@ export function createM365Provider({ home, env = process.env, account: accountOv
|
|
|
156
159
|
})().catch(error => {
|
|
157
160
|
if (current === generation) {
|
|
158
161
|
state = "unavailable";reason = /^m365_[a-z0-9_]+$/.test(error.code || "") ? error.code : "m365_unavailable";
|
|
162
|
+
networkDiagnostic = m365NetworkDiagnostic(error.network_diagnostic);
|
|
159
163
|
registry.lastError = reason;registry.lastErrorAtMs = now();
|
|
160
164
|
}
|
|
161
165
|
throw error;
|
|
@@ -249,6 +253,7 @@ export function createM365Provider({ home, env = process.env, account: accountOv
|
|
|
249
253
|
},
|
|
250
254
|
snapshot: () => ({ ...auth.snapshot(), state, reason: reason || auth.snapshot().reason, account: account ? { login: account.login, tenant: account.tenant, selection_source: account.selection_source || "legacy" } : null,
|
|
251
255
|
network: network?.snapshot() || null,
|
|
256
|
+
network_diagnostic: networkDiagnostic ? { ...networkDiagnostic } : null,
|
|
252
257
|
cache_ttl_adjustments: cacheTtlAdjustments,
|
|
253
258
|
models: { total: catalog?.data.length || 0, claude: m365Models(catalog, "claude").length, gpt: m365Models(catalog, "gpt").length,
|
|
254
259
|
source: registry.source, refreshed_at: catalogAt ? new Date(catalogAt).toISOString() : null }, refresh_in_flight: Boolean(flight) }),
|