@tangle-network/sandbox 0.4.3 → 0.5.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.
@@ -0,0 +1,292 @@
1
+ //#region src/intelligence/index.d.ts
2
+ /**
3
+ * `@tangle-network/sandbox/intelligence` — browser-safe typed client for the
4
+ * hosted trace-read surface on Tangle Intelligence
5
+ * (`https://intelligence.tangle.tools`, default port 3030).
6
+ *
7
+ * This is a SEPARATE host from the Sandbox API. The SDK's `IntelligenceClient`
8
+ * (exposed as `client.intelligence`) routes intelligence-*report* calls through
9
+ * `SandboxClient.fetch` against the **sandbox** `baseUrl` — that is the
10
+ * sandbox-api intelligence-report surface, a different service. The trace-read
11
+ * routes (`/v1/traces`, `/v1/runs*`, `/v1/sessions*`) live on intelligence-api
12
+ * and are tenant-scoped by the customer key, so this client does NOT reuse
13
+ * `SandboxClient.fetch`; it carries its own intelligence-host base URL.
14
+ *
15
+ * Auth is the customer key (`sk-tan-*`) sent as `Authorization: Bearer ...`;
16
+ * the platform resolves it to the caller's tenant and filters `tenant_id`
17
+ * first and unconditionally on every route, so a cross-tenant id returns an
18
+ * empty result or 404, never the row.
19
+ *
20
+ * Nothing here uses a Node API — `globalThis.fetch` only — so it runs in the
21
+ * browser, Cloudflare Workers, Deno, and Node 20+ unchanged. The base URL must
22
+ * be supplied by the caller (e.g. from `TANGLE_INTELLIGENCE_BASE_URL`) or it
23
+ * falls back to the production host.
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * import { createIntelligenceClient } from "@tangle-network/sandbox/intelligence";
28
+ *
29
+ * const intel = createIntelligenceClient({
30
+ * apiKey: process.env.TANGLE_API_KEY!,
31
+ * baseUrl: process.env.TANGLE_INTELLIGENCE_BASE_URL,
32
+ * });
33
+ *
34
+ * const { items } = await intel.listTraces({ status: "ERROR", limit: 20 });
35
+ * for await (const span of intel.iterateTraceSpans(items[0].traceId)) {
36
+ * console.log(span.name, span.durationMs);
37
+ * }
38
+ * ```
39
+ *
40
+ * @packageDocumentation
41
+ */
42
+ /**
43
+ * Production intelligence-api host. Mirrors the api-side
44
+ * `DEFAULT_INTELLIGENCE_BASE_URL` so the SDK default and the server default
45
+ * never drift.
46
+ */
47
+ declare const DEFAULT_INTELLIGENCE_BASE_URL = "https://intelligence.tangle.tools";
48
+ interface IntelligenceClientConfig {
49
+ /** Tangle customer API key (`sk-tan-*`). Sent as `Authorization: Bearer ...`. */
50
+ apiKey: string;
51
+ /**
52
+ * Intelligence-api base URL. Defaults to {@link DEFAULT_INTELLIGENCE_BASE_URL}.
53
+ * Pass `TANGLE_INTELLIGENCE_BASE_URL` here to point at a non-prod host; do NOT
54
+ * pass the sandbox `baseUrl` — these routes live on a different service.
55
+ */
56
+ baseUrl?: string;
57
+ /** Per-request timeout. Default: 30000 (30s). */
58
+ timeoutMs?: number;
59
+ }
60
+ /**
61
+ * A bigint nanosecond timestamp rendered as a decimal string — JSON cannot
62
+ * carry a bigint, so the wire format is the same OTLP-JSON decimal-string
63
+ * convention the service accepts on ingest.
64
+ */
65
+ type NanoString = string;
66
+ /** Trace status filter: `ERROR` = the trace has ≥1 error span; `OK` = none. */
67
+ type TraceStatus = "ERROR" | "OK";
68
+ /** One row of the tenant-wide trace explorer (`GET /v1/traces`). */
69
+ interface TraceSummary {
70
+ traceId: string;
71
+ spanCount: number;
72
+ startUnixNano: NanoString;
73
+ endUnixNano: NanoString;
74
+ /** `(maxEnd - minStart) / 1e6`. */
75
+ durationMs: number;
76
+ errorCount: number;
77
+ /** Null (never 0) when no span in the trace was priced. */
78
+ costUsd: number | null;
79
+ inputTokens: number | null;
80
+ outputTokens: number | null;
81
+ /** Name of the earliest span by `start_unix_nano`. */
82
+ rootName: string | null;
83
+ /** Model of the earliest span by `start_unix_nano`. */
84
+ model: string | null;
85
+ runId: string | null;
86
+ }
87
+ /** A page of trace summaries plus the keyset cursor for the next page. */
88
+ interface TraceSummaryList {
89
+ items: TraceSummary[];
90
+ /** Opaque cursor for the next page; `null` at the end of the stream. */
91
+ nextCursor: string | null;
92
+ }
93
+ /**
94
+ * One trace-span row on the wire — every stored column passed through, the two
95
+ * bigint nano columns rendered as decimal strings. Already redacted at ingest.
96
+ */
97
+ interface SerializedSpan {
98
+ /** Span PK, `<traceId>:<spanId>`. */
99
+ id: string;
100
+ tenantId: string;
101
+ traceId: string;
102
+ parentSpanId: string | null;
103
+ name: string;
104
+ startUnixNano: NanoString;
105
+ endUnixNano: NanoString;
106
+ /** Redacted-at-ingest span attribute bag. */
107
+ attributes: Record<string, unknown>;
108
+ events: Array<Record<string, unknown>> | null;
109
+ statusCode: string | null;
110
+ statusMessage: string | null;
111
+ redactionVersion: string | null;
112
+ model: string | null;
113
+ inputTokens: number | null;
114
+ outputTokens: number | null;
115
+ /** `numeric(12,6)` as a string; `null` when the model is unpriced. */
116
+ costUsd: string | null;
117
+ runId: string | null;
118
+ scenarioId: string | null;
119
+ generation: number | null;
120
+ cellId: string | null;
121
+ sessionId: string | null;
122
+ threadId: string | null;
123
+ userId: string | null;
124
+ receivedAt: string;
125
+ }
126
+ /** A keyset page of one trace's spans plus its full span count. */
127
+ interface SpanPage {
128
+ items: SerializedSpan[];
129
+ /** True when the trace's total span count exceeds one page. */
130
+ truncated: boolean;
131
+ /** The trace's full span count, independent of the page. */
132
+ total: number;
133
+ /** Opaque cursor for the next page; `null` at the end of the trace. */
134
+ nextCursor: string | null;
135
+ }
136
+ /** A bounded window of a run's spans (run-pivoted reads are not paginated). */
137
+ interface RunSpanWindow {
138
+ items: SerializedSpan[];
139
+ truncated: boolean;
140
+ total: number;
141
+ }
142
+ /**
143
+ * An eval-run row. Numeric metrics are numeric columns rendered as strings.
144
+ * `additionalProperties` on the wire — the row carries more columns than the
145
+ * documented core, so the type is open.
146
+ */
147
+ interface Run {
148
+ id: string;
149
+ tenantId: string;
150
+ runDir: string | null;
151
+ status: string;
152
+ gateDecision: string | null;
153
+ totalCostUsd: string | null;
154
+ totalDurationMs: number | null;
155
+ holdoutLift: string | null;
156
+ labels: Record<string, unknown> | null;
157
+ receivedAt: string;
158
+ [key: string]: unknown;
159
+ }
160
+ /** A page of eval-runs. Offset is legacy; follow `nextCursor` to paginate. */
161
+ interface RunList {
162
+ items: Run[];
163
+ limit: number;
164
+ offset: number;
165
+ nextCursor: string | null;
166
+ }
167
+ /** One row of the tenant-wide session explorer (`GET /v1/sessions`). */
168
+ interface SessionSummary {
169
+ sessionId: string;
170
+ traceCount: number;
171
+ spanCount: number;
172
+ firstSeen: string;
173
+ lastSeen: string;
174
+ /** Null (never 0) when no span in the session was priced. */
175
+ totalCostUsd: number | null;
176
+ errorCount: number;
177
+ userId: string | null;
178
+ }
179
+ /** A page of session summaries plus the keyset cursor for the next page. */
180
+ interface SessionSummaryList {
181
+ items: SessionSummary[];
182
+ nextCursor: string | null;
183
+ }
184
+ /** Query params for {@link IntelligenceClient.listTraces}. */
185
+ interface ListTracesParams {
186
+ /** Page size, clamped server-side to `[1, 200]` (default 50). */
187
+ limit?: number;
188
+ /** ISO-8601 lower bound on `received_at` (inclusive). */
189
+ from?: string;
190
+ /** ISO-8601 upper bound on `received_at` (inclusive). */
191
+ to?: string;
192
+ /** Case-insensitive substring over span name (matches if ANY span matches). */
193
+ q?: string;
194
+ /** Exact model match (matches if any span carried this model). */
195
+ model?: string;
196
+ /** Exact `run_id` match. */
197
+ runId?: string;
198
+ /** `ERROR` = ≥1 error span; `OK` = no error span anywhere in the trace. */
199
+ status?: TraceStatus;
200
+ /** Opaque cursor from the prior response's `nextCursor`. */
201
+ cursor?: string;
202
+ }
203
+ /** Query params for {@link IntelligenceClient.getTraceSpans}. */
204
+ interface GetTraceSpansParams {
205
+ /** Page size, clamped server-side to `INTELLIGENCE_TRACE_SPAN_LIMIT`. */
206
+ limit?: number;
207
+ /** Opaque cursor over `(start_unix_nano, span id)` from the prior page. */
208
+ cursor?: string;
209
+ }
210
+ /** Query params for {@link IntelligenceClient.listRuns}. */
211
+ interface ListRunsParams {
212
+ limit?: number;
213
+ /** Legacy offset pagination; ignored once `cursor` is supplied. */
214
+ offset?: number;
215
+ status?: "started" | "baseline-complete" | "generation-complete" | "gate-decided" | "finished" | "errored";
216
+ gate?: "ship" | "hold" | "need_more_work" | "model_ceiling" | "arch_ceiling";
217
+ /** Case-insensitive substring over `run_dir`. */
218
+ q?: string;
219
+ from?: string;
220
+ to?: string;
221
+ /** `key:value` over the run's labels jsonb. */
222
+ label?: string;
223
+ cursor?: string;
224
+ }
225
+ /** Query params for {@link IntelligenceClient.listSessions}. */
226
+ interface ListSessionsParams {
227
+ limit?: number;
228
+ from?: string;
229
+ to?: string;
230
+ /** Case-insensitive substring over `session_id`. */
231
+ q?: string;
232
+ /** Exact end-user match (`user_id` span column). */
233
+ userId?: string;
234
+ cursor?: string;
235
+ }
236
+ /** Query params for {@link IntelligenceClient.getSessionTraces}. */
237
+ interface GetSessionTracesParams {
238
+ limit?: number;
239
+ cursor?: string;
240
+ }
241
+ /**
242
+ * Browser-safe typed client for the Tangle Intelligence trace-read surface.
243
+ * Construct via {@link createIntelligenceClient}.
244
+ */
245
+ interface IntelligenceClient {
246
+ /** List tenant-wide trace summaries (one row per trace), newest first. */
247
+ listTraces(params?: ListTracesParams): Promise<TraceSummaryList>;
248
+ /** List one trace's spans, keyset-paginated. */
249
+ getTraceSpans(traceId: string, params?: GetTraceSpansParams): Promise<SpanPage>;
250
+ /**
251
+ * Stream the FULL span set of one trace as NDJSON. The returned
252
+ * `ReadableStream` yields the raw bytes (one JSON span per line); decode it
253
+ * yourself, or use {@link iterateTraceSpans} to walk parsed spans page by
254
+ * page without the bulk endpoint.
255
+ */
256
+ exportTraceSpansNdjson(traceId: string): Promise<ReadableStream<Uint8Array>>;
257
+ /** List the tenant's eval-runs, newest first. */
258
+ listRuns(params?: ListRunsParams): Promise<RunList>;
259
+ /** Fetch a single eval-run. */
260
+ getRun(runId: string): Promise<Run>;
261
+ /** List the spans pivoted to this run (by `run_id`), bounded window. */
262
+ getRunTraces(runId: string): Promise<RunSpanWindow>;
263
+ /** List tenant-wide session summaries (one row per session), newest first. */
264
+ listSessions(params?: ListSessionsParams): Promise<SessionSummaryList>;
265
+ /** List one session's traces as the trace-summary shape, keyset-paginated. */
266
+ getSessionTraces(sessionId: string, params?: GetSessionTracesParams): Promise<TraceSummaryList>;
267
+ /**
268
+ * Async iterator over the spans of one trace, following the keyset cursor
269
+ * page by page so a trace larger than one page is walkable end-to-end
270
+ * without the NDJSON bulk endpoint.
271
+ */
272
+ iterateTraceSpans(traceId: string, params?: GetTraceSpansParams): AsyncGenerator<SerializedSpan, void, unknown>;
273
+ /**
274
+ * Async iterator over every trace summary, following `nextCursor` page by
275
+ * page until the stream ends.
276
+ */
277
+ iterateTraces(params?: ListTracesParams): AsyncGenerator<TraceSummary, void, unknown>;
278
+ /**
279
+ * Async iterator over every session summary, following `nextCursor` page by
280
+ * page until the stream ends.
281
+ */
282
+ iterateSessions(params?: ListSessionsParams): AsyncGenerator<SessionSummary, void, unknown>;
283
+ }
284
+ /**
285
+ * Create a browser-safe client for the Tangle Intelligence trace-read surface.
286
+ *
287
+ * @param config.apiKey Customer key (`sk-tan-*`) — Bearer auth, resolved to a tenant.
288
+ * @param config.baseUrl Intelligence-api host; defaults to {@link DEFAULT_INTELLIGENCE_BASE_URL}.
289
+ */
290
+ declare function createIntelligenceClient(config: IntelligenceClientConfig): IntelligenceClient;
291
+ //#endregion
292
+ export { DEFAULT_INTELLIGENCE_BASE_URL, GetSessionTracesParams, GetTraceSpansParams, IntelligenceClient, IntelligenceClientConfig, ListRunsParams, ListSessionsParams, ListTracesParams, NanoString, Run, RunList, RunSpanWindow, SerializedSpan, SessionSummary, SessionSummaryList, SpanPage, TraceStatus, TraceSummary, TraceSummaryList, createIntelligenceClient };
@@ -0,0 +1 @@
1
+ const a0_0x3919a2=a0_0x1fe0;(function(_0x26720e,_0x1cac7a){const _0x52b4c8=a0_0x1fe0,_0x1f5903=_0x26720e();while(!![]){try{const _0x412fd8=-parseInt(_0x52b4c8(0x199))/0x1*(-parseInt(_0x52b4c8(0x17e))/0x2)+parseInt(_0x52b4c8(0x16b))/0x3+parseInt(_0x52b4c8(0x171))/0x4+parseInt(_0x52b4c8(0x176))/0x5+parseInt(_0x52b4c8(0x194))/0x6*(parseInt(_0x52b4c8(0x190))/0x7)+parseInt(_0x52b4c8(0x19a))/0x8+-parseInt(_0x52b4c8(0x186))/0x9*(parseInt(_0x52b4c8(0x17c))/0xa);if(_0x412fd8===_0x1cac7a)break;else _0x1f5903['push'](_0x1f5903['shift']());}catch(_0x1f9a0a){_0x1f5903['push'](_0x1f5903['shift']());}}}(a0_0x3d70,0x2d77a));import{f as a0_0x583336,r as a0_0x206eb1,u as a0_0x155c81}from'\x2e\x2e\x2f\x65\x72\x72\x6f\x72\x73\x2d\x43\x6c\x6a\x69\x47\x52\x5f\x5f\x2e\x6a\x73';const DEFAULT_INTELLIGENCE_BASE_URL=a0_0x3919a2(0x191),DEFAULT_TIMEOUT_MS=0x7530;function a0_0x3d70(){const _0x3c35a0=['\x71\x4e\x4c\x4a\x74\x32\x4b','\x72\x4d\x39\x55\x44\x68\x4f','\x43\x33\x72\x48\x44\x68\x76\x5a','\x7a\x4e\x6a\x56\x42\x71','\x71\x4b\x58\x4e\x76\x4b\x79','\x6e\x64\x65\x57\x6e\x74\x48\x72\x75\x65\x7a\x4d\x71\x4c\x75','\x44\x67\x4c\x54\x7a\x77\x39\x31\x44\x65\x31\x5a','\x72\x4d\x66\x50\x42\x67\x76\x4b\x69\x68\x72\x56\x69\x67\x6e\x56\x42\x4d\x35\x4c\x79\x33\x71\x47\x44\x67\x38\x47\x73\x77\x35\x30\x7a\x77\x58\x53\x41\x77\x44\x4c\x42\x4d\x6e\x4c\x69\x65\x66\x71\x73\x74\x4f\x47','\x71\x77\x6a\x56\x43\x4e\x72\x66\x43\x4e\x6a\x56\x43\x47','\x72\x4b\x35\x57\x79\x30\x69','\x43\x67\x66\x59\x43\x32\x75','\x7a\x4d\x76\x30\x79\x32\x47','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x63\x31\x48\x43\x67\x4b','\x43\x32\x76\x30','\x6c\x33\x79\x58\x6c\x33\x6e\x4c\x43\x33\x6e\x50\x42\x32\x35\x5a\x6c\x57','\x6d\x4a\x69\x5a\x6d\x5a\x69\x57\x6d\x33\x48\x50\x74\x65\x7a\x32\x42\x47','\x41\x68\x72\x30\x43\x68\x6d\x36\x6c\x59\x39\x50\x42\x4e\x72\x4c\x42\x67\x58\x50\x7a\x32\x76\x55\x79\x32\x75\x55\x44\x67\x66\x55\x7a\x32\x58\x4c\x6c\x4e\x72\x56\x42\x32\x58\x5a','\x41\x78\x72\x4c\x42\x78\x6d','\x42\x4e\x76\x4e\x7a\x33\x71','\x6e\x4d\x35\x6d\x43\x4b\x4c\x74\x41\x47','\x6c\x33\x6e\x57\x79\x77\x35\x5a\x6c\x4d\x35\x4b\x41\x4e\x6e\x56\x42\x47','\x41\x67\x76\x48\x7a\x67\x76\x59\x43\x57','\x71\x4d\x66\x6c\x45\x77\x43','\x74\x76\x44\x77\x76\x77\x4f','\x6d\x5a\x7a\x6f\x43\x65\x50\x77\x72\x67\x69','\x6f\x74\x47\x35\x6d\x64\x69\x30\x42\x65\x48\x5a\x41\x77\x7a\x6e','\x79\x78\x62\x50\x73\x32\x76\x35','\x42\x67\x4c\x54\x41\x78\x71','\x71\x4e\x7a\x71\x73\x68\x6d','\x71\x4d\x76\x48\x43\x4d\x76\x59\x69\x61','\x73\x77\x35\x30\x7a\x77\x58\x53\x41\x77\x44\x4c\x42\x4d\x6e\x4c\x69\x65\x66\x71\x73\x73\x62\x59\x7a\x78\x72\x31\x43\x4d\x35\x4c\x7a\x63\x62\x48\x42\x49\x62\x6f\x72\x65\x50\x74\x74\x30\x34\x47\x7a\x78\x48\x57\x42\x33\x6a\x30\x69\x68\x44\x50\x44\x67\x47\x47\x42\x4d\x38\x47\x79\x4d\x39\x4b\x45\x73\x62\x5a\x44\x68\x6a\x4c\x79\x77\x30','\x72\x75\x39\x77\x73\x77\x71','\x7a\x32\x66\x30\x7a\x71','\x6c\x33\x72\x59\x79\x77\x6e\x4c\x43\x57','\x42\x77\x39\x4b\x7a\x77\x57','\x6c\x33\x79\x58\x6c\x33\x6a\x31\x42\x4e\x6d\x56','\x43\x32\x4c\x4e\x42\x4d\x66\x53','\x76\x75\x39\x76\x71\x4b\x43','\x41\x75\x6a\x71\x42\x32\x34','\x79\x33\x76\x59\x43\x32\x39\x59','\x42\x4d\x76\x34\x44\x65\x6e\x31\x43\x4e\x6e\x56\x43\x47','\x6e\x64\x79\x57\x6d\x64\x79\x31\x7a\x4b\x58\x72\x72\x66\x50\x59','\x42\x77\x76\x5a\x43\x32\x66\x4e\x7a\x71','\x71\x77\x4c\x30\x71\x76\x61','\x6c\x33\x6e\x57\x79\x77\x35\x5a','\x43\x4e\x76\x55\x73\x77\x71','\x79\x77\x6a\x56\x43\x4e\x71','\x6e\x4a\x65\x5a\x6d\x64\x69\x30\x42\x30\x48\x58\x79\x4b\x39\x57','\x43\x32\x4c\x36\x7a\x71','\x75\x4c\x50\x4b\x73\x4b\x6d','\x44\x78\x6e\x4c\x43\x4b\x4c\x4b','\x6c\x33\x79\x58\x6c\x33\x72\x59\x79\x77\x6e\x4c\x43\x57','\x6d\x74\x47\x58\x6d\x64\x65\x57\x6d\x66\x66\x54\x73\x4c\x6e\x67\x41\x71','\x42\x32\x7a\x4d\x43\x32\x76\x30','\x7a\x78\x76\x30\x77\x4c\x4b','\x72\x30\x76\x75','\x79\x4d\x39\x4b\x45\x71','\x6c\x33\x79\x58\x6c\x33\x6e\x4c\x43\x33\x6e\x50\x42\x32\x35\x5a','\x6d\x4a\x61\x35\x6d\x66\x4c\x62\x72\x77\x39\x67\x73\x61','\x7a\x33\x66\x74\x44\x65\x71','\x6d\x74\x75\x33\x6f\x65\x76\x75\x41\x77\x4c\x36\x72\x61','\x72\x77\x50\x77\x71\x33\x61','\x6c\x33\x79\x58\x6c\x33\x72\x59\x79\x77\x6e\x4c\x43\x59\x38'];a0_0x3d70=function(){return _0x3c35a0;};return a0_0x3d70();}function appendParam(_0x31275b,_0x15cb0d,_0x24b894){const _0x3b191c=a0_0x3919a2,_0x5735d7={'\x65\x75\x74\x5a\x59':function(_0x2ad842,_0x2d7c4e){return _0x2ad842===_0x2d7c4e;}};if(_0x5735d7[_0x3b191c(0x178)](_0x24b894,void 0x0))return;_0x31275b[_0x3b191c(0x18e)](_0x15cb0d,String(_0x24b894));}function createIntelligenceClient(_0x46db48){const _0x29013a=a0_0x3919a2,_0x469c6d={'\x42\x4c\x67\x56\x46':function(_0x5c9c4e,_0x2f5adc,_0x4d8fe3){return _0x5c9c4e(_0x2f5adc,_0x4d8fe3);},'\x76\x66\x58\x75\x4c':function(_0x450c57,_0x2e8739){return _0x450c57 instanceof _0x2e8739;},'\x67\x71\x53\x74\x44':_0x29013a(0x18d),'\x52\x5a\x64\x4a\x43':function(_0xe00585,_0x38f7d9){return _0xe00585(_0x38f7d9);},'\x45\x6a\x56\x43\x70':function(_0x4dac08,_0x4d63f2,_0x52323e,_0x406bbb){return _0x4dac08(_0x4d63f2,_0x52323e,_0x406bbb);},'\x69\x42\x50\x6f\x6e':function(_0x18eecb,_0xa63352){return _0x18eecb>_0xa63352;},'\x41\x69\x74\x41\x50':function(_0x3c2f81,_0xd8a683,_0x1209ae,_0x3bea76){return _0x3c2f81(_0xd8a683,_0x1209ae,_0x3bea76);},'\x46\x4e\x70\x63\x42':function(_0x3ee33a,_0x5f4a6f,_0x2cc726,_0x5d8d08){return _0x3ee33a(_0x5f4a6f,_0x2cc726,_0x5d8d08);},'\x50\x6a\x75\x44\x65':function(_0x3d9a73,_0x19f0e1){return _0x3d9a73(_0x19f0e1);},'\x4d\x57\x56\x55\x6a':function(_0x573cad,_0x106ca){return _0x573cad(_0x106ca);},'\x42\x76\x50\x48\x73':function(_0x3df8bd,_0x419e10,_0x26ecf7,_0x2e8c13,_0x20cf40){return _0x3df8bd(_0x419e10,_0x26ecf7,_0x2e8c13,_0x20cf40);},'\x42\x79\x63\x4f\x69':_0x29013a(0x160),'\x6a\x55\x67\x74\x6c':function(_0x1c2b3d,_0x46b076,_0x20fea5,_0x4870c9){return _0x1c2b3d(_0x46b076,_0x20fea5,_0x4870c9);},'\x46\x6f\x6e\x74\x7a':function(_0x3c9a55,_0x574f77,_0x29fe80,_0xf3233c){return _0x3c9a55(_0x574f77,_0x29fe80,_0xf3233c);},'\x55\x4f\x55\x42\x47':function(_0x10d2ae,_0x19e475){return _0x10d2ae(_0x19e475);},'\x6e\x75\x67\x67\x74':function(_0x3059e1,_0x22ba97){return _0x3059e1(_0x22ba97);},'\x4e\x61\x6d\x6c\x59':_0x29013a(0x174),'\x62\x6b\x6c\x61\x48':function(_0x41ed5c,_0x25c9b7){return _0x41ed5c(_0x25c9b7);},'\x42\x61\x4b\x79\x67':function(_0x5ae9cb,_0x4929a7){return _0x5ae9cb(_0x4929a7);},'\x45\x4f\x56\x49\x64':function(_0x54caa7,_0x5b2c3c){return _0x54caa7(_0x5b2c3c);},'\x58\x79\x52\x45\x68':'\x63\x72\x65\x61\x74\x65\x49\x6e\x74\x65\x6c\x6c\x69\x67\x65\x6e\x63\x65\x43\x6c\x69\x65\x6e\x74\x3a\x20\x61\x70\x69\x4b\x65\x79\x20\x69\x73\x20\x72\x65\x71\x75\x69\x72\x65\x64'};if(!_0x46db48[_0x29013a(0x19b)])throw new Error(_0x469c6d['\x58\x79\x52\x45\x68']);const _0x3132af=_0x46db48[_0x29013a(0x19b)],_0x33fa3e=(_0x46db48['\x62\x61\x73\x65\x55\x72\x6c']??_0x29013a(0x191))['\x72\x65\x70\x6c\x61\x63\x65'](/\/$/,''),_0x4591e8=_0x46db48[_0x29013a(0x187)]??DEFAULT_TIMEOUT_MS;async function _0x4d47da(_0x2f1f32){const _0xd3a109=_0x29013a,_0x11f2e1=''+_0x33fa3e+_0x2f1f32,_0x3468be=new AbortController(),_0x1b6991=_0x469c6d[_0xd3a109(0x185)](setTimeout,()=>_0x3468be[_0xd3a109(0x170)](),_0x4591e8);try{return await globalThis[_0xd3a109(0x18c)](_0x11f2e1,{'\x68\x65\x61\x64\x65\x72\x73':{'\x41\x75\x74\x68\x6f\x72\x69\x7a\x61\x74\x69\x6f\x6e':_0xd3a109(0x15f)+_0x3132af,'\x41\x63\x63\x65\x70\x74':'\x61\x70\x70\x6c\x69\x63\x61\x74\x69\x6f\x6e\x2f\x6a\x73\x6f\x6e'},'\x73\x69\x67\x6e\x61\x6c':_0x3468be[_0xd3a109(0x166)]});}catch(_0x32235d){if(_0x469c6d['\x76\x66\x58\x75\x4c'](_0x32235d,Error)&&_0x32235d['\x6e\x61\x6d\x65']===_0xd3a109(0x189))throw new a0_0x155c81(_0x4591e8);throw new a0_0x206eb1(_0xd3a109(0x188)+(_0x32235d instanceof Error?_0x32235d[_0xd3a109(0x16c)]:String(_0x32235d)),_0x32235d instanceof Error?_0x32235d:void 0x0,{'\x65\x6e\x64\x70\x6f\x69\x6e\x74':_0x2f1f32,'\x6f\x72\x69\x67\x69\x6e':_0x469c6d[_0xd3a109(0x17d)]});}finally{clearTimeout(_0x1b6991);}}async function _0x3a5b61(_0x1284e2){const _0x3bced0=_0x29013a,_0x54c74f=await _0x469c6d['\x52\x5a\x64\x4a\x43'](_0x4d47da,_0x1284e2),_0x2688d7=await _0x54c74f['\x74\x65\x78\x74']();if(!_0x54c74f['\x6f\x6b'])throw a0_0x583336(_0x54c74f['\x73\x74\x61\x74\x75\x73'],_0x2688d7,{'\x6d\x65\x74\x68\x6f\x64':_0x3bced0(0x179),'\x70\x61\x74\x68':_0x1284e2},_0x54c74f[_0x3bced0(0x196)]);return JSON[_0x3bced0(0x18b)](_0x2688d7);}async function _0x3cbec8(_0x314cb0={}){const _0x18b6ba=_0x29013a,_0x586490=new URLSearchParams();return _0x469c6d['\x45\x6a\x56\x43\x70'](appendParam,_0x586490,_0x18b6ba(0x19c),_0x314cb0[_0x18b6ba(0x19c)]),appendParam(_0x586490,_0x18b6ba(0x184),_0x314cb0[_0x18b6ba(0x184)]),appendParam(_0x586490,'\x74\x6f',_0x314cb0['\x74\x6f']),appendParam(_0x586490,'\x71',_0x314cb0['\x71']),appendParam(_0x586490,_0x18b6ba(0x164),_0x314cb0[_0x18b6ba(0x164)]),appendParam(_0x586490,_0x18b6ba(0x16f),_0x314cb0[_0x18b6ba(0x16f)]),appendParam(_0x586490,_0x18b6ba(0x183),_0x314cb0[_0x18b6ba(0x183)]),appendParam(_0x586490,_0x18b6ba(0x169),_0x314cb0[_0x18b6ba(0x169)]),_0x469c6d['\x52\x5a\x64\x4a\x43'](_0x3a5b61,_0x18b6ba(0x175)+(_0x469c6d[_0x18b6ba(0x168)](_0x586490['\x73\x69\x7a\x65'],0x0)?'\x3f'+_0x586490:''));}async function _0x37f689(_0x4307d7,_0x1926d9={}){const _0x178536=_0x29013a,_0x504228=new URLSearchParams();_0x469c6d[_0x178536(0x16d)](appendParam,_0x504228,_0x178536(0x19c),_0x1926d9['\x6c\x69\x6d\x69\x74']),_0x469c6d[_0x178536(0x18a)](appendParam,_0x504228,_0x178536(0x169),_0x1926d9[_0x178536(0x169)]);const _0x1137a1=_0x504228[_0x178536(0x172)]>0x0?'\x3f'+_0x504228:'';return _0x3a5b61(_0x178536(0x180)+_0x469c6d['\x50\x6a\x75\x44\x65'](encodeURIComponent,_0x4307d7)+_0x178536(0x16e)+_0x1137a1);}async function _0x26ded7(_0x22edb9){const _0xc2e630=_0x29013a,_0x3aa277='\x2f\x76\x31\x2f\x74\x72\x61\x63\x65\x73\x2f'+_0x469c6d['\x50\x6a\x75\x44\x65'](encodeURIComponent,_0x22edb9)+_0xc2e630(0x195),_0xf20471=await _0x469c6d[_0xc2e630(0x198)](_0x4d47da,_0x3aa277);if(!_0xf20471['\x6f\x6b']){const _0x2aef05=await _0xf20471['\x74\x65\x78\x74']();throw _0x469c6d[_0xc2e630(0x19d)](a0_0x583336,_0xf20471[_0xc2e630(0x183)],_0x2aef05,{'\x6d\x65\x74\x68\x6f\x64':_0xc2e630(0x179),'\x70\x61\x74\x68':_0x3aa277},_0xf20471[_0xc2e630(0x196)]);}if(!_0xf20471['\x62\x6f\x64\x79'])throw new a0_0x206eb1(_0x469c6d[_0xc2e630(0x181)],{'\x65\x6e\x64\x70\x6f\x69\x6e\x74':_0x3aa277,'\x6f\x72\x69\x67\x69\x6e':_0xc2e630(0x18d)});return _0xf20471[_0xc2e630(0x17a)];}async function _0x4fc9cc(_0x5e50b3={}){const _0x1f9600=_0x29013a,_0x55f368=new URLSearchParams();return appendParam(_0x55f368,'\x6c\x69\x6d\x69\x74',_0x5e50b3[_0x1f9600(0x19c)]),appendParam(_0x55f368,_0x1f9600(0x177),_0x5e50b3[_0x1f9600(0x177)]),_0x469c6d['\x45\x6a\x56\x43\x70'](appendParam,_0x55f368,'\x73\x74\x61\x74\x75\x73',_0x5e50b3[_0x1f9600(0x183)]),_0x469c6d['\x6a\x55\x67\x74\x6c'](appendParam,_0x55f368,_0x1f9600(0x162),_0x5e50b3[_0x1f9600(0x162)]),appendParam(_0x55f368,'\x71',_0x5e50b3['\x71']),appendParam(_0x55f368,_0x1f9600(0x184),_0x5e50b3[_0x1f9600(0x184)]),_0x469c6d[_0x1f9600(0x182)](appendParam,_0x55f368,'\x74\x6f',_0x5e50b3['\x74\x6f']),appendParam(_0x55f368,'\x6c\x61\x62\x65\x6c',_0x5e50b3['\x6c\x61\x62\x65\x6c']),_0x469c6d[_0x1f9600(0x17f)](appendParam,_0x55f368,_0x1f9600(0x169),_0x5e50b3[_0x1f9600(0x169)]),_0x469c6d[_0x1f9600(0x167)](_0x3a5b61,'\x2f\x76\x31\x2f\x72\x75\x6e\x73'+(_0x55f368['\x73\x69\x7a\x65']>0x0?'\x3f'+_0x55f368:''));}async function _0x327eb7(_0x568f9b){const _0x1ab09a=_0x29013a;return _0x469c6d[_0x1ab09a(0x173)](_0x3a5b61,_0x1ab09a(0x165)+_0x469c6d[_0x1ab09a(0x193)](encodeURIComponent,_0x568f9b));}async function _0x762770(_0x2e5427){const _0x569672=_0x29013a;return _0x3a5b61(_0x569672(0x165)+_0x469c6d[_0x569672(0x167)](encodeURIComponent,_0x2e5427)+_0x569672(0x163));}async function _0x5e5686(_0x558a7a={}){const _0x1138d3=_0x29013a,_0x32358b=new URLSearchParams();return appendParam(_0x32358b,_0x1138d3(0x19c),_0x558a7a[_0x1138d3(0x19c)]),appendParam(_0x32358b,_0x1138d3(0x184),_0x558a7a[_0x1138d3(0x184)]),appendParam(_0x32358b,'\x74\x6f',_0x558a7a['\x74\x6f']),appendParam(_0x32358b,'\x71',_0x558a7a['\x71']),appendParam(_0x32358b,_0x469c6d['\x4e\x61\x6d\x6c\x59'],_0x558a7a['\x75\x73\x65\x72\x49\x64']),appendParam(_0x32358b,_0x1138d3(0x169),_0x558a7a['\x63\x75\x72\x73\x6f\x72']),_0x469c6d['\x62\x6b\x6c\x61\x48'](_0x3a5b61,_0x1138d3(0x17b)+(_0x469c6d[_0x1138d3(0x168)](_0x32358b['\x73\x69\x7a\x65'],0x0)?'\x3f'+_0x32358b:''));}async function _0x11e1a5(_0x2c303d,_0x58f79c={}){const _0x284aa6=_0x29013a,_0x454b3a=new URLSearchParams();appendParam(_0x454b3a,_0x284aa6(0x19c),_0x58f79c[_0x284aa6(0x19c)]),appendParam(_0x454b3a,_0x284aa6(0x169),_0x58f79c[_0x284aa6(0x169)]);const _0x132b08=_0x454b3a[_0x284aa6(0x172)]>0x0?'\x3f'+_0x454b3a:'';return _0x469c6d[_0x284aa6(0x197)](_0x3a5b61,_0x284aa6(0x18f)+encodeURIComponent(_0x2c303d)+_0x284aa6(0x163)+_0x132b08);}async function*_0x8051d5(_0x4aca4a,_0x2268c9={}){const _0x56e52e=_0x29013a;let _0x27dfa2=_0x2268c9['\x63\x75\x72\x73\x6f\x72'];for(;;){const _0x106d81=await _0x37f689(_0x4aca4a,{..._0x2268c9,'\x63\x75\x72\x73\x6f\x72':_0x27dfa2});for(const _0x41ce90 of _0x106d81[_0x56e52e(0x192)])yield _0x41ce90;if(!_0x106d81[_0x56e52e(0x16a)])return;_0x27dfa2=_0x106d81['\x6e\x65\x78\x74\x43\x75\x72\x73\x6f\x72'];}}async function*_0x361c8e(_0x5376d4={}){const _0x210e44=_0x29013a;let _0x47844a=_0x5376d4[_0x210e44(0x169)];for(;;){const _0x1f79c3=await _0x3cbec8({..._0x5376d4,'\x63\x75\x72\x73\x6f\x72':_0x47844a});for(const _0x2663b2 of _0x1f79c3[_0x210e44(0x192)])yield _0x2663b2;if(!_0x1f79c3['\x6e\x65\x78\x74\x43\x75\x72\x73\x6f\x72'])return;_0x47844a=_0x1f79c3[_0x210e44(0x16a)];}}async function*_0x8071eb(_0x3c83d6={}){const _0x504ccd=_0x29013a;let _0x190fa=_0x3c83d6[_0x504ccd(0x169)];for(;;){const _0x5561ec=await _0x469c6d[_0x504ccd(0x161)](_0x5e5686,{..._0x3c83d6,'\x63\x75\x72\x73\x6f\x72':_0x190fa});for(const _0x4befd2 of _0x5561ec[_0x504ccd(0x192)])yield _0x4befd2;if(!_0x5561ec[_0x504ccd(0x16a)])return;_0x190fa=_0x5561ec[_0x504ccd(0x16a)];}}return{'\x6c\x69\x73\x74\x54\x72\x61\x63\x65\x73':_0x3cbec8,'\x67\x65\x74\x54\x72\x61\x63\x65\x53\x70\x61\x6e\x73':_0x37f689,'\x65\x78\x70\x6f\x72\x74\x54\x72\x61\x63\x65\x53\x70\x61\x6e\x73\x4e\x64\x6a\x73\x6f\x6e':_0x26ded7,'\x6c\x69\x73\x74\x52\x75\x6e\x73':_0x4fc9cc,'\x67\x65\x74\x52\x75\x6e':_0x327eb7,'\x67\x65\x74\x52\x75\x6e\x54\x72\x61\x63\x65\x73':_0x762770,'\x6c\x69\x73\x74\x53\x65\x73\x73\x69\x6f\x6e\x73':_0x5e5686,'\x67\x65\x74\x53\x65\x73\x73\x69\x6f\x6e\x54\x72\x61\x63\x65\x73':_0x11e1a5,'\x69\x74\x65\x72\x61\x74\x65\x54\x72\x61\x63\x65\x53\x70\x61\x6e\x73':_0x8051d5,'\x69\x74\x65\x72\x61\x74\x65\x54\x72\x61\x63\x65\x73':_0x361c8e,'\x69\x74\x65\x72\x61\x74\x65\x53\x65\x73\x73\x69\x6f\x6e\x73':_0x8071eb};}function a0_0x1fe0(_0x289b8e,_0x1abe5e){_0x289b8e=_0x289b8e-0x15f;const _0x3d7096=a0_0x3d70();let _0x1fe010=_0x3d7096[_0x289b8e];if(a0_0x1fe0['\x6c\x66\x51\x63\x64\x52']===undefined){var _0x48d066=function(_0x32d581){const _0x253356='\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x2b\x2f\x3d';let _0x53882d='',_0x5dfce3='';for(let _0x21b7ed=0x0,_0x26b246,_0x3248bb,_0x266f66=0x0;_0x3248bb=_0x32d581['\x63\x68\x61\x72\x41\x74'](_0x266f66++);~_0x3248bb&&(_0x26b246=_0x21b7ed%0x4?_0x26b246*0x40+_0x3248bb:_0x3248bb,_0x21b7ed++%0x4)?_0x53882d+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&_0x26b246>>(-0x2*_0x21b7ed&0x6)):0x0){_0x3248bb=_0x253356['\x69\x6e\x64\x65\x78\x4f\x66'](_0x3248bb);}for(let _0x5f2e4b=0x0,_0x16ceea=_0x53882d['\x6c\x65\x6e\x67\x74\x68'];_0x5f2e4b<_0x16ceea;_0x5f2e4b++){_0x5dfce3+='\x25'+('\x30\x30'+_0x53882d['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x5f2e4b)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(_0x5dfce3);};a0_0x1fe0['\x41\x68\x6b\x73\x4d\x51']=_0x48d066,a0_0x1fe0['\x58\x6b\x57\x49\x6e\x4c']={},a0_0x1fe0['\x6c\x66\x51\x63\x64\x52']=!![];}const _0x5460a2=_0x3d7096[0x0],_0x716815=_0x289b8e+_0x5460a2,_0x3472c4=a0_0x1fe0['\x58\x6b\x57\x49\x6e\x4c'][_0x716815];return!_0x3472c4?(_0x1fe010=a0_0x1fe0['\x41\x68\x6b\x73\x4d\x51'](_0x1fe010),a0_0x1fe0['\x58\x6b\x57\x49\x6e\x4c'][_0x716815]=_0x1fe010):_0x1fe010=_0x3472c4,_0x1fe010;}export{DEFAULT_INTELLIGENCE_BASE_URL,createIntelligenceClient};