@selvajs/compute 4.0.0-beta.3 → 4.0.0-beta.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.
@@ -0,0 +1,458 @@
1
+ //#region src/core/errors.d.ts
2
+ declare const ErrorCodes: {
3
+ readonly NETWORK_ERROR: "NETWORK_ERROR";
4
+ readonly AUTH_ERROR: "AUTH_ERROR";
5
+ readonly VALIDATION_ERROR: "VALIDATION_ERROR";
6
+ readonly COMPUTATION_ERROR: "COMPUTATION_ERROR";
7
+ readonly TIMEOUT_ERROR: "TIMEOUT_ERROR";
8
+ readonly CORS_ERROR: "CORS_ERROR";
9
+ /** HTTP 404 — the endpoint path does not exist on the server (usually a typo'd route or wrong server). Never retried. */
10
+ readonly NOT_FOUND: "NOT_FOUND";
11
+ /** HTTP 429 — the server is rate-limiting requests. Retried by default (honors `Retry-After`); see `RetryPolicy.retryOn429`. */
12
+ readonly RATE_LIMIT: "RATE_LIMIT";
13
+ /**
14
+ * The server answered 2xx but the body is deterministically not JSON (the
15
+ * response declared a non-JSON `Content-Type`, e.g. an HTML captive-portal or
16
+ * proxy login page, or a misconfigured endpoint). Never retried — refetching
17
+ * returns the same page.
18
+ */
19
+ readonly INVALID_RESPONSE: "INVALID_RESPONSE";
20
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
21
+ readonly INVALID_STATE: "INVALID_STATE";
22
+ readonly INVALID_INPUT: "INVALID_INPUT";
23
+ readonly INVALID_CONFIG: "INVALID_CONFIG";
24
+ readonly BROWSER_ONLY: "BROWSER_ONLY";
25
+ readonly ENVIRONMENT_ERROR: "ENVIRONMENT_ERROR";
26
+ readonly ENCODING_ERROR: "ENCODING_ERROR";
27
+ /** An input's `default` had a shape the normalizer didn't recognize (no innerTree key). */
28
+ readonly MALFORMED_DEFAULT: "MALFORMED_DEFAULT";
29
+ /** Scheduler latest-wins: this call was replaced by a newer one. */
30
+ readonly SUPERSEDED: "SUPERSEDED";
31
+ /** Scheduler / caller-supplied AbortSignal: this call was aborted. */
32
+ readonly ABORTED: "ABORTED";
33
+ /**
34
+ * Scheduler backpressure: the queue was already at `maxQueueDepth` when this
35
+ * call arrived, so it was rejected immediately rather than queued. Retryable — the
36
+ * caller (or an HTTP layer, as 503 + Retry-After) should back off and retry.
37
+ * The error `context` carries `{ queueDepth, maxQueueDepth }`.
38
+ */
39
+ readonly QUEUE_FULL: "QUEUE_FULL";
40
+ /**
41
+ * Scheduler backpressure: this call sat queued longer than `queueWaitMs`
42
+ * without starting, so it was rejected before wasting compute on a stale request.
43
+ * Retryable. The error `context` carries `{ waitedMs, queueWaitMs }`.
44
+ */
45
+ readonly QUEUE_TIMEOUT: "QUEUE_TIMEOUT";
46
+ /**
47
+ * A solve referenced a definition by `pointer` (server-side cache key), but the
48
+ * server no longer holds that definition (evicted / GC'd / a different child in
49
+ * the pool / server restarted). The caller should retry with the full
50
+ * definition. Surfaced when the server tags its error body with
51
+ * `code: "definition_not_cached"`, so it survives production message-scrubbing.
52
+ */
53
+ readonly DEFINITION_NOT_CACHED: "DEFINITION_NOT_CACHED";
54
+ };
55
+ type ErrorCode = (typeof ErrorCodes)[keyof typeof ErrorCodes];
56
+ /**
57
+ * Simplified error for Rhino Compute operations
58
+ *
59
+ * @public Use this for error handling with error codes and context.
60
+ */
61
+ declare class ComputeError extends Error {
62
+ readonly code: ErrorCode;
63
+ readonly statusCode?: number;
64
+ readonly context?: Record<string, unknown>;
65
+ readonly originalError?: Error;
66
+ constructor(message: string, code?: ErrorCode, options?: {
67
+ statusCode?: number;
68
+ context?: Record<string, unknown>;
69
+ originalError?: Error;
70
+ });
71
+ /**
72
+ * Create an error for missing/empty values
73
+ */
74
+ static missingValues(inputName: string, expectedType?: string, context?: Record<string, unknown>): ComputeError;
75
+ /**
76
+ * Create an error for unknown parameter type
77
+ */
78
+ static unknownParamType(paramType: string, paramName?: string, context?: Record<string, unknown>): ComputeError;
79
+ }
80
+ //#endregion
81
+ //#region src/core/types.d.ts
82
+ /**
83
+ * Backend wire code (the JSON error body's `code` field) → one of our
84
+ * {@link ErrorCodes}. An unlisted code falls back to the status-based mapping.
85
+ */
86
+ type ServerErrorCodeMap = Record<string, ErrorCode>;
87
+ interface RetryPolicy {
88
+ /** Maximum number of retry attempts after the initial request (default: 0). */
89
+ attempts?: number;
90
+ /** Base delay in milliseconds for exponential backoff (default: 500). */
91
+ baseDelayMs?: number;
92
+ /** Upper bound for backoff delay (default: 30_000). */
93
+ maxDelayMs?: number;
94
+ /** Whether to retry on 429 responses (default: true — honors Retry-After). */
95
+ retryOn429?: boolean;
96
+ }
97
+ interface ComputeConfig {
98
+ serverUrl: string;
99
+ /** Optional API key for authenticating with the server. Sent as {@link apiKeyHeader}. */
100
+ apiKey?: string;
101
+ /**
102
+ * Header name carrying `apiKey`. Defaults to `'RhinoComputeKey'` — the name
103
+ * rhino.compute expects. A different backend sets its own.
104
+ */
105
+ apiKeyHeader?: string;
106
+ /** Optional Bearer token for authentication (e.g., when behind a proxy or API gateway) */
107
+ authToken?: string;
108
+ headers?: Record<string, string>;
109
+ /** Enable debug logging to the console */
110
+ debug?: boolean;
111
+ /** Suppress browser security warnings in the console */
112
+ suppressBrowserWarning?: boolean;
113
+ timeoutMs?: number;
114
+ /**
115
+ * Retry policy for transient errors. Default: no retries.
116
+ */
117
+ retry?: RetryPolicy;
118
+ /**
119
+ * Optional caller-supplied AbortSignal. Composes with the internal timeout —
120
+ * whichever fires first wins. Lets callers cancel in-flight requests
121
+ * (e.g. on component unmount or when superseding a stale solve).
122
+ */
123
+ signal?: AbortSignal;
124
+ /**
125
+ * Machine-readable error codes this backend tags onto its error bodies, mapped
126
+ * to our {@link ErrorCodes}. A code here outranks the status-based mapping.
127
+ * Core knows no backend's codes — the client supplies its own table.
128
+ */
129
+ serverErrorCodes?: ServerErrorCodeMap;
130
+ onServerTiming?: (timing: ServerTiming, requestId: string) => void;
131
+ }
132
+ interface ServerTiming {
133
+ decode?: number;
134
+ solve?: number;
135
+ encode?: number;
136
+ raw: string;
137
+ }
138
+ //#endregion
139
+ //#region src/core/compute-fetch/compute-fetch.d.ts
140
+ /**
141
+ * Generic Rhino Compute fetch function.
142
+ * Sends a POST request to any Compute endpoint with pre-prepared arguments.
143
+ *
144
+ * Use this for advanced, low-level control over compute requests. For most use cases, prefer higher-level APIs.
145
+ *
146
+ * The transport is response-type-agnostic: it does not know which response a
147
+ * given endpoint returns. Callers supply the response type via `R` (defaulting
148
+ * to `unknown`, which forces an explicit narrowing before use).
149
+ *
150
+ * Timeout semantics: `config.timeoutMs` is a PER-ATTEMPT timeout, re-armed for
151
+ * every retry. With `retry: { attempts: N }` the worst-case wall clock is
152
+ * `(N + 1) × timeoutMs` plus backoff sleeps (and a server `Retry-After` can
153
+ * stretch a single sleep up to 60s). For a hard overall deadline, pass
154
+ * `config.signal` (e.g. `AbortSignal.timeout(totalMs)`) — a caller abort wins
155
+ * immediately, including during backoff.
156
+ *
157
+ * Retry caveats: requests are POSTs, so a retry after a mid-flight connection
158
+ * loss may re-execute a request the server already ran (see {@link RetryPolicy}).
159
+ * A 2xx response that declares a non-JSON `Content-Type` (captive portal,
160
+ * proxy login page) fails immediately with `INVALID_RESPONSE` and is never
161
+ * retried; a body that fails to parse under a JSON content-type is treated as
162
+ * a truncated stream and is retried.
163
+ *
164
+ * @typeParam R - The expected response shape. The caller names it at the call site.
165
+ * @param endpoint - The Compute API endpoint (e.g., 'grasshopper', 'io', 'mesh').
166
+ * @param args - Pre-prepared arguments for the request body.
167
+ * @param config - Compute configuration (server URL, API key, timeout, debug, retry, signal).
168
+ * @returns The parsed JSON response from the server, typed as `R`.
169
+ *
170
+ * @example
171
+ * // Basic usage for the Grasshopper endpoint:
172
+ * const response = await fetchCompute(
173
+ * 'grasshopper',
174
+ * { ... },
175
+ * {
176
+ * serverUrl: 'https://my-server.com',
177
+ * debug: true,
178
+ * timeoutMs: 30_000,
179
+ * retry: { attempts: 2 },
180
+ * signal: controller.signal,
181
+ * }
182
+ * );
183
+ */
184
+ declare function fetchCompute<R = unknown>(endpoint: string, args: Record<string, any>, config: ComputeConfig): Promise<R>;
185
+ //#endregion
186
+ //#region src/core/compute-fetch/wire-size.d.ts
187
+ /**
188
+ * Side-channel carrying a response's wire size (its JSON text length) alongside
189
+ * the parsed object, so downstream caches can budget by bytes without
190
+ * re-serializing (audit C2/C3 — the response tree can be hundreds of MB, and
191
+ * every extra `JSON.stringify` pass over it is a real cost).
192
+ *
193
+ * A `WeakMap` rather than a property on the response: the response type is the
194
+ * server's schema, and an extra enumerable field would leak into every
195
+ * `JSON.stringify(response)` on the way back out to clients. Derived copies
196
+ * (e.g. the `algo`-stripped shallow copy in `runSolve`) must re-register — the
197
+ * hint follows object identity, not content.
198
+ *
199
+ * The size is `text.length` (UTF-16 code units), not strict UTF-8 bytes —
200
+ * compute responses are ASCII-dominated JSON (base64 + numerals), so the two
201
+ * are interchangeable for budgeting purposes and `.length` is free.
202
+ */
203
+ /** Record `response`'s wire size. No-op for non-object/null values. */
204
+ declare function setResponseWireSize(response: unknown, size: number): void;
205
+ /** The wire size recorded for `response`, or undefined when never registered. */
206
+ declare function getResponseWireSize(response: unknown): number | undefined;
207
+ //#endregion
208
+ //#region src/core/utils/logger.d.ts
209
+ /**
210
+ * Logger interface for structured logging
211
+ *
212
+ * @public Implement this interface to provide custom logging behavior.
213
+ */
214
+ interface Logger {
215
+ debug(message: string, ...args: unknown[]): void;
216
+ info(message: string, ...args: unknown[]): void;
217
+ warn(message: string, ...args: unknown[]): void;
218
+ error(message: string, ...args: unknown[]): void;
219
+ }
220
+ /**
221
+ * Get the current logger instance
222
+ *
223
+ * @returns The current logger instance
224
+ */
225
+ declare function getLogger(): Logger;
226
+ /**
227
+ * Set a custom logger instance
228
+ *
229
+ * @public Use this to configure custom logging behavior.
230
+ *
231
+ * @param logger - Custom logger implementation or null to disable logging
232
+ * @throws {ComputeError} `INVALID_CONFIG` if the logger is missing any of
233
+ * the four required methods — failing here beats a confusing
234
+ * "getLogger().debug is not a function" at some later, unrelated call site.
235
+ *
236
+ * @example
237
+ * ```typescript
238
+ * import { setLogger } from '@selvajs/compute/core';
239
+ *
240
+ * // Enable console logging
241
+ * setLogger(console);
242
+ *
243
+ * // Use a custom logger
244
+ * setLogger({
245
+ * debug: (msg, ...args) => myLogger.debug(msg, ...args),
246
+ * info: (msg, ...args) => myLogger.info(msg, ...args),
247
+ * warn: (msg, ...args) => myLogger.warn(msg, ...args),
248
+ * error: (msg, ...args) => myLogger.error(msg, ...args)
249
+ * });
250
+ *
251
+ * // Disable logging
252
+ * setLogger(null);
253
+ * ```
254
+ */
255
+ declare function setLogger(logger: Logger | Console | null): void;
256
+ /**
257
+ * Enable debug logging to console
258
+ *
259
+ * @public Convenience method to enable console logging.
260
+ *
261
+ * @example
262
+ * ```typescript
263
+ * import { enableDebugLogging } from '@selvajs/compute/core';
264
+ *
265
+ * enableDebugLogging();
266
+ * ```
267
+ */
268
+ declare function enableDebugLogging(): void;
269
+ //#endregion
270
+ //#region src/core/utils/read-field.d.ts
271
+ /**
272
+ * Case-insensitive single-key reader for wire payloads.
273
+ *
274
+ * The Rhino Compute family serializes the same logical field with different
275
+ * casing depending on the server branch:
276
+ *
277
+ * - mcneel 8.x / 9.x: the IO schema is PascalCase (`ParamType`, `Default`,
278
+ * `InnerTree`, …) because those C# classes carry no `[JsonProperty]`.
279
+ * - VektorNode Compute8: the IO schema is camelCase (`paramType`, `default`,
280
+ * …) because the fork added `[JsonProperty("camelCase")]`, BUT the nested
281
+ * `default` DataTree wrapper stays PascalCase (`ParamName` / `InnerTree`)
282
+ * since `Resthopper.IO.DataTree` is an external type the fork can't attribute.
283
+ *
284
+ * So a single response can mix casings, and which casing a given field uses
285
+ * depends on the server branch. Rather than deep-camelCasing the whole payload
286
+ * (the old `camelcaseKeys` approach — which corrupted user-authored value-list
287
+ * label keys and item `data` JSON), read the specific fields we care about
288
+ * case-insensitively and leave everything else verbatim.
289
+ *
290
+ * Prefers an exact-case match when present, then falls back to the first
291
+ * case-insensitive match. Returns `undefined` when no key matches.
292
+ *
293
+ * @param obj - The source object (any non-object input yields `undefined`).
294
+ * @param name - The logical field name, in any casing.
295
+ */
296
+ declare function readField<T = unknown>(obj: unknown, name: string): T | undefined;
297
+ /**
298
+ * True when `obj` has a key matching `name` (case-insensitively). Distinguishes
299
+ * "field present but value is null/undefined" from "field absent" — needed where
300
+ * presence itself carries meaning (e.g. an `innerTree` that exists but is empty).
301
+ */
302
+ declare function hasField(obj: unknown, name: string): boolean;
303
+ //#endregion
304
+ //#region src/core/utils/encoding.d.ts
305
+ /**
306
+ * Decodes a base64 string to binary data (Uint8Array).
307
+ * Normalizes and validates input per WHATWG forgiving-base64 so both runtimes fail consistently.
308
+ *
309
+ * @param base64File - Base64 encoded string
310
+ * @returns Decoded binary data as Uint8Array
311
+ * @throws {ComputeError} `ENCODING_ERROR` if invalid, or `INVALID_STATE` if decoder unavailable
312
+ */
313
+ declare function decodeBase64ToBinary(base64File: string): Uint8Array;
314
+ //#endregion
315
+ //#region src/core/definition-ref.d.ts
316
+ /**
317
+ * By-reference definition form for solves.
318
+ *
319
+ * Lets a caller that already knows a definition's identity (e.g. a stored
320
+ * version's UUID) schedule solves without materializing the multi-MB bytes:
321
+ * cache keys and the server-pointer map are derived from `key` alone, and
322
+ * `load()` is only called when an upload is genuinely unavoidable (first solve
323
+ * of a definition, or a server-side pointer miss).
324
+ */
325
+ /**
326
+ * A definition identified by a stable key, with bytes materialized on demand.
327
+ *
328
+ * **Immutability contract — read this before constructing one.** `key` must
329
+ * identify IMMUTABLE bytes: every `load()` for a given `key` must return the
330
+ * same content, forever. All caching (the scheduler's result cache, the
331
+ * server-pointer map, and any durable cache built on these keys) trusts the
332
+ * key as the definition's identity WITHOUT looking at the bytes. If two
333
+ * different byte contents ever share a key, cached solves from one are served
334
+ * for the other — silent cache poisoning with no diagnostic. Use an identity
335
+ * that can never be reused for different content (e.g. a version UUID), never
336
+ * a mutable name or path.
337
+ */
338
+ interface DefinitionRef {
339
+ /**
340
+ * Identity of immutable bytes (e.g. a version UUID). Two different byte
341
+ * contents must never share a key — cache poisoning otherwise.
342
+ */
343
+ key: string;
344
+ /**
345
+ * Materialize the bytes. Called ONLY when an upload is unavoidable — inside
346
+ * the solve execution, so it counts toward the solve's abort semantics.
347
+ */
348
+ load: () => Promise<Uint8Array>;
349
+ }
350
+ /**
351
+ * Every definition form accepted by the solve entry points:
352
+ * - a URL, base64 string, or plain string (content-hashed for caching)
353
+ * - raw `.gh` bytes (content-hashed)
354
+ * - a {@link DefinitionRef} (identity-keyed; bytes loaded lazily)
355
+ */
356
+ type SolveDefinition = string | Uint8Array | DefinitionRef;
357
+ /** Narrow a {@link SolveDefinition} to the by-reference form. */
358
+ declare function isDefinitionRef(definition: SolveDefinition): definition is DefinitionRef;
359
+ //#endregion
360
+ //#region src/core/server/validate-server-url.d.ts
361
+ /**
362
+ * The public McNeel endpoint's host — the default blocked host; users must point at
363
+ * their own server. Compared against the parsed hostname lowercased and with any
364
+ * trailing dot stripped, so the FQDN form (`compute.rhino3d.com.`) can't bypass it.
365
+ * Known limitation: the endpoint's raw IP is not blocked — it sits behind a load
366
+ * balancer with no single stable, verifiable address to pin.
367
+ */
368
+ declare const DEFAULT_BLOCKED_HOST = "compute.rhino3d.com";
369
+ interface ValidateServerUrlOptions {
370
+ /**
371
+ * Hostnames rejected as a `serverUrl` — a backend's shared public endpoint,
372
+ * which callers must not point at. Defaults to `[DEFAULT_BLOCKED_HOST]`; pass
373
+ * `[]` to block nothing. Compared lowercased with any trailing dot stripped.
374
+ */
375
+ blockedHosts?: readonly string[];
376
+ }
377
+ /**
378
+ * Validate and normalize a compute `serverUrl`.
379
+ *
380
+ * This is the single source of truth for "is this a usable server URL?" — both
381
+ * `GrasshopperClient` (via `normalizeComputeConfig`) and the standalone-exported
382
+ * `ComputeServerStats` constructor delegate here, so a given URL is accepted or
383
+ * rejected identically no matter which entry point a caller uses.
384
+ *
385
+ * Rules (all enforced, on the *trimmed* input — the trimmed form is what's
386
+ * returned, so no stray whitespace survives into later `fetch` calls):
387
+ * - non-empty (after trim)
388
+ * - `http://` or `https://` scheme (case-insensitive, per RFC 3986)
389
+ * - parseable by `new URL()`
390
+ * - no embedded credentials (`http://user:pass@host`) — `fetch`/`new Request`
391
+ * reject credentialed URLs at runtime, so they must fail here instead
392
+ * - no query string or fragment — endpoint paths are appended to this URL
393
+ * (`${serverUrl}/version`), which a `?…` or `#…` suffix would corrupt
394
+ * - not a blocked host (by default the public McNeel endpoint) — compared by
395
+ * parsed hostname (lowercased, trailing dot stripped), so scheme, casing, port,
396
+ * path, trailing-slash, or FQDN-dot variants can't slip past the block
397
+ *
398
+ * @param raw - The candidate server URL.
399
+ * @param options - Override the blocked-host list for a non-Rhino backend.
400
+ * @returns The trimmed, normalized URL with any trailing slashes removed.
401
+ * @throws {ComputeError} `INVALID_CONFIG` if any rule fails.
402
+ */
403
+ declare function validateServerUrl(raw: string, options?: ValidateServerUrlOptions): string;
404
+ //#endregion
405
+ //#region src/core/files/types.d.ts
406
+ /**
407
+ * Raw file data from Grasshopper/Rhino Compute response, with metadata for processing.
408
+ * Files are typically combined with additional files and packaged into a ZIP archive.
409
+ * @see {@link extractFilesFromComputeResponse} for extraction from compute responses
410
+ */
411
+ type FileData = {
412
+ /** Base filename without extension (e.g., "model") */
413
+ fileName: string;
414
+ /** File content, base64-encoded or plain string depending on isBase64Encoded flag */
415
+ data: string;
416
+ /** File extension including the dot (e.g., ".3dm", ".json"). Appended to fileName to create the full filename */
417
+ fileType: string;
418
+ /** Whether data is base64-encoded. If true, must be decoded to binary before use */
419
+ isBase64Encoded: boolean;
420
+ /** Directory path for archive organization (e.g., "subfolder/nested"). Empty string for root-level files */
421
+ subFolder: string;
422
+ /** Arbitrary metadata attached in Grasshopper. Not interpreted by compute; passed through for downstream consumers. May be absent on older payloads */
423
+ metadata?: Record<string, string>;
424
+ };
425
+ /**
426
+ * Normalized file ready for consumption or archival.
427
+ * Unified intermediate format from FileData or FileBaseInfo, ready to be packaged into archives or returned to callers.
428
+ */
429
+ type ProcessedFile = {
430
+ /** Full filename including extension (e.g., "model.3dm") */
431
+ fileName: string;
432
+ /** File content as binary data (Uint8Array for decoded base64 or fetched binary) or text */
433
+ content: Uint8Array | string;
434
+ /** File path for archive organization (e.g., "subfolder/model.3dm") */
435
+ path: string;
436
+ };
437
+ /**
438
+ * Reference to an external file to be fetched and included in file operations.
439
+ * Specifies additional files (beyond compute response files) to fetch and process as ProcessedFile.
440
+ * @see {@link fetchRemoteFiles} for how FileBaseInfo is fetched and converted
441
+ */
442
+ type FileBaseInfo = {
443
+ /** Destination filename for the file in the archive or result set (e.g., "additional-data.json") */
444
+ fileName: string;
445
+ /** URL to fetch the file from. Must be accessible from the runtime environment */
446
+ filePath: string;
447
+ /** Optional directory path for archive organization (e.g., "extras/docs"). When omitted, file lands at archive root */
448
+ subFolder?: string;
449
+ };
450
+ //#endregion
451
+ //#region src/core/files/handle-files.d.ts
452
+ /** Extracts and processes files from compute response data without downloading them. */
453
+ declare const extractFilesFromComputeResponse: (downloadableFiles: FileData[], additionalFiles?: FileBaseInfo[] | FileBaseInfo | null) => Promise<ProcessedFile[]>;
454
+ /** Downloads files from a compute response as a ZIP archive. */
455
+ declare const downloadFileData: (downloadableFiles: FileData[], fileFoldername: string, additionalFiles?: FileBaseInfo[] | FileBaseInfo | null) => Promise<void>;
456
+ //#endregion
457
+ export { RetryPolicy as C, ErrorCode as D, ComputeError as E, ErrorCodes as O, ComputeConfig as S, ServerTiming as T, getLogger as _, ProcessedFile as a, setResponseWireSize as b, validateServerUrl as c, isDefinitionRef as d, decodeBase64ToBinary as f, enableDebugLogging as g, Logger as h, FileData as i, DefinitionRef as l, readField as m, extractFilesFromComputeResponse as n, DEFAULT_BLOCKED_HOST as o, hasField as p, FileBaseInfo as r, ValidateServerUrlOptions as s, downloadFileData as t, SolveDefinition as u, setLogger as v, ServerErrorCodeMap as w, fetchCompute as x, getResponseWireSize as y };
458
+ //# sourceMappingURL=index-BNsid0_9.d.cts.map