dsh-llm-omp-transports 0.3.4 → 0.3.6
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 +12 -4
- package/lib/adapter.d.ts +17 -9
- package/lib/adapter.js +52 -18
- package/lib/adapter.js.map +1 -1
- package/lib/antigravity/credentials.d.ts +37 -0
- package/lib/antigravity/credentials.js +110 -0
- package/lib/antigravity/credentials.js.map +1 -0
- package/lib/catalog/antigravity-cli.d.ts +27 -0
- package/lib/catalog/antigravity-cli.js +231 -0
- package/lib/catalog/antigravity-cli.js.map +1 -0
- package/lib/catalog/cursor.d.ts +4 -4
- package/lib/catalog/cursor.js +3 -3
- package/lib/catalog/devin.d.ts +5 -5
- package/lib/catalog/devin.js +3 -25
- package/lib/catalog/devin.js.map +1 -1
- package/lib/catalog/factory-droid.d.ts +4 -4
- package/lib/catalog/factory-droid.js +2 -2
- package/lib/catalog/gitlab-duo-agent.d.ts +4 -4
- package/lib/catalog/gitlab-duo-agent.js +2 -2
- package/lib/catalog/gitlab-duo.d.ts +4 -4
- package/lib/catalog/gitlab-duo.js +2 -2
- package/lib/catalog/google-antigravity.d.ts +4 -4
- package/lib/catalog/google-antigravity.js +2 -2
- package/lib/catalog/google-gemini-cli.d.ts +4 -4
- package/lib/catalog/google-gemini-cli.js +2 -2
- package/lib/cursor/credentials.js +8 -2
- package/lib/cursor/credentials.js.map +1 -1
- package/lib/devin/credentials.js +8 -2
- package/lib/devin/credentials.js.map +1 -1
- package/lib/factory-droid/credentials.js +8 -4
- package/lib/factory-droid/credentials.js.map +1 -1
- package/lib/gitlab/credentials.js +8 -4
- package/lib/gitlab/credentials.js.map +1 -1
- package/lib/google/auth.d.ts +18 -0
- package/lib/google/auth.js +40 -3
- package/lib/google/auth.js.map +1 -1
- package/lib/google/client-facts.generated.d.ts +1 -1
- package/lib/google/client-facts.generated.js +0 -4
- package/lib/google/client-facts.generated.js.map +1 -1
- package/lib/google/credentials.d.ts +0 -2
- package/lib/google/credentials.js +8 -5
- package/lib/google/credentials.js.map +1 -1
- package/lib/google/route.d.ts +0 -5
- package/lib/google/route.js +0 -26
- package/lib/google/route.js.map +1 -1
- package/lib/index.d.ts +30 -12
- package/lib/index.js +141 -40
- package/lib/index.js.map +1 -1
- package/lib/omp/antigravity-cli.mjs +14594 -0
- package/lib/omp/antigravity-login.mjs +9424 -0
- package/lib/omp/cursor.mjs +33 -16
- package/lib/omp/devin.mjs +22 -13
- package/lib/omp/factory-droid.mjs +254 -81
- package/lib/omp/gitlab-duo-agent.mjs +13 -8
- package/lib/omp/gitlab-duo.mjs +363 -132
- package/lib/omp/google.mjs +334 -134
- package/lib/omp.d.ts +23 -1
- package/lib/projection.d.ts +36 -11
- package/lib/projection.js +59 -44
- package/lib/projection.js.map +1 -1
- package/package.json +11 -9
package/README.md
CHANGED
|
@@ -110,10 +110,18 @@ records — not a second code path.
|
|
|
110
110
|
transport the structured JSON envelope (`token`, `projectId`, `refreshToken`,
|
|
111
111
|
`expiresAt`, `email`) that omp parses.
|
|
112
112
|
- **Project discovery** — sign-in finishes with the Cloud Code Assist project:
|
|
113
|
-
`loadCodeAssist` → (tier onboarding `onboardUser` + LRO poll, or
|
|
114
|
-
`
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
`loadCodeAssist` → (tier onboarding `onboardUser` + LRO poll, or, when a
|
|
114
|
+
`google-gemini-cli` account is `legacy-tier`/paid **and** Google returns no
|
|
115
|
+
project, a project-id question in the sign-in panel — `GOOGLE_CLOUD_PROJECT` /
|
|
116
|
+
`GOOGLE_CLOUD_PROJECT_ID` answers it without the prompt). Antigravity
|
|
117
|
+
additionally checks free-tier eligibility and bounds onboarding at 30 s.
|
|
118
|
+
- **Google account requirements** — the routes are not interchangeable.
|
|
119
|
+
`google-gemini-cli` is the Google Cloud (Gemini Code Assist) route: the account
|
|
120
|
+
needs a Cloud project, and a Google One subscription does not provide one.
|
|
121
|
+
`google-antigravity` runs on a Google account's Antigravity entitlement (its
|
|
122
|
+
free tier here; Antigravity's own plans decide paid access). Both go straight
|
|
123
|
+
to Cloud Code Assist — this package bundles no `agy` CLI and no ACP transport;
|
|
124
|
+
omp's separate `antigravity-cli` provider is out of scope.
|
|
117
125
|
- **Models** — generated from the pinned `@oh-my-pi/pi-catalog@18.18.8`: 7 rows
|
|
118
126
|
for `google-gemini-cli`, 22 for `google-antigravity`, served without a network
|
|
119
127
|
call.
|
package/lib/adapter.d.ts
CHANGED
|
@@ -20,15 +20,15 @@ import { LlmAdapter } from '@deepseek-ai/dsh-llm';
|
|
|
20
20
|
import type { GenerateOptions, LlmModelInfo, LlmProviderInfo, LlmResolvedModelInfo, StreamChunk } from '@deepseek-ai/dsh-llm';
|
|
21
21
|
import type { RouteProfile } from './projection.js';
|
|
22
22
|
import type { OmpAssistantMessageEvent, OmpContext } from './omp.js';
|
|
23
|
-
import type { CursorModelRow, DevinModelRow, FactoryDroidModelRow, GitLabDuoAgentModelRow, GitLabDuoModelRow, GoogleModelRow, OmpCursorModel, OmpCursorOptions, OmpDevinModel, OmpDevinOptions, OmpFactoryDroidModel, OmpFactoryDroidOptions, OmpGitLabDuoAgentModel, OmpGitLabDuoModel, OmpGitLabDuoOptions, OmpGitLabDuoWorkflowOptions, OmpGoogleModel, OmpGoogleOptions } from './omp.js';
|
|
23
|
+
import type { CursorModelRow, DevinModelRow, FactoryDroidModelRow, GitLabDuoAgentModelRow, GitLabDuoModelRow, GoogleModelRow, OmpCursorModel, OmpCursorOptions, OmpDevinModel, OmpDevinOptions, OmpFactoryDroidModel, OmpFactoryDroidOptions, OmpGitLabDuoAgentModel, OmpGitLabDuoModel, OmpGitLabDuoOptions, OmpGitLabDuoWorkflowOptions, OmpAntigravityCliModel, OmpAntigravityCliOptions, OmpGoogleModel, OmpGoogleOptions } from './omp.js';
|
|
24
24
|
/** The Cursor provider route this adapter owns. */
|
|
25
25
|
export declare const CURSOR_ROUTE = "cursor";
|
|
26
26
|
/** The Devin provider route this adapter owns. */
|
|
27
27
|
export declare const DEVIN_ROUTE = "devin";
|
|
28
|
+
/** The Antigravity ACP provider route this adapter owns. */
|
|
29
|
+
export declare const ANTIGRAVITY_CLI_ROUTE = "antigravity-cli";
|
|
28
30
|
/** The Gemini CLI provider route this adapter owns. */
|
|
29
31
|
export declare const GOOGLE_GEMINI_CLI_ROUTE = "google-gemini-cli";
|
|
30
|
-
/** The Antigravity provider route this adapter owns. */
|
|
31
|
-
export declare const GOOGLE_ANTIGRAVITY_ROUTE = "google-antigravity";
|
|
32
32
|
/** The Factory Droid provider route this adapter owns. */
|
|
33
33
|
export declare const FACTORY_DROID_ROUTE = "factory-droid";
|
|
34
34
|
/** The GitLab Duo proxy provider route this adapter owns. */
|
|
@@ -65,7 +65,7 @@ export interface ProjectedTransportRequest<Model, Options> {
|
|
|
65
65
|
/** What differs between the routes: identity, catalog, projection and credential record. */
|
|
66
66
|
export interface TransportRoute<Row extends TransportRow, Model, Options extends TransportOptions> {
|
|
67
67
|
/** Provider id; also the registered route set the projection's profile accepts. */
|
|
68
|
-
readonly id: 'cursor' | 'devin' | 'factory-droid' | 'gitlab-duo' | 'gitlab-duo-agent' | 'google-gemini-cli' | '
|
|
68
|
+
readonly id: 'cursor' | 'devin' | 'factory-droid' | 'gitlab-duo' | 'gitlab-duo-agent' | 'google-gemini-cli' | 'antigravity-cli';
|
|
69
69
|
/** Models-page / provider-info display name. */
|
|
70
70
|
readonly displayName: string;
|
|
71
71
|
/** The `ctx.credentials` record this route reads. */
|
|
@@ -98,8 +98,16 @@ export declare const DEVIN_TRANSPORT_ROUTE: TransportRoute<DevinModelRow, OmpDev
|
|
|
98
98
|
* resolver reads and writes those records.
|
|
99
99
|
*/
|
|
100
100
|
export declare const GOOGLE_GEMINI_CLI_TRANSPORT_ROUTE: TransportRoute<GoogleModelRow, OmpGoogleModel, OmpGoogleOptions>;
|
|
101
|
-
/**
|
|
102
|
-
|
|
101
|
+
/**
|
|
102
|
+
* The Antigravity CLI (ACP) route's facts.
|
|
103
|
+
*
|
|
104
|
+
* The transport is omp's `streamAntigravityCli`: it runs the official `agy`
|
|
105
|
+
* binary over ACP, so a row's `baseUrl` is unused and the credential is the
|
|
106
|
+
* staged consumer grant. `state` is the adapter-owned map that carries agy's
|
|
107
|
+
* conversation across the steps of one tool turn — the provider parks an MCP
|
|
108
|
+
* request in it and resumes on the next call.
|
|
109
|
+
*/
|
|
110
|
+
export declare const ANTIGRAVITY_CLI_TRANSPORT_ROUTE: TransportRoute<GoogleModelRow, OmpAntigravityCliModel, OmpAntigravityCliOptions>;
|
|
103
111
|
/**
|
|
104
112
|
* The Factory Droid route's credential record.
|
|
105
113
|
*
|
|
@@ -235,9 +243,9 @@ export type OmpGoogleAdapterConfig = OmpAdapterOptions<OmpGoogleModel, OmpGoogle
|
|
|
235
243
|
export declare class OmpGoogleGeminiCliAdapter extends OmpTransportAdapter<GoogleModelRow, OmpGoogleModel, OmpGoogleOptions> {
|
|
236
244
|
constructor(options: OmpGoogleAdapterConfig);
|
|
237
245
|
}
|
|
238
|
-
/** The Antigravity adapter: the
|
|
239
|
-
export declare class
|
|
240
|
-
constructor(options:
|
|
246
|
+
/** The Antigravity ACP adapter: the bundled `streamAntigravityCli` over the `agy` catalog. */
|
|
247
|
+
export declare class OmpAntigravityCliAdapter extends OmpTransportAdapter<GoogleModelRow, OmpAntigravityCliModel, OmpAntigravityCliOptions> {
|
|
248
|
+
constructor(options: OmpAdapterOptions<OmpAntigravityCliModel, OmpAntigravityCliOptions>);
|
|
241
249
|
}
|
|
242
250
|
/** The DSH llm adapter configuration for the Factory Droid route. */
|
|
243
251
|
export type OmpFactoryDroidAdapterConfig = OmpAdapterOptions<OmpFactoryDroidModel, OmpFactoryDroidOptions>;
|
package/lib/adapter.js
CHANGED
|
@@ -22,19 +22,19 @@ import { DEVIN_MODELS } from './catalog/devin.js';
|
|
|
22
22
|
import { FACTORY_DROID_MODELS } from './catalog/factory-droid.js';
|
|
23
23
|
import { GITLAB_DUO_MODELS } from './catalog/gitlab-duo.js';
|
|
24
24
|
import { GITLAB_DUO_AGENT_MODELS } from './catalog/gitlab-duo-agent.js';
|
|
25
|
-
import {
|
|
25
|
+
import { ANTIGRAVITY_CLI_MODELS } from './catalog/antigravity-cli.js';
|
|
26
26
|
import { GOOGLE_GEMINI_CLI_MODELS } from './catalog/google-gemini-cli.js';
|
|
27
27
|
import { CURSOR_CREDENTIAL_KEY } from './cursor/credentials.js';
|
|
28
28
|
import { DEVIN_CREDENTIAL_KEY } from './devin/credentials.js';
|
|
29
|
-
import { CURSOR_PROFILE, DEVIN_PROFILE, FACTORY_DROID_PROFILE, GITLAB_DUO_AGENT_PROFILE, GITLAB_DUO_PROFILE,
|
|
29
|
+
import { ANTIGRAVITY_CLI_PROFILE, CURSOR_PROFILE, DEVIN_PROFILE, FACTORY_DROID_PROFILE, GITLAB_DUO_AGENT_PROFILE, GITLAB_DUO_PROFILE, GOOGLE_GEMINI_CLI_PROFILE, abortedFinish, projectDevinRequest, projectEvents, projectFactoryDroidRequest, projectGitLabDuoAgentRequest, projectGitLabDuoRequest, projectAntigravityCliRequest, projectGoogleRequest, projectRequest, } from './projection.js';
|
|
30
30
|
/** The Cursor provider route this adapter owns. */
|
|
31
31
|
export const CURSOR_ROUTE = 'cursor';
|
|
32
32
|
/** The Devin provider route this adapter owns. */
|
|
33
33
|
export const DEVIN_ROUTE = 'devin';
|
|
34
|
+
/** The Antigravity ACP provider route this adapter owns. */
|
|
35
|
+
export const ANTIGRAVITY_CLI_ROUTE = 'antigravity-cli';
|
|
34
36
|
/** The Gemini CLI provider route this adapter owns. */
|
|
35
37
|
export const GOOGLE_GEMINI_CLI_ROUTE = 'google-gemini-cli';
|
|
36
|
-
/** The Antigravity provider route this adapter owns. */
|
|
37
|
-
export const GOOGLE_ANTIGRAVITY_ROUTE = 'google-antigravity';
|
|
38
38
|
/** The Factory Droid provider route this adapter owns. */
|
|
39
39
|
export const FACTORY_DROID_ROUTE = 'factory-droid';
|
|
40
40
|
/** The GitLab Duo proxy provider route this adapter owns. */
|
|
@@ -101,16 +101,47 @@ export const GOOGLE_GEMINI_CLI_TRANSPORT_ROUTE = {
|
|
|
101
101
|
project: (row, options) => projectGoogleRequest(row, GOOGLE_GEMINI_CLI_PROFILE, options),
|
|
102
102
|
efforts: row => row.thinking?.efforts,
|
|
103
103
|
};
|
|
104
|
-
/**
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
/**
|
|
105
|
+
* The Antigravity CLI (ACP) route's facts.
|
|
106
|
+
*
|
|
107
|
+
* The transport is omp's `streamAntigravityCli`: it runs the official `agy`
|
|
108
|
+
* binary over ACP, so a row's `baseUrl` is unused and the credential is the
|
|
109
|
+
* staged consumer grant. `state` is the adapter-owned map that carries agy's
|
|
110
|
+
* conversation across the steps of one tool turn — the provider parks an MCP
|
|
111
|
+
* request in it and resumes on the next call.
|
|
112
|
+
*/
|
|
113
|
+
export const ANTIGRAVITY_CLI_TRANSPORT_ROUTE = (() => {
|
|
114
|
+
// agy's conversation state is per DSH session: keying it prevents one session's
|
|
115
|
+
// parked tool turn from resuming another's, and the small bound keeps a long-lived
|
|
116
|
+
// daemon from retaining every session it ever served.
|
|
117
|
+
const sessions = new Map();
|
|
118
|
+
const stateFor = (key) => {
|
|
119
|
+
const existing = sessions.get(key);
|
|
120
|
+
if (existing !== undefined) {
|
|
121
|
+
// Re-insert on every use so the eviction below is LRU, not FIFO: an active
|
|
122
|
+
// session's parked tool turn must never be the first one dropped.
|
|
123
|
+
sessions.delete(key);
|
|
124
|
+
sessions.set(key, existing);
|
|
125
|
+
return existing;
|
|
126
|
+
}
|
|
127
|
+
if (sessions.size >= 64) {
|
|
128
|
+
const oldest = sessions.keys().next().value;
|
|
129
|
+
if (oldest !== undefined)
|
|
130
|
+
sessions.delete(oldest);
|
|
131
|
+
}
|
|
132
|
+
const created = new Map();
|
|
133
|
+
sessions.set(key, created);
|
|
134
|
+
return created;
|
|
135
|
+
};
|
|
136
|
+
return {
|
|
137
|
+
id: ANTIGRAVITY_CLI_ROUTE,
|
|
138
|
+
displayName: 'Antigravity (agy)',
|
|
139
|
+
credentialKey: `llm-omp-transports/${ANTIGRAVITY_CLI_ROUTE}`,
|
|
140
|
+
profile: ANTIGRAVITY_CLI_PROFILE,
|
|
141
|
+
models: ANTIGRAVITY_CLI_MODELS,
|
|
142
|
+
project: (row, options) => projectAntigravityCliRequest(row, ANTIGRAVITY_CLI_PROFILE, options, stateFor(String(options.sessionId ?? 'default')), process.cwd()),
|
|
143
|
+
};
|
|
144
|
+
})();
|
|
114
145
|
/**
|
|
115
146
|
* The Factory Droid route's credential record.
|
|
116
147
|
*
|
|
@@ -237,7 +268,10 @@ class OmpTransportAdapter extends LlmAdapter {
|
|
|
237
268
|
/** Refuse routes this adapter does not own instead of describing another provider's models. */
|
|
238
269
|
assertRoute(provider) {
|
|
239
270
|
if (provider !== this.config.route.id) {
|
|
240
|
-
throw
|
|
271
|
+
throw LlmError.fromFailure({
|
|
272
|
+
message: `llm-omp-transports: the ${this.config.route.id} adapter does not serve provider "${provider}"`,
|
|
273
|
+
code: UNKNOWN_PROVIDER,
|
|
274
|
+
});
|
|
241
275
|
}
|
|
242
276
|
}
|
|
243
277
|
async *call(options) {
|
|
@@ -335,10 +369,10 @@ export class OmpGoogleGeminiCliAdapter extends OmpTransportAdapter {
|
|
|
335
369
|
super({ route: GOOGLE_GEMINI_CLI_TRANSPORT_ROUTE, ...options });
|
|
336
370
|
}
|
|
337
371
|
}
|
|
338
|
-
/** The Antigravity adapter: the
|
|
339
|
-
export class
|
|
372
|
+
/** The Antigravity ACP adapter: the bundled `streamAntigravityCli` over the `agy` catalog. */
|
|
373
|
+
export class OmpAntigravityCliAdapter extends OmpTransportAdapter {
|
|
340
374
|
constructor(options) {
|
|
341
|
-
super({ route:
|
|
375
|
+
super({ route: ANTIGRAVITY_CLI_TRANSPORT_ROUTE, ...options });
|
|
342
376
|
}
|
|
343
377
|
}
|
|
344
378
|
/** The Factory Droid adapter: the bundled `streamFactoryDroid` over the registry seed catalog. */
|
package/lib/adapter.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAUlG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"adapter.js","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAUlG,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAA;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAA;AACrE,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,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AAqB,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;IACrD,CAAC;CACF;AAKD,+FAA+F;AAC/F,MAAM,OAAO,yBAA0B,SAAQ,mBAAqE;IAClH,YAAY,OAA+B;QACzC,KAAK,CAAC,EAAE,KAAK,EAAE,iCAAiC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;IACjE,CAAC;CACF;AAGD,8FAA8F;AAC9F,MAAM,OAAO,wBAAyB,SAAQ,mBAI7C;IACC,YAAY,OAA4E;QACtF,KAAK,CAAC,EAAE,KAAK,EAAE,+BAA+B,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;IAC/D,CAAC;CACF;AAKD,kGAAkG;AAClG,MAAM,OAAO,sBAAuB,SAAQ,mBAI3C;IACC,YAAY,OAAqC;QAC/C,KAAK,CAAC,EAAE,KAAK,EAAE,6BAA6B,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;IAC7D,CAAC;CACF;AAQD,6FAA6F;AAC7F,MAAM,OAAO,wBAAyB,SAAQ,mBAI7C;IACC,YAAY,OAAuC;QACjD,KAAK,CAAC,EAAE,KAAK,EAAE,gCAAgC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;IAChE,CAAC;CACF;AAKD,mFAAmF;AACnF,MAAM,OAAO,mBAAoB,SAAQ,mBAIxC;IACC,YAAY,OAAkC;QAC5C,KAAK,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,GAAG,OAAO,EAAE,CAAC,CAAA;IAC1D,CAAC;CACF"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CredentialRecordsLike, StoredCredentialRecord } from '../cursor/credentials.js';
|
|
2
|
+
/** The credential record this route reads and writes. */
|
|
3
|
+
export declare const ANTIGRAVITY_CLI_CREDENTIAL_KEY = "llm-omp-transports/antigravity-cli";
|
|
4
|
+
/** The consumer grant agy exported: what the CLI refresh call consumes and returns. */
|
|
5
|
+
export interface AntigravityCliGrant {
|
|
6
|
+
readonly access: string;
|
|
7
|
+
readonly refresh: string;
|
|
8
|
+
readonly expires: number;
|
|
9
|
+
readonly email?: string;
|
|
10
|
+
readonly accountId?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Refresh one stored grant through the route's own refresh call. */
|
|
13
|
+
export type AntigravityCliRefresher = (grant: AntigravityCliGrant, signal?: AbortSignal) => Promise<AntigravityCliGrant>;
|
|
14
|
+
/**
|
|
15
|
+
* Read the route's grant from one credential record.
|
|
16
|
+
*
|
|
17
|
+
* @param record - the stored record, as the credentials seam returned it.
|
|
18
|
+
* @returns the grant, or undefined when the record is absent or malformed.
|
|
19
|
+
*/
|
|
20
|
+
export declare function readAntigravityCliGrant(record: StoredCredentialRecord | undefined): AntigravityCliGrant | undefined;
|
|
21
|
+
/** The transport's api-key envelope: it reads these four fields and nothing else. */
|
|
22
|
+
export declare function antigravityCliEnvelope(grant: AntigravityCliGrant): string;
|
|
23
|
+
/** Options for {@link createAntigravityCliAccess}. */
|
|
24
|
+
export interface AntigravityCliAccessOptions {
|
|
25
|
+
readonly now?: () => number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Build the route's credential resolver.
|
|
29
|
+
*
|
|
30
|
+
* @param credentials - the credentials seam this route reads and writes.
|
|
31
|
+
* @param refreshGrant - the CLI's refresh call, injected so this module stays
|
|
32
|
+
* free of the bundled artifact.
|
|
33
|
+
* @param options - clock seam.
|
|
34
|
+
* @returns a resolver that returns the transport's envelope, refreshing once
|
|
35
|
+
* under the record lock when the grant is near expiry.
|
|
36
|
+
*/
|
|
37
|
+
export declare function createAntigravityCliAccess(credentials: CredentialRecordsLike, refreshGrant: AntigravityCliRefresher, options?: AntigravityCliAccessOptions): (signal?: AbortSignal) => Promise<string>;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Antigravity ACP route's credential record.
|
|
3
|
+
*
|
|
4
|
+
* The record is the consumer grant agy exported during sign-in
|
|
5
|
+
* (`{access, refresh, expires, email?, accountId?}`) — no `projectId`, because the
|
|
6
|
+
* CLI owns the endpoint. The transport parses it as its "structured" api-key
|
|
7
|
+
* envelope, so the adapter hands over `{token, refreshToken, expiresAt, email}`.
|
|
8
|
+
*
|
|
9
|
+
* @module dsh-llm-omp-transports/antigravity/credentials
|
|
10
|
+
*/
|
|
11
|
+
import { LlmError } from '@deepseek-ai/dsh-llm';
|
|
12
|
+
/** The credential record this route reads and writes. */
|
|
13
|
+
export const ANTIGRAVITY_CLI_CREDENTIAL_KEY = 'llm-omp-transports/antigravity-cli';
|
|
14
|
+
/** Refresh this long before the recorded expiry, as the Google routes do. */
|
|
15
|
+
const SKEW_MS = 60_000;
|
|
16
|
+
/**
|
|
17
|
+
* Read the route's grant from one credential record.
|
|
18
|
+
*
|
|
19
|
+
* @param record - the stored record, as the credentials seam returned it.
|
|
20
|
+
* @returns the grant, or undefined when the record is absent or malformed.
|
|
21
|
+
*/
|
|
22
|
+
export function readAntigravityCliGrant(record) {
|
|
23
|
+
if (record?.kind !== 'grant')
|
|
24
|
+
return undefined;
|
|
25
|
+
const payload = record.payload;
|
|
26
|
+
if (typeof payload !== 'object' || payload === null || Array.isArray(payload))
|
|
27
|
+
return undefined;
|
|
28
|
+
const value = payload;
|
|
29
|
+
const access = value['access'];
|
|
30
|
+
const refresh = value['refresh'];
|
|
31
|
+
const expires = value['expires'];
|
|
32
|
+
if (typeof access !== 'string' || access === '')
|
|
33
|
+
return undefined;
|
|
34
|
+
if (typeof refresh !== 'string' || refresh === '')
|
|
35
|
+
return undefined;
|
|
36
|
+
if (typeof expires !== 'number' || !Number.isFinite(expires))
|
|
37
|
+
return undefined;
|
|
38
|
+
return {
|
|
39
|
+
access,
|
|
40
|
+
refresh,
|
|
41
|
+
expires,
|
|
42
|
+
...(typeof value['email'] === 'string' ? { email: value['email'] } : {}),
|
|
43
|
+
...(typeof value['accountId'] === 'string' ? { accountId: value['accountId'] } : {}),
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** The transport's api-key envelope: it reads these four fields and nothing else. */
|
|
47
|
+
export function antigravityCliEnvelope(grant) {
|
|
48
|
+
return JSON.stringify({
|
|
49
|
+
token: grant.access,
|
|
50
|
+
refreshToken: grant.refresh,
|
|
51
|
+
expiresAt: grant.expires,
|
|
52
|
+
...(grant.email === undefined ? {} : { email: grant.email }),
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
/** The record one refreshed grant becomes. */
|
|
56
|
+
function recordOf(grant) {
|
|
57
|
+
return {
|
|
58
|
+
kind: 'grant',
|
|
59
|
+
payload: {
|
|
60
|
+
access: grant.access,
|
|
61
|
+
refresh: grant.refresh,
|
|
62
|
+
expires: grant.expires,
|
|
63
|
+
...(grant.email === undefined ? {} : { email: grant.email }),
|
|
64
|
+
...(grant.accountId === undefined ? {} : { accountId: grant.accountId }),
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Build the route's credential resolver.
|
|
70
|
+
*
|
|
71
|
+
* @param credentials - the credentials seam this route reads and writes.
|
|
72
|
+
* @param refreshGrant - the CLI's refresh call, injected so this module stays
|
|
73
|
+
* free of the bundled artifact.
|
|
74
|
+
* @param options - clock seam.
|
|
75
|
+
* @returns a resolver that returns the transport's envelope, refreshing once
|
|
76
|
+
* under the record lock when the grant is near expiry.
|
|
77
|
+
*/
|
|
78
|
+
export function createAntigravityCliAccess(credentials, refreshGrant, options = {}) {
|
|
79
|
+
const now = options.now ?? Date.now;
|
|
80
|
+
const live = (grant) => grant.expires - SKEW_MS > now();
|
|
81
|
+
return async (signal) => {
|
|
82
|
+
const stored = readAntigravityCliGrant(await credentials.readRecord(ANTIGRAVITY_CLI_CREDENTIAL_KEY));
|
|
83
|
+
if (stored === undefined) {
|
|
84
|
+
throw LlmError.fromFailure({
|
|
85
|
+
message: `llm-omp-transports: no Antigravity sign-in is stored at ${ANTIGRAVITY_CLI_CREDENTIAL_KEY}; run the Antigravity authorization flow`,
|
|
86
|
+
code: 'MISSING_CREDENTIAL',
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
if (live(stored))
|
|
90
|
+
return antigravityCliEnvelope(stored);
|
|
91
|
+
const refreshed = await credentials.modifyRecord(ANTIGRAVITY_CLI_CREDENTIAL_KEY, async (current) => {
|
|
92
|
+
const currentGrant = readAntigravityCliGrant(current);
|
|
93
|
+
// Removed or replaced while this turn waited for the lock: leave it alone.
|
|
94
|
+
if (currentGrant === undefined)
|
|
95
|
+
return undefined;
|
|
96
|
+
if (live(currentGrant))
|
|
97
|
+
return current;
|
|
98
|
+
return recordOf(await refreshGrant(currentGrant, signal));
|
|
99
|
+
});
|
|
100
|
+
const next = readAntigravityCliGrant(refreshed);
|
|
101
|
+
if (next === undefined) {
|
|
102
|
+
throw LlmError.fromFailure({
|
|
103
|
+
message: `llm-omp-transports: the Antigravity sign-in at ${ANTIGRAVITY_CLI_CREDENTIAL_KEY} is gone or refused its refresh; sign in again`,
|
|
104
|
+
code: 'REAUTH_REQUIRED',
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return antigravityCliEnvelope(next);
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/antigravity/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAI/C,yDAAyD;AACzD,MAAM,CAAC,MAAM,8BAA8B,GAAG,oCAAoC,CAAA;AAiBlF,6EAA6E;AAC7E,MAAM,OAAO,GAAG,MAAM,CAAA;AAEtB;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAA0C;IAChF,IAAI,MAAM,EAAE,IAAI,KAAK,OAAO;QAAE,OAAO,SAAS,CAAA;IAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;IAC9B,IAAI,OAAO,OAAO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I,CAAC,MAAM,CAAC;YAAE,OAAO,sBAAsB,CAAC,MAAM,CAAC,CAAA;QAEvD,MAAM,SAAS,GAAG,MAAM,WAAW,CAAC,YAAY,CAAC,8BAA8B,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE;YAC/F,MAAM,YAAY,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAA;YACrD,2EAA2E;YAC3E,IAAI,YAAY,KAAK,SAAS;gBAAE,OAAO,SAAS,CAAA;YAChD,IAAI,IAAI,CAAC,YAAY,CAAC;gBAAE,OAAO,OAAO,CAAA;YACtC,OAAO,QAAQ,CAAC,MAAM,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC,CAAA;QAC3D,CAAC,CAAC,CAAA;QACF,MAAM,IAAI,GAAG,uBAAuB,CAAC,SAAS,CAAC,CAAA;QAC/C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,MAAM,QAAQ,CAAC,WAAW,CAAC;gBACzB,OAAO,EAAE,kDAAkD,8BAA8B,gDAAgD;gBACzI,IAAI,EAAE,iBAAiB;aACxB,CAAC,CAAA;QACJ,CAAC;QACD,OAAO,sBAAsB,CAAC,IAAI,CAAC,CAAA;IACrC,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated Antigravity CLI model table — do not edit by hand.
|
|
3
|
+
*
|
|
4
|
+
* Source: `@oh-my-pi/pi-catalog@18.20.3` `src/models.json` key `antigravity-cli`
|
|
5
|
+
* (7 rows, sha256:d183025c204d185d1a002fccfc2bd7afd39407c3b96062fa373e56947e1ccdaf). Regenerate with `pnpm -C packages/llm-omp run generate:catalog`.
|
|
6
|
+
*
|
|
7
|
+
* The drift gate in `tests/build-google.test.ts` pins the same package version
|
|
8
|
+
* and source hash, so an omp bump fails there before this table can describe
|
|
9
|
+
* the wrong models.
|
|
10
|
+
*
|
|
11
|
+
* These rows belong to the ACP route: the CLI decides the endpoint, so a row's
|
|
12
|
+
* `baseUrl` is not sent anywhere, and `id` is the ACP model id.
|
|
13
|
+
*
|
|
14
|
+
* @module dsh-llm-omp-transports/catalog/antigravity-cli
|
|
15
|
+
*/
|
|
16
|
+
import type { GoogleModelRow } from '../omp.js';
|
|
17
|
+
/** Provenance of {@link ANTIGRAVITY_CLI_MODELS}. */
|
|
18
|
+
export declare const ANTIGRAVITY_CLI_CATALOG_SOURCE: {
|
|
19
|
+
readonly package: "@oh-my-pi/pi-catalog";
|
|
20
|
+
readonly version: "18.20.3";
|
|
21
|
+
readonly file: "src/models.json";
|
|
22
|
+
readonly key: "antigravity-cli";
|
|
23
|
+
readonly sourceHash: "sha256:d183025c204d185d1a002fccfc2bd7afd39407c3b96062fa373e56947e1ccdaf";
|
|
24
|
+
readonly rowCount: 7;
|
|
25
|
+
};
|
|
26
|
+
/** Every Antigravity CLI model the pinned catalog serves, sorted by id. */
|
|
27
|
+
export declare const ANTIGRAVITY_CLI_MODELS: readonly GoogleModelRow[];
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/** Provenance of {@link ANTIGRAVITY_CLI_MODELS}. */
|
|
2
|
+
export const ANTIGRAVITY_CLI_CATALOG_SOURCE = {
|
|
3
|
+
package: '@oh-my-pi/pi-catalog',
|
|
4
|
+
version: '18.20.3',
|
|
5
|
+
file: 'src/models.json',
|
|
6
|
+
key: 'antigravity-cli',
|
|
7
|
+
sourceHash: 'sha256:d183025c204d185d1a002fccfc2bd7afd39407c3b96062fa373e56947e1ccdaf',
|
|
8
|
+
rowCount: 7,
|
|
9
|
+
};
|
|
10
|
+
/** Every Antigravity CLI model the pinned catalog serves, sorted by id. */
|
|
11
|
+
export const ANTIGRAVITY_CLI_MODELS = [
|
|
12
|
+
{
|
|
13
|
+
"id": "claude-opus-5-5",
|
|
14
|
+
"name": "Claude Opus 5.5",
|
|
15
|
+
"baseUrl": "https://antigravity.google",
|
|
16
|
+
"contextWindow": 1000000,
|
|
17
|
+
"maxTokens": 128000,
|
|
18
|
+
"input": [
|
|
19
|
+
"text",
|
|
20
|
+
"image"
|
|
21
|
+
],
|
|
22
|
+
"cost": {
|
|
23
|
+
"input": 0,
|
|
24
|
+
"output": 0,
|
|
25
|
+
"cacheRead": 0,
|
|
26
|
+
"cacheWrite": 0
|
|
27
|
+
},
|
|
28
|
+
"reasoning": true,
|
|
29
|
+
"identity": {
|
|
30
|
+
"class": "anthropic",
|
|
31
|
+
"family": "opus",
|
|
32
|
+
"revision": "5.5.0"
|
|
33
|
+
},
|
|
34
|
+
"compat": {},
|
|
35
|
+
"thinking": {
|
|
36
|
+
"mode": "effort",
|
|
37
|
+
"efforts": [
|
|
38
|
+
"low",
|
|
39
|
+
"medium",
|
|
40
|
+
"high"
|
|
41
|
+
],
|
|
42
|
+
"prefixBinding": true
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"id": "claude-sonnet-5-5",
|
|
47
|
+
"name": "Claude Sonnet 5.5",
|
|
48
|
+
"baseUrl": "https://antigravity.google",
|
|
49
|
+
"contextWindow": 1000000,
|
|
50
|
+
"maxTokens": 128000,
|
|
51
|
+
"input": [
|
|
52
|
+
"text",
|
|
53
|
+
"image"
|
|
54
|
+
],
|
|
55
|
+
"cost": {
|
|
56
|
+
"input": 0,
|
|
57
|
+
"output": 0,
|
|
58
|
+
"cacheRead": 0,
|
|
59
|
+
"cacheWrite": 0
|
|
60
|
+
},
|
|
61
|
+
"reasoning": true,
|
|
62
|
+
"identity": {
|
|
63
|
+
"class": "anthropic",
|
|
64
|
+
"family": "sonnet",
|
|
65
|
+
"revision": "5.5.0"
|
|
66
|
+
},
|
|
67
|
+
"compat": {},
|
|
68
|
+
"thinking": {
|
|
69
|
+
"mode": "effort",
|
|
70
|
+
"efforts": [
|
|
71
|
+
"low",
|
|
72
|
+
"medium",
|
|
73
|
+
"high"
|
|
74
|
+
],
|
|
75
|
+
"prefixBinding": true
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "gemini-3.8-flash",
|
|
80
|
+
"name": "Gemini 3.8 Flash",
|
|
81
|
+
"baseUrl": "https://antigravity.google",
|
|
82
|
+
"contextWindow": 1048576,
|
|
83
|
+
"maxTokens": 65536,
|
|
84
|
+
"input": [
|
|
85
|
+
"text",
|
|
86
|
+
"image"
|
|
87
|
+
],
|
|
88
|
+
"cost": {
|
|
89
|
+
"input": 0,
|
|
90
|
+
"output": 0,
|
|
91
|
+
"cacheRead": 0,
|
|
92
|
+
"cacheWrite": 0
|
|
93
|
+
},
|
|
94
|
+
"reasoning": true,
|
|
95
|
+
"identity": {
|
|
96
|
+
"class": "gemini",
|
|
97
|
+
"family": "flash",
|
|
98
|
+
"revision": "3.8.0"
|
|
99
|
+
},
|
|
100
|
+
"compat": {},
|
|
101
|
+
"thinking": {
|
|
102
|
+
"mode": "effort",
|
|
103
|
+
"efforts": [
|
|
104
|
+
"low",
|
|
105
|
+
"medium",
|
|
106
|
+
"high"
|
|
107
|
+
],
|
|
108
|
+
"requiresEffort": true
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"id": "gemini-4-argon",
|
|
113
|
+
"name": "Gemini 4 Argon",
|
|
114
|
+
"baseUrl": "https://antigravity.google",
|
|
115
|
+
"contextWindow": 1048576,
|
|
116
|
+
"maxTokens": 65536,
|
|
117
|
+
"input": [
|
|
118
|
+
"text",
|
|
119
|
+
"image"
|
|
120
|
+
],
|
|
121
|
+
"cost": {
|
|
122
|
+
"input": 0,
|
|
123
|
+
"output": 0,
|
|
124
|
+
"cacheRead": 0,
|
|
125
|
+
"cacheWrite": 0
|
|
126
|
+
},
|
|
127
|
+
"reasoning": true,
|
|
128
|
+
"identity": {
|
|
129
|
+
"class": "gemini",
|
|
130
|
+
"revision": "4.0.0"
|
|
131
|
+
},
|
|
132
|
+
"compat": {},
|
|
133
|
+
"thinking": {
|
|
134
|
+
"mode": "effort",
|
|
135
|
+
"efforts": [
|
|
136
|
+
"low",
|
|
137
|
+
"medium",
|
|
138
|
+
"high"
|
|
139
|
+
],
|
|
140
|
+
"requiresEffort": true
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"id": "gemini-4-carbon",
|
|
145
|
+
"name": "Gemini 4 Carbon",
|
|
146
|
+
"baseUrl": "https://antigravity.google",
|
|
147
|
+
"contextWindow": 1048576,
|
|
148
|
+
"maxTokens": 262144,
|
|
149
|
+
"input": [
|
|
150
|
+
"text",
|
|
151
|
+
"image"
|
|
152
|
+
],
|
|
153
|
+
"cost": {
|
|
154
|
+
"input": 0,
|
|
155
|
+
"output": 0,
|
|
156
|
+
"cacheRead": 0,
|
|
157
|
+
"cacheWrite": 0
|
|
158
|
+
},
|
|
159
|
+
"reasoning": true,
|
|
160
|
+
"identity": {
|
|
161
|
+
"class": "gemini",
|
|
162
|
+
"revision": "4.0.0"
|
|
163
|
+
},
|
|
164
|
+
"compat": {},
|
|
165
|
+
"thinking": {
|
|
166
|
+
"mode": "effort",
|
|
167
|
+
"efforts": [
|
|
168
|
+
"low",
|
|
169
|
+
"medium",
|
|
170
|
+
"high"
|
|
171
|
+
],
|
|
172
|
+
"requiresEffort": true
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"id": "gemini-4-hydrogen",
|
|
177
|
+
"name": "Gemini 4 Hydrogen",
|
|
178
|
+
"baseUrl": "https://antigravity.google",
|
|
179
|
+
"contextWindow": 1048576,
|
|
180
|
+
"maxTokens": 262144,
|
|
181
|
+
"input": [
|
|
182
|
+
"text",
|
|
183
|
+
"image"
|
|
184
|
+
],
|
|
185
|
+
"cost": {
|
|
186
|
+
"input": 0,
|
|
187
|
+
"output": 0,
|
|
188
|
+
"cacheRead": 0,
|
|
189
|
+
"cacheWrite": 0
|
|
190
|
+
},
|
|
191
|
+
"reasoning": true,
|
|
192
|
+
"identity": {
|
|
193
|
+
"class": "gemini",
|
|
194
|
+
"revision": "4.0.0"
|
|
195
|
+
},
|
|
196
|
+
"compat": {},
|
|
197
|
+
"thinking": {
|
|
198
|
+
"mode": "effort",
|
|
199
|
+
"efforts": [
|
|
200
|
+
"low",
|
|
201
|
+
"medium",
|
|
202
|
+
"high",
|
|
203
|
+
"xhigh"
|
|
204
|
+
],
|
|
205
|
+
"requiresEffort": true
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"id": "gpt-oss-120b-medium",
|
|
210
|
+
"name": "GPT-OSS 120B (Medium)",
|
|
211
|
+
"baseUrl": "https://antigravity.google",
|
|
212
|
+
"contextWindow": 131072,
|
|
213
|
+
"maxTokens": 32768,
|
|
214
|
+
"input": [
|
|
215
|
+
"text"
|
|
216
|
+
],
|
|
217
|
+
"cost": {
|
|
218
|
+
"input": 0,
|
|
219
|
+
"output": 0,
|
|
220
|
+
"cacheRead": 0,
|
|
221
|
+
"cacheWrite": 0
|
|
222
|
+
},
|
|
223
|
+
"reasoning": false,
|
|
224
|
+
"identity": {
|
|
225
|
+
"class": "gpt-oss",
|
|
226
|
+
"family": "120b"
|
|
227
|
+
},
|
|
228
|
+
"compat": {}
|
|
229
|
+
},
|
|
230
|
+
];
|
|
231
|
+
//# sourceMappingURL=antigravity-cli.js.map
|