@palai/sdk 0.1.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.
- package/CHANGELOG.md +65 -0
- package/LICENSE +201 -0
- package/README.md +160 -0
- package/dist/client.d.ts +94 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +296 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +40 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +143 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/tools.d.ts +39 -0
- package/dist/generated/tools.d.ts.map +1 -0
- package/dist/generated/tools.js +44 -0
- package/dist/generated/tools.js.map +1 -0
- package/dist/generated/types.d.ts +341 -0
- package/dist/generated/types.d.ts.map +1 -0
- package/dist/generated/types.js +7 -0
- package/dist/generated/types.js.map +1 -0
- package/dist/index.browser.d.ts +3 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.browser.js +6 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator.d.ts +61 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +159 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/resources/agents.d.ts +67 -0
- package/dist/resources/agents.d.ts.map +1 -0
- package/dist/resources/agents.js +75 -0
- package/dist/resources/agents.js.map +1 -0
- package/dist/resources/approvals.d.ts +33 -0
- package/dist/resources/approvals.d.ts.map +1 -0
- package/dist/resources/approvals.js +33 -0
- package/dist/resources/approvals.js.map +1 -0
- package/dist/resources/artifacts.d.ts +36 -0
- package/dist/resources/artifacts.d.ts.map +1 -0
- package/dist/resources/artifacts.js +70 -0
- package/dist/resources/artifacts.js.map +1 -0
- package/dist/resources/model-routes.d.ts +70 -0
- package/dist/resources/model-routes.d.ts.map +1 -0
- package/dist/resources/model-routes.js +74 -0
- package/dist/resources/model-routes.js.map +1 -0
- package/dist/resources/reads.d.ts +49 -0
- package/dist/resources/reads.d.ts.map +1 -0
- package/dist/resources/reads.js +91 -0
- package/dist/resources/reads.js.map +1 -0
- package/dist/resources/responses.d.ts +70 -0
- package/dist/resources/responses.d.ts.map +1 -0
- package/dist/resources/responses.js +147 -0
- package/dist/resources/responses.js.map +1 -0
- package/dist/resources/secret-refs.d.ts +24 -0
- package/dist/resources/secret-refs.d.ts.map +1 -0
- package/dist/resources/secret-refs.js +33 -0
- package/dist/resources/secret-refs.js.map +1 -0
- package/dist/resources/sessions.d.ts +106 -0
- package/dist/resources/sessions.d.ts.map +1 -0
- package/dist/resources/sessions.js +161 -0
- package/dist/resources/sessions.js.map +1 -0
- package/dist/resources/shared.d.ts +31 -0
- package/dist/resources/shared.d.ts.map +1 -0
- package/dist/resources/shared.js +32 -0
- package/dist/resources/shared.js.map +1 -0
- package/dist/resources/skills.d.ts +40 -0
- package/dist/resources/skills.d.ts.map +1 -0
- package/dist/resources/skills.js +40 -0
- package/dist/resources/skills.js.map +1 -0
- package/dist/schema.d.ts +35 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +30 -0
- package/dist/schema.js.map +1 -0
- package/dist/server-only.d.ts +2 -0
- package/dist/server-only.d.ts.map +1 -0
- package/dist/server-only.js +22 -0
- package/dist/server-only.js.map +1 -0
- package/dist/stream.d.ts +38 -0
- package/dist/stream.d.ts.map +1 -0
- package/dist/stream.js +314 -0
- package/dist/stream.js.map +1 -0
- package/package.json +44 -0
package/dist/client.js
ADDED
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
// Importing the API-key client marks this module server-only: bundling it for the browser
|
|
2
|
+
// throws rather than shipping the secret (see ./server-only.ts).
|
|
3
|
+
import "./server-only.js";
|
|
4
|
+
import { errorForResponse, isRetryableStatus, PalaiConnectionError } from "./errors.js";
|
|
5
|
+
import { delay, fullJitterBackoff } from "./stream.js";
|
|
6
|
+
import { Responses } from "./resources/responses.js";
|
|
7
|
+
import { Sessions } from "./resources/sessions.js";
|
|
8
|
+
import { Skills } from "./resources/skills.js";
|
|
9
|
+
import { Agents } from "./resources/agents.js";
|
|
10
|
+
import { Approvals } from "./resources/approvals.js";
|
|
11
|
+
import { Artifacts } from "./resources/artifacts.js";
|
|
12
|
+
import { MCPConnections, ModelConnections, RepositoryBindings, Tools, Triggers } from "./resources/reads.js";
|
|
13
|
+
import { SecretRefs } from "./resources/secret-refs.js";
|
|
14
|
+
import { ModelRoutes } from "./resources/model-routes.js";
|
|
15
|
+
// APIVersion is the dated contract this SDK speaks; it rides every request (spec §20.13).
|
|
16
|
+
export const APIVersion = "2026-07-16";
|
|
17
|
+
// Palai is the transport client: Bearer auth, the dated API version, idempotent retry, and
|
|
18
|
+
// typed RFC 9457 errors. Resource groups (responses) hang off it. It implements
|
|
19
|
+
// StreamTransport so the streaming layer opens SSE connections through the same auth.
|
|
20
|
+
export class Palai {
|
|
21
|
+
baseURL;
|
|
22
|
+
project;
|
|
23
|
+
responses;
|
|
24
|
+
modelConnections;
|
|
25
|
+
sessions;
|
|
26
|
+
agents;
|
|
27
|
+
// skills is the untrusted-content surface: install, review the quarantine, enable.
|
|
28
|
+
skills;
|
|
29
|
+
// approvals is the human-in-the-loop surface: what is parked, and the answer. A program that starts runs
|
|
30
|
+
// has to be able to answer them, or a gated call sits until its TTL expires.
|
|
31
|
+
approvals;
|
|
32
|
+
artifacts;
|
|
33
|
+
repositoryBindings;
|
|
34
|
+
tools;
|
|
35
|
+
mcpConnections;
|
|
36
|
+
triggers;
|
|
37
|
+
secretRefs;
|
|
38
|
+
modelRoutes;
|
|
39
|
+
// THERE IS NO `projects` OR `apiKeys` HERE, and their removal is the substance of the consumer/operator
|
|
40
|
+
// split rather than a tidy-up. Both routes demand a `system` or `provision` capability that a customer's
|
|
41
|
+
// project key does not carry, so the properties could only ever have handed a customer a 403 their key
|
|
42
|
+
// can never satisfy. Deleting the EXPORTS alone would not have removed the surface — these two lines are
|
|
43
|
+
// what made it reachable as `palai.projects.create(...)`, and a guard that enumerated the module's
|
|
44
|
+
// exports would have gone green with the surface still live.
|
|
45
|
+
#apiKey;
|
|
46
|
+
#fetch;
|
|
47
|
+
#maxRetries;
|
|
48
|
+
#timeoutMs;
|
|
49
|
+
#backoffBaseMs;
|
|
50
|
+
#backoffMaxMs;
|
|
51
|
+
constructor(options = {}) {
|
|
52
|
+
// Precedence: explicit option, then the Palai-scoped environment. No other provider's
|
|
53
|
+
// environment is ever read — the SDK never silently picks up an unrelated key.
|
|
54
|
+
const apiKey = options.apiKey ?? env("PALAI_API_KEY");
|
|
55
|
+
if (!apiKey) {
|
|
56
|
+
throw new Error("@palai/sdk: an API key is required — pass { apiKey } or set PALAI_API_KEY. " +
|
|
57
|
+
"Keep it server-side; never expose it to the browser.");
|
|
58
|
+
}
|
|
59
|
+
this.#apiKey = apiKey;
|
|
60
|
+
this.baseURL = trimTrailingSlash(options.baseURL ?? env("PALAI_BASE_URL") ?? "http://localhost:8080");
|
|
61
|
+
this.project = options.project ?? env("PALAI_PROJECT");
|
|
62
|
+
this.#fetch = options.fetch ?? globalThis.fetch;
|
|
63
|
+
this.#maxRetries = options.maxRetries ?? 2;
|
|
64
|
+
this.#timeoutMs = options.timeoutMs ?? 60_000;
|
|
65
|
+
this.#backoffBaseMs = options.backoffBaseMs ?? 200;
|
|
66
|
+
this.#backoffMaxMs = options.backoffMaxMs ?? 10_000;
|
|
67
|
+
this.responses = new Responses(this);
|
|
68
|
+
this.modelConnections = new ModelConnections(this);
|
|
69
|
+
this.sessions = new Sessions(this);
|
|
70
|
+
this.agents = new Agents(this);
|
|
71
|
+
this.skills = new Skills(this);
|
|
72
|
+
this.approvals = new Approvals(this);
|
|
73
|
+
this.artifacts = new Artifacts(this);
|
|
74
|
+
this.repositoryBindings = new RepositoryBindings(this);
|
|
75
|
+
this.tools = new Tools(this);
|
|
76
|
+
this.mcpConnections = new MCPConnections(this);
|
|
77
|
+
this.triggers = new Triggers(this);
|
|
78
|
+
this.secretRefs = new SecretRefs(this);
|
|
79
|
+
this.modelRoutes = new ModelRoutes(this);
|
|
80
|
+
}
|
|
81
|
+
async request(method, path, options = {}) {
|
|
82
|
+
const url = this.baseURL + path;
|
|
83
|
+
const headers = {
|
|
84
|
+
Authorization: `Bearer ${this.#apiKey}`,
|
|
85
|
+
"API-Version": APIVersion,
|
|
86
|
+
Accept: options.accept ?? "application/json",
|
|
87
|
+
};
|
|
88
|
+
// The idempotency key is built once and rides every retry, so a create that is retried
|
|
89
|
+
// after a network blip settles exactly one response (spec §20.9, §35.3).
|
|
90
|
+
if (options.idempotencyKey !== undefined) {
|
|
91
|
+
headers["Idempotency-Key"] = options.idempotencyKey;
|
|
92
|
+
}
|
|
93
|
+
let bodyText;
|
|
94
|
+
if (options.bytes !== undefined) {
|
|
95
|
+
// ‼️ RAW BYTES, AND THE CONTENT TYPE IS THE SERVER'S TO DECIDE. POST /v1/artifacts takes the object
|
|
96
|
+
// itself as the body and SNIFFS its media type (http.DetectContentType), refusing anything outside
|
|
97
|
+
// its allow-list. A client-declared type would be a claim the server ignores — a lie in a function
|
|
98
|
+
// signature — so none is sent.
|
|
99
|
+
bodyText = options.bytes;
|
|
100
|
+
}
|
|
101
|
+
else if (options.body !== undefined) {
|
|
102
|
+
bodyText = JSON.stringify(options.body);
|
|
103
|
+
headers["Content-Type"] = "application/json";
|
|
104
|
+
}
|
|
105
|
+
// A network-level failure may have already committed on the server, so it is only re-sent when the
|
|
106
|
+
// request is idempotent: a safe method, an Idempotency-Key create, or a body-idempotent op that
|
|
107
|
+
// opts in. A non-idempotent create is NOT re-sent, so a connection torn after its 201 cannot
|
|
108
|
+
// double-provision a tenant/secret/route (SHOULD-1). Response-level (429/5xx) retry is unaffected.
|
|
109
|
+
const idempotent = isSafeMethod(method) || options.idempotencyKey !== undefined || options.idempotent === true;
|
|
110
|
+
const maxRetries = options.maxRetries ?? this.#maxRetries;
|
|
111
|
+
const deadline = Date.now() + (options.timeoutMs ?? this.#timeoutMs);
|
|
112
|
+
let attempt = 0;
|
|
113
|
+
for (;;) {
|
|
114
|
+
const remaining = deadline - Date.now();
|
|
115
|
+
if (remaining <= 0) {
|
|
116
|
+
throw new PalaiConnectionError(`${method} ${path} exceeded its ${options.timeoutMs ?? this.#timeoutMs}ms deadline`);
|
|
117
|
+
}
|
|
118
|
+
const signal = combineSignals(options.signal, AbortSignal.timeout(remaining));
|
|
119
|
+
let response;
|
|
120
|
+
try {
|
|
121
|
+
response = await this.#fetch(url, {
|
|
122
|
+
method,
|
|
123
|
+
headers,
|
|
124
|
+
signal,
|
|
125
|
+
...(bodyText !== undefined ? { body: bodyText } : {}),
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
catch (cause) {
|
|
129
|
+
if (options.signal?.aborted) {
|
|
130
|
+
throw new PalaiConnectionError(`${method} ${path} was canceled`, { cause });
|
|
131
|
+
}
|
|
132
|
+
// Network failure or a per-attempt timeout: retry within budget — but only for an idempotent
|
|
133
|
+
// request, so a non-idempotent create fails closed instead of risking a double-commit.
|
|
134
|
+
if (!idempotent || attempt >= maxRetries || !withinBudget(deadline, attempt, this.#backoffBaseMs, this.#backoffMaxMs)) {
|
|
135
|
+
throw new PalaiConnectionError(`${method} ${path} failed to reach the server`, { cause });
|
|
136
|
+
}
|
|
137
|
+
try {
|
|
138
|
+
await delay(fullJitterBackoff(attempt, this.#backoffBaseMs, this.#backoffMaxMs), options.signal);
|
|
139
|
+
}
|
|
140
|
+
catch (abortCause) {
|
|
141
|
+
// A cancel landing inside the backoff sleep must surface as a PalaiError, not the
|
|
142
|
+
// raw DOMException delay() rejects with.
|
|
143
|
+
throw new PalaiConnectionError(`${method} ${path} was canceled`, { cause: abortCause });
|
|
144
|
+
}
|
|
145
|
+
attempt += 1;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
if (response.ok) {
|
|
149
|
+
return await parseJSON(response);
|
|
150
|
+
}
|
|
151
|
+
if (isRetryableStatus(response.status) && attempt < maxRetries) {
|
|
152
|
+
const wait = retryAfterMs(response) ?? fullJitterBackoff(attempt, this.#backoffBaseMs, this.#backoffMaxMs);
|
|
153
|
+
if (Date.now() + wait < deadline) {
|
|
154
|
+
await response.body?.cancel().catch(() => { });
|
|
155
|
+
try {
|
|
156
|
+
await delay(wait, options.signal);
|
|
157
|
+
}
|
|
158
|
+
catch (cause) {
|
|
159
|
+
// A cancel landing inside the backoff sleep must surface as a PalaiError, not the
|
|
160
|
+
// raw DOMException delay() rejects with.
|
|
161
|
+
throw new PalaiConnectionError(`${method} ${path} was canceled`, { cause });
|
|
162
|
+
}
|
|
163
|
+
attempt += 1;
|
|
164
|
+
continue;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const text = await response.text();
|
|
168
|
+
throw errorForResponse(response.status, text, response.headers.get("Request-Id") ?? undefined);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
// openEventStream opens the raw SSE response for a session with Bearer auth and, on a
|
|
172
|
+
// resume, the Last-Event-ID cursor. It does not retry — ResponseStream owns reconnection.
|
|
173
|
+
openEventStream(sessionID, lastEventId, signal) {
|
|
174
|
+
const headers = {
|
|
175
|
+
Authorization: `Bearer ${this.#apiKey}`,
|
|
176
|
+
"API-Version": APIVersion,
|
|
177
|
+
Accept: "text/event-stream",
|
|
178
|
+
};
|
|
179
|
+
if (lastEventId !== null) {
|
|
180
|
+
headers["Last-Event-ID"] = lastEventId;
|
|
181
|
+
}
|
|
182
|
+
return this.#fetch(`${this.baseURL}/v1/sessions/${encodeURIComponent(sessionID)}/events`, {
|
|
183
|
+
method: "GET",
|
|
184
|
+
headers,
|
|
185
|
+
cache: "no-store",
|
|
186
|
+
...(signal ? { signal } : {}),
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
retrieveResponse(responseID) {
|
|
190
|
+
return this.responses.retrieve(responseID);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* One prompt in, the model's text out.
|
|
194
|
+
*
|
|
195
|
+
* The whole vertical collapsed to a single call — create, wait, read — for the case where a
|
|
196
|
+
* caller wants an answer and nothing else. Everything it hides stays reachable: `responses.run`
|
|
197
|
+
* returns the full Response, `responses.stream` gives the journal.
|
|
198
|
+
*/
|
|
199
|
+
async ask(prompt, options = {}) {
|
|
200
|
+
const request = {
|
|
201
|
+
input: prompt,
|
|
202
|
+
...(options.model !== undefined ? { model: options.model } : {}),
|
|
203
|
+
...(options.effort !== undefined ? { effort: options.effort } : {}),
|
|
204
|
+
};
|
|
205
|
+
const response = await this.responses.run(request, options.deadlineMs !== undefined ? { deadlineMs: options.deadlineMs } : {});
|
|
206
|
+
const output = response.output ?? [];
|
|
207
|
+
return output.map((part) => (typeof part.content === "string" ? part.content : "")).join("");
|
|
208
|
+
}
|
|
209
|
+
// openDownload opens an authenticated GET whose body is raw bytes (an artifact download), not JSON.
|
|
210
|
+
// It applies the same Bearer auth + dated version as request() and maps a non-2xx to the typed RFC
|
|
211
|
+
// 9457 error, but returns the raw Response so the caller streams the body without buffering it.
|
|
212
|
+
//
|
|
213
|
+
// timeoutMs bounds the CONNECT phase only: the timer is cleared the moment headers arrive, so the
|
|
214
|
+
// byte stream that follows is governed solely by the caller's signal — a multi-GB object never trips
|
|
215
|
+
// a wall-clock connect deadline mid-transfer (SHOULD-2). A connect timeout surfaces as a typed
|
|
216
|
+
// PalaiConnectionError, never a raw AbortError.
|
|
217
|
+
// ponytail: single attempt — a partially-drained stream is not safely retryable; add a bounded
|
|
218
|
+
// open-retry only when a caller measurably needs one.
|
|
219
|
+
async openDownload(path, options = {}) {
|
|
220
|
+
const headers = {
|
|
221
|
+
Authorization: `Bearer ${this.#apiKey}`,
|
|
222
|
+
"API-Version": APIVersion,
|
|
223
|
+
Accept: "application/octet-stream",
|
|
224
|
+
};
|
|
225
|
+
const controller = new AbortController();
|
|
226
|
+
const timer = setTimeout(() => controller.abort(), options.timeoutMs ?? this.#timeoutMs);
|
|
227
|
+
const signal = combineSignals(options.signal, controller.signal);
|
|
228
|
+
let response;
|
|
229
|
+
try {
|
|
230
|
+
response = await this.#fetch(this.baseURL + path, { method: "GET", headers, cache: "no-store", signal });
|
|
231
|
+
}
|
|
232
|
+
catch (cause) {
|
|
233
|
+
if (options.signal?.aborted) {
|
|
234
|
+
throw new PalaiConnectionError(`GET ${path} was canceled`, { cause });
|
|
235
|
+
}
|
|
236
|
+
throw new PalaiConnectionError(`GET ${path} failed to reach the server`, { cause });
|
|
237
|
+
}
|
|
238
|
+
finally {
|
|
239
|
+
// Headers are in (or the connect failed): stop the connect timeout so it never aborts the body.
|
|
240
|
+
clearTimeout(timer);
|
|
241
|
+
}
|
|
242
|
+
if (!response.ok) {
|
|
243
|
+
const text = await response.text();
|
|
244
|
+
throw errorForResponse(response.status, text, response.headers.get("Request-Id") ?? undefined);
|
|
245
|
+
}
|
|
246
|
+
return response;
|
|
247
|
+
}
|
|
248
|
+
// defineAgent is agents.defineAgent hoisted to the client, because "define an agent" is something a
|
|
249
|
+
// caller does to the PLATFORM rather than to a sub-resource — and because the three-call shape it
|
|
250
|
+
// replaces is the one a caller most often gets wrong, silently.
|
|
251
|
+
defineAgent(params, options = {}) {
|
|
252
|
+
return this.agents.defineAgent(params, options);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
// env reads a Palai-scoped variable, trimmed, or undefined. It never throws in a runtime
|
|
256
|
+
// without process (the browser-safe entrypoint never constructs this client).
|
|
257
|
+
function env(name) {
|
|
258
|
+
if (typeof process === "undefined" || process.env === undefined) {
|
|
259
|
+
return undefined;
|
|
260
|
+
}
|
|
261
|
+
const value = process.env[name];
|
|
262
|
+
return value && value.trim() !== "" ? value.trim() : undefined;
|
|
263
|
+
}
|
|
264
|
+
function trimTrailingSlash(url) {
|
|
265
|
+
return url.endsWith("/") ? url.slice(0, -1) : url;
|
|
266
|
+
}
|
|
267
|
+
// isSafeMethod reports whether a method has no side effect, so re-sending it after a network failure
|
|
268
|
+
// cannot double-apply anything (RFC 9110 §9.2.1). Every SDK read is a GET; nothing else is auto-safe.
|
|
269
|
+
function isSafeMethod(method) {
|
|
270
|
+
return method === "GET" || method === "HEAD";
|
|
271
|
+
}
|
|
272
|
+
// combineSignals joins the caller's cancel signal with the per-attempt timeout so either
|
|
273
|
+
// aborts the fetch; with no caller signal it is just the timeout.
|
|
274
|
+
function combineSignals(caller, timeout) {
|
|
275
|
+
return caller ? AbortSignal.any([caller, timeout]) : timeout;
|
|
276
|
+
}
|
|
277
|
+
// withinBudget reports whether the next backoff would still leave time before the deadline.
|
|
278
|
+
function withinBudget(deadline, attempt, baseMs, maxMs) {
|
|
279
|
+
return Date.now() + fullJitterBackoff(attempt, baseMs, maxMs) < deadline;
|
|
280
|
+
}
|
|
281
|
+
// retryAfterMs honors a server Retry-After header (delta-seconds) so the client backs off
|
|
282
|
+
// as instructed rather than on its own schedule; a non-numeric value is ignored.
|
|
283
|
+
function retryAfterMs(response) {
|
|
284
|
+
const header = response.headers.get("Retry-After");
|
|
285
|
+
if (header === null) {
|
|
286
|
+
return null;
|
|
287
|
+
}
|
|
288
|
+
const seconds = Number(header);
|
|
289
|
+
return Number.isFinite(seconds) && seconds >= 0 ? seconds * 1000 : null;
|
|
290
|
+
}
|
|
291
|
+
async function parseJSON(response) {
|
|
292
|
+
const text = await response.text();
|
|
293
|
+
const body = (text === "" ? undefined : JSON.parse(text));
|
|
294
|
+
return { status: response.status, headers: response.headers, body };
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,0FAA0F;AAC1F,iEAAiE;AACjE,OAAO,kBAAkB,CAAC;AAG1B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxF,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAwB,MAAM,aAAa,CAAC;AAC7E,OAAO,EAAE,SAAS,EAAE,MAA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AAa;IACpF,OAAO,IAAI,CAAC,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,QAAQ,CAAC;AAC3E,CAAC;AAED,0FAA0F;AAC1F,iFAAiF;AACjF,SAAS,YAAY,CAAC,QAA6B;IACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IACnD,IAAI,MAAM,KAAK,IAAI,EAAE,CAAC;QACpB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/B,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,OAAO,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC;AAED,KAAK,UAAU,SAAS,CAAI,QAA6B;IACvD,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAM,CAAC;IAC/D,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC;AACtE,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Problem } from "./generated/types.ts";
|
|
2
|
+
export type ProblemCode = "invalid_request" | "invalid_state" | "unsupported_content" | "missing_idempotency_key" | "authentication_required" | "invalid_token" | "expired_token" | "permission_denied" | "capability_denied" | "policy_denied" | "region_denied" | "not_found" | "revision_conflict" | "idempotency_mismatch" | "idempotency_in_progress" | "active_run_conflict" | "lease_conflict" | "gone" | "idempotency_result_expired" | "retention_expired" | "precondition_failed" | "payload_too_large" | "context_too_large" | "schema_validation_failed" | "unsupported_model_capability" | "unknown_connection" | "unsupported_model" | "model_not_allowed" | "rate_limited" | "quota_exceeded" | "concurrency_exceeded" | "internal_error" | "provider_error" | "tool_transport_error" | "runner_error" | "capacity_unavailable" | "dependency_unavailable" | "maintenance" | "operation_timed_out" | (string & {});
|
|
3
|
+
export declare class PalaiError extends Error {
|
|
4
|
+
constructor(message: string, options?: {
|
|
5
|
+
cause?: unknown;
|
|
6
|
+
});
|
|
7
|
+
}
|
|
8
|
+
export declare class PalaiConnectionError extends PalaiError {
|
|
9
|
+
readonly retryable = true;
|
|
10
|
+
constructor(message: string, options?: {
|
|
11
|
+
cause?: unknown;
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export declare class PalaiAPIError extends PalaiError {
|
|
15
|
+
readonly status: number;
|
|
16
|
+
readonly code: ProblemCode;
|
|
17
|
+
readonly problem: Problem;
|
|
18
|
+
readonly requestId: string | undefined;
|
|
19
|
+
readonly retryable: boolean;
|
|
20
|
+
constructor(status: number, problem: Problem, requestId?: string);
|
|
21
|
+
}
|
|
22
|
+
export declare class InvalidRequestError extends PalaiAPIError {
|
|
23
|
+
}
|
|
24
|
+
export declare class AuthenticationError extends PalaiAPIError {
|
|
25
|
+
}
|
|
26
|
+
export declare class PermissionDeniedError extends PalaiAPIError {
|
|
27
|
+
}
|
|
28
|
+
export declare class NotFoundError extends PalaiAPIError {
|
|
29
|
+
}
|
|
30
|
+
export declare class ConflictError extends PalaiAPIError {
|
|
31
|
+
}
|
|
32
|
+
export declare class GoneError extends PalaiAPIError {
|
|
33
|
+
}
|
|
34
|
+
export declare class RateLimitError extends PalaiAPIError {
|
|
35
|
+
}
|
|
36
|
+
export declare class InternalServerError extends PalaiAPIError {
|
|
37
|
+
}
|
|
38
|
+
export declare function isRetryableStatus(status: number): boolean;
|
|
39
|
+
export declare function errorForResponse(status: number, bodyText: string, requestId?: string): PalaiAPIError;
|
|
40
|
+
//# s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C,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAE5B,YAAY,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE,MAAM,EAQ/D;CACF;AAID,qBAAa,mBAAoB,SAAQ,aAAa;CAAG;AACzD,qBAAa,mBAAoB,SAAQ,aAAa;CAAG;AACzD,qBAAa,qBAAsB,SAAQ,aAAa;CAAG;AAC3D,qBAAa,aAAc,SAAQ,aAAa;CAAG;AACnD,qBAAa,aAAc,SAAQ,aAAa;CAAG;AACnD,qBAAa,SAAU,SAAQ,aAAa;CAAG;AAC/C,qBAAa,cAAe,SAAQ,aAAa;CAAG;AACpD,qBAAa,mBAAoB,SAAQ,aAAa;CAAG;AAIzD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD;AA8BD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,aAAa,CAIpG"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
// PalaiError is the base for everything the SDK throws, so a caller can catch the whole
|
|
2
|
+
// surface with one `instanceof`.
|
|
3
|
+
export class PalaiError extends Error {
|
|
4
|
+
constructor(message, options) {
|
|
5
|
+
super(message, options);
|
|
6
|
+
this.name = new.target.name;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
// PalaiConnectionError is a transport failure before any HTTP status was seen — a dropped
|
|
10
|
+
// socket, DNS failure, or an aborted per-attempt timeout. It is always retryable.
|
|
11
|
+
export class PalaiConnectionError extends PalaiError {
|
|
12
|
+
retryable = true;
|
|
13
|
+
constructor(message, options) {
|
|
14
|
+
super(message, options);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
// PalaiAPIError is a typed RFC 9457 problem response. It carries the parsed Problem, the
|
|
18
|
+
// HTTP status, the stable code, the correlation request id, and whether the class of
|
|
19
|
+
// failure is retryable (§23.7).
|
|
20
|
+
export class PalaiAPIError extends PalaiError {
|
|
21
|
+
status;
|
|
22
|
+
code;
|
|
23
|
+
problem;
|
|
24
|
+
requestId;
|
|
25
|
+
retryable;
|
|
26
|
+
constructor(status, problem, requestId) {
|
|
27
|
+
super(problem.detail || problem.title || problem.code || `HTTP ${status}`);
|
|
28
|
+
this.status = status;
|
|
29
|
+
this.problem = problem;
|
|
30
|
+
this.code = problem.code;
|
|
31
|
+
this.requestId = problem.request_id || requestId;
|
|
32
|
+
// The server's explicit retryable wins; otherwise fall back to the status class.
|
|
33
|
+
this.retryable = problem.retryable ?? isRetryableStatus(status);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
// Family subclasses give ergonomic `instanceof` discrimination for the common HTTP
|
|
37
|
+
// classes without a class per stable code; the exact code is always on `.code`.
|
|
38
|
+
export class InvalidRequestError extends PalaiAPIError {
|
|
39
|
+
}
|
|
40
|
+
export class AuthenticationError extends PalaiAPIError {
|
|
41
|
+
}
|
|
42
|
+
export class PermissionDeniedError extends PalaiAPIError {
|
|
43
|
+
}
|
|
44
|
+
export class NotFoundError extends PalaiAPIError {
|
|
45
|
+
}
|
|
46
|
+
export class ConflictError extends PalaiAPIError {
|
|
47
|
+
}
|
|
48
|
+
export class GoneError extends PalaiAPIError {
|
|
49
|
+
}
|
|
50
|
+
export class RateLimitError extends PalaiAPIError {
|
|
51
|
+
}
|
|
52
|
+
export class InternalServerError extends PalaiAPIError {
|
|
53
|
+
}
|
|
54
|
+
// isRetryableStatus is the SDK's default retry predicate (§23.7): a request timeout, a
|
|
55
|
+
// rate limit, or any server-side 5xx may be retried; everything else is terminal.
|
|
56
|
+
export function isRetryableStatus(status) {
|
|
57
|
+
return status === 408 || status === 429 || status >= 500;
|
|
58
|
+
}
|
|
59
|
+
// apiErrorClass picks the family subclass for an HTTP status so callers can branch on the
|
|
60
|
+
// error type. An unmapped status falls back to the base PalaiAPIError.
|
|
61
|
+
function apiErrorClass(status) {
|
|
62
|
+
switch (status) {
|
|
63
|
+
case 400:
|
|
64
|
+
case 422:
|
|
65
|
+
return InvalidRequestError;
|
|
66
|
+
case 401:
|
|
67
|
+
return AuthenticationError;
|
|
68
|
+
case 403:
|
|
69
|
+
return PermissionDeniedError;
|
|
70
|
+
case 404:
|
|
71
|
+
return NotFoundError;
|
|
72
|
+
case 409:
|
|
73
|
+
return ConflictError;
|
|
74
|
+
case 410:
|
|
75
|
+
return GoneError;
|
|
76
|
+
case 429:
|
|
77
|
+
return RateLimitError;
|
|
78
|
+
default:
|
|
79
|
+
return status >= 500 ? InternalServerError : PalaiAPIError;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// errorForResponse builds the typed error for a non-2xx response. A well-formed
|
|
83
|
+
// application/problem+json body is parsed into a Problem; a body that is missing or not a
|
|
84
|
+
// problem document degrades to a synthesized Problem carrying the stable code the status
|
|
85
|
+
// implies, so a gateway's plain-text 502 still throws a typed, retryable error.
|
|
86
|
+
export function errorForResponse(status, bodyText, requestId) {
|
|
87
|
+
const problem = parseProblem(bodyText) ?? syntheticProblem(status, requestId);
|
|
88
|
+
const Cls = apiErrorClass(status);
|
|
89
|
+
return new Cls(status, problem, requestId);
|
|
90
|
+
}
|
|
91
|
+
function parseProblem(bodyText) {
|
|
92
|
+
if (!bodyText) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
let parsed;
|
|
96
|
+
try {
|
|
97
|
+
parsed = JSON.parse(bodyText);
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
const candidate = parsed;
|
|
106
|
+
if (typeof candidate.code !== "string" || typeof candidate.status !== "number") {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
return parsed;
|
|
110
|
+
}
|
|
111
|
+
function syntheticProblem(status, requestId) {
|
|
112
|
+
const code = statusCode(status);
|
|
113
|
+
return {
|
|
114
|
+
type: `https://docs.palai.dev/problems/${code}`,
|
|
115
|
+
title: code,
|
|
116
|
+
status,
|
|
117
|
+
code,
|
|
118
|
+
request_id: requestId ?? "",
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
function statusCode(status) {
|
|
122
|
+
switch (status) {
|
|
123
|
+
case 401:
|
|
124
|
+
return "authentication_required";
|
|
125
|
+
case 403:
|
|
126
|
+
return "permission_denied";
|
|
127
|
+
case 404:
|
|
128
|
+
return "not_found";
|
|
129
|
+
case 409:
|
|
130
|
+
return "active_run_conflict";
|
|
131
|
+
case 410:
|
|
132
|
+
return "gone";
|
|
133
|
+
case 429:
|
|
134
|
+
return "rate_limited";
|
|
135
|
+
case 503:
|
|
136
|
+
return "capacity_unavailable";
|
|
137
|
+
case 504:
|
|
138
|
+
return "operation_timed_out";
|
|
139
|
+
default:
|
|
140
|
+
return status >= 500 ? "internal_error" : "invalid_request";
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAuDA,wFAAwF;AACxF,iCAAiC;AACjC,MAAM,OAAO,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC;IAC9B,CAAC;CACF;AAED,0FAA0F;AAC1F,kFAAkF;AAClF,MAAM,OAAO,oBAAqB,SAAQ,UAAU;IACzC,SAAS,GAAG,IAAI,CAAC;IAC1B,YAAY,OAAe,EAAE,OAA6B;QACxD,KAAK,CAAC,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M,KAAK,IAAI,EAAE,CAAC;QAClD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,SAAS,GAAG,MAA0B,CAAC;IAC7C,IAAI,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,IAAI,OAAO,SAAS,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC/E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,MAAiB,CAAC;AAC3B,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAc,EAAE,SAAkB;IAC1D,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAChC,OAAO;QACL,IAAI,EAAE,mCAAmC,IAAI,EAAE;QAC/C,KAAK,EAAE,IAAI;QACX,MAAM;QACN,IAAI;QACJ,UAAU,EAAE,SAAS,IAAI,EAAE;KAC5B,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,MAAc;IAChC,QAAQ,MAAM,EAAE,CAAC;QACf,KAAK,GAAG;YACN,OAAO,yBAAyB,CAAC;QACnC,KAAK,GAAG;YACN,OAAO,mBAAmB,CAAC;QAC7B,KAAK,GAAG;YACN,OAAO,WAAW,CAAC;QACrB,KAAK,GAAG;YACN,OAAO,qBAAqB,CAAC;QAC/B,KAAK,GAAG;YACN,OAAO,MAAM,CAAC;QAChB,KAAK,GAAG;YACN,OAAO,cAAc,CAAC;QACxB,KAAK,GAAG;YACN,OAAO,sBAAsB,CAAC;QAChC,KAAK,GAAG;YACN,OAAO,qBAAqB,CAAC;QAC/B;YACE,OAAO,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,iBAAiB,CAAC;IAChE,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const tools: {
|
|
2
|
+
readonly workspace: {
|
|
3
|
+
readonly file: "palai.workspace.file";
|
|
4
|
+
readonly glob: "palai.workspace.glob";
|
|
5
|
+
readonly grep: "palai.workspace.grep";
|
|
6
|
+
readonly shell: "palai.workspace.shell";
|
|
7
|
+
readonly backgroundKill: "palai.workspace.background_kill";
|
|
8
|
+
readonly showMedia: "palai.workspace.show_media";
|
|
9
|
+
readonly fetchArchive: "palai.workspace.fetch_archive";
|
|
10
|
+
readonly commit: "palai.workspace.commit";
|
|
11
|
+
};
|
|
12
|
+
readonly strReplaceBasedEditTool: "str_replace_based_edit_tool";
|
|
13
|
+
readonly preview: {
|
|
14
|
+
readonly build: "palai.preview.build";
|
|
15
|
+
};
|
|
16
|
+
readonly research: {
|
|
17
|
+
readonly fetch: "palai.research.fetch";
|
|
18
|
+
};
|
|
19
|
+
readonly knowledge: {
|
|
20
|
+
readonly retrieve: "palai.knowledge.retrieve";
|
|
21
|
+
};
|
|
22
|
+
readonly agent: {
|
|
23
|
+
readonly spawn: "palai.agent.spawn";
|
|
24
|
+
readonly status: "palai.agent.status";
|
|
25
|
+
readonly stop: "palai.agent.stop";
|
|
26
|
+
readonly send: "palai.agent.send";
|
|
27
|
+
readonly notify: "palai.agent.notify";
|
|
28
|
+
};
|
|
29
|
+
readonly skill: {
|
|
30
|
+
readonly load: "palai.skill.load";
|
|
31
|
+
};
|
|
32
|
+
readonly publish: {
|
|
33
|
+
readonly push: "palai.publish.push";
|
|
34
|
+
readonly pullRequest: "palai.publish.pull_request";
|
|
35
|
+
readonly mergePullRequest: "palai.publish.merge_pull_request";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
export type ToolName = typeof tools extends infer T ? T[keyof T] extends string ? T[keyof T] : never : never;
|
|
39
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/generated/tools.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK;aAChB,SAAS;iBACP,IAAI,EAAE,sBAAsB;iBAC5B,IAAI,EAAE,sBAAsB;iBAC5B,IAAI,EAAE,sBAAsB;iBAC5B,KAAK,EAAE,uBAAuB;iBAC9B,cAAc,EAAE,iCAAiC;iBACjD,SAAS,EAAE,4BAA4B;iBACvC,YAAY,EAAE,+BAA+B;iBAC7C,MAAM,EAAE,wBAAwB;;aAElC,uBAAuB,EAAE,6BAA6B;aACtD,OAAO;iBACL,KAAK,EAAE,qBAAqB;;aAE9B,QAAQ;iBACN,KAAK,EAAE,sBAAsB;;aAE/B,SAAS;iBACP,QAAQ,EAAE,0BAA0B;;aAEtC,KAAK;iBACH,KAAK,EAAE,mBAAmB;iBAC1B,MAAM,EAAE,oBAAoB;iBAC5B,IAAI,EAAE,kBAAkB;iBACxB,IAAI,EAAE,kBAAkB;iBACxB,MAAM,EAAE,oBAAoB;;aAE9B,KAAK;iBACH,IAAI,EAAE,kBAAkB;;aAE1B,OAAO;iBACL,IAAI,EAAE,oBAAoB;iBAC1B,WAAW,EAAE,4BAA4B;iBACzC,gBAAgB,EAAE,kCAAkC;;CAE9C,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,OAAO,KAAK,SAAS,MAAM,CAAC,GAC/C,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,GAC9C,KAAK,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// GENERATED FILE — do not edit. Source: packages/toolset/toolset.go
|
|
2
|
+
// Regenerate with: npm run generate:tools
|
|
3
|
+
//
|
|
4
|
+
// The names a run can be granted, as constants rather than strings a caller retypes. A typo in a tool
|
|
5
|
+
// name is otherwise silent: the effective set simply omits it and the model is never offered the tool,
|
|
6
|
+
// with nothing anywhere saying why.
|
|
7
|
+
export const tools = {
|
|
8
|
+
workspace: {
|
|
9
|
+
file: "palai.workspace.file",
|
|
10
|
+
glob: "palai.workspace.glob",
|
|
11
|
+
grep: "palai.workspace.grep",
|
|
12
|
+
shell: "palai.workspace.shell",
|
|
13
|
+
backgroundKill: "palai.workspace.background_kill",
|
|
14
|
+
showMedia: "palai.workspace.show_media",
|
|
15
|
+
fetchArchive: "palai.workspace.fetch_archive",
|
|
16
|
+
commit: "palai.workspace.commit",
|
|
17
|
+
},
|
|
18
|
+
strReplaceBasedEditTool: "str_replace_based_edit_tool",
|
|
19
|
+
preview: {
|
|
20
|
+
build: "palai.preview.build",
|
|
21
|
+
},
|
|
22
|
+
research: {
|
|
23
|
+
fetch: "palai.research.fetch",
|
|
24
|
+
},
|
|
25
|
+
knowledge: {
|
|
26
|
+
retrieve: "palai.knowledge.retrieve",
|
|
27
|
+
},
|
|
28
|
+
agent: {
|
|
29
|
+
spawn: "palai.agent.spawn",
|
|
30
|
+
status: "palai.agent.status",
|
|
31
|
+
stop: "palai.agent.stop",
|
|
32
|
+
send: "palai.agent.send",
|
|
33
|
+
notify: "palai.agent.notify",
|
|
34
|
+
},
|
|
35
|
+
skill: {
|
|
36
|
+
load: "palai.skill.load",
|
|
37
|
+
},
|
|
38
|
+
publish: {
|
|
39
|
+
push: "palai.publish.push",
|
|
40
|
+
pullRequest: "palai.publish.pull_request",
|
|
41
|
+
mergePullRequest: "palai.publish.merge_pull_request",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/generated/tools.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,0CAA0C;AAC1C,EAAE;AACF,sGAAsG;AACtG,uGAAuG;AACvG,oCAAoC;AACpC,MAAM,CAAC,MAAM,KAAK,GAAG;IACnB,SAAS,EAAE;QACT,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,sBAAsB;QAC5B,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,uBAAuB;QAC9B,cAAc,EAAE,iCAAiC;QACjD,SAAS,EAAE,4BAA4B;QACvC,YAAY,EAAE,+BAA+B;QAC7C,MAAM,EAAE,wBAAwB;KACjC;IACD,uBAAuB,EAAE,6BAA6B;IACtD,OAAO,EAAE;QACP,KAAK,EAAE,qBAAqB;KAC7B;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,sBAAsB;KAC9B;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,0BAA0B;KACrC;IACD,KAAK,EAAE;QACL,KAAK,EAAE,mBAAmB;QAC1B,MAAM,EAAE,oBAAoB;QAC5B,IAAI,EAAE,kBAAkB;QACxB,IAAI,EAAE,kBAAkB;QACxB,MAAM,EAAE,oBAAoB;KAC7B;IACD,KAAK,EAAE;QACL,IAAI,EAAE,kBAAkB;KACzB;IACD,OAAO,EAAE;QACP,IAAI,EAAE,oBAAoB;QAC1B,WAAW,EAAE,4BAA4B;QACzC,gBAAgB,EAAE,kCAAkC;KACrD;CACO,CAAC"}
|