omnigateway 0.12.12 → 0.13.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/README.md +1 -0
- package/bin/omni.js +414 -25
- package/gateway.js +379 -15
- package/package.json +1 -1
- package/public/assets/{Chip-D4qvhu1D.js → Chip-D0XSbQUr.js} +1 -1
- package/public/assets/{CopyValue-SnsT2LML.js → CopyValue-DAlmkISB.js} +3 -3
- package/public/assets/{Field-BYBri2NV.js → Field-DG1317zr.js} +1 -1
- package/public/assets/Lamp-Dk9XrTCg.js +26 -0
- package/public/assets/{Panel-CWmOTDAP.js → Panel-CsovmtxF.js} +23 -4
- package/public/assets/Rack-CDUOJkS2.js +483 -0
- package/public/assets/{Readout-BTh732hP.js → Readout-DlT5oxGO.js} +1 -1
- package/public/assets/RequestTable-i3TtCB9m.js +93 -0
- package/public/assets/{SummaryDeck-7ivuca39.js → SummaryDeck-DrzTQQo5.js} +2 -2
- package/public/assets/{Toggle-t82IhqEt.js → Toggle-CdMD58sy.js} +1 -1
- package/public/assets/{TokenBreakdown-D1Wtza1y.js → TokenBreakdown-BC6nqo1v.js} +1 -1
- package/public/assets/{WindowChart-BeGPsccS.js → WindowChart-Bqbl-KFO.js} +2 -2
- package/public/assets/_app-CSru2YTE.js +1 -0
- package/public/assets/_app.accounts-2syjcpos.js +70 -0
- package/public/assets/_app.console-Dxkf_zSS.js +24 -0
- package/public/assets/_app.database-CqSoTi2l.js +24 -0
- package/public/assets/_app.index-BV1kJJjA.js +67 -0
- package/public/assets/_app.keys-Dq5O0AG9.js +92 -0
- package/public/assets/_app.logs-PjRK5wqy.js +46 -0
- package/public/assets/_app.models-BfmeeB5e.js +148 -0
- package/public/assets/_app.plugins._pluginId-BSlXzAHP.js +20 -0
- package/public/assets/{_app.settings-C3GzeJ4q.js → _app.settings-5i-vvT-H.js} +7 -7
- package/public/assets/_app.usage--5qFtU1W.js +76 -0
- package/public/assets/chevron-down-Bb5ZGvwk.js +1 -0
- package/public/assets/chevron-right-hwF5mD6-.js +1 -0
- package/public/assets/{client-k1tkFSNH.js → client-DUhmc9Si.js} +4 -4
- package/public/assets/{dist-D03q-60i.js → dist-BBGxva0Y.js} +1 -1
- package/public/assets/index-Bzh27906.js +14 -0
- package/public/assets/{login-DW2Ipp21.js → login-DbXxdOl5.js} +4 -4
- package/public/assets/plus-BgcHxxIr.js +1 -0
- package/public/assets/{preload-helper-BPaHpbO_.js → preload-helper-B7KDmXJ9.js} +1 -1
- package/public/assets/rotate-ccw-Do43Argv.js +1 -0
- package/public/assets/{shared-Dtkw6SE0.js → shared-DDpLUhCp.js} +2 -2
- package/public/assets/{trash-D4QWzEK_.js → trash-00950_yY.js} +1 -1
- package/public/index.html +5 -5
- package/public/assets/Lamp-DkvXKB-B.js +0 -26
- package/public/assets/Rack-CEuCdVXc.js +0 -483
- package/public/assets/RequestTable-D8L6iVJV.js +0 -93
- package/public/assets/_app-Drf03PWk.js +0 -1
- package/public/assets/_app.accounts-W1USUo2Q.js +0 -70
- package/public/assets/_app.console-Co9d2ZiD.js +0 -44
- package/public/assets/_app.database-CtFJLcfE.js +0 -24
- package/public/assets/_app.index-DigYfob3.js +0 -67
- package/public/assets/_app.keys-B1fRMyU-.js +0 -92
- package/public/assets/_app.logs-CFixPsUw.js +0 -60
- package/public/assets/_app.models-Dpl1O2RE.js +0 -148
- package/public/assets/_app.plugins._pluginId-BK0ADugW.js +0 -20
- package/public/assets/_app.usage-D2qlcEp4.js +0 -76
- package/public/assets/chevron-down-Bs0tSOyA.js +0 -1
- package/public/assets/chevron-right-DSaI1kFo.js +0 -1
- package/public/assets/index-Bk9sabex.js +0 -14
- package/public/assets/plus-BCfjC6nk.js +0 -1
package/gateway.js
CHANGED
|
@@ -30177,12 +30177,18 @@ var ANTHROPIC_MODELS = {
|
|
|
30177
30177
|
};
|
|
30178
30178
|
var ONE_M_SUFFIX = "[1m]";
|
|
30179
30179
|
var DATED_SUFFIX = /-\d{8}$/;
|
|
30180
|
-
function
|
|
30180
|
+
function anthropicChoice(model) {
|
|
30181
30181
|
let id = model.trim();
|
|
30182
30182
|
if (id.toLowerCase().endsWith(ONE_M_SUFFIX))
|
|
30183
30183
|
id = id.slice(0, -ONE_M_SUFFIX.length).trim();
|
|
30184
30184
|
id = id.replace(DATED_SUFFIX, "");
|
|
30185
|
-
return ANTHROPIC_MODELS.models.find((m) => m.id === id)
|
|
30185
|
+
return ANTHROPIC_MODELS.models.find((m) => m.id === id);
|
|
30186
|
+
}
|
|
30187
|
+
function anthropicReasoningForm(model) {
|
|
30188
|
+
return anthropicChoice(model)?.reasoningForm ?? "adaptive";
|
|
30189
|
+
}
|
|
30190
|
+
function anthropicMaxOutputTokens(model) {
|
|
30191
|
+
return anthropicChoice(model)?.limits.maxOutputTokens;
|
|
30186
30192
|
}
|
|
30187
30193
|
|
|
30188
30194
|
// packages/providers/src/anthropic/descriptor.ts
|
|
@@ -31181,7 +31187,8 @@ function codecAdapter(id, capabilities2, codec2, origins) {
|
|
|
31181
31187
|
credentials: req.credentials,
|
|
31182
31188
|
fail,
|
|
31183
31189
|
...req.requestId === undefined ? {} : { requestId: req.requestId },
|
|
31184
|
-
...req.autoCache === undefined ? {} : { autoCacheEnabled: req.autoCache }
|
|
31190
|
+
...req.autoCache === undefined ? {} : { autoCacheEnabled: req.autoCache },
|
|
31191
|
+
...req.maxOutputTokens === undefined ? {} : { maxOutputTokens: req.maxOutputTokens }
|
|
31185
31192
|
}));
|
|
31186
31193
|
const described = built?.request ?? {};
|
|
31187
31194
|
const request2 = {
|
|
@@ -32902,6 +32909,12 @@ function addAutoCacheBreakpoints(body, req, note) {
|
|
|
32902
32909
|
lastHistory.cache_control = { type: "ephemeral" };
|
|
32903
32910
|
note("anthropic:history-cache-breakpoint-added");
|
|
32904
32911
|
}
|
|
32912
|
+
function defaultMaxTokens(model, saved) {
|
|
32913
|
+
const ceiling = anthropicMaxOutputTokens(model);
|
|
32914
|
+
if (saved === undefined)
|
|
32915
|
+
return ceiling ?? 4096;
|
|
32916
|
+
return ceiling === undefined ? saved : Math.min(saved, ceiling);
|
|
32917
|
+
}
|
|
32905
32918
|
function toWire(req, model, opts) {
|
|
32906
32919
|
const cloak = opts.cloak ?? null;
|
|
32907
32920
|
const degradations = [];
|
|
@@ -32948,7 +32961,7 @@ function toWire(req, model, opts) {
|
|
|
32948
32961
|
}
|
|
32949
32962
|
return [{ role: m.role, content: encodeSystemTurn(m.content, cloak) }];
|
|
32950
32963
|
}),
|
|
32951
|
-
max_tokens: req.maxTokens ??
|
|
32964
|
+
max_tokens: req.maxTokens ?? defaultMaxTokens(model, opts.maxOutputTokens),
|
|
32952
32965
|
stream: req.stream
|
|
32953
32966
|
};
|
|
32954
32967
|
if (systemCache.retarget !== undefined) {
|
|
@@ -33087,7 +33100,8 @@ var anthropicCodec = {
|
|
|
33087
33100
|
const { body, degradations } = toWire(input2.request, input2.model, {
|
|
33088
33101
|
oauth,
|
|
33089
33102
|
cloak,
|
|
33090
|
-
autoCache: input2.autoCacheEnabled === true
|
|
33103
|
+
autoCache: input2.autoCacheEnabled === true,
|
|
33104
|
+
...input2.maxOutputTokens === undefined ? {} : { maxOutputTokens: input2.maxOutputTokens }
|
|
33091
33105
|
});
|
|
33092
33106
|
const firstUser = input2.request.messages.find((m) => m.role === "user");
|
|
33093
33107
|
const firstText = firstUser?.content.find((b) => b.type === "text");
|
|
@@ -33420,8 +33434,125 @@ var anthropicOAuthFlow = {
|
|
|
33420
33434
|
if (!usageReadable(res.status, "anthropic"))
|
|
33421
33435
|
return null;
|
|
33422
33436
|
return parseAnthropicUsage(parsed(res.body), now());
|
|
33437
|
+
},
|
|
33438
|
+
async* resetCredits({ secrets }) {
|
|
33439
|
+
if (secrets.accessToken === null)
|
|
33440
|
+
return null;
|
|
33441
|
+
const res = yield getJsonRequest(RESET_STATUS_URL, anthropicProfile, {
|
|
33442
|
+
accessToken: secrets.accessToken,
|
|
33443
|
+
extraHeaders: SIDE_HEADERS
|
|
33444
|
+
});
|
|
33445
|
+
if (!usageReadable(res.status, "anthropic"))
|
|
33446
|
+
return null;
|
|
33447
|
+
const root = recordOf(parsed(res.body));
|
|
33448
|
+
return root === null ? null : parseResetGrants(root.cedar_ember ?? null);
|
|
33449
|
+
},
|
|
33450
|
+
async* redeemReset({ secrets, creditId, requestId, fail }) {
|
|
33451
|
+
if (secrets.accessToken === null)
|
|
33452
|
+
throw fail("AUTH", "credential holds no access token");
|
|
33453
|
+
const grantId = grantOf(creditId);
|
|
33454
|
+
if (grantId === null)
|
|
33455
|
+
throw fail("CONFLICT", "that reset credit is not available");
|
|
33456
|
+
const profile = yield getJsonRequest(PROFILE_URL, anthropicProfile, {
|
|
33457
|
+
accessToken: secrets.accessToken,
|
|
33458
|
+
extraHeaders: SIDE_HEADERS
|
|
33459
|
+
});
|
|
33460
|
+
if (profile.status < 200 || profile.status >= 300) {
|
|
33461
|
+
throw fail(redeemErrorCode(profile.status), `profile read refused: http_${profile.status}`, {
|
|
33462
|
+
status: profile.status
|
|
33463
|
+
});
|
|
33464
|
+
}
|
|
33465
|
+
const orgId = orgIdOf(parsed(profile.body));
|
|
33466
|
+
if (orgId === null)
|
|
33467
|
+
throw fail("UPSTREAM", "profile names no organization");
|
|
33468
|
+
const res = yield postJsonRequest(`https://api.anthropic.com/api/organizations/${orgId}/reset_rate_limits`, anthropicProfile, {
|
|
33469
|
+
contentType: "application/json",
|
|
33470
|
+
body: JSON.stringify({ program: RESET_PROGRAM, grant_id: grantId, request_id: requestId }),
|
|
33471
|
+
extraHeaders: [["Authorization", `Bearer ${secrets.accessToken}`], ...SIDE_HEADERS]
|
|
33472
|
+
});
|
|
33473
|
+
if (res.status < 200 || res.status >= 300) {
|
|
33474
|
+
throw fail(redeemErrorCode(res.status), `reset claim refused: http_${res.status}`, {
|
|
33475
|
+
status: res.status
|
|
33476
|
+
});
|
|
33477
|
+
}
|
|
33478
|
+
return claimOutcome(parsed(res.body), fail);
|
|
33423
33479
|
}
|
|
33424
33480
|
};
|
|
33481
|
+
var RESET_PROGRAM = "cedar_ember";
|
|
33482
|
+
var RESET_STATUS_URL = `${USAGE_URL}?cedar_ember=1&skip_spend=1`;
|
|
33483
|
+
var PROFILE_URL = "https://api.anthropic.com/api/oauth/profile";
|
|
33484
|
+
var ORG_ID = /^[A-Za-z0-9-]{1,64}$/;
|
|
33485
|
+
var SIDE_HEADERS = [["anthropic-beta", "oauth-2025-04-20"]];
|
|
33486
|
+
var USE_SUFFIX = /-u(\d+)$/;
|
|
33487
|
+
function creditIdOf(grantId, left) {
|
|
33488
|
+
return `${grantId}-u${left}`;
|
|
33489
|
+
}
|
|
33490
|
+
function grantOf(creditId) {
|
|
33491
|
+
const grant = creditId.replace(USE_SUFFIX, "");
|
|
33492
|
+
return grant === creditId || grant === "" ? null : grant;
|
|
33493
|
+
}
|
|
33494
|
+
function orgIdOf(value) {
|
|
33495
|
+
const org = recordOf(recordOf(value)?.organization);
|
|
33496
|
+
const uuid3 = org?.uuid;
|
|
33497
|
+
return typeof uuid3 === "string" && ORG_ID.test(uuid3) ? uuid3 : null;
|
|
33498
|
+
}
|
|
33499
|
+
function parseResetGrants(value) {
|
|
33500
|
+
if (value === null)
|
|
33501
|
+
return { available: 0, credits: [] };
|
|
33502
|
+
const block = recordOf(value);
|
|
33503
|
+
if (block === null || !Array.isArray(block.grants))
|
|
33504
|
+
return null;
|
|
33505
|
+
const next = typeof block.next_grant_id === "string" ? block.next_grant_id : null;
|
|
33506
|
+
const atLimit = block.at_limit === true;
|
|
33507
|
+
let available = 0;
|
|
33508
|
+
const credits = block.grants.flatMap((raw) => {
|
|
33509
|
+
const g = recordOf(raw);
|
|
33510
|
+
if (g === null || typeof g.id !== "string")
|
|
33511
|
+
return [];
|
|
33512
|
+
const left = typeof g.resets_left === "number" ? g.resets_left : 0;
|
|
33513
|
+
const claimable = left > 0 && g.usable_now === true && g.paused !== true && (g.use_requires_limit !== true || atLimit) && (next === null || next === g.id);
|
|
33514
|
+
if (claimable)
|
|
33515
|
+
available += left;
|
|
33516
|
+
return [
|
|
33517
|
+
{
|
|
33518
|
+
id: creditIdOf(g.id, left),
|
|
33519
|
+
status: claimable ? "available" : left > 0 ? "unavailable" : "used",
|
|
33520
|
+
title: typeof g.label === "string" && g.label !== "" ? g.label : null,
|
|
33521
|
+
grantedAt: isoOrNull(g.starts_at),
|
|
33522
|
+
expiresAt: isoOrNull(g.ends_at)
|
|
33523
|
+
}
|
|
33524
|
+
];
|
|
33525
|
+
});
|
|
33526
|
+
return { available, credits };
|
|
33527
|
+
}
|
|
33528
|
+
function claimOutcome(value, fail) {
|
|
33529
|
+
const body = recordOf(value);
|
|
33530
|
+
const result = typeof body?.result === "string" ? body.result : null;
|
|
33531
|
+
if (result === "reset") {
|
|
33532
|
+
return { windowsReset: Array.isArray(body?.cleared) ? body.cleared.length : null };
|
|
33533
|
+
}
|
|
33534
|
+
if (result === "cooldown")
|
|
33535
|
+
throw fail("RATE_LIMIT", "reset claim refused: cooldown");
|
|
33536
|
+
if (result === "already_used" || result === "not_limited" || result === "ineligible") {
|
|
33537
|
+
throw fail("CONFLICT", `reset claim refused: ${result}`);
|
|
33538
|
+
}
|
|
33539
|
+
throw fail("UPSTREAM", "reset claim answered without a reset");
|
|
33540
|
+
}
|
|
33541
|
+
function redeemErrorCode(status) {
|
|
33542
|
+
if (status === 429)
|
|
33543
|
+
return "RATE_LIMIT";
|
|
33544
|
+
if (status === 401 || status === 403)
|
|
33545
|
+
return "AUTH";
|
|
33546
|
+
if (status >= 400 && status < 500)
|
|
33547
|
+
return "CONFLICT";
|
|
33548
|
+
return "UPSTREAM";
|
|
33549
|
+
}
|
|
33550
|
+
function isoOrNull(value) {
|
|
33551
|
+
if (typeof value !== "string")
|
|
33552
|
+
return null;
|
|
33553
|
+
const at = Date.parse(value);
|
|
33554
|
+
return Number.isNaN(at) ? null : at;
|
|
33555
|
+
}
|
|
33425
33556
|
// packages/providers/src/antigravity/codec.ts
|
|
33426
33557
|
import { createHash as createHash2 } from "crypto";
|
|
33427
33558
|
|
|
@@ -34743,7 +34874,7 @@ var grokOAuthFlow = {
|
|
|
34743
34874
|
|
|
34744
34875
|
// packages/providers/src/kilo/oauth.ts
|
|
34745
34876
|
var CODES_URL = "https://api.kilo.ai/api/device-auth/codes";
|
|
34746
|
-
var
|
|
34877
|
+
var PROFILE_URL2 = "https://api.kilo.ai/api/profile";
|
|
34747
34878
|
var FALLBACK_VERIFICATION_URL = "https://kilo.ai";
|
|
34748
34879
|
var DEFAULT_EXPIRES_SECONDS = 300;
|
|
34749
34880
|
var POLL_INTERVAL_SECONDS = 3;
|
|
@@ -34775,7 +34906,7 @@ function deviceCodeFrom(value, fail) {
|
|
|
34775
34906
|
}
|
|
34776
34907
|
async function* orgIdFor(accessToken) {
|
|
34777
34908
|
try {
|
|
34778
|
-
const res = yield getJsonRequest(
|
|
34909
|
+
const res = yield getJsonRequest(PROFILE_URL2, kiloProfile, { accessToken });
|
|
34779
34910
|
if (res.status < 200 || res.status >= 300)
|
|
34780
34911
|
return null;
|
|
34781
34912
|
const record2 = recordFrom(parsed(res.body));
|
|
@@ -35283,6 +35414,7 @@ var AUTHORIZE_URL3 = "https://auth.openai.com/oauth/authorize";
|
|
|
35283
35414
|
var TOKEN_URL5 = "https://auth.openai.com/oauth/token";
|
|
35284
35415
|
var SCOPES4 = "openid profile email offline_access";
|
|
35285
35416
|
var USAGE_URL3 = "https://chatgpt.com/backend-api/wham/usage";
|
|
35417
|
+
var RESET_CREDITS_URL = "https://chatgpt.com/backend-api/wham/rate-limit-reset-credits";
|
|
35286
35418
|
function isRecord7(value) {
|
|
35287
35419
|
return typeof value === "object" && value !== null;
|
|
35288
35420
|
}
|
|
@@ -35436,8 +35568,78 @@ var openaiOAuthFlow = {
|
|
|
35436
35568
|
if (!usageReadable(res.status, "openai"))
|
|
35437
35569
|
return null;
|
|
35438
35570
|
return parseOpenAIUsage(parsed(res.body), now());
|
|
35571
|
+
},
|
|
35572
|
+
async* resetCredits({ secrets, providerData }) {
|
|
35573
|
+
if (secrets.accessToken === null)
|
|
35574
|
+
return null;
|
|
35575
|
+
const res = yield getJsonRequest(RESET_CREDITS_URL, openaiProfile, {
|
|
35576
|
+
accessToken: secrets.accessToken,
|
|
35577
|
+
extraHeaders: accountHeader(providerData)
|
|
35578
|
+
});
|
|
35579
|
+
if (!usageReadable(res.status, "openai"))
|
|
35580
|
+
return null;
|
|
35581
|
+
return parseResetCredits(parsed(res.body));
|
|
35582
|
+
},
|
|
35583
|
+
async* redeemReset({ secrets, providerData, creditId, requestId, fail }) {
|
|
35584
|
+
if (secrets.accessToken === null)
|
|
35585
|
+
throw fail("AUTH", "credential holds no access token");
|
|
35586
|
+
const res = yield postJsonRequest(`${RESET_CREDITS_URL}/consume`, openaiProfile, {
|
|
35587
|
+
contentType: "application/json",
|
|
35588
|
+
body: JSON.stringify({ credit_id: creditId, redeem_request_id: requestId }),
|
|
35589
|
+
extraHeaders: [
|
|
35590
|
+
["Authorization", `Bearer ${secrets.accessToken}`],
|
|
35591
|
+
...accountHeader(providerData)
|
|
35592
|
+
]
|
|
35593
|
+
});
|
|
35594
|
+
if (res.status < 200 || res.status >= 300) {
|
|
35595
|
+
throw fail(redeemErrorCode2(res.status), `reset credit redeem refused: http_${res.status}`, {
|
|
35596
|
+
status: res.status
|
|
35597
|
+
});
|
|
35598
|
+
}
|
|
35599
|
+
const body = recordOf(parsed(res.body));
|
|
35600
|
+
const windowsReset = body === null ? null : numberOf(body, ["windows_reset"]);
|
|
35601
|
+
return { windowsReset };
|
|
35439
35602
|
}
|
|
35440
35603
|
};
|
|
35604
|
+
function accountHeader(providerData) {
|
|
35605
|
+
const accountId = accountIdFromProviderData(providerData);
|
|
35606
|
+
return accountId === null ? [] : [["chatgpt-account-id", accountId]];
|
|
35607
|
+
}
|
|
35608
|
+
function redeemErrorCode2(status) {
|
|
35609
|
+
if (status === 429)
|
|
35610
|
+
return "RATE_LIMIT";
|
|
35611
|
+
if (status === 401 || status === 403)
|
|
35612
|
+
return "AUTH";
|
|
35613
|
+
if (status >= 400 && status < 500)
|
|
35614
|
+
return "CONFLICT";
|
|
35615
|
+
return "UPSTREAM";
|
|
35616
|
+
}
|
|
35617
|
+
function isoOrNull2(value) {
|
|
35618
|
+
if (typeof value !== "string")
|
|
35619
|
+
return null;
|
|
35620
|
+
const at = Date.parse(value);
|
|
35621
|
+
return Number.isFinite(at) ? at : null;
|
|
35622
|
+
}
|
|
35623
|
+
function parseResetCredits(value) {
|
|
35624
|
+
const root = recordOf(value);
|
|
35625
|
+
if (root === null || !Array.isArray(root.credits))
|
|
35626
|
+
return null;
|
|
35627
|
+
const credits = root.credits.flatMap((raw) => {
|
|
35628
|
+
const c = recordOf(raw);
|
|
35629
|
+
if (c === null || typeof c.id !== "string" || typeof c.status !== "string")
|
|
35630
|
+
return [];
|
|
35631
|
+
return [
|
|
35632
|
+
{
|
|
35633
|
+
id: c.id,
|
|
35634
|
+
status: c.status,
|
|
35635
|
+
title: typeof c.title === "string" ? c.title : null,
|
|
35636
|
+
grantedAt: isoOrNull2(c.granted_at),
|
|
35637
|
+
expiresAt: isoOrNull2(c.expires_at)
|
|
35638
|
+
}
|
|
35639
|
+
];
|
|
35640
|
+
});
|
|
35641
|
+
return { available: credits.filter((c) => c.status === "available").length, credits };
|
|
35642
|
+
}
|
|
35441
35643
|
|
|
35442
35644
|
// packages/providers/src/builtinOAuth.ts
|
|
35443
35645
|
function builtinOAuthFlows() {
|
|
@@ -38170,6 +38372,24 @@ function createConnectFlows(deps) {
|
|
|
38170
38372
|
if (provider === undefined)
|
|
38171
38373
|
throw new GatewayError("BAD_REQUEST", "provider does not support OAuth");
|
|
38172
38374
|
const result = await provider.exchange({ code, pending: flow.pending }, { http: deps.http, now: deps.now });
|
|
38375
|
+
if (flow.credentialId !== undefined) {
|
|
38376
|
+
const existing = await deps.store.credentials.get(flow.credentialId);
|
|
38377
|
+
if (existing === null)
|
|
38378
|
+
throw new GatewayError("BAD_REQUEST", "credential not found");
|
|
38379
|
+
await deps.store.credentials.updateSecrets(flow.credentialId, result.secrets, result.expiresAt);
|
|
38380
|
+
await deps.store.credentials.update(flow.credentialId, {
|
|
38381
|
+
enabled: true,
|
|
38382
|
+
disabledReason: null,
|
|
38383
|
+
disabledAt: null,
|
|
38384
|
+
accountEmail: result.accountEmail,
|
|
38385
|
+
providerData: result.providerData
|
|
38386
|
+
});
|
|
38387
|
+
logger2.info("oauth reconnect completed", {
|
|
38388
|
+
provider: flow.provider,
|
|
38389
|
+
credentialId: flow.credentialId
|
|
38390
|
+
});
|
|
38391
|
+
return { id: flow.credentialId };
|
|
38392
|
+
}
|
|
38173
38393
|
const id = crypto.randomUUID();
|
|
38174
38394
|
await deps.store.credentials.create({
|
|
38175
38395
|
id,
|
|
@@ -38206,13 +38426,25 @@ function createConnectFlows(deps) {
|
|
|
38206
38426
|
}
|
|
38207
38427
|
return {
|
|
38208
38428
|
connectableIds,
|
|
38209
|
-
async start(providerInput, labelInput) {
|
|
38429
|
+
async start(providerInput, labelInput, credentialIdInput) {
|
|
38210
38430
|
const unconnectable = () => new GatewayError("BAD_REQUEST", `provider must be one of ${connectableIds().join(", ")}`);
|
|
38211
38431
|
if (!exists(providerInput))
|
|
38212
38432
|
throw unconnectable();
|
|
38213
38433
|
const provider = deps.providers[providerInput];
|
|
38214
38434
|
if (provider === undefined)
|
|
38215
38435
|
throw unconnectable();
|
|
38436
|
+
let credentialId;
|
|
38437
|
+
if (credentialIdInput !== undefined) {
|
|
38438
|
+
if (typeof credentialIdInput !== "string" || credentialIdInput.trim().length === 0) {
|
|
38439
|
+
throw new GatewayError("BAD_REQUEST", "invalid credential for reconnect");
|
|
38440
|
+
}
|
|
38441
|
+
const id = credentialIdInput.trim();
|
|
38442
|
+
const existing = await deps.store.credentials.get(id);
|
|
38443
|
+
if (existing === null || existing.provider !== providerInput || existing.authType !== "oauth") {
|
|
38444
|
+
throw new GatewayError("BAD_REQUEST", "invalid credential for reconnect");
|
|
38445
|
+
}
|
|
38446
|
+
credentialId = id;
|
|
38447
|
+
}
|
|
38216
38448
|
const label3 = typeof labelInput === "string" && labelInput.trim().length > 0 ? labelInput.trim() : providerInput;
|
|
38217
38449
|
const redirectUri = callbackUri(providerInput);
|
|
38218
38450
|
const oauthDeps = { http: deps.http, now: deps.now };
|
|
@@ -38222,6 +38454,7 @@ function createConnectFlows(deps) {
|
|
|
38222
38454
|
provider: providerInput,
|
|
38223
38455
|
label: label3,
|
|
38224
38456
|
pending: start.pending,
|
|
38457
|
+
...credentialId === undefined ? {} : { credentialId },
|
|
38225
38458
|
...start.userCode === undefined ? {} : { userCode: start.userCode }
|
|
38226
38459
|
});
|
|
38227
38460
|
return {
|
|
@@ -38375,6 +38608,11 @@ var quotaRefreshSchema = exports_external.discriminatedUnion("kind", [
|
|
|
38375
38608
|
}).strict(),
|
|
38376
38609
|
exports_external.object({ kind: exports_external.literal("all") }).strict()
|
|
38377
38610
|
]);
|
|
38611
|
+
var accountIdSchema = exports_external.string().trim().min(1).max(64).regex(/^[A-Za-z0-9_-]+$/, "credentialId must be an account id");
|
|
38612
|
+
var redeemResetSchema = exports_external.object({
|
|
38613
|
+
credentialId: accountIdSchema,
|
|
38614
|
+
creditId: exports_external.string().min(1).max(128).regex(/^[A-Za-z0-9_-]+$/).optional()
|
|
38615
|
+
}).strict();
|
|
38378
38616
|
var dimensionSchema = exports_external.enum([
|
|
38379
38617
|
"credential",
|
|
38380
38618
|
"model",
|
|
@@ -40267,6 +40505,29 @@ function oauthAdapter(id, flow, opts = {}) {
|
|
|
40267
40505
|
return Promise.resolve(null);
|
|
40268
40506
|
return runStep(id, "usage", step, deps, origins);
|
|
40269
40507
|
}
|
|
40508
|
+
},
|
|
40509
|
+
...flow.resetCredits === undefined ? {} : {
|
|
40510
|
+
resetCredits: (secrets, deps, providerData) => {
|
|
40511
|
+
const step = flow.resetCredits?.({ secrets, providerData, ...helpers(deps) });
|
|
40512
|
+
if (step === undefined)
|
|
40513
|
+
return Promise.resolve(null);
|
|
40514
|
+
return runStep(id, "resetCredits", step, deps, origins);
|
|
40515
|
+
}
|
|
40516
|
+
},
|
|
40517
|
+
...flow.redeemReset === undefined ? {} : {
|
|
40518
|
+
redeemReset: (secrets, deps, providerData, creditId, requestId) => {
|
|
40519
|
+
const step = flow.redeemReset?.({
|
|
40520
|
+
secrets,
|
|
40521
|
+
providerData,
|
|
40522
|
+
creditId,
|
|
40523
|
+
requestId,
|
|
40524
|
+
...helpers(deps)
|
|
40525
|
+
});
|
|
40526
|
+
if (step === undefined) {
|
|
40527
|
+
return Promise.reject(flowFailure(id, "redeemReset", "has no redeem step"));
|
|
40528
|
+
}
|
|
40529
|
+
return runStep(id, "redeemReset", step, deps, origins);
|
|
40530
|
+
}
|
|
40270
40531
|
}
|
|
40271
40532
|
};
|
|
40272
40533
|
if (flow.kind === "pkce")
|
|
@@ -40302,11 +40563,32 @@ function isAuthorizeStart(value) {
|
|
|
40302
40563
|
const candidate = value;
|
|
40303
40564
|
return typeof candidate.authorizeUrl === "string" && typeof candidate.pending === "object" && candidate.pending !== null;
|
|
40304
40565
|
}
|
|
40566
|
+
function isResetCreditsOrNull(value) {
|
|
40567
|
+
if (value === null)
|
|
40568
|
+
return true;
|
|
40569
|
+
if (typeof value !== "object")
|
|
40570
|
+
return false;
|
|
40571
|
+
const candidate = value;
|
|
40572
|
+
return typeof candidate.available === "number" && Array.isArray(candidate.credits) && candidate.credits.every((c) => {
|
|
40573
|
+
if (typeof c !== "object" || c === null)
|
|
40574
|
+
return false;
|
|
40575
|
+
const row = c;
|
|
40576
|
+
return typeof row.id === "string" && typeof row.status === "string" && (row.title === null || typeof row.title === "string") && (row.grantedAt === null || typeof row.grantedAt === "number") && (row.expiresAt === null || typeof row.expiresAt === "number");
|
|
40577
|
+
});
|
|
40578
|
+
}
|
|
40579
|
+
function isResetRedeemed(value) {
|
|
40580
|
+
if (typeof value !== "object" || value === null)
|
|
40581
|
+
return false;
|
|
40582
|
+
const held = value.windowsReset;
|
|
40583
|
+
return held === null || typeof held === "number";
|
|
40584
|
+
}
|
|
40305
40585
|
var RETURN_SHAPE = {
|
|
40306
40586
|
start: isAuthorizeStart,
|
|
40307
40587
|
begin: isAuthorizeStart,
|
|
40308
40588
|
exchange: isFlowResult,
|
|
40309
|
-
refresh: isFlowResult
|
|
40589
|
+
refresh: isFlowResult,
|
|
40590
|
+
resetCredits: isResetCreditsOrNull,
|
|
40591
|
+
redeemReset: isResetRedeemed
|
|
40310
40592
|
};
|
|
40311
40593
|
|
|
40312
40594
|
// packages/control/src/oauth/index.ts
|
|
@@ -40523,6 +40805,11 @@ function validateOAuthFlow(id, value) {
|
|
|
40523
40805
|
if (value.usage !== undefined) {
|
|
40524
40806
|
checkAt(typeof value.usage === "function", id, "oauth.usage", "a function");
|
|
40525
40807
|
}
|
|
40808
|
+
for (const fn of ["resetCredits", "redeemReset"]) {
|
|
40809
|
+
if (value[fn] !== undefined) {
|
|
40810
|
+
checkAt(typeof value[fn] === "function", id, `oauth.${fn}`, "a function");
|
|
40811
|
+
}
|
|
40812
|
+
}
|
|
40526
40813
|
if (kind === "device") {
|
|
40527
40814
|
checkAt(typeof value.begin === "function", id, "oauth.begin", "a function");
|
|
40528
40815
|
checkAt(typeof value.needsDeviceId === "boolean", id, "oauth.needsDeviceId", "a boolean");
|
|
@@ -40721,6 +41008,52 @@ async function accountQuotaHistory(deps, input2) {
|
|
|
40721
41008
|
truncated
|
|
40722
41009
|
};
|
|
40723
41010
|
}
|
|
41011
|
+
// packages/control/src/quota/resets.ts
|
|
41012
|
+
async function resettable(deps, credentialId) {
|
|
41013
|
+
const credential = await deps.store.credentials.get(credentialId.trim());
|
|
41014
|
+
if (credential === null)
|
|
41015
|
+
throw new GatewayError("BAD_REQUEST", "no such credential");
|
|
41016
|
+
const provider = deps.providers[credential.provider];
|
|
41017
|
+
const list = provider?.resetCredits;
|
|
41018
|
+
const redeem = provider?.redeemReset;
|
|
41019
|
+
if (credential.authType !== "oauth" || list === undefined || redeem === undefined) {
|
|
41020
|
+
throw new GatewayError("BAD_REQUEST", "this account's provider has no quota resets");
|
|
41021
|
+
}
|
|
41022
|
+
return { credential, list, redeem };
|
|
41023
|
+
}
|
|
41024
|
+
async function listFor(deps, r) {
|
|
41025
|
+
const secrets = await usageSecretsFor(deps, r.credential);
|
|
41026
|
+
const read = await r.list(secrets, { http: deps.http, now: deps.now }, r.credential.providerData);
|
|
41027
|
+
if (read === null) {
|
|
41028
|
+
throw new GatewayError("UPSTREAM", "provider answered the reset list with nothing usable", {
|
|
41029
|
+
gatewayAuthored: true
|
|
41030
|
+
});
|
|
41031
|
+
}
|
|
41032
|
+
return read;
|
|
41033
|
+
}
|
|
41034
|
+
async function listResetCredits(deps, credentialId) {
|
|
41035
|
+
const r = await resettable(deps, credentialId);
|
|
41036
|
+
return { credentialId: r.credential.id, ...await listFor(deps, r) };
|
|
41037
|
+
}
|
|
41038
|
+
async function redeemResetCredit(deps, request2) {
|
|
41039
|
+
const r = await resettable(deps, request2.credentialId);
|
|
41040
|
+
return deps.coord.mutex.withLock(PROBE_LOCK_PREFIX + r.credential.id, PROBE_LOCK_TTL_MS, PROBE_LOCK_WAIT_MS, () => redeemLocked(deps, r, request2));
|
|
41041
|
+
}
|
|
41042
|
+
async function redeemLocked(deps, r, request2) {
|
|
41043
|
+
const available = (await listFor(deps, r)).credits.filter((c) => c.status === "available").sort((a, b) => (a.expiresAt ?? Number.POSITIVE_INFINITY) - (b.expiresAt ?? Number.POSITIVE_INFINITY));
|
|
41044
|
+
const credit = request2.creditId === undefined ? available[0] : available.find((c) => c.id === request2.creditId);
|
|
41045
|
+
if (credit === undefined) {
|
|
41046
|
+
throw new GatewayError("CONFLICT", request2.creditId === undefined ? "no reset credit is available for this account" : "that reset credit is not available");
|
|
41047
|
+
}
|
|
41048
|
+
const secrets = await usageSecretsFor(deps, r.credential);
|
|
41049
|
+
const { windowsReset } = await r.redeem(secrets, { http: deps.http, now: deps.now }, r.credential.providerData, credit.id, crypto.randomUUID());
|
|
41050
|
+
let quotaRefreshed = false;
|
|
41051
|
+
try {
|
|
41052
|
+
quotaRefreshed = await probe(deps, r.credential) !== null;
|
|
41053
|
+
} catch {}
|
|
41054
|
+
return { credentialId: r.credential.id, creditId: credit.id, windowsReset, quotaRefreshed };
|
|
41055
|
+
}
|
|
41056
|
+
|
|
40724
41057
|
// packages/control/src/quota/poll.ts
|
|
40725
41058
|
var CONCURRENCY = 4;
|
|
40726
41059
|
var RATE_LIMIT_COOLDOWN_MS = 180000;
|
|
@@ -40728,14 +41061,17 @@ var COOLDOWN_PREFIX = "quota:cooldown:";
|
|
|
40728
41061
|
var PROBE_LOCK_PREFIX = "quota:probe:";
|
|
40729
41062
|
var PROBE_LOCK_TTL_MS = 60000;
|
|
40730
41063
|
var PROBE_LOCK_WAIT_MS = 30000;
|
|
41064
|
+
async function usageSecretsFor(deps, credential) {
|
|
41065
|
+
const refreshed = credential.hasRefreshToken && credential.expiresAt !== null && credential.expiresAt - SCHEDULER_REFRESH_LEAD_MS <= deps.now() ? await deps.refresh(credential) : null;
|
|
41066
|
+
return refreshed === null ? await credential.openForUsage() : { accessToken: refreshed.accessToken };
|
|
41067
|
+
}
|
|
40731
41068
|
async function probe(deps, credential) {
|
|
40732
41069
|
if (credential.authType !== "oauth")
|
|
40733
41070
|
return null;
|
|
40734
41071
|
const provider = deps.providers[credential.provider];
|
|
40735
41072
|
if (provider?.usage === undefined)
|
|
40736
41073
|
return null;
|
|
40737
|
-
const
|
|
40738
|
-
const secrets = refreshed === null ? await credential.openForUsage() : { accessToken: refreshed.accessToken };
|
|
41074
|
+
const secrets = await usageSecretsFor(deps, credential);
|
|
40739
41075
|
const report = await provider.usage(secrets, { http: deps.http, now: deps.now }, credential.providerData);
|
|
40740
41076
|
if (report === null || report.windows.length === 0)
|
|
40741
41077
|
return null;
|
|
@@ -40898,6 +41234,12 @@ function quotaOps(deps) {
|
|
|
40898
41234
|
outcomes.push(result?.outcome ?? { kind: "failed", credentialId: credential.id, code: "INTERNAL" });
|
|
40899
41235
|
}
|
|
40900
41236
|
return { outcomes };
|
|
41237
|
+
},
|
|
41238
|
+
resetCredits: (credentialId) => listResetCredits(deps, credentialId),
|
|
41239
|
+
redeemReset: (request2) => redeemResetCredit(deps, request2),
|
|
41240
|
+
hasResets: (provider) => {
|
|
41241
|
+
const flow = deps.providers[provider];
|
|
41242
|
+
return flow?.resetCredits !== undefined && flow.redeemReset !== undefined;
|
|
40901
41243
|
}
|
|
40902
41244
|
};
|
|
40903
41245
|
}
|
|
@@ -57094,6 +57436,12 @@ function adminRoutes(deps) {
|
|
|
57094
57436
|
});
|
|
57095
57437
|
};
|
|
57096
57438
|
const changed = (topic) => deps.broadcaster?.invalidate(topic);
|
|
57439
|
+
const quotaOrRefuse = () => {
|
|
57440
|
+
if (deps.quota === undefined) {
|
|
57441
|
+
throw new GatewayError("INTERNAL", "quota operations are not available on this process");
|
|
57442
|
+
}
|
|
57443
|
+
return deps.quota;
|
|
57444
|
+
};
|
|
57097
57445
|
return new Elysia().onError(apiErrorHandler).get("/api/status", async ({ request: request2 }) => {
|
|
57098
57446
|
const token = readCookie(request2, ADMIN_COOKIE);
|
|
57099
57447
|
const principal = token === null ? null : await deps.admin.verify(token);
|
|
@@ -57182,6 +57530,18 @@ function adminRoutes(deps) {
|
|
|
57182
57530
|
changed("res:quota");
|
|
57183
57531
|
}
|
|
57184
57532
|
return result;
|
|
57533
|
+
}).get("/api/credentials/:id/resets", async ({ request: request2, params }) => {
|
|
57534
|
+
await requireAdmin(request2, deps.admin);
|
|
57535
|
+
return quotaOrRefuse().resetCredits(params.id);
|
|
57536
|
+
}).post("/api/credentials/:id/resets/redeem", async ({ request: request2, params }) => {
|
|
57537
|
+
await requireAdmin(request2, deps.admin);
|
|
57538
|
+
const raw = await readJsonRecord(request2);
|
|
57539
|
+
if (raw === null)
|
|
57540
|
+
throw new GatewayError("BAD_REQUEST", "body must be a JSON object");
|
|
57541
|
+
const body2 = parseOrThrow(redeemResetSchema, { ...raw, credentialId: params.id });
|
|
57542
|
+
const result = await quotaOrRefuse().redeemReset(body2);
|
|
57543
|
+
changed("res:quota");
|
|
57544
|
+
return result;
|
|
57185
57545
|
}).patch("/api/credentials/:id", async ({ request: request2, params }) => {
|
|
57186
57546
|
await requireAdmin(request2, deps.admin);
|
|
57187
57547
|
await patchCredential(deps, params.id, await readJson(request2));
|
|
@@ -57197,7 +57557,10 @@ function adminRoutes(deps) {
|
|
|
57197
57557
|
return { models: await listModels(deps.store) };
|
|
57198
57558
|
}).get("/api/catalog", async ({ request: request2 }) => {
|
|
57199
57559
|
await requireReader(request2, deps.admin);
|
|
57200
|
-
|
|
57560
|
+
const quota = deps.quota;
|
|
57561
|
+
return {
|
|
57562
|
+
providers: providerCatalog(reportCatalogProblem).map((provider) => quota?.hasResets(provider.id) === true ? { ...provider, quotaResets: true } : provider)
|
|
57563
|
+
};
|
|
57201
57564
|
}).put("/api/models/:id", async ({ request: request2, params }) => {
|
|
57202
57565
|
await requireAdmin(request2, deps.admin);
|
|
57203
57566
|
await putModel(deps.store, params.id, await readJson(request2));
|
|
@@ -57466,7 +57829,7 @@ function connectRoutes(deps) {
|
|
|
57466
57829
|
return new Elysia().onError(apiErrorHandler).post("/api/connect/start", async ({ request: request2 }) => {
|
|
57467
57830
|
await requireAdmin(request2, deps.admin);
|
|
57468
57831
|
const body2 = await readJsonRecord(request2);
|
|
57469
|
-
return flows.start(body2?.provider, body2?.label);
|
|
57832
|
+
return flows.start(body2?.provider, body2?.label, body2?.credentialId);
|
|
57470
57833
|
}).post("/api/connect/finish", async ({ request: request2 }) => {
|
|
57471
57834
|
await requireAdmin(request2, deps.admin);
|
|
57472
57835
|
const body2 = await readJsonRecord(request2);
|
|
@@ -60084,7 +60447,8 @@ async function attempt(opts) {
|
|
|
60084
60447
|
http,
|
|
60085
60448
|
signal,
|
|
60086
60449
|
...opts.requestId === undefined ? {} : { requestId: opts.requestId },
|
|
60087
|
-
...opts.autoCache === undefined ? {} : { autoCache: opts.autoCache }
|
|
60450
|
+
...opts.autoCache === undefined ? {} : { autoCache: opts.autoCache },
|
|
60451
|
+
...candidate.target.maxOutputTokens === undefined ? {} : { maxOutputTokens: candidate.target.maxOutputTokens }
|
|
60088
60452
|
});
|
|
60089
60453
|
}
|
|
60090
60454
|
|
|
@@ -63124,7 +63488,7 @@ function createRing(limits = DEFAULT_RING_LIMITS) {
|
|
|
63124
63488
|
}
|
|
63125
63489
|
|
|
63126
63490
|
// apps/gateway/src/version.ts
|
|
63127
|
-
var VERSION = "0.
|
|
63491
|
+
var VERSION = "0.13.0";
|
|
63128
63492
|
|
|
63129
63493
|
// apps/gateway/src/app.ts
|
|
63130
63494
|
var ADMIN_SESSION_TTL_MS = 12 * 60 * 60 * 1000;
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{w as e}from"./Rack-
|
|
1
|
+
import{w as e}from"./Rack-CDUOJkS2.js";import{jsx as t}from"react/jsx-runtime";import n from"styled-components";var r={neutral:{fg:`var(--ink-dim)`,bg:`transparent`},ok:{fg:`var(--ok)`,bg:`var(--ok-wash)`},warn:{fg:`var(--warn)`,bg:`var(--warn-wash)`},down:{fg:`var(--down)`,bg:`var(--down-wash)`},accent:{fg:`var(--accent)`,bg:`var(--accent-wash)`}},i=n.span`
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
align-items: center;
|
|
4
4
|
line-height: 1;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{A as e,T as t}from"./Panel-CsovmtxF.js";import{A as n}from"./Rack-CDUOJkS2.js";import{useCallback as r,useEffect as i,useRef as a,useState as o}from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import l from"styled-components";var u={name:`check`,size:24,node:[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]};u.node;var d=n(u),f={name:`copy`,size:24,node:[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]};f.node;var p=n(f);function m(e){if(e===null||typeof getSelection!=`function`)return!1;let t=getSelection();if(t===null)return!1;try{let n=document.createRange();return n.selectNodeContents(e),t.removeAllRanges(),t.addRange(n),!0}catch{return!1}}async function h(e,t){if(typeof navigator<`u`&&navigator.clipboard!==void 0)try{return await navigator.clipboard.writeText(e),`copied`}catch{}let n=m(t??null);if(n&&typeof document.execCommand==`function`)try{if(document.execCommand(`copy`))return`copied`}catch{}return n?`selected`:`failed`}var g=l.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: stretch;
|
|
4
4
|
gap: 0;
|
|
@@ -14,7 +14,7 @@ import{C as e,O as t}from"./Panel-CWmOTDAP.js";import{A as n}from"./Rack-CEuCdVX
|
|
|
14
14
|
font-size: 12px;
|
|
15
15
|
word-break: break-all;
|
|
16
16
|
user-select: all;
|
|
17
|
-
`,v=l(
|
|
17
|
+
`,v=l(e)`
|
|
18
18
|
border: 0;
|
|
19
19
|
border-left: 1px solid ${({theme:e})=>e.color.ruleStrong};
|
|
20
20
|
border-radius: 0;
|
|
@@ -24,4 +24,4 @@ import{C as e,O as t}from"./Panel-CWmOTDAP.js";import{A as n}from"./Rack-CEuCdVX
|
|
|
24
24
|
`,y=l.p`
|
|
25
25
|
font-size: 11px;
|
|
26
26
|
color: ${({theme:e})=>e.color.warn};
|
|
27
|
-
`,b={selected:`Your browser would not copy it. The value is selected — copy it with your keyboard.`,failed:`Your browser would not copy it. Select the value and copy it by hand.`};function x({value:
|
|
27
|
+
`,b={selected:`Your browser would not copy it. The value is selected — copy it with your keyboard.`,failed:`Your browser would not copy it. Select the value and copy it by hand.`};function x({value:e,label:n}){let[l,u]=o(null),f=a(null);i(()=>{if(l!==`copied`)return;let e=setTimeout(()=>u(null),1600);return()=>clearTimeout(e)},[l]);let m=r(()=>{h(e,f.current).then(u)},[e]),x=l===`copied`,S=l===null?void 0:b[l];return c(t,{$gap:1,children:[c(g,{children:[s(_,{ref:f,children:e}),s(v,{type:`button`,$variant:`ghost`,onClick:m,"aria-label":x?`Copied`:n,title:x?`Copied`:n,children:s(x?d:p,{})})]}),S===void 0?null:s(y,{role:`status`,children:S})]})}export{x as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{y as e}from"./Panel-CsovmtxF.js";import{useId as t}from"react";import{jsx as n,jsxs as r}from"react/jsx-runtime";import i from"styled-components";var a=`
|
|
2
2
|
width: 100%;
|
|
3
3
|
border-radius: 3px;
|
|
4
4
|
transition: border-color 120ms ease;
|