dsh-coding-subscription-oauth 0.6.0 → 0.6.2

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.
Files changed (122) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/CONTRIBUTING.md +0 -0
  3. package/INSTALL.md +9 -8
  4. package/LICENSE +0 -0
  5. package/NOTICE +0 -0
  6. package/README.de.md +7 -8
  7. package/README.es.md +7 -8
  8. package/README.fr.md +7 -8
  9. package/README.ja.md +7 -8
  10. package/README.ko.md +7 -8
  11. package/README.md +8 -9
  12. package/README.pt-BR.md +7 -8
  13. package/README.ru.md +7 -8
  14. package/README.zh-CN.md +8 -9
  15. package/compatibility/dsh-bom.json +17 -30
  16. package/cordis.patch.yml +0 -0
  17. package/docs/00-project-rules.md +0 -0
  18. package/docs/02-architecture.md +1 -1
  19. package/docs/02-architecture.zh-CN.md +1 -1
  20. package/lib/adapter.d.ts.map +1 -1
  21. package/lib/alias-adapter.d.ts +3 -1
  22. package/lib/alias-adapter.d.ts.map +1 -1
  23. package/lib/bin.js +3 -3
  24. package/lib/bin.js.map +1 -1
  25. package/lib/client.js +3 -3
  26. package/lib/client.js.map +4 -4
  27. package/lib/compatibility.d.ts +14 -14
  28. package/lib/dsh-host-adapter.d.ts.map +1 -1
  29. package/lib/index.d.ts +1 -1
  30. package/lib/index.d.ts.map +1 -1
  31. package/lib/index.js +109 -79
  32. package/lib/index.js.map +3 -3
  33. package/media/en/settings_accounts.png +0 -0
  34. package/media/en/settings_capabilities.png +0 -0
  35. package/media/en/settings_gateway.png +0 -0
  36. package/media/settings_accounts.png +0 -0
  37. package/media/settings_capabilities.png +0 -0
  38. package/media/settings_gateway.png +0 -0
  39. package/media/settings_overview.png +0 -0
  40. package/media/zh-CN/settings_accounts.png +0 -0
  41. package/media/zh-CN/settings_capabilities.png +0 -0
  42. package/media/zh-CN/settings_gateway.png +0 -0
  43. package/package.json +38 -38
  44. package/patches/dsh-agy@0.1.2.patch +0 -0
  45. package/scripts/release.mjs +0 -0
  46. package/scripts/smoke-deployed-routes.mjs +0 -0
  47. package/scripts/verify-deployed-catalog.mjs +0 -0
  48. package/src/adapter.ts +75 -14
  49. package/src/alias-adapter.ts +17 -23
  50. package/src/auth-routes.ts +0 -0
  51. package/src/auth.ts +0 -0
  52. package/src/bin.ts +0 -0
  53. package/src/capability-routes.ts +0 -0
  54. package/src/capability-runtime.ts +0 -0
  55. package/src/capability-settings.ts +0 -0
  56. package/src/capability-tools.ts +0 -0
  57. package/src/catalog.ts +0 -0
  58. package/src/client/GrokBuildSettings.tsx +0 -0
  59. package/src/client/api.ts +0 -0
  60. package/src/client/components/AboutTab.tsx +0 -0
  61. package/src/client/components/AccountsTab.tsx +0 -0
  62. package/src/client/components/Badge.tsx +0 -0
  63. package/src/client/components/CapabilitiesTab.tsx +0 -0
  64. package/src/client/components/CliPullPreview.tsx +0 -0
  65. package/src/client/components/CopyButton.tsx +0 -0
  66. package/src/client/components/GatewayTab.tsx +0 -0
  67. package/src/client/components/NoticeBanner.tsx +0 -0
  68. package/src/client/components/ProgressBar.tsx +0 -0
  69. package/src/client/components/ProviderCard.tsx +0 -0
  70. package/src/client/components/SettingsTabs.tsx +0 -0
  71. package/src/client/components/ToggleSwitch.tsx +0 -0
  72. package/src/client/constants.ts +1 -1
  73. package/src/client/display.ts +0 -0
  74. package/src/client/dshClientAdapter.ts +32 -14
  75. package/src/client/gatewaySnippets.ts +0 -0
  76. package/src/client/index.tsx +3 -3
  77. package/src/client/locales.ts +0 -0
  78. package/src/client/microStyles.ts +0 -0
  79. package/src/client/parsers.ts +0 -0
  80. package/src/client/styles.ts +0 -0
  81. package/src/client/types.ts +0 -0
  82. package/src/codex-http.ts +0 -0
  83. package/src/codex-images.ts +0 -0
  84. package/src/codex-model-capabilities.ts +0 -0
  85. package/src/codex-search.ts +0 -0
  86. package/src/codex-usage.ts +0 -0
  87. package/src/compatibility.ts +14 -14
  88. package/src/dsh-host-adapter.ts +8 -6
  89. package/src/gateway-anthropic-messages.ts +0 -0
  90. package/src/gateway-auth.ts +0 -0
  91. package/src/gateway-backend.ts +0 -0
  92. package/src/gateway-body.ts +0 -0
  93. package/src/gateway-config.ts +0 -0
  94. package/src/gateway-http.ts +0 -0
  95. package/src/gateway-openai-chat.ts +0 -0
  96. package/src/gateway-openai-responses.ts +0 -0
  97. package/src/gateway-parse.ts +0 -0
  98. package/src/gateway-protocol.ts +0 -0
  99. package/src/gateway-routes.ts +0 -0
  100. package/src/gateway.ts +0 -0
  101. package/src/grok-errors.ts +0 -0
  102. package/src/grok-imagine.ts +0 -0
  103. package/src/grok-import.ts +0 -0
  104. package/src/http-json.ts +0 -0
  105. package/src/ids.ts +0 -0
  106. package/src/imagine-routes.ts +0 -0
  107. package/src/index.ts +26 -39
  108. package/src/invariant.ts +0 -0
  109. package/src/kimi-errors.ts +0 -0
  110. package/src/media-store.ts +0 -0
  111. package/src/oauth-import-routes.ts +0 -0
  112. package/src/oauth-providers.ts +0 -0
  113. package/src/oauth-session.ts +0 -0
  114. package/src/oauth-sources.ts +0 -0
  115. package/src/oauth.ts +0 -0
  116. package/src/provider.ts +0 -0
  117. package/src/proxy.ts +0 -0
  118. package/src/redact.ts +0 -0
  119. package/src/session.ts +0 -0
  120. package/src/store.ts +0 -0
  121. package/src/web-origin.ts +0 -0
  122. package/src/web-routes.ts +0 -0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/gateway.ts CHANGED
File without changes
File without changes
File without changes
File without changes
package/src/http-json.ts CHANGED
File without changes
package/src/ids.ts CHANGED
File without changes
File without changes
package/src/index.ts CHANGED
@@ -240,7 +240,7 @@ function fixedCredentialRef(value: string): CredentialRef {
240
240
  export { IMAGINE_MEDIA_STORE_DIRNAME } from "./ids.ts";
241
241
 
242
242
  /** Optional host services are acquired inside the elected child fiber. */
243
- export const inject = [] as const;
243
+ export const inject = ["webServer"] as const;
244
244
 
245
245
  /** Plugin configuration; every field is optional. */
246
246
  export interface Config {
@@ -571,37 +571,27 @@ async function applyOwned(ctx: Context, config: Config): Promise<void> {
571
571
  return () => gateway.stop();
572
572
  }, "dsh-coding-subscription-oauth: local API gateway");
573
573
 
574
- let webRoutesMounted = false;
575
- const webRoutesFiber = ctx.inject(["webServer"], (webCtx) => {
576
- registerCapabilityRoutes(webCtx, {
577
- controller: capabilityRoutesController,
578
- usage: () => usage.read(),
579
- credentialInfo: () => describeImagineCredential(webCtx.get("credentials") as CredentialProvider | undefined),
580
- ownerRequestPolicy,
581
- });
582
- registerGatewayRoutes(webCtx, gateway, ownerRequestPolicy);
583
- registerCodingOAuthRoutes(webCtx, grok, subscriptions, ownerRequestPolicy, (accessMode) =>
584
- host.compatibility({
585
- accessMode,
586
- uiOwner: "standalone",
587
- diagnostics: ownerRequestPolicy.diagnostics(),
588
- }),
589
- );
590
- registerOAuthImportRoutes(webCtx, oauthImportDestinations(grok, subscriptions), {
591
- ownerRequestPolicy,
592
- onImported: (event) => {
593
- if (event.kind === "codex") invalidateOptionalAuthState();
594
- notifyCatalogChange();
595
- },
596
- });
597
- webRoutesMounted = true;
598
- webCtx.effect(
599
- () => () => {
600
- webRoutesMounted = false;
601
- },
602
- "dsh-coding-subscription-oauth: required web route readiness",
603
- );
604
- });
574
+ registerCapabilityRoutes(ctx, {
575
+ controller: capabilityRoutesController,
576
+ usage: () => usage.read(),
577
+ credentialInfo: () => describeImagineCredential(ctx.get("credentials") as CredentialProvider | undefined),
578
+ ownerRequestPolicy,
579
+ });
580
+ registerGatewayRoutes(ctx, gateway, ownerRequestPolicy);
581
+ registerCodingOAuthRoutes(ctx, grok, subscriptions, ownerRequestPolicy, (accessMode) =>
582
+ host.compatibility({
583
+ accessMode,
584
+ uiOwner: "standalone",
585
+ diagnostics: ownerRequestPolicy.diagnostics(),
586
+ }),
587
+ );
588
+ registerOAuthImportRoutes(ctx, oauthImportDestinations(grok, subscriptions), {
589
+ ownerRequestPolicy,
590
+ onImported: (event) => {
591
+ if (event.kind === "codex") invalidateOptionalAuthState();
592
+ notifyCatalogChange();
593
+ },
594
+ });
605
595
 
606
596
  const search = createCodexSearchProvider({
607
597
  auth: codexAuth,
@@ -690,13 +680,10 @@ async function applyOwned(ctx: Context, config: Config): Promise<void> {
690
680
 
691
681
  // Only adapters and LLM-backed model resolution depend on this service. Its
692
682
  // child fiber may unload and reload without disturbing OAuth/Web ownership.
693
- ctx.inject(["llm"], (llmCtx) =>
694
- applyOwnedLlm(llmCtx, config, { grok, subscriptions, runtime, codexAuth, codexModels, logger }),
695
- );
696
-
697
- await webRoutesFiber.await();
698
- if (!webRoutesMounted) throw new Error("required DSH webServer routes did not activate");
699
- }
683
+ ctx.inject(["llm"], (llmCtx) =>
684
+ applyOwnedLlm(llmCtx, config, { grok, subscriptions, runtime, codexAuth, codexModels, logger }),
685
+ );
686
+ }
700
687
 
701
688
  interface OwnedLlmDependencies {
702
689
  readonly grok: GrokBuildSession;
package/src/invariant.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/oauth.ts CHANGED
File without changes
package/src/provider.ts CHANGED
File without changes
package/src/proxy.ts CHANGED
File without changes
package/src/redact.ts CHANGED
File without changes
package/src/session.ts CHANGED
File without changes
package/src/store.ts CHANGED
File without changes
package/src/web-origin.ts CHANGED
File without changes
package/src/web-routes.ts CHANGED
File without changes