@kombai/cli 0.2.0 → 0.2.2
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/dist/kombai.mjs +74 -22
- package/dist/launch.mjs +1 -1
- package/dist/mcp-apps/design-taste.js +1 -1
- package/dist/mcp-apps/plans.js +39 -39
- package/package.json +1 -1
package/dist/kombai.mjs
CHANGED
|
@@ -504,6 +504,9 @@ function pick(entry, fields) {
|
|
|
504
504
|
function hasGuest(entry) {
|
|
505
505
|
return typeof entry.guest === "string" && entry.guest !== "";
|
|
506
506
|
}
|
|
507
|
+
function isMarkedClaimed(guest2) {
|
|
508
|
+
return typeof guest2?.guestClaimed === "string" && guest2.guestClaimed === guest2.guestId;
|
|
509
|
+
}
|
|
507
510
|
async function writeCredential(home, env, credential) {
|
|
508
511
|
await updateEntry(home, env, (entry) => {
|
|
509
512
|
return {
|
|
@@ -588,7 +591,14 @@ var init_store = __esm({
|
|
|
588
591
|
SIGN_IN_AGAIN = "that signs this machine out, so sign in again after.";
|
|
589
592
|
NEW_MACHINE_ID = "the CLI then makes a new machine id.";
|
|
590
593
|
KEY_FIELDS = Object.freeze(["key", "keyId", "userId", "email", "expires"]);
|
|
591
|
-
GUEST_FIELDS = Object.freeze([
|
|
594
|
+
GUEST_FIELDS = Object.freeze([
|
|
595
|
+
"guest",
|
|
596
|
+
"guestId",
|
|
597
|
+
"canvasId",
|
|
598
|
+
"guestExpires",
|
|
599
|
+
"claimOrgs",
|
|
600
|
+
"guestClaimed"
|
|
601
|
+
]);
|
|
592
602
|
}
|
|
593
603
|
});
|
|
594
604
|
|
|
@@ -1040,13 +1050,13 @@ var init_version = __esm({
|
|
|
1040
1050
|
init_define_KOMBAI_TELEMETRY();
|
|
1041
1051
|
init_codexKombaiEntry();
|
|
1042
1052
|
init_place();
|
|
1043
|
-
CLI_VERSION = true ? "0.2.
|
|
1053
|
+
CLI_VERSION = true ? "0.2.2" : (
|
|
1044
1054
|
/** @type {{ version: string }} */
|
|
1045
1055
|
JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf8")).version
|
|
1046
1056
|
);
|
|
1047
|
-
CLI_NPX_RUN = true ? "npx -y @kombai/cli@0.2.
|
|
1057
|
+
CLI_NPX_RUN = true ? "npx -y @kombai/cli@0.2.2" : `npx -y ${KOMBAI_CLI_PACKAGE}`;
|
|
1048
1058
|
CLI_RUN = runLineOf(fileURLToPath(import.meta.url), CLI_VERSION, CLI_NPX_RUN);
|
|
1049
|
-
CLI_PACKAGE = true ? "@kombai/cli@0.2.
|
|
1059
|
+
CLI_PACKAGE = true ? "@kombai/cli@0.2.2" : KOMBAI_CLI_PACKAGE;
|
|
1050
1060
|
CLI_OUTDATED_NEXT = "A newer Kombai CLI is out; update the Kombai plugin.";
|
|
1051
1061
|
}
|
|
1052
1062
|
});
|
|
@@ -3074,7 +3084,7 @@ function storageReason(text) {
|
|
|
3074
3084
|
const match = /<Code>([^<]+)<\/Code>/.exec(text);
|
|
3075
3085
|
return match ? match[1] : void 0;
|
|
3076
3086
|
}
|
|
3077
|
-
var CALL_LIMIT_MS, STORAGE_LIMIT_MS, LOST_ANSWER_BACKOFF_MS, MAX_RETRY_AFTER_TRIES, MAX_RETRY_AFTER_MS, PRIVATE_CANVAS, UNKNOWN_OUTCOME_STATUSES, GUEST_CLAIM_PATH, GUEST_CANVAS_PATH, GUEST_GONE_CODES, isGuestGone, LostAnswer, ApiClient, GUEST_ERRORS;
|
|
3087
|
+
var CALL_LIMIT_MS, STORAGE_LIMIT_MS, LOST_ANSWER_BACKOFF_MS, MAX_RETRY_AFTER_TRIES, MAX_RETRY_AFTER_MS, PRIVATE_CANVAS, UNKNOWN_OUTCOME_STATUSES, GUEST_CLAIM_PATH, GUEST_CANVAS_PATH, CliCapability, CLI_CAPS, GUEST_GONE_CODES, isGuestGone, LostAnswer, ApiClient, GUEST_ERRORS;
|
|
3078
3088
|
var init_api = __esm({
|
|
3079
3089
|
"src/lib/api.js"() {
|
|
3080
3090
|
"use strict";
|
|
@@ -3093,6 +3103,14 @@ var init_api = __esm({
|
|
|
3093
3103
|
UNKNOWN_OUTCOME_STATUSES = /* @__PURE__ */ new Set([500, 502, 504]);
|
|
3094
3104
|
GUEST_CLAIM_PATH = "/design/guest-claim";
|
|
3095
3105
|
GUEST_CANVAS_PATH = "/design/canvases/";
|
|
3106
|
+
CliCapability = Object.freeze({
|
|
3107
|
+
/**
|
|
3108
|
+
* A guest token the store calls claimed (SIGNIN_GUEST_CLAIMED) is kept and marked `guestClaimed`, so the next
|
|
3109
|
+
* login's claim repeats and names the canvas: the hosted page may then claim the guest canvas itself.
|
|
3110
|
+
*/
|
|
3111
|
+
PageClaim: "page-claim"
|
|
3112
|
+
});
|
|
3113
|
+
CLI_CAPS = Object.values(CliCapability).join(",");
|
|
3096
3114
|
GUEST_GONE_CODES = /* @__PURE__ */ new Set(["SIGNIN_GUEST_EXPIRED", "SIGNIN_GUEST_CLAIMED"]);
|
|
3097
3115
|
isGuestGone = (code) => GUEST_GONE_CODES.has(code);
|
|
3098
3116
|
LostAnswer = class extends CliError {
|
|
@@ -3144,6 +3162,7 @@ var init_api = __esm({
|
|
|
3144
3162
|
const url2 = `${this.baseUrl}${path30}${queryString(options.query)}`;
|
|
3145
3163
|
const headers = {
|
|
3146
3164
|
"x-kombai-cli": this.ctx.version,
|
|
3165
|
+
"x-kombai-cli-caps": CLI_CAPS,
|
|
3147
3166
|
"x-type": "agent",
|
|
3148
3167
|
"x-session-id": this.ctx.sessionId
|
|
3149
3168
|
};
|
|
@@ -3344,12 +3363,13 @@ async function openAnySession(ctx, options = {}) {
|
|
|
3344
3363
|
...guestHooks(ctx, env, guest2)
|
|
3345
3364
|
});
|
|
3346
3365
|
const session = { kind: "key", env, hosts, credential, guest: guest2, api: api2 };
|
|
3347
|
-
if (guest2 && !guest2.claimOrgs && options.claim !== false) {
|
|
3366
|
+
if (guest2 && (!guest2.claimOrgs || isMarkedClaimed(guest2)) && options.claim !== false) {
|
|
3348
3367
|
const outcome = await settleClaim(ctx, session, void 0, { retry: options.claimRetry ?? "safe" });
|
|
3349
3368
|
if (outcome.status === "pending") ctx.warnings.add(CLAIM_PENDING);
|
|
3350
3369
|
}
|
|
3351
3370
|
return session;
|
|
3352
3371
|
}
|
|
3372
|
+
if (isClaimedGuest(entry)) throw guestClaimedRefusal();
|
|
3353
3373
|
if (!guest2 || holdsAccount(entry)) throw notSignedIn(`Not signed in to Kombai (${env}).`, notSignedInReason(entry));
|
|
3354
3374
|
const api = new ApiClient({ ctx, baseUrl: hosts.api, key: null, deadline, ...guestHooks(ctx, env, guest2) });
|
|
3355
3375
|
return { kind: "guest", env, hosts, credential: null, guest: guest2, api };
|
|
@@ -3357,9 +3377,14 @@ async function openAnySession(ctx, options = {}) {
|
|
|
3357
3377
|
function isPureGuest(entry) {
|
|
3358
3378
|
return hasGuest(entry) && !holdsAccount(entry);
|
|
3359
3379
|
}
|
|
3380
|
+
function isClaimedGuest(entry) {
|
|
3381
|
+
return isPureGuest(entry) && isMarkedClaimed(entry);
|
|
3382
|
+
}
|
|
3360
3383
|
async function refuseGuest(ctx) {
|
|
3361
3384
|
const { env } = await currentEnv(ctx);
|
|
3362
|
-
|
|
3385
|
+
const entry = await readEntry(ctx.home, env);
|
|
3386
|
+
if (isClaimedGuest(entry)) throw guestClaimedRefusal();
|
|
3387
|
+
if (isPureGuest(entry))
|
|
3363
3388
|
throw signInRequired("This needs a Kombai account, and this machine is a guest: sign in first.");
|
|
3364
3389
|
}
|
|
3365
3390
|
function guestHooks(ctx, env, guest2) {
|
|
@@ -3368,7 +3393,8 @@ function guestHooks(ctx, env, guest2) {
|
|
|
3368
3393
|
let expires = guest2.guestExpires;
|
|
3369
3394
|
return {
|
|
3370
3395
|
guest: { token, canvasId: guest2.canvasId ?? null },
|
|
3371
|
-
|
|
3396
|
+
/** @param {import('./api.js').GuestGoneCode} code */
|
|
3397
|
+
onGuestGone: (code) => code === "SIGNIN_GUEST_CLAIMED" ? markGuestClaimed(ctx.home, env, token, guest2.guestId) : forgetGuest(ctx.home, env, token),
|
|
3372
3398
|
/** @param {string} guestExpiresAt */
|
|
3373
3399
|
onGuestExpires: async (guestExpiresAt) => {
|
|
3374
3400
|
if (guestExpiresAt === expires) return;
|
|
@@ -3416,6 +3442,15 @@ async function forgetGuest(home, env, guest2) {
|
|
|
3416
3442
|
for (const field of GUEST_FIELDS) delete record2[field];
|
|
3417
3443
|
});
|
|
3418
3444
|
}
|
|
3445
|
+
async function markGuestClaimed(home, env, guest2, guestId) {
|
|
3446
|
+
await writeGuest(home, env, { guestClaimed: guestId }, { ifGuest: guest2 });
|
|
3447
|
+
}
|
|
3448
|
+
function guestClaimedRefusal() {
|
|
3449
|
+
return notSignedIn(
|
|
3450
|
+
"This guest canvas moved into a Kombai account; sign in to reach it.",
|
|
3451
|
+
NotSignedInReason.GUEST_CLAIMED
|
|
3452
|
+
);
|
|
3453
|
+
}
|
|
3419
3454
|
async function settleClaim(ctx, session, orgId, options = {}) {
|
|
3420
3455
|
const guest2 = session.guest;
|
|
3421
3456
|
if (!guest2) return { status: "none" };
|
|
@@ -3437,8 +3472,13 @@ async function settleClaim(ctx, session, orgId, options = {}) {
|
|
|
3437
3472
|
} catch (error2) {
|
|
3438
3473
|
if (!(error2 instanceof CliError)) throw error2;
|
|
3439
3474
|
if (CLAIM_ENDED_CODES.has(error2.code)) {
|
|
3475
|
+
const claimedEarlier = isMarkedClaimed(guest2) && error2.code === "SIGNIN_GUEST_EXPIRED";
|
|
3476
|
+
if (claimedEarlier) error2.message = CLAIMED_EARLIER;
|
|
3440
3477
|
await forgetGuest(ctx.home, env, guest2.guest);
|
|
3441
|
-
ctx.warnings.add({
|
|
3478
|
+
ctx.warnings.add({
|
|
3479
|
+
code: error2.code,
|
|
3480
|
+
message: claimedEarlier ? CLAIMED_EARLIER : CLAIM_ENDED_MESSAGES[error2.code] ?? error2.message
|
|
3481
|
+
});
|
|
3442
3482
|
return settled({ status: "dropped", error: error2 });
|
|
3443
3483
|
}
|
|
3444
3484
|
if (error2.status === 401) throw error2;
|
|
@@ -3478,7 +3518,7 @@ function claimFields(outcome) {
|
|
|
3478
3518
|
return {};
|
|
3479
3519
|
}
|
|
3480
3520
|
}
|
|
3481
|
-
var NotSignedInReason, CLAIM_PENDING, CLAIM_ENDED_CODES, CLAIM_ENDED_MESSAGES, CLAIM_BAD_ORG_CODES;
|
|
3521
|
+
var NotSignedInReason, CLAIM_PENDING, CLAIM_ENDED_CODES, CLAIM_ENDED_MESSAGES, CLAIMED_EARLIER, CLAIM_BAD_ORG_CODES;
|
|
3482
3522
|
var init_session = __esm({
|
|
3483
3523
|
"src/lib/session.js"() {
|
|
3484
3524
|
"use strict";
|
|
@@ -3493,7 +3533,9 @@ var init_session = __esm({
|
|
|
3493
3533
|
/** A key is stored but has expired. */
|
|
3494
3534
|
EXPIRED: "expired",
|
|
3495
3535
|
/** The key was forgotten after the backend refused it. */
|
|
3496
|
-
SIGNED_OUT: "signed_out"
|
|
3536
|
+
SIGNED_OUT: "signed_out",
|
|
3537
|
+
/** No account here, and the guest token held is marked claimed: its canvas moved into an account (guestClaimed). */
|
|
3538
|
+
GUEST_CLAIMED: "guest_claimed"
|
|
3497
3539
|
});
|
|
3498
3540
|
CLAIM_PENDING = Object.freeze({
|
|
3499
3541
|
code: "CLI_CLAIM_PENDING",
|
|
@@ -3504,6 +3546,7 @@ var init_session = __esm({
|
|
|
3504
3546
|
SIGNIN_GUEST_EXPIRED: "The guest canvas had expired, so there was nothing to move into your account.",
|
|
3505
3547
|
SIGNIN_GUEST_CLAIMED: "The guest canvas was already moved into an account."
|
|
3506
3548
|
};
|
|
3549
|
+
CLAIMED_EARLIER = "The guest canvas had already moved into an account.";
|
|
3507
3550
|
CLAIM_BAD_ORG_CODES = /* @__PURE__ */ new Set(["DESIGN_FORBIDDEN", "DESIGN_BAD_REQUEST"]);
|
|
3508
3551
|
}
|
|
3509
3552
|
});
|
|
@@ -4949,7 +4992,7 @@ function heldLine(ctx, env, entry) {
|
|
|
4949
4992
|
if (holdsAccount(entry)) {
|
|
4950
4993
|
throw notSignedIn("This machine has signed in to Kombai before; sign in again.", notSignedInReason(entry));
|
|
4951
4994
|
}
|
|
4952
|
-
return hasGuest(entry) ? guestLine(entry, env) : null;
|
|
4995
|
+
return hasGuest(entry) && !isMarkedClaimed(entry) ? guestLine(entry, env) : null;
|
|
4953
4996
|
}
|
|
4954
4997
|
function whoamiLine(ctx, env, entry) {
|
|
4955
4998
|
const credential = keyOf(entry);
|
|
@@ -4963,6 +5006,7 @@ function whoamiLine(ctx, env, entry) {
|
|
|
4963
5006
|
throw error2;
|
|
4964
5007
|
}
|
|
4965
5008
|
if (!hasGuest(entry)) throw error2;
|
|
5009
|
+
if (isMarkedClaimed(entry)) throw guestClaimedRefusal();
|
|
4966
5010
|
return {
|
|
4967
5011
|
status: "guest",
|
|
4968
5012
|
guestId: entry.guestId,
|
|
@@ -4973,9 +5017,10 @@ function whoamiLine(ctx, env, entry) {
|
|
|
4973
5017
|
}
|
|
4974
5018
|
function keyLine(credential, env, entry) {
|
|
4975
5019
|
if (!hasGuest(entry)) return identity(credential, env);
|
|
5020
|
+
const needsOrg = entry.claimOrgs && !isMarkedClaimed(entry);
|
|
4976
5021
|
return {
|
|
4977
5022
|
...identity(credential, env),
|
|
4978
|
-
...
|
|
5023
|
+
...needsOrg ? { claim: "needs_org", orgs: entry.claimOrgs } : { claim: "pending" }
|
|
4979
5024
|
};
|
|
4980
5025
|
}
|
|
4981
5026
|
function guestLine(entry, env) {
|
|
@@ -5182,7 +5227,7 @@ var init_auth = __esm({
|
|
|
5182
5227
|
}
|
|
5183
5228
|
const token = parsed[0];
|
|
5184
5229
|
const after = await updateEntry(ctx.home, env, (entry) => {
|
|
5185
|
-
if (holdsAccount(entry) || hasGuest(entry)) return;
|
|
5230
|
+
if (holdsAccount(entry) || hasGuest(entry) && !isMarkedClaimed(entry)) return;
|
|
5186
5231
|
const record2 = (
|
|
5187
5232
|
/** @type {Record<string, unknown>} */
|
|
5188
5233
|
entry
|
|
@@ -9710,7 +9755,7 @@ async function ticketedUrl(ctx, cc) {
|
|
|
9710
9755
|
cc.canvasId
|
|
9711
9756
|
);
|
|
9712
9757
|
const { projectId } = await projectOf(ctx, cc, await readForLink(cc));
|
|
9713
|
-
const guestOwns = cc.session.kind === "key" && cc.session.guest?.canvasId === canvasId;
|
|
9758
|
+
const guestOwns = cc.session.kind === "key" && cc.session.guest?.canvasId === canvasId && !isMarkedClaimed(cc.session.guest);
|
|
9714
9759
|
const res = await cc.session.api.call({
|
|
9715
9760
|
method: "POST",
|
|
9716
9761
|
path: "/design/tickets",
|
|
@@ -10353,6 +10398,7 @@ var init_config = __esm({
|
|
|
10353
10398
|
const credential = await readCredential(ctx.home, env);
|
|
10354
10399
|
if (!credential) {
|
|
10355
10400
|
const entry = await readEntry(ctx.home, env);
|
|
10401
|
+
if (isClaimedGuest(entry)) throw guestClaimedRefusal();
|
|
10356
10402
|
if (isPureGuest(entry))
|
|
10357
10403
|
throw signInRequired("The preference is kept per signed-in user, and this machine is a guest: sign in first.");
|
|
10358
10404
|
throw notSignedIn("Sign in first: the preference is kept per signed-in user.", notSignedInReason(entry));
|
|
@@ -34564,7 +34610,8 @@ async function callCanvasApp(ctx, args) {
|
|
|
34564
34610
|
}
|
|
34565
34611
|
async function canBeGuest(ctx) {
|
|
34566
34612
|
const { env } = await currentEnv(ctx);
|
|
34567
|
-
|
|
34613
|
+
const entry = await readEntry(ctx.home, env);
|
|
34614
|
+
return !holdsAccount(entry) && !isClaimedGuest(entry);
|
|
34568
34615
|
}
|
|
34569
34616
|
async function guestCanvasItem(ctx, session) {
|
|
34570
34617
|
const { guest: guest2 } = session;
|
|
@@ -34596,7 +34643,7 @@ async function guestCanvasItem(ctx, session) {
|
|
|
34596
34643
|
}
|
|
34597
34644
|
return (await list2(read2.projectId)).find((i) => i.id === canvasId) ?? null;
|
|
34598
34645
|
} catch (error2) {
|
|
34599
|
-
if (error2 instanceof CliError &&
|
|
34646
|
+
if (error2 instanceof CliError && error2.code === "SIGNIN_GUEST_EXPIRED") return null;
|
|
34600
34647
|
throw error2;
|
|
34601
34648
|
}
|
|
34602
34649
|
}
|
|
@@ -34616,6 +34663,9 @@ async function guestHome(ctx, session, ticketFor, hosted) {
|
|
|
34616
34663
|
const { projectId } = await resolveCheckout(ctx.cwd, { platform: ctx.platform, home: ctx.home });
|
|
34617
34664
|
return answer({ status: "guest_home", guestCanvas, hosted, ...minted ?? {}, project: projectId });
|
|
34618
34665
|
} catch (error2) {
|
|
34666
|
+
if (error2 instanceof CliError && error2.code === "SIGNIN_GUEST_CLAIMED") {
|
|
34667
|
+
return answer({ status: "not_signed_in", error: { code: error2.code, message: error2.message }, hosted });
|
|
34668
|
+
}
|
|
34619
34669
|
if (error2 instanceof CliError && isGuestGone(error2.code)) {
|
|
34620
34670
|
return answer({ status: "guest_home", guestCanvas: null, hosted });
|
|
34621
34671
|
}
|
|
@@ -34698,6 +34748,7 @@ function createSessionTool(ctx, { login: runner }) {
|
|
|
34698
34748
|
}
|
|
34699
34749
|
if (session.kind === "key" && session.guest && (!ref || ref.canvasId === await guestCanvasOf(ctx, session))) {
|
|
34700
34750
|
const { guest: guest2 } = session;
|
|
34751
|
+
if (isMarkedClaimed(guest2)) return answer({ status: "claim_pending", ...ids, hosted: hosts.web });
|
|
34701
34752
|
if (guest2.claimOrgs?.length) {
|
|
34702
34753
|
return answer({ status: "needs_org", ...ids, orgs: guest2.claimOrgs, hosted: hosts.web });
|
|
34703
34754
|
}
|
|
@@ -34752,6 +34803,7 @@ async function guestCanvasOf(ctx, session) {
|
|
|
34752
34803
|
const guest2 = session.guest;
|
|
34753
34804
|
if (!guest2) return null;
|
|
34754
34805
|
if (guest2.canvasId) return guest2.canvasId;
|
|
34806
|
+
if (isMarkedClaimed(guest2)) return null;
|
|
34755
34807
|
const { projectId } = await resolveCheckout(ctx.cwd, { platform: ctx.platform, home: ctx.home });
|
|
34756
34808
|
const res = await session.api.call({
|
|
34757
34809
|
method: "GET",
|
|
@@ -35486,7 +35538,7 @@ var init_cards = __esm({
|
|
|
35486
35538
|
signInTool = (resourceUri) => ({
|
|
35487
35539
|
name: SIGN_IN_CARD_TOOL,
|
|
35488
35540
|
title: "Kombai",
|
|
35489
|
-
description: "Show Kombai's sign-in card in this chat for a guest (kombai whoami printed status guest, or claim pending), or for a machine with neither a guest nor an account (reason start). Call it with the reason instead of offering kombai login in text: start when kombai whoami exits 3 (CLI_NOT_SIGNED_IN), in place of asking whether to sign in or try Kombai without an account; canvas_full for DESIGN_GUEST_LIMIT with no canvasId in details; second_canvas for DESIGN_GUEST_LIMIT with one (still use that canvas); taste when taste is refused or asked for; assets when AI image or video generation is refused or asked for; repo_images for CLI_SIGNIN_REQUIRED with images in details; account for any other CLI_SIGNIN_REQUIRED or DESIGN_SIGNIN_REQUIRED; ending once per conversation when whoami's expires is within 7 days. Then end your turn, except after ending, a reminder, where you carry on with the request. The user signs in from the card; never run kombai login for them unless they ask in the chat,
|
|
35541
|
+
description: "Show Kombai's sign-in card in this chat for a guest (kombai whoami printed status guest, or claim pending), or for a machine with neither a guest nor an account (reason start). Call it with the reason instead of offering kombai login in text: start when kombai whoami exits 3 (CLI_NOT_SIGNED_IN; not for reason guest_claimed, which signs in at once as `kombai skill sign-in` says), in place of asking whether to sign in or try Kombai without an account; canvas_full for DESIGN_GUEST_LIMIT with no canvasId in details; second_canvas for DESIGN_GUEST_LIMIT with one (still use that canvas); taste when taste is refused or asked for; assets when AI image or video generation is refused or asked for; repo_images for CLI_SIGNIN_REQUIRED with images in details; account for any other CLI_SIGNIN_REQUIRED or DESIGN_SIGNIN_REQUIRED; ending once per conversation when whoami's expires is within 7 days. Then end your turn, except after ending, a reminder, where you carry on with the request. The user signs in from the card; never run kombai login for them unless they ask in the chat, or a command answered SIGNIN_GUEST_CLAIMED or reason guest_claimed \u2014 then sign in as `kombai skill sign-in` says: with a browser panel the user can see, `kombai login --no-browser`, its url opened in that panel. When they say they have signed in, run kombai whoami.",
|
|
35490
35542
|
inputSchema: {
|
|
35491
35543
|
type: "object",
|
|
35492
35544
|
properties: { reason: { type: "string", enum: Object.values(SignInReason) } },
|
|
@@ -36479,7 +36531,7 @@ var init_server3 = __esm({
|
|
|
36479
36531
|
var actions_default;
|
|
36480
36532
|
var init_actions = __esm({
|
|
36481
36533
|
"src/skill/actions.md"() {
|
|
36482
|
-
actions_default = '# Requests from the canvas\n\nThe user can ask for work from the hosted canvas: the page copies a message for them to paste into this\nchat, or, in the Kombai view beside the chat, puts it in the message box (an Add to context becomes a\ncontext item instead). Each request is one sentence, then a link on its own line (Add to context\'s is\none line with no sentence, below):\n\n On my Kombai canvas "Checkout redesign", make 3 variants of "Variant A" with improved styles.\n https://agent.kombai.com/c/cnv_8f2a1b9c3d7e?node=nd_31a\n\nThe link names the canvas (after /c/) and the design (?node=). One message can hold several requests,\nsplit by blank lines; do each. The user may add their own words; they win where they differ.\n\nFor a whole-canvas request, use `kombai canvas pull --canvas <link>` and follow the user\'s request.\nFor a node request, use `kombai node pull --canvas <link> --node <node>`; if you will change that design,\nrun `kombai node lock --canvas <link> --node <node>` before the pull. Read the HTML file it prints,\nand look at its thumbnail with `kombai screenshot wait --canvas <link> --node <node> --tiles`. An element\nnamed with data-kid="<id>" is the element with that attribute in the HTML.\n\nBefore writing or changing design HTML, read `kombai skill html`. When the request needs taste, read\n`kombai skill brief` first. A request from the canvas (copied from its page, or put in the message box by the\nKombai view) comes from a canvas the user has open: don\'t show the canvas again. A canvas the user only named:\nshow it once, as `kombai skill opening` says.\n\nThen do what the sentence asks:\n\n- **make 3 variants of "<label>"**, maybe with a direction (improved styles, structure, interactions or\n responsiveness, or "that improve the design") and a style in parentheses. Make 3 new designs with\n `kombai node start --canvas <id> --label "<label>" --parent <node>`, each a clear take on that\n direction and different from the others, keeping the content. Run taste first only when the request\n wants new ideas rather than a change of the same design.\n- **make a [dark mode] [mobile | tablet | laptop | custom-width] version of "<label>"**, maybe with a\n width and the user\'s instructions after a colon. One new design with --parent <node> and the content\n kept. Add `--viewport mobile` (390 px), `--viewport tablet` (768 px) or `--viewport desktop` (laptop,\n 1280 px) to node start. For a custom width, give the node its width before its first push, so the\n thumbnail is rendered once, at that width; a later width change drops it until the next\n `kombai screenshot fill`. After node start, set the node\'s rect w in canvas.json to that width and\n run `kombai canvas push --canvas <id>`, then write the HTML and push it. Dark mode: the same design\n in a dark palette. No taste: reflow, don\'t redesign.\n- **regenerate "<label>"**: write a fresh, better version of the same concept into the pulled file and\n push it to the same node. **with the "<name>" design system**: find its slug in `kombai ds list`, pull\n it (`kombai skill design-system`) and use its tokens.\n- **in "<label>", change the <element>: <what to do>**: edit only that element in the pulled file and\n push. Leave the rest of the design as it is.\n- **build "<label>" in this project**, or **build the <element> of "<label>"**: write it as code in this\n repo, in the repo\'s framework, components and styles, using the pulled HTML and the thumbnail as the\n reference. This changes the repo, not the canvas.\n- **"<label>" <link>**, **The <element> in "<label>" <link>** or **The canvas "<name>" <link>**: one line\n with no sentence (Add to context; in the Kombai view beside the chat it arrives as a context item titled\n with the name). Context for the user\'s own words in the same message. Use the pulled node or canvas and\n do what they ask; if they asked nothing, describe it and ask what they want.\n- **refer design system: <name>**: one line with no link (Add to context in the Design systems panel).\n Context for the user\'s own words in the same message: `kombai skill design-system` says how to find\n and pull it by name.\n\nA lock lasts 10 minutes: run node lock again for a longer edit
|
|
36534
|
+
actions_default = '# Requests from the canvas\n\nThe user can ask for work from the hosted canvas: the page copies a message for them to paste into this\nchat, or, in the Kombai view beside the chat, puts it in the message box (an Add to context becomes a\ncontext item instead). Each request is one sentence, then a link on its own line (Add to context\'s is\none line with no sentence, below):\n\n On my Kombai canvas "Checkout redesign", make 3 variants of "Variant A" with improved styles.\n https://agent.kombai.com/c/cnv_8f2a1b9c3d7e?node=nd_31a\n\nThe link names the canvas (after /c/) and the design (?node=). One message can hold several requests,\nsplit by blank lines; do each. The user may add their own words; they win where they differ.\n\nFor a whole-canvas request, use `kombai canvas pull --canvas <link>` and follow the user\'s request.\nFor a node request, use `kombai node pull --canvas <link> --node <node>`; if you will change that design,\nrun `kombai node lock --canvas <link> --node <node>` before the pull. Read the HTML file it prints,\nand look at its thumbnail with `kombai screenshot wait --canvas <link> --node <node> --tiles`. An element\nnamed with data-kid="<id>" is the element with that attribute in the HTML.\n\nBefore writing or changing design HTML, read `kombai skill html`. When the request needs taste, read\n`kombai skill brief` first. A request from the canvas (copied from its page, or put in the message box by the\nKombai view) comes from a canvas the user has open: don\'t show the canvas again. A canvas the user only named:\nshow it once, as `kombai skill opening` says.\n\nThen do what the sentence asks:\n\n- **make 3 variants of "<label>"**, maybe with a direction (improved styles, structure, interactions or\n responsiveness, or "that improve the design") and a style in parentheses. Make 3 new designs with\n `kombai node start --canvas <id> --label "<label>" --parent <node>`, each a clear take on that\n direction and different from the others, keeping the content. Run taste first only when the request\n wants new ideas rather than a change of the same design.\n- **make a [dark mode] [mobile | tablet | laptop | custom-width] version of "<label>"**, maybe with a\n width and the user\'s instructions after a colon. One new design with --parent <node> and the content\n kept. Add `--viewport mobile` (390 px), `--viewport tablet` (768 px) or `--viewport desktop` (laptop,\n 1280 px) to node start. For a custom width, give the node its width before its first push, so the\n thumbnail is rendered once, at that width; a later width change drops it until the next\n `kombai screenshot fill`. After node start, set the node\'s rect w in canvas.json to that width and\n run `kombai canvas push --canvas <id>`, then write the HTML and push it. Dark mode: the same design\n in a dark palette. No taste: reflow, don\'t redesign.\n- **regenerate "<label>"**: write a fresh, better version of the same concept into the pulled file and\n push it to the same node. **with the "<name>" design system**: find its slug in `kombai ds list`, pull\n it (`kombai skill design-system`) and use its tokens.\n- **in "<label>", change the <element>: <what to do>**: edit only that element in the pulled file and\n push. Leave the rest of the design as it is.\n- **build "<label>" in this project**, or **build the <element> of "<label>"**: write it as code in this\n repo, in the repo\'s framework, components and styles, using the pulled HTML and the thumbnail as the\n reference. This changes the repo, not the canvas.\n- **"<label>" <link>**, **The <element> in "<label>" <link>** or **The canvas "<name>" <link>**: one line\n with no sentence (Add to context; in the Kombai view beside the chat it arrives as a context item titled\n with the name). Context for the user\'s own words in the same message. Use the pulled node or canvas and\n do what they ask; if they asked nothing, describe it and ask what they want.\n- **refer design system: <name>**: one line with no link (Add to context in the Design systems panel).\n Context for the user\'s own words in the same message: `kombai skill design-system` says how to find\n and pull it by name.\n\nA lock lasts 10 minutes: run node lock again for a longer edit (the push ends it). The fixes after a push\n("Check a finished design" in the overview) take no lock. If you stop without pushing, or drop your edit\nwith node pull --discard, run `kombai node unlock --canvas <link> --node <node>`. If node lock fails, go on\nwithout it; a drawing takes no lock.\n\nAfter a design\'s last HTML push, follow "Check a finished design" in the overview. When you are done,\ntell the user what changed; the canvas they have open shows it live.\n';
|
|
36483
36535
|
}
|
|
36484
36536
|
});
|
|
36485
36537
|
|
|
@@ -36567,7 +36619,7 @@ var init_opening = __esm({
|
|
|
36567
36619
|
var overview_default;
|
|
36568
36620
|
var init_overview = __esm({
|
|
36569
36621
|
"src/skill/overview.md"() {
|
|
36570
|
-
overview_default = '# Kombai design\n\nDesign UI on a hosted Kombai canvas; design systems need no canvas. `kombai <command> --help` gives its\nflags. Read each JSON result: next can be a command, a link or advice. Follow it after handling the error\nand any required user choice.\nSkill text and default help are plain text. Tell the user in one line before and after each step that\ntakes more than a few seconds.\n\n{{RUN}}\n\nRun `kombai` outside any sandbox from the first try: it needs network and writes ~/.kombai.\n\n{{APP}}\n\n## Choose the task\n\n- New design: follow New designs below.\n- Existing canvas or node (a link, "On my Kombai canvas" message, or a named canvas): read\n `kombai skill actions`, pull the target and follow that request. An edit needs no taste; variants\n seeking new ideas do. Neither needs a new canvas.\n- Design systems (.ds): read `kombai skill design-system`.\n- Shapes, pictures or layout: read `kombai skill drawings`.\n- AI images/video the user asks Kombai for: read `kombai skill assets`.\n- Questions about Kombai itself (account, credits, data, setup): read `kombai skill faq`.\n\nAt the start of each request, run `kombai whoami`. Unless it prints an email with no claim, read\n`kombai skill sign-in` and follow it. Read it before any `kombai login`.\n\n## New designs\n\n1. Read `kombai skill brief` and the repo before writing a brief outside the repo. The topic says\n when a reference or reflow skips taste.\n2. When taste is needed (never for a guest), tell the user their `kombai credits` balance first,\n then run `kombai taste start --brief <file> --variants <1-4>`, one per design. A run takes minutes:\n do step 3 meanwhile, then `kombai taste wait <run>`, again while its status is running. Follow\n directions.md. On TASTE_NO_CREDITS, call plans_card if among your tools, else show next\'s plan link; stop.\n3. Create a canvas: `kombai canvas create --name "<what it is>"`. Reuse one only when the user points\n to it or this conversation made it; `kombai canvas list` finds it by name (this repo\'s carry its\n `checkoutProjectId` as `projectId`). Ask if the target is unclear. On DESIGN_ORG_REQUIRED, ask which listed org, save `kombai config org <id>`, then retry.\n Read `kombai skill opening` and show the canvas once when creating or first using it.\n It starts private; share only when asked.\n4. Before writing HTML, read `kombai skill html`: it says how to build in passes. For each design,\n `kombai node start --canvas <id> --label "<label>"` (`--parent <node>` for a variant), then write\n and push it as that topic says.\n\n## Check a finished design\n\nAfter a design\'s last push, run the complete screenshot fill its next names in the background. Then run\n`kombai screenshot wait --canvas <id> --node <node> --tiles` and inspect each image it prints.\
|
|
36622
|
+
overview_default = '# Kombai design\n\nDesign UI on a hosted Kombai canvas; design systems need no canvas. `kombai <command> --help` gives its\nflags. Read each JSON result: next can be a command, a link or advice. Follow it after handling the error\nand any required user choice.\nSkill text and default help are plain text. Tell the user in one line before and after each step that\ntakes more than a few seconds.\n\n{{RUN}}\n\nRun `kombai` outside any sandbox from the first try: it needs network and writes ~/.kombai.\n\n{{APP}}\n\n## Choose the task\n\n- New design: follow New designs below.\n- Existing canvas or node (a link, "On my Kombai canvas" message, or a named canvas): read\n `kombai skill actions`, pull the target and follow that request. An edit needs no taste; variants\n seeking new ideas do. Neither needs a new canvas.\n- Design systems (.ds): read `kombai skill design-system`.\n- Shapes, pictures or layout: read `kombai skill drawings`.\n- AI images/video the user asks Kombai for: read `kombai skill assets`.\n- Questions about Kombai itself (account, credits, data, setup): read `kombai skill faq`.\n\nAt the start of each request, run `kombai whoami`. Unless it prints an email with no claim, read\n`kombai skill sign-in` and follow it. Read it before any `kombai login`.\n\n## New designs\n\n1. Read `kombai skill brief` and the repo before writing a brief outside the repo. The topic says\n when a reference or reflow skips taste.\n2. When taste is needed (never for a guest), tell the user their `kombai credits` balance first,\n then run `kombai taste start --brief <file> --variants <1-4>`, one per design. A run takes minutes:\n do step 3 meanwhile, then `kombai taste wait <run>`, again while its status is running. Follow\n directions.md. On TASTE_NO_CREDITS, call plans_card if among your tools, else show next\'s plan link; stop.\n3. Create a canvas: `kombai canvas create --name "<what it is>"`. Reuse one only when the user points\n to it or this conversation made it; `kombai canvas list` finds it by name (this repo\'s carry its\n `checkoutProjectId` as `projectId`). Ask if the target is unclear. On DESIGN_ORG_REQUIRED, ask which listed org, save `kombai config org <id>`, then retry.\n Read `kombai skill opening` and show the canvas once when creating or first using it.\n It starts private; share only when asked.\n4. Before writing HTML, read `kombai skill html`: it says how to build in passes. For each design,\n `kombai node start --canvas <id> --label "<label>"` (`--parent <node>` for a variant), then write\n and push it as that topic says.\n\n## Check a finished design\n\nAfter a design\'s last push, run the complete screenshot fill its next names in the background. Then run\n`kombai screenshot wait --canvas <id> --node <node> --tiles` and inspect each image it prints.\nFix and push again, no node lock, at most 3 rounds. On CLI_NO_BROWSER or CLI_LAUNCH_FAILED from fill,\nask before the roughly 100 MB download; then `kombai browser install --yes` and retry fill.\nIf wait reports CLI_NOTHING_RENDERING, run its suggested fill only if none is running; on\nCLI_SCREENSHOT_FAILED, inspect the failure reason before retrying.\n\n## Recover from errors\n\nExit 2 is not always a changed node.\nFor DESIGN_NODE_CHANGED on node push, merge the stored version at error.details.remote into your\nfile, then `kombai node push --canvas <id> --node <node> --merged`. Only to discard your edit, use\n`kombai node pull --canvas <id> --node <node> --discard`.\n\nRun commands that change a canvas\'s files (node start, node push, node pull, canvas pull, canvas push)\none at a time per canvas, and edit files only between them; screenshot fill and screenshot wait can run\nbeside them.\n\nExit codes: 0 done, 1 failed, 2 refused or conflict, 3 not signed in, 4 timed out. A wait timeout\ndoes not mean the work failed: follow its next; check a fill\'s result if no image arrives.\n';
|
|
36571
36623
|
}
|
|
36572
36624
|
});
|
|
36573
36625
|
|
|
@@ -36575,7 +36627,7 @@ var init_overview = __esm({
|
|
|
36575
36627
|
var sign_in_default;
|
|
36576
36628
|
var init_sign_in = __esm({
|
|
36577
36629
|
"src/skill/sign-in.md"() {
|
|
36578
|
-
sign_in_default = "# Signing in, or trying Kombai as a guest\n\nWhat `kombai whoami` printed decides. Where `sign_in_card` is among your tools (the Codex app lists it only in\nALL_TOOLS), it asks the sign-in questions below in your place (read The sign-in card at the end first); you still ask\nthe claim needs_org question yourself. The reasons below apply to any
|
|
36630
|
+
sign_in_default = "# Signing in, or trying Kombai as a guest\n\nWhat `kombai whoami` printed decides. Where `sign_in_card` is among your tools (the Codex app lists it only in\nALL_TOOLS), it asks the sign-in questions below in your place (read The sign-in card at the end first); you still ask\nthe claim needs_org question yourself, and reason guest_claimed signs in with no card. The reasons below apply to any\nexit-3 CLI_NOT_SIGNED_IN, not just whoami's:\n\n- Exit 3 with details.reason none: ask once, \"Kombai works best signed in. Sign in now, or try it without an account?\"\n Sign in: see Signing in. Try it: run `kombai guest`, then work as a guest (below).\n- Exit 3 with reason expired or signed_out: the user has an account. Offer sign-in only, never guest mode. With\n claim pending in details, signing in also moves the guest canvas into the account.\n- Exit 3 with reason guest_claimed: the user signed in on the canvas page, so the guest canvas is in their account\n now. Tell them so in one line and sign in now without asking (Signing in), even where `sign_in_card` is among your\n tools; show the match code. The signed-in line then has claimed. If that sign-in is not approved (it expires),\n ask once: sign in again, or start fresh with `kombai guest` (a new guest canvas; the old one stays in the account).\n- Any other or missing reason: offer sign-in only.\n- Exit 0 with status guest: the user already chose. Work as a guest without asking again.\n- An email with claim needs_org: ask which listed organization gets the guest canvas, then run\n `kombai claim --org <id>`. With claim pending, the next command finishes it.\n\n## Signing in\n\nBefore any `kombai login`, check whether you have a browser panel the user can see. That decides the command; run\nit in the background:\n\n1. You have a browser panel the user can see (the Codex app's in-app browser, the Claude desktop app's Browser pane,\n VS Code's Integrated Browser through `open_browser_page`): run `kombai login --no-browser`, show the matchCode\n from its first line, and open the url from that line in your panel. The user signs in and approves there. With\n such a panel, never run `kombai login` without --no-browser.\n2. No such panel: run `kombai login` and show the matchCode from its first line. The user approves on the page it\n opens in their browser, or, if they see none, at the url from that line.\n\nNever type into, click on or approve that page yourself: the approval is the user's check that the match code is\ntheirs. If they'd rather use their own browser, give them that url, for them alone: whoever approves it signs this\nCLI into their account. When the signed-in line has claimed, the guest canvas is now in the account, same link. When\nit has claim needs_org, ask as above.\n\n## As a guest\n\n- The whoami at the start of each request matters most here: the user may have signed in since, in another chat or\n on a card. When it no longer says guest, drop everything below.\n- Skip taste: no brief and no `kombai taste start`. Go straight to `kombai canvas create`. A guest has one canvas: when\n canvas create answers DESIGN_GUEST_LIMIT with a canvasId in details, use that canvas.\n- Use no repo images (/api/local/images/\u2026): CSS, inline SVG or public https images instead.\n- Make no AI-generated images or video (no `kombai asset generate`): public https images, CSS or SVG instead.\n- The canvas is the user's own. Show it to them as `kombai skill opening` says; don't suggest sending its link to anyone.\n- When whoami's expires is within 7 days, say once in this conversation that the guest canvas ends on that date and\n that signing in keeps it.\n- End each turn with one line saying what signing in unlocks:\n taste directions, AI images and video, repo images, design systems and sharing.\n\n## Refusals\n\n- DESIGN_SIGNIN_REQUIRED or CLI_SIGNIN_REQUIRED: tell the user in one line what signing in unlocks, and sign in\n (Signing in) only if they agree.\n- DESIGN_GUEST_LIMIT on any other command (node start, node push, screenshot fill): the guest canvas is full. Say so\n in one line, and that signing in keeps the canvas and lifts the limit; sign in only if they agree. Don't retry or\n work around it, and keep the unpushed files: push them again after sign-in.\n- SIGNIN_GUEST_RATE from `kombai guest`: this network has made too many guests today. Say so in one line, and offer\n sign-in only (Signing in); don't run `kombai guest` again today.\n- SIGNIN_GUEST_EXPIRED as an error from a guest's own command: say the guest canvas expired, and ask again: sign in,\n or start fresh with `kombai guest`.\n- SIGNIN_GUEST_EXPIRED as a warning on a signed-in line (an email is printed): say its message in one line (the old\n guest canvas expired and is gone, or had already moved into an account). Never offer `kombai guest`.\n- SIGNIN_GUEST_CLAIMED as an error from a guest's own command: the canvas moved into an account; do as the reason\n guest_claimed line says. As a warning on a signed-in line: nothing to do.\n- DESIGN_GUEST_CLAIMED as a warning on a signed-in line: another account has the guest canvas. Say so in one line\n and carry on in the signed-in account, on a new canvas.\n\n## The sign-in card\n\nWhere `sign_in_card` is among your tools, call it in place of the lines above (except reason guest_claimed, which\nsigns in at once), with the moment's reason, and end your\nturn; don't run or offer `kombai login` in text:\n\n- start: whoami exits 3 with any reason but guest_claimed, in place of asking whether to sign in or try it without\n an account. The user chooses on the card; when they say to carry on, run `kombai whoami` and go on as it says.\n- canvas_full: DESIGN_GUEST_LIMIT with no canvasId in details. second_canvas: with one (still use that canvas).\n- taste: taste refused or asked for. repo_images: CLI_SIGNIN_REQUIRED with images in details.\n- assets: `asset generate` or `asset wait` refused (CLI_SIGNIN_REQUIRED), or the user asks a guest for AI images\n or video.\n- account: any other DESIGN_SIGNIN_REQUIRED or CLI_SIGNIN_REQUIRED.\n- ending: once, when whoami's expires is within 7 days. It is a reminder, not a refusal: don't end your turn after\n it; carry on with the request.\n\nIf the user then asks you in the chat to sign them in, do it as Signing in says.\nWithout `sign_in_card`, use the lines above.\n";
|
|
36579
36631
|
}
|
|
36580
36632
|
});
|
|
36581
36633
|
|
|
@@ -37772,7 +37824,7 @@ var init_node = __esm({
|
|
|
37772
37824
|
};
|
|
37773
37825
|
nodeLock = {
|
|
37774
37826
|
name: "node lock",
|
|
37775
|
-
summary: "Mark a design as being edited, so the canvas shows it busy: run it before you pull and change a design already on the canvas
|
|
37827
|
+
summary: "Mark a design as being edited, so the canvas shows it busy: run it before you pull and change a design already on the canvas. The fixes after a push take none. A new design needs none: the canvas shows its placeholder busy. It lasts 10 minutes; run it again to keep it. node push ends it.",
|
|
37776
37828
|
flags: {
|
|
37777
37829
|
canvas: { type: "string", required: true, placeholder: "<id|link>", check: canvasRefProblem },
|
|
37778
37830
|
node: { type: "string", required: true, placeholder: "<id>", check: (value) => nodeIdProblem(value) }
|
package/dist/launch.mjs
CHANGED
|
@@ -7,7 +7,7 @@ import { dirname, join } from 'node:path';
|
|
|
7
7
|
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
8
|
|
|
9
9
|
// The version that wrote this file: a published one, so its npx line always works. Filled in by the build.
|
|
10
|
-
const WRITTEN_BY = '0.2.
|
|
10
|
+
const WRITTEN_BY = '0.2.2';
|
|
11
11
|
const root = dirname(fileURLToPath(import.meta.url));
|
|
12
12
|
|
|
13
13
|
// On stderr, as the CLI's own start-up errors are: under `kombai mcp` stdout carries MCP frames only.
|
|
@@ -2679,7 +2679,7 @@ body {
|
|
|
2679
2679
|
flex: none;
|
|
2680
2680
|
color: var(--primary, #48de94);
|
|
2681
2681
|
}
|
|
2682
|
-
`;function cv({items:e}){return(0,d0.jsx)(sY,{"aria-label":"Included with your account",children:e.map(t=>(0,d0.jsxs)("li",{children:[(0,d0.jsx)(un,{size:13,strokeWidth:2.5,"aria-hidden":!0}),t]},t))})}var st=E(Gt()),jO="chat_sign_in",iY="chat_guest",lY=20,QY=11*6e4,uv="Sign-in didn't finish.";var k5={state:"idle",matchCode:null,orgs:[],failure:uv,moved:null,besideChat:!1,openLink:null};function cY(e,t){switch(e.status){case"signing_in":return{...k5,state:"waiting",matchCode:e.match_code??t.matchCode,openLink:e.openLink??t.openLink};case"claimed":return{...k5,state:"claimed",moved:e.moved,besideChat:e.besideChat};case"needs_org":return{...k5,state:"needs_org",orgs:e.orgs};case"claim_pending":return{...k5,state:"pending"};case"signed_in":return{...k5,state:"signed_in"};case"guest":return{...k5,state:"guest"};case"failed":return{...k5,state:"failed",failure:e.error?.message??uv}}}function qO({data:e,host:t,subsystem:r,intro:a}){let[o,n]=(0,Ca.useState)(k5),[s,i]=(0,Ca.useState)(!1),l=(0,Ca.useRef)(!1),Q=(0,Ca.useRef)(0),c=(0,Ca.useRef)(!0);(0,Ca.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]);let u=p=>void t.openLink(p).catch(v=>S1(v,{tags:{subsystem:r}})),d=async(p,v=jO)=>{if(l.current)return;l.current=!0;let b=++Q.current,L=()=>c.current&&Q.current===b;i(!0);let S=p,_=k5,x=Date.now()+QY;try{for(;;){let C=kO(await t.callTool(v,S));if(!L())return;if(C.status==="signing_in"&&Date.now()>=x){n({...k5,state:"failed"});return}if(_=cY(C,_),n(_),C.status==="signing_in"&&C.openNow&&_.openLink&&u(_.openLink),C.status!=="signing_in")return;S={wait:lY}}}catch(C){S1(C,{tags:{subsystem:r}}),L()&&n({...k5,state:"failed",failure:C instanceof Error&&C.message?C.message:uv})}finally{Q.current===b&&(l.current=!1,c.current&&i(!1))}},f=()=>{Q.current++,l.current=!1,i(!1),n(k5)},g=()=>o.openLink?u(o.openLink):void t.callTool(jO,{reopen:!0}).catch(p=>S1(p,{tags:{subsystem:r}})),h=e.reason==="start"&&e.guest,y=(p,v=!0)=>(0,st.jsxs)(V6,{children:[v&&(0,st.jsx)(l9,{children:FO(e.appBrowser)}),h&&(0,st.jsx)(dn,{type:"button",$look:"outline",disabled:s,onClick:()=>void d({},iY),children:ZO}),(0,st.jsx)(dn,{type:"button",disabled:s,onClick:()=>void d({wait:0}),children:p})]}),m=a??PO(e);switch(o.state){case"idle":return(0,st.jsx)(Sa,{guest:e.reason!=="start",title:m.title,body:m.body,children:y("Sign in")});case"waiting":{let p=BO(e.appBrowser);return(0,st.jsxs)(Sa,{title:p.title,body:p.body,children:[(0,st.jsx)($O,{matchCode:o.matchCode,status:d9.status}),(0,st.jsxs)(V6,{children:[(0,st.jsx)(dn,{type:"button",$look:"plain",onClick:f,children:d9.cancel}),(0,st.jsx)(dn,{type:"button",$look:"outline",onClick:g,children:d9.reopen})]})]})}case"claimed":{let{moved:p,besideChat:v}=o,b=v?null:p?.url;return(0,st.jsxs)(Sa,{guest:!1,done:!0,title:E4.title,body:E4.body,children:[p?.name?(0,st.jsx)(zO,{name:p.name,detail:UO(p.designs)}):(0,st.jsx)(cv,{items:iv}),(0,st.jsxs)(V6,{children:[(0,st.jsx)(l9,{children:v?E4.besideChat:E4.next}),b&&(0,st.jsx)(dn,{type:"button",$look:"outline",onClick:()=>u(b),children:E4.open})]})]})}case"needs_org":return(0,st.jsx)(Sa,{title:Qv.title,body:Qv.body,children:(0,st.jsx)(GO,{children:o.orgs.map(p=>(0,st.jsx)(LO,{disabled:s,onClick:()=>void d({claimOrg:p.id}),children:p.name},p.id))})});case"pending":return(0,st.jsx)(Sa,{guest:!1,title:lv.title,body:lv.body,children:y("Try again",!1)});case"guest":return(0,st.jsx)(Sa,{done:!0,title:f9.title,body:f9.body,children:(0,st.jsxs)(V6,{children:[(0,st.jsx)(l9,{children:f9.next}),(0,st.jsx)(dn,{type:"button",$look:"outline",disabled:s,onClick:()=>void d({wait:0}),children:"Sign in"})]})});case"signed_in":return(0,st.jsx)(Sa,{guest:!1,done:!0,title:sv.title,body:sv.body,children:(0,st.jsx)(cv,{items:iv})});case"failed":return(0,st.jsxs)(Sa,{title:m.title,body:m.body,children:[(0,st.jsx)(_O,{children:o.failure}),y("Sign in")]})}}function uY(e){let t=e.structuredContent;return e.isError!==!0&&u0(t)&&Array.isArray(t.briefs)?{run_id:typeof t.run_id=="string"?t.run_id:"",thread_name:typeof t.thread_name=="string"?t.thread_name:null,briefs:t.briefs.filter(r=>typeof r=="string"&&r.length>0)}:EO(e)||"Kombai sent no taste brief."}function WO(e,t){return RO({name:"kombai-design-taste",version:e,subsystem:"mcp-design-taste"},{onTheme:t.onTheme,onFailure:t.onFailure,onToolResult:r=>{let a=DO(r);if(a){t.onSignIn(a);return}let o=uY(r);typeof o=="string"?t.onFailure(o):t.onData(o)}})}var bk=E(H());var fn={primary:16};var dY={LAUNCH_FAILED:"launch_failed",PAGE_LOAD_FAILED:"page_load_failed",DETECTION_FAILED:"detection_failed",OPEN_PAGE_IN_CONTEXT_FAILED:"open_page_in_context_failed",EXTENSION_LOAD_FAILED:"extension_load_failed",CONTEXT_CREATION_FAILED:"context_creation_failed",PROXY_SETUP_FAILED:"proxy_setup_failed",NAMESPACE_INJECTION_FAILED:"namespace_injection_failed",PAGE_NAVIGATION_FAILED:"page_navigation_failed",CONNECTION_FAILED:"connection_failed",APP_INITIALIZATION_FAILED:"app_initialization_failed",API_INJECTION_FAILED:"api_injection_failed",API_VALIDATION_FAILED:"api_validation_failed",PAGE_META_INJECTION_FAILED:"page_meta_injection_failed",IFRAME_LOAD_FAILED:"iframe_load_failed",IFRAME_DISPOSAL_FAILED:"iframe_disposal_failed",IFRAME_REMOVAL_FAILED:"iframe_removal_failed",HEALTH_CHECK_FAILED:"health_check_failed",SCRIPT_EXECUTION_FAILED:"script_execution_failed",SCRIPT_TIMEOUT:"script_timeout",FILE_READ_FAILED:"file_read_failed",DIRECTORY_FOUND_KOMBAI_TEMP_DIR:"directory_found_kombai_temp_dir",DIRECTORY_DELETE_FAILED:"directory_delete_failed",IMAGE_LIMIT_EXCEEDED:"image_limit_exceeded",TEXT_LENGTH_LIMIT_EXCEEDED:"text_length_limit_exceeded",BINARY_FILE_FOUND_IN_TEMP_DIR:"binary_file_found_in_temp_dir",PAGE_METADATA_FETCH_ERROR:"page_metadata_fetch_error",VALIDATION_FAILED:"validation_failed",DEBUGGING_PORT_READ_FAILED:"debugging_port_read_failed",DEBUGGING_PORT_PARSE_FAILED:"debugging_port_parse_failed",RAW_BROWSER_NOT_FOUND:"raw_browser_not_found",PROXY_NOT_INSTALLED:"proxy_not_installed",USER_DATA_DIR_LOCKED:"user_data_dir_locked",BROWSER_NOT_LAUNCHED:"browser_not_launched",WINDOW_ID_FETCH_FAILED:"window_id_fetch_failed",PAGE_ID_FETCH_FAILED:"page_id_fetch_failed",INVALID_PAGE_URL:"invalid_page_url",RESOURCE_FILE_URL_NOT_SUPPORTED:"resource_file_url_not_supported",RXJS_INJECTION_FAILED:"rxjs_injection_failed",BROWSER_AUDIT_FAILED:"browser_audit_failed",EXTENSION_APP_NOT_INITIALIZED:"extension_app_not_initialized",PAGE_NOT_FOUND:"page_not_found",PAGE_INITIALIZATION_FAILED:"page_initialization_failed",PAGE_REFRESH_SETUP_FAILED:"page_refresh_setup_failed",NEW_PAGE_SETUP_FAILED:"new_page_setup_failed",PAGE_DISPOSE_FAILED:"page_dispose_failed",SERVICES_RESET_FAILED:"services_reset_failed"},fY={SYNC_FAILED:"sync_failed"},pY={PAGE_CLOSED:"page_closed",PAGE_DETACHED:"page_detached",NAVIGATION_INTERRUPTED:"navigation_interrupted",DOM_NOT_AVAILABLE:"dom_not_available"},mY={NOT_INITIALIZED:"not_initialized",TIMEOUT:"timeout",OPERATION_FAILED:"operation_failed",INJECTION_FAILED:"injection_failed",CHANNEL_NOT_READY:"channel_not_ready",VALIDATION_FAILED:"validation_failed",FIBER_NODE_NOT_FOUND:"fiber_node_not_found",RESOURCE_NOT_FOUND:"resource_not_found",NODE_ID_NOT_FOUND_FOR_SELECTOR:"node_id_not_found_for_selector",CDP_SESSION_FAILED_TO_CREATE:"cdp_session_failed_to_create",CDP_SESSION_ERROR:"cdp_session_error",PAGE_API_NOT_AVAILABLE:"page_api_not_available"},gY={PAGE_OPEN_FAILED:"page_open_failed",PAGE_REOPEN_FAILED:"page_reopen_failed",PAGE_CLOSE_FAILED:"page_close_failed",PAGE_REFRESH_FAILED:"page_refresh_failed",PAGE_FOCUS_FAILED:"page_focus_failed",PAGE_NOT_FOUND:"page_not_found",APP_NOT_FOUND:"app_not_found",BROWSER_CLOSE_FAILED:"browser_close_failed",INITIALIZATION_FAILED:"initialization_failed",SUBSCRIPTION_SETUP_FAILED:"subscription_setup_failed",SUBSCRIPTION_CLEANUP_FAILED:"subscription_cleanup_failed",DOM_SERVICES_NOT_INITIALIZED:"dom_services_not_initialized",SNAPSHOT_CACHE_UPDATE_FAILED:"snapshot_cache_update_failed",SNAPSHOT_CACHE_PURGE_FAILED:"snapshot_cache_purge_failed",SNAPSHOT_CACHE_NOT_FOUND:"snapshot_cache_not_found",SNAPSHOT_NOT_FOUND_IN_CACHE:"snapshot_not_found_in_cache",SCREENSHOT_READ_FAILED:"screenshot_read_failed",SCREENSHOT_DIRECTORY_EMPTY_FAILED:"screenshot_directory_empty_failed",DATA_PROCESSING_FAILED:"data_processing_failed",CHAT_INTEGRATION_FAILED:"chat_integration_failed",CONTEXT_STATE_SYNC_FAILED:"context_state_sync_failed",SEND_TO_CHAT_FAILED:"send_to_chat_failed",CHANNEL_COMMUNICATION_INITIALIZATION_FAILED:"channel_communication_initialization_failed"},hY={BROWSER_OPEN_ERROR:"BROWSER_OPEN_ERROR",BROWSER_CLOSE_ERROR:"BROWSER_CLOSE_ERROR",BROWSER_EXECUTE_ERROR:"BROWSER_EXECUTE_ERROR",BROWSER_OPEN_FAILED_REASON_NOT_PROVIDED:"BROWSER_OPEN_FAILED_REASON_NOT_PROVIDED",BROWSER_NOT_FOUND:"BROWSER_NOT_FOUND",INVALID_BROWSER_TYPE:"INVALID_BROWSER_TYPE",INVALID_URL:"INVALID_URL",INVALID_CODE:"INVALID_CODE",INVALID_DESCRIPTION:"INVALID_DESCRIPTION",INVALID_PAGE_ID:"INVALID_PAGE_ID",INVALID_ACTION_TYPE:"INVALID_ACTION_TYPE"},vY={AGENT_PAGE_OPEN_FAILED:"agent_page_open_failed",AGENT_PAGE_CLOSE_FAILED:"agent_page_close_failed",AGENT_BANNER_INJECTION_FAILED:"agent_banner_injection_failed",AGENT_BROWSER_AUDIT_FAILED:"agent_browser_audit_failed"},yY={NOT_INITIALIZED:"session_not_initialized",INITIALIZATION_FAILED:"session_initialization_failed",HANDLER_NOT_REGISTERED:"session_handler_not_registered",SNAPSHOT_FAILED:"session_snapshot_failed"},bY={SOCKET_SERVER_START_FAILED:"socket_server_start_failed",SOCKET_SERVER_STOP_FAILED:"socket_server_stop_failed",SOCKET_SERVER_NOT_INITIALIZED:"socket_server_not_initialized",SOCKET_CHANNEL_EMIT_FAILED:"socket_channel_emit_failed",SOCKET_CHANNEL_NOT_FOUND:"socket_channel_not_found",SOCKET_CLIENT_CONNECTION_FAILED:"socket_client_connection_failed",SOCKET_CLIENT_UPDATE_REJECTED:"socket_client_update_rejected"},_Y={SERVER_START_FAILED:"server_start_failed",SERVER_STOP_FAILED:"server_stop_failed",SERVER_RESTART_FAILED:"server_restart_failed",SERVER_DISPOSAL_FAILED:"server_disposal_failed",PORT_ALLOCATION_FAILED:"port_allocation_failed",PORT_NOT_AVAILABLE:"port_not_available",DIRECTORY_CREATION_FAILED:"directory_creation_failed",DIRECTORY_VALIDATION_FAILED:"directory_validation_failed",FILE_READ_FAILED:"file_read_failed",FILE_SERVE_FAILED:"file_serve_failed",VIRTUAL_FILE_GENERATION_FAILED:"virtual_file_generation_failed",VIRTUAL_FILE_REGISTRATION_FAILED:"virtual_file_registration_failed",REQUEST_HANDLER_FAILED:"request_handler_failed",INVALID_REQUEST_PATH:"invalid_request_path",INVALID_STATE_TRANSITION:"invalid_state_transition",SERVER_ALREADY_DISPOSED:"server_already_disposed"},KO={...fY,...pY,...mY,...gY,...vY,...hY,...dY,..._Y,...bY,...yY};var R4={UNAUTHORIZED:"UNAUTHORIZED",FORBIDDEN_WAF:"FORBIDDEN_WAF",FORBIDDEN_CORS:"FORBIDDEN_CORS",AUTH_FAILED:"AUTH_FAILED",INTERNAL_SERVER_ERROR:"INTERNAL_SERVER_ERROR",DESIGN_LIBRARY_FETCH_ERROR:"DESIGN_LIBRARY_FETCH_ERROR",UNHANDLED_ERROR:"UNHANDLED_ERROR",BAD_REQUEST:"BAD_REQUEST",UI_NETWORK_ERROR:"UI_NETWORK_ERROR",THREAD_NOT_FOUND:"THREAD_NOT_FOUND",LOGOUT_CLEANUP_VALIDATION_ERROR:"LOGOUT_CLEANUP_VALIDATION_ERROR",LOGOUT_ERROR:"LOGOUT_ERROR",CODE_VERIFICATION_ERROR:"CODE_VERIFICATION_ERROR",LOGIN_CALLBACK_ERROR:"LOGIN_CALLBACK_ERROR",OAUTH_CALLBACK_ERROR:"OAUTH_CALLBACK_ERROR",SECURE_STORAGE_UNAVAILABLE:"SECURE_STORAGE_UNAVAILABLE",USER_RULES_VALIDATION_ERROR:"USER_RULES_VALIDATION_ERROR",CODEGEN_VALIDATION_ERROR:"CODEGEN_VALIDATION_ERROR",NEW_USER_RULES_VALIDATION_ERROR:"NEW_USER_RULES_VALIDATION_ERROR",STREAMING_VALIDATION_ERROR:"STREAMING_VALIDATION_ERROR",UNSUPPORTED_WS_VALIDATION_ERROR:"UNSUPPORTED_WS_VALIDATION_ERROR",PREVIEW_ERROR_VALIDATION_ERROR:"PREVIEW_ERROR_VALIDATION_ERROR",RESOLVE_INPUT_VALIDATION_ERROR:"RESOLVE_INPUT_VALIDATION_ERROR",FIX_CODE_VALIDATION_ERROR:"FIX_CODE_VALIDATION_ERROR",SKIP_VALIDATION_ERROR:"SKIP_VALIDATION_ERROR",WORKING_SET_VALIDATION_ERROR:"WORKING_SET_VALIDATION_ERROR",INVALID_MESSAGE_VALIDATION_ERROR:"INVALID_MESSAGE_VALIDATION_ERROR",CODEGEN_ALREADY_IN_PROGRESS_ERROR:"CODEGEN_ALREADY_IN_PROGRESS_ERROR",INVALID_FIGMA_VALIDATION_ERROR:"INVALID_FIGMA_VALIDATION_ERROR",INVALID_SOCKET_RESPONSE_ERROR:"INVALID_SOCKET_RESPONSE_ERROR",MISSING_EDITOR_CONTENT_VALIDATION_ERROR:"MISSING_EDITOR_CONTENT_VALIDATION_ERROR",FIGMA_CONNECT_MESSAGE_VALIDATION_ERROR:"FIGMA_CONNECT_MESSAGE_VALIDATION_ERROR",UI_ERROR:"UI_ERROR",LOADER_LEFT_OPEN:"LOADER_LEFT_OPEN",WEBVIEW_REQUEST_TIMEOUT:"WEBVIEW_REQUEST_TIMEOUT",WEBVIEW_REQUEST_ABORTED:"WEBVIEW_REQUEST_ABORTED",CORE_UNAVAILABLE:"CORE_UNAVAILABLE",EDITOR_SURFACE_MISSING:"EDITOR_SURFACE_MISSING",PROJECT_REQUIRED:"PROJECT_REQUIRED",CODEX_FAILED:"CODEX_FAILED",CODEX_CONTINUABLE:"CODEX_CONTINUABLE",CLAUDE_CODE_FAILED:"CLAUDE_CODE_FAILED",CLAUDE_CODE_CONTINUABLE:"CLAUDE_CODE_CONTINUABLE",CODEX_PLAN_LIMIT:"CODEX_PLAN_LIMIT",CLAUDE_CODE_PLAN_LIMIT:"CLAUDE_CODE_PLAN_LIMIT",CODEX_AUTH_FAILED:"CODEX_AUTH_FAILED",CODEX_NOT_INSTALLED:"CODEX_NOT_INSTALLED",CLAUDE_CODE_NOT_INSTALLED:"CLAUDE_CODE_NOT_INSTALLED",CODEX_SESSION_BUSY:"CODEX_SESSION_BUSY",CLAUDE_CODE_AT_CAPACITY:"CLAUDE_CODE_AT_CAPACITY",AGENT_WORKSPACE_MISSING:"AGENT_WORKSPACE_MISSING",THREAD_SESSION_MISMATCH:"THREAD_SESSION_MISMATCH",SEND_DISPATCH_FAILED:"SEND_DISPATCH_FAILED",SOCKET_TIMEOUT:"SOCKET_TIMEOUT",SOCKET_CONNECTION_ERROR:"SOCKET_CONNECTION_ERROR",GLOBAL_STORE_ERROR:"GLOBAL_STORE_ERROR",THREAD_LEASE_LOST:"THREAD_LEASE_LOST",SOCKET_SEND_ERROR:"SOCKET_SEND_ERROR",SOCKET_SEND_ERROR_CALLBACK:"SOCKET_SEND_ERROR_CALLBACK2",UNHANDLED_SOCKET_ERROR:"UNHANDLED_SOCKET_ERROR",SOCKET_REJECTING_WAITING_REQUEST:"SOCKET_REJECTING_WAITING_REQUEST",SOCKET_MAX_RETRIES:"SOCKET_MAX_RETRIES",SOCKET_INITIALIZATION_ERROR:"SOCKET_INITIALIZATION_ERROR",SOCKET_SEND_BLOCKING_TOOL_REPLY_ERROR:"SOCKET_SEND_BLOCKING_TOOL_REPLY_ERROR",SOCKET_FRAME_DROPPED:"SOCKET_FRAME_DROPPED",FORCE_UPDATE_ERROR:"FORCE_UPDATE_ERROR",FIGMA_API_ERROR:"FIGMA_API_ERROR",FIGMA_CONNECT_ERROR:"FIGMA_CONNECT_ERROR",FIGMA_TOKEN_NOT_FOUND:"FIGMA_TOKEN_NOT_FOUND",REPLACE_FILE_CONTENT_ERROR:"REPLACE_FILE_CONTENT_ERROR",SETUP_DIFF_DIRECTORY_ERROR:"SETUP_DIFF_DIRECTORY_ERROR",CLEAN_UP_DIFF_ERROR:"CLEAN_UP_DIFF_ERROR",WRITE_DIFF_FILE_ERROR:"WRITE_DIFF_FILE_ERROR",GET_ENCLOSING_SYMBOL_ERROR:"GET_ENCLOSING_SYMBOL_ERROR",GET_REFERENCES_ERROR:"GET_REFERENCES_ERROR",WORKSPACE_NOT_FOUND:"WORKSPACE_NOT_FOUND",WALK_DIR_ERROR:"WALK_DIR_ERROR",FILE_NOT_FOUND:"FILE_NOT_FOUND",TS_CONFIG_PARSING_FAILED:"TS_CONFIG_PARSING_FAILED",FILE_NOT_SUPPORTED_FOR_REFERENCES:"FILE_NOT_SUPPORTED_FOR_REFERENCES",WRITE_FILE_ERROR:"WRITE_FILE_ERROR",FILE_REFERENCE_ERROR:"FILE_REFERENCE_ERROR",READ_RANGE_ERROR:"READ_RANGE_ERROR",S3_FETCH_ERROR:"S3_FETCH_ERROR",S3_PUT_ERROR:"S3_PUT_ERROR",IMAGE_LOST:"IMAGE_LOST",IMAGE_STORE_WRITE_ERROR:"IMAGE_STORE_WRITE_ERROR",IMAGE_STORE_READ_ERROR:"IMAGE_STORE_READ_ERROR",IMAGE_STORE_FALLBACK_ENGAGED:"IMAGE_STORE_FALLBACK_ENGAGED",FIGMA_SNAPSHOT_UNAVAILABLE:"FIGMA_SNAPSHOT_UNAVAILABLE",FIGMA_SNAPSHOT_TOO_LARGE:"FIGMA_SNAPSHOT_TOO_LARGE",FIGMA_SNAPSHOT_NOT_READY:"FIGMA_SNAPSHOT_NOT_READY",DATA_URL_TREATED_AS_FILE:"DATA_URL_TREATED_AS_FILE",GET_FILE_CONTENTS_ERROR:"GET_FILE_CONTENTS_ERROR",IS_DIRECTORY_ERROR:"IS_DIRECTORY_ERROR",GET_FILES_ERROR:"GET_FILES_ERROR",NOT_RELATIVE_TO_GITIGNORE:"NOT_RELATIVE_TO_GITIGNORE",KOMBAI_FOLDER_SYNC_ERROR:"KOMBAI_FOLDER_SYNC_ERROR",PREVIEW_FOLDER_NOT_FOUND:"PREVIEW_FOLDER_NOT_FOUND",FILE_ICON_ERROR:"FILE_ICON_ERROR",CDN_FETCH_ERROR:"CDN_FETCH_ERROR",BINARY_FETCH_ERROR:"BINARY_FETCH_ERROR",BINRARY_NOT_FOUND_AT_EXPECTED_PATH:"BINRARY_NOT_FOUND_AT_EXPECTED_PATH",PAYLOAD_PARSING_ERROR:"PAYLOAD_PARSING_ERROR",DOM_ELEMENT_NOT_FOUND:"DOM_ELEMENT_NOT_FOUND",INVALID_CURSOR_POSITION:"INVALID_CURSOR_POSITION",INDEXING_ERROR:"INDEXING_ERROR",TECH_STACK_READ_ERROR:"TECH_STACK_READ_ERROR",TECH_STACK_WRITE_ERROR:"TECH_STACK_WRITE_ERROR",TECH_STACK_INDEX_METADATA_READ_ERROR:"TECH_STACK_INDEX_METADATA_READ_ERROR",TECH_STACK_INDEX_METADATA_WRITE_ERROR:"TECH_STACK_INDEX_METADATA_WRITE_ERROR",RESOLVE_INPUT_ERROR:"RESOLVE_INPUT_ERROR",GET_SELECTED_CODE_PROMPT_CONTEXT_ERROR:"GET_SELECTED_CODE_PROMPT_CONTEXT_ERROR",SYSTEM_METADATA_FETCH_ERROR:"SYSTEM_METADATA_FETCH_ERROR",USER_FIGMA_FORBIDDEN_FIGMA:"USER_FIGMA_FORBIDDEN_FIGMA",USER_FIGMA_NOT_FRAME_LIKE:"USER_FIGMA_NOT_FRAME_LIKE",WEBVIEW_DIDNT_RESPOND:"WEBVIEW_DIDNT_RESPOND",INVALID_VIEW_NAME:"INVALID_VIEW_NAME",INVALID_ARGUMENT:"INVALID_ARGUMENT",HISTORY_LOAD_ERROR:"HISTORY_LOAD_ERROR",HISTORY_LIST_ERROR:"HISTORY_LIST_ERROR",HISTORY_DELETE_ERROR:"HISTORY_DELETE_ERROR",HISTORY_RENAME_ERROR:"HISTORY_RENAME_ERROR",HISTORY_SHARE_ERROR:"HISTORY_SHARE_ERROR",HISTORY_RESUME_ERROR:"HISTORY_RESUME_ERROR",HISTORY_TRUNCATE_ERROR:"HISTORY_TRUNCATE_ERROR",HISTORY_SAVE_FILES_SAVED_CHECKPOINT_ERROR:"HISTORY_SAVE_FILES_SAVED_CHECKPOINT_ERROR",HISTORY_GET_CHECKPOINT_FILES_ERROR:"HISTORY_GET_CHECKPOINT_FILES_ERROR",HISTORY_GET_USAGE_LOGS_ERROR:"HISTORY_GET_USAGE_LOGS_ERROR",HISTORY_REPORT_THREAD_ACTION_ERROR:"HISTORY_REPORT_THREAD_ACTION_ERROR",THREAD_SYNC_DISABLED:"THREAD_SYNC_DISABLED",TOKEN_USAGE_INFO_ERROR:"TOKEN_USAGE_INFO_ERROR",EXTENSION_MESSAGE_HANDLER_ERROR:"EXTENSION_MESSAGE_HANDLER_ERROR",EXTENSION_SETTING_USER_INSTRUCTIONS_ERROR:"EXTENSION_SETTING_USER_INSTRUCTIONS_ERROR",EXTENSION_GETTING_USER_INSTRUCTIONS_ERROR:"EXTENSION_GETTING_USER_INSTRUCTIONS_ERROR",CREATE_DIRECTORY_ERROR:"CREATE_DIRECTORY_ERROR",DELETE_FILE_ERROR:"DELETE_FILE_ERROR",INVALID_WEBVIEW_TYPE:"INVALID_WEBVIEW_TYPE",GLOBAL_STATE_CONTEXT_MANAGER_NOT_INITIALIZED:"GLOBAL_STATE_CONTEXT_MANAGER_NOT_INITIALIZED",FAILED_TO_RUN_TOOL:"FAILED_TO_RUN_TOOL",AGENT_NOT_FOUND:"AGENT_NOT_FOUND",AGENT_FAILED:"AGENT_FAILED",PARENT_NOT_FOUND:"PARENT_NOT_FOUND",INVALID_AGENT_TYPE:"INVALID_AGENT_TYPE",INVALID_AGENT_STATE:"INVALID_AGENT_STATE",INVALID_AGENT_OPERATION:"INVALID_AGENT_OPERATION",NO_TOOLS_TO_RUN:"NO_TOOLS_TO_RUN",INVALID_TOOL_INPUT:"INVALID_TOOL_INPUT",TERMINAL_EXECUTION_ERROR:"TERMINAL_EXECUTION_ERROR",POWER_SHELL_VERSION_ERROR:"POWER_SHELL_VERSION_ERROR",FETCH_IMAGE_CONTENT_ERROR:"FETCH_IMAGE_CONTENT_ERROR",IMAGE_FILE_OPEN_ERROR:"IMAGE_FILE_OPEN_ERROR",MESSAGE_SENT_POSTHOG_ERROR:"MESSAGE_SENT_POSTHOG_ERROR",USER_ID_NOT_FOUND_FOR_SETUP_SCRIPT:"USER_ID_NOT_FOUND_FOR_SETUP_SCRIPT",USER_RULES_INITIALIZATION_ERROR:"USER_RULES_INITIALIZATION_ERROR",USER_RULES_GET_FOR_CHAT_ERROR:"USER_RULES_GET_FOR_CHAT_ERROR",ORG_RULES_LIST_ERROR:"ORG_RULES_LIST_ERROR",ORG_RULES_GET_ERROR:"ORG_RULES_GET_ERROR",ORG_RULES_PUBLISH_ERROR:"ORG_RULES_PUBLISH_ERROR",ORG_RULES_OVERRIDE_ERROR:"ORG_RULES_OVERRIDE_ERROR",ORG_RULES_DELETE_ERROR:"ORG_RULES_DELETE_ERROR",ORG_RULES_USE_ERROR:"ORG_RULES_USE_ERROR",ORG_COMMANDS_LIST_ERROR:"ORG_COMMANDS_LIST_ERROR",ORG_COMMANDS_GET_ERROR:"ORG_COMMANDS_GET_ERROR",ORG_COMMANDS_PUBLISH_ERROR:"ORG_COMMANDS_PUBLISH_ERROR",ORG_COMMANDS_OVERRIDE_ERROR:"ORG_COMMANDS_OVERRIDE_ERROR",ORG_COMMANDS_DELETE_ERROR:"ORG_COMMANDS_DELETE_ERROR",ORG_COMMANDS_USE_ERROR:"ORG_COMMANDS_USE_ERROR",THREAD_FILE_HISTORY_MANAGER_ERROR:"THREAD_FILE_HISTORY_MANAGER_ERROR",THREAD_FILE_HISTORY_CONTENT_NOT_FOUND:"THREAD_FILE_HISTORY_CONTENT_NOT_FOUND",FILE_NOT_FOUND_IN_WORKSPACE:"FILE_NOT_FOUND_IN_WORKSPACE",THREAD_FILE_HISTORY_MANAGER_NOT_INITIALIZED:"THREAD_FILE_HISTORY_MANAGER_NOT_INITIALIZED",INVALID_OPERATION:"INVALID_OPERATION",INVALID_ACTION_ON_FILE_HISTORY:"INVALID_ACTION_ON_FILE_HISTORY",FILE_WATCHER_SETUP_ERROR:"FILE_WATCHER_SETUP_ERROR",FILE_WATCHER_CREATE_ERROR:"FILE_WATCHER_CREATE_ERROR",FILE_WATCHER_CLEANUP_ERROR:"FILE_WATCHER_CLEANUP_ERROR",FILE_WATCHER_REFRESH_ERROR:"FILE_WATCHER_REFRESH_ERROR",FILE_HISTORY_ADD_OPERATION_ERROR:"FILE_HISTORY_ADD_OPERATION_ERROR",FILE_HISTORY_DELETE_OPERATION_ERROR:"FILE_HISTORY_DELETE_OPERATION_ERROR",FILE_HISTORY_RESTORE_ERROR:"FILE_HISTORY_RESTORE_ERROR",FILE_HISTORY_ACCEPT_ERROR:"FILE_HISTORY_ACCEPT_ERROR",FILE_HISTORY_REJECT_ERROR:"FILE_HISTORY_REJECT_ERROR",FILE_HISTORY_OPEN_ERROR:"FILE_HISTORY_OPEN_ERROR",FILE_CHANGE_HANDLER_ERROR:"FILE_CHANGE_HANDLER_ERROR",FILE_RESTORATION_ERROR:"FILE_RESTORATION_ERROR",WORKSPACE_ROOT_NOT_FOUND:"WORKSPACE_ROOT_NOT_FOUND",FILE_HISTORY_SAVE_ERROR:"FILE_HISTORY_SAVE_ERROR",FILE_HISTORY_INITIALIZATION_ERROR:"FILE_HISTORY_INITIALIZATION_ERROR",NO_OUTGOING_MESSAGE_TIMESTAMP_FOUND:"NO_OUTGOING_MESSAGE_TIMESTAMP_FOUND",USER_DRAFT_CLEAR_ERROR:"USER_DRAFT_CLEAR_ERROR",USER_DRAFT_SAVE_ERROR:"USER_DRAFT_SAVE_ERROR",USER_DRAFT_GET_ERROR:"USER_DRAFT_GET_ERROR",FIRST_TURN_MESSAGE_CLEAR_ERROR:"FIRST_TURN_MESSAGE_CLEAR_ERROR",MENTION_PICKER_HOST_ERROR:"MENTION_PICKER_HOST_ERROR",TOOL_USE_FILE_OPEN_ERROR:"TOOL_USE_FILE_OPEN_ERROR",TOOL_USE_FILE_HISTORY_ADD_ERROR:"TOOL_USE_FILE_HISTORY_ADD_ERROR",TOOL_USE_FILE_HISTORY_ROLLBACK_ERROR:"TOOL_USE_FILE_HISTORY_ROLLBACK_ERROR",TOOL_USE_EXECUTION_ERROR:"TOOL_USE_EXECUTION_ERROR",TOOL_USE_PROCESSING_ERROR:"TOOL_USE_PROCESSING_ERROR",TOOL_USE_INVALID_SOURCE:"TOOL_USE_INVALID_SOURCE",TOOL_USE_SPILLOVER_UNRESOLVED:"TOOL_USE_SPILLOVER_UNRESOLVED",AGENT_RESULT_ENVELOPE_UNRESOLVED:"AGENT_RESULT_ENVELOPE_UNRESOLVED",NON_BLOCKING_TOOL_EXECUTED:"NON_BLOCKING_TOOL_EXECUTED",BLOCKING_TOOL_TIMEOUT:"BLOCKING_TOOL_TIMEOUT",BLOCKING_TOOL_STOPPED:"BLOCKING_TOOL_STOPPED",FILESET_FETCH_HISTORY_ERROR:"FILESET_FETCH_HISTORY_ERROR",FILESET_KEEP_HISTORY_ERROR:"FILESET_KEEP_HISTORY_ERROR",FILESET_REJECT_HISTORY_ERROR:"FILESET_REJECT_HISTORY_ERROR",FILESET_FILE_OPEN_ERROR:"FILESET_FILE_OPEN_ERROR",FILESET_GET_FILE_HISTORY_ERROR:"FILESET_GET_FILE_HISTORY_ERROR",FILESET_ACCEPT_FILE_ERROR:"FILESET_ACCEPT_FILE_ERROR",FILESET_REJECT_FILE_ERROR:"FILESET_REJECT_FILE_ERROR",TOOL_EXECUTION_ERROR:"TOOL_EXECUTION_ERROR",...KO,GET_FEATURE_FLAG_ERROR:"GET_FEATURE_FLAG_ERROR",GET_ACTIVATION_CARD_ERROR:"GET_ACTIVATION_CARD_ERROR",KOMBAI_SUGGESTED_SETTINGS_FETCH_ERROR:"KOMBAI_SUGGESTED_SETTINGS_FETCH_ERROR",AI_SUGGESTED_SETTINGS_FETCH_ERROR:"AI_SUGGESTED_SETTINGS_FETCH_ERROR",BROWSER_STATE_VALIDATION_ERROR:"BROWSER_STATE_VALIDATION_ERROR",BROWSER_SERVER_NOT_FOUND:"BROWSER_SERVER_NOT_FOUND",FETCH_RECENTLY_ACCESSED_FILES_ERROR:"FETCH_RECENTLY_ACCESSED_FILES_ERROR",FETCH_LATEST_SESSION_THREAD_ID_ERROR:"FETCH_LATEST_SESSION_THREAD_ID_ERROR",ATTACHMENT_ERROR:"ATTACHMENT_ERROR",FAILED_TO_GET_SLASH_COMMAND_PROMPTS_DIRECTORY:"FAILED_TO_GET_SLASH_COMMAND_PROMPTS_DIRECTORY",SLASH_COMMAND_NOT_FOUND:"SLASH_COMMAND_NOT_FOUND",PARSE_LEGACY_COMMAND_DIRS_ERROR:"PARSE_LEGACY_COMMAND_DIRS_ERROR",OPEN_FILE_AFTER_CREATE_ERROR:"OPEN_FILE_AFTER_CREATE_ERROR",SETTINGS_ITEMS_LIST_ERROR:"SETTINGS_ITEMS_LIST_ERROR",SETTINGS_ITEMS_REQUEST_ERROR:"SETTINGS_ITEMS_REQUEST_ERROR",BROWSER_CLEAR_CACHE_DATA_FOR_LLM_ERROR:"BROWSER_CLEAR_CACHE_DATA_FOR_LLM_ERROR",FILE_PREVIEW_ERROR:"FILE_PREVIEW_ERROR",TERMINAL_TOOL_EXECUTION_ERROR:"TERMINAL_TOOL_EXECUTION_ERROR",BROWSER_DATA_UPLOAD_ERROR:"BROWSER_DATA_UPLOAD_ERROR",VSCODE_URI_PARSE_ERROR:"VSCODE_URI_PARSE_ERROR",MERMAID_RENDER_ERROR:"MERMAID_RENDER_ERROR",REFERRAL_UNKNOWN_ERROR:"REFERRAL_UNKNOWN_ERROR",REFERRAL_RESPONSE_VALIDATION_ERROR:"REFERRAL_RESPONSE_VALIDATION_ERROR",REFERRAL_GENERATE_CODE_ERROR:"REFERRAL_GENERATE_CODE_ERROR",REFERRAL_GENERATE_CODE_IPC_ERROR:"REFERRAL_GENERATE_CODE_IPC_ERROR",REFERRAL_UNEXPECTED_NOT_PAID_USER:"REFERRAL_UNEXPECTED_NOT_PAID_USER",REFERRAL_UNEXPECTED_TEAM_PLAN_USER:"REFERRAL_UNEXPECTED_TEAM_PLAN_USER",REFERRAL_REFEREE_STATUS_UNEXPECTED:"REFERRAL_REFEREE_STATUS_UNEXPECTED",REFERRAL_REFEREE_STATUS_FETCH_FAILED:"REFERRAL_REFEREE_STATUS_FETCH_FAILED",PAYMENT_LINK_RESPONSE_VALIDATION_ERROR:"PAYMENT_LINK_RESPONSE_VALIDATION_ERROR",SUBSCRIPTION_SCHEDULE_DOWNGRADE_ERROR:"SUBSCRIPTION_SCHEDULE_DOWNGRADE_ERROR",SUBSCRIPTION_CANCEL_SCHEDULED_DOWNGRADE_ERROR:"SUBSCRIPTION_CANCEL_SCHEDULED_DOWNGRADE_ERROR",SUBSCRIPTION_CANCEL_AT_PERIOD_END_ERROR:"SUBSCRIPTION_CANCEL_AT_PERIOD_END_ERROR",PLAN_FEATURE_MARKUP_UNPARSED:"PLAN_FEATURE_MARKUP_UNPARSED",PAYMENT_STRIPE_JS_LOAD_FAILED:"PAYMENT_STRIPE_JS_LOAD_FAILED",PAYMENT_CHALLENGE_THREW:"PAYMENT_CHALLENGE_THREW",PAYMENT_CHALLENGE_INCOMPLETE:"PAYMENT_CHALLENGE_INCOMPLETE",PAYMENT_CHALLENGE_ORPHANED_SUCCESS:"PAYMENT_CHALLENGE_ORPHANED_SUCCESS",PAYMENT_REQUEST_THREW:"PAYMENT_REQUEST_THREW",PAYMENT_ATTEMPT_ORPHANED:"PAYMENT_ATTEMPT_ORPHANED",PAYMENT_OUTCOME_UNHANDLED:"PAYMENT_OUTCOME_UNHANDLED",PAYMENT_CART_CHANGED_WHILE_CHARGING:"PAYMENT_CART_CHANGED_WHILE_CHARGING",PAYMENT_SETTLEMENT_UNCONFIRMED:"PAYMENT_SETTLEMENT_UNCONFIRMED",PAYMENT_SETTLEMENT_BACKSTOP_FIRED:"PAYMENT_SETTLEMENT_BACKSTOP_FIRED",PAYMENT_EMPTY_CART_SUBMIT:"PAYMENT_EMPTY_CART_SUBMIT",PAYMENT_NO_PLAN_SELECTED:"PAYMENT_NO_PLAN_SELECTED",PAYMENT_SEED_PLAN_UNRESOLVED:"PAYMENT_SEED_PLAN_UNRESOLVED",PAYMENT_CONFIRM_STEP_WITHOUT_CARDS:"PAYMENT_CONFIRM_STEP_WITHOUT_CARDS",PAYMENT_CONFIRM_CARD_WITHOUT_ORDER:"PAYMENT_CONFIRM_CARD_WITHOUT_ORDER",PAYMENT_ENVELOPE_OUTCOME_UNRECOGNISED:"PAYMENT_ENVELOPE_OUTCOME_UNRECOGNISED",PAYMENT_ATTEMPT_FAILED:"PAYMENT_ATTEMPT_FAILED",EXCALIDRAW_PNG_CREATION_ERROR:"EXCALIDRAW_PNG_CREATION_ERROR",SKILLS_SCAN_ERROR:"SKILLS_SCAN_ERROR",MCP_SERVER_CONFIG_ERROR:"MCP_SERVER_CONFIG_ERROR",MCP_WRITE_TOOLS_TO_DISK_ERROR:"MCP_WRITE_TOOLS_TO_DISK_ERROR",MCP_LIST_TOOLS_ERROR:"MCP_LIST_TOOLS_ERROR",MCP_LIST_RESOURCES_ERROR:"MCP_LIST_RESOURCES_ERROR",MCP_CLEAR_JSON_FILES_ERROR:"MCP_CLEAR_JSON_FILES_ERROR",MCP_DELETE_SERVER_CONFIG_FILE_ERROR:"MCP_DELETE_SERVER_CONFIG_FILE_ERROR",MCP_SERVER_RUNTIME_ERROR:"MCP_SERVER_RUNTIME_ERROR",MCP_WORKER_ERROR:"MCP_WORKER_ERROR",MCP_HOST_REQUEST_ERROR:"MCP_HOST_REQUEST_ERROR",MCP_TOOL_CALL_ERROR:"MCP_TOOL_CALL_ERROR",MCP_RESOURCE_READ_ERROR:"MCP_RESOURCE_READ_ERROR",MCP_EXTERNAL_CALL_ERROR:"MCP_EXTERNAL_CALL_ERROR",ENHANCE_PROMPT_UNKNOWN_TOKEN:"ENHANCE_PROMPT_UNKNOWN_TOKEN",ENHANCE_PROMPT_DUPLICATE_KEY_CONFLICT:"ENHANCE_PROMPT_DUPLICATE_KEY_CONFLICT",ENHANCE_PROMPT_UNKNOWN_NODE_TYPE:"ENHANCE_PROMPT_UNKNOWN_NODE_TYPE",ENHANCE_PROMPT_VALIDATION_ERROR:"ENHANCE_PROMPT_VALIDATION_ERROR",ENHANCE_PROMPT_CORE_ERROR:"ENHANCE_PROMPT_CORE_ERROR",ENHANCE_PROMPT_REQUEST_FAILED:"ENHANCE_PROMPT_REQUEST_FAILED",ENHANCE_PROMPT_INPUT_TOO_LONG:"ENHANCE_PROMPT_INPUT_TOO_LONG",CANVAS_TOOL_UNKNOWN_TOOL:"CANVAS_TOOL_UNKNOWN_TOOL",LEARN_SANITY_UNREACHABLE:"LEARN_SANITY_UNREACHABLE",LEARN_SANITY_PLAN_LIMIT_REACHED:"LEARN_SANITY_PLAN_LIMIT_REACHED",LEARN_SANITY_HTTP_ERROR:"LEARN_SANITY_HTTP_ERROR",LEARN_SANITY_MALFORMED_RESPONSE:"LEARN_SANITY_MALFORMED_RESPONSE",LEARN_SANITY_RESULT_UNPARSEABLE:"LEARN_SANITY_RESULT_UNPARSEABLE",LEARN_GUIDE_UNRENDERABLE:"LEARN_GUIDE_UNRENDERABLE",LOCAL_CACHE_WRITE_ERROR:"LOCAL_CACHE_WRITE_ERROR",LOCAL_CACHE_READ_ERROR:"LOCAL_CACHE_READ_ERROR",LOCAL_CACHE_INIT_ERROR:"LOCAL_CACHE_INIT_ERROR"},KSe=new Set([R4.SOCKET_REJECTING_WAITING_REQUEST,R4.SOCKET_MAX_RETRIES,R4.SOCKET_TIMEOUT,R4.SOCKET_CONNECTION_ERROR]);var dv=class extends Error{constructor(r,a,o,n){super(`${r} ${a}`);Vn(this,"errorCode");Vn(this,"details");o&&(this.cause=o),this.errorCode=r,this.details=n||{}}};var p9=class extends dv{constructor(r,a,o,n){super(r,a,o);Vn(this,"extraInfo");this.name="WebviewError",this.extraInfo=n}};var fv="var(--vscode-charts-green, #3FE38B)",YO="var(--vscode-errorForeground, #f47067)",Tr=K5`
|
|
2682
|
+
`;function cv({items:e}){return(0,d0.jsx)(sY,{"aria-label":"Included with your account",children:e.map(t=>(0,d0.jsxs)("li",{children:[(0,d0.jsx)(un,{size:13,strokeWidth:2.5,"aria-hidden":!0}),t]},t))})}var st=E(Gt()),jO="chat_sign_in",iY="chat_guest",lY=20,QY=11*6e4,uv="Sign-in didn't finish.";var k5={state:"idle",matchCode:null,orgs:[],failure:uv,moved:null,besideChat:!1,openLink:null};function cY(e,t){switch(e.status){case"signing_in":return{...k5,state:"waiting",matchCode:e.match_code??t.matchCode,openLink:e.openLink??t.openLink};case"claimed":return{...k5,state:"claimed",moved:e.moved,besideChat:e.besideChat};case"needs_org":return{...k5,state:"needs_org",orgs:e.orgs};case"claim_pending":return{...k5,state:"pending"};case"signed_in":return{...k5,state:"signed_in"};case"guest":return{...k5,state:"guest"};case"failed":return{...k5,state:"failed",failure:e.error?.message??uv}}}function qO({data:e,host:t,subsystem:r,intro:a}){let[o,n]=(0,Ca.useState)(k5),[s,i]=(0,Ca.useState)(!1),l=(0,Ca.useRef)(!1),Q=(0,Ca.useRef)(0),c=(0,Ca.useRef)(!0);(0,Ca.useEffect)(()=>(c.current=!0,()=>{c.current=!1}),[]);let u=p=>void t.openLink(p).catch(v=>S1(v,{tags:{subsystem:r}})),d=async(p,v=jO)=>{if(l.current)return;l.current=!0;let b=++Q.current,L=()=>c.current&&Q.current===b;i(!0);let S=p,_=k5,x=Date.now()+QY;try{for(;;){let C=kO(await t.callTool(v,S));if(!L())return;if(C.status==="signing_in"&&Date.now()>=x){n({...k5,state:"failed"});return}if(_=cY(C,_),n(_),C.status==="signing_in"&&C.openNow&&_.openLink&&u(_.openLink),C.status!=="signing_in")return;S={wait:lY}}}catch(C){S1(C,{tags:{subsystem:r}}),L()&&n({...k5,state:"failed",failure:C instanceof Error&&C.message?C.message:uv})}finally{Q.current===b&&(l.current=!1,c.current&&i(!1))}},f=()=>{Q.current++,l.current=!1,i(!1),n(k5)},g=()=>o.openLink?u(o.openLink):void t.callTool(jO,{reopen:!0}).catch(p=>S1(p,{tags:{subsystem:r}})),h=e.reason==="start"&&e.guest,y=(p,v=!0)=>(0,st.jsxs)(V6,{children:[v&&(0,st.jsx)(l9,{children:FO(e.appBrowser)}),h&&(0,st.jsx)(dn,{type:"button",$look:"outline",disabled:s,onClick:()=>void d({},iY),children:ZO}),(0,st.jsx)(dn,{type:"button",disabled:s,onClick:()=>void d({wait:0}),children:p})]}),m=a??PO(e);switch(o.state){case"idle":return(0,st.jsx)(Sa,{guest:e.reason!=="start",title:m.title,body:m.body,children:y("Sign in")});case"waiting":{let p=BO(e.appBrowser);return(0,st.jsxs)(Sa,{title:p.title,body:p.body,children:[(0,st.jsx)($O,{matchCode:o.matchCode,status:d9.status}),(0,st.jsxs)(V6,{children:[(0,st.jsx)(dn,{type:"button",$look:"plain",onClick:f,children:d9.cancel}),(0,st.jsx)(dn,{type:"button",$look:"outline",onClick:g,children:d9.reopen})]})]})}case"claimed":{let{moved:p,besideChat:v}=o,b=v?null:p?.url;return(0,st.jsxs)(Sa,{guest:!1,done:!0,title:E4.title,body:E4.body,children:[p?.name?(0,st.jsx)(zO,{name:p.name,detail:UO(p.designs)}):(0,st.jsx)(cv,{items:iv}),(0,st.jsxs)(V6,{children:[(0,st.jsx)(l9,{children:v?E4.besideChat:E4.next}),b&&(0,st.jsx)(dn,{type:"button",$look:"outline",onClick:()=>u(b),children:E4.open})]})]})}case"needs_org":return(0,st.jsx)(Sa,{title:Qv.title,body:Qv.body,children:(0,st.jsx)(GO,{children:o.orgs.map(p=>(0,st.jsx)(LO,{disabled:s,onClick:()=>void d({claimOrg:p.id}),children:p.name},p.id))})});case"pending":return(0,st.jsx)(Sa,{guest:!1,title:lv.title,body:lv.body,children:y("Try again",!1)});case"guest":return(0,st.jsx)(Sa,{done:!0,title:f9.title,body:f9.body,children:(0,st.jsxs)(V6,{children:[(0,st.jsx)(l9,{children:f9.next}),(0,st.jsx)(dn,{type:"button",$look:"outline",disabled:s,onClick:()=>void d({wait:0}),children:"Sign in"})]})});case"signed_in":return(0,st.jsx)(Sa,{guest:!1,done:!0,title:sv.title,body:sv.body,children:(0,st.jsx)(cv,{items:iv})});case"failed":return(0,st.jsxs)(Sa,{title:m.title,body:m.body,children:[(0,st.jsx)(_O,{children:o.failure}),y("Sign in")]})}}function uY(e){let t=e.structuredContent;return e.isError!==!0&&u0(t)&&Array.isArray(t.briefs)?{run_id:typeof t.run_id=="string"?t.run_id:"",thread_name:typeof t.thread_name=="string"?t.thread_name:null,briefs:t.briefs.filter(r=>typeof r=="string"&&r.length>0)}:EO(e)||"Kombai sent no taste brief."}function WO(e,t){return RO({name:"kombai-design-taste",version:e,subsystem:"mcp-design-taste"},{onTheme:t.onTheme,onFailure:t.onFailure,onToolResult:r=>{let a=DO(r);if(a){t.onSignIn(a);return}let o=uY(r);typeof o=="string"?t.onFailure(o):t.onData(o)}})}var bk=E(H());var fn={primary:16};var dY={LAUNCH_FAILED:"launch_failed",PAGE_LOAD_FAILED:"page_load_failed",DETECTION_FAILED:"detection_failed",OPEN_PAGE_IN_CONTEXT_FAILED:"open_page_in_context_failed",EXTENSION_LOAD_FAILED:"extension_load_failed",CONTEXT_CREATION_FAILED:"context_creation_failed",PROXY_SETUP_FAILED:"proxy_setup_failed",NAMESPACE_INJECTION_FAILED:"namespace_injection_failed",PAGE_NAVIGATION_FAILED:"page_navigation_failed",CONNECTION_FAILED:"connection_failed",APP_INITIALIZATION_FAILED:"app_initialization_failed",API_INJECTION_FAILED:"api_injection_failed",API_VALIDATION_FAILED:"api_validation_failed",PAGE_META_INJECTION_FAILED:"page_meta_injection_failed",IFRAME_LOAD_FAILED:"iframe_load_failed",IFRAME_DISPOSAL_FAILED:"iframe_disposal_failed",IFRAME_REMOVAL_FAILED:"iframe_removal_failed",HEALTH_CHECK_FAILED:"health_check_failed",SCRIPT_EXECUTION_FAILED:"script_execution_failed",SCRIPT_TIMEOUT:"script_timeout",FILE_READ_FAILED:"file_read_failed",DIRECTORY_FOUND_KOMBAI_TEMP_DIR:"directory_found_kombai_temp_dir",DIRECTORY_DELETE_FAILED:"directory_delete_failed",IMAGE_LIMIT_EXCEEDED:"image_limit_exceeded",TEXT_LENGTH_LIMIT_EXCEEDED:"text_length_limit_exceeded",BINARY_FILE_FOUND_IN_TEMP_DIR:"binary_file_found_in_temp_dir",PAGE_METADATA_FETCH_ERROR:"page_metadata_fetch_error",VALIDATION_FAILED:"validation_failed",DEBUGGING_PORT_READ_FAILED:"debugging_port_read_failed",DEBUGGING_PORT_PARSE_FAILED:"debugging_port_parse_failed",RAW_BROWSER_NOT_FOUND:"raw_browser_not_found",PROXY_NOT_INSTALLED:"proxy_not_installed",USER_DATA_DIR_LOCKED:"user_data_dir_locked",BROWSER_NOT_LAUNCHED:"browser_not_launched",WINDOW_ID_FETCH_FAILED:"window_id_fetch_failed",PAGE_ID_FETCH_FAILED:"page_id_fetch_failed",INVALID_PAGE_URL:"invalid_page_url",RESOURCE_FILE_URL_NOT_SUPPORTED:"resource_file_url_not_supported",RXJS_INJECTION_FAILED:"rxjs_injection_failed",BROWSER_AUDIT_FAILED:"browser_audit_failed",EXTENSION_APP_NOT_INITIALIZED:"extension_app_not_initialized",PAGE_NOT_FOUND:"page_not_found",PAGE_INITIALIZATION_FAILED:"page_initialization_failed",PAGE_REFRESH_SETUP_FAILED:"page_refresh_setup_failed",NEW_PAGE_SETUP_FAILED:"new_page_setup_failed",PAGE_DISPOSE_FAILED:"page_dispose_failed",SERVICES_RESET_FAILED:"services_reset_failed"},fY={SYNC_FAILED:"sync_failed"},pY={PAGE_CLOSED:"page_closed",PAGE_DETACHED:"page_detached",NAVIGATION_INTERRUPTED:"navigation_interrupted",DOM_NOT_AVAILABLE:"dom_not_available"},mY={NOT_INITIALIZED:"not_initialized",TIMEOUT:"timeout",OPERATION_FAILED:"operation_failed",INJECTION_FAILED:"injection_failed",CHANNEL_NOT_READY:"channel_not_ready",VALIDATION_FAILED:"validation_failed",FIBER_NODE_NOT_FOUND:"fiber_node_not_found",RESOURCE_NOT_FOUND:"resource_not_found",NODE_ID_NOT_FOUND_FOR_SELECTOR:"node_id_not_found_for_selector",CDP_SESSION_FAILED_TO_CREATE:"cdp_session_failed_to_create",CDP_SESSION_ERROR:"cdp_session_error",PAGE_API_NOT_AVAILABLE:"page_api_not_available"},gY={PAGE_OPEN_FAILED:"page_open_failed",PAGE_REOPEN_FAILED:"page_reopen_failed",PAGE_CLOSE_FAILED:"page_close_failed",PAGE_REFRESH_FAILED:"page_refresh_failed",PAGE_FOCUS_FAILED:"page_focus_failed",PAGE_NOT_FOUND:"page_not_found",APP_NOT_FOUND:"app_not_found",BROWSER_CLOSE_FAILED:"browser_close_failed",INITIALIZATION_FAILED:"initialization_failed",SUBSCRIPTION_SETUP_FAILED:"subscription_setup_failed",SUBSCRIPTION_CLEANUP_FAILED:"subscription_cleanup_failed",DOM_SERVICES_NOT_INITIALIZED:"dom_services_not_initialized",SNAPSHOT_CACHE_UPDATE_FAILED:"snapshot_cache_update_failed",SNAPSHOT_CACHE_PURGE_FAILED:"snapshot_cache_purge_failed",SNAPSHOT_CACHE_NOT_FOUND:"snapshot_cache_not_found",SNAPSHOT_NOT_FOUND_IN_CACHE:"snapshot_not_found_in_cache",SCREENSHOT_READ_FAILED:"screenshot_read_failed",SCREENSHOT_DIRECTORY_EMPTY_FAILED:"screenshot_directory_empty_failed",DATA_PROCESSING_FAILED:"data_processing_failed",CHAT_INTEGRATION_FAILED:"chat_integration_failed",CONTEXT_STATE_SYNC_FAILED:"context_state_sync_failed",SEND_TO_CHAT_FAILED:"send_to_chat_failed",CHANNEL_COMMUNICATION_INITIALIZATION_FAILED:"channel_communication_initialization_failed"},hY={BROWSER_OPEN_ERROR:"BROWSER_OPEN_ERROR",BROWSER_CLOSE_ERROR:"BROWSER_CLOSE_ERROR",BROWSER_EXECUTE_ERROR:"BROWSER_EXECUTE_ERROR",BROWSER_OPEN_FAILED_REASON_NOT_PROVIDED:"BROWSER_OPEN_FAILED_REASON_NOT_PROVIDED",BROWSER_NOT_FOUND:"BROWSER_NOT_FOUND",INVALID_BROWSER_TYPE:"INVALID_BROWSER_TYPE",INVALID_URL:"INVALID_URL",INVALID_CODE:"INVALID_CODE",INVALID_DESCRIPTION:"INVALID_DESCRIPTION",INVALID_PAGE_ID:"INVALID_PAGE_ID",INVALID_ACTION_TYPE:"INVALID_ACTION_TYPE"},vY={AGENT_PAGE_OPEN_FAILED:"agent_page_open_failed",AGENT_PAGE_CLOSE_FAILED:"agent_page_close_failed",AGENT_BANNER_INJECTION_FAILED:"agent_banner_injection_failed",AGENT_BROWSER_AUDIT_FAILED:"agent_browser_audit_failed"},yY={NOT_INITIALIZED:"session_not_initialized",INITIALIZATION_FAILED:"session_initialization_failed",HANDLER_NOT_REGISTERED:"session_handler_not_registered",SNAPSHOT_FAILED:"session_snapshot_failed"},bY={SOCKET_SERVER_START_FAILED:"socket_server_start_failed",SOCKET_SERVER_STOP_FAILED:"socket_server_stop_failed",SOCKET_SERVER_NOT_INITIALIZED:"socket_server_not_initialized",SOCKET_CHANNEL_EMIT_FAILED:"socket_channel_emit_failed",SOCKET_CHANNEL_NOT_FOUND:"socket_channel_not_found",SOCKET_CLIENT_CONNECTION_FAILED:"socket_client_connection_failed",SOCKET_CLIENT_UPDATE_REJECTED:"socket_client_update_rejected"},_Y={SERVER_START_FAILED:"server_start_failed",SERVER_STOP_FAILED:"server_stop_failed",SERVER_RESTART_FAILED:"server_restart_failed",SERVER_DISPOSAL_FAILED:"server_disposal_failed",PORT_ALLOCATION_FAILED:"port_allocation_failed",PORT_NOT_AVAILABLE:"port_not_available",DIRECTORY_CREATION_FAILED:"directory_creation_failed",DIRECTORY_VALIDATION_FAILED:"directory_validation_failed",FILE_READ_FAILED:"file_read_failed",FILE_SERVE_FAILED:"file_serve_failed",VIRTUAL_FILE_GENERATION_FAILED:"virtual_file_generation_failed",VIRTUAL_FILE_REGISTRATION_FAILED:"virtual_file_registration_failed",REQUEST_HANDLER_FAILED:"request_handler_failed",INVALID_REQUEST_PATH:"invalid_request_path",INVALID_STATE_TRANSITION:"invalid_state_transition",SERVER_ALREADY_DISPOSED:"server_already_disposed"},KO={...fY,...pY,...mY,...gY,...vY,...hY,...dY,..._Y,...bY,...yY};var R4={UNAUTHORIZED:"UNAUTHORIZED",FORBIDDEN_WAF:"FORBIDDEN_WAF",FORBIDDEN_CORS:"FORBIDDEN_CORS",AUTH_FAILED:"AUTH_FAILED",INTERNAL_SERVER_ERROR:"INTERNAL_SERVER_ERROR",DESIGN_LIBRARY_FETCH_ERROR:"DESIGN_LIBRARY_FETCH_ERROR",UNHANDLED_ERROR:"UNHANDLED_ERROR",BAD_REQUEST:"BAD_REQUEST",UI_NETWORK_ERROR:"UI_NETWORK_ERROR",THREAD_NOT_FOUND:"THREAD_NOT_FOUND",LOGOUT_CLEANUP_VALIDATION_ERROR:"LOGOUT_CLEANUP_VALIDATION_ERROR",LOGOUT_ERROR:"LOGOUT_ERROR",CODE_VERIFICATION_ERROR:"CODE_VERIFICATION_ERROR",LOGIN_CALLBACK_ERROR:"LOGIN_CALLBACK_ERROR",OAUTH_CALLBACK_ERROR:"OAUTH_CALLBACK_ERROR",SECURE_STORAGE_UNAVAILABLE:"SECURE_STORAGE_UNAVAILABLE",USER_RULES_VALIDATION_ERROR:"USER_RULES_VALIDATION_ERROR",CODEGEN_VALIDATION_ERROR:"CODEGEN_VALIDATION_ERROR",NEW_USER_RULES_VALIDATION_ERROR:"NEW_USER_RULES_VALIDATION_ERROR",STREAMING_VALIDATION_ERROR:"STREAMING_VALIDATION_ERROR",UNSUPPORTED_WS_VALIDATION_ERROR:"UNSUPPORTED_WS_VALIDATION_ERROR",PREVIEW_ERROR_VALIDATION_ERROR:"PREVIEW_ERROR_VALIDATION_ERROR",RESOLVE_INPUT_VALIDATION_ERROR:"RESOLVE_INPUT_VALIDATION_ERROR",FIX_CODE_VALIDATION_ERROR:"FIX_CODE_VALIDATION_ERROR",SKIP_VALIDATION_ERROR:"SKIP_VALIDATION_ERROR",WORKING_SET_VALIDATION_ERROR:"WORKING_SET_VALIDATION_ERROR",INVALID_MESSAGE_VALIDATION_ERROR:"INVALID_MESSAGE_VALIDATION_ERROR",CODEGEN_ALREADY_IN_PROGRESS_ERROR:"CODEGEN_ALREADY_IN_PROGRESS_ERROR",INVALID_FIGMA_VALIDATION_ERROR:"INVALID_FIGMA_VALIDATION_ERROR",INVALID_SOCKET_RESPONSE_ERROR:"INVALID_SOCKET_RESPONSE_ERROR",MISSING_EDITOR_CONTENT_VALIDATION_ERROR:"MISSING_EDITOR_CONTENT_VALIDATION_ERROR",FIGMA_CONNECT_MESSAGE_VALIDATION_ERROR:"FIGMA_CONNECT_MESSAGE_VALIDATION_ERROR",UI_ERROR:"UI_ERROR",LOADER_LEFT_OPEN:"LOADER_LEFT_OPEN",WEBVIEW_REQUEST_TIMEOUT:"WEBVIEW_REQUEST_TIMEOUT",WEBVIEW_REQUEST_ABORTED:"WEBVIEW_REQUEST_ABORTED",CORE_UNAVAILABLE:"CORE_UNAVAILABLE",EDITOR_SURFACE_MISSING:"EDITOR_SURFACE_MISSING",PROJECT_REQUIRED:"PROJECT_REQUIRED",CODEX_FAILED:"CODEX_FAILED",CODEX_CONTINUABLE:"CODEX_CONTINUABLE",CLAUDE_CODE_FAILED:"CLAUDE_CODE_FAILED",CLAUDE_CODE_CONTINUABLE:"CLAUDE_CODE_CONTINUABLE",CODEX_PLAN_LIMIT:"CODEX_PLAN_LIMIT",CLAUDE_CODE_PLAN_LIMIT:"CLAUDE_CODE_PLAN_LIMIT",CODEX_AUTH_FAILED:"CODEX_AUTH_FAILED",CODEX_NOT_INSTALLED:"CODEX_NOT_INSTALLED",CLAUDE_CODE_NOT_INSTALLED:"CLAUDE_CODE_NOT_INSTALLED",CODEX_SESSION_BUSY:"CODEX_SESSION_BUSY",CLAUDE_CODE_AT_CAPACITY:"CLAUDE_CODE_AT_CAPACITY",AGENT_WORKSPACE_MISSING:"AGENT_WORKSPACE_MISSING",THREAD_SESSION_MISMATCH:"THREAD_SESSION_MISMATCH",SEND_DISPATCH_FAILED:"SEND_DISPATCH_FAILED",SOCKET_TIMEOUT:"SOCKET_TIMEOUT",SOCKET_CONNECTION_ERROR:"SOCKET_CONNECTION_ERROR",GLOBAL_STORE_ERROR:"GLOBAL_STORE_ERROR",THREAD_LEASE_LOST:"THREAD_LEASE_LOST",SOCKET_SEND_ERROR:"SOCKET_SEND_ERROR",SOCKET_SEND_ERROR_CALLBACK:"SOCKET_SEND_ERROR_CALLBACK2",UNHANDLED_SOCKET_ERROR:"UNHANDLED_SOCKET_ERROR",SOCKET_REJECTING_WAITING_REQUEST:"SOCKET_REJECTING_WAITING_REQUEST",SOCKET_MAX_RETRIES:"SOCKET_MAX_RETRIES",SOCKET_INITIALIZATION_ERROR:"SOCKET_INITIALIZATION_ERROR",SOCKET_SEND_BLOCKING_TOOL_REPLY_ERROR:"SOCKET_SEND_BLOCKING_TOOL_REPLY_ERROR",SOCKET_FRAME_DROPPED:"SOCKET_FRAME_DROPPED",FORCE_UPDATE_ERROR:"FORCE_UPDATE_ERROR",FIGMA_API_ERROR:"FIGMA_API_ERROR",FIGMA_CONNECT_ERROR:"FIGMA_CONNECT_ERROR",FIGMA_TOKEN_NOT_FOUND:"FIGMA_TOKEN_NOT_FOUND",REPLACE_FILE_CONTENT_ERROR:"REPLACE_FILE_CONTENT_ERROR",SETUP_DIFF_DIRECTORY_ERROR:"SETUP_DIFF_DIRECTORY_ERROR",CLEAN_UP_DIFF_ERROR:"CLEAN_UP_DIFF_ERROR",WRITE_DIFF_FILE_ERROR:"WRITE_DIFF_FILE_ERROR",GET_ENCLOSING_SYMBOL_ERROR:"GET_ENCLOSING_SYMBOL_ERROR",GET_REFERENCES_ERROR:"GET_REFERENCES_ERROR",WORKSPACE_NOT_FOUND:"WORKSPACE_NOT_FOUND",WALK_DIR_ERROR:"WALK_DIR_ERROR",FILE_NOT_FOUND:"FILE_NOT_FOUND",TS_CONFIG_PARSING_FAILED:"TS_CONFIG_PARSING_FAILED",FILE_NOT_SUPPORTED_FOR_REFERENCES:"FILE_NOT_SUPPORTED_FOR_REFERENCES",WRITE_FILE_ERROR:"WRITE_FILE_ERROR",FILE_REFERENCE_ERROR:"FILE_REFERENCE_ERROR",READ_RANGE_ERROR:"READ_RANGE_ERROR",S3_FETCH_ERROR:"S3_FETCH_ERROR",S3_PUT_ERROR:"S3_PUT_ERROR",IMAGE_LOST:"IMAGE_LOST",IMAGE_STORE_WRITE_ERROR:"IMAGE_STORE_WRITE_ERROR",IMAGE_STORE_READ_ERROR:"IMAGE_STORE_READ_ERROR",IMAGE_STORE_FALLBACK_ENGAGED:"IMAGE_STORE_FALLBACK_ENGAGED",FIGMA_SNAPSHOT_UNAVAILABLE:"FIGMA_SNAPSHOT_UNAVAILABLE",FIGMA_SNAPSHOT_TOO_LARGE:"FIGMA_SNAPSHOT_TOO_LARGE",FIGMA_SNAPSHOT_NOT_READY:"FIGMA_SNAPSHOT_NOT_READY",DATA_URL_TREATED_AS_FILE:"DATA_URL_TREATED_AS_FILE",GET_FILE_CONTENTS_ERROR:"GET_FILE_CONTENTS_ERROR",ATTACHMENT_PROBE_ERROR:"ATTACHMENT_PROBE_ERROR",IS_DIRECTORY_ERROR:"IS_DIRECTORY_ERROR",GET_FILES_ERROR:"GET_FILES_ERROR",NOT_RELATIVE_TO_GITIGNORE:"NOT_RELATIVE_TO_GITIGNORE",KOMBAI_FOLDER_SYNC_ERROR:"KOMBAI_FOLDER_SYNC_ERROR",PREVIEW_FOLDER_NOT_FOUND:"PREVIEW_FOLDER_NOT_FOUND",FILE_ICON_ERROR:"FILE_ICON_ERROR",CDN_FETCH_ERROR:"CDN_FETCH_ERROR",BINARY_FETCH_ERROR:"BINARY_FETCH_ERROR",BINRARY_NOT_FOUND_AT_EXPECTED_PATH:"BINRARY_NOT_FOUND_AT_EXPECTED_PATH",PAYLOAD_PARSING_ERROR:"PAYLOAD_PARSING_ERROR",DOM_ELEMENT_NOT_FOUND:"DOM_ELEMENT_NOT_FOUND",INVALID_CURSOR_POSITION:"INVALID_CURSOR_POSITION",INDEXING_ERROR:"INDEXING_ERROR",TECH_STACK_READ_ERROR:"TECH_STACK_READ_ERROR",TECH_STACK_WRITE_ERROR:"TECH_STACK_WRITE_ERROR",TECH_STACK_INDEX_METADATA_READ_ERROR:"TECH_STACK_INDEX_METADATA_READ_ERROR",TECH_STACK_INDEX_METADATA_WRITE_ERROR:"TECH_STACK_INDEX_METADATA_WRITE_ERROR",RESOLVE_INPUT_ERROR:"RESOLVE_INPUT_ERROR",GET_SELECTED_CODE_PROMPT_CONTEXT_ERROR:"GET_SELECTED_CODE_PROMPT_CONTEXT_ERROR",SYSTEM_METADATA_FETCH_ERROR:"SYSTEM_METADATA_FETCH_ERROR",USER_FIGMA_FORBIDDEN_FIGMA:"USER_FIGMA_FORBIDDEN_FIGMA",USER_FIGMA_NOT_FRAME_LIKE:"USER_FIGMA_NOT_FRAME_LIKE",WEBVIEW_DIDNT_RESPOND:"WEBVIEW_DIDNT_RESPOND",INVALID_VIEW_NAME:"INVALID_VIEW_NAME",INVALID_ARGUMENT:"INVALID_ARGUMENT",HISTORY_LOAD_ERROR:"HISTORY_LOAD_ERROR",HISTORY_LIST_ERROR:"HISTORY_LIST_ERROR",HISTORY_DELETE_ERROR:"HISTORY_DELETE_ERROR",HISTORY_RENAME_ERROR:"HISTORY_RENAME_ERROR",HISTORY_SHARE_ERROR:"HISTORY_SHARE_ERROR",HISTORY_RESUME_ERROR:"HISTORY_RESUME_ERROR",HISTORY_TRUNCATE_ERROR:"HISTORY_TRUNCATE_ERROR",HISTORY_SAVE_FILES_SAVED_CHECKPOINT_ERROR:"HISTORY_SAVE_FILES_SAVED_CHECKPOINT_ERROR",HISTORY_GET_CHECKPOINT_FILES_ERROR:"HISTORY_GET_CHECKPOINT_FILES_ERROR",HISTORY_GET_USAGE_LOGS_ERROR:"HISTORY_GET_USAGE_LOGS_ERROR",HISTORY_REPORT_THREAD_ACTION_ERROR:"HISTORY_REPORT_THREAD_ACTION_ERROR",THREAD_SYNC_DISABLED:"THREAD_SYNC_DISABLED",TOKEN_USAGE_INFO_ERROR:"TOKEN_USAGE_INFO_ERROR",EXTENSION_MESSAGE_HANDLER_ERROR:"EXTENSION_MESSAGE_HANDLER_ERROR",EXTENSION_SETTING_USER_INSTRUCTIONS_ERROR:"EXTENSION_SETTING_USER_INSTRUCTIONS_ERROR",EXTENSION_GETTING_USER_INSTRUCTIONS_ERROR:"EXTENSION_GETTING_USER_INSTRUCTIONS_ERROR",CREATE_DIRECTORY_ERROR:"CREATE_DIRECTORY_ERROR",DELETE_FILE_ERROR:"DELETE_FILE_ERROR",INVALID_WEBVIEW_TYPE:"INVALID_WEBVIEW_TYPE",GLOBAL_STATE_CONTEXT_MANAGER_NOT_INITIALIZED:"GLOBAL_STATE_CONTEXT_MANAGER_NOT_INITIALIZED",FAILED_TO_RUN_TOOL:"FAILED_TO_RUN_TOOL",AGENT_NOT_FOUND:"AGENT_NOT_FOUND",AGENT_FAILED:"AGENT_FAILED",PARENT_NOT_FOUND:"PARENT_NOT_FOUND",INVALID_AGENT_TYPE:"INVALID_AGENT_TYPE",INVALID_AGENT_STATE:"INVALID_AGENT_STATE",INVALID_AGENT_OPERATION:"INVALID_AGENT_OPERATION",NO_TOOLS_TO_RUN:"NO_TOOLS_TO_RUN",INVALID_TOOL_INPUT:"INVALID_TOOL_INPUT",TERMINAL_EXECUTION_ERROR:"TERMINAL_EXECUTION_ERROR",POWER_SHELL_VERSION_ERROR:"POWER_SHELL_VERSION_ERROR",FETCH_IMAGE_CONTENT_ERROR:"FETCH_IMAGE_CONTENT_ERROR",IMAGE_FILE_OPEN_ERROR:"IMAGE_FILE_OPEN_ERROR",MESSAGE_SENT_POSTHOG_ERROR:"MESSAGE_SENT_POSTHOG_ERROR",USER_ID_NOT_FOUND_FOR_SETUP_SCRIPT:"USER_ID_NOT_FOUND_FOR_SETUP_SCRIPT",USER_RULES_INITIALIZATION_ERROR:"USER_RULES_INITIALIZATION_ERROR",USER_RULES_GET_FOR_CHAT_ERROR:"USER_RULES_GET_FOR_CHAT_ERROR",ORG_RULES_LIST_ERROR:"ORG_RULES_LIST_ERROR",ORG_RULES_GET_ERROR:"ORG_RULES_GET_ERROR",ORG_RULES_PUBLISH_ERROR:"ORG_RULES_PUBLISH_ERROR",ORG_RULES_OVERRIDE_ERROR:"ORG_RULES_OVERRIDE_ERROR",ORG_RULES_DELETE_ERROR:"ORG_RULES_DELETE_ERROR",ORG_RULES_USE_ERROR:"ORG_RULES_USE_ERROR",ORG_COMMANDS_LIST_ERROR:"ORG_COMMANDS_LIST_ERROR",ORG_COMMANDS_GET_ERROR:"ORG_COMMANDS_GET_ERROR",ORG_COMMANDS_PUBLISH_ERROR:"ORG_COMMANDS_PUBLISH_ERROR",ORG_COMMANDS_OVERRIDE_ERROR:"ORG_COMMANDS_OVERRIDE_ERROR",ORG_COMMANDS_DELETE_ERROR:"ORG_COMMANDS_DELETE_ERROR",ORG_COMMANDS_USE_ERROR:"ORG_COMMANDS_USE_ERROR",THREAD_FILE_HISTORY_MANAGER_ERROR:"THREAD_FILE_HISTORY_MANAGER_ERROR",THREAD_FILE_HISTORY_CONTENT_NOT_FOUND:"THREAD_FILE_HISTORY_CONTENT_NOT_FOUND",FILE_NOT_FOUND_IN_WORKSPACE:"FILE_NOT_FOUND_IN_WORKSPACE",THREAD_FILE_HISTORY_MANAGER_NOT_INITIALIZED:"THREAD_FILE_HISTORY_MANAGER_NOT_INITIALIZED",INVALID_OPERATION:"INVALID_OPERATION",INVALID_ACTION_ON_FILE_HISTORY:"INVALID_ACTION_ON_FILE_HISTORY",FILE_WATCHER_SETUP_ERROR:"FILE_WATCHER_SETUP_ERROR",FILE_WATCHER_CREATE_ERROR:"FILE_WATCHER_CREATE_ERROR",FILE_WATCHER_CLEANUP_ERROR:"FILE_WATCHER_CLEANUP_ERROR",FILE_WATCHER_REFRESH_ERROR:"FILE_WATCHER_REFRESH_ERROR",FILE_HISTORY_ADD_OPERATION_ERROR:"FILE_HISTORY_ADD_OPERATION_ERROR",FILE_HISTORY_DELETE_OPERATION_ERROR:"FILE_HISTORY_DELETE_OPERATION_ERROR",FILE_HISTORY_RESTORE_ERROR:"FILE_HISTORY_RESTORE_ERROR",FILE_HISTORY_ACCEPT_ERROR:"FILE_HISTORY_ACCEPT_ERROR",FILE_HISTORY_REJECT_ERROR:"FILE_HISTORY_REJECT_ERROR",FILE_HISTORY_OPEN_ERROR:"FILE_HISTORY_OPEN_ERROR",FILE_CHANGE_HANDLER_ERROR:"FILE_CHANGE_HANDLER_ERROR",FILE_RESTORATION_ERROR:"FILE_RESTORATION_ERROR",WORKSPACE_ROOT_NOT_FOUND:"WORKSPACE_ROOT_NOT_FOUND",FILE_HISTORY_SAVE_ERROR:"FILE_HISTORY_SAVE_ERROR",FILE_HISTORY_INITIALIZATION_ERROR:"FILE_HISTORY_INITIALIZATION_ERROR",NO_OUTGOING_MESSAGE_TIMESTAMP_FOUND:"NO_OUTGOING_MESSAGE_TIMESTAMP_FOUND",USER_DRAFT_CLEAR_ERROR:"USER_DRAFT_CLEAR_ERROR",USER_DRAFT_SAVE_ERROR:"USER_DRAFT_SAVE_ERROR",USER_DRAFT_GET_ERROR:"USER_DRAFT_GET_ERROR",FIRST_TURN_MESSAGE_CLEAR_ERROR:"FIRST_TURN_MESSAGE_CLEAR_ERROR",MENTION_PICKER_HOST_ERROR:"MENTION_PICKER_HOST_ERROR",TOOL_USE_FILE_OPEN_ERROR:"TOOL_USE_FILE_OPEN_ERROR",TOOL_USE_FILE_HISTORY_ADD_ERROR:"TOOL_USE_FILE_HISTORY_ADD_ERROR",TOOL_USE_FILE_HISTORY_ROLLBACK_ERROR:"TOOL_USE_FILE_HISTORY_ROLLBACK_ERROR",TOOL_USE_EXECUTION_ERROR:"TOOL_USE_EXECUTION_ERROR",TOOL_USE_PROCESSING_ERROR:"TOOL_USE_PROCESSING_ERROR",TOOL_USE_INVALID_SOURCE:"TOOL_USE_INVALID_SOURCE",TOOL_USE_SPILLOVER_UNRESOLVED:"TOOL_USE_SPILLOVER_UNRESOLVED",AGENT_RESULT_ENVELOPE_UNRESOLVED:"AGENT_RESULT_ENVELOPE_UNRESOLVED",NON_BLOCKING_TOOL_EXECUTED:"NON_BLOCKING_TOOL_EXECUTED",BLOCKING_TOOL_TIMEOUT:"BLOCKING_TOOL_TIMEOUT",BLOCKING_TOOL_STOPPED:"BLOCKING_TOOL_STOPPED",DISPLAY_FORM_CLOSED:"DISPLAY_FORM_CLOSED",FILESET_FETCH_HISTORY_ERROR:"FILESET_FETCH_HISTORY_ERROR",FILESET_KEEP_HISTORY_ERROR:"FILESET_KEEP_HISTORY_ERROR",FILESET_REJECT_HISTORY_ERROR:"FILESET_REJECT_HISTORY_ERROR",FILESET_FILE_OPEN_ERROR:"FILESET_FILE_OPEN_ERROR",FILESET_GET_FILE_HISTORY_ERROR:"FILESET_GET_FILE_HISTORY_ERROR",FILESET_ACCEPT_FILE_ERROR:"FILESET_ACCEPT_FILE_ERROR",FILESET_REJECT_FILE_ERROR:"FILESET_REJECT_FILE_ERROR",TOOL_EXECUTION_ERROR:"TOOL_EXECUTION_ERROR",...KO,GET_FEATURE_FLAG_ERROR:"GET_FEATURE_FLAG_ERROR",GET_ACTIVATION_CARD_ERROR:"GET_ACTIVATION_CARD_ERROR",KOMBAI_SUGGESTED_SETTINGS_FETCH_ERROR:"KOMBAI_SUGGESTED_SETTINGS_FETCH_ERROR",AI_SUGGESTED_SETTINGS_FETCH_ERROR:"AI_SUGGESTED_SETTINGS_FETCH_ERROR",BROWSER_STATE_VALIDATION_ERROR:"BROWSER_STATE_VALIDATION_ERROR",BROWSER_SERVER_NOT_FOUND:"BROWSER_SERVER_NOT_FOUND",FETCH_RECENTLY_ACCESSED_FILES_ERROR:"FETCH_RECENTLY_ACCESSED_FILES_ERROR",FETCH_LATEST_SESSION_THREAD_ID_ERROR:"FETCH_LATEST_SESSION_THREAD_ID_ERROR",ATTACHMENT_ERROR:"ATTACHMENT_ERROR",FAILED_TO_GET_SLASH_COMMAND_PROMPTS_DIRECTORY:"FAILED_TO_GET_SLASH_COMMAND_PROMPTS_DIRECTORY",SLASH_COMMAND_NOT_FOUND:"SLASH_COMMAND_NOT_FOUND",PARSE_LEGACY_COMMAND_DIRS_ERROR:"PARSE_LEGACY_COMMAND_DIRS_ERROR",OPEN_FILE_AFTER_CREATE_ERROR:"OPEN_FILE_AFTER_CREATE_ERROR",SETTINGS_ITEMS_LIST_ERROR:"SETTINGS_ITEMS_LIST_ERROR",SETTINGS_ITEMS_REQUEST_ERROR:"SETTINGS_ITEMS_REQUEST_ERROR",BROWSER_CLEAR_CACHE_DATA_FOR_LLM_ERROR:"BROWSER_CLEAR_CACHE_DATA_FOR_LLM_ERROR",FILE_PREVIEW_ERROR:"FILE_PREVIEW_ERROR",TERMINAL_TOOL_EXECUTION_ERROR:"TERMINAL_TOOL_EXECUTION_ERROR",BROWSER_DATA_UPLOAD_ERROR:"BROWSER_DATA_UPLOAD_ERROR",VSCODE_URI_PARSE_ERROR:"VSCODE_URI_PARSE_ERROR",MERMAID_RENDER_ERROR:"MERMAID_RENDER_ERROR",REFERRAL_UNKNOWN_ERROR:"REFERRAL_UNKNOWN_ERROR",REFERRAL_RESPONSE_VALIDATION_ERROR:"REFERRAL_RESPONSE_VALIDATION_ERROR",REFERRAL_GENERATE_CODE_ERROR:"REFERRAL_GENERATE_CODE_ERROR",REFERRAL_GENERATE_CODE_IPC_ERROR:"REFERRAL_GENERATE_CODE_IPC_ERROR",REFERRAL_UNEXPECTED_NOT_PAID_USER:"REFERRAL_UNEXPECTED_NOT_PAID_USER",REFERRAL_UNEXPECTED_TEAM_PLAN_USER:"REFERRAL_UNEXPECTED_TEAM_PLAN_USER",REFERRAL_REFEREE_STATUS_UNEXPECTED:"REFERRAL_REFEREE_STATUS_UNEXPECTED",REFERRAL_REFEREE_STATUS_FETCH_FAILED:"REFERRAL_REFEREE_STATUS_FETCH_FAILED",PAYMENT_LINK_RESPONSE_VALIDATION_ERROR:"PAYMENT_LINK_RESPONSE_VALIDATION_ERROR",SUBSCRIPTION_SCHEDULE_DOWNGRADE_ERROR:"SUBSCRIPTION_SCHEDULE_DOWNGRADE_ERROR",SUBSCRIPTION_CANCEL_SCHEDULED_DOWNGRADE_ERROR:"SUBSCRIPTION_CANCEL_SCHEDULED_DOWNGRADE_ERROR",SUBSCRIPTION_CANCEL_AT_PERIOD_END_ERROR:"SUBSCRIPTION_CANCEL_AT_PERIOD_END_ERROR",PLAN_FEATURE_MARKUP_UNPARSED:"PLAN_FEATURE_MARKUP_UNPARSED",PAYMENT_STRIPE_JS_LOAD_FAILED:"PAYMENT_STRIPE_JS_LOAD_FAILED",PAYMENT_CHALLENGE_THREW:"PAYMENT_CHALLENGE_THREW",PAYMENT_CHALLENGE_INCOMPLETE:"PAYMENT_CHALLENGE_INCOMPLETE",PAYMENT_CHALLENGE_ORPHANED_SUCCESS:"PAYMENT_CHALLENGE_ORPHANED_SUCCESS",PAYMENT_REQUEST_THREW:"PAYMENT_REQUEST_THREW",PAYMENT_ATTEMPT_ORPHANED:"PAYMENT_ATTEMPT_ORPHANED",PAYMENT_OUTCOME_UNHANDLED:"PAYMENT_OUTCOME_UNHANDLED",PAYMENT_CART_CHANGED_WHILE_CHARGING:"PAYMENT_CART_CHANGED_WHILE_CHARGING",PAYMENT_SETTLEMENT_UNCONFIRMED:"PAYMENT_SETTLEMENT_UNCONFIRMED",PAYMENT_SETTLEMENT_BACKSTOP_FIRED:"PAYMENT_SETTLEMENT_BACKSTOP_FIRED",PAYMENT_EMPTY_CART_SUBMIT:"PAYMENT_EMPTY_CART_SUBMIT",PAYMENT_NO_PLAN_SELECTED:"PAYMENT_NO_PLAN_SELECTED",PAYMENT_SEED_PLAN_UNRESOLVED:"PAYMENT_SEED_PLAN_UNRESOLVED",PAYMENT_CONFIRM_STEP_WITHOUT_CARDS:"PAYMENT_CONFIRM_STEP_WITHOUT_CARDS",PAYMENT_CONFIRM_CARD_WITHOUT_ORDER:"PAYMENT_CONFIRM_CARD_WITHOUT_ORDER",PAYMENT_ENVELOPE_OUTCOME_UNRECOGNISED:"PAYMENT_ENVELOPE_OUTCOME_UNRECOGNISED",PAYMENT_ATTEMPT_FAILED:"PAYMENT_ATTEMPT_FAILED",EXCALIDRAW_PNG_CREATION_ERROR:"EXCALIDRAW_PNG_CREATION_ERROR",SKILLS_SCAN_ERROR:"SKILLS_SCAN_ERROR",MCP_SERVER_CONFIG_ERROR:"MCP_SERVER_CONFIG_ERROR",MCP_WRITE_TOOLS_TO_DISK_ERROR:"MCP_WRITE_TOOLS_TO_DISK_ERROR",MCP_LIST_TOOLS_ERROR:"MCP_LIST_TOOLS_ERROR",MCP_LIST_RESOURCES_ERROR:"MCP_LIST_RESOURCES_ERROR",MCP_CLEAR_JSON_FILES_ERROR:"MCP_CLEAR_JSON_FILES_ERROR",MCP_DELETE_SERVER_CONFIG_FILE_ERROR:"MCP_DELETE_SERVER_CONFIG_FILE_ERROR",MCP_SERVER_RUNTIME_ERROR:"MCP_SERVER_RUNTIME_ERROR",MCP_WORKER_ERROR:"MCP_WORKER_ERROR",MCP_HOST_REQUEST_ERROR:"MCP_HOST_REQUEST_ERROR",MCP_TOOL_CALL_ERROR:"MCP_TOOL_CALL_ERROR",MCP_RESOURCE_READ_ERROR:"MCP_RESOURCE_READ_ERROR",MCP_EXTERNAL_CALL_ERROR:"MCP_EXTERNAL_CALL_ERROR",ENHANCE_PROMPT_UNKNOWN_TOKEN:"ENHANCE_PROMPT_UNKNOWN_TOKEN",ENHANCE_PROMPT_DUPLICATE_KEY_CONFLICT:"ENHANCE_PROMPT_DUPLICATE_KEY_CONFLICT",ENHANCE_PROMPT_UNKNOWN_NODE_TYPE:"ENHANCE_PROMPT_UNKNOWN_NODE_TYPE",ENHANCE_PROMPT_VALIDATION_ERROR:"ENHANCE_PROMPT_VALIDATION_ERROR",ENHANCE_PROMPT_CORE_ERROR:"ENHANCE_PROMPT_CORE_ERROR",ENHANCE_PROMPT_REQUEST_FAILED:"ENHANCE_PROMPT_REQUEST_FAILED",ENHANCE_PROMPT_INPUT_TOO_LONG:"ENHANCE_PROMPT_INPUT_TOO_LONG",CANVAS_TOOL_UNKNOWN_TOOL:"CANVAS_TOOL_UNKNOWN_TOOL",LEARN_SANITY_UNREACHABLE:"LEARN_SANITY_UNREACHABLE",LEARN_SANITY_PLAN_LIMIT_REACHED:"LEARN_SANITY_PLAN_LIMIT_REACHED",LEARN_SANITY_HTTP_ERROR:"LEARN_SANITY_HTTP_ERROR",LEARN_SANITY_MALFORMED_RESPONSE:"LEARN_SANITY_MALFORMED_RESPONSE",LEARN_SANITY_RESULT_UNPARSEABLE:"LEARN_SANITY_RESULT_UNPARSEABLE",LEARN_GUIDE_UNRENDERABLE:"LEARN_GUIDE_UNRENDERABLE",LOCAL_CACHE_WRITE_ERROR:"LOCAL_CACHE_WRITE_ERROR",LOCAL_CACHE_READ_ERROR:"LOCAL_CACHE_READ_ERROR",LOCAL_CACHE_INIT_ERROR:"LOCAL_CACHE_INIT_ERROR"},KSe=new Set([R4.SOCKET_REJECTING_WAITING_REQUEST,R4.SOCKET_MAX_RETRIES,R4.SOCKET_TIMEOUT,R4.SOCKET_CONNECTION_ERROR]);var dv=class extends Error{constructor(r,a,o,n){super(`${r} ${a}`);Vn(this,"errorCode");Vn(this,"details");o&&(this.cause=o),this.errorCode=r,this.details=n||{}}};var p9=class extends dv{constructor(r,a,o,n){super(r,a,o);Vn(this,"extraInfo");this.name="WebviewError",this.extraInfo=n}};var fv="var(--vscode-charts-green, #3FE38B)",YO="var(--vscode-errorForeground, #f47067)",Tr=K5`
|
|
2683
2683
|
font-family: var(--vscode-editor-font-family, ui-monospace, monospace);
|
|
2684
2684
|
font-feature-settings: 'tnum';
|
|
2685
2685
|
`;var aA=E(H());var LY=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded"]);function pv(e){return LY.has(e.trim().toLowerCase())}function m9(e){return e?pv(e.family)?e.family.toLowerCase():`${JSON.stringify(e.family)}, sans-serif`:"inherit"}function mv(e){let t=e.filter(r=>!/\balternative\b|\boption\b/i.test(r.role));return{heading:t.find(r=>/\bhead(?:ing|line)|\btitle|\bdisplay/i.test(r.role)),body:t.find(r=>/\bbody\b|\bparagraph/i.test(r.role))}}function XO(e){return`${e.patterns.length} AI-slop pattern${e.patterns.length===1?"":"s"}`}function JO(e){let t=e.directions[0].sections;return e.directions.every(r=>r.sections.length===t.length&&r.sections.every((a,o)=>a===t[o]))?t:[]}function $2(e,t){let r=new Map;return e.map(a=>{let o=t(a),n=r.get(o)??0;return r.set(o,n+1),{key:JSON.stringify([o,n]),item:a}})}var tA=E(H());var xY="https://fonts.googleapis.com";var eA=`${xY}/css2`;var g9=new Map;function SY(e){let t=g9.get(e);if(!t){let r=document.createElement("link");r.rel="stylesheet",r.href=`${eA}?family=${encodeURIComponent(e)}:wght@400;600&display=swap`,r.dataset.designBriefFont=e,r.addEventListener("error",()=>S1(new Error(`Design brief font stylesheet failed: ${e}`)),{once:!0}),document.head.appendChild(r),t={link:r,users:0},g9.set(e,t)}return t.users+=1,()=>{let r=g9.get(e);r&&(r.users-=1,r.users===0&&(r.link.remove(),g9.delete(e)))}}function h9(e){let t=[...new Set(e.filter(r=>!pv(r)))].sort().map(encodeURIComponent).join("|");(0,tA.useEffect)(()=>{let r=t?t.split("|").map(a=>SY(decodeURIComponent(a))):[];return()=>r.forEach(a=>a())},[t])}var v9=E(H());var w6=E(H());var rA=E(Gt());function gv(e){let t=g8(),{overlayStyle:r,overlayInnerStyle:a,destroyTooltipOnHide:o,styles:n,arrow:s,open:i,onOpenChange:l,...Q}=e,c=Q.title!==void 0&&Q.title!==null&&Q.title!=="",[u,d]=(0,w6.useState)(!1),[f,g]=(0,w6.useState)(!1),h=i!==void 0,y=u&&!f;return(0,w6.useEffect)(()=>{if(h||!y)return;let m=()=>g(!0);return document.addEventListener("pointerdown",m,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",m,!0),document.removeEventListener("keydown",m,!0)}},[h,y]),(0,rA.jsx)(ir,{arrow:s??!1,destroyOnHidden:o??!0,color:t.colors.background.editorHoverWidgetBackground,...Q,open:h?i:y&&c,onOpenChange:m=>{d(m),g(!1),l?.(m)},styles:{...n,root:{...r,...n?.root},body:{color:t.colors.foreground.editorHoverWidgetForeground,border:`1px solid ${t.colors.borderColors.editorHoverWidgetBorder}`,fontSize:"var(--font-size-primary)",lineHeight:"18px",padding:"6px 10px",borderRadius:8,...a,...n?.body}}})}var ft=E(Gt()),V4=U.div`
|