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.
- package/CHANGELOG.md +33 -0
- package/CONTRIBUTING.md +13 -4
- package/INSTALL.md +7 -5
- package/README.de.md +6 -6
- package/README.es.md +6 -6
- package/README.fr.md +6 -6
- package/README.ja.md +6 -6
- package/README.ko.md +6 -6
- package/README.md +6 -6
- package/README.pt-BR.md +6 -6
- package/README.ru.md +6 -6
- package/README.zh-CN.md +6 -6
- package/docs/00-project-rules.md +4 -4
- package/docs/02-architecture.md +7 -3
- package/docs/02-architecture.zh-CN.md +7 -3
- package/lib/bin.js +1333 -569
- package/lib/bin.js.map +4 -4
- package/lib/client.js +1 -1
- package/lib/client.js.map +2 -2
- package/lib/gateway-protocol.d.ts +3 -46
- package/lib/gateway-protocol.d.ts.map +1 -1
- package/lib/gateway-routes.d.ts.map +1 -1
- package/lib/grok-errors.d.ts +2 -12
- package/lib/grok-errors.d.ts.map +1 -1
- package/lib/grok-imagine/client.d.ts +73 -0
- package/lib/grok-imagine/client.d.ts.map +1 -0
- package/lib/grok-imagine/index.d.ts +8 -0
- package/lib/grok-imagine/index.d.ts.map +1 -0
- package/lib/grok-imagine/net.d.ts +10 -0
- package/lib/grok-imagine/net.d.ts.map +1 -0
- package/lib/grok-imagine/parse.d.ts +20 -0
- package/lib/grok-imagine/parse.d.ts.map +1 -0
- package/lib/grok-imagine/types.d.ts +191 -0
- package/lib/grok-imagine/types.d.ts.map +1 -0
- package/lib/grok-imagine.d.ts +3 -263
- package/lib/grok-imagine.d.ts.map +1 -1
- package/lib/http-json.d.ts +2 -9
- package/lib/http-json.d.ts.map +1 -1
- package/lib/index.js +1395 -26178
- package/lib/index.js.map +4 -4
- package/lib/kimi-errors.d.ts +2 -12
- package/lib/kimi-errors.d.ts.map +1 -1
- package/lib/runtime/gateway-protocol.d.ts +47 -0
- package/lib/runtime/gateway-protocol.d.ts.map +1 -0
- package/lib/runtime/grok-errors.d.ts +13 -0
- package/lib/runtime/grok-errors.d.ts.map +1 -0
- package/lib/runtime/http-json.d.ts +10 -0
- package/lib/runtime/http-json.d.ts.map +1 -0
- package/lib/runtime/kimi-errors.d.ts +13 -0
- package/lib/runtime/kimi-errors.d.ts.map +1 -0
- package/package.json +12 -7
- package/scripts/release.mjs +1 -0
- package/src/adapter.ts +0 -348
- package/src/alias-adapter.ts +0 -147
- package/src/auth-routes.ts +0 -921
- package/src/auth.ts +0 -67
- package/src/bin.ts +0 -350
- package/src/capability-routes.ts +0 -279
- package/src/capability-runtime.ts +0 -314
- package/src/capability-settings.ts +0 -671
- package/src/capability-tools.ts +0 -685
- package/src/catalog.ts +0 -271
- package/src/client/GrokBuildSettings.tsx +0 -771
- package/src/client/api.ts +0 -88
- package/src/client/components/AboutTab.tsx +0 -30
- package/src/client/components/AccountsTab.tsx +0 -241
- package/src/client/components/Badge.tsx +0 -33
- package/src/client/components/CapabilitiesTab.tsx +0 -265
- package/src/client/components/CliPullPreview.tsx +0 -116
- package/src/client/components/CopyButton.tsx +0 -57
- package/src/client/components/GatewayTab.tsx +0 -469
- package/src/client/components/NoticeBanner.tsx +0 -46
- package/src/client/components/ProgressBar.tsx +0 -53
- package/src/client/components/ProviderCard.tsx +0 -606
- package/src/client/components/SettingsTabs.tsx +0 -75
- package/src/client/components/ToggleSwitch.tsx +0 -71
- package/src/client/constants.ts +0 -230
- package/src/client/display.ts +0 -61
- package/src/client/dshClientAdapter.ts +0 -127
- package/src/client/gatewaySnippets.ts +0 -37
- package/src/client/index.tsx +0 -156
- package/src/client/locales.ts +0 -540
- package/src/client/microStyles.ts +0 -52
- package/src/client/parsers.ts +0 -398
- package/src/client/styles.ts +0 -325
- package/src/client/types.ts +0 -199
- package/src/codex-http.ts +0 -447
- package/src/codex-images.ts +0 -503
- package/src/codex-model-capabilities.ts +0 -320
- package/src/codex-search.ts +0 -245
- package/src/codex-usage.ts +0 -263
- package/src/compatibility.ts +0 -55
- package/src/dsh-host-adapter.ts +0 -173
- package/src/gateway-anthropic-messages.ts +0 -84
- package/src/gateway-auth.ts +0 -102
- package/src/gateway-backend.ts +0 -274
- package/src/gateway-body.ts +0 -49
- package/src/gateway-config.ts +0 -76
- package/src/gateway-http.ts +0 -104
- package/src/gateway-openai-chat.ts +0 -124
- package/src/gateway-openai-responses.ts +0 -53
- package/src/gateway-parse.ts +0 -224
- package/src/gateway-protocol.ts +0 -52
- package/src/gateway-routes.ts +0 -158
- package/src/gateway.ts +0 -258
- package/src/grok-errors.ts +0 -24
- package/src/grok-imagine.ts +0 -1627
- package/src/grok-import.ts +0 -151
- package/src/http-json.ts +0 -82
- package/src/ids.ts +0 -59
- package/src/imagine-routes.ts +0 -463
- package/src/index.ts +0 -735
- package/src/invariant.ts +0 -17
- package/src/kimi-errors.ts +0 -26
- package/src/media-store.ts +0 -927
- package/src/oauth-import-routes.ts +0 -324
- package/src/oauth-providers.ts +0 -152
- package/src/oauth-session.ts +0 -183
- package/src/oauth-sources.ts +0 -1104
- package/src/oauth.ts +0 -620
- package/src/provider.ts +0 -128
- package/src/proxy.ts +0 -11
- package/src/redact.ts +0 -72
- package/src/session.ts +0 -218
- package/src/store.ts +0 -217
- package/src/web-origin.ts +0 -296
- package/src/web-routes.ts +0 -38
package/lib/grok-imagine.d.ts
CHANGED
|
@@ -5,267 +5,7 @@
|
|
|
5
5
|
* a signed upstream URL.
|
|
6
6
|
* @module dsh-coding-subscription-oauth/grok-imagine
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export declare const GROK_IMAGINE_VIDEO_START_PATH = "/v1/videos/generations";
|
|
12
|
-
export declare const GROK_IMAGINE_IMAGE_MODEL = "grok-imagine-image-2.0";
|
|
13
|
-
export declare const GROK_IMAGINE_VIDEO_MODEL = "grok-imagine-video-1.5";
|
|
14
|
-
export declare const GROK_IMAGINE_IMAGE_TOOL = "grok_imagine_image";
|
|
15
|
-
export declare const GROK_IMAGINE_VIDEO_TOOL = "grok_imagine_video";
|
|
16
|
-
export declare const GROK_IMAGINE_VIDEO_STATUS_TOOL = "grok_imagine_video_status";
|
|
17
|
-
export declare const IMAGINE_IMAGE_ROUTE_PREFIX = "/plugins/dsh-grok-build/imagine/images/";
|
|
18
|
-
/** Frozen xAI output hosts. Callers cannot widen this list. */
|
|
19
|
-
export declare const XAI_OUTPUT_HOSTS: readonly ["imgen.x.ai", "videogen.x.ai", "vidgen.x.ai"];
|
|
20
|
-
export declare const IMAGINE_IMAGE_RESOLUTIONS: readonly ["1k", "2k"];
|
|
21
|
-
export declare const IMAGINE_VIDEO_RESOLUTIONS: readonly ["480p", "720p", "1080p"];
|
|
22
|
-
export declare const IMAGINE_IMAGE_ASPECT_RATIOS: readonly ["1:1", "3:4", "4:3", "9:16", "16:9", "2:3", "3:2", "9:19.5", "19.5:9", "9:20", "20:9", "1:2", "2:1", "auto"];
|
|
23
|
-
export declare const IMAGINE_VIDEO_ASPECT_RATIOS: readonly ["1:1", "16:9", "9:16", "4:3", "3:4", "3:2", "2:3"];
|
|
24
|
-
export declare const IMAGINE_VIDEO_MIN_DURATION_SECONDS = 1;
|
|
25
|
-
export declare const IMAGINE_VIDEO_MAX_DURATION_SECONDS = 15;
|
|
26
|
-
export declare const IMAGINE_IMAGE_MAX_N = 10;
|
|
27
|
-
/**
|
|
28
|
-
* Hard ceilings enforced both at the tool boundary (consumer guard) and inside
|
|
29
|
-
* the Imagine client (defence-in-depth). The prompt ceiling uses UTF-16 code
|
|
30
|
-
* units because that is what the JSON wire format bounds; the image-id arrays
|
|
31
|
-
* are bounded so a runaway caller cannot exhaust the bounded body reader.
|
|
32
|
-
*/
|
|
33
|
-
export declare const IMAGINE_PROMPT_MAX_LENGTH = 4000;
|
|
34
|
-
export declare const IMAGINE_IMAGE_IDS_MIN = 1;
|
|
35
|
-
export declare const IMAGINE_IMAGE_IDS_MAX = 5;
|
|
36
|
-
export declare const DEFAULT_IMAGE_DOWNLOAD_MAX_BYTES: number;
|
|
37
|
-
export declare const DEFAULT_API_TIMEOUT_MS = 30000;
|
|
38
|
-
export declare const DEFAULT_IMAGE_DOWNLOAD_TIMEOUT_MS = 15000;
|
|
39
|
-
export declare const DEFAULT_VIDEO_DOWNLOAD_TIMEOUT_MS = 60000;
|
|
40
|
-
export declare const DEFAULT_MAX_REDIRECTS = 3;
|
|
41
|
-
export declare const DEFAULT_API_JSON_MAX_BYTES: number;
|
|
42
|
-
export declare const MAX_CACHED_VIDEO_JOBS = 256;
|
|
43
|
-
export type ImagineOperation = "image.generate" | "video.start" | "video.status";
|
|
44
|
-
export type ImagineImageResolution = (typeof IMAGINE_IMAGE_RESOLUTIONS)[number];
|
|
45
|
-
export type ImagineVideoResolution = (typeof IMAGINE_VIDEO_RESOLUTIONS)[number];
|
|
46
|
-
export type ImagineImageAspectRatio = (typeof IMAGINE_IMAGE_ASPECT_RATIOS)[number];
|
|
47
|
-
export type ImagineVideoAspectRatio = (typeof IMAGINE_VIDEO_ASPECT_RATIOS)[number];
|
|
48
|
-
export type ImagineApiKeyResolver = (operation: ImagineOperation) => Promise<string>;
|
|
49
|
-
export type ImagineFetch = (input: string | URL, init?: RequestInit) => Promise<Response>;
|
|
50
|
-
export type ImagineDnsLookup = (hostname: string) => Promise<readonly string[]>;
|
|
51
|
-
export type ImagineImageMediaType = "image/png" | "image/jpeg" | "image/webp" | "image/gif";
|
|
52
|
-
export interface ImagineMediaHopRequest {
|
|
53
|
-
timeoutMs: number;
|
|
54
|
-
maxBytes: number;
|
|
55
|
-
accept: string;
|
|
56
|
-
signal?: AbortSignal;
|
|
57
|
-
}
|
|
58
|
-
export interface ImagineMediaHop {
|
|
59
|
-
status: number;
|
|
60
|
-
location?: string;
|
|
61
|
-
contentType?: string;
|
|
62
|
-
data?: Uint8Array;
|
|
63
|
-
}
|
|
64
|
-
/** Single-hop GET. Must not follow redirects or attach credentials. */
|
|
65
|
-
export interface ImagineMediaTransport {
|
|
66
|
-
get(url: URL, request: ImagineMediaHopRequest): Promise<ImagineMediaHop>;
|
|
67
|
-
}
|
|
68
|
-
export interface ImagineDownloadRequest {
|
|
69
|
-
url: string;
|
|
70
|
-
timeoutMs: number;
|
|
71
|
-
maxBytes: number;
|
|
72
|
-
accept: string;
|
|
73
|
-
signal?: AbortSignal;
|
|
74
|
-
}
|
|
75
|
-
export interface ImagineDownloadResult {
|
|
76
|
-
data: Uint8Array;
|
|
77
|
-
contentType?: string;
|
|
78
|
-
}
|
|
79
|
-
/** Full download including redirect revalidation. Production default is pinned. */
|
|
80
|
-
export interface ImagineDownloader {
|
|
81
|
-
download(request: ImagineDownloadRequest): Promise<ImagineDownloadResult>;
|
|
82
|
-
}
|
|
83
|
-
export type GrokImagineErrorCode = "MISSING_CREDENTIAL" | "AUTH" | "QUOTA" | "RATE_LIMIT" | "SSRF" | "INVALID_INPUT" | "UPSTREAM" | "TIMEOUT" | "MEDIA";
|
|
84
|
-
export declare class GrokImagineError extends Error {
|
|
85
|
-
readonly code: GrokImagineErrorCode;
|
|
86
|
-
readonly status?: number;
|
|
87
|
-
constructor(code: GrokImagineErrorCode, message: string, options?: {
|
|
88
|
-
cause?: unknown;
|
|
89
|
-
status?: number;
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
export interface ImagineImageAttachmentRef {
|
|
93
|
-
attachmentId: string;
|
|
94
|
-
mediaType: ImagineImageMediaType;
|
|
95
|
-
bytes: number;
|
|
96
|
-
width: number;
|
|
97
|
-
height: number;
|
|
98
|
-
name?: string;
|
|
99
|
-
}
|
|
100
|
-
export interface ImagineImageLimits {
|
|
101
|
-
maxImageBytes?: number;
|
|
102
|
-
mediaTypes?: readonly string[];
|
|
103
|
-
}
|
|
104
|
-
/** Structural AttachmentStore surface used by Imagine. */
|
|
105
|
-
export interface ImagineAttachmentStore {
|
|
106
|
-
imageLimits?: ImagineImageLimits;
|
|
107
|
-
saveImage(input: {
|
|
108
|
-
data: Uint8Array;
|
|
109
|
-
mediaType: ImagineImageMediaType;
|
|
110
|
-
name?: string;
|
|
111
|
-
}): Promise<ImagineImageAttachmentRef>;
|
|
112
|
-
readImage?(ref: ImagineImageAttachmentRef, signal?: AbortSignal): Promise<{
|
|
113
|
-
ref: ImagineImageAttachmentRef;
|
|
114
|
-
data: Uint8Array;
|
|
115
|
-
}>;
|
|
116
|
-
}
|
|
117
|
-
export interface GenerateImagineImageInput {
|
|
118
|
-
prompt: string;
|
|
119
|
-
model?: string;
|
|
120
|
-
n?: number;
|
|
121
|
-
aspectRatio?: string;
|
|
122
|
-
resolution?: string;
|
|
123
|
-
name?: string;
|
|
124
|
-
}
|
|
125
|
-
export interface ImagineImageResult {
|
|
126
|
-
model: string;
|
|
127
|
-
images: readonly ImaginePersistedImage[];
|
|
128
|
-
attachment: ImagineImageAttachmentRef;
|
|
129
|
-
path: string;
|
|
130
|
-
}
|
|
131
|
-
export interface ImaginePersistedImage {
|
|
132
|
-
attachment: ImagineImageAttachmentRef;
|
|
133
|
-
path: string;
|
|
134
|
-
}
|
|
135
|
-
export interface StartImagineVideoInput {
|
|
136
|
-
prompt: string;
|
|
137
|
-
model?: string;
|
|
138
|
-
duration?: number;
|
|
139
|
-
aspectRatio?: string;
|
|
140
|
-
resolution?: string;
|
|
141
|
-
name?: string;
|
|
142
|
-
}
|
|
143
|
-
export interface ImagineVideoStartResult {
|
|
144
|
-
model: string;
|
|
145
|
-
requestId: string;
|
|
146
|
-
status: "pending";
|
|
147
|
-
}
|
|
148
|
-
export type ImagineVideoJobStatus = "pending" | "completed" | "failed";
|
|
149
|
-
export interface ImagineVideoStatusResult {
|
|
150
|
-
requestId: string;
|
|
151
|
-
status: ImagineVideoJobStatus;
|
|
152
|
-
artifact?: MediaArtifactMeta;
|
|
153
|
-
path?: string;
|
|
154
|
-
error?: string;
|
|
155
|
-
}
|
|
156
|
-
export interface GrokImagineClientOptions {
|
|
157
|
-
resolveApiKey: ImagineApiKeyResolver;
|
|
158
|
-
attachments: ImagineAttachmentStore;
|
|
159
|
-
media: MediaStore;
|
|
160
|
-
/** API-only test seam. Never used for media and never a production default. */
|
|
161
|
-
fetch?: ImagineFetch;
|
|
162
|
-
/** Media downloads. Production default pins DNS at connect time via undici. */
|
|
163
|
-
downloader?: ImagineDownloader;
|
|
164
|
-
now?: () => number;
|
|
165
|
-
imageDownloadTimeoutMs?: number;
|
|
166
|
-
videoDownloadTimeoutMs?: number;
|
|
167
|
-
apiTimeoutMs?: number;
|
|
168
|
-
maxRedirects?: number;
|
|
169
|
-
imageMaxBytes?: number;
|
|
170
|
-
apiJsonMaxBytes?: number;
|
|
171
|
-
}
|
|
172
|
-
export interface ImagineImageDownloadHeaders {
|
|
173
|
-
"Content-Type": string;
|
|
174
|
-
"Content-Length": string;
|
|
175
|
-
"Content-Disposition": string;
|
|
176
|
-
"Cache-Control": string;
|
|
177
|
-
"X-Content-Type-Options": "nosniff";
|
|
178
|
-
}
|
|
179
|
-
export interface ImagineImageDownloadView {
|
|
180
|
-
ref: ImagineImageAttachmentRef;
|
|
181
|
-
body: Uint8Array;
|
|
182
|
-
headers: ImagineImageDownloadHeaders;
|
|
183
|
-
}
|
|
184
|
-
export declare function redactImagineMessage(error: unknown): string;
|
|
185
|
-
/** True when an address is loopback, private, reserved, documentation, or an embedded special form. */
|
|
186
|
-
export declare function isBlockedIp(address: string): boolean;
|
|
187
|
-
export declare function isAllowlistedImagineHost(hostname: string): boolean;
|
|
188
|
-
export declare function grokImagineVideoStatusPath(requestId: string): string;
|
|
189
|
-
export declare function isSafeImagineAttachmentId(attachmentId: string): boolean;
|
|
190
|
-
export declare function imagineImagePath(attachmentId: string): string;
|
|
191
|
-
export declare function parseImagineImagePath(pathname: string): string | undefined;
|
|
192
|
-
export declare function imagineImageDownloadHeaders(ref: ImagineImageAttachmentRef): ImagineImageDownloadHeaders;
|
|
193
|
-
export { IMAGINE_MEDIA_ROUTE_PREFIX, imagineMediaPath, isTrustedImaginePeer };
|
|
194
|
-
export declare function detectImageMediaType(data: Uint8Array): ImagineImageMediaType | undefined;
|
|
195
|
-
export declare function detectVideoMediaType(data: Uint8Array): MediaStoreVideoType | undefined;
|
|
196
|
-
export declare function defaultImagineLookup(hostname: string): Promise<readonly string[]>;
|
|
197
|
-
export declare function assertSafeRemoteMediaUrl(raw: string, lookup: ImagineDnsLookup): Promise<URL>;
|
|
198
|
-
export declare function createPinnedMediaTransport(lookup?: ImagineDnsLookup): ImagineMediaTransport;
|
|
199
|
-
export declare function createPinnedApiFetch(lookup?: ImagineDnsLookup, maxBytes?: number): ImagineFetch;
|
|
200
|
-
export declare function downloadRemoteImagineMedia(initialUrl: string, transport: ImagineMediaTransport, options: {
|
|
201
|
-
lookup: ImagineDnsLookup;
|
|
202
|
-
timeoutMs: number;
|
|
203
|
-
maxBytes: number;
|
|
204
|
-
accept: string;
|
|
205
|
-
maxRedirects: number;
|
|
206
|
-
signal?: AbortSignal;
|
|
207
|
-
}): Promise<ImagineDownloadResult>;
|
|
208
|
-
export declare function createPinnedImagineDownloader(options?: {
|
|
209
|
-
lookup?: ImagineDnsLookup;
|
|
210
|
-
maxRedirects?: number;
|
|
211
|
-
}): ImagineDownloader;
|
|
212
|
-
/**
|
|
213
|
-
* Test-only adapter around an injected fetch. Ordinary mock fetch is not
|
|
214
|
-
* production-safe: it cannot pin DNS at connect time.
|
|
215
|
-
*/
|
|
216
|
-
export declare function createImagineDownloaderFromFetch(fetchImpl: ImagineFetch, options: {
|
|
217
|
-
trustedTestTransport: true;
|
|
218
|
-
lookup?: ImagineDnsLookup;
|
|
219
|
-
maxRedirects?: number;
|
|
220
|
-
}): ImagineDownloader;
|
|
221
|
-
/**
|
|
222
|
-
* Validate a tool-supplied Imagine video `requestId`. Returns the id unchanged
|
|
223
|
-
* on success or throws an `INVALID_INPUT` error. Exposed so capability tools
|
|
224
|
-
* fail closed at the boundary instead of dispatching a malformed id to the
|
|
225
|
-
* internal client.
|
|
226
|
-
*/
|
|
227
|
-
export declare function parseVideoRequestId(value: unknown): string;
|
|
228
|
-
/** Enforce min/max bounds on a candidate image-id array. */
|
|
229
|
-
export declare function clampImagineImageIds(ids: readonly unknown[]): readonly string[];
|
|
230
|
-
export declare class GrokImagineClient {
|
|
231
|
-
private readonly resolveApiKey;
|
|
232
|
-
private readonly attachments;
|
|
233
|
-
private readonly media;
|
|
234
|
-
private readonly apiFetch;
|
|
235
|
-
private readonly downloader;
|
|
236
|
-
private readonly imageDownloadTimeoutMs;
|
|
237
|
-
private readonly videoDownloadTimeoutMs;
|
|
238
|
-
private readonly apiTimeoutMs;
|
|
239
|
-
private readonly maxRedirects;
|
|
240
|
-
private readonly imageMaxBytes;
|
|
241
|
-
private readonly apiJsonMaxBytes;
|
|
242
|
-
private readonly videoResults;
|
|
243
|
-
private readonly videoInflight;
|
|
244
|
-
private readonly disposeController;
|
|
245
|
-
private disposed;
|
|
246
|
-
constructor(options: GrokImagineClientOptions);
|
|
247
|
-
/**
|
|
248
|
-
* Permanently retire this client. In-flight API calls, downloads, and
|
|
249
|
-
* media persistence operations are aborted; subsequent operations fail
|
|
250
|
-
* closed with an `INVALID_INPUT` error until callers construct a new client.
|
|
251
|
-
*/
|
|
252
|
-
dispose(): void;
|
|
253
|
-
/** @returns true once {@link dispose} has been called. */
|
|
254
|
-
get isDisposed(): boolean;
|
|
255
|
-
private assertWritable;
|
|
256
|
-
generateImage(input: GenerateImagineImageInput, signal?: AbortSignal): Promise<ImagineImageResult>;
|
|
257
|
-
startVideo(input: StartImagineVideoInput, signal?: AbortSignal): Promise<ImagineVideoStartResult>;
|
|
258
|
-
videoStatus(requestId: string, options?: {
|
|
259
|
-
name?: string;
|
|
260
|
-
signal?: AbortSignal;
|
|
261
|
-
}): Promise<ImagineVideoStatusResult>;
|
|
262
|
-
private pollVideo;
|
|
263
|
-
private rememberVideo;
|
|
264
|
-
private persistGeneratedImage;
|
|
265
|
-
private resolveCredential;
|
|
266
|
-
private apiJson;
|
|
267
|
-
}
|
|
268
|
-
export declare function createGrokImagineClient(options: GrokImagineClientOptions): GrokImagineClient;
|
|
269
|
-
/** Gate a same-origin image download. Requires an explicit trusted/authz token. */
|
|
270
|
-
export declare function openTrustedImagineImageDownload(attachments: ImagineAttachmentStore, ref: ImagineImageAttachmentRef, authz: TrustedImagineAuthz): Promise<ImagineImageDownloadView>;
|
|
8
|
+
export type { GenerateImagineImageInput, GrokImagineClientOptions, GrokImagineErrorCode, ImagineApiKeyResolver, ImagineAttachmentStore, ImagineDnsLookup, ImagineDownloader, ImagineDownloadRequest, ImagineDownloadResult, ImagineFetch, ImagineImageAspectRatio, ImagineImageAttachmentRef, ImagineImageDownloadHeaders, ImagineImageDownloadView, ImagineImageLimits, ImagineImageMediaType, ImagineImageResolution, ImagineImageResult, ImagineMediaHop, ImagineMediaHopRequest, ImagineMediaTransport, ImagineOperation, ImaginePersistedImage, ImagineVideoAspectRatio, ImagineVideoJobStatus, ImagineVideoResolution, ImagineVideoStartResult, ImagineVideoStatusResult, StartImagineVideoInput, } from "./grok-imagine/index.js";
|
|
9
|
+
export { assertSafeRemoteMediaUrl, clampImagineImageIds, createGrokImagineClient, createImagineDownloaderFromFetch, createPinnedApiFetch, createPinnedImagineDownloader, createPinnedMediaTransport, DEFAULT_API_JSON_MAX_BYTES, DEFAULT_API_TIMEOUT_MS, DEFAULT_IMAGE_DOWNLOAD_MAX_BYTES, DEFAULT_IMAGE_DOWNLOAD_TIMEOUT_MS, DEFAULT_MAX_REDIRECTS, DEFAULT_VIDEO_DOWNLOAD_TIMEOUT_MS, defaultImagineLookup, detectImageMediaType, detectVideoMediaType, downloadRemoteImagineMedia, GROK_IMAGINE_IMAGE_MODEL, GROK_IMAGINE_IMAGE_PATH, GROK_IMAGINE_IMAGE_TOOL, GROK_IMAGINE_VIDEO_MODEL, GROK_IMAGINE_VIDEO_START_PATH, GROK_IMAGINE_VIDEO_STATUS_TOOL, GROK_IMAGINE_VIDEO_TOOL, GrokImagineClient, GrokImagineError, grokImagineVideoStatusPath, IMAGINE_IMAGE_ASPECT_RATIOS, IMAGINE_IMAGE_IDS_MAX, IMAGINE_IMAGE_IDS_MIN, IMAGINE_IMAGE_MAX_N, IMAGINE_IMAGE_RESOLUTIONS, IMAGINE_IMAGE_ROUTE_PREFIX, IMAGINE_PROMPT_MAX_LENGTH, IMAGINE_VIDEO_ASPECT_RATIOS, IMAGINE_VIDEO_MAX_DURATION_SECONDS, IMAGINE_VIDEO_MIN_DURATION_SECONDS, IMAGINE_VIDEO_RESOLUTIONS, imagineImageDownloadHeaders, imagineImagePath, isAllowlistedImagineHost, isBlockedIp, isSafeImagineAttachmentId, MAX_CACHED_VIDEO_JOBS, openTrustedImagineImageDownload, parseImagineImagePath, parseVideoRequestId, redactImagineMessage, XAI_API_ORIGIN, XAI_OUTPUT_HOSTS, } from "./grok-imagine/index.js";
|
|
10
|
+
export { IMAGINE_MEDIA_ROUTE_PREFIX, imagineMediaPath, isTrustedImaginePeer } from "./media-store.js";
|
|
271
11
|
//# sourceMappingURL=grok-imagine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grok-imagine.d.ts","sourceRoot":"","sources":["../../src/grok-imagine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"grok-imagine.d.ts","sourceRoot":"","sources":["../../src/grok-imagine.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,YAAY,EACX,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,sBAAsB,EACtB,gBAAgB,EAChB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,uBAAuB,EACvB,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EAClB,eAAe,EACf,sBAAsB,EACtB,qBAAqB,EACrB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,sBAAsB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACN,wBAAwB,EACxB,oBAAoB,EACpB,uBAAuB,EACvB,gCAAgC,EAChC,oBAAoB,EACpB,6BAA6B,EAC7B,0BAA0B,EAC1B,0BAA0B,EAC1B,sBAAsB,EACtB,gCAAgC,EAChC,iCAAiC,EACjC,qBAAqB,EACrB,iCAAiC,EACjC,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,0BAA0B,EAC1B,wBAAwB,EACxB,uBAAuB,EACvB,uBAAuB,EACvB,wBAAwB,EACxB,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,0BAA0B,EAC1B,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,EACrB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,kCAAkC,EAClC,kCAAkC,EAClC,yBAAyB,EACzB,2BAA2B,EAC3B,gBAAgB,EAChB,wBAAwB,EACxB,WAAW,EACX,yBAAyB,EACzB,qBAAqB,EACrB,+BAA+B,EAC/B,qBAAqB,EACrB,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,EACd,gBAAgB,GAChB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,0BAA0B,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC"}
|
package/lib/http-json.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare class JsonRequestError extends Error {
|
|
4
|
-
readonly statusCode: 400 | 413;
|
|
5
|
-
constructor(statusCode: 400 | 413, message: string);
|
|
6
|
-
}
|
|
7
|
-
/** Read one JSON request body with a strict in-memory ceiling. */
|
|
8
|
-
export declare function readJsonRequest(request: IncomingMessage, limit?: number): Promise<unknown>;
|
|
9
|
-
export declare function requestErrorStatus(error: unknown, fallback: number): number;
|
|
1
|
+
/** Compatibility facade — implementation lives in `src/runtime/` (mirrored from Hub vendor core). */
|
|
2
|
+
export { JSON_BODY_LIMIT_BYTES, JsonRequestError, readJsonRequest, requestErrorStatus, } from "./runtime/http-json.js";
|
|
10
3
|
//# sourceMappingURL=http-json.d.ts.map
|
package/lib/http-json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-json.d.ts","sourceRoot":"","sources":["../../src/http-json.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"http-json.d.ts","sourceRoot":"","sources":["../../src/http-json.ts"],"names":[],"mappings":"AAAA,qGAAqG;AAErG,OAAO,EACN,qBAAqB,EACrB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,GAClB,MAAM,wBAAwB,CAAC"}
|