@tangle-network/sandbox 0.0.0-develop.20260601225751.b012f8a → 0.0.0-develop.20260608062026.e6c3e81

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_0x40dc12=a0_0x3f86;(function(_0x543118,_0x4840c4){const _0x12f295=a0_0x3f86,_0x3f6493=_0x543118();while(!![]){try{const _0x33cd31=-parseInt(_0x12f295(0x173))/0x1+-parseInt(_0x12f295(0x196))/0x2+parseInt(_0x12f295(0x1bb))/0x3+parseInt(_0x12f295(0x1b0))/0x4+parseInt(_0x12f295(0x19f))/0x5*(parseInt(_0x12f295(0x1aa))/0x6)+parseInt(_0x12f295(0x1b1))/0x7*(parseInt(_0x12f295(0x17d))/0x8)+parseInt(_0x12f295(0x1ba))/0x9*(-parseInt(_0x12f295(0x19c))/0xa);if(_0x33cd31===_0x4840c4)break;else _0x3f6493['push'](_0x3f6493['shift']());}catch(_0x141bd6){_0x3f6493['push'](_0x3f6493['shift']());}}}(a0_0x5db6,0x32189));function a0_0x5db6(){const _0x5367a3=['\x43\x4e\x76\x55\x73\x77\x71','\x42\x4d\x66\x54\x7a\x71','\x79\x4c\x72\x6b\x41\x76\x6d','\x6d\x74\x6d\x32\x45\x75\x58\x57\x43\x4e\x76\x56','\x6c\x33\x6e\x57\x79\x77\x35\x5a\x6c\x4d\x35\x4b\x41\x4e\x6e\x56\x42\x47','\x44\x32\x44\x4e\x7a\x75\x79','\x71\x75\x76\x75\x75\x30\x53','\x6c\x33\x79\x58\x6c\x33\x6a\x31\x42\x4e\x6d','\x42\x4d\x76\x34\x44\x65\x6e\x31\x43\x4e\x6e\x56\x43\x47','\x44\x67\x76\x34\x44\x61','\x79\x78\x62\x50\x73\x32\x76\x35','\x6c\x33\x79\x58\x6c\x33\x6e\x4c\x43\x33\x6e\x50\x42\x32\x35\x5a\x6c\x57','\x79\x77\x6a\x56\x43\x4e\x71','\x42\x32\x7a\x4d\x43\x32\x76\x30','\x42\x77\x76\x5a\x43\x32\x66\x4e\x7a\x71','\x41\x32\x58\x6f\x45\x68\x79','\x45\x4c\x72\x6b\x75\x76\x71','\x45\x4c\x76\x6f\x43\x68\x43','\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','\x43\x32\x4c\x36\x7a\x71','\x74\x31\x66\x57\x74\x75\x71','\x6c\x33\x79\x58\x6c\x33\x6e\x4c\x43\x33\x6e\x50\x42\x32\x35\x5a','\x79\x33\x6a\x4c\x79\x78\x72\x4c\x73\x77\x35\x30\x7a\x77\x58\x53\x41\x77\x44\x4c\x42\x4d\x6e\x4c\x71\x32\x58\x50\x7a\x77\x35\x30\x6f\x49\x62\x48\x43\x67\x4c\x6c\x7a\x78\x4b\x47\x41\x78\x6d\x47\x43\x4d\x76\x58\x44\x77\x4c\x59\x7a\x77\x71','\x76\x4d\x6e\x6c\x44\x68\x43','\x71\x4d\x76\x48\x43\x4d\x76\x59\x69\x61','\x41\x67\x76\x48\x7a\x67\x76\x59\x43\x57','\x45\x65\x50\x4d\x72\x31\x69','\x43\x32\x66\x55\x7a\x67\x6a\x56\x45\x63\x31\x48\x43\x67\x4b','\x6d\x4a\x47\x34\x6f\x74\x75\x30\x44\x67\x4c\x4e\x43\x78\x6a\x4b','\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','\x73\x32\x54\x4c\x71\x4c\x4f','\x44\x77\x44\x67\x76\x65\x4b','\x42\x67\x66\x49\x7a\x77\x57','\x6c\x33\x79\x58\x6c\x33\x72\x59\x79\x77\x6e\x4c\x43\x59\x38','\x6d\x74\x43\x33\x6f\x64\x79\x59\x6d\x65\x35\x6d\x74\x75\x76\x36\x44\x57','\x71\x76\x7a\x48\x7a\x67\x65','\x7a\x4e\x6a\x56\x42\x71','\x6e\x74\x4b\x58\x6e\x4a\x71\x57\x45\x68\x50\x31\x43\x76\x76\x33','\x6c\x33\x72\x59\x79\x77\x6e\x4c\x43\x57','\x72\x30\x76\x75','\x41\x4d\x6e\x4a\x73\x75\x69','\x75\x30\x72\x48\x73\x66\x71','\x41\x78\x72\x4c\x42\x78\x6d','\x77\x65\x48\x36\x42\x4d\x53','\x41\x75\x35\x63\x71\x30\x4f','\x43\x4d\x76\x57\x42\x67\x66\x4a\x7a\x71','\x42\x77\x39\x4b\x7a\x77\x57','\x44\x78\x6e\x4c\x43\x4b\x4c\x4b','\x6d\x74\x6a\x78\x42\x30\x44\x5a\x41\x4c\x75','\x43\x32\x4c\x4e\x42\x4d\x66\x53','\x7a\x4d\x76\x30\x79\x32\x47','\x45\x75\x76\x55\x76\x75\x57','\x44\x67\x4c\x54\x7a\x77\x39\x31\x44\x65\x31\x5a','\x79\x4d\x66\x5a\x7a\x76\x76\x59\x42\x61','\x6d\x4a\x79\x5a\x6d\x64\x43\x32\x72\x4e\x72\x73\x41\x68\x62\x49','\x6d\x74\x71\x34\x6d\x64\x4b\x35\x74\x66\x72\x36\x44\x31\x48\x65','\x41\x33\x7a\x49\x44\x33\x6d','\x42\x67\x4c\x54\x41\x78\x71','\x72\x4d\x6a\x78\x72\x66\x6d','\x7a\x32\x66\x30\x7a\x71','\x79\x33\x76\x59\x43\x32\x39\x59','\x43\x32\x76\x30','\x7a\x4e\x4c\x62\x45\x4d\x57','\x7a\x32\x6a\x34\x72\x30\x43','\x6d\x74\x48\x4c\x41\x30\x31\x52\x71\x77\x30','\x6e\x5a\x65\x58\x6d\x4a\x4b\x33\x41\x78\x76\x76\x44\x66\x50\x31','\x43\x4d\x35\x63\x77\x4d\x4b','\x71\x78\x66\x4c\x76\x31\x61','\x6d\x74\x4b\x5a\x6e\x5a\x4b\x35\x72\x66\x44\x41\x73\x75\x58\x36','\x79\x4d\x39\x4b\x45\x71','\x7a\x66\x44\x32\x79\x4c\x4f','\x79\x78\x62\x57\x42\x67\x4c\x4a\x79\x78\x72\x50\x42\x32\x34\x56\x41\x4e\x6e\x56\x42\x47','\x6c\x33\x6e\x57\x79\x77\x35\x5a','\x7a\x33\x66\x53\x75\x65\x38','\x43\x33\x72\x48\x44\x68\x76\x5a'];a0_0x5db6=function(){return _0x5367a3;};return a0_0x5db6();}function a0_0x3f86(_0x50c92b,_0x1e40e7){_0x50c92b=_0x50c92b-0x172;const _0x5db656=a0_0x5db6();let _0x3f86a0=_0x5db656[_0x50c92b];if(a0_0x3f86['\x62\x74\x63\x43\x7a\x50']===undefined){var _0x52cbc0=function(_0x413e01){const _0x3cc747='\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 _0xb8e488='',_0x44f0b6='';for(let _0x30c750=0x0,_0x2b67e8,_0x48c175,_0x3c3d52=0x0;_0x48c175=_0x413e01['\x63\x68\x61\x72\x41\x74'](_0x3c3d52++);~_0x48c175&&(_0x2b67e8=_0x30c750%0x4?_0x2b67e8*0x40+_0x48c175:_0x48c175,_0x30c750++%0x4)?_0xb8e488+=String['\x66\x72\x6f\x6d\x43\x68\x61\x72\x43\x6f\x64\x65'](0xff&_0x2b67e8>>(-0x2*_0x30c750&0x6)):0x0){_0x48c175=_0x3cc747['\x69\x6e\x64\x65\x78\x4f\x66'](_0x48c175);}for(let _0x36a57a=0x0,_0x11802d=_0xb8e488['\x6c\x65\x6e\x67\x74\x68'];_0x36a57a<_0x11802d;_0x36a57a++){_0x44f0b6+='\x25'+('\x30\x30'+_0xb8e488['\x63\x68\x61\x72\x43\x6f\x64\x65\x41\x74'](_0x36a57a)['\x74\x6f\x53\x74\x72\x69\x6e\x67'](0x10))['\x73\x6c\x69\x63\x65'](-0x2);}return decodeURIComponent(_0x44f0b6);};a0_0x3f86['\x5a\x70\x6c\x6a\x4d\x79']=_0x52cbc0,a0_0x3f86['\x62\x4a\x78\x67\x42\x41']={},a0_0x3f86['\x62\x74\x63\x43\x7a\x50']=!![];}const _0x5a16a9=_0x5db656[0x0],_0x280e59=_0x50c92b+_0x5a16a9,_0x591a7a=a0_0x3f86['\x62\x4a\x78\x67\x42\x41'][_0x280e59];return!_0x591a7a?(_0x3f86a0=a0_0x3f86['\x5a\x70\x6c\x6a\x4d\x79'](_0x3f86a0),a0_0x3f86['\x62\x4a\x78\x67\x42\x41'][_0x280e59]=_0x3f86a0):_0x3f86a0=_0x591a7a,_0x3f86a0;}import{f as a0_0x3d1757,r as a0_0x5d5f8c,u as a0_0x12ceec}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_0x40dc12(0x18c),DEFAULT_TIMEOUT_MS=0x7530;function appendParam(_0x2b6a40,_0x20928d,_0xc74060){const _0x40bcd5=a0_0x40dc12,_0x3ed060={'\x41\x71\x65\x57\x50':function(_0xd5a26b,_0x1af86a){return _0xd5a26b===_0x1af86a;},'\x66\x79\x41\x7a\x6c':function(_0x31f5ad,_0x1ac0e2){return _0x31f5ad(_0x1ac0e2);}};if(_0x3ed060[_0x40bcd5(0x172)](_0xc74060,void 0x0))return;_0x2b6a40[_0x40bcd5(0x1b7)](_0x20928d,_0x3ed060[_0x40bcd5(0x1b8)](String,_0xc74060));}function createIntelligenceClient(_0x31bc17){const _0x5179e7=a0_0x40dc12,_0x261f19={'\x72\x6e\x42\x5a\x69':function(_0xa1a381,_0x564206){return _0xa1a381 instanceof _0x564206;},'\x64\x57\x76\x62\x5a':'\x41\x62\x6f\x72\x74\x45\x72\x72\x6f\x72','\x41\x45\x54\x53\x4b':function(_0x536516,_0x2fdf93){return _0x536516(_0x2fdf93);},'\x62\x54\x4a\x69\x53':function(_0x199a3b,_0x11fb16,_0x4bdd19,_0x477c86){return _0x199a3b(_0x11fb16,_0x4bdd19,_0x477c86);},'\x41\x56\x61\x64\x61':function(_0x507a0f,_0x1bddd2,_0x28012d,_0x5475c3){return _0x507a0f(_0x1bddd2,_0x28012d,_0x5475c3);},'\x4b\x77\x56\x41\x6a':_0x5179e7(0x17a),'\x7a\x54\x4a\x51\x54':function(_0x14f139,_0x22234f,_0xe2ec0a,_0x4c9917){return _0x14f139(_0x22234f,_0xe2ec0a,_0x4c9917);},'\x46\x62\x57\x44\x53':function(_0x433f10,_0x5b99c4,_0x40a9c9,_0x50e91a){return _0x433f10(_0x5b99c4,_0x40a9c9,_0x50e91a);},'\x58\x48\x7a\x6e\x6b':_0x5179e7(0x1b3),'\x67\x62\x78\x47\x47':function(_0x30247d,_0x2a3d4c){return _0x30247d>_0x2a3d4c;},'\x77\x67\x67\x65\x46':function(_0x369a8b,_0x336feb){return _0x369a8b(_0x336feb);},'\x53\x44\x61\x48\x54':function(_0x98b1be,_0x5985e4){return _0x98b1be(_0x5985e4);},'\x4b\x6b\x65\x42\x5a':function(_0x4bf16d,_0x4f1c21,_0x4a3574,_0x5dfea6,_0x204175){return _0x4bf16d(_0x4f1c21,_0x4a3574,_0x5dfea6,_0x204175);},'\x4f\x51\x70\x4d\x44':'\x49\x6e\x74\x65\x6c\x6c\x69\x67\x65\x6e\x63\x65\x20\x41\x50\x49\x20\x72\x65\x74\x75\x72\x6e\x65\x64\x20\x61\x6e\x20\x4e\x44\x4a\x53\x4f\x4e\x20\x65\x78\x70\x6f\x72\x74\x20\x77\x69\x74\x68\x20\x6e\x6f\x20\x62\x6f\x64\x79\x20\x73\x74\x72\x65\x61\x6d','\x78\x4a\x66\x47\x52':_0x5179e7(0x195),'\x79\x6b\x71\x74\x6d':_0x5179e7(0x1b5),'\x6a\x63\x63\x49\x42':function(_0x5108ae,_0x1db6c3,_0x3294d2,_0x7c25cd){return _0x5108ae(_0x1db6c3,_0x3294d2,_0x7c25cd);},'\x7a\x55\x4e\x70\x77':function(_0x5626b2,_0x44fba5,_0x5cbab5,_0x183b89){return _0x5626b2(_0x44fba5,_0x5cbab5,_0x183b89);},'\x79\x45\x6e\x55\x4c':_0x5179e7(0x19a),'\x6b\x6c\x4e\x78\x76':function(_0x4b7976,_0x3676c0){return _0x4b7976>_0x3676c0;},'\x75\x67\x46\x54\x49':function(_0x2a0f82,_0x5ee71a){return _0x2a0f82(_0x5ee71a);},'\x69\x4e\x42\x43\x4a':_0x5179e7(0x1a9),'\x6f\x6f\x41\x43\x55':_0x5179e7(0x1b6),'\x56\x63\x4b\x74\x77':function(_0x3d90f4,_0x1c7e44,_0x4b7955,_0x33f4b6){return _0x3d90f4(_0x1c7e44,_0x4b7955,_0x33f4b6);},'\x67\x71\x6c\x50\x4f':function(_0x4ef60f,_0x5b769a){return _0x4ef60f>_0x5b769a;},'\x62\x5a\x69\x48\x63':function(_0x49b72f,_0x4fa1a8,_0x1f93ca){return _0x49b72f(_0x4fa1a8,_0x1f93ca);},'\x46\x42\x69\x65\x6f':function(_0x284f8d,_0x17663b){return _0x284f8d(_0x17663b);},'\x6b\x76\x62\x77\x73':_0x5179e7(0x190)};if(!_0x31bc17[_0x5179e7(0x184)])throw new Error(_0x261f19[_0x5179e7(0x1b2)]);const _0x5ef6ac=_0x31bc17[_0x5179e7(0x184)],_0x332a6e=(_0x31bc17[_0x5179e7(0x1af)]??_0x5179e7(0x18c))[_0x5179e7(0x1a7)](/\/$/,''),_0x353b9c=_0x31bc17[_0x5179e7(0x1ae)]??DEFAULT_TIMEOUT_MS;async function _0x57da20(_0x17e9bd){const _0x1513e2=_0x5179e7,_0x59d0a8=''+_0x332a6e+_0x17e9bd,_0x299e10=new AbortController(),_0x50c6d8=setTimeout(()=>_0x299e10[_0x1513e2(0x186)](),_0x353b9c);try{return await globalThis[_0x1513e2(0x1ac)](_0x59d0a8,{'\x68\x65\x61\x64\x65\x72\x73':{'\x41\x75\x74\x68\x6f\x72\x69\x7a\x61\x74\x69\x6f\x6e':_0x1513e2(0x192)+_0x5ef6ac,'\x41\x63\x63\x65\x70\x74':_0x1513e2(0x176)},'\x73\x69\x67\x6e\x61\x6c':_0x299e10[_0x1513e2(0x1ab)]});}catch(_0x59747e){if(_0x261f19[_0x1513e2(0x1bc)](_0x59747e,Error)&&_0x59747e[_0x1513e2(0x17b)]===_0x261f19[_0x1513e2(0x175)])throw new a0_0x12ceec(_0x353b9c);throw new a0_0x5d5f8c(_0x1513e2(0x197)+(_0x59747e instanceof Error?_0x59747e[_0x1513e2(0x188)]:String(_0x59747e)),_0x59747e instanceof Error?_0x59747e:void 0x0,{'\x65\x6e\x64\x70\x6f\x69\x6e\x74':_0x17e9bd,'\x6f\x72\x69\x67\x69\x6e':_0x1513e2(0x195)});}finally{_0x261f19[_0x1513e2(0x180)](clearTimeout,_0x50c6d8);}}async function _0x22d512(_0x2dfe86){const _0x10866f=_0x5179e7,_0x11c997=await _0x261f19[_0x10866f(0x180)](_0x57da20,_0x2dfe86),_0x343a52=await _0x11c997[_0x10866f(0x183)]();if(!_0x11c997['\x6f\x6b'])throw a0_0x3d1757(_0x11c997[_0x10866f(0x179)],_0x343a52,{'\x6d\x65\x74\x68\x6f\x64':_0x10866f(0x1a1),'\x70\x61\x74\x68':_0x2dfe86},_0x11c997['\x68\x65\x61\x64\x65\x72\x73']);return JSON['\x70\x61\x72\x73\x65'](_0x343a52);}async function _0x5bf30a(_0x96540e={}){const _0x47abe4=_0x5179e7,_0x894176=new URLSearchParams();return _0x261f19[_0x47abe4(0x17c)](appendParam,_0x894176,_0x47abe4(0x1b3),_0x96540e[_0x47abe4(0x1b3)]),_0x261f19['\x41\x56\x61\x64\x61'](appendParam,_0x894176,_0x47abe4(0x19e),_0x96540e[_0x47abe4(0x19e)]),_0x261f19[_0x47abe4(0x19d)](appendParam,_0x894176,'\x74\x6f',_0x96540e['\x74\x6f']),appendParam(_0x894176,'\x71',_0x96540e['\x71']),appendParam(_0x894176,_0x47abe4(0x1a8),_0x96540e[_0x47abe4(0x1a8)]),appendParam(_0x894176,_0x261f19['\x4b\x77\x56\x41\x6a'],_0x96540e[_0x47abe4(0x17a)]),_0x261f19['\x7a\x54\x4a\x51\x54'](appendParam,_0x894176,_0x47abe4(0x179),_0x96540e['\x73\x74\x61\x74\x75\x73']),appendParam(_0x894176,'\x63\x75\x72\x73\x6f\x72',_0x96540e[_0x47abe4(0x1b6)]),_0x22d512('\x2f\x76\x31\x2f\x74\x72\x61\x63\x65\x73'+(_0x894176[_0x47abe4(0x18d)]>0x0?'\x3f'+_0x894176:''));}async function _0x37d194(_0x141964,_0x4f0c0a={}){const _0x3564=_0x5179e7,_0x3fd74a=new URLSearchParams();_0x261f19[_0x3564(0x1b4)](appendParam,_0x3fd74a,_0x261f19[_0x3564(0x1a5)],_0x4f0c0a[_0x3564(0x1b3)]),appendParam(_0x3fd74a,_0x3564(0x1b6),_0x4f0c0a['\x63\x75\x72\x73\x6f\x72']);const _0x37175a=_0x261f19[_0x3564(0x1b9)](_0x3fd74a[_0x3564(0x18d)],0x0)?'\x3f'+_0x3fd74a:'';return _0x22d512(_0x3564(0x19b)+_0x261f19[_0x3564(0x180)](encodeURIComponent,_0x141964)+_0x3564(0x177)+_0x37175a);}async function _0x9af8d(_0x29e218){const _0x108711=_0x5179e7,_0x4dc612='\x2f\x76\x31\x2f\x74\x72\x61\x63\x65\x73\x2f'+_0x261f19[_0x108711(0x17f)](encodeURIComponent,_0x29e218)+_0x108711(0x17e),_0x43283a=await _0x261f19[_0x108711(0x1a3)](_0x57da20,_0x4dc612);if(!_0x43283a['\x6f\x6b']){const _0x2d2db1=await _0x43283a['\x74\x65\x78\x74']();throw _0x261f19[_0x108711(0x198)](a0_0x3d1757,_0x43283a[_0x108711(0x179)],_0x2d2db1,{'\x6d\x65\x74\x68\x6f\x64':_0x108711(0x1a1),'\x70\x61\x74\x68':_0x4dc612},_0x43283a[_0x108711(0x193)]);}if(!_0x43283a['\x62\x6f\x64\x79'])throw new a0_0x5d5f8c(_0x261f19[_0x108711(0x18e)],{'\x65\x6e\x64\x70\x6f\x69\x6e\x74':_0x4dc612,'\x6f\x72\x69\x67\x69\x6e':_0x261f19[_0x108711(0x194)]});return _0x43283a[_0x108711(0x174)];}async function _0x568e23(_0xdd12a6={}){const _0x513729=_0x5179e7,_0x4d9693=new URLSearchParams();return appendParam(_0x4d9693,_0x513729(0x1b3),_0xdd12a6['\x6c\x69\x6d\x69\x74']),appendParam(_0x4d9693,_0x513729(0x187),_0xdd12a6[_0x513729(0x187)]),appendParam(_0x4d9693,_0x513729(0x179),_0xdd12a6[_0x513729(0x179)]),appendParam(_0x4d9693,_0x261f19['\x79\x6b\x71\x74\x6d'],_0xdd12a6[_0x513729(0x1b5)]),appendParam(_0x4d9693,'\x71',_0xdd12a6['\x71']),_0x261f19['\x6a\x63\x63\x49\x42'](appendParam,_0x4d9693,_0x513729(0x19e),_0xdd12a6[_0x513729(0x19e)]),appendParam(_0x4d9693,'\x74\x6f',_0xdd12a6['\x74\x6f']),_0x261f19[_0x513729(0x18b)](appendParam,_0x4d9693,_0x261f19[_0x513729(0x1ad)],_0xdd12a6[_0x513729(0x19a)]),_0x261f19[_0x513729(0x1a2)](appendParam,_0x4d9693,_0x513729(0x1b6),_0xdd12a6[_0x513729(0x1b6)]),_0x22d512(_0x513729(0x181)+(_0x261f19[_0x513729(0x189)](_0x4d9693[_0x513729(0x18d)],0x0)?'\x3f'+_0x4d9693:''));}async function _0x4e9eea(_0x4d69a2){const _0xfb6439=_0x5179e7;return _0x22d512('\x2f\x76\x31\x2f\x72\x75\x6e\x73\x2f'+_0x261f19[_0xfb6439(0x199)](encodeURIComponent,_0x4d69a2));}async function _0x4ee503(_0x18c827){return _0x22d512('\x2f\x76\x31\x2f\x72\x75\x6e\x73\x2f'+_0x261f19['\x41\x45\x54\x53\x4b'](encodeURIComponent,_0x18c827)+'\x2f\x74\x72\x61\x63\x65\x73');}async function _0x335d1a(_0x24086f={}){const _0x56fb21=_0x5179e7,_0x107f74=new URLSearchParams();return _0x261f19[_0x56fb21(0x1a2)](appendParam,_0x107f74,_0x261f19[_0x56fb21(0x1a5)],_0x24086f[_0x56fb21(0x1b3)]),appendParam(_0x107f74,_0x56fb21(0x19e),_0x24086f[_0x56fb21(0x19e)]),_0x261f19[_0x56fb21(0x18a)](appendParam,_0x107f74,'\x74\x6f',_0x24086f['\x74\x6f']),appendParam(_0x107f74,'\x71',_0x24086f['\x71']),_0x261f19[_0x56fb21(0x1b4)](appendParam,_0x107f74,_0x261f19[_0x56fb21(0x1a6)],_0x24086f[_0x56fb21(0x1a9)]),_0x261f19[_0x56fb21(0x18b)](appendParam,_0x107f74,_0x261f19['\x6f\x6f\x41\x43\x55'],_0x24086f[_0x56fb21(0x1b6)]),_0x22d512(_0x56fb21(0x18f)+(_0x261f19[_0x56fb21(0x189)](_0x107f74[_0x56fb21(0x18d)],0x0)?'\x3f'+_0x107f74:''));}async function _0xa04849(_0x1cb1b3,_0x27c9a6={}){const _0xeea874=_0x5179e7,_0x40a0ef=new URLSearchParams();appendParam(_0x40a0ef,_0x261f19[_0xeea874(0x1a5)],_0x27c9a6['\x6c\x69\x6d\x69\x74']),_0x261f19[_0xeea874(0x191)](appendParam,_0x40a0ef,_0x261f19['\x6f\x6f\x41\x43\x55'],_0x27c9a6[_0xeea874(0x1b6)]);const _0x306924=_0x261f19[_0xeea874(0x178)](_0x40a0ef['\x73\x69\x7a\x65'],0x0)?'\x3f'+_0x40a0ef:'';return _0x261f19['\x41\x45\x54\x53\x4b'](_0x22d512,_0xeea874(0x185)+encodeURIComponent(_0x1cb1b3)+_0xeea874(0x1a0)+_0x306924);}async function*_0x4aba76(_0x5314ea,_0x13640b={}){const _0xe5fb0b=_0x5179e7;let _0x47050c=_0x13640b[_0xe5fb0b(0x1b6)];for(;;){const _0x16c0e9=await _0x261f19['\x62\x5a\x69\x48\x63'](_0x37d194,_0x5314ea,{..._0x13640b,'\x63\x75\x72\x73\x6f\x72':_0x47050c});for(const _0x528fcc of _0x16c0e9['\x69\x74\x65\x6d\x73'])yield _0x528fcc;if(!_0x16c0e9[_0xe5fb0b(0x182)])return;_0x47050c=_0x16c0e9[_0xe5fb0b(0x182)];}}async function*_0x34f926(_0x3d897b={}){const _0x40afbc=_0x5179e7;let _0x203eb8=_0x3d897b['\x63\x75\x72\x73\x6f\x72'];for(;;){const _0x2ad862=await _0x261f19['\x46\x42\x69\x65\x6f'](_0x5bf30a,{..._0x3d897b,'\x63\x75\x72\x73\x6f\x72':_0x203eb8});for(const _0x4c0d8d of _0x2ad862[_0x40afbc(0x1a4)])yield _0x4c0d8d;if(!_0x2ad862[_0x40afbc(0x182)])return;_0x203eb8=_0x2ad862[_0x40afbc(0x182)];}}async function*_0x5574bd(_0x344c62={}){const _0x159e11=_0x5179e7;let _0x354ceb=_0x344c62[_0x159e11(0x1b6)];for(;;){const _0x157cc6=await _0x335d1a({..._0x344c62,'\x63\x75\x72\x73\x6f\x72':_0x354ceb});for(const _0x4a2747 of _0x157cc6[_0x159e11(0x1a4)])yield _0x4a2747;if(!_0x157cc6[_0x159e11(0x182)])return;_0x354ceb=_0x157cc6[_0x159e11(0x182)];}}return{'\x6c\x69\x73\x74\x54\x72\x61\x63\x65\x73':_0x5bf30a,'\x67\x65\x74\x54\x72\x61\x63\x65\x53\x70\x61\x6e\x73':_0x37d194,'\x65\x78\x70\x6f\x72\x74\x54\x72\x61\x63\x65\x53\x70\x61\x6e\x73\x4e\x64\x6a\x73\x6f\x6e':_0x9af8d,'\x6c\x69\x73\x74\x52\x75\x6e\x73':_0x568e23,'\x67\x65\x74\x52\x75\x6e':_0x4e9eea,'\x67\x65\x74\x52\x75\x6e\x54\x72\x61\x63\x65\x73':_0x4ee503,'\x6c\x69\x73\x74\x53\x65\x73\x73\x69\x6f\x6e\x73':_0x335d1a,'\x67\x65\x74\x53\x65\x73\x73\x69\x6f\x6e\x54\x72\x61\x63\x65\x73':_0xa04849,'\x69\x74\x65\x72\x61\x74\x65\x54\x72\x61\x63\x65\x53\x70\x61\x6e\x73':_0x4aba76,'\x69\x74\x65\x72\x61\x74\x65\x54\x72\x61\x63\x65\x73':_0x34f926,'\x69\x74\x65\x72\x61\x74\x65\x53\x65\x73\x73\x69\x6f\x6e\x73':_0x5574bd};}export{DEFAULT_INTELLIGENCE_BASE_URL,createIntelligenceClient};