@dsh-stack/provider-gemini-sub 0.0.0-stage → 0.1.0
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 +2 -2
- package/lib/index.d.ts +13 -0
- package/lib/index.js +81 -0
- package/package.json +43 -4
- package/stack.json +10 -0
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# provider-gemini-sub
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Registers the `gemini-sub` provider route (base URL, dialect, credential slots, advisory model fallback, and — where the provider publishes one — a live model-catalog endpoint) into the `providers` registry abstraction (`@dsh-stack/providers`), the same way `agent-preset-coding` registers a preset resource into `agents`.
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `gemini-sub` provider route: a concrete provider extension plugging into
|
|
3
|
+
* the `providers` registry abstraction (`@dsh-stack/providers`).
|
|
4
|
+
* @module provider-gemini-sub
|
|
5
|
+
*/
|
|
6
|
+
import type { Context } from "@deepseek-ai/cordis";
|
|
7
|
+
import type { ProviderRoute } from "@dsh-stack/providers";
|
|
8
|
+
/** The `gemini-sub` provider route. */
|
|
9
|
+
export declare const route: ProviderRoute;
|
|
10
|
+
export declare const name = "provider-gemini-sub";
|
|
11
|
+
export declare const inject: string[];
|
|
12
|
+
/** apply implementation. */
|
|
13
|
+
export declare function apply(ctx: Context): void;
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `gemini-sub` provider route: a concrete provider extension plugging into
|
|
3
|
+
* the `providers` registry abstraction (`@dsh-stack/providers`).
|
|
4
|
+
* @module provider-gemini-sub
|
|
5
|
+
*/
|
|
6
|
+
import { EFFORTS, GEMINI_CONTEXT, GEMINI_MAX_OUTPUT, TOKEN } from "@dsh-stack/providers";
|
|
7
|
+
/** The `gemini-sub` provider route. */
|
|
8
|
+
export const route = {
|
|
9
|
+
id: "gemini-sub",
|
|
10
|
+
// Not the subscription: this is Google's free Code Assist tier, the surface
|
|
11
|
+
// the Gemini CLI uses. The paid Antigravity seat on the same account is
|
|
12
|
+
// `antigravity-sub`, and the pay-as-you-go Google API is `gemini-api`, so
|
|
13
|
+
// all three are named for what they actually bill.
|
|
14
|
+
displayName: "Gemini Code Assist (Free tier)",
|
|
15
|
+
kind: "subscription",
|
|
16
|
+
authKind: "oauth",
|
|
17
|
+
dialect: "code-assist",
|
|
18
|
+
baseURL: "https://cloudcode-pa.googleapis.com/v1internal",
|
|
19
|
+
authSlots: [TOKEN("GEMINI_SUB_OAUTH_TOKEN")],
|
|
20
|
+
// loadCodeAssist answers 200 for an account whose generation quota is
|
|
21
|
+
// exhausted, so probing it reported this route healthy while every
|
|
22
|
+
// message came back 429. The smallest real generation is the only
|
|
23
|
+
// request that answers the question the light claims to answer.
|
|
24
|
+
probe: {
|
|
25
|
+
url: "https://cloudcode-pa.googleapis.com/v1internal:streamGenerateContent?alt=sse",
|
|
26
|
+
method: "POST",
|
|
27
|
+
// The same identity headers the code-assist dialect sends per request;
|
|
28
|
+
// Code Assist answers 500 rather than a status when they are absent.
|
|
29
|
+
headers: {
|
|
30
|
+
accept: "text/event-stream",
|
|
31
|
+
"x-goog-api-client": "gl-node",
|
|
32
|
+
"user-agent": "Antigravity/2.0.1 (Jetbrains; DARWIN_ARM64)",
|
|
33
|
+
},
|
|
34
|
+
body: JSON.stringify({
|
|
35
|
+
model: "gemini-3.6-flash",
|
|
36
|
+
project: "",
|
|
37
|
+
user_prompt_id: "00000000-0000-4000-8000-000000000000",
|
|
38
|
+
request: {
|
|
39
|
+
contents: [{ role: "user", parts: [{ text: "ping" }] }],
|
|
40
|
+
generationConfig: { maxOutputTokens: 1 },
|
|
41
|
+
session_id: "00000000-0000-4000-8000-000000000000",
|
|
42
|
+
},
|
|
43
|
+
}),
|
|
44
|
+
},
|
|
45
|
+
models: [
|
|
46
|
+
{
|
|
47
|
+
id: "gemini-3.6-flash",
|
|
48
|
+
name: "Gemini 3.6 Flash",
|
|
49
|
+
contextWindow: GEMINI_CONTEXT,
|
|
50
|
+
maxTokens: GEMINI_MAX_OUTPUT,
|
|
51
|
+
reasoning: EFFORTS,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: "gemini-3.5-flash",
|
|
55
|
+
name: "Gemini 3.5 Flash",
|
|
56
|
+
contextWindow: GEMINI_CONTEXT,
|
|
57
|
+
maxTokens: GEMINI_MAX_OUTPUT,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
id: "gemini-3.1-pro",
|
|
61
|
+
name: "Gemini 3.1 Pro",
|
|
62
|
+
contextWindow: GEMINI_CONTEXT,
|
|
63
|
+
maxTokens: GEMINI_MAX_OUTPUT,
|
|
64
|
+
reasoning: EFFORTS,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
id: "gemini-3-pro",
|
|
68
|
+
name: "Gemini 3 Pro",
|
|
69
|
+
contextWindow: GEMINI_CONTEXT,
|
|
70
|
+
maxTokens: GEMINI_MAX_OUTPUT,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
defaultMaxTokens: GEMINI_MAX_OUTPUT,
|
|
74
|
+
defaultContextWindow: GEMINI_CONTEXT,
|
|
75
|
+
};
|
|
76
|
+
export const name = "provider-gemini-sub";
|
|
77
|
+
export const inject = ["providers"];
|
|
78
|
+
/** apply implementation. */
|
|
79
|
+
export function apply(ctx) {
|
|
80
|
+
ctx.providers.register(route);
|
|
81
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-stack/provider-gemini-sub",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "gemini-sub provider-route extension for the Stack `providers` registry.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "lib/index.js",
|
|
8
|
+
"types": "lib/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./lib/index.d.ts",
|
|
12
|
+
"default": "./lib/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"lib",
|
|
17
|
+
"README.md",
|
|
18
|
+
"package.json",
|
|
19
|
+
"stack.json"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"stack": {
|
|
25
|
+
"kind": "plugin",
|
|
26
|
+
"id": "stack.ai.provider.gemini-sub"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc -p tsconfig.json",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
31
|
+
"verify": "node verify.mjs"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@dsh-stack/providers": "0.1.0"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"typescript": "^6.0.3",
|
|
38
|
+
"@dsh-stack/dialects": "0.1.0"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/marius-patrik/dsh-stack.git",
|
|
43
|
+
"directory": "plugins/provider-gemini-sub"
|
|
44
|
+
}
|
|
45
|
+
}
|
package/stack.json
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"id": "stack.ai.provider.gemini-sub",
|
|
3
|
+
"name": "@dsh-stack/provider-gemini-sub",
|
|
4
|
+
"version": "0.1.0",
|
|
5
|
+
"kind": "plugin",
|
|
6
|
+
"description": "gemini-sub provider-route extension for the Stack `providers` registry.",
|
|
7
|
+
"files": ["lib", "README.md", "package.json", "stack.json"],
|
|
8
|
+
"dependencies": ["stack.ai.providers"],
|
|
9
|
+
"optionalDependencies": []
|
|
10
|
+
}
|