dsh-llm-omp-transports 0.4.5 → 0.4.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 +25 -71
- package/lib/adapter.d.ts +12 -30
- package/lib/adapter.js +11 -58
- package/lib/adapter.js.map +1 -1
- package/lib/antigravity/credentials.d.ts +1 -1
- package/lib/devin/credentials.d.ts +1 -1
- package/lib/devin/discovery.d.ts +1 -1
- package/lib/factory-droid/credentials.d.ts +1 -1
- package/lib/factory-droid/credentials.js +2 -2
- package/lib/factory-droid/credentials.js.map +1 -1
- package/lib/gitlab/credentials.d.ts +1 -1
- package/lib/gitlab/credentials.js +1 -1
- package/lib/index.d.ts +28 -144
- package/lib/index.js +12 -113
- package/lib/index.js.map +1 -1
- package/lib/jwt.d.ts +1 -1
- package/lib/jwt.js +1 -1
- package/lib/omp.d.ts +7 -60
- package/lib/omp.js +4 -4
- package/lib/projection.d.ts +19 -91
- package/lib/projection.js +69 -237
- package/lib/projection.js.map +1 -1
- package/lib/transport/credentials.d.ts +28 -0
- package/lib/transport/credentials.js +14 -0
- package/lib/transport/credentials.js.map +1 -0
- package/package.json +1 -1
- package/lib/catalog/cursor.d.ts +0 -29
- package/lib/catalog/cursor.js +0 -7525
- package/lib/catalog/cursor.js.map +0 -1
- package/lib/cursor/auth.d.ts +0 -135
- package/lib/cursor/auth.js +0 -304
- package/lib/cursor/auth.js.map +0 -1
- package/lib/cursor/credentials.d.ts +0 -52
- package/lib/cursor/credentials.js +0 -117
- package/lib/cursor/credentials.js.map +0 -1
- package/lib/omp/cursor.mjs +0 -23734
package/README.md
CHANGED
|
@@ -11,43 +11,18 @@ and the plugin page lists both bundle components
|
|
|
11
11
|
|---|---|
|
|
12
12
|
| npm package | `dsh-llm-omp-transports` |
|
|
13
13
|
| Plugin id | `llm-omp-transports` |
|
|
14
|
-
| Routes | `
|
|
15
|
-
| Credential scope | `llm-omp-transports/<provider>` — one record per route (`
|
|
14
|
+
| Routes | `devin`, `antigravity-cli`, `factory-droid`, `gitlab-duo`, `gitlab-duo-agent` (the seam is provider-generic) |
|
|
15
|
+
| Credential scope | `llm-omp-transports/<provider>` — one record per route (`devin`, `antigravity-cli`, `factory-droid`, `gitlab-duo`, `gitlab-duo-agent`) |
|
|
16
16
|
| Runtime | Node 24 (the bundle imports Node builtins only) |
|
|
17
17
|
| License | MIT |
|
|
18
18
|
|
|
19
19
|
The plugin registers its own route on the DSH `llm` seam, so it depends on no
|
|
20
20
|
upstream DSH change. `@oh-my-pi/pi-ai` and `@oh-my-pi/pi-catalog` are used at
|
|
21
21
|
**build time only**: the build inlines the pinned omp transports into one ESM
|
|
22
|
-
artifact per route (`lib/omp/
|
|
22
|
+
artifact per route (`lib/omp/devin.mjs`), plus one shared
|
|
23
23
|
artifacts for Antigravity CLI (`lib/omp/antigravity-cli.mjs` / `antigravity-login.mjs`), and the published
|
|
24
24
|
package imports nothing from `@oh-my-pi/*` or `bun:*` at runtime.
|
|
25
25
|
|
|
26
|
-
## Cursor support status
|
|
27
|
-
|
|
28
|
-
- **Text streaming** — yes. Assistant text and usage are projected onto DSH's
|
|
29
|
-
`StreamChunk` stream.
|
|
30
|
-
- **Reasoning streaming** — yes, with the catalog's effort routing. The
|
|
31
|
-
selected effort becomes the routed wire model id; an effort the model does
|
|
32
|
-
not advertise is refused with `UNSUPPORTED_REASONING_EFFORT`.
|
|
33
|
-
- **Tool-call handoff** — yes, through DSH's tool loop. Cursor's server drives
|
|
34
|
-
execution over its exec channel, so the transport runs in external-executor
|
|
35
|
-
mode: an unhandled MCP call is emitted as an unresolved tool call and
|
|
36
|
-
answered with a handoff, DSH runs the tool, and the next request replays the
|
|
37
|
-
result from history. The adapter never executes a tool itself.
|
|
38
|
-
- **Sign-in and refresh** — yes. The package registers the
|
|
39
|
-
`llm-omp-transports/cursor` authorization flow (a browser login page plus a
|
|
40
|
-
poll, no loopback callback and no device code) and refreshes an expiring
|
|
41
|
-
grant under the credential store's per-key lock. The Keys Manager Web page's
|
|
42
|
-
**Transport accounts** section is the surface that starts the flow.
|
|
43
|
-
- **Models** — from the pinned catalog: the Cursor slice of
|
|
44
|
-
`@oh-my-pi/pi-catalog@18.18.8` (123 rows) is generated into
|
|
45
|
-
`src/catalog/cursor.ts` and served without a network call.
|
|
46
|
-
- **Route** — `cursor`, declared configurable so the Models page has a profile
|
|
47
|
-
entry for it.
|
|
48
|
-
- **Images** — not yet. The route advertises text-only input and refuses image
|
|
49
|
-
blocks with `CONTENT_UNSUPPORTED`; see [known limits](docs/known-limits.md).
|
|
50
|
-
|
|
51
26
|
## Devin support status
|
|
52
27
|
|
|
53
28
|
- **Text streaming** — yes. Assistant text and reasoning are projected onto
|
|
@@ -57,8 +32,7 @@ package imports nothing from `@oh-my-pi/*` or `bun:*` at runtime.
|
|
|
57
32
|
with `UNSUPPORTED_REASONING_EFFORT`.
|
|
58
33
|
- **Tool-call handoff** — yes, native to DSH's tool loop. The transport emits
|
|
59
34
|
the call, finishes the turn `toolUse`, and DSH executes it; the result is
|
|
60
|
-
replayed from history on the next request.
|
|
61
|
-
transport-resolved, so nothing is filtered from the handoff.
|
|
35
|
+
replayed from history on the next request.
|
|
62
36
|
- **Sign-in** — two methods. Either paste the callback: the pinned omp login is
|
|
63
37
|
a declarative `oauth-code` rule whose loopback listener is Bun-only, so this
|
|
64
38
|
package opens the authorize page and asks for the address the browser landed
|
|
@@ -74,7 +48,7 @@ package imports nothing from `@oh-my-pi/*` or `bun:*` at runtime.
|
|
|
74
48
|
rather than the previous account's rows.
|
|
75
49
|
- **Route** — `devin`, declared configurable so the Models page has a
|
|
76
50
|
`providers.devin` profile with an allow-list.
|
|
77
|
-
- **Images** — not yet
|
|
51
|
+
- **Images** — not yet: text-only input, image blocks refused
|
|
78
52
|
with `CONTENT_UNSUPPORTED`.
|
|
79
53
|
|
|
80
54
|
## Google / Antigravity support status
|
|
@@ -145,7 +119,7 @@ next turn replays the result through the goal transcript.
|
|
|
145
119
|
may import them: `tests/build.test.ts` checks that every static import of the
|
|
146
120
|
shipped artifact is a Node builtin.
|
|
147
121
|
- **Node 24 load.** The artifact is imported through a plain Node ESM loader
|
|
148
|
-
with no Bun global present, and must expose
|
|
122
|
+
with no Bun global present, and must expose its stream export. The Bun and
|
|
149
123
|
`@oh-my-pi/pi-utils` surface the bundled graph reaches is covered by the
|
|
150
124
|
shims in `scripts/omp-shim/`; a missing shim symbol or a new shim category
|
|
151
125
|
fails the build.
|
|
@@ -156,24 +130,17 @@ next turn replays the result through the goal transcript.
|
|
|
156
130
|
committed manifest is unchanged after a build, so an omp bump that changes
|
|
157
131
|
the contract shows up as a reviewable manifest diff before it can reach a
|
|
158
132
|
request.
|
|
159
|
-
- **Generated catalogs.** The model tables (`
|
|
133
|
+
- **Generated catalogs.** The model tables (`devin`,
|
|
160
134
|
`antigravity-cli`, `factory-droid`, `gitlab-duo`, `gitlab-duo-agent`) are
|
|
161
135
|
generated from the pinned catalog and are not hand-edited. An omp or catalog
|
|
162
136
|
bump requires `pnpm -C packages/llm-omp run generate:catalog`.
|
|
163
137
|
|
|
164
138
|
## Limits and risks
|
|
165
139
|
|
|
166
|
-
- **
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
terms-of-service (ToS) risk. If Cursor gates non-IDE clients (a `401`/`403`
|
|
171
|
-
on `Run` with a valid account), this transport stops until the product
|
|
172
|
-
decision recorded as stop condition **S4**.
|
|
173
|
-
- **Real endpoints unverified.** The login, poll, refresh and agent endpoint
|
|
174
|
-
shapes are ported from the pinned omp sources; this repository's tests replay
|
|
175
|
-
recorded fixtures and never call Cursor, so live behavior is unverified until
|
|
176
|
-
it is exercised against a real account.
|
|
140
|
+
- **Real endpoints unverified.** The login, refresh and agent endpoint shapes
|
|
141
|
+
are ported from the pinned omp sources; this repository's tests replay
|
|
142
|
+
recorded fixtures and never call the providers, so live behavior is
|
|
143
|
+
unverified until it is exercised against a real account.
|
|
177
144
|
- **In-process checkpoint cache.** Per-conversation checkpoints live in a
|
|
178
145
|
module-level, in-process LRU (128 conversations) inside the bundled omp
|
|
179
146
|
transport. Nothing is persisted: an evicted or lost checkpoint rebuilds from
|
|
@@ -181,39 +148,26 @@ next turn replays the result through the goal transcript.
|
|
|
181
148
|
multi-step tool turn must replay its history.
|
|
182
149
|
- **Image input is advertised as text-only.** Forwarding is future work; until
|
|
183
150
|
it lands the projection refuses non-text blocks instead of silently dropping
|
|
184
|
-
them.
|
|
151
|
+
them. Many pinned catalog rows claim image support but are
|
|
185
152
|
advertised text-only.
|
|
186
|
-
- **Tool handoff
|
|
187
|
-
|
|
188
|
-
Tool declarations travel as MCP definitions, and
|
|
189
|
-
but cannot be replayed (the active tool set is the
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
`
|
|
194
|
-
history replay keeps the advertised alias so the follow-up request stays
|
|
195
|
-
consistent. The seven `dsh_<native>` names are reserved: a DSH tool that
|
|
196
|
-
already carries one is refused with `TOOL_ALIAS_COLLISION`, which fails the
|
|
197
|
-
whole request and requires renaming the tool. Any other tool name travels
|
|
198
|
-
unchanged. Cursor-native exec frames (`read`, `shell`, `write`, `delete`,
|
|
199
|
-
`grep`, `ls`, `diagnostics`, streamed edits) are still answered by the
|
|
200
|
-
transport with `Tool not available` and are **not** executed by DSH (live
|
|
201
|
-
reachability unverified).
|
|
202
|
-
- **Advisory request knobs are ignored.** Cursor's agent protocol has no field
|
|
203
|
-
for an output cap, sampling temperature, stop sequences or an auxiliary-call
|
|
204
|
-
purpose; DSH's `maxTokens`, `temperature`, `stop` and `purpose` never reach
|
|
205
|
-
the wire, and Cursor applies the catalog output limit server-side.
|
|
153
|
+
- **Tool handoff runs in DSH's own loop.** A turn that needs a tool ends with
|
|
154
|
+
the tool call; DSH's loop executes it and the result is replayed on the
|
|
155
|
+
follow-up request. Tool declarations travel as MCP definitions, and
|
|
156
|
+
`toolHistory` is accepted but cannot be replayed (the active tool set is the
|
|
157
|
+
projection).
|
|
158
|
+
- **Advisory request knobs are ignored.** Each route forwards only the knobs
|
|
159
|
+
its wire carries; the rest of DSH's `maxTokens`/`temperature`/`stop`/
|
|
160
|
+
`purpose` never reaches the wire.
|
|
206
161
|
- **Unofficial Devin client.** The transport presents the released Devin CLI
|
|
207
162
|
identity (`ideName: "devin-cli"`, `ideType: "chisel"`, `ideVersion:
|
|
208
163
|
"3000.11.205"`) and a `connect-go` client header the omp sources copy from the
|
|
209
|
-
CLI.
|
|
210
|
-
|
|
211
|
-
identity.
|
|
164
|
+
CLI. A first live turn rejected with `401`/`403` stops the route until a
|
|
165
|
+
product decision, never a retry under another identity.
|
|
212
166
|
- **Attribution deviates on one call.** The Devin chat request must keep the
|
|
213
167
|
transport's own `connect-go` client header — the backend gates on it. The
|
|
214
168
|
header-less `GetUserJwt` handshake has no identity of its own, so the adapter
|
|
215
|
-
fills DSH's attribution `user-agent` only where a header is absent.
|
|
216
|
-
requests keep full attribution.
|
|
169
|
+
fills DSH's attribution `user-agent` only where a header is absent. Other
|
|
170
|
+
routes' requests keep full attribution.
|
|
217
171
|
- **Devin has no refresh.** The pinned rule declares `refresh "none"`, so the
|
|
218
172
|
record is a static bearer with a derived `expires` (JWT `exp` minus five
|
|
219
173
|
minutes, else one year). An expired or corrupt record is `REAUTH_REQUIRED`,
|
|
@@ -245,7 +199,7 @@ pnpm -C packages/llm-omp run generate:catalog
|
|
|
245
199
|
```
|
|
246
200
|
|
|
247
201
|
`build` bundles the pinned omp graphs from the `scripts/omp-entry*.ts` entries
|
|
248
|
-
into `lib/omp/*.mjs` (
|
|
202
|
+
into `lib/omp/*.mjs` (devin, antigravity-cli/login, factory-droid,
|
|
249
203
|
gitlab-duo/agent) and rewrites `scripts/omp-manifest.json`; run it before
|
|
250
204
|
`test` after a pin or shim change. CI runs the same sequence and then fails if
|
|
251
205
|
the committed manifest drifted.
|
package/lib/adapter.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adapter for the omp-owned routes this plugin serves.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* (
|
|
6
|
-
* `
|
|
4
|
+
* Each route shares one shape: the provider speaks its own agent protocol
|
|
5
|
+
* (Devin's Connect-framed `GetChatMessage`) through an omp build artifact in
|
|
6
|
+
* `lib/omp/*.mjs`. The
|
|
7
7
|
* transport is injected rather than imported so this module stays free of the
|
|
8
8
|
* bundled artifacts and tests can replay recorded event scripts. A
|
|
9
9
|
* {@link TransportRoute} carries what differs per route: the catalog, the
|
|
@@ -20,9 +20,7 @@ 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 {
|
|
24
|
-
/** The Cursor provider route this adapter owns. */
|
|
25
|
-
export declare const CURSOR_ROUTE = "cursor";
|
|
23
|
+
import type { DevinModelRow, FactoryDroidModelRow, GitLabDuoAgentModelRow, GitLabDuoModelRow, GoogleModelRow, OmpDevinModel, OmpDevinOptions, OmpFactoryDroidModel, OmpFactoryDroidOptions, OmpGitLabDuoAgentModel, OmpGitLabDuoModel, OmpGitLabDuoOptions, OmpGitLabDuoWorkflowOptions, OmpAntigravityCliModel, OmpAntigravityCliOptions } from './omp.js';
|
|
26
24
|
/** The Devin provider route this adapter owns. */
|
|
27
25
|
export declare const DEVIN_ROUTE = "devin";
|
|
28
26
|
/** The Antigravity ACP provider route this adapter owns. */
|
|
@@ -63,7 +61,7 @@ export interface ProjectedTransportRequest<Model, Options> {
|
|
|
63
61
|
/** What differs between the routes: identity, catalog, projection and credential record. */
|
|
64
62
|
export interface TransportRoute<Row extends TransportRow, Model, Options extends TransportOptions> {
|
|
65
63
|
/** Provider id; also the registered route set the projection's profile accepts. */
|
|
66
|
-
readonly id: '
|
|
64
|
+
readonly id: 'devin' | 'factory-droid' | 'gitlab-duo' | 'gitlab-duo-agent' | 'antigravity-cli';
|
|
67
65
|
/** Models-page / provider-info display name. */
|
|
68
66
|
readonly displayName: string;
|
|
69
67
|
/** The `ctx.credentials` record this route reads. */
|
|
@@ -74,16 +72,7 @@ export interface TransportRoute<Row extends TransportRow, Model, Options extends
|
|
|
74
72
|
readonly models: readonly Row[];
|
|
75
73
|
/** Project one DSH request onto this route's transport arguments. */
|
|
76
74
|
readonly project: (row: Row, options: GenerateOptions<string>) => ProjectedTransportRequest<Model, Options>;
|
|
77
|
-
/**
|
|
78
|
-
* The row's advertised reasoning efforts.
|
|
79
|
-
*
|
|
80
|
-
* Cursor's rows carry `thinking.efforts`; Devin's rows advertise none (a
|
|
81
|
-
* selected effort is refused by its projection), so the route may omit this.
|
|
82
|
-
*/
|
|
83
|
-
readonly efforts?: (row: Row) => readonly string[] | undefined;
|
|
84
75
|
}
|
|
85
|
-
/** The Cursor route's facts. */
|
|
86
|
-
export declare const CURSOR_TRANSPORT_ROUTE: TransportRoute<CursorModelRow, OmpCursorModel, OmpCursorOptions>;
|
|
87
76
|
/** The Devin route's facts. */
|
|
88
77
|
export declare const DEVIN_TRANSPORT_ROUTE: TransportRoute<DevinModelRow, OmpDevinModel, OmpDevinOptions>;
|
|
89
78
|
/**
|
|
@@ -139,8 +128,8 @@ export interface OmpAdapterOptions<Model, Options extends TransportOptions, Row
|
|
|
139
128
|
* Resolve the route's bearer token for one request.
|
|
140
129
|
*
|
|
141
130
|
* @remarks
|
|
142
|
-
* Asynchronous because it reads (and
|
|
143
|
-
*
|
|
131
|
+
* Asynchronous because it reads (and may refresh) the route's credential
|
|
132
|
+
* through the credentials seam. The request signal is forwarded
|
|
144
133
|
* so an aborted turn can abandon a refresh instead of writing it late. Tests
|
|
145
134
|
* inject a fake.
|
|
146
135
|
*/
|
|
@@ -166,7 +155,7 @@ export interface OmpAdapterOptions<Model, Options extends TransportOptions, Row
|
|
|
166
155
|
* `inferenceRegion`) with the grant, and the transport needs it as
|
|
167
156
|
* `options.oauthIdentity` to pick the EU host. The base class merges whatever
|
|
168
157
|
* this returns into the transport options, so a route that has no such data
|
|
169
|
-
* (
|
|
158
|
+
* (devin, google, gitlab) simply omits it — the ignored-field contract
|
|
170
159
|
* the design chose over a route-specific adapter subclass.
|
|
171
160
|
*/
|
|
172
161
|
identity?: () => Promise<Readonly<Record<string, unknown>> | undefined>;
|
|
@@ -192,8 +181,8 @@ interface OmpRouteAdapterConfig<Row extends TransportRow, Model, Options extends
|
|
|
192
181
|
* @remarks
|
|
193
182
|
* The per-turn order is fixed: refuse an already-aborted turn, resolve the row,
|
|
194
183
|
* project the request (refusals must not pay a credential read), read the
|
|
195
|
-
* credential, validate it, then stream.
|
|
196
|
-
* that read; Devin's resolver only reads.
|
|
184
|
+
* credential, validate it, then stream. A route's resolver may refresh the
|
|
185
|
+
* grant under that read; Devin's resolver only reads.
|
|
197
186
|
*/
|
|
198
187
|
declare abstract class OmpTransportAdapter<Row extends TransportRow, Model, Options extends TransportOptions> extends LlmAdapter {
|
|
199
188
|
private readonly config;
|
|
@@ -219,9 +208,8 @@ declare abstract class OmpTransportAdapter<Row extends TransportRow, Model, Opti
|
|
|
219
208
|
* The id is echoed back (`id: provider`) so a caller sees the route it named,
|
|
220
209
|
* but only for a route this adapter owns: a foreign id raises
|
|
221
210
|
* {@link UNKNOWN_PROVIDER} instead of answering another provider's id with
|
|
222
|
-
* this route's display name. That guard
|
|
223
|
-
*
|
|
224
|
-
* id); it applies to every route and is pinned in both directions.
|
|
211
|
+
* this route's display name. That guard applies to every route and is pinned
|
|
212
|
+
* in both directions.
|
|
225
213
|
*/
|
|
226
214
|
providerInfo(provider: string): LlmProviderInfo;
|
|
227
215
|
listModels(provider: string): Promise<readonly LlmModelInfo[]>;
|
|
@@ -233,12 +221,6 @@ declare abstract class OmpTransportAdapter<Row extends TransportRow, Model, Opti
|
|
|
233
221
|
/** Build the seam's exact-model metadata from one catalog row. */
|
|
234
222
|
private modelInfo;
|
|
235
223
|
}
|
|
236
|
-
/** The DSH llm adapter configuration for the Cursor route. */
|
|
237
|
-
export type OmpCursorAdapterConfig = OmpAdapterOptions<OmpCursorModel, OmpCursorOptions, CursorModelRow>;
|
|
238
|
-
/** The Cursor adapter: the bundled `streamCursor` over the generated Cursor catalog. */
|
|
239
|
-
export declare class OmpCursorAdapter extends OmpTransportAdapter<CursorModelRow, OmpCursorModel, OmpCursorOptions> {
|
|
240
|
-
constructor(options: OmpCursorAdapterConfig);
|
|
241
|
-
}
|
|
242
224
|
/** The DSH llm adapter configuration for the Devin route. */
|
|
243
225
|
export type OmpDevinAdapterConfig = OmpAdapterOptions<OmpDevinModel, OmpDevinOptions, DevinModelRow>;
|
|
244
226
|
/** The Devin adapter: the bundled `streamDevin` over the generated Devin catalog. */
|
package/lib/adapter.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Adapter for the omp-owned routes this plugin serves.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* (
|
|
6
|
-
* `
|
|
4
|
+
* Each route shares one shape: the provider speaks its own agent protocol
|
|
5
|
+
* (Devin's Connect-framed `GetChatMessage`) through an omp build artifact in
|
|
6
|
+
* `lib/omp/*.mjs`. The
|
|
7
7
|
* transport is injected rather than imported so this module stays free of the
|
|
8
8
|
* bundled artifacts and tests can replay recorded event scripts. A
|
|
9
9
|
* {@link TransportRoute} carries what differs per route: the catalog, the
|
|
@@ -17,17 +17,13 @@
|
|
|
17
17
|
* @module dsh-llm-omp-transports/adapter
|
|
18
18
|
*/
|
|
19
19
|
import { LlmAdapter, LlmError, ReasoningEffortId, assertUsableApiKey } from '@deepseek-ai/dsh-llm';
|
|
20
|
-
import { CURSOR_MODELS } from './catalog/cursor.js';
|
|
21
20
|
import { DEVIN_MODELS } from './catalog/devin.js';
|
|
22
21
|
import { FACTORY_DROID_MODELS } from './catalog/factory-droid.js';
|
|
23
22
|
import { GITLAB_DUO_MODELS } from './catalog/gitlab-duo.js';
|
|
24
23
|
import { GITLAB_DUO_AGENT_MODELS } from './catalog/gitlab-duo-agent.js';
|
|
25
24
|
import { ANTIGRAVITY_CLI_MODELS } from './catalog/antigravity-cli.js';
|
|
26
|
-
import { CURSOR_CREDENTIAL_KEY } from './cursor/credentials.js';
|
|
27
25
|
import { DEVIN_CREDENTIAL_KEY } from './devin/credentials.js';
|
|
28
|
-
import { ANTIGRAVITY_CLI_PROFILE,
|
|
29
|
-
/** The Cursor provider route this adapter owns. */
|
|
30
|
-
export const CURSOR_ROUTE = 'cursor';
|
|
26
|
+
import { ANTIGRAVITY_CLI_PROFILE, DEVIN_PROFILE, FACTORY_DROID_PROFILE, GITLAB_DUO_AGENT_PROFILE, GITLAB_DUO_PROFILE, abortedFinish, projectDevinRequest, projectEvents, projectFactoryDroidRequest, projectGitLabDuoAgentRequest, projectGitLabDuoRequest, projectAntigravityCliRequest, } from './projection.js';
|
|
31
27
|
/** The Devin provider route this adapter owns. */
|
|
32
28
|
export const DEVIN_ROUTE = 'devin';
|
|
33
29
|
/** The Antigravity ACP provider route this adapter owns. */
|
|
@@ -52,25 +48,6 @@ export const UNKNOWN_PROVIDER = 'UNKNOWN_PROVIDER';
|
|
|
52
48
|
* advertisable again.
|
|
53
49
|
*/
|
|
54
50
|
const INPUT_MODALITIES = ['text'];
|
|
55
|
-
/** Display names for the catalog's reasoning efforts. */
|
|
56
|
-
const EFFORT_NAMES = {
|
|
57
|
-
minimal: 'Minimal',
|
|
58
|
-
low: 'Low',
|
|
59
|
-
medium: 'Medium',
|
|
60
|
-
high: 'High',
|
|
61
|
-
xhigh: 'Extra high',
|
|
62
|
-
max: 'Max',
|
|
63
|
-
};
|
|
64
|
-
/** The Cursor route's facts. */
|
|
65
|
-
export const CURSOR_TRANSPORT_ROUTE = {
|
|
66
|
-
id: CURSOR_ROUTE,
|
|
67
|
-
displayName: 'Cursor',
|
|
68
|
-
credentialKey: CURSOR_CREDENTIAL_KEY,
|
|
69
|
-
profile: CURSOR_PROFILE,
|
|
70
|
-
models: CURSOR_MODELS,
|
|
71
|
-
project: projectRequest,
|
|
72
|
-
efforts: row => row.thinking?.efforts,
|
|
73
|
-
};
|
|
74
51
|
/** The Devin route's facts. */
|
|
75
52
|
export const DEVIN_TRANSPORT_ROUTE = {
|
|
76
53
|
id: DEVIN_ROUTE,
|
|
@@ -185,8 +162,8 @@ export const GITLAB_DUO_AGENT_TRANSPORT_ROUTE = {
|
|
|
185
162
|
* @remarks
|
|
186
163
|
* The per-turn order is fixed: refuse an already-aborted turn, resolve the row,
|
|
187
164
|
* project the request (refusals must not pay a credential read), read the
|
|
188
|
-
* credential, validate it, then stream.
|
|
189
|
-
* that read; Devin's resolver only reads.
|
|
165
|
+
* credential, validate it, then stream. A route's resolver may refresh the
|
|
166
|
+
* grant under that read; Devin's resolver only reads.
|
|
190
167
|
*/
|
|
191
168
|
class OmpTransportAdapter extends LlmAdapter {
|
|
192
169
|
config;
|
|
@@ -230,9 +207,8 @@ class OmpTransportAdapter extends LlmAdapter {
|
|
|
230
207
|
* The id is echoed back (`id: provider`) so a caller sees the route it named,
|
|
231
208
|
* but only for a route this adapter owns: a foreign id raises
|
|
232
209
|
* {@link UNKNOWN_PROVIDER} instead of answering another provider's id with
|
|
233
|
-
* this route's display name. That guard
|
|
234
|
-
*
|
|
235
|
-
* id); it applies to every route and is pinned in both directions.
|
|
210
|
+
* this route's display name. That guard applies to every route and is pinned
|
|
211
|
+
* in both directions.
|
|
236
212
|
*/
|
|
237
213
|
providerInfo(provider) {
|
|
238
214
|
this.assertRoute(provider);
|
|
@@ -269,8 +245,7 @@ class OmpTransportAdapter extends LlmAdapter {
|
|
|
269
245
|
async *call(options) {
|
|
270
246
|
// Read the live signal each time: it can abort while the credential is read.
|
|
271
247
|
const aborted = () => options.signal?.aborted === true;
|
|
272
|
-
// An already-cancelled turn must not pay a credential read
|
|
273
|
-
// refreshes, a CAS write) or open a stream.
|
|
248
|
+
// An already-cancelled turn must not pay a credential read or open a stream.
|
|
274
249
|
if (aborted()) {
|
|
275
250
|
yield abortedFinish();
|
|
276
251
|
return;
|
|
@@ -307,11 +282,10 @@ class OmpTransportAdapter extends LlmAdapter {
|
|
|
307
282
|
apiKey: accessKey,
|
|
308
283
|
...(extras === undefined ? {} : extras),
|
|
309
284
|
};
|
|
310
|
-
yield* projectEvents(this.config.transport(request.model, request.context, transportOptions),
|
|
285
|
+
yield* projectEvents(this.config.transport(request.model, request.context, transportOptions), this.config.route.profile, options.signal);
|
|
311
286
|
}
|
|
312
287
|
/** Build the seam's exact-model metadata from one catalog row. */
|
|
313
288
|
modelInfo(provider, row) {
|
|
314
|
-
const efforts = this.config.route.efforts?.(row) ?? [];
|
|
315
289
|
return {
|
|
316
290
|
provider,
|
|
317
291
|
id: row.id,
|
|
@@ -321,34 +295,13 @@ class OmpTransportAdapter extends LlmAdapter {
|
|
|
321
295
|
// absent `context` as "capacity not stated", which is the truth here.
|
|
322
296
|
...(row.contextWindow === undefined ? {} : { context: { contextWindow: row.contextWindow } }),
|
|
323
297
|
// No `defaultMaxTokens`. The seam materializes that number into
|
|
324
|
-
// `maxTokens` on every request that omits one;
|
|
325
|
-
// per-request output-cap field, and Devin's projection forwards an
|
|
298
|
+
// `maxTokens` on every request that omits one; Devin's projection forwards an
|
|
326
299
|
// explicit `maxTokens` but the transport already defaults to the row's
|
|
327
300
|
// `maxTokens`. Advertising a default would only promise a cap nothing
|
|
328
301
|
// enforces. Both catalogs apply their cap from the model object.
|
|
329
|
-
// Every effort list is advertised exactly as the catalog declares it. On
|
|
330
|
-
// a row with no `effortRouting` entry each advertised effort resolves to
|
|
331
|
-
// the same wire id — the row's own — so those selections are wire-level
|
|
332
|
-
// no-ops, exactly as in omp.
|
|
333
|
-
...(efforts.length > 0
|
|
334
|
-
? {
|
|
335
|
-
reasoning: {
|
|
336
|
-
efforts: efforts.map(effort => ({
|
|
337
|
-
id: ReasoningEffortId(effort),
|
|
338
|
-
name: EFFORT_NAMES[effort] ?? effort,
|
|
339
|
-
})),
|
|
340
|
-
},
|
|
341
|
-
}
|
|
342
|
-
: {}),
|
|
343
302
|
};
|
|
344
303
|
}
|
|
345
304
|
}
|
|
346
|
-
/** The Cursor adapter: the bundled `streamCursor` over the generated Cursor catalog. */
|
|
347
|
-
export class OmpCursorAdapter extends OmpTransportAdapter {
|
|
348
|
-
constructor(options) {
|
|
349
|
-
super({ route: CURSOR_TRANSPORT_ROUTE, ...options });
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
305
|
/** The Devin adapter: the bundled `streamDevin` over the generated Devin catalog. */
|
|
353
306
|
export class OmpDevinAdapter extends OmpTransportAdapter {
|
|
354
307
|
constructor(options) {
|
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,
|
|
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,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,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EACL,uBAAu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AAK,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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CredentialRecordsLike, StoredCredentialRecord } from '../
|
|
1
|
+
import type { CredentialRecordsLike, StoredCredentialRecord } from '../transport/credentials.js';
|
|
2
2
|
/** The credential record this route reads and writes. */
|
|
3
3
|
export declare const ANTIGRAVITY_CLI_CREDENTIAL_KEY = "llm-omp-transports/antigravity-cli";
|
|
4
4
|
/** The consumer grant agy exported: what the CLI refresh call consumes and returns. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CredentialRecordsLike, StoredCredentialRecord } from '../
|
|
1
|
+
import type { CredentialRecordsLike, StoredCredentialRecord } from '../transport/credentials.js';
|
|
2
2
|
/** The record this plugin owns: scope `<plugin name>`, id the provider route. */
|
|
3
3
|
export declare const DEVIN_CREDENTIAL_KEY = "llm-omp-transports/devin";
|
|
4
4
|
/** The payload this plugin writes into its grant record. */
|
package/lib/devin/discovery.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DevinModelRow, OmpDevinDiscoveredModel, OmpDevinDiscoveryOptions } from '../omp.js';
|
|
2
|
-
import type { CredentialRecordsLike } from '../
|
|
2
|
+
import type { CredentialRecordsLike } from '../transport/credentials.js';
|
|
3
3
|
/** The discovery half of the bundled artifact (also the tests' seam). */
|
|
4
4
|
export type DiscoverDevinModels = (options: OmpDevinDiscoveryOptions) => Promise<readonly OmpDevinDiscoveredModel[] | null>;
|
|
5
5
|
/** Test seams for {@link refreshDevinRows}; the plugin uses the real network and clock. */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { FACTORY_DROID_CREDENTIAL_KEY } from '../adapter.js';
|
|
2
|
-
import type { CredentialRecordsLike, StoredCredentialRecord } from '../
|
|
2
|
+
import type { CredentialRecordsLike, StoredCredentialRecord } from '../transport/credentials.js';
|
|
3
3
|
import type { FactoryDroidFetch, FactoryDroidIdentity } from './auth.js';
|
|
4
4
|
/** The record this plugin owns; re-exported from the adapter where the route names it. */
|
|
5
5
|
export { FACTORY_DROID_CREDENTIAL_KEY };
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* both halves — the flow writes the record, the adapter reads it through
|
|
8
8
|
* {@link createFactoryDroidAccess} and forwards the scope as `oauthIdentity`. The pinned rule *has* a refresh
|
|
9
9
|
* (`refresh { after-refresh hook="factory-droid-region" }`), so the resolver is
|
|
10
|
-
*
|
|
10
|
+
* refresh-capable rather than Devin-shaped: a fresh grant answers without touching
|
|
11
11
|
* the write path, an expiring one is renewed once under the store's per-key lock,
|
|
12
12
|
* and a failure is fail-loud (`REAUTH_REQUIRED` / `MISSING_CREDENTIAL`), never a
|
|
13
13
|
* silent retry with another identity.
|
|
@@ -19,7 +19,7 @@ import { FACTORY_DROID_CREDENTIAL_KEY } from '../adapter.js';
|
|
|
19
19
|
import { FACTORY_DROID_CLIENT_ID, FACTORY_DROID_TOKEN_URL, FactoryDroidAuthError, mapRefreshedToken, resolveFactoryDroidIdentity, } from './auth.js';
|
|
20
20
|
/** The record this plugin owns; re-exported from the adapter where the route names it. */
|
|
21
21
|
export { FACTORY_DROID_CREDENTIAL_KEY };
|
|
22
|
-
/** How early a grant is renewed: enough for one in-flight turn
|
|
22
|
+
/** How early a grant is renewed: enough for one in-flight turn to finish. */
|
|
23
23
|
const REFRESH_WINDOW_MS = 60_000;
|
|
24
24
|
/** The grant payload of one record, or undefined when it is not a usable grant. */
|
|
25
25
|
export function readFactoryDroidGrant(record) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/factory-droid/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAA;AAE5D,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,GAC5B,MAAM,WAAW,CAAA;AAGlB,0FAA0F;AAC1F,OAAO,EAAE,4BAA4B,EAAE,CAAA;AAEvC,
|
|
1
|
+
{"version":3,"file":"credentials.js","sourceRoot":"","sources":["../../src/factory-droid/credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAA;AAE5D,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,qBAAqB,EACrB,iBAAiB,EACjB,2BAA2B,GAC5B,MAAM,WAAW,CAAA;AAGlB,0FAA0F;AAC1F,OAAO,EAAE,4BAA4B,EAAE,CAAA;AAEvC,6EAA6E;AAC7E,MAAM,iBAAiB,GAAG,MAAM,CAAA;AAoBhC,mFAAmF;AACnF,MAAM,UAAU,qBAAqB,CACnC,MAA0C;IAE1C,IAAI,MAAM,EAAE,IAAI,KAAK,OAAO;QAAE,OAAO,SAAS,CAAA;I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;QACf,CAAC;QACD,MAAM,KAAK,CAAA;IACb,CAAC;AACH,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { GITLAB_DUO_AGENT_CREDENTIAL_KEY, GITLAB_DUO_CREDENTIAL_KEY } from '../adapter.js';
|
|
2
|
-
import type { CredentialRecordsLike, StoredCredentialRecord } from '../
|
|
2
|
+
import type { CredentialRecordsLike, StoredCredentialRecord } from '../transport/credentials.js';
|
|
3
3
|
import type { GitLabDuoAuthEnv, GitLabFetch } from './auth.js';
|
|
4
4
|
/** The records this plugin owns; re-exported from the adapter where the routes name them. */
|
|
5
5
|
export { GITLAB_DUO_AGENT_CREDENTIAL_KEY, GITLAB_DUO_CREDENTIAL_KEY };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* The record is a GitLab OAuth grant — `{ access, refresh, expires, email? }` —
|
|
5
5
|
* and this module owns both halves: the flow writes it, the adapter reads it
|
|
6
6
|
* through {@link createGitLabDuoAgentAccess}. The pinned rule *has* a refresh
|
|
7
|
-
* (`refresh.token.params { redirect_uri }`), so the resolver
|
|
7
|
+
* (`refresh.token.params { redirect_uri }`), so the resolver follows the grant seam:
|
|
8
8
|
* a fresh grant answers without touching the write path, an expiring one is
|
|
9
9
|
* renewed once under the store's per-key lock, and a failure is fail-loud
|
|
10
10
|
* (`REAUTH_REQUIRED` / `MISSING_CREDENTIAL`), never a silent retry.
|