dsh-coding-subscription-oauth 0.6.3 → 0.6.5

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 (127) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/CONTRIBUTING.md +13 -4
  3. package/INSTALL.md +7 -5
  4. package/README.de.md +6 -6
  5. package/README.es.md +6 -6
  6. package/README.fr.md +6 -6
  7. package/README.ja.md +6 -6
  8. package/README.ko.md +6 -6
  9. package/README.md +6 -6
  10. package/README.pt-BR.md +6 -6
  11. package/README.ru.md +6 -6
  12. package/README.zh-CN.md +6 -6
  13. package/docs/00-project-rules.md +4 -4
  14. package/docs/02-architecture.md +7 -3
  15. package/docs/02-architecture.zh-CN.md +7 -3
  16. package/lib/bin.js +1333 -569
  17. package/lib/bin.js.map +4 -4
  18. package/lib/client.js +1 -1
  19. package/lib/client.js.map +2 -2
  20. package/lib/gateway-protocol.d.ts +3 -46
  21. package/lib/gateway-protocol.d.ts.map +1 -1
  22. package/lib/gateway-routes.d.ts.map +1 -1
  23. package/lib/grok-errors.d.ts +2 -12
  24. package/lib/grok-errors.d.ts.map +1 -1
  25. package/lib/grok-imagine/client.d.ts +73 -0
  26. package/lib/grok-imagine/client.d.ts.map +1 -0
  27. package/lib/grok-imagine/index.d.ts +8 -0
  28. package/lib/grok-imagine/index.d.ts.map +1 -0
  29. package/lib/grok-imagine/net.d.ts +10 -0
  30. package/lib/grok-imagine/net.d.ts.map +1 -0
  31. package/lib/grok-imagine/parse.d.ts +20 -0
  32. package/lib/grok-imagine/parse.d.ts.map +1 -0
  33. package/lib/grok-imagine/types.d.ts +191 -0
  34. package/lib/grok-imagine/types.d.ts.map +1 -0
  35. package/lib/grok-imagine.d.ts +3 -263
  36. package/lib/grok-imagine.d.ts.map +1 -1
  37. package/lib/http-json.d.ts +2 -9
  38. package/lib/http-json.d.ts.map +1 -1
  39. package/lib/index.js +1395 -26178
  40. package/lib/index.js.map +4 -4
  41. package/lib/kimi-errors.d.ts +2 -12
  42. package/lib/kimi-errors.d.ts.map +1 -1
  43. package/lib/runtime/gateway-protocol.d.ts +47 -0
  44. package/lib/runtime/gateway-protocol.d.ts.map +1 -0
  45. package/lib/runtime/grok-errors.d.ts +13 -0
  46. package/lib/runtime/grok-errors.d.ts.map +1 -0
  47. package/lib/runtime/http-json.d.ts +10 -0
  48. package/lib/runtime/http-json.d.ts.map +1 -0
  49. package/lib/runtime/kimi-errors.d.ts +13 -0
  50. package/lib/runtime/kimi-errors.d.ts.map +1 -0
  51. package/package.json +12 -7
  52. package/scripts/release.mjs +1 -0
  53. package/src/adapter.ts +0 -348
  54. package/src/alias-adapter.ts +0 -147
  55. package/src/auth-routes.ts +0 -921
  56. package/src/auth.ts +0 -67
  57. package/src/bin.ts +0 -350
  58. package/src/capability-routes.ts +0 -279
  59. package/src/capability-runtime.ts +0 -314
  60. package/src/capability-settings.ts +0 -671
  61. package/src/capability-tools.ts +0 -685
  62. package/src/catalog.ts +0 -271
  63. package/src/client/GrokBuildSettings.tsx +0 -771
  64. package/src/client/api.ts +0 -88
  65. package/src/client/components/AboutTab.tsx +0 -30
  66. package/src/client/components/AccountsTab.tsx +0 -241
  67. package/src/client/components/Badge.tsx +0 -33
  68. package/src/client/components/CapabilitiesTab.tsx +0 -265
  69. package/src/client/components/CliPullPreview.tsx +0 -116
  70. package/src/client/components/CopyButton.tsx +0 -57
  71. package/src/client/components/GatewayTab.tsx +0 -469
  72. package/src/client/components/NoticeBanner.tsx +0 -46
  73. package/src/client/components/ProgressBar.tsx +0 -53
  74. package/src/client/components/ProviderCard.tsx +0 -606
  75. package/src/client/components/SettingsTabs.tsx +0 -75
  76. package/src/client/components/ToggleSwitch.tsx +0 -71
  77. package/src/client/constants.ts +0 -230
  78. package/src/client/display.ts +0 -61
  79. package/src/client/dshClientAdapter.ts +0 -127
  80. package/src/client/gatewaySnippets.ts +0 -37
  81. package/src/client/index.tsx +0 -156
  82. package/src/client/locales.ts +0 -540
  83. package/src/client/microStyles.ts +0 -52
  84. package/src/client/parsers.ts +0 -398
  85. package/src/client/styles.ts +0 -325
  86. package/src/client/types.ts +0 -199
  87. package/src/codex-http.ts +0 -447
  88. package/src/codex-images.ts +0 -503
  89. package/src/codex-model-capabilities.ts +0 -320
  90. package/src/codex-search.ts +0 -245
  91. package/src/codex-usage.ts +0 -263
  92. package/src/compatibility.ts +0 -55
  93. package/src/dsh-host-adapter.ts +0 -173
  94. package/src/gateway-anthropic-messages.ts +0 -84
  95. package/src/gateway-auth.ts +0 -102
  96. package/src/gateway-backend.ts +0 -274
  97. package/src/gateway-body.ts +0 -49
  98. package/src/gateway-config.ts +0 -76
  99. package/src/gateway-http.ts +0 -104
  100. package/src/gateway-openai-chat.ts +0 -124
  101. package/src/gateway-openai-responses.ts +0 -53
  102. package/src/gateway-parse.ts +0 -224
  103. package/src/gateway-protocol.ts +0 -52
  104. package/src/gateway-routes.ts +0 -158
  105. package/src/gateway.ts +0 -258
  106. package/src/grok-errors.ts +0 -24
  107. package/src/grok-imagine.ts +0 -1627
  108. package/src/grok-import.ts +0 -151
  109. package/src/http-json.ts +0 -82
  110. package/src/ids.ts +0 -59
  111. package/src/imagine-routes.ts +0 -463
  112. package/src/index.ts +0 -735
  113. package/src/invariant.ts +0 -17
  114. package/src/kimi-errors.ts +0 -26
  115. package/src/media-store.ts +0 -927
  116. package/src/oauth-import-routes.ts +0 -324
  117. package/src/oauth-providers.ts +0 -152
  118. package/src/oauth-session.ts +0 -183
  119. package/src/oauth-sources.ts +0 -1104
  120. package/src/oauth.ts +0 -620
  121. package/src/provider.ts +0 -128
  122. package/src/proxy.ts +0 -11
  123. package/src/redact.ts +0 -72
  124. package/src/session.ts +0 -218
  125. package/src/store.ts +0 -217
  126. package/src/web-origin.ts +0 -296
  127. package/src/web-routes.ts +0 -38
@@ -1,325 +0,0 @@
1
- /** Shared inline styles using DSH design tokens. */
2
-
3
- import type { CSSProperties } from "react";
4
- import type { ProviderStatus } from "./types.ts";
5
-
6
- export const TRANSITION = "all 0.15s ease";
7
-
8
- export const pageStyle: CSSProperties = {
9
- display: "flex",
10
- flexDirection: "column",
11
- gap: 16,
12
- width: "100%",
13
- maxWidth: 780,
14
- minWidth: 0,
15
- };
16
- export const titleStyle: CSSProperties = {
17
- margin: 0,
18
- fontSize: 20,
19
- lineHeight: "28px",
20
- fontWeight: 600,
21
- color: "var(--dsw-alias-label-primary)",
22
- };
23
- export const bodyStyle: CSSProperties = {
24
- margin: 0,
25
- fontSize: 14,
26
- lineHeight: "22px",
27
- color: "var(--dsw-alias-label-secondary)",
28
- };
29
- export const cardStyle: CSSProperties = {
30
- display: "flex",
31
- flexDirection: "column",
32
- gap: 14,
33
- padding: "18px 20px",
34
- border: "1px solid var(--dsw-alias-border-l2)",
35
- borderRadius: 12,
36
- background: "var(--dsw-alias-bg-module-platform)",
37
- transition: TRANSITION,
38
- };
39
- export const rowStyle: CSSProperties = {
40
- display: "flex",
41
- alignItems: "center",
42
- justifyContent: "space-between",
43
- flexWrap: "wrap",
44
- gap: 12,
45
- };
46
- export const statusStyle: CSSProperties = {
47
- display: "flex",
48
- alignItems: "center",
49
- gap: 9,
50
- fontSize: 14,
51
- fontWeight: 500,
52
- color: "var(--dsw-alias-label-primary)",
53
- };
54
- export const buttonStyle: CSSProperties = {
55
- boxSizing: "border-box",
56
- minHeight: 34,
57
- padding: "6px 14px",
58
- border: "1px solid var(--dsw-alias-border-l4, rgba(127, 127, 127, 0.4))",
59
- borderRadius: 18,
60
- background: "var(--dsw-alias-button-elevated-fill, var(--dsw-alias-bg-layer-1))",
61
- color: "var(--dsw-alias-label-primary)",
62
- boxShadow: "0 1px 2px rgba(0, 0, 0, 0.18)",
63
- font: "inherit",
64
- fontSize: 14,
65
- fontWeight: 500,
66
- cursor: "pointer",
67
- transition: TRANSITION,
68
- };
69
- export const primaryButtonStyle: CSSProperties = {
70
- ...buttonStyle,
71
- // DSH dark theme flips brand-primary to near-white; use the button/foreground
72
- // pair so primary CTAs stay readable in both light and dark mode.
73
- border: "none",
74
- background: "var(--dsw-alias-button-primary-fill)",
75
- color: "var(--dsw-alias-label-primary-foreground)",
76
- boxShadow: "0 1px 3px rgba(0, 0, 0, 0.28)",
77
- fontWeight: 600,
78
- };
79
- export const compactButtonStyle: CSSProperties = {
80
- ...buttonStyle,
81
- minHeight: 28,
82
- padding: "4px 10px",
83
- fontSize: 13,
84
- borderRadius: 8,
85
- };
86
- export const errorStyle: CSSProperties = { ...bodyStyle, color: "var(--dsw-alias-state-error-primary)" };
87
- export const successStyle: CSSProperties = { ...bodyStyle, color: "var(--dsw-alias-state-success-primary, #22a06b)" };
88
- export const warningStyle: CSSProperties = {
89
- ...bodyStyle,
90
- padding: "10px 12px",
91
- borderRadius: 8,
92
- border: "1px solid color-mix(in srgb, var(--dsw-alias-state-warn-primary, #e06c00) 35%, transparent)",
93
- background: "color-mix(in srgb, var(--dsw-alias-state-warn-primary, #e06c00) 10%, transparent)",
94
- color: "var(--dsw-alias-label-primary)",
95
- };
96
- export const tipStyle: CSSProperties = {
97
- ...bodyStyle,
98
- padding: "10px 12px",
99
- borderRadius: 8,
100
- border: "1px solid var(--dsw-alias-border-l2)",
101
- background: "var(--dsw-alias-bg-layer-1)",
102
- color: "var(--dsw-alias-label-primary)",
103
- };
104
- export const noticeStyle: CSSProperties = {
105
- ...tipStyle,
106
- animation: "dsh-coding-oauth-fade-in 0.2s ease",
107
- };
108
- export const codeStyle: CSSProperties = {
109
- fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",
110
- fontSize: 20,
111
- letterSpacing: "0.08em",
112
- fontWeight: 600,
113
- color: "var(--dsw-alias-label-primary)",
114
- };
115
- export const monoStyle: CSSProperties = { fontFamily: "ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" };
116
- export const snippetStyle: CSSProperties = {
117
- ...monoStyle,
118
- display: "block",
119
- fontSize: 12,
120
- lineHeight: "18px",
121
- padding: "10px 12px",
122
- borderRadius: 8,
123
- border: "1px solid var(--dsw-alias-border-l2)",
124
- background: "var(--dsw-alias-bg-layer-1)",
125
- color: "var(--dsw-alias-label-primary)",
126
- overflowWrap: "anywhere",
127
- whiteSpace: "pre-wrap",
128
- };
129
- export const linkStyle: CSSProperties = { color: "var(--dsw-alias-brand-primary)", wordBreak: "break-all" };
130
- export const listStyle: CSSProperties = {
131
- display: "flex",
132
- flexDirection: "column",
133
- gap: 8,
134
- margin: 0,
135
- padding: 0,
136
- listStyle: "none",
137
- };
138
- export const checkRowStyle: CSSProperties = {
139
- display: "flex",
140
- alignItems: "flex-start",
141
- gap: 8,
142
- fontSize: 14,
143
- color: "var(--dsw-alias-label-primary)",
144
- };
145
- export const inputStyle: CSSProperties = {
146
- boxSizing: "border-box",
147
- width: "100%",
148
- minHeight: 34,
149
- padding: "6px 12px",
150
- border: "1px solid var(--dsw-alias-border-l2)",
151
- borderRadius: 8,
152
- background: "var(--dsw-alias-bg-layer-1)",
153
- color: "var(--dsw-alias-label-primary)",
154
- font: "inherit",
155
- fontSize: 13,
156
- transition: TRANSITION,
157
- };
158
- export const nestedStyle: CSSProperties = {
159
- display: "flex",
160
- flexDirection: "column",
161
- gap: 8,
162
- padding: "12px 14px",
163
- border: "1px solid var(--dsw-alias-border-l2)",
164
- borderRadius: 8,
165
- background: "var(--dsw-alias-bg-layer-1)",
166
- };
167
- export const hintStyle: CSSProperties = { ...bodyStyle, fontSize: 13 };
168
- export const visuallyHiddenStyle: CSSProperties = {
169
- position: "absolute",
170
- width: 1,
171
- height: 1,
172
- padding: 0,
173
- margin: -1,
174
- overflow: "hidden",
175
- clip: "rect(0, 0, 0, 0)",
176
- whiteSpace: "nowrap",
177
- border: 0,
178
- };
179
- export const segmentedNavStyle: CSSProperties = {
180
- display: "inline-flex",
181
- flexWrap: "wrap",
182
- gap: 2,
183
- padding: 3,
184
- borderRadius: 10,
185
- border: "1px solid var(--dsw-alias-border-l2)",
186
- background: "var(--dsw-alias-bg-layer-1)",
187
- };
188
- export const segmentedTabStyle: CSSProperties = {
189
- ...buttonStyle,
190
- border: "none",
191
- borderRadius: 8,
192
- boxShadow: "none",
193
- background: "transparent",
194
- minHeight: 32,
195
- padding: "5px 12px",
196
- fontSize: 13,
197
- };
198
- export const segmentedTabActiveStyle: CSSProperties = {
199
- ...segmentedTabStyle,
200
- background: "var(--dsw-alias-bg-module-platform)",
201
- color: "var(--dsw-alias-label-primary)",
202
- boxShadow: "0 1px 2px rgba(0, 0, 0, 0.12)",
203
- fontWeight: 600,
204
- };
205
- export const panelStyle: CSSProperties = {
206
- display: "flex",
207
- flexDirection: "column",
208
- gap: 14,
209
- minWidth: 0,
210
- };
211
- export const accountGridStyle: CSSProperties = {
212
- display: "grid",
213
- gridTemplateColumns: "repeat(auto-fill, minmax(min(320px, 100%), 1fr))",
214
- gap: 14,
215
- };
216
- export const copyRowStyle: CSSProperties = {
217
- display: "flex",
218
- alignItems: "center",
219
- justifyContent: "space-between",
220
- flexWrap: "wrap",
221
- gap: 8,
222
- };
223
- export const skeletonStyle: CSSProperties = {
224
- ...cardStyle,
225
- minHeight: 88,
226
- background:
227
- "linear-gradient(90deg, var(--dsw-alias-bg-layer-1) 0%, var(--dsw-alias-bg-module-platform) 50%, var(--dsw-alias-bg-layer-1) 100%)",
228
- backgroundSize: "200% 100%",
229
- animation: "dsh-coding-oauth-skeleton-pulse 1.4s ease-in-out infinite",
230
- };
231
- export const stepRowStyle: CSSProperties = {
232
- display: "flex",
233
- alignItems: "flex-start",
234
- gap: 10,
235
- fontSize: 14,
236
- color: "var(--dsw-alias-label-secondary)",
237
- };
238
- export const stepActiveStyle: CSSProperties = {
239
- ...stepRowStyle,
240
- color: "var(--dsw-alias-label-primary)",
241
- fontWeight: 500,
242
- };
243
- export const stepNumberStyle: CSSProperties = {
244
- display: "inline-flex",
245
- alignItems: "center",
246
- justifyContent: "center",
247
- width: 22,
248
- height: 22,
249
- borderRadius: "50%",
250
- flex: "0 0 auto",
251
- fontSize: 12,
252
- fontWeight: 600,
253
- background: "var(--dsw-alias-bg-layer-1)",
254
- border: "1px solid var(--dsw-alias-border-l2)",
255
- color: "var(--dsw-alias-label-secondary)",
256
- };
257
- export const stepNumberActiveStyle: CSSProperties = {
258
- ...stepNumberStyle,
259
- background: "var(--dsw-alias-button-primary-fill)",
260
- borderColor: "var(--dsw-alias-button-primary-fill)",
261
- color: "var(--dsw-alias-label-primary-foreground)",
262
- };
263
-
264
- export type StatusTone = "success" | "error" | "warning" | "info" | "neutral";
265
-
266
- export function statusToneColor(tone: StatusTone): string {
267
- switch (tone) {
268
- case "success":
269
- return "var(--dsw-alias-state-success-primary, #22a06b)";
270
- case "error":
271
- return "var(--dsw-alias-state-error-primary, #d92d20)";
272
- case "warning":
273
- // DSH token is `state-warn-*` (not `state-warning-*`).
274
- return "var(--dsw-alias-state-warn-primary, #e06c00)";
275
- case "info":
276
- // Accent/text color (not a solid fill + white text pair).
277
- return "var(--dsw-alias-brand-primary, #1677ff)";
278
- default:
279
- // Prefer tertiary over dimmed: dimmed is near-invisible on light cards
280
- // and too dark on dark cards.
281
- return "var(--dsw-alias-label-tertiary, #81858c)";
282
- }
283
- }
284
-
285
- export function badgeStyle(tone: StatusTone): CSSProperties {
286
- const color = statusToneColor(tone);
287
- return {
288
- display: "inline-flex",
289
- alignItems: "center",
290
- gap: 6,
291
- padding: "3px 10px",
292
- borderRadius: 999,
293
- fontSize: 12,
294
- fontWeight: 600,
295
- lineHeight: "18px",
296
- color,
297
- background: `color-mix(in srgb, ${color} 14%, transparent)`,
298
- border: `1px solid color-mix(in srgb, ${color} 28%, transparent)`,
299
- whiteSpace: "nowrap",
300
- };
301
- }
302
-
303
- export function dotStyle(
304
- status: ProviderStatus["status"] | "loading" | "available" | "unavailable",
305
- installed = true,
306
- ): CSSProperties {
307
- const color = !installed
308
- ? "var(--dsw-alias-label-tertiary, #81858c)"
309
- : status === "signed-in" || status === "available"
310
- ? "var(--dsw-alias-state-success-primary, #22a06b)"
311
- : status === "error"
312
- ? "var(--dsw-alias-state-error-primary, #d92d20)"
313
- : status === "signing-in" || status === "loading"
314
- ? "var(--dsw-alias-brand-primary, #1677ff)"
315
- : "var(--dsw-alias-label-tertiary, #81858c)";
316
- return { width: 9, height: 9, borderRadius: "50%", flex: "0 0 auto", background: color };
317
- }
318
-
319
- export function providerStatusTone(status: ProviderStatus["status"], installed = true): StatusTone {
320
- if (!installed) return "neutral";
321
- if (status === "signed-in") return "success";
322
- if (status === "error") return "error";
323
- if (status === "signing-in") return "info";
324
- return "neutral";
325
- }
@@ -1,199 +0,0 @@
1
- /** Shared client types for the Coding OAuth settings UI. */
2
-
3
- import type { GrokBuildSettingsKey } from "./locales.ts";
4
-
5
- export type ProviderSlug = "grok" | "codex" | "kimi" | "claude";
6
- export type LoginMethod = "pkce" | "device" | "browser";
7
- export type CatalogSource = "live" | "cache" | "fallback";
8
- export type SourceKind = ProviderSlug;
9
- export type SourceReason = "missing" | "unsafe" | "invalid" | "too_large";
10
- export type SourceConflict =
11
- | "none"
12
- | "same_credential"
13
- | "same_account"
14
- | "different_account"
15
- | "unknown_account"
16
- | "unreadable_destination"
17
- | "unsafe_destination";
18
- export type SourcePreviewAction = "import" | "reuse" | "overwrite" | "blocked";
19
- export type SourceCommitAction = "imported" | "unchanged" | "overwritten";
20
- export type CapabilityFlagKey =
21
- | "codexSearch"
22
- | "codexImages"
23
- | "codexImageEdits"
24
- | "codexImagesAnyModel"
25
- | "codexUsage"
26
- | "codexFast"
27
- | "grokImagineImage"
28
- | "grokImagineVideo";
29
- export type CapabilityLimitKey = "searchResults" | "imageCount" | "videoArtifactTtlMs";
30
- export type CapabilitySettingKey = CapabilityFlagKey | CapabilityLimitKey;
31
- export type SettingsTabId = "accounts" | "capabilities" | "gateway" | "about";
32
- export type CopyField = "openai" | "anthropic" | "key";
33
-
34
- export type GrokStatus =
35
- | { status: "signed-out"; grokImportAvailable: boolean }
36
- | { status: "signing-in"; method: "pkce" | "device"; url?: string; userCode?: string; grokImportAvailable: boolean }
37
- | {
38
- status: "signed-in";
39
- models: string[];
40
- available: string[];
41
- selected: string[];
42
- catalogSource: CatalogSource;
43
- catalogError?: string;
44
- grokImportAvailable: boolean;
45
- }
46
- | { status: "error"; message: string; grokImportAvailable: boolean };
47
-
48
- export type SubscriptionStatus = {
49
- provider: Exclude<ProviderSlug, "grok">;
50
- route: string;
51
- displayName: string;
52
- loginMethods: readonly ("browser" | "device")[];
53
- recommendedLoginMethod: "browser" | "device";
54
- models: string[];
55
- available: string[];
56
- selected: string[];
57
- } & (
58
- | { status: "signed-out" }
59
- | { status: "signing-in"; method: "browser" | "device"; url?: string; userCode?: string }
60
- | { status: "signed-in"; expiresAt?: number }
61
- | { status: "error"; message: string }
62
- );
63
-
64
- export type ProviderStatus = GrokStatus | SubscriptionStatus;
65
-
66
- export interface CodingOAuthStatus {
67
- accessMode: "loopback" | "ssh-tunnel" | "trusted-https-proxy" | "denied";
68
- uiOwner: "standalone" | "hub";
69
- compatibility: {
70
- coreAbi: string;
71
- dshVersion: string | null;
72
- status: "healthy" | "degraded" | "incompatible";
73
- diagnostics: readonly unknown[];
74
- };
75
- providers: {
76
- grok: GrokStatus;
77
- codex: SubscriptionStatus;
78
- kimi: SubscriptionStatus;
79
- claude: SubscriptionStatus;
80
- };
81
- antigravity: { installed: boolean; route: "agy"; management: "cli" };
82
- }
83
-
84
- export interface LoginChallenge {
85
- method: LoginMethod;
86
- url: string;
87
- userCode?: string;
88
- }
89
-
90
- export interface ProviderCardDefinition {
91
- slug: ProviderSlug;
92
- route: string;
93
- titleKey: GrokBuildSettingsKey;
94
- descriptionKey: GrokBuildSettingsKey;
95
- methods: readonly LoginMethod[];
96
- recommended: LoginMethod;
97
- /** Preferred method when the Settings UI is opened on a remote / non-loopback host. */
98
- remoteRecommended?: LoginMethod;
99
- }
100
-
101
- export interface SourceStatus {
102
- kind: SourceKind;
103
- displayPath: string;
104
- available: boolean;
105
- expiresAt?: number;
106
- reason?: SourceReason;
107
- }
108
-
109
- export interface SourcePreview {
110
- previewId: string;
111
- kind: SourceKind;
112
- displayPath: string;
113
- expiresAt?: number;
114
- ticketExpiresAt?: number;
115
- conflict?: SourceConflict;
116
- action?: SourcePreviewAction;
117
- warnings: string[];
118
- confirmOverwriteRequired: boolean;
119
- }
120
-
121
- export interface CapabilityFlags {
122
- codexSearch: boolean;
123
- codexImages: boolean;
124
- codexImageEdits: boolean;
125
- codexImagesAnyModel: boolean;
126
- codexUsage: boolean;
127
- codexFast: boolean;
128
- grokImagineImage: boolean;
129
- grokImagineVideo: boolean;
130
- }
131
-
132
- export interface CapabilitySettingsView extends CapabilityFlags {
133
- searchResults: number;
134
- imageCount: number;
135
- videoArtifactTtlMs: number;
136
- }
137
-
138
- export interface CapabilitySnapshot {
139
- value: CapabilitySettingsView;
140
- revision: number;
141
- writable: boolean;
142
- }
143
-
144
- export interface UsageWindowView {
145
- usedPercent?: number;
146
- remainingPercent?: number;
147
- windowSeconds?: number;
148
- resetsAt?: number;
149
- }
150
-
151
- export interface UsageLimitView {
152
- id: string;
153
- name?: string;
154
- windows: UsageWindowView[];
155
- }
156
-
157
- export interface UsageView {
158
- rateLimits: UsageLimitView[];
159
- creditsUnlimited?: boolean;
160
- creditsBalance?: string;
161
- individualLimit?: string;
162
- individualUsed?: string;
163
- individualRemaining?: string;
164
- individualRemainingPercent?: number;
165
- individualResetsAt?: number;
166
- spendControlReached?: boolean;
167
- resetCredits?: number;
168
- fetchedAt?: number;
169
- }
170
-
171
- export interface ImagineCredentialView {
172
- configured: boolean;
173
- source?: string;
174
- writable?: boolean;
175
- }
176
-
177
- export interface PluginRequestError extends Error {
178
- status: number;
179
- code?: string;
180
- }
181
-
182
- export interface GatewayView {
183
- enabled: boolean;
184
- running: boolean;
185
- bind: string;
186
- port: number;
187
- model: string | null;
188
- keyConfigured: boolean;
189
- keyAvailable: boolean;
190
- keyHint: string;
191
- models: string[];
192
- warning: string;
193
- }
194
-
195
- export interface GrokBuildSettingsInjected {
196
- t: (key: GrokBuildSettingsKey, params?: Record<string, unknown>) => string;
197
- }
198
-
199
- export type GrokBuildSettingsProps = Partial<GrokBuildSettingsInjected>;