codex-copilot-dx 1.2.11 → 1.2.13
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 +14 -14
- package/bin/cli.mjs +12 -8
- package/docs/ARCHITECTURE.md +75 -5
- package/docs/REFERENCE.md +117 -4
- package/package.json +2 -2
- package/src/access-settings.mjs +98 -0
- package/src/adapter.mjs +19 -7
- package/src/api-secrets.mjs +69 -0
- package/src/auto-review-model.mjs +4 -3
- package/src/claude-client-config.mjs +16 -11
- package/src/claude-gateway.mjs +11 -8
- package/src/cli-m365.mjs +48 -8
- package/src/cli-models.mjs +2 -1
- package/src/cli-options.mjs +1 -1
- package/src/cli-status.mjs +1 -1
- package/src/client-gateway-keys.mjs +29 -0
- package/src/codex-api-config.mjs +51 -0
- package/src/connection-runtime.mjs +289 -0
- package/src/conversation-source-guard.mjs +42 -0
- package/src/dashboard/connections.js +163 -0
- package/src/dashboard/console.js +6 -4
- package/src/dashboard/flow.js +17 -18
- package/src/dashboard/index.html +46 -3
- package/src/dashboard/language.js +88 -3
- package/src/dashboard/status.js +1 -1
- package/src/dashboard/ui.css +54 -26
- package/src/dashboard/ui.js +5 -3
- package/src/dashboard-api.mjs +19 -4
- package/src/dashboard.mjs +1 -0
- package/src/optional-routes.mjs +2 -2
- package/src/private-helper-environment.mjs +7 -0
- package/src/provider-management.mjs +1 -1
- package/src/provider-runtime.mjs +37 -5
- package/src/providers/api-network.mjs +51 -0
- package/src/providers/api.mjs +129 -0
- package/src/proxy-tunnel.mjs +6 -4
- package/src/request-application.mjs +12 -6
- package/src/responses-handler.mjs +6 -4
- package/src/startup-ui.mjs +9 -0
- package/src/stream-performance.mjs +7 -6
- package/src/terminal-console.mjs +1 -1
- package/src/usage-store.mjs +1 -1
- package/src/windows-http-network.mjs +11 -6
- package/src/windows-prediction-network.cs +6 -4
|
@@ -31,6 +31,7 @@ public static class CCDXPredictionNetwork {
|
|
|
31
31
|
static readonly JavaScriptSerializer json = new JavaScriptSerializer { MaxJsonLength=2*1024*1024 };
|
|
32
32
|
static IntPtr session;
|
|
33
33
|
static string target = "prediction";
|
|
34
|
+
static HashSet<string> apiTargets = new HashSet<string>(StringComparer.Ordinal);
|
|
34
35
|
static int requestTimeout = 30000;
|
|
35
36
|
class Work { public IntPtr handle; public ManualResetEventSlim ack = new ManualResetEventSlim(false); public BlockingCollection<byte[]> upload = new BlockingCollection<byte[]>(2); public bool cancelled; }
|
|
36
37
|
static void Check(bool ok) { if(!ok) throw new IOException("winhttp_" + Marshal.GetLastWin32Error()); }
|
|
@@ -77,7 +78,7 @@ public static class CCDXPredictionNetwork {
|
|
|
77
78
|
IntPtr connection=IntPtr.Zero;
|
|
78
79
|
try {
|
|
79
80
|
var uri=new Uri((string)data["url"]);
|
|
80
|
-
if(uri.Scheme!="https" || uri.
|
|
81
|
+
if(uri.Scheme!="https" || uri.UserInfo.Length!=0 || uri.Fragment.Length!=0 || (target=="api" ? !apiTargets.Contains(uri.AbsoluteUri) : (uri.Port!=443 || (target=="m365" ? (uri.Host!="df.loki.delve.office.com" || !uri.AbsolutePath.StartsWith("/api/v1/llmapi/",StringComparison.Ordinal)) : (uri.Host!="chatgpt.com"&&uri.Host!="ab.chatgpt.com"))))) throw new IOException("winhttp_target_invalid");
|
|
81
82
|
var method=(string)data["method"];
|
|
82
83
|
if(method!="GET"&&method!="POST"&&method!="HEAD"&&method!="PUT"&&method!="DELETE"&&method!="OPTIONS"&&method!="PATCH")throw new IOException("winhttp_method_invalid");
|
|
83
84
|
var headers=(string)data["headers"];
|
|
@@ -129,9 +130,10 @@ public static class CCDXPredictionNetwork {
|
|
|
129
130
|
try {
|
|
130
131
|
var initial=json.Deserialize<Dictionary<string,object>>(Console.ReadLine());
|
|
131
132
|
if(initial.ContainsKey("target")) target=(string)initial["target"];
|
|
132
|
-
if(target!="prediction"&&target!="m365")throw new IOException("winhttp_target_invalid");
|
|
133
|
-
if(target=="
|
|
134
|
-
|
|
133
|
+
if(target!="prediction"&&target!="m365"&&target!="api")throw new IOException("winhttp_target_invalid");
|
|
134
|
+
if(target=="api") { if(initial["apiTargets"] is string)throw new IOException("winhttp_target_invalid");foreach(object raw in (System.Collections.IEnumerable)initial["apiTargets"]) { var uri=new Uri((string)raw);if(uri.Scheme!="https"||uri.UserInfo.Length!=0||uri.Query.Length!=0||uri.Fragment.Length!=0)throw new IOException("winhttp_target_invalid");apiTargets.Add(uri.AbsoluteUri);if(apiTargets.Count>8)throw new IOException("winhttp_target_invalid"); }if(apiTargets.Count<1)throw new IOException("winhttp_target_invalid"); }
|
|
135
|
+
if(target!="prediction" && initial.ContainsKey("timeoutMs")) requestTimeout=(int)Math.Max(1000,Math.Min(int.MaxValue,Convert.ToInt64(initial["timeoutMs"])));
|
|
136
|
+
session=WinHttpOpen(target=="m365"?"CCDX Microsoft 365":target=="api"?"CCDX API":"CCDX native prediction",4,null,null,0);
|
|
135
137
|
Check(session!=IntPtr.Zero);Check(WinHttpSetTimeouts(session,10000,10000,requestTimeout,requestTimeout));
|
|
136
138
|
uint protocols=0x800;Check(WinHttpSetOption(session,84,ref protocols,4));
|
|
137
139
|
string pac=(string)initial["pac"];
|