dsh-coding-subscription-oauth 0.6.4 → 0.7.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.
Files changed (151) hide show
  1. package/CHANGELOG.md +291 -255
  2. package/CONTRIBUTING.md +138 -129
  3. package/INSTALL.md +261 -256
  4. package/LICENSE +19 -19
  5. package/NOTICE +11 -11
  6. package/README.de.md +303 -303
  7. package/README.es.md +304 -304
  8. package/README.fr.md +304 -304
  9. package/README.ja.md +304 -304
  10. package/README.ko.md +304 -304
  11. package/README.md +321 -320
  12. package/README.pt-BR.md +304 -304
  13. package/README.ru.md +304 -304
  14. package/README.zh-CN.md +319 -318
  15. package/compatibility/dsh-bom.json +36 -30
  16. package/cordis.patch.yml +13 -13
  17. package/docs/00-project-rules.md +213 -212
  18. package/docs/02-architecture.md +142 -138
  19. package/docs/02-architecture.zh-CN.md +142 -138
  20. package/lib/auth-routes.d.ts +10 -1
  21. package/lib/auth-routes.d.ts.map +1 -1
  22. package/lib/bin.js +483 -50
  23. package/lib/bin.js.map +4 -4
  24. package/lib/client.js +5 -5
  25. package/lib/client.js.map +4 -4
  26. package/lib/compatibility.d.ts +0 -1
  27. package/lib/compatibility.d.ts.map +1 -1
  28. package/lib/gateway-protocol.d.ts +3 -46
  29. package/lib/gateway-protocol.d.ts.map +1 -1
  30. package/lib/gateway-routes.d.ts.map +1 -1
  31. package/lib/grok-errors.d.ts +2 -12
  32. package/lib/grok-errors.d.ts.map +1 -1
  33. package/lib/grok-imagine/client.d.ts +73 -0
  34. package/lib/grok-imagine/client.d.ts.map +1 -0
  35. package/lib/grok-imagine/index.d.ts +8 -0
  36. package/lib/grok-imagine/index.d.ts.map +1 -0
  37. package/lib/grok-imagine/net.d.ts +10 -0
  38. package/lib/grok-imagine/net.d.ts.map +1 -0
  39. package/lib/grok-imagine/parse.d.ts +20 -0
  40. package/lib/grok-imagine/parse.d.ts.map +1 -0
  41. package/lib/grok-imagine/types.d.ts +191 -0
  42. package/lib/grok-imagine/types.d.ts.map +1 -0
  43. package/lib/grok-imagine.d.ts +3 -263
  44. package/lib/grok-imagine.d.ts.map +1 -1
  45. package/lib/http-json.d.ts +2 -9
  46. package/lib/http-json.d.ts.map +1 -1
  47. package/lib/ids.d.ts +4 -0
  48. package/lib/ids.d.ts.map +1 -1
  49. package/lib/index.d.ts +2 -1
  50. package/lib/index.d.ts.map +1 -1
  51. package/lib/index.js +730 -196
  52. package/lib/index.js.map +4 -4
  53. package/lib/invariant.js.map +1 -1
  54. package/lib/kimi-errors.d.ts +2 -12
  55. package/lib/kimi-errors.d.ts.map +1 -1
  56. package/lib/oauth-session.d.ts +2 -0
  57. package/lib/oauth-session.d.ts.map +1 -1
  58. package/lib/session.d.ts +2 -0
  59. package/lib/session.d.ts.map +1 -1
  60. package/lib/store.d.ts +73 -1
  61. package/lib/store.d.ts.map +1 -1
  62. package/media/en/settings_accounts.png +0 -0
  63. package/media/en/settings_capabilities.png +0 -0
  64. package/media/en/settings_gateway.png +0 -0
  65. package/media/settings_accounts.png +0 -0
  66. package/media/settings_capabilities.png +0 -0
  67. package/media/settings_gateway.png +0 -0
  68. package/media/settings_overview.png +0 -0
  69. package/media/zh-CN/settings_accounts.png +0 -0
  70. package/media/zh-CN/settings_capabilities.png +0 -0
  71. package/media/zh-CN/settings_gateway.png +0 -0
  72. package/package.json +224 -221
  73. package/patches/dsh-agy@0.1.2.patch +25 -25
  74. package/scripts/release.mjs +187 -186
  75. package/scripts/smoke-deployed-routes.mjs +146 -146
  76. package/scripts/verify-deployed-catalog.mjs +87 -87
  77. package/src/adapter.ts +0 -348
  78. package/src/alias-adapter.ts +0 -147
  79. package/src/auth-routes.ts +0 -921
  80. package/src/auth.ts +0 -67
  81. package/src/bin.ts +0 -350
  82. package/src/capability-routes.ts +0 -279
  83. package/src/capability-runtime.ts +0 -314
  84. package/src/capability-settings.ts +0 -671
  85. package/src/capability-tools.ts +0 -685
  86. package/src/catalog.ts +0 -271
  87. package/src/client/GrokBuildSettings.tsx +0 -771
  88. package/src/client/api.ts +0 -88
  89. package/src/client/components/AboutTab.tsx +0 -30
  90. package/src/client/components/AccountsTab.tsx +0 -241
  91. package/src/client/components/Badge.tsx +0 -33
  92. package/src/client/components/CapabilitiesTab.tsx +0 -265
  93. package/src/client/components/CliPullPreview.tsx +0 -116
  94. package/src/client/components/CopyButton.tsx +0 -57
  95. package/src/client/components/GatewayTab.tsx +0 -469
  96. package/src/client/components/NoticeBanner.tsx +0 -46
  97. package/src/client/components/ProgressBar.tsx +0 -53
  98. package/src/client/components/ProviderCard.tsx +0 -606
  99. package/src/client/components/SettingsTabs.tsx +0 -75
  100. package/src/client/components/ToggleSwitch.tsx +0 -71
  101. package/src/client/constants.ts +0 -230
  102. package/src/client/display.ts +0 -61
  103. package/src/client/dshClientAdapter.ts +0 -127
  104. package/src/client/gatewaySnippets.ts +0 -37
  105. package/src/client/index.tsx +0 -156
  106. package/src/client/locales.ts +0 -540
  107. package/src/client/microStyles.ts +0 -52
  108. package/src/client/parsers.ts +0 -398
  109. package/src/client/styles.ts +0 -325
  110. package/src/client/types.ts +0 -199
  111. package/src/codex-http.ts +0 -447
  112. package/src/codex-images.ts +0 -503
  113. package/src/codex-model-capabilities.ts +0 -320
  114. package/src/codex-search.ts +0 -245
  115. package/src/codex-usage.ts +0 -263
  116. package/src/compatibility.ts +0 -55
  117. package/src/dsh-host-adapter.ts +0 -173
  118. package/src/gateway-anthropic-messages.ts +0 -84
  119. package/src/gateway-auth.ts +0 -102
  120. package/src/gateway-backend.ts +0 -274
  121. package/src/gateway-body.ts +0 -49
  122. package/src/gateway-config.ts +0 -76
  123. package/src/gateway-http.ts +0 -104
  124. package/src/gateway-openai-chat.ts +0 -124
  125. package/src/gateway-openai-responses.ts +0 -53
  126. package/src/gateway-parse.ts +0 -224
  127. package/src/gateway-protocol.ts +0 -52
  128. package/src/gateway-routes.ts +0 -158
  129. package/src/gateway.ts +0 -258
  130. package/src/grok-errors.ts +0 -24
  131. package/src/grok-imagine.ts +0 -1627
  132. package/src/grok-import.ts +0 -151
  133. package/src/http-json.ts +0 -82
  134. package/src/ids.ts +0 -59
  135. package/src/imagine-routes.ts +0 -463
  136. package/src/index.ts +0 -735
  137. package/src/invariant.ts +0 -17
  138. package/src/kimi-errors.ts +0 -26
  139. package/src/media-store.ts +0 -927
  140. package/src/oauth-import-routes.ts +0 -324
  141. package/src/oauth-providers.ts +0 -152
  142. package/src/oauth-session.ts +0 -183
  143. package/src/oauth-sources.ts +0 -1104
  144. package/src/oauth.ts +0 -620
  145. package/src/provider.ts +0 -128
  146. package/src/proxy.ts +0 -11
  147. package/src/redact.ts +0 -72
  148. package/src/session.ts +0 -218
  149. package/src/store.ts +0 -217
  150. package/src/web-origin.ts +0 -296
  151. package/src/web-routes.ts +0 -38
@@ -1,540 +0,0 @@
1
- /** English copy for the Coding OAuth settings section. */
2
- export const en = {
3
- nav: "Coding OAuth",
4
- title: "Coding subscriptions",
5
- intro:
6
- "Use your own Grok Build, ChatGPT Codex, Kimi Code, and Claude Code subscriptions in dsh. API-key routes remain separate.",
7
- termsWarning:
8
- "These are unofficial third-party integrations with subscription services. Provider terms, quotas, regions, and account-risk policies still apply.",
9
- loadingAccount: "Loading accounts…",
10
- signedOut: "Not signed in",
11
- signingIn: "Waiting for authorization…",
12
- signedIn: "Signed in",
13
- requestFailed: "The account request failed.",
14
- retry: "Try again",
15
- cancel: "Cancel",
16
- logout: "Sign out",
17
- logoutConfirmTitle: "Confirm sign-out",
18
- logoutConfirmHint: "Sign out of this provider in dsh? Your provider account itself is not changed.",
19
- logoutConfirmAction: "Confirm sign-out",
20
- working: "Working…",
21
- cancelLogin: "Cancel sign-in",
22
- deviceLogin: "Sign in with device code",
23
- deviceLoginRemote: "Sign in with device code (best for remote)",
24
- browserLogin: "Sign in in browser",
25
- pkceLogin: "Sign in with authorization code",
26
- userCode: "Enter this code when the provider asks:",
27
- openUrl: "Complete sign-in at:",
28
- popupBlocked: "The browser blocked the sign-in window. Open this URL manually:",
29
- pasteCodeHint:
30
- "Paste the authorization code or complete redirect URL returned by the provider. For local PKCE, use this only if the callback could not reach this DSH host:",
31
- pasteBrowserCodeHint:
32
- "Paste the authorization code or complete redirect URL returned by the provider to finish this browser sign-in:",
33
- pasteCodePlaceholder: "authorization code or complete redirect URL",
34
- pasteCodeLabel: "Authorization code or complete redirect URL",
35
- submitCode: "Submit code",
36
- importGrok: "Import from Grok CLI",
37
- importHint: "Copies ~/.grok/auth.json into dsh. A later dsh refresh may rotate the token and sign the Grok CLI out.",
38
- models: "Visible models",
39
- catalogLive: "From your current xAI account",
40
- catalogCache: "From the last successful xAI listing",
41
- catalogFallback: "Built-in Grok baseline (live listing unavailable)",
42
- catalogError: "Could not refresh the live Grok model list.",
43
- selectAll: "Show all",
44
- modelHint: "Checked models appear in the model picker as",
45
- grokTitle: "xAI Grok Build",
46
- grokDescription: "SuperGrok / X Premium coding subscription through the Grok Build endpoint.",
47
- codexTitle: "OpenAI Codex",
48
- codexDescription: "ChatGPT Plus/Pro Codex entitlement. Device code is recommended for a remote DSH host.",
49
- kimiTitle: "Kimi Code",
50
- kimiDescription:
51
- "Kimi Code membership through auth.kimi.com and api.kimi.com/coding; this is not the Moonshot API-key platform.",
52
- claudeTitle: "Claude Code",
53
- claudeDescription: "Claude Pro/Max OAuth with Claude Code scopes and automatic refresh.",
54
- antigravityTitle: "Google Antigravity",
55
- antigravityDescription: "Provided by the separately pinned MIT dsh-agy plugin and exposed as the agy route.",
56
- antigravityInstalled: "Installed (CLI-managed)",
57
- antigravityMissing: "Not installed",
58
- antigravityCliHint:
59
- "The unauthenticated dsh-agy web export dashboard is disabled. Manage Google OAuth with the profile-local CLI when needed.",
60
- antigravityCliCommand: "dsh plugin --profile web exec dsh-agy login --headless",
61
- sourcesTitle: "Pull a copy from official CLI files",
62
- sourcesIntro:
63
- "dsh can discover a local official CLI login and pull a one-way copy into its own store. Official CLI files stay read-only and are never modified.",
64
- sourcesReadOnlyHint:
65
- "This is a one-way pull of a copy. dsh does not update, replace, or write back the official CLI documents.",
66
- sourcesLoading: "Looking for official CLI login files…",
67
- sourcesCheckAgain: "Check again",
68
- sourcesAvailable: "A readable copy is available",
69
- sourcesUnavailable: "No usable copy found",
70
- sourcesAllMissingHint:
71
- "No official CLI login files were found on this host. That is normal on a remote DSH machine — use device-code sign-in instead, or check again after logging in on this same host.",
72
- sourcesAvailableHint:
73
- "An official CLI login was found on this host. You can pull a one-way copy into dsh from a provider card.",
74
- sourcesPullCopy: "Pull a copy",
75
- remoteAccountsTip:
76
- "This Settings page looks remote (not loopback). Prefer device-code sign-in; browser pop-ups and local PKCE callbacks often fail from another machine.",
77
- remoteTipDismiss: "Dismiss",
78
- sourcesPreviewTitle: "Review this copy before saving it in dsh",
79
- sourcesPreviewExpires: "CLI credential expiry: {time}",
80
- sourcesTicketExpires: "This preview expires at {time}",
81
- sourcesConflict: "Stored dsh credential: {detail}",
82
- sourcesAction: "If you continue: {detail}",
83
- sourcesWarnings: "Notes",
84
- sourcesConfirmOverwrite: "Replace the credential already stored in dsh with this copy",
85
- sourcesConfirmOverwriteHint: "A different credential is already stored. Check the box, then confirm the pull.",
86
- sourcesCommit: "Confirm pull",
87
- sourcesCancelPreview: "Cancel preview",
88
- sourcesCommitSuccess: "Copied into dsh ({action}).",
89
- sourcesPreviewFailed: "Could not prepare a copy from that CLI file.",
90
- sourcesCommitFailed: "Could not save the copy in dsh.",
91
- sourcesLoadFailed: "Could not look for official CLI login files.",
92
- sourceKindGrok: "Grok CLI",
93
- sourceKindCodex: "Codex CLI",
94
- sourceKindKimi: "Kimi Code CLI",
95
- sourceKindClaude: "Claude Code CLI",
96
- sourceReasonMissing: "No official CLI file was found at the expected location.",
97
- sourceReasonUnsafe: "The official CLI file is not safe to read (permissions or file type).",
98
- sourceReasonInvalid: "The official CLI file is present but is not a usable OAuth login.",
99
- sourceReasonTooLarge: "The official CLI file is larger than the allowed read limit.",
100
- sourceConflictNone: "dsh has no stored credential yet",
101
- sourceConflictSameCredential: "same credential already stored",
102
- sourceConflictSameAccount: "same account, different credential",
103
- sourceConflictDifferentAccount: "a different account is already stored",
104
- sourceConflictUnknownAccount: "an existing credential is stored (account could not be compared)",
105
- sourceConflictUnreadableDestination: "the stored dsh credential could not be read",
106
- sourceConflictUnsafeDestination: "the stored dsh credential file is not safe to replace",
107
- sourceConflictUnrecognized: "the stored credential needs a review",
108
- sourceActionImport: "save this copy in dsh",
109
- sourceActionReuse: "keep the stored dsh credential (it already matches)",
110
- sourceActionOverwrite: "replace the stored dsh credential",
111
- sourceActionBlocked: "blocked — the stored dsh file cannot be replaced from here",
112
- sourceActionUnrecognized: "needs a review",
113
- sourceCommitImported: "saved",
114
- sourceCommitUnchanged: "already matched",
115
- sourceCommitOverwritten: "replaced",
116
- capabilitiesTitle: "Subscription capabilities",
117
- capabilitiesIntro:
118
- "Every switch starts off. Turning one on uses that vendor’s subscription quota, not a separate API-key bill.",
119
- capabilitiesQuotaHint:
120
- "Search, images, edits, Fast, usage, and Grok Imagine all consume the matching subscription quota when they run.",
121
- capabilitiesReadOnly: "These switches are read-only in this deployment.",
122
- capabilitiesLoading: "Loading capability settings…",
123
- capabilitiesLoadFailed: "Could not load capability settings.",
124
- capabilitiesSaveFailed: "Could not save that capability setting.",
125
- capabilitiesConflictRefreshed: "Those settings changed elsewhere. The page was refreshed; try again.",
126
- capabilityLimitsTitle: "Capability limits",
127
- capabilityLimitsHint: "Limits apply live to newly started operations and remain within the audited safety bounds.",
128
- capSearchResults: "Maximum search results",
129
- capSearchResultsHint: "Codex search returns at most this many results (1–20).",
130
- capImageCount: "Maximum images per call",
131
- capImageCountHint: "Codex and Imagine image tools can return at most this many images (1–4).",
132
- capVideoTtlHours: "Video artifact retention (hours)",
133
- capVideoTtlHoursHint:
134
- "Completed Imagine video artifacts are kept for 1–168 hours. Lowering retention cleans older artifacts immediately; raising it applies to new artifacts.",
135
- capabilityLimitInvalid: "Enter a whole number from {min} through {max}.",
136
- capCodexSearch: "Codex subscription search",
137
- capCodexSearchHint: "Optional search using Codex quota.",
138
- capCodexImages: "Codex images",
139
- capCodexImagesHint: "Generate images with ChatGPT/Codex quota.",
140
- capCodexImageEdits: "Codex image edits",
141
- capCodexImageEditsHint: "Edit images; requires Codex images.",
142
- capCodexImagesAnyModel: "Allow any model to use image tools",
143
- capCodexImagesAnyModelHint:
144
- "Let non-Codex routes also call image generate/edit. Still uses your ChatGPT/Codex quota and requires Codex sign-in.",
145
- capCodexUsage: "Show Codex quota",
146
- capCodexUsageHint: "Show remaining quota on the Codex account card when available.",
147
- capCodexFast: "Fast requested",
148
- capCodexFastHint: "Publish the Fast route when the live catalog confirms priority eligibility.",
149
- capGrokImagineImage: "Grok Imagine images",
150
- capGrokImagineImageHint: "Needs a separate Imagine credential (not Grok OAuth alone).",
151
- capGrokImagineVideo: "Grok Imagine video",
152
- capGrokImagineVideoHint: "Needs a separate Imagine credential (not Grok OAuth alone).",
153
- usageTitle: "Codex quota",
154
- usageLoading: "Loading Codex quota…",
155
- usageUnavailable: "Codex quota is not available right now.",
156
- usageEmpty: "The vendor did not return any displayable quota fields.",
157
- usageFetchedAt: "Last read: {time}",
158
- usageRateLimit: "Rate limit",
159
- usageWindow: "{seconds}s window",
160
- usageUsed: "Used {value}",
161
- usageRemaining: "Remaining {value}",
162
- usageResets: "Resets {time}",
163
- usageCredits: "Credits",
164
- usageCreditsUnlimited: "Unlimited credits",
165
- usageCreditsLimited: "Limited credits",
166
- usageBalance: "Balance {value}",
167
- usageIndividualLimit: "Individual limit",
168
- usageLimit: "Limit {value}",
169
- usageUsedAmount: "Used {value}",
170
- usageRemainingAmount: "Remaining {value}",
171
- usageSpendControlReached: "Spend control has been reached.",
172
- usageResetCredits: "Reset credits available: {value}",
173
- imagineTitle: "Grok Imagine credential",
174
- imagineIntro:
175
- "Official Imagine calls use an xAI API credential (for example $XAI_API_KEY). That key is separate from a Grok Build OAuth login and is never shown here.",
176
- imagineLoading: "Checking the Imagine credential…",
177
- imagineLoadFailed: "Could not read the Imagine credential status.",
178
- imagineConfigured: "An Imagine credential is configured",
179
- imagineNotConfigured: "No Imagine credential is configured",
180
- imagineSource: "Source: {source}",
181
- imagineWritable: "This deployment can update the Imagine credential store.",
182
- imagineReadOnly: "This deployment cannot update the Imagine credential store.",
183
- imagineSourceNone: "none",
184
- imagineSourceEnv: "environment variable",
185
- imagineSourceApiKey: "stored API key",
186
- imagineSourceOAuth: "OAuth access (only if Imagine accepted it)",
187
- imagineSourceCliKey: "Grok CLI key field",
188
- imagineSourceUnknown: "configured (details withheld)",
189
- tabAccounts: "Accounts",
190
- tabCapabilities: "Capabilities",
191
- tabGateway: "Gateway",
192
- tabAbout: "About",
193
- copy: "Copy",
194
- copied: "Copied",
195
- copyFailed: "Could not copy",
196
- modelsSummary: "{selected}/{total} models visible",
197
- expandModels: "Models",
198
- collapseModels: "Hide models",
199
- usageUsedShort: "Used {value}",
200
- gatewayTitle: "Local API gateway",
201
- gatewayIntro: "Loopback OpenAI/Anthropic-compatible server for your own tools. Off until you enable it.",
202
- gatewayWarning: "Exposes signed-in subscriptions as a local API. Can violate provider terms and uses quota.",
203
- gatewayLoopbackHint: "Binds to loopback only. Do not port-forward or expose this gateway on a public interface.",
204
- gatewayEnableConfirm:
205
- "Enable the local API gateway? It exposes your signed-in subscriptions to tools on this host and consumes provider quota.",
206
- gatewayEnableConfirmAction: "Confirm",
207
- gatewayEnableCancel: "Cancel",
208
- gatewayEnabled: "Enable local gateway",
209
- gatewayBind: "Bind",
210
- gatewayPort: "Port",
211
- gatewayPortHint: "Integer from 1024 through 65535. Apply to save; Random fills a high port, then Apply.",
212
- gatewayPortApply: "Apply",
213
- gatewayPortRandom: "Random",
214
- gatewayPortInvalid: "Enter a whole port number from 1024 through 65535.",
215
- gatewayAddress: "Gateway address",
216
- gatewayOpenAiUrl: "OpenAI-compatible base URL",
217
- gatewayAnthropicUrl: "Anthropic-compatible base URL",
218
- gatewayKeyHint: "Bearer key",
219
- gatewayKeyCopyHint: "Copy uses the current key. Rotate only if you want to invalidate existing clients.",
220
- gatewayCopyKey: "Copy key",
221
- gatewayShowKey: "Show",
222
- gatewayHideKey: "Hide",
223
- gatewayRevealFailed: "Could not read the current key.",
224
- gatewayRotateConfirm: "Rotate the key? Existing clients will stop working.",
225
- gatewayRotateConfirmHint: "This replaces the current Bearer key.",
226
- gatewayRotateConfirmAction: "Confirm rotate",
227
- gatewayRotateCancel: "Cancel",
228
- gatewayRunning: "Listening",
229
- gatewayStopped: "Not listening",
230
- gatewayRotate: "Rotate API key",
231
- gatewayRotated: "New key (shown once): {key}",
232
- gatewayLoadFailed: "Could not load gateway settings.",
233
- gatewaySaveFailed: "Could not update the gateway.",
234
- gatewayLoading: "Loading gateway settings…",
235
- gatewayModelsReady: "{count} executable model(s) available. Snippets use {model}.",
236
- gatewayModelsUnavailable: "No signed-in provider currently exposes an executable gateway model.",
237
- gatewayKeyConfigured: "A real Bearer key is configured. Reveal it before copying an executable snippet.",
238
- gatewayKeyNotConfigured: "No Bearer key is configured yet.",
239
- remoteLoginHelp:
240
- "On a remote DSH host, open Settings here and use device-code sign-in for each provider. Complete the code on any browser that can reach the provider, then return to chat and pick the provider route model.",
241
- pluginVersion: "Plugin version {version}",
242
- aboutTitle: "About",
243
- aboutDocsHint:
244
- "See the plugin README and INSTALL docs in the repository for setup, supported providers, and gateway safety notes.",
245
- aboutDocsLink: "Open README on GitHub",
246
- otherLoginMethods: "Other sign-in methods",
247
- hideOtherLoginMethods: "Hide other methods",
248
- signInStepOpen: "Open the provider authorization page",
249
- signInStepCode: "Enter the device code when prompted",
250
- signInStepWait: "Waiting for authorization to complete",
251
- copyUserCode: "Copy code",
252
- openAuthUrl: "Open authorization page",
253
- modelFilterPlaceholder: "Filter models…",
254
- modelFilterLabel: "Filter models for {provider}",
255
- applyModelDraft: "Apply model selection",
256
- modelDraftPending: "Selection changed locally. Apply once to save.",
257
- deselectAll: "Hide all",
258
- resetModelsDefault: "Reset selection",
259
- requiresCodexImages: "Turn on Codex images first.",
260
- requiresCodexSignIn: "Sign in to OpenAI Codex first.",
261
- requiresImagineCredential: "Configure the separate Grok Imagine credential first.",
262
- openCodexAccount: "Open Codex account",
263
- focusCodexImages: "Go to Codex images",
264
- focusImagineCredential: "View Imagine credential status",
265
- gatewaySnippetsTitle: "Quick setup snippets",
266
- gatewaySnippetsUnavailable: "Reveal the real key and sign in to at least one provider before snippets are shown.",
267
- gatewaySnippetCurl: "cURL",
268
- gatewaySnippetPython: "Python (OpenAI SDK)",
269
- gatewaySnippetIde: "IDE / client",
270
- tabAccountsSignedIn: "{count} signed in",
271
- coinstallTitle: "Managed by Usage Center",
272
- coinstallSummary: "Usage Center is the active OAuth owner. {count} provider account(s) are currently signed in.",
273
- coinstallOpenHub: "Open Usage Center",
274
- tabGatewayActive: "Running",
275
- };
276
-
277
- export type GrokBuildSettingsKey = keyof typeof en;
278
-
279
- export const zh: { [Key in GrokBuildSettingsKey]: string } = {
280
- nav: "编码 OAuth",
281
- title: "编码订阅账户",
282
- intro:
283
- "在 dsh 中使用自己的 Grok Build、ChatGPT Codex、Kimi Code 和 Claude Code 订阅;现有 API-key 路由继续独立保留。",
284
- termsWarning: "这些是订阅服务的非官方第三方集成,仍受供应商条款、配额、地区限制和账号风控约束。",
285
- loadingAccount: "正在加载账户…",
286
- signedOut: "尚未登录",
287
- signingIn: "正在等待授权…",
288
- signedIn: "已登录",
289
- requestFailed: "账户请求失败。",
290
- retry: "重试",
291
- cancel: "取消",
292
- logout: "退出登录",
293
- logoutConfirmTitle: "确认退出登录",
294
- logoutConfirmHint: "确定在 dsh 中退出此供应商?供应商账号本身不会被修改。",
295
- logoutConfirmAction: "确认退出",
296
- working: "处理中…",
297
- cancelLogin: "取消登录",
298
- deviceLogin: "使用设备码登录",
299
- deviceLoginRemote: "使用设备码登录(适合远程)",
300
- browserLogin: "在浏览器中登录",
301
- pkceLogin: "使用授权码登录",
302
- userCode: "供应商要求输入代码时,请输入:",
303
- openUrl: "请在此完成登录:",
304
- popupBlocked: "浏览器阻止了登录窗口,请手动打开:",
305
- pasteCodeHint: "请粘贴供应商返回的授权 code 或完整跳转链接。本地 PKCE 仅在回调无法到达这台 DSH 主机时使用:",
306
- pasteBrowserCodeHint: "请粘贴供应商返回的授权 code 或完整跳转链接,以完成此次浏览器登录:",
307
- pasteCodePlaceholder: "授权 code 或完整跳转链接",
308
- pasteCodeLabel: "授权 code 或完整跳转链接",
309
- submitCode: "提交 code",
310
- importGrok: "从 Grok CLI 导入",
311
- importHint: "把 ~/.grok/auth.json 复制进 dsh;之后 dsh 刷新 token 可能让 Grok CLI 掉线。",
312
- models: "可见模型",
313
- catalogLive: "来自当前 xAI 账号",
314
- catalogCache: "来自上一次成功拉取的 xAI 列表",
315
- catalogFallback: "内置 Grok 基线目录(线上列表不可用)",
316
- catalogError: "无法刷新线上 Grok 模型列表。",
317
- selectAll: "全部显示",
318
- modelHint: "勾选模型会以该前缀出现在模型选择器:",
319
- grokTitle: "xAI Grok Build",
320
- grokDescription: "通过 Grok Build 端点使用 SuperGrok / X Premium 编码订阅。",
321
- codexTitle: "OpenAI Codex",
322
- codexDescription: "使用 ChatGPT Plus/Pro 的 Codex 权益;远程 DSH 主机推荐设备码登录。",
323
- kimiTitle: "Kimi Code",
324
- kimiDescription: "通过 auth.kimi.com 与 api.kimi.com/coding 使用 Kimi Code 会员;不是 Moonshot API-key 开放平台。",
325
- claudeTitle: "Claude Code",
326
- claudeDescription: "Claude Pro/Max OAuth,包含 Claude Code scope 和自动刷新。",
327
- antigravityTitle: "Google Antigravity",
328
- antigravityDescription: "由单独固定版本的 MIT 开源 dsh-agy 插件提供,对外路由为 agy。",
329
- antigravityInstalled: "已安装(CLI 管理)",
330
- antigravityMissing: "尚未安装",
331
- antigravityCliHint:
332
- "为避免暴露无认证的凭据导出页面,默认禁用 dsh-agy Web 管理页;需要时使用 profile 内 CLI 管理 Google OAuth。",
333
- antigravityCliCommand: "dsh plugin --profile web exec dsh-agy login --headless",
334
- sourcesTitle: "从官方 CLI 文件拉取副本",
335
- sourcesIntro:
336
- "dsh 可以自动发现本机官方 CLI 登录,并单向拉取一份副本到自己的存储。官方 CLI 文件保持只读,绝不会被修改。",
337
- sourcesReadOnlyHint: "这是单向拉取副本。dsh 不会更新、覆盖或回写官方 CLI 文档。",
338
- sourcesLoading: "正在查找官方 CLI 登录文件…",
339
- sourcesCheckAgain: "再检查一次",
340
- sourcesAvailable: "可以读取一份副本",
341
- sourcesUnavailable: "没有可用的副本",
342
- sourcesAllMissingHint:
343
- "这台主机上没有找到官方 CLI 登录文件。远程 DSH 上这很常见——请改用设备码登录;若已在本机 CLI 登录,可再检查一次。",
344
- sourcesAvailableHint: "本机发现了官方 CLI 登录。可在对应账户卡片里单向拉取一份副本到 dsh。",
345
- sourcesPullCopy: "拉取副本",
346
- remoteAccountsTip:
347
- "当前 Settings 页面看起来是远程访问(非本机回环)。请优先使用设备码登录;从另一台机器打开时,浏览器弹窗和本地 PKCE 回调经常会失败。",
348
- remoteTipDismiss: "知道了",
349
- sourcesPreviewTitle: "先核对这份副本,再写入 dsh",
350
- sourcesPreviewExpires: "CLI 凭据到期时间:{time}",
351
- sourcesTicketExpires: "此次预览将于 {time} 失效",
352
- sourcesConflict: "dsh 中已存凭据:{detail}",
353
- sourcesAction: "若继续:{detail}",
354
- sourcesWarnings: "说明",
355
- sourcesConfirmOverwrite: "用这份副本替换 dsh 中已保存的凭据",
356
- sourcesConfirmOverwriteHint: "dsh 里已有另一份凭据。请先勾选,再确认拉取。",
357
- sourcesCommit: "确认拉取",
358
- sourcesCancelPreview: "取消预览",
359
- sourcesCommitSuccess: "已复制到 dsh({action})。",
360
- sourcesPreviewFailed: "无法从该 CLI 文件准备副本。",
361
- sourcesCommitFailed: "无法把副本保存到 dsh。",
362
- sourcesLoadFailed: "无法查找官方 CLI 登录文件。",
363
- sourceKindGrok: "Grok CLI",
364
- sourceKindCodex: "Codex CLI",
365
- sourceKindKimi: "Kimi Code CLI",
366
- sourceKindClaude: "Claude Code CLI",
367
- sourceReasonMissing: "在预期位置没有找到官方 CLI 文件。",
368
- sourceReasonUnsafe: "官方 CLI 文件不安全,无法读取(权限或文件类型)。",
369
- sourceReasonInvalid: "官方 CLI 文件存在,但不是可用的 OAuth 登录。",
370
- sourceReasonTooLarge: "官方 CLI 文件超过允许的读取上限。",
371
- sourceConflictNone: "dsh 尚未保存凭据",
372
- sourceConflictSameCredential: "已保存同一份凭据",
373
- sourceConflictSameAccount: "同一账号,但凭据不同",
374
- sourceConflictDifferentAccount: "已保存另一个账号",
375
- sourceConflictUnknownAccount: "已保存凭据(无法比较账号)",
376
- sourceConflictUnreadableDestination: "无法读取 dsh 中已存凭据",
377
- sourceConflictUnsafeDestination: "dsh 中的凭据文件不安全,不能从这里替换",
378
- sourceConflictUnrecognized: "已存凭据需要核对",
379
- sourceActionImport: "把这份副本保存到 dsh",
380
- sourceActionReuse: "保留 dsh 中已存凭据(内容已相同)",
381
- sourceActionOverwrite: "替换 dsh 中已存凭据",
382
- sourceActionBlocked: "已阻止 — 不能从这里替换 dsh 中的文件",
383
- sourceActionUnrecognized: "需要核对",
384
- sourceCommitImported: "已保存",
385
- sourceCommitUnchanged: "原本就相同",
386
- sourceCommitOverwritten: "已替换",
387
- capabilitiesTitle: "订阅能力",
388
- capabilitiesIntro: "所有开关默认关闭。打开后消耗的是对应供应商的订阅配额,不是另一套 API-key 账单。",
389
- capabilitiesQuotaHint: "搜索、出图、改图、Fast、额度展示和 Grok Imagine 在实际调用时都会消耗对应订阅配额。",
390
- capabilitiesReadOnly: "当前部署中这些开关为只读。",
391
- capabilitiesLoading: "正在加载能力设置…",
392
- capabilitiesLoadFailed: "无法加载能力设置。",
393
- capabilitiesSaveFailed: "无法保存该能力设置。",
394
- capabilitiesConflictRefreshed: "这些设置已在别处被改过。页面已刷新,请再试一次。",
395
- capabilityLimitsTitle: "能力限制",
396
- capabilityLimitsHint: "限制会实时应用于新发起的操作,并始终保持在已审计的安全范围内。",
397
- capSearchResults: "最多搜索结果数",
398
- capSearchResultsHint: "Codex 搜索最多返回这么多条结果(1–20)。",
399
- capImageCount: "单次最多图片数",
400
- capImageCountHint: "Codex 与 Imagine 图片工具单次最多返回这么多张图片(1–4)。",
401
- capVideoTtlHours: "视频产物保留时间(小时)",
402
- capVideoTtlHoursHint: "Imagine 视频产物保留 1–168 小时;降低保留时间会立即清理过期旧产物,提高只影响新产物。",
403
- capabilityLimitInvalid: "请输入 {min} 到 {max} 之间的整数。",
404
- capCodexSearch: "Codex 订阅搜索",
405
- capCodexSearchHint: "可选搜索,消耗 Codex 配额。",
406
- capCodexImages: "Codex 出图",
407
- capCodexImagesHint: "用 ChatGPT/Codex 配额出图。",
408
- capCodexImageEdits: "Codex 改图",
409
- capCodexImageEditsHint: "改图;需先打开 Codex 出图。",
410
- capCodexImagesAnyModel: "允许任意模型调用出图工具",
411
- capCodexImagesAnyModelHint: "非 Codex 渠道的模型也可调用图片生成/编辑。仍消耗 ChatGPT/Codex 配额,且需登录 Codex。",
412
- capCodexUsage: "显示 Codex 额度",
413
- capCodexUsageHint: "有数据时在 Codex 账户卡片上显示剩余额度。",
414
- capCodexFast: "已请求 Fast",
415
- capCodexFastHint: "在线目录确认优先资格后发布 Fast 路由。",
416
- capGrokImagineImage: "Grok Imagine 出图",
417
- capGrokImagineImageHint: "需要单独的 Imagine 凭据,仅有 Grok OAuth 不够。",
418
- capGrokImagineVideo: "Grok Imagine 出视频",
419
- capGrokImagineVideoHint: "需要单独的 Imagine 凭据,仅有 Grok OAuth 不够。",
420
- usageTitle: "Codex 额度",
421
- usageLoading: "正在加载 Codex 额度…",
422
- usageUnavailable: "当前无法读取 Codex 额度。",
423
- usageEmpty: "供应商没有返回可展示的额度字段。",
424
- usageFetchedAt: "最近读取:{time}",
425
- usageRateLimit: "速率限制",
426
- usageWindow: "{seconds} 秒窗口",
427
- usageUsed: "已用 {value}",
428
- usageRemaining: "剩余 {value}",
429
- usageResets: "重置时间 {time}",
430
- usageCredits: "积分",
431
- usageCreditsUnlimited: "无限积分",
432
- usageCreditsLimited: "有限积分",
433
- usageBalance: "余额 {value}",
434
- usageIndividualLimit: "个人额度",
435
- usageLimit: "上限 {value}",
436
- usageUsedAmount: "已用 {value}",
437
- usageRemainingAmount: "剩余 {value}",
438
- usageSpendControlReached: "已达到支出控制上限。",
439
- usageResetCredits: "可用重置次数:{value}",
440
- imagineTitle: "Grok Imagine 凭据",
441
- imagineIntro:
442
- "官方 Imagine 调用使用 xAI API 凭据(例如 $XAI_API_KEY)。它与 Grok Build OAuth 登录不是同一份凭据,这里也不会显示密钥。",
443
- imagineLoading: "正在检查 Imagine 凭据…",
444
- imagineLoadFailed: "无法读取 Imagine 凭据状态。",
445
- imagineConfigured: "已配置 Imagine 凭据",
446
- imagineNotConfigured: "尚未配置 Imagine 凭据",
447
- imagineSource: "来源:{source}",
448
- imagineWritable: "当前部署可以更新 Imagine 凭据存储。",
449
- imagineReadOnly: "当前部署不能更新 Imagine 凭据存储。",
450
- imagineSourceNone: "无",
451
- imagineSourceEnv: "环境变量",
452
- imagineSourceApiKey: "已保存的 API key",
453
- imagineSourceOAuth: "OAuth access(仅当 Imagine 接受时)",
454
- imagineSourceCliKey: "Grok CLI 的 key 字段",
455
- imagineSourceUnknown: "已配置(细节不展示)",
456
- tabAccounts: "账户",
457
- tabCapabilities: "能力",
458
- tabGateway: "网关",
459
- tabAbout: "关于",
460
- copy: "复制",
461
- copied: "已复制",
462
- copyFailed: "复制失败",
463
- modelsSummary: "已显示 {selected}/{total} 个模型",
464
- expandModels: "模型",
465
- collapseModels: "收起模型",
466
- usageUsedShort: "已用 {value}",
467
- gatewayTitle: "本地 API 网关",
468
- gatewayIntro: "本机 loopback 上的 OpenAI/Anthropic 兼容服务,供你自己的工具使用。默认关闭。",
469
- gatewayWarning: "打开后会把已登录订阅暴露成本地 API。可能违反供应商条款并消耗配额。",
470
- gatewayLoopbackHint: "仅绑定本机回环地址。请勿做端口转发,也不要把它暴露到公网。",
471
- gatewayEnableConfirm: "要启用本地 API 网关吗?它会把已登录的订阅暴露给本机工具,并消耗供应商配额。",
472
- gatewayEnableConfirmAction: "确认启用",
473
- gatewayEnableCancel: "取消",
474
- gatewayEnabled: "启用本地网关",
475
- gatewayBind: "绑定地址",
476
- gatewayPort: "端口",
477
- gatewayPortHint: "1024–65535 的整数。改完点确定保存;随机会填一个高位端口,仍需确定。",
478
- gatewayPortApply: "确定",
479
- gatewayPortRandom: "随机",
480
- gatewayPortInvalid: "请输入 1024 到 65535 之间的整数端口。",
481
- gatewayAddress: "网关地址",
482
- gatewayOpenAiUrl: "OpenAI 兼容地址",
483
- gatewayAnthropicUrl: "Anthropic 兼容地址",
484
- gatewayKeyHint: "Bearer key",
485
- gatewayKeyCopyHint: "复制的是当前 key。只有要作废已有客户端时才轮换。",
486
- gatewayCopyKey: "复制 key",
487
- gatewayShowKey: "显示",
488
- gatewayHideKey: "隐藏",
489
- gatewayRevealFailed: "无法读取当前 key。",
490
- gatewayRotateConfirm: "确定轮换 key?现有客户端将失效。",
491
- gatewayRotateConfirmHint: "这会替换当前 Bearer key。",
492
- gatewayRotateConfirmAction: "确认轮换",
493
- gatewayRotateCancel: "取消",
494
- gatewayRunning: "正在监听",
495
- gatewayStopped: "未监听",
496
- gatewayRotate: "轮换 API key",
497
- gatewayRotated: "新 key(只显示一次):{key}",
498
- gatewayLoadFailed: "无法加载网关设置。",
499
- gatewaySaveFailed: "无法更新网关。",
500
- gatewayLoading: "正在加载网关设置…",
501
- gatewayModelsReady: "当前有 {count} 个可执行模型,配置片段使用 {model}。",
502
- gatewayModelsUnavailable: "当前没有已登录供应商提供可执行的网关模型。",
503
- gatewayKeyConfigured: "已配置真实 Bearer key;复制可执行片段前请先读取 key。",
504
- gatewayKeyNotConfigured: "尚未配置 Bearer key。",
505
- remoteLoginHelp:
506
- "在远程 DSH 主机上,打开此处 Settings,对每个供应商使用设备码登录。在能访问供应商的任意浏览器完成验证码,再回到聊天选择对应路由模型。",
507
- pluginVersion: "插件版本 {version}",
508
- aboutTitle: "关于",
509
- aboutDocsHint: "仓库中的 README 与 INSTALL 文档介绍了安装步骤、支持的供应商以及网关安全注意事项。",
510
- aboutDocsLink: "在 GitHub 打开 README",
511
- otherLoginMethods: "其他登录方式",
512
- hideOtherLoginMethods: "收起其他方式",
513
- signInStepOpen: "打开供应商授权页面",
514
- signInStepCode: "在提示处输入设备码",
515
- signInStepWait: "等待授权完成",
516
- copyUserCode: "复制设备码",
517
- openAuthUrl: "打开授权页面",
518
- modelFilterPlaceholder: "筛选模型…",
519
- modelFilterLabel: "筛选 {provider} 的模型",
520
- applyModelDraft: "应用模型选择",
521
- modelDraftPending: "选择仅在本页形成草稿,点击应用后一次保存。",
522
- deselectAll: "全部隐藏",
523
- resetModelsDefault: "重置选择",
524
- requiresCodexImages: "需先开启 Codex 出图。",
525
- requiresCodexSignIn: "请先登录 OpenAI Codex。",
526
- requiresImagineCredential: "请先配置独立的 Grok Imagine 凭据。",
527
- openCodexAccount: "前往 Codex 账户",
528
- focusCodexImages: "前往 Codex 出图开关",
529
- focusImagineCredential: "查看 Imagine 凭据状态",
530
- gatewaySnippetsTitle: "快速配置片段",
531
- gatewaySnippetsUnavailable: "请先读取真实 key,并至少登录一个供应商;满足后才会显示可执行配置片段。",
532
- gatewaySnippetCurl: "cURL",
533
- gatewaySnippetPython: "Python (OpenAI SDK)",
534
- gatewaySnippetIde: "IDE / 客户端",
535
- tabAccountsSignedIn: "已登录 {count} 个",
536
- coinstallTitle: "已由用量中心统一管理",
537
- coinstallSummary: "用量中心当前负责 OAuth 运行时;已有 {count} 个供应商账号登录。",
538
- coinstallOpenHub: "前往用量中心",
539
- tabGatewayActive: "运行中",
540
- };
@@ -1,52 +0,0 @@
1
- /** Injects global keyframes once for skeleton pulse and spinner animations. */
2
-
3
- const STYLE_ID = "dsh-coding-oauth-micro-styles";
4
-
5
- const CSS = `
6
- @keyframes dsh-coding-oauth-skeleton-pulse {
7
- 0% { background-position: 200% 0; }
8
- 100% { background-position: -200% 0; }
9
- }
10
- @keyframes dsh-coding-oauth-spin {
11
- from { transform: rotate(0deg); }
12
- to { transform: rotate(360deg); }
13
- }
14
- @keyframes dsh-coding-oauth-fade-in {
15
- from { opacity: 0; transform: translateY(-4px); }
16
- to { opacity: 1; transform: translateY(0); }
17
- }
18
- @media (prefers-reduced-motion: reduce) {
19
- [data-dsh-coding-oauth] *, [data-dsh-coding-oauth] *::before, [data-dsh-coding-oauth] *::after {
20
- animation-duration: 0.01ms !important;
21
- animation-iteration-count: 1 !important;
22
- transition-duration: 0.01ms !important;
23
- scroll-behavior: auto !important;
24
- }
25
- }
26
- @media (max-width: 560px) {
27
- [data-dsh-coding-oauth] button,
28
- [data-dsh-coding-oauth] input,
29
- [data-dsh-coding-oauth] [role="switch"] {
30
- min-height: 44px;
31
- }
32
- [data-dsh-coding-oauth] [data-responsive-row] {
33
- align-items: stretch !important;
34
- flex-direction: column;
35
- }
36
- }
37
- `;
38
-
39
- let injected = false;
40
-
41
- export function ensureMicroStyles(): void {
42
- if (injected || typeof document === "undefined") return;
43
- if (document.getElementById(STYLE_ID) !== null) {
44
- injected = true;
45
- return;
46
- }
47
- const style = document.createElement("style");
48
- style.id = STYLE_ID;
49
- style.textContent = CSS;
50
- document.head.appendChild(style);
51
- injected = true;
52
- }