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.
- package/CHANGELOG.md +14 -0
- package/CONTRIBUTING.md +0 -0
- package/INSTALL.md +9 -8
- package/LICENSE +0 -0
- package/NOTICE +0 -0
- package/README.de.md +7 -8
- package/README.es.md +7 -8
- package/README.fr.md +7 -8
- package/README.ja.md +7 -8
- package/README.ko.md +7 -8
- package/README.md +8 -9
- package/README.pt-BR.md +7 -8
- package/README.ru.md +7 -8
- package/README.zh-CN.md +8 -9
- package/compatibility/dsh-bom.json +17 -30
- package/cordis.patch.yml +0 -0
- package/docs/00-project-rules.md +0 -0
- package/docs/02-architecture.md +1 -1
- package/docs/02-architecture.zh-CN.md +1 -1
- package/lib/adapter.d.ts.map +1 -1
- package/lib/alias-adapter.d.ts +3 -1
- package/lib/alias-adapter.d.ts.map +1 -1
- package/lib/bin.js +3 -3
- package/lib/bin.js.map +1 -1
- package/lib/client.js +3 -3
- package/lib/client.js.map +4 -4
- package/lib/compatibility.d.ts +14 -14
- package/lib/dsh-host-adapter.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +109 -79
- package/lib/index.js.map +3 -3
- package/media/en/settings_accounts.png +0 -0
- package/media/en/settings_capabilities.png +0 -0
- package/media/en/settings_gateway.png +0 -0
- package/media/settings_accounts.png +0 -0
- package/media/settings_capabilities.png +0 -0
- package/media/settings_gateway.png +0 -0
- package/media/settings_overview.png +0 -0
- package/media/zh-CN/settings_accounts.png +0 -0
- package/media/zh-CN/settings_capabilities.png +0 -0
- package/media/zh-CN/settings_gateway.png +0 -0
- package/package.json +38 -38
- package/patches/dsh-agy@0.1.2.patch +0 -0
- package/scripts/release.mjs +0 -0
- package/scripts/smoke-deployed-routes.mjs +0 -0
- package/scripts/verify-deployed-catalog.mjs +0 -0
- package/src/adapter.ts +75 -14
- package/src/alias-adapter.ts +17 -23
- package/src/auth-routes.ts +0 -0
- package/src/auth.ts +0 -0
- package/src/bin.ts +0 -0
- package/src/capability-routes.ts +0 -0
- package/src/capability-runtime.ts +0 -0
- package/src/capability-settings.ts +0 -0
- package/src/capability-tools.ts +0 -0
- package/src/catalog.ts +0 -0
- package/src/client/GrokBuildSettings.tsx +0 -0
- package/src/client/api.ts +0 -0
- package/src/client/components/AboutTab.tsx +0 -0
- package/src/client/components/AccountsTab.tsx +0 -0
- package/src/client/components/Badge.tsx +0 -0
- package/src/client/components/CapabilitiesTab.tsx +0 -0
- package/src/client/components/CliPullPreview.tsx +0 -0
- package/src/client/components/CopyButton.tsx +0 -0
- package/src/client/components/GatewayTab.tsx +0 -0
- package/src/client/components/NoticeBanner.tsx +0 -0
- package/src/client/components/ProgressBar.tsx +0 -0
- package/src/client/components/ProviderCard.tsx +0 -0
- package/src/client/components/SettingsTabs.tsx +0 -0
- package/src/client/components/ToggleSwitch.tsx +0 -0
- package/src/client/constants.ts +1 -1
- package/src/client/display.ts +0 -0
- package/src/client/dshClientAdapter.ts +32 -14
- package/src/client/gatewaySnippets.ts +0 -0
- package/src/client/index.tsx +3 -3
- package/src/client/locales.ts +0 -0
- package/src/client/microStyles.ts +0 -0
- package/src/client/parsers.ts +0 -0
- package/src/client/styles.ts +0 -0
- package/src/client/types.ts +0 -0
- package/src/codex-http.ts +0 -0
- package/src/codex-images.ts +0 -0
- package/src/codex-model-capabilities.ts +0 -0
- package/src/codex-search.ts +0 -0
- package/src/codex-usage.ts +0 -0
- package/src/compatibility.ts +14 -14
- package/src/dsh-host-adapter.ts +8 -6
- package/src/gateway-anthropic-messages.ts +0 -0
- package/src/gateway-auth.ts +0 -0
- package/src/gateway-backend.ts +0 -0
- package/src/gateway-body.ts +0 -0
- package/src/gateway-config.ts +0 -0
- package/src/gateway-http.ts +0 -0
- package/src/gateway-openai-chat.ts +0 -0
- package/src/gateway-openai-responses.ts +0 -0
- package/src/gateway-parse.ts +0 -0
- package/src/gateway-protocol.ts +0 -0
- package/src/gateway-routes.ts +0 -0
- package/src/gateway.ts +0 -0
- package/src/grok-errors.ts +0 -0
- package/src/grok-imagine.ts +0 -0
- package/src/grok-import.ts +0 -0
- package/src/http-json.ts +0 -0
- package/src/ids.ts +0 -0
- package/src/imagine-routes.ts +0 -0
- package/src/index.ts +26 -39
- package/src/invariant.ts +0 -0
- package/src/kimi-errors.ts +0 -0
- package/src/media-store.ts +0 -0
- package/src/oauth-import-routes.ts +0 -0
- package/src/oauth-providers.ts +0 -0
- package/src/oauth-session.ts +0 -0
- package/src/oauth-sources.ts +0 -0
- package/src/oauth.ts +0 -0
- package/src/provider.ts +0 -0
- package/src/proxy.ts +0 -0
- package/src/redact.ts +0 -0
- package/src/session.ts +0 -0
- package/src/store.ts +0 -0
- package/src/web-origin.ts +0 -0
- package/src/web-routes.ts +0 -0
package/src/gateway-backend.ts
CHANGED
|
File without changes
|
package/src/gateway-body.ts
CHANGED
|
File without changes
|
package/src/gateway-config.ts
CHANGED
|
File without changes
|
package/src/gateway-http.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/gateway-parse.ts
CHANGED
|
File without changes
|
package/src/gateway-protocol.ts
CHANGED
|
File without changes
|
package/src/gateway-routes.ts
CHANGED
|
File without changes
|
package/src/gateway.ts
CHANGED
|
File without changes
|
package/src/grok-errors.ts
CHANGED
|
File without changes
|
package/src/grok-imagine.ts
CHANGED
|
File without changes
|
package/src/grok-import.ts
CHANGED
|
File without changes
|
package/src/http-json.ts
CHANGED
|
File without changes
|
package/src/ids.ts
CHANGED
|
File without changes
|
package/src/imagine-routes.ts
CHANGED
|
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
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
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
|
package/src/kimi-errors.ts
CHANGED
|
File without changes
|
package/src/media-store.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/oauth-providers.ts
CHANGED
|
File without changes
|
package/src/oauth-session.ts
CHANGED
|
File without changes
|
package/src/oauth-sources.ts
CHANGED
|
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
|