opencode-antigravity-auth-mf 11.3.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/LICENSE +21 -0
- package/README.md +630 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/src/antigravity/oauth.d.ts +31 -0
- package/dist/src/antigravity/oauth.d.ts.map +1 -0
- package/dist/src/antigravity/oauth.js +168 -0
- package/dist/src/antigravity/oauth.js.map +1 -0
- package/dist/src/constants.d.ts +99 -0
- package/dist/src/constants.d.ts.map +1 -0
- package/dist/src/constants.js +135 -0
- package/dist/src/constants.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/cache.d.ts +3 -0
- package/dist/src/hooks/auto-update-checker/cache.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/cache.js +71 -0
- package/dist/src/hooks/auto-update-checker/cache.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/checker.d.ts +16 -0
- package/dist/src/hooks/auto-update-checker/checker.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/checker.js +237 -0
- package/dist/src/hooks/auto-update-checker/checker.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/constants.d.ts +9 -0
- package/dist/src/hooks/auto-update-checker/constants.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/constants.js +23 -0
- package/dist/src/hooks/auto-update-checker/constants.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/index.d.ts +34 -0
- package/dist/src/hooks/auto-update-checker/index.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/index.js +125 -0
- package/dist/src/hooks/auto-update-checker/index.js.map +1 -0
- package/dist/src/hooks/auto-update-checker/types.d.ts +25 -0
- package/dist/src/hooks/auto-update-checker/types.d.ts.map +1 -0
- package/dist/src/hooks/auto-update-checker/types.js +1 -0
- package/dist/src/hooks/auto-update-checker/types.js.map +1 -0
- package/dist/src/plugin/accounts.d.ts +86 -0
- package/dist/src/plugin/accounts.d.ts.map +1 -0
- package/dist/src/plugin/accounts.js +609 -0
- package/dist/src/plugin/accounts.js.map +1 -0
- package/dist/src/plugin/auth.d.ts +21 -0
- package/dist/src/plugin/auth.d.ts.map +1 -0
- package/dist/src/plugin/auth.js +46 -0
- package/dist/src/plugin/auth.js.map +1 -0
- package/dist/src/plugin/cache/index.d.ts +5 -0
- package/dist/src/plugin/cache/index.d.ts.map +1 -0
- package/dist/src/plugin/cache/index.js +5 -0
- package/dist/src/plugin/cache/index.js.map +1 -0
- package/dist/src/plugin/cache/signature-cache.d.ts +111 -0
- package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -0
- package/dist/src/plugin/cache/signature-cache.js +375 -0
- package/dist/src/plugin/cache/signature-cache.js.map +1 -0
- package/dist/src/plugin/cache.d.ts +44 -0
- package/dist/src/plugin/cache.d.ts.map +1 -0
- package/dist/src/plugin/cache.js +200 -0
- package/dist/src/plugin/cache.js.map +1 -0
- package/dist/src/plugin/cli.d.ts +19 -0
- package/dist/src/plugin/cli.d.ts.map +1 -0
- package/dist/src/plugin/cli.js +59 -0
- package/dist/src/plugin/cli.js.map +1 -0
- package/dist/src/plugin/config/index.d.ts +16 -0
- package/dist/src/plugin/config/index.d.ts.map +1 -0
- package/dist/src/plugin/config/index.js +16 -0
- package/dist/src/plugin/config/index.js.map +1 -0
- package/dist/src/plugin/config/loader.d.ts +37 -0
- package/dist/src/plugin/config/loader.d.ts.map +1 -0
- package/dist/src/plugin/config/loader.js +206 -0
- package/dist/src/plugin/config/loader.js.map +1 -0
- package/dist/src/plugin/config/schema.d.ts +411 -0
- package/dist/src/plugin/config/schema.d.ts.map +1 -0
- package/dist/src/plugin/config/schema.js +339 -0
- package/dist/src/plugin/config/schema.js.map +1 -0
- package/dist/src/plugin/core/streaming/index.d.ts +3 -0
- package/dist/src/plugin/core/streaming/index.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/index.js +3 -0
- package/dist/src/plugin/core/streaming/index.js.map +1 -0
- package/dist/src/plugin/core/streaming/transformer.d.ts +10 -0
- package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/transformer.js +255 -0
- package/dist/src/plugin/core/streaming/transformer.js.map +1 -0
- package/dist/src/plugin/core/streaming/types.d.ts +35 -0
- package/dist/src/plugin/core/streaming/types.d.ts.map +1 -0
- package/dist/src/plugin/core/streaming/types.js +1 -0
- package/dist/src/plugin/core/streaming/types.js.map +1 -0
- package/dist/src/plugin/debug.d.ts +68 -0
- package/dist/src/plugin/debug.d.ts.map +1 -0
- package/dist/src/plugin/debug.js +325 -0
- package/dist/src/plugin/debug.js.map +1 -0
- package/dist/src/plugin/errors.d.ts +28 -0
- package/dist/src/plugin/errors.d.ts.map +1 -0
- package/dist/src/plugin/errors.js +42 -0
- package/dist/src/plugin/errors.js.map +1 -0
- package/dist/src/plugin/image-saver.d.ts +25 -0
- package/dist/src/plugin/image-saver.d.ts.map +1 -0
- package/dist/src/plugin/image-saver.js +86 -0
- package/dist/src/plugin/image-saver.js.map +1 -0
- package/dist/src/plugin/logger.d.ts +54 -0
- package/dist/src/plugin/logger.d.ts.map +1 -0
- package/dist/src/plugin/logger.js +120 -0
- package/dist/src/plugin/logger.js.map +1 -0
- package/dist/src/plugin/project.d.ts +33 -0
- package/dist/src/plugin/project.d.ts.map +1 -0
- package/dist/src/plugin/project.js +234 -0
- package/dist/src/plugin/project.js.map +1 -0
- package/dist/src/plugin/recovery/constants.d.ts +22 -0
- package/dist/src/plugin/recovery/constants.d.ts.map +1 -0
- package/dist/src/plugin/recovery/constants.js +43 -0
- package/dist/src/plugin/recovery/constants.js.map +1 -0
- package/dist/src/plugin/recovery/index.d.ts +12 -0
- package/dist/src/plugin/recovery/index.d.ts.map +1 -0
- package/dist/src/plugin/recovery/index.js +12 -0
- package/dist/src/plugin/recovery/index.js.map +1 -0
- package/dist/src/plugin/recovery/storage.d.ts +24 -0
- package/dist/src/plugin/recovery/storage.d.ts.map +1 -0
- package/dist/src/plugin/recovery/storage.js +354 -0
- package/dist/src/plugin/recovery/storage.js.map +1 -0
- package/dist/src/plugin/recovery/types.d.ts +116 -0
- package/dist/src/plugin/recovery/types.d.ts.map +1 -0
- package/dist/src/plugin/recovery/types.js +6 -0
- package/dist/src/plugin/recovery/types.js.map +1 -0
- package/dist/src/plugin/recovery.d.ts +61 -0
- package/dist/src/plugin/recovery.d.ts.map +1 -0
- package/dist/src/plugin/recovery.js +376 -0
- package/dist/src/plugin/recovery.js.map +1 -0
- package/dist/src/plugin/refresh-queue.d.ts +101 -0
- package/dist/src/plugin/refresh-queue.d.ts.map +1 -0
- package/dist/src/plugin/refresh-queue.js +244 -0
- package/dist/src/plugin/refresh-queue.js.map +1 -0
- package/dist/src/plugin/request-helpers.d.ts +278 -0
- package/dist/src/plugin/request-helpers.d.ts.map +1 -0
- package/dist/src/plugin/request-helpers.js +2268 -0
- package/dist/src/plugin/request-helpers.js.map +1 -0
- package/dist/src/plugin/request.d.ts +91 -0
- package/dist/src/plugin/request.d.ts.map +1 -0
- package/dist/src/plugin/request.js +1302 -0
- package/dist/src/plugin/request.js.map +1 -0
- package/dist/src/plugin/rotation.d.ts +168 -0
- package/dist/src/plugin/rotation.d.ts.map +1 -0
- package/dist/src/plugin/rotation.js +302 -0
- package/dist/src/plugin/rotation.js.map +1 -0
- package/dist/src/plugin/server.d.ts +23 -0
- package/dist/src/plugin/server.d.ts.map +1 -0
- package/dist/src/plugin/server.js +324 -0
- package/dist/src/plugin/server.js.map +1 -0
- package/dist/src/plugin/storage.d.ts +92 -0
- package/dist/src/plugin/storage.d.ts.map +1 -0
- package/dist/src/plugin/storage.js +417 -0
- package/dist/src/plugin/storage.js.map +1 -0
- package/dist/src/plugin/stores/signature-store.d.ts +5 -0
- package/dist/src/plugin/stores/signature-store.d.ts.map +1 -0
- package/dist/src/plugin/stores/signature-store.js +25 -0
- package/dist/src/plugin/stores/signature-store.js.map +1 -0
- package/dist/src/plugin/thinking-recovery.d.ts +90 -0
- package/dist/src/plugin/thinking-recovery.d.ts.map +1 -0
- package/dist/src/plugin/thinking-recovery.js +316 -0
- package/dist/src/plugin/thinking-recovery.js.map +1 -0
- package/dist/src/plugin/token.d.ts +19 -0
- package/dist/src/plugin/token.d.ts.map +1 -0
- package/dist/src/plugin/token.js +128 -0
- package/dist/src/plugin/token.js.map +1 -0
- package/dist/src/plugin/transform/claude.d.ts +80 -0
- package/dist/src/plugin/transform/claude.d.ts.map +1 -0
- package/dist/src/plugin/transform/claude.js +265 -0
- package/dist/src/plugin/transform/claude.js.map +1 -0
- package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +35 -0
- package/dist/src/plugin/transform/cross-model-sanitizer.d.ts.map +1 -0
- package/dist/src/plugin/transform/cross-model-sanitizer.js +225 -0
- package/dist/src/plugin/transform/cross-model-sanitizer.js.map +1 -0
- package/dist/src/plugin/transform/gemini.d.ts +112 -0
- package/dist/src/plugin/transform/gemini.d.ts.map +1 -0
- package/dist/src/plugin/transform/gemini.js +409 -0
- package/dist/src/plugin/transform/gemini.js.map +1 -0
- package/dist/src/plugin/transform/index.d.ts +15 -0
- package/dist/src/plugin/transform/index.d.ts.map +1 -0
- package/dist/src/plugin/transform/index.js +14 -0
- package/dist/src/plugin/transform/index.js.map +1 -0
- package/dist/src/plugin/transform/model-resolver.d.ts +101 -0
- package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -0
- package/dist/src/plugin/transform/model-resolver.js +356 -0
- package/dist/src/plugin/transform/model-resolver.js.map +1 -0
- package/dist/src/plugin/transform/types.d.ts +106 -0
- package/dist/src/plugin/transform/types.d.ts.map +1 -0
- package/dist/src/plugin/transform/types.js +1 -0
- package/dist/src/plugin/transform/types.js.map +1 -0
- package/dist/src/plugin/types.d.ts +96 -0
- package/dist/src/plugin/types.d.ts.map +1 -0
- package/dist/src/plugin/types.js +1 -0
- package/dist/src/plugin/types.js.map +1 -0
- package/dist/src/plugin/usage-reporter.d.ts +23 -0
- package/dist/src/plugin/usage-reporter.d.ts.map +1 -0
- package/dist/src/plugin/usage-reporter.js +43 -0
- package/dist/src/plugin/usage-reporter.js.map +1 -0
- package/dist/src/plugin.d.ts +8 -0
- package/dist/src/plugin.d.ts.map +1 -0
- package/dist/src/plugin.js +1708 -0
- package/dist/src/plugin.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration schema for opencode-antigravity-auth plugin.
|
|
3
|
+
*
|
|
4
|
+
* Config file locations (in priority order, highest wins):
|
|
5
|
+
* - Project: .opencode/antigravity.json
|
|
6
|
+
* - User: ~/.config/opencode/antigravity.json (Linux/Mac)
|
|
7
|
+
* %APPDATA%\opencode\antigravity.json (Windows)
|
|
8
|
+
*
|
|
9
|
+
* Environment variables always override config file values.
|
|
10
|
+
*/
|
|
11
|
+
import { z } from "zod";
|
|
12
|
+
/**
|
|
13
|
+
* Account selection strategy for distributing requests across accounts.
|
|
14
|
+
*
|
|
15
|
+
* - `sticky`: Use same account until rate-limited. Preserves prompt cache.
|
|
16
|
+
* - `round-robin`: Rotate to next account on every request. Maximum throughput.
|
|
17
|
+
* - `hybrid` (default): Deterministic selection based on health score + token bucket + LRU freshness.
|
|
18
|
+
*/
|
|
19
|
+
export declare const AccountSelectionStrategySchema: z.ZodEnum<["sticky", "round-robin", "hybrid"]>;
|
|
20
|
+
export type AccountSelectionStrategy = z.infer<typeof AccountSelectionStrategySchema>;
|
|
21
|
+
/**
|
|
22
|
+
* Signature cache configuration for persisting thinking block signatures to disk.
|
|
23
|
+
*/
|
|
24
|
+
export declare const SignatureCacheConfigSchema: z.ZodObject<{
|
|
25
|
+
/** Enable disk caching of signatures (default: true) */
|
|
26
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
27
|
+
/** In-memory TTL in seconds (default: 3600 = 1 hour) */
|
|
28
|
+
memory_ttl_seconds: z.ZodDefault<z.ZodNumber>;
|
|
29
|
+
/** Disk TTL in seconds (default: 172800 = 48 hours) */
|
|
30
|
+
disk_ttl_seconds: z.ZodDefault<z.ZodNumber>;
|
|
31
|
+
/** Background write interval in seconds (default: 60) */
|
|
32
|
+
write_interval_seconds: z.ZodDefault<z.ZodNumber>;
|
|
33
|
+
}, "strip", z.ZodTypeAny, {
|
|
34
|
+
enabled: boolean;
|
|
35
|
+
memory_ttl_seconds: number;
|
|
36
|
+
disk_ttl_seconds: number;
|
|
37
|
+
write_interval_seconds: number;
|
|
38
|
+
}, {
|
|
39
|
+
enabled?: boolean | undefined;
|
|
40
|
+
memory_ttl_seconds?: number | undefined;
|
|
41
|
+
disk_ttl_seconds?: number | undefined;
|
|
42
|
+
write_interval_seconds?: number | undefined;
|
|
43
|
+
}>;
|
|
44
|
+
/**
|
|
45
|
+
* Main configuration schema for the Antigravity OAuth plugin.
|
|
46
|
+
*/
|
|
47
|
+
export declare const AntigravityConfigSchema: z.ZodObject<{
|
|
48
|
+
/** JSON Schema reference for IDE support */
|
|
49
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
50
|
+
/**
|
|
51
|
+
* Suppress most toast notifications (rate limit, account switching, etc.)
|
|
52
|
+
* Recovery toasts are always shown regardless of this setting.
|
|
53
|
+
* Env override: OPENCODE_ANTIGRAVITY_QUIET=1
|
|
54
|
+
* @default false
|
|
55
|
+
*/
|
|
56
|
+
quiet_mode: z.ZodDefault<z.ZodBoolean>;
|
|
57
|
+
/**
|
|
58
|
+
* Enable debug logging to file.
|
|
59
|
+
* Env override: OPENCODE_ANTIGRAVITY_DEBUG=1
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
debug: z.ZodDefault<z.ZodBoolean>;
|
|
63
|
+
/**
|
|
64
|
+
* Custom directory for debug logs.
|
|
65
|
+
* Env override: OPENCODE_ANTIGRAVITY_LOG_DIR=/path/to/logs
|
|
66
|
+
* @default OS-specific config dir + "/antigravity-logs"
|
|
67
|
+
*/
|
|
68
|
+
log_dir: z.ZodOptional<z.ZodString>;
|
|
69
|
+
/**
|
|
70
|
+
* Preserve thinking blocks for Claude models using signature caching.
|
|
71
|
+
*
|
|
72
|
+
* When false (default): Thinking blocks are stripped for reliability.
|
|
73
|
+
* When true: Full context preserved, but may encounter signature errors.
|
|
74
|
+
*
|
|
75
|
+
* Env override: OPENCODE_ANTIGRAVITY_KEEP_THINKING=1
|
|
76
|
+
* @default false
|
|
77
|
+
*/
|
|
78
|
+
keep_thinking: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
/**
|
|
80
|
+
* Enable automatic session recovery from tool_result_missing errors.
|
|
81
|
+
* When enabled, shows a toast notification when recoverable errors occur.
|
|
82
|
+
*
|
|
83
|
+
* @default true
|
|
84
|
+
*/
|
|
85
|
+
session_recovery: z.ZodDefault<z.ZodBoolean>;
|
|
86
|
+
/**
|
|
87
|
+
* Automatically send a "continue" prompt after successful recovery.
|
|
88
|
+
* Only applies when session_recovery is enabled.
|
|
89
|
+
*
|
|
90
|
+
* When false: Only shows toast notification, user must manually continue.
|
|
91
|
+
* When true: Automatically sends "continue" to resume the session.
|
|
92
|
+
*
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
auto_resume: z.ZodDefault<z.ZodBoolean>;
|
|
96
|
+
/**
|
|
97
|
+
* Custom text to send when auto-resuming after recovery.
|
|
98
|
+
* Only used when auto_resume is enabled.
|
|
99
|
+
*
|
|
100
|
+
* @default "continue"
|
|
101
|
+
*/
|
|
102
|
+
resume_text: z.ZodDefault<z.ZodString>;
|
|
103
|
+
/**
|
|
104
|
+
* Signature cache configuration for persisting thinking block signatures.
|
|
105
|
+
* Only used when keep_thinking is enabled.
|
|
106
|
+
*/
|
|
107
|
+
signature_cache: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
/** Enable disk caching of signatures (default: true) */
|
|
109
|
+
enabled: z.ZodDefault<z.ZodBoolean>;
|
|
110
|
+
/** In-memory TTL in seconds (default: 3600 = 1 hour) */
|
|
111
|
+
memory_ttl_seconds: z.ZodDefault<z.ZodNumber>;
|
|
112
|
+
/** Disk TTL in seconds (default: 172800 = 48 hours) */
|
|
113
|
+
disk_ttl_seconds: z.ZodDefault<z.ZodNumber>;
|
|
114
|
+
/** Background write interval in seconds (default: 60) */
|
|
115
|
+
write_interval_seconds: z.ZodDefault<z.ZodNumber>;
|
|
116
|
+
}, "strip", z.ZodTypeAny, {
|
|
117
|
+
enabled: boolean;
|
|
118
|
+
memory_ttl_seconds: number;
|
|
119
|
+
disk_ttl_seconds: number;
|
|
120
|
+
write_interval_seconds: number;
|
|
121
|
+
}, {
|
|
122
|
+
enabled?: boolean | undefined;
|
|
123
|
+
memory_ttl_seconds?: number | undefined;
|
|
124
|
+
disk_ttl_seconds?: number | undefined;
|
|
125
|
+
write_interval_seconds?: number | undefined;
|
|
126
|
+
}>>;
|
|
127
|
+
/**
|
|
128
|
+
* Maximum retry attempts when Antigravity returns an empty response.
|
|
129
|
+
* Empty responses occur when no candidates/choices are returned.
|
|
130
|
+
*
|
|
131
|
+
* @default 4
|
|
132
|
+
*/
|
|
133
|
+
empty_response_max_attempts: z.ZodDefault<z.ZodNumber>;
|
|
134
|
+
/**
|
|
135
|
+
* Delay in milliseconds between empty response retries.
|
|
136
|
+
*
|
|
137
|
+
* @default 2000
|
|
138
|
+
*/
|
|
139
|
+
empty_response_retry_delay_ms: z.ZodDefault<z.ZodNumber>;
|
|
140
|
+
/**
|
|
141
|
+
* Enable tool ID orphan recovery.
|
|
142
|
+
* When tool responses have mismatched IDs (due to context compaction),
|
|
143
|
+
* attempt to match them by function name or create placeholders.
|
|
144
|
+
*
|
|
145
|
+
* @default true
|
|
146
|
+
*/
|
|
147
|
+
tool_id_recovery: z.ZodDefault<z.ZodBoolean>;
|
|
148
|
+
/**
|
|
149
|
+
* Enable tool hallucination prevention for Claude models.
|
|
150
|
+
* When enabled, injects:
|
|
151
|
+
* - Parameter signatures into tool descriptions
|
|
152
|
+
* - System instruction with strict tool usage rules
|
|
153
|
+
*
|
|
154
|
+
* This helps prevent Claude from using parameter names from its training
|
|
155
|
+
* data instead of the actual schema.
|
|
156
|
+
*
|
|
157
|
+
* @default true
|
|
158
|
+
*/
|
|
159
|
+
claude_tool_hardening: z.ZodDefault<z.ZodBoolean>;
|
|
160
|
+
/**
|
|
161
|
+
* Enable proactive background token refresh.
|
|
162
|
+
* When enabled, tokens are refreshed in the background before they expire,
|
|
163
|
+
* ensuring requests never block on token refresh.
|
|
164
|
+
*
|
|
165
|
+
* @default true
|
|
166
|
+
*/
|
|
167
|
+
proactive_token_refresh: z.ZodDefault<z.ZodBoolean>;
|
|
168
|
+
/**
|
|
169
|
+
* Seconds before token expiry to trigger proactive refresh.
|
|
170
|
+
* Default is 30 minutes (1800 seconds).
|
|
171
|
+
*
|
|
172
|
+
* @default 1800
|
|
173
|
+
*/
|
|
174
|
+
proactive_refresh_buffer_seconds: z.ZodDefault<z.ZodNumber>;
|
|
175
|
+
/**
|
|
176
|
+
* Interval between proactive refresh checks in seconds.
|
|
177
|
+
* Default is 5 minutes (300 seconds).
|
|
178
|
+
*
|
|
179
|
+
* @default 300
|
|
180
|
+
*/
|
|
181
|
+
proactive_refresh_check_interval_seconds: z.ZodDefault<z.ZodNumber>;
|
|
182
|
+
/**
|
|
183
|
+
* Maximum time in seconds to wait when all accounts are rate-limited.
|
|
184
|
+
* If the minimum wait time across all accounts exceeds this threshold,
|
|
185
|
+
* the plugin fails fast with an error instead of hanging.
|
|
186
|
+
*
|
|
187
|
+
* Set to 0 to disable (wait indefinitely).
|
|
188
|
+
*
|
|
189
|
+
* @default 300 (5 minutes)
|
|
190
|
+
*/
|
|
191
|
+
max_rate_limit_wait_seconds: z.ZodDefault<z.ZodNumber>;
|
|
192
|
+
/**
|
|
193
|
+
* Enable quota fallback for Gemini models.
|
|
194
|
+
* When the preferred quota (gemini-cli or antigravity) is exhausted,
|
|
195
|
+
* try the alternate quota on the same account before switching accounts.
|
|
196
|
+
*
|
|
197
|
+
* Only applies when model is requested without explicit quota suffix.
|
|
198
|
+
* Explicit suffixes like `:antigravity` or `:gemini-cli` always use
|
|
199
|
+
* that specific quota and switch accounts if exhausted.
|
|
200
|
+
*
|
|
201
|
+
* @default false
|
|
202
|
+
*/
|
|
203
|
+
quota_fallback: z.ZodDefault<z.ZodBoolean>;
|
|
204
|
+
/**
|
|
205
|
+
* Strategy for selecting accounts when making requests.
|
|
206
|
+
* Env override: OPENCODE_ANTIGRAVITY_ACCOUNT_SELECTION_STRATEGY
|
|
207
|
+
* @default "hybrid"
|
|
208
|
+
*/
|
|
209
|
+
account_selection_strategy: z.ZodDefault<z.ZodEnum<["sticky", "round-robin", "hybrid"]>>;
|
|
210
|
+
/**
|
|
211
|
+
* Enable PID-based account offset for multi-session distribution.
|
|
212
|
+
*
|
|
213
|
+
* When enabled, different sessions (PIDs) will prefer different starting
|
|
214
|
+
* accounts, which helps distribute load when running multiple parallel agents.
|
|
215
|
+
*
|
|
216
|
+
* When disabled (default), accounts start from the same index, which preserves
|
|
217
|
+
* Anthropic's prompt cache across restarts (recommended for single-session use).
|
|
218
|
+
*
|
|
219
|
+
* Env override: OPENCODE_ANTIGRAVITY_PID_OFFSET_ENABLED=1
|
|
220
|
+
* @default false
|
|
221
|
+
*/
|
|
222
|
+
pid_offset_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
223
|
+
/**
|
|
224
|
+
* Switch to another account immediately on first rate limit (after 1s delay).
|
|
225
|
+
* When disabled, retries same account first, then switches on second rate limit.
|
|
226
|
+
*
|
|
227
|
+
* @default true
|
|
228
|
+
*/
|
|
229
|
+
switch_on_first_rate_limit: z.ZodDefault<z.ZodBoolean>;
|
|
230
|
+
health_score: z.ZodOptional<z.ZodObject<{
|
|
231
|
+
initial: z.ZodDefault<z.ZodNumber>;
|
|
232
|
+
success_reward: z.ZodDefault<z.ZodNumber>;
|
|
233
|
+
rate_limit_penalty: z.ZodDefault<z.ZodNumber>;
|
|
234
|
+
failure_penalty: z.ZodDefault<z.ZodNumber>;
|
|
235
|
+
recovery_rate_per_hour: z.ZodDefault<z.ZodNumber>;
|
|
236
|
+
min_usable: z.ZodDefault<z.ZodNumber>;
|
|
237
|
+
max_score: z.ZodDefault<z.ZodNumber>;
|
|
238
|
+
}, "strip", z.ZodTypeAny, {
|
|
239
|
+
initial: number;
|
|
240
|
+
success_reward: number;
|
|
241
|
+
rate_limit_penalty: number;
|
|
242
|
+
failure_penalty: number;
|
|
243
|
+
recovery_rate_per_hour: number;
|
|
244
|
+
min_usable: number;
|
|
245
|
+
max_score: number;
|
|
246
|
+
}, {
|
|
247
|
+
initial?: number | undefined;
|
|
248
|
+
success_reward?: number | undefined;
|
|
249
|
+
rate_limit_penalty?: number | undefined;
|
|
250
|
+
failure_penalty?: number | undefined;
|
|
251
|
+
recovery_rate_per_hour?: number | undefined;
|
|
252
|
+
min_usable?: number | undefined;
|
|
253
|
+
max_score?: number | undefined;
|
|
254
|
+
}>>;
|
|
255
|
+
token_bucket: z.ZodOptional<z.ZodObject<{
|
|
256
|
+
max_tokens: z.ZodDefault<z.ZodNumber>;
|
|
257
|
+
regeneration_rate_per_minute: z.ZodDefault<z.ZodNumber>;
|
|
258
|
+
initial_tokens: z.ZodDefault<z.ZodNumber>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
max_tokens: number;
|
|
261
|
+
regeneration_rate_per_minute: number;
|
|
262
|
+
initial_tokens: number;
|
|
263
|
+
}, {
|
|
264
|
+
max_tokens?: number | undefined;
|
|
265
|
+
regeneration_rate_per_minute?: number | undefined;
|
|
266
|
+
initial_tokens?: number | undefined;
|
|
267
|
+
}>>;
|
|
268
|
+
/**
|
|
269
|
+
* Enable automatic plugin updates.
|
|
270
|
+
* @default true
|
|
271
|
+
*/
|
|
272
|
+
auto_update: z.ZodDefault<z.ZodBoolean>;
|
|
273
|
+
web_search: z.ZodOptional<z.ZodObject<{
|
|
274
|
+
/**
|
|
275
|
+
* Default mode for web search when not specified by variant.
|
|
276
|
+
* - `auto`: Model decides when to search (dynamic retrieval).
|
|
277
|
+
* - `off`: Search is disabled by default.
|
|
278
|
+
* @default "off"
|
|
279
|
+
*/
|
|
280
|
+
default_mode: z.ZodDefault<z.ZodEnum<["auto", "off"]>>;
|
|
281
|
+
/**
|
|
282
|
+
* Dynamic retrieval threshold (0.0 to 1.0).
|
|
283
|
+
* Higher values make the model search LESS often (requires higher confidence to trigger search).
|
|
284
|
+
* Only applies in 'auto' mode.
|
|
285
|
+
* @default 0.3
|
|
286
|
+
*/
|
|
287
|
+
grounding_threshold: z.ZodDefault<z.ZodNumber>;
|
|
288
|
+
}, "strip", z.ZodTypeAny, {
|
|
289
|
+
default_mode: "auto" | "off";
|
|
290
|
+
grounding_threshold: number;
|
|
291
|
+
}, {
|
|
292
|
+
default_mode?: "auto" | "off" | undefined;
|
|
293
|
+
grounding_threshold?: number | undefined;
|
|
294
|
+
}>>;
|
|
295
|
+
/**
|
|
296
|
+
* Remote account service endpoint URL.
|
|
297
|
+
* When configured with api_key, accounts are loaded from remote service
|
|
298
|
+
* instead of local file.
|
|
299
|
+
* Env override: OPENCODE_ANTIGRAVITY_API_ENDPOINT
|
|
300
|
+
*/
|
|
301
|
+
api_endpoint: z.ZodOptional<z.ZodString>;
|
|
302
|
+
/**
|
|
303
|
+
* API key for authenticating with remote account service.
|
|
304
|
+
* Required when api_endpoint is configured.
|
|
305
|
+
* Env override: OPENCODE_ANTIGRAVITY_API_KEY
|
|
306
|
+
*/
|
|
307
|
+
api_key: z.ZodOptional<z.ZodString>;
|
|
308
|
+
}, "strip", z.ZodTypeAny, {
|
|
309
|
+
debug: boolean;
|
|
310
|
+
quiet_mode: boolean;
|
|
311
|
+
keep_thinking: boolean;
|
|
312
|
+
session_recovery: boolean;
|
|
313
|
+
auto_resume: boolean;
|
|
314
|
+
resume_text: string;
|
|
315
|
+
empty_response_max_attempts: number;
|
|
316
|
+
empty_response_retry_delay_ms: number;
|
|
317
|
+
tool_id_recovery: boolean;
|
|
318
|
+
claude_tool_hardening: boolean;
|
|
319
|
+
proactive_token_refresh: boolean;
|
|
320
|
+
proactive_refresh_buffer_seconds: number;
|
|
321
|
+
proactive_refresh_check_interval_seconds: number;
|
|
322
|
+
max_rate_limit_wait_seconds: number;
|
|
323
|
+
quota_fallback: boolean;
|
|
324
|
+
account_selection_strategy: "sticky" | "round-robin" | "hybrid";
|
|
325
|
+
pid_offset_enabled: boolean;
|
|
326
|
+
switch_on_first_rate_limit: boolean;
|
|
327
|
+
auto_update: boolean;
|
|
328
|
+
api_key?: string | undefined;
|
|
329
|
+
$schema?: string | undefined;
|
|
330
|
+
log_dir?: string | undefined;
|
|
331
|
+
signature_cache?: {
|
|
332
|
+
enabled: boolean;
|
|
333
|
+
memory_ttl_seconds: number;
|
|
334
|
+
disk_ttl_seconds: number;
|
|
335
|
+
write_interval_seconds: number;
|
|
336
|
+
} | undefined;
|
|
337
|
+
health_score?: {
|
|
338
|
+
initial: number;
|
|
339
|
+
success_reward: number;
|
|
340
|
+
rate_limit_penalty: number;
|
|
341
|
+
failure_penalty: number;
|
|
342
|
+
recovery_rate_per_hour: number;
|
|
343
|
+
min_usable: number;
|
|
344
|
+
max_score: number;
|
|
345
|
+
} | undefined;
|
|
346
|
+
token_bucket?: {
|
|
347
|
+
max_tokens: number;
|
|
348
|
+
regeneration_rate_per_minute: number;
|
|
349
|
+
initial_tokens: number;
|
|
350
|
+
} | undefined;
|
|
351
|
+
web_search?: {
|
|
352
|
+
default_mode: "auto" | "off";
|
|
353
|
+
grounding_threshold: number;
|
|
354
|
+
} | undefined;
|
|
355
|
+
api_endpoint?: string | undefined;
|
|
356
|
+
}, {
|
|
357
|
+
api_key?: string | undefined;
|
|
358
|
+
debug?: boolean | undefined;
|
|
359
|
+
$schema?: string | undefined;
|
|
360
|
+
quiet_mode?: boolean | undefined;
|
|
361
|
+
log_dir?: string | undefined;
|
|
362
|
+
keep_thinking?: boolean | undefined;
|
|
363
|
+
session_recovery?: boolean | undefined;
|
|
364
|
+
auto_resume?: boolean | undefined;
|
|
365
|
+
resume_text?: string | undefined;
|
|
366
|
+
signature_cache?: {
|
|
367
|
+
enabled?: boolean | undefined;
|
|
368
|
+
memory_ttl_seconds?: number | undefined;
|
|
369
|
+
disk_ttl_seconds?: number | undefined;
|
|
370
|
+
write_interval_seconds?: number | undefined;
|
|
371
|
+
} | undefined;
|
|
372
|
+
empty_response_max_attempts?: number | undefined;
|
|
373
|
+
empty_response_retry_delay_ms?: number | undefined;
|
|
374
|
+
tool_id_recovery?: boolean | undefined;
|
|
375
|
+
claude_tool_hardening?: boolean | undefined;
|
|
376
|
+
proactive_token_refresh?: boolean | undefined;
|
|
377
|
+
proactive_refresh_buffer_seconds?: number | undefined;
|
|
378
|
+
proactive_refresh_check_interval_seconds?: number | undefined;
|
|
379
|
+
max_rate_limit_wait_seconds?: number | undefined;
|
|
380
|
+
quota_fallback?: boolean | undefined;
|
|
381
|
+
account_selection_strategy?: "sticky" | "round-robin" | "hybrid" | undefined;
|
|
382
|
+
pid_offset_enabled?: boolean | undefined;
|
|
383
|
+
switch_on_first_rate_limit?: boolean | undefined;
|
|
384
|
+
health_score?: {
|
|
385
|
+
initial?: number | undefined;
|
|
386
|
+
success_reward?: number | undefined;
|
|
387
|
+
rate_limit_penalty?: number | undefined;
|
|
388
|
+
failure_penalty?: number | undefined;
|
|
389
|
+
recovery_rate_per_hour?: number | undefined;
|
|
390
|
+
min_usable?: number | undefined;
|
|
391
|
+
max_score?: number | undefined;
|
|
392
|
+
} | undefined;
|
|
393
|
+
token_bucket?: {
|
|
394
|
+
max_tokens?: number | undefined;
|
|
395
|
+
regeneration_rate_per_minute?: number | undefined;
|
|
396
|
+
initial_tokens?: number | undefined;
|
|
397
|
+
} | undefined;
|
|
398
|
+
auto_update?: boolean | undefined;
|
|
399
|
+
web_search?: {
|
|
400
|
+
default_mode?: "auto" | "off" | undefined;
|
|
401
|
+
grounding_threshold?: number | undefined;
|
|
402
|
+
} | undefined;
|
|
403
|
+
api_endpoint?: string | undefined;
|
|
404
|
+
}>;
|
|
405
|
+
export type AntigravityConfig = z.infer<typeof AntigravityConfigSchema>;
|
|
406
|
+
export type SignatureCacheConfig = z.infer<typeof SignatureCacheConfigSchema>;
|
|
407
|
+
/**
|
|
408
|
+
* Default configuration values.
|
|
409
|
+
*/
|
|
410
|
+
export declare const DEFAULT_CONFIG: AntigravityConfig;
|
|
411
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/plugin/config/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;GAMG;AACH,eAAO,MAAM,8BAA8B,gDAA8C,CAAC;AAC1F,MAAM,MAAM,wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,0BAA0B;IACrC,wDAAwD;;IAGxD,wDAAwD;;IAGxD,uDAAuD;;IAGvD,yDAAyD;;;;;;;;;;;;EAEzD,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,uBAAuB;IAClC,4CAA4C;;IAO5C;;;;;OAKG;;IAGH;;;;OAIG;;IAGH;;;;OAIG;;IAOH;;;;;;;;OAQG;;IAOH;;;;;OAKG;;IAGH;;;;;;;;OAQG;;IAGH;;;;;OAKG;;IAOH;;;OAGG;;QAnGH,wDAAwD;;QAGxD,wDAAwD;;QAGxD,uDAAuD;;QAGvD,yDAAyD;;;;;;;;;;;;;IAiGzD;;;;;OAKG;;IAGH;;;;OAIG;;IAOH;;;;;;OAMG;;IAOH;;;;;;;;;;OAUG;;IAOH;;;;;;OAMG;;IAGH;;;;;OAKG;;IAGH;;;;;OAKG;;IAOH;;;;;;;;OAQG;;IAGH;;;;;;;;;;OAUG;;IAGH;;;;OAIG;;IAGH;;;;;;;;;;;OAWG;;IAGF;;;;;OAKG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA+BJ;;;OAGG;;;QAQD;;;;;WAKG;;QAGH;;;;;WAKG;;;;;;;;;IAQL;;;;;OAKG;;IAGH;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAE9E;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,iBA4C5B,CAAC"}
|