@cortexkit/opencode-antigravity-auth 3.0.5 → 3.0.6
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 +38 -352
- package/dist/cli.js +9199 -8799
- package/dist/cli.js.map +4 -4
- package/dist/cli.meta.json +1286 -1064
- package/dist/index.js +13641 -14559
- package/dist/index.js.map +4 -4
- package/dist/index.meta.json +1333 -1342
- package/dist/server.js +10618 -11080
- package/dist/server.js.map +4 -4
- package/dist/server.meta.json +1 -1
- package/dist/src/auth-method-labels.d.ts +3 -0
- package/dist/src/auth-method-labels.d.ts.map +1 -0
- package/dist/src/auth-method-labels.js +5 -0
- package/dist/src/auth-method-labels.js.map +1 -0
- package/dist/src/cli.d.ts +3 -1
- package/dist/src/cli.d.ts.map +1 -1
- package/dist/src/cli.js +98 -12
- package/dist/src/cli.js.map +1 -1
- package/dist/src/common-auth-embedded/claustrum/consumer.d.ts +33 -3
- package/dist/src/common-auth-embedded/claustrum/consumer.js +96 -1
- package/dist/src/common-auth-embedded/claustrum/custody.d.ts +4 -1
- package/dist/src/common-auth-embedded/claustrum/enrollment.d.ts +6 -1
- package/dist/src/common-auth-embedded/claustrum/enrollment.js +6 -1
- package/dist/src/common-auth-embedded/claustrum/index.d.ts +2 -1
- package/dist/src/common-auth-embedded/claustrum/index.js +5 -3
- package/dist/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
- package/dist/src/common-auth-embedded/claustrum/insula.js +152 -0
- package/dist/src/common-auth-embedded/claustrum/roster.d.ts +13 -0
- package/dist/src/common-auth-embedded/claustrum/roster.js +33 -3
- package/dist/src/common-auth-embedded/fs/refresh-file-lock.js +20 -11
- package/dist/src/common-auth-embedded/quota/codec.d.ts +2 -0
- package/dist/src/common-auth-embedded/quota/codec.js +2 -1
- package/dist/src/common-auth-embedded/quota/format.d.ts +26 -0
- package/dist/src/common-auth-embedded/quota/format.js +78 -42
- package/dist/src/common-auth-embedded/quota/index.d.ts +4 -4
- package/dist/src/common-auth-embedded/quota/index.js +2 -2
- package/dist/src/common-auth-embedded/quota/map.d.ts +11 -0
- package/dist/src/common-auth-embedded/quota/map.js +36 -1
- package/dist/src/common-auth-embedded/quota/merge.d.ts +3 -1
- package/dist/src/common-auth-embedded/quota/merge.js +21 -5
- package/dist/src/common-auth-embedded/quota/projection.d.ts +2 -1
- package/dist/src/common-auth-embedded/quota/projection.js +3 -1
- package/dist/src/common-auth-embedded/setup/command-runner.js +49 -0
- package/dist/src/common-auth-embedded/setup/command.d.ts +3 -0
- package/dist/src/common-auth-embedded/setup/command.js +215 -0
- package/dist/src/common-auth-embedded/setup/config-write.js +60 -0
- package/dist/src/common-auth-embedded/setup/detect.d.ts +6 -0
- package/dist/src/common-auth-embedded/setup/detect.js +224 -0
- package/dist/src/common-auth-embedded/setup/enroll.js +70 -0
- package/dist/src/common-auth-embedded/setup/index.d.ts +5 -0
- package/dist/src/common-auth-embedded/setup/index.js +4 -0
- package/dist/src/common-auth-embedded/setup/paths.js +33 -0
- package/dist/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
- package/dist/src/common-auth-embedded/setup/process-fence.js +270 -0
- package/dist/src/common-auth-embedded/setup/prompts.js +26 -0
- package/dist/src/common-auth-embedded/setup/register.d.ts +11 -0
- package/dist/src/common-auth-embedded/setup/register.js +130 -0
- package/dist/src/common-auth-embedded/setup/types.d.ts +136 -0
- package/dist/src/common-auth-embedded/source-output.json +228 -80
- package/dist/src/common-auth-embedded/store/schema.d.ts +2 -0
- package/dist/src/common-auth-embedded/store/schema.js +3 -2
- package/dist/src/ga/rpc/protocol.d.ts +4 -7
- package/dist/src/ga/rpc/protocol.d.ts.map +1 -1
- package/dist/src/ga/rpc/protocol.js +5 -13
- package/dist/src/ga/rpc/protocol.js.map +1 -1
- package/dist/src/ga/server/auth.d.ts +8 -3
- package/dist/src/ga/server/auth.d.ts.map +1 -1
- package/dist/src/ga/server/auth.js +25 -9
- package/dist/src/ga/server/auth.js.map +1 -1
- package/dist/src/ga/server/index.d.ts +39 -12
- package/dist/src/ga/server/index.d.ts.map +1 -1
- package/dist/src/ga/server/index.js +214 -53
- package/dist/src/ga/server/index.js.map +1 -1
- package/dist/src/ga/server/pool-login.d.ts +22 -0
- package/dist/src/ga/server/pool-login.d.ts.map +1 -0
- package/dist/src/ga/server/pool-login.js +150 -0
- package/dist/src/ga/server/pool-login.js.map +1 -0
- package/dist/src/ga/tui/host-ga.d.ts +2 -5
- package/dist/src/ga/tui/host-ga.d.ts.map +1 -1
- package/dist/src/ga/tui/host-ga.js +17 -49
- package/dist/src/ga/tui/host-ga.js.map +1 -1
- package/dist/src/plugin/accounts.d.ts +1 -1
- package/dist/src/plugin/accounts.d.ts.map +1 -1
- package/dist/src/plugin/accounts.js +1 -0
- package/dist/src/plugin/accounts.js.map +1 -1
- package/dist/src/plugin/background-vault-quota-refresh.d.ts +2 -0
- package/dist/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
- package/dist/src/plugin/background-vault-quota-refresh.js +125 -10
- package/dist/src/plugin/background-vault-quota-refresh.js.map +1 -1
- package/dist/src/plugin/command-apply.d.ts +2 -2
- package/dist/src/plugin/command-apply.d.ts.map +1 -1
- package/dist/src/plugin/command-apply.js +3 -10
- package/dist/src/plugin/command-apply.js.map +1 -1
- package/dist/src/plugin/commands.d.ts +1 -0
- package/dist/src/plugin/commands.d.ts.map +1 -1
- package/dist/src/plugin/commands.js +2 -2
- package/dist/src/plugin/commands.js.map +1 -1
- package/dist/src/plugin/config/operator-settings-schema.d.ts +0 -4
- package/dist/src/plugin/config/operator-settings-schema.d.ts.map +1 -1
- package/dist/src/plugin/config/operator-settings-schema.js +0 -5
- package/dist/src/plugin/config/operator-settings-schema.js.map +1 -1
- package/dist/src/plugin/config/schema.d.ts +0 -7
- package/dist/src/plugin/config/schema.d.ts.map +1 -1
- package/dist/src/plugin/config/schema.js +0 -43
- package/dist/src/plugin/config/schema.js.map +1 -1
- package/dist/src/plugin/config/writer.d.ts +1 -1
- package/dist/src/plugin/config/writer.js +1 -1
- package/dist/src/plugin/fetch/retry-state.d.ts +19 -3
- package/dist/src/plugin/fetch/retry-state.d.ts.map +1 -1
- package/dist/src/plugin/fetch/retry-state.js +0 -6
- package/dist/src/plugin/fetch/retry-state.js.map +1 -1
- package/dist/src/plugin/fetch-interceptor.d.ts.map +1 -1
- package/dist/src/plugin/fetch-interceptor.js +0 -3
- package/dist/src/plugin/fetch-interceptor.js.map +1 -1
- package/dist/src/plugin/fetch-routing.d.ts +0 -16
- package/dist/src/plugin/fetch-routing.d.ts.map +1 -1
- package/dist/src/plugin/fetch-routing.js +0 -49
- package/dist/src/plugin/fetch-routing.js.map +1 -1
- package/dist/src/plugin/ga-location-services.d.ts +14 -9
- package/dist/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/src/plugin/ga-location-services.js +120 -40
- package/dist/src/plugin/ga-location-services.js.map +1 -1
- package/dist/src/plugin/google-origin.d.ts +7 -0
- package/dist/src/plugin/google-origin.d.ts.map +1 -0
- package/dist/src/plugin/google-origin.js +14 -0
- package/dist/src/plugin/google-origin.js.map +1 -0
- package/dist/src/plugin/index.d.ts.map +1 -1
- package/dist/src/plugin/index.js +15 -4
- package/dist/src/plugin/index.js.map +1 -1
- package/dist/src/plugin/oauth-methods.d.ts.map +1 -1
- package/dist/src/plugin/oauth-methods.js +0 -33
- package/dist/src/plugin/oauth-methods.js.map +1 -1
- package/dist/src/plugin/operator-settings.d.ts +1 -1
- package/dist/src/plugin/operator-settings.d.ts.map +1 -1
- package/dist/src/plugin/operator-settings.js +1 -8
- package/dist/src/plugin/operator-settings.js.map +1 -1
- package/dist/src/plugin/quota.d.ts +11 -7
- package/dist/src/plugin/quota.d.ts.map +1 -1
- package/dist/src/plugin/quota.js +128 -102
- package/dist/src/plugin/quota.js.map +1 -1
- package/dist/src/plugin/request.d.ts +5 -3
- package/dist/src/plugin/request.d.ts.map +1 -1
- package/dist/src/plugin/request.js +87 -168
- package/dist/src/plugin/request.js.map +1 -1
- package/dist/src/plugin/server.d.ts.map +1 -1
- package/dist/src/plugin/server.js +60 -53
- package/dist/src/plugin/server.js.map +1 -1
- package/dist/src/plugin/shared/advisory-repository.d.ts +20 -0
- package/dist/src/plugin/shared/advisory-repository.d.ts.map +1 -0
- package/dist/src/plugin/shared/advisory-repository.js +91 -0
- package/dist/src/plugin/shared/advisory-repository.js.map +1 -0
- package/dist/src/plugin/shared/request-services.d.ts +19 -25
- package/dist/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/src/plugin/shared/request-services.js +105 -188
- package/dist/src/plugin/shared/request-services.js.map +1 -1
- package/dist/src/plugin/shared/runtime.js +4 -2
- package/dist/src/plugin/shared/runtime.js.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts +4 -1
- package/dist/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/src/plugin/shared/vault-request-credentials.js +41 -7
- package/dist/src/plugin/shared/vault-request-credentials.js.map +1 -1
- package/dist/src/plugin/storage.d.ts +2 -2
- package/dist/src/plugin/storage.d.ts.map +1 -1
- package/dist/src/plugin/storage.js.map +1 -1
- package/dist/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/src/plugin/vault-custody.js +147 -35
- package/dist/src/plugin/vault-custody.js.map +1 -1
- package/dist/src/plugin/vault-quota-outcome.d.ts +19 -0
- package/dist/src/plugin/vault-quota-outcome.d.ts.map +1 -0
- package/dist/src/plugin/vault-quota-outcome.js +47 -0
- package/dist/src/plugin/vault-quota-outcome.js.map +1 -0
- package/dist/src/quota-presentation.d.ts +29 -1
- package/dist/src/quota-presentation.d.ts.map +1 -1
- package/dist/src/quota-presentation.js +52 -17
- package/dist/src/quota-presentation.js.map +1 -1
- package/dist/src/setup.d.ts +15 -0
- package/dist/src/setup.d.ts.map +1 -0
- package/dist/src/setup.js +320 -0
- package/dist/src/setup.js.map +1 -0
- package/dist/src/sidebar-projection.d.ts +1 -1
- package/dist/src/sidebar-projection.d.ts.map +1 -1
- package/dist/src/sidebar-state.d.ts +1 -1
- package/dist/src/sidebar-state.d.ts.map +1 -1
- package/dist/src/sidebar-state.js +19 -1
- package/dist/src/sidebar-state.js.map +1 -1
- package/dist/src/tui.d.ts.map +1 -1
- package/dist/src/tui.js +205 -110
- package/dist/src/tui.js.map +1 -1
- package/dist/tui-build-map.json +37 -37
- package/dist/tui-ga-build-map.json +33 -33
- package/dist/types/src/auth-method-labels.d.ts +3 -0
- package/dist/types/src/auth-method-labels.d.ts.map +1 -0
- package/dist/types/src/cli.d.ts +3 -1
- package/dist/types/src/cli.d.ts.map +1 -1
- package/dist/types/src/common-auth-embedded/auth-menu/terminal.d.ts +43 -0
- package/dist/types/src/common-auth-embedded/claustrum/consumer.d.ts +132 -0
- package/dist/types/src/common-auth-embedded/claustrum/custody.d.ts +178 -0
- package/dist/types/src/common-auth-embedded/claustrum/enrollment.d.ts +164 -0
- package/dist/types/src/common-auth-embedded/claustrum/errors.d.ts +16 -0
- package/dist/types/src/common-auth-embedded/claustrum/host-slot.d.ts +39 -0
- package/dist/types/src/common-auth-embedded/claustrum/index.d.ts +19 -0
- package/dist/types/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
- package/dist/types/src/common-auth-embedded/claustrum/interlock.d.ts +27 -0
- package/dist/types/src/common-auth-embedded/claustrum/roster.d.ts +221 -0
- package/dist/types/src/common-auth-embedded/opencode2/errors.d.ts +25 -0
- package/dist/types/src/common-auth-embedded/opencode2/index.d.ts +8 -0
- package/dist/types/src/common-auth-embedded/opencode2/install.d.ts +55 -0
- package/dist/types/src/common-auth-embedded/opencode2/integration.d.ts +112 -0
- package/dist/types/src/common-auth-embedded/opencode2/sse.d.ts +12 -0
- package/dist/types/src/common-auth-embedded/opencode2/types.d.ts +413 -0
- package/dist/types/src/common-auth-embedded/quota/codec.d.ts +2 -0
- package/dist/types/src/common-auth-embedded/quota/format.d.ts +26 -0
- package/dist/types/src/common-auth-embedded/quota/index.d.ts +4 -4
- package/dist/types/src/common-auth-embedded/quota/map.d.ts +11 -0
- package/dist/types/src/common-auth-embedded/quota/merge.d.ts +3 -1
- package/dist/types/src/common-auth-embedded/quota/projection.d.ts +2 -1
- package/dist/types/src/common-auth-embedded/routing/admission.d.ts +93 -0
- package/dist/types/src/common-auth-embedded/routing/index.d.ts +8 -0
- package/dist/types/src/common-auth-embedded/routing/ordered.d.ts +47 -0
- package/dist/types/src/common-auth-embedded/routing/pins.d.ts +22 -0
- package/dist/types/src/common-auth-embedded/routing/sticky.d.ts +158 -0
- package/dist/types/src/common-auth-embedded/setup/command.d.ts +3 -0
- package/dist/types/src/common-auth-embedded/setup/detect.d.ts +6 -0
- package/dist/types/src/common-auth-embedded/setup/index.d.ts +5 -0
- package/dist/types/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
- package/dist/types/src/common-auth-embedded/setup/register.d.ts +11 -0
- package/dist/types/src/common-auth-embedded/setup/types.d.ts +136 -0
- package/dist/types/src/common-auth-embedded/store/schema.d.ts +2 -0
- package/dist/types/src/ga/rpc/protocol.d.ts +4 -7
- package/dist/types/src/ga/rpc/protocol.d.ts.map +1 -1
- package/dist/types/src/ga/server/auth.d.ts +8 -3
- package/dist/types/src/ga/server/auth.d.ts.map +1 -1
- package/dist/types/src/ga/server/index.d.ts +39 -12
- package/dist/types/src/ga/server/index.d.ts.map +1 -1
- package/dist/types/src/ga/server/pool-login.d.ts +22 -0
- package/dist/types/src/ga/server/pool-login.d.ts.map +1 -0
- package/dist/types/src/plugin/accounts.d.ts +1 -1
- package/dist/types/src/plugin/accounts.d.ts.map +1 -1
- package/dist/types/src/plugin/background-vault-quota-refresh.d.ts +2 -0
- package/dist/types/src/plugin/background-vault-quota-refresh.d.ts.map +1 -1
- package/dist/types/src/plugin/command-apply.d.ts +2 -2
- package/dist/types/src/plugin/command-apply.d.ts.map +1 -1
- package/dist/types/src/plugin/commands.d.ts +1 -0
- package/dist/types/src/plugin/commands.d.ts.map +1 -1
- package/dist/types/src/plugin/config/operator-settings-schema.d.ts +0 -4
- package/dist/types/src/plugin/config/operator-settings-schema.d.ts.map +1 -1
- package/dist/types/src/plugin/config/schema.d.ts +0 -7
- package/dist/types/src/plugin/config/schema.d.ts.map +1 -1
- package/dist/types/src/plugin/config/writer.d.ts +1 -1
- package/dist/types/src/plugin/fetch/retry-state.d.ts +19 -3
- package/dist/types/src/plugin/fetch/retry-state.d.ts.map +1 -1
- package/dist/types/src/plugin/fetch-interceptor.d.ts.map +1 -1
- package/dist/types/src/plugin/fetch-routing.d.ts +0 -16
- package/dist/types/src/plugin/fetch-routing.d.ts.map +1 -1
- package/dist/types/src/plugin/ga-location-services.d.ts +14 -9
- package/dist/types/src/plugin/ga-location-services.d.ts.map +1 -1
- package/dist/types/src/plugin/google-origin.d.ts +7 -0
- package/dist/types/src/plugin/google-origin.d.ts.map +1 -0
- package/dist/types/src/plugin/index.d.ts.map +1 -1
- package/dist/types/src/plugin/oauth-methods.d.ts.map +1 -1
- package/dist/types/src/plugin/operator-settings.d.ts +1 -1
- package/dist/types/src/plugin/operator-settings.d.ts.map +1 -1
- package/dist/types/src/plugin/quota.d.ts +11 -7
- package/dist/types/src/plugin/quota.d.ts.map +1 -1
- package/dist/types/src/plugin/request.d.ts +5 -3
- package/dist/types/src/plugin/request.d.ts.map +1 -1
- package/dist/types/src/plugin/server.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/advisory-repository.d.ts +20 -0
- package/dist/types/src/plugin/shared/advisory-repository.d.ts.map +1 -0
- package/dist/types/src/plugin/shared/request-services.d.ts +19 -25
- package/dist/types/src/plugin/shared/request-services.d.ts.map +1 -1
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts +4 -1
- package/dist/types/src/plugin/shared/vault-request-credentials.d.ts.map +1 -1
- package/dist/types/src/plugin/storage.d.ts +2 -2
- package/dist/types/src/plugin/storage.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-custody.d.ts.map +1 -1
- package/dist/types/src/plugin/vault-quota-outcome.d.ts +19 -0
- package/dist/types/src/plugin/vault-quota-outcome.d.ts.map +1 -0
- package/dist/types/src/setup.d.ts +15 -0
- package/dist/types/src/setup.d.ts.map +1 -0
- package/dist/types/src/sidebar-state.d.ts +1 -1
- package/dist/types/src/sidebar-state.d.ts.map +1 -1
- package/package.json +5 -4
- package/src/common-auth-embedded/claustrum/consumer.d.ts +33 -3
- package/src/common-auth-embedded/claustrum/consumer.js +96 -1
- package/src/common-auth-embedded/claustrum/custody.d.ts +4 -1
- package/src/common-auth-embedded/claustrum/enrollment.d.ts +6 -1
- package/src/common-auth-embedded/claustrum/enrollment.js +6 -1
- package/src/common-auth-embedded/claustrum/index.d.ts +2 -1
- package/src/common-auth-embedded/claustrum/index.js +5 -3
- package/src/common-auth-embedded/claustrum/insula.d.ts +69 -0
- package/src/common-auth-embedded/claustrum/insula.js +152 -0
- package/src/common-auth-embedded/claustrum/roster.d.ts +13 -0
- package/src/common-auth-embedded/claustrum/roster.js +33 -3
- package/src/common-auth-embedded/fs/refresh-file-lock.js +20 -11
- package/src/common-auth-embedded/quota/codec.d.ts +2 -0
- package/src/common-auth-embedded/quota/codec.js +2 -1
- package/src/common-auth-embedded/quota/format.d.ts +26 -0
- package/src/common-auth-embedded/quota/format.js +78 -42
- package/src/common-auth-embedded/quota/index.d.ts +4 -4
- package/src/common-auth-embedded/quota/index.js +2 -2
- package/src/common-auth-embedded/quota/map.d.ts +11 -0
- package/src/common-auth-embedded/quota/map.js +36 -1
- package/src/common-auth-embedded/quota/merge.d.ts +3 -1
- package/src/common-auth-embedded/quota/merge.js +21 -5
- package/src/common-auth-embedded/quota/projection.d.ts +2 -1
- package/src/common-auth-embedded/quota/projection.js +3 -1
- package/src/common-auth-embedded/setup/command-runner.js +49 -0
- package/src/common-auth-embedded/setup/command.d.ts +3 -0
- package/src/common-auth-embedded/setup/command.js +215 -0
- package/src/common-auth-embedded/setup/config-write.js +60 -0
- package/src/common-auth-embedded/setup/detect.d.ts +6 -0
- package/src/common-auth-embedded/setup/detect.js +224 -0
- package/src/common-auth-embedded/setup/enroll.js +70 -0
- package/src/common-auth-embedded/setup/index.d.ts +5 -0
- package/src/common-auth-embedded/setup/index.js +4 -0
- package/src/common-auth-embedded/setup/paths.js +33 -0
- package/src/common-auth-embedded/setup/process-fence.d.ts +43 -0
- package/src/common-auth-embedded/setup/process-fence.js +270 -0
- package/src/common-auth-embedded/setup/prompts.js +26 -0
- package/src/common-auth-embedded/setup/register.d.ts +11 -0
- package/src/common-auth-embedded/setup/register.js +130 -0
- package/src/common-auth-embedded/setup/types.d.ts +136 -0
- package/src/common-auth-embedded/source-output.json +228 -80
- package/src/common-auth-embedded/store/schema.d.ts +2 -0
- package/src/common-auth-embedded/store/schema.js +3 -2
- package/src/sidebar-state.ts +19 -2
- package/src/tui-compiled/common-auth-embedded/quota/codec.js +2 -1
- package/src/tui-compiled/common-auth-embedded/quota/format.js +78 -42
- package/src/tui-compiled/common-auth-embedded/quota/index.js +2 -2
- package/src/tui-compiled/common-auth-embedded/quota/map.js +36 -1
- package/src/tui-compiled/common-auth-embedded/quota/merge.js +21 -5
- package/src/tui-compiled/common-auth-embedded/quota/projection.js +3 -1
- package/src/tui-compiled/quota-presentation.js +42 -9
- package/src/tui-compiled/sidebar-state.js +15 -1
- package/src/tui-compiled/tui.js +516 -334
- package/src/tui-ga-compiled/host-ga.js +11 -38
- package/src/tui-ga-compiled/shared/1ff34afa7c42d196-projection.js +3 -1
- package/src/tui-ga-compiled/shared/77138df80c7ae006-map.js +36 -1
- package/src/tui-ga-compiled/shared/98cc0c186c46c42d-quota-presentation.js +42 -9
- package/src/tui-ga-compiled/shared/aef2402f8fc342f0-format.js +78 -42
- package/src/tui-ga-compiled/shared/bf17cbee28e58197-index.js +2 -2
- package/src/tui-ga-compiled/shared/ca21dc417b36dc5d-codec.js +2 -1
- package/src/tui-ga-compiled/shared/ecc214300932dfb6-merge.js +21 -5
- package/src/tui-ga-raw/host-ga.tsx +31 -62
- package/src/tui-ga-raw/shared/1ff34afa7c42d196-projection.js +3 -1
- package/src/tui-ga-raw/shared/77138df80c7ae006-map.js +36 -1
- package/src/tui-ga-raw/shared/98cc0c186c46c42d-quota-presentation.js +42 -9
- package/src/tui-ga-raw/shared/aef2402f8fc342f0-format.js +78 -42
- package/src/tui-ga-raw/shared/bf17cbee28e58197-index.js +2 -2
- package/src/tui-ga-raw/shared/ca21dc417b36dc5d-codec.js +2 -1
- package/src/tui-ga-raw/shared/ecc214300932dfb6-merge.js +21 -5
- package/src/tui-raw/common-auth-embedded/quota/codec.js +2 -1
- package/src/tui-raw/common-auth-embedded/quota/format.js +78 -42
- package/src/tui-raw/common-auth-embedded/quota/index.js +2 -2
- package/src/tui-raw/common-auth-embedded/quota/map.js +36 -1
- package/src/tui-raw/common-auth-embedded/quota/merge.js +21 -5
- package/src/tui-raw/common-auth-embedded/quota/projection.js +3 -1
- package/src/tui-raw/quota-presentation.js +42 -9
- package/src/tui-raw/sidebar-state.js +15 -1
- package/src/tui-raw/tui.tsx +423 -218
- package/src/tui.tsx +423 -218
- package/dist/src/tui/vault-setup.d.ts +0 -98
- package/dist/src/tui/vault-setup.d.ts.map +0 -1
- package/dist/src/tui/vault-setup.js +0 -198
- package/dist/src/tui/vault-setup.js.map +0 -1
- package/dist/types/src/plugin/transform/model-resolver.d.ts +0 -2
- package/dist/types/src/plugin/transform/model-resolver.d.ts.map +0 -1
- package/dist/types/src/quota-presentation.d.ts +0 -18
- package/dist/types/src/quota-presentation.d.ts.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OpenCodeGeneration, SetupIO, SetupPlugin } from './types.js';
|
|
2
|
+
export interface PlannedWrite {
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
changed: boolean;
|
|
6
|
+
}
|
|
7
|
+
/** Edit only array entries so unrelated JSONC text, including comments, survives. */
|
|
8
|
+
export declare function updatePluginConfig(text: string, key: 'plugin' | 'plugins', pkg: string, version: string): string;
|
|
9
|
+
export declare function planOpenCodeRegistration(plugin: SetupPlugin, generation: OpenCodeGeneration, io?: SetupIO): PlannedWrite[];
|
|
10
|
+
export declare function registerOpenCode(writes: readonly PlannedWrite[], beforeWrite?: () => Promise<void>): Promise<void>;
|
|
11
|
+
export declare function registerPi(plugin: SetupPlugin, executable: string, io?: SetupIO): Promise<void>;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { applyEdits, createScanner, findNodeAtLocation, modify, parse, parseTree, } from 'jsonc-parser';
|
|
2
|
+
import { defaultCommandRunner, runResolvedCommand } from './command-runner.js';
|
|
3
|
+
import { writeHostConfigAtomic } from './config-write.js';
|
|
4
|
+
import { defaultSetupFileSystem } from './detect.js';
|
|
5
|
+
import { setupPaths } from './paths.js';
|
|
6
|
+
function packageOf(value) {
|
|
7
|
+
const entry = typeof value === 'string'
|
|
8
|
+
? value
|
|
9
|
+
: Array.isArray(value)
|
|
10
|
+
? value[0]
|
|
11
|
+
: value && typeof value === 'object' && 'package' in value
|
|
12
|
+
? value.package
|
|
13
|
+
: null;
|
|
14
|
+
if (typeof entry !== 'string')
|
|
15
|
+
return null;
|
|
16
|
+
const at = entry.indexOf('@', entry.startsWith('@') ? 1 : 0);
|
|
17
|
+
return at < 0 ? entry : entry.slice(0, at);
|
|
18
|
+
}
|
|
19
|
+
function removeArrayEntry(text, key, index) {
|
|
20
|
+
const tree = parseTree(text);
|
|
21
|
+
const array = tree && findNodeAtLocation(tree, [key]);
|
|
22
|
+
const nodes = array?.children ?? [];
|
|
23
|
+
const node = nodes[index];
|
|
24
|
+
if (!node || !array)
|
|
25
|
+
throw new Error('Invalid plugin array edit.');
|
|
26
|
+
const edits = [{ offset: node.offset, length: node.length, content: '' }];
|
|
27
|
+
const removeComma = (start, end) => {
|
|
28
|
+
const scanner = createScanner(text.slice(start, end), true);
|
|
29
|
+
scanner.scan();
|
|
30
|
+
if (text[start + scanner.getTokenOffset()] === ',')
|
|
31
|
+
edits.push({
|
|
32
|
+
offset: start + scanner.getTokenOffset(),
|
|
33
|
+
length: 1,
|
|
34
|
+
content: '',
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
// Delete punctuation separately so comments beside other entries are not removed.
|
|
38
|
+
if (index === nodes.length - 1) {
|
|
39
|
+
const previous = nodes[index - 1];
|
|
40
|
+
if (previous)
|
|
41
|
+
removeComma(previous.offset + previous.length, node.offset);
|
|
42
|
+
removeComma(node.offset + node.length, array.offset + array.length - 1);
|
|
43
|
+
}
|
|
44
|
+
else
|
|
45
|
+
removeComma(node.offset + node.length, nodes[index + 1]?.offset ?? node.offset + node.length);
|
|
46
|
+
return applyEdits(text, edits);
|
|
47
|
+
}
|
|
48
|
+
/** Edit only array entries so unrelated JSONC text, including comments, survives. */
|
|
49
|
+
export function updatePluginConfig(text, key, pkg, version) {
|
|
50
|
+
const errors = [];
|
|
51
|
+
const value = parse(text, errors, { allowTrailingComma: true });
|
|
52
|
+
if (errors.length ||
|
|
53
|
+
!value ||
|
|
54
|
+
typeof value !== 'object' ||
|
|
55
|
+
Array.isArray(value))
|
|
56
|
+
throw new Error('Invalid OpenCode config; refusing to overwrite it.');
|
|
57
|
+
const options = {
|
|
58
|
+
formattingOptions: {
|
|
59
|
+
insertSpaces: !/^\t+/m.test(text),
|
|
60
|
+
tabSize: /^([ ]+)"/m.exec(text)?.[1]?.length ?? 2,
|
|
61
|
+
eol: text.includes('\r\n') ? '\r\n' : '\n',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
let output = text;
|
|
65
|
+
const array = value[key];
|
|
66
|
+
if (array !== undefined && !Array.isArray(array))
|
|
67
|
+
throw new Error(`OpenCode ${key} must be an array.`);
|
|
68
|
+
const entries = Array.isArray(array) ? [...array] : [];
|
|
69
|
+
const matches = entries.flatMap((entry, index) => packageOf(entry) === pkg ? [index] : []);
|
|
70
|
+
const entry = `${pkg}@${version}`;
|
|
71
|
+
if (!matches.length) {
|
|
72
|
+
output = applyEdits(output, modify(output, array === undefined ? [key] : [key, entries.length], array === undefined ? [entry] : entry, options));
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
const first = matches[0];
|
|
76
|
+
const previous = entries[first];
|
|
77
|
+
// Preserve options in OpenCode's [package, options] and { package, options } entries.
|
|
78
|
+
const replacement = Array.isArray(previous)
|
|
79
|
+
? [entry, ...previous.slice(1)]
|
|
80
|
+
: previous && typeof previous === 'object'
|
|
81
|
+
? { ...previous, package: entry }
|
|
82
|
+
: entry;
|
|
83
|
+
if (JSON.stringify(previous) !== JSON.stringify(replacement))
|
|
84
|
+
output = applyEdits(output, modify(output, [key, first], replacement, options));
|
|
85
|
+
for (const index of matches.slice(1).reverse())
|
|
86
|
+
output = removeArrayEntry(output, key, index);
|
|
87
|
+
}
|
|
88
|
+
const other = key === 'plugin' ? 'plugins' : 'plugin';
|
|
89
|
+
if (Array.isArray(value[other])) {
|
|
90
|
+
const otherEntries = value[other];
|
|
91
|
+
for (let index = otherEntries.length - 1; index >= 0; index--) {
|
|
92
|
+
if (packageOf(otherEntries[index]) === pkg)
|
|
93
|
+
output = removeArrayEntry(output, other, index);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return output;
|
|
97
|
+
}
|
|
98
|
+
export function planOpenCodeRegistration(plugin, generation, io = {}) {
|
|
99
|
+
const fs = io.fs ?? defaultSetupFileSystem;
|
|
100
|
+
const { path, opencode } = setupPaths(io);
|
|
101
|
+
const key = generation === '2' ? 'plugins' : 'plugin';
|
|
102
|
+
const names = generation === '2' ? ['opencode'] : ['opencode', 'tui'];
|
|
103
|
+
return names.map((name) => {
|
|
104
|
+
const jsonc = path.join(opencode, `${name}.jsonc`);
|
|
105
|
+
const json = path.join(opencode, `${name}.json`);
|
|
106
|
+
const file = fs.exists(jsonc) ? jsonc : fs.exists(json) ? json : jsonc;
|
|
107
|
+
const exists = fs.exists(file);
|
|
108
|
+
const before = exists
|
|
109
|
+
? fs.readText(file)
|
|
110
|
+
: `${JSON.stringify({ $schema: `https://opencode.ai/${name === 'tui' ? 'tui' : 'config'}.json` }, null, 2)}\n`;
|
|
111
|
+
const content = updatePluginConfig(before, key, plugin.packages.opencode, plugin.version);
|
|
112
|
+
return { path: file, content, changed: !exists || content !== before };
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
export async function registerOpenCode(writes, beforeWrite) {
|
|
116
|
+
for (const write of writes) {
|
|
117
|
+
if (!write.changed)
|
|
118
|
+
continue;
|
|
119
|
+
await beforeWrite?.();
|
|
120
|
+
await writeHostConfigAtomic(write.path, write.content, {
|
|
121
|
+
beforeRename: beforeWrite,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
export async function registerPi(plugin, executable, io = {}) {
|
|
126
|
+
const { platform, env } = setupPaths(io);
|
|
127
|
+
const result = await runResolvedCommand(io.runner ?? defaultCommandRunner, platform, executable, ['install', `npm:${plugin.packages.pi}@${plugin.version}`], env);
|
|
128
|
+
if (result.exitCode !== 0)
|
|
129
|
+
throw new Error('Pi install failed; run pi install after checking your npm connection.');
|
|
130
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { MenuTerminal } from '../auth-menu/terminal.js';
|
|
2
|
+
import type { ClaustrumEnrollmentConnection, hostEnrollmentPaths } from '../claustrum/index.js';
|
|
3
|
+
export type SetupHost = 'opencode' | 'pi';
|
|
4
|
+
export type OpenCodeGeneration = '1' | '2' | 'both';
|
|
5
|
+
export type SetupEnvironment = Record<string, string | undefined>;
|
|
6
|
+
/**
|
|
7
|
+
* What setup decided before calling a plugin callback. The OpenCode generation
|
|
8
|
+
* is the one being registered, after `--opencode` or the interactive choice, so
|
|
9
|
+
* a plugin can sign in the way that generation expects (OpenCode 2 does not
|
|
10
|
+
* read OpenCode 1's login file).
|
|
11
|
+
*/
|
|
12
|
+
export interface SetupCallbackContext {
|
|
13
|
+
opencodeGeneration: OpenCodeGeneration;
|
|
14
|
+
mode: 'local' | 'claustrum';
|
|
15
|
+
/**
|
|
16
|
+
* Every host this run sets up, in order, so the first `beforeSignIn` can
|
|
17
|
+
* check conditions across all of them (for example that their storage paths
|
|
18
|
+
* do not overlap) before any host is changed.
|
|
19
|
+
*/
|
|
20
|
+
hosts: readonly SetupHost[];
|
|
21
|
+
/**
|
|
22
|
+
* Pi's agent folder, resolved the way Pi itself does (`PI_CODING_AGENT_DIR`,
|
|
23
|
+
* with `~` expanded, else `~/.pi/agent`). Pi's own `auth.json` lives here;
|
|
24
|
+
* use it rather than a plugin path setting, which can point elsewhere.
|
|
25
|
+
*/
|
|
26
|
+
piAgentDir: string;
|
|
27
|
+
}
|
|
28
|
+
/** Provider login, credential migration and vault activation stay in plugin callbacks. */
|
|
29
|
+
export interface SetupPlugin {
|
|
30
|
+
packages: {
|
|
31
|
+
opencode: string;
|
|
32
|
+
pi: string;
|
|
33
|
+
};
|
|
34
|
+
version: string;
|
|
35
|
+
displayName: string;
|
|
36
|
+
slashCommand: string;
|
|
37
|
+
vault: {
|
|
38
|
+
connectionFile: string;
|
|
39
|
+
hosts: Record<SetupHost, {
|
|
40
|
+
name: string;
|
|
41
|
+
paths: Parameters<typeof hostEnrollmentPaths>[0];
|
|
42
|
+
}>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Runs for each host on a real run after the host, mode and generation are
|
|
46
|
+
* chosen and before the vault ceremony or `signInLocal`, while nothing has
|
|
47
|
+
* changed yet. Rejecting stops setup for that host, so a plugin can ask for
|
|
48
|
+
* consent or check preconditions before any credential or authority change.
|
|
49
|
+
*/
|
|
50
|
+
beforeSignIn?(host: SetupHost, context: SetupCallbackContext): Promise<void>;
|
|
51
|
+
signInLocal(host: SetupHost, context: SetupCallbackContext): Promise<void>;
|
|
52
|
+
migrate(host: SetupHost, context: SetupCallbackContext): Promise<void>;
|
|
53
|
+
/** Reject mixed local/vault credentials and activate provider-specific vault access before registration. */
|
|
54
|
+
beforeRegister?(host: SetupHost, mode: 'local' | 'claustrum', context: SetupCallbackContext): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
export interface CommandResult {
|
|
57
|
+
exitCode: number;
|
|
58
|
+
stdout: string;
|
|
59
|
+
stderr: string;
|
|
60
|
+
signal?: NodeJS.Signals | null;
|
|
61
|
+
timedOut?: boolean;
|
|
62
|
+
durationMs?: number;
|
|
63
|
+
}
|
|
64
|
+
export interface CommandRunner {
|
|
65
|
+
run(file: string, args: readonly string[], options?: {
|
|
66
|
+
env?: SetupEnvironment;
|
|
67
|
+
timeoutMs?: number;
|
|
68
|
+
windowsVerbatimArguments?: boolean;
|
|
69
|
+
}): Promise<CommandResult>;
|
|
70
|
+
}
|
|
71
|
+
export interface SetupFileSystem {
|
|
72
|
+
exists(path: string): boolean;
|
|
73
|
+
isDirectory(path: string): boolean;
|
|
74
|
+
isFile(path: string): boolean;
|
|
75
|
+
isExecutable(path: string): boolean;
|
|
76
|
+
readText(path: string): string;
|
|
77
|
+
realpath(path: string): string;
|
|
78
|
+
}
|
|
79
|
+
export interface ProcessFence {
|
|
80
|
+
listRunningHosts(env?: SetupEnvironment): Promise<Array<{
|
|
81
|
+
pid: number;
|
|
82
|
+
command: string;
|
|
83
|
+
}>>;
|
|
84
|
+
/**
|
|
85
|
+
* For a dry run, which must change nothing: the hosts found without starting
|
|
86
|
+
* any program that writes files. On Windows that skips the PowerShell query
|
|
87
|
+
* for Node and Bun command lines (PowerShell writes a startup cache into the
|
|
88
|
+
* user's profile), so Node or Bun processes are only counted. A fence without
|
|
89
|
+
* it is previewed with `listRunningHosts`.
|
|
90
|
+
*/
|
|
91
|
+
previewRunningHosts?(env?: SetupEnvironment): Promise<{
|
|
92
|
+
hosts: Array<{
|
|
93
|
+
pid: number;
|
|
94
|
+
command: string;
|
|
95
|
+
}>;
|
|
96
|
+
uncheckedRuntimes: number;
|
|
97
|
+
}>;
|
|
98
|
+
}
|
|
99
|
+
/** Defaults use the process terminal and environment; overrides are test seams. */
|
|
100
|
+
export interface SetupIO {
|
|
101
|
+
terminal?: MenuTerminal;
|
|
102
|
+
env?: SetupEnvironment;
|
|
103
|
+
platform?: string;
|
|
104
|
+
home?: string;
|
|
105
|
+
cwd?: string;
|
|
106
|
+
fs?: SetupFileSystem;
|
|
107
|
+
runner?: CommandRunner;
|
|
108
|
+
fence?: ProcessFence;
|
|
109
|
+
connect?: (options: {
|
|
110
|
+
connectionFile: string;
|
|
111
|
+
handshakeTimeoutMs: number;
|
|
112
|
+
}) => Promise<ClaustrumEnrollmentConnection>;
|
|
113
|
+
wait?: (ms: number) => Promise<void>;
|
|
114
|
+
}
|
|
115
|
+
export interface HostDetection {
|
|
116
|
+
installed: boolean;
|
|
117
|
+
executable: string | null;
|
|
118
|
+
version: string | null;
|
|
119
|
+
directory: string;
|
|
120
|
+
}
|
|
121
|
+
export interface SetupDetection {
|
|
122
|
+
opencode: HostDetection & {
|
|
123
|
+
generation: '1' | '2' | 'ambiguous';
|
|
124
|
+
};
|
|
125
|
+
pi: HostDetection;
|
|
126
|
+
claustrum: {
|
|
127
|
+
available: boolean;
|
|
128
|
+
executable: string | null;
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
export interface SetupResult {
|
|
132
|
+
hosts: SetupHost[];
|
|
133
|
+
dryRun: boolean;
|
|
134
|
+
mode: 'local' | 'claustrum';
|
|
135
|
+
detection: SetupDetection;
|
|
136
|
+
}
|