oh-my-opencode 2.14.0 → 3.0.0-beta.1

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 (84) hide show
  1. package/README.ja.md +70 -14
  2. package/README.md +163 -34
  3. package/README.zh-cn.md +67 -14
  4. package/dist/agents/metis.d.ts +18 -0
  5. package/dist/agents/momus.d.ts +6 -0
  6. package/dist/agents/orchestrator-sisyphus.d.ts +19 -0
  7. package/dist/agents/plan-prompt.d.ts +8 -5
  8. package/dist/agents/prometheus-prompt.d.ts +27 -0
  9. package/dist/agents/sisyphus-junior.d.ts +3 -0
  10. package/dist/agents/types.d.ts +1 -1
  11. package/dist/agents/utils.d.ts +4 -1
  12. package/dist/auth/antigravity/accounts.d.ts +40 -0
  13. package/dist/auth/antigravity/accounts.test.d.ts +1 -0
  14. package/dist/auth/antigravity/browser.d.ts +27 -0
  15. package/dist/auth/antigravity/browser.test.d.ts +1 -0
  16. package/dist/auth/antigravity/cli.d.ts +2 -0
  17. package/dist/auth/antigravity/cli.test.d.ts +1 -0
  18. package/dist/auth/antigravity/constants.d.ts +63 -1
  19. package/dist/auth/antigravity/constants.test.d.ts +1 -0
  20. package/dist/auth/antigravity/fetch.d.ts +2 -1
  21. package/dist/auth/antigravity/integration.test.d.ts +10 -0
  22. package/dist/auth/antigravity/oauth.d.ts +6 -40
  23. package/dist/auth/antigravity/oauth.test.d.ts +1 -0
  24. package/dist/auth/antigravity/request.d.ts +12 -0
  25. package/dist/auth/antigravity/request.test.d.ts +1 -0
  26. package/dist/auth/antigravity/storage.d.ts +5 -0
  27. package/dist/auth/antigravity/storage.test.d.ts +1 -0
  28. package/dist/auth/antigravity/thinking.d.ts +45 -1
  29. package/dist/auth/antigravity/thinking.test.d.ts +10 -0
  30. package/dist/auth/antigravity/token.test.d.ts +1 -0
  31. package/dist/auth/antigravity/types.d.ts +29 -5
  32. package/dist/cli/commands/auth.d.ts +2 -0
  33. package/dist/cli/index.js +334 -115
  34. package/dist/config/schema.d.ts +269 -6
  35. package/dist/features/background-agent/manager.d.ts +13 -1
  36. package/dist/features/background-agent/types.d.ts +26 -1
  37. package/dist/features/boulder-state/constants.d.ts +10 -0
  38. package/dist/features/boulder-state/index.d.ts +3 -0
  39. package/dist/features/boulder-state/storage.d.ts +28 -0
  40. package/dist/features/boulder-state/storage.test.d.ts +1 -0
  41. package/dist/features/boulder-state/types.d.ts +24 -0
  42. package/dist/features/builtin-commands/templates/init-deep.d.ts +1 -1
  43. package/dist/features/builtin-commands/templates/refactor.d.ts +1 -1
  44. package/dist/features/builtin-commands/templates/start-work.d.ts +1 -0
  45. package/dist/features/builtin-commands/types.d.ts +1 -1
  46. package/dist/features/hook-message-injector/injector.d.ts +2 -2
  47. package/dist/features/hook-message-injector/types.d.ts +3 -2
  48. package/dist/features/opencode-skill-loader/index.d.ts +1 -0
  49. package/dist/features/opencode-skill-loader/skill-content.d.ts +5 -0
  50. package/dist/features/opencode-skill-loader/skill-content.test.d.ts +1 -0
  51. package/dist/features/task-toast-manager/index.d.ts +2 -0
  52. package/dist/features/task-toast-manager/manager.d.ts +56 -0
  53. package/dist/features/task-toast-manager/manager.test.d.ts +1 -0
  54. package/dist/features/task-toast-manager/types.d.ts +16 -0
  55. package/dist/google-auth.js +2167 -161
  56. package/dist/hooks/agent-usage-reminder/constants.d.ts +1 -1
  57. package/dist/hooks/claude-code-hooks/index.d.ts +2 -1
  58. package/dist/hooks/claude-code-hooks/types.d.ts +1 -0
  59. package/dist/hooks/index.d.ts +4 -0
  60. package/dist/hooks/prometheus-md-only/constants.d.ts +6 -0
  61. package/dist/hooks/prometheus-md-only/index.d.ts +12 -0
  62. package/dist/hooks/prometheus-md-only/index.test.d.ts +1 -0
  63. package/dist/hooks/sisyphus-orchestrator/index.d.ts +35 -0
  64. package/dist/hooks/sisyphus-orchestrator/index.test.d.ts +1 -0
  65. package/dist/hooks/start-work/index.d.ts +16 -0
  66. package/dist/hooks/start-work/index.test.d.ts +1 -0
  67. package/dist/hooks/task-resume-info/index.d.ts +11 -0
  68. package/dist/hooks/todo-continuation-enforcer.d.ts +1 -0
  69. package/dist/index.js +12017 -3545
  70. package/dist/mcp/index.d.ts +4 -2
  71. package/dist/mcp/websearch.d.ts +3 -0
  72. package/dist/shared/external-plugin-detector.d.ts +18 -0
  73. package/dist/shared/external-plugin-detector.test.d.ts +1 -0
  74. package/dist/shared/index.d.ts +1 -0
  75. package/dist/shared/migration.d.ts +6 -0
  76. package/dist/tools/background-task/index.d.ts +1 -1
  77. package/dist/tools/call-omo-agent/constants.d.ts +1 -1
  78. package/dist/tools/index.d.ts +1 -0
  79. package/dist/tools/sisyphus-task/constants.d.ts +12 -0
  80. package/dist/tools/sisyphus-task/index.d.ts +3 -0
  81. package/dist/tools/sisyphus-task/tools.d.ts +16 -0
  82. package/dist/tools/sisyphus-task/tools.test.d.ts +1 -0
  83. package/dist/tools/sisyphus-task/types.d.ts +9 -0
  84. package/package.json +3 -2
@@ -1,33 +1,12 @@
1
1
  import type { AntigravityTokenExchangeResult, AntigravityUserInfo } from "./types";
2
- /**
3
- * PKCE pair containing verifier and challenge.
4
- */
5
- export interface PKCEPair {
6
- /** PKCE verifier - used during token exchange */
7
- verifier: string;
8
- /** PKCE challenge - sent in auth URL */
9
- challenge: string;
10
- /** Challenge method - always "S256" */
11
- method: string;
12
- }
13
- /**
14
- * OAuth state encoded in the auth URL.
15
- * Contains the PKCE verifier for later retrieval.
16
- */
17
- export interface OAuthState {
18
- /** PKCE verifier */
19
- verifier: string;
20
- /** Optional project ID */
21
- projectId?: string;
22
- }
23
2
  /**
24
3
  * Result from building an OAuth authorization URL.
25
4
  */
26
5
  export interface AuthorizationResult {
27
6
  /** Full OAuth URL to open in browser */
28
7
  url: string;
29
- /** PKCE verifier to use during code exchange */
30
- verifier: string;
8
+ /** State for CSRF protection */
9
+ state: string;
31
10
  }
32
11
  /**
33
12
  * Result from the OAuth callback server.
@@ -40,31 +19,17 @@ export interface CallbackResult {
40
19
  /** Error message if any */
41
20
  error?: string;
42
21
  }
43
- /**
44
- * Generate PKCE verifier and challenge pair.
45
- * Uses @openauthjs/openauth for cryptographically secure generation.
46
- *
47
- * @returns PKCE pair with verifier, challenge, and method
48
- */
49
- export declare function generatePKCEPair(): Promise<PKCEPair>;
50
- /**
51
- * Decode OAuth state from a base64 string.
52
- *
53
- * @param encoded - Base64URL or Base64 encoded state
54
- * @returns Decoded OAuth state
55
- */
56
- export declare function decodeState(encoded: string): OAuthState;
57
22
  export declare function buildAuthURL(projectId?: string, clientId?: string, port?: number): Promise<AuthorizationResult>;
58
23
  /**
59
24
  * Exchange authorization code for tokens.
60
25
  *
61
26
  * @param code - Authorization code from OAuth callback
62
- * @param verifier - PKCE verifier from initial auth request
27
+ * @param redirectUri - OAuth redirect URI
63
28
  * @param clientId - Optional custom client ID (defaults to ANTIGRAVITY_CLIENT_ID)
64
29
  * @param clientSecret - Optional custom client secret (defaults to ANTIGRAVITY_CLIENT_SECRET)
65
30
  * @returns Token exchange result with access and refresh tokens
66
31
  */
67
- export declare function exchangeCode(code: string, verifier: string, clientId?: string, clientSecret?: string, port?: number): Promise<AntigravityTokenExchangeResult>;
32
+ export declare function exchangeCode(code: string, redirectUri: string, clientId?: string, clientSecret?: string): Promise<AntigravityTokenExchangeResult>;
68
33
  /**
69
34
  * Fetch user info from Google's userinfo API.
70
35
  *
@@ -74,6 +39,7 @@ export declare function exchangeCode(code: string, verifier: string, clientId?:
74
39
  export declare function fetchUserInfo(accessToken: string): Promise<AntigravityUserInfo>;
75
40
  export interface CallbackServerHandle {
76
41
  port: number;
42
+ redirectUri: string;
77
43
  waitForCallback: () => Promise<CallbackResult>;
78
44
  close: () => void;
79
45
  }
@@ -81,5 +47,5 @@ export declare function startCallbackServer(timeoutMs?: number): CallbackServerH
81
47
  export declare function performOAuthFlow(projectId?: string, openBrowser?: (url: string) => Promise<void>, clientId?: string, clientSecret?: string): Promise<{
82
48
  tokens: AntigravityTokenExchangeResult;
83
49
  userInfo: AntigravityUserInfo;
84
- verifier: string;
50
+ state: string;
85
51
  }>;
@@ -0,0 +1 @@
1
+ export {};
@@ -72,6 +72,18 @@ export declare function buildAntigravityUrl(baseEndpoint: string, action: string
72
72
  * @returns Default (first) Antigravity endpoint
73
73
  */
74
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;
75
87
  export declare function wrapRequestBody(body: Record<string, unknown>, projectId: string, modelName: string, sessionId: string): AntigravityRequestBody;
76
88
  export declare function injectThoughtSignatureIntoFunctionCalls(body: Record<string, unknown>, signature: string | undefined): Record<string, unknown>;
77
89
  /**
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { AccountStorage } from "./types";
2
+ export declare function getDataDir(): string;
3
+ export declare function getStoragePath(): string;
4
+ export declare function loadAccounts(path?: string): Promise<AccountStorage | null>;
5
+ export declare function saveAccounts(storage: AccountStorage, path?: string): Promise<void>;
@@ -0,0 +1 @@
1
+ export {};
@@ -12,6 +12,7 @@
12
12
  *
13
13
  * Note: This is Gemini-only. Claude models are NOT handled by Antigravity.
14
14
  */
15
+ import { type AntigravityModelConfig } from "./constants";
15
16
  /**
16
17
  * Represents a single thinking/reasoning block extracted from Gemini response
17
18
  */
@@ -212,13 +213,14 @@ export declare function normalizeThinkingConfig(config: unknown): ThinkingConfig
212
213
  * Extract thinking configuration from request payload
213
214
  *
214
215
  * Supports both Gemini-style thinkingConfig and Anthropic-style thinking options.
216
+ * Also supports reasoning_effort parameter which maps to thinking budget/level.
215
217
  *
216
218
  * @param requestPayload - Request body
217
219
  * @param generationConfig - Generation config from request
218
220
  * @param extraBody - Extra body options
219
221
  * @returns Extracted thinking configuration or undefined
220
222
  */
221
- export declare function extractThinkingConfig(requestPayload: Record<string, unknown>, generationConfig?: Record<string, unknown>, extraBody?: Record<string, unknown>): ThinkingConfig | undefined;
223
+ export declare function extractThinkingConfig(requestPayload: Record<string, unknown>, generationConfig?: Record<string, unknown>, extraBody?: Record<string, unknown>): ThinkingConfig | DeleteThinkingConfig | undefined;
222
224
  /**
223
225
  * Resolve final thinking configuration based on model and context
224
226
  *
@@ -232,3 +234,45 @@ export declare function extractThinkingConfig(requestPayload: Record<string, unk
232
234
  * @returns Final thinking configuration
233
235
  */
234
236
  export declare function resolveThinkingConfig(userConfig: ThinkingConfig | undefined, isThinkingModel: boolean, isClaudeModel: boolean, hasAssistantHistory: boolean): ThinkingConfig | undefined;
237
+ /**
238
+ * Get thinking config for a model by normalized ID.
239
+ * Uses pattern matching fallback if exact match not found.
240
+ *
241
+ * @param model - Model identifier string (with or without provider prefix)
242
+ * @returns Thinking configuration or undefined if not found
243
+ */
244
+ export declare function getModelThinkingConfig(model: string): AntigravityModelConfig | undefined;
245
+ /**
246
+ * Type for the delete thinking config marker.
247
+ * Used when reasoning_effort is "none" to signal complete removal.
248
+ */
249
+ export interface DeleteThinkingConfig {
250
+ deleteThinkingConfig: true;
251
+ }
252
+ /**
253
+ * Union type for thinking configuration input.
254
+ */
255
+ export type ThinkingConfigInput = ThinkingConfig | DeleteThinkingConfig;
256
+ /**
257
+ * Convert thinking budget to closest level string for Gemini 3 models.
258
+ *
259
+ * @param budget - Thinking budget in tokens
260
+ * @param model - Model identifier
261
+ * @returns Level string ("low", "high", etc.) or "medium" fallback
262
+ */
263
+ export declare function budgetToLevel(budget: number, model: string): string;
264
+ /**
265
+ * Apply thinking config to request body.
266
+ *
267
+ * CRITICAL: Sets request.generationConfig.thinkingConfig (NOT outer body!)
268
+ *
269
+ * Handles:
270
+ * - Gemini 3: Sets thinkingLevel (string)
271
+ * - Gemini 2.5: Sets thinkingBudget (number)
272
+ * - Delete marker: Removes thinkingConfig entirely
273
+ *
274
+ * @param requestBody - Request body to modify (mutates in place)
275
+ * @param model - Model identifier
276
+ * @param config - Thinking configuration or delete marker
277
+ */
278
+ export declare function applyThinkingConfigToRequest(requestBody: Record<string, unknown>, model: string, config: ThinkingConfigInput): void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Tests for reasoning_effort and Gemini 3 thinkingLevel support.
3
+ *
4
+ * Tests the following functions:
5
+ * - getModelThinkingConfig()
6
+ * - extractThinkingConfig() with reasoning_effort
7
+ * - applyThinkingConfigToRequest()
8
+ * - budgetToLevel()
9
+ */
10
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -78,15 +78,11 @@ export interface AntigravityOnboardUserPayload {
78
78
  * Wraps the actual request with project and model context
79
79
  */
80
80
  export interface AntigravityRequestBody {
81
- /** GCP project ID */
82
81
  project: string;
83
- /** Model identifier (e.g., "gemini-3-pro-preview") */
84
82
  model: string;
85
- /** User agent identifier */
86
83
  userAgent: string;
87
- /** Unique request ID */
84
+ requestType: string;
88
85
  requestId: string;
89
- /** The actual request payload */
90
86
  request: Record<string, unknown>;
91
87
  }
92
88
  /**
@@ -203,3 +199,31 @@ export interface ParsedOAuthError {
203
199
  code?: string;
204
200
  description?: string;
205
201
  }
202
+ /**
203
+ * Multi-account support types
204
+ */
205
+ /** All model families for rate limit tracking */
206
+ export declare const MODEL_FAMILIES: readonly ["claude", "gemini-flash", "gemini-pro"];
207
+ /** Model family for rate limit tracking */
208
+ export type ModelFamily = (typeof MODEL_FAMILIES)[number];
209
+ /** Account tier for prioritization */
210
+ export type AccountTier = "free" | "paid";
211
+ /** Rate limit state per model family (Unix timestamps in ms) */
212
+ export type RateLimitState = Partial<Record<ModelFamily, number>>;
213
+ /** Account metadata for storage */
214
+ export interface AccountMetadata {
215
+ email: string;
216
+ tier: AccountTier;
217
+ refreshToken: string;
218
+ projectId: string;
219
+ managedProjectId?: string;
220
+ accessToken: string;
221
+ expiresAt: number;
222
+ rateLimits: RateLimitState;
223
+ }
224
+ /** Storage schema for persisting multiple accounts */
225
+ export interface AccountStorage {
226
+ version: number;
227
+ accounts: AccountMetadata[];
228
+ activeIndex: number;
229
+ }
@@ -0,0 +1,2 @@
1
+ export declare function listAccounts(): Promise<number>;
2
+ export declare function removeAccount(indexOrEmail: string): Promise<number>;