@reinamaccredy/oh-my-opencode 1.0.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.
Files changed (429) hide show
  1. package/LICENSE.md +82 -0
  2. package/README.ja.md +1107 -0
  3. package/README.md +1243 -0
  4. package/README.zh-cn.md +1107 -0
  5. package/dist/agents/build-prompt.d.ts +31 -0
  6. package/dist/agents/document-writer.d.ts +5 -0
  7. package/dist/agents/explore.d.ts +5 -0
  8. package/dist/agents/frontend-ui-ux-engineer.d.ts +5 -0
  9. package/dist/agents/index.d.ts +5 -0
  10. package/dist/agents/librarian.d.ts +5 -0
  11. package/dist/agents/metis.d.ts +18 -0
  12. package/dist/agents/momus.d.ts +6 -0
  13. package/dist/agents/multimodal-looker.d.ts +5 -0
  14. package/dist/agents/oracle.d.ts +5 -0
  15. package/dist/agents/orchestrator-sisyphus.d.ts +19 -0
  16. package/dist/agents/plan-prompt.d.ts +64 -0
  17. package/dist/agents/prometheus-prompt.d.ts +27 -0
  18. package/dist/agents/sisyphus-junior.d.ts +3 -0
  19. package/dist/agents/sisyphus-prompt-builder.d.ts +26 -0
  20. package/dist/agents/sisyphus.d.ts +4 -0
  21. package/dist/agents/types.d.ts +49 -0
  22. package/dist/agents/utils.d.ts +13 -0
  23. package/dist/agents/utils.test.d.ts +1 -0
  24. package/dist/auth/antigravity/accounts.d.ts +40 -0
  25. package/dist/auth/antigravity/accounts.test.d.ts +1 -0
  26. package/dist/auth/antigravity/browser.d.ts +27 -0
  27. package/dist/auth/antigravity/browser.test.d.ts +1 -0
  28. package/dist/auth/antigravity/cli.d.ts +2 -0
  29. package/dist/auth/antigravity/cli.test.d.ts +1 -0
  30. package/dist/auth/antigravity/constants.d.ts +98 -0
  31. package/dist/auth/antigravity/constants.test.d.ts +1 -0
  32. package/dist/auth/antigravity/fetch.d.ts +69 -0
  33. package/dist/auth/antigravity/index.d.ts +13 -0
  34. package/dist/auth/antigravity/integration.test.d.ts +10 -0
  35. package/dist/auth/antigravity/message-converter.d.ts +54 -0
  36. package/dist/auth/antigravity/oauth.d.ts +51 -0
  37. package/dist/auth/antigravity/oauth.test.d.ts +1 -0
  38. package/dist/auth/antigravity/plugin.d.ts +54 -0
  39. package/dist/auth/antigravity/project.d.ts +10 -0
  40. package/dist/auth/antigravity/request.d.ts +116 -0
  41. package/dist/auth/antigravity/request.test.d.ts +1 -0
  42. package/dist/auth/antigravity/response.d.ts +137 -0
  43. package/dist/auth/antigravity/storage.d.ts +5 -0
  44. package/dist/auth/antigravity/storage.test.d.ts +1 -0
  45. package/dist/auth/antigravity/thinking.d.ts +278 -0
  46. package/dist/auth/antigravity/thinking.test.d.ts +10 -0
  47. package/dist/auth/antigravity/thought-signature-store.d.ts +52 -0
  48. package/dist/auth/antigravity/token.d.ts +38 -0
  49. package/dist/auth/antigravity/token.test.d.ts +1 -0
  50. package/dist/auth/antigravity/tools.d.ts +119 -0
  51. package/dist/auth/antigravity/types.d.ts +229 -0
  52. package/dist/cli/commands/auth.d.ts +2 -0
  53. package/dist/cli/config-manager.d.ts +91 -0
  54. package/dist/cli/config-manager.test.d.ts +1 -0
  55. package/dist/cli/doctor/checks/auth.d.ts +7 -0
  56. package/dist/cli/doctor/checks/auth.test.d.ts +1 -0
  57. package/dist/cli/doctor/checks/config.d.ts +8 -0
  58. package/dist/cli/doctor/checks/config.test.d.ts +1 -0
  59. package/dist/cli/doctor/checks/dependencies.d.ts +8 -0
  60. package/dist/cli/doctor/checks/dependencies.test.d.ts +1 -0
  61. package/dist/cli/doctor/checks/gh.d.ts +13 -0
  62. package/dist/cli/doctor/checks/gh.test.d.ts +1 -0
  63. package/dist/cli/doctor/checks/index.d.ts +11 -0
  64. package/dist/cli/doctor/checks/lsp.d.ts +8 -0
  65. package/dist/cli/doctor/checks/lsp.test.d.ts +1 -0
  66. package/dist/cli/doctor/checks/mcp.d.ts +6 -0
  67. package/dist/cli/doctor/checks/mcp.test.d.ts +1 -0
  68. package/dist/cli/doctor/checks/opencode.d.ts +10 -0
  69. package/dist/cli/doctor/checks/opencode.test.d.ts +1 -0
  70. package/dist/cli/doctor/checks/plugin.d.ts +4 -0
  71. package/dist/cli/doctor/checks/plugin.test.d.ts +1 -0
  72. package/dist/cli/doctor/checks/version.d.ts +4 -0
  73. package/dist/cli/doctor/checks/version.test.d.ts +1 -0
  74. package/dist/cli/doctor/constants.d.ts +40 -0
  75. package/dist/cli/doctor/formatter.d.ts +12 -0
  76. package/dist/cli/doctor/formatter.test.d.ts +1 -0
  77. package/dist/cli/doctor/index.d.ts +5 -0
  78. package/dist/cli/doctor/runner.d.ts +7 -0
  79. package/dist/cli/doctor/runner.test.d.ts +1 -0
  80. package/dist/cli/doctor/types.d.ts +91 -0
  81. package/dist/cli/get-local-version/formatter.d.ts +3 -0
  82. package/dist/cli/get-local-version/index.d.ts +3 -0
  83. package/dist/cli/get-local-version/types.d.ts +13 -0
  84. package/dist/cli/index.d.ts +2 -0
  85. package/dist/cli/index.js +23604 -0
  86. package/dist/cli/install.d.ts +2 -0
  87. package/dist/cli/run/completion.d.ts +2 -0
  88. package/dist/cli/run/completion.test.d.ts +1 -0
  89. package/dist/cli/run/events.d.ts +11 -0
  90. package/dist/cli/run/events.test.d.ts +1 -0
  91. package/dist/cli/run/index.d.ts +2 -0
  92. package/dist/cli/run/runner.d.ts +2 -0
  93. package/dist/cli/run/types.d.ts +71 -0
  94. package/dist/cli/types.d.ts +27 -0
  95. package/dist/config/index.d.ts +2 -0
  96. package/dist/config/schema.d.ts +1914 -0
  97. package/dist/config/schema.test.d.ts +1 -0
  98. package/dist/features/background-agent/concurrency.d.ts +10 -0
  99. package/dist/features/background-agent/concurrency.test.d.ts +1 -0
  100. package/dist/features/background-agent/index.d.ts +3 -0
  101. package/dist/features/background-agent/manager.d.ts +55 -0
  102. package/dist/features/background-agent/manager.test.d.ts +1 -0
  103. package/dist/features/background-agent/types.d.ts +64 -0
  104. package/dist/features/boulder-state/constants.d.ts +10 -0
  105. package/dist/features/boulder-state/index.d.ts +3 -0
  106. package/dist/features/boulder-state/storage.d.ts +28 -0
  107. package/dist/features/boulder-state/storage.test.d.ts +1 -0
  108. package/dist/features/boulder-state/types.d.ts +24 -0
  109. package/dist/features/builtin-commands/commands.d.ts +2 -0
  110. package/dist/features/builtin-commands/index.d.ts +2 -0
  111. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -0
  112. package/dist/features/builtin-commands/templates/ralph-loop.d.ts +2 -0
  113. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -0
  114. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -0
  115. package/dist/features/builtin-commands/types.d.ts +6 -0
  116. package/dist/features/builtin-skills/index.d.ts +2 -0
  117. package/dist/features/builtin-skills/skills.d.ts +2 -0
  118. package/dist/features/builtin-skills/types.d.ts +15 -0
  119. package/dist/features/claude-code-agent-loader/index.d.ts +2 -0
  120. package/dist/features/claude-code-agent-loader/loader.d.ts +3 -0
  121. package/dist/features/claude-code-agent-loader/types.d.ts +14 -0
  122. package/dist/features/claude-code-command-loader/index.d.ts +2 -0
  123. package/dist/features/claude-code-command-loader/loader.d.ts +6 -0
  124. package/dist/features/claude-code-command-loader/types.d.ts +42 -0
  125. package/dist/features/claude-code-mcp-loader/env-expander.d.ts +2 -0
  126. package/dist/features/claude-code-mcp-loader/index.d.ts +10 -0
  127. package/dist/features/claude-code-mcp-loader/loader.d.ts +4 -0
  128. package/dist/features/claude-code-mcp-loader/loader.test.d.ts +1 -0
  129. package/dist/features/claude-code-mcp-loader/transformer.d.ts +2 -0
  130. package/dist/features/claude-code-mcp-loader/types.d.ts +35 -0
  131. package/dist/features/claude-code-plugin-loader/index.d.ts +3 -0
  132. package/dist/features/claude-code-plugin-loader/loader.d.ts +20 -0
  133. package/dist/features/claude-code-plugin-loader/types.d.ts +186 -0
  134. package/dist/features/claude-code-session-state/index.d.ts +1 -0
  135. package/dist/features/claude-code-session-state/state.d.ts +4 -0
  136. package/dist/features/context-injector/collector.d.ts +11 -0
  137. package/dist/features/context-injector/collector.test.d.ts +1 -0
  138. package/dist/features/context-injector/index.d.ts +3 -0
  139. package/dist/features/context-injector/injector.d.ts +39 -0
  140. package/dist/features/context-injector/injector.test.d.ts +1 -0
  141. package/dist/features/context-injector/types.d.ts +83 -0
  142. package/dist/features/hook-message-injector/constants.d.ts +3 -0
  143. package/dist/features/hook-message-injector/index.d.ts +4 -0
  144. package/dist/features/hook-message-injector/injector.d.ts +11 -0
  145. package/dist/features/hook-message-injector/types.d.ts +44 -0
  146. package/dist/features/opencode-skill-loader/async-loader.d.ts +6 -0
  147. package/dist/features/opencode-skill-loader/async-loader.test.d.ts +1 -0
  148. package/dist/features/opencode-skill-loader/blocking.d.ts +2 -0
  149. package/dist/features/opencode-skill-loader/blocking.test.d.ts +1 -0
  150. package/dist/features/opencode-skill-loader/discover-worker.d.ts +1 -0
  151. package/dist/features/opencode-skill-loader/index.d.ts +4 -0
  152. package/dist/features/opencode-skill-loader/loader.d.ts +16 -0
  153. package/dist/features/opencode-skill-loader/loader.test.d.ts +1 -0
  154. package/dist/features/opencode-skill-loader/merger.d.ts +7 -0
  155. package/dist/features/opencode-skill-loader/skill-content.d.ts +5 -0
  156. package/dist/features/opencode-skill-loader/skill-content.test.d.ts +1 -0
  157. package/dist/features/opencode-skill-loader/types.d.ts +34 -0
  158. package/dist/features/skill-mcp-manager/env-cleaner.d.ts +2 -0
  159. package/dist/features/skill-mcp-manager/env-cleaner.test.d.ts +1 -0
  160. package/dist/features/skill-mcp-manager/index.d.ts +2 -0
  161. package/dist/features/skill-mcp-manager/manager.d.ts +29 -0
  162. package/dist/features/skill-mcp-manager/manager.test.d.ts +1 -0
  163. package/dist/features/skill-mcp-manager/types.d.ts +11 -0
  164. package/dist/features/task-toast-manager/index.d.ts +2 -0
  165. package/dist/features/task-toast-manager/manager.d.ts +56 -0
  166. package/dist/features/task-toast-manager/manager.test.d.ts +1 -0
  167. package/dist/features/task-toast-manager/types.d.ts +16 -0
  168. package/dist/features/workflow-engine/adapters/index.d.ts +2 -0
  169. package/dist/features/workflow-engine/adapters/maestro/index.d.ts +43 -0
  170. package/dist/features/workflow-engine/adapters/sisyphus/index.d.ts +30 -0
  171. package/dist/features/workflow-engine/contracts/v1/contract.test.d.ts +1 -0
  172. package/dist/features/workflow-engine/contracts/v1/engine.contract.d.ts +27 -0
  173. package/dist/features/workflow-engine/contracts/v1/index.d.ts +2 -0
  174. package/dist/features/workflow-engine/contracts/v1/types.d.ts +337 -0
  175. package/dist/features/workflow-engine/engines/index.d.ts +1 -0
  176. package/dist/features/workflow-engine/engines/maestro-engine.d.ts +40 -0
  177. package/dist/features/workflow-engine/index.d.ts +4 -0
  178. package/dist/features/workflow-engine/service.d.ts +6 -0
  179. package/dist/google-auth.d.ts +3 -0
  180. package/dist/google-auth.js +3871 -0
  181. package/dist/hooks/agent-usage-reminder/constants.d.ts +5 -0
  182. package/dist/hooks/agent-usage-reminder/index.d.ts +22 -0
  183. package/dist/hooks/agent-usage-reminder/storage.d.ts +4 -0
  184. package/dist/hooks/agent-usage-reminder/types.d.ts +6 -0
  185. package/dist/hooks/anthropic-context-window-limit-recovery/executor.d.ts +4 -0
  186. package/dist/hooks/anthropic-context-window-limit-recovery/executor.test.d.ts +1 -0
  187. package/dist/hooks/anthropic-context-window-limit-recovery/index.d.ts +17 -0
  188. package/dist/hooks/anthropic-context-window-limit-recovery/parser.d.ts +2 -0
  189. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.d.ts +7 -0
  190. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-deduplication.test.d.ts +1 -0
  191. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-executor.d.ts +3 -0
  192. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-purge-errors.d.ts +7 -0
  193. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-storage.d.ts +2 -0
  194. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-supersede.d.ts +6 -0
  195. package/dist/hooks/anthropic-context-window-limit-recovery/pruning-types.d.ts +36 -0
  196. package/dist/hooks/anthropic-context-window-limit-recovery/storage.d.ts +28 -0
  197. package/dist/hooks/anthropic-context-window-limit-recovery/storage.test.d.ts +1 -0
  198. package/dist/hooks/anthropic-context-window-limit-recovery/types.d.ts +42 -0
  199. package/dist/hooks/auto-slash-command/constants.d.ts +5 -0
  200. package/dist/hooks/auto-slash-command/detector.d.ts +9 -0
  201. package/dist/hooks/auto-slash-command/detector.test.d.ts +1 -0
  202. package/dist/hooks/auto-slash-command/executor.d.ts +11 -0
  203. package/dist/hooks/auto-slash-command/index.d.ts +12 -0
  204. package/dist/hooks/auto-slash-command/index.test.d.ts +1 -0
  205. package/dist/hooks/auto-slash-command/types.d.ts +27 -0
  206. package/dist/hooks/auto-update-checker/cache.d.ts +3 -0
  207. package/dist/hooks/auto-update-checker/checker.d.ts +20 -0
  208. package/dist/hooks/auto-update-checker/constants.d.ts +13 -0
  209. package/dist/hooks/auto-update-checker/index.d.ts +13 -0
  210. package/dist/hooks/auto-update-checker/types.d.ts +25 -0
  211. package/dist/hooks/background-notification/index.d.ts +12 -0
  212. package/dist/hooks/background-notification/types.d.ts +4 -0
  213. package/dist/hooks/claude-code-hooks/config-loader.d.ts +13 -0
  214. package/dist/hooks/claude-code-hooks/config.d.ts +3 -0
  215. package/dist/hooks/claude-code-hooks/index.d.ts +48 -0
  216. package/dist/hooks/claude-code-hooks/plugin-config.d.ts +8 -0
  217. package/dist/hooks/claude-code-hooks/post-tool-use.d.ts +40 -0
  218. package/dist/hooks/claude-code-hooks/pre-compact.d.ts +16 -0
  219. package/dist/hooks/claude-code-hooks/pre-tool-use.d.ts +25 -0
  220. package/dist/hooks/claude-code-hooks/stop.d.ts +20 -0
  221. package/dist/hooks/claude-code-hooks/todo.d.ts +12 -0
  222. package/dist/hooks/claude-code-hooks/tool-input-cache.d.ts +5 -0
  223. package/dist/hooks/claude-code-hooks/transcript.d.ts +38 -0
  224. package/dist/hooks/claude-code-hooks/types.d.ts +183 -0
  225. package/dist/hooks/claude-code-hooks/user-prompt-submit.d.ts +22 -0
  226. package/dist/hooks/comment-checker/cli.d.ts +53 -0
  227. package/dist/hooks/comment-checker/constants.d.ts +3 -0
  228. package/dist/hooks/comment-checker/downloader.d.ts +25 -0
  229. package/dist/hooks/comment-checker/filters/bdd.d.ts +2 -0
  230. package/dist/hooks/comment-checker/filters/directive.d.ts +2 -0
  231. package/dist/hooks/comment-checker/filters/docstring.d.ts +2 -0
  232. package/dist/hooks/comment-checker/filters/index.d.ts +7 -0
  233. package/dist/hooks/comment-checker/filters/shebang.d.ts +2 -0
  234. package/dist/hooks/comment-checker/index.d.ts +19 -0
  235. package/dist/hooks/comment-checker/output/formatter.d.ts +2 -0
  236. package/dist/hooks/comment-checker/output/index.d.ts +2 -0
  237. package/dist/hooks/comment-checker/output/xml-builder.d.ts +2 -0
  238. package/dist/hooks/comment-checker/types.d.ts +31 -0
  239. package/dist/hooks/compaction-context-injector/index.d.ts +2 -0
  240. package/dist/hooks/context-window-monitor.d.ts +18 -0
  241. package/dist/hooks/directory-agents-injector/constants.d.ts +3 -0
  242. package/dist/hooks/directory-agents-injector/index.d.ts +26 -0
  243. package/dist/hooks/directory-agents-injector/storage.d.ts +3 -0
  244. package/dist/hooks/directory-agents-injector/types.d.ts +5 -0
  245. package/dist/hooks/directory-readme-injector/constants.d.ts +3 -0
  246. package/dist/hooks/directory-readme-injector/index.d.ts +26 -0
  247. package/dist/hooks/directory-readme-injector/storage.d.ts +3 -0
  248. package/dist/hooks/directory-readme-injector/types.d.ts +5 -0
  249. package/dist/hooks/edit-error-recovery/index.d.ts +31 -0
  250. package/dist/hooks/edit-error-recovery/index.test.d.ts +1 -0
  251. package/dist/hooks/empty-message-sanitizer/index.d.ts +12 -0
  252. package/dist/hooks/empty-task-response-detector.d.ts +12 -0
  253. package/dist/hooks/index.d.ts +30 -0
  254. package/dist/hooks/interactive-bash-session/constants.d.ts +4 -0
  255. package/dist/hooks/interactive-bash-session/index.d.ts +23 -0
  256. package/dist/hooks/interactive-bash-session/storage.d.ts +4 -0
  257. package/dist/hooks/interactive-bash-session/types.d.ts +10 -0
  258. package/dist/hooks/keyword-detector/constants.d.ts +12 -0
  259. package/dist/hooks/keyword-detector/detector.d.ts +11 -0
  260. package/dist/hooks/keyword-detector/index.d.ts +22 -0
  261. package/dist/hooks/keyword-detector/index.test.d.ts +1 -0
  262. package/dist/hooks/keyword-detector/types.d.ts +4 -0
  263. package/dist/hooks/non-interactive-env/constants.d.ts +34 -0
  264. package/dist/hooks/non-interactive-env/detector.d.ts +1 -0
  265. package/dist/hooks/non-interactive-env/index.d.ts +14 -0
  266. package/dist/hooks/non-interactive-env/index.test.d.ts +1 -0
  267. package/dist/hooks/non-interactive-env/types.d.ts +3 -0
  268. package/dist/hooks/preemptive-compaction/constants.d.ts +3 -0
  269. package/dist/hooks/preemptive-compaction/index.d.ts +24 -0
  270. package/dist/hooks/preemptive-compaction/types.d.ts +17 -0
  271. package/dist/hooks/prometheus-md-only/constants.d.ts +6 -0
  272. package/dist/hooks/prometheus-md-only/index.d.ts +12 -0
  273. package/dist/hooks/prometheus-md-only/index.test.d.ts +1 -0
  274. package/dist/hooks/ralph-loop/constants.d.ts +5 -0
  275. package/dist/hooks/ralph-loop/index.d.ts +20 -0
  276. package/dist/hooks/ralph-loop/index.test.d.ts +1 -0
  277. package/dist/hooks/ralph-loop/storage.d.ts +6 -0
  278. package/dist/hooks/ralph-loop/types.d.ts +16 -0
  279. package/dist/hooks/rules-injector/constants.d.ts +8 -0
  280. package/dist/hooks/rules-injector/finder.d.ts +33 -0
  281. package/dist/hooks/rules-injector/finder.test.d.ts +1 -0
  282. package/dist/hooks/rules-injector/index.d.ts +26 -0
  283. package/dist/hooks/rules-injector/matcher.d.ts +21 -0
  284. package/dist/hooks/rules-injector/parser.d.ts +18 -0
  285. package/dist/hooks/rules-injector/parser.test.d.ts +1 -0
  286. package/dist/hooks/rules-injector/storage.d.ts +9 -0
  287. package/dist/hooks/rules-injector/types.d.ts +54 -0
  288. package/dist/hooks/session-notification-utils.d.ts +9 -0
  289. package/dist/hooks/session-notification.d.ts +20 -0
  290. package/dist/hooks/session-notification.test.d.ts +1 -0
  291. package/dist/hooks/session-recovery/constants.d.ts +6 -0
  292. package/dist/hooks/session-recovery/index.d.ts +22 -0
  293. package/dist/hooks/session-recovery/index.test.d.ts +1 -0
  294. package/dist/hooks/session-recovery/storage.d.ts +19 -0
  295. package/dist/hooks/session-recovery/types.d.ts +90 -0
  296. package/dist/hooks/sisyphus-orchestrator/index.d.ts +35 -0
  297. package/dist/hooks/sisyphus-orchestrator/index.test.d.ts +1 -0
  298. package/dist/hooks/start-work/index.d.ts +16 -0
  299. package/dist/hooks/start-work/index.test.d.ts +1 -0
  300. package/dist/hooks/task-resume-info/index.d.ts +11 -0
  301. package/dist/hooks/think-mode/detector.d.ts +5 -0
  302. package/dist/hooks/think-mode/index.d.ts +14 -0
  303. package/dist/hooks/think-mode/index.test.d.ts +1 -0
  304. package/dist/hooks/think-mode/switcher.d.ts +57 -0
  305. package/dist/hooks/think-mode/switcher.test.d.ts +1 -0
  306. package/dist/hooks/think-mode/types.d.ts +21 -0
  307. package/dist/hooks/thinking-block-validator/index.d.ts +30 -0
  308. package/dist/hooks/todo-continuation-enforcer.d.ts +17 -0
  309. package/dist/hooks/todo-continuation-enforcer.test.d.ts +1 -0
  310. package/dist/hooks/tool-output-truncator.d.ts +17 -0
  311. package/dist/hooks/tool-output-truncator.test.d.ts +1 -0
  312. package/dist/index.d.ts +5 -0
  313. package/dist/index.js +56428 -0
  314. package/dist/mcp/context7.d.ts +5 -0
  315. package/dist/mcp/grep-app.d.ts +5 -0
  316. package/dist/mcp/index.d.ts +8 -0
  317. package/dist/mcp/index.test.d.ts +1 -0
  318. package/dist/mcp/types.d.ts +9 -0
  319. package/dist/mcp/websearch.d.ts +8 -0
  320. package/dist/plugin-config.d.ts +4 -0
  321. package/dist/plugin-handlers/config-handler.d.ts +10 -0
  322. package/dist/plugin-handlers/index.d.ts +1 -0
  323. package/dist/plugin-state.d.ts +6 -0
  324. package/dist/shared/claude-config-dir.d.ts +1 -0
  325. package/dist/shared/claude-config-dir.test.d.ts +1 -0
  326. package/dist/shared/command-executor.d.ts +21 -0
  327. package/dist/shared/config-errors.d.ts +7 -0
  328. package/dist/shared/config-path.d.ts +17 -0
  329. package/dist/shared/data-path.d.ts +14 -0
  330. package/dist/shared/deep-merge.d.ts +13 -0
  331. package/dist/shared/dynamic-truncator.d.ts +27 -0
  332. package/dist/shared/external-plugin-detector.d.ts +18 -0
  333. package/dist/shared/external-plugin-detector.test.d.ts +1 -0
  334. package/dist/shared/file-reference-resolver.d.ts +1 -0
  335. package/dist/shared/file-utils.d.ts +7 -0
  336. package/dist/shared/frontmatter.d.ts +7 -0
  337. package/dist/shared/frontmatter.test.d.ts +1 -0
  338. package/dist/shared/hook-disabled.d.ts +2 -0
  339. package/dist/shared/index.d.ts +22 -0
  340. package/dist/shared/jsonc-parser.d.ts +15 -0
  341. package/dist/shared/jsonc-parser.test.d.ts +1 -0
  342. package/dist/shared/logger.d.ts +2 -0
  343. package/dist/shared/migration.d.ts +17 -0
  344. package/dist/shared/migration.test.d.ts +1 -0
  345. package/dist/shared/model-sanitizer.d.ts +3 -0
  346. package/dist/shared/opencode-config-dir.d.ts +19 -0
  347. package/dist/shared/opencode-config-dir.test.d.ts +1 -0
  348. package/dist/shared/opencode-version.d.ts +10 -0
  349. package/dist/shared/opencode-version.test.d.ts +1 -0
  350. package/dist/shared/pattern-matcher.d.ts +3 -0
  351. package/dist/shared/permission-compat.d.ts +12 -0
  352. package/dist/shared/permission-compat.test.d.ts +1 -0
  353. package/dist/shared/snake-case.d.ts +4 -0
  354. package/dist/shared/tool-name.d.ts +1 -0
  355. package/dist/tools/ast-grep/cli.d.ts +15 -0
  356. package/dist/tools/ast-grep/constants.d.ts +29 -0
  357. package/dist/tools/ast-grep/downloader.d.ts +5 -0
  358. package/dist/tools/ast-grep/index.d.ts +8 -0
  359. package/dist/tools/ast-grep/napi.d.ts +13 -0
  360. package/dist/tools/ast-grep/tools.d.ts +3 -0
  361. package/dist/tools/ast-grep/types.d.ts +58 -0
  362. package/dist/tools/ast-grep/utils.d.ts +5 -0
  363. package/dist/tools/background-task/constants.d.ts +3 -0
  364. package/dist/tools/background-task/index.d.ts +3 -0
  365. package/dist/tools/background-task/tools.d.ts +7 -0
  366. package/dist/tools/background-task/types.d.ts +14 -0
  367. package/dist/tools/call-omo-agent/constants.d.ts +2 -0
  368. package/dist/tools/call-omo-agent/index.d.ts +3 -0
  369. package/dist/tools/call-omo-agent/tools.d.ts +3 -0
  370. package/dist/tools/call-omo-agent/types.d.ts +24 -0
  371. package/dist/tools/glob/cli.d.ts +7 -0
  372. package/dist/tools/glob/constants.d.ts +6 -0
  373. package/dist/tools/glob/index.d.ts +2 -0
  374. package/dist/tools/glob/tools.d.ts +2 -0
  375. package/dist/tools/glob/types.d.ts +19 -0
  376. package/dist/tools/glob/utils.d.ts +2 -0
  377. package/dist/tools/grep/cli.d.ts +3 -0
  378. package/dist/tools/grep/constants.d.ts +17 -0
  379. package/dist/tools/grep/downloader.d.ts +3 -0
  380. package/dist/tools/grep/downloader.test.d.ts +1 -0
  381. package/dist/tools/grep/index.d.ts +2 -0
  382. package/dist/tools/grep/tools.d.ts +2 -0
  383. package/dist/tools/grep/types.d.ts +36 -0
  384. package/dist/tools/grep/utils.d.ts +3 -0
  385. package/dist/tools/index.d.ts +14 -0
  386. package/dist/tools/interactive-bash/constants.d.ts +3 -0
  387. package/dist/tools/interactive-bash/index.d.ts +3 -0
  388. package/dist/tools/interactive-bash/tools.d.ts +7 -0
  389. package/dist/tools/interactive-bash/types.d.ts +3 -0
  390. package/dist/tools/interactive-bash/utils.d.ts +3 -0
  391. package/dist/tools/look-at/constants.d.ts +2 -0
  392. package/dist/tools/look-at/index.d.ts +3 -0
  393. package/dist/tools/look-at/tools.d.ts +2 -0
  394. package/dist/tools/look-at/types.d.ts +4 -0
  395. package/dist/tools/lsp/client.d.ts +59 -0
  396. package/dist/tools/lsp/config.d.ts +17 -0
  397. package/dist/tools/lsp/constants.d.ts +9 -0
  398. package/dist/tools/lsp/index.d.ts +6 -0
  399. package/dist/tools/lsp/tools.d.ts +12 -0
  400. package/dist/tools/lsp/types.d.ts +156 -0
  401. package/dist/tools/lsp/utils.d.ts +29 -0
  402. package/dist/tools/session-manager/constants.d.ts +12 -0
  403. package/dist/tools/session-manager/index.d.ts +3 -0
  404. package/dist/tools/session-manager/storage.d.ts +12 -0
  405. package/dist/tools/session-manager/storage.test.d.ts +1 -0
  406. package/dist/tools/session-manager/tools.d.ts +5 -0
  407. package/dist/tools/session-manager/tools.test.d.ts +1 -0
  408. package/dist/tools/session-manager/types.d.ts +89 -0
  409. package/dist/tools/session-manager/utils.d.ts +11 -0
  410. package/dist/tools/session-manager/utils.test.d.ts +1 -0
  411. package/dist/tools/sisyphus-task/constants.d.ts +12 -0
  412. package/dist/tools/sisyphus-task/index.d.ts +3 -0
  413. package/dist/tools/sisyphus-task/tools.d.ts +16 -0
  414. package/dist/tools/sisyphus-task/tools.test.d.ts +1 -0
  415. package/dist/tools/sisyphus-task/types.d.ts +9 -0
  416. package/dist/tools/skill/constants.d.ts +3 -0
  417. package/dist/tools/skill/index.d.ts +3 -0
  418. package/dist/tools/skill/tools.d.ts +10 -0
  419. package/dist/tools/skill/tools.test.d.ts +1 -0
  420. package/dist/tools/skill/types.d.ts +25 -0
  421. package/dist/tools/skill-mcp/constants.d.ts +2 -0
  422. package/dist/tools/skill-mcp/index.d.ts +3 -0
  423. package/dist/tools/skill-mcp/tools.d.ts +11 -0
  424. package/dist/tools/skill-mcp/tools.test.d.ts +1 -0
  425. package/dist/tools/skill-mcp/types.d.ts +8 -0
  426. package/dist/tools/slashcommand/index.d.ts +2 -0
  427. package/dist/tools/slashcommand/tools.d.ts +11 -0
  428. package/dist/tools/slashcommand/types.d.ts +24 -0
  429. package/package.json +83 -0
@@ -0,0 +1,40 @@
1
+ import { type AccountStorage, type AccountTier, type AntigravityRefreshParts, type ModelFamily, type RateLimitState } from "./types";
2
+ export interface ManagedAccount {
3
+ index: number;
4
+ parts: AntigravityRefreshParts;
5
+ access?: string;
6
+ expires?: number;
7
+ rateLimits: RateLimitState;
8
+ lastUsed: number;
9
+ email?: string;
10
+ tier?: AccountTier;
11
+ }
12
+ interface AuthDetails {
13
+ refresh: string;
14
+ access: string;
15
+ expires: number;
16
+ }
17
+ interface OAuthAuthDetails {
18
+ type: "oauth";
19
+ refresh: string;
20
+ access: string;
21
+ expires: number;
22
+ }
23
+ export declare class AccountManager {
24
+ private accounts;
25
+ private currentIndex;
26
+ private activeIndex;
27
+ constructor(auth: AuthDetails, storedAccounts?: AccountStorage | null);
28
+ getAccountCount(): number;
29
+ getCurrentAccount(): ManagedAccount | null;
30
+ getAccounts(): ManagedAccount[];
31
+ getCurrentOrNextForFamily(family: ModelFamily): ManagedAccount | null;
32
+ getNextForFamily(family: ModelFamily): ManagedAccount | null;
33
+ markRateLimited(account: ManagedAccount, retryAfterMs: number, family: ModelFamily): void;
34
+ clearExpiredRateLimits(account: ManagedAccount): void;
35
+ addAccount(parts: AntigravityRefreshParts, access?: string, expires?: number, email?: string, tier?: AccountTier): void;
36
+ removeAccount(index: number): boolean;
37
+ save(path?: string): Promise<void>;
38
+ toAuthDetails(): OAuthAuthDetails;
39
+ }
40
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Cross-platform browser opening utility.
3
+ * Uses the "open" npm package for reliable cross-platform support.
4
+ *
5
+ * Supports: macOS, Windows, Linux (including WSL)
6
+ */
7
+ /**
8
+ * Opens a URL in the user's default browser.
9
+ *
10
+ * Cross-platform support:
11
+ * - macOS: uses `open` command
12
+ * - Windows: uses `start` command
13
+ * - Linux: uses `xdg-open` command
14
+ * - WSL: uses Windows PowerShell
15
+ *
16
+ * @param url - The URL to open in the browser
17
+ * @returns Promise<boolean> - true if browser opened successfully, false otherwise
18
+ *
19
+ * @example
20
+ * ```typescript
21
+ * const success = await openBrowserURL("https://accounts.google.com/oauth...")
22
+ * if (!success) {
23
+ * console.log("Please open this URL manually:", url)
24
+ * }
25
+ * ```
26
+ */
27
+ export declare function openBrowserURL(url: string): Promise<boolean>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ export declare function promptAddAnotherAccount(currentCount: number): Promise<boolean>;
2
+ export declare function promptAccountTier(): Promise<"free" | "paid">;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,98 @@
1
+ /**
2
+ * Antigravity OAuth configuration constants.
3
+ * Values sourced from cliproxyapi/sdk/auth/antigravity.go
4
+ *
5
+ * ## Logging Policy
6
+ *
7
+ * All console logging in antigravity modules follows a consistent policy:
8
+ *
9
+ * - **Debug logs**: Guard with `if (process.env.ANTIGRAVITY_DEBUG === "1")`
10
+ * - Includes: info messages, warnings, non-fatal errors
11
+ * - Enable debugging: `ANTIGRAVITY_DEBUG=1 opencode`
12
+ *
13
+ * - **Fatal errors**: None currently. All errors are handled by returning
14
+ * appropriate error responses to OpenCode's auth system.
15
+ *
16
+ * This policy ensures production silence while enabling verbose debugging
17
+ * when needed for troubleshooting OAuth flows.
18
+ */
19
+ export declare const ANTIGRAVITY_CLIENT_ID = "1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com";
20
+ export declare const ANTIGRAVITY_CLIENT_SECRET = "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";
21
+ export declare const ANTIGRAVITY_CALLBACK_PORT = 51121;
22
+ export declare const ANTIGRAVITY_REDIRECT_URI = "http://localhost:51121/oauth-callback";
23
+ export declare const ANTIGRAVITY_SCOPES: readonly ["https://www.googleapis.com/auth/cloud-platform", "https://www.googleapis.com/auth/userinfo.email", "https://www.googleapis.com/auth/userinfo.profile", "https://www.googleapis.com/auth/cclog", "https://www.googleapis.com/auth/experimentsandconfigs"];
24
+ export declare const ANTIGRAVITY_ENDPOINT_FALLBACKS: readonly ["https://daily-cloudcode-pa.sandbox.googleapis.com", "https://daily-cloudcode-pa.googleapis.com", "https://cloudcode-pa.googleapis.com"];
25
+ export declare const ANTIGRAVITY_API_VERSION = "v1internal";
26
+ export declare const ANTIGRAVITY_HEADERS: {
27
+ readonly "User-Agent": "google-api-nodejs-client/9.15.1";
28
+ readonly "X-Goog-Api-Client": "google-cloud-sdk vscode_cloudshelleditor/0.1";
29
+ readonly "Client-Metadata": string;
30
+ };
31
+ export declare const ANTIGRAVITY_DEFAULT_PROJECT_ID = "rising-fact-p41fc";
32
+ export declare const GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth";
33
+ export declare const GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token";
34
+ export declare const GOOGLE_USERINFO_URL = "https://www.googleapis.com/oauth2/v1/userinfo";
35
+ export declare const ANTIGRAVITY_TOKEN_REFRESH_BUFFER_MS = 60000;
36
+ export declare const SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator";
37
+ export declare const ANTIGRAVITY_SYSTEM_PROMPT = "<identity>\nYou are Antigravity, a powerful agentic AI coding assistant designed by the Google Deepmind team working on Advanced Agentic Coding.\nYou are pair programming with a USER to solve their coding task. The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.\nThe USER will send you requests, which you must always prioritize addressing. Along with each USER request, we will attach additional metadata about their current state, such as what files they have open and where their cursor is.\nThis information may or may not be relevant to the coding task, it is up for you to decide.\n</identity>\n\n<tool_calling>\nCall tools as you normally would. The following list provides additional guidance to help you avoid errors:\n - **Absolute paths only**. When using tools that accept file path arguments, ALWAYS use the absolute file path.\n</tool_calling>\n\n<web_application_development>\n## Technology Stack\nYour web applications should be built using the following technologies:\n1. **Core**: Use HTML for structure and Javascript for logic.\n2. **Styling (CSS)**: Use Vanilla CSS for maximum flexibility and control. Avoid using TailwindCSS unless the USER explicitly requests it; in this case, first confirm which TailwindCSS version to use.\n3. **Web App**: If the USER specifies that they want a more complex web app, use a framework like Next.js or Vite. Only do this if the USER explicitly requests a web app.\n4. **New Project Creation**: If you need to use a framework for a new app, use `npx` with the appropriate script, but there are some rules to follow:\n - Use `npx -y` to automatically install the script and its dependencies\n - You MUST run the command with `--help` flag to see all available options first\n - Initialize the app in the current directory with `./` (example: `npx -y create-vite-app@latest ./`)\n</web_application_development>\n";
38
+ /**
39
+ * Maps reasoning_effort UI values to thinking budget tokens.
40
+ *
41
+ * Key notes:
42
+ * - `none: 0` is a sentinel value meaning "delete thinkingConfig entirely"
43
+ * - `auto: -1` triggers dynamic budget calculation based on context
44
+ * - All other values represent actual thinking budget in tokens
45
+ */
46
+ export declare const REASONING_EFFORT_BUDGET_MAP: Record<string, number>;
47
+ /**
48
+ * Model-specific thinking configuration.
49
+ *
50
+ * thinkingType:
51
+ * - "numeric": Uses thinkingBudget (number) - Gemini 2.5, Claude via Antigravity
52
+ * - "levels": Uses thinkingLevel (string) - Gemini 3
53
+ *
54
+ * zeroAllowed:
55
+ * - true: Budget can be 0 (thinking disabled)
56
+ * - false: Minimum budget enforced (cannot disable thinking)
57
+ */
58
+ export interface AntigravityModelConfig {
59
+ thinkingType: "numeric" | "levels";
60
+ min: number;
61
+ max: number;
62
+ zeroAllowed: boolean;
63
+ levels?: string[];
64
+ }
65
+ /**
66
+ * Thinking configuration per model.
67
+ * Keys are normalized model IDs (no provider prefix, no variant suffix).
68
+ *
69
+ * Config lookup uses pattern matching fallback:
70
+ * - includes("gemini-3") → Gemini 3 (levels)
71
+ * - includes("gemini-2.5") → Gemini 2.5 (numeric)
72
+ * - includes("claude") → Claude via Antigravity (numeric)
73
+ */
74
+ export declare const ANTIGRAVITY_MODEL_CONFIGS: Record<string, AntigravityModelConfig>;
75
+ /**
76
+ * Normalizes model ID for config lookup.
77
+ *
78
+ * Algorithm:
79
+ * 1. Strip provider prefix (e.g., "google/")
80
+ * 2. Strip "antigravity-" prefix
81
+ * 3. Strip UI variant suffixes (-high, -low, -thinking-*)
82
+ *
83
+ * Examples:
84
+ * - "google/antigravity-gemini-3-pro-high" → "gemini-3-pro"
85
+ * - "antigravity-gemini-3-flash-preview" → "gemini-3-flash-preview"
86
+ * - "gemini-2.5-flash" → "gemini-2.5-flash"
87
+ * - "gemini-claude-sonnet-4-5-thinking-high" → "gemini-claude-sonnet-4-5"
88
+ */
89
+ export declare function normalizeModelId(model: string): string;
90
+ export declare const ANTIGRAVITY_SUPPORTED_MODELS: readonly ["gemini-2.5-flash", "gemini-2.5-flash-lite", "gemini-2.5-computer-use-preview-10-2025", "gemini-3-pro-preview", "gemini-3-flash-preview", "gemini-claude-sonnet-4-5-thinking", "gemini-claude-opus-4-5-thinking"];
91
+ /**
92
+ * Converts UI model names to Antigravity API model names.
93
+ *
94
+ * NOTE: Tested 2026-01-08 - Gemini 3 models work with -preview suffix directly.
95
+ * The CLIProxyAPI transformations (gemini-3-pro-high, gemini-3-flash) return 404.
96
+ * Claude models return 404 on all endpoints (may require special access/quota).
97
+ */
98
+ export declare function alias2ModelName(modelName: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Antigravity Fetch Interceptor
3
+ *
4
+ * Creates a custom fetch function that:
5
+ * - Checks token expiration and auto-refreshes
6
+ * - Rewrites URLs to Antigravity endpoints
7
+ * - Applies request transformation (including tool normalization)
8
+ * - Applies response transformation (including thinking extraction)
9
+ * - Implements endpoint fallback (daily → autopush → prod)
10
+ *
11
+ * **Body Type Assumption:**
12
+ * This interceptor assumes `init.body` is a JSON string (OpenAI format).
13
+ * Non-string bodies (ReadableStream, Blob, FormData, URLSearchParams, etc.)
14
+ * are passed through unchanged to the original fetch to avoid breaking
15
+ * other requests that may not be OpenAI-format API calls.
16
+ *
17
+ * Debug logging available via ANTIGRAVITY_DEBUG=1 environment variable.
18
+ */
19
+ import { AccountManager } from "./accounts";
20
+ /**
21
+ * Auth interface matching OpenCode's auth system
22
+ */
23
+ interface Auth {
24
+ access?: string;
25
+ refresh?: string;
26
+ expires?: number;
27
+ }
28
+ /**
29
+ * Client interface for auth operations
30
+ */
31
+ interface AuthClient {
32
+ set(providerId: string, auth: Auth): Promise<void>;
33
+ }
34
+ /**
35
+ * Create Antigravity fetch interceptor
36
+ *
37
+ * Factory function that creates a custom fetch function for Antigravity API.
38
+ * Handles token management, request/response transformation, and endpoint fallback.
39
+ *
40
+ * @param getAuth - Async function to retrieve current auth state
41
+ * @param client - Auth client for saving updated tokens
42
+ * @param providerId - Provider identifier (e.g., "google")
43
+ * @param clientId - Optional custom client ID for token refresh (defaults to ANTIGRAVITY_CLIENT_ID)
44
+ * @param clientSecret - Optional custom client secret for token refresh (defaults to ANTIGRAVITY_CLIENT_SECRET)
45
+ * @returns Custom fetch function compatible with standard fetch signature
46
+ *
47
+ * @example
48
+ * ```typescript
49
+ * const customFetch = createAntigravityFetch(
50
+ * () => auth(),
51
+ * client,
52
+ * "google",
53
+ * "custom-client-id",
54
+ * "custom-client-secret"
55
+ * )
56
+ *
57
+ * // Use like standard fetch
58
+ * const response = await customFetch("https://api.example.com/chat", {
59
+ * method: "POST",
60
+ * body: JSON.stringify({ messages: [...] })
61
+ * })
62
+ * ```
63
+ */
64
+ export declare function createAntigravityFetch(getAuth: () => Promise<Auth>, client: AuthClient, providerId: string, clientId?: string, clientSecret?: string, accountManager?: AccountManager | null): (url: string, init?: RequestInit) => Promise<Response>;
65
+ /**
66
+ * Type export for createAntigravityFetch return type
67
+ */
68
+ export type AntigravityFetch = (url: string, init?: RequestInit) => Promise<Response>;
69
+ export {};
@@ -0,0 +1,13 @@
1
+ export * from "./types";
2
+ export * from "./constants";
3
+ export * from "./oauth";
4
+ export * from "./token";
5
+ export * from "./project";
6
+ export * from "./request";
7
+ export * from "./response";
8
+ export * from "./tools";
9
+ export * from "./thinking";
10
+ export * from "./thought-signature-store";
11
+ export * from "./message-converter";
12
+ export * from "./fetch";
13
+ export * from "./plugin";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Antigravity Integration Tests - End-to-End
3
+ *
4
+ * Tests the complete request transformation pipeline:
5
+ * - Request parsing and model extraction
6
+ * - System prompt injection (handled by transformRequest)
7
+ * - Thinking config application (handled by applyThinkingConfigToRequest)
8
+ * - Body wrapping for Antigravity API format
9
+ */
10
+ export {};
@@ -0,0 +1,54 @@
1
+ /**
2
+ * OpenAI → Gemini message format converter
3
+ *
4
+ * Converts OpenAI-style messages to Gemini contents format,
5
+ * injecting thoughtSignature into functionCall parts.
6
+ */
7
+ interface OpenAIMessage {
8
+ role: "system" | "user" | "assistant" | "tool";
9
+ content?: string | OpenAIContentPart[];
10
+ tool_calls?: OpenAIToolCall[];
11
+ tool_call_id?: string;
12
+ name?: string;
13
+ }
14
+ interface OpenAIContentPart {
15
+ type: string;
16
+ text?: string;
17
+ image_url?: {
18
+ url: string;
19
+ };
20
+ [key: string]: unknown;
21
+ }
22
+ interface OpenAIToolCall {
23
+ id: string;
24
+ type: "function";
25
+ function: {
26
+ name: string;
27
+ arguments: string;
28
+ };
29
+ }
30
+ interface GeminiPart {
31
+ text?: string;
32
+ functionCall?: {
33
+ name: string;
34
+ args: Record<string, unknown>;
35
+ };
36
+ functionResponse?: {
37
+ name: string;
38
+ response: Record<string, unknown>;
39
+ };
40
+ inlineData?: {
41
+ mimeType: string;
42
+ data: string;
43
+ };
44
+ thought_signature?: string;
45
+ [key: string]: unknown;
46
+ }
47
+ interface GeminiContent {
48
+ role: "user" | "model";
49
+ parts: GeminiPart[];
50
+ }
51
+ export declare function convertOpenAIToGemini(messages: OpenAIMessage[], thoughtSignature?: string): GeminiContent[];
52
+ export declare function hasOpenAIMessages(body: Record<string, unknown>): boolean;
53
+ export declare function convertRequestBody(body: Record<string, unknown>, thoughtSignature?: string): Record<string, unknown>;
54
+ export {};
@@ -0,0 +1,51 @@
1
+ import type { AntigravityTokenExchangeResult, AntigravityUserInfo } from "./types";
2
+ /**
3
+ * Result from building an OAuth authorization URL.
4
+ */
5
+ export interface AuthorizationResult {
6
+ /** Full OAuth URL to open in browser */
7
+ url: string;
8
+ /** State for CSRF protection */
9
+ state: string;
10
+ }
11
+ /**
12
+ * Result from the OAuth callback server.
13
+ */
14
+ export interface CallbackResult {
15
+ /** Authorization code from Google */
16
+ code: string;
17
+ /** State parameter from callback */
18
+ state: string;
19
+ /** Error message if any */
20
+ error?: string;
21
+ }
22
+ export declare function buildAuthURL(projectId?: string, clientId?: string, port?: number): Promise<AuthorizationResult>;
23
+ /**
24
+ * Exchange authorization code for tokens.
25
+ *
26
+ * @param code - Authorization code from OAuth callback
27
+ * @param redirectUri - OAuth redirect URI
28
+ * @param clientId - Optional custom client ID (defaults to ANTIGRAVITY_CLIENT_ID)
29
+ * @param clientSecret - Optional custom client secret (defaults to ANTIGRAVITY_CLIENT_SECRET)
30
+ * @returns Token exchange result with access and refresh tokens
31
+ */
32
+ export declare function exchangeCode(code: string, redirectUri: string, clientId?: string, clientSecret?: string): Promise<AntigravityTokenExchangeResult>;
33
+ /**
34
+ * Fetch user info from Google's userinfo API.
35
+ *
36
+ * @param accessToken - Valid access token
37
+ * @returns User info containing email
38
+ */
39
+ export declare function fetchUserInfo(accessToken: string): Promise<AntigravityUserInfo>;
40
+ export interface CallbackServerHandle {
41
+ port: number;
42
+ redirectUri: string;
43
+ waitForCallback: () => Promise<CallbackResult>;
44
+ close: () => void;
45
+ }
46
+ export declare function startCallbackServer(timeoutMs?: number): CallbackServerHandle;
47
+ export declare function performOAuthFlow(projectId?: string, openBrowser?: (url: string) => Promise<void>, clientId?: string, clientSecret?: string): Promise<{
48
+ tokens: AntigravityTokenExchangeResult;
49
+ userInfo: AntigravityUserInfo;
50
+ state: string;
51
+ }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Google Antigravity Auth Plugin for OpenCode
3
+ *
4
+ * Provides OAuth authentication for Google models via Antigravity API.
5
+ * This plugin integrates with OpenCode's auth system to enable:
6
+ * - OAuth 2.0 with PKCE flow for Google authentication
7
+ * - Automatic token refresh
8
+ * - Request/response transformation for Antigravity API
9
+ *
10
+ * @example
11
+ * ```json
12
+ * // opencode.json
13
+ * {
14
+ * "plugin": ["oh-my-opencode"],
15
+ * "provider": {
16
+ * "google": {
17
+ * "options": {
18
+ * "clientId": "custom-client-id",
19
+ * "clientSecret": "custom-client-secret"
20
+ * }
21
+ * }
22
+ * }
23
+ * }
24
+ * ```
25
+ */
26
+ import type { AuthHook, PluginInput } from "@opencode-ai/plugin";
27
+ /**
28
+ * Creates the Google Antigravity OAuth plugin for OpenCode.
29
+ *
30
+ * This factory function creates an auth plugin that:
31
+ * 1. Provides OAuth flow for Google authentication
32
+ * 2. Creates a custom fetch interceptor for Antigravity API
33
+ * 3. Handles token management and refresh
34
+ *
35
+ * @param input - Plugin input containing the OpenCode client
36
+ * @returns Hooks object with auth configuration
37
+ *
38
+ * @example
39
+ * ```typescript
40
+ * // Used by OpenCode automatically when plugin is loaded
41
+ * const hooks = await createGoogleAntigravityAuthPlugin({ client, ... })
42
+ * ```
43
+ */
44
+ export declare function createGoogleAntigravityAuthPlugin({ client, }: PluginInput): Promise<{
45
+ auth: AuthHook;
46
+ }>;
47
+ /**
48
+ * Default export for OpenCode plugin system
49
+ */
50
+ export default createGoogleAntigravityAuthPlugin;
51
+ /**
52
+ * Named export for explicit imports
53
+ */
54
+ export declare const GoogleAntigravityAuthPlugin: typeof createGoogleAntigravityAuthPlugin;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Antigravity project context management.
3
+ * Handles fetching GCP project ID via Google's loadCodeAssist API.
4
+ * For FREE tier users, onboards via onboardUser API to get server-assigned managed project ID.
5
+ * Reference: https://github.com/shekohex/opencode-google-antigravity-auth
6
+ */
7
+ import type { AntigravityProjectContext } from "./types";
8
+ export declare function fetchProjectContext(accessToken: string): Promise<AntigravityProjectContext>;
9
+ export declare function clearProjectContextCache(accessToken?: string): void;
10
+ export declare function invalidateProjectContextByRefreshToken(_refreshToken: string): void;
@@ -0,0 +1,116 @@
1
+ /**
2
+ * Antigravity request transformer.
3
+ * Transforms OpenAI-format requests to Antigravity format.
4
+ * Does NOT handle tool normalization (handled by tools.ts in Task 9).
5
+ */
6
+ import type { AntigravityRequestBody } from "./types";
7
+ /**
8
+ * Result of request transformation including URL, headers, and body.
9
+ */
10
+ export interface TransformedRequest {
11
+ /** Transformed URL for Antigravity API */
12
+ url: string;
13
+ /** Request headers including Authorization and Antigravity-specific headers */
14
+ headers: Record<string, string>;
15
+ /** Transformed request body in Antigravity format */
16
+ body: AntigravityRequestBody;
17
+ /** Whether this is a streaming request */
18
+ streaming: boolean;
19
+ }
20
+ /**
21
+ * Build Antigravity-specific request headers.
22
+ * Includes Authorization, User-Agent, X-Goog-Api-Client, and Client-Metadata.
23
+ *
24
+ * @param accessToken - OAuth access token for Authorization header
25
+ * @returns Headers object with all required Antigravity headers
26
+ */
27
+ export declare function buildRequestHeaders(accessToken: string): Record<string, string>;
28
+ /**
29
+ * Extract model name from request body.
30
+ * OpenAI-format requests include model in the body.
31
+ *
32
+ * @param body - Request body that may contain a model field
33
+ * @returns Model name or undefined if not found
34
+ */
35
+ export declare function extractModelFromBody(body: Record<string, unknown>): string | undefined;
36
+ /**
37
+ * Extract model name from URL path.
38
+ * Handles Google Generative Language API format: /models/{model}:{action}
39
+ *
40
+ * @param url - Request URL to parse
41
+ * @returns Model name or undefined if not found
42
+ */
43
+ export declare function extractModelFromUrl(url: string): string | undefined;
44
+ /**
45
+ * Determine the action type from the URL path.
46
+ * E.g., generateContent, streamGenerateContent
47
+ *
48
+ * @param url - Request URL to parse
49
+ * @returns Action name or undefined if not found
50
+ */
51
+ export declare function extractActionFromUrl(url: string): string | undefined;
52
+ /**
53
+ * Check if a URL is targeting Google's Generative Language API.
54
+ *
55
+ * @param url - URL to check
56
+ * @returns true if this is a Google Generative Language API request
57
+ */
58
+ export declare function isGenerativeLanguageRequest(url: string): boolean;
59
+ /**
60
+ * Build Antigravity API URL for the given action.
61
+ *
62
+ * @param baseEndpoint - Base Antigravity endpoint URL (from fallbacks)
63
+ * @param action - API action (e.g., generateContent, streamGenerateContent)
64
+ * @param streaming - Whether to append SSE query parameter
65
+ * @returns Formatted Antigravity API URL
66
+ */
67
+ export declare function buildAntigravityUrl(baseEndpoint: string, action: string, streaming: boolean): string;
68
+ /**
69
+ * Get the first available Antigravity endpoint.
70
+ * Can be used with fallback logic in fetch.ts.
71
+ *
72
+ * @returns Default (first) Antigravity endpoint
73
+ */
74
+ export declare function getDefaultEndpoint(): string;
75
+ /**
76
+ * Inject ANTIGRAVITY_SYSTEM_PROMPT into request.systemInstruction.
77
+ * Prepends Antigravity prompt before any existing systemInstruction.
78
+ * Prevents duplicate injection by checking for <identity> marker.
79
+ *
80
+ * CRITICAL: Modifies wrappedBody.request.systemInstruction (NOT outer body!)
81
+ *
82
+ * @param wrappedBody - The wrapped request body with request field
83
+ */
84
+ export declare function injectSystemPrompt(wrappedBody: {
85
+ request?: unknown;
86
+ }): void;
87
+ export declare function wrapRequestBody(body: Record<string, unknown>, projectId: string, modelName: string, sessionId: string): AntigravityRequestBody;
88
+ export declare function injectThoughtSignatureIntoFunctionCalls(body: Record<string, unknown>, signature: string | undefined): Record<string, unknown>;
89
+ /**
90
+ * Detect if request is for streaming.
91
+ * Checks both action name and request body for stream flag.
92
+ *
93
+ * @param url - Request URL
94
+ * @param body - Request body
95
+ * @returns true if streaming is requested
96
+ */
97
+ export declare function isStreamingRequest(url: string, body: Record<string, unknown>): boolean;
98
+ export interface TransformRequestOptions {
99
+ url: string;
100
+ body: Record<string, unknown>;
101
+ accessToken: string;
102
+ projectId: string;
103
+ sessionId: string;
104
+ modelName?: string;
105
+ endpointOverride?: string;
106
+ thoughtSignature?: string;
107
+ }
108
+ export declare function transformRequest(options: TransformRequestOptions): TransformedRequest;
109
+ /**
110
+ * Prepare request headers for streaming responses.
111
+ * Adds Accept header for SSE format.
112
+ *
113
+ * @param headers - Existing headers object
114
+ * @returns Headers with streaming support
115
+ */
116
+ export declare function addStreamingHeaders(headers: Record<string, string>): Record<string, string>;
@@ -0,0 +1 @@
1
+ export {};