@eddyskywalker/dsh-chatgpt-subscription 0.76.0 → 0.76.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/CHANGELOG.md +9 -0
- package/lib/client.js.map +1 -1
- package/lib/index.js +76 -19
- package/lib/types/compat.d.ts +1 -1
- package/lib/types/host/antigravity-acp/binary.d.ts +6 -0
- package/lib/types/host/antigravity-acp/binary.d.ts.map +1 -1
- package/lib/types/host/antigravity-acp/login.d.ts +9 -16
- package/lib/types/host/antigravity-acp/login.d.ts.map +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -817,7 +817,7 @@ const ROUTE_PREFIX$5 = "/api/dsh-chatgpt-subscription";
|
|
|
817
817
|
* `test/responses-client.test.ts` asserts the two agree, so a release that
|
|
818
818
|
* forgets this constant fails the suite instead of shipping quietly.
|
|
819
819
|
*/
|
|
820
|
-
const PLUGIN_VERSION = "0.76.
|
|
820
|
+
const PLUGIN_VERSION = "0.76.1";
|
|
821
821
|
const CODEX_CHATGPT_PROVIDER_ID = "codex-chatgpt";
|
|
822
822
|
const CODEX_API_BASE = "https://chatgpt.com/backend-api/codex";
|
|
823
823
|
const CODEX_RESPONSES_URL = `${CODEX_API_BASE}/responses`;
|
|
@@ -27761,6 +27761,15 @@ const ACP_BINARY_RELEASES = {
|
|
|
27761
27761
|
executable: "agy_acp_server.par"
|
|
27762
27762
|
}
|
|
27763
27763
|
};
|
|
27764
|
+
/**
|
|
27765
|
+
* Arguments for the resolved executable.
|
|
27766
|
+
* The registry's standalone server already speaks ACP on stdio and rejects the
|
|
27767
|
+
* full CLI's acp and disable-telemetry flags. Detect configured paths too.
|
|
27768
|
+
*/
|
|
27769
|
+
function acpLaunchArgs(binary) {
|
|
27770
|
+
const executable = path.basename(binary.path).toLowerCase();
|
|
27771
|
+
return binary.kind === "downloaded" || executable === "agy_acp_server.exe" || executable === "agy_acp_server.par" ? [] : ["acp", "--disable-telemetry"];
|
|
27772
|
+
}
|
|
27764
27773
|
/** How long a resolved executable is reused before the disk is read again. */
|
|
27765
27774
|
const BINARY_CACHE_TTL_MS = 5 * 6e4;
|
|
27766
27775
|
/** Candidate paths the local CLI may live at, most specific first. */
|
|
@@ -28051,10 +28060,9 @@ function findEndOfCentralDirectory(bytes) {
|
|
|
28051
28060
|
*
|
|
28052
28061
|
* Two consequences follow, and they are the whole design:
|
|
28053
28062
|
*
|
|
28054
|
-
* - **The browser is opened exactly once.**
|
|
28055
|
-
*
|
|
28056
|
-
*
|
|
28057
|
-
* lines. So nothing here calls `openBrowser`.
|
|
28063
|
+
* - **The browser is opened exactly once.** ACP authenticate opens it for
|
|
28064
|
+
* protocol-driven methods; only a server that exclusively offers terminal
|
|
28065
|
+
* login falls back to agy acp --login. Nothing here calls openBrowser.
|
|
28058
28066
|
* - **"Signed in" is a probe, not a flag.** There is no local state to read: the
|
|
28059
28067
|
* only truthful answer comes from asking the agent to create a session, which
|
|
28060
28068
|
* is what {@link probeAuth} does. A failed probe is reported as "not signed in",
|
|
@@ -28078,22 +28086,71 @@ const LOGIN_STDERR_CAP = 2e3;
|
|
|
28078
28086
|
/**
|
|
28079
28087
|
* Start the official sign-in.
|
|
28080
28088
|
*
|
|
28081
|
-
*
|
|
28082
|
-
*
|
|
28083
|
-
*
|
|
28084
|
-
*
|
|
28085
|
-
*
|
|
28086
|
-
* The command line is `agy acp --login`, and a rejected command line, a
|
|
28087
|
-
* misconfigured path or a binary that cannot be spawned all exit (or error)
|
|
28088
|
-
* within milliseconds - and the previous version reported "sign-in started" for
|
|
28089
|
-
* every one of them while discarding the only sentence that explained it. The
|
|
28090
|
-
* launcher is therefore watched for {@link LOGIN_FAILURE_WINDOW_MS}: a spawn
|
|
28091
|
-
* error, or a non-zero exit that left stderr behind, is returned as the reason.
|
|
28089
|
+
* Protocol-driven methods run through ACP authenticate. A server that only
|
|
28090
|
+
* offers terminal-login keeps the detached agy acp --login fallback. Both paths
|
|
28091
|
+
* return after the start-up window instead of waiting for the browser callback,
|
|
28092
|
+
* and both surface an early process or protocol failure instead of claiming
|
|
28093
|
+
* that sign-in started.
|
|
28092
28094
|
*
|
|
28093
28095
|
* @param launch - The resolved executable.
|
|
28094
28096
|
* @returns whether a process was started, and why it was not.
|
|
28095
28097
|
*/
|
|
28096
|
-
function startLogin(launch) {
|
|
28098
|
+
async function startLogin(launch) {
|
|
28099
|
+
let client;
|
|
28100
|
+
try {
|
|
28101
|
+
client = new AcpClient({
|
|
28102
|
+
command: launch.command,
|
|
28103
|
+
args: launch.args,
|
|
28104
|
+
cwd: process.cwd()
|
|
28105
|
+
});
|
|
28106
|
+
const init = asRecord$17(await client.request("initialize", {
|
|
28107
|
+
protocolVersion: 1,
|
|
28108
|
+
clientCapabilities: {
|
|
28109
|
+
fs: {
|
|
28110
|
+
readTextFile: false,
|
|
28111
|
+
writeTextFile: false
|
|
28112
|
+
},
|
|
28113
|
+
terminal: false
|
|
28114
|
+
},
|
|
28115
|
+
clientInfo: {
|
|
28116
|
+
name: "dsh-chatgpt-subscription",
|
|
28117
|
+
version: "1.0.0"
|
|
28118
|
+
}
|
|
28119
|
+
}));
|
|
28120
|
+
const authMethods = Array.isArray(init?.authMethods) ? init.authMethods.map((entry) => String(entry.id ?? "")).filter((id) => id !== "") : [];
|
|
28121
|
+
if (authMethods.length === 0) throw new Error("The Antigravity ACP server advertised no authentication methods.");
|
|
28122
|
+
const methodId = preferAuthMethod(authMethods);
|
|
28123
|
+
if (methodId === "terminal-login") {
|
|
28124
|
+
await client.dispose().catch(() => void 0);
|
|
28125
|
+
return startTerminalLogin(launch);
|
|
28126
|
+
}
|
|
28127
|
+
return await startProtocolLogin(client, methodId);
|
|
28128
|
+
} catch (error) {
|
|
28129
|
+
if (client !== void 0) await client.dispose().catch(() => void 0);
|
|
28130
|
+
return {
|
|
28131
|
+
started: false,
|
|
28132
|
+
error: error instanceof Error ? error.message : String(error)
|
|
28133
|
+
};
|
|
28134
|
+
}
|
|
28135
|
+
}
|
|
28136
|
+
async function startProtocolLogin(client, methodId) {
|
|
28137
|
+
const completion = client.request("authenticate", { methodId }).then(() => ({ started: true }), (error) => ({
|
|
28138
|
+
started: false,
|
|
28139
|
+
error: error instanceof Error ? error.message : String(error)
|
|
28140
|
+
}));
|
|
28141
|
+
completion.then(() => client.dispose().catch(() => void 0));
|
|
28142
|
+
let timer;
|
|
28143
|
+
const detached = new Promise((resolve) => {
|
|
28144
|
+
timer = setTimeout(() => resolve({ started: true }), LOGIN_FAILURE_WINDOW_MS);
|
|
28145
|
+
timer.unref?.();
|
|
28146
|
+
});
|
|
28147
|
+
try {
|
|
28148
|
+
return await Promise.race([completion, detached]);
|
|
28149
|
+
} finally {
|
|
28150
|
+
if (timer !== void 0) clearTimeout(timer);
|
|
28151
|
+
}
|
|
28152
|
+
}
|
|
28153
|
+
function startTerminalLogin(launch) {
|
|
28097
28154
|
let child;
|
|
28098
28155
|
try {
|
|
28099
28156
|
child = spawn(launch.command, [...launch.args, "--login"], {
|
|
@@ -106156,7 +106213,7 @@ function apply(ctx, pluginConfig = {}) {
|
|
|
106156
106213
|
if (resolved.binary === void 0) throw new Error(resolved.diagnostics.error ?? "No usable Antigravity CLI (agy) was found.");
|
|
106157
106214
|
return {
|
|
106158
106215
|
command: resolved.binary.path,
|
|
106159
|
-
args:
|
|
106216
|
+
args: acpLaunchArgs(resolved.binary),
|
|
106160
106217
|
version: resolved.binary.version
|
|
106161
106218
|
};
|
|
106162
106219
|
};
|
|
@@ -106183,7 +106240,7 @@ function apply(ctx, pluginConfig = {}) {
|
|
|
106183
106240
|
if (resolved.binary === void 0) throw new Error(resolved.diagnostics.error ?? "No usable Antigravity CLI (agy) was found.");
|
|
106184
106241
|
return {
|
|
106185
106242
|
command: resolved.binary.path,
|
|
106186
|
-
args:
|
|
106243
|
+
args: acpLaunchArgs(resolved.binary),
|
|
106187
106244
|
version: resolved.binary.version
|
|
106188
106245
|
};
|
|
106189
106246
|
}));
|
package/lib/types/compat.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export declare const ROUTE_PREFIX: "/api/dsh-chatgpt-subscription";
|
|
|
76
76
|
* `test/responses-client.test.ts` asserts the two agree, so a release that
|
|
77
77
|
* forgets this constant fails the suite instead of shipping quietly.
|
|
78
78
|
*/
|
|
79
|
-
export declare const PLUGIN_VERSION: "0.76.
|
|
79
|
+
export declare const PLUGIN_VERSION: "0.76.1";
|
|
80
80
|
export declare const CODEX_CHATGPT_PROVIDER_ID: "codex-chatgpt";
|
|
81
81
|
export { MINIMAX_CODE_PROVIDER_ID, MINIMAX_CODE_ROUTE_PREFIX } from './shared/minimax-code-contracts.ts';
|
|
82
82
|
export declare const CODEX_API_BASE: "https://chatgpt.com/backend-api/codex";
|
|
@@ -52,6 +52,12 @@ export interface ResolvedAcpBinary {
|
|
|
52
52
|
/** The CLI version when it could be read. */
|
|
53
53
|
version?: string;
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* Arguments for the resolved executable.
|
|
57
|
+
* The registry's standalone server already speaks ACP on stdio and rejects the
|
|
58
|
+
* full CLI's acp and disable-telemetry flags. Detect configured paths too.
|
|
59
|
+
*/
|
|
60
|
+
export declare function acpLaunchArgs(binary: ResolvedAcpBinary): string[];
|
|
55
61
|
/** Where a resolution attempt looked and what it found, for the status card. */
|
|
56
62
|
export interface AcpBinaryDiagnostics {
|
|
57
63
|
/** Every candidate path tried, in order. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binary.d.ts","sourceRoot":"","sources":["../../../../src/host/antigravity-acp/binary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AASH,6FAA6F;AAC7F,MAAM,WAAW,gBAAgB;IAC/B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAA;IACf,mBAAmB;IACnB,GAAG,EAAE,MAAM,CAAA;IACX,2DAA2D;IAC3D,MAAM,EAAE,MAAM,CAAA;IACd,gFAAgF;IAChF,UAAU,EAAE,MAAM,C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* - **The browser is opened exactly once.**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* lines. So nothing here calls `openBrowser`.
|
|
10
|
+
* - **The browser is opened exactly once.** ACP authenticate opens it for
|
|
11
|
+
* protocol-driven methods; only a server that exclusively offers terminal
|
|
12
|
+
* login falls back to agy acp --login. Nothing here calls openBrowser.
|
|
14
13
|
* - **"Signed in" is a probe, not a flag.** There is no local state to read: the
|
|
15
14
|
* only truthful answer comes from asking the agent to create a session, which
|
|
16
15
|
* is what {@link probeAuth} does. A failed probe is reported as "not signed in",
|
|
@@ -18,7 +17,7 @@
|
|
|
18
17
|
*
|
|
19
18
|
* @module dsh-chatgpt-subscription/host/antigravity-acp/login
|
|
20
19
|
*/
|
|
21
|
-
import
|
|
20
|
+
import { AcpClient } from './acp-client.ts';
|
|
22
21
|
import type { AcpLaunch } from './adapter.ts';
|
|
23
22
|
import type { AntigravityAcpAuthDto } from '../../shared/antigravity-acp-contracts.ts';
|
|
24
23
|
/** How long the login launcher may run before it is considered detached. */
|
|
@@ -44,17 +43,11 @@ export interface LoginStartResult {
|
|
|
44
43
|
/**
|
|
45
44
|
* Start the official sign-in.
|
|
46
45
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* The command line is `agy acp --login`, and a rejected command line, a
|
|
53
|
-
* misconfigured path or a binary that cannot be spawned all exit (or error)
|
|
54
|
-
* within milliseconds - and the previous version reported "sign-in started" for
|
|
55
|
-
* every one of them while discarding the only sentence that explained it. The
|
|
56
|
-
* launcher is therefore watched for {@link LOGIN_FAILURE_WINDOW_MS}: a spawn
|
|
57
|
-
* error, or a non-zero exit that left stderr behind, is returned as the reason.
|
|
46
|
+
* Protocol-driven methods run through ACP authenticate. A server that only
|
|
47
|
+
* offers terminal-login keeps the detached agy acp --login fallback. Both paths
|
|
48
|
+
* return after the start-up window instead of waiting for the browser callback,
|
|
49
|
+
* and both surface an early process or protocol failure instead of claiming
|
|
50
|
+
* that sign-in started.
|
|
58
51
|
*
|
|
59
52
|
* @param launch - The resolved executable.
|
|
60
53
|
* @returns whether a process was started, and why it was not.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/host/antigravity-acp/login.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../../../src/host/antigravity-acp/login.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAE7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2CAA2C,CAAA;AAEtF,4EAA4E;AAC5E,eAAO,MAAM,sBAAsB,QAAS,CAAA;AAE5C;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,OAAQ,CAAA;AAK5C,iCAAiC;AACjC,eAAO,MAAM,oBAAoB,QAAS,CAAA;AAE1C,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAA;IAChB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuB7E;AA4FD;;;;;;;;;;GAUG;AACH,wBAAsB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,qBAAqB,CAAC,CA4BvG"}
|