@cortexkit/opencode-antigravity-auth 2.2.1 → 3.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 +100 -92
- package/dist/cli.js +18476 -812
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +4100 -0
- package/dist/index.js +40602 -15857
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +6978 -0
- package/dist/server.js +51220 -0
- package/dist/server.js.map +7 -0
- package/dist/server.meta.json +7313 -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 -1352
- 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 +229 -65
- 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 +1752 -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 +46 -19
- 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
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
/** Top-level key of the config file that holds everything the pool adds. */
|
|
2
|
+
export declare const POOL_KEY = "commonAuthPool";
|
|
3
|
+
/** The pool schema this library reads and writes. */
|
|
4
|
+
export declare const POOL_SCHEMA_VERSION = 1;
|
|
5
|
+
/** Property of `commonAuthPool` holding the per-row entries, keyed by local id. */
|
|
6
|
+
export declare const POOL_ROWS_KEY = "rows";
|
|
7
|
+
/**
|
|
8
|
+
* Property of `commonAuthPool` (since 0.8.0) holding, per id, the highest
|
|
9
|
+
* credential epoch a row with that id held when the store last dropped it
|
|
10
|
+
* from the pool. A row added later under the same id starts past it (see
|
|
11
|
+
* `nextAddEpochIn`), so an attribution taken for the dropped row never
|
|
12
|
+
* matches the new one. Older readers ignore it, and older writers keep it
|
|
13
|
+
* as they keep every pool key they do not know.
|
|
14
|
+
*/
|
|
15
|
+
export declare const POOL_RETIRED_EPOCHS_KEY = "retiredEpochs";
|
|
16
|
+
/** The `version` older readers of the same files expect at the top level. */
|
|
17
|
+
export declare const LEGACY_STORE_VERSION = 1;
|
|
18
|
+
/**
|
|
19
|
+
* How far ahead of the clock a stored `lastRefreshedAt` may sit and still be
|
|
20
|
+
* trusted. Older readers of the state file apply the same bound, and a stamp
|
|
21
|
+
* strictly above it counts as absent when they compare two copies of a token.
|
|
22
|
+
*/
|
|
23
|
+
export declare const REFRESH_STAMP_TOLERANCE_MS: number;
|
|
24
|
+
export type OAuthCredential = {
|
|
25
|
+
type: 'oauth';
|
|
26
|
+
access?: string;
|
|
27
|
+
refresh: string;
|
|
28
|
+
expires?: number;
|
|
29
|
+
};
|
|
30
|
+
export type ApiKeyCredential = {
|
|
31
|
+
type: 'api';
|
|
32
|
+
apiKey: string;
|
|
33
|
+
baseURL: string;
|
|
34
|
+
authHeader?: 'authorization-bearer' | 'x-api-key';
|
|
35
|
+
};
|
|
36
|
+
export type PoolCredential = OAuthCredential | ApiKeyCredential;
|
|
37
|
+
/**
|
|
38
|
+
* What `rotate` takes. Rotation refreshes the secret of the endpoint a row
|
|
39
|
+
* already has, so an API key may leave out `baseURL` (and `authHeader`) to
|
|
40
|
+
* keep the row's; one it gives must equal the row's.
|
|
41
|
+
*/
|
|
42
|
+
export type RotateCredential = OAuthCredential | (Omit<ApiKeyCredential, 'baseURL'> & {
|
|
43
|
+
baseURL?: string;
|
|
44
|
+
});
|
|
45
|
+
/** A credential as stored: an OAuth credential also carries its refresh stamp. */
|
|
46
|
+
export type StoredCredential = (OAuthCredential & {
|
|
47
|
+
lastRefreshedAt?: number;
|
|
48
|
+
}) | ApiKeyCredential;
|
|
49
|
+
/** Quota codec supplied by `/quota`: the store never interprets the map itself. */
|
|
50
|
+
export interface QuotaCodec {
|
|
51
|
+
validate(value: unknown): boolean;
|
|
52
|
+
merge(stored: unknown | undefined, observation: unknown): unknown;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* What `ProviderStateCodec.onReplace` is told about a replacement: the row id,
|
|
56
|
+
* the credential epoch the new credential starts, `previousIdentity` (the
|
|
57
|
+
* identity the locked row recorded before the replace), `identity` (the
|
|
58
|
+
* identity the replace records), and the provider state the caller handed to
|
|
59
|
+
* `replace`, if any. Each identity is absent when none was recorded.
|
|
60
|
+
*/
|
|
61
|
+
export interface ProviderStateReplacement {
|
|
62
|
+
id: string;
|
|
63
|
+
credentialEpoch: number;
|
|
64
|
+
previousIdentity?: string;
|
|
65
|
+
identity?: string;
|
|
66
|
+
incoming?: unknown;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Codec for the provider state a plugin keeps beside each row's credential
|
|
70
|
+
* (a project id, a device fingerprint, eligibility times: whatever belongs to
|
|
71
|
+
* that credential). The store never interprets the value: it stores it as
|
|
72
|
+
* JSON, asks `validate` before every write and on every load, and calls the
|
|
73
|
+
* hooks below where two values meet. Every hook is synchronous and runs
|
|
74
|
+
* under the store locks.
|
|
75
|
+
*/
|
|
76
|
+
export interface ProviderStateCodec {
|
|
77
|
+
validate(value: unknown): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* The part of a (valid) value that belongs to the credential: what is true
|
|
80
|
+
* of the account the credential signs in to, such as a project id or a
|
|
81
|
+
* device fingerprint, as opposed to what the plugin merely tracks about
|
|
82
|
+
* its use, such as a cooldown or a cursor. The credential stamp covers the
|
|
83
|
+
* digest of exactly this projection, so a foreign edit of it hides the
|
|
84
|
+
* value, while the rest may change through `updateProviderState` without
|
|
85
|
+
* the stamp being rewritten. It must be a pure function of the value that
|
|
86
|
+
* returns JSON with a deterministic key order. Without it the whole value
|
|
87
|
+
* is credential-bound.
|
|
88
|
+
*/
|
|
89
|
+
credentialBound?(value: unknown): unknown;
|
|
90
|
+
/**
|
|
91
|
+
* Combines the value on disk with one a write brings (`add` of a secret the
|
|
92
|
+
* pool already holds, `rotate`, or a refresh whose provider returned a
|
|
93
|
+
* state). Called only when the row has a value on disk; without it the
|
|
94
|
+
* incoming value replaces the stored one. Its result is validated.
|
|
95
|
+
*/
|
|
96
|
+
merge?(onDisk: unknown, incoming: unknown): unknown;
|
|
97
|
+
/**
|
|
98
|
+
* The provider state of a row once `replace` gives it a new credential
|
|
99
|
+
* epoch. `previous` is the old credential's value (undefined when the row
|
|
100
|
+
* shows none). Returning undefined clears it. Without this hook a replace
|
|
101
|
+
* keeps the value handed to `replace` and otherwise clears the state.
|
|
102
|
+
*/
|
|
103
|
+
onReplace?(previous: unknown | undefined, replacement: ProviderStateReplacement): unknown | undefined;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Why a row shows no provider state although the state file holds one for it.
|
|
107
|
+
*
|
|
108
|
+
* `uncovered`: the value's credential-bound part (see
|
|
109
|
+
* `ProviderStateCodec.credentialBound`) is not the one this store last
|
|
110
|
+
* wrote beside the row's credential at its credential epoch and recorded
|
|
111
|
+
* identity. Another writer edited it, or
|
|
112
|
+
* wrote the credential beside it without knowing about it (an older version
|
|
113
|
+
* of this library, which drops the coverage, or a writer that does not know
|
|
114
|
+
* the pool at all), or it belongs to an earlier credential of the row.
|
|
115
|
+
* `invalid`: the value is covered but the codec rejects it, or the store was
|
|
116
|
+
* opened without a provider-state codec.
|
|
117
|
+
*/
|
|
118
|
+
export type ProviderStateDrop = 'uncovered' | 'invalid';
|
|
119
|
+
/**
|
|
120
|
+
* What the stamp beside a row's credential proves (see `CredentialStamp`).
|
|
121
|
+
*
|
|
122
|
+
* `none`: the row holds no credential, so there is nothing to stamp.
|
|
123
|
+
* `bound`: the stamp was written with this credential (its digest matches),
|
|
124
|
+
* names the row's credential epoch (1 for a row without a per-row entry),
|
|
125
|
+
* the identity it records (or its recording none) and any endpoint it
|
|
126
|
+
* records are the row's, and its dispatch digest matches everything a
|
|
127
|
+
* request would send (the OAuth access and refresh tokens and expiry; the API
|
|
128
|
+
* key with its `baseURL` and `authHeader`).
|
|
129
|
+
* `missing`: the credential carries no stamp (written by a writer that does
|
|
130
|
+
* not know about stamps, or one that dropped it).
|
|
131
|
+
* `malformed`: the stamp is not one this store writes (wrong shape, or an
|
|
132
|
+
* epoch outside the positive safe integers).
|
|
133
|
+
* `mismatched`: the stamp was written for another credential, epoch,
|
|
134
|
+
* identity, endpoint, or token to send than the row now holds.
|
|
135
|
+
* `legacy`: a well-formed stamp written with this credential's secret but
|
|
136
|
+
* with no dispatch digest (written by 0.4.3 or earlier), so it proves
|
|
137
|
+
* neither the token sent nor the account or endpoint it goes to.
|
|
138
|
+
*/
|
|
139
|
+
export type CredentialStampStatus = 'none' | 'bound' | 'missing' | 'malformed' | 'mismatched' | 'legacy';
|
|
140
|
+
/** One row of the pool as loaded. */
|
|
141
|
+
export interface PoolRow {
|
|
142
|
+
id: string;
|
|
143
|
+
type: 'oauth' | 'api';
|
|
144
|
+
label?: string;
|
|
145
|
+
enabled: boolean;
|
|
146
|
+
addedAt?: number;
|
|
147
|
+
/** Recorded wire identity (the roster row's `accountId`), when known. */
|
|
148
|
+
identity?: string;
|
|
149
|
+
/** Undefined when the state file holds no usable credential for the row. */
|
|
150
|
+
credential?: StoredCredential;
|
|
151
|
+
/** Stable hash of the credential's secret material; never persisted. */
|
|
152
|
+
fingerprint?: string;
|
|
153
|
+
/** Undefined when the row has no per-row entry yet. */
|
|
154
|
+
credentialEpoch?: number;
|
|
155
|
+
needsFirstReading: boolean;
|
|
156
|
+
disabledReason?: string;
|
|
157
|
+
/** Store-owned reservation; only `publishRoster` releases it for ordinary use. */
|
|
158
|
+
staged?: {
|
|
159
|
+
reservation: string;
|
|
160
|
+
};
|
|
161
|
+
/** The opaque quota map, as validated by the codec. */
|
|
162
|
+
quota?: unknown;
|
|
163
|
+
/**
|
|
164
|
+
* The opaque provider state kept beside the credential, as validated by
|
|
165
|
+
* the provider-state codec. Absent when the row has none, or when the one
|
|
166
|
+
* on disk is not shown (see `providerStateDropped`).
|
|
167
|
+
*/
|
|
168
|
+
providerState?: unknown;
|
|
169
|
+
/**
|
|
170
|
+
* Set when the state file holds a provider state for the row that is not
|
|
171
|
+
* shown, and why. The value stays on disk untouched until a write on the
|
|
172
|
+
* row sets or clears it; the row itself stays usable.
|
|
173
|
+
*/
|
|
174
|
+
providerStateDropped?: ProviderStateDrop;
|
|
175
|
+
hasEntry: boolean;
|
|
176
|
+
/** A row that may be refreshed, pulled for, or admitted. */
|
|
177
|
+
candidate: boolean;
|
|
178
|
+
/** Set when the roster row or the per-row entry failed validation. */
|
|
179
|
+
invalid?: 'roster' | 'entry';
|
|
180
|
+
/**
|
|
181
|
+
* Set when a replace stopped between its two writes: the state file holds
|
|
182
|
+
* the new credential, stamped with the epoch and the identity or endpoint
|
|
183
|
+
* it belongs to, and the config still holds the replaced row. Also set when
|
|
184
|
+
* a write that gives a row its first identity (`recordIdentity`, or a
|
|
185
|
+
* `rotate` or refresh that learns one) stopped after stamping the identity
|
|
186
|
+
* and before recording it in the config, and when an attributed `disable`
|
|
187
|
+
* or `enable` that changed the provider state stopped after its state
|
|
188
|
+
* write and before flipping the row in the config. The row is shown as the
|
|
189
|
+
* write leaves it once completed, is never a candidate, and the next store
|
|
190
|
+
* write on it writes the config to match.
|
|
191
|
+
*/
|
|
192
|
+
torn?: true;
|
|
193
|
+
/**
|
|
194
|
+
* Whether the credential is the one the store last stamped for this row
|
|
195
|
+
* (see `CredentialStampStatus`). Every row the store loads carries it; a
|
|
196
|
+
* torn row reports the stamp of the row as it is shown completed. It is
|
|
197
|
+
* optional only so that rows built by hand (test fixtures) still type.
|
|
198
|
+
*/
|
|
199
|
+
stamp?: CredentialStampStatus;
|
|
200
|
+
/**
|
|
201
|
+
* Set only when the store was opened with `requireCredentialStamps` and
|
|
202
|
+
* the row's `stamp` is not `bound`: the row is never a candidate, and
|
|
203
|
+
* `refresh`, quota pulls, `recordQuota`, `recordIdentity`, `rotate` and a
|
|
204
|
+
* re-`add` onto it refuse with `unbound-credential`. Only `replace` (or a
|
|
205
|
+
* new row) makes it usable again.
|
|
206
|
+
*/
|
|
207
|
+
unbound?: true;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Key, inside a state-file account entry, of the stamp naming what the
|
|
211
|
+
* credential beside it belongs to. Older readers ignore it.
|
|
212
|
+
*/
|
|
213
|
+
export declare const CREDENTIAL_STAMP_KEY = "commonAuthPool";
|
|
214
|
+
/**
|
|
215
|
+
* What the config holds for a credential when its stamp is written: the
|
|
216
|
+
* identity it belongs to (absent: none is known yet) and, for an API key, its
|
|
217
|
+
* endpoint. For a replace it is the config the replace is about to write.
|
|
218
|
+
*/
|
|
219
|
+
export interface CredentialBinding {
|
|
220
|
+
identity?: string;
|
|
221
|
+
baseURL?: string;
|
|
222
|
+
authHeader?: 'authorization-bearer' | 'x-api-key';
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Written beside every credential the store puts in the state file. It names
|
|
226
|
+
* the credential epoch the credential belongs to and a digest of its secret,
|
|
227
|
+
* so a stamp left beside a credential another writer put there afterwards is
|
|
228
|
+
* recognisable and ignored.
|
|
229
|
+
*
|
|
230
|
+
* `digest` covers only the refresh token or API key: it names the credential
|
|
231
|
+
* lineage, and torn-replace detection matches it, including against stamps
|
|
232
|
+
* older versions wrote, so it keeps that exact definition. `dispatch` covers
|
|
233
|
+
* everything a request sends (see `dispatchDigest`), so a token or endpoint
|
|
234
|
+
* changed beside an unchanged lineage secret is caught; stamps written by
|
|
235
|
+
* 0.4.3 or earlier lack it.
|
|
236
|
+
*
|
|
237
|
+
* `binding` is the config the credential was written beside (see
|
|
238
|
+
* `CredentialBinding`); every write since 0.4.4 records it, earlier versions
|
|
239
|
+
* only on replace. `replace` marks a stamp written by a replace, which is
|
|
240
|
+
* what lets a reader complete a replace that stopped after writing the
|
|
241
|
+
* credential: a stamp from any other write is never completed as torn.
|
|
242
|
+
*
|
|
243
|
+
* `providerState` is the digest of the credential-bound part of the provider
|
|
244
|
+
* state beside the credential (see `providerStateDigest`); it is absent when
|
|
245
|
+
* the row has none, so the stamp of a row without provider state is exactly
|
|
246
|
+
* what 0.5.0 wrote. It is apart from `digest` and `dispatch`, which keep
|
|
247
|
+
* their meaning: the credential's stamp status never depends on it.
|
|
248
|
+
*/
|
|
249
|
+
export interface CredentialStamp {
|
|
250
|
+
credentialEpoch: number;
|
|
251
|
+
digest: string;
|
|
252
|
+
dispatch?: string;
|
|
253
|
+
binding?: CredentialBinding;
|
|
254
|
+
replace?: true;
|
|
255
|
+
providerState?: string;
|
|
256
|
+
staged?: StagedStamp;
|
|
257
|
+
}
|
|
258
|
+
/** Original staged-add metadata, persisted with the credential before config exists. */
|
|
259
|
+
export interface StagedStamp {
|
|
260
|
+
reservation: string;
|
|
261
|
+
label?: string;
|
|
262
|
+
disabledReason: string;
|
|
263
|
+
providerState?: string;
|
|
264
|
+
}
|
|
265
|
+
/** Canonical JSON: recursively sorted object keys, preserved array order. */
|
|
266
|
+
export declare function canonicalJson(value: unknown): string;
|
|
267
|
+
export declare function canonicalDigest(value: unknown): string;
|
|
268
|
+
export declare function parseReservation(raw: unknown): {
|
|
269
|
+
reservation: string;
|
|
270
|
+
} | undefined;
|
|
271
|
+
/**
|
|
272
|
+
* Key, inside a state-file account entry, of the provider state kept beside
|
|
273
|
+
* the credential. Older readers ignore it.
|
|
274
|
+
*/
|
|
275
|
+
export declare const PROVIDER_STATE_KEY = "commonAuthProviderState";
|
|
276
|
+
export type ConfigClassification = {
|
|
277
|
+
status: 'ready';
|
|
278
|
+
exists: boolean;
|
|
279
|
+
config: Record<string, unknown>;
|
|
280
|
+
} | {
|
|
281
|
+
status: 'pending-migration';
|
|
282
|
+
config: Record<string, unknown>;
|
|
283
|
+
} | {
|
|
284
|
+
status: 'error';
|
|
285
|
+
reason: string;
|
|
286
|
+
};
|
|
287
|
+
export type StateClassification = {
|
|
288
|
+
status: 'ready';
|
|
289
|
+
exists: boolean;
|
|
290
|
+
state: Record<string, unknown>;
|
|
291
|
+
} | {
|
|
292
|
+
status: 'error';
|
|
293
|
+
reason: string;
|
|
294
|
+
};
|
|
295
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
296
|
+
/**
|
|
297
|
+
* Ids are stored exactly as given. Older readers trim ids, so an id with
|
|
298
|
+
* surrounding whitespace would be renamed by them; such ids, empty ids and
|
|
299
|
+
* prototype keys are refused instead of being rewritten.
|
|
300
|
+
*/
|
|
301
|
+
export declare function idProblem(id: unknown): string | undefined;
|
|
302
|
+
/** Same URL rule the older readers apply to an API-key row's `baseURL`. */
|
|
303
|
+
export declare function isValidBaseURL(value: unknown): boolean;
|
|
304
|
+
export declare function fingerprintOf(credential: PoolCredential | StoredCredential): string;
|
|
305
|
+
/**
|
|
306
|
+
* The digest a credential stamp carries. It is kept apart from the
|
|
307
|
+
* fingerprint (a different input prefix) so the persisted value is never the
|
|
308
|
+
* dedupe key.
|
|
309
|
+
*/
|
|
310
|
+
export declare function credentialDigest(credential: PoolCredential | StoredCredential): string;
|
|
311
|
+
/**
|
|
312
|
+
* The digest of everything a request made with the credential sends or is
|
|
313
|
+
* served by: the OAuth access token, refresh token and expiry (the expiry
|
|
314
|
+
* decides whether the access token is used or refreshed first), or the API
|
|
315
|
+
* key with the `baseURL` and header it is sent to. Its input prefix differs
|
|
316
|
+
* from both the fingerprint's and `credentialDigest`'s, so it never equals
|
|
317
|
+
* either. The parts are JSON-encoded as a list, so no two credentials share
|
|
318
|
+
* an input. An access token or expiry the state file cannot hold as loaded
|
|
319
|
+
* (not a string, not a finite number) counts as absent, which is how
|
|
320
|
+
* `buildRawRows` loads it back.
|
|
321
|
+
*/
|
|
322
|
+
export declare function dispatchDigest(credential: PoolCredential | StoredCredential): string;
|
|
323
|
+
/**
|
|
324
|
+
* The stamp for a credential written into a row at `credentialEpoch`, beside
|
|
325
|
+
* the config `binding` describes. `replace` is set only by a replace.
|
|
326
|
+
*/
|
|
327
|
+
export declare function stampFor(credential: PoolCredential | StoredCredential, credentialEpoch: number, binding: CredentialBinding, options?: {
|
|
328
|
+
replace?: boolean;
|
|
329
|
+
providerState?: string;
|
|
330
|
+
}): CredentialStamp;
|
|
331
|
+
/**
|
|
332
|
+
* The digest a stamp carries for a provider state: of its credential-bound
|
|
333
|
+
* part (`ProviderStateCodec.credentialBound`, the whole value without it), as
|
|
334
|
+
* it serializes. The store only ever stores values that survive a JSON round
|
|
335
|
+
* trip unchanged, so the digest of a value read back from disk equals the one
|
|
336
|
+
* computed when it was written. Its input prefix differs from every other
|
|
337
|
+
* digest the store writes.
|
|
338
|
+
*/
|
|
339
|
+
export declare function providerStateDigest(codec: Pick<ProviderStateCodec, 'credentialBound'> | undefined, value: unknown): string;
|
|
340
|
+
/**
|
|
341
|
+
* The provider-state digest of the stamp in a state-file account entry, when
|
|
342
|
+
* that stamp binds it to this row: written with this credential (its lineage
|
|
343
|
+
* digest matches), at this credential epoch, naming this recorded identity.
|
|
344
|
+
* Whether the value beside it still has that digest is checked apart, by
|
|
345
|
+
* `providerStateFields`; this alone is what a write that keeps the value
|
|
346
|
+
* carries into the stamp it writes, so a value no stamp of this store bound
|
|
347
|
+
* to the row stays unbound rather than being vouched for, and one edited
|
|
348
|
+
* after it was bound stays detectably edited.
|
|
349
|
+
*/
|
|
350
|
+
export declare function boundProviderStateDigest(account: unknown, credential: PoolCredential | StoredCredential | undefined, credentialEpoch: number | undefined, identity: string | undefined): string | undefined;
|
|
351
|
+
/**
|
|
352
|
+
* A credential epoch is a positive safe integer. Above `MAX_SAFE_INTEGER`,
|
|
353
|
+
* adding one may give back the same number, so a replace would not move the
|
|
354
|
+
* epoch and nothing could tell the old credential's work from the new one's.
|
|
355
|
+
*/
|
|
356
|
+
export declare function isCredentialEpoch(value: unknown): value is number;
|
|
357
|
+
/** A well-formed stamp, or undefined for anything else (which is ignored). */
|
|
358
|
+
export declare function parseStamp(raw: unknown): CredentialStamp | undefined;
|
|
359
|
+
/** A parsed file, or the reason it could not be parsed. */
|
|
360
|
+
export type FileRead = {
|
|
361
|
+
exists: false;
|
|
362
|
+
} | {
|
|
363
|
+
exists: true;
|
|
364
|
+
value: unknown;
|
|
365
|
+
} | {
|
|
366
|
+
exists: true;
|
|
367
|
+
parseError: unknown;
|
|
368
|
+
};
|
|
369
|
+
export declare function classifyConfig(read: FileRead): ConfigClassification;
|
|
370
|
+
export declare function classifyState(read: FileRead): StateClassification;
|
|
371
|
+
export declare function rosterOf(config: Record<string, unknown>): unknown[];
|
|
372
|
+
export declare function entriesOf(config: Record<string, unknown>): Record<string, unknown>;
|
|
373
|
+
/** The first roster row with this id (the one the pool loads). */
|
|
374
|
+
export declare function rosterRowIn(config: Record<string, unknown>, id: string): Record<string, unknown> | undefined;
|
|
375
|
+
/** The per-row entries of a config, created (empty) when absent. */
|
|
376
|
+
export declare function ensureEntries(config: Record<string, unknown>): Record<string, unknown>;
|
|
377
|
+
export declare function entryIn(config: Record<string, unknown>, id: string): Record<string, unknown> | undefined;
|
|
378
|
+
/** Sets an entry as an own property, so an id such as `toString` is safe. */
|
|
379
|
+
export declare function setEntryIn(config: Record<string, unknown>, id: string, entry: Record<string, unknown>): void;
|
|
380
|
+
/**
|
|
381
|
+
* The credential epoch recorded for a dropped id (see
|
|
382
|
+
* `POOL_RETIRED_EPOCHS_KEY`), or undefined when none is. A value that is not
|
|
383
|
+
* a credential epoch counts as none.
|
|
384
|
+
*/
|
|
385
|
+
export declare function retiredEpochIn(config: Record<string, unknown>, id: string): number | undefined;
|
|
386
|
+
/**
|
|
387
|
+
* The credential epoch `add` gives a new row with this id: one past the
|
|
388
|
+
* highest epoch the id is known to have held, which is the epoch recorded
|
|
389
|
+
* when the store dropped it, or the epoch of an entry left behind by a writer
|
|
390
|
+
* that removed only its roster row; 1 for an id the pool never held.
|
|
391
|
+
*
|
|
392
|
+
* An attribution names a row by id and credential epoch (and identity), and
|
|
393
|
+
* an id is chosen by the plugin, so it is often the same one again (`main`).
|
|
394
|
+
* Were a re-added row to start at epoch 1 again, an attribution taken for the
|
|
395
|
+
* removed row's credential would match the new credential exactly, in this
|
|
396
|
+
* process or any other. Starting past every earlier epoch makes such an
|
|
397
|
+
* attribution fail as it does after a `replace`. The result may lie past the
|
|
398
|
+
* safe integers (an id whose last row was at `Number.MAX_SAFE_INTEGER`);
|
|
399
|
+
* `add` refuses such an id.
|
|
400
|
+
*/
|
|
401
|
+
export declare function nextAddEpochIn(config: Record<string, unknown>, id: string): number;
|
|
402
|
+
/**
|
|
403
|
+
* Records, in a config being written, the epochs of the ids it drops: for
|
|
404
|
+
* each, the epoch its entry claims (1 for a row without one, the epoch such a
|
|
405
|
+
* row is at), kept only when above what is already recorded, so the record
|
|
406
|
+
* for an id never goes down. Valid recorded values of other ids are kept; a
|
|
407
|
+
* record that is not an object, or a value in it that is not an epoch, says
|
|
408
|
+
* nothing and is replaced. An entry whose epoch cannot be read records 1.
|
|
409
|
+
*/
|
|
410
|
+
export declare function retireEpochsIn(config: Record<string, unknown>, dropped: Iterable<string>): void;
|
|
411
|
+
/**
|
|
412
|
+
* Builds the rows of a ready pool from the files exactly as they are, without
|
|
413
|
+
* looking at credential stamps (see `loadRows` for the rows every reader
|
|
414
|
+
* gets). A roster row the older readers would reject, a duplicate id, or a
|
|
415
|
+
* malformed per-row entry makes that one row invalid (never a candidate) and
|
|
416
|
+
* blocks nothing else.
|
|
417
|
+
*/
|
|
418
|
+
export declare function buildRawRows(config: Record<string, unknown>, state: Record<string, unknown>, codec: QuotaCodec, providerCodec?: ProviderStateCodec): PoolRow[];
|
|
419
|
+
/** The row-lock key: recorded wire identity when known, else the local id. */
|
|
420
|
+
export declare function rowLockKey(row: Pick<PoolRow, 'id' | 'identity'>): string;
|
|
421
|
+
/**
|
|
422
|
+
* The refresh stamp a write persists: the clock, raised to one past a prior
|
|
423
|
+
* stamp that is still trusted, so a stale copy of the previous token can never
|
|
424
|
+
* compare newer than the rotation. A prior stamp beyond the trust bound says
|
|
425
|
+
* nothing and is ignored.
|
|
426
|
+
*/
|
|
427
|
+
export declare function rotationStamp(prior: number | undefined, now: number): number;
|
|
428
|
+
/** True when a rotation stamped now would itself be past the trust bound. */
|
|
429
|
+
export declare function rotationStampUntrusted(prior: number | undefined, now: number): boolean;
|
|
430
|
+
/** The legacy-shaped roster row for a new row. */
|
|
431
|
+
export declare function rosterRowFor(input: {
|
|
432
|
+
id: string;
|
|
433
|
+
credential: PoolCredential;
|
|
434
|
+
identity?: string;
|
|
435
|
+
label?: string;
|
|
436
|
+
addedAt: number;
|
|
437
|
+
}): Record<string, unknown>;
|
|
438
|
+
/** The state-file fields a credential occupies, in the older readers' names. */
|
|
439
|
+
export declare function stateFieldsFor(credential: PoolCredential, lastRefreshedAt: number | undefined): Record<string, unknown>;
|
|
440
|
+
export declare function storedCredential(credential: PoolCredential, lastRefreshedAt: number | undefined): StoredCredential;
|
|
441
|
+
export declare function credentialProblem(credential: unknown, options?: {
|
|
442
|
+
baseURLOptional?: boolean;
|
|
443
|
+
}): string | undefined;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { PoolOperationError } from './errors.js';
|
|
2
|
+
import type { PoolLockSpec } from './refresh-lock.js';
|
|
3
|
+
import type { StoreRuntime } from './runtime.js';
|
|
4
|
+
/**
|
|
5
|
+
* Top-level config keys the pool owns: the legacy `version`, the legacy
|
|
6
|
+
* roster (`accounts`) and the pool's own key. A settings write never reads
|
|
7
|
+
* them into the settings it hands out and refuses a result that sets them,
|
|
8
|
+
* so the roster and the per-row entries change only through row operations.
|
|
9
|
+
*/
|
|
10
|
+
export declare const POOL_OWNED_KEYS: readonly string[];
|
|
11
|
+
/** The plugin's settings: every top-level config key except the pool-owned ones. */
|
|
12
|
+
export type PoolSettings = Record<string, unknown>;
|
|
13
|
+
export type SettingsRead = {
|
|
14
|
+
status: 'ready';
|
|
15
|
+
settings: PoolSettings;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The config still holds a legacy roster with no pool key. Its settings
|
|
19
|
+
* read the same way; `updateSettings` refuses until the pool is initialized.
|
|
20
|
+
*/
|
|
21
|
+
| {
|
|
22
|
+
status: 'pending-migration';
|
|
23
|
+
settings: PoolSettings;
|
|
24
|
+
} | {
|
|
25
|
+
status: 'error';
|
|
26
|
+
file: 'config' | 'state';
|
|
27
|
+
reason: string;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Receives a private copy of the current settings and either edits it in
|
|
31
|
+
* place (returning nothing) or returns the complete next settings object.
|
|
32
|
+
* It runs under the store locks, so it must not call back into the store:
|
|
33
|
+
* a store operation called from inside it is refused (`PoolReentryError`).
|
|
34
|
+
*/
|
|
35
|
+
export type SettingsMutator = (settings: PoolSettings) => PoolSettings | undefined | Promise<PoolSettings | undefined>;
|
|
36
|
+
/**
|
|
37
|
+
* Options of `updateSettings`. It names no row, so its failure hook is
|
|
38
|
+
* handed only the failure; like `reorder` it takes the extra locks, then the
|
|
39
|
+
* store locks, and no row or provider-wide lock.
|
|
40
|
+
*/
|
|
41
|
+
export interface UpdateSettingsOptions {
|
|
42
|
+
/** Called once, awaited, on every non-success path, before the extra locks release. */
|
|
43
|
+
onFailure?: (error: PoolOperationError) => void | Promise<void>;
|
|
44
|
+
/** Locks taken, in this order, before the store locks. */
|
|
45
|
+
extraLocks?: readonly PoolLockSpec[];
|
|
46
|
+
}
|
|
47
|
+
export type UpdateSettingsResult = {
|
|
48
|
+
/** The settings now on disk. */
|
|
49
|
+
settings: PoolSettings;
|
|
50
|
+
/** `unchanged` when the mutator left the settings as they were; nothing was written. */
|
|
51
|
+
outcome: 'updated' | 'unchanged';
|
|
52
|
+
};
|
|
53
|
+
/** Reads the settings without taking a lock or writing anything. */
|
|
54
|
+
export declare function readPoolSettings(rt: StoreRuntime): Promise<SettingsRead>;
|
|
55
|
+
/**
|
|
56
|
+
* One locked read-modify-write of the plugin's settings in the config file
|
|
57
|
+
* the pool lives in. The pool must be ready (a pending migration or a load
|
|
58
|
+
* error refuses before the mutator runs). A mutator result that sets a
|
|
59
|
+
* pool-owned key refuses (`invalid-input`) with nothing written; a result
|
|
60
|
+
* equal to the current settings writes nothing. The state file is never
|
|
61
|
+
* touched, and the pool-owned keys are written back exactly as read.
|
|
62
|
+
*/
|
|
63
|
+
export declare function updatePoolSettings(rt: StoreRuntime, mutator: SettingsMutator, options?: UpdateSettingsOptions): Promise<UpdateSettingsResult>;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { type RowEditor } from './identity.js';
|
|
2
|
+
import { type CredentialBinding, type CredentialStamp, type PoolRow, type ProviderStateCodec, type QuotaCodec } from './schema.js';
|
|
3
|
+
/** Key, inside a credential stamp, of an attributed enable or disable. */
|
|
4
|
+
export declare const TRANSITION_STAMP_KEY = "transition";
|
|
5
|
+
/**
|
|
6
|
+
* Key, inside a per-row config entry, of the mark of the last transition the
|
|
7
|
+
* config carries out. Older readers ignore it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const TRANSITION_MARK_KEY = "transitionMark";
|
|
10
|
+
/**
|
|
11
|
+
* An attributed enable or disable as its state write records it: `mark` is
|
|
12
|
+
* unique to that write, `enabled` is the flag it sets, and `reason` the
|
|
13
|
+
* disabled reason (a disable's only).
|
|
14
|
+
*/
|
|
15
|
+
export interface StampedTransition {
|
|
16
|
+
mark: string;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
reason?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Carries a transition out in a config being edited: the row's enabled flag
|
|
22
|
+
* and reason as the transition says, and its mark recorded in the entry (a
|
|
23
|
+
* row without an entry gets one at epoch 1, as `disableIn` gives it). An
|
|
24
|
+
* enable then applies the duplicate-identity rule, as every write that
|
|
25
|
+
* enables an OAuth row with a known identity does: the earlier row in roster
|
|
26
|
+
* order keeps the identity.
|
|
27
|
+
*/
|
|
28
|
+
export declare function applyTransition(editor: RowEditor, id: string, transition: StampedTransition): void;
|
|
29
|
+
/** How a row left between the two writes of an operation is completed. */
|
|
30
|
+
export type TornCompletion = {
|
|
31
|
+
kind: 'replace';
|
|
32
|
+
stamp: CredentialStamp & {
|
|
33
|
+
binding: CredentialBinding;
|
|
34
|
+
};
|
|
35
|
+
} | {
|
|
36
|
+
kind: 'identity';
|
|
37
|
+
identity: string;
|
|
38
|
+
} | {
|
|
39
|
+
kind: 'transition';
|
|
40
|
+
transition: StampedTransition;
|
|
41
|
+
};
|
|
42
|
+
/** Rows left between the two writes of an operation, by row id. */
|
|
43
|
+
export declare function tornStamps(config: Record<string, unknown>, state: Record<string, unknown>, codec: QuotaCodec, options?: {
|
|
44
|
+
requireCredentialStamps?: boolean;
|
|
45
|
+
}): Map<string, TornCompletion>;
|
|
46
|
+
/**
|
|
47
|
+
* The config half of a replacement: the row's entry moves to the new epoch,
|
|
48
|
+
* loses its quota and needs a first reading; its roster row gets the new
|
|
49
|
+
* identity (or loses the old one) and, for an API key, the new endpoint.
|
|
50
|
+
* Disabling later rows that share the new identity is left to the caller
|
|
51
|
+
* (`disableIdentityDuplicates`), so several rows can be bound first.
|
|
52
|
+
*/
|
|
53
|
+
export declare function bindReplacement(editor: RowEditor, id: string, credentialEpoch: number, binding: CredentialBinding): void;
|
|
54
|
+
/**
|
|
55
|
+
* The config with every torn row completed as its interrupted write would
|
|
56
|
+
* have left it, and the ids completed. The config passed in is not modified;
|
|
57
|
+
* when nothing is torn it is returned as is.
|
|
58
|
+
*/
|
|
59
|
+
export declare function completeTornRows(config: Record<string, unknown>, state: Record<string, unknown>, codec: QuotaCodec, options?: {
|
|
60
|
+
requireCredentialStamps?: boolean;
|
|
61
|
+
}): {
|
|
62
|
+
config: Record<string, unknown>;
|
|
63
|
+
torn: string[];
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* The rows every reader gets. A torn row is shown completed (the identity,
|
|
67
|
+
* endpoint and epoch its stamp names, beside the credential it stamps), is
|
|
68
|
+
* marked `torn` and is never a candidate; every other row is as on disk.
|
|
69
|
+
* With `requireCredentialStamps`, a row whose stamp is not `bound` is marked
|
|
70
|
+
* `unbound` and is never a candidate either. A torn row is shown with the
|
|
71
|
+
* stamp of the interrupted write, which binds the completed row, so it is not
|
|
72
|
+
* unbound; once a store write puts its completion on disk it is no longer
|
|
73
|
+
* torn and is a candidate again like any other row.
|
|
74
|
+
*/
|
|
75
|
+
export declare function loadRows(config: Record<string, unknown>, state: Record<string, unknown>, codec: QuotaCodec, options?: {
|
|
76
|
+
requireCredentialStamps?: boolean;
|
|
77
|
+
providerState?: ProviderStateCodec;
|
|
78
|
+
}): PoolRow[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../src/constants.ts"],"names":[],"mappings":"AACA,cAAc,kCAAkC,CAAA;AAKhD,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,kBAAkB,GACnB,MAAM,gBAAgB,CAAA"}
|