@cortexkit/opencode-antigravity-auth 2.2.0 → 3.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.
- package/README.md +95 -89
- package/dist/cli.js +18469 -810
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +4079 -0
- package/dist/index.js +40923 -16450
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +6949 -0
- package/dist/server.js +50948 -0
- package/dist/server.js.map +7 -0
- package/dist/server.meta.json +7284 -0
- package/dist/src/cli.d.ts +46 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +207 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/common-auth-embedded/NOTICE.txt +21 -0
- package/dist/src/common-auth-embedded/auth-menu/accounts.d.ts +97 -0
- package/dist/src/common-auth-embedded/auth-menu/accounts.js +387 -0
- package/dist/src/common-auth-embedded/auth-menu/ansi.d.ts +26 -0
- package/dist/src/common-auth-embedded/auth-menu/ansi.js +98 -0
- package/dist/src/common-auth-embedded/auth-menu/confirm.d.ts +7 -0
- package/dist/src/common-auth-embedded/auth-menu/confirm.js +21 -0
- package/dist/src/common-auth-embedded/auth-menu/doctor.d.ts +52 -0
- package/dist/src/common-auth-embedded/auth-menu/doctor.js +81 -0
- package/dist/src/common-auth-embedded/auth-menu/index.d.ts +17 -0
- package/dist/src/common-auth-embedded/auth-menu/index.js +12 -0
- package/dist/src/common-auth-embedded/auth-menu/login.d.ts +55 -0
- package/dist/src/common-auth-embedded/auth-menu/login.js +83 -0
- package/dist/src/common-auth-embedded/auth-menu/menu.d.ts +59 -0
- package/dist/src/common-auth-embedded/auth-menu/menu.js +73 -0
- package/dist/src/common-auth-embedded/auth-menu/opencode-v1.d.ts +49 -0
- package/dist/src/common-auth-embedded/auth-menu/opencode-v1.js +47 -0
- package/dist/src/common-auth-embedded/auth-menu/select.d.ts +21 -0
- package/dist/src/common-auth-embedded/auth-menu/select.js +159 -0
- package/dist/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
- package/dist/src/common-auth-embedded/auth-menu/terminal.js +19 -0
- package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +102 -0
- package/dist/src/common-auth-embedded/claustrum/consumer.js +298 -0
- package/dist/src/common-auth-embedded/claustrum/custody.d.ts +175 -0
- package/dist/src/common-auth-embedded/claustrum/custody.js +354 -0
- package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +158 -0
- package/dist/src/common-auth-embedded/claustrum/enrollment.js +759 -0
- package/dist/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
- package/dist/src/common-auth-embedded/claustrum/errors.js +8 -0
- package/dist/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
- package/dist/src/common-auth-embedded/claustrum/host-slot.js +72 -0
- package/dist/src/common-auth-embedded/claustrum/index.d.ts +18 -0
- package/dist/src/common-auth-embedded/claustrum/index.js +22 -0
- package/dist/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
- package/dist/src/common-auth-embedded/claustrum/interlock.js +29 -0
- package/dist/src/common-auth-embedded/claustrum/roster.d.ts +208 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +536 -0
- package/dist/src/common-auth-embedded/commands/builtins.d.ts +71 -0
- package/dist/src/common-auth-embedded/commands/builtins.js +534 -0
- package/dist/src/common-auth-embedded/commands/index.d.ts +10 -0
- package/dist/src/common-auth-embedded/commands/index.js +5 -0
- package/dist/src/common-auth-embedded/commands/menu.d.ts +61 -0
- package/dist/src/common-auth-embedded/commands/menu.js +300 -0
- package/dist/src/common-auth-embedded/commands/model.d.ts +238 -0
- package/dist/src/common-auth-embedded/commands/model.js +16 -0
- package/dist/src/common-auth-embedded/commands/pi.d.ts +23 -0
- package/dist/src/common-auth-embedded/commands/pi.js +206 -0
- package/dist/src/common-auth-embedded/commands/seam.d.ts +72 -0
- package/dist/src/common-auth-embedded/commands/seam.js +301 -0
- package/dist/src/common-auth-embedded/fs/atomic-write.d.ts +20 -0
- package/dist/src/common-auth-embedded/fs/atomic-write.js +80 -0
- package/dist/src/common-auth-embedded/fs/index.d.ts +7 -0
- package/dist/src/common-auth-embedded/fs/index.js +6 -0
- package/dist/src/common-auth-embedded/fs/lock-constants.d.ts +14 -0
- package/dist/src/common-auth-embedded/fs/lock-constants.js +14 -0
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +501 -0
- package/dist/src/common-auth-embedded/fs/with-lock.d.ts +33 -0
- package/dist/src/common-auth-embedded/fs/with-lock.js +48 -0
- package/dist/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
- package/dist/src/common-auth-embedded/logger/capture-sink.js +13 -0
- package/dist/src/common-auth-embedded/logger/engine.d.ts +100 -0
- package/dist/src/common-auth-embedded/logger/engine.js +246 -0
- package/dist/src/common-auth-embedded/logger/index.d.ts +6 -0
- package/dist/src/common-auth-embedded/logger/index.js +3 -0
- package/dist/src/common-auth-embedded/logger/redact.d.ts +11 -0
- package/dist/src/common-auth-embedded/logger/redact.js +83 -0
- package/dist/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
- package/dist/src/common-auth-embedded/opencode2/errors.js +15 -0
- package/dist/src/common-auth-embedded/opencode2/index.d.ts +8 -0
- package/dist/src/common-auth-embedded/opencode2/index.js +4 -0
- package/dist/src/common-auth-embedded/opencode2/install.d.ts +55 -0
- package/dist/src/common-auth-embedded/opencode2/install.js +886 -0
- package/dist/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
- package/dist/src/common-auth-embedded/opencode2/integration.js +143 -0
- package/dist/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
- package/dist/src/common-auth-embedded/opencode2/sse.js +60 -0
- package/dist/src/common-auth-embedded/opencode2/types.d.ts +413 -0
- package/dist/src/common-auth-embedded/pi-slot/index.d.ts +3 -0
- package/dist/src/common-auth-embedded/pi-slot/index.js +2 -0
- package/dist/src/common-auth-embedded/pi-slot/lock.js +212 -0
- package/dist/src/common-auth-embedded/pi-slot/slot.d.ts +49 -0
- package/dist/src/common-auth-embedded/pi-slot/slot.js +383 -0
- package/dist/src/common-auth-embedded/quota/codec.d.ts +11 -0
- package/dist/src/common-auth-embedded/quota/codec.js +12 -0
- package/dist/src/common-auth-embedded/quota/format.d.ts +46 -0
- package/dist/src/common-auth-embedded/quota/format.js +138 -0
- package/dist/src/common-auth-embedded/quota/index.d.ts +10 -0
- package/dist/src/common-auth-embedded/quota/index.js +5 -0
- package/dist/src/common-auth-embedded/quota/map.d.ts +63 -0
- package/dist/src/common-auth-embedded/quota/map.js +105 -0
- package/dist/src/common-auth-embedded/quota/merge.d.ts +48 -0
- package/dist/src/common-auth-embedded/quota/merge.js +162 -0
- package/dist/src/common-auth-embedded/quota/projection.d.ts +64 -0
- package/dist/src/common-auth-embedded/quota/projection.js +134 -0
- package/dist/src/common-auth-embedded/routing/admission.d.ts +93 -0
- package/dist/src/common-auth-embedded/routing/admission.js +142 -0
- package/dist/src/common-auth-embedded/routing/index.d.ts +8 -0
- package/dist/src/common-auth-embedded/routing/index.js +4 -0
- package/dist/src/common-auth-embedded/routing/ordered.d.ts +47 -0
- package/dist/src/common-auth-embedded/routing/ordered.js +58 -0
- package/dist/src/common-auth-embedded/routing/pins.d.ts +22 -0
- package/dist/src/common-auth-embedded/routing/pins.js +34 -0
- package/dist/src/common-auth-embedded/routing/sticky.d.ts +158 -0
- package/dist/src/common-auth-embedded/routing/sticky.js +339 -0
- package/dist/src/common-auth-embedded/rpc/client.d.ts +3 -0
- package/dist/src/common-auth-embedded/rpc/client.js +2 -0
- package/dist/src/common-auth-embedded/rpc/index.d.ts +10 -0
- package/dist/src/common-auth-embedded/rpc/index.js +5 -0
- package/dist/src/common-auth-embedded/rpc/notifications.d.ts +73 -0
- package/dist/src/common-auth-embedded/rpc/notifications.js +100 -0
- package/dist/src/common-auth-embedded/rpc/port-file.d.ts +33 -0
- package/dist/src/common-auth-embedded/rpc/port-file.js +217 -0
- package/dist/src/common-auth-embedded/rpc/rpc-client.d.ts +30 -0
- package/dist/src/common-auth-embedded/rpc/rpc-client.js +253 -0
- package/dist/src/common-auth-embedded/rpc/rpc-server.d.ts +58 -0
- package/dist/src/common-auth-embedded/rpc/rpc-server.js +311 -0
- package/dist/src/common-auth-embedded/rpc/server-registry.d.ts +11 -0
- package/dist/src/common-auth-embedded/rpc/server-registry.js +47 -0
- package/dist/src/common-auth-embedded/source-output.json +1326 -0
- package/dist/src/common-auth-embedded/store/attribution.d.ts +28 -0
- package/dist/src/common-auth-embedded/store/attribution.js +60 -0
- package/dist/src/common-auth-embedded/store/errors.d.ts +55 -0
- package/dist/src/common-auth-embedded/store/errors.js +38 -0
- package/dist/src/common-auth-embedded/store/hooks.d.ts +12 -0
- package/dist/src/common-auth-embedded/store/hooks.js +34 -0
- package/dist/src/common-auth-embedded/store/identity.d.ts +39 -0
- package/dist/src/common-auth-embedded/store/identity.js +79 -0
- package/dist/src/common-auth-embedded/store/index.d.ts +21 -0
- package/dist/src/common-auth-embedded/store/index.js +7 -0
- package/dist/src/common-auth-embedded/store/mutate.d.ts +189 -0
- package/dist/src/common-auth-embedded/store/mutate.js +500 -0
- package/dist/src/common-auth-embedded/store/pool.d.ts +196 -0
- package/dist/src/common-auth-embedded/store/pool.js +120 -0
- package/dist/src/common-auth-embedded/store/provider-state.d.ts +131 -0
- package/dist/src/common-auth-embedded/store/provider-state.js +226 -0
- package/dist/src/common-auth-embedded/store/publication.d.ts +47 -0
- package/dist/src/common-auth-embedded/store/publication.js +304 -0
- package/dist/src/common-auth-embedded/store/pull.d.ts +36 -0
- package/dist/src/common-auth-embedded/store/pull.js +143 -0
- package/dist/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
- package/dist/src/common-auth-embedded/store/refresh-lock.js +136 -0
- package/dist/src/common-auth-embedded/store/refresh.d.ts +72 -0
- package/dist/src/common-auth-embedded/store/refresh.js +225 -0
- package/dist/src/common-auth-embedded/store/reserved.js +13 -0
- package/dist/src/common-auth-embedded/store/rows.d.ts +313 -0
- package/dist/src/common-auth-embedded/store/rows.js +1258 -0
- package/dist/src/common-auth-embedded/store/runtime.d.ts +36 -0
- package/dist/src/common-auth-embedded/store/runtime.js +68 -0
- package/dist/src/common-auth-embedded/store/schema.d.ts +443 -0
- package/dist/src/common-auth-embedded/store/schema.js +754 -0
- package/dist/src/common-auth-embedded/store/settings.d.ts +63 -0
- package/dist/src/common-auth-embedded/store/settings.js +120 -0
- package/dist/src/common-auth-embedded/store/torn.d.ts +78 -0
- package/dist/src/common-auth-embedded/store/torn.js +294 -0
- package/dist/src/common-auth-embedded/tui/index.d.ts +8 -0
- package/dist/src/common-auth-embedded/tui/index.js +21 -0
- package/dist/src/common-auth-embedded/util/any-signal.js +42 -0
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +4 -0
- package/dist/src/constants.js.map +1 -1
- package/dist/src/ga/proxy-guard.d.ts +120 -0
- package/dist/src/ga/proxy-guard.d.ts.map +1 -0
- package/dist/src/ga/proxy-guard.js +269 -0
- package/dist/src/ga/proxy-guard.js.map +1 -0
- package/dist/src/ga/rpc/protocol.d.ts +504 -0
- package/dist/src/ga/rpc/protocol.d.ts.map +1 -0
- package/dist/src/ga/rpc/protocol.js +1278 -0
- package/dist/src/ga/rpc/protocol.js.map +1 -0
- package/dist/src/ga/server/auth.d.ts +9 -0
- package/dist/src/ga/server/auth.d.ts.map +1 -0
- package/dist/src/ga/server/auth.js +37 -0
- package/dist/src/ga/server/auth.js.map +1 -0
- package/dist/src/ga/server/index.d.ts +576 -0
- package/dist/src/ga/server/index.d.ts.map +1 -0
- package/dist/src/ga/server/index.js +1012 -0
- package/dist/src/ga/server/index.js.map +1 -0
- package/dist/src/ga/tui/host-ga.d.ts +350 -0
- package/dist/src/ga/tui/host-ga.d.ts.map +1 -0
- package/dist/src/ga/tui/host-ga.js +1242 -0
- package/dist/src/ga/tui/host-ga.js.map +1 -0
- package/dist/src/logging/provider-key-policy.d.ts +9 -0
- package/dist/src/logging/provider-key-policy.d.ts.map +1 -0
- package/dist/src/logging/provider-key-policy.js +11 -0
- package/dist/src/logging/provider-key-policy.js.map +1 -0
- package/dist/src/plugin/account-access.d.ts +130 -15
- package/dist/src/plugin/account-access.d.ts.map +1 -1
- package/dist/src/plugin/account-access.js +331 -129
- package/dist/src/plugin/account-access.js.map +1 -1
- package/dist/src/plugin/account-blocks.d.ts +102 -0
- package/dist/src/plugin/account-blocks.d.ts.map +1 -0
- package/dist/src/plugin/account-blocks.js +196 -0
- package/dist/src/plugin/account-blocks.js.map +1 -0
- package/dist/src/plugin/accounts.d.ts +85 -1
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +127 -3
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/auth-loader.d.ts +69 -5
- package/dist/src/plugin/auth-loader.d.ts.map +1 -1
- package/dist/src/plugin/auth-loader.js +355 -52
- package/dist/src/plugin/auth-loader.js.map +1 -1
- package/dist/src/plugin/background-quota-refresh.d.ts +54 -8
- package/dist/src/plugin/background-quota-refresh.d.ts.map +1 -1
- package/dist/src/plugin/background-quota-refresh.js +81 -24
- package/dist/src/plugin/background-quota-refresh.js.map +1 -1
- 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 +55 -10
- package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
- package/dist/src/plugin/cache/signature-cache.js +100 -41
- package/dist/src/plugin/cache/signature-cache.js.map +1 -1
- package/dist/src/plugin/cache.d.ts +80 -16
- package/dist/src/plugin/cache.d.ts.map +1 -1
- package/dist/src/plugin/cache.js +339 -200
- package/dist/src/plugin/cache.js.map +1 -1
- package/dist/src/plugin/catalog.d.ts +4 -18
- package/dist/src/plugin/catalog.d.ts.map +1 -1
- package/dist/src/plugin/catalog.js +11 -41
- package/dist/src/plugin/catalog.js.map +1 -1
- package/dist/src/plugin/command-apply.d.ts +58 -0
- package/dist/src/plugin/command-apply.d.ts.map +1 -0
- package/dist/src/plugin/command-apply.js +168 -0
- package/dist/src/plugin/command-apply.js.map +1 -0
- package/dist/src/plugin/command-data.d.ts +1 -0
- package/dist/src/plugin/command-data.d.ts.map +1 -1
- package/dist/src/plugin/command-data.js +2 -0
- package/dist/src/plugin/command-data.js.map +1 -1
- package/dist/src/plugin/commands.d.ts +142 -132
- package/dist/src/plugin/commands.d.ts.map +1 -1
- package/dist/src/plugin/commands.js +214 -686
- package/dist/src/plugin/commands.js.map +1 -1
- package/dist/src/plugin/config/index.d.ts +1 -1
- package/dist/src/plugin/config/index.d.ts.map +1 -1
- package/dist/src/plugin/config/index.js +1 -1
- package/dist/src/plugin/config/index.js.map +1 -1
- package/dist/src/plugin/config/loader.d.ts +37 -1
- package/dist/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/src/plugin/config/loader.js +64 -9
- package/dist/src/plugin/config/loader.js.map +1 -1
- package/dist/src/plugin/config/operator-settings-schema.d.ts +2 -2
- package/dist/src/plugin/config/schema.d.ts +2 -2
- package/dist/src/plugin/config/writer.d.ts +7 -0
- package/dist/src/plugin/config/writer.d.ts.map +1 -1
- package/dist/src/plugin/config/writer.js +10 -1
- package/dist/src/plugin/config/writer.js.map +1 -1
- package/dist/src/plugin/debug.d.ts +72 -29
- package/dist/src/plugin/debug.d.ts.map +1 -1
- package/dist/src/plugin/debug.js +353 -239
- package/dist/src/plugin/debug.js.map +1 -1
- package/dist/src/plugin/fetch/retry-state.d.ts +1 -1
- package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -1
- package/dist/src/plugin/fetch/retry-state.js.map +1 -1
- package/dist/src/plugin/fetch-interceptor.d.ts +66 -11
- package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -1
- package/dist/src/plugin/fetch-interceptor.js +228 -1347
- package/dist/src/plugin/fetch-interceptor.js.map +1 -1
- package/dist/src/plugin/fetch-routing.d.ts +7 -2
- package/dist/src/plugin/fetch-routing.d.ts.map +1 -1
- package/dist/src/plugin/fetch-routing.js +7 -4
- package/dist/src/plugin/fetch-routing.js.map +1 -1
- package/dist/src/plugin/ga-location-services.d.ts +389 -0
- package/dist/src/plugin/ga-location-services.d.ts.map +1 -0
- package/dist/src/plugin/ga-location-services.js +1838 -0
- package/dist/src/plugin/ga-location-services.js.map +1 -0
- package/dist/src/plugin/gemini-dump.d.ts +37 -12
- package/dist/src/plugin/gemini-dump.d.ts.map +1 -1
- package/dist/src/plugin/gemini-dump.js +42 -21
- package/dist/src/plugin/gemini-dump.js.map +1 -1
- package/dist/src/plugin/google-search-tool.d.ts +2 -1
- package/dist/src/plugin/google-search-tool.d.ts.map +1 -1
- package/dist/src/plugin/google-search-tool.js +4 -1
- package/dist/src/plugin/google-search-tool.js.map +1 -1
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +505 -141
- package/dist/src/plugin/index.js.map +1 -1
- package/dist/src/plugin/killswitch.d.ts +1 -2
- package/dist/src/plugin/killswitch.d.ts.map +1 -1
- package/dist/src/plugin/lifecycle.d.ts +24 -1
- package/dist/src/plugin/lifecycle.d.ts.map +1 -1
- package/dist/src/plugin/lifecycle.js +95 -8
- package/dist/src/plugin/lifecycle.js.map +1 -1
- package/dist/src/plugin/logger.d.ts +61 -10
- package/dist/src/plugin/logger.d.ts.map +1 -1
- package/dist/src/plugin/logger.js +134 -63
- package/dist/src/plugin/logger.js.map +1 -1
- package/dist/src/plugin/neutral-types.d.ts +42 -0
- package/dist/src/plugin/neutral-types.d.ts.map +1 -0
- package/dist/src/plugin/neutral-types.js +12 -0
- package/dist/src/plugin/neutral-types.js.map +1 -0
- package/dist/src/plugin/oauth-methods.d.ts +2 -1
- package/dist/src/plugin/oauth-methods.d.ts.map +1 -1
- package/dist/src/plugin/oauth-methods.js +173 -88
- package/dist/src/plugin/oauth-methods.js.map +1 -1
- package/dist/src/plugin/operator-settings.d.ts +34 -0
- package/dist/src/plugin/operator-settings.d.ts.map +1 -1
- package/dist/src/plugin/operator-settings.js +105 -2
- package/dist/src/plugin/operator-settings.js.map +1 -1
- package/dist/src/plugin/persist-account-pool.d.ts +63 -2
- package/dist/src/plugin/persist-account-pool.d.ts.map +1 -1
- package/dist/src/plugin/persist-account-pool.js +125 -2
- package/dist/src/plugin/persist-account-pool.js.map +1 -1
- package/dist/src/plugin/quota.d.ts +335 -35
- package/dist/src/plugin/quota.d.ts.map +1 -1
- package/dist/src/plugin/quota.js +825 -95
- package/dist/src/plugin/quota.js.map +1 -1
- package/dist/src/plugin/refresh-queue.d.ts +35 -5
- package/dist/src/plugin/refresh-queue.d.ts.map +1 -1
- package/dist/src/plugin/refresh-queue.js +50 -16
- package/dist/src/plugin/refresh-queue.js.map +1 -1
- package/dist/src/plugin/request-helpers.d.ts +30 -5
- package/dist/src/plugin/request-helpers.d.ts.map +1 -1
- package/dist/src/plugin/request-helpers.js +82 -17
- package/dist/src/plugin/request-helpers.js.map +1 -1
- package/dist/src/plugin/request.d.ts +63 -15
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +190 -60
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/session-context.d.ts.map +1 -1
- package/dist/src/plugin/session-context.js +5 -2
- package/dist/src/plugin/session-context.js.map +1 -1
- package/dist/src/plugin/shared/local-grant.d.ts +26 -0
- package/dist/src/plugin/shared/local-grant.d.ts.map +1 -0
- package/dist/src/plugin/shared/local-grant.js +19 -0
- package/dist/src/plugin/shared/local-grant.js.map +1 -0
- package/dist/src/plugin/shared/request-cancellation.d.ts +12 -0
- package/dist/src/plugin/shared/request-cancellation.d.ts.map +1 -0
- package/dist/src/plugin/shared/request-cancellation.js +118 -0
- package/dist/src/plugin/shared/request-cancellation.js.map +1 -0
- package/dist/src/plugin/shared/request-services.d.ts +375 -0
- package/dist/src/plugin/shared/request-services.d.ts.map +1 -0
- package/dist/src/plugin/shared/request-services.js +1743 -0
- package/dist/src/plugin/shared/request-services.js.map +1 -0
- package/dist/src/plugin/shared/runtime.d.ts +217 -0
- package/dist/src/plugin/shared/runtime.d.ts.map +1 -0
- package/dist/src/plugin/shared/runtime.js +345 -0
- package/dist/src/plugin/shared/runtime.js.map +1 -0
- package/dist/src/plugin/shared/source-sidebar.d.ts +15 -0
- package/dist/src/plugin/shared/source-sidebar.d.ts.map +1 -0
- package/dist/src/plugin/shared/source-sidebar.js +41 -0
- package/dist/src/plugin/shared/source-sidebar.js.map +1 -0
- package/dist/src/plugin/shared/vault-menu.d.ts +5 -0
- package/dist/src/plugin/shared/vault-menu.d.ts.map +1 -0
- package/dist/src/plugin/shared/vault-menu.js +49 -0
- package/dist/src/plugin/shared/vault-menu.js.map +1 -0
- package/dist/src/plugin/shared/vault-request-credentials.d.ts +168 -0
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -0
- package/dist/src/plugin/shared/vault-request-credentials.js +485 -0
- package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -0
- package/dist/src/plugin/storage.d.ts +127 -1
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +188 -3
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/token.d.ts +23 -1
- package/dist/src/plugin/token.d.ts.map +1 -1
- package/dist/src/plugin/token.js +117 -58
- package/dist/src/plugin/token.js.map +1 -1
- package/dist/src/plugin/ui/quota-status.d.ts +1 -10
- package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
- package/dist/src/plugin/ui/quota-status.js +6 -42
- package/dist/src/plugin/ui/quota-status.js.map +1 -1
- package/dist/src/plugin/vault-activation.d.ts +11 -0
- package/dist/src/plugin/vault-activation.d.ts.map +1 -0
- package/dist/src/plugin/vault-activation.js +53 -0
- package/dist/src/plugin/vault-activation.js.map +1 -0
- package/dist/src/plugin/vault-custody.d.ts +131 -0
- package/dist/src/plugin/vault-custody.d.ts.map +1 -0
- package/dist/src/plugin/vault-custody.js +381 -0
- package/dist/src/plugin/vault-custody.js.map +1 -0
- package/dist/src/quota-presentation.d.ts +18 -0
- package/dist/src/quota-presentation.d.ts.map +1 -0
- package/dist/src/quota-presentation.js +58 -0
- package/dist/src/quota-presentation.js.map +1 -0
- package/dist/src/rpc/notifications.d.ts +2 -2
- package/dist/src/rpc/notifications.d.ts.map +1 -1
- package/dist/src/rpc/notifications.js +1 -1
- package/dist/src/rpc/notifications.js.map +1 -1
- package/dist/src/rpc/port-file.d.ts +2 -12
- package/dist/src/rpc/port-file.d.ts.map +1 -1
- package/dist/src/rpc/port-file.js +5 -107
- package/dist/src/rpc/port-file.js.map +1 -1
- package/dist/src/rpc/protocol.d.ts +47 -16
- package/dist/src/rpc/protocol.d.ts.map +1 -1
- package/dist/src/rpc/rpc-client.d.ts +27 -3
- package/dist/src/rpc/rpc-client.d.ts.map +1 -1
- package/dist/src/rpc/rpc-client.js +55 -45
- package/dist/src/rpc/rpc-client.js.map +1 -1
- package/dist/src/rpc/rpc-server.d.ts +13 -2
- package/dist/src/rpc/rpc-server.d.ts.map +1 -1
- package/dist/src/rpc/rpc-server.js +38 -212
- package/dist/src/rpc/rpc-server.js.map +1 -1
- package/dist/src/server.d.ts +30 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +29 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/sidebar-projection.d.ts +102 -0
- package/dist/src/sidebar-projection.d.ts.map +1 -0
- package/dist/src/sidebar-projection.js +146 -0
- package/dist/src/sidebar-projection.js.map +1 -0
- package/dist/src/sidebar-state.d.ts +13 -5
- package/dist/src/sidebar-state.d.ts.map +1 -1
- package/dist/src/sidebar-state.js +49 -16
- package/dist/src/sidebar-state.js.map +1 -1
- package/dist/src/tui/command-dialogs.d.ts +58 -52
- package/dist/src/tui/command-dialogs.d.ts.map +1 -1
- package/dist/src/tui/command-dialogs.js +379 -571
- package/dist/src/tui/command-dialogs.js.map +1 -1
- package/dist/src/tui/file-logger.d.ts +2 -3
- package/dist/src/tui/file-logger.d.ts.map +1 -1
- package/dist/src/tui/file-logger.js +21 -7
- package/dist/src/tui/file-logger.js.map +1 -1
- package/dist/src/tui/host-api.d.ts +196 -0
- package/dist/src/tui/host-api.d.ts.map +1 -0
- package/dist/src/tui/host-api.js +357 -0
- package/dist/src/tui/host-api.js.map +1 -0
- package/dist/src/tui/host-v1.d.ts +60 -0
- package/dist/src/tui/host-v1.d.ts.map +1 -0
- package/dist/src/tui/host-v1.js +147 -0
- package/dist/src/tui/host-v1.js.map +1 -0
- package/dist/src/tui/vault-setup.d.ts +98 -0
- package/dist/src/tui/vault-setup.d.ts.map +1 -0
- package/dist/src/tui/vault-setup.js +198 -0
- package/dist/src/tui/vault-setup.js.map +1 -0
- package/dist/src/tui.d.ts +4 -11
- package/dist/src/tui.d.ts.map +1 -1
- package/dist/src/tui.js +33 -75
- package/dist/src/tui.js.map +1 -1
- package/dist/tui-build-map.json +380 -0
- package/dist/tui-ga-build-map.json +187 -0
- package/dist/types/src/antigravity/oauth.d.ts +2 -0
- package/dist/types/src/antigravity/oauth.d.ts.map +1 -0
- package/dist/types/src/cli.d.ts +66 -0
- package/dist/types/src/cli.d.ts.map +1 -0
- package/dist/types/src/common-auth-embedded/commands/builtins.d.ts +71 -0
- package/dist/types/src/common-auth-embedded/commands/index.d.ts +10 -0
- package/dist/types/src/common-auth-embedded/commands/menu.d.ts +61 -0
- package/dist/types/src/common-auth-embedded/commands/model.d.ts +238 -0
- package/dist/types/src/common-auth-embedded/commands/pi.d.ts +23 -0
- package/dist/types/src/common-auth-embedded/commands/seam.d.ts +72 -0
- package/dist/types/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
- package/dist/types/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
- package/dist/types/src/common-auth-embedded/logger/engine.d.ts +100 -0
- package/dist/types/src/common-auth-embedded/logger/index.d.ts +6 -0
- package/dist/types/src/common-auth-embedded/logger/redact.d.ts +11 -0
- package/dist/types/src/common-auth-embedded/quota/codec.d.ts +11 -0
- package/dist/types/src/common-auth-embedded/quota/format.d.ts +46 -0
- package/dist/types/src/common-auth-embedded/quota/index.d.ts +10 -0
- package/dist/types/src/common-auth-embedded/quota/map.d.ts +63 -0
- package/dist/types/src/common-auth-embedded/quota/merge.d.ts +48 -0
- package/dist/types/src/common-auth-embedded/quota/projection.d.ts +64 -0
- package/dist/types/src/common-auth-embedded/store/attribution.d.ts +28 -0
- package/dist/types/src/common-auth-embedded/store/errors.d.ts +55 -0
- package/dist/types/src/common-auth-embedded/store/hooks.d.ts +12 -0
- package/dist/types/src/common-auth-embedded/store/identity.d.ts +39 -0
- package/dist/types/src/common-auth-embedded/store/index.d.ts +21 -0
- package/dist/types/src/common-auth-embedded/store/mutate.d.ts +189 -0
- package/dist/types/src/common-auth-embedded/store/pool.d.ts +196 -0
- package/dist/types/src/common-auth-embedded/store/provider-state.d.ts +131 -0
- package/dist/types/src/common-auth-embedded/store/publication.d.ts +47 -0
- package/dist/types/src/common-auth-embedded/store/pull.d.ts +36 -0
- package/dist/types/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
- package/dist/types/src/common-auth-embedded/store/refresh.d.ts +72 -0
- package/dist/types/src/common-auth-embedded/store/rows.d.ts +313 -0
- package/dist/types/src/common-auth-embedded/store/runtime.d.ts +36 -0
- package/dist/types/src/common-auth-embedded/store/schema.d.ts +443 -0
- package/dist/types/src/common-auth-embedded/store/settings.d.ts +63 -0
- package/dist/types/src/common-auth-embedded/store/torn.d.ts +78 -0
- package/dist/types/src/constants.d.ts +3 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/ga/proxy-guard.d.ts +120 -0
- package/dist/types/src/ga/proxy-guard.d.ts.map +1 -0
- package/dist/types/src/ga/rpc/protocol.d.ts +504 -0
- package/dist/types/src/ga/rpc/protocol.d.ts.map +1 -0
- package/dist/types/src/ga/server/auth.d.ts +9 -0
- package/dist/types/src/ga/server/auth.d.ts.map +1 -0
- package/dist/types/src/ga/server/index.d.ts +576 -0
- package/dist/types/src/ga/server/index.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/cache.d.ts +3 -0
- package/dist/types/src/hooks/auto-update-checker/cache.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/checker.d.ts +16 -0
- package/dist/types/src/hooks/auto-update-checker/checker.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/constants.d.ts +9 -0
- package/dist/types/src/hooks/auto-update-checker/constants.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/index.d.ts +34 -0
- package/dist/types/src/hooks/auto-update-checker/index.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/logging.d.ts +3 -0
- package/dist/types/src/hooks/auto-update-checker/logging.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/types.d.ts +25 -0
- package/dist/types/src/hooks/auto-update-checker/types.d.ts.map +1 -0
- package/dist/types/src/logging/provider-key-policy.d.ts +9 -0
- package/dist/types/src/logging/provider-key-policy.d.ts.map +1 -0
- package/dist/types/src/plugin/account-access.d.ts +214 -0
- package/dist/types/src/plugin/account-access.d.ts.map +1 -0
- package/dist/types/src/plugin/account-blocks.d.ts +102 -0
- package/dist/types/src/plugin/account-blocks.d.ts.map +1 -0
- package/dist/types/src/plugin/account-command-oauth.d.ts +34 -0
- package/dist/types/src/plugin/account-command-oauth.d.ts.map +1 -0
- package/dist/types/src/plugin/accounts.d.ts +94 -0
- package/dist/types/src/plugin/accounts.d.ts.map +1 -0
- package/dist/types/src/plugin/agy-request-metadata.d.ts +2 -0
- package/dist/types/src/plugin/agy-request-metadata.d.ts.map +1 -0
- package/dist/types/src/plugin/agy-transport.d.ts +2 -0
- package/dist/types/src/plugin/agy-transport.d.ts.map +1 -0
- package/dist/types/src/plugin/auth-doctor.d.ts +30 -0
- package/dist/types/src/plugin/auth-doctor.d.ts.map +1 -0
- package/dist/types/src/plugin/auth-drift.d.ts +13 -0
- package/dist/types/src/plugin/auth-drift.d.ts.map +1 -0
- package/dist/types/src/plugin/auth-loader.d.ts +114 -0
- package/dist/types/src/plugin/auth-loader.d.ts.map +1 -0
- package/dist/types/src/plugin/auth.d.ts +2 -0
- package/dist/types/src/plugin/auth.d.ts.map +1 -0
- package/dist/types/src/plugin/background-quota-refresh.d.ts +192 -0
- package/dist/types/src/plugin/background-quota-refresh.d.ts.map +1 -0
- package/dist/types/src/plugin/cache/signature-cache.d.ts +156 -0
- package/dist/types/src/plugin/cache/signature-cache.d.ts.map +1 -0
- package/dist/types/src/plugin/cache.d.ts +109 -0
- package/dist/types/src/plugin/cache.d.ts.map +1 -0
- package/dist/types/src/plugin/catalog.d.ts +9 -0
- package/dist/types/src/plugin/catalog.d.ts.map +1 -0
- package/dist/types/src/plugin/cli.d.ts +44 -0
- package/dist/types/src/plugin/cli.d.ts.map +1 -0
- package/dist/types/src/plugin/command-apply.d.ts +58 -0
- package/dist/types/src/plugin/command-apply.d.ts.map +1 -0
- package/dist/types/src/plugin/command-data.d.ts +330 -0
- package/dist/types/src/plugin/command-data.d.ts.map +1 -0
- package/dist/types/src/plugin/commands.d.ts +164 -0
- package/dist/types/src/plugin/commands.d.ts.map +1 -0
- package/dist/types/src/plugin/config/index.d.ts +16 -0
- package/dist/types/src/plugin/config/index.d.ts.map +1 -0
- package/dist/types/src/plugin/config/loader.d.ts +72 -0
- package/dist/types/src/plugin/config/loader.d.ts.map +1 -0
- package/dist/types/src/plugin/config/models.d.ts +3 -0
- package/dist/types/src/plugin/config/models.d.ts.map +1 -0
- package/dist/types/src/plugin/config/operator-settings-schema.d.ts +29 -0
- package/dist/types/src/plugin/config/operator-settings-schema.d.ts.map +1 -0
- package/dist/types/src/plugin/config/schema.d.ts +162 -0
- package/dist/types/src/plugin/config/schema.d.ts.map +1 -0
- package/dist/types/src/plugin/config/updater.d.ts +55 -0
- package/dist/types/src/plugin/config/updater.d.ts.map +1 -0
- package/dist/types/src/plugin/config/writer.d.ts +41 -0
- package/dist/types/src/plugin/config/writer.d.ts.map +1 -0
- package/dist/types/src/plugin/core/streaming/index.d.ts +3 -0
- package/dist/types/src/plugin/core/streaming/index.d.ts.map +1 -0
- package/dist/types/src/plugin/core/streaming/transformer.d.ts +12 -0
- package/dist/types/src/plugin/core/streaming/transformer.d.ts.map +1 -0
- package/dist/types/src/plugin/core/streaming/types.d.ts +34 -0
- package/dist/types/src/plugin/core/streaming/types.d.ts.map +1 -0
- package/dist/types/src/plugin/debug.d.ts +144 -0
- package/dist/types/src/plugin/debug.d.ts.map +1 -0
- package/dist/types/src/plugin/dependencies.d.ts +129 -0
- package/dist/types/src/plugin/dependencies.d.ts.map +1 -0
- package/dist/types/src/plugin/errors.d.ts +55 -0
- package/dist/types/src/plugin/errors.d.ts.map +1 -0
- package/dist/types/src/plugin/event-handler.d.ts +53 -0
- package/dist/types/src/plugin/event-handler.d.ts.map +1 -0
- package/dist/types/src/plugin/fetch/retry-state.d.ts +61 -0
- package/dist/types/src/plugin/fetch/retry-state.d.ts.map +1 -0
- package/dist/types/src/plugin/fetch/warmup.d.ts +30 -0
- package/dist/types/src/plugin/fetch/warmup.d.ts.map +1 -0
- package/dist/types/src/plugin/fetch-interceptor.d.ts +114 -0
- package/dist/types/src/plugin/fetch-interceptor.d.ts.map +1 -0
- package/dist/types/src/plugin/fetch-routing.d.ts +31 -0
- package/dist/types/src/plugin/fetch-routing.d.ts.map +1 -0
- package/dist/types/src/plugin/fingerprint.d.ts +2 -0
- package/dist/types/src/plugin/fingerprint.d.ts.map +1 -0
- package/dist/types/src/plugin/ga-location-services.d.ts +389 -0
- package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -0
- package/dist/types/src/plugin/gemini-dump.d.ts +72 -0
- package/dist/types/src/plugin/gemini-dump.d.ts.map +1 -0
- package/dist/types/src/plugin/google-search-tool.d.ts +10 -0
- package/dist/types/src/plugin/google-search-tool.d.ts.map +1 -0
- package/dist/types/src/plugin/image-saver.d.ts +6 -0
- package/dist/types/src/plugin/image-saver.d.ts.map +1 -0
- package/dist/types/src/plugin/index.d.ts +30 -0
- package/dist/types/src/plugin/index.d.ts.map +1 -0
- package/dist/types/src/plugin/killswitch.d.ts +93 -0
- package/dist/types/src/plugin/killswitch.d.ts.map +1 -0
- package/dist/types/src/plugin/lifecycle.d.ts +63 -0
- package/dist/types/src/plugin/lifecycle.d.ts.map +1 -0
- package/dist/types/src/plugin/logger.d.ts +83 -0
- package/dist/types/src/plugin/logger.d.ts.map +1 -0
- package/dist/types/src/plugin/logging-utils.d.ts +57 -0
- package/dist/types/src/plugin/logging-utils.d.ts.map +1 -0
- package/dist/types/src/plugin/model-registry.d.ts +2 -0
- package/dist/types/src/plugin/model-registry.d.ts.map +1 -0
- package/dist/types/src/plugin/neutral-types.d.ts +42 -0
- package/dist/types/src/plugin/neutral-types.d.ts.map +1 -0
- package/dist/types/src/plugin/oauth-login.d.ts +22 -0
- package/dist/types/src/plugin/oauth-login.d.ts.map +1 -0
- package/dist/types/src/plugin/oauth-methods.d.ts +43 -0
- package/dist/types/src/plugin/oauth-methods.d.ts.map +1 -0
- package/dist/types/src/plugin/operator-settings.d.ts +74 -0
- package/dist/types/src/plugin/operator-settings.d.ts.map +1 -0
- package/dist/types/src/plugin/persist-account-pool.d.ts +98 -0
- package/dist/types/src/plugin/persist-account-pool.d.ts.map +1 -0
- package/dist/types/src/plugin/project.d.ts +2 -0
- package/dist/types/src/plugin/project.d.ts.map +1 -0
- package/dist/types/src/plugin/prompt-context.d.ts +18 -0
- package/dist/types/src/plugin/prompt-context.d.ts.map +1 -0
- package/dist/types/src/plugin/quota.d.ts +441 -0
- package/dist/types/src/plugin/quota.d.ts.map +1 -0
- package/dist/types/src/plugin/recovery/constants.d.ts +22 -0
- package/dist/types/src/plugin/recovery/constants.d.ts.map +1 -0
- package/dist/types/src/plugin/recovery/storage.d.ts +24 -0
- package/dist/types/src/plugin/recovery/storage.d.ts.map +1 -0
- package/dist/types/src/plugin/recovery/types.d.ts +116 -0
- package/dist/types/src/plugin/recovery/types.d.ts.map +1 -0
- package/dist/types/src/plugin/recovery.d.ts +61 -0
- package/dist/types/src/plugin/recovery.d.ts.map +1 -0
- package/dist/types/src/plugin/refresh-queue.d.ts +133 -0
- package/dist/types/src/plugin/refresh-queue.d.ts.map +1 -0
- package/dist/types/src/plugin/request-helpers.d.ts +304 -0
- package/dist/types/src/plugin/request-helpers.d.ts.map +1 -0
- package/dist/types/src/plugin/request.d.ts +161 -0
- package/dist/types/src/plugin/request.d.ts.map +1 -0
- package/dist/types/src/plugin/rotation.d.ts +2 -0
- package/dist/types/src/plugin/rotation.d.ts.map +1 -0
- package/dist/types/src/plugin/search.d.ts +25 -0
- package/dist/types/src/plugin/search.d.ts.map +1 -0
- package/dist/types/src/plugin/server.d.ts +23 -0
- package/dist/types/src/plugin/server.d.ts.map +1 -0
- package/dist/types/src/plugin/session-context.d.ts +22 -0
- package/dist/types/src/plugin/session-context.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/local-grant.d.ts +26 -0
- package/dist/types/src/plugin/shared/local-grant.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/request-cancellation.d.ts +12 -0
- package/dist/types/src/plugin/shared/request-cancellation.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/request-services.d.ts +375 -0
- package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/runtime.d.ts +217 -0
- package/dist/types/src/plugin/shared/runtime.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/source-sidebar.d.ts +15 -0
- package/dist/types/src/plugin/shared/source-sidebar.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/vault-menu.d.ts +5 -0
- package/dist/types/src/plugin/shared/vault-menu.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +168 -0
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -0
- package/dist/types/src/plugin/storage.d.ts +221 -0
- package/dist/types/src/plugin/storage.d.ts.map +1 -0
- package/dist/types/src/plugin/stores/signature-store.d.ts +5 -0
- package/dist/types/src/plugin/stores/signature-store.d.ts.map +1 -0
- package/dist/types/src/plugin/thinking-recovery.d.ts +90 -0
- package/dist/types/src/plugin/thinking-recovery.d.ts.map +1 -0
- package/dist/types/src/plugin/token.d.ts +41 -0
- package/dist/types/src/plugin/token.d.ts.map +1 -0
- package/dist/types/src/plugin/transform/cross-model-sanitizer.d.ts +2 -0
- package/dist/types/src/plugin/transform/cross-model-sanitizer.d.ts.map +1 -0
- package/dist/types/src/plugin/transform/index.d.ts +2 -0
- package/dist/types/src/plugin/transform/index.d.ts.map +1 -0
- package/dist/types/src/plugin/transform/model-resolver.d.ts +2 -0
- package/dist/types/src/plugin/transform/model-resolver.d.ts.map +1 -0
- package/dist/types/src/plugin/transform/types.d.ts +2 -0
- package/dist/types/src/plugin/transform/types.d.ts.map +1 -0
- package/dist/types/src/plugin/types.d.ts +36 -0
- package/dist/types/src/plugin/types.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/ansi.d.ts +32 -0
- package/dist/types/src/plugin/ui/ansi.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/auth-menu.d.ts +59 -0
- package/dist/types/src/plugin/ui/auth-menu.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/confirm.d.ts +2 -0
- package/dist/types/src/plugin/ui/confirm.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/quota-status.d.ts +73 -0
- package/dist/types/src/plugin/ui/quota-status.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/select.d.ts +23 -0
- package/dist/types/src/plugin/ui/select.d.ts.map +1 -0
- package/dist/types/src/plugin/vault-activation.d.ts +11 -0
- package/dist/types/src/plugin/vault-activation.d.ts.map +1 -0
- package/dist/types/src/plugin/vault-custody.d.ts +131 -0
- package/dist/types/src/plugin/vault-custody.d.ts.map +1 -0
- package/dist/types/src/plugin/version.d.ts +2 -0
- package/dist/types/src/plugin/version.d.ts.map +1 -0
- package/dist/types/src/quota-presentation.d.ts +18 -0
- package/dist/types/src/quota-presentation.d.ts.map +1 -0
- package/dist/types/src/rpc/notifications.d.ts +6 -0
- package/dist/types/src/rpc/notifications.d.ts.map +1 -0
- package/dist/types/src/rpc/protocol.d.ts +53 -0
- package/dist/types/src/rpc/protocol.d.ts.map +1 -0
- package/dist/types/src/rpc/rpc-dir.d.ts +4 -0
- package/dist/types/src/rpc/rpc-dir.d.ts.map +1 -0
- package/dist/types/src/rpc/rpc-server.d.ts +24 -0
- package/dist/types/src/rpc/rpc-server.d.ts.map +1 -0
- package/dist/types/src/server.d.ts +30 -0
- package/dist/types/src/server.d.ts.map +1 -0
- package/dist/types/src/sidebar-state.d.ts +365 -0
- package/dist/types/src/sidebar-state.d.ts.map +1 -0
- package/dist/types/src/tui/host-api.d.ts +196 -0
- package/dist/types/src/tui/host-api.d.ts.map +1 -0
- package/package.json +45 -18
- package/server.js +6 -0
- package/src/common-auth-embedded/NOTICE.txt +21 -0
- package/src/common-auth-embedded/auth-menu/accounts.d.ts +97 -0
- package/src/common-auth-embedded/auth-menu/accounts.js +387 -0
- package/src/common-auth-embedded/auth-menu/ansi.d.ts +26 -0
- package/src/common-auth-embedded/auth-menu/ansi.js +98 -0
- package/src/common-auth-embedded/auth-menu/confirm.d.ts +7 -0
- package/src/common-auth-embedded/auth-menu/confirm.js +21 -0
- package/src/common-auth-embedded/auth-menu/doctor.d.ts +52 -0
- package/src/common-auth-embedded/auth-menu/doctor.js +81 -0
- package/src/common-auth-embedded/auth-menu/index.d.ts +17 -0
- package/src/common-auth-embedded/auth-menu/index.js +12 -0
- package/src/common-auth-embedded/auth-menu/login.d.ts +55 -0
- package/src/common-auth-embedded/auth-menu/login.js +83 -0
- package/src/common-auth-embedded/auth-menu/menu.d.ts +59 -0
- package/src/common-auth-embedded/auth-menu/menu.js +73 -0
- package/src/common-auth-embedded/auth-menu/opencode-v1.d.ts +49 -0
- package/src/common-auth-embedded/auth-menu/opencode-v1.js +47 -0
- package/src/common-auth-embedded/auth-menu/select.d.ts +21 -0
- package/src/common-auth-embedded/auth-menu/select.js +159 -0
- package/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
- package/src/common-auth-embedded/auth-menu/terminal.js +19 -0
- package/src/common-auth-embedded/claustrum/consumer.d.ts +102 -0
- package/src/common-auth-embedded/claustrum/consumer.js +298 -0
- package/src/common-auth-embedded/claustrum/custody.d.ts +175 -0
- package/src/common-auth-embedded/claustrum/custody.js +354 -0
- package/src/common-auth-embedded/claustrum/enrollment.d.ts +158 -0
- package/src/common-auth-embedded/claustrum/enrollment.js +759 -0
- package/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
- package/src/common-auth-embedded/claustrum/errors.js +8 -0
- package/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
- package/src/common-auth-embedded/claustrum/host-slot.js +72 -0
- package/src/common-auth-embedded/claustrum/index.d.ts +18 -0
- package/src/common-auth-embedded/claustrum/index.js +22 -0
- package/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
- package/src/common-auth-embedded/claustrum/interlock.js +29 -0
- package/src/common-auth-embedded/claustrum/roster.d.ts +208 -0
- package/src/common-auth-embedded/claustrum/roster.js +536 -0
- package/src/common-auth-embedded/commands/builtins.d.ts +71 -0
- package/src/common-auth-embedded/commands/builtins.js +534 -0
- package/src/common-auth-embedded/commands/index.d.ts +10 -0
- package/src/common-auth-embedded/commands/index.js +5 -0
- package/src/common-auth-embedded/commands/menu.d.ts +61 -0
- package/src/common-auth-embedded/commands/menu.js +300 -0
- package/src/common-auth-embedded/commands/model.d.ts +238 -0
- package/src/common-auth-embedded/commands/model.js +16 -0
- package/src/common-auth-embedded/commands/pi.d.ts +23 -0
- package/src/common-auth-embedded/commands/pi.js +206 -0
- package/src/common-auth-embedded/commands/seam.d.ts +72 -0
- package/src/common-auth-embedded/commands/seam.js +301 -0
- package/src/common-auth-embedded/fs/atomic-write.d.ts +20 -0
- package/src/common-auth-embedded/fs/atomic-write.js +80 -0
- package/src/common-auth-embedded/fs/index.d.ts +7 -0
- package/src/common-auth-embedded/fs/index.js +6 -0
- package/src/common-auth-embedded/fs/lock-constants.d.ts +14 -0
- package/src/common-auth-embedded/fs/lock-constants.js +14 -0
- package/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
- package/src/common-auth-embedded/fs/refresh-file-lock.js +501 -0
- package/src/common-auth-embedded/fs/with-lock.d.ts +33 -0
- package/src/common-auth-embedded/fs/with-lock.js +48 -0
- package/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
- package/src/common-auth-embedded/logger/capture-sink.js +13 -0
- package/src/common-auth-embedded/logger/engine.d.ts +100 -0
- package/src/common-auth-embedded/logger/engine.js +246 -0
- package/src/common-auth-embedded/logger/index.d.ts +6 -0
- package/src/common-auth-embedded/logger/index.js +3 -0
- package/src/common-auth-embedded/logger/redact.d.ts +11 -0
- package/src/common-auth-embedded/logger/redact.js +83 -0
- package/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
- package/src/common-auth-embedded/opencode2/errors.js +15 -0
- package/src/common-auth-embedded/opencode2/index.d.ts +8 -0
- package/src/common-auth-embedded/opencode2/index.js +4 -0
- package/src/common-auth-embedded/opencode2/install.d.ts +55 -0
- package/src/common-auth-embedded/opencode2/install.js +886 -0
- package/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
- package/src/common-auth-embedded/opencode2/integration.js +143 -0
- package/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
- package/src/common-auth-embedded/opencode2/sse.js +60 -0
- package/src/common-auth-embedded/opencode2/types.d.ts +413 -0
- package/src/common-auth-embedded/pi-slot/index.d.ts +3 -0
- package/src/common-auth-embedded/pi-slot/index.js +2 -0
- package/src/common-auth-embedded/pi-slot/lock.js +212 -0
- package/src/common-auth-embedded/pi-slot/slot.d.ts +49 -0
- package/src/common-auth-embedded/pi-slot/slot.js +383 -0
- package/src/common-auth-embedded/quota/codec.d.ts +11 -0
- package/src/common-auth-embedded/quota/codec.js +12 -0
- package/src/common-auth-embedded/quota/format.d.ts +46 -0
- package/src/common-auth-embedded/quota/format.js +138 -0
- package/src/common-auth-embedded/quota/index.d.ts +10 -0
- package/src/common-auth-embedded/quota/index.js +5 -0
- package/src/common-auth-embedded/quota/map.d.ts +63 -0
- package/src/common-auth-embedded/quota/map.js +105 -0
- package/src/common-auth-embedded/quota/merge.d.ts +48 -0
- package/src/common-auth-embedded/quota/merge.js +162 -0
- package/src/common-auth-embedded/quota/projection.d.ts +64 -0
- package/src/common-auth-embedded/quota/projection.js +134 -0
- package/src/common-auth-embedded/routing/admission.d.ts +93 -0
- package/src/common-auth-embedded/routing/admission.js +142 -0
- package/src/common-auth-embedded/routing/index.d.ts +8 -0
- package/src/common-auth-embedded/routing/index.js +4 -0
- package/src/common-auth-embedded/routing/ordered.d.ts +47 -0
- package/src/common-auth-embedded/routing/ordered.js +58 -0
- package/src/common-auth-embedded/routing/pins.d.ts +22 -0
- package/src/common-auth-embedded/routing/pins.js +34 -0
- package/src/common-auth-embedded/routing/sticky.d.ts +158 -0
- package/src/common-auth-embedded/routing/sticky.js +339 -0
- package/src/common-auth-embedded/rpc/client.d.ts +3 -0
- package/src/common-auth-embedded/rpc/client.js +2 -0
- package/src/common-auth-embedded/rpc/index.d.ts +10 -0
- package/src/common-auth-embedded/rpc/index.js +5 -0
- package/src/common-auth-embedded/rpc/notifications.d.ts +73 -0
- package/src/common-auth-embedded/rpc/notifications.js +100 -0
- package/src/common-auth-embedded/rpc/port-file.d.ts +33 -0
- package/src/common-auth-embedded/rpc/port-file.js +217 -0
- package/src/common-auth-embedded/rpc/rpc-client.d.ts +30 -0
- package/src/common-auth-embedded/rpc/rpc-client.js +253 -0
- package/src/common-auth-embedded/rpc/rpc-server.d.ts +58 -0
- package/src/common-auth-embedded/rpc/rpc-server.js +311 -0
- package/src/common-auth-embedded/rpc/server-registry.d.ts +11 -0
- package/src/common-auth-embedded/rpc/server-registry.js +47 -0
- package/src/common-auth-embedded/source-output.json +1326 -0
- package/src/common-auth-embedded/store/attribution.d.ts +28 -0
- package/src/common-auth-embedded/store/attribution.js +60 -0
- package/src/common-auth-embedded/store/errors.d.ts +55 -0
- package/src/common-auth-embedded/store/errors.js +38 -0
- package/src/common-auth-embedded/store/hooks.d.ts +12 -0
- package/src/common-auth-embedded/store/hooks.js +34 -0
- package/src/common-auth-embedded/store/identity.d.ts +39 -0
- package/src/common-auth-embedded/store/identity.js +79 -0
- package/src/common-auth-embedded/store/index.d.ts +21 -0
- package/src/common-auth-embedded/store/index.js +7 -0
- package/src/common-auth-embedded/store/mutate.d.ts +189 -0
- package/src/common-auth-embedded/store/mutate.js +500 -0
- package/src/common-auth-embedded/store/pool.d.ts +196 -0
- package/src/common-auth-embedded/store/pool.js +120 -0
- package/src/common-auth-embedded/store/provider-state.d.ts +131 -0
- package/src/common-auth-embedded/store/provider-state.js +226 -0
- package/src/common-auth-embedded/store/publication.d.ts +47 -0
- package/src/common-auth-embedded/store/publication.js +304 -0
- package/src/common-auth-embedded/store/pull.d.ts +36 -0
- package/src/common-auth-embedded/store/pull.js +143 -0
- package/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
- package/src/common-auth-embedded/store/refresh-lock.js +136 -0
- package/src/common-auth-embedded/store/refresh.d.ts +72 -0
- package/src/common-auth-embedded/store/refresh.js +225 -0
- package/src/common-auth-embedded/store/reserved.js +13 -0
- package/src/common-auth-embedded/store/rows.d.ts +313 -0
- package/src/common-auth-embedded/store/rows.js +1258 -0
- package/src/common-auth-embedded/store/runtime.d.ts +36 -0
- package/src/common-auth-embedded/store/runtime.js +68 -0
- package/src/common-auth-embedded/store/schema.d.ts +443 -0
- package/src/common-auth-embedded/store/schema.js +754 -0
- package/src/common-auth-embedded/store/settings.d.ts +63 -0
- package/src/common-auth-embedded/store/settings.js +120 -0
- package/src/common-auth-embedded/store/torn.d.ts +78 -0
- package/src/common-auth-embedded/store/torn.js +294 -0
- package/src/common-auth-embedded/tui/index.d.ts +8 -0
- package/src/common-auth-embedded/tui/index.js +21 -0
- package/src/common-auth-embedded/util/any-signal.js +42 -0
- package/src/plugin/command-data.ts +3 -0
- package/src/rpc/port-file.ts +6 -140
- package/src/rpc/protocol.ts +59 -24
- package/src/rpc/rpc-client.ts +101 -71
- package/src/sidebar-state.ts +82 -24
- package/src/tui/command-dialogs.tsx +412 -776
- package/src/tui/entry.d.mts +17 -0
- package/src/tui/entry.mjs +34 -66
- package/src/tui/file-logger.ts +22 -7
- package/src/tui-compiled/common-auth-embedded/logger/capture-sink.js +13 -0
- package/src/tui-compiled/common-auth-embedded/logger/engine.js +246 -0
- package/src/tui-compiled/common-auth-embedded/logger/index.js +3 -0
- package/src/tui-compiled/common-auth-embedded/logger/redact.js +83 -0
- package/src/tui-compiled/common-auth-embedded/quota/codec.js +12 -0
- package/src/tui-compiled/common-auth-embedded/quota/format.js +138 -0
- package/src/tui-compiled/common-auth-embedded/quota/index.js +5 -0
- package/src/tui-compiled/common-auth-embedded/quota/map.js +105 -0
- package/src/tui-compiled/common-auth-embedded/quota/merge.js +162 -0
- package/src/tui-compiled/common-auth-embedded/quota/projection.js +134 -0
- package/src/tui-compiled/common-auth-embedded/rpc/client.js +2 -0
- package/src/tui-compiled/common-auth-embedded/rpc/port-file.js +217 -0
- package/src/tui-compiled/common-auth-embedded/rpc/rpc-client.js +253 -0
- package/src/tui-compiled/logging/provider-key-policy.js +3 -0
- package/src/tui-compiled/quota-presentation.js +42 -0
- package/src/tui-compiled/rpc/rpc-client.js +35 -0
- package/src/tui-compiled/rpc/rpc-dir.js +13 -0
- package/src/tui-compiled/selector.js +21 -0
- package/src/tui-compiled/sidebar-state.js +401 -0
- package/src/tui-compiled/tui/command-dialogs.js +424 -0
- package/src/tui-compiled/tui/file-logger.js +73 -0
- package/src/tui-compiled/tui/host-api.js +269 -0
- package/src/tui-compiled/tui/host-v1.js +228 -0
- package/src/tui-compiled/tui-preferences.js +230 -0
- package/src/tui-compiled/{tui.tsx → tui.js} +140 -231
- package/src/tui-ga-compiled/host-ga.js +1304 -0
- package/src/tui-ga-compiled/selector.js +21 -0
- package/src/tui-ga-compiled/shared/07365a7d2ccade4c-host-api.js +269 -0
- package/src/tui-ga-compiled/shared/0e19a88ff3535906-command-dialogs.js +424 -0
- package/src/tui-ga-compiled/shared/1ff34afa7c42d196-projection.js +134 -0
- package/src/tui-ga-compiled/shared/77138df80c7ae006-map.js +105 -0
- package/src/tui-ga-compiled/shared/8ae1927e5910ea81-sidebar-projection.js +112 -0
- package/src/tui-ga-compiled/shared/98cc0c186c46c42d-quota-presentation.js +42 -0
- package/src/tui-ga-compiled/shared/aef2402f8fc342f0-format.js +138 -0
- package/src/tui-ga-compiled/shared/bf17cbee28e58197-index.js +5 -0
- package/src/tui-ga-compiled/shared/ca21dc417b36dc5d-codec.js +12 -0
- package/src/tui-ga-compiled/shared/ecc214300932dfb6-merge.js +162 -0
- package/src/tui-ga-raw/host-ga.tsx +1740 -0
- package/src/tui-ga-raw/selector.js +21 -0
- package/src/tui-ga-raw/shared/07365a7d2ccade4c-host-api.js +269 -0
- package/src/tui-ga-raw/shared/0e19a88ff3535906-command-dialogs.tsx +468 -0
- package/src/tui-ga-raw/shared/1ff34afa7c42d196-projection.js +134 -0
- package/src/tui-ga-raw/shared/77138df80c7ae006-map.js +105 -0
- package/src/tui-ga-raw/shared/8ae1927e5910ea81-sidebar-projection.js +112 -0
- package/src/tui-ga-raw/shared/98cc0c186c46c42d-quota-presentation.js +42 -0
- package/src/tui-ga-raw/shared/aef2402f8fc342f0-format.js +138 -0
- package/src/tui-ga-raw/shared/bf17cbee28e58197-index.js +5 -0
- package/src/tui-ga-raw/shared/ca21dc417b36dc5d-codec.js +12 -0
- package/src/tui-ga-raw/shared/ecc214300932dfb6-merge.js +162 -0
- package/src/tui-raw/common-auth-embedded/logger/capture-sink.js +13 -0
- package/src/tui-raw/common-auth-embedded/logger/engine.js +246 -0
- package/src/tui-raw/common-auth-embedded/logger/index.js +3 -0
- package/src/tui-raw/common-auth-embedded/logger/redact.js +83 -0
- package/src/tui-raw/common-auth-embedded/quota/codec.js +12 -0
- package/src/tui-raw/common-auth-embedded/quota/format.js +138 -0
- package/src/tui-raw/common-auth-embedded/quota/index.js +5 -0
- package/src/tui-raw/common-auth-embedded/quota/map.js +105 -0
- package/src/tui-raw/common-auth-embedded/quota/merge.js +162 -0
- package/src/tui-raw/common-auth-embedded/quota/projection.js +134 -0
- package/src/tui-raw/common-auth-embedded/rpc/client.js +2 -0
- package/src/tui-raw/common-auth-embedded/rpc/port-file.js +217 -0
- package/src/tui-raw/common-auth-embedded/rpc/rpc-client.js +253 -0
- package/src/tui-raw/logging/provider-key-policy.js +3 -0
- package/src/tui-raw/quota-presentation.js +42 -0
- package/src/tui-raw/rpc/rpc-client.js +35 -0
- package/src/tui-raw/rpc/rpc-dir.js +13 -0
- package/src/tui-raw/selector.js +21 -0
- package/src/tui-raw/sidebar-state.js +401 -0
- package/src/tui-raw/tui/command-dialogs.tsx +468 -0
- package/src/tui-raw/tui/file-logger.js +73 -0
- package/src/tui-raw/tui/host-api.js +269 -0
- package/src/tui-raw/tui/host-v1.tsx +249 -0
- package/src/tui-raw/tui-preferences.js +230 -0
- package/src/tui-raw/tui.tsx +1088 -0
- package/src/tui.tsx +58 -141
- package/tui.js +6 -0
- package/src/tui-compiled/plugin/command-data.ts +0 -931
- package/src/tui-compiled/rpc/port-file.ts +0 -143
- package/src/tui-compiled/rpc/protocol.ts +0 -31
- package/src/tui-compiled/rpc/rpc-client.ts +0 -102
- package/src/tui-compiled/rpc/rpc-dir.ts +0 -24
- package/src/tui-compiled/sidebar-state.ts +0 -991
- package/src/tui-compiled/tui/command-dialogs.tsx +0 -779
- package/src/tui-compiled/tui/file-logger.ts +0 -145
- package/src/tui-compiled/tui-preferences.ts +0 -416
package/dist/src/plugin/index.js
CHANGED
|
@@ -1,36 +1,45 @@
|
|
|
1
|
-
import { createHash } from 'node:crypto';
|
|
2
|
-
import { join } from 'node:path';
|
|
1
|
+
import { createHash, randomUUID } from 'node:crypto';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
import { loadCommonAuthCommands, VAULT_ACCOUNT_REMEDY, } from '@cortexkit/antigravity-auth-core';
|
|
4
|
+
import { cliAccountOf } from '../cli';
|
|
3
5
|
import { ANTIGRAVITY_PROVIDER_ID } from '../constants';
|
|
4
6
|
import { createAutoUpdateCheckerHook } from '../hooks/auto-update-checker';
|
|
5
7
|
import { drainNotifications, pushNotification } from '../rpc/notifications';
|
|
6
8
|
import { getRpcDir } from '../rpc/rpc-dir';
|
|
7
9
|
import { startRpcServer } from '../rpc/rpc-server';
|
|
8
|
-
import { drainSidebarWrites, getSidebarStateFile, isAccountCurrent, toCapturedTier, } from '../sidebar-state';
|
|
10
|
+
import { buildSidebarMachineStateFromAccounts, drainSidebarWrites, getSidebarStateFile, isAccountCurrent, setSidebarMachineState, toCapturedTier, upsertSidebarActiveRouting, } from '../sidebar-state';
|
|
9
11
|
import { createAccountAccessService, promptAccountIndexForVerification, promptOpenVerificationUrl, } from './account-access';
|
|
10
12
|
import { createAccountCommandOAuthService } from './account-command-oauth';
|
|
11
13
|
import { createAuthLoader } from './auth-loader';
|
|
12
14
|
import { BackgroundQuotaRefresh } from './background-quota-refresh';
|
|
13
15
|
import { initDiskSignatureCache, shutdownDiskSignatureCache } from './cache';
|
|
14
16
|
import { applyAntigravityProviderCatalog, registerAntigravityCommands, } from './catalog';
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
+
import { createStoreAccountLimits } from './command-apply';
|
|
18
|
+
import { projectCommandAccountRows } from './command-data';
|
|
19
|
+
import { ANTIGRAVITY_MENU_COMMAND, createAccountTargets, createAntigravityCommandExecuteBefore, createOpenCodeAntigravityMenu, createOpenCodeVaultAntigravityMenu, menuInvocation, } from './commands';
|
|
17
20
|
import { initRuntimeConfig, loadConfig } from './config';
|
|
18
21
|
import { getUserConfigPath } from './config/loader';
|
|
19
22
|
import { closeDebugLog, initializeDebug } from './debug';
|
|
20
23
|
import { resolvePluginDependencies, } from './dependencies';
|
|
21
24
|
import { createEventHandler } from './event-handler';
|
|
22
|
-
import { createFetchInterceptor } from './fetch-interceptor';
|
|
25
|
+
import { createFetchInterceptor, createVaultFetchInterceptor, } from './fetch-interceptor';
|
|
26
|
+
import { isGeminiDumpEnabled, setGeminiDumpEnabled } from './gemini-dump';
|
|
23
27
|
import { createGoogleSearchTool } from './google-search-tool';
|
|
24
28
|
import { createPluginLifecycle } from './lifecycle';
|
|
25
29
|
import { createLogger, initLogger, setRuntimeLogLevel } from './logger';
|
|
26
30
|
import { createOAuthMethods, openBrowserWithSystem } from './oauth-methods';
|
|
27
31
|
import { createOperatorSettingsController, } from './operator-settings';
|
|
28
|
-
import { persistAccountPool } from './persist-account-pool';
|
|
29
|
-
import { createOpenCodeQuotaManager, makeTierLoader, } from './quota';
|
|
32
|
+
import { commitLogins, persistAccountPool, replacePoolLogins, } from './persist-account-pool';
|
|
33
|
+
import { createOpenCodeQuotaManager, createStoreQuotaService, fetchVaultAccountQuota, makeTierLoader, } from './quota';
|
|
30
34
|
import { createSessionRecoveryHook } from './recovery';
|
|
31
35
|
import { getHealthTracker, initHealthTracker, initTokenTracker, } from './rotation';
|
|
32
36
|
import { AgySessionRegistry } from './session-context';
|
|
37
|
+
import { createSourceSidebarPublisher } from './shared/source-sidebar';
|
|
38
|
+
import { createVaultAccountMenuSections } from './shared/vault-menu';
|
|
39
|
+
import { checkVaultQuota, createVaultAccountPool, vaultAccountRowKey, } from './shared/vault-request-credentials';
|
|
33
40
|
import { clearAccounts, getStoragePath, loadAccounts, mutateAccountStorage, } from './storage';
|
|
41
|
+
import { createV1VaultActivationMethod } from './vault-activation';
|
|
42
|
+
import { createOpenCodeVaultCustody } from './vault-custody';
|
|
34
43
|
import { initAntigravityVersion } from './version';
|
|
35
44
|
const logger = createLogger('plugin');
|
|
36
45
|
/**
|
|
@@ -79,6 +88,7 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
79
88
|
}
|
|
80
89
|
const sessionRegistry = new AgySessionRegistry(directory);
|
|
81
90
|
let cachedGetAuth = null;
|
|
91
|
+
let stopSidebarPublisher;
|
|
82
92
|
const lifecycle = createPluginLifecycle({
|
|
83
93
|
sessionRegistry,
|
|
84
94
|
shutdownDiskSignatureCache,
|
|
@@ -88,8 +98,50 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
88
98
|
// Drain pending sidebar writes BEFORE tearing down the RPC server
|
|
89
99
|
// and file logger — a fetch-interceptor routing upsert enqueued at
|
|
90
100
|
// shutdown must land before the host closes the terminal.
|
|
91
|
-
drainSidebarWrites
|
|
101
|
+
drainSidebarWrites: async () => {
|
|
102
|
+
await stopSidebarPublisher?.();
|
|
103
|
+
await drainSidebarWrites();
|
|
104
|
+
},
|
|
105
|
+
});
|
|
106
|
+
// Store vault enrollment and account-source settings beside the shared pool.
|
|
107
|
+
// Vault requests obtain credentials from Claustrum, never OpenCode's Google login.
|
|
108
|
+
const vaultCustody = createOpenCodeVaultCustody({
|
|
109
|
+
accountFile: resolve(getStoragePath()),
|
|
110
|
+
readHostSlot: async () => {
|
|
111
|
+
if (!cachedGetAuth)
|
|
112
|
+
throw new Error('OpenCode has not provided its sign-in yet');
|
|
113
|
+
return cachedGetAuth();
|
|
114
|
+
},
|
|
115
|
+
// The request executor reports failed bearer authorization to Claustrum,
|
|
116
|
+
// which decides whether its served credential needs replacement.
|
|
117
|
+
reporterSource: 'direct',
|
|
118
|
+
onAuthorityChanged: () => scheduleSidebarPublication(),
|
|
119
|
+
onRosterChanged: () => scheduleSidebarPublication(),
|
|
92
120
|
});
|
|
121
|
+
let vaultPool;
|
|
122
|
+
const currentVaultPool = async () => {
|
|
123
|
+
const source = await vaultCustody.custodySource();
|
|
124
|
+
if (vaultPool && vaultPool.source === source)
|
|
125
|
+
return vaultPool;
|
|
126
|
+
vaultPool = {
|
|
127
|
+
source,
|
|
128
|
+
pool: createVaultAccountPool({
|
|
129
|
+
source,
|
|
130
|
+
durable: { source, readState: () => vaultCustody.readState() },
|
|
131
|
+
}),
|
|
132
|
+
};
|
|
133
|
+
return vaultPool;
|
|
134
|
+
};
|
|
135
|
+
const readAuthority = async () => {
|
|
136
|
+
const mode = await vaultCustody.readMode();
|
|
137
|
+
return !mode.ok
|
|
138
|
+
? 'unreadable'
|
|
139
|
+
: mode.record.mode === 'custody'
|
|
140
|
+
? 'vault'
|
|
141
|
+
: 'local';
|
|
142
|
+
};
|
|
143
|
+
const mayRunLocalAccounts = async () => (await readAuthority()) === 'local' &&
|
|
144
|
+
(await authLoader.accountStore()).status !== 'migration-required';
|
|
93
145
|
const quotaManager = createOpenCodeQuotaManager(client, providerId, {
|
|
94
146
|
// Route quota fetches through the injected transport so e2e and
|
|
95
147
|
// custom-host deployments stay on the loopback/mock server for both
|
|
@@ -97,10 +149,17 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
97
149
|
// poller always hits the production Antigravity endpoint even when
|
|
98
150
|
// the caller injected a mock transport.
|
|
99
151
|
fetchVia: dependencies.agyTransport,
|
|
100
|
-
|
|
152
|
+
mayRun: mayRunLocalAccounts,
|
|
153
|
+
fetchStoreAccountQuota: async (account, request) => {
|
|
154
|
+
const service = await currentStoreQuota();
|
|
155
|
+
if (!service)
|
|
156
|
+
throw new Error('The current store quota service is unavailable');
|
|
157
|
+
return service.fetchAccountQuota(account, request);
|
|
158
|
+
}, // Bind to the live AccountManager so every refresh (manual or
|
|
101
159
|
// background) pushes the freshly-updated quota percentages into the
|
|
102
160
|
// sidebar without an extra RPC. The wrapper reads lazily so the
|
|
103
161
|
// AccountManager reference stays stable across reloads.
|
|
162
|
+
publishSidebar: () => sidebarPublisher.publish(),
|
|
104
163
|
getAccountsForSidebar: () => {
|
|
105
164
|
const manager = lifecycle.getAccountManager();
|
|
106
165
|
if (!manager)
|
|
@@ -113,6 +172,7 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
113
172
|
current: isAccountCurrent(entry.index, activeByFamily),
|
|
114
173
|
coolingDownUntil: entry.coolingDownUntil,
|
|
115
174
|
cachedQuota: entry.cachedQuota,
|
|
175
|
+
cachedQuotaUpdatedAt: entry.cachedQuotaUpdatedAt,
|
|
116
176
|
// Carry the identity stamp so the sidebar projection can
|
|
117
177
|
// detect a stale snapshot that landed on the wrong account
|
|
118
178
|
// after an index shift (see `redactAccountForSidebar`).
|
|
@@ -128,6 +188,91 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
128
188
|
return manager.getActiveIndexByFamily();
|
|
129
189
|
},
|
|
130
190
|
});
|
|
191
|
+
const sidebarPublisher = createSourceSidebarPublisher({
|
|
192
|
+
readAuthority,
|
|
193
|
+
local: async () => {
|
|
194
|
+
const manager = lifecycle.getAccountManager();
|
|
195
|
+
const active = manager?.getActiveIndexByFamily();
|
|
196
|
+
return buildSidebarMachineStateFromAccounts(manager?.getAccounts().map((entry) => ({
|
|
197
|
+
index: entry.index,
|
|
198
|
+
enabled: entry.enabled,
|
|
199
|
+
current: active ? isAccountCurrent(entry.index, active) : false,
|
|
200
|
+
coolingDownUntil: entry.coolingDownUntil,
|
|
201
|
+
healthScore: getHealthTracker().getScore(entry.index),
|
|
202
|
+
cachedQuota: entry.cachedQuota,
|
|
203
|
+
cachedQuotaUpdatedAt: entry.cachedQuotaUpdatedAt,
|
|
204
|
+
cachedQuotaAccountId: entry.cachedQuotaAccountId,
|
|
205
|
+
currentQuotaAccountId: quotaAccountIdentity(entry.parts.refreshToken),
|
|
206
|
+
tier: toCapturedTier(entry),
|
|
207
|
+
})) ?? []);
|
|
208
|
+
},
|
|
209
|
+
vault: async () => {
|
|
210
|
+
const { pool } = await currentVaultPool();
|
|
211
|
+
await pool.sync();
|
|
212
|
+
const projection = buildSidebarMachineStateFromAccounts(pool.selector.rows.map((entry) => ({
|
|
213
|
+
index: entry.index,
|
|
214
|
+
enabled: entry.enabled,
|
|
215
|
+
current: false,
|
|
216
|
+
coolingDownUntil: entry.coolingDownUntil,
|
|
217
|
+
healthScore: pool.selector.healthTracker.getScore(entry.index),
|
|
218
|
+
cachedQuota: entry.cachedQuota,
|
|
219
|
+
cachedQuotaUpdatedAt: entry.cachedQuotaUpdatedAt,
|
|
220
|
+
})));
|
|
221
|
+
return {
|
|
222
|
+
...projection,
|
|
223
|
+
accounts: projection.accounts.map((account) => ({
|
|
224
|
+
...account,
|
|
225
|
+
id: `vault-${account.id}`,
|
|
226
|
+
})),
|
|
227
|
+
...(projection.accounts.length === 0
|
|
228
|
+
? { lastError: VAULT_ACCOUNT_REMEDY }
|
|
229
|
+
: {}),
|
|
230
|
+
};
|
|
231
|
+
},
|
|
232
|
+
write: async (state, ids) => {
|
|
233
|
+
// Keep the existing account-state snapshot untouched until offline
|
|
234
|
+
// migration. Approved vault publication still uses its own accounts.
|
|
235
|
+
if ((await readAuthority()) === 'local' &&
|
|
236
|
+
(await authLoader.accountStore()).status === 'migration-required')
|
|
237
|
+
return;
|
|
238
|
+
await setSidebarMachineState(state, { retainRoutingForAccountIds: ids });
|
|
239
|
+
},
|
|
240
|
+
});
|
|
241
|
+
function scheduleSidebarPublication() {
|
|
242
|
+
void sidebarPublisher.publish().catch((error) => logger.debug('sidebar-source-publish-failed', {
|
|
243
|
+
error: error instanceof Error ? error.name : 'unknown',
|
|
244
|
+
}));
|
|
245
|
+
}
|
|
246
|
+
const routingWrites = new Set();
|
|
247
|
+
let routingClosed = false;
|
|
248
|
+
stopSidebarPublisher = async () => {
|
|
249
|
+
routingClosed = true;
|
|
250
|
+
await Promise.allSettled([...routingWrites]);
|
|
251
|
+
await sidebarPublisher.dispose();
|
|
252
|
+
await vaultCustody.dispose();
|
|
253
|
+
};
|
|
254
|
+
const publishRouting = (source) => (sessionId, entry) => {
|
|
255
|
+
if (routingClosed)
|
|
256
|
+
return;
|
|
257
|
+
const writing = (async () => {
|
|
258
|
+
await sidebarPublisher.publish();
|
|
259
|
+
if ((await readAuthority()) !== source)
|
|
260
|
+
return;
|
|
261
|
+
await upsertSidebarActiveRouting(sessionId, {
|
|
262
|
+
...entry,
|
|
263
|
+
accountId: source === 'vault'
|
|
264
|
+
? `vault-${entry.accountId}`
|
|
265
|
+
: entry.accountId,
|
|
266
|
+
}, {
|
|
267
|
+
authoritative: true,
|
|
268
|
+
onlyForProjectedAccounts: true,
|
|
269
|
+
});
|
|
270
|
+
})().catch((error) => logger.debug('sidebar-routing-publish-failed', {
|
|
271
|
+
error: error instanceof Error ? error.name : 'unknown',
|
|
272
|
+
}));
|
|
273
|
+
routingWrites.add(writing);
|
|
274
|
+
void writing.finally(() => routingWrites.delete(writing));
|
|
275
|
+
};
|
|
131
276
|
// Producer phase: the quota manager emits fire-and-forget sidebar
|
|
132
277
|
// writes after every refresh. Its dispose() awaits any in-flight
|
|
133
278
|
// refresh, so disposing it BEFORE the sidebar drain guarantees the
|
|
@@ -141,6 +286,8 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
141
286
|
// guaranteeing any final poll write lands before the drain flushes.
|
|
142
287
|
if (config.background_quota_refresh) {
|
|
143
288
|
const poller = new BackgroundQuotaRefresh({
|
|
289
|
+
publishSidebar: () => sidebarPublisher.publish(),
|
|
290
|
+
mayRun: mayRunLocalAccounts,
|
|
144
291
|
intervalMs: config.background_quota_refresh_interval_minutes * 60_000,
|
|
145
292
|
sidebarStateFile: getSidebarStateFile(),
|
|
146
293
|
getAccountManager: () => lifecycle.getAccountManager(),
|
|
@@ -148,7 +295,18 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
148
295
|
// Resolve plan tier for accounts with stale capturedTierAt. Uses
|
|
149
296
|
// the same token-refresh path as the quota manager without a separate
|
|
150
297
|
// network seam -- tier is best-effort metadata, not quota.
|
|
151
|
-
loadAccountTier: makeTierLoader(client, providerId
|
|
298
|
+
loadAccountTier: makeTierLoader(client, providerId, {
|
|
299
|
+
mayRun: mayRunLocalAccounts,
|
|
300
|
+
authorizeStore: async (account) => {
|
|
301
|
+
const service = await currentStoreQuota();
|
|
302
|
+
return service
|
|
303
|
+
? service.authorizeLocalCheck(account)
|
|
304
|
+
: {
|
|
305
|
+
status: 'refused',
|
|
306
|
+
reason: 'The current store quota service is unavailable',
|
|
307
|
+
};
|
|
308
|
+
},
|
|
309
|
+
}),
|
|
152
310
|
// Thread the injected clock so e2e tests can control startup
|
|
153
311
|
// jitter and timing without needing a real 30-second wait.
|
|
154
312
|
now: dependencies.clock.now,
|
|
@@ -186,103 +344,241 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
186
344
|
updateChecker,
|
|
187
345
|
logger,
|
|
188
346
|
});
|
|
189
|
-
//
|
|
190
|
-
//
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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);
|
|
347
|
+
// The menu's manual quota check runs through the store quota service of
|
|
348
|
+
// the manager currently routing with the store; a new manager (after an
|
|
349
|
+
// account add reloads the runtime) gets its own service and the old one
|
|
350
|
+
// is disposed. A ref the current manager does not hold is reported as
|
|
351
|
+
// not checked by the service itself.
|
|
352
|
+
let storeQuota = null;
|
|
353
|
+
const currentStoreQuota = async (knownRepository) => {
|
|
354
|
+
const manager = lifecycle.getAccountManager();
|
|
355
|
+
if (manager === null)
|
|
356
|
+
return null;
|
|
357
|
+
const opening = knownRepository
|
|
358
|
+
? undefined
|
|
359
|
+
: await authLoader.accountStore();
|
|
360
|
+
const repository = knownRepository ??
|
|
361
|
+
(opening?.status === 'ready' ? opening.repository : undefined);
|
|
362
|
+
if (!repository)
|
|
363
|
+
return null;
|
|
364
|
+
if (storeQuota?.manager !== manager) {
|
|
365
|
+
const previous = storeQuota;
|
|
366
|
+
storeQuota = {
|
|
367
|
+
manager,
|
|
368
|
+
service: createStoreQuotaService({
|
|
369
|
+
mayRun: async () => (await readAuthority()) === 'local',
|
|
370
|
+
manager,
|
|
371
|
+
repository,
|
|
372
|
+
logger: createLogger('store-quota'),
|
|
373
|
+
}),
|
|
374
|
+
};
|
|
375
|
+
await previous?.service.dispose();
|
|
376
|
+
}
|
|
377
|
+
return storeQuota.service;
|
|
378
|
+
};
|
|
379
|
+
const checkStoreQuota = async (repository, refs) => {
|
|
380
|
+
const service = await currentStoreQuota(repository);
|
|
381
|
+
return service
|
|
382
|
+
? service.checkStoreQuota(refs)
|
|
383
|
+
: { checked: 0, notChecked: refs.length };
|
|
384
|
+
};
|
|
385
|
+
lifecycle.register({
|
|
386
|
+
dispose: async () => {
|
|
387
|
+
const current = storeQuota;
|
|
388
|
+
storeQuota = null;
|
|
389
|
+
await current?.service.dispose();
|
|
390
|
+
},
|
|
391
|
+
}, 'producer');
|
|
392
|
+
// The `/antigravity` menu is built once per account-store repository,
|
|
393
|
+
// on the same common-auth commands module whose request parser the RPC
|
|
394
|
+
// server uses, so a request is parsed and applied by one module instance.
|
|
395
|
+
const commandsModule = await loadCommonAuthCommands();
|
|
396
|
+
let builtMenu = null;
|
|
397
|
+
let builtVaultMenu;
|
|
398
|
+
const vaultSelectors = new Map();
|
|
399
|
+
let unavailableVaultMenu;
|
|
400
|
+
const showUnavailableVaultMenu = async () => {
|
|
401
|
+
unavailableVaultMenu ??= createOpenCodeVaultAntigravityMenu({
|
|
402
|
+
commands: commandsModule,
|
|
403
|
+
settings: operatorSettings,
|
|
404
|
+
dump: {
|
|
405
|
+
isEnabled: isGeminiDumpEnabled,
|
|
406
|
+
setEnabled: setGeminiDumpEnabled,
|
|
258
407
|
},
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
408
|
+
applyLogLevel: setRuntimeLogLevel,
|
|
409
|
+
vault: vaultCustody.menuSection(),
|
|
410
|
+
sections: {
|
|
411
|
+
accounts: {
|
|
412
|
+
title: 'Accounts',
|
|
413
|
+
build: () => ({ lines: [VAULT_ACCOUNT_REMEDY] }),
|
|
414
|
+
},
|
|
415
|
+
quota: { title: 'Quota', build: () => ({}) },
|
|
264
416
|
},
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
417
|
+
});
|
|
418
|
+
return { kind: 'menu', menu: await unavailableVaultMenu };
|
|
419
|
+
};
|
|
420
|
+
const currentMenu = async () => {
|
|
421
|
+
const authority = await readAuthority();
|
|
422
|
+
if (authority !== 'local') {
|
|
423
|
+
if (authority !== 'vault')
|
|
424
|
+
return showUnavailableVaultMenu();
|
|
425
|
+
let current;
|
|
426
|
+
try {
|
|
427
|
+
current = await currentVaultPool();
|
|
428
|
+
await current.pool.sync();
|
|
429
|
+
}
|
|
430
|
+
catch {
|
|
431
|
+
return showUnavailableVaultMenu();
|
|
432
|
+
}
|
|
433
|
+
const { source, pool } = current;
|
|
434
|
+
if (builtVaultMenu?.pool !== pool) {
|
|
435
|
+
builtVaultMenu = {
|
|
436
|
+
pool,
|
|
437
|
+
menu: createOpenCodeVaultAntigravityMenu({
|
|
438
|
+
commands: commandsModule,
|
|
439
|
+
settings: operatorSettings,
|
|
440
|
+
dump: {
|
|
441
|
+
isEnabled: isGeminiDumpEnabled,
|
|
442
|
+
setEnabled: setGeminiDumpEnabled,
|
|
443
|
+
},
|
|
444
|
+
applyLogLevel: setRuntimeLogLevel,
|
|
445
|
+
vault: vaultCustody.menuSection(),
|
|
446
|
+
sections: createVaultAccountMenuSections(pool, (row) => {
|
|
447
|
+
const key = vaultAccountRowKey(row);
|
|
448
|
+
const existing = vaultSelectors.get(key);
|
|
449
|
+
if (existing)
|
|
450
|
+
return existing;
|
|
451
|
+
const selector = randomUUID();
|
|
452
|
+
vaultSelectors.set(key, selector);
|
|
453
|
+
return selector;
|
|
454
|
+
}, (signal) => checkVaultQuota({
|
|
455
|
+
pool,
|
|
456
|
+
signal,
|
|
457
|
+
fetchReading: (ref, check) => fetchVaultAccountQuota({
|
|
458
|
+
source,
|
|
459
|
+
ref,
|
|
460
|
+
signal: check,
|
|
461
|
+
logger,
|
|
462
|
+
transport: dependencies.fetchImpl,
|
|
463
|
+
}),
|
|
464
|
+
})),
|
|
465
|
+
}),
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
return { kind: 'menu', menu: await builtVaultMenu.menu };
|
|
469
|
+
}
|
|
470
|
+
const opening = await authLoader.accountStore();
|
|
471
|
+
if (opening.status !== 'ready') {
|
|
472
|
+
return {
|
|
473
|
+
kind: 'unavailable',
|
|
474
|
+
message: opening.status === 'initialization-required'
|
|
475
|
+
? 'No Antigravity accounts yet. Sign in to Google from OpenCode\u2019s provider login to add the first one.'
|
|
476
|
+
: authLoader.usesPoolFile(opening)
|
|
477
|
+
? 'Antigravity accounts are still in the pre-store account file. Stop OpenCode and run `antigravity-auth migrate --offline` to manage them from /antigravity.'
|
|
478
|
+
: opening.status === 'refused'
|
|
479
|
+
? opening.message
|
|
480
|
+
: 'The Antigravity account store cannot be opened.',
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
if (builtMenu?.repository !== opening.repository) {
|
|
484
|
+
builtMenu = {
|
|
485
|
+
repository: opening.repository,
|
|
486
|
+
menu: createOpenCodeAntigravityMenu({
|
|
487
|
+
commands: commandsModule,
|
|
488
|
+
accounts: opening.repository,
|
|
489
|
+
settings: operatorSettings,
|
|
490
|
+
dump: {
|
|
491
|
+
isEnabled: isGeminiDumpEnabled,
|
|
492
|
+
setEnabled: setGeminiDumpEnabled,
|
|
493
|
+
},
|
|
494
|
+
applyLogLevel: setRuntimeLogLevel,
|
|
495
|
+
accountLimits: createStoreAccountLimits({
|
|
496
|
+
repository: opening.repository,
|
|
497
|
+
settings: operatorSettings,
|
|
498
|
+
}),
|
|
499
|
+
refreshQuota: (refs) => checkStoreQuota(opening.repository, refs),
|
|
500
|
+
signIn: accountOAuth,
|
|
501
|
+
vault: vaultCustody.menuSection(),
|
|
502
|
+
}),
|
|
503
|
+
};
|
|
504
|
+
}
|
|
505
|
+
return { kind: 'menu', menu: await builtMenu.menu };
|
|
506
|
+
};
|
|
507
|
+
const commandExecuteBefore = createAntigravityCommandExecuteBefore({
|
|
508
|
+
client,
|
|
509
|
+
push: pushNotification,
|
|
510
|
+
open: async (sessionId) => {
|
|
511
|
+
const current = await currentMenu();
|
|
512
|
+
if (current.kind === 'unavailable')
|
|
513
|
+
return current;
|
|
514
|
+
return {
|
|
515
|
+
kind: 'menu',
|
|
516
|
+
payload: await current.menu.open(menuInvocation(pushNotification, sessionId)),
|
|
517
|
+
};
|
|
270
518
|
},
|
|
271
519
|
});
|
|
272
|
-
const commandExecuteBefore = createCommandExecuteBefore(client, operatorSettings, pushNotification, commandData);
|
|
273
520
|
const googleSearchTool = createGoogleSearchTool({
|
|
521
|
+
mayStartLocalWork: async () => (await readAuthority()) === 'local',
|
|
274
522
|
getAuth: async () => (cachedGetAuth ? cachedGetAuth() : null),
|
|
275
523
|
client,
|
|
276
524
|
providerId,
|
|
277
525
|
});
|
|
526
|
+
const { accountSource, loginTarget } = createAccountTargets({
|
|
527
|
+
accountStore: () => authLoader.accountStore(),
|
|
528
|
+
usesPoolFile: (opening) => authLoader.usesPoolFile(opening),
|
|
529
|
+
initializeFreshStore: () => authLoader.initializeFreshStore(),
|
|
530
|
+
});
|
|
278
531
|
const accountAccess = createAccountAccessService({
|
|
279
532
|
client,
|
|
280
533
|
providerId,
|
|
534
|
+
// The target resolver refuses an existing unmigrated pool. An active
|
|
535
|
+
// store supplies accounts through its repository, without reading or
|
|
536
|
+
// editing the retired file.
|
|
281
537
|
store: {
|
|
282
|
-
load:
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
538
|
+
load: async () => {
|
|
539
|
+
const source = await accountSource();
|
|
540
|
+
if (source.kind === 'none')
|
|
541
|
+
return null;
|
|
542
|
+
if (source.kind === 'pool-file')
|
|
543
|
+
return loadAccounts();
|
|
544
|
+
const read = await source.repository.read();
|
|
545
|
+
if (read.status !== 'ready')
|
|
546
|
+
throw new Error(`The account store is ${read.status}`);
|
|
547
|
+
return {
|
|
548
|
+
version: 4,
|
|
549
|
+
activeIndex: Math.max(0, read.rows.findIndex((row) => row.ref.id === read.routing?.activeRow?.id)),
|
|
550
|
+
accounts: read.rows.map(cliAccountOf),
|
|
551
|
+
};
|
|
552
|
+
},
|
|
553
|
+
mutate: async (mutate) => {
|
|
554
|
+
const source = await accountSource();
|
|
555
|
+
if (source.kind === 'pool-file')
|
|
556
|
+
return mutateAccountStorage(getStoragePath(), mutate);
|
|
557
|
+
throw new Error(source.kind === 'none'
|
|
558
|
+
? 'There are no Antigravity accounts yet; sign in to add one'
|
|
559
|
+
: 'Accounts live in the account store; change them from the /antigravity menu');
|
|
560
|
+
},
|
|
561
|
+
clear: async () => {
|
|
562
|
+
const source = await accountSource();
|
|
563
|
+
// A fresh installation has nothing to clear.
|
|
564
|
+
if (source.kind === 'none')
|
|
565
|
+
return;
|
|
566
|
+
if (source.kind === 'pool-file')
|
|
567
|
+
return clearAccounts();
|
|
568
|
+
throw new Error('Accounts live in the account store; remove them from the /antigravity menu');
|
|
569
|
+
},
|
|
570
|
+
persistAccountPool: async (results, replaceAll) => {
|
|
571
|
+
const target = await loginTarget();
|
|
572
|
+
if (target === 'pool-file')
|
|
573
|
+
return persistAccountPool(results, replaceAll);
|
|
574
|
+
if (replaceAll) {
|
|
575
|
+
await replacePoolLogins(target, results);
|
|
576
|
+
return;
|
|
577
|
+
}
|
|
578
|
+
const refused = (await commitLogins(target, results)).find((entry) => entry.status === 'refused');
|
|
579
|
+
if (refused?.status === 'refused')
|
|
580
|
+
throw new Error(refused.message);
|
|
581
|
+
},
|
|
286
582
|
},
|
|
287
583
|
openBrowser: openBrowserWithSystem,
|
|
288
584
|
prompt: {
|
|
@@ -291,6 +587,27 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
291
587
|
},
|
|
292
588
|
});
|
|
293
589
|
const authLoader = createAuthLoader({
|
|
590
|
+
publishSidebar: () => sidebarPublisher.publish(),
|
|
591
|
+
fetchImpl: dependencies.fetchImpl,
|
|
592
|
+
readAuthority,
|
|
593
|
+
createVaultFetch: async () => {
|
|
594
|
+
const { source, pool } = await currentVaultPool();
|
|
595
|
+
return createVaultFetchInterceptor({
|
|
596
|
+
assertAdmission: async () => {
|
|
597
|
+
if ((await readAuthority()) !== 'vault')
|
|
598
|
+
throw new Error(VAULT_ACCOUNT_REMEDY);
|
|
599
|
+
},
|
|
600
|
+
client,
|
|
601
|
+
config,
|
|
602
|
+
agySessionRegistry: sessionRegistry,
|
|
603
|
+
operatorSettings,
|
|
604
|
+
agyTransport: dependencies.agyTransport,
|
|
605
|
+
fetchImpl: dependencies.fetchImpl,
|
|
606
|
+
source,
|
|
607
|
+
pool,
|
|
608
|
+
onRouting: publishRouting('vault'),
|
|
609
|
+
});
|
|
610
|
+
},
|
|
294
611
|
client,
|
|
295
612
|
providerId,
|
|
296
613
|
config,
|
|
@@ -298,12 +615,20 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
298
615
|
onGetAuth: (getAuth) => {
|
|
299
616
|
cachedGetAuth = getAuth;
|
|
300
617
|
},
|
|
301
|
-
|
|
618
|
+
// Approved vault enrollment excludes the local account pool on every
|
|
619
|
+
// request. Only a readable, unenrolled state permits a local runtime.
|
|
620
|
+
createFetch: ({ accountManager, getAuth, source }) => createFetchInterceptor({
|
|
621
|
+
assertAdmission: async () => {
|
|
622
|
+
if ((await readAuthority()) !== 'local')
|
|
623
|
+
throw new Error(VAULT_ACCOUNT_REMEDY);
|
|
624
|
+
},
|
|
302
625
|
client,
|
|
303
626
|
directory,
|
|
304
627
|
providerId,
|
|
305
628
|
config,
|
|
306
629
|
accountManager,
|
|
630
|
+
accountSource: source,
|
|
631
|
+
onRouting: publishRouting('local'),
|
|
307
632
|
quotaManager,
|
|
308
633
|
getAuth,
|
|
309
634
|
agySessionRegistry: sessionRegistry,
|
|
@@ -321,8 +646,47 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
321
646
|
// Google OAuth endpoints when adding an account.
|
|
322
647
|
authorize: dependencies.oauth.authorize,
|
|
323
648
|
exchange: dependencies.oauth.exchange,
|
|
324
|
-
|
|
325
|
-
|
|
649
|
+
// New logins go through the same repository as request routing. An
|
|
650
|
+
// existing unmigrated pool is not a login target.
|
|
651
|
+
persist: async (result) => {
|
|
652
|
+
const target = await loginTarget();
|
|
653
|
+
if (target === 'pool-file') {
|
|
654
|
+
await persistAccountPool([result], false);
|
|
655
|
+
return;
|
|
656
|
+
}
|
|
657
|
+
const [committed] = await commitLogins(target, [result]);
|
|
658
|
+
if (committed?.status === 'refused')
|
|
659
|
+
throw new Error(committed.message);
|
|
660
|
+
},
|
|
661
|
+
listAccounts: async () => {
|
|
662
|
+
const opening = await authLoader.accountStore();
|
|
663
|
+
if (opening.status === 'ready') {
|
|
664
|
+
const read = await opening.repository.read();
|
|
665
|
+
if (read.status !== 'ready')
|
|
666
|
+
return [];
|
|
667
|
+
const activeId = read.routing?.activeRow?.id;
|
|
668
|
+
const activeIndex = read.rows.findIndex((row) => row.ref.id === activeId);
|
|
669
|
+
return projectCommandAccountRows({
|
|
670
|
+
activeIndex: activeIndex === -1 ? 0 : activeIndex,
|
|
671
|
+
version: 4,
|
|
672
|
+
accounts: read.rows.map((row) => ({
|
|
673
|
+
refreshToken: row.credential?.refreshToken ?? '',
|
|
674
|
+
enabled: row.enabled,
|
|
675
|
+
addedAt: row.metadata.status === 'present'
|
|
676
|
+
? row.metadata.metadata.addedAt
|
|
677
|
+
: 0,
|
|
678
|
+
lastUsed: row.metadata.status === 'present'
|
|
679
|
+
? row.metadata.metadata.lastUsed
|
|
680
|
+
: 0,
|
|
681
|
+
})),
|
|
682
|
+
});
|
|
683
|
+
}
|
|
684
|
+
if (opening.status === 'initialization-required')
|
|
685
|
+
return [];
|
|
686
|
+
if (!authLoader.usesPoolFile(opening))
|
|
687
|
+
return [];
|
|
688
|
+
return projectCommandAccountRows(await accountAccess.loadAccounts());
|
|
689
|
+
},
|
|
326
690
|
// After the new account lands on disk, reload the live
|
|
327
691
|
// AccountManager + fetch interceptor so routing sees it
|
|
328
692
|
// immediately — without waiting for an auth reload.
|
|
@@ -334,52 +698,45 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
334
698
|
}),
|
|
335
699
|
});
|
|
336
700
|
lifecycle.register({ dispose: () => accountOAuth.dispose() });
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
providerId,
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
701
|
+
const authSource = await readAuthority();
|
|
702
|
+
const oauthMethods = authSource === 'vault'
|
|
703
|
+
? [createV1VaultActivationMethod({ providerId, readAuthority })]
|
|
704
|
+
: authSource === 'unreadable'
|
|
705
|
+
? []
|
|
706
|
+
: createOAuthMethods({
|
|
707
|
+
mayStartLocalWork: async () => (await readAuthority()) === 'local',
|
|
708
|
+
client,
|
|
709
|
+
providerId,
|
|
710
|
+
config,
|
|
711
|
+
lifecycle,
|
|
712
|
+
accountAccess,
|
|
713
|
+
quotaManager,
|
|
714
|
+
getAuth: async () => cachedGetAuth ? cachedGetAuth() : undefined,
|
|
715
|
+
});
|
|
346
716
|
const rpcServer = await startRpcServer({
|
|
347
717
|
dir: getRpcDir(directory),
|
|
718
|
+
parseApplyRequest: commandsModule.parseApplyRequest,
|
|
348
719
|
apply: async (request) => {
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
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);
|
|
720
|
+
const current = await currentMenu();
|
|
721
|
+
if (current.kind === 'unavailable')
|
|
722
|
+
throw new Error(current.message);
|
|
723
|
+
const result = await current.menu.apply(request, menuInvocation(pushNotification, request.sessionId));
|
|
724
|
+
// The menu wrote to the account store; bring the routing manager up
|
|
725
|
+
// to date with it so the next request sees the change.
|
|
726
|
+
try {
|
|
727
|
+
if ((await readAuthority()) === 'local')
|
|
728
|
+
await lifecycle.getAccountManager()?.refreshFromRepository();
|
|
729
|
+
}
|
|
730
|
+
catch (error) {
|
|
731
|
+
logger.warn('menu-routing-refresh-failed', { error: String(error) });
|
|
732
|
+
pushNotification({
|
|
733
|
+
command: ANTIGRAVITY_MENU_COMMAND,
|
|
734
|
+
notify: {
|
|
735
|
+
message: 'The change was saved, but routing has not picked it up yet.',
|
|
736
|
+
kind: 'warning',
|
|
737
|
+
},
|
|
738
|
+
}, request.sessionId);
|
|
739
|
+
}
|
|
383
740
|
return result;
|
|
384
741
|
},
|
|
385
742
|
drain: drainNotifications,
|
|
@@ -388,6 +745,13 @@ export const createAntigravityPlugin = (providerId, options = {}) => async (inpu
|
|
|
388
745
|
// Flush the debug log stream after the sidebar drain so the last
|
|
389
746
|
// buffered lines land on disk before the process exits. Best-effort.
|
|
390
747
|
lifecycle.register({ dispose: () => closeDebugLog().catch(() => { }) });
|
|
748
|
+
try {
|
|
749
|
+
await vaultCustody.startObservation();
|
|
750
|
+
}
|
|
751
|
+
catch (error) {
|
|
752
|
+
await lifecycle.dispose();
|
|
753
|
+
throw error;
|
|
754
|
+
}
|
|
391
755
|
return {
|
|
392
756
|
dispose: async () => {
|
|
393
757
|
await lifecycle.dispose();
|