@cortexkit/opencode-antigravity-auth 2.2.1 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -89
- package/dist/cli.js +18469 -810
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +4079 -0
- package/dist/index.js +40914 -16441
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +6949 -0
- package/dist/server.js +50948 -0
- package/dist/server.js.map +7 -0
- package/dist/server.meta.json +7284 -0
- package/dist/src/cli.d.ts +46 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +207 -2
- package/dist/src/cli.js.map +1 -1
- package/dist/src/common-auth-embedded/NOTICE.txt +21 -0
- package/dist/src/common-auth-embedded/auth-menu/accounts.d.ts +97 -0
- package/dist/src/common-auth-embedded/auth-menu/accounts.js +387 -0
- package/dist/src/common-auth-embedded/auth-menu/ansi.d.ts +26 -0
- package/dist/src/common-auth-embedded/auth-menu/ansi.js +98 -0
- package/dist/src/common-auth-embedded/auth-menu/confirm.d.ts +7 -0
- package/dist/src/common-auth-embedded/auth-menu/confirm.js +21 -0
- package/dist/src/common-auth-embedded/auth-menu/doctor.d.ts +52 -0
- package/dist/src/common-auth-embedded/auth-menu/doctor.js +81 -0
- package/dist/src/common-auth-embedded/auth-menu/index.d.ts +17 -0
- package/dist/src/common-auth-embedded/auth-menu/index.js +12 -0
- package/dist/src/common-auth-embedded/auth-menu/login.d.ts +55 -0
- package/dist/src/common-auth-embedded/auth-menu/login.js +83 -0
- package/dist/src/common-auth-embedded/auth-menu/menu.d.ts +59 -0
- package/dist/src/common-auth-embedded/auth-menu/menu.js +73 -0
- package/dist/src/common-auth-embedded/auth-menu/opencode-v1.d.ts +49 -0
- package/dist/src/common-auth-embedded/auth-menu/opencode-v1.js +47 -0
- package/dist/src/common-auth-embedded/auth-menu/select.d.ts +21 -0
- package/dist/src/common-auth-embedded/auth-menu/select.js +159 -0
- package/dist/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
- package/dist/src/common-auth-embedded/auth-menu/terminal.js +19 -0
- package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +102 -0
- package/dist/src/common-auth-embedded/claustrum/consumer.js +298 -0
- package/dist/src/common-auth-embedded/claustrum/custody.d.ts +175 -0
- package/dist/src/common-auth-embedded/claustrum/custody.js +354 -0
- package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +158 -0
- package/dist/src/common-auth-embedded/claustrum/enrollment.js +759 -0
- package/dist/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
- package/dist/src/common-auth-embedded/claustrum/errors.js +8 -0
- package/dist/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
- package/dist/src/common-auth-embedded/claustrum/host-slot.js +72 -0
- package/dist/src/common-auth-embedded/claustrum/index.d.ts +18 -0
- package/dist/src/common-auth-embedded/claustrum/index.js +22 -0
- package/dist/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
- package/dist/src/common-auth-embedded/claustrum/interlock.js +29 -0
- package/dist/src/common-auth-embedded/claustrum/roster.d.ts +208 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +536 -0
- package/dist/src/common-auth-embedded/commands/builtins.d.ts +71 -0
- package/dist/src/common-auth-embedded/commands/builtins.js +534 -0
- package/dist/src/common-auth-embedded/commands/index.d.ts +10 -0
- package/dist/src/common-auth-embedded/commands/index.js +5 -0
- package/dist/src/common-auth-embedded/commands/menu.d.ts +61 -0
- package/dist/src/common-auth-embedded/commands/menu.js +300 -0
- package/dist/src/common-auth-embedded/commands/model.d.ts +238 -0
- package/dist/src/common-auth-embedded/commands/model.js +16 -0
- package/dist/src/common-auth-embedded/commands/pi.d.ts +23 -0
- package/dist/src/common-auth-embedded/commands/pi.js +206 -0
- package/dist/src/common-auth-embedded/commands/seam.d.ts +72 -0
- package/dist/src/common-auth-embedded/commands/seam.js +301 -0
- package/dist/src/common-auth-embedded/fs/atomic-write.d.ts +20 -0
- package/dist/src/common-auth-embedded/fs/atomic-write.js +80 -0
- package/dist/src/common-auth-embedded/fs/index.d.ts +7 -0
- package/dist/src/common-auth-embedded/fs/index.js +6 -0
- package/dist/src/common-auth-embedded/fs/lock-constants.d.ts +14 -0
- package/dist/src/common-auth-embedded/fs/lock-constants.js +14 -0
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +501 -0
- package/dist/src/common-auth-embedded/fs/with-lock.d.ts +33 -0
- package/dist/src/common-auth-embedded/fs/with-lock.js +48 -0
- package/dist/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
- package/dist/src/common-auth-embedded/logger/capture-sink.js +13 -0
- package/dist/src/common-auth-embedded/logger/engine.d.ts +100 -0
- package/dist/src/common-auth-embedded/logger/engine.js +246 -0
- package/dist/src/common-auth-embedded/logger/index.d.ts +6 -0
- package/dist/src/common-auth-embedded/logger/index.js +3 -0
- package/dist/src/common-auth-embedded/logger/redact.d.ts +11 -0
- package/dist/src/common-auth-embedded/logger/redact.js +83 -0
- package/dist/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
- package/dist/src/common-auth-embedded/opencode2/errors.js +15 -0
- package/dist/src/common-auth-embedded/opencode2/index.d.ts +8 -0
- package/dist/src/common-auth-embedded/opencode2/index.js +4 -0
- package/dist/src/common-auth-embedded/opencode2/install.d.ts +55 -0
- package/dist/src/common-auth-embedded/opencode2/install.js +886 -0
- package/dist/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
- package/dist/src/common-auth-embedded/opencode2/integration.js +143 -0
- package/dist/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
- package/dist/src/common-auth-embedded/opencode2/sse.js +60 -0
- package/dist/src/common-auth-embedded/opencode2/types.d.ts +413 -0
- package/dist/src/common-auth-embedded/pi-slot/index.d.ts +3 -0
- package/dist/src/common-auth-embedded/pi-slot/index.js +2 -0
- package/dist/src/common-auth-embedded/pi-slot/lock.js +212 -0
- package/dist/src/common-auth-embedded/pi-slot/slot.d.ts +49 -0
- package/dist/src/common-auth-embedded/pi-slot/slot.js +383 -0
- package/dist/src/common-auth-embedded/quota/codec.d.ts +11 -0
- package/dist/src/common-auth-embedded/quota/codec.js +12 -0
- package/dist/src/common-auth-embedded/quota/format.d.ts +46 -0
- package/dist/src/common-auth-embedded/quota/format.js +138 -0
- package/dist/src/common-auth-embedded/quota/index.d.ts +10 -0
- package/dist/src/common-auth-embedded/quota/index.js +5 -0
- package/dist/src/common-auth-embedded/quota/map.d.ts +63 -0
- package/dist/src/common-auth-embedded/quota/map.js +105 -0
- package/dist/src/common-auth-embedded/quota/merge.d.ts +48 -0
- package/dist/src/common-auth-embedded/quota/merge.js +162 -0
- package/dist/src/common-auth-embedded/quota/projection.d.ts +64 -0
- package/dist/src/common-auth-embedded/quota/projection.js +134 -0
- package/dist/src/common-auth-embedded/routing/admission.d.ts +93 -0
- package/dist/src/common-auth-embedded/routing/admission.js +142 -0
- package/dist/src/common-auth-embedded/routing/index.d.ts +8 -0
- package/dist/src/common-auth-embedded/routing/index.js +4 -0
- package/dist/src/common-auth-embedded/routing/ordered.d.ts +47 -0
- package/dist/src/common-auth-embedded/routing/ordered.js +58 -0
- package/dist/src/common-auth-embedded/routing/pins.d.ts +22 -0
- package/dist/src/common-auth-embedded/routing/pins.js +34 -0
- package/dist/src/common-auth-embedded/routing/sticky.d.ts +158 -0
- package/dist/src/common-auth-embedded/routing/sticky.js +339 -0
- package/dist/src/common-auth-embedded/rpc/client.d.ts +3 -0
- package/dist/src/common-auth-embedded/rpc/client.js +2 -0
- package/dist/src/common-auth-embedded/rpc/index.d.ts +10 -0
- package/dist/src/common-auth-embedded/rpc/index.js +5 -0
- package/dist/src/common-auth-embedded/rpc/notifications.d.ts +73 -0
- package/dist/src/common-auth-embedded/rpc/notifications.js +100 -0
- package/dist/src/common-auth-embedded/rpc/port-file.d.ts +33 -0
- package/dist/src/common-auth-embedded/rpc/port-file.js +217 -0
- package/dist/src/common-auth-embedded/rpc/rpc-client.d.ts +30 -0
- package/dist/src/common-auth-embedded/rpc/rpc-client.js +253 -0
- package/dist/src/common-auth-embedded/rpc/rpc-server.d.ts +58 -0
- package/dist/src/common-auth-embedded/rpc/rpc-server.js +311 -0
- package/dist/src/common-auth-embedded/rpc/server-registry.d.ts +11 -0
- package/dist/src/common-auth-embedded/rpc/server-registry.js +47 -0
- package/dist/src/common-auth-embedded/source-output.json +1326 -0
- package/dist/src/common-auth-embedded/store/attribution.d.ts +28 -0
- package/dist/src/common-auth-embedded/store/attribution.js +60 -0
- package/dist/src/common-auth-embedded/store/errors.d.ts +55 -0
- package/dist/src/common-auth-embedded/store/errors.js +38 -0
- package/dist/src/common-auth-embedded/store/hooks.d.ts +12 -0
- package/dist/src/common-auth-embedded/store/hooks.js +34 -0
- package/dist/src/common-auth-embedded/store/identity.d.ts +39 -0
- package/dist/src/common-auth-embedded/store/identity.js +79 -0
- package/dist/src/common-auth-embedded/store/index.d.ts +21 -0
- package/dist/src/common-auth-embedded/store/index.js +7 -0
- package/dist/src/common-auth-embedded/store/mutate.d.ts +189 -0
- package/dist/src/common-auth-embedded/store/mutate.js +500 -0
- package/dist/src/common-auth-embedded/store/pool.d.ts +196 -0
- package/dist/src/common-auth-embedded/store/pool.js +120 -0
- package/dist/src/common-auth-embedded/store/provider-state.d.ts +131 -0
- package/dist/src/common-auth-embedded/store/provider-state.js +226 -0
- package/dist/src/common-auth-embedded/store/publication.d.ts +47 -0
- package/dist/src/common-auth-embedded/store/publication.js +304 -0
- package/dist/src/common-auth-embedded/store/pull.d.ts +36 -0
- package/dist/src/common-auth-embedded/store/pull.js +143 -0
- package/dist/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
- package/dist/src/common-auth-embedded/store/refresh-lock.js +136 -0
- package/dist/src/common-auth-embedded/store/refresh.d.ts +72 -0
- package/dist/src/common-auth-embedded/store/refresh.js +225 -0
- package/dist/src/common-auth-embedded/store/reserved.js +13 -0
- package/dist/src/common-auth-embedded/store/rows.d.ts +313 -0
- package/dist/src/common-auth-embedded/store/rows.js +1258 -0
- package/dist/src/common-auth-embedded/store/runtime.d.ts +36 -0
- package/dist/src/common-auth-embedded/store/runtime.js +68 -0
- package/dist/src/common-auth-embedded/store/schema.d.ts +443 -0
- package/dist/src/common-auth-embedded/store/schema.js +754 -0
- package/dist/src/common-auth-embedded/store/settings.d.ts +63 -0
- package/dist/src/common-auth-embedded/store/settings.js +120 -0
- package/dist/src/common-auth-embedded/store/torn.d.ts +78 -0
- package/dist/src/common-auth-embedded/store/torn.js +294 -0
- package/dist/src/common-auth-embedded/tui/index.d.ts +8 -0
- package/dist/src/common-auth-embedded/tui/index.js +21 -0
- package/dist/src/common-auth-embedded/util/any-signal.js +42 -0
- package/dist/src/constants.d.ts +1 -0
- package/dist/src/constants.d.ts.map +1 -1
- package/dist/src/constants.js +4 -0
- package/dist/src/constants.js.map +1 -1
- package/dist/src/ga/proxy-guard.d.ts +120 -0
- package/dist/src/ga/proxy-guard.d.ts.map +1 -0
- package/dist/src/ga/proxy-guard.js +269 -0
- package/dist/src/ga/proxy-guard.js.map +1 -0
- package/dist/src/ga/rpc/protocol.d.ts +504 -0
- package/dist/src/ga/rpc/protocol.d.ts.map +1 -0
- package/dist/src/ga/rpc/protocol.js +1278 -0
- package/dist/src/ga/rpc/protocol.js.map +1 -0
- package/dist/src/ga/server/auth.d.ts +9 -0
- package/dist/src/ga/server/auth.d.ts.map +1 -0
- package/dist/src/ga/server/auth.js +37 -0
- package/dist/src/ga/server/auth.js.map +1 -0
- package/dist/src/ga/server/index.d.ts +576 -0
- package/dist/src/ga/server/index.d.ts.map +1 -0
- package/dist/src/ga/server/index.js +1012 -0
- package/dist/src/ga/server/index.js.map +1 -0
- package/dist/src/ga/tui/host-ga.d.ts +350 -0
- package/dist/src/ga/tui/host-ga.d.ts.map +1 -0
- package/dist/src/ga/tui/host-ga.js +1242 -0
- package/dist/src/ga/tui/host-ga.js.map +1 -0
- package/dist/src/logging/provider-key-policy.d.ts +9 -0
- package/dist/src/logging/provider-key-policy.d.ts.map +1 -0
- package/dist/src/logging/provider-key-policy.js +11 -0
- package/dist/src/logging/provider-key-policy.js.map +1 -0
- package/dist/src/plugin/account-access.d.ts +130 -15
- package/dist/src/plugin/account-access.d.ts.map +1 -1
- package/dist/src/plugin/account-access.js +331 -129
- package/dist/src/plugin/account-access.js.map +1 -1
- package/dist/src/plugin/account-blocks.d.ts +102 -0
- package/dist/src/plugin/account-blocks.d.ts.map +1 -0
- package/dist/src/plugin/account-blocks.js +196 -0
- package/dist/src/plugin/account-blocks.js.map +1 -0
- package/dist/src/plugin/accounts.d.ts +85 -1
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +127 -3
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/auth-loader.d.ts +69 -5
- package/dist/src/plugin/auth-loader.d.ts.map +1 -1
- package/dist/src/plugin/auth-loader.js +355 -52
- package/dist/src/plugin/auth-loader.js.map +1 -1
- package/dist/src/plugin/background-quota-refresh.d.ts +54 -8
- package/dist/src/plugin/background-quota-refresh.d.ts.map +1 -1
- package/dist/src/plugin/background-quota-refresh.js +81 -24
- package/dist/src/plugin/background-quota-refresh.js.map +1 -1
- package/dist/src/plugin/cache/index.d.ts +1 -1
- package/dist/src/plugin/cache/index.d.ts.map +1 -1
- package/dist/src/plugin/cache/index.js +1 -1
- package/dist/src/plugin/cache/index.js.map +1 -1
- package/dist/src/plugin/cache/signature-cache.d.ts +55 -10
- package/dist/src/plugin/cache/signature-cache.d.ts.map +1 -1
- package/dist/src/plugin/cache/signature-cache.js +100 -41
- package/dist/src/plugin/cache/signature-cache.js.map +1 -1
- package/dist/src/plugin/cache.d.ts +80 -16
- package/dist/src/plugin/cache.d.ts.map +1 -1
- package/dist/src/plugin/cache.js +339 -200
- package/dist/src/plugin/cache.js.map +1 -1
- package/dist/src/plugin/catalog.d.ts +4 -18
- package/dist/src/plugin/catalog.d.ts.map +1 -1
- package/dist/src/plugin/catalog.js +11 -41
- package/dist/src/plugin/catalog.js.map +1 -1
- package/dist/src/plugin/command-apply.d.ts +58 -0
- package/dist/src/plugin/command-apply.d.ts.map +1 -0
- package/dist/src/plugin/command-apply.js +168 -0
- package/dist/src/plugin/command-apply.js.map +1 -0
- package/dist/src/plugin/command-data.d.ts +1 -0
- package/dist/src/plugin/command-data.d.ts.map +1 -1
- package/dist/src/plugin/command-data.js +2 -0
- package/dist/src/plugin/command-data.js.map +1 -1
- package/dist/src/plugin/commands.d.ts +142 -132
- package/dist/src/plugin/commands.d.ts.map +1 -1
- package/dist/src/plugin/commands.js +214 -686
- package/dist/src/plugin/commands.js.map +1 -1
- package/dist/src/plugin/config/index.d.ts +1 -1
- package/dist/src/plugin/config/index.d.ts.map +1 -1
- package/dist/src/plugin/config/index.js +1 -1
- package/dist/src/plugin/config/index.js.map +1 -1
- package/dist/src/plugin/config/loader.d.ts +37 -1
- package/dist/src/plugin/config/loader.d.ts.map +1 -1
- package/dist/src/plugin/config/loader.js +64 -9
- package/dist/src/plugin/config/loader.js.map +1 -1
- package/dist/src/plugin/config/operator-settings-schema.d.ts +2 -2
- package/dist/src/plugin/config/schema.d.ts +2 -2
- package/dist/src/plugin/config/writer.d.ts +7 -0
- package/dist/src/plugin/config/writer.d.ts.map +1 -1
- package/dist/src/plugin/config/writer.js +10 -1
- package/dist/src/plugin/config/writer.js.map +1 -1
- package/dist/src/plugin/debug.d.ts +72 -29
- package/dist/src/plugin/debug.d.ts.map +1 -1
- package/dist/src/plugin/debug.js +353 -239
- package/dist/src/plugin/debug.js.map +1 -1
- package/dist/src/plugin/fetch/retry-state.d.ts +1 -1
- package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -1
- package/dist/src/plugin/fetch/retry-state.js.map +1 -1
- package/dist/src/plugin/fetch-interceptor.d.ts +66 -11
- package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -1
- package/dist/src/plugin/fetch-interceptor.js +228 -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 +190 -60
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/session-context.d.ts.map +1 -1
- package/dist/src/plugin/session-context.js +5 -2
- package/dist/src/plugin/session-context.js.map +1 -1
- package/dist/src/plugin/shared/local-grant.d.ts +26 -0
- package/dist/src/plugin/shared/local-grant.d.ts.map +1 -0
- package/dist/src/plugin/shared/local-grant.js +19 -0
- package/dist/src/plugin/shared/local-grant.js.map +1 -0
- package/dist/src/plugin/shared/request-cancellation.d.ts +12 -0
- package/dist/src/plugin/shared/request-cancellation.d.ts.map +1 -0
- package/dist/src/plugin/shared/request-cancellation.js +118 -0
- package/dist/src/plugin/shared/request-cancellation.js.map +1 -0
- package/dist/src/plugin/shared/request-services.d.ts +375 -0
- package/dist/src/plugin/shared/request-services.d.ts.map +1 -0
- package/dist/src/plugin/shared/request-services.js +1743 -0
- package/dist/src/plugin/shared/request-services.js.map +1 -0
- package/dist/src/plugin/shared/runtime.d.ts +217 -0
- package/dist/src/plugin/shared/runtime.d.ts.map +1 -0
- package/dist/src/plugin/shared/runtime.js +345 -0
- package/dist/src/plugin/shared/runtime.js.map +1 -0
- package/dist/src/plugin/shared/source-sidebar.d.ts +15 -0
- package/dist/src/plugin/shared/source-sidebar.d.ts.map +1 -0
- package/dist/src/plugin/shared/source-sidebar.js +41 -0
- package/dist/src/plugin/shared/source-sidebar.js.map +1 -0
- package/dist/src/plugin/shared/vault-menu.d.ts +5 -0
- package/dist/src/plugin/shared/vault-menu.d.ts.map +1 -0
- package/dist/src/plugin/shared/vault-menu.js +49 -0
- package/dist/src/plugin/shared/vault-menu.js.map +1 -0
- package/dist/src/plugin/shared/vault-request-credentials.d.ts +168 -0
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -0
- package/dist/src/plugin/shared/vault-request-credentials.js +485 -0
- package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -0
- package/dist/src/plugin/storage.d.ts +127 -1
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js +188 -3
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/token.d.ts +23 -1
- package/dist/src/plugin/token.d.ts.map +1 -1
- package/dist/src/plugin/token.js +117 -58
- package/dist/src/plugin/token.js.map +1 -1
- package/dist/src/plugin/ui/quota-status.d.ts +1 -10
- package/dist/src/plugin/ui/quota-status.d.ts.map +1 -1
- package/dist/src/plugin/ui/quota-status.js +6 -42
- package/dist/src/plugin/ui/quota-status.js.map +1 -1
- package/dist/src/plugin/vault-activation.d.ts +11 -0
- package/dist/src/plugin/vault-activation.d.ts.map +1 -0
- package/dist/src/plugin/vault-activation.js +53 -0
- package/dist/src/plugin/vault-activation.js.map +1 -0
- package/dist/src/plugin/vault-custody.d.ts +131 -0
- package/dist/src/plugin/vault-custody.d.ts.map +1 -0
- package/dist/src/plugin/vault-custody.js +381 -0
- package/dist/src/plugin/vault-custody.js.map +1 -0
- package/dist/src/quota-presentation.d.ts +18 -0
- package/dist/src/quota-presentation.d.ts.map +1 -0
- package/dist/src/quota-presentation.js +58 -0
- package/dist/src/quota-presentation.js.map +1 -0
- package/dist/src/rpc/notifications.d.ts +2 -2
- package/dist/src/rpc/notifications.d.ts.map +1 -1
- package/dist/src/rpc/notifications.js +1 -1
- package/dist/src/rpc/notifications.js.map +1 -1
- package/dist/src/rpc/port-file.d.ts +2 -12
- package/dist/src/rpc/port-file.d.ts.map +1 -1
- package/dist/src/rpc/port-file.js +5 -107
- package/dist/src/rpc/port-file.js.map +1 -1
- package/dist/src/rpc/protocol.d.ts +47 -16
- package/dist/src/rpc/protocol.d.ts.map +1 -1
- package/dist/src/rpc/rpc-client.d.ts +27 -3
- package/dist/src/rpc/rpc-client.d.ts.map +1 -1
- package/dist/src/rpc/rpc-client.js +55 -45
- package/dist/src/rpc/rpc-client.js.map +1 -1
- package/dist/src/rpc/rpc-server.d.ts +13 -2
- package/dist/src/rpc/rpc-server.d.ts.map +1 -1
- package/dist/src/rpc/rpc-server.js +38 -212
- package/dist/src/rpc/rpc-server.js.map +1 -1
- package/dist/src/server.d.ts +30 -0
- package/dist/src/server.d.ts.map +1 -0
- package/dist/src/server.js +29 -0
- package/dist/src/server.js.map +1 -0
- package/dist/src/sidebar-projection.d.ts +102 -0
- package/dist/src/sidebar-projection.d.ts.map +1 -0
- package/dist/src/sidebar-projection.js +146 -0
- package/dist/src/sidebar-projection.js.map +1 -0
- package/dist/src/sidebar-state.d.ts +13 -5
- package/dist/src/sidebar-state.d.ts.map +1 -1
- package/dist/src/sidebar-state.js +49 -16
- package/dist/src/sidebar-state.js.map +1 -1
- package/dist/src/tui/command-dialogs.d.ts +58 -52
- package/dist/src/tui/command-dialogs.d.ts.map +1 -1
- package/dist/src/tui/command-dialogs.js +379 -571
- package/dist/src/tui/command-dialogs.js.map +1 -1
- package/dist/src/tui/file-logger.d.ts +2 -3
- package/dist/src/tui/file-logger.d.ts.map +1 -1
- package/dist/src/tui/file-logger.js +21 -7
- package/dist/src/tui/file-logger.js.map +1 -1
- package/dist/src/tui/host-api.d.ts +196 -0
- package/dist/src/tui/host-api.d.ts.map +1 -0
- package/dist/src/tui/host-api.js +357 -0
- package/dist/src/tui/host-api.js.map +1 -0
- package/dist/src/tui/host-v1.d.ts +60 -0
- package/dist/src/tui/host-v1.d.ts.map +1 -0
- package/dist/src/tui/host-v1.js +147 -0
- package/dist/src/tui/host-v1.js.map +1 -0
- package/dist/src/tui/vault-setup.d.ts +98 -0
- package/dist/src/tui/vault-setup.d.ts.map +1 -0
- package/dist/src/tui/vault-setup.js +198 -0
- package/dist/src/tui/vault-setup.js.map +1 -0
- package/dist/src/tui.d.ts +4 -11
- package/dist/src/tui.d.ts.map +1 -1
- package/dist/src/tui.js +33 -75
- package/dist/src/tui.js.map +1 -1
- package/dist/tui-build-map.json +380 -0
- package/dist/tui-ga-build-map.json +187 -0
- package/dist/types/src/antigravity/oauth.d.ts +2 -0
- package/dist/types/src/antigravity/oauth.d.ts.map +1 -0
- package/dist/types/src/cli.d.ts +66 -0
- package/dist/types/src/cli.d.ts.map +1 -0
- package/dist/types/src/common-auth-embedded/commands/builtins.d.ts +71 -0
- package/dist/types/src/common-auth-embedded/commands/index.d.ts +10 -0
- package/dist/types/src/common-auth-embedded/commands/menu.d.ts +61 -0
- package/dist/types/src/common-auth-embedded/commands/model.d.ts +238 -0
- package/dist/types/src/common-auth-embedded/commands/pi.d.ts +23 -0
- package/dist/types/src/common-auth-embedded/commands/seam.d.ts +72 -0
- package/dist/types/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
- package/dist/types/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
- package/dist/types/src/common-auth-embedded/logger/engine.d.ts +100 -0
- package/dist/types/src/common-auth-embedded/logger/index.d.ts +6 -0
- package/dist/types/src/common-auth-embedded/logger/redact.d.ts +11 -0
- package/dist/types/src/common-auth-embedded/quota/codec.d.ts +11 -0
- package/dist/types/src/common-auth-embedded/quota/format.d.ts +46 -0
- package/dist/types/src/common-auth-embedded/quota/index.d.ts +10 -0
- package/dist/types/src/common-auth-embedded/quota/map.d.ts +63 -0
- package/dist/types/src/common-auth-embedded/quota/merge.d.ts +48 -0
- package/dist/types/src/common-auth-embedded/quota/projection.d.ts +64 -0
- package/dist/types/src/common-auth-embedded/store/attribution.d.ts +28 -0
- package/dist/types/src/common-auth-embedded/store/errors.d.ts +55 -0
- package/dist/types/src/common-auth-embedded/store/hooks.d.ts +12 -0
- package/dist/types/src/common-auth-embedded/store/identity.d.ts +39 -0
- package/dist/types/src/common-auth-embedded/store/index.d.ts +21 -0
- package/dist/types/src/common-auth-embedded/store/mutate.d.ts +189 -0
- package/dist/types/src/common-auth-embedded/store/pool.d.ts +196 -0
- package/dist/types/src/common-auth-embedded/store/provider-state.d.ts +131 -0
- package/dist/types/src/common-auth-embedded/store/publication.d.ts +47 -0
- package/dist/types/src/common-auth-embedded/store/pull.d.ts +36 -0
- package/dist/types/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
- package/dist/types/src/common-auth-embedded/store/refresh.d.ts +72 -0
- package/dist/types/src/common-auth-embedded/store/rows.d.ts +313 -0
- package/dist/types/src/common-auth-embedded/store/runtime.d.ts +36 -0
- package/dist/types/src/common-auth-embedded/store/schema.d.ts +443 -0
- package/dist/types/src/common-auth-embedded/store/settings.d.ts +63 -0
- package/dist/types/src/common-auth-embedded/store/torn.d.ts +78 -0
- package/dist/types/src/constants.d.ts +3 -0
- package/dist/types/src/constants.d.ts.map +1 -0
- package/dist/types/src/ga/proxy-guard.d.ts +120 -0
- package/dist/types/src/ga/proxy-guard.d.ts.map +1 -0
- package/dist/types/src/ga/rpc/protocol.d.ts +504 -0
- package/dist/types/src/ga/rpc/protocol.d.ts.map +1 -0
- package/dist/types/src/ga/server/auth.d.ts +9 -0
- package/dist/types/src/ga/server/auth.d.ts.map +1 -0
- package/dist/types/src/ga/server/index.d.ts +576 -0
- package/dist/types/src/ga/server/index.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/cache.d.ts +3 -0
- package/dist/types/src/hooks/auto-update-checker/cache.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/checker.d.ts +16 -0
- package/dist/types/src/hooks/auto-update-checker/checker.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/constants.d.ts +9 -0
- package/dist/types/src/hooks/auto-update-checker/constants.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/index.d.ts +34 -0
- package/dist/types/src/hooks/auto-update-checker/index.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/logging.d.ts +3 -0
- package/dist/types/src/hooks/auto-update-checker/logging.d.ts.map +1 -0
- package/dist/types/src/hooks/auto-update-checker/types.d.ts +25 -0
- package/dist/types/src/hooks/auto-update-checker/types.d.ts.map +1 -0
- package/dist/types/src/logging/provider-key-policy.d.ts +9 -0
- package/dist/types/src/logging/provider-key-policy.d.ts.map +1 -0
- package/dist/types/src/plugin/account-access.d.ts +214 -0
- package/dist/types/src/plugin/account-access.d.ts.map +1 -0
- package/dist/types/src/plugin/account-blocks.d.ts +102 -0
- package/dist/types/src/plugin/account-blocks.d.ts.map +1 -0
- package/dist/types/src/plugin/account-command-oauth.d.ts +34 -0
- package/dist/types/src/plugin/account-command-oauth.d.ts.map +1 -0
- package/dist/types/src/plugin/accounts.d.ts +94 -0
- package/dist/types/src/plugin/accounts.d.ts.map +1 -0
- package/dist/types/src/plugin/agy-request-metadata.d.ts +2 -0
- package/dist/types/src/plugin/agy-request-metadata.d.ts.map +1 -0
- package/dist/types/src/plugin/agy-transport.d.ts +2 -0
- package/dist/types/src/plugin/agy-transport.d.ts.map +1 -0
- package/dist/types/src/plugin/auth-doctor.d.ts +30 -0
- package/dist/types/src/plugin/auth-doctor.d.ts.map +1 -0
- package/dist/types/src/plugin/auth-drift.d.ts +13 -0
- package/dist/types/src/plugin/auth-drift.d.ts.map +1 -0
- package/dist/types/src/plugin/auth-loader.d.ts +114 -0
- package/dist/types/src/plugin/auth-loader.d.ts.map +1 -0
- package/dist/types/src/plugin/auth.d.ts +2 -0
- package/dist/types/src/plugin/auth.d.ts.map +1 -0
- package/dist/types/src/plugin/background-quota-refresh.d.ts +192 -0
- package/dist/types/src/plugin/background-quota-refresh.d.ts.map +1 -0
- package/dist/types/src/plugin/cache/signature-cache.d.ts +156 -0
- package/dist/types/src/plugin/cache/signature-cache.d.ts.map +1 -0
- package/dist/types/src/plugin/cache.d.ts +109 -0
- package/dist/types/src/plugin/cache.d.ts.map +1 -0
- package/dist/types/src/plugin/catalog.d.ts +9 -0
- package/dist/types/src/plugin/catalog.d.ts.map +1 -0
- package/dist/types/src/plugin/cli.d.ts +44 -0
- package/dist/types/src/plugin/cli.d.ts.map +1 -0
- package/dist/types/src/plugin/command-apply.d.ts +58 -0
- package/dist/types/src/plugin/command-apply.d.ts.map +1 -0
- package/dist/types/src/plugin/command-data.d.ts +330 -0
- package/dist/types/src/plugin/command-data.d.ts.map +1 -0
- package/dist/types/src/plugin/commands.d.ts +164 -0
- package/dist/types/src/plugin/commands.d.ts.map +1 -0
- package/dist/types/src/plugin/config/index.d.ts +16 -0
- package/dist/types/src/plugin/config/index.d.ts.map +1 -0
- package/dist/types/src/plugin/config/loader.d.ts +72 -0
- package/dist/types/src/plugin/config/loader.d.ts.map +1 -0
- package/dist/types/src/plugin/config/models.d.ts +3 -0
- package/dist/types/src/plugin/config/models.d.ts.map +1 -0
- package/dist/types/src/plugin/config/operator-settings-schema.d.ts +29 -0
- package/dist/types/src/plugin/config/operator-settings-schema.d.ts.map +1 -0
- package/dist/types/src/plugin/config/schema.d.ts +162 -0
- package/dist/types/src/plugin/config/schema.d.ts.map +1 -0
- package/dist/types/src/plugin/config/updater.d.ts +55 -0
- package/dist/types/src/plugin/config/updater.d.ts.map +1 -0
- package/dist/types/src/plugin/config/writer.d.ts +41 -0
- package/dist/types/src/plugin/config/writer.d.ts.map +1 -0
- package/dist/types/src/plugin/core/streaming/index.d.ts +3 -0
- package/dist/types/src/plugin/core/streaming/index.d.ts.map +1 -0
- package/dist/types/src/plugin/core/streaming/transformer.d.ts +12 -0
- package/dist/types/src/plugin/core/streaming/transformer.d.ts.map +1 -0
- package/dist/types/src/plugin/core/streaming/types.d.ts +34 -0
- package/dist/types/src/plugin/core/streaming/types.d.ts.map +1 -0
- package/dist/types/src/plugin/debug.d.ts +144 -0
- package/dist/types/src/plugin/debug.d.ts.map +1 -0
- package/dist/types/src/plugin/dependencies.d.ts +129 -0
- package/dist/types/src/plugin/dependencies.d.ts.map +1 -0
- package/dist/types/src/plugin/errors.d.ts +55 -0
- package/dist/types/src/plugin/errors.d.ts.map +1 -0
- package/dist/types/src/plugin/event-handler.d.ts +53 -0
- package/dist/types/src/plugin/event-handler.d.ts.map +1 -0
- package/dist/types/src/plugin/fetch/retry-state.d.ts +61 -0
- package/dist/types/src/plugin/fetch/retry-state.d.ts.map +1 -0
- package/dist/types/src/plugin/fetch/warmup.d.ts +30 -0
- package/dist/types/src/plugin/fetch/warmup.d.ts.map +1 -0
- package/dist/types/src/plugin/fetch-interceptor.d.ts +114 -0
- package/dist/types/src/plugin/fetch-interceptor.d.ts.map +1 -0
- package/dist/types/src/plugin/fetch-routing.d.ts +31 -0
- package/dist/types/src/plugin/fetch-routing.d.ts.map +1 -0
- package/dist/types/src/plugin/fingerprint.d.ts +2 -0
- package/dist/types/src/plugin/fingerprint.d.ts.map +1 -0
- package/dist/types/src/plugin/ga-location-services.d.ts +389 -0
- package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -0
- package/dist/types/src/plugin/gemini-dump.d.ts +72 -0
- package/dist/types/src/plugin/gemini-dump.d.ts.map +1 -0
- package/dist/types/src/plugin/google-search-tool.d.ts +10 -0
- package/dist/types/src/plugin/google-search-tool.d.ts.map +1 -0
- package/dist/types/src/plugin/image-saver.d.ts +6 -0
- package/dist/types/src/plugin/image-saver.d.ts.map +1 -0
- package/dist/types/src/plugin/index.d.ts +30 -0
- package/dist/types/src/plugin/index.d.ts.map +1 -0
- package/dist/types/src/plugin/killswitch.d.ts +93 -0
- package/dist/types/src/plugin/killswitch.d.ts.map +1 -0
- package/dist/types/src/plugin/lifecycle.d.ts +63 -0
- package/dist/types/src/plugin/lifecycle.d.ts.map +1 -0
- package/dist/types/src/plugin/logger.d.ts +83 -0
- package/dist/types/src/plugin/logger.d.ts.map +1 -0
- package/dist/types/src/plugin/logging-utils.d.ts +57 -0
- package/dist/types/src/plugin/logging-utils.d.ts.map +1 -0
- package/dist/types/src/plugin/model-registry.d.ts +2 -0
- package/dist/types/src/plugin/model-registry.d.ts.map +1 -0
- package/dist/types/src/plugin/neutral-types.d.ts +42 -0
- package/dist/types/src/plugin/neutral-types.d.ts.map +1 -0
- package/dist/types/src/plugin/oauth-login.d.ts +22 -0
- package/dist/types/src/plugin/oauth-login.d.ts.map +1 -0
- package/dist/types/src/plugin/oauth-methods.d.ts +43 -0
- package/dist/types/src/plugin/oauth-methods.d.ts.map +1 -0
- package/dist/types/src/plugin/operator-settings.d.ts +74 -0
- package/dist/types/src/plugin/operator-settings.d.ts.map +1 -0
- package/dist/types/src/plugin/persist-account-pool.d.ts +98 -0
- package/dist/types/src/plugin/persist-account-pool.d.ts.map +1 -0
- package/dist/types/src/plugin/project.d.ts +2 -0
- package/dist/types/src/plugin/project.d.ts.map +1 -0
- package/dist/types/src/plugin/prompt-context.d.ts +18 -0
- package/dist/types/src/plugin/prompt-context.d.ts.map +1 -0
- package/dist/types/src/plugin/quota.d.ts +441 -0
- package/dist/types/src/plugin/quota.d.ts.map +1 -0
- package/dist/types/src/plugin/recovery/constants.d.ts +22 -0
- package/dist/types/src/plugin/recovery/constants.d.ts.map +1 -0
- package/dist/types/src/plugin/recovery/storage.d.ts +24 -0
- package/dist/types/src/plugin/recovery/storage.d.ts.map +1 -0
- package/dist/types/src/plugin/recovery/types.d.ts +116 -0
- package/dist/types/src/plugin/recovery/types.d.ts.map +1 -0
- package/dist/types/src/plugin/recovery.d.ts +61 -0
- package/dist/types/src/plugin/recovery.d.ts.map +1 -0
- package/dist/types/src/plugin/refresh-queue.d.ts +133 -0
- package/dist/types/src/plugin/refresh-queue.d.ts.map +1 -0
- package/dist/types/src/plugin/request-helpers.d.ts +304 -0
- package/dist/types/src/plugin/request-helpers.d.ts.map +1 -0
- package/dist/types/src/plugin/request.d.ts +161 -0
- package/dist/types/src/plugin/request.d.ts.map +1 -0
- package/dist/types/src/plugin/rotation.d.ts +2 -0
- package/dist/types/src/plugin/rotation.d.ts.map +1 -0
- package/dist/types/src/plugin/search.d.ts +25 -0
- package/dist/types/src/plugin/search.d.ts.map +1 -0
- package/dist/types/src/plugin/server.d.ts +23 -0
- package/dist/types/src/plugin/server.d.ts.map +1 -0
- package/dist/types/src/plugin/session-context.d.ts +22 -0
- package/dist/types/src/plugin/session-context.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/local-grant.d.ts +26 -0
- package/dist/types/src/plugin/shared/local-grant.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/request-cancellation.d.ts +12 -0
- package/dist/types/src/plugin/shared/request-cancellation.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/request-services.d.ts +375 -0
- package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/runtime.d.ts +217 -0
- package/dist/types/src/plugin/shared/runtime.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/source-sidebar.d.ts +15 -0
- package/dist/types/src/plugin/shared/source-sidebar.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/vault-menu.d.ts +5 -0
- package/dist/types/src/plugin/shared/vault-menu.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +168 -0
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -0
- package/dist/types/src/plugin/storage.d.ts +221 -0
- package/dist/types/src/plugin/storage.d.ts.map +1 -0
- package/dist/types/src/plugin/stores/signature-store.d.ts +5 -0
- package/dist/types/src/plugin/stores/signature-store.d.ts.map +1 -0
- package/dist/types/src/plugin/thinking-recovery.d.ts +90 -0
- package/dist/types/src/plugin/thinking-recovery.d.ts.map +1 -0
- package/dist/types/src/plugin/token.d.ts +41 -0
- package/dist/types/src/plugin/token.d.ts.map +1 -0
- package/dist/types/src/plugin/transform/cross-model-sanitizer.d.ts +2 -0
- package/dist/types/src/plugin/transform/cross-model-sanitizer.d.ts.map +1 -0
- package/dist/types/src/plugin/transform/index.d.ts +2 -0
- package/dist/types/src/plugin/transform/index.d.ts.map +1 -0
- package/dist/types/src/plugin/transform/model-resolver.d.ts +2 -0
- package/dist/types/src/plugin/transform/model-resolver.d.ts.map +1 -0
- package/dist/types/src/plugin/transform/types.d.ts +2 -0
- package/dist/types/src/plugin/transform/types.d.ts.map +1 -0
- package/dist/types/src/plugin/types.d.ts +36 -0
- package/dist/types/src/plugin/types.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/ansi.d.ts +32 -0
- package/dist/types/src/plugin/ui/ansi.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/auth-menu.d.ts +59 -0
- package/dist/types/src/plugin/ui/auth-menu.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/confirm.d.ts +2 -0
- package/dist/types/src/plugin/ui/confirm.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/quota-status.d.ts +73 -0
- package/dist/types/src/plugin/ui/quota-status.d.ts.map +1 -0
- package/dist/types/src/plugin/ui/select.d.ts +23 -0
- package/dist/types/src/plugin/ui/select.d.ts.map +1 -0
- package/dist/types/src/plugin/vault-activation.d.ts +11 -0
- package/dist/types/src/plugin/vault-activation.d.ts.map +1 -0
- package/dist/types/src/plugin/vault-custody.d.ts +131 -0
- package/dist/types/src/plugin/vault-custody.d.ts.map +1 -0
- package/dist/types/src/plugin/version.d.ts +2 -0
- package/dist/types/src/plugin/version.d.ts.map +1 -0
- package/dist/types/src/quota-presentation.d.ts +18 -0
- package/dist/types/src/quota-presentation.d.ts.map +1 -0
- package/dist/types/src/rpc/notifications.d.ts +6 -0
- package/dist/types/src/rpc/notifications.d.ts.map +1 -0
- package/dist/types/src/rpc/protocol.d.ts +53 -0
- package/dist/types/src/rpc/protocol.d.ts.map +1 -0
- package/dist/types/src/rpc/rpc-dir.d.ts +4 -0
- package/dist/types/src/rpc/rpc-dir.d.ts.map +1 -0
- package/dist/types/src/rpc/rpc-server.d.ts +24 -0
- package/dist/types/src/rpc/rpc-server.d.ts.map +1 -0
- package/dist/types/src/server.d.ts +30 -0
- package/dist/types/src/server.d.ts.map +1 -0
- package/dist/types/src/sidebar-state.d.ts +365 -0
- package/dist/types/src/sidebar-state.d.ts.map +1 -0
- package/dist/types/src/tui/host-api.d.ts +196 -0
- package/dist/types/src/tui/host-api.d.ts.map +1 -0
- package/package.json +45 -18
- package/server.js +6 -0
- package/src/common-auth-embedded/NOTICE.txt +21 -0
- package/src/common-auth-embedded/auth-menu/accounts.d.ts +97 -0
- package/src/common-auth-embedded/auth-menu/accounts.js +387 -0
- package/src/common-auth-embedded/auth-menu/ansi.d.ts +26 -0
- package/src/common-auth-embedded/auth-menu/ansi.js +98 -0
- package/src/common-auth-embedded/auth-menu/confirm.d.ts +7 -0
- package/src/common-auth-embedded/auth-menu/confirm.js +21 -0
- package/src/common-auth-embedded/auth-menu/doctor.d.ts +52 -0
- package/src/common-auth-embedded/auth-menu/doctor.js +81 -0
- package/src/common-auth-embedded/auth-menu/index.d.ts +17 -0
- package/src/common-auth-embedded/auth-menu/index.js +12 -0
- package/src/common-auth-embedded/auth-menu/login.d.ts +55 -0
- package/src/common-auth-embedded/auth-menu/login.js +83 -0
- package/src/common-auth-embedded/auth-menu/menu.d.ts +59 -0
- package/src/common-auth-embedded/auth-menu/menu.js +73 -0
- package/src/common-auth-embedded/auth-menu/opencode-v1.d.ts +49 -0
- package/src/common-auth-embedded/auth-menu/opencode-v1.js +47 -0
- package/src/common-auth-embedded/auth-menu/select.d.ts +21 -0
- package/src/common-auth-embedded/auth-menu/select.js +159 -0
- package/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
- package/src/common-auth-embedded/auth-menu/terminal.js +19 -0
- package/src/common-auth-embedded/claustrum/consumer.d.ts +102 -0
- package/src/common-auth-embedded/claustrum/consumer.js +298 -0
- package/src/common-auth-embedded/claustrum/custody.d.ts +175 -0
- package/src/common-auth-embedded/claustrum/custody.js +354 -0
- package/src/common-auth-embedded/claustrum/enrollment.d.ts +158 -0
- package/src/common-auth-embedded/claustrum/enrollment.js +759 -0
- package/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
- package/src/common-auth-embedded/claustrum/errors.js +8 -0
- package/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
- package/src/common-auth-embedded/claustrum/host-slot.js +72 -0
- package/src/common-auth-embedded/claustrum/index.d.ts +18 -0
- package/src/common-auth-embedded/claustrum/index.js +22 -0
- package/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
- package/src/common-auth-embedded/claustrum/interlock.js +29 -0
- package/src/common-auth-embedded/claustrum/roster.d.ts +208 -0
- package/src/common-auth-embedded/claustrum/roster.js +536 -0
- package/src/common-auth-embedded/commands/builtins.d.ts +71 -0
- package/src/common-auth-embedded/commands/builtins.js +534 -0
- package/src/common-auth-embedded/commands/index.d.ts +10 -0
- package/src/common-auth-embedded/commands/index.js +5 -0
- package/src/common-auth-embedded/commands/menu.d.ts +61 -0
- package/src/common-auth-embedded/commands/menu.js +300 -0
- package/src/common-auth-embedded/commands/model.d.ts +238 -0
- package/src/common-auth-embedded/commands/model.js +16 -0
- package/src/common-auth-embedded/commands/pi.d.ts +23 -0
- package/src/common-auth-embedded/commands/pi.js +206 -0
- package/src/common-auth-embedded/commands/seam.d.ts +72 -0
- package/src/common-auth-embedded/commands/seam.js +301 -0
- package/src/common-auth-embedded/fs/atomic-write.d.ts +20 -0
- package/src/common-auth-embedded/fs/atomic-write.js +80 -0
- package/src/common-auth-embedded/fs/index.d.ts +7 -0
- package/src/common-auth-embedded/fs/index.js +6 -0
- package/src/common-auth-embedded/fs/lock-constants.d.ts +14 -0
- package/src/common-auth-embedded/fs/lock-constants.js +14 -0
- package/src/common-auth-embedded/fs/refresh-file-lock.d.ts +33 -0
- package/src/common-auth-embedded/fs/refresh-file-lock.js +501 -0
- package/src/common-auth-embedded/fs/with-lock.d.ts +33 -0
- package/src/common-auth-embedded/fs/with-lock.js +48 -0
- package/src/common-auth-embedded/logger/capture-sink.d.ts +14 -0
- package/src/common-auth-embedded/logger/capture-sink.js +13 -0
- package/src/common-auth-embedded/logger/engine.d.ts +100 -0
- package/src/common-auth-embedded/logger/engine.js +246 -0
- package/src/common-auth-embedded/logger/index.d.ts +6 -0
- package/src/common-auth-embedded/logger/index.js +3 -0
- package/src/common-auth-embedded/logger/redact.d.ts +11 -0
- package/src/common-auth-embedded/logger/redact.js +83 -0
- package/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
- package/src/common-auth-embedded/opencode2/errors.js +15 -0
- package/src/common-auth-embedded/opencode2/index.d.ts +8 -0
- package/src/common-auth-embedded/opencode2/index.js +4 -0
- package/src/common-auth-embedded/opencode2/install.d.ts +55 -0
- package/src/common-auth-embedded/opencode2/install.js +886 -0
- package/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
- package/src/common-auth-embedded/opencode2/integration.js +143 -0
- package/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
- package/src/common-auth-embedded/opencode2/sse.js +60 -0
- package/src/common-auth-embedded/opencode2/types.d.ts +413 -0
- package/src/common-auth-embedded/pi-slot/index.d.ts +3 -0
- package/src/common-auth-embedded/pi-slot/index.js +2 -0
- package/src/common-auth-embedded/pi-slot/lock.js +212 -0
- package/src/common-auth-embedded/pi-slot/slot.d.ts +49 -0
- package/src/common-auth-embedded/pi-slot/slot.js +383 -0
- package/src/common-auth-embedded/quota/codec.d.ts +11 -0
- package/src/common-auth-embedded/quota/codec.js +12 -0
- package/src/common-auth-embedded/quota/format.d.ts +46 -0
- package/src/common-auth-embedded/quota/format.js +138 -0
- package/src/common-auth-embedded/quota/index.d.ts +10 -0
- package/src/common-auth-embedded/quota/index.js +5 -0
- package/src/common-auth-embedded/quota/map.d.ts +63 -0
- package/src/common-auth-embedded/quota/map.js +105 -0
- package/src/common-auth-embedded/quota/merge.d.ts +48 -0
- package/src/common-auth-embedded/quota/merge.js +162 -0
- package/src/common-auth-embedded/quota/projection.d.ts +64 -0
- package/src/common-auth-embedded/quota/projection.js +134 -0
- package/src/common-auth-embedded/routing/admission.d.ts +93 -0
- package/src/common-auth-embedded/routing/admission.js +142 -0
- package/src/common-auth-embedded/routing/index.d.ts +8 -0
- package/src/common-auth-embedded/routing/index.js +4 -0
- package/src/common-auth-embedded/routing/ordered.d.ts +47 -0
- package/src/common-auth-embedded/routing/ordered.js +58 -0
- package/src/common-auth-embedded/routing/pins.d.ts +22 -0
- package/src/common-auth-embedded/routing/pins.js +34 -0
- package/src/common-auth-embedded/routing/sticky.d.ts +158 -0
- package/src/common-auth-embedded/routing/sticky.js +339 -0
- package/src/common-auth-embedded/rpc/client.d.ts +3 -0
- package/src/common-auth-embedded/rpc/client.js +2 -0
- package/src/common-auth-embedded/rpc/index.d.ts +10 -0
- package/src/common-auth-embedded/rpc/index.js +5 -0
- package/src/common-auth-embedded/rpc/notifications.d.ts +73 -0
- package/src/common-auth-embedded/rpc/notifications.js +100 -0
- package/src/common-auth-embedded/rpc/port-file.d.ts +33 -0
- package/src/common-auth-embedded/rpc/port-file.js +217 -0
- package/src/common-auth-embedded/rpc/rpc-client.d.ts +30 -0
- package/src/common-auth-embedded/rpc/rpc-client.js +253 -0
- package/src/common-auth-embedded/rpc/rpc-server.d.ts +58 -0
- package/src/common-auth-embedded/rpc/rpc-server.js +311 -0
- package/src/common-auth-embedded/rpc/server-registry.d.ts +11 -0
- package/src/common-auth-embedded/rpc/server-registry.js +47 -0
- package/src/common-auth-embedded/source-output.json +1326 -0
- package/src/common-auth-embedded/store/attribution.d.ts +28 -0
- package/src/common-auth-embedded/store/attribution.js +60 -0
- package/src/common-auth-embedded/store/errors.d.ts +55 -0
- package/src/common-auth-embedded/store/errors.js +38 -0
- package/src/common-auth-embedded/store/hooks.d.ts +12 -0
- package/src/common-auth-embedded/store/hooks.js +34 -0
- package/src/common-auth-embedded/store/identity.d.ts +39 -0
- package/src/common-auth-embedded/store/identity.js +79 -0
- package/src/common-auth-embedded/store/index.d.ts +21 -0
- package/src/common-auth-embedded/store/index.js +7 -0
- package/src/common-auth-embedded/store/mutate.d.ts +189 -0
- package/src/common-auth-embedded/store/mutate.js +500 -0
- package/src/common-auth-embedded/store/pool.d.ts +196 -0
- package/src/common-auth-embedded/store/pool.js +120 -0
- package/src/common-auth-embedded/store/provider-state.d.ts +131 -0
- package/src/common-auth-embedded/store/provider-state.js +226 -0
- package/src/common-auth-embedded/store/publication.d.ts +47 -0
- package/src/common-auth-embedded/store/publication.js +304 -0
- package/src/common-auth-embedded/store/pull.d.ts +36 -0
- package/src/common-auth-embedded/store/pull.js +143 -0
- package/src/common-auth-embedded/store/refresh-lock.d.ts +63 -0
- package/src/common-auth-embedded/store/refresh-lock.js +136 -0
- package/src/common-auth-embedded/store/refresh.d.ts +72 -0
- package/src/common-auth-embedded/store/refresh.js +225 -0
- package/src/common-auth-embedded/store/reserved.js +13 -0
- package/src/common-auth-embedded/store/rows.d.ts +313 -0
- package/src/common-auth-embedded/store/rows.js +1258 -0
- package/src/common-auth-embedded/store/runtime.d.ts +36 -0
- package/src/common-auth-embedded/store/runtime.js +68 -0
- package/src/common-auth-embedded/store/schema.d.ts +443 -0
- package/src/common-auth-embedded/store/schema.js +754 -0
- package/src/common-auth-embedded/store/settings.d.ts +63 -0
- package/src/common-auth-embedded/store/settings.js +120 -0
- package/src/common-auth-embedded/store/torn.d.ts +78 -0
- package/src/common-auth-embedded/store/torn.js +294 -0
- package/src/common-auth-embedded/tui/index.d.ts +8 -0
- package/src/common-auth-embedded/tui/index.js +21 -0
- package/src/common-auth-embedded/util/any-signal.js +42 -0
- package/src/plugin/command-data.ts +3 -0
- package/src/rpc/port-file.ts +6 -140
- package/src/rpc/protocol.ts +59 -24
- package/src/rpc/rpc-client.ts +101 -71
- package/src/sidebar-state.ts +82 -24
- package/src/tui/command-dialogs.tsx +412 -776
- package/src/tui/entry.d.mts +17 -0
- package/src/tui/entry.mjs +34 -66
- package/src/tui/file-logger.ts +22 -7
- package/src/tui-compiled/common-auth-embedded/logger/capture-sink.js +13 -0
- package/src/tui-compiled/common-auth-embedded/logger/engine.js +246 -0
- package/src/tui-compiled/common-auth-embedded/logger/index.js +3 -0
- package/src/tui-compiled/common-auth-embedded/logger/redact.js +83 -0
- package/src/tui-compiled/common-auth-embedded/quota/codec.js +12 -0
- package/src/tui-compiled/common-auth-embedded/quota/format.js +138 -0
- package/src/tui-compiled/common-auth-embedded/quota/index.js +5 -0
- package/src/tui-compiled/common-auth-embedded/quota/map.js +105 -0
- package/src/tui-compiled/common-auth-embedded/quota/merge.js +162 -0
- package/src/tui-compiled/common-auth-embedded/quota/projection.js +134 -0
- package/src/tui-compiled/common-auth-embedded/rpc/client.js +2 -0
- package/src/tui-compiled/common-auth-embedded/rpc/port-file.js +217 -0
- package/src/tui-compiled/common-auth-embedded/rpc/rpc-client.js +253 -0
- package/src/tui-compiled/logging/provider-key-policy.js +3 -0
- package/src/tui-compiled/quota-presentation.js +42 -0
- package/src/tui-compiled/rpc/rpc-client.js +35 -0
- package/src/tui-compiled/rpc/rpc-dir.js +13 -0
- package/src/tui-compiled/selector.js +21 -0
- package/src/tui-compiled/sidebar-state.js +401 -0
- package/src/tui-compiled/tui/command-dialogs.js +424 -0
- package/src/tui-compiled/tui/file-logger.js +73 -0
- package/src/tui-compiled/tui/host-api.js +269 -0
- package/src/tui-compiled/tui/host-v1.js +228 -0
- package/src/tui-compiled/tui-preferences.js +230 -0
- package/src/tui-compiled/{tui.tsx → tui.js} +140 -231
- package/src/tui-ga-compiled/host-ga.js +1304 -0
- package/src/tui-ga-compiled/selector.js +21 -0
- package/src/tui-ga-compiled/shared/07365a7d2ccade4c-host-api.js +269 -0
- package/src/tui-ga-compiled/shared/0e19a88ff3535906-command-dialogs.js +424 -0
- package/src/tui-ga-compiled/shared/1ff34afa7c42d196-projection.js +134 -0
- package/src/tui-ga-compiled/shared/77138df80c7ae006-map.js +105 -0
- package/src/tui-ga-compiled/shared/8ae1927e5910ea81-sidebar-projection.js +112 -0
- package/src/tui-ga-compiled/shared/98cc0c186c46c42d-quota-presentation.js +42 -0
- package/src/tui-ga-compiled/shared/aef2402f8fc342f0-format.js +138 -0
- package/src/tui-ga-compiled/shared/bf17cbee28e58197-index.js +5 -0
- package/src/tui-ga-compiled/shared/ca21dc417b36dc5d-codec.js +12 -0
- package/src/tui-ga-compiled/shared/ecc214300932dfb6-merge.js +162 -0
- package/src/tui-ga-raw/host-ga.tsx +1740 -0
- package/src/tui-ga-raw/selector.js +21 -0
- package/src/tui-ga-raw/shared/07365a7d2ccade4c-host-api.js +269 -0
- package/src/tui-ga-raw/shared/0e19a88ff3535906-command-dialogs.tsx +468 -0
- package/src/tui-ga-raw/shared/1ff34afa7c42d196-projection.js +134 -0
- package/src/tui-ga-raw/shared/77138df80c7ae006-map.js +105 -0
- package/src/tui-ga-raw/shared/8ae1927e5910ea81-sidebar-projection.js +112 -0
- package/src/tui-ga-raw/shared/98cc0c186c46c42d-quota-presentation.js +42 -0
- package/src/tui-ga-raw/shared/aef2402f8fc342f0-format.js +138 -0
- package/src/tui-ga-raw/shared/bf17cbee28e58197-index.js +5 -0
- package/src/tui-ga-raw/shared/ca21dc417b36dc5d-codec.js +12 -0
- package/src/tui-ga-raw/shared/ecc214300932dfb6-merge.js +162 -0
- package/src/tui-raw/common-auth-embedded/logger/capture-sink.js +13 -0
- package/src/tui-raw/common-auth-embedded/logger/engine.js +246 -0
- package/src/tui-raw/common-auth-embedded/logger/index.js +3 -0
- package/src/tui-raw/common-auth-embedded/logger/redact.js +83 -0
- package/src/tui-raw/common-auth-embedded/quota/codec.js +12 -0
- package/src/tui-raw/common-auth-embedded/quota/format.js +138 -0
- package/src/tui-raw/common-auth-embedded/quota/index.js +5 -0
- package/src/tui-raw/common-auth-embedded/quota/map.js +105 -0
- package/src/tui-raw/common-auth-embedded/quota/merge.js +162 -0
- package/src/tui-raw/common-auth-embedded/quota/projection.js +134 -0
- package/src/tui-raw/common-auth-embedded/rpc/client.js +2 -0
- package/src/tui-raw/common-auth-embedded/rpc/port-file.js +217 -0
- package/src/tui-raw/common-auth-embedded/rpc/rpc-client.js +253 -0
- package/src/tui-raw/logging/provider-key-policy.js +3 -0
- package/src/tui-raw/quota-presentation.js +42 -0
- package/src/tui-raw/rpc/rpc-client.js +35 -0
- package/src/tui-raw/rpc/rpc-dir.js +13 -0
- package/src/tui-raw/selector.js +21 -0
- package/src/tui-raw/sidebar-state.js +401 -0
- package/src/tui-raw/tui/command-dialogs.tsx +468 -0
- package/src/tui-raw/tui/file-logger.js +73 -0
- package/src/tui-raw/tui/host-api.js +269 -0
- package/src/tui-raw/tui/host-v1.tsx +249 -0
- package/src/tui-raw/tui-preferences.js +230 -0
- package/src/tui-raw/tui.tsx +1088 -0
- package/src/tui.tsx +58 -141
- package/tui.js +6 -0
- package/src/tui-compiled/plugin/command-data.ts +0 -931
- package/src/tui-compiled/rpc/port-file.ts +0 -143
- package/src/tui-compiled/rpc/protocol.ts +0 -31
- package/src/tui-compiled/rpc/rpc-client.ts +0 -102
- package/src/tui-compiled/rpc/rpc-dir.ts +0 -24
- package/src/tui-compiled/sidebar-state.ts +0 -991
- package/src/tui-compiled/tui/command-dialogs.tsx +0 -779
- package/src/tui-compiled/tui/file-logger.ts +0 -145
- package/src/tui-compiled/tui-preferences.ts +0 -416
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type RedactionOptions } from '../logger/index.js';
|
|
2
|
+
import type { ActionDefinition, CommandApplyResult, CommandDialogPayload, ItemDefinition, MenuAccount, MenuConfirmation, SectionContent, SectionSlot } from './model.js';
|
|
3
|
+
/** Where a dropped field is reported. Names only, never values. */
|
|
4
|
+
export interface SeamLogger {
|
|
5
|
+
warn(message: string, data?: unknown): void;
|
|
6
|
+
}
|
|
7
|
+
/** Masks the secret-shaped parts of one string. */
|
|
8
|
+
export type TextRedactor = (text: string) => string;
|
|
9
|
+
/** The string redactor every value crossing the seam goes through. */
|
|
10
|
+
export declare function createTextRedactor(options?: RedactionOptions): TextRedactor;
|
|
11
|
+
/**
|
|
12
|
+
* A failure whose message was written for the user. An action throws it to
|
|
13
|
+
* show `message` with the stable `code`; any other thrown value is shown only
|
|
14
|
+
* as a generic message, because its text may quote a request, a response or
|
|
15
|
+
* a credential. `code` is lowercase letters, digits and dashes; anything else
|
|
16
|
+
* is reported as `action-failed`.
|
|
17
|
+
*/
|
|
18
|
+
export declare class CommandError extends Error {
|
|
19
|
+
readonly code: string;
|
|
20
|
+
constructor(code: string, message: string, options?: {
|
|
21
|
+
cause?: unknown;
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
/** What a failed action shows: a stable code and a message safe to display. */
|
|
25
|
+
export interface ProjectedFailure {
|
|
26
|
+
code: string;
|
|
27
|
+
text: string;
|
|
28
|
+
}
|
|
29
|
+
/** The code and message shown for an exception the seam cannot vouch for. */
|
|
30
|
+
export declare const ACTION_FAILED: ProjectedFailure;
|
|
31
|
+
/** The code and display text for a thrown value; never its raw text. */
|
|
32
|
+
export declare function projectFailure(error: unknown): ProjectedFailure;
|
|
33
|
+
/** A built-in item may carry the account it shows; plugin items cannot. */
|
|
34
|
+
export interface ResolvedItem extends ItemDefinition {
|
|
35
|
+
account?: MenuAccount;
|
|
36
|
+
}
|
|
37
|
+
/** A section with its bodies, as the menu holds it between builds. */
|
|
38
|
+
export interface ResolvedSection {
|
|
39
|
+
id: string;
|
|
40
|
+
slot: SectionSlot;
|
|
41
|
+
title: string;
|
|
42
|
+
content: Omit<SectionContent, 'items'> & {
|
|
43
|
+
items?: ResolvedItem[];
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** The confirmation shown when an irreversible action names none. */
|
|
47
|
+
export declare const DEFAULT_IRREVERSIBLE_CONFIRMATION = "This cannot be undone. Continue?";
|
|
48
|
+
/** What every payload builder needs besides the payload itself. */
|
|
49
|
+
export interface SeamContext {
|
|
50
|
+
logger: SeamLogger;
|
|
51
|
+
redact: TextRedactor;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The confirmation an action must pass before it runs, or undefined. An
|
|
55
|
+
* irreversible action always has one, even when its definition (built
|
|
56
|
+
* outside the type checker) names none.
|
|
57
|
+
*/
|
|
58
|
+
export declare function confirmationOf(action: ActionDefinition): MenuConfirmation | undefined;
|
|
59
|
+
/** The account fields a renderer may show; see `MenuAccount`. */
|
|
60
|
+
export declare function projectAccount(account: MenuAccount): MenuAccount;
|
|
61
|
+
/** The payload a host's TUI receives when the slash command opens. */
|
|
62
|
+
export declare function dialogPayload(command: string, title: string, sections: readonly ResolvedSection[], seam: SeamContext): CommandDialogPayload;
|
|
63
|
+
/** How an apply ended, before the seam turns it into a payload. */
|
|
64
|
+
export interface ApplyOutcome {
|
|
65
|
+
ok: boolean;
|
|
66
|
+
text: string;
|
|
67
|
+
/** Present on every failure. */
|
|
68
|
+
code?: string;
|
|
69
|
+
needsConfirmation?: boolean;
|
|
70
|
+
}
|
|
71
|
+
/** An apply's result: the message and the refreshed menu. */
|
|
72
|
+
export declare function applyResult(command: string, title: string, sections: readonly ResolvedSection[], outcome: ApplyOutcome, seam: SeamContext): CommandApplyResult;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export declare function isLostMarkerRaceError(error: unknown): boolean;
|
|
2
|
+
export interface LockLoss {
|
|
3
|
+
readonly reason: 'taken-over' | 'expired' | 'unreadable' | 'renewal-failed' | 'marker-lost';
|
|
4
|
+
readonly expectedOwnerId: string;
|
|
5
|
+
readonly observedOwnerId?: string;
|
|
6
|
+
readonly observedExpiresAt?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface RefreshFileLock {
|
|
9
|
+
readonly ownerId: string;
|
|
10
|
+
assertOwned(): Promise<void>;
|
|
11
|
+
release(): Promise<void>;
|
|
12
|
+
/** Resolves once on detected loss; remains pending after an owner's release. */
|
|
13
|
+
whenLost(): Promise<LockLoss>;
|
|
14
|
+
hasLost(): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare function acquireRefreshFileLock(options: {
|
|
17
|
+
name: string;
|
|
18
|
+
ttlMs: number;
|
|
19
|
+
/**
|
|
20
|
+
* File the lock is named after. Required: the lock and the write it guards
|
|
21
|
+
* must target the same file, and a default resolved in here could only ever
|
|
22
|
+
* be one host's path.
|
|
23
|
+
*/
|
|
24
|
+
path: string;
|
|
25
|
+
now?: () => number;
|
|
26
|
+
renew?: boolean;
|
|
27
|
+
renewIntervalMs?: number;
|
|
28
|
+
/** Notifies a live-owner refusal without awaiting; observer failures are ignored. */
|
|
29
|
+
onContended?: () => void;
|
|
30
|
+
/** Synchronous, never awaited; throws and returned promise/thenable rejections are isolated. */
|
|
31
|
+
onRenewalTimer?: (event: 'scheduled' | 'cancelled') => void;
|
|
32
|
+
onStep?: (step: 'stale-marker-stat' | 'stale-marker-claimed' | 'stale-lock-observed' | 'stale-lock-confirmed' | 'stale-lock-removed' | 'stale-lock-recreated' | 'eviction-marker-acquired' | 'renewal-owner-confirmed' | 'renewal-marker-unavailable' | 'renewal-write-fenced' | 'renewal-write-ready' | 'relinquish-read' | 'renewal-finished' | 'release-owner-confirmed') => void | Promise<void>;
|
|
33
|
+
}): Promise<RefreshFileLock | null>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Level } from './engine.js';
|
|
2
|
+
export interface LogTestRecord {
|
|
3
|
+
channel: string;
|
|
4
|
+
level: Level;
|
|
5
|
+
message: string;
|
|
6
|
+
data?: unknown;
|
|
7
|
+
}
|
|
8
|
+
/** The engine delivers scrubbed records only; this sink never sees raw credentials. */
|
|
9
|
+
export type CaptureSink = (record: LogTestRecord) => void;
|
|
10
|
+
export declare function createCaptureSink(): {
|
|
11
|
+
records: LogTestRecord[];
|
|
12
|
+
sink: CaptureSink;
|
|
13
|
+
clear: () => void;
|
|
14
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { CaptureSink } from './capture-sink.js';
|
|
2
|
+
import { type RedactionOptions } from './redact.js';
|
|
3
|
+
export type Level = 'error' | 'warn' | 'info' | 'debug' | 'trace';
|
|
4
|
+
/** A logger that writes to a file, and to a capture sink when one is given. */
|
|
5
|
+
export interface InitLoggerOptions extends RedactionOptions {
|
|
6
|
+
/** Receives every emitted record, scrubbed, alongside the file. */
|
|
7
|
+
captureSink?: CaptureSink;
|
|
8
|
+
/**
|
|
9
|
+
* Path of the file lines are appended to, or a function returning it.
|
|
10
|
+
*
|
|
11
|
+
* A function is what a host passes when its destination can move while the
|
|
12
|
+
* process runs — an operator or a test changing the variable that names the
|
|
13
|
+
* log file expects the next line to land in the new file, and a value
|
|
14
|
+
* captured once at init would keep writing to the old one.
|
|
15
|
+
*/
|
|
16
|
+
file: string | (() => string);
|
|
17
|
+
/** Level floor applied when no `setLogLevel` call has overridden it. */
|
|
18
|
+
level?: Level | (() => Level | undefined);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A logger with no file: the capture sink is its only destination. Nothing
|
|
22
|
+
* is written to disk or printed, for a host that forwards records to its own
|
|
23
|
+
* log.
|
|
24
|
+
*/
|
|
25
|
+
export interface SinkOnlyLoggerOptions extends RedactionOptions {
|
|
26
|
+
/** Receives every emitted record, scrubbed. */
|
|
27
|
+
captureSink: CaptureSink;
|
|
28
|
+
file?: undefined;
|
|
29
|
+
/** Level floor applied when no `setLogLevel` call has overridden it. */
|
|
30
|
+
level?: Level | (() => Level | undefined);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* What a logger is configured with: a file (`InitLoggerOptions`, the shape
|
|
34
|
+
* every release before this one accepted, kept as its own interface so a
|
|
35
|
+
* caller deriving a type from it with `Pick` or `extends` keeps compiling) or
|
|
36
|
+
* a capture sink alone.
|
|
37
|
+
*/
|
|
38
|
+
export type LoggerOptions = InitLoggerOptions | SinkOnlyLoggerOptions;
|
|
39
|
+
export interface ChannelLogger {
|
|
40
|
+
error(message: string, data?: unknown): void;
|
|
41
|
+
warn(message: string, data?: unknown): void;
|
|
42
|
+
info(message: string, data?: unknown): void;
|
|
43
|
+
debug(message: string, data?: unknown): void;
|
|
44
|
+
trace(message: string, data?: unknown): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A logger with its own file, level, redaction, capture sink and buffer.
|
|
48
|
+
* Two instances in one process never touch each other's settings or lines,
|
|
49
|
+
* so two plugins that load one shared copy of this module each keep their own
|
|
50
|
+
* log by holding their own instance.
|
|
51
|
+
*/
|
|
52
|
+
export interface LoggerInstance {
|
|
53
|
+
/** A logger whose lines carry `channel` and go to this instance's file. */
|
|
54
|
+
createLogger(channel: string): ChannelLogger;
|
|
55
|
+
/**
|
|
56
|
+
* Point this instance at a host's file and level. Idempotent: calling it
|
|
57
|
+
* again replaces both. A runtime level installed by `setLogLevel` is left
|
|
58
|
+
* alone, because it is the operator's explicit choice and outranks the
|
|
59
|
+
* floor a host computed at start-up.
|
|
60
|
+
*/
|
|
61
|
+
configure(options: LoggerOptions): void;
|
|
62
|
+
/** Operator override of the level floor; undefined removes it. */
|
|
63
|
+
setLogLevel(level: Level | undefined): void;
|
|
64
|
+
/**
|
|
65
|
+
* Write whatever is buffered. Safe to call synchronously from a
|
|
66
|
+
* process-exit handler, which is how each host drains the buffer on
|
|
67
|
+
* shutdown.
|
|
68
|
+
*/
|
|
69
|
+
flushLogs(): void;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A logger instance of its own, configured with `options`. A plugin whose
|
|
73
|
+
* copy of this module may be shared with another plugin in the same process
|
|
74
|
+
* uses this instead of `initLogger`, so neither replaces the other's file,
|
|
75
|
+
* level, redaction or capture sink.
|
|
76
|
+
*/
|
|
77
|
+
export declare function createLoggerInstance(options: LoggerOptions): LoggerInstance;
|
|
78
|
+
/**
|
|
79
|
+
* Point the module's default logger at a host's file and level, and return
|
|
80
|
+
* it. Idempotent: calling it again replaces both. A runtime level installed
|
|
81
|
+
* by `setLogLevel` is deliberately left alone, because it is the operator's
|
|
82
|
+
* explicit choice and outranks the floor a host computed at start-up.
|
|
83
|
+
*/
|
|
84
|
+
export declare function initLogger(options: LoggerOptions): LoggerInstance;
|
|
85
|
+
export declare function setLogLevel(l: Level | undefined): void;
|
|
86
|
+
/**
|
|
87
|
+
* Write whatever the default logger has buffered. Safe to call synchronously
|
|
88
|
+
* from a process-exit handler, which is how each host drains the buffer on
|
|
89
|
+
* shutdown.
|
|
90
|
+
*/
|
|
91
|
+
export declare function flushLogs(): void;
|
|
92
|
+
export declare function createLogger(channel: string): ChannelLogger;
|
|
93
|
+
export declare function flushForTest(): Promise<void>;
|
|
94
|
+
/**
|
|
95
|
+
* Return the default logger to its uninitialised state. Only a test needs
|
|
96
|
+
* this: a single process runs every test file, so a file path left over from
|
|
97
|
+
* one test would keep a later "logger was never initialised" case writing
|
|
98
|
+
* lines.
|
|
99
|
+
*/
|
|
100
|
+
export declare function resetLoggerForTest(): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type { CaptureSink, LogTestRecord } from './capture-sink.js';
|
|
2
|
+
export { createCaptureSink } from './capture-sink.js';
|
|
3
|
+
export type { ChannelLogger, InitLoggerOptions, Level, LoggerInstance, LoggerOptions, SinkOnlyLoggerOptions, } from './engine.js';
|
|
4
|
+
export { createLogger, createLoggerInstance, flushForTest, flushLogs, initLogger, resetLoggerForTest, setLogLevel, } from './engine.js';
|
|
5
|
+
export type { RedactionOptions, Redactor } from './redact.js';
|
|
6
|
+
export { createRedactor, redact, redactStrings } from './redact.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface RedactionOptions {
|
|
2
|
+
extraSecretKeys?: (normalizedKey: string) => boolean;
|
|
3
|
+
extraValuePatterns?: RegExp[];
|
|
4
|
+
}
|
|
5
|
+
export declare function createRedactor(options?: RedactionOptions): {
|
|
6
|
+
redact: (value: unknown) => unknown;
|
|
7
|
+
redactStrings: (value: unknown) => unknown;
|
|
8
|
+
};
|
|
9
|
+
export type Redactor = ReturnType<typeof createRedactor>;
|
|
10
|
+
export declare const redact: (value: unknown) => unknown;
|
|
11
|
+
export declare const redactStrings: (value: unknown) => unknown;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface QuotaCodec {
|
|
2
|
+
readonly validate: (value: unknown) => boolean;
|
|
3
|
+
readonly merge: (stored: unknown, observation: unknown) => unknown;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* The quota codec the account-pool store (the `/store` subpath) takes when it
|
|
7
|
+
* is opened: `validate` checks a stored per-row quota map and `merge` applies
|
|
8
|
+
* an observation to one, so the store persists the map without interpreting
|
|
9
|
+
* it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const quotaCodec: QuotaCodec;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ProjectedLimit, ProjectedQuota } from './projection.js';
|
|
2
|
+
/** A reading older than this is marked with its age. */
|
|
3
|
+
export declare const QUOTA_STALE_AFTER_MS: number;
|
|
4
|
+
/** What `formatQuota` returns when there is no reading at all. */
|
|
5
|
+
export declare const NO_QUOTA_READING = "no quota reading yet";
|
|
6
|
+
/**
|
|
7
|
+
* What `formatQuota` returns when the provider answered but reported no
|
|
8
|
+
* limit for any window (every window is an absence record or a tombstone).
|
|
9
|
+
*/
|
|
10
|
+
export declare const NO_LIMITS_REPORTED = "no limits reported";
|
|
11
|
+
/**
|
|
12
|
+
* `compact` fits a footer or a sidebar row: each window's figure, the credit
|
|
13
|
+
* budget and the stale marker, without reset times. `full` adds each reset.
|
|
14
|
+
*/
|
|
15
|
+
export type QuotaTextForm = 'compact' | 'full';
|
|
16
|
+
export interface QuotaTextOptions {
|
|
17
|
+
/** The current time in ms, for reset countdowns and the stale marker. */
|
|
18
|
+
now: number;
|
|
19
|
+
/** Defaults to `full`. */
|
|
20
|
+
form?: QuotaTextForm;
|
|
21
|
+
/** Defaults to `QUOTA_STALE_AFTER_MS`. */
|
|
22
|
+
staleAfterMs?: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* The name a window is shown under. A general window (scope `all`) is named
|
|
26
|
+
* by its stored length; a model-scoped window keeps the label the plugin
|
|
27
|
+
* stored it under, which already names the model (`seven_day_opus`). A
|
|
28
|
+
* general window stored without a length (a snapshot from before lengths
|
|
29
|
+
* were recorded) falls back to its label.
|
|
30
|
+
*/
|
|
31
|
+
export declare function quotaWindowName(limit: Pick<ProjectedLimit, 'scope' | 'label' | 'windowMinutes'>): string;
|
|
32
|
+
/**
|
|
33
|
+
* The pieces of a quota text, in order: one per reported window
|
|
34
|
+
* (`5h 58% left, resets 2h`), then the credit budget when there is one, then
|
|
35
|
+
* `checked 3h ago` when the oldest piece shown is stale. Empty when nothing
|
|
36
|
+
* was reported; `formatQuota` turns that into a sentence. A caller printing
|
|
37
|
+
* one line per window (the terminal auth menu) uses these directly.
|
|
38
|
+
*/
|
|
39
|
+
export declare function quotaTextParts(quota: ProjectedQuota | undefined, options: QuotaTextOptions): string[];
|
|
40
|
+
/**
|
|
41
|
+
* A row's quota as one line: `5h 58% left · 7d 90% left` in the compact
|
|
42
|
+
* form, with `, resets 2h` after each window in the full form. With nothing
|
|
43
|
+
* reported it is `NO_QUOTA_READING`, or `NO_LIMITS_REPORTED` when the
|
|
44
|
+
* provider answered without a limit for any window.
|
|
45
|
+
*/
|
|
46
|
+
export declare function formatQuota(quota: ProjectedQuota | undefined, options: QuotaTextOptions): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type { QuotaCodec } from './codec.js';
|
|
2
|
+
export { quotaCodec } from './codec.js';
|
|
3
|
+
export type { QuotaTextForm, QuotaTextOptions } from './format.js';
|
|
4
|
+
export { formatQuota, NO_LIMITS_REPORTED, NO_QUOTA_READING, QUOTA_STALE_AFTER_MS, quotaTextParts, quotaWindowName, } from './format.js';
|
|
5
|
+
export type { CreditBudgetCleared, CreditBudgetEntry, CreditBudgetReading, QuotaAbsentEntry, QuotaEntry, QuotaMap, QuotaReadingEntry, QuotaRetiredEntry, } from './map.js';
|
|
6
|
+
export { ALL_SCOPE, DEFAULT_REQUIRED_LABELS, emptyQuotaMap, isQuotaMap, } from './map.js';
|
|
7
|
+
export type { ObservedBudget, ObservedPair, ObservedReading, QuotaObservation, } from './merge.js';
|
|
8
|
+
export { isQuotaObservation, mergeQuotaObservation, QuotaCodecError, } from './merge.js';
|
|
9
|
+
export type { ExhaustionReset, ProjectedBudget, ProjectedLimit, ProjectedQuota, } from './projection.js';
|
|
10
|
+
export { budgetExhaustedResetAt, futureResetAt, projectQuota, readsExhausted, } from './projection.js';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/** The scope of a limit that binds every request regardless of model. */
|
|
2
|
+
export declare const ALL_SCOPE = "all";
|
|
3
|
+
/** The window label required when an admission call supplies none. */
|
|
4
|
+
export declare const DEFAULT_REQUIRED_LABELS: readonly string[];
|
|
5
|
+
export interface QuotaReadingEntry {
|
|
6
|
+
scope: string;
|
|
7
|
+
label: string;
|
|
8
|
+
kind: 'reading';
|
|
9
|
+
checkedAt: number;
|
|
10
|
+
usedPercent: number;
|
|
11
|
+
/** ISO timestamp at which the window resets, as the provider reported it. */
|
|
12
|
+
resetsAt?: string;
|
|
13
|
+
/** Window length in minutes, when the provider reported one. */
|
|
14
|
+
windowMinutes?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface QuotaRetiredEntry {
|
|
17
|
+
scope: string;
|
|
18
|
+
label: string;
|
|
19
|
+
kind: 'retired';
|
|
20
|
+
retiredAt: number;
|
|
21
|
+
}
|
|
22
|
+
export interface QuotaAbsentEntry {
|
|
23
|
+
scope: string;
|
|
24
|
+
label: string;
|
|
25
|
+
kind: 'absent';
|
|
26
|
+
checkedAt: number;
|
|
27
|
+
}
|
|
28
|
+
export type QuotaEntry = QuotaReadingEntry | QuotaRetiredEntry | QuotaAbsentEntry;
|
|
29
|
+
export interface CreditBudgetReading {
|
|
30
|
+
kind: 'reading';
|
|
31
|
+
checkedAt: number;
|
|
32
|
+
/** The provider's own verdict that the budget is spent. */
|
|
33
|
+
reached: boolean;
|
|
34
|
+
remainingPercent?: number;
|
|
35
|
+
usedPercent?: number;
|
|
36
|
+
resetsAt?: string;
|
|
37
|
+
limit?: number;
|
|
38
|
+
used?: number;
|
|
39
|
+
remaining?: number;
|
|
40
|
+
unit?: string;
|
|
41
|
+
}
|
|
42
|
+
export interface CreditBudgetCleared {
|
|
43
|
+
kind: 'cleared';
|
|
44
|
+
checkedAt: number;
|
|
45
|
+
}
|
|
46
|
+
export type CreditBudgetEntry = CreditBudgetReading | CreditBudgetCleared;
|
|
47
|
+
export interface QuotaMap {
|
|
48
|
+
limits: QuotaEntry[];
|
|
49
|
+
/** Absent means no observation has reported on the budget yet. */
|
|
50
|
+
budget?: CreditBudgetEntry;
|
|
51
|
+
}
|
|
52
|
+
export declare function emptyQuotaMap(): QuotaMap;
|
|
53
|
+
/** The time an entry speaks for: its reading, retirement or absence time. */
|
|
54
|
+
export declare function entryTime(entry: QuotaEntry): number;
|
|
55
|
+
export declare function limitKey(scope: string, label: string): string;
|
|
56
|
+
export declare function isCreditBudgetEntry(value: unknown): value is CreditBudgetEntry;
|
|
57
|
+
/**
|
|
58
|
+
* True when `value` is a well-formed quota map. Unrecognised top-level keys
|
|
59
|
+
* are tolerated (and preserved by merge) so a newer writer's additions
|
|
60
|
+
* survive; a malformed entry, a duplicated (scope, label) key or a malformed
|
|
61
|
+
* budget makes the whole map invalid.
|
|
62
|
+
*/
|
|
63
|
+
export declare function isQuotaMap(value: unknown): value is QuotaMap;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type QuotaMap } from './map.js';
|
|
2
|
+
export interface ObservedReading {
|
|
3
|
+
/** Defaults to `all`. */
|
|
4
|
+
scope?: string;
|
|
5
|
+
label: string;
|
|
6
|
+
usedPercent: number;
|
|
7
|
+
resetsAt?: string;
|
|
8
|
+
windowMinutes?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface ObservedPair {
|
|
11
|
+
/** Defaults to `all`. */
|
|
12
|
+
scope?: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
export type ObservedBudget = {
|
|
16
|
+
kind: 'reading';
|
|
17
|
+
reached: boolean;
|
|
18
|
+
remainingPercent?: number;
|
|
19
|
+
usedPercent?: number;
|
|
20
|
+
resetsAt?: string;
|
|
21
|
+
limit?: number;
|
|
22
|
+
used?: number;
|
|
23
|
+
remaining?: number;
|
|
24
|
+
unit?: string;
|
|
25
|
+
} | {
|
|
26
|
+
kind: 'cleared';
|
|
27
|
+
};
|
|
28
|
+
export interface QuotaObservation {
|
|
29
|
+
checkedAt: number;
|
|
30
|
+
readings?: ObservedReading[];
|
|
31
|
+
/** Pairs reported on with authority besides the ones carrying a reading. */
|
|
32
|
+
coverage?: ObservedPair[];
|
|
33
|
+
/** Absent means the observation says nothing about the budget. */
|
|
34
|
+
budget?: ObservedBudget;
|
|
35
|
+
}
|
|
36
|
+
/** Thrown by `mergeQuotaObservation` when either argument is malformed. */
|
|
37
|
+
export declare class QuotaCodecError extends TypeError {
|
|
38
|
+
constructor(message: string);
|
|
39
|
+
}
|
|
40
|
+
/** True when `value` is a well-formed observation; a pair read twice is not. */
|
|
41
|
+
export declare function isQuotaObservation(value: unknown): value is QuotaObservation;
|
|
42
|
+
/**
|
|
43
|
+
* Applies `observation` to `stored` (undefined for a row with no map yet) and
|
|
44
|
+
* returns the new map. Pure: neither argument is modified. Throws
|
|
45
|
+
* `QuotaCodecError` when either argument is malformed, so a store refuses the
|
|
46
|
+
* write rather than persisting a map it could not read back.
|
|
47
|
+
*/
|
|
48
|
+
export declare function mergeQuotaObservation(stored: unknown, observation: unknown): QuotaMap;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { type QuotaMap } from './map.js';
|
|
2
|
+
export interface ProjectedLimit {
|
|
3
|
+
scope: string;
|
|
4
|
+
label: string;
|
|
5
|
+
kind: 'reading' | 'retired' | 'absent';
|
|
6
|
+
/** The reading, retirement or absence time. */
|
|
7
|
+
checkedAt: number;
|
|
8
|
+
/** The stored window length; undefined when the provider reported none. */
|
|
9
|
+
windowMinutes?: number;
|
|
10
|
+
/** Present on readings only. */
|
|
11
|
+
usedPercent?: number;
|
|
12
|
+
/** Present on readings only: `100 - usedPercent`. */
|
|
13
|
+
remainingPercent?: number;
|
|
14
|
+
resetsAt?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface ProjectedBudget {
|
|
17
|
+
checkedAt: number;
|
|
18
|
+
reached: boolean;
|
|
19
|
+
remainingPercent?: number;
|
|
20
|
+
resetsAt?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ProjectedQuota {
|
|
23
|
+
scope: string;
|
|
24
|
+
/** One entry per label: longest known window first, unknown lengths last. */
|
|
25
|
+
limits: readonly ProjectedLimit[];
|
|
26
|
+
/**
|
|
27
|
+
* The oldest reading time among the limits (or, with no reading, the oldest
|
|
28
|
+
* evidence time), so a projection is only as fresh as its stalest limit.
|
|
29
|
+
*/
|
|
30
|
+
checkedAt?: number;
|
|
31
|
+
/** Present only when the stored budget is a reading, not cleared. */
|
|
32
|
+
budget?: ProjectedBudget;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Resolves `map` for a request in `scope` (`all` or a model family). A family
|
|
36
|
+
* request sees only its own family's keys and the `all` keys.
|
|
37
|
+
*
|
|
38
|
+
* The label decides how a family limit relates to a general one. Under the
|
|
39
|
+
* same label, the family reading replaces the `all` reading: use this only
|
|
40
|
+
* when the provider's family figure is a more specific view of the same cap.
|
|
41
|
+
* Under different labels both limits are projected and every consumer judges
|
|
42
|
+
* both, so a family cap that applies on top of a general cap must be stored
|
|
43
|
+
* under its own label; otherwise the general cap is hidden from a family
|
|
44
|
+
* request. A family tombstone or absence record says only that no
|
|
45
|
+
* family-specific limit exists, so it does not hide an `all` entry for the
|
|
46
|
+
* same label and is used only when there is none.
|
|
47
|
+
*/
|
|
48
|
+
export declare function projectQuota(map: QuotaMap | undefined, scope?: string): ProjectedQuota;
|
|
49
|
+
export interface ExhaustionReset {
|
|
50
|
+
resetsAt: string;
|
|
51
|
+
resetAtMs: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* The credit budget's own exhaustion signal. Admission and the sticky
|
|
55
|
+
* routing decision to move a session off its pinned row both use it, so the
|
|
56
|
+
* two agree on what "spent" means. `reached` is the provider's
|
|
57
|
+
* verdict (the percentage is only a display value), and the check fails open
|
|
58
|
+
* on a missing, unparsable or already-passed reset.
|
|
59
|
+
*/
|
|
60
|
+
export declare function budgetExhaustedResetAt(quota: Pick<ProjectedQuota, 'budget'> | null | undefined, now: number): ExhaustionReset | undefined;
|
|
61
|
+
/** True for a reading at or beyond its whole window. */
|
|
62
|
+
export declare function readsExhausted(limit: ProjectedLimit): boolean;
|
|
63
|
+
/** The reset time of a limit when it parses and lies after `now`. */
|
|
64
|
+
export declare function futureResetAt(limit: ProjectedLimit, now: number): number | undefined;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type StoreRuntime } from './runtime.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a pull or refresh captured about its row (named by id alongside) when
|
|
4
|
+
* it was issued. A result applies only while the row with that id still has
|
|
5
|
+
* this credential epoch and this recorded identity; a replaced credential
|
|
6
|
+
* bumps the epoch, so work issued for the old one is discarded.
|
|
7
|
+
*
|
|
8
|
+
* The epoch names one credential lineage of the row: a credential given by
|
|
9
|
+
* `add` or `replace`, through every refresh and `rotate` of it, which keep
|
|
10
|
+
* the epoch. Since 0.8.0 that holds across removal too: a row added under an
|
|
11
|
+
* id the pool held before starts past every epoch that id held (the store
|
|
12
|
+
* records them when it drops a row, in the config file, so every process
|
|
13
|
+
* sees it), so an attribution taken for a removed row is refused once the id
|
|
14
|
+
* is added again, even with the same identity. Writers older than 0.8.0
|
|
15
|
+
* start a re-added id at epoch 1 again, and a writer that does not know the
|
|
16
|
+
* pool can remove and re-add a row without the store seeing it; work
|
|
17
|
+
* attributed across either may still apply to the new credential.
|
|
18
|
+
*/
|
|
19
|
+
export interface Attribution {
|
|
20
|
+
credentialEpoch: number;
|
|
21
|
+
identity?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Merges a quota observation into a row's stored map under the store locks,
|
|
25
|
+
* after attribution passes. Needs no row lock, so it is permitted from
|
|
26
|
+
* inside hooks. Clears needs-first-reading on success.
|
|
27
|
+
*/
|
|
28
|
+
export declare function recordQuota(rt: StoreRuntime, id: string, attribution: Attribution, observation: unknown): Promise<void>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { StoredCredential } from './schema.js';
|
|
2
|
+
/** Every library operation that can fail, as named in the failure value. */
|
|
3
|
+
export type PoolOperation = 'initialize' | 'add' | 'replace' | 'rotate' | 'disable' | 'enable' | 'remove' | 'reorder' | 'updateSettings' | 'recordIdentity' | 'updateProviderState' | 'refresh' | 'pull' | 'publishRoster';
|
|
4
|
+
/**
|
|
5
|
+
* How far an operation got before it failed.
|
|
6
|
+
*
|
|
7
|
+
* `before-first-write`: nothing was written; both files are as they were.
|
|
8
|
+
* `after-first-write`: the operation's first file write landed and a later one
|
|
9
|
+
* did not; what that first write left is on disk and is never rolled back
|
|
10
|
+
* (add: a state entry no roster row names, which no reader loads; replace:
|
|
11
|
+
* the new credential stamped ahead of the config, which readers show as a
|
|
12
|
+
* torn row and the next store write on it completes; rotate: the rotated
|
|
13
|
+
* credential beside the old per-row entry). `pull`: a quota pull, or the
|
|
14
|
+
* recording of its result, failed.
|
|
15
|
+
*/
|
|
16
|
+
export type PoolFailurePhase = 'before-first-write' | 'after-first-write' | 'pull';
|
|
17
|
+
/**
|
|
18
|
+
* Why an operation failed. `lock-contention` and `lock-ownership` are the two
|
|
19
|
+
* lock outcomes (a wait that ran out, and a lease found lost); the rest are
|
|
20
|
+
* refusals and failures of the operation itself.
|
|
21
|
+
*/
|
|
22
|
+
export type PoolFailureKind = 'lock-contention' | 'lock-ownership' | 'pending-migration' | 'load-error' | 'snapshot-contended' | 'publication-sync' | 'publication-incomplete' | 'unknown-row' | 'invalid-row' | 'invalid-input' | 'id-exists' | 'id-removed' | 'type-mismatch' | 'no-credential' | 'row-disabled' | 'row-protected' | 'row-staged' | 'credential-exists' | 'publication-mismatch' | 'duplicate-identity' | 'identity-mismatch' | 'identity-contradicted' | 'endpoint-mismatch' | 'row-key-changed' | 'invalid-order' | 'refresh-stamp-ahead' | 'unbound-credential' | 'attribution' | 'provider' | 'pull' | 'invalid-quota' | 'invalid-provider-state' | 'after-persist-hook' | 'unexpected';
|
|
23
|
+
/**
|
|
24
|
+
* The single failure value of every store operation. `committed` is present
|
|
25
|
+
* only when the operation had already written a credential to the state file
|
|
26
|
+
* before it failed (a partial rotation or refresh): it is the credential now
|
|
27
|
+
* on disk, so a caller never has to re-read the files to learn it.
|
|
28
|
+
*/
|
|
29
|
+
export declare class PoolOperationError extends Error {
|
|
30
|
+
readonly operation: PoolOperation;
|
|
31
|
+
readonly rowId: string | undefined;
|
|
32
|
+
readonly phase: PoolFailurePhase;
|
|
33
|
+
readonly retryable: boolean;
|
|
34
|
+
readonly kind: PoolFailureKind;
|
|
35
|
+
readonly committed: StoredCredential | undefined;
|
|
36
|
+
constructor(details: {
|
|
37
|
+
operation: PoolOperation;
|
|
38
|
+
rowId?: string;
|
|
39
|
+
phase: PoolFailurePhase;
|
|
40
|
+
retryable: boolean;
|
|
41
|
+
kind: PoolFailureKind;
|
|
42
|
+
committed?: StoredCredential;
|
|
43
|
+
message?: string;
|
|
44
|
+
cause?: unknown;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Thrown when a row operation or a refresh is called from inside a hook of a
|
|
49
|
+
* lock-holding operation (or from any continuation created inside one). It is
|
|
50
|
+
* thrown before any lock is taken or waited for.
|
|
51
|
+
*/
|
|
52
|
+
export declare class PoolReentryError extends Error {
|
|
53
|
+
readonly operation: PoolOperation;
|
|
54
|
+
constructor(operation: PoolOperation);
|
|
55
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type PoolOperation } from './errors.js';
|
|
2
|
+
/** Refuses a row operation or refresh called from inside a hook. */
|
|
3
|
+
export declare function assertNotInsideHook(operation: PoolOperation): void;
|
|
4
|
+
export declare function runInsideHook<T>(operation: PoolOperation, fn: () => Promise<T> | T): Promise<T>;
|
|
5
|
+
export interface PoolLogger {
|
|
6
|
+
warn(message: string, data?: unknown): void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Runs a failure hook. A hook that throws never replaces the failure it was
|
|
10
|
+
* handed: its exception is logged and discarded.
|
|
11
|
+
*/
|
|
12
|
+
export declare function callFailureHook<E, R extends string | undefined>(operation: PoolOperation, hook: ((rowId: R, error: E) => void | Promise<void>) | undefined, rowId: R, error: E, logger: PoolLogger | undefined): Promise<void>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { PoolRow } from './schema.js';
|
|
2
|
+
/**
|
|
3
|
+
* What the identity rules edit: a transaction, or a config being completed
|
|
4
|
+
* in memory.
|
|
5
|
+
*/
|
|
6
|
+
export interface RowEditor {
|
|
7
|
+
rows(): PoolRow[];
|
|
8
|
+
rosterRow(id: string): Record<string, unknown> | undefined;
|
|
9
|
+
entry(id: string): Record<string, unknown> | undefined;
|
|
10
|
+
setEntry(id: string, entry: Record<string, unknown>): void;
|
|
11
|
+
}
|
|
12
|
+
/** Prefix of a refresh quarantine reason, followed by JSON of the expected and returned identities. */
|
|
13
|
+
export declare const IDENTITY_CONTRADICTED_REASON_PREFIX = "identity-contradicted: ";
|
|
14
|
+
/** The reason recorded on a row disabled because an earlier row is the same account. */
|
|
15
|
+
export declare const DUPLICATE_IDENTITY_REASON = "duplicate-identity";
|
|
16
|
+
/**
|
|
17
|
+
* Enabled OAuth rows holding a credential whose wire identity is not yet
|
|
18
|
+
* known. API-key rows and disabled rows never count.
|
|
19
|
+
*/
|
|
20
|
+
export declare function countUnknownIdentityRows(rows: readonly PoolRow[]): number;
|
|
21
|
+
/**
|
|
22
|
+
* Marks a row disabled with a reason: `enabled: false` in the roster row,
|
|
23
|
+
* which older readers honour, and the reason in the per-row entry. A row
|
|
24
|
+
* without an entry gets one at epoch 1. Nothing is ever deleted.
|
|
25
|
+
*/
|
|
26
|
+
export declare function disableIn(tx: RowEditor, id: string, reason: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Marks a row enabled: `enabled: true` in the roster row and no
|
|
29
|
+
* `disabledReason` in its entry. A row without an entry is not given one.
|
|
30
|
+
*/
|
|
31
|
+
export declare function enableIn(tx: RowEditor, id: string): void;
|
|
32
|
+
/**
|
|
33
|
+
* Two enabled OAuth rows with one wire identity are the same account: the
|
|
34
|
+
* earlier row in roster order stays enabled and every later one is disabled
|
|
35
|
+
* with a reason. Returns the ids it disabled.
|
|
36
|
+
*/
|
|
37
|
+
export declare function disableIdentityDuplicates(tx: RowEditor, identity: string): string[];
|
|
38
|
+
/** Records a row's wire identity in its roster row, then applies dedupe. */
|
|
39
|
+
export declare function recordIdentityIn(tx: RowEditor, id: string, identity: string): string[];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export type { Attribution } from './attribution.js';
|
|
2
|
+
export type { PoolFailureKind, PoolFailurePhase, PoolOperation, } from './errors.js';
|
|
3
|
+
export { PoolOperationError, PoolReentryError } from './errors.js';
|
|
4
|
+
export type { PoolLogger } from './hooks.js';
|
|
5
|
+
export { countUnknownIdentityRows, DUPLICATE_IDENTITY_REASON, } from './identity.js';
|
|
6
|
+
export type { HoldPoint, InitializeOutcome, WriteStep } from './mutate.js';
|
|
7
|
+
export type { OpenPoolStoreOptions, PoolLoad, PoolStore, } from './pool.js';
|
|
8
|
+
export { openPoolStore } from './pool.js';
|
|
9
|
+
export type { ProviderStateMutator, RowTransitionMutator, UpdateProviderStateResult, } from './provider-state.js';
|
|
10
|
+
export { DECLINE_TRANSITION } from './provider-state.js';
|
|
11
|
+
export type { PublicationReceipt, PublishOptions, PublishPlan, PublishResult, } from './publication.js';
|
|
12
|
+
export type { PullHook, PullRequest } from './pull.js';
|
|
13
|
+
export type { ProviderRefresh, ProviderRefreshResult, RefreshOptions, RefreshOutcome, } from './refresh.js';
|
|
14
|
+
export type { LockEvent, PoolLockOptions, PoolLockSpec, } from './refresh-lock.js';
|
|
15
|
+
export { POOL_LOCK_DEFAULTS } from './refresh-lock.js';
|
|
16
|
+
export type { AddInput, AddOptions, AddResult, CredentialWriteInput, FailureHook, ProtectFn, ProtectView, RemoveOptions, RemoveResult, RemoveView, ReorderOptions, ReorderResult, RowOperationOptions, RowProjection, RowToggleOptions, RowTransitionOptions, RowTransitionResult, RowWriteOptions, } from './rows.js';
|
|
17
|
+
export type { PullReason } from './runtime.js';
|
|
18
|
+
export type { ApiKeyCredential, CredentialStampStatus, OAuthCredential, PoolCredential, PoolRow, ProviderStateCodec, ProviderStateDrop, ProviderStateReplacement, QuotaCodec, RotateCredential, StoredCredential, } from './schema.js';
|
|
19
|
+
export { fingerprintOf, LEGACY_STORE_VERSION, POOL_KEY, POOL_ROWS_KEY, POOL_SCHEMA_VERSION, PROVIDER_STATE_KEY, REFRESH_STAMP_TOLERANCE_MS, rowLockKey, } from './schema.js';
|
|
20
|
+
export type { PoolSettings, SettingsMutator, SettingsRead, UpdateSettingsOptions, UpdateSettingsResult, } from './settings.js';
|
|
21
|
+
export { POOL_OWNED_KEYS } from './settings.js';
|