opencode-antigravity-auth-remix 1.0.7

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.
Files changed (187) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +723 -0
  3. package/dist/index.d.ts +4 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +3 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/antigravity/oauth.d.ts +31 -0
  8. package/dist/src/antigravity/oauth.d.ts.map +1 -0
  9. package/dist/src/antigravity/oauth.js +168 -0
  10. package/dist/src/antigravity/oauth.js.map +1 -0
  11. package/dist/src/constants.d.ts +107 -0
  12. package/dist/src/constants.d.ts.map +1 -0
  13. package/dist/src/constants.js +138 -0
  14. package/dist/src/constants.js.map +1 -0
  15. package/dist/src/hooks/auto-update-checker/cache.d.ts +3 -0
  16. package/dist/src/hooks/auto-update-checker/cache.d.ts.map +1 -0
  17. package/dist/src/hooks/auto-update-checker/cache.js +71 -0
  18. package/dist/src/hooks/auto-update-checker/cache.js.map +1 -0
  19. package/dist/src/hooks/auto-update-checker/checker.d.ts +16 -0
  20. package/dist/src/hooks/auto-update-checker/checker.d.ts.map +1 -0
  21. package/dist/src/hooks/auto-update-checker/checker.js +237 -0
  22. package/dist/src/hooks/auto-update-checker/checker.js.map +1 -0
  23. package/dist/src/hooks/auto-update-checker/constants.d.ts +9 -0
  24. package/dist/src/hooks/auto-update-checker/constants.d.ts.map +1 -0
  25. package/dist/src/hooks/auto-update-checker/constants.js +23 -0
  26. package/dist/src/hooks/auto-update-checker/constants.js.map +1 -0
  27. package/dist/src/hooks/auto-update-checker/index.d.ts +34 -0
  28. package/dist/src/hooks/auto-update-checker/index.d.ts.map +1 -0
  29. package/dist/src/hooks/auto-update-checker/index.js +125 -0
  30. package/dist/src/hooks/auto-update-checker/index.js.map +1 -0
  31. package/dist/src/hooks/auto-update-checker/types.d.ts +25 -0
  32. package/dist/src/hooks/auto-update-checker/types.d.ts.map +1 -0
  33. package/dist/src/hooks/auto-update-checker/types.js +1 -0
  34. package/dist/src/hooks/auto-update-checker/types.js.map +1 -0
  35. package/dist/src/plugin/accounts.d.ts +58 -0
  36. package/dist/src/plugin/accounts.d.ts.map +1 -0
  37. package/dist/src/plugin/accounts.js +350 -0
  38. package/dist/src/plugin/accounts.js.map +1 -0
  39. package/dist/src/plugin/auth.d.ts +21 -0
  40. package/dist/src/plugin/auth.d.ts.map +1 -0
  41. package/dist/src/plugin/auth.js +46 -0
  42. package/dist/src/plugin/auth.js.map +1 -0
  43. package/dist/src/plugin/cache/index.d.ts +5 -0
  44. package/dist/src/plugin/cache/index.d.ts.map +1 -0
  45. package/dist/src/plugin/cache/index.js +5 -0
  46. package/dist/src/plugin/cache/index.js.map +1 -0
  47. package/dist/src/plugin/cache/signature-cache.d.ts +111 -0
  48. package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -0
  49. package/dist/src/plugin/cache/signature-cache.js +373 -0
  50. package/dist/src/plugin/cache/signature-cache.js.map +1 -0
  51. package/dist/src/plugin/cache.d.ts +44 -0
  52. package/dist/src/plugin/cache.d.ts.map +1 -0
  53. package/dist/src/plugin/cache.js +200 -0
  54. package/dist/src/plugin/cache.js.map +1 -0
  55. package/dist/src/plugin/cli.d.ts +19 -0
  56. package/dist/src/plugin/cli.d.ts.map +1 -0
  57. package/dist/src/plugin/cli.js +59 -0
  58. package/dist/src/plugin/cli.js.map +1 -0
  59. package/dist/src/plugin/config/index.d.ts +16 -0
  60. package/dist/src/plugin/config/index.d.ts.map +1 -0
  61. package/dist/src/plugin/config/index.js +16 -0
  62. package/dist/src/plugin/config/index.js.map +1 -0
  63. package/dist/src/plugin/config/loader.d.ts +35 -0
  64. package/dist/src/plugin/config/loader.d.ts.map +1 -0
  65. package/dist/src/plugin/config/loader.js +178 -0
  66. package/dist/src/plugin/config/loader.js.map +1 -0
  67. package/dist/src/plugin/config/schema.d.ts +257 -0
  68. package/dist/src/plugin/config/schema.d.ts.map +1 -0
  69. package/dist/src/plugin/config/schema.js +229 -0
  70. package/dist/src/plugin/config/schema.js.map +1 -0
  71. package/dist/src/plugin/core/streaming/index.d.ts +3 -0
  72. package/dist/src/plugin/core/streaming/index.d.ts.map +1 -0
  73. package/dist/src/plugin/core/streaming/index.js +3 -0
  74. package/dist/src/plugin/core/streaming/index.js.map +1 -0
  75. package/dist/src/plugin/core/streaming/transformer.d.ts +9 -0
  76. package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -0
  77. package/dist/src/plugin/core/streaming/transformer.js +134 -0
  78. package/dist/src/plugin/core/streaming/transformer.js.map +1 -0
  79. package/dist/src/plugin/core/streaming/types.d.ts +26 -0
  80. package/dist/src/plugin/core/streaming/types.d.ts.map +1 -0
  81. package/dist/src/plugin/core/streaming/types.js +1 -0
  82. package/dist/src/plugin/core/streaming/types.js.map +1 -0
  83. package/dist/src/plugin/debug.d.ts +68 -0
  84. package/dist/src/plugin/debug.d.ts.map +1 -0
  85. package/dist/src/plugin/debug.js +321 -0
  86. package/dist/src/plugin/debug.js.map +1 -0
  87. package/dist/src/plugin/errors.d.ts +28 -0
  88. package/dist/src/plugin/errors.d.ts.map +1 -0
  89. package/dist/src/plugin/errors.js +42 -0
  90. package/dist/src/plugin/errors.js.map +1 -0
  91. package/dist/src/plugin/logger.d.ts +54 -0
  92. package/dist/src/plugin/logger.d.ts.map +1 -0
  93. package/dist/src/plugin/logger.js +120 -0
  94. package/dist/src/plugin/logger.js.map +1 -0
  95. package/dist/src/plugin/project.d.ts +33 -0
  96. package/dist/src/plugin/project.d.ts.map +1 -0
  97. package/dist/src/plugin/project.js +239 -0
  98. package/dist/src/plugin/project.js.map +1 -0
  99. package/dist/src/plugin/recovery/constants.d.ts +22 -0
  100. package/dist/src/plugin/recovery/constants.d.ts.map +1 -0
  101. package/dist/src/plugin/recovery/constants.js +43 -0
  102. package/dist/src/plugin/recovery/constants.js.map +1 -0
  103. package/dist/src/plugin/recovery/index.d.ts +12 -0
  104. package/dist/src/plugin/recovery/index.d.ts.map +1 -0
  105. package/dist/src/plugin/recovery/index.js +12 -0
  106. package/dist/src/plugin/recovery/index.js.map +1 -0
  107. package/dist/src/plugin/recovery/storage.d.ts +24 -0
  108. package/dist/src/plugin/recovery/storage.d.ts.map +1 -0
  109. package/dist/src/plugin/recovery/storage.js +354 -0
  110. package/dist/src/plugin/recovery/storage.js.map +1 -0
  111. package/dist/src/plugin/recovery/types.d.ts +116 -0
  112. package/dist/src/plugin/recovery/types.d.ts.map +1 -0
  113. package/dist/src/plugin/recovery/types.js +6 -0
  114. package/dist/src/plugin/recovery/types.js.map +1 -0
  115. package/dist/src/plugin/recovery.d.ts +61 -0
  116. package/dist/src/plugin/recovery.d.ts.map +1 -0
  117. package/dist/src/plugin/recovery.js +376 -0
  118. package/dist/src/plugin/recovery.js.map +1 -0
  119. package/dist/src/plugin/refresh-queue.d.ts +101 -0
  120. package/dist/src/plugin/refresh-queue.d.ts.map +1 -0
  121. package/dist/src/plugin/refresh-queue.js +244 -0
  122. package/dist/src/plugin/refresh-queue.js.map +1 -0
  123. package/dist/src/plugin/request-helpers.d.ts +270 -0
  124. package/dist/src/plugin/request-helpers.d.ts.map +1 -0
  125. package/dist/src/plugin/request-helpers.js +2158 -0
  126. package/dist/src/plugin/request-helpers.js.map +1 -0
  127. package/dist/src/plugin/request.d.ts +87 -0
  128. package/dist/src/plugin/request.d.ts.map +1 -0
  129. package/dist/src/plugin/request.js +1233 -0
  130. package/dist/src/plugin/request.js.map +1 -0
  131. package/dist/src/plugin/search.d.ts +19 -0
  132. package/dist/src/plugin/search.d.ts.map +1 -0
  133. package/dist/src/plugin/search.js +191 -0
  134. package/dist/src/plugin/search.js.map +1 -0
  135. package/dist/src/plugin/server.d.ts +23 -0
  136. package/dist/src/plugin/server.d.ts.map +1 -0
  137. package/dist/src/plugin/server.js +222 -0
  138. package/dist/src/plugin/server.js.map +1 -0
  139. package/dist/src/plugin/storage.d.ts +77 -0
  140. package/dist/src/plugin/storage.d.ts.map +1 -0
  141. package/dist/src/plugin/storage.js +207 -0
  142. package/dist/src/plugin/storage.js.map +1 -0
  143. package/dist/src/plugin/stores/signature-store.d.ts +5 -0
  144. package/dist/src/plugin/stores/signature-store.d.ts.map +1 -0
  145. package/dist/src/plugin/stores/signature-store.js +25 -0
  146. package/dist/src/plugin/stores/signature-store.js.map +1 -0
  147. package/dist/src/plugin/thinking-recovery.d.ts +90 -0
  148. package/dist/src/plugin/thinking-recovery.d.ts.map +1 -0
  149. package/dist/src/plugin/thinking-recovery.js +316 -0
  150. package/dist/src/plugin/thinking-recovery.js.map +1 -0
  151. package/dist/src/plugin/token.d.ts +19 -0
  152. package/dist/src/plugin/token.d.ts.map +1 -0
  153. package/dist/src/plugin/token.js +128 -0
  154. package/dist/src/plugin/token.js.map +1 -0
  155. package/dist/src/plugin/transform/claude.d.ts +80 -0
  156. package/dist/src/plugin/transform/claude.d.ts.map +1 -0
  157. package/dist/src/plugin/transform/claude.js +265 -0
  158. package/dist/src/plugin/transform/claude.js.map +1 -0
  159. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +35 -0
  160. package/dist/src/plugin/transform/cross-model-sanitizer.d.ts.map +1 -0
  161. package/dist/src/plugin/transform/cross-model-sanitizer.js +225 -0
  162. package/dist/src/plugin/transform/cross-model-sanitizer.js.map +1 -0
  163. package/dist/src/plugin/transform/gemini.d.ts +63 -0
  164. package/dist/src/plugin/transform/gemini.d.ts.map +1 -0
  165. package/dist/src/plugin/transform/gemini.js +142 -0
  166. package/dist/src/plugin/transform/gemini.js.map +1 -0
  167. package/dist/src/plugin/transform/index.d.ts +14 -0
  168. package/dist/src/plugin/transform/index.d.ts.map +1 -0
  169. package/dist/src/plugin/transform/index.js +14 -0
  170. package/dist/src/plugin/transform/index.js.map +1 -0
  171. package/dist/src/plugin/transform/model-resolver.d.ts +78 -0
  172. package/dist/src/plugin/transform/model-resolver.d.ts.map +1 -0
  173. package/dist/src/plugin/transform/model-resolver.js +221 -0
  174. package/dist/src/plugin/transform/model-resolver.js.map +1 -0
  175. package/dist/src/plugin/transform/types.d.ts +93 -0
  176. package/dist/src/plugin/transform/types.d.ts.map +1 -0
  177. package/dist/src/plugin/transform/types.js +1 -0
  178. package/dist/src/plugin/transform/types.js.map +1 -0
  179. package/dist/src/plugin/types.d.ts +97 -0
  180. package/dist/src/plugin/types.d.ts.map +1 -0
  181. package/dist/src/plugin/types.js +1 -0
  182. package/dist/src/plugin/types.js.map +1 -0
  183. package/dist/src/plugin.d.ts +8 -0
  184. package/dist/src/plugin.d.ts.map +1 -0
  185. package/dist/src/plugin.js +1845 -0
  186. package/dist/src/plugin.js.map +1 -0
  187. package/package.json +65 -0
@@ -0,0 +1,59 @@
1
+ import { createInterface } from "node:readline/promises";
2
+ import { stdin as input, stdout as output } from "node:process";
3
+ /**
4
+ * Prompts the user for a project ID via stdin/stdout.
5
+ */
6
+ export async function promptProjectId() {
7
+ const rl = createInterface({ input, output });
8
+ try {
9
+ const answer = await rl.question("Project ID (leave blank to use your default project): ");
10
+ return answer.trim();
11
+ }
12
+ finally {
13
+ rl.close();
14
+ }
15
+ }
16
+ /**
17
+ * Prompts user whether they want to add another OAuth account.
18
+ */
19
+ export async function promptAddAnotherAccount(currentCount) {
20
+ const rl = createInterface({ input, output });
21
+ try {
22
+ const answer = await rl.question(`Add another account? (${currentCount} added) (y/n): `);
23
+ const normalized = answer.trim().toLowerCase();
24
+ return normalized === "y" || normalized === "yes";
25
+ }
26
+ finally {
27
+ rl.close();
28
+ }
29
+ }
30
+ /**
31
+ * Prompts user to choose login mode when accounts already exist.
32
+ * Returns "add" to append new accounts, "fresh" to clear and start over.
33
+ */
34
+ export async function promptLoginMode(existingAccounts) {
35
+ const rl = createInterface({ input, output });
36
+ try {
37
+ console.log(`\n${existingAccounts.length} account(s) saved:`);
38
+ for (const acc of existingAccounts) {
39
+ const label = acc.email || `Account ${acc.index + 1}`;
40
+ console.log(` ${acc.index + 1}. ${label}`);
41
+ }
42
+ console.log("");
43
+ while (true) {
44
+ const answer = await rl.question("(a)dd new account(s) or (f)resh start? [a/f]: ");
45
+ const normalized = answer.trim().toLowerCase();
46
+ if (normalized === "a" || normalized === "add") {
47
+ return "add";
48
+ }
49
+ if (normalized === "f" || normalized === "fresh") {
50
+ return "fresh";
51
+ }
52
+ console.log("Please enter 'a' to add accounts or 'f' to start fresh.");
53
+ }
54
+ }
55
+ finally {
56
+ rl.close();
57
+ }
58
+ }
59
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/plugin/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAEhE;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,eAAe;IACnC,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC,CAAC;QAC3F,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;YAAS,CAAC;QACT,EAAE,CAAC,KAAK,EAAE,CAAC;IACb,CAAC;AACH,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,YAAoB;IAChE,MAAM,EAAE,GAAG,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,QAAQ,CAAC,yBAAyB,YAAY,iBAAiB,CAAC,CAAC;QACzF,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/C,OAAO,UAAU,KAAK,GAAG,IAAI,UAAU,KA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*
4
+ * @example
5
+ * ```typescript
6
+ * import { loadConfig, type AntigravityConfig } from "./config";
7
+ *
8
+ * const config = loadConfig(directory);
9
+ * if (config.session_recovery) {
10
+ * // Enable session recovery
11
+ * }
12
+ * ```
13
+ */
14
+ export { AntigravityConfigSchema, SignatureCacheConfigSchema, DEFAULT_CONFIG, type AntigravityConfig, type SignatureCacheConfig, } from "./schema";
15
+ export { loadConfig, getUserConfigPath, getProjectConfigPath, getDefaultLogsDir, configExists, } from "./loader";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugin/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,GAC1B,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,GACb,MAAM,UAAU,CAAC"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Configuration module for opencode-antigravity-auth plugin.
3
+ *
4
+ * @example
5
+ * ```typescript
6
+ * import { loadConfig, type AntigravityConfig } from "./config";
7
+ *
8
+ * const config = loadConfig(directory);
9
+ * if (config.session_recovery) {
10
+ * // Enable session recovery
11
+ * }
12
+ * ```
13
+ */
14
+ export { AntigravityConfigSchema, SignatureCacheConfigSchema, DEFAULT_CONFIG, } from "./schema";
15
+ export { loadConfig, getUserConfigPath, getProjectConfigPath, getDefaultLogsDir, configExists, } from "./loader";
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/plugin/config/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,uBAAuB,EACvB,0BAA0B,EAC1B,cAAc,GAGf,MAAM,UAAU,CAAC;AAElB,OAAO,EACL,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,YAAY,GACb,MAAM,UAAU,CAAC"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Configuration loader for opencode-antigravity-auth plugin.
3
+ *
4
+ * Loads config from files with environment variable overrides.
5
+ * Priority (lowest to highest):
6
+ * 1. Schema defaults
7
+ * 2. User config file
8
+ * 3. Project config file
9
+ * 4. Environment variables
10
+ */
11
+ import { type AntigravityConfig } from "./schema";
12
+ /**
13
+ * Get the user-level config file path.
14
+ */
15
+ export declare function getUserConfigPath(): string;
16
+ /**
17
+ * Get the project-level config file path.
18
+ */
19
+ export declare function getProjectConfigPath(directory: string): string;
20
+ /**
21
+ * Load the complete configuration.
22
+ *
23
+ * @param directory - The project directory (for project-level config)
24
+ * @returns Fully resolved configuration
25
+ */
26
+ export declare function loadConfig(directory: string): AntigravityConfig;
27
+ /**
28
+ * Check if a config file exists at the given path.
29
+ */
30
+ export declare function configExists(path: string): boolean;
31
+ /**
32
+ * Get the default logs directory.
33
+ */
34
+ export declare function getDefaultLogsDir(): string;
35
+ //# sourceMappingURL=loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/plugin/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,EAA2C,KAAK,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAqB3F;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE9D;AA2HD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,iBAAiB,CAsB/D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * Configuration loader for opencode-antigravity-auth plugin.
3
+ *
4
+ * Loads config from files with environment variable overrides.
5
+ * Priority (lowest to highest):
6
+ * 1. Schema defaults
7
+ * 2. User config file
8
+ * 3. Project config file
9
+ * 4. Environment variables
10
+ */
11
+ import { existsSync, readFileSync } from "node:fs";
12
+ import { join } from "node:path";
13
+ import { homedir } from "node:os";
14
+ import { AntigravityConfigSchema, DEFAULT_CONFIG } from "./schema";
15
+ import { createLogger } from "../logger";
16
+ const log = createLogger("config");
17
+ // =============================================================================
18
+ // Path Utilities
19
+ // =============================================================================
20
+ /**
21
+ * Get the OS-specific config directory.
22
+ */
23
+ function getConfigDir() {
24
+ const platform = process.platform;
25
+ if (platform === "win32") {
26
+ return join(process.env.APPDATA || join(homedir(), "AppData", "Roaming"), "opencode");
27
+ }
28
+ const xdgConfig = process.env.XDG_CONFIG_HOME || join(homedir(), ".config");
29
+ return join(xdgConfig, "opencode");
30
+ }
31
+ /**
32
+ * Get the user-level config file path.
33
+ */
34
+ export function getUserConfigPath() {
35
+ return join(getConfigDir(), "antigravity.json");
36
+ }
37
+ /**
38
+ * Get the project-level config file path.
39
+ */
40
+ export function getProjectConfigPath(directory) {
41
+ return join(directory, ".opencode", "antigravity.json");
42
+ }
43
+ // =============================================================================
44
+ // Config Loading
45
+ // =============================================================================
46
+ /**
47
+ * Load and parse a config file, returning null if not found or invalid.
48
+ */
49
+ function loadConfigFile(path) {
50
+ try {
51
+ if (!existsSync(path)) {
52
+ return null;
53
+ }
54
+ const content = readFileSync(path, "utf-8");
55
+ const rawConfig = JSON.parse(content);
56
+ // Validate with Zod (partial - we'll merge with defaults later)
57
+ const result = AntigravityConfigSchema.partial().safeParse(rawConfig);
58
+ if (!result.success) {
59
+ log.warn("Config validation error", {
60
+ path,
61
+ issues: result.error.issues.map(i => `${i.path.join(".")}: ${i.message}`).join(", "),
62
+ });
63
+ return null;
64
+ }
65
+ return result.data;
66
+ }
67
+ catch (error) {
68
+ if (error instanceof SyntaxError) {
69
+ log.warn("Invalid JSON in config file", { path, error: error.message });
70
+ }
71
+ else {
72
+ log.warn("Failed to load config file", { path, error: String(error) });
73
+ }
74
+ return null;
75
+ }
76
+ }
77
+ /**
78
+ * Deep merge two config objects, with override taking precedence.
79
+ */
80
+ function mergeConfigs(base, override) {
81
+ return {
82
+ ...base,
83
+ ...override,
84
+ // Deep merge signature_cache if both exist
85
+ signature_cache: override.signature_cache
86
+ ? {
87
+ ...base.signature_cache,
88
+ ...override.signature_cache,
89
+ }
90
+ : base.signature_cache,
91
+ };
92
+ }
93
+ /**
94
+ * Apply environment variable overrides to config.
95
+ * Env vars always take precedence over config file values.
96
+ */
97
+ function applyEnvOverrides(config) {
98
+ const env = process.env;
99
+ return {
100
+ ...config,
101
+ // OPENCODE_ANTIGRAVITY_QUIET=1
102
+ quiet_mode: env.OPENCODE_ANTIGRAVITY_QUIET === "1" || env.OPENCODE_ANTIGRAVITY_QUIET === "true"
103
+ ? true
104
+ : config.quiet_mode,
105
+ // OPENCODE_ANTIGRAVITY_DEBUG=1 or any truthy value
106
+ debug: env.OPENCODE_ANTIGRAVITY_DEBUG
107
+ ? env.OPENCODE_ANTIGRAVITY_DEBUG !== "0" && env.OPENCODE_ANTIGRAVITY_DEBUG !== "false"
108
+ : config.debug,
109
+ // OPENCODE_ANTIGRAVITY_LOG_DIR=/path/to/logs
110
+ log_dir: env.OPENCODE_ANTIGRAVITY_LOG_DIR || config.log_dir,
111
+ // OPENCODE_ANTIGRAVITY_KEEP_THINKING=1
112
+ keep_thinking: env.OPENCODE_ANTIGRAVITY_KEEP_THINKING === "1" ||
113
+ env.OPENCODE_ANTIGRAVITY_KEEP_THINKING === "true"
114
+ ? true
115
+ : config.keep_thinking,
116
+ // OPENCODE_ANTIGRAVITY_SESSION_RECOVERY=0 to disable
117
+ session_recovery: env.OPENCODE_ANTIGRAVITY_SESSION_RECOVERY === "0" ||
118
+ env.OPENCODE_ANTIGRAVITY_SESSION_RECOVERY === "false"
119
+ ? false
120
+ : config.session_recovery,
121
+ // OPENCODE_ANTIGRAVITY_AUTO_RESUME=0 to disable auto-continue after recovery
122
+ auto_resume: env.OPENCODE_ANTIGRAVITY_AUTO_RESUME === "0" ||
123
+ env.OPENCODE_ANTIGRAVITY_AUTO_RESUME === "false"
124
+ ? false
125
+ : env.OPENCODE_ANTIGRAVITY_AUTO_RESUME === "1" ||
126
+ env.OPENCODE_ANTIGRAVITY_AUTO_RESUME === "true"
127
+ ? true
128
+ : config.auto_resume,
129
+ // OPENCODE_ANTIGRAVITY_RESUME_TEXT to customize resume text
130
+ resume_text: env.OPENCODE_ANTIGRAVITY_RESUME_TEXT || config.resume_text,
131
+ // OPENCODE_ANTIGRAVITY_AUTO_UPDATE=0 to disable
132
+ auto_update: env.OPENCODE_ANTIGRAVITY_AUTO_UPDATE === "0" ||
133
+ env.OPENCODE_ANTIGRAVITY_AUTO_UPDATE === "false"
134
+ ? false
135
+ : config.auto_update,
136
+ };
137
+ }
138
+ // =============================================================================
139
+ // Main Loader
140
+ // =============================================================================
141
+ /**
142
+ * Load the complete configuration.
143
+ *
144
+ * @param directory - The project directory (for project-level config)
145
+ * @returns Fully resolved configuration
146
+ */
147
+ export function loadConfig(directory) {
148
+ // Start with defaults
149
+ let config = { ...DEFAULT_CONFIG };
150
+ // Load user config file (if exists)
151
+ const userConfigPath = getUserConfigPath();
152
+ const userConfig = loadConfigFile(userConfigPath);
153
+ if (userConfig) {
154
+ config = mergeConfigs(config, userConfig);
155
+ }
156
+ // Load project config file (if exists) - overrides user config
157
+ const projectConfigPath = getProjectConfigPath(directory);
158
+ const projectConfig = loadConfigFile(projectConfigPath);
159
+ if (projectConfig) {
160
+ config = mergeConfigs(config, projectConfig);
161
+ }
162
+ // Apply environment variable overrides (always win)
163
+ config = applyEnvOverrides(config);
164
+ return config;
165
+ }
166
+ /**
167
+ * Check if a config file exists at the given path.
168
+ */
169
+ export function configExists(path) {
170
+ return existsSync(path);
171
+ }
172
+ /**
173
+ * Get the default logs directory.
174
+ */
175
+ export function getDefaultLogsDir() {
176
+ return join(getConfigDir(), "antigravity-logs");
177
+ }
178
+ //# sourceMappingURL=loader.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loader.js","sourceRoot":"","sources":["../../../../src/plugin/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,uBAAuB,EAAE,cAAc,EAA0B,MAAM,UAAU,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,MAAM,GAAG,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;AAEnC,gFAAgF;AAChF,iBAAiB;AACjB,gFAAgF;AAEhF;;GAEG;AACH,SAAS,YAAY;IACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;IACxF,CAAC;IACD,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;IAC5E,OAAO,IAAI,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,CAAC,YAAY,EAAE,EAAE,kBAAkB,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,SAAiB;I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AAM,CAAC,CAAC;IAEnC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,IAAY;IACvC,OAAO,UAAU,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,CAAC,YAAY,EAAE,EAAE,kBAAkB,CAAC,CAAC;AAClD,CAAC"}
@@ -0,0 +1,257 @@
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
+ * Signature cache configuration for persisting thinking block signatures to disk.
14
+ */
15
+ export declare const SignatureCacheConfigSchema: z.ZodObject<{
16
+ /** Enable disk caching of signatures (default: true) */
17
+ enabled: z.ZodDefault<z.ZodBoolean>;
18
+ /** In-memory TTL in seconds (default: 3600 = 1 hour) */
19
+ memory_ttl_seconds: z.ZodDefault<z.ZodNumber>;
20
+ /** Disk TTL in seconds (default: 172800 = 48 hours) */
21
+ disk_ttl_seconds: z.ZodDefault<z.ZodNumber>;
22
+ /** Background write interval in seconds (default: 60) */
23
+ write_interval_seconds: z.ZodDefault<z.ZodNumber>;
24
+ }, "strip", z.ZodTypeAny, {
25
+ enabled: boolean;
26
+ memory_ttl_seconds: number;
27
+ disk_ttl_seconds: number;
28
+ write_interval_seconds: number;
29
+ }, {
30
+ enabled?: boolean | undefined;
31
+ memory_ttl_seconds?: number | undefined;
32
+ disk_ttl_seconds?: number | undefined;
33
+ write_interval_seconds?: number | undefined;
34
+ }>;
35
+ /**
36
+ * Main configuration schema for the Antigravity OAuth plugin.
37
+ */
38
+ export declare const AntigravityConfigSchema: z.ZodObject<{
39
+ /** JSON Schema reference for IDE support */
40
+ $schema: z.ZodOptional<z.ZodString>;
41
+ /**
42
+ * Suppress most toast notifications (rate limit, account switching, etc.)
43
+ * Recovery toasts are always shown regardless of this setting.
44
+ * Env override: OPENCODE_ANTIGRAVITY_QUIET=1
45
+ * @default false
46
+ */
47
+ quiet_mode: z.ZodDefault<z.ZodBoolean>;
48
+ /**
49
+ * Enable debug logging to file.
50
+ * Env override: OPENCODE_ANTIGRAVITY_DEBUG=1
51
+ * @default false
52
+ */
53
+ debug: z.ZodDefault<z.ZodBoolean>;
54
+ /**
55
+ * Custom directory for debug logs.
56
+ * Env override: OPENCODE_ANTIGRAVITY_LOG_DIR=/path/to/logs
57
+ * @default OS-specific config dir + "/antigravity-logs"
58
+ */
59
+ log_dir: z.ZodOptional<z.ZodString>;
60
+ /**
61
+ * Preserve thinking blocks for Claude models using signature caching.
62
+ *
63
+ * When false (default): Thinking blocks are stripped for reliability.
64
+ * When true: Full context preserved, but may encounter signature errors.
65
+ *
66
+ * Env override: OPENCODE_ANTIGRAVITY_KEEP_THINKING=1
67
+ * @default false
68
+ */
69
+ keep_thinking: z.ZodDefault<z.ZodBoolean>;
70
+ /**
71
+ * Enable automatic session recovery from tool_result_missing errors.
72
+ * When enabled, shows a toast notification when recoverable errors occur.
73
+ *
74
+ * @default true
75
+ */
76
+ session_recovery: z.ZodDefault<z.ZodBoolean>;
77
+ /**
78
+ * Automatically send a "continue" prompt after successful recovery.
79
+ * Only applies when session_recovery is enabled.
80
+ *
81
+ * When false: Only shows toast notification, user must manually continue.
82
+ * When true: Automatically sends "continue" to resume the session.
83
+ *
84
+ * @default true
85
+ */
86
+ auto_resume: z.ZodDefault<z.ZodBoolean>;
87
+ /**
88
+ * Custom text to send when auto-resuming after recovery.
89
+ * Only used when auto_resume is enabled.
90
+ *
91
+ * @default "continue"
92
+ */
93
+ resume_text: z.ZodDefault<z.ZodString>;
94
+ /**
95
+ * Signature cache configuration for persisting thinking block signatures.
96
+ * Only used when keep_thinking is enabled.
97
+ */
98
+ signature_cache: z.ZodOptional<z.ZodObject<{
99
+ /** Enable disk caching of signatures (default: true) */
100
+ enabled: z.ZodDefault<z.ZodBoolean>;
101
+ /** In-memory TTL in seconds (default: 3600 = 1 hour) */
102
+ memory_ttl_seconds: z.ZodDefault<z.ZodNumber>;
103
+ /** Disk TTL in seconds (default: 172800 = 48 hours) */
104
+ disk_ttl_seconds: z.ZodDefault<z.ZodNumber>;
105
+ /** Background write interval in seconds (default: 60) */
106
+ write_interval_seconds: z.ZodDefault<z.ZodNumber>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ enabled: boolean;
109
+ memory_ttl_seconds: number;
110
+ disk_ttl_seconds: number;
111
+ write_interval_seconds: number;
112
+ }, {
113
+ enabled?: boolean | undefined;
114
+ memory_ttl_seconds?: number | undefined;
115
+ disk_ttl_seconds?: number | undefined;
116
+ write_interval_seconds?: number | undefined;
117
+ }>>;
118
+ /**
119
+ * Maximum retry attempts when Antigravity returns an empty response.
120
+ * Empty responses occur when no candidates/choices are returned.
121
+ *
122
+ * @default 4
123
+ */
124
+ empty_response_max_attempts: z.ZodDefault<z.ZodNumber>;
125
+ /**
126
+ * Delay in milliseconds between empty response retries.
127
+ *
128
+ * @default 2000
129
+ */
130
+ empty_response_retry_delay_ms: z.ZodDefault<z.ZodNumber>;
131
+ /**
132
+ * Enable tool ID orphan recovery.
133
+ * When tool responses have mismatched IDs (due to context compaction),
134
+ * attempt to match them by function name or create placeholders.
135
+ *
136
+ * @default true
137
+ */
138
+ tool_id_recovery: z.ZodDefault<z.ZodBoolean>;
139
+ /**
140
+ * Enable tool hallucination prevention for Claude models.
141
+ * When enabled, injects:
142
+ * - Parameter signatures into tool descriptions
143
+ * - System instruction with strict tool usage rules
144
+ *
145
+ * This helps prevent Claude from using parameter names from its training
146
+ * data instead of the actual schema.
147
+ *
148
+ * @default true
149
+ */
150
+ claude_tool_hardening: z.ZodDefault<z.ZodBoolean>;
151
+ /**
152
+ * Enable proactive background token refresh.
153
+ * When enabled, tokens are refreshed in the background before they expire,
154
+ * ensuring requests never block on token refresh.
155
+ *
156
+ * @default true
157
+ */
158
+ proactive_token_refresh: z.ZodDefault<z.ZodBoolean>;
159
+ /**
160
+ * Seconds before token expiry to trigger proactive refresh.
161
+ * Default is 30 minutes (1800 seconds).
162
+ *
163
+ * @default 1800
164
+ */
165
+ proactive_refresh_buffer_seconds: z.ZodDefault<z.ZodNumber>;
166
+ /**
167
+ * Interval between proactive refresh checks in seconds.
168
+ * Default is 5 minutes (300 seconds).
169
+ *
170
+ * @default 300
171
+ */
172
+ proactive_refresh_check_interval_seconds: z.ZodDefault<z.ZodNumber>;
173
+ /**
174
+ * Maximum time in seconds to wait when all accounts are rate-limited.
175
+ * If the minimum wait time across all accounts exceeds this threshold,
176
+ * the plugin fails fast with an error instead of hanging.
177
+ *
178
+ * Set to 0 to disable (wait indefinitely).
179
+ *
180
+ * @default 300 (5 minutes)
181
+ */
182
+ max_rate_limit_wait_seconds: z.ZodDefault<z.ZodNumber>;
183
+ /**
184
+ * Enable quota fallback for Gemini models.
185
+ * When the preferred quota (gemini-cli or antigravity) is exhausted,
186
+ * try the alternate quota on the same account before switching accounts.
187
+ *
188
+ * Only applies when model is requested without explicit quota suffix.
189
+ * Explicit suffixes like `:antigravity` or `:gemini-cli` always use
190
+ * that specific quota and switch accounts if exhausted.
191
+ *
192
+ * @default false
193
+ */
194
+ quota_fallback: z.ZodDefault<z.ZodBoolean>;
195
+ /**
196
+ * Enable automatic plugin updates.
197
+ * @default true
198
+ */
199
+ auto_update: z.ZodDefault<z.ZodBoolean>;
200
+ }, "strip", z.ZodTypeAny, {
201
+ debug: boolean;
202
+ quiet_mode: boolean;
203
+ keep_thinking: boolean;
204
+ session_recovery: boolean;
205
+ auto_resume: boolean;
206
+ resume_text: string;
207
+ empty_response_max_attempts: number;
208
+ empty_response_retry_delay_ms: number;
209
+ tool_id_recovery: boolean;
210
+ claude_tool_hardening: boolean;
211
+ proactive_token_refresh: boolean;
212
+ proactive_refresh_buffer_seconds: number;
213
+ proactive_refresh_check_interval_seconds: number;
214
+ max_rate_limit_wait_seconds: number;
215
+ quota_fallback: boolean;
216
+ auto_update: boolean;
217
+ $schema?: string | undefined;
218
+ log_dir?: string | undefined;
219
+ signature_cache?: {
220
+ enabled: boolean;
221
+ memory_ttl_seconds: number;
222
+ disk_ttl_seconds: number;
223
+ write_interval_seconds: number;
224
+ } | undefined;
225
+ }, {
226
+ debug?: boolean | undefined;
227
+ $schema?: string | undefined;
228
+ quiet_mode?: boolean | undefined;
229
+ log_dir?: string | undefined;
230
+ keep_thinking?: boolean | undefined;
231
+ session_recovery?: boolean | undefined;
232
+ auto_resume?: boolean | undefined;
233
+ resume_text?: string | undefined;
234
+ signature_cache?: {
235
+ enabled?: boolean | undefined;
236
+ memory_ttl_seconds?: number | undefined;
237
+ disk_ttl_seconds?: number | undefined;
238
+ write_interval_seconds?: number | undefined;
239
+ } | undefined;
240
+ empty_response_max_attempts?: number | undefined;
241
+ empty_response_retry_delay_ms?: number | undefined;
242
+ tool_id_recovery?: boolean | undefined;
243
+ claude_tool_hardening?: boolean | undefined;
244
+ proactive_token_refresh?: boolean | undefined;
245
+ proactive_refresh_buffer_seconds?: number | undefined;
246
+ proactive_refresh_check_interval_seconds?: number | undefined;
247
+ max_rate_limit_wait_seconds?: number | undefined;
248
+ quota_fallback?: boolean | undefined;
249
+ auto_update?: boolean | undefined;
250
+ }>;
251
+ export type AntigravityConfig = z.infer<typeof AntigravityConfigSchema>;
252
+ export type SignatureCacheConfig = z.infer<typeof SignatureCacheConfigSchema>;
253
+ /**
254
+ * Default configuration values.
255
+ */
256
+ export declare const DEFAULT_CONFIG: AntigravityConfig;
257
+ //# 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;;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;;IAOH;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,iBAuB5B,CAAC"}