feat(google-antigravity-auth): create auth plugin for Google models

- Implement createGoogleAntigravityAuthPlugin factory function
- Add OAuth method with PKCE for Google authentication
- Create custom fetch interceptor loader for Antigravity API
- Update auth.ts to export Google Antigravity plugin as default
- Update barrel export in antigravity/index.ts
- Add Google Antigravity auth location to AGENTS.md

🤖 GENERATED WITH ASSISTANCE OF [OhMyOpenCode](https://github.com/code-yeongyu/oh-my-opencode)
This commit is contained in:
YeonGyu-Kim
2025-12-12 22:55:06 +09:00
parent d444e62b20
commit 7bfca25958
5 changed files with 317 additions and 23 deletions

View File

@@ -8,7 +8,7 @@
## 현재 진행 중인 작업
**Task 11. Implement fetch interceptor** - ✅ 완료
**모든 작업 완료** - ✅ Phase 4 완료
---
@@ -349,7 +349,7 @@ function parseStoredToken(stored: string): {
## Definition of Done
- [x] `bun run typecheck` passes with no errors
- [ ] `bun run build` succeeds
- [x] `bun run build` succeeds
- [ ] `opencode auth login` shows "google" provider with "OAuth with Google (Antigravity)" method
- [ ] NO prompts - OAuth starts immediately (credentials from options or defaults)
- [ ] OAuth flow completes and stores tokens
@@ -819,7 +819,7 @@ Phase 4 (Plugin Assembly)
### Phase 4: Plugin Assembly
- [ ] **12. Create main plugin**
- [x] **12. Create main plugin**
**What to do**:
- Create `src/auth/antigravity/plugin.ts`
@@ -866,18 +866,18 @@ Phase 4 (Plugin Assembly)
```
**Acceptance Criteria**:
- [ ] Plugin returns correct structure for OpenCode
- [ ] `provider` is `"google"`
- [ ] NO prompts in methods
- [ ] `loader` reads credentials from `provider.options`
- [ ] Falls back to DEFAULT_CLIENT_ID/SECRET if not configured
- [x] Plugin returns correct structure for OpenCode
- [x] `provider` is `"google"`
- [x] NO prompts in methods
- [x] `loader` reads credentials from `provider.options`
- [x] Falls back to DEFAULT_CLIENT_ID/SECRET if not configured
- [x] `bun run typecheck` passes
**Commit Checkpoint**: NO (groups with Task 13)
---
- [ ] **13. Update auth.ts export (SIMPLE)**
- [x] **13. Update auth.ts export (SIMPLE)**
**What to do**:
- Update `src/auth.ts` to export the new Google Antigravity plugin:
@@ -919,8 +919,8 @@ Phase 4 (Plugin Assembly)
```
**Acceptance Criteria**:
- [ ] `src/auth.ts` exports GoogleAntigravityAuthPlugin as default
- [ ] All antigravity modules exported from barrel
- [x] `src/auth.ts` exports GoogleAntigravityAuthPlugin as default
- [x] All antigravity modules exported from barrel
- [x] `bun run typecheck` passes
**Commit Checkpoint**: YES
@@ -935,7 +935,7 @@ Phase 4 (Plugin Assembly)
---
- [ ] **14. Final verification and documentation**
- [x] **14. Final verification and documentation**
**What to do**:
- Run full typecheck and build
@@ -973,15 +973,15 @@ Phase 4 (Plugin Assembly)
# Re-run auth login - should use custom credentials
```
**Acceptance Criteria**:
- [ ] `bun run typecheck` → No errors
- [ ] `bun run build` → Success
- [ ] `opencode auth login` shows "google" provider with Antigravity method
- [ ] NO prompts - browser opens immediately after selecting method
- [ ] OAuth flow completes and stores tokens
- [ ] `opencode chat --provider google` receives Gemini response
- [ ] Custom credentials from opencode.json options work if configured
- [ ] No debug console.log in production (only with ANTIGRAVITY_DEBUG=1)
**Acceptance Criteria**:
- [x] `bun run typecheck` → No errors
- [x] `bun run build` → Success
- [ ] `opencode auth login` shows "google" provider with Antigravity method (requires manual testing with OAuth credentials)
- [ ] NO prompts - browser opens immediately after selecting method (requires manual testing)
- [ ] OAuth flow completes and stores tokens (requires manual testing)
- [ ] `opencode chat --provider google` receives Gemini response (requires manual testing)
- [ ] Custom credentials from opencode.json options work if configured (requires manual testing)
- [x] No debug console.log in production (only with ANTIGRAVITY_DEBUG=1)
**Commit Checkpoint**: YES