@cortexkit/opencode-antigravity-auth 1.1.0 → 2.0.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.
- package/README.md +225 -569
- package/dist/cli.js +4017 -0
- package/dist/cli.js.map +7 -0
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20742 -14586
- package/dist/index.js.map +4 -4
- package/dist/src/antigravity/oauth.d.ts +1 -1
- package/dist/src/antigravity/oauth.js +1 -1
- package/dist/src/cli.d.ts +21 -0
- package/dist/src/cli.d.ts.map +1 -0
- package/dist/src/cli.js +237 -0
- package/dist/src/cli.js.map +1 -0
- package/dist/src/constants.d.ts +1 -1
- package/dist/src/constants.js +1 -1
- package/dist/src/hooks/auto-update-checker/cache.d.ts.map +1 -1
- package/dist/src/hooks/auto-update-checker/cache.js +13 -13
- package/dist/src/hooks/auto-update-checker/cache.js.map +1 -1
- package/dist/src/hooks/auto-update-checker/checker.d.ts +1 -1
- package/dist/src/hooks/auto-update-checker/checker.d.ts.map +1 -1
- package/dist/src/hooks/auto-update-checker/checker.js +75 -51
- package/dist/src/hooks/auto-update-checker/checker.js.map +1 -1
- package/dist/src/hooks/auto-update-checker/constants.d.ts.map +1 -1
- package/dist/src/hooks/auto-update-checker/constants.js +12 -12
- package/dist/src/hooks/auto-update-checker/constants.js.map +1 -1
- package/dist/src/hooks/auto-update-checker/index.d.ts +6 -6
- package/dist/src/hooks/auto-update-checker/index.d.ts.map +1 -1
- package/dist/src/hooks/auto-update-checker/index.js +17 -17
- package/dist/src/hooks/auto-update-checker/index.js.map +1 -1
- package/dist/src/hooks/auto-update-checker/logging.js +2 -2
- package/dist/src/hooks/auto-update-checker/logging.js.map +1 -1
- package/dist/src/hooks/auto-update-checker/types.d.ts.map +1 -1
- package/dist/src/plugin/account-access.d.ts +99 -0
- package/dist/src/plugin/account-access.d.ts.map +1 -0
- package/dist/src/plugin/account-access.js +480 -0
- package/dist/src/plugin/account-access.js.map +1 -0
- package/dist/src/plugin/account-command-oauth.d.ts +34 -0
- package/dist/src/plugin/account-command-oauth.d.ts.map +1 -0
- package/dist/src/plugin/account-command-oauth.js +156 -0
- package/dist/src/plugin/account-command-oauth.js.map +1 -0
- package/dist/src/plugin/accounts.d.ts +7 -256
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +31 -1367
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/agy-request-metadata.d.ts +1 -1
- package/dist/src/plugin/agy-request-metadata.js +1 -1
- package/dist/src/plugin/agy-transport.d.ts +1 -1
- package/dist/src/plugin/agy-transport.js +1 -1
- package/dist/src/plugin/auth-doctor.d.ts +6 -6
- package/dist/src/plugin/auth-doctor.d.ts.map +1 -1
- package/dist/src/plugin/auth-doctor.js +74 -66
- package/dist/src/plugin/auth-doctor.js.map +1 -1
- package/dist/src/plugin/auth-drift.d.ts +4 -4
- package/dist/src/plugin/auth-drift.d.ts.map +1 -1
- package/dist/src/plugin/auth-drift.js +15 -15
- package/dist/src/plugin/auth-drift.js.map +1 -1
- package/dist/src/plugin/auth-loader.d.ts +50 -0
- package/dist/src/plugin/auth-loader.d.ts.map +1 -0
- package/dist/src/plugin/auth-loader.js +225 -0
- package/dist/src/plugin/auth-loader.js.map +1 -0
- package/dist/src/plugin/auth.d.ts +1 -1
- package/dist/src/plugin/auth.js +1 -1
- package/dist/src/plugin/background-quota-refresh.d.ts +146 -0
- package/dist/src/plugin/background-quota-refresh.d.ts.map +1 -0
- package/dist/src/plugin/background-quota-refresh.js +347 -0
- package/dist/src/plugin/background-quota-refresh.js.map +1 -0
- package/dist/src/plugin/cache/index.d.ts +1 -1
- package/dist/src/plugin/cache/index.d.ts.map +1 -1
- package/dist/src/plugin/cache/index.js +1 -1
- package/dist/src/plugin/cache/index.js.map +1 -1
- package/dist/src/plugin/cache/signature-cache.d.ts +1 -1
- package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
- package/dist/src/plugin/cache/signature-cache.js +23 -24
- package/dist/src/plugin/cache/signature-cache.js.map +1 -1
- package/dist/src/plugin/cache.d.ts +6 -5
- package/dist/src/plugin/cache.d.ts.map +1 -1
- package/dist/src/plugin/cache.js +21 -7
- package/dist/src/plugin/cache.js.map +1 -1
- package/dist/src/plugin/catalog.d.ts +23 -0
- package/dist/src/plugin/catalog.d.ts.map +1 -0
- package/dist/src/plugin/catalog.js +60 -0
- package/dist/src/plugin/catalog.js.map +1 -0
- package/dist/src/plugin/cli.d.ts +7 -7
- package/dist/src/plugin/cli.d.ts.map +1 -1
- package/dist/src/plugin/cli.js +62 -55
- package/dist/src/plugin/cli.js.map +1 -1
- package/dist/src/plugin/command-data.d.ts +329 -0
- package/dist/src/plugin/command-data.d.ts.map +1 -0
- package/dist/src/plugin/command-data.js +517 -0
- package/dist/src/plugin/command-data.js.map +1 -0
- package/dist/src/plugin/commands.d.ts +154 -0
- package/dist/src/plugin/commands.d.ts.map +1 -0
- package/dist/src/plugin/commands.js +746 -0
- package/dist/src/plugin/commands.js.map +1 -0
- package/dist/src/plugin/config/index.d.ts +2 -2
- package/dist/src/plugin/config/index.d.ts.map +1 -1
- package/dist/src/plugin/config/index.js +2 -2
- package/dist/src/plugin/config/index.js.map +1 -1
- package/dist/src/plugin/config/loader.d.ts +1 -1
- package/dist/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/src/plugin/config/loader.js +18 -16
- package/dist/src/plugin/config/loader.js.map +1 -1
- package/dist/src/plugin/config/models.d.ts +2 -2
- package/dist/src/plugin/config/models.d.ts.map +1 -1
- package/dist/src/plugin/config/models.js +1 -1
- package/dist/src/plugin/config/models.js.map +1 -1
- package/dist/src/plugin/config/operator-settings-schema.d.ts +29 -0
- package/dist/src/plugin/config/operator-settings-schema.d.ts.map +1 -0
- package/dist/src/plugin/config/operator-settings-schema.js +28 -0
- package/dist/src/plugin/config/operator-settings-schema.js.map +1 -0
- package/dist/src/plugin/config/schema.d.ts +23 -2
- package/dist/src/plugin/config/schema.d.ts.map +1 -1
- package/dist/src/plugin/config/schema.js +109 -25
- package/dist/src/plugin/config/schema.js.map +1 -1
- package/dist/src/plugin/config/updater.d.ts.map +1 -1
- package/dist/src/plugin/config/updater.js +15 -15
- package/dist/src/plugin/config/updater.js.map +1 -1
- package/dist/src/plugin/config/writer.d.ts +34 -0
- package/dist/src/plugin/config/writer.d.ts.map +1 -0
- package/dist/src/plugin/config/writer.js +81 -0
- package/dist/src/plugin/config/writer.js.map +1 -0
- package/dist/src/plugin/core/streaming/index.d.ts +1 -1
- package/dist/src/plugin/core/streaming/index.d.ts.map +1 -1
- package/dist/src/plugin/core/streaming/index.js +1 -1
- package/dist/src/plugin/core/streaming/index.js.map +1 -1
- package/dist/src/plugin/core/streaming/transformer.d.ts.map +1 -1
- package/dist/src/plugin/core/streaming/transformer.js +85 -44
- package/dist/src/plugin/core/streaming/transformer.js.map +1 -1
- package/dist/src/plugin/core/streaming/types.d.ts.map +1 -1
- package/dist/src/plugin/debug.d.ts +10 -3
- package/dist/src/plugin/debug.d.ts.map +1 -1
- package/dist/src/plugin/debug.js +110 -47
- package/dist/src/plugin/debug.js.map +1 -1
- package/dist/src/plugin/dependencies.d.ts +129 -0
- package/dist/src/plugin/dependencies.d.ts.map +1 -0
- package/dist/src/plugin/dependencies.js +107 -0
- package/dist/src/plugin/dependencies.js.map +1 -0
- package/dist/src/plugin/errors.d.ts +27 -0
- package/dist/src/plugin/errors.d.ts.map +1 -1
- package/dist/src/plugin/errors.js +29 -3
- package/dist/src/plugin/errors.js.map +1 -1
- package/dist/src/plugin/event-handler.d.ts +53 -0
- package/dist/src/plugin/event-handler.d.ts.map +1 -0
- package/dist/src/plugin/event-handler.js +101 -0
- package/dist/src/plugin/event-handler.js.map +1 -0
- package/dist/src/plugin/fetch/retry-state.d.ts +61 -0
- package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -0
- package/dist/src/plugin/fetch/retry-state.js +248 -0
- package/dist/src/plugin/fetch/retry-state.js.map +1 -0
- package/dist/src/plugin/fetch/warmup.d.ts +30 -0
- package/dist/src/plugin/fetch/warmup.d.ts.map +1 -0
- package/dist/src/plugin/fetch/warmup.js +76 -0
- package/dist/src/plugin/fetch/warmup.js.map +1 -0
- package/dist/src/plugin/fetch-interceptor.d.ts +59 -0
- package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -0
- package/dist/src/plugin/fetch-interceptor.js +1399 -0
- package/dist/src/plugin/fetch-interceptor.js.map +1 -0
- package/dist/src/plugin/fetch-routing.d.ts +26 -0
- package/dist/src/plugin/fetch-routing.d.ts.map +1 -0
- package/dist/src/plugin/fetch-routing.js +99 -0
- package/dist/src/plugin/fetch-routing.js.map +1 -0
- package/dist/src/plugin/fingerprint.d.ts +1 -1
- package/dist/src/plugin/fingerprint.js +1 -1
- package/dist/src/plugin/gemini-dump.d.ts +5 -5
- package/dist/src/plugin/gemini-dump.d.ts.map +1 -1
- package/dist/src/plugin/gemini-dump.js +109 -55
- package/dist/src/plugin/gemini-dump.js.map +1 -1
- package/dist/src/plugin/google-search-tool.d.ts +9 -0
- package/dist/src/plugin/google-search-tool.d.ts.map +1 -0
- package/dist/src/plugin/google-search-tool.js +56 -0
- package/dist/src/plugin/google-search-tool.js.map +1 -0
- package/dist/src/plugin/image-saver.d.ts.map +1 -1
- package/dist/src/plugin/image-saver.js +16 -16
- package/dist/src/plugin/image-saver.js.map +1 -1
- package/dist/src/plugin/index.d.ts +30 -0
- package/dist/src/plugin/index.d.ts.map +1 -0
- package/dist/src/plugin/index.js +411 -0
- package/dist/src/plugin/index.js.map +1 -0
- package/dist/src/plugin/killswitch.d.ts +94 -0
- package/dist/src/plugin/killswitch.d.ts.map +1 -0
- package/dist/src/plugin/killswitch.js +197 -0
- package/dist/src/plugin/killswitch.js.map +1 -0
- package/dist/src/plugin/lifecycle.d.ts +40 -0
- package/dist/src/plugin/lifecycle.d.ts.map +1 -0
- package/dist/src/plugin/lifecycle.js +73 -0
- package/dist/src/plugin/lifecycle.js.map +1 -0
- package/dist/src/plugin/logger.d.ts +10 -1
- package/dist/src/plugin/logger.d.ts.map +1 -1
- package/dist/src/plugin/logger.js +38 -12
- package/dist/src/plugin/logger.js.map +1 -1
- package/dist/src/plugin/logging-utils.d.ts +35 -1
- package/dist/src/plugin/logging-utils.d.ts.map +1 -1
- package/dist/src/plugin/logging-utils.js +98 -15
- package/dist/src/plugin/logging-utils.js.map +1 -1
- package/dist/src/plugin/model-registry.d.ts +1 -1
- package/dist/src/plugin/model-registry.js +1 -1
- package/dist/src/plugin/oauth-login.d.ts +22 -0
- package/dist/src/plugin/oauth-login.d.ts.map +1 -0
- package/dist/src/plugin/oauth-login.js +37 -0
- package/dist/src/plugin/oauth-login.js.map +1 -0
- package/dist/src/plugin/oauth-methods.d.ts +42 -0
- package/dist/src/plugin/oauth-methods.d.ts.map +1 -0
- package/dist/src/plugin/oauth-methods.js +1276 -0
- package/dist/src/plugin/oauth-methods.js.map +1 -0
- package/dist/src/plugin/operator-settings.d.ts +40 -0
- package/dist/src/plugin/operator-settings.d.ts.map +1 -0
- package/dist/src/plugin/operator-settings.js +148 -0
- package/dist/src/plugin/operator-settings.js.map +1 -0
- package/dist/src/plugin/persist-account-pool.d.ts +37 -0
- package/dist/src/plugin/persist-account-pool.d.ts.map +1 -0
- package/dist/src/plugin/persist-account-pool.js +142 -0
- package/dist/src/plugin/persist-account-pool.js.map +1 -0
- package/dist/src/plugin/project.d.ts +1 -1
- package/dist/src/plugin/project.js +1 -1
- package/dist/src/plugin/prompt-context.d.ts.map +1 -1
- package/dist/src/plugin/prompt-context.js +11 -11
- package/dist/src/plugin/prompt-context.js.map +1 -1
- package/dist/src/plugin/quota.d.ts +138 -41
- package/dist/src/plugin/quota.d.ts.map +1 -1
- package/dist/src/plugin/quota.js +417 -285
- package/dist/src/plugin/quota.js.map +1 -1
- package/dist/src/plugin/recovery/constants.d.ts.map +1 -1
- package/dist/src/plugin/recovery/constants.js +24 -15
- package/dist/src/plugin/recovery/constants.js.map +1 -1
- package/dist/src/plugin/recovery/index.d.ts +3 -3
- package/dist/src/plugin/recovery/index.d.ts.map +1 -1
- package/dist/src/plugin/recovery/index.js +3 -3
- package/dist/src/plugin/recovery/index.js.map +1 -1
- package/dist/src/plugin/recovery/storage.d.ts +1 -1
- package/dist/src/plugin/recovery/storage.d.ts.map +1 -1
- package/dist/src/plugin/recovery/storage.js +31 -39
- package/dist/src/plugin/recovery/storage.js.map +1 -1
- package/dist/src/plugin/recovery/types.d.ts +12 -12
- package/dist/src/plugin/recovery/types.d.ts.map +1 -1
- package/dist/src/plugin/recovery.d.ts +3 -3
- package/dist/src/plugin/recovery.d.ts.map +1 -1
- package/dist/src/plugin/recovery.js +62 -58
- package/dist/src/plugin/recovery.js.map +1 -1
- package/dist/src/plugin/refresh-queue.d.ts +5 -2
- package/dist/src/plugin/refresh-queue.d.ts.map +1 -1
- package/dist/src/plugin/refresh-queue.js +37 -15
- package/dist/src/plugin/refresh-queue.js.map +1 -1
- package/dist/src/plugin/request-helpers.d.ts +1 -1
- package/dist/src/plugin/request-helpers.d.ts.map +1 -1
- package/dist/src/plugin/request-helpers.js +451 -352
- package/dist/src/plugin/request-helpers.js.map +1 -1
- package/dist/src/plugin/request.d.ts +7 -7
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +622 -384
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/rotation.d.ts +1 -168
- package/dist/src/plugin/rotation.d.ts.map +1 -1
- package/dist/src/plugin/rotation.js +1 -327
- package/dist/src/plugin/rotation.js.map +1 -1
- package/dist/src/plugin/search.d.ts.map +1 -1
- package/dist/src/plugin/search.js +39 -35
- package/dist/src/plugin/search.js.map +1 -1
- package/dist/src/plugin/server.d.ts +1 -1
- package/dist/src/plugin/server.d.ts.map +1 -1
- package/dist/src/plugin/server.js +42 -37
- package/dist/src/plugin/server.js.map +1 -1
- package/dist/src/plugin/session-context.d.ts +2 -1
- package/dist/src/plugin/session-context.d.ts.map +1 -1
- package/dist/src/plugin/session-context.js +11 -7
- package/dist/src/plugin/session-context.js.map +1 -1
- package/dist/src/plugin/storage.d.ts +59 -120
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +140 -485
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/stores/signature-store.d.ts.map +1 -1
- package/dist/src/plugin/stores/signature-store.js.map +1 -1
- package/dist/src/plugin/thinking-recovery.d.ts.map +1 -1
- package/dist/src/plugin/thinking-recovery.js +35 -33
- package/dist/src/plugin/thinking-recovery.js.map +1 -1
- package/dist/src/plugin/token.d.ts +2 -2
- package/dist/src/plugin/token.d.ts.map +1 -1
- package/dist/src/plugin/token.js +30 -21
- package/dist/src/plugin/token.js.map +1 -1
- package/dist/src/plugin/transform/cross-model-sanitizer.d.ts +1 -1
- package/dist/src/plugin/transform/cross-model-sanitizer.js +1 -1
- package/dist/src/plugin/transform/index.d.ts +1 -1
- package/dist/src/plugin/transform/index.js +1 -1
- package/dist/src/plugin/transform/model-resolver.d.ts +1 -1
- package/dist/src/plugin/transform/model-resolver.js +1 -1
- package/dist/src/plugin/transform/types.d.ts +1 -1
- package/dist/src/plugin/transform/types.js +1 -1
- package/dist/src/plugin/types.d.ts +25 -69
- package/dist/src/plugin/types.d.ts.map +1 -1
- package/dist/src/plugin/ui/ansi.d.ts.map +1 -1
- package/dist/src/plugin/ui/ansi.js.map +1 -1
- package/dist/src/plugin/ui/auth-menu.d.ts +1 -1
- package/dist/src/plugin/ui/auth-menu.d.ts.map +1 -1
- package/dist/src/plugin/ui/auth-menu.js +84 -35
- package/dist/src/plugin/ui/auth-menu.js.map +1 -1
- package/dist/src/plugin/ui/confirm.d.ts.map +1 -1
- package/dist/src/plugin/ui/confirm.js.map +1 -1
- package/dist/src/plugin/ui/model-status.d.ts +3 -3
- package/dist/src/plugin/ui/model-status.d.ts.map +1 -1
- package/dist/src/plugin/ui/model-status.js +3 -3
- package/dist/src/plugin/ui/model-status.js.map +1 -1
- package/dist/src/plugin/ui/quota-status.d.ts +4 -4
- package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
- package/dist/src/plugin/ui/quota-status.js +49 -49
- package/dist/src/plugin/ui/quota-status.js.map +1 -1
- package/dist/src/plugin/ui/select.d.ts.map +1 -1
- package/dist/src/plugin/ui/select.js +22 -12
- package/dist/src/plugin/ui/select.js.map +1 -1
- package/dist/src/plugin/version.d.ts +1 -1
- package/dist/src/plugin/version.js +1 -1
- package/dist/src/rpc/notifications.d.ts +6 -0
- package/dist/src/rpc/notifications.d.ts.map +1 -0
- package/dist/src/rpc/notifications.js +46 -0
- package/dist/src/rpc/notifications.js.map +1 -0
- package/dist/src/rpc/port-file.d.ts +13 -0
- package/dist/src/rpc/port-file.d.ts.map +1 -0
- package/dist/src/rpc/port-file.js +109 -0
- package/dist/src/rpc/port-file.js.map +1 -0
- package/dist/src/rpc/protocol.d.ts +22 -0
- package/dist/src/rpc/protocol.d.ts.map +1 -0
- package/dist/src/rpc/protocol.js +1 -0
- package/dist/src/rpc/protocol.js.map +1 -0
- package/dist/src/rpc/rpc-client.d.ts +10 -0
- package/dist/src/rpc/rpc-client.d.ts.map +1 -0
- package/dist/src/rpc/rpc-client.js +58 -0
- package/dist/src/rpc/rpc-client.js.map +1 -0
- package/dist/src/rpc/rpc-dir.d.ts +4 -0
- package/dist/src/rpc/rpc-dir.d.ts.map +1 -0
- package/dist/src/rpc/rpc-dir.js +19 -0
- package/dist/src/rpc/rpc-dir.js.map +1 -0
- package/dist/src/rpc/rpc-server.d.ts +13 -0
- package/dist/src/rpc/rpc-server.d.ts.map +1 -0
- package/dist/src/rpc/rpc-server.js +231 -0
- package/dist/src/rpc/rpc-server.js.map +1 -0
- package/dist/src/sidebar-state.d.ts +357 -0
- package/dist/src/sidebar-state.d.ts.map +1 -0
- package/dist/src/sidebar-state.js +680 -0
- package/dist/src/sidebar-state.js.map +1 -0
- package/dist/src/tui/command-dialogs.d.ts +61 -0
- package/dist/src/tui/command-dialogs.d.ts.map +1 -0
- package/dist/src/tui/command-dialogs.js +595 -0
- package/dist/src/tui/command-dialogs.js.map +1 -0
- package/dist/src/tui/file-logger.d.ts +41 -0
- package/dist/src/tui/file-logger.d.ts.map +1 -0
- package/dist/src/tui/file-logger.js +114 -0
- package/dist/src/tui/file-logger.js.map +1 -0
- package/dist/src/tui-preferences.d.ts +40 -0
- package/dist/src/tui-preferences.d.ts.map +1 -0
- package/dist/src/tui-preferences.js +328 -0
- package/dist/src/tui-preferences.js.map +1 -0
- package/dist/src/tui.d.ts +68 -0
- package/dist/src/tui.d.ts.map +1 -0
- package/dist/src/tui.js +697 -0
- package/dist/src/tui.js.map +1 -0
- package/package.json +46 -22
- package/src/plugin/command-data.ts +931 -0
- package/src/rpc/port-file.ts +143 -0
- package/src/rpc/protocol.ts +31 -0
- package/src/rpc/rpc-client.ts +102 -0
- package/src/rpc/rpc-dir.ts +24 -0
- package/src/sidebar-state.ts +991 -0
- package/src/tui/command-dialogs.tsx +832 -0
- package/src/tui/entry.mjs +74 -0
- package/src/tui/file-logger.ts +145 -0
- package/src/tui-compiled/plugin/command-data.ts +931 -0
- package/src/tui-compiled/rpc/port-file.ts +143 -0
- package/src/tui-compiled/rpc/protocol.ts +31 -0
- package/src/tui-compiled/rpc/rpc-client.ts +102 -0
- package/src/tui-compiled/rpc/rpc-dir.ts +24 -0
- package/src/tui-compiled/sidebar-state.ts +991 -0
- package/src/tui-compiled/tui/command-dialogs.tsx +779 -0
- package/src/tui-compiled/tui/file-logger.ts +145 -0
- package/src/tui-compiled/tui-preferences.ts +416 -0
- package/src/tui-compiled/tui.tsx +1193 -0
- package/src/tui-preferences.ts +416 -0
- package/src/tui.tsx +1171 -0
- package/dist/src/plugin.d.ts +0 -48
- package/dist/src/plugin.d.ts.map +0 -1
- package/dist/src/plugin.js +0 -3311
- package/dist/src/plugin.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-dump.js","sourceRoot":"","sources":["../../../src/plugin/gemini-dump.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAA;AAErD,MAAM,iBAAiB,GAAG,uBAAuB,CAAA;AACjD,MAAM,kBAAkB,GAAG,wBAAwB,CAAA;AACnD,MAAM,mBAAmB,GAAG,yBAAyB,CAAA;AACrD,MAAM,gBAAgB,GAAG,sBAAsB,CAAA;AAC/C,MAAM,UAAU,
|
|
1
|
+
{"version":3,"file":"gemini-dump.js","sourceRoot":"","sources":["../../../src/plugin/gemini-dump.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAA;AAEtD,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAA;AAErD,MAAM,iBAAiB,GAAG,uBAAuB,CAAA;AACjD,MAAM,kBAAkB,GAAG,wBAAwB,CAAA;AACnD,MAAM,mBAAmB,GAAG,yBAAyB,CAAA;AACrD,MAAM,gBAAgB,GAAG,sBAAsB,CAAA;AAC/C,MAAM,UAAU,GACd,kEAAkE,CAAA;AACpE,MAAM,YAAY,GAAG,sCAAsC,CAAA;AAC3D,MAAM,gBAAgB,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,mCAAmC,CAAC,CAAA;AAC5E,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BAA4B,CAC1C,OAA6C,EAC7C,IAAY;IAEZ,IAAI,CAAC,OAAO;QAAE,OAAM;IACpB,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,CAAC,CAAA;IACpD,cAAc,CAAC,OAAO,EAAE;QACtB,aAAa,EAAE,IAAI,CAAC,MAAM;QAC1B,YAAY,EAAE,QAAQ,CAAC,IAAI,CAAC;KAC7B,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAC/C,OAA6C;IAE7C,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IACzB,OAAO,IAAI,eAAe,CAAyB;QACjD,SAAS,CAAC,KAAK,EAAE,UAAU;YACzB,cAAc,CAAC,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;YAC1D,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;QAC3B,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { GetAuth, PluginClient, PluginTool } from './types';
|
|
2
|
+
type GoogleSearchAuthLoader = () => Promise<Awaited<ReturnType<GetAuth>> | null | undefined>;
|
|
3
|
+
export declare function createGoogleSearchTool({ getAuth, client, providerId, }: {
|
|
4
|
+
getAuth: GoogleSearchAuthLoader;
|
|
5
|
+
client: PluginClient;
|
|
6
|
+
providerId: string;
|
|
7
|
+
}): PluginTool;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=google-search-tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-search-tool.d.ts","sourceRoot":"","sources":["../../../src/plugin/google-search-tool.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAIhE,KAAK,sBAAsB,GAAG,MAAM,OAAO,CACzC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,CAChD,CAAA;AAED,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,MAAM,EACN,UAAU,GACX,EAAE;IACD,OAAO,EAAE,sBAAsB,CAAA;IAC/B,MAAM,EAAE,YAAY,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;CACnB,GAAG,UAAU,CA8Db"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { tool } from '@opencode-ai/plugin';
|
|
2
|
+
import { accessTokenExpired, isOAuthAuth, parseRefreshParts } from './auth';
|
|
3
|
+
import { createLogger } from './logger';
|
|
4
|
+
import { executeSearch } from './search';
|
|
5
|
+
import { refreshAccessToken } from './token';
|
|
6
|
+
const log = createLogger('plugin');
|
|
7
|
+
export function createGoogleSearchTool({ getAuth, client, providerId, }) {
|
|
8
|
+
return tool({
|
|
9
|
+
description: "Search the web using Google Search and analyze URLs. Returns real-time information from the internet with source citations. Use this when you need up-to-date information about current events, recent developments, or any topic that may have changed. You can also provide specific URLs to analyze. IMPORTANT: If the user mentions or provides any URLs in their query, you MUST extract those URLs and pass them in the 'urls' parameter for direct analysis.",
|
|
10
|
+
args: {
|
|
11
|
+
query: tool.schema
|
|
12
|
+
.string()
|
|
13
|
+
.describe('The search query or question to answer using web search'),
|
|
14
|
+
urls: tool.schema
|
|
15
|
+
.array(tool.schema.string())
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('List of specific URLs to fetch and analyze. IMPORTANT: Always extract and include any URLs mentioned by the user in their query here.'),
|
|
18
|
+
thinking: tool.schema
|
|
19
|
+
.boolean()
|
|
20
|
+
.optional()
|
|
21
|
+
.default(true)
|
|
22
|
+
.describe('Enable deep thinking for more thorough analysis (default: true)'),
|
|
23
|
+
},
|
|
24
|
+
async execute(args, ctx) {
|
|
25
|
+
log.debug('Google Search tool called', {
|
|
26
|
+
query: args.query,
|
|
27
|
+
urlCount: args.urls?.length ?? 0,
|
|
28
|
+
});
|
|
29
|
+
const auth = await getAuth();
|
|
30
|
+
if (!auth || !isOAuthAuth(auth)) {
|
|
31
|
+
return 'Error: Not authenticated with Antigravity. Please run `opencode auth login` to authenticate.';
|
|
32
|
+
}
|
|
33
|
+
const parts = parseRefreshParts(auth.refresh);
|
|
34
|
+
const projectId = parts.managedProjectId || parts.projectId || 'unknown';
|
|
35
|
+
let accessToken = auth.access;
|
|
36
|
+
if (!accessToken || accessTokenExpired(auth)) {
|
|
37
|
+
try {
|
|
38
|
+
const refreshed = await refreshAccessToken(auth, client, providerId);
|
|
39
|
+
accessToken = refreshed?.access;
|
|
40
|
+
}
|
|
41
|
+
catch (error) {
|
|
42
|
+
return `Error: Failed to refresh access token: ${error instanceof Error ? error.message : String(error)}`;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
if (!accessToken) {
|
|
46
|
+
return 'Error: No valid access token available. Please run `opencode auth login` to re-authenticate.';
|
|
47
|
+
}
|
|
48
|
+
return executeSearch({
|
|
49
|
+
query: args.query,
|
|
50
|
+
urls: args.urls,
|
|
51
|
+
thinking: args.thinking,
|
|
52
|
+
}, accessToken, projectId, ctx.abort);
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
//# sourceMappingURL=google-search-tool.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-search-tool.js","sourceRoot":"","sources":["../../../src/plugin/google-search-tool.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAA;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAG5C,MAAM,GAAG,GAA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AS,GAAG,MAAM,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,CAAA;oBACpE,WAAW,GAAG,SAAS,EAAE,MAAM,CAAA;gBACjC,CAAC;gBAAC,OAAO,KAAK,EAAE,CAAC;oBACf,OAAO,0CAA0C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;gBAC3G,CAAC;YACH,CAAC;YAED,IAAI,CAAC,WAAW,EAAE,CAAC;gBACjB,OAAO,8FAA8F,CAAA;YACvG,CAAC;YAED,OAAO,aAAa,CAClB;gBACE,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;aACxB,EACD,WAAW,EACX,SAAS,EACT,GAAG,CAAC,KAAK,CACV,CAAA;QACH,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-saver.d.ts","sourceRoot":"","sources":["../../../src/plugin/image-saver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-saver.d.ts","sourceRoot":"","sources":["../../../src/plugin/image-saver.ts"],"names":[],"mappings":"AA8BA,wBAAgB,eAAe,CAC7B,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,CAWR;AAED,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EAChD,SAAS,CAAC,EAAE,MAAM,GACjB,MAAM,GAAG,IAAI,CAaf"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { chmodSync, existsSync, mkdirSync, writeFileSync
|
|
2
|
-
import { homedir } from
|
|
3
|
-
import { join } from
|
|
1
|
+
import { chmodSync, existsSync, mkdirSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
4
|
function getImageOutputDir(outputDir) {
|
|
5
|
-
const resolved = outputDir ?? join(homedir(),
|
|
5
|
+
const resolved = outputDir ?? join(homedir(), '.opencode', 'generated-images');
|
|
6
6
|
if (!existsSync(resolved)) {
|
|
7
7
|
mkdirSync(resolved, { recursive: true, mode: 0o700 });
|
|
8
8
|
}
|
|
@@ -10,17 +10,17 @@ function getImageOutputDir(outputDir) {
|
|
|
10
10
|
return resolved;
|
|
11
11
|
}
|
|
12
12
|
function generateImageFilename(mimeType) {
|
|
13
|
-
const timestamp = new Date().toISOString().replace(/[:.]/g,
|
|
13
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
14
14
|
const random = Math.random().toString(36).substring(2, 8);
|
|
15
|
-
let extension =
|
|
16
|
-
if (mimeType.includes(
|
|
17
|
-
extension =
|
|
15
|
+
let extension = 'png';
|
|
16
|
+
if (mimeType.includes('jpeg') || mimeType.includes('jpg')) {
|
|
17
|
+
extension = 'jpg';
|
|
18
18
|
}
|
|
19
|
-
else if (mimeType.includes(
|
|
20
|
-
extension =
|
|
19
|
+
else if (mimeType.includes('gif')) {
|
|
20
|
+
extension = 'gif';
|
|
21
21
|
}
|
|
22
|
-
else if (mimeType.includes(
|
|
23
|
-
extension =
|
|
22
|
+
else if (mimeType.includes('webp')) {
|
|
23
|
+
extension = 'webp';
|
|
24
24
|
}
|
|
25
25
|
return `image-${timestamp}-${random}.${extension}`;
|
|
26
26
|
}
|
|
@@ -28,17 +28,17 @@ export function saveImageToDisk(base64Data, mimeType, outputDir) {
|
|
|
28
28
|
try {
|
|
29
29
|
const resolvedOutputDir = getImageOutputDir(outputDir);
|
|
30
30
|
const filePath = join(resolvedOutputDir, generateImageFilename(mimeType));
|
|
31
|
-
writeFileSync(filePath, Buffer.from(base64Data,
|
|
31
|
+
writeFileSync(filePath, Buffer.from(base64Data, 'base64'), { mode: 0o600 });
|
|
32
32
|
chmodSync(filePath, 0o600);
|
|
33
33
|
return filePath;
|
|
34
34
|
}
|
|
35
35
|
catch (error) {
|
|
36
|
-
console.error(
|
|
37
|
-
return
|
|
36
|
+
console.error('[image-saver] Failed to save image:', error);
|
|
37
|
+
return '';
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
export function processImageData(inlineData, outputDir) {
|
|
41
|
-
const mimeType = inlineData.mimeType ||
|
|
41
|
+
const mimeType = inlineData.mimeType || 'image/png';
|
|
42
42
|
const data = inlineData.data;
|
|
43
43
|
if (!data) {
|
|
44
44
|
return null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-saver.js","sourceRoot":"","sources":["../../../src/plugin/image-saver.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"image-saver.js","sourceRoot":"","sources":["../../../src/plugin/image-saver.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,SAAS,iBAAiB,CAAC,SAAkB;IAC3C,MAAM,QAAQ,GAAG,SAAS,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,kBAAkB,CAAC,CAAA;IAE9E,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1B,SAAS,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IACvD,CAAC;IACD,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAC1B,OAAO,QAAQ,CAAA;AACjB,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAgB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K,CAAC,CAAA;QAC3D,OAAO,EAAE,CAAA;IACX,CAAC;AACH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,UAAgD,EAChD,SAAkB;IAElB,MAAM,QAAQ,GAAG,UAAU,CAAC,QAAQ,IAAI,WAAW,CAAA;IACnD,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,CAAA;IAC5B,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,QAAQ,GAAG,eAAe,CAAC,IAAI,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;IAC3D,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,sBAAsB,QAAQ,0BAA0B,QAAQ,0BAA0B,QAAQ,KAAK,CAAA;IAChH,CAAC;IAED,OAAO,2BAA2B,QAAQ,WAAW,IAAI,GAAG,CAAA;AAC9D,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BackgroundQuotaRefresh } from './background-quota-refresh';
|
|
2
|
+
import { type PluginDependencyOverrides } from './dependencies';
|
|
3
|
+
import { type PluginLifecycle } from './lifecycle';
|
|
4
|
+
import { type QuotaManager } from './quota';
|
|
5
|
+
import type { PluginInput, PluginResult } from './types';
|
|
6
|
+
export type { PluginResult } from './types';
|
|
7
|
+
/**
|
|
8
|
+
* High-level options for the plugin factory. Production callers omit it
|
|
9
|
+
* entirely; the e2e workspace injects overrides so the same factory can
|
|
10
|
+
* build against a mock Antigravity server bound to 127.0.0.1.
|
|
11
|
+
*/
|
|
12
|
+
export interface CreateAntigravityPluginOptions {
|
|
13
|
+
/**
|
|
14
|
+
* Dependency overrides for the composition seam — fetch implementation,
|
|
15
|
+
* Antigravity transport, OAuth primitives, filesystem roots, clock, and
|
|
16
|
+
* randomness. Defaults to production implementations.
|
|
17
|
+
*/
|
|
18
|
+
dependencies?: PluginDependencyOverrides;
|
|
19
|
+
/**
|
|
20
|
+
* Test-only seam: called synchronously after the background poller is
|
|
21
|
+
* constructed, before `start()`. Lets wiring tests capture the instance
|
|
22
|
+
* without reaching into lifecycle internals.
|
|
23
|
+
*/
|
|
24
|
+
_onPollerCreated?: (poller: BackgroundQuotaRefresh) => void;
|
|
25
|
+
}
|
|
26
|
+
export declare function registerQuotaManagerProducer(lifecycle: PluginLifecycle, quotaManager: QuotaManager): void;
|
|
27
|
+
export declare const createAntigravityPlugin: (providerId: string, options?: CreateAntigravityPluginOptions) => (input: PluginInput) => Promise<PluginResult>;
|
|
28
|
+
export declare const AntigravityCLIOAuthPlugin: (input: PluginInput) => Promise<PluginResult>;
|
|
29
|
+
export declare const GoogleOAuthPlugin: (input: PluginInput) => Promise<PluginResult>;
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugin/index.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AAmBnE,OAAO,EAEL,KAAK,yBAAyB,EAE/B,MAAM,gBAAgB,CAAA;AAIvB,OAAO,EAAyB,KAAK,eAAe,EAAE,MAAM,aAAa,CAAA;AAQzE,OAAO,EAGL,KAAK,YAAY,EAClB,MAAM,SAAS,CAAA;AAchB,OAAO,KAAK,EAA0B,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAEhF,YAAY,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAmB3C;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;;OAIG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAA;IACxC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,sBAAsB,KAAK,IAAI,CAAA;CAC5D;AAED,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,eAAe,EAC1B,YAAY,EAAE,YAAY,GACzB,IAAI,CAEN;AAED,eAAO,MAAM,uBAAuB,GACjC,YAAY,MAAM,EAAE,UAAS,8BAAmC,MAC1D,OAAO,WAAW,KAAG,OAAO,CAAC,YAAY,CA2X/C,CAAA;AAEH,eAAO,MAAM,yBAAyB,UA7XtB,WAAW,KAAG,OAAO,CAAC,YAAY,CA+XjD,CAAA;AACD,eAAO,MAAM,iBAAiB,UAhYd,WAAW,KAAG,OAAO,CAAC,YAAY,CAgYQ,CAAA"}
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { ANTIGRAVITY_PROVIDER_ID } from '../constants';
|
|
4
|
+
import { createAutoUpdateCheckerHook } from '../hooks/auto-update-checker';
|
|
5
|
+
import { drainNotifications, pushNotification } from '../rpc/notifications';
|
|
6
|
+
import { getRpcDir } from '../rpc/rpc-dir';
|
|
7
|
+
import { startRpcServer } from '../rpc/rpc-server';
|
|
8
|
+
import { drainSidebarWrites, getSidebarStateFile, isAccountCurrent, toCapturedTier, } from '../sidebar-state';
|
|
9
|
+
import { createAccountAccessService, promptAccountIndexForVerification, promptOpenVerificationUrl, } from './account-access';
|
|
10
|
+
import { createAccountCommandOAuthService } from './account-command-oauth';
|
|
11
|
+
import { createAuthLoader } from './auth-loader';
|
|
12
|
+
import { BackgroundQuotaRefresh } from './background-quota-refresh';
|
|
13
|
+
import { initDiskSignatureCache, shutdownDiskSignatureCache } from './cache';
|
|
14
|
+
import { applyAntigravityProviderCatalog, registerAntigravityCommands, } from './catalog';
|
|
15
|
+
import { createCommandDataService, projectCommandAccountRows, } from './command-data';
|
|
16
|
+
import { applyCommand, createCommandExecuteBefore, createSidebarRefresher, } from './commands';
|
|
17
|
+
import { initRuntimeConfig, loadConfig } from './config';
|
|
18
|
+
import { getUserConfigPath } from './config/loader';
|
|
19
|
+
import { closeDebugLog, initializeDebug } from './debug';
|
|
20
|
+
import { resolvePluginDependencies, } from './dependencies';
|
|
21
|
+
import { createEventHandler } from './event-handler';
|
|
22
|
+
import { createFetchInterceptor } from './fetch-interceptor';
|
|
23
|
+
import { createGoogleSearchTool } from './google-search-tool';
|
|
24
|
+
import { createPluginLifecycle } from './lifecycle';
|
|
25
|
+
import { createLogger, initLogger, setRuntimeLogLevel } from './logger';
|
|
26
|
+
import { createOAuthMethods, openBrowserWithSystem } from './oauth-methods';
|
|
27
|
+
import { createOperatorSettingsController, } from './operator-settings';
|
|
28
|
+
import { persistAccountPool } from './persist-account-pool';
|
|
29
|
+
import { createOpenCodeQuotaManager, makeTierLoader, } from './quota';
|
|
30
|
+
import { createSessionRecoveryHook } from './recovery';
|
|
31
|
+
import { getHealthTracker, initHealthTracker, initTokenTracker, } from './rotation';
|
|
32
|
+
import { AgySessionRegistry } from './session-context';
|
|
33
|
+
import { clearAccounts, getStoragePath, loadAccounts, mutateAccountStorage, } from './storage';
|
|
34
|
+
import { initAntigravityVersion } from './version';
|
|
35
|
+
const logger = createLogger('plugin');
|
|
36
|
+
/**
|
|
37
|
+
* Opaque identity derived from a refresh token. Mirrors
|
|
38
|
+
* `command-data.ts`'s copy (the two callers stay independent because
|
|
39
|
+
* `command-data.ts` ships into the TUI's compiled tree and can't reach
|
|
40
|
+
* across the core barrel boundary). Used by the live quota→sidebar
|
|
41
|
+
* writers to stamp each quota snapshot with the account it belongs to
|
|
42
|
+
* so the sidebar projection can detect a stale cache after an index
|
|
43
|
+
* shift.
|
|
44
|
+
*/
|
|
45
|
+
function quotaAccountIdentity(refreshToken) {
|
|
46
|
+
return createHash('sha256').update(refreshToken).digest('hex').slice(0, 16);
|
|
47
|
+
}
|
|
48
|
+
export function registerQuotaManagerProducer(lifecycle, quotaManager) {
|
|
49
|
+
lifecycle.register({ dispose: () => quotaManager.dispose() }, 'producer');
|
|
50
|
+
}
|
|
51
|
+
export const createAntigravityPlugin = (providerId, options = {}) => async (input) => {
|
|
52
|
+
const dependencies = resolvePluginDependencies(options.dependencies);
|
|
53
|
+
const { client, directory } = input;
|
|
54
|
+
const config = loadConfig(directory);
|
|
55
|
+
initRuntimeConfig(config);
|
|
56
|
+
initializeDebug(config);
|
|
57
|
+
initLogger(client);
|
|
58
|
+
await initAntigravityVersion();
|
|
59
|
+
if (config.health_score) {
|
|
60
|
+
initHealthTracker({
|
|
61
|
+
initial: config.health_score.initial,
|
|
62
|
+
successReward: config.health_score.success_reward,
|
|
63
|
+
rateLimitPenalty: config.health_score.rate_limit_penalty,
|
|
64
|
+
failurePenalty: config.health_score.failure_penalty,
|
|
65
|
+
recoveryRatePerHour: config.health_score.recovery_rate_per_hour,
|
|
66
|
+
minUsable: config.health_score.min_usable,
|
|
67
|
+
maxScore: config.health_score.max_score,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
if (config.token_bucket) {
|
|
71
|
+
initTokenTracker({
|
|
72
|
+
maxTokens: config.token_bucket.max_tokens,
|
|
73
|
+
regenerationRatePerMinute: config.token_bucket.regeneration_rate_per_minute,
|
|
74
|
+
initialTokens: config.token_bucket.initial_tokens,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
if (config.keep_thinking) {
|
|
78
|
+
initDiskSignatureCache(config.signature_cache);
|
|
79
|
+
}
|
|
80
|
+
const sessionRegistry = new AgySessionRegistry(directory);
|
|
81
|
+
let cachedGetAuth = null;
|
|
82
|
+
const lifecycle = createPluginLifecycle({
|
|
83
|
+
sessionRegistry,
|
|
84
|
+
shutdownDiskSignatureCache,
|
|
85
|
+
clearFetchState: () => {
|
|
86
|
+
cachedGetAuth = null;
|
|
87
|
+
},
|
|
88
|
+
// Drain pending sidebar writes BEFORE tearing down the RPC server
|
|
89
|
+
// and file logger — a fetch-interceptor routing upsert enqueued at
|
|
90
|
+
// shutdown must land before the host closes the terminal.
|
|
91
|
+
drainSidebarWrites,
|
|
92
|
+
});
|
|
93
|
+
const quotaManager = createOpenCodeQuotaManager(client, providerId, {
|
|
94
|
+
// Route quota fetches through the injected transport so e2e and
|
|
95
|
+
// custom-host deployments stay on the loopback/mock server for both
|
|
96
|
+
// the request path and the background poller. Without this the
|
|
97
|
+
// poller always hits the production Antigravity endpoint even when
|
|
98
|
+
// the caller injected a mock transport.
|
|
99
|
+
fetchVia: dependencies.agyTransport,
|
|
100
|
+
// Bind to the live AccountManager so every refresh (manual or
|
|
101
|
+
// background) pushes the freshly-updated quota percentages into the
|
|
102
|
+
// sidebar without an extra RPC. The wrapper reads lazily so the
|
|
103
|
+
// AccountManager reference stays stable across reloads.
|
|
104
|
+
getAccountsForSidebar: () => {
|
|
105
|
+
const manager = lifecycle.getAccountManager();
|
|
106
|
+
if (!manager)
|
|
107
|
+
return null;
|
|
108
|
+
const activeByFamily = manager.getActiveIndexByFamily();
|
|
109
|
+
return manager.getAccounts().map((entry) => ({
|
|
110
|
+
index: entry.index,
|
|
111
|
+
label: entry.label,
|
|
112
|
+
enabled: entry.enabled,
|
|
113
|
+
current: isAccountCurrent(entry.index, activeByFamily),
|
|
114
|
+
coolingDownUntil: entry.coolingDownUntil,
|
|
115
|
+
cachedQuota: entry.cachedQuota,
|
|
116
|
+
// Carry the identity stamp so the sidebar projection can
|
|
117
|
+
// detect a stale snapshot that landed on the wrong account
|
|
118
|
+
// after an index shift (see `redactAccountForSidebar`).
|
|
119
|
+
cachedQuotaAccountId: entry.cachedQuotaAccountId,
|
|
120
|
+
currentQuotaAccountId: quotaAccountIdentity(entry.parts.refreshToken),
|
|
121
|
+
tier: toCapturedTier(entry),
|
|
122
|
+
}));
|
|
123
|
+
},
|
|
124
|
+
getActiveIndexByFamily: () => {
|
|
125
|
+
const manager = lifecycle.getAccountManager();
|
|
126
|
+
if (!manager)
|
|
127
|
+
return null;
|
|
128
|
+
return manager.getActiveIndexByFamily();
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
// Producer phase: the quota manager emits fire-and-forget sidebar
|
|
132
|
+
// writes after every refresh. Its dispose() awaits any in-flight
|
|
133
|
+
// refresh, so disposing it BEFORE the sidebar drain guarantees the
|
|
134
|
+
// final post-refresh write is enqueued before the drain flushes —
|
|
135
|
+
// a consumer-phase registration could let a refresh enqueue a write
|
|
136
|
+
// after drainSidebarWrites() already asserted the queue was empty.
|
|
137
|
+
registerQuotaManagerProducer(lifecycle, quotaManager);
|
|
138
|
+
// Background quota poller: per-loader-instance timer that keeps idle
|
|
139
|
+
// account sidebar bars fresh between real requests. Registered as a
|
|
140
|
+
// producer so it is stopped and awaited BEFORE the sidebar drain,
|
|
141
|
+
// guaranteeing any final poll write lands before the drain flushes.
|
|
142
|
+
if (config.background_quota_refresh) {
|
|
143
|
+
const poller = new BackgroundQuotaRefresh({
|
|
144
|
+
intervalMs: config.background_quota_refresh_interval_minutes * 60_000,
|
|
145
|
+
sidebarStateFile: getSidebarStateFile(),
|
|
146
|
+
getAccountManager: () => lifecycle.getAccountManager(),
|
|
147
|
+
quotaManager,
|
|
148
|
+
// Resolve plan tier for accounts with stale capturedTierAt. Uses
|
|
149
|
+
// the same token-refresh path as the quota manager without a separate
|
|
150
|
+
// network seam -- tier is best-effort metadata, not quota.
|
|
151
|
+
loadAccountTier: makeTierLoader(client, providerId),
|
|
152
|
+
// Thread the injected clock so e2e tests can control startup
|
|
153
|
+
// jitter and timing without needing a real 30-second wait.
|
|
154
|
+
now: dependencies.clock.now,
|
|
155
|
+
random: dependencies.clock.random,
|
|
156
|
+
});
|
|
157
|
+
options._onPollerCreated?.(poller);
|
|
158
|
+
poller.start();
|
|
159
|
+
lifecycle.register({ dispose: () => poller.dispose() }, 'producer');
|
|
160
|
+
}
|
|
161
|
+
// Operator settings controller backs the /antigravity-* slash commands.
|
|
162
|
+
// The controller loads existing persisted settings at first read, mutates
|
|
163
|
+
// runtime config immediately, and serializes through the fenced-lock
|
|
164
|
+
// writer so a crash mid-write cannot corrupt the file.
|
|
165
|
+
const operatorSettings = createOperatorSettingsController({
|
|
166
|
+
projectConfigPath: join(directory, '.opencode', 'antigravity.json'),
|
|
167
|
+
// getUserConfigPath() already returns the full file path including
|
|
168
|
+
// 'antigravity.json' — do NOT join again or the path double-nests
|
|
169
|
+
// into <dir>/antigravity.json/antigravity.json.
|
|
170
|
+
userConfigPath: getUserConfigPath(),
|
|
171
|
+
});
|
|
172
|
+
setRuntimeLogLevel(operatorSettings.get().log_level);
|
|
173
|
+
lifecycle.register({ dispose: () => operatorSettings.dispose() });
|
|
174
|
+
const sessionRecovery = createSessionRecoveryHook({ client, directory }, config);
|
|
175
|
+
const updateChecker = createAutoUpdateCheckerHook(client, directory, {
|
|
176
|
+
showStartupToast: true,
|
|
177
|
+
autoUpdate: config.auto_update,
|
|
178
|
+
});
|
|
179
|
+
const event = createEventHandler({
|
|
180
|
+
client,
|
|
181
|
+
config,
|
|
182
|
+
directory,
|
|
183
|
+
lifecycle,
|
|
184
|
+
sessionRegistry,
|
|
185
|
+
sessionRecovery,
|
|
186
|
+
updateChecker,
|
|
187
|
+
logger,
|
|
188
|
+
});
|
|
189
|
+
// This service intentionally closes over lifecycle getters, so both OPEN
|
|
190
|
+
// notifications and RPC apply actions observe the current account manager.
|
|
191
|
+
const commandData = createCommandDataService({
|
|
192
|
+
accountManagerView: {
|
|
193
|
+
getAccounts: () => {
|
|
194
|
+
const manager = lifecycle.getAccountManager();
|
|
195
|
+
if (!manager)
|
|
196
|
+
return [];
|
|
197
|
+
const activeByFamily = manager.getActiveIndexByFamily();
|
|
198
|
+
return manager.getAccounts().map((entry, index) => ({
|
|
199
|
+
index,
|
|
200
|
+
refreshToken: entry.parts.refreshToken,
|
|
201
|
+
label: entry.label,
|
|
202
|
+
enabled: entry.enabled !== false,
|
|
203
|
+
active: isAccountCurrent(index, activeByFamily),
|
|
204
|
+
cachedQuota: entry.cachedQuota,
|
|
205
|
+
cachedQuotaUpdatedAt: entry.cachedQuotaUpdatedAt,
|
|
206
|
+
cachedQuotaAccountId: entry.cachedQuotaAccountId,
|
|
207
|
+
accountIneligible: entry.accountIneligible,
|
|
208
|
+
coolingDownUntil: entry.coolingDownUntil,
|
|
209
|
+
healthScore: getHealthTracker().getScore(entry.index),
|
|
210
|
+
capturedTierId: entry.capturedTierId,
|
|
211
|
+
capturedPaidTierId: entry.capturedPaidTierId,
|
|
212
|
+
capturedTierAt: entry.capturedTierAt,
|
|
213
|
+
}));
|
|
214
|
+
},
|
|
215
|
+
getAccountsForQuotaCheck: () => {
|
|
216
|
+
const manager = lifecycle.getAccountManager();
|
|
217
|
+
return manager ? manager.getAccountsForQuotaCheck() : [];
|
|
218
|
+
},
|
|
219
|
+
updateQuotaCache: (index, groups, expectedRefreshToken) => {
|
|
220
|
+
lifecycle
|
|
221
|
+
.getAccountManager()
|
|
222
|
+
?.updateQuotaCache(index, groups, expectedRefreshToken);
|
|
223
|
+
},
|
|
224
|
+
requestSaveToDisk: () => {
|
|
225
|
+
lifecycle.getAccountManager()?.requestSaveToDisk();
|
|
226
|
+
},
|
|
227
|
+
flushSaveToDisk: async () => {
|
|
228
|
+
await lifecycle.getAccountManager()?.flushSaveToDisk();
|
|
229
|
+
},
|
|
230
|
+
getActiveIndexByFamily: () => {
|
|
231
|
+
const manager = lifecycle.getAccountManager();
|
|
232
|
+
if (!manager)
|
|
233
|
+
return { claude: 0, gemini: 0 };
|
|
234
|
+
return manager.getActiveIndexByFamily();
|
|
235
|
+
},
|
|
236
|
+
setAccountEnabled: (index, enabled) => {
|
|
237
|
+
const manager = lifecycle.getAccountManager();
|
|
238
|
+
if (!manager)
|
|
239
|
+
return false;
|
|
240
|
+
return manager.setAccountEnabled(index, enabled);
|
|
241
|
+
},
|
|
242
|
+
setAccountCurrent: (index) => {
|
|
243
|
+
const manager = lifecycle.getAccountManager();
|
|
244
|
+
if (!manager)
|
|
245
|
+
return false;
|
|
246
|
+
const account = manager.getAccounts()[index];
|
|
247
|
+
if (!account)
|
|
248
|
+
return false;
|
|
249
|
+
manager.markSwitched(account, 'initial', 'claude');
|
|
250
|
+
manager.markSwitched(account, 'initial', 'gemini');
|
|
251
|
+
return true;
|
|
252
|
+
},
|
|
253
|
+
removeAccountByIndex: (index) => {
|
|
254
|
+
const manager = lifecycle.getAccountManager();
|
|
255
|
+
if (!manager)
|
|
256
|
+
return false;
|
|
257
|
+
return manager.removeAccountByIndex(index);
|
|
258
|
+
},
|
|
259
|
+
getRefreshTokenAt: (index) => {
|
|
260
|
+
const manager = lifecycle.getAccountManager();
|
|
261
|
+
if (!manager)
|
|
262
|
+
return undefined;
|
|
263
|
+
return manager.getAccounts()[index]?.parts.refreshToken;
|
|
264
|
+
},
|
|
265
|
+
},
|
|
266
|
+
quotaManager,
|
|
267
|
+
sidebarStateFile: getSidebarStateFile(),
|
|
268
|
+
storage: {
|
|
269
|
+
mutate: (mutator) => mutateAccountStorage(getStoragePath(), mutator),
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
const commandExecuteBefore = createCommandExecuteBefore(client, operatorSettings, pushNotification, commandData);
|
|
273
|
+
const googleSearchTool = createGoogleSearchTool({
|
|
274
|
+
getAuth: async () => (cachedGetAuth ? cachedGetAuth() : null),
|
|
275
|
+
client,
|
|
276
|
+
providerId,
|
|
277
|
+
});
|
|
278
|
+
const accountAccess = createAccountAccessService({
|
|
279
|
+
client,
|
|
280
|
+
providerId,
|
|
281
|
+
store: {
|
|
282
|
+
load: loadAccounts,
|
|
283
|
+
mutate: (mutate) => mutateAccountStorage(getStoragePath(), mutate),
|
|
284
|
+
clear: clearAccounts,
|
|
285
|
+
persistAccountPool,
|
|
286
|
+
},
|
|
287
|
+
openBrowser: openBrowserWithSystem,
|
|
288
|
+
prompt: {
|
|
289
|
+
selectAccount: promptAccountIndexForVerification,
|
|
290
|
+
confirmOpenVerificationUrl: promptOpenVerificationUrl,
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
const authLoader = createAuthLoader({
|
|
294
|
+
client,
|
|
295
|
+
providerId,
|
|
296
|
+
config,
|
|
297
|
+
lifecycle,
|
|
298
|
+
onGetAuth: (getAuth) => {
|
|
299
|
+
cachedGetAuth = getAuth;
|
|
300
|
+
},
|
|
301
|
+
createFetch: ({ accountManager, getAuth }) => createFetchInterceptor({
|
|
302
|
+
client,
|
|
303
|
+
directory,
|
|
304
|
+
providerId,
|
|
305
|
+
config,
|
|
306
|
+
accountManager,
|
|
307
|
+
quotaManager,
|
|
308
|
+
getAuth,
|
|
309
|
+
agySessionRegistry: sessionRegistry,
|
|
310
|
+
operatorSettings,
|
|
311
|
+
agyTransport: dependencies.agyTransport,
|
|
312
|
+
fetchImpl: dependencies.fetchImpl,
|
|
313
|
+
}),
|
|
314
|
+
});
|
|
315
|
+
const accountOAuth = createAccountCommandOAuthService({
|
|
316
|
+
// Wire the OAuth primitives through the dependency seam (rather
|
|
317
|
+
// than the concrete imports above) so injected overrides from
|
|
318
|
+
// `dependencies.oauth.*` reach this path — the same composition
|
|
319
|
+
// pattern used by every other sub-factory. Without this seam the
|
|
320
|
+
// e2e harness / custom-host deployments would still hit the real
|
|
321
|
+
// Google OAuth endpoints when adding an account.
|
|
322
|
+
authorize: dependencies.oauth.authorize,
|
|
323
|
+
exchange: dependencies.oauth.exchange,
|
|
324
|
+
persist: (result) => accountAccess.persistAccountPool([result], false),
|
|
325
|
+
listAccounts: async () => projectCommandAccountRows(await accountAccess.loadAccounts()),
|
|
326
|
+
// After the new account lands on disk, reload the live
|
|
327
|
+
// AccountManager + fetch interceptor so routing sees it
|
|
328
|
+
// immediately — without waiting for an auth reload.
|
|
329
|
+
onAfterPersist: () => authLoader.reload(async () => {
|
|
330
|
+
const auth = cachedGetAuth ? await cachedGetAuth() : undefined;
|
|
331
|
+
if (auth)
|
|
332
|
+
return auth;
|
|
333
|
+
throw new Error('No live auth cached for OAuth finish reload — the host has not yet loaded any account.');
|
|
334
|
+
}),
|
|
335
|
+
});
|
|
336
|
+
lifecycle.register({ dispose: () => accountOAuth.dispose() });
|
|
337
|
+
const oauthMethods = createOAuthMethods({
|
|
338
|
+
client,
|
|
339
|
+
providerId,
|
|
340
|
+
config,
|
|
341
|
+
lifecycle,
|
|
342
|
+
accountAccess,
|
|
343
|
+
quotaManager,
|
|
344
|
+
getAuth: async () => (cachedGetAuth ? cachedGetAuth() : undefined),
|
|
345
|
+
});
|
|
346
|
+
const rpcServer = await startRpcServer({
|
|
347
|
+
dir: getRpcDir(directory),
|
|
348
|
+
apply: async (request) => {
|
|
349
|
+
// Sidebar refresher is bound to the live account manager so every
|
|
350
|
+
// /antigravity-* mutation bumps `checkedAt` for the next TUI poll.
|
|
351
|
+
// The refresher is best-effort and never breaks the apply response.
|
|
352
|
+
const refreshSidebar = createSidebarRefresher(() => {
|
|
353
|
+
const manager = lifecycle.getAccountManager();
|
|
354
|
+
if (!manager)
|
|
355
|
+
return null;
|
|
356
|
+
const activeByFamily = manager.getActiveIndexByFamily();
|
|
357
|
+
return manager.getAccounts().map((entry) => ({
|
|
358
|
+
index: entry.index,
|
|
359
|
+
label: entry.label,
|
|
360
|
+
enabled: entry.enabled,
|
|
361
|
+
current: isAccountCurrent(entry.index, activeByFamily),
|
|
362
|
+
coolingDownUntil: entry.coolingDownUntil,
|
|
363
|
+
cachedQuota: entry.cachedQuota,
|
|
364
|
+
// Carry the identity stamp so the sidebar projection can
|
|
365
|
+
// detect a stale snapshot that landed on the wrong account
|
|
366
|
+
// after an index shift (see `redactAccountForSidebar`).
|
|
367
|
+
cachedQuotaAccountId: entry.cachedQuotaAccountId,
|
|
368
|
+
currentQuotaAccountId: quotaAccountIdentity(entry.parts.refreshToken),
|
|
369
|
+
tier: toCapturedTier(entry),
|
|
370
|
+
}));
|
|
371
|
+
});
|
|
372
|
+
const result = await applyCommand(request, {
|
|
373
|
+
client,
|
|
374
|
+
sessionID: request.sessionId ?? '',
|
|
375
|
+
settings: operatorSettings,
|
|
376
|
+
onApplied: refreshSidebar,
|
|
377
|
+
commandData,
|
|
378
|
+
accountOAuth,
|
|
379
|
+
});
|
|
380
|
+
// /antigravity-logging mutates the log level — propagate
|
|
381
|
+
// immediately so subsequent log calls in this session respect it.
|
|
382
|
+
setRuntimeLogLevel(operatorSettings.get().log_level);
|
|
383
|
+
return result;
|
|
384
|
+
},
|
|
385
|
+
drain: drainNotifications,
|
|
386
|
+
});
|
|
387
|
+
lifecycle.register({ dispose: () => rpcServer.stop() });
|
|
388
|
+
// Flush the debug log stream after the sidebar drain so the last
|
|
389
|
+
// buffered lines land on disk before the process exits. Best-effort.
|
|
390
|
+
lifecycle.register({ dispose: () => closeDebugLog().catch(() => { }) });
|
|
391
|
+
return {
|
|
392
|
+
dispose: async () => {
|
|
393
|
+
await lifecycle.dispose();
|
|
394
|
+
},
|
|
395
|
+
config: async (opencodeConfig) => {
|
|
396
|
+
applyAntigravityProviderCatalog(opencodeConfig, providerId);
|
|
397
|
+
registerAntigravityCommands(opencodeConfig);
|
|
398
|
+
},
|
|
399
|
+
'command.execute.before': commandExecuteBefore,
|
|
400
|
+
event,
|
|
401
|
+
tool: { google_search: googleSearchTool },
|
|
402
|
+
auth: {
|
|
403
|
+
provider: providerId,
|
|
404
|
+
loader: authLoader,
|
|
405
|
+
methods: oauthMethods,
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
export const AntigravityCLIOAuthPlugin = createAntigravityPlugin(ANTIGRAVITY_PROVIDER_ID);
|
|
410
|
+
export const GoogleOAuthPlugin = AntigravityCLIOAuthPlugin;
|
|
411
|
+
//# sourceMappingURL=index.js.map
|