@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,189 @@
|
|
|
1
|
+
import { type PoolFailurePhase, type PoolOperation, PoolOperationError } from './errors.js';
|
|
2
|
+
import { type PoolLogger } from './hooks.js';
|
|
3
|
+
import { type LockEnvironment, LockStack, type PoolLockOptions, type PoolLockSpec } from './refresh-lock.js';
|
|
4
|
+
import { type PoolRow, type ProviderStateCodec, type QuotaCodec, type StoredCredential } from './schema.js';
|
|
5
|
+
/** Named points on the write path, for crash and ownership injection. */
|
|
6
|
+
export type WriteStep = 'before-config-write' | 'after-config-write' | 'before-state-write' | 'after-state-write';
|
|
7
|
+
/** Awaitable pause points on the pull and refresh paths. */
|
|
8
|
+
export type HoldPoint = 'refresh-before-provider' | 'pull-before-request';
|
|
9
|
+
export interface StoreContext {
|
|
10
|
+
provider: string;
|
|
11
|
+
configPath: string;
|
|
12
|
+
statePath: string;
|
|
13
|
+
codec: QuotaCodec;
|
|
14
|
+
/** The provider-state codec; without one no row shows a provider state. */
|
|
15
|
+
providerState?: ProviderStateCodec;
|
|
16
|
+
now: () => number;
|
|
17
|
+
storeLocks: readonly PoolLockSpec[];
|
|
18
|
+
lockDefaults: PoolLockOptions;
|
|
19
|
+
lockEnv: LockEnvironment;
|
|
20
|
+
logger?: PoolLogger;
|
|
21
|
+
onStep?: (step: WriteStep, info: {
|
|
22
|
+
operation: PoolOperation;
|
|
23
|
+
rowId: string | undefined;
|
|
24
|
+
}) => void | Promise<void>;
|
|
25
|
+
hold?: (point: HoldPoint, rowId: string) => void | Promise<void>;
|
|
26
|
+
/** Ids whose per-row entry a library write dropped in this process. */
|
|
27
|
+
removedIds: Set<string>;
|
|
28
|
+
/**
|
|
29
|
+
* When true, rows whose credential stamp is not bound load `unbound` and
|
|
30
|
+
* the operations that use a credential refuse them (see
|
|
31
|
+
* `OpenPoolStoreOptions.requireCredentialStamps`).
|
|
32
|
+
*/
|
|
33
|
+
requireCredentialStamps?: boolean;
|
|
34
|
+
requireRemovedFingerprint?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface Snapshot {
|
|
37
|
+
configExists: boolean;
|
|
38
|
+
stateExists: boolean;
|
|
39
|
+
config: Record<string, unknown>;
|
|
40
|
+
state: Record<string, unknown>;
|
|
41
|
+
rows: PoolRow[];
|
|
42
|
+
}
|
|
43
|
+
export type ReadResult = ({
|
|
44
|
+
status: 'ready';
|
|
45
|
+
} & Snapshot) | {
|
|
46
|
+
status: 'pending-migration';
|
|
47
|
+
config: Record<string, unknown>;
|
|
48
|
+
} | {
|
|
49
|
+
status: 'error';
|
|
50
|
+
file: 'config' | 'state';
|
|
51
|
+
reason: string;
|
|
52
|
+
kind?: 'snapshot-contended';
|
|
53
|
+
retryable?: true;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Validate config/state/config bytes without locks. Roster replacement writes
|
|
57
|
+
* config before deleting old state credentials. Re-read a changed config so an
|
|
58
|
+
* old roster cannot be paired with state from which its accounts were removed.
|
|
59
|
+
*/
|
|
60
|
+
export declare function readPool(ctx: StoreContext): Promise<ReadResult>;
|
|
61
|
+
/** The refusal for a pool that is not ready, as a failure value. */
|
|
62
|
+
export declare function notReadyError(result: Exclude<ReadResult, {
|
|
63
|
+
status: 'ready';
|
|
64
|
+
}>, operation: PoolOperation, rowId: string | undefined, phase?: PoolFailurePhase): PoolOperationError;
|
|
65
|
+
/** What an operation has written so far; decides the failure phase. */
|
|
66
|
+
export interface Progress {
|
|
67
|
+
writes: number;
|
|
68
|
+
/** The roster config was renamed into place, or its committed receipt was found. */
|
|
69
|
+
publicationDecided?: true;
|
|
70
|
+
/** The credential the operation's state write put on disk, once it has. */
|
|
71
|
+
committed?: StoredCredential;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* One locked read-modify-write. The store locks are pushed onto the caller's
|
|
75
|
+
* lock stack, so the ownership assertion before each write covers the outer
|
|
76
|
+
* row, provider-wide and extra locks as well; they are released when the
|
|
77
|
+
* transaction ends, whatever happens.
|
|
78
|
+
*/
|
|
79
|
+
export declare class Transaction {
|
|
80
|
+
private readonly ctx;
|
|
81
|
+
readonly snapshot: Snapshot;
|
|
82
|
+
private readonly locks;
|
|
83
|
+
private readonly progress;
|
|
84
|
+
readonly info: {
|
|
85
|
+
operation: PoolOperation;
|
|
86
|
+
rowId: string | undefined;
|
|
87
|
+
};
|
|
88
|
+
config: Record<string, unknown>;
|
|
89
|
+
state: Record<string, unknown>;
|
|
90
|
+
constructor(ctx: StoreContext, snapshot: Snapshot, locks: LockStack, progress: Progress, info: {
|
|
91
|
+
operation: PoolOperation;
|
|
92
|
+
rowId: string | undefined;
|
|
93
|
+
});
|
|
94
|
+
/**
|
|
95
|
+
* The rows as every reader loads them: a row torn between the writes of a
|
|
96
|
+
* replace is shown as that replace leaves it once completed (see
|
|
97
|
+
* `PoolRow.torn`).
|
|
98
|
+
*/
|
|
99
|
+
rows(): PoolRow[];
|
|
100
|
+
row(id: string): PoolRow | undefined;
|
|
101
|
+
/** Read the config marker, or an orphan's stamp; never use a caller's reservation. */
|
|
102
|
+
reservation(id: string): unknown;
|
|
103
|
+
assertNotStaged(id: string): void;
|
|
104
|
+
roster(): unknown[];
|
|
105
|
+
/** The first roster row with this id (the one the pool loads). */
|
|
106
|
+
rosterRow(id: string): Record<string, unknown> | undefined;
|
|
107
|
+
/**
|
|
108
|
+
* Drops every roster row carrying this id. The row's per-row entry goes with
|
|
109
|
+
* it on the next `commitConfig`, which drops entries for ids no longer in
|
|
110
|
+
* the roster. Returns how many roster rows were dropped.
|
|
111
|
+
*/
|
|
112
|
+
dropRosterRows(id: string): number;
|
|
113
|
+
entries(): Record<string, unknown>;
|
|
114
|
+
entry(id: string): Record<string, unknown> | undefined;
|
|
115
|
+
setEntry(id: string, entry: Record<string, unknown>): void;
|
|
116
|
+
/**
|
|
117
|
+
* Writes the config of every row torn between the writes of a replace, or
|
|
118
|
+
* of a write giving it its first identity, as that write would have left it
|
|
119
|
+
* (see `completeTornRows`), in one config
|
|
120
|
+
* write ahead of the operation's own. The write is counted apart from the
|
|
121
|
+
* operation's: it is setup, like a pull giving a row its entry, so a later
|
|
122
|
+
* refusal still reports `before-first-write`.
|
|
123
|
+
*/
|
|
124
|
+
completeTorn(): Promise<void>;
|
|
125
|
+
stateAccount(id: string): Record<string, unknown> | undefined;
|
|
126
|
+
/** Drops the row's credential and runtime fields from the state file's accounts. */
|
|
127
|
+
dropStateAccount(id: string): void;
|
|
128
|
+
setStateAccount(id: string, fields: Record<string, unknown>): void;
|
|
129
|
+
/**
|
|
130
|
+
* Writes the config: legacy `version: 1` and the legacy roster beside
|
|
131
|
+
* `commonAuthPool`, every other top-level key and every unrecognised pool
|
|
132
|
+
* key untouched. Entries for ids no longer in the roster are dropped here,
|
|
133
|
+
* and remembered so the id is not reused in this process. Every id the
|
|
134
|
+
* write drops (a roster row the files held when the transaction read them,
|
|
135
|
+
* or an entry left without one) has its epoch recorded in the config (see
|
|
136
|
+
* `retireEpochsIn`), which is what keeps a later `add` of the id, from any
|
|
137
|
+
* process, past every epoch an attribution could name.
|
|
138
|
+
*/
|
|
139
|
+
commitConfig(options?: {
|
|
140
|
+
counted?: boolean;
|
|
141
|
+
durable?: boolean;
|
|
142
|
+
publicationDecision?: boolean;
|
|
143
|
+
}): Promise<void>;
|
|
144
|
+
/** Writes the state: every unrecognised top-level and per-row key kept. */
|
|
145
|
+
commitState(committed?: StoredCredential, options?: {
|
|
146
|
+
durable?: boolean;
|
|
147
|
+
}): Promise<void>;
|
|
148
|
+
assertAll(): Promise<void>;
|
|
149
|
+
syncState(): Promise<void>;
|
|
150
|
+
markPublicationDecision(): void;
|
|
151
|
+
syncConfig(): Promise<void>;
|
|
152
|
+
private write;
|
|
153
|
+
}
|
|
154
|
+
/** What `initializePool` did. */
|
|
155
|
+
export type InitializeOutcome = 'initialized' | 'already-ready';
|
|
156
|
+
/**
|
|
157
|
+
* Adds the pool key to a config that holds a legacy roster without one, under
|
|
158
|
+
* the store-lock list, in one config write: `commonAuthPool` with the schema
|
|
159
|
+
* version and no row entries, the legacy roster and every other top-level key
|
|
160
|
+
* kept, except the keys named in `dropKeys`. The state file is not touched.
|
|
161
|
+
* This is the only write the store makes to a pending-migration config; it is
|
|
162
|
+
* where a plugin's migration starts, and every later row goes through the
|
|
163
|
+
* ordinary operations. A config that is already a pool is left alone; a load
|
|
164
|
+
* error refuses.
|
|
165
|
+
*/
|
|
166
|
+
export declare function initializePool(ctx: StoreContext, dropKeys: readonly string[]): Promise<InitializeOutcome>;
|
|
167
|
+
/**
|
|
168
|
+
* Runs `fn` under the store-lock list. The pool must be ready: a pending
|
|
169
|
+
* migration or a load error refuses before anything is written. Unless
|
|
170
|
+
* `completeTorn` is false, rows torn between the writes of a replace are
|
|
171
|
+
* completed first, so `fn` never sees one; the writes that only record
|
|
172
|
+
* readings or reorder the roster opt out and leave such rows as they are.
|
|
173
|
+
*/
|
|
174
|
+
export declare function withTransaction<T>(ctx: StoreContext, locks: LockStack, progress: Progress, info: {
|
|
175
|
+
operation: PoolOperation;
|
|
176
|
+
rowId: string | undefined;
|
|
177
|
+
}, fn: (tx: Transaction) => Promise<T>, options?: {
|
|
178
|
+
completeTorn?: boolean;
|
|
179
|
+
}): Promise<T>;
|
|
180
|
+
/** Maps anything thrown inside an operation onto the one failure value. */
|
|
181
|
+
export declare function toFailure(error: unknown, operation: PoolOperation, rowId: string | undefined, progress: Progress): PoolOperationError;
|
|
182
|
+
/**
|
|
183
|
+
* The frame every lock-holding operation runs in: failures are mapped onto
|
|
184
|
+
* the failure value, handed to the failure hook while the outer locks are
|
|
185
|
+
* still held (the store locks are already released), and rethrown; every
|
|
186
|
+
* lock is released afterwards. `rowId` is undefined for an operation that
|
|
187
|
+
* names no row (`reorder`).
|
|
188
|
+
*/
|
|
189
|
+
export declare function runOperation<T, R extends string | undefined = string>(ctx: StoreContext, operation: PoolOperation, rowId: R, onFailure: ((rowId: R, error: PoolOperationError) => void | Promise<void>) | undefined, body: (locks: LockStack, progress: Progress) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { type Attribution } from './attribution.js';
|
|
2
|
+
import type { PoolOperationError } from './errors.js';
|
|
3
|
+
import type { PoolLogger } from './hooks.js';
|
|
4
|
+
import { type HoldPoint, type InitializeOutcome, type StoreContext } from './mutate.js';
|
|
5
|
+
import { type ProviderStateMutator, type UpdateProviderStateResult } from './provider-state.js';
|
|
6
|
+
import { type PublicationReceipt, type PublishOptions, type PublishPlan, type PublishResult } from './publication.js';
|
|
7
|
+
import { type PullHook } from './pull.js';
|
|
8
|
+
import { type ProviderRefresh, type RefreshOptions, type RefreshOutcome } from './refresh.js';
|
|
9
|
+
import { type LockEnvironment, type PoolLockOptions, type PoolLockSpec } from './refresh-lock.js';
|
|
10
|
+
import { type AddInput, type AddOptions, type AddResult, type CredentialWriteInput, type RemoveOptions, type RemoveResult, type ReorderOptions, type ReorderResult, type RowOperationOptions, type RowToggleOptions, type RowTransitionOptions, type RowTransitionResult, type RowWriteOptions } from './rows.js';
|
|
11
|
+
import { type PoolCredential, type PoolRow, type ProviderStateCodec, type QuotaCodec, type RotateCredential, type StoredCredential } from './schema.js';
|
|
12
|
+
import { type SettingsMutator, type SettingsRead, type UpdateSettingsOptions, type UpdateSettingsResult } from './settings.js';
|
|
13
|
+
export interface OpenPoolStoreOptions {
|
|
14
|
+
/** The provider every row of this pool belongs to; keys the provider-wide lock. */
|
|
15
|
+
provider: string;
|
|
16
|
+
configPath: string;
|
|
17
|
+
statePath: string;
|
|
18
|
+
quota: QuotaCodec;
|
|
19
|
+
/**
|
|
20
|
+
* The codec of the provider state kept beside each row's credential (see
|
|
21
|
+
* `ProviderStateCodec`). Without it no row shows a provider state, and
|
|
22
|
+
* every write that would set one refuses (`invalid-input`); writes that
|
|
23
|
+
* leave it alone keep the value on disk as it is, and `replace` clears it.
|
|
24
|
+
*/
|
|
25
|
+
providerState?: ProviderStateCodec;
|
|
26
|
+
/**
|
|
27
|
+
* Refuse every credential this store did not stamp (default false, which
|
|
28
|
+
* loads unstamped and mis-stamped credentials as older writers left them).
|
|
29
|
+
* When true, a row whose `stamp` is not `bound` loads `unbound` and is no
|
|
30
|
+
* candidate, and every operation that would use or keep its credential or
|
|
31
|
+
* what was observed about it (`refresh`, quota pulls, `recordQuota`,
|
|
32
|
+
* `recordIdentity`, `rotate`, and an `add` of the same secret or onto the
|
|
33
|
+
* same credential-less row) refuses with `unbound-credential` before any
|
|
34
|
+
* provider call or write, checked again under the locks and at commit.
|
|
35
|
+
* Nothing makes such a row bound except `replace`, which starts a new
|
|
36
|
+
* credential epoch and drops what was observed about the old one.
|
|
37
|
+
* An interrupted add's state-only orphan is recovered only when its stamp
|
|
38
|
+
* binds the stored and incoming material, including a supplied identity and
|
|
39
|
+
* an API key's endpoint/header. Otherwise add refuses `unbound-credential`
|
|
40
|
+
* without writing; `remove(id)` explicitly discards the orphan.
|
|
41
|
+
*/
|
|
42
|
+
requireCredentialStamps?: boolean;
|
|
43
|
+
/** Require an exact secret fingerprint for every roster-publication removal. */
|
|
44
|
+
requireRemovedFingerprint?: boolean;
|
|
45
|
+
/** Injected clock for leases, refresh stamps and `addedAt`. */
|
|
46
|
+
now?: () => number;
|
|
47
|
+
/**
|
|
48
|
+
* Ordered store-lock list held across every read-modify-write. Defaults to
|
|
49
|
+
* the older writers' `save` lock at the config path, then at the state path.
|
|
50
|
+
*/
|
|
51
|
+
storeLocks?: readonly PoolLockSpec[];
|
|
52
|
+
/** Defaults for every lock the store takes (see `POOL_LOCK_DEFAULTS`). */
|
|
53
|
+
lockOptions?: Partial<PoolLockOptions>;
|
|
54
|
+
/** Overrides for the row locks only. */
|
|
55
|
+
rowLockOptions?: Partial<PoolLockOptions>;
|
|
56
|
+
/** The provider-wide lock; defaults to `provider-<provider>` beside the state file. */
|
|
57
|
+
providerLock?: PoolLockSpec;
|
|
58
|
+
/** Quota pull hook, fired without being awaited. */
|
|
59
|
+
pull?: PullHook;
|
|
60
|
+
/** Receives every pull failure, since no caller awaits a pull. */
|
|
61
|
+
onPullFailure?: (rowId: string, error: PoolOperationError) => void | Promise<void>;
|
|
62
|
+
logger?: PoolLogger;
|
|
63
|
+
/** Named write steps, awaited; a test seam for crash and ownership rows. */
|
|
64
|
+
onStep?: StoreContext['onStep'];
|
|
65
|
+
/** Awaitable hold points on the refresh and pull paths; a test seam. */
|
|
66
|
+
hold?: (point: HoldPoint, rowId: string) => void | Promise<void>;
|
|
67
|
+
onLockEvent?: LockEnvironment['onLockEvent'];
|
|
68
|
+
onLockStep?: LockEnvironment['onLockStep'];
|
|
69
|
+
}
|
|
70
|
+
export type PoolLoad = {
|
|
71
|
+
status: 'ready';
|
|
72
|
+
schemaVersion: number;
|
|
73
|
+
rows: PoolRow[];
|
|
74
|
+
} | {
|
|
75
|
+
status: 'pending-migration';
|
|
76
|
+
roster: unknown[];
|
|
77
|
+
} | {
|
|
78
|
+
status: 'error';
|
|
79
|
+
file: 'config' | 'state';
|
|
80
|
+
reason: string;
|
|
81
|
+
kind?: 'snapshot-contended';
|
|
82
|
+
retryable?: true;
|
|
83
|
+
};
|
|
84
|
+
export interface PoolStore {
|
|
85
|
+
/** Reads the pool and fires first-reading pulls; never writes a file itself. */
|
|
86
|
+
load(): Promise<PoolLoad>;
|
|
87
|
+
/** Reads the pool without firing anything. */
|
|
88
|
+
read(): Promise<PoolLoad>;
|
|
89
|
+
/**
|
|
90
|
+
* Turns a pending-migration config into an empty pool (the pool key with no
|
|
91
|
+
* row entries) in one locked config write, dropping the named top-level
|
|
92
|
+
* keys and keeping the rest. The start of a plugin's migration; a ready
|
|
93
|
+
* pool is left alone. Failures carry operation `initialize`.
|
|
94
|
+
*/
|
|
95
|
+
initialize(input?: {
|
|
96
|
+
dropKeys?: readonly string[];
|
|
97
|
+
}): Promise<{
|
|
98
|
+
status: InitializeOutcome;
|
|
99
|
+
}>;
|
|
100
|
+
/**
|
|
101
|
+
* Adds a row, or completes or rotates the row already holding the id or
|
|
102
|
+
* the secret. A new row starts at credential epoch 1; since 0.8.0 one
|
|
103
|
+
* whose id the pool held before starts one past the highest epoch that id
|
|
104
|
+
* held (see `Attribution`), and an id that held `Number.MAX_SAFE_INTEGER`
|
|
105
|
+
* refuses (`id-removed`) before writing.
|
|
106
|
+
*/
|
|
107
|
+
add(input: AddInput, options?: AddOptions): Promise<AddResult>;
|
|
108
|
+
publishRoster(plan: PublishPlan, options?: PublishOptions): Promise<PublishResult>;
|
|
109
|
+
publication(operationId: string): Promise<PublicationReceipt | undefined>;
|
|
110
|
+
/**
|
|
111
|
+
* Gives a row a new credential and a new credential epoch. Since 0.6.0 the
|
|
112
|
+
* row's provider state is whatever `ProviderStateCodec.onReplace` returns;
|
|
113
|
+
* without that hook it is `input.providerState`, else cleared.
|
|
114
|
+
* Optional `attribution` fences the write on the prior credential under the
|
|
115
|
+
* locks, before any write or replacement hook; see `RowWriteOptions`.
|
|
116
|
+
*/
|
|
117
|
+
replace(id: string, credential: PoolCredential, input?: CredentialWriteInput, options?: RowWriteOptions): Promise<{
|
|
118
|
+
id: string;
|
|
119
|
+
credential: StoredCredential;
|
|
120
|
+
credentialEpoch: number;
|
|
121
|
+
}>;
|
|
122
|
+
/**
|
|
123
|
+
* Refreshes the secret a row holds without changing its account or
|
|
124
|
+
* endpoint. Since 0.4.1 an API key may leave out `baseURL` and `authHeader`
|
|
125
|
+
* to keep the row's, and one that gives another is refused
|
|
126
|
+
* (`endpoint-mismatch`) before writing: that is a `replace`.
|
|
127
|
+
* Takes the same optional attribution fence as `replace` (`RowWriteOptions`).
|
|
128
|
+
*/
|
|
129
|
+
rotate(id: string, credential: RotateCredential, input?: CredentialWriteInput, options?: RowWriteOptions): Promise<{
|
|
130
|
+
id: string;
|
|
131
|
+
credential: StoredCredential;
|
|
132
|
+
}>;
|
|
133
|
+
/**
|
|
134
|
+
* Changes a row's provider state without touching its credential (since
|
|
135
|
+
* 0.6.0), under the row lock, `extraLocks` and the store locks. Refuses
|
|
136
|
+
* (`attribution`) once the row has moved off the credential epoch or
|
|
137
|
+
* identity in `fence`, and (`unknown-row`) once it is removed.
|
|
138
|
+
*/
|
|
139
|
+
updateProviderState(id: string, fence: Attribution, mutator: ProviderStateMutator, options?: RowToggleOptions): Promise<UpdateProviderStateResult>;
|
|
140
|
+
/**
|
|
141
|
+
* Sets `enabled: false` and the entry's `disabledReason`. Takes the row
|
|
142
|
+
* lock, then `extraLocks`, then the store locks (the row lock and
|
|
143
|
+
* `extraLocks` since 0.2.3). Since 0.7.0 it may be fenced on the
|
|
144
|
+
* credential the caller's evidence is about (`attribution`) and carry a
|
|
145
|
+
* provider-state change that lands with it (`providerState`); see
|
|
146
|
+
* `RowTransitionOptions`.
|
|
147
|
+
*/
|
|
148
|
+
disable(id: string, reason: string, options?: RowTransitionOptions): Promise<RowTransitionResult>;
|
|
149
|
+
/**
|
|
150
|
+
* Clears `enabled: false` and `disabledReason` (since 0.2.3); refuses with
|
|
151
|
+
* `duplicate-identity` when another enabled OAuth row holds the row's
|
|
152
|
+
* identity. Locks as `disable`, and takes the same options since 0.7.0.
|
|
153
|
+
*/
|
|
154
|
+
enable(id: string, options?: RowTransitionOptions): Promise<RowTransitionResult>;
|
|
155
|
+
/**
|
|
156
|
+
* Deletes the roster row, its per-row entry and its state-file credential
|
|
157
|
+
* (since 0.2.3). Locks as `disable`; `protect` can refuse the id.
|
|
158
|
+
*/
|
|
159
|
+
remove(id: string, options?: RemoveOptions): Promise<RemoveResult>;
|
|
160
|
+
/**
|
|
161
|
+
* Sets the roster order (since 0.2.4) in one config write. `ids` must name
|
|
162
|
+
* every roster id exactly once; anything else refuses with `invalid-order`
|
|
163
|
+
* and writes nothing. Takes `extraLocks`, then the store locks; no row or
|
|
164
|
+
* provider-wide lock. Roster rows and their entries are left unchanged.
|
|
165
|
+
*/
|
|
166
|
+
reorder(ids: readonly string[], options?: ReorderOptions): Promise<ReorderResult>;
|
|
167
|
+
/**
|
|
168
|
+
* The plugin's settings (since 0.2.6): every top-level key of the config
|
|
169
|
+
* file except the pool-owned ones (`POOL_OWNED_KEYS`). Never writes.
|
|
170
|
+
*/
|
|
171
|
+
readSettings(): Promise<SettingsRead>;
|
|
172
|
+
/**
|
|
173
|
+
* One locked write of the plugin's settings (since 0.2.6) beside the pool,
|
|
174
|
+
* in the config file. Refuses a result that sets a pool-owned key
|
|
175
|
+
* (`invalid-input`). Takes `extraLocks`, then the store locks.
|
|
176
|
+
*/
|
|
177
|
+
updateSettings(mutator: SettingsMutator, options?: UpdateSettingsOptions): Promise<UpdateSettingsResult>;
|
|
178
|
+
/**
|
|
179
|
+
* Records the identity a lookup found for the row's credential. Since
|
|
180
|
+
* 0.3.1 it takes the credential epoch the lookup was issued for, and
|
|
181
|
+
* refuses a lookup that completes after the row was replaced
|
|
182
|
+
* (`attribution`) or a row recorded for another account
|
|
183
|
+
* (`identity-mismatch`).
|
|
184
|
+
*/
|
|
185
|
+
recordIdentity(id: string, identity: string, attribution: Pick<Attribution, 'credentialEpoch'>, options?: RowOperationOptions): Promise<{
|
|
186
|
+
id: string;
|
|
187
|
+
disabled: string[];
|
|
188
|
+
}>;
|
|
189
|
+
refresh(id: string, provider: ProviderRefresh, options?: RefreshOptions): Promise<RefreshOutcome>;
|
|
190
|
+
recordQuota(id: string, attribution: Attribution, observation: unknown): Promise<void>;
|
|
191
|
+
/** Fires a pull for a row admission refused for want of a reading. */
|
|
192
|
+
requestReading(id: string): void;
|
|
193
|
+
/** Resolves once every pull fired so far has settled. */
|
|
194
|
+
pullsSettled(): Promise<void>;
|
|
195
|
+
}
|
|
196
|
+
export declare function openPoolStore(options: OpenPoolStoreOptions): PoolStore;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import type { Attribution } from './attribution.js';
|
|
2
|
+
import type { PoolOperation } from './errors.js';
|
|
3
|
+
import { type Transaction } from './mutate.js';
|
|
4
|
+
import type { RowToggleOptions } from './rows.js';
|
|
5
|
+
import { type StoreRuntime } from './runtime.js';
|
|
6
|
+
import { type PoolRow, type ProviderStateCodec } from './schema.js';
|
|
7
|
+
/**
|
|
8
|
+
* What a credential write does to the provider state beside it: `keep`
|
|
9
|
+
* leaves the value on disk as it is (bound by the new stamp only if the old
|
|
10
|
+
* stamp bound it to the same row, epoch and identity), `set` stores a value
|
|
11
|
+
* the codec accepted, and `clear` deletes it.
|
|
12
|
+
*/
|
|
13
|
+
export type ProviderStateWrite = {
|
|
14
|
+
kind: 'keep';
|
|
15
|
+
} | {
|
|
16
|
+
kind: 'set';
|
|
17
|
+
value: unknown;
|
|
18
|
+
} | {
|
|
19
|
+
kind: 'clear';
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A provider state as the store will store it: a JSON round trip of it (so
|
|
23
|
+
* its digest is the same once read back from disk), accepted by the codec.
|
|
24
|
+
* Refused before anything is written when the store has no codec, the value
|
|
25
|
+
* is not JSON, or the codec rejects it.
|
|
26
|
+
*/
|
|
27
|
+
export declare function acceptProviderState(codec: ProviderStateCodec | undefined, operation: PoolOperation, id: string, value: unknown, what?: string): unknown;
|
|
28
|
+
/**
|
|
29
|
+
* The write for a value a credential write brings (`add` of a secret the
|
|
30
|
+
* pool holds, `rotate`, a refresh): merged with the row's value on disk by
|
|
31
|
+
* the codec's `merge` when both exist, else the incoming value as is.
|
|
32
|
+
*/
|
|
33
|
+
export declare function mergedProviderState(codec: ProviderStateCodec | undefined, operation: PoolOperation, id: string, onDisk: unknown, incoming: unknown): ProviderStateWrite;
|
|
34
|
+
/**
|
|
35
|
+
* The provider state a replace leaves on the row, decided before anything is
|
|
36
|
+
* written: whatever the codec's `onReplace` returns (undefined clears it), or
|
|
37
|
+
* without that hook the value handed to `replace`, else nothing. The old
|
|
38
|
+
* credential's value is never kept by default: it describes the account the
|
|
39
|
+
* replaced credential belonged to.
|
|
40
|
+
*/
|
|
41
|
+
export declare function replacementProviderState(codec: ProviderStateCodec | undefined, row: PoolRow, credentialEpoch: number, identity: string | undefined, incoming: unknown): ProviderStateWrite;
|
|
42
|
+
/**
|
|
43
|
+
* The provider-state digest the stamp of a credential write carries, and the
|
|
44
|
+
* state-file fields it changes. `set` binds the new value; `keep` carries the
|
|
45
|
+
* old stamp's digest forward only when that stamp bound it to this row as it
|
|
46
|
+
* stood before the write (same credential lineage, the epoch being written,
|
|
47
|
+
* the identity recorded before the write); `clear` binds nothing.
|
|
48
|
+
*/
|
|
49
|
+
export declare function providerStateCoverage(codec: ProviderStateCodec | undefined, write: ProviderStateWrite, prior: Record<string, unknown> | undefined, priorRow: PoolRow | undefined, credentialEpoch: number): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Receives a private copy of the row's provider state (undefined when the row
|
|
52
|
+
* shows none) and the row as loaded under the locks, and returns the next
|
|
53
|
+
* provider state; returning undefined clears it, so a mutator that means to
|
|
54
|
+
* keep the value returns it. It runs under the row lock and the store locks,
|
|
55
|
+
* so it must not call back into the store (`PoolReentryError`).
|
|
56
|
+
*/
|
|
57
|
+
export type ProviderStateMutator = (current: unknown | undefined, row: PoolRow) => unknown | Promise<unknown>;
|
|
58
|
+
export type UpdateProviderStateResult = {
|
|
59
|
+
id: string;
|
|
60
|
+
/** The provider state now on disk; absent when the row has none. */
|
|
61
|
+
providerState?: unknown;
|
|
62
|
+
/**
|
|
63
|
+
* `unchanged`: the mutator returned what the row already shows (or cleared
|
|
64
|
+
* a row that holds none); nothing was written.
|
|
65
|
+
*/
|
|
66
|
+
outcome: 'updated' | 'cleared' | 'unchanged';
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Changes a row's provider state without touching its credential, in one
|
|
70
|
+
* state-file write under the row lock, the caller's extra locks and the
|
|
71
|
+
* store locks. `fence` is what the caller read the row at: the write is
|
|
72
|
+
* refused (`attribution`, retryable) when the row has since moved to another
|
|
73
|
+
* credential epoch or recorded identity, and (`unknown-row`) once it is
|
|
74
|
+
* removed, so a writer that read the row before a replace or a removal never
|
|
75
|
+
* lands its value on the new credential or brings a removed row's state back.
|
|
76
|
+
*
|
|
77
|
+
* The value is bound by the stamp already beside the credential. When its
|
|
78
|
+
* credential-bound part is unchanged the stamp is left byte for byte as it
|
|
79
|
+
* is; otherwise only the stamp's provider-state digest changes, so the
|
|
80
|
+
* credential's stamp status never moves. With `requireCredentialStamps`, an
|
|
81
|
+
* unbound row refuses (`unbound-credential`) as every other strict path
|
|
82
|
+
* does. Without it, a row whose stamp was not written by this store with this
|
|
83
|
+
* credential at the row's epoch and identity refuses the same way: no stamp
|
|
84
|
+
* could bind the value, so no reader would ever show it. A `rotate` or
|
|
85
|
+
* `replace` stamps such a row.
|
|
86
|
+
*/
|
|
87
|
+
export declare function updateProviderStateRow(rt: StoreRuntime, id: string, fence: Attribution, mutator: ProviderStateMutator, options?: RowToggleOptions): Promise<UpdateProviderStateResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Returned by the provider-state mutator of an attributed `disable` or
|
|
90
|
+
* `enable` to decline the whole transition: nothing is written, neither the
|
|
91
|
+
* provider state nor the row's enabled flag, and the call resolves with
|
|
92
|
+
* `declined: true`. A mutator declines when the state it is shown is newer
|
|
93
|
+
* than what its caller saw, such as an eligibility recorded after the
|
|
94
|
+
* request whose refusal is being acted on. It is a value of its own because
|
|
95
|
+
* `undefined` already means "clear the provider state". `Symbol.for` keeps it
|
|
96
|
+
* equal across two copies of this module loaded in one process.
|
|
97
|
+
*/
|
|
98
|
+
export declare const DECLINE_TRANSITION: unique symbol;
|
|
99
|
+
/**
|
|
100
|
+
* The provider-state mutator of an attributed `disable` or `enable`: as
|
|
101
|
+
* `ProviderStateMutator`, and it may also return `DECLINE_TRANSITION`.
|
|
102
|
+
*/
|
|
103
|
+
export type RowTransitionMutator = (current: unknown | undefined, row: PoolRow) => unknown | typeof DECLINE_TRANSITION | Promise<unknown | typeof DECLINE_TRANSITION>;
|
|
104
|
+
/**
|
|
105
|
+
* What a provider-state mutator asks of a row, worked out under the locks
|
|
106
|
+
* before anything is written. `changed` carries the row's whole next
|
|
107
|
+
* state-file account entry (the value, and the stamp rebound to it when its
|
|
108
|
+
* credential-bound part moved); `value` is the next value, absent when it is
|
|
109
|
+
* cleared.
|
|
110
|
+
*/
|
|
111
|
+
export type ProviderStatePlan = {
|
|
112
|
+
kind: 'declined';
|
|
113
|
+
} | {
|
|
114
|
+
kind: 'unchanged';
|
|
115
|
+
value?: unknown;
|
|
116
|
+
} | {
|
|
117
|
+
kind: 'changed';
|
|
118
|
+
value?: unknown;
|
|
119
|
+
account: Record<string, unknown>;
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Runs a provider-state mutator for a row loaded under every lock and
|
|
123
|
+
* already checked by the caller (present, valid, inside its attribution
|
|
124
|
+
* fence), and plans the write. Refuses (`no-credential`) a row holding no
|
|
125
|
+
* credential, and (`unbound-credential`) one whose credential carries no
|
|
126
|
+
* stamp of this store at the row's epoch and identity: no stamp could bind
|
|
127
|
+
* the value, so no reader would ever show it. `DECLINE_TRANSITION` is
|
|
128
|
+
* honoured only when `declinable` is set; elsewhere it is not JSON and is
|
|
129
|
+
* refused as such.
|
|
130
|
+
*/
|
|
131
|
+
export declare function planProviderStateIn(tx: Transaction, codec: ProviderStateCodec, operation: PoolOperation, row: PoolRow, mutator: ProviderStateMutator | RowTransitionMutator, declinable?: boolean): Promise<ProviderStatePlan>;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Attribution } from './attribution.js';
|
|
2
|
+
import type { PoolLockSpec } from './refresh-lock.js';
|
|
3
|
+
import { type FailureHook, type ProtectFn } from './rows.js';
|
|
4
|
+
import { type StoreRuntime } from './runtime.js';
|
|
5
|
+
export interface PublishPlan {
|
|
6
|
+
operationId: string;
|
|
7
|
+
remove: Array<{
|
|
8
|
+
id: string;
|
|
9
|
+
attribution: Attribution;
|
|
10
|
+
fingerprint?: string;
|
|
11
|
+
}>;
|
|
12
|
+
finalize: Array<{
|
|
13
|
+
id: string;
|
|
14
|
+
attribution: Attribution;
|
|
15
|
+
reservation: string;
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
disabledReason?: string;
|
|
18
|
+
}>;
|
|
19
|
+
order: string[];
|
|
20
|
+
}
|
|
21
|
+
export interface PublicationReceipt {
|
|
22
|
+
operationId: string;
|
|
23
|
+
planDigest: string;
|
|
24
|
+
phase: 'committed' | 'cleaned';
|
|
25
|
+
removed: Array<{
|
|
26
|
+
id: string;
|
|
27
|
+
credentialEpoch: number;
|
|
28
|
+
}>;
|
|
29
|
+
finalized: Array<{
|
|
30
|
+
id: string;
|
|
31
|
+
credentialEpoch: number;
|
|
32
|
+
reservation: string;
|
|
33
|
+
enabled: boolean;
|
|
34
|
+
}>;
|
|
35
|
+
}
|
|
36
|
+
export interface PublishOptions {
|
|
37
|
+
protect?: ProtectFn;
|
|
38
|
+
extraLocks?: PoolLockSpec[];
|
|
39
|
+
providerLock?: PoolLockSpec;
|
|
40
|
+
onFailure?: FailureHook;
|
|
41
|
+
}
|
|
42
|
+
export interface PublishResult {
|
|
43
|
+
outcome: 'published' | 'cleaned' | 'already-cleaned';
|
|
44
|
+
receipt: PublicationReceipt;
|
|
45
|
+
}
|
|
46
|
+
export declare function publication(rt: StoreRuntime, operationId: string): Promise<PublicationReceipt | undefined>;
|
|
47
|
+
export declare function publishRoster(rt: StoreRuntime, plan: PublishPlan, options?: PublishOptions): Promise<PublishResult>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { PoolOperationError } from './errors.js';
|
|
2
|
+
import type { PoolLogger } from './hooks.js';
|
|
3
|
+
import { type PullReason, type StoreRuntime } from './runtime.js';
|
|
4
|
+
import type { StoredCredential } from './schema.js';
|
|
5
|
+
/** What a pull is issued with: the credential and its attribution tuple. */
|
|
6
|
+
export interface PullRequest {
|
|
7
|
+
id: string;
|
|
8
|
+
credential: StoredCredential;
|
|
9
|
+
credentialEpoch: number;
|
|
10
|
+
identity?: string;
|
|
11
|
+
reason: PullReason;
|
|
12
|
+
}
|
|
13
|
+
export type PullHook = (request: PullRequest) => Promise<unknown>;
|
|
14
|
+
/**
|
|
15
|
+
* Fires quota pulls without ever making a caller wait for one. A pull first
|
|
16
|
+
* gives a row without a per-row entry its entry at epoch 1 (its own locked
|
|
17
|
+
* config write), then captures the credential and the attribution tuple in
|
|
18
|
+
* one locked read, requests the observation, and records it only if
|
|
19
|
+
* attribution still holds. Failures go to the store's pull failure hook.
|
|
20
|
+
*/
|
|
21
|
+
export declare class PullScheduler {
|
|
22
|
+
private readonly rt;
|
|
23
|
+
private readonly hook;
|
|
24
|
+
private readonly onFailure;
|
|
25
|
+
/** Rows a load-time pull has fired for in this process. */
|
|
26
|
+
private readonly firedAtLoad;
|
|
27
|
+
private readonly logger;
|
|
28
|
+
private readonly inflight;
|
|
29
|
+
constructor(rt: () => StoreRuntime, hook: PullHook | undefined, onFailure: ((rowId: string, error: PoolOperationError) => void | Promise<void>) | undefined,
|
|
30
|
+
/** Rows a load-time pull has fired for in this process. */
|
|
31
|
+
firedAtLoad: Set<string>, logger: PoolLogger | undefined);
|
|
32
|
+
fire(id: string, reason: PullReason): void;
|
|
33
|
+
/** Resolves once every pull fired so far has settled. */
|
|
34
|
+
settled(): Promise<void>;
|
|
35
|
+
private run;
|
|
36
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { acquireRefreshFileLock } from '../fs/refresh-file-lock.js';
|
|
2
|
+
type LockStep = NonNullable<Parameters<typeof acquireRefreshFileLock>[0]['onStep']> extends (step: infer S) => unknown ? S : never;
|
|
3
|
+
/** Tuning shared by every lock the store takes; each field is overridable. */
|
|
4
|
+
export interface PoolLockOptions {
|
|
5
|
+
ttlMs: number;
|
|
6
|
+
timeoutMs: number;
|
|
7
|
+
retryMs: number;
|
|
8
|
+
renew: boolean;
|
|
9
|
+
renewIntervalMs?: number;
|
|
10
|
+
}
|
|
11
|
+
/** A lock: the (name, path) pair naming its file plus optional tuning. */
|
|
12
|
+
export interface PoolLockSpec extends Partial<PoolLockOptions> {
|
|
13
|
+
name: string;
|
|
14
|
+
path: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Store lock defaults: a 15 000 ms bounded wait retried every 50 ms plus
|
|
18
|
+
* jitter, and a renewed 10 000 ms lease.
|
|
19
|
+
*/
|
|
20
|
+
export declare const POOL_LOCK_DEFAULTS: Readonly<PoolLockOptions>;
|
|
21
|
+
export type LockEvent = {
|
|
22
|
+
type: 'acquired' | 'released' | 'contended';
|
|
23
|
+
name: string;
|
|
24
|
+
path: string;
|
|
25
|
+
};
|
|
26
|
+
export interface LockEnvironment {
|
|
27
|
+
now: () => number;
|
|
28
|
+
onLockEvent?: (event: LockEvent) => void;
|
|
29
|
+
onLockStep?: (lock: {
|
|
30
|
+
name: string;
|
|
31
|
+
path: string;
|
|
32
|
+
}, step: LockStep) => void | Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
export interface HeldLock {
|
|
35
|
+
readonly name: string;
|
|
36
|
+
readonly path: string;
|
|
37
|
+
assertOwned(): Promise<void>;
|
|
38
|
+
release(): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Takes one lock, retrying while a live holder has it until `timeoutMs` has
|
|
42
|
+
* passed on the real clock, then throws `LockContentionError`. The lease is
|
|
43
|
+
* asserted as owned once acquired, so a caller never proceeds on a lease that
|
|
44
|
+
* expired during the wait.
|
|
45
|
+
*/
|
|
46
|
+
export declare function acquirePoolLock(spec: PoolLockSpec, defaults: PoolLockOptions, env: LockEnvironment): Promise<HeldLock>;
|
|
47
|
+
/**
|
|
48
|
+
* Locks taken in order and released in reverse. Every acquisition re-asserts
|
|
49
|
+
* the leases already held, because a wait is exactly when an earlier lease
|
|
50
|
+
* can expire unnoticed.
|
|
51
|
+
*/
|
|
52
|
+
export declare class LockStack {
|
|
53
|
+
private readonly defaults;
|
|
54
|
+
private readonly env;
|
|
55
|
+
readonly held: HeldLock[];
|
|
56
|
+
constructor(defaults: PoolLockOptions, env: LockEnvironment);
|
|
57
|
+
acquire(spec: PoolLockSpec): Promise<HeldLock>;
|
|
58
|
+
assertAll(): Promise<void>;
|
|
59
|
+
/** Releases every lock taken after `mark` (a length of `held`), newest first. */
|
|
60
|
+
releaseTo(mark: number): Promise<void>;
|
|
61
|
+
releaseAll(): Promise<void>;
|
|
62
|
+
}
|
|
63
|
+
export {};
|